X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=grml-debootstrap;h=ffcb6aa2eefe8cbe34aec3c9c85cb4013a4a60f0;hp=5313e25aa5bff829eae9eb745015a450b6be700c;hb=2be6b799851ac001378be023d1095c7540c5d46f;hpb=092274d8d241e9ed0b5f468decd541a1eb9f17b3 diff --git a/grml-debootstrap b/grml-debootstrap index 5313e25..ffcb6aa 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -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"