summaryrefslogtreecommitdiffstats
path: root/openembedded/packages/udev
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2006-05-22 22:09:42 +0000
committerRichard Purdie <richard@openedhand.com>2006-05-22 22:09:42 +0000
commitcd21247af8a09738df4be658cb83a944cea8deab (patch)
tree32bdf4deb9492acb566bde87c8a74363e8e58bcf /openembedded/packages/udev
parentfe23e86ac15b7fd744323cf77053cea63b6107c5 (diff)
downloadpoky-cd21247af8a09738df4be658cb83a944cea8deab.tar.gz
Add udev 089 and add /dev/ram to udev autmount blacklist
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@399 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'openembedded/packages/udev')
-rw-r--r--openembedded/packages/udev/files/mount.blacklist1
-rw-r--r--openembedded/packages/udev/udev-089/flags.patch51
-rw-r--r--openembedded/packages/udev/udev-089/init227
-rw-r--r--openembedded/packages/udev/udev-089/local.rules28
-rw-r--r--openembedded/packages/udev/udev-089/udev.rules98
-rw-r--r--openembedded/packages/udev/udev_084.bb2
-rw-r--r--openembedded/packages/udev/udev_089.bb49
7 files changed, 455 insertions, 1 deletions
diff --git a/openembedded/packages/udev/files/mount.blacklist b/openembedded/packages/udev/files/mount.blacklist
index 7e13ea91de..dc6c98953f 100644
--- a/openembedded/packages/udev/files/mount.blacklist
+++ b/openembedded/packages/udev/files/mount.blacklist
@@ -1 +1,2 @@
1/dev/loop 1/dev/loop
2/dev/ram* \ No newline at end of file
diff --git a/openembedded/packages/udev/udev-089/flags.patch b/openembedded/packages/udev/udev-089/flags.patch
new file mode 100644
index 0000000000..492a39881c
--- /dev/null
+++ b/openembedded/packages/udev/udev-089/flags.patch
@@ -0,0 +1,51 @@
1--- udev-089/Makefile.orig 2006-04-08 13:32:53.000000000 +0200
2+++ udev-089/Makefile 2006-04-08 13:34:27.000000000 +0200
3@@ -117,28 +117,28 @@
4 AR = $(CROSS_COMPILE)ar
5 RANLIB = $(CROSS_COMPILE)ranlib
6
7-CFLAGS = -g -Wall -pipe -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
8+override CFLAGS = -g -Wall -pipe -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
9 WARNINGS = -Wstrict-prototypes -Wsign-compare -Wshadow \
10 -Wchar-subscripts -Wmissing-declarations -Wnested-externs \
11 -Wpointer-arith -Wcast-align -Wsign-compare -Wmissing-prototypes
12-CFLAGS += $(WARNINGS)
13+override CFLAGS += $(WARNINGS)
14
15 LDFLAGS = -Wl,-warn-common
16
17 OPTFLAGS = -Os
18-CFLAGS += $(OPTFLAGS)
19+override CFLAGS += $(OPTFLAGS)
20
21 ifeq ($(strip $(USE_LOG)),true)
22- CFLAGS += -DUSE_LOG
23+ override CFLAGS += -DUSE_LOG
24 endif
25
26 # if DEBUG is enabled, then we do not strip
27 ifeq ($(strip $(DEBUG)),true)
28- CFLAGS += -DDEBUG
29+ override CFLAGS += -DDEBUG
30 endif
31
32 ifeq ($(strip $(USE_GCOV)),true)
33- CFLAGS += -fprofile-arcs -ftest-coverage
34+ override CFLAGS += -fprofile-arcs -ftest-coverage
35 LDFLAGS += -fprofile-arcs
36 endif
37
38@@ -151,11 +151,11 @@
39 ifeq ($(strip $(USE_SELINUX)),true)
40 UDEV_OBJS += udev_selinux.o
41 LIB_OBJS += -lselinux -lsepol
42- CFLAGS += -DUSE_SELINUX
43+ override CFLAGS += -DUSE_SELINUX
44 endif
45
46 ifeq ($(strip $(USE_STATIC)),true)
47- CFLAGS += -DUSE_STATIC
48+ override CFLAGS += -DUSE_STATIC
49 LDFLAGS += -static
50 endif
51
diff --git a/openembedded/packages/udev/udev-089/init b/openembedded/packages/udev/udev-089/init
new file mode 100644
index 0000000000..5a60d52a9a
--- /dev/null
+++ b/openembedded/packages/udev/udev-089/init
@@ -0,0 +1,227 @@
1#!/bin/sh -e
2### BEGIN INIT INFO
3# Provides: udev
4# Required-Start: mountvirtfs
5# Required-Stop:
6# Default-Start: S
7# Default-Stop:
8# Short-Description: Start udevd, populate /dev and load drivers.
9### END INIT INFO
10
11# we need to unmount /dev/pts/ and remount it later over the tmpfs
12unmount_devpts() {
13 if mountpoint -q /dev/pts/; then
14 umount -l /dev/pts/
15 fi
16
17 if mountpoint -q /dev/shm/; then
18 umount -l /dev/shm/
19 fi
20}
21
22# mount a tmpfs over /dev, if somebody did not already do it
23mount_tmpfs() {
24 if grep -E -q "^[^[:space:]]+ /dev tmpfs" /proc/mounts; then
25 return
26 fi
27
28 # /dev/.static/dev/ is used by MAKEDEV to access the real /dev/ directory.
29 # /etc/udev/ is recycled as a temporary mount point because it's the only
30 # directory which is guaranteed to be available.
31 mount -n -o bind /dev /etc/udev
32
33 if ! mount -n -o size=$tmpfs_size,mode=0755 -t tmpfs tmpfs /dev; then
34 umount /etc/udev
35 echo "udev requires tmpfs support, not started."
36 exit 1
37 fi
38
39 mkdir -p /dev/.static/dev
40 chmod 700 /dev/.static/
41 # The mount options in busybox are non-standard...
42 if test -x /bin/mount.util-linux
43 then
44 /bin/mount.util-linux --move /etc/udev /dev/.static/dev
45 elif test -x /bin/busybox
46 then
47 busybox mount -n -o move /etc/udev /dev/.static/dev
48 else
49 echo "udev requires an identifiable mount command, not started."
50 umount /etc/udev
51 umount /dev
52 exit 1
53 fi
54}
55
56# I hate this hack. -- Md
57make_extra_nodes() {
58 if [ "$(echo /lib/udev/devices/*)" != "/lib/udev/devices/*" ]; then
59 cp -a /lib/udev/devices/* /dev/
60 fi
61
62 [ -e /etc/udev/links.conf ] || return 0
63 grep '^[^#]' /etc/udev/links.conf | \
64 while read type name arg1; do
65 [ "$type" -a "$name" -a ! -e "/dev/$name" -a ! -L "/dev/$name" ] ||continue
66 case "$type" in
67 L) ln -s $arg1 /dev/$name ;;
68 D) mkdir -p /dev/$name ;;
69 M) mknod -m 600 /dev/$name $arg1 ;;
70 *) echo "links.conf: unparseable line ($type $name $arg1)" ;;
71 esac
72 done
73}
74
75supported_kernel() {
76 case "$(uname -r)" in
77 2.[012345].*|2.6.[0-9]|2.6.[0-9][!0-9]*) return 1 ;;
78 2.6.1[01]|2.6.1[01][!0-9]*) return 1 ;;
79 esac
80 return 0
81}
82
83set_hotplug_handler() {
84 case "$(uname -r)" in
85 2.6.1[0-4]|2.6.1[0-4][!0-9]*) HANDLER='/sbin/udevsend' ;;
86 esac
87 echo $HANDLER > /proc/sys/kernel/hotplug
88}
89
90# shell version of /usr/bin/tty
91my_tty() {
92 [ -x /bin/readlink ] || return 0
93 [ -e /proc/self/fd/0 ] || return 0
94 readlink --silent /proc/self/fd/0 || true
95}
96
97warn_if_interactive() {
98 if [ "$RUNLEVEL" = "S" -a "$PREVLEVEL" = "N" ]; then
99 return
100 fi
101
102 TTY=$(my_tty)
103 if [ -z "$TTY" -o "$TTY" = "/dev/console" ]; then
104 return
105 fi
106
107 printf "\n\n\nIt has been detected that the command\n\n\t$0 $*\n\n"
108 printf "has been run from an interactive shell.\n"
109 printf "It will probably not do what you expect, so this script will wait\n"
110 printf "60 seconds before continuing. Press ^C to stop it.\n"
111 printf "RUNNING THIS COMMAND IS HIGHLY DISCOURAGED!\n\n\n\n"
112 sleep 60
113}
114
115##############################################################################
116
117PATH="/sbin:/bin:/usr/bin"
118
119[ -x /sbin/udevd ] || exit 0
120
121# defaults
122tmpfs_size="10M"
123udev_root="/dev"
124udevd_timeout=30
125
126. /etc/udev/udev.conf
127
128if ! supported_kernel; then
129 echo "udev requires a kernel >= 2.6.12, not started."
130 exit 1
131fi
132
133if [ ! -e /proc/filesystems ]; then
134 echo "udev requires a mounted procfs, not started."
135 exit 1
136fi
137
138if ! grep -q '[[:space:]]tmpfs$' /proc/filesystems; then
139 echo "udev requires tmpfs support, not started."
140 exit 1
141fi
142
143if [ ! -d /sys/class/ ]; then
144 echo "udev requires a mounted sysfs, not started."
145 exit 1
146fi
147
148if [ ! -e /proc/sys/kernel/hotplug ]; then
149 echo "udev requires hotplug support, not started."
150 exit 1
151fi
152
153##############################################################################
154
155# When modifying this script, do not forget that between the time that
156# the new /dev has been mounted and udevsynthesize has been run there will be
157# no /dev/null. This also means that you cannot use the "&" shell command.
158
159case "$1" in
160 start)
161 if [ -e "$udev_root/.udev/" ]; then
162 if mountpoint -q /dev/; then
163 TMPFS_MOUNTED=1
164 else
165 echo ".udev/ already exists on the static $udev_root!"
166 fi
167 else
168 warn_if_interactive
169 fi
170
171 echo "Starting the hotplug events dispatcher" "udevd"
172 udevd --daemon
173
174 set_hotplug_handler
175
176 if [ -z "$TMPFS_MOUNTED" ]; then
177 unmount_devpts
178 mount_tmpfs
179 [ -d /proc/1 ] || mount -n /proc
180 fi
181
182 # if this directory is not present /dev will not be updated by udev
183 mkdir -p /dev/.udev/ /dev/.udev/db/ /dev/.udev/queue/ /dev/.udevdb/
184 # /dev/null must be created before udevd is started
185 make_extra_nodes
186
187 echo "Synthesizing the initial hotplug events"
188 udevsynthesize
189
190 # wait for the udevd childs to finish
191 echo "Waiting for /dev to be fully populated"
192 while [ -d /dev/.udev/queue/ ]; do
193 sleep 1
194 udevd_timeout=$(($udevd_timeout - 1))
195 if [ $udevd_timeout -eq 0 ]; then
196 # ps axf
197 break
198 fi
199 done
200 if [ $udevd_timeout -eq 0 ]; then
201 echo 'timeout'
202 fi
203 ;;
204
205 stop)
206 echo "Stopping the hotplug events dispatcher" "udevd"
207 start-stop-daemon --stop --name udevd --quiet
208 ;;
209
210 restart|force-reload)
211 echo "Stopping the hotplug events dispatcher" "udevd"
212 if start-stop-daemon --stop --name udevd --quiet ; then
213 exit 1
214 fi
215
216 echo "Starting the hotplug events dispatcher" "udevd"
217 udevd --daemon
218 ;;
219
220 *)
221 echo "Usage: /etc/init.d/udev {start|stop|restart|force-reload}"
222 exit 1
223 ;;
224esac
225
226exit 0
227
diff --git a/openembedded/packages/udev/udev-089/local.rules b/openembedded/packages/udev/udev-089/local.rules
new file mode 100644
index 0000000000..bb8459ba23
--- /dev/null
+++ b/openembedded/packages/udev/udev-089/local.rules
@@ -0,0 +1,28 @@
1# There are a number of modifiers that are allowed to be used in some
2# of the different fields. They provide the following subsitutions:
3#
4# %n the "kernel number" of the device.
5# For example, 'sda3' has a "kernel number" of '3'
6# %e the smallest number for that name which does not matches an existing node
7# %k the kernel name for the device
8# %M the kernel major number for the device
9# %m the kernel minor number for the device
10# %b the bus id for the device
11# %c the string returned by the PROGRAM
12# %s{filename} the content of a sysfs attribute
13# %% the '%' char itself
14#
15
16# Media automounting
17SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh"
18SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"
19
20# Handle network interface setup
21SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh"
22SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh"
23
24# The first rtc device is symlinked to /dev/rtc
25KERNEL="rtc0", SYMLINK="rtc"
26
27# Try and modprobe for drivers for new hardware
28ACTION="add", DEVPATH="/devices/*", MODALIAS=="?*", RUN+="/sbin/modprobe $modalias"
diff --git a/openembedded/packages/udev/udev-089/udev.rules b/openembedded/packages/udev/udev-089/udev.rules
new file mode 100644
index 0000000000..7b4152c5bf
--- /dev/null
+++ b/openembedded/packages/udev/udev-089/udev.rules
@@ -0,0 +1,98 @@
1# There are a number of modifiers that are allowed to be used in some
2# of the different fields. They provide the following subsitutions:
3#
4# %n the "kernel number" of the device.
5# For example, 'sda3' has a "kernel number" of '3'
6# %e the smallest number for that name which does not matches an existing node
7# %k the kernel name for the device
8# %M the kernel major number for the device
9# %m the kernel minor number for the device
10# %b the bus id for the device
11# %c the string returned by the PROGRAM
12# %s{filename} the content of a sysfs attribute
13# %% the '%' char itself
14#
15
16# SCSI devices
17BUS=="scsi", KERNEL=="sr[0-9]*", NAME="scd%n", SYMLINK+="sr%n"
18
19# USB devices
20BUS=="usb", KERNEL=="auer[0-9]*", NAME="usb/%k"
21BUS=="usb", KERNEL=="cpad[0-9]*", NAME="usb/%k"
22BUS=="usb", KERNEL=="dabusb*", NAME="usb/%k"
23BUS=="usb", KERNEL=="hiddev*", NAME="usb/%k"
24BUS=="usb", KERNEL=="legousbtower*", NAME="usb/%k"
25BUS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k"
26BUS=="usb", KERNEL=="ttyUSB*", SYSFS{product}=="Palm Handheld*", \
27 SYMLINK+="pilot"
28
29# usbfs-like devices
30SUBSYSTEM=="usb_device", \
31 PROGRAM="/bin/sh -c 'export X=%k; export X=$${X#usbdev}; export B=$${X%%%%.*}; export D=$${X#*.}; echo bus/usb/$$B/$$D'", SYMLINK+="%c"
32
33# serial devices
34KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20"
35KERNEL=="capi[0-9]*", NAME="capi/%n"
36
37# video devices
38KERNEL=="card[0-9]*", NAME="dri/%k"
39
40# misc devices
41KERNEL=="hw_random", NAME="hwrng"
42KERNEL=="tun", NAME="net/%k"
43
44KERNEL=="cdemu[0-9]*", NAME="cdemu/%n"
45KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%n"
46KERNEL=="pktcdvd", NAME="pktcdvd/control"
47
48KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid"
49KERNEL=="msr[0-9]*", NAME="cpu/%n/msr"
50KERNEL=="microcode", NAME="cpu/microcode"
51
52KERNEL=="umad*", NAME="infiniband/%k"
53KERNEL=="issm*", NAME="infiniband/%k"
54KERNEL=="uverbs*", NAME="infiniband/%k"
55KERNEL=="ucm", NAME="infiniband/%k"
56
57KERNEL=="buzzer", NAME="misc/buzzer"
58
59# ALSA devices
60KERNEL=="controlC[0-9]*", NAME="snd/%k"
61KERNEL=="hwC[D0-9]*", NAME="snd/%k"
62KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k"
63KERNEL=="midiC[D0-9]*", NAME="snd/%k"
64KERNEL=="timer", NAME="snd/%k"
65KERNEL=="seq", NAME="snd/%k"
66
67# ieee1394 devices
68KERNEL=="dv1394*", NAME="dv1394/%n"
69KERNEL=="video1394*", NAME="video1394/%n"
70
71# input devices
72KERNEL=="mice", NAME="input/%k"
73KERNEL=="mouse[0-9]*", NAME="input/%k"
74KERNEL=="event[0-9]*", NAME="input/%k"
75KERNEL=="js[0-9]*", NAME="input/%k"
76KERNEL=="ts[0-9]*", NAME="input/%k"
77KERNEL=="uinput", NAME="input/%k"
78
79# Zaptel
80KERNEL=="zapctl", NAME="zap/ctl"
81KERNEL=="zaptimer", NAME="zap/timer"
82KERNEL=="zapchannel", NAME="zap/channel"
83KERNEL=="zappseudo", NAME="zap/pseudo"
84KERNEL=="zap[0-9]*", NAME="zap/%n"
85
86# AOE character devices
87SUBSYSTEM=="aoe", KERNEL=="discover", NAME="etherd/%k"
88SUBSYSTEM=="aoe", KERNEL=="err", NAME="etherd/%k"
89SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k"
90
91# device mapper creates its own device nodes, so ignore these
92KERNEL=="dm-[0-9]*", OPTIONS+="ignore_device"
93KERNEL=="device-mapper", NAME="mapper/control"
94
95KERNEL="rfcomm[0-9]*", NAME="%k", GROUP="users", MODE="0660"
96
97# Firmware Helper
98ACTION=="add", SUBSYSTEM=="firmware", RUN+="/lib/udev/firmware_helper"
diff --git a/openembedded/packages/udev/udev_084.bb b/openembedded/packages/udev/udev_084.bb
index 0bb96c7f36..71c8e048ff 100644
--- a/openembedded/packages/udev/udev_084.bb
+++ b/openembedded/packages/udev/udev_084.bb
@@ -15,7 +15,7 @@ include udev.inc
15 15
16INITSCRIPT_PARAMS = "start 03 S ." 16INITSCRIPT_PARAMS = "start 03 S ."
17 17
18PR = "r12" 18PR = "r13"
19 19
20FILES_${PN} += "${base_libdir}" 20FILES_${PN} += "${base_libdir}"
21UDEV_EXTRAS = "extras/firmware/ extras/scsi_id/ extras/volume_id/ extras/run_directory/" 21UDEV_EXTRAS = "extras/firmware/ extras/scsi_id/ extras/volume_id/ extras/run_directory/"
diff --git a/openembedded/packages/udev/udev_089.bb b/openembedded/packages/udev/udev_089.bb
new file mode 100644
index 0000000000..3ab31addee
--- /dev/null
+++ b/openembedded/packages/udev/udev_089.bb
@@ -0,0 +1,49 @@
1DESCRIPTION = "udev is a daemon which dynamically creates and removes device nodes from \
2/dev/, handles hotplug events and loads drivers at boot time. It replaces \
3the hotplug package and requires a kernel not older than 2.6.12."
4RPROVIDES = "hotplug"
5
6PR = "r2"
7
8SRC_URI = "http://kernel.org/pub/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
9 file://noasmlinkage.patch;patch=1 \
10 file://flags.patch;patch=1 \
11 file://udevsynthesize.patch;patch=1 \
12 file://udevsynthesize.sh \
13 file://mount.blacklist"
14
15include udev.inc
16
17INITSCRIPT_PARAMS = "start 03 S ."
18
19FILES_${PN} += "${base_libdir}"
20UDEV_EXTRAS = "extras/firmware/ extras/scsi_id/ extras/volume_id/ extras/run_directory/"
21EXTRA_OEMAKE += "libudevdir=/lib/udev"
22
23do_install () {
24 install -d ${D}${usrsbindir} \
25 ${D}${sbindir}
26 oe_runmake 'DESTDIR=${D}' INSTALL=install install
27 install -d ${D}${sysconfdir}/init.d
28 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
29
30 install -d ${D}${sysconfdir}/udev/rules.d/
31
32 install -m 0644 ${WORKDIR}/mount.blacklist ${D}${sysconfdir}/udev/
33 install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules
34 install -m 0644 ${WORKDIR}/permissions.rules ${D}${sysconfdir}/udev/rules.d/permissions.rules
35 install -m 0644 ${WORKDIR}/udev.rules ${D}${sysconfdir}/udev/rules.d/udev.rules
36 install -m 0644 ${WORKDIR}/links.conf ${D}${sysconfdir}/udev/links.conf
37 if [ "${UDEV_DEVFS_RULES}" = "1" ]; then
38 install -m 0644 ${WORKDIR}/devfs-udev.rules ${D}${sysconfdir}/udev/rules.d/devfs-udev.rules
39 fi
40
41 install -d ${D}${sysconfdir}/udev/scripts/
42
43 install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh
44 install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts
45
46 install -d ${D}${base_libdir}/udev/
47 install -m 0755 ${S}/udevsynthesize ${D}${base_libdir}/udev/udevsynthesize
48 install -m 0755 ${WORKDIR}/udevsynthesize.sh ${D}${sbindir}/udevsynthesize
49}