aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bootscripts/ChangeLog6
-rw-r--r--bootscripts/lfs/init.d/checkfs10
-rw-r--r--bootscripts/lfs/lib/services/init-functions4
-rw-r--r--bootscripts/lfs/sysconfig/rc.site16
-rw-r--r--chapter01/changelog.xml10
-rw-r--r--chapter07/site.xml67
-rw-r--r--packages.ent2
-rw-r--r--udev-lfs/55-lfs.txt (renamed from udev-lfs/doc/55-lfs.txt)0
-rw-r--r--udev-lfs/81-cdrom.rules3
-rw-r--r--udev-lfs/83-cdrom-symlinks.rules13
-rw-r--r--udev-lfs/Makefile.lfs7
-rw-r--r--udev-lfs/README4
-rw-r--r--udev-lfs/doc/README6
13 files changed, 128 insertions, 20 deletions
diff --git a/bootscripts/ChangeLog b/bootscripts/ChangeLog
index 5ff5efcf7..bc64c304a 100644
--- a/bootscripts/ChangeLog
+++ b/bootscripts/ChangeLog
@@ -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
diff --git a/bootscripts/lfs/init.d/checkfs b/bootscripts/lfs/init.d/checkfs
index ef96aaf0f..cd7904b5b 100644
--- a/bootscripts/lfs/init.d/checkfs
+++ b/bootscripts/lfs/init.d/checkfs
@@ -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
- fsck ${options} -a -A -C -T >/dev/null
+ 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
diff --git a/bootscripts/lfs/lib/services/init-functions b/bootscripts/lfs/lib/services/init-functions
index e898826aa..29ff26270 100644
--- a/bootscripts/lfs/lib/services/init-functions
+++ b/bootscripts/lfs/lib/services/init-functions
@@ -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
diff --git a/bootscripts/lfs/sysconfig/rc.site b/bootscripts/lfs/sysconfig/rc.site
index 3b58035b2..207bc90fe 100644
--- a/bootscripts/lfs/sysconfig/rc.site
+++ b/bootscripts/lfs/sysconfig/rc.site
@@ -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
diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml
index d8cd81fca..f403b8d16 100644
--- a/chapter01/changelog.xml
+++ b/chapter01/changelog.xml
@@ -37,6 +37,16 @@
-->
<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>
<listitem>
diff --git a/chapter07/site.xml b/chapter07/site.xml
index 47b327eee..dcb2c5532 100644
--- a/chapter07/site.xml
+++ b/chapter07/site.xml
@@ -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>
diff --git a/packages.ent b/packages.ent
index 091369a79..1a3903c28 100644
--- a/packages.ent
+++ b/packages.ent
@@ -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 -->
diff --git a/udev-lfs/doc/55-lfs.txt b/udev-lfs/55-lfs.txt
index 5f116f9b7..5f116f9b7 100644
--- a/udev-lfs/doc/55-lfs.txt
+++ b/udev-lfs/55-lfs.txt
diff --git a/udev-lfs/81-cdrom.rules b/udev-lfs/81-cdrom.rules
new file mode 100644
index 000000000..cb7ea5748
--- /dev/null
+++ b/udev-lfs/81-cdrom.rules
@@ -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"
diff --git a/udev-lfs/83-cdrom-symlinks.rules b/udev-lfs/83-cdrom-symlinks.rules
new file mode 100644
index 000000000..5d6b60078
--- /dev/null
+++ b/udev-lfs/83-cdrom-symlinks.rules
@@ -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"
diff --git a/udev-lfs/Makefile.lfs b/udev-lfs/Makefile.lfs
index 1bb8f1bf0..bda131402 100644
--- a/udev-lfs/Makefile.lfs
+++ b/udev-lfs/Makefile.lfs
@@ -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
diff --git a/udev-lfs/README b/udev-lfs/README
index 18e3b881f..d9e39c159 100644
--- a/udev-lfs/README
+++ b/udev-lfs/README
@@ -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
diff --git a/udev-lfs/doc/README b/udev-lfs/doc/README
deleted file mode 100644
index 01216694c..000000000
--- a/udev-lfs/doc/README
+++ /dev/null
@@ -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.
-