Changeset a6cd72e
- Timestamp:
- Feb 21, 2006, 1:37:37 AM (19 years ago)
- Branches:
- clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
- Children:
- 128c984
- Parents:
- ce36880
- Location:
- udev
- Files:
-
- 3 added
- 2 deleted
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
udev/50-udev.rules
rce36880 ra6cd72e 14 14 # 15 15 ######################################################################## 16 17 # ignore these events until someone needs them18 SUBSYSTEM=="drivers", OPTIONS="last_rule"19 SUBSYSTEM=="module", OPTIONS="last_rule"20 16 21 17 # console … … 56 52 SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%i $${K%%%%.*} $${K#*.}'", NAME="%c", GROUP="video" 57 53 58 # Kino jogshuttle support59 SUBSYSTEM=="usb", ACTION=="add", ENV{PRODUCT}=="b33/10/*", RUN+="/usr/bin/killall --quiet -USR2 kino"60 SUBSYSTEM=="usb", ACTION=="add", ENV{PRODUCT}=="5f3/240/*", RUN+="/usr/bin/killall --quiet -USR2 kino"61 62 54 # input devices 63 55 KERNEL=="mice", NAME="input/%k", MODE="0640" … … 68 60 KERNEL=="uinput", NAME="input/%k", MODE="0600" 69 61 KERNEL=="lirc0", NAME="%k", SYMLINK+="lirc" 70 KERNEL=="input[0-9]*", RUN+="/lib/udev/input_device.sh" 71 KERNEL=="input[0-9]*", ACTION=="add", ENV{ABS}=="[1-9]*", RUN+="/sbin/modprobe joydev" 62 KERNEL=="input[0-9]*", ACTION=="add", RUN+="input.sh" 72 63 73 64 # printer … … 94 85 # 167 /dev/specialix_sxctl Specialix serial control 95 86 KERNEL=="sxctl", NAME="specialix_sxctl", SYMLINK+="%k" 87 88 # network 89 KERNEL=="tun", NAME="net/%k", MODE="0600" 96 90 97 91 # misc devices … … 121 115 KERNEL=="auer[0-9]*" NAME="usb/%k" 122 116 117 # packet writing interface 123 118 KERNEL=="pktcdvd", NAME="pktcdvd/control" 124 119 KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%k" 125 120 126 121 # fix floppy devices 127 KERNEL=="nvram", ACTION=="add", RUN+=" /lib/udev/load_floppy_module.sh"128 KERNEL=="fd *", ACTION=="add", SYSFS{device/cmos}=="*", RUN+="/lib/udev/create_floppy_devices -c -t $sysfs{device/cmos} -m %M /dev/%k"129 KERNEL=="fd *", ACTION=="remove", RUN+="/lib/udev/remove_floppy_devices.sh %k"122 KERNEL=="nvram", ACTION=="add", RUN+="load_floppy_module.sh" 123 KERNEL=="fd[0-9]*", ACTION=="add", SYSFS{device/cmos}=="*", RUN+="create_floppy_devices -c -t $sysfs{device/cmos} -m %M /dev/%k" 124 KERNEL=="fd[0-9]*", ACTION=="remove", RUN+="/bin/rm -f $root/%k*" 130 125 131 126 # block devices … … 143 138 SUBSYSTEM=="scsi_device", ACTION=="add", RUN+="/sbin/modprobe sg" 144 139 145 # IDE modules146 SUBSYSTEM=="ide", ACTION=="add", RUN+=" /lib/udev/load_ide_modules.sh"140 # load IDE modules 141 SUBSYSTEM=="ide", ACTION=="add", RUN+="ide.sh" 147 142 148 143 # device mapper 149 KERNEL=="device-mapper", ACTION=="add",NAME="%k", SYMLINK+="mapper/control"144 KERNEL=="device-mapper", NAME="%k", SYMLINK+="mapper/control" 150 145 151 146 # check fstab and possibly mount 152 SUBSYSTEM=="block", KERNEL=="sd*[0-9]|hd*[0-9]", ACTION=="add", RUN+="/lib/udev/mount.sh"147 SUBSYSTEM=="block", ACTION=="add", KERNEL=="sd*[0-9]|hd*[0-9]", RUN+="mount.sh" 153 148 154 149 # misc storage devices (non-block) … … 179 174 SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", MODE="0644" 180 175 181 # firmware loader182 SUBSYSTEM=="firmware", ACTION=="add", RUN+=" /lib/udev/firmware.sh"176 # kernel firmware loader 177 SUBSYSTEM=="firmware", ACTION=="add", RUN+="firmware.sh" -
udev/Makefile
rce36880 ra6cd72e 10 10 11 11 rules: 12 install -m ${RULESMODE} ${DESTDIR}/etc/udev/rules.d/ 10-wait-for-sysfs.rules12 install -m ${RULESMODE} ${DESTDIR}/etc/udev/rules.d/05-udev-early.rules 13 13 install -m ${RULESMODE} ${DESTDIR}/etc/udev/rules.d/50-udev.rules 14 14 install -m ${RULESMODE} ${DESTDIR}/etc/udev/rules.d/60-persistent.rules … … 19 19 install -m ${SCRIPTMODE) ${DESTDIR}/lib/udev/remove_floppy_devices.sh 20 20 install -m ${SCRIPTMODE) ${DESTDIR}/lib/udev/load_floppy_module.sh 21 install -m ${SCRIPTMODE) ${DESTDIR}/lib/udev/ load_ide_modules.sh21 install -m ${SCRIPTMODE) ${DESTDIR}/lib/udev/ide.sh 22 22 install -m ${SCRIPTMODE) ${DESTDIR}/lib/udev/firmware.sh 23 install -m ${SCRIPTMODE) ${DESTDIR}/lib/udev/input _device.sh23 install -m ${SCRIPTMODE) ${DESTDIR}/lib/udev/input.sh 24 24 install -m ${SCRIPTMODE) ${DESTDIR}/lib/udev/mount.sh 25 25 install -m ${CONFMODE} ${DESTDIR}/etc/scsi_id.config -
udev/boot.udev
rce36880 ra6cd72e 19 19 . /etc/sysconfig/rc 20 20 . ${rc_functions} 21 22 PATH="/sbin:/bin"23 DAEMON=/sbin/udevd24 udevd_args="--daemon"25 21 26 22 function trigger_device_events() { … … 58 54 case "$1" in 59 55 start) 60 61 56 # disable hotplug helper, udevd listens to netlink 62 57 echo "" > /proc/sys/kernel/hotplug 63 58 64 59 # start udevd 65 boot _mesg "Starting udevd"66 loadproc $DAEMON $udevd_args60 bootmesg "Starting udevd..." 61 loadproc /sbin/udevd --daemon 67 62 68 63 # cleanup some stuff 64 rm -f /var/run/sysconfig/network 69 65 rm -rf /events/* 66 67 # start coldplugging 68 bootmesg "Performing Coldplugging..." 70 69 71 70 # unlikely, but we may be faster than the first event … … 82 81 loop=$(($loop + 1)) 83 82 done 83 84 echo_ok 84 85 ;; 85 86 86 87 stop) 87 boot _mesg "Stopping udevd:"88 bootmesg "Stopping udevd..." 88 89 echo "/sbin/hotplug" > /proc/sys/kernel/hotplug 89 killproc $DAEMON90 killproc /sbin/udevd 90 91 ;; 91 92 92 93 restart) 93 ${0} stop 94 sleep 1 95 ${0} start 94 bootmesg "Restarting udevd..." 95 killproc /sbin/udevd 96 loadproc /sbin/udevd --daemon 97 evaluate_retval 96 98 ;; 97 99 … … 101 103 102 104 reload) 103 boot _mesg "Reloading udev rules:"105 bootmesg "Reloading udev rules..." 104 106 udevcontrol reload_rules 105 107 cp --preserve=all --recursive --update /lib/udev/devices/* /dev … … 108 110 109 111 force-reload) 110 boot _mesg "Updating all available device nodes in /dev:"112 bootmesg "Updating all available device nodes in /dev..." 111 113 udevcontrol reload_rules 112 114 rm -rf /dev/.udev /dev/disk … … 115 117 evaluate_retval 116 118 ;; 119 117 120 *) 118 121 echo "Usage: $0 {start|stop|restart|status|reload|force-reload}" -
udev/boot.udev_retry
rce36880 ra6cd72e 22 22 23 23 case "$1" in 24 25 24 start) 26 25 if test -d /dev/.udev/failed; then 27 boot _mesg "Retry device configuration"26 bootmesg "Retry device configuration..." 28 27 list=$(echo /dev/.udev/failed/*) 29 28 for i in $list; do -
udev/ide.sh
-
Property mode
changed from
100644
to100755
rce36880 ra6cd72e 2 2 ######################################################################## 3 3 # 4 # Description : load_ide_modules4 # Description : Load ide 5 5 # 6 6 # Authors : Based on Open Suse Udev Rules … … 12 12 # Version : 00.00 13 13 # 14 # Notes : 14 # Notes : 15 15 # 16 16 ######################################################################## 17 17 18 # calculate device name from bus and drive number 18 19 device=${DEVPATH#/devices/*/ide?/} 19 20 drive=${device#?.} 20 21 bus=${device%.?} 21 name=$(printf "hd%x" $(($drive + $bus * 2 + 10))) 22 unitnum=$((96 + 1 + $drive + $bus * 2)) 23 name=$(printf "hd\\$(printf '%o' $unitnum)") 22 24 procfile="/proc/ide/$name/media" 23 25 24 loop=50 26 # wait for /proc file to appear 27 loop=30 25 28 while ! test -e $procfile; do 26 29 sleep 0.1; 27 test "$loop" -gt 0 || exit 130 test "$loop" -gt 0 || break 28 31 loop=$(($loop - 1)) 29 32 done -
Property mode
changed from
-
udev/load_floppy_module.sh
rce36880 ra6cd72e 18 18 PROC=/proc/driver/nvram 19 19 20 # wait for /proc file to appear 21 loop=10 22 while ! test -e $PROC; do 23 sleep 0.1; 24 test "$loop" -gt 0 || break 25 loop=$(($loop - 1)) 26 done 27 20 28 if [ ! -r /proc/driver/nvram ]; then 21 29 exit 0; -
udev/mount.sh
rce36880 ra6cd72e 1 #! /bin/bash 1 #!/bin/sh 2 ######################################################################## 3 # 4 # Description : Input devices 5 # 6 # Authors : Based on Open Suse Udev Rules 7 # kay.sievers@suse.de 8 # 9 # Adapted to : Jim Gifford 10 # LFS 11 # 12 # Version : 00.00 13 # 14 # Notes : 15 # 16 ######################################################################## 2 17 3 . /etc/sysconfig/hardware/scripts/functions 18 . /etc/sysconfig/rc 19 . ${rc_functions} 4 20 . /etc/sysconfig/storage 5 21 … … 20 36 NODES="$NODES /dev/$sl" 21 37 done 22 info_mesg "Avilable nodes: $NODES"38 boot_mesg "Avilable nodes: $NODES" 23 39 24 40 NODE= … … 33 49 NODE="$n" 34 50 FSCK="$fsck" 35 info_mesg "matching line for $DEVNAME:"36 info_mesg "$dn $mp $fs $opts $dump $fsck $x"51 boot_mesg "matching line for $DEVNAME:" 52 boot_mesg "$dn $mp $fs $opts $dump $fsck $x" 37 53 break 2 38 54 fi … … 43 59 MESSAGE="`fsck -a $DEVNAME`" 44 60 RET=$? 45 info_mesg "$MESSAGE"61 boot_mesg "$MESSAGE" 46 62 case $RET in 47 63 0|1) : ;; 48 64 2|3) 49 info_mesg "Please unplug device $DEVNAME, and plug it again"65 boot_mesg "Please unplug device $DEVNAME, and plug it again" 50 66 logger -t $0 "fsck for '$DEVNAME' failed. Will not mount it." 51 67 exit 0 … … 63 79 MESSAGE="`mount -av "$NODE"`" 64 80 test $? != 0 && logger -t $0 "Could not mount '$DEVNAME'." 65 info_mesg "$MESSAGE"81 boot_mesg "$MESSAGE" 66 82 fi
Note:
See TracChangeset
for help on using the changeset viewer.