X-Git-Url: http://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=autoconfig.functions;h=1934575a7597a9c70fd0e82987353700ec8d7504;hp=7960772e10f23223702eaf65e3fbf84a699dc7db;hb=0c6e4eb8b502b781754e6b59a67dd1addb593778;hpb=e54ae72e08c71669fccc297c9500e1d8e83447ca diff --git a/autoconfig.functions b/autoconfig.functions index 7960772..1934575 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -2150,20 +2150,28 @@ config_debootstrap(){ if stringinstring "BOOT_IMAGE=debian2hd " "$CMDLINE" ; then +einfo "Bootoption debian2hd found. Setting up environment for automatic installation via grml-debootstrap." ; eend 0 + if ! [ -x /usr/sbin/grml-debootstrap ] ; then + eindent eerror "Bootoption debian2hd found, but grml-debootstrap is not available." ; eend 1 - eerror "Dropping you to a shell, just exit it to continue booting." ; eend 1 - /bin/zsh + eoutdent + exit 1 fi -if checkbootparam "partition" ; then - PARTITION='' - PARTITION="$(getbootparam 'partition' 2>>$DEBUG)" +if checkbootparam "target" ; then + TARGET='' + TARGET="$(getbootparam 'target' 2>>$DEBUG)" # notice: the following checks whether the given partition is available, if not the skip # execution of grml-debootstrap as it might result in data loss... - if ! [ -r $PARTITION ] ; then - ewarn "Partition $PARTITION does not exist. Skipping execution of grml-debootstrap therefore." ; eend 1 + if ! [ -r "$TARGET" ] ; then + eerror "Target $TARGET does not exist. Skipping execution of grml-debootstrap therefore." ; eend 1 fi +else + eindent + eerror "No bootoption named target found, can not continue execution of grml-debootstrap." ; eend 1 + eoutdent + exit 1 fi if checkbootparam "grub" ; then @@ -2192,28 +2200,32 @@ if checkbootparam "password" ; then fi # now check which options are available -if [ -n "PARTITION" ] ; then - PARTITIONCMD="--target $PARTITION" +if [ -n "TARGET" ] ; then + TARGETCMD="--target $TARGET" else - PARTITIONCMD='' - ewarn "Partion not set via bootoption. Skipping execution of grml-debootstrap therefore."; eend 1 + TARGETCMD='' + eindent + eerror "Target not set via bootoption. Skipping execution of grml-debootstrap therefore."; eend 1 + eoutdent + exit 1 fi [ -n "$GRUB" ] && GRUBCMD="--grub $GRUB" || GRUBCMD='' [ -n "$GROOT" ] && GROOTCMD="--groot $GROOT" || GROOTCMD='' [ -n "$RELEASE" ] && RELEASECMD="--release $RELEASE" || RELEASECMD='' [ -n "$MIRROR" ] && MIRRORCMD="--mirror $MIRROR" || MIRRORCMD='' -[ -n "$PASSWORD" ] && PASSWORDCMD="--password $PASSWORD" ] || PASSWORDCMD='' +[ -n "$PASSWORD" ] && PASSWORDCMD="--password $PASSWORD" || PASSWORDCMD='' # and finally write script and execute it cat>|/usr/bin/grml-debootstrap_noninteractive<