mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-06-19 03:39:20 +01:00
Updates to boot scripts:
general cleanup; move consolelog function to rc; clean up boot logging functions; fix interactive prompt between run level S and target run level. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@9661 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
parent
b15d6da86b
commit
9813d5e328
@ -73,11 +73,6 @@
|
|||||||
<screen>&mountvirtfs;</screen>
|
<screen>&mountvirtfs;</screen>
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
<sect1 id="consolelog" role="wrap">
|
|
||||||
<title>/etc/rc.d/init.d/consolelog</title>
|
|
||||||
<screen>&consolelog;</screen>
|
|
||||||
</sect1>
|
|
||||||
|
|
||||||
<sect1 id="modules" role="wrap">
|
<sect1 id="modules" role="wrap">
|
||||||
<title>/etc/rc.d/init.d/modules</title>
|
<title>/etc/rc.d/init.d/modules</title>
|
||||||
<screen>&modules;</screen>
|
<screen>&modules;</screen>
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
2011-11-14 Bruce Dubbs <bdubbs@linuxfromscratch.org>
|
||||||
|
|
||||||
|
* The following are from suggestions by DJ Lucas
|
||||||
|
** General cleanup of scripts
|
||||||
|
** Move consolelog function to rc
|
||||||
|
** Clean up boot logging functions
|
||||||
|
** Fix interactive prompt between run level S and target run level
|
||||||
|
|
||||||
2011-10-06 Bryan Kadzban <bryan@linuxfromscratch.org>
|
2011-10-06 Bryan Kadzban <bryan@linuxfromscratch.org>
|
||||||
|
|
||||||
* Add configuration for udev_retry, and remove --type=failed (which does
|
* Add configuration for udev_retry, and remove --type=failed (which does
|
||||||
|
@ -24,15 +24,14 @@ create-dirs:
|
|||||||
install -d -m ${DIRMODE} ${LIBDIR}
|
install -d -m ${DIRMODE} ${LIBDIR}
|
||||||
install -d -m ${DIRMODE} ${MAN8}
|
install -d -m ${DIRMODE} ${MAN8}
|
||||||
install -d -m ${DIRMODE} ${SBIN}
|
install -d -m ${DIRMODE} ${SBIN}
|
||||||
ln -svf services ${DESTDIR}/lib/lsb
|
ln -sfn services ${DESTDIR}/lib/lsb
|
||||||
ln -sf rc.d/init.d ${EXTDIR}/init.d
|
ln -sfn rc.d/init.d ${EXTDIR}/init.d
|
||||||
|
|
||||||
files: create-dirs
|
files: create-dirs
|
||||||
install -m ${MODE} lfs/init.d/checkfs ${EXTDIR}/rc.d/init.d/
|
install -m ${MODE} lfs/init.d/checkfs ${EXTDIR}/rc.d/init.d/
|
||||||
install -m ${MODE} lfs/init.d/cleanfs ${EXTDIR}/rc.d/init.d/
|
install -m ${MODE} lfs/init.d/cleanfs ${EXTDIR}/rc.d/init.d/
|
||||||
install -m ${MODE} lfs/init.d/halt ${EXTDIR}/rc.d/init.d/
|
install -m ${MODE} lfs/init.d/halt ${EXTDIR}/rc.d/init.d/
|
||||||
install -m ${MODE} lfs/init.d/console ${EXTDIR}/rc.d/init.d/
|
install -m ${MODE} lfs/init.d/console ${EXTDIR}/rc.d/init.d/
|
||||||
install -m ${MODE} lfs/init.d/consolelog ${EXTDIR}/rc.d/init.d/
|
|
||||||
install -m ${CONFMODE} lfs/init.d/functions ${EXTDIR}/rc.d/init.d/
|
install -m ${CONFMODE} lfs/init.d/functions ${EXTDIR}/rc.d/init.d/
|
||||||
install -m ${MODE} lfs/init.d/localnet ${EXTDIR}/rc.d/init.d/
|
install -m ${MODE} lfs/init.d/localnet ${EXTDIR}/rc.d/init.d/
|
||||||
install -m ${MODE} lfs/init.d/modules ${EXTDIR}/rc.d/init.d/
|
install -m ${MODE} lfs/init.d/modules ${EXTDIR}/rc.d/init.d/
|
||||||
@ -76,7 +75,6 @@ links: rcS rc0 rc1 rc2 rc3 rc4 rc5 rc6
|
|||||||
|
|
||||||
rcS: files
|
rcS: files
|
||||||
ln -sf ../init.d/mountvirtfs ${EXTDIR}/rc.d/rcS.d/S00mountvirtfs
|
ln -sf ../init.d/mountvirtfs ${EXTDIR}/rc.d/rcS.d/S00mountvirtfs
|
||||||
ln -sf ../init.d/consolelog ${EXTDIR}/rc.d/rcS.d/S02consolelog
|
|
||||||
ln -sf ../init.d/modules ${EXTDIR}/rc.d/rcS.d/S05modules
|
ln -sf ../init.d/modules ${EXTDIR}/rc.d/rcS.d/S05modules
|
||||||
ln -sf ../init.d/localnet ${EXTDIR}/rc.d/rcS.d/S08localnet
|
ln -sf ../init.d/localnet ${EXTDIR}/rc.d/rcS.d/S08localnet
|
||||||
ln -sf ../init.d/udev ${EXTDIR}/rc.d/rcS.d/S10udev
|
ln -sf ../init.d/udev ${EXTDIR}/rc.d/rcS.d/S10udev
|
||||||
|
@ -79,7 +79,7 @@ case "${1}" in
|
|||||||
|
|
||||||
log_info_msg "Checking file systems..."
|
log_info_msg "Checking file systems..."
|
||||||
# Note: -a option used to be -p; but this fails e.g. on fsck.minix
|
# Note: -a option used to be -p; but this fails e.g. on fsck.minix
|
||||||
fsck ${options} -a -A -C -T
|
fsck ${options} -a -A -C -T >/dev/null
|
||||||
error_value=${?}
|
error_value=${?}
|
||||||
|
|
||||||
if [ "${error_value}" = 0 ]; then
|
if [ "${error_value}" = 0 ]; then
|
||||||
|
@ -90,7 +90,7 @@ case "${1}" in
|
|||||||
log_info_msg "Cleaning file systems:"
|
log_info_msg "Cleaning file systems:"
|
||||||
|
|
||||||
if [ "${SKIPTMPCLEAN}" = "" ]; then
|
if [ "${SKIPTMPCLEAN}" = "" ]; then
|
||||||
log_info_msg2 "\n /tmp"
|
log_info_msg2 " /tmp"
|
||||||
cd /tmp &&
|
cd /tmp &&
|
||||||
find . -xdev -mindepth 1 ! -name lost+found -delete || failed=1
|
find . -xdev -mindepth 1 ! -name lost+found -delete || failed=1
|
||||||
fi
|
fi
|
||||||
|
@ -1,78 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
########################################################################
|
|
||||||
# Begin consolelog
|
|
||||||
#
|
|
||||||
# Description : Set the kernel log level for the console
|
|
||||||
#
|
|
||||||
# Authors : Dan Nicholson - dnicholson@linuxfromscratch.org
|
|
||||||
# Gerard Beekmans - gerard@linuxfromscratch.org
|
|
||||||
# DJ Lucas - dj@linuxfromscratch.org
|
|
||||||
# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
|
|
||||||
#
|
|
||||||
# Version : LFS 7.0
|
|
||||||
#
|
|
||||||
# Notes : /proc must be mounted before this can run
|
|
||||||
#
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: consolelog
|
|
||||||
# Required-Start:
|
|
||||||
# Should-Start:
|
|
||||||
# Required-Stop:
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: S
|
|
||||||
# Default-Stop:
|
|
||||||
# Short-Description: Sets the console log level.
|
|
||||||
# Description: Sets the console log level.
|
|
||||||
# X-LFS-Provided-By: LFS
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
# set the default loglevel if needed
|
|
||||||
LOGLEVEL=${LOGLEVEL:-7}
|
|
||||||
|
|
||||||
[ -r /etc/sysconfig/console ] && . /etc/sysconfig/console
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
start)
|
|
||||||
case "$LOGLEVEL" in
|
|
||||||
[1-8])
|
|
||||||
log_info_msg "Setting the console log level to ${LOGLEVEL}..."
|
|
||||||
dmesg -n $LOGLEVEL
|
|
||||||
evaluate_retval
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
log_failure_msg "Console log level '${LOGLEVEL}' is invalid"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
|
|
||||||
status)
|
|
||||||
# Read the current value if possible
|
|
||||||
if [ -r /proc/sys/kernel/printk ]; then
|
|
||||||
read level line < /proc/sys/kernel/printk
|
|
||||||
else
|
|
||||||
log_failure_msg "Can't read the current console log level"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Print the value
|
|
||||||
if [ -n "$level" ]; then
|
|
||||||
log_info_msg "The current console log level is ${level}\n"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Usage: ${0} {start|status}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End consolelog
|
|
@ -36,15 +36,15 @@ case "${1}" in
|
|||||||
mount -n /run || failed=1
|
mount -n /run || failed=1
|
||||||
mkdir -p /run/{var,lock,shm}
|
mkdir -p /run/{var,lock,shm}
|
||||||
|
|
||||||
log_info_msg "Mounting virtual file systems: /run"
|
log_info_msg "Mounting virtual file systems: ${INFO}/run"
|
||||||
|
|
||||||
if ! mountpoint /proc >/dev/null; then
|
if ! mountpoint /proc >/dev/null; then
|
||||||
log_info_msg2 " /proc"
|
log_info_msg2 " ${INFO}/proc"
|
||||||
mount -n /proc || failed=1
|
mount -n /proc || failed=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! mountpoint /sys >/dev/null; then
|
if ! mountpoint /sys >/dev/null; then
|
||||||
log_info_msg2 " /sys"
|
log_info_msg2 " ${INFO}/sys"
|
||||||
mount -n /sys || failed=1
|
mount -n /sys || failed=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -93,20 +93,23 @@ trap "" INT QUIT TSTP
|
|||||||
|
|
||||||
[ "${1}" != "" ] && runlevel=${1}
|
[ "${1}" != "" ] && runlevel=${1}
|
||||||
|
|
||||||
if [ "${runlevel}" = "" ]; then
|
if [ "${runlevel}" == "" ]; then
|
||||||
echo "Usage: ${0} <runlevel>" >&2
|
echo "Usage: ${0} <runlevel>" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
previous=${PREVLEVEL}
|
previous=${PREVLEVEL}
|
||||||
[ "${previous}" = "" ] && previous=N
|
[ "${previous}" == "" ] && previous=N
|
||||||
|
|
||||||
if [ ! -d /etc/rc.d/rc${runlevel}.d ]; then
|
if [ ! -d /etc/rc.d/rc${runlevel}.d ]; then
|
||||||
log_info_msg "/etc/rc.d/rc${runlevel}.d does not exist.\n"
|
log_info_msg "/etc/rc.d/rc${runlevel}.d does not exist.\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$runlevel" == "6" ] || [ "$runlevel" == "0" ]; then IPROMPT="no"; fi
|
if [ "$runlevel" == "6" -o "$runlevel" == "0" ]; then IPROMPT="no"; fi
|
||||||
|
|
||||||
|
# Note: In ${LOGLEVEL:-7}, it is ':' 'dash' '7', not minus 7
|
||||||
|
if [ "$runlevel" == "S" ]; then dmesg -n "${LOGLEVEL:-7}"; fi
|
||||||
|
|
||||||
if [ "${IPROMPT}" == "yes" ]; then
|
if [ "${IPROMPT}" == "yes" ]; then
|
||||||
# dcol and icol are spaces before the message to center the
|
# dcol and icol are spaces before the message to center the
|
||||||
@ -115,16 +118,20 @@ if [ "${IPROMPT}" == "yes" ]; then
|
|||||||
wcol=$(( ( ${COLUMNS} - ${wlen} ) / 2 ))
|
wcol=$(( ( ${COLUMNS} - ${wlen} ) / 2 ))
|
||||||
icol=$(( ( ${COLUMNS} - ${ilen} ) / 2 ))
|
icol=$(( ( ${COLUMNS} - ${ilen} ) / 2 ))
|
||||||
|
|
||||||
|
echo -e "\n\n"
|
||||||
echo -e "\\033[${wcol}G${welcome_message}"
|
echo -e "\\033[${wcol}G${welcome_message}"
|
||||||
echo -e "\\033[${icol}G${i_message}${NORMAL}"
|
echo -e "\\033[${icol}G${i_message}${NORMAL}"
|
||||||
echo ""
|
echo ""
|
||||||
read -t "${itime}" -n 1 interactive 2>&1 > /dev/null
|
read -t "${itime}" -n 1 interactive 2>&1 > /dev/null
|
||||||
|
|
||||||
# Make lower case
|
|
||||||
[ "${interactive}" == "I" ] && interactive="i"
|
|
||||||
[ "${interactive}" != "i" ] && interactive=""
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Make lower case
|
||||||
|
[ "${interactive}" == "I" ] && interactive="i"
|
||||||
|
[ "${interactive}" != "i" ] && interactive=""
|
||||||
|
|
||||||
|
# Read the state file if it exists from runlevel S
|
||||||
|
[ -r /var/run/interactive ] && source /var/run/interactive
|
||||||
|
|
||||||
# Attempt to stop all services started by the previous runlevel,
|
# Attempt to stop all services started by the previous runlevel,
|
||||||
# and killed in this runlevel
|
# and killed in this runlevel
|
||||||
if [ "${previous}" != "N" ]; then
|
if [ "${previous}" != "N" ]; then
|
||||||
@ -136,8 +143,8 @@ if [ "${previous}" != "N" ]; then
|
|||||||
prev_start=/etc/rc.d/rc$previous.d/S[0-9][0-9]$suffix
|
prev_start=/etc/rc.d/rc$previous.d/S[0-9][0-9]$suffix
|
||||||
sysinit_start=/etc/rc.d/rcS.d/S[0-9][0-9]$suffix
|
sysinit_start=/etc/rc.d/rcS.d/S[0-9][0-9]$suffix
|
||||||
|
|
||||||
if [ "${runlevel}" != "0" ] && [ "${runlevel}" != "6" ]; then
|
if [ "${runlevel}" != "0" -a "${runlevel}" != "6" ]; then
|
||||||
if [ ! -f ${prev_start} ] && [ ! -f ${sysinit_start} ]; then
|
if [ ! -f ${prev_start} -a ! -f ${sysinit_start} ]; then
|
||||||
MSG="WARNING:\n\n${i} can't be "
|
MSG="WARNING:\n\n${i} can't be "
|
||||||
MSG="${MSG}executed because it was not "
|
MSG="${MSG}executed because it was not "
|
||||||
MSG="${MSG}not started in the previous "
|
MSG="${MSG}not started in the previous "
|
||||||
@ -156,7 +163,7 @@ fi
|
|||||||
|
|
||||||
if [ "${previous}" == "N" ]; then export IN_BOOT=1; fi
|
if [ "${previous}" == "N" ]; then export IN_BOOT=1; fi
|
||||||
|
|
||||||
if [ "$runlevel" == "6" ] && [ -n "${FASTBOOT}" ]; then
|
if [ "$runlevel" == "6" -a -n "${FASTBOOT}" ]; then
|
||||||
touch /fastboot
|
touch /fastboot
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -169,7 +176,7 @@ do
|
|||||||
stop=/etc/rc.d/rc$runlevel.d/K[0-9][0-9]$suffix
|
stop=/etc/rc.d/rc$runlevel.d/K[0-9][0-9]$suffix
|
||||||
prev_start=/etc/rc.d/rc$previous.d/S[0-9][0-9]$suffix
|
prev_start=/etc/rc.d/rc$previous.d/S[0-9][0-9]$suffix
|
||||||
|
|
||||||
[ -f ${prev_start} ] && [ ! -f ${stop} ] && continue
|
[ -f ${prev_start} -a ! -f ${stop} ] && continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
check_script_status
|
check_script_status
|
||||||
@ -188,10 +195,23 @@ do
|
|||||||
if [ "${error_value}" != "0" ]; then print_error_msg; fi
|
if [ "${error_value}" != "0" ]; then print_error_msg; fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Store interactive variable on switch from runlevel S and remove if not
|
||||||
|
if [ "${runlevel}" == "S" -a "${interactive}" == "i" ]; then
|
||||||
|
echo "interactive=\"i\"" > /var/run/interactive
|
||||||
|
else
|
||||||
|
rm -f /var/run/interactive 2> /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
# Copy the boot log on initial boot only
|
# Copy the boot log on initial boot only
|
||||||
if [ "${previous}" == "N" ]; then
|
if [ "${previous}" == "N" ]; then
|
||||||
cat /run/var/bootlog >> /var/log/boot.log
|
cat /run/var/bootlog >> /var/log/boot.log
|
||||||
echo "--------" >> /var/log/boot.log # Mark the end of boot
|
|
||||||
|
if [ "${runlevel}" != "S" ]; then
|
||||||
|
# Mark the end of boot
|
||||||
|
echo "--------" >> /var/log/boot.log
|
||||||
|
# Remove the temporary file
|
||||||
|
rm -f /run/var/bootlog 2> /dev/null
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# End rc
|
# End rc
|
||||||
|
@ -84,7 +84,7 @@ case "${1}" in
|
|||||||
|
|
||||||
# Now wait for udevd to process the uevents we triggered
|
# Now wait for udevd to process the uevents we triggered
|
||||||
/sbin/udevadm settle
|
/sbin/udevadm settle
|
||||||
log_success_msg2
|
#log_success_msg2
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
@ -56,7 +56,7 @@ case "${1}" in
|
|||||||
|
|
||||||
# Now wait for udevd to process the uevents we triggered
|
# Now wait for udevd to process the uevents we triggered
|
||||||
/sbin/udevadm settle
|
/sbin/udevadm settle
|
||||||
evaluate_retval
|
#evaluate_retval
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
|
@ -43,6 +43,7 @@ WCOL=$((${COL} - 2))
|
|||||||
SET_COL="\\033[${COL}G" # at the $COL char
|
SET_COL="\\033[${COL}G" # at the $COL char
|
||||||
SET_WCOL="\\033[${WCOL}G" # at the $WCOL 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_UP="\\033[1A\\033[0G" # Up one line, at the 0'th char
|
||||||
|
CURS_ZERO="\\033[0G"
|
||||||
|
|
||||||
## Set color commands, used via echo
|
## Set color commands, used via echo
|
||||||
# Please consult `man console_codes for more information
|
# Please consult `man console_codes for more information
|
||||||
@ -60,6 +61,12 @@ FAILURE="\\033[1;31m" # Failures are red
|
|||||||
INFO="\\033[1;36m" # Information is light cyan
|
INFO="\\033[1;36m" # Information is light cyan
|
||||||
BRACKET="\\033[1;34m" # Brackets are blue
|
BRACKET="\\033[1;34m" # Brackets are blue
|
||||||
|
|
||||||
|
# Use a colored prefix
|
||||||
|
BMPREFIX=" "
|
||||||
|
SUCCESS_PREFIX="${SUCCESS} * ${NORMAL}"
|
||||||
|
FAILURE_PREFIX="${FAILURE}*****${NORMAL}"
|
||||||
|
WARNING_PREFIX="${WARNING} *** ${NORMAL}"
|
||||||
|
|
||||||
BOOTLOG=/run/var/bootlog
|
BOOTLOG=/run/var/bootlog
|
||||||
KILLDELAY=3
|
KILLDELAY=3
|
||||||
|
|
||||||
@ -171,7 +178,6 @@ start_daemon()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Do the start!
|
# Do the start!
|
||||||
|
|
||||||
nice -n "${nice}" "${@}"
|
nice -n "${nice}" "${@}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -470,22 +476,20 @@ pidofproc()
|
|||||||
# Inputs: -p pidfile, use the specified pidfile instead of pidof #
|
# Inputs: -p pidfile, use the specified pidfile instead of pidof #
|
||||||
# pathname, path to the specified program #
|
# pathname, path to the specified program #
|
||||||
# #
|
# #
|
||||||
# Note: Output to stdout. Not logged. #
|
|
||||||
# #
|
|
||||||
# Return values: #
|
# Return values: #
|
||||||
# 0 - Status printed #
|
# 0 - Status printed #
|
||||||
# 1 - Input error. The daemon to check was not specified. #
|
# 1 - Input error. The daemon to check was not specified. #
|
||||||
################################################################################
|
################################################################################
|
||||||
statusproc()
|
statusproc()
|
||||||
{
|
{
|
||||||
if [ "${#}" = "0" ]; then
|
|
||||||
echo "Usage: statusproc {program}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
local pidfile
|
local pidfile
|
||||||
local pidlist
|
local pidlist
|
||||||
|
|
||||||
|
if [ "${#}" = "0" ]; then
|
||||||
|
echo "Usage: [-p pidfle] statusproc {program}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Process arguments
|
# Process arguments
|
||||||
while true; do
|
while true; do
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
@ -494,6 +498,15 @@ statusproc()
|
|||||||
pidfile="${2}"
|
pidfile="${2}"
|
||||||
shift 2
|
shift 2
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
if [ -n "${2}" ]; then
|
||||||
|
echo "Too many arguments"
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -516,7 +529,7 @@ statusproc()
|
|||||||
echo -e "${WARNING}${1} is not running but" \
|
echo -e "${WARNING}${1} is not running but" \
|
||||||
"/var/run/${base}.pid exists.${NORMAL}"
|
"/var/run/${base}.pid exists.${NORMAL}"
|
||||||
else
|
else
|
||||||
if [ -z "${pidlist}" -a -n "${pidfile}" ]; then
|
if [ -n "${pidfile}" -a -e "${pidfile}" ]; then
|
||||||
echo -e "${WARNING}${1} is not running" \
|
echo -e "${WARNING}${1} is not running" \
|
||||||
"but ${pidfile} exists.${NORMAL}"
|
"but ${pidfile} exists.${NORMAL}"
|
||||||
else
|
else
|
||||||
@ -553,20 +566,25 @@ timespec()
|
|||||||
################################################################################
|
################################################################################
|
||||||
log_success_msg()
|
log_success_msg()
|
||||||
{
|
{
|
||||||
echo -n -e "${@}"
|
echo -n -e "${BMPREFIX}${@}"
|
||||||
echo -e "${SET_COL}${BRACKET}[${SUCCESS} OK ${BRACKET}]${NORMAL}"
|
echo -e "${CURS_ZERO}${SUCCESS_PREFIX}${SET_COL}${BRACKET}[${SUCCESS} OK ${BRACKET}]${NORMAL}"
|
||||||
|
|
||||||
|
# Strip non-printable characters from log file
|
||||||
|
local logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
|
||||||
|
|
||||||
timespec
|
timespec
|
||||||
echo -e "${STAMP} ${@} OK" >> ${BOOTLOG}
|
echo -e "${STAMP} ${logmessage} OK" >> ${BOOTLOG}
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
log_success_msg2()
|
log_success_msg2()
|
||||||
{
|
{
|
||||||
echo -n -e "${@}"
|
echo -n -e "${BMPREFIX}${@}"
|
||||||
echo -e "${SET_COL}${BRACKET}[${SUCCESS} OK ${BRACKET}]${NORMAL}"
|
echo -e "${CURS_ZERO}${SUCCESS_PREFIX}${SET_COL}${BRACKET}[${SUCCESS} OK ${BRACKET}]${NORMAL}"
|
||||||
|
|
||||||
echo " OK" >> ${BOOTLOG}
|
echo " OK" >> ${BOOTLOG}
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -583,20 +601,25 @@ log_success_msg2()
|
|||||||
################################################################################
|
################################################################################
|
||||||
log_failure_msg()
|
log_failure_msg()
|
||||||
{
|
{
|
||||||
echo -n -e "${@}"
|
echo -n -e "${BMPREFIX}${@}"
|
||||||
echo -e "${SET_COL}${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"
|
echo -e "${CURS_ZERO}${FAILURE_PREFIX}${SET_COL}${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"
|
||||||
|
|
||||||
|
# Strip non-printable characters from log file
|
||||||
|
|
||||||
timespec
|
timespec
|
||||||
echo -e "${STAMP} ${@} FAIL" >> ${BOOTLOG}
|
local logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
|
||||||
|
echo -e "${STAMP} ${logmessage} FAIL" >> ${BOOTLOG}
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
log_failure_msg2()
|
log_failure_msg2()
|
||||||
{
|
{
|
||||||
echo -n -e "${@}"
|
echo -n -e "${BMPREFIX}${@}"
|
||||||
echo -e "${SET_COL}${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"
|
echo -e "${CURS_ZERO}${FAILURE_PREFIX}${SET_COL}${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"
|
||||||
|
|
||||||
echo "FAIL" >> ${BOOTLOG}
|
echo "FAIL" >> ${BOOTLOG}
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -611,11 +634,14 @@ log_failure_msg2()
|
|||||||
################################################################################
|
################################################################################
|
||||||
log_warning_msg()
|
log_warning_msg()
|
||||||
{
|
{
|
||||||
echo -n -e "${@}"
|
echo -n -e "${BMPREFIX}${@}"
|
||||||
echo -e "${SET_COL}${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}"
|
echo -e "${CURS_ZERO}${WARNING_PREFIX}${SET_COL}${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}"
|
||||||
|
|
||||||
|
# Strip non-printable characters from log file
|
||||||
|
local logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
|
||||||
timespec
|
timespec
|
||||||
echo -e "${STAMP} ${@} WARN" >> ${BOOTLOG}
|
echo -e "${STAMP} ${logmessage} WARN" >> ${BOOTLOG}
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -630,10 +656,13 @@ log_warning_msg()
|
|||||||
################################################################################
|
################################################################################
|
||||||
log_info_msg()
|
log_info_msg()
|
||||||
{
|
{
|
||||||
echo -n -e "${@}"
|
echo -n -e "${BMPREFIX}${@}"
|
||||||
|
|
||||||
|
# Strip non-printable characters from log file
|
||||||
|
local logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
|
||||||
timespec
|
timespec
|
||||||
echo -n -e "${STAMP} ${@}" >> ${BOOTLOG}
|
echo -n -e "${STAMP} ${logmessage}" >> ${BOOTLOG}
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -641,7 +670,10 @@ log_info_msg2()
|
|||||||
{
|
{
|
||||||
echo -n -e "${@}"
|
echo -n -e "${@}"
|
||||||
|
|
||||||
echo -n -e "${@}" >> ${BOOTLOG}
|
# Strip non-printable characters from log file
|
||||||
|
local logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
|
||||||
|
echo -n -e "${logmessage}" >> ${BOOTLOG}
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,11 +2,21 @@
|
|||||||
# Optional parameters for boot scripts.
|
# Optional parameters for boot scripts.
|
||||||
|
|
||||||
# Distro Information
|
# Distro Information
|
||||||
DISTRO="Linux From Scratch" # The distro name
|
# These values, if specified here, override the defaults
|
||||||
DISTRO_CONTACT="lfs-dev@linuxfromscratch.org" # Bug report address
|
#DISTRO="Linux From Scratch" # The distro name
|
||||||
DISTRO_MINI="LFS" # Short name used in filenames for distro config
|
#DISTRO_CONTACT="lfs-dev@linuxfromscratch.org" # Bug report address
|
||||||
|
#DISTRO_MINI="LFS" # Short name used in filenames for distro config
|
||||||
|
|
||||||
# Define custom colors used in messages printed to the screen
|
# Define custom colors used in messages printed to the screen
|
||||||
|
|
||||||
|
# Please consult `man console_codes` for more information
|
||||||
|
# under the "ECMA-48 Set Graphics Rendition" section
|
||||||
|
#
|
||||||
|
# Warning: when switching from a 8bit to a 9bit font,
|
||||||
|
# the linux console will reinterpret the bold (1;) to
|
||||||
|
# the top 256 glyphs of the 9bit font. This does
|
||||||
|
# not affect framebuffer consoles
|
||||||
|
|
||||||
# These values, if specified here, override the defaults
|
# These values, if specified here, override the defaults
|
||||||
#BRACKET="\\033[1;34m" # Blue
|
#BRACKET="\\033[1;34m" # Blue
|
||||||
#FAILURE="\\033[1;31m" # Red
|
#FAILURE="\\033[1;31m" # Red
|
||||||
@ -15,9 +25,16 @@ DISTRO_MINI="LFS" # Short name used in filenames for distro config
|
|||||||
#SUCCESS="\\033[1;32m" # Green
|
#SUCCESS="\\033[1;32m" # Green
|
||||||
#WARNING="\\033[1;33m" # Yellow
|
#WARNING="\\033[1;33m" # Yellow
|
||||||
|
|
||||||
|
# Use a colored prefix
|
||||||
|
# These values, if specified here, override the defaults
|
||||||
|
#BMPREFIX=" "
|
||||||
|
#SUCCESS_PREFIX="${SUCCESS} * ${NORMAL}"
|
||||||
|
#FAILURE_PREFIX="${FAILURE}*****${NORMAL}"
|
||||||
|
#WARNING_PREFIX="${WARNING} *** ${NORMAL}"
|
||||||
|
|
||||||
# Interactive startup
|
# Interactive startup
|
||||||
#IPROMPT="yes" # Whether to display the interactive boot promp
|
#IPROMPT="yes" # Whether to display the interactive boot promp
|
||||||
itime="10" # The ammount of time (in seconds) to display the prompt
|
itime="3" # The ammount of time (in seconds) to display the prompt
|
||||||
|
|
||||||
# The total length of the distro welcome string, without escape codes
|
# The total length of the distro welcome string, without escape codes
|
||||||
wlen=$(echo "Welcome to ${DISTRO}" | wc -c )
|
wlen=$(echo "Welcome to ${DISTRO}" | wc -c )
|
||||||
|
@ -36,6 +36,20 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
<listitem>
|
||||||
|
<para>2011-11-14</para>
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>[bdubbs] - Updates to boot scripts:
|
||||||
|
general cleanup;
|
||||||
|
move consolelog function to rc;
|
||||||
|
clean up boot logging functions;
|
||||||
|
fix interactive prompt between run level S and target run level.
|
||||||
|
Thanks to DJ Lucas.</para>
|
||||||
|
</listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>2011-10-29</para>
|
<para>2011-10-29</para>
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<!ENTITY version "SVN-20111108">
|
<!ENTITY version "SVN-20111114">
|
||||||
<!ENTITY releasedate "Nov 8, 2011">
|
<!ENTITY releasedate "Nov 14, 2011">
|
||||||
<!ENTITY copyrightdate "1999-2011"><!-- jhalfs needs a literal dash, not – -->
|
<!ENTITY copyrightdate "1999-2011"><!-- jhalfs needs a literal dash, not – -->
|
||||||
<!ENTITY milestone "7.1">
|
<!ENTITY milestone "7.1">
|
||||||
<!ENTITY generic-version "development"> <!-- Use "development", "testing", or "x.y[-pre{x}]" -->
|
<!ENTITY generic-version "development"> <!-- Use "development", "testing", or "x.y[-pre{x}]" -->
|
||||||
|
@ -298,7 +298,7 @@
|
|||||||
<!ENTITY less-ch6-du "3.5 MB">
|
<!ENTITY less-ch6-du "3.5 MB">
|
||||||
<!ENTITY less-ch6-sbu "less than 0.1 SBU">
|
<!ENTITY less-ch6-sbu "less than 0.1 SBU">
|
||||||
|
|
||||||
<!ENTITY lfs-bootscripts-version "20111108"> <!-- Scripts depend on this format -->
|
<!ENTITY lfs-bootscripts-version "20111114"> <!-- Scripts depend on this format -->
|
||||||
<!ENTITY lfs-bootscripts-size "BOOTSCRIPTS-SIZE KB"> <!-- Updated in Makefile -->
|
<!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-url "&downloads-root;lfs-bootscripts-&lfs-bootscripts-version;.tar.bz2">
|
||||||
<!ENTITY lfs-bootscripts-md5 "BOOTSCRIPTS-MD5SUM"> <!-- Updated in Makefile -->
|
<!ENTITY lfs-bootscripts-md5 "BOOTSCRIPTS-MD5SUM"> <!-- Updated in Makefile -->
|
||||||
|
Loading…
Reference in New Issue
Block a user