diff --git a/agent/bootstrap-alt.sh b/agent/bootstrap-alt.sh index d8d51d28..6abb9fa9 100755 --- a/agent/bootstrap-alt.sh +++ b/agent/bootstrap-alt.sh @@ -149,9 +149,6 @@ if alternatives --display nmap; then alternatives --display nmap fi -# Pin kernel to 4.18.0-521.el8 -dnf install -y kernel-4.18.0-521.el8 - # Fetch the upstream systemd repo test -e systemd && rm -rf systemd git clone "$REPO_URL" systemd @@ -251,9 +248,6 @@ Name=eth0 Unmanaged=yes EOF -# FIXME -grubby --set-default "/boot/vmlinuz-4.18.0-521.el8.ppc64le" - # Reboot the machine here to switch to the latest kernel if available echo "-----------------------------" echo "- REBOOT THE MACHINE BEFORE -" diff --git a/agent/bootstrap-rhel8.sh b/agent/bootstrap-rhel8.sh index 40433e4b..bee9cbb3 100755 --- a/agent/bootstrap-rhel8.sh +++ b/agent/bootstrap-rhel8.sh @@ -90,9 +90,6 @@ if alternatives --display nmap; then alternatives --display nmap fi -# Pin kernel to 4.18.0-521.el8 -dnf install -y kernel-4.18.0-521.el8 - # Fetch the systemd repo test -e systemd && rm -rf systemd git clone "$REPO_URL" systemd @@ -214,6 +211,7 @@ ninja -C build install getent group systemd-resolve &>/dev/null || groupadd -r -g 193 systemd-resolve 2>&1 getent passwd systemd-resolve &>/dev/null || useradd -r -u 193 -l -g systemd-resolve -d / -s /sbin/nologin -c "systemd Resolver" systemd-resolve &>/dev/null +LATEST_KERNEL="$(rpm -q kernel --qf "%{EVR}.%{ARCH}\n" | sort -Vr | head -n1)" # Configure the selected cgroup hierarchy for both the host machine and each # integration test VM if [[ "$CGROUP_HIERARCHY" == unified ]]; then @@ -230,17 +228,15 @@ fi # comments in `testsuite.sh` for the explanation export INITRD="/var/tmp/ci-sanity-initramfs-$(uname -r).img" cp -fv "/boot/initramfs-$(uname -r).img" "$INITRD" - # FIXME - dracut --kver 4.18.0-521.el8.x86_64 -o "multipath rngd" --filesystems ext4 --rebuild "$INITRD" + dracut --kver "$LATEST_KERNEL" -o "multipath rngd" --filesystems ext4 --rebuild "$INITRD" centos_ensure_qemu_symlink ## Configure test environment # Explicitly set paths to initramfs (see above) and kernel images # (for QEMU tests) - # FIXME - export KERNEL_VER="4.18.0-521.el8.x86_64" - export KERNEL_BIN="/boot/vmlinuz-$KERNEL_VER" + export KERNEL_BIN="/boot/vmlinuz-$LATEST_KERNEL" + export KERNEL_VER="$LATEST_KERNEL" # Enable kernel debug output for easier debugging when something goes south export KERNEL_APPEND="debug systemd.log_level=debug rd.systemd.log_target=console $CGROUP_KERNEL_ARGS" # Set timeout for QEMU tests to kill them in case they get stuck @@ -275,9 +271,7 @@ fi echo "Configuring $CGROUP_HIERARCHY cgroup hierarchy using '$CGROUP_KERNEL_ARGS'" # Make sure the latest kernel is the one we're going to boot into -# FIXME -grubby --set-default "/boot/vmlinuz-4.18.0-521.el8.x86_64" -#grubby --set-default "/boot/vmlinuz-$(rpm -q kernel --qf "%{EVR}.%{ARCH}\n" | sort -Vr | head -n1)" +grubby --set-default "/boot/vmlinuz-$LATEST_KERNEL" grubby --args="$CGROUP_KERNEL_ARGS" --update-kernel="$(grubby --default-kernel)" # grub on RHEL 8 uses BLS grep -r "systemd.unified_cgroup_hierarchy" /boot/loader/entries/ diff --git a/agent/bootstrap-rhel9.sh b/agent/bootstrap-rhel9.sh index 65416355..abcc48ad 100755 --- a/agent/bootstrap-rhel9.sh +++ b/agent/bootstrap-rhel9.sh @@ -303,6 +303,7 @@ fi # Install the compiled systemd ninja -C build install +LATEST_KERNEL="$(rpm -q kernel --qf "%{EVR}.%{ARCH}\n" | sort -Vr | head -n1)" # Configure the selected cgroup hierarchy for both the host machine and each # integration test VM if [[ "$CGROUP_HIERARCHY" == unified ]]; then @@ -320,14 +321,15 @@ fi # comments in `testsuite.sh` for the explanation export INITRD="/var/tmp/ci-sanity-initramfs-$(uname -r).img" cp -fv "/boot/initramfs-$(uname -r).img" "$INITRD" - dracut -o "multipath rngd" --filesystems ext4 --rebuild "$INITRD" + dracut --kver "$LATEST_KERNEL" -o "multipath rngd" --filesystems ext4 --rebuild "$INITRD" centos_ensure_qemu_symlink ## Configure test environment # Explicitly set paths to initramfs (see above) and kernel images # (for QEMU tests) - export KERNEL_BIN="/boot/vmlinuz-$(uname -r)" + export KERNEL_BIN="/boot/vmlinuz-$LATEST_KERNEL" + export KERNEL_VER="$LATEST_KERNEL" # Enable kernel debug output for easier debugging when something goes south export KERNEL_APPEND="debug systemd.log_level=debug rd.systemd.log_target=console systemd.default_standard_output=journal+console ${CGROUP_KERNEL_ARGS[*]}" # Set timeout for QEMU tests to kill them in case they get stuck @@ -396,7 +398,7 @@ if grep -q "GRUB_ENABLE_BLSCFG=false" /etc/default/grub; then grub2-mkconfig -o /boot/grub2/grub.cfg fi -grubby --set-default "/boot/vmlinuz-$(rpm -q kernel --qf "%{EVR}.%{ARCH}\n" | sort -Vr | head -n1)" +grubby --set-default "/boot/vmlinuz-$LATEST_KERNEL" grubby --args="${GRUBBY_ARGS[*]}" --update-kernel="$(grubby --default-kernel)" # Check if the $GRUBBY_ARGS were applied correctly for arg in "${GRUBBY_ARGS[@]}"; do diff --git a/agent/bootstrap.sh b/agent/bootstrap.sh index abbbdee1..0e4e61e9 100755 --- a/agent/bootstrap.sh +++ b/agent/bootstrap.sh @@ -145,9 +145,6 @@ fi alternatives --set python /usr/bin/python3.8 alternatives --list -# Pin kernel to 4.18.0-521.el8 -dnf install -y kernel-4.18.0-521.el8 - # Fetch the upstream systemd repo test -e systemd && rm -rf systemd echo "Cloning repo: $REPO_URL" @@ -222,6 +219,7 @@ coredumpctl_set_ts # Install the compiled systemd ninja -C "$BUILD_DIR" install +LATEST_KERNEL="$(rpm -q kernel --qf "%{EVR}.%{ARCH}\n" | sort -Vr | head -n1)" # FIXME: drop once https://github.com/systemd/systemd/pull/27890 lands DRACUT_OPTS=() [[ -x /usr/lib/systemd/systemd-executor ]] && DRACUT_OPTS+=(--install /usr/lib/systemd/systemd-executor) @@ -235,17 +233,15 @@ DRACUT_OPTS=() # comments in `testsuite.sh` for the explanation export INITRD="/var/tmp/ci-sanity-initramfs-$(uname -r).img" cp -fv "/boot/initramfs-$(uname -r).img" "$INITRD" - # FIXME - dracut --kver 4.18.0-521.el8.x86_64 "${DRACUT_OPTS[@]}" -o "multipath rngd" --filesystems ext4 --rebuild "$INITRD" + dracut "${DRACUT_OPTS[@]}" --kver "$LATEST_KERNEL" -o "multipath rngd" --filesystems ext4 --rebuild "$INITRD" centos_ensure_qemu_symlink ## Configure test environment # Explicitly set paths to initramfs (see above) and kernel images # (for QEMU tests) - # FIXME - export KERNEL_VER="4.18.0-521.el8.x86_64" - export KERNEL_BIN="/boot/vmlinuz-$KERNEL_VER" + export KERNEL_BIN="/boot/vmlinuz-$LATEST_KERNEL" + export KERNEL_VER="$LATEST_KERNEL" # Enable kernel debug output for easier debugging when something goes south export KERNEL_APPEND="debug systemd.log_level=debug rd.systemd.log_target=console systemd.default_standard_output=journal+console" # Set timeout for QEMU tests to kill them in case they get stuck @@ -308,9 +304,7 @@ GRUBBY_ARGS=( "panic=3" ) # Make sure the latest kernel is the one we're going to boot into -# FIXME -grubby --set-default "/boot/vmlinuz-4.18.0-521.el8.x86_64" -#grubby --set-default "/boot/vmlinuz-$(rpm -q kernel --qf "%{EVR}.%{ARCH}\n" | sort -Vr | head -n1)" +grubby --set-default "/boot/vmlinuz-$LATEST_KERNEL" grubby --args="${GRUBBY_ARGS[*]}" --update-kernel="$(grubby --default-kernel)" # Check if the $GRUBBY_ARGS were applied correctly for arg in "${GRUBBY_ARGS[@]}"; do