Add boot/shutdown script customization instructions

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10016 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
Bruce Dubbs 2012-10-13 16:14:09 +00:00
parent 5cef3143bf
commit 12574f2c42
13 changed files with 128 additions and 20 deletions

View File

@ -1,3 +1,9 @@
2012-10-13 Bruce Dubbs <bdubbs@linuxfromscratch.org>
* Remove unneeded sleep in killproc
* Add option for verbose fsck
* Flatten directory structure of tarball
* Remove /fastboot or /forcecheck if set
2012-09-05 Bruce Dubbs <bdubbs@linuxfromscratch.org>
* Add udevadm trigger --action=change line to udev script
to support initramfs better

View File

@ -46,6 +46,7 @@ case "${1}" in
msg="/fastboot found, will omit "
msg="${msg} file system checks as requested.\n"
log_info_msg "${msg}"
rm /fastboot
exit 0
fi
@ -73,13 +74,20 @@ case "${1}" in
msg="${msg} system checks as requested."
log_success_msg "$msg"
options="-f"
rm /forcefsck
else
options=""
fi
log_info_msg "Checking file systems..."
# Note: -a option used to be -p; but this fails e.g. on fsck.minix
if is_true "$VERBOSE_FSCK"; then
fsck ${options} -a -A -C -T
else
fsck ${options} -a -A -C -T >/dev/null
fi
error_value=${?}
if [ "${error_value}" = 0 ]; then

View File

@ -344,10 +344,6 @@ killproc()
sleep 1
# Check again, and fail if still running
kill -0 "${pid}" 2> /dev/null && return 1
else
# just check one last time and if still alive, fail
sleep 1
kill -0 "${pid}" 2> /dev/null && return 1
fi
fi
done

View File

@ -50,8 +50,20 @@
# Skip reading from the console
#HEADLESS=yes
# Skip cleaning /tmp
#SKIPTMPCLEAN=yes
# Speed up boot without waiting for settle in udev_retry
#OMIT_UDEV_RETRY_SETTLE=yes
# Write out fsck progress if yes
#VERBOSE_FSCK=no
# Speed up boot without waiting for settle in udev
#OMIT_UDEV_SETTLE=y
# Speed up boot without waiting for settle in udev_retry
#OMIT_UDEV_RETRY_SETTLE=yes
# Skip cleaning /tmp if yes
#SKIPTMPCLEAN=no
# For setclock
#UTC=1

View File

@ -36,6 +36,16 @@
</listitem>
-->
<listitem>
<para>2012-09-27</para>
<itemizedlist>
<listitem>
<para>[bdubbs] - Add boot/shutdown script customization
instructions.</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>2012-10-02</para>
<itemizedlist>

View File

@ -32,5 +32,72 @@
<!-- Use role to fix a pdf generation problem -->
<screen role="auto">&site;</screen>
<sect2>
<title>Customizing the Boot and Shutdown Scripts</title>
<para>The LFS boot scripts boot and shut down a system in a fairly
efficient manner, but there are a few tweaks that you can make in the
rc.site file to improve speed even more and to adjust messages accoring
to your preferences. To do this, adjust the settings in
the <filename>/etc/sysconfig/rc.site</filename> file above.</para>
<itemizedlist>
<listitem><para>During the boot script <filename>udev</filename>, there is
a call to <command>udev settle</command> that requires some time to
complete. This time may or may not be required depending on devices present
in the system. If you only have simple partitions and a single ethernet
card, the boot process will probably not need to wait for this command. To
skip it, set the variable OMIT_UDEV_SETTLE=y.</para></listitem>
<listitem><para>The boot script <filename>udev_retry</filename> also runs
<command>udev settle</command> by default. This command is only needed by
default if the <filename class='directory'>/var</filename> directory is
separately mounted. This is because the clock needs the file
<filename>/var/lib/hwclock/adjtime</filename>. Other customizations may
also need to wait for udev to complete, but in many installations it is not
needed. Skip the command by setting the variable OMIT_UDEV_RETRY_SETTLE=y.
</para></listitem>
<listitem><para>By default, the file system checks are silent. This can
appear to be a delay during the bootup process. To turn on the
<command>fsck</command> output, set the variable VERBOSE_FSCK=y.
</para></listitem>
<listitem><para>When rebooting, you may want to skip the filesystem check,
<command>fsck</command>, completely. To do this, either create the file
<filename>/fastboot</filename> or reboot the system with the command
<command>/sbin/shutdown -f -r now</command>. On the other hand, you can
force all file systems to be checked by creating
<filename>/forcefsck</filename> or running <command>shutdown</command> with
the <parameter>-F</parameter> parameter instead of <parameter>-f</parameter>.
</para>
<para>Setting the variable FASTBOOT=y will disable <command>fsck</command>
during the boot process until it is removed. This is not recommended
on a permanent basis.</para></listitem>
<listitem><para>Normally, all files in the <filename
class='directory'>/tmp</filename> directory are deleted at boot time.
Depending on the number of files or directories present, this can cause a
noticible delay in the boot process. To skip removing these files set the
variable SKIPTMPCLEAN=y.</para></listitem>
<listitem><para>During shutdown, the <command>init</command> program sends
a TERM signal to each program it has started (e.g. agetty), waits for a set
time (default 3 seconds), and sends each process a KILL signal and waits
again. This process is repeated in the <command>sendsignals</command>
script for any processes that are not shut down by their own scripts. The
delay for <command>init</command> can be set by passing a parameter. For
example to remove the delay in <command>init</command>, pass the -t0
parameter when shutting down or rebooting (e.g. <command>/sbin/shutdown
-t0 -r now</command>). The delay for the <command>sendsignals</command>
script can be skipped by setting the parameter
KILLDELAY=0.</para></listitem>
</itemizedlist>
</sect2>
</sect1>

View File

@ -302,7 +302,7 @@
<!ENTITY less-ch6-du "3.8 MB">
<!ENTITY less-ch6-sbu "less than 0.1 SBU">
<!ENTITY lfs-bootscripts-version "20120905"> <!-- Scripts depend on this format -->
<!ENTITY lfs-bootscripts-version "20121013"> <!-- 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 -->

3
udev-lfs/81-cdrom.rules Normal file
View File

@ -0,0 +1,3 @@
# /etc/udev/rules.d/81-cdrom.rules: Set CD-ROM permissions and get device capabilities
ACTION=="add", SUBSYSTEM=="block", ENV{ID_TYPE}=="cd", IMPORT{program}="cdrom_id --export $tempnode", GROUP="cdrom"

View File

@ -0,0 +1,13 @@
# /etc/udev/rules.d/83-cdrom-symlinks.rules: Determine CD drive capability.
ACTION!="add", GOTO="cd_aliases_generator_end"
SUBSYSTEM!="block", GOTO="cd_aliases_generator_end"
ENV{GENERATED}=="?*", GOTO="cd_aliases_generator_end"
# Fail the uevent if the autogenerated rules cannot be saved
ENV{ID_CDROM}=="?*", PROGRAM="/bin/grep -c ' / [^[:space:]]* rw' /proc/mounts", \
RESULT!="2", RUN+="/bin/false", GOTO="cd_aliases_generator_end"
ENV{ID_CDROM}=="?*", PROGRAM="write_cd_rules", SYMLINK+="%c"
LABEL="cd_aliases_generator_end"

View File

@ -278,13 +278,14 @@ install: udev
# Create null device and copy rules
@cp -v rules/* $(DESTDIR)/lib/udev/rules.d
@rm -v $(DESTDIR)/lib/udev/rules.d/99*
@cp -v udev-lfs-$(VERSION)/*lfs.rules $(DESTDIR)/etc/udev/rules.d
@cp -v udev-lfs-$(VERSION)/*.rules $(DESTDIR)/etc/udev/rules.d
# Copy documentation
@cp -v man/udev.7 $(DESTDIR)/usr/share/man/man7
@cp -v man/udevadm.8 $(DESTDIR)/usr/share/man/man8
@cp -v udev-lfs-$(VERSION)/udevd.8 $(DESTDIR)/usr/share/man/man8/udevd.8
@cp -v udev-lfs-$(VERSION)/doc/* $(DESTDIR)/usr/share/doc/udev/lfs
@cp -v udev-lfs-$(VERSION)/udevd.8 $(DESTDIR)/usr/share/man/man8
@cp -v udev-lfs-$(VERSION)/README $(DESTDIR)/usr/share/doc/udev/lfs
@cp -v udev-lfs-$(VERSION)/*.txt $(DESTDIR)/usr/share/doc/udev/lfs
# Copy misc
@cp -v udev-lfs-$(VERSION)/init-net-rules.sh $(DESTDIR)/lib/udev

View File

@ -29,9 +29,7 @@ write_net_rules - Scripts for LFS rules
write_cd_rules
rule_generator.functions
doc - Documentation for LFS installed rules
doc/55-lfs.txt
doc/README
55-lfs.txt - Documentation for LFS installed rules
cfg.h - Basic info needed for udev compilation

View File

@ -1,6 +0,0 @@
This directory contains documentation for each rule file used in LFS.
Each .rules file should contain a corresponding .txt file in this directory,
which explains both the overall purpose of the rules file, and each type of
rule contained therein.