X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=grml-debootstrap;h=dc4006d3e081aa7a4b1f5c29319764d99aa91843;hp=82431922cd390069c773736fb639a2b50aa2dcb0;hb=c62dadf69387a747f3bb5f4e02ca1f62a9114382;hpb=f84d7f6ddf7ea481d4f9e54e9b8e0cd9730f0bf6 diff --git a/grml-debootstrap b/grml-debootstrap index 8243192..dc4006d 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -11,7 +11,7 @@ set -e # exit on any error # variables {{{ PN="$(basename $0)" -VERSION='0.37' +VERSION='0.38' MNTPOINT="/mnt/debootstrap.$$" # inside the chroot system locales might not be available, so use minimum: @@ -93,16 +93,9 @@ check4progs debootstrap dialog || exit 1 check4root || exit 1 # }}} -# source configuration file {{{ +# source main configuration file {{{ if [ -r /etc/debootstrap/config ] ; then - if [ -n "$CONFIGFILE" ] ; then - einfo "Using config file $CONFIGFILE." - if ! . "$CONFIGFILE" ; then - eerror "Error reading config file $CONFIGFILE" ; eend 1 ; exit 1 - fi - else - . /etc/debootstrap/config - fi + . /etc/debootstrap/config fi # }}} @@ -172,6 +165,15 @@ fi } # }}} +# source specified configuration file {{{ +if [ -n "$CONFIGFILE" ] ; then + einfo "Reading specified config file $CONFIGFILE." + if ! . "$CONFIGFILE" ; then + eerror "Error reading config file $CONFIGFILE" ; eend 1 ; exit 1 + fi +fi +# }}} + # backwards compability checks {{{ if [ -n "$GROOT" ] ; then echo "Error: you seem to have \$GROOT configured." >&2 @@ -705,7 +707,11 @@ mkfs() { # make sure /dev/disk/by-uuid/... is up2date, otherwise grub # will fail to detect the uuid in the chroot - blockdev --rereadpt "${TARGET%%[0-9]*}" + if echo "$TARGET" | grep -q "/dev/md" ; then + blockdev --rereadpt "${TARGET}" + else + blockdev --rereadpt "${TARGET%%[0-9]*}" + fi # give the system 2 seconds, otherwise we might run into # race conditions :-/ sleep 2