Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
c43f6ed
Move optional steps for testing VMs out of README.md file
jafingerhut Oct 16, 2024
459987f
Merge branch 'master' of github.com:jafingerhut/tutorials
jafingerhut Oct 25, 2024
5f69ce2
Merge branch 'master' of https://github.com/p4lang/tutorials
jafingerhut Oct 31, 2024
fcdf6d2
Merge remote-tracking branch 'upstream/master'
jafingerhut Nov 3, 2024
27310d1
Merge branch 'master' of https://github.com/p4lang/tutorials
jafingerhut Nov 7, 2024
51d5317
Merge remote-tracking branch 'upstream/master'
jafingerhut Nov 13, 2024
0054e7b
Merge branch 'master' of https://github.com/p4lang/tutorials
jafingerhut Dec 1, 2024
b8a81f2
Merge branch 'master' of github.com:jafingerhut/tutorials
jafingerhut Dec 1, 2024
1b02938
Merge branch 'master' of https://github.com/p4lang/tutorials
jafingerhut Dec 10, 2024
f574bea
Merge branch 'master' of github.com:jafingerhut/tutorials
jafingerhut Dec 10, 2024
40ac9e0
Merge branch 'master' of https://github.com/p4lang/tutorials
jafingerhut Dec 30, 2024
365a909
Merge branch 'master' of https://github.com/p4lang/tutorials
jafingerhut Dec 30, 2024
e62c95b
Merge branch 'master' of github.com:jafingerhut/tutorials
jafingerhut Dec 30, 2024
0af41fd
Merge remote-tracking branch 'upstream/master'
jafingerhut Dec 30, 2024
d600b63
Merge branch 'master' of https://github.com/p4lang/tutorials
jafingerhut Dec 31, 2024
29fd124
Merge branch 'master' of github.com:jafingerhut/tutorials
jafingerhut Dec 31, 2024
fdd4721
Merge branch 'master' of https://github.com/p4lang/tutorials
jafingerhut Jan 1, 2025
089cbd8
Merge branch 'master' of https://github.com/p4lang/tutorials
jafingerhut Jan 3, 2025
ff1664a
Merge branch 'master' of https://github.com/p4lang/tutorials
jafingerhut Jan 25, 2025
b8c5cab
Merge branch 'master' of github.com:jafingerhut/tutorials
jafingerhut Jan 25, 2025
ff9c994
Merge branch 'master' of https://github.com/p4lang/tutorials
jafingerhut Jan 27, 2025
3224949
Add 2025-Jan-30 versions of source code for install.sh
jafingerhut Jan 30, 2025
9235e50
Merge branch 'master' of https://github.com/p4lang/tutorials
jafingerhut Feb 11, 2025
fe22d96
Merge remote-tracking branch 'upstream/master'
jafingerhut Feb 28, 2025
2f66fc9
Merge branch 'master' of github.com:jafingerhut/tutorials
jafingerhut Feb 28, 2025
82856d1
Merge remote-tracking branch 'upstream/master'
jafingerhut Mar 2, 2025
dcb3d72
Merge remote-tracking branch 'upstream/master'
jafingerhut Apr 1, 2025
2bb59c9
Merge remote-tracking branch 'up/master'
jafingerhut Apr 21, 2025
7f076ba
Merge remote-tracking branch 'up/master'
jafingerhut Apr 21, 2025
4e1408f
Merge remote-tracking branch 'up/master'
jafingerhut May 1, 2025
cdceaab
Merge branch 'master' of github.com:jafingerhut/tutorials
jafingerhut May 1, 2025
aa0e580
Merge remote-tracking branch 'up/master'
jafingerhut May 13, 2025
745f2bd
Merge branch 'master' of github.com:jafingerhut/tutorials
jafingerhut May 13, 2025
7b68640
Merge branch 'master' of github.com:jafingerhut/tutorials
jafingerhut Jun 1, 2025
21aca3b
Merge remote-tracking branch 'upstream/master'
jafingerhut Jun 1, 2025
72c2c09
Merge remote-tracking branch 'up/master'
jafingerhut Jul 3, 2025
cb9381d
Merge remote-tracking branch 'up/master'
jafingerhut Jul 5, 2025
70c4cd8
Merge branch 'master' of github.com:jafingerhut/tutorials
jafingerhut Aug 1, 2025
b71ef2a
Merge remote-tracking branch 'up/master'
jafingerhut Aug 1, 2025
54b84c2
Merge remote-tracking branch 'up/master'
jafingerhut Sep 1, 2025
471c37a
Merge remote-tracking branch 'up/master'
jafingerhut Oct 1, 2025
cf02788
Merge remote-tracking branch 'up/master'
jafingerhut Nov 1, 2025
143c96d
Merge remote-tracking branch 'up/master'
jafingerhut Nov 14, 2025
573a295
Merge remote-tracking branch 'up/master'
jafingerhut Jan 17, 2026
bd8682a
Merge remote-tracking branch 'up/master'
jafingerhut Jan 23, 2026
488b5d4
Merge branch 'master' of github.com:jafingerhut/tutorials
jafingerhut Jan 23, 2026
6d5bb15
Merge remote-tracking branch 'up/master'
jafingerhut Feb 1, 2026
d9cb2b8
Merge remote-tracking branch 'up/master'
jafingerhut Feb 3, 2026
f562b70
Merge remote-tracking branch 'up/master'
jafingerhut Feb 21, 2026
9f2940c
Merge remote-tracking branch 'up/master'
jafingerhut Feb 21, 2026
61e3320
Merge remote-tracking branch 'up/master'
jafingerhut Mar 1, 2026
7b5d789
Merge remote-tracking branch 'upstream/master'
jafingerhut Mar 1, 2026
be8157e
Merge branch 'master' of github.com:jafingerhut/tutorials
jafingerhut Aug 1, 2026
02aace1
Merge remote-tracking branch 'up/master'
jafingerhut Aug 1, 2026
01686ba
Merge remote-tracking branch 'up/master'
jafingerhut Aug 5, 2026
6c0f979
Merge remote-tracking branch 'up/master'
jafingerhut Sep 1, 2026
2b94c35
Merge remote-tracking branch 'up/master'
jafingerhut Sep 4, 2026
df05df7
Merge remote-tracking branch 'up/master'
jafingerhut Oct 6, 2026
186e065
Add install script for Ubuntu 26.04
jafingerhut Oct 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions vm-ubuntu-24.04/clean.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#! /bin/bash

# SPDX-FileCopyrightText: 2024 Andy Fingerhut
# Copyright 2024 Andy Fingerhut
#
# SPDX-License-Identifier: Apache-2.0

Expand Down
17 changes: 1 addition & 16 deletions vm-ubuntu-24.04/config-gnome-settings.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
#! /bin/bash

# SPDX-FileCopyrightText: 2025 Andy Fingerhut
# Copyright 2025 Andy Fingerhut
#
# SPDX-License-Identifier: Apache-2.0

######################################################################
# Copyright 2024 Andy Fingerhut
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
######################################################################

# Customize some GNOME desktop settings that I prefer.

# This command will show the GNOME version number installed/running on
Expand Down
15 changes: 1 addition & 14 deletions vm-ubuntu-24.04/install-debug-utils.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
#! /bin/bash

# SPDX-FileCopyrightText: 2024 Andy Fingerhut
#
# SPDX-License-Identifier: Apache-2.0

# Copyright 2024 Andy Fingerhut

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0

# Various packages that are useful when running exercises
# in the p4lang/tutorials repo.
Expand Down
16 changes: 1 addition & 15 deletions vm-ubuntu-24.04/install-p4dev-v8.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
#! /bin/bash

# SPDX-FileCopyrightText: 2024 Andy Fingerhut
# Copyright 2024 Andy Fingerhut
#
# SPDX-License-Identifier: Apache-2.0

# Copyright 2022-present Intel Corporation

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


# This script differs from install-p4dev-v6.sh as follows:

# * Installs all Python3 packages into a virtual environment created
Expand Down
15 changes: 1 addition & 14 deletions vm-ubuntu-24.04/install.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
#! /bin/bash

# SPDX-FileCopyrightText: 2024 Andy Fingerhut
#
# SPDX-License-Identifier: Apache-2.0

# Copyright 2024 Andy Fingerhut

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0

# Remember the current directory when the script was started:
INSTALL_DIR="${PWD}"
Expand Down
15 changes: 1 addition & 14 deletions vm-ubuntu-24.04/p4-environment-info.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
#! /bin/bash

# SPDX-FileCopyrightText: 2024 Andy Fingerhut
#
# SPDX-License-Identifier: Apache-2.0

# Copyright 2024 Andy Fingerhut

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0

get_package_info() {
local pkg="$1"
Expand Down
15 changes: 1 addition & 14 deletions vm-ubuntu-24.04/setup-emacs.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
#! /bin/bash

# SPDX-FileCopyrightText: 2024 Andy Fingerhut
#
# SPDX-License-Identifier: Apache-2.0

# Copyright 2024 Andy Fingerhut

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0

# Remember the current directory when the script was started:
INSTALL_DIR="${PWD}"
Expand Down
15 changes: 1 addition & 14 deletions vm-ubuntu-24.04/setup-vim.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
#! /bin/bash

# SPDX-FileCopyrightText: 2024 Andy Fingerhut
#
# SPDX-License-Identifier: Apache-2.0

# Copyright 2024 Andy Fingerhut

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0

# Remember the current directory when the script was started:
INSTALL_DIR="${PWD}"
Expand Down
15 changes: 1 addition & 14 deletions vm-ubuntu-24.04/user-bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
#!/bin/bash

# SPDX-FileCopyrightText: 2024 Andy Fingerhut
#
# SPDX-License-Identifier: Apache-2.0

# Copyright 2024 Andy Fingerhut

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# SPDX-License-Identifier: Apache-2.0

# Remember the current directory when the script was started:
INSTALL_DIR="${PWD}"
Expand Down
50 changes: 50 additions & 0 deletions vm-ubuntu-26.04/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#! /bin/bash

# SPDX-FileCopyrightText: 2024 Andy Fingerhut
# Copyright 2024 Andy Fingerhut
#
# SPDX-License-Identifier: Apache-2.0

# To reduce disk space used by the virtual machine, delete many build
# files created during execution of install scripts.

# This script is _not_ automatically run during creation of the VM, so
# that if anything goes wrong during the build, all of the resulting
# files are left behind for examination.

DF1_BEFORE=`df -h .`
DF2_BEFORE=`df -BM .`

# Remove protobuf and grpc sources completely, since they are large
# and easily downloadable.
/bin/rm -fr protobuf grpc

cd behavioral-model
make clean
cd ..

cd p4c
/bin/rm -fr build
cd ..

/bin/rm usr-local-*.txt pip3-list-2b-*.txt $HOME/.ssh/*

sudo apt autoremove
sudo apt clean

# Zero out unused disk blocks. Results in significantly smaller VM
# image files.

echo "Writing zeros to unused disk blocks (be patient) ..."
FNAME="/bigemptyfile"
sudo dd if=/dev/zero | sudo dd of=${FNAME} bs=4096k
sudo /bin/rm -f ${FNAME}

echo "Disk usage before running this script:"
echo "$DF1_BEFORE"
echo "$DF2_BEFORE"

echo ""
echo "Disk usage after running this script:"
df -h .
df -BM .
115 changes: 115 additions & 0 deletions vm-ubuntu-26.04/config-gnome-settings.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
#! /bin/bash

# SPDX-FileCopyrightText: 2025 Andy Fingerhut
# Copyright 2025 Andy Fingerhut
#
# SPDX-License-Identifier: Apache-2.0

# Customize some GNOME desktop settings that I prefer.

# This command will show the GNOME version number installed/running on
# the system:
# gnome-shell --version
# The output on all versions I checked was of the form:
# GNOME Shell <dotted decimal version string>

# This command can be used to see what names that the version of GNOME
# installed on a system uses for the applications that have been
# pinned in the Dash:
# gsettings get org.gnome.shell favorite-apps

which gnome-shell > /dev/null
exit_status=$?
if [ ${exit_status} -ne 0 ]
then
1>&2 echo "No command 'gnome-shell' found in command path."
1>&2 echo "Does this system have GNOME installed? Aborting."
exit 1
fi

which gsettings > /dev/null
exit_status=$?
if [ ${exit_status} -ne 0 ]
then
1>&2 echo "No command 'gsettings' found in command path."
1>&2 echo "Does this system have GNOME installed? Aborting."
exit 1
fi

GNOME_VERSION_STR=`gnome-shell --version | awk '{print $3;}'`

TERMINAL_NAME="org.gnome.Terminal.desktop"
NAUTILUS_NAME="org.gnome.Nautilus.desktop"
UPDATE_MANAGER_NAME="update-manager.desktop"
HELP_NAME="yelp.desktop"

supported_version=0
case ${GNOME_VERSION_STR} in
3.36.9)
# I have seen GNOME version 3.36.9 installed on systems running:
# Ubuntu 20.04
supported_version=1
FIREFOX_NAME="firefox.desktop"
SETTINGS_NAME="gnome-control-center.desktop"
;;
42.9)
# I have seen GNOME version 42.9 installed on systems running:
# Ubuntu 22.04
supported_version=1
FIREFOX_NAME="firefox_firefox.desktop"
SETTINGS_NAME="gnome-control-center.desktop"
;;
46.0|47.0)
# I have seen GNOME version 46.0 installed on systems running:
# Ubuntu 24.04
# I have seen GNOME version 47.0 installed on systems running:
# Ubuntu 24.10
supported_version=1
FIREFOX_NAME="firefox_firefox.desktop"
SETTINGS_NAME="org.gnome.Settings.desktop"
;;
esac

if [ ${supported_version} -eq 1 ]
then
echo "Found supported GNOME version ${GNOME_VERSION_STR} installed."
else
1>&2 echo "Found GNOME version ${GNOME_VERSION_STR} installed, but"
1>&2 echo "this script does not support that version of GNOME."
1>&2 echo "Consider updating the script so it does."
exit 1
fi

set -x
# Update GNOME settings via the following corresponding gsettings
# commands.

# This command has the same effect as doing this in Settings app
# in Ubuntu 24.04:
# Privacy & Security -> Screen Lock -> Blank Screen Delay -> Never
gsettings set org.gnome.desktop.session idle-delay 0

# Privacy & Security -> Screen Lock -> Automatic Screen Lock -> disabled
gsettings set org.gnome.desktop.screensaver lock-enabled false

# Ubuntu Desktop -> Dock -> Icon Size -> 24
gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 24

# Update the list of icons pinned in the Dash:
gsettings set org.gnome.shell favorite-apps "['${TERMINAL_NAME}', '${FIREFOX_NAME}', '${NAUTILUS_NAME}', '${SETTINGS_NAME}', '${UPDATE_MANAGER_NAME}', '${HELP_NAME}']"

# System -> Users -> user account "p4" -> Automatic Login -> enabled
# Changing this does not change the output of the command:
# gsettings list-recursively
# It must modify something on the system elsewhere.
# I learned that it causes a line like the following in file
# /etc/gdm3/custom.conf to have the value after the = change from False to True:
#AutomaticLoginEnable=False
# This line is in a section labeled [daemon].
# It also causes this line to be created, or its value modified,
# to the user account name:
#AutomaticLogin=p4

# TODO: The best way to change this from a Bash script would be to
# find a well-tested utility program that modifies or adds settings to
# files with that format, which is like a Windows INI format file.
27 changes: 27 additions & 0 deletions vm-ubuntu-26.04/install-debug-utils.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#! /bin/bash

# SPDX-FileCopyrightText: 2024 Andy Fingerhut
# Copyright 2024 Andy Fingerhut
#
# SPDX-License-Identifier: Apache-2.0

# Various packages that are useful when running exercises
# in the p4lang/tutorials repo.

sudo apt-get install -y \
ca-certificates \
iproute2 \
libpcap-dev \
tcpdump \
wget \
xterm \
xcscope-el

# Install Wireshark and tshark on Ubuntu system without having to
# answer _any_ questions interactively, except perhaps providing your
# password when prompted by 'sudo'.

# https://askubuntu.com/questions/1275842/install-wireshark-without-confirm

echo "wireshark-common wireshark-common/install-setuid boolean true" | sudo debconf-set-selections
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install wireshark tshark
Loading
Loading