diff --git a/ChangeLog b/ChangeLog index 9de46681d..b307b5668 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-15 Robert Millan + + * util/grub.d/10_linux.in: Use the underliing device for loop-AES + devices. + Reported by Max Vozeler. + 2008-06-15 Robert Millan * util/i386/pc/grub-mkimage.c (generate_image): If we included a drive diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 9aac6327b..1ae1e1e51 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -28,7 +28,16 @@ else fi if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] ; then - LINUX_ROOT_DEVICE=${GRUB_DEVICE} + # loop-AES arranges things so that /dev/loop/X can be our root device, but + # the initrds that Linux uses don't like that. + case ${GRUB_DEVICE} in + /dev/loop/*|/dev/loop[0-9]) + LINUX_ROOT_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"` + ;; + *) + LINUX_ROOT_DEVICE=${GRUB_DEVICE} + ;; + esac else LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} fi