From: Harald Hoyer Date: Wed, 10 Jun 2015 17:39:41 +0000 (+0200) Subject: run-qemu: default kernel to "/lib/modules/${KVERSION}/vmlinuz" X-Git-Tag: 042~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97ff396a97c1c70fbc5516e0f58ab2636a6f9521;p=thirdparty%2Fdracut.git run-qemu: default kernel to "/lib/modules/${KVERSION}/vmlinuz" newer Fedora kernel install the kernel to /lib/modules --- diff --git a/test/TEST-16-DMSQUASH/test.sh b/test/TEST-16-DMSQUASH/test.sh index eb0044c1d..1eeb95f66 100755 --- a/test/TEST-16-DMSQUASH/test.sh +++ b/test/TEST-16-DMSQUASH/test.sh @@ -74,7 +74,17 @@ test_setup() { inst_simple /etc/os-release inst ./test-init.sh /sbin/init inst "$TESTDIR"/initramfs.testing "/boot/initramfs-$KVERSION.img" - inst /boot/vmlinuz-"$KVERSION" + [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id + + VMLINUZ="/lib/modules/${KVERSION}/vmlinuz" + if ! [[ -e $VMLINUZ ]]; then + if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then + VMLINUZ="/boot/${MACHINE_ID}/$KVERSION/linux" + fi + fi + [[ -e $VMLINUZ ]] || VMLINUZ="/boot/vmlinuz-${KVERSION}" + + inst "$VMLINUZ" "/boot/vmlinuz-${KVERSION}" find_binary plymouth >/dev/null && inst_multiple plymouth cp -a -- /etc/ld.so.conf* "$initdir"/etc sudo ldconfig -r -- "$initdir" diff --git a/test/run-qemu b/test/run-qemu index 00c2f6a85..a65ea1988 100755 --- a/test/run-qemu +++ b/test/run-qemu @@ -17,12 +17,16 @@ $(lsmod | grep -q '^kqemu ') && BIN=/usr/bin/qemu && ARGS="-kernel-kqemu " KVERSION=${KVERSION-$(uname -r)} -[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id +VMLINUZ="/lib/modules/${KVERSION}/vmlinuz" -if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then - VMLINUZ="/boot/${MACHINE_ID}/$KVERSION/linux" -else - VMLINUZ="/boot/vmlinuz-${KVERSION}" +if ! [ -f "$VMLINUZ" ]; then + [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id + + if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then + VMLINUZ="/boot/${MACHINE_ID}/$KVERSION/linux" + else + VMLINUZ="/boot/vmlinuz-${KVERSION}" + fi fi exec sudo $BIN $ARGS -kernel $VMLINUZ "$@"