}
# }}}
-# {{{ vmware specific stuff
-config_vmware(){
-if checkbootparam 'novmware' ; then
- ewarn "Skipping running vmware specific stuff as requested on boot commandline." ; eend 0
-else
- if [ -z "$INSTALLED" ] ; 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 $?
- fi
- fi
- elif [ -r /proc/acpi/battery/BAT0/info -a -r /etc/X11/xorg.conf.virtualbox ] ; then
- if grep -q 'OEM info: innotek' /proc/acpi/battery/BAT0/info ; then
- einfo 'Virtual Box: Copying /etc/X11/xorg.conf.virtualbox to /etc/X11/xorg.conf'
- cp /etc/X11/xorg.conf.virtualbox /etc/X11/xorg.conf ; eend $?
- fi
- fi
- fi
-fi
-}
-# }}}
-
-# {{{ qemu specific stuff
-config_qemu(){
-if checkbootparam 'qemu' ; then
- 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 $?
- fi
-fi
-}
-# }}}
-
# {{{ ld.so.cache + depmod
config_ld_mod(){
if [ -n "$INSTALLED" ]; then
}
# }}}
-# {{{ Interactive configuration
-config_interactive(){
- ewarn "config_interactive is deprecated nowadays."
- ewarn "Please set CONFIG_INTERACTIVE='no' in /etc/grml/autoconfig" ; eend 0
-}
-# }}}
-
# {{{ AGP
config_agp(){
if checkbootparam 'forceagp' ; then
checkbootparam 'anyswap' && export ANYSWAP='yes' || export ANYSWAP=""
fi
-if checkbootparam 'nofstab' || checkbootparam 'forensic' ; then
- 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)"
- iszsh && setopt nonomatch
- if [ -x /usr/sbin/rebuildfstab ] ; then
- config_userfstab || fstabuser=grml
- /usr/sbin/rebuildfstab -r -u $fstabuser -g $fstabuser ; eend $?
- else
- ewarn "Command rebuildfstab not found. Install package grml-rebuildfstab." ; eend 1
- fi
-fi # checkbootparam nofstab/forensic
-
# Scan for swap, config, homedir - but only in live-mode
if [ -z "$INSTALLED" ] ; then
[ -z "$NOSWAP" ] && einfo "Searching for swap partition(s) as requested."
}
# }}}
-# {{{ Fat-Client-Version: DHCP Broadcast for IP address
-config_dhcp(){
-if checkbootparam 'nodhcp'; then
- 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)"
- rm -rf /etc/network/status ; mkdir -p /etc/network/status
- for DEVICE in `echo "$NETDEVICES"` ; do
- einfo "Network device ${WHITE}${DEVICE}${NORMAL} detected, DHCP broadcasting for IP. (Backgrounding)"
- trap 2 3 11
- ifconfig $DEVICE up >>$DEBUG 2>&1
- ( pump -i $DEVICE --script=/usr/lib/grml-autoconfig/pump-runparts >>$DEBUG 2>&1 && echo finished_running_pump > /etc/network/status/$DEVICE ) &
- trap "" 2 3 11
- sleep 1
- eend 0
- done
- if [ -n "$INSTALLED" ] ; then
- ewarn 'If you want to disable automatic DHCP requests set CONFIG_DHCP=no in /etc/grml/autoconfig.'
- eend 0
- fi
-fi
-}
-# }}}
-
# {{{ CPU-detection
config_cpu(){
if checkbootparam 'nocpu'; then
}
# }}}
-# {{{ Check for persistent homedir option and eventually mount /home from there, or use a loopback file.
-config_homedir(){
-if checkbootparam 'home' ; then
- ewarn "The \"home\" bootoption is deprecated, please use the persistency feature instead."; eend 1
-fi
-}
-# }}}
-
# {{{ Sound
config_mixer () {
if ! [ -x /usr/bin/amixer ] ; then
fi
for card in $(cat /proc/asound/cards| grep -e '^\s*[0-9]' | awk '{print $1}') ; do
- einfo "Configuring soundcard $(cat /proc/asound/cards| grep -e "$card" | awk -F\[ '{print $2}' | awk '{print $1}')"
+ einfo "Configuring soundcard \"$(awk -F\[ '/^ *'$card' \[/{ FS=" "; $0=$2; print $1}' < /proc/asound/cards)\""
eindent
if checkbootparam 'vol' ; then
fi
for CONTROL in Master PCM ; do
- if amixer -q | grep -q "Simple mixer control.*$CONTROL" ; then
+ if amixer -q | grep -q "Simple mixer control '$CONTROL'" ; then
amixer -q set "${CONTROL}" "${VOL}"%
eend $?
fi
}
# }}}
-# {{{ keyboard add-ons
-config_setkeycodes(){
-if checkbootparam 'setkeycodes' ; then
- einfo "Setting keycodes as requested via bootparameter 'setkeycodes'."
- # MS MM keyboard add-on
- # fix
- setkeycodes e001 126 &>/dev/null
- setkeycodes e059 127 &>/dev/null
- # fn keys
- setkeycodes e03b 59 &>/dev/null
- setkeycodes e008 60 &>/dev/null
- setkeycodes e007 61 &>/dev/null
- setkeycodes e03e 62 &>/dev/null
- setkeycodes e03f 63 &>/dev/null
- setkeycodes e040 64 &>/dev/null
- setkeycodes e041 65 &>/dev/null
- setkeycodes e042 66 &>/dev/null
- setkeycodes e043 67 &>/dev/null
- setkeycodes e023 68 &>/dev/null
- setkeycodes e057 87 &>/dev/null
- setkeycodes e058 88 &>/dev/null
- # hp keycodes
- setkeycodes e00a 89 e008 90 &>/dev/null
- eend 0
-fi
-}
-# }}}
-
# {{{ wondershaper
config_wondershaper(){
if checkbootparam 'wondershaper' ; then
}
# }}}
-# {{{ create all /mnt-directories
-create_mnt_dirs(){
- ewarn "create_mnt_dirs is deprecated as grml-rebuildfstab does all we need."
- ewarn "Please set CONFIG_CREATE_MNT_DIRS='no' in /etc/grml/autoconfig" ; eend 0
-}
-# }}}
-
# {{{ start X window system via grml-x
config_x_startup(){
# make sure we start X only if startx is used *before* a nostartx option
# foo, even if a GRMLCFG partition is present.
DCSDIR=""
DCSMP="/mnt/grml"
+# autoconfig, see issue673
+GRMLCFG="$(getbootparam 'autoconfig' 2>>$DEBUG)"
+[ -n "$GRMLCFG" ] || GRMLCFG="GRMLCFG"
if checkbootparam 'noautoconfig' || checkbootparam 'forensic' ; then
- ewarn "Skipping running automount of device(s) labeled GRMLCFG as requested." ; eend 0
+ ewarn "Skipping running automount of device(s) labeled $GRMLCFG as requested." ; eend 0
else
if [ -z "$INSTALLED" ] ; then
if checkbootparam 'myconfig' ; then
eerror "Error: No device for bootoption myconfig provided." ; eend 1
fi # [ -z "$DCSDEVICE" ]
elif checkvalue $CONFIG_MYCONFIG; then # checkbootparam myconfig
- einfo "Searching for device(s) labeled with GRMLCFG. (Disable this via boot option: noautoconfig)" ; eend 0
+ einfo "Searching for device(s) labeled with $GRMLCFG. (Disable this via boot option: noautoconfig)" ; eend 0
eindent
# We do need the following fix so floppy disk is available to blkid in any case :-/
if [ -r /dev/fd0 ] ; then
blkid /dev/fd0 >>$DEBUG 2>&1
fi
fi
- DCSDEVICE=$(blkid -t LABEL=GRMLCFG | head -1 | awk -F: '{print $1}')
+ DCSDEVICE=$(blkid -t LABEL=$GRMLCFG | head -1 | awk -F: '{print $1}')
if [ -n "$DCSDEVICE" ]; then
DCSMP="/mnt/grmlcfg"
fi
if checkbootparam 'debs' ; then
iszsh && setopt localoptions shwordsplit
DEBS="$(getbootparam 'debs' 2>>$DEBUG)"
+ if [ -z "$DEBS" ] ; then
+ DEBS="*.deb"
+ fi
if ! echo $DEBS | grep -q '/'; then
# backwards compatibility: if no path is given get debs from debs/
DEBS="debs/$DEBS"
fi
fi
fi
-# umount $DCSMP if it was mounted by finddcsdir
-# this doesn't really belong here
-grep -q '$DCSMP' /proc/mounts && umount $DCSMP
+}
+# }}}
+
+# {{{ confing_umount_dcsdir
+config_umount_dcsdir(){
+ # umount $DCSMP if it was mounted by finddcsdir
+ grep -q "$DCSMP" /proc/mounts && umount "$DCSMP"
}
# }}}
# {{{ debnet: setup network based on an existing one found on a partition
config_debnet(){
if checkbootparam 'debnet' ; then
- iszsh && setopt localoptions shwordsplit
- DEVICES="$(< /proc/partitions tail -n +3 | awk '{print "/dev/"$4}' | tr "\n" " ")"
- DEVICES="$DEVICES $(ls /dev/mapper/*)"
- FOUND_DEBNET=""
-
einfo "Bootoption 'debnet' found. Searching for Debian network configuration: "
- eindent
- if ! mount | grep '/mnt ' >/dev/null 2>&1 ; then
- for i in $DEVICES; do
- if mount -o ro -t auto "$i" /mnt >/dev/null 2>&1; then
- einfo "Scanning on $i"
- if [ -f /mnt/etc/network/interfaces ]; then
- einfo "/etc/network/interfaces found on ${i}" ; eend 0
- FOUND_DEBNET="$i"
- break
- fi
- umount /mnt
- fi
- done
-
- if [ -n "$FOUND_DEBNET" ]; then
- einfo "Stopping network."
- pump -k >/dev/null 2>&1
- /etc/init.d/networking stop >/dev/null 2>&1 ; eend $?
- einfo "Copying Debian network configuration from $FOUND_DEBNET to running system."
- rm -rf /etc/network/run
- cp -a /mnt/etc/network /etc
- rm -rf /etc/network/run
- mkdir /etc/network/run
- umount /mnt ; eend $?
- einfo "Starting network."
- invoke-rc.d networking start ; eend $?
- else
- eerror "/etc/network/interfaces not found." ; eend 1
- fi
- eoutdent
- else
- eerror "Error: /mnt already mounted." ; eend 1
- fi
+ /usr/sbin/debnet
fi
}
# }}}
# {{{ grml2hd: automatic installation
config_grml2hd(){
-if checkbootparam "BOOT_IMAGE=grml2hd" ; then
+if checkbootparam "grml2hd" || checkbootparam "BOOT_IMAGE=grml2hd" ; then
if checkbootparam 'user' ; then
NEWUSER=''
# {{{ debootstrap: automatic installation
config_debootstrap(){
-if checkbootparam "BOOT_IMAGE=debian2hd" ; then
+if checkbootparam "BOOT_IMAGE=debian2hd" || checkbootparam "debian2hd" ; then
einfo "Bootoption debian2hd found. Setting up environment for automatic installation via grml-debootstrap." ; eend 0
}
# }}}
-### {{{ backwards compatible stuff
-config_environment(){
- ewarn "config_environment is deprecated. Please set CONFIG_ENVIRONMENT in /etc/grml/autoconfig to 'no'." ; eend 0
-}
-config_keyboard(){
- ewarn "config_keyboard is deprecated. Please set CONFIG_KEYBOARD in /etc/grml/autoconfig to 'no'." ; eend 0
-}
-# }}}
-
## END OF FILE #################################################################
# vim:foldmethod=marker expandtab ai ft=zsh shiftwidth=3