aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Dubbs <bdubbs@linuxfromscratch.org>2015-02-22 21:50:39 +0000
committerBruce Dubbs <bdubbs@linuxfromscratch.org>2015-02-22 21:50:39 +0000
commitb7804aeaec5719d68ff5672b64f2e3e11eca1c8a (patch)
tree9af2d9ea6c80474152d3954e9c9d036593ebf998
parenteb8b1c55439f17853b63e7c7bb2594a474f66e6f (diff)
Cosmetic changes to output messages by network boot scripts.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10858 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
-rw-r--r--bootscripts/ChangeLog3
-rw-r--r--bootscripts/lfs/lib/services/init-functions58
-rwxr-xr-xbootscripts/lfs/lib/services/ipv4-static2
-rwxr-xr-xbootscripts/lfs/sbin/ifup11
-rw-r--r--bootscripts/lfs/sysconfig/rc.site5
-rw-r--r--chapter01/changelog.xml10
-rw-r--r--general.ent4
-rw-r--r--packages.ent2
8 files changed, 64 insertions, 31 deletions
diff --git a/bootscripts/ChangeLog b/bootscripts/ChangeLog
index df4087927..9600652ad 100644
--- a/bootscripts/ChangeLog
+++ b/bootscripts/ChangeLog
@@ -1,3 +1,6 @@
+2015-02-22 Bruce Dubbs <bdubbs@linuxfromscratch.org>
+ * Cosmetic changes to network scripts' output
+
2015-02-08 Bruce Dubbs <bdubbs@linuxfromscratch.org>
* Modify ipv4-static to support ethernet labels
* Output a newline if an interface is skipped during boot
diff --git a/bootscripts/lfs/lib/services/init-functions b/bootscripts/lfs/lib/services/init-functions
index a09f6188b..87f0bc6bb 100644
--- a/bootscripts/lfs/lib/services/init-functions
+++ b/bootscripts/lfs/lib/services/init-functions
@@ -23,28 +23,6 @@
umask 022
export PATH="/bin:/usr/bin:/sbin:/usr/sbin"
-## Screen Dimensions
-# Find current screen size
-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} - 8))
-WCOL=$((${COL} - 2))
-
-## Set Cursor Position Commands, used via echo
-SET_COL="\\033[${COL}G" # at the $COL char
-SET_WCOL="\\033[${WCOL}G" # at the $WCOL char
-CURS_UP="\\033[1A\\033[0G" # Up one line, at the 0'th char
-CURS_ZERO="\\033[0G"
-
## Set color commands, used via echo
# Please consult `man console_codes for more information
# under the "ECMA-48 Set Graphics Rendition" section
@@ -66,10 +44,12 @@ BMPREFIX=" "
SUCCESS_PREFIX="${SUCCESS} * ${NORMAL}"
FAILURE_PREFIX="${FAILURE}*****${NORMAL}"
WARNING_PREFIX="${WARNING} *** ${NORMAL}"
+SKIP_PREFIX="${INFO} S ${NORMAL}"
SUCCESS_SUFFIX="${BRACKET}[${SUCCESS} OK ${BRACKET}]${NORMAL}"
FAILURE_SUFFIX="${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"
WARNING_SUFFIX="${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}"
+SKIP_SUFFIX="${BRACKET}[${INFO} SKIP ${BRACKET}]${NORMAL}"
BOOTLOG=/run/bootlog
KILLDELAY=3
@@ -77,6 +57,28 @@ KILLDELAY=3
# Set any user specified environment variables e.g. HEADLESS
[ -r /etc/sysconfig/rc.site ] && . /etc/sysconfig/rc.site
+## Screen Dimensions
+# Find current screen size
+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} - 8))
+WCOL=$((${COL} - 2))
+
+## Set Cursor Position Commands, used via echo
+SET_COL="\\033[${COL}G" # at the $COL char
+SET_WCOL="\\033[${WCOL}G" # at the $WCOL char
+CURS_UP="\\033[1A\\033[0G" # Up one line, at the 0'th char
+CURS_ZERO="\\033[0G"
+
################################################################################
# start_daemon() #
# Usage: start_daemon [-f] [-n nicelevel] [-p pidfile] pathname [args...] #
@@ -645,6 +647,18 @@ log_warning_msg()
return 0
}
+log_skip_msg()
+{
+ /bin/echo -n -e "${BMPREFIX}${@}"
+ /bin/echo -e "${CURS_ZERO}${SKIP_PREFIX}${SET_COL}${SKIP_SUFFIX}"
+
+ # Strip non-printable characters from log file
+ logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
+ /bin/echo "SKIP" >> ${BOOTLOG}
+
+ return 0
+}
+
################################################################################
# log_info_msg() #
# Usage: log_info_msg message #
diff --git a/bootscripts/lfs/lib/services/ipv4-static b/bootscripts/lfs/lib/services/ipv4-static
index 33fe4c21b..4ac7f3e45 100755
--- a/bootscripts/lfs/lib/services/ipv4-static
+++ b/bootscripts/lfs/lib/services/ipv4-static
@@ -48,7 +48,7 @@ case "${2}" in
up)
if [ "$(ip addr show ${1} 2>/dev/null | grep ${IP}/)" = "" ]; then
- # Cosmetic output not needed for multiple services
+ # Cosmetic output
if ! $(echo ${SERVICE} | grep -q " "); then
log_info_msg2 "\n" # Terminate the previous message
fi
diff --git a/bootscripts/lfs/sbin/ifup b/bootscripts/lfs/sbin/ifup
index 317223b0b..a7e1138e8 100755
--- a/bootscripts/lfs/sbin/ifup
+++ b/bootscripts/lfs/sbin/ifup
@@ -8,7 +8,7 @@
# Kevin P. Fleming - kpfleming@linuxfromscratch.org
# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
#
-# Version : LFS 7.2
+# Version : LFS 7.7
#
# Notes : The IFCONFIG variable is passed to the SERVICE script
# in the /lib/services directory, to indicate what file the
@@ -33,7 +33,7 @@ up()
fi
}
-RELEASE="7.2"
+RELEASE="7.7"
USAGE="Usage: $0 [ -hV ] [--help] [--version] interface"
VERSTR="LFS ifup, version ${RELEASE}"
@@ -89,8 +89,7 @@ fi
# Do not process this service if started by boot, and ONBOOT
# is not set to yes
if [ "${IN_BOOT}" = "1" -a "${ONBOOT}" != "yes" ]; then
- log_info_msg2 "skipped"
- echo
+ log_skip_msg
exit 0
fi
@@ -104,6 +103,8 @@ for S in ${SERVICE}; do
fi
done
+if [ "${SERVICE}" = "wpa" ]; then log_success_msg; fi
+
# Create/configure the interface
for S in ${SERVICE}; do
IFCONFIG=${file} /lib/services/${S} ${IFACE} up
@@ -126,7 +127,7 @@ fi
# Set the route default gateway if requested
if [ -n "${GATEWAY}" ]; then
if ip route | grep -q default; then
- log_warning_msg "\nGateway already setup; skipping."
+ log_skip_msg "\n Gateway already setup; skipping."
else
log_info_msg "Setting up default gateway..."
ip route add default via ${GATEWAY} dev ${IFACE}
diff --git a/bootscripts/lfs/sysconfig/rc.site b/bootscripts/lfs/sysconfig/rc.site
index b0a124d71..9b501e542 100644
--- a/bootscripts/lfs/sysconfig/rc.site
+++ b/bootscripts/lfs/sysconfig/rc.site
@@ -32,6 +32,11 @@
#FAILURE_PREFIX="${FAILURE}*****${NORMAL}"
#WARNING_PREFIX="${WARNING} *** ${NORMAL}"
+# Manually seet the right edge of message output (characters)
+# Useful when resetting console font during boot to override
+# automatic screen width detection
+#COLUMNS=120
+
# Interactive startup
#IPROMPT="yes" # Whether to display the interactive boot prompt
#itime="3" # The amount of time (in seconds) to display the prompt
diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml
index 2ab4e3466..99b4559c9 100644
--- a/chapter01/changelog.xml
+++ b/chapter01/changelog.xml
@@ -36,6 +36,16 @@
</listitem>
-->
<listitem>
+ <para>2015-02-22</para>
+ <itemizedlist>
+ <listitem>
+ <para>[bdubbs] - Cosmetic changes to output messages
+ by network boot scripts.</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
<para>2015-02-19</para>
<itemizedlist>
<listitem>
diff --git a/general.ent b/general.ent
index f1fb0ad4e..bb14b4ede 100644
--- a/general.ent
+++ b/general.ent
@@ -1,7 +1,7 @@
-<!ENTITY version "SVN-20150219">
+<!ENTITY version "SVN-20150222">
<!ENTITY short-version "svn"> <!-- Used in dbus chapter, change to x.y for release
but not -rc releases -->
-<!ENTITY releasedate "February 19, 2015">
+<!ENTITY releasedate "February 22, 2015">
<!ENTITY copyrightdate "1999-2015"><!-- jhalfs needs a literal dash, not &ndash; -->
<!ENTITY milestone "7.7">
<!ENTITY generic-version "development"> <!-- Use "development", "testing", or "x.y[-pre{x}]" -->
diff --git a/packages.ent b/packages.ent
index dc3e2cf75..c9dcec244 100644
--- a/packages.ent
+++ b/packages.ent
@@ -352,7 +352,7 @@
<!ENTITY less-ch6-du "3.6 MB">
<!ENTITY less-ch6-sbu "0.1 SBU">
-<!ENTITY lfs-bootscripts-version "20150208"> <!-- Scripts depend on this format -->
+<!ENTITY lfs-bootscripts-version "20150222"> <!-- Scripts depend on this format -->
<!ENTITY lfs-bootscripts-size "BOOTSCRIPTS-SIZE KB"> <!-- Updated in Makefile -->
<!ENTITY lfs-bootscripts-url "&downloads-root;lfs-bootscripts-&lfs-bootscripts-version;.tar.bz2">
<!ENTITY lfs-bootscripts-md5 "BOOTSCRIPTS-MD5SUM"> <!-- Updated in Makefile -->