Here's a patch that fixes up the bootscript to work with udev-076 the
way I think upstream intend it to be used. In addition to that patch
you'll need to run:
mkdir -p /lib/udev/devices &&
ln -sf /proc/self/fd /lib/udev/devices/fd &&
ln -sf /proc/self/fd/0 /lib/udev/devices/stdin &&
ln -sf /proc/self/fd/1 /lib/udev/devices/stdout &&
ln -sf /proc/self/fd/2 /lib/udev/devices/stderr &&
ln -sf /proc/kcore /lib/udev/devices/core &&
mkdir -p /lib/udev/devices/{pts,shm}
In addition you can omit installing the hotplug package in chapter 6.
This works fine on my non-modular 2.6.14.3 kernel, though it is probably
horribly broken on modular kernels due to the rules file not having
received any attention yet.
Given the fairly minor changes required to get this all working, I'm not
sure it's worth setting a branch up for this stuff. This, of course,
assumes I've not missed something!
Regards,
Matt.
diff -Naur lfs-bootscripts-3.2.2.orig/Makefile lfs-bootscripts-3.2.2/Makefile
--- lfs-bootscripts-3.2.2.orig/Makefile 2005-05-26 20:08:09.000000000 +0000
+++ lfs-bootscripts-3.2.2/Makefile 2005-11-30 13:36:09.000000000 +0000
@@ -27,7 +27,6 @@
install -m ${CONFMODE} lfs/init.d/functions ${EXTDIR}/rc.d/init.d/
install -m ${MODE} lfs/init.d/halt ${EXTDIR}/rc.d/init.d/
install -m ${MODE} lfs/init.d/console ${EXTDIR}/rc.d/init.d/
- install -m ${MODE} lfs/init.d/hotplug ${EXTDIR}/rc.d/init.d/
install -m ${MODE} lfs/init.d/localnet ${EXTDIR}/rc.d/init.d/
install -m ${MODE} lfs/init.d/modules ${EXTDIR}/rc.d/init.d/
install -m ${MODE} lfs/init.d/mountfs ${EXTDIR}/rc.d/init.d/
@@ -44,7 +43,6 @@
install -m ${MODE} lfs/init.d/udev ${EXTDIR}/rc.d/init.d/
ln -sf ../init.d/network ${EXTDIR}/rc.d/rc0.d/K80network
ln -sf ../init.d/sysklogd ${EXTDIR}/rc.d/rc0.d/K90sysklogd
- ln -sf ../init.d/hotplug ${EXTDIR}/rc.d/rc0.d/S50hotplug
ln -sf ../init.d/sendsignals ${EXTDIR}/rc.d/rc0.d/S60sendsignals
ln -sf ../init.d/mountfs ${EXTDIR}/rc.d/rc0.d/S70mountfs
ln -sf ../init.d/swap ${EXTDIR}/rc.d/rc0.d/S80swap
@@ -62,7 +60,6 @@
ln -sf ../init.d/network ${EXTDIR}/rc.d/rc5.d/S20network
ln -sf ../init.d/network ${EXTDIR}/rc.d/rc6.d/K80network
ln -sf ../init.d/sysklogd ${EXTDIR}/rc.d/rc6.d/K90sysklogd
- ln -sf ../init.d/hotplug ${EXTDIR}/rc.d/rc6.d/S50hotplug
ln -sf ../init.d/sendsignals ${EXTDIR}/rc.d/rc6.d/S60sendsignals
ln -sf ../init.d/mountfs ${EXTDIR}/rc.d/rc6.d/S70mountfs
ln -sf ../init.d/swap ${EXTDIR}/rc.d/rc6.d/S80swap
@@ -75,7 +72,6 @@
ln -sf ../init.d/checkfs ${EXTDIR}/rc.d/rcsysinit.d/S30checkfs
ln -sf ../init.d/mountfs ${EXTDIR}/rc.d/rcsysinit.d/S40mountfs
ln -sf ../init.d/cleanfs ${EXTDIR}/rc.d/rcsysinit.d/S50cleanfs
- ln -sf ../init.d/hotplug ${EXTDIR}/rc.d/rcsysinit.d/S55hotplug
ln -sf ../init.d/setclock ${EXTDIR}/rc.d/rcsysinit.d/S60setclock
ln -sf ../init.d/console ${EXTDIR}/rc.d/rcsysinit.d/S70console
ln -sf ../init.d/localnet ${EXTDIR}/rc.d/rcsysinit.d/S80localnet
diff -Naur lfs-bootscripts-3.2.2.orig/lfs/init.d/hotplug lfs-bootscripts-3.2.2/lfs/init.d/hotplug
--- lfs-bootscripts-3.2.2.orig/lfs/init.d/hotplug 2005-04-17 22:12:16.000000000 +0000
+++ lfs-bootscripts-3.2.2/lfs/init.d/hotplug 1970-01-01 00:00:00.000000000 +0000
@@ -1,44 +0,0 @@
-#!/bin/sh
-########################################################################
-# Begin $rc_base/init.d/hotplug
-#
-# Description : Load modules for system devices
-#
-# Authors : Zack Winkles
-#
-# Version : 00.02
-#
-# Notes :
-#
-########################################################################
-
-. /etc/sysconfig/rc
-. ${rc_functions}
-
-case "${1}" in
- start|restart)
- boot_mesg "Loading modules for system devices..."
- for rc in /etc/hotplug/*.rc
- do
- ${rc} ${1}
- done
- echo_ok
- ;;
- stop)
- # Remove and Recreate /var/log/hotplug/events
- > /var/log/hotplug/events
-
- ;;
- status)
- for rc in /etc/hotplug/*.rc
- do
- ${rc} status
- done
- ;;
- *)
- echo "Usage: ${0} {start|stop|restart|status}"
- exit 1
- ;;
-esac
-
-# End $rc_base/init.d/hotplug
diff -Naur lfs-bootscripts-3.2.2.orig/lfs/init.d/udev lfs-bootscripts-3.2.2/lfs/init.d/udev
--- lfs-bootscripts-3.2.2.orig/lfs/init.d/udev 2005-03-16 23:18:06.000000000 +0000
+++ lfs-bootscripts-3.2.2/lfs/init.d/udev 2005-11-30 13:08:54.000000000 +0000
@@ -15,18 +15,6 @@
. /etc/sysconfig/rc
. ${rc_functions}
-# Create some things that sysfs does not, and should not export for us. Feel
-# free to add devices to this list.
-make_extra_nodes() {
- ln -s /proc/self/fd /dev/fd
- ln -s /proc/self/fd/0 /dev/stdin
- ln -s /proc/self/fd/1 /dev/stdout
- ln -s /proc/self/fd/2 /dev/stderr
- ln -s /proc/kcore /dev/core
- mkdir /dev/pts
- mkdir /dev/shm
-}
-
case "${1}" in
start)
boot_mesg "Populating /dev with device nodes..."
@@ -61,17 +49,22 @@
/etc/rc.d/init.d/halt stop
fi
- # Assign udevsend to get hotplug events. udevsend can manage the whole
- # hotplug handling by taking over the kernel spawned event process
- echo /sbin/udevsend > /proc/sys/kernel/hotplug
+ # Udev can handle hotplug events itself, so unregister
+ # /sbin/hotplug as the kernel's hotplug event handler.
+ > /proc/sys/kernel/hotplug
# Populate /dev with all the devices that are already available,
- # and save it's status so we can report failures.
+ # and save its status so we can report failures.
udevstart || failed=1
- # Now, create some required files/directories/devices that sysfs
- # doesn't export for us.
- make_extra_nodes
+ # /lib/udev/devices contains device nodes for broken subsystems
+ # or devices which can't be detected automatically by the
+ # kernel.
+ cp -R /lib/udev/devices/* /dev
+
+ # start the udev daemon so that runtime changes to devices are
+ # reflected in the /dev directory
+ udevd --daemon
# When reporting the status, base it on the success or failure
# of the `udevstart' command, since that's the most important.
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page