Honor GRUB_DISABLE_LINUX_UUID=true and don't set root=UUID then
authorMichael Prokop <mika@grml.org>
Thu, 4 Jun 2015 12:11:22 +0000 (14:11 +0200)
committerMichael Prokop <mika@grml.org>
Thu, 4 Jun 2015 12:12:44 +0000 (14:12 +0200)
According to the bug report pygrub doesn't support the UUID
magic.  If the user explicitely sets GRUB_DISABLE_LINUX_UUID=true
in /etc/default/grub we should honor that. Don't adjust grub.cfg
but instead prompt a warning then.

Fixes #65 @ github

grml-debootstrap

index 7fd52a2..1e7b598 100755 (executable)
@@ -1199,8 +1199,13 @@ fi
 
   case "$RELEASE" in
     lenny|squeeze|wheezy)
-      einfo "Adjusting grub.cfg for successful boot sequence."
-      sed -i "s;root=[^ ]\+;root=UUID=$TARGET_UUID;" "${MNTPOINT}"/boot/grub/grub.cfg
+      if grep -q '^GRUB_DISABLE_LINUX_UUID=true' "${MNTPOINT}"/etc/default/grub 2>/dev/null ; then
+        ewarn "GRUB_DISABLE_LINUX_UUID is set to true in /etc/default/grub, not adjusting root= in grub.cfg."
+        ewarn "Please note that your system might NOT be able to properly boot."
+      else
+        einfo "Adjusting grub.cfg for successful boot sequence."
+        sed -i "s;root=[^ ]\+;root=UUID=$TARGET_UUID;" "${MNTPOINT}"/boot/grub/grub.cfg
+      fi
       ;;
   esac