Always remove /boot/grub/device.map to avoid leaking host data
authorMichael Prokop <mika@grml.org>
Thu, 4 Jun 2015 08:06:40 +0000 (10:06 +0200)
committerMichael Prokop <mika@grml.org>
Thu, 4 Jun 2015 08:06:40 +0000 (10:06 +0200)
Thanks: Patrick Schleizer <adrelanos@riseup.net> for bug report and feedback
Fixes #27 @ github

chroot-script

index e1c183a..0e31f70 100755 (executable)
@@ -585,11 +585,13 @@ grub_install() {
         echo "Installing grub on ${GRUB}:"
         grub-install --no-floppy "$GRUB"
      done
         echo "Installing grub on ${GRUB}:"
         grub-install --no-floppy "$GRUB"
      done
+     rm -f /boot/grub/device.map
   else
      echo "Installing grub on ${GRUB}:"
      case "$RELEASE" in
        lenny|squeeze|wheezy)
          grub-install --no-floppy "$(readlink -f "${GRUB}")"
   else
      echo "Installing grub on ${GRUB}:"
      case "$RELEASE" in
        lenny|squeeze|wheezy)
          grub-install --no-floppy "$(readlink -f "${GRUB}")"
+         rm -f /boot/grub/device.map
          ;;
        *)
          echo "(hd0) ${GRUB}" > /boot/grub/device.map
          ;;
        *)
          echo "(hd0) ${GRUB}" > /boot/grub/device.map