summaryrefslogtreecommitdiff
path: root/sys-fs
diff options
context:
space:
mode:
authorFlorian Fischer <vlooe@web.de>2009-03-26 22:39:41 +0100
committerFlorian Fischer <vlooe@web.de>2009-03-26 22:39:41 +0100
commit984d7ab0959a5b0493a210987f14d804df5915f6 (patch)
tree84b721b6ff7ba8aa030b1e7ed142a9fb736fe232 /sys-fs
parentadded sys-devel/libtool-1.5.26 (diff)
downloadmultilib-portage-984d7ab0959a5b0493a210987f14d804df5915f6.tar.gz
multilib-portage-984d7ab0959a5b0493a210987f14d804df5915f6.tar.bz2
multilib-portage-984d7ab0959a5b0493a210987f14d804df5915f6.zip
added sys-fs/udev-124-r1
Diffstat (limited to 'sys-fs')
-rw-r--r--sys-fs/udev/Manifest46
-rwxr-xr-xsys-fs/udev/files/modprobe-114.sh93
-rwxr-xr-xsys-fs/udev/files/modprobe-115.sh102
-rwxr-xr-xsys-fs/udev/files/net-104-r10.sh28
-rwxr-xr-xsys-fs/udev/files/net-118-r1.sh34
-rw-r--r--sys-fs/udev/files/shell-compat-118-r2.sh57
-rw-r--r--sys-fs/udev/files/shell-compat-118-r3.sh75
-rw-r--r--sys-fs/udev/files/udev-110-root-link-1.diff148
-rw-r--r--sys-fs/udev/files/udev-114-root-link-2.diff164
-rw-r--r--sys-fs/udev/files/udev-122-rules-update.diff13
-rw-r--r--sys-fs/udev/files/udev-124-cdrom-autoclose-bug.diff27
-rw-r--r--sys-fs/udev/files/udev-125-cdrom-autoclose-bug.diff27
-rw-r--r--sys-fs/udev/files/udev-125-rules-update.diff13
-rw-r--r--sys-fs/udev/files/udev-133-rules-update.diff70
-rw-r--r--sys-fs/udev/files/udev-133-silence-physdev-warnings.diff42
-rw-r--r--sys-fs/udev/files/udev-135-fix-capi.diff29
-rw-r--r--sys-fs/udev/files/udev-135-fix-dri-perms.diff20
-rw-r--r--sys-fs/udev/files/udev-135-r2.confd16
-rw-r--r--sys-fs/udev/files/udev-135-r2.initd209
-rw-r--r--sys-fs/udev/files/udev-135-r3.confd27
-rw-r--r--sys-fs/udev/files/udev-135-rules-update.diff14
-rwxr-xr-xsys-fs/udev/files/udev-dev-tarball-135-r2.initd95
-rw-r--r--sys-fs/udev/files/udev-fix-udevinfo-in-doc.diff135
-rwxr-xr-xsys-fs/udev/files/udev-mount-135-r2.initd107
-rwxr-xr-xsys-fs/udev/files/udev-mount-135-r3.initd101
-rwxr-xr-xsys-fs/udev/files/udev-postmount-130-r2.initd25
-rwxr-xr-xsys-fs/udev/files/udev-postmount-135-r2.initd23
-rwxr-xr-xsys-fs/udev/files/udev-postmount-initd-111-r223
-rw-r--r--sys-fs/udev/files/udev-start-113-r2.sh247
-rw-r--r--sys-fs/udev/files/udev-start-114-r1.sh234
-rw-r--r--sys-fs/udev/files/udev-start-118-r2.sh203
-rw-r--r--sys-fs/udev/files/udev-start-122-r1.sh239
-rw-r--r--sys-fs/udev/files/udev-start-126.sh239
-rw-r--r--sys-fs/udev/files/udev-start-133.sh254
-rw-r--r--sys-fs/udev/files/udev-start-135-r2.sh45
-rw-r--r--sys-fs/udev/files/udev-start-135-r3.sh54
-rwxr-xr-xsys-fs/udev/files/udev-stop-111-r2.sh80
-rwxr-xr-xsys-fs/udev/files/udev-stop-118-r2.sh71
-rwxr-xr-xsys-fs/udev/files/udev-stop-126.sh71
-rw-r--r--sys-fs/udev/files/udev-stop-135-r2.sh13
-rw-r--r--sys-fs/udev/files/udev.conf.post_11328
-rw-r--r--sys-fs/udev/files/udev.conf.post_11411
-rw-r--r--sys-fs/udev/files/udev.confd8
-rwxr-xr-xsys-fs/udev/files/udev.initd59
-rwxr-xr-xsys-fs/udev/files/write_root_link_rule29
-rw-r--r--sys-fs/udev/udev-124-r1.ebuild377
46 files changed, 4025 insertions, 0 deletions
diff --git a/sys-fs/udev/Manifest b/sys-fs/udev/Manifest
index 999638cfc..369a55dd8 100644
--- a/sys-fs/udev/Manifest
+++ b/sys-fs/udev/Manifest
@@ -8,9 +8,55 @@ AUX 136/udev-stop.sh 237 RMD160 dea1f6d7525e792484c3d2c31d36e8b4d78ebda8 SHA1 72
AUX 136/udev.confd 1764 RMD160 255afed98d59675108bc96e1639f9b7e8baed4b3 SHA1 19f465c7140818860ce5031e85118d48544c3629 SHA256 6918ce2ad61a7998088e1628e5bd1b59a9082cdb89dc23b1385f641d8a59cdb6
AUX 136/udev.initd 5788 RMD160 76990933287475809083ddc6b2e83383d5500d67 SHA1 adc8c33d287f1ccdcc1db16655a7b11397d1ff79 SHA256 5a051c02f7a64d102d9b73b8a73bf1d6fe3d692d7839dde117da21a948d90ce9
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
AUX move_tmp_persistent_rules-112-r1.sh 646 RMD160 462b7836fc1492491e8e67de9301acb05cef847e SHA1 32b1cf96cfa55193c7b7e82640296fc11e7e8031 SHA256 d5dcbb9a13223633e9c4ac8b4eb26ddb38b55af7ea0eec9e512eb47475a07400
+AUX net-104-r10.sh 719 RMD160 e0c3a76c24108d43518f301ebe5cff7f3e06081d SHA1 baa060c99d7c38c26bcc629ee9844319bd886647 SHA256 e3d7b8a447087b7357b6b7713089bf84aecf598714a569be75c45d7c3a7581ee
+AUX net-118-r1.sh 861 RMD160 44335ca0bf482757683fcaf014d2b9072c8fa10c SHA1 7729b61627b71038928310b27099bd02175825df SHA256 90054aeda808a7b82ff08d7185a198f89f9a0b5ad0e3ff8e92940fdec4b7d68a
AUX net-130-r1.sh 865 RMD160 0025caa63b4b57bac9d6d47a285e8593fd47fc21 SHA1 299b89d6fa04d700e31bf0b8a8eebf90cc8a6640 SHA256 54897b58aba92d9765e8da4349ad777f9d8328bf94922d28cb3210ee0664a6a4
AUX pnp-aliases 537 RMD160 e0144801b7b9c77eb4897692678b75a661723725 SHA1 8276e2dd1a3be1aa2343797b3f9906606d58c9ca SHA256 690b32a166d060c1c663030c51d5b2298eb9d314c8cef737373e0b16ed751e99
+AUX shell-compat-118-r2.sh 1050 RMD160 9cffc5b6b1159fcf87a6befbfaaf01a632828d9f SHA1 75b90a518372624a850c045993885104e27728dc SHA256 f3a71925ca6b99a34018150b3280c4990b465aa297de55f7784f90b1fe9b5e6a
+AUX shell-compat-118-r3.sh 1554 RMD160 4adb41f34c71704c03d241e291aba4529ee0c43c SHA1 a1bbf28acca0dd3189dba91bc876820364706cd8 SHA256 d5720dd2d572db98320d08572fa1d5f40037697d94e2db6bd7b51ba502fc2876
+AUX udev-110-root-link-1.diff 3412 RMD160 d4a61b2825ec593198c286622b5f9a188bd18e51 SHA1 06869481f097a09244de6ccb28e133ca03515fef SHA256 30e983bb086c40e0935680d46c172b3e737b2ad5bc134070451250ebcf39c8c8
+AUX udev-114-root-link-2.diff 4677 RMD160 47b040b51ed0dc637ff2197373db5173bc59854e SHA1 be6ab3162682b4c4cd922d57d356eee4b35d352e SHA256 d212407420bb46a541e547d59862668745dd8b516b6be6e6619cf967ab2124f9
+AUX udev-122-rules-update.diff 586 RMD160 5b9d086ac57ae282b5cd30eda375fc736b2c1af8 SHA1 91ed560c66a5619c7e6fe411a8802acc31682185 SHA256 1eaa8365efa69445e8a1e95c88f1fd411ed3b3f0b73e3d1c3798f0943c5584a8
+AUX udev-124-cdrom-autoclose-bug.diff 1381 RMD160 7e1ee6fa9f59f2528df7c4b3deb1d8c12332b14b SHA1 04daf04b28f2963d98c2826962de625b4ba4b03e SHA256 260a1bd5ad54c8c484a55a503c7b602518070dcc40c2887bb5ec84a5231bedf9
+AUX udev-125-cdrom-autoclose-bug.diff 1369 RMD160 52eb8c8dd8160431bc533e921490efb374ae7f10 SHA1 5b0fc1f809b2ba1ced47eb05c6673734a6c98c85 SHA256 81512746419ec4cd8a76e9a470c2a94201d7747ff09bb3b5ed7de2d588a83081
+AUX udev-125-rules-update.diff 577 RMD160 13aad3db2819980996f2b36267b1b4b4fe48e943 SHA1 862386a818aed8dc283caef1cea0bd6567634531 SHA256 223b6d5196e24cc608e45ff9a589cfadac2944e1d89b32c80fdf101f381ce6c6
+AUX udev-133-rules-update.diff 2310 RMD160 92359598dfe12f83a8fbeccef910fb7f14af1470 SHA1 d9eba00002ca66297b861cf4c13539f069a295d7 SHA256 f377673736e59ba4b026489bff8e37b710c4fe11dbed7d8bb0ae323141327126
+AUX udev-133-silence-physdev-warnings.diff 1441 RMD160 261062f671d8a070c6ca0f5a656ca74303e1a178 SHA1 f90ee4a4cb71213b9f7abf69a1d848adb6cec7ac SHA256 8397e6b91433f2de7ce786275b5450a0c3a0384178e46c508e80c8e97cd22dc5
+AUX udev-135-fix-capi.diff 1168 RMD160 9283d71d645b2049bcfebe265be8a6289e003fca SHA1 09aa1fed193ccfd174144d2c36cb5becd7f78c62 SHA256 34ad67c749bf4f076bb8fb1f894197a545f7a4c4a7fa977b9198d34cf249a698
+AUX udev-135-fix-dri-perms.diff 791 RMD160 e4510e49233ea04705c6c96cd5e9ccaacf7f34ca SHA1 069609174fd939d094250022293ba08920812441 SHA256 0b15c790bf8eb93af8e0d421c175b69f6c3f89edaad159e8cf55424a4ec21e06
+AUX udev-135-r2.confd 555 RMD160 dd2f1be71fb1ec9021d03f9065ac768de361bf15 SHA1 b3ba12437dbb105072d44a2c2831f61550190cb6 SHA256 246d25beec523e7ce99a9322a14169c57e8f338a5e8b3893a6a108e21c1deca0
+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-dev-tarball-135-r2.initd 2579 RMD160 b7feb34f854a3eb08d1203f1faabf9cecee3101c SHA1 10ecda997314851d86a175db8cbfcc6a343e9bb2 SHA256 a829fa3efb9d6aadb137cb8879b8bc2660ef6500b2dbb8d55db8edf52f332d60
+AUX udev-fix-udevinfo-in-doc.diff 9455 RMD160 9a8198f50956d71408b92b4eb8e47c96b7ac5cc5 SHA1 981e6e2258466817933716bfa76b42160baa1f3a SHA256 ca5967beeace666d1882397549ecc7735d50a56789f45de6846f33127cbb2f8e
+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
+AUX udev-postmount-130-r2.initd 541 RMD160 88bcdfee21d301385d1a6ef59303825042efd335 SHA1 b89322e2c5a24492593ee8165d042b7039214adf SHA256 00dc2047e16505a89c38571ea50c4ba453ffdee4b9aebe81ca41572f9d62e30e
+AUX udev-postmount-135-r2.initd 508 RMD160 c4cc6666d98050024eb28738203bd92c0e4fa1d2 SHA1 db42443945c3c06fb7c951a0d69879b32f9366ce SHA256 21e53535357a5851305e1bdc377a9b3b2eddf85fb9ab55a7efef6e28183d8913
+AUX udev-postmount-initd-111-r2 508 RMD160 e1f42197fe3003ec4691b768a921029ce085becb SHA1 7ceb08150d429bd6b5cef88d76847575c6e89f22 SHA256 607deb133ab4be0d2fcb16346e86b3d8ae00bd62d2cbc1329458f278a1b1ff5c
+AUX udev-start-113-r2.sh 6515 RMD160 2ecaa37fd9e498e60f8cd5978cb4f7930594cf99 SHA1 670bb1845ed70442fe598a5580101be75e2402c9 SHA256 438bc31605c8d2e50bebedd7fbff1410845738372ab3bc03d6f5ed1427ddd046
+AUX udev-start-114-r1.sh 6218 RMD160 a7348ac44768096b3da712a9be0ef4bf9af6ec17 SHA1 6dfcb9aed5e066d21bebee03d29137722db19b56 SHA256 a639a6f1093f05da197c3fc548c31f7078b2f0023f66f3caade0721c60819268
+AUX udev-start-118-r2.sh 5072 RMD160 24b469dc45b70b6eac82ae3a32f1fb8b0d062c5f SHA1 259ffce13605ad5dd4495926862a1c30ed9c1b51 SHA256 90b6a7616767facf64bcc21563f7333f63633044c24fa56f6ca5647c5b8ee5dc
+AUX udev-start-122-r1.sh 5776 RMD160 50d9aa7d13dbbe04b13d85aee785caa3be36bcd4 SHA1 91216ac58a61a4f5c0d73751f773efb3ffecc8e7 SHA256 6590e4a4bc9a56ec3ead0cef1d7727dc565bdc90dccbbd33dcb56b7f320176ad
+AUX udev-start-126.sh 5788 RMD160 77352965a177c5cc476f2d62f59c41e546160c94 SHA1 ae2fa5d4b3d64e46c162b807e153f733b0233730 SHA256 dfe276618d5ef4e0148bee23c3edbb07e99afcba64a0d58df494932a527824ba
+AUX udev-start-133.sh 6228 RMD160 06b60d7214c0228560aa46a69de6dfe21ed0fd97 SHA1 01a0dd48be7eb170e560f1875311e5ae56feb754 SHA256 00110f6e6bfdbdf0edf76f25c162fd1d1103f8316b8808dfc023001cd6c74de1
+AUX udev-start-135-r2.sh 911 RMD160 929b1621e4512dc5f41b2c4b991a36d8a713f3bd SHA1 e594b8d8bfe0ae74d50bac379b777d1c6a0eeee0 SHA256 fac53ab852a95470a11d994fe54bb7883444c1e51b7f0c51bbdaf49093ab9b23
+AUX udev-start-135-r3.sh 1339 RMD160 106e7d2bb621977a0801f2ec0c6417bcf1f318ce SHA1 bc7b2abf23cb5643021a1a7e0de33c569344e0ad SHA256 6995a44262ea5cbf432658aebaa2e963cc34e23361b55a5921614b5d4fb06cdb
+AUX udev-stop-111-r2.sh 2389 RMD160 a3dcd87b999576f552c3a36f43513c68eabf40dd SHA1 a107387dfe9d0e5bbb470cc89186b49248b4e2a9 SHA256 41f0b053033ceaadf1e9334540c129a879aedb35de88f8aff0b3464009fa04fa
+AUX udev-stop-118-r2.sh 2160 RMD160 0c3c40fbe3f931a3a8a41b9bcc98b5d6f6592f45 SHA1 9327cd3f6fd805b198ca7f75dcc839a6ebd04066 SHA256 ebda8f0e744e842b2dc563e58ec9bb18f981c9003a4446fdf95cbbe90df5e62e
+AUX udev-stop-126.sh 2164 RMD160 339a3e5aeb9cdb0ad3be26491f7e00f2590ba522 SHA1 2f37fad8d3450238ddb1b411969af8b109e01f34 SHA256 6012cd0816b119606b0a5e49466b4042d9a0cdc6dc328f83067316abcb2a166c
+AUX udev-stop-135-r2.sh 231 RMD160 420955a1db5bfc7112b17f080ac84f867f7369b8 SHA1 b4f7ea6069d6ccebe43b1646fac3698c46743f4d SHA256 d20632b9508863962f64ef30e48e9dab99a4a6ccd074b9313f49c0f242cb5203
+AUX udev.conf.post_113 1084 RMD160 00b356c1be30a03d63bb25516d05eb4688642804 SHA1 4a55d0c0b75673f9863f87717978fcd70219119d SHA256 61ad09df9fbfbe382c7bf3c57eed2b546a324815e8c31bd52e1114b5b8e4eb1b
+AUX udev.conf.post_114 405 RMD160 9cb36e1c4fad99ed0d37952d54a6508bc3ad6428 SHA1 c01872ed68d8b0183aa7fb7e6c721e4408557347 SHA256 1d1ea52357d6318c9bc9f4b77e1509d700ef7576eb255e9be9112ea94685e6fb
+AUX udev.confd 205 RMD160 9a05cf33e0a59d087d647e2aa8b12cd2bea89a3d SHA1 8ed3b9a3a46595e1d7264249f91a645e2bac7968 SHA256 6620d2fba1e76101d67f1b45843f03d62c09089a786b37a8aa8035f1f115d6b6
+AUX udev.initd 1457 RMD160 81d4b42483b578027fce518f19a969a600aa07ce SHA1 609853ec8843b4ddfa18e19c041cc152106ec980 SHA256 8aad04741a9ca4ee9243de642afd9b053b286eaec7d7ae22551c709a0c46c0d3
+AUX write_root_link_rule 1064 RMD160 dae5cc41dc790d34a5d29320fa47411dd45547be SHA1 80e4d5de4b6a08ca263bc55981f2ff8065673eb4 SHA256 3c5b198b0aaf92f88e419f4d11f6e7c5da010d25ccc391b5f4aa600e33825a78
AUX write_root_link_rule-125 1086 RMD160 669f994678f306d97c79d585c615f56b026b1fa7 SHA1 309fd5155e8a010616adcb51a0b717887ba05ec3 SHA256 f8cff0e73ef40c6a9f642aba35136eac6e60d4cdfb54027aad59f6b770c01915
+DIST udev-124.tar.bz2 208381 RMD160 3a7affb0f11087fdb5d016d13add32b0442d13df SHA1 5b5426d8b9dc2e7a7b7602ba9fb8fca62e96d8ee SHA256 a497914660d9d9db9863dead25395fc944e934e8a7bef4a639f5b31d057a5542
DIST udev-140.tar.bz2 450894 RMD160 e3a0a6a7996d43fa8263b0e7ddc91a640d9faa37 SHA1 603c34d413e983659650f41cc6b95141b6a0d029 SHA256 869e015257457c58209d5aaae0c0f1f41d124c53601bb74e4dbb637442ea5b33
+EBUILD udev-124-r1.ebuild 10729 RMD160 b8c6b25eed9f38faac2381bcbbf6fea8fd640fd6 SHA1 b788ab75e9b1c5f9f3ff5e5f88c7e9021c1b975a SHA256 3a6c26d1343a95664f13a9299fc191c0025bad08da60444d9dcf589dfde2f2a6
EBUILD udev-140.ebuild 12313 RMD160 847d961d242d1f3353f58a6054e7cec7e5a064ef SHA1 2bd71ce025ae2a6d7b5aa541ffab6b4f3ef64f5a SHA256 399038e5cb99a0efc60749963916fb5151e054324b069eb1babe98d9a01963a1
diff --git a/sys-fs/udev/files/modprobe-114.sh b/sys-fs/udev/files/modprobe-114.sh
new file mode 100755
index 000000000..8e5d062dd
--- /dev/null
+++ b/sys-fs/udev/files/modprobe-114.sh
@@ -0,0 +1,93 @@
+#!/bin/sh
+
+# Do not continue for non-modular kernel - Bug #168322
+[ ! -f /proc/modules ] && exit 0
+
+if [ -e /dev/.udev_populate ]; then
+ # Enable verbose while called from udev-addon-start
+ . /dev/.udev_populate
+
+ if [ -c "${CONSOLE}" ]; then
+ # redirect stdin/out/err
+ exec <${CONSOLE} >${CONSOLE} 2>/${CONSOLE}
+ fi
+fi
+
+# set default if not present in udev.conf
+implicitly_blacklist_modules_autoload="yes"
+MODPROBE=/sbin/modprobe
+
+. /etc/init.d/functions.sh
+[ -e /etc/udev/udev.conf ] && . /etc/udev/udev.conf
+
+
+# Create a lock file for the current module.
+lock_modprobe() {
+ [ -e /dev/.udev/ ] || return 0
+
+ MODPROBE_LOCK="/dev/.udev/.lock-modprobe-${MODNAME}"
+
+ retry=20
+ while ! mkdir "$MODPROBE_LOCK" 2> /dev/null; do
+ if [ $retry -eq 0 ]; then
+ ewarn "Could not lock modprobe ${MODNAME}!"
+ return 1
+ fi
+ sleep 1
+ retry=$(($retry - 1))
+ done
+ return 0
+}
+
+unlock_modprobe() {
+ [ "$MODPROBE_LOCK" ] || return 0
+ rmdir "$MODPROBE_LOCK" || true
+}
+
+cleanup_exit() {
+ unlock_modprobe
+ exit "$@"
+}
+
+# Get normalized names only with _
+MODLIST=$("${MODPROBE}" -q -i --show-depends "${@}" 2>/dev/null \
+ | sed -e "s#^insmod /lib.*/\(.*\)\.ko.*#\1#g" -e 's|-|_|g')
+
+# exit if you have no modules to load
+[ -z "${MODLIST}" ] && exit 0
+for m in ${MODLIST}; do
+ MODNAME=$m
+done
+
+
+lock_modprobe
+
+if [ -d /sys/module/"${MODNAME}" ]; then
+ # already loaded
+ cleanup_exit 0
+fi
+
+# build regex to match module name written with either - or _
+MOD_REGEX="$(echo "${MODNAME}"|sed -e 's#_#[-_]#g')"
+
+# check for blacklisting
+if [ -f /etc/modprobe.conf ]; then
+ if grep -q '^blacklist.*[[:space:]]'"${MOD_REGEX}"'\([[:space:]]\|$\)' /etc/modprobe.conf; then
+ # module blacklisted
+ cleanup_exit 0
+ fi
+fi
+
+if [ "$implicitly_blacklist_modules_autoload" = "yes" -a -f "${MODULES_AUTOLOAD_FILE}" ]; then
+ if grep -q "^${MOD_REGEX}"'\([[:space:]]\|$\)' "${MODULES_AUTOLOAD_FILE}"; then
+ # module implictly blacklisted
+ # as present in modules.autoload, Bug 184833
+ cleanup_exit 0
+ fi
+fi
+
+# now do real loading
+einfo " udev loading module ${MODNAME}"
+"${MODPROBE}" -q "${@}" >/dev/null 2>/dev/null
+unlock_modprobe
+
diff --git a/sys-fs/udev/files/modprobe-115.sh b/sys-fs/udev/files/modprobe-115.sh
new file mode 100755
index 000000000..0425d625d
--- /dev/null
+++ b/sys-fs/udev/files/modprobe-115.sh
@@ -0,0 +1,102 @@
+#!/bin/sh
+
+# Do not continue for non-modular kernel - Bug #168322
+[ ! -f /proc/modules ] && exit 0
+
+if [ -e /dev/.udev_populate ]; then
+ # Enable verbose while called from udev-addon-start
+ . /dev/.udev_populate
+
+ if [ -c "${CONSOLE}" ]; then
+ # redirect stdin/out/err
+ exec <${CONSOLE} >${CONSOLE} 2>/${CONSOLE}
+ fi
+fi
+
+# set default if not present in udev.conf
+implicitly_blacklist_modules_autoload="yes"
+MODPROBE=/sbin/modprobe
+
+. /etc/init.d/functions.sh
+[ -e /etc/udev/udev.conf ] && . /etc/udev/udev.conf
+
+
+# Create a lock file for the current module.
+lock_modprobe() {
+ [ -e /dev/.udev/ ] || return 0
+
+ MODPROBE_LOCK="/dev/.udev/.lock-modprobe-${MODNAME}"
+
+ retry=20
+ while ! mkdir "$MODPROBE_LOCK" 2> /dev/null; do
+ if [ $retry -eq 0 ]; then
+ ewarn "Could not lock modprobe ${MODNAME}!"
+ return 1
+ fi
+ sleep 1
+ retry=$(($retry - 1))
+ done
+ return 0
+}
+
+unlock_modprobe() {
+ [ "$MODPROBE_LOCK" ] || return 0
+ rmdir "$MODPROBE_LOCK" || true
+ MODPROBE_LOCK=""
+}
+
+load_module() {
+ # Get normalized names only with _
+ local MODLIST=$("${MODPROBE}" -q -i --show-depends "${@}" 2>/dev/null \
+ | sed -e "s#^insmod /lib.*/\(.*\)\.ko.*#\1#g" -e 's|-|_|g')
+
+ # exit if you have no modules to load
+ [ -z "${MODLIST}" ] && return 0
+ local m
+ for m in ${MODLIST}; do
+ MODNAME=$m
+ done
+
+ lock_modprobe
+
+ if [ -d /sys/module/"${MODNAME}" ]; then
+ # already loaded
+ unlock_modprobe
+ return 0
+ fi
+
+ # build regex to match module name written with either - or _
+ MOD_REGEX="$(echo "${MODNAME}"|sed -e 's#_#[-_]#g')"
+
+ # check for blacklisting
+ if [ -f /etc/modprobe.conf ]; then
+ if grep -q '^blacklist.*[[:space:]]'"${MOD_REGEX}"'\([[:space:]]\|$\)' /etc/modprobe.conf; then
+ # module blacklisted
+ unlock_modprobe
+ return 0
+ fi
+ fi
+
+ if [ "$implicitly_blacklist_modules_autoload" = "yes" -a -f "${MODULES_AUTOLOAD_FILE}" ]; then
+ if grep -q "^${MOD_REGEX}"'\([[:space:]]\|$\)' "${MODULES_AUTOLOAD_FILE}"; then
+ # module implictly blacklisted
+ # as present in modules.autoload, Bug 184833
+ unlock_modprobe
+ return 0
+ fi
+ fi
+
+ # now do real loading
+ einfo " udev loading module ${MODNAME}"
+ "${MODPROBE}" -q "${@}" >/dev/null 2>/dev/null
+ unlock_modprobe
+}
+
+while [ -n "${1}" ]; do
+ case "${1}" in
+ --all|-a) ;;
+ *) load_module "${1}" ;;
+ esac
+ shift
+done
+
diff --git a/sys-fs/udev/files/net-104-r10.sh b/sys-fs/udev/files/net-104-r10.sh
new file mode 100755
index 000000000..f9f51aa11
--- /dev/null
+++ b/sys-fs/udev/files/net-104-r10.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# net.sh: udev external RUN script
+#
+# Copyright 2007 Roy Marples <uberlord@gentoo.org>
+# Distributed under the terms of the GNU General Public License v2
+
+IFACE=$1
+ACTION=$2
+
+SCRIPT=/etc/init.d/net.$IFACE
+
+# ignore interfaces that are registered after being "up" (?)
+case ${IFACE} in
+ ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*|ipsec*|tun*|tap*)
+ exit 0 ;;
+esac
+
+if [ ! -x "${SCRIPT}" ] ; then
+ logger -t udev-net.sh "${SCRIPT}: does not exist or is not executable"
+ exit 1
+fi
+
+# If we're stopping then sleep for a bit in-case a daemon is monitoring
+# the interface. This to try and ensure we stop after they do.
+[ "${ACTION}" == "stop" ] && sleep 2
+
+IN_HOTPLUG=1 "${SCRIPT}" --quiet "${ACTION}"
diff --git a/sys-fs/udev/files/net-118-r1.sh b/sys-fs/udev/files/net-118-r1.sh
new file mode 100755
index 000000000..bb8b2d64f
--- /dev/null
+++ b/sys-fs/udev/files/net-118-r1.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# net.sh: udev external RUN script
+#
+# Copyright 2007 Roy Marples <uberlord@gentoo.org>
+# Distributed under the terms of the GNU General Public License v2
+
+IFACE=$1
+ACTION=$2
+
+SCRIPT=/etc/init.d/net.$IFACE
+
+# ignore interfaces that are registered after being "up" (?)
+case ${IFACE} in
+ ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*|ipsec*|tun*|tap*)
+ exit 0 ;;
+esac
+
+# stop here if coldplug is disabled, Bug #206518
+if [ "${do_not_run_plug_service}" = 1 ]; then
+ exit 0
+fi
+
+if [ ! -x "${SCRIPT}" ] ; then
+ #do not flood log with messages, bug #205687
+ #logger -t udev-net.sh "${SCRIPT}: does not exist or is not executable"
+ exit 1
+fi
+
+# If we're stopping then sleep for a bit in-case a daemon is monitoring
+# the interface. This to try and ensure we stop after they do.
+[ "${ACTION}" == "stop" ] && sleep 2
+
+IN_HOTPLUG=1 "${SCRIPT}" --quiet "${ACTION}"
diff --git a/sys-fs/udev/files/shell-compat-118-r2.sh b/sys-fs/udev/files/shell-compat-118-r2.sh
new file mode 100644
index 000000000..0b91bf5dc
--- /dev/null
+++ b/sys-fs/udev/files/shell-compat-118-r2.sh
@@ -0,0 +1,57 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+cmd_exist()
+{
+ type "$1" >/dev/null 2>&1
+}
+
+if ! cmd_exist yesno; then
+ yesno() {
+ [ -z "$1" ] && return 1
+ case "$1" in
+ yes|Yes|YES) return 0 ;;
+ esac
+ return 1
+ }
+fi
+
+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
+
+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
+
+if ! cmd_exist fstabinfo; then
+ # we only query /dev, so ignore all args
+ fstabinfo() {
+ yesno "${RC_USE_FSTAB}"
+ }
+fi
+
diff --git a/sys-fs/udev/files/shell-compat-118-r3.sh b/sys-fs/udev/files/shell-compat-118-r3.sh
new file mode 100644
index 000000000..479dd9db5
--- /dev/null
+++ b/sys-fs/udev/files/shell-compat-118-r3.sh
@@ -0,0 +1,75 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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 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
+
+# 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/udev-110-root-link-1.diff b/sys-fs/udev/files/udev-110-root-link-1.diff
new file mode 100644
index 000000000..c8813d104
--- /dev/null
+++ b/sys-fs/udev/files/udev-110-root-link-1.diff
@@ -0,0 +1,148 @@
+diff --git a/extras/root_link/Makefile b/extras/root_link/Makefile
+new file mode 100644
+index 0000000..76b475d
+--- /dev/null
++++ b/extras/root_link/Makefile
+@@ -0,0 +1,69 @@
++# Makefile for udev extra invoked from the udev main Makefile
++#
++# Copyright (C) 2004-2005 Kay Sievers <kay.sievers@vrfy.org>
++#
++# Released under the GNU General Public License, version 2.
++#
++
++PROG = get_dir_major_minor
++OBJ =
++HEADERS =
++GEN_HEADERS =
++MAN_PAGES =
++
++prefix =
++etcdir = ${prefix}/etc
++sbindir = ${prefix}/sbin
++usrbindir = ${prefix}/usr/bin
++usrsbindir = ${prefix}/usr/sbin
++libudevdir = ${prefix}/lib/udev
++mandir = ${prefix}/usr/share/man
++configdir = ${etcdir}/udev/
++
++INSTALL = install -c
++INSTALL_PROGRAM = ${INSTALL}
++INSTALL_DATA = ${INSTALL} -m 644
++INSTALL_SCRIPT = ${INSTALL}
++
++all: $(PROG) $(MAN_PAGES)
++.PHONY: all
++.DEFAULT: all
++
++%.o: %.c $(GEN_HEADERS)
++ $(E) " CC " $@
++ $(Q) $(CC) -c $(CFLAGS) $< -o $@
++
++$(PROG): %: $(HEADERS) %.o $(OBJS)
++ $(E) " LD " $@
++ $(Q) $(LD) $(LDFLAGS) $@.o $(OBJS) -o $@ $(LIBUDEV) $(LIB_OBJS)
++
++# man pages
++%.8: %.xml
++ $(E) " XMLTO " $@
++ $(Q) xmlto man $?
++.PRECIOUS: %.8
++
++clean:
++ $(E) " CLEAN "
++ $(Q) rm -f $(PROG) $(OBJS) $(GEN_HEADERS)
++.PHONY: clean
++
++install-bin: all
++ $(INSTALL_PROGRAM) -D $(PROG) $(DESTDIR)$(libudevdir)/$(PROG)
++.PHONY: install-bin
++
++uninstall-bin:
++ - rm $(DESTDIR)$(libudevdir)/$(PROG)
++.PHONY: uninstall-bin
++
++install-man:
++ @echo "Please create a man page for this tool."
++.PHONY: install-man
++
++uninstall-man:
++ @echo "Please create a man page for this tool."
++.PHONY: uninstall-man
++
++install-config:
++ @echo "no config file to install"
++.PHONY: install-config
+diff --git a/extras/root_link/get_dir_major_minor.c b/extras/root_link/get_dir_major_minor.c
+new file mode 100644
+index 0000000..1e39411
+--- /dev/null
++++ b/extras/root_link/get_dir_major_minor.c
+@@ -0,0 +1,48 @@
++// print out major/minor nr of the device the supplied dir
++// is mounted on
++//
++// Author: Matthias Schwarzott <zzam@gentoo.org>
++
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <unistd.h>
++
++#include <stdio.h>
++#include <stdlib.h>
++
++// Getting major/minor
++#include <sys/sysmacros.h>
++int main(int argc, char **argv)
++{
++ struct stat stat_buf;
++ unsigned int dev_major=0, dev_minor=0;
++ dev_t dev;
++
++ if (argc != 2) {
++ printf("Usage:\n");
++ printf(" get_dir_major_minor <directory>\n");
++ return EXIT_FAILURE;
++ }
++
++ if (stat(argv[1], &stat_buf) < 0) {
++ perror("stat");
++ return EXIT_FAILURE;
++ }
++
++ dev = stat_buf.st_dev;
++
++ dev_major = gnu_dev_major(dev);
++ dev_minor = gnu_dev_minor(dev);
++
++
++ if (dev_major == 0) {
++ fprintf(stderr, "Major number is 0.\n");
++ return EXIT_FAILURE;
++ } else
++ printf("%d %d\n",
++ dev_major,
++ dev_minor);
++
++ return EXIT_SUCCESS;
++}
++
+diff --git a/extras/root_link/print_root_link_rule.sh b/extras/root_link/print_root_link_rule.sh
+new file mode 100755
+index 0000000..c33f290
+--- /dev/null
++++ b/extras/root_link/print_root_link_rule.sh
+@@ -0,0 +1,13 @@
++#!/bin/sh
++
++PROG=/lib/udev/print_dir_major_minor
++[ -x "${PROG}" ] && DEV=$(/lib/udev/print_dir_major_minor /)
++if [ $? == 0 ]; then
++ MAJOR="${DEV##* }"
++ MINOR="${DEV%% *}"
++
++ echo "# Created by print_root_link_rule"
++ echo "# This rule should create /dev/root as link to real root device."
++ echo "SUBSYSTEM==\"block\", ENV{MAJOR}==\"$MAJOR\", ENV{MINOR}==\"$MINOR\", SYMLINK+=\"root\""
++fi
++
diff --git a/sys-fs/udev/files/udev-114-root-link-2.diff b/sys-fs/udev/files/udev-114-root-link-2.diff
new file mode 100644
index 000000000..5bd61a2d8
--- /dev/null
+++ b/sys-fs/udev/files/udev-114-root-link-2.diff
@@ -0,0 +1,164 @@
+diff -ruN udev-git/extras/root_link/get_dir_major_minor.c udev-git-try/extras/root_link/get_dir_major_minor.c
+--- udev-git/extras/root_link/get_dir_major_minor.c 1970-01-01 01:00:00.000000000 +0100
++++ udev-git-try/extras/root_link/get_dir_major_minor.c 2007-08-16 16:08:30.000000000 +0200
+@@ -0,0 +1,52 @@
++// print out major/minor nr of the device the supplied dir
++// is mounted on
++//
++// This program is free software; you can redistribute it and/or modify it
++// under the terms of the GNU General Public License as published by the
++// Free Software Foundation version 2 of the License.
++//
++// (c) 2007 Matthias Schwarzott <zzam@gentoo.org>
++
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <unistd.h>
++
++#include <stdio.h>
++#include <stdlib.h>
++
++// Getting major/minor
++#include <sys/sysmacros.h>
++int main(int argc, char **argv)
++{
++ struct stat stat_buf;
++ unsigned int dev_major=0, dev_minor=0;
++ dev_t dev;
++
++ if (argc != 2) {
++ printf("Usage:\n");
++ printf(" get_dir_major_minor <directory>\n");
++ return EXIT_FAILURE;
++ }
++
++ if (stat(argv[1], &stat_buf) < 0) {
++ perror("stat");
++ return EXIT_FAILURE;
++ }
++
++ dev = stat_buf.st_dev;
++
++ dev_major = gnu_dev_major(dev);
++ dev_minor = gnu_dev_minor(dev);
++
++
++ if (dev_major == 0) {
++ fprintf(stderr, "Major number is 0.\n");
++ return EXIT_FAILURE;
++ } else
++ printf("%d %d\n",
++ dev_major,
++ dev_minor);
++
++ return EXIT_SUCCESS;
++}
++
+diff -ruN udev-git/extras/root_link/Makefile udev-git-try/extras/root_link/Makefile
+--- udev-git/extras/root_link/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ udev-git-try/extras/root_link/Makefile 2007-08-16 15:52:01.000000000 +0200
+@@ -0,0 +1,70 @@
++# Makefile for udev extra invoked from the udev main Makefile
++#
++# Copyright (C) 2004-2005 Kay Sievers <kay.sievers@vrfy.org>
++#
++# Released under the GNU General Public License, version 2.
++#
++
++PROG = get_dir_major_minor
++OBJ =
++HEADERS =
++GEN_HEADERS =
++MAN_PAGES =
++
++prefix =
++etcdir = ${prefix}/etc
++sbindir = ${prefix}/sbin
++usrbindir = ${prefix}/usr/bin
++usrsbindir = ${prefix}/usr/sbin
++libudevdir = ${prefix}/lib/udev
++mandir = ${prefix}/usr/share/man
++configdir = ${etcdir}/udev/
++
++INSTALL = install -c
++INSTALL_PROGRAM = ${INSTALL}
++INSTALL_DATA = ${INSTALL} -m 644
++INSTALL_SCRIPT = ${INSTALL}
++
++all: $(PROG) $(MAN_PAGES)
++.PHONY: all
++.DEFAULT: all
++
++%.o: %.c $(GEN_HEADERS)
++ $(E) " CC " $@
++ $(Q) $(CC) -c $(CFLAGS) $< -o $@
++
++$(PROG): %: $(HEADERS) %.o $(OBJS)
++ $(E) " LD " $@
++ $(Q) $(LD) $(LDFLAGS) $@.o $(OBJS) -o $@ $(LIBUDEV) $(LIB_OBJS)
++
++# man pages
++%.8: %.xml
++ $(E) " XMLTO " $@
++ $(Q) xmlto man $?
++.PRECIOUS: %.8
++
++clean:
++ $(E) " CLEAN "
++ $(Q) rm -f $(PROG) $(OBJS) $(GEN_HEADERS)
++.PHONY: clean
++
++install-bin: all
++ $(INSTALL_PROGRAM) -D $(PROG) $(DESTDIR)$(libudevdir)/$(PROG)
++ $(INSTALL_PROGRAM) -D write_root_link_rule $(DESTDIR)$(libudevdir)/
++.PHONY: install-bin
++
++uninstall-bin:
++ - rm $(DESTDIR)$(libudevdir)/$(PROG)
++.PHONY: uninstall-bin
++
++install-man:
++ @echo "Please create a man page for this tool."
++.PHONY: install-man
++
++uninstall-man:
++ @echo "Please create a man page for this tool."
++.PHONY: uninstall-man
++
++install-config:
++ @echo "no config file to install"
++.PHONY: install-config
+diff -ruN udev-git/extras/root_link/write_root_link_rule udev-git-try/extras/root_link/write_root_link_rule
+--- udev-git/extras/root_link/write_root_link_rule 1970-01-01 01:00:00.000000000 +0100
++++ udev-git-try/extras/root_link/write_root_link_rule 2007-08-16 16:12:23.000000000 +0200
+@@ -0,0 +1,30 @@
++#!/bin/sh
++#
++# This script should run before doing udevtrigger at boot.
++# It will create a rule matching the device directory / is on, and
++# creating /dev/root symlink pointing on its device node.
++#
++# This is especially useful for hal looking at /proc/mounts containing
++# a line listing /dev/root as device:
++# /dev/root / reiserfs rw 0 0
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU General Public License as published by the
++# Free Software Foundation version 2 of the License.
++#
++# (c) 2007 Matthias Schwarzott <zzam@gentoo.org>
++
++PROG=/lib/udev/get_dir_major_minor
++[ -x "${PROG}" ] && DEV=$(${PROG} "/")
++if [ $? = 0 ]; then
++ MAJOR="${DEV% *}"
++ MINOR="${DEV#* }"
++
++ [ -d /dev/.udev/rules.d ] || mkdir -p /dev/.udev/rules.d
++ RULES=/dev/.udev/rules.d/10-root-link.rules
++
++ echo "# Created by /lib/udev/write_root_link_rule" > "${RULES}"
++ echo "# This rule should create /dev/root as link to real root device." >> "${RULES}"
++ echo "SUBSYSTEM==\"block\", ENV{MAJOR}==\"$MAJOR\", ENV{MINOR}==\"$MINOR\", SYMLINK+=\"root\"" >> "${RULES}"
++fi
++
diff --git a/sys-fs/udev/files/udev-122-rules-update.diff b/sys-fs/udev/files/udev-122-rules-update.diff
new file mode 100644
index 000000000..cd4b7ca57
--- /dev/null
+++ b/sys-fs/udev/files/udev-122-rules-update.diff
@@ -0,0 +1,13 @@
+Index: udev-git/etc/udev/gentoo/65-permissions.rules
+===================================================================
+--- udev-git.orig/etc/udev/gentoo/65-permissions.rules
++++ udev-git/etc/udev/gentoo/65-permissions.rules
+@@ -15,7 +15,7 @@ KERNEL=="st[0-9]*|nst[0-9]*|ht[0-9]*|nht
+ SUBSYSTEMS=="scsi", KERNEL=="sg[0-9]*", ATTRS{type}=="[18]", GROUP="tape", MODE="660"
+
+ # dialout devices
+-KERNEL=="ippp*|isdn*|dcbri*|capi*", GROUP="uucp"
++KERNEL=="ippp*|isdn*|dcbri*|capi*|rfcomm*|ttyACM[0-9]*", GROUP="uucp"
+ KERNEL=="pilot", GROUP="uucp"
+
+ # sound devices (sound=alsa, snd=oss)
diff --git a/sys-fs/udev/files/udev-124-cdrom-autoclose-bug.diff b/sys-fs/udev/files/udev-124-cdrom-autoclose-bug.diff
new file mode 100644
index 000000000..165c06c69
--- /dev/null
+++ b/sys-fs/udev/files/udev-124-cdrom-autoclose-bug.diff
@@ -0,0 +1,27 @@
+commit f755fd5657b619fd27160ad202fc5d773d096e9c
+Author: Kay Sievers <kay.sievers@vrfy.org>
+Date: Sat Aug 2 10:26:48 2008 +0200
+
+ rules: run vol_id on opticals only if media is found
+
+ Opening an optical drive device node without O_NONBLOCK autocloses the
+ tray, we run vol_id on every media change by kernel emitted "change"
+ events, which can make it hard to change the media when the tray closes
+ immediatey again.:) We check for cdrom_id to indicate an existing track,
+ if no media is found, we will not open the device with vol_id.
+
+ Thanks to Christian Krause and DavidZ for debugging and testing.
+
+diff --git a/etc/udev/rules.d/60-persistent-storage.rules b/etc/udev/rules.d/60-persistent-storage.rules
+index 5ae0c7f..097e864 100644
+--- a/etc/udev/rules.d/60-persistent-storage.rules
++++ b/etc/udev/rules.d/60-persistent-storage.rules
+@@ -52,6 +52,8 @@ ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PA
+
+ # skip unpartitioned removable media devices from drivers which do not send "change" events
+ ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end"
++# skip optical drives without media
++ENV{DEVTYPE}=="disk", KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT}!="?*", GOTO="persistent_storage_end"
+
+ # import filesystem metadata
+ IMPORT{program}="vol_id --export $tempnode"
diff --git a/sys-fs/udev/files/udev-125-cdrom-autoclose-bug.diff b/sys-fs/udev/files/udev-125-cdrom-autoclose-bug.diff
new file mode 100644
index 000000000..f61bad33a
--- /dev/null
+++ b/sys-fs/udev/files/udev-125-cdrom-autoclose-bug.diff
@@ -0,0 +1,27 @@
+commit f755fd5657b619fd27160ad202fc5d773d096e9c
+Author: Kay Sievers <kay.sievers@vrfy.org>
+Date: Sat Aug 2 10:26:48 2008 +0200
+
+ rules: run vol_id on opticals only if media is found
+
+ Opening an optical drive device node without O_NONBLOCK autocloses the
+ tray, we run vol_id on every media change by kernel emitted "change"
+ events, which can make it hard to change the media when the tray closes
+ immediatey again.:) We check for cdrom_id to indicate an existing track,
+ if no media is found, we will not open the device with vol_id.
+
+ Thanks to Christian Krause and DavidZ for debugging and testing.
+
+diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules
+index 5ae0c7f..097e864 100644
+--- a/rules/rules.d/60-persistent-storage.rules
++++ b/rules/rules.d/60-persistent-storage.rules
+@@ -52,6 +52,8 @@ ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PA
+
+ # skip unpartitioned removable media devices from drivers which do not send "change" events
+ ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end"
++# skip optical drives without media
++ENV{DEVTYPE}=="disk", KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT}!="?*", GOTO="persistent_storage_end"
+
+ # import filesystem metadata
+ IMPORT{program}="vol_id --export $tempnode"
diff --git a/sys-fs/udev/files/udev-125-rules-update.diff b/sys-fs/udev/files/udev-125-rules-update.diff
new file mode 100644
index 000000000..a063ce745
--- /dev/null
+++ b/sys-fs/udev/files/udev-125-rules-update.diff
@@ -0,0 +1,13 @@
+Index: udev-git/rules/gentoo/65-permissions.rules
+===================================================================
+--- udev-git.orig/rules/gentoo/65-permissions.rules
++++ udev-git/rules/gentoo/65-permissions.rules
+@@ -15,7 +15,7 @@ KERNEL=="st[0-9]*|nst[0-9]*|ht[0-9]*|nht
+ SUBSYSTEMS=="scsi", KERNEL=="sg[0-9]*", ATTRS{type}=="[18]", GROUP="tape", MODE="660"
+
+ # dialout devices
+-KERNEL=="ippp*|isdn*|dcbri*|capi*", GROUP="uucp"
++KERNEL=="ippp*|isdn*|dcbri*|capi*|rfcomm*|ttyACM[0-9]*", GROUP="uucp"
+ KERNEL=="pilot", GROUP="uucp"
+
+ # sound devices (sound=alsa, snd=oss)
diff --git a/sys-fs/udev/files/udev-133-rules-update.diff b/sys-fs/udev/files/udev-133-rules-update.diff
new file mode 100644
index 000000000..2861a8322
--- /dev/null
+++ b/sys-fs/udev/files/udev-133-rules-update.diff
@@ -0,0 +1,70 @@
+diff --git a/rules/gentoo/30-kernel-compat.rules b/rules/gentoo/30-kernel-compat.rules
+index 1f767df..d07e7fa 100644
+--- a/rules/gentoo/30-kernel-compat.rules
++++ b/rules/gentoo/30-kernel-compat.rules
+@@ -1,9 +1,17 @@
+ # do not edit this file, it will be overwritten on update
+
+-ACTION!="add", GOTO="kernel_compat_end"
++ACTION!="add|change", GOTO="kernel_compat_end"
++
++#
++# rules to workaround bad sysfs timing
++#
++
++ACTION!="add", GOTO="kernel_compat_wait_end"
+
+ # workarounds needed to synchronize with sysfs
++# needed for kernels < v2.6.18-rc1
+ DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus"
++SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", WAIT_FOR_SYSFS="ioerr_cnt"
+
+ # needed for kernels <2.6.16
+ SUBSYSTEM=="net", WAIT_FOR_SYSFS="address"
+@@ -11,13 +19,29 @@ SUBSYSTEM=="net", WAIT_FOR_SYSFS="address"
+ # needed for kernels <2.6.17
+ SUBSYSTEM=="net", ENV{PHYSDEVDRIVER}=="?*", WAIT_FOR_SYSFS="device/driver"
+
++LABEL="kernel_compat_wait_end"
+
++#
++# naming device rules
++#
+
++# old style usb sysfs devices
+ # needed for kernels <2.6.22
+ SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", GROUP="usb", MODE="0664"
+
++# /sys/class/block will export this
++# needed for kernels <2.6.25-rc1
++SUBSYSTEM!="block", GOTO="block_devtype_end"
++ENV{DEVTYPE}!="?*", ATTR{range}=="?*", ENV{DEVTYPE}="disk"
++ENV{DEVTYPE}!="?*", ATTR{start}=="?*", ENV{DEVTYPE}="partition"
++LABEL="block_devtype_end"
+
+
++#
++# module loading rules
++#
++ACTION!="add", GOTO="kernel_compat_end"
++
+ # this driver is broken and should not be loaded automatically
+ # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=398962
+ # needed for kernels <2.6.21
+@@ -26,6 +50,11 @@ SUBSYSTEM=="platform", ENV{MODALIAS}=="i82365", ENV{MODALIAS}=""
+ # No need for more code, as MODALIAS is present
+ ENV{MODALIAS}=="?*", GOTO="kernel_compat_end"
+
++# needed for kernel <2.6.27-rc5
++# acpi will do on newer kernels
++SUBSYSTEM=="pnp", DRIVER!="?*", \
++ RUN{ignore_error}+="/bin/sh -c '/sbin/modprobe -a $$(while read id; do echo pnp:d$$id; done < /sys$devpath/id)'"
++
+ # needed for kernels <2.6.22
+ SUBSYSTEM!="scsi_device", GOTO="kernel_compat_end"
+
+@@ -44,4 +73,3 @@ SUBSYSTEM!="scsi_device", GOTO="kernel_compat_end"
+
+ LABEL="kernel_compat_end"
+
+-
diff --git a/sys-fs/udev/files/udev-133-silence-physdev-warnings.diff b/sys-fs/udev/files/udev-133-silence-physdev-warnings.diff
new file mode 100644
index 000000000..1ae1c56b7
--- /dev/null
+++ b/sys-fs/udev/files/udev-133-silence-physdev-warnings.diff
@@ -0,0 +1,42 @@
+commit ae2d346642aee4fab33c88708627bcf5b0cb317d
+Author: Kay Sievers <kay.sievers@vrfy.org>
+Date: Mon Nov 24 21:24:04 2008 +0100
+
+ silence PHYSDEV* warning for WAIT_FOR* rules
+
+diff --git a/udev/udev-rules.c b/udev/udev-rules.c
+index df9fc78..afd2e88 100644
+--- a/udev/udev-rules.c
++++ b/udev/udev-rules.c
+@@ -1135,6 +1135,7 @@ static int add_rule(struct udev_rules *rules, char *line,
+ char *linepos;
+ char *attr;
+ int physdev = 0;
++ int waitfor = 0;
+ struct rule_tmp rule_tmp;
+
+ memset(&rule_tmp, 0x00, sizeof(struct rule_tmp));
+@@ -1395,6 +1396,7 @@ static int add_rule(struct udev_rules *rules, char *line,
+ if (strcasecmp(key, "WAIT_FOR") == 0 || strcasecmp(key, "WAIT_FOR_SYSFS") == 0) {
+ rule_add_key(&rule_tmp, TK_M_WAITFOR, 0, value, NULL);
+ valid = 1;
++ waitfor = 1;
+ continue;
+ }
+
+@@ -1544,11 +1546,11 @@ static int add_rule(struct udev_rules *rules, char *line,
+ err(rules->udev, "unknown key '%s' in %s:%u\n", key, filename, lineno);
+ }
+
+- if (physdev)
+- err(rules->udev, "PHYSDEV* values are deprecated and not available on recent kernels, \n"
+- "please fix it in %s:%u", filename, lineno);
++ if (physdev && !waitfor)
++ err(rules->udev, "PHYSDEV* values are deprecated and not available on recent kernels, "
++ "please fix it in %s:%u\n", filename, lineno);
+
+- /* skip line if not any valid key was found */
++ /* skip line if no valid key was found */
+ if (!valid)
+ goto invalid;
+
diff --git a/sys-fs/udev/files/udev-135-fix-capi.diff b/sys-fs/udev/files/udev-135-fix-capi.diff
new file mode 100644
index 000000000..ec5bc29bb
--- /dev/null
+++ b/sys-fs/udev/files/udev-135-fix-capi.diff
@@ -0,0 +1,29 @@
+commit 1ac8fad8e56097cf8e08a0a17f044309317cb50f
+Author: Kay Sievers <kay.sievers@vrfy.org>
+Date: Wed Dec 3 01:32:00 2008 +0100
+
+ rules: fix isdn rules
+
+ On Tue, Dec 2, 2008 at 21:07, Matthias Schwarzott <zzam@gentoo.org> wrote:
+ > It seems that the rules related to capi devices are not correct:
+ >
+ > KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20"
+ > KERNEL=="capi*", NAME="capi/%n"
+ >
+ > Changing the second rule to match only on KERNEL=="capi[0-9]*" is reported to
+ > make it work.
+ > So I can only guess that the problem is the second rule overwriting the NAME
+ > set by the first one.
+
+diff --git a/rules/packages/40-isdn.rules b/rules/packages/40-isdn.rules
+index f2bc34e..8a4686f 100644
+--- a/rules/packages/40-isdn.rules
++++ b/rules/packages/40-isdn.rules
+@@ -1,5 +1,4 @@
+ # do not edit this file, it will be overwritten on update
+
+-SUBSYSTEM=="capi", GROUP="uucp"
+-KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20"
+-KERNEL=="capi*", NAME="capi/%n"
++SUBSYSTEM=="capi", KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20", GROUP="uucp"
++SUBSYSTEM=="tty", KERNEL=="capi[0-9]*", NAME="capi/%n"
diff --git a/sys-fs/udev/files/udev-135-fix-dri-perms.diff b/sys-fs/udev/files/udev-135-fix-dri-perms.diff
new file mode 100644
index 000000000..dd9d31a3a
--- /dev/null
+++ b/sys-fs/udev/files/udev-135-fix-dri-perms.diff
@@ -0,0 +1,20 @@
+commit 66d9b44f8302efe383ada6a52d8431655614bf76
+Author: Kay Sievers <kay.sievers@vrfy.org>
+Date: Thu Jan 15 17:06:14 2009 +0100
+
+ rules: add drm devices to group "video"
+
+ https://bugs.launchpad.net/bugs/317430
+
+diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules
+index 7730f0d..95d82d7 100644
+--- a/rules/rules.d/50-udev-default.rules
++++ b/rules/rules.d/50-udev-default.rules
+@@ -38,6 +38,7 @@ KERNEL=="card[0-9]*", NAME="dri/%k"
+ KERNEL=="pmu", GROUP="video"
+ KERNEL=="nvidia*|nvidiactl*", GROUP="video"
+ SUBSYSTEM=="graphics", GROUP="video"
++SUBSYSTEM=="drm", GROUP="video"
+
+ # DVB (video)
+ SUBSYSTEM=="dvb", ENV{DVB_ADAPTER_NUM}=="?*", NAME="dvb/adapter$env{DVB_ADAPTER_NUM}/$env{DVB_DEVICE_TYPE}$env{DVB_DEVICE_NUM}", GROUP="video"
diff --git a/sys-fs/udev/files/udev-135-r2.confd b/sys-fs/udev/files/udev-135-r2.confd
new file mode 100644
index 000000000..d26a4f67e
--- /dev/null
+++ b/sys-fs/udev/files/udev-135-r2.confd
@@ -0,0 +1,16 @@
+# /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"
diff --git a/sys-fs/udev/files/udev-135-r2.initd b/sys-fs/udev/files/udev-135-r2.initd
new file mode 100644
index 000000000..7bad67f15
--- /dev/null
+++ b/sys-fs/udev/files/udev-135-r2.initd
@@ -0,0 +1,209 @@
+#!/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
+. /lib/udev/shell-compat.sh
+
+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-135-r3.confd b/sys-fs/udev/files/udev-135-r3.confd
new file mode 100644
index 000000000..4abfa9116
--- /dev/null
+++ b/sys-fs/udev/files/udev-135-r3.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/udev-135-rules-update.diff b/sys-fs/udev/files/udev-135-rules-update.diff
new file mode 100644
index 000000000..b28d26a29
--- /dev/null
+++ b/sys-fs/udev/files/udev-135-rules-update.diff
@@ -0,0 +1,14 @@
+Index: udev-git/rules/gentoo/40-gentoo.rules
+===================================================================
+--- udev-git.orig/rules/gentoo/40-gentoo.rules
++++ udev-git/rules/gentoo/40-gentoo.rules
+@@ -1,9 +1,5 @@
+ # do not edit this file, it will be overwritten on update
+
+-# capi devices
+-KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20"
+-KERNEL=="capi*", NAME="capi/%n"
+-
+ # old devfs path, removing this could break systems
+ # Bug 195839
+ KERNEL=="md[0-9]*", SYMLINK+="md/%n"
diff --git a/sys-fs/udev/files/udev-dev-tarball-135-r2.initd b/sys-fs/udev/files/udev-dev-tarball-135-r2.initd
new file mode 100755
index 000000000..2cdce4ff2
--- /dev/null
+++ b/sys-fs/udev/files/udev-dev-tarball-135-r2.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/udev-fix-udevinfo-in-doc.diff b/sys-fs/udev/files/udev-fix-udevinfo-in-doc.diff
new file mode 100644
index 000000000..cf9716ee3
--- /dev/null
+++ b/sys-fs/udev/files/udev-fix-udevinfo-in-doc.diff
@@ -0,0 +1,135 @@
+commit 04f2a4fb6eded359cc8be1ba4ce33d7f7db6919f
+Author: Miklos Vajna <vmiklos@frugalware.org>
+Date: Fri Jan 23 03:55:24 2009 +0100
+
+ doc: writing udev rules - refer to 'udevadm info' instead of 'udevinfo'
+
+ Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
+
+diff --git a/docs/writing_udev_rules/index.html b/docs/writing_udev_rules/index.html
+index 5fedb3f..ca4fb9d 100644
+--- a/docs/writing_udev_rules/index.html
++++ b/docs/writing_udev_rules/index.html
+@@ -52,7 +52,7 @@ The most recent version of this document can always be found at: <br />
+ <li>Finding suitable information from sysfs
+ <ul>
+ <li><a href="#sysfstree">The sysfs tree</a></li>
+- <li><a href="#udevinfo">udevinfo</a></li>
++ <li><a href="#udevadm">udevadm info</a></li>
+ <li><a href="#sysfsalt">Alternative methods</a></li>
+ </ul>
+ </li>
+@@ -429,15 +429,15 @@ In a udev rule, I could use ATTR{size}=="234441648" to identify this disk. As ud
+ Although this serves as a useful introduction as to the structure of sysfs and exactly how udev matches values, manually trawling through sysfs is both time consuming and unnecessary.
+ </p>
+
+-<a name="udevinfo"></a>
+-<h3>udevinfo</h3>
++<a name="udevadm"></a>
++<h3>udevadm info</h3>
+
+ <p>
+-Enter <em>udevinfo</em>, which is probably the most straightforward tool you can use to construct rules. All you need to know is the sysfs device path of the device in question. A trimmed example is shown below:
++Enter <em>udevadm info</em>, which is probably the most straightforward tool you can use to construct rules. All you need to know is the sysfs device path of the device in question. A trimmed example is shown below:
+ </p>
+
+ <blockquote><pre>
+-# udevinfo -a -p /sys/block/sda
++# udevadm info -a -p /sys/block/sda
+
+ <span class="green"> looking at device '/block/sda':
+ KERNEL=="sda"
+@@ -476,7 +476,7 @@ Enter <em>udevinfo</em>, which is probably the most straightforward tool you can
+ </pre></blockquote>
+
+ <p>
+-As you can see, udevinfo simply produces a list of attributes you can use as-is as match keys in your udev rules. From the above example, I could produce (e.g.) either of the following two rules for this device:
++As you can see, udevadm info simply produces a list of attributes you can use as-is as match keys in your udev rules. From the above example, I could produce (e.g.) either of the following two rules for this device:
+ </p>
+
+ <blockquote><pre>
+@@ -495,24 +495,24 @@ You are usually provided with a large number of attributes, and you must pick a
+ </p>
+
+ <p>
+-Observe the effects of hierarchy in the udevinfo output. The <span class="green">green</span> section corresponding to the device in question uses the standard match keys such as KERNEL and ATTR. The <span class="blue">blue</span> and <span class="maroon">maroon</span> sections corresponding to parent devices use the parent-traversing variants such as SUBSYSTEMS and ATTRS. This is why the complexity introduced by the hierarchical structure is actually quite easy to deal with, just be sure to use the exact values that udevinfo suggests.
++Observe the effects of hierarchy in the udevadm info output. The <span class="green">green</span> section corresponding to the device in question uses the standard match keys such as KERNEL and ATTR. The <span class="blue">blue</span> and <span class="maroon">maroon</span> sections corresponding to parent devices use the parent-traversing variants such as SUBSYSTEMS and ATTRS. This is why the complexity introduced by the hierarchical structure is actually quite easy to deal with, just be sure to use the exact values that udevadm info suggests.
+ </p>
+
+ <p>
+-Another point to note is that it is common for text attributes to appear in the udevinfo output to be padded with spaces (e.g. see ST3120827AS above). In your rules, you can either specify the extra spaces, or you can cut them off as I have done.
++Another point to note is that it is common for text attributes to appear in the udevadm info output to be padded with spaces (e.g. see ST3120827AS above). In your rules, you can either specify the extra spaces, or you can cut them off as I have done.
+ </p>
+
+ <p>
+-The only complication with using udevinfo is that you are required to know the top-level device path (/sys/block/sda in the example above). This is not always obvious. However, as you are generally writing rules for device nodes which already exist, you can use udevinfo to look up the device path for you:
++The only complication with using udevadm info is that you are required to know the top-level device path (/sys/block/sda in the example above). This is not always obvious. However, as you are generally writing rules for device nodes which already exist, you can use udevadm info to look up the device path for you:
+ </p>
+
+-<blockquote><pre># udevinfo -a -p $(udevinfo -q path -n /dev/sda)</pre></blockquote>
++<blockquote><pre># udevadm info -a -p $(udevadm info -q path -n /dev/sda)</pre></blockquote>
+
+ <a name="sysfsalt"></a>
+ <h3>Alternative methods</h3>
+
+ <p>
+-Although udevinfo is almost certainly the most straightforward way of listing the exact attributes you can build rules from, some users are happier with other tools. Utilities such as <a href="http://www.kroah.com/linux/usb/">usbview</a> display a similar set of information, most of which can be used in rules.
++Although udevadm info is almost certainly the most straightforward way of listing the exact attributes you can build rules from, some users are happier with other tools. Utilities such as <a href="http://www.kroah.com/linux/usb/">usbview</a> display a similar set of information, most of which can be used in rules.
+ </p>
+
+ <h2>Advanced topics</h2>
+@@ -659,11 +659,11 @@ For example, the rule below sets the group ownership on my hard disk node, and e
+ <h3>USB Printer</h3>
+
+ <p>
+-I power on my printer, and it is assigned device node <em>/dev/lp0</em>. Not satisfied with such a bland name, I decide to use udevinfo to aid me in writing a rule which will provide an alternative name:
++I power on my printer, and it is assigned device node <em>/dev/lp0</em>. Not satisfied with such a bland name, I decide to use udevadm info to aid me in writing a rule which will provide an alternative name:
+ </p>
+
+ <blockquote><pre>
+-# udevinfo -a -p $(udevinfo -q path -n /dev/lp0)
++# udevadm info -a -p $(udevadm info -q path -n /dev/lp0)
+ looking at device '/class/usb/lp0':
+ KERNEL=="lp0"
+ SUBSYSTEM=="usb"
+@@ -695,7 +695,7 @@ Not all cameras work in this way: some of them use a non-storage protocol such a
+ </p>
+
+ <p>
+-A common complication with USB camera devices is that they usually identify themselves as a disk with a single partition, in this case <em>/dev/sdb</em> with <em>/dev/sdb1</em>. The sdb node is useless to me, but sdb1 is interesting - this is the one I want to mount. There is a problem here that because sysfs is chained, the useful attributes which udevinfo produces for /dev/sdb1 are identical to the ones for /dev/sdb. This results in your rule potentially matching <u>both</u> the raw disk and the partition, which is not what you want, your rule should be <b>specific</b>.
++A common complication with USB camera devices is that they usually identify themselves as a disk with a single partition, in this case <em>/dev/sdb</em> with <em>/dev/sdb1</em>. The sdb node is useless to me, but sdb1 is interesting - this is the one I want to mount. There is a problem here that because sysfs is chained, the useful attributes which udevadm info produces for /dev/sdb1 are identical to the ones for /dev/sdb. This results in your rule potentially matching <u>both</u> the raw disk and the partition, which is not what you want, your rule should be <b>specific</b>.
+ </p>
+
+ <p>
+@@ -703,7 +703,7 @@ To get around this, you simply need to think about what differs between sdb and
+ </p>
+
+ <blockquote><pre>
+-# udevinfo -a -p $(udevinfo -q path -n /dev/sdb1)
++# udevadm info -a -p $(udevadm info -q path -n /dev/sdb1)
+ looking at device '/block/sdb/sdb1':
+ KERNEL=="sdb1"
+ SUBSYSTEM=="block"
+@@ -781,7 +781,7 @@ These devices work as USB-serial devices, so by default, you only get the <em>tt
+ <blockquote><pre>SUBSYSTEMS=="usb", ATTRS{product}=="Palm Handheld", KERNEL=="ttyUSB*", SYMLINK+="pilot"</pre></blockquote>
+
+ <p>
+-Note that the product string seems to vary from product to product, so make sure that you check (using udevinfo) which one applies to you.
++Note that the product string seems to vary from product to product, so make sure that you check (using udevadm info) which one applies to you.
+ </p>
+
+ <a name="example-cdrom"></a>
+@@ -808,11 +808,11 @@ Even though they are referenced by names, network interfaces typically do not ha
+ </p>
+
+ <p>
+-It makes sense to simply match the MAC address of your interface in the rule, as this is unique. However, make sure that you use the <em>exact</em> MAC address as shown as udevinfo, because if you do not match the case exactly, your rule will not work.
++It makes sense to simply match the MAC address of your interface in the rule, as this is unique. However, make sure that you use the <em>exact</em> MAC address as shown as udevadm info, because if you do not match the case exactly, your rule will not work.
+ </p>
+
+ <blockquote><pre>
+-# udevinfo -a -p /sys/class/net/eth0
++# udevadm info -a -p /sys/class/net/eth0
+ looking at class device '/sys/class/net/eth0':
+ KERNEL=="eth0"
+ ATTR{address}=="00:52:8b:d5:04:48"
diff --git a/sys-fs/udev/files/udev-mount-135-r2.initd b/sys-fs/udev/files/udev-mount-135-r2.initd
new file mode 100755
index 000000000..0c4d04633
--- /dev/null
+++ b/sys-fs/udev/files/udev-mount-135-r2.initd
@@ -0,0 +1,107 @@
+#!/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 others
+. /lib/udev/shell-compat.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 '2.6.15') ]; then
+ eerror "Your kernel is too old to work with this version of udev."
+ eerror "Current udev only supports Linux kernel 2.6.15 and newer."
+ return 1
+ fi
+ if [ $(get_KV) -lt $(KV_to_int '2.6.18') ]; then
+ ewarn "You need at least Linux kernel 2.6.18 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
+
+ # FIXME: Is this needed with openrc?
+ # 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
+
+ seed_dev
+
+ return 0
+}
diff --git a/sys-fs/udev/files/udev-mount-135-r3.initd b/sys-fs/udev/files/udev-mount-135-r3.initd
new file mode 100755
index 000000000..84bed6a48
--- /dev/null
+++ b/sys-fs/udev/files/udev-mount-135-r3.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 others
+. /lib/udev/shell-compat.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 '2.6.15') ]; then
+ eerror "Your kernel is too old to work with this version of udev."
+ eerror "Current udev only supports Linux kernel 2.6.15 and newer."
+ return 1
+ fi
+ if [ $(get_KV) -lt $(KV_to_int '2.6.18') ]; then
+ ewarn "You need at least Linux kernel 2.6.18 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/udev-postmount-130-r2.initd b/sys-fs/udev/files/udev-postmount-130-r2.initd
new file mode 100755
index 000000000..a19e11b0a
--- /dev/null
+++ b/sys-fs/udev/files/udev-postmount-130-r2.initd
@@ -0,0 +1,25 @@
+#!/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/udev-postmount-130-r2.initd,v 1.1 2008/10/28 21:59:05 zzam Exp $
+
+depend() {
+ need localmount
+}
+
+start() {
+ # check if this system uses udev
+ [ -d /dev/.udev/ ] || return 0
+
+ einfo "udev postmount cleanup"
+
+ # 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/udev-postmount-135-r2.initd b/sys-fs/udev/files/udev-postmount-135-r2.initd
new file mode 100755
index 000000000..bde1f59d1
--- /dev/null
+++ b/sys-fs/udev/files/udev-postmount-135-r2.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/udev-postmount-135-r2.initd,v 1.1 2008/12/19 22:40:58 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/udev-postmount-initd-111-r2 b/sys-fs/udev/files/udev-postmount-initd-111-r2
new file mode 100755
index 000000000..6421f84d5
--- /dev/null
+++ b/sys-fs/udev/files/udev-postmount-initd-111-r2
@@ -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/udev-postmount-initd-111-r2,v 1.1 2007/05/25 13:51:07 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/udev-start-113-r2.sh b/sys-fs/udev/files/udev-start-113-r2.sh
new file mode 100644
index 000000000..f8cd44839
--- /dev/null
+++ b/sys-fs/udev/files/udev-start-113-r2.sh
@@ -0,0 +1,247 @@
+# 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
+
+get_modules_autoload_file() {
+ # code copied from /etc/init.d/modules
+
+ # Should not fail if kernel do not have module
+ # support compiled in ...
+ [ ! -f /proc/modules -o "${RC_SYS}" = "VPS" ] && return 0
+
+ local KV=$(uname -r)
+ local KV_MAJOR=${KV%%.*}
+ local x=${KV#*.}
+ local KV_MINOR=${x%%.*}
+ x=${KV#*.*.}
+ local KV_MICRO=${x%%-*}
+
+ local auto=""
+ if [ -f /etc/modules.autoload -a ! -L /etc/modules.autoload ]; then
+ auto=/etc/modules.autoload
+ else
+ local x= f="/etc/modules.autoload.d/kernel"
+ for x in "${KV}" ${KV_MAJOR}.${KV_MINOR}.${KV_MICRO} ${KV_MAJOR}.${KV_MINOR} ; do
+ if [ -f "${f}-${x}.${RC_SOFTLEVEL}" ] ; then
+ auto="${f}-${x}.${RC_SOFTLEVEL}"
+ break
+ fi
+ if [ "${RC_SOFTLEVEL}" = "${RC_BOOTLEVEL}" -a -f "${f}-${x}.${RC_DEFAULTLEVEL}" ] ; then
+ auto="${f}-${x}.${RC_DEFAULTLEVEL}"
+ break
+ fi
+ if [ -f "${f}-${x}" ] ; then
+ auto="${f}-${x}"
+ break
+ fi
+ done
+ fi
+ echo "${auto}"
+}
+
+populate_udev() {
+ # populate /dev with devices already found by the kernel
+
+ # tell modprobe.sh to be verbose to $CONSOLE
+
+ echo "export CONSOLE=${CONSOLE}" > /dev/.udev_populate
+ echo "export TERM=${TERM}" >> /dev/.udev_populate
+ echo "export MODULES_AUTOLOAD_FILE=$(get_modules_autoload_file)" >> /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
+}
+
+make_dev_root() {
+ local DEV="$(/lib/udev/get_dir_major_minor "/")"
+ if [ $? = 0 -a -n "${DEV}" ]; then
+ mknod -m 600 /dev/root b ${DEV}
+ fi
+}
+
+check_persistent_net() {
+ # check if there are problems with persistent-net
+ local syspath=
+ local devs=
+ local problem_found=0
+ for syspath in /sys/class/net/*_rename*; do
+ if [ -d "${syspath}" ]; then
+ devs="${devs} ${syspath##*/}"
+ problem_found=1
+ fi
+ done
+
+ [ "${problem_found}" = 0 ] && 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
+}
+
+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 -a -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
+ make_dev_root
+
+ # Only do this for baselayout-1*
+ if [ ! -e /lib/librc.so ]; then
+
+ # 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}" -a -x /sbin/evms_activate ] && \
+ /sbin/evms_activate -q &>/dev/null
+ eend 0
+ fi
+
+ check_persistent_net
+
+ # trigger executing initscript when /etc is writable
+ IN_HOTPLUG=1 /etc/init.d/udev-postmount start >/dev/null 2>/dev/null
+
+ # udev started successfully
+ return 0
+}
+
+main
+
+# vim:ts=4
diff --git a/sys-fs/udev/files/udev-start-114-r1.sh b/sys-fs/udev/files/udev-start-114-r1.sh
new file mode 100644
index 000000000..3f611c237
--- /dev/null
+++ b/sys-fs/udev/files/udev-start-114-r1.sh
@@ -0,0 +1,234 @@
+# 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
+
+get_modules_autoload_file() {
+ # code copied from /etc/init.d/modules
+
+ # Should not fail if kernel do not have module
+ # support compiled in ...
+ [ ! -f /proc/modules -o "${RC_SYS}" = "VPS" ] && return 0
+
+ local KV=$(uname -r)
+ local KV_MAJOR=${KV%%.*}
+ local x=${KV#*.}
+ local KV_MINOR=${x%%.*}
+ x=${KV#*.*.}
+ local KV_MICRO=${x%%-*}
+
+ local auto=""
+ if [ -f /etc/modules.autoload -a ! -L /etc/modules.autoload ]; then
+ auto=/etc/modules.autoload
+ else
+ local x= f="/etc/modules.autoload.d/kernel"
+ for x in "${KV}" ${KV_MAJOR}.${KV_MINOR}.${KV_MICRO} ${KV_MAJOR}.${KV_MINOR} ; do
+ if [ -f "${f}-${x}.${RC_SOFTLEVEL}" ] ; then
+ auto="${f}-${x}.${RC_SOFTLEVEL}"
+ break
+ fi
+ if [ "${RC_SOFTLEVEL}" = "${RC_BOOTLEVEL}" -a -f "${f}-${x}.${RC_DEFAULTLEVEL}" ] ; then
+ auto="${f}-${x}.${RC_DEFAULTLEVEL}"
+ break
+ fi
+ if [ -f "${f}-${x}" ] ; then
+ auto="${f}-${x}"
+ break
+ fi
+ done
+ fi
+ echo "${auto}"
+}
+
+mount_dev_directory() {
+ # 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 $?
+}
+
+populate_udev() {
+ # populate /dev with devices already found by the kernel
+
+ # tell modprobe.sh to be verbose to $CONSOLE
+
+ echo "export CONSOLE=${CONSOLE}" > /dev/.udev_populate
+ echo "export TERM=${TERM}" >> /dev/.udev_populate
+ echo "export MODULES_AUTOLOAD_FILE=$(get_modules_autoload_file)" >> /dev/.udev_populate
+
+ if get_bootparam "nocoldplug" ; then
+ RC_COLDPLUG="no"
+ ewarn "Skipping udev coldplug as requested in kernel cmdline"
+ fi
+
+ # at this point we are already sure to use kernel 2.6.15 or newer
+ ebegin "Populating /dev with existing devices through uevents"
+ local opts=
+ [ "${RC_COLDPLUG}" != "yes" ] && opts="--attr-match=dev"
+ /sbin/udevtrigger ${opts}
+ eend $?
+
+ # 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
+}
+
+check_persistent_net() {
+ # check if there are problems with persistent-net
+ local syspath=
+ local devs=
+ local problem_found=0
+ for syspath in /sys/class/net/*_rename*; do
+ if [ -d "${syspath}" ]; then
+ devs="${devs} ${syspath##*/}"
+ problem_found=1
+ fi
+ done
+
+ [ "${problem_found}" = 0 ] && 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
+}
+
+main() {
+ if [ $(get_KV) -le $(KV_to_int '2.6.14') ] ; then
+ eerror "Your kernel is too old to work with this version of udev."
+ eerror "Current udev only supports Linux kernel 2.6.15 and newer."
+ return 1
+ fi
+
+ mount_dev_directory
+
+ # 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 -a -c /selinux/null ] ; then
+ restorecon /dev > /selinux/null
+ fi
+
+ unpack_device_tarball
+ seed_dev
+
+ if [ -e /proc/sys/kernel/hotplug ] ; then
+ echo "" > /proc/sys/kernel/hotplug
+ fi
+
+ ebegin "Starting udevd"
+ /sbin/udevd --daemon
+ eend $?
+
+ /lib/udev/write_root_link_rule
+ populate_udev
+
+ # Only do this for baselayout-1*
+ if [ ! -e /lib/librc.so ]; then
+
+ # 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}" -a -x /sbin/evms_activate ] && \
+ /sbin/evms_activate -q &>/dev/null
+ eend 0
+ fi
+
+ check_persistent_net
+
+ # trigger executing initscript when /etc is writable
+ IN_HOTPLUG=1 /etc/init.d/udev-postmount start >/dev/null 2>/dev/null
+
+ # udev started successfully
+ return 0
+}
+
+main
+
+# vim:ts=4
diff --git a/sys-fs/udev/files/udev-start-118-r2.sh b/sys-fs/udev/files/udev-start-118-r2.sh
new file mode 100644
index 000000000..b9cc0486e
--- /dev/null
+++ b/sys-fs/udev/files/udev-start-118-r2.sh
@@ -0,0 +1,203 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+[ -e /etc/udev/udev.conf ] && . /etc/udev/udev.conf
+. /lib/udev/shell-compat.sh
+
+rc_coldplug=${rc_coldplug:-${RC_COLDPLUG:-YES}}
+rc_device_tarball=${rc_device_tarball:-${RC_DEVICE_TARBALL:-NO}}
+
+# FIXME
+# Instead of this script testing kernel version, udev itself should
+# Maybe something like udevd --test || exit $?
+check_kernel()
+{
+ if [ $(get_KV) -le $(KV_to_int '2.6.14') ]; then
+ eerror "Your kernel is too old to work with this version of udev."
+ eerror "Current udev only supports Linux kernel 2.6.15 and newer."
+ return 1
+ fi
+ return 0
+}
+
+
+mount_dev_directory()
+{
+ # No options are processed here as they should all be in /etc/fstab
+ ebegin "Mounting /dev for udev"
+ 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 $?
+}
+
+unpack_device_tarball()
+{
+ local device_tarball=/lib/udev/state/devices.tar.bz2
+ if yesno "${rc_device_tarball}" && \
+ [ -s "${device_tarball}" ]
+ then
+ ebegin "Populating /dev with saved device nodes"
+ tar -jxpf "${device_tarball}" -C /dev
+ eend $?
+ fi
+}
+
+seed_dev()
+{
+ # Seed /dev with some things that we know we need
+
+ # 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 -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
+}
+
+start_udev()
+{
+ ebegin "Starting udevd"
+ start-stop-daemon --start --exec /sbin/udevd -- --daemon
+ eend $?
+}
+
+# populate /dev with devices already found by the kernel
+populate_udev()
+{
+ 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
+ udevtrigger
+ else
+ # Do not run any init-scripts, Bug #206518
+ udevadm control --env do_not_run_plug_service=1
+
+ # only create device nodes
+ udevtrigger --attr-match=dev
+
+ # run persistent-net stuff, bug 191466
+ udevtrigger --subsystem-match=net
+ fi
+ eend $?
+
+ ebegin "Waiting for uevents to be processed"
+ udevsettle --timeout=60
+ eend $?
+
+ udevadm control --env do_not_run_plug_service=
+ return 0
+}
+
+compat_device_nodes()
+{
+ # Only do this for baselayout-1*
+ 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
+}
+
+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_kernel || exit $?
+mount_dev_directory || exit $?
+
+# 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 -a -c /selinux/null ]; then
+ restorecon /dev > /selinux/null
+fi
+
+unpack_device_tarball
+seed_dev
+
+if [ -e /proc/sys/kernel/hotplug ]; then
+ echo "" >/proc/sys/kernel/hotplug
+fi
+
+start_udev || exit $?
+
+/lib/udev/write_root_link_rule
+populate_udev
+
+compat_device_nodes
+
+check_persistent_net
+
+# trigger executing initscript when /etc is writable
+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/udev-start-122-r1.sh b/sys-fs/udev/files/udev-start-122-r1.sh
new file mode 100644
index 000000000..150d20015
--- /dev/null
+++ b/sys-fs/udev/files/udev-start-122-r1.sh
@@ -0,0 +1,239 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+[ -e /etc/udev/udev.conf ] && . /etc/udev/udev.conf
+. /lib/udev/shell-compat.sh
+
+rc_coldplug=${rc_coldplug:-${RC_COLDPLUG:-YES}}
+rc_device_tarball=${rc_device_tarball:-${RC_DEVICE_TARBALL:-NO}}
+
+cleanup()
+{
+ # fail more gracely and not leave udevd running
+ start-stop-daemon --stop --exec /sbin/udevd
+ exit 1
+}
+
+# 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 '2.6.15') ]; then
+ eerror "Your kernel is too old to work with this version of udev."
+ eerror "Current udev only supports Linux kernel 2.6.15 and newer."
+ return 1
+ fi
+ if [ $(get_KV) -lt $(KV_to_int '2.6.18') ]; then
+ ewarn "You need at least Linux kernel 2.6.18 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 $?
+}
+
+unpack_device_tarball()
+{
+ local device_tarball=/lib/udev/state/devices.tar.bz2
+ if yesno "${rc_device_tarball}" && \
+ [ -s "${device_tarball}" ]
+ then
+ ebegin "Populating /dev with saved device nodes"
+ tar -jxpf "${device_tarball}" -C /dev
+ eend $?
+ fi
+}
+
+seed_dev()
+{
+ # Seed /dev with some things that we know we need
+
+ # 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 -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
+}
+
+disable_hotplug_agent()
+{
+ if [ -e /proc/sys/kernel/hotplug ]; then
+ echo "" >/proc/sys/kernel/hotplug
+ fi
+}
+
+root_link()
+{
+ /lib/udev/write_root_link_rule
+}
+
+start_udevd()
+{
+ # load unix domain sockets if built as module, Bug #221253
+ if [ -e /proc/modules ] ; then
+ modprobe -q unix
+ 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
+}
+
+compat_volume_nodes()
+{
+ # Only do this for baselayout-1*
+ 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
+}
+
+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
+}
+
+
+
+check_kernel || cleanup
+mount_dev_directory || cleanup
+
+# 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 -a -c /selinux/null ]; then
+ restorecon /dev > /selinux/null
+fi
+
+unpack_device_tarball
+seed_dev
+root_link
+disable_hotplug_agent
+
+start_udevd || cleanup
+populate_dev || cleanup
+
+compat_volume_nodes
+check_persistent_net
+
+# trigger executing initscript when /etc is writable
+IN_HOTPLUG=1 /etc/init.d/udev-postmount start >/dev/null 2>&1
+
+check_udev_works || cleanup
+
+# udev started successfully
+exit 0
diff --git a/sys-fs/udev/files/udev-start-126.sh b/sys-fs/udev/files/udev-start-126.sh
new file mode 100644
index 000000000..12641340e
--- /dev/null
+++ b/sys-fs/udev/files/udev-start-126.sh
@@ -0,0 +1,239 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+[ -e /etc/udev/udev.conf ] && . /etc/udev/udev.conf
+. /lib/udev/shell-compat.sh
+
+rc_coldplug=${rc_coldplug:-${RC_COLDPLUG:-YES}}
+rc_device_tarball=${rc_device_tarball:-${RC_DEVICE_TARBALL:-NO}}
+
+cleanup()
+{
+ # fail more gracely and not leave udevd running
+ start-stop-daemon --stop --exec /sbin/udevd
+ exit 1
+}
+
+# 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 '2.6.15') ]; then
+ eerror "Your kernel is too old to work with this version of udev."
+ eerror "Current udev only supports Linux kernel 2.6.15 and newer."
+ return 1
+ fi
+ if [ $(get_KV) -lt $(KV_to_int '2.6.18') ]; then
+ ewarn "You need at least Linux kernel 2.6.18 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 $?
+}
+
+unpack_device_tarball()
+{
+ local device_tarball=/lib/udev/state/devices.tar.bz2
+ if yesno "${rc_device_tarball}" && \
+ [ -s "${device_tarball}" ]
+ then
+ ebegin "Populating /dev with saved device nodes"
+ tar -jxpf "${device_tarball}" -C /dev
+ eend $?
+ fi
+}
+
+seed_dev()
+{
+ # Seed /dev with some things that we know we need
+
+ # 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 -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
+}
+
+disable_hotplug_agent()
+{
+ if [ -e /proc/sys/kernel/hotplug ]; then
+ echo "" >/proc/sys/kernel/hotplug
+ fi
+}
+
+root_link()
+{
+ /lib/udev/write_root_link_rule
+}
+
+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
+}
+
+compat_volume_nodes()
+{
+ # Only do this for baselayout-1*
+ 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
+}
+
+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
+}
+
+
+
+check_kernel || cleanup
+mount_dev_directory || cleanup
+
+# 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 -a -c /selinux/null ]; then
+ restorecon /dev > /selinux/null
+fi
+
+unpack_device_tarball
+seed_dev
+root_link
+disable_hotplug_agent
+
+start_udevd || cleanup
+populate_dev || cleanup
+
+compat_volume_nodes
+check_persistent_net
+
+# trigger executing initscript when /etc is writable
+IN_HOTPLUG=1 /etc/init.d/udev-postmount start >/dev/null 2>&1
+
+check_udev_works || cleanup
+
+# udev started successfully
+exit 0
diff --git a/sys-fs/udev/files/udev-start-133.sh b/sys-fs/udev/files/udev-start-133.sh
new file mode 100644
index 000000000..24a4d9ef8
--- /dev/null
+++ b/sys-fs/udev/files/udev-start-133.sh
@@ -0,0 +1,254 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+[ -e /etc/udev/udev.conf ] && . /etc/udev/udev.conf
+[ -e /etc/conf.d/udev ] && . /etc/conf.d/udev
+. /lib/udev/shell-compat.sh
+
+rc_coldplug=${rc_coldplug:-${RC_COLDPLUG:-YES}}
+rc_device_tarball=${rc_device_tarball:-${RC_DEVICE_TARBALL:-NO}}
+
+cleanup()
+{
+ # fail more gracely and not leave udevd running
+ start-stop-daemon --stop --exec /sbin/udevd
+ exit 1
+}
+
+# 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 '2.6.15') ]; then
+ eerror "Your kernel is too old to work with this version of udev."
+ eerror "Current udev only supports Linux kernel 2.6.15 and newer."
+ return 1
+ fi
+ if [ $(get_KV) -lt $(KV_to_int '2.6.18') ]; then
+ ewarn "You need at least Linux kernel 2.6.18 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 $?
+}
+
+unpack_device_tarball()
+{
+ local device_tarball=/lib/udev/state/devices.tar.bz2
+ if yesno "${rc_device_tarball}" && \
+ [ -s "${device_tarball}" ]
+ then
+ ebegin "Populating /dev with saved device nodes"
+ tar -jxpf "${device_tarball}" -C /dev
+ eend $?
+ fi
+}
+
+seed_dev()
+{
+ # Seed /dev with some things that we know we need
+
+ # 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 -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
+}
+
+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
+}
+
+compat_volume_nodes()
+{
+ # Only do this for baselayout-1*
+ 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
+}
+
+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
+}
+
+
+
+check_kernel || cleanup
+mount_dev_directory || cleanup
+
+# 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 -a -c /selinux/null ]; then
+ restorecon /dev > /selinux/null
+fi
+
+unpack_device_tarball
+seed_dev
+root_link
+persistent_net_switch
+disable_hotplug_agent
+
+start_udevd || cleanup
+populate_dev || cleanup
+
+compat_volume_nodes
+check_persistent_net
+
+# trigger executing initscript when /etc is writable
+IN_HOTPLUG=1 /etc/init.d/udev-postmount start >/dev/null 2>&1
+
+check_udev_works || cleanup
+
+# udev started successfully
+exit 0
diff --git a/sys-fs/udev/files/udev-start-135-r2.sh b/sys-fs/udev/files/udev-start-135-r2.sh
new file mode 100644
index 000000000..ecda790dc
--- /dev/null
+++ b/sys-fs/udev/files/udev-start-135-r2.sh
@@ -0,0 +1,45 @@
+# 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.sh
+
+compat_volume_nodes()
+{
+ # Only do this for baselayout-1*
+ 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
+
+# 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/udev-start-135-r3.sh b/sys-fs/udev/files/udev-start-135-r3.sh
new file mode 100644
index 000000000..84de1628a
--- /dev/null
+++ b/sys-fs/udev/files/udev-start-135-r3.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.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/udev-stop-111-r2.sh b/sys-fs/udev/files/udev-stop-111-r2.sh
new file mode 100755
index 000000000..8d61bd11c
--- /dev/null
+++ b/sys-fs/udev/files/udev-stop-111-r2.sh
@@ -0,0 +1,80 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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 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}"
+ 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() {
+ /lib/udev/move_tmp_persistent_rules.sh
+ create_device_tarball
+}
+
+main
+
+
+# vim:ts=4
diff --git a/sys-fs/udev/files/udev-stop-118-r2.sh b/sys-fs/udev/files/udev-stop-118-r2.sh
new file mode 100755
index 000000000..990130f88
--- /dev/null
+++ b/sys-fs/udev/files/udev-stop-118-r2.sh
@@ -0,0 +1,71 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+/lib/udev/move_tmp_persistent_rules.sh
+
+. /lib/udev/shell-compat.sh
+
+device_tarball=/lib/udev/state/devices.tar.bz2
+
+rc_device_tarball=${rc_device_tarball:-${RC_DEVICE_TARBALL:-NO}}
+if [ -e /dev/.devfsd ] || [ ! -e /dev/.udev ] || [ ! -z "${CDBOOT}" ] || \
+ ! yesno "${rc_device_tarball}" || \
+ ! touch "${device_tarball}" 2>/dev/null
+then
+ exit 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
+ udevinfo --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/udev-stop-126.sh b/sys-fs/udev/files/udev-stop-126.sh
new file mode 100755
index 000000000..081b7150f
--- /dev/null
+++ b/sys-fs/udev/files/udev-stop-126.sh
@@ -0,0 +1,71 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+/lib/udev/move_tmp_persistent_rules.sh
+
+. /lib/udev/shell-compat.sh
+
+device_tarball=/lib/udev/state/devices.tar.bz2
+
+rc_device_tarball=${rc_device_tarball:-${RC_DEVICE_TARBALL:-NO}}
+if [ -e /dev/.devfsd ] || [ ! -e /dev/.udev ] || [ ! -z "${CDBOOT}" ] || \
+ ! yesno "${rc_device_tarball}" || \
+ ! touch "${device_tarball}" 2>/dev/null
+then
+ exit 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/udev-stop-135-r2.sh b/sys-fs/udev/files/udev-stop-135-r2.sh
new file mode 100644
index 000000000..15e8d3db3
--- /dev/null
+++ b/sys-fs/udev/files/udev-stop-135-r2.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.sh
+
+# store device tarball
+(
+ . /etc/init.d/udev-dev-tarball
+ stop
+)
+
+exit 0
diff --git a/sys-fs/udev/files/udev.conf.post_113 b/sys-fs/udev/files/udev.conf.post_113
new file mode 100644
index 000000000..b9f6e14bf
--- /dev/null
+++ b/sys-fs/udev/files/udev.conf.post_113
@@ -0,0 +1,28 @@
+# /etc/udev/udev.conf: main config file for udev
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/files/udev.conf.post_113,v 1.1 2007/07/12 14:24:15 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=<value>".
+udev_log="err"
+
+# The maximum size reserved for the tmpfs mounted on /dev
+tmpfs_size="10M"
+
+# Implictly blacklist the modules listed in modules.autoload
+# so that udev (with coldplugging) does not load them
+# but /etc/init.d/modules will do later.
+# This can guarantee correct load order needed for
+# some subsystems (like alsa, v4l, dvb, ...).
+# It should be generally safe.
+implicitly_blacklist_modules_autoload="yes"
+
diff --git a/sys-fs/udev/files/udev.conf.post_114 b/sys-fs/udev/files/udev.conf.post_114
new file mode 100644
index 000000000..485bb9d0f
--- /dev/null
+++ b/sys-fs/udev/files/udev.conf.post_114
@@ -0,0 +1,11 @@
+# The maximum size reserved for the tmpfs mounted on /dev
+tmpfs_size="10M"
+
+# Implictly blacklist the modules listed in modules.autoload
+# so that udev (with coldplugging) does not load them
+# but /etc/init.d/modules will do later.
+# This can guarantee correct load order needed for
+# some subsystems (like alsa, v4l, dvb, ...).
+# It should be generally safe.
+implicitly_blacklist_modules_autoload="yes"
+
diff --git a/sys-fs/udev/files/udev.confd b/sys-fs/udev/files/udev.confd
new file mode 100644
index 000000000..0a0ca7d77
--- /dev/null
+++ b/sys-fs/udev/files/udev.confd
@@ -0,0 +1,8 @@
+# /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"
+
diff --git a/sys-fs/udev/files/udev.initd b/sys-fs/udev/files/udev.initd
new file mode 100755
index 000000000..80135e3f3
--- /dev/null
+++ b/sys-fs/udev/files/udev.initd
@@ -0,0 +1,59 @@
+#!/sbin/runscript
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="Mount /dev and let udev create the device-nodes"
+
+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
+ before checkfs fsck
+
+ # udev does not work inside vservers
+ keyword novserver
+ fi
+}
+
+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() {
+ mark_service_hotplugged udev-postmount
+ #einfo "Injected udev-postmount service"
+}
+
+start()
+{
+ # do not run this on too old baselayout - udev-addon is already loaded!
+ if [ ! -e /lib/librc.so -a -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_addon udev || return 1
+ display_hotplugged_services
+ inject_postmount_initd
+ return 0
+}
+
+stop()
+{
+ stop_addon udev
+}
diff --git a/sys-fs/udev/files/write_root_link_rule b/sys-fs/udev/files/write_root_link_rule
new file mode 100755
index 000000000..4d6cd78c9
--- /dev/null
+++ b/sys-fs/udev/files/write_root_link_rule
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# This script should run before doing udevtrigger at boot.
+# It will create a rule matching the device directory / is on, and
+# creating /dev/root symlink pointing on its device node.
+#
+# This is especially useful for hal looking at /proc/mounts containing
+# a line listing /dev/root as device:
+# /dev/root / reiserfs rw 0 0
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation version 2 of the License.
+#
+# (c) 2007 Matthias Schwarzott <zzam@gentoo.org>
+
+DEV=$(udevadm info --device-id-of-file=/)
+if [ $? = 0 ]; then
+ MAJOR="${DEV% *}"
+ MINOR="${DEV#* }"
+
+ [ -d /dev/.udev/rules.d ] || mkdir -p /dev/.udev/rules.d
+ RULES=/dev/.udev/rules.d/10-root-link.rules
+
+ echo "# Created by /lib/udev/write_root_link_rule" > "${RULES}"
+ echo "# This rule should create /dev/root as link to real root device." >> "${RULES}"
+ echo "SUBSYSTEM==\"block\", ENV{MAJOR}==\"$MAJOR\", ENV{MINOR}==\"$MINOR\", SYMLINK+=\"root\"" >> "${RULES}"
+fi
+
diff --git a/sys-fs/udev/udev-124-r1.ebuild b/sys-fs/udev/udev-124-r1.ebuild
new file mode 100644
index 000000000..52636d61e
--- /dev/null
+++ b/sys-fs/udev/udev-124-r1.ebuild
@@ -0,0 +1,377 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-124-r1.ebuild,v 1.10 2008/11/28 12:51:54 zzam Exp $
+
+EAPI="2"
+
+inherit eutils flag-o-matic multilib toolchain-funcs versionator multilib-native
+
+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
+ !<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"
+
+ myconf=
+ 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/collect \
+ extras/rule_generator"
+
+ use selinux && myconf="${myconf} USE_SELINUX=true"
+
+ # 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 ok=0
+ if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 && ${KV_MICRO} -ge 18 ]]
+ then
+ ok=1
+ fi
+
+ if [[ ${ok} == 0 ]]
+ then
+ ewarn
+ ewarn "${P} does not support Linux kernel before version 2.6.15!"
+ ewarn "If you want to use udev reliable you should update"
+ ewarn "to at least kernel version 2.6.18!"
+ ewarn
+ ebeep
+ fi
+}
+
+sed_helper_dir() {
+ sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@"
+}
+
+src_unpack() {
+ unpack ${A}
+
+ cd "${S}"
+
+ # patches go here...
+ # Bug #223757, Bug #208578
+ epatch "${FILESDIR}/${PN}-122-rules-update.diff"
+ epatch "${FILESDIR}/${P}-cdrom-autoclose-bug.diff"
+
+ # 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
+ # Do not require xmlto to refresh manpages
+ sed -ie 's|$(MAN_PAGES)||g' Makefile
+
+ # Make sure there is no sudden changes to upstream rules file
+ # (more for my own needs than anything else ...)
+ MD5=$(md5sum < "${S}/etc/udev/rules.d/50-udev-default.rules")
+ MD5=${MD5/ -/}
+ if [[ ${MD5} != db44f7e02100f57a555d48e2192c3f8d ]]
+ then
+ echo
+ eerror "50-udev-default.rules has been updated, please validate!"
+ die "50-udev-default.rules has been updated, please validate!"
+ fi
+
+ sed_helper_dir \
+ etc/udev/rules.d/50-udev-default.rules \
+ extras/rule_generator/write_*_rules \
+ udev_rules_parse.c \
+ udev_rules.c
+
+ # Use correct multilib dir
+ sed -i extras/volume_id/lib/Makefile \
+ -e "/ =/s-/lib-/$(get_libdir)-"
+}
+
+multilib-native_src_compile_internal() {
+ filter-flags -fprefetch-loop-arrays
+
+ if [[ -z ${extras} ]]; then
+ eerror "Variable extras is unset!"
+ eerror "It seems you suffer from Bug #190994"
+ die "Variable extras is unset!"
+ fi
+
+ # Not everyone has full $CHOST-{ld,ar,etc...} yet
+ local mycross=""
+ type -p ${CHOST}-ar && mycross=${CHOST}-
+
+ emake \
+ EXTRAS="${extras}" \
+ libudevdir=${udev_helper_dir} \
+ CROSS_COMPILE=${mycross} \
+ OPTFLAGS="" \
+ ${myconf} || die "compiling udev failed"
+}
+
+multilib-native_src_install_internal() {
+ into /
+ emake \
+ DESTDIR="${D}" \
+ libudevdir=${udev_helper_dir} \
+ EXTRAS="${extras}" \
+ ${myconf} \
+ install || die "make install failed"
+
+ exeinto "${udev_helper_dir}"
+ newexe "${FILESDIR}"/net-118-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"
+ doexe "${FILESDIR}"/write_root_link_rule \
+ || die "write_root_link_rule not installed properly"
+ newexe "${FILESDIR}"/shell-compat-118-r3.sh shell-compat.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
+
+ # vol_id library (needed by mount and HAL)
+ into /
+ rm "${D}/$(get_libdir)"/libvolume_id.so* 2>/dev/null
+ dolib extras/volume_id/lib/*.so* || die "Failed installing libvolume_id.so"
+ into /usr
+ dolib extras/volume_id/lib/*.a || die "Failed installing libvolume_id.a"
+
+ # handle static linking bug #4411
+ rm -f "${D}/usr/$(get_libdir)/libvolume_id.so"
+ gen_usr_ldscript libvolume_id.so
+
+ # Add gentoo stuff to udev.conf
+ echo "# If you need to change mount-options, do it in /etc/fstab" \
+ >> "${D}"/etc/udev/udev.conf
+
+ # Now installing rules
+ cd etc/udev
+ insinto /etc/udev/rules.d/
+
+ # Our rules files
+ doins gentoo/??-*.rules
+ doins packages/40-alsa.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
+ newins "${FILESDIR}"/udev-start-122-r1.sh udev-start.sh
+ newins "${FILESDIR}"/udev-stop-118-r2.sh udev-stop.sh
+
+ # The udev-post init-script
+ newinitd "${FILESDIR}"/udev-postmount-initd-111-r2 udev-postmount
+
+ 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 FAQ README TODO RELEASE-NOTES
+ dodoc docs/{overview,udev_vs_devfs}
+
+ 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=$?
+}
+
+pkg_postinst() {
+ # 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."
+
+ if [[ ${ROOT} == / ]]
+ then
+ # check if root of init-process is identical to ours
+ if [[ -r /proc/1/root && /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
+
+ ewarn "If you build an initramfs including udev, then please"
+ ewarn "make sure that the /sbin/udevadm binary gets included,"
+ ewarn "as the helper apps udevinfo, udevtrigger, ... are now"
+ ewarn "only symlinks to udevadm."
+
+ 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"
+}