Merge branch 'trunk' into xry111/clfs-ng

This commit is contained in:
Xi Ruoyao 2022-03-26 23:10:13 +08:00
commit d6796c80dd
No known key found for this signature in database
GPG Key ID: D95E4716CCBB34DC
22 changed files with 99 additions and 77 deletions

View File

@ -1,3 +1,8 @@
2022-03-24 Pierre Labastie <pierre dot labastie at neuf dot fr>
* New semantics for K and S scripts:
- S scripts only started if not already marked S in the previous runlevel
- K scripts only started if not already marked K in the previous runlevel
- remove the convention of running S scripts ith "stop" in rl 0/6
2021-06-08 Bruce Dubbs <bdubbs@linuxfromscratch.org>
* When shutting down the network, ignore invalid interfaces
or interfaces that are not UP.

View File

@ -88,10 +88,10 @@ rcS: files
rc0: files
ln -sf ../init.d/network ${ETCDIR}/rc.d/rc0.d/K80network
ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc0.d/K90sysklogd
ln -sf ../init.d/sendsignals ${ETCDIR}/rc.d/rc0.d/S60sendsignals
ln -sf ../init.d/swap ${ETCDIR}/rc.d/rc0.d/S65swap
ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rc0.d/S70mountfs
ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rc0.d/S90localnet
ln -sf ../init.d/sendsignals ${ETCDIR}/rc.d/rc0.d/K92sendsignals
ln -sf ../init.d/swap ${ETCDIR}/rc.d/rc0.d/K94swap
ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rc0.d/K96mountfs
ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rc0.d/K98localnet
ln -sf ../init.d/halt ${ETCDIR}/rc.d/rc0.d/S99halt
rc1: files
@ -99,8 +99,8 @@ rc1: files
ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc1.d/K90sysklogd
rc2: files
ln -sf ../init.d/network ${ETCDIR}/rc.d/rc2.d/K80network
ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc2.d/K90sysklogd
ln -sf ../init.d/network ${ETCDIR}/rc.d/rc2.d/S10network
ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc2.d/S20sysklogd
rc3: files
ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc3.d/S10sysklogd
@ -117,10 +117,10 @@ rc5: files
rc6: files
ln -sf ../init.d/network ${ETCDIR}/rc.d/rc6.d/K80network
ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc6.d/K90sysklogd
ln -sf ../init.d/sendsignals ${ETCDIR}/rc.d/rc6.d/S60sendsignals
ln -sf ../init.d/swap ${ETCDIR}/rc.d/rc6.d/S65swap
ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rc6.d/S70mountfs
ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rc6.d/S90localnet
ln -sf ../init.d/sendsignals ${ETCDIR}/rc.d/rc0.d/K92sendsignals
ln -sf ../init.d/swap ${ETCDIR}/rc.d/rc0.d/K94swap
ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rc0.d/K96mountfs
ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rc0.d/K98localnet
ln -sf ../init.d/reboot ${ETCDIR}/rc.d/rc6.d/S99reboot
uninstall:

View File

@ -32,11 +32,6 @@
# Native English speakers probably don't have /etc/sysconfig/console at all
[ -r /etc/sysconfig/console ] && . /etc/sysconfig/console
is_true()
{
[ "$1" = "1" ] || [ "$1" = "yes" ] || [ "$1" = "true" ]
}
failed=0
case "${1}" in

View File

@ -7,14 +7,18 @@
# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
# DJ Lucas - dj@linuxfromscratch.org
# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
# : Pierre Labastie - pierre@linuxfromscratch.org
#
# Version : LFS 7.0
#
# Notes : Update March 24th, 2022: change "stop" to "start".
# Add the $last facility to Required-start
#
########################################################################
### BEGIN INIT INFO
# Provides: halt
# Required-Start:
# Required-Start: $last
# Should-Start:
# Required-Stop:
# Should-Stop:
@ -26,12 +30,12 @@
### END INIT INFO
case "${1}" in
stop)
start)
halt -d -f -i -p
;;
*)
echo "Usage: {stop}"
echo "Usage: {start}"
exit 1
;;
esac

View File

@ -20,8 +20,8 @@
# Should-Start: $syslog firewalld iptables nftables
# Required-Stop: $local_fs localnet swap
# Should-Stop: $syslog firewalld iptables nftables
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts and configures network interfaces.
# Description: Starts and configures network interfaces.
# X-LFS-Provided-By: LFS
@ -29,6 +29,8 @@
case "${1}" in
start)
# if the default route exists, network is already configured
if ip route | grep -q "^default"; then return 0; fi
# Start all network interfaces
for file in /etc/sysconfig/ifconfig.*
do

View File

@ -6,10 +6,18 @@
#
# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
# : DJ Lucas - dj@linuxfromscratch.org
# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
# Updates : Bruce Dubbs - bdubbs@linuxfromscratch.org
# : Pierre Labastie - pierre@linuxfromscratch.org
#
# Version : LFS 7.0
#
# Notes : Updates March 24th, 2022: new semantics of S/K files
# - Instead of testing that S scripts were K scripts in the
# previous runlevel, test that they were not S scripts
# - Instead of testing that K scripts were S scripts in the
# previous runlevel, test that they were not K scripts
# - S scripts in runlevel 0 or 6 are now run with
# "script start" (was "script stop" previously).
########################################################################
. /lib/lsb/init-functions
@ -144,8 +152,9 @@ fi
# Read the state file if it exists from runlevel S
[ -r /run/interactive ] && source /run/interactive
# Attempt to stop all services started by the previous runlevel,
# and killed in this runlevel
# Stop all services marked as K, except if marked as K in the previous
# runlevel: it is the responsibility of the script to not try to kill
# a non running service
if [ "${previous}" != "N" ]; then
for i in $(ls -v /etc/rc.d/rc${runlevel}.d/K* 2> /dev/null)
do
@ -155,20 +164,8 @@ if [ "${previous}" != "N" ]; then
continue
fi
suffix=${i#/etc/rc.d/rc$runlevel.d/K[0-9][0-9]}
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
if [ "${runlevel}" != "0" -a "${runlevel}" != "6" ]; then
if [ ! -f ${prev_start} -a ! -f ${sysinit_start} ]; then
MSG="WARNING:\n\n${i} can't be "
MSG="${MSG}executed because it was not "
MSG="${MSG}not started in the previous "
MSG="${MSG}runlevel (${previous})."
log_warning_msg "$MSG"
continue
fi
fi
suffix=${i#/etc/rc.d/rc${runlevel}.d/K[0-9][0-9]}
[ -e /etc/rc.d/rc${previous}.d/K[0-9][0-9]$suffix ] && continue
run ${i} stop
error_value=${?}
@ -184,15 +181,16 @@ if [ "$runlevel" == "6" -a -n "${FASTBOOT}" ]; then
fi
# Start all functions in this runlevel
# Start all services marked as S in this runlevel, except if marked as
# S in the previous runlevel
# it is the responsabily of the script to not try to start an already running
# service
for i in $( ls -v /etc/rc.d/rc${runlevel}.d/S* 2> /dev/null)
do
if [ "${previous}" != "N" ]; then
suffix=${i#/etc/rc.d/rc$runlevel.d/S[0-9][0-9]}
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
[ -f ${prev_start} -a ! -f ${stop} ] && continue
if [ "${previous}" != "N" ]; then
suffix=${i#/etc/rc.d/rc${runlevel}.d/S[0-9][0-9]}
[ -e /etc/rc.d/rc${previous}.d/S[0-9][0-9]$suffix ] && continue
fi
check_script_status
@ -201,14 +199,7 @@ do
continue
fi
case ${runlevel} in
0|6)
run ${i} stop
;;
*)
run ${i} start
;;
esac
error_value=${?}

View File

@ -6,15 +6,19 @@
#
# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
# DJ Lucas - dj@linuxfromscratch.org
# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
# Updates : Bruce Dubbs - bdubbs@linuxfromscratch.org
# : Pierre Labastie - pierre@linuxfromscratch.org
#
# Version : LFS 7.0
#
# Notes : Update March 24th, 2022: change "stop" to "start".
# Add the $last facility to Required-start
#
########################################################################
### BEGIN INIT INFO
# Provides: reboot
# Required-Start:
# Required-Start: $last
# Should-Start:
# Required-Stop:
# Should-Stop:
@ -28,13 +32,13 @@
. /lib/lsb/init-functions
case "${1}" in
stop)
start)
log_info_msg "Restarting system..."
reboot -d -f -i
;;
*)
echo "Usage: ${0} {stop}"
echo "Usage: ${0} {start}"
exit 1
;;

View File

@ -18,17 +18,14 @@
# Should-Start:
# Required-Stop: $local_fs
# Should-Stop: sendsignals
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts kernel and system log daemons.
# Description: Starts kernel and system log daemons.
# /etc/fstab.
# X-LFS-Provided-By: LFS
### END INIT INFO
# Note: sysklogd is not started in runlevel 2 due to possible
# remote logging configurations
. /lib/lsb/init-functions
case "${1}" in

View File

@ -30,12 +30,26 @@
case "${1}" in
start)
log_info_msg "Starting..."
# if it is possible to use start_daemon
start_daemon fully_qualified_path
# if it is not possible to use start_daemon
# (command to start the daemon is not simple enough)
if ! pidofproc daemon_name_as_reported_by_ps >/dev/null; then
command_to_start_the_service
fi
evaluate_retval
;;
stop)
log_info_msg "Stopping..."
# if it is possible to use killproc
killproc fully_qualified_path
# if it is not possible to use killproc
# (the daemon shoudn't be stopped by killing it)
if pidofproc daemon_name_as_reported_by_ps >/dev/null; then
command_to_stop_the_service
fi
evaluate_retval
;;
restart)

View File

@ -700,7 +700,7 @@ log_info_msg2()
################################################################################
# evaluate_retval() #
# Usage: Evaluate a return value and print success or failyure as appropriate #
# Usage: Evaluate a return value and print success or failure as appropriate #
# #
# Purpose: Convenience function to terminate an info message #
# #

View File

@ -40,6 +40,16 @@
appropriate for the entry or if needed the entire day's listitem.
-->
<listitem>
<para>2022-03-25</para>
<itemizedlist>
<listitem>
<para>[pierre] - Update bootscripts to 20220324. Fixes
<ulink url="&lfs-ticket-root;5027">#5027</ulink>.</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>2022-03-20</para>
<itemizedlist>

View File

@ -80,7 +80,7 @@ esac</userinput></screen>
cd build</userinput></screen>
<para>Ensure that the <command>ldconfig</command> and <command>sln</command>
utilites are installed into
utilities are installed into
<filename class="directory">/usr/sbin</filename>:</para>
<screen><userinput remap="pre">echo "rootsbindir=/usr/sbin" &gt; configparms</userinput></screen>

View File

@ -87,7 +87,7 @@
<note>
<para>
Because the backup archive is compressed, it takes a relatively
long time (over 10 minutes) even on a resonably fast system.
long time (over 10 minutes) even on a reasonably fast system.
</para>
</note>

View File

@ -72,7 +72,7 @@
<term><parameter>ADJTIME_PATH=/var/lib/hwclock/adjtime</parameter></term>
<listitem>
<para>This sets the location of the file recording information about
the hardware clock in accordance to the FHS. This is not stricly
the hardware clock in accordance to the FHS. This is not strictly
needed for this temporary tool, but it prevents creating a file
at another location, which would not be overwritten or removed
when building the final util-linux package.</para>

View File

@ -63,7 +63,7 @@
cd build</userinput></screen>
<para>Ensure that the <command>ldconfig</command> and <command>sln</command>
utilites will be installed into
utilities will be installed into
<filename class="directory">/usr/sbin</filename>:</para>
<screen><userinput remap="pre">echo "rootsbindir=/usr/sbin" &gt; configparms</userinput></screen>

View File

@ -24,7 +24,7 @@
<title/>
<para>Jinja2 is a Python module that implements a simple pythonic template
lanuage.</para>
language.</para>
<segmentedlist>
<segtitle>&buildtime;</segtitle>

View File

@ -44,7 +44,7 @@
<note>
<para>Similar to GMP, libffi builds with optimizations specific
to the proccesor in use. If building for another system, export
to the processor in use. If building for another system, export
CFLAGS and CXXFLAGS to specify a generic build for your architecture.
If this is not done, all applications that link to libffi will trigger
Illegal Operation Errors.</para>

View File

@ -41,7 +41,7 @@
rationale to use the <command>install</command> command here.</para>
<note><para>The ELF loader's name is ld-linux-x86-64.so.2 on 64-bit systems
and ld-linux.so.2 on 32-bit systems. The contruct below selects the
and ld-linux.so.2 on 32-bit systems. The construct below selects the
correct name for the current architecture.</para></note>
<!-- also of interest are libgfortan, libgo, libgomp, and libobjc from GCC -->

View File

@ -42,7 +42,7 @@
# Allow the command prompt to wrap to the next line
set horizontal-scroll-mode Off
# Enable 8bit input
# Enable 8-bit input
set meta-flag On
set input-meta On

View File

@ -163,7 +163,7 @@ EOF</userinput></screen>
<listitem>
<para><command>systemctl show -p Wants <replaceable>&lt;multi-user.target&gt;</replaceable></command>:
shows all units that depend on the multi-user target. Targets are
special unit files that are anogalous to runlevels under
special unit files that are analogous to runlevels under
SysVinit.</para>
</listitem>
<listitem>

View File

@ -157,7 +157,7 @@ EOF</userinput></screen>
script is run with the <parameter>stop</parameter> argument. When an S link
is encountered, the appropriate script is run with the
<parameter>start</parameter> argument.</para>
<!-- Changed for March 24th, 2022 version of bootscripts
<para>There is one exception to this explanation. Links that start
with an <emphasis>S</emphasis> in the <filename
class="directory">rc0.d</filename> and <filename
@ -170,7 +170,7 @@ EOF</userinput></screen>
run before any <emphasis>S</emphasis> prefixed scripts are run with the
<parameter>stop</parameter> parameter.
</para>
-->
<para>These are descriptions of what the arguments make the scripts
do:</para>

View File

@ -389,7 +389,7 @@
<!ENTITY less-fin-du "4.2 MB">
<!ENTITY less-fin-sbu "less than 0.1 SBU">
<!ENTITY lfs-bootscripts-version "20210608"> <!-- Scripts depend on this format -->
<!ENTITY lfs-bootscripts-version "20220324"> <!-- Scripts depend on this format -->
<!ENTITY lfs-bootscripts-size "BOOTSCRIPTS-SIZE KB">
<!ENTITY lfs-bootscripts-url "&downloads-root;lfs-bootscripts-&lfs-bootscripts-version;.tar.xz">
<!ENTITY lfs-bootscripts-md5 "BOOTSCRIPTS-MD5SUM">