Add placeholder functions for start/restart/reload/stop to grml-autoconfig.strace
[grml-autoconfig.git] / autoconfig.functions
index 19fdbf6..94efd88 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/zsh
 # Filename:      autoconfig.functions
 # Purpose:       basic system configuration and hardware setup for grml system
-# Authors:       grml-team (grml.org), (c) Klaus Knopper <knopper@knopper.net>, (c) Michael Prokop <mika@grml.org>
+# Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2.
 ################################################################################
@@ -34,10 +34,10 @@ iszsh && setopt no_nomatch # || echo "Warning: not running under zsh!"
 
 # {{{ Read in boot parameters
 if [ -z "$CMDLINE" ]; then
-  # if CMDLINE was set from the outside, we're debugging. Otherwise, take
-  # CMDLINE from Kernel and config files
+  # if CMDLINE was set from the outside, we're debugging.
+  # Otherwise, take CMDLINE from Kernel and config files.
   CMDLINE="$(cat /proc/cmdline)"
-  [ -d /cdrom/bootparams/ ] && CMDLINE="$CMDLINE $(cat /cdrom/bootparams/* | tr '\n' ' ')"
+  [ -d /cdrom/bootparams/ ]      && CMDLINE="$CMDLINE $(cat /cdrom/bootparams/* | tr '\n' ' ')"
   [ -d /live/image/bootparams/ ] && CMDLINE="$CMDLINE $(cat /live/image/bootparams/* | tr '\n' ' ')"
 fi
 # }}}
@@ -107,7 +107,7 @@ mount_sys(){
 }
 # }}}
 
-# {{{ Check if we are running from the grml-CD or HD
+# {{{ Check if we are running in live mode or from HD
 INSTALLED=""
 [ -e /etc/grml_cd ] || INSTALLED="yes"
 
@@ -1590,19 +1590,6 @@ fi # checkbootparam home
 }
 # }}}
 
-# {{{ Check for scripts on CD-ROM
-# this is also executed when the scripts option is called. Is this a bug
-# or intended?
-config_cdrom_scripts(){
-if checkbootparam "script"; then
-   for script in "${LIVECD_PATH}"/scripts/* ; do
-       einfo " grml script found on CD, executing ${WHITE}${script}${NORMAL}."
-       . $script
-   done
-fi
-}
-# }}}
-
 # {{{ Sound
 config_mixer(){
 if ! [ -x /usr/bin/aumix ] ; then
@@ -1900,7 +1887,7 @@ EOF
    fi
 
   else
-    eerror "We are not running from CD - startx will not work, skipping it."
+    eerror "We are not running in live mode - startx will not work, skipping it."
     eerror " -> Please use something like xdm, gdm or kdm for starting X on a harddisk system!" ; eend 1
   fi
  else
@@ -1969,12 +1956,13 @@ else
     fi
   fi
 fi
+
 if [ -n "$DCSDIR" ]; then
   einfo "Debs, config, scripts will be read from $DCSDIR." ; eend 0
 else
-  einfo "Debs, config, scripts will be read from the CD image directly." ; eend 0
+  einfo "Debs, config, scripts will be read from the live image directly." ; eend 0
 fi
-}                            
+}
 
 
 config_partconf() {
@@ -2045,7 +2033,7 @@ if checkbootparam config ; then
   if [ -n "$CONFIG" ]; then
     if [ -d "${DCSDIR}/${CONFIG}" ] ; then
       einfo "Taking configuration from directory ${DCSDIR}/${CONFIG}"
-    
+
       cp -a ${DCSDIR}/${CONFIG}/* /
     elif [ -f "${DCSDIR}/${CONFIG}" ]; then
       einfo "Extracting configuration from file ${DCSDIR}/${CONFIG}"
@@ -2353,7 +2341,7 @@ if checkbootparam "debnet" ; then
        mkdir /etc/network/run
        umount /mnt ; eend $?
      einfo "Starting network."
-       /etc/init.d/networking start ; eend $?
+       invoke-rc.d networking start ; eend $?
    else
      eerror "/etc/network/interfaces not found." ; eend 1
    fi
@@ -2404,9 +2392,9 @@ config_tohd()
      fi
 
      if grep -q $TARGET /proc/mounts ; then
-       eerror "$TARGET already mounted, skipping execution of tohd therefore."
-       eend 1
-       return 1
+        eerror "$TARGET already mounted, skipping execution of tohd therefore."
+        eend 1
+        return 1
      fi
 
      local MOUNTDIR=$(mktemp -d)
@@ -2414,10 +2402,10 @@ config_tohd()
      if mount -o rw "$TARGET" "$MOUNTDIR" ; then
         einfo "Copyring live system to $TARGET - this might take a while"
         rsync -a --progress /live/image/live $MOUNTDIR
-       sync
-       umount "$MOUNTDIR"
+        sync
+        umount "$MOUNTDIR"
         eend $?
-       einfo "Booting with \"grml bootfrom=$TARGET\" should work now." ; eend 0
+        einfo "Booting with \"grml bootfrom=$TARGET\" should work now." ; eend 0
      else
         eerror "Error when trying to mount $TARGET, sorry."; eend 1
         return 1