r831 - in trunk: . udev

jim at linuxfromscratch.org jim at linuxfromscratch.org
Mon Dec 5 10:42:26 PST 2005


Author: jim
Date: 2005-12-05 11:42:24 -0700 (Mon, 05 Dec 2005)
New Revision: 831

Added:
   trunk/udev/
   trunk/udev/10-wait-for-sysfs.rules
   trunk/udev/50-udev.rules
   trunk/udev/60-persistent.rules
   trunk/udev/80-sysconfig.rules
   trunk/udev/95-debug.rules
   trunk/udev/Makefile
   trunk/udev/README.Logging
   trunk/udev/boot.udev
   trunk/udev/boot.udev_retry
   trunk/udev/firmware.sh
   trunk/udev/input_device.sh
   trunk/udev/load_floppy_module.sh
   trunk/udev/load_ide_modules.sh
   trunk/udev/mount.sh
   trunk/udev/remove_floppy_devices.sh
   trunk/udev/scsi_id.config
   trunk/udev/show_event_log
   trunk/udev/sysconfig.storage
   trunk/udev/udev.count_events
   trunk/udev/udev.makechanges
Log:
Added: udev package for Cross-LFS. Work in Progress

Added: trunk/udev/10-wait-for-sysfs.rules
===================================================================
--- trunk/udev/10-wait-for-sysfs.rules	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/10-wait-for-sysfs.rules	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,17 @@
+########################################################################
+#
+# Description : Wait for SYSFS
+#
+# Authors     : Based on Open Suse Udev Rules
+#               kay.sievers at suse.de
+#
+# Adapted to  : Jim Gifford
+# LFS
+#
+# Version     : 00.01
+#
+# Notes       :
+#
+########################################################################
+
+ACTION=="add", DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"

Added: trunk/udev/50-udev.rules
===================================================================
--- trunk/udev/50-udev.rules	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/50-udev.rules	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,182 @@
+########################################################################
+#
+# Description : Base Udev Rules Set
+#
+# Authors     : Based on Open Suse Udev Rules
+#               kay.sievers at suse.de
+#
+# Adapted to  : Jim Gifford
+# LFS
+#
+# Version     : 00.01
+#
+# Notes       :
+#
+########################################################################
+
+# ignore these events until someone needs them
+SUBSYSTEM=="drivers",		OPTIONS="last_rule"
+SUBSYSTEM=="module",		OPTIONS="last_rule"
+
+# console
+KERNEL=="pty[pqrstuvwxyzabcdef][0123456789abcdef]", NAME="%k", GROUP="tty", MODE="666", OPTIONS="last_rule"
+KERNEL=="tty[pqrstuvwxyzabcdef][0123456789abcdef]", NAME="%k", GROUP="tty", MODE="666", OPTIONS="last_rule"
+KERNEL=="vcs*",			NAME="%k", GROUP="tty", MODE="620", OPTIONS="last_rule"
+KERNEL=="vcsa*",		NAME="%k", GROUP="tty", MODE="620", OPTIONS="last_rule"
+KERNEL=="tty",			NAME="%k", GROUP="tty", MODE="666", OPTIONS="last_rule"
+KERNEL=="tty[0-9]*",		NAME="%k", GROUP="tty", MODE="620", OPTIONS="last_rule"
+KERNEL=="console",		NAME="%k", MODE="600", OPTIONS="last_rule"
+KERNEL=="ptmx",			NAME="%k", GROUP="tty", MODE="666", OPTIONS="last_rule"
+
+# serial devices
+KERNEL=="tty[A-Z]*",		NAME="%k", GROUP="uucp"
+KERNEL=="pppox*",		NAME="%k", GROUP="uucp"
+KERNEL=="ircomm*",		NAME="%k", GROUP="uucp"
+KERNEL=="modems/mwave*",	NAME="%k", GROUP="uucp"
+KERNEL=="hvc*",			NAME="%k", GROUP="uucp"
+KERNEL=="hvsi*",		NAME="%k", GROUP="uucp"
+KERNEL=="iseries/vtty*",	NAME="%k", GROUP="uucp"
+KERNEL=="ttyUSB*", SYSFS{product}=="Palm Handheld*", SYMLINK+="pilot"
+
+# video/graphics
+SUBSYSTEM=="video4linux",	GROUP="video"
+SUBSYSTEM=="graphics"		GROUP="video"
+KERNEL=="vtx*",			NAME="%k", GROUP="video"
+KERNEL=="vbi*",			NAME="%k", GROUP="video"
+KERNEL=="winradio*",		NAME="%k", GROUP="video"
+KERNEL=="vttuner*",		NAME="%k", GROUP="video"
+KERNEL=="nvidia*",		NAME="%k", GROUP="video"
+KERNEL=="nvidiactl*",		NAME="%k", GROUP="video"
+KERNEL=="video0",		SYMLINK+="video"
+KERNEL=="radio0",		SYMLINK+="radio"
+KERNEL=="vbi0",			SYMLINK+="vbi"
+KERNEL=="pmu",			GROUP="video"
+
+# dvb
+SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%i $${K%%%%.*} $${K#*.}'", NAME="%c", GROUP="video"
+
+# Kino jogshuttle support
+SUBSYSTEM=="usb", ACTION=="add", ENV{PRODUCT}=="b33/10/*", RUN+="/usr/bin/killall --quiet -USR2 kino"
+SUBSYSTEM=="usb", ACTION=="add", ENV{PRODUCT}=="5f3/240/*", RUN+="/usr/bin/killall --quiet -USR2 kino"
+
+# input devices
+KERNEL=="mice",			NAME="input/%k", MODE="0640"
+KERNEL=="mouse*",		NAME="input/%k", MODE="0640"
+KERNEL=="event*",		NAME="input/%k", MODE="0640"
+KERNEL=="js*",			NAME="input/%k", MODE="0644"
+KERNEL=="ts*",			NAME="input/%k", MODE="0600"
+KERNEL=="uinput",		NAME="input/%k", MODE="0600"
+KERNEL=="lirc0",		NAME="%k", SYMLINK+="lirc"
+KERNEL=="input[0-9]*",		RUN+="/lib/udev/input_device.sh"
+KERNEL=="input[0-9]*",		ACTION=="add", ENV{ABS}=="[1-9]*", RUN+="/sbin/modprobe joydev"
+
+# printer
+SUBSYSTEM=="usb",		KERNEL=="lp*", NAME="usb/%k", SYMLINK+="usb%k", GROUP="lp"
+SUBSYSTEM=="printer",		KERNEL=="lp*", NAME="%k", GROUP="lp"
+KERNEL=="irlpt*",		NAME="%k", GROUP="lp"
+
+# cpu devices
+KERNEL=="cpu[0-9]*",		NAME="cpu/%n/cpuid"
+KERNEL=="msr[0-9]*",		NAME="cpu/%n/msr"
+KERNEL=="microcode",		NAME="cpu/microcode", MODE="0600"
+
+# IEEE1394 devices
+KERNEL=="raw1394*",		NAME="%k", GROUP="video"
+KERNEL=="dv1394*",		NAME="%k", SYMLINK+="dv1394/%n", GROUP="video"
+KERNEL=="video1394*",		NAME="%k", SYMLINK+="video1394/%n", GROUP="video"
+
+# 183 = /dev/hwrng        Generic random number generator
+KERNEL=="hw_random",		NAME="hwrng", SYMLINK+="%k"
+# 219 /dev/modems/mwave MWave modem firmware upload
+KERNEL=="mwave",		NAME="modems/%k"
+# 169 /dev/specialix_rioctl Specialix RIO serial control
+KERNEL=="rioctl",		NAME="specialix_rioctl", SYMLINK+="%k"
+# 167 /dev/specialix_sxctl Specialix serial control
+KERNEL=="sxctl",		NAME="specialix_sxctl", SYMLINK+="%k"
+
+# misc devices
+KERNEL=="mem",			NAME="%k", GROUP="kmem", MODE="640"
+KERNEL=="kmem",			NAME="%k", GROUP="kmem", MODE="640"
+KERNEL=="port",			NAME="%k", GROUP="kmem", MODE="640"
+KERNEL=="nvram",		NAME="%k", GROUP="kmem", MODE="600"
+KERNEL=="null",			NAME="%k", MODE="666"
+KERNEL=="zero",			NAME="%k", MODE="666"
+KERNEL=="full",			NAME="%k", MODE="622"
+KERNEL=="random",		NAME="%k", MODE="666"
+KERNEL=="urandom",		NAME="%k", MODE="644"
+KERNEL=="rtc",			GROUP="audio"
+KERNEL=="sonypi",		MODE="0666"
+KERNEL=="agpgart",		MODE="0600", GROUP="video"
+KERNEL=="djs*",			NAME="%k", MODE="644"
+KERNEL=="sgi_*",		NAME="%k", MODE="666"
+KERNEL=="rrom*",		NAME="%k", MODE="400"
+KERNEL=="rflash*",		NAME="%k", MODE="400"
+KERNEL=="usbscanner*",		NAME="%k", MODE="644"
+KERNEL=="3270/ttycons*",	NAME="%k", MODE="600"
+KERNEL=="3270/tub*",		NAME="%k", MODE="666"
+KERNEL=="3270/tubcons*",	NAME="%k", MODE="600"
+KERNEL=="ica",			NAME="%k", MODE="666"
+KERNEL=="z90crypt",		NAME="%k", MODE="666"
+KERNEL=="mmtimer",		NAME="%k", MODE="444"
+KERNEL=="auer[0-9]*"		NAME="usb/%k"
+
+KERNEL=="pktcdvd",		NAME="pktcdvd/control"
+KERNEL=="pktcdvd[0-9]*",	NAME="pktcdvd/%k"
+
+# fix floppy devices
+KERNEL=="nvram", ACTION=="add", RUN+="/lib/udev/load_floppy_module.sh"
+KERNEL=="fd*", ACTION=="add", SYSFS{device/cmos}=="*", RUN+="/lib/udev/create_floppy_devices -c -t $sysfs{device/cmos} -m %M /dev/%k"
+KERNEL=="fd*", ACTION=="remove", RUN+="/lib/udev/remove_floppy_devices.sh %k"
+
+# block devices
+SUBSYSTEM=="block", GROUP="disk", MODE="0640"
+
+# sd:		0 TYPE_DISK, 7 TYPE_MOD, 14 TYPE_RBC
+# sr:		4 TYPE_WORM, 5 TYPE_ROM
+# st/osst:	1 TYPE_TAPE
+ACTION=="add", SUBSYSTEM="scsi" , SYSFS{type}=="0|7|14", RUN+="/bin/sh -c 'echo 60 > /sys/$DEVPATH/timeout'"
+ACTION=="add", SUBSYSTEM="scsi" , SYSFS{type}=="1", RUN+="/bin/sh -c 'echo 900 > /sys/$DEVPATH/timeout'"
+SUBSYSTEM=="scsi_device", ACTION=="add", SYSFS{device/type}=="0|7|14", RUN+="/sbin/modprobe sd_mod"
+SUBSYSTEM=="scsi_device", ACTION=="add", SYSFS{device/type}=="1", SYSFS{device/vendor}=="On[sS]tream", RUN+="/sbin/modprobe osst"
+SUBSYSTEM=="scsi_device", ACTION=="add", SYSFS{device/type}=="1", RUN+="/sbin/modprobe st"
+SUBSYSTEM=="scsi_device", ACTION=="add", SYSFS{device/type}=="[45]", RUN+="/sbin/modprobe sr_mod"
+SUBSYSTEM=="scsi_device", ACTION=="add", RUN+="/sbin/modprobe sg"
+
+# IDE modules
+SUBSYSTEM=="ide", ACTION=="add", RUN+="/lib/udev/load_ide_modules.sh"
+
+# device mapper
+KERNEL=="device-mapper", ACTION=="add", NAME="%k", SYMLINK+="mapper/control"
+
+# check fstab and possibly mount
+SUBSYSTEM=="block", KERNEL=="sd*[0-9]|hd*[0-9]", ACTION=="add", RUN+="/lib/udev/mount.sh"
+
+# misc storage devices (non-block)
+KERNEL=="sg*",			NAME="%k", GROUP="disk", MODE="640"
+KERNEL=="st*",			NAME="%k", GROUP="disk"
+KERNEL=="nst*",			NAME="%k", GROUP="disk"
+KERNEL=="initrd",		NAME="%k", GROUP="disk"
+KERNEL=="qft*",			NAME="%k", GROUP="disk"
+KERNEL=="nqft*",		NAME="%k", GROUP="disk"
+KERNEL=="zqft*",		NAME="%k", GROUP="disk"
+KERNEL=="nzqft*",		NAME="%k", GROUP="disk"
+KERNEL=="rawqft*",		NAME="%k", GROUP="disk"
+KERNEL=="nrawqft*",		NAME="%k", GROUP="disk"
+KERNEL=="pf*",			NAME="%k", GROUP="disk"
+KERNEL=="sch*",			NAME="%k", GROUP="disk"
+KERNEL=="pt*",			NAME="%k", GROUP="disk"
+KERNEL=="npt*",			NAME="%k", GROUP="disk"
+KERNEL=="pg*",			NAME="%k", GROUP="disk"
+KERNEL=="evms/block_device*",	NAME="%k", GROUP="disk"
+KERNEL=="rawctl*",		NAME="%k", GROUP="disk"
+KERNEL=="osst*",		NAME="%k", GROUP="disk"
+KERNEL=="nosst*",		NAME="%k", GROUP="disk"
+KERNEL=="iseries/vt*",		NAME="%k", GROUP="disk"
+KERNEL=="iseries/nvt*",		NAME="%k", GROUP="disk"
+KERNEL=="iseries/ibmsis*",	NAME="%k", GROUP="disk"
+
+# libusb device access
+SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", MODE="0644"
+
+# firmware loader
+SUBSYSTEM=="firmware", ACTION=="add", RUN+="/lib/udev/firmware.sh"

Added: trunk/udev/60-persistent.rules
===================================================================
--- trunk/udev/60-persistent.rules	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/60-persistent.rules	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,64 @@
+########################################################################
+#
+# Description : Persistent Rules
+#
+# Authors     : Based on Open Suse Udev Rules
+#               kay.sievers at suse.de and hare at suse.de
+#
+# Adapted to  : Jim Gifford
+# LFS
+#
+# Version     : 00.01
+#
+# Notes       :
+#
+########################################################################
+
+# persistent disk links: /dev/disk/{by-id,by-uuid,by-label,by-path}
+# scheme based on "Linux persistent device names", 2004, Hannes Reinecke <hare at suse.de>
+
+ACTION!="add", GOTO="persistent_end"
+SUBSYSTEM!="block", GOTO="persistent_end"
+
+# skip rules for inappropriate block devices
+KERNEL=="ram*|loop*|fd*|nbd*", GOTO="persistent_end"
+
+# never access removable ide devices, the drivers are causing event loops on open()
+BUS=="ide", DRIVER!="ide-cdrom", SYSFS{removable}="1", GOTO="persistent_end"
+
+# by-id (hardware serial number)
+KERNEL=="hd*[!0-9]", IMPORT{program}="/sbin/ata_id --export $tempnode"
+KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
+KERNEL=="hd*[0-9]", IMPORT{parent}=="ID_*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
+
+KERNEL=="sd*[!0-9]|sr*", SYSFS{ieee1394_id}=="*", ENV{ID_SERIAL}="$sysfs{ieee1394_id}", ENV{ID_BUS}="ieee1394"
+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="", IMPORT{program}="/sbin/usb_id -x"
+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="", IMPORT{program}="/sbin/scsi_id -g -x -s %p -d $tempnode"
+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="", IMPORT{program}="/sbin/scsi_id -g -x -a -s %p -d $tempnode"
+KERNEL=="dasd*[!0-9]", IMPORT{program}="/sbin/dasd_id --export $tempnode"
+KERNEL=="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
+
+# for partitions import parent information
+KERNEL=="sd*[0-9]|dasd*[0-9]", IMPORT{parent}=="ID_*"
+KERNEL=="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
+
+# by-path (shortest physical path)
+KERNEL=="*[!0-9]|sr*", ENV{ID_TYPE}=="?*", IMPORT{program}="/sbin/path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}"
+KERNEL=="sr*", GOTO="persistent_end"
+KERNEL=="*[0-9]", IMPORT{parent}=="ID_*"
+KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
+
+# by-label/by-uuid (filesystem properties)
+KERNEL=="*[!0-9]", SYSFS{removable}=="1", GOTO="persistent_end"
+IMPORT{program}="/sbin/vol_id --export $tempnode"
+ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
+ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
+
+# BIOS Enhanced Disk Device
+KERNEL=="*[!0-9]", IMPORT{program}="/sbin/edd_id --export $tempnode"
+KERNEL=="*[!0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}"
+KERNEL=="*[0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n"
+
+KERNEL=="dm-[0-9]*", ACTION=="add", PROGRAM="/sbin/dmsetup info -c --noheadings -o name -j %M -m %m", SYMLINK="disk/by-name/%c"
+
+LABEL="persistent_end"

Added: trunk/udev/80-sysconfig.rules
===================================================================
--- trunk/udev/80-sysconfig.rules	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/80-sysconfig.rules	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,24 @@
+########################################################################
+#
+# Description : Sysconfig Rules Set
+#
+# Authors     : Based on Open Suse Udev Rules
+#               kay.sievers at suse.de
+#
+# Adapted to  : Jim Gifford
+# LFS
+#
+# Version     : 00.01
+#
+# Notes       :
+#
+########################################################################
+
+ENV{SYSCONFIG}=="no|off|0", GOTO="sysconfig_end"
+
+# network devices
+KERNEL=="tun", NAME="net/%k", MODE="0600"
+SUBSYSTEM=="net", ACTION=="add", RUN+="/sbin/ifup $env{INTERFACE} -o hotplug"
+SUBSYSTEM=="net", ACTION=="remove", RUN+="/sbin/ifdown %k -o hotplug"
+
+LABEL="sysconfig_end"

Added: trunk/udev/95-debug.rules
===================================================================
--- trunk/udev/95-debug.rules	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/95-debug.rules	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,22 @@
+########################################################################
+#
+# Description : Debug Rules Set
+#
+# Authors     : Based on Open Suse Udev Rules
+#               kay.sievers at suse.de
+#
+# Adapted to  : Jim Gifford
+# LFS
+#
+# Version     : 00.01
+#
+# Notes       :
+#
+########################################################################
+
+# debug events to /events, but not on default udev_log="err"
+ENV{UDEV_LOG}=="[4-9]", RUN+="/lib/udev/eventrecorder.sh"
+
+# event to be catched by udevmonitor
+RUN+="socket:/org/kernel/udev/monitor"
+

Added: trunk/udev/Makefile
===================================================================
--- trunk/udev/Makefile	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/Makefile	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,48 @@
+INITMODE=754
+DIRMODE=755
+SCRIPTMODE=755
+RULESMODE=644
+CONFMODE=644
+
+all: install
+
+install: device_dirs device_link rules scripts boot
+
+rules:
+	install -m ${RULESMODE} ${DESTDIR}/etc/udev/rules.d/10-wait-for-sysfs.rules
+	install -m ${RULESMODE} ${DESTDIR}/etc/udev/rules.d/50-udev.rules
+	install -m ${RULESMODE} ${DESTDIR}/etc/udev/rules.d/60-persistent.rules
+	install -m ${RULESMODE} ${DESTDIR}/etc/udev/rules.d/80-sysconfig.rules
+	install -m ${RULESMODE} ${DESTDIR}/etc/udev/rules.d/95-debug.rules
+
+scripts:
+	install -m ${SCRIPTMODE) ${DESTDIR}/lib/udev/remove_floppy_devices.sh
+	install -m ${SCRIPTMODE) ${DESTDIR}/lib/udev/load_floppy_module.sh
+	install -m ${SCRIPTMODE) ${DESTDIR}/lib/udev/load_ide_modules.sh
+	install -m ${SCRIPTMODE) ${DESTDIR}/lib/udev/firmware.sh
+	install -m ${SCRIPTMODE) ${DESTDIR}/lib/udev/input_device.sh
+	install -m ${SCRIPTMODE) ${DESTDIR}/lib/udev/mount.sh
+	install -m ${CONFMODE} ${DESTDIR}/etc/scsi_id.config
+	install -m ${SCRIPTMODE) ${DESTDIR}/usr/bin/udev.count_events
+
+boot:
+	install -m ${INITMODE} ${DESTDIR}/etc/init.d/boot.udev
+	install -m ${INITMODE} ${DESTDIR}/etc/init.d/boot.udev_retry
+	install -m ${CONFMODE} ${DESTDIR}/var/adm/fillup-templates/sysconfig.storage
+	install -m ${SCRIPTMODE) doc/show_event_log
+	install -m ${CONFMODE} doc/README.Logging
+
+device_dirs:
+	install -d -m ${DIRMODE} ${DESTDIR}/lib/udev/devices
+	install -d -m ${DIRMODE} ${DESTDIR}/lib/udev/devices/pts
+	install -d -m ${DIRMODE} ${DESTDIR}/lib/udev/devices/shm
+	install -d -m ${DIRMODE} ${DESTDIR}/lib/udev/devices/net
+
+device_links:
+	ln -sn /proc/self/fd ${DESTDIR}/lib/udev/devices/fd
+	ln -sn /proc/self/fd/0 ${DESTDIR}/lib/udev/devices/stdin
+	ln -sn /proc/self/fd/1 ${DESTDIR}/lib/udev/devices/stdout
+	ln -sn /proc/self/fd/2 ${DESTDIR}/lib/udev/devices/stderr
+	ln -sn /proc/kcore ${DESTDIR}/lib/udev/devices/core
+
+.PHONY: all install device_dirs device_links rules scripts boot

Added: trunk/udev/README.Logging
===================================================================
--- trunk/udev/README.Logging	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/README.Logging	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,77 @@
+How to watch udev activity when booting
+#######################################
+
+
+1) Make syslog start before udev:
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Since udev writes all output to syslog, we need service syslog running before
+udevd starts. There are two ways to achieve this.
+
+Either add the needed link to /etc/init.d/earlysyslog in /etc/init.d/boot.d/ manually. But it must start later then boot.rootfsck.
+
+Or you edit the service scripts itself and let insserv create the links. You
+have to change earlysyslog and boot.udev:
+  /etc/init.d/earlysyslog
+    Add 'B' to 'Default-Start:' and 'boot.rootfsck' to 'Required-Start:'
+    # Required-Start: boot.rootfsck
+    # Default-Start:  B 2 3 5
+  /etc/init.d/boot.udev
+    Add 'earlysyslog' to 'Required-Start'
+    # Required-Start:    boot.rootfsck earlysyslog
+Then call
+  /sbin/insserv -d earlysyslog
+Check if earlysyslog comes before boot.udev in /etc/init.d/boot.d/S*
+
+You need /var on your root partition for that because boot.localfs is started
+after udev. If you have a seperate /var partition, make it available somehow or
+change the location of your syslog file.
+
+
+2) Enable logging
+^^^^^^^^^^^^^^^^^
+set udev_log=info in /etc/udev/udev.conf. 
+
+There is also debug, but you are very
+probably not interested in the huge amount of debugging output from udev. It
+writes about 70M logfile at a single boot.
+
+Many tools which are called from hotplug also respect the setting of udev_log.
+But there might be some which need special actions to make them verbose.
+[to be enhanced: list tools and their individual debug switches]
+
+You may change udevs loglevel at runtime with
+  udevcontrol log_priority=<level>
+
+
+3) Reboot
+^^^^^^^^^
+For further processing of the logging output you should get a clean logfile at
+next boot. Just move the old logfile away. Syslog will still use the moved file
+until shutdown (until syslog restarted).
+mv /var/log/messages /var/log/messages.`date +%s`
+
+Then reboot.
+
+
+4) Getting logged events sorted
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+There is a script 'show_event_log' which may be used to extract info out of
+/var/log/messages. Call it
+  show_event_log <first> [<last> [<list of event types>] ]
+<first> is the sequence number of the first event you are interested in.
+<last>  is the number of the last event. You may write 'last' literally. It may
+        also be omitted if you want to see a single event. 
+<list>  is a list of event types you like to see. If you omit it, you get most
+        events, not all. Some are exclude by default. Use " " as list if you
+	want to see really all. Or edit the list of skipped events in the first
+        lines of the script
+If you don't use /var/log/messages as lockfile you may set the environment
+variable MESSAGES=<logfile>.
+
+The script is slowly. It is just a quick hack. The larger the syslog file the
+slower the script. Therefore always boot with a fresh logfile.
+Improvements are welcome.
+
+
+Have a lot of fun, as always ;)
+

Added: trunk/udev/boot.udev
===================================================================
--- trunk/udev/boot.udev	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/boot.udev	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,121 @@
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/udev
+#
+# Description : Udev Boot Script
+#
+# Authors     : Based on Open Suse Udev Rules
+#               kay.sievers at suse.de
+#
+# Adapted to  : Jim Gifford
+# LFS
+#
+# Version     : 00.00
+#
+# Notes       :
+#
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+PATH="/sbin:/bin"
+DAEMON=/sbin/udevd
+udevd_args="--daemon"
+
+function trigger_device_events() {
+	# generate events with the sysfs trigger
+	list=$(echo /sys/bus/*/devices/*/uevent)
+	list="$list $(echo /sys/class/*/*/uevent)"
+	list="$list $(echo /sys/block/*/uevent /sys/block/*/*/uevent)"
+	for i in $list; do
+	    case "$i" in
+		*/device/uevent)
+		    # skip followed device symlinks
+		    continue
+		    ;;
+
+		*/class/mem/*|*/class/tty/*)
+		    first="$first $i"
+		    ;;
+
+		*/block/md*)
+		    last="$last $i"
+		    ;;
+
+		*/*)
+		    default="$default $i"
+		    ;;
+	    esac
+	done
+
+	# trigger the sorted events
+	for i in $first $default $last; do
+	    echo "add" > "$i"
+	done
+}
+
+case "$1" in
+    start)
+
+	# disable hotplug helper, udevd listens to netlink
+	echo "" > /proc/sys/kernel/hotplug
+
+	# start udevd
+	boot_mesg "Starting udevd"
+	loadproc $DAEMON $udevd_args
+
+	# cleanup some stuff
+	rm -rf /events/*
+
+	# unlikely, but we may be faster than the first event
+	mkdir -p /dev/.udev/queue
+
+	# configure all devices
+	trigger_device_events
+
+	# until we know how to do better, we wait for all events to finish
+	loop=0
+	while test -d /dev/.udev/queue; do
+	    sleep 0.1;
+	    test "$loop" -gt 300 && break
+	    loop=$(($loop + 1))
+	done
+	;;
+
+    stop)
+	boot_mesg "Stopping udevd:"
+	echo "/sbin/hotplug" > /proc/sys/kernel/hotplug
+	killproc $DAEMON
+	;;
+
+    restart)
+	${0} stop
+        sleep 1
+        ${0} start
+	;;
+
+    status)
+	statusproc /sbin/udevd
+	;;
+
+    reload)
+	boot_mesg "Reloading udev rules:"
+	udevcontrol reload_rules
+	cp --preserve=all --recursive --update /lib/udev/devices/* /dev
+	evaluate_retval
+	;;
+
+    force-reload)
+	boot_mesg "Updating all available device nodes in /dev: "
+	udevcontrol reload_rules
+	rm -rf /dev/.udev /dev/disk
+	cp --preserve=all --recursive --update /lib/udev/devices/* /dev
+	trigger_device_events
+	evaluate_retval
+	;;
+    *)
+	echo "Usage: $0 {start|stop|restart|status|reload|force-reload}"
+	exit 1
+	;;
+esac


Property changes on: trunk/udev/boot.udev
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/udev/boot.udev_retry
===================================================================
--- trunk/udev/boot.udev_retry	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/boot.udev_retry	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,40 @@
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/udev_retry
+#
+# Description : Udev Retry Boot Script
+#
+# Authors     : Based on Open Suse Udev Rules
+#               kay.sievers at suse.de
+#
+# Adapted to  : Jim Gifford
+# LFS
+#
+# Version     : 00.00
+#
+# Notes       : Retry Udev events that have failed after local file
+#               systems are mounted
+#
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+case "$1" in
+
+    start)
+	if test -d /dev/.udev/failed; then
+	    boot_mesg "Retry device configuration"
+	    list=$(echo /dev/.udev/failed/*)
+	    for i in $list; do
+		device="$(readlink $i)/uevent"
+		test -e $device && echo "add" > $device
+	    done
+	fi
+	evaluate_retval
+	;;
+    *)
+	echo "Usage: $0 {start}"
+	exit 1
+	;;
+esac


Property changes on: trunk/udev/boot.udev_retry
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/udev/firmware.sh
===================================================================
--- trunk/udev/firmware.sh	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/firmware.sh	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,39 @@
+#!/bin/sh
+########################################################################
+#
+# Description : Firmware Script
+#
+# Authors     : Based on Open Suse Udev Rules
+#               kay.sievers at suse.de
+#
+# Adapted to  : Jim Gifford
+# LFS
+#
+# Version     : 00.00
+#
+# Notes       :
+#
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+FIRMWARE_DIRS="/lib/firmware"
+
+if [ ! -e /sys/$DEVPATH/loading ]; then
+    boot_mesg "firmware loader misses sysfs directory"
+    exit 0
+fi
+
+for DIR in $FIRMWARE_DIRS; do
+    [ -e "$DIR/$FIRMWARE" ] || continue
+    boot_mesg "loading $DIR/$FIRMWARE"
+    echo 1 > /sys/$DEVPATH/loading
+    cat "$DIR/$FIRMWARE" > /sys/$DEVPATH/data
+    echo 0 > /sys/$DEVPATH/loading
+    exit
+done
+
+echo -1 > /sys/$DEVPATH/loading
+boot_mesg "Cannot find  firmware file '$FIRMWARE'"
+exit 1


Property changes on: trunk/udev/firmware.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/udev/input_device.sh
===================================================================
--- trunk/udev/input_device.sh	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/input_device.sh	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,302 @@
+#!/bin/bash
+# $Id$
+#
+# input-device specific hotplug policy agent.
+#
+# This should handle 2.6.* input hotplugging,
+# with a consistent framework for adding device and driver
+# specific handling.
+#
+# Normally, adding a input device will modprobe handler(s) for
+# this device.
+#
+# Kernel input hotplug params include (not all of them may be available):
+#
+#        ACTION=%s [add or remove]
+#        PRODUCT=%x/%x/%x/%x
+#        NAME=%s
+#        PHYS=%s
+#        EV=%lx
+#        KEY=%lx %lx ...
+#        REL=%lx
+#        ABS=%lx %lx ...
+#        MSC=%lx
+#        LED=%lx
+#        SND=%lx
+#        FF=%lx %lx ...
+#
+: ${ACTION?Bad invocation: \$ACTION is not set}
+
+cd /etc/hotplug
+. ./hotplug.functions
+
+# generated by module-init-tools
+MAP_CURRENT=$MODULE_DIR/modules.inputmap
+
+# used for kernel drivers that don't show up in MAP_CURRENT
+# or to overwrite default from MAP_CURRENT
+#
+MAP_HANDMAP=$HOTPLUG_DIR/input.handmap
+
+# Each modules.inputmap format line corresponds to one entry in a
+# MODULE_DEVICE_TABLE(input,...) declaration in a kernel file.
+#
+matchBits=0
+i_bustype=0
+i_vendor=0
+i_product=0
+i_version=0
+i_evBits=0
+
+input_join_words ()
+{
+    local name=$1; shift
+    local tmp=$1; shift
+    while [ "$#" -gt 0 ]; do
+        tmp="$tmp:$1"; shift
+    done
+    eval $name=\$tmp
+}
+
+input_convert_vars ()
+{
+    if [ "$PRODUCT" != "" ]; then
+        set -- `IFS=/; echo $PRODUCT`
+        i_bustype=$((0x$1))
+        i_vendor=$((0x$2))
+        i_product=$((0x$3))
+        i_version=$((0x$4))
+    fi
+
+    if [ "$EV" != "" ]; then
+        i_evBits=$((0x$EV))
+    fi
+
+    input_join_words i_keyBits $KEY
+    # for a in $KEY; do i_keyBits="${i_keyBits:+$i_keyBits:}${a}"; done
+    input_join_words i_relBits $REL
+    input_join_words i_absBits $ABS
+    input_join_words i_mscBits $MSC
+    input_join_words i_ledBits $LED
+    input_join_words i_sndBits $SND
+    input_join_words i_ffBits  $FF
+}
+
+INPUT_DEVICE_ID_MATCH_BUS=1
+INPUT_DEVICE_ID_MATCH_VENDOR=2
+INPUT_DEVICE_ID_MATCH_PRODUCT=4
+INPUT_DEVICE_ID_MATCH_VERSION=8
+INPUT_DEVICE_ID_MATCH_EVBIT=$((0x010))
+INPUT_DEVICE_ID_MATCH_KEYBIT=$((0x020))
+INPUT_DEVICE_ID_MATCH_RELBIT=$((0x040))
+INPUT_DEVICE_ID_MATCH_ABSBIT=$((0x080))
+INPUT_DEVICE_ID_MATCH_MSCBIT=$((0x100))
+INPUT_DEVICE_ID_MATCH_LEDBIT=$((0x200))
+INPUT_DEVICE_ID_MATCH_SNDBIT=$((0x400))
+INPUT_DEVICE_ID_MATCH_FFBIT=$((0x800))
+
+
+input_match_bits ()
+{
+    local mod_bits=$1 dev_bits=$2
+
+    mword=$((0x${mod_bits##*:}))
+    dword=$((0x${dev_bits##*:}))
+
+    while true; do
+        if [ $(( $mword & $dword != $mword )) -eq 1 ]; then
+            return 1
+        fi
+
+        mod_bits=${mod_bits%:*}
+        dev_bits=${dev_bits%:*}
+
+        case "$mod_bits-$dev_bits" in
+            *:*-*:* )
+                : continue
+            ;;
+            *:*-*|*-*:* )
+                return 0
+            ;;
+            * )
+                return 1
+            ;;
+        esac
+    done
+}
+
+#
+# stdin is "modules.inputmap" syntax
+# on return, all matching modules were added to $DRIVERS
+#
+input_map_modules ()
+{
+    local line module
+    local relBits mscBits ledBits sndBits keyBits absBits ffBits
+
+    while read line
+    do
+        # comments are lines that start with "#" ...
+        # be careful, they still get parsed by bash!
+        case "$line" in
+            \#*|"") continue ;;
+        esac
+
+        set $line
+
+        module=$1
+        matchBits=$(($2))
+
+        bustype=$(($3))
+        vendor=$(($4))
+        product=$(($5))
+        vendor=$(($6))
+
+        evBits=$(($7))
+        keyBits=$8
+        relBits=$(($9))
+
+        shift 9
+        absBits=$(($1))
+        cbsBits=$(($2))
+        ledBits=$(($3))
+        sndBits=$(($4))
+        ffBits=$(($5))
+        driverInfo=$(($6))
+
+        : checkmatch $module
+
+        : bustype $bustype $i_bustype
+        if [ $INPUT_DEVICE_ID_MATCH_BUS -eq $(( $matchBits & $INPUT_DEVICE_ID_MATCH_BUS )) ] &&
+           [ $bustype -ne $i_bustype ]; then
+            continue
+        fi
+
+        : vendor $vendor $i_vendor
+        if [ $INPUT_DEVICE_ID_MATCH_VENDOR -eq $(( $matchBits & $INPUT_DEVICE_ID_MATCH_VENDOR )) ] &&
+           [ $vendor -ne $i_vendor ]; then
+            continue
+        fi
+
+        : product $product $i_product
+        if [ $INPUT_DEVICE_ID_MATCH_PRODUCT -eq $(( $matchBits & $INPUT_DEVICE_ID_MATCH_PRODUCT )) ] &&
+           [ $product -ne $i_product ]; then
+            continue
+        fi
+
+        # version i_version $i_version < version $version
+        if [ $INPUT_DEVICE_ID_MATCH_VERSION -eq $(( $matchBits & $INPUT_DEVICE_ID_MATCH_VERSION )) ] &&
+           [ $version -ge $i_version ]; then
+            continue
+        fi
+
+        : evBits $evBits $i_evBits
+        if [ $INPUT_DEVICE_ID_MATCH_EVBIT -eq $(( $matchBits & $INPUT_DEVICE_ID_MATCH_EVBIT )) ] &&
+           [ $evBits -ne $(( $evBits & $i_evBits)) ]; then
+            continue
+        fi
+        : keyBits $keyBits $i_keyBits
+        if [ $INPUT_DEVICE_ID_MATCH_KEYBIT -eq $(( $matchBits & $INPUT_DEVICE_ID_MATCH_KEYBIT )) ] &&
+           input_match_bits "$keyBits" "$i_keyBits"; then
+            continue
+        fi
+        : relBits $relBits $i_relBits
+        if [ $INPUT_DEVICE_ID_MATCH_RELBIT -eq $(( $matchBits & $INPUT_DEVICE_ID_MATCH_RELBIT )) ] &&
+           [ $relBits -ne $(( $relBits & $i_relBits)) ]; then
+            continue
+        fi
+
+        : absBits $absBits $i_absBits
+        if [ $INPUT_DEVICE_ID_MATCH_ABSBIT -eq $(( $matchBits & $INPUT_DEVICE_ID_MATCH_ABSBIT )) ] &&
+           input_match_bits "$absBits" "$i_absBits"; then
+            continue
+        fi
+
+        : mscBits $mscBits $i_mscBits
+        if [ $INPUT_DEVICE_ID_MATCH_MSCBIT -eq $(( $matchBits & $INPUT_DEVICE_ID_MATCH_MSCBIT )) ] &&
+           [ $mscBits -ne $(( $mscBits & $i_mscBits)) ]; then
+            continue
+        fi
+
+        : ledBits $ledBits $_ledBits
+        if [ $INPUT_DEVICE_ID_MATCH_LEDBIT -eq $(( $matchBits & $INPUT_DEVICE_ID_MATCH_LEDBIT )) ] &&
+           input_match_bits "$ledBits" "$i_ledBits"; then
+            continue
+        fi
+
+        : sndBits $sndBits $i_sndBits
+        if [ $INPUT_DEVICE_ID_MATCH_SNDBIT -eq $(( $matchBits & $INPUT_DEVICE_ID_MATCH_SNDBIT )) ] &&
+           [ $sndBits -ne $(( $sndBits & $i_sndBits)) ]; then
+            continue
+        fi
+
+        : ffBits $ffBits $i_ffBits
+        if [ $INPUT_DEVICE_ID_MATCH_FFBIT -eq $(( $matchBits & $INPUT_DEVICE_ID_MATCH_FFBIT )) ] &&
+           input_match_bits "$ffBits" "$i_ffBits"; then
+            continue
+        fi
+
+        : driverInfo $driverInfo
+        if [ $matchBits -eq 0 -a $driverInfo -eq 0 ]; then
+                continue
+        fi
+
+        # It was a match!
+        case " $DRIVERS " in
+            *" $module "* )
+                : already found
+            ;;
+            * )
+                DRIVERS="$module $DRIVERS"
+            ;;
+        esac
+        : drivers $DRIVERS
+    done
+}
+
+#
+# What to do with this INPUT hotplug event?
+#
+case $ACTION in
+
+    add)
+
+        # If hwup does initialize the device there is nothing more to do
+        if [ -x /sbin/hwup ] && /sbin/hwup  ${1:+$1-}devpath-$DEVPATH -o hotplug; then
+            : nix
+        else
+
+            input_convert_vars
+
+            FOUND="" 
+            LABEL="INPUT product $PRODUCT"
+
+            # cope with special driver module configurations first. So we can
+            # overwrite default settings in MAP_CURRENT
+            if [ -r $MAP_HANDMAP ]; then
+                load_drivers usb $MAP_HANDMAP "$LABEL"
+                FOUND="$FOUND${DRIVERS:+ $DRIVERS}"
+            fi
+
+            if [ -r $MAP_CURRENT -a -z "$FOUND" ]; then
+                load_drivers input $MAP_CURRENT "$LABEL"
+            fi
+
+        fi
+
+        ;;
+
+    remove)
+
+        if [ -x /sbin/hwdown ] && /sbin/hwdown  ${1:+$1-}devpath-$DEVPATH -o hotplug; then
+            : nix
+        fi
+
+        ;;
+
+    *)
+        debug_mesg INPUT $ACTION event not supported
+        exit 1
+        ;;
+
+esac


Property changes on: trunk/udev/input_device.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/udev/load_floppy_module.sh
===================================================================
--- trunk/udev/load_floppy_module.sh	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/load_floppy_module.sh	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,32 @@
+#!/bin/sh
+########################################################################
+#
+# Description : load_floppy_module
+#
+# Authors     : Based on Open Suse Udev Rules
+#               kay.sievers at suse.de
+#
+# Adapted to  : Jim Gifford
+# LFS
+#
+# Version     : 00.00
+#
+# Notes       : Loads the floppy module based upon contents of the NVRAM
+# 
+########################################################################
+
+PROC=/proc/driver/nvram
+
+if [ ! -r /proc/driver/nvram ]; then
+    exit 0;
+fi
+
+floppy_devices=$(cat $PROC | sed -n '/Floppy.*\..*/p')
+
+if [ -n "$floppy_devices" ]; then
+    /sbin/modprobe block-major-2
+else
+    /bin/true
+fi
+
+exit $?


Property changes on: trunk/udev/load_floppy_module.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/udev/load_ide_modules.sh
===================================================================
--- trunk/udev/load_ide_modules.sh	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/load_ide_modules.sh	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,48 @@
+#!/bin/sh
+########################################################################
+#
+# Description : load_ide_modules
+#
+# Authors     : Based on Open Suse Udev Rules
+#               kay.sievers at suse.de
+#
+# Adapted to  : Jim Gifford
+# LFS
+#
+# Version     : 00.00
+#
+# Notes       : 
+#
+########################################################################
+
+device=${DEVPATH#/devices/*/ide?/}
+drive=${device#?.}
+bus=${device%.?}
+name=$(printf "hd%x" $(($drive + $bus * 2 + 10)))
+procfile="/proc/ide/$name/media"
+
+loop=50
+while ! test -e $procfile; do
+    sleep 0.1;
+    test "$loop" -gt 0 || exit 1
+    loop=$(($loop - 1))
+done
+
+read media < $procfile
+case "$media" in
+    cdrom)
+	/sbin/modprobe ide-cd
+	;;
+    disk)
+	/sbin/modprobe ide-disk
+	;;
+    floppy)
+	/sbin/modprobe ide-floppy
+	;;
+    tape)
+	/sbin/modprobe ide-tape
+	;;
+    *)
+	/sbin/modprobe ide-generic
+	;;
+esac

Added: trunk/udev/mount.sh
===================================================================
--- trunk/udev/mount.sh	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/mount.sh	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,66 @@
+#! /bin/bash
+
+. /etc/sysconfig/hardware/scripts/functions
+. /etc/sysconfig/storage
+
+test "$HOTPLUG_MOUNT_FSTAB" != yes && exit
+
+# Handle only partitions of sd
+case "$DEVNAME" in
+	/dev/sd*|/dev/hd*) : ;;
+	*) exit 0 ;;
+esac
+case "$DEVNAME" in
+	*sd[a-z]|*hd[a-z]) exit 0 ;;
+esac
+
+
+NODES=$DEVNAME
+for sl in `udevinfo -q symlink -p $DEVPATH`; do
+	NODES="$NODES /dev/$sl"
+done
+info_mesg "Avilable nodes: $NODES"
+
+NODE=
+declare -i FSCK=0
+while read dn mp fs opts dump fsck x; do
+	for n in $NODES; do
+		if [ "$n" == "$dn" ] ; then
+			case $opts in
+				*hotplug*) : ;;
+				*) exit 0 ;;
+			esac
+			NODE="$n"
+			FSCK="$fsck"
+			info_mesg "matching line for $DEVNAME:"
+			info_mesg "$dn $mp $fs $opts $dump $fsck $x"
+			break 2
+		fi
+	done
+done < /etc/fstab
+
+if [ "$HOTPLUG_CHECK_FILESYSTEMS" == yes -a "$FSCK" -gt 0 ] ; then
+	MESSAGE="`fsck -a $DEVNAME`"
+	RET=$?
+	info_mesg "$MESSAGE"
+	case $RET in
+		0|1) : ;;
+		2|3) 
+			info_mesg "Please unplug device $DEVNAME, and plug it again" 
+			logger -t $0 "fsck for '$DEVNAME' failed. Will not mount it."
+			exit 0
+			;;
+		*) 
+			err_mesg "fsck failed on $DEVNAME. Please fsck filesystem manually." 
+			logger -t $0 "fsck for '$DEVNAME' failed. Will not mount it."
+			exit 1
+			;;
+	esac
+fi
+
+
+if [ -n "$NODE" ] ; then
+	MESSAGE="`mount -av "$NODE"`"
+	test $? != 0 && logger -t $0 "Could not mount '$DEVNAME'."
+	info_mesg "$MESSAGE"
+fi


Property changes on: trunk/udev/mount.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/udev/remove_floppy_devices.sh
===================================================================
--- trunk/udev/remove_floppy_devices.sh	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/remove_floppy_devices.sh	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,22 @@
+#!/bin/sh
+########################################################################
+#
+# Description : remove_floppy_devices
+#
+# Authors     : Based on Open Suse Udev Rules
+#               kay.sievers at suse.de
+#
+# Adapted to  : Jim Gifford
+# LFS
+#
+# Version     : 00.00
+#
+# Notes       :
+#
+########################################################################
+
+fdname=$1
+
+for dev in /dev/${fdname}*; do
+	rm -f $dev
+done


Property changes on: trunk/udev/remove_floppy_devices.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/udev/scsi_id.config
===================================================================
--- trunk/udev/scsi_id.config	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/scsi_id.config	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,8 @@
+#
+# scsi_id configuration
+#
+
+#
+# libata drives require vpd page 0x80
+#
+vendor="ATA",options=-p 0x80

Added: trunk/udev/show_event_log
===================================================================
--- trunk/udev/show_event_log	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/show_event_log	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,73 @@
+#!/bin/sh
+########################################################################
+#
+# Description : show_event_log
+#
+# Authors     : Based on Open Suse Udev Rules
+#               kay.sievers at suse.de
+#
+# Adapted to  : Jim Gifford
+# LFS
+#
+# Version     : 00.00
+#
+# Notes       :
+#
+########################################################################
+#
+# known events are:
+# ac97 acpi block cpu drivers edd firmware graphics i2c-adapter i8259
+# ieee1394_protocol input ioapic irqrouter lapic mem misc module namespace
+# pci_bus pci_express pcmcia pcmcia_socket platform pnp printer scsi scsi_host
+# serio sound timer timer_pit tty usb usb_device usb_host vc
+#
+EXCLUDE_SUBS="acpi cpu edd mem namespace pci_bus tty vc"
+# EXCLUDE_SUBS="ac97 acpi cpu drivers edd graphics i2c-adapter mem i8259 ioapic irqrouter lapic mem module namespace platform pnp pci_bus tty vc"
+MESSAGES=${MESSAGES:-/var/log/messages}
+#grep udevd /var/log/messages | grep -v "pass_env\|geventrec\|hal.hot\|received"
+
+show_event() {
+	local SN PID SUBS
+	declare -i SN=$1 PID
+#	read PID ACT SUBS < <(sed -n "s/^.*seq $SN forked, pid \[\([0-9]*\)\], \([^,]*\),.*$/\1 \2/p;T;q" $MESSAGES)
+	read PID ACT SUBS < <(sed -n "s/^.*seq $SN forked, pid \[\([0-9]*\)\], '\([^']*\)' '\([^']*\)'.*$/\1 \2 \3/p;T;q" $MESSAGES)
+	if [ $PID == 0 ] ; then
+		echo event $SN not found 1>&2
+		return 1
+	fi
+	if [ -n "$WANTED_SUBS" ] ; then
+		WANTED=no
+		for S in $WANTED_SUBS; do
+			test "$SUBS" == "$S" && WANTED=yes
+		done
+	else
+		WANTED=yes
+		for S in $EXCLUDE_SUBS; do
+			test "$SUBS" == "$S" && WANTED=no
+		done
+	fi
+	echo event $SN $PID $ACT $SUBS $WANTED 1>&2
+	test $WANTED == no && return 1
+	echo " _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ $SN _ $ACT _ $SUBS _ _ _ _"
+	grep "seq $SN \|\[$PID\]" $MESSAGES |
+		grep -v "pass_env\|geventrec\|hal.hot"
+	echo
+}
+
+declare -i START=$1 STOP=$2
+if [ "$2" == last ] ; then
+	read STOP < <(grep -o "udev_done.*exit" $MESSAGES | cut -d" " -f3 | sort -n | tail -1)
+fi
+test $START -lt 0 -a $STOP -gt 0 && START=$((STOP+START+1))
+test $START -gt $STOP && STOP=$START
+shift; shift; WANTED_SUBS="$*"
+for n in `seq $START $STOP`; do
+	show_event $n
+done
+	
+exit
+
+# list all events
+(read x; while read x s x x x c x; read x s2 x a d; do echo $s $s2 $a $c $d; done) < <( sed -n "s/^.*udev.*\(seq [0-9]* [qf].*$\)/\1/p" /var/log/messages | sort -n -k 2 | tr -d ',' )   
+
+./show_event_log 1 last > boot.events.log.`date +%A_%H:%M` 2> boot.events.list.`date +%A_%H:%M`


Property changes on: trunk/udev/show_event_log
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/udev/sysconfig.storage
===================================================================
--- trunk/udev/sysconfig.storage	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/sysconfig.storage	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,22 @@
+## Path:           Hardware/Storage
+## Description:    Common storage device options
+
+## Type:           yesno
+## Default:        yes
+#
+# Should we mount hotplugged system storage devices automatically?
+# This requires a fstab line with mount option 'hotplug'. See README.Hotplug in
+# /usr/share/doc/packages/udev for details.
+# WARNING: You have to unmount these devices manually before you unplug them!!!
+#
+HOTPLUG_MOUNT_FSTAB=yes
+
+## Type:           yesno
+## Default:        yes
+# Should we check hotplugged system storage devices before we mount them?
+# If set to yes, you may control this individually in the sixth field in
+# /etc/fstab as usual. Watch /var/log/messages for errors and warnings. See
+# README.Hotplug in # /usr/share/doc/packages/udev for details.
+#
+HOTPLUG_CHECK_FILESYSTEMS=yes
+

Added: trunk/udev/udev.count_events
===================================================================
--- trunk/udev/udev.count_events	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/udev.count_events	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,24 @@
+#!/bin/sh
+########################################################################
+#
+# Description : udev.count_events
+#
+# Authors     : Based on Open Suse Udev Rules
+#               kay.sievers at suse.de
+#
+# Adapted to  : Jim Gifford
+# LFS
+#
+# Version     : 00.00
+#
+# Notes       : Wait for all current udev events to finish
+#
+########################################################################
+
+loop=100
+while test -d /dev/.udev/queue; do
+    sleep 0.1;
+    test "$loop" -gt 0 || exit 1
+    loop=$(($loop - 1))
+done
+exit 0


Property changes on: trunk/udev/udev.count_events
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/udev/udev.makechanges
===================================================================
--- trunk/udev/udev.makechanges	2005-12-05 16:57:18 UTC (rev 830)
+++ trunk/udev/udev.makechanges	2005-12-05 18:42:24 UTC (rev 831)
@@ -0,0 +1,10 @@
+Udev will need to be made with the following extras
+
+extras/scsi_id
+extras/volume_id
+extras/ata_id
+extras/usb_id
+extras/edd_id
+extras/dasd_id
+extras/cdrom_id
+extras/floppy




More information about the cross-lfs mailing list