# {{{ Read in boot parameters
if [ -z "$CMDLINE" ]; then
# if CMDLINE was set from the outside, we're debugging.
# {{{ Read in boot parameters
if [ -z "$CMDLINE" ]; then
# if CMDLINE was set from the outside, we're debugging.
CMDLINE="$(cat /proc/cmdline)"
[ -d /cdrom/bootparams/ ] && CMDLINE="$CMDLINE $(cat /cdrom/bootparams/* | tr '\n' ' ')"
[ -d /live/image/bootparams/ ] && CMDLINE="$CMDLINE $(cat /live/image/bootparams/* | tr '\n' ' ')"
CMDLINE="$(cat /proc/cmdline)"
[ -d /cdrom/bootparams/ ] && CMDLINE="$CMDLINE $(cat /cdrom/bootparams/* | tr '\n' ' ')"
[ -d /live/image/bootparams/ ] && CMDLINE="$CMDLINE $(cat /live/image/bootparams/* | tr '\n' ' ')"
-# Simple shell grep
-stringinfile(){
- case "$(cat $2)" in *$1*) return 0;; esac
- return 1
-}
-
-# same for strings
-stringinstring(){
- case "$2" in *$1*) return 0;; esac
- return 1
-}
-
-# Reread boot command line; echo last parameter's argument or return false.
+# Get a bootoption's parameter: read boot command line and either
+# echo last parameter's argument or return false.
- stringinstring " $1=" "$CMDLINE" || return 1
- result="${CMDLINE##* $1=}"
- result="${result%%[ ]*}"
- echo "$result"
- return 0
+ case "$CMDLINE" in
+ *$1=*)
+ result="${CMDLINE##* $1=}"
+ result="${result%%[ ]*}"
+ echo "$result"
+ return 0 ;;
+ *) # no match?
+ return 1 ;;
+ esac
- stringinstring " $1" "$CMDLINE"
- return "$?"
+ [ -n "$1" ] || ( echo "Error: missing argument to checkbootparam()" ; return 1 )
+ # make sure we match beginning and end of line as well
+ # but don't match 'vg' if we want to check for 'vga'
+ if echo "$CMDLINE" | grep -qw "$1" ; then
+ return 0
+ else
+ return 1
+ fi
RC_NOCOLOR=yes
. /etc/grml/lsb-functions
einfo "Disabling colors in bootsequence as requested on commandline." ; eend 0
RC_NOCOLOR=yes
. /etc/grml/lsb-functions
einfo "Disabling colors in bootsequence as requested on commandline." ; eend 0
- checkbootparam "debug" && BOOTDEBUG="yes"
- stringinstring "BOOT_IMAGE=debug " "$CMDLINE" && BOOTDEBUG="yes"
+ checkbootparam 'debug' && BOOTDEBUG="yes"
+ checkbootparam "BOOT_IMAGE=debug" && BOOTDEBUG="yes"
export DEBUG="/tmp/grml.log.`date +%Y%m%d`"
touch $DEBUG
einfo "Bootparameter log found. Log files: ${DEBUG} and /var/log/boot"
export DEBUG="/tmp/grml.log.`date +%Y%m%d`"
touch $DEBUG
einfo "Bootparameter log found. Log files: ${DEBUG} and /var/log/boot"
TIMEOUT="$(getbootparam 'fwtimeout' 2>>$DEBUG)"
einfo "Bootoption fwtimeout found. (Re)Loading firmware_class module."
rmmod firmware_class 1>>$DEBUG 2>&1
TIMEOUT="$(getbootparam 'fwtimeout' 2>>$DEBUG)"
einfo "Bootoption fwtimeout found. (Re)Loading firmware_class module."
rmmod firmware_class 1>>$DEBUG 2>&1
grep -q ' lang=.*-utf8' /proc/cmdline && UTF8='yes' || UTF8=''
# check for bootoption which overrides config from /etc/grml/autoconfig:
grep -q ' lang=.*-utf8' /proc/cmdline && UTF8='yes' || UTF8=''
# check for bootoption which overrides config from /etc/grml/autoconfig:
[ -n "$BOOT_LANGUAGE" ] && LANGUAGE="$BOOT_LANGUAGE"
# set default to 'en' in live-cd mode if $LANGUAGE is not yet set:
[ -n "$BOOT_LANGUAGE" ] && LANGUAGE="$BOOT_LANGUAGE"
# set default to 'en' in live-cd mode if $LANGUAGE is not yet set:
# [ -n "$UTF8" ] && CONSOLEFONT='LatArCyrHeb-16' || CONSOLEFONT='Lat15-Terminus16'
# if [ -r /usr/share/consolefonts/Lat15-Terminus16.psf.gz ] ; then
if [ -r /usr/share/consolefonts/Uni3-Terminus16.psf.gz ] ; then
# [ -n "$UTF8" ] && CONSOLEFONT='LatArCyrHeb-16' || CONSOLEFONT='Lat15-Terminus16'
# if [ -r /usr/share/consolefonts/Lat15-Terminus16.psf.gz ] ; then
if [ -r /usr/share/consolefonts/Uni3-Terminus16.psf.gz ] ; then
[ -r /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard
# now allow keyboard override by boot commandline for later use:
[ -r /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard
# now allow keyboard override by boot commandline for later use:
[ -n "$KKEYBOARD" ] && KEYTABLE="$KKEYBOARD"
# notce: de/at is a bad choice, so take de-latin1-nodeadkeys instead:
[[ "$KKEYBOARD" == 'de' ]] && KEYTABLE=de-latin1-nodeadkeys
[ -n "$KKEYBOARD" ] && KEYTABLE="$KKEYBOARD"
# notce: de/at is a bad choice, so take de-latin1-nodeadkeys instead:
[[ "$KKEYBOARD" == 'de' ]] && KEYTABLE=de-latin1-nodeadkeys
local LANGUAGE="$BOOT_LANGUAGE"
. /etc/grml/language-functions
# allow setting xkeyboard explicitly different than console keyboard
local LANGUAGE="$BOOT_LANGUAGE"
. /etc/grml/language-functions
# allow setting xkeyboard explicitly different than console keyboard
# duplicate of previous code to make sure /etc/grml/language-functions
# does not overwrite our values....
# now allow keyboard override by boot commandline for later use:
# duplicate of previous code to make sure /etc/grml/language-functions
# does not overwrite our values....
# now allow keyboard override by boot commandline for later use:
[ -n "$KKEYBOARD" ] && KEYTABLE="$KKEYBOARD"
# notce: de/at is a bad choice, so take de-latin1-nodeadkeys instead:
[[ "$KKEYBOARD" == 'de' ]] && KEYTABLE=de-latin1-nodeadkeys
[ -n "$KKEYBOARD" ] && KEYTABLE="$KKEYBOARD"
# notce: de/at is a bad choice, so take de-latin1-nodeadkeys instead:
[[ "$KKEYBOARD" == 'de' ]] && KEYTABLE=de-latin1-nodeadkeys
ewarn "Skipping setting console font as requested on boot commandline." ; eend 0
else
if [ -n "$CONSOLEFONT" ] ; then
ewarn "Skipping setting console font as requested on boot commandline." ; eend 0
else
if [ -n "$CONSOLEFONT" ] ; then
HOSTNAME="$(getbootparam 'hostname' 2>>$DEBUG)"
einfo "Setting hostname to $HOSTNAME as requested."
sed -i "s/^127.0.0.1.*localhost/127.0.0.1 $HOSTNAME localhost/" /etc/hosts
HOSTNAME="$(getbootparam 'hostname' 2>>$DEBUG)"
einfo "Setting hostname to $HOSTNAME as requested."
sed -i "s/^127.0.0.1.*localhost/127.0.0.1 $HOSTNAME localhost/" /etc/hosts
# The default hardware clock timezone is stated as representing local time.
UTC="--localtime"
grep -q "^UTC=" /etc/default/rcS || echo "UTC=no" >> /etc/default/rcS
# The default hardware clock timezone is stated as representing local time.
UTC="--localtime"
grep -q "^UTC=" /etc/default/rcS || echo "UTC=no" >> /etc/default/rcS
- checkbootparam utc >>$DEBUG 2>&1 && sed -i "s|^UTC=.*$|UTC=yes|" /etc/default/rcS
- checkbootparam gmt >>$DEBUG 2>&1 && sed -i "s|^UTC=.*$|UTC=yes|" /etc/default/rcS
- checkbootparam localtime >>$DEBUG 2>&1 && sed -i "s|^UTC=.*$|UTC=no|" /etc/default/rcS
+ checkbootparam 'utc' >>$DEBUG 2>&1 && sed -i "s|^UTC=.*$|UTC=yes|" /etc/default/rcS
+ checkbootparam 'gmt' >>$DEBUG 2>&1 && sed -i "s|^UTC=.*$|UTC=yes|" /etc/default/rcS
+ checkbootparam 'localtime' >>$DEBUG 2>&1 && sed -i "s|^UTC=.*$|UTC=no|" /etc/default/rcS
[ -z "$KTZ" ] && [ -r /etc/timezone ] && KTZ=$(cat /etc/timezone)
if [ ! -f "/usr/share/zoneinfo/$KTZ" ] ; then
ewarn "Warning: unknown timezone $KTZ" ; eend 1
[ -z "$KTZ" ] && [ -r /etc/timezone ] && KTZ=$(cat /etc/timezone)
if [ ! -f "/usr/share/zoneinfo/$KTZ" ] ; then
ewarn "Warning: unknown timezone $KTZ" ; eend 1
ewarn "Skipping running vmware specific stuff as requested on boot commandline." ; eend 0
else
if [ -z "$INSTALLED" ] ; then
ewarn "Skipping running vmware specific stuff as requested on boot commandline." ; eend 0
else
if [ -z "$INSTALLED" ] ; then
- if vmware-detect || stringinstring "BOOT_IMAGE=vmware " "$CMDLINE" ; then
- if ! checkbootparam qemu ; then
+ if vmware-detect || checkbootparam "BOOT_IMAGE=vmware" ; then
+ if ! checkbootparam 'qemu' ; then
if [ -r /etc/X11/xorg.conf.vmware ] ; then
einfo "VMware: Copying /etc/X11/xorg.conf.vmware to /etc/X11/xorg.conf"
cp /etc/X11/xorg.conf.vmware /etc/X11/xorg.conf ; eend $?
if [ -r /etc/X11/xorg.conf.vmware ] ; then
einfo "VMware: Copying /etc/X11/xorg.conf.vmware to /etc/X11/xorg.conf"
cp /etc/X11/xorg.conf.vmware /etc/X11/xorg.conf ; eend $?
if [ -r /etc/X11/xorg.conf.example ] ; then
einfo "Qemu: Copying /etc/X11/xorg.conf.example to /etc/X11/xorg.conf"
cp /etc/X11/xorg.conf.example /etc/X11/xorg.conf ; eend $?
if [ -r /etc/X11/xorg.conf.example ] ; then
einfo "Qemu: Copying /etc/X11/xorg.conf.example to /etc/X11/xorg.conf"
cp /etc/X11/xorg.conf.example /etc/X11/xorg.conf ; eend $?
einfo "Information: ${RAM} kB of RAM available." ; eend 0
einfo "Bootoption small detected. Activating small system."
if [ -r /etc/inittab.small ] ; then
einfo "Information: ${RAM} kB of RAM available." ; eend 0
einfo "Bootoption small detected. Activating small system."
if [ -r /etc/inittab.small ] ; then
ewarn "Bootoption fast detected. Skipping startup of grml-quickconfig."
sed -i 's#^1:.*#1:12345:respawn:/usr/bin/openvt -f -c 1 -w -- /bin/zsh#' /etc/inittab
/sbin/telinit q ; eend $?
ewarn "Bootoption fast detected. Skipping startup of grml-quickconfig."
sed -i 's#^1:.*#1:12345:respawn:/usr/bin/openvt -f -c 1 -w -- /bin/zsh#' /etc/inittab
/sbin/telinit q ; eend $?
MODE=${MODE%%n*}
[ -n "$MODE" ] || MODE=9600 # default mode
einfo "Setting speed in /etc/mgetty/mgetty.config to $MODE bps"
MODE=${MODE%%n*}
[ -n "$MODE" ] || MODE=9600 # default mode
einfo "Setting speed in /etc/mgetty/mgetty.config to $MODE bps"
ewarn "Skipping creating some firewire devices as requested on boot commandline." ; eend 0
else
#if [ "${KERNEL%-*}" == "2.6.11" ] ; then
ewarn "Skipping creating some firewire devices as requested on boot commandline." ; eend 0
else
#if [ "${KERNEL%-*}" == "2.6.11" ] ; then
ewarn "Skipping hardware detection via discover as requested on boot commandline." ; eend 0
else
if [ -x /sbin/discover ] ; then
ewarn "Skipping hardware detection via discover as requested on boot commandline." ; eend 0
else
if [ -x /sbin/discover ] ; then
einfo "Discovering hardware via hwinfo:"
MODULES=$(su grml hwinfo | grep "Cmd: \"modprobe" | awk '{print $5}' | sed 's/"//')
echo -n " Loading modules: "
einfo "Discovering hardware via hwinfo:"
MODULES=$(su grml hwinfo | grep "Cmd: \"modprobe" | awk '{print $5}' | sed 's/"//')
echo -n " Loading modules: "
AGENT="$(getbootparam 'noagent' 2>>$DEBUG)"
AGENTLIST=$(echo "$AGENT" | sed 's/,/\\n/g')
AGENTNL=$(echo "$AGENT" | sed 's/,/ /g')
AGENT="$(getbootparam 'noagent' 2>>$DEBUG)"
AGENTLIST=$(echo "$AGENT" | sed 's/,/\\n/g')
AGENTNL=$(echo "$AGENT" | sed 's/,/ /g')
BLACK="$(getbootparam 'black' 2>>$DEBUG)"
BLACKLIST=$(echo "$BLACK" | sed 's/,/\\n/g')
BLACKNL=$(echo "$BLACK" | sed 's/,/ /g')
BLACK="$(getbootparam 'black' 2>>$DEBUG)"
BLACKLIST=$(echo "$BLACK" | sed 's/,/\\n/g')
BLACKNL=$(echo "$BLACK" | sed 's/,/ /g')
ewarn "Skipping running hotplug as requested on boot commandline." ; eend 0
else
if [ -r /etc/init.d/hotplug ] ; then
ewarn "Skipping running hotplug as requested on boot commandline." ; eend 0
else
if [ -r /etc/init.d/hotplug ] ; then
if [ -z "$INSTALLED" ]; then
einfo "Bootoption blacklist found."
BLACK="$(getbootparam 'blacklist' 2>>$DEBUG)"
if [ -z "$INSTALLED" ]; then
einfo "Bootoption blacklist found."
BLACK="$(getbootparam 'blacklist' 2>>$DEBUG)"
ewarn "Skipping ACPI Bios detection as requested via nogrmlacpi on boot commandline." ; eend 0
else
einfo "ACPI Bios found, activating modules (disable via bootoption noacpi / nogrmlacpi): "
ewarn "Skipping ACPI Bios detection as requested via nogrmlacpi on boot commandline." ; eend 0
else
einfo "ACPI Bios found, activating modules (disable via bootoption noacpi / nogrmlacpi): "
ewarn "Skipping APM Bios detection as requested on boot commandline." ; eend 0
else
modprobe apm power_off=1 >>$DEBUG 2>&1
ewarn "Skipping APM Bios detection as requested on boot commandline." ; eend 0
else
modprobe apm power_off=1 >>$DEBUG 2>&1
ewarn "Skipping PCMCIA detection as requested on boot commandline." ; eend 0
else
if /usr/sbin/laptop-detect ; then
ewarn "Skipping PCMCIA detection as requested on boot commandline." ; eend 0
else
if /usr/sbin/laptop-detect ; then
einfo "Bootoption swspeak found."
if [ ! -d /proc/speakup/ ] && ! grep -q speakup_soft /proc/modules ; then
einfo "Bootoption swspeak found."
if [ ! -d /proc/speakup/ ] && ! grep -q speakup_soft /proc/modules ; then
if [ -z "$module" ] ; then
eerror "Sorry, no speakup module specified for bootoption speakup.synth."
flitewrapper "Sorry, no speakup module specified for bootoption speakup.synth."
if [ -z "$module" ] ; then
eerror "Sorry, no speakup module specified for bootoption speakup.synth."
flitewrapper "Sorry, no speakup module specified for bootoption speakup.synth."
einfo "Bootoption hwspeak found."
if [ ! -d /proc/speakup/ ] && ! grep -q speakup /proc/modules ; then
einfo "Bootoption hwspeak found."
if [ ! -d /proc/speakup/ ] && ! grep -q speakup /proc/modules ; then
[ -d "/mnt/auto/$d" ] || mkdir -p "/mnt/auto/$d"
[ -L "/mnt/$d" ] || ln -s "/mnt/auto/$d" "/mnt/$d"
anew="$d -fstype=auto,$2 :$i"
[ -d "/mnt/auto/$d" ] || mkdir -p "/mnt/auto/$d"
[ -L "/mnt/$d" ] || ln -s "/mnt/auto/$d" "/mnt/$d"
anew="$d -fstype=auto,$2 :$i"
AUTOMOUNTS="$AUTOMOUNTS $d"
new="$1 /mnt/auto/$d auto users,noauto,exec,$2 0 0"
else
[ -d /mnt/$d ] && mkdir -p /mnt/$d
new="$1 /mnt/$d auto users,noauto,exec,$2 0 0"
fi
AUTOMOUNTS="$AUTOMOUNTS $d"
new="$1 /mnt/auto/$d auto users,noauto,exec,$2 0 0"
else
[ -d /mnt/$d ] && mkdir -p /mnt/$d
new="$1 /mnt/$d auto users,noauto,exec,$2 0 0"
fi
# {{{ Enable DMA for all IDE drives now if not disabled
# Notice: Already done by linuxrc, but make sure it's done also on harddisk-installed systems
config_dma(){
# {{{ Enable DMA for all IDE drives now if not disabled
# Notice: Already done by linuxrc, but make sure it's done also on harddisk-installed systems
config_dma(){
ewarn "Skipping DMA accelleration as requested on boot commandline." ; eend 0
else
for d in $(cd /proc/ide 2>>$DEBUG && echo hd[a-z]); do
ewarn "Skipping DMA accelleration as requested on boot commandline." ; eend 0
else
for d in $(cd /proc/ide 2>>$DEBUG && echo hd[a-z]); do
ewarn "Skipping /etc/fstab creation as requested on boot commandline." ; eend 0
else
einfo "Scanning for harddisk partitions and creating /etc/fstab. (Disable this via boot option: nofstab)"
ewarn "Skipping /etc/fstab creation as requested on boot commandline." ; eend 0
else
einfo "Scanning for harddisk partitions and creating /etc/fstab. (Disable this via boot option: nofstab)"
if [ -n "$partitions" ]; then
while read p m f relax; do
case "$p" in *fd0*|*proc*|*sys*|*\#*) continue;; esac
if [ -n "$partitions" ]; then
while read p m f relax; do
case "$p" in *fd0*|*proc*|*sys*|*\#*) continue;; esac
einfo "Enabling IPv6 as requested on boot commandline (sleeping for 2 seconds)"
modprobe ipv6
# we probably need some time until stateless autoconfiguration has happened
einfo "Enabling IPv6 as requested on boot commandline (sleeping for 2 seconds)"
modprobe ipv6
# we probably need some time until stateless autoconfiguration has happened
ewarn "Skipping DHCP broadcast/network detection as requested on boot commandline." ; eend 0
else
NETDEVICES="$(awk -F: '/eth.:|tr.:|wlan.:/{print $1}' /proc/net/dev 2>>$DEBUG)"
ewarn "Skipping DHCP broadcast/network detection as requested on boot commandline." ; eend 0
else
NETDEVICES="$(awk -F: '/eth.:|tr.:|wlan.:/{print $1}' /proc/net/dev 2>>$DEBUG)"
ewarn "Skipping CPU detection as requested on boot commandline." ; eend 0
else
# check module dependencies
ewarn "Skipping CPU detection as requested on boot commandline." ; eend 0
else
# check module dependencies
SSH_PASSWD=''
SSH_PASSWD="$(getbootparam 'ssh' 2>>$DEBUG)"
einfo "Bootoption ssh found, trying to set password for user grml."
SSH_PASSWD=''
SSH_PASSWD="$(getbootparam 'ssh' 2>>$DEBUG)"
einfo "Bootoption ssh found, trying to set password for user grml."
einfo "Bootoption passwd found."
PASSWD="$(getbootparam 'passwd' 2>>$DEBUG)"
if [ -n "$PASSWD" ] ; then
einfo "Bootoption passwd found."
PASSWD="$(getbootparam 'passwd' 2>>$DEBUG)"
if [ -n "$PASSWD" ] ; then
VOL="$(getbootparam 'vol' 2>>$DEBUG)"
if [ -z "$VOL" ] ; then
eerror "Bootoption vol found but no volume level/parameter given. Using defaults." ; eend 1
VOL="$(getbootparam 'vol' 2>>$DEBUG)"
if [ -z "$VOL" ] ; then
eerror "Bootoption vol found but no volume level/parameter given. Using defaults." ; eend 1
einfo "Muting sound devices on request."
# some IBM notebooks require the following stuff:
if [ -x /usr/bin/amixer ] ; then
einfo "Muting sound devices on request."
# some IBM notebooks require the following stuff:
if [ -x /usr/bin/amixer ] ; then
ewarn "Skipping check for AC97 modem controller as requested on boot commandline." ; eend 0
else
if [ -x /etc/init.d/sl-modem-daemon ] ; then
ewarn "Skipping check for AC97 modem controller as requested on boot commandline." ; eend 0
else
if [ -x /etc/init.d/sl-modem-daemon ] ; then
ewarn "Not starting GPM as requested on boot commandline." ; eend 0
else
if ! [ -r /dev/input/mice ] ; then
ewarn "Not starting GPM as requested on boot commandline." ; eend 0
else
if ! [ -r /dev/input/mice ] ; then
SERVICELIST=$(echo "$SERVICE" | sed 's/,/\\n/g')
SERVICENL=$(echo "$SERVICE" | sed 's/,/ /g')
einfo "Starting service(s) ${SERVICENL} in background."
SERVICELIST=$(echo "$SERVICE" | sed 's/,/\\n/g')
SERVICENL=$(echo "$SERVICE" | sed 's/,/ /g')
einfo "Starting service(s) ${SERVICENL} in background."
config_x_startup(){
# make sure we start X only if startx is used *before* a nostartx option
# so it's possible to disable automatic X startup using nostart
config_x_startup(){
# make sure we start X only if startx is used *before* a nostartx option
# so it's possible to disable automatic X startup using nostart
if [ -x /usr/X11R6/bin/X ] ; then
if [ -z "$INSTALLED" ] ; then
WINDOWMANAGER="$(getbootparam 'startx' 2>>$DEBUG)"
if [ -x /usr/X11R6/bin/X ] ; then
if [ -z "$INSTALLED" ] ; then
WINDOWMANAGER="$(getbootparam 'startx' 2>>$DEBUG)"
# - If myconfig=foo is set on the command line, $dcs-dir is set to
# foo, even if a GRMLCFG partition is present.
DCSDIR=""
# - If myconfig=foo is set on the command line, $dcs-dir is set to
# foo, even if a GRMLCFG partition is present.
DCSDIR=""
ewarn "Skipping running automount of device(s) labeled GRMLCFG as requested." ; eend 0
else
if [ -z "$INSTALLED" ] ; then
ewarn "Skipping running automount of device(s) labeled GRMLCFG as requested." ; eend 0
else
if [ -z "$INSTALLED" ] ; then
DCSDEVICE="$(getbootparam 'myconfig' 2>>$DEBUG)"
if [ -z "$DCSDEVICE" ]; then
einfo "No device for bootoption myconfig provided." ; eend 1
DCSDEVICE="$(getbootparam 'myconfig' 2>>$DEBUG)"
if [ -z "$DCSDEVICE" ]; then
einfo "No device for bootoption myconfig provided." ; eend 1
if [ -n "$DCSDIR" ]; then
einfo "Debs, config, scripts will be read from $DCSDIR." ; eend 0
if [ -n "$DCSDIR" ]; then
einfo "Debs, config, scripts will be read from $DCSDIR." ; eend 0
MOUNTDEVICE="$(getbootparam 'partconf' 2>>$DEBUG)"
if [ -n "$MOUNTDEVICE" ]; then
[ -d /mnt/grml ] || mkdir /mnt/grml
MOUNTDEVICE="$(getbootparam 'partconf' 2>>$DEBUG)"
if [ -n "$MOUNTDEVICE" ]; then
[ -d /mnt/grml ] || mkdir /mnt/grml
DEBS="$(getbootparam 'debs' 2>>$DEBUG)"
if ! echo $DEBS | grep -q '/'; then
# backwards compatibility: if no path is given get debs from debs/
DEBS="$(getbootparam 'debs' 2>>$DEBUG)"
if ! echo $DEBS | grep -q '/'; then
# backwards compatibility: if no path is given get debs from debs/
SCRIPTS="$(getbootparam 'scripts' 2>>$DEBUG)"
if [ -z "$SCRIPTS" ]; then
SCRIPTS="$(cd ${DCSDIR}/scripts; /bin/ls -1d [Gg][Rr][Mm][Ll].[Ss][Hh] 2>>$DEBUG)"
SCRIPTS="$(getbootparam 'scripts' 2>>$DEBUG)"
if [ -z "$SCRIPTS" ]; then
SCRIPTS="$(cd ${DCSDIR}/scripts; /bin/ls -1d [Gg][Rr][Mm][Ll].[Ss][Hh] 2>>$DEBUG)"
CONFIG="$(getbootparam 'config' 2>>$DEBUG)"
if [ -z "$CONFIG" ]; then
CONFIG="$(cd ${DCSDIR}; ls -1d [Cc][Oo][Nn][Ff][Ii][Gg].[Tt][Bb][Zz] 2>>$DEBUG)"
CONFIG="$(getbootparam 'config' 2>>$DEBUG)"
if [ -z "$CONFIG" ]; then
CONFIG="$(cd ${DCSDIR}; ls -1d [Cc][Oo][Nn][Ff][Ii][Gg].[Tt][Bb][Zz] 2>>$DEBUG)"
MY_PATH="$(getbootparam 'mypath' 2>>$DEBUG)"
einfo "Bootparameter mypath found, adding ${MY_PATH} to /etc/grml/my_path"
touch /etc/grml/my_path
MY_PATH="$(getbootparam 'mypath' 2>>$DEBUG)"
einfo "Bootparameter mypath found, adding ${MY_PATH} to /etc/grml/my_path"
touch /etc/grml/my_path
ewarn "Skipping loading of modules defined in ${MODULES_FILE} as requested." ; eend 0
elif [ -z "$INSTALLED" ]; then
if [ -r $MODULES_FILE ] ; then
ewarn "Skipping loading of modules defined in ${MODULES_FILE} as requested." ; eend 0
elif [ -z "$INSTALLED" ]; then
if [ -r $MODULES_FILE ] ; then
iszsh && setopt shwordsplit
DEVICES="$(< /proc/partitions tail -n +3 | awk '{print "/dev/"$4}' | tr "\n" " ")"
DEVICES="$DEVICES $(ls /dev/mapper/*)"
iszsh && setopt shwordsplit
DEVICES="$(< /proc/partitions tail -n +3 | awk '{print "/dev/"$4}' | tr "\n" " ")"
DEVICES="$DEVICES $(ls /dev/mapper/*)"
local TARGET="$(getbootparam 'tohd' 2>>$DEBUG)"
if [ -z "$TARGET" ] ; then
eerror "Error: tohd specified without any partition, can not continue." ; eend 1
local TARGET="$(getbootparam 'tohd' 2>>$DEBUG)"
if [ -z "$TARGET" ] ; then
eerror "Error: tohd specified without any partition, can not continue." ; eend 1
NEWUSER=''
NEWUSER="$(getbootparam 'user' 2>>$DEBUG)"
sed -i "s/^NEWUSER=.*/NEWUSER=$NEWUSER/" /etc/grml2hd/config || export GRML2HD_FAIL=1
fi
NEWUSER=''
NEWUSER="$(getbootparam 'user' 2>>$DEBUG)"
sed -i "s/^NEWUSER=.*/NEWUSER=$NEWUSER/" /etc/grml2hd/config || export GRML2HD_FAIL=1
fi
FILESYSTEM=''
FILESYSTEM="$(getbootparam 'filesystem' 2>>$DEBUG)"
sed -i "s/^FILESYSTEM=.*/FILESYSTEM=$FILESYSTEM/" /etc/grml2hd/config || export GRML2HD_FAIL=1
fi
FILESYSTEM=''
FILESYSTEM="$(getbootparam 'filesystem' 2>>$DEBUG)"
sed -i "s/^FILESYSTEM=.*/FILESYSTEM=$FILESYSTEM/" /etc/grml2hd/config || export GRML2HD_FAIL=1
fi
PARTITION=''
PARTITION="$(getbootparam 'partition' 2>>$DEBUG)"
# notice: the following checks whether the given partition is available, if not the skip
PARTITION=''
PARTITION="$(getbootparam 'partition' 2>>$DEBUG)"
# notice: the following checks whether the given partition is available, if not the skip
BOOT_PARTITION=''
BOOT_PARTITION="$(getbootparam 'mbr' 2>>$DEBUG)"
sed -i "s#^BOOT_PARTITION=.*#BOOT_PARTITION=$BOOT_PARTITION#" /etc/grml2hd/config || export GRML2HD_FAIL=1
BOOT_PARTITION=''
BOOT_PARTITION="$(getbootparam 'mbr' 2>>$DEBUG)"
sed -i "s#^BOOT_PARTITION=.*#BOOT_PARTITION=$BOOT_PARTITION#" /etc/grml2hd/config || export GRML2HD_FAIL=1
TARGET=''
TARGET="$(getbootparam 'target' 2>>$DEBUG)"
# notice: the following checks whether the given partition is available, if not the skip
TARGET=''
TARGET="$(getbootparam 'target' 2>>$DEBUG)"
# notice: the following checks whether the given partition is available, if not the skip
DISTRI="$(getbootparam 'distri' 2>>$DEBUG)"
if [ -r "${LIVECD_PATH}"/desktop/"$DISTRI".jpg ] ; then
[ -n "$BOOTDEBUG" ] && einfo "Debug: bootoption distri found and file ${LIVECD_PATH}/desktop/${DISTRI} present" && eend 0
DISTRI="$(getbootparam 'distri' 2>>$DEBUG)"
if [ -r "${LIVECD_PATH}"/desktop/"$DISTRI".jpg ] ; then
[ -n "$BOOTDEBUG" ] && einfo "Debug: bootoption distri found and file ${LIVECD_PATH}/desktop/${DISTRI} present" && eend 0