# {{{ 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
+ local line
+ local ws
+ ws=' '
+ line=" $CMDLINE "
+ case "$line" in
+ *[${ws}]"$1="*)
+ result="${line##*[$ws]$1=}"
+ result="${result%%[$ws]*}"
+ echo "$result"
+ return 0 ;;
+ *) # no match?
+ return 1 ;;
+ esac
- checkbootparam 'debug' && BOOTDEBUG="yes"
- stringinstring "BOOT_IMAGE=debug " "$CMDLINE" && BOOTDEBUG="yes"
+ checkbootparam 'debug' && BOOTDEBUG="yes"
+ checkbootparam "BOOT_IMAGE=debug" && BOOTDEBUG="yes"
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 ! checkbootparam 'qemu' ; then
if [ -r /etc/X11/xorg.conf.vmware ] ; then
einfo "VMware: Copying /etc/X11/xorg.conf.vmware to /etc/X11/xorg.conf"
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"
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 $?
[ -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
--read-timeout=10 $CONFIG -O $CONFIGFILE && return 0 || return 1
}
einfo "Trying to get ${WHITE}${CONFIG}${NORMAL}"
--read-timeout=10 $CONFIG -O $CONFIGFILE && return 0 || return 1
}
einfo "Trying to get ${WHITE}${CONFIG}${NORMAL}"
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)"
fi
fi
fi
if [ -n "$DCSDIR" ]; then
einfo "Debs, config, scripts will be read from $DCSDIR." ; eend 0
fi
fi
fi
if [ -n "$DCSDIR" ]; then
einfo "Debs, config, scripts will be read from $DCSDIR." ; eend 0