@@ -6,15 +6,19 @@ source $(dirname $0)/lib.sh
66
77req_env_var USER HOME GOSRC SCRIPT_BASE SETUP_MARKER_FILEPATH
88
9- show_env_vars
10-
119# Ensure this script only executes successfully once and always logs ending timestamp
12- [[ ! -e " $SETUP_MARKER_FILEPATH " ]] || exit 0
10+ if [[ -e " $SETUP_MARKER_FILEPATH " ]]; then
11+ show_env_vars
12+ exit 0
13+ fi
14+
1315exithandler () {
1416 RET=$?
1517 echo " ."
1618 echo " $( basename $0 ) exit status: $RET "
1719 [[ " $RET " -eq " 0" ]] && date +%s >> " $SETUP_MARKER_FILEPATH "
20+ show_env_vars
21+ [ " $RET " -eq " 0" ]] || warn " Non-zero exit caused by error ABOVE env. var. display."
1822}
1923trap exithandler EXIT
2024
@@ -46,42 +50,59 @@ case "${OS_RELEASE_ID}" in
4650 # All SELinux distros need this for systemd-in-a-container
4751 setsebool container_manage_cgroup true
4852 if [[ " $ADD_SECOND_PARTITION " == " true" ]]; then
49- bash " $SCRIPT_BASE /add_second_partition.sh" ; fi
53+ bash " $SCRIPT_BASE /add_second_partition.sh"
54+ fi
5055
51- if [[ " $OS_RELEASE_VER " == " 31" ]]; then
52- warn " Switching io schedular to deadline to avoid RHBZ 1767539"
53- warn " aka https://bugzilla.kernel.org/show_bug.cgi?id=205447"
54- echo " mq-deadline" > /sys/block/sda/queue/scheduler
55- cat /sys/block/sda/queue/scheduler
56+ warn " Switching io scheduler to 'deadline' to avoid RHBZ 1767539"
57+ warn " aka https://bugzilla.kernel.org/show_bug.cgi?id=205447"
58+ echo " mq-deadline" > /sys/block/sda/queue/scheduler
59+ cat /sys/block/sda/queue/scheduler
5660
57- warn " Forcing systemd cgroup manager"
58- X=$( echo " export CGROUP_MANAGER=systemd" | \
59- tee -a /etc/environment) && eval " $X " && echo " $X "
61+ warn " Forcing systemd cgroup manager"
62+ X=$( echo " export CGROUP_MANAGER=systemd" | \
63+ tee -a /etc/environment) && eval " $X " && echo " $X "
64+ ;;
65+ centos) # Current VM is an image-builder-image no local podman/testing
66+ echo " No further setup required for VM image building"
67+ exit 0
68+ ;;
69+ * ) bad_os_id_ver ;;
70+ esac
6071
61- warn " Testing with crun instead of runc"
62- X=$( echo " export OCI_RUNTIME=/usr/bin/crun" | \
63- tee -a /etc/environment) && eval " $X " && echo " $X "
72+ # Reload to incorporate any changes from above
73+ source " $SCRIPT_BASE /lib.sh"
74+
75+ case " $CG_FS_TYPE " in
76+ tmpfs)
77+ warn " Forcing testing with runc instead of crun"
78+ X=$( echo " export OCI_RUNTIME=/usr/bin/runc" | \
79+ tee -a /etc/environment) && eval " $X " && echo " $X "
80+ ;;
81+ cgroup2fs)
82+ # This is necessary since we've built/installed from source, which uses runc as the default.
83+ warn " Forcing testing with crun instead of runc"
84+ X=$( echo " export OCI_RUNTIME=/usr/bin/crun" | \
85+ tee -a /etc/environment) && eval " $X " && echo " $X "
86+
87+ if [[ " $MOD_LIBPOD_CONF " == " true" ]]; then
88+ warn " Updating runtime setting in repo. copy of libpod.conf"
89+ sed -i -r -e ' s/^runtime = "runc"/runtime = "crun"/' $GOSRC /libpod.conf
90+ git diff $GOSRC /libpod.conf
91+ fi
6492
93+ if [[ " $OS_RELEASE_ID " == " fedora" ]]; then
6594 warn " Upgrading to the latest crun"
6695 # Normally not something to do for stable testing
6796 # but crun is new, and late-breaking fixes may be required
6897 # on short notice
6998 dnf update -y crun
70-
71- # warn "Setting SELinux into Permissive mode"
72- # setenforce 0
7399 fi
74100 ;;
75- centos) # Current VM is an image-builder-image no local podman/testing
76- echo " No further setup required for VM image building"
77- exit 0
101+ * )
102+ die 110 " Unsure how to handle cgroup filesystem type '$CG_FS_TYPE '"
78103 ;;
79- * ) bad_os_id_ver ;;
80104esac
81105
82- # Reload to incorporate any changes from above
83- source " $SCRIPT_BASE /lib.sh"
84-
85106# Must execute before possible setup_rootless()
86107make install.tools
87108
0 commit comments