Drop deprecated config_hwinfo().
[grml-autoconfig.git] / autoconfig.functions
index 0bf61e4..a8eed74 100755 (executable)
@@ -617,16 +617,6 @@ fi
 }
 # }}}
 
-# For burning on IDE-CD-Roms, k3b (and others) check for special permissions {{{
-config_cdrom_perm(){
-CDROMS=""
-for DEVICE in /proc/ide/hd?; do
- [ "$(cat $DEVICE/media 2>/dev/null)" = "cdrom" ] && CDROMS="$CDROMS /dev/${DEVICE##*/}"
-done
-[ -n "$CDROMS" ] && { chown root.cdrom $CDROMS; chmod 666 $CDROMS; } 2>/dev/null
-}
-# }}}
-
 # {{{ Bring up loopback interface now
 config_local_net(){
  if [ -z "$INSTALLED" ] ; then
@@ -639,28 +629,6 @@ config_local_net(){
 }
 # }}}
 
-# firewire devices {{{
-# the raw1394 driver does not yet export info into SYSFS,
-# so let's create raw1394 device manually
-# http://www.michael-prokop.at/blog/index.php?p=352
-config_firewire_dev(){
-if checkbootparam 'nofirewiredev' ; then
-  ewarn "Skipping creating some firewire devices as requested on boot commandline." ; eend 0
-else
-#if [ "${KERNEL%-*}" == "2.6.11" ] ; then
-  einfo "Creating some firewire devices (fix kernel 2.6-bug)."
-#  cd /dev && MAKEDEV video1394 raw1394
-  [ -r /dev/raw1394 ]   || mknod /dev/raw1394 c 171 0
-  [ -r /dev/video1394 ] || mknod -m 666 /dev/video1394 c 171 16
-# mknod -m 666 /dev/dv1394 c 171 32 # for NTSC
-  [ -r /dev/dv1394 ]    || mknod -m 666 /dev/dv1394 c 171 34 # for PAL
-  chown -R root:video /dev/raw1394 /dev/video1394 /dev/dv1394
-  chmod -R 664 /dev/raw1394 /dev/video1394 /dev/dv1394 ; eend $?
-fi
-#fi
-}
-# }}}
-
 # {{{ copy passwd-lockfile to ramdisk (fix unionfs-behaviour)
 # otherwise we will get: passwd: Authentication token lock busy
 config_fix_passwd(){
@@ -699,86 +667,6 @@ fi
 }
 # }}}
 
-# {{{ hardware detection via discover
-config_discover(){
-if checkbootparam 'nodisc' ; then
-  ewarn "Skipping hardware detection via discover as requested on boot commandline." ; eend 0
-else
- if [ -x /sbin/discover ] ; then
-  einfo "Discovering hardware. Trying to load the following modules in background:"
-   eindent
-   einfo "$(discover --data-path=linux/module/name --data-path=linux/modules/options --format="%s %s" --data-version=`uname -r` --enable-bus all | sort -u | xargs echo)"
-   eoutdent
-  /sbin/discover-modprobe -v >>$DEBUG 2>&1 &
-  eend 0
- else
-  eerror "Application discover not available. Information: udev should handle hardware recognition." ; eend 0
- fi
-fi
-}
-# }}}
-
-# {{{ hardware detection via hwinfo
-config_hwinfo(){
-if checkbootparam 'hwinfo' >>$DEBUG 2>&1; then
-  einfo "Discovering hardware via hwinfo:"
-  MODULES=$(su grml hwinfo | grep "Cmd: \"modprobe" | awk '{print $5}' | sed 's/"//')
-  echo -n "  Loading modules: "
-  for i in `echo $MODULES` ; do echo -n $i && modprobe $i ; done
-  eend 0
-fi
-}
-# }}}
-
-# {{{ disable hotplug agents on request
-config_hotplug_agent(){
-if checkbootparam 'noagent' ; then
-  AGENT="$(getbootparam 'noagent' 2>>$DEBUG)"
-  AGENTLIST=$(echo "$AGENT" | sed 's/,/\\n/g')
-  AGENTNL=$(echo "$AGENT" | sed 's/,/ /g')
-  einfo "Disabling hotplug-agent(s) $AGENTNL"
-  for agent in $(echo -e $AGENTLIST) ; do
-    mv /etc/hotplug/${agent}.rc /etc/hotplug/${agent}.norc
-  done
-  [ "$?" == "0" ] ; eend $?
-fi
-}
-# }}}
-
-# {{{ blacklist of hotplug-modules
-config_hotplug_blacklist(){
-if checkbootparam 'black' ; then
-  BLACK="$(getbootparam 'black' 2>>$DEBUG)"
-  BLACKLIST=$(echo "$BLACK" | sed 's/,/\\n/g')
-  BLACKNL=$(echo "$BLACK" | sed 's/,/ /g')
-  einfo "Blacklisting $BLACKNL via /etc/hotplug/blacklist.d/hotplug-light"
-  echo -e "$BLACKLIST" >> /etc/hotplug/blacklist.d/hotplug-light
-  echo -e "$BLACKLIST" >> /etc/hotplug/blacklist
-  eend 0
-fi
-}
-# }}}
-
-# {{{ run hotplug
-config_hotplug(){
-if checkbootparam 'nohotplug' ; then
-  ewarn "Skipping running hotplug as requested on boot commandline." ; eend 0
-else
-  if [ -r /etc/init.d/hotplug ] ; then
-    einfo "Starting hotplug system in background."
-    /etc/init.d/hotplug start >>$DEBUG 2>>$DEBUG &
-    eend 0
-  elif [ -r /etc/init.d/hotplug-light ] ; then
-    einfo "Starting hotplug-light system in background."
-    /etc/init.d/hotplug-light start >>$DEBUG 2>>$DEBUG &
-    eend 0
-  else
-    ewarn "No hotplug system found. Should be handled by udev. Skipping execution." ; eend 0
-  fi
-fi
-}
-# }}}
-
 # {{{ blacklist specific module [ used in /etc/init.d/udev ]
 config_blacklist(){
 if checkbootparam 'blacklist' ; then
@@ -866,33 +754,6 @@ fi
 }
 # }}}
 
-# {{{ PCMCIA Check/Setup
-# This needs to be done before other modules are being loaded (by hwsetup)
-config_pcmcia(){
-if checkbootparam 'nopcmcia'; then
-  ewarn "Skipping PCMCIA detection as requested on boot commandline." ; eend 0
-else
-  if /usr/sbin/laptop-detect ; then
-    einfo "Detected Laptop - checking for PCMCIA." && eend 0
-    modprobe pcmcia_core >>$DEBUG 2>&1
-    # Try Cardbus or normal PCMCIA socket drivers
-    modprobe yenta_socket >>$DEBUG 2>&1 || modprobe i82365 >>$DEBUG 2>&1 || modprobe pd6729 >>$DEBUG 2>&1 || modprobe tcic >>$DEBUG 2>&1
-    if [ "$?" = "0" ]; then
-      modprobe ds >>$DEBUG 2>&1
-      if [ -d /proc/bus/pccard ] ; then
-       if [ -x /sbin/cardmgr ] ; then
-        einfo "PCMCIA found, starting cardmgr."
-        cardmgr >>$DEBUG 2>&1 && sleep 6 && eend 0
-       else
-        eerror "No cardmgr found. Make sure package pcmciautils is installed, it should handle it instead." ; eend 1
-       fi
-      fi
-    fi
-  fi
-fi
-}
-# }}}
-
 # {{{ run software synthesizer via speakup
 config_swspeak(){
    if checkbootparam 'swspeak' ; then
@@ -1791,8 +1652,11 @@ config_finddcsdir() {
 #    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
@@ -1801,7 +1665,7 @@ else
         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
@@ -1810,7 +1674,7 @@ else
            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
@@ -1944,9 +1808,13 @@ if checkbootparam 'config' || [ "$DCSMP" = "/mnt/grmlcfg" ]; then
     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"
 }
 # }}}