Author: bdubbs Date: 2012-10-13 10:14:09 -0600 (Sat, 13 Oct 2012) New Revision: 10016
Added: trunk/BOOK/udev-lfs/55-lfs.txt trunk/BOOK/udev-lfs/81-cdrom.rules trunk/BOOK/udev-lfs/83-cdrom-symlinks.rules Removed: trunk/BOOK/udev-lfs/doc/ Modified: trunk/BOOK/bootscripts/ChangeLog trunk/BOOK/bootscripts/lfs/init.d/checkfs trunk/BOOK/bootscripts/lfs/lib/services/init-functions trunk/BOOK/bootscripts/lfs/sysconfig/rc.site trunk/BOOK/chapter01/changelog.xml trunk/BOOK/chapter07/site.xml trunk/BOOK/packages.ent trunk/BOOK/udev-lfs/Makefile.lfs trunk/BOOK/udev-lfs/README Log: Add boot/shutdown script customization instructions Modified: trunk/BOOK/bootscripts/ChangeLog =================================================================== --- trunk/BOOK/bootscripts/ChangeLog 2012-10-02 22:40:39 UTC (rev 10015) +++ trunk/BOOK/bootscripts/ChangeLog 2012-10-13 16:14:09 UTC (rev 10016) @@ -1,3 +1,9 @@ +2012-10-13 Bruce Dubbs <[email protected]> + * 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 <[email protected]> * Add udevadm trigger --action=change line to udev script to support initramfs better Modified: trunk/BOOK/bootscripts/lfs/init.d/checkfs =================================================================== --- trunk/BOOK/bootscripts/lfs/init.d/checkfs 2012-10-02 22:40:39 UTC (rev 10015) +++ trunk/BOOK/bootscripts/lfs/init.d/checkfs 2012-10-13 16:14:09 UTC (rev 10016) @@ -46,6 +46,7 @@ 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 @@ 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 Modified: trunk/BOOK/bootscripts/lfs/lib/services/init-functions =================================================================== --- trunk/BOOK/bootscripts/lfs/lib/services/init-functions 2012-10-02 22:40:39 UTC (rev 10015) +++ trunk/BOOK/bootscripts/lfs/lib/services/init-functions 2012-10-13 16:14:09 UTC (rev 10016) @@ -344,10 +344,6 @@ 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 Modified: trunk/BOOK/bootscripts/lfs/sysconfig/rc.site =================================================================== --- trunk/BOOK/bootscripts/lfs/sysconfig/rc.site 2012-10-02 22:40:39 UTC (rev 10015) +++ trunk/BOOK/bootscripts/lfs/sysconfig/rc.site 2012-10-13 16:14:09 UTC (rev 10016) @@ -50,9 +50,21 @@ # 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 #CLOCKPARAMS= Modified: trunk/BOOK/chapter01/changelog.xml =================================================================== --- trunk/BOOK/chapter01/changelog.xml 2012-10-02 22:40:39 UTC (rev 10015) +++ trunk/BOOK/chapter01/changelog.xml 2012-10-13 16:14:09 UTC (rev 10016) @@ -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> Modified: trunk/BOOK/chapter07/site.xml =================================================================== --- trunk/BOOK/chapter07/site.xml 2012-10-02 22:40:39 UTC (rev 10015) +++ trunk/BOOK/chapter07/site.xml 2012-10-13 16:14:09 UTC (rev 10016) @@ -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> Modified: trunk/BOOK/packages.ent =================================================================== --- trunk/BOOK/packages.ent 2012-10-02 22:40:39 UTC (rev 10015) +++ trunk/BOOK/packages.ent 2012-10-13 16:14:09 UTC (rev 10016) @@ -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 --> Copied: trunk/BOOK/udev-lfs/55-lfs.txt (from rev 10003, trunk/BOOK/udev-lfs/doc/55-lfs.txt) =================================================================== --- trunk/BOOK/udev-lfs/55-lfs.txt (rev 0) +++ trunk/BOOK/udev-lfs/55-lfs.txt 2012-10-13 16:14:09 UTC (rev 10016) @@ -0,0 +1,20 @@ +Purpose of rules file: + +Most of the rules installed by Udev itself create devices with the correct +properties. This file contains rules that have not been merged upstream yet. + +Description of rules: + +By default, Udev creates device nodes with UID 0, GID 0, and permissions 0660. + +ISDN-related devices should be owned by the 'dialout' group, hence the following +rule (and similar): + +KERNEL=="ippp[0-9]*", GROUP="dialout" + +The RTC-related rules cause the setclock bootscript to be run as soon as the +RTC device has been created by Udev, meaning that times in log files, for +example, are as accurate as possible as quickly as possible. + +A final word of caution: Any particular rule must be written on one line, and a +comma must separate each part of the rule. Copied: trunk/BOOK/udev-lfs/81-cdrom.rules (from rev 10003, trunk/BOOK/udev-lfs/contrib/debian/81-cdrom.rules) =================================================================== --- trunk/BOOK/udev-lfs/81-cdrom.rules (rev 0) +++ trunk/BOOK/udev-lfs/81-cdrom.rules 2012-10-13 16:14:09 UTC (rev 10016) @@ -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" Copied: trunk/BOOK/udev-lfs/83-cdrom-symlinks.rules (from rev 10003, trunk/BOOK/udev-lfs/contrib/debian/83-cdrom-symlinks.rules) =================================================================== --- trunk/BOOK/udev-lfs/83-cdrom-symlinks.rules (rev 0) +++ trunk/BOOK/udev-lfs/83-cdrom-symlinks.rules 2012-10-13 16:14:09 UTC (rev 10016) @@ -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" Modified: trunk/BOOK/udev-lfs/Makefile.lfs =================================================================== --- trunk/BOOK/udev-lfs/Makefile.lfs 2012-10-02 22:40:39 UTC (rev 10015) +++ trunk/BOOK/udev-lfs/Makefile.lfs 2012-10-13 16:14:09 UTC (rev 10016) @@ -278,13 +278,14 @@ # 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 Modified: trunk/BOOK/udev-lfs/README =================================================================== --- trunk/BOOK/udev-lfs/README 2012-10-02 22:40:39 UTC (rev 10015) +++ trunk/BOOK/udev-lfs/README 2012-10-13 16:14:09 UTC (rev 10016) @@ -29,9 +29,7 @@ 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 -- http://linuxfromscratch.org/mailman/listinfo/lfs-book FAQ: http://www.linuxfromscratch.org/lfs/faq.html Unsubscribe: See the above information page
