r4172 - in trunk/bootscripts: . lfs/init.d

nathan at linuxfromscratch.org nathan at linuxfromscratch.org
Wed Sep 15 20:49:12 PDT 2004


Author: nathan
Date: 2004-09-15 21:49:10 -0600 (Wed, 15 Sep 2004)
New Revision: 4172

Modified:
   trunk/bootscripts/CHANGELOG
   trunk/bootscripts/lfs/init.d/functions
Log:
Imported some changes from DJ's bootscript package.  boot_echo function, blue bracket, prevent calling stty size multiple times, and some reformatting

Modified: trunk/bootscripts/CHANGELOG
===================================================================
--- trunk/bootscripts/CHANGELOG	2004-09-15 19:37:05 UTC (rev 4171)
+++ trunk/bootscripts/CHANGELOG	2004-09-16 03:49:10 UTC (rev 4172)
@@ -1,3 +1,10 @@
+n/a - September 15, 2004
+	* Added blue bracket, from dj's 3.0-pre1 bootscript package [echo_failure,
+	  echo_warning, and echo_ok]
+	* Added a new function called boot_mesg, meant to replace the echo command.
+	  This will give us the posibility of doing logging at a later date
+	* Do not set COLUMNS if COLUMNS is already set
+
 2.2.3 - September 04, 2004
 	* Tagged as 2.2.3
 

Modified: trunk/bootscripts/lfs/init.d/functions
===================================================================
--- trunk/bootscripts/lfs/init.d/functions	2004-09-15 19:37:05 UTC (rev 4171)
+++ trunk/bootscripts/lfs/init.d/functions	2004-09-16 03:49:10 UTC (rev 4172)
@@ -7,27 +7,22 @@
 # With code based on Matthias Benkmann's simpleinit-msb @
 # http://winterdrache.de/linux/newboot/index.html
 
-# Initial Stop Signal
-STOPSIG=TERM
-
-# The fallback if STOPSIG does not stop a process in time (see KILLDELAY)
-FALLBACK=KILL
-
-# Signal sent to running processes to refresh their configuration
-RELOADSIG=HUP
-
-# Number of seconds between STOPSIG and FALLBACK when stopping processes
-KILLDELAY=3
-
+## Environmental setup
+# Setup default values for environment
 umask 022
 export PATH="/bin:/usr/bin:/sbin:/usr/sbin"
 
-# Width of the Screen
-COLUMNS=$(stty size)
-COLUMNS=${COLUMNS##* }
+# Default values for kill function
+STOPSIG="TERM"  # Initial Stop Signal
+FALLBACK="KILL" # Fallback if STOPSIG does not stop a process in time (see KILLDELAY)
+RELOADSIG="HUP" # Signal sent to running processes to refresh their configuration
+KILLDELAY="3"   # Number of seconds between STOPSIG and FALLBACK when stopping processes
+PIDFILE=""
+
+## Screen Dimentions
+if [ -z "$COLUMNS" ]; then COLUMNS=$(stty size); COLUMNS=${COLUMNS##*}; fi
 # When using remote connections, such as a serial port, stty size returns 0
 if [ "$COLUMNS" = "0" ]; then COLUMNS=80; fi
-
 # Measurements for positioning result messages
 COL=$(($COLUMNS - 10))
 WCOL=$(($COLUMNS - 30))
@@ -42,20 +37,32 @@
 SUCCESS="\\033[1;32m"
 WARNING="\\033[1;33m"
 FAILURE="\\033[1;31m"
+BRACKET="\\033[1;34m"
 
+# Set screen and bootlog message values to ero
+BOOTMESG=""
+BOOTSERVICE=""
+
+boot_mesg() {
+	if [ -z "$BOOTMESG" ]; then
+		BOOTMESG="$@"
+		echo -e "${NORMAL}${BOOTMESG}"
+	fi
+}
+
 echo_ok()
 {
-	echo -e "$CURS_UP$SET_COL"["$SUCCESS""  OK  ""$NORMAL"]
+	echo -e "${CURS_UP}""${SET_COL}""${BRACKET}""[""${SUCCESS}""  OK  ""${BRACKET}""]""${NORMAL}"
 }
 
 echo_failure()
 {
-	echo -e "$CURS_UP$SET_COL"["$FAILURE"FAILED"$NORMAL"]
+	echo -e "${CURS_UP}""${SET_COL}""${BRACKET}""[""${FAILED}""FAILED""${BRACKET}""]""${NORMAL}"
 }
 
 echo_warning()
 {
-	echo -e "$CURS_UP$SET_WCOL$@$SET_COL"["$WARNING" WARN  "$NORMAL"]
+	echo -e "${CURS_UP}""${SET_WCOL}""$@""${SET_COL}""${BRACKET}""[""${WARNING}"" WARN  ""${BRACKET}""]""${NORMAL}"
 }
 
 # $i is inherited by the rc script




More information about the lfs-book mailing list