From 567dc7a1b50317426f9591997943c0a714101c0d Mon Sep 17 00:00:00 2001 From: Matthias Schwarzott Date: Mon, 23 Apr 2007 20:18:22 +0000 Subject: [PATCH] Removing variable that was unconditionally added to env of all events, saving lot of space, Bug #173476. Restricting /dev-tmpfs in size, 10M by default. Added persistent links for joysticks. Finally removed /etc/dev.d. Make moving persistent-rules from tmp-storage to /etc more generic. Package-Manager: portage-2.1.2.4 --- sys-fs/udev/ChangeLog | 14 +- sys-fs/udev/Manifest | 41 ++- sys-fs/udev/files/digest-udev-108-r1 | 3 + .../files/udev-108-cleanup-early-rules.diff | 11 + .../files/udev-108-persistent-joystick.diff | 19 ++ sys-fs/udev/files/udev-start-108-r1.sh | 149 +++++++++ sys-fs/udev/files/udev-stop-108-r1.sh | 96 ++++++ sys-fs/udev/files/udev.conf.post_108 | 19 ++ sys-fs/udev/udev-108-r1.ebuild | 303 ++++++++++++++++++ 9 files changed, 647 insertions(+), 8 deletions(-) create mode 100644 sys-fs/udev/files/digest-udev-108-r1 create mode 100644 sys-fs/udev/files/udev-108-cleanup-early-rules.diff create mode 100644 sys-fs/udev/files/udev-108-persistent-joystick.diff create mode 100644 sys-fs/udev/files/udev-start-108-r1.sh create mode 100755 sys-fs/udev/files/udev-stop-108-r1.sh create mode 100644 sys-fs/udev/files/udev.conf.post_108 create mode 100644 sys-fs/udev/udev-108-r1.ebuild diff --git a/sys-fs/udev/ChangeLog b/sys-fs/udev/ChangeLog index da82987a3daa..ffc0a1e45208 100644 --- a/sys-fs/udev/ChangeLog +++ b/sys-fs/udev/ChangeLog @@ -1,6 +1,18 @@ # ChangeLog for sys-fs/udev # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.294 2007/03/29 07:36:25 zzam Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.295 2007/04/23 20:18:22 zzam Exp $ + +*udev-108-r1 (23 Apr 2007) + + 23 Apr 2007; Matthias Schwarzott + +files/udev-108-cleanup-early-rules.diff, + +files/udev-108-persistent-joystick.diff, +files/udev-start-108-r1.sh, + +files/udev-stop-108-r1.sh, +files/udev.conf.post_108, + +udev-108-r1.ebuild: + Removing variable that was unconditionally added to env of all events, + saving lot of space, Bug #173476. Restricting /dev-tmpfs in size, 10M by + default. Added persistent links for joysticks. Finally removed /etc/dev.d. + Make moving persistent-rules from tmp-storage to /etc more generic. *udev-108 (29 Mar 2007) diff --git a/sys-fs/udev/Manifest b/sys-fs/udev/Manifest index 89f76736e878..c144b69013ed 100644 --- a/sys-fs/udev/Manifest +++ b/sys-fs/udev/Manifest @@ -113,6 +113,14 @@ AUX udev-107-usbcd-by-id.patch 412 RMD160 64a0f6993914c5d5b22e16d2d1e450357e965e MD5 821153b2aba1250766fa3c9530b85978 files/udev-107-usbcd-by-id.patch 412 RMD160 64a0f6993914c5d5b22e16d2d1e450357e965edf files/udev-107-usbcd-by-id.patch 412 SHA256 50a490ac1dcfd65a220e03513d7af4856ef03c4cb7c4137e1b2bb60ee858ece2 files/udev-107-usbcd-by-id.patch 412 +AUX udev-108-cleanup-early-rules.diff 631 RMD160 3e790eb31578237ad3b0f13d8665cc14fb5caef6 SHA1 4e3ac697b023ad19ea89618ae67a222bb72c3e8b SHA256 4061cbc8ada6e3f4407034d2534369d06b969a5ff311d73501845f22496d8be2 +MD5 fe91c8971d73bd75ba353817f3d48141 files/udev-108-cleanup-early-rules.diff 631 +RMD160 3e790eb31578237ad3b0f13d8665cc14fb5caef6 files/udev-108-cleanup-early-rules.diff 631 +SHA256 4061cbc8ada6e3f4407034d2534369d06b969a5ff311d73501845f22496d8be2 files/udev-108-cleanup-early-rules.diff 631 +AUX udev-108-persistent-joystick.diff 1167 RMD160 8722bddcd3541faf345d76af1e843d506ae18c21 SHA1 e483670c5ed44b05b70cbc8a06fcdaa851902128 SHA256 8533c943449a3b7c7b5f1431975fbfb884ca5a9a48868016134cdb41218a3a23 +MD5 02fc5dc221ea63b655277c7f2a77ce40 files/udev-108-persistent-joystick.diff 1167 +RMD160 8722bddcd3541faf345d76af1e843d506ae18c21 files/udev-108-persistent-joystick.diff 1167 +SHA256 8533c943449a3b7c7b5f1431975fbfb884ca5a9a48868016134cdb41218a3a23 files/udev-108-persistent-joystick.diff 1167 AUX udev-parisc-path_id-again.patch 524 RMD160 d305615a2f5ae0ab6b468400e95ad3332a2bcb38 SHA1 574d12600292d5cd1acb3b1be2bc24d337581a88 SHA256 a1b40d1bf3f8a7e0d6787d310218b44916c79a4f94a39287bc00f8ae058b67ff MD5 2f18f7560f7667fa98179c6084396453 files/udev-parisc-path_id-again.patch 524 RMD160 d305615a2f5ae0ab6b468400e95ad3332a2bcb38 files/udev-parisc-path_id-again.patch 524 @@ -173,6 +181,10 @@ AUX udev-start-107.sh 3820 RMD160 8db20bbf4513384f3af945b7829d26a7412de6fd SHA1 MD5 39a88dfb4bfe504bd943a2e2fca6674e files/udev-start-107.sh 3820 RMD160 8db20bbf4513384f3af945b7829d26a7412de6fd files/udev-start-107.sh 3820 SHA256 2f3ae31ed868dc2e64070354b1f63a5d948223eb99da2361126ebe262b2d1ee8 files/udev-start-107.sh 3820 +AUX udev-start-108-r1.sh 3935 RMD160 f65acd07a4edeb35eeed5468b4b0c30e6c1efc17 SHA1 cd018c0d5e706a705b4c5dffa7712721bace5efe SHA256 16a7969ad8dcebc5893d1f04c0207db0344d24011f9630785518b954c47c06f3 +MD5 f0fde8cc31e129c9eb55e1954f42c288 files/udev-start-108-r1.sh 3935 +RMD160 f65acd07a4edeb35eeed5468b4b0c30e6c1efc17 files/udev-start-108-r1.sh 3935 +SHA256 16a7969ad8dcebc5893d1f04c0207db0344d24011f9630785518b954c47c06f3 files/udev-start-108-r1.sh 3935 AUX udev-start.sh 2460 RMD160 97afa40bab5aed0106e3a3b065ae480ce329e11c SHA1 2558e3265c9bed383198e2f263e10016ad6f34a0 SHA256 0527b03ac666dd9e4c94811b10d499f04b3f6f8ae2f03e6460727c1b570d985d MD5 622f085dff7fb6138f3e2c992d569593 files/udev-start.sh 2460 RMD160 97afa40bab5aed0106e3a3b065ae480ce329e11c files/udev-start.sh 2460 @@ -185,6 +197,10 @@ AUX udev-stop-105.sh 2830 RMD160 cd74b761b93afa8c61c13b8f9a9948af164b3376 SHA1 f MD5 4e3b1899da16a3bef03f3f55c6159bc1 files/udev-stop-105.sh 2830 RMD160 cd74b761b93afa8c61c13b8f9a9948af164b3376 files/udev-stop-105.sh 2830 SHA256 9b378e668bfe5d6fc9aff16187ef5e4292cf9b4f14bd35d47f44c36345267765 files/udev-stop-105.sh 2830 +AUX udev-stop-108-r1.sh 2787 RMD160 64d12a04ea9dcaf9f76ce54b284d428fc887735e SHA1 0400c5bc795a6a1220b08ceb6a971260ce930079 SHA256 6a4b1215ea596cb3e787eaa8474309c84302454672d089539fa8fea8e289c63c +MD5 10108b1a0128e67d0939274239a78e9b files/udev-stop-108-r1.sh 2787 +RMD160 64d12a04ea9dcaf9f76ce54b284d428fc887735e files/udev-stop-108-r1.sh 2787 +SHA256 6a4b1215ea596cb3e787eaa8474309c84302454672d089539fa8fea8e289c63c files/udev-stop-108-r1.sh 2787 AUX udev-stop.sh 2158 RMD160 0293fc9cd5de85b17624d38bd2c22a48c9722453 SHA1 6d918052006403d0fe1ab34041e36581cdeddcd4 SHA256 bb4fad16e3b58707565d9bb6652c94d917378dc0c462fd660957e17860313429 MD5 b73dfbd0300c444f047f77914ca1c956 files/udev-stop.sh 2158 RMD160 0293fc9cd5de85b17624d38bd2c22a48c9722453 files/udev-stop.sh 2158 @@ -213,6 +229,10 @@ AUX udev.conf.post_081 681 RMD160 16a7e32f351fa5ca761c32fa387993a3d925d55c SHA1 MD5 a7adc8ae806cee9c077406766658cab2 files/udev.conf.post_081 681 RMD160 16a7e32f351fa5ca761c32fa387993a3d925d55c files/udev.conf.post_081 681 SHA256 db8f66c5c0f87f5ab3566872c6ec5cd5752cb29ff9d7458607ef9a5c4bf7443a files/udev.conf.post_081 681 +AUX udev.conf.post_108 754 RMD160 a4cf25cd25d08bf8b2f7444206077fa87b249fa7 SHA1 bf304d4a2bb61ed72544b6cff48bcf5b1be20a97 SHA256 587d1756e4a63aaccc2f1c71783b332b62056c41f2fb1ed0db6b3ac067238bef +MD5 771a1f3b24fa4287e24da2f4cd5c43a4 files/udev.conf.post_108 754 +RMD160 a4cf25cd25d08bf8b2f7444206077fa87b249fa7 files/udev.conf.post_108 754 +SHA256 587d1756e4a63aaccc2f1c71783b332b62056c41f2fb1ed0db6b3ac067238bef files/udev.conf.post_108 754 AUX udev.hotplug.empty 106 RMD160 0d6fedd5f2fad1a127ee45247f94c1a8c57b9304 SHA1 4a1d6200c0d0ecd9fe5d37a23f4f85157cf3f3b3 SHA256 b527a9f2a5100a4e64de6154f06ee8793bff84a1318e6b9ed427ccae031dd7f0 MD5 77692161d3e1d624773ff10aec89b318 files/udev.hotplug.empty 106 RMD160 0d6fedd5f2fad1a127ee45247f94c1a8c57b9304 files/udev.hotplug.empty 106 @@ -378,14 +398,18 @@ EBUILD udev-107.ebuild 9614 RMD160 745190da2a8e9d32efc865aeeea4dc4c8c34d3ad SHA1 MD5 b78e1c913308e38a4c66bbdc47ce6be2 udev-107.ebuild 9614 RMD160 745190da2a8e9d32efc865aeeea4dc4c8c34d3ad udev-107.ebuild 9614 SHA256 89698652fdc83bd545ed5e67a67a82f2728976f1f637909fa7edcedeafc5849a udev-107.ebuild 9614 +EBUILD udev-108-r1.ebuild 10035 RMD160 7dc68b82c2ad1f09f9836d699cb2f2e06353739f SHA1 c29ffb284049f8cef69ab209011e60f3f3683d11 SHA256 c7344ff51dd9fb9e40553eaf2bf1794c8b69e0634f29baa59ebcbf9a90f96e70 +MD5 82e5fec178e9e239e8d599be32cc9cd0 udev-108-r1.ebuild 10035 +RMD160 7dc68b82c2ad1f09f9836d699cb2f2e06353739f udev-108-r1.ebuild 10035 +SHA256 c7344ff51dd9fb9e40553eaf2bf1794c8b69e0634f29baa59ebcbf9a90f96e70 udev-108-r1.ebuild 10035 EBUILD udev-108.ebuild 9608 RMD160 d7e60ea554e963d2a66aa1cba8796f4458782b3f SHA1 e04f5e242b5be9c1032311eb87fbf87cc8a18ed3 SHA256 3b39e71f420ada07465a7891ffd8a019bfb6db322479265e1a7b5e0924118a1e MD5 821fd4c4b7db717688987e169c936ddf udev-108.ebuild 9608 RMD160 d7e60ea554e963d2a66aa1cba8796f4458782b3f udev-108.ebuild 9608 SHA256 3b39e71f420ada07465a7891ffd8a019bfb6db322479265e1a7b5e0924118a1e udev-108.ebuild 9608 -MISC ChangeLog 56169 RMD160 c2294c867461b9a1c3d445e47d6b973ba4f6c2ed SHA1 58d9fb0225a18aa052e14dc52d02bd68387133ac SHA256 6d52be9ee5bf443005f3f21fab9b427a5e0e8e5a0b95068fd72436ba3eb7f742 -MD5 95c3ce227a64a88d791c0f621bf08664 ChangeLog 56169 -RMD160 c2294c867461b9a1c3d445e47d6b973ba4f6c2ed ChangeLog 56169 -SHA256 6d52be9ee5bf443005f3f21fab9b427a5e0e8e5a0b95068fd72436ba3eb7f742 ChangeLog 56169 +MISC ChangeLog 56743 RMD160 e6a1ad01925f711c4b1e72da17c73207aeb25457 SHA1 60bbea9215be720d306ff42773765b81384fe0be SHA256 a72facce49105a54b16fe86b7a89025f1305470856d475eaa4ce437641974405 +MD5 30571338c61dc79ae52fcff89c20b6a8 ChangeLog 56743 +RMD160 e6a1ad01925f711c4b1e72da17c73207aeb25457 ChangeLog 56743 +SHA256 a72facce49105a54b16fe86b7a89025f1305470856d475eaa4ce437641974405 ChangeLog 56743 MISC metadata.xml 447 RMD160 d1ba09bd6a434b25c718673de9258cc544e090be SHA1 70c43d2863c09958849bfce8c5bb97d406a0662b SHA256 a9881de1424ac71191111bd30c7c1253589673b0cdce13c352204f1499e9d884 MD5 f74bee0505505c00e76da6313db29e49 metadata.xml 447 RMD160 d1ba09bd6a434b25c718673de9258cc544e090be metadata.xml 447 @@ -447,10 +471,13 @@ SHA256 285db05bbcc252c4a94bf3e2040de2b66a7f0757c2b79cae350dc232d9a15976 files/di MD5 afb0581941a81d478429e9bbe0dd3e3c files/digest-udev-108 229 RMD160 8909ec163d6e565d6b80cee19a97e4102374f89a files/digest-udev-108 229 SHA256 ff79035ff80988aa331bbc8d5146584c9462b49ceea58433682c944c28a341c6 files/digest-udev-108 229 +MD5 afb0581941a81d478429e9bbe0dd3e3c files/digest-udev-108-r1 229 +RMD160 8909ec163d6e565d6b80cee19a97e4102374f89a files/digest-udev-108-r1 229 +SHA256 ff79035ff80988aa331bbc8d5146584c9462b49ceea58433682c944c28a341c6 files/digest-udev-108-r1 229 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.3 (GNU/Linux) -iD8DBQFGF7IB8bi6rjpTunYRAghAAJ48tz5eDX2XqMyZI2UBjGbvRmEaQACfVIhy -X2pHnqn+EhMSoHBvXWV3NUo= -=KNt7 +iD8DBQFGLRSYt2vP6XvVdOcRAozaAJ9LWTJkyTNCWlnJsOwcgVje17LehwCfWrco +LhFZUquC3kfQv9tn5wENLT8= +=Oedq -----END PGP SIGNATURE----- diff --git a/sys-fs/udev/files/digest-udev-108-r1 b/sys-fs/udev/files/digest-udev-108-r1 new file mode 100644 index 000000000000..38c2b79089e7 --- /dev/null +++ b/sys-fs/udev/files/digest-udev-108-r1 @@ -0,0 +1,3 @@ +MD5 67935abde67b23e7c6e86e0be77c5e4b udev-108.tar.bz2 187460 +RMD160 cfc3885bdbb1a3611118c8503efe3ffe472b0f2d udev-108.tar.bz2 187460 +SHA256 0956fd6e7388cbb9c3431db302e52f8ee03d7fad8a159359597878058d8632ec udev-108.tar.bz2 187460 diff --git a/sys-fs/udev/files/udev-108-cleanup-early-rules.diff b/sys-fs/udev/files/udev-108-cleanup-early-rules.diff new file mode 100644 index 000000000000..ee6e26883f71 --- /dev/null +++ b/sys-fs/udev/files/udev-108-cleanup-early-rules.diff @@ -0,0 +1,11 @@ +diff -r -ru udev-108-orig/etc/udev/gentoo/05-udev-early.rules udev-108/etc/udev/gentoo/05-udev-early.rules +--- udev-108-orig/etc/udev/gentoo/05-udev-early.rules 2007-04-11 09:32:13.007423206 +0200 ++++ udev-108/etc/udev/gentoo/05-udev-early.rules 2007-04-11 09:32:30.587306470 +0200 +@@ -7,7 +7,3 @@ + ACTION=="add", KERNEL=="[0-9]*:[0-9]*", SUBSYSTEM=="scsi", WAIT_FOR_SYSFS="ioerr_cnt" + ACTION=="add", SUBSYSTEM=="net", WAIT_FOR_SYSFS="address" + ACTION=="add", SUBSYSTEM=="net", ENV{PHYSDEVDRIVER}=="?*", WAIT_FOR_SYSFS="device/driver" +- +-# Set IN_HOTPLUG for compatibility with init-scripts called from udev +-ENV{IN_HOTPLUG}="1" +- diff --git a/sys-fs/udev/files/udev-108-persistent-joystick.diff b/sys-fs/udev/files/udev-108-persistent-joystick.diff new file mode 100644 index 000000000000..091b2e0795b1 --- /dev/null +++ b/sys-fs/udev/files/udev-108-persistent-joystick.diff @@ -0,0 +1,19 @@ +diff --git a/etc/udev/rules.d/60-persistent-input.rules b/etc/udev/rules.d/60-persistent-input.rules +index 623eb7d..503e61e 100644 +--- a/etc/udev/rules.d/60-persistent-input.rules ++++ b/etc/udev/rules.d/60-persistent-input.rules +@@ -18,12 +18,12 @@ ATTRS{modalias}=="input:*-*a[068],*|input:*-*a*,[68],*m*", ATTRS{modalias}!="inp + ENV{ID_CLASS}=="?*", ENV{ID_SERIAL}=="", ENV{ID_SERIAL}="noserial" + + # by-id links +-KERNEL=="mouse*", ENV{ID_BUS}=="?*", ENV{ID_CLASS}=="?*", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_CLASS}" ++KERNEL=="mouse*|js*", ENV{ID_BUS}=="?*", ENV{ID_CLASS}=="?*", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_CLASS}" + KERNEL=="event*", ENV{ID_BUS}=="?*", ENV{ID_CLASS}=="?*", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-$env{ID_CLASS}" + + # by-path + IMPORT{program}="path_id %p" +-ENV{ID_PATH}=="?*", KERNEL=="mouse*", SYMLINK+="input/by-path/$env{ID_PATH}-$env{ID_CLASS}" ++ENV{ID_PATH}=="?*", KERNEL=="mouse*|js*", SYMLINK+="input/by-path/$env{ID_PATH}-$env{ID_CLASS}" + ENV{ID_PATH}=="?*", KERNEL=="event*", SYMLINK+="input/by-path/$env{ID_PATH}-event-$env{ID_CLASS}" + + LABEL="persistent_input_end" diff --git a/sys-fs/udev/files/udev-start-108-r1.sh b/sys-fs/udev/files/udev-start-108-r1.sh new file mode 100644 index 000000000000..677dc722270f --- /dev/null +++ b/sys-fs/udev/files/udev-start-108-r1.sh @@ -0,0 +1,149 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +tmpfs_size="10M" + +[ -e /etc/udev/udev.conf ] && . /etc/udev/udev.conf + +populate_udev() { + # populate /dev with devices already found by the kernel + + # tell modprobe.sh to be verbose to $CONSOLE + echo CONSOLE=${CONSOLE} > /dev/.udev_populate + + if get_bootparam "nocoldplug" ; then + RC_COLDPLUG="no" + ewarn "Skipping udev coldplug as requested in kernel cmdline" + fi + + if [ $(get_KV) -gt $(KV_to_int '2.6.14') ] ; then + ebegin "Populating /dev with existing devices through uevents" + local opts= + [ "${RC_COLDPLUG}" != "yes" ] && opts="--attr-match=dev" + /sbin/udevtrigger ${opts} + eend $? + else + ebegin "Populating /dev with existing devices with udevstart" + /sbin/udevstart + eend $? + fi + + # loop until everything is finished + # there's gotta be a better way... + ebegin "Letting udev process events" + /sbin/udevsettle --timeout=60 + eend $? + + rm -f /dev/.udev_populate + return 0 +} + +seed_dev() { + # Seed /dev with some things that we know we need + ebegin "Seeding /dev with needed nodes" + + # creating /dev/console and /dev/tty1 to be able to write + # to $CONSOLE with/without bootsplash before udevd creates it + [ ! -c /dev/console ] && mknod /dev/console c 5 1 + [ ! -c /dev/tty1 ] && mknod /dev/tty1 c 4 1 + + # udevd will dup its stdin/stdout/stderr to /dev/null + # and we do not want a file which gets buffered in ram + [ ! -c /dev/null ] && mknod /dev/null c 1 3 + + # copy over any persistant things + if [ -d /lib/udev/devices ] ; then + cp --preserve=all --recursive --update /lib/udev/devices/* /dev 2>/dev/null + fi + + # Not provided by sysfs but needed + ln -snf /proc/self/fd /dev/fd + ln -snf fd/0 /dev/stdin + ln -snf fd/1 /dev/stdout + ln -snf fd/2 /dev/stderr + [ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core + + # Create problematic directories + mkdir -p /dev/pts /dev/shm + eend 0 +} + +unpack_device_tarball() { + # Actually get udev rolling + if [ "${RC_DEVICE_TARBALL}" = "yes" ] && \ + [ -s /lib/udev/state/devices.tar.bz2 ] ; then + ebegin "Populating /dev with saved device nodes" + try tar -jxpf /lib/udev/state/devices.tar.bz2 -C /dev + eend $? + fi +} + +main() { + # Setup temporary storage for /dev + ebegin "Mounting /dev for udev" + if [ "${RC_USE_FSTAB}" = "yes" ] ; then + mntcmd=$(get_mount_fstab /dev) + else + unset mntcmd + fi + if [ -n "${mntcmd}" ] ; then + try mount -n ${mntcmd} + else + mntopts="exec,nosuid,mode=0755,size=${tmpfs_size}" + if grep -Eq "[[:space:]]+tmpfs$" /proc/filesystems ; then + mntcmd="tmpfs" + else + mntcmd="ramfs" + fi + # many video drivers require exec access in /dev #92921 + try mount -n -t "${mntcmd}" -o "${mntopts}" udev /dev + fi + eend $? + + # Create a file so that our rc system knows it's still in sysinit. + # Existance means init scripts will not directly run. + # rc will remove the file when done with sysinit. + touch /dev/.rcsysinit + + # Selinux lovin; /selinux should be mounted by selinux-patched init + if [ -x /sbin/restorecon ] && [ -c /selinux/null ] ; then + restorecon /dev > /selinux/null + fi + + unpack_device_tarball + seed_dev + + # Setup hotplugging (if possible) + if [ -e /proc/sys/kernel/hotplug ] ; then + ebegin "Setting up proper hotplug agent" + eindent + if [ $(get_KV) -gt $(KV_to_int '2.6.14') ] ; then + einfo "Using netlink for hotplug events..." + echo "" > /proc/sys/kernel/hotplug + else + einfo "Setting /sbin/udevsend as hotplug agent ..." + echo "/sbin/udevsend" > /proc/sys/kernel/hotplug + fi + eoutdent + eend 0 + fi + + ebegin "Starting udevd" + /sbin/udevd --daemon + eend $? + + populate_udev + + # Create nodes that udev can't + ebegin "Finalizing udev configuration" + [ -x /sbin/lvm ] && \ + /sbin/lvm vgscan -P --mknodes --ignorelockingfailure &>/dev/null + # Running evms_activate on a LiveCD causes lots of headaches + [ -z "${CDBOOT}" ] && [ -x /sbin/evms_activate ] && \ + /sbin/evms_activate -q &>/dev/null + eend 0 +} + +main + +# vim:ts=4 diff --git a/sys-fs/udev/files/udev-stop-108-r1.sh b/sys-fs/udev/files/udev-stop-108-r1.sh new file mode 100755 index 000000000000..a38baf133146 --- /dev/null +++ b/sys-fs/udev/files/udev-stop-108-r1.sh @@ -0,0 +1,96 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# store persistent-rules that got created while booting +# when / was still read-only +store_persistent_rules() { + local file dest + + for file in /dev/.udev/tmp-rules--*; do + dest=${file##*tmp-rules--} + [ "$dest" = '*' ] && break + type=${dest##70-persistent-} + type=${type%%.rules} + einfo "Saving udev persistent ${type} rules to /etc/udev/rules.d" + cat "$file" >> /etc/udev/rules.d/"$dest" + rm -f "$file" + done +} + +create_device_tarball() { + if [ -e /dev/.devfsd ] || [ ! -e /dev/.udev ] || [ ! -z "${CDBOOT}" ] || \ + [ "${RC_DEVICE_TARBALL}" != "yes" ] || \ + ! touch /lib/udev/state/devices.tar.bz2 2>/dev/null + then + return 0 + fi + + ebegin "Saving device nodes" + # Handle our temp files + save_tmp_base=/tmp/udev.savedevices."$$" + devices_udev="${save_tmp_base}"/devices.udev + devices_real="${save_tmp_base}"/devices.real + devices_totar="${save_tmp_base}"/devices.totar + device_tarball="${save_tmp_base}"/devices + + rm -rf "${save_tmp_base}" + mkdir "${save_tmp_base}" + touch "${devices_udev}" "${devices_real}" \ + "${devices_totar}" "${device_tarball}" + + if [ -f ${devices_udev} ] && [ -f ${devices_real} ] && \ + [ -f ${devices_totar} ] && [ -f ${device_tarball} ] ; then + cd /dev + # Find all devices + find . -xdev -type b -or -type c -or -type l | cut -d/ -f2- > \ + "${devices_real}" + # Figure out what udev created + udevinfo=$(udevinfo --export-db) + + # This basically strips 'S:' and 'N:' from the db output, and then + # print all the nodes/symlinks udev created ... + echo "${udevinfo}" | gawk ' + /^(N|S):.+/ { + sub(/^(N|S):/, "") + split($0, nodes) + for (x in nodes) + print nodes[x] + }' > "${devices_udev}" + # These ones we also do not want in there + for x in MAKEDEV core fd initctl pts shm stderr stdin stdout; do + echo "${x}" >> "${devices_udev}" + done + if [ -d /lib/udev/devices ]; then + cd /lib/udev/devices + find . -xdev -type b -or -type c -or -type l | cut -d/ -f2- >> "${devices_udev}" + fi + cd /dev + fgrep -x -v -f "${devices_udev}" < "${devices_real}" | \ + grep -v ^\\.udev > "${devices_totar}" + + # Now only tarball those not created by udev if we have any + if [ -s ${devices_totar} ]; then + # we dont want to descend into mounted filesystems (e.g. devpts) + # looking up username may involve NIS/network, and net may be down + tar --one-file-system --numeric-owner -jcpf "${device_tarball}" -T "${devices_totar}" + mv -f "${device_tarball}" /lib/udev/state/devices.tar.bz2 + else + rm -f /lib/udev/state/devices.tar.bz2 + fi + eend 0 + else + eend 1 "Could not create temporary files!" + fi + + rm -rf "${save_tmp_base}" +} + +main() { + store_persistent_rules + create_device_tarball +} + +main + + +# vim:ts=4 diff --git a/sys-fs/udev/files/udev.conf.post_108 b/sys-fs/udev/files/udev.conf.post_108 new file mode 100644 index 000000000000..7d4f87a57afd --- /dev/null +++ b/sys-fs/udev/files/udev.conf.post_108 @@ -0,0 +1,19 @@ +# /etc/udev/udev.conf: main config file for udev +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/files/udev.conf.post_108,v 1.1 2007/04/23 20:18:22 zzam Exp $ +# +# This file can be used to override some of udev's default values. +# See the udev man page for more details about these values. + +# udev_root - where in the filesystem to place the device nodes +udev_root="/dev/" + +# udev_rules - The name and location of the udev rules file +udev_rules="/etc/udev/rules.d/" + +# The initial syslog(3) priority: "err", "info", "debug" or its +# numerical equivalent. For runtime debugging, the daemons internal +# state can be changed with: "udevcontrol log_priority=". +udev_log="err" + +# The maximum size reserved for the tmpfs mounted on /dev +tmpfs_size="10M" diff --git a/sys-fs/udev/udev-108-r1.ebuild b/sys-fs/udev/udev-108-r1.ebuild new file mode 100644 index 000000000000..bf0f9799adc8 --- /dev/null +++ b/sys-fs/udev/udev-108-r1.ebuild @@ -0,0 +1,303 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-108-r1.ebuild,v 1.1 2007/04/23 20:18:22 zzam Exp $ + +inherit eutils flag-o-matic multilib toolchain-funcs + +DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" +HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" +SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" +IUSE="selinux" + +DEPEND="selinux? ( sys-libs/libselinux )" +RDEPEND="!sys-apps/coldplug" +RDEPEND="${DEPEND} ${RDEPEND} + >=sys-apps/baselayout-1.12.5" +# We need the lib/rcscripts/addon support +PROVIDE="virtual/dev-manager" + +src_unpack() { + unpack ${A} + + cd "${S}" + + # patches go here... + #epatch ${FILESDIR}/${P}-udev_volume_id.patch + epatch ${FILESDIR}/${PN}-104-peristent-net-disable-xen.patch + epatch ${FILESDIR}/${PN}-108-cleanup-early-rules.diff + epatch ${FILESDIR}/${PN}-108-persistent-joystick.diff + + cd "${S}/etc/udev/gentoo" + mv udev.rules 50-udev.rules + cd "${S}" + + # No need to clutter the logs ... + sed -ie '/^DEBUG/ c\DEBUG = false' Makefile + # Do not use optimization flags from the package + sed -ie 's|$(OPTIMIZATION)||g' Makefile + + # Make sure there is no sudden changes to udev.rules.gentoo + # (more for my own needs than anything else ...) + MD5=`md5sum < "${S}/etc/udev/gentoo/50-udev.rules"` + MD5=${MD5/ -/} + if [ "${MD5}" != "db0c266c3f407b6e4d1959b31f753e9a" ] + then + echo + eerror "gentoo/udev.rules has been updated, please validate!" + die "gentoo/udev.rules has been updated, please validate!" + fi +} + +src_compile() { + filter-flags -fprefetch-loop-arrays + local myconf= + local extras="extras/ata_id \ + extras/cdrom_id \ + extras/edd_id \ + extras/firmware \ + extras/floppy \ + extras/path_id \ + extras/scsi_id \ + extras/usb_id \ + extras/volume_id \ + extras/rule_generator" + + use selinux && myconf="${myconf} USE_SELINUX=true" + + # Not everyone has full $CHOST-{ld,ar,etc...} yet + local mycross="" + type -p ${CHOST}-ar && mycross=${CHOST}- + + echo "get_libdir = $(get_libdir)" + # Do not work with emake + make \ + EXTRAS="${extras}" \ + udevdir="/dev/" \ + CROSS_COMPILE=${mycross} \ + ${myconf} || die +} + +src_install() { + # we install everything by "hand" and don't rely on the udev Makefile to do + # it for us (why? it's easier that way...) + dobin udevinfo || die "Required binary not installed properly" + dobin udevtest || die "Required binary not installed properly" + dobin udevmonitor || die "Required binary not installed properly" + into / + dosbin udevd || die "Required binary not installed properly" + dosbin udevstart || die "Required binary not installed properly" + dosbin udevtrigger || die "Required binary not installed properly" + dosbin udevcontrol || die "Required binary not installed properly" + dosbin udevsettle || die "Required binary not installed properly" + + # Helpers + exeinto /lib/udev + doexe extras/ata_id/ata_id || die "Required helper not installed properly" + doexe extras/volume_id/vol_id || die "Required helper not installed properly" + doexe extras/scsi_id/scsi_id || die "Required helper not installed properly" + doexe extras/usb_id/usb_id || die "Required helper not installed properly" + doexe extras/path_id/path_id || die "Required helper not installed properly" + doexe extras/cdrom_id/cdrom_id || die "Required helper not installed properly" + doexe extras/edd_id/edd_id || die "Required helper not installed properly" + doexe extras/rule_generator/write_cd_rules || die "Required helper not installed properly" + doexe extras/rule_generator/write_net_rules || die "Required helper not installed properly" + doexe extras/rule_generator/rule_generator.functions || die "Required helper not installed properly" + keepdir /lib/udev/state + keepdir /lib/udev/devices + + # create symlinks for these utilities to /sbin + # where multipath-tools expect them to be (Bug #168588) + dosym ../lib/udev/vol_id /sbin/vol_id + dosym ../lib/udev/scsi_id /sbin/scsi_id + + # vol_id library (needed by mount and HAL) + dolib extras/volume_id/lib/*.a extras/volume_id/lib/*.so* + # move the .a files to /usr/lib + dodir /usr/$(get_libdir) + mv -f "${D}"/$(get_libdir)/*.a "${D}"/usr/$(get_libdir)/ + + # handle static linking bug #4411 + gen_usr_ldscript libvolume_id.so + + # save pkgconfig info + insinto /usr/$(get_libdir)/pkgconfig + doins extras/volume_id/lib/*.pc + + #exeinto /etc/udev/scripts + exeinto /lib/udev + #doexe extras/ide-devfs.sh + #doexe extras/scsi-devfs.sh + #doexe extras/raid-devfs.sh + doexe extras/floppy/create_floppy_devices || die "Required binary not installed properly" + doexe extras/firmware/firmware.sh || die "Required binary not installed properly" + newexe ${FILESDIR}/net-104-r10.sh net.sh || die "Required binary not installed properly" + newexe ${FILESDIR}/modprobe-105.sh modprobe.sh || die "Required binary not installed properly" + doexe extras/eventrecorder.sh || die "Required binary not installed properly" + + # Our udev config file + insinto /etc/udev + newins ${FILESDIR}/udev.conf.post_108 udev.conf + + # Our rules files + insinto /etc/udev/rules.d/ + doins etc/udev/gentoo/??-*.rules + #newins ${FILESDIR}/udev.rules-107-r1 50-udev.rules + #newins ${FILESDIR}/05-udev-early.rules-106-r5 05-udev-early.rules + #doins ${FILESDIR}/95-udev-late.rules + # Special rules for device-mapper + #newins ${FILESDIR}/64-device-mapper.rules-107-r1 64-device-mapper.rules + # Use upstream's persistent rules for devices + doins etc/udev/rules.d/60-*.rules + doins extras/rule_generator/75-*.rules || die "rules not installed properly" + + # scsi_id configuration + insinto /etc + doins extras/scsi_id/scsi_id.config + + # all of the man pages + doman *.7 + doman *.8 + doman extras/ata_id/ata_id.8 + doman extras/edd_id/edd_id.8 + doman extras/scsi_id/scsi_id.8 + doman extras/volume_id/vol_id.8 + doman extras/cdrom_id/cdrom_id.8 + # create a extra symlink for udevcontrol + dosym udevd.8 /usr/share/man/man8/udevcontrol.8 + + # our udev hooks into the rc system + insinto /$(get_libdir)/rcscripts/addons + newins "${FILESDIR}"/udev-start-108-r1.sh udev-start.sh + newins "${FILESDIR}"/udev-stop-108-r1.sh udev-stop.sh + + # needed to compile latest Hal + insinto /usr/include + doins extras/volume_id/lib/libvolume_id.h + + dodoc ChangeLog FAQ README TODO RELEASE-NOTES + dodoc docs/{overview,udev_vs_devfs} + dodoc docs/writing_udev_rules/* + + newdoc extras/volume_id/README README_volume_id + + insinto /etc/modprobe.d + doins ${FILESDIR}/blacklist ${FILESDIR}/pnp-aliases + + if use s390; then + # s390 does not has persistent mac addresses + # and we only have persistence rules for mac. + # For now just remove the rules file. + rm ${D}/etc/udev/rules.d/75-persistent-net-generator.rules + fi + +} + +pkg_preinst() { + if [[ -d ${ROOT}/lib/udev-state ]] ; then + mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/ + rm -r "${ROOT}"/lib/udev-state + fi + + if [ -f "${ROOT}/etc/udev/udev.config" -a \ + ! -f "${ROOT}/etc/udev/udev.rules" ] + then + mv -f ${ROOT}/etc/udev/udev.config ${ROOT}/etc/udev/udev.rules + fi + + # delete the old udev.hotplug symlink if it is present + if [ -h "${ROOT}/etc/hotplug.d/default/udev.hotplug" ] + then + rm -f ${ROOT}/etc/hotplug.d/default/udev.hotplug + fi + + # delete the old wait_for_sysfs.hotplug symlink if it is present + if [ -h "${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug" ] + then + rm -f ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug + fi + + # delete the old wait_for_sysfs.hotplug symlink if it is present + if [ -h "${ROOT}/etc/hotplug.d/default/10-udev.hotplug" ] + then + rm -f ${ROOT}/etc/hotplug.d/default/10-udev.hotplug + fi + + # is there a stale coldplug initscript? (CONFIG_PROTECT leaves it behind) + coldplug_stale="" + if [ -f "${ROOT}/etc/init.d/coldplug" ] + then + coldplug_stale="1" + fi +} + +pkg_postinst() { + if [[ ${ROOT} == "/" ]] ; then + # check if root of init-process is identical to ours + if [ -r /proc/1/root -a /proc/1/root/ -ef /proc/self/root/ ]; then + einfo "restarting udevd now." + if [[ -n $(pidof udevd) ]] ; then + killall -15 udevd &>/dev/null + sleep 1 + killall -9 udevd &>/dev/null + fi + /sbin/udevd --daemon + fi + fi + + # people want reminders, I'll give them reminders. Odds are they will + # just ignore them anyway... + + if [[ ${coldplug_stale} == "1" ]] ; then + ewarn "A stale coldplug init script found. You should run:" + ewarn + ewarn " rc-update del coldplug" + ewarn " rm -f /etc/init.d/coldplug" + ewarn + ewarn "udev now provides its own coldplug functionality." + fi + + # delete 40-scsi-hotplug.rules - all integrated in 50-udev.rules + if has_version "=sys-fs/udev-103-r3"; then + if [[ -e "${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules" ]] + then + ewarn "Deleting stray 40-scsi-hotplug.rules" + ewarn "installed by sys-fs/udev-103-r3" + rm -f ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules + fi + fi + + # Removing some device-nodes we thought we need some time ago + if [[ -d "${ROOT}"/lib/udev/devices ]]; then + rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom} + fi + + # Removing some old file + if has_version "