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
- eerror "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
- eerror "No bootoption partition found, can not continue execution of grml-debootstrap." ; eend 1
- exit 0
+ eindent
+ eerror "No bootoption named target found, can not continue execution of grml-debootstrap." ; eend 1
+ eoutdent
+ exit 1
fi
if checkbootparam "grub" ; then
MIRROR="$(getbootparam 'mirror' 2>>$DEBUG)"
fi
+if checkbootparam "boot_append" ; then
+ BOOT_APPEND=''
+ BOOT_APPEND="$(getbootparam 'boot_append' 2>>$DEBUG)"
+fi
+
if checkbootparam "password" ; then
PASSWORD=''
PASSWORD="$(getbootparam 'password' 2>>$DEBUG)"
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=''
+[ -n "$BOOT_APPEND" ] && BOOT_APPEND="--boot_append $BOOT_APPEND" || BOOT_APPEND=''
# and finally write script and execute it
cat>|/usr/bin/grml-debootstrap_noninteractive<<EOF
#!/bin/sh
-AUTOINSTALL='yes' grml-debootstrap $PARTITIONCMD $GRUBCMD $GROOTCMD $RELEASECMD $MIRRORCMD $PASSWORDCMD
+AUTOINSTALL='yes' grml-debootstrap $TARGETCMD $GRUBCMD $GROOTCMD $RELEASECMD $MIRRORCMD $PASSWORDCMD $BOOT_APPEND
EOF
chmod 750 /usr/bin/grml-debootstrap_noninteractive