diff options
author | Matthias Schwarzott <zzam@gentoo.org> | 2009-01-20 13:00:01 +0000 |
---|---|---|
committer | Matthias Schwarzott <zzam@gentoo.org> | 2009-01-20 13:00:01 +0000 |
commit | 4d4929328fb353eac7bbb6af1282c7f10d3d7685 (patch) | |
tree | c995300315783acde95b8d3fbab2659bedba57f2 /sys-fs | |
parent | Adding virtuals for dual-lifed modules that come with perl-5.10 (diff) | |
download | historical-4d4929328fb353eac7bbb6af1282c7f10d3d7685.tar.gz historical-4d4929328fb353eac7bbb6af1282c7f10d3d7685.tar.bz2 historical-4d4929328fb353eac7bbb6af1282c7f10d3d7685.zip |
Version bumped. This raises kernel version for reliable udev usage to 2.6.20. Backported one patch. The upstream rule changes still need to be reviewed. For now keep using group uucp instead of dialout as suggested by upstream. Move init-script stuff into a subdir for FILESDIR. Small changes to shell-compat logic.
Package-Manager: portage-2.1.6.6/cvs/Linux 2.6.27-gentoo-r1 i686
Diffstat (limited to 'sys-fs')
-rw-r--r-- | sys-fs/udev/ChangeLog | 17 | ||||
-rw-r--r-- | sys-fs/udev/Manifest | 22 | ||||
-rw-r--r-- | sys-fs/udev/files/136/shell-compat-KV.sh | 45 | ||||
-rw-r--r-- | sys-fs/udev/files/136/shell-compat-addon.sh | 43 | ||||
-rwxr-xr-x | sys-fs/udev/files/136/udev-dev-tarball.initd | 95 | ||||
-rwxr-xr-x | sys-fs/udev/files/136/udev-mount.initd | 101 | ||||
-rwxr-xr-x | sys-fs/udev/files/136/udev-postmount.initd | 23 | ||||
-rw-r--r-- | sys-fs/udev/files/136/udev-start.sh | 54 | ||||
-rw-r--r-- | sys-fs/udev/files/136/udev-stop.sh | 13 | ||||
-rw-r--r-- | sys-fs/udev/files/136/udev.confd | 27 | ||||
-rw-r--r-- | sys-fs/udev/files/136/udev.initd | 208 | ||||
-rw-r--r-- | sys-fs/udev/files/udev-136-fix-ide-cd-rule.diff | 21 | ||||
-rw-r--r-- | sys-fs/udev/udev-136.ebuild | 427 | ||||
-rw-r--r-- | sys-fs/udev/udev-9999.ebuild | 54 |
14 files changed, 1127 insertions, 23 deletions
diff --git a/sys-fs/udev/ChangeLog b/sys-fs/udev/ChangeLog index 8226d5e8f043..29f66561c4c8 100644 --- a/sys-fs/udev/ChangeLog +++ b/sys-fs/udev/ChangeLog @@ -1,6 +1,21 @@ # ChangeLog for sys-fs/udev # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.437 2009/01/20 11:20:22 zzam Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.438 2009/01/20 13:00:01 zzam Exp $ + +*udev-136 (20 Jan 2009) + + 20 Jan 2009; Matthias Schwarzott <zzam@gentoo.org> + +files/136/shell-compat-addon.sh, +files/136/udev.confd, + +files/udev-136-fix-ide-cd-rule.diff, +files/136/udev.initd, + +files/136/udev-dev-tarball.initd, +files/136/udev-mount.initd, + +files/136/shell-compat-KV.sh, +files/136/udev-postmount.initd, + +files/136/udev-start.sh, +files/136/udev-stop.sh, +udev-136.ebuild, + udev-9999.ebuild: + Version bumped. This raises kernel version for reliable udev usage to + 2.6.20. Backported one patch. The upstream rule changes still need to be + reviewed. For now keep using group uucp instead of dialout as suggested by + upstream. Move init-script stuff into a subdir for FILESDIR. Small changes + to shell-compat logic. 20 Jan 2009; Matthias Schwarzott <zzam@gentoo.org> files/shell-compat-118-r3.sh: diff --git a/sys-fs/udev/Manifest b/sys-fs/udev/Manifest index f569c26fab7b..c9ddbd2d81c8 100644 --- a/sys-fs/udev/Manifest +++ b/sys-fs/udev/Manifest @@ -1,6 +1,15 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 +AUX 136/shell-compat-KV.sh 1012 RMD160 5bc85047b4237d502f7b0ccc7181f9974c2b0898 SHA1 bbc58d6181f3fc8d623de1537eddcc1ede919202 SHA256 2393918bc65c69e1c19d7712292c945a4adfe45ce02b88ae7663167b8745cf8b +AUX 136/shell-compat-addon.sh 930 RMD160 c96a77a2085698e4ca3636994d1b6d07326e4b5f SHA1 d696a1ff942d31b493d385cff27bc9cbacd3fa47 SHA256 94b1fe1f5ba892c82798cec6f15b5c5c76e1902ef2d13701ddfbb54f19079af9 +AUX 136/udev-dev-tarball.initd 2579 RMD160 b7feb34f854a3eb08d1203f1faabf9cecee3101c SHA1 10ecda997314851d86a175db8cbfcc6a343e9bb2 SHA256 a829fa3efb9d6aadb137cb8879b8bc2660ef6500b2dbb8d55db8edf52f332d60 +AUX 136/udev-mount.initd 2523 RMD160 1b98e1bf8bead67ff6ce2a0077324755c43b6a60 SHA1 344bfa006a8e0625bd61be8e7668960e44048418 SHA256 63737bd5d35c7c68e718661ff5335750405631bfa25621c74fa4c6d750637f44 +AUX 136/udev-postmount.initd 505 RMD160 42a08fa97d7a8672249647e82369eb81abd88f1f SHA1 2ea973b6c6aea0b17a57586e55eac94f09dd9e1e SHA256 bae9074358b36706a69cbc9006d53f19a257613f6de00431273ebdbb234e038f +AUX 136/udev-start.sh 1345 RMD160 c1b4aac1a52da1eac79f3b6a2ccb6e7036a81fdf SHA1 a8d889f3a1ed216d64affa79a99446611899b16d SHA256 5a56cb63ab5fec4f5393eca944d734bab1373bc2a75dcee6b202f86570541414 +AUX 136/udev-stop.sh 237 RMD160 dea1f6d7525e792484c3d2c31d36e8b4d78ebda8 SHA1 72174a2e5e6be2133b2e5f68e477d0fa342b46ce SHA256 1dbdaa45b9f1e54faba9d153a93c0043aabe5b51270c233d3a5e48a6c1d20a1d +AUX 136/udev.confd 1060 RMD160 541c9530a0ef5415b6aba6df24c49c82927fd972 SHA1 942f40b4760d6941e83003546ae8da4eb0912ec2 SHA256 01900956829beb4d031e097a8cca26e52ac33e0cb1658d1e8ab8eb7dbbd70bc6 +AUX 136/udev.initd 4707 RMD160 edf8d7523a1bb13c2356345696f625b9bf7444ed SHA1 4b14dbb90e5773239f61bad649b091577b7f3879 SHA256 4d57f119a5b7ef91d0991f03e77bee121c8464e538b2a8b1f98ed0a7d6e37d22 AUX blacklist-110 854 RMD160 6cb0acd91dad5c86c47b41f06f74a8529de08b8e SHA1 aa2c3c8340517053151ee687d76d4de05e28ac51 SHA256 438020f3499a2e10a19ba8d3fe7d567572322093ea878e8c18336b067442bcdd AUX modprobe-114.sh 2106 RMD160 7b40f1d0c7e41aa51100c99d1b4accafe9309f00 SHA1 d8d3a6b047a416bf4a80a9dde6eddbcc1e7abb1b SHA256 acfff1be773352f71b7e68ec12aafa113150f76ecb1daa03088842d449df9d6b AUX modprobe-115.sh 2280 RMD160 effe6766adfff5733d396dbffe00827e61280c5b SHA1 dd9331410db47ce8cfb5ab2d9af8d420905313d6 SHA256 22ab8b9f68bfe6d0acb8d2aec70870700ca03ab80341734cbd059c680473739f @@ -24,6 +33,7 @@ AUX udev-135-r2.confd 555 RMD160 dd2f1be71fb1ec9021d03f9065ac768de361bf15 SHA1 b AUX udev-135-r2.initd 4735 RMD160 81089d57c52ab9a685a647049103ae7f2630e25d SHA1 f46e1d017bbc16dd4f610f31a487b3154eb55a38 SHA256 a8a229d1cbfb9a01b0b08b2c312eed87de2dd996faf3af9476ee6456355505d6 AUX udev-135-r3.confd 1060 RMD160 541c9530a0ef5415b6aba6df24c49c82927fd972 SHA1 942f40b4760d6941e83003546ae8da4eb0912ec2 SHA256 01900956829beb4d031e097a8cca26e52ac33e0cb1658d1e8ab8eb7dbbd70bc6 AUX udev-135-rules-update.diff 491 RMD160 175c31cc04287059b88abe4eff41b548c0780894 SHA1 d3365b058964046f47bfce60d1d18a63832cb9a8 SHA256 f6718f689cb3fe256f859d9280164cb6bfeed9452ffc5447c488f397fb4ea9a7 +AUX udev-136-fix-ide-cd-rule.diff 954 RMD160 249e09db662bd12ae2a98e9632bf684e6a66f177 SHA1 9b586d2f5786533a7a23167dd1d9587087c198e2 SHA256 cd353dbc950f4477cc22b251bee7a441994aa514c2399ef8a3ea94e5fd5992c1 AUX udev-dev-tarball-135-r2.initd 2579 RMD160 b7feb34f854a3eb08d1203f1faabf9cecee3101c SHA1 10ecda997314851d86a175db8cbfcc6a343e9bb2 SHA256 a829fa3efb9d6aadb137cb8879b8bc2660ef6500b2dbb8d55db8edf52f332d60 AUX udev-mount-135-r2.initd 2727 RMD160 cdc0d9a8ebaa1160488cbcf41be7d6c6d380e387 SHA1 87c0e5371a67f228b5b276f5e548c73b5ba3e53c SHA256 f1f794e030f7fc34e0e2de1d986b1354cd61fd51778b87ad8d5665017ef6a5b0 AUX udev-mount-135-r3.initd 2491 RMD160 ea74a5349d5a6a61f509bdc2547e9885c5d5ab85 SHA1 2aabc57752b9f6a24d0a8705c8dd33d78f0dd491 SHA256 27f1a58e13e36ad7e22f27d5e5a7d88f1d4f1dd1a546767eed9a7ee764316068 @@ -58,6 +68,7 @@ DIST udev-125.tar.bz2 205296 RMD160 c1571c3824860a166c830d47784f72630129825e SHA DIST udev-130.tar.bz2 442846 RMD160 6b941866b224396792a34db9aa2da0d44dace509 SHA1 da55d4064bd89d4cc3672a3ec304d82a12f0e39c SHA256 bbb64eb268ebc3d7c3bad74774daa2ed0ef887956ae6fb8f6f80717a7c957478 DIST udev-133.tar.bz2 445588 RMD160 c1f2cdbcd168c6d44bb9ff673e2d73e52bde3aa7 SHA1 c0fe38d1552e3710df5418f7811f0a4c0e405e5a SHA256 fe4785fe93e27be05ded15414e3f590b0cbc309400f9cc461a27d20c042f62a8 DIST udev-135.tar.bz2 446675 RMD160 c56d146e0d56e140f7c6dd9294673259d27b162c SHA1 dd3c439279312c6f9594800ca73e84f367d2903a SHA256 acbb5e7d322253ed242f28fbc1974bd34a4da7c29275e17cd5b32b38b2a5c849 +DIST udev-136.tar.bz2 447854 RMD160 eaffd816fb37c1c6f275264f51d00375279ffb2d SHA1 3ca4027db7be5415401905de92e5e367abb60fbb SHA256 ff1f113b460c269b747e747bb0da6ce81c2d5fa748051e8f295de8c9242cde43 EBUILD udev-114.ebuild 9031 RMD160 1b7e45d1a384c52a336727a17e6fbd087855fb34 SHA1 207b330f01cb9970eee14b4c39b7bf2d5b9ce181 SHA256 f45fda83e1308079b9d932586b07acf2d7bf65527f8b414c8d43738fd0c129e5 EBUILD udev-115-r1.ebuild 10108 RMD160 86ec04530480872e2ac1fbb2fa37fa2819639752 SHA1 1021b13461ac7625f97a60634982416c2a8dddc4 SHA256 765135b405bd90ee6c527c0be00e87c12400121e30261de9ba6d3e4a3c50f872 EBUILD udev-119.ebuild 10145 RMD160 7b978b270ce5d39443310b7da58aa5ff4bdd02f9 SHA1 fdd10d47bb62517d78f0e7d811903203b4cc3d8e SHA256 2998cfa7681f16132aaad0a8a033e83418c4e418430cabf5ebf1d8631fcc58bd @@ -70,13 +81,14 @@ EBUILD udev-135-r1.ebuild 12198 RMD160 09f49ca30c37fcedcdb94f483267149291203d2b EBUILD udev-135-r2.ebuild 11230 RMD160 942d3ef0703e37ca76778f380c9f04d8779d4949 SHA1 32b08efeaefbce0ddc566ba5649885608e5a011b SHA256 12534a745f1902814a865ca80ae14e3b588c926165cd91146155d01740308fc2 EBUILD udev-135-r3.ebuild 11230 RMD160 b1bfe5d74055ee6161a8881b38515e535e56519f SHA1 c61f9f3402b79f3a9b4a1807ee184b390a5d8e3a SHA256 41e807d1ac42d9d386d1560d9e0dc3970e15376628b1e225ee3380c6b99f3eca EBUILD udev-135.ebuild 12079 RMD160 88554ff3379d6d74c0537a0848b71e346e5a6108 SHA1 1d2375e4eb0516e4015b534ac4ecb848e8ed5df9 SHA256 8cd73c178e60d06862bbe99f02e86cf0d517edcad6faa5dd0ffe57863355bdb9 -EBUILD udev-9999.ebuild 11379 RMD160 35d7837a0e6c35c71f9c5e0c4f5f84ad02b9b05d SHA1 220b8d85c7478a8bc35e59a46b3686c181b835ed SHA256 24dbad4c413f11ce9fb18032819862301f6bc1fb7da7ca35754631b469c169a6 -MISC ChangeLog 89809 RMD160 3841cf8b0519460a32deee03b25b5fe0da05f901 SHA1 01d51b9c644277f307a8e65366a6f093dd849a52 SHA256 bdf5b193b441310cb1685e5f7576a8f410ede62e5b28d90de960f8da2b639809 +EBUILD udev-136.ebuild 12040 RMD160 c7642c3e12f9dfe55e579e9924620b4894e9f787 SHA1 fdb928183fca04da50ec6af04b02d71604614207 SHA256 5b4f425c10167262d7e082baa8517f6c4f6b4ce050c03d8bae0b15b57e6a1b8e +EBUILD udev-9999.ebuild 11917 RMD160 0d9622046d3df3a2e43ce2b290532907d4328b6b SHA1 7f1c68276bd7c50007ac7586dddf830652512b4b SHA256 c5ff52f3249c4fb0126e846c9ed2f1f543cc63b323f34dce0899f9fa6016c9f9 +MISC ChangeLog 90559 RMD160 316c390400019f3618c82934f9734baf4730b18d SHA1 9594686010719ab4ad17453fd5e2034d191e927a SHA256 b10689adaca6a705dfcbc339ade793c01fc7b2b97821b439f4a5d87d09dc5d6b MISC metadata.xml 225 RMD160 9459d2b2027607874431067a9100c48a0a128ffa SHA1 d9fad1caa18dd065595932b9e5d6c18098f3dfad SHA256 dd3c55c5a5c97678030df2554192894d849cdd4845d6fec1c8259d7bf263cd46 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) -iEYEARECAAYFAkl1s4AACgkQt2vP6XvVdOcpbwCeN2qlhZm3joVO/5pwNDR8mcRK -LwUAn1BDjPXg5kqaweDXDpJ9xXpn3O/v -=Rudy +iEYEARECAAYFAkl1ytcACgkQt2vP6XvVdOcx1QCfd6jQ5fmnv+gDI0rKuyZUeoyx ++WsAn1+ag3T1PfhGUUJZAtC/RMSxwkZt +=hQTy -----END PGP SIGNATURE----- diff --git a/sys-fs/udev/files/136/shell-compat-KV.sh b/sys-fs/udev/files/136/shell-compat-KV.sh new file mode 100644 index 000000000000..be74fe49e3d6 --- /dev/null +++ b/sys-fs/udev/files/136/shell-compat-KV.sh @@ -0,0 +1,45 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# provides get_KV and KV_to_int as not all openrc-versions installed via ebuild have these + +cmd_exist() +{ + type "$1" >/dev/null 2>&1 +} + +# does exist in baselayout-1 +# does not exist in openrc, but is added by openrc-ebuild since some time +if ! cmd_exist KV_to_int; then + KV_to_int() { + [ -z $1 ] && return 1 + + local x=${1%%-*} + local KV_MAJOR=${x%%.*} + x=${x#*.} + local KV_MINOR=${x%%.*} + x=${x#*.} + local KV_MICRO=${x%%.*} + local KV_int=$((${KV_MAJOR} * 65536 + ${KV_MINOR} * 256 + ${KV_MICRO} )) + + # We make version 2.2.0 the minimum version we will handle as + # a sanity check ... if its less, we fail ... + [ "${KV_int}" -lt 131584 ] && return 1 + + echo "${KV_int}" + } +fi + +# same as KV_to_int +if ! cmd_exist get_KV; then + _RC_GET_KV_CACHE="" + get_KV() { + [ -z "${_RC_GET_KV_CACHE}" ] \ + && _RC_GET_KV_CACHE="$(uname -r)" + + echo "$(KV_to_int "${_RC_GET_KV_CACHE}")" + + return $? + } +fi + diff --git a/sys-fs/udev/files/136/shell-compat-addon.sh b/sys-fs/udev/files/136/shell-compat-addon.sh new file mode 100644 index 000000000000..7e684f4d58e2 --- /dev/null +++ b/sys-fs/udev/files/136/shell-compat-addon.sh @@ -0,0 +1,43 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# functions that may not be defined, but are used by the udev-start and udev-stop addon +# used by baselayout-1 and openrc before version 0.4.0 + +cmd_exist() +{ + type "$1" >/dev/null 2>&1 +} + +# does not exist in baselayout-1, does exist in openrc +if ! cmd_exist yesno; then + yesno() { + [ -z "$1" ] && return 1 + case "$1" in + yes|Yes|YES) return 0 ;; + esac + return 1 + } +fi + +# does not exist in baselayout-1, does exist in openrc +if ! cmd_exist fstabinfo; then + fstabinfo() { + [ "$1" = "--quiet" ] && shift + local dir="$1" + + # only check RC_USE_FSTAB on baselayout-1 + yesno "${RC_USE_FSTAB}" || return 1 + + # check if entry is in /etc/fstab + local ret=$(gawk 'BEGIN { found="false"; } + $1 ~ "^#" { next } + $2 == "'$dir'" { found="true"; } + END { print found; } + ' /etc/fstab) + + "${ret}" + } +fi + + diff --git a/sys-fs/udev/files/136/udev-dev-tarball.initd b/sys-fs/udev/files/136/udev-dev-tarball.initd new file mode 100755 index 000000000000..2cdce4ff226b --- /dev/null +++ b/sys-fs/udev/files/136/udev-dev-tarball.initd @@ -0,0 +1,95 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="Maintain a tarball of not udev managed device nodes" +[ -e /etc/conf.d/udev ] && . /etc/conf.d/udev + +rc_device_tarball=${rc_device_tarball:-${RC_DEVICE_TARBALL:-NO}} +device_tarball=/lib/udev/state/devices.tar.bz2 + +depend() { + if [ -f /etc/init.d/sysfs ]; then + need udev-mount + fi +} + +start() +{ + _start +} + +_start() { + if yesno "${rc_device_tarball}" && \ + [ -s "${device_tarball}" ] + then + ebegin "Populating /dev with saved device nodes" + tar -jxpf "${device_tarball}" -C /dev + eend $? + fi +} + +stop() { + if [ -e /dev/.devfsd ] || [ ! -e /dev/.udev ] || [ ! -z "${CDBOOT}" ] || \ + ! yesno "${rc_device_tarball}" || \ + ! touch "${device_tarball}" 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_tmp_tarball="${save_tmp_base}"/devices + + rm -rf "${save_tmp_base}" + mkdir "${save_tmp_base}" + touch "${devices_udev}" "${devices_real}" \ + "${devices_totar}" "${device_tmp_tarball}" + + if [ -f "${devices_udev}" -a -f "${devices_real}" -a \ + -f "${devices_totar}" -a -f "${device_tmp_tarball}" ] + then + cd /dev + # Find all devices, but ignore .udev directory + find . -xdev -type b -or -type c -or -type l | \ + cut -d/ -f2- | \ + grep -v ^\\.udev >"${devices_real}" + + # Figure out what udev created + udevadm info --export-db | sed -ne 's,^[SN]: \(.*\),\1,p' >"${devices_udev}" + # These ones we also do not want in there + for x in MAKEDEV core fd initctl pts shm stderr stdin stdout root; 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}" + cd /dev + fi + + fgrep -x -v -f "${devices_udev}" "${devices_real}" > "${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_tmp_tarball}" -T "${devices_totar}" + mv -f "${device_tmp_tarball}" "${device_tarball}" + else + rm -f "${device_tarball}" + fi + eend 0 + else + eend 1 "Could not create temporary files!" + fi + + rm -rf "${save_tmp_base}" +} + diff --git a/sys-fs/udev/files/136/udev-mount.initd b/sys-fs/udev/files/136/udev-mount.initd new file mode 100755 index 000000000000..c41fa0781a4c --- /dev/null +++ b/sys-fs/udev/files/136/udev-mount.initd @@ -0,0 +1,101 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="Mount tmpfs on /dev" +[ -e /etc/conf.d/udev ] && . /etc/conf.d/udev + +# get_KV and KV_to_int +. /lib/udev/shell-compat-KV.sh + +# FIXME +# Instead of this script testing kernel version, udev itself should +# Maybe something like udevd --test || exit $? +check_kernel() +{ + if [ $(get_KV) -lt $(KV_to_int '%KV_MIN%') ]; then + eerror "Your kernel is too old to work with this version of udev." + eerror "Current udev only supports Linux kernel %KV_MIN% and newer." + return 1 + fi + if [ $(get_KV) -lt $(KV_to_int '%KV_MIN_RELIABLE%') ]; then + ewarn "You need at least Linux kernel %KV_MIN_RELIABLE% for reliable operation of udev." + fi + return 0 +} + + +mount_dev_directory() +{ + # No options are processed here as they should all be in /etc/fstab + ebegin "Mounting /dev" + if fstabinfo --quiet /dev; then + mount -n /dev + else + # Some devices require exec, Bug #92921 + mount -n -t tmpfs -o "exec,nosuid,mode=0755,size=10M" udev /dev + fi + eend $? +} + +seed_dev() +{ + # Seed /dev with some things that we know we need + + # creating /dev/console, /dev/tty 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 + [ -c /dev/tty ] || mknod /dev/tty c 5 0 + + # 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 -RPp /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 + return 0 +} + + +start() +{ + # do not run this on too old baselayout - udev-addon is already loaded! + if [ ! -f /etc/init.d/sysfs ]; then + eerror "The $SVCNAME init-script is written for baselayout-2!" + eerror "Please do not use it with baselayout-1!". + return 1 + fi + + _start +} + +_start() +{ + check_kernel || return 1 + mount_dev_directory || return 1 + + # Selinux lovin; /selinux should be mounted by selinux-patched init + if [ -x /sbin/restorecon -a -c /selinux/null ]; then + restorecon /dev > /selinux/null + fi + + # make sure it exists + mkdir -p /dev/.udev + + seed_dev + + return 0 +} diff --git a/sys-fs/udev/files/136/udev-postmount.initd b/sys-fs/udev/files/136/udev-postmount.initd new file mode 100755 index 000000000000..a640e93de132 --- /dev/null +++ b/sys-fs/udev/files/136/udev-postmount.initd @@ -0,0 +1,23 @@ +#!/sbin/runscript +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/files/136/udev-postmount.initd,v 1.1 2009/01/20 13:00:01 zzam Exp $ + +depend() { + need localmount +} + +start() { + # check if this system uses udev + [ -d /dev/.udev/ ] || return 0 + + # store persistent-rules that got created while booting + # when / was still read-only + /lib/udev/move_tmp_persistent_rules.sh +} + +stop() { + : +} + +# vim:ts=4 diff --git a/sys-fs/udev/files/136/udev-start.sh b/sys-fs/udev/files/136/udev-start.sh new file mode 100644 index 000000000000..8bf098dee1b3 --- /dev/null +++ b/sys-fs/udev/files/136/udev-start.sh @@ -0,0 +1,54 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +[ -e /etc/conf.d/udev ] && . /etc/conf.d/udev + +. /lib/udev/shell-compat-addon.sh + +compat_volume_nodes() +{ + # Only do this for baselayout-1* + # This check is likely to get false positives due to some multilib stuff, + # but that should not matter, as this can only happen on old openrc versions + # no longer available as ebuilds. + if [ ! -e /lib/librc.so ]; then + + # Create nodes that udev can't + [ -x /sbin/lvm ] && \ + /sbin/lvm vgscan -P --mknodes --ignorelockingfailure &>/dev/null + # Running evms_activate on a LiveCD causes lots of headaches + [ -z "${CDBOOT}" -a -x /sbin/evms_activate ] && \ + /sbin/evms_activate -q &>/dev/null + fi +} + +start_initd() +{ + ( + . /etc/init.d/"$1" + _start + ) +} + +# mount tmpfs on /dev +start_initd udev-mount || exit 1 + +# 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. +# this is no longer needed as of openrc-0.4.0 +touch /dev/.rcsysinit + +# load device tarball +start_initd udev-dev-tarball + +# run udevd +start_initd udev || exit 1 + +compat_volume_nodes + +# inject into boot runlevel +IN_HOTPLUG=1 /etc/init.d/udev-postmount start >/dev/null 2>&1 + +# udev started successfully +exit 0 diff --git a/sys-fs/udev/files/136/udev-stop.sh b/sys-fs/udev/files/136/udev-stop.sh new file mode 100644 index 000000000000..47e095607f0a --- /dev/null +++ b/sys-fs/udev/files/136/udev-stop.sh @@ -0,0 +1,13 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# for function yesno +. /lib/udev/shell-compat-addon.sh + +# store device tarball +( + . /etc/init.d/udev-dev-tarball + stop +) + +exit 0 diff --git a/sys-fs/udev/files/136/udev.confd b/sys-fs/udev/files/136/udev.confd new file mode 100644 index 000000000000..4abfa911674d --- /dev/null +++ b/sys-fs/udev/files/136/udev.confd @@ -0,0 +1,27 @@ +# /etc/conf.d/udev: config file for udev + +# We discourage to disable persistent-net!! +# this may lead to random interface naming + +# Disable adding new rules for persistent-net +persistent_net_disable="no" + +# Set to "yes" if you want to save /dev to a tarball on shutdown +# and restore it on startup. This is useful if you have a lot of +# custom device nodes that udev does not handle/know about. +# +# As this option is fragile, we recommend you +# to create your devices in /lib/udev/devices. +# These will be copied to /dev on boot. +#rc_device_tarball="NO" + +# udev can trigger coldplug events which cause services to start and +# kernel modules to be loaded. +# Services are deferred to start in the boot runlevel. +# Set rc_coldplug="NO" if you don't want this. +# If you want module coldplugging but not coldplugging of services then you +# can disable service coldplugging in baselayout/openrc config files. +# The setting is named different in different versions. +# in /etc/rc.conf: rc_hotplug="!*" or +# in /etc/conf.d/rc: rc_plug_services="!*" +#rc_coldplug="YES" diff --git a/sys-fs/udev/files/136/udev.initd b/sys-fs/udev/files/136/udev.initd new file mode 100644 index 000000000000..1707ccea7737 --- /dev/null +++ b/sys-fs/udev/files/136/udev.initd @@ -0,0 +1,208 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="Run udevd and create the device-nodes" + +[ -e /etc/udev/udev.conf ] && . /etc/udev/udev.conf + +rc_coldplug=${rc_coldplug:-${RC_COLDPLUG:-YES}} + +depend() +{ + if [ -f /etc/init.d/sysfs ]; then + # require new enough openrc with sysinit being extra runlevel + # on linux we just check if sysfs init-script exists + # this is to silence out ugly warnings about not-existing sysfs script + provide dev + need sysfs udev-mount udev-dev-tarball + before checkfs fsck + + # udev does not work inside vservers + keyword novserver + fi +} + +cleanup() +{ + # fail more gracely and not leave udevd running + start-stop-daemon --stop --exec /sbin/udevd + exit 1 +} + +disable_hotplug_agent() +{ + if [ -e /proc/sys/kernel/hotplug ]; then + echo "" >/proc/sys/kernel/hotplug + fi +} + +root_link() +{ + /lib/udev/write_root_link_rule +} + +persistent_net_switch() +{ + # this function disables rules files + # by creating new files with the same name + # in a temp rules directory with higher priority + local d=/dev/.udev/rules.d + if yesno "${persistent_net_disable:-no}"; then + mkdir -p "$d" + echo "# This file disables persistent-net due to /etc/conf.d/udev" \ + > "$d"/75-persistent-net-generator.rules + fi +} + +start_udevd() +{ + # load unix domain sockets if built as module, Bug #221253 + if [ -e /proc/modules ] ; then + modprobe -q unix 2>/dev/null + fi + ebegin "Starting udevd" + start-stop-daemon --start --exec /sbin/udevd -- --daemon + eend $? +} + +# populate /dev with devices already found by the kernel +populate_dev() +{ + if get_bootparam "nocoldplug" ; then + rc_coldplug="NO" + ewarn "Skipping udev coldplug as requested in kernel cmdline" + fi + + ebegin "Populating /dev with existing devices through uevents" + if yesno "${rc_coldplug}"; then + udevadm trigger + else + # Do not run any init-scripts, Bug #206518 + udevadm control --env do_not_run_plug_service=1 + + # only create device nodes + udevadm trigger --attr-match=dev + + # run persistent-net stuff, bug 191466 + udevadm trigger --subsystem-match=net + fi + eend $? + + ebegin "Waiting for uevents to be processed" + udevadm settle --timeout=60 + eend $? + + udevadm control --env do_not_run_plug_service= + return 0 +} + +display_hotplugged_services() { + local svcfile= svc= services= + for svcfile in "${RC_SVCDIR}"/hotplugged/*; do + svc="${svcfile##*/}" + [ -x "${svcfile}" ] || continue + + # do not display this - better: do only inject it later :) + [ "$svc" = "udev-postmount" ] && continue + + services="${services} ${svc}" + done + [ -n "${services}" ] && einfo "Device initiated services:${HILITE}${services}${NORMAL}" +} + +inject_postmount_initd() { + if ! mark_service_hotplugged udev-postmount; then + IN_HOTPLUG=1 /etc/init.d/udev-postmount start >/dev/null 2>&1 + fi + #einfo "Injected udev-postmount service" +} + +check_persistent_net() +{ + # check if there are problems with persistent-net + local syspath= devs= problem=false + for syspath in /sys/class/net/*_rename*; do + if [ -d "${syspath}" ]; then + devs="${devs} ${syspath##*/}" + problem=true + fi + done + + ${problem} || return 0 + + eerror "UDEV: Your system has a problem assigning persistent names" + eerror "to these network interfaces: ${devs}" + + einfo "Checking persistent-net rules:" + # the sed-expression lists all duplicate lines + # from the input, like "uniq -d" does, but uniq + # is installed into /usr/bin and not available at boot. + dups=$( + RULES_FILE='/etc/udev/rules.d/70-persistent-net.rules' + . /lib/udev/rule_generator.functions + find_all_rules 'NAME=' '.*' | \ + tr ' ' '\n' | \ + sort | \ + sed '$!N; s/^\(.*\)\n\1$/\1/; t; D' + ) + if [ -n "${dups}" ]; then + ewarn "The rules create multiple entries assigning these names:" + eindent + ewarn "${dups}" + eoutdent + else + ewarn "Found no duplicate names in persistent-net rules," + ewarn "there must be some other problem!" + fi + return 1 +} + +check_udev_works() +{ + # should exist on every system, else udev failed + if [ ! -e /dev/zero ]; then + eerror "Assuming udev failed somewhere, as /dev/zero does not exist." + return 1 + fi + return 0 +} + +start() +{ + # do not run this on old baselayout where udev-addon gets loaded + if [ ! -f /etc/init.d/sysfs ]; then + eerror "The $SVCNAME init-script is written for baselayout-2!" + eerror "Please do not use it with baselayout-1!". + return 1 + fi + + _start + + display_hotplugged_services + + inject_postmount_initd +} + +_start() +{ + root_link + persistent_net_switch + + disable_hotplug_agent + start_udevd || cleanup + populate_dev || cleanup + + check_persistent_net + + check_udev_works || cleanup + + return 0 +} + +stop() { + ebegin "Stopping udevd" + start-stop-daemon --stop --exec /sbin/udevd + eend $? +} + diff --git a/sys-fs/udev/files/udev-136-fix-ide-cd-rule.diff b/sys-fs/udev/files/udev-136-fix-ide-cd-rule.diff new file mode 100644 index 000000000000..1ceaa44cd030 --- /dev/null +++ b/sys-fs/udev/files/udev-136-fix-ide-cd-rule.diff @@ -0,0 +1,21 @@ +commit 18cff5c3b2e3591fa46107288ea2d7026a15ccf3 +Author: Kay Sievers <kay.sievers@vrfy.org> +Date: Sat Jan 10 17:44:09 2009 +0100 + + rules: fix typo in ide cd rule + + Thanks to Scott, who found that. + +diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules +index 119941b..7730f0d 100644 +--- a/rules/rules.d/50-udev-default.rules ++++ b/rules/rules.d/50-udev-default.rules +@@ -68,7 +68,7 @@ KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="floppy", OPTIONS+="all_partitio + + # cdrom + SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n", GROUP="cdrom" +-SUBSYSTEM=="block", KERNEL=="hd[0-9]*", SUBSYSTEMS=="ide", ATTRS{media}=="cdrom", GROUP="cdrom" ++SUBSYSTEM=="block", KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="cdrom", GROUP="cdrom" + SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom" + KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%k", GROUP="cdrom" + KERNEL=="pktcdvd", NAME="pktcdvd/control", GROUP="cdrom" diff --git a/sys-fs/udev/udev-136.ebuild b/sys-fs/udev/udev-136.ebuild new file mode 100644 index 000000000000..6b2bd253588a --- /dev/null +++ b/sys-fs/udev/udev-136.ebuild @@ -0,0 +1,427 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-136.ebuild,v 1.1 2009/01/20 13:00:01 zzam Exp $ + +inherit eutils flag-o-matic multilib toolchain-funcs versionator + +HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" +if [[ ${PV} == "9999" ]]; then + EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/hotplug/udev.git" + EGIT_BRANCH="master" + inherit git autotools +else + SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2" +fi +DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" + +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 + !<sys-fs/device-mapper-1.02.19-r1" +RDEPEND="${DEPEND} ${RDEPEND} + >=sys-apps/baselayout-1.12.5" +# We need the lib/rcscripts/addon support +PROVIDE="virtual/dev-manager" + +pkg_setup() { + udev_helper_dir="/$(get_libdir)/udev" + + # comparing kernel version without linux-info.eclass to not pull + # virtual/linux-sources + + local KV=$(uname -r) + local KV_MAJOR=$(get_major_version ${KV}) + local KV_MINOR=$(get_version_component_range 2 ${KV}) + local KV_MICRO=$(get_version_component_range 3 ${KV}) + + local KV_min_micro=15 KV_min_micro_reliable=20 + KV_min=2.6.${KV_min_micro} + KV_min_reliable=2.6.${KV_min_micro_reliable} + + local ok=0 + if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 ]] + then + if [[ ${KV_MICRO} -ge ${KV_min_micro_reliable} ]]; then + ok=2 + elif [[ ${KV_MICRO} -ge ${KV_min_micro} ]]; then + ok=1 + fi + fi + + if [[ ${ok} -lt 1 ]] + then + ewarn + ewarn "${P} does not support Linux kernel before version ${KV_min}!" + fi + if [[ ${ok} -lt 2 ]]; then + ewarn "If you want to use udev reliable you should update" + ewarn "to at least kernel version ${KV_min_reliable}!" + ewarn + ebeep + fi +} + +sed_helper_dir() { + sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@" +} + +src_unpack() { + if [[ ${PV} == "9999" ]] ; then + git_src_unpack + else + unpack ${A} + fi + + cd "${S}" + + # patches go here... + epatch "${FILESDIR}/${P}-fix-ide-cd-rule.diff" + + # change rules back to group uucp instead of dialout for now + sed -e 's/GROUP="dialout"/GROUP="uucp"/' \ + -i rules/{rules.d,packages}/*.rules + + if [[ ${PV} != 9999 ]]; then + # Make sure there is no sudden changes to upstream rules file + # (more for my own needs than anything else ...) + MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules") + MD5=${MD5/ -/} + if [[ ${MD5} != 7c7de0a29a2cf218dc43dd099cd3bfec ]] + then + echo + eerror "50-udev-default.rules has been updated, please validate!" + eerror "md5sum=${MD5}" + die "50-udev-default.rules has been updated, please validate!" + fi + fi + + sed_helper_dir \ + rules/rules.d/50-udev-default.rules \ + extras/rule_generator/write_*_rules \ + udev/udev-util.c \ + udev/udev-rules.c \ + udev/udevd.c || die "sed failed" + + if [[ ${PV} == 9999 ]]; then + eautoreconf + fi +} + +src_compile() { + filter-flags -fprefetch-loop-arrays + + econf \ + --prefix=/usr \ + --sysconfdir=/etc \ + --exec-prefix= \ + --with-libdir-name=$(get_libdir) \ + --enable-logging \ + $(use_with selinux) + + emake || die "compiling udev failed" +} + +src_install() { + local scriptdir="${FILESDIR}/136" + + into / + emake DESTDIR="${D}" install || die "make install failed" + if [[ "$(get_libdir)" != "lib" ]]; then + # we can not just rename /lib to /lib64, because + # make install creates /lib64 and /lib + mkdir -p "${D}/$(get_libdir)" + mv "${D}"/lib/* "${D}/$(get_libdir)/" + rmdir "${D}"/lib + fi + + exeinto "${udev_helper_dir}" + newexe "${FILESDIR}"/net-130-r1.sh net.sh || die "net.sh not installed properly" + newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \ + || die "move_tmp_persistent_rules.sh not installed properly" + newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \ + || die "write_root_link_rule not installed properly" + + doexe "${scriptdir}"/shell-compat-KV.sh \ + || die "shell-compat.sh not installed properly" + doexe "${scriptdir}"/shell-compat-addon.sh \ + || die "shell-compat.sh not installed properly" + + keepdir "${udev_helper_dir}"/state + keepdir "${udev_helper_dir}"/devices + + # create symlinks for these utilities to /sbin + # where multipath-tools expect them to be (Bug #168588) + dosym "..${udev_helper_dir}/vol_id" /sbin/vol_id + dosym "..${udev_helper_dir}/scsi_id" /sbin/scsi_id + + # Add gentoo stuff to udev.conf + echo "# If you need to change mount-options, do it in /etc/fstab" \ + >> "${D}"/etc/udev/udev.conf + + # let the dir exist at least + keepdir /etc/udev/rules.d + + # Now installing rules + cd "${S}"/rules + insinto "${udev_helper_dir}"/rules.d/ + + # Our rules files + doins gentoo/??-*.rules + doins packages/40-alsa.rules + doins packages/40-isdn.rules + + # Adding arch specific rules + if [[ -f packages/40-${ARCH}.rules ]] + then + doins "packages/40-${ARCH}.rules" + fi + cd "${S}" + + # our udev hooks into the rc system + insinto /$(get_libdir)/rcscripts/addons + doins "${scriptdir}"/udev-start.sh \ + || die "udev-start.sh not installed properly" + doins "${scriptdir}"/udev-stop.sh \ + || die "udev-stop.sh not installed properly" + + local init + # udev-postmount and init-scripts for >=openrc-0.3.1, Bug #240984 + for init in udev udev-mount udev-dev-tarball udev-postmount; do + newinitd "${scriptdir}/${init}.initd" "${init}" \ + || die "initscript ${init} not installed properly" + done + + # insert minimum kernel versions + sed -e "s/%KV_MIN%/${KV_min}/" \ + -e "s/%KV_MIN_RELIABLE%/${KV_min_reliable}/" \ + -i "${D}"/etc/init.d/udev-mount + + + # config file for init-script and start-addon + newconfd "${scriptdir}/udev.confd" udev \ + || die "config file not installed properly" + + insinto /etc/modprobe.d + newins "${FILESDIR}"/blacklist-110 blacklist + doins "${FILESDIR}"/pnp-aliases + + # convert /lib/udev to real used dir + sed_helper_dir \ + "${D}/$(get_libdir)"/rcscripts/addons/*.sh \ + "${D}"/etc/init.d/udev* \ + "${D}"/etc/modprobe.d/* + + # documentation + dodoc ChangeLog README TODO || die "failed installing docs" + + cd docs/writing_udev_rules + mv index.html writing_udev_rules.html + dohtml *.html + + cd "${S}" + + newdoc extras/volume_id/README README_volume_id + + echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > 20udev + doenvd 20udev +} + +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 && + ! -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 + + has_version "=${CATEGORY}/${PN}-103-r3" + previous_equal_to_103_r3=$? + + has_version "<${CATEGORY}/${PN}-104-r5" + previous_less_than_104_r5=$? + + has_version "<${CATEGORY}/${PN}-106-r5" + previous_less_than_106_r5=$? + + has_version "<${CATEGORY}/${PN}-113" + previous_less_than_113=$? +} + +fix_old_persistent_net_rules() { + local rules=${ROOT}/etc/udev/rules.d/70-persistent-net.rules + [[ -f ${rules} ]] || return + + elog + elog "Updating persistent-net rules file" + + # Change ATTRS to ATTR matches, Bug #246927 + sed -i -e 's/ATTRS{/ATTR{/g' "${rules}" + + # Add KERNEL matches if missing, Bug #246849 + sed -ri \ + -e '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \ + "${rules}" +} + +# See Bug #129204 for a discussion about restarting udevd +restart_udevd() { + # need to merge to our system + [[ ${ROOT} = / ]] || return + + # check if root of init-process is identical to ours (not in chroot) + [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] || return + + # abort if there is no udevd running + [[ -n $(pidof udevd) ]] || return + + # abort if no /dev/.udev exists + [[ -e /dev/.udev ]] || return + + elog + elog "restarting udevd now." + + killall -15 udevd &>/dev/null + sleep 1 + killall -9 udevd &>/dev/null + + /sbin/udevd --daemon +} + +pkg_postinst() { + fix_old_persistent_net_rules + + restart_udevd + + if [[ -e "${ROOT}"/etc/runlevels/sysinit && ! -e "${ROOT}"/etc/runlevels/sysinit/udev ]] + then + ewarn + ewarn "You need to add the udev init script to the runlevel sysinit," + ewarn "else your system will not be able to boot" + ewarn "after updating to >=openrc-0.4.0" + ewarn "Run this to enable udev for >=openrc-0.4.0:" + ewarn "\trc-update add udev sysinit" + ewarn + 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 [[ $previous_equal_to_103_r3 = 0 ]] && + [[ -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 + + # 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 [[ $previous_less_than_104_r5 = 0 ]] + then + rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev + rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null + fi + + if [[ $previous_less_than_106_r5 = 0 ]] && + [[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]] + then + rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules + fi + + # Try to remove /etc/dev.d as that is obsolete + if [[ -d ${ROOT}/etc/dev.d ]] + then + rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null + if [[ -d ${ROOT}/etc/dev.d ]] + then + ewarn "You still have the directory /etc/dev.d on your system." + ewarn "This is no longer used by udev and can be removed." + fi + fi + + # 64-device-mapper.rules now gets installed by sys-fs/device-mapper + # remove it if user don't has sys-fs/device-mapper installed + if [[ $previous_less_than_113 = 0 ]] && + [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && + ! has_version sys-fs/device-mapper + then + rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules + einfo "Removed unneeded file 64-device-mapper.rules" + fi + + # requested in Bug #225033: + elog + elog "persistent-net does assigning fixed names to network devices." + elog "If you have problems with the persistent-net rules," + elog "just delete the rules file" + elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules" + elog "and then reboot." + elog + elog "This may however number your devices in a different way than they are now." + + ewarn + ewarn "If you build an initramfs including udev, then please" + ewarn "make sure that the /sbin/udevadm binary gets included," + ewarn "and your scripts changed to use it,as it replaces the" + ewarn "old helper apps udevinfo, udevtrigger, ..." + + ewarn + ewarn "mount options for directory /dev are no longer" + ewarn "set in /etc/udev/udev.conf, but in /etc/fstab" + ewarn "as for other directories." + + elog + elog "For more information on udev on Gentoo, writing udev rules, and" + elog " fixing known issues visit:" + elog " http://www.gentoo.org/doc/en/udev-guide.xml" +} diff --git a/sys-fs/udev/udev-9999.ebuild b/sys-fs/udev/udev-9999.ebuild index 6fd03bd2daae..b3ee9831f2f3 100644 --- a/sys-fs/udev/udev-9999.ebuild +++ b/sys-fs/udev/udev-9999.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-9999.ebuild,v 1.2 2009/01/06 18:42:15 mr_bones_ Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-9999.ebuild,v 1.3 2009/01/20 13:00:01 zzam Exp $ inherit eutils flag-o-matic multilib toolchain-funcs versionator @@ -38,14 +38,16 @@ pkg_setup() { local KV_MINOR=$(get_version_component_range 2 ${KV}) local KV_MICRO=$(get_version_component_range 3 ${KV}) - local min_micro=15 min_micro_reliable=20 + local KV_min_micro=15 KV_min_micro_reliable=20 + KV_min=2.6.${KV_min_micro} + KV_min_reliable=2.6.${KV_min_micro_reliable} local ok=0 if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 ]] then - if [[ ${KV_MICRO} -ge ${min_micro_reliable} ]]; then + if [[ ${KV_MICRO} -ge ${KV_min_micro_reliable} ]]; then ok=2 - elif [[ ${KV_MICRO} -ge ${min_micro} ]]; then + elif [[ ${KV_MICRO} -ge ${KV_min_micro} ]]; then ok=1 fi fi @@ -53,11 +55,11 @@ pkg_setup() { if [[ ${ok} -lt 1 ]] then ewarn - ewarn "${P} does not support Linux kernel before version 2.6.${min_micro}!" + ewarn "${P} does not support Linux kernel before version ${KV_min}!" fi if [[ ${ok} -lt 2 ]]; then ewarn "If you want to use udev reliable you should update" - ewarn "to at least kernel version 2.6.${min_micro_reliable}!" + ewarn "to at least kernel version ${KV_min_reliable}!" ewarn ebeep fi @@ -78,15 +80,20 @@ src_unpack() { # patches go here... + # change rules back to group uucp instead of dialout for now + sed -e 's/GROUP="dialout"/GROUP="uucp"/' \ + -i rules/{rules.d,packages}/*.rules + if [[ ${PV} != 9999 ]]; then # Make sure there is no sudden changes to upstream rules file # (more for my own needs than anything else ...) MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules") MD5=${MD5/ -/} - if [[ ${MD5} != c233e7da2eaebbda659d7121957aea72 ]] + if [[ ${MD5} != 7c7de0a29a2cf218dc43dd099cd3bfec ]] then echo eerror "50-udev-default.rules has been updated, please validate!" + eerror "md5sum=${MD5}" die "50-udev-default.rules has been updated, please validate!" fi fi @@ -118,6 +125,8 @@ src_compile() { } src_install() { + local scriptdir="${FILESDIR}/136" + into / emake DESTDIR="${D}" install || die "make install failed" if [[ "$(get_libdir)" != "lib" ]]; then @@ -134,7 +143,10 @@ src_install() { || die "move_tmp_persistent_rules.sh not installed properly" newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \ || die "write_root_link_rule not installed properly" - newexe "${FILESDIR}"/shell-compat-118-r3.sh shell-compat.sh \ + + doexe "${scriptdir}"/shell-compat-KV.sh \ + || die "shell-compat.sh not installed properly" + doexe "${scriptdir}"/shell-compat-addon.sh \ || die "shell-compat.sh not installed properly" keepdir "${udev_helper_dir}"/state @@ -170,19 +182,27 @@ src_install() { # our udev hooks into the rc system insinto /$(get_libdir)/rcscripts/addons - newins "${FILESDIR}"/udev-start-135-r3.sh udev-start.sh - newins "${FILESDIR}"/udev-stop-135-r2.sh udev-stop.sh + doins "${scriptdir}"/udev-start.sh \ + || die "udev-start.sh not installed properly" + doins "${scriptdir}"/udev-stop.sh \ + || die "udev-stop.sh not installed properly" + + local init + # udev-postmount and init-scripts for >=openrc-0.3.1, Bug #240984 + for init in udev udev-mount udev-dev-tarball udev-postmount; do + newinitd "${scriptdir}/${init}.initd" "${init}" \ + || die "initscript ${init} not installed properly" + done - # The udev-post init-script - newinitd "${FILESDIR}"/udev-postmount-135-r2.initd udev-postmount + # insert minimum kernel versions + sed -e "s/%KV_MIN%/${KV_min}/" \ + -e "s/%KV_MIN_RELIABLE%/${KV_min_reliable}/" \ + -i "${D}"/etc/init.d/udev-mount - # init-scripts for >=openrc-0.3.1, Bug #240984 - newinitd "${FILESDIR}/udev-135-r2.initd" udev - newinitd "${FILESDIR}/udev-mount-135-r3.initd" udev-mount - newinitd "${FILESDIR}/udev-dev-tarball-135-r2.initd" udev-dev-tarball # config file for init-script and start-addon - newconfd "${FILESDIR}/udev-135-r3.confd" udev + newconfd "${scriptdir}/udev.confd" udev \ + || die "config file not installed properly" insinto /etc/modprobe.d newins "${FILESDIR}"/blacklist-110 blacklist |