Additional check for boot option debian2hd in config_debootstrap().
[grml-autoconfig.git] / autoconfig.functions
index ec87922..d2baf4e 100755 (executable)
@@ -1026,13 +1026,6 @@ fi
 }
 # }}}
 
-# {{{ 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
@@ -1299,30 +1292,6 @@ fi
 }
 # }}}
 
-# {{{ 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
@@ -1517,14 +1486,6 @@ fi
 }
 # }}}
 
-# {{{ 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
@@ -1538,7 +1499,7 @@ config_mixer () {
       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
@@ -1572,7 +1533,7 @@ config_mixer () {
             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
@@ -1802,13 +1763,6 @@ fix_unionfs(){
 }
 # }}}
 
-# {{{ 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
@@ -1966,6 +1920,9 @@ config_debs(){
 if checkbootparam 'debs' ; then
    iszsh && setopt localoptions shwordsplit
    DEBS="$(getbootparam 'debs' 2>>$DEBUG)"
+   if [ -z "$DEBS" ] ; then
+      DEBS="*"
+   fi
    if ! echo $DEBS | grep -q '/'; then
      # backwards compatibility: if no path is given get debs from debs/
      DEBS="debs/$DEBS"
@@ -2362,45 +2319,8 @@ config_lvm(){
 # {{{ 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
 }
 # }}}
@@ -2458,7 +2378,7 @@ config_tohd()
 # {{{ grml2hd: automatic installation
 config_grml2hd(){
 
-if checkbootparam "BOOT_IMAGE=grml2hd" ; then
+if checkbootparam "grml2hd" || checkbootparam "BOOT_IMAGE=grml2hd" ; then
 
 if checkbootparam 'user' ; then
    NEWUSER=''
@@ -2510,7 +2430,7 @@ fi # if checkbootparam "BOOT_IMAGE=grml2hd ...
 # {{{ 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
 
@@ -2613,14 +2533,5 @@ fi
 }
 # }}}
 
-### {{{ 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