Release new version 0.68
[grml-debootstrap.git] / grml-debootstrap
index 5313e25..ffcb6aa 100755 (executable)
@@ -419,7 +419,7 @@ prompt_for_target()
   AVAILABLE_PARTITIONS=$(LANG=C fdisk -l 2>/dev/null | \
                sed 's/*//' | \
                grep -v 'Extended$' | \
-               gawk -v num=0 -v ORS=' ' '/^\/dev\// {print $1}'; ls /dev/md* 2>/dev/null || true);
+               gawk -v num=0 -v ORS=' ' '/^\/dev\// {print $1}'; ls /dev/md[0-9]* 2>/dev/null || true);
 
   if [ -z "$AVAILABLE_PARTITIONS" ] ; then
      dialog --title "$PN" --trim \
@@ -430,7 +430,10 @@ prompt_for_target()
   fi
 
   PARTITION_LIST=$(for i in $AVAILABLE_PARTITIONS ; do
-                     echo "$i $(blkid -s TYPE -o value "$i" 2>/dev/null || echo '[no_filesystem_yet]')"
+                     fs="$(blkid -s TYPE -o value "$i" 2>/dev/null)"
+                     [ -n "$fs" ] || fs='[no_filesystem_yet]'
+                     echo "$i" "$fs"
+                     unset fs
                    done)
 
   TARGET=$(dialog --title "$PN" --single-quoted --stdout \
@@ -1078,7 +1081,14 @@ finalize_vm() {
      bailout 1
   fi
 
-  cp "${MNTPOINT}"/usr/lib/grub/i386-pc/* "${MNTPOINT}/boot/grub/"
+  case "$RELEASE" in
+    lenny|squeeze|wheezy)
+      cp "${MNTPOINT}"/usr/lib/grub/i386-pc/* "${MNTPOINT}/boot/grub/"
+      ;;
+    *)
+      cp -a "${MNTPOINT}"/usr/lib/grub/i386-pc "${MNTPOINT}/boot/grub/"
+      ;;
+  esac
   chroot "${MNTPOINT}" grub-mkimage -O i386-pc -p "(hd0,msdos1)/boot/grub" -o /tmp/core.img biosdisk part_msdos ext2
   dd if="${MNTPOINT}/tmp/core.img" of="${ORIG_TARGET}" conv=notrunc seek=4
   rm -f "${MNTPOINT}/tmp/core.img"