From 72b0264b85cbe2e8841e0386f8f698e414afcbf3 Mon Sep 17 00:00:00 2001 From: "Alexander E. Patrakov" Date: Thu, 20 May 2004 01:47:22 +0000 Subject: Added hotplug to HEAD git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3671 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- TODO | 1 + chapter01/changelog.xml | 5 ++ chapter03/packages.xml | 7 ++ chapter03/patches.xml | 28 +++++++ chapter06/chapter06.xml | 1 + chapter06/hotplug.xml | 203 ++++++++++++++++++++++++++++++++++++++++++++++++ chapter06/pwdgroup.xml | 1 + chapter06/udev.xml | 5 -- chapter08/fstab.xml | 5 +- chapter08/kernel.xml | 4 + general.ent | 5 +- 11 files changed, 256 insertions(+), 9 deletions(-) create mode 100644 chapter06/hotplug.xml diff --git a/TODO b/TODO index 47bb37414..4c245d72d 100644 --- a/TODO +++ b/TODO @@ -6,3 +6,4 @@ those at the beginning of chapter 6 and have one less package to compile. We need to be sure this doens't break the pureness though. - Check for pureness and fix any occurrences of breakage. + - Add more index terms to hotplug page. diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml index cfd0663e1..1f8fe5672 100644 --- a/chapter01/changelog.xml +++ b/chapter01/changelog.xml @@ -33,6 +33,7 @@ first a summary, then a detailed log. glibc-2.3.4-20040510 groff-1.19.1 grub-0.94 +hotplug-2004_04_01 kbd-1.12 less-382 lfs-bootscripts-2.1.1 @@ -71,6 +72,7 @@ first a summary, then a detailed log. udev-025 udev-025-config-1.patch util-linux-2.12a-kernel-headers-1.patch +hotplug-2004_04_01 @@ -97,6 +99,9 @@ first a summary, then a detailed log. +May 20th, 2004 [alexander]: Added Hotplug 2004_04_01. + + May 19th, 2004 [winkie]: Upgraded to Binutils 2.15 & GCC 3.4.1-20040517. diff --git a/chapter03/packages.xml b/chapter03/packages.xml index b4c7dd96d..91a64d753 100644 --- a/chapter03/packages.xml +++ b/chapter03/packages.xml @@ -165,6 +165,13 @@ + +Hotplug (&hotplug-version;) - 34 KB: + + + + + Iana-Etc (&iana-etc-version;) - 161 KB: diff --git a/chapter03/patches.xml b/chapter03/patches.xml index 90bcaa7a7..0c81eff64 100644 --- a/chapter03/patches.xml +++ b/chapter03/patches.xml @@ -63,6 +63,34 @@ following: + +Hotplug patch that eliminates bogus dependencies - 1 KB: + + + + + + +Hotplug patch that makes the initscript consistent with the rest - 1 KB: + + + + + + +Hotplug patch that fixes USB cold plugging - 1 KB: + + + + + + +Hotplug patch that adds ISAPNP hardware detection (optional) - 1 KB: + + + + + Inetutils Kernel Headers Patch - 1 KB: diff --git a/chapter06/chapter06.xml b/chapter06/chapter06.xml index b1a26b25f..a99b76af8 100644 --- a/chapter06/chapter06.xml +++ b/chapter06/chapter06.xml @@ -54,6 +54,7 @@ + diff --git a/chapter06/hotplug.xml b/chapter06/hotplug.xml new file mode 100644 index 000000000..dcc704950 --- /dev/null +++ b/chapter06/hotplug.xml @@ -0,0 +1,203 @@ + + + %general-entities; +]> + +Hotplug-&hotplug-version; + + +Hotplug + + + +<para>The Hotplug package contains scripts that react upon various changes +in the kernel state, in particular, addition and removal of hardware. This +package also detects existing hardware during boot and inserts the relevant +modules into the running kernel. +</para> +<segmentedlist> +<segtitle>&buildtime;</segtitle> +<segtitle>&diskspace;</segtitle> +<seglistitem><seg>0.01 SBU</seg><seg>0.1 MB</seg></seglistitem> +</segmentedlist> + +</sect2> + +<sect2 role="installation"> +<title>Installation of Hotplug + + +By default, Hotplug does not output anything in its initscript and places it +into +/etc/init.d, +whereas the place for initscripts in LFS is +/etc/rc.d/init.d. Apply the patch +that makes the output of hotplug initscript more verbose and places this +initscript into the proper directory: + + +patch -Np1 -i ../hotplug-&hotplug-version;-cosmetic-2.patch + + + +Apply the patch that avoids bogus dependencies of the hotplug initscript +upon which and +usbutils packages: + + +patch -Np1 -i ../hotplug-&hotplug-version;-bogus-deps-1.patch + + + +USB coldplugging is somewhat broken in Hotplug by default. Fix this with the +following patch: + + +patch -Np1 -i ../hotplug-&hotplug-version;-device-2.patch + + + +At last, there is an optional patch that adds ISAPNP hardware detection +capabilities to hotplug. It is not well tested. If you chose to apply it, +run the following command: + + +patch -Np1 -i ../hotplug-&hotplug-version;-isapnp-2.patch + + + +And finally install the hotplug package: + +make install + +Make a symbolic link that tells the lfs-bootscripts package to run the +hotplug initscript after mounting and cleaning filesystems: + +ln -sf ../init.d/hotplug /etc/rc.d/init.d/S55hotplug + + +If you have applied the ISAPNP patch, add some required entries to +/etc/modprobe.conf: + +cat >>/etc/modprobe.conf <<"EOF" +# Begin /etc/modprobe.conf entries for ISAPNP hardware detection script +# by Marco d'Itri +alias pnp:dPNP0511 irtty-sir +alias pnp:dPNP0700 floppy +alias pnp:dPNP0800 pcspkr +alias pnp:dPNP0B00 rtc +alias pnp:dPNP0303 atkbd +alias pnp:dPNP0F13 psmouse +alias pnp:dPNPB02F analog +# End /etc/modprobe.conf entries for ISAPNP hardware detection script +EOF + +These entries may become unneded for newer versions of Linux kernel, +since Marco d'Itri will try to convince developers to put them into the +corresponding modules themselves. + + + + +Contents of Hotplug + + + + + +/sbin/hotplug + +hotplug +This script is called by default by Linux kernel when something +changes in its internal state (e.g. a new device is added or removed). + + + + +hotplug initscript + +hotplug +This script just runs all +/etc/hotplug/*.rc scripts in turn during system +startup. + + + + +*.rc files in +/etc/hotplug directory + +These scripts are used for cold plugging, i.e. detection and other +specific actions upon hardware already present during system startup. These +scripts try to find kernel modules corresponding to your hardware and insert +them into the running kernel. + + + + + +*.agent files in +/etc/hotplug directory + +These scripts are called by /sbin/hotplug +in response to different types of hotplug events generated by the kernel. +Their action is to insert corresponding kernel modules and call user-provided +scripts, if any. + + + + + +/etc/hotplug/hotplug.functions + +This file contains common functions used by other scripts in hotplug +package. + + + + + +/etc/hotplug/blacklist + +/etc/hotplug/blacklist +This file contains the list of modules that should never be +inserted into the kernel by hotplug scripts. + + + + + +/etc/hotplug/{pci,usb} + +These directories are supposed to contain user-written handlers for +hotplug events. + + + + + +/etc/hotplug/usb.usermap + +/etc/hotplug/usb.usermap +This file contains rules that determine which user-defined handlers to +call for each USB device, based on its vendor, id and other attributes. + + + + + +/etc/hotplug.d + +This directory contains programs (or symlinks to them) +that are interested in receiving all hotplug events. E.g., +udev puts its symlink here during installation. + + + + + diff --git a/chapter06/pwdgroup.xml b/chapter06/pwdgroup.xml index 880a266e7..44827432c 100644 --- a/chapter06/pwdgroup.xml +++ b/chapter06/pwdgroup.xml @@ -47,6 +47,7 @@ dialout:x:10: audio:x:11: video:x:12: utmp:x:13: +usb:x:15: EOF The created groups aren't part of any standard -- they are some of the diff --git a/chapter06/udev.xml b/chapter06/udev.xml index 2c3453bf8..3d90f6ab9 100644 --- a/chapter06/udev.xml +++ b/chapter06/udev.xml @@ -38,11 +38,6 @@ by applying the following patch: make udevdir=/dev install -And since we aren't going to be using the udev daemon, but instead the -udev binary itself, we correct it's hotplug configuration: - -ln -sf /sbin/udev /etc/hotplug.d/default/udev.hotplug - diff --git a/chapter08/fstab.xml b/chapter08/fstab.xml index 6c8738cc8..3c76ff2fa 100644 --- a/chapter08/fstab.xml +++ b/chapter08/fstab.xml @@ -25,7 +25,7 @@ proc /proc proc defaults 0 0 sysfs /sys sysfs defaults 0 0 devpts /dev/pts devpts gid=4,mode=620 0 0 shm /dev/shm tmpfs defaults 0 0 - +usbfs /proc/bus/usb usbfs devgid=15,devmode=0660 0 0 # End /etc/fstab EOF @@ -33,7 +33,8 @@ shm /dev/shm tmpfs defaults 0 0 and fff with the values appropriate for your system -- for example hda2, hda5 and reiserfs. For all the details on the six fields in this -table, see man 5 fstab. +table, see man 5 fstab. Omit the usbfs line if you didn't +compile "USB device filesystem" into the kernel. When using a reiserfs partition, the 1 1 at the end of the line should be replaced with 0 0, as such a diff --git a/chapter08/kernel.xml b/chapter08/kernel.xml index f7ba78e97..6013089e5 100644 --- a/chapter08/kernel.xml +++ b/chapter08/kernel.xml @@ -63,6 +63,10 @@ scratch. Virtual memory file system support is enabled. It resides within the File systems menu and is normally enabled by default. +LFS bootscripts make the assumption that you either compile +"USB device filesystem" directly into the kernel, or don't compile it at +all. They will not work properly if it is a module (usbcore.ko). + NPTL requires the kernel to be compiled with GCC 3.x, in this case &gcc-version;. Compiling with 2.95.x is known to cause failures in the glibc testsuite, so do not compile the kernel with gcc 2.95.x diff --git a/general.ent b/general.ent index 998f7e79a..4aec7892f 100644 --- a/general.ent +++ b/general.ent @@ -1,6 +1,6 @@ - - + + @@ -39,6 +39,7 @@ + -- cgit v1.2.3-54-g00ecf