X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=grml-debootstrap;h=dba64341c500f8c10c6b302b70d2cc3b9eb3996f;hp=ca4172b67ddc4682b0690857ef941a90ee3fa1c7;hb=0de1bb148af138894da4b535852157bbbb2b056a;hpb=15a11433dd0fc15f7a16130578d1a50bd1cdcdcf diff --git a/grml-debootstrap b/grml-debootstrap index ca4172b..dba6434 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -995,10 +995,19 @@ mkfs() { # make sure /dev/disk/by-uuid/... is up2date, otherwise grub # will fail to detect the uuid in the chroot - if echo "$TARGET" | grep -q "/dev/md" ; then + if [ -n "$VIRTUAL" ] ; then + einfo "Virtual environment doesn't require blockdev --rereadpt, skipping therefore" + elif echo "$TARGET" | grep -q "/dev/md" ; then blockdev --rereadpt "${TARGET}" - elif ! [ -n "$VIRTUAL" ] ; then - blockdev --rereadpt "${TARGET%%[0-9]*}" + else + # if we deploy to /dev/sdX# then let's see if /dev/sdX exists + local main_device="${TARGET%%[0-9]*}" + # sanity check to not try to e.g. access /dev/loop if we get /dev/loop0 + if [ -f "/sys/block/$(basename ${main_device})/$(basename ${TARGET})/dev" ] ; then + blockdev --rereadpt "$main_device" + else + einfo "No underlying block device for $TARGET identified, skipping blockdev --rereadpt." + fi fi # give the system 2 seconds, otherwise we might run into # race conditions :-/ @@ -1167,6 +1176,14 @@ fi chroot "${MNTPOINT}" update-grub case "$RELEASE" in + jessie) + einfo "Applying workaround for GRUB font path bug in jessie (Debian #787685)." + mkdir -p "${MNTPOINT}/boot/grub/fonts/" + cp "${MNTPOINT}/usr/share/grub/unicode.pf2" "${MNTPOINT}/boot/grub/fonts/" + ;; + esac + + 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