summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJochen Sprickerhof <git@jochen.sprickerhof.de>2023-01-15 13:03:31 +0100
committerJochen Sprickerhof <git@jochen.sprickerhof.de>2023-01-15 13:03:31 +0100
commitbfddad6582f4123023bb74d43f4cc7e3d68c16a9 (patch)
tree534810bdc1cfb1b6644f95567ffd5c37ddac929c /bin
parentb6aee3905cc52fa206cfbef3fe01d2c6388435a1 (diff)
downloaddebvm-bfddad6582f4123023bb74d43f4cc7e3d68c16a9.tar.gz
Support kernel links in /boot (Ubuntu)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/debvm-run12
1 files changed, 8 insertions, 4 deletions
diff --git a/bin/debvm-run b/bin/debvm-run
index 6ed47c4..1b59158 100755
--- a/bin/debvm-run
+++ b/bin/debvm-run
@@ -195,8 +195,12 @@ case "$VMARCH" in
;;
esac
-KERNELNAME=$(/sbin/debugfs "$IMAGE" -R "stat $KERNELLINK" | sed 's/Fast link dest: "\(.*\)"/\1/;t;d')
-INITRDNAME=$(/sbin/debugfs "$IMAGE" -R "stat initrd.img" | sed 's/Fast link dest: "\(.*\)"/\1/;t;d')
+KERNELPREFIX=""
+KERNELNAME=$(/sbin/debugfs "$IMAGE" -R "stat $KERNELLINK")
+test -n "$KERNELNAME" || KERNELPREFIX=boot/
+
+KERNELNAME=$(/sbin/debugfs "$IMAGE" -R "stat ${KERNELPREFIX}$KERNELLINK" | sed 's/Fast link dest: "\(.*\)"/\1/;t;d')
+INITRDNAME=$(/sbin/debugfs "$IMAGE" -R "stat ${KERNELPREFIX}initrd.img" | sed 's/Fast link dest: "\(.*\)"/\1/;t;d')
test -n "$KERNELNAME" || die "failed to discover kernel image"
test -n "$INITRDNAME" || die "failed to discover initrd image"
@@ -286,7 +290,7 @@ set -- \
set -ex
-/sbin/debugfs "$IMAGE" -R "cat $KERNELNAME" > "$KERNELTMP"
-/sbin/debugfs "$IMAGE" -R "cat $INITRDNAME" > "$INITRDTMP"
+/sbin/debugfs "$IMAGE" -R "cat ${KERNELPREFIX}$KERNELNAME" > "$KERNELTMP"
+/sbin/debugfs "$IMAGE" -R "cat ${KERNELPREFIX}$INITRDNAME" > "$INITRDTMP"
"$QEMU" "$@"