--- functions.sh 2003-06-18 05:16:52.000000000 -0400 +++ /sbin/functions.sh 2003-06-20 05:40:41.000000000 -0400 @@ -22,9 +22,6 @@ # Size of $svcdir in KB svcsize="1024" -# tmpfs mount point for diskless nodes -shmdir="/mnt/.shm" - # Different types of dependancies deptypes="need use" @@ -74,6 +71,31 @@ HILITE=$'\e[36;01m' +if [ -e /proc/cmdline ] +then + for copt in `cat /proc/cmdline` + do + if [ "${copt%=*}" = "softlevel" ] + then + forcedlevel="${copt##*=}" + CONFSUFFIX=".${forcedlevel}" + elif [ "${copt%=*}" = "bootlevel" ] + then + BOOTLEVEL="${copt##*=}" + fi + done + + if [ -d "/etc/runlevels/boot${CONFSUFFIX}" \ + -o -L "/etc/runlevels/boot${CONFSUFFIX}" \ + -a ! "${BOOTLEVEL}" ] + then + BOOTLEVEL="boot${CONFSUFFIX}" + else + BOOTLEVEL="boot" + fi + +fi + esyslog() { if [ -x /usr/bin/logger ] then @@ -205,22 +227,6 @@ return ${retval} } -# int checkserver(void) -# -# Return 0 (no error) if this script is executed -# onto the server, one otherwise. -# See the boot section of /sbin/rc for more details. -# -checkserver() { - # Only do check if 'gentoo=adelie' is given as kernel param - if get_bootparam "adelie" - then - [ "`cat ${svcdir}/hostname`" = "(none)" ] || return 1 - fi - - return 0 -} - # int KV_to_int(string) # # Convert a string type kernel version (2.4.0) to an int (132096) @@ -361,5 +367,17 @@ fi } +# char *add_suffix(char * configfile) +# +# Returns a config file name with the softlevel suffix +# appended to it. For use with multi-config services. +add_suffix () { + if [ -e ${1}${CONFSUFFIX} ] + then + echo ${1}${CONFSUFFIX} + else + echo ${1} + fi +} # vim:ts=4