# {{{ 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
- 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