From: Harald Hoyer Date: Fri, 28 Jun 2013 08:21:42 +0000 (+0200) Subject: test/run-qemu: specify the kernel X-Git-Tag: 030~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=87ae9688100a352035f7da89051d75743714fb7c;p=thirdparty%2Fdracut.git test/run-qemu: specify the kernel --- diff --git a/test/run-qemu b/test/run-qemu index 667975f87..00c2f6a85 100755 --- a/test/run-qemu +++ b/test/run-qemu @@ -14,4 +14,15 @@ $(lsmod | grep -q '^kqemu ') && BIN=/usr/bin/qemu && ARGS="-kernel-kqemu " echo "Please install kvm or qemu." >&2 exit 1 } -exec sudo $BIN $ARGS "$@" + +KVERSION=${KVERSION-$(uname -r)} + +[[ -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 + +exec sudo $BIN $ARGS -kernel $VMLINUZ "$@"