diff options
author | Richard Purdie <richard@openedhand.com> | 2005-09-20 15:19:38 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2005-09-20 15:19:38 +0000 |
commit | 8d66edc4085db428e67223f0f71cde6b3640f27e (patch) | |
tree | da9dcd13d59b36f7350d3938f9094cb2ecc4449a /openembedded | |
parent | b4a7122cacef647dbec3db5c9ebe1e504a7670df (diff) | |
download | poky-8d66edc4085db428e67223f0f71cde6b3640f27e.tar.gz |
pcmciautils and udev updates. Slowly aiming to get rid of hotplug and pcmcia-cs
git-svn-id: https://svn.o-hand.com/repos/poky@27 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'openembedded')
15 files changed, 442 insertions, 197 deletions
diff --git a/openembedded/packages/pcmciautils/pcmciautils_010.bb b/openembedded/packages/pcmciautils/pcmciautils_010.bb new file mode 100644 index 0000000000..f619a98235 --- /dev/null +++ b/openembedded/packages/pcmciautils/pcmciautils_010.bb | |||
@@ -0,0 +1,35 @@ | |||
1 | DESCRIPTION = "Linux Kernel 2.6 Userland Utilities for the PCMCIA Subsystem" | ||
2 | DEPENDS = "sysfsutils udev" | ||
3 | RDEPENDS = "udev" | ||
4 | HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/pcmcia/pcmcia.html" | ||
5 | SECTION = "kernel/userland" | ||
6 | PRIORITY = "optional" | ||
7 | |||
8 | SRC_URI = "http://kernel.org/pub/linux/utils/kernel/pcmcia/pcmciautils-${PV}.tar.bz2" | ||
9 | S = "${WORKDIR}/pcmciautils-${PV}" | ||
10 | |||
11 | PR = "r1" | ||
12 | |||
13 | inherit update-rc.d | ||
14 | |||
15 | INITSCRIPT_NAME = "coldplug" | ||
16 | INITSCRIPT_PARAMS = "defaults" | ||
17 | |||
18 | export HOSTCC = "${BUILD_CC}" | ||
19 | export etcdir = "${sysconfdir}" | ||
20 | export pcmciaconfdir = "${sysconfdir}/pcmcia" | ||
21 | export udevrulesdir = "${sysconfdir}/udev/rules.d" | ||
22 | export UDEV = 1 | ||
23 | LD = "${CC}" | ||
24 | CFLAGS =+ "-I${S}/src" | ||
25 | CFLAGS =+ '-DPCMCIAUTILS_VERSION=010' | ||
26 | |||
27 | PARALLEL_MAKE = "" | ||
28 | EXTRA_OEMAKE = "-e 'STRIP=echo' 'LIB_OBJS=-lc -lsysfs'" | ||
29 | |||
30 | do_install () { | ||
31 | oe_runmake 'DESTDIR=${D}' install | ||
32 | } | ||
33 | |||
34 | CONFFILES_${PN} += "${sysconfdir}/pcmcia/config.opts" | ||
35 | RCONFLICTS_${PN} += "pcmcia-cs" | ||
diff --git a/openembedded/packages/udev/files/init b/openembedded/packages/udev/files/init index 16efb31542..c290661c72 100755 --- a/openembedded/packages/udev/files/init +++ b/openembedded/packages/udev/files/init | |||
@@ -1,36 +1,18 @@ | |||
1 | #!/bin/sh -e | 1 | #!/bin/sh -e |
2 | 2 | ||
3 | PATH="/usr/sbin:/usr/bin:/sbin:/bin" | ||
4 | |||
5 | UDEVSTART=/sbin/udevstart | 3 | UDEVSTART=/sbin/udevstart |
6 | 4 | ||
7 | # default maximum size of the /dev ramfs | 5 | # defaults |
8 | ramfs_size="1M" | 6 | tmpfs_size="10M" |
7 | udev_root="/dev" | ||
9 | 8 | ||
10 | [ -x $UDEVSTART ] || exit 0 | 9 | [ -x $UDEVSTART ] || exit 0 |
11 | 10 | ||
12 | . /etc/udev/udev.conf | 11 | . /etc/udev/udev.conf |
13 | 12 | ||
14 | case "$(uname -r)" in | ||
15 | 2.[012345].*) | ||
16 | echo "udev requires a kernel >= 2.6, not started." | ||
17 | exit 0 | ||
18 | ;; | ||
19 | esac | ||
20 | |||
21 | if ! grep -q '[[:space:]]ramfs$' /proc/filesystems; then | ||
22 | echo "udev requires ramfs support, not started." | ||
23 | exit 0 | ||
24 | fi | ||
25 | |||
26 | if [ ! -e /proc/sys/kernel/hotplug ]; then | ||
27 | echo "udev requires hotplug support, not started." | ||
28 | exit 0 | ||
29 | fi | ||
30 | |||
31 | ############################################################################## | 13 | ############################################################################## |
32 | 14 | ||
33 | # we need to unmount /dev/pts/ and remount it later over the ramfs | 15 | # we need to unmount /dev/pts/ and remount it later over the tmpfs |
34 | unmount_devpts() { | 16 | unmount_devpts() { |
35 | if mountpoint -q /dev/pts/; then | 17 | if mountpoint -q /dev/pts/; then |
36 | umount -l /dev/pts/ | 18 | umount -l /dev/pts/ |
@@ -41,132 +23,169 @@ unmount_devpts() { | |||
41 | fi | 23 | fi |
42 | } | 24 | } |
43 | 25 | ||
44 | # mount a ramfs over /dev, if somebody did not already do it | 26 | # mount a tmpfs over /dev, if somebody did not already do it |
45 | mount_ramfs() { | 27 | mount_tmpfs() { |
46 | if grep -E -q "^[^[:space:]]+ /dev ramfs" /proc/mounts; then | 28 | if grep -E -q "^[^[:space:]]+ /dev tmpfs" /proc/mounts; then |
47 | return 0 | 29 | return 0 |
48 | fi | 30 | fi |
49 | 31 | ||
50 | # /.dev is used by /sbin/MAKEDEV to access the real /dev directory. | 32 | # /dev/.static/dev/ is used by MAKEDEV to access the real /dev/ directory. |
51 | # if you don't like this, remove /.dev/. | 33 | # /etc/udev/ is recycled as a temporary mount point because it's the only |
52 | [ -d /.dev ] && mount --bind /dev /.dev | 34 | # directory which is guaranteed to be available. |
35 | mount -n -o bind /dev /etc/udev | ||
36 | |||
37 | if ! mount -n -o size=$tmpfs_size,mode=0755 -t tmpfs tmpfs /dev; then | ||
38 | umount /etc/udev | ||
39 | echo "udev requires tmpfs support, not started." | ||
40 | exit 1 | ||
41 | fi | ||
42 | |||
43 | # using ln to test if /dev works, because touch is in /usr/bin/ | ||
44 | if ln -s test /dev/test-file; then | ||
45 | rm /dev/test-file | ||
46 | else | ||
47 | echo "udev requires tmpfs support, not started." | ||
48 | umount /etc/udev | ||
49 | umount /dev | ||
50 | exit 1 | ||
51 | fi | ||
53 | 52 | ||
54 | echo -n "Mounting a ramfs over /dev..." | 53 | mkdir -p /dev/.static/dev |
55 | mount -n -o size=$ramfs_size,mode=0755 -t ramfs none /dev | 54 | chmod 700 /dev/.static/ |
56 | echo "done." | 55 | mount -n -o move /etc/udev /dev/.static/dev |
57 | } | 56 | } |
58 | 57 | ||
59 | # I hate this hack. -- Md | 58 | # I hate this hack. -- Md |
60 | make_extra_nodes() { | 59 | make_extra_nodes() { |
61 | if [ -f /etc/udev/links.conf ]; then | 60 | [ -e /etc/udev/links.conf ] || return 0 |
62 | grep '^[^#]' /etc/udev/links.conf | \ | 61 | grep '^[^#]' /etc/udev/links.conf | \ |
63 | while read type name arg1; do | 62 | while read type name arg1; do |
64 | [ "$type" -a "$name" -a ! -e "/dev/$name" -a ! -L "/dev/$name" ] ||continue | 63 | [ "$type" -a "$name" -a ! -e "/dev/$name" -a ! -L "/dev/$name" ] ||continue |
65 | case "$type" in | 64 | case "$type" in |
66 | L) | 65 | L) ln -s $arg1 /dev/$name ;; |
67 | ln -s $arg1 /dev/$name | 66 | D) mkdir -p /dev/$name ;; |
68 | ;; | 67 | M) mknod -m 600 /dev/$name $arg1 ;; |
69 | D) | 68 | *) echo "links.conf: unparseable line ($type $name $arg1)" ;; |
70 | mkdir -p /dev/$name | ||
71 | ;; | ||
72 | M) | ||
73 | mknod -m 600 /dev/$name $arg1 | ||
74 | ;; | ||
75 | *) | ||
76 | echo "unparseable line ($type $name $arg1)" | ||
77 | ;; | ||
78 | esac | 69 | esac |
79 | done | 70 | done |
80 | fi | 71 | } |
72 | |||
73 | # this function is duplicated in preinst, postinst and d-i | ||
74 | supported_kernel() { | ||
75 | case "$(uname -r)" in | ||
76 | 2.[012345].*|2.6.[0-9]|2.6.[0-9][!0-9]*) return 1 ;; | ||
77 | 2.6.1[01]|2.6.1[01][!0-9]*) return 1 ;; | ||
78 | esac | ||
79 | return 0 | ||
80 | } | ||
81 | |||
82 | # shell version of /usr/bin/tty | ||
83 | my_tty() { | ||
84 | [ -x /bin/readlink ] || return 0 | ||
85 | [ -e /proc/self/fd/0 ] || return 0 | ||
86 | readlink --silent /proc/self/fd/0 || true | ||
87 | } | ||
88 | |||
89 | warn_if_interactive() { | ||
90 | if [ "$RUNLEVEL" = "S" -a "$PREVLEVEL" = "N" ]; then | ||
91 | return 0 | ||
92 | fi | ||
93 | |||
94 | TTY=$(my_tty) | ||
95 | if [ -z "$TTY" -o "$TTY" = "/dev/console" ]; then | ||
96 | return 0 | ||
97 | fi | ||
98 | |||
99 | printf "\n\n\nIt has been detected that the command\n\n\t$0 $*\n\n" | ||
100 | printf "has been run from an interactive shell.\n" | ||
101 | printf "It will probably not do what you expect, so this script will wait\n" | ||
102 | printf "60 seconds before continuing. Press ^C to stop it.\n" | ||
103 | printf "RUNNING THIS COMMAND IS HIGHLY DISCOURAGED!\n\n\n\n" | ||
104 | sleep 60 | ||
81 | } | 105 | } |
82 | 106 | ||
83 | ############################################################################## | 107 | ############################################################################## |
84 | 108 | ||
85 | if [ "$udev_root" != "/dev" ]; then | 109 | if ! supported_kernel; then |
86 | echo "WARNING: udev_root != /dev" | 110 | echo "udev requires a kernel >= 2.6.12, not started." |
111 | exit 1 | ||
112 | fi | ||
87 | 113 | ||
88 | case "$1" in | 114 | if [ ! -e /proc/filesystems ]; then |
89 | start) | 115 | echo "udev requires a mounted procfs, not started." |
90 | if [ -e "$udev_root/.udev.tdb" ]; then | 116 | exit 1 |
91 | if mountpoint -q /dev/; then | 117 | fi |
92 | echo "FATAL: udev is already active on $udev_root." | 118 | |
93 | exit 1 | 119 | if ! grep -q '[[:space:]]tmpfs$' /proc/filesystems; then |
94 | else | 120 | echo "udev requires tmpfs support, not started." |
95 | echo "WARNING: .udev.tdb already exists on the old $udev_root!" | 121 | exit 1 |
96 | fi | 122 | fi |
97 | fi | ||
98 | mount -n -o size=$ramfs_size,mode=0755 -t ramfs none $udev_root | ||
99 | echo -n "Creating initial device nodes..." | ||
100 | $UDEVSTART | ||
101 | echo "done." | ||
102 | ;; | ||
103 | stop) | ||
104 | start-stop-daemon -K -x /sbin/udevd | ||
105 | echo -n "Unmounting $udev_root..." | ||
106 | # unmounting with -l should never fail | ||
107 | if umount -l $udev_root; then | ||
108 | echo "done." | ||
109 | else | ||
110 | echo "failed." | ||
111 | fi | ||
112 | ;; | ||
113 | restart|force-reload) | ||
114 | $0 stop | ||
115 | $0 start | ||
116 | ;; | ||
117 | *) | ||
118 | echo "Usage: /etc/init.d/udev {start|stop|restart|force-reload}" | ||
119 | exit 1 | ||
120 | ;; | ||
121 | esac | ||
122 | 123 | ||
123 | exit 0 | 124 | if [ ! -d /sys/class/ ]; then |
124 | fi # udev_root != /dev/ | 125 | echo "udev requires a mounted sysfs, not started." |
126 | exit 1 | ||
127 | fi | ||
128 | |||
129 | if [ ! -e /proc/sys/kernel/hotplug ]; then | ||
130 | echo "udev requires hotplug support, not started." | ||
131 | exit 1 | ||
132 | fi | ||
125 | 133 | ||
126 | ############################################################################## | 134 | ############################################################################## |
135 | |||
127 | # When modifying this script, do not forget that between the time that | 136 | # When modifying this script, do not forget that between the time that |
128 | # the new /dev has been mounted and udevstart has been run there will be | 137 | # the new /dev has been mounted and udevstart has been run there will be |
129 | # no /dev/null. This also means that you cannot use the "&" shell command. | 138 | # no /dev/null. This also means that you cannot use the "&" shell command. |
130 | 139 | ||
131 | case "$1" in | 140 | case "$1" in |
132 | start) | 141 | start) |
133 | if [ -e "$udev_root/.udev.tdb" ]; then | 142 | if [ -e "$udev_root/.udevdb" ]; then |
134 | if mountpoint -q /dev/; then | 143 | if mountpoint -q /dev/; then |
135 | echo "FATAL: udev is already active on $udev_root." | 144 | TMPFS_MOUNTED=1 |
136 | exit 1 | ||
137 | else | 145 | else |
138 | echo "WARNING: .udev.tdb already exists on the old $udev_root!" | 146 | echo ".udevdb already exists on the old $udev_root!" |
139 | fi | 147 | fi |
140 | fi | 148 | fi |
141 | unmount_devpts | 149 | warn_if_interactive |
142 | mount_ramfs | 150 | |
143 | ACTION=add | 151 | #echo /sbin/udevsend > /proc/sys/kernel/hotplug |
144 | echo -n "Creating initial device nodes..." | 152 | echo "" > /proc/sys/kernel/hotplug |
145 | $UDEVSTART | 153 | udevsend |
154 | if [ "$UDEV_DISABLED" = "yes" ]; then | ||
155 | echo "udev disabled on the kernel command line, not started." | ||
156 | exit 0 | ||
157 | fi | ||
158 | |||
159 | if [ ! "$TMPFS_MOUNTED" ]; then | ||
160 | unmount_devpts | ||
161 | mount_tmpfs | ||
162 | [ -d /proc/1 ] || mount -n /proc | ||
163 | # if this directory is not present /dev will not be updated by udev | ||
164 | mkdir /dev/.udevdb/ | ||
165 | echo "Creating initial device nodes..." | ||
166 | udevstart | ||
167 | fi | ||
146 | make_extra_nodes | 168 | make_extra_nodes |
147 | echo "done." | ||
148 | # /etc/init.d/mountvirtfs start | ||
149 | ;; | 169 | ;; |
150 | stop) | 170 | stop) |
151 | start-stop-daemon -K -x /sbin/udevd | 171 | warn_if_interactive |
172 | start-stop-daemon --stop --exec /sbin/udevd --quiet | ||
152 | unmount_devpts | 173 | unmount_devpts |
153 | echo -n "Unmounting /dev..." | 174 | if [ -d /dev/.static/dev/ ]; then |
175 | umount -l /dev/.static/dev/ || true | ||
176 | fi | ||
177 | echo "Unmounting /dev..." | ||
154 | # unmounting with -l should never fail | 178 | # unmounting with -l should never fail |
155 | if umount -l /dev; then | 179 | if ! umount -l /dev; then |
156 | echo "done." | 180 | exit 1 |
157 | umount -l /.dev || true | ||
158 | # /etc/init.d/mountvirtfs start | ||
159 | else | ||
160 | echo "failed." | ||
161 | fi | 181 | fi |
162 | ;; | 182 | ;; |
163 | restart|force-reload) | 183 | restart|force-reload) |
164 | start-stop-daemon -K -x /sbin/udevd | 184 | start-stop-daemon --stop --exec /sbin/udevd --quiet |
165 | echo -n "Recreating device nodes..." | 185 | log_begin_msg "Recreating device nodes..." |
166 | ACTION=add | 186 | udevstart |
167 | $UDEVSTART | ||
168 | make_extra_nodes | 187 | make_extra_nodes |
169 | echo "done." | 188 | log_end_msg 0 |
170 | ;; | 189 | ;; |
171 | *) | 190 | *) |
172 | echo "Usage: /etc/init.d/udev {start|stop|restart|force-reload}" | 191 | echo "Usage: /etc/init.d/udev {start|stop|restart|force-reload}" |
@@ -175,4 +194,3 @@ case "$1" in | |||
175 | esac | 194 | esac |
176 | 195 | ||
177 | exit 0 | 196 | exit 0 |
178 | |||
diff --git a/openembedded/packages/udev/files/links.conf b/openembedded/packages/udev/files/links.conf new file mode 100644 index 0000000000..8fff922db6 --- /dev/null +++ b/openembedded/packages/udev/files/links.conf | |||
@@ -0,0 +1,21 @@ | |||
1 | # This file does not exist. Please do not ask the debian maintainer about it. | ||
2 | # You may use it to do strange and wonderful things, at your risk. | ||
3 | |||
4 | L fd /proc/self/fd | ||
5 | L stdin /proc/self/fd/0 | ||
6 | L stdout /proc/self/fd/1 | ||
7 | L stderr /proc/self/fd/2 | ||
8 | L core /proc/kcore | ||
9 | L sndstat /proc/asound/oss/sndstat | ||
10 | L MAKEDEV /sbin/MAKEDEV | ||
11 | |||
12 | D pts | ||
13 | D shm | ||
14 | |||
15 | # Hic sunt leones. | ||
16 | M ppp c 108 0 | ||
17 | D loop | ||
18 | M loop/0 b 7 0 | ||
19 | D net | ||
20 | M net/tun c 10 200 | ||
21 | |||
diff --git a/openembedded/packages/udev/files/local.rules b/openembedded/packages/udev/files/local.rules new file mode 100644 index 0000000000..95b3e10830 --- /dev/null +++ b/openembedded/packages/udev/files/local.rules | |||
@@ -0,0 +1,3 @@ | |||
1 | SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh" | ||
2 | SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh" | ||
3 | |||
diff --git a/openembedded/packages/udev/files/mount.sh b/openembedded/packages/udev/files/mount.sh new file mode 100644 index 0000000000..7e641b08d7 --- /dev/null +++ b/openembedded/packages/udev/files/mount.sh | |||
@@ -0,0 +1,25 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Called from udev | ||
4 | # Attemp to mount any added block devices | ||
5 | # and remove any removed devices | ||
6 | # | ||
7 | |||
8 | MOUNT="/bin/mount" | ||
9 | PMOUNT="/usr/bin/pmount" | ||
10 | UMOUNT="/bin/umount" | ||
11 | |||
12 | if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ]; then | ||
13 | if [ -x "$PMOUNT" ]; then | ||
14 | $PMOUNT $DEVNAME 2> /dev/null | ||
15 | elif [ -x $MOUNT ]; then | ||
16 | $MOUNT $DEVNAME 2> /dev/null | ||
17 | fi | ||
18 | fi | ||
19 | |||
20 | if [ "$ACTION" = "remove" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then | ||
21 | for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " ` | ||
22 | do | ||
23 | $UMOUNT $mnt | ||
24 | done | ||
25 | fi | ||
diff --git a/openembedded/packages/udev/files/noasmlinkage.patch b/openembedded/packages/udev/files/noasmlinkage.patch deleted file mode 100644 index 1694d4d661..0000000000 --- a/openembedded/packages/udev/files/noasmlinkage.patch +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | |||
2 | # | ||
3 | # Patch managed by http://www.holgerschurig.de/patcher.html | ||
4 | # | ||
5 | |||
6 | --- udev-042/udev.c~noasmlinkage | ||
7 | +++ udev-042/udev.c | ||
8 | @@ -60,7 +60,7 @@ | ||
9 | } | ||
10 | #endif | ||
11 | |||
12 | -static void asmlinkage sig_handler(int signum) | ||
13 | +static void sig_handler(int signum) | ||
14 | { | ||
15 | switch (signum) { | ||
16 | case SIGALRM: | ||
17 | --- udev-042/udevd.c~noasmlinkage | ||
18 | +++ udev-042/udevd.c | ||
19 | @@ -308,7 +308,7 @@ | ||
20 | return; | ||
21 | } | ||
22 | |||
23 | -static void asmlinkage sig_handler(int signum) | ||
24 | +static void sig_handler(int signum) | ||
25 | { | ||
26 | int rc; | ||
27 | |||
diff --git a/openembedded/packages/udev/files/permissions.rules b/openembedded/packages/udev/files/permissions.rules new file mode 100644 index 0000000000..86d771276b --- /dev/null +++ b/openembedded/packages/udev/files/permissions.rules | |||
@@ -0,0 +1,81 @@ | |||
1 | # default permissions for block devices | ||
2 | SUBSYSTEM=="block", GROUP="disk" | ||
3 | SUBSYSTEM=="block", SYSFS{removable}=="1", GROUP="floppy" | ||
4 | |||
5 | # IDE devices | ||
6 | BUS=="ide", KERNEL=="hd[a-z]", SYSFS{removable}="1", \ | ||
7 | PROGRAM="/bin/cat /proc/ide/%k/media", RESULT=="cdrom*", GROUP="cdrom" | ||
8 | BUS=="ide", KERNEL=="ht[0-9]*", GROUP="tape" | ||
9 | BUS=="ide", KERNEL=="nht[0-9]*", GROUP="tape" | ||
10 | |||
11 | # SCSI devices | ||
12 | BUS=="scsi", SYSFS{type}=="1", GROUP="tape" | ||
13 | BUS=="scsi", SYSFS{type}=="5", GROUP="cdrom" | ||
14 | BUS=="scsi", SYSFS{type}=="6", GROUP="scanner" | ||
15 | |||
16 | # USB devices | ||
17 | BUS=="usb", KERNEL=="legousbtower*", MODE="0666" | ||
18 | BUS=="usb", KERNEL=="lp[0-9]*", GROUP="lp" | ||
19 | |||
20 | # serial devices | ||
21 | SUBSYSTEM=="tty", GROUP="dialout" | ||
22 | SUBSYSTEM=="capi", GROUP="dialout" | ||
23 | SUBSYSTEM=="slamr", GROUP="dialout" | ||
24 | |||
25 | # vc devices (all members of the tty subsystem) | ||
26 | KERNEL=="ptmx", MODE="0666", GROUP="root" | ||
27 | KERNEL=="console", MODE="0600", GROUP="root" | ||
28 | KERNEL=="tty", MODE="0666", GROUP="root" | ||
29 | KERNEL=="tty[0-9]*", GROUP="root" | ||
30 | KERNEL=="pty*", MODE="0666", GROUP="tty" | ||
31 | |||
32 | # video devices | ||
33 | SUBSYSTEM=="video4linux", GROUP="video" | ||
34 | SUBSYSTEM=="drm", GROUP="video" | ||
35 | SUBSYSTEM=="dvb", GROUP="video" | ||
36 | SUBSYSTEM=="em8300", GROUP="video" | ||
37 | SUBSYSTEM=="graphics", GROUP="video" | ||
38 | SUBSYSTEM=="nvidia", GROUP="video" | ||
39 | |||
40 | # misc devices | ||
41 | KERNEL=="random", MODE="0666" | ||
42 | KERNEL=="urandom", MODE="0444" | ||
43 | KERNEL=="mem", MODE="0640", GROUP="kmem" | ||
44 | KERNEL=="kmem", MODE="0640", GROUP="kmem" | ||
45 | KERNEL=="port", MODE="0640", GROUP="kmem" | ||
46 | KERNEL=="full", MODE="0666" | ||
47 | KERNEL=="null", MODE="0666" | ||
48 | KERNEL=="zero", MODE="0666" | ||
49 | KERNEL=="inotify", MODE="0666" | ||
50 | KERNEL=="sgi_fetchop", MODE="0666" | ||
51 | KERNEL=="sonypi", MODE="0666" | ||
52 | KERNEL=="agpgart", GROUP="video" | ||
53 | KERNEL=="nvram", GROUP="nvram" | ||
54 | KERNEL=="rtc", MODE="0660", GROUP="audio" | ||
55 | |||
56 | KERNEL=="cdemu[0-9]*", GROUP="cdrom" | ||
57 | KERNEL=="pktcdvd[0-9]*", GROUP="cdrom" | ||
58 | KERNEL=="pktcdvd", MODE="0644" | ||
59 | |||
60 | # printers and parallel devices | ||
61 | SUBSYSTEM=="printer", GROUP="lp" | ||
62 | SUBSYSTEM=="ppdev", GROUP="lp" | ||
63 | KERNEL=="pt[0-9]*", GROUP="tape" | ||
64 | KERNEL=="pht[0-9]*", GROUP="tape" | ||
65 | |||
66 | # sound devices | ||
67 | SUBSYSTEM=="sound", GROUP="audio" | ||
68 | |||
69 | # ieee1394 devices | ||
70 | KERNEL=="raw1394", GROUP="disk" | ||
71 | KERNEL=="dv1394*", GROUP="video" | ||
72 | KERNEL=="video1394*", GROUP="video" | ||
73 | |||
74 | # input devices | ||
75 | KERNEL=="event[0-9]*", MODE="0664" | ||
76 | KERNEL=="js[0-9]*", MODE="0664" | ||
77 | |||
78 | # AOE character devices | ||
79 | SUBSYSTEM=="aoe", MODE="0220", GROUP="disk" | ||
80 | SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440" | ||
81 | |||
diff --git a/openembedded/packages/udev/files/udev.rules b/openembedded/packages/udev/files/udev.rules new file mode 100644 index 0000000000..4fc82ba250 --- /dev/null +++ b/openembedded/packages/udev/files/udev.rules | |||
@@ -0,0 +1,96 @@ | |||
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 | ||
17 | BUS=="scsi", KERNEL=="sr[0-9]*", NAME="scd%n", SYMLINK+="sr%n" | ||
18 | |||
19 | # USB devices | ||
20 | BUS=="usb", KERNEL=="auer[0-9]*", NAME="usb/%k" | ||
21 | BUS=="usb", KERNEL=="cpad[0-9]*", NAME="usb/%k" | ||
22 | BUS=="usb", KERNEL=="dabusb*", NAME="usb/%k" | ||
23 | BUS=="usb", KERNEL=="hiddev*", NAME="usb/%k" | ||
24 | BUS=="usb", KERNEL=="legousbtower*", NAME="usb/%k" | ||
25 | BUS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k" | ||
26 | BUS=="usb", KERNEL=="ttyUSB*", SYSFS{product}=="Palm Handheld*", \ | ||
27 | SYMLINK+="pilot" | ||
28 | |||
29 | # usbfs-like devices | ||
30 | SUBSYSTEM=="usb_device", \ | ||
31 | PROGRAM="/bin/sh -c 'X=%k X=$${X#usbdev} B=$${X%%%%.*} D=$${X#*.}; echo bus/usb/$$B/$$D'", SYMLINK+="%c" | ||
32 | |||
33 | # serial devices | ||
34 | KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20" | ||
35 | KERNEL=="capi[0-9]*", NAME="capi/%n" | ||
36 | |||
37 | # video devices | ||
38 | KERNEL=="card[0-9]*", NAME="dri/%k" | ||
39 | |||
40 | # misc devices | ||
41 | KERNEL=="hw_random", NAME="hwrng" | ||
42 | KERNEL=="tun", NAME="net/%k" | ||
43 | |||
44 | KERNEL=="cdemu[0-9]*", NAME="cdemu/%n" | ||
45 | KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%n" | ||
46 | KERNEL=="pktcdvd", NAME="pktcdvd/control" | ||
47 | |||
48 | KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid" | ||
49 | KERNEL=="msr[0-9]*", NAME="cpu/%n/msr" | ||
50 | KERNEL=="microcode", NAME="cpu/microcode" | ||
51 | |||
52 | KERNEL=="umad*", NAME="infiniband/%k" | ||
53 | KERNEL=="issm*", NAME="infiniband/%k" | ||
54 | KERNEL=="uverbs*", NAME="infiniband/%k" | ||
55 | KERNEL=="ucm", NAME="infiniband/%k" | ||
56 | |||
57 | # ALSA devices | ||
58 | KERNEL=="controlC[0-9]*", NAME="snd/%k" | ||
59 | KERNEL=="hwC[D0-9]*", NAME="snd/%k" | ||
60 | KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k" | ||
61 | KERNEL=="midiC[D0-9]*", NAME="snd/%k" | ||
62 | KERNEL=="timer", NAME="snd/%k" | ||
63 | KERNEL=="seq", NAME="snd/%k" | ||
64 | |||
65 | # ieee1394 devices | ||
66 | KERNEL=="dv1394*", NAME="dv1394/%n" | ||
67 | KERNEL=="video1394*", NAME="video1394/%n" | ||
68 | |||
69 | # input devices | ||
70 | KERNEL=="mice", NAME="input/%k" | ||
71 | KERNEL=="mouse[0-9]*", NAME="input/%k" | ||
72 | KERNEL=="event[0-9]*", NAME="input/%k" | ||
73 | KERNEL=="js[0-9]*", NAME="input/%k" | ||
74 | KERNEL=="ts[0-9]*", NAME="input/%k" | ||
75 | KERNEL=="uinput", NAME="input/%k" | ||
76 | |||
77 | # Zaptel | ||
78 | KERNEL=="zapctl", NAME="zap/ctl" | ||
79 | KERNEL=="zaptimer", NAME="zap/timer" | ||
80 | KERNEL=="zapchannel", NAME="zap/channel" | ||
81 | KERNEL=="zappseudo", NAME="zap/pseudo" | ||
82 | KERNEL=="zap[0-9]*", NAME="zap/%n" | ||
83 | |||
84 | # AOE character devices | ||
85 | SUBSYSTEM=="aoe", KERNEL=="discover", NAME="etherd/%k" | ||
86 | SUBSYSTEM=="aoe", KERNEL=="err", NAME="etherd/%k" | ||
87 | SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k" | ||
88 | |||
89 | # device mapper creates its own device nodes, so ignore these | ||
90 | KERNEL=="dm-[0-9]*", OPTIONS+="ignore_device" | ||
91 | KERNEL=="device-mapper", NAME="mapper/control" | ||
92 | |||
93 | KERNEL="rfcomm[0-9]*", NAME="%k", GROUP="users", MODE="0660" | ||
94 | |||
95 | # Firmware Helper | ||
96 | ACTION=="add", SUBSYSTEM=="firmware", RUN+="/sbin/firmware_helper" | ||
diff --git a/openembedded/packages/udev/udev-065/fix-alignment.patch b/openembedded/packages/udev/udev-065/fix-alignment.patch deleted file mode 100644 index 8c7b8b5ac5..0000000000 --- a/openembedded/packages/udev/udev-065/fix-alignment.patch +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | diff --git a/udev_rules_parse.c b/udev_rules_parse.c | ||
2 | --- a/udev_rules_parse.c | ||
3 | +++ b/udev_rules_parse.c | ||
4 | @@ -241,6 +241,7 @@ static int add_to_rules(struct udev_rule | ||
5 | int valid; | ||
6 | char *linepos; | ||
7 | char *attr; | ||
8 | + size_t padding; | ||
9 | int retval; | ||
10 | |||
11 | /* get all the keys */ | ||
12 | @@ -506,6 +507,11 @@ static int add_to_rules(struct udev_rule | ||
13 | |||
14 | /* grow buffer and add rule */ | ||
15 | rule_size = sizeof(struct udev_rule) + rule->bufsize; | ||
16 | + padding = (sizeof(size_t) - rule_size % sizeof(size_t)) % sizeof(size_t); | ||
17 | + dbg("add %zi padding bytes", padding); | ||
18 | + rule_size += padding; | ||
19 | + rule->bufsize += padding; | ||
20 | + | ||
21 | rules->buf = realloc(rules->buf, rules->bufsize + rule_size); | ||
22 | if (!rules->buf) { | ||
23 | err("realloc failed"); | ||
24 | |||
diff --git a/openembedded/packages/udev/udev-065/tty-symlinks.patch b/openembedded/packages/udev/udev-065/tty-symlinks.patch deleted file mode 100644 index 6a458de64c..0000000000 --- a/openembedded/packages/udev/udev-065/tty-symlinks.patch +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | --- udev-063/etc/udev/udev.rules.devfs.orig 2005-07-27 19:55:51 +0200 | ||
2 | +++ udev-063/etc/udev/udev.rules.devfs 2005-07-27 19:56:49 +0200 | ||
3 | @@ -103,3 +103,8 @@ | ||
4 | |||
5 | # raw devices | ||
6 | KERNEL="raw[0-9]*", NAME="raw/%k" | ||
7 | + | ||
8 | +# tty devices | ||
9 | +KERNEL=="tty[0-9]*", SYMLINK="%k" | ||
10 | +KERNEL=="ttyS[0-9]*", SYMLINK="%k" | ||
11 | + | ||
diff --git a/openembedded/packages/udev/udev-065/flags.patch b/openembedded/packages/udev/udev-070/flags.patch index d95daa51e2..bd04041f78 100644 --- a/openembedded/packages/udev/udev-065/flags.patch +++ b/openembedded/packages/udev/udev-070/flags.patch | |||
@@ -1,11 +1,6 @@ | |||
1 | 1 | --- udev-070/Makefile~flags 2005-09-15 01:19:07 +0200 | |
2 | # | 2 | +++ udev-070/Makefile 2005-09-16 11:44:37 +0200 |
3 | # Patch managed by http://www.holgerschurig.de/patcher.html | 3 | @@ -160,36 +160,36 @@ |
4 | # | ||
5 | |||
6 | --- udev-065/Makefile~flags | ||
7 | +++ udev-065/Makefile | ||
8 | @@ -106,11 +106,11 @@ | ||
9 | # check if compiler option is supported | 4 | # check if compiler option is supported |
10 | cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi;} | 5 | cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi;} |
11 | 6 | ||
@@ -21,10 +16,8 @@ | |||
21 | 16 | ||
22 | # use '-Os' optimization if available, else use -O2 | 17 | # use '-Os' optimization if available, else use -O2 |
23 | OPTFLAGS := $(call cc-supports, -Os, -O2) | 18 | OPTFLAGS := $(call cc-supports, -Os, -O2) |
24 | @@ -154,16 +154,16 @@ | ||
25 | |||
26 | SYSFS = $(PWD)/libsysfs/sysfs.a | ||
27 | 19 | ||
20 | # include our local copy of libsysfs | ||
28 | -CFLAGS += -I$(PWD)/libsysfs/sysfs \ | 21 | -CFLAGS += -I$(PWD)/libsysfs/sysfs \ |
29 | +override CFLAGS += -I$(PWD)/libsysfs/sysfs \ | 22 | +override CFLAGS += -I$(PWD)/libsysfs/sysfs \ |
30 | -I$(PWD)/libsysfs | 23 | -I$(PWD)/libsysfs |
@@ -37,16 +30,29 @@ | |||
37 | # if DEBUG is enabled, then we do not strip or optimize | 30 | # if DEBUG is enabled, then we do not strip or optimize |
38 | ifeq ($(strip $(DEBUG)),true) | 31 | ifeq ($(strip $(DEBUG)),true) |
39 | - CFLAGS += -O1 -g -DDEBUG | 32 | - CFLAGS += -O1 -g -DDEBUG |
40 | + override CFLAGS += -DDEBUG | 33 | + override CFLAGS += -O1 -g -DDEBUG |
41 | LDFLAGS += -Wl | 34 | LDFLAGS += -Wl |
42 | STRIPCMD = /bin/true -Since_we_are_debugging | 35 | STRIPCMD = /bin/true -Since_we_are_debugging |
43 | else | 36 | else |
44 | @@ -180,18 +180,18 @@ | 37 | - CFLAGS += $(OPTFLAGS) -fomit-frame-pointer |
38 | + override CFLAGS += $(OPTFLAGS) -fomit-frame-pointer | ||
39 | LDFLAGS += -s -Wl | ||
40 | STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment | ||
41 | endif | ||
42 | |||
43 | ifeq ($(strip $(USE_GCOV)),true) | ||
44 | - CFLAGS += -fprofile-arcs -ftest-coverage | ||
45 | + override CFLAGS += -fprofile-arcs -ftest-coverage | ||
46 | LDFLAGS = -fprofile-arcs | ||
47 | endif | ||
48 | |||
49 | @@ -200,18 +200,18 @@ | ||
45 | CC = $(KLCC) | 50 | CC = $(KLCC) |
46 | LD = $(KLCC) | 51 | LD = $(KLCC) |
47 | else | 52 | else |
48 | - CFLAGS += -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations | 53 | - CFLAGS += -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations |
49 | + override CFLAGS += -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations | 54 | + override CFLAGS += -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations |
55 | LDFLAGS += -Wl,-warn-common | ||
50 | endif | 56 | endif |
51 | 57 | ||
52 | ifeq ($(strip $(USE_SELINUX)),true) | 58 | ifeq ($(strip $(USE_SELINUX)),true) |
@@ -58,9 +64,7 @@ | |||
58 | 64 | ||
59 | ifeq ($(strip $(USE_STATIC)),true) | 65 | ifeq ($(strip $(USE_STATIC)),true) |
60 | - CFLAGS += -DUSE_STATIC | 66 | - CFLAGS += -DUSE_STATIC |
61 | - LDFLAGS += -static | ||
62 | + override CFLAGS += -DUSE_STATIC | 67 | + override CFLAGS += -DUSE_STATIC |
63 | + override LDFLAGS += -static | 68 | LDFLAGS += -static |
64 | endif | 69 | endif |
65 | 70 | ||
66 | ifeq ($(strip $(V)),false) | ||
diff --git a/openembedded/packages/udev/udev-065/noasmlinkage.patch b/openembedded/packages/udev/udev-070/noasmlinkage.patch index 0d8e854c0e..0d8e854c0e 100644 --- a/openembedded/packages/udev/udev-065/noasmlinkage.patch +++ b/openembedded/packages/udev/udev-070/noasmlinkage.patch | |||
diff --git a/openembedded/packages/udev/udev-070/tty-symlinks.patch b/openembedded/packages/udev/udev-070/tty-symlinks.patch new file mode 100644 index 0000000000..28bdf92af8 --- /dev/null +++ b/openembedded/packages/udev/udev-070/tty-symlinks.patch | |||
@@ -0,0 +1,13 @@ | |||
1 | --- udev-068/etc/udev/udev-devfs.rules.orig 2005-08-22 20:22:18.000000000 +0200 | ||
2 | +++ udev-068/etc/udev/udev-devfs.rules 2005-08-22 20:22:44.000000000 +0200 | ||
3 | @@ -14,8 +14,8 @@ | ||
4 | KERNEL="fd[0-9]*", NAME="floppy/%n" | ||
5 | |||
6 | # tty devices | ||
7 | -KERNEL="tty[0-9]*", NAME="vc/%n" | ||
8 | -KERNEL="ttyS[0-9]*", NAME="tts/%n" | ||
9 | +KERNEL="tty[0-9]*", NAME="vc/%n", SYMLINK="%k" | ||
10 | +KERNEL="ttyS[0-9]*", NAME="tts/%n", SYMLINK="%k" | ||
11 | KERNEL="ttyUSB[0-9]*", NAME="tts/USB%n" | ||
12 | |||
13 | # vc devices | ||
diff --git a/openembedded/packages/udev/udev.inc b/openembedded/packages/udev/udev.inc index 0b51df4797..9ab17e87f4 100644 --- a/openembedded/packages/udev/udev.inc +++ b/openembedded/packages/udev/udev.inc | |||
@@ -2,6 +2,14 @@ DESCRIPTION = "udev is a program which dynamically creates and removes device no | |||
2 | /dev/. It responds to /sbin/hotplug device events and requires a 2.6 kernel." | 2 | /dev/. It responds to /sbin/hotplug device events and requires a 2.6 kernel." |
3 | LICENSE = "GPL" | 3 | LICENSE = "GPL" |
4 | 4 | ||
5 | SRC_URI += " \ | ||
6 | file://udev.rules \ | ||
7 | file://links.conf \ | ||
8 | file://permissions.rules \ | ||
9 | file://mount.sh \ | ||
10 | file://local.rules \ | ||
11 | file://init" | ||
12 | |||
5 | UDEV_DEVFS_RULES ?= "0" | 13 | UDEV_DEVFS_RULES ?= "0" |
6 | 14 | ||
7 | PACKAGES =+ "udev-utils" | 15 | PACKAGES =+ "udev-utils" |
@@ -34,9 +42,17 @@ do_install () { | |||
34 | oe_runmake 'DESTDIR=${D}' INSTALL=install install | 42 | oe_runmake 'DESTDIR=${D}' INSTALL=install install |
35 | install -d ${D}${sysconfdir}/init.d | 43 | install -d ${D}${sysconfdir}/init.d |
36 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev | 44 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev |
45 | |||
46 | install -d ${D}${sysconfdir}/udev/rules.d/ | ||
47 | |||
48 | install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules | ||
49 | install -m 0644 ${WORKDIR}/permissions.rules ${D}${sysconfdir}/udev/rules.d/permissions.rules | ||
50 | install -m 0644 ${WORKDIR}/udev.rules ${D}${sysconfdir}/udev/rules.d/udev.rules | ||
37 | if [ "${UDEV_DEVFS_RULES}" = "1" ]; then | 51 | if [ "${UDEV_DEVFS_RULES}" = "1" ]; then |
38 | install -m 0644 ${S}/etc/udev/udev.rules.devfs ${D}${sysconfdir}/udev/rules.d/50-udev.rules | 52 | install -m 0644 ${S}/etc/udev/udev.rules.devfs ${D}${sysconfdir}/udev/rules.d/50-udev.rules |
39 | fi | 53 | fi |
40 | install -d ${D}${sysconfdir}/udev/rules.d/ | 54 | |
41 | install -m 0644 ${S}/etc/udev/debian/permissions.rules ${D}${sysconfdir}/udev/rules.d/ | 55 | install -d ${D}${sysconfdir}/udev/scripts/ |
56 | |||
57 | install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh | ||
42 | } | 58 | } |
diff --git a/openembedded/packages/udev/udev_065.bb b/openembedded/packages/udev/udev_070.bb index f6a2783136..8b4181b363 100644 --- a/openembedded/packages/udev/udev_065.bb +++ b/openembedded/packages/udev/udev_070.bb | |||
@@ -2,21 +2,16 @@ SRC_URI = "http://kernel.org/pub/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \ | |||
2 | file://tmpfs.patch;patch=1 \ | 2 | file://tmpfs.patch;patch=1 \ |
3 | file://noasmlinkage.patch;patch=1 \ | 3 | file://noasmlinkage.patch;patch=1 \ |
4 | file://flags.patch;patch=1 \ | 4 | file://flags.patch;patch=1 \ |
5 | file://tty-symlinks.patch;patch=1 \ | 5 | file://tty-symlinks.patch;patch=1" |
6 | file://init" | ||
7 | 6 | ||
8 | include udev.inc | 7 | include udev.inc |
9 | 8 | ||
10 | PR = "r0" | 9 | PR = "r2" |
11 | UDEV_EXTRAS = "extras/scsi_id/ extras/volume_id/ extras/run_directory/" | 10 | |
11 | UDEV_EXTRAS = "extras/firmware/ extras/scsi_id/ extras/volume_id/ extras/run_directory/" | ||
12 | 12 | ||
13 | #FIXME UDEV MIGRATION PLAN: | 13 | #FIXME UDEV MIGRATION PLAN: |
14 | #FIXME a) udevd is now a netlink daemon and needs to be started by the init script (ours is way too old) | 14 | #FIXME a) udevd is now a netlink daemon and needs to be started by the init script (ours is way too old) |
15 | #FIXME b) sbin/hotplug should no longer be called by the kernel, i.e. echo "" >/proc/sys/kernel/hotplug | 15 | #FIXME b) sbin/hotplug should no longer be called by the kernel, i.e. echo "" >/proc/sys/kernel/hotplug |
16 | #FIXME done c) until d) happens, udev will emulate hotplugd behaviour (see do_install_append() | 16 | #FIXME done c) until d) happens, udev will emulate hotplugd behaviour (see do_install_append() |
17 | #FIXME d) eventually hotplug should no longer be used at all, all agents shall be converted to udev rules | 17 | #FIXME d) eventually hotplug should no longer be used at all, all agents shall be converted to udev rules |
18 | |||
19 | do_install_append() { | ||
20 | install -m 0755 extras/run_directory/udev_run_hotplugd ${D}${sbindir}/ | ||
21 | echo RUN+="/sbin/udev_run_hotplugd" >>${D}${sysconfdir}/udev/rules.d/50-udev.rules | ||
22 | } | ||