diff --git a/profiles/calculate/package.mask b/profiles/calculate/package.mask index 9867d0edd..dc5b325d1 100644 --- a/profiles/calculate/package.mask +++ b/profiles/calculate/package.mask @@ -36,3 +36,6 @@ sys-fs/device-mapper ~sys-apps/calculate-lib-3.2.0_alpha12 ~sys-apps/calculate-update-3.2.0_alpha12 ~sys-apps/calculate-utilities-3.2.0_alpha12 + +# calckernel is not used anymore (replace to dracut) +sys-kernel/calckernel diff --git a/sys-kernel/calckernel/Manifest b/sys-kernel/calckernel/Manifest index 3cedae9e1..4800073d3 100644 --- a/sys-kernel/calckernel/Manifest +++ b/sys-kernel/calckernel/Manifest @@ -1,52 +1,19 @@ -AUX calckernel-3.4.15-r17.patch 63256 SHA256 f7a006a3900bb2c1596dbaee52b3ad5eb567cfcf331995b160170ca68bacdca2 SHA512 d064a3900ee9d9118010914a320d7c0527543324e3556eca16aaf517a37420ccfe49b8a46fe591c93bca5e98d42accb60d38c4bf932e8740a5fe5b71683378c1 WHIRLPOOL 19ef678d29b43b438c0880de76acbffab6e9939990be8a479ebf51627d5a7fb99bb75ac0b1a79b6cd44610f6ab072600dc58203806129f069a9bab45ede7a744 AUX calckernel-3.4.18-fix_slow_device.patch 726 SHA256 c437b3cf18a0d79ecff8aad95fa728e8821bd113731c2b5fed1103e9ab687a92 SHA512 08258a05e6868d615f5f764e24a9b7d749281d65c45f896f31fdc6bf35661f1cc1f4c6db0e72f5cf6d9e51d69d98b06acbaeea1e1ffecebdfd1e9a9e6fa988d4 WHIRLPOOL 0307174b16e6874d17a0c0b6685d65b8e83b6fb0ba9e43b7e2bcfffc3105e667ad809c474de5f5d5f919194fc75fa37e81ec37b7fee98b4b6441db2c0573dadf AUX calckernel-3.4.18-fix_udev.patch 1312 SHA256 f2e975c50e9d6d3458099e975cd022110affcda3dfbc490e7164ff056cb8818e SHA512 7511e8cb51c2bbd128991c94674c846919503e215f940a6cc86d0bdb6dd29b63e448387124dc4cb7f131247b8836e04af07d49a9ed3e138458a2b19dec3e8e23 WHIRLPOOL ba52f31b06887d0922c1749d873f7eab21262d1560d8c55a93c35c6b051ac8abf7a6383a2ccc4c8eabb5daaf2de750312ddaecb9037f2660778873c4fda2a4ab AUX calckernel-3.4.18-fix_udev212.patch 1454 SHA256 d5a2f4579921999c3f4073c1992044e08bfa940f57622b17b210e67f17000191 SHA512 b13ebc95b0bab69352097416123175bf7b69cbe4d49a078ee25d7acdf27472c0523d13b62be5e15c8cc1666a37bbc76a3d6028dcdd1e6cd05d304dc6aaccb9f1 WHIRLPOOL b7503455bd2801350ddf6ee0325464162764f6bef8fa1616413068e1e8d0b6d0631eeea1a8db5986100dc3f5be8f1db07190b2ef766869c0ef0a501ed659c832 -AUX calckernel-3.4.18-r1.patch 63197 SHA256 e86f71cbd06700fb1cc62616defaa68a89b05292006aaf8f56bb61ffa55685a1 SHA512 58eb531663b322c65b72c4e57bd32b084de22611a2b94e854d8acc74b22ae859a7e8648005ded4f6000bf90d65f3798a89d86df87f6a5cddfa4c38865ba116bc WHIRLPOOL 24474814c2fb664db9cf20cc6a1a95981bbe1a502bd170718392d3959e9c93faf262c87d311267bbb6dff1e43beb31337145a6f6d9e0e1247ed340a6222e6498 -AUX calckernel-3.4.18-r10.patch 65200 SHA256 a57f847f30357033256d39714bd2fd73e2fb21ee35b08d370195bf356abea79c SHA512 640029eb7615d47dfd51f0877d529184aeede4f9752ac9c424c9680a92abe548bade5670b309e0e2488bd6d091c0e514521f2f604f8ea9c3c2a0269f1dc70440 WHIRLPOOL 0423cb9a26da2f3068ae222a20d899094a4065178fcd689a5af968a473e6ebf80156940854e80a6343d5a2e5e7afbcf9b5d433715aaac68899d86695ad5be8c7 -AUX calckernel-3.4.18-r11.patch 66043 SHA256 07597dfabf5325b06a7ba19f6e7abb90f47a2e0249fc8ee0d1e5d2d54c87e6fc SHA512 8f2f4cd5a7a6a2ab3c99396a5710637321f2c1cfed7b90c4e41896bd121862dbbacdb7f8eeadbf33931b200c6beaaa9fdde8fde537bb98e3a7f6460e4dade98e WHIRLPOOL 4e76c2193764948fa2f2ba9532a5f1bd796fc45639e7fb7a9d5cb38040538863bfbcbb140a61a03a3069ef6df4117c500c680a913ed7b936a9b7d813f1fcc561 -AUX calckernel-3.4.18-r12.patch 66043 SHA256 07597dfabf5325b06a7ba19f6e7abb90f47a2e0249fc8ee0d1e5d2d54c87e6fc SHA512 8f2f4cd5a7a6a2ab3c99396a5710637321f2c1cfed7b90c4e41896bd121862dbbacdb7f8eeadbf33931b200c6beaaa9fdde8fde537bb98e3a7f6460e4dade98e WHIRLPOOL 4e76c2193764948fa2f2ba9532a5f1bd796fc45639e7fb7a9d5cb38040538863bfbcbb140a61a03a3069ef6df4117c500c680a913ed7b936a9b7d813f1fcc561 -AUX calckernel-3.4.18-r14.patch 66043 SHA256 07597dfabf5325b06a7ba19f6e7abb90f47a2e0249fc8ee0d1e5d2d54c87e6fc SHA512 8f2f4cd5a7a6a2ab3c99396a5710637321f2c1cfed7b90c4e41896bd121862dbbacdb7f8eeadbf33931b200c6beaaa9fdde8fde537bb98e3a7f6460e4dade98e WHIRLPOOL 4e76c2193764948fa2f2ba9532a5f1bd796fc45639e7fb7a9d5cb38040538863bfbcbb140a61a03a3069ef6df4117c500c680a913ed7b936a9b7d813f1fcc561 AUX calckernel-3.4.18-r15.patch 66043 SHA256 07597dfabf5325b06a7ba19f6e7abb90f47a2e0249fc8ee0d1e5d2d54c87e6fc SHA512 8f2f4cd5a7a6a2ab3c99396a5710637321f2c1cfed7b90c4e41896bd121862dbbacdb7f8eeadbf33931b200c6beaaa9fdde8fde537bb98e3a7f6460e4dade98e WHIRLPOOL 4e76c2193764948fa2f2ba9532a5f1bd796fc45639e7fb7a9d5cb38040538863bfbcbb140a61a03a3069ef6df4117c500c680a913ed7b936a9b7d813f1fcc561 -AUX calckernel-3.4.18-r2.patch 63979 SHA256 8e78d525674e816158bcef3cb565167bee6c1070da382666fcebc1fd5aab2ca0 SHA512 c786aff7230e30b63d82b3879326ff939400ae5d4fc8d32bf27c5d6e86df950c880310b7cec85bf41baba51525ffa24b54b3831b86e9556fea665952074c58d6 WHIRLPOOL 38351392113d8e049b130d60c181b9261612f605e7dfa4c3cb320c7e59f3271813cebfa39b3af0227db7d919c7d15c2244ed8b361a65f9ec8bfd5d730b79543c -AUX calckernel-3.4.18-r3.patch 64032 SHA256 ba5c5fc730f04cb877dcc32008c1cf50782b70f907f008cfe295e1dbc48c79e9 SHA512 e880b955ca9cadb0a9a739504d9d823da349e6fa89f444c88962c3251ac93082e8bb8f466141f0cb101b29ff6424d90e1b98a0c3d391d32d628b18d2e2a8ee7e WHIRLPOOL b699d4af5781ecfaa176a1a9f0423508f721e99af7c6404b9774b13e0d14a89efc57b9857dff905a8fe4f2b4eb8f83711fc4e0977d5be371c0577151837490cc -AUX calckernel-3.4.18-r4.patch 64032 SHA256 ba5c5fc730f04cb877dcc32008c1cf50782b70f907f008cfe295e1dbc48c79e9 SHA512 e880b955ca9cadb0a9a739504d9d823da349e6fa89f444c88962c3251ac93082e8bb8f466141f0cb101b29ff6424d90e1b98a0c3d391d32d628b18d2e2a8ee7e WHIRLPOOL b699d4af5781ecfaa176a1a9f0423508f721e99af7c6404b9774b13e0d14a89efc57b9857dff905a8fe4f2b4eb8f83711fc4e0977d5be371c0577151837490cc -AUX calckernel-3.4.18-r5.patch 64292 SHA256 8ccb06df7ca56fa0d70de739bf9e15a8f5fc5f609dce51c46c286f447be5a112 SHA512 a95ddd3bc690ffda6d4540dd98eb820d9d2d4aa30c3fb8cec7431d12c6b2320e5f1d21771439de2ef9f7ab91e7767f9c7b6f6a30986428049d07fcccd0fc6147 WHIRLPOOL ae337ba245d5963ed1929f649805fd910a73e217b482c54788b73822d4ed5e51d8f2ef9fc7fa8f26c680c4f0b1920a81d78dcd0b7e822a94f01f6faf20eb2148 -AUX calckernel-3.4.18-r6.patch 64014 SHA256 21879a9d672dc03efb6461b6873c5df3d287b7ad68c67c7c2edbd4be8c03d2f9 SHA512 2b8faa5304d966f02231fac56c37eb3cb7e0d8b19223e51728e3e7cb1e7e18c614460a4083f6687e771ad8eb87dc2656c9a6c655a63746bc45d8746ee1bfecc7 WHIRLPOOL 521a783458460d472c7b78023e96bb2a34e48b2c3eed7491d3a7cff442abaa092c0223beaf1949eed7e35186b174ad70e6fb3e0e18717e40960246050100cc73 -AUX calckernel-3.4.18-r7.patch 64044 SHA256 6c705f57a3e9244b72adbf1a5b5fb6555cea19db86d8a74032cf8b04c480db45 SHA512 0b8c67bf4dd567062d2f83d5128f5995c24d7b2fa5b3cda2e83ed24130e5eff68317e3997443f54ae5bb1b09aef909d6872aa98cfd6dd55decd4c13c81390915 WHIRLPOOL 94e9f28d76f72cd7cddbd728727bcc8756987542e8f0a92aade17e68f524e4e38884472aef13763214415d0f8793659b06dc81c820df85beb07670cfbed73302 -AUX calckernel-3.4.18-r8.patch 64439 SHA256 9e7f6c2d554cdcc46b2c36c217d2f334b31190bddaf70ab0bfc8c1cdbef95738 SHA512 780a87debac5542ccc3b999c489ef8fafa15023654abf5e10e602fc7965654884adbc7b309b086e0233be1ad2135165af06190fbf9ff34269abd0efd5f1e3d23 WHIRLPOOL bf05e1b5803ebc665de332c1bb41c5718192cde4bfeadbbf193a3a08ed240c2e106bc625ec675b74075b25b87d08f3329fe0365e49a1a04c1b80900020fe273b -AUX calckernel-3.4.18-r9.patch 65200 SHA256 a57f847f30357033256d39714bd2fd73e2fb21ee35b08d370195bf356abea79c SHA512 640029eb7615d47dfd51f0877d529184aeede4f9752ac9c424c9680a92abe548bade5670b309e0e2488bd6d091c0e514521f2f604f8ea9c3c2a0269f1dc70440 WHIRLPOOL 0423cb9a26da2f3068ae222a20d899094a4065178fcd689a5af968a473e6ebf80156940854e80a6343d5a2e5e7afbcf9b5d433715aaac68899d86695ad5be8c7 -AUX calckernel-3.4.18.patch 63045 SHA256 6ba45c0519ff0098421d8b79ce1c01f2a97bc9aab27ec38fc907f88911543893 SHA512 88ae1e7a26ea224425d7ad5cf99de26af125cfe799f6311f25d49326b43414787c227391d0d62b86dce13d9d5be02f45cfba1f1a1652034a67538b0129799e3b WHIRLPOOL 9aaf83494a91e1e00b9d8b4c8c02f6c63b415ce8fc822c68a8566d6084f649bfd6a3fce6101325f70338b1ffd522ca5862749e610fd64b20075799a9b807feb9 AUX genkernel.bash 2438 SHA256 e7de9771ba79ef878e2c9a21a1c1720f092c6047d3cc7d4a49ff6b90e7e2c248 SHA512 2bfe23606f919577bb2d174ffe18cd00fbb4ce642fb8860b319e059745d46ff8459b99374159f78af9f3aebb0a352a74ccd74c3be581980f5e298293b96e983d WHIRLPOOL 71a6be56d38c24c3032fec5f4016c92dd0bc8140e5204db9d97c5cc5be42a2465282f36e213858b528d013ff74c6bcbf9aa443a77a8ed3ce8174baa79afe6004 DIST LVM2.2.02.74.tgz 943084 SHA256 a40c80c5b9a2547b8bd63e9321d7037c8bf041a35f734a5766ad2848d80bb697 SHA512 c41701fb9e5d52da06a770e93346631e078cdae639ae707dee59dd4d51e8a0eb7ec56f0a685fac014106972833eea98d1f0a100009eac5cf332a4b8463b26dba WHIRLPOOL 3b1a2a791a9278aa892d90361c8a3765978d10cd89398664759a083659b84cc1d0560a2aeb16623afa86c97663cbcfbdd251a6d69245f7db48df272214721f42 -DIST busybox-1.18.1.tar.bz2 2129404 SHA256 33eb25ea7b20c727c3af769256b21408a1ac1f927ff9f89a1f1e3767c18c9967 SHA512 2b4b52d1f7fa07a6b7af4de63a42d52e7db73fdfe88e7f181f54b3a8a821e8336896c48183df5936ba94b9558fb70b58abfbcc889010a7b21359fb391fe516c0 WHIRLPOOL 75e62a032d602629f04e0ae3df2723d495ef5fdc583bbc968151a421ae1bbf554922f9f081dd3bfe4e716cd991317580a2a13aa67d58dddbec7557655393e5f9 DIST busybox-1.20.1.tar.bz2 2190170 SHA256 3e515d8abefd8583ebabffdcfccecb3b8deacf2cef7c69ab1d8755a012ec68c9 SHA512 9ad2af7216ae79c2c8cf246654a2c591983d347d22bfe4cd54ae41eaee0ea17f7bf8d6834add3f1f843494d6980707e0443aaf663075fda6e4e7e29728606c53 WHIRLPOOL 07ce28698c63a38ce2c6d71bfbfe1f920f07a76d471db9b9b1a7260ef1bf493551bae67d9b9dc2be41783f1ce0cf56935c44eb7af2a1bc865807afaa87eaabec DIST device-mapper.1.02.22.tgz 189726 SHA256 ff833a6cd6246686f5b3f5692fd6597f1ffbc60f08929e5fe68304cdafb61595 SHA512 36e02b5102fea9c921f6fde5598d2e73f7899df09f6c9a2862d1eeab4f312e3073aafa2b567f2e15ffa3b8e637a5e00eb65e96d883d35b26b9317e9c381435be WHIRLPOOL bee5fc258dde486c0c23ac040abdc316dd7d181ae4ba15471596736a5597c7fc94d103dd31ad6d96e6f734ad4227353d842e3e1a14c598e959c716d88390e8ca DIST dmraid-1.0.0.rc14.tar.bz2 164234 SHA256 a777354d6d69a9b58d84966cc7b37bc3f5c89539f885ad25fd874ed1c388fbec SHA512 0804e1bf91f4707b8845affeb987e68c5a85d97119af27ddba2927c87735a59b86b1fec4f03ac0fbdcde89d779d77e21cab4e6936dd1a82b53a0d8b16eb59768 WHIRLPOOL c5612139d3f24be710fb8e6d51eb6ebe0847dcf804c0c0ba1a5f3142a2680de2b33bfae74bbf3cff704b0da5d9d273c432906f1b7fd46e1057b8ef53cc89ca1e DIST e2fsprogs-1.41.14.tar.gz 4512157 SHA256 3f8ac1fedd7c4bec480afcbe4acabdd4ac59ec0446a0fd50c8975cd0aad7b176 SHA512 077d854e469eb8158460481daadd729ef7fa1c08687b9547397d32d23f862168f53dfcf1ad30cdb3b0deda038e0770a2e656eab5aa06bac5b3c6d939b12af64d WHIRLPOOL 9b5a2b77750014188d8e39bfe4f5fc89008b47d35fd9e652226874b2797b20233d99ebf02395b7023711cd5aab936e1133ae3ece74595dfe012e537e3cc4ffb8 DIST fuse-2.7.4.tar.gz 506658 SHA256 c8b070ece5d4e09bd06eea6c28818c718f803d93a4b85bacb9982deb8ded49e6 SHA512 6ff4fc04ea2ad90d5dd39893831da71da0ade2570f9fda1a7631b8506dc2bc48ee5a203dff1ce01d2c3926c276f4a927654ffdddc16604c1974559fbcc26d9f8 WHIRLPOOL 77cf1c70069412c592370628642943e79460eaa6f56c57cc79ce8c110423afb7a2da2b6936e4fc1361cbf5f0a1934ca8ed65e16f792af97516adec53d9c682e4 -DIST genkernel-3.4.15.tar.bz2 205609 SHA256 5ac00509ef1dfdd2db59b8a322284afce90010e3d54474e69fde558d73c898cb SHA512 73ef2c616920695bedbafecbb3bce726bcef05379fc179f09cadb9235913ac9312a8b7bd87ef66641a3d5c1147257afba27f9b1b1d9c1cb90f631e9780cb7b16 WHIRLPOOL 7bd8dca3a4ff88fb25302ef3d5f29df2fd71764283323aa66749c795c7538d4319eb3e41bb5425c99a1cbd340256217edc66e5bb9c2c4224a98677b483dbd6c0 DIST genkernel-3.4.18.tar.bz2 207295 SHA256 acbba62ffdfeb243f8d67b0d33f88fa0ecf2b59b8e646156705f18d34b45a86d SHA512 159cf135f2aef3c48a4e56290f8b9a397d5df8533b68739adeb7393e97ce51f766f7ee818cbc1f4cdb5866273d7e5ff243ed91260e78dcae2aac57b662667add WHIRLPOOL e3060f9abe41e6b57909c7a43d6e71ea8b43e02a420aebd0d1794a5e1d97841ea30dadf7de0e61c04e793ba34096345135b9e96f0b310c85cac12266d5573338 DIST gnupg-1.4.11.tar.bz2 3407075 SHA256 d18ceeac16e554a501170b9bfde611625252d0fe9448685a69c93bf149ee6ef6 SHA512 97e7b8b0f972cc2f7cabdb0e013cbee1c33e7d48407d040cca5c2037e32abe1c2100194be7d3b569d4f05eb16b24c205a5b83f06718f0241f8d4ee174f1c37ae WHIRLPOOL 6f914627e2f527f6616e1f99d2ae06942b734f839d03a45ffa45bf67516a81d58f89e6a85612cf8e5fd83be04ab0b6bc2da8f81114143dad7523e5fcea62366b DIST mdadm-3.1.4.tar.bz2 288578 SHA256 849ad0ad4ad3c1d2d8806a16b30e1f59ab2daf313cb103807207f7cba889ea63 SHA512 b668773d4f43bc90fba0ac27f01fc869aa2068d958ccc84de2bf8a64ac7e9a40cc8e461ff04a3619b17459d05478843b9fff0894868d9cbc97fc2cfa80faac73 WHIRLPOOL 28a3b43d4edfa4a097d2c410a9d67b75707dfa20d30c72870cc0584132bd2f896c02be26f97ca0d588be8cabdcf90e89d33c3f23ca727e966597ffea9af9a3a9 DIST open-iscsi-2.0-871.tar.gz 330514 SHA256 bcea8746ae82f2ada7bc05d2aa59bcda1ca0d5197f05f2e16744aae59f0a7dcb SHA512 5a13e521e1fbd0fd01077c5cb5b1c2e591e80180cd3ac7724ca09f728f42ecce14ca358961a5b11afd6cfbca3b9d74c8847ea7d34c40224c23809a3072064a9f WHIRLPOOL ff562ac10e5b558db6c0cc5c27c44484900be1ca5ee31ae4377c5c37da9458eeeec396156a32e918619ebca031a4bbbcbd0b6f3e203bf119aaad5b2170838cac DIST unionfs-fuse-0.22.tar.bz2 27355 SHA256 fa0c494a8ce63f235601fcc35e3a96527831169d6d5921ee49faccf3b25feb78 SHA512 f0f377bb8468b2760fb0275ba8e832e58d0379ceed5fc01b06b81c8832cd17a3dae17ab0dc5225b9affe87b673cafff893c9530ef241ef7beb2cb30112a73de7 WHIRLPOOL 6d1d7c4b55c7e80b80dc3a217b260d8b8768a47ab6479c58b717468200feec91443aa968026ef91e5fecf6fdc64bdd07e65627a2332a21507b8bfd732cf71c3f -EBUILD calckernel-3.4.15-r17.ebuild 5555 SHA256 b2f0b99ac7f29d24de38b05e6859c7ed426118b8bdae11494e5a46b5635f0676 SHA512 169f68ba020e97ed0ec114cb80a559ced13e3ad848168f82951547653c9105698ca054a9fbd38b33115818307f5a14ef6f397ed42158b8d721cf49a436b7bbeb WHIRLPOOL 574cb6f4fe6d444945e3b97f865c053bff75632fd2182afd615e5d5e618708036b69921ac5c3b00f3f2dee1cb710431da23167abbeccd1af4b631372bc5b3633 -EBUILD calckernel-3.4.18-r1.ebuild 5555 SHA256 b2f0b99ac7f29d24de38b05e6859c7ed426118b8bdae11494e5a46b5635f0676 SHA512 169f68ba020e97ed0ec114cb80a559ced13e3ad848168f82951547653c9105698ca054a9fbd38b33115818307f5a14ef6f397ed42158b8d721cf49a436b7bbeb WHIRLPOOL 574cb6f4fe6d444945e3b97f865c053bff75632fd2182afd615e5d5e618708036b69921ac5c3b00f3f2dee1cb710431da23167abbeccd1af4b631372bc5b3633 -EBUILD calckernel-3.4.18-r10.ebuild 5555 SHA256 3dfcceb368582f9037708bfed87cbb250e44e4cdf3ac30f75f062e2526908ff1 SHA512 8a6d37478701ab3cb4e93682cc216571bcbb81cbb2de0575f35de9eb415b31e1124a9962208fb0eecef1b7a271d4c416c523dcf2f95118bbe83be3c5443a660b WHIRLPOOL c04dcc1173ec25af0257dc87e42bfe5746d3dbbe79c914311bd2e468699fac37417f0b27bda5bf9955612fc6eb22bb5b402151aed667ab0f2fbccb6622ac6506 -EBUILD calckernel-3.4.18-r11.ebuild 5592 SHA256 7f3829e376f2db91e9a9ee1e805f1a4ba8499a92624e13f64e67717bbe08d415 SHA512 84d7aa536410ecdadec324db6ab5ce20085331134fb497f7c8a030d24e04969dd2e9fa66fab25864bb00c94b1e57b255bc10f8e96f0fd400540ea274c4075838 WHIRLPOOL 7ecc40236de1a88673e891a5e02c76b5af34d9f2cf0e37f92800201281a9268957cd7bf5040ba38fa8cda1ae238e437d930bfa8587dc6f68c4cca8cb44106f23 -EBUILD calckernel-3.4.18-r12.ebuild 5666 SHA256 e91cb8e2959d7a122373ef1450166058d79121bc6d6d1571f80bffd40cd4b20a SHA512 8eda79122f39eed82a41d9773e44bb465d2ca0884200b4a66d072129ba74756701a168426804cec5208988201171c57c91480f9367efd2ffc48625bece98e65b WHIRLPOOL 7f0e9a24cec1ff003da8f1a26554354171c8f6da12b1320c6aa83674c4b637d4143c0b3cd259b890fb106cb4a4a667e56ae74a2ba4b97fb3b46bce7631c8fc00 -EBUILD calckernel-3.4.18-r14.ebuild 5728 SHA256 7509afa90cc6c02c37ec8c02037c7073e506f444df3f1955544c5683e7d166ee SHA512 37a641d7b6f8af722d7a409f38ccd1d100973ab1228e6c31d6cd0d8d53b73a83be4286d404778145ae748c4f206f5a26e41fb45ee824f9b40e4357b918b5f9eb WHIRLPOOL ce2fb19b6b8c83e59178a117d0674fd6002355743c7470700376680be0bf3534a8cab84f68d604f866f9d037bc7f83ab487810b5a1440ba68acda32b25a68d09 -EBUILD calckernel-3.4.18-r15.ebuild 5729 SHA256 f84037be4a05b4831aedb55f179db11491a41db0b29fccfdeca117f8aff4e290 SHA512 284f9792980cc661f71d8933d566646725372e1e162e97de5d526a943b2477d4da420befc3543275776f360b6313436d31932a3caa8f3f77b4d512200d85beec WHIRLPOOL ace835c72cac3c6f20c2c292fe9c43404376a306a5869917ad8a2dd73f337535b517ea789a2bde5f3bab0efa096ee37fe0c39c5faa4a673f2df4644894858503 -EBUILD calckernel-3.4.18-r16.ebuild 5803 SHA256 080d8201ed80d9702011b4c43d4c42f1f7fac1d6c28f9411ac91c5e53e35dcc6 SHA512 0f87353dae81e616bb1e781e2052013ada648e09de422480de9d3482755b45a4ecfcbd447bed849432517898b74da22957f73febda892939dff344a76ae41e03 WHIRLPOOL 3e302a3e9239423b8f9925772039f1ff37cb9f715c9ed1168c64f072448b39691b510c96d0fc3289bc5a504b528709308618cc44003b274de58ae5b632d23b6f -EBUILD calckernel-3.4.18-r2.ebuild 5555 SHA256 b2f0b99ac7f29d24de38b05e6859c7ed426118b8bdae11494e5a46b5635f0676 SHA512 169f68ba020e97ed0ec114cb80a559ced13e3ad848168f82951547653c9105698ca054a9fbd38b33115818307f5a14ef6f397ed42158b8d721cf49a436b7bbeb WHIRLPOOL 574cb6f4fe6d444945e3b97f865c053bff75632fd2182afd615e5d5e618708036b69921ac5c3b00f3f2dee1cb710431da23167abbeccd1af4b631372bc5b3633 -EBUILD calckernel-3.4.18-r3.ebuild 5555 SHA256 b2f0b99ac7f29d24de38b05e6859c7ed426118b8bdae11494e5a46b5635f0676 SHA512 169f68ba020e97ed0ec114cb80a559ced13e3ad848168f82951547653c9105698ca054a9fbd38b33115818307f5a14ef6f397ed42158b8d721cf49a436b7bbeb WHIRLPOOL 574cb6f4fe6d444945e3b97f865c053bff75632fd2182afd615e5d5e618708036b69921ac5c3b00f3f2dee1cb710431da23167abbeccd1af4b631372bc5b3633 -EBUILD calckernel-3.4.18-r4.ebuild 5513 SHA256 cebb614d8ad0cdd495954e9bd2b974da47ab5941ca6aa543fc77c852f0159888 SHA512 ecf0a6f7d232eb81f3deda226914d8096149d8981b04b1c14418f726c39c51d9d9ecfd84c24d2607a385562fb7f44db2ca929215ea2772e4a94307d837df643f WHIRLPOOL fa3a4e64ba2f23532b1277f9162a9ea2b247e79436a4da886f20f4af582fb616f8f533af020e9fd5ea80b8957ef0b5a3b114f1fc50d11bb9276c831ef3b50dca -EBUILD calckernel-3.4.18-r5.ebuild 5513 SHA256 cebb614d8ad0cdd495954e9bd2b974da47ab5941ca6aa543fc77c852f0159888 SHA512 ecf0a6f7d232eb81f3deda226914d8096149d8981b04b1c14418f726c39c51d9d9ecfd84c24d2607a385562fb7f44db2ca929215ea2772e4a94307d837df643f WHIRLPOOL fa3a4e64ba2f23532b1277f9162a9ea2b247e79436a4da886f20f4af582fb616f8f533af020e9fd5ea80b8957ef0b5a3b114f1fc50d11bb9276c831ef3b50dca -EBUILD calckernel-3.4.18-r6.ebuild 5513 SHA256 cebb614d8ad0cdd495954e9bd2b974da47ab5941ca6aa543fc77c852f0159888 SHA512 ecf0a6f7d232eb81f3deda226914d8096149d8981b04b1c14418f726c39c51d9d9ecfd84c24d2607a385562fb7f44db2ca929215ea2772e4a94307d837df643f WHIRLPOOL fa3a4e64ba2f23532b1277f9162a9ea2b247e79436a4da886f20f4af582fb616f8f533af020e9fd5ea80b8957ef0b5a3b114f1fc50d11bb9276c831ef3b50dca -EBUILD calckernel-3.4.18-r7.ebuild 5513 SHA256 cebb614d8ad0cdd495954e9bd2b974da47ab5941ca6aa543fc77c852f0159888 SHA512 ecf0a6f7d232eb81f3deda226914d8096149d8981b04b1c14418f726c39c51d9d9ecfd84c24d2607a385562fb7f44db2ca929215ea2772e4a94307d837df643f WHIRLPOOL fa3a4e64ba2f23532b1277f9162a9ea2b247e79436a4da886f20f4af582fb616f8f533af020e9fd5ea80b8957ef0b5a3b114f1fc50d11bb9276c831ef3b50dca -EBUILD calckernel-3.4.18-r8.ebuild 5555 SHA256 0ec7bc47b747d4814dee456bd4af54082808a9d5877a439aef1f6746a468fbad SHA512 ff426ab41532fd0352e6eb9aea28e3baeb0d358f77341df5162e8a025797edefd3f765a56b2de337ede6901fa04ff3824756c1d9b4b7681e6159e006f415ca53 WHIRLPOOL 1db42b4aa6f730fd3c9276e37f2d5c6b882a5bcc779f7ab67478131ee875a7ce5e323eba7181dcf215b0744898cb28911d15399eea418ae3942bc509188a86a3 -EBUILD calckernel-3.4.18-r9.ebuild 5555 SHA256 0ec7bc47b747d4814dee456bd4af54082808a9d5877a439aef1f6746a468fbad SHA512 ff426ab41532fd0352e6eb9aea28e3baeb0d358f77341df5162e8a025797edefd3f765a56b2de337ede6901fa04ff3824756c1d9b4b7681e6159e006f415ca53 WHIRLPOOL 1db42b4aa6f730fd3c9276e37f2d5c6b882a5bcc779f7ab67478131ee875a7ce5e323eba7181dcf215b0744898cb28911d15399eea418ae3942bc509188a86a3 -EBUILD calckernel-3.4.18.ebuild 5555 SHA256 b2f0b99ac7f29d24de38b05e6859c7ed426118b8bdae11494e5a46b5635f0676 SHA512 169f68ba020e97ed0ec114cb80a559ced13e3ad848168f82951547653c9105698ca054a9fbd38b33115818307f5a14ef6f397ed42158b8d721cf49a436b7bbeb WHIRLPOOL 574cb6f4fe6d444945e3b97f865c053bff75632fd2182afd615e5d5e618708036b69921ac5c3b00f3f2dee1cb710431da23167abbeccd1af4b631372bc5b3633 +EBUILD calckernel-3.4.18-r16.ebuild 5805 SHA256 e6e61db849836c32517ecefe93b13257898e22e0bcb214af5aaac6ba38b8ba4b SHA512 d5f3caec88f5441812c750ec31255cd78f3e136230191b1e92eaee1e02a51492e029fb24f82182d0fae9c0f7440d1082e7bf083c77e8fddd18c19e14ef2fe2bd WHIRLPOOL 938c29f3a6f2b97cee3c57d4600a990305a343328e58568378fc9b19fba62cfc9ba2aa4e2a61181b6134459ec66c03b0b91d006d5984ed3720d652675648ed59 MISC ChangeLog 5828 SHA256 cc0df65dfa6cf4330f604da7cb9f67a81039a8924a20fcf91f07817e5ad2ab0f SHA512 26314a14e441b8fdbcdfa91a74917379e1a868253711b831563ffe2e14a241486ea1defd62e6c9e89b877fba027d5bd710fa1f25dfd97b7a046354b557d77807 WHIRLPOOL a557f2492e06ed0c9aa0b33f22968763b5e36fe28412a6e7a184927931705725184be24c2c7b1e223001e661835d2eacecdde0283580e5cb25b85e1e7f5a975e MISC metadata.xml 332 SHA256 629337dd254d66431dd8752f97f1981de237cf1ca44a0eefc3a7cb8e667d7458 SHA512 c53962eb39db34b583b95075637716f1e4aa3932603d1de72e7f1830b59bcc355cff6a7fbd6a6454693404effc0e3bdc06f22f9f99068b84582617363228cf5b WHIRLPOOL be47dd6b3531019d89524da4ce8eb8b759a356d55b0ba2b133b030e9133341458d7c4dc01ebbd1eb9b6f6eb92dbed9d91dc01b54b8164026e0acaa8b22d64ffd diff --git a/sys-kernel/calckernel/calckernel-3.4.15-r17.ebuild b/sys-kernel/calckernel/calckernel-3.4.15-r17.ebuild deleted file mode 100644 index 3494049b8..000000000 --- a/sys-kernel/calckernel/calckernel-3.4.15-r17.ebuild +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel/genkernel-3.4.13.ebuild,v 1.1 2011/02/10 17:19:16 sping Exp $ - -# genkernel-9999 -> latest Git master -# genkernel-99999 -> latest Git experimental -# genkernel-VERSION -> normal genkernel release - -VERSION_BUSYBOX='1.18.1' -VERSION_DMAP='1.02.22' -VERSION_DMRAID='1.0.0.rc14' -VERSION_MDADM='3.1.4' -VERSION_E2FSPROGS='1.41.14' -VERSION_FUSE='2.7.4' -VERSION_ISCSI='2.0-871' -VERSION_LVM='2.02.74' -VERSION_UNIONFS_FUSE='0.22' -VERSION_GPG='1.4.11' - -MY_P=gen${P/#calc} -S=${WORKDIR}/${MY_P} - -MY_HOME="http://wolf31o2.org" -RH_HOME="ftp://sources.redhat.com/pub" -DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src" -BB_HOME="http://www.busybox.net/downloads" - -COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2 - ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2 - mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2 - ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/dm/device-mapper.${VERSION_DMAP}.tgz - ${RH_HOME}/dm/old/device-mapper.${VERSION_DMAP}.tgz - ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2 - http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz - mirror://sourceforge/e2fsprogs/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz - mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz - http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 - mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2" - -if [[ ${PV} == 9999* ]] -then - EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/genkernel.git" - [[ ${PV} == 99999* ]] && EGIT_BRANCH=experimental - inherit git-2 bash-completion eutils - S="${WORKDIR}/${PN}" - SRC_URI="${COMMON_URI}" - KEYWORDS="" -else - inherit bash-completion eutils - SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 - ${MY_HOME}/sources/genkernel/${MY_P}.tar.bz2 - ftp://ftp.calculate.ru/pub/calculate/calckernel/${MY_P}.tar.bz2 - ${COMMON_URI}" - # Please don't touch individual KEYWORDS. Since this is maintained/tested by - # Release Engineering, it's easier for us to deal with all arches at once. - KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86" -fi - -DESCRIPTION="Calculate automatic kernel building scripts" -HOMEPAGE="http://www.calculate-linux.org/main/ru/calckernel" - -LICENSE="GPL-2" -SLOT="0" -RESTRICT="" -IUSE="ibm selinux video_cards_radeon" - -DEPEND="sys-fs/e2fsprogs - selinux? ( sys-libs/libselinux ) - >=sys-apps/calculate-templates-2.2.13-r1 - !sys-kernel/genkernel" -RDEPEND="${DEPEND} app-arch/cpio - video_cards_radeon? ( sys-kernel/linux-firmware )" - -if [[ ${PV} == 9999* ]]; then - DEPEND="${DEPEND} app-text/asciidoc" -fi - -src_unpack() { - if [[ ${PV} == 9999* ]] ; then - git-2_src_unpack - else - unpack ${MY_P}.tar.bz2 - fi - use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh - cd ${S} - epatch "${FILESDIR}"/${PF}.patch -} - -src_compile() { - if [[ ${PV} == 9999* ]]; then - emake || die - fi -} - -src_install() { - # This block updates genkernel.conf - sed \ - -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \ - -e "s:VERSION_DMAP:$VERSION_DMAP:" \ - -e "s:VERSION_MDADM:$VERSION_MDADM:" \ - -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \ - -e "s:VERSION_E2FSPROGS:$VERSION_E2FSPROGS:" \ - -e "s:VERSION_FUSE:$VERSION_FUSE:" \ - -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \ - -e "s:VERSION_LVM:$VERSION_LVM:" \ - -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \ - -e "s:VERSION_GPG:$VERSION_GPG:" \ - "${S}"/genkernel.conf > "${T}"/genkernel.conf \ - || die "Could not adjust versions" - insinto /etc - doins "${T}"/genkernel.conf || die "doins genkernel.conf" - - doman genkernel.8 || die "doman" - dodoc AUTHORS ChangeLog README TODO || die "dodoc" - - dobin genkernel || die "dobin genkernel" - - rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf - - insinto /usr/share/genkernel - doins -r "${S}"/* || die "doins" - use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \ - cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6 - - # Copy files to /var/cache/genkernel/src - elog "Copying files to /var/cache/genkernel/src..." - mkdir -p "${D}"/var/cache/genkernel/src - cp -f \ - "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \ - "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \ - "${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \ - "${DISTDIR}"/device-mapper.${VERSION_DMAP}.tgz \ - "${DISTDIR}"/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz \ - "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \ - "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \ - "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \ - "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \ - "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \ - "${D}"/var/cache/genkernel/src || die "Copying distfiles..." - - dobashcompletion "${FILESDIR}"/genkernel.bash -} - -pkg_postinst() { - echo - elog 'Documentation is available in the genkernel manual page' - elog 'as well as the following URL:' - echo - elog 'http://www.gentoo.org/doc/en/genkernel.xml' - echo - ewarn "This package is known to not work with reiser4. If you are running" - ewarn "reiser4 and have a problem, do not file a bug. We know it does not" - ewarn "work and we don't plan on fixing it since reiser4 is the one that is" - ewarn "broken in this regard. Try using a sane filesystem like ext3 or" - ewarn "even reiser3." - echo - ewarn "The LUKS support has changed from versions prior to 3.4.4. Now," - ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah." - echo - - bash-completion_pkg_postinst -} diff --git a/sys-kernel/calckernel/calckernel-3.4.18-r1.ebuild b/sys-kernel/calckernel/calckernel-3.4.18-r1.ebuild deleted file mode 100644 index 3494049b8..000000000 --- a/sys-kernel/calckernel/calckernel-3.4.18-r1.ebuild +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel/genkernel-3.4.13.ebuild,v 1.1 2011/02/10 17:19:16 sping Exp $ - -# genkernel-9999 -> latest Git master -# genkernel-99999 -> latest Git experimental -# genkernel-VERSION -> normal genkernel release - -VERSION_BUSYBOX='1.18.1' -VERSION_DMAP='1.02.22' -VERSION_DMRAID='1.0.0.rc14' -VERSION_MDADM='3.1.4' -VERSION_E2FSPROGS='1.41.14' -VERSION_FUSE='2.7.4' -VERSION_ISCSI='2.0-871' -VERSION_LVM='2.02.74' -VERSION_UNIONFS_FUSE='0.22' -VERSION_GPG='1.4.11' - -MY_P=gen${P/#calc} -S=${WORKDIR}/${MY_P} - -MY_HOME="http://wolf31o2.org" -RH_HOME="ftp://sources.redhat.com/pub" -DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src" -BB_HOME="http://www.busybox.net/downloads" - -COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2 - ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2 - mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2 - ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/dm/device-mapper.${VERSION_DMAP}.tgz - ${RH_HOME}/dm/old/device-mapper.${VERSION_DMAP}.tgz - ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2 - http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz - mirror://sourceforge/e2fsprogs/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz - mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz - http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 - mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2" - -if [[ ${PV} == 9999* ]] -then - EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/genkernel.git" - [[ ${PV} == 99999* ]] && EGIT_BRANCH=experimental - inherit git-2 bash-completion eutils - S="${WORKDIR}/${PN}" - SRC_URI="${COMMON_URI}" - KEYWORDS="" -else - inherit bash-completion eutils - SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 - ${MY_HOME}/sources/genkernel/${MY_P}.tar.bz2 - ftp://ftp.calculate.ru/pub/calculate/calckernel/${MY_P}.tar.bz2 - ${COMMON_URI}" - # Please don't touch individual KEYWORDS. Since this is maintained/tested by - # Release Engineering, it's easier for us to deal with all arches at once. - KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86" -fi - -DESCRIPTION="Calculate automatic kernel building scripts" -HOMEPAGE="http://www.calculate-linux.org/main/ru/calckernel" - -LICENSE="GPL-2" -SLOT="0" -RESTRICT="" -IUSE="ibm selinux video_cards_radeon" - -DEPEND="sys-fs/e2fsprogs - selinux? ( sys-libs/libselinux ) - >=sys-apps/calculate-templates-2.2.13-r1 - !sys-kernel/genkernel" -RDEPEND="${DEPEND} app-arch/cpio - video_cards_radeon? ( sys-kernel/linux-firmware )" - -if [[ ${PV} == 9999* ]]; then - DEPEND="${DEPEND} app-text/asciidoc" -fi - -src_unpack() { - if [[ ${PV} == 9999* ]] ; then - git-2_src_unpack - else - unpack ${MY_P}.tar.bz2 - fi - use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh - cd ${S} - epatch "${FILESDIR}"/${PF}.patch -} - -src_compile() { - if [[ ${PV} == 9999* ]]; then - emake || die - fi -} - -src_install() { - # This block updates genkernel.conf - sed \ - -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \ - -e "s:VERSION_DMAP:$VERSION_DMAP:" \ - -e "s:VERSION_MDADM:$VERSION_MDADM:" \ - -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \ - -e "s:VERSION_E2FSPROGS:$VERSION_E2FSPROGS:" \ - -e "s:VERSION_FUSE:$VERSION_FUSE:" \ - -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \ - -e "s:VERSION_LVM:$VERSION_LVM:" \ - -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \ - -e "s:VERSION_GPG:$VERSION_GPG:" \ - "${S}"/genkernel.conf > "${T}"/genkernel.conf \ - || die "Could not adjust versions" - insinto /etc - doins "${T}"/genkernel.conf || die "doins genkernel.conf" - - doman genkernel.8 || die "doman" - dodoc AUTHORS ChangeLog README TODO || die "dodoc" - - dobin genkernel || die "dobin genkernel" - - rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf - - insinto /usr/share/genkernel - doins -r "${S}"/* || die "doins" - use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \ - cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6 - - # Copy files to /var/cache/genkernel/src - elog "Copying files to /var/cache/genkernel/src..." - mkdir -p "${D}"/var/cache/genkernel/src - cp -f \ - "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \ - "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \ - "${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \ - "${DISTDIR}"/device-mapper.${VERSION_DMAP}.tgz \ - "${DISTDIR}"/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz \ - "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \ - "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \ - "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \ - "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \ - "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \ - "${D}"/var/cache/genkernel/src || die "Copying distfiles..." - - dobashcompletion "${FILESDIR}"/genkernel.bash -} - -pkg_postinst() { - echo - elog 'Documentation is available in the genkernel manual page' - elog 'as well as the following URL:' - echo - elog 'http://www.gentoo.org/doc/en/genkernel.xml' - echo - ewarn "This package is known to not work with reiser4. If you are running" - ewarn "reiser4 and have a problem, do not file a bug. We know it does not" - ewarn "work and we don't plan on fixing it since reiser4 is the one that is" - ewarn "broken in this regard. Try using a sane filesystem like ext3 or" - ewarn "even reiser3." - echo - ewarn "The LUKS support has changed from versions prior to 3.4.4. Now," - ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah." - echo - - bash-completion_pkg_postinst -} diff --git a/sys-kernel/calckernel/calckernel-3.4.18-r10.ebuild b/sys-kernel/calckernel/calckernel-3.4.18-r10.ebuild deleted file mode 100644 index dd41e5f1a..000000000 --- a/sys-kernel/calckernel/calckernel-3.4.18-r10.ebuild +++ /dev/null @@ -1,166 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel/genkernel-3.4.13.ebuild,v 1.1 2011/02/10 17:19:16 sping Exp $ - -# genkernel-9999 -> latest Git master -# genkernel-99999 -> latest Git experimental -# genkernel-VERSION -> normal genkernel release - -EAPI="2" - -VERSION_BUSYBOX='1.20.1' -VERSION_DMAP='1.02.22' -VERSION_DMRAID='1.0.0.rc14' -VERSION_MDADM='3.1.4' -VERSION_E2FSPROGS='1.41.14' -VERSION_FUSE='2.7.4' -VERSION_ISCSI='2.0-871' -VERSION_LVM='2.02.74' -VERSION_UNIONFS_FUSE='0.22' -VERSION_GPG='1.4.11' - -MY_P=gen${P/#calc} -S=${WORKDIR}/${MY_P} - -MY_HOME="http://wolf31o2.org" -RH_HOME="ftp://sources.redhat.com/pub" -DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src" -BB_HOME="http://www.busybox.net/downloads" - -COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2 - ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2 - mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2 - ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/dm/device-mapper.${VERSION_DMAP}.tgz - ${RH_HOME}/dm/old/device-mapper.${VERSION_DMAP}.tgz - ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2 - http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz - mirror://sourceforge/e2fsprogs/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz - mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz - http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 - mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2" - -if [[ ${PV} == 9999* ]] -then - EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/genkernel.git" - [[ ${PV} == 99999* ]] && EGIT_BRANCH=experimental - inherit git-2 bash-completion eutils - S="${WORKDIR}/${PN}" - SRC_URI="${COMMON_URI}" - KEYWORDS="" -else - inherit bash-completion eutils - SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 - ${MY_HOME}/sources/genkernel/${MY_P}.tar.bz2 - ftp://ftp.calculate.ru/pub/calculate/calckernel/${MY_P}.tar.bz2 - ${COMMON_URI}" - # Please don't touch individual KEYWORDS. Since this is maintained/tested by - # Release Engineering, it's easier for us to deal with all arches at once. - KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86" -fi - -DESCRIPTION="Calculate automatic kernel building scripts" -HOMEPAGE="http://www.calculate-linux.org/main/ru/calckernel" - -LICENSE="GPL-2" -SLOT="0" -RESTRICT="" -IUSE="ibm selinux video_cards_radeon +nfs" - -DEPEND="sys-fs/e2fsprogs - selinux? ( sys-libs/libselinux ) - nfs? ( net-fs/nfs-utils ) - !sys-kernel/genkernel" -RDEPEND="${DEPEND} app-arch/cpio - video_cards_radeon? ( sys-kernel/linux-firmware )" - -if [[ ${PV} == 9999* ]]; then - DEPEND="${DEPEND} app-text/asciidoc" -fi - -src_unpack() { - if [[ ${PV} == 9999* ]] ; then - git-2_src_unpack - else - unpack ${MY_P}.tar.bz2 - fi - use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh - cd ${S} - epatch "${FILESDIR}"/${PF}.patch -} - -src_compile() { - if [[ ${PV} == 9999* ]]; then - emake || die - fi -} - -src_install() { - # This block updates genkernel.conf - sed \ - -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \ - -e "s:VERSION_DMAP:$VERSION_DMAP:" \ - -e "s:VERSION_MDADM:$VERSION_MDADM:" \ - -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \ - -e "s:VERSION_E2FSPROGS:$VERSION_E2FSPROGS:" \ - -e "s:VERSION_FUSE:$VERSION_FUSE:" \ - -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \ - -e "s:VERSION_LVM:$VERSION_LVM:" \ - -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \ - -e "s:VERSION_GPG:$VERSION_GPG:" \ - "${S}"/genkernel.conf > "${T}"/genkernel.conf \ - || die "Could not adjust versions" - insinto /etc - doins "${T}"/genkernel.conf || die "doins genkernel.conf" - - doman genkernel.8 || die "doman" - dodoc AUTHORS ChangeLog README TODO || die "dodoc" - - dobin genkernel || die "dobin genkernel" - - rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf - - insinto /usr/share/genkernel - doins -r "${S}"/* || die "doins" - use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \ - cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6 - - # Copy files to /var/cache/genkernel/src - elog "Copying files to /var/cache/genkernel/src..." - mkdir -p "${D}"/var/cache/genkernel/src - cp -f \ - "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \ - "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \ - "${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \ - "${DISTDIR}"/device-mapper.${VERSION_DMAP}.tgz \ - "${DISTDIR}"/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz \ - "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \ - "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \ - "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \ - "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \ - "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \ - "${D}"/var/cache/genkernel/src || die "Copying distfiles..." - - dobashcompletion "${FILESDIR}"/genkernel.bash -} - -pkg_postinst() { - echo - elog 'Documentation is available in the genkernel manual page' - elog 'as well as the following URL:' - echo - elog 'http://www.gentoo.org/doc/en/genkernel.xml' - echo - ewarn "This package is known to not work with reiser4. If you are running" - ewarn "reiser4 and have a problem, do not file a bug. We know it does not" - ewarn "work and we don't plan on fixing it since reiser4 is the one that is" - ewarn "broken in this regard. Try using a sane filesystem like ext3 or" - ewarn "even reiser3." - echo - ewarn "The LUKS support has changed from versions prior to 3.4.4. Now," - ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah." - echo - - bash-completion_pkg_postinst -} diff --git a/sys-kernel/calckernel/calckernel-3.4.18-r11.ebuild b/sys-kernel/calckernel/calckernel-3.4.18-r11.ebuild deleted file mode 100644 index 1bb0f54da..000000000 --- a/sys-kernel/calckernel/calckernel-3.4.18-r11.ebuild +++ /dev/null @@ -1,167 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel/genkernel-3.4.13.ebuild,v 1.1 2011/02/10 17:19:16 sping Exp $ - -# genkernel-9999 -> latest Git master -# genkernel-99999 -> latest Git experimental -# genkernel-VERSION -> normal genkernel release - -EAPI="2" - -VERSION_BUSYBOX='1.20.1' -VERSION_DMAP='1.02.22' -VERSION_DMRAID='1.0.0.rc14' -VERSION_MDADM='3.1.4' -VERSION_E2FSPROGS='1.41.14' -VERSION_FUSE='2.7.4' -VERSION_ISCSI='2.0-871' -VERSION_LVM='2.02.74' -VERSION_UNIONFS_FUSE='0.22' -VERSION_GPG='1.4.11' - -MY_P=gen${P/#calc} -S=${WORKDIR}/${MY_P} - -MY_HOME="http://wolf31o2.org" -RH_HOME="ftp://sources.redhat.com/pub" -DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src" -BB_HOME="http://www.busybox.net/downloads" - -COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2 - ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2 - mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2 - ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/dm/device-mapper.${VERSION_DMAP}.tgz - ${RH_HOME}/dm/old/device-mapper.${VERSION_DMAP}.tgz - ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2 - http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz - mirror://sourceforge/e2fsprogs/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz - mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz - http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 - mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2" - -if [[ ${PV} == 9999* ]] -then - EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/genkernel.git" - [[ ${PV} == 99999* ]] && EGIT_BRANCH=experimental - inherit git-2 bash-completion eutils - S="${WORKDIR}/${PN}" - SRC_URI="${COMMON_URI}" - KEYWORDS="" -else - inherit bash-completion eutils - SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 - ${MY_HOME}/sources/genkernel/${MY_P}.tar.bz2 - ftp://ftp.calculate.ru/pub/calculate/calckernel/${MY_P}.tar.bz2 - ${COMMON_URI}" - # Please don't touch individual KEYWORDS. Since this is maintained/tested by - # Release Engineering, it's easier for us to deal with all arches at once. - KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86" -fi - -DESCRIPTION="Calculate automatic kernel building scripts" -HOMEPAGE="http://www.calculate-linux.org/main/ru/calckernel" - -LICENSE="GPL-2" -SLOT="0" -RESTRICT="" -IUSE="ibm +lspci selinux video_cards_radeon +nfs" - -DEPEND="sys-fs/e2fsprogs - selinux? ( sys-libs/libselinux ) - nfs? ( net-fs/nfs-utils ) - !sys-kernel/genkernel" -RDEPEND="${DEPEND} app-arch/cpio - lspci? ( sys-apps/pciutils ) - video_cards_radeon? ( sys-kernel/linux-firmware )" - -if [[ ${PV} == 9999* ]]; then - DEPEND="${DEPEND} app-text/asciidoc" -fi - -src_unpack() { - if [[ ${PV} == 9999* ]] ; then - git-2_src_unpack - else - unpack ${MY_P}.tar.bz2 - fi - use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh - cd ${S} - epatch "${FILESDIR}"/${PF}.patch -} - -src_compile() { - if [[ ${PV} == 9999* ]]; then - emake || die - fi -} - -src_install() { - # This block updates genkernel.conf - sed \ - -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \ - -e "s:VERSION_DMAP:$VERSION_DMAP:" \ - -e "s:VERSION_MDADM:$VERSION_MDADM:" \ - -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \ - -e "s:VERSION_E2FSPROGS:$VERSION_E2FSPROGS:" \ - -e "s:VERSION_FUSE:$VERSION_FUSE:" \ - -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \ - -e "s:VERSION_LVM:$VERSION_LVM:" \ - -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \ - -e "s:VERSION_GPG:$VERSION_GPG:" \ - "${S}"/genkernel.conf > "${T}"/genkernel.conf \ - || die "Could not adjust versions" - insinto /etc - doins "${T}"/genkernel.conf || die "doins genkernel.conf" - - doman genkernel.8 || die "doman" - dodoc AUTHORS ChangeLog README TODO || die "dodoc" - - dobin genkernel || die "dobin genkernel" - - rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf - - insinto /usr/share/genkernel - doins -r "${S}"/* || die "doins" - use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \ - cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6 - - # Copy files to /var/cache/genkernel/src - elog "Copying files to /var/cache/genkernel/src..." - mkdir -p "${D}"/var/cache/genkernel/src - cp -f \ - "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \ - "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \ - "${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \ - "${DISTDIR}"/device-mapper.${VERSION_DMAP}.tgz \ - "${DISTDIR}"/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz \ - "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \ - "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \ - "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \ - "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \ - "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \ - "${D}"/var/cache/genkernel/src || die "Copying distfiles..." - - dobashcompletion "${FILESDIR}"/genkernel.bash -} - -pkg_postinst() { - echo - elog 'Documentation is available in the genkernel manual page' - elog 'as well as the following URL:' - echo - elog 'http://www.gentoo.org/doc/en/genkernel.xml' - echo - ewarn "This package is known to not work with reiser4. If you are running" - ewarn "reiser4 and have a problem, do not file a bug. We know it does not" - ewarn "work and we don't plan on fixing it since reiser4 is the one that is" - ewarn "broken in this regard. Try using a sane filesystem like ext3 or" - ewarn "even reiser3." - echo - ewarn "The LUKS support has changed from versions prior to 3.4.4. Now," - ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah." - echo - - bash-completion_pkg_postinst -} diff --git a/sys-kernel/calckernel/calckernel-3.4.18-r12.ebuild b/sys-kernel/calckernel/calckernel-3.4.18-r12.ebuild deleted file mode 100644 index 691d45edd..000000000 --- a/sys-kernel/calckernel/calckernel-3.4.18-r12.ebuild +++ /dev/null @@ -1,169 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel/genkernel-3.4.13.ebuild,v 1.1 2011/02/10 17:19:16 sping Exp $ - -# genkernel-9999 -> latest Git master -# genkernel-99999 -> latest Git experimental -# genkernel-VERSION -> normal genkernel release - -EAPI="2" - -VERSION_BUSYBOX='1.20.1' -VERSION_DMAP='1.02.22' -VERSION_DMRAID='1.0.0.rc14' -VERSION_MDADM='3.1.4' -VERSION_E2FSPROGS='1.41.14' -VERSION_FUSE='2.7.4' -VERSION_ISCSI='2.0-871' -VERSION_LVM='2.02.74' -VERSION_UNIONFS_FUSE='0.22' -VERSION_GPG='1.4.11' - -MY_P=gen${P/#calc} -S=${WORKDIR}/${MY_P} - -MY_HOME="http://wolf31o2.org" -RH_HOME="ftp://sources.redhat.com/pub" -DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src" -BB_HOME="http://www.busybox.net/downloads" - -COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2 - ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2 - mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2 - ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/dm/device-mapper.${VERSION_DMAP}.tgz - ${RH_HOME}/dm/old/device-mapper.${VERSION_DMAP}.tgz - ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2 - http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz - mirror://sourceforge/e2fsprogs/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz - mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz - http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 - mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2" - -if [[ ${PV} == 9999* ]] -then - EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/genkernel.git" - [[ ${PV} == 99999* ]] && EGIT_BRANCH=experimental - inherit git-2 bash-completion eutils - S="${WORKDIR}/${PN}" - SRC_URI="${COMMON_URI}" - KEYWORDS="" -else - inherit bash-completion eutils - SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 - ${MY_HOME}/sources/genkernel/${MY_P}.tar.bz2 - ftp://ftp.calculate.ru/pub/calculate/calckernel/${MY_P}.tar.bz2 - ${COMMON_URI}" - # Please don't touch individual KEYWORDS. Since this is maintained/tested by - # Release Engineering, it's easier for us to deal with all arches at once. - KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86" -fi - -DESCRIPTION="Calculate automatic kernel building scripts" -HOMEPAGE="http://www.calculate-linux.org/main/ru/calckernel" - -LICENSE="GPL-2" -SLOT="0" -RESTRICT="" -IUSE="ibm +lspci selinux video_cards_radeon +nfs" - -DEPEND="sys-fs/e2fsprogs - selinux? ( sys-libs/libselinux ) - nfs? ( net-fs/nfs-utils ) - !sys-kernel/genkernel" -RDEPEND="${DEPEND} app-arch/cpio - >=sys-fs/udev-197 - lspci? ( sys-apps/pciutils ) - video_cards_radeon? ( sys-kernel/linux-firmware )" - -if [[ ${PV} == 9999* ]]; then - DEPEND="${DEPEND} app-text/asciidoc" -fi - -src_unpack() { - if [[ ${PV} == 9999* ]] ; then - git-2_src_unpack - else - unpack ${MY_P}.tar.bz2 - fi - use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh - cd ${S} - epatch "${FILESDIR}"/${PF}.patch - epatch "${FILESDIR}"/calckernel-3.4.18-fix_udev.patch -} - -src_compile() { - if [[ ${PV} == 9999* ]]; then - emake || die - fi -} - -src_install() { - # This block updates genkernel.conf - sed \ - -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \ - -e "s:VERSION_DMAP:$VERSION_DMAP:" \ - -e "s:VERSION_MDADM:$VERSION_MDADM:" \ - -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \ - -e "s:VERSION_E2FSPROGS:$VERSION_E2FSPROGS:" \ - -e "s:VERSION_FUSE:$VERSION_FUSE:" \ - -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \ - -e "s:VERSION_LVM:$VERSION_LVM:" \ - -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \ - -e "s:VERSION_GPG:$VERSION_GPG:" \ - "${S}"/genkernel.conf > "${T}"/genkernel.conf \ - || die "Could not adjust versions" - insinto /etc - doins "${T}"/genkernel.conf || die "doins genkernel.conf" - - doman genkernel.8 || die "doman" - dodoc AUTHORS ChangeLog README TODO || die "dodoc" - - dobin genkernel || die "dobin genkernel" - - rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf - - insinto /usr/share/genkernel - doins -r "${S}"/* || die "doins" - use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \ - cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6 - - # Copy files to /var/cache/genkernel/src - elog "Copying files to /var/cache/genkernel/src..." - mkdir -p "${D}"/var/cache/genkernel/src - cp -f \ - "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \ - "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \ - "${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \ - "${DISTDIR}"/device-mapper.${VERSION_DMAP}.tgz \ - "${DISTDIR}"/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz \ - "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \ - "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \ - "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \ - "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \ - "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \ - "${D}"/var/cache/genkernel/src || die "Copying distfiles..." - - dobashcompletion "${FILESDIR}"/genkernel.bash -} - -pkg_postinst() { - echo - elog 'Documentation is available in the genkernel manual page' - elog 'as well as the following URL:' - echo - elog 'http://www.gentoo.org/doc/en/genkernel.xml' - echo - ewarn "This package is known to not work with reiser4. If you are running" - ewarn "reiser4 and have a problem, do not file a bug. We know it does not" - ewarn "work and we don't plan on fixing it since reiser4 is the one that is" - ewarn "broken in this regard. Try using a sane filesystem like ext3 or" - ewarn "even reiser3." - echo - ewarn "The LUKS support has changed from versions prior to 3.4.4. Now," - ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah." - echo - - bash-completion_pkg_postinst -} diff --git a/sys-kernel/calckernel/calckernel-3.4.18-r14.ebuild b/sys-kernel/calckernel/calckernel-3.4.18-r14.ebuild deleted file mode 100644 index 54690a3b7..000000000 --- a/sys-kernel/calckernel/calckernel-3.4.18-r14.ebuild +++ /dev/null @@ -1,170 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel/genkernel-3.4.13.ebuild,v 1.1 2011/02/10 17:19:16 sping Exp $ - -# genkernel-9999 -> latest Git master -# genkernel-99999 -> latest Git experimental -# genkernel-VERSION -> normal genkernel release - -EAPI="2" - -VERSION_BUSYBOX='1.20.1' -VERSION_DMAP='1.02.22' -VERSION_DMRAID='1.0.0.rc14' -VERSION_MDADM='3.1.4' -VERSION_E2FSPROGS='1.41.14' -VERSION_FUSE='2.7.4' -VERSION_ISCSI='2.0-871' -VERSION_LVM='2.02.74' -VERSION_UNIONFS_FUSE='0.22' -VERSION_GPG='1.4.11' - -MY_P=gen${P/#calc} -S=${WORKDIR}/${MY_P} - -MY_HOME="http://wolf31o2.org" -RH_HOME="ftp://sources.redhat.com/pub" -DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src" -BB_HOME="http://www.busybox.net/downloads" - -COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2 - ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2 - mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2 - ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/dm/device-mapper.${VERSION_DMAP}.tgz - ${RH_HOME}/dm/old/device-mapper.${VERSION_DMAP}.tgz - ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2 - http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz - mirror://sourceforge/e2fsprogs/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz - mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz - http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 - mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2" - -if [[ ${PV} == 9999* ]] -then - EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/genkernel.git" - [[ ${PV} == 99999* ]] && EGIT_BRANCH=experimental - inherit git-2 bash-completion eutils - S="${WORKDIR}/${PN}" - SRC_URI="${COMMON_URI}" - KEYWORDS="" -else - inherit bash-completion eutils - SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 - ${MY_HOME}/sources/genkernel/${MY_P}.tar.bz2 - ftp://ftp.calculate.ru/pub/calculate/calckernel/${MY_P}.tar.bz2 - ${COMMON_URI}" - # Please don't touch individual KEYWORDS. Since this is maintained/tested by - # Release Engineering, it's easier for us to deal with all arches at once. - KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86" -fi - -DESCRIPTION="Calculate automatic kernel building scripts" -HOMEPAGE="http://www.calculate-linux.org/main/ru/calckernel" - -LICENSE="GPL-2" -SLOT="0" -RESTRICT="" -IUSE="ibm +lspci selinux video_cards_radeon +nfs" - -DEPEND="sys-fs/e2fsprogs - selinux? ( sys-libs/libselinux ) - nfs? ( net-fs/nfs-utils ) - !sys-kernel/genkernel" -RDEPEND="${DEPEND} app-arch/cpio - >=sys-fs/udev-197 - lspci? ( sys-apps/pciutils ) - video_cards_radeon? ( sys-kernel/linux-firmware )" - -if [[ ${PV} == 9999* ]]; then - DEPEND="${DEPEND} app-text/asciidoc" -fi - -src_unpack() { - if [[ ${PV} == 9999* ]] ; then - git-2_src_unpack - else - unpack ${MY_P}.tar.bz2 - fi - use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh - cd ${S} - epatch "${FILESDIR}"/${PF}.patch - epatch "${FILESDIR}"/calckernel-3.4.18-fix_udev.patch - epatch "${FILESDIR}"/calckernel-3.4.18-fix_slow_device.patch -} - -src_compile() { - if [[ ${PV} == 9999* ]]; then - emake || die - fi -} - -src_install() { - # This block updates genkernel.conf - sed \ - -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \ - -e "s:VERSION_DMAP:$VERSION_DMAP:" \ - -e "s:VERSION_MDADM:$VERSION_MDADM:" \ - -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \ - -e "s:VERSION_E2FSPROGS:$VERSION_E2FSPROGS:" \ - -e "s:VERSION_FUSE:$VERSION_FUSE:" \ - -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \ - -e "s:VERSION_LVM:$VERSION_LVM:" \ - -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \ - -e "s:VERSION_GPG:$VERSION_GPG:" \ - "${S}"/genkernel.conf > "${T}"/genkernel.conf \ - || die "Could not adjust versions" - insinto /etc - doins "${T}"/genkernel.conf || die "doins genkernel.conf" - - doman genkernel.8 || die "doman" - dodoc AUTHORS ChangeLog README TODO || die "dodoc" - - dobin genkernel || die "dobin genkernel" - - rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf - - insinto /usr/share/genkernel - doins -r "${S}"/* || die "doins" - use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \ - cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6 - - # Copy files to /var/cache/genkernel/src - elog "Copying files to /var/cache/genkernel/src..." - mkdir -p "${D}"/var/cache/genkernel/src - cp -f \ - "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \ - "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \ - "${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \ - "${DISTDIR}"/device-mapper.${VERSION_DMAP}.tgz \ - "${DISTDIR}"/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz \ - "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \ - "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \ - "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \ - "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \ - "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \ - "${D}"/var/cache/genkernel/src || die "Copying distfiles..." - - dobashcompletion "${FILESDIR}"/genkernel.bash -} - -pkg_postinst() { - echo - elog 'Documentation is available in the genkernel manual page' - elog 'as well as the following URL:' - echo - elog 'http://www.gentoo.org/doc/en/genkernel.xml' - echo - ewarn "This package is known to not work with reiser4. If you are running" - ewarn "reiser4 and have a problem, do not file a bug. We know it does not" - ewarn "work and we don't plan on fixing it since reiser4 is the one that is" - ewarn "broken in this regard. Try using a sane filesystem like ext3 or" - ewarn "even reiser3." - echo - ewarn "The LUKS support has changed from versions prior to 3.4.4. Now," - ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah." - echo - - bash-completion_pkg_postinst -} diff --git a/sys-kernel/calckernel/calckernel-3.4.18-r15.ebuild b/sys-kernel/calckernel/calckernel-3.4.18-r15.ebuild deleted file mode 100644 index e18c087f7..000000000 --- a/sys-kernel/calckernel/calckernel-3.4.18-r15.ebuild +++ /dev/null @@ -1,170 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel/genkernel-3.4.13.ebuild,v 1.1 2011/02/10 17:19:16 sping Exp $ - -# genkernel-9999 -> latest Git master -# genkernel-99999 -> latest Git experimental -# genkernel-VERSION -> normal genkernel release - -EAPI="2" - -VERSION_BUSYBOX='1.20.1' -VERSION_DMAP='1.02.22' -VERSION_DMRAID='1.0.0.rc14' -VERSION_MDADM='3.1.4' -VERSION_E2FSPROGS='1.41.14' -VERSION_FUSE='2.7.4' -VERSION_ISCSI='2.0-871' -VERSION_LVM='2.02.74' -VERSION_UNIONFS_FUSE='0.22' -VERSION_GPG='1.4.11' - -MY_P=gen${P/#calc} -S=${WORKDIR}/${MY_P} - -MY_HOME="http://wolf31o2.org" -RH_HOME="ftp://sources.redhat.com/pub" -DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src" -BB_HOME="http://www.busybox.net/downloads" - -COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2 - ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2 - mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2 - ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/dm/device-mapper.${VERSION_DMAP}.tgz - ${RH_HOME}/dm/old/device-mapper.${VERSION_DMAP}.tgz - ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2 - http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz - mirror://sourceforge/e2fsprogs/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz - mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz - http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 - mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2" - -if [[ ${PV} == 9999* ]] -then - EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/genkernel.git" - [[ ${PV} == 99999* ]] && EGIT_BRANCH=experimental - inherit git-2 bash-completion eutils - S="${WORKDIR}/${PN}" - SRC_URI="${COMMON_URI}" - KEYWORDS="" -else - inherit bash-completion eutils - SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 - ${MY_HOME}/sources/genkernel/${MY_P}.tar.bz2 - ftp://ftp.calculate.ru/pub/calculate/calckernel/${MY_P}.tar.bz2 - ${COMMON_URI}" - # Please don't touch individual KEYWORDS. Since this is maintained/tested by - # Release Engineering, it's easier for us to deal with all arches at once. - KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86" -fi - -DESCRIPTION="Calculate automatic kernel building scripts" -HOMEPAGE="http://www.calculate-linux.org/main/ru/calckernel" - -LICENSE="GPL-2" -SLOT="0" -RESTRICT="" -IUSE="ibm +lspci selinux video_cards_radeon +nfs" - -DEPEND="sys-fs/e2fsprogs - selinux? ( sys-libs/libselinux ) - nfs? ( net-fs/nfs-utils ) - !sys-kernel/genkernel" -RDEPEND="${DEPEND} app-arch/cpio - >=virtual/udev-197 - lspci? ( sys-apps/pciutils ) - video_cards_radeon? ( sys-kernel/linux-firmware )" - -if [[ ${PV} == 9999* ]]; then - DEPEND="${DEPEND} app-text/asciidoc" -fi - -src_unpack() { - if [[ ${PV} == 9999* ]] ; then - git-2_src_unpack - else - unpack ${MY_P}.tar.bz2 - fi - use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh - cd ${S} - epatch "${FILESDIR}"/${PF}.patch - epatch "${FILESDIR}"/calckernel-3.4.18-fix_udev.patch - epatch "${FILESDIR}"/calckernel-3.4.18-fix_slow_device.patch -} - -src_compile() { - if [[ ${PV} == 9999* ]]; then - emake || die - fi -} - -src_install() { - # This block updates genkernel.conf - sed \ - -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \ - -e "s:VERSION_DMAP:$VERSION_DMAP:" \ - -e "s:VERSION_MDADM:$VERSION_MDADM:" \ - -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \ - -e "s:VERSION_E2FSPROGS:$VERSION_E2FSPROGS:" \ - -e "s:VERSION_FUSE:$VERSION_FUSE:" \ - -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \ - -e "s:VERSION_LVM:$VERSION_LVM:" \ - -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \ - -e "s:VERSION_GPG:$VERSION_GPG:" \ - "${S}"/genkernel.conf > "${T}"/genkernel.conf \ - || die "Could not adjust versions" - insinto /etc - doins "${T}"/genkernel.conf || die "doins genkernel.conf" - - doman genkernel.8 || die "doman" - dodoc AUTHORS ChangeLog README TODO || die "dodoc" - - dobin genkernel || die "dobin genkernel" - - rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf - - insinto /usr/share/genkernel - doins -r "${S}"/* || die "doins" - use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \ - cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6 - - # Copy files to /var/cache/genkernel/src - elog "Copying files to /var/cache/genkernel/src..." - mkdir -p "${D}"/var/cache/genkernel/src - cp -f \ - "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \ - "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \ - "${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \ - "${DISTDIR}"/device-mapper.${VERSION_DMAP}.tgz \ - "${DISTDIR}"/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz \ - "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \ - "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \ - "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \ - "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \ - "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \ - "${D}"/var/cache/genkernel/src || die "Copying distfiles..." - - dobashcompletion "${FILESDIR}"/genkernel.bash -} - -pkg_postinst() { - echo - elog 'Documentation is available in the genkernel manual page' - elog 'as well as the following URL:' - echo - elog 'http://www.gentoo.org/doc/en/genkernel.xml' - echo - ewarn "This package is known to not work with reiser4. If you are running" - ewarn "reiser4 and have a problem, do not file a bug. We know it does not" - ewarn "work and we don't plan on fixing it since reiser4 is the one that is" - ewarn "broken in this regard. Try using a sane filesystem like ext3 or" - ewarn "even reiser3." - echo - ewarn "The LUKS support has changed from versions prior to 3.4.4. Now," - ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah." - echo - - bash-completion_pkg_postinst -} diff --git a/sys-kernel/calckernel/calckernel-3.4.18-r16.ebuild b/sys-kernel/calckernel/calckernel-3.4.18-r16.ebuild index 730737d53..0073cae3f 100644 --- a/sys-kernel/calckernel/calckernel-3.4.18-r16.ebuild +++ b/sys-kernel/calckernel/calckernel-3.4.18-r16.ebuild @@ -57,7 +57,7 @@ else ${COMMON_URI}" # Please don't touch individual KEYWORDS. Since this is maintained/tested by # Release Engineering, it's easier for us to deal with all arches at once. - KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86" + KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" fi DESCRIPTION="Calculate automatic kernel building scripts" diff --git a/sys-kernel/calckernel/calckernel-3.4.18-r2.ebuild b/sys-kernel/calckernel/calckernel-3.4.18-r2.ebuild deleted file mode 100644 index 3494049b8..000000000 --- a/sys-kernel/calckernel/calckernel-3.4.18-r2.ebuild +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel/genkernel-3.4.13.ebuild,v 1.1 2011/02/10 17:19:16 sping Exp $ - -# genkernel-9999 -> latest Git master -# genkernel-99999 -> latest Git experimental -# genkernel-VERSION -> normal genkernel release - -VERSION_BUSYBOX='1.18.1' -VERSION_DMAP='1.02.22' -VERSION_DMRAID='1.0.0.rc14' -VERSION_MDADM='3.1.4' -VERSION_E2FSPROGS='1.41.14' -VERSION_FUSE='2.7.4' -VERSION_ISCSI='2.0-871' -VERSION_LVM='2.02.74' -VERSION_UNIONFS_FUSE='0.22' -VERSION_GPG='1.4.11' - -MY_P=gen${P/#calc} -S=${WORKDIR}/${MY_P} - -MY_HOME="http://wolf31o2.org" -RH_HOME="ftp://sources.redhat.com/pub" -DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src" -BB_HOME="http://www.busybox.net/downloads" - -COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2 - ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2 - mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2 - ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/dm/device-mapper.${VERSION_DMAP}.tgz - ${RH_HOME}/dm/old/device-mapper.${VERSION_DMAP}.tgz - ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2 - http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz - mirror://sourceforge/e2fsprogs/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz - mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz - http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 - mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2" - -if [[ ${PV} == 9999* ]] -then - EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/genkernel.git" - [[ ${PV} == 99999* ]] && EGIT_BRANCH=experimental - inherit git-2 bash-completion eutils - S="${WORKDIR}/${PN}" - SRC_URI="${COMMON_URI}" - KEYWORDS="" -else - inherit bash-completion eutils - SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 - ${MY_HOME}/sources/genkernel/${MY_P}.tar.bz2 - ftp://ftp.calculate.ru/pub/calculate/calckernel/${MY_P}.tar.bz2 - ${COMMON_URI}" - # Please don't touch individual KEYWORDS. Since this is maintained/tested by - # Release Engineering, it's easier for us to deal with all arches at once. - KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86" -fi - -DESCRIPTION="Calculate automatic kernel building scripts" -HOMEPAGE="http://www.calculate-linux.org/main/ru/calckernel" - -LICENSE="GPL-2" -SLOT="0" -RESTRICT="" -IUSE="ibm selinux video_cards_radeon" - -DEPEND="sys-fs/e2fsprogs - selinux? ( sys-libs/libselinux ) - >=sys-apps/calculate-templates-2.2.13-r1 - !sys-kernel/genkernel" -RDEPEND="${DEPEND} app-arch/cpio - video_cards_radeon? ( sys-kernel/linux-firmware )" - -if [[ ${PV} == 9999* ]]; then - DEPEND="${DEPEND} app-text/asciidoc" -fi - -src_unpack() { - if [[ ${PV} == 9999* ]] ; then - git-2_src_unpack - else - unpack ${MY_P}.tar.bz2 - fi - use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh - cd ${S} - epatch "${FILESDIR}"/${PF}.patch -} - -src_compile() { - if [[ ${PV} == 9999* ]]; then - emake || die - fi -} - -src_install() { - # This block updates genkernel.conf - sed \ - -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \ - -e "s:VERSION_DMAP:$VERSION_DMAP:" \ - -e "s:VERSION_MDADM:$VERSION_MDADM:" \ - -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \ - -e "s:VERSION_E2FSPROGS:$VERSION_E2FSPROGS:" \ - -e "s:VERSION_FUSE:$VERSION_FUSE:" \ - -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \ - -e "s:VERSION_LVM:$VERSION_LVM:" \ - -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \ - -e "s:VERSION_GPG:$VERSION_GPG:" \ - "${S}"/genkernel.conf > "${T}"/genkernel.conf \ - || die "Could not adjust versions" - insinto /etc - doins "${T}"/genkernel.conf || die "doins genkernel.conf" - - doman genkernel.8 || die "doman" - dodoc AUTHORS ChangeLog README TODO || die "dodoc" - - dobin genkernel || die "dobin genkernel" - - rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf - - insinto /usr/share/genkernel - doins -r "${S}"/* || die "doins" - use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \ - cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6 - - # Copy files to /var/cache/genkernel/src - elog "Copying files to /var/cache/genkernel/src..." - mkdir -p "${D}"/var/cache/genkernel/src - cp -f \ - "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \ - "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \ - "${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \ - "${DISTDIR}"/device-mapper.${VERSION_DMAP}.tgz \ - "${DISTDIR}"/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz \ - "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \ - "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \ - "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \ - "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \ - "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \ - "${D}"/var/cache/genkernel/src || die "Copying distfiles..." - - dobashcompletion "${FILESDIR}"/genkernel.bash -} - -pkg_postinst() { - echo - elog 'Documentation is available in the genkernel manual page' - elog 'as well as the following URL:' - echo - elog 'http://www.gentoo.org/doc/en/genkernel.xml' - echo - ewarn "This package is known to not work with reiser4. If you are running" - ewarn "reiser4 and have a problem, do not file a bug. We know it does not" - ewarn "work and we don't plan on fixing it since reiser4 is the one that is" - ewarn "broken in this regard. Try using a sane filesystem like ext3 or" - ewarn "even reiser3." - echo - ewarn "The LUKS support has changed from versions prior to 3.4.4. Now," - ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah." - echo - - bash-completion_pkg_postinst -} diff --git a/sys-kernel/calckernel/calckernel-3.4.18-r3.ebuild b/sys-kernel/calckernel/calckernel-3.4.18-r3.ebuild deleted file mode 100644 index 3494049b8..000000000 --- a/sys-kernel/calckernel/calckernel-3.4.18-r3.ebuild +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel/genkernel-3.4.13.ebuild,v 1.1 2011/02/10 17:19:16 sping Exp $ - -# genkernel-9999 -> latest Git master -# genkernel-99999 -> latest Git experimental -# genkernel-VERSION -> normal genkernel release - -VERSION_BUSYBOX='1.18.1' -VERSION_DMAP='1.02.22' -VERSION_DMRAID='1.0.0.rc14' -VERSION_MDADM='3.1.4' -VERSION_E2FSPROGS='1.41.14' -VERSION_FUSE='2.7.4' -VERSION_ISCSI='2.0-871' -VERSION_LVM='2.02.74' -VERSION_UNIONFS_FUSE='0.22' -VERSION_GPG='1.4.11' - -MY_P=gen${P/#calc} -S=${WORKDIR}/${MY_P} - -MY_HOME="http://wolf31o2.org" -RH_HOME="ftp://sources.redhat.com/pub" -DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src" -BB_HOME="http://www.busybox.net/downloads" - -COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2 - ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2 - mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2 - ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/dm/device-mapper.${VERSION_DMAP}.tgz - ${RH_HOME}/dm/old/device-mapper.${VERSION_DMAP}.tgz - ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2 - http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz - mirror://sourceforge/e2fsprogs/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz - mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz - http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 - mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2" - -if [[ ${PV} == 9999* ]] -then - EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/genkernel.git" - [[ ${PV} == 99999* ]] && EGIT_BRANCH=experimental - inherit git-2 bash-completion eutils - S="${WORKDIR}/${PN}" - SRC_URI="${COMMON_URI}" - KEYWORDS="" -else - inherit bash-completion eutils - SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 - ${MY_HOME}/sources/genkernel/${MY_P}.tar.bz2 - ftp://ftp.calculate.ru/pub/calculate/calckernel/${MY_P}.tar.bz2 - ${COMMON_URI}" - # Please don't touch individual KEYWORDS. Since this is maintained/tested by - # Release Engineering, it's easier for us to deal with all arches at once. - KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86" -fi - -DESCRIPTION="Calculate automatic kernel building scripts" -HOMEPAGE="http://www.calculate-linux.org/main/ru/calckernel" - -LICENSE="GPL-2" -SLOT="0" -RESTRICT="" -IUSE="ibm selinux video_cards_radeon" - -DEPEND="sys-fs/e2fsprogs - selinux? ( sys-libs/libselinux ) - >=sys-apps/calculate-templates-2.2.13-r1 - !sys-kernel/genkernel" -RDEPEND="${DEPEND} app-arch/cpio - video_cards_radeon? ( sys-kernel/linux-firmware )" - -if [[ ${PV} == 9999* ]]; then - DEPEND="${DEPEND} app-text/asciidoc" -fi - -src_unpack() { - if [[ ${PV} == 9999* ]] ; then - git-2_src_unpack - else - unpack ${MY_P}.tar.bz2 - fi - use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh - cd ${S} - epatch "${FILESDIR}"/${PF}.patch -} - -src_compile() { - if [[ ${PV} == 9999* ]]; then - emake || die - fi -} - -src_install() { - # This block updates genkernel.conf - sed \ - -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \ - -e "s:VERSION_DMAP:$VERSION_DMAP:" \ - -e "s:VERSION_MDADM:$VERSION_MDADM:" \ - -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \ - -e "s:VERSION_E2FSPROGS:$VERSION_E2FSPROGS:" \ - -e "s:VERSION_FUSE:$VERSION_FUSE:" \ - -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \ - -e "s:VERSION_LVM:$VERSION_LVM:" \ - -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \ - -e "s:VERSION_GPG:$VERSION_GPG:" \ - "${S}"/genkernel.conf > "${T}"/genkernel.conf \ - || die "Could not adjust versions" - insinto /etc - doins "${T}"/genkernel.conf || die "doins genkernel.conf" - - doman genkernel.8 || die "doman" - dodoc AUTHORS ChangeLog README TODO || die "dodoc" - - dobin genkernel || die "dobin genkernel" - - rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf - - insinto /usr/share/genkernel - doins -r "${S}"/* || die "doins" - use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \ - cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6 - - # Copy files to /var/cache/genkernel/src - elog "Copying files to /var/cache/genkernel/src..." - mkdir -p "${D}"/var/cache/genkernel/src - cp -f \ - "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \ - "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \ - "${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \ - "${DISTDIR}"/device-mapper.${VERSION_DMAP}.tgz \ - "${DISTDIR}"/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz \ - "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \ - "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \ - "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \ - "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \ - "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \ - "${D}"/var/cache/genkernel/src || die "Copying distfiles..." - - dobashcompletion "${FILESDIR}"/genkernel.bash -} - -pkg_postinst() { - echo - elog 'Documentation is available in the genkernel manual page' - elog 'as well as the following URL:' - echo - elog 'http://www.gentoo.org/doc/en/genkernel.xml' - echo - ewarn "This package is known to not work with reiser4. If you are running" - ewarn "reiser4 and have a problem, do not file a bug. We know it does not" - ewarn "work and we don't plan on fixing it since reiser4 is the one that is" - ewarn "broken in this regard. Try using a sane filesystem like ext3 or" - ewarn "even reiser3." - echo - ewarn "The LUKS support has changed from versions prior to 3.4.4. Now," - ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah." - echo - - bash-completion_pkg_postinst -} diff --git a/sys-kernel/calckernel/calckernel-3.4.18-r4.ebuild b/sys-kernel/calckernel/calckernel-3.4.18-r4.ebuild deleted file mode 100644 index b41343295..000000000 --- a/sys-kernel/calckernel/calckernel-3.4.18-r4.ebuild +++ /dev/null @@ -1,163 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel/genkernel-3.4.13.ebuild,v 1.1 2011/02/10 17:19:16 sping Exp $ - -# genkernel-9999 -> latest Git master -# genkernel-99999 -> latest Git experimental -# genkernel-VERSION -> normal genkernel release - -VERSION_BUSYBOX='1.18.1' -VERSION_DMAP='1.02.22' -VERSION_DMRAID='1.0.0.rc14' -VERSION_MDADM='3.1.4' -VERSION_E2FSPROGS='1.41.14' -VERSION_FUSE='2.7.4' -VERSION_ISCSI='2.0-871' -VERSION_LVM='2.02.74' -VERSION_UNIONFS_FUSE='0.22' -VERSION_GPG='1.4.11' - -MY_P=gen${P/#calc} -S=${WORKDIR}/${MY_P} - -MY_HOME="http://wolf31o2.org" -RH_HOME="ftp://sources.redhat.com/pub" -DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src" -BB_HOME="http://www.busybox.net/downloads" - -COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2 - ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2 - mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2 - ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/dm/device-mapper.${VERSION_DMAP}.tgz - ${RH_HOME}/dm/old/device-mapper.${VERSION_DMAP}.tgz - ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2 - http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz - mirror://sourceforge/e2fsprogs/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz - mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz - http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 - mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2" - -if [[ ${PV} == 9999* ]] -then - EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/genkernel.git" - [[ ${PV} == 99999* ]] && EGIT_BRANCH=experimental - inherit git-2 bash-completion eutils - S="${WORKDIR}/${PN}" - SRC_URI="${COMMON_URI}" - KEYWORDS="" -else - inherit bash-completion eutils - SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 - ${MY_HOME}/sources/genkernel/${MY_P}.tar.bz2 - ftp://ftp.calculate.ru/pub/calculate/calckernel/${MY_P}.tar.bz2 - ${COMMON_URI}" - # Please don't touch individual KEYWORDS. Since this is maintained/tested by - # Release Engineering, it's easier for us to deal with all arches at once. - KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86" -fi - -DESCRIPTION="Calculate automatic kernel building scripts" -HOMEPAGE="http://www.calculate-linux.org/main/ru/calckernel" - -LICENSE="GPL-2" -SLOT="0" -RESTRICT="" -IUSE="ibm selinux video_cards_radeon" - -DEPEND="sys-fs/e2fsprogs - selinux? ( sys-libs/libselinux ) - !sys-kernel/genkernel" -RDEPEND="${DEPEND} app-arch/cpio - video_cards_radeon? ( sys-kernel/linux-firmware )" - -if [[ ${PV} == 9999* ]]; then - DEPEND="${DEPEND} app-text/asciidoc" -fi - -src_unpack() { - if [[ ${PV} == 9999* ]] ; then - git-2_src_unpack - else - unpack ${MY_P}.tar.bz2 - fi - use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh - cd ${S} - epatch "${FILESDIR}"/${PF}.patch -} - -src_compile() { - if [[ ${PV} == 9999* ]]; then - emake || die - fi -} - -src_install() { - # This block updates genkernel.conf - sed \ - -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \ - -e "s:VERSION_DMAP:$VERSION_DMAP:" \ - -e "s:VERSION_MDADM:$VERSION_MDADM:" \ - -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \ - -e "s:VERSION_E2FSPROGS:$VERSION_E2FSPROGS:" \ - -e "s:VERSION_FUSE:$VERSION_FUSE:" \ - -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \ - -e "s:VERSION_LVM:$VERSION_LVM:" \ - -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \ - -e "s:VERSION_GPG:$VERSION_GPG:" \ - "${S}"/genkernel.conf > "${T}"/genkernel.conf \ - || die "Could not adjust versions" - insinto /etc - doins "${T}"/genkernel.conf || die "doins genkernel.conf" - - doman genkernel.8 || die "doman" - dodoc AUTHORS ChangeLog README TODO || die "dodoc" - - dobin genkernel || die "dobin genkernel" - - rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf - - insinto /usr/share/genkernel - doins -r "${S}"/* || die "doins" - use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \ - cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6 - - # Copy files to /var/cache/genkernel/src - elog "Copying files to /var/cache/genkernel/src..." - mkdir -p "${D}"/var/cache/genkernel/src - cp -f \ - "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \ - "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \ - "${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \ - "${DISTDIR}"/device-mapper.${VERSION_DMAP}.tgz \ - "${DISTDIR}"/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz \ - "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \ - "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \ - "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \ - "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \ - "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \ - "${D}"/var/cache/genkernel/src || die "Copying distfiles..." - - dobashcompletion "${FILESDIR}"/genkernel.bash -} - -pkg_postinst() { - echo - elog 'Documentation is available in the genkernel manual page' - elog 'as well as the following URL:' - echo - elog 'http://www.gentoo.org/doc/en/genkernel.xml' - echo - ewarn "This package is known to not work with reiser4. If you are running" - ewarn "reiser4 and have a problem, do not file a bug. We know it does not" - ewarn "work and we don't plan on fixing it since reiser4 is the one that is" - ewarn "broken in this regard. Try using a sane filesystem like ext3 or" - ewarn "even reiser3." - echo - ewarn "The LUKS support has changed from versions prior to 3.4.4. Now," - ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah." - echo - - bash-completion_pkg_postinst -} diff --git a/sys-kernel/calckernel/calckernel-3.4.18-r5.ebuild b/sys-kernel/calckernel/calckernel-3.4.18-r5.ebuild deleted file mode 100644 index b41343295..000000000 --- a/sys-kernel/calckernel/calckernel-3.4.18-r5.ebuild +++ /dev/null @@ -1,163 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel/genkernel-3.4.13.ebuild,v 1.1 2011/02/10 17:19:16 sping Exp $ - -# genkernel-9999 -> latest Git master -# genkernel-99999 -> latest Git experimental -# genkernel-VERSION -> normal genkernel release - -VERSION_BUSYBOX='1.18.1' -VERSION_DMAP='1.02.22' -VERSION_DMRAID='1.0.0.rc14' -VERSION_MDADM='3.1.4' -VERSION_E2FSPROGS='1.41.14' -VERSION_FUSE='2.7.4' -VERSION_ISCSI='2.0-871' -VERSION_LVM='2.02.74' -VERSION_UNIONFS_FUSE='0.22' -VERSION_GPG='1.4.11' - -MY_P=gen${P/#calc} -S=${WORKDIR}/${MY_P} - -MY_HOME="http://wolf31o2.org" -RH_HOME="ftp://sources.redhat.com/pub" -DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src" -BB_HOME="http://www.busybox.net/downloads" - -COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2 - ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2 - mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2 - ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/dm/device-mapper.${VERSION_DMAP}.tgz - ${RH_HOME}/dm/old/device-mapper.${VERSION_DMAP}.tgz - ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2 - http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz - mirror://sourceforge/e2fsprogs/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz - mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz - http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 - mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2" - -if [[ ${PV} == 9999* ]] -then - EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/genkernel.git" - [[ ${PV} == 99999* ]] && EGIT_BRANCH=experimental - inherit git-2 bash-completion eutils - S="${WORKDIR}/${PN}" - SRC_URI="${COMMON_URI}" - KEYWORDS="" -else - inherit bash-completion eutils - SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 - ${MY_HOME}/sources/genkernel/${MY_P}.tar.bz2 - ftp://ftp.calculate.ru/pub/calculate/calckernel/${MY_P}.tar.bz2 - ${COMMON_URI}" - # Please don't touch individual KEYWORDS. Since this is maintained/tested by - # Release Engineering, it's easier for us to deal with all arches at once. - KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86" -fi - -DESCRIPTION="Calculate automatic kernel building scripts" -HOMEPAGE="http://www.calculate-linux.org/main/ru/calckernel" - -LICENSE="GPL-2" -SLOT="0" -RESTRICT="" -IUSE="ibm selinux video_cards_radeon" - -DEPEND="sys-fs/e2fsprogs - selinux? ( sys-libs/libselinux ) - !sys-kernel/genkernel" -RDEPEND="${DEPEND} app-arch/cpio - video_cards_radeon? ( sys-kernel/linux-firmware )" - -if [[ ${PV} == 9999* ]]; then - DEPEND="${DEPEND} app-text/asciidoc" -fi - -src_unpack() { - if [[ ${PV} == 9999* ]] ; then - git-2_src_unpack - else - unpack ${MY_P}.tar.bz2 - fi - use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh - cd ${S} - epatch "${FILESDIR}"/${PF}.patch -} - -src_compile() { - if [[ ${PV} == 9999* ]]; then - emake || die - fi -} - -src_install() { - # This block updates genkernel.conf - sed \ - -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \ - -e "s:VERSION_DMAP:$VERSION_DMAP:" \ - -e "s:VERSION_MDADM:$VERSION_MDADM:" \ - -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \ - -e "s:VERSION_E2FSPROGS:$VERSION_E2FSPROGS:" \ - -e "s:VERSION_FUSE:$VERSION_FUSE:" \ - -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \ - -e "s:VERSION_LVM:$VERSION_LVM:" \ - -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \ - -e "s:VERSION_GPG:$VERSION_GPG:" \ - "${S}"/genkernel.conf > "${T}"/genkernel.conf \ - || die "Could not adjust versions" - insinto /etc - doins "${T}"/genkernel.conf || die "doins genkernel.conf" - - doman genkernel.8 || die "doman" - dodoc AUTHORS ChangeLog README TODO || die "dodoc" - - dobin genkernel || die "dobin genkernel" - - rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf - - insinto /usr/share/genkernel - doins -r "${S}"/* || die "doins" - use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \ - cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6 - - # Copy files to /var/cache/genkernel/src - elog "Copying files to /var/cache/genkernel/src..." - mkdir -p "${D}"/var/cache/genkernel/src - cp -f \ - "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \ - "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \ - "${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \ - "${DISTDIR}"/device-mapper.${VERSION_DMAP}.tgz \ - "${DISTDIR}"/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz \ - "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \ - "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \ - "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \ - "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \ - "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \ - "${D}"/var/cache/genkernel/src || die "Copying distfiles..." - - dobashcompletion "${FILESDIR}"/genkernel.bash -} - -pkg_postinst() { - echo - elog 'Documentation is available in the genkernel manual page' - elog 'as well as the following URL:' - echo - elog 'http://www.gentoo.org/doc/en/genkernel.xml' - echo - ewarn "This package is known to not work with reiser4. If you are running" - ewarn "reiser4 and have a problem, do not file a bug. We know it does not" - ewarn "work and we don't plan on fixing it since reiser4 is the one that is" - ewarn "broken in this regard. Try using a sane filesystem like ext3 or" - ewarn "even reiser3." - echo - ewarn "The LUKS support has changed from versions prior to 3.4.4. Now," - ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah." - echo - - bash-completion_pkg_postinst -} diff --git a/sys-kernel/calckernel/calckernel-3.4.18-r6.ebuild b/sys-kernel/calckernel/calckernel-3.4.18-r6.ebuild deleted file mode 100644 index b41343295..000000000 --- a/sys-kernel/calckernel/calckernel-3.4.18-r6.ebuild +++ /dev/null @@ -1,163 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel/genkernel-3.4.13.ebuild,v 1.1 2011/02/10 17:19:16 sping Exp $ - -# genkernel-9999 -> latest Git master -# genkernel-99999 -> latest Git experimental -# genkernel-VERSION -> normal genkernel release - -VERSION_BUSYBOX='1.18.1' -VERSION_DMAP='1.02.22' -VERSION_DMRAID='1.0.0.rc14' -VERSION_MDADM='3.1.4' -VERSION_E2FSPROGS='1.41.14' -VERSION_FUSE='2.7.4' -VERSION_ISCSI='2.0-871' -VERSION_LVM='2.02.74' -VERSION_UNIONFS_FUSE='0.22' -VERSION_GPG='1.4.11' - -MY_P=gen${P/#calc} -S=${WORKDIR}/${MY_P} - -MY_HOME="http://wolf31o2.org" -RH_HOME="ftp://sources.redhat.com/pub" -DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src" -BB_HOME="http://www.busybox.net/downloads" - -COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2 - ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2 - mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2 - ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/dm/device-mapper.${VERSION_DMAP}.tgz - ${RH_HOME}/dm/old/device-mapper.${VERSION_DMAP}.tgz - ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2 - http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz - mirror://sourceforge/e2fsprogs/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz - mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz - http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 - mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2" - -if [[ ${PV} == 9999* ]] -then - EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/genkernel.git" - [[ ${PV} == 99999* ]] && EGIT_BRANCH=experimental - inherit git-2 bash-completion eutils - S="${WORKDIR}/${PN}" - SRC_URI="${COMMON_URI}" - KEYWORDS="" -else - inherit bash-completion eutils - SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 - ${MY_HOME}/sources/genkernel/${MY_P}.tar.bz2 - ftp://ftp.calculate.ru/pub/calculate/calckernel/${MY_P}.tar.bz2 - ${COMMON_URI}" - # Please don't touch individual KEYWORDS. Since this is maintained/tested by - # Release Engineering, it's easier for us to deal with all arches at once. - KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86" -fi - -DESCRIPTION="Calculate automatic kernel building scripts" -HOMEPAGE="http://www.calculate-linux.org/main/ru/calckernel" - -LICENSE="GPL-2" -SLOT="0" -RESTRICT="" -IUSE="ibm selinux video_cards_radeon" - -DEPEND="sys-fs/e2fsprogs - selinux? ( sys-libs/libselinux ) - !sys-kernel/genkernel" -RDEPEND="${DEPEND} app-arch/cpio - video_cards_radeon? ( sys-kernel/linux-firmware )" - -if [[ ${PV} == 9999* ]]; then - DEPEND="${DEPEND} app-text/asciidoc" -fi - -src_unpack() { - if [[ ${PV} == 9999* ]] ; then - git-2_src_unpack - else - unpack ${MY_P}.tar.bz2 - fi - use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh - cd ${S} - epatch "${FILESDIR}"/${PF}.patch -} - -src_compile() { - if [[ ${PV} == 9999* ]]; then - emake || die - fi -} - -src_install() { - # This block updates genkernel.conf - sed \ - -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \ - -e "s:VERSION_DMAP:$VERSION_DMAP:" \ - -e "s:VERSION_MDADM:$VERSION_MDADM:" \ - -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \ - -e "s:VERSION_E2FSPROGS:$VERSION_E2FSPROGS:" \ - -e "s:VERSION_FUSE:$VERSION_FUSE:" \ - -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \ - -e "s:VERSION_LVM:$VERSION_LVM:" \ - -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \ - -e "s:VERSION_GPG:$VERSION_GPG:" \ - "${S}"/genkernel.conf > "${T}"/genkernel.conf \ - || die "Could not adjust versions" - insinto /etc - doins "${T}"/genkernel.conf || die "doins genkernel.conf" - - doman genkernel.8 || die "doman" - dodoc AUTHORS ChangeLog README TODO || die "dodoc" - - dobin genkernel || die "dobin genkernel" - - rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf - - insinto /usr/share/genkernel - doins -r "${S}"/* || die "doins" - use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \ - cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6 - - # Copy files to /var/cache/genkernel/src - elog "Copying files to /var/cache/genkernel/src..." - mkdir -p "${D}"/var/cache/genkernel/src - cp -f \ - "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \ - "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \ - "${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \ - "${DISTDIR}"/device-mapper.${VERSION_DMAP}.tgz \ - "${DISTDIR}"/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz \ - "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \ - "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \ - "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \ - "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \ - "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \ - "${D}"/var/cache/genkernel/src || die "Copying distfiles..." - - dobashcompletion "${FILESDIR}"/genkernel.bash -} - -pkg_postinst() { - echo - elog 'Documentation is available in the genkernel manual page' - elog 'as well as the following URL:' - echo - elog 'http://www.gentoo.org/doc/en/genkernel.xml' - echo - ewarn "This package is known to not work with reiser4. If you are running" - ewarn "reiser4 and have a problem, do not file a bug. We know it does not" - ewarn "work and we don't plan on fixing it since reiser4 is the one that is" - ewarn "broken in this regard. Try using a sane filesystem like ext3 or" - ewarn "even reiser3." - echo - ewarn "The LUKS support has changed from versions prior to 3.4.4. Now," - ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah." - echo - - bash-completion_pkg_postinst -} diff --git a/sys-kernel/calckernel/calckernel-3.4.18-r7.ebuild b/sys-kernel/calckernel/calckernel-3.4.18-r7.ebuild deleted file mode 100644 index b41343295..000000000 --- a/sys-kernel/calckernel/calckernel-3.4.18-r7.ebuild +++ /dev/null @@ -1,163 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel/genkernel-3.4.13.ebuild,v 1.1 2011/02/10 17:19:16 sping Exp $ - -# genkernel-9999 -> latest Git master -# genkernel-99999 -> latest Git experimental -# genkernel-VERSION -> normal genkernel release - -VERSION_BUSYBOX='1.18.1' -VERSION_DMAP='1.02.22' -VERSION_DMRAID='1.0.0.rc14' -VERSION_MDADM='3.1.4' -VERSION_E2FSPROGS='1.41.14' -VERSION_FUSE='2.7.4' -VERSION_ISCSI='2.0-871' -VERSION_LVM='2.02.74' -VERSION_UNIONFS_FUSE='0.22' -VERSION_GPG='1.4.11' - -MY_P=gen${P/#calc} -S=${WORKDIR}/${MY_P} - -MY_HOME="http://wolf31o2.org" -RH_HOME="ftp://sources.redhat.com/pub" -DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src" -BB_HOME="http://www.busybox.net/downloads" - -COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2 - ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2 - mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2 - ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/dm/device-mapper.${VERSION_DMAP}.tgz - ${RH_HOME}/dm/old/device-mapper.${VERSION_DMAP}.tgz - ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2 - http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz - mirror://sourceforge/e2fsprogs/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz - mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz - http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 - mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2" - -if [[ ${PV} == 9999* ]] -then - EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/genkernel.git" - [[ ${PV} == 99999* ]] && EGIT_BRANCH=experimental - inherit git-2 bash-completion eutils - S="${WORKDIR}/${PN}" - SRC_URI="${COMMON_URI}" - KEYWORDS="" -else - inherit bash-completion eutils - SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 - ${MY_HOME}/sources/genkernel/${MY_P}.tar.bz2 - ftp://ftp.calculate.ru/pub/calculate/calckernel/${MY_P}.tar.bz2 - ${COMMON_URI}" - # Please don't touch individual KEYWORDS. Since this is maintained/tested by - # Release Engineering, it's easier for us to deal with all arches at once. - KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86" -fi - -DESCRIPTION="Calculate automatic kernel building scripts" -HOMEPAGE="http://www.calculate-linux.org/main/ru/calckernel" - -LICENSE="GPL-2" -SLOT="0" -RESTRICT="" -IUSE="ibm selinux video_cards_radeon" - -DEPEND="sys-fs/e2fsprogs - selinux? ( sys-libs/libselinux ) - !sys-kernel/genkernel" -RDEPEND="${DEPEND} app-arch/cpio - video_cards_radeon? ( sys-kernel/linux-firmware )" - -if [[ ${PV} == 9999* ]]; then - DEPEND="${DEPEND} app-text/asciidoc" -fi - -src_unpack() { - if [[ ${PV} == 9999* ]] ; then - git-2_src_unpack - else - unpack ${MY_P}.tar.bz2 - fi - use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh - cd ${S} - epatch "${FILESDIR}"/${PF}.patch -} - -src_compile() { - if [[ ${PV} == 9999* ]]; then - emake || die - fi -} - -src_install() { - # This block updates genkernel.conf - sed \ - -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \ - -e "s:VERSION_DMAP:$VERSION_DMAP:" \ - -e "s:VERSION_MDADM:$VERSION_MDADM:" \ - -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \ - -e "s:VERSION_E2FSPROGS:$VERSION_E2FSPROGS:" \ - -e "s:VERSION_FUSE:$VERSION_FUSE:" \ - -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \ - -e "s:VERSION_LVM:$VERSION_LVM:" \ - -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \ - -e "s:VERSION_GPG:$VERSION_GPG:" \ - "${S}"/genkernel.conf > "${T}"/genkernel.conf \ - || die "Could not adjust versions" - insinto /etc - doins "${T}"/genkernel.conf || die "doins genkernel.conf" - - doman genkernel.8 || die "doman" - dodoc AUTHORS ChangeLog README TODO || die "dodoc" - - dobin genkernel || die "dobin genkernel" - - rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf - - insinto /usr/share/genkernel - doins -r "${S}"/* || die "doins" - use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \ - cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6 - - # Copy files to /var/cache/genkernel/src - elog "Copying files to /var/cache/genkernel/src..." - mkdir -p "${D}"/var/cache/genkernel/src - cp -f \ - "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \ - "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \ - "${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \ - "${DISTDIR}"/device-mapper.${VERSION_DMAP}.tgz \ - "${DISTDIR}"/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz \ - "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \ - "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \ - "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \ - "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \ - "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \ - "${D}"/var/cache/genkernel/src || die "Copying distfiles..." - - dobashcompletion "${FILESDIR}"/genkernel.bash -} - -pkg_postinst() { - echo - elog 'Documentation is available in the genkernel manual page' - elog 'as well as the following URL:' - echo - elog 'http://www.gentoo.org/doc/en/genkernel.xml' - echo - ewarn "This package is known to not work with reiser4. If you are running" - ewarn "reiser4 and have a problem, do not file a bug. We know it does not" - ewarn "work and we don't plan on fixing it since reiser4 is the one that is" - ewarn "broken in this regard. Try using a sane filesystem like ext3 or" - ewarn "even reiser3." - echo - ewarn "The LUKS support has changed from versions prior to 3.4.4. Now," - ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah." - echo - - bash-completion_pkg_postinst -} diff --git a/sys-kernel/calckernel/calckernel-3.4.18-r8.ebuild b/sys-kernel/calckernel/calckernel-3.4.18-r8.ebuild deleted file mode 100644 index 7c43cffc8..000000000 --- a/sys-kernel/calckernel/calckernel-3.4.18-r8.ebuild +++ /dev/null @@ -1,166 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel/genkernel-3.4.13.ebuild,v 1.1 2011/02/10 17:19:16 sping Exp $ - -# genkernel-9999 -> latest Git master -# genkernel-99999 -> latest Git experimental -# genkernel-VERSION -> normal genkernel release - -EAPI="2" - -VERSION_BUSYBOX='1.18.1' -VERSION_DMAP='1.02.22' -VERSION_DMRAID='1.0.0.rc14' -VERSION_MDADM='3.1.4' -VERSION_E2FSPROGS='1.41.14' -VERSION_FUSE='2.7.4' -VERSION_ISCSI='2.0-871' -VERSION_LVM='2.02.74' -VERSION_UNIONFS_FUSE='0.22' -VERSION_GPG='1.4.11' - -MY_P=gen${P/#calc} -S=${WORKDIR}/${MY_P} - -MY_HOME="http://wolf31o2.org" -RH_HOME="ftp://sources.redhat.com/pub" -DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src" -BB_HOME="http://www.busybox.net/downloads" - -COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2 - ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2 - mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2 - ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/dm/device-mapper.${VERSION_DMAP}.tgz - ${RH_HOME}/dm/old/device-mapper.${VERSION_DMAP}.tgz - ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2 - http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz - mirror://sourceforge/e2fsprogs/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz - mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz - http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 - mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2" - -if [[ ${PV} == 9999* ]] -then - EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/genkernel.git" - [[ ${PV} == 99999* ]] && EGIT_BRANCH=experimental - inherit git-2 bash-completion eutils - S="${WORKDIR}/${PN}" - SRC_URI="${COMMON_URI}" - KEYWORDS="" -else - inherit bash-completion eutils - SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 - ${MY_HOME}/sources/genkernel/${MY_P}.tar.bz2 - ftp://ftp.calculate.ru/pub/calculate/calckernel/${MY_P}.tar.bz2 - ${COMMON_URI}" - # Please don't touch individual KEYWORDS. Since this is maintained/tested by - # Release Engineering, it's easier for us to deal with all arches at once. - KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86" -fi - -DESCRIPTION="Calculate automatic kernel building scripts" -HOMEPAGE="http://www.calculate-linux.org/main/ru/calckernel" - -LICENSE="GPL-2" -SLOT="0" -RESTRICT="" -IUSE="ibm selinux video_cards_radeon +nfs" - -DEPEND="sys-fs/e2fsprogs - selinux? ( sys-libs/libselinux ) - nfs? ( net-fs/nfs-utils ) - !sys-kernel/genkernel" -RDEPEND="${DEPEND} app-arch/cpio - video_cards_radeon? ( sys-kernel/linux-firmware )" - -if [[ ${PV} == 9999* ]]; then - DEPEND="${DEPEND} app-text/asciidoc" -fi - -src_unpack() { - if [[ ${PV} == 9999* ]] ; then - git-2_src_unpack - else - unpack ${MY_P}.tar.bz2 - fi - use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh - cd ${S} - epatch "${FILESDIR}"/${PF}.patch -} - -src_compile() { - if [[ ${PV} == 9999* ]]; then - emake || die - fi -} - -src_install() { - # This block updates genkernel.conf - sed \ - -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \ - -e "s:VERSION_DMAP:$VERSION_DMAP:" \ - -e "s:VERSION_MDADM:$VERSION_MDADM:" \ - -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \ - -e "s:VERSION_E2FSPROGS:$VERSION_E2FSPROGS:" \ - -e "s:VERSION_FUSE:$VERSION_FUSE:" \ - -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \ - -e "s:VERSION_LVM:$VERSION_LVM:" \ - -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \ - -e "s:VERSION_GPG:$VERSION_GPG:" \ - "${S}"/genkernel.conf > "${T}"/genkernel.conf \ - || die "Could not adjust versions" - insinto /etc - doins "${T}"/genkernel.conf || die "doins genkernel.conf" - - doman genkernel.8 || die "doman" - dodoc AUTHORS ChangeLog README TODO || die "dodoc" - - dobin genkernel || die "dobin genkernel" - - rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf - - insinto /usr/share/genkernel - doins -r "${S}"/* || die "doins" - use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \ - cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6 - - # Copy files to /var/cache/genkernel/src - elog "Copying files to /var/cache/genkernel/src..." - mkdir -p "${D}"/var/cache/genkernel/src - cp -f \ - "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \ - "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \ - "${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \ - "${DISTDIR}"/device-mapper.${VERSION_DMAP}.tgz \ - "${DISTDIR}"/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz \ - "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \ - "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \ - "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \ - "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \ - "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \ - "${D}"/var/cache/genkernel/src || die "Copying distfiles..." - - dobashcompletion "${FILESDIR}"/genkernel.bash -} - -pkg_postinst() { - echo - elog 'Documentation is available in the genkernel manual page' - elog 'as well as the following URL:' - echo - elog 'http://www.gentoo.org/doc/en/genkernel.xml' - echo - ewarn "This package is known to not work with reiser4. If you are running" - ewarn "reiser4 and have a problem, do not file a bug. We know it does not" - ewarn "work and we don't plan on fixing it since reiser4 is the one that is" - ewarn "broken in this regard. Try using a sane filesystem like ext3 or" - ewarn "even reiser3." - echo - ewarn "The LUKS support has changed from versions prior to 3.4.4. Now," - ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah." - echo - - bash-completion_pkg_postinst -} diff --git a/sys-kernel/calckernel/calckernel-3.4.18-r9.ebuild b/sys-kernel/calckernel/calckernel-3.4.18-r9.ebuild deleted file mode 100644 index 7c43cffc8..000000000 --- a/sys-kernel/calckernel/calckernel-3.4.18-r9.ebuild +++ /dev/null @@ -1,166 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel/genkernel-3.4.13.ebuild,v 1.1 2011/02/10 17:19:16 sping Exp $ - -# genkernel-9999 -> latest Git master -# genkernel-99999 -> latest Git experimental -# genkernel-VERSION -> normal genkernel release - -EAPI="2" - -VERSION_BUSYBOX='1.18.1' -VERSION_DMAP='1.02.22' -VERSION_DMRAID='1.0.0.rc14' -VERSION_MDADM='3.1.4' -VERSION_E2FSPROGS='1.41.14' -VERSION_FUSE='2.7.4' -VERSION_ISCSI='2.0-871' -VERSION_LVM='2.02.74' -VERSION_UNIONFS_FUSE='0.22' -VERSION_GPG='1.4.11' - -MY_P=gen${P/#calc} -S=${WORKDIR}/${MY_P} - -MY_HOME="http://wolf31o2.org" -RH_HOME="ftp://sources.redhat.com/pub" -DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src" -BB_HOME="http://www.busybox.net/downloads" - -COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2 - ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2 - mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2 - ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/dm/device-mapper.${VERSION_DMAP}.tgz - ${RH_HOME}/dm/old/device-mapper.${VERSION_DMAP}.tgz - ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2 - http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz - mirror://sourceforge/e2fsprogs/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz - mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz - http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 - mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2" - -if [[ ${PV} == 9999* ]] -then - EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/genkernel.git" - [[ ${PV} == 99999* ]] && EGIT_BRANCH=experimental - inherit git-2 bash-completion eutils - S="${WORKDIR}/${PN}" - SRC_URI="${COMMON_URI}" - KEYWORDS="" -else - inherit bash-completion eutils - SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 - ${MY_HOME}/sources/genkernel/${MY_P}.tar.bz2 - ftp://ftp.calculate.ru/pub/calculate/calckernel/${MY_P}.tar.bz2 - ${COMMON_URI}" - # Please don't touch individual KEYWORDS. Since this is maintained/tested by - # Release Engineering, it's easier for us to deal with all arches at once. - KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86" -fi - -DESCRIPTION="Calculate automatic kernel building scripts" -HOMEPAGE="http://www.calculate-linux.org/main/ru/calckernel" - -LICENSE="GPL-2" -SLOT="0" -RESTRICT="" -IUSE="ibm selinux video_cards_radeon +nfs" - -DEPEND="sys-fs/e2fsprogs - selinux? ( sys-libs/libselinux ) - nfs? ( net-fs/nfs-utils ) - !sys-kernel/genkernel" -RDEPEND="${DEPEND} app-arch/cpio - video_cards_radeon? ( sys-kernel/linux-firmware )" - -if [[ ${PV} == 9999* ]]; then - DEPEND="${DEPEND} app-text/asciidoc" -fi - -src_unpack() { - if [[ ${PV} == 9999* ]] ; then - git-2_src_unpack - else - unpack ${MY_P}.tar.bz2 - fi - use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh - cd ${S} - epatch "${FILESDIR}"/${PF}.patch -} - -src_compile() { - if [[ ${PV} == 9999* ]]; then - emake || die - fi -} - -src_install() { - # This block updates genkernel.conf - sed \ - -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \ - -e "s:VERSION_DMAP:$VERSION_DMAP:" \ - -e "s:VERSION_MDADM:$VERSION_MDADM:" \ - -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \ - -e "s:VERSION_E2FSPROGS:$VERSION_E2FSPROGS:" \ - -e "s:VERSION_FUSE:$VERSION_FUSE:" \ - -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \ - -e "s:VERSION_LVM:$VERSION_LVM:" \ - -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \ - -e "s:VERSION_GPG:$VERSION_GPG:" \ - "${S}"/genkernel.conf > "${T}"/genkernel.conf \ - || die "Could not adjust versions" - insinto /etc - doins "${T}"/genkernel.conf || die "doins genkernel.conf" - - doman genkernel.8 || die "doman" - dodoc AUTHORS ChangeLog README TODO || die "dodoc" - - dobin genkernel || die "dobin genkernel" - - rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf - - insinto /usr/share/genkernel - doins -r "${S}"/* || die "doins" - use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \ - cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6 - - # Copy files to /var/cache/genkernel/src - elog "Copying files to /var/cache/genkernel/src..." - mkdir -p "${D}"/var/cache/genkernel/src - cp -f \ - "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \ - "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \ - "${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \ - "${DISTDIR}"/device-mapper.${VERSION_DMAP}.tgz \ - "${DISTDIR}"/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz \ - "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \ - "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \ - "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \ - "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \ - "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \ - "${D}"/var/cache/genkernel/src || die "Copying distfiles..." - - dobashcompletion "${FILESDIR}"/genkernel.bash -} - -pkg_postinst() { - echo - elog 'Documentation is available in the genkernel manual page' - elog 'as well as the following URL:' - echo - elog 'http://www.gentoo.org/doc/en/genkernel.xml' - echo - ewarn "This package is known to not work with reiser4. If you are running" - ewarn "reiser4 and have a problem, do not file a bug. We know it does not" - ewarn "work and we don't plan on fixing it since reiser4 is the one that is" - ewarn "broken in this regard. Try using a sane filesystem like ext3 or" - ewarn "even reiser3." - echo - ewarn "The LUKS support has changed from versions prior to 3.4.4. Now," - ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah." - echo - - bash-completion_pkg_postinst -} diff --git a/sys-kernel/calckernel/calckernel-3.4.18.ebuild b/sys-kernel/calckernel/calckernel-3.4.18.ebuild deleted file mode 100644 index 3494049b8..000000000 --- a/sys-kernel/calckernel/calckernel-3.4.18.ebuild +++ /dev/null @@ -1,164 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/genkernel/genkernel-3.4.13.ebuild,v 1.1 2011/02/10 17:19:16 sping Exp $ - -# genkernel-9999 -> latest Git master -# genkernel-99999 -> latest Git experimental -# genkernel-VERSION -> normal genkernel release - -VERSION_BUSYBOX='1.18.1' -VERSION_DMAP='1.02.22' -VERSION_DMRAID='1.0.0.rc14' -VERSION_MDADM='3.1.4' -VERSION_E2FSPROGS='1.41.14' -VERSION_FUSE='2.7.4' -VERSION_ISCSI='2.0-871' -VERSION_LVM='2.02.74' -VERSION_UNIONFS_FUSE='0.22' -VERSION_GPG='1.4.11' - -MY_P=gen${P/#calc} -S=${WORKDIR}/${MY_P} - -MY_HOME="http://wolf31o2.org" -RH_HOME="ftp://sources.redhat.com/pub" -DM_HOME="http://people.redhat.com/~heinzm/sw/dmraid/src" -BB_HOME="http://www.busybox.net/downloads" - -COMMON_URI="${DM_HOME}/dmraid-${VERSION_DMRAID}.tar.bz2 - ${DM_HOME}/old/dmraid-${VERSION_DMRAID}.tar.bz2 - mirror://kernel/linux/utils/raid/mdadm/mdadm-${VERSION_MDADM}.tar.bz2 - ${RH_HOME}/lvm2/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/lvm2/old/LVM2.${VERSION_LVM}.tgz - ${RH_HOME}/dm/device-mapper.${VERSION_DMAP}.tgz - ${RH_HOME}/dm/old/device-mapper.${VERSION_DMAP}.tgz - ${BB_HOME}/busybox-${VERSION_BUSYBOX}.tar.bz2 - http://www.open-iscsi.org/bits/open-iscsi-${VERSION_ISCSI}.tar.gz - mirror://sourceforge/e2fsprogs/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz - mirror://sourceforge/fuse/fuse-${VERSION_FUSE}.tar.gz - http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 - mirror://gnupg/gnupg/gnupg-${VERSION_GPG}.tar.bz2" - -if [[ ${PV} == 9999* ]] -then - EGIT_REPO_URI="git://git.overlays.gentoo.org/proj/genkernel.git" - [[ ${PV} == 99999* ]] && EGIT_BRANCH=experimental - inherit git-2 bash-completion eutils - S="${WORKDIR}/${PN}" - SRC_URI="${COMMON_URI}" - KEYWORDS="" -else - inherit bash-completion eutils - SRC_URI="mirror://gentoo/${MY_P}.tar.bz2 - ${MY_HOME}/sources/genkernel/${MY_P}.tar.bz2 - ftp://ftp.calculate.ru/pub/calculate/calckernel/${MY_P}.tar.bz2 - ${COMMON_URI}" - # Please don't touch individual KEYWORDS. Since this is maintained/tested by - # Release Engineering, it's easier for us to deal with all arches at once. - KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc x86" -fi - -DESCRIPTION="Calculate automatic kernel building scripts" -HOMEPAGE="http://www.calculate-linux.org/main/ru/calckernel" - -LICENSE="GPL-2" -SLOT="0" -RESTRICT="" -IUSE="ibm selinux video_cards_radeon" - -DEPEND="sys-fs/e2fsprogs - selinux? ( sys-libs/libselinux ) - >=sys-apps/calculate-templates-2.2.13-r1 - !sys-kernel/genkernel" -RDEPEND="${DEPEND} app-arch/cpio - video_cards_radeon? ( sys-kernel/linux-firmware )" - -if [[ ${PV} == 9999* ]]; then - DEPEND="${DEPEND} app-text/asciidoc" -fi - -src_unpack() { - if [[ ${PV} == 9999* ]] ; then - git-2_src_unpack - else - unpack ${MY_P}.tar.bz2 - fi - use selinux && sed -i 's/###//g' "${S}"/gen_compile.sh - cd ${S} - epatch "${FILESDIR}"/${PF}.patch -} - -src_compile() { - if [[ ${PV} == 9999* ]]; then - emake || die - fi -} - -src_install() { - # This block updates genkernel.conf - sed \ - -e "s:VERSION_BUSYBOX:$VERSION_BUSYBOX:" \ - -e "s:VERSION_DMAP:$VERSION_DMAP:" \ - -e "s:VERSION_MDADM:$VERSION_MDADM:" \ - -e "s:VERSION_DMRAID:$VERSION_DMRAID:" \ - -e "s:VERSION_E2FSPROGS:$VERSION_E2FSPROGS:" \ - -e "s:VERSION_FUSE:$VERSION_FUSE:" \ - -e "s:VERSION_ISCSI:$VERSION_ISCSI:" \ - -e "s:VERSION_LVM:$VERSION_LVM:" \ - -e "s:VERSION_UNIONFS_FUSE:$VERSION_UNIONFS_FUSE:" \ - -e "s:VERSION_GPG:$VERSION_GPG:" \ - "${S}"/genkernel.conf > "${T}"/genkernel.conf \ - || die "Could not adjust versions" - insinto /etc - doins "${T}"/genkernel.conf || die "doins genkernel.conf" - - doman genkernel.8 || die "doman" - dodoc AUTHORS ChangeLog README TODO || die "dodoc" - - dobin genkernel || die "dobin genkernel" - - rm -f genkernel genkernel.8 AUTHORS ChangeLog README TODO genkernel.conf - - insinto /usr/share/genkernel - doins -r "${S}"/* || die "doins" - use ibm && cp "${S}"/ppc64/kernel-2.6-pSeries "${S}"/ppc64/kernel-2.6 || \ - cp "${S}"/arch/ppc64/kernel-2.6.g5 "${S}"/arch/ppc64/kernel-2.6 - - # Copy files to /var/cache/genkernel/src - elog "Copying files to /var/cache/genkernel/src..." - mkdir -p "${D}"/var/cache/genkernel/src - cp -f \ - "${DISTDIR}"/mdadm-${VERSION_MDADM}.tar.bz2 \ - "${DISTDIR}"/dmraid-${VERSION_DMRAID}.tar.bz2 \ - "${DISTDIR}"/LVM2.${VERSION_LVM}.tgz \ - "${DISTDIR}"/device-mapper.${VERSION_DMAP}.tgz \ - "${DISTDIR}"/e2fsprogs-${VERSION_E2FSPROGS}.tar.gz \ - "${DISTDIR}"/busybox-${VERSION_BUSYBOX}.tar.bz2 \ - "${DISTDIR}"/fuse-${VERSION_FUSE}.tar.gz \ - "${DISTDIR}"/unionfs-fuse-${VERSION_UNIONFS_FUSE}.tar.bz2 \ - "${DISTDIR}"/gnupg-${VERSION_GPG}.tar.bz2 \ - "${DISTDIR}"/open-iscsi-${VERSION_ISCSI}.tar.gz \ - "${D}"/var/cache/genkernel/src || die "Copying distfiles..." - - dobashcompletion "${FILESDIR}"/genkernel.bash -} - -pkg_postinst() { - echo - elog 'Documentation is available in the genkernel manual page' - elog 'as well as the following URL:' - echo - elog 'http://www.gentoo.org/doc/en/genkernel.xml' - echo - ewarn "This package is known to not work with reiser4. If you are running" - ewarn "reiser4 and have a problem, do not file a bug. We know it does not" - ewarn "work and we don't plan on fixing it since reiser4 is the one that is" - ewarn "broken in this regard. Try using a sane filesystem like ext3 or" - ewarn "even reiser3." - echo - ewarn "The LUKS support has changed from versions prior to 3.4.4. Now," - ewarn "you use crypt_root=/dev/blah instead of real_root=luks:/dev/blah." - echo - - bash-completion_pkg_postinst -} diff --git a/sys-kernel/calckernel/files/calckernel-3.4.15-r17.patch b/sys-kernel/calckernel/files/calckernel-3.4.15-r17.patch deleted file mode 100644 index 189ee42b6..000000000 --- a/sys-kernel/calckernel/files/calckernel-3.4.15-r17.patch +++ /dev/null @@ -1,2087 +0,0 @@ -diff --git defaults/initrd.defaults defaults/initrd.defaults -index fd6d9fc..3a5f5d3 100755 ---- defaults/initrd.defaults -+++ defaults/initrd.defaults -@@ -68,6 +68,7 @@ fi - - REAL_ROOT='' - CDROOT='0' -+SCRATCH='0' - CDROOT_DEV='' - CDROOT_TYPE='auto' - NEW_ROOT='/newroot' -diff --git defaults/initrd.scripts defaults/initrd.scripts -index b228a77..fdbfaa1 100755 ---- defaults/initrd.scripts -+++ defaults/initrd.scripts -@@ -187,23 +187,45 @@ cache_cd_contents() { - # TODO: Check the size of the image versus the size of our tmpfs - # along with the amount of available RAM and increase tmpfs size - # if necessary. (Not having awk sucks...) -- # z=0 -- # for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -- # cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; do -- # z=$(($z + $i)) ; done -- # echo $z -- good_msg "Copying loop file for caching..." -- # Verify that the needed directory exists -- mkdir -p "$(dirname ${NEW_ROOT}/mnt/${LOOP})" -- cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/${LOOP} -- if [ $? -ne 0 ] -+ -+ # getting memory -+ allmemory=0 -+ for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -+ cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; -+ do -+ allmemory=$(($allmemory + $i)) -+ done -+ -+ # getting size tmpfs of default -+ let curtfs=$allmemory/2 -+ -+ # getting size of image -+ let imagesize=`ls -la ${NEW_ROOT}/mnt/cdrom/${LOOP} | sed -r -n 's/(\S*\s*){4}(\S*).*/\2/p'`/20000*21 -+ let addon=$imagesize/10 -+ if [[ $curtfs -gt $(( ${imagesize} + ${addon} )) ]]; - then -- bad_msg "Failed to cache the loop file! Lack of space?" -- rm -rf ${NEW_ROOT}/mnt/livecd.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/image.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/zisofs 2>/dev/null -+ let addon=$(( $curtfs - ${imagesize} )) -+ fi -+ -+ if [[ $((${imagesize} + $addon)) -lt ${allmemory} ]]; -+ then -+ mount -o remount,size=${addon}000 -t tmpfs tmpfs ${NEW_ROOT} -+ mkdir ${NEW_ROOT}/mnt/squash -+ mount -o size=${imagesize}000 -t tmpfs tmpfs ${NEW_ROOT}/mnt/squash -+ good_msg "Copying loop file for caching..." -+ cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/squash/${LOOP} -+ if [ $? -ne 0 ] -+ then -+ bad_msg "Failed to cache the loop file! Lack of space?" -+ umount ${NEW_ROOT}/mnt/squash -+ mount -o remount,size=${curtfs}000 -t tmpfs tmpfs ${NEW_ROOT} -+ else -+ LOOPEXT='../squash/' -+ good_msg "Unmounting media from ${NEW_ROOT}/mnt/cdrom" -+ umount ${NEW_ROOT}/mnt/cdrom -+ fi - else -- LOOPEXT='../' -+ bad_msg "Too low memory for cache the loop file." - fi - fi - fi -@@ -655,7 +677,7 @@ startVolumes() { - [ -d /etc/lvm/cache ] && lvm_commands="${lvm_commands} \nvgscan" - - # To activate volumegroups on all devices in the cache -- lvm_commands="${lvm_commands} \nvgchange -ay --sysinit" -+ lvm_commands="${lvm_commands} \nvgchange -ay --sysinit --noudevsync" - - # And finally execute it all (/proc/... needed if lvm is compiled without readline) - good_msg "Scanning for and activating Volume Groups" -@@ -940,7 +962,7 @@ sdelay() { - # Sleep a specific number of seconds if SDELAY is set - if [ "${SDELAY}" ] - then -- good_msg 'Waiting ${SDELAY} seconds...' -+ good_msg "Waiting ${SDELAY} seconds..." - sleep ${SDELAY} - else - good_msg 'Hint: Use parameter scandelay[=seconds] if you need waiting here' -@@ -1100,6 +1122,38 @@ getdvhoff() { - echo $(( $(hexdump -n 4 -s $((316 + 12 * $2)) -e '"%i"' $1) * 512)) - } - -+load_union_module() { -+ UNIONTYPE="" -+ # find module for union file system -+ [ -n "$(find /lib/ -name unionfs.ko)" ] && UNIONTYPE="unionfs" -+ [ -n "$(find /lib/ -name aufs.ko)" ] && UNIONTYPE="aufs" -+ # probably aufs in kernel -+ if [ -n "$(gzip -dc /proc/config.gz | grep CONFIG_AUFS_FS=y )" ] -+ then -+ UNIONTYPE="aufs" -+ else -+ if [ -z "${UNIONTYPE}" ] -+ then -+ bad_msg "Module for union file system is not found!" -+ run_shell -+ else -+ modprobe ${UNIONTYPE} > /dev/null 2>&1 -+ # error on load union module -+ if [ -z "$(lsmod | grep $UNIONTYPE)" ] -+ then -+ bad_msg "Module for union file system is not correct!" -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ bad_msg "Probably kernel compiled without standalone patch." -+ fi -+ run_shell -+ fi -+ -+ good_msg "Loading ${UNIONTYPE}" -+ fi -+ fi -+} -+ - setup_unionfs() { - local rw_dir=$1 - local ro_dir=$2 -@@ -1119,6 +1173,7 @@ setup_unionfs() { - mkdir -p ${UNION} - good_msg "Loading fuse module" - modprobe fuse > /dev/null 2>&1 -+ load_union_module - # if [ -n "${UNIONFS}" ] - # then - # CHANGESDEV=${UNIONFS} -@@ -1148,11 +1203,102 @@ setup_unionfs() { - mkdir /tmp - mkdir -p ${UNION} - # mkdir -p $CHANGES --# mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+## mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+ -+ if [ "${SCRATCH}" -ne 0 ]; -+ then -+ good_msg "Loading in scratch mode" -+ BUILDERDIR=${UNION}/mnt/builder -+ SCRATCHDIR=${UNION}/mnt/scratch -+ DELTADIR=${rw_dir}/mnt/delta -+ WORKSPACEDIR=${rw_dir}/mnt/workspace -+ mount -o remount,rw ${rw_dir}/mnt/cdrom >/dev/null 2>&1 -+ touch ${rw_dir}/mnt/cdrom/livecd >/dev/null 2>&1 -+ if [ "$?" -ne 0 ]; -+ then -+ ISRW=0 -+ else -+ ISRW=1 -+ fi -+ -+ mkdir -p ${DELTADIR} -+ mkdir -p ${WORKSPACEDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${WORKSPACEDIR}=rw:${DELTADIR}=ro+wh:${rw_dir}/mnt/livecd=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${WORKSPACEDIR}=rw:${DELTADIR}=ro:${rw_dir}/mnt/livecd=ro unionfs ${UNION} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${SCRATCHDIR}/calculate -+ mkdir -p ${SCRATCHDIR}/delta -+ mkdir -p ${SCRATCHDIR}/workspace -+ mount -o bind ${rw_dir}/mnt/delta ${SCRATCHDIR}/delta -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind ${rw_dir}/mnt/workspace ${SCRATCHDIR}/workspace -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${BUILDERDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro none ${BUILDERDIR} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro unionfs ${BUILDERDIR} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind,ro ${rw_dir}/mnt/livecd ${SCRATCHDIR}/calculate -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ if [ "$ISRW" -ne 0 ]; -+ then -+ FLASHDIR=${UNION}/mnt/flash -+ mkdir -p ${FLASHDIR} -+ mount -o bind ${rw_dir}/mnt/cdrom ${FLASHDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ mkdir -p ${CDROMDIR} -+ mount -o bind,ro ${rw_dir}/mnt/cdrom ${CDROMDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ fi -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ LIVECDDIR=${UNION}/mnt/livecd -+ -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${rw_dir}:${ro_dir}=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${rw_dir}:${ro_dir}=ro unionfs ${UNION} -+ fi -+ -+ if [[ -n "$( echo ${LOOPEXT} | grep squash )" ]]; -+ then -+ mkdir -p ${UNION}/mnt/squash -+ mount -o bind ${NEW_ROOT}/mnt/squash ${UNION}/mnt/squash &>/dev/null -+ fi -+ -+ chmod 0755 ${UNION} -+ mount -o bind ${rw_dir}/mnt/cdrom ${CDROMDIR} &>/dev/null -+ mount -o bind ${rw_dir}/mnt/livecd ${LIVECDDIR} &>/dev/null -+ ret=$? -+ fi -+ -+ chmod 1777 ${UNION}/tmp - good_msg "Creating union mount" -- unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -- ret=$? -- if [ ${ret} -ne 0 ] -+# unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -+# ret=$? -+ if [ "${ret}" -ne 0 ] - then - bad_msg "Can't setup union mount!" - USE_UNIONFS_NORMAL=0 -@@ -1161,3 +1307,106 @@ setup_unionfs() { - USE_UNIONFS_NORMAL=0 - fi - } -+ -+load_videodrv() { -+ good_msg "Loading frame buffer video driver" -+ # find all available fb drivers -+ videodrv_count=$(find /lib/modules \ -+ -name "nouveau.ko" -o \ -+ -name "uvesafb.ko" -o \ -+ -name "i915.ko" -o \ -+ -name "radeon.ko" | -+ grep -c "") -+ # load specified videodrv -+ modules_list= -+ case "${VIDEODRV}" in -+ nouveau) -+ modules_list="nouveau" -+ ;; -+ radeon) -+ modules_list="radeon" -+ ;; -+ i915|intel) -+ modules_list="i915" -+ ;; -+ ""|auto) -+ # if not livecd and initramfs otimized (aviailable only one video driver) -+ if [ "${CDROOT}" != '1' -a "${videodrv_count}" -le 2 ] -+ then -+ modules_list="nouveau i915 radeon" -+ else -+ if [[ -x /usr/sbin/lspci ]] -+ then -+ if lspci | grep -m1 VGA | grep -qi intel -+ then -+ modules_list="i915" -+ elif lspci | grep -m1 VGA | grep -qi nvidia -+ then -+ modules_list="nouveau" -+ elif lspci | grep -m1 VGA | grep -q -e "Ati" -e "ATI" -+ then -+ modules_list="radeon" -+ else -+ modules_list="" -+ fi -+ else -+ modules_list="i915" -+ fi -+ fi -+ ;; -+ esac -+ for x in $modules_list -+ do -+ if [ "`find /lib/modules -name "${x}.ko" | grep -c ''`" -eq "1" ] -+ then -+ modprobe "${x}" modeset=${USE_MODESET} &>/dev/null -+ lsmod | grep -q "${x}" && return 0 -+ fi -+ done -+ # else load uvesafb with specified video resolution -+ if [ -n "${VIDEORES}" ] -+ then -+ if ! echo $VIDEORES | grep -q "\-" -+ then -+ VIDEORES="${VIDEORES}-32" -+ fi -+ else -+ VIDEORES="1024x768-32" -+ fi -+ modprobe uvesafb mode_option=${VIDEORES} &>/dev/null -+} -+ -+start_udev() -+{ -+ # start udev -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ echo "" >/proc/sys/kernel/hotplug -+ udevd --daemon &>/dev/null -+ udevadm settle -+ fi -+} -+ -+stop_udev() -+{ -+ # kill udevd -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ pkill udevd &>/dev/null -+ fi -+} -+ -+populate_dev() -+{ -+ good_msg 'Activating udev' -+ # Do not run any init-scripts -+ udevadm control --property=do_not_run_plug_service=1 -+ -+ # discarding net drivers placed into blacklist.conf -+ udevadm trigger --action="add" -+ -+ # we can speed up booting under these conditions: -+ # * using devtmpfs so kernel creates device nodes for us -+ # * only using kernel created device nodes at boot (in /etc/fstab and elsewhere) -+ udevadm settle --timeout=60 -+} -diff --git defaults/linuxrc defaults/linuxrc -index 1819d9f..0103780 100755 ---- defaults/linuxrc -+++ defaults/linuxrc -@@ -38,6 +38,13 @@ CMDLINE=`cat /proc/cmdline` - FAKE_ROOT='' - REAL_ROOTFLAGS='' - CRYPT_SILENT=0 -+VIDEODRV='' -+USE_UDEV=1 -+USE_MODESET=1 -+if [ -e "/etc/calculate/calculate.ini" ] -+then -+ source /etc/calculate/calculate.ini -+fi - for x in ${CMDLINE} - do - case "${x}" in -@@ -56,6 +63,57 @@ do - init_opts\=*) - INIT_OPTS=`parse_opt "${x}"` - ;; -+ nokms) -+ USE_MODESET=0 -+ ;; -+ kms) -+ USE_MODESET=1 -+ ;; -+ noudev) -+ USE_UDEV=0 -+ ;; -+ calculate\=*) -+ CALCULATE=`parse_opt "${x}"` -+ if [[ "${CALCULATE//:/}" != "${CALCULATE}" ]] -+ then -+ for i in ${CALCULATE//,/ } -+ do -+ case "${i}" in -+ video:*) -+ VIDEODRV=`echo "${i}" | cut -s -d: -f2-` -+ ;; -+ resolution:*) -+ RES=`echo "${i}" | cut -s -d: -f2-` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ ;; -+ esac -+ done -+ else -+ RES=`echo "${CALCULATE}" | cut -s -d, -f4` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ VIDEODRV=`echo "${CALCULATE}" | cut -s -d, -f5` -+ fi -+ ;; -+ video\=*) -+ VR=`parse_opt "${x}"` -+ for i in ${VR//,/ } -+ do -+ if [ -z "${i//[0-9-x@]}" ] -+ then -+ VIDEORES=${i} -+ fi -+ done -+ ;; -+ # Scratch usbload -+ scratch) -+ SCRATCH=1 -+ ;; - # Livecd options - cdroot) - CDROOT=1 -@@ -253,15 +311,24 @@ then - REAL_ROOT="${FAKE_ROOT}" - fi - --splash 'init' -- --cmdline_hwopts -+# check udevd -+[ ! -x /sbin/udevd ] && USE_UDEV=0 - - # Mount sysfs - mount_sysfs - -+# start udev -+start_udev -+ -+# load kernel video driver -+load_videodrv -+ -+splash 'init' -+ -+cmdline_hwopts -+ - # Setup hotplugging for firmware loading --setup_hotplug -+[ "${USE_UDEV}" == "0" ] && setup_hotplug - - # Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel - if [ -z "${DO_modules}" ] -@@ -271,7 +338,7 @@ elif [ -d "/lib/modules/${KV}" ] - then - good_msg 'Loading modules' - # Load appropriate kernel modules -- if [ "${NODETECT}" != '1' ] -+ if [ "${USE_UDEV}" != '1' -a "${NODETECT}" != '1' ] - then - for modules in ${MY_HWOPTS} - do -@@ -287,14 +354,20 @@ fi - # Apply scan delay if specified - sdelay - --# Setup slow USB bits --setup_slowusb -+if [ "${USE_UDEV}" == "1" ] -+then -+ # populate /dev with devices already found by the kernel -+ populate_dev -+else -+ # Setup slow USB bits -+ setup_slowusb - --# Start device manager --start_dev_mgr -+ # Start device manager -+ start_dev_mgr - --# if doslowusb is passed, pause other 10 seconds here, after mdev load --[ "${DO_slowusb}" ] && sleep 10 -+ # if doslowusb is passed, pause other 10 seconds here, after mdev load -+ [ "${DO_slowusb}" ] && sleep 10 -+fi - - # Start iSCSI - if [ -e /bin/iscsistart ] -@@ -510,9 +583,50 @@ do - then - break - else -- bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -- got_good_root=0 -- REAL_ROOT='' -+ # check for scratch -+ if [ -e ${NEW_ROOT}/livecd.squashfs -a -d ${NEW_ROOT}/delta -a -d ${NEW_ROOT}/workspace ]; -+ then -+ good_msg 'Found scratch data...' -+ load_union_module -+ modprobe squashfs >/dev/null -+ if mount -o remount,rw ${NEW_ROOT}; -+ then -+ mkdir -p ${NEW_ROOT}/calculate && mkdir -p /union && mkdir -p ${NEW_ROOT}/workspace/mnt/builder && mkdir -p ${NEW_ROOT}/workspace/mnt/scratch -+ if mount -o loop,ro -t squashfs ${NEW_ROOT}/livecd.squashfs ${NEW_ROOT}/calculate; -+ then -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/workspace=rw:${NEW_ROOT}/delta=ro+wh:${NEW_ROOT}/calculate=ro none /union; -+ then -+ mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/delta=rw:${NEW_ROOT}/calculate=ro none /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers!' -+ run_shell -+ fi -+ else -+ if mount -t unionfs -o ro,dirs=${NEW_ROOT}/workspace:${NEW_ROOT}/delta=ro:${NEW_ROOT}/calculate=ro unionfs /union; -+ then -+ mount -t unionfs -o ro,dirs=${NEW_ROOT}/delta:${NEW_ROOT}/calculate=ro unionfs /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers' -+ run_shell -+ fi -+ fi -+ else -+ bad_msg 'Could not mount scratch squashfs image' -+ fi -+ else -+ bad_msg 'Could not remount ${NEW_ROOT}' -+ fi -+ else -+ bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -+ got_good_root=0 -+ REAL_ROOT='' -+ fi - fi - else - bad_msg "Could not mount specified ROOT, try again" -@@ -731,9 +845,12 @@ cd "${CHROOT}" - mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null - echo -ne "${BOLD}.${NORMAL}" - -+# stop udev before move mount points -+stop_udev -+ - # If devtmpfs is mounted, try move it to the new root - # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise --for fs in /dev /sys /proc -+for fs in "/dev " /sys /proc - do - if grep -qs "$fs" /proc/mounts - then -diff --git defaults/modprobe defaults/modprobe -index ba2d890..9280357 100755 ---- defaults/modprobe -+++ defaults/modprobe -@@ -10,8 +10,6 @@ usage() { - echo - echo 'Example:' - echo ' modprobe eepro100' -- echo -- echo 'Note: Do not pass the suffix to modprobe!' - exit 1 - } - -@@ -81,14 +79,29 @@ modprobe2() { - usage - exit 1 - fi -- real_path=`real_mod_path ${1}` -+ local modname=${1} -+ local quiet='' -+ local params='' -+ shift -+ for x in $@ -+ do -+ case ${x} in -+ -n) -+ quiet=1 -+ ;; -+ *) -+ params="${params} ${x}" -+ ;; -+ esac -+ done -+ real_path=`real_mod_path ${modname}` - if [ "${real_path}" = '' -o "${real_path}" = ' ' ] - then -- [ "${2}" = '-n' ] && echo -n " -> $1" -+ [ "${quiet}" = '1' ] && echo -n " -> ${modname}" - echo ' module not found.' - exit 2 - fi -- modlist=`modules_dep_list ${1}` -+ modlist=`modules_dep_list ${modname}` - if [ "${modlist}" != '' -a "${modlist}" != ' ' ] - then - deps=`strip_mod_paths ${modlist}` -@@ -110,13 +123,13 @@ modprobe2() { - filler=1 - fi - done -- ${INSMOD} ${real_path} > /dev/null 2>&1 -+ ${INSMOD} ${real_path} ${params} > /dev/null 2>&1 - ret=$? - if [ ${ret} -eq 0 ] - then - echoAppend=' loaded.' -- [ "${2}" = '-n' ] && echoFlags='-n' && echoAppend=', ' -- echo ${echoFlags} "${1}${echoAppend}" -+ [ "${quiet}" = '1' ] && echoFlags='-n' && echoAppend=', ' -+ echo ${echoFlags} "${modname}${echoAppend}" - fi - return $ret - } -@@ -132,7 +145,7 @@ do - LOADED_MODULES="${LOADED_MODULES} ${x}" - done - --modprobe2 ${1} -+modprobe2 ${@} - modprobe_ret=$? - - [ -f '/modules.cache' ] && rm -f /modules.cache > /dev/null 2>&1 -diff --git dracut_funcs.sh dracut_funcs.sh -new file mode 100755 -index 0000000..e80a638 ---- /dev/null -+++ dracut_funcs.sh -@@ -0,0 +1,752 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+# -+# functions used by dracut and other tools. -+# -+# Copyright 2005-2009 Red Hat, Inc. All rights reserved. -+# -+# 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; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+# -+ -+IF_RTLD="" -+IF_dynamic="" -+ -+# Generic substring function. If $2 is in $1, return 0. -+strstr() { [[ $1 =~ $2 ]]; } -+ -+# Create all subdirectories for given path without creating the last element. -+# $1 = path -+mksubdirs() { mkdir -p ${1%/*}; } -+ -+# Version comparision function. Assumes Linux style version scheme. -+# $1 = version a -+# $2 = comparision op (gt, ge, eq, le, lt, ne) -+# $3 = version b -+vercmp() { -+ local n1=(${1//./ }) op=$2 n2=(${3//./ }) i res -+ -+ for ((i=0; ; i++)) -+ do -+ if [[ ! ${n1[i]}${n2[i]} ]]; then res=0 -+ elif ((${n1[i]:-0} > ${n2[i]:-0})); then res=1 -+ elif ((${n1[i]:-0} < ${n2[i]:-0})); then res=2 -+ else continue -+ fi -+ break -+ done -+ -+ case $op in -+ gt) ((res == 1));; -+ ge) ((res != 2));; -+ eq) ((res == 0));; -+ le) ((res != 1));; -+ lt) ((res == 2));; -+ ne) ((res != 0));; -+ esac -+} -+ -+is_func() { -+ [[ $(type -t $1) = "function" ]] -+} -+ -+# Log initrd creation. -+if ! [[ $dracutlogfile ]]; then -+ [[ $dracutbasedir = /usr/share/dracut ]] && \ -+ dracutlogfile=/var/log/dracut.log || \ -+ dracutlogfile=/tmp/dracut.log -+# [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log -+ if [[ -w $dracutlogfile ]]; then -+ >"$dracutlogfile" -+ fi -+fi -+ -+dwarning() { -+ echo "W: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "W: $@" >>"$dracutlogfile" -+} -+ -+dinfo() { -+ [[ $beverbose ]] && echo "I: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "I: $@" >>"$dracutlogfile" -+} -+ -+derror() { -+ echo "E: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile" -+} -+ -+# Function prints global variables in format name=value line by line. -+# $@ = list of global variables' name -+print_vars() { -+ local var value -+ -+ for var in $@ -+ do -+ value=$(eval echo \$$var) -+ [[ ${value} ]] && echo "${var}=\"${value}\"" -+ done -+} -+ -+get_fs_env() { -+ [[ $1 ]] || return -+ eval $(udevadm info --query=env --name=$1|egrep 'ID_FS_(TYPE|UUID)=') -+ [[ $ID_FS_TYPE ]] && return -+ -+ if [[ -x /lib/udev/vol_id ]]; then -+ eval $(/lib/udev/vol_id --export $1) -+ elif find_binary blkid >/dev/null; then -+ eval $(blkid -o udev $1) -+ else -+ return 1 -+ fi -+} -+ -+get_fs_type() ( -+ [[ $1 ]] || return -+ if [[ $1 != ${1#/dev/block/nfs:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs3:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs4:} ]]; then -+ echo "nfs" -+ return -+ fi -+ get_fs_env $1 || return -+ echo $ID_FS_TYPE -+) -+ -+get_fs_uuid() ( -+ get_fs_env $1 || return -+ echo $ID_FS_UUID -+) -+ -+# finds the major:minor of the block device backing the root filesystem. -+find_block_device() { -+ local x mpt majmin dev fs misc maj min -+ if [[ $use_fstab != yes ]]; then -+ while read x x majmin x mpt x x fs dev misc; do -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $fs = btrfs ]] && { -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ } -+ if [[ $mpt = $1 ]] && [[ ${majmin#0:} = $majmin ]]; then -+ echo $majmin; -+ return 0 # we have a winner! -+ fi -+ done < /proc/self/mountinfo -+ fi -+ # fall back to /etc/fstab -+ while read dev mpt fs misc; do -+ if [[ $mpt = $1 ]]; then -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $dev != ${dev#UUID=} ]] && dev=/dev/disk/by-uuid/${dev#UUID=} -+ [[ $dev != ${dev#LABEL=} ]] && dev=/dev/disk/by-label/${dev#LABEL=} -+ [[ -b $dev ]] || return 1 # oops, not a block device. -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ fi -+ done < /etc/fstab -+ return 1; -+} -+ -+find_root_block_device() { find_block_device /; } -+ -+# Walk all the slave relationships for a given block device. -+# Stop when our helper function returns success -+# $1 = function to call on every found block device -+# $2 = block device in major:minor format -+check_block_and_slaves() { -+ local x -+ [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. -+ "$1" $2 && return -+ check_vol_slaves "$@" && return 0 -+ if [[ -f /sys/dev/block/$2/../dev ]]; then -+ check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0 -+ fi -+ [[ -d /sys/dev/block/$2/slaves ]] || return 1 -+ for x in /sys/dev/block/$2/slaves/*/dev; do -+ [[ -f $x ]] || continue -+ check_block_and_slaves $1 $(cat "$x") && return 0 -+ done -+ return 1 -+} -+ -+get_numeric_dev() { -+ ls -lH "$1" | { read a b c d maj min rest; printf "%d:%d" ${maj%%,} $min;} -+} -+ -+# ugly workaround for the lvm design -+# There is no volume group device, -+# so, there are no slave devices for volume groups. -+# Logical volumes only have the slave devices they really live on, -+# but you cannot create the logical volume without the volume group. -+# And the volume group might be bigger than the devices the LV needs. -+check_vol_slaves() { -+ for i in /dev/mapper/*; do -+ lv=$(get_numeric_dev $i) -+ if [[ $lv = $2 ]]; then -+ vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null) -+ # strip space -+ vg=$(echo $vg) -+ if [[ $vg ]]; then -+ for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \ -+ do -+ check_block_and_slaves $1 $(get_numeric_dev $pv) \ -+ && return 0 -+ done -+ fi -+ fi -+ done -+ return 1 -+} -+ -+# Install a directory, keeping symlinks as on the original system. -+# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file" -+# will create ${initdir}/lib64, ${initdir}/lib64/file, -+# and a symlink ${initdir}/lib -> lib64. -+inst_dir() { -+ local dir="$1" -+ [[ -e ${initdir}$dir ]] && return 0 -+ -+ # iterate over parent directories -+ local file="" -+ local IFS="/" -+ for part in $dir; do -+ [[ $part ]] || continue -+ file="$file/$part" -+ [[ -e ${initdir}$file ]] && continue -+ -+ if [[ -L $file ]]; then -+ # create link as the original -+ local target=$(readlink "$file") -+ ln -sfn "$target" "${initdir}$file" || return 1 -+ # resolve relative path and recursively install destionation -+ [[ $target = ${target##*/} ]] && target="${file%/*}/$target" -+ inst_dir "$target" -+ else -+ # create directory -+ mkdir -p "${initdir}$file" || return 1 -+ fi -+ done -+} -+ -+# $1 = file to copy to ramdisk -+# $2 (optional) Name for the file on the ramdisk -+# Location of the image dir is assumed to be $initdir -+# We never overwrite the target if it exists. -+inst_simple() { -+ local src target -+ [[ -f $1 ]] || return 1 -+ src=$1 target="${2:-$1}" -+ if ! [[ -d ${initdir}$target ]]; then -+ [[ -e ${initdir}$target ]] && return 0 -+ inst_dir "${target%/*}" -+ fi -+ dinfo "Installing $src" -+ cp -pfL "$src" "${initdir}$target" -+} -+ -+# find symlinks linked to given library file -+# $1 = library file -+# Function searches for symlinks by stripping version numbers appended to -+# library filename, checks if it points to the same target and finally -+# prints the list of symlinks to stdout. -+# -+# Example: -+# rev_lib_symlinks libfoo.so.8.1 -+# output: libfoo.so.8 libfoo.so -+# (Only if libfoo.so.8 and libfoo.so exists on host system.) -+rev_lib_symlinks() { -+ [[ ! $1 ]] && return 0 -+ -+ local fn="$1" orig="$(readlink -f "$1")" links='' -+ -+ [[ ${fn} =~ .*\.so\..* ]] || return 1 -+ -+ until [[ ${fn##*.} == so ]]; do -+ fn="${fn%.*}" -+ [[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}" -+ done -+ -+ echo ${links} -+} -+ -+# Same as above, but specialized to handle dynamic libraries. -+# It handles making symlinks according to how the original library -+# is referenced. -+inst_library() { -+ local src=$1 dest=${2:-$1} lib reallib symlink -+ [[ -e $initdir$dest ]] && return 0 -+ if [[ -L $src ]]; then -+ reallib=$(readlink -f "$src") -+ lib=${src##*/} -+ inst_simple "$reallib" "$reallib" -+ inst_dir "${dest%/*}" -+ (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib") -+ else -+ inst_simple "$src" "$dest" -+ fi -+ -+ # Create additional symlinks. See rev_symlinks description. -+ for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do -+ [[ ! -e $initdir$symlink ]] && { -+ dinfo "Creating extra symlink: $symlink" -+ inst_symlink $symlink -+ } -+ done -+} -+ -+# find a binary. If we were not passed the full path directly, -+# search in the usual places to find the binary. -+find_binary() { -+ local binpath="/bin /sbin /usr/bin /usr/sbin" p -+ [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } -+ for p in $binpath; do -+ [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# Same as above, but specialized to install binary executables. -+# Install binary executable, and all shared library dependencies, if any. -+inst_binary() { -+ local bin target -+ bin=$(find_binary "$1") || return 1 -+ target=${2:-$bin} -+ inst_symlink $bin $target && return 0 -+ local LDSO NAME IO FILE ADDR I1 n f TLIBDIR -+ [[ -e $initdir$target ]] && return 0 -+ # I love bash! -+ LC_ALL=C ldd $bin 2>/dev/null | while read line; do -+ [[ $line = 'not a dynamic executable' ]] && return 1 -+ if [[ $line =~ not\ found ]]; then -+ derror "Missing a shared library required by $bin." -+ derror "Run \"ldd $bin\" to find out what it is." -+ derror "dracut cannot create an initrd." -+ exit 1 -+ fi -+ so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)' -+ [[ $line =~ $so_regex ]] || continue -+ FILE=${BASH_REMATCH[1]} -+ [[ -e ${initdir}$FILE ]] && continue -+ # see if we are loading an optimized version of a shared lib. -+ lib_regex='^(/lib[^/]*).*' -+ if [[ $FILE =~ $lib_regex ]]; then -+ TLIBDIR=${BASH_REMATCH[1]} -+ BASE=${FILE##*/} -+ # prefer nosegneg libs, then unoptimized ones. -+ for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do -+ [[ -e $f/$BASE ]] || continue -+ FILE=$f/$BASE -+ break -+ done -+ inst_library "$FILE" "$TLIBDIR/$BASE" -+ IF_dynamic=yes -+ continue -+ fi -+ inst_library "$FILE" -+ done -+ inst_simple "$bin" "$target" -+} -+ -+# same as above, except for shell scripts. -+# If your shell script does not start with shebang, it is not a shell script. -+inst_script() { -+ [[ -f $1 ]] || return 1 -+ local line -+ read -r -n 80 line <"$1" -+ # If debug is set, clean unprintable chars to prevent messing up the term -+ [[ $debug ]] && line=$(echo -n "$line" | tr -c -d '[:print:][:space:]') -+ shebang_regex='(#! *)(/[^ ]+).*' -+ [[ $line =~ $shebang_regex ]] || return 1 -+ inst "${BASH_REMATCH[2]}" && inst_simple "$@" -+} -+ -+# same as above, but specialized for symlinks -+inst_symlink() { -+ local src=$1 target=$initdir${2:-$1} realsrc -+ [[ -L $1 ]] || return 1 -+ [[ -L $target ]] && return 0 -+ realsrc=$(readlink -f "$src") -+ [[ $realsrc = ${realsrc##*/} ]] && realsrc=${src%/*}/$realsrc -+ inst "$realsrc" && mkdir -p "${target%/*}" && \ -+ ln -s "$realsrc" "$target" -+} -+ -+# find a udev rule in the usual places. -+find_rule() { -+ [[ -f $1 ]] && { echo "$1"; return 0; } -+ for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do -+ [[ -f $r/$1 ]] && { echo "$r/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# udev rules always get installed in the same place, so -+# create a function to install them to make life simpler. -+inst_rules() { -+ local target=/etc/udev/rules.d rule found -+ -+ inst_dir "/lib/udev/rules.d" -+ inst_dir "$target" -+ for rule in "$@"; do -+ found=$(find_rule "$rule") && \ -+ inst_simple "$found" "$target/${found##*/}" \ -+ || dinfo "Skipping udev rule: $rule" -+ done -+} -+ -+# general purpose installation function -+# Same args as above. -+inst() { -+ case $# in -+ 1) ;; -+ 2) [[ ! $initdir && -d $2 ]] && export initdir=$2 -+ [[ $initdir = $2 ]] && set $1;; -+ 3) [[ -z $initdir ]] && export initdir=$2 -+ set $1 $3;; -+ *) derror "inst only takes 1 or 2 or 3 arguments" -+ exit 1;; -+ esac -+ for x in inst_symlink inst_script inst_binary inst_simple; do -+ $x "$@" && return 0 -+ done -+ return 1 -+} -+ -+# install function specialized for hooks -+# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook -+# All hooks should be POSIX/SuS compliant, they will be sourced by init. -+inst_hook() { -+ if ! [[ -f $3 ]]; then -+ derror "Cannot install a hook ($3) that does not exist." -+ derror "Aborting initrd creation." -+ exit 1 -+ elif ! strstr "$hookdirs" "$1"; then -+ derror "No such hook type $1. Aborting initrd creation." -+ exit 1 -+ fi -+ inst_simple "$3" "/${1}/${2}${3##*/}" -+} -+ -+dracut_install() { -+ if [[ $1 = '-o' ]]; then -+ local optional=yes -+ shift -+ fi -+ while (($# > 0)); do -+ if ! inst "$1" ; then -+ if [[ $optional = yes ]]; then -+ dwarning "Skipping program $1 as it cannot be found and is flagged to be optional" -+ else -+ derror "Failed to install $1" -+ exit 1 -+ fi -+ fi -+ shift -+ done -+} -+ -+# install function decompressing the target and handling symlinks -+# $@ = list of compressed (gz or bz2) files or symlinks pointing to such files -+# -+# Function install targets in the same paths inside overlay but decompressed -+# and without extensions (.gz, .bz2). -+inst_decompress() { -+ local src dst realsrc realdst cmd -+ -+ for src in $@ -+ do -+ case ${src} in -+ *.gz) cmd='gzip -d' ;; -+ *.bz2) cmd='bzip2 -d' ;; -+ *) return 1 ;; -+ esac -+ -+ if [[ -L ${src} ]] -+ then -+ realsrc="$(readlink -f ${src})" # symlink target with extension -+ dst="${src%.*}" # symlink without extension -+ realdst="${realsrc%.*}" # symlink target without extension -+ mksubdirs "${initdir}/${src}" -+ # Create symlink without extension to target without extension. -+ ln -s "${realdst}" "${initdir}/${dst}" -+ fi -+ -+ # If the source is symlink we operate on its target. -+ [[ ${realsrc} ]] && src=${realsrc} -+ inst ${src} -+ # Decompress with chosen tool. We assume that tool changes name e.g. -+ # from 'name.gz' to 'name'. -+ ${cmd} "${initdir}${src}" -+ done -+} -+ -+# It's similar to above, but if file is not compressed, performs standard -+# install. -+# $@ = list of files -+inst_opt_decompress() { -+ local src -+ -+ for src in $@ -+ do -+ inst_decompress "${src}" || inst "${src}" -+ done -+} -+ -+module_check() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we are unconditionally included -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check $hostonly -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func check || return 0 -+ check -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_depends() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we have no deps -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check -d -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func depends || return 0 -+ depends -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_install() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/install ]] && . "$moddir/install" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func install || return 0 -+ install -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_installkernel() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/installkernel ]] && . "$moddir/installkernel" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func installkernel || return 0 -+ installkernel -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+check_module() { -+ local mod=$1; -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ local moddep; -+ # If we are already scheduled to be loaded, no need to check again. -+ strstr " $mods_to_load " " $mod " && return 0 -+ strstr " $mods_checked_as_dep " " $mod " && return 1 -+ -+ # This should never happen, but... -+ [[ -d $moddir ]] || return 1 -+ -+ [[ $2 ]] || mods_checked_as_dep+=" $mod " -+ -+ strstr " $omit_dracutmodules " " $mod " && return 1 -+ -+ if strstr " $dracutmodules $add_dracutmodules " " $mod "; then -+ module_check $mod; ret=$? -+ # explicit module, so also accept ret=255 -+ [[ $ret = 0 || $ret = 255 ]] || return 1 -+ else -+ # module not in our list -+ if [[ $dracutmodules = all ]]; then -+ # check, if we can and should install this module -+ module_check $mod || return 1 -+ else -+ # skip this module -+ return 1 -+ fi -+ fi -+ -+ for moddep in $(module_depends $mod); do -+ # handle deps as if they were manually added -+ strstr " $add_dracutmodules " " $moddep " || \ -+ add_dracutmodules+=" $moddep " -+ # if a module we depend on fail, fail also -+ check_module $moddep || return 1 -+ done -+ -+ strstr " $mods_to_load " " $mod " || \ -+ mods_to_load+=" $mod " -+ -+ return 0 -+} -+ -+check_module_dir() { -+ local modcheck; -+ local mod; -+ mods_to_load="" -+ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do -+ local mod=${moddir##*/}; mod=${mod#[0-9][0-9]} -+ check_module $mod 1 -+ done -+} -+ -+# Install a single kernel module along with any firmware it may require. -+# $1 = full path to kernel module to install -+install_kmod_with_fw() { -+ local modname=${1##*/} fwdir found -+ modname=${modname%.ko*} -+ inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \ -+ return 0 # no need to go further if the module is already installed -+ for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do -+ found='' -+ for fwdir in $fw_dir; do -+ if [[ -d $fwdir && -f $fwdir/$fw ]]; then -+ inst_simple "$fwdir/$fw" "/lib/firmware/$fw" -+ found=yes -+ fi -+ done -+ if [[ $found != yes ]]; then -+ dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\"" -+ fi -+ done -+} -+ -+# Do something with all the dependencies of a kernel module. -+# Note that kernel modules depend on themselves using the technique we use -+# $1 = function to call for each dependency we find -+# It will be passed the full path to the found kernel module -+# $2 = module to get dependencies for -+# rest of args = arguments to modprobe -+for_each_kmod_dep() { -+ local func=$1 kmod=$2 cmd modpapth options -+ shift 2 -+ modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \ -+ while read cmd modpath options; do -+ [[ $cmd = insmod ]] || continue -+ $func $modpath -+ done -+} -+ -+# filter kernel modules to install certain modules that meet specific -+# requirements. -+# $1 = function to call with module name to filter. -+# This function will be passed the full path to the module to test. -+# The behaviour of this function can vary depending on whether $hostonly is set. -+# If it is, we will only look at modules that are already in memory. -+# If it is not, we will look at all kernel modules -+# This function returns the full filenames of modules that match $1 -+filter_kernel_modules () ( -+ if ! [[ $hostonly ]]; then -+ filtercmd='find "$srcmods/kernel/drivers" "$srcmods/extra" "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz" 2>/dev/null' -+ else -+ filtercmd='cut -d " " -f 1 /dev/null' -+ fi -+ for modname in $(eval $filtercmd); do -+ case $modname in -+ *.ko) "$1" "$modname" && echo "$modname";; -+ *.ko.gz) gzip -dc "$modname" > $initdir/$$.ko -+ $1 $initdir/$$.ko && echo "$modname" -+ rm -f $initdir/$$.ko;; -+ esac -+ done -+) -+ -+# install kernel modules along with all their dependencies. -+instmods() { -+ [[ $no_kernel = yes ]] && return -+ local mod mpargs modpath modname cmd moddirname -+ while (($# > 0)); do -+ mod=${1%.ko*} -+ case $mod in -+ =*) -+ # This introduces 2 incompatible meanings for =* arguments -+ # to instmods. We need to decide which one to keep. -+ if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then -+ instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block") -+ elif [ -f $srcmods/modules.${mod#=} ]; then -+ instmods $mpargs $(cat ${srcmods}/modules.${mod#=} ) -+ else -+ instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*") -+ fi -+ ;; -+ --*) -+ mod=${mod##*/} -+ mpargs+=" $mod";; -+ i2o_scsi) shift; continue;; # Do not load this diagnostic-only module -+ *) mod=${mod##*/} -+ # if we are already installed, skip this module and go on -+ # to the next one. -+ [[ -f $initdir/$1 ]] && { shift; continue; } -+ # If we are building a host-specific initramfs and this -+ # module is not already loaded, move on to the next one. -+ [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \ -+ ! echo $add_drivers | grep -qe "\<${mod}\>" && { -+ shift; continue; -+ } -+ -+ # We use '-d' option in modprobe only if modules prefix path -+ # differs from default '/'. This allows us to use Dracut with -+ # old version of modprobe which doesn't have '-d' option. -+ moddirname=${srcmods%%/lib/modules/*} -+ [[ -n ${moddirname} ]] && moddirname="-d ${moddirname}/" -+ -+ # ok, load the module, all its dependencies, and any firmware -+ # it may require -+ for_each_kmod_dep install_kmod_with_fw $mod \ -+ --set-version $kernel ${moddirname} -+ ;; -+ esac -+ shift -+ done -+} -diff --git gen_cmdline.sh gen_cmdline.sh -index 9e4009e..5b45943 100755 ---- gen_cmdline.sh -+++ gen_cmdline.sh -@@ -22,6 +22,7 @@ longusage() { - echo " --logfile= Output file for debug info" - echo " --color Output debug in color" - echo " --no-color Do not output debug in color" -+ echo " --no-cleartmp Do not clear temp directory" - echo " Kernel Configuration settings" - echo " --menuconfig Run menuconfig after oldconfig" - echo " --no-menuconfig Do not run menuconfig after oldconfig" -@@ -78,6 +79,8 @@ longusage() { - echo " --evms Include EVMS support" - echo " --> 'emerge evms' in the host operating system" - echo " first" -+ echo " --udev Include udev in the initramfs" -+ echo " --no-udev Exclude udev from the initramfs" - echo " --lvm Include LVM support" - echo " --mdadm Include MDADM/MDMON support" - echo " --mdadm-config= Use file as mdadm.conf in initramfs" -@@ -97,6 +100,8 @@ longusage() { - echo " --unionfs Include support for unionfs" - echo " --netboot Create a self-contained env in the initramfs" - echo " --real-root= Specify a default for real_root=" -+ echo " --lscpi Include lspci into the initramfs" -+ echo " --no-lscpi Exclude lspci from the initramfs" - echo " Internals" - echo " --arch-override= Force to arch instead of autodetect" - echo " --cachedir= Override the default cache location" -@@ -224,6 +229,22 @@ parse_cmdline() { - CMD_KEYMAP=0 - print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" - ;; -+ --udev) -+ CMD_UDEV=1 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --no-udev) -+ CMD_UDEV=0 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --lspci) -+ CMD_LSPCI=1 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --no-lspci) -+ CMD_UDEV=0 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; - --evms) - CMD_EVMS=1 - print_info 2 "CMD_EVMS: ${CMD_EVMS}" -@@ -443,6 +464,10 @@ parse_cmdline() { - print_info 2 "USECOLOR: ${USECOLOR}" - setColorVars - ;; -+ --no-cleartmp) -+ NOCLEARTMP=1 -+ print_info 2 "NOCLEARTMP: ${NOCLEARTMP}" -+ ;; - --logfile=*) - CMD_LOGFILE=`parse_opt "$*"` - LOGFILE=`parse_opt "$*"` -diff --git gen_compile.sh gen_compile.sh -index ec752ce..6e011b9 100755 ---- gen_compile.sh -+++ gen_compile.sh -@@ -402,7 +402,10 @@ compile_busybox() { - yes '' 2>/dev/null | compile_generic oldconfig utils - - print_info 1 'busybox: >> Compiling...' -+ OLDLOGLEVEL=$LOGLEVEL -+ LOGLEVEL=1 - compile_generic all utils -+ LOGLEVEL=$OLDLOGLEVEL - print_info 1 'busybox: >> Copying to cache...' - [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] || - gen_die 'Busybox executable does not exist!' -diff --git gen_determineargs.sh gen_determineargs.sh -index e680569..e13faf3 100755 ---- gen_determineargs.sh -+++ gen_determineargs.sh -@@ -107,6 +107,8 @@ determine_real_args() { - set_config_with_override 1 SYMLINK CMD_SYMLINK - set_config_with_override 2 INSTALL_MOD_PATH CMD_INSTALL_MOD_PATH - set_config_with_override 1 OLDCONFIG CMD_OLDCONFIG -+ set_config_with_override 1 UDEV CMD_UDEV -+ set_config_with_override 1 LSPCI CMD_LSPCI - set_config_with_override 1 LVM CMD_LVM - set_config_with_override 1 EVMS CMD_EVMS - set_config_with_override 1 DMRAID CMD_DMRAID -diff --git gen_initramfs.sh gen_initramfs.sh -index 543f484..d07818f 100755 ---- gen_initramfs.sh -+++ gen_initramfs.sh -@@ -56,7 +56,13 @@ append_busybox() { - chmod +x "${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/default.script" - - # Set up a few default symlinks -- for i in ${BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}; do -+ if isTrue "${UDEV}" -+ then -+ BUSYBOX_APPLETS="${BUSYBOX_APPLETS:-[ ash sh uname echo cut cat}" -+ else -+ BUSYBOX_APPLETS="{$BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}" -+ fi -+ for i in ${BUSYBOX_APPLETS}; do - rm -f ${TEMP}/initramfs-busybox-temp/bin/$i > /dev/null - ln -s busybox ${TEMP}/initramfs-busybox-temp/bin/$i || - gen_die "Busybox error: could not link ${i}!" -@@ -463,7 +469,7 @@ append_firmware() { - IFS="," - for i in ${FIRMWARE_FILES} - do -- cp -L "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ -+ cp -rL "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ - done - IFS=$OLD_IFS - else -@@ -491,9 +497,66 @@ append_gpg() { - chmod a+x "${TEMP}/initramfs-gpg-temp/sbin/gpg" - cd "${TEMP}/initramfs-gpg-temp/" - find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" - rm -rf "${TEMP}/initramfs-gpg-temp" > /dev/null - } - -+append_udev() { -+ if [ -d "${TEMP}/initramfs-udev-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-udev-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-udev-temp/" -+ udevmod="${GK_SHARE}/modules/udev-rules/" -+ source ${udevmod}/module-setup.sh -+ initdir=${TEMP}/initramfs-udev-temp \ -+ moddir=${udevmod} \ -+ libdir=/lib/ \ -+ usrlibdir=/usr/lib/ \ -+ install_module -+ -+ if isTrue $LSPCI -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ fi -+ # find net modules and sound -+ ((find ${INSTALL_MOD_PATH}/lib/modules/${KV}/net -name "*.ko"; -+ find ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/net -name "*.ko"; -+ find ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/drivers/net -name "*.ko"; -+ find ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/sound -name "*.ko") | -+ # add them prefix blacklist -+ while read module;do -+ echo "blacklist `basename $module .ko`"; -+ # concat with ready blacklist.conf -+ done;cat "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf") | -+ # sort and rewrite blacklist.conf -+ sort | uniq > "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf" -+ -+ cd "${TEMP}/initramfs-udev-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-udev-temp" > /dev/null -+} -+ -+append_lspci() { -+ if [ -d "${TEMP}/initramfs-lspci-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-lspci-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-lspci-temp/" -+ -+ initdir=${TEMP}/initramfs-lspci-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ -+ cd "${TEMP}/initramfs-lspci-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-lspci-temp" > /dev/null -+} -+ - print_list() - { - local x -@@ -542,6 +605,11 @@ append_modules() { - print_list ${!group_modules} > "${TEMP}/initramfs-modules-${KV}-temp/etc/modules/${group}" - done - cd "${TEMP}/initramfs-modules-${KV}-temp/" -+ # remove sound and media -+ for x in `find . -type d -name media -o -type d -name sound` -+ do -+ rm -r "${x}" &>/dev/null -+ done - find . | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ - || gen_die "compressing modules cpio" - cd "${TEMP}" -@@ -614,11 +682,14 @@ append_auxilary() { - done - echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" - -- if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ if ! isTrue "${UDEV}" - then -- cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -- else -- cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ then -+ cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ else -+ cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ fi - fi - if isTrue $CMD_DOKEYMAPAUTO - then -@@ -635,7 +706,7 @@ append_auxilary() { - chmod +x "${TEMP}/initramfs-aux-temp/init" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" -- chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ isTrue "${UDEV}" || chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" - - if isTrue ${NETBOOT} - then -@@ -662,6 +733,21 @@ append_data() { - fi - } - -+pack_cpio() { -+ print_info 1 " >> Pack cpio data..." -+ if [ -d "${TEMP}/initramfs-repack-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-repack-temp" -+ fi -+ mkdir -p "${TEMP}/initramfs-repack-temp" -+ cd "${TEMP}/initramfs-repack-temp" -+ # unpack and pack cpio remove double files -+ cpio -di <${CPIO} 2>/dev/null -+ find . -print | cpio ${CPIO_ARGS} | gzip -9 >"${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-repack-temp" > /dev/null -+} -+ - create_initramfs() { - print_info 1 "initramfs: >> Initializing..." - -@@ -672,6 +758,11 @@ create_initramfs() { - - append_data 'base_layout' - append_data 'auxilary' "${BUSYBOX}" -+ append_data 'udev' "${UDEV}" -+ if ! isTrue "${UDEV}" -+ then -+ append_data 'lspci' "${LSPCI}" -+ fi - append_data 'busybox' "${BUSYBOX}" - append_data 'lvm' "${LVM}" - append_data 'dmraid' "${DMRAID}" -@@ -706,8 +797,7 @@ create_initramfs() { - append_data 'overlay' - fi - -- gzip -9 "${CPIO}" -- mv -f "${CPIO}.gz" "${CPIO}" -+ pack_cpio - - if isTrue "${INTEGRATED_INITRAMFS}" - then -diff --git genkernel genkernel -index b779032..3786296 100755 ---- genkernel -+++ genkernel -@@ -9,6 +9,7 @@ GK_V='3.4.15' - TMPDIR='/var/tmp/genkernel' - - TODEBUGCACHE=1 # Until an error occurs or LOGFILE is fully qualified. -+NOCLEARTMP=0 - - small_die() { - echo $1 -@@ -45,6 +46,7 @@ source ${GK_SHARE}/gen_initramfs.sh || gen_die "Could not read ${GK_SHARE}/gen_i - source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_moddeps.sh" - source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh" - source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh" -+source ${GK_SHARE}/dracut_funcs.sh || gen_die "Could not read ${GK_SHARE}/dracut_funcs.sh" - - TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ - -@@ -55,21 +57,25 @@ trap_cleanup(){ - } - - cleanup(){ -- if [ -n "$TEMP" -a -d "$TEMP" ]; then -- rm -rf "$TEMP" -- fi -- -- if isTrue ${POSTCLEAR} -- then -- echo -- print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -- print_info 1 "CACHE_DIR: ${CACHE_DIR}" -- CLEAR_CACHE_DIR='yes' -- setup_cache_dir -- echo -- print_info 1 "TMPDIR: ${TMPDIR}" -- clear_tmpdir -- fi -+ if [[ ${NOCLEARTMP} -ne 0 ]] -+ then -+ return -+ fi -+ if [ -n "$TEMP" -a -d "$TEMP" ]; then -+ rm -rf "$TEMP" &>/dev/null -+ fi -+ -+ if isTrue ${POSTCLEAR} -+ then -+ echo -+ print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -+ print_info 1 "CACHE_DIR: ${CACHE_DIR}" -+ CLEAR_CACHE_DIR='yes' -+ setup_cache_dir -+ echo -+ print_info 1 "TMPDIR: ${TMPDIR}" -+ clear_tmpdir -+ fi - } - - trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL -diff --git genkernel.conf genkernel.conf -index a5988da..90824f2 100644 ---- genkernel.conf -+++ genkernel.conf -@@ -49,6 +49,12 @@ USECOLOR="yes" - # argument is: *+1 - # MAKEOPTS="-j2" - -+# Add udev to initramfs -+UDEV="yes" -+ -+# Add lspci to initramfs -+LSPCI="yes" -+ - # Add in LVM support from static binaries if they exist on the system, or - # compile static LVM binaries if static ones do not exist. - # LVM="no" -@@ -90,7 +96,7 @@ USECOLOR="yes" - # Specify directory to pull from - # FIRMWARE_DIR="/lib/firmware" - # Specify specific firmware files to include. This overrides FIRMWARE_DIR --# FIRMWARE_FILES="" -+FIRMWARE_FILES="/lib/firmware/radeon" - - # Enable disklabel support (copies blkid to initrd) - DISKLABEL="yes" -diff --git modules/udev-rules/01-ignore.rules modules/udev-rules/01-ignore.rules -new file mode 100644 -index 0000000..b32f22e ---- /dev/null -+++ modules/udev-rules/01-ignore.rules -@@ -0,0 +1 @@ -+KERNEL=="ram[0-9]*", OPTIONS+="ignore_device", OPTIONS+="last_rule" -diff --git modules/udev-rules/59-persistent-storage-volid.rules modules/udev-rules/59-persistent-storage-volid.rules -new file mode 100644 -index 0000000..0b798e6 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage-volid.rules -@@ -0,0 +1,7 @@ -+SUBSYSTEM!="block", GOTO="psv_end" -+ACTION!="add|change", GOTO="psv_end" -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="cciss[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", IMPORT{program}="vol_id --export $tempnode" -+LABEL="psv_end" -diff --git modules/udev-rules/59-persistent-storage.rules modules/udev-rules/59-persistent-storage.rules -new file mode 100644 -index 0000000..2b83e72 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage.rules -@@ -0,0 +1,38 @@ -+SUBSYSTEM!="block", GOTO="ps_end" -+ACTION!="add|change", GOTO="ps_end" -+ -+KERNEL=="cciss[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end" -+ -+# partitions have no md/{array_state,metadata_version} -+ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" -+ -+# container devices have a metadata version of e.g. 'external:ddf' and -+# never leave state 'inactive' -+ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -+TEST!="md/array_state", GOTO="md_end" -+ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -+ -+LABEL="md_ignore_state" -+ -+IMPORT{program}="/sbin/mdadm --detail --export $tempnode" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+OPTIONS+="link_priority=100" -+OPTIONS+="watch" -+LABEL="md_end" -+ -+ -+KERNEL!="dm-[0-9]*", GOTO="ps_end" -+ACTION=="add", GOTO="ps_end" -+IMPORT{program}="/sbin/dmsetup info -c --nameprefixes --unquoted --rows --noheadings -o name,uuid,suspended,readonly,major,minor,open,tables_loaded,names_using_dev -j%M -m%m" -+ENV{DM_NAME}!="?*", GOTO="ps_end" -+ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="ps_end" -+ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="ps_end" -+ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="ps_end" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+LABEL="ps_end" -diff --git modules/udev-rules/61-persistent-storage.rules modules/udev-rules/61-persistent-storage.rules -new file mode 100644 -index 0000000..9cfdb0b ---- /dev/null -+++ modules/udev-rules/61-persistent-storage.rules -@@ -0,0 +1,20 @@ -+SUBSYSTEM!="block", GOTO="pss_end" -+ACTION!="add|change", GOTO="pss_end" -+ -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss" -+KERNEL=="cciss[0-9]*", GOTO="do_pss" -+KERNEL=="nbd[0-9]*", GOTO="do_pss" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", GOTO="do_pss" -+ -+GOTO="pss_end" -+ -+LABEL="do_pss" -+# by-path (parent device path) -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{program}="path_id %p" -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" -+ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" -+ -+# by-label/by-uuid links (filesystem metadata) -+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -+LABEL="pss_end" -diff --git modules/udev-rules/blacklist.conf modules/udev-rules/blacklist.conf -new file mode 100644 -index 0000000..21ac71c ---- /dev/null -+++ modules/udev-rules/blacklist.conf -@@ -0,0 +1,162 @@ -+blacklist ath_pci -+blacklist evbug -+blacklist usbmouse -+blacklist usbkbd -+blacklist eepro100 -+blacklist de4x5 -+blacklist eth1394 -+blacklist snd_intel8x0m -+blacklist snd_aw2 -+blacklist i2c_i801 -+blacklist prism54 -+blacklist bcm43xx -+blacklist garmin_gps -+blacklist asus_acpi -+blacklist snd_pcsp -+blacklist pcspkr -+blacklist amd76x_edac -+blacklist ohci1394 -+blacklist sbp2 -+blacklist dv1394 -+blacklist raw1394 -+blacklist video1394 -+blacklist aty128fb -+blacklist atyfb -+blacklist radeonfb -+blacklist cirrusfb -+blacklist cyber2000fb -+blacklist cyblafb -+blacklist gx1fb -+blacklist hgafb -+blacklist i810fb -+blacklist intelfb -+blacklist kyrofb -+blacklist lxfb -+blacklist matroxfb_base -+blacklist neofb -+blacklist nvidiafb -+blacklist pm2fb -+blacklist rivafb -+blacklist s1d13xxxfb -+blacklist savagefb -+blacklist sisfb -+blacklist sstfb -+blacklist tdfxfb -+blacklist tridentfb -+blacklist vesafb -+blacklist vfb -+blacklist viafb -+blacklist vt8623fb -+blacklist ac97 -+blacklist ac97_codec -+blacklist ac97_plugin_ad1980 -+blacklist ad1848 -+blacklist ad1889 -+blacklist adlib_card -+blacklist aedsp16 -+blacklist ali5455 -+blacklist btaudio -+blacklist cmpci -+blacklist cs4232 -+blacklist cs4281 -+blacklist cs461x -+blacklist cs46xx -+blacklist emu10k1 -+blacklist es1370 -+blacklist es1371 -+blacklist esssolo1 -+blacklist forte -+blacklist gus -+blacklist i810_audio -+blacklist kahlua -+blacklist mad16 -+blacklist maestro -+blacklist maestro3 -+blacklist maui -+blacklist mpu401 -+blacklist nm256_audio -+blacklist opl3 -+blacklist opl3sa -+blacklist opl3sa2 -+blacklist pas2 -+blacklist pss -+blacklist rme96xx -+blacklist sb -+blacklist sb_lib -+blacklist sgalaxy -+blacklist sonicvibes -+blacklist sound -+blacklist sscape -+blacklist trident -+blacklist trix -+blacklist uart401 -+blacklist uart6850 -+blacklist via82cxxx_audio -+blacklist v_midi -+blacklist wavefront -+blacklist ymfpci -+blacklist ac97_plugin_wm97xx -+blacklist ad1816 -+blacklist audio -+blacklist awe_wave -+blacklist dmasound_core -+blacklist dmasound_pmac -+blacklist harmony -+blacklist sequencer -+blacklist soundcard -+blacklist usb-midi -+blacklist acquirewdt -+blacklist advantechwdt -+blacklist alim1535_wdt -+blacklist alim7101_wdt -+blacklist booke_wdt -+blacklist cpu5wdt -+blacklist eurotechwdt -+blacklist i6300esb -+blacklist i8xx_tco -+blacklist ib700wdt -+blacklist ibmasr -+blacklist indydog -+blacklist iTCO_wdt -+blacklist it8712f_wdt -+blacklist it87_wdt -+blacklist ixp2000_wdt -+blacklist ixp4xx_wdt -+blacklist machzwd -+blacklist mixcomwd -+blacklist mpc8xx_wdt -+blacklist mpcore_wdt -+blacklist mv64x60_wdt -+blacklist pc87413_wdt -+blacklist pcwd -+blacklist pcwd_pci -+blacklist pcwd_usb -+blacklist s3c2410_wdt -+blacklist sa1100_wdt -+blacklist sbc60xxwdt -+blacklist sbc7240_wdt -+blacklist sb8360 -+blacklist sc1200wdt -+blacklist sc520_wdt -+blacklist sch311_wdt -+blacklist scx200_wdt -+blacklist shwdt -+blacklist smsc37b787_wdt -+blacklist softdog -+blacklist twl4030_wdt -+blacklist w83627hf_wdt -+blacklist w83697hf_wdt -+blacklist w83697ug_wdt -+blacklist w83877f_wdt -+blacklist w83977f_wdt -+blacklist wafer5823wdt -+blacklist wdt -+blacklist wdt_pci -+blacklist wm8350_wdt -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -diff --git modules/udev-rules/load-modules.sh modules/udev-rules/load-modules.sh -new file mode 100755 -index 0000000..36972fd ---- /dev/null -+++ modules/udev-rules/load-modules.sh -@@ -0,0 +1,7 @@ -+#!/bin/sh -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+# Implement blacklisting for udev-loaded modules -+ -+modprobe -b "$@" -diff --git modules/udev-rules/module-setup.sh modules/udev-rules/module-setup.sh -new file mode 100755 -index 0000000..1005627 ---- /dev/null -+++ modules/udev-rules/module-setup.sh -@@ -0,0 +1,57 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+install_module() { -+ # FIXME: would be nice if we didn't have to know which rules to grab.... -+ # ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies -+ # of the rules we want so that we just copy those in would be best -+ dracut_install udevd udevadm /etc/udev/udev.conf /etc/group /bin/mount /sbin/modprobe -+ inst_rules 50-udev-default.rules 60-persistent-storage.rules \ -+ 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \ -+ 60-pcmcia.rules -+ mkdir -p "$initdir"/etc/modprobe.d -+ inst_simple "$moddir/blacklist.conf" /etc/modprobe.d/ -+ -+ # ignore some devices in the initrd -+ inst_rules "$moddir/01-ignore.rules" -+ -+ # for firmware loading -+ inst_rules 50-firmware.rules -+ -+ if [ ! -x /lib/udev/vol_id ]; then -+ inst_rules "$moddir/59-persistent-storage.rules" -+ else -+ inst_rules "$moddir/59-persistent-storage-volid.rules" -+ fi -+ inst_rules "$moddir/61-persistent-storage.rules" -+ -+ for i in \ -+ ata_id \ -+ cdrom_id \ -+ create_floppy_devices \ -+ edd_id \ -+ firmware.sh \ -+ firmware \ -+ firmware.agent \ -+ hotplug.functions \ -+ fw_unit_symlinks.sh \ -+ hid2hci \ -+ path_id \ -+ scsi_id \ -+ usb_id \ -+ vol_id \ -+ pcmcia-socket-startup \ -+ pcmcia-check-broken-cis \ -+ ; do -+ for utilpath in /lib/udev /sbin /bin -+ do -+ [ -e $utilpath/$i ] && dracut_install $utilpath/$i -+ done -+ done -+ -+ for i in {"$libdir","$usrlibdir"}/libnss_files*; do -+ [ -e "$i" ] && dracut_install "$i" -+ done -+} -+ diff --git a/sys-kernel/calckernel/files/calckernel-3.4.18-r1.patch b/sys-kernel/calckernel/files/calckernel-3.4.18-r1.patch deleted file mode 100644 index e8733b468..000000000 --- a/sys-kernel/calckernel/files/calckernel-3.4.18-r1.patch +++ /dev/null @@ -1,2083 +0,0 @@ -diff --git defaults/initrd.defaults defaults/initrd.defaults -index 76d72a7..0c059a5 100755 ---- defaults/initrd.defaults -+++ defaults/initrd.defaults -@@ -68,6 +68,7 @@ fi - - REAL_ROOT='' - CDROOT='0' -+SCRATCH='0' - CDROOT_DEV='' - CDROOT_TYPE='auto' - NEW_ROOT='/newroot' -diff --git defaults/initrd.scripts defaults/initrd.scripts -index 51ebcce..3723854 100755 ---- defaults/initrd.scripts -+++ defaults/initrd.scripts -@@ -187,23 +187,45 @@ cache_cd_contents() { - # TODO: Check the size of the image versus the size of our tmpfs - # along with the amount of available RAM and increase tmpfs size - # if necessary. (Not having awk sucks...) -- # z=0 -- # for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -- # cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; do -- # z=$(($z + $i)) ; done -- # echo $z -- good_msg "Copying loop file for caching..." -- # Verify that the needed directory exists -- mkdir -p "$(dirname ${NEW_ROOT}/mnt/${LOOP})" -- cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/${LOOP} -- if [ $? -ne 0 ] -+ -+ # getting memory -+ allmemory=0 -+ for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -+ cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; -+ do -+ allmemory=$(($allmemory + $i)) -+ done -+ -+ # getting size tmpfs of default -+ let curtfs=$allmemory/2 -+ -+ # getting size of image -+ let imagesize=`ls -la ${NEW_ROOT}/mnt/cdrom/${LOOP} | sed -r -n 's/(\S*\s*){4}(\S*).*/\2/p'`/20000*21 -+ let addon=$imagesize/10 -+ if [[ $curtfs -gt $(( ${imagesize} + ${addon} )) ]]; - then -- bad_msg "Failed to cache the loop file! Lack of space?" -- rm -rf ${NEW_ROOT}/mnt/livecd.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/image.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/zisofs 2>/dev/null -+ let addon=$(( $curtfs - ${imagesize} )) -+ fi -+ -+ if [[ $((${imagesize} + $addon)) -lt ${allmemory} ]]; -+ then -+ mount -o remount,size=${addon}000 -t tmpfs tmpfs ${NEW_ROOT} -+ mkdir ${NEW_ROOT}/mnt/squash -+ mount -o size=${imagesize}000 -t tmpfs tmpfs ${NEW_ROOT}/mnt/squash -+ good_msg "Copying loop file for caching..." -+ cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/squash/${LOOP} -+ if [ $? -ne 0 ] -+ then -+ bad_msg "Failed to cache the loop file! Lack of space?" -+ umount ${NEW_ROOT}/mnt/squash -+ mount -o remount,size=${curtfs}000 -t tmpfs tmpfs ${NEW_ROOT} -+ else -+ LOOPEXT='../squash/' -+ good_msg "Unmounting media from ${NEW_ROOT}/mnt/cdrom" -+ umount ${NEW_ROOT}/mnt/cdrom -+ fi - else -- LOOPEXT='../' -+ bad_msg "Too low memory for cache the loop file." - fi - fi - fi -@@ -655,7 +677,7 @@ startVolumes() { - [ -d /etc/lvm/cache ] && lvm_commands="${lvm_commands} \nvgscan" - - # To activate volumegroups on all devices in the cache -- lvm_commands="${lvm_commands} \nvgchange -ay --sysinit" -+ lvm_commands="${lvm_commands} \nvgchange -ay --sysinit --noudevsync" - - # And finally execute it all (/proc/... needed if lvm is compiled without readline) - good_msg "Scanning for and activating Volume Groups" -@@ -1082,6 +1104,38 @@ getdvhoff() { - echo $(( $(hexdump -n 4 -s $((316 + 12 * $2)) -e '"%i"' $1) * 512)) - } - -+load_union_module() { -+ UNIONTYPE="" -+ # find module for union file system -+ [ -n "$(find /lib/ -name unionfs.ko)" ] && UNIONTYPE="unionfs" -+ [ -n "$(find /lib/ -name aufs.ko)" ] && UNIONTYPE="aufs" -+ # probably aufs in kernel -+ if [ -n "$(gzip -dc /proc/config.gz | grep CONFIG_AUFS_FS=y )" ] -+ then -+ UNIONTYPE="aufs" -+ else -+ if [ -z "${UNIONTYPE}" ] -+ then -+ bad_msg "Module for union file system is not found!" -+ run_shell -+ else -+ modprobe ${UNIONTYPE} > /dev/null 2>&1 -+ # error on load union module -+ if [ -z "$(lsmod | grep $UNIONTYPE)" ] -+ then -+ bad_msg "Module for union file system is not correct!" -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ bad_msg "Probably kernel compiled without standalone patch." -+ fi -+ run_shell -+ fi -+ -+ good_msg "Loading ${UNIONTYPE}" -+ fi -+ fi -+} -+ - setup_unionfs() { - local rw_dir=$1 - local ro_dir=$2 -@@ -1101,6 +1155,7 @@ setup_unionfs() { - mkdir -p ${UNION} - good_msg "Loading fuse module" - modprobe fuse > /dev/null 2>&1 -+ load_union_module - # if [ -n "${UNIONFS}" ] - # then - # CHANGESDEV=${UNIONFS} -@@ -1130,11 +1185,102 @@ setup_unionfs() { - mkdir /tmp - mkdir -p ${UNION} - # mkdir -p $CHANGES --# mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+## mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+ -+ if [ "${SCRATCH}" -ne 0 ]; -+ then -+ good_msg "Loading in scratch mode" -+ BUILDERDIR=${UNION}/mnt/builder -+ SCRATCHDIR=${UNION}/mnt/scratch -+ DELTADIR=${rw_dir}/mnt/delta -+ WORKSPACEDIR=${rw_dir}/mnt/workspace -+ mount -o remount,rw ${rw_dir}/mnt/cdrom >/dev/null 2>&1 -+ touch ${rw_dir}/mnt/cdrom/livecd >/dev/null 2>&1 -+ if [ "$?" -ne 0 ]; -+ then -+ ISRW=0 -+ else -+ ISRW=1 -+ fi -+ -+ mkdir -p ${DELTADIR} -+ mkdir -p ${WORKSPACEDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${WORKSPACEDIR}=rw:${DELTADIR}=ro+wh:${rw_dir}/mnt/livecd=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${WORKSPACEDIR}=rw:${DELTADIR}=ro:${rw_dir}/mnt/livecd=ro unionfs ${UNION} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${SCRATCHDIR}/calculate -+ mkdir -p ${SCRATCHDIR}/delta -+ mkdir -p ${SCRATCHDIR}/workspace -+ mount -o bind ${rw_dir}/mnt/delta ${SCRATCHDIR}/delta -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind ${rw_dir}/mnt/workspace ${SCRATCHDIR}/workspace -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${BUILDERDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro none ${BUILDERDIR} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro unionfs ${BUILDERDIR} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind,ro ${rw_dir}/mnt/livecd ${SCRATCHDIR}/calculate -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ if [ "$ISRW" -ne 0 ]; -+ then -+ FLASHDIR=${UNION}/mnt/flash -+ mkdir -p ${FLASHDIR} -+ mount -o bind ${rw_dir}/mnt/cdrom ${FLASHDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ mkdir -p ${CDROMDIR} -+ mount -o bind,ro ${rw_dir}/mnt/cdrom ${CDROMDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ fi -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ LIVECDDIR=${UNION}/mnt/livecd -+ -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${rw_dir}:${ro_dir}=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${rw_dir}:${ro_dir}=ro unionfs ${UNION} -+ fi -+ -+ if [[ -n "$( echo ${LOOPEXT} | grep squash )" ]]; -+ then -+ mkdir -p ${UNION}/mnt/squash -+ mount -o bind ${NEW_ROOT}/mnt/squash ${UNION}/mnt/squash &>/dev/null -+ fi -+ -+ chmod 0755 ${UNION} -+ mount -o bind ${rw_dir}/mnt/cdrom ${CDROMDIR} &>/dev/null -+ mount -o bind ${rw_dir}/mnt/livecd ${LIVECDDIR} &>/dev/null -+ ret=$? -+ fi -+ -+ chmod 1777 ${UNION}/tmp - good_msg "Creating union mount" -- unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -- ret=$? -- if [ ${ret} -ne 0 ] -+# unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -+# ret=$? -+ if [ "${ret}" -ne 0 ] - then - bad_msg "Can't setup union mount!" - USE_UNIONFS_NORMAL=0 -@@ -1143,3 +1289,106 @@ setup_unionfs() { - USE_UNIONFS_NORMAL=0 - fi - } -+ -+load_videodrv() { -+ good_msg "Loading frame buffer video driver" -+ # find all available fb drivers -+ videodrv_count=$(find /lib/modules \ -+ -name "nouveau.ko" -o \ -+ -name "uvesafb.ko" -o \ -+ -name "i915.ko" -o \ -+ -name "radeon.ko" | -+ grep -c "") -+ # load specified videodrv -+ modules_list= -+ case "${VIDEODRV}" in -+ nouveau) -+ modules_list="nouveau" -+ ;; -+ radeon) -+ modules_list="radeon" -+ ;; -+ i915|intel) -+ modules_list="i915" -+ ;; -+ ""|auto) -+ # if not livecd and initramfs otimized (aviailable only one video driver) -+ if [ "${CDROOT}" != '1' -a "${videodrv_count}" -le 2 ] -+ then -+ modules_list="nouveau i915 radeon" -+ else -+ if [[ -x /usr/sbin/lspci ]] -+ then -+ if lspci | grep -m1 VGA | grep -qi intel -+ then -+ modules_list="i915" -+ elif lspci | grep -m1 VGA | grep -qi nvidia -+ then -+ modules_list="nouveau" -+ elif lspci | grep -m1 VGA | grep -q -e "Ati" -e "ATI" -+ then -+ modules_list="radeon" -+ else -+ modules_list="" -+ fi -+ else -+ modules_list="i915" -+ fi -+ fi -+ ;; -+ esac -+ for x in $modules_list -+ do -+ if [ "`find /lib/modules -name "${x}.ko" | grep -c ''`" -eq "1" ] -+ then -+ modprobe "${x}" modeset=${USE_MODESET} &>/dev/null -+ lsmod | grep -q "${x}" && return 0 -+ fi -+ done -+ # else load uvesafb with specified video resolution -+ if [ -n "${VIDEORES}" ] -+ then -+ if ! echo $VIDEORES | grep -q "\-" -+ then -+ VIDEORES="${VIDEORES}-32" -+ fi -+ else -+ VIDEORES="1024x768-32" -+ fi -+ modprobe uvesafb mode_option=${VIDEORES} &>/dev/null -+} -+ -+start_udev() -+{ -+ # start udev -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ echo "" >/proc/sys/kernel/hotplug -+ udevd --daemon &>/dev/null -+ udevadm settle -+ fi -+} -+ -+stop_udev() -+{ -+ # kill udevd -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ pkill udevd &>/dev/null -+ fi -+} -+ -+populate_dev() -+{ -+ good_msg 'Activating udev' -+ # Do not run any init-scripts -+ udevadm control --property=do_not_run_plug_service=1 -+ -+ # discarding net drivers placed into blacklist.conf -+ udevadm trigger --action="add" -+ -+ # we can speed up booting under these conditions: -+ # * using devtmpfs so kernel creates device nodes for us -+ # * only using kernel created device nodes at boot (in /etc/fstab and elsewhere) -+ udevadm settle --timeout=60 -+} -diff --git defaults/linuxrc defaults/linuxrc -index 0843f5d..8109d09 100755 ---- defaults/linuxrc -+++ defaults/linuxrc -@@ -39,6 +39,13 @@ FAKE_ROOT='' - REAL_ROOTFLAGS='' - ROOTFSTYPE='auto' - CRYPT_SILENT=0 -+VIDEODRV='' -+USE_UDEV=1 -+USE_MODESET=1 -+if [ -e "/etc/calculate/calculate.ini" ] -+then -+ source /etc/calculate/calculate.ini -+fi - for x in ${CMDLINE} - do - case "${x}" in -@@ -57,6 +64,57 @@ do - init_opts\=*) - INIT_OPTS=`parse_opt "${x}"` - ;; -+ nokms) -+ USE_MODESET=0 -+ ;; -+ kms) -+ USE_MODESET=1 -+ ;; -+ noudev) -+ USE_UDEV=0 -+ ;; -+ calculate\=*) -+ CALCULATE=`parse_opt "${x}"` -+ if [[ "${CALCULATE//:/}" != "${CALCULATE}" ]] -+ then -+ for i in ${CALCULATE//,/ } -+ do -+ case "${i}" in -+ video:*) -+ VIDEODRV=`echo "${i}" | cut -s -d: -f2-` -+ ;; -+ resolution:*) -+ RES=`echo "${i}" | cut -s -d: -f2-` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ ;; -+ esac -+ done -+ else -+ RES=`echo "${CALCULATE}" | cut -s -d, -f4` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ VIDEODRV=`echo "${CALCULATE}" | cut -s -d, -f5` -+ fi -+ ;; -+ video\=*) -+ VR=`parse_opt "${x}"` -+ for i in ${VR//,/ } -+ do -+ if [ -z "${i//[0-9-x@]}" ] -+ then -+ VIDEORES=${i} -+ fi -+ done -+ ;; -+ # Scratch usbload -+ scratch) -+ SCRATCH=1 -+ ;; - # Livecd options - cdroot) - CDROOT=1 -@@ -251,15 +309,24 @@ then - REAL_ROOT="${FAKE_ROOT}" - fi - --splash 'init' -- --cmdline_hwopts -+# check udevd -+[ ! -x /sbin/udevd ] && USE_UDEV=0 - - # Mount sysfs - mount_sysfs - -+# start udev -+start_udev -+ -+# load kernel video driver -+load_videodrv -+ -+splash 'init' -+ -+cmdline_hwopts -+ - # Setup hotplugging for firmware loading --setup_hotplug -+[ "${USE_UDEV}" == "0" ] && setup_hotplug - - # Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel - if [ -z "${DO_modules}" ] -@@ -269,7 +336,7 @@ elif [ -d "/lib/modules/${KV}" ] - then - good_msg 'Loading modules' - # Load appropriate kernel modules -- if [ "${NODETECT}" != '1' ] -+ if [ "${USE_UDEV}" != '1' -a "${NODETECT}" != '1' ] - then - for modules in ${MY_HWOPTS} - do -@@ -285,14 +352,20 @@ fi - # Apply scan delay if specified - sdelay - --# Setup slow USB bits --setup_slowusb -+if [ "${USE_UDEV}" == "1" ] -+then -+ # populate /dev with devices already found by the kernel -+ populate_dev -+else -+ # Setup slow USB bits -+ setup_slowusb - --# Start device manager --start_dev_mgr -+ # Start device manager -+ start_dev_mgr - --# if doslowusb is passed, pause other 10 seconds here, after mdev load --[ "${DO_slowusb}" ] && sleep 10 -+ # if doslowusb is passed, pause other 10 seconds here, after mdev load -+ [ "${DO_slowusb}" ] && sleep 10 -+fi - - # Start iSCSI - if [ -e /bin/iscsistart ] -@@ -509,9 +582,50 @@ do - then - break - else -- bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -- got_good_root=0 -- REAL_ROOT='' -+ # check for scratch -+ if [ -e ${NEW_ROOT}/livecd.squashfs -a -d ${NEW_ROOT}/delta -a -d ${NEW_ROOT}/workspace ]; -+ then -+ good_msg 'Found scratch data...' -+ load_union_module -+ modprobe squashfs >/dev/null -+ if mount -o remount,rw ${NEW_ROOT}; -+ then -+ mkdir -p ${NEW_ROOT}/calculate && mkdir -p /union && mkdir -p ${NEW_ROOT}/workspace/mnt/builder && mkdir -p ${NEW_ROOT}/workspace/mnt/scratch -+ if mount -o loop,ro -t squashfs ${NEW_ROOT}/livecd.squashfs ${NEW_ROOT}/calculate; -+ then -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/workspace=rw:${NEW_ROOT}/delta=ro+wh:${NEW_ROOT}/calculate=ro none /union; -+ then -+ mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/delta=rw:${NEW_ROOT}/calculate=ro none /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers!' -+ run_shell -+ fi -+ else -+ if mount -t unionfs -o ro,dirs=${NEW_ROOT}/workspace:${NEW_ROOT}/delta=ro:${NEW_ROOT}/calculate=ro unionfs /union; -+ then -+ mount -t unionfs -o ro,dirs=${NEW_ROOT}/delta:${NEW_ROOT}/calculate=ro unionfs /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers' -+ run_shell -+ fi -+ fi -+ else -+ bad_msg 'Could not mount scratch squashfs image' -+ fi -+ else -+ bad_msg 'Could not remount ${NEW_ROOT}' -+ fi -+ else -+ bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -+ got_good_root=0 -+ REAL_ROOT='' -+ fi - fi - else - bad_msg "Could not mount specified ROOT, try again" -@@ -723,9 +837,12 @@ cd "${CHROOT}" - mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null - echo -ne "${BOLD}.${NORMAL}" - -+# stop udev before move mount points -+stop_udev -+ - # If devtmpfs is mounted, try move it to the new root - # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise --for fs in /dev /sys /proc -+for fs in "/dev " /sys /proc - do - if grep -qs "$fs" /proc/mounts - then -diff --git defaults/modprobe defaults/modprobe -index ba2d890..9280357 100755 ---- defaults/modprobe -+++ defaults/modprobe -@@ -10,8 +10,6 @@ usage() { - echo - echo 'Example:' - echo ' modprobe eepro100' -- echo -- echo 'Note: Do not pass the suffix to modprobe!' - exit 1 - } - -@@ -81,14 +79,29 @@ modprobe2() { - usage - exit 1 - fi -- real_path=`real_mod_path ${1}` -+ local modname=${1} -+ local quiet='' -+ local params='' -+ shift -+ for x in $@ -+ do -+ case ${x} in -+ -n) -+ quiet=1 -+ ;; -+ *) -+ params="${params} ${x}" -+ ;; -+ esac -+ done -+ real_path=`real_mod_path ${modname}` - if [ "${real_path}" = '' -o "${real_path}" = ' ' ] - then -- [ "${2}" = '-n' ] && echo -n " -> $1" -+ [ "${quiet}" = '1' ] && echo -n " -> ${modname}" - echo ' module not found.' - exit 2 - fi -- modlist=`modules_dep_list ${1}` -+ modlist=`modules_dep_list ${modname}` - if [ "${modlist}" != '' -a "${modlist}" != ' ' ] - then - deps=`strip_mod_paths ${modlist}` -@@ -110,13 +123,13 @@ modprobe2() { - filler=1 - fi - done -- ${INSMOD} ${real_path} > /dev/null 2>&1 -+ ${INSMOD} ${real_path} ${params} > /dev/null 2>&1 - ret=$? - if [ ${ret} -eq 0 ] - then - echoAppend=' loaded.' -- [ "${2}" = '-n' ] && echoFlags='-n' && echoAppend=', ' -- echo ${echoFlags} "${1}${echoAppend}" -+ [ "${quiet}" = '1' ] && echoFlags='-n' && echoAppend=', ' -+ echo ${echoFlags} "${modname}${echoAppend}" - fi - return $ret - } -@@ -132,7 +145,7 @@ do - LOADED_MODULES="${LOADED_MODULES} ${x}" - done - --modprobe2 ${1} -+modprobe2 ${@} - modprobe_ret=$? - - [ -f '/modules.cache' ] && rm -f /modules.cache > /dev/null 2>&1 -diff --git dracut_funcs.sh dracut_funcs.sh -new file mode 100755 -index 0000000..e80a638 ---- /dev/null -+++ dracut_funcs.sh -@@ -0,0 +1,752 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+# -+# functions used by dracut and other tools. -+# -+# Copyright 2005-2009 Red Hat, Inc. All rights reserved. -+# -+# 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; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+# -+ -+IF_RTLD="" -+IF_dynamic="" -+ -+# Generic substring function. If $2 is in $1, return 0. -+strstr() { [[ $1 =~ $2 ]]; } -+ -+# Create all subdirectories for given path without creating the last element. -+# $1 = path -+mksubdirs() { mkdir -p ${1%/*}; } -+ -+# Version comparision function. Assumes Linux style version scheme. -+# $1 = version a -+# $2 = comparision op (gt, ge, eq, le, lt, ne) -+# $3 = version b -+vercmp() { -+ local n1=(${1//./ }) op=$2 n2=(${3//./ }) i res -+ -+ for ((i=0; ; i++)) -+ do -+ if [[ ! ${n1[i]}${n2[i]} ]]; then res=0 -+ elif ((${n1[i]:-0} > ${n2[i]:-0})); then res=1 -+ elif ((${n1[i]:-0} < ${n2[i]:-0})); then res=2 -+ else continue -+ fi -+ break -+ done -+ -+ case $op in -+ gt) ((res == 1));; -+ ge) ((res != 2));; -+ eq) ((res == 0));; -+ le) ((res != 1));; -+ lt) ((res == 2));; -+ ne) ((res != 0));; -+ esac -+} -+ -+is_func() { -+ [[ $(type -t $1) = "function" ]] -+} -+ -+# Log initrd creation. -+if ! [[ $dracutlogfile ]]; then -+ [[ $dracutbasedir = /usr/share/dracut ]] && \ -+ dracutlogfile=/var/log/dracut.log || \ -+ dracutlogfile=/tmp/dracut.log -+# [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log -+ if [[ -w $dracutlogfile ]]; then -+ >"$dracutlogfile" -+ fi -+fi -+ -+dwarning() { -+ echo "W: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "W: $@" >>"$dracutlogfile" -+} -+ -+dinfo() { -+ [[ $beverbose ]] && echo "I: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "I: $@" >>"$dracutlogfile" -+} -+ -+derror() { -+ echo "E: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile" -+} -+ -+# Function prints global variables in format name=value line by line. -+# $@ = list of global variables' name -+print_vars() { -+ local var value -+ -+ for var in $@ -+ do -+ value=$(eval echo \$$var) -+ [[ ${value} ]] && echo "${var}=\"${value}\"" -+ done -+} -+ -+get_fs_env() { -+ [[ $1 ]] || return -+ eval $(udevadm info --query=env --name=$1|egrep 'ID_FS_(TYPE|UUID)=') -+ [[ $ID_FS_TYPE ]] && return -+ -+ if [[ -x /lib/udev/vol_id ]]; then -+ eval $(/lib/udev/vol_id --export $1) -+ elif find_binary blkid >/dev/null; then -+ eval $(blkid -o udev $1) -+ else -+ return 1 -+ fi -+} -+ -+get_fs_type() ( -+ [[ $1 ]] || return -+ if [[ $1 != ${1#/dev/block/nfs:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs3:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs4:} ]]; then -+ echo "nfs" -+ return -+ fi -+ get_fs_env $1 || return -+ echo $ID_FS_TYPE -+) -+ -+get_fs_uuid() ( -+ get_fs_env $1 || return -+ echo $ID_FS_UUID -+) -+ -+# finds the major:minor of the block device backing the root filesystem. -+find_block_device() { -+ local x mpt majmin dev fs misc maj min -+ if [[ $use_fstab != yes ]]; then -+ while read x x majmin x mpt x x fs dev misc; do -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $fs = btrfs ]] && { -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ } -+ if [[ $mpt = $1 ]] && [[ ${majmin#0:} = $majmin ]]; then -+ echo $majmin; -+ return 0 # we have a winner! -+ fi -+ done < /proc/self/mountinfo -+ fi -+ # fall back to /etc/fstab -+ while read dev mpt fs misc; do -+ if [[ $mpt = $1 ]]; then -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $dev != ${dev#UUID=} ]] && dev=/dev/disk/by-uuid/${dev#UUID=} -+ [[ $dev != ${dev#LABEL=} ]] && dev=/dev/disk/by-label/${dev#LABEL=} -+ [[ -b $dev ]] || return 1 # oops, not a block device. -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ fi -+ done < /etc/fstab -+ return 1; -+} -+ -+find_root_block_device() { find_block_device /; } -+ -+# Walk all the slave relationships for a given block device. -+# Stop when our helper function returns success -+# $1 = function to call on every found block device -+# $2 = block device in major:minor format -+check_block_and_slaves() { -+ local x -+ [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. -+ "$1" $2 && return -+ check_vol_slaves "$@" && return 0 -+ if [[ -f /sys/dev/block/$2/../dev ]]; then -+ check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0 -+ fi -+ [[ -d /sys/dev/block/$2/slaves ]] || return 1 -+ for x in /sys/dev/block/$2/slaves/*/dev; do -+ [[ -f $x ]] || continue -+ check_block_and_slaves $1 $(cat "$x") && return 0 -+ done -+ return 1 -+} -+ -+get_numeric_dev() { -+ ls -lH "$1" | { read a b c d maj min rest; printf "%d:%d" ${maj%%,} $min;} -+} -+ -+# ugly workaround for the lvm design -+# There is no volume group device, -+# so, there are no slave devices for volume groups. -+# Logical volumes only have the slave devices they really live on, -+# but you cannot create the logical volume without the volume group. -+# And the volume group might be bigger than the devices the LV needs. -+check_vol_slaves() { -+ for i in /dev/mapper/*; do -+ lv=$(get_numeric_dev $i) -+ if [[ $lv = $2 ]]; then -+ vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null) -+ # strip space -+ vg=$(echo $vg) -+ if [[ $vg ]]; then -+ for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \ -+ do -+ check_block_and_slaves $1 $(get_numeric_dev $pv) \ -+ && return 0 -+ done -+ fi -+ fi -+ done -+ return 1 -+} -+ -+# Install a directory, keeping symlinks as on the original system. -+# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file" -+# will create ${initdir}/lib64, ${initdir}/lib64/file, -+# and a symlink ${initdir}/lib -> lib64. -+inst_dir() { -+ local dir="$1" -+ [[ -e ${initdir}$dir ]] && return 0 -+ -+ # iterate over parent directories -+ local file="" -+ local IFS="/" -+ for part in $dir; do -+ [[ $part ]] || continue -+ file="$file/$part" -+ [[ -e ${initdir}$file ]] && continue -+ -+ if [[ -L $file ]]; then -+ # create link as the original -+ local target=$(readlink "$file") -+ ln -sfn "$target" "${initdir}$file" || return 1 -+ # resolve relative path and recursively install destionation -+ [[ $target = ${target##*/} ]] && target="${file%/*}/$target" -+ inst_dir "$target" -+ else -+ # create directory -+ mkdir -p "${initdir}$file" || return 1 -+ fi -+ done -+} -+ -+# $1 = file to copy to ramdisk -+# $2 (optional) Name for the file on the ramdisk -+# Location of the image dir is assumed to be $initdir -+# We never overwrite the target if it exists. -+inst_simple() { -+ local src target -+ [[ -f $1 ]] || return 1 -+ src=$1 target="${2:-$1}" -+ if ! [[ -d ${initdir}$target ]]; then -+ [[ -e ${initdir}$target ]] && return 0 -+ inst_dir "${target%/*}" -+ fi -+ dinfo "Installing $src" -+ cp -pfL "$src" "${initdir}$target" -+} -+ -+# find symlinks linked to given library file -+# $1 = library file -+# Function searches for symlinks by stripping version numbers appended to -+# library filename, checks if it points to the same target and finally -+# prints the list of symlinks to stdout. -+# -+# Example: -+# rev_lib_symlinks libfoo.so.8.1 -+# output: libfoo.so.8 libfoo.so -+# (Only if libfoo.so.8 and libfoo.so exists on host system.) -+rev_lib_symlinks() { -+ [[ ! $1 ]] && return 0 -+ -+ local fn="$1" orig="$(readlink -f "$1")" links='' -+ -+ [[ ${fn} =~ .*\.so\..* ]] || return 1 -+ -+ until [[ ${fn##*.} == so ]]; do -+ fn="${fn%.*}" -+ [[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}" -+ done -+ -+ echo ${links} -+} -+ -+# Same as above, but specialized to handle dynamic libraries. -+# It handles making symlinks according to how the original library -+# is referenced. -+inst_library() { -+ local src=$1 dest=${2:-$1} lib reallib symlink -+ [[ -e $initdir$dest ]] && return 0 -+ if [[ -L $src ]]; then -+ reallib=$(readlink -f "$src") -+ lib=${src##*/} -+ inst_simple "$reallib" "$reallib" -+ inst_dir "${dest%/*}" -+ (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib") -+ else -+ inst_simple "$src" "$dest" -+ fi -+ -+ # Create additional symlinks. See rev_symlinks description. -+ for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do -+ [[ ! -e $initdir$symlink ]] && { -+ dinfo "Creating extra symlink: $symlink" -+ inst_symlink $symlink -+ } -+ done -+} -+ -+# find a binary. If we were not passed the full path directly, -+# search in the usual places to find the binary. -+find_binary() { -+ local binpath="/bin /sbin /usr/bin /usr/sbin" p -+ [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } -+ for p in $binpath; do -+ [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# Same as above, but specialized to install binary executables. -+# Install binary executable, and all shared library dependencies, if any. -+inst_binary() { -+ local bin target -+ bin=$(find_binary "$1") || return 1 -+ target=${2:-$bin} -+ inst_symlink $bin $target && return 0 -+ local LDSO NAME IO FILE ADDR I1 n f TLIBDIR -+ [[ -e $initdir$target ]] && return 0 -+ # I love bash! -+ LC_ALL=C ldd $bin 2>/dev/null | while read line; do -+ [[ $line = 'not a dynamic executable' ]] && return 1 -+ if [[ $line =~ not\ found ]]; then -+ derror "Missing a shared library required by $bin." -+ derror "Run \"ldd $bin\" to find out what it is." -+ derror "dracut cannot create an initrd." -+ exit 1 -+ fi -+ so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)' -+ [[ $line =~ $so_regex ]] || continue -+ FILE=${BASH_REMATCH[1]} -+ [[ -e ${initdir}$FILE ]] && continue -+ # see if we are loading an optimized version of a shared lib. -+ lib_regex='^(/lib[^/]*).*' -+ if [[ $FILE =~ $lib_regex ]]; then -+ TLIBDIR=${BASH_REMATCH[1]} -+ BASE=${FILE##*/} -+ # prefer nosegneg libs, then unoptimized ones. -+ for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do -+ [[ -e $f/$BASE ]] || continue -+ FILE=$f/$BASE -+ break -+ done -+ inst_library "$FILE" "$TLIBDIR/$BASE" -+ IF_dynamic=yes -+ continue -+ fi -+ inst_library "$FILE" -+ done -+ inst_simple "$bin" "$target" -+} -+ -+# same as above, except for shell scripts. -+# If your shell script does not start with shebang, it is not a shell script. -+inst_script() { -+ [[ -f $1 ]] || return 1 -+ local line -+ read -r -n 80 line <"$1" -+ # If debug is set, clean unprintable chars to prevent messing up the term -+ [[ $debug ]] && line=$(echo -n "$line" | tr -c -d '[:print:][:space:]') -+ shebang_regex='(#! *)(/[^ ]+).*' -+ [[ $line =~ $shebang_regex ]] || return 1 -+ inst "${BASH_REMATCH[2]}" && inst_simple "$@" -+} -+ -+# same as above, but specialized for symlinks -+inst_symlink() { -+ local src=$1 target=$initdir${2:-$1} realsrc -+ [[ -L $1 ]] || return 1 -+ [[ -L $target ]] && return 0 -+ realsrc=$(readlink -f "$src") -+ [[ $realsrc = ${realsrc##*/} ]] && realsrc=${src%/*}/$realsrc -+ inst "$realsrc" && mkdir -p "${target%/*}" && \ -+ ln -s "$realsrc" "$target" -+} -+ -+# find a udev rule in the usual places. -+find_rule() { -+ [[ -f $1 ]] && { echo "$1"; return 0; } -+ for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do -+ [[ -f $r/$1 ]] && { echo "$r/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# udev rules always get installed in the same place, so -+# create a function to install them to make life simpler. -+inst_rules() { -+ local target=/etc/udev/rules.d rule found -+ -+ inst_dir "/lib/udev/rules.d" -+ inst_dir "$target" -+ for rule in "$@"; do -+ found=$(find_rule "$rule") && \ -+ inst_simple "$found" "$target/${found##*/}" \ -+ || dinfo "Skipping udev rule: $rule" -+ done -+} -+ -+# general purpose installation function -+# Same args as above. -+inst() { -+ case $# in -+ 1) ;; -+ 2) [[ ! $initdir && -d $2 ]] && export initdir=$2 -+ [[ $initdir = $2 ]] && set $1;; -+ 3) [[ -z $initdir ]] && export initdir=$2 -+ set $1 $3;; -+ *) derror "inst only takes 1 or 2 or 3 arguments" -+ exit 1;; -+ esac -+ for x in inst_symlink inst_script inst_binary inst_simple; do -+ $x "$@" && return 0 -+ done -+ return 1 -+} -+ -+# install function specialized for hooks -+# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook -+# All hooks should be POSIX/SuS compliant, they will be sourced by init. -+inst_hook() { -+ if ! [[ -f $3 ]]; then -+ derror "Cannot install a hook ($3) that does not exist." -+ derror "Aborting initrd creation." -+ exit 1 -+ elif ! strstr "$hookdirs" "$1"; then -+ derror "No such hook type $1. Aborting initrd creation." -+ exit 1 -+ fi -+ inst_simple "$3" "/${1}/${2}${3##*/}" -+} -+ -+dracut_install() { -+ if [[ $1 = '-o' ]]; then -+ local optional=yes -+ shift -+ fi -+ while (($# > 0)); do -+ if ! inst "$1" ; then -+ if [[ $optional = yes ]]; then -+ dwarning "Skipping program $1 as it cannot be found and is flagged to be optional" -+ else -+ derror "Failed to install $1" -+ exit 1 -+ fi -+ fi -+ shift -+ done -+} -+ -+# install function decompressing the target and handling symlinks -+# $@ = list of compressed (gz or bz2) files or symlinks pointing to such files -+# -+# Function install targets in the same paths inside overlay but decompressed -+# and without extensions (.gz, .bz2). -+inst_decompress() { -+ local src dst realsrc realdst cmd -+ -+ for src in $@ -+ do -+ case ${src} in -+ *.gz) cmd='gzip -d' ;; -+ *.bz2) cmd='bzip2 -d' ;; -+ *) return 1 ;; -+ esac -+ -+ if [[ -L ${src} ]] -+ then -+ realsrc="$(readlink -f ${src})" # symlink target with extension -+ dst="${src%.*}" # symlink without extension -+ realdst="${realsrc%.*}" # symlink target without extension -+ mksubdirs "${initdir}/${src}" -+ # Create symlink without extension to target without extension. -+ ln -s "${realdst}" "${initdir}/${dst}" -+ fi -+ -+ # If the source is symlink we operate on its target. -+ [[ ${realsrc} ]] && src=${realsrc} -+ inst ${src} -+ # Decompress with chosen tool. We assume that tool changes name e.g. -+ # from 'name.gz' to 'name'. -+ ${cmd} "${initdir}${src}" -+ done -+} -+ -+# It's similar to above, but if file is not compressed, performs standard -+# install. -+# $@ = list of files -+inst_opt_decompress() { -+ local src -+ -+ for src in $@ -+ do -+ inst_decompress "${src}" || inst "${src}" -+ done -+} -+ -+module_check() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we are unconditionally included -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check $hostonly -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func check || return 0 -+ check -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_depends() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we have no deps -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check -d -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func depends || return 0 -+ depends -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_install() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/install ]] && . "$moddir/install" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func install || return 0 -+ install -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_installkernel() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/installkernel ]] && . "$moddir/installkernel" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func installkernel || return 0 -+ installkernel -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+check_module() { -+ local mod=$1; -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ local moddep; -+ # If we are already scheduled to be loaded, no need to check again. -+ strstr " $mods_to_load " " $mod " && return 0 -+ strstr " $mods_checked_as_dep " " $mod " && return 1 -+ -+ # This should never happen, but... -+ [[ -d $moddir ]] || return 1 -+ -+ [[ $2 ]] || mods_checked_as_dep+=" $mod " -+ -+ strstr " $omit_dracutmodules " " $mod " && return 1 -+ -+ if strstr " $dracutmodules $add_dracutmodules " " $mod "; then -+ module_check $mod; ret=$? -+ # explicit module, so also accept ret=255 -+ [[ $ret = 0 || $ret = 255 ]] || return 1 -+ else -+ # module not in our list -+ if [[ $dracutmodules = all ]]; then -+ # check, if we can and should install this module -+ module_check $mod || return 1 -+ else -+ # skip this module -+ return 1 -+ fi -+ fi -+ -+ for moddep in $(module_depends $mod); do -+ # handle deps as if they were manually added -+ strstr " $add_dracutmodules " " $moddep " || \ -+ add_dracutmodules+=" $moddep " -+ # if a module we depend on fail, fail also -+ check_module $moddep || return 1 -+ done -+ -+ strstr " $mods_to_load " " $mod " || \ -+ mods_to_load+=" $mod " -+ -+ return 0 -+} -+ -+check_module_dir() { -+ local modcheck; -+ local mod; -+ mods_to_load="" -+ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do -+ local mod=${moddir##*/}; mod=${mod#[0-9][0-9]} -+ check_module $mod 1 -+ done -+} -+ -+# Install a single kernel module along with any firmware it may require. -+# $1 = full path to kernel module to install -+install_kmod_with_fw() { -+ local modname=${1##*/} fwdir found -+ modname=${modname%.ko*} -+ inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \ -+ return 0 # no need to go further if the module is already installed -+ for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do -+ found='' -+ for fwdir in $fw_dir; do -+ if [[ -d $fwdir && -f $fwdir/$fw ]]; then -+ inst_simple "$fwdir/$fw" "/lib/firmware/$fw" -+ found=yes -+ fi -+ done -+ if [[ $found != yes ]]; then -+ dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\"" -+ fi -+ done -+} -+ -+# Do something with all the dependencies of a kernel module. -+# Note that kernel modules depend on themselves using the technique we use -+# $1 = function to call for each dependency we find -+# It will be passed the full path to the found kernel module -+# $2 = module to get dependencies for -+# rest of args = arguments to modprobe -+for_each_kmod_dep() { -+ local func=$1 kmod=$2 cmd modpapth options -+ shift 2 -+ modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \ -+ while read cmd modpath options; do -+ [[ $cmd = insmod ]] || continue -+ $func $modpath -+ done -+} -+ -+# filter kernel modules to install certain modules that meet specific -+# requirements. -+# $1 = function to call with module name to filter. -+# This function will be passed the full path to the module to test. -+# The behaviour of this function can vary depending on whether $hostonly is set. -+# If it is, we will only look at modules that are already in memory. -+# If it is not, we will look at all kernel modules -+# This function returns the full filenames of modules that match $1 -+filter_kernel_modules () ( -+ if ! [[ $hostonly ]]; then -+ filtercmd='find "$srcmods/kernel/drivers" "$srcmods/extra" "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz" 2>/dev/null' -+ else -+ filtercmd='cut -d " " -f 1 /dev/null' -+ fi -+ for modname in $(eval $filtercmd); do -+ case $modname in -+ *.ko) "$1" "$modname" && echo "$modname";; -+ *.ko.gz) gzip -dc "$modname" > $initdir/$$.ko -+ $1 $initdir/$$.ko && echo "$modname" -+ rm -f $initdir/$$.ko;; -+ esac -+ done -+) -+ -+# install kernel modules along with all their dependencies. -+instmods() { -+ [[ $no_kernel = yes ]] && return -+ local mod mpargs modpath modname cmd moddirname -+ while (($# > 0)); do -+ mod=${1%.ko*} -+ case $mod in -+ =*) -+ # This introduces 2 incompatible meanings for =* arguments -+ # to instmods. We need to decide which one to keep. -+ if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then -+ instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block") -+ elif [ -f $srcmods/modules.${mod#=} ]; then -+ instmods $mpargs $(cat ${srcmods}/modules.${mod#=} ) -+ else -+ instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*") -+ fi -+ ;; -+ --*) -+ mod=${mod##*/} -+ mpargs+=" $mod";; -+ i2o_scsi) shift; continue;; # Do not load this diagnostic-only module -+ *) mod=${mod##*/} -+ # if we are already installed, skip this module and go on -+ # to the next one. -+ [[ -f $initdir/$1 ]] && { shift; continue; } -+ # If we are building a host-specific initramfs and this -+ # module is not already loaded, move on to the next one. -+ [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \ -+ ! echo $add_drivers | grep -qe "\<${mod}\>" && { -+ shift; continue; -+ } -+ -+ # We use '-d' option in modprobe only if modules prefix path -+ # differs from default '/'. This allows us to use Dracut with -+ # old version of modprobe which doesn't have '-d' option. -+ moddirname=${srcmods%%/lib/modules/*} -+ [[ -n ${moddirname} ]] && moddirname="-d ${moddirname}/" -+ -+ # ok, load the module, all its dependencies, and any firmware -+ # it may require -+ for_each_kmod_dep install_kmod_with_fw $mod \ -+ --set-version $kernel ${moddirname} -+ ;; -+ esac -+ shift -+ done -+} -diff --git gen_cmdline.sh gen_cmdline.sh -index b3e451d..bc9f2dc 100755 ---- gen_cmdline.sh -+++ gen_cmdline.sh -@@ -22,6 +22,7 @@ longusage() { - echo " --logfile= Output file for debug info" - echo " --color Output debug in color" - echo " --no-color Do not output debug in color" -+ echo " --no-cleartmp Do not clear temp directory" - echo " Kernel Configuration settings" - echo " --menuconfig Run menuconfig after oldconfig" - echo " --no-menuconfig Do not run menuconfig after oldconfig" -@@ -78,6 +79,8 @@ longusage() { - echo " --splash-res= Select splash theme resolutions to install" - echo " --do-keymap-auto Forces keymap selection at boot" - echo " --no-keymap Disables keymap selection support" -+ echo " --udev Include udev in the initramfs" -+ echo " --no-udev Exclude udev from the initramfs" - echo " --lvm Include LVM support" - echo " --mdadm Include MDADM/MDMON support" - echo " --mdadm-config= Use file as mdadm.conf in initramfs" -@@ -97,6 +100,8 @@ longusage() { - echo " --unionfs Include support for unionfs" - echo " --netboot Create a self-contained env in the initramfs" - echo " --real-root= Specify a default for real_root=" -+ echo " --lscpi Include lspci into the initramfs" -+ echo " --no-lscpi Exclude lspci from the initramfs" - echo " Internals" - echo " --arch-override= Force to arch instead of autodetect" - echo " --cachedir= Override the default cache location" -@@ -232,6 +237,22 @@ parse_cmdline() { - CMD_KEYMAP=0 - print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" - ;; -+ --udev) -+ CMD_UDEV=1 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --no-udev) -+ CMD_UDEV=0 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --lspci) -+ CMD_LSPCI=1 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --no-lspci) -+ CMD_UDEV=0 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; - --lvm) - CMD_LVM=1 - print_info 2 "CMD_LVM: ${CMD_LVM}" -@@ -441,6 +462,10 @@ parse_cmdline() { - print_info 2 "USECOLOR: ${USECOLOR}" - setColorVars - ;; -+ --no-cleartmp) -+ NOCLEARTMP=1 -+ print_info 2 "NOCLEARTMP: ${NOCLEARTMP}" -+ ;; - --logfile=*) - CMD_LOGFILE=`parse_opt "$*"` - LOGFILE=`parse_opt "$*"` -diff --git gen_compile.sh gen_compile.sh -index 0758c3a..8a2339a 100755 ---- gen_compile.sh -+++ gen_compile.sh -@@ -407,7 +407,10 @@ compile_busybox() { - yes '' 2>/dev/null | compile_generic oldconfig utils - - print_info 1 'busybox: >> Compiling...' -+ OLDLOGLEVEL=$LOGLEVEL -+ LOGLEVEL=1 - compile_generic all utils -+ LOGLEVEL=$OLDLOGLEVEL - print_info 1 'busybox: >> Copying to cache...' - [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] || - gen_die 'Busybox executable does not exist!' -diff --git gen_determineargs.sh gen_determineargs.sh -index ce479cb..bda14b8 100755 ---- gen_determineargs.sh -+++ gen_determineargs.sh -@@ -107,6 +107,8 @@ determine_real_args() { - set_config_with_override BOOL SYMLINK CMD_SYMLINK - set_config_with_override STRING INSTALL_MOD_PATH CMD_INSTALL_MOD_PATH - set_config_with_override BOOL OLDCONFIG CMD_OLDCONFIG -+ set_config_with_override BOOL UDEV CMD_UDEV -+ set_config_with_override BOOL LSPCI CMD_LSPCI - set_config_with_override BOOL LVM CMD_LVM - set_config_with_override BOOL DMRAID CMD_DMRAID - set_config_with_override BOOL ISCSI CMD_ISCSI -diff --git gen_initramfs.sh gen_initramfs.sh -index 7fe4421..76b6645 100755 ---- gen_initramfs.sh -+++ gen_initramfs.sh -@@ -56,7 +56,13 @@ append_busybox() { - chmod +x "${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/default.script" - - # Set up a few default symlinks -- for i in ${BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}; do -+ if isTrue "${UDEV}" -+ then -+ BUSYBOX_APPLETS="${BUSYBOX_APPLETS:-[ ash sh uname echo cut cat}" -+ else -+ BUSYBOX_APPLETS="{$BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}" -+ fi -+ for i in ${BUSYBOX_APPLETS}; do - rm -f ${TEMP}/initramfs-busybox-temp/bin/$i > /dev/null - ln -s busybox ${TEMP}/initramfs-busybox-temp/bin/$i || - gen_die "Busybox error: could not link ${i}!" -@@ -410,7 +416,7 @@ append_firmware() { - IFS="," - for i in ${FIRMWARE_FILES} - do -- cp -L "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ -+ cp -rL "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ - done - IFS=$OLD_IFS - else -@@ -438,9 +444,71 @@ append_gpg() { - chmod a+x "${TEMP}/initramfs-gpg-temp/sbin/gpg" - cd "${TEMP}/initramfs-gpg-temp/" - find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" - rm -rf "${TEMP}/initramfs-gpg-temp" > /dev/null - } - -+append_udev() { -+ if [ -d "${TEMP}/initramfs-udev-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-udev-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-udev-temp/" -+ udevmod="${GK_SHARE}/modules/udev-rules/" -+ source ${udevmod}/module-setup.sh -+ initdir=${TEMP}/initramfs-udev-temp \ -+ moddir=${udevmod} \ -+ libdir=/lib/ \ -+ usrlibdir=/usr/lib/ \ -+ install_module -+ -+ if isTrue $LSPCI -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ fi -+ # find net modules and sound -+ (for pathname in ${INSTALL_MOD_PATH}/lib/modules/${KV}/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/drivers/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/sound -+ do -+ [[ -d $pathname ]] && find $pathname -name "*.ko" -+ done | -+ while read module;do -+ # add them prefix blacklist -+ echo "blacklist `basename $module .ko`"; -+ # concat with ready blacklist.conf -+ done;cat "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf") | -+ # sort and rewrite blacklist.conf -+ sort | uniq > "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" -+ mv "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" \ -+ "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf" -+ -+ cd "${TEMP}/initramfs-udev-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-udev-temp" > /dev/null -+} -+ -+append_lspci() { -+ if [ -d "${TEMP}/initramfs-lspci-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-lspci-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-lspci-temp/" -+ -+ initdir=${TEMP}/initramfs-lspci-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ -+ cd "${TEMP}/initramfs-lspci-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-lspci-temp" > /dev/null -+} -+ - print_list() - { - local x -@@ -489,6 +557,11 @@ append_modules() { - print_list ${!group_modules} > "${TEMP}/initramfs-modules-${KV}-temp/etc/modules/${group}" - done - cd "${TEMP}/initramfs-modules-${KV}-temp/" -+ # remove sound and media -+ for x in `find . -type d -name media -o -type d -name sound` -+ do -+ rm -r "${x}" &>/dev/null -+ done - find . | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ - || gen_die "compressing modules cpio" - cd "${TEMP}" -@@ -561,11 +634,14 @@ append_auxilary() { - done - echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" - -- if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ if ! isTrue "${UDEV}" - then -- cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -- else -- cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ then -+ cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ else -+ cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ fi - fi - if isTrue $CMD_DOKEYMAPAUTO - then -@@ -582,7 +658,7 @@ append_auxilary() { - chmod +x "${TEMP}/initramfs-aux-temp/init" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" -- chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ isTrue "${UDEV}" || chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" - - if isTrue ${NETBOOT} - then -@@ -609,6 +685,21 @@ append_data() { - fi - } - -+pack_cpio() { -+ print_info 1 " >> Pack cpio data..." -+ if [ -d "${TEMP}/initramfs-repack-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-repack-temp" -+ fi -+ mkdir -p "${TEMP}/initramfs-repack-temp" -+ cd "${TEMP}/initramfs-repack-temp" -+ # unpack and pack cpio remove double files -+ cpio -di <${CPIO} 2>/dev/null -+ find . -print | cpio ${CPIO_ARGS} | gzip -9 >"${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-repack-temp" > /dev/null -+} -+ - create_initramfs() { - print_info 1 "initramfs: >> Initializing..." - -@@ -619,6 +710,11 @@ create_initramfs() { - - append_data 'base_layout' - append_data 'auxilary' "${BUSYBOX}" -+ append_data 'udev' "${UDEV}" -+ if ! isTrue "${UDEV}" -+ then -+ append_data 'lspci' "${LSPCI}" -+ fi - append_data 'busybox' "${BUSYBOX}" - append_data 'lvm' "${LVM}" - append_data 'dmraid' "${DMRAID}" -@@ -652,8 +748,7 @@ create_initramfs() { - append_data 'overlay' - fi - -- gzip -9 "${CPIO}" -- mv -f "${CPIO}.gz" "${CPIO}" -+ pack_cpio - - if isTrue "${INTEGRATED_INITRAMFS}" - then -diff --git genkernel genkernel -index 0a06cdd..1486c61 100755 ---- genkernel -+++ genkernel -@@ -9,6 +9,7 @@ GK_V='3.4.18' - TMPDIR='/var/tmp/genkernel' - - TODEBUGCACHE=1 # Until an error occurs or LOGFILE is fully qualified. -+NOCLEARTMP=0 - - small_die() { - echo $1 -@@ -45,6 +46,7 @@ source ${GK_SHARE}/gen_initramfs.sh || gen_die "Could not read ${GK_SHARE}/gen_i - source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_moddeps.sh" - source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh" - source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh" -+source ${GK_SHARE}/dracut_funcs.sh || gen_die "Could not read ${GK_SHARE}/dracut_funcs.sh" - - TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ - -@@ -55,21 +57,25 @@ trap_cleanup(){ - } - - cleanup(){ -- if [ -n "$TEMP" -a -d "$TEMP" ]; then -- rm -rf "$TEMP" -- fi -- -- if isTrue ${POSTCLEAR} -- then -- echo -- print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -- print_info 1 "CACHE_DIR: ${CACHE_DIR}" -- CLEAR_CACHE_DIR='yes' -- setup_cache_dir -- echo -- print_info 1 "TMPDIR: ${TMPDIR}" -- clear_tmpdir -- fi -+ if [[ ${NOCLEARTMP} -ne 0 ]] -+ then -+ return -+ fi -+ if [ -n "$TEMP" -a -d "$TEMP" ]; then -+ rm -rf "$TEMP" &>/dev/null -+ fi -+ -+ if isTrue ${POSTCLEAR} -+ then -+ echo -+ print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -+ print_info 1 "CACHE_DIR: ${CACHE_DIR}" -+ CLEAR_CACHE_DIR='yes' -+ setup_cache_dir -+ echo -+ print_info 1 "TMPDIR: ${TMPDIR}" -+ clear_tmpdir -+ fi - } - - trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL -diff --git genkernel.conf genkernel.conf -index 24fcd54..41f8e06 100644 ---- genkernel.conf -+++ genkernel.conf -@@ -52,6 +52,12 @@ USECOLOR="yes" - # argument is: *+1 - # MAKEOPTS="-j2" - -+# Add udev to initramfs -+UDEV="yes" -+ -+# Add lspci to initramfs -+LSPCI="yes" -+ - # Add in LVM support from static binaries if they exist on the system, or - # compile static LVM binaries if static ones do not exist. - # LVM="no" -@@ -92,7 +98,7 @@ USECOLOR="yes" - # Specify directory to pull from - # FIRMWARE_DIR="/lib/firmware" - # Specify specific firmware files to include. This overrides FIRMWARE_DIR --# FIRMWARE_FILES="" -+FIRMWARE_FILES="/lib/firmware/radeon" - - # Enable disklabel support (copies blkid to initrd) - DISKLABEL="yes" -diff --git modules/udev-rules/01-ignore.rules modules/udev-rules/01-ignore.rules -new file mode 100644 -index 0000000..b32f22e ---- /dev/null -+++ modules/udev-rules/01-ignore.rules -@@ -0,0 +1 @@ -+KERNEL=="ram[0-9]*", OPTIONS+="ignore_device", OPTIONS+="last_rule" -diff --git modules/udev-rules/59-persistent-storage-volid.rules modules/udev-rules/59-persistent-storage-volid.rules -new file mode 100644 -index 0000000..0b798e6 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage-volid.rules -@@ -0,0 +1,7 @@ -+SUBSYSTEM!="block", GOTO="psv_end" -+ACTION!="add|change", GOTO="psv_end" -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="cciss[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", IMPORT{program}="vol_id --export $tempnode" -+LABEL="psv_end" -diff --git modules/udev-rules/59-persistent-storage.rules modules/udev-rules/59-persistent-storage.rules -new file mode 100644 -index 0000000..2b83e72 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage.rules -@@ -0,0 +1,38 @@ -+SUBSYSTEM!="block", GOTO="ps_end" -+ACTION!="add|change", GOTO="ps_end" -+ -+KERNEL=="cciss[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end" -+ -+# partitions have no md/{array_state,metadata_version} -+ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" -+ -+# container devices have a metadata version of e.g. 'external:ddf' and -+# never leave state 'inactive' -+ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -+TEST!="md/array_state", GOTO="md_end" -+ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -+ -+LABEL="md_ignore_state" -+ -+IMPORT{program}="/sbin/mdadm --detail --export $tempnode" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+OPTIONS+="link_priority=100" -+OPTIONS+="watch" -+LABEL="md_end" -+ -+ -+KERNEL!="dm-[0-9]*", GOTO="ps_end" -+ACTION=="add", GOTO="ps_end" -+IMPORT{program}="/sbin/dmsetup info -c --nameprefixes --unquoted --rows --noheadings -o name,uuid,suspended,readonly,major,minor,open,tables_loaded,names_using_dev -j%M -m%m" -+ENV{DM_NAME}!="?*", GOTO="ps_end" -+ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="ps_end" -+ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="ps_end" -+ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="ps_end" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+LABEL="ps_end" -diff --git modules/udev-rules/61-persistent-storage.rules modules/udev-rules/61-persistent-storage.rules -new file mode 100644 -index 0000000..9cfdb0b ---- /dev/null -+++ modules/udev-rules/61-persistent-storage.rules -@@ -0,0 +1,20 @@ -+SUBSYSTEM!="block", GOTO="pss_end" -+ACTION!="add|change", GOTO="pss_end" -+ -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss" -+KERNEL=="cciss[0-9]*", GOTO="do_pss" -+KERNEL=="nbd[0-9]*", GOTO="do_pss" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", GOTO="do_pss" -+ -+GOTO="pss_end" -+ -+LABEL="do_pss" -+# by-path (parent device path) -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{program}="path_id %p" -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" -+ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" -+ -+# by-label/by-uuid links (filesystem metadata) -+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -+LABEL="pss_end" -diff --git modules/udev-rules/blacklist.conf modules/udev-rules/blacklist.conf -new file mode 100644 -index 0000000..21ac71c ---- /dev/null -+++ modules/udev-rules/blacklist.conf -@@ -0,0 +1,162 @@ -+blacklist ath_pci -+blacklist evbug -+blacklist usbmouse -+blacklist usbkbd -+blacklist eepro100 -+blacklist de4x5 -+blacklist eth1394 -+blacklist snd_intel8x0m -+blacklist snd_aw2 -+blacklist i2c_i801 -+blacklist prism54 -+blacklist bcm43xx -+blacklist garmin_gps -+blacklist asus_acpi -+blacklist snd_pcsp -+blacklist pcspkr -+blacklist amd76x_edac -+blacklist ohci1394 -+blacklist sbp2 -+blacklist dv1394 -+blacklist raw1394 -+blacklist video1394 -+blacklist aty128fb -+blacklist atyfb -+blacklist radeonfb -+blacklist cirrusfb -+blacklist cyber2000fb -+blacklist cyblafb -+blacklist gx1fb -+blacklist hgafb -+blacklist i810fb -+blacklist intelfb -+blacklist kyrofb -+blacklist lxfb -+blacklist matroxfb_base -+blacklist neofb -+blacklist nvidiafb -+blacklist pm2fb -+blacklist rivafb -+blacklist s1d13xxxfb -+blacklist savagefb -+blacklist sisfb -+blacklist sstfb -+blacklist tdfxfb -+blacklist tridentfb -+blacklist vesafb -+blacklist vfb -+blacklist viafb -+blacklist vt8623fb -+blacklist ac97 -+blacklist ac97_codec -+blacklist ac97_plugin_ad1980 -+blacklist ad1848 -+blacklist ad1889 -+blacklist adlib_card -+blacklist aedsp16 -+blacklist ali5455 -+blacklist btaudio -+blacklist cmpci -+blacklist cs4232 -+blacklist cs4281 -+blacklist cs461x -+blacklist cs46xx -+blacklist emu10k1 -+blacklist es1370 -+blacklist es1371 -+blacklist esssolo1 -+blacklist forte -+blacklist gus -+blacklist i810_audio -+blacklist kahlua -+blacklist mad16 -+blacklist maestro -+blacklist maestro3 -+blacklist maui -+blacklist mpu401 -+blacklist nm256_audio -+blacklist opl3 -+blacklist opl3sa -+blacklist opl3sa2 -+blacklist pas2 -+blacklist pss -+blacklist rme96xx -+blacklist sb -+blacklist sb_lib -+blacklist sgalaxy -+blacklist sonicvibes -+blacklist sound -+blacklist sscape -+blacklist trident -+blacklist trix -+blacklist uart401 -+blacklist uart6850 -+blacklist via82cxxx_audio -+blacklist v_midi -+blacklist wavefront -+blacklist ymfpci -+blacklist ac97_plugin_wm97xx -+blacklist ad1816 -+blacklist audio -+blacklist awe_wave -+blacklist dmasound_core -+blacklist dmasound_pmac -+blacklist harmony -+blacklist sequencer -+blacklist soundcard -+blacklist usb-midi -+blacklist acquirewdt -+blacklist advantechwdt -+blacklist alim1535_wdt -+blacklist alim7101_wdt -+blacklist booke_wdt -+blacklist cpu5wdt -+blacklist eurotechwdt -+blacklist i6300esb -+blacklist i8xx_tco -+blacklist ib700wdt -+blacklist ibmasr -+blacklist indydog -+blacklist iTCO_wdt -+blacklist it8712f_wdt -+blacklist it87_wdt -+blacklist ixp2000_wdt -+blacklist ixp4xx_wdt -+blacklist machzwd -+blacklist mixcomwd -+blacklist mpc8xx_wdt -+blacklist mpcore_wdt -+blacklist mv64x60_wdt -+blacklist pc87413_wdt -+blacklist pcwd -+blacklist pcwd_pci -+blacklist pcwd_usb -+blacklist s3c2410_wdt -+blacklist sa1100_wdt -+blacklist sbc60xxwdt -+blacklist sbc7240_wdt -+blacklist sb8360 -+blacklist sc1200wdt -+blacklist sc520_wdt -+blacklist sch311_wdt -+blacklist scx200_wdt -+blacklist shwdt -+blacklist smsc37b787_wdt -+blacklist softdog -+blacklist twl4030_wdt -+blacklist w83627hf_wdt -+blacklist w83697hf_wdt -+blacklist w83697ug_wdt -+blacklist w83877f_wdt -+blacklist w83977f_wdt -+blacklist wafer5823wdt -+blacklist wdt -+blacklist wdt_pci -+blacklist wm8350_wdt -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -diff --git modules/udev-rules/load-modules.sh modules/udev-rules/load-modules.sh -new file mode 100755 -index 0000000..36972fd ---- /dev/null -+++ modules/udev-rules/load-modules.sh -@@ -0,0 +1,7 @@ -+#!/bin/sh -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+# Implement blacklisting for udev-loaded modules -+ -+modprobe -b "$@" -diff --git modules/udev-rules/module-setup.sh modules/udev-rules/module-setup.sh -new file mode 100755 -index 0000000..1005627 ---- /dev/null -+++ modules/udev-rules/module-setup.sh -@@ -0,0 +1,57 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+install_module() { -+ # FIXME: would be nice if we didn't have to know which rules to grab.... -+ # ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies -+ # of the rules we want so that we just copy those in would be best -+ dracut_install udevd udevadm /etc/udev/udev.conf /etc/group /bin/mount /sbin/modprobe -+ inst_rules 50-udev-default.rules 60-persistent-storage.rules \ -+ 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \ -+ 60-pcmcia.rules -+ mkdir -p "$initdir"/etc/modprobe.d -+ inst_simple "$moddir/blacklist.conf" /etc/modprobe.d/ -+ -+ # ignore some devices in the initrd -+ inst_rules "$moddir/01-ignore.rules" -+ -+ # for firmware loading -+ inst_rules 50-firmware.rules -+ -+ if [ ! -x /lib/udev/vol_id ]; then -+ inst_rules "$moddir/59-persistent-storage.rules" -+ else -+ inst_rules "$moddir/59-persistent-storage-volid.rules" -+ fi -+ inst_rules "$moddir/61-persistent-storage.rules" -+ -+ for i in \ -+ ata_id \ -+ cdrom_id \ -+ create_floppy_devices \ -+ edd_id \ -+ firmware.sh \ -+ firmware \ -+ firmware.agent \ -+ hotplug.functions \ -+ fw_unit_symlinks.sh \ -+ hid2hci \ -+ path_id \ -+ scsi_id \ -+ usb_id \ -+ vol_id \ -+ pcmcia-socket-startup \ -+ pcmcia-check-broken-cis \ -+ ; do -+ for utilpath in /lib/udev /sbin /bin -+ do -+ [ -e $utilpath/$i ] && dracut_install $utilpath/$i -+ done -+ done -+ -+ for i in {"$libdir","$usrlibdir"}/libnss_files*; do -+ [ -e "$i" ] && dracut_install "$i" -+ done -+} -+ diff --git a/sys-kernel/calckernel/files/calckernel-3.4.18-r10.patch b/sys-kernel/calckernel/files/calckernel-3.4.18-r10.patch deleted file mode 100644 index 9a97c592b..000000000 --- a/sys-kernel/calckernel/files/calckernel-3.4.18-r10.patch +++ /dev/null @@ -1,2159 +0,0 @@ -diff --git defaults/busy-config defaults/busy-config -index 51fdc8e..a1f6858 100644 ---- defaults/busy-config -+++ defaults/busy-config -@@ -462,7 +462,7 @@ CONFIG_MDSTART=y - CONFIG_MORE=y - CONFIG_FEATURE_USE_TERMIOS=y - CONFIG_MOUNT=y --CONFIG_FEATURE_MOUNT_NFS=y -+CONFIG_FEATURE_MOUNT_NFS=n - # CONFIG_FEATURE_MOUNT_CIFS is not set - CONFIG_FEATURE_MOUNT_FLAGS=y - CONFIG_FEATURE_MOUNT_FSTAB=y -diff --git defaults/initrd.defaults defaults/initrd.defaults -index 76d72a7..0c059a5 100755 ---- defaults/initrd.defaults -+++ defaults/initrd.defaults -@@ -68,6 +68,7 @@ fi - - REAL_ROOT='' - CDROOT='0' -+SCRATCH='0' - CDROOT_DEV='' - CDROOT_TYPE='auto' - NEW_ROOT='/newroot' -diff --git defaults/initrd.scripts defaults/initrd.scripts -index 51ebcce..7feaf7b 100755 ---- defaults/initrd.scripts -+++ defaults/initrd.scripts -@@ -187,23 +187,45 @@ cache_cd_contents() { - # TODO: Check the size of the image versus the size of our tmpfs - # along with the amount of available RAM and increase tmpfs size - # if necessary. (Not having awk sucks...) -- # z=0 -- # for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -- # cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; do -- # z=$(($z + $i)) ; done -- # echo $z -- good_msg "Copying loop file for caching..." -- # Verify that the needed directory exists -- mkdir -p "$(dirname ${NEW_ROOT}/mnt/${LOOP})" -- cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/${LOOP} -- if [ $? -ne 0 ] -+ -+ # getting memory -+ allmemory=0 -+ for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -+ cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; -+ do -+ allmemory=$(($allmemory + $i)) -+ done -+ -+ # getting size tmpfs of default -+ let curtfs=$allmemory/2 -+ -+ # getting size of image -+ let imagesize=`ls -la ${NEW_ROOT}/mnt/cdrom/${LOOP} | sed -r -n 's/(\S*\s*){4}(\S*).*/\2/p'`/20000*21 -+ let addon=$imagesize/10 -+ if [[ $curtfs -gt $(( ${imagesize} + ${addon} )) ]]; - then -- bad_msg "Failed to cache the loop file! Lack of space?" -- rm -rf ${NEW_ROOT}/mnt/livecd.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/image.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/zisofs 2>/dev/null -+ let addon=$(( $curtfs - ${imagesize} )) -+ fi -+ -+ if [[ $((${imagesize} + $addon)) -lt ${allmemory} ]]; -+ then -+ mount -o remount,size=${addon}000 -t tmpfs tmpfs ${NEW_ROOT} -+ mkdir ${NEW_ROOT}/mnt/squash -+ mount -o size=${imagesize}000 -t tmpfs tmpfs ${NEW_ROOT}/mnt/squash -+ good_msg "Copying loop file for caching..." -+ cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/squash/${LOOP} -+ if [ $? -ne 0 ] -+ then -+ bad_msg "Failed to cache the loop file! Lack of space?" -+ umount ${NEW_ROOT}/mnt/squash -+ mount -o remount,size=${curtfs}000 -t tmpfs tmpfs ${NEW_ROOT} -+ else -+ LOOPEXT='../squash/' -+ good_msg "Unmounting media from ${NEW_ROOT}/mnt/cdrom" -+ umount ${NEW_ROOT}/mnt/cdrom -+ fi - else -- LOOPEXT='../' -+ bad_msg "Too low memory for cache the loop file." - fi - fi - fi -@@ -306,7 +328,9 @@ run_shell() { - /bin/ash - } - --runmdev() { -+make_devfs() { -+ # make /run in root -+ mkdir /run - # Use devtmpfs if enabled in kernel, - # else tmpfs. Always run mdev just in case - devfs=tmpfs -@@ -321,6 +345,10 @@ runmdev() { - # http://git.busybox.net/busybox/plain/docs/mdev.txt - mkdir -m 0755 /dev/pts - mount -t devpts -o gid=5,mode=0620 devpts /dev/pts || bad_msg "Failed to mount /dev/pts" -+} -+ -+runmdev() { -+ make_devfs - mdev -s || bad_msg "Failed to receive dynamic updates from mdev" - } - -@@ -655,7 +683,7 @@ startVolumes() { - [ -d /etc/lvm/cache ] && lvm_commands="${lvm_commands} \nvgscan" - - # To activate volumegroups on all devices in the cache -- lvm_commands="${lvm_commands} \nvgchange -ay --sysinit" -+ lvm_commands="${lvm_commands} \nvgchange -ay --sysinit --noudevsync" - - # And finally execute it all (/proc/... needed if lvm is compiled without readline) - good_msg "Scanning for and activating Volume Groups" -@@ -1082,6 +1110,38 @@ getdvhoff() { - echo $(( $(hexdump -n 4 -s $((316 + 12 * $2)) -e '"%i"' $1) * 512)) - } - -+load_union_module() { -+ UNIONTYPE="" -+ # find module for union file system -+ [ -n "$(find /lib/ -name unionfs.ko)" ] && UNIONTYPE="unionfs" -+ [ -n "$(find /lib/ -name aufs.ko)" ] && UNIONTYPE="aufs" -+ # probably aufs in kernel -+ if [ -n "$(gzip -dc /proc/config.gz | grep CONFIG_AUFS_FS=y )" ] -+ then -+ UNIONTYPE="aufs" -+ else -+ if [ -z "${UNIONTYPE}" ] -+ then -+ bad_msg "Module for union file system is not found!" -+ run_shell -+ else -+ modprobe ${UNIONTYPE} > /dev/null 2>&1 -+ # error on load union module -+ if [ -z "$(lsmod | grep $UNIONTYPE)" ] -+ then -+ bad_msg "Module for union file system is not correct!" -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ bad_msg "Probably kernel compiled without standalone patch." -+ fi -+ run_shell -+ fi -+ -+ good_msg "Loading ${UNIONTYPE}" -+ fi -+ fi -+} -+ - setup_unionfs() { - local rw_dir=$1 - local ro_dir=$2 -@@ -1101,6 +1161,7 @@ setup_unionfs() { - mkdir -p ${UNION} - good_msg "Loading fuse module" - modprobe fuse > /dev/null 2>&1 -+ load_union_module - # if [ -n "${UNIONFS}" ] - # then - # CHANGESDEV=${UNIONFS} -@@ -1130,11 +1191,102 @@ setup_unionfs() { - mkdir /tmp - mkdir -p ${UNION} - # mkdir -p $CHANGES --# mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+## mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+ -+ if [ "${SCRATCH}" -ne 0 ]; -+ then -+ good_msg "Loading in scratch mode" -+ BUILDERDIR=${UNION}/mnt/builder -+ SCRATCHDIR=${UNION}/mnt/scratch -+ DELTADIR=${rw_dir}/mnt/delta -+ WORKSPACEDIR=${rw_dir}/mnt/workspace -+ mount -o remount,rw ${rw_dir}/mnt/cdrom >/dev/null 2>&1 -+ touch ${rw_dir}/mnt/cdrom/livecd >/dev/null 2>&1 -+ if [ "$?" -ne 0 ]; -+ then -+ ISRW=0 -+ else -+ ISRW=1 -+ fi -+ -+ mkdir -p ${DELTADIR} -+ mkdir -p ${WORKSPACEDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${WORKSPACEDIR}=rw:${DELTADIR}=ro+wh:${rw_dir}/mnt/livecd=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${WORKSPACEDIR}=rw:${DELTADIR}=ro:${rw_dir}/mnt/livecd=ro unionfs ${UNION} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${SCRATCHDIR}/calculate -+ mkdir -p ${SCRATCHDIR}/delta -+ mkdir -p ${SCRATCHDIR}/workspace -+ mount -o bind ${rw_dir}/mnt/delta ${SCRATCHDIR}/delta -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind ${rw_dir}/mnt/workspace ${SCRATCHDIR}/workspace -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${BUILDERDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro none ${BUILDERDIR} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro unionfs ${BUILDERDIR} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind,ro ${rw_dir}/mnt/livecd ${SCRATCHDIR}/calculate -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ if [ "$ISRW" -ne 0 ]; -+ then -+ FLASHDIR=${UNION}/mnt/flash -+ mkdir -p ${FLASHDIR} -+ mount -o bind ${rw_dir}/mnt/cdrom ${FLASHDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ mkdir -p ${CDROMDIR} -+ mount -o bind,ro ${rw_dir}/mnt/cdrom ${CDROMDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ fi -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ LIVECDDIR=${UNION}/mnt/livecd -+ -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${rw_dir}:${ro_dir}=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${rw_dir}:${ro_dir}=ro unionfs ${UNION} -+ fi -+ -+ if [[ -n "$( echo ${LOOPEXT} | grep squash )" ]]; -+ then -+ mkdir -p ${UNION}/mnt/squash -+ mount -o bind ${NEW_ROOT}/mnt/squash ${UNION}/mnt/squash &>/dev/null -+ fi -+ -+ chmod 0755 ${UNION} -+ mount -o bind ${rw_dir}/mnt/cdrom ${CDROMDIR} &>/dev/null -+ mount -o bind ${rw_dir}/mnt/livecd ${LIVECDDIR} &>/dev/null -+ ret=$? -+ fi -+ -+ chmod 1777 ${UNION}/tmp - good_msg "Creating union mount" -- unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -- ret=$? -- if [ ${ret} -ne 0 ] -+# unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -+# ret=$? -+ if [ "${ret}" -ne 0 ] - then - bad_msg "Can't setup union mount!" - USE_UNIONFS_NORMAL=0 -@@ -1143,3 +1295,122 @@ setup_unionfs() { - USE_UNIONFS_NORMAL=0 - fi - } -+ -+load_videodrv() { -+ good_msg "Loading frame buffer video driver" -+ # find all available fb drivers -+ videodrv_count=$(find /lib/modules \ -+ -name "nouveau.ko" -o \ -+ -name "uvesafb.ko" -o \ -+ -name "i915.ko" -o \ -+ -name "radeon.ko" | -+ grep -c "") -+ # load specified videodrv -+ modules_list= -+ case "${VIDEODRV}" in -+ nouveau) -+ modules_list="nouveau" -+ ;; -+ radeon) -+ modules_list="radeon" -+ ;; -+ i915|intel) -+ modules_list="i915" -+ ;; -+ ""|auto) -+ # if not livecd and initramfs otimized (aviailable only one video driver) -+ if [ "${CDROOT}" != '1' -a "${videodrv_count}" -le 2 ] -+ then -+ modules_list="nouveau i915 radeon" -+ else -+ if [[ -x /usr/sbin/lspci ]] -+ then -+ if lspci | grep -m1 VGA | grep -qi intel -+ then -+ modules_list="i915" -+ elif lspci | grep -m1 VGA | grep -qi nvidia -+ then -+ modules_list="nouveau" -+ elif lspci | grep -m1 VGA | grep -q -e "Ati" -e "ATI" -+ then -+ modules_list="radeon" -+ else -+ modules_list="" -+ fi -+ else -+ modules_list="i915" -+ fi -+ fi -+ ;; -+ esac -+ for x in $modules_list -+ do -+ if [ "`find /lib/modules -name "${x}.ko" | grep -c ''`" -eq "1" ] -+ then -+ modprobe "${x}" modeset=${USE_MODESET} &>/dev/null -+ lsmod | grep -q "^${x}" && \ -+ [ "`cat /sys/module/${x}/refcnt`" -gt 0 ] && return 0 -+ fi -+ done -+ # else load uvesafb with specified video resolution -+ if [ -n "${VIDEORES}" ] -+ then -+ if ! echo $VIDEORES | grep -q "\-" -+ then -+ VIDEORES="${VIDEORES}-32" -+ fi -+ else -+ VIDEORES="1024x768-32" -+ fi -+ modprobe uvesafb mode_option=${VIDEORES} &>/dev/null -+} -+ -+start_udev() -+{ -+ # start udev -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ echo "" >/proc/sys/kernel/hotplug -+ make_devfs -+ udevd --daemon &>/dev/null -+ udevadm settle -+ fi -+} -+ -+stop_udev() -+{ -+ # kill udevd -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ pkill udevd &>/dev/null -+ fi -+} -+ -+populate_dev() -+{ -+ good_msg 'Activating udev' -+ # Do not run any init-scripts -+ udevadm control --property=do_not_run_plug_service=1 -+ -+ if [ "${REAL_ROOT}" == "/dev/nfs" ] -+ then -+ # clean blacklist because there are net drivers -+ # keep black video for correct loading prop. nvidia -+ cat </etc/modprobe.d/blacklist.conf -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -+EOF -+ fi -+ # discarding net drivers placed into blacklist.conf -+ udevadm trigger --action="add" -+ -+ # we can speed up booting under these conditions: -+ # * using devtmpfs so kernel creates device nodes for us -+ # * only using kernel created device nodes at boot (in /etc/fstab and elsewhere) -+ udevadm settle --timeout=60 -+} -diff --git defaults/linuxrc defaults/linuxrc -index 0843f5d..8109d09 100755 ---- defaults/linuxrc -+++ defaults/linuxrc -@@ -39,6 +39,13 @@ FAKE_ROOT='' - REAL_ROOTFLAGS='' - ROOTFSTYPE='auto' - CRYPT_SILENT=0 -+VIDEODRV='' -+USE_UDEV=1 -+USE_MODESET=1 -+if [ -e "/etc/calculate/calculate.ini" ] -+then -+ source /etc/calculate/calculate.ini -+fi - for x in ${CMDLINE} - do - case "${x}" in -@@ -57,6 +64,57 @@ do - init_opts\=*) - INIT_OPTS=`parse_opt "${x}"` - ;; -+ nokms) -+ USE_MODESET=0 -+ ;; -+ kms) -+ USE_MODESET=1 -+ ;; -+ noudev) -+ USE_UDEV=0 -+ ;; -+ calculate\=*) -+ CALCULATE=`parse_opt "${x}"` -+ if [[ "${CALCULATE//:/}" != "${CALCULATE}" ]] -+ then -+ for i in ${CALCULATE//,/ } -+ do -+ case "${i}" in -+ video:*) -+ VIDEODRV=`echo "${i}" | cut -s -d: -f2-` -+ ;; -+ resolution:*) -+ RES=`echo "${i}" | cut -s -d: -f2-` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ ;; -+ esac -+ done -+ else -+ RES=`echo "${CALCULATE}" | cut -s -d, -f4` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ VIDEODRV=`echo "${CALCULATE}" | cut -s -d, -f5` -+ fi -+ ;; -+ video\=*) -+ VR=`parse_opt "${x}"` -+ for i in ${VR//,/ } -+ do -+ if [ -z "${i//[0-9-x@]}" ] -+ then -+ VIDEORES=${i} -+ fi -+ done -+ ;; -+ # Scratch usbload -+ scratch) -+ SCRATCH=1 -+ ;; - # Livecd options - cdroot) - CDROOT=1 -@@ -251,15 +309,24 @@ then - REAL_ROOT="${FAKE_ROOT}" - fi - --splash 'init' -- --cmdline_hwopts -+# check udevd -+[ ! -x /sbin/udevd ] && USE_UDEV=0 - - # Mount sysfs - mount_sysfs - -+# start udev -+start_udev -+ -+# load kernel video driver -+load_videodrv -+ -+splash 'init' -+ -+cmdline_hwopts -+ - # Setup hotplugging for firmware loading --setup_hotplug -+[ "${USE_UDEV}" == "0" ] && setup_hotplug - - # Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel - if [ -z "${DO_modules}" ] -@@ -269,7 +336,7 @@ elif [ -d "/lib/modules/${KV}" ] - then - good_msg 'Loading modules' - # Load appropriate kernel modules -- if [ "${NODETECT}" != '1' ] -+ if [ "${USE_UDEV}" != '1' -a "${NODETECT}" != '1' ] - then - for modules in ${MY_HWOPTS} - do -@@ -285,14 +352,20 @@ fi - # Apply scan delay if specified - sdelay - --# Setup slow USB bits --setup_slowusb -+if [ "${USE_UDEV}" == "1" ] -+then -+ # populate /dev with devices already found by the kernel -+ populate_dev -+else -+ # Setup slow USB bits -+ setup_slowusb - --# Start device manager --start_dev_mgr -+ # Start device manager -+ start_dev_mgr - --# if doslowusb is passed, pause other 10 seconds here, after mdev load --[ "${DO_slowusb}" ] && sleep 10 -+ # if doslowusb is passed, pause other 10 seconds here, after mdev load -+ [ "${DO_slowusb}" ] && sleep 10 -+fi - - # Start iSCSI - if [ -e /bin/iscsistart ] -@@ -509,9 +582,50 @@ do - then - break - else -- bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -- got_good_root=0 -- REAL_ROOT='' -+ # check for scratch -+ if [ -e ${NEW_ROOT}/livecd.squashfs -a -d ${NEW_ROOT}/delta -a -d ${NEW_ROOT}/workspace ]; -+ then -+ good_msg 'Found scratch data...' -+ load_union_module -+ modprobe squashfs >/dev/null -+ if mount -o remount,rw ${NEW_ROOT}; -+ then -+ mkdir -p ${NEW_ROOT}/calculate && mkdir -p /union && mkdir -p ${NEW_ROOT}/workspace/mnt/builder && mkdir -p ${NEW_ROOT}/workspace/mnt/scratch -+ if mount -o loop,ro -t squashfs ${NEW_ROOT}/livecd.squashfs ${NEW_ROOT}/calculate; -+ then -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/workspace=rw:${NEW_ROOT}/delta=ro+wh:${NEW_ROOT}/calculate=ro none /union; -+ then -+ mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/delta=rw:${NEW_ROOT}/calculate=ro none /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers!' -+ run_shell -+ fi -+ else -+ if mount -t unionfs -o ro,dirs=${NEW_ROOT}/workspace:${NEW_ROOT}/delta=ro:${NEW_ROOT}/calculate=ro unionfs /union; -+ then -+ mount -t unionfs -o ro,dirs=${NEW_ROOT}/delta:${NEW_ROOT}/calculate=ro unionfs /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers' -+ run_shell -+ fi -+ fi -+ else -+ bad_msg 'Could not mount scratch squashfs image' -+ fi -+ else -+ bad_msg 'Could not remount ${NEW_ROOT}' -+ fi -+ else -+ bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -+ got_good_root=0 -+ REAL_ROOT='' -+ fi - fi - else - bad_msg "Could not mount specified ROOT, try again" -@@ -723,9 +837,12 @@ cd "${CHROOT}" - mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null - echo -ne "${BOLD}.${NORMAL}" - -+# stop udev before move mount points -+stop_udev -+ - # If devtmpfs is mounted, try move it to the new root - # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise --for fs in /dev /sys /proc -+for fs in "/dev " /sys /proc - do - if grep -qs "$fs" /proc/mounts - then -diff --git defaults/modprobe defaults/modprobe -index ba2d890..9280357 100755 ---- defaults/modprobe -+++ defaults/modprobe -@@ -10,8 +10,6 @@ usage() { - echo - echo 'Example:' - echo ' modprobe eepro100' -- echo -- echo 'Note: Do not pass the suffix to modprobe!' - exit 1 - } - -@@ -81,14 +79,29 @@ modprobe2() { - usage - exit 1 - fi -- real_path=`real_mod_path ${1}` -+ local modname=${1} -+ local quiet='' -+ local params='' -+ shift -+ for x in $@ -+ do -+ case ${x} in -+ -n) -+ quiet=1 -+ ;; -+ *) -+ params="${params} ${x}" -+ ;; -+ esac -+ done -+ real_path=`real_mod_path ${modname}` - if [ "${real_path}" = '' -o "${real_path}" = ' ' ] - then -- [ "${2}" = '-n' ] && echo -n " -> $1" -+ [ "${quiet}" = '1' ] && echo -n " -> ${modname}" - echo ' module not found.' - exit 2 - fi -- modlist=`modules_dep_list ${1}` -+ modlist=`modules_dep_list ${modname}` - if [ "${modlist}" != '' -a "${modlist}" != ' ' ] - then - deps=`strip_mod_paths ${modlist}` -@@ -110,13 +123,13 @@ modprobe2() { - filler=1 - fi - done -- ${INSMOD} ${real_path} > /dev/null 2>&1 -+ ${INSMOD} ${real_path} ${params} > /dev/null 2>&1 - ret=$? - if [ ${ret} -eq 0 ] - then - echoAppend=' loaded.' -- [ "${2}" = '-n' ] && echoFlags='-n' && echoAppend=', ' -- echo ${echoFlags} "${1}${echoAppend}" -+ [ "${quiet}" = '1' ] && echoFlags='-n' && echoAppend=', ' -+ echo ${echoFlags} "${modname}${echoAppend}" - fi - return $ret - } -@@ -132,7 +145,7 @@ do - LOADED_MODULES="${LOADED_MODULES} ${x}" - done - --modprobe2 ${1} -+modprobe2 ${@} - modprobe_ret=$? - - [ -f '/modules.cache' ] && rm -f /modules.cache > /dev/null 2>&1 -diff --git dracut_funcs.sh dracut_funcs.sh -new file mode 100755 -index 0000000..e80a638 ---- /dev/null -+++ dracut_funcs.sh -@@ -0,0 +1,752 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+# -+# functions used by dracut and other tools. -+# -+# Copyright 2005-2009 Red Hat, Inc. All rights reserved. -+# -+# 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; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+# -+ -+IF_RTLD="" -+IF_dynamic="" -+ -+# Generic substring function. If $2 is in $1, return 0. -+strstr() { [[ $1 =~ $2 ]]; } -+ -+# Create all subdirectories for given path without creating the last element. -+# $1 = path -+mksubdirs() { mkdir -p ${1%/*}; } -+ -+# Version comparision function. Assumes Linux style version scheme. -+# $1 = version a -+# $2 = comparision op (gt, ge, eq, le, lt, ne) -+# $3 = version b -+vercmp() { -+ local n1=(${1//./ }) op=$2 n2=(${3//./ }) i res -+ -+ for ((i=0; ; i++)) -+ do -+ if [[ ! ${n1[i]}${n2[i]} ]]; then res=0 -+ elif ((${n1[i]:-0} > ${n2[i]:-0})); then res=1 -+ elif ((${n1[i]:-0} < ${n2[i]:-0})); then res=2 -+ else continue -+ fi -+ break -+ done -+ -+ case $op in -+ gt) ((res == 1));; -+ ge) ((res != 2));; -+ eq) ((res == 0));; -+ le) ((res != 1));; -+ lt) ((res == 2));; -+ ne) ((res != 0));; -+ esac -+} -+ -+is_func() { -+ [[ $(type -t $1) = "function" ]] -+} -+ -+# Log initrd creation. -+if ! [[ $dracutlogfile ]]; then -+ [[ $dracutbasedir = /usr/share/dracut ]] && \ -+ dracutlogfile=/var/log/dracut.log || \ -+ dracutlogfile=/tmp/dracut.log -+# [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log -+ if [[ -w $dracutlogfile ]]; then -+ >"$dracutlogfile" -+ fi -+fi -+ -+dwarning() { -+ echo "W: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "W: $@" >>"$dracutlogfile" -+} -+ -+dinfo() { -+ [[ $beverbose ]] && echo "I: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "I: $@" >>"$dracutlogfile" -+} -+ -+derror() { -+ echo "E: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile" -+} -+ -+# Function prints global variables in format name=value line by line. -+# $@ = list of global variables' name -+print_vars() { -+ local var value -+ -+ for var in $@ -+ do -+ value=$(eval echo \$$var) -+ [[ ${value} ]] && echo "${var}=\"${value}\"" -+ done -+} -+ -+get_fs_env() { -+ [[ $1 ]] || return -+ eval $(udevadm info --query=env --name=$1|egrep 'ID_FS_(TYPE|UUID)=') -+ [[ $ID_FS_TYPE ]] && return -+ -+ if [[ -x /lib/udev/vol_id ]]; then -+ eval $(/lib/udev/vol_id --export $1) -+ elif find_binary blkid >/dev/null; then -+ eval $(blkid -o udev $1) -+ else -+ return 1 -+ fi -+} -+ -+get_fs_type() ( -+ [[ $1 ]] || return -+ if [[ $1 != ${1#/dev/block/nfs:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs3:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs4:} ]]; then -+ echo "nfs" -+ return -+ fi -+ get_fs_env $1 || return -+ echo $ID_FS_TYPE -+) -+ -+get_fs_uuid() ( -+ get_fs_env $1 || return -+ echo $ID_FS_UUID -+) -+ -+# finds the major:minor of the block device backing the root filesystem. -+find_block_device() { -+ local x mpt majmin dev fs misc maj min -+ if [[ $use_fstab != yes ]]; then -+ while read x x majmin x mpt x x fs dev misc; do -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $fs = btrfs ]] && { -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ } -+ if [[ $mpt = $1 ]] && [[ ${majmin#0:} = $majmin ]]; then -+ echo $majmin; -+ return 0 # we have a winner! -+ fi -+ done < /proc/self/mountinfo -+ fi -+ # fall back to /etc/fstab -+ while read dev mpt fs misc; do -+ if [[ $mpt = $1 ]]; then -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $dev != ${dev#UUID=} ]] && dev=/dev/disk/by-uuid/${dev#UUID=} -+ [[ $dev != ${dev#LABEL=} ]] && dev=/dev/disk/by-label/${dev#LABEL=} -+ [[ -b $dev ]] || return 1 # oops, not a block device. -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ fi -+ done < /etc/fstab -+ return 1; -+} -+ -+find_root_block_device() { find_block_device /; } -+ -+# Walk all the slave relationships for a given block device. -+# Stop when our helper function returns success -+# $1 = function to call on every found block device -+# $2 = block device in major:minor format -+check_block_and_slaves() { -+ local x -+ [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. -+ "$1" $2 && return -+ check_vol_slaves "$@" && return 0 -+ if [[ -f /sys/dev/block/$2/../dev ]]; then -+ check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0 -+ fi -+ [[ -d /sys/dev/block/$2/slaves ]] || return 1 -+ for x in /sys/dev/block/$2/slaves/*/dev; do -+ [[ -f $x ]] || continue -+ check_block_and_slaves $1 $(cat "$x") && return 0 -+ done -+ return 1 -+} -+ -+get_numeric_dev() { -+ ls -lH "$1" | { read a b c d maj min rest; printf "%d:%d" ${maj%%,} $min;} -+} -+ -+# ugly workaround for the lvm design -+# There is no volume group device, -+# so, there are no slave devices for volume groups. -+# Logical volumes only have the slave devices they really live on, -+# but you cannot create the logical volume without the volume group. -+# And the volume group might be bigger than the devices the LV needs. -+check_vol_slaves() { -+ for i in /dev/mapper/*; do -+ lv=$(get_numeric_dev $i) -+ if [[ $lv = $2 ]]; then -+ vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null) -+ # strip space -+ vg=$(echo $vg) -+ if [[ $vg ]]; then -+ for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \ -+ do -+ check_block_and_slaves $1 $(get_numeric_dev $pv) \ -+ && return 0 -+ done -+ fi -+ fi -+ done -+ return 1 -+} -+ -+# Install a directory, keeping symlinks as on the original system. -+# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file" -+# will create ${initdir}/lib64, ${initdir}/lib64/file, -+# and a symlink ${initdir}/lib -> lib64. -+inst_dir() { -+ local dir="$1" -+ [[ -e ${initdir}$dir ]] && return 0 -+ -+ # iterate over parent directories -+ local file="" -+ local IFS="/" -+ for part in $dir; do -+ [[ $part ]] || continue -+ file="$file/$part" -+ [[ -e ${initdir}$file ]] && continue -+ -+ if [[ -L $file ]]; then -+ # create link as the original -+ local target=$(readlink "$file") -+ ln -sfn "$target" "${initdir}$file" || return 1 -+ # resolve relative path and recursively install destionation -+ [[ $target = ${target##*/} ]] && target="${file%/*}/$target" -+ inst_dir "$target" -+ else -+ # create directory -+ mkdir -p "${initdir}$file" || return 1 -+ fi -+ done -+} -+ -+# $1 = file to copy to ramdisk -+# $2 (optional) Name for the file on the ramdisk -+# Location of the image dir is assumed to be $initdir -+# We never overwrite the target if it exists. -+inst_simple() { -+ local src target -+ [[ -f $1 ]] || return 1 -+ src=$1 target="${2:-$1}" -+ if ! [[ -d ${initdir}$target ]]; then -+ [[ -e ${initdir}$target ]] && return 0 -+ inst_dir "${target%/*}" -+ fi -+ dinfo "Installing $src" -+ cp -pfL "$src" "${initdir}$target" -+} -+ -+# find symlinks linked to given library file -+# $1 = library file -+# Function searches for symlinks by stripping version numbers appended to -+# library filename, checks if it points to the same target and finally -+# prints the list of symlinks to stdout. -+# -+# Example: -+# rev_lib_symlinks libfoo.so.8.1 -+# output: libfoo.so.8 libfoo.so -+# (Only if libfoo.so.8 and libfoo.so exists on host system.) -+rev_lib_symlinks() { -+ [[ ! $1 ]] && return 0 -+ -+ local fn="$1" orig="$(readlink -f "$1")" links='' -+ -+ [[ ${fn} =~ .*\.so\..* ]] || return 1 -+ -+ until [[ ${fn##*.} == so ]]; do -+ fn="${fn%.*}" -+ [[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}" -+ done -+ -+ echo ${links} -+} -+ -+# Same as above, but specialized to handle dynamic libraries. -+# It handles making symlinks according to how the original library -+# is referenced. -+inst_library() { -+ local src=$1 dest=${2:-$1} lib reallib symlink -+ [[ -e $initdir$dest ]] && return 0 -+ if [[ -L $src ]]; then -+ reallib=$(readlink -f "$src") -+ lib=${src##*/} -+ inst_simple "$reallib" "$reallib" -+ inst_dir "${dest%/*}" -+ (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib") -+ else -+ inst_simple "$src" "$dest" -+ fi -+ -+ # Create additional symlinks. See rev_symlinks description. -+ for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do -+ [[ ! -e $initdir$symlink ]] && { -+ dinfo "Creating extra symlink: $symlink" -+ inst_symlink $symlink -+ } -+ done -+} -+ -+# find a binary. If we were not passed the full path directly, -+# search in the usual places to find the binary. -+find_binary() { -+ local binpath="/bin /sbin /usr/bin /usr/sbin" p -+ [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } -+ for p in $binpath; do -+ [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# Same as above, but specialized to install binary executables. -+# Install binary executable, and all shared library dependencies, if any. -+inst_binary() { -+ local bin target -+ bin=$(find_binary "$1") || return 1 -+ target=${2:-$bin} -+ inst_symlink $bin $target && return 0 -+ local LDSO NAME IO FILE ADDR I1 n f TLIBDIR -+ [[ -e $initdir$target ]] && return 0 -+ # I love bash! -+ LC_ALL=C ldd $bin 2>/dev/null | while read line; do -+ [[ $line = 'not a dynamic executable' ]] && return 1 -+ if [[ $line =~ not\ found ]]; then -+ derror "Missing a shared library required by $bin." -+ derror "Run \"ldd $bin\" to find out what it is." -+ derror "dracut cannot create an initrd." -+ exit 1 -+ fi -+ so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)' -+ [[ $line =~ $so_regex ]] || continue -+ FILE=${BASH_REMATCH[1]} -+ [[ -e ${initdir}$FILE ]] && continue -+ # see if we are loading an optimized version of a shared lib. -+ lib_regex='^(/lib[^/]*).*' -+ if [[ $FILE =~ $lib_regex ]]; then -+ TLIBDIR=${BASH_REMATCH[1]} -+ BASE=${FILE##*/} -+ # prefer nosegneg libs, then unoptimized ones. -+ for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do -+ [[ -e $f/$BASE ]] || continue -+ FILE=$f/$BASE -+ break -+ done -+ inst_library "$FILE" "$TLIBDIR/$BASE" -+ IF_dynamic=yes -+ continue -+ fi -+ inst_library "$FILE" -+ done -+ inst_simple "$bin" "$target" -+} -+ -+# same as above, except for shell scripts. -+# If your shell script does not start with shebang, it is not a shell script. -+inst_script() { -+ [[ -f $1 ]] || return 1 -+ local line -+ read -r -n 80 line <"$1" -+ # If debug is set, clean unprintable chars to prevent messing up the term -+ [[ $debug ]] && line=$(echo -n "$line" | tr -c -d '[:print:][:space:]') -+ shebang_regex='(#! *)(/[^ ]+).*' -+ [[ $line =~ $shebang_regex ]] || return 1 -+ inst "${BASH_REMATCH[2]}" && inst_simple "$@" -+} -+ -+# same as above, but specialized for symlinks -+inst_symlink() { -+ local src=$1 target=$initdir${2:-$1} realsrc -+ [[ -L $1 ]] || return 1 -+ [[ -L $target ]] && return 0 -+ realsrc=$(readlink -f "$src") -+ [[ $realsrc = ${realsrc##*/} ]] && realsrc=${src%/*}/$realsrc -+ inst "$realsrc" && mkdir -p "${target%/*}" && \ -+ ln -s "$realsrc" "$target" -+} -+ -+# find a udev rule in the usual places. -+find_rule() { -+ [[ -f $1 ]] && { echo "$1"; return 0; } -+ for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do -+ [[ -f $r/$1 ]] && { echo "$r/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# udev rules always get installed in the same place, so -+# create a function to install them to make life simpler. -+inst_rules() { -+ local target=/etc/udev/rules.d rule found -+ -+ inst_dir "/lib/udev/rules.d" -+ inst_dir "$target" -+ for rule in "$@"; do -+ found=$(find_rule "$rule") && \ -+ inst_simple "$found" "$target/${found##*/}" \ -+ || dinfo "Skipping udev rule: $rule" -+ done -+} -+ -+# general purpose installation function -+# Same args as above. -+inst() { -+ case $# in -+ 1) ;; -+ 2) [[ ! $initdir && -d $2 ]] && export initdir=$2 -+ [[ $initdir = $2 ]] && set $1;; -+ 3) [[ -z $initdir ]] && export initdir=$2 -+ set $1 $3;; -+ *) derror "inst only takes 1 or 2 or 3 arguments" -+ exit 1;; -+ esac -+ for x in inst_symlink inst_script inst_binary inst_simple; do -+ $x "$@" && return 0 -+ done -+ return 1 -+} -+ -+# install function specialized for hooks -+# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook -+# All hooks should be POSIX/SuS compliant, they will be sourced by init. -+inst_hook() { -+ if ! [[ -f $3 ]]; then -+ derror "Cannot install a hook ($3) that does not exist." -+ derror "Aborting initrd creation." -+ exit 1 -+ elif ! strstr "$hookdirs" "$1"; then -+ derror "No such hook type $1. Aborting initrd creation." -+ exit 1 -+ fi -+ inst_simple "$3" "/${1}/${2}${3##*/}" -+} -+ -+dracut_install() { -+ if [[ $1 = '-o' ]]; then -+ local optional=yes -+ shift -+ fi -+ while (($# > 0)); do -+ if ! inst "$1" ; then -+ if [[ $optional = yes ]]; then -+ dwarning "Skipping program $1 as it cannot be found and is flagged to be optional" -+ else -+ derror "Failed to install $1" -+ exit 1 -+ fi -+ fi -+ shift -+ done -+} -+ -+# install function decompressing the target and handling symlinks -+# $@ = list of compressed (gz or bz2) files or symlinks pointing to such files -+# -+# Function install targets in the same paths inside overlay but decompressed -+# and without extensions (.gz, .bz2). -+inst_decompress() { -+ local src dst realsrc realdst cmd -+ -+ for src in $@ -+ do -+ case ${src} in -+ *.gz) cmd='gzip -d' ;; -+ *.bz2) cmd='bzip2 -d' ;; -+ *) return 1 ;; -+ esac -+ -+ if [[ -L ${src} ]] -+ then -+ realsrc="$(readlink -f ${src})" # symlink target with extension -+ dst="${src%.*}" # symlink without extension -+ realdst="${realsrc%.*}" # symlink target without extension -+ mksubdirs "${initdir}/${src}" -+ # Create symlink without extension to target without extension. -+ ln -s "${realdst}" "${initdir}/${dst}" -+ fi -+ -+ # If the source is symlink we operate on its target. -+ [[ ${realsrc} ]] && src=${realsrc} -+ inst ${src} -+ # Decompress with chosen tool. We assume that tool changes name e.g. -+ # from 'name.gz' to 'name'. -+ ${cmd} "${initdir}${src}" -+ done -+} -+ -+# It's similar to above, but if file is not compressed, performs standard -+# install. -+# $@ = list of files -+inst_opt_decompress() { -+ local src -+ -+ for src in $@ -+ do -+ inst_decompress "${src}" || inst "${src}" -+ done -+} -+ -+module_check() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we are unconditionally included -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check $hostonly -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func check || return 0 -+ check -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_depends() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we have no deps -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check -d -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func depends || return 0 -+ depends -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_install() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/install ]] && . "$moddir/install" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func install || return 0 -+ install -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_installkernel() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/installkernel ]] && . "$moddir/installkernel" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func installkernel || return 0 -+ installkernel -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+check_module() { -+ local mod=$1; -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ local moddep; -+ # If we are already scheduled to be loaded, no need to check again. -+ strstr " $mods_to_load " " $mod " && return 0 -+ strstr " $mods_checked_as_dep " " $mod " && return 1 -+ -+ # This should never happen, but... -+ [[ -d $moddir ]] || return 1 -+ -+ [[ $2 ]] || mods_checked_as_dep+=" $mod " -+ -+ strstr " $omit_dracutmodules " " $mod " && return 1 -+ -+ if strstr " $dracutmodules $add_dracutmodules " " $mod "; then -+ module_check $mod; ret=$? -+ # explicit module, so also accept ret=255 -+ [[ $ret = 0 || $ret = 255 ]] || return 1 -+ else -+ # module not in our list -+ if [[ $dracutmodules = all ]]; then -+ # check, if we can and should install this module -+ module_check $mod || return 1 -+ else -+ # skip this module -+ return 1 -+ fi -+ fi -+ -+ for moddep in $(module_depends $mod); do -+ # handle deps as if they were manually added -+ strstr " $add_dracutmodules " " $moddep " || \ -+ add_dracutmodules+=" $moddep " -+ # if a module we depend on fail, fail also -+ check_module $moddep || return 1 -+ done -+ -+ strstr " $mods_to_load " " $mod " || \ -+ mods_to_load+=" $mod " -+ -+ return 0 -+} -+ -+check_module_dir() { -+ local modcheck; -+ local mod; -+ mods_to_load="" -+ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do -+ local mod=${moddir##*/}; mod=${mod#[0-9][0-9]} -+ check_module $mod 1 -+ done -+} -+ -+# Install a single kernel module along with any firmware it may require. -+# $1 = full path to kernel module to install -+install_kmod_with_fw() { -+ local modname=${1##*/} fwdir found -+ modname=${modname%.ko*} -+ inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \ -+ return 0 # no need to go further if the module is already installed -+ for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do -+ found='' -+ for fwdir in $fw_dir; do -+ if [[ -d $fwdir && -f $fwdir/$fw ]]; then -+ inst_simple "$fwdir/$fw" "/lib/firmware/$fw" -+ found=yes -+ fi -+ done -+ if [[ $found != yes ]]; then -+ dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\"" -+ fi -+ done -+} -+ -+# Do something with all the dependencies of a kernel module. -+# Note that kernel modules depend on themselves using the technique we use -+# $1 = function to call for each dependency we find -+# It will be passed the full path to the found kernel module -+# $2 = module to get dependencies for -+# rest of args = arguments to modprobe -+for_each_kmod_dep() { -+ local func=$1 kmod=$2 cmd modpapth options -+ shift 2 -+ modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \ -+ while read cmd modpath options; do -+ [[ $cmd = insmod ]] || continue -+ $func $modpath -+ done -+} -+ -+# filter kernel modules to install certain modules that meet specific -+# requirements. -+# $1 = function to call with module name to filter. -+# This function will be passed the full path to the module to test. -+# The behaviour of this function can vary depending on whether $hostonly is set. -+# If it is, we will only look at modules that are already in memory. -+# If it is not, we will look at all kernel modules -+# This function returns the full filenames of modules that match $1 -+filter_kernel_modules () ( -+ if ! [[ $hostonly ]]; then -+ filtercmd='find "$srcmods/kernel/drivers" "$srcmods/extra" "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz" 2>/dev/null' -+ else -+ filtercmd='cut -d " " -f 1 /dev/null' -+ fi -+ for modname in $(eval $filtercmd); do -+ case $modname in -+ *.ko) "$1" "$modname" && echo "$modname";; -+ *.ko.gz) gzip -dc "$modname" > $initdir/$$.ko -+ $1 $initdir/$$.ko && echo "$modname" -+ rm -f $initdir/$$.ko;; -+ esac -+ done -+) -+ -+# install kernel modules along with all their dependencies. -+instmods() { -+ [[ $no_kernel = yes ]] && return -+ local mod mpargs modpath modname cmd moddirname -+ while (($# > 0)); do -+ mod=${1%.ko*} -+ case $mod in -+ =*) -+ # This introduces 2 incompatible meanings for =* arguments -+ # to instmods. We need to decide which one to keep. -+ if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then -+ instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block") -+ elif [ -f $srcmods/modules.${mod#=} ]; then -+ instmods $mpargs $(cat ${srcmods}/modules.${mod#=} ) -+ else -+ instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*") -+ fi -+ ;; -+ --*) -+ mod=${mod##*/} -+ mpargs+=" $mod";; -+ i2o_scsi) shift; continue;; # Do not load this diagnostic-only module -+ *) mod=${mod##*/} -+ # if we are already installed, skip this module and go on -+ # to the next one. -+ [[ -f $initdir/$1 ]] && { shift; continue; } -+ # If we are building a host-specific initramfs and this -+ # module is not already loaded, move on to the next one. -+ [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \ -+ ! echo $add_drivers | grep -qe "\<${mod}\>" && { -+ shift; continue; -+ } -+ -+ # We use '-d' option in modprobe only if modules prefix path -+ # differs from default '/'. This allows us to use Dracut with -+ # old version of modprobe which doesn't have '-d' option. -+ moddirname=${srcmods%%/lib/modules/*} -+ [[ -n ${moddirname} ]] && moddirname="-d ${moddirname}/" -+ -+ # ok, load the module, all its dependencies, and any firmware -+ # it may require -+ for_each_kmod_dep install_kmod_with_fw $mod \ -+ --set-version $kernel ${moddirname} -+ ;; -+ esac -+ shift -+ done -+} -diff --git gen_cmdline.sh gen_cmdline.sh -index b3e451d..36afb2e 100755 ---- gen_cmdline.sh -+++ gen_cmdline.sh -@@ -22,6 +22,7 @@ longusage() { - echo " --logfile= Output file for debug info" - echo " --color Output debug in color" - echo " --no-color Do not output debug in color" -+ echo " --no-cleartmp Do not clear temp directory" - echo " Kernel Configuration settings" - echo " --menuconfig Run menuconfig after oldconfig" - echo " --no-menuconfig Do not run menuconfig after oldconfig" -@@ -78,6 +79,8 @@ longusage() { - echo " --splash-res= Select splash theme resolutions to install" - echo " --do-keymap-auto Forces keymap selection at boot" - echo " --no-keymap Disables keymap selection support" -+ echo " --udev Include udev in the initramfs" -+ echo " --no-udev Exclude udev from the initramfs" - echo " --lvm Include LVM support" - echo " --mdadm Include MDADM/MDMON support" - echo " --mdadm-config= Use file as mdadm.conf in initramfs" -@@ -97,6 +100,8 @@ longusage() { - echo " --unionfs Include support for unionfs" - echo " --netboot Create a self-contained env in the initramfs" - echo " --real-root= Specify a default for real_root=" -+ echo " --lscpi Include lspci into the initramfs" -+ echo " --no-lscpi Exclude lspci from the initramfs" - echo " Internals" - echo " --arch-override= Force to arch instead of autodetect" - echo " --cachedir= Override the default cache location" -@@ -232,6 +237,30 @@ parse_cmdline() { - CMD_KEYMAP=0 - print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" - ;; -+ --udev) -+ CMD_UDEV=1 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --no-udev) -+ CMD_UDEV=0 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --lspci) -+ CMD_LSPCI=1 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --no-lspci) -+ CMD_LSPCI=0 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --nfsutils) -+ CMD_NFSUTILS=1 -+ print_info 2 "CMD_NFSUTILS: ${CMD_NFSUTILS}" -+ ;; -+ --no-nfsutils) -+ CMD_NFSUTILS=0 -+ print_info 2 "CMD_NFSUTILS: ${CMD_NFSUTILS}" -+ ;; - --lvm) - CMD_LVM=1 - print_info 2 "CMD_LVM: ${CMD_LVM}" -@@ -441,6 +470,10 @@ parse_cmdline() { - print_info 2 "USECOLOR: ${USECOLOR}" - setColorVars - ;; -+ --no-cleartmp) -+ NOCLEARTMP=1 -+ print_info 2 "NOCLEARTMP: ${NOCLEARTMP}" -+ ;; - --logfile=*) - CMD_LOGFILE=`parse_opt "$*"` - LOGFILE=`parse_opt "$*"` -diff --git gen_compile.sh gen_compile.sh -index 0758c3a..8a2339a 100755 ---- gen_compile.sh -+++ gen_compile.sh -@@ -407,7 +407,10 @@ compile_busybox() { - yes '' 2>/dev/null | compile_generic oldconfig utils - - print_info 1 'busybox: >> Compiling...' -+ OLDLOGLEVEL=$LOGLEVEL -+ LOGLEVEL=1 - compile_generic all utils -+ LOGLEVEL=$OLDLOGLEVEL - print_info 1 'busybox: >> Copying to cache...' - [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] || - gen_die 'Busybox executable does not exist!' -diff --git gen_determineargs.sh gen_determineargs.sh -index ce479cb..eb23120 100755 ---- gen_determineargs.sh -+++ gen_determineargs.sh -@@ -107,6 +107,9 @@ determine_real_args() { - set_config_with_override BOOL SYMLINK CMD_SYMLINK - set_config_with_override STRING INSTALL_MOD_PATH CMD_INSTALL_MOD_PATH - set_config_with_override BOOL OLDCONFIG CMD_OLDCONFIG -+ set_config_with_override BOOL UDEV CMD_UDEV -+ set_config_with_override BOOL LSPCI CMD_LSPCI -+ set_config_with_override BOOL NFSUTILS CMD_NFSUTILS - set_config_with_override BOOL LVM CMD_LVM - set_config_with_override BOOL DMRAID CMD_DMRAID - set_config_with_override BOOL ISCSI CMD_ISCSI -diff --git gen_initramfs.sh gen_initramfs.sh -index 7fe4421..2e936e9 100755 ---- gen_initramfs.sh -+++ gen_initramfs.sh -@@ -56,7 +56,13 @@ append_busybox() { - chmod +x "${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/default.script" - - # Set up a few default symlinks -- for i in ${BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}; do -+ if isTrue "${UDEV}" -+ then -+ BUSYBOX_APPLETS="${BUSYBOX_APPLETS:-[ ash sh uname echo cut cat}" -+ else -+ BUSYBOX_APPLETS="{$BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}" -+ fi -+ for i in ${BUSYBOX_APPLETS}; do - rm -f ${TEMP}/initramfs-busybox-temp/bin/$i > /dev/null - ln -s busybox ${TEMP}/initramfs-busybox-temp/bin/$i || - gen_die "Busybox error: could not link ${i}!" -@@ -410,7 +416,7 @@ append_firmware() { - IFS="," - for i in ${FIRMWARE_FILES} - do -- cp -L "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ -+ cp -rL "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ - done - IFS=$OLD_IFS - else -@@ -438,9 +444,76 @@ append_gpg() { - chmod a+x "${TEMP}/initramfs-gpg-temp/sbin/gpg" - cd "${TEMP}/initramfs-gpg-temp/" - find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" - rm -rf "${TEMP}/initramfs-gpg-temp" > /dev/null - } - -+append_udev() { -+ if [ -d "${TEMP}/initramfs-udev-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-udev-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-udev-temp/" -+ udevmod="${GK_SHARE}/modules/udev-rules/" -+ source ${udevmod}/module-setup.sh -+ initdir=${TEMP}/initramfs-udev-temp \ -+ moddir=${udevmod} \ -+ libdir=/lib/ \ -+ usrlibdir=/usr/lib/ \ -+ install_module -+ -+ if isTrue $LSPCI -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ fi -+ if isTrue $NFSUTILS -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /sbin/mount.nfs /etc/services /etc/protocols /etc/netconfig -+ fi -+ # find net modules and sound -+ (for pathname in ${INSTALL_MOD_PATH}/lib/modules/${KV}/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/drivers/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/sound -+ do -+ [[ -d $pathname ]] && find $pathname -name "*.ko" -+ done | -+ while read module;do -+ # add them prefix blacklist -+ echo "blacklist `basename $module .ko`"; -+ # concat with ready blacklist.conf -+ done;cat "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf") | -+ # sort and rewrite blacklist.conf -+ sort | uniq > "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" -+ mv "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" \ -+ "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf" -+ -+ cd "${TEMP}/initramfs-udev-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-udev-temp" > /dev/null -+} -+ -+append_lspci() { -+ if [ -d "${TEMP}/initramfs-lspci-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-lspci-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-lspci-temp/" -+ -+ initdir=${TEMP}/initramfs-lspci-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ -+ cd "${TEMP}/initramfs-lspci-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-lspci-temp" > /dev/null -+} -+ - print_list() - { - local x -@@ -489,6 +562,11 @@ append_modules() { - print_list ${!group_modules} > "${TEMP}/initramfs-modules-${KV}-temp/etc/modules/${group}" - done - cd "${TEMP}/initramfs-modules-${KV}-temp/" -+ # remove sound and media -+ for x in `find . -type d -name media -o -type d -name sound` -+ do -+ rm -r "${x}" &>/dev/null -+ done - find . | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ - || gen_die "compressing modules cpio" - cd "${TEMP}" -@@ -561,11 +639,14 @@ append_auxilary() { - done - echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" - -- if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ if ! isTrue "${UDEV}" - then -- cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -- else -- cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ then -+ cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ else -+ cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ fi - fi - if isTrue $CMD_DOKEYMAPAUTO - then -@@ -582,7 +663,7 @@ append_auxilary() { - chmod +x "${TEMP}/initramfs-aux-temp/init" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" -- chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ isTrue "${UDEV}" || chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" - - if isTrue ${NETBOOT} - then -@@ -609,6 +690,21 @@ append_data() { - fi - } - -+pack_cpio() { -+ print_info 1 " >> Pack cpio data..." -+ if [ -d "${TEMP}/initramfs-repack-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-repack-temp" -+ fi -+ mkdir -p "${TEMP}/initramfs-repack-temp" -+ cd "${TEMP}/initramfs-repack-temp" -+ # unpack and pack cpio remove double files -+ cpio -di <${CPIO} 2>/dev/null -+ find . -print | cpio ${CPIO_ARGS} | gzip -9 >"${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-repack-temp" > /dev/null -+} -+ - create_initramfs() { - print_info 1 "initramfs: >> Initializing..." - -@@ -619,6 +715,11 @@ create_initramfs() { - - append_data 'base_layout' - append_data 'auxilary' "${BUSYBOX}" -+ append_data 'udev' "${UDEV}" -+ if ! isTrue "${UDEV}" -+ then -+ append_data 'lspci' "${LSPCI}" -+ fi - append_data 'busybox' "${BUSYBOX}" - append_data 'lvm' "${LVM}" - append_data 'dmraid' "${DMRAID}" -@@ -652,8 +753,7 @@ create_initramfs() { - append_data 'overlay' - fi - -- gzip -9 "${CPIO}" -- mv -f "${CPIO}.gz" "${CPIO}" -+ pack_cpio - - if isTrue "${INTEGRATED_INITRAMFS}" - then -diff --git genkernel genkernel -index 0a06cdd..1486c61 100755 ---- genkernel -+++ genkernel -@@ -9,6 +9,7 @@ GK_V='3.4.18' - TMPDIR='/var/tmp/genkernel' - - TODEBUGCACHE=1 # Until an error occurs or LOGFILE is fully qualified. -+NOCLEARTMP=0 - - small_die() { - echo $1 -@@ -45,6 +46,7 @@ source ${GK_SHARE}/gen_initramfs.sh || gen_die "Could not read ${GK_SHARE}/gen_i - source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_moddeps.sh" - source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh" - source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh" -+source ${GK_SHARE}/dracut_funcs.sh || gen_die "Could not read ${GK_SHARE}/dracut_funcs.sh" - - TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ - -@@ -55,21 +57,25 @@ trap_cleanup(){ - } - - cleanup(){ -- if [ -n "$TEMP" -a -d "$TEMP" ]; then -- rm -rf "$TEMP" -- fi -- -- if isTrue ${POSTCLEAR} -- then -- echo -- print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -- print_info 1 "CACHE_DIR: ${CACHE_DIR}" -- CLEAR_CACHE_DIR='yes' -- setup_cache_dir -- echo -- print_info 1 "TMPDIR: ${TMPDIR}" -- clear_tmpdir -- fi -+ if [[ ${NOCLEARTMP} -ne 0 ]] -+ then -+ return -+ fi -+ if [ -n "$TEMP" -a -d "$TEMP" ]; then -+ rm -rf "$TEMP" &>/dev/null -+ fi -+ -+ if isTrue ${POSTCLEAR} -+ then -+ echo -+ print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -+ print_info 1 "CACHE_DIR: ${CACHE_DIR}" -+ CLEAR_CACHE_DIR='yes' -+ setup_cache_dir -+ echo -+ print_info 1 "TMPDIR: ${TMPDIR}" -+ clear_tmpdir -+ fi - } - - trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL -diff --git genkernel.conf genkernel.conf -index 24fcd54..b61f1fa 100644 ---- genkernel.conf -+++ genkernel.conf -@@ -52,6 +52,15 @@ USECOLOR="yes" - # argument is: *+1 - # MAKEOPTS="-j2" - -+# Add udev to initramfs -+UDEV="yes" -+ -+# Add lspci to initramfs -+LSPCI="yes" -+ -+# add ntfs-utils to initramfs -+NFSUTILS="yes" -+ - # Add in LVM support from static binaries if they exist on the system, or - # compile static LVM binaries if static ones do not exist. - # LVM="no" -@@ -92,7 +101,7 @@ USECOLOR="yes" - # Specify directory to pull from - # FIRMWARE_DIR="/lib/firmware" - # Specify specific firmware files to include. This overrides FIRMWARE_DIR --# FIRMWARE_FILES="" -+FIRMWARE_FILES="/lib/firmware/radeon" - - # Enable disklabel support (copies blkid to initrd) - DISKLABEL="yes" -diff --git modules/udev-rules/01-ignore.rules modules/udev-rules/01-ignore.rules -new file mode 100644 -index 0000000..b32f22e ---- /dev/null -+++ modules/udev-rules/01-ignore.rules -@@ -0,0 +1 @@ -+KERNEL=="ram[0-9]*", OPTIONS+="ignore_device", OPTIONS+="last_rule" -diff --git modules/udev-rules/59-persistent-storage-volid.rules modules/udev-rules/59-persistent-storage-volid.rules -new file mode 100644 -index 0000000..0b798e6 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage-volid.rules -@@ -0,0 +1,7 @@ -+SUBSYSTEM!="block", GOTO="psv_end" -+ACTION!="add|change", GOTO="psv_end" -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="cciss[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", IMPORT{program}="vol_id --export $tempnode" -+LABEL="psv_end" -diff --git modules/udev-rules/59-persistent-storage.rules modules/udev-rules/59-persistent-storage.rules -new file mode 100644 -index 0000000..2b83e72 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage.rules -@@ -0,0 +1,38 @@ -+SUBSYSTEM!="block", GOTO="ps_end" -+ACTION!="add|change", GOTO="ps_end" -+ -+KERNEL=="cciss[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end" -+ -+# partitions have no md/{array_state,metadata_version} -+ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" -+ -+# container devices have a metadata version of e.g. 'external:ddf' and -+# never leave state 'inactive' -+ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -+TEST!="md/array_state", GOTO="md_end" -+ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -+ -+LABEL="md_ignore_state" -+ -+IMPORT{program}="/sbin/mdadm --detail --export $tempnode" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+OPTIONS+="link_priority=100" -+OPTIONS+="watch" -+LABEL="md_end" -+ -+ -+KERNEL!="dm-[0-9]*", GOTO="ps_end" -+ACTION=="add", GOTO="ps_end" -+IMPORT{program}="/sbin/dmsetup info -c --nameprefixes --unquoted --rows --noheadings -o name,uuid,suspended,readonly,major,minor,open,tables_loaded,names_using_dev -j%M -m%m" -+ENV{DM_NAME}!="?*", GOTO="ps_end" -+ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="ps_end" -+ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="ps_end" -+ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="ps_end" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+LABEL="ps_end" -diff --git modules/udev-rules/61-persistent-storage.rules modules/udev-rules/61-persistent-storage.rules -new file mode 100644 -index 0000000..9cfdb0b ---- /dev/null -+++ modules/udev-rules/61-persistent-storage.rules -@@ -0,0 +1,20 @@ -+SUBSYSTEM!="block", GOTO="pss_end" -+ACTION!="add|change", GOTO="pss_end" -+ -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss" -+KERNEL=="cciss[0-9]*", GOTO="do_pss" -+KERNEL=="nbd[0-9]*", GOTO="do_pss" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", GOTO="do_pss" -+ -+GOTO="pss_end" -+ -+LABEL="do_pss" -+# by-path (parent device path) -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{program}="path_id %p" -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" -+ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" -+ -+# by-label/by-uuid links (filesystem metadata) -+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -+LABEL="pss_end" -diff --git modules/udev-rules/blacklist.conf modules/udev-rules/blacklist.conf -new file mode 100644 -index 0000000..21ac71c ---- /dev/null -+++ modules/udev-rules/blacklist.conf -@@ -0,0 +1,162 @@ -+blacklist ath_pci -+blacklist evbug -+blacklist usbmouse -+blacklist usbkbd -+blacklist eepro100 -+blacklist de4x5 -+blacklist eth1394 -+blacklist snd_intel8x0m -+blacklist snd_aw2 -+blacklist i2c_i801 -+blacklist prism54 -+blacklist bcm43xx -+blacklist garmin_gps -+blacklist asus_acpi -+blacklist snd_pcsp -+blacklist pcspkr -+blacklist amd76x_edac -+blacklist ohci1394 -+blacklist sbp2 -+blacklist dv1394 -+blacklist raw1394 -+blacklist video1394 -+blacklist aty128fb -+blacklist atyfb -+blacklist radeonfb -+blacklist cirrusfb -+blacklist cyber2000fb -+blacklist cyblafb -+blacklist gx1fb -+blacklist hgafb -+blacklist i810fb -+blacklist intelfb -+blacklist kyrofb -+blacklist lxfb -+blacklist matroxfb_base -+blacklist neofb -+blacklist nvidiafb -+blacklist pm2fb -+blacklist rivafb -+blacklist s1d13xxxfb -+blacklist savagefb -+blacklist sisfb -+blacklist sstfb -+blacklist tdfxfb -+blacklist tridentfb -+blacklist vesafb -+blacklist vfb -+blacklist viafb -+blacklist vt8623fb -+blacklist ac97 -+blacklist ac97_codec -+blacklist ac97_plugin_ad1980 -+blacklist ad1848 -+blacklist ad1889 -+blacklist adlib_card -+blacklist aedsp16 -+blacklist ali5455 -+blacklist btaudio -+blacklist cmpci -+blacklist cs4232 -+blacklist cs4281 -+blacklist cs461x -+blacklist cs46xx -+blacklist emu10k1 -+blacklist es1370 -+blacklist es1371 -+blacklist esssolo1 -+blacklist forte -+blacklist gus -+blacklist i810_audio -+blacklist kahlua -+blacklist mad16 -+blacklist maestro -+blacklist maestro3 -+blacklist maui -+blacklist mpu401 -+blacklist nm256_audio -+blacklist opl3 -+blacklist opl3sa -+blacklist opl3sa2 -+blacklist pas2 -+blacklist pss -+blacklist rme96xx -+blacklist sb -+blacklist sb_lib -+blacklist sgalaxy -+blacklist sonicvibes -+blacklist sound -+blacklist sscape -+blacklist trident -+blacklist trix -+blacklist uart401 -+blacklist uart6850 -+blacklist via82cxxx_audio -+blacklist v_midi -+blacklist wavefront -+blacklist ymfpci -+blacklist ac97_plugin_wm97xx -+blacklist ad1816 -+blacklist audio -+blacklist awe_wave -+blacklist dmasound_core -+blacklist dmasound_pmac -+blacklist harmony -+blacklist sequencer -+blacklist soundcard -+blacklist usb-midi -+blacklist acquirewdt -+blacklist advantechwdt -+blacklist alim1535_wdt -+blacklist alim7101_wdt -+blacklist booke_wdt -+blacklist cpu5wdt -+blacklist eurotechwdt -+blacklist i6300esb -+blacklist i8xx_tco -+blacklist ib700wdt -+blacklist ibmasr -+blacklist indydog -+blacklist iTCO_wdt -+blacklist it8712f_wdt -+blacklist it87_wdt -+blacklist ixp2000_wdt -+blacklist ixp4xx_wdt -+blacklist machzwd -+blacklist mixcomwd -+blacklist mpc8xx_wdt -+blacklist mpcore_wdt -+blacklist mv64x60_wdt -+blacklist pc87413_wdt -+blacklist pcwd -+blacklist pcwd_pci -+blacklist pcwd_usb -+blacklist s3c2410_wdt -+blacklist sa1100_wdt -+blacklist sbc60xxwdt -+blacklist sbc7240_wdt -+blacklist sb8360 -+blacklist sc1200wdt -+blacklist sc520_wdt -+blacklist sch311_wdt -+blacklist scx200_wdt -+blacklist shwdt -+blacklist smsc37b787_wdt -+blacklist softdog -+blacklist twl4030_wdt -+blacklist w83627hf_wdt -+blacklist w83697hf_wdt -+blacklist w83697ug_wdt -+blacklist w83877f_wdt -+blacklist w83977f_wdt -+blacklist wafer5823wdt -+blacklist wdt -+blacklist wdt_pci -+blacklist wm8350_wdt -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -diff --git modules/udev-rules/load-modules.sh modules/udev-rules/load-modules.sh -new file mode 100755 -index 0000000..36972fd ---- /dev/null -+++ modules/udev-rules/load-modules.sh -@@ -0,0 +1,7 @@ -+#!/bin/sh -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+# Implement blacklisting for udev-loaded modules -+ -+modprobe -b "$@" -diff --git modules/udev-rules/module-setup.sh modules/udev-rules/module-setup.sh -new file mode 100755 -index 0000000..93c01f4 ---- /dev/null -+++ modules/udev-rules/module-setup.sh -@@ -0,0 +1,65 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+install_module() { -+ # FIXME: would be nice if we didn't have to know which rules to grab.... -+ # ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies -+ # of the rules we want so that we just copy those in would be best -+ [[ -x /sbin/udevd ]] && dracut_install udevd -+ dracut_install udevadm /etc/udev/udev.conf /etc/group /bin/mount /sbin/modprobe -+ inst_rules 50-udev-default.rules 60-persistent-storage.rules \ -+ 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \ -+ 60-pcmcia.rules -+ mkdir -p "$initdir"/etc/modprobe.d -+ inst_simple "$moddir/blacklist.conf" /etc/modprobe.d/ -+ -+ # ignore some devices in the initrd -+ inst_rules "$moddir/01-ignore.rules" -+ -+ # for firmware loading -+ inst_rules 50-firmware.rules -+ -+ if [ ! -x /lib/udev/vol_id ]; then -+ inst_rules "$moddir/59-persistent-storage.rules" -+ else -+ inst_rules "$moddir/59-persistent-storage-volid.rules" -+ fi -+ inst_rules "$moddir/61-persistent-storage.rules" -+ -+ for i in \ -+ ata_id \ -+ cdrom_id \ -+ create_floppy_devices \ -+ edd_id \ -+ firmware.sh \ -+ firmware \ -+ firmware.agent \ -+ hotplug.functions \ -+ fw_unit_symlinks.sh \ -+ hid2hci \ -+ path_id \ -+ scsi_id \ -+ usb_id \ -+ vol_id \ -+ pcmcia-socket-startup \ -+ pcmcia-check-broken-cis \ -+ udevd \ -+ ; do -+ for utilpath in /lib/udev /sbin /bin -+ do -+ [ -e $utilpath/$i ] && dracut_install $utilpath/$i -+ done -+ done -+ -+ if ! [ -e "$initdir/sbin/udevd" ]; then -+ if [ -x /lib/udev/udevd ]; then -+ ln -s /lib/udev/udevd "$initdir/sbin/udevd" -+ fi -+ fi -+ -+ for i in {"$libdir","$usrlibdir"}/libnss_files*; do -+ [ -e "$i" ] && dracut_install "$i" -+ done -+} -+ diff --git a/sys-kernel/calckernel/files/calckernel-3.4.18-r11.patch b/sys-kernel/calckernel/files/calckernel-3.4.18-r11.patch deleted file mode 100644 index 1033c94a1..000000000 --- a/sys-kernel/calckernel/files/calckernel-3.4.18-r11.patch +++ /dev/null @@ -1,2191 +0,0 @@ -diff --git defaults/busy-config defaults/busy-config -index 51fdc8e..a1f6858 100644 ---- defaults/busy-config -+++ defaults/busy-config -@@ -462,7 +462,7 @@ CONFIG_MDSTART=y - CONFIG_MORE=y - CONFIG_FEATURE_USE_TERMIOS=y - CONFIG_MOUNT=y --CONFIG_FEATURE_MOUNT_NFS=y -+CONFIG_FEATURE_MOUNT_NFS=n - # CONFIG_FEATURE_MOUNT_CIFS is not set - CONFIG_FEATURE_MOUNT_FLAGS=y - CONFIG_FEATURE_MOUNT_FSTAB=y -diff --git defaults/initrd.defaults defaults/initrd.defaults -index 76d72a7..0c059a5 100755 ---- defaults/initrd.defaults -+++ defaults/initrd.defaults -@@ -68,6 +68,7 @@ fi - - REAL_ROOT='' - CDROOT='0' -+SCRATCH='0' - CDROOT_DEV='' - CDROOT_TYPE='auto' - NEW_ROOT='/newroot' -diff --git defaults/initrd.scripts defaults/initrd.scripts -index 51ebcce..8007347 100755 ---- defaults/initrd.scripts -+++ defaults/initrd.scripts -@@ -187,23 +187,45 @@ cache_cd_contents() { - # TODO: Check the size of the image versus the size of our tmpfs - # along with the amount of available RAM and increase tmpfs size - # if necessary. (Not having awk sucks...) -- # z=0 -- # for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -- # cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; do -- # z=$(($z + $i)) ; done -- # echo $z -- good_msg "Copying loop file for caching..." -- # Verify that the needed directory exists -- mkdir -p "$(dirname ${NEW_ROOT}/mnt/${LOOP})" -- cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/${LOOP} -- if [ $? -ne 0 ] -+ -+ # getting memory -+ allmemory=0 -+ for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -+ cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; -+ do -+ allmemory=$(($allmemory + $i)) -+ done -+ -+ # getting size tmpfs of default -+ let curtfs=$allmemory/2 -+ -+ # getting size of image -+ let imagesize=`ls -la ${NEW_ROOT}/mnt/cdrom/${LOOP} | sed -r -n 's/(\S*\s*){4}(\S*).*/\2/p'`/20000*21 -+ let addon=$imagesize/10 -+ if [[ $curtfs -gt $(( ${imagesize} + ${addon} )) ]]; -+ then -+ let addon=$(( $curtfs - ${imagesize} )) -+ fi -+ -+ if [[ $((${imagesize} + $addon)) -lt ${allmemory} ]]; - then -- bad_msg "Failed to cache the loop file! Lack of space?" -- rm -rf ${NEW_ROOT}/mnt/livecd.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/image.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/zisofs 2>/dev/null -+ mount -o remount,size=${addon}000 -t tmpfs tmpfs ${NEW_ROOT} -+ mkdir ${NEW_ROOT}/mnt/squash -+ mount -o size=${imagesize}000 -t tmpfs tmpfs ${NEW_ROOT}/mnt/squash -+ good_msg "Copying loop file for caching..." -+ cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/squash/${LOOP} -+ if [ $? -ne 0 ] -+ then -+ bad_msg "Failed to cache the loop file! Lack of space?" -+ umount ${NEW_ROOT}/mnt/squash -+ mount -o remount,size=${curtfs}000 -t tmpfs tmpfs ${NEW_ROOT} -+ else -+ LOOPEXT='../squash/' -+ good_msg "Unmounting media from ${NEW_ROOT}/mnt/cdrom" -+ umount ${NEW_ROOT}/mnt/cdrom -+ fi - else -- LOOPEXT='../' -+ bad_msg "Too low memory for cache the loop file." - fi - fi - fi -@@ -306,7 +328,9 @@ run_shell() { - /bin/ash - } - --runmdev() { -+make_devfs() { -+ # make /run in root -+ mkdir /run - # Use devtmpfs if enabled in kernel, - # else tmpfs. Always run mdev just in case - devfs=tmpfs -@@ -321,6 +345,10 @@ runmdev() { - # http://git.busybox.net/busybox/plain/docs/mdev.txt - mkdir -m 0755 /dev/pts - mount -t devpts -o gid=5,mode=0620 devpts /dev/pts || bad_msg "Failed to mount /dev/pts" -+} -+ -+runmdev() { -+ make_devfs - mdev -s || bad_msg "Failed to receive dynamic updates from mdev" - } - -@@ -655,7 +683,7 @@ startVolumes() { - [ -d /etc/lvm/cache ] && lvm_commands="${lvm_commands} \nvgscan" - - # To activate volumegroups on all devices in the cache -- lvm_commands="${lvm_commands} \nvgchange -ay --sysinit" -+ lvm_commands="${lvm_commands} \nvgchange -ay --sysinit --noudevsync" - - # And finally execute it all (/proc/... needed if lvm is compiled without readline) - good_msg "Scanning for and activating Volume Groups" -@@ -1082,6 +1110,38 @@ getdvhoff() { - echo $(( $(hexdump -n 4 -s $((316 + 12 * $2)) -e '"%i"' $1) * 512)) - } - -+load_union_module() { -+ UNIONTYPE="" -+ # find module for union file system -+ [ -n "$(find /lib/ -name unionfs.ko)" ] && UNIONTYPE="unionfs" -+ [ -n "$(find /lib/ -name aufs.ko)" ] && UNIONTYPE="aufs" -+ # probably aufs in kernel -+ if [ -n "$(gzip -dc /proc/config.gz | grep CONFIG_AUFS_FS=y )" ] -+ then -+ UNIONTYPE="aufs" -+ else -+ if [ -z "${UNIONTYPE}" ] -+ then -+ bad_msg "Module for union file system is not found!" -+ run_shell -+ else -+ modprobe ${UNIONTYPE} > /dev/null 2>&1 -+ # error on load union module -+ if [ -z "$(lsmod | grep $UNIONTYPE)" ] -+ then -+ bad_msg "Module for union file system is not correct!" -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ bad_msg "Probably kernel compiled without standalone patch." -+ fi -+ run_shell -+ fi -+ -+ good_msg "Loading ${UNIONTYPE}" -+ fi -+ fi -+} -+ - setup_unionfs() { - local rw_dir=$1 - local ro_dir=$2 -@@ -1101,6 +1161,7 @@ setup_unionfs() { - mkdir -p ${UNION} - good_msg "Loading fuse module" - modprobe fuse > /dev/null 2>&1 -+ load_union_module - # if [ -n "${UNIONFS}" ] - # then - # CHANGESDEV=${UNIONFS} -@@ -1130,11 +1191,117 @@ setup_unionfs() { - mkdir /tmp - mkdir -p ${UNION} - # mkdir -p $CHANGES --# mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+## mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+ -+ if [ "${SCRATCH}" -ne 0 ]; -+ then -+ good_msg "Loading in scratch mode" -+ BUILDERDIR=${UNION}/mnt/builder -+ SCRATCHDIR=${UNION}/mnt/scratch -+ DELTADIR=${rw_dir}/mnt/delta -+ WORKSPACEDIR=${rw_dir}/mnt/workspace -+ mount -o remount,rw ${rw_dir}/mnt/cdrom >/dev/null 2>&1 -+ touch ${rw_dir}/mnt/cdrom/livecd >/dev/null 2>&1 -+ if [ "$?" -ne 0 ]; -+ then -+ ISRW=0 -+ else -+ ISRW=1 -+ fi -+ -+ mkdir -p ${DELTADIR} -+ mkdir -p ${WORKSPACEDIR} -+ -+ if [[ -n ${CDROOT_OVERLAY} ]] && [[ -f ${rw_dir}/mnt/cdrom/${CDROOT_OVERLAY} ]] -+ then -+ good_msg "Unpacking ${CDROOT_OVERLAY}" -+ cd ${DELTADIR} -+ tar xf ${rw_dir}/mnt/cdrom/${CDROOT_OVERLAY} -+ fi -+ -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${WORKSPACEDIR}=rw:${DELTADIR}=ro+wh:${rw_dir}/mnt/livecd=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${WORKSPACEDIR}=rw:${DELTADIR}=ro:${rw_dir}/mnt/livecd=ro unionfs ${UNION} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${SCRATCHDIR}/calculate -+ mkdir -p ${SCRATCHDIR}/delta -+ mkdir -p ${SCRATCHDIR}/workspace -+ mount -o bind ${rw_dir}/mnt/delta ${SCRATCHDIR}/delta -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind ${rw_dir}/mnt/workspace ${SCRATCHDIR}/workspace -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${BUILDERDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro none ${BUILDERDIR} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro unionfs ${BUILDERDIR} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind,ro ${rw_dir}/mnt/livecd ${SCRATCHDIR}/calculate -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ if [ "$ISRW" -ne 0 ]; -+ then -+ FLASHDIR=${UNION}/mnt/flash -+ mkdir -p ${FLASHDIR} -+ mount -o bind ${rw_dir}/mnt/cdrom ${FLASHDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ mkdir -p ${CDROMDIR} -+ mount -o bind,ro ${rw_dir}/mnt/cdrom ${CDROMDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ fi -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ LIVECDDIR=${UNION}/mnt/livecd -+ -+ if [[ -n ${CDROOT_OVERLAY} ]] && [[ -f ${rw_dir}/mnt/cdrom/${CDROOT_OVERLAY} ]] -+ then -+ good_msg "Unpacking ${CDROOT_OVERLAY}" -+ cd ${rw_dir} -+ tar xf ${rw_dir}/mnt/cdrom/${CDROOT_OVERLAY} -+ fi -+ -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${rw_dir}:${ro_dir}=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${rw_dir}:${ro_dir}=ro unionfs ${UNION} -+ fi -+ -+ if [[ -n "$( echo ${LOOPEXT} | grep squash )" ]]; -+ then -+ mkdir -p ${UNION}/mnt/squash -+ mount -o bind ${NEW_ROOT}/mnt/squash ${UNION}/mnt/squash &>/dev/null -+ fi -+ -+ chmod 0755 ${UNION} -+ mount -o bind ${rw_dir}/mnt/cdrom ${CDROMDIR} &>/dev/null -+ mount -o bind ${rw_dir}/mnt/livecd ${LIVECDDIR} &>/dev/null -+ ret=$? -+ fi -+ -+ chmod 1777 ${UNION}/tmp - good_msg "Creating union mount" -- unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -- ret=$? -- if [ ${ret} -ne 0 ] -+# unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -+# ret=$? -+ if [ "${ret}" -ne 0 ] - then - bad_msg "Can't setup union mount!" - USE_UNIONFS_NORMAL=0 -@@ -1143,3 +1310,122 @@ setup_unionfs() { - USE_UNIONFS_NORMAL=0 - fi - } -+ -+load_videodrv() { -+ good_msg "Loading frame buffer video driver" -+ # find all available fb drivers -+ videodrv_count=$(find /lib/modules \ -+ -name "nouveau.ko" -o \ -+ -name "uvesafb.ko" -o \ -+ -name "i915.ko" -o \ -+ -name "radeon.ko" | -+ grep -c "") -+ # load specified videodrv -+ modules_list= -+ case "${VIDEODRV}" in -+ nouveau) -+ modules_list="nouveau" -+ ;; -+ radeon) -+ modules_list="radeon" -+ ;; -+ i915|intel) -+ modules_list="i915" -+ ;; -+ ""|auto) -+ # if not livecd and initramfs otimized (aviailable only one video driver) -+ if [ "${CDROOT}" != '1' -a "${videodrv_count}" -le 2 ] -+ then -+ modules_list="nouveau i915 radeon" -+ else -+ if [[ -x /usr/sbin/lspci ]] -+ then -+ if lspci | grep -m1 VGA | grep -qi intel -+ then -+ modules_list="i915" -+ elif lspci | grep -m1 VGA | grep -qi nvidia -+ then -+ modules_list="nouveau" -+ elif lspci | grep -m1 VGA | grep -q -e "Ati" -e "ATI" -+ then -+ modules_list="radeon" -+ else -+ modules_list="" -+ fi -+ else -+ modules_list="i915" -+ fi -+ fi -+ ;; -+ esac -+ for x in $modules_list -+ do -+ if [ "`find /lib/modules -name "${x}.ko" | grep -c ''`" -eq "1" ] -+ then -+ modprobe "${x}" modeset=${USE_MODESET} &>/dev/null -+ lsmod | grep -q "^${x}" && \ -+ [ "`cat /sys/module/${x}/refcnt`" -gt 0 ] && return 0 -+ fi -+ done -+ # else load uvesafb with specified video resolution -+ if [ -n "${VIDEORES}" ] -+ then -+ if ! echo $VIDEORES | grep -q "\-" -+ then -+ VIDEORES="${VIDEORES}-32" -+ fi -+ else -+ VIDEORES="1024x768-32" -+ fi -+ modprobe uvesafb mode_option=${VIDEORES} &>/dev/null -+} -+ -+start_udev() -+{ -+ # start udev -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ echo "" >/proc/sys/kernel/hotplug -+ make_devfs -+ udevd --daemon &>/dev/null -+ udevadm settle -+ fi -+} -+ -+stop_udev() -+{ -+ # kill udevd -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ pkill udevd &>/dev/null -+ fi -+} -+ -+populate_dev() -+{ -+ good_msg 'Activating udev' -+ # Do not run any init-scripts -+ udevadm control --property=do_not_run_plug_service=1 -+ -+ if [ "${REAL_ROOT}" == "/dev/nfs" ] -+ then -+ # clean blacklist because there are net drivers -+ # keep black video for correct loading prop. nvidia -+ cat </etc/modprobe.d/blacklist.conf -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -+EOF -+ fi -+ # discarding net drivers placed into blacklist.conf -+ udevadm trigger --action="add" -+ -+ # we can speed up booting under these conditions: -+ # * using devtmpfs so kernel creates device nodes for us -+ # * only using kernel created device nodes at boot (in /etc/fstab and elsewhere) -+ udevadm settle --timeout=60 -+} -diff --git defaults/linuxrc defaults/linuxrc -index 0843f5d..687f5cc 100755 ---- defaults/linuxrc -+++ defaults/linuxrc -@@ -39,6 +39,14 @@ FAKE_ROOT='' - REAL_ROOTFLAGS='' - ROOTFSTYPE='auto' - CRYPT_SILENT=0 -+VIDEODRV='' -+USE_UDEV=1 -+USE_MODESET=1 -+CDROOT_OVERLAY='cdroot-overlay.tar.bz2' -+if [ -e "/etc/calculate/calculate.ini" ] -+then -+ source /etc/calculate/calculate.ini -+fi - for x in ${CMDLINE} - do - case "${x}" in -@@ -57,6 +65,57 @@ do - init_opts\=*) - INIT_OPTS=`parse_opt "${x}"` - ;; -+ nokms) -+ USE_MODESET=0 -+ ;; -+ kms) -+ USE_MODESET=1 -+ ;; -+ noudev) -+ USE_UDEV=0 -+ ;; -+ calculate\=*) -+ CALCULATE=`parse_opt "${x}"` -+ if [[ "${CALCULATE//:/}" != "${CALCULATE}" ]] -+ then -+ for i in ${CALCULATE//,/ } -+ do -+ case "${i}" in -+ video:*) -+ VIDEODRV=`echo "${i}" | cut -s -d: -f2-` -+ ;; -+ resolution:*) -+ RES=`echo "${i}" | cut -s -d: -f2-` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ ;; -+ esac -+ done -+ else -+ RES=`echo "${CALCULATE}" | cut -s -d, -f4` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ VIDEODRV=`echo "${CALCULATE}" | cut -s -d, -f5` -+ fi -+ ;; -+ video\=*) -+ VR=`parse_opt "${x}"` -+ for i in ${VR//,/ } -+ do -+ if [ -z "${i//[0-9-x@]}" ] -+ then -+ VIDEORES=${i} -+ fi -+ done -+ ;; -+ # Scratch usbload -+ scratch) -+ SCRATCH=1 -+ ;; - # Livecd options - cdroot) - CDROOT=1 -@@ -79,6 +138,9 @@ do - ISOBOOT=`parse_opt "${x}"` - ;; - # Start Volume manager options -+ overlay\=*) -+ CDROOT_OVERLAY=`parse_opt "${x}"` -+ ;; - dolvm) - USE_LVM_NORMAL=1 - ;; -@@ -251,15 +313,24 @@ then - REAL_ROOT="${FAKE_ROOT}" - fi - --splash 'init' -- --cmdline_hwopts -+# check udevd -+[ ! -x /sbin/udevd ] && USE_UDEV=0 - - # Mount sysfs - mount_sysfs - -+# start udev -+start_udev -+ -+# load kernel video driver -+load_videodrv -+ -+splash 'init' -+ -+cmdline_hwopts -+ - # Setup hotplugging for firmware loading --setup_hotplug -+[ "${USE_UDEV}" == "0" ] && setup_hotplug - - # Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel - if [ -z "${DO_modules}" ] -@@ -269,7 +340,7 @@ elif [ -d "/lib/modules/${KV}" ] - then - good_msg 'Loading modules' - # Load appropriate kernel modules -- if [ "${NODETECT}" != '1' ] -+ if [ "${USE_UDEV}" != '1' -a "${NODETECT}" != '1' ] - then - for modules in ${MY_HWOPTS} - do -@@ -285,14 +356,20 @@ fi - # Apply scan delay if specified - sdelay - --# Setup slow USB bits --setup_slowusb -+if [ "${USE_UDEV}" == "1" ] -+then -+ # populate /dev with devices already found by the kernel -+ populate_dev -+else -+ # Setup slow USB bits -+ setup_slowusb - --# Start device manager --start_dev_mgr -+ # Start device manager -+ start_dev_mgr - --# if doslowusb is passed, pause other 10 seconds here, after mdev load --[ "${DO_slowusb}" ] && sleep 10 -+ # if doslowusb is passed, pause other 10 seconds here, after mdev load -+ [ "${DO_slowusb}" ] && sleep 10 -+fi - - # Start iSCSI - if [ -e /bin/iscsistart ] -@@ -509,9 +586,50 @@ do - then - break - else -- bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -- got_good_root=0 -- REAL_ROOT='' -+ # check for scratch -+ if [ -e ${NEW_ROOT}/livecd.squashfs -a -d ${NEW_ROOT}/delta -a -d ${NEW_ROOT}/workspace ]; -+ then -+ good_msg 'Found scratch data...' -+ load_union_module -+ modprobe squashfs >/dev/null -+ if mount -o remount,rw ${NEW_ROOT}; -+ then -+ mkdir -p ${NEW_ROOT}/calculate && mkdir -p /union && mkdir -p ${NEW_ROOT}/workspace/mnt/builder && mkdir -p ${NEW_ROOT}/workspace/mnt/scratch -+ if mount -o loop,ro -t squashfs ${NEW_ROOT}/livecd.squashfs ${NEW_ROOT}/calculate; -+ then -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/workspace=rw:${NEW_ROOT}/delta=ro+wh:${NEW_ROOT}/calculate=ro none /union; -+ then -+ mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/delta=rw:${NEW_ROOT}/calculate=ro none /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers!' -+ run_shell -+ fi -+ else -+ if mount -t unionfs -o ro,dirs=${NEW_ROOT}/workspace:${NEW_ROOT}/delta=ro:${NEW_ROOT}/calculate=ro unionfs /union; -+ then -+ mount -t unionfs -o ro,dirs=${NEW_ROOT}/delta:${NEW_ROOT}/calculate=ro unionfs /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers' -+ run_shell -+ fi -+ fi -+ else -+ bad_msg 'Could not mount scratch squashfs image' -+ fi -+ else -+ bad_msg 'Could not remount ${NEW_ROOT}' -+ fi -+ else -+ bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -+ got_good_root=0 -+ REAL_ROOT='' -+ fi - fi - else - bad_msg "Could not mount specified ROOT, try again" -@@ -723,9 +841,12 @@ cd "${CHROOT}" - mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null - echo -ne "${BOLD}.${NORMAL}" - -+# stop udev before move mount points -+stop_udev -+ - # If devtmpfs is mounted, try move it to the new root - # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise --for fs in /dev /sys /proc -+for fs in "/dev " /sys /proc - do - if grep -qs "$fs" /proc/mounts - then -diff --git defaults/modprobe defaults/modprobe -index ba2d890..9280357 100755 ---- defaults/modprobe -+++ defaults/modprobe -@@ -10,8 +10,6 @@ usage() { - echo - echo 'Example:' - echo ' modprobe eepro100' -- echo -- echo 'Note: Do not pass the suffix to modprobe!' - exit 1 - } - -@@ -81,14 +79,29 @@ modprobe2() { - usage - exit 1 - fi -- real_path=`real_mod_path ${1}` -+ local modname=${1} -+ local quiet='' -+ local params='' -+ shift -+ for x in $@ -+ do -+ case ${x} in -+ -n) -+ quiet=1 -+ ;; -+ *) -+ params="${params} ${x}" -+ ;; -+ esac -+ done -+ real_path=`real_mod_path ${modname}` - if [ "${real_path}" = '' -o "${real_path}" = ' ' ] - then -- [ "${2}" = '-n' ] && echo -n " -> $1" -+ [ "${quiet}" = '1' ] && echo -n " -> ${modname}" - echo ' module not found.' - exit 2 - fi -- modlist=`modules_dep_list ${1}` -+ modlist=`modules_dep_list ${modname}` - if [ "${modlist}" != '' -a "${modlist}" != ' ' ] - then - deps=`strip_mod_paths ${modlist}` -@@ -110,13 +123,13 @@ modprobe2() { - filler=1 - fi - done -- ${INSMOD} ${real_path} > /dev/null 2>&1 -+ ${INSMOD} ${real_path} ${params} > /dev/null 2>&1 - ret=$? - if [ ${ret} -eq 0 ] - then - echoAppend=' loaded.' -- [ "${2}" = '-n' ] && echoFlags='-n' && echoAppend=', ' -- echo ${echoFlags} "${1}${echoAppend}" -+ [ "${quiet}" = '1' ] && echoFlags='-n' && echoAppend=', ' -+ echo ${echoFlags} "${modname}${echoAppend}" - fi - return $ret - } -@@ -132,7 +145,7 @@ do - LOADED_MODULES="${LOADED_MODULES} ${x}" - done - --modprobe2 ${1} -+modprobe2 ${@} - modprobe_ret=$? - - [ -f '/modules.cache' ] && rm -f /modules.cache > /dev/null 2>&1 -diff --git dracut_funcs.sh dracut_funcs.sh -new file mode 100755 -index 0000000..e80a638 ---- /dev/null -+++ dracut_funcs.sh -@@ -0,0 +1,752 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+# -+# functions used by dracut and other tools. -+# -+# Copyright 2005-2009 Red Hat, Inc. All rights reserved. -+# -+# 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; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+# -+ -+IF_RTLD="" -+IF_dynamic="" -+ -+# Generic substring function. If $2 is in $1, return 0. -+strstr() { [[ $1 =~ $2 ]]; } -+ -+# Create all subdirectories for given path without creating the last element. -+# $1 = path -+mksubdirs() { mkdir -p ${1%/*}; } -+ -+# Version comparision function. Assumes Linux style version scheme. -+# $1 = version a -+# $2 = comparision op (gt, ge, eq, le, lt, ne) -+# $3 = version b -+vercmp() { -+ local n1=(${1//./ }) op=$2 n2=(${3//./ }) i res -+ -+ for ((i=0; ; i++)) -+ do -+ if [[ ! ${n1[i]}${n2[i]} ]]; then res=0 -+ elif ((${n1[i]:-0} > ${n2[i]:-0})); then res=1 -+ elif ((${n1[i]:-0} < ${n2[i]:-0})); then res=2 -+ else continue -+ fi -+ break -+ done -+ -+ case $op in -+ gt) ((res == 1));; -+ ge) ((res != 2));; -+ eq) ((res == 0));; -+ le) ((res != 1));; -+ lt) ((res == 2));; -+ ne) ((res != 0));; -+ esac -+} -+ -+is_func() { -+ [[ $(type -t $1) = "function" ]] -+} -+ -+# Log initrd creation. -+if ! [[ $dracutlogfile ]]; then -+ [[ $dracutbasedir = /usr/share/dracut ]] && \ -+ dracutlogfile=/var/log/dracut.log || \ -+ dracutlogfile=/tmp/dracut.log -+# [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log -+ if [[ -w $dracutlogfile ]]; then -+ >"$dracutlogfile" -+ fi -+fi -+ -+dwarning() { -+ echo "W: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "W: $@" >>"$dracutlogfile" -+} -+ -+dinfo() { -+ [[ $beverbose ]] && echo "I: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "I: $@" >>"$dracutlogfile" -+} -+ -+derror() { -+ echo "E: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile" -+} -+ -+# Function prints global variables in format name=value line by line. -+# $@ = list of global variables' name -+print_vars() { -+ local var value -+ -+ for var in $@ -+ do -+ value=$(eval echo \$$var) -+ [[ ${value} ]] && echo "${var}=\"${value}\"" -+ done -+} -+ -+get_fs_env() { -+ [[ $1 ]] || return -+ eval $(udevadm info --query=env --name=$1|egrep 'ID_FS_(TYPE|UUID)=') -+ [[ $ID_FS_TYPE ]] && return -+ -+ if [[ -x /lib/udev/vol_id ]]; then -+ eval $(/lib/udev/vol_id --export $1) -+ elif find_binary blkid >/dev/null; then -+ eval $(blkid -o udev $1) -+ else -+ return 1 -+ fi -+} -+ -+get_fs_type() ( -+ [[ $1 ]] || return -+ if [[ $1 != ${1#/dev/block/nfs:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs3:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs4:} ]]; then -+ echo "nfs" -+ return -+ fi -+ get_fs_env $1 || return -+ echo $ID_FS_TYPE -+) -+ -+get_fs_uuid() ( -+ get_fs_env $1 || return -+ echo $ID_FS_UUID -+) -+ -+# finds the major:minor of the block device backing the root filesystem. -+find_block_device() { -+ local x mpt majmin dev fs misc maj min -+ if [[ $use_fstab != yes ]]; then -+ while read x x majmin x mpt x x fs dev misc; do -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $fs = btrfs ]] && { -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ } -+ if [[ $mpt = $1 ]] && [[ ${majmin#0:} = $majmin ]]; then -+ echo $majmin; -+ return 0 # we have a winner! -+ fi -+ done < /proc/self/mountinfo -+ fi -+ # fall back to /etc/fstab -+ while read dev mpt fs misc; do -+ if [[ $mpt = $1 ]]; then -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $dev != ${dev#UUID=} ]] && dev=/dev/disk/by-uuid/${dev#UUID=} -+ [[ $dev != ${dev#LABEL=} ]] && dev=/dev/disk/by-label/${dev#LABEL=} -+ [[ -b $dev ]] || return 1 # oops, not a block device. -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ fi -+ done < /etc/fstab -+ return 1; -+} -+ -+find_root_block_device() { find_block_device /; } -+ -+# Walk all the slave relationships for a given block device. -+# Stop when our helper function returns success -+# $1 = function to call on every found block device -+# $2 = block device in major:minor format -+check_block_and_slaves() { -+ local x -+ [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. -+ "$1" $2 && return -+ check_vol_slaves "$@" && return 0 -+ if [[ -f /sys/dev/block/$2/../dev ]]; then -+ check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0 -+ fi -+ [[ -d /sys/dev/block/$2/slaves ]] || return 1 -+ for x in /sys/dev/block/$2/slaves/*/dev; do -+ [[ -f $x ]] || continue -+ check_block_and_slaves $1 $(cat "$x") && return 0 -+ done -+ return 1 -+} -+ -+get_numeric_dev() { -+ ls -lH "$1" | { read a b c d maj min rest; printf "%d:%d" ${maj%%,} $min;} -+} -+ -+# ugly workaround for the lvm design -+# There is no volume group device, -+# so, there are no slave devices for volume groups. -+# Logical volumes only have the slave devices they really live on, -+# but you cannot create the logical volume without the volume group. -+# And the volume group might be bigger than the devices the LV needs. -+check_vol_slaves() { -+ for i in /dev/mapper/*; do -+ lv=$(get_numeric_dev $i) -+ if [[ $lv = $2 ]]; then -+ vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null) -+ # strip space -+ vg=$(echo $vg) -+ if [[ $vg ]]; then -+ for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \ -+ do -+ check_block_and_slaves $1 $(get_numeric_dev $pv) \ -+ && return 0 -+ done -+ fi -+ fi -+ done -+ return 1 -+} -+ -+# Install a directory, keeping symlinks as on the original system. -+# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file" -+# will create ${initdir}/lib64, ${initdir}/lib64/file, -+# and a symlink ${initdir}/lib -> lib64. -+inst_dir() { -+ local dir="$1" -+ [[ -e ${initdir}$dir ]] && return 0 -+ -+ # iterate over parent directories -+ local file="" -+ local IFS="/" -+ for part in $dir; do -+ [[ $part ]] || continue -+ file="$file/$part" -+ [[ -e ${initdir}$file ]] && continue -+ -+ if [[ -L $file ]]; then -+ # create link as the original -+ local target=$(readlink "$file") -+ ln -sfn "$target" "${initdir}$file" || return 1 -+ # resolve relative path and recursively install destionation -+ [[ $target = ${target##*/} ]] && target="${file%/*}/$target" -+ inst_dir "$target" -+ else -+ # create directory -+ mkdir -p "${initdir}$file" || return 1 -+ fi -+ done -+} -+ -+# $1 = file to copy to ramdisk -+# $2 (optional) Name for the file on the ramdisk -+# Location of the image dir is assumed to be $initdir -+# We never overwrite the target if it exists. -+inst_simple() { -+ local src target -+ [[ -f $1 ]] || return 1 -+ src=$1 target="${2:-$1}" -+ if ! [[ -d ${initdir}$target ]]; then -+ [[ -e ${initdir}$target ]] && return 0 -+ inst_dir "${target%/*}" -+ fi -+ dinfo "Installing $src" -+ cp -pfL "$src" "${initdir}$target" -+} -+ -+# find symlinks linked to given library file -+# $1 = library file -+# Function searches for symlinks by stripping version numbers appended to -+# library filename, checks if it points to the same target and finally -+# prints the list of symlinks to stdout. -+# -+# Example: -+# rev_lib_symlinks libfoo.so.8.1 -+# output: libfoo.so.8 libfoo.so -+# (Only if libfoo.so.8 and libfoo.so exists on host system.) -+rev_lib_symlinks() { -+ [[ ! $1 ]] && return 0 -+ -+ local fn="$1" orig="$(readlink -f "$1")" links='' -+ -+ [[ ${fn} =~ .*\.so\..* ]] || return 1 -+ -+ until [[ ${fn##*.} == so ]]; do -+ fn="${fn%.*}" -+ [[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}" -+ done -+ -+ echo ${links} -+} -+ -+# Same as above, but specialized to handle dynamic libraries. -+# It handles making symlinks according to how the original library -+# is referenced. -+inst_library() { -+ local src=$1 dest=${2:-$1} lib reallib symlink -+ [[ -e $initdir$dest ]] && return 0 -+ if [[ -L $src ]]; then -+ reallib=$(readlink -f "$src") -+ lib=${src##*/} -+ inst_simple "$reallib" "$reallib" -+ inst_dir "${dest%/*}" -+ (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib") -+ else -+ inst_simple "$src" "$dest" -+ fi -+ -+ # Create additional symlinks. See rev_symlinks description. -+ for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do -+ [[ ! -e $initdir$symlink ]] && { -+ dinfo "Creating extra symlink: $symlink" -+ inst_symlink $symlink -+ } -+ done -+} -+ -+# find a binary. If we were not passed the full path directly, -+# search in the usual places to find the binary. -+find_binary() { -+ local binpath="/bin /sbin /usr/bin /usr/sbin" p -+ [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } -+ for p in $binpath; do -+ [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# Same as above, but specialized to install binary executables. -+# Install binary executable, and all shared library dependencies, if any. -+inst_binary() { -+ local bin target -+ bin=$(find_binary "$1") || return 1 -+ target=${2:-$bin} -+ inst_symlink $bin $target && return 0 -+ local LDSO NAME IO FILE ADDR I1 n f TLIBDIR -+ [[ -e $initdir$target ]] && return 0 -+ # I love bash! -+ LC_ALL=C ldd $bin 2>/dev/null | while read line; do -+ [[ $line = 'not a dynamic executable' ]] && return 1 -+ if [[ $line =~ not\ found ]]; then -+ derror "Missing a shared library required by $bin." -+ derror "Run \"ldd $bin\" to find out what it is." -+ derror "dracut cannot create an initrd." -+ exit 1 -+ fi -+ so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)' -+ [[ $line =~ $so_regex ]] || continue -+ FILE=${BASH_REMATCH[1]} -+ [[ -e ${initdir}$FILE ]] && continue -+ # see if we are loading an optimized version of a shared lib. -+ lib_regex='^(/lib[^/]*).*' -+ if [[ $FILE =~ $lib_regex ]]; then -+ TLIBDIR=${BASH_REMATCH[1]} -+ BASE=${FILE##*/} -+ # prefer nosegneg libs, then unoptimized ones. -+ for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do -+ [[ -e $f/$BASE ]] || continue -+ FILE=$f/$BASE -+ break -+ done -+ inst_library "$FILE" "$TLIBDIR/$BASE" -+ IF_dynamic=yes -+ continue -+ fi -+ inst_library "$FILE" -+ done -+ inst_simple "$bin" "$target" -+} -+ -+# same as above, except for shell scripts. -+# If your shell script does not start with shebang, it is not a shell script. -+inst_script() { -+ [[ -f $1 ]] || return 1 -+ local line -+ read -r -n 80 line <"$1" -+ # If debug is set, clean unprintable chars to prevent messing up the term -+ [[ $debug ]] && line=$(echo -n "$line" | tr -c -d '[:print:][:space:]') -+ shebang_regex='(#! *)(/[^ ]+).*' -+ [[ $line =~ $shebang_regex ]] || return 1 -+ inst "${BASH_REMATCH[2]}" && inst_simple "$@" -+} -+ -+# same as above, but specialized for symlinks -+inst_symlink() { -+ local src=$1 target=$initdir${2:-$1} realsrc -+ [[ -L $1 ]] || return 1 -+ [[ -L $target ]] && return 0 -+ realsrc=$(readlink -f "$src") -+ [[ $realsrc = ${realsrc##*/} ]] && realsrc=${src%/*}/$realsrc -+ inst "$realsrc" && mkdir -p "${target%/*}" && \ -+ ln -s "$realsrc" "$target" -+} -+ -+# find a udev rule in the usual places. -+find_rule() { -+ [[ -f $1 ]] && { echo "$1"; return 0; } -+ for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do -+ [[ -f $r/$1 ]] && { echo "$r/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# udev rules always get installed in the same place, so -+# create a function to install them to make life simpler. -+inst_rules() { -+ local target=/etc/udev/rules.d rule found -+ -+ inst_dir "/lib/udev/rules.d" -+ inst_dir "$target" -+ for rule in "$@"; do -+ found=$(find_rule "$rule") && \ -+ inst_simple "$found" "$target/${found##*/}" \ -+ || dinfo "Skipping udev rule: $rule" -+ done -+} -+ -+# general purpose installation function -+# Same args as above. -+inst() { -+ case $# in -+ 1) ;; -+ 2) [[ ! $initdir && -d $2 ]] && export initdir=$2 -+ [[ $initdir = $2 ]] && set $1;; -+ 3) [[ -z $initdir ]] && export initdir=$2 -+ set $1 $3;; -+ *) derror "inst only takes 1 or 2 or 3 arguments" -+ exit 1;; -+ esac -+ for x in inst_symlink inst_script inst_binary inst_simple; do -+ $x "$@" && return 0 -+ done -+ return 1 -+} -+ -+# install function specialized for hooks -+# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook -+# All hooks should be POSIX/SuS compliant, they will be sourced by init. -+inst_hook() { -+ if ! [[ -f $3 ]]; then -+ derror "Cannot install a hook ($3) that does not exist." -+ derror "Aborting initrd creation." -+ exit 1 -+ elif ! strstr "$hookdirs" "$1"; then -+ derror "No such hook type $1. Aborting initrd creation." -+ exit 1 -+ fi -+ inst_simple "$3" "/${1}/${2}${3##*/}" -+} -+ -+dracut_install() { -+ if [[ $1 = '-o' ]]; then -+ local optional=yes -+ shift -+ fi -+ while (($# > 0)); do -+ if ! inst "$1" ; then -+ if [[ $optional = yes ]]; then -+ dwarning "Skipping program $1 as it cannot be found and is flagged to be optional" -+ else -+ derror "Failed to install $1" -+ exit 1 -+ fi -+ fi -+ shift -+ done -+} -+ -+# install function decompressing the target and handling symlinks -+# $@ = list of compressed (gz or bz2) files or symlinks pointing to such files -+# -+# Function install targets in the same paths inside overlay but decompressed -+# and without extensions (.gz, .bz2). -+inst_decompress() { -+ local src dst realsrc realdst cmd -+ -+ for src in $@ -+ do -+ case ${src} in -+ *.gz) cmd='gzip -d' ;; -+ *.bz2) cmd='bzip2 -d' ;; -+ *) return 1 ;; -+ esac -+ -+ if [[ -L ${src} ]] -+ then -+ realsrc="$(readlink -f ${src})" # symlink target with extension -+ dst="${src%.*}" # symlink without extension -+ realdst="${realsrc%.*}" # symlink target without extension -+ mksubdirs "${initdir}/${src}" -+ # Create symlink without extension to target without extension. -+ ln -s "${realdst}" "${initdir}/${dst}" -+ fi -+ -+ # If the source is symlink we operate on its target. -+ [[ ${realsrc} ]] && src=${realsrc} -+ inst ${src} -+ # Decompress with chosen tool. We assume that tool changes name e.g. -+ # from 'name.gz' to 'name'. -+ ${cmd} "${initdir}${src}" -+ done -+} -+ -+# It's similar to above, but if file is not compressed, performs standard -+# install. -+# $@ = list of files -+inst_opt_decompress() { -+ local src -+ -+ for src in $@ -+ do -+ inst_decompress "${src}" || inst "${src}" -+ done -+} -+ -+module_check() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we are unconditionally included -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check $hostonly -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func check || return 0 -+ check -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_depends() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we have no deps -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check -d -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func depends || return 0 -+ depends -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_install() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/install ]] && . "$moddir/install" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func install || return 0 -+ install -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_installkernel() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/installkernel ]] && . "$moddir/installkernel" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func installkernel || return 0 -+ installkernel -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+check_module() { -+ local mod=$1; -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ local moddep; -+ # If we are already scheduled to be loaded, no need to check again. -+ strstr " $mods_to_load " " $mod " && return 0 -+ strstr " $mods_checked_as_dep " " $mod " && return 1 -+ -+ # This should never happen, but... -+ [[ -d $moddir ]] || return 1 -+ -+ [[ $2 ]] || mods_checked_as_dep+=" $mod " -+ -+ strstr " $omit_dracutmodules " " $mod " && return 1 -+ -+ if strstr " $dracutmodules $add_dracutmodules " " $mod "; then -+ module_check $mod; ret=$? -+ # explicit module, so also accept ret=255 -+ [[ $ret = 0 || $ret = 255 ]] || return 1 -+ else -+ # module not in our list -+ if [[ $dracutmodules = all ]]; then -+ # check, if we can and should install this module -+ module_check $mod || return 1 -+ else -+ # skip this module -+ return 1 -+ fi -+ fi -+ -+ for moddep in $(module_depends $mod); do -+ # handle deps as if they were manually added -+ strstr " $add_dracutmodules " " $moddep " || \ -+ add_dracutmodules+=" $moddep " -+ # if a module we depend on fail, fail also -+ check_module $moddep || return 1 -+ done -+ -+ strstr " $mods_to_load " " $mod " || \ -+ mods_to_load+=" $mod " -+ -+ return 0 -+} -+ -+check_module_dir() { -+ local modcheck; -+ local mod; -+ mods_to_load="" -+ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do -+ local mod=${moddir##*/}; mod=${mod#[0-9][0-9]} -+ check_module $mod 1 -+ done -+} -+ -+# Install a single kernel module along with any firmware it may require. -+# $1 = full path to kernel module to install -+install_kmod_with_fw() { -+ local modname=${1##*/} fwdir found -+ modname=${modname%.ko*} -+ inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \ -+ return 0 # no need to go further if the module is already installed -+ for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do -+ found='' -+ for fwdir in $fw_dir; do -+ if [[ -d $fwdir && -f $fwdir/$fw ]]; then -+ inst_simple "$fwdir/$fw" "/lib/firmware/$fw" -+ found=yes -+ fi -+ done -+ if [[ $found != yes ]]; then -+ dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\"" -+ fi -+ done -+} -+ -+# Do something with all the dependencies of a kernel module. -+# Note that kernel modules depend on themselves using the technique we use -+# $1 = function to call for each dependency we find -+# It will be passed the full path to the found kernel module -+# $2 = module to get dependencies for -+# rest of args = arguments to modprobe -+for_each_kmod_dep() { -+ local func=$1 kmod=$2 cmd modpapth options -+ shift 2 -+ modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \ -+ while read cmd modpath options; do -+ [[ $cmd = insmod ]] || continue -+ $func $modpath -+ done -+} -+ -+# filter kernel modules to install certain modules that meet specific -+# requirements. -+# $1 = function to call with module name to filter. -+# This function will be passed the full path to the module to test. -+# The behaviour of this function can vary depending on whether $hostonly is set. -+# If it is, we will only look at modules that are already in memory. -+# If it is not, we will look at all kernel modules -+# This function returns the full filenames of modules that match $1 -+filter_kernel_modules () ( -+ if ! [[ $hostonly ]]; then -+ filtercmd='find "$srcmods/kernel/drivers" "$srcmods/extra" "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz" 2>/dev/null' -+ else -+ filtercmd='cut -d " " -f 1 /dev/null' -+ fi -+ for modname in $(eval $filtercmd); do -+ case $modname in -+ *.ko) "$1" "$modname" && echo "$modname";; -+ *.ko.gz) gzip -dc "$modname" > $initdir/$$.ko -+ $1 $initdir/$$.ko && echo "$modname" -+ rm -f $initdir/$$.ko;; -+ esac -+ done -+) -+ -+# install kernel modules along with all their dependencies. -+instmods() { -+ [[ $no_kernel = yes ]] && return -+ local mod mpargs modpath modname cmd moddirname -+ while (($# > 0)); do -+ mod=${1%.ko*} -+ case $mod in -+ =*) -+ # This introduces 2 incompatible meanings for =* arguments -+ # to instmods. We need to decide which one to keep. -+ if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then -+ instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block") -+ elif [ -f $srcmods/modules.${mod#=} ]; then -+ instmods $mpargs $(cat ${srcmods}/modules.${mod#=} ) -+ else -+ instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*") -+ fi -+ ;; -+ --*) -+ mod=${mod##*/} -+ mpargs+=" $mod";; -+ i2o_scsi) shift; continue;; # Do not load this diagnostic-only module -+ *) mod=${mod##*/} -+ # if we are already installed, skip this module and go on -+ # to the next one. -+ [[ -f $initdir/$1 ]] && { shift; continue; } -+ # If we are building a host-specific initramfs and this -+ # module is not already loaded, move on to the next one. -+ [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \ -+ ! echo $add_drivers | grep -qe "\<${mod}\>" && { -+ shift; continue; -+ } -+ -+ # We use '-d' option in modprobe only if modules prefix path -+ # differs from default '/'. This allows us to use Dracut with -+ # old version of modprobe which doesn't have '-d' option. -+ moddirname=${srcmods%%/lib/modules/*} -+ [[ -n ${moddirname} ]] && moddirname="-d ${moddirname}/" -+ -+ # ok, load the module, all its dependencies, and any firmware -+ # it may require -+ for_each_kmod_dep install_kmod_with_fw $mod \ -+ --set-version $kernel ${moddirname} -+ ;; -+ esac -+ shift -+ done -+} -diff --git gen_cmdline.sh gen_cmdline.sh -index b3e451d..36afb2e 100755 ---- gen_cmdline.sh -+++ gen_cmdline.sh -@@ -22,6 +22,7 @@ longusage() { - echo " --logfile= Output file for debug info" - echo " --color Output debug in color" - echo " --no-color Do not output debug in color" -+ echo " --no-cleartmp Do not clear temp directory" - echo " Kernel Configuration settings" - echo " --menuconfig Run menuconfig after oldconfig" - echo " --no-menuconfig Do not run menuconfig after oldconfig" -@@ -78,6 +79,8 @@ longusage() { - echo " --splash-res= Select splash theme resolutions to install" - echo " --do-keymap-auto Forces keymap selection at boot" - echo " --no-keymap Disables keymap selection support" -+ echo " --udev Include udev in the initramfs" -+ echo " --no-udev Exclude udev from the initramfs" - echo " --lvm Include LVM support" - echo " --mdadm Include MDADM/MDMON support" - echo " --mdadm-config= Use file as mdadm.conf in initramfs" -@@ -97,6 +100,8 @@ longusage() { - echo " --unionfs Include support for unionfs" - echo " --netboot Create a self-contained env in the initramfs" - echo " --real-root= Specify a default for real_root=" -+ echo " --lscpi Include lspci into the initramfs" -+ echo " --no-lscpi Exclude lspci from the initramfs" - echo " Internals" - echo " --arch-override= Force to arch instead of autodetect" - echo " --cachedir= Override the default cache location" -@@ -232,6 +237,30 @@ parse_cmdline() { - CMD_KEYMAP=0 - print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" - ;; -+ --udev) -+ CMD_UDEV=1 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --no-udev) -+ CMD_UDEV=0 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --lspci) -+ CMD_LSPCI=1 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --no-lspci) -+ CMD_LSPCI=0 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --nfsutils) -+ CMD_NFSUTILS=1 -+ print_info 2 "CMD_NFSUTILS: ${CMD_NFSUTILS}" -+ ;; -+ --no-nfsutils) -+ CMD_NFSUTILS=0 -+ print_info 2 "CMD_NFSUTILS: ${CMD_NFSUTILS}" -+ ;; - --lvm) - CMD_LVM=1 - print_info 2 "CMD_LVM: ${CMD_LVM}" -@@ -441,6 +470,10 @@ parse_cmdline() { - print_info 2 "USECOLOR: ${USECOLOR}" - setColorVars - ;; -+ --no-cleartmp) -+ NOCLEARTMP=1 -+ print_info 2 "NOCLEARTMP: ${NOCLEARTMP}" -+ ;; - --logfile=*) - CMD_LOGFILE=`parse_opt "$*"` - LOGFILE=`parse_opt "$*"` -diff --git gen_compile.sh gen_compile.sh -index 0758c3a..8a2339a 100755 ---- gen_compile.sh -+++ gen_compile.sh -@@ -407,7 +407,10 @@ compile_busybox() { - yes '' 2>/dev/null | compile_generic oldconfig utils - - print_info 1 'busybox: >> Compiling...' -+ OLDLOGLEVEL=$LOGLEVEL -+ LOGLEVEL=1 - compile_generic all utils -+ LOGLEVEL=$OLDLOGLEVEL - print_info 1 'busybox: >> Copying to cache...' - [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] || - gen_die 'Busybox executable does not exist!' -diff --git gen_determineargs.sh gen_determineargs.sh -index ce479cb..eb23120 100755 ---- gen_determineargs.sh -+++ gen_determineargs.sh -@@ -107,6 +107,9 @@ determine_real_args() { - set_config_with_override BOOL SYMLINK CMD_SYMLINK - set_config_with_override STRING INSTALL_MOD_PATH CMD_INSTALL_MOD_PATH - set_config_with_override BOOL OLDCONFIG CMD_OLDCONFIG -+ set_config_with_override BOOL UDEV CMD_UDEV -+ set_config_with_override BOOL LSPCI CMD_LSPCI -+ set_config_with_override BOOL NFSUTILS CMD_NFSUTILS - set_config_with_override BOOL LVM CMD_LVM - set_config_with_override BOOL DMRAID CMD_DMRAID - set_config_with_override BOOL ISCSI CMD_ISCSI -diff --git gen_initramfs.sh gen_initramfs.sh -index 7fe4421..2e936e9 100755 ---- gen_initramfs.sh -+++ gen_initramfs.sh -@@ -56,7 +56,13 @@ append_busybox() { - chmod +x "${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/default.script" - - # Set up a few default symlinks -- for i in ${BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}; do -+ if isTrue "${UDEV}" -+ then -+ BUSYBOX_APPLETS="${BUSYBOX_APPLETS:-[ ash sh uname echo cut cat}" -+ else -+ BUSYBOX_APPLETS="{$BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}" -+ fi -+ for i in ${BUSYBOX_APPLETS}; do - rm -f ${TEMP}/initramfs-busybox-temp/bin/$i > /dev/null - ln -s busybox ${TEMP}/initramfs-busybox-temp/bin/$i || - gen_die "Busybox error: could not link ${i}!" -@@ -410,7 +416,7 @@ append_firmware() { - IFS="," - for i in ${FIRMWARE_FILES} - do -- cp -L "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ -+ cp -rL "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ - done - IFS=$OLD_IFS - else -@@ -438,9 +444,76 @@ append_gpg() { - chmod a+x "${TEMP}/initramfs-gpg-temp/sbin/gpg" - cd "${TEMP}/initramfs-gpg-temp/" - find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" - rm -rf "${TEMP}/initramfs-gpg-temp" > /dev/null - } - -+append_udev() { -+ if [ -d "${TEMP}/initramfs-udev-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-udev-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-udev-temp/" -+ udevmod="${GK_SHARE}/modules/udev-rules/" -+ source ${udevmod}/module-setup.sh -+ initdir=${TEMP}/initramfs-udev-temp \ -+ moddir=${udevmod} \ -+ libdir=/lib/ \ -+ usrlibdir=/usr/lib/ \ -+ install_module -+ -+ if isTrue $LSPCI -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ fi -+ if isTrue $NFSUTILS -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /sbin/mount.nfs /etc/services /etc/protocols /etc/netconfig -+ fi -+ # find net modules and sound -+ (for pathname in ${INSTALL_MOD_PATH}/lib/modules/${KV}/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/drivers/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/sound -+ do -+ [[ -d $pathname ]] && find $pathname -name "*.ko" -+ done | -+ while read module;do -+ # add them prefix blacklist -+ echo "blacklist `basename $module .ko`"; -+ # concat with ready blacklist.conf -+ done;cat "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf") | -+ # sort and rewrite blacklist.conf -+ sort | uniq > "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" -+ mv "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" \ -+ "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf" -+ -+ cd "${TEMP}/initramfs-udev-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-udev-temp" > /dev/null -+} -+ -+append_lspci() { -+ if [ -d "${TEMP}/initramfs-lspci-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-lspci-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-lspci-temp/" -+ -+ initdir=${TEMP}/initramfs-lspci-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ -+ cd "${TEMP}/initramfs-lspci-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-lspci-temp" > /dev/null -+} -+ - print_list() - { - local x -@@ -489,6 +562,11 @@ append_modules() { - print_list ${!group_modules} > "${TEMP}/initramfs-modules-${KV}-temp/etc/modules/${group}" - done - cd "${TEMP}/initramfs-modules-${KV}-temp/" -+ # remove sound and media -+ for x in `find . -type d -name media -o -type d -name sound` -+ do -+ rm -r "${x}" &>/dev/null -+ done - find . | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ - || gen_die "compressing modules cpio" - cd "${TEMP}" -@@ -561,11 +639,14 @@ append_auxilary() { - done - echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" - -- if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ if ! isTrue "${UDEV}" - then -- cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -- else -- cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ then -+ cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ else -+ cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ fi - fi - if isTrue $CMD_DOKEYMAPAUTO - then -@@ -582,7 +663,7 @@ append_auxilary() { - chmod +x "${TEMP}/initramfs-aux-temp/init" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" -- chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ isTrue "${UDEV}" || chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" - - if isTrue ${NETBOOT} - then -@@ -609,6 +690,21 @@ append_data() { - fi - } - -+pack_cpio() { -+ print_info 1 " >> Pack cpio data..." -+ if [ -d "${TEMP}/initramfs-repack-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-repack-temp" -+ fi -+ mkdir -p "${TEMP}/initramfs-repack-temp" -+ cd "${TEMP}/initramfs-repack-temp" -+ # unpack and pack cpio remove double files -+ cpio -di <${CPIO} 2>/dev/null -+ find . -print | cpio ${CPIO_ARGS} | gzip -9 >"${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-repack-temp" > /dev/null -+} -+ - create_initramfs() { - print_info 1 "initramfs: >> Initializing..." - -@@ -619,6 +715,11 @@ create_initramfs() { - - append_data 'base_layout' - append_data 'auxilary' "${BUSYBOX}" -+ append_data 'udev' "${UDEV}" -+ if ! isTrue "${UDEV}" -+ then -+ append_data 'lspci' "${LSPCI}" -+ fi - append_data 'busybox' "${BUSYBOX}" - append_data 'lvm' "${LVM}" - append_data 'dmraid' "${DMRAID}" -@@ -652,8 +753,7 @@ create_initramfs() { - append_data 'overlay' - fi - -- gzip -9 "${CPIO}" -- mv -f "${CPIO}.gz" "${CPIO}" -+ pack_cpio - - if isTrue "${INTEGRATED_INITRAMFS}" - then -diff --git genkernel genkernel -index 0a06cdd..1486c61 100755 ---- genkernel -+++ genkernel -@@ -9,6 +9,7 @@ GK_V='3.4.18' - TMPDIR='/var/tmp/genkernel' - - TODEBUGCACHE=1 # Until an error occurs or LOGFILE is fully qualified. -+NOCLEARTMP=0 - - small_die() { - echo $1 -@@ -45,6 +46,7 @@ source ${GK_SHARE}/gen_initramfs.sh || gen_die "Could not read ${GK_SHARE}/gen_i - source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_moddeps.sh" - source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh" - source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh" -+source ${GK_SHARE}/dracut_funcs.sh || gen_die "Could not read ${GK_SHARE}/dracut_funcs.sh" - - TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ - -@@ -55,21 +57,25 @@ trap_cleanup(){ - } - - cleanup(){ -- if [ -n "$TEMP" -a -d "$TEMP" ]; then -- rm -rf "$TEMP" -- fi -- -- if isTrue ${POSTCLEAR} -- then -- echo -- print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -- print_info 1 "CACHE_DIR: ${CACHE_DIR}" -- CLEAR_CACHE_DIR='yes' -- setup_cache_dir -- echo -- print_info 1 "TMPDIR: ${TMPDIR}" -- clear_tmpdir -- fi -+ if [[ ${NOCLEARTMP} -ne 0 ]] -+ then -+ return -+ fi -+ if [ -n "$TEMP" -a -d "$TEMP" ]; then -+ rm -rf "$TEMP" &>/dev/null -+ fi -+ -+ if isTrue ${POSTCLEAR} -+ then -+ echo -+ print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -+ print_info 1 "CACHE_DIR: ${CACHE_DIR}" -+ CLEAR_CACHE_DIR='yes' -+ setup_cache_dir -+ echo -+ print_info 1 "TMPDIR: ${TMPDIR}" -+ clear_tmpdir -+ fi - } - - trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL -diff --git genkernel.conf genkernel.conf -index 24fcd54..b61f1fa 100644 ---- genkernel.conf -+++ genkernel.conf -@@ -52,6 +52,15 @@ USECOLOR="yes" - # argument is: *+1 - # MAKEOPTS="-j2" - -+# Add udev to initramfs -+UDEV="yes" -+ -+# Add lspci to initramfs -+LSPCI="yes" -+ -+# add ntfs-utils to initramfs -+NFSUTILS="yes" -+ - # Add in LVM support from static binaries if they exist on the system, or - # compile static LVM binaries if static ones do not exist. - # LVM="no" -@@ -92,7 +101,7 @@ USECOLOR="yes" - # Specify directory to pull from - # FIRMWARE_DIR="/lib/firmware" - # Specify specific firmware files to include. This overrides FIRMWARE_DIR --# FIRMWARE_FILES="" -+FIRMWARE_FILES="/lib/firmware/radeon" - - # Enable disklabel support (copies blkid to initrd) - DISKLABEL="yes" -diff --git modules/udev-rules/01-ignore.rules modules/udev-rules/01-ignore.rules -new file mode 100644 -index 0000000..b32f22e ---- /dev/null -+++ modules/udev-rules/01-ignore.rules -@@ -0,0 +1 @@ -+KERNEL=="ram[0-9]*", OPTIONS+="ignore_device", OPTIONS+="last_rule" -diff --git modules/udev-rules/59-persistent-storage-volid.rules modules/udev-rules/59-persistent-storage-volid.rules -new file mode 100644 -index 0000000..0b798e6 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage-volid.rules -@@ -0,0 +1,7 @@ -+SUBSYSTEM!="block", GOTO="psv_end" -+ACTION!="add|change", GOTO="psv_end" -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="cciss[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", IMPORT{program}="vol_id --export $tempnode" -+LABEL="psv_end" -diff --git modules/udev-rules/59-persistent-storage.rules modules/udev-rules/59-persistent-storage.rules -new file mode 100644 -index 0000000..2b83e72 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage.rules -@@ -0,0 +1,38 @@ -+SUBSYSTEM!="block", GOTO="ps_end" -+ACTION!="add|change", GOTO="ps_end" -+ -+KERNEL=="cciss[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end" -+ -+# partitions have no md/{array_state,metadata_version} -+ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" -+ -+# container devices have a metadata version of e.g. 'external:ddf' and -+# never leave state 'inactive' -+ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -+TEST!="md/array_state", GOTO="md_end" -+ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -+ -+LABEL="md_ignore_state" -+ -+IMPORT{program}="/sbin/mdadm --detail --export $tempnode" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+OPTIONS+="link_priority=100" -+OPTIONS+="watch" -+LABEL="md_end" -+ -+ -+KERNEL!="dm-[0-9]*", GOTO="ps_end" -+ACTION=="add", GOTO="ps_end" -+IMPORT{program}="/sbin/dmsetup info -c --nameprefixes --unquoted --rows --noheadings -o name,uuid,suspended,readonly,major,minor,open,tables_loaded,names_using_dev -j%M -m%m" -+ENV{DM_NAME}!="?*", GOTO="ps_end" -+ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="ps_end" -+ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="ps_end" -+ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="ps_end" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+LABEL="ps_end" -diff --git modules/udev-rules/61-persistent-storage.rules modules/udev-rules/61-persistent-storage.rules -new file mode 100644 -index 0000000..9cfdb0b ---- /dev/null -+++ modules/udev-rules/61-persistent-storage.rules -@@ -0,0 +1,20 @@ -+SUBSYSTEM!="block", GOTO="pss_end" -+ACTION!="add|change", GOTO="pss_end" -+ -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss" -+KERNEL=="cciss[0-9]*", GOTO="do_pss" -+KERNEL=="nbd[0-9]*", GOTO="do_pss" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", GOTO="do_pss" -+ -+GOTO="pss_end" -+ -+LABEL="do_pss" -+# by-path (parent device path) -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{program}="path_id %p" -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" -+ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" -+ -+# by-label/by-uuid links (filesystem metadata) -+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -+LABEL="pss_end" -diff --git modules/udev-rules/blacklist.conf modules/udev-rules/blacklist.conf -new file mode 100644 -index 0000000..21ac71c ---- /dev/null -+++ modules/udev-rules/blacklist.conf -@@ -0,0 +1,162 @@ -+blacklist ath_pci -+blacklist evbug -+blacklist usbmouse -+blacklist usbkbd -+blacklist eepro100 -+blacklist de4x5 -+blacklist eth1394 -+blacklist snd_intel8x0m -+blacklist snd_aw2 -+blacklist i2c_i801 -+blacklist prism54 -+blacklist bcm43xx -+blacklist garmin_gps -+blacklist asus_acpi -+blacklist snd_pcsp -+blacklist pcspkr -+blacklist amd76x_edac -+blacklist ohci1394 -+blacklist sbp2 -+blacklist dv1394 -+blacklist raw1394 -+blacklist video1394 -+blacklist aty128fb -+blacklist atyfb -+blacklist radeonfb -+blacklist cirrusfb -+blacklist cyber2000fb -+blacklist cyblafb -+blacklist gx1fb -+blacklist hgafb -+blacklist i810fb -+blacklist intelfb -+blacklist kyrofb -+blacklist lxfb -+blacklist matroxfb_base -+blacklist neofb -+blacklist nvidiafb -+blacklist pm2fb -+blacklist rivafb -+blacklist s1d13xxxfb -+blacklist savagefb -+blacklist sisfb -+blacklist sstfb -+blacklist tdfxfb -+blacklist tridentfb -+blacklist vesafb -+blacklist vfb -+blacklist viafb -+blacklist vt8623fb -+blacklist ac97 -+blacklist ac97_codec -+blacklist ac97_plugin_ad1980 -+blacklist ad1848 -+blacklist ad1889 -+blacklist adlib_card -+blacklist aedsp16 -+blacklist ali5455 -+blacklist btaudio -+blacklist cmpci -+blacklist cs4232 -+blacklist cs4281 -+blacklist cs461x -+blacklist cs46xx -+blacklist emu10k1 -+blacklist es1370 -+blacklist es1371 -+blacklist esssolo1 -+blacklist forte -+blacklist gus -+blacklist i810_audio -+blacklist kahlua -+blacklist mad16 -+blacklist maestro -+blacklist maestro3 -+blacklist maui -+blacklist mpu401 -+blacklist nm256_audio -+blacklist opl3 -+blacklist opl3sa -+blacklist opl3sa2 -+blacklist pas2 -+blacklist pss -+blacklist rme96xx -+blacklist sb -+blacklist sb_lib -+blacklist sgalaxy -+blacklist sonicvibes -+blacklist sound -+blacklist sscape -+blacklist trident -+blacklist trix -+blacklist uart401 -+blacklist uart6850 -+blacklist via82cxxx_audio -+blacklist v_midi -+blacklist wavefront -+blacklist ymfpci -+blacklist ac97_plugin_wm97xx -+blacklist ad1816 -+blacklist audio -+blacklist awe_wave -+blacklist dmasound_core -+blacklist dmasound_pmac -+blacklist harmony -+blacklist sequencer -+blacklist soundcard -+blacklist usb-midi -+blacklist acquirewdt -+blacklist advantechwdt -+blacklist alim1535_wdt -+blacklist alim7101_wdt -+blacklist booke_wdt -+blacklist cpu5wdt -+blacklist eurotechwdt -+blacklist i6300esb -+blacklist i8xx_tco -+blacklist ib700wdt -+blacklist ibmasr -+blacklist indydog -+blacklist iTCO_wdt -+blacklist it8712f_wdt -+blacklist it87_wdt -+blacklist ixp2000_wdt -+blacklist ixp4xx_wdt -+blacklist machzwd -+blacklist mixcomwd -+blacklist mpc8xx_wdt -+blacklist mpcore_wdt -+blacklist mv64x60_wdt -+blacklist pc87413_wdt -+blacklist pcwd -+blacklist pcwd_pci -+blacklist pcwd_usb -+blacklist s3c2410_wdt -+blacklist sa1100_wdt -+blacklist sbc60xxwdt -+blacklist sbc7240_wdt -+blacklist sb8360 -+blacklist sc1200wdt -+blacklist sc520_wdt -+blacklist sch311_wdt -+blacklist scx200_wdt -+blacklist shwdt -+blacklist smsc37b787_wdt -+blacklist softdog -+blacklist twl4030_wdt -+blacklist w83627hf_wdt -+blacklist w83697hf_wdt -+blacklist w83697ug_wdt -+blacklist w83877f_wdt -+blacklist w83977f_wdt -+blacklist wafer5823wdt -+blacklist wdt -+blacklist wdt_pci -+blacklist wm8350_wdt -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -diff --git modules/udev-rules/load-modules.sh modules/udev-rules/load-modules.sh -new file mode 100755 -index 0000000..36972fd ---- /dev/null -+++ modules/udev-rules/load-modules.sh -@@ -0,0 +1,7 @@ -+#!/bin/sh -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+# Implement blacklisting for udev-loaded modules -+ -+modprobe -b "$@" -diff --git modules/udev-rules/module-setup.sh modules/udev-rules/module-setup.sh -new file mode 100755 -index 0000000..8ef142b ---- /dev/null -+++ modules/udev-rules/module-setup.sh -@@ -0,0 +1,71 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+install_module() { -+ # FIXME: would be nice if we didn't have to know which rules to grab.... -+ # ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies -+ # of the rules we want so that we just copy those in would be best -+ [[ -x /sbin/udevd ]] && dracut_install udevd -+ dracut_install udevadm /etc/udev/udev.conf /etc/group /bin/mount /sbin/modprobe -+ inst_rules 50-udev-default.rules 60-persistent-storage.rules \ -+ 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \ -+ 60-pcmcia.rules -+ mkdir -p "$initdir"/etc/modprobe.d -+ inst_simple "$moddir/blacklist.conf" /etc/modprobe.d/ -+ -+ # ignore some devices in the initrd -+ inst_rules "$moddir/01-ignore.rules" -+ -+ # for firmware loading -+ inst_rules 50-firmware.rules -+ -+ if [ ! -x /lib/udev/vol_id ]; then -+ inst_rules "$moddir/59-persistent-storage.rules" -+ else -+ inst_rules "$moddir/59-persistent-storage-volid.rules" -+ fi -+ inst_rules "$moddir/61-persistent-storage.rules" -+ -+ for i in \ -+ ata_id \ -+ cdrom_id \ -+ create_floppy_devices \ -+ edd_id \ -+ firmware.sh \ -+ firmware \ -+ firmware.agent \ -+ hotplug.functions \ -+ fw_unit_symlinks.sh \ -+ hid2hci \ -+ path_id \ -+ scsi_id \ -+ dmsetup \ -+ usb_id \ -+ vol_id \ -+ pcmcia-socket-startup \ -+ pcmcia-check-broken-cis \ -+ udevd \ -+ ; do -+ for utilpath in /lib/udev /sbin /bin -+ do -+ if [ -e $utilpath/$i.static ] -+ then -+ inst_binary $utilpath/$i.static $utilpath/$i -+ else -+ [ -e $utilpath/$i ] && dracut_install $utilpath/$i -+ fi -+ done -+ done -+ -+ if ! [ -e "$initdir/sbin/udevd" ]; then -+ if [ -x /lib/udev/udevd ]; then -+ ln -s /lib/udev/udevd "$initdir/sbin/udevd" -+ fi -+ fi -+ -+ for i in {"$libdir","$usrlibdir"}/libnss_files*; do -+ [ -e "$i" ] && dracut_install "$i" -+ done -+} -+ diff --git a/sys-kernel/calckernel/files/calckernel-3.4.18-r12.patch b/sys-kernel/calckernel/files/calckernel-3.4.18-r12.patch deleted file mode 100644 index 1033c94a1..000000000 --- a/sys-kernel/calckernel/files/calckernel-3.4.18-r12.patch +++ /dev/null @@ -1,2191 +0,0 @@ -diff --git defaults/busy-config defaults/busy-config -index 51fdc8e..a1f6858 100644 ---- defaults/busy-config -+++ defaults/busy-config -@@ -462,7 +462,7 @@ CONFIG_MDSTART=y - CONFIG_MORE=y - CONFIG_FEATURE_USE_TERMIOS=y - CONFIG_MOUNT=y --CONFIG_FEATURE_MOUNT_NFS=y -+CONFIG_FEATURE_MOUNT_NFS=n - # CONFIG_FEATURE_MOUNT_CIFS is not set - CONFIG_FEATURE_MOUNT_FLAGS=y - CONFIG_FEATURE_MOUNT_FSTAB=y -diff --git defaults/initrd.defaults defaults/initrd.defaults -index 76d72a7..0c059a5 100755 ---- defaults/initrd.defaults -+++ defaults/initrd.defaults -@@ -68,6 +68,7 @@ fi - - REAL_ROOT='' - CDROOT='0' -+SCRATCH='0' - CDROOT_DEV='' - CDROOT_TYPE='auto' - NEW_ROOT='/newroot' -diff --git defaults/initrd.scripts defaults/initrd.scripts -index 51ebcce..8007347 100755 ---- defaults/initrd.scripts -+++ defaults/initrd.scripts -@@ -187,23 +187,45 @@ cache_cd_contents() { - # TODO: Check the size of the image versus the size of our tmpfs - # along with the amount of available RAM and increase tmpfs size - # if necessary. (Not having awk sucks...) -- # z=0 -- # for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -- # cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; do -- # z=$(($z + $i)) ; done -- # echo $z -- good_msg "Copying loop file for caching..." -- # Verify that the needed directory exists -- mkdir -p "$(dirname ${NEW_ROOT}/mnt/${LOOP})" -- cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/${LOOP} -- if [ $? -ne 0 ] -+ -+ # getting memory -+ allmemory=0 -+ for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -+ cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; -+ do -+ allmemory=$(($allmemory + $i)) -+ done -+ -+ # getting size tmpfs of default -+ let curtfs=$allmemory/2 -+ -+ # getting size of image -+ let imagesize=`ls -la ${NEW_ROOT}/mnt/cdrom/${LOOP} | sed -r -n 's/(\S*\s*){4}(\S*).*/\2/p'`/20000*21 -+ let addon=$imagesize/10 -+ if [[ $curtfs -gt $(( ${imagesize} + ${addon} )) ]]; -+ then -+ let addon=$(( $curtfs - ${imagesize} )) -+ fi -+ -+ if [[ $((${imagesize} + $addon)) -lt ${allmemory} ]]; - then -- bad_msg "Failed to cache the loop file! Lack of space?" -- rm -rf ${NEW_ROOT}/mnt/livecd.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/image.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/zisofs 2>/dev/null -+ mount -o remount,size=${addon}000 -t tmpfs tmpfs ${NEW_ROOT} -+ mkdir ${NEW_ROOT}/mnt/squash -+ mount -o size=${imagesize}000 -t tmpfs tmpfs ${NEW_ROOT}/mnt/squash -+ good_msg "Copying loop file for caching..." -+ cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/squash/${LOOP} -+ if [ $? -ne 0 ] -+ then -+ bad_msg "Failed to cache the loop file! Lack of space?" -+ umount ${NEW_ROOT}/mnt/squash -+ mount -o remount,size=${curtfs}000 -t tmpfs tmpfs ${NEW_ROOT} -+ else -+ LOOPEXT='../squash/' -+ good_msg "Unmounting media from ${NEW_ROOT}/mnt/cdrom" -+ umount ${NEW_ROOT}/mnt/cdrom -+ fi - else -- LOOPEXT='../' -+ bad_msg "Too low memory for cache the loop file." - fi - fi - fi -@@ -306,7 +328,9 @@ run_shell() { - /bin/ash - } - --runmdev() { -+make_devfs() { -+ # make /run in root -+ mkdir /run - # Use devtmpfs if enabled in kernel, - # else tmpfs. Always run mdev just in case - devfs=tmpfs -@@ -321,6 +345,10 @@ runmdev() { - # http://git.busybox.net/busybox/plain/docs/mdev.txt - mkdir -m 0755 /dev/pts - mount -t devpts -o gid=5,mode=0620 devpts /dev/pts || bad_msg "Failed to mount /dev/pts" -+} -+ -+runmdev() { -+ make_devfs - mdev -s || bad_msg "Failed to receive dynamic updates from mdev" - } - -@@ -655,7 +683,7 @@ startVolumes() { - [ -d /etc/lvm/cache ] && lvm_commands="${lvm_commands} \nvgscan" - - # To activate volumegroups on all devices in the cache -- lvm_commands="${lvm_commands} \nvgchange -ay --sysinit" -+ lvm_commands="${lvm_commands} \nvgchange -ay --sysinit --noudevsync" - - # And finally execute it all (/proc/... needed if lvm is compiled without readline) - good_msg "Scanning for and activating Volume Groups" -@@ -1082,6 +1110,38 @@ getdvhoff() { - echo $(( $(hexdump -n 4 -s $((316 + 12 * $2)) -e '"%i"' $1) * 512)) - } - -+load_union_module() { -+ UNIONTYPE="" -+ # find module for union file system -+ [ -n "$(find /lib/ -name unionfs.ko)" ] && UNIONTYPE="unionfs" -+ [ -n "$(find /lib/ -name aufs.ko)" ] && UNIONTYPE="aufs" -+ # probably aufs in kernel -+ if [ -n "$(gzip -dc /proc/config.gz | grep CONFIG_AUFS_FS=y )" ] -+ then -+ UNIONTYPE="aufs" -+ else -+ if [ -z "${UNIONTYPE}" ] -+ then -+ bad_msg "Module for union file system is not found!" -+ run_shell -+ else -+ modprobe ${UNIONTYPE} > /dev/null 2>&1 -+ # error on load union module -+ if [ -z "$(lsmod | grep $UNIONTYPE)" ] -+ then -+ bad_msg "Module for union file system is not correct!" -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ bad_msg "Probably kernel compiled without standalone patch." -+ fi -+ run_shell -+ fi -+ -+ good_msg "Loading ${UNIONTYPE}" -+ fi -+ fi -+} -+ - setup_unionfs() { - local rw_dir=$1 - local ro_dir=$2 -@@ -1101,6 +1161,7 @@ setup_unionfs() { - mkdir -p ${UNION} - good_msg "Loading fuse module" - modprobe fuse > /dev/null 2>&1 -+ load_union_module - # if [ -n "${UNIONFS}" ] - # then - # CHANGESDEV=${UNIONFS} -@@ -1130,11 +1191,117 @@ setup_unionfs() { - mkdir /tmp - mkdir -p ${UNION} - # mkdir -p $CHANGES --# mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+## mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+ -+ if [ "${SCRATCH}" -ne 0 ]; -+ then -+ good_msg "Loading in scratch mode" -+ BUILDERDIR=${UNION}/mnt/builder -+ SCRATCHDIR=${UNION}/mnt/scratch -+ DELTADIR=${rw_dir}/mnt/delta -+ WORKSPACEDIR=${rw_dir}/mnt/workspace -+ mount -o remount,rw ${rw_dir}/mnt/cdrom >/dev/null 2>&1 -+ touch ${rw_dir}/mnt/cdrom/livecd >/dev/null 2>&1 -+ if [ "$?" -ne 0 ]; -+ then -+ ISRW=0 -+ else -+ ISRW=1 -+ fi -+ -+ mkdir -p ${DELTADIR} -+ mkdir -p ${WORKSPACEDIR} -+ -+ if [[ -n ${CDROOT_OVERLAY} ]] && [[ -f ${rw_dir}/mnt/cdrom/${CDROOT_OVERLAY} ]] -+ then -+ good_msg "Unpacking ${CDROOT_OVERLAY}" -+ cd ${DELTADIR} -+ tar xf ${rw_dir}/mnt/cdrom/${CDROOT_OVERLAY} -+ fi -+ -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${WORKSPACEDIR}=rw:${DELTADIR}=ro+wh:${rw_dir}/mnt/livecd=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${WORKSPACEDIR}=rw:${DELTADIR}=ro:${rw_dir}/mnt/livecd=ro unionfs ${UNION} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${SCRATCHDIR}/calculate -+ mkdir -p ${SCRATCHDIR}/delta -+ mkdir -p ${SCRATCHDIR}/workspace -+ mount -o bind ${rw_dir}/mnt/delta ${SCRATCHDIR}/delta -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind ${rw_dir}/mnt/workspace ${SCRATCHDIR}/workspace -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${BUILDERDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro none ${BUILDERDIR} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro unionfs ${BUILDERDIR} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind,ro ${rw_dir}/mnt/livecd ${SCRATCHDIR}/calculate -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ if [ "$ISRW" -ne 0 ]; -+ then -+ FLASHDIR=${UNION}/mnt/flash -+ mkdir -p ${FLASHDIR} -+ mount -o bind ${rw_dir}/mnt/cdrom ${FLASHDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ mkdir -p ${CDROMDIR} -+ mount -o bind,ro ${rw_dir}/mnt/cdrom ${CDROMDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ fi -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ LIVECDDIR=${UNION}/mnt/livecd -+ -+ if [[ -n ${CDROOT_OVERLAY} ]] && [[ -f ${rw_dir}/mnt/cdrom/${CDROOT_OVERLAY} ]] -+ then -+ good_msg "Unpacking ${CDROOT_OVERLAY}" -+ cd ${rw_dir} -+ tar xf ${rw_dir}/mnt/cdrom/${CDROOT_OVERLAY} -+ fi -+ -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${rw_dir}:${ro_dir}=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${rw_dir}:${ro_dir}=ro unionfs ${UNION} -+ fi -+ -+ if [[ -n "$( echo ${LOOPEXT} | grep squash )" ]]; -+ then -+ mkdir -p ${UNION}/mnt/squash -+ mount -o bind ${NEW_ROOT}/mnt/squash ${UNION}/mnt/squash &>/dev/null -+ fi -+ -+ chmod 0755 ${UNION} -+ mount -o bind ${rw_dir}/mnt/cdrom ${CDROMDIR} &>/dev/null -+ mount -o bind ${rw_dir}/mnt/livecd ${LIVECDDIR} &>/dev/null -+ ret=$? -+ fi -+ -+ chmod 1777 ${UNION}/tmp - good_msg "Creating union mount" -- unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -- ret=$? -- if [ ${ret} -ne 0 ] -+# unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -+# ret=$? -+ if [ "${ret}" -ne 0 ] - then - bad_msg "Can't setup union mount!" - USE_UNIONFS_NORMAL=0 -@@ -1143,3 +1310,122 @@ setup_unionfs() { - USE_UNIONFS_NORMAL=0 - fi - } -+ -+load_videodrv() { -+ good_msg "Loading frame buffer video driver" -+ # find all available fb drivers -+ videodrv_count=$(find /lib/modules \ -+ -name "nouveau.ko" -o \ -+ -name "uvesafb.ko" -o \ -+ -name "i915.ko" -o \ -+ -name "radeon.ko" | -+ grep -c "") -+ # load specified videodrv -+ modules_list= -+ case "${VIDEODRV}" in -+ nouveau) -+ modules_list="nouveau" -+ ;; -+ radeon) -+ modules_list="radeon" -+ ;; -+ i915|intel) -+ modules_list="i915" -+ ;; -+ ""|auto) -+ # if not livecd and initramfs otimized (aviailable only one video driver) -+ if [ "${CDROOT}" != '1' -a "${videodrv_count}" -le 2 ] -+ then -+ modules_list="nouveau i915 radeon" -+ else -+ if [[ -x /usr/sbin/lspci ]] -+ then -+ if lspci | grep -m1 VGA | grep -qi intel -+ then -+ modules_list="i915" -+ elif lspci | grep -m1 VGA | grep -qi nvidia -+ then -+ modules_list="nouveau" -+ elif lspci | grep -m1 VGA | grep -q -e "Ati" -e "ATI" -+ then -+ modules_list="radeon" -+ else -+ modules_list="" -+ fi -+ else -+ modules_list="i915" -+ fi -+ fi -+ ;; -+ esac -+ for x in $modules_list -+ do -+ if [ "`find /lib/modules -name "${x}.ko" | grep -c ''`" -eq "1" ] -+ then -+ modprobe "${x}" modeset=${USE_MODESET} &>/dev/null -+ lsmod | grep -q "^${x}" && \ -+ [ "`cat /sys/module/${x}/refcnt`" -gt 0 ] && return 0 -+ fi -+ done -+ # else load uvesafb with specified video resolution -+ if [ -n "${VIDEORES}" ] -+ then -+ if ! echo $VIDEORES | grep -q "\-" -+ then -+ VIDEORES="${VIDEORES}-32" -+ fi -+ else -+ VIDEORES="1024x768-32" -+ fi -+ modprobe uvesafb mode_option=${VIDEORES} &>/dev/null -+} -+ -+start_udev() -+{ -+ # start udev -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ echo "" >/proc/sys/kernel/hotplug -+ make_devfs -+ udevd --daemon &>/dev/null -+ udevadm settle -+ fi -+} -+ -+stop_udev() -+{ -+ # kill udevd -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ pkill udevd &>/dev/null -+ fi -+} -+ -+populate_dev() -+{ -+ good_msg 'Activating udev' -+ # Do not run any init-scripts -+ udevadm control --property=do_not_run_plug_service=1 -+ -+ if [ "${REAL_ROOT}" == "/dev/nfs" ] -+ then -+ # clean blacklist because there are net drivers -+ # keep black video for correct loading prop. nvidia -+ cat </etc/modprobe.d/blacklist.conf -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -+EOF -+ fi -+ # discarding net drivers placed into blacklist.conf -+ udevadm trigger --action="add" -+ -+ # we can speed up booting under these conditions: -+ # * using devtmpfs so kernel creates device nodes for us -+ # * only using kernel created device nodes at boot (in /etc/fstab and elsewhere) -+ udevadm settle --timeout=60 -+} -diff --git defaults/linuxrc defaults/linuxrc -index 0843f5d..687f5cc 100755 ---- defaults/linuxrc -+++ defaults/linuxrc -@@ -39,6 +39,14 @@ FAKE_ROOT='' - REAL_ROOTFLAGS='' - ROOTFSTYPE='auto' - CRYPT_SILENT=0 -+VIDEODRV='' -+USE_UDEV=1 -+USE_MODESET=1 -+CDROOT_OVERLAY='cdroot-overlay.tar.bz2' -+if [ -e "/etc/calculate/calculate.ini" ] -+then -+ source /etc/calculate/calculate.ini -+fi - for x in ${CMDLINE} - do - case "${x}" in -@@ -57,6 +65,57 @@ do - init_opts\=*) - INIT_OPTS=`parse_opt "${x}"` - ;; -+ nokms) -+ USE_MODESET=0 -+ ;; -+ kms) -+ USE_MODESET=1 -+ ;; -+ noudev) -+ USE_UDEV=0 -+ ;; -+ calculate\=*) -+ CALCULATE=`parse_opt "${x}"` -+ if [[ "${CALCULATE//:/}" != "${CALCULATE}" ]] -+ then -+ for i in ${CALCULATE//,/ } -+ do -+ case "${i}" in -+ video:*) -+ VIDEODRV=`echo "${i}" | cut -s -d: -f2-` -+ ;; -+ resolution:*) -+ RES=`echo "${i}" | cut -s -d: -f2-` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ ;; -+ esac -+ done -+ else -+ RES=`echo "${CALCULATE}" | cut -s -d, -f4` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ VIDEODRV=`echo "${CALCULATE}" | cut -s -d, -f5` -+ fi -+ ;; -+ video\=*) -+ VR=`parse_opt "${x}"` -+ for i in ${VR//,/ } -+ do -+ if [ -z "${i//[0-9-x@]}" ] -+ then -+ VIDEORES=${i} -+ fi -+ done -+ ;; -+ # Scratch usbload -+ scratch) -+ SCRATCH=1 -+ ;; - # Livecd options - cdroot) - CDROOT=1 -@@ -79,6 +138,9 @@ do - ISOBOOT=`parse_opt "${x}"` - ;; - # Start Volume manager options -+ overlay\=*) -+ CDROOT_OVERLAY=`parse_opt "${x}"` -+ ;; - dolvm) - USE_LVM_NORMAL=1 - ;; -@@ -251,15 +313,24 @@ then - REAL_ROOT="${FAKE_ROOT}" - fi - --splash 'init' -- --cmdline_hwopts -+# check udevd -+[ ! -x /sbin/udevd ] && USE_UDEV=0 - - # Mount sysfs - mount_sysfs - -+# start udev -+start_udev -+ -+# load kernel video driver -+load_videodrv -+ -+splash 'init' -+ -+cmdline_hwopts -+ - # Setup hotplugging for firmware loading --setup_hotplug -+[ "${USE_UDEV}" == "0" ] && setup_hotplug - - # Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel - if [ -z "${DO_modules}" ] -@@ -269,7 +340,7 @@ elif [ -d "/lib/modules/${KV}" ] - then - good_msg 'Loading modules' - # Load appropriate kernel modules -- if [ "${NODETECT}" != '1' ] -+ if [ "${USE_UDEV}" != '1' -a "${NODETECT}" != '1' ] - then - for modules in ${MY_HWOPTS} - do -@@ -285,14 +356,20 @@ fi - # Apply scan delay if specified - sdelay - --# Setup slow USB bits --setup_slowusb -+if [ "${USE_UDEV}" == "1" ] -+then -+ # populate /dev with devices already found by the kernel -+ populate_dev -+else -+ # Setup slow USB bits -+ setup_slowusb - --# Start device manager --start_dev_mgr -+ # Start device manager -+ start_dev_mgr - --# if doslowusb is passed, pause other 10 seconds here, after mdev load --[ "${DO_slowusb}" ] && sleep 10 -+ # if doslowusb is passed, pause other 10 seconds here, after mdev load -+ [ "${DO_slowusb}" ] && sleep 10 -+fi - - # Start iSCSI - if [ -e /bin/iscsistart ] -@@ -509,9 +586,50 @@ do - then - break - else -- bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -- got_good_root=0 -- REAL_ROOT='' -+ # check for scratch -+ if [ -e ${NEW_ROOT}/livecd.squashfs -a -d ${NEW_ROOT}/delta -a -d ${NEW_ROOT}/workspace ]; -+ then -+ good_msg 'Found scratch data...' -+ load_union_module -+ modprobe squashfs >/dev/null -+ if mount -o remount,rw ${NEW_ROOT}; -+ then -+ mkdir -p ${NEW_ROOT}/calculate && mkdir -p /union && mkdir -p ${NEW_ROOT}/workspace/mnt/builder && mkdir -p ${NEW_ROOT}/workspace/mnt/scratch -+ if mount -o loop,ro -t squashfs ${NEW_ROOT}/livecd.squashfs ${NEW_ROOT}/calculate; -+ then -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/workspace=rw:${NEW_ROOT}/delta=ro+wh:${NEW_ROOT}/calculate=ro none /union; -+ then -+ mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/delta=rw:${NEW_ROOT}/calculate=ro none /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers!' -+ run_shell -+ fi -+ else -+ if mount -t unionfs -o ro,dirs=${NEW_ROOT}/workspace:${NEW_ROOT}/delta=ro:${NEW_ROOT}/calculate=ro unionfs /union; -+ then -+ mount -t unionfs -o ro,dirs=${NEW_ROOT}/delta:${NEW_ROOT}/calculate=ro unionfs /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers' -+ run_shell -+ fi -+ fi -+ else -+ bad_msg 'Could not mount scratch squashfs image' -+ fi -+ else -+ bad_msg 'Could not remount ${NEW_ROOT}' -+ fi -+ else -+ bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -+ got_good_root=0 -+ REAL_ROOT='' -+ fi - fi - else - bad_msg "Could not mount specified ROOT, try again" -@@ -723,9 +841,12 @@ cd "${CHROOT}" - mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null - echo -ne "${BOLD}.${NORMAL}" - -+# stop udev before move mount points -+stop_udev -+ - # If devtmpfs is mounted, try move it to the new root - # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise --for fs in /dev /sys /proc -+for fs in "/dev " /sys /proc - do - if grep -qs "$fs" /proc/mounts - then -diff --git defaults/modprobe defaults/modprobe -index ba2d890..9280357 100755 ---- defaults/modprobe -+++ defaults/modprobe -@@ -10,8 +10,6 @@ usage() { - echo - echo 'Example:' - echo ' modprobe eepro100' -- echo -- echo 'Note: Do not pass the suffix to modprobe!' - exit 1 - } - -@@ -81,14 +79,29 @@ modprobe2() { - usage - exit 1 - fi -- real_path=`real_mod_path ${1}` -+ local modname=${1} -+ local quiet='' -+ local params='' -+ shift -+ for x in $@ -+ do -+ case ${x} in -+ -n) -+ quiet=1 -+ ;; -+ *) -+ params="${params} ${x}" -+ ;; -+ esac -+ done -+ real_path=`real_mod_path ${modname}` - if [ "${real_path}" = '' -o "${real_path}" = ' ' ] - then -- [ "${2}" = '-n' ] && echo -n " -> $1" -+ [ "${quiet}" = '1' ] && echo -n " -> ${modname}" - echo ' module not found.' - exit 2 - fi -- modlist=`modules_dep_list ${1}` -+ modlist=`modules_dep_list ${modname}` - if [ "${modlist}" != '' -a "${modlist}" != ' ' ] - then - deps=`strip_mod_paths ${modlist}` -@@ -110,13 +123,13 @@ modprobe2() { - filler=1 - fi - done -- ${INSMOD} ${real_path} > /dev/null 2>&1 -+ ${INSMOD} ${real_path} ${params} > /dev/null 2>&1 - ret=$? - if [ ${ret} -eq 0 ] - then - echoAppend=' loaded.' -- [ "${2}" = '-n' ] && echoFlags='-n' && echoAppend=', ' -- echo ${echoFlags} "${1}${echoAppend}" -+ [ "${quiet}" = '1' ] && echoFlags='-n' && echoAppend=', ' -+ echo ${echoFlags} "${modname}${echoAppend}" - fi - return $ret - } -@@ -132,7 +145,7 @@ do - LOADED_MODULES="${LOADED_MODULES} ${x}" - done - --modprobe2 ${1} -+modprobe2 ${@} - modprobe_ret=$? - - [ -f '/modules.cache' ] && rm -f /modules.cache > /dev/null 2>&1 -diff --git dracut_funcs.sh dracut_funcs.sh -new file mode 100755 -index 0000000..e80a638 ---- /dev/null -+++ dracut_funcs.sh -@@ -0,0 +1,752 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+# -+# functions used by dracut and other tools. -+# -+# Copyright 2005-2009 Red Hat, Inc. All rights reserved. -+# -+# 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; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+# -+ -+IF_RTLD="" -+IF_dynamic="" -+ -+# Generic substring function. If $2 is in $1, return 0. -+strstr() { [[ $1 =~ $2 ]]; } -+ -+# Create all subdirectories for given path without creating the last element. -+# $1 = path -+mksubdirs() { mkdir -p ${1%/*}; } -+ -+# Version comparision function. Assumes Linux style version scheme. -+# $1 = version a -+# $2 = comparision op (gt, ge, eq, le, lt, ne) -+# $3 = version b -+vercmp() { -+ local n1=(${1//./ }) op=$2 n2=(${3//./ }) i res -+ -+ for ((i=0; ; i++)) -+ do -+ if [[ ! ${n1[i]}${n2[i]} ]]; then res=0 -+ elif ((${n1[i]:-0} > ${n2[i]:-0})); then res=1 -+ elif ((${n1[i]:-0} < ${n2[i]:-0})); then res=2 -+ else continue -+ fi -+ break -+ done -+ -+ case $op in -+ gt) ((res == 1));; -+ ge) ((res != 2));; -+ eq) ((res == 0));; -+ le) ((res != 1));; -+ lt) ((res == 2));; -+ ne) ((res != 0));; -+ esac -+} -+ -+is_func() { -+ [[ $(type -t $1) = "function" ]] -+} -+ -+# Log initrd creation. -+if ! [[ $dracutlogfile ]]; then -+ [[ $dracutbasedir = /usr/share/dracut ]] && \ -+ dracutlogfile=/var/log/dracut.log || \ -+ dracutlogfile=/tmp/dracut.log -+# [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log -+ if [[ -w $dracutlogfile ]]; then -+ >"$dracutlogfile" -+ fi -+fi -+ -+dwarning() { -+ echo "W: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "W: $@" >>"$dracutlogfile" -+} -+ -+dinfo() { -+ [[ $beverbose ]] && echo "I: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "I: $@" >>"$dracutlogfile" -+} -+ -+derror() { -+ echo "E: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile" -+} -+ -+# Function prints global variables in format name=value line by line. -+# $@ = list of global variables' name -+print_vars() { -+ local var value -+ -+ for var in $@ -+ do -+ value=$(eval echo \$$var) -+ [[ ${value} ]] && echo "${var}=\"${value}\"" -+ done -+} -+ -+get_fs_env() { -+ [[ $1 ]] || return -+ eval $(udevadm info --query=env --name=$1|egrep 'ID_FS_(TYPE|UUID)=') -+ [[ $ID_FS_TYPE ]] && return -+ -+ if [[ -x /lib/udev/vol_id ]]; then -+ eval $(/lib/udev/vol_id --export $1) -+ elif find_binary blkid >/dev/null; then -+ eval $(blkid -o udev $1) -+ else -+ return 1 -+ fi -+} -+ -+get_fs_type() ( -+ [[ $1 ]] || return -+ if [[ $1 != ${1#/dev/block/nfs:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs3:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs4:} ]]; then -+ echo "nfs" -+ return -+ fi -+ get_fs_env $1 || return -+ echo $ID_FS_TYPE -+) -+ -+get_fs_uuid() ( -+ get_fs_env $1 || return -+ echo $ID_FS_UUID -+) -+ -+# finds the major:minor of the block device backing the root filesystem. -+find_block_device() { -+ local x mpt majmin dev fs misc maj min -+ if [[ $use_fstab != yes ]]; then -+ while read x x majmin x mpt x x fs dev misc; do -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $fs = btrfs ]] && { -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ } -+ if [[ $mpt = $1 ]] && [[ ${majmin#0:} = $majmin ]]; then -+ echo $majmin; -+ return 0 # we have a winner! -+ fi -+ done < /proc/self/mountinfo -+ fi -+ # fall back to /etc/fstab -+ while read dev mpt fs misc; do -+ if [[ $mpt = $1 ]]; then -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $dev != ${dev#UUID=} ]] && dev=/dev/disk/by-uuid/${dev#UUID=} -+ [[ $dev != ${dev#LABEL=} ]] && dev=/dev/disk/by-label/${dev#LABEL=} -+ [[ -b $dev ]] || return 1 # oops, not a block device. -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ fi -+ done < /etc/fstab -+ return 1; -+} -+ -+find_root_block_device() { find_block_device /; } -+ -+# Walk all the slave relationships for a given block device. -+# Stop when our helper function returns success -+# $1 = function to call on every found block device -+# $2 = block device in major:minor format -+check_block_and_slaves() { -+ local x -+ [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. -+ "$1" $2 && return -+ check_vol_slaves "$@" && return 0 -+ if [[ -f /sys/dev/block/$2/../dev ]]; then -+ check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0 -+ fi -+ [[ -d /sys/dev/block/$2/slaves ]] || return 1 -+ for x in /sys/dev/block/$2/slaves/*/dev; do -+ [[ -f $x ]] || continue -+ check_block_and_slaves $1 $(cat "$x") && return 0 -+ done -+ return 1 -+} -+ -+get_numeric_dev() { -+ ls -lH "$1" | { read a b c d maj min rest; printf "%d:%d" ${maj%%,} $min;} -+} -+ -+# ugly workaround for the lvm design -+# There is no volume group device, -+# so, there are no slave devices for volume groups. -+# Logical volumes only have the slave devices they really live on, -+# but you cannot create the logical volume without the volume group. -+# And the volume group might be bigger than the devices the LV needs. -+check_vol_slaves() { -+ for i in /dev/mapper/*; do -+ lv=$(get_numeric_dev $i) -+ if [[ $lv = $2 ]]; then -+ vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null) -+ # strip space -+ vg=$(echo $vg) -+ if [[ $vg ]]; then -+ for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \ -+ do -+ check_block_and_slaves $1 $(get_numeric_dev $pv) \ -+ && return 0 -+ done -+ fi -+ fi -+ done -+ return 1 -+} -+ -+# Install a directory, keeping symlinks as on the original system. -+# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file" -+# will create ${initdir}/lib64, ${initdir}/lib64/file, -+# and a symlink ${initdir}/lib -> lib64. -+inst_dir() { -+ local dir="$1" -+ [[ -e ${initdir}$dir ]] && return 0 -+ -+ # iterate over parent directories -+ local file="" -+ local IFS="/" -+ for part in $dir; do -+ [[ $part ]] || continue -+ file="$file/$part" -+ [[ -e ${initdir}$file ]] && continue -+ -+ if [[ -L $file ]]; then -+ # create link as the original -+ local target=$(readlink "$file") -+ ln -sfn "$target" "${initdir}$file" || return 1 -+ # resolve relative path and recursively install destionation -+ [[ $target = ${target##*/} ]] && target="${file%/*}/$target" -+ inst_dir "$target" -+ else -+ # create directory -+ mkdir -p "${initdir}$file" || return 1 -+ fi -+ done -+} -+ -+# $1 = file to copy to ramdisk -+# $2 (optional) Name for the file on the ramdisk -+# Location of the image dir is assumed to be $initdir -+# We never overwrite the target if it exists. -+inst_simple() { -+ local src target -+ [[ -f $1 ]] || return 1 -+ src=$1 target="${2:-$1}" -+ if ! [[ -d ${initdir}$target ]]; then -+ [[ -e ${initdir}$target ]] && return 0 -+ inst_dir "${target%/*}" -+ fi -+ dinfo "Installing $src" -+ cp -pfL "$src" "${initdir}$target" -+} -+ -+# find symlinks linked to given library file -+# $1 = library file -+# Function searches for symlinks by stripping version numbers appended to -+# library filename, checks if it points to the same target and finally -+# prints the list of symlinks to stdout. -+# -+# Example: -+# rev_lib_symlinks libfoo.so.8.1 -+# output: libfoo.so.8 libfoo.so -+# (Only if libfoo.so.8 and libfoo.so exists on host system.) -+rev_lib_symlinks() { -+ [[ ! $1 ]] && return 0 -+ -+ local fn="$1" orig="$(readlink -f "$1")" links='' -+ -+ [[ ${fn} =~ .*\.so\..* ]] || return 1 -+ -+ until [[ ${fn##*.} == so ]]; do -+ fn="${fn%.*}" -+ [[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}" -+ done -+ -+ echo ${links} -+} -+ -+# Same as above, but specialized to handle dynamic libraries. -+# It handles making symlinks according to how the original library -+# is referenced. -+inst_library() { -+ local src=$1 dest=${2:-$1} lib reallib symlink -+ [[ -e $initdir$dest ]] && return 0 -+ if [[ -L $src ]]; then -+ reallib=$(readlink -f "$src") -+ lib=${src##*/} -+ inst_simple "$reallib" "$reallib" -+ inst_dir "${dest%/*}" -+ (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib") -+ else -+ inst_simple "$src" "$dest" -+ fi -+ -+ # Create additional symlinks. See rev_symlinks description. -+ for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do -+ [[ ! -e $initdir$symlink ]] && { -+ dinfo "Creating extra symlink: $symlink" -+ inst_symlink $symlink -+ } -+ done -+} -+ -+# find a binary. If we were not passed the full path directly, -+# search in the usual places to find the binary. -+find_binary() { -+ local binpath="/bin /sbin /usr/bin /usr/sbin" p -+ [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } -+ for p in $binpath; do -+ [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# Same as above, but specialized to install binary executables. -+# Install binary executable, and all shared library dependencies, if any. -+inst_binary() { -+ local bin target -+ bin=$(find_binary "$1") || return 1 -+ target=${2:-$bin} -+ inst_symlink $bin $target && return 0 -+ local LDSO NAME IO FILE ADDR I1 n f TLIBDIR -+ [[ -e $initdir$target ]] && return 0 -+ # I love bash! -+ LC_ALL=C ldd $bin 2>/dev/null | while read line; do -+ [[ $line = 'not a dynamic executable' ]] && return 1 -+ if [[ $line =~ not\ found ]]; then -+ derror "Missing a shared library required by $bin." -+ derror "Run \"ldd $bin\" to find out what it is." -+ derror "dracut cannot create an initrd." -+ exit 1 -+ fi -+ so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)' -+ [[ $line =~ $so_regex ]] || continue -+ FILE=${BASH_REMATCH[1]} -+ [[ -e ${initdir}$FILE ]] && continue -+ # see if we are loading an optimized version of a shared lib. -+ lib_regex='^(/lib[^/]*).*' -+ if [[ $FILE =~ $lib_regex ]]; then -+ TLIBDIR=${BASH_REMATCH[1]} -+ BASE=${FILE##*/} -+ # prefer nosegneg libs, then unoptimized ones. -+ for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do -+ [[ -e $f/$BASE ]] || continue -+ FILE=$f/$BASE -+ break -+ done -+ inst_library "$FILE" "$TLIBDIR/$BASE" -+ IF_dynamic=yes -+ continue -+ fi -+ inst_library "$FILE" -+ done -+ inst_simple "$bin" "$target" -+} -+ -+# same as above, except for shell scripts. -+# If your shell script does not start with shebang, it is not a shell script. -+inst_script() { -+ [[ -f $1 ]] || return 1 -+ local line -+ read -r -n 80 line <"$1" -+ # If debug is set, clean unprintable chars to prevent messing up the term -+ [[ $debug ]] && line=$(echo -n "$line" | tr -c -d '[:print:][:space:]') -+ shebang_regex='(#! *)(/[^ ]+).*' -+ [[ $line =~ $shebang_regex ]] || return 1 -+ inst "${BASH_REMATCH[2]}" && inst_simple "$@" -+} -+ -+# same as above, but specialized for symlinks -+inst_symlink() { -+ local src=$1 target=$initdir${2:-$1} realsrc -+ [[ -L $1 ]] || return 1 -+ [[ -L $target ]] && return 0 -+ realsrc=$(readlink -f "$src") -+ [[ $realsrc = ${realsrc##*/} ]] && realsrc=${src%/*}/$realsrc -+ inst "$realsrc" && mkdir -p "${target%/*}" && \ -+ ln -s "$realsrc" "$target" -+} -+ -+# find a udev rule in the usual places. -+find_rule() { -+ [[ -f $1 ]] && { echo "$1"; return 0; } -+ for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do -+ [[ -f $r/$1 ]] && { echo "$r/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# udev rules always get installed in the same place, so -+# create a function to install them to make life simpler. -+inst_rules() { -+ local target=/etc/udev/rules.d rule found -+ -+ inst_dir "/lib/udev/rules.d" -+ inst_dir "$target" -+ for rule in "$@"; do -+ found=$(find_rule "$rule") && \ -+ inst_simple "$found" "$target/${found##*/}" \ -+ || dinfo "Skipping udev rule: $rule" -+ done -+} -+ -+# general purpose installation function -+# Same args as above. -+inst() { -+ case $# in -+ 1) ;; -+ 2) [[ ! $initdir && -d $2 ]] && export initdir=$2 -+ [[ $initdir = $2 ]] && set $1;; -+ 3) [[ -z $initdir ]] && export initdir=$2 -+ set $1 $3;; -+ *) derror "inst only takes 1 or 2 or 3 arguments" -+ exit 1;; -+ esac -+ for x in inst_symlink inst_script inst_binary inst_simple; do -+ $x "$@" && return 0 -+ done -+ return 1 -+} -+ -+# install function specialized for hooks -+# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook -+# All hooks should be POSIX/SuS compliant, they will be sourced by init. -+inst_hook() { -+ if ! [[ -f $3 ]]; then -+ derror "Cannot install a hook ($3) that does not exist." -+ derror "Aborting initrd creation." -+ exit 1 -+ elif ! strstr "$hookdirs" "$1"; then -+ derror "No such hook type $1. Aborting initrd creation." -+ exit 1 -+ fi -+ inst_simple "$3" "/${1}/${2}${3##*/}" -+} -+ -+dracut_install() { -+ if [[ $1 = '-o' ]]; then -+ local optional=yes -+ shift -+ fi -+ while (($# > 0)); do -+ if ! inst "$1" ; then -+ if [[ $optional = yes ]]; then -+ dwarning "Skipping program $1 as it cannot be found and is flagged to be optional" -+ else -+ derror "Failed to install $1" -+ exit 1 -+ fi -+ fi -+ shift -+ done -+} -+ -+# install function decompressing the target and handling symlinks -+# $@ = list of compressed (gz or bz2) files or symlinks pointing to such files -+# -+# Function install targets in the same paths inside overlay but decompressed -+# and without extensions (.gz, .bz2). -+inst_decompress() { -+ local src dst realsrc realdst cmd -+ -+ for src in $@ -+ do -+ case ${src} in -+ *.gz) cmd='gzip -d' ;; -+ *.bz2) cmd='bzip2 -d' ;; -+ *) return 1 ;; -+ esac -+ -+ if [[ -L ${src} ]] -+ then -+ realsrc="$(readlink -f ${src})" # symlink target with extension -+ dst="${src%.*}" # symlink without extension -+ realdst="${realsrc%.*}" # symlink target without extension -+ mksubdirs "${initdir}/${src}" -+ # Create symlink without extension to target without extension. -+ ln -s "${realdst}" "${initdir}/${dst}" -+ fi -+ -+ # If the source is symlink we operate on its target. -+ [[ ${realsrc} ]] && src=${realsrc} -+ inst ${src} -+ # Decompress with chosen tool. We assume that tool changes name e.g. -+ # from 'name.gz' to 'name'. -+ ${cmd} "${initdir}${src}" -+ done -+} -+ -+# It's similar to above, but if file is not compressed, performs standard -+# install. -+# $@ = list of files -+inst_opt_decompress() { -+ local src -+ -+ for src in $@ -+ do -+ inst_decompress "${src}" || inst "${src}" -+ done -+} -+ -+module_check() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we are unconditionally included -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check $hostonly -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func check || return 0 -+ check -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_depends() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we have no deps -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check -d -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func depends || return 0 -+ depends -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_install() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/install ]] && . "$moddir/install" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func install || return 0 -+ install -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_installkernel() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/installkernel ]] && . "$moddir/installkernel" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func installkernel || return 0 -+ installkernel -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+check_module() { -+ local mod=$1; -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ local moddep; -+ # If we are already scheduled to be loaded, no need to check again. -+ strstr " $mods_to_load " " $mod " && return 0 -+ strstr " $mods_checked_as_dep " " $mod " && return 1 -+ -+ # This should never happen, but... -+ [[ -d $moddir ]] || return 1 -+ -+ [[ $2 ]] || mods_checked_as_dep+=" $mod " -+ -+ strstr " $omit_dracutmodules " " $mod " && return 1 -+ -+ if strstr " $dracutmodules $add_dracutmodules " " $mod "; then -+ module_check $mod; ret=$? -+ # explicit module, so also accept ret=255 -+ [[ $ret = 0 || $ret = 255 ]] || return 1 -+ else -+ # module not in our list -+ if [[ $dracutmodules = all ]]; then -+ # check, if we can and should install this module -+ module_check $mod || return 1 -+ else -+ # skip this module -+ return 1 -+ fi -+ fi -+ -+ for moddep in $(module_depends $mod); do -+ # handle deps as if they were manually added -+ strstr " $add_dracutmodules " " $moddep " || \ -+ add_dracutmodules+=" $moddep " -+ # if a module we depend on fail, fail also -+ check_module $moddep || return 1 -+ done -+ -+ strstr " $mods_to_load " " $mod " || \ -+ mods_to_load+=" $mod " -+ -+ return 0 -+} -+ -+check_module_dir() { -+ local modcheck; -+ local mod; -+ mods_to_load="" -+ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do -+ local mod=${moddir##*/}; mod=${mod#[0-9][0-9]} -+ check_module $mod 1 -+ done -+} -+ -+# Install a single kernel module along with any firmware it may require. -+# $1 = full path to kernel module to install -+install_kmod_with_fw() { -+ local modname=${1##*/} fwdir found -+ modname=${modname%.ko*} -+ inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \ -+ return 0 # no need to go further if the module is already installed -+ for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do -+ found='' -+ for fwdir in $fw_dir; do -+ if [[ -d $fwdir && -f $fwdir/$fw ]]; then -+ inst_simple "$fwdir/$fw" "/lib/firmware/$fw" -+ found=yes -+ fi -+ done -+ if [[ $found != yes ]]; then -+ dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\"" -+ fi -+ done -+} -+ -+# Do something with all the dependencies of a kernel module. -+# Note that kernel modules depend on themselves using the technique we use -+# $1 = function to call for each dependency we find -+# It will be passed the full path to the found kernel module -+# $2 = module to get dependencies for -+# rest of args = arguments to modprobe -+for_each_kmod_dep() { -+ local func=$1 kmod=$2 cmd modpapth options -+ shift 2 -+ modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \ -+ while read cmd modpath options; do -+ [[ $cmd = insmod ]] || continue -+ $func $modpath -+ done -+} -+ -+# filter kernel modules to install certain modules that meet specific -+# requirements. -+# $1 = function to call with module name to filter. -+# This function will be passed the full path to the module to test. -+# The behaviour of this function can vary depending on whether $hostonly is set. -+# If it is, we will only look at modules that are already in memory. -+# If it is not, we will look at all kernel modules -+# This function returns the full filenames of modules that match $1 -+filter_kernel_modules () ( -+ if ! [[ $hostonly ]]; then -+ filtercmd='find "$srcmods/kernel/drivers" "$srcmods/extra" "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz" 2>/dev/null' -+ else -+ filtercmd='cut -d " " -f 1 /dev/null' -+ fi -+ for modname in $(eval $filtercmd); do -+ case $modname in -+ *.ko) "$1" "$modname" && echo "$modname";; -+ *.ko.gz) gzip -dc "$modname" > $initdir/$$.ko -+ $1 $initdir/$$.ko && echo "$modname" -+ rm -f $initdir/$$.ko;; -+ esac -+ done -+) -+ -+# install kernel modules along with all their dependencies. -+instmods() { -+ [[ $no_kernel = yes ]] && return -+ local mod mpargs modpath modname cmd moddirname -+ while (($# > 0)); do -+ mod=${1%.ko*} -+ case $mod in -+ =*) -+ # This introduces 2 incompatible meanings for =* arguments -+ # to instmods. We need to decide which one to keep. -+ if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then -+ instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block") -+ elif [ -f $srcmods/modules.${mod#=} ]; then -+ instmods $mpargs $(cat ${srcmods}/modules.${mod#=} ) -+ else -+ instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*") -+ fi -+ ;; -+ --*) -+ mod=${mod##*/} -+ mpargs+=" $mod";; -+ i2o_scsi) shift; continue;; # Do not load this diagnostic-only module -+ *) mod=${mod##*/} -+ # if we are already installed, skip this module and go on -+ # to the next one. -+ [[ -f $initdir/$1 ]] && { shift; continue; } -+ # If we are building a host-specific initramfs and this -+ # module is not already loaded, move on to the next one. -+ [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \ -+ ! echo $add_drivers | grep -qe "\<${mod}\>" && { -+ shift; continue; -+ } -+ -+ # We use '-d' option in modprobe only if modules prefix path -+ # differs from default '/'. This allows us to use Dracut with -+ # old version of modprobe which doesn't have '-d' option. -+ moddirname=${srcmods%%/lib/modules/*} -+ [[ -n ${moddirname} ]] && moddirname="-d ${moddirname}/" -+ -+ # ok, load the module, all its dependencies, and any firmware -+ # it may require -+ for_each_kmod_dep install_kmod_with_fw $mod \ -+ --set-version $kernel ${moddirname} -+ ;; -+ esac -+ shift -+ done -+} -diff --git gen_cmdline.sh gen_cmdline.sh -index b3e451d..36afb2e 100755 ---- gen_cmdline.sh -+++ gen_cmdline.sh -@@ -22,6 +22,7 @@ longusage() { - echo " --logfile= Output file for debug info" - echo " --color Output debug in color" - echo " --no-color Do not output debug in color" -+ echo " --no-cleartmp Do not clear temp directory" - echo " Kernel Configuration settings" - echo " --menuconfig Run menuconfig after oldconfig" - echo " --no-menuconfig Do not run menuconfig after oldconfig" -@@ -78,6 +79,8 @@ longusage() { - echo " --splash-res= Select splash theme resolutions to install" - echo " --do-keymap-auto Forces keymap selection at boot" - echo " --no-keymap Disables keymap selection support" -+ echo " --udev Include udev in the initramfs" -+ echo " --no-udev Exclude udev from the initramfs" - echo " --lvm Include LVM support" - echo " --mdadm Include MDADM/MDMON support" - echo " --mdadm-config= Use file as mdadm.conf in initramfs" -@@ -97,6 +100,8 @@ longusage() { - echo " --unionfs Include support for unionfs" - echo " --netboot Create a self-contained env in the initramfs" - echo " --real-root= Specify a default for real_root=" -+ echo " --lscpi Include lspci into the initramfs" -+ echo " --no-lscpi Exclude lspci from the initramfs" - echo " Internals" - echo " --arch-override= Force to arch instead of autodetect" - echo " --cachedir= Override the default cache location" -@@ -232,6 +237,30 @@ parse_cmdline() { - CMD_KEYMAP=0 - print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" - ;; -+ --udev) -+ CMD_UDEV=1 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --no-udev) -+ CMD_UDEV=0 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --lspci) -+ CMD_LSPCI=1 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --no-lspci) -+ CMD_LSPCI=0 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --nfsutils) -+ CMD_NFSUTILS=1 -+ print_info 2 "CMD_NFSUTILS: ${CMD_NFSUTILS}" -+ ;; -+ --no-nfsutils) -+ CMD_NFSUTILS=0 -+ print_info 2 "CMD_NFSUTILS: ${CMD_NFSUTILS}" -+ ;; - --lvm) - CMD_LVM=1 - print_info 2 "CMD_LVM: ${CMD_LVM}" -@@ -441,6 +470,10 @@ parse_cmdline() { - print_info 2 "USECOLOR: ${USECOLOR}" - setColorVars - ;; -+ --no-cleartmp) -+ NOCLEARTMP=1 -+ print_info 2 "NOCLEARTMP: ${NOCLEARTMP}" -+ ;; - --logfile=*) - CMD_LOGFILE=`parse_opt "$*"` - LOGFILE=`parse_opt "$*"` -diff --git gen_compile.sh gen_compile.sh -index 0758c3a..8a2339a 100755 ---- gen_compile.sh -+++ gen_compile.sh -@@ -407,7 +407,10 @@ compile_busybox() { - yes '' 2>/dev/null | compile_generic oldconfig utils - - print_info 1 'busybox: >> Compiling...' -+ OLDLOGLEVEL=$LOGLEVEL -+ LOGLEVEL=1 - compile_generic all utils -+ LOGLEVEL=$OLDLOGLEVEL - print_info 1 'busybox: >> Copying to cache...' - [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] || - gen_die 'Busybox executable does not exist!' -diff --git gen_determineargs.sh gen_determineargs.sh -index ce479cb..eb23120 100755 ---- gen_determineargs.sh -+++ gen_determineargs.sh -@@ -107,6 +107,9 @@ determine_real_args() { - set_config_with_override BOOL SYMLINK CMD_SYMLINK - set_config_with_override STRING INSTALL_MOD_PATH CMD_INSTALL_MOD_PATH - set_config_with_override BOOL OLDCONFIG CMD_OLDCONFIG -+ set_config_with_override BOOL UDEV CMD_UDEV -+ set_config_with_override BOOL LSPCI CMD_LSPCI -+ set_config_with_override BOOL NFSUTILS CMD_NFSUTILS - set_config_with_override BOOL LVM CMD_LVM - set_config_with_override BOOL DMRAID CMD_DMRAID - set_config_with_override BOOL ISCSI CMD_ISCSI -diff --git gen_initramfs.sh gen_initramfs.sh -index 7fe4421..2e936e9 100755 ---- gen_initramfs.sh -+++ gen_initramfs.sh -@@ -56,7 +56,13 @@ append_busybox() { - chmod +x "${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/default.script" - - # Set up a few default symlinks -- for i in ${BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}; do -+ if isTrue "${UDEV}" -+ then -+ BUSYBOX_APPLETS="${BUSYBOX_APPLETS:-[ ash sh uname echo cut cat}" -+ else -+ BUSYBOX_APPLETS="{$BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}" -+ fi -+ for i in ${BUSYBOX_APPLETS}; do - rm -f ${TEMP}/initramfs-busybox-temp/bin/$i > /dev/null - ln -s busybox ${TEMP}/initramfs-busybox-temp/bin/$i || - gen_die "Busybox error: could not link ${i}!" -@@ -410,7 +416,7 @@ append_firmware() { - IFS="," - for i in ${FIRMWARE_FILES} - do -- cp -L "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ -+ cp -rL "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ - done - IFS=$OLD_IFS - else -@@ -438,9 +444,76 @@ append_gpg() { - chmod a+x "${TEMP}/initramfs-gpg-temp/sbin/gpg" - cd "${TEMP}/initramfs-gpg-temp/" - find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" - rm -rf "${TEMP}/initramfs-gpg-temp" > /dev/null - } - -+append_udev() { -+ if [ -d "${TEMP}/initramfs-udev-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-udev-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-udev-temp/" -+ udevmod="${GK_SHARE}/modules/udev-rules/" -+ source ${udevmod}/module-setup.sh -+ initdir=${TEMP}/initramfs-udev-temp \ -+ moddir=${udevmod} \ -+ libdir=/lib/ \ -+ usrlibdir=/usr/lib/ \ -+ install_module -+ -+ if isTrue $LSPCI -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ fi -+ if isTrue $NFSUTILS -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /sbin/mount.nfs /etc/services /etc/protocols /etc/netconfig -+ fi -+ # find net modules and sound -+ (for pathname in ${INSTALL_MOD_PATH}/lib/modules/${KV}/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/drivers/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/sound -+ do -+ [[ -d $pathname ]] && find $pathname -name "*.ko" -+ done | -+ while read module;do -+ # add them prefix blacklist -+ echo "blacklist `basename $module .ko`"; -+ # concat with ready blacklist.conf -+ done;cat "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf") | -+ # sort and rewrite blacklist.conf -+ sort | uniq > "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" -+ mv "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" \ -+ "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf" -+ -+ cd "${TEMP}/initramfs-udev-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-udev-temp" > /dev/null -+} -+ -+append_lspci() { -+ if [ -d "${TEMP}/initramfs-lspci-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-lspci-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-lspci-temp/" -+ -+ initdir=${TEMP}/initramfs-lspci-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ -+ cd "${TEMP}/initramfs-lspci-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-lspci-temp" > /dev/null -+} -+ - print_list() - { - local x -@@ -489,6 +562,11 @@ append_modules() { - print_list ${!group_modules} > "${TEMP}/initramfs-modules-${KV}-temp/etc/modules/${group}" - done - cd "${TEMP}/initramfs-modules-${KV}-temp/" -+ # remove sound and media -+ for x in `find . -type d -name media -o -type d -name sound` -+ do -+ rm -r "${x}" &>/dev/null -+ done - find . | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ - || gen_die "compressing modules cpio" - cd "${TEMP}" -@@ -561,11 +639,14 @@ append_auxilary() { - done - echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" - -- if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ if ! isTrue "${UDEV}" - then -- cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -- else -- cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ then -+ cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ else -+ cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ fi - fi - if isTrue $CMD_DOKEYMAPAUTO - then -@@ -582,7 +663,7 @@ append_auxilary() { - chmod +x "${TEMP}/initramfs-aux-temp/init" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" -- chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ isTrue "${UDEV}" || chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" - - if isTrue ${NETBOOT} - then -@@ -609,6 +690,21 @@ append_data() { - fi - } - -+pack_cpio() { -+ print_info 1 " >> Pack cpio data..." -+ if [ -d "${TEMP}/initramfs-repack-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-repack-temp" -+ fi -+ mkdir -p "${TEMP}/initramfs-repack-temp" -+ cd "${TEMP}/initramfs-repack-temp" -+ # unpack and pack cpio remove double files -+ cpio -di <${CPIO} 2>/dev/null -+ find . -print | cpio ${CPIO_ARGS} | gzip -9 >"${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-repack-temp" > /dev/null -+} -+ - create_initramfs() { - print_info 1 "initramfs: >> Initializing..." - -@@ -619,6 +715,11 @@ create_initramfs() { - - append_data 'base_layout' - append_data 'auxilary' "${BUSYBOX}" -+ append_data 'udev' "${UDEV}" -+ if ! isTrue "${UDEV}" -+ then -+ append_data 'lspci' "${LSPCI}" -+ fi - append_data 'busybox' "${BUSYBOX}" - append_data 'lvm' "${LVM}" - append_data 'dmraid' "${DMRAID}" -@@ -652,8 +753,7 @@ create_initramfs() { - append_data 'overlay' - fi - -- gzip -9 "${CPIO}" -- mv -f "${CPIO}.gz" "${CPIO}" -+ pack_cpio - - if isTrue "${INTEGRATED_INITRAMFS}" - then -diff --git genkernel genkernel -index 0a06cdd..1486c61 100755 ---- genkernel -+++ genkernel -@@ -9,6 +9,7 @@ GK_V='3.4.18' - TMPDIR='/var/tmp/genkernel' - - TODEBUGCACHE=1 # Until an error occurs or LOGFILE is fully qualified. -+NOCLEARTMP=0 - - small_die() { - echo $1 -@@ -45,6 +46,7 @@ source ${GK_SHARE}/gen_initramfs.sh || gen_die "Could not read ${GK_SHARE}/gen_i - source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_moddeps.sh" - source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh" - source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh" -+source ${GK_SHARE}/dracut_funcs.sh || gen_die "Could not read ${GK_SHARE}/dracut_funcs.sh" - - TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ - -@@ -55,21 +57,25 @@ trap_cleanup(){ - } - - cleanup(){ -- if [ -n "$TEMP" -a -d "$TEMP" ]; then -- rm -rf "$TEMP" -- fi -- -- if isTrue ${POSTCLEAR} -- then -- echo -- print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -- print_info 1 "CACHE_DIR: ${CACHE_DIR}" -- CLEAR_CACHE_DIR='yes' -- setup_cache_dir -- echo -- print_info 1 "TMPDIR: ${TMPDIR}" -- clear_tmpdir -- fi -+ if [[ ${NOCLEARTMP} -ne 0 ]] -+ then -+ return -+ fi -+ if [ -n "$TEMP" -a -d "$TEMP" ]; then -+ rm -rf "$TEMP" &>/dev/null -+ fi -+ -+ if isTrue ${POSTCLEAR} -+ then -+ echo -+ print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -+ print_info 1 "CACHE_DIR: ${CACHE_DIR}" -+ CLEAR_CACHE_DIR='yes' -+ setup_cache_dir -+ echo -+ print_info 1 "TMPDIR: ${TMPDIR}" -+ clear_tmpdir -+ fi - } - - trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL -diff --git genkernel.conf genkernel.conf -index 24fcd54..b61f1fa 100644 ---- genkernel.conf -+++ genkernel.conf -@@ -52,6 +52,15 @@ USECOLOR="yes" - # argument is: *+1 - # MAKEOPTS="-j2" - -+# Add udev to initramfs -+UDEV="yes" -+ -+# Add lspci to initramfs -+LSPCI="yes" -+ -+# add ntfs-utils to initramfs -+NFSUTILS="yes" -+ - # Add in LVM support from static binaries if they exist on the system, or - # compile static LVM binaries if static ones do not exist. - # LVM="no" -@@ -92,7 +101,7 @@ USECOLOR="yes" - # Specify directory to pull from - # FIRMWARE_DIR="/lib/firmware" - # Specify specific firmware files to include. This overrides FIRMWARE_DIR --# FIRMWARE_FILES="" -+FIRMWARE_FILES="/lib/firmware/radeon" - - # Enable disklabel support (copies blkid to initrd) - DISKLABEL="yes" -diff --git modules/udev-rules/01-ignore.rules modules/udev-rules/01-ignore.rules -new file mode 100644 -index 0000000..b32f22e ---- /dev/null -+++ modules/udev-rules/01-ignore.rules -@@ -0,0 +1 @@ -+KERNEL=="ram[0-9]*", OPTIONS+="ignore_device", OPTIONS+="last_rule" -diff --git modules/udev-rules/59-persistent-storage-volid.rules modules/udev-rules/59-persistent-storage-volid.rules -new file mode 100644 -index 0000000..0b798e6 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage-volid.rules -@@ -0,0 +1,7 @@ -+SUBSYSTEM!="block", GOTO="psv_end" -+ACTION!="add|change", GOTO="psv_end" -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="cciss[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", IMPORT{program}="vol_id --export $tempnode" -+LABEL="psv_end" -diff --git modules/udev-rules/59-persistent-storage.rules modules/udev-rules/59-persistent-storage.rules -new file mode 100644 -index 0000000..2b83e72 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage.rules -@@ -0,0 +1,38 @@ -+SUBSYSTEM!="block", GOTO="ps_end" -+ACTION!="add|change", GOTO="ps_end" -+ -+KERNEL=="cciss[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end" -+ -+# partitions have no md/{array_state,metadata_version} -+ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" -+ -+# container devices have a metadata version of e.g. 'external:ddf' and -+# never leave state 'inactive' -+ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -+TEST!="md/array_state", GOTO="md_end" -+ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -+ -+LABEL="md_ignore_state" -+ -+IMPORT{program}="/sbin/mdadm --detail --export $tempnode" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+OPTIONS+="link_priority=100" -+OPTIONS+="watch" -+LABEL="md_end" -+ -+ -+KERNEL!="dm-[0-9]*", GOTO="ps_end" -+ACTION=="add", GOTO="ps_end" -+IMPORT{program}="/sbin/dmsetup info -c --nameprefixes --unquoted --rows --noheadings -o name,uuid,suspended,readonly,major,minor,open,tables_loaded,names_using_dev -j%M -m%m" -+ENV{DM_NAME}!="?*", GOTO="ps_end" -+ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="ps_end" -+ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="ps_end" -+ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="ps_end" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+LABEL="ps_end" -diff --git modules/udev-rules/61-persistent-storage.rules modules/udev-rules/61-persistent-storage.rules -new file mode 100644 -index 0000000..9cfdb0b ---- /dev/null -+++ modules/udev-rules/61-persistent-storage.rules -@@ -0,0 +1,20 @@ -+SUBSYSTEM!="block", GOTO="pss_end" -+ACTION!="add|change", GOTO="pss_end" -+ -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss" -+KERNEL=="cciss[0-9]*", GOTO="do_pss" -+KERNEL=="nbd[0-9]*", GOTO="do_pss" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", GOTO="do_pss" -+ -+GOTO="pss_end" -+ -+LABEL="do_pss" -+# by-path (parent device path) -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{program}="path_id %p" -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" -+ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" -+ -+# by-label/by-uuid links (filesystem metadata) -+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -+LABEL="pss_end" -diff --git modules/udev-rules/blacklist.conf modules/udev-rules/blacklist.conf -new file mode 100644 -index 0000000..21ac71c ---- /dev/null -+++ modules/udev-rules/blacklist.conf -@@ -0,0 +1,162 @@ -+blacklist ath_pci -+blacklist evbug -+blacklist usbmouse -+blacklist usbkbd -+blacklist eepro100 -+blacklist de4x5 -+blacklist eth1394 -+blacklist snd_intel8x0m -+blacklist snd_aw2 -+blacklist i2c_i801 -+blacklist prism54 -+blacklist bcm43xx -+blacklist garmin_gps -+blacklist asus_acpi -+blacklist snd_pcsp -+blacklist pcspkr -+blacklist amd76x_edac -+blacklist ohci1394 -+blacklist sbp2 -+blacklist dv1394 -+blacklist raw1394 -+blacklist video1394 -+blacklist aty128fb -+blacklist atyfb -+blacklist radeonfb -+blacklist cirrusfb -+blacklist cyber2000fb -+blacklist cyblafb -+blacklist gx1fb -+blacklist hgafb -+blacklist i810fb -+blacklist intelfb -+blacklist kyrofb -+blacklist lxfb -+blacklist matroxfb_base -+blacklist neofb -+blacklist nvidiafb -+blacklist pm2fb -+blacklist rivafb -+blacklist s1d13xxxfb -+blacklist savagefb -+blacklist sisfb -+blacklist sstfb -+blacklist tdfxfb -+blacklist tridentfb -+blacklist vesafb -+blacklist vfb -+blacklist viafb -+blacklist vt8623fb -+blacklist ac97 -+blacklist ac97_codec -+blacklist ac97_plugin_ad1980 -+blacklist ad1848 -+blacklist ad1889 -+blacklist adlib_card -+blacklist aedsp16 -+blacklist ali5455 -+blacklist btaudio -+blacklist cmpci -+blacklist cs4232 -+blacklist cs4281 -+blacklist cs461x -+blacklist cs46xx -+blacklist emu10k1 -+blacklist es1370 -+blacklist es1371 -+blacklist esssolo1 -+blacklist forte -+blacklist gus -+blacklist i810_audio -+blacklist kahlua -+blacklist mad16 -+blacklist maestro -+blacklist maestro3 -+blacklist maui -+blacklist mpu401 -+blacklist nm256_audio -+blacklist opl3 -+blacklist opl3sa -+blacklist opl3sa2 -+blacklist pas2 -+blacklist pss -+blacklist rme96xx -+blacklist sb -+blacklist sb_lib -+blacklist sgalaxy -+blacklist sonicvibes -+blacklist sound -+blacklist sscape -+blacklist trident -+blacklist trix -+blacklist uart401 -+blacklist uart6850 -+blacklist via82cxxx_audio -+blacklist v_midi -+blacklist wavefront -+blacklist ymfpci -+blacklist ac97_plugin_wm97xx -+blacklist ad1816 -+blacklist audio -+blacklist awe_wave -+blacklist dmasound_core -+blacklist dmasound_pmac -+blacklist harmony -+blacklist sequencer -+blacklist soundcard -+blacklist usb-midi -+blacklist acquirewdt -+blacklist advantechwdt -+blacklist alim1535_wdt -+blacklist alim7101_wdt -+blacklist booke_wdt -+blacklist cpu5wdt -+blacklist eurotechwdt -+blacklist i6300esb -+blacklist i8xx_tco -+blacklist ib700wdt -+blacklist ibmasr -+blacklist indydog -+blacklist iTCO_wdt -+blacklist it8712f_wdt -+blacklist it87_wdt -+blacklist ixp2000_wdt -+blacklist ixp4xx_wdt -+blacklist machzwd -+blacklist mixcomwd -+blacklist mpc8xx_wdt -+blacklist mpcore_wdt -+blacklist mv64x60_wdt -+blacklist pc87413_wdt -+blacklist pcwd -+blacklist pcwd_pci -+blacklist pcwd_usb -+blacklist s3c2410_wdt -+blacklist sa1100_wdt -+blacklist sbc60xxwdt -+blacklist sbc7240_wdt -+blacklist sb8360 -+blacklist sc1200wdt -+blacklist sc520_wdt -+blacklist sch311_wdt -+blacklist scx200_wdt -+blacklist shwdt -+blacklist smsc37b787_wdt -+blacklist softdog -+blacklist twl4030_wdt -+blacklist w83627hf_wdt -+blacklist w83697hf_wdt -+blacklist w83697ug_wdt -+blacklist w83877f_wdt -+blacklist w83977f_wdt -+blacklist wafer5823wdt -+blacklist wdt -+blacklist wdt_pci -+blacklist wm8350_wdt -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -diff --git modules/udev-rules/load-modules.sh modules/udev-rules/load-modules.sh -new file mode 100755 -index 0000000..36972fd ---- /dev/null -+++ modules/udev-rules/load-modules.sh -@@ -0,0 +1,7 @@ -+#!/bin/sh -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+# Implement blacklisting for udev-loaded modules -+ -+modprobe -b "$@" -diff --git modules/udev-rules/module-setup.sh modules/udev-rules/module-setup.sh -new file mode 100755 -index 0000000..8ef142b ---- /dev/null -+++ modules/udev-rules/module-setup.sh -@@ -0,0 +1,71 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+install_module() { -+ # FIXME: would be nice if we didn't have to know which rules to grab.... -+ # ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies -+ # of the rules we want so that we just copy those in would be best -+ [[ -x /sbin/udevd ]] && dracut_install udevd -+ dracut_install udevadm /etc/udev/udev.conf /etc/group /bin/mount /sbin/modprobe -+ inst_rules 50-udev-default.rules 60-persistent-storage.rules \ -+ 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \ -+ 60-pcmcia.rules -+ mkdir -p "$initdir"/etc/modprobe.d -+ inst_simple "$moddir/blacklist.conf" /etc/modprobe.d/ -+ -+ # ignore some devices in the initrd -+ inst_rules "$moddir/01-ignore.rules" -+ -+ # for firmware loading -+ inst_rules 50-firmware.rules -+ -+ if [ ! -x /lib/udev/vol_id ]; then -+ inst_rules "$moddir/59-persistent-storage.rules" -+ else -+ inst_rules "$moddir/59-persistent-storage-volid.rules" -+ fi -+ inst_rules "$moddir/61-persistent-storage.rules" -+ -+ for i in \ -+ ata_id \ -+ cdrom_id \ -+ create_floppy_devices \ -+ edd_id \ -+ firmware.sh \ -+ firmware \ -+ firmware.agent \ -+ hotplug.functions \ -+ fw_unit_symlinks.sh \ -+ hid2hci \ -+ path_id \ -+ scsi_id \ -+ dmsetup \ -+ usb_id \ -+ vol_id \ -+ pcmcia-socket-startup \ -+ pcmcia-check-broken-cis \ -+ udevd \ -+ ; do -+ for utilpath in /lib/udev /sbin /bin -+ do -+ if [ -e $utilpath/$i.static ] -+ then -+ inst_binary $utilpath/$i.static $utilpath/$i -+ else -+ [ -e $utilpath/$i ] && dracut_install $utilpath/$i -+ fi -+ done -+ done -+ -+ if ! [ -e "$initdir/sbin/udevd" ]; then -+ if [ -x /lib/udev/udevd ]; then -+ ln -s /lib/udev/udevd "$initdir/sbin/udevd" -+ fi -+ fi -+ -+ for i in {"$libdir","$usrlibdir"}/libnss_files*; do -+ [ -e "$i" ] && dracut_install "$i" -+ done -+} -+ diff --git a/sys-kernel/calckernel/files/calckernel-3.4.18-r14.patch b/sys-kernel/calckernel/files/calckernel-3.4.18-r14.patch deleted file mode 100644 index 1033c94a1..000000000 --- a/sys-kernel/calckernel/files/calckernel-3.4.18-r14.patch +++ /dev/null @@ -1,2191 +0,0 @@ -diff --git defaults/busy-config defaults/busy-config -index 51fdc8e..a1f6858 100644 ---- defaults/busy-config -+++ defaults/busy-config -@@ -462,7 +462,7 @@ CONFIG_MDSTART=y - CONFIG_MORE=y - CONFIG_FEATURE_USE_TERMIOS=y - CONFIG_MOUNT=y --CONFIG_FEATURE_MOUNT_NFS=y -+CONFIG_FEATURE_MOUNT_NFS=n - # CONFIG_FEATURE_MOUNT_CIFS is not set - CONFIG_FEATURE_MOUNT_FLAGS=y - CONFIG_FEATURE_MOUNT_FSTAB=y -diff --git defaults/initrd.defaults defaults/initrd.defaults -index 76d72a7..0c059a5 100755 ---- defaults/initrd.defaults -+++ defaults/initrd.defaults -@@ -68,6 +68,7 @@ fi - - REAL_ROOT='' - CDROOT='0' -+SCRATCH='0' - CDROOT_DEV='' - CDROOT_TYPE='auto' - NEW_ROOT='/newroot' -diff --git defaults/initrd.scripts defaults/initrd.scripts -index 51ebcce..8007347 100755 ---- defaults/initrd.scripts -+++ defaults/initrd.scripts -@@ -187,23 +187,45 @@ cache_cd_contents() { - # TODO: Check the size of the image versus the size of our tmpfs - # along with the amount of available RAM and increase tmpfs size - # if necessary. (Not having awk sucks...) -- # z=0 -- # for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -- # cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; do -- # z=$(($z + $i)) ; done -- # echo $z -- good_msg "Copying loop file for caching..." -- # Verify that the needed directory exists -- mkdir -p "$(dirname ${NEW_ROOT}/mnt/${LOOP})" -- cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/${LOOP} -- if [ $? -ne 0 ] -+ -+ # getting memory -+ allmemory=0 -+ for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -+ cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; -+ do -+ allmemory=$(($allmemory + $i)) -+ done -+ -+ # getting size tmpfs of default -+ let curtfs=$allmemory/2 -+ -+ # getting size of image -+ let imagesize=`ls -la ${NEW_ROOT}/mnt/cdrom/${LOOP} | sed -r -n 's/(\S*\s*){4}(\S*).*/\2/p'`/20000*21 -+ let addon=$imagesize/10 -+ if [[ $curtfs -gt $(( ${imagesize} + ${addon} )) ]]; -+ then -+ let addon=$(( $curtfs - ${imagesize} )) -+ fi -+ -+ if [[ $((${imagesize} + $addon)) -lt ${allmemory} ]]; - then -- bad_msg "Failed to cache the loop file! Lack of space?" -- rm -rf ${NEW_ROOT}/mnt/livecd.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/image.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/zisofs 2>/dev/null -+ mount -o remount,size=${addon}000 -t tmpfs tmpfs ${NEW_ROOT} -+ mkdir ${NEW_ROOT}/mnt/squash -+ mount -o size=${imagesize}000 -t tmpfs tmpfs ${NEW_ROOT}/mnt/squash -+ good_msg "Copying loop file for caching..." -+ cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/squash/${LOOP} -+ if [ $? -ne 0 ] -+ then -+ bad_msg "Failed to cache the loop file! Lack of space?" -+ umount ${NEW_ROOT}/mnt/squash -+ mount -o remount,size=${curtfs}000 -t tmpfs tmpfs ${NEW_ROOT} -+ else -+ LOOPEXT='../squash/' -+ good_msg "Unmounting media from ${NEW_ROOT}/mnt/cdrom" -+ umount ${NEW_ROOT}/mnt/cdrom -+ fi - else -- LOOPEXT='../' -+ bad_msg "Too low memory for cache the loop file." - fi - fi - fi -@@ -306,7 +328,9 @@ run_shell() { - /bin/ash - } - --runmdev() { -+make_devfs() { -+ # make /run in root -+ mkdir /run - # Use devtmpfs if enabled in kernel, - # else tmpfs. Always run mdev just in case - devfs=tmpfs -@@ -321,6 +345,10 @@ runmdev() { - # http://git.busybox.net/busybox/plain/docs/mdev.txt - mkdir -m 0755 /dev/pts - mount -t devpts -o gid=5,mode=0620 devpts /dev/pts || bad_msg "Failed to mount /dev/pts" -+} -+ -+runmdev() { -+ make_devfs - mdev -s || bad_msg "Failed to receive dynamic updates from mdev" - } - -@@ -655,7 +683,7 @@ startVolumes() { - [ -d /etc/lvm/cache ] && lvm_commands="${lvm_commands} \nvgscan" - - # To activate volumegroups on all devices in the cache -- lvm_commands="${lvm_commands} \nvgchange -ay --sysinit" -+ lvm_commands="${lvm_commands} \nvgchange -ay --sysinit --noudevsync" - - # And finally execute it all (/proc/... needed if lvm is compiled without readline) - good_msg "Scanning for and activating Volume Groups" -@@ -1082,6 +1110,38 @@ getdvhoff() { - echo $(( $(hexdump -n 4 -s $((316 + 12 * $2)) -e '"%i"' $1) * 512)) - } - -+load_union_module() { -+ UNIONTYPE="" -+ # find module for union file system -+ [ -n "$(find /lib/ -name unionfs.ko)" ] && UNIONTYPE="unionfs" -+ [ -n "$(find /lib/ -name aufs.ko)" ] && UNIONTYPE="aufs" -+ # probably aufs in kernel -+ if [ -n "$(gzip -dc /proc/config.gz | grep CONFIG_AUFS_FS=y )" ] -+ then -+ UNIONTYPE="aufs" -+ else -+ if [ -z "${UNIONTYPE}" ] -+ then -+ bad_msg "Module for union file system is not found!" -+ run_shell -+ else -+ modprobe ${UNIONTYPE} > /dev/null 2>&1 -+ # error on load union module -+ if [ -z "$(lsmod | grep $UNIONTYPE)" ] -+ then -+ bad_msg "Module for union file system is not correct!" -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ bad_msg "Probably kernel compiled without standalone patch." -+ fi -+ run_shell -+ fi -+ -+ good_msg "Loading ${UNIONTYPE}" -+ fi -+ fi -+} -+ - setup_unionfs() { - local rw_dir=$1 - local ro_dir=$2 -@@ -1101,6 +1161,7 @@ setup_unionfs() { - mkdir -p ${UNION} - good_msg "Loading fuse module" - modprobe fuse > /dev/null 2>&1 -+ load_union_module - # if [ -n "${UNIONFS}" ] - # then - # CHANGESDEV=${UNIONFS} -@@ -1130,11 +1191,117 @@ setup_unionfs() { - mkdir /tmp - mkdir -p ${UNION} - # mkdir -p $CHANGES --# mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+## mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+ -+ if [ "${SCRATCH}" -ne 0 ]; -+ then -+ good_msg "Loading in scratch mode" -+ BUILDERDIR=${UNION}/mnt/builder -+ SCRATCHDIR=${UNION}/mnt/scratch -+ DELTADIR=${rw_dir}/mnt/delta -+ WORKSPACEDIR=${rw_dir}/mnt/workspace -+ mount -o remount,rw ${rw_dir}/mnt/cdrom >/dev/null 2>&1 -+ touch ${rw_dir}/mnt/cdrom/livecd >/dev/null 2>&1 -+ if [ "$?" -ne 0 ]; -+ then -+ ISRW=0 -+ else -+ ISRW=1 -+ fi -+ -+ mkdir -p ${DELTADIR} -+ mkdir -p ${WORKSPACEDIR} -+ -+ if [[ -n ${CDROOT_OVERLAY} ]] && [[ -f ${rw_dir}/mnt/cdrom/${CDROOT_OVERLAY} ]] -+ then -+ good_msg "Unpacking ${CDROOT_OVERLAY}" -+ cd ${DELTADIR} -+ tar xf ${rw_dir}/mnt/cdrom/${CDROOT_OVERLAY} -+ fi -+ -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${WORKSPACEDIR}=rw:${DELTADIR}=ro+wh:${rw_dir}/mnt/livecd=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${WORKSPACEDIR}=rw:${DELTADIR}=ro:${rw_dir}/mnt/livecd=ro unionfs ${UNION} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${SCRATCHDIR}/calculate -+ mkdir -p ${SCRATCHDIR}/delta -+ mkdir -p ${SCRATCHDIR}/workspace -+ mount -o bind ${rw_dir}/mnt/delta ${SCRATCHDIR}/delta -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind ${rw_dir}/mnt/workspace ${SCRATCHDIR}/workspace -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${BUILDERDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro none ${BUILDERDIR} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro unionfs ${BUILDERDIR} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind,ro ${rw_dir}/mnt/livecd ${SCRATCHDIR}/calculate -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ if [ "$ISRW" -ne 0 ]; -+ then -+ FLASHDIR=${UNION}/mnt/flash -+ mkdir -p ${FLASHDIR} -+ mount -o bind ${rw_dir}/mnt/cdrom ${FLASHDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ mkdir -p ${CDROMDIR} -+ mount -o bind,ro ${rw_dir}/mnt/cdrom ${CDROMDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ fi -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ LIVECDDIR=${UNION}/mnt/livecd -+ -+ if [[ -n ${CDROOT_OVERLAY} ]] && [[ -f ${rw_dir}/mnt/cdrom/${CDROOT_OVERLAY} ]] -+ then -+ good_msg "Unpacking ${CDROOT_OVERLAY}" -+ cd ${rw_dir} -+ tar xf ${rw_dir}/mnt/cdrom/${CDROOT_OVERLAY} -+ fi -+ -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${rw_dir}:${ro_dir}=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${rw_dir}:${ro_dir}=ro unionfs ${UNION} -+ fi -+ -+ if [[ -n "$( echo ${LOOPEXT} | grep squash )" ]]; -+ then -+ mkdir -p ${UNION}/mnt/squash -+ mount -o bind ${NEW_ROOT}/mnt/squash ${UNION}/mnt/squash &>/dev/null -+ fi -+ -+ chmod 0755 ${UNION} -+ mount -o bind ${rw_dir}/mnt/cdrom ${CDROMDIR} &>/dev/null -+ mount -o bind ${rw_dir}/mnt/livecd ${LIVECDDIR} &>/dev/null -+ ret=$? -+ fi -+ -+ chmod 1777 ${UNION}/tmp - good_msg "Creating union mount" -- unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -- ret=$? -- if [ ${ret} -ne 0 ] -+# unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -+# ret=$? -+ if [ "${ret}" -ne 0 ] - then - bad_msg "Can't setup union mount!" - USE_UNIONFS_NORMAL=0 -@@ -1143,3 +1310,122 @@ setup_unionfs() { - USE_UNIONFS_NORMAL=0 - fi - } -+ -+load_videodrv() { -+ good_msg "Loading frame buffer video driver" -+ # find all available fb drivers -+ videodrv_count=$(find /lib/modules \ -+ -name "nouveau.ko" -o \ -+ -name "uvesafb.ko" -o \ -+ -name "i915.ko" -o \ -+ -name "radeon.ko" | -+ grep -c "") -+ # load specified videodrv -+ modules_list= -+ case "${VIDEODRV}" in -+ nouveau) -+ modules_list="nouveau" -+ ;; -+ radeon) -+ modules_list="radeon" -+ ;; -+ i915|intel) -+ modules_list="i915" -+ ;; -+ ""|auto) -+ # if not livecd and initramfs otimized (aviailable only one video driver) -+ if [ "${CDROOT}" != '1' -a "${videodrv_count}" -le 2 ] -+ then -+ modules_list="nouveau i915 radeon" -+ else -+ if [[ -x /usr/sbin/lspci ]] -+ then -+ if lspci | grep -m1 VGA | grep -qi intel -+ then -+ modules_list="i915" -+ elif lspci | grep -m1 VGA | grep -qi nvidia -+ then -+ modules_list="nouveau" -+ elif lspci | grep -m1 VGA | grep -q -e "Ati" -e "ATI" -+ then -+ modules_list="radeon" -+ else -+ modules_list="" -+ fi -+ else -+ modules_list="i915" -+ fi -+ fi -+ ;; -+ esac -+ for x in $modules_list -+ do -+ if [ "`find /lib/modules -name "${x}.ko" | grep -c ''`" -eq "1" ] -+ then -+ modprobe "${x}" modeset=${USE_MODESET} &>/dev/null -+ lsmod | grep -q "^${x}" && \ -+ [ "`cat /sys/module/${x}/refcnt`" -gt 0 ] && return 0 -+ fi -+ done -+ # else load uvesafb with specified video resolution -+ if [ -n "${VIDEORES}" ] -+ then -+ if ! echo $VIDEORES | grep -q "\-" -+ then -+ VIDEORES="${VIDEORES}-32" -+ fi -+ else -+ VIDEORES="1024x768-32" -+ fi -+ modprobe uvesafb mode_option=${VIDEORES} &>/dev/null -+} -+ -+start_udev() -+{ -+ # start udev -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ echo "" >/proc/sys/kernel/hotplug -+ make_devfs -+ udevd --daemon &>/dev/null -+ udevadm settle -+ fi -+} -+ -+stop_udev() -+{ -+ # kill udevd -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ pkill udevd &>/dev/null -+ fi -+} -+ -+populate_dev() -+{ -+ good_msg 'Activating udev' -+ # Do not run any init-scripts -+ udevadm control --property=do_not_run_plug_service=1 -+ -+ if [ "${REAL_ROOT}" == "/dev/nfs" ] -+ then -+ # clean blacklist because there are net drivers -+ # keep black video for correct loading prop. nvidia -+ cat </etc/modprobe.d/blacklist.conf -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -+EOF -+ fi -+ # discarding net drivers placed into blacklist.conf -+ udevadm trigger --action="add" -+ -+ # we can speed up booting under these conditions: -+ # * using devtmpfs so kernel creates device nodes for us -+ # * only using kernel created device nodes at boot (in /etc/fstab and elsewhere) -+ udevadm settle --timeout=60 -+} -diff --git defaults/linuxrc defaults/linuxrc -index 0843f5d..687f5cc 100755 ---- defaults/linuxrc -+++ defaults/linuxrc -@@ -39,6 +39,14 @@ FAKE_ROOT='' - REAL_ROOTFLAGS='' - ROOTFSTYPE='auto' - CRYPT_SILENT=0 -+VIDEODRV='' -+USE_UDEV=1 -+USE_MODESET=1 -+CDROOT_OVERLAY='cdroot-overlay.tar.bz2' -+if [ -e "/etc/calculate/calculate.ini" ] -+then -+ source /etc/calculate/calculate.ini -+fi - for x in ${CMDLINE} - do - case "${x}" in -@@ -57,6 +65,57 @@ do - init_opts\=*) - INIT_OPTS=`parse_opt "${x}"` - ;; -+ nokms) -+ USE_MODESET=0 -+ ;; -+ kms) -+ USE_MODESET=1 -+ ;; -+ noudev) -+ USE_UDEV=0 -+ ;; -+ calculate\=*) -+ CALCULATE=`parse_opt "${x}"` -+ if [[ "${CALCULATE//:/}" != "${CALCULATE}" ]] -+ then -+ for i in ${CALCULATE//,/ } -+ do -+ case "${i}" in -+ video:*) -+ VIDEODRV=`echo "${i}" | cut -s -d: -f2-` -+ ;; -+ resolution:*) -+ RES=`echo "${i}" | cut -s -d: -f2-` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ ;; -+ esac -+ done -+ else -+ RES=`echo "${CALCULATE}" | cut -s -d, -f4` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ VIDEODRV=`echo "${CALCULATE}" | cut -s -d, -f5` -+ fi -+ ;; -+ video\=*) -+ VR=`parse_opt "${x}"` -+ for i in ${VR//,/ } -+ do -+ if [ -z "${i//[0-9-x@]}" ] -+ then -+ VIDEORES=${i} -+ fi -+ done -+ ;; -+ # Scratch usbload -+ scratch) -+ SCRATCH=1 -+ ;; - # Livecd options - cdroot) - CDROOT=1 -@@ -79,6 +138,9 @@ do - ISOBOOT=`parse_opt "${x}"` - ;; - # Start Volume manager options -+ overlay\=*) -+ CDROOT_OVERLAY=`parse_opt "${x}"` -+ ;; - dolvm) - USE_LVM_NORMAL=1 - ;; -@@ -251,15 +313,24 @@ then - REAL_ROOT="${FAKE_ROOT}" - fi - --splash 'init' -- --cmdline_hwopts -+# check udevd -+[ ! -x /sbin/udevd ] && USE_UDEV=0 - - # Mount sysfs - mount_sysfs - -+# start udev -+start_udev -+ -+# load kernel video driver -+load_videodrv -+ -+splash 'init' -+ -+cmdline_hwopts -+ - # Setup hotplugging for firmware loading --setup_hotplug -+[ "${USE_UDEV}" == "0" ] && setup_hotplug - - # Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel - if [ -z "${DO_modules}" ] -@@ -269,7 +340,7 @@ elif [ -d "/lib/modules/${KV}" ] - then - good_msg 'Loading modules' - # Load appropriate kernel modules -- if [ "${NODETECT}" != '1' ] -+ if [ "${USE_UDEV}" != '1' -a "${NODETECT}" != '1' ] - then - for modules in ${MY_HWOPTS} - do -@@ -285,14 +356,20 @@ fi - # Apply scan delay if specified - sdelay - --# Setup slow USB bits --setup_slowusb -+if [ "${USE_UDEV}" == "1" ] -+then -+ # populate /dev with devices already found by the kernel -+ populate_dev -+else -+ # Setup slow USB bits -+ setup_slowusb - --# Start device manager --start_dev_mgr -+ # Start device manager -+ start_dev_mgr - --# if doslowusb is passed, pause other 10 seconds here, after mdev load --[ "${DO_slowusb}" ] && sleep 10 -+ # if doslowusb is passed, pause other 10 seconds here, after mdev load -+ [ "${DO_slowusb}" ] && sleep 10 -+fi - - # Start iSCSI - if [ -e /bin/iscsistart ] -@@ -509,9 +586,50 @@ do - then - break - else -- bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -- got_good_root=0 -- REAL_ROOT='' -+ # check for scratch -+ if [ -e ${NEW_ROOT}/livecd.squashfs -a -d ${NEW_ROOT}/delta -a -d ${NEW_ROOT}/workspace ]; -+ then -+ good_msg 'Found scratch data...' -+ load_union_module -+ modprobe squashfs >/dev/null -+ if mount -o remount,rw ${NEW_ROOT}; -+ then -+ mkdir -p ${NEW_ROOT}/calculate && mkdir -p /union && mkdir -p ${NEW_ROOT}/workspace/mnt/builder && mkdir -p ${NEW_ROOT}/workspace/mnt/scratch -+ if mount -o loop,ro -t squashfs ${NEW_ROOT}/livecd.squashfs ${NEW_ROOT}/calculate; -+ then -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/workspace=rw:${NEW_ROOT}/delta=ro+wh:${NEW_ROOT}/calculate=ro none /union; -+ then -+ mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/delta=rw:${NEW_ROOT}/calculate=ro none /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers!' -+ run_shell -+ fi -+ else -+ if mount -t unionfs -o ro,dirs=${NEW_ROOT}/workspace:${NEW_ROOT}/delta=ro:${NEW_ROOT}/calculate=ro unionfs /union; -+ then -+ mount -t unionfs -o ro,dirs=${NEW_ROOT}/delta:${NEW_ROOT}/calculate=ro unionfs /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers' -+ run_shell -+ fi -+ fi -+ else -+ bad_msg 'Could not mount scratch squashfs image' -+ fi -+ else -+ bad_msg 'Could not remount ${NEW_ROOT}' -+ fi -+ else -+ bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -+ got_good_root=0 -+ REAL_ROOT='' -+ fi - fi - else - bad_msg "Could not mount specified ROOT, try again" -@@ -723,9 +841,12 @@ cd "${CHROOT}" - mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null - echo -ne "${BOLD}.${NORMAL}" - -+# stop udev before move mount points -+stop_udev -+ - # If devtmpfs is mounted, try move it to the new root - # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise --for fs in /dev /sys /proc -+for fs in "/dev " /sys /proc - do - if grep -qs "$fs" /proc/mounts - then -diff --git defaults/modprobe defaults/modprobe -index ba2d890..9280357 100755 ---- defaults/modprobe -+++ defaults/modprobe -@@ -10,8 +10,6 @@ usage() { - echo - echo 'Example:' - echo ' modprobe eepro100' -- echo -- echo 'Note: Do not pass the suffix to modprobe!' - exit 1 - } - -@@ -81,14 +79,29 @@ modprobe2() { - usage - exit 1 - fi -- real_path=`real_mod_path ${1}` -+ local modname=${1} -+ local quiet='' -+ local params='' -+ shift -+ for x in $@ -+ do -+ case ${x} in -+ -n) -+ quiet=1 -+ ;; -+ *) -+ params="${params} ${x}" -+ ;; -+ esac -+ done -+ real_path=`real_mod_path ${modname}` - if [ "${real_path}" = '' -o "${real_path}" = ' ' ] - then -- [ "${2}" = '-n' ] && echo -n " -> $1" -+ [ "${quiet}" = '1' ] && echo -n " -> ${modname}" - echo ' module not found.' - exit 2 - fi -- modlist=`modules_dep_list ${1}` -+ modlist=`modules_dep_list ${modname}` - if [ "${modlist}" != '' -a "${modlist}" != ' ' ] - then - deps=`strip_mod_paths ${modlist}` -@@ -110,13 +123,13 @@ modprobe2() { - filler=1 - fi - done -- ${INSMOD} ${real_path} > /dev/null 2>&1 -+ ${INSMOD} ${real_path} ${params} > /dev/null 2>&1 - ret=$? - if [ ${ret} -eq 0 ] - then - echoAppend=' loaded.' -- [ "${2}" = '-n' ] && echoFlags='-n' && echoAppend=', ' -- echo ${echoFlags} "${1}${echoAppend}" -+ [ "${quiet}" = '1' ] && echoFlags='-n' && echoAppend=', ' -+ echo ${echoFlags} "${modname}${echoAppend}" - fi - return $ret - } -@@ -132,7 +145,7 @@ do - LOADED_MODULES="${LOADED_MODULES} ${x}" - done - --modprobe2 ${1} -+modprobe2 ${@} - modprobe_ret=$? - - [ -f '/modules.cache' ] && rm -f /modules.cache > /dev/null 2>&1 -diff --git dracut_funcs.sh dracut_funcs.sh -new file mode 100755 -index 0000000..e80a638 ---- /dev/null -+++ dracut_funcs.sh -@@ -0,0 +1,752 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+# -+# functions used by dracut and other tools. -+# -+# Copyright 2005-2009 Red Hat, Inc. All rights reserved. -+# -+# 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; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+# -+ -+IF_RTLD="" -+IF_dynamic="" -+ -+# Generic substring function. If $2 is in $1, return 0. -+strstr() { [[ $1 =~ $2 ]]; } -+ -+# Create all subdirectories for given path without creating the last element. -+# $1 = path -+mksubdirs() { mkdir -p ${1%/*}; } -+ -+# Version comparision function. Assumes Linux style version scheme. -+# $1 = version a -+# $2 = comparision op (gt, ge, eq, le, lt, ne) -+# $3 = version b -+vercmp() { -+ local n1=(${1//./ }) op=$2 n2=(${3//./ }) i res -+ -+ for ((i=0; ; i++)) -+ do -+ if [[ ! ${n1[i]}${n2[i]} ]]; then res=0 -+ elif ((${n1[i]:-0} > ${n2[i]:-0})); then res=1 -+ elif ((${n1[i]:-0} < ${n2[i]:-0})); then res=2 -+ else continue -+ fi -+ break -+ done -+ -+ case $op in -+ gt) ((res == 1));; -+ ge) ((res != 2));; -+ eq) ((res == 0));; -+ le) ((res != 1));; -+ lt) ((res == 2));; -+ ne) ((res != 0));; -+ esac -+} -+ -+is_func() { -+ [[ $(type -t $1) = "function" ]] -+} -+ -+# Log initrd creation. -+if ! [[ $dracutlogfile ]]; then -+ [[ $dracutbasedir = /usr/share/dracut ]] && \ -+ dracutlogfile=/var/log/dracut.log || \ -+ dracutlogfile=/tmp/dracut.log -+# [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log -+ if [[ -w $dracutlogfile ]]; then -+ >"$dracutlogfile" -+ fi -+fi -+ -+dwarning() { -+ echo "W: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "W: $@" >>"$dracutlogfile" -+} -+ -+dinfo() { -+ [[ $beverbose ]] && echo "I: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "I: $@" >>"$dracutlogfile" -+} -+ -+derror() { -+ echo "E: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile" -+} -+ -+# Function prints global variables in format name=value line by line. -+# $@ = list of global variables' name -+print_vars() { -+ local var value -+ -+ for var in $@ -+ do -+ value=$(eval echo \$$var) -+ [[ ${value} ]] && echo "${var}=\"${value}\"" -+ done -+} -+ -+get_fs_env() { -+ [[ $1 ]] || return -+ eval $(udevadm info --query=env --name=$1|egrep 'ID_FS_(TYPE|UUID)=') -+ [[ $ID_FS_TYPE ]] && return -+ -+ if [[ -x /lib/udev/vol_id ]]; then -+ eval $(/lib/udev/vol_id --export $1) -+ elif find_binary blkid >/dev/null; then -+ eval $(blkid -o udev $1) -+ else -+ return 1 -+ fi -+} -+ -+get_fs_type() ( -+ [[ $1 ]] || return -+ if [[ $1 != ${1#/dev/block/nfs:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs3:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs4:} ]]; then -+ echo "nfs" -+ return -+ fi -+ get_fs_env $1 || return -+ echo $ID_FS_TYPE -+) -+ -+get_fs_uuid() ( -+ get_fs_env $1 || return -+ echo $ID_FS_UUID -+) -+ -+# finds the major:minor of the block device backing the root filesystem. -+find_block_device() { -+ local x mpt majmin dev fs misc maj min -+ if [[ $use_fstab != yes ]]; then -+ while read x x majmin x mpt x x fs dev misc; do -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $fs = btrfs ]] && { -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ } -+ if [[ $mpt = $1 ]] && [[ ${majmin#0:} = $majmin ]]; then -+ echo $majmin; -+ return 0 # we have a winner! -+ fi -+ done < /proc/self/mountinfo -+ fi -+ # fall back to /etc/fstab -+ while read dev mpt fs misc; do -+ if [[ $mpt = $1 ]]; then -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $dev != ${dev#UUID=} ]] && dev=/dev/disk/by-uuid/${dev#UUID=} -+ [[ $dev != ${dev#LABEL=} ]] && dev=/dev/disk/by-label/${dev#LABEL=} -+ [[ -b $dev ]] || return 1 # oops, not a block device. -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ fi -+ done < /etc/fstab -+ return 1; -+} -+ -+find_root_block_device() { find_block_device /; } -+ -+# Walk all the slave relationships for a given block device. -+# Stop when our helper function returns success -+# $1 = function to call on every found block device -+# $2 = block device in major:minor format -+check_block_and_slaves() { -+ local x -+ [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. -+ "$1" $2 && return -+ check_vol_slaves "$@" && return 0 -+ if [[ -f /sys/dev/block/$2/../dev ]]; then -+ check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0 -+ fi -+ [[ -d /sys/dev/block/$2/slaves ]] || return 1 -+ for x in /sys/dev/block/$2/slaves/*/dev; do -+ [[ -f $x ]] || continue -+ check_block_and_slaves $1 $(cat "$x") && return 0 -+ done -+ return 1 -+} -+ -+get_numeric_dev() { -+ ls -lH "$1" | { read a b c d maj min rest; printf "%d:%d" ${maj%%,} $min;} -+} -+ -+# ugly workaround for the lvm design -+# There is no volume group device, -+# so, there are no slave devices for volume groups. -+# Logical volumes only have the slave devices they really live on, -+# but you cannot create the logical volume without the volume group. -+# And the volume group might be bigger than the devices the LV needs. -+check_vol_slaves() { -+ for i in /dev/mapper/*; do -+ lv=$(get_numeric_dev $i) -+ if [[ $lv = $2 ]]; then -+ vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null) -+ # strip space -+ vg=$(echo $vg) -+ if [[ $vg ]]; then -+ for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \ -+ do -+ check_block_and_slaves $1 $(get_numeric_dev $pv) \ -+ && return 0 -+ done -+ fi -+ fi -+ done -+ return 1 -+} -+ -+# Install a directory, keeping symlinks as on the original system. -+# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file" -+# will create ${initdir}/lib64, ${initdir}/lib64/file, -+# and a symlink ${initdir}/lib -> lib64. -+inst_dir() { -+ local dir="$1" -+ [[ -e ${initdir}$dir ]] && return 0 -+ -+ # iterate over parent directories -+ local file="" -+ local IFS="/" -+ for part in $dir; do -+ [[ $part ]] || continue -+ file="$file/$part" -+ [[ -e ${initdir}$file ]] && continue -+ -+ if [[ -L $file ]]; then -+ # create link as the original -+ local target=$(readlink "$file") -+ ln -sfn "$target" "${initdir}$file" || return 1 -+ # resolve relative path and recursively install destionation -+ [[ $target = ${target##*/} ]] && target="${file%/*}/$target" -+ inst_dir "$target" -+ else -+ # create directory -+ mkdir -p "${initdir}$file" || return 1 -+ fi -+ done -+} -+ -+# $1 = file to copy to ramdisk -+# $2 (optional) Name for the file on the ramdisk -+# Location of the image dir is assumed to be $initdir -+# We never overwrite the target if it exists. -+inst_simple() { -+ local src target -+ [[ -f $1 ]] || return 1 -+ src=$1 target="${2:-$1}" -+ if ! [[ -d ${initdir}$target ]]; then -+ [[ -e ${initdir}$target ]] && return 0 -+ inst_dir "${target%/*}" -+ fi -+ dinfo "Installing $src" -+ cp -pfL "$src" "${initdir}$target" -+} -+ -+# find symlinks linked to given library file -+# $1 = library file -+# Function searches for symlinks by stripping version numbers appended to -+# library filename, checks if it points to the same target and finally -+# prints the list of symlinks to stdout. -+# -+# Example: -+# rev_lib_symlinks libfoo.so.8.1 -+# output: libfoo.so.8 libfoo.so -+# (Only if libfoo.so.8 and libfoo.so exists on host system.) -+rev_lib_symlinks() { -+ [[ ! $1 ]] && return 0 -+ -+ local fn="$1" orig="$(readlink -f "$1")" links='' -+ -+ [[ ${fn} =~ .*\.so\..* ]] || return 1 -+ -+ until [[ ${fn##*.} == so ]]; do -+ fn="${fn%.*}" -+ [[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}" -+ done -+ -+ echo ${links} -+} -+ -+# Same as above, but specialized to handle dynamic libraries. -+# It handles making symlinks according to how the original library -+# is referenced. -+inst_library() { -+ local src=$1 dest=${2:-$1} lib reallib symlink -+ [[ -e $initdir$dest ]] && return 0 -+ if [[ -L $src ]]; then -+ reallib=$(readlink -f "$src") -+ lib=${src##*/} -+ inst_simple "$reallib" "$reallib" -+ inst_dir "${dest%/*}" -+ (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib") -+ else -+ inst_simple "$src" "$dest" -+ fi -+ -+ # Create additional symlinks. See rev_symlinks description. -+ for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do -+ [[ ! -e $initdir$symlink ]] && { -+ dinfo "Creating extra symlink: $symlink" -+ inst_symlink $symlink -+ } -+ done -+} -+ -+# find a binary. If we were not passed the full path directly, -+# search in the usual places to find the binary. -+find_binary() { -+ local binpath="/bin /sbin /usr/bin /usr/sbin" p -+ [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } -+ for p in $binpath; do -+ [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# Same as above, but specialized to install binary executables. -+# Install binary executable, and all shared library dependencies, if any. -+inst_binary() { -+ local bin target -+ bin=$(find_binary "$1") || return 1 -+ target=${2:-$bin} -+ inst_symlink $bin $target && return 0 -+ local LDSO NAME IO FILE ADDR I1 n f TLIBDIR -+ [[ -e $initdir$target ]] && return 0 -+ # I love bash! -+ LC_ALL=C ldd $bin 2>/dev/null | while read line; do -+ [[ $line = 'not a dynamic executable' ]] && return 1 -+ if [[ $line =~ not\ found ]]; then -+ derror "Missing a shared library required by $bin." -+ derror "Run \"ldd $bin\" to find out what it is." -+ derror "dracut cannot create an initrd." -+ exit 1 -+ fi -+ so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)' -+ [[ $line =~ $so_regex ]] || continue -+ FILE=${BASH_REMATCH[1]} -+ [[ -e ${initdir}$FILE ]] && continue -+ # see if we are loading an optimized version of a shared lib. -+ lib_regex='^(/lib[^/]*).*' -+ if [[ $FILE =~ $lib_regex ]]; then -+ TLIBDIR=${BASH_REMATCH[1]} -+ BASE=${FILE##*/} -+ # prefer nosegneg libs, then unoptimized ones. -+ for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do -+ [[ -e $f/$BASE ]] || continue -+ FILE=$f/$BASE -+ break -+ done -+ inst_library "$FILE" "$TLIBDIR/$BASE" -+ IF_dynamic=yes -+ continue -+ fi -+ inst_library "$FILE" -+ done -+ inst_simple "$bin" "$target" -+} -+ -+# same as above, except for shell scripts. -+# If your shell script does not start with shebang, it is not a shell script. -+inst_script() { -+ [[ -f $1 ]] || return 1 -+ local line -+ read -r -n 80 line <"$1" -+ # If debug is set, clean unprintable chars to prevent messing up the term -+ [[ $debug ]] && line=$(echo -n "$line" | tr -c -d '[:print:][:space:]') -+ shebang_regex='(#! *)(/[^ ]+).*' -+ [[ $line =~ $shebang_regex ]] || return 1 -+ inst "${BASH_REMATCH[2]}" && inst_simple "$@" -+} -+ -+# same as above, but specialized for symlinks -+inst_symlink() { -+ local src=$1 target=$initdir${2:-$1} realsrc -+ [[ -L $1 ]] || return 1 -+ [[ -L $target ]] && return 0 -+ realsrc=$(readlink -f "$src") -+ [[ $realsrc = ${realsrc##*/} ]] && realsrc=${src%/*}/$realsrc -+ inst "$realsrc" && mkdir -p "${target%/*}" && \ -+ ln -s "$realsrc" "$target" -+} -+ -+# find a udev rule in the usual places. -+find_rule() { -+ [[ -f $1 ]] && { echo "$1"; return 0; } -+ for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do -+ [[ -f $r/$1 ]] && { echo "$r/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# udev rules always get installed in the same place, so -+# create a function to install them to make life simpler. -+inst_rules() { -+ local target=/etc/udev/rules.d rule found -+ -+ inst_dir "/lib/udev/rules.d" -+ inst_dir "$target" -+ for rule in "$@"; do -+ found=$(find_rule "$rule") && \ -+ inst_simple "$found" "$target/${found##*/}" \ -+ || dinfo "Skipping udev rule: $rule" -+ done -+} -+ -+# general purpose installation function -+# Same args as above. -+inst() { -+ case $# in -+ 1) ;; -+ 2) [[ ! $initdir && -d $2 ]] && export initdir=$2 -+ [[ $initdir = $2 ]] && set $1;; -+ 3) [[ -z $initdir ]] && export initdir=$2 -+ set $1 $3;; -+ *) derror "inst only takes 1 or 2 or 3 arguments" -+ exit 1;; -+ esac -+ for x in inst_symlink inst_script inst_binary inst_simple; do -+ $x "$@" && return 0 -+ done -+ return 1 -+} -+ -+# install function specialized for hooks -+# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook -+# All hooks should be POSIX/SuS compliant, they will be sourced by init. -+inst_hook() { -+ if ! [[ -f $3 ]]; then -+ derror "Cannot install a hook ($3) that does not exist." -+ derror "Aborting initrd creation." -+ exit 1 -+ elif ! strstr "$hookdirs" "$1"; then -+ derror "No such hook type $1. Aborting initrd creation." -+ exit 1 -+ fi -+ inst_simple "$3" "/${1}/${2}${3##*/}" -+} -+ -+dracut_install() { -+ if [[ $1 = '-o' ]]; then -+ local optional=yes -+ shift -+ fi -+ while (($# > 0)); do -+ if ! inst "$1" ; then -+ if [[ $optional = yes ]]; then -+ dwarning "Skipping program $1 as it cannot be found and is flagged to be optional" -+ else -+ derror "Failed to install $1" -+ exit 1 -+ fi -+ fi -+ shift -+ done -+} -+ -+# install function decompressing the target and handling symlinks -+# $@ = list of compressed (gz or bz2) files or symlinks pointing to such files -+# -+# Function install targets in the same paths inside overlay but decompressed -+# and without extensions (.gz, .bz2). -+inst_decompress() { -+ local src dst realsrc realdst cmd -+ -+ for src in $@ -+ do -+ case ${src} in -+ *.gz) cmd='gzip -d' ;; -+ *.bz2) cmd='bzip2 -d' ;; -+ *) return 1 ;; -+ esac -+ -+ if [[ -L ${src} ]] -+ then -+ realsrc="$(readlink -f ${src})" # symlink target with extension -+ dst="${src%.*}" # symlink without extension -+ realdst="${realsrc%.*}" # symlink target without extension -+ mksubdirs "${initdir}/${src}" -+ # Create symlink without extension to target without extension. -+ ln -s "${realdst}" "${initdir}/${dst}" -+ fi -+ -+ # If the source is symlink we operate on its target. -+ [[ ${realsrc} ]] && src=${realsrc} -+ inst ${src} -+ # Decompress with chosen tool. We assume that tool changes name e.g. -+ # from 'name.gz' to 'name'. -+ ${cmd} "${initdir}${src}" -+ done -+} -+ -+# It's similar to above, but if file is not compressed, performs standard -+# install. -+# $@ = list of files -+inst_opt_decompress() { -+ local src -+ -+ for src in $@ -+ do -+ inst_decompress "${src}" || inst "${src}" -+ done -+} -+ -+module_check() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we are unconditionally included -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check $hostonly -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func check || return 0 -+ check -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_depends() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we have no deps -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check -d -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func depends || return 0 -+ depends -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_install() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/install ]] && . "$moddir/install" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func install || return 0 -+ install -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_installkernel() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/installkernel ]] && . "$moddir/installkernel" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func installkernel || return 0 -+ installkernel -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+check_module() { -+ local mod=$1; -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ local moddep; -+ # If we are already scheduled to be loaded, no need to check again. -+ strstr " $mods_to_load " " $mod " && return 0 -+ strstr " $mods_checked_as_dep " " $mod " && return 1 -+ -+ # This should never happen, but... -+ [[ -d $moddir ]] || return 1 -+ -+ [[ $2 ]] || mods_checked_as_dep+=" $mod " -+ -+ strstr " $omit_dracutmodules " " $mod " && return 1 -+ -+ if strstr " $dracutmodules $add_dracutmodules " " $mod "; then -+ module_check $mod; ret=$? -+ # explicit module, so also accept ret=255 -+ [[ $ret = 0 || $ret = 255 ]] || return 1 -+ else -+ # module not in our list -+ if [[ $dracutmodules = all ]]; then -+ # check, if we can and should install this module -+ module_check $mod || return 1 -+ else -+ # skip this module -+ return 1 -+ fi -+ fi -+ -+ for moddep in $(module_depends $mod); do -+ # handle deps as if they were manually added -+ strstr " $add_dracutmodules " " $moddep " || \ -+ add_dracutmodules+=" $moddep " -+ # if a module we depend on fail, fail also -+ check_module $moddep || return 1 -+ done -+ -+ strstr " $mods_to_load " " $mod " || \ -+ mods_to_load+=" $mod " -+ -+ return 0 -+} -+ -+check_module_dir() { -+ local modcheck; -+ local mod; -+ mods_to_load="" -+ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do -+ local mod=${moddir##*/}; mod=${mod#[0-9][0-9]} -+ check_module $mod 1 -+ done -+} -+ -+# Install a single kernel module along with any firmware it may require. -+# $1 = full path to kernel module to install -+install_kmod_with_fw() { -+ local modname=${1##*/} fwdir found -+ modname=${modname%.ko*} -+ inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \ -+ return 0 # no need to go further if the module is already installed -+ for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do -+ found='' -+ for fwdir in $fw_dir; do -+ if [[ -d $fwdir && -f $fwdir/$fw ]]; then -+ inst_simple "$fwdir/$fw" "/lib/firmware/$fw" -+ found=yes -+ fi -+ done -+ if [[ $found != yes ]]; then -+ dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\"" -+ fi -+ done -+} -+ -+# Do something with all the dependencies of a kernel module. -+# Note that kernel modules depend on themselves using the technique we use -+# $1 = function to call for each dependency we find -+# It will be passed the full path to the found kernel module -+# $2 = module to get dependencies for -+# rest of args = arguments to modprobe -+for_each_kmod_dep() { -+ local func=$1 kmod=$2 cmd modpapth options -+ shift 2 -+ modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \ -+ while read cmd modpath options; do -+ [[ $cmd = insmod ]] || continue -+ $func $modpath -+ done -+} -+ -+# filter kernel modules to install certain modules that meet specific -+# requirements. -+# $1 = function to call with module name to filter. -+# This function will be passed the full path to the module to test. -+# The behaviour of this function can vary depending on whether $hostonly is set. -+# If it is, we will only look at modules that are already in memory. -+# If it is not, we will look at all kernel modules -+# This function returns the full filenames of modules that match $1 -+filter_kernel_modules () ( -+ if ! [[ $hostonly ]]; then -+ filtercmd='find "$srcmods/kernel/drivers" "$srcmods/extra" "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz" 2>/dev/null' -+ else -+ filtercmd='cut -d " " -f 1 /dev/null' -+ fi -+ for modname in $(eval $filtercmd); do -+ case $modname in -+ *.ko) "$1" "$modname" && echo "$modname";; -+ *.ko.gz) gzip -dc "$modname" > $initdir/$$.ko -+ $1 $initdir/$$.ko && echo "$modname" -+ rm -f $initdir/$$.ko;; -+ esac -+ done -+) -+ -+# install kernel modules along with all their dependencies. -+instmods() { -+ [[ $no_kernel = yes ]] && return -+ local mod mpargs modpath modname cmd moddirname -+ while (($# > 0)); do -+ mod=${1%.ko*} -+ case $mod in -+ =*) -+ # This introduces 2 incompatible meanings for =* arguments -+ # to instmods. We need to decide which one to keep. -+ if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then -+ instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block") -+ elif [ -f $srcmods/modules.${mod#=} ]; then -+ instmods $mpargs $(cat ${srcmods}/modules.${mod#=} ) -+ else -+ instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*") -+ fi -+ ;; -+ --*) -+ mod=${mod##*/} -+ mpargs+=" $mod";; -+ i2o_scsi) shift; continue;; # Do not load this diagnostic-only module -+ *) mod=${mod##*/} -+ # if we are already installed, skip this module and go on -+ # to the next one. -+ [[ -f $initdir/$1 ]] && { shift; continue; } -+ # If we are building a host-specific initramfs and this -+ # module is not already loaded, move on to the next one. -+ [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \ -+ ! echo $add_drivers | grep -qe "\<${mod}\>" && { -+ shift; continue; -+ } -+ -+ # We use '-d' option in modprobe only if modules prefix path -+ # differs from default '/'. This allows us to use Dracut with -+ # old version of modprobe which doesn't have '-d' option. -+ moddirname=${srcmods%%/lib/modules/*} -+ [[ -n ${moddirname} ]] && moddirname="-d ${moddirname}/" -+ -+ # ok, load the module, all its dependencies, and any firmware -+ # it may require -+ for_each_kmod_dep install_kmod_with_fw $mod \ -+ --set-version $kernel ${moddirname} -+ ;; -+ esac -+ shift -+ done -+} -diff --git gen_cmdline.sh gen_cmdline.sh -index b3e451d..36afb2e 100755 ---- gen_cmdline.sh -+++ gen_cmdline.sh -@@ -22,6 +22,7 @@ longusage() { - echo " --logfile= Output file for debug info" - echo " --color Output debug in color" - echo " --no-color Do not output debug in color" -+ echo " --no-cleartmp Do not clear temp directory" - echo " Kernel Configuration settings" - echo " --menuconfig Run menuconfig after oldconfig" - echo " --no-menuconfig Do not run menuconfig after oldconfig" -@@ -78,6 +79,8 @@ longusage() { - echo " --splash-res= Select splash theme resolutions to install" - echo " --do-keymap-auto Forces keymap selection at boot" - echo " --no-keymap Disables keymap selection support" -+ echo " --udev Include udev in the initramfs" -+ echo " --no-udev Exclude udev from the initramfs" - echo " --lvm Include LVM support" - echo " --mdadm Include MDADM/MDMON support" - echo " --mdadm-config= Use file as mdadm.conf in initramfs" -@@ -97,6 +100,8 @@ longusage() { - echo " --unionfs Include support for unionfs" - echo " --netboot Create a self-contained env in the initramfs" - echo " --real-root= Specify a default for real_root=" -+ echo " --lscpi Include lspci into the initramfs" -+ echo " --no-lscpi Exclude lspci from the initramfs" - echo " Internals" - echo " --arch-override= Force to arch instead of autodetect" - echo " --cachedir= Override the default cache location" -@@ -232,6 +237,30 @@ parse_cmdline() { - CMD_KEYMAP=0 - print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" - ;; -+ --udev) -+ CMD_UDEV=1 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --no-udev) -+ CMD_UDEV=0 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --lspci) -+ CMD_LSPCI=1 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --no-lspci) -+ CMD_LSPCI=0 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --nfsutils) -+ CMD_NFSUTILS=1 -+ print_info 2 "CMD_NFSUTILS: ${CMD_NFSUTILS}" -+ ;; -+ --no-nfsutils) -+ CMD_NFSUTILS=0 -+ print_info 2 "CMD_NFSUTILS: ${CMD_NFSUTILS}" -+ ;; - --lvm) - CMD_LVM=1 - print_info 2 "CMD_LVM: ${CMD_LVM}" -@@ -441,6 +470,10 @@ parse_cmdline() { - print_info 2 "USECOLOR: ${USECOLOR}" - setColorVars - ;; -+ --no-cleartmp) -+ NOCLEARTMP=1 -+ print_info 2 "NOCLEARTMP: ${NOCLEARTMP}" -+ ;; - --logfile=*) - CMD_LOGFILE=`parse_opt "$*"` - LOGFILE=`parse_opt "$*"` -diff --git gen_compile.sh gen_compile.sh -index 0758c3a..8a2339a 100755 ---- gen_compile.sh -+++ gen_compile.sh -@@ -407,7 +407,10 @@ compile_busybox() { - yes '' 2>/dev/null | compile_generic oldconfig utils - - print_info 1 'busybox: >> Compiling...' -+ OLDLOGLEVEL=$LOGLEVEL -+ LOGLEVEL=1 - compile_generic all utils -+ LOGLEVEL=$OLDLOGLEVEL - print_info 1 'busybox: >> Copying to cache...' - [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] || - gen_die 'Busybox executable does not exist!' -diff --git gen_determineargs.sh gen_determineargs.sh -index ce479cb..eb23120 100755 ---- gen_determineargs.sh -+++ gen_determineargs.sh -@@ -107,6 +107,9 @@ determine_real_args() { - set_config_with_override BOOL SYMLINK CMD_SYMLINK - set_config_with_override STRING INSTALL_MOD_PATH CMD_INSTALL_MOD_PATH - set_config_with_override BOOL OLDCONFIG CMD_OLDCONFIG -+ set_config_with_override BOOL UDEV CMD_UDEV -+ set_config_with_override BOOL LSPCI CMD_LSPCI -+ set_config_with_override BOOL NFSUTILS CMD_NFSUTILS - set_config_with_override BOOL LVM CMD_LVM - set_config_with_override BOOL DMRAID CMD_DMRAID - set_config_with_override BOOL ISCSI CMD_ISCSI -diff --git gen_initramfs.sh gen_initramfs.sh -index 7fe4421..2e936e9 100755 ---- gen_initramfs.sh -+++ gen_initramfs.sh -@@ -56,7 +56,13 @@ append_busybox() { - chmod +x "${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/default.script" - - # Set up a few default symlinks -- for i in ${BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}; do -+ if isTrue "${UDEV}" -+ then -+ BUSYBOX_APPLETS="${BUSYBOX_APPLETS:-[ ash sh uname echo cut cat}" -+ else -+ BUSYBOX_APPLETS="{$BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}" -+ fi -+ for i in ${BUSYBOX_APPLETS}; do - rm -f ${TEMP}/initramfs-busybox-temp/bin/$i > /dev/null - ln -s busybox ${TEMP}/initramfs-busybox-temp/bin/$i || - gen_die "Busybox error: could not link ${i}!" -@@ -410,7 +416,7 @@ append_firmware() { - IFS="," - for i in ${FIRMWARE_FILES} - do -- cp -L "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ -+ cp -rL "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ - done - IFS=$OLD_IFS - else -@@ -438,9 +444,76 @@ append_gpg() { - chmod a+x "${TEMP}/initramfs-gpg-temp/sbin/gpg" - cd "${TEMP}/initramfs-gpg-temp/" - find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" - rm -rf "${TEMP}/initramfs-gpg-temp" > /dev/null - } - -+append_udev() { -+ if [ -d "${TEMP}/initramfs-udev-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-udev-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-udev-temp/" -+ udevmod="${GK_SHARE}/modules/udev-rules/" -+ source ${udevmod}/module-setup.sh -+ initdir=${TEMP}/initramfs-udev-temp \ -+ moddir=${udevmod} \ -+ libdir=/lib/ \ -+ usrlibdir=/usr/lib/ \ -+ install_module -+ -+ if isTrue $LSPCI -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ fi -+ if isTrue $NFSUTILS -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /sbin/mount.nfs /etc/services /etc/protocols /etc/netconfig -+ fi -+ # find net modules and sound -+ (for pathname in ${INSTALL_MOD_PATH}/lib/modules/${KV}/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/drivers/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/sound -+ do -+ [[ -d $pathname ]] && find $pathname -name "*.ko" -+ done | -+ while read module;do -+ # add them prefix blacklist -+ echo "blacklist `basename $module .ko`"; -+ # concat with ready blacklist.conf -+ done;cat "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf") | -+ # sort and rewrite blacklist.conf -+ sort | uniq > "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" -+ mv "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" \ -+ "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf" -+ -+ cd "${TEMP}/initramfs-udev-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-udev-temp" > /dev/null -+} -+ -+append_lspci() { -+ if [ -d "${TEMP}/initramfs-lspci-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-lspci-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-lspci-temp/" -+ -+ initdir=${TEMP}/initramfs-lspci-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ -+ cd "${TEMP}/initramfs-lspci-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-lspci-temp" > /dev/null -+} -+ - print_list() - { - local x -@@ -489,6 +562,11 @@ append_modules() { - print_list ${!group_modules} > "${TEMP}/initramfs-modules-${KV}-temp/etc/modules/${group}" - done - cd "${TEMP}/initramfs-modules-${KV}-temp/" -+ # remove sound and media -+ for x in `find . -type d -name media -o -type d -name sound` -+ do -+ rm -r "${x}" &>/dev/null -+ done - find . | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ - || gen_die "compressing modules cpio" - cd "${TEMP}" -@@ -561,11 +639,14 @@ append_auxilary() { - done - echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" - -- if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ if ! isTrue "${UDEV}" - then -- cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -- else -- cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ then -+ cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ else -+ cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ fi - fi - if isTrue $CMD_DOKEYMAPAUTO - then -@@ -582,7 +663,7 @@ append_auxilary() { - chmod +x "${TEMP}/initramfs-aux-temp/init" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" -- chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ isTrue "${UDEV}" || chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" - - if isTrue ${NETBOOT} - then -@@ -609,6 +690,21 @@ append_data() { - fi - } - -+pack_cpio() { -+ print_info 1 " >> Pack cpio data..." -+ if [ -d "${TEMP}/initramfs-repack-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-repack-temp" -+ fi -+ mkdir -p "${TEMP}/initramfs-repack-temp" -+ cd "${TEMP}/initramfs-repack-temp" -+ # unpack and pack cpio remove double files -+ cpio -di <${CPIO} 2>/dev/null -+ find . -print | cpio ${CPIO_ARGS} | gzip -9 >"${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-repack-temp" > /dev/null -+} -+ - create_initramfs() { - print_info 1 "initramfs: >> Initializing..." - -@@ -619,6 +715,11 @@ create_initramfs() { - - append_data 'base_layout' - append_data 'auxilary' "${BUSYBOX}" -+ append_data 'udev' "${UDEV}" -+ if ! isTrue "${UDEV}" -+ then -+ append_data 'lspci' "${LSPCI}" -+ fi - append_data 'busybox' "${BUSYBOX}" - append_data 'lvm' "${LVM}" - append_data 'dmraid' "${DMRAID}" -@@ -652,8 +753,7 @@ create_initramfs() { - append_data 'overlay' - fi - -- gzip -9 "${CPIO}" -- mv -f "${CPIO}.gz" "${CPIO}" -+ pack_cpio - - if isTrue "${INTEGRATED_INITRAMFS}" - then -diff --git genkernel genkernel -index 0a06cdd..1486c61 100755 ---- genkernel -+++ genkernel -@@ -9,6 +9,7 @@ GK_V='3.4.18' - TMPDIR='/var/tmp/genkernel' - - TODEBUGCACHE=1 # Until an error occurs or LOGFILE is fully qualified. -+NOCLEARTMP=0 - - small_die() { - echo $1 -@@ -45,6 +46,7 @@ source ${GK_SHARE}/gen_initramfs.sh || gen_die "Could not read ${GK_SHARE}/gen_i - source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_moddeps.sh" - source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh" - source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh" -+source ${GK_SHARE}/dracut_funcs.sh || gen_die "Could not read ${GK_SHARE}/dracut_funcs.sh" - - TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ - -@@ -55,21 +57,25 @@ trap_cleanup(){ - } - - cleanup(){ -- if [ -n "$TEMP" -a -d "$TEMP" ]; then -- rm -rf "$TEMP" -- fi -- -- if isTrue ${POSTCLEAR} -- then -- echo -- print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -- print_info 1 "CACHE_DIR: ${CACHE_DIR}" -- CLEAR_CACHE_DIR='yes' -- setup_cache_dir -- echo -- print_info 1 "TMPDIR: ${TMPDIR}" -- clear_tmpdir -- fi -+ if [[ ${NOCLEARTMP} -ne 0 ]] -+ then -+ return -+ fi -+ if [ -n "$TEMP" -a -d "$TEMP" ]; then -+ rm -rf "$TEMP" &>/dev/null -+ fi -+ -+ if isTrue ${POSTCLEAR} -+ then -+ echo -+ print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -+ print_info 1 "CACHE_DIR: ${CACHE_DIR}" -+ CLEAR_CACHE_DIR='yes' -+ setup_cache_dir -+ echo -+ print_info 1 "TMPDIR: ${TMPDIR}" -+ clear_tmpdir -+ fi - } - - trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL -diff --git genkernel.conf genkernel.conf -index 24fcd54..b61f1fa 100644 ---- genkernel.conf -+++ genkernel.conf -@@ -52,6 +52,15 @@ USECOLOR="yes" - # argument is: *+1 - # MAKEOPTS="-j2" - -+# Add udev to initramfs -+UDEV="yes" -+ -+# Add lspci to initramfs -+LSPCI="yes" -+ -+# add ntfs-utils to initramfs -+NFSUTILS="yes" -+ - # Add in LVM support from static binaries if they exist on the system, or - # compile static LVM binaries if static ones do not exist. - # LVM="no" -@@ -92,7 +101,7 @@ USECOLOR="yes" - # Specify directory to pull from - # FIRMWARE_DIR="/lib/firmware" - # Specify specific firmware files to include. This overrides FIRMWARE_DIR --# FIRMWARE_FILES="" -+FIRMWARE_FILES="/lib/firmware/radeon" - - # Enable disklabel support (copies blkid to initrd) - DISKLABEL="yes" -diff --git modules/udev-rules/01-ignore.rules modules/udev-rules/01-ignore.rules -new file mode 100644 -index 0000000..b32f22e ---- /dev/null -+++ modules/udev-rules/01-ignore.rules -@@ -0,0 +1 @@ -+KERNEL=="ram[0-9]*", OPTIONS+="ignore_device", OPTIONS+="last_rule" -diff --git modules/udev-rules/59-persistent-storage-volid.rules modules/udev-rules/59-persistent-storage-volid.rules -new file mode 100644 -index 0000000..0b798e6 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage-volid.rules -@@ -0,0 +1,7 @@ -+SUBSYSTEM!="block", GOTO="psv_end" -+ACTION!="add|change", GOTO="psv_end" -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="cciss[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", IMPORT{program}="vol_id --export $tempnode" -+LABEL="psv_end" -diff --git modules/udev-rules/59-persistent-storage.rules modules/udev-rules/59-persistent-storage.rules -new file mode 100644 -index 0000000..2b83e72 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage.rules -@@ -0,0 +1,38 @@ -+SUBSYSTEM!="block", GOTO="ps_end" -+ACTION!="add|change", GOTO="ps_end" -+ -+KERNEL=="cciss[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end" -+ -+# partitions have no md/{array_state,metadata_version} -+ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" -+ -+# container devices have a metadata version of e.g. 'external:ddf' and -+# never leave state 'inactive' -+ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -+TEST!="md/array_state", GOTO="md_end" -+ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -+ -+LABEL="md_ignore_state" -+ -+IMPORT{program}="/sbin/mdadm --detail --export $tempnode" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+OPTIONS+="link_priority=100" -+OPTIONS+="watch" -+LABEL="md_end" -+ -+ -+KERNEL!="dm-[0-9]*", GOTO="ps_end" -+ACTION=="add", GOTO="ps_end" -+IMPORT{program}="/sbin/dmsetup info -c --nameprefixes --unquoted --rows --noheadings -o name,uuid,suspended,readonly,major,minor,open,tables_loaded,names_using_dev -j%M -m%m" -+ENV{DM_NAME}!="?*", GOTO="ps_end" -+ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="ps_end" -+ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="ps_end" -+ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="ps_end" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+LABEL="ps_end" -diff --git modules/udev-rules/61-persistent-storage.rules modules/udev-rules/61-persistent-storage.rules -new file mode 100644 -index 0000000..9cfdb0b ---- /dev/null -+++ modules/udev-rules/61-persistent-storage.rules -@@ -0,0 +1,20 @@ -+SUBSYSTEM!="block", GOTO="pss_end" -+ACTION!="add|change", GOTO="pss_end" -+ -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss" -+KERNEL=="cciss[0-9]*", GOTO="do_pss" -+KERNEL=="nbd[0-9]*", GOTO="do_pss" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", GOTO="do_pss" -+ -+GOTO="pss_end" -+ -+LABEL="do_pss" -+# by-path (parent device path) -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{program}="path_id %p" -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" -+ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" -+ -+# by-label/by-uuid links (filesystem metadata) -+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -+LABEL="pss_end" -diff --git modules/udev-rules/blacklist.conf modules/udev-rules/blacklist.conf -new file mode 100644 -index 0000000..21ac71c ---- /dev/null -+++ modules/udev-rules/blacklist.conf -@@ -0,0 +1,162 @@ -+blacklist ath_pci -+blacklist evbug -+blacklist usbmouse -+blacklist usbkbd -+blacklist eepro100 -+blacklist de4x5 -+blacklist eth1394 -+blacklist snd_intel8x0m -+blacklist snd_aw2 -+blacklist i2c_i801 -+blacklist prism54 -+blacklist bcm43xx -+blacklist garmin_gps -+blacklist asus_acpi -+blacklist snd_pcsp -+blacklist pcspkr -+blacklist amd76x_edac -+blacklist ohci1394 -+blacklist sbp2 -+blacklist dv1394 -+blacklist raw1394 -+blacklist video1394 -+blacklist aty128fb -+blacklist atyfb -+blacklist radeonfb -+blacklist cirrusfb -+blacklist cyber2000fb -+blacklist cyblafb -+blacklist gx1fb -+blacklist hgafb -+blacklist i810fb -+blacklist intelfb -+blacklist kyrofb -+blacklist lxfb -+blacklist matroxfb_base -+blacklist neofb -+blacklist nvidiafb -+blacklist pm2fb -+blacklist rivafb -+blacklist s1d13xxxfb -+blacklist savagefb -+blacklist sisfb -+blacklist sstfb -+blacklist tdfxfb -+blacklist tridentfb -+blacklist vesafb -+blacklist vfb -+blacklist viafb -+blacklist vt8623fb -+blacklist ac97 -+blacklist ac97_codec -+blacklist ac97_plugin_ad1980 -+blacklist ad1848 -+blacklist ad1889 -+blacklist adlib_card -+blacklist aedsp16 -+blacklist ali5455 -+blacklist btaudio -+blacklist cmpci -+blacklist cs4232 -+blacklist cs4281 -+blacklist cs461x -+blacklist cs46xx -+blacklist emu10k1 -+blacklist es1370 -+blacklist es1371 -+blacklist esssolo1 -+blacklist forte -+blacklist gus -+blacklist i810_audio -+blacklist kahlua -+blacklist mad16 -+blacklist maestro -+blacklist maestro3 -+blacklist maui -+blacklist mpu401 -+blacklist nm256_audio -+blacklist opl3 -+blacklist opl3sa -+blacklist opl3sa2 -+blacklist pas2 -+blacklist pss -+blacklist rme96xx -+blacklist sb -+blacklist sb_lib -+blacklist sgalaxy -+blacklist sonicvibes -+blacklist sound -+blacklist sscape -+blacklist trident -+blacklist trix -+blacklist uart401 -+blacklist uart6850 -+blacklist via82cxxx_audio -+blacklist v_midi -+blacklist wavefront -+blacklist ymfpci -+blacklist ac97_plugin_wm97xx -+blacklist ad1816 -+blacklist audio -+blacklist awe_wave -+blacklist dmasound_core -+blacklist dmasound_pmac -+blacklist harmony -+blacklist sequencer -+blacklist soundcard -+blacklist usb-midi -+blacklist acquirewdt -+blacklist advantechwdt -+blacklist alim1535_wdt -+blacklist alim7101_wdt -+blacklist booke_wdt -+blacklist cpu5wdt -+blacklist eurotechwdt -+blacklist i6300esb -+blacklist i8xx_tco -+blacklist ib700wdt -+blacklist ibmasr -+blacklist indydog -+blacklist iTCO_wdt -+blacklist it8712f_wdt -+blacklist it87_wdt -+blacklist ixp2000_wdt -+blacklist ixp4xx_wdt -+blacklist machzwd -+blacklist mixcomwd -+blacklist mpc8xx_wdt -+blacklist mpcore_wdt -+blacklist mv64x60_wdt -+blacklist pc87413_wdt -+blacklist pcwd -+blacklist pcwd_pci -+blacklist pcwd_usb -+blacklist s3c2410_wdt -+blacklist sa1100_wdt -+blacklist sbc60xxwdt -+blacklist sbc7240_wdt -+blacklist sb8360 -+blacklist sc1200wdt -+blacklist sc520_wdt -+blacklist sch311_wdt -+blacklist scx200_wdt -+blacklist shwdt -+blacklist smsc37b787_wdt -+blacklist softdog -+blacklist twl4030_wdt -+blacklist w83627hf_wdt -+blacklist w83697hf_wdt -+blacklist w83697ug_wdt -+blacklist w83877f_wdt -+blacklist w83977f_wdt -+blacklist wafer5823wdt -+blacklist wdt -+blacklist wdt_pci -+blacklist wm8350_wdt -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -diff --git modules/udev-rules/load-modules.sh modules/udev-rules/load-modules.sh -new file mode 100755 -index 0000000..36972fd ---- /dev/null -+++ modules/udev-rules/load-modules.sh -@@ -0,0 +1,7 @@ -+#!/bin/sh -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+# Implement blacklisting for udev-loaded modules -+ -+modprobe -b "$@" -diff --git modules/udev-rules/module-setup.sh modules/udev-rules/module-setup.sh -new file mode 100755 -index 0000000..8ef142b ---- /dev/null -+++ modules/udev-rules/module-setup.sh -@@ -0,0 +1,71 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+install_module() { -+ # FIXME: would be nice if we didn't have to know which rules to grab.... -+ # ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies -+ # of the rules we want so that we just copy those in would be best -+ [[ -x /sbin/udevd ]] && dracut_install udevd -+ dracut_install udevadm /etc/udev/udev.conf /etc/group /bin/mount /sbin/modprobe -+ inst_rules 50-udev-default.rules 60-persistent-storage.rules \ -+ 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \ -+ 60-pcmcia.rules -+ mkdir -p "$initdir"/etc/modprobe.d -+ inst_simple "$moddir/blacklist.conf" /etc/modprobe.d/ -+ -+ # ignore some devices in the initrd -+ inst_rules "$moddir/01-ignore.rules" -+ -+ # for firmware loading -+ inst_rules 50-firmware.rules -+ -+ if [ ! -x /lib/udev/vol_id ]; then -+ inst_rules "$moddir/59-persistent-storage.rules" -+ else -+ inst_rules "$moddir/59-persistent-storage-volid.rules" -+ fi -+ inst_rules "$moddir/61-persistent-storage.rules" -+ -+ for i in \ -+ ata_id \ -+ cdrom_id \ -+ create_floppy_devices \ -+ edd_id \ -+ firmware.sh \ -+ firmware \ -+ firmware.agent \ -+ hotplug.functions \ -+ fw_unit_symlinks.sh \ -+ hid2hci \ -+ path_id \ -+ scsi_id \ -+ dmsetup \ -+ usb_id \ -+ vol_id \ -+ pcmcia-socket-startup \ -+ pcmcia-check-broken-cis \ -+ udevd \ -+ ; do -+ for utilpath in /lib/udev /sbin /bin -+ do -+ if [ -e $utilpath/$i.static ] -+ then -+ inst_binary $utilpath/$i.static $utilpath/$i -+ else -+ [ -e $utilpath/$i ] && dracut_install $utilpath/$i -+ fi -+ done -+ done -+ -+ if ! [ -e "$initdir/sbin/udevd" ]; then -+ if [ -x /lib/udev/udevd ]; then -+ ln -s /lib/udev/udevd "$initdir/sbin/udevd" -+ fi -+ fi -+ -+ for i in {"$libdir","$usrlibdir"}/libnss_files*; do -+ [ -e "$i" ] && dracut_install "$i" -+ done -+} -+ diff --git a/sys-kernel/calckernel/files/calckernel-3.4.18-r2.patch b/sys-kernel/calckernel/files/calckernel-3.4.18-r2.patch deleted file mode 100644 index 519735a8a..000000000 --- a/sys-kernel/calckernel/files/calckernel-3.4.18-r2.patch +++ /dev/null @@ -1,2105 +0,0 @@ -diff --git defaults/initrd.defaults defaults/initrd.defaults -index 76d72a7..0c059a5 100755 ---- defaults/initrd.defaults -+++ defaults/initrd.defaults -@@ -68,6 +68,7 @@ fi - - REAL_ROOT='' - CDROOT='0' -+SCRATCH='0' - CDROOT_DEV='' - CDROOT_TYPE='auto' - NEW_ROOT='/newroot' -diff --git defaults/initrd.scripts defaults/initrd.scripts -index 51ebcce..b2d3d5d 100755 ---- defaults/initrd.scripts -+++ defaults/initrd.scripts -@@ -187,23 +187,45 @@ cache_cd_contents() { - # TODO: Check the size of the image versus the size of our tmpfs - # along with the amount of available RAM and increase tmpfs size - # if necessary. (Not having awk sucks...) -- # z=0 -- # for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -- # cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; do -- # z=$(($z + $i)) ; done -- # echo $z -- good_msg "Copying loop file for caching..." -- # Verify that the needed directory exists -- mkdir -p "$(dirname ${NEW_ROOT}/mnt/${LOOP})" -- cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/${LOOP} -- if [ $? -ne 0 ] -+ -+ # getting memory -+ allmemory=0 -+ for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -+ cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; -+ do -+ allmemory=$(($allmemory + $i)) -+ done -+ -+ # getting size tmpfs of default -+ let curtfs=$allmemory/2 -+ -+ # getting size of image -+ let imagesize=`ls -la ${NEW_ROOT}/mnt/cdrom/${LOOP} | sed -r -n 's/(\S*\s*){4}(\S*).*/\2/p'`/20000*21 -+ let addon=$imagesize/10 -+ if [[ $curtfs -gt $(( ${imagesize} + ${addon} )) ]]; - then -- bad_msg "Failed to cache the loop file! Lack of space?" -- rm -rf ${NEW_ROOT}/mnt/livecd.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/image.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/zisofs 2>/dev/null -+ let addon=$(( $curtfs - ${imagesize} )) -+ fi -+ -+ if [[ $((${imagesize} + $addon)) -lt ${allmemory} ]]; -+ then -+ mount -o remount,size=${addon}000 -t tmpfs tmpfs ${NEW_ROOT} -+ mkdir ${NEW_ROOT}/mnt/squash -+ mount -o size=${imagesize}000 -t tmpfs tmpfs ${NEW_ROOT}/mnt/squash -+ good_msg "Copying loop file for caching..." -+ cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/squash/${LOOP} -+ if [ $? -ne 0 ] -+ then -+ bad_msg "Failed to cache the loop file! Lack of space?" -+ umount ${NEW_ROOT}/mnt/squash -+ mount -o remount,size=${curtfs}000 -t tmpfs tmpfs ${NEW_ROOT} -+ else -+ LOOPEXT='../squash/' -+ good_msg "Unmounting media from ${NEW_ROOT}/mnt/cdrom" -+ umount ${NEW_ROOT}/mnt/cdrom -+ fi - else -- LOOPEXT='../' -+ bad_msg "Too low memory for cache the loop file." - fi - fi - fi -@@ -266,7 +288,7 @@ findnfsmount() { - if [ "${CDROOT}" != '0' ] - then - good_msg "Attempting to mount NFS CD image on ${NFSROOT} with options ${NFSOPTIONS}" -- mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT}/mnt/cdrom -+ busybox mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT}/mnt/cdrom - if [ "$?" = '0' ] - then - REAL_ROOT="/dev/nfs" -@@ -275,7 +297,7 @@ findnfsmount() { - fi - else - good_msg "Attempting to mount NFS root on ${NFSROOT} with options ${NFSOPTIONS}" -- mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT} -+ busybox mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT} - if [ "$?" = '0' ] - then - REAL_ROOT="/dev/nfs" -@@ -655,7 +677,7 @@ startVolumes() { - [ -d /etc/lvm/cache ] && lvm_commands="${lvm_commands} \nvgscan" - - # To activate volumegroups on all devices in the cache -- lvm_commands="${lvm_commands} \nvgchange -ay --sysinit" -+ lvm_commands="${lvm_commands} \nvgchange -ay --sysinit --noudevsync" - - # And finally execute it all (/proc/... needed if lvm is compiled without readline) - good_msg "Scanning for and activating Volume Groups" -@@ -1082,6 +1104,38 @@ getdvhoff() { - echo $(( $(hexdump -n 4 -s $((316 + 12 * $2)) -e '"%i"' $1) * 512)) - } - -+load_union_module() { -+ UNIONTYPE="" -+ # find module for union file system -+ [ -n "$(find /lib/ -name unionfs.ko)" ] && UNIONTYPE="unionfs" -+ [ -n "$(find /lib/ -name aufs.ko)" ] && UNIONTYPE="aufs" -+ # probably aufs in kernel -+ if [ -n "$(gzip -dc /proc/config.gz | grep CONFIG_AUFS_FS=y )" ] -+ then -+ UNIONTYPE="aufs" -+ else -+ if [ -z "${UNIONTYPE}" ] -+ then -+ bad_msg "Module for union file system is not found!" -+ run_shell -+ else -+ modprobe ${UNIONTYPE} > /dev/null 2>&1 -+ # error on load union module -+ if [ -z "$(lsmod | grep $UNIONTYPE)" ] -+ then -+ bad_msg "Module for union file system is not correct!" -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ bad_msg "Probably kernel compiled without standalone patch." -+ fi -+ run_shell -+ fi -+ -+ good_msg "Loading ${UNIONTYPE}" -+ fi -+ fi -+} -+ - setup_unionfs() { - local rw_dir=$1 - local ro_dir=$2 -@@ -1101,6 +1155,7 @@ setup_unionfs() { - mkdir -p ${UNION} - good_msg "Loading fuse module" - modprobe fuse > /dev/null 2>&1 -+ load_union_module - # if [ -n "${UNIONFS}" ] - # then - # CHANGESDEV=${UNIONFS} -@@ -1130,11 +1185,102 @@ setup_unionfs() { - mkdir /tmp - mkdir -p ${UNION} - # mkdir -p $CHANGES --# mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+## mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+ -+ if [ "${SCRATCH}" -ne 0 ]; -+ then -+ good_msg "Loading in scratch mode" -+ BUILDERDIR=${UNION}/mnt/builder -+ SCRATCHDIR=${UNION}/mnt/scratch -+ DELTADIR=${rw_dir}/mnt/delta -+ WORKSPACEDIR=${rw_dir}/mnt/workspace -+ mount -o remount,rw ${rw_dir}/mnt/cdrom >/dev/null 2>&1 -+ touch ${rw_dir}/mnt/cdrom/livecd >/dev/null 2>&1 -+ if [ "$?" -ne 0 ]; -+ then -+ ISRW=0 -+ else -+ ISRW=1 -+ fi -+ -+ mkdir -p ${DELTADIR} -+ mkdir -p ${WORKSPACEDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${WORKSPACEDIR}=rw:${DELTADIR}=ro+wh:${rw_dir}/mnt/livecd=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${WORKSPACEDIR}=rw:${DELTADIR}=ro:${rw_dir}/mnt/livecd=ro unionfs ${UNION} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${SCRATCHDIR}/calculate -+ mkdir -p ${SCRATCHDIR}/delta -+ mkdir -p ${SCRATCHDIR}/workspace -+ mount -o bind ${rw_dir}/mnt/delta ${SCRATCHDIR}/delta -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind ${rw_dir}/mnt/workspace ${SCRATCHDIR}/workspace -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${BUILDERDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro none ${BUILDERDIR} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro unionfs ${BUILDERDIR} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind,ro ${rw_dir}/mnt/livecd ${SCRATCHDIR}/calculate -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ if [ "$ISRW" -ne 0 ]; -+ then -+ FLASHDIR=${UNION}/mnt/flash -+ mkdir -p ${FLASHDIR} -+ mount -o bind ${rw_dir}/mnt/cdrom ${FLASHDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ mkdir -p ${CDROMDIR} -+ mount -o bind,ro ${rw_dir}/mnt/cdrom ${CDROMDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ fi -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ LIVECDDIR=${UNION}/mnt/livecd -+ -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${rw_dir}:${ro_dir}=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${rw_dir}:${ro_dir}=ro unionfs ${UNION} -+ fi -+ -+ if [[ -n "$( echo ${LOOPEXT} | grep squash )" ]]; -+ then -+ mkdir -p ${UNION}/mnt/squash -+ mount -o bind ${NEW_ROOT}/mnt/squash ${UNION}/mnt/squash &>/dev/null -+ fi -+ -+ chmod 0755 ${UNION} -+ mount -o bind ${rw_dir}/mnt/cdrom ${CDROMDIR} &>/dev/null -+ mount -o bind ${rw_dir}/mnt/livecd ${LIVECDDIR} &>/dev/null -+ ret=$? -+ fi -+ -+ chmod 1777 ${UNION}/tmp - good_msg "Creating union mount" -- unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -- ret=$? -- if [ ${ret} -ne 0 ] -+# unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -+# ret=$? -+ if [ "${ret}" -ne 0 ] - then - bad_msg "Can't setup union mount!" - USE_UNIONFS_NORMAL=0 -@@ -1143,3 +1289,110 @@ setup_unionfs() { - USE_UNIONFS_NORMAL=0 - fi - } -+ -+load_videodrv() { -+ good_msg "Loading frame buffer video driver" -+ # find all available fb drivers -+ videodrv_count=$(find /lib/modules \ -+ -name "nouveau.ko" -o \ -+ -name "uvesafb.ko" -o \ -+ -name "i915.ko" -o \ -+ -name "radeon.ko" | -+ grep -c "") -+ # load specified videodrv -+ modules_list= -+ case "${VIDEODRV}" in -+ nouveau) -+ modules_list="nouveau" -+ ;; -+ radeon) -+ modules_list="radeon" -+ ;; -+ i915|intel) -+ modules_list="i915" -+ ;; -+ ""|auto) -+ # if not livecd and initramfs otimized (aviailable only one video driver) -+ if [ "${CDROOT}" != '1' -a "${videodrv_count}" -le 2 ] -+ then -+ modules_list="nouveau i915 radeon" -+ else -+ if [[ -x /usr/sbin/lspci ]] -+ then -+ if lspci | grep -m1 VGA | grep -qi intel -+ then -+ modules_list="i915" -+ elif lspci | grep -m1 VGA | grep -qi nvidia -+ then -+ modules_list="nouveau" -+ elif lspci | grep -m1 VGA | grep -q -e "Ati" -e "ATI" -+ then -+ modules_list="radeon" -+ else -+ modules_list="" -+ fi -+ else -+ modules_list="i915" -+ fi -+ fi -+ ;; -+ esac -+ for x in $modules_list -+ do -+ if [ "`find /lib/modules -name "${x}.ko" | grep -c ''`" -eq "1" ] -+ then -+ modprobe "${x}" modeset=${USE_MODESET} &>/dev/null -+ lsmod | grep -q "${x}" && return 0 -+ fi -+ done -+ # else load uvesafb with specified video resolution -+ if [ -n "${VIDEORES}" ] -+ then -+ if ! echo $VIDEORES | grep -q "\-" -+ then -+ VIDEORES="${VIDEORES}-32" -+ fi -+ else -+ VIDEORES="1024x768-32" -+ fi -+ modprobe uvesafb mode_option=${VIDEORES} &>/dev/null -+} -+ -+start_udev() -+{ -+ # start udev -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ echo "" >/proc/sys/kernel/hotplug -+ udevd --daemon &>/dev/null -+ udevadm settle -+ fi -+} -+ -+stop_udev() -+{ -+ # kill udevd -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ pkill udevd &>/dev/null -+ fi -+} -+ -+populate_dev() -+{ -+ good_msg 'Activating udev' -+ # Do not run any init-scripts -+ udevadm control --property=do_not_run_plug_service=1 -+ -+ if [ "${REAL_ROOT}" == "/dev/nfs" ] -+ then -+ rm /etc/modprobe.d/blacklist.conf -+ fi -+ # discarding net drivers placed into blacklist.conf -+ udevadm trigger --action="add" -+ -+ # we can speed up booting under these conditions: -+ # * using devtmpfs so kernel creates device nodes for us -+ # * only using kernel created device nodes at boot (in /etc/fstab and elsewhere) -+ udevadm settle --timeout=60 -+} -diff --git defaults/linuxrc defaults/linuxrc -index 0843f5d..8109d09 100755 ---- defaults/linuxrc -+++ defaults/linuxrc -@@ -39,6 +39,13 @@ FAKE_ROOT='' - REAL_ROOTFLAGS='' - ROOTFSTYPE='auto' - CRYPT_SILENT=0 -+VIDEODRV='' -+USE_UDEV=1 -+USE_MODESET=1 -+if [ -e "/etc/calculate/calculate.ini" ] -+then -+ source /etc/calculate/calculate.ini -+fi - for x in ${CMDLINE} - do - case "${x}" in -@@ -57,6 +64,57 @@ do - init_opts\=*) - INIT_OPTS=`parse_opt "${x}"` - ;; -+ nokms) -+ USE_MODESET=0 -+ ;; -+ kms) -+ USE_MODESET=1 -+ ;; -+ noudev) -+ USE_UDEV=0 -+ ;; -+ calculate\=*) -+ CALCULATE=`parse_opt "${x}"` -+ if [[ "${CALCULATE//:/}" != "${CALCULATE}" ]] -+ then -+ for i in ${CALCULATE//,/ } -+ do -+ case "${i}" in -+ video:*) -+ VIDEODRV=`echo "${i}" | cut -s -d: -f2-` -+ ;; -+ resolution:*) -+ RES=`echo "${i}" | cut -s -d: -f2-` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ ;; -+ esac -+ done -+ else -+ RES=`echo "${CALCULATE}" | cut -s -d, -f4` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ VIDEODRV=`echo "${CALCULATE}" | cut -s -d, -f5` -+ fi -+ ;; -+ video\=*) -+ VR=`parse_opt "${x}"` -+ for i in ${VR//,/ } -+ do -+ if [ -z "${i//[0-9-x@]}" ] -+ then -+ VIDEORES=${i} -+ fi -+ done -+ ;; -+ # Scratch usbload -+ scratch) -+ SCRATCH=1 -+ ;; - # Livecd options - cdroot) - CDROOT=1 -@@ -251,15 +309,24 @@ then - REAL_ROOT="${FAKE_ROOT}" - fi - --splash 'init' -- --cmdline_hwopts -+# check udevd -+[ ! -x /sbin/udevd ] && USE_UDEV=0 - - # Mount sysfs - mount_sysfs - -+# start udev -+start_udev -+ -+# load kernel video driver -+load_videodrv -+ -+splash 'init' -+ -+cmdline_hwopts -+ - # Setup hotplugging for firmware loading --setup_hotplug -+[ "${USE_UDEV}" == "0" ] && setup_hotplug - - # Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel - if [ -z "${DO_modules}" ] -@@ -269,7 +336,7 @@ elif [ -d "/lib/modules/${KV}" ] - then - good_msg 'Loading modules' - # Load appropriate kernel modules -- if [ "${NODETECT}" != '1' ] -+ if [ "${USE_UDEV}" != '1' -a "${NODETECT}" != '1' ] - then - for modules in ${MY_HWOPTS} - do -@@ -285,14 +352,20 @@ fi - # Apply scan delay if specified - sdelay - --# Setup slow USB bits --setup_slowusb -+if [ "${USE_UDEV}" == "1" ] -+then -+ # populate /dev with devices already found by the kernel -+ populate_dev -+else -+ # Setup slow USB bits -+ setup_slowusb - --# Start device manager --start_dev_mgr -+ # Start device manager -+ start_dev_mgr - --# if doslowusb is passed, pause other 10 seconds here, after mdev load --[ "${DO_slowusb}" ] && sleep 10 -+ # if doslowusb is passed, pause other 10 seconds here, after mdev load -+ [ "${DO_slowusb}" ] && sleep 10 -+fi - - # Start iSCSI - if [ -e /bin/iscsistart ] -@@ -509,9 +582,50 @@ do - then - break - else -- bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -- got_good_root=0 -- REAL_ROOT='' -+ # check for scratch -+ if [ -e ${NEW_ROOT}/livecd.squashfs -a -d ${NEW_ROOT}/delta -a -d ${NEW_ROOT}/workspace ]; -+ then -+ good_msg 'Found scratch data...' -+ load_union_module -+ modprobe squashfs >/dev/null -+ if mount -o remount,rw ${NEW_ROOT}; -+ then -+ mkdir -p ${NEW_ROOT}/calculate && mkdir -p /union && mkdir -p ${NEW_ROOT}/workspace/mnt/builder && mkdir -p ${NEW_ROOT}/workspace/mnt/scratch -+ if mount -o loop,ro -t squashfs ${NEW_ROOT}/livecd.squashfs ${NEW_ROOT}/calculate; -+ then -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/workspace=rw:${NEW_ROOT}/delta=ro+wh:${NEW_ROOT}/calculate=ro none /union; -+ then -+ mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/delta=rw:${NEW_ROOT}/calculate=ro none /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers!' -+ run_shell -+ fi -+ else -+ if mount -t unionfs -o ro,dirs=${NEW_ROOT}/workspace:${NEW_ROOT}/delta=ro:${NEW_ROOT}/calculate=ro unionfs /union; -+ then -+ mount -t unionfs -o ro,dirs=${NEW_ROOT}/delta:${NEW_ROOT}/calculate=ro unionfs /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers' -+ run_shell -+ fi -+ fi -+ else -+ bad_msg 'Could not mount scratch squashfs image' -+ fi -+ else -+ bad_msg 'Could not remount ${NEW_ROOT}' -+ fi -+ else -+ bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -+ got_good_root=0 -+ REAL_ROOT='' -+ fi - fi - else - bad_msg "Could not mount specified ROOT, try again" -@@ -723,9 +837,12 @@ cd "${CHROOT}" - mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null - echo -ne "${BOLD}.${NORMAL}" - -+# stop udev before move mount points -+stop_udev -+ - # If devtmpfs is mounted, try move it to the new root - # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise --for fs in /dev /sys /proc -+for fs in "/dev " /sys /proc - do - if grep -qs "$fs" /proc/mounts - then -diff --git defaults/modprobe defaults/modprobe -index ba2d890..9280357 100755 ---- defaults/modprobe -+++ defaults/modprobe -@@ -10,8 +10,6 @@ usage() { - echo - echo 'Example:' - echo ' modprobe eepro100' -- echo -- echo 'Note: Do not pass the suffix to modprobe!' - exit 1 - } - -@@ -81,14 +79,29 @@ modprobe2() { - usage - exit 1 - fi -- real_path=`real_mod_path ${1}` -+ local modname=${1} -+ local quiet='' -+ local params='' -+ shift -+ for x in $@ -+ do -+ case ${x} in -+ -n) -+ quiet=1 -+ ;; -+ *) -+ params="${params} ${x}" -+ ;; -+ esac -+ done -+ real_path=`real_mod_path ${modname}` - if [ "${real_path}" = '' -o "${real_path}" = ' ' ] - then -- [ "${2}" = '-n' ] && echo -n " -> $1" -+ [ "${quiet}" = '1' ] && echo -n " -> ${modname}" - echo ' module not found.' - exit 2 - fi -- modlist=`modules_dep_list ${1}` -+ modlist=`modules_dep_list ${modname}` - if [ "${modlist}" != '' -a "${modlist}" != ' ' ] - then - deps=`strip_mod_paths ${modlist}` -@@ -110,13 +123,13 @@ modprobe2() { - filler=1 - fi - done -- ${INSMOD} ${real_path} > /dev/null 2>&1 -+ ${INSMOD} ${real_path} ${params} > /dev/null 2>&1 - ret=$? - if [ ${ret} -eq 0 ] - then - echoAppend=' loaded.' -- [ "${2}" = '-n' ] && echoFlags='-n' && echoAppend=', ' -- echo ${echoFlags} "${1}${echoAppend}" -+ [ "${quiet}" = '1' ] && echoFlags='-n' && echoAppend=', ' -+ echo ${echoFlags} "${modname}${echoAppend}" - fi - return $ret - } -@@ -132,7 +145,7 @@ do - LOADED_MODULES="${LOADED_MODULES} ${x}" - done - --modprobe2 ${1} -+modprobe2 ${@} - modprobe_ret=$? - - [ -f '/modules.cache' ] && rm -f /modules.cache > /dev/null 2>&1 -diff --git dracut_funcs.sh dracut_funcs.sh -new file mode 100755 -index 0000000..e80a638 ---- /dev/null -+++ dracut_funcs.sh -@@ -0,0 +1,752 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+# -+# functions used by dracut and other tools. -+# -+# Copyright 2005-2009 Red Hat, Inc. All rights reserved. -+# -+# 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; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+# -+ -+IF_RTLD="" -+IF_dynamic="" -+ -+# Generic substring function. If $2 is in $1, return 0. -+strstr() { [[ $1 =~ $2 ]]; } -+ -+# Create all subdirectories for given path without creating the last element. -+# $1 = path -+mksubdirs() { mkdir -p ${1%/*}; } -+ -+# Version comparision function. Assumes Linux style version scheme. -+# $1 = version a -+# $2 = comparision op (gt, ge, eq, le, lt, ne) -+# $3 = version b -+vercmp() { -+ local n1=(${1//./ }) op=$2 n2=(${3//./ }) i res -+ -+ for ((i=0; ; i++)) -+ do -+ if [[ ! ${n1[i]}${n2[i]} ]]; then res=0 -+ elif ((${n1[i]:-0} > ${n2[i]:-0})); then res=1 -+ elif ((${n1[i]:-0} < ${n2[i]:-0})); then res=2 -+ else continue -+ fi -+ break -+ done -+ -+ case $op in -+ gt) ((res == 1));; -+ ge) ((res != 2));; -+ eq) ((res == 0));; -+ le) ((res != 1));; -+ lt) ((res == 2));; -+ ne) ((res != 0));; -+ esac -+} -+ -+is_func() { -+ [[ $(type -t $1) = "function" ]] -+} -+ -+# Log initrd creation. -+if ! [[ $dracutlogfile ]]; then -+ [[ $dracutbasedir = /usr/share/dracut ]] && \ -+ dracutlogfile=/var/log/dracut.log || \ -+ dracutlogfile=/tmp/dracut.log -+# [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log -+ if [[ -w $dracutlogfile ]]; then -+ >"$dracutlogfile" -+ fi -+fi -+ -+dwarning() { -+ echo "W: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "W: $@" >>"$dracutlogfile" -+} -+ -+dinfo() { -+ [[ $beverbose ]] && echo "I: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "I: $@" >>"$dracutlogfile" -+} -+ -+derror() { -+ echo "E: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile" -+} -+ -+# Function prints global variables in format name=value line by line. -+# $@ = list of global variables' name -+print_vars() { -+ local var value -+ -+ for var in $@ -+ do -+ value=$(eval echo \$$var) -+ [[ ${value} ]] && echo "${var}=\"${value}\"" -+ done -+} -+ -+get_fs_env() { -+ [[ $1 ]] || return -+ eval $(udevadm info --query=env --name=$1|egrep 'ID_FS_(TYPE|UUID)=') -+ [[ $ID_FS_TYPE ]] && return -+ -+ if [[ -x /lib/udev/vol_id ]]; then -+ eval $(/lib/udev/vol_id --export $1) -+ elif find_binary blkid >/dev/null; then -+ eval $(blkid -o udev $1) -+ else -+ return 1 -+ fi -+} -+ -+get_fs_type() ( -+ [[ $1 ]] || return -+ if [[ $1 != ${1#/dev/block/nfs:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs3:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs4:} ]]; then -+ echo "nfs" -+ return -+ fi -+ get_fs_env $1 || return -+ echo $ID_FS_TYPE -+) -+ -+get_fs_uuid() ( -+ get_fs_env $1 || return -+ echo $ID_FS_UUID -+) -+ -+# finds the major:minor of the block device backing the root filesystem. -+find_block_device() { -+ local x mpt majmin dev fs misc maj min -+ if [[ $use_fstab != yes ]]; then -+ while read x x majmin x mpt x x fs dev misc; do -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $fs = btrfs ]] && { -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ } -+ if [[ $mpt = $1 ]] && [[ ${majmin#0:} = $majmin ]]; then -+ echo $majmin; -+ return 0 # we have a winner! -+ fi -+ done < /proc/self/mountinfo -+ fi -+ # fall back to /etc/fstab -+ while read dev mpt fs misc; do -+ if [[ $mpt = $1 ]]; then -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $dev != ${dev#UUID=} ]] && dev=/dev/disk/by-uuid/${dev#UUID=} -+ [[ $dev != ${dev#LABEL=} ]] && dev=/dev/disk/by-label/${dev#LABEL=} -+ [[ -b $dev ]] || return 1 # oops, not a block device. -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ fi -+ done < /etc/fstab -+ return 1; -+} -+ -+find_root_block_device() { find_block_device /; } -+ -+# Walk all the slave relationships for a given block device. -+# Stop when our helper function returns success -+# $1 = function to call on every found block device -+# $2 = block device in major:minor format -+check_block_and_slaves() { -+ local x -+ [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. -+ "$1" $2 && return -+ check_vol_slaves "$@" && return 0 -+ if [[ -f /sys/dev/block/$2/../dev ]]; then -+ check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0 -+ fi -+ [[ -d /sys/dev/block/$2/slaves ]] || return 1 -+ for x in /sys/dev/block/$2/slaves/*/dev; do -+ [[ -f $x ]] || continue -+ check_block_and_slaves $1 $(cat "$x") && return 0 -+ done -+ return 1 -+} -+ -+get_numeric_dev() { -+ ls -lH "$1" | { read a b c d maj min rest; printf "%d:%d" ${maj%%,} $min;} -+} -+ -+# ugly workaround for the lvm design -+# There is no volume group device, -+# so, there are no slave devices for volume groups. -+# Logical volumes only have the slave devices they really live on, -+# but you cannot create the logical volume without the volume group. -+# And the volume group might be bigger than the devices the LV needs. -+check_vol_slaves() { -+ for i in /dev/mapper/*; do -+ lv=$(get_numeric_dev $i) -+ if [[ $lv = $2 ]]; then -+ vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null) -+ # strip space -+ vg=$(echo $vg) -+ if [[ $vg ]]; then -+ for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \ -+ do -+ check_block_and_slaves $1 $(get_numeric_dev $pv) \ -+ && return 0 -+ done -+ fi -+ fi -+ done -+ return 1 -+} -+ -+# Install a directory, keeping symlinks as on the original system. -+# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file" -+# will create ${initdir}/lib64, ${initdir}/lib64/file, -+# and a symlink ${initdir}/lib -> lib64. -+inst_dir() { -+ local dir="$1" -+ [[ -e ${initdir}$dir ]] && return 0 -+ -+ # iterate over parent directories -+ local file="" -+ local IFS="/" -+ for part in $dir; do -+ [[ $part ]] || continue -+ file="$file/$part" -+ [[ -e ${initdir}$file ]] && continue -+ -+ if [[ -L $file ]]; then -+ # create link as the original -+ local target=$(readlink "$file") -+ ln -sfn "$target" "${initdir}$file" || return 1 -+ # resolve relative path and recursively install destionation -+ [[ $target = ${target##*/} ]] && target="${file%/*}/$target" -+ inst_dir "$target" -+ else -+ # create directory -+ mkdir -p "${initdir}$file" || return 1 -+ fi -+ done -+} -+ -+# $1 = file to copy to ramdisk -+# $2 (optional) Name for the file on the ramdisk -+# Location of the image dir is assumed to be $initdir -+# We never overwrite the target if it exists. -+inst_simple() { -+ local src target -+ [[ -f $1 ]] || return 1 -+ src=$1 target="${2:-$1}" -+ if ! [[ -d ${initdir}$target ]]; then -+ [[ -e ${initdir}$target ]] && return 0 -+ inst_dir "${target%/*}" -+ fi -+ dinfo "Installing $src" -+ cp -pfL "$src" "${initdir}$target" -+} -+ -+# find symlinks linked to given library file -+# $1 = library file -+# Function searches for symlinks by stripping version numbers appended to -+# library filename, checks if it points to the same target and finally -+# prints the list of symlinks to stdout. -+# -+# Example: -+# rev_lib_symlinks libfoo.so.8.1 -+# output: libfoo.so.8 libfoo.so -+# (Only if libfoo.so.8 and libfoo.so exists on host system.) -+rev_lib_symlinks() { -+ [[ ! $1 ]] && return 0 -+ -+ local fn="$1" orig="$(readlink -f "$1")" links='' -+ -+ [[ ${fn} =~ .*\.so\..* ]] || return 1 -+ -+ until [[ ${fn##*.} == so ]]; do -+ fn="${fn%.*}" -+ [[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}" -+ done -+ -+ echo ${links} -+} -+ -+# Same as above, but specialized to handle dynamic libraries. -+# It handles making symlinks according to how the original library -+# is referenced. -+inst_library() { -+ local src=$1 dest=${2:-$1} lib reallib symlink -+ [[ -e $initdir$dest ]] && return 0 -+ if [[ -L $src ]]; then -+ reallib=$(readlink -f "$src") -+ lib=${src##*/} -+ inst_simple "$reallib" "$reallib" -+ inst_dir "${dest%/*}" -+ (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib") -+ else -+ inst_simple "$src" "$dest" -+ fi -+ -+ # Create additional symlinks. See rev_symlinks description. -+ for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do -+ [[ ! -e $initdir$symlink ]] && { -+ dinfo "Creating extra symlink: $symlink" -+ inst_symlink $symlink -+ } -+ done -+} -+ -+# find a binary. If we were not passed the full path directly, -+# search in the usual places to find the binary. -+find_binary() { -+ local binpath="/bin /sbin /usr/bin /usr/sbin" p -+ [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } -+ for p in $binpath; do -+ [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# Same as above, but specialized to install binary executables. -+# Install binary executable, and all shared library dependencies, if any. -+inst_binary() { -+ local bin target -+ bin=$(find_binary "$1") || return 1 -+ target=${2:-$bin} -+ inst_symlink $bin $target && return 0 -+ local LDSO NAME IO FILE ADDR I1 n f TLIBDIR -+ [[ -e $initdir$target ]] && return 0 -+ # I love bash! -+ LC_ALL=C ldd $bin 2>/dev/null | while read line; do -+ [[ $line = 'not a dynamic executable' ]] && return 1 -+ if [[ $line =~ not\ found ]]; then -+ derror "Missing a shared library required by $bin." -+ derror "Run \"ldd $bin\" to find out what it is." -+ derror "dracut cannot create an initrd." -+ exit 1 -+ fi -+ so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)' -+ [[ $line =~ $so_regex ]] || continue -+ FILE=${BASH_REMATCH[1]} -+ [[ -e ${initdir}$FILE ]] && continue -+ # see if we are loading an optimized version of a shared lib. -+ lib_regex='^(/lib[^/]*).*' -+ if [[ $FILE =~ $lib_regex ]]; then -+ TLIBDIR=${BASH_REMATCH[1]} -+ BASE=${FILE##*/} -+ # prefer nosegneg libs, then unoptimized ones. -+ for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do -+ [[ -e $f/$BASE ]] || continue -+ FILE=$f/$BASE -+ break -+ done -+ inst_library "$FILE" "$TLIBDIR/$BASE" -+ IF_dynamic=yes -+ continue -+ fi -+ inst_library "$FILE" -+ done -+ inst_simple "$bin" "$target" -+} -+ -+# same as above, except for shell scripts. -+# If your shell script does not start with shebang, it is not a shell script. -+inst_script() { -+ [[ -f $1 ]] || return 1 -+ local line -+ read -r -n 80 line <"$1" -+ # If debug is set, clean unprintable chars to prevent messing up the term -+ [[ $debug ]] && line=$(echo -n "$line" | tr -c -d '[:print:][:space:]') -+ shebang_regex='(#! *)(/[^ ]+).*' -+ [[ $line =~ $shebang_regex ]] || return 1 -+ inst "${BASH_REMATCH[2]}" && inst_simple "$@" -+} -+ -+# same as above, but specialized for symlinks -+inst_symlink() { -+ local src=$1 target=$initdir${2:-$1} realsrc -+ [[ -L $1 ]] || return 1 -+ [[ -L $target ]] && return 0 -+ realsrc=$(readlink -f "$src") -+ [[ $realsrc = ${realsrc##*/} ]] && realsrc=${src%/*}/$realsrc -+ inst "$realsrc" && mkdir -p "${target%/*}" && \ -+ ln -s "$realsrc" "$target" -+} -+ -+# find a udev rule in the usual places. -+find_rule() { -+ [[ -f $1 ]] && { echo "$1"; return 0; } -+ for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do -+ [[ -f $r/$1 ]] && { echo "$r/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# udev rules always get installed in the same place, so -+# create a function to install them to make life simpler. -+inst_rules() { -+ local target=/etc/udev/rules.d rule found -+ -+ inst_dir "/lib/udev/rules.d" -+ inst_dir "$target" -+ for rule in "$@"; do -+ found=$(find_rule "$rule") && \ -+ inst_simple "$found" "$target/${found##*/}" \ -+ || dinfo "Skipping udev rule: $rule" -+ done -+} -+ -+# general purpose installation function -+# Same args as above. -+inst() { -+ case $# in -+ 1) ;; -+ 2) [[ ! $initdir && -d $2 ]] && export initdir=$2 -+ [[ $initdir = $2 ]] && set $1;; -+ 3) [[ -z $initdir ]] && export initdir=$2 -+ set $1 $3;; -+ *) derror "inst only takes 1 or 2 or 3 arguments" -+ exit 1;; -+ esac -+ for x in inst_symlink inst_script inst_binary inst_simple; do -+ $x "$@" && return 0 -+ done -+ return 1 -+} -+ -+# install function specialized for hooks -+# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook -+# All hooks should be POSIX/SuS compliant, they will be sourced by init. -+inst_hook() { -+ if ! [[ -f $3 ]]; then -+ derror "Cannot install a hook ($3) that does not exist." -+ derror "Aborting initrd creation." -+ exit 1 -+ elif ! strstr "$hookdirs" "$1"; then -+ derror "No such hook type $1. Aborting initrd creation." -+ exit 1 -+ fi -+ inst_simple "$3" "/${1}/${2}${3##*/}" -+} -+ -+dracut_install() { -+ if [[ $1 = '-o' ]]; then -+ local optional=yes -+ shift -+ fi -+ while (($# > 0)); do -+ if ! inst "$1" ; then -+ if [[ $optional = yes ]]; then -+ dwarning "Skipping program $1 as it cannot be found and is flagged to be optional" -+ else -+ derror "Failed to install $1" -+ exit 1 -+ fi -+ fi -+ shift -+ done -+} -+ -+# install function decompressing the target and handling symlinks -+# $@ = list of compressed (gz or bz2) files or symlinks pointing to such files -+# -+# Function install targets in the same paths inside overlay but decompressed -+# and without extensions (.gz, .bz2). -+inst_decompress() { -+ local src dst realsrc realdst cmd -+ -+ for src in $@ -+ do -+ case ${src} in -+ *.gz) cmd='gzip -d' ;; -+ *.bz2) cmd='bzip2 -d' ;; -+ *) return 1 ;; -+ esac -+ -+ if [[ -L ${src} ]] -+ then -+ realsrc="$(readlink -f ${src})" # symlink target with extension -+ dst="${src%.*}" # symlink without extension -+ realdst="${realsrc%.*}" # symlink target without extension -+ mksubdirs "${initdir}/${src}" -+ # Create symlink without extension to target without extension. -+ ln -s "${realdst}" "${initdir}/${dst}" -+ fi -+ -+ # If the source is symlink we operate on its target. -+ [[ ${realsrc} ]] && src=${realsrc} -+ inst ${src} -+ # Decompress with chosen tool. We assume that tool changes name e.g. -+ # from 'name.gz' to 'name'. -+ ${cmd} "${initdir}${src}" -+ done -+} -+ -+# It's similar to above, but if file is not compressed, performs standard -+# install. -+# $@ = list of files -+inst_opt_decompress() { -+ local src -+ -+ for src in $@ -+ do -+ inst_decompress "${src}" || inst "${src}" -+ done -+} -+ -+module_check() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we are unconditionally included -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check $hostonly -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func check || return 0 -+ check -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_depends() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we have no deps -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check -d -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func depends || return 0 -+ depends -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_install() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/install ]] && . "$moddir/install" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func install || return 0 -+ install -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_installkernel() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/installkernel ]] && . "$moddir/installkernel" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func installkernel || return 0 -+ installkernel -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+check_module() { -+ local mod=$1; -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ local moddep; -+ # If we are already scheduled to be loaded, no need to check again. -+ strstr " $mods_to_load " " $mod " && return 0 -+ strstr " $mods_checked_as_dep " " $mod " && return 1 -+ -+ # This should never happen, but... -+ [[ -d $moddir ]] || return 1 -+ -+ [[ $2 ]] || mods_checked_as_dep+=" $mod " -+ -+ strstr " $omit_dracutmodules " " $mod " && return 1 -+ -+ if strstr " $dracutmodules $add_dracutmodules " " $mod "; then -+ module_check $mod; ret=$? -+ # explicit module, so also accept ret=255 -+ [[ $ret = 0 || $ret = 255 ]] || return 1 -+ else -+ # module not in our list -+ if [[ $dracutmodules = all ]]; then -+ # check, if we can and should install this module -+ module_check $mod || return 1 -+ else -+ # skip this module -+ return 1 -+ fi -+ fi -+ -+ for moddep in $(module_depends $mod); do -+ # handle deps as if they were manually added -+ strstr " $add_dracutmodules " " $moddep " || \ -+ add_dracutmodules+=" $moddep " -+ # if a module we depend on fail, fail also -+ check_module $moddep || return 1 -+ done -+ -+ strstr " $mods_to_load " " $mod " || \ -+ mods_to_load+=" $mod " -+ -+ return 0 -+} -+ -+check_module_dir() { -+ local modcheck; -+ local mod; -+ mods_to_load="" -+ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do -+ local mod=${moddir##*/}; mod=${mod#[0-9][0-9]} -+ check_module $mod 1 -+ done -+} -+ -+# Install a single kernel module along with any firmware it may require. -+# $1 = full path to kernel module to install -+install_kmod_with_fw() { -+ local modname=${1##*/} fwdir found -+ modname=${modname%.ko*} -+ inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \ -+ return 0 # no need to go further if the module is already installed -+ for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do -+ found='' -+ for fwdir in $fw_dir; do -+ if [[ -d $fwdir && -f $fwdir/$fw ]]; then -+ inst_simple "$fwdir/$fw" "/lib/firmware/$fw" -+ found=yes -+ fi -+ done -+ if [[ $found != yes ]]; then -+ dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\"" -+ fi -+ done -+} -+ -+# Do something with all the dependencies of a kernel module. -+# Note that kernel modules depend on themselves using the technique we use -+# $1 = function to call for each dependency we find -+# It will be passed the full path to the found kernel module -+# $2 = module to get dependencies for -+# rest of args = arguments to modprobe -+for_each_kmod_dep() { -+ local func=$1 kmod=$2 cmd modpapth options -+ shift 2 -+ modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \ -+ while read cmd modpath options; do -+ [[ $cmd = insmod ]] || continue -+ $func $modpath -+ done -+} -+ -+# filter kernel modules to install certain modules that meet specific -+# requirements. -+# $1 = function to call with module name to filter. -+# This function will be passed the full path to the module to test. -+# The behaviour of this function can vary depending on whether $hostonly is set. -+# If it is, we will only look at modules that are already in memory. -+# If it is not, we will look at all kernel modules -+# This function returns the full filenames of modules that match $1 -+filter_kernel_modules () ( -+ if ! [[ $hostonly ]]; then -+ filtercmd='find "$srcmods/kernel/drivers" "$srcmods/extra" "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz" 2>/dev/null' -+ else -+ filtercmd='cut -d " " -f 1 /dev/null' -+ fi -+ for modname in $(eval $filtercmd); do -+ case $modname in -+ *.ko) "$1" "$modname" && echo "$modname";; -+ *.ko.gz) gzip -dc "$modname" > $initdir/$$.ko -+ $1 $initdir/$$.ko && echo "$modname" -+ rm -f $initdir/$$.ko;; -+ esac -+ done -+) -+ -+# install kernel modules along with all their dependencies. -+instmods() { -+ [[ $no_kernel = yes ]] && return -+ local mod mpargs modpath modname cmd moddirname -+ while (($# > 0)); do -+ mod=${1%.ko*} -+ case $mod in -+ =*) -+ # This introduces 2 incompatible meanings for =* arguments -+ # to instmods. We need to decide which one to keep. -+ if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then -+ instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block") -+ elif [ -f $srcmods/modules.${mod#=} ]; then -+ instmods $mpargs $(cat ${srcmods}/modules.${mod#=} ) -+ else -+ instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*") -+ fi -+ ;; -+ --*) -+ mod=${mod##*/} -+ mpargs+=" $mod";; -+ i2o_scsi) shift; continue;; # Do not load this diagnostic-only module -+ *) mod=${mod##*/} -+ # if we are already installed, skip this module and go on -+ # to the next one. -+ [[ -f $initdir/$1 ]] && { shift; continue; } -+ # If we are building a host-specific initramfs and this -+ # module is not already loaded, move on to the next one. -+ [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \ -+ ! echo $add_drivers | grep -qe "\<${mod}\>" && { -+ shift; continue; -+ } -+ -+ # We use '-d' option in modprobe only if modules prefix path -+ # differs from default '/'. This allows us to use Dracut with -+ # old version of modprobe which doesn't have '-d' option. -+ moddirname=${srcmods%%/lib/modules/*} -+ [[ -n ${moddirname} ]] && moddirname="-d ${moddirname}/" -+ -+ # ok, load the module, all its dependencies, and any firmware -+ # it may require -+ for_each_kmod_dep install_kmod_with_fw $mod \ -+ --set-version $kernel ${moddirname} -+ ;; -+ esac -+ shift -+ done -+} -diff --git gen_cmdline.sh gen_cmdline.sh -index b3e451d..bc9f2dc 100755 ---- gen_cmdline.sh -+++ gen_cmdline.sh -@@ -22,6 +22,7 @@ longusage() { - echo " --logfile= Output file for debug info" - echo " --color Output debug in color" - echo " --no-color Do not output debug in color" -+ echo " --no-cleartmp Do not clear temp directory" - echo " Kernel Configuration settings" - echo " --menuconfig Run menuconfig after oldconfig" - echo " --no-menuconfig Do not run menuconfig after oldconfig" -@@ -78,6 +79,8 @@ longusage() { - echo " --splash-res= Select splash theme resolutions to install" - echo " --do-keymap-auto Forces keymap selection at boot" - echo " --no-keymap Disables keymap selection support" -+ echo " --udev Include udev in the initramfs" -+ echo " --no-udev Exclude udev from the initramfs" - echo " --lvm Include LVM support" - echo " --mdadm Include MDADM/MDMON support" - echo " --mdadm-config= Use file as mdadm.conf in initramfs" -@@ -97,6 +100,8 @@ longusage() { - echo " --unionfs Include support for unionfs" - echo " --netboot Create a self-contained env in the initramfs" - echo " --real-root= Specify a default for real_root=" -+ echo " --lscpi Include lspci into the initramfs" -+ echo " --no-lscpi Exclude lspci from the initramfs" - echo " Internals" - echo " --arch-override= Force to arch instead of autodetect" - echo " --cachedir= Override the default cache location" -@@ -232,6 +237,22 @@ parse_cmdline() { - CMD_KEYMAP=0 - print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" - ;; -+ --udev) -+ CMD_UDEV=1 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --no-udev) -+ CMD_UDEV=0 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --lspci) -+ CMD_LSPCI=1 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --no-lspci) -+ CMD_UDEV=0 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; - --lvm) - CMD_LVM=1 - print_info 2 "CMD_LVM: ${CMD_LVM}" -@@ -441,6 +462,10 @@ parse_cmdline() { - print_info 2 "USECOLOR: ${USECOLOR}" - setColorVars - ;; -+ --no-cleartmp) -+ NOCLEARTMP=1 -+ print_info 2 "NOCLEARTMP: ${NOCLEARTMP}" -+ ;; - --logfile=*) - CMD_LOGFILE=`parse_opt "$*"` - LOGFILE=`parse_opt "$*"` -diff --git gen_compile.sh gen_compile.sh -index 0758c3a..8a2339a 100755 ---- gen_compile.sh -+++ gen_compile.sh -@@ -407,7 +407,10 @@ compile_busybox() { - yes '' 2>/dev/null | compile_generic oldconfig utils - - print_info 1 'busybox: >> Compiling...' -+ OLDLOGLEVEL=$LOGLEVEL -+ LOGLEVEL=1 - compile_generic all utils -+ LOGLEVEL=$OLDLOGLEVEL - print_info 1 'busybox: >> Copying to cache...' - [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] || - gen_die 'Busybox executable does not exist!' -diff --git gen_determineargs.sh gen_determineargs.sh -index ce479cb..bda14b8 100755 ---- gen_determineargs.sh -+++ gen_determineargs.sh -@@ -107,6 +107,8 @@ determine_real_args() { - set_config_with_override BOOL SYMLINK CMD_SYMLINK - set_config_with_override STRING INSTALL_MOD_PATH CMD_INSTALL_MOD_PATH - set_config_with_override BOOL OLDCONFIG CMD_OLDCONFIG -+ set_config_with_override BOOL UDEV CMD_UDEV -+ set_config_with_override BOOL LSPCI CMD_LSPCI - set_config_with_override BOOL LVM CMD_LVM - set_config_with_override BOOL DMRAID CMD_DMRAID - set_config_with_override BOOL ISCSI CMD_ISCSI -diff --git gen_initramfs.sh gen_initramfs.sh -index 7fe4421..76b6645 100755 ---- gen_initramfs.sh -+++ gen_initramfs.sh -@@ -56,7 +56,13 @@ append_busybox() { - chmod +x "${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/default.script" - - # Set up a few default symlinks -- for i in ${BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}; do -+ if isTrue "${UDEV}" -+ then -+ BUSYBOX_APPLETS="${BUSYBOX_APPLETS:-[ ash sh uname echo cut cat}" -+ else -+ BUSYBOX_APPLETS="{$BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}" -+ fi -+ for i in ${BUSYBOX_APPLETS}; do - rm -f ${TEMP}/initramfs-busybox-temp/bin/$i > /dev/null - ln -s busybox ${TEMP}/initramfs-busybox-temp/bin/$i || - gen_die "Busybox error: could not link ${i}!" -@@ -410,7 +416,7 @@ append_firmware() { - IFS="," - for i in ${FIRMWARE_FILES} - do -- cp -L "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ -+ cp -rL "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ - done - IFS=$OLD_IFS - else -@@ -438,9 +444,71 @@ append_gpg() { - chmod a+x "${TEMP}/initramfs-gpg-temp/sbin/gpg" - cd "${TEMP}/initramfs-gpg-temp/" - find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" - rm -rf "${TEMP}/initramfs-gpg-temp" > /dev/null - } - -+append_udev() { -+ if [ -d "${TEMP}/initramfs-udev-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-udev-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-udev-temp/" -+ udevmod="${GK_SHARE}/modules/udev-rules/" -+ source ${udevmod}/module-setup.sh -+ initdir=${TEMP}/initramfs-udev-temp \ -+ moddir=${udevmod} \ -+ libdir=/lib/ \ -+ usrlibdir=/usr/lib/ \ -+ install_module -+ -+ if isTrue $LSPCI -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ fi -+ # find net modules and sound -+ (for pathname in ${INSTALL_MOD_PATH}/lib/modules/${KV}/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/drivers/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/sound -+ do -+ [[ -d $pathname ]] && find $pathname -name "*.ko" -+ done | -+ while read module;do -+ # add them prefix blacklist -+ echo "blacklist `basename $module .ko`"; -+ # concat with ready blacklist.conf -+ done;cat "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf") | -+ # sort and rewrite blacklist.conf -+ sort | uniq > "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" -+ mv "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" \ -+ "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf" -+ -+ cd "${TEMP}/initramfs-udev-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-udev-temp" > /dev/null -+} -+ -+append_lspci() { -+ if [ -d "${TEMP}/initramfs-lspci-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-lspci-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-lspci-temp/" -+ -+ initdir=${TEMP}/initramfs-lspci-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ -+ cd "${TEMP}/initramfs-lspci-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-lspci-temp" > /dev/null -+} -+ - print_list() - { - local x -@@ -489,6 +557,11 @@ append_modules() { - print_list ${!group_modules} > "${TEMP}/initramfs-modules-${KV}-temp/etc/modules/${group}" - done - cd "${TEMP}/initramfs-modules-${KV}-temp/" -+ # remove sound and media -+ for x in `find . -type d -name media -o -type d -name sound` -+ do -+ rm -r "${x}" &>/dev/null -+ done - find . | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ - || gen_die "compressing modules cpio" - cd "${TEMP}" -@@ -561,11 +634,14 @@ append_auxilary() { - done - echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" - -- if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ if ! isTrue "${UDEV}" - then -- cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -- else -- cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ then -+ cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ else -+ cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ fi - fi - if isTrue $CMD_DOKEYMAPAUTO - then -@@ -582,7 +658,7 @@ append_auxilary() { - chmod +x "${TEMP}/initramfs-aux-temp/init" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" -- chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ isTrue "${UDEV}" || chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" - - if isTrue ${NETBOOT} - then -@@ -609,6 +685,21 @@ append_data() { - fi - } - -+pack_cpio() { -+ print_info 1 " >> Pack cpio data..." -+ if [ -d "${TEMP}/initramfs-repack-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-repack-temp" -+ fi -+ mkdir -p "${TEMP}/initramfs-repack-temp" -+ cd "${TEMP}/initramfs-repack-temp" -+ # unpack and pack cpio remove double files -+ cpio -di <${CPIO} 2>/dev/null -+ find . -print | cpio ${CPIO_ARGS} | gzip -9 >"${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-repack-temp" > /dev/null -+} -+ - create_initramfs() { - print_info 1 "initramfs: >> Initializing..." - -@@ -619,6 +710,11 @@ create_initramfs() { - - append_data 'base_layout' - append_data 'auxilary' "${BUSYBOX}" -+ append_data 'udev' "${UDEV}" -+ if ! isTrue "${UDEV}" -+ then -+ append_data 'lspci' "${LSPCI}" -+ fi - append_data 'busybox' "${BUSYBOX}" - append_data 'lvm' "${LVM}" - append_data 'dmraid' "${DMRAID}" -@@ -652,8 +748,7 @@ create_initramfs() { - append_data 'overlay' - fi - -- gzip -9 "${CPIO}" -- mv -f "${CPIO}.gz" "${CPIO}" -+ pack_cpio - - if isTrue "${INTEGRATED_INITRAMFS}" - then -diff --git genkernel genkernel -index 0a06cdd..1486c61 100755 ---- genkernel -+++ genkernel -@@ -9,6 +9,7 @@ GK_V='3.4.18' - TMPDIR='/var/tmp/genkernel' - - TODEBUGCACHE=1 # Until an error occurs or LOGFILE is fully qualified. -+NOCLEARTMP=0 - - small_die() { - echo $1 -@@ -45,6 +46,7 @@ source ${GK_SHARE}/gen_initramfs.sh || gen_die "Could not read ${GK_SHARE}/gen_i - source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_moddeps.sh" - source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh" - source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh" -+source ${GK_SHARE}/dracut_funcs.sh || gen_die "Could not read ${GK_SHARE}/dracut_funcs.sh" - - TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ - -@@ -55,21 +57,25 @@ trap_cleanup(){ - } - - cleanup(){ -- if [ -n "$TEMP" -a -d "$TEMP" ]; then -- rm -rf "$TEMP" -- fi -- -- if isTrue ${POSTCLEAR} -- then -- echo -- print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -- print_info 1 "CACHE_DIR: ${CACHE_DIR}" -- CLEAR_CACHE_DIR='yes' -- setup_cache_dir -- echo -- print_info 1 "TMPDIR: ${TMPDIR}" -- clear_tmpdir -- fi -+ if [[ ${NOCLEARTMP} -ne 0 ]] -+ then -+ return -+ fi -+ if [ -n "$TEMP" -a -d "$TEMP" ]; then -+ rm -rf "$TEMP" &>/dev/null -+ fi -+ -+ if isTrue ${POSTCLEAR} -+ then -+ echo -+ print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -+ print_info 1 "CACHE_DIR: ${CACHE_DIR}" -+ CLEAR_CACHE_DIR='yes' -+ setup_cache_dir -+ echo -+ print_info 1 "TMPDIR: ${TMPDIR}" -+ clear_tmpdir -+ fi - } - - trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL -diff --git genkernel.conf genkernel.conf -index 24fcd54..41f8e06 100644 ---- genkernel.conf -+++ genkernel.conf -@@ -52,6 +52,12 @@ USECOLOR="yes" - # argument is: *+1 - # MAKEOPTS="-j2" - -+# Add udev to initramfs -+UDEV="yes" -+ -+# Add lspci to initramfs -+LSPCI="yes" -+ - # Add in LVM support from static binaries if they exist on the system, or - # compile static LVM binaries if static ones do not exist. - # LVM="no" -@@ -92,7 +98,7 @@ USECOLOR="yes" - # Specify directory to pull from - # FIRMWARE_DIR="/lib/firmware" - # Specify specific firmware files to include. This overrides FIRMWARE_DIR --# FIRMWARE_FILES="" -+FIRMWARE_FILES="/lib/firmware/radeon" - - # Enable disklabel support (copies blkid to initrd) - DISKLABEL="yes" -diff --git modules/udev-rules/01-ignore.rules modules/udev-rules/01-ignore.rules -new file mode 100644 -index 0000000..b32f22e ---- /dev/null -+++ modules/udev-rules/01-ignore.rules -@@ -0,0 +1 @@ -+KERNEL=="ram[0-9]*", OPTIONS+="ignore_device", OPTIONS+="last_rule" -diff --git modules/udev-rules/59-persistent-storage-volid.rules modules/udev-rules/59-persistent-storage-volid.rules -new file mode 100644 -index 0000000..0b798e6 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage-volid.rules -@@ -0,0 +1,7 @@ -+SUBSYSTEM!="block", GOTO="psv_end" -+ACTION!="add|change", GOTO="psv_end" -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="cciss[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", IMPORT{program}="vol_id --export $tempnode" -+LABEL="psv_end" -diff --git modules/udev-rules/59-persistent-storage.rules modules/udev-rules/59-persistent-storage.rules -new file mode 100644 -index 0000000..2b83e72 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage.rules -@@ -0,0 +1,38 @@ -+SUBSYSTEM!="block", GOTO="ps_end" -+ACTION!="add|change", GOTO="ps_end" -+ -+KERNEL=="cciss[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end" -+ -+# partitions have no md/{array_state,metadata_version} -+ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" -+ -+# container devices have a metadata version of e.g. 'external:ddf' and -+# never leave state 'inactive' -+ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -+TEST!="md/array_state", GOTO="md_end" -+ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -+ -+LABEL="md_ignore_state" -+ -+IMPORT{program}="/sbin/mdadm --detail --export $tempnode" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+OPTIONS+="link_priority=100" -+OPTIONS+="watch" -+LABEL="md_end" -+ -+ -+KERNEL!="dm-[0-9]*", GOTO="ps_end" -+ACTION=="add", GOTO="ps_end" -+IMPORT{program}="/sbin/dmsetup info -c --nameprefixes --unquoted --rows --noheadings -o name,uuid,suspended,readonly,major,minor,open,tables_loaded,names_using_dev -j%M -m%m" -+ENV{DM_NAME}!="?*", GOTO="ps_end" -+ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="ps_end" -+ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="ps_end" -+ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="ps_end" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+LABEL="ps_end" -diff --git modules/udev-rules/61-persistent-storage.rules modules/udev-rules/61-persistent-storage.rules -new file mode 100644 -index 0000000..9cfdb0b ---- /dev/null -+++ modules/udev-rules/61-persistent-storage.rules -@@ -0,0 +1,20 @@ -+SUBSYSTEM!="block", GOTO="pss_end" -+ACTION!="add|change", GOTO="pss_end" -+ -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss" -+KERNEL=="cciss[0-9]*", GOTO="do_pss" -+KERNEL=="nbd[0-9]*", GOTO="do_pss" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", GOTO="do_pss" -+ -+GOTO="pss_end" -+ -+LABEL="do_pss" -+# by-path (parent device path) -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{program}="path_id %p" -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" -+ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" -+ -+# by-label/by-uuid links (filesystem metadata) -+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -+LABEL="pss_end" -diff --git modules/udev-rules/blacklist.conf modules/udev-rules/blacklist.conf -new file mode 100644 -index 0000000..21ac71c ---- /dev/null -+++ modules/udev-rules/blacklist.conf -@@ -0,0 +1,162 @@ -+blacklist ath_pci -+blacklist evbug -+blacklist usbmouse -+blacklist usbkbd -+blacklist eepro100 -+blacklist de4x5 -+blacklist eth1394 -+blacklist snd_intel8x0m -+blacklist snd_aw2 -+blacklist i2c_i801 -+blacklist prism54 -+blacklist bcm43xx -+blacklist garmin_gps -+blacklist asus_acpi -+blacklist snd_pcsp -+blacklist pcspkr -+blacklist amd76x_edac -+blacklist ohci1394 -+blacklist sbp2 -+blacklist dv1394 -+blacklist raw1394 -+blacklist video1394 -+blacklist aty128fb -+blacklist atyfb -+blacklist radeonfb -+blacklist cirrusfb -+blacklist cyber2000fb -+blacklist cyblafb -+blacklist gx1fb -+blacklist hgafb -+blacklist i810fb -+blacklist intelfb -+blacklist kyrofb -+blacklist lxfb -+blacklist matroxfb_base -+blacklist neofb -+blacklist nvidiafb -+blacklist pm2fb -+blacklist rivafb -+blacklist s1d13xxxfb -+blacklist savagefb -+blacklist sisfb -+blacklist sstfb -+blacklist tdfxfb -+blacklist tridentfb -+blacklist vesafb -+blacklist vfb -+blacklist viafb -+blacklist vt8623fb -+blacklist ac97 -+blacklist ac97_codec -+blacklist ac97_plugin_ad1980 -+blacklist ad1848 -+blacklist ad1889 -+blacklist adlib_card -+blacklist aedsp16 -+blacklist ali5455 -+blacklist btaudio -+blacklist cmpci -+blacklist cs4232 -+blacklist cs4281 -+blacklist cs461x -+blacklist cs46xx -+blacklist emu10k1 -+blacklist es1370 -+blacklist es1371 -+blacklist esssolo1 -+blacklist forte -+blacklist gus -+blacklist i810_audio -+blacklist kahlua -+blacklist mad16 -+blacklist maestro -+blacklist maestro3 -+blacklist maui -+blacklist mpu401 -+blacklist nm256_audio -+blacklist opl3 -+blacklist opl3sa -+blacklist opl3sa2 -+blacklist pas2 -+blacklist pss -+blacklist rme96xx -+blacklist sb -+blacklist sb_lib -+blacklist sgalaxy -+blacklist sonicvibes -+blacklist sound -+blacklist sscape -+blacklist trident -+blacklist trix -+blacklist uart401 -+blacklist uart6850 -+blacklist via82cxxx_audio -+blacklist v_midi -+blacklist wavefront -+blacklist ymfpci -+blacklist ac97_plugin_wm97xx -+blacklist ad1816 -+blacklist audio -+blacklist awe_wave -+blacklist dmasound_core -+blacklist dmasound_pmac -+blacklist harmony -+blacklist sequencer -+blacklist soundcard -+blacklist usb-midi -+blacklist acquirewdt -+blacklist advantechwdt -+blacklist alim1535_wdt -+blacklist alim7101_wdt -+blacklist booke_wdt -+blacklist cpu5wdt -+blacklist eurotechwdt -+blacklist i6300esb -+blacklist i8xx_tco -+blacklist ib700wdt -+blacklist ibmasr -+blacklist indydog -+blacklist iTCO_wdt -+blacklist it8712f_wdt -+blacklist it87_wdt -+blacklist ixp2000_wdt -+blacklist ixp4xx_wdt -+blacklist machzwd -+blacklist mixcomwd -+blacklist mpc8xx_wdt -+blacklist mpcore_wdt -+blacklist mv64x60_wdt -+blacklist pc87413_wdt -+blacklist pcwd -+blacklist pcwd_pci -+blacklist pcwd_usb -+blacklist s3c2410_wdt -+blacklist sa1100_wdt -+blacklist sbc60xxwdt -+blacklist sbc7240_wdt -+blacklist sb8360 -+blacklist sc1200wdt -+blacklist sc520_wdt -+blacklist sch311_wdt -+blacklist scx200_wdt -+blacklist shwdt -+blacklist smsc37b787_wdt -+blacklist softdog -+blacklist twl4030_wdt -+blacklist w83627hf_wdt -+blacklist w83697hf_wdt -+blacklist w83697ug_wdt -+blacklist w83877f_wdt -+blacklist w83977f_wdt -+blacklist wafer5823wdt -+blacklist wdt -+blacklist wdt_pci -+blacklist wm8350_wdt -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -diff --git modules/udev-rules/load-modules.sh modules/udev-rules/load-modules.sh -new file mode 100755 -index 0000000..36972fd ---- /dev/null -+++ modules/udev-rules/load-modules.sh -@@ -0,0 +1,7 @@ -+#!/bin/sh -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+# Implement blacklisting for udev-loaded modules -+ -+modprobe -b "$@" -diff --git modules/udev-rules/module-setup.sh modules/udev-rules/module-setup.sh -new file mode 100755 -index 0000000..1005627 ---- /dev/null -+++ modules/udev-rules/module-setup.sh -@@ -0,0 +1,57 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+install_module() { -+ # FIXME: would be nice if we didn't have to know which rules to grab.... -+ # ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies -+ # of the rules we want so that we just copy those in would be best -+ dracut_install udevd udevadm /etc/udev/udev.conf /etc/group /bin/mount /sbin/modprobe -+ inst_rules 50-udev-default.rules 60-persistent-storage.rules \ -+ 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \ -+ 60-pcmcia.rules -+ mkdir -p "$initdir"/etc/modprobe.d -+ inst_simple "$moddir/blacklist.conf" /etc/modprobe.d/ -+ -+ # ignore some devices in the initrd -+ inst_rules "$moddir/01-ignore.rules" -+ -+ # for firmware loading -+ inst_rules 50-firmware.rules -+ -+ if [ ! -x /lib/udev/vol_id ]; then -+ inst_rules "$moddir/59-persistent-storage.rules" -+ else -+ inst_rules "$moddir/59-persistent-storage-volid.rules" -+ fi -+ inst_rules "$moddir/61-persistent-storage.rules" -+ -+ for i in \ -+ ata_id \ -+ cdrom_id \ -+ create_floppy_devices \ -+ edd_id \ -+ firmware.sh \ -+ firmware \ -+ firmware.agent \ -+ hotplug.functions \ -+ fw_unit_symlinks.sh \ -+ hid2hci \ -+ path_id \ -+ scsi_id \ -+ usb_id \ -+ vol_id \ -+ pcmcia-socket-startup \ -+ pcmcia-check-broken-cis \ -+ ; do -+ for utilpath in /lib/udev /sbin /bin -+ do -+ [ -e $utilpath/$i ] && dracut_install $utilpath/$i -+ done -+ done -+ -+ for i in {"$libdir","$usrlibdir"}/libnss_files*; do -+ [ -e "$i" ] && dracut_install "$i" -+ done -+} -+ diff --git a/sys-kernel/calckernel/files/calckernel-3.4.18-r3.patch b/sys-kernel/calckernel/files/calckernel-3.4.18-r3.patch deleted file mode 100644 index 4088199df..000000000 --- a/sys-kernel/calckernel/files/calckernel-3.4.18-r3.patch +++ /dev/null @@ -1,2106 +0,0 @@ -diff --git defaults/initrd.defaults defaults/initrd.defaults -index 76d72a7..0c059a5 100755 ---- defaults/initrd.defaults -+++ defaults/initrd.defaults -@@ -68,6 +68,7 @@ fi - - REAL_ROOT='' - CDROOT='0' -+SCRATCH='0' - CDROOT_DEV='' - CDROOT_TYPE='auto' - NEW_ROOT='/newroot' -diff --git defaults/initrd.scripts defaults/initrd.scripts -index 51ebcce..88d4f1e 100755 ---- defaults/initrd.scripts -+++ defaults/initrd.scripts -@@ -187,23 +187,45 @@ cache_cd_contents() { - # TODO: Check the size of the image versus the size of our tmpfs - # along with the amount of available RAM and increase tmpfs size - # if necessary. (Not having awk sucks...) -- # z=0 -- # for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -- # cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; do -- # z=$(($z + $i)) ; done -- # echo $z -- good_msg "Copying loop file for caching..." -- # Verify that the needed directory exists -- mkdir -p "$(dirname ${NEW_ROOT}/mnt/${LOOP})" -- cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/${LOOP} -- if [ $? -ne 0 ] -+ -+ # getting memory -+ allmemory=0 -+ for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -+ cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; -+ do -+ allmemory=$(($allmemory + $i)) -+ done -+ -+ # getting size tmpfs of default -+ let curtfs=$allmemory/2 -+ -+ # getting size of image -+ let imagesize=`ls -la ${NEW_ROOT}/mnt/cdrom/${LOOP} | sed -r -n 's/(\S*\s*){4}(\S*).*/\2/p'`/20000*21 -+ let addon=$imagesize/10 -+ if [[ $curtfs -gt $(( ${imagesize} + ${addon} )) ]]; - then -- bad_msg "Failed to cache the loop file! Lack of space?" -- rm -rf ${NEW_ROOT}/mnt/livecd.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/image.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/zisofs 2>/dev/null -+ let addon=$(( $curtfs - ${imagesize} )) -+ fi -+ -+ if [[ $((${imagesize} + $addon)) -lt ${allmemory} ]]; -+ then -+ mount -o remount,size=${addon}000 -t tmpfs tmpfs ${NEW_ROOT} -+ mkdir ${NEW_ROOT}/mnt/squash -+ mount -o size=${imagesize}000 -t tmpfs tmpfs ${NEW_ROOT}/mnt/squash -+ good_msg "Copying loop file for caching..." -+ cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/squash/${LOOP} -+ if [ $? -ne 0 ] -+ then -+ bad_msg "Failed to cache the loop file! Lack of space?" -+ umount ${NEW_ROOT}/mnt/squash -+ mount -o remount,size=${curtfs}000 -t tmpfs tmpfs ${NEW_ROOT} -+ else -+ LOOPEXT='../squash/' -+ good_msg "Unmounting media from ${NEW_ROOT}/mnt/cdrom" -+ umount ${NEW_ROOT}/mnt/cdrom -+ fi - else -- LOOPEXT='../' -+ bad_msg "Too low memory for cache the loop file." - fi - fi - fi -@@ -266,7 +288,7 @@ findnfsmount() { - if [ "${CDROOT}" != '0' ] - then - good_msg "Attempting to mount NFS CD image on ${NFSROOT} with options ${NFSOPTIONS}" -- mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT}/mnt/cdrom -+ busybox mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT}/mnt/cdrom - if [ "$?" = '0' ] - then - REAL_ROOT="/dev/nfs" -@@ -275,7 +297,7 @@ findnfsmount() { - fi - else - good_msg "Attempting to mount NFS root on ${NFSROOT} with options ${NFSOPTIONS}" -- mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT} -+ busybox mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT} - if [ "$?" = '0' ] - then - REAL_ROOT="/dev/nfs" -@@ -655,7 +677,7 @@ startVolumes() { - [ -d /etc/lvm/cache ] && lvm_commands="${lvm_commands} \nvgscan" - - # To activate volumegroups on all devices in the cache -- lvm_commands="${lvm_commands} \nvgchange -ay --sysinit" -+ lvm_commands="${lvm_commands} \nvgchange -ay --sysinit --noudevsync" - - # And finally execute it all (/proc/... needed if lvm is compiled without readline) - good_msg "Scanning for and activating Volume Groups" -@@ -1082,6 +1104,38 @@ getdvhoff() { - echo $(( $(hexdump -n 4 -s $((316 + 12 * $2)) -e '"%i"' $1) * 512)) - } - -+load_union_module() { -+ UNIONTYPE="" -+ # find module for union file system -+ [ -n "$(find /lib/ -name unionfs.ko)" ] && UNIONTYPE="unionfs" -+ [ -n "$(find /lib/ -name aufs.ko)" ] && UNIONTYPE="aufs" -+ # probably aufs in kernel -+ if [ -n "$(gzip -dc /proc/config.gz | grep CONFIG_AUFS_FS=y )" ] -+ then -+ UNIONTYPE="aufs" -+ else -+ if [ -z "${UNIONTYPE}" ] -+ then -+ bad_msg "Module for union file system is not found!" -+ run_shell -+ else -+ modprobe ${UNIONTYPE} > /dev/null 2>&1 -+ # error on load union module -+ if [ -z "$(lsmod | grep $UNIONTYPE)" ] -+ then -+ bad_msg "Module for union file system is not correct!" -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ bad_msg "Probably kernel compiled without standalone patch." -+ fi -+ run_shell -+ fi -+ -+ good_msg "Loading ${UNIONTYPE}" -+ fi -+ fi -+} -+ - setup_unionfs() { - local rw_dir=$1 - local ro_dir=$2 -@@ -1101,6 +1155,7 @@ setup_unionfs() { - mkdir -p ${UNION} - good_msg "Loading fuse module" - modprobe fuse > /dev/null 2>&1 -+ load_union_module - # if [ -n "${UNIONFS}" ] - # then - # CHANGESDEV=${UNIONFS} -@@ -1130,11 +1185,102 @@ setup_unionfs() { - mkdir /tmp - mkdir -p ${UNION} - # mkdir -p $CHANGES --# mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+## mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+ -+ if [ "${SCRATCH}" -ne 0 ]; -+ then -+ good_msg "Loading in scratch mode" -+ BUILDERDIR=${UNION}/mnt/builder -+ SCRATCHDIR=${UNION}/mnt/scratch -+ DELTADIR=${rw_dir}/mnt/delta -+ WORKSPACEDIR=${rw_dir}/mnt/workspace -+ mount -o remount,rw ${rw_dir}/mnt/cdrom >/dev/null 2>&1 -+ touch ${rw_dir}/mnt/cdrom/livecd >/dev/null 2>&1 -+ if [ "$?" -ne 0 ]; -+ then -+ ISRW=0 -+ else -+ ISRW=1 -+ fi -+ -+ mkdir -p ${DELTADIR} -+ mkdir -p ${WORKSPACEDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${WORKSPACEDIR}=rw:${DELTADIR}=ro+wh:${rw_dir}/mnt/livecd=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${WORKSPACEDIR}=rw:${DELTADIR}=ro:${rw_dir}/mnt/livecd=ro unionfs ${UNION} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${SCRATCHDIR}/calculate -+ mkdir -p ${SCRATCHDIR}/delta -+ mkdir -p ${SCRATCHDIR}/workspace -+ mount -o bind ${rw_dir}/mnt/delta ${SCRATCHDIR}/delta -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind ${rw_dir}/mnt/workspace ${SCRATCHDIR}/workspace -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${BUILDERDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro none ${BUILDERDIR} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro unionfs ${BUILDERDIR} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind,ro ${rw_dir}/mnt/livecd ${SCRATCHDIR}/calculate -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ if [ "$ISRW" -ne 0 ]; -+ then -+ FLASHDIR=${UNION}/mnt/flash -+ mkdir -p ${FLASHDIR} -+ mount -o bind ${rw_dir}/mnt/cdrom ${FLASHDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ mkdir -p ${CDROMDIR} -+ mount -o bind,ro ${rw_dir}/mnt/cdrom ${CDROMDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ fi -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ LIVECDDIR=${UNION}/mnt/livecd -+ -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${rw_dir}:${ro_dir}=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${rw_dir}:${ro_dir}=ro unionfs ${UNION} -+ fi -+ -+ if [[ -n "$( echo ${LOOPEXT} | grep squash )" ]]; -+ then -+ mkdir -p ${UNION}/mnt/squash -+ mount -o bind ${NEW_ROOT}/mnt/squash ${UNION}/mnt/squash &>/dev/null -+ fi -+ -+ chmod 0755 ${UNION} -+ mount -o bind ${rw_dir}/mnt/cdrom ${CDROMDIR} &>/dev/null -+ mount -o bind ${rw_dir}/mnt/livecd ${LIVECDDIR} &>/dev/null -+ ret=$? -+ fi -+ -+ chmod 1777 ${UNION}/tmp - good_msg "Creating union mount" -- unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -- ret=$? -- if [ ${ret} -ne 0 ] -+# unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -+# ret=$? -+ if [ "${ret}" -ne 0 ] - then - bad_msg "Can't setup union mount!" - USE_UNIONFS_NORMAL=0 -@@ -1143,3 +1289,111 @@ setup_unionfs() { - USE_UNIONFS_NORMAL=0 - fi - } -+ -+load_videodrv() { -+ good_msg "Loading frame buffer video driver" -+ # find all available fb drivers -+ videodrv_count=$(find /lib/modules \ -+ -name "nouveau.ko" -o \ -+ -name "uvesafb.ko" -o \ -+ -name "i915.ko" -o \ -+ -name "radeon.ko" | -+ grep -c "") -+ # load specified videodrv -+ modules_list= -+ case "${VIDEODRV}" in -+ nouveau) -+ modules_list="nouveau" -+ ;; -+ radeon) -+ modules_list="radeon" -+ ;; -+ i915|intel) -+ modules_list="i915" -+ ;; -+ ""|auto) -+ # if not livecd and initramfs otimized (aviailable only one video driver) -+ if [ "${CDROOT}" != '1' -a "${videodrv_count}" -le 2 ] -+ then -+ modules_list="nouveau i915 radeon" -+ else -+ if [[ -x /usr/sbin/lspci ]] -+ then -+ if lspci | grep -m1 VGA | grep -qi intel -+ then -+ modules_list="i915" -+ elif lspci | grep -m1 VGA | grep -qi nvidia -+ then -+ modules_list="nouveau" -+ elif lspci | grep -m1 VGA | grep -q -e "Ati" -e "ATI" -+ then -+ modules_list="radeon" -+ else -+ modules_list="" -+ fi -+ else -+ modules_list="i915" -+ fi -+ fi -+ ;; -+ esac -+ for x in $modules_list -+ do -+ if [ "`find /lib/modules -name "${x}.ko" | grep -c ''`" -eq "1" ] -+ then -+ modprobe "${x}" modeset=${USE_MODESET} &>/dev/null -+ lsmod | grep -q "^${x}" && \ -+ [ "`cat /sys/module/${x}/refcnt`" -gt 0 ] && return 0 -+ fi -+ done -+ # else load uvesafb with specified video resolution -+ if [ -n "${VIDEORES}" ] -+ then -+ if ! echo $VIDEORES | grep -q "\-" -+ then -+ VIDEORES="${VIDEORES}-32" -+ fi -+ else -+ VIDEORES="1024x768-32" -+ fi -+ modprobe uvesafb mode_option=${VIDEORES} &>/dev/null -+} -+ -+start_udev() -+{ -+ # start udev -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ echo "" >/proc/sys/kernel/hotplug -+ udevd --daemon &>/dev/null -+ udevadm settle -+ fi -+} -+ -+stop_udev() -+{ -+ # kill udevd -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ pkill udevd &>/dev/null -+ fi -+} -+ -+populate_dev() -+{ -+ good_msg 'Activating udev' -+ # Do not run any init-scripts -+ udevadm control --property=do_not_run_plug_service=1 -+ -+ if [ "${REAL_ROOT}" == "/dev/nfs" ] -+ then -+ rm /etc/modprobe.d/blacklist.conf -+ fi -+ # discarding net drivers placed into blacklist.conf -+ udevadm trigger --action="add" -+ -+ # we can speed up booting under these conditions: -+ # * using devtmpfs so kernel creates device nodes for us -+ # * only using kernel created device nodes at boot (in /etc/fstab and elsewhere) -+ udevadm settle --timeout=60 -+} -diff --git defaults/linuxrc defaults/linuxrc -index 0843f5d..8109d09 100755 ---- defaults/linuxrc -+++ defaults/linuxrc -@@ -39,6 +39,13 @@ FAKE_ROOT='' - REAL_ROOTFLAGS='' - ROOTFSTYPE='auto' - CRYPT_SILENT=0 -+VIDEODRV='' -+USE_UDEV=1 -+USE_MODESET=1 -+if [ -e "/etc/calculate/calculate.ini" ] -+then -+ source /etc/calculate/calculate.ini -+fi - for x in ${CMDLINE} - do - case "${x}" in -@@ -57,6 +64,57 @@ do - init_opts\=*) - INIT_OPTS=`parse_opt "${x}"` - ;; -+ nokms) -+ USE_MODESET=0 -+ ;; -+ kms) -+ USE_MODESET=1 -+ ;; -+ noudev) -+ USE_UDEV=0 -+ ;; -+ calculate\=*) -+ CALCULATE=`parse_opt "${x}"` -+ if [[ "${CALCULATE//:/}" != "${CALCULATE}" ]] -+ then -+ for i in ${CALCULATE//,/ } -+ do -+ case "${i}" in -+ video:*) -+ VIDEODRV=`echo "${i}" | cut -s -d: -f2-` -+ ;; -+ resolution:*) -+ RES=`echo "${i}" | cut -s -d: -f2-` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ ;; -+ esac -+ done -+ else -+ RES=`echo "${CALCULATE}" | cut -s -d, -f4` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ VIDEODRV=`echo "${CALCULATE}" | cut -s -d, -f5` -+ fi -+ ;; -+ video\=*) -+ VR=`parse_opt "${x}"` -+ for i in ${VR//,/ } -+ do -+ if [ -z "${i//[0-9-x@]}" ] -+ then -+ VIDEORES=${i} -+ fi -+ done -+ ;; -+ # Scratch usbload -+ scratch) -+ SCRATCH=1 -+ ;; - # Livecd options - cdroot) - CDROOT=1 -@@ -251,15 +309,24 @@ then - REAL_ROOT="${FAKE_ROOT}" - fi - --splash 'init' -- --cmdline_hwopts -+# check udevd -+[ ! -x /sbin/udevd ] && USE_UDEV=0 - - # Mount sysfs - mount_sysfs - -+# start udev -+start_udev -+ -+# load kernel video driver -+load_videodrv -+ -+splash 'init' -+ -+cmdline_hwopts -+ - # Setup hotplugging for firmware loading --setup_hotplug -+[ "${USE_UDEV}" == "0" ] && setup_hotplug - - # Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel - if [ -z "${DO_modules}" ] -@@ -269,7 +336,7 @@ elif [ -d "/lib/modules/${KV}" ] - then - good_msg 'Loading modules' - # Load appropriate kernel modules -- if [ "${NODETECT}" != '1' ] -+ if [ "${USE_UDEV}" != '1' -a "${NODETECT}" != '1' ] - then - for modules in ${MY_HWOPTS} - do -@@ -285,14 +352,20 @@ fi - # Apply scan delay if specified - sdelay - --# Setup slow USB bits --setup_slowusb -+if [ "${USE_UDEV}" == "1" ] -+then -+ # populate /dev with devices already found by the kernel -+ populate_dev -+else -+ # Setup slow USB bits -+ setup_slowusb - --# Start device manager --start_dev_mgr -+ # Start device manager -+ start_dev_mgr - --# if doslowusb is passed, pause other 10 seconds here, after mdev load --[ "${DO_slowusb}" ] && sleep 10 -+ # if doslowusb is passed, pause other 10 seconds here, after mdev load -+ [ "${DO_slowusb}" ] && sleep 10 -+fi - - # Start iSCSI - if [ -e /bin/iscsistart ] -@@ -509,9 +582,50 @@ do - then - break - else -- bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -- got_good_root=0 -- REAL_ROOT='' -+ # check for scratch -+ if [ -e ${NEW_ROOT}/livecd.squashfs -a -d ${NEW_ROOT}/delta -a -d ${NEW_ROOT}/workspace ]; -+ then -+ good_msg 'Found scratch data...' -+ load_union_module -+ modprobe squashfs >/dev/null -+ if mount -o remount,rw ${NEW_ROOT}; -+ then -+ mkdir -p ${NEW_ROOT}/calculate && mkdir -p /union && mkdir -p ${NEW_ROOT}/workspace/mnt/builder && mkdir -p ${NEW_ROOT}/workspace/mnt/scratch -+ if mount -o loop,ro -t squashfs ${NEW_ROOT}/livecd.squashfs ${NEW_ROOT}/calculate; -+ then -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/workspace=rw:${NEW_ROOT}/delta=ro+wh:${NEW_ROOT}/calculate=ro none /union; -+ then -+ mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/delta=rw:${NEW_ROOT}/calculate=ro none /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers!' -+ run_shell -+ fi -+ else -+ if mount -t unionfs -o ro,dirs=${NEW_ROOT}/workspace:${NEW_ROOT}/delta=ro:${NEW_ROOT}/calculate=ro unionfs /union; -+ then -+ mount -t unionfs -o ro,dirs=${NEW_ROOT}/delta:${NEW_ROOT}/calculate=ro unionfs /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers' -+ run_shell -+ fi -+ fi -+ else -+ bad_msg 'Could not mount scratch squashfs image' -+ fi -+ else -+ bad_msg 'Could not remount ${NEW_ROOT}' -+ fi -+ else -+ bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -+ got_good_root=0 -+ REAL_ROOT='' -+ fi - fi - else - bad_msg "Could not mount specified ROOT, try again" -@@ -723,9 +837,12 @@ cd "${CHROOT}" - mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null - echo -ne "${BOLD}.${NORMAL}" - -+# stop udev before move mount points -+stop_udev -+ - # If devtmpfs is mounted, try move it to the new root - # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise --for fs in /dev /sys /proc -+for fs in "/dev " /sys /proc - do - if grep -qs "$fs" /proc/mounts - then -diff --git defaults/modprobe defaults/modprobe -index ba2d890..9280357 100755 ---- defaults/modprobe -+++ defaults/modprobe -@@ -10,8 +10,6 @@ usage() { - echo - echo 'Example:' - echo ' modprobe eepro100' -- echo -- echo 'Note: Do not pass the suffix to modprobe!' - exit 1 - } - -@@ -81,14 +79,29 @@ modprobe2() { - usage - exit 1 - fi -- real_path=`real_mod_path ${1}` -+ local modname=${1} -+ local quiet='' -+ local params='' -+ shift -+ for x in $@ -+ do -+ case ${x} in -+ -n) -+ quiet=1 -+ ;; -+ *) -+ params="${params} ${x}" -+ ;; -+ esac -+ done -+ real_path=`real_mod_path ${modname}` - if [ "${real_path}" = '' -o "${real_path}" = ' ' ] - then -- [ "${2}" = '-n' ] && echo -n " -> $1" -+ [ "${quiet}" = '1' ] && echo -n " -> ${modname}" - echo ' module not found.' - exit 2 - fi -- modlist=`modules_dep_list ${1}` -+ modlist=`modules_dep_list ${modname}` - if [ "${modlist}" != '' -a "${modlist}" != ' ' ] - then - deps=`strip_mod_paths ${modlist}` -@@ -110,13 +123,13 @@ modprobe2() { - filler=1 - fi - done -- ${INSMOD} ${real_path} > /dev/null 2>&1 -+ ${INSMOD} ${real_path} ${params} > /dev/null 2>&1 - ret=$? - if [ ${ret} -eq 0 ] - then - echoAppend=' loaded.' -- [ "${2}" = '-n' ] && echoFlags='-n' && echoAppend=', ' -- echo ${echoFlags} "${1}${echoAppend}" -+ [ "${quiet}" = '1' ] && echoFlags='-n' && echoAppend=', ' -+ echo ${echoFlags} "${modname}${echoAppend}" - fi - return $ret - } -@@ -132,7 +145,7 @@ do - LOADED_MODULES="${LOADED_MODULES} ${x}" - done - --modprobe2 ${1} -+modprobe2 ${@} - modprobe_ret=$? - - [ -f '/modules.cache' ] && rm -f /modules.cache > /dev/null 2>&1 -diff --git dracut_funcs.sh dracut_funcs.sh -new file mode 100755 -index 0000000..e80a638 ---- /dev/null -+++ dracut_funcs.sh -@@ -0,0 +1,752 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+# -+# functions used by dracut and other tools. -+# -+# Copyright 2005-2009 Red Hat, Inc. All rights reserved. -+# -+# 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; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+# -+ -+IF_RTLD="" -+IF_dynamic="" -+ -+# Generic substring function. If $2 is in $1, return 0. -+strstr() { [[ $1 =~ $2 ]]; } -+ -+# Create all subdirectories for given path without creating the last element. -+# $1 = path -+mksubdirs() { mkdir -p ${1%/*}; } -+ -+# Version comparision function. Assumes Linux style version scheme. -+# $1 = version a -+# $2 = comparision op (gt, ge, eq, le, lt, ne) -+# $3 = version b -+vercmp() { -+ local n1=(${1//./ }) op=$2 n2=(${3//./ }) i res -+ -+ for ((i=0; ; i++)) -+ do -+ if [[ ! ${n1[i]}${n2[i]} ]]; then res=0 -+ elif ((${n1[i]:-0} > ${n2[i]:-0})); then res=1 -+ elif ((${n1[i]:-0} < ${n2[i]:-0})); then res=2 -+ else continue -+ fi -+ break -+ done -+ -+ case $op in -+ gt) ((res == 1));; -+ ge) ((res != 2));; -+ eq) ((res == 0));; -+ le) ((res != 1));; -+ lt) ((res == 2));; -+ ne) ((res != 0));; -+ esac -+} -+ -+is_func() { -+ [[ $(type -t $1) = "function" ]] -+} -+ -+# Log initrd creation. -+if ! [[ $dracutlogfile ]]; then -+ [[ $dracutbasedir = /usr/share/dracut ]] && \ -+ dracutlogfile=/var/log/dracut.log || \ -+ dracutlogfile=/tmp/dracut.log -+# [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log -+ if [[ -w $dracutlogfile ]]; then -+ >"$dracutlogfile" -+ fi -+fi -+ -+dwarning() { -+ echo "W: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "W: $@" >>"$dracutlogfile" -+} -+ -+dinfo() { -+ [[ $beverbose ]] && echo "I: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "I: $@" >>"$dracutlogfile" -+} -+ -+derror() { -+ echo "E: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile" -+} -+ -+# Function prints global variables in format name=value line by line. -+# $@ = list of global variables' name -+print_vars() { -+ local var value -+ -+ for var in $@ -+ do -+ value=$(eval echo \$$var) -+ [[ ${value} ]] && echo "${var}=\"${value}\"" -+ done -+} -+ -+get_fs_env() { -+ [[ $1 ]] || return -+ eval $(udevadm info --query=env --name=$1|egrep 'ID_FS_(TYPE|UUID)=') -+ [[ $ID_FS_TYPE ]] && return -+ -+ if [[ -x /lib/udev/vol_id ]]; then -+ eval $(/lib/udev/vol_id --export $1) -+ elif find_binary blkid >/dev/null; then -+ eval $(blkid -o udev $1) -+ else -+ return 1 -+ fi -+} -+ -+get_fs_type() ( -+ [[ $1 ]] || return -+ if [[ $1 != ${1#/dev/block/nfs:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs3:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs4:} ]]; then -+ echo "nfs" -+ return -+ fi -+ get_fs_env $1 || return -+ echo $ID_FS_TYPE -+) -+ -+get_fs_uuid() ( -+ get_fs_env $1 || return -+ echo $ID_FS_UUID -+) -+ -+# finds the major:minor of the block device backing the root filesystem. -+find_block_device() { -+ local x mpt majmin dev fs misc maj min -+ if [[ $use_fstab != yes ]]; then -+ while read x x majmin x mpt x x fs dev misc; do -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $fs = btrfs ]] && { -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ } -+ if [[ $mpt = $1 ]] && [[ ${majmin#0:} = $majmin ]]; then -+ echo $majmin; -+ return 0 # we have a winner! -+ fi -+ done < /proc/self/mountinfo -+ fi -+ # fall back to /etc/fstab -+ while read dev mpt fs misc; do -+ if [[ $mpt = $1 ]]; then -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $dev != ${dev#UUID=} ]] && dev=/dev/disk/by-uuid/${dev#UUID=} -+ [[ $dev != ${dev#LABEL=} ]] && dev=/dev/disk/by-label/${dev#LABEL=} -+ [[ -b $dev ]] || return 1 # oops, not a block device. -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ fi -+ done < /etc/fstab -+ return 1; -+} -+ -+find_root_block_device() { find_block_device /; } -+ -+# Walk all the slave relationships for a given block device. -+# Stop when our helper function returns success -+# $1 = function to call on every found block device -+# $2 = block device in major:minor format -+check_block_and_slaves() { -+ local x -+ [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. -+ "$1" $2 && return -+ check_vol_slaves "$@" && return 0 -+ if [[ -f /sys/dev/block/$2/../dev ]]; then -+ check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0 -+ fi -+ [[ -d /sys/dev/block/$2/slaves ]] || return 1 -+ for x in /sys/dev/block/$2/slaves/*/dev; do -+ [[ -f $x ]] || continue -+ check_block_and_slaves $1 $(cat "$x") && return 0 -+ done -+ return 1 -+} -+ -+get_numeric_dev() { -+ ls -lH "$1" | { read a b c d maj min rest; printf "%d:%d" ${maj%%,} $min;} -+} -+ -+# ugly workaround for the lvm design -+# There is no volume group device, -+# so, there are no slave devices for volume groups. -+# Logical volumes only have the slave devices they really live on, -+# but you cannot create the logical volume without the volume group. -+# And the volume group might be bigger than the devices the LV needs. -+check_vol_slaves() { -+ for i in /dev/mapper/*; do -+ lv=$(get_numeric_dev $i) -+ if [[ $lv = $2 ]]; then -+ vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null) -+ # strip space -+ vg=$(echo $vg) -+ if [[ $vg ]]; then -+ for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \ -+ do -+ check_block_and_slaves $1 $(get_numeric_dev $pv) \ -+ && return 0 -+ done -+ fi -+ fi -+ done -+ return 1 -+} -+ -+# Install a directory, keeping symlinks as on the original system. -+# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file" -+# will create ${initdir}/lib64, ${initdir}/lib64/file, -+# and a symlink ${initdir}/lib -> lib64. -+inst_dir() { -+ local dir="$1" -+ [[ -e ${initdir}$dir ]] && return 0 -+ -+ # iterate over parent directories -+ local file="" -+ local IFS="/" -+ for part in $dir; do -+ [[ $part ]] || continue -+ file="$file/$part" -+ [[ -e ${initdir}$file ]] && continue -+ -+ if [[ -L $file ]]; then -+ # create link as the original -+ local target=$(readlink "$file") -+ ln -sfn "$target" "${initdir}$file" || return 1 -+ # resolve relative path and recursively install destionation -+ [[ $target = ${target##*/} ]] && target="${file%/*}/$target" -+ inst_dir "$target" -+ else -+ # create directory -+ mkdir -p "${initdir}$file" || return 1 -+ fi -+ done -+} -+ -+# $1 = file to copy to ramdisk -+# $2 (optional) Name for the file on the ramdisk -+# Location of the image dir is assumed to be $initdir -+# We never overwrite the target if it exists. -+inst_simple() { -+ local src target -+ [[ -f $1 ]] || return 1 -+ src=$1 target="${2:-$1}" -+ if ! [[ -d ${initdir}$target ]]; then -+ [[ -e ${initdir}$target ]] && return 0 -+ inst_dir "${target%/*}" -+ fi -+ dinfo "Installing $src" -+ cp -pfL "$src" "${initdir}$target" -+} -+ -+# find symlinks linked to given library file -+# $1 = library file -+# Function searches for symlinks by stripping version numbers appended to -+# library filename, checks if it points to the same target and finally -+# prints the list of symlinks to stdout. -+# -+# Example: -+# rev_lib_symlinks libfoo.so.8.1 -+# output: libfoo.so.8 libfoo.so -+# (Only if libfoo.so.8 and libfoo.so exists on host system.) -+rev_lib_symlinks() { -+ [[ ! $1 ]] && return 0 -+ -+ local fn="$1" orig="$(readlink -f "$1")" links='' -+ -+ [[ ${fn} =~ .*\.so\..* ]] || return 1 -+ -+ until [[ ${fn##*.} == so ]]; do -+ fn="${fn%.*}" -+ [[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}" -+ done -+ -+ echo ${links} -+} -+ -+# Same as above, but specialized to handle dynamic libraries. -+# It handles making symlinks according to how the original library -+# is referenced. -+inst_library() { -+ local src=$1 dest=${2:-$1} lib reallib symlink -+ [[ -e $initdir$dest ]] && return 0 -+ if [[ -L $src ]]; then -+ reallib=$(readlink -f "$src") -+ lib=${src##*/} -+ inst_simple "$reallib" "$reallib" -+ inst_dir "${dest%/*}" -+ (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib") -+ else -+ inst_simple "$src" "$dest" -+ fi -+ -+ # Create additional symlinks. See rev_symlinks description. -+ for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do -+ [[ ! -e $initdir$symlink ]] && { -+ dinfo "Creating extra symlink: $symlink" -+ inst_symlink $symlink -+ } -+ done -+} -+ -+# find a binary. If we were not passed the full path directly, -+# search in the usual places to find the binary. -+find_binary() { -+ local binpath="/bin /sbin /usr/bin /usr/sbin" p -+ [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } -+ for p in $binpath; do -+ [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# Same as above, but specialized to install binary executables. -+# Install binary executable, and all shared library dependencies, if any. -+inst_binary() { -+ local bin target -+ bin=$(find_binary "$1") || return 1 -+ target=${2:-$bin} -+ inst_symlink $bin $target && return 0 -+ local LDSO NAME IO FILE ADDR I1 n f TLIBDIR -+ [[ -e $initdir$target ]] && return 0 -+ # I love bash! -+ LC_ALL=C ldd $bin 2>/dev/null | while read line; do -+ [[ $line = 'not a dynamic executable' ]] && return 1 -+ if [[ $line =~ not\ found ]]; then -+ derror "Missing a shared library required by $bin." -+ derror "Run \"ldd $bin\" to find out what it is." -+ derror "dracut cannot create an initrd." -+ exit 1 -+ fi -+ so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)' -+ [[ $line =~ $so_regex ]] || continue -+ FILE=${BASH_REMATCH[1]} -+ [[ -e ${initdir}$FILE ]] && continue -+ # see if we are loading an optimized version of a shared lib. -+ lib_regex='^(/lib[^/]*).*' -+ if [[ $FILE =~ $lib_regex ]]; then -+ TLIBDIR=${BASH_REMATCH[1]} -+ BASE=${FILE##*/} -+ # prefer nosegneg libs, then unoptimized ones. -+ for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do -+ [[ -e $f/$BASE ]] || continue -+ FILE=$f/$BASE -+ break -+ done -+ inst_library "$FILE" "$TLIBDIR/$BASE" -+ IF_dynamic=yes -+ continue -+ fi -+ inst_library "$FILE" -+ done -+ inst_simple "$bin" "$target" -+} -+ -+# same as above, except for shell scripts. -+# If your shell script does not start with shebang, it is not a shell script. -+inst_script() { -+ [[ -f $1 ]] || return 1 -+ local line -+ read -r -n 80 line <"$1" -+ # If debug is set, clean unprintable chars to prevent messing up the term -+ [[ $debug ]] && line=$(echo -n "$line" | tr -c -d '[:print:][:space:]') -+ shebang_regex='(#! *)(/[^ ]+).*' -+ [[ $line =~ $shebang_regex ]] || return 1 -+ inst "${BASH_REMATCH[2]}" && inst_simple "$@" -+} -+ -+# same as above, but specialized for symlinks -+inst_symlink() { -+ local src=$1 target=$initdir${2:-$1} realsrc -+ [[ -L $1 ]] || return 1 -+ [[ -L $target ]] && return 0 -+ realsrc=$(readlink -f "$src") -+ [[ $realsrc = ${realsrc##*/} ]] && realsrc=${src%/*}/$realsrc -+ inst "$realsrc" && mkdir -p "${target%/*}" && \ -+ ln -s "$realsrc" "$target" -+} -+ -+# find a udev rule in the usual places. -+find_rule() { -+ [[ -f $1 ]] && { echo "$1"; return 0; } -+ for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do -+ [[ -f $r/$1 ]] && { echo "$r/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# udev rules always get installed in the same place, so -+# create a function to install them to make life simpler. -+inst_rules() { -+ local target=/etc/udev/rules.d rule found -+ -+ inst_dir "/lib/udev/rules.d" -+ inst_dir "$target" -+ for rule in "$@"; do -+ found=$(find_rule "$rule") && \ -+ inst_simple "$found" "$target/${found##*/}" \ -+ || dinfo "Skipping udev rule: $rule" -+ done -+} -+ -+# general purpose installation function -+# Same args as above. -+inst() { -+ case $# in -+ 1) ;; -+ 2) [[ ! $initdir && -d $2 ]] && export initdir=$2 -+ [[ $initdir = $2 ]] && set $1;; -+ 3) [[ -z $initdir ]] && export initdir=$2 -+ set $1 $3;; -+ *) derror "inst only takes 1 or 2 or 3 arguments" -+ exit 1;; -+ esac -+ for x in inst_symlink inst_script inst_binary inst_simple; do -+ $x "$@" && return 0 -+ done -+ return 1 -+} -+ -+# install function specialized for hooks -+# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook -+# All hooks should be POSIX/SuS compliant, they will be sourced by init. -+inst_hook() { -+ if ! [[ -f $3 ]]; then -+ derror "Cannot install a hook ($3) that does not exist." -+ derror "Aborting initrd creation." -+ exit 1 -+ elif ! strstr "$hookdirs" "$1"; then -+ derror "No such hook type $1. Aborting initrd creation." -+ exit 1 -+ fi -+ inst_simple "$3" "/${1}/${2}${3##*/}" -+} -+ -+dracut_install() { -+ if [[ $1 = '-o' ]]; then -+ local optional=yes -+ shift -+ fi -+ while (($# > 0)); do -+ if ! inst "$1" ; then -+ if [[ $optional = yes ]]; then -+ dwarning "Skipping program $1 as it cannot be found and is flagged to be optional" -+ else -+ derror "Failed to install $1" -+ exit 1 -+ fi -+ fi -+ shift -+ done -+} -+ -+# install function decompressing the target and handling symlinks -+# $@ = list of compressed (gz or bz2) files or symlinks pointing to such files -+# -+# Function install targets in the same paths inside overlay but decompressed -+# and without extensions (.gz, .bz2). -+inst_decompress() { -+ local src dst realsrc realdst cmd -+ -+ for src in $@ -+ do -+ case ${src} in -+ *.gz) cmd='gzip -d' ;; -+ *.bz2) cmd='bzip2 -d' ;; -+ *) return 1 ;; -+ esac -+ -+ if [[ -L ${src} ]] -+ then -+ realsrc="$(readlink -f ${src})" # symlink target with extension -+ dst="${src%.*}" # symlink without extension -+ realdst="${realsrc%.*}" # symlink target without extension -+ mksubdirs "${initdir}/${src}" -+ # Create symlink without extension to target without extension. -+ ln -s "${realdst}" "${initdir}/${dst}" -+ fi -+ -+ # If the source is symlink we operate on its target. -+ [[ ${realsrc} ]] && src=${realsrc} -+ inst ${src} -+ # Decompress with chosen tool. We assume that tool changes name e.g. -+ # from 'name.gz' to 'name'. -+ ${cmd} "${initdir}${src}" -+ done -+} -+ -+# It's similar to above, but if file is not compressed, performs standard -+# install. -+# $@ = list of files -+inst_opt_decompress() { -+ local src -+ -+ for src in $@ -+ do -+ inst_decompress "${src}" || inst "${src}" -+ done -+} -+ -+module_check() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we are unconditionally included -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check $hostonly -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func check || return 0 -+ check -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_depends() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we have no deps -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check -d -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func depends || return 0 -+ depends -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_install() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/install ]] && . "$moddir/install" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func install || return 0 -+ install -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_installkernel() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/installkernel ]] && . "$moddir/installkernel" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func installkernel || return 0 -+ installkernel -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+check_module() { -+ local mod=$1; -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ local moddep; -+ # If we are already scheduled to be loaded, no need to check again. -+ strstr " $mods_to_load " " $mod " && return 0 -+ strstr " $mods_checked_as_dep " " $mod " && return 1 -+ -+ # This should never happen, but... -+ [[ -d $moddir ]] || return 1 -+ -+ [[ $2 ]] || mods_checked_as_dep+=" $mod " -+ -+ strstr " $omit_dracutmodules " " $mod " && return 1 -+ -+ if strstr " $dracutmodules $add_dracutmodules " " $mod "; then -+ module_check $mod; ret=$? -+ # explicit module, so also accept ret=255 -+ [[ $ret = 0 || $ret = 255 ]] || return 1 -+ else -+ # module not in our list -+ if [[ $dracutmodules = all ]]; then -+ # check, if we can and should install this module -+ module_check $mod || return 1 -+ else -+ # skip this module -+ return 1 -+ fi -+ fi -+ -+ for moddep in $(module_depends $mod); do -+ # handle deps as if they were manually added -+ strstr " $add_dracutmodules " " $moddep " || \ -+ add_dracutmodules+=" $moddep " -+ # if a module we depend on fail, fail also -+ check_module $moddep || return 1 -+ done -+ -+ strstr " $mods_to_load " " $mod " || \ -+ mods_to_load+=" $mod " -+ -+ return 0 -+} -+ -+check_module_dir() { -+ local modcheck; -+ local mod; -+ mods_to_load="" -+ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do -+ local mod=${moddir##*/}; mod=${mod#[0-9][0-9]} -+ check_module $mod 1 -+ done -+} -+ -+# Install a single kernel module along with any firmware it may require. -+# $1 = full path to kernel module to install -+install_kmod_with_fw() { -+ local modname=${1##*/} fwdir found -+ modname=${modname%.ko*} -+ inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \ -+ return 0 # no need to go further if the module is already installed -+ for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do -+ found='' -+ for fwdir in $fw_dir; do -+ if [[ -d $fwdir && -f $fwdir/$fw ]]; then -+ inst_simple "$fwdir/$fw" "/lib/firmware/$fw" -+ found=yes -+ fi -+ done -+ if [[ $found != yes ]]; then -+ dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\"" -+ fi -+ done -+} -+ -+# Do something with all the dependencies of a kernel module. -+# Note that kernel modules depend on themselves using the technique we use -+# $1 = function to call for each dependency we find -+# It will be passed the full path to the found kernel module -+# $2 = module to get dependencies for -+# rest of args = arguments to modprobe -+for_each_kmod_dep() { -+ local func=$1 kmod=$2 cmd modpapth options -+ shift 2 -+ modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \ -+ while read cmd modpath options; do -+ [[ $cmd = insmod ]] || continue -+ $func $modpath -+ done -+} -+ -+# filter kernel modules to install certain modules that meet specific -+# requirements. -+# $1 = function to call with module name to filter. -+# This function will be passed the full path to the module to test. -+# The behaviour of this function can vary depending on whether $hostonly is set. -+# If it is, we will only look at modules that are already in memory. -+# If it is not, we will look at all kernel modules -+# This function returns the full filenames of modules that match $1 -+filter_kernel_modules () ( -+ if ! [[ $hostonly ]]; then -+ filtercmd='find "$srcmods/kernel/drivers" "$srcmods/extra" "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz" 2>/dev/null' -+ else -+ filtercmd='cut -d " " -f 1 /dev/null' -+ fi -+ for modname in $(eval $filtercmd); do -+ case $modname in -+ *.ko) "$1" "$modname" && echo "$modname";; -+ *.ko.gz) gzip -dc "$modname" > $initdir/$$.ko -+ $1 $initdir/$$.ko && echo "$modname" -+ rm -f $initdir/$$.ko;; -+ esac -+ done -+) -+ -+# install kernel modules along with all their dependencies. -+instmods() { -+ [[ $no_kernel = yes ]] && return -+ local mod mpargs modpath modname cmd moddirname -+ while (($# > 0)); do -+ mod=${1%.ko*} -+ case $mod in -+ =*) -+ # This introduces 2 incompatible meanings for =* arguments -+ # to instmods. We need to decide which one to keep. -+ if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then -+ instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block") -+ elif [ -f $srcmods/modules.${mod#=} ]; then -+ instmods $mpargs $(cat ${srcmods}/modules.${mod#=} ) -+ else -+ instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*") -+ fi -+ ;; -+ --*) -+ mod=${mod##*/} -+ mpargs+=" $mod";; -+ i2o_scsi) shift; continue;; # Do not load this diagnostic-only module -+ *) mod=${mod##*/} -+ # if we are already installed, skip this module and go on -+ # to the next one. -+ [[ -f $initdir/$1 ]] && { shift; continue; } -+ # If we are building a host-specific initramfs and this -+ # module is not already loaded, move on to the next one. -+ [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \ -+ ! echo $add_drivers | grep -qe "\<${mod}\>" && { -+ shift; continue; -+ } -+ -+ # We use '-d' option in modprobe only if modules prefix path -+ # differs from default '/'. This allows us to use Dracut with -+ # old version of modprobe which doesn't have '-d' option. -+ moddirname=${srcmods%%/lib/modules/*} -+ [[ -n ${moddirname} ]] && moddirname="-d ${moddirname}/" -+ -+ # ok, load the module, all its dependencies, and any firmware -+ # it may require -+ for_each_kmod_dep install_kmod_with_fw $mod \ -+ --set-version $kernel ${moddirname} -+ ;; -+ esac -+ shift -+ done -+} -diff --git gen_cmdline.sh gen_cmdline.sh -index b3e451d..bc9f2dc 100755 ---- gen_cmdline.sh -+++ gen_cmdline.sh -@@ -22,6 +22,7 @@ longusage() { - echo " --logfile= Output file for debug info" - echo " --color Output debug in color" - echo " --no-color Do not output debug in color" -+ echo " --no-cleartmp Do not clear temp directory" - echo " Kernel Configuration settings" - echo " --menuconfig Run menuconfig after oldconfig" - echo " --no-menuconfig Do not run menuconfig after oldconfig" -@@ -78,6 +79,8 @@ longusage() { - echo " --splash-res= Select splash theme resolutions to install" - echo " --do-keymap-auto Forces keymap selection at boot" - echo " --no-keymap Disables keymap selection support" -+ echo " --udev Include udev in the initramfs" -+ echo " --no-udev Exclude udev from the initramfs" - echo " --lvm Include LVM support" - echo " --mdadm Include MDADM/MDMON support" - echo " --mdadm-config= Use file as mdadm.conf in initramfs" -@@ -97,6 +100,8 @@ longusage() { - echo " --unionfs Include support for unionfs" - echo " --netboot Create a self-contained env in the initramfs" - echo " --real-root= Specify a default for real_root=" -+ echo " --lscpi Include lspci into the initramfs" -+ echo " --no-lscpi Exclude lspci from the initramfs" - echo " Internals" - echo " --arch-override= Force to arch instead of autodetect" - echo " --cachedir= Override the default cache location" -@@ -232,6 +237,22 @@ parse_cmdline() { - CMD_KEYMAP=0 - print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" - ;; -+ --udev) -+ CMD_UDEV=1 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --no-udev) -+ CMD_UDEV=0 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --lspci) -+ CMD_LSPCI=1 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --no-lspci) -+ CMD_UDEV=0 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; - --lvm) - CMD_LVM=1 - print_info 2 "CMD_LVM: ${CMD_LVM}" -@@ -441,6 +462,10 @@ parse_cmdline() { - print_info 2 "USECOLOR: ${USECOLOR}" - setColorVars - ;; -+ --no-cleartmp) -+ NOCLEARTMP=1 -+ print_info 2 "NOCLEARTMP: ${NOCLEARTMP}" -+ ;; - --logfile=*) - CMD_LOGFILE=`parse_opt "$*"` - LOGFILE=`parse_opt "$*"` -diff --git gen_compile.sh gen_compile.sh -index 0758c3a..8a2339a 100755 ---- gen_compile.sh -+++ gen_compile.sh -@@ -407,7 +407,10 @@ compile_busybox() { - yes '' 2>/dev/null | compile_generic oldconfig utils - - print_info 1 'busybox: >> Compiling...' -+ OLDLOGLEVEL=$LOGLEVEL -+ LOGLEVEL=1 - compile_generic all utils -+ LOGLEVEL=$OLDLOGLEVEL - print_info 1 'busybox: >> Copying to cache...' - [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] || - gen_die 'Busybox executable does not exist!' -diff --git gen_determineargs.sh gen_determineargs.sh -index ce479cb..bda14b8 100755 ---- gen_determineargs.sh -+++ gen_determineargs.sh -@@ -107,6 +107,8 @@ determine_real_args() { - set_config_with_override BOOL SYMLINK CMD_SYMLINK - set_config_with_override STRING INSTALL_MOD_PATH CMD_INSTALL_MOD_PATH - set_config_with_override BOOL OLDCONFIG CMD_OLDCONFIG -+ set_config_with_override BOOL UDEV CMD_UDEV -+ set_config_with_override BOOL LSPCI CMD_LSPCI - set_config_with_override BOOL LVM CMD_LVM - set_config_with_override BOOL DMRAID CMD_DMRAID - set_config_with_override BOOL ISCSI CMD_ISCSI -diff --git gen_initramfs.sh gen_initramfs.sh -index 7fe4421..76b6645 100755 ---- gen_initramfs.sh -+++ gen_initramfs.sh -@@ -56,7 +56,13 @@ append_busybox() { - chmod +x "${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/default.script" - - # Set up a few default symlinks -- for i in ${BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}; do -+ if isTrue "${UDEV}" -+ then -+ BUSYBOX_APPLETS="${BUSYBOX_APPLETS:-[ ash sh uname echo cut cat}" -+ else -+ BUSYBOX_APPLETS="{$BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}" -+ fi -+ for i in ${BUSYBOX_APPLETS}; do - rm -f ${TEMP}/initramfs-busybox-temp/bin/$i > /dev/null - ln -s busybox ${TEMP}/initramfs-busybox-temp/bin/$i || - gen_die "Busybox error: could not link ${i}!" -@@ -410,7 +416,7 @@ append_firmware() { - IFS="," - for i in ${FIRMWARE_FILES} - do -- cp -L "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ -+ cp -rL "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ - done - IFS=$OLD_IFS - else -@@ -438,9 +444,71 @@ append_gpg() { - chmod a+x "${TEMP}/initramfs-gpg-temp/sbin/gpg" - cd "${TEMP}/initramfs-gpg-temp/" - find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" - rm -rf "${TEMP}/initramfs-gpg-temp" > /dev/null - } - -+append_udev() { -+ if [ -d "${TEMP}/initramfs-udev-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-udev-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-udev-temp/" -+ udevmod="${GK_SHARE}/modules/udev-rules/" -+ source ${udevmod}/module-setup.sh -+ initdir=${TEMP}/initramfs-udev-temp \ -+ moddir=${udevmod} \ -+ libdir=/lib/ \ -+ usrlibdir=/usr/lib/ \ -+ install_module -+ -+ if isTrue $LSPCI -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ fi -+ # find net modules and sound -+ (for pathname in ${INSTALL_MOD_PATH}/lib/modules/${KV}/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/drivers/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/sound -+ do -+ [[ -d $pathname ]] && find $pathname -name "*.ko" -+ done | -+ while read module;do -+ # add them prefix blacklist -+ echo "blacklist `basename $module .ko`"; -+ # concat with ready blacklist.conf -+ done;cat "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf") | -+ # sort and rewrite blacklist.conf -+ sort | uniq > "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" -+ mv "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" \ -+ "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf" -+ -+ cd "${TEMP}/initramfs-udev-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-udev-temp" > /dev/null -+} -+ -+append_lspci() { -+ if [ -d "${TEMP}/initramfs-lspci-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-lspci-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-lspci-temp/" -+ -+ initdir=${TEMP}/initramfs-lspci-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ -+ cd "${TEMP}/initramfs-lspci-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-lspci-temp" > /dev/null -+} -+ - print_list() - { - local x -@@ -489,6 +557,11 @@ append_modules() { - print_list ${!group_modules} > "${TEMP}/initramfs-modules-${KV}-temp/etc/modules/${group}" - done - cd "${TEMP}/initramfs-modules-${KV}-temp/" -+ # remove sound and media -+ for x in `find . -type d -name media -o -type d -name sound` -+ do -+ rm -r "${x}" &>/dev/null -+ done - find . | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ - || gen_die "compressing modules cpio" - cd "${TEMP}" -@@ -561,11 +634,14 @@ append_auxilary() { - done - echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" - -- if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ if ! isTrue "${UDEV}" - then -- cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -- else -- cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ then -+ cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ else -+ cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ fi - fi - if isTrue $CMD_DOKEYMAPAUTO - then -@@ -582,7 +658,7 @@ append_auxilary() { - chmod +x "${TEMP}/initramfs-aux-temp/init" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" -- chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ isTrue "${UDEV}" || chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" - - if isTrue ${NETBOOT} - then -@@ -609,6 +685,21 @@ append_data() { - fi - } - -+pack_cpio() { -+ print_info 1 " >> Pack cpio data..." -+ if [ -d "${TEMP}/initramfs-repack-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-repack-temp" -+ fi -+ mkdir -p "${TEMP}/initramfs-repack-temp" -+ cd "${TEMP}/initramfs-repack-temp" -+ # unpack and pack cpio remove double files -+ cpio -di <${CPIO} 2>/dev/null -+ find . -print | cpio ${CPIO_ARGS} | gzip -9 >"${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-repack-temp" > /dev/null -+} -+ - create_initramfs() { - print_info 1 "initramfs: >> Initializing..." - -@@ -619,6 +710,11 @@ create_initramfs() { - - append_data 'base_layout' - append_data 'auxilary' "${BUSYBOX}" -+ append_data 'udev' "${UDEV}" -+ if ! isTrue "${UDEV}" -+ then -+ append_data 'lspci' "${LSPCI}" -+ fi - append_data 'busybox' "${BUSYBOX}" - append_data 'lvm' "${LVM}" - append_data 'dmraid' "${DMRAID}" -@@ -652,8 +748,7 @@ create_initramfs() { - append_data 'overlay' - fi - -- gzip -9 "${CPIO}" -- mv -f "${CPIO}.gz" "${CPIO}" -+ pack_cpio - - if isTrue "${INTEGRATED_INITRAMFS}" - then -diff --git genkernel genkernel -index 0a06cdd..1486c61 100755 ---- genkernel -+++ genkernel -@@ -9,6 +9,7 @@ GK_V='3.4.18' - TMPDIR='/var/tmp/genkernel' - - TODEBUGCACHE=1 # Until an error occurs or LOGFILE is fully qualified. -+NOCLEARTMP=0 - - small_die() { - echo $1 -@@ -45,6 +46,7 @@ source ${GK_SHARE}/gen_initramfs.sh || gen_die "Could not read ${GK_SHARE}/gen_i - source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_moddeps.sh" - source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh" - source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh" -+source ${GK_SHARE}/dracut_funcs.sh || gen_die "Could not read ${GK_SHARE}/dracut_funcs.sh" - - TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ - -@@ -55,21 +57,25 @@ trap_cleanup(){ - } - - cleanup(){ -- if [ -n "$TEMP" -a -d "$TEMP" ]; then -- rm -rf "$TEMP" -- fi -- -- if isTrue ${POSTCLEAR} -- then -- echo -- print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -- print_info 1 "CACHE_DIR: ${CACHE_DIR}" -- CLEAR_CACHE_DIR='yes' -- setup_cache_dir -- echo -- print_info 1 "TMPDIR: ${TMPDIR}" -- clear_tmpdir -- fi -+ if [[ ${NOCLEARTMP} -ne 0 ]] -+ then -+ return -+ fi -+ if [ -n "$TEMP" -a -d "$TEMP" ]; then -+ rm -rf "$TEMP" &>/dev/null -+ fi -+ -+ if isTrue ${POSTCLEAR} -+ then -+ echo -+ print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -+ print_info 1 "CACHE_DIR: ${CACHE_DIR}" -+ CLEAR_CACHE_DIR='yes' -+ setup_cache_dir -+ echo -+ print_info 1 "TMPDIR: ${TMPDIR}" -+ clear_tmpdir -+ fi - } - - trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL -diff --git genkernel.conf genkernel.conf -index 24fcd54..41f8e06 100644 ---- genkernel.conf -+++ genkernel.conf -@@ -52,6 +52,12 @@ USECOLOR="yes" - # argument is: *+1 - # MAKEOPTS="-j2" - -+# Add udev to initramfs -+UDEV="yes" -+ -+# Add lspci to initramfs -+LSPCI="yes" -+ - # Add in LVM support from static binaries if they exist on the system, or - # compile static LVM binaries if static ones do not exist. - # LVM="no" -@@ -92,7 +98,7 @@ USECOLOR="yes" - # Specify directory to pull from - # FIRMWARE_DIR="/lib/firmware" - # Specify specific firmware files to include. This overrides FIRMWARE_DIR --# FIRMWARE_FILES="" -+FIRMWARE_FILES="/lib/firmware/radeon" - - # Enable disklabel support (copies blkid to initrd) - DISKLABEL="yes" -diff --git modules/udev-rules/01-ignore.rules modules/udev-rules/01-ignore.rules -new file mode 100644 -index 0000000..b32f22e ---- /dev/null -+++ modules/udev-rules/01-ignore.rules -@@ -0,0 +1 @@ -+KERNEL=="ram[0-9]*", OPTIONS+="ignore_device", OPTIONS+="last_rule" -diff --git modules/udev-rules/59-persistent-storage-volid.rules modules/udev-rules/59-persistent-storage-volid.rules -new file mode 100644 -index 0000000..0b798e6 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage-volid.rules -@@ -0,0 +1,7 @@ -+SUBSYSTEM!="block", GOTO="psv_end" -+ACTION!="add|change", GOTO="psv_end" -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="cciss[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", IMPORT{program}="vol_id --export $tempnode" -+LABEL="psv_end" -diff --git modules/udev-rules/59-persistent-storage.rules modules/udev-rules/59-persistent-storage.rules -new file mode 100644 -index 0000000..2b83e72 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage.rules -@@ -0,0 +1,38 @@ -+SUBSYSTEM!="block", GOTO="ps_end" -+ACTION!="add|change", GOTO="ps_end" -+ -+KERNEL=="cciss[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end" -+ -+# partitions have no md/{array_state,metadata_version} -+ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" -+ -+# container devices have a metadata version of e.g. 'external:ddf' and -+# never leave state 'inactive' -+ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -+TEST!="md/array_state", GOTO="md_end" -+ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -+ -+LABEL="md_ignore_state" -+ -+IMPORT{program}="/sbin/mdadm --detail --export $tempnode" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+OPTIONS+="link_priority=100" -+OPTIONS+="watch" -+LABEL="md_end" -+ -+ -+KERNEL!="dm-[0-9]*", GOTO="ps_end" -+ACTION=="add", GOTO="ps_end" -+IMPORT{program}="/sbin/dmsetup info -c --nameprefixes --unquoted --rows --noheadings -o name,uuid,suspended,readonly,major,minor,open,tables_loaded,names_using_dev -j%M -m%m" -+ENV{DM_NAME}!="?*", GOTO="ps_end" -+ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="ps_end" -+ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="ps_end" -+ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="ps_end" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+LABEL="ps_end" -diff --git modules/udev-rules/61-persistent-storage.rules modules/udev-rules/61-persistent-storage.rules -new file mode 100644 -index 0000000..9cfdb0b ---- /dev/null -+++ modules/udev-rules/61-persistent-storage.rules -@@ -0,0 +1,20 @@ -+SUBSYSTEM!="block", GOTO="pss_end" -+ACTION!="add|change", GOTO="pss_end" -+ -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss" -+KERNEL=="cciss[0-9]*", GOTO="do_pss" -+KERNEL=="nbd[0-9]*", GOTO="do_pss" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", GOTO="do_pss" -+ -+GOTO="pss_end" -+ -+LABEL="do_pss" -+# by-path (parent device path) -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{program}="path_id %p" -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" -+ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" -+ -+# by-label/by-uuid links (filesystem metadata) -+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -+LABEL="pss_end" -diff --git modules/udev-rules/blacklist.conf modules/udev-rules/blacklist.conf -new file mode 100644 -index 0000000..21ac71c ---- /dev/null -+++ modules/udev-rules/blacklist.conf -@@ -0,0 +1,162 @@ -+blacklist ath_pci -+blacklist evbug -+blacklist usbmouse -+blacklist usbkbd -+blacklist eepro100 -+blacklist de4x5 -+blacklist eth1394 -+blacklist snd_intel8x0m -+blacklist snd_aw2 -+blacklist i2c_i801 -+blacklist prism54 -+blacklist bcm43xx -+blacklist garmin_gps -+blacklist asus_acpi -+blacklist snd_pcsp -+blacklist pcspkr -+blacklist amd76x_edac -+blacklist ohci1394 -+blacklist sbp2 -+blacklist dv1394 -+blacklist raw1394 -+blacklist video1394 -+blacklist aty128fb -+blacklist atyfb -+blacklist radeonfb -+blacklist cirrusfb -+blacklist cyber2000fb -+blacklist cyblafb -+blacklist gx1fb -+blacklist hgafb -+blacklist i810fb -+blacklist intelfb -+blacklist kyrofb -+blacklist lxfb -+blacklist matroxfb_base -+blacklist neofb -+blacklist nvidiafb -+blacklist pm2fb -+blacklist rivafb -+blacklist s1d13xxxfb -+blacklist savagefb -+blacklist sisfb -+blacklist sstfb -+blacklist tdfxfb -+blacklist tridentfb -+blacklist vesafb -+blacklist vfb -+blacklist viafb -+blacklist vt8623fb -+blacklist ac97 -+blacklist ac97_codec -+blacklist ac97_plugin_ad1980 -+blacklist ad1848 -+blacklist ad1889 -+blacklist adlib_card -+blacklist aedsp16 -+blacklist ali5455 -+blacklist btaudio -+blacklist cmpci -+blacklist cs4232 -+blacklist cs4281 -+blacklist cs461x -+blacklist cs46xx -+blacklist emu10k1 -+blacklist es1370 -+blacklist es1371 -+blacklist esssolo1 -+blacklist forte -+blacklist gus -+blacklist i810_audio -+blacklist kahlua -+blacklist mad16 -+blacklist maestro -+blacklist maestro3 -+blacklist maui -+blacklist mpu401 -+blacklist nm256_audio -+blacklist opl3 -+blacklist opl3sa -+blacklist opl3sa2 -+blacklist pas2 -+blacklist pss -+blacklist rme96xx -+blacklist sb -+blacklist sb_lib -+blacklist sgalaxy -+blacklist sonicvibes -+blacklist sound -+blacklist sscape -+blacklist trident -+blacklist trix -+blacklist uart401 -+blacklist uart6850 -+blacklist via82cxxx_audio -+blacklist v_midi -+blacklist wavefront -+blacklist ymfpci -+blacklist ac97_plugin_wm97xx -+blacklist ad1816 -+blacklist audio -+blacklist awe_wave -+blacklist dmasound_core -+blacklist dmasound_pmac -+blacklist harmony -+blacklist sequencer -+blacklist soundcard -+blacklist usb-midi -+blacklist acquirewdt -+blacklist advantechwdt -+blacklist alim1535_wdt -+blacklist alim7101_wdt -+blacklist booke_wdt -+blacklist cpu5wdt -+blacklist eurotechwdt -+blacklist i6300esb -+blacklist i8xx_tco -+blacklist ib700wdt -+blacklist ibmasr -+blacklist indydog -+blacklist iTCO_wdt -+blacklist it8712f_wdt -+blacklist it87_wdt -+blacklist ixp2000_wdt -+blacklist ixp4xx_wdt -+blacklist machzwd -+blacklist mixcomwd -+blacklist mpc8xx_wdt -+blacklist mpcore_wdt -+blacklist mv64x60_wdt -+blacklist pc87413_wdt -+blacklist pcwd -+blacklist pcwd_pci -+blacklist pcwd_usb -+blacklist s3c2410_wdt -+blacklist sa1100_wdt -+blacklist sbc60xxwdt -+blacklist sbc7240_wdt -+blacklist sb8360 -+blacklist sc1200wdt -+blacklist sc520_wdt -+blacklist sch311_wdt -+blacklist scx200_wdt -+blacklist shwdt -+blacklist smsc37b787_wdt -+blacklist softdog -+blacklist twl4030_wdt -+blacklist w83627hf_wdt -+blacklist w83697hf_wdt -+blacklist w83697ug_wdt -+blacklist w83877f_wdt -+blacklist w83977f_wdt -+blacklist wafer5823wdt -+blacklist wdt -+blacklist wdt_pci -+blacklist wm8350_wdt -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -diff --git modules/udev-rules/load-modules.sh modules/udev-rules/load-modules.sh -new file mode 100755 -index 0000000..36972fd ---- /dev/null -+++ modules/udev-rules/load-modules.sh -@@ -0,0 +1,7 @@ -+#!/bin/sh -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+# Implement blacklisting for udev-loaded modules -+ -+modprobe -b "$@" -diff --git modules/udev-rules/module-setup.sh modules/udev-rules/module-setup.sh -new file mode 100755 -index 0000000..1005627 ---- /dev/null -+++ modules/udev-rules/module-setup.sh -@@ -0,0 +1,57 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+install_module() { -+ # FIXME: would be nice if we didn't have to know which rules to grab.... -+ # ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies -+ # of the rules we want so that we just copy those in would be best -+ dracut_install udevd udevadm /etc/udev/udev.conf /etc/group /bin/mount /sbin/modprobe -+ inst_rules 50-udev-default.rules 60-persistent-storage.rules \ -+ 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \ -+ 60-pcmcia.rules -+ mkdir -p "$initdir"/etc/modprobe.d -+ inst_simple "$moddir/blacklist.conf" /etc/modprobe.d/ -+ -+ # ignore some devices in the initrd -+ inst_rules "$moddir/01-ignore.rules" -+ -+ # for firmware loading -+ inst_rules 50-firmware.rules -+ -+ if [ ! -x /lib/udev/vol_id ]; then -+ inst_rules "$moddir/59-persistent-storage.rules" -+ else -+ inst_rules "$moddir/59-persistent-storage-volid.rules" -+ fi -+ inst_rules "$moddir/61-persistent-storage.rules" -+ -+ for i in \ -+ ata_id \ -+ cdrom_id \ -+ create_floppy_devices \ -+ edd_id \ -+ firmware.sh \ -+ firmware \ -+ firmware.agent \ -+ hotplug.functions \ -+ fw_unit_symlinks.sh \ -+ hid2hci \ -+ path_id \ -+ scsi_id \ -+ usb_id \ -+ vol_id \ -+ pcmcia-socket-startup \ -+ pcmcia-check-broken-cis \ -+ ; do -+ for utilpath in /lib/udev /sbin /bin -+ do -+ [ -e $utilpath/$i ] && dracut_install $utilpath/$i -+ done -+ done -+ -+ for i in {"$libdir","$usrlibdir"}/libnss_files*; do -+ [ -e "$i" ] && dracut_install "$i" -+ done -+} -+ diff --git a/sys-kernel/calckernel/files/calckernel-3.4.18-r4.patch b/sys-kernel/calckernel/files/calckernel-3.4.18-r4.patch deleted file mode 100644 index 4088199df..000000000 --- a/sys-kernel/calckernel/files/calckernel-3.4.18-r4.patch +++ /dev/null @@ -1,2106 +0,0 @@ -diff --git defaults/initrd.defaults defaults/initrd.defaults -index 76d72a7..0c059a5 100755 ---- defaults/initrd.defaults -+++ defaults/initrd.defaults -@@ -68,6 +68,7 @@ fi - - REAL_ROOT='' - CDROOT='0' -+SCRATCH='0' - CDROOT_DEV='' - CDROOT_TYPE='auto' - NEW_ROOT='/newroot' -diff --git defaults/initrd.scripts defaults/initrd.scripts -index 51ebcce..88d4f1e 100755 ---- defaults/initrd.scripts -+++ defaults/initrd.scripts -@@ -187,23 +187,45 @@ cache_cd_contents() { - # TODO: Check the size of the image versus the size of our tmpfs - # along with the amount of available RAM and increase tmpfs size - # if necessary. (Not having awk sucks...) -- # z=0 -- # for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -- # cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; do -- # z=$(($z + $i)) ; done -- # echo $z -- good_msg "Copying loop file for caching..." -- # Verify that the needed directory exists -- mkdir -p "$(dirname ${NEW_ROOT}/mnt/${LOOP})" -- cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/${LOOP} -- if [ $? -ne 0 ] -+ -+ # getting memory -+ allmemory=0 -+ for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -+ cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; -+ do -+ allmemory=$(($allmemory + $i)) -+ done -+ -+ # getting size tmpfs of default -+ let curtfs=$allmemory/2 -+ -+ # getting size of image -+ let imagesize=`ls -la ${NEW_ROOT}/mnt/cdrom/${LOOP} | sed -r -n 's/(\S*\s*){4}(\S*).*/\2/p'`/20000*21 -+ let addon=$imagesize/10 -+ if [[ $curtfs -gt $(( ${imagesize} + ${addon} )) ]]; - then -- bad_msg "Failed to cache the loop file! Lack of space?" -- rm -rf ${NEW_ROOT}/mnt/livecd.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/image.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/zisofs 2>/dev/null -+ let addon=$(( $curtfs - ${imagesize} )) -+ fi -+ -+ if [[ $((${imagesize} + $addon)) -lt ${allmemory} ]]; -+ then -+ mount -o remount,size=${addon}000 -t tmpfs tmpfs ${NEW_ROOT} -+ mkdir ${NEW_ROOT}/mnt/squash -+ mount -o size=${imagesize}000 -t tmpfs tmpfs ${NEW_ROOT}/mnt/squash -+ good_msg "Copying loop file for caching..." -+ cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/squash/${LOOP} -+ if [ $? -ne 0 ] -+ then -+ bad_msg "Failed to cache the loop file! Lack of space?" -+ umount ${NEW_ROOT}/mnt/squash -+ mount -o remount,size=${curtfs}000 -t tmpfs tmpfs ${NEW_ROOT} -+ else -+ LOOPEXT='../squash/' -+ good_msg "Unmounting media from ${NEW_ROOT}/mnt/cdrom" -+ umount ${NEW_ROOT}/mnt/cdrom -+ fi - else -- LOOPEXT='../' -+ bad_msg "Too low memory for cache the loop file." - fi - fi - fi -@@ -266,7 +288,7 @@ findnfsmount() { - if [ "${CDROOT}" != '0' ] - then - good_msg "Attempting to mount NFS CD image on ${NFSROOT} with options ${NFSOPTIONS}" -- mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT}/mnt/cdrom -+ busybox mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT}/mnt/cdrom - if [ "$?" = '0' ] - then - REAL_ROOT="/dev/nfs" -@@ -275,7 +297,7 @@ findnfsmount() { - fi - else - good_msg "Attempting to mount NFS root on ${NFSROOT} with options ${NFSOPTIONS}" -- mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT} -+ busybox mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT} - if [ "$?" = '0' ] - then - REAL_ROOT="/dev/nfs" -@@ -655,7 +677,7 @@ startVolumes() { - [ -d /etc/lvm/cache ] && lvm_commands="${lvm_commands} \nvgscan" - - # To activate volumegroups on all devices in the cache -- lvm_commands="${lvm_commands} \nvgchange -ay --sysinit" -+ lvm_commands="${lvm_commands} \nvgchange -ay --sysinit --noudevsync" - - # And finally execute it all (/proc/... needed if lvm is compiled without readline) - good_msg "Scanning for and activating Volume Groups" -@@ -1082,6 +1104,38 @@ getdvhoff() { - echo $(( $(hexdump -n 4 -s $((316 + 12 * $2)) -e '"%i"' $1) * 512)) - } - -+load_union_module() { -+ UNIONTYPE="" -+ # find module for union file system -+ [ -n "$(find /lib/ -name unionfs.ko)" ] && UNIONTYPE="unionfs" -+ [ -n "$(find /lib/ -name aufs.ko)" ] && UNIONTYPE="aufs" -+ # probably aufs in kernel -+ if [ -n "$(gzip -dc /proc/config.gz | grep CONFIG_AUFS_FS=y )" ] -+ then -+ UNIONTYPE="aufs" -+ else -+ if [ -z "${UNIONTYPE}" ] -+ then -+ bad_msg "Module for union file system is not found!" -+ run_shell -+ else -+ modprobe ${UNIONTYPE} > /dev/null 2>&1 -+ # error on load union module -+ if [ -z "$(lsmod | grep $UNIONTYPE)" ] -+ then -+ bad_msg "Module for union file system is not correct!" -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ bad_msg "Probably kernel compiled without standalone patch." -+ fi -+ run_shell -+ fi -+ -+ good_msg "Loading ${UNIONTYPE}" -+ fi -+ fi -+} -+ - setup_unionfs() { - local rw_dir=$1 - local ro_dir=$2 -@@ -1101,6 +1155,7 @@ setup_unionfs() { - mkdir -p ${UNION} - good_msg "Loading fuse module" - modprobe fuse > /dev/null 2>&1 -+ load_union_module - # if [ -n "${UNIONFS}" ] - # then - # CHANGESDEV=${UNIONFS} -@@ -1130,11 +1185,102 @@ setup_unionfs() { - mkdir /tmp - mkdir -p ${UNION} - # mkdir -p $CHANGES --# mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+## mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+ -+ if [ "${SCRATCH}" -ne 0 ]; -+ then -+ good_msg "Loading in scratch mode" -+ BUILDERDIR=${UNION}/mnt/builder -+ SCRATCHDIR=${UNION}/mnt/scratch -+ DELTADIR=${rw_dir}/mnt/delta -+ WORKSPACEDIR=${rw_dir}/mnt/workspace -+ mount -o remount,rw ${rw_dir}/mnt/cdrom >/dev/null 2>&1 -+ touch ${rw_dir}/mnt/cdrom/livecd >/dev/null 2>&1 -+ if [ "$?" -ne 0 ]; -+ then -+ ISRW=0 -+ else -+ ISRW=1 -+ fi -+ -+ mkdir -p ${DELTADIR} -+ mkdir -p ${WORKSPACEDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${WORKSPACEDIR}=rw:${DELTADIR}=ro+wh:${rw_dir}/mnt/livecd=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${WORKSPACEDIR}=rw:${DELTADIR}=ro:${rw_dir}/mnt/livecd=ro unionfs ${UNION} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${SCRATCHDIR}/calculate -+ mkdir -p ${SCRATCHDIR}/delta -+ mkdir -p ${SCRATCHDIR}/workspace -+ mount -o bind ${rw_dir}/mnt/delta ${SCRATCHDIR}/delta -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind ${rw_dir}/mnt/workspace ${SCRATCHDIR}/workspace -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${BUILDERDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro none ${BUILDERDIR} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro unionfs ${BUILDERDIR} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind,ro ${rw_dir}/mnt/livecd ${SCRATCHDIR}/calculate -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ if [ "$ISRW" -ne 0 ]; -+ then -+ FLASHDIR=${UNION}/mnt/flash -+ mkdir -p ${FLASHDIR} -+ mount -o bind ${rw_dir}/mnt/cdrom ${FLASHDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ mkdir -p ${CDROMDIR} -+ mount -o bind,ro ${rw_dir}/mnt/cdrom ${CDROMDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ fi -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ LIVECDDIR=${UNION}/mnt/livecd -+ -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${rw_dir}:${ro_dir}=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${rw_dir}:${ro_dir}=ro unionfs ${UNION} -+ fi -+ -+ if [[ -n "$( echo ${LOOPEXT} | grep squash )" ]]; -+ then -+ mkdir -p ${UNION}/mnt/squash -+ mount -o bind ${NEW_ROOT}/mnt/squash ${UNION}/mnt/squash &>/dev/null -+ fi -+ -+ chmod 0755 ${UNION} -+ mount -o bind ${rw_dir}/mnt/cdrom ${CDROMDIR} &>/dev/null -+ mount -o bind ${rw_dir}/mnt/livecd ${LIVECDDIR} &>/dev/null -+ ret=$? -+ fi -+ -+ chmod 1777 ${UNION}/tmp - good_msg "Creating union mount" -- unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -- ret=$? -- if [ ${ret} -ne 0 ] -+# unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -+# ret=$? -+ if [ "${ret}" -ne 0 ] - then - bad_msg "Can't setup union mount!" - USE_UNIONFS_NORMAL=0 -@@ -1143,3 +1289,111 @@ setup_unionfs() { - USE_UNIONFS_NORMAL=0 - fi - } -+ -+load_videodrv() { -+ good_msg "Loading frame buffer video driver" -+ # find all available fb drivers -+ videodrv_count=$(find /lib/modules \ -+ -name "nouveau.ko" -o \ -+ -name "uvesafb.ko" -o \ -+ -name "i915.ko" -o \ -+ -name "radeon.ko" | -+ grep -c "") -+ # load specified videodrv -+ modules_list= -+ case "${VIDEODRV}" in -+ nouveau) -+ modules_list="nouveau" -+ ;; -+ radeon) -+ modules_list="radeon" -+ ;; -+ i915|intel) -+ modules_list="i915" -+ ;; -+ ""|auto) -+ # if not livecd and initramfs otimized (aviailable only one video driver) -+ if [ "${CDROOT}" != '1' -a "${videodrv_count}" -le 2 ] -+ then -+ modules_list="nouveau i915 radeon" -+ else -+ if [[ -x /usr/sbin/lspci ]] -+ then -+ if lspci | grep -m1 VGA | grep -qi intel -+ then -+ modules_list="i915" -+ elif lspci | grep -m1 VGA | grep -qi nvidia -+ then -+ modules_list="nouveau" -+ elif lspci | grep -m1 VGA | grep -q -e "Ati" -e "ATI" -+ then -+ modules_list="radeon" -+ else -+ modules_list="" -+ fi -+ else -+ modules_list="i915" -+ fi -+ fi -+ ;; -+ esac -+ for x in $modules_list -+ do -+ if [ "`find /lib/modules -name "${x}.ko" | grep -c ''`" -eq "1" ] -+ then -+ modprobe "${x}" modeset=${USE_MODESET} &>/dev/null -+ lsmod | grep -q "^${x}" && \ -+ [ "`cat /sys/module/${x}/refcnt`" -gt 0 ] && return 0 -+ fi -+ done -+ # else load uvesafb with specified video resolution -+ if [ -n "${VIDEORES}" ] -+ then -+ if ! echo $VIDEORES | grep -q "\-" -+ then -+ VIDEORES="${VIDEORES}-32" -+ fi -+ else -+ VIDEORES="1024x768-32" -+ fi -+ modprobe uvesafb mode_option=${VIDEORES} &>/dev/null -+} -+ -+start_udev() -+{ -+ # start udev -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ echo "" >/proc/sys/kernel/hotplug -+ udevd --daemon &>/dev/null -+ udevadm settle -+ fi -+} -+ -+stop_udev() -+{ -+ # kill udevd -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ pkill udevd &>/dev/null -+ fi -+} -+ -+populate_dev() -+{ -+ good_msg 'Activating udev' -+ # Do not run any init-scripts -+ udevadm control --property=do_not_run_plug_service=1 -+ -+ if [ "${REAL_ROOT}" == "/dev/nfs" ] -+ then -+ rm /etc/modprobe.d/blacklist.conf -+ fi -+ # discarding net drivers placed into blacklist.conf -+ udevadm trigger --action="add" -+ -+ # we can speed up booting under these conditions: -+ # * using devtmpfs so kernel creates device nodes for us -+ # * only using kernel created device nodes at boot (in /etc/fstab and elsewhere) -+ udevadm settle --timeout=60 -+} -diff --git defaults/linuxrc defaults/linuxrc -index 0843f5d..8109d09 100755 ---- defaults/linuxrc -+++ defaults/linuxrc -@@ -39,6 +39,13 @@ FAKE_ROOT='' - REAL_ROOTFLAGS='' - ROOTFSTYPE='auto' - CRYPT_SILENT=0 -+VIDEODRV='' -+USE_UDEV=1 -+USE_MODESET=1 -+if [ -e "/etc/calculate/calculate.ini" ] -+then -+ source /etc/calculate/calculate.ini -+fi - for x in ${CMDLINE} - do - case "${x}" in -@@ -57,6 +64,57 @@ do - init_opts\=*) - INIT_OPTS=`parse_opt "${x}"` - ;; -+ nokms) -+ USE_MODESET=0 -+ ;; -+ kms) -+ USE_MODESET=1 -+ ;; -+ noudev) -+ USE_UDEV=0 -+ ;; -+ calculate\=*) -+ CALCULATE=`parse_opt "${x}"` -+ if [[ "${CALCULATE//:/}" != "${CALCULATE}" ]] -+ then -+ for i in ${CALCULATE//,/ } -+ do -+ case "${i}" in -+ video:*) -+ VIDEODRV=`echo "${i}" | cut -s -d: -f2-` -+ ;; -+ resolution:*) -+ RES=`echo "${i}" | cut -s -d: -f2-` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ ;; -+ esac -+ done -+ else -+ RES=`echo "${CALCULATE}" | cut -s -d, -f4` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ VIDEODRV=`echo "${CALCULATE}" | cut -s -d, -f5` -+ fi -+ ;; -+ video\=*) -+ VR=`parse_opt "${x}"` -+ for i in ${VR//,/ } -+ do -+ if [ -z "${i//[0-9-x@]}" ] -+ then -+ VIDEORES=${i} -+ fi -+ done -+ ;; -+ # Scratch usbload -+ scratch) -+ SCRATCH=1 -+ ;; - # Livecd options - cdroot) - CDROOT=1 -@@ -251,15 +309,24 @@ then - REAL_ROOT="${FAKE_ROOT}" - fi - --splash 'init' -- --cmdline_hwopts -+# check udevd -+[ ! -x /sbin/udevd ] && USE_UDEV=0 - - # Mount sysfs - mount_sysfs - -+# start udev -+start_udev -+ -+# load kernel video driver -+load_videodrv -+ -+splash 'init' -+ -+cmdline_hwopts -+ - # Setup hotplugging for firmware loading --setup_hotplug -+[ "${USE_UDEV}" == "0" ] && setup_hotplug - - # Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel - if [ -z "${DO_modules}" ] -@@ -269,7 +336,7 @@ elif [ -d "/lib/modules/${KV}" ] - then - good_msg 'Loading modules' - # Load appropriate kernel modules -- if [ "${NODETECT}" != '1' ] -+ if [ "${USE_UDEV}" != '1' -a "${NODETECT}" != '1' ] - then - for modules in ${MY_HWOPTS} - do -@@ -285,14 +352,20 @@ fi - # Apply scan delay if specified - sdelay - --# Setup slow USB bits --setup_slowusb -+if [ "${USE_UDEV}" == "1" ] -+then -+ # populate /dev with devices already found by the kernel -+ populate_dev -+else -+ # Setup slow USB bits -+ setup_slowusb - --# Start device manager --start_dev_mgr -+ # Start device manager -+ start_dev_mgr - --# if doslowusb is passed, pause other 10 seconds here, after mdev load --[ "${DO_slowusb}" ] && sleep 10 -+ # if doslowusb is passed, pause other 10 seconds here, after mdev load -+ [ "${DO_slowusb}" ] && sleep 10 -+fi - - # Start iSCSI - if [ -e /bin/iscsistart ] -@@ -509,9 +582,50 @@ do - then - break - else -- bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -- got_good_root=0 -- REAL_ROOT='' -+ # check for scratch -+ if [ -e ${NEW_ROOT}/livecd.squashfs -a -d ${NEW_ROOT}/delta -a -d ${NEW_ROOT}/workspace ]; -+ then -+ good_msg 'Found scratch data...' -+ load_union_module -+ modprobe squashfs >/dev/null -+ if mount -o remount,rw ${NEW_ROOT}; -+ then -+ mkdir -p ${NEW_ROOT}/calculate && mkdir -p /union && mkdir -p ${NEW_ROOT}/workspace/mnt/builder && mkdir -p ${NEW_ROOT}/workspace/mnt/scratch -+ if mount -o loop,ro -t squashfs ${NEW_ROOT}/livecd.squashfs ${NEW_ROOT}/calculate; -+ then -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/workspace=rw:${NEW_ROOT}/delta=ro+wh:${NEW_ROOT}/calculate=ro none /union; -+ then -+ mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/delta=rw:${NEW_ROOT}/calculate=ro none /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers!' -+ run_shell -+ fi -+ else -+ if mount -t unionfs -o ro,dirs=${NEW_ROOT}/workspace:${NEW_ROOT}/delta=ro:${NEW_ROOT}/calculate=ro unionfs /union; -+ then -+ mount -t unionfs -o ro,dirs=${NEW_ROOT}/delta:${NEW_ROOT}/calculate=ro unionfs /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers' -+ run_shell -+ fi -+ fi -+ else -+ bad_msg 'Could not mount scratch squashfs image' -+ fi -+ else -+ bad_msg 'Could not remount ${NEW_ROOT}' -+ fi -+ else -+ bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -+ got_good_root=0 -+ REAL_ROOT='' -+ fi - fi - else - bad_msg "Could not mount specified ROOT, try again" -@@ -723,9 +837,12 @@ cd "${CHROOT}" - mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null - echo -ne "${BOLD}.${NORMAL}" - -+# stop udev before move mount points -+stop_udev -+ - # If devtmpfs is mounted, try move it to the new root - # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise --for fs in /dev /sys /proc -+for fs in "/dev " /sys /proc - do - if grep -qs "$fs" /proc/mounts - then -diff --git defaults/modprobe defaults/modprobe -index ba2d890..9280357 100755 ---- defaults/modprobe -+++ defaults/modprobe -@@ -10,8 +10,6 @@ usage() { - echo - echo 'Example:' - echo ' modprobe eepro100' -- echo -- echo 'Note: Do not pass the suffix to modprobe!' - exit 1 - } - -@@ -81,14 +79,29 @@ modprobe2() { - usage - exit 1 - fi -- real_path=`real_mod_path ${1}` -+ local modname=${1} -+ local quiet='' -+ local params='' -+ shift -+ for x in $@ -+ do -+ case ${x} in -+ -n) -+ quiet=1 -+ ;; -+ *) -+ params="${params} ${x}" -+ ;; -+ esac -+ done -+ real_path=`real_mod_path ${modname}` - if [ "${real_path}" = '' -o "${real_path}" = ' ' ] - then -- [ "${2}" = '-n' ] && echo -n " -> $1" -+ [ "${quiet}" = '1' ] && echo -n " -> ${modname}" - echo ' module not found.' - exit 2 - fi -- modlist=`modules_dep_list ${1}` -+ modlist=`modules_dep_list ${modname}` - if [ "${modlist}" != '' -a "${modlist}" != ' ' ] - then - deps=`strip_mod_paths ${modlist}` -@@ -110,13 +123,13 @@ modprobe2() { - filler=1 - fi - done -- ${INSMOD} ${real_path} > /dev/null 2>&1 -+ ${INSMOD} ${real_path} ${params} > /dev/null 2>&1 - ret=$? - if [ ${ret} -eq 0 ] - then - echoAppend=' loaded.' -- [ "${2}" = '-n' ] && echoFlags='-n' && echoAppend=', ' -- echo ${echoFlags} "${1}${echoAppend}" -+ [ "${quiet}" = '1' ] && echoFlags='-n' && echoAppend=', ' -+ echo ${echoFlags} "${modname}${echoAppend}" - fi - return $ret - } -@@ -132,7 +145,7 @@ do - LOADED_MODULES="${LOADED_MODULES} ${x}" - done - --modprobe2 ${1} -+modprobe2 ${@} - modprobe_ret=$? - - [ -f '/modules.cache' ] && rm -f /modules.cache > /dev/null 2>&1 -diff --git dracut_funcs.sh dracut_funcs.sh -new file mode 100755 -index 0000000..e80a638 ---- /dev/null -+++ dracut_funcs.sh -@@ -0,0 +1,752 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+# -+# functions used by dracut and other tools. -+# -+# Copyright 2005-2009 Red Hat, Inc. All rights reserved. -+# -+# 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; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+# -+ -+IF_RTLD="" -+IF_dynamic="" -+ -+# Generic substring function. If $2 is in $1, return 0. -+strstr() { [[ $1 =~ $2 ]]; } -+ -+# Create all subdirectories for given path without creating the last element. -+# $1 = path -+mksubdirs() { mkdir -p ${1%/*}; } -+ -+# Version comparision function. Assumes Linux style version scheme. -+# $1 = version a -+# $2 = comparision op (gt, ge, eq, le, lt, ne) -+# $3 = version b -+vercmp() { -+ local n1=(${1//./ }) op=$2 n2=(${3//./ }) i res -+ -+ for ((i=0; ; i++)) -+ do -+ if [[ ! ${n1[i]}${n2[i]} ]]; then res=0 -+ elif ((${n1[i]:-0} > ${n2[i]:-0})); then res=1 -+ elif ((${n1[i]:-0} < ${n2[i]:-0})); then res=2 -+ else continue -+ fi -+ break -+ done -+ -+ case $op in -+ gt) ((res == 1));; -+ ge) ((res != 2));; -+ eq) ((res == 0));; -+ le) ((res != 1));; -+ lt) ((res == 2));; -+ ne) ((res != 0));; -+ esac -+} -+ -+is_func() { -+ [[ $(type -t $1) = "function" ]] -+} -+ -+# Log initrd creation. -+if ! [[ $dracutlogfile ]]; then -+ [[ $dracutbasedir = /usr/share/dracut ]] && \ -+ dracutlogfile=/var/log/dracut.log || \ -+ dracutlogfile=/tmp/dracut.log -+# [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log -+ if [[ -w $dracutlogfile ]]; then -+ >"$dracutlogfile" -+ fi -+fi -+ -+dwarning() { -+ echo "W: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "W: $@" >>"$dracutlogfile" -+} -+ -+dinfo() { -+ [[ $beverbose ]] && echo "I: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "I: $@" >>"$dracutlogfile" -+} -+ -+derror() { -+ echo "E: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile" -+} -+ -+# Function prints global variables in format name=value line by line. -+# $@ = list of global variables' name -+print_vars() { -+ local var value -+ -+ for var in $@ -+ do -+ value=$(eval echo \$$var) -+ [[ ${value} ]] && echo "${var}=\"${value}\"" -+ done -+} -+ -+get_fs_env() { -+ [[ $1 ]] || return -+ eval $(udevadm info --query=env --name=$1|egrep 'ID_FS_(TYPE|UUID)=') -+ [[ $ID_FS_TYPE ]] && return -+ -+ if [[ -x /lib/udev/vol_id ]]; then -+ eval $(/lib/udev/vol_id --export $1) -+ elif find_binary blkid >/dev/null; then -+ eval $(blkid -o udev $1) -+ else -+ return 1 -+ fi -+} -+ -+get_fs_type() ( -+ [[ $1 ]] || return -+ if [[ $1 != ${1#/dev/block/nfs:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs3:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs4:} ]]; then -+ echo "nfs" -+ return -+ fi -+ get_fs_env $1 || return -+ echo $ID_FS_TYPE -+) -+ -+get_fs_uuid() ( -+ get_fs_env $1 || return -+ echo $ID_FS_UUID -+) -+ -+# finds the major:minor of the block device backing the root filesystem. -+find_block_device() { -+ local x mpt majmin dev fs misc maj min -+ if [[ $use_fstab != yes ]]; then -+ while read x x majmin x mpt x x fs dev misc; do -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $fs = btrfs ]] && { -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ } -+ if [[ $mpt = $1 ]] && [[ ${majmin#0:} = $majmin ]]; then -+ echo $majmin; -+ return 0 # we have a winner! -+ fi -+ done < /proc/self/mountinfo -+ fi -+ # fall back to /etc/fstab -+ while read dev mpt fs misc; do -+ if [[ $mpt = $1 ]]; then -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $dev != ${dev#UUID=} ]] && dev=/dev/disk/by-uuid/${dev#UUID=} -+ [[ $dev != ${dev#LABEL=} ]] && dev=/dev/disk/by-label/${dev#LABEL=} -+ [[ -b $dev ]] || return 1 # oops, not a block device. -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ fi -+ done < /etc/fstab -+ return 1; -+} -+ -+find_root_block_device() { find_block_device /; } -+ -+# Walk all the slave relationships for a given block device. -+# Stop when our helper function returns success -+# $1 = function to call on every found block device -+# $2 = block device in major:minor format -+check_block_and_slaves() { -+ local x -+ [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. -+ "$1" $2 && return -+ check_vol_slaves "$@" && return 0 -+ if [[ -f /sys/dev/block/$2/../dev ]]; then -+ check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0 -+ fi -+ [[ -d /sys/dev/block/$2/slaves ]] || return 1 -+ for x in /sys/dev/block/$2/slaves/*/dev; do -+ [[ -f $x ]] || continue -+ check_block_and_slaves $1 $(cat "$x") && return 0 -+ done -+ return 1 -+} -+ -+get_numeric_dev() { -+ ls -lH "$1" | { read a b c d maj min rest; printf "%d:%d" ${maj%%,} $min;} -+} -+ -+# ugly workaround for the lvm design -+# There is no volume group device, -+# so, there are no slave devices for volume groups. -+# Logical volumes only have the slave devices they really live on, -+# but you cannot create the logical volume without the volume group. -+# And the volume group might be bigger than the devices the LV needs. -+check_vol_slaves() { -+ for i in /dev/mapper/*; do -+ lv=$(get_numeric_dev $i) -+ if [[ $lv = $2 ]]; then -+ vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null) -+ # strip space -+ vg=$(echo $vg) -+ if [[ $vg ]]; then -+ for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \ -+ do -+ check_block_and_slaves $1 $(get_numeric_dev $pv) \ -+ && return 0 -+ done -+ fi -+ fi -+ done -+ return 1 -+} -+ -+# Install a directory, keeping symlinks as on the original system. -+# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file" -+# will create ${initdir}/lib64, ${initdir}/lib64/file, -+# and a symlink ${initdir}/lib -> lib64. -+inst_dir() { -+ local dir="$1" -+ [[ -e ${initdir}$dir ]] && return 0 -+ -+ # iterate over parent directories -+ local file="" -+ local IFS="/" -+ for part in $dir; do -+ [[ $part ]] || continue -+ file="$file/$part" -+ [[ -e ${initdir}$file ]] && continue -+ -+ if [[ -L $file ]]; then -+ # create link as the original -+ local target=$(readlink "$file") -+ ln -sfn "$target" "${initdir}$file" || return 1 -+ # resolve relative path and recursively install destionation -+ [[ $target = ${target##*/} ]] && target="${file%/*}/$target" -+ inst_dir "$target" -+ else -+ # create directory -+ mkdir -p "${initdir}$file" || return 1 -+ fi -+ done -+} -+ -+# $1 = file to copy to ramdisk -+# $2 (optional) Name for the file on the ramdisk -+# Location of the image dir is assumed to be $initdir -+# We never overwrite the target if it exists. -+inst_simple() { -+ local src target -+ [[ -f $1 ]] || return 1 -+ src=$1 target="${2:-$1}" -+ if ! [[ -d ${initdir}$target ]]; then -+ [[ -e ${initdir}$target ]] && return 0 -+ inst_dir "${target%/*}" -+ fi -+ dinfo "Installing $src" -+ cp -pfL "$src" "${initdir}$target" -+} -+ -+# find symlinks linked to given library file -+# $1 = library file -+# Function searches for symlinks by stripping version numbers appended to -+# library filename, checks if it points to the same target and finally -+# prints the list of symlinks to stdout. -+# -+# Example: -+# rev_lib_symlinks libfoo.so.8.1 -+# output: libfoo.so.8 libfoo.so -+# (Only if libfoo.so.8 and libfoo.so exists on host system.) -+rev_lib_symlinks() { -+ [[ ! $1 ]] && return 0 -+ -+ local fn="$1" orig="$(readlink -f "$1")" links='' -+ -+ [[ ${fn} =~ .*\.so\..* ]] || return 1 -+ -+ until [[ ${fn##*.} == so ]]; do -+ fn="${fn%.*}" -+ [[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}" -+ done -+ -+ echo ${links} -+} -+ -+# Same as above, but specialized to handle dynamic libraries. -+# It handles making symlinks according to how the original library -+# is referenced. -+inst_library() { -+ local src=$1 dest=${2:-$1} lib reallib symlink -+ [[ -e $initdir$dest ]] && return 0 -+ if [[ -L $src ]]; then -+ reallib=$(readlink -f "$src") -+ lib=${src##*/} -+ inst_simple "$reallib" "$reallib" -+ inst_dir "${dest%/*}" -+ (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib") -+ else -+ inst_simple "$src" "$dest" -+ fi -+ -+ # Create additional symlinks. See rev_symlinks description. -+ for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do -+ [[ ! -e $initdir$symlink ]] && { -+ dinfo "Creating extra symlink: $symlink" -+ inst_symlink $symlink -+ } -+ done -+} -+ -+# find a binary. If we were not passed the full path directly, -+# search in the usual places to find the binary. -+find_binary() { -+ local binpath="/bin /sbin /usr/bin /usr/sbin" p -+ [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } -+ for p in $binpath; do -+ [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# Same as above, but specialized to install binary executables. -+# Install binary executable, and all shared library dependencies, if any. -+inst_binary() { -+ local bin target -+ bin=$(find_binary "$1") || return 1 -+ target=${2:-$bin} -+ inst_symlink $bin $target && return 0 -+ local LDSO NAME IO FILE ADDR I1 n f TLIBDIR -+ [[ -e $initdir$target ]] && return 0 -+ # I love bash! -+ LC_ALL=C ldd $bin 2>/dev/null | while read line; do -+ [[ $line = 'not a dynamic executable' ]] && return 1 -+ if [[ $line =~ not\ found ]]; then -+ derror "Missing a shared library required by $bin." -+ derror "Run \"ldd $bin\" to find out what it is." -+ derror "dracut cannot create an initrd." -+ exit 1 -+ fi -+ so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)' -+ [[ $line =~ $so_regex ]] || continue -+ FILE=${BASH_REMATCH[1]} -+ [[ -e ${initdir}$FILE ]] && continue -+ # see if we are loading an optimized version of a shared lib. -+ lib_regex='^(/lib[^/]*).*' -+ if [[ $FILE =~ $lib_regex ]]; then -+ TLIBDIR=${BASH_REMATCH[1]} -+ BASE=${FILE##*/} -+ # prefer nosegneg libs, then unoptimized ones. -+ for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do -+ [[ -e $f/$BASE ]] || continue -+ FILE=$f/$BASE -+ break -+ done -+ inst_library "$FILE" "$TLIBDIR/$BASE" -+ IF_dynamic=yes -+ continue -+ fi -+ inst_library "$FILE" -+ done -+ inst_simple "$bin" "$target" -+} -+ -+# same as above, except for shell scripts. -+# If your shell script does not start with shebang, it is not a shell script. -+inst_script() { -+ [[ -f $1 ]] || return 1 -+ local line -+ read -r -n 80 line <"$1" -+ # If debug is set, clean unprintable chars to prevent messing up the term -+ [[ $debug ]] && line=$(echo -n "$line" | tr -c -d '[:print:][:space:]') -+ shebang_regex='(#! *)(/[^ ]+).*' -+ [[ $line =~ $shebang_regex ]] || return 1 -+ inst "${BASH_REMATCH[2]}" && inst_simple "$@" -+} -+ -+# same as above, but specialized for symlinks -+inst_symlink() { -+ local src=$1 target=$initdir${2:-$1} realsrc -+ [[ -L $1 ]] || return 1 -+ [[ -L $target ]] && return 0 -+ realsrc=$(readlink -f "$src") -+ [[ $realsrc = ${realsrc##*/} ]] && realsrc=${src%/*}/$realsrc -+ inst "$realsrc" && mkdir -p "${target%/*}" && \ -+ ln -s "$realsrc" "$target" -+} -+ -+# find a udev rule in the usual places. -+find_rule() { -+ [[ -f $1 ]] && { echo "$1"; return 0; } -+ for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do -+ [[ -f $r/$1 ]] && { echo "$r/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# udev rules always get installed in the same place, so -+# create a function to install them to make life simpler. -+inst_rules() { -+ local target=/etc/udev/rules.d rule found -+ -+ inst_dir "/lib/udev/rules.d" -+ inst_dir "$target" -+ for rule in "$@"; do -+ found=$(find_rule "$rule") && \ -+ inst_simple "$found" "$target/${found##*/}" \ -+ || dinfo "Skipping udev rule: $rule" -+ done -+} -+ -+# general purpose installation function -+# Same args as above. -+inst() { -+ case $# in -+ 1) ;; -+ 2) [[ ! $initdir && -d $2 ]] && export initdir=$2 -+ [[ $initdir = $2 ]] && set $1;; -+ 3) [[ -z $initdir ]] && export initdir=$2 -+ set $1 $3;; -+ *) derror "inst only takes 1 or 2 or 3 arguments" -+ exit 1;; -+ esac -+ for x in inst_symlink inst_script inst_binary inst_simple; do -+ $x "$@" && return 0 -+ done -+ return 1 -+} -+ -+# install function specialized for hooks -+# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook -+# All hooks should be POSIX/SuS compliant, they will be sourced by init. -+inst_hook() { -+ if ! [[ -f $3 ]]; then -+ derror "Cannot install a hook ($3) that does not exist." -+ derror "Aborting initrd creation." -+ exit 1 -+ elif ! strstr "$hookdirs" "$1"; then -+ derror "No such hook type $1. Aborting initrd creation." -+ exit 1 -+ fi -+ inst_simple "$3" "/${1}/${2}${3##*/}" -+} -+ -+dracut_install() { -+ if [[ $1 = '-o' ]]; then -+ local optional=yes -+ shift -+ fi -+ while (($# > 0)); do -+ if ! inst "$1" ; then -+ if [[ $optional = yes ]]; then -+ dwarning "Skipping program $1 as it cannot be found and is flagged to be optional" -+ else -+ derror "Failed to install $1" -+ exit 1 -+ fi -+ fi -+ shift -+ done -+} -+ -+# install function decompressing the target and handling symlinks -+# $@ = list of compressed (gz or bz2) files or symlinks pointing to such files -+# -+# Function install targets in the same paths inside overlay but decompressed -+# and without extensions (.gz, .bz2). -+inst_decompress() { -+ local src dst realsrc realdst cmd -+ -+ for src in $@ -+ do -+ case ${src} in -+ *.gz) cmd='gzip -d' ;; -+ *.bz2) cmd='bzip2 -d' ;; -+ *) return 1 ;; -+ esac -+ -+ if [[ -L ${src} ]] -+ then -+ realsrc="$(readlink -f ${src})" # symlink target with extension -+ dst="${src%.*}" # symlink without extension -+ realdst="${realsrc%.*}" # symlink target without extension -+ mksubdirs "${initdir}/${src}" -+ # Create symlink without extension to target without extension. -+ ln -s "${realdst}" "${initdir}/${dst}" -+ fi -+ -+ # If the source is symlink we operate on its target. -+ [[ ${realsrc} ]] && src=${realsrc} -+ inst ${src} -+ # Decompress with chosen tool. We assume that tool changes name e.g. -+ # from 'name.gz' to 'name'. -+ ${cmd} "${initdir}${src}" -+ done -+} -+ -+# It's similar to above, but if file is not compressed, performs standard -+# install. -+# $@ = list of files -+inst_opt_decompress() { -+ local src -+ -+ for src in $@ -+ do -+ inst_decompress "${src}" || inst "${src}" -+ done -+} -+ -+module_check() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we are unconditionally included -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check $hostonly -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func check || return 0 -+ check -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_depends() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we have no deps -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check -d -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func depends || return 0 -+ depends -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_install() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/install ]] && . "$moddir/install" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func install || return 0 -+ install -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_installkernel() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/installkernel ]] && . "$moddir/installkernel" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func installkernel || return 0 -+ installkernel -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+check_module() { -+ local mod=$1; -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ local moddep; -+ # If we are already scheduled to be loaded, no need to check again. -+ strstr " $mods_to_load " " $mod " && return 0 -+ strstr " $mods_checked_as_dep " " $mod " && return 1 -+ -+ # This should never happen, but... -+ [[ -d $moddir ]] || return 1 -+ -+ [[ $2 ]] || mods_checked_as_dep+=" $mod " -+ -+ strstr " $omit_dracutmodules " " $mod " && return 1 -+ -+ if strstr " $dracutmodules $add_dracutmodules " " $mod "; then -+ module_check $mod; ret=$? -+ # explicit module, so also accept ret=255 -+ [[ $ret = 0 || $ret = 255 ]] || return 1 -+ else -+ # module not in our list -+ if [[ $dracutmodules = all ]]; then -+ # check, if we can and should install this module -+ module_check $mod || return 1 -+ else -+ # skip this module -+ return 1 -+ fi -+ fi -+ -+ for moddep in $(module_depends $mod); do -+ # handle deps as if they were manually added -+ strstr " $add_dracutmodules " " $moddep " || \ -+ add_dracutmodules+=" $moddep " -+ # if a module we depend on fail, fail also -+ check_module $moddep || return 1 -+ done -+ -+ strstr " $mods_to_load " " $mod " || \ -+ mods_to_load+=" $mod " -+ -+ return 0 -+} -+ -+check_module_dir() { -+ local modcheck; -+ local mod; -+ mods_to_load="" -+ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do -+ local mod=${moddir##*/}; mod=${mod#[0-9][0-9]} -+ check_module $mod 1 -+ done -+} -+ -+# Install a single kernel module along with any firmware it may require. -+# $1 = full path to kernel module to install -+install_kmod_with_fw() { -+ local modname=${1##*/} fwdir found -+ modname=${modname%.ko*} -+ inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \ -+ return 0 # no need to go further if the module is already installed -+ for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do -+ found='' -+ for fwdir in $fw_dir; do -+ if [[ -d $fwdir && -f $fwdir/$fw ]]; then -+ inst_simple "$fwdir/$fw" "/lib/firmware/$fw" -+ found=yes -+ fi -+ done -+ if [[ $found != yes ]]; then -+ dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\"" -+ fi -+ done -+} -+ -+# Do something with all the dependencies of a kernel module. -+# Note that kernel modules depend on themselves using the technique we use -+# $1 = function to call for each dependency we find -+# It will be passed the full path to the found kernel module -+# $2 = module to get dependencies for -+# rest of args = arguments to modprobe -+for_each_kmod_dep() { -+ local func=$1 kmod=$2 cmd modpapth options -+ shift 2 -+ modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \ -+ while read cmd modpath options; do -+ [[ $cmd = insmod ]] || continue -+ $func $modpath -+ done -+} -+ -+# filter kernel modules to install certain modules that meet specific -+# requirements. -+# $1 = function to call with module name to filter. -+# This function will be passed the full path to the module to test. -+# The behaviour of this function can vary depending on whether $hostonly is set. -+# If it is, we will only look at modules that are already in memory. -+# If it is not, we will look at all kernel modules -+# This function returns the full filenames of modules that match $1 -+filter_kernel_modules () ( -+ if ! [[ $hostonly ]]; then -+ filtercmd='find "$srcmods/kernel/drivers" "$srcmods/extra" "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz" 2>/dev/null' -+ else -+ filtercmd='cut -d " " -f 1 /dev/null' -+ fi -+ for modname in $(eval $filtercmd); do -+ case $modname in -+ *.ko) "$1" "$modname" && echo "$modname";; -+ *.ko.gz) gzip -dc "$modname" > $initdir/$$.ko -+ $1 $initdir/$$.ko && echo "$modname" -+ rm -f $initdir/$$.ko;; -+ esac -+ done -+) -+ -+# install kernel modules along with all their dependencies. -+instmods() { -+ [[ $no_kernel = yes ]] && return -+ local mod mpargs modpath modname cmd moddirname -+ while (($# > 0)); do -+ mod=${1%.ko*} -+ case $mod in -+ =*) -+ # This introduces 2 incompatible meanings for =* arguments -+ # to instmods. We need to decide which one to keep. -+ if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then -+ instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block") -+ elif [ -f $srcmods/modules.${mod#=} ]; then -+ instmods $mpargs $(cat ${srcmods}/modules.${mod#=} ) -+ else -+ instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*") -+ fi -+ ;; -+ --*) -+ mod=${mod##*/} -+ mpargs+=" $mod";; -+ i2o_scsi) shift; continue;; # Do not load this diagnostic-only module -+ *) mod=${mod##*/} -+ # if we are already installed, skip this module and go on -+ # to the next one. -+ [[ -f $initdir/$1 ]] && { shift; continue; } -+ # If we are building a host-specific initramfs and this -+ # module is not already loaded, move on to the next one. -+ [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \ -+ ! echo $add_drivers | grep -qe "\<${mod}\>" && { -+ shift; continue; -+ } -+ -+ # We use '-d' option in modprobe only if modules prefix path -+ # differs from default '/'. This allows us to use Dracut with -+ # old version of modprobe which doesn't have '-d' option. -+ moddirname=${srcmods%%/lib/modules/*} -+ [[ -n ${moddirname} ]] && moddirname="-d ${moddirname}/" -+ -+ # ok, load the module, all its dependencies, and any firmware -+ # it may require -+ for_each_kmod_dep install_kmod_with_fw $mod \ -+ --set-version $kernel ${moddirname} -+ ;; -+ esac -+ shift -+ done -+} -diff --git gen_cmdline.sh gen_cmdline.sh -index b3e451d..bc9f2dc 100755 ---- gen_cmdline.sh -+++ gen_cmdline.sh -@@ -22,6 +22,7 @@ longusage() { - echo " --logfile= Output file for debug info" - echo " --color Output debug in color" - echo " --no-color Do not output debug in color" -+ echo " --no-cleartmp Do not clear temp directory" - echo " Kernel Configuration settings" - echo " --menuconfig Run menuconfig after oldconfig" - echo " --no-menuconfig Do not run menuconfig after oldconfig" -@@ -78,6 +79,8 @@ longusage() { - echo " --splash-res= Select splash theme resolutions to install" - echo " --do-keymap-auto Forces keymap selection at boot" - echo " --no-keymap Disables keymap selection support" -+ echo " --udev Include udev in the initramfs" -+ echo " --no-udev Exclude udev from the initramfs" - echo " --lvm Include LVM support" - echo " --mdadm Include MDADM/MDMON support" - echo " --mdadm-config= Use file as mdadm.conf in initramfs" -@@ -97,6 +100,8 @@ longusage() { - echo " --unionfs Include support for unionfs" - echo " --netboot Create a self-contained env in the initramfs" - echo " --real-root= Specify a default for real_root=" -+ echo " --lscpi Include lspci into the initramfs" -+ echo " --no-lscpi Exclude lspci from the initramfs" - echo " Internals" - echo " --arch-override= Force to arch instead of autodetect" - echo " --cachedir= Override the default cache location" -@@ -232,6 +237,22 @@ parse_cmdline() { - CMD_KEYMAP=0 - print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" - ;; -+ --udev) -+ CMD_UDEV=1 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --no-udev) -+ CMD_UDEV=0 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --lspci) -+ CMD_LSPCI=1 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --no-lspci) -+ CMD_UDEV=0 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; - --lvm) - CMD_LVM=1 - print_info 2 "CMD_LVM: ${CMD_LVM}" -@@ -441,6 +462,10 @@ parse_cmdline() { - print_info 2 "USECOLOR: ${USECOLOR}" - setColorVars - ;; -+ --no-cleartmp) -+ NOCLEARTMP=1 -+ print_info 2 "NOCLEARTMP: ${NOCLEARTMP}" -+ ;; - --logfile=*) - CMD_LOGFILE=`parse_opt "$*"` - LOGFILE=`parse_opt "$*"` -diff --git gen_compile.sh gen_compile.sh -index 0758c3a..8a2339a 100755 ---- gen_compile.sh -+++ gen_compile.sh -@@ -407,7 +407,10 @@ compile_busybox() { - yes '' 2>/dev/null | compile_generic oldconfig utils - - print_info 1 'busybox: >> Compiling...' -+ OLDLOGLEVEL=$LOGLEVEL -+ LOGLEVEL=1 - compile_generic all utils -+ LOGLEVEL=$OLDLOGLEVEL - print_info 1 'busybox: >> Copying to cache...' - [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] || - gen_die 'Busybox executable does not exist!' -diff --git gen_determineargs.sh gen_determineargs.sh -index ce479cb..bda14b8 100755 ---- gen_determineargs.sh -+++ gen_determineargs.sh -@@ -107,6 +107,8 @@ determine_real_args() { - set_config_with_override BOOL SYMLINK CMD_SYMLINK - set_config_with_override STRING INSTALL_MOD_PATH CMD_INSTALL_MOD_PATH - set_config_with_override BOOL OLDCONFIG CMD_OLDCONFIG -+ set_config_with_override BOOL UDEV CMD_UDEV -+ set_config_with_override BOOL LSPCI CMD_LSPCI - set_config_with_override BOOL LVM CMD_LVM - set_config_with_override BOOL DMRAID CMD_DMRAID - set_config_with_override BOOL ISCSI CMD_ISCSI -diff --git gen_initramfs.sh gen_initramfs.sh -index 7fe4421..76b6645 100755 ---- gen_initramfs.sh -+++ gen_initramfs.sh -@@ -56,7 +56,13 @@ append_busybox() { - chmod +x "${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/default.script" - - # Set up a few default symlinks -- for i in ${BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}; do -+ if isTrue "${UDEV}" -+ then -+ BUSYBOX_APPLETS="${BUSYBOX_APPLETS:-[ ash sh uname echo cut cat}" -+ else -+ BUSYBOX_APPLETS="{$BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}" -+ fi -+ for i in ${BUSYBOX_APPLETS}; do - rm -f ${TEMP}/initramfs-busybox-temp/bin/$i > /dev/null - ln -s busybox ${TEMP}/initramfs-busybox-temp/bin/$i || - gen_die "Busybox error: could not link ${i}!" -@@ -410,7 +416,7 @@ append_firmware() { - IFS="," - for i in ${FIRMWARE_FILES} - do -- cp -L "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ -+ cp -rL "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ - done - IFS=$OLD_IFS - else -@@ -438,9 +444,71 @@ append_gpg() { - chmod a+x "${TEMP}/initramfs-gpg-temp/sbin/gpg" - cd "${TEMP}/initramfs-gpg-temp/" - find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" - rm -rf "${TEMP}/initramfs-gpg-temp" > /dev/null - } - -+append_udev() { -+ if [ -d "${TEMP}/initramfs-udev-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-udev-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-udev-temp/" -+ udevmod="${GK_SHARE}/modules/udev-rules/" -+ source ${udevmod}/module-setup.sh -+ initdir=${TEMP}/initramfs-udev-temp \ -+ moddir=${udevmod} \ -+ libdir=/lib/ \ -+ usrlibdir=/usr/lib/ \ -+ install_module -+ -+ if isTrue $LSPCI -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ fi -+ # find net modules and sound -+ (for pathname in ${INSTALL_MOD_PATH}/lib/modules/${KV}/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/drivers/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/sound -+ do -+ [[ -d $pathname ]] && find $pathname -name "*.ko" -+ done | -+ while read module;do -+ # add them prefix blacklist -+ echo "blacklist `basename $module .ko`"; -+ # concat with ready blacklist.conf -+ done;cat "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf") | -+ # sort and rewrite blacklist.conf -+ sort | uniq > "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" -+ mv "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" \ -+ "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf" -+ -+ cd "${TEMP}/initramfs-udev-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-udev-temp" > /dev/null -+} -+ -+append_lspci() { -+ if [ -d "${TEMP}/initramfs-lspci-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-lspci-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-lspci-temp/" -+ -+ initdir=${TEMP}/initramfs-lspci-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ -+ cd "${TEMP}/initramfs-lspci-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-lspci-temp" > /dev/null -+} -+ - print_list() - { - local x -@@ -489,6 +557,11 @@ append_modules() { - print_list ${!group_modules} > "${TEMP}/initramfs-modules-${KV}-temp/etc/modules/${group}" - done - cd "${TEMP}/initramfs-modules-${KV}-temp/" -+ # remove sound and media -+ for x in `find . -type d -name media -o -type d -name sound` -+ do -+ rm -r "${x}" &>/dev/null -+ done - find . | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ - || gen_die "compressing modules cpio" - cd "${TEMP}" -@@ -561,11 +634,14 @@ append_auxilary() { - done - echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" - -- if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ if ! isTrue "${UDEV}" - then -- cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -- else -- cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ then -+ cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ else -+ cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ fi - fi - if isTrue $CMD_DOKEYMAPAUTO - then -@@ -582,7 +658,7 @@ append_auxilary() { - chmod +x "${TEMP}/initramfs-aux-temp/init" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" -- chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ isTrue "${UDEV}" || chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" - - if isTrue ${NETBOOT} - then -@@ -609,6 +685,21 @@ append_data() { - fi - } - -+pack_cpio() { -+ print_info 1 " >> Pack cpio data..." -+ if [ -d "${TEMP}/initramfs-repack-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-repack-temp" -+ fi -+ mkdir -p "${TEMP}/initramfs-repack-temp" -+ cd "${TEMP}/initramfs-repack-temp" -+ # unpack and pack cpio remove double files -+ cpio -di <${CPIO} 2>/dev/null -+ find . -print | cpio ${CPIO_ARGS} | gzip -9 >"${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-repack-temp" > /dev/null -+} -+ - create_initramfs() { - print_info 1 "initramfs: >> Initializing..." - -@@ -619,6 +710,11 @@ create_initramfs() { - - append_data 'base_layout' - append_data 'auxilary' "${BUSYBOX}" -+ append_data 'udev' "${UDEV}" -+ if ! isTrue "${UDEV}" -+ then -+ append_data 'lspci' "${LSPCI}" -+ fi - append_data 'busybox' "${BUSYBOX}" - append_data 'lvm' "${LVM}" - append_data 'dmraid' "${DMRAID}" -@@ -652,8 +748,7 @@ create_initramfs() { - append_data 'overlay' - fi - -- gzip -9 "${CPIO}" -- mv -f "${CPIO}.gz" "${CPIO}" -+ pack_cpio - - if isTrue "${INTEGRATED_INITRAMFS}" - then -diff --git genkernel genkernel -index 0a06cdd..1486c61 100755 ---- genkernel -+++ genkernel -@@ -9,6 +9,7 @@ GK_V='3.4.18' - TMPDIR='/var/tmp/genkernel' - - TODEBUGCACHE=1 # Until an error occurs or LOGFILE is fully qualified. -+NOCLEARTMP=0 - - small_die() { - echo $1 -@@ -45,6 +46,7 @@ source ${GK_SHARE}/gen_initramfs.sh || gen_die "Could not read ${GK_SHARE}/gen_i - source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_moddeps.sh" - source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh" - source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh" -+source ${GK_SHARE}/dracut_funcs.sh || gen_die "Could not read ${GK_SHARE}/dracut_funcs.sh" - - TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ - -@@ -55,21 +57,25 @@ trap_cleanup(){ - } - - cleanup(){ -- if [ -n "$TEMP" -a -d "$TEMP" ]; then -- rm -rf "$TEMP" -- fi -- -- if isTrue ${POSTCLEAR} -- then -- echo -- print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -- print_info 1 "CACHE_DIR: ${CACHE_DIR}" -- CLEAR_CACHE_DIR='yes' -- setup_cache_dir -- echo -- print_info 1 "TMPDIR: ${TMPDIR}" -- clear_tmpdir -- fi -+ if [[ ${NOCLEARTMP} -ne 0 ]] -+ then -+ return -+ fi -+ if [ -n "$TEMP" -a -d "$TEMP" ]; then -+ rm -rf "$TEMP" &>/dev/null -+ fi -+ -+ if isTrue ${POSTCLEAR} -+ then -+ echo -+ print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -+ print_info 1 "CACHE_DIR: ${CACHE_DIR}" -+ CLEAR_CACHE_DIR='yes' -+ setup_cache_dir -+ echo -+ print_info 1 "TMPDIR: ${TMPDIR}" -+ clear_tmpdir -+ fi - } - - trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL -diff --git genkernel.conf genkernel.conf -index 24fcd54..41f8e06 100644 ---- genkernel.conf -+++ genkernel.conf -@@ -52,6 +52,12 @@ USECOLOR="yes" - # argument is: *+1 - # MAKEOPTS="-j2" - -+# Add udev to initramfs -+UDEV="yes" -+ -+# Add lspci to initramfs -+LSPCI="yes" -+ - # Add in LVM support from static binaries if they exist on the system, or - # compile static LVM binaries if static ones do not exist. - # LVM="no" -@@ -92,7 +98,7 @@ USECOLOR="yes" - # Specify directory to pull from - # FIRMWARE_DIR="/lib/firmware" - # Specify specific firmware files to include. This overrides FIRMWARE_DIR --# FIRMWARE_FILES="" -+FIRMWARE_FILES="/lib/firmware/radeon" - - # Enable disklabel support (copies blkid to initrd) - DISKLABEL="yes" -diff --git modules/udev-rules/01-ignore.rules modules/udev-rules/01-ignore.rules -new file mode 100644 -index 0000000..b32f22e ---- /dev/null -+++ modules/udev-rules/01-ignore.rules -@@ -0,0 +1 @@ -+KERNEL=="ram[0-9]*", OPTIONS+="ignore_device", OPTIONS+="last_rule" -diff --git modules/udev-rules/59-persistent-storage-volid.rules modules/udev-rules/59-persistent-storage-volid.rules -new file mode 100644 -index 0000000..0b798e6 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage-volid.rules -@@ -0,0 +1,7 @@ -+SUBSYSTEM!="block", GOTO="psv_end" -+ACTION!="add|change", GOTO="psv_end" -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="cciss[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", IMPORT{program}="vol_id --export $tempnode" -+LABEL="psv_end" -diff --git modules/udev-rules/59-persistent-storage.rules modules/udev-rules/59-persistent-storage.rules -new file mode 100644 -index 0000000..2b83e72 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage.rules -@@ -0,0 +1,38 @@ -+SUBSYSTEM!="block", GOTO="ps_end" -+ACTION!="add|change", GOTO="ps_end" -+ -+KERNEL=="cciss[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end" -+ -+# partitions have no md/{array_state,metadata_version} -+ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" -+ -+# container devices have a metadata version of e.g. 'external:ddf' and -+# never leave state 'inactive' -+ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -+TEST!="md/array_state", GOTO="md_end" -+ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -+ -+LABEL="md_ignore_state" -+ -+IMPORT{program}="/sbin/mdadm --detail --export $tempnode" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+OPTIONS+="link_priority=100" -+OPTIONS+="watch" -+LABEL="md_end" -+ -+ -+KERNEL!="dm-[0-9]*", GOTO="ps_end" -+ACTION=="add", GOTO="ps_end" -+IMPORT{program}="/sbin/dmsetup info -c --nameprefixes --unquoted --rows --noheadings -o name,uuid,suspended,readonly,major,minor,open,tables_loaded,names_using_dev -j%M -m%m" -+ENV{DM_NAME}!="?*", GOTO="ps_end" -+ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="ps_end" -+ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="ps_end" -+ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="ps_end" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+LABEL="ps_end" -diff --git modules/udev-rules/61-persistent-storage.rules modules/udev-rules/61-persistent-storage.rules -new file mode 100644 -index 0000000..9cfdb0b ---- /dev/null -+++ modules/udev-rules/61-persistent-storage.rules -@@ -0,0 +1,20 @@ -+SUBSYSTEM!="block", GOTO="pss_end" -+ACTION!="add|change", GOTO="pss_end" -+ -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss" -+KERNEL=="cciss[0-9]*", GOTO="do_pss" -+KERNEL=="nbd[0-9]*", GOTO="do_pss" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", GOTO="do_pss" -+ -+GOTO="pss_end" -+ -+LABEL="do_pss" -+# by-path (parent device path) -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{program}="path_id %p" -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" -+ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" -+ -+# by-label/by-uuid links (filesystem metadata) -+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -+LABEL="pss_end" -diff --git modules/udev-rules/blacklist.conf modules/udev-rules/blacklist.conf -new file mode 100644 -index 0000000..21ac71c ---- /dev/null -+++ modules/udev-rules/blacklist.conf -@@ -0,0 +1,162 @@ -+blacklist ath_pci -+blacklist evbug -+blacklist usbmouse -+blacklist usbkbd -+blacklist eepro100 -+blacklist de4x5 -+blacklist eth1394 -+blacklist snd_intel8x0m -+blacklist snd_aw2 -+blacklist i2c_i801 -+blacklist prism54 -+blacklist bcm43xx -+blacklist garmin_gps -+blacklist asus_acpi -+blacklist snd_pcsp -+blacklist pcspkr -+blacklist amd76x_edac -+blacklist ohci1394 -+blacklist sbp2 -+blacklist dv1394 -+blacklist raw1394 -+blacklist video1394 -+blacklist aty128fb -+blacklist atyfb -+blacklist radeonfb -+blacklist cirrusfb -+blacklist cyber2000fb -+blacklist cyblafb -+blacklist gx1fb -+blacklist hgafb -+blacklist i810fb -+blacklist intelfb -+blacklist kyrofb -+blacklist lxfb -+blacklist matroxfb_base -+blacklist neofb -+blacklist nvidiafb -+blacklist pm2fb -+blacklist rivafb -+blacklist s1d13xxxfb -+blacklist savagefb -+blacklist sisfb -+blacklist sstfb -+blacklist tdfxfb -+blacklist tridentfb -+blacklist vesafb -+blacklist vfb -+blacklist viafb -+blacklist vt8623fb -+blacklist ac97 -+blacklist ac97_codec -+blacklist ac97_plugin_ad1980 -+blacklist ad1848 -+blacklist ad1889 -+blacklist adlib_card -+blacklist aedsp16 -+blacklist ali5455 -+blacklist btaudio -+blacklist cmpci -+blacklist cs4232 -+blacklist cs4281 -+blacklist cs461x -+blacklist cs46xx -+blacklist emu10k1 -+blacklist es1370 -+blacklist es1371 -+blacklist esssolo1 -+blacklist forte -+blacklist gus -+blacklist i810_audio -+blacklist kahlua -+blacklist mad16 -+blacklist maestro -+blacklist maestro3 -+blacklist maui -+blacklist mpu401 -+blacklist nm256_audio -+blacklist opl3 -+blacklist opl3sa -+blacklist opl3sa2 -+blacklist pas2 -+blacklist pss -+blacklist rme96xx -+blacklist sb -+blacklist sb_lib -+blacklist sgalaxy -+blacklist sonicvibes -+blacklist sound -+blacklist sscape -+blacklist trident -+blacklist trix -+blacklist uart401 -+blacklist uart6850 -+blacklist via82cxxx_audio -+blacklist v_midi -+blacklist wavefront -+blacklist ymfpci -+blacklist ac97_plugin_wm97xx -+blacklist ad1816 -+blacklist audio -+blacklist awe_wave -+blacklist dmasound_core -+blacklist dmasound_pmac -+blacklist harmony -+blacklist sequencer -+blacklist soundcard -+blacklist usb-midi -+blacklist acquirewdt -+blacklist advantechwdt -+blacklist alim1535_wdt -+blacklist alim7101_wdt -+blacklist booke_wdt -+blacklist cpu5wdt -+blacklist eurotechwdt -+blacklist i6300esb -+blacklist i8xx_tco -+blacklist ib700wdt -+blacklist ibmasr -+blacklist indydog -+blacklist iTCO_wdt -+blacklist it8712f_wdt -+blacklist it87_wdt -+blacklist ixp2000_wdt -+blacklist ixp4xx_wdt -+blacklist machzwd -+blacklist mixcomwd -+blacklist mpc8xx_wdt -+blacklist mpcore_wdt -+blacklist mv64x60_wdt -+blacklist pc87413_wdt -+blacklist pcwd -+blacklist pcwd_pci -+blacklist pcwd_usb -+blacklist s3c2410_wdt -+blacklist sa1100_wdt -+blacklist sbc60xxwdt -+blacklist sbc7240_wdt -+blacklist sb8360 -+blacklist sc1200wdt -+blacklist sc520_wdt -+blacklist sch311_wdt -+blacklist scx200_wdt -+blacklist shwdt -+blacklist smsc37b787_wdt -+blacklist softdog -+blacklist twl4030_wdt -+blacklist w83627hf_wdt -+blacklist w83697hf_wdt -+blacklist w83697ug_wdt -+blacklist w83877f_wdt -+blacklist w83977f_wdt -+blacklist wafer5823wdt -+blacklist wdt -+blacklist wdt_pci -+blacklist wm8350_wdt -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -diff --git modules/udev-rules/load-modules.sh modules/udev-rules/load-modules.sh -new file mode 100755 -index 0000000..36972fd ---- /dev/null -+++ modules/udev-rules/load-modules.sh -@@ -0,0 +1,7 @@ -+#!/bin/sh -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+# Implement blacklisting for udev-loaded modules -+ -+modprobe -b "$@" -diff --git modules/udev-rules/module-setup.sh modules/udev-rules/module-setup.sh -new file mode 100755 -index 0000000..1005627 ---- /dev/null -+++ modules/udev-rules/module-setup.sh -@@ -0,0 +1,57 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+install_module() { -+ # FIXME: would be nice if we didn't have to know which rules to grab.... -+ # ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies -+ # of the rules we want so that we just copy those in would be best -+ dracut_install udevd udevadm /etc/udev/udev.conf /etc/group /bin/mount /sbin/modprobe -+ inst_rules 50-udev-default.rules 60-persistent-storage.rules \ -+ 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \ -+ 60-pcmcia.rules -+ mkdir -p "$initdir"/etc/modprobe.d -+ inst_simple "$moddir/blacklist.conf" /etc/modprobe.d/ -+ -+ # ignore some devices in the initrd -+ inst_rules "$moddir/01-ignore.rules" -+ -+ # for firmware loading -+ inst_rules 50-firmware.rules -+ -+ if [ ! -x /lib/udev/vol_id ]; then -+ inst_rules "$moddir/59-persistent-storage.rules" -+ else -+ inst_rules "$moddir/59-persistent-storage-volid.rules" -+ fi -+ inst_rules "$moddir/61-persistent-storage.rules" -+ -+ for i in \ -+ ata_id \ -+ cdrom_id \ -+ create_floppy_devices \ -+ edd_id \ -+ firmware.sh \ -+ firmware \ -+ firmware.agent \ -+ hotplug.functions \ -+ fw_unit_symlinks.sh \ -+ hid2hci \ -+ path_id \ -+ scsi_id \ -+ usb_id \ -+ vol_id \ -+ pcmcia-socket-startup \ -+ pcmcia-check-broken-cis \ -+ ; do -+ for utilpath in /lib/udev /sbin /bin -+ do -+ [ -e $utilpath/$i ] && dracut_install $utilpath/$i -+ done -+ done -+ -+ for i in {"$libdir","$usrlibdir"}/libnss_files*; do -+ [ -e "$i" ] && dracut_install "$i" -+ done -+} -+ diff --git a/sys-kernel/calckernel/files/calckernel-3.4.18-r5.patch b/sys-kernel/calckernel/files/calckernel-3.4.18-r5.patch deleted file mode 100644 index 39b61e9e9..000000000 --- a/sys-kernel/calckernel/files/calckernel-3.4.18-r5.patch +++ /dev/null @@ -1,2116 +0,0 @@ -diff --git defaults/initrd.defaults defaults/initrd.defaults -index 76d72a7..0c059a5 100755 ---- defaults/initrd.defaults -+++ defaults/initrd.defaults -@@ -68,6 +68,7 @@ fi - - REAL_ROOT='' - CDROOT='0' -+SCRATCH='0' - CDROOT_DEV='' - CDROOT_TYPE='auto' - NEW_ROOT='/newroot' -diff --git defaults/initrd.scripts defaults/initrd.scripts -index 51ebcce..09a11d5 100755 ---- defaults/initrd.scripts -+++ defaults/initrd.scripts -@@ -187,23 +187,45 @@ cache_cd_contents() { - # TODO: Check the size of the image versus the size of our tmpfs - # along with the amount of available RAM and increase tmpfs size - # if necessary. (Not having awk sucks...) -- # z=0 -- # for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -- # cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; do -- # z=$(($z + $i)) ; done -- # echo $z -- good_msg "Copying loop file for caching..." -- # Verify that the needed directory exists -- mkdir -p "$(dirname ${NEW_ROOT}/mnt/${LOOP})" -- cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/${LOOP} -- if [ $? -ne 0 ] -+ -+ # getting memory -+ allmemory=0 -+ for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -+ cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; -+ do -+ allmemory=$(($allmemory + $i)) -+ done -+ -+ # getting size tmpfs of default -+ let curtfs=$allmemory/2 -+ -+ # getting size of image -+ let imagesize=`ls -la ${NEW_ROOT}/mnt/cdrom/${LOOP} | sed -r -n 's/(\S*\s*){4}(\S*).*/\2/p'`/20000*21 -+ let addon=$imagesize/10 -+ if [[ $curtfs -gt $(( ${imagesize} + ${addon} )) ]]; - then -- bad_msg "Failed to cache the loop file! Lack of space?" -- rm -rf ${NEW_ROOT}/mnt/livecd.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/image.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/zisofs 2>/dev/null -+ let addon=$(( $curtfs - ${imagesize} )) -+ fi -+ -+ if [[ $((${imagesize} + $addon)) -lt ${allmemory} ]]; -+ then -+ mount -o remount,size=${addon}000 -t tmpfs tmpfs ${NEW_ROOT} -+ mkdir ${NEW_ROOT}/mnt/squash -+ mount -o size=${imagesize}000 -t tmpfs tmpfs ${NEW_ROOT}/mnt/squash -+ good_msg "Copying loop file for caching..." -+ cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/squash/${LOOP} -+ if [ $? -ne 0 ] -+ then -+ bad_msg "Failed to cache the loop file! Lack of space?" -+ umount ${NEW_ROOT}/mnt/squash -+ mount -o remount,size=${curtfs}000 -t tmpfs tmpfs ${NEW_ROOT} -+ else -+ LOOPEXT='../squash/' -+ good_msg "Unmounting media from ${NEW_ROOT}/mnt/cdrom" -+ umount ${NEW_ROOT}/mnt/cdrom -+ fi - else -- LOOPEXT='../' -+ bad_msg "Too low memory for cache the loop file." - fi - fi - fi -@@ -266,7 +288,7 @@ findnfsmount() { - if [ "${CDROOT}" != '0' ] - then - good_msg "Attempting to mount NFS CD image on ${NFSROOT} with options ${NFSOPTIONS}" -- mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT}/mnt/cdrom -+ busybox mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT}/mnt/cdrom - if [ "$?" = '0' ] - then - REAL_ROOT="/dev/nfs" -@@ -275,7 +297,7 @@ findnfsmount() { - fi - else - good_msg "Attempting to mount NFS root on ${NFSROOT} with options ${NFSOPTIONS}" -- mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT} -+ busybox mount -t nfs -o ${NFSOPTIONS} ${NFSROOT} ${NEW_ROOT} - if [ "$?" = '0' ] - then - REAL_ROOT="/dev/nfs" -@@ -655,7 +677,7 @@ startVolumes() { - [ -d /etc/lvm/cache ] && lvm_commands="${lvm_commands} \nvgscan" - - # To activate volumegroups on all devices in the cache -- lvm_commands="${lvm_commands} \nvgchange -ay --sysinit" -+ lvm_commands="${lvm_commands} \nvgchange -ay --sysinit --noudevsync" - - # And finally execute it all (/proc/... needed if lvm is compiled without readline) - good_msg "Scanning for and activating Volume Groups" -@@ -1082,6 +1104,38 @@ getdvhoff() { - echo $(( $(hexdump -n 4 -s $((316 + 12 * $2)) -e '"%i"' $1) * 512)) - } - -+load_union_module() { -+ UNIONTYPE="" -+ # find module for union file system -+ [ -n "$(find /lib/ -name unionfs.ko)" ] && UNIONTYPE="unionfs" -+ [ -n "$(find /lib/ -name aufs.ko)" ] && UNIONTYPE="aufs" -+ # probably aufs in kernel -+ if [ -n "$(gzip -dc /proc/config.gz | grep CONFIG_AUFS_FS=y )" ] -+ then -+ UNIONTYPE="aufs" -+ else -+ if [ -z "${UNIONTYPE}" ] -+ then -+ bad_msg "Module for union file system is not found!" -+ run_shell -+ else -+ modprobe ${UNIONTYPE} > /dev/null 2>&1 -+ # error on load union module -+ if [ -z "$(lsmod | grep $UNIONTYPE)" ] -+ then -+ bad_msg "Module for union file system is not correct!" -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ bad_msg "Probably kernel compiled without standalone patch." -+ fi -+ run_shell -+ fi -+ -+ good_msg "Loading ${UNIONTYPE}" -+ fi -+ fi -+} -+ - setup_unionfs() { - local rw_dir=$1 - local ro_dir=$2 -@@ -1101,6 +1155,7 @@ setup_unionfs() { - mkdir -p ${UNION} - good_msg "Loading fuse module" - modprobe fuse > /dev/null 2>&1 -+ load_union_module - # if [ -n "${UNIONFS}" ] - # then - # CHANGESDEV=${UNIONFS} -@@ -1130,11 +1185,102 @@ setup_unionfs() { - mkdir /tmp - mkdir -p ${UNION} - # mkdir -p $CHANGES --# mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+## mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+ -+ if [ "${SCRATCH}" -ne 0 ]; -+ then -+ good_msg "Loading in scratch mode" -+ BUILDERDIR=${UNION}/mnt/builder -+ SCRATCHDIR=${UNION}/mnt/scratch -+ DELTADIR=${rw_dir}/mnt/delta -+ WORKSPACEDIR=${rw_dir}/mnt/workspace -+ mount -o remount,rw ${rw_dir}/mnt/cdrom >/dev/null 2>&1 -+ touch ${rw_dir}/mnt/cdrom/livecd >/dev/null 2>&1 -+ if [ "$?" -ne 0 ]; -+ then -+ ISRW=0 -+ else -+ ISRW=1 -+ fi -+ -+ mkdir -p ${DELTADIR} -+ mkdir -p ${WORKSPACEDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${WORKSPACEDIR}=rw:${DELTADIR}=ro+wh:${rw_dir}/mnt/livecd=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${WORKSPACEDIR}=rw:${DELTADIR}=ro:${rw_dir}/mnt/livecd=ro unionfs ${UNION} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${SCRATCHDIR}/calculate -+ mkdir -p ${SCRATCHDIR}/delta -+ mkdir -p ${SCRATCHDIR}/workspace -+ mount -o bind ${rw_dir}/mnt/delta ${SCRATCHDIR}/delta -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind ${rw_dir}/mnt/workspace ${SCRATCHDIR}/workspace -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${BUILDERDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro none ${BUILDERDIR} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro unionfs ${BUILDERDIR} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind,ro ${rw_dir}/mnt/livecd ${SCRATCHDIR}/calculate -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ if [ "$ISRW" -ne 0 ]; -+ then -+ FLASHDIR=${UNION}/mnt/flash -+ mkdir -p ${FLASHDIR} -+ mount -o bind ${rw_dir}/mnt/cdrom ${FLASHDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ mkdir -p ${CDROMDIR} -+ mount -o bind,ro ${rw_dir}/mnt/cdrom ${CDROMDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ fi -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ LIVECDDIR=${UNION}/mnt/livecd -+ -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${rw_dir}:${ro_dir}=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${rw_dir}:${ro_dir}=ro unionfs ${UNION} -+ fi -+ -+ if [[ -n "$( echo ${LOOPEXT} | grep squash )" ]]; -+ then -+ mkdir -p ${UNION}/mnt/squash -+ mount -o bind ${NEW_ROOT}/mnt/squash ${UNION}/mnt/squash &>/dev/null -+ fi -+ -+ chmod 0755 ${UNION} -+ mount -o bind ${rw_dir}/mnt/cdrom ${CDROMDIR} &>/dev/null -+ mount -o bind ${rw_dir}/mnt/livecd ${LIVECDDIR} &>/dev/null -+ ret=$? -+ fi -+ -+ chmod 1777 ${UNION}/tmp - good_msg "Creating union mount" -- unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -- ret=$? -- if [ ${ret} -ne 0 ] -+# unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -+# ret=$? -+ if [ "${ret}" -ne 0 ] - then - bad_msg "Can't setup union mount!" - USE_UNIONFS_NORMAL=0 -@@ -1143,3 +1289,121 @@ setup_unionfs() { - USE_UNIONFS_NORMAL=0 - fi - } -+ -+load_videodrv() { -+ good_msg "Loading frame buffer video driver" -+ # find all available fb drivers -+ videodrv_count=$(find /lib/modules \ -+ -name "nouveau.ko" -o \ -+ -name "uvesafb.ko" -o \ -+ -name "i915.ko" -o \ -+ -name "radeon.ko" | -+ grep -c "") -+ # load specified videodrv -+ modules_list= -+ case "${VIDEODRV}" in -+ nouveau) -+ modules_list="nouveau" -+ ;; -+ radeon) -+ modules_list="radeon" -+ ;; -+ i915|intel) -+ modules_list="i915" -+ ;; -+ ""|auto) -+ # if not livecd and initramfs otimized (aviailable only one video driver) -+ if [ "${CDROOT}" != '1' -a "${videodrv_count}" -le 2 ] -+ then -+ modules_list="nouveau i915 radeon" -+ else -+ if [[ -x /usr/sbin/lspci ]] -+ then -+ if lspci | grep -m1 VGA | grep -qi intel -+ then -+ modules_list="i915" -+ elif lspci | grep -m1 VGA | grep -qi nvidia -+ then -+ modules_list="nouveau" -+ elif lspci | grep -m1 VGA | grep -q -e "Ati" -e "ATI" -+ then -+ modules_list="radeon" -+ else -+ modules_list="" -+ fi -+ else -+ modules_list="i915" -+ fi -+ fi -+ ;; -+ esac -+ for x in $modules_list -+ do -+ if [ "`find /lib/modules -name "${x}.ko" | grep -c ''`" -eq "1" ] -+ then -+ modprobe "${x}" modeset=${USE_MODESET} &>/dev/null -+ lsmod | grep -q "^${x}" && \ -+ [ "`cat /sys/module/${x}/refcnt`" -gt 0 ] && return 0 -+ fi -+ done -+ # else load uvesafb with specified video resolution -+ if [ -n "${VIDEORES}" ] -+ then -+ if ! echo $VIDEORES | grep -q "\-" -+ then -+ VIDEORES="${VIDEORES}-32" -+ fi -+ else -+ VIDEORES="1024x768-32" -+ fi -+ modprobe uvesafb mode_option=${VIDEORES} &>/dev/null -+} -+ -+start_udev() -+{ -+ # start udev -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ echo "" >/proc/sys/kernel/hotplug -+ udevd --daemon &>/dev/null -+ udevadm settle -+ fi -+} -+ -+stop_udev() -+{ -+ # kill udevd -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ pkill udevd &>/dev/null -+ fi -+} -+ -+populate_dev() -+{ -+ good_msg 'Activating udev' -+ # Do not run any init-scripts -+ udevadm control --property=do_not_run_plug_service=1 -+ -+ if [ "${REAL_ROOT}" == "/dev/nfs" ] -+ then -+ # clean blacklist because there are net drivers -+ # keep black video for correct loading prop. nvidia -+ cat </etc/modprobe.d/blacklist.conf -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -+EOF -+ fi -+ # discarding net drivers placed into blacklist.conf -+ udevadm trigger --action="add" -+ -+ # we can speed up booting under these conditions: -+ # * using devtmpfs so kernel creates device nodes for us -+ # * only using kernel created device nodes at boot (in /etc/fstab and elsewhere) -+ udevadm settle --timeout=60 -+} -diff --git defaults/linuxrc defaults/linuxrc -index 0843f5d..8109d09 100755 ---- defaults/linuxrc -+++ defaults/linuxrc -@@ -39,6 +39,13 @@ FAKE_ROOT='' - REAL_ROOTFLAGS='' - ROOTFSTYPE='auto' - CRYPT_SILENT=0 -+VIDEODRV='' -+USE_UDEV=1 -+USE_MODESET=1 -+if [ -e "/etc/calculate/calculate.ini" ] -+then -+ source /etc/calculate/calculate.ini -+fi - for x in ${CMDLINE} - do - case "${x}" in -@@ -57,6 +64,57 @@ do - init_opts\=*) - INIT_OPTS=`parse_opt "${x}"` - ;; -+ nokms) -+ USE_MODESET=0 -+ ;; -+ kms) -+ USE_MODESET=1 -+ ;; -+ noudev) -+ USE_UDEV=0 -+ ;; -+ calculate\=*) -+ CALCULATE=`parse_opt "${x}"` -+ if [[ "${CALCULATE//:/}" != "${CALCULATE}" ]] -+ then -+ for i in ${CALCULATE//,/ } -+ do -+ case "${i}" in -+ video:*) -+ VIDEODRV=`echo "${i}" | cut -s -d: -f2-` -+ ;; -+ resolution:*) -+ RES=`echo "${i}" | cut -s -d: -f2-` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ ;; -+ esac -+ done -+ else -+ RES=`echo "${CALCULATE}" | cut -s -d, -f4` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ VIDEODRV=`echo "${CALCULATE}" | cut -s -d, -f5` -+ fi -+ ;; -+ video\=*) -+ VR=`parse_opt "${x}"` -+ for i in ${VR//,/ } -+ do -+ if [ -z "${i//[0-9-x@]}" ] -+ then -+ VIDEORES=${i} -+ fi -+ done -+ ;; -+ # Scratch usbload -+ scratch) -+ SCRATCH=1 -+ ;; - # Livecd options - cdroot) - CDROOT=1 -@@ -251,15 +309,24 @@ then - REAL_ROOT="${FAKE_ROOT}" - fi - --splash 'init' -- --cmdline_hwopts -+# check udevd -+[ ! -x /sbin/udevd ] && USE_UDEV=0 - - # Mount sysfs - mount_sysfs - -+# start udev -+start_udev -+ -+# load kernel video driver -+load_videodrv -+ -+splash 'init' -+ -+cmdline_hwopts -+ - # Setup hotplugging for firmware loading --setup_hotplug -+[ "${USE_UDEV}" == "0" ] && setup_hotplug - - # Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel - if [ -z "${DO_modules}" ] -@@ -269,7 +336,7 @@ elif [ -d "/lib/modules/${KV}" ] - then - good_msg 'Loading modules' - # Load appropriate kernel modules -- if [ "${NODETECT}" != '1' ] -+ if [ "${USE_UDEV}" != '1' -a "${NODETECT}" != '1' ] - then - for modules in ${MY_HWOPTS} - do -@@ -285,14 +352,20 @@ fi - # Apply scan delay if specified - sdelay - --# Setup slow USB bits --setup_slowusb -+if [ "${USE_UDEV}" == "1" ] -+then -+ # populate /dev with devices already found by the kernel -+ populate_dev -+else -+ # Setup slow USB bits -+ setup_slowusb - --# Start device manager --start_dev_mgr -+ # Start device manager -+ start_dev_mgr - --# if doslowusb is passed, pause other 10 seconds here, after mdev load --[ "${DO_slowusb}" ] && sleep 10 -+ # if doslowusb is passed, pause other 10 seconds here, after mdev load -+ [ "${DO_slowusb}" ] && sleep 10 -+fi - - # Start iSCSI - if [ -e /bin/iscsistart ] -@@ -509,9 +582,50 @@ do - then - break - else -- bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -- got_good_root=0 -- REAL_ROOT='' -+ # check for scratch -+ if [ -e ${NEW_ROOT}/livecd.squashfs -a -d ${NEW_ROOT}/delta -a -d ${NEW_ROOT}/workspace ]; -+ then -+ good_msg 'Found scratch data...' -+ load_union_module -+ modprobe squashfs >/dev/null -+ if mount -o remount,rw ${NEW_ROOT}; -+ then -+ mkdir -p ${NEW_ROOT}/calculate && mkdir -p /union && mkdir -p ${NEW_ROOT}/workspace/mnt/builder && mkdir -p ${NEW_ROOT}/workspace/mnt/scratch -+ if mount -o loop,ro -t squashfs ${NEW_ROOT}/livecd.squashfs ${NEW_ROOT}/calculate; -+ then -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/workspace=rw:${NEW_ROOT}/delta=ro+wh:${NEW_ROOT}/calculate=ro none /union; -+ then -+ mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/delta=rw:${NEW_ROOT}/calculate=ro none /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers!' -+ run_shell -+ fi -+ else -+ if mount -t unionfs -o ro,dirs=${NEW_ROOT}/workspace:${NEW_ROOT}/delta=ro:${NEW_ROOT}/calculate=ro unionfs /union; -+ then -+ mount -t unionfs -o ro,dirs=${NEW_ROOT}/delta:${NEW_ROOT}/calculate=ro unionfs /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers' -+ run_shell -+ fi -+ fi -+ else -+ bad_msg 'Could not mount scratch squashfs image' -+ fi -+ else -+ bad_msg 'Could not remount ${NEW_ROOT}' -+ fi -+ else -+ bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -+ got_good_root=0 -+ REAL_ROOT='' -+ fi - fi - else - bad_msg "Could not mount specified ROOT, try again" -@@ -723,9 +837,12 @@ cd "${CHROOT}" - mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null - echo -ne "${BOLD}.${NORMAL}" - -+# stop udev before move mount points -+stop_udev -+ - # If devtmpfs is mounted, try move it to the new root - # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise --for fs in /dev /sys /proc -+for fs in "/dev " /sys /proc - do - if grep -qs "$fs" /proc/mounts - then -diff --git defaults/modprobe defaults/modprobe -index ba2d890..9280357 100755 ---- defaults/modprobe -+++ defaults/modprobe -@@ -10,8 +10,6 @@ usage() { - echo - echo 'Example:' - echo ' modprobe eepro100' -- echo -- echo 'Note: Do not pass the suffix to modprobe!' - exit 1 - } - -@@ -81,14 +79,29 @@ modprobe2() { - usage - exit 1 - fi -- real_path=`real_mod_path ${1}` -+ local modname=${1} -+ local quiet='' -+ local params='' -+ shift -+ for x in $@ -+ do -+ case ${x} in -+ -n) -+ quiet=1 -+ ;; -+ *) -+ params="${params} ${x}" -+ ;; -+ esac -+ done -+ real_path=`real_mod_path ${modname}` - if [ "${real_path}" = '' -o "${real_path}" = ' ' ] - then -- [ "${2}" = '-n' ] && echo -n " -> $1" -+ [ "${quiet}" = '1' ] && echo -n " -> ${modname}" - echo ' module not found.' - exit 2 - fi -- modlist=`modules_dep_list ${1}` -+ modlist=`modules_dep_list ${modname}` - if [ "${modlist}" != '' -a "${modlist}" != ' ' ] - then - deps=`strip_mod_paths ${modlist}` -@@ -110,13 +123,13 @@ modprobe2() { - filler=1 - fi - done -- ${INSMOD} ${real_path} > /dev/null 2>&1 -+ ${INSMOD} ${real_path} ${params} > /dev/null 2>&1 - ret=$? - if [ ${ret} -eq 0 ] - then - echoAppend=' loaded.' -- [ "${2}" = '-n' ] && echoFlags='-n' && echoAppend=', ' -- echo ${echoFlags} "${1}${echoAppend}" -+ [ "${quiet}" = '1' ] && echoFlags='-n' && echoAppend=', ' -+ echo ${echoFlags} "${modname}${echoAppend}" - fi - return $ret - } -@@ -132,7 +145,7 @@ do - LOADED_MODULES="${LOADED_MODULES} ${x}" - done - --modprobe2 ${1} -+modprobe2 ${@} - modprobe_ret=$? - - [ -f '/modules.cache' ] && rm -f /modules.cache > /dev/null 2>&1 -diff --git dracut_funcs.sh dracut_funcs.sh -new file mode 100755 -index 0000000..e80a638 ---- /dev/null -+++ dracut_funcs.sh -@@ -0,0 +1,752 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+# -+# functions used by dracut and other tools. -+# -+# Copyright 2005-2009 Red Hat, Inc. All rights reserved. -+# -+# 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; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+# -+ -+IF_RTLD="" -+IF_dynamic="" -+ -+# Generic substring function. If $2 is in $1, return 0. -+strstr() { [[ $1 =~ $2 ]]; } -+ -+# Create all subdirectories for given path without creating the last element. -+# $1 = path -+mksubdirs() { mkdir -p ${1%/*}; } -+ -+# Version comparision function. Assumes Linux style version scheme. -+# $1 = version a -+# $2 = comparision op (gt, ge, eq, le, lt, ne) -+# $3 = version b -+vercmp() { -+ local n1=(${1//./ }) op=$2 n2=(${3//./ }) i res -+ -+ for ((i=0; ; i++)) -+ do -+ if [[ ! ${n1[i]}${n2[i]} ]]; then res=0 -+ elif ((${n1[i]:-0} > ${n2[i]:-0})); then res=1 -+ elif ((${n1[i]:-0} < ${n2[i]:-0})); then res=2 -+ else continue -+ fi -+ break -+ done -+ -+ case $op in -+ gt) ((res == 1));; -+ ge) ((res != 2));; -+ eq) ((res == 0));; -+ le) ((res != 1));; -+ lt) ((res == 2));; -+ ne) ((res != 0));; -+ esac -+} -+ -+is_func() { -+ [[ $(type -t $1) = "function" ]] -+} -+ -+# Log initrd creation. -+if ! [[ $dracutlogfile ]]; then -+ [[ $dracutbasedir = /usr/share/dracut ]] && \ -+ dracutlogfile=/var/log/dracut.log || \ -+ dracutlogfile=/tmp/dracut.log -+# [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log -+ if [[ -w $dracutlogfile ]]; then -+ >"$dracutlogfile" -+ fi -+fi -+ -+dwarning() { -+ echo "W: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "W: $@" >>"$dracutlogfile" -+} -+ -+dinfo() { -+ [[ $beverbose ]] && echo "I: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "I: $@" >>"$dracutlogfile" -+} -+ -+derror() { -+ echo "E: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile" -+} -+ -+# Function prints global variables in format name=value line by line. -+# $@ = list of global variables' name -+print_vars() { -+ local var value -+ -+ for var in $@ -+ do -+ value=$(eval echo \$$var) -+ [[ ${value} ]] && echo "${var}=\"${value}\"" -+ done -+} -+ -+get_fs_env() { -+ [[ $1 ]] || return -+ eval $(udevadm info --query=env --name=$1|egrep 'ID_FS_(TYPE|UUID)=') -+ [[ $ID_FS_TYPE ]] && return -+ -+ if [[ -x /lib/udev/vol_id ]]; then -+ eval $(/lib/udev/vol_id --export $1) -+ elif find_binary blkid >/dev/null; then -+ eval $(blkid -o udev $1) -+ else -+ return 1 -+ fi -+} -+ -+get_fs_type() ( -+ [[ $1 ]] || return -+ if [[ $1 != ${1#/dev/block/nfs:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs3:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs4:} ]]; then -+ echo "nfs" -+ return -+ fi -+ get_fs_env $1 || return -+ echo $ID_FS_TYPE -+) -+ -+get_fs_uuid() ( -+ get_fs_env $1 || return -+ echo $ID_FS_UUID -+) -+ -+# finds the major:minor of the block device backing the root filesystem. -+find_block_device() { -+ local x mpt majmin dev fs misc maj min -+ if [[ $use_fstab != yes ]]; then -+ while read x x majmin x mpt x x fs dev misc; do -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $fs = btrfs ]] && { -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ } -+ if [[ $mpt = $1 ]] && [[ ${majmin#0:} = $majmin ]]; then -+ echo $majmin; -+ return 0 # we have a winner! -+ fi -+ done < /proc/self/mountinfo -+ fi -+ # fall back to /etc/fstab -+ while read dev mpt fs misc; do -+ if [[ $mpt = $1 ]]; then -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $dev != ${dev#UUID=} ]] && dev=/dev/disk/by-uuid/${dev#UUID=} -+ [[ $dev != ${dev#LABEL=} ]] && dev=/dev/disk/by-label/${dev#LABEL=} -+ [[ -b $dev ]] || return 1 # oops, not a block device. -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ fi -+ done < /etc/fstab -+ return 1; -+} -+ -+find_root_block_device() { find_block_device /; } -+ -+# Walk all the slave relationships for a given block device. -+# Stop when our helper function returns success -+# $1 = function to call on every found block device -+# $2 = block device in major:minor format -+check_block_and_slaves() { -+ local x -+ [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. -+ "$1" $2 && return -+ check_vol_slaves "$@" && return 0 -+ if [[ -f /sys/dev/block/$2/../dev ]]; then -+ check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0 -+ fi -+ [[ -d /sys/dev/block/$2/slaves ]] || return 1 -+ for x in /sys/dev/block/$2/slaves/*/dev; do -+ [[ -f $x ]] || continue -+ check_block_and_slaves $1 $(cat "$x") && return 0 -+ done -+ return 1 -+} -+ -+get_numeric_dev() { -+ ls -lH "$1" | { read a b c d maj min rest; printf "%d:%d" ${maj%%,} $min;} -+} -+ -+# ugly workaround for the lvm design -+# There is no volume group device, -+# so, there are no slave devices for volume groups. -+# Logical volumes only have the slave devices they really live on, -+# but you cannot create the logical volume without the volume group. -+# And the volume group might be bigger than the devices the LV needs. -+check_vol_slaves() { -+ for i in /dev/mapper/*; do -+ lv=$(get_numeric_dev $i) -+ if [[ $lv = $2 ]]; then -+ vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null) -+ # strip space -+ vg=$(echo $vg) -+ if [[ $vg ]]; then -+ for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \ -+ do -+ check_block_and_slaves $1 $(get_numeric_dev $pv) \ -+ && return 0 -+ done -+ fi -+ fi -+ done -+ return 1 -+} -+ -+# Install a directory, keeping symlinks as on the original system. -+# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file" -+# will create ${initdir}/lib64, ${initdir}/lib64/file, -+# and a symlink ${initdir}/lib -> lib64. -+inst_dir() { -+ local dir="$1" -+ [[ -e ${initdir}$dir ]] && return 0 -+ -+ # iterate over parent directories -+ local file="" -+ local IFS="/" -+ for part in $dir; do -+ [[ $part ]] || continue -+ file="$file/$part" -+ [[ -e ${initdir}$file ]] && continue -+ -+ if [[ -L $file ]]; then -+ # create link as the original -+ local target=$(readlink "$file") -+ ln -sfn "$target" "${initdir}$file" || return 1 -+ # resolve relative path and recursively install destionation -+ [[ $target = ${target##*/} ]] && target="${file%/*}/$target" -+ inst_dir "$target" -+ else -+ # create directory -+ mkdir -p "${initdir}$file" || return 1 -+ fi -+ done -+} -+ -+# $1 = file to copy to ramdisk -+# $2 (optional) Name for the file on the ramdisk -+# Location of the image dir is assumed to be $initdir -+# We never overwrite the target if it exists. -+inst_simple() { -+ local src target -+ [[ -f $1 ]] || return 1 -+ src=$1 target="${2:-$1}" -+ if ! [[ -d ${initdir}$target ]]; then -+ [[ -e ${initdir}$target ]] && return 0 -+ inst_dir "${target%/*}" -+ fi -+ dinfo "Installing $src" -+ cp -pfL "$src" "${initdir}$target" -+} -+ -+# find symlinks linked to given library file -+# $1 = library file -+# Function searches for symlinks by stripping version numbers appended to -+# library filename, checks if it points to the same target and finally -+# prints the list of symlinks to stdout. -+# -+# Example: -+# rev_lib_symlinks libfoo.so.8.1 -+# output: libfoo.so.8 libfoo.so -+# (Only if libfoo.so.8 and libfoo.so exists on host system.) -+rev_lib_symlinks() { -+ [[ ! $1 ]] && return 0 -+ -+ local fn="$1" orig="$(readlink -f "$1")" links='' -+ -+ [[ ${fn} =~ .*\.so\..* ]] || return 1 -+ -+ until [[ ${fn##*.} == so ]]; do -+ fn="${fn%.*}" -+ [[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}" -+ done -+ -+ echo ${links} -+} -+ -+# Same as above, but specialized to handle dynamic libraries. -+# It handles making symlinks according to how the original library -+# is referenced. -+inst_library() { -+ local src=$1 dest=${2:-$1} lib reallib symlink -+ [[ -e $initdir$dest ]] && return 0 -+ if [[ -L $src ]]; then -+ reallib=$(readlink -f "$src") -+ lib=${src##*/} -+ inst_simple "$reallib" "$reallib" -+ inst_dir "${dest%/*}" -+ (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib") -+ else -+ inst_simple "$src" "$dest" -+ fi -+ -+ # Create additional symlinks. See rev_symlinks description. -+ for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do -+ [[ ! -e $initdir$symlink ]] && { -+ dinfo "Creating extra symlink: $symlink" -+ inst_symlink $symlink -+ } -+ done -+} -+ -+# find a binary. If we were not passed the full path directly, -+# search in the usual places to find the binary. -+find_binary() { -+ local binpath="/bin /sbin /usr/bin /usr/sbin" p -+ [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } -+ for p in $binpath; do -+ [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# Same as above, but specialized to install binary executables. -+# Install binary executable, and all shared library dependencies, if any. -+inst_binary() { -+ local bin target -+ bin=$(find_binary "$1") || return 1 -+ target=${2:-$bin} -+ inst_symlink $bin $target && return 0 -+ local LDSO NAME IO FILE ADDR I1 n f TLIBDIR -+ [[ -e $initdir$target ]] && return 0 -+ # I love bash! -+ LC_ALL=C ldd $bin 2>/dev/null | while read line; do -+ [[ $line = 'not a dynamic executable' ]] && return 1 -+ if [[ $line =~ not\ found ]]; then -+ derror "Missing a shared library required by $bin." -+ derror "Run \"ldd $bin\" to find out what it is." -+ derror "dracut cannot create an initrd." -+ exit 1 -+ fi -+ so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)' -+ [[ $line =~ $so_regex ]] || continue -+ FILE=${BASH_REMATCH[1]} -+ [[ -e ${initdir}$FILE ]] && continue -+ # see if we are loading an optimized version of a shared lib. -+ lib_regex='^(/lib[^/]*).*' -+ if [[ $FILE =~ $lib_regex ]]; then -+ TLIBDIR=${BASH_REMATCH[1]} -+ BASE=${FILE##*/} -+ # prefer nosegneg libs, then unoptimized ones. -+ for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do -+ [[ -e $f/$BASE ]] || continue -+ FILE=$f/$BASE -+ break -+ done -+ inst_library "$FILE" "$TLIBDIR/$BASE" -+ IF_dynamic=yes -+ continue -+ fi -+ inst_library "$FILE" -+ done -+ inst_simple "$bin" "$target" -+} -+ -+# same as above, except for shell scripts. -+# If your shell script does not start with shebang, it is not a shell script. -+inst_script() { -+ [[ -f $1 ]] || return 1 -+ local line -+ read -r -n 80 line <"$1" -+ # If debug is set, clean unprintable chars to prevent messing up the term -+ [[ $debug ]] && line=$(echo -n "$line" | tr -c -d '[:print:][:space:]') -+ shebang_regex='(#! *)(/[^ ]+).*' -+ [[ $line =~ $shebang_regex ]] || return 1 -+ inst "${BASH_REMATCH[2]}" && inst_simple "$@" -+} -+ -+# same as above, but specialized for symlinks -+inst_symlink() { -+ local src=$1 target=$initdir${2:-$1} realsrc -+ [[ -L $1 ]] || return 1 -+ [[ -L $target ]] && return 0 -+ realsrc=$(readlink -f "$src") -+ [[ $realsrc = ${realsrc##*/} ]] && realsrc=${src%/*}/$realsrc -+ inst "$realsrc" && mkdir -p "${target%/*}" && \ -+ ln -s "$realsrc" "$target" -+} -+ -+# find a udev rule in the usual places. -+find_rule() { -+ [[ -f $1 ]] && { echo "$1"; return 0; } -+ for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do -+ [[ -f $r/$1 ]] && { echo "$r/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# udev rules always get installed in the same place, so -+# create a function to install them to make life simpler. -+inst_rules() { -+ local target=/etc/udev/rules.d rule found -+ -+ inst_dir "/lib/udev/rules.d" -+ inst_dir "$target" -+ for rule in "$@"; do -+ found=$(find_rule "$rule") && \ -+ inst_simple "$found" "$target/${found##*/}" \ -+ || dinfo "Skipping udev rule: $rule" -+ done -+} -+ -+# general purpose installation function -+# Same args as above. -+inst() { -+ case $# in -+ 1) ;; -+ 2) [[ ! $initdir && -d $2 ]] && export initdir=$2 -+ [[ $initdir = $2 ]] && set $1;; -+ 3) [[ -z $initdir ]] && export initdir=$2 -+ set $1 $3;; -+ *) derror "inst only takes 1 or 2 or 3 arguments" -+ exit 1;; -+ esac -+ for x in inst_symlink inst_script inst_binary inst_simple; do -+ $x "$@" && return 0 -+ done -+ return 1 -+} -+ -+# install function specialized for hooks -+# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook -+# All hooks should be POSIX/SuS compliant, they will be sourced by init. -+inst_hook() { -+ if ! [[ -f $3 ]]; then -+ derror "Cannot install a hook ($3) that does not exist." -+ derror "Aborting initrd creation." -+ exit 1 -+ elif ! strstr "$hookdirs" "$1"; then -+ derror "No such hook type $1. Aborting initrd creation." -+ exit 1 -+ fi -+ inst_simple "$3" "/${1}/${2}${3##*/}" -+} -+ -+dracut_install() { -+ if [[ $1 = '-o' ]]; then -+ local optional=yes -+ shift -+ fi -+ while (($# > 0)); do -+ if ! inst "$1" ; then -+ if [[ $optional = yes ]]; then -+ dwarning "Skipping program $1 as it cannot be found and is flagged to be optional" -+ else -+ derror "Failed to install $1" -+ exit 1 -+ fi -+ fi -+ shift -+ done -+} -+ -+# install function decompressing the target and handling symlinks -+# $@ = list of compressed (gz or bz2) files or symlinks pointing to such files -+# -+# Function install targets in the same paths inside overlay but decompressed -+# and without extensions (.gz, .bz2). -+inst_decompress() { -+ local src dst realsrc realdst cmd -+ -+ for src in $@ -+ do -+ case ${src} in -+ *.gz) cmd='gzip -d' ;; -+ *.bz2) cmd='bzip2 -d' ;; -+ *) return 1 ;; -+ esac -+ -+ if [[ -L ${src} ]] -+ then -+ realsrc="$(readlink -f ${src})" # symlink target with extension -+ dst="${src%.*}" # symlink without extension -+ realdst="${realsrc%.*}" # symlink target without extension -+ mksubdirs "${initdir}/${src}" -+ # Create symlink without extension to target without extension. -+ ln -s "${realdst}" "${initdir}/${dst}" -+ fi -+ -+ # If the source is symlink we operate on its target. -+ [[ ${realsrc} ]] && src=${realsrc} -+ inst ${src} -+ # Decompress with chosen tool. We assume that tool changes name e.g. -+ # from 'name.gz' to 'name'. -+ ${cmd} "${initdir}${src}" -+ done -+} -+ -+# It's similar to above, but if file is not compressed, performs standard -+# install. -+# $@ = list of files -+inst_opt_decompress() { -+ local src -+ -+ for src in $@ -+ do -+ inst_decompress "${src}" || inst "${src}" -+ done -+} -+ -+module_check() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we are unconditionally included -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check $hostonly -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func check || return 0 -+ check -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_depends() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we have no deps -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check -d -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func depends || return 0 -+ depends -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_install() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/install ]] && . "$moddir/install" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func install || return 0 -+ install -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_installkernel() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/installkernel ]] && . "$moddir/installkernel" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func installkernel || return 0 -+ installkernel -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+check_module() { -+ local mod=$1; -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ local moddep; -+ # If we are already scheduled to be loaded, no need to check again. -+ strstr " $mods_to_load " " $mod " && return 0 -+ strstr " $mods_checked_as_dep " " $mod " && return 1 -+ -+ # This should never happen, but... -+ [[ -d $moddir ]] || return 1 -+ -+ [[ $2 ]] || mods_checked_as_dep+=" $mod " -+ -+ strstr " $omit_dracutmodules " " $mod " && return 1 -+ -+ if strstr " $dracutmodules $add_dracutmodules " " $mod "; then -+ module_check $mod; ret=$? -+ # explicit module, so also accept ret=255 -+ [[ $ret = 0 || $ret = 255 ]] || return 1 -+ else -+ # module not in our list -+ if [[ $dracutmodules = all ]]; then -+ # check, if we can and should install this module -+ module_check $mod || return 1 -+ else -+ # skip this module -+ return 1 -+ fi -+ fi -+ -+ for moddep in $(module_depends $mod); do -+ # handle deps as if they were manually added -+ strstr " $add_dracutmodules " " $moddep " || \ -+ add_dracutmodules+=" $moddep " -+ # if a module we depend on fail, fail also -+ check_module $moddep || return 1 -+ done -+ -+ strstr " $mods_to_load " " $mod " || \ -+ mods_to_load+=" $mod " -+ -+ return 0 -+} -+ -+check_module_dir() { -+ local modcheck; -+ local mod; -+ mods_to_load="" -+ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do -+ local mod=${moddir##*/}; mod=${mod#[0-9][0-9]} -+ check_module $mod 1 -+ done -+} -+ -+# Install a single kernel module along with any firmware it may require. -+# $1 = full path to kernel module to install -+install_kmod_with_fw() { -+ local modname=${1##*/} fwdir found -+ modname=${modname%.ko*} -+ inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \ -+ return 0 # no need to go further if the module is already installed -+ for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do -+ found='' -+ for fwdir in $fw_dir; do -+ if [[ -d $fwdir && -f $fwdir/$fw ]]; then -+ inst_simple "$fwdir/$fw" "/lib/firmware/$fw" -+ found=yes -+ fi -+ done -+ if [[ $found != yes ]]; then -+ dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\"" -+ fi -+ done -+} -+ -+# Do something with all the dependencies of a kernel module. -+# Note that kernel modules depend on themselves using the technique we use -+# $1 = function to call for each dependency we find -+# It will be passed the full path to the found kernel module -+# $2 = module to get dependencies for -+# rest of args = arguments to modprobe -+for_each_kmod_dep() { -+ local func=$1 kmod=$2 cmd modpapth options -+ shift 2 -+ modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \ -+ while read cmd modpath options; do -+ [[ $cmd = insmod ]] || continue -+ $func $modpath -+ done -+} -+ -+# filter kernel modules to install certain modules that meet specific -+# requirements. -+# $1 = function to call with module name to filter. -+# This function will be passed the full path to the module to test. -+# The behaviour of this function can vary depending on whether $hostonly is set. -+# If it is, we will only look at modules that are already in memory. -+# If it is not, we will look at all kernel modules -+# This function returns the full filenames of modules that match $1 -+filter_kernel_modules () ( -+ if ! [[ $hostonly ]]; then -+ filtercmd='find "$srcmods/kernel/drivers" "$srcmods/extra" "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz" 2>/dev/null' -+ else -+ filtercmd='cut -d " " -f 1 /dev/null' -+ fi -+ for modname in $(eval $filtercmd); do -+ case $modname in -+ *.ko) "$1" "$modname" && echo "$modname";; -+ *.ko.gz) gzip -dc "$modname" > $initdir/$$.ko -+ $1 $initdir/$$.ko && echo "$modname" -+ rm -f $initdir/$$.ko;; -+ esac -+ done -+) -+ -+# install kernel modules along with all their dependencies. -+instmods() { -+ [[ $no_kernel = yes ]] && return -+ local mod mpargs modpath modname cmd moddirname -+ while (($# > 0)); do -+ mod=${1%.ko*} -+ case $mod in -+ =*) -+ # This introduces 2 incompatible meanings for =* arguments -+ # to instmods. We need to decide which one to keep. -+ if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then -+ instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block") -+ elif [ -f $srcmods/modules.${mod#=} ]; then -+ instmods $mpargs $(cat ${srcmods}/modules.${mod#=} ) -+ else -+ instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*") -+ fi -+ ;; -+ --*) -+ mod=${mod##*/} -+ mpargs+=" $mod";; -+ i2o_scsi) shift; continue;; # Do not load this diagnostic-only module -+ *) mod=${mod##*/} -+ # if we are already installed, skip this module and go on -+ # to the next one. -+ [[ -f $initdir/$1 ]] && { shift; continue; } -+ # If we are building a host-specific initramfs and this -+ # module is not already loaded, move on to the next one. -+ [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \ -+ ! echo $add_drivers | grep -qe "\<${mod}\>" && { -+ shift; continue; -+ } -+ -+ # We use '-d' option in modprobe only if modules prefix path -+ # differs from default '/'. This allows us to use Dracut with -+ # old version of modprobe which doesn't have '-d' option. -+ moddirname=${srcmods%%/lib/modules/*} -+ [[ -n ${moddirname} ]] && moddirname="-d ${moddirname}/" -+ -+ # ok, load the module, all its dependencies, and any firmware -+ # it may require -+ for_each_kmod_dep install_kmod_with_fw $mod \ -+ --set-version $kernel ${moddirname} -+ ;; -+ esac -+ shift -+ done -+} -diff --git gen_cmdline.sh gen_cmdline.sh -index b3e451d..bc9f2dc 100755 ---- gen_cmdline.sh -+++ gen_cmdline.sh -@@ -22,6 +22,7 @@ longusage() { - echo " --logfile= Output file for debug info" - echo " --color Output debug in color" - echo " --no-color Do not output debug in color" -+ echo " --no-cleartmp Do not clear temp directory" - echo " Kernel Configuration settings" - echo " --menuconfig Run menuconfig after oldconfig" - echo " --no-menuconfig Do not run menuconfig after oldconfig" -@@ -78,6 +79,8 @@ longusage() { - echo " --splash-res= Select splash theme resolutions to install" - echo " --do-keymap-auto Forces keymap selection at boot" - echo " --no-keymap Disables keymap selection support" -+ echo " --udev Include udev in the initramfs" -+ echo " --no-udev Exclude udev from the initramfs" - echo " --lvm Include LVM support" - echo " --mdadm Include MDADM/MDMON support" - echo " --mdadm-config= Use file as mdadm.conf in initramfs" -@@ -97,6 +100,8 @@ longusage() { - echo " --unionfs Include support for unionfs" - echo " --netboot Create a self-contained env in the initramfs" - echo " --real-root= Specify a default for real_root=" -+ echo " --lscpi Include lspci into the initramfs" -+ echo " --no-lscpi Exclude lspci from the initramfs" - echo " Internals" - echo " --arch-override= Force to arch instead of autodetect" - echo " --cachedir= Override the default cache location" -@@ -232,6 +237,22 @@ parse_cmdline() { - CMD_KEYMAP=0 - print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" - ;; -+ --udev) -+ CMD_UDEV=1 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --no-udev) -+ CMD_UDEV=0 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --lspci) -+ CMD_LSPCI=1 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --no-lspci) -+ CMD_UDEV=0 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; - --lvm) - CMD_LVM=1 - print_info 2 "CMD_LVM: ${CMD_LVM}" -@@ -441,6 +462,10 @@ parse_cmdline() { - print_info 2 "USECOLOR: ${USECOLOR}" - setColorVars - ;; -+ --no-cleartmp) -+ NOCLEARTMP=1 -+ print_info 2 "NOCLEARTMP: ${NOCLEARTMP}" -+ ;; - --logfile=*) - CMD_LOGFILE=`parse_opt "$*"` - LOGFILE=`parse_opt "$*"` -diff --git gen_compile.sh gen_compile.sh -index 0758c3a..8a2339a 100755 ---- gen_compile.sh -+++ gen_compile.sh -@@ -407,7 +407,10 @@ compile_busybox() { - yes '' 2>/dev/null | compile_generic oldconfig utils - - print_info 1 'busybox: >> Compiling...' -+ OLDLOGLEVEL=$LOGLEVEL -+ LOGLEVEL=1 - compile_generic all utils -+ LOGLEVEL=$OLDLOGLEVEL - print_info 1 'busybox: >> Copying to cache...' - [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] || - gen_die 'Busybox executable does not exist!' -diff --git gen_determineargs.sh gen_determineargs.sh -index ce479cb..bda14b8 100755 ---- gen_determineargs.sh -+++ gen_determineargs.sh -@@ -107,6 +107,8 @@ determine_real_args() { - set_config_with_override BOOL SYMLINK CMD_SYMLINK - set_config_with_override STRING INSTALL_MOD_PATH CMD_INSTALL_MOD_PATH - set_config_with_override BOOL OLDCONFIG CMD_OLDCONFIG -+ set_config_with_override BOOL UDEV CMD_UDEV -+ set_config_with_override BOOL LSPCI CMD_LSPCI - set_config_with_override BOOL LVM CMD_LVM - set_config_with_override BOOL DMRAID CMD_DMRAID - set_config_with_override BOOL ISCSI CMD_ISCSI -diff --git gen_initramfs.sh gen_initramfs.sh -index 7fe4421..76b6645 100755 ---- gen_initramfs.sh -+++ gen_initramfs.sh -@@ -56,7 +56,13 @@ append_busybox() { - chmod +x "${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/default.script" - - # Set up a few default symlinks -- for i in ${BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}; do -+ if isTrue "${UDEV}" -+ then -+ BUSYBOX_APPLETS="${BUSYBOX_APPLETS:-[ ash sh uname echo cut cat}" -+ else -+ BUSYBOX_APPLETS="{$BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}" -+ fi -+ for i in ${BUSYBOX_APPLETS}; do - rm -f ${TEMP}/initramfs-busybox-temp/bin/$i > /dev/null - ln -s busybox ${TEMP}/initramfs-busybox-temp/bin/$i || - gen_die "Busybox error: could not link ${i}!" -@@ -410,7 +416,7 @@ append_firmware() { - IFS="," - for i in ${FIRMWARE_FILES} - do -- cp -L "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ -+ cp -rL "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ - done - IFS=$OLD_IFS - else -@@ -438,9 +444,71 @@ append_gpg() { - chmod a+x "${TEMP}/initramfs-gpg-temp/sbin/gpg" - cd "${TEMP}/initramfs-gpg-temp/" - find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" - rm -rf "${TEMP}/initramfs-gpg-temp" > /dev/null - } - -+append_udev() { -+ if [ -d "${TEMP}/initramfs-udev-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-udev-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-udev-temp/" -+ udevmod="${GK_SHARE}/modules/udev-rules/" -+ source ${udevmod}/module-setup.sh -+ initdir=${TEMP}/initramfs-udev-temp \ -+ moddir=${udevmod} \ -+ libdir=/lib/ \ -+ usrlibdir=/usr/lib/ \ -+ install_module -+ -+ if isTrue $LSPCI -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ fi -+ # find net modules and sound -+ (for pathname in ${INSTALL_MOD_PATH}/lib/modules/${KV}/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/drivers/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/sound -+ do -+ [[ -d $pathname ]] && find $pathname -name "*.ko" -+ done | -+ while read module;do -+ # add them prefix blacklist -+ echo "blacklist `basename $module .ko`"; -+ # concat with ready blacklist.conf -+ done;cat "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf") | -+ # sort and rewrite blacklist.conf -+ sort | uniq > "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" -+ mv "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" \ -+ "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf" -+ -+ cd "${TEMP}/initramfs-udev-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-udev-temp" > /dev/null -+} -+ -+append_lspci() { -+ if [ -d "${TEMP}/initramfs-lspci-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-lspci-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-lspci-temp/" -+ -+ initdir=${TEMP}/initramfs-lspci-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ -+ cd "${TEMP}/initramfs-lspci-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-lspci-temp" > /dev/null -+} -+ - print_list() - { - local x -@@ -489,6 +557,11 @@ append_modules() { - print_list ${!group_modules} > "${TEMP}/initramfs-modules-${KV}-temp/etc/modules/${group}" - done - cd "${TEMP}/initramfs-modules-${KV}-temp/" -+ # remove sound and media -+ for x in `find . -type d -name media -o -type d -name sound` -+ do -+ rm -r "${x}" &>/dev/null -+ done - find . | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ - || gen_die "compressing modules cpio" - cd "${TEMP}" -@@ -561,11 +634,14 @@ append_auxilary() { - done - echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" - -- if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ if ! isTrue "${UDEV}" - then -- cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -- else -- cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ then -+ cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ else -+ cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ fi - fi - if isTrue $CMD_DOKEYMAPAUTO - then -@@ -582,7 +658,7 @@ append_auxilary() { - chmod +x "${TEMP}/initramfs-aux-temp/init" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" -- chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ isTrue "${UDEV}" || chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" - - if isTrue ${NETBOOT} - then -@@ -609,6 +685,21 @@ append_data() { - fi - } - -+pack_cpio() { -+ print_info 1 " >> Pack cpio data..." -+ if [ -d "${TEMP}/initramfs-repack-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-repack-temp" -+ fi -+ mkdir -p "${TEMP}/initramfs-repack-temp" -+ cd "${TEMP}/initramfs-repack-temp" -+ # unpack and pack cpio remove double files -+ cpio -di <${CPIO} 2>/dev/null -+ find . -print | cpio ${CPIO_ARGS} | gzip -9 >"${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-repack-temp" > /dev/null -+} -+ - create_initramfs() { - print_info 1 "initramfs: >> Initializing..." - -@@ -619,6 +710,11 @@ create_initramfs() { - - append_data 'base_layout' - append_data 'auxilary' "${BUSYBOX}" -+ append_data 'udev' "${UDEV}" -+ if ! isTrue "${UDEV}" -+ then -+ append_data 'lspci' "${LSPCI}" -+ fi - append_data 'busybox' "${BUSYBOX}" - append_data 'lvm' "${LVM}" - append_data 'dmraid' "${DMRAID}" -@@ -652,8 +748,7 @@ create_initramfs() { - append_data 'overlay' - fi - -- gzip -9 "${CPIO}" -- mv -f "${CPIO}.gz" "${CPIO}" -+ pack_cpio - - if isTrue "${INTEGRATED_INITRAMFS}" - then -diff --git genkernel genkernel -index 0a06cdd..1486c61 100755 ---- genkernel -+++ genkernel -@@ -9,6 +9,7 @@ GK_V='3.4.18' - TMPDIR='/var/tmp/genkernel' - - TODEBUGCACHE=1 # Until an error occurs or LOGFILE is fully qualified. -+NOCLEARTMP=0 - - small_die() { - echo $1 -@@ -45,6 +46,7 @@ source ${GK_SHARE}/gen_initramfs.sh || gen_die "Could not read ${GK_SHARE}/gen_i - source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_moddeps.sh" - source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh" - source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh" -+source ${GK_SHARE}/dracut_funcs.sh || gen_die "Could not read ${GK_SHARE}/dracut_funcs.sh" - - TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ - -@@ -55,21 +57,25 @@ trap_cleanup(){ - } - - cleanup(){ -- if [ -n "$TEMP" -a -d "$TEMP" ]; then -- rm -rf "$TEMP" -- fi -- -- if isTrue ${POSTCLEAR} -- then -- echo -- print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -- print_info 1 "CACHE_DIR: ${CACHE_DIR}" -- CLEAR_CACHE_DIR='yes' -- setup_cache_dir -- echo -- print_info 1 "TMPDIR: ${TMPDIR}" -- clear_tmpdir -- fi -+ if [[ ${NOCLEARTMP} -ne 0 ]] -+ then -+ return -+ fi -+ if [ -n "$TEMP" -a -d "$TEMP" ]; then -+ rm -rf "$TEMP" &>/dev/null -+ fi -+ -+ if isTrue ${POSTCLEAR} -+ then -+ echo -+ print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -+ print_info 1 "CACHE_DIR: ${CACHE_DIR}" -+ CLEAR_CACHE_DIR='yes' -+ setup_cache_dir -+ echo -+ print_info 1 "TMPDIR: ${TMPDIR}" -+ clear_tmpdir -+ fi - } - - trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL -diff --git genkernel.conf genkernel.conf -index 24fcd54..41f8e06 100644 ---- genkernel.conf -+++ genkernel.conf -@@ -52,6 +52,12 @@ USECOLOR="yes" - # argument is: *+1 - # MAKEOPTS="-j2" - -+# Add udev to initramfs -+UDEV="yes" -+ -+# Add lspci to initramfs -+LSPCI="yes" -+ - # Add in LVM support from static binaries if they exist on the system, or - # compile static LVM binaries if static ones do not exist. - # LVM="no" -@@ -92,7 +98,7 @@ USECOLOR="yes" - # Specify directory to pull from - # FIRMWARE_DIR="/lib/firmware" - # Specify specific firmware files to include. This overrides FIRMWARE_DIR --# FIRMWARE_FILES="" -+FIRMWARE_FILES="/lib/firmware/radeon" - - # Enable disklabel support (copies blkid to initrd) - DISKLABEL="yes" -diff --git modules/udev-rules/01-ignore.rules modules/udev-rules/01-ignore.rules -new file mode 100644 -index 0000000..b32f22e ---- /dev/null -+++ modules/udev-rules/01-ignore.rules -@@ -0,0 +1 @@ -+KERNEL=="ram[0-9]*", OPTIONS+="ignore_device", OPTIONS+="last_rule" -diff --git modules/udev-rules/59-persistent-storage-volid.rules modules/udev-rules/59-persistent-storage-volid.rules -new file mode 100644 -index 0000000..0b798e6 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage-volid.rules -@@ -0,0 +1,7 @@ -+SUBSYSTEM!="block", GOTO="psv_end" -+ACTION!="add|change", GOTO="psv_end" -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="cciss[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", IMPORT{program}="vol_id --export $tempnode" -+LABEL="psv_end" -diff --git modules/udev-rules/59-persistent-storage.rules modules/udev-rules/59-persistent-storage.rules -new file mode 100644 -index 0000000..2b83e72 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage.rules -@@ -0,0 +1,38 @@ -+SUBSYSTEM!="block", GOTO="ps_end" -+ACTION!="add|change", GOTO="ps_end" -+ -+KERNEL=="cciss[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end" -+ -+# partitions have no md/{array_state,metadata_version} -+ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" -+ -+# container devices have a metadata version of e.g. 'external:ddf' and -+# never leave state 'inactive' -+ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -+TEST!="md/array_state", GOTO="md_end" -+ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -+ -+LABEL="md_ignore_state" -+ -+IMPORT{program}="/sbin/mdadm --detail --export $tempnode" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+OPTIONS+="link_priority=100" -+OPTIONS+="watch" -+LABEL="md_end" -+ -+ -+KERNEL!="dm-[0-9]*", GOTO="ps_end" -+ACTION=="add", GOTO="ps_end" -+IMPORT{program}="/sbin/dmsetup info -c --nameprefixes --unquoted --rows --noheadings -o name,uuid,suspended,readonly,major,minor,open,tables_loaded,names_using_dev -j%M -m%m" -+ENV{DM_NAME}!="?*", GOTO="ps_end" -+ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="ps_end" -+ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="ps_end" -+ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="ps_end" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+LABEL="ps_end" -diff --git modules/udev-rules/61-persistent-storage.rules modules/udev-rules/61-persistent-storage.rules -new file mode 100644 -index 0000000..9cfdb0b ---- /dev/null -+++ modules/udev-rules/61-persistent-storage.rules -@@ -0,0 +1,20 @@ -+SUBSYSTEM!="block", GOTO="pss_end" -+ACTION!="add|change", GOTO="pss_end" -+ -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss" -+KERNEL=="cciss[0-9]*", GOTO="do_pss" -+KERNEL=="nbd[0-9]*", GOTO="do_pss" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", GOTO="do_pss" -+ -+GOTO="pss_end" -+ -+LABEL="do_pss" -+# by-path (parent device path) -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{program}="path_id %p" -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" -+ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" -+ -+# by-label/by-uuid links (filesystem metadata) -+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -+LABEL="pss_end" -diff --git modules/udev-rules/blacklist.conf modules/udev-rules/blacklist.conf -new file mode 100644 -index 0000000..21ac71c ---- /dev/null -+++ modules/udev-rules/blacklist.conf -@@ -0,0 +1,162 @@ -+blacklist ath_pci -+blacklist evbug -+blacklist usbmouse -+blacklist usbkbd -+blacklist eepro100 -+blacklist de4x5 -+blacklist eth1394 -+blacklist snd_intel8x0m -+blacklist snd_aw2 -+blacklist i2c_i801 -+blacklist prism54 -+blacklist bcm43xx -+blacklist garmin_gps -+blacklist asus_acpi -+blacklist snd_pcsp -+blacklist pcspkr -+blacklist amd76x_edac -+blacklist ohci1394 -+blacklist sbp2 -+blacklist dv1394 -+blacklist raw1394 -+blacklist video1394 -+blacklist aty128fb -+blacklist atyfb -+blacklist radeonfb -+blacklist cirrusfb -+blacklist cyber2000fb -+blacklist cyblafb -+blacklist gx1fb -+blacklist hgafb -+blacklist i810fb -+blacklist intelfb -+blacklist kyrofb -+blacklist lxfb -+blacklist matroxfb_base -+blacklist neofb -+blacklist nvidiafb -+blacklist pm2fb -+blacklist rivafb -+blacklist s1d13xxxfb -+blacklist savagefb -+blacklist sisfb -+blacklist sstfb -+blacklist tdfxfb -+blacklist tridentfb -+blacklist vesafb -+blacklist vfb -+blacklist viafb -+blacklist vt8623fb -+blacklist ac97 -+blacklist ac97_codec -+blacklist ac97_plugin_ad1980 -+blacklist ad1848 -+blacklist ad1889 -+blacklist adlib_card -+blacklist aedsp16 -+blacklist ali5455 -+blacklist btaudio -+blacklist cmpci -+blacklist cs4232 -+blacklist cs4281 -+blacklist cs461x -+blacklist cs46xx -+blacklist emu10k1 -+blacklist es1370 -+blacklist es1371 -+blacklist esssolo1 -+blacklist forte -+blacklist gus -+blacklist i810_audio -+blacklist kahlua -+blacklist mad16 -+blacklist maestro -+blacklist maestro3 -+blacklist maui -+blacklist mpu401 -+blacklist nm256_audio -+blacklist opl3 -+blacklist opl3sa -+blacklist opl3sa2 -+blacklist pas2 -+blacklist pss -+blacklist rme96xx -+blacklist sb -+blacklist sb_lib -+blacklist sgalaxy -+blacklist sonicvibes -+blacklist sound -+blacklist sscape -+blacklist trident -+blacklist trix -+blacklist uart401 -+blacklist uart6850 -+blacklist via82cxxx_audio -+blacklist v_midi -+blacklist wavefront -+blacklist ymfpci -+blacklist ac97_plugin_wm97xx -+blacklist ad1816 -+blacklist audio -+blacklist awe_wave -+blacklist dmasound_core -+blacklist dmasound_pmac -+blacklist harmony -+blacklist sequencer -+blacklist soundcard -+blacklist usb-midi -+blacklist acquirewdt -+blacklist advantechwdt -+blacklist alim1535_wdt -+blacklist alim7101_wdt -+blacklist booke_wdt -+blacklist cpu5wdt -+blacklist eurotechwdt -+blacklist i6300esb -+blacklist i8xx_tco -+blacklist ib700wdt -+blacklist ibmasr -+blacklist indydog -+blacklist iTCO_wdt -+blacklist it8712f_wdt -+blacklist it87_wdt -+blacklist ixp2000_wdt -+blacklist ixp4xx_wdt -+blacklist machzwd -+blacklist mixcomwd -+blacklist mpc8xx_wdt -+blacklist mpcore_wdt -+blacklist mv64x60_wdt -+blacklist pc87413_wdt -+blacklist pcwd -+blacklist pcwd_pci -+blacklist pcwd_usb -+blacklist s3c2410_wdt -+blacklist sa1100_wdt -+blacklist sbc60xxwdt -+blacklist sbc7240_wdt -+blacklist sb8360 -+blacklist sc1200wdt -+blacklist sc520_wdt -+blacklist sch311_wdt -+blacklist scx200_wdt -+blacklist shwdt -+blacklist smsc37b787_wdt -+blacklist softdog -+blacklist twl4030_wdt -+blacklist w83627hf_wdt -+blacklist w83697hf_wdt -+blacklist w83697ug_wdt -+blacklist w83877f_wdt -+blacklist w83977f_wdt -+blacklist wafer5823wdt -+blacklist wdt -+blacklist wdt_pci -+blacklist wm8350_wdt -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -diff --git modules/udev-rules/load-modules.sh modules/udev-rules/load-modules.sh -new file mode 100755 -index 0000000..36972fd ---- /dev/null -+++ modules/udev-rules/load-modules.sh -@@ -0,0 +1,7 @@ -+#!/bin/sh -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+# Implement blacklisting for udev-loaded modules -+ -+modprobe -b "$@" -diff --git modules/udev-rules/module-setup.sh modules/udev-rules/module-setup.sh -new file mode 100755 -index 0000000..1005627 ---- /dev/null -+++ modules/udev-rules/module-setup.sh -@@ -0,0 +1,57 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+install_module() { -+ # FIXME: would be nice if we didn't have to know which rules to grab.... -+ # ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies -+ # of the rules we want so that we just copy those in would be best -+ dracut_install udevd udevadm /etc/udev/udev.conf /etc/group /bin/mount /sbin/modprobe -+ inst_rules 50-udev-default.rules 60-persistent-storage.rules \ -+ 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \ -+ 60-pcmcia.rules -+ mkdir -p "$initdir"/etc/modprobe.d -+ inst_simple "$moddir/blacklist.conf" /etc/modprobe.d/ -+ -+ # ignore some devices in the initrd -+ inst_rules "$moddir/01-ignore.rules" -+ -+ # for firmware loading -+ inst_rules 50-firmware.rules -+ -+ if [ ! -x /lib/udev/vol_id ]; then -+ inst_rules "$moddir/59-persistent-storage.rules" -+ else -+ inst_rules "$moddir/59-persistent-storage-volid.rules" -+ fi -+ inst_rules "$moddir/61-persistent-storage.rules" -+ -+ for i in \ -+ ata_id \ -+ cdrom_id \ -+ create_floppy_devices \ -+ edd_id \ -+ firmware.sh \ -+ firmware \ -+ firmware.agent \ -+ hotplug.functions \ -+ fw_unit_symlinks.sh \ -+ hid2hci \ -+ path_id \ -+ scsi_id \ -+ usb_id \ -+ vol_id \ -+ pcmcia-socket-startup \ -+ pcmcia-check-broken-cis \ -+ ; do -+ for utilpath in /lib/udev /sbin /bin -+ do -+ [ -e $utilpath/$i ] && dracut_install $utilpath/$i -+ done -+ done -+ -+ for i in {"$libdir","$usrlibdir"}/libnss_files*; do -+ [ -e "$i" ] && dracut_install "$i" -+ done -+} -+ diff --git a/sys-kernel/calckernel/files/calckernel-3.4.18-r6.patch b/sys-kernel/calckernel/files/calckernel-3.4.18-r6.patch deleted file mode 100644 index f03d04b88..000000000 --- a/sys-kernel/calckernel/files/calckernel-3.4.18-r6.patch +++ /dev/null @@ -1,2111 +0,0 @@ -diff --git defaults/busy-config defaults/busy-config -index 51fdc8e..a1f6858 100644 ---- defaults/busy-config -+++ defaults/busy-config -@@ -462,7 +462,7 @@ CONFIG_MDSTART=y - CONFIG_MORE=y - CONFIG_FEATURE_USE_TERMIOS=y - CONFIG_MOUNT=y --CONFIG_FEATURE_MOUNT_NFS=y -+CONFIG_FEATURE_MOUNT_NFS=n - # CONFIG_FEATURE_MOUNT_CIFS is not set - CONFIG_FEATURE_MOUNT_FLAGS=y - CONFIG_FEATURE_MOUNT_FSTAB=y -diff --git defaults/initrd.defaults defaults/initrd.defaults -index 76d72a7..0c059a5 100755 ---- defaults/initrd.defaults -+++ defaults/initrd.defaults -@@ -68,6 +68,7 @@ fi - - REAL_ROOT='' - CDROOT='0' -+SCRATCH='0' - CDROOT_DEV='' - CDROOT_TYPE='auto' - NEW_ROOT='/newroot' -diff --git defaults/initrd.scripts defaults/initrd.scripts -index 51ebcce..3979418 100755 ---- defaults/initrd.scripts -+++ defaults/initrd.scripts -@@ -187,23 +187,45 @@ cache_cd_contents() { - # TODO: Check the size of the image versus the size of our tmpfs - # along with the amount of available RAM and increase tmpfs size - # if necessary. (Not having awk sucks...) -- # z=0 -- # for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -- # cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; do -- # z=$(($z + $i)) ; done -- # echo $z -- good_msg "Copying loop file for caching..." -- # Verify that the needed directory exists -- mkdir -p "$(dirname ${NEW_ROOT}/mnt/${LOOP})" -- cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/${LOOP} -- if [ $? -ne 0 ] -+ -+ # getting memory -+ allmemory=0 -+ for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -+ cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; -+ do -+ allmemory=$(($allmemory + $i)) -+ done -+ -+ # getting size tmpfs of default -+ let curtfs=$allmemory/2 -+ -+ # getting size of image -+ let imagesize=`ls -la ${NEW_ROOT}/mnt/cdrom/${LOOP} | sed -r -n 's/(\S*\s*){4}(\S*).*/\2/p'`/20000*21 -+ let addon=$imagesize/10 -+ if [[ $curtfs -gt $(( ${imagesize} + ${addon} )) ]]; - then -- bad_msg "Failed to cache the loop file! Lack of space?" -- rm -rf ${NEW_ROOT}/mnt/livecd.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/image.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/zisofs 2>/dev/null -+ let addon=$(( $curtfs - ${imagesize} )) -+ fi -+ -+ if [[ $((${imagesize} + $addon)) -lt ${allmemory} ]]; -+ then -+ mount -o remount,size=${addon}000 -t tmpfs tmpfs ${NEW_ROOT} -+ mkdir ${NEW_ROOT}/mnt/squash -+ mount -o size=${imagesize}000 -t tmpfs tmpfs ${NEW_ROOT}/mnt/squash -+ good_msg "Copying loop file for caching..." -+ cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/squash/${LOOP} -+ if [ $? -ne 0 ] -+ then -+ bad_msg "Failed to cache the loop file! Lack of space?" -+ umount ${NEW_ROOT}/mnt/squash -+ mount -o remount,size=${curtfs}000 -t tmpfs tmpfs ${NEW_ROOT} -+ else -+ LOOPEXT='../squash/' -+ good_msg "Unmounting media from ${NEW_ROOT}/mnt/cdrom" -+ umount ${NEW_ROOT}/mnt/cdrom -+ fi - else -- LOOPEXT='../' -+ bad_msg "Too low memory for cache the loop file." - fi - fi - fi -@@ -655,7 +677,7 @@ startVolumes() { - [ -d /etc/lvm/cache ] && lvm_commands="${lvm_commands} \nvgscan" - - # To activate volumegroups on all devices in the cache -- lvm_commands="${lvm_commands} \nvgchange -ay --sysinit" -+ lvm_commands="${lvm_commands} \nvgchange -ay --sysinit --noudevsync" - - # And finally execute it all (/proc/... needed if lvm is compiled without readline) - good_msg "Scanning for and activating Volume Groups" -@@ -1082,6 +1104,38 @@ getdvhoff() { - echo $(( $(hexdump -n 4 -s $((316 + 12 * $2)) -e '"%i"' $1) * 512)) - } - -+load_union_module() { -+ UNIONTYPE="" -+ # find module for union file system -+ [ -n "$(find /lib/ -name unionfs.ko)" ] && UNIONTYPE="unionfs" -+ [ -n "$(find /lib/ -name aufs.ko)" ] && UNIONTYPE="aufs" -+ # probably aufs in kernel -+ if [ -n "$(gzip -dc /proc/config.gz | grep CONFIG_AUFS_FS=y )" ] -+ then -+ UNIONTYPE="aufs" -+ else -+ if [ -z "${UNIONTYPE}" ] -+ then -+ bad_msg "Module for union file system is not found!" -+ run_shell -+ else -+ modprobe ${UNIONTYPE} > /dev/null 2>&1 -+ # error on load union module -+ if [ -z "$(lsmod | grep $UNIONTYPE)" ] -+ then -+ bad_msg "Module for union file system is not correct!" -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ bad_msg "Probably kernel compiled without standalone patch." -+ fi -+ run_shell -+ fi -+ -+ good_msg "Loading ${UNIONTYPE}" -+ fi -+ fi -+} -+ - setup_unionfs() { - local rw_dir=$1 - local ro_dir=$2 -@@ -1101,6 +1155,7 @@ setup_unionfs() { - mkdir -p ${UNION} - good_msg "Loading fuse module" - modprobe fuse > /dev/null 2>&1 -+ load_union_module - # if [ -n "${UNIONFS}" ] - # then - # CHANGESDEV=${UNIONFS} -@@ -1130,11 +1185,102 @@ setup_unionfs() { - mkdir /tmp - mkdir -p ${UNION} - # mkdir -p $CHANGES --# mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+## mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+ -+ if [ "${SCRATCH}" -ne 0 ]; -+ then -+ good_msg "Loading in scratch mode" -+ BUILDERDIR=${UNION}/mnt/builder -+ SCRATCHDIR=${UNION}/mnt/scratch -+ DELTADIR=${rw_dir}/mnt/delta -+ WORKSPACEDIR=${rw_dir}/mnt/workspace -+ mount -o remount,rw ${rw_dir}/mnt/cdrom >/dev/null 2>&1 -+ touch ${rw_dir}/mnt/cdrom/livecd >/dev/null 2>&1 -+ if [ "$?" -ne 0 ]; -+ then -+ ISRW=0 -+ else -+ ISRW=1 -+ fi -+ -+ mkdir -p ${DELTADIR} -+ mkdir -p ${WORKSPACEDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${WORKSPACEDIR}=rw:${DELTADIR}=ro+wh:${rw_dir}/mnt/livecd=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${WORKSPACEDIR}=rw:${DELTADIR}=ro:${rw_dir}/mnt/livecd=ro unionfs ${UNION} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${SCRATCHDIR}/calculate -+ mkdir -p ${SCRATCHDIR}/delta -+ mkdir -p ${SCRATCHDIR}/workspace -+ mount -o bind ${rw_dir}/mnt/delta ${SCRATCHDIR}/delta -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind ${rw_dir}/mnt/workspace ${SCRATCHDIR}/workspace -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${BUILDERDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro none ${BUILDERDIR} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro unionfs ${BUILDERDIR} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind,ro ${rw_dir}/mnt/livecd ${SCRATCHDIR}/calculate -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ if [ "$ISRW" -ne 0 ]; -+ then -+ FLASHDIR=${UNION}/mnt/flash -+ mkdir -p ${FLASHDIR} -+ mount -o bind ${rw_dir}/mnt/cdrom ${FLASHDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ mkdir -p ${CDROMDIR} -+ mount -o bind,ro ${rw_dir}/mnt/cdrom ${CDROMDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ fi -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ LIVECDDIR=${UNION}/mnt/livecd -+ -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${rw_dir}:${ro_dir}=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${rw_dir}:${ro_dir}=ro unionfs ${UNION} -+ fi -+ -+ if [[ -n "$( echo ${LOOPEXT} | grep squash )" ]]; -+ then -+ mkdir -p ${UNION}/mnt/squash -+ mount -o bind ${NEW_ROOT}/mnt/squash ${UNION}/mnt/squash &>/dev/null -+ fi -+ -+ chmod 0755 ${UNION} -+ mount -o bind ${rw_dir}/mnt/cdrom ${CDROMDIR} &>/dev/null -+ mount -o bind ${rw_dir}/mnt/livecd ${LIVECDDIR} &>/dev/null -+ ret=$? -+ fi -+ -+ chmod 1777 ${UNION}/tmp - good_msg "Creating union mount" -- unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -- ret=$? -- if [ ${ret} -ne 0 ] -+# unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -+# ret=$? -+ if [ "${ret}" -ne 0 ] - then - bad_msg "Can't setup union mount!" - USE_UNIONFS_NORMAL=0 -@@ -1143,3 +1289,121 @@ setup_unionfs() { - USE_UNIONFS_NORMAL=0 - fi - } -+ -+load_videodrv() { -+ good_msg "Loading frame buffer video driver" -+ # find all available fb drivers -+ videodrv_count=$(find /lib/modules \ -+ -name "nouveau.ko" -o \ -+ -name "uvesafb.ko" -o \ -+ -name "i915.ko" -o \ -+ -name "radeon.ko" | -+ grep -c "") -+ # load specified videodrv -+ modules_list= -+ case "${VIDEODRV}" in -+ nouveau) -+ modules_list="nouveau" -+ ;; -+ radeon) -+ modules_list="radeon" -+ ;; -+ i915|intel) -+ modules_list="i915" -+ ;; -+ ""|auto) -+ # if not livecd and initramfs otimized (aviailable only one video driver) -+ if [ "${CDROOT}" != '1' -a "${videodrv_count}" -le 2 ] -+ then -+ modules_list="nouveau i915 radeon" -+ else -+ if [[ -x /usr/sbin/lspci ]] -+ then -+ if lspci | grep -m1 VGA | grep -qi intel -+ then -+ modules_list="i915" -+ elif lspci | grep -m1 VGA | grep -qi nvidia -+ then -+ modules_list="nouveau" -+ elif lspci | grep -m1 VGA | grep -q -e "Ati" -e "ATI" -+ then -+ modules_list="radeon" -+ else -+ modules_list="" -+ fi -+ else -+ modules_list="i915" -+ fi -+ fi -+ ;; -+ esac -+ for x in $modules_list -+ do -+ if [ "`find /lib/modules -name "${x}.ko" | grep -c ''`" -eq "1" ] -+ then -+ modprobe "${x}" modeset=${USE_MODESET} &>/dev/null -+ lsmod | grep -q "^${x}" && \ -+ [ "`cat /sys/module/${x}/refcnt`" -gt 0 ] && return 0 -+ fi -+ done -+ # else load uvesafb with specified video resolution -+ if [ -n "${VIDEORES}" ] -+ then -+ if ! echo $VIDEORES | grep -q "\-" -+ then -+ VIDEORES="${VIDEORES}-32" -+ fi -+ else -+ VIDEORES="1024x768-32" -+ fi -+ modprobe uvesafb mode_option=${VIDEORES} &>/dev/null -+} -+ -+start_udev() -+{ -+ # start udev -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ echo "" >/proc/sys/kernel/hotplug -+ udevd --daemon &>/dev/null -+ udevadm settle -+ fi -+} -+ -+stop_udev() -+{ -+ # kill udevd -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ pkill udevd &>/dev/null -+ fi -+} -+ -+populate_dev() -+{ -+ good_msg 'Activating udev' -+ # Do not run any init-scripts -+ udevadm control --property=do_not_run_plug_service=1 -+ -+ if [ "${REAL_ROOT}" == "/dev/nfs" ] -+ then -+ # clean blacklist because there are net drivers -+ # keep black video for correct loading prop. nvidia -+ cat </etc/modprobe.d/blacklist.conf -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -+EOF -+ fi -+ # discarding net drivers placed into blacklist.conf -+ udevadm trigger --action="add" -+ -+ # we can speed up booting under these conditions: -+ # * using devtmpfs so kernel creates device nodes for us -+ # * only using kernel created device nodes at boot (in /etc/fstab and elsewhere) -+ udevadm settle --timeout=60 -+} -diff --git defaults/linuxrc defaults/linuxrc -index 0843f5d..8109d09 100755 ---- defaults/linuxrc -+++ defaults/linuxrc -@@ -39,6 +39,13 @@ FAKE_ROOT='' - REAL_ROOTFLAGS='' - ROOTFSTYPE='auto' - CRYPT_SILENT=0 -+VIDEODRV='' -+USE_UDEV=1 -+USE_MODESET=1 -+if [ -e "/etc/calculate/calculate.ini" ] -+then -+ source /etc/calculate/calculate.ini -+fi - for x in ${CMDLINE} - do - case "${x}" in -@@ -57,6 +64,57 @@ do - init_opts\=*) - INIT_OPTS=`parse_opt "${x}"` - ;; -+ nokms) -+ USE_MODESET=0 -+ ;; -+ kms) -+ USE_MODESET=1 -+ ;; -+ noudev) -+ USE_UDEV=0 -+ ;; -+ calculate\=*) -+ CALCULATE=`parse_opt "${x}"` -+ if [[ "${CALCULATE//:/}" != "${CALCULATE}" ]] -+ then -+ for i in ${CALCULATE//,/ } -+ do -+ case "${i}" in -+ video:*) -+ VIDEODRV=`echo "${i}" | cut -s -d: -f2-` -+ ;; -+ resolution:*) -+ RES=`echo "${i}" | cut -s -d: -f2-` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ ;; -+ esac -+ done -+ else -+ RES=`echo "${CALCULATE}" | cut -s -d, -f4` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ VIDEODRV=`echo "${CALCULATE}" | cut -s -d, -f5` -+ fi -+ ;; -+ video\=*) -+ VR=`parse_opt "${x}"` -+ for i in ${VR//,/ } -+ do -+ if [ -z "${i//[0-9-x@]}" ] -+ then -+ VIDEORES=${i} -+ fi -+ done -+ ;; -+ # Scratch usbload -+ scratch) -+ SCRATCH=1 -+ ;; - # Livecd options - cdroot) - CDROOT=1 -@@ -251,15 +309,24 @@ then - REAL_ROOT="${FAKE_ROOT}" - fi - --splash 'init' -- --cmdline_hwopts -+# check udevd -+[ ! -x /sbin/udevd ] && USE_UDEV=0 - - # Mount sysfs - mount_sysfs - -+# start udev -+start_udev -+ -+# load kernel video driver -+load_videodrv -+ -+splash 'init' -+ -+cmdline_hwopts -+ - # Setup hotplugging for firmware loading --setup_hotplug -+[ "${USE_UDEV}" == "0" ] && setup_hotplug - - # Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel - if [ -z "${DO_modules}" ] -@@ -269,7 +336,7 @@ elif [ -d "/lib/modules/${KV}" ] - then - good_msg 'Loading modules' - # Load appropriate kernel modules -- if [ "${NODETECT}" != '1' ] -+ if [ "${USE_UDEV}" != '1' -a "${NODETECT}" != '1' ] - then - for modules in ${MY_HWOPTS} - do -@@ -285,14 +352,20 @@ fi - # Apply scan delay if specified - sdelay - --# Setup slow USB bits --setup_slowusb -+if [ "${USE_UDEV}" == "1" ] -+then -+ # populate /dev with devices already found by the kernel -+ populate_dev -+else -+ # Setup slow USB bits -+ setup_slowusb - --# Start device manager --start_dev_mgr -+ # Start device manager -+ start_dev_mgr - --# if doslowusb is passed, pause other 10 seconds here, after mdev load --[ "${DO_slowusb}" ] && sleep 10 -+ # if doslowusb is passed, pause other 10 seconds here, after mdev load -+ [ "${DO_slowusb}" ] && sleep 10 -+fi - - # Start iSCSI - if [ -e /bin/iscsistart ] -@@ -509,9 +582,50 @@ do - then - break - else -- bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -- got_good_root=0 -- REAL_ROOT='' -+ # check for scratch -+ if [ -e ${NEW_ROOT}/livecd.squashfs -a -d ${NEW_ROOT}/delta -a -d ${NEW_ROOT}/workspace ]; -+ then -+ good_msg 'Found scratch data...' -+ load_union_module -+ modprobe squashfs >/dev/null -+ if mount -o remount,rw ${NEW_ROOT}; -+ then -+ mkdir -p ${NEW_ROOT}/calculate && mkdir -p /union && mkdir -p ${NEW_ROOT}/workspace/mnt/builder && mkdir -p ${NEW_ROOT}/workspace/mnt/scratch -+ if mount -o loop,ro -t squashfs ${NEW_ROOT}/livecd.squashfs ${NEW_ROOT}/calculate; -+ then -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/workspace=rw:${NEW_ROOT}/delta=ro+wh:${NEW_ROOT}/calculate=ro none /union; -+ then -+ mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/delta=rw:${NEW_ROOT}/calculate=ro none /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers!' -+ run_shell -+ fi -+ else -+ if mount -t unionfs -o ro,dirs=${NEW_ROOT}/workspace:${NEW_ROOT}/delta=ro:${NEW_ROOT}/calculate=ro unionfs /union; -+ then -+ mount -t unionfs -o ro,dirs=${NEW_ROOT}/delta:${NEW_ROOT}/calculate=ro unionfs /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers' -+ run_shell -+ fi -+ fi -+ else -+ bad_msg 'Could not mount scratch squashfs image' -+ fi -+ else -+ bad_msg 'Could not remount ${NEW_ROOT}' -+ fi -+ else -+ bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -+ got_good_root=0 -+ REAL_ROOT='' -+ fi - fi - else - bad_msg "Could not mount specified ROOT, try again" -@@ -723,9 +837,12 @@ cd "${CHROOT}" - mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null - echo -ne "${BOLD}.${NORMAL}" - -+# stop udev before move mount points -+stop_udev -+ - # If devtmpfs is mounted, try move it to the new root - # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise --for fs in /dev /sys /proc -+for fs in "/dev " /sys /proc - do - if grep -qs "$fs" /proc/mounts - then -diff --git defaults/modprobe defaults/modprobe -index ba2d890..9280357 100755 ---- defaults/modprobe -+++ defaults/modprobe -@@ -10,8 +10,6 @@ usage() { - echo - echo 'Example:' - echo ' modprobe eepro100' -- echo -- echo 'Note: Do not pass the suffix to modprobe!' - exit 1 - } - -@@ -81,14 +79,29 @@ modprobe2() { - usage - exit 1 - fi -- real_path=`real_mod_path ${1}` -+ local modname=${1} -+ local quiet='' -+ local params='' -+ shift -+ for x in $@ -+ do -+ case ${x} in -+ -n) -+ quiet=1 -+ ;; -+ *) -+ params="${params} ${x}" -+ ;; -+ esac -+ done -+ real_path=`real_mod_path ${modname}` - if [ "${real_path}" = '' -o "${real_path}" = ' ' ] - then -- [ "${2}" = '-n' ] && echo -n " -> $1" -+ [ "${quiet}" = '1' ] && echo -n " -> ${modname}" - echo ' module not found.' - exit 2 - fi -- modlist=`modules_dep_list ${1}` -+ modlist=`modules_dep_list ${modname}` - if [ "${modlist}" != '' -a "${modlist}" != ' ' ] - then - deps=`strip_mod_paths ${modlist}` -@@ -110,13 +123,13 @@ modprobe2() { - filler=1 - fi - done -- ${INSMOD} ${real_path} > /dev/null 2>&1 -+ ${INSMOD} ${real_path} ${params} > /dev/null 2>&1 - ret=$? - if [ ${ret} -eq 0 ] - then - echoAppend=' loaded.' -- [ "${2}" = '-n' ] && echoFlags='-n' && echoAppend=', ' -- echo ${echoFlags} "${1}${echoAppend}" -+ [ "${quiet}" = '1' ] && echoFlags='-n' && echoAppend=', ' -+ echo ${echoFlags} "${modname}${echoAppend}" - fi - return $ret - } -@@ -132,7 +145,7 @@ do - LOADED_MODULES="${LOADED_MODULES} ${x}" - done - --modprobe2 ${1} -+modprobe2 ${@} - modprobe_ret=$? - - [ -f '/modules.cache' ] && rm -f /modules.cache > /dev/null 2>&1 -diff --git dracut_funcs.sh dracut_funcs.sh -new file mode 100755 -index 0000000..e80a638 ---- /dev/null -+++ dracut_funcs.sh -@@ -0,0 +1,752 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+# -+# functions used by dracut and other tools. -+# -+# Copyright 2005-2009 Red Hat, Inc. All rights reserved. -+# -+# 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; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+# -+ -+IF_RTLD="" -+IF_dynamic="" -+ -+# Generic substring function. If $2 is in $1, return 0. -+strstr() { [[ $1 =~ $2 ]]; } -+ -+# Create all subdirectories for given path without creating the last element. -+# $1 = path -+mksubdirs() { mkdir -p ${1%/*}; } -+ -+# Version comparision function. Assumes Linux style version scheme. -+# $1 = version a -+# $2 = comparision op (gt, ge, eq, le, lt, ne) -+# $3 = version b -+vercmp() { -+ local n1=(${1//./ }) op=$2 n2=(${3//./ }) i res -+ -+ for ((i=0; ; i++)) -+ do -+ if [[ ! ${n1[i]}${n2[i]} ]]; then res=0 -+ elif ((${n1[i]:-0} > ${n2[i]:-0})); then res=1 -+ elif ((${n1[i]:-0} < ${n2[i]:-0})); then res=2 -+ else continue -+ fi -+ break -+ done -+ -+ case $op in -+ gt) ((res == 1));; -+ ge) ((res != 2));; -+ eq) ((res == 0));; -+ le) ((res != 1));; -+ lt) ((res == 2));; -+ ne) ((res != 0));; -+ esac -+} -+ -+is_func() { -+ [[ $(type -t $1) = "function" ]] -+} -+ -+# Log initrd creation. -+if ! [[ $dracutlogfile ]]; then -+ [[ $dracutbasedir = /usr/share/dracut ]] && \ -+ dracutlogfile=/var/log/dracut.log || \ -+ dracutlogfile=/tmp/dracut.log -+# [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log -+ if [[ -w $dracutlogfile ]]; then -+ >"$dracutlogfile" -+ fi -+fi -+ -+dwarning() { -+ echo "W: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "W: $@" >>"$dracutlogfile" -+} -+ -+dinfo() { -+ [[ $beverbose ]] && echo "I: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "I: $@" >>"$dracutlogfile" -+} -+ -+derror() { -+ echo "E: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile" -+} -+ -+# Function prints global variables in format name=value line by line. -+# $@ = list of global variables' name -+print_vars() { -+ local var value -+ -+ for var in $@ -+ do -+ value=$(eval echo \$$var) -+ [[ ${value} ]] && echo "${var}=\"${value}\"" -+ done -+} -+ -+get_fs_env() { -+ [[ $1 ]] || return -+ eval $(udevadm info --query=env --name=$1|egrep 'ID_FS_(TYPE|UUID)=') -+ [[ $ID_FS_TYPE ]] && return -+ -+ if [[ -x /lib/udev/vol_id ]]; then -+ eval $(/lib/udev/vol_id --export $1) -+ elif find_binary blkid >/dev/null; then -+ eval $(blkid -o udev $1) -+ else -+ return 1 -+ fi -+} -+ -+get_fs_type() ( -+ [[ $1 ]] || return -+ if [[ $1 != ${1#/dev/block/nfs:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs3:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs4:} ]]; then -+ echo "nfs" -+ return -+ fi -+ get_fs_env $1 || return -+ echo $ID_FS_TYPE -+) -+ -+get_fs_uuid() ( -+ get_fs_env $1 || return -+ echo $ID_FS_UUID -+) -+ -+# finds the major:minor of the block device backing the root filesystem. -+find_block_device() { -+ local x mpt majmin dev fs misc maj min -+ if [[ $use_fstab != yes ]]; then -+ while read x x majmin x mpt x x fs dev misc; do -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $fs = btrfs ]] && { -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ } -+ if [[ $mpt = $1 ]] && [[ ${majmin#0:} = $majmin ]]; then -+ echo $majmin; -+ return 0 # we have a winner! -+ fi -+ done < /proc/self/mountinfo -+ fi -+ # fall back to /etc/fstab -+ while read dev mpt fs misc; do -+ if [[ $mpt = $1 ]]; then -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $dev != ${dev#UUID=} ]] && dev=/dev/disk/by-uuid/${dev#UUID=} -+ [[ $dev != ${dev#LABEL=} ]] && dev=/dev/disk/by-label/${dev#LABEL=} -+ [[ -b $dev ]] || return 1 # oops, not a block device. -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ fi -+ done < /etc/fstab -+ return 1; -+} -+ -+find_root_block_device() { find_block_device /; } -+ -+# Walk all the slave relationships for a given block device. -+# Stop when our helper function returns success -+# $1 = function to call on every found block device -+# $2 = block device in major:minor format -+check_block_and_slaves() { -+ local x -+ [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. -+ "$1" $2 && return -+ check_vol_slaves "$@" && return 0 -+ if [[ -f /sys/dev/block/$2/../dev ]]; then -+ check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0 -+ fi -+ [[ -d /sys/dev/block/$2/slaves ]] || return 1 -+ for x in /sys/dev/block/$2/slaves/*/dev; do -+ [[ -f $x ]] || continue -+ check_block_and_slaves $1 $(cat "$x") && return 0 -+ done -+ return 1 -+} -+ -+get_numeric_dev() { -+ ls -lH "$1" | { read a b c d maj min rest; printf "%d:%d" ${maj%%,} $min;} -+} -+ -+# ugly workaround for the lvm design -+# There is no volume group device, -+# so, there are no slave devices for volume groups. -+# Logical volumes only have the slave devices they really live on, -+# but you cannot create the logical volume without the volume group. -+# And the volume group might be bigger than the devices the LV needs. -+check_vol_slaves() { -+ for i in /dev/mapper/*; do -+ lv=$(get_numeric_dev $i) -+ if [[ $lv = $2 ]]; then -+ vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null) -+ # strip space -+ vg=$(echo $vg) -+ if [[ $vg ]]; then -+ for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \ -+ do -+ check_block_and_slaves $1 $(get_numeric_dev $pv) \ -+ && return 0 -+ done -+ fi -+ fi -+ done -+ return 1 -+} -+ -+# Install a directory, keeping symlinks as on the original system. -+# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file" -+# will create ${initdir}/lib64, ${initdir}/lib64/file, -+# and a symlink ${initdir}/lib -> lib64. -+inst_dir() { -+ local dir="$1" -+ [[ -e ${initdir}$dir ]] && return 0 -+ -+ # iterate over parent directories -+ local file="" -+ local IFS="/" -+ for part in $dir; do -+ [[ $part ]] || continue -+ file="$file/$part" -+ [[ -e ${initdir}$file ]] && continue -+ -+ if [[ -L $file ]]; then -+ # create link as the original -+ local target=$(readlink "$file") -+ ln -sfn "$target" "${initdir}$file" || return 1 -+ # resolve relative path and recursively install destionation -+ [[ $target = ${target##*/} ]] && target="${file%/*}/$target" -+ inst_dir "$target" -+ else -+ # create directory -+ mkdir -p "${initdir}$file" || return 1 -+ fi -+ done -+} -+ -+# $1 = file to copy to ramdisk -+# $2 (optional) Name for the file on the ramdisk -+# Location of the image dir is assumed to be $initdir -+# We never overwrite the target if it exists. -+inst_simple() { -+ local src target -+ [[ -f $1 ]] || return 1 -+ src=$1 target="${2:-$1}" -+ if ! [[ -d ${initdir}$target ]]; then -+ [[ -e ${initdir}$target ]] && return 0 -+ inst_dir "${target%/*}" -+ fi -+ dinfo "Installing $src" -+ cp -pfL "$src" "${initdir}$target" -+} -+ -+# find symlinks linked to given library file -+# $1 = library file -+# Function searches for symlinks by stripping version numbers appended to -+# library filename, checks if it points to the same target and finally -+# prints the list of symlinks to stdout. -+# -+# Example: -+# rev_lib_symlinks libfoo.so.8.1 -+# output: libfoo.so.8 libfoo.so -+# (Only if libfoo.so.8 and libfoo.so exists on host system.) -+rev_lib_symlinks() { -+ [[ ! $1 ]] && return 0 -+ -+ local fn="$1" orig="$(readlink -f "$1")" links='' -+ -+ [[ ${fn} =~ .*\.so\..* ]] || return 1 -+ -+ until [[ ${fn##*.} == so ]]; do -+ fn="${fn%.*}" -+ [[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}" -+ done -+ -+ echo ${links} -+} -+ -+# Same as above, but specialized to handle dynamic libraries. -+# It handles making symlinks according to how the original library -+# is referenced. -+inst_library() { -+ local src=$1 dest=${2:-$1} lib reallib symlink -+ [[ -e $initdir$dest ]] && return 0 -+ if [[ -L $src ]]; then -+ reallib=$(readlink -f "$src") -+ lib=${src##*/} -+ inst_simple "$reallib" "$reallib" -+ inst_dir "${dest%/*}" -+ (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib") -+ else -+ inst_simple "$src" "$dest" -+ fi -+ -+ # Create additional symlinks. See rev_symlinks description. -+ for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do -+ [[ ! -e $initdir$symlink ]] && { -+ dinfo "Creating extra symlink: $symlink" -+ inst_symlink $symlink -+ } -+ done -+} -+ -+# find a binary. If we were not passed the full path directly, -+# search in the usual places to find the binary. -+find_binary() { -+ local binpath="/bin /sbin /usr/bin /usr/sbin" p -+ [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } -+ for p in $binpath; do -+ [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# Same as above, but specialized to install binary executables. -+# Install binary executable, and all shared library dependencies, if any. -+inst_binary() { -+ local bin target -+ bin=$(find_binary "$1") || return 1 -+ target=${2:-$bin} -+ inst_symlink $bin $target && return 0 -+ local LDSO NAME IO FILE ADDR I1 n f TLIBDIR -+ [[ -e $initdir$target ]] && return 0 -+ # I love bash! -+ LC_ALL=C ldd $bin 2>/dev/null | while read line; do -+ [[ $line = 'not a dynamic executable' ]] && return 1 -+ if [[ $line =~ not\ found ]]; then -+ derror "Missing a shared library required by $bin." -+ derror "Run \"ldd $bin\" to find out what it is." -+ derror "dracut cannot create an initrd." -+ exit 1 -+ fi -+ so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)' -+ [[ $line =~ $so_regex ]] || continue -+ FILE=${BASH_REMATCH[1]} -+ [[ -e ${initdir}$FILE ]] && continue -+ # see if we are loading an optimized version of a shared lib. -+ lib_regex='^(/lib[^/]*).*' -+ if [[ $FILE =~ $lib_regex ]]; then -+ TLIBDIR=${BASH_REMATCH[1]} -+ BASE=${FILE##*/} -+ # prefer nosegneg libs, then unoptimized ones. -+ for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do -+ [[ -e $f/$BASE ]] || continue -+ FILE=$f/$BASE -+ break -+ done -+ inst_library "$FILE" "$TLIBDIR/$BASE" -+ IF_dynamic=yes -+ continue -+ fi -+ inst_library "$FILE" -+ done -+ inst_simple "$bin" "$target" -+} -+ -+# same as above, except for shell scripts. -+# If your shell script does not start with shebang, it is not a shell script. -+inst_script() { -+ [[ -f $1 ]] || return 1 -+ local line -+ read -r -n 80 line <"$1" -+ # If debug is set, clean unprintable chars to prevent messing up the term -+ [[ $debug ]] && line=$(echo -n "$line" | tr -c -d '[:print:][:space:]') -+ shebang_regex='(#! *)(/[^ ]+).*' -+ [[ $line =~ $shebang_regex ]] || return 1 -+ inst "${BASH_REMATCH[2]}" && inst_simple "$@" -+} -+ -+# same as above, but specialized for symlinks -+inst_symlink() { -+ local src=$1 target=$initdir${2:-$1} realsrc -+ [[ -L $1 ]] || return 1 -+ [[ -L $target ]] && return 0 -+ realsrc=$(readlink -f "$src") -+ [[ $realsrc = ${realsrc##*/} ]] && realsrc=${src%/*}/$realsrc -+ inst "$realsrc" && mkdir -p "${target%/*}" && \ -+ ln -s "$realsrc" "$target" -+} -+ -+# find a udev rule in the usual places. -+find_rule() { -+ [[ -f $1 ]] && { echo "$1"; return 0; } -+ for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do -+ [[ -f $r/$1 ]] && { echo "$r/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# udev rules always get installed in the same place, so -+# create a function to install them to make life simpler. -+inst_rules() { -+ local target=/etc/udev/rules.d rule found -+ -+ inst_dir "/lib/udev/rules.d" -+ inst_dir "$target" -+ for rule in "$@"; do -+ found=$(find_rule "$rule") && \ -+ inst_simple "$found" "$target/${found##*/}" \ -+ || dinfo "Skipping udev rule: $rule" -+ done -+} -+ -+# general purpose installation function -+# Same args as above. -+inst() { -+ case $# in -+ 1) ;; -+ 2) [[ ! $initdir && -d $2 ]] && export initdir=$2 -+ [[ $initdir = $2 ]] && set $1;; -+ 3) [[ -z $initdir ]] && export initdir=$2 -+ set $1 $3;; -+ *) derror "inst only takes 1 or 2 or 3 arguments" -+ exit 1;; -+ esac -+ for x in inst_symlink inst_script inst_binary inst_simple; do -+ $x "$@" && return 0 -+ done -+ return 1 -+} -+ -+# install function specialized for hooks -+# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook -+# All hooks should be POSIX/SuS compliant, they will be sourced by init. -+inst_hook() { -+ if ! [[ -f $3 ]]; then -+ derror "Cannot install a hook ($3) that does not exist." -+ derror "Aborting initrd creation." -+ exit 1 -+ elif ! strstr "$hookdirs" "$1"; then -+ derror "No such hook type $1. Aborting initrd creation." -+ exit 1 -+ fi -+ inst_simple "$3" "/${1}/${2}${3##*/}" -+} -+ -+dracut_install() { -+ if [[ $1 = '-o' ]]; then -+ local optional=yes -+ shift -+ fi -+ while (($# > 0)); do -+ if ! inst "$1" ; then -+ if [[ $optional = yes ]]; then -+ dwarning "Skipping program $1 as it cannot be found and is flagged to be optional" -+ else -+ derror "Failed to install $1" -+ exit 1 -+ fi -+ fi -+ shift -+ done -+} -+ -+# install function decompressing the target and handling symlinks -+# $@ = list of compressed (gz or bz2) files or symlinks pointing to such files -+# -+# Function install targets in the same paths inside overlay but decompressed -+# and without extensions (.gz, .bz2). -+inst_decompress() { -+ local src dst realsrc realdst cmd -+ -+ for src in $@ -+ do -+ case ${src} in -+ *.gz) cmd='gzip -d' ;; -+ *.bz2) cmd='bzip2 -d' ;; -+ *) return 1 ;; -+ esac -+ -+ if [[ -L ${src} ]] -+ then -+ realsrc="$(readlink -f ${src})" # symlink target with extension -+ dst="${src%.*}" # symlink without extension -+ realdst="${realsrc%.*}" # symlink target without extension -+ mksubdirs "${initdir}/${src}" -+ # Create symlink without extension to target without extension. -+ ln -s "${realdst}" "${initdir}/${dst}" -+ fi -+ -+ # If the source is symlink we operate on its target. -+ [[ ${realsrc} ]] && src=${realsrc} -+ inst ${src} -+ # Decompress with chosen tool. We assume that tool changes name e.g. -+ # from 'name.gz' to 'name'. -+ ${cmd} "${initdir}${src}" -+ done -+} -+ -+# It's similar to above, but if file is not compressed, performs standard -+# install. -+# $@ = list of files -+inst_opt_decompress() { -+ local src -+ -+ for src in $@ -+ do -+ inst_decompress "${src}" || inst "${src}" -+ done -+} -+ -+module_check() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we are unconditionally included -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check $hostonly -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func check || return 0 -+ check -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_depends() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we have no deps -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check -d -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func depends || return 0 -+ depends -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_install() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/install ]] && . "$moddir/install" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func install || return 0 -+ install -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_installkernel() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/installkernel ]] && . "$moddir/installkernel" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func installkernel || return 0 -+ installkernel -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+check_module() { -+ local mod=$1; -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ local moddep; -+ # If we are already scheduled to be loaded, no need to check again. -+ strstr " $mods_to_load " " $mod " && return 0 -+ strstr " $mods_checked_as_dep " " $mod " && return 1 -+ -+ # This should never happen, but... -+ [[ -d $moddir ]] || return 1 -+ -+ [[ $2 ]] || mods_checked_as_dep+=" $mod " -+ -+ strstr " $omit_dracutmodules " " $mod " && return 1 -+ -+ if strstr " $dracutmodules $add_dracutmodules " " $mod "; then -+ module_check $mod; ret=$? -+ # explicit module, so also accept ret=255 -+ [[ $ret = 0 || $ret = 255 ]] || return 1 -+ else -+ # module not in our list -+ if [[ $dracutmodules = all ]]; then -+ # check, if we can and should install this module -+ module_check $mod || return 1 -+ else -+ # skip this module -+ return 1 -+ fi -+ fi -+ -+ for moddep in $(module_depends $mod); do -+ # handle deps as if they were manually added -+ strstr " $add_dracutmodules " " $moddep " || \ -+ add_dracutmodules+=" $moddep " -+ # if a module we depend on fail, fail also -+ check_module $moddep || return 1 -+ done -+ -+ strstr " $mods_to_load " " $mod " || \ -+ mods_to_load+=" $mod " -+ -+ return 0 -+} -+ -+check_module_dir() { -+ local modcheck; -+ local mod; -+ mods_to_load="" -+ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do -+ local mod=${moddir##*/}; mod=${mod#[0-9][0-9]} -+ check_module $mod 1 -+ done -+} -+ -+# Install a single kernel module along with any firmware it may require. -+# $1 = full path to kernel module to install -+install_kmod_with_fw() { -+ local modname=${1##*/} fwdir found -+ modname=${modname%.ko*} -+ inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \ -+ return 0 # no need to go further if the module is already installed -+ for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do -+ found='' -+ for fwdir in $fw_dir; do -+ if [[ -d $fwdir && -f $fwdir/$fw ]]; then -+ inst_simple "$fwdir/$fw" "/lib/firmware/$fw" -+ found=yes -+ fi -+ done -+ if [[ $found != yes ]]; then -+ dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\"" -+ fi -+ done -+} -+ -+# Do something with all the dependencies of a kernel module. -+# Note that kernel modules depend on themselves using the technique we use -+# $1 = function to call for each dependency we find -+# It will be passed the full path to the found kernel module -+# $2 = module to get dependencies for -+# rest of args = arguments to modprobe -+for_each_kmod_dep() { -+ local func=$1 kmod=$2 cmd modpapth options -+ shift 2 -+ modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \ -+ while read cmd modpath options; do -+ [[ $cmd = insmod ]] || continue -+ $func $modpath -+ done -+} -+ -+# filter kernel modules to install certain modules that meet specific -+# requirements. -+# $1 = function to call with module name to filter. -+# This function will be passed the full path to the module to test. -+# The behaviour of this function can vary depending on whether $hostonly is set. -+# If it is, we will only look at modules that are already in memory. -+# If it is not, we will look at all kernel modules -+# This function returns the full filenames of modules that match $1 -+filter_kernel_modules () ( -+ if ! [[ $hostonly ]]; then -+ filtercmd='find "$srcmods/kernel/drivers" "$srcmods/extra" "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz" 2>/dev/null' -+ else -+ filtercmd='cut -d " " -f 1 /dev/null' -+ fi -+ for modname in $(eval $filtercmd); do -+ case $modname in -+ *.ko) "$1" "$modname" && echo "$modname";; -+ *.ko.gz) gzip -dc "$modname" > $initdir/$$.ko -+ $1 $initdir/$$.ko && echo "$modname" -+ rm -f $initdir/$$.ko;; -+ esac -+ done -+) -+ -+# install kernel modules along with all their dependencies. -+instmods() { -+ [[ $no_kernel = yes ]] && return -+ local mod mpargs modpath modname cmd moddirname -+ while (($# > 0)); do -+ mod=${1%.ko*} -+ case $mod in -+ =*) -+ # This introduces 2 incompatible meanings for =* arguments -+ # to instmods. We need to decide which one to keep. -+ if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then -+ instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block") -+ elif [ -f $srcmods/modules.${mod#=} ]; then -+ instmods $mpargs $(cat ${srcmods}/modules.${mod#=} ) -+ else -+ instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*") -+ fi -+ ;; -+ --*) -+ mod=${mod##*/} -+ mpargs+=" $mod";; -+ i2o_scsi) shift; continue;; # Do not load this diagnostic-only module -+ *) mod=${mod##*/} -+ # if we are already installed, skip this module and go on -+ # to the next one. -+ [[ -f $initdir/$1 ]] && { shift; continue; } -+ # If we are building a host-specific initramfs and this -+ # module is not already loaded, move on to the next one. -+ [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \ -+ ! echo $add_drivers | grep -qe "\<${mod}\>" && { -+ shift; continue; -+ } -+ -+ # We use '-d' option in modprobe only if modules prefix path -+ # differs from default '/'. This allows us to use Dracut with -+ # old version of modprobe which doesn't have '-d' option. -+ moddirname=${srcmods%%/lib/modules/*} -+ [[ -n ${moddirname} ]] && moddirname="-d ${moddirname}/" -+ -+ # ok, load the module, all its dependencies, and any firmware -+ # it may require -+ for_each_kmod_dep install_kmod_with_fw $mod \ -+ --set-version $kernel ${moddirname} -+ ;; -+ esac -+ shift -+ done -+} -diff --git gen_cmdline.sh gen_cmdline.sh -index b3e451d..bc9f2dc 100755 ---- gen_cmdline.sh -+++ gen_cmdline.sh -@@ -22,6 +22,7 @@ longusage() { - echo " --logfile= Output file for debug info" - echo " --color Output debug in color" - echo " --no-color Do not output debug in color" -+ echo " --no-cleartmp Do not clear temp directory" - echo " Kernel Configuration settings" - echo " --menuconfig Run menuconfig after oldconfig" - echo " --no-menuconfig Do not run menuconfig after oldconfig" -@@ -78,6 +79,8 @@ longusage() { - echo " --splash-res= Select splash theme resolutions to install" - echo " --do-keymap-auto Forces keymap selection at boot" - echo " --no-keymap Disables keymap selection support" -+ echo " --udev Include udev in the initramfs" -+ echo " --no-udev Exclude udev from the initramfs" - echo " --lvm Include LVM support" - echo " --mdadm Include MDADM/MDMON support" - echo " --mdadm-config= Use file as mdadm.conf in initramfs" -@@ -97,6 +100,8 @@ longusage() { - echo " --unionfs Include support for unionfs" - echo " --netboot Create a self-contained env in the initramfs" - echo " --real-root= Specify a default for real_root=" -+ echo " --lscpi Include lspci into the initramfs" -+ echo " --no-lscpi Exclude lspci from the initramfs" - echo " Internals" - echo " --arch-override= Force to arch instead of autodetect" - echo " --cachedir= Override the default cache location" -@@ -232,6 +237,22 @@ parse_cmdline() { - CMD_KEYMAP=0 - print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" - ;; -+ --udev) -+ CMD_UDEV=1 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --no-udev) -+ CMD_UDEV=0 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --lspci) -+ CMD_LSPCI=1 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --no-lspci) -+ CMD_UDEV=0 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; - --lvm) - CMD_LVM=1 - print_info 2 "CMD_LVM: ${CMD_LVM}" -@@ -441,6 +462,10 @@ parse_cmdline() { - print_info 2 "USECOLOR: ${USECOLOR}" - setColorVars - ;; -+ --no-cleartmp) -+ NOCLEARTMP=1 -+ print_info 2 "NOCLEARTMP: ${NOCLEARTMP}" -+ ;; - --logfile=*) - CMD_LOGFILE=`parse_opt "$*"` - LOGFILE=`parse_opt "$*"` -diff --git gen_compile.sh gen_compile.sh -index 0758c3a..8a2339a 100755 ---- gen_compile.sh -+++ gen_compile.sh -@@ -407,7 +407,10 @@ compile_busybox() { - yes '' 2>/dev/null | compile_generic oldconfig utils - - print_info 1 'busybox: >> Compiling...' -+ OLDLOGLEVEL=$LOGLEVEL -+ LOGLEVEL=1 - compile_generic all utils -+ LOGLEVEL=$OLDLOGLEVEL - print_info 1 'busybox: >> Copying to cache...' - [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] || - gen_die 'Busybox executable does not exist!' -diff --git gen_determineargs.sh gen_determineargs.sh -index ce479cb..bda14b8 100755 ---- gen_determineargs.sh -+++ gen_determineargs.sh -@@ -107,6 +107,8 @@ determine_real_args() { - set_config_with_override BOOL SYMLINK CMD_SYMLINK - set_config_with_override STRING INSTALL_MOD_PATH CMD_INSTALL_MOD_PATH - set_config_with_override BOOL OLDCONFIG CMD_OLDCONFIG -+ set_config_with_override BOOL UDEV CMD_UDEV -+ set_config_with_override BOOL LSPCI CMD_LSPCI - set_config_with_override BOOL LVM CMD_LVM - set_config_with_override BOOL DMRAID CMD_DMRAID - set_config_with_override BOOL ISCSI CMD_ISCSI -diff --git gen_initramfs.sh gen_initramfs.sh -index 7fe4421..76b6645 100755 ---- gen_initramfs.sh -+++ gen_initramfs.sh -@@ -56,7 +56,13 @@ append_busybox() { - chmod +x "${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/default.script" - - # Set up a few default symlinks -- for i in ${BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}; do -+ if isTrue "${UDEV}" -+ then -+ BUSYBOX_APPLETS="${BUSYBOX_APPLETS:-[ ash sh uname echo cut cat}" -+ else -+ BUSYBOX_APPLETS="{$BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}" -+ fi -+ for i in ${BUSYBOX_APPLETS}; do - rm -f ${TEMP}/initramfs-busybox-temp/bin/$i > /dev/null - ln -s busybox ${TEMP}/initramfs-busybox-temp/bin/$i || - gen_die "Busybox error: could not link ${i}!" -@@ -410,7 +416,7 @@ append_firmware() { - IFS="," - for i in ${FIRMWARE_FILES} - do -- cp -L "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ -+ cp -rL "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ - done - IFS=$OLD_IFS - else -@@ -438,9 +444,71 @@ append_gpg() { - chmod a+x "${TEMP}/initramfs-gpg-temp/sbin/gpg" - cd "${TEMP}/initramfs-gpg-temp/" - find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" - rm -rf "${TEMP}/initramfs-gpg-temp" > /dev/null - } - -+append_udev() { -+ if [ -d "${TEMP}/initramfs-udev-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-udev-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-udev-temp/" -+ udevmod="${GK_SHARE}/modules/udev-rules/" -+ source ${udevmod}/module-setup.sh -+ initdir=${TEMP}/initramfs-udev-temp \ -+ moddir=${udevmod} \ -+ libdir=/lib/ \ -+ usrlibdir=/usr/lib/ \ -+ install_module -+ -+ if isTrue $LSPCI -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ fi -+ # find net modules and sound -+ (for pathname in ${INSTALL_MOD_PATH}/lib/modules/${KV}/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/drivers/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/sound -+ do -+ [[ -d $pathname ]] && find $pathname -name "*.ko" -+ done | -+ while read module;do -+ # add them prefix blacklist -+ echo "blacklist `basename $module .ko`"; -+ # concat with ready blacklist.conf -+ done;cat "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf") | -+ # sort and rewrite blacklist.conf -+ sort | uniq > "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" -+ mv "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" \ -+ "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf" -+ -+ cd "${TEMP}/initramfs-udev-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-udev-temp" > /dev/null -+} -+ -+append_lspci() { -+ if [ -d "${TEMP}/initramfs-lspci-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-lspci-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-lspci-temp/" -+ -+ initdir=${TEMP}/initramfs-lspci-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ -+ cd "${TEMP}/initramfs-lspci-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-lspci-temp" > /dev/null -+} -+ - print_list() - { - local x -@@ -489,6 +557,11 @@ append_modules() { - print_list ${!group_modules} > "${TEMP}/initramfs-modules-${KV}-temp/etc/modules/${group}" - done - cd "${TEMP}/initramfs-modules-${KV}-temp/" -+ # remove sound and media -+ for x in `find . -type d -name media -o -type d -name sound` -+ do -+ rm -r "${x}" &>/dev/null -+ done - find . | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ - || gen_die "compressing modules cpio" - cd "${TEMP}" -@@ -561,11 +634,14 @@ append_auxilary() { - done - echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" - -- if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ if ! isTrue "${UDEV}" - then -- cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -- else -- cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ then -+ cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ else -+ cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ fi - fi - if isTrue $CMD_DOKEYMAPAUTO - then -@@ -582,7 +658,7 @@ append_auxilary() { - chmod +x "${TEMP}/initramfs-aux-temp/init" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" -- chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ isTrue "${UDEV}" || chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" - - if isTrue ${NETBOOT} - then -@@ -609,6 +685,21 @@ append_data() { - fi - } - -+pack_cpio() { -+ print_info 1 " >> Pack cpio data..." -+ if [ -d "${TEMP}/initramfs-repack-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-repack-temp" -+ fi -+ mkdir -p "${TEMP}/initramfs-repack-temp" -+ cd "${TEMP}/initramfs-repack-temp" -+ # unpack and pack cpio remove double files -+ cpio -di <${CPIO} 2>/dev/null -+ find . -print | cpio ${CPIO_ARGS} | gzip -9 >"${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-repack-temp" > /dev/null -+} -+ - create_initramfs() { - print_info 1 "initramfs: >> Initializing..." - -@@ -619,6 +710,11 @@ create_initramfs() { - - append_data 'base_layout' - append_data 'auxilary' "${BUSYBOX}" -+ append_data 'udev' "${UDEV}" -+ if ! isTrue "${UDEV}" -+ then -+ append_data 'lspci' "${LSPCI}" -+ fi - append_data 'busybox' "${BUSYBOX}" - append_data 'lvm' "${LVM}" - append_data 'dmraid' "${DMRAID}" -@@ -652,8 +748,7 @@ create_initramfs() { - append_data 'overlay' - fi - -- gzip -9 "${CPIO}" -- mv -f "${CPIO}.gz" "${CPIO}" -+ pack_cpio - - if isTrue "${INTEGRATED_INITRAMFS}" - then -diff --git genkernel genkernel -index 0a06cdd..1486c61 100755 ---- genkernel -+++ genkernel -@@ -9,6 +9,7 @@ GK_V='3.4.18' - TMPDIR='/var/tmp/genkernel' - - TODEBUGCACHE=1 # Until an error occurs or LOGFILE is fully qualified. -+NOCLEARTMP=0 - - small_die() { - echo $1 -@@ -45,6 +46,7 @@ source ${GK_SHARE}/gen_initramfs.sh || gen_die "Could not read ${GK_SHARE}/gen_i - source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_moddeps.sh" - source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh" - source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh" -+source ${GK_SHARE}/dracut_funcs.sh || gen_die "Could not read ${GK_SHARE}/dracut_funcs.sh" - - TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ - -@@ -55,21 +57,25 @@ trap_cleanup(){ - } - - cleanup(){ -- if [ -n "$TEMP" -a -d "$TEMP" ]; then -- rm -rf "$TEMP" -- fi -- -- if isTrue ${POSTCLEAR} -- then -- echo -- print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -- print_info 1 "CACHE_DIR: ${CACHE_DIR}" -- CLEAR_CACHE_DIR='yes' -- setup_cache_dir -- echo -- print_info 1 "TMPDIR: ${TMPDIR}" -- clear_tmpdir -- fi -+ if [[ ${NOCLEARTMP} -ne 0 ]] -+ then -+ return -+ fi -+ if [ -n "$TEMP" -a -d "$TEMP" ]; then -+ rm -rf "$TEMP" &>/dev/null -+ fi -+ -+ if isTrue ${POSTCLEAR} -+ then -+ echo -+ print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -+ print_info 1 "CACHE_DIR: ${CACHE_DIR}" -+ CLEAR_CACHE_DIR='yes' -+ setup_cache_dir -+ echo -+ print_info 1 "TMPDIR: ${TMPDIR}" -+ clear_tmpdir -+ fi - } - - trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL -diff --git genkernel.conf genkernel.conf -index 24fcd54..41f8e06 100644 ---- genkernel.conf -+++ genkernel.conf -@@ -52,6 +52,12 @@ USECOLOR="yes" - # argument is: *+1 - # MAKEOPTS="-j2" - -+# Add udev to initramfs -+UDEV="yes" -+ -+# Add lspci to initramfs -+LSPCI="yes" -+ - # Add in LVM support from static binaries if they exist on the system, or - # compile static LVM binaries if static ones do not exist. - # LVM="no" -@@ -92,7 +98,7 @@ USECOLOR="yes" - # Specify directory to pull from - # FIRMWARE_DIR="/lib/firmware" - # Specify specific firmware files to include. This overrides FIRMWARE_DIR --# FIRMWARE_FILES="" -+FIRMWARE_FILES="/lib/firmware/radeon" - - # Enable disklabel support (copies blkid to initrd) - DISKLABEL="yes" -diff --git modules/udev-rules/01-ignore.rules modules/udev-rules/01-ignore.rules -new file mode 100644 -index 0000000..b32f22e ---- /dev/null -+++ modules/udev-rules/01-ignore.rules -@@ -0,0 +1 @@ -+KERNEL=="ram[0-9]*", OPTIONS+="ignore_device", OPTIONS+="last_rule" -diff --git modules/udev-rules/59-persistent-storage-volid.rules modules/udev-rules/59-persistent-storage-volid.rules -new file mode 100644 -index 0000000..0b798e6 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage-volid.rules -@@ -0,0 +1,7 @@ -+SUBSYSTEM!="block", GOTO="psv_end" -+ACTION!="add|change", GOTO="psv_end" -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="cciss[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", IMPORT{program}="vol_id --export $tempnode" -+LABEL="psv_end" -diff --git modules/udev-rules/59-persistent-storage.rules modules/udev-rules/59-persistent-storage.rules -new file mode 100644 -index 0000000..2b83e72 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage.rules -@@ -0,0 +1,38 @@ -+SUBSYSTEM!="block", GOTO="ps_end" -+ACTION!="add|change", GOTO="ps_end" -+ -+KERNEL=="cciss[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end" -+ -+# partitions have no md/{array_state,metadata_version} -+ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" -+ -+# container devices have a metadata version of e.g. 'external:ddf' and -+# never leave state 'inactive' -+ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -+TEST!="md/array_state", GOTO="md_end" -+ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -+ -+LABEL="md_ignore_state" -+ -+IMPORT{program}="/sbin/mdadm --detail --export $tempnode" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+OPTIONS+="link_priority=100" -+OPTIONS+="watch" -+LABEL="md_end" -+ -+ -+KERNEL!="dm-[0-9]*", GOTO="ps_end" -+ACTION=="add", GOTO="ps_end" -+IMPORT{program}="/sbin/dmsetup info -c --nameprefixes --unquoted --rows --noheadings -o name,uuid,suspended,readonly,major,minor,open,tables_loaded,names_using_dev -j%M -m%m" -+ENV{DM_NAME}!="?*", GOTO="ps_end" -+ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="ps_end" -+ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="ps_end" -+ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="ps_end" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+LABEL="ps_end" -diff --git modules/udev-rules/61-persistent-storage.rules modules/udev-rules/61-persistent-storage.rules -new file mode 100644 -index 0000000..9cfdb0b ---- /dev/null -+++ modules/udev-rules/61-persistent-storage.rules -@@ -0,0 +1,20 @@ -+SUBSYSTEM!="block", GOTO="pss_end" -+ACTION!="add|change", GOTO="pss_end" -+ -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss" -+KERNEL=="cciss[0-9]*", GOTO="do_pss" -+KERNEL=="nbd[0-9]*", GOTO="do_pss" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", GOTO="do_pss" -+ -+GOTO="pss_end" -+ -+LABEL="do_pss" -+# by-path (parent device path) -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{program}="path_id %p" -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" -+ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" -+ -+# by-label/by-uuid links (filesystem metadata) -+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -+LABEL="pss_end" -diff --git modules/udev-rules/blacklist.conf modules/udev-rules/blacklist.conf -new file mode 100644 -index 0000000..21ac71c ---- /dev/null -+++ modules/udev-rules/blacklist.conf -@@ -0,0 +1,162 @@ -+blacklist ath_pci -+blacklist evbug -+blacklist usbmouse -+blacklist usbkbd -+blacklist eepro100 -+blacklist de4x5 -+blacklist eth1394 -+blacklist snd_intel8x0m -+blacklist snd_aw2 -+blacklist i2c_i801 -+blacklist prism54 -+blacklist bcm43xx -+blacklist garmin_gps -+blacklist asus_acpi -+blacklist snd_pcsp -+blacklist pcspkr -+blacklist amd76x_edac -+blacklist ohci1394 -+blacklist sbp2 -+blacklist dv1394 -+blacklist raw1394 -+blacklist video1394 -+blacklist aty128fb -+blacklist atyfb -+blacklist radeonfb -+blacklist cirrusfb -+blacklist cyber2000fb -+blacklist cyblafb -+blacklist gx1fb -+blacklist hgafb -+blacklist i810fb -+blacklist intelfb -+blacklist kyrofb -+blacklist lxfb -+blacklist matroxfb_base -+blacklist neofb -+blacklist nvidiafb -+blacklist pm2fb -+blacklist rivafb -+blacklist s1d13xxxfb -+blacklist savagefb -+blacklist sisfb -+blacklist sstfb -+blacklist tdfxfb -+blacklist tridentfb -+blacklist vesafb -+blacklist vfb -+blacklist viafb -+blacklist vt8623fb -+blacklist ac97 -+blacklist ac97_codec -+blacklist ac97_plugin_ad1980 -+blacklist ad1848 -+blacklist ad1889 -+blacklist adlib_card -+blacklist aedsp16 -+blacklist ali5455 -+blacklist btaudio -+blacklist cmpci -+blacklist cs4232 -+blacklist cs4281 -+blacklist cs461x -+blacklist cs46xx -+blacklist emu10k1 -+blacklist es1370 -+blacklist es1371 -+blacklist esssolo1 -+blacklist forte -+blacklist gus -+blacklist i810_audio -+blacklist kahlua -+blacklist mad16 -+blacklist maestro -+blacklist maestro3 -+blacklist maui -+blacklist mpu401 -+blacklist nm256_audio -+blacklist opl3 -+blacklist opl3sa -+blacklist opl3sa2 -+blacklist pas2 -+blacklist pss -+blacklist rme96xx -+blacklist sb -+blacklist sb_lib -+blacklist sgalaxy -+blacklist sonicvibes -+blacklist sound -+blacklist sscape -+blacklist trident -+blacklist trix -+blacklist uart401 -+blacklist uart6850 -+blacklist via82cxxx_audio -+blacklist v_midi -+blacklist wavefront -+blacklist ymfpci -+blacklist ac97_plugin_wm97xx -+blacklist ad1816 -+blacklist audio -+blacklist awe_wave -+blacklist dmasound_core -+blacklist dmasound_pmac -+blacklist harmony -+blacklist sequencer -+blacklist soundcard -+blacklist usb-midi -+blacklist acquirewdt -+blacklist advantechwdt -+blacklist alim1535_wdt -+blacklist alim7101_wdt -+blacklist booke_wdt -+blacklist cpu5wdt -+blacklist eurotechwdt -+blacklist i6300esb -+blacklist i8xx_tco -+blacklist ib700wdt -+blacklist ibmasr -+blacklist indydog -+blacklist iTCO_wdt -+blacklist it8712f_wdt -+blacklist it87_wdt -+blacklist ixp2000_wdt -+blacklist ixp4xx_wdt -+blacklist machzwd -+blacklist mixcomwd -+blacklist mpc8xx_wdt -+blacklist mpcore_wdt -+blacklist mv64x60_wdt -+blacklist pc87413_wdt -+blacklist pcwd -+blacklist pcwd_pci -+blacklist pcwd_usb -+blacklist s3c2410_wdt -+blacklist sa1100_wdt -+blacklist sbc60xxwdt -+blacklist sbc7240_wdt -+blacklist sb8360 -+blacklist sc1200wdt -+blacklist sc520_wdt -+blacklist sch311_wdt -+blacklist scx200_wdt -+blacklist shwdt -+blacklist smsc37b787_wdt -+blacklist softdog -+blacklist twl4030_wdt -+blacklist w83627hf_wdt -+blacklist w83697hf_wdt -+blacklist w83697ug_wdt -+blacklist w83877f_wdt -+blacklist w83977f_wdt -+blacklist wafer5823wdt -+blacklist wdt -+blacklist wdt_pci -+blacklist wm8350_wdt -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -diff --git modules/udev-rules/load-modules.sh modules/udev-rules/load-modules.sh -new file mode 100755 -index 0000000..36972fd ---- /dev/null -+++ modules/udev-rules/load-modules.sh -@@ -0,0 +1,7 @@ -+#!/bin/sh -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+# Implement blacklisting for udev-loaded modules -+ -+modprobe -b "$@" -diff --git modules/udev-rules/module-setup.sh modules/udev-rules/module-setup.sh -new file mode 100755 -index 0000000..2a3597e ---- /dev/null -+++ modules/udev-rules/module-setup.sh -@@ -0,0 +1,57 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+install_module() { -+ # FIXME: would be nice if we didn't have to know which rules to grab.... -+ # ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies -+ # of the rules we want so that we just copy those in would be best -+ dracut_install udevd udevadm /etc/udev/udev.conf /etc/group /bin/mount /sbin/modprobe /sbin/mount.nfs /etc/services -+ inst_rules 50-udev-default.rules 60-persistent-storage.rules \ -+ 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \ -+ 60-pcmcia.rules -+ mkdir -p "$initdir"/etc/modprobe.d -+ inst_simple "$moddir/blacklist.conf" /etc/modprobe.d/ -+ -+ # ignore some devices in the initrd -+ inst_rules "$moddir/01-ignore.rules" -+ -+ # for firmware loading -+ inst_rules 50-firmware.rules -+ -+ if [ ! -x /lib/udev/vol_id ]; then -+ inst_rules "$moddir/59-persistent-storage.rules" -+ else -+ inst_rules "$moddir/59-persistent-storage-volid.rules" -+ fi -+ inst_rules "$moddir/61-persistent-storage.rules" -+ -+ for i in \ -+ ata_id \ -+ cdrom_id \ -+ create_floppy_devices \ -+ edd_id \ -+ firmware.sh \ -+ firmware \ -+ firmware.agent \ -+ hotplug.functions \ -+ fw_unit_symlinks.sh \ -+ hid2hci \ -+ path_id \ -+ scsi_id \ -+ usb_id \ -+ vol_id \ -+ pcmcia-socket-startup \ -+ pcmcia-check-broken-cis \ -+ ; do -+ for utilpath in /lib/udev /sbin /bin -+ do -+ [ -e $utilpath/$i ] && dracut_install $utilpath/$i -+ done -+ done -+ -+ for i in {"$libdir","$usrlibdir"}/libnss_files*; do -+ [ -e "$i" ] && dracut_install "$i" -+ done -+} -+ diff --git a/sys-kernel/calckernel/files/calckernel-3.4.18-r7.patch b/sys-kernel/calckernel/files/calckernel-3.4.18-r7.patch deleted file mode 100644 index 4076b8354..000000000 --- a/sys-kernel/calckernel/files/calckernel-3.4.18-r7.patch +++ /dev/null @@ -1,2111 +0,0 @@ -diff --git defaults/busy-config defaults/busy-config -index 51fdc8e..a1f6858 100644 ---- defaults/busy-config -+++ defaults/busy-config -@@ -462,7 +462,7 @@ CONFIG_MDSTART=y - CONFIG_MORE=y - CONFIG_FEATURE_USE_TERMIOS=y - CONFIG_MOUNT=y --CONFIG_FEATURE_MOUNT_NFS=y -+CONFIG_FEATURE_MOUNT_NFS=n - # CONFIG_FEATURE_MOUNT_CIFS is not set - CONFIG_FEATURE_MOUNT_FLAGS=y - CONFIG_FEATURE_MOUNT_FSTAB=y -diff --git defaults/initrd.defaults defaults/initrd.defaults -index 76d72a7..0c059a5 100755 ---- defaults/initrd.defaults -+++ defaults/initrd.defaults -@@ -68,6 +68,7 @@ fi - - REAL_ROOT='' - CDROOT='0' -+SCRATCH='0' - CDROOT_DEV='' - CDROOT_TYPE='auto' - NEW_ROOT='/newroot' -diff --git defaults/initrd.scripts defaults/initrd.scripts -index 51ebcce..3979418 100755 ---- defaults/initrd.scripts -+++ defaults/initrd.scripts -@@ -187,23 +187,45 @@ cache_cd_contents() { - # TODO: Check the size of the image versus the size of our tmpfs - # along with the amount of available RAM and increase tmpfs size - # if necessary. (Not having awk sucks...) -- # z=0 -- # for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -- # cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; do -- # z=$(($z + $i)) ; done -- # echo $z -- good_msg "Copying loop file for caching..." -- # Verify that the needed directory exists -- mkdir -p "$(dirname ${NEW_ROOT}/mnt/${LOOP})" -- cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/${LOOP} -- if [ $? -ne 0 ] -+ -+ # getting memory -+ allmemory=0 -+ for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -+ cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; -+ do -+ allmemory=$(($allmemory + $i)) -+ done -+ -+ # getting size tmpfs of default -+ let curtfs=$allmemory/2 -+ -+ # getting size of image -+ let imagesize=`ls -la ${NEW_ROOT}/mnt/cdrom/${LOOP} | sed -r -n 's/(\S*\s*){4}(\S*).*/\2/p'`/20000*21 -+ let addon=$imagesize/10 -+ if [[ $curtfs -gt $(( ${imagesize} + ${addon} )) ]]; - then -- bad_msg "Failed to cache the loop file! Lack of space?" -- rm -rf ${NEW_ROOT}/mnt/livecd.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/image.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/zisofs 2>/dev/null -+ let addon=$(( $curtfs - ${imagesize} )) -+ fi -+ -+ if [[ $((${imagesize} + $addon)) -lt ${allmemory} ]]; -+ then -+ mount -o remount,size=${addon}000 -t tmpfs tmpfs ${NEW_ROOT} -+ mkdir ${NEW_ROOT}/mnt/squash -+ mount -o size=${imagesize}000 -t tmpfs tmpfs ${NEW_ROOT}/mnt/squash -+ good_msg "Copying loop file for caching..." -+ cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/squash/${LOOP} -+ if [ $? -ne 0 ] -+ then -+ bad_msg "Failed to cache the loop file! Lack of space?" -+ umount ${NEW_ROOT}/mnt/squash -+ mount -o remount,size=${curtfs}000 -t tmpfs tmpfs ${NEW_ROOT} -+ else -+ LOOPEXT='../squash/' -+ good_msg "Unmounting media from ${NEW_ROOT}/mnt/cdrom" -+ umount ${NEW_ROOT}/mnt/cdrom -+ fi - else -- LOOPEXT='../' -+ bad_msg "Too low memory for cache the loop file." - fi - fi - fi -@@ -655,7 +677,7 @@ startVolumes() { - [ -d /etc/lvm/cache ] && lvm_commands="${lvm_commands} \nvgscan" - - # To activate volumegroups on all devices in the cache -- lvm_commands="${lvm_commands} \nvgchange -ay --sysinit" -+ lvm_commands="${lvm_commands} \nvgchange -ay --sysinit --noudevsync" - - # And finally execute it all (/proc/... needed if lvm is compiled without readline) - good_msg "Scanning for and activating Volume Groups" -@@ -1082,6 +1104,38 @@ getdvhoff() { - echo $(( $(hexdump -n 4 -s $((316 + 12 * $2)) -e '"%i"' $1) * 512)) - } - -+load_union_module() { -+ UNIONTYPE="" -+ # find module for union file system -+ [ -n "$(find /lib/ -name unionfs.ko)" ] && UNIONTYPE="unionfs" -+ [ -n "$(find /lib/ -name aufs.ko)" ] && UNIONTYPE="aufs" -+ # probably aufs in kernel -+ if [ -n "$(gzip -dc /proc/config.gz | grep CONFIG_AUFS_FS=y )" ] -+ then -+ UNIONTYPE="aufs" -+ else -+ if [ -z "${UNIONTYPE}" ] -+ then -+ bad_msg "Module for union file system is not found!" -+ run_shell -+ else -+ modprobe ${UNIONTYPE} > /dev/null 2>&1 -+ # error on load union module -+ if [ -z "$(lsmod | grep $UNIONTYPE)" ] -+ then -+ bad_msg "Module for union file system is not correct!" -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ bad_msg "Probably kernel compiled without standalone patch." -+ fi -+ run_shell -+ fi -+ -+ good_msg "Loading ${UNIONTYPE}" -+ fi -+ fi -+} -+ - setup_unionfs() { - local rw_dir=$1 - local ro_dir=$2 -@@ -1101,6 +1155,7 @@ setup_unionfs() { - mkdir -p ${UNION} - good_msg "Loading fuse module" - modprobe fuse > /dev/null 2>&1 -+ load_union_module - # if [ -n "${UNIONFS}" ] - # then - # CHANGESDEV=${UNIONFS} -@@ -1130,11 +1185,102 @@ setup_unionfs() { - mkdir /tmp - mkdir -p ${UNION} - # mkdir -p $CHANGES --# mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+## mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+ -+ if [ "${SCRATCH}" -ne 0 ]; -+ then -+ good_msg "Loading in scratch mode" -+ BUILDERDIR=${UNION}/mnt/builder -+ SCRATCHDIR=${UNION}/mnt/scratch -+ DELTADIR=${rw_dir}/mnt/delta -+ WORKSPACEDIR=${rw_dir}/mnt/workspace -+ mount -o remount,rw ${rw_dir}/mnt/cdrom >/dev/null 2>&1 -+ touch ${rw_dir}/mnt/cdrom/livecd >/dev/null 2>&1 -+ if [ "$?" -ne 0 ]; -+ then -+ ISRW=0 -+ else -+ ISRW=1 -+ fi -+ -+ mkdir -p ${DELTADIR} -+ mkdir -p ${WORKSPACEDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${WORKSPACEDIR}=rw:${DELTADIR}=ro+wh:${rw_dir}/mnt/livecd=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${WORKSPACEDIR}=rw:${DELTADIR}=ro:${rw_dir}/mnt/livecd=ro unionfs ${UNION} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${SCRATCHDIR}/calculate -+ mkdir -p ${SCRATCHDIR}/delta -+ mkdir -p ${SCRATCHDIR}/workspace -+ mount -o bind ${rw_dir}/mnt/delta ${SCRATCHDIR}/delta -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind ${rw_dir}/mnt/workspace ${SCRATCHDIR}/workspace -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${BUILDERDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro none ${BUILDERDIR} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro unionfs ${BUILDERDIR} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind,ro ${rw_dir}/mnt/livecd ${SCRATCHDIR}/calculate -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ if [ "$ISRW" -ne 0 ]; -+ then -+ FLASHDIR=${UNION}/mnt/flash -+ mkdir -p ${FLASHDIR} -+ mount -o bind ${rw_dir}/mnt/cdrom ${FLASHDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ mkdir -p ${CDROMDIR} -+ mount -o bind,ro ${rw_dir}/mnt/cdrom ${CDROMDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ fi -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ LIVECDDIR=${UNION}/mnt/livecd -+ -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${rw_dir}:${ro_dir}=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${rw_dir}:${ro_dir}=ro unionfs ${UNION} -+ fi -+ -+ if [[ -n "$( echo ${LOOPEXT} | grep squash )" ]]; -+ then -+ mkdir -p ${UNION}/mnt/squash -+ mount -o bind ${NEW_ROOT}/mnt/squash ${UNION}/mnt/squash &>/dev/null -+ fi -+ -+ chmod 0755 ${UNION} -+ mount -o bind ${rw_dir}/mnt/cdrom ${CDROMDIR} &>/dev/null -+ mount -o bind ${rw_dir}/mnt/livecd ${LIVECDDIR} &>/dev/null -+ ret=$? -+ fi -+ -+ chmod 1777 ${UNION}/tmp - good_msg "Creating union mount" -- unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -- ret=$? -- if [ ${ret} -ne 0 ] -+# unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -+# ret=$? -+ if [ "${ret}" -ne 0 ] - then - bad_msg "Can't setup union mount!" - USE_UNIONFS_NORMAL=0 -@@ -1143,3 +1289,121 @@ setup_unionfs() { - USE_UNIONFS_NORMAL=0 - fi - } -+ -+load_videodrv() { -+ good_msg "Loading frame buffer video driver" -+ # find all available fb drivers -+ videodrv_count=$(find /lib/modules \ -+ -name "nouveau.ko" -o \ -+ -name "uvesafb.ko" -o \ -+ -name "i915.ko" -o \ -+ -name "radeon.ko" | -+ grep -c "") -+ # load specified videodrv -+ modules_list= -+ case "${VIDEODRV}" in -+ nouveau) -+ modules_list="nouveau" -+ ;; -+ radeon) -+ modules_list="radeon" -+ ;; -+ i915|intel) -+ modules_list="i915" -+ ;; -+ ""|auto) -+ # if not livecd and initramfs otimized (aviailable only one video driver) -+ if [ "${CDROOT}" != '1' -a "${videodrv_count}" -le 2 ] -+ then -+ modules_list="nouveau i915 radeon" -+ else -+ if [[ -x /usr/sbin/lspci ]] -+ then -+ if lspci | grep -m1 VGA | grep -qi intel -+ then -+ modules_list="i915" -+ elif lspci | grep -m1 VGA | grep -qi nvidia -+ then -+ modules_list="nouveau" -+ elif lspci | grep -m1 VGA | grep -q -e "Ati" -e "ATI" -+ then -+ modules_list="radeon" -+ else -+ modules_list="" -+ fi -+ else -+ modules_list="i915" -+ fi -+ fi -+ ;; -+ esac -+ for x in $modules_list -+ do -+ if [ "`find /lib/modules -name "${x}.ko" | grep -c ''`" -eq "1" ] -+ then -+ modprobe "${x}" modeset=${USE_MODESET} &>/dev/null -+ lsmod | grep -q "^${x}" && \ -+ [ "`cat /sys/module/${x}/refcnt`" -gt 0 ] && return 0 -+ fi -+ done -+ # else load uvesafb with specified video resolution -+ if [ -n "${VIDEORES}" ] -+ then -+ if ! echo $VIDEORES | grep -q "\-" -+ then -+ VIDEORES="${VIDEORES}-32" -+ fi -+ else -+ VIDEORES="1024x768-32" -+ fi -+ modprobe uvesafb mode_option=${VIDEORES} &>/dev/null -+} -+ -+start_udev() -+{ -+ # start udev -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ echo "" >/proc/sys/kernel/hotplug -+ udevd --daemon &>/dev/null -+ udevadm settle -+ fi -+} -+ -+stop_udev() -+{ -+ # kill udevd -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ pkill udevd &>/dev/null -+ fi -+} -+ -+populate_dev() -+{ -+ good_msg 'Activating udev' -+ # Do not run any init-scripts -+ udevadm control --property=do_not_run_plug_service=1 -+ -+ if [ "${REAL_ROOT}" == "/dev/nfs" ] -+ then -+ # clean blacklist because there are net drivers -+ # keep black video for correct loading prop. nvidia -+ cat </etc/modprobe.d/blacklist.conf -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -+EOF -+ fi -+ # discarding net drivers placed into blacklist.conf -+ udevadm trigger --action="add" -+ -+ # we can speed up booting under these conditions: -+ # * using devtmpfs so kernel creates device nodes for us -+ # * only using kernel created device nodes at boot (in /etc/fstab and elsewhere) -+ udevadm settle --timeout=60 -+} -diff --git defaults/linuxrc defaults/linuxrc -index 0843f5d..8109d09 100755 ---- defaults/linuxrc -+++ defaults/linuxrc -@@ -39,6 +39,13 @@ FAKE_ROOT='' - REAL_ROOTFLAGS='' - ROOTFSTYPE='auto' - CRYPT_SILENT=0 -+VIDEODRV='' -+USE_UDEV=1 -+USE_MODESET=1 -+if [ -e "/etc/calculate/calculate.ini" ] -+then -+ source /etc/calculate/calculate.ini -+fi - for x in ${CMDLINE} - do - case "${x}" in -@@ -57,6 +64,57 @@ do - init_opts\=*) - INIT_OPTS=`parse_opt "${x}"` - ;; -+ nokms) -+ USE_MODESET=0 -+ ;; -+ kms) -+ USE_MODESET=1 -+ ;; -+ noudev) -+ USE_UDEV=0 -+ ;; -+ calculate\=*) -+ CALCULATE=`parse_opt "${x}"` -+ if [[ "${CALCULATE//:/}" != "${CALCULATE}" ]] -+ then -+ for i in ${CALCULATE//,/ } -+ do -+ case "${i}" in -+ video:*) -+ VIDEODRV=`echo "${i}" | cut -s -d: -f2-` -+ ;; -+ resolution:*) -+ RES=`echo "${i}" | cut -s -d: -f2-` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ ;; -+ esac -+ done -+ else -+ RES=`echo "${CALCULATE}" | cut -s -d, -f4` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ VIDEODRV=`echo "${CALCULATE}" | cut -s -d, -f5` -+ fi -+ ;; -+ video\=*) -+ VR=`parse_opt "${x}"` -+ for i in ${VR//,/ } -+ do -+ if [ -z "${i//[0-9-x@]}" ] -+ then -+ VIDEORES=${i} -+ fi -+ done -+ ;; -+ # Scratch usbload -+ scratch) -+ SCRATCH=1 -+ ;; - # Livecd options - cdroot) - CDROOT=1 -@@ -251,15 +309,24 @@ then - REAL_ROOT="${FAKE_ROOT}" - fi - --splash 'init' -- --cmdline_hwopts -+# check udevd -+[ ! -x /sbin/udevd ] && USE_UDEV=0 - - # Mount sysfs - mount_sysfs - -+# start udev -+start_udev -+ -+# load kernel video driver -+load_videodrv -+ -+splash 'init' -+ -+cmdline_hwopts -+ - # Setup hotplugging for firmware loading --setup_hotplug -+[ "${USE_UDEV}" == "0" ] && setup_hotplug - - # Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel - if [ -z "${DO_modules}" ] -@@ -269,7 +336,7 @@ elif [ -d "/lib/modules/${KV}" ] - then - good_msg 'Loading modules' - # Load appropriate kernel modules -- if [ "${NODETECT}" != '1' ] -+ if [ "${USE_UDEV}" != '1' -a "${NODETECT}" != '1' ] - then - for modules in ${MY_HWOPTS} - do -@@ -285,14 +352,20 @@ fi - # Apply scan delay if specified - sdelay - --# Setup slow USB bits --setup_slowusb -+if [ "${USE_UDEV}" == "1" ] -+then -+ # populate /dev with devices already found by the kernel -+ populate_dev -+else -+ # Setup slow USB bits -+ setup_slowusb - --# Start device manager --start_dev_mgr -+ # Start device manager -+ start_dev_mgr - --# if doslowusb is passed, pause other 10 seconds here, after mdev load --[ "${DO_slowusb}" ] && sleep 10 -+ # if doslowusb is passed, pause other 10 seconds here, after mdev load -+ [ "${DO_slowusb}" ] && sleep 10 -+fi - - # Start iSCSI - if [ -e /bin/iscsistart ] -@@ -509,9 +582,50 @@ do - then - break - else -- bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -- got_good_root=0 -- REAL_ROOT='' -+ # check for scratch -+ if [ -e ${NEW_ROOT}/livecd.squashfs -a -d ${NEW_ROOT}/delta -a -d ${NEW_ROOT}/workspace ]; -+ then -+ good_msg 'Found scratch data...' -+ load_union_module -+ modprobe squashfs >/dev/null -+ if mount -o remount,rw ${NEW_ROOT}; -+ then -+ mkdir -p ${NEW_ROOT}/calculate && mkdir -p /union && mkdir -p ${NEW_ROOT}/workspace/mnt/builder && mkdir -p ${NEW_ROOT}/workspace/mnt/scratch -+ if mount -o loop,ro -t squashfs ${NEW_ROOT}/livecd.squashfs ${NEW_ROOT}/calculate; -+ then -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/workspace=rw:${NEW_ROOT}/delta=ro+wh:${NEW_ROOT}/calculate=ro none /union; -+ then -+ mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/delta=rw:${NEW_ROOT}/calculate=ro none /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers!' -+ run_shell -+ fi -+ else -+ if mount -t unionfs -o ro,dirs=${NEW_ROOT}/workspace:${NEW_ROOT}/delta=ro:${NEW_ROOT}/calculate=ro unionfs /union; -+ then -+ mount -t unionfs -o ro,dirs=${NEW_ROOT}/delta:${NEW_ROOT}/calculate=ro unionfs /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers' -+ run_shell -+ fi -+ fi -+ else -+ bad_msg 'Could not mount scratch squashfs image' -+ fi -+ else -+ bad_msg 'Could not remount ${NEW_ROOT}' -+ fi -+ else -+ bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -+ got_good_root=0 -+ REAL_ROOT='' -+ fi - fi - else - bad_msg "Could not mount specified ROOT, try again" -@@ -723,9 +837,12 @@ cd "${CHROOT}" - mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null - echo -ne "${BOLD}.${NORMAL}" - -+# stop udev before move mount points -+stop_udev -+ - # If devtmpfs is mounted, try move it to the new root - # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise --for fs in /dev /sys /proc -+for fs in "/dev " /sys /proc - do - if grep -qs "$fs" /proc/mounts - then -diff --git defaults/modprobe defaults/modprobe -index ba2d890..9280357 100755 ---- defaults/modprobe -+++ defaults/modprobe -@@ -10,8 +10,6 @@ usage() { - echo - echo 'Example:' - echo ' modprobe eepro100' -- echo -- echo 'Note: Do not pass the suffix to modprobe!' - exit 1 - } - -@@ -81,14 +79,29 @@ modprobe2() { - usage - exit 1 - fi -- real_path=`real_mod_path ${1}` -+ local modname=${1} -+ local quiet='' -+ local params='' -+ shift -+ for x in $@ -+ do -+ case ${x} in -+ -n) -+ quiet=1 -+ ;; -+ *) -+ params="${params} ${x}" -+ ;; -+ esac -+ done -+ real_path=`real_mod_path ${modname}` - if [ "${real_path}" = '' -o "${real_path}" = ' ' ] - then -- [ "${2}" = '-n' ] && echo -n " -> $1" -+ [ "${quiet}" = '1' ] && echo -n " -> ${modname}" - echo ' module not found.' - exit 2 - fi -- modlist=`modules_dep_list ${1}` -+ modlist=`modules_dep_list ${modname}` - if [ "${modlist}" != '' -a "${modlist}" != ' ' ] - then - deps=`strip_mod_paths ${modlist}` -@@ -110,13 +123,13 @@ modprobe2() { - filler=1 - fi - done -- ${INSMOD} ${real_path} > /dev/null 2>&1 -+ ${INSMOD} ${real_path} ${params} > /dev/null 2>&1 - ret=$? - if [ ${ret} -eq 0 ] - then - echoAppend=' loaded.' -- [ "${2}" = '-n' ] && echoFlags='-n' && echoAppend=', ' -- echo ${echoFlags} "${1}${echoAppend}" -+ [ "${quiet}" = '1' ] && echoFlags='-n' && echoAppend=', ' -+ echo ${echoFlags} "${modname}${echoAppend}" - fi - return $ret - } -@@ -132,7 +145,7 @@ do - LOADED_MODULES="${LOADED_MODULES} ${x}" - done - --modprobe2 ${1} -+modprobe2 ${@} - modprobe_ret=$? - - [ -f '/modules.cache' ] && rm -f /modules.cache > /dev/null 2>&1 -diff --git dracut_funcs.sh dracut_funcs.sh -new file mode 100755 -index 0000000..e80a638 ---- /dev/null -+++ dracut_funcs.sh -@@ -0,0 +1,752 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+# -+# functions used by dracut and other tools. -+# -+# Copyright 2005-2009 Red Hat, Inc. All rights reserved. -+# -+# 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; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+# -+ -+IF_RTLD="" -+IF_dynamic="" -+ -+# Generic substring function. If $2 is in $1, return 0. -+strstr() { [[ $1 =~ $2 ]]; } -+ -+# Create all subdirectories for given path without creating the last element. -+# $1 = path -+mksubdirs() { mkdir -p ${1%/*}; } -+ -+# Version comparision function. Assumes Linux style version scheme. -+# $1 = version a -+# $2 = comparision op (gt, ge, eq, le, lt, ne) -+# $3 = version b -+vercmp() { -+ local n1=(${1//./ }) op=$2 n2=(${3//./ }) i res -+ -+ for ((i=0; ; i++)) -+ do -+ if [[ ! ${n1[i]}${n2[i]} ]]; then res=0 -+ elif ((${n1[i]:-0} > ${n2[i]:-0})); then res=1 -+ elif ((${n1[i]:-0} < ${n2[i]:-0})); then res=2 -+ else continue -+ fi -+ break -+ done -+ -+ case $op in -+ gt) ((res == 1));; -+ ge) ((res != 2));; -+ eq) ((res == 0));; -+ le) ((res != 1));; -+ lt) ((res == 2));; -+ ne) ((res != 0));; -+ esac -+} -+ -+is_func() { -+ [[ $(type -t $1) = "function" ]] -+} -+ -+# Log initrd creation. -+if ! [[ $dracutlogfile ]]; then -+ [[ $dracutbasedir = /usr/share/dracut ]] && \ -+ dracutlogfile=/var/log/dracut.log || \ -+ dracutlogfile=/tmp/dracut.log -+# [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log -+ if [[ -w $dracutlogfile ]]; then -+ >"$dracutlogfile" -+ fi -+fi -+ -+dwarning() { -+ echo "W: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "W: $@" >>"$dracutlogfile" -+} -+ -+dinfo() { -+ [[ $beverbose ]] && echo "I: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "I: $@" >>"$dracutlogfile" -+} -+ -+derror() { -+ echo "E: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile" -+} -+ -+# Function prints global variables in format name=value line by line. -+# $@ = list of global variables' name -+print_vars() { -+ local var value -+ -+ for var in $@ -+ do -+ value=$(eval echo \$$var) -+ [[ ${value} ]] && echo "${var}=\"${value}\"" -+ done -+} -+ -+get_fs_env() { -+ [[ $1 ]] || return -+ eval $(udevadm info --query=env --name=$1|egrep 'ID_FS_(TYPE|UUID)=') -+ [[ $ID_FS_TYPE ]] && return -+ -+ if [[ -x /lib/udev/vol_id ]]; then -+ eval $(/lib/udev/vol_id --export $1) -+ elif find_binary blkid >/dev/null; then -+ eval $(blkid -o udev $1) -+ else -+ return 1 -+ fi -+} -+ -+get_fs_type() ( -+ [[ $1 ]] || return -+ if [[ $1 != ${1#/dev/block/nfs:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs3:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs4:} ]]; then -+ echo "nfs" -+ return -+ fi -+ get_fs_env $1 || return -+ echo $ID_FS_TYPE -+) -+ -+get_fs_uuid() ( -+ get_fs_env $1 || return -+ echo $ID_FS_UUID -+) -+ -+# finds the major:minor of the block device backing the root filesystem. -+find_block_device() { -+ local x mpt majmin dev fs misc maj min -+ if [[ $use_fstab != yes ]]; then -+ while read x x majmin x mpt x x fs dev misc; do -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $fs = btrfs ]] && { -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ } -+ if [[ $mpt = $1 ]] && [[ ${majmin#0:} = $majmin ]]; then -+ echo $majmin; -+ return 0 # we have a winner! -+ fi -+ done < /proc/self/mountinfo -+ fi -+ # fall back to /etc/fstab -+ while read dev mpt fs misc; do -+ if [[ $mpt = $1 ]]; then -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $dev != ${dev#UUID=} ]] && dev=/dev/disk/by-uuid/${dev#UUID=} -+ [[ $dev != ${dev#LABEL=} ]] && dev=/dev/disk/by-label/${dev#LABEL=} -+ [[ -b $dev ]] || return 1 # oops, not a block device. -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ fi -+ done < /etc/fstab -+ return 1; -+} -+ -+find_root_block_device() { find_block_device /; } -+ -+# Walk all the slave relationships for a given block device. -+# Stop when our helper function returns success -+# $1 = function to call on every found block device -+# $2 = block device in major:minor format -+check_block_and_slaves() { -+ local x -+ [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. -+ "$1" $2 && return -+ check_vol_slaves "$@" && return 0 -+ if [[ -f /sys/dev/block/$2/../dev ]]; then -+ check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0 -+ fi -+ [[ -d /sys/dev/block/$2/slaves ]] || return 1 -+ for x in /sys/dev/block/$2/slaves/*/dev; do -+ [[ -f $x ]] || continue -+ check_block_and_slaves $1 $(cat "$x") && return 0 -+ done -+ return 1 -+} -+ -+get_numeric_dev() { -+ ls -lH "$1" | { read a b c d maj min rest; printf "%d:%d" ${maj%%,} $min;} -+} -+ -+# ugly workaround for the lvm design -+# There is no volume group device, -+# so, there are no slave devices for volume groups. -+# Logical volumes only have the slave devices they really live on, -+# but you cannot create the logical volume without the volume group. -+# And the volume group might be bigger than the devices the LV needs. -+check_vol_slaves() { -+ for i in /dev/mapper/*; do -+ lv=$(get_numeric_dev $i) -+ if [[ $lv = $2 ]]; then -+ vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null) -+ # strip space -+ vg=$(echo $vg) -+ if [[ $vg ]]; then -+ for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \ -+ do -+ check_block_and_slaves $1 $(get_numeric_dev $pv) \ -+ && return 0 -+ done -+ fi -+ fi -+ done -+ return 1 -+} -+ -+# Install a directory, keeping symlinks as on the original system. -+# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file" -+# will create ${initdir}/lib64, ${initdir}/lib64/file, -+# and a symlink ${initdir}/lib -> lib64. -+inst_dir() { -+ local dir="$1" -+ [[ -e ${initdir}$dir ]] && return 0 -+ -+ # iterate over parent directories -+ local file="" -+ local IFS="/" -+ for part in $dir; do -+ [[ $part ]] || continue -+ file="$file/$part" -+ [[ -e ${initdir}$file ]] && continue -+ -+ if [[ -L $file ]]; then -+ # create link as the original -+ local target=$(readlink "$file") -+ ln -sfn "$target" "${initdir}$file" || return 1 -+ # resolve relative path and recursively install destionation -+ [[ $target = ${target##*/} ]] && target="${file%/*}/$target" -+ inst_dir "$target" -+ else -+ # create directory -+ mkdir -p "${initdir}$file" || return 1 -+ fi -+ done -+} -+ -+# $1 = file to copy to ramdisk -+# $2 (optional) Name for the file on the ramdisk -+# Location of the image dir is assumed to be $initdir -+# We never overwrite the target if it exists. -+inst_simple() { -+ local src target -+ [[ -f $1 ]] || return 1 -+ src=$1 target="${2:-$1}" -+ if ! [[ -d ${initdir}$target ]]; then -+ [[ -e ${initdir}$target ]] && return 0 -+ inst_dir "${target%/*}" -+ fi -+ dinfo "Installing $src" -+ cp -pfL "$src" "${initdir}$target" -+} -+ -+# find symlinks linked to given library file -+# $1 = library file -+# Function searches for symlinks by stripping version numbers appended to -+# library filename, checks if it points to the same target and finally -+# prints the list of symlinks to stdout. -+# -+# Example: -+# rev_lib_symlinks libfoo.so.8.1 -+# output: libfoo.so.8 libfoo.so -+# (Only if libfoo.so.8 and libfoo.so exists on host system.) -+rev_lib_symlinks() { -+ [[ ! $1 ]] && return 0 -+ -+ local fn="$1" orig="$(readlink -f "$1")" links='' -+ -+ [[ ${fn} =~ .*\.so\..* ]] || return 1 -+ -+ until [[ ${fn##*.} == so ]]; do -+ fn="${fn%.*}" -+ [[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}" -+ done -+ -+ echo ${links} -+} -+ -+# Same as above, but specialized to handle dynamic libraries. -+# It handles making symlinks according to how the original library -+# is referenced. -+inst_library() { -+ local src=$1 dest=${2:-$1} lib reallib symlink -+ [[ -e $initdir$dest ]] && return 0 -+ if [[ -L $src ]]; then -+ reallib=$(readlink -f "$src") -+ lib=${src##*/} -+ inst_simple "$reallib" "$reallib" -+ inst_dir "${dest%/*}" -+ (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib") -+ else -+ inst_simple "$src" "$dest" -+ fi -+ -+ # Create additional symlinks. See rev_symlinks description. -+ for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do -+ [[ ! -e $initdir$symlink ]] && { -+ dinfo "Creating extra symlink: $symlink" -+ inst_symlink $symlink -+ } -+ done -+} -+ -+# find a binary. If we were not passed the full path directly, -+# search in the usual places to find the binary. -+find_binary() { -+ local binpath="/bin /sbin /usr/bin /usr/sbin" p -+ [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } -+ for p in $binpath; do -+ [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# Same as above, but specialized to install binary executables. -+# Install binary executable, and all shared library dependencies, if any. -+inst_binary() { -+ local bin target -+ bin=$(find_binary "$1") || return 1 -+ target=${2:-$bin} -+ inst_symlink $bin $target && return 0 -+ local LDSO NAME IO FILE ADDR I1 n f TLIBDIR -+ [[ -e $initdir$target ]] && return 0 -+ # I love bash! -+ LC_ALL=C ldd $bin 2>/dev/null | while read line; do -+ [[ $line = 'not a dynamic executable' ]] && return 1 -+ if [[ $line =~ not\ found ]]; then -+ derror "Missing a shared library required by $bin." -+ derror "Run \"ldd $bin\" to find out what it is." -+ derror "dracut cannot create an initrd." -+ exit 1 -+ fi -+ so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)' -+ [[ $line =~ $so_regex ]] || continue -+ FILE=${BASH_REMATCH[1]} -+ [[ -e ${initdir}$FILE ]] && continue -+ # see if we are loading an optimized version of a shared lib. -+ lib_regex='^(/lib[^/]*).*' -+ if [[ $FILE =~ $lib_regex ]]; then -+ TLIBDIR=${BASH_REMATCH[1]} -+ BASE=${FILE##*/} -+ # prefer nosegneg libs, then unoptimized ones. -+ for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do -+ [[ -e $f/$BASE ]] || continue -+ FILE=$f/$BASE -+ break -+ done -+ inst_library "$FILE" "$TLIBDIR/$BASE" -+ IF_dynamic=yes -+ continue -+ fi -+ inst_library "$FILE" -+ done -+ inst_simple "$bin" "$target" -+} -+ -+# same as above, except for shell scripts. -+# If your shell script does not start with shebang, it is not a shell script. -+inst_script() { -+ [[ -f $1 ]] || return 1 -+ local line -+ read -r -n 80 line <"$1" -+ # If debug is set, clean unprintable chars to prevent messing up the term -+ [[ $debug ]] && line=$(echo -n "$line" | tr -c -d '[:print:][:space:]') -+ shebang_regex='(#! *)(/[^ ]+).*' -+ [[ $line =~ $shebang_regex ]] || return 1 -+ inst "${BASH_REMATCH[2]}" && inst_simple "$@" -+} -+ -+# same as above, but specialized for symlinks -+inst_symlink() { -+ local src=$1 target=$initdir${2:-$1} realsrc -+ [[ -L $1 ]] || return 1 -+ [[ -L $target ]] && return 0 -+ realsrc=$(readlink -f "$src") -+ [[ $realsrc = ${realsrc##*/} ]] && realsrc=${src%/*}/$realsrc -+ inst "$realsrc" && mkdir -p "${target%/*}" && \ -+ ln -s "$realsrc" "$target" -+} -+ -+# find a udev rule in the usual places. -+find_rule() { -+ [[ -f $1 ]] && { echo "$1"; return 0; } -+ for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do -+ [[ -f $r/$1 ]] && { echo "$r/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# udev rules always get installed in the same place, so -+# create a function to install them to make life simpler. -+inst_rules() { -+ local target=/etc/udev/rules.d rule found -+ -+ inst_dir "/lib/udev/rules.d" -+ inst_dir "$target" -+ for rule in "$@"; do -+ found=$(find_rule "$rule") && \ -+ inst_simple "$found" "$target/${found##*/}" \ -+ || dinfo "Skipping udev rule: $rule" -+ done -+} -+ -+# general purpose installation function -+# Same args as above. -+inst() { -+ case $# in -+ 1) ;; -+ 2) [[ ! $initdir && -d $2 ]] && export initdir=$2 -+ [[ $initdir = $2 ]] && set $1;; -+ 3) [[ -z $initdir ]] && export initdir=$2 -+ set $1 $3;; -+ *) derror "inst only takes 1 or 2 or 3 arguments" -+ exit 1;; -+ esac -+ for x in inst_symlink inst_script inst_binary inst_simple; do -+ $x "$@" && return 0 -+ done -+ return 1 -+} -+ -+# install function specialized for hooks -+# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook -+# All hooks should be POSIX/SuS compliant, they will be sourced by init. -+inst_hook() { -+ if ! [[ -f $3 ]]; then -+ derror "Cannot install a hook ($3) that does not exist." -+ derror "Aborting initrd creation." -+ exit 1 -+ elif ! strstr "$hookdirs" "$1"; then -+ derror "No such hook type $1. Aborting initrd creation." -+ exit 1 -+ fi -+ inst_simple "$3" "/${1}/${2}${3##*/}" -+} -+ -+dracut_install() { -+ if [[ $1 = '-o' ]]; then -+ local optional=yes -+ shift -+ fi -+ while (($# > 0)); do -+ if ! inst "$1" ; then -+ if [[ $optional = yes ]]; then -+ dwarning "Skipping program $1 as it cannot be found and is flagged to be optional" -+ else -+ derror "Failed to install $1" -+ exit 1 -+ fi -+ fi -+ shift -+ done -+} -+ -+# install function decompressing the target and handling symlinks -+# $@ = list of compressed (gz or bz2) files or symlinks pointing to such files -+# -+# Function install targets in the same paths inside overlay but decompressed -+# and without extensions (.gz, .bz2). -+inst_decompress() { -+ local src dst realsrc realdst cmd -+ -+ for src in $@ -+ do -+ case ${src} in -+ *.gz) cmd='gzip -d' ;; -+ *.bz2) cmd='bzip2 -d' ;; -+ *) return 1 ;; -+ esac -+ -+ if [[ -L ${src} ]] -+ then -+ realsrc="$(readlink -f ${src})" # symlink target with extension -+ dst="${src%.*}" # symlink without extension -+ realdst="${realsrc%.*}" # symlink target without extension -+ mksubdirs "${initdir}/${src}" -+ # Create symlink without extension to target without extension. -+ ln -s "${realdst}" "${initdir}/${dst}" -+ fi -+ -+ # If the source is symlink we operate on its target. -+ [[ ${realsrc} ]] && src=${realsrc} -+ inst ${src} -+ # Decompress with chosen tool. We assume that tool changes name e.g. -+ # from 'name.gz' to 'name'. -+ ${cmd} "${initdir}${src}" -+ done -+} -+ -+# It's similar to above, but if file is not compressed, performs standard -+# install. -+# $@ = list of files -+inst_opt_decompress() { -+ local src -+ -+ for src in $@ -+ do -+ inst_decompress "${src}" || inst "${src}" -+ done -+} -+ -+module_check() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we are unconditionally included -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check $hostonly -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func check || return 0 -+ check -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_depends() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we have no deps -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check -d -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func depends || return 0 -+ depends -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_install() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/install ]] && . "$moddir/install" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func install || return 0 -+ install -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_installkernel() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/installkernel ]] && . "$moddir/installkernel" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func installkernel || return 0 -+ installkernel -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+check_module() { -+ local mod=$1; -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ local moddep; -+ # If we are already scheduled to be loaded, no need to check again. -+ strstr " $mods_to_load " " $mod " && return 0 -+ strstr " $mods_checked_as_dep " " $mod " && return 1 -+ -+ # This should never happen, but... -+ [[ -d $moddir ]] || return 1 -+ -+ [[ $2 ]] || mods_checked_as_dep+=" $mod " -+ -+ strstr " $omit_dracutmodules " " $mod " && return 1 -+ -+ if strstr " $dracutmodules $add_dracutmodules " " $mod "; then -+ module_check $mod; ret=$? -+ # explicit module, so also accept ret=255 -+ [[ $ret = 0 || $ret = 255 ]] || return 1 -+ else -+ # module not in our list -+ if [[ $dracutmodules = all ]]; then -+ # check, if we can and should install this module -+ module_check $mod || return 1 -+ else -+ # skip this module -+ return 1 -+ fi -+ fi -+ -+ for moddep in $(module_depends $mod); do -+ # handle deps as if they were manually added -+ strstr " $add_dracutmodules " " $moddep " || \ -+ add_dracutmodules+=" $moddep " -+ # if a module we depend on fail, fail also -+ check_module $moddep || return 1 -+ done -+ -+ strstr " $mods_to_load " " $mod " || \ -+ mods_to_load+=" $mod " -+ -+ return 0 -+} -+ -+check_module_dir() { -+ local modcheck; -+ local mod; -+ mods_to_load="" -+ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do -+ local mod=${moddir##*/}; mod=${mod#[0-9][0-9]} -+ check_module $mod 1 -+ done -+} -+ -+# Install a single kernel module along with any firmware it may require. -+# $1 = full path to kernel module to install -+install_kmod_with_fw() { -+ local modname=${1##*/} fwdir found -+ modname=${modname%.ko*} -+ inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \ -+ return 0 # no need to go further if the module is already installed -+ for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do -+ found='' -+ for fwdir in $fw_dir; do -+ if [[ -d $fwdir && -f $fwdir/$fw ]]; then -+ inst_simple "$fwdir/$fw" "/lib/firmware/$fw" -+ found=yes -+ fi -+ done -+ if [[ $found != yes ]]; then -+ dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\"" -+ fi -+ done -+} -+ -+# Do something with all the dependencies of a kernel module. -+# Note that kernel modules depend on themselves using the technique we use -+# $1 = function to call for each dependency we find -+# It will be passed the full path to the found kernel module -+# $2 = module to get dependencies for -+# rest of args = arguments to modprobe -+for_each_kmod_dep() { -+ local func=$1 kmod=$2 cmd modpapth options -+ shift 2 -+ modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \ -+ while read cmd modpath options; do -+ [[ $cmd = insmod ]] || continue -+ $func $modpath -+ done -+} -+ -+# filter kernel modules to install certain modules that meet specific -+# requirements. -+# $1 = function to call with module name to filter. -+# This function will be passed the full path to the module to test. -+# The behaviour of this function can vary depending on whether $hostonly is set. -+# If it is, we will only look at modules that are already in memory. -+# If it is not, we will look at all kernel modules -+# This function returns the full filenames of modules that match $1 -+filter_kernel_modules () ( -+ if ! [[ $hostonly ]]; then -+ filtercmd='find "$srcmods/kernel/drivers" "$srcmods/extra" "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz" 2>/dev/null' -+ else -+ filtercmd='cut -d " " -f 1 /dev/null' -+ fi -+ for modname in $(eval $filtercmd); do -+ case $modname in -+ *.ko) "$1" "$modname" && echo "$modname";; -+ *.ko.gz) gzip -dc "$modname" > $initdir/$$.ko -+ $1 $initdir/$$.ko && echo "$modname" -+ rm -f $initdir/$$.ko;; -+ esac -+ done -+) -+ -+# install kernel modules along with all their dependencies. -+instmods() { -+ [[ $no_kernel = yes ]] && return -+ local mod mpargs modpath modname cmd moddirname -+ while (($# > 0)); do -+ mod=${1%.ko*} -+ case $mod in -+ =*) -+ # This introduces 2 incompatible meanings for =* arguments -+ # to instmods. We need to decide which one to keep. -+ if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then -+ instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block") -+ elif [ -f $srcmods/modules.${mod#=} ]; then -+ instmods $mpargs $(cat ${srcmods}/modules.${mod#=} ) -+ else -+ instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*") -+ fi -+ ;; -+ --*) -+ mod=${mod##*/} -+ mpargs+=" $mod";; -+ i2o_scsi) shift; continue;; # Do not load this diagnostic-only module -+ *) mod=${mod##*/} -+ # if we are already installed, skip this module and go on -+ # to the next one. -+ [[ -f $initdir/$1 ]] && { shift; continue; } -+ # If we are building a host-specific initramfs and this -+ # module is not already loaded, move on to the next one. -+ [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \ -+ ! echo $add_drivers | grep -qe "\<${mod}\>" && { -+ shift; continue; -+ } -+ -+ # We use '-d' option in modprobe only if modules prefix path -+ # differs from default '/'. This allows us to use Dracut with -+ # old version of modprobe which doesn't have '-d' option. -+ moddirname=${srcmods%%/lib/modules/*} -+ [[ -n ${moddirname} ]] && moddirname="-d ${moddirname}/" -+ -+ # ok, load the module, all its dependencies, and any firmware -+ # it may require -+ for_each_kmod_dep install_kmod_with_fw $mod \ -+ --set-version $kernel ${moddirname} -+ ;; -+ esac -+ shift -+ done -+} -diff --git gen_cmdline.sh gen_cmdline.sh -index b3e451d..bc9f2dc 100755 ---- gen_cmdline.sh -+++ gen_cmdline.sh -@@ -22,6 +22,7 @@ longusage() { - echo " --logfile= Output file for debug info" - echo " --color Output debug in color" - echo " --no-color Do not output debug in color" -+ echo " --no-cleartmp Do not clear temp directory" - echo " Kernel Configuration settings" - echo " --menuconfig Run menuconfig after oldconfig" - echo " --no-menuconfig Do not run menuconfig after oldconfig" -@@ -78,6 +79,8 @@ longusage() { - echo " --splash-res= Select splash theme resolutions to install" - echo " --do-keymap-auto Forces keymap selection at boot" - echo " --no-keymap Disables keymap selection support" -+ echo " --udev Include udev in the initramfs" -+ echo " --no-udev Exclude udev from the initramfs" - echo " --lvm Include LVM support" - echo " --mdadm Include MDADM/MDMON support" - echo " --mdadm-config= Use file as mdadm.conf in initramfs" -@@ -97,6 +100,8 @@ longusage() { - echo " --unionfs Include support for unionfs" - echo " --netboot Create a self-contained env in the initramfs" - echo " --real-root= Specify a default for real_root=" -+ echo " --lscpi Include lspci into the initramfs" -+ echo " --no-lscpi Exclude lspci from the initramfs" - echo " Internals" - echo " --arch-override= Force to arch instead of autodetect" - echo " --cachedir= Override the default cache location" -@@ -232,6 +237,22 @@ parse_cmdline() { - CMD_KEYMAP=0 - print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" - ;; -+ --udev) -+ CMD_UDEV=1 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --no-udev) -+ CMD_UDEV=0 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --lspci) -+ CMD_LSPCI=1 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --no-lspci) -+ CMD_UDEV=0 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; - --lvm) - CMD_LVM=1 - print_info 2 "CMD_LVM: ${CMD_LVM}" -@@ -441,6 +462,10 @@ parse_cmdline() { - print_info 2 "USECOLOR: ${USECOLOR}" - setColorVars - ;; -+ --no-cleartmp) -+ NOCLEARTMP=1 -+ print_info 2 "NOCLEARTMP: ${NOCLEARTMP}" -+ ;; - --logfile=*) - CMD_LOGFILE=`parse_opt "$*"` - LOGFILE=`parse_opt "$*"` -diff --git gen_compile.sh gen_compile.sh -index 0758c3a..8a2339a 100755 ---- gen_compile.sh -+++ gen_compile.sh -@@ -407,7 +407,10 @@ compile_busybox() { - yes '' 2>/dev/null | compile_generic oldconfig utils - - print_info 1 'busybox: >> Compiling...' -+ OLDLOGLEVEL=$LOGLEVEL -+ LOGLEVEL=1 - compile_generic all utils -+ LOGLEVEL=$OLDLOGLEVEL - print_info 1 'busybox: >> Copying to cache...' - [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] || - gen_die 'Busybox executable does not exist!' -diff --git gen_determineargs.sh gen_determineargs.sh -index ce479cb..bda14b8 100755 ---- gen_determineargs.sh -+++ gen_determineargs.sh -@@ -107,6 +107,8 @@ determine_real_args() { - set_config_with_override BOOL SYMLINK CMD_SYMLINK - set_config_with_override STRING INSTALL_MOD_PATH CMD_INSTALL_MOD_PATH - set_config_with_override BOOL OLDCONFIG CMD_OLDCONFIG -+ set_config_with_override BOOL UDEV CMD_UDEV -+ set_config_with_override BOOL LSPCI CMD_LSPCI - set_config_with_override BOOL LVM CMD_LVM - set_config_with_override BOOL DMRAID CMD_DMRAID - set_config_with_override BOOL ISCSI CMD_ISCSI -diff --git gen_initramfs.sh gen_initramfs.sh -index 7fe4421..76b6645 100755 ---- gen_initramfs.sh -+++ gen_initramfs.sh -@@ -56,7 +56,13 @@ append_busybox() { - chmod +x "${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/default.script" - - # Set up a few default symlinks -- for i in ${BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}; do -+ if isTrue "${UDEV}" -+ then -+ BUSYBOX_APPLETS="${BUSYBOX_APPLETS:-[ ash sh uname echo cut cat}" -+ else -+ BUSYBOX_APPLETS="{$BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}" -+ fi -+ for i in ${BUSYBOX_APPLETS}; do - rm -f ${TEMP}/initramfs-busybox-temp/bin/$i > /dev/null - ln -s busybox ${TEMP}/initramfs-busybox-temp/bin/$i || - gen_die "Busybox error: could not link ${i}!" -@@ -410,7 +416,7 @@ append_firmware() { - IFS="," - for i in ${FIRMWARE_FILES} - do -- cp -L "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ -+ cp -rL "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ - done - IFS=$OLD_IFS - else -@@ -438,9 +444,71 @@ append_gpg() { - chmod a+x "${TEMP}/initramfs-gpg-temp/sbin/gpg" - cd "${TEMP}/initramfs-gpg-temp/" - find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" - rm -rf "${TEMP}/initramfs-gpg-temp" > /dev/null - } - -+append_udev() { -+ if [ -d "${TEMP}/initramfs-udev-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-udev-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-udev-temp/" -+ udevmod="${GK_SHARE}/modules/udev-rules/" -+ source ${udevmod}/module-setup.sh -+ initdir=${TEMP}/initramfs-udev-temp \ -+ moddir=${udevmod} \ -+ libdir=/lib/ \ -+ usrlibdir=/usr/lib/ \ -+ install_module -+ -+ if isTrue $LSPCI -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ fi -+ # find net modules and sound -+ (for pathname in ${INSTALL_MOD_PATH}/lib/modules/${KV}/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/drivers/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/sound -+ do -+ [[ -d $pathname ]] && find $pathname -name "*.ko" -+ done | -+ while read module;do -+ # add them prefix blacklist -+ echo "blacklist `basename $module .ko`"; -+ # concat with ready blacklist.conf -+ done;cat "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf") | -+ # sort and rewrite blacklist.conf -+ sort | uniq > "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" -+ mv "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" \ -+ "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf" -+ -+ cd "${TEMP}/initramfs-udev-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-udev-temp" > /dev/null -+} -+ -+append_lspci() { -+ if [ -d "${TEMP}/initramfs-lspci-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-lspci-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-lspci-temp/" -+ -+ initdir=${TEMP}/initramfs-lspci-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ -+ cd "${TEMP}/initramfs-lspci-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-lspci-temp" > /dev/null -+} -+ - print_list() - { - local x -@@ -489,6 +557,11 @@ append_modules() { - print_list ${!group_modules} > "${TEMP}/initramfs-modules-${KV}-temp/etc/modules/${group}" - done - cd "${TEMP}/initramfs-modules-${KV}-temp/" -+ # remove sound and media -+ for x in `find . -type d -name media -o -type d -name sound` -+ do -+ rm -r "${x}" &>/dev/null -+ done - find . | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ - || gen_die "compressing modules cpio" - cd "${TEMP}" -@@ -561,11 +634,14 @@ append_auxilary() { - done - echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" - -- if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ if ! isTrue "${UDEV}" - then -- cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -- else -- cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ then -+ cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ else -+ cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ fi - fi - if isTrue $CMD_DOKEYMAPAUTO - then -@@ -582,7 +658,7 @@ append_auxilary() { - chmod +x "${TEMP}/initramfs-aux-temp/init" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" -- chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ isTrue "${UDEV}" || chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" - - if isTrue ${NETBOOT} - then -@@ -609,6 +685,21 @@ append_data() { - fi - } - -+pack_cpio() { -+ print_info 1 " >> Pack cpio data..." -+ if [ -d "${TEMP}/initramfs-repack-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-repack-temp" -+ fi -+ mkdir -p "${TEMP}/initramfs-repack-temp" -+ cd "${TEMP}/initramfs-repack-temp" -+ # unpack and pack cpio remove double files -+ cpio -di <${CPIO} 2>/dev/null -+ find . -print | cpio ${CPIO_ARGS} | gzip -9 >"${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-repack-temp" > /dev/null -+} -+ - create_initramfs() { - print_info 1 "initramfs: >> Initializing..." - -@@ -619,6 +710,11 @@ create_initramfs() { - - append_data 'base_layout' - append_data 'auxilary' "${BUSYBOX}" -+ append_data 'udev' "${UDEV}" -+ if ! isTrue "${UDEV}" -+ then -+ append_data 'lspci' "${LSPCI}" -+ fi - append_data 'busybox' "${BUSYBOX}" - append_data 'lvm' "${LVM}" - append_data 'dmraid' "${DMRAID}" -@@ -652,8 +748,7 @@ create_initramfs() { - append_data 'overlay' - fi - -- gzip -9 "${CPIO}" -- mv -f "${CPIO}.gz" "${CPIO}" -+ pack_cpio - - if isTrue "${INTEGRATED_INITRAMFS}" - then -diff --git genkernel genkernel -index 0a06cdd..1486c61 100755 ---- genkernel -+++ genkernel -@@ -9,6 +9,7 @@ GK_V='3.4.18' - TMPDIR='/var/tmp/genkernel' - - TODEBUGCACHE=1 # Until an error occurs or LOGFILE is fully qualified. -+NOCLEARTMP=0 - - small_die() { - echo $1 -@@ -45,6 +46,7 @@ source ${GK_SHARE}/gen_initramfs.sh || gen_die "Could not read ${GK_SHARE}/gen_i - source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_moddeps.sh" - source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh" - source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh" -+source ${GK_SHARE}/dracut_funcs.sh || gen_die "Could not read ${GK_SHARE}/dracut_funcs.sh" - - TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ - -@@ -55,21 +57,25 @@ trap_cleanup(){ - } - - cleanup(){ -- if [ -n "$TEMP" -a -d "$TEMP" ]; then -- rm -rf "$TEMP" -- fi -- -- if isTrue ${POSTCLEAR} -- then -- echo -- print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -- print_info 1 "CACHE_DIR: ${CACHE_DIR}" -- CLEAR_CACHE_DIR='yes' -- setup_cache_dir -- echo -- print_info 1 "TMPDIR: ${TMPDIR}" -- clear_tmpdir -- fi -+ if [[ ${NOCLEARTMP} -ne 0 ]] -+ then -+ return -+ fi -+ if [ -n "$TEMP" -a -d "$TEMP" ]; then -+ rm -rf "$TEMP" &>/dev/null -+ fi -+ -+ if isTrue ${POSTCLEAR} -+ then -+ echo -+ print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -+ print_info 1 "CACHE_DIR: ${CACHE_DIR}" -+ CLEAR_CACHE_DIR='yes' -+ setup_cache_dir -+ echo -+ print_info 1 "TMPDIR: ${TMPDIR}" -+ clear_tmpdir -+ fi - } - - trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL -diff --git genkernel.conf genkernel.conf -index 24fcd54..41f8e06 100644 ---- genkernel.conf -+++ genkernel.conf -@@ -52,6 +52,12 @@ USECOLOR="yes" - # argument is: *+1 - # MAKEOPTS="-j2" - -+# Add udev to initramfs -+UDEV="yes" -+ -+# Add lspci to initramfs -+LSPCI="yes" -+ - # Add in LVM support from static binaries if they exist on the system, or - # compile static LVM binaries if static ones do not exist. - # LVM="no" -@@ -92,7 +98,7 @@ USECOLOR="yes" - # Specify directory to pull from - # FIRMWARE_DIR="/lib/firmware" - # Specify specific firmware files to include. This overrides FIRMWARE_DIR --# FIRMWARE_FILES="" -+FIRMWARE_FILES="/lib/firmware/radeon" - - # Enable disklabel support (copies blkid to initrd) - DISKLABEL="yes" -diff --git modules/udev-rules/01-ignore.rules modules/udev-rules/01-ignore.rules -new file mode 100644 -index 0000000..b32f22e ---- /dev/null -+++ modules/udev-rules/01-ignore.rules -@@ -0,0 +1 @@ -+KERNEL=="ram[0-9]*", OPTIONS+="ignore_device", OPTIONS+="last_rule" -diff --git modules/udev-rules/59-persistent-storage-volid.rules modules/udev-rules/59-persistent-storage-volid.rules -new file mode 100644 -index 0000000..0b798e6 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage-volid.rules -@@ -0,0 +1,7 @@ -+SUBSYSTEM!="block", GOTO="psv_end" -+ACTION!="add|change", GOTO="psv_end" -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="cciss[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", IMPORT{program}="vol_id --export $tempnode" -+LABEL="psv_end" -diff --git modules/udev-rules/59-persistent-storage.rules modules/udev-rules/59-persistent-storage.rules -new file mode 100644 -index 0000000..2b83e72 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage.rules -@@ -0,0 +1,38 @@ -+SUBSYSTEM!="block", GOTO="ps_end" -+ACTION!="add|change", GOTO="ps_end" -+ -+KERNEL=="cciss[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end" -+ -+# partitions have no md/{array_state,metadata_version} -+ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" -+ -+# container devices have a metadata version of e.g. 'external:ddf' and -+# never leave state 'inactive' -+ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -+TEST!="md/array_state", GOTO="md_end" -+ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -+ -+LABEL="md_ignore_state" -+ -+IMPORT{program}="/sbin/mdadm --detail --export $tempnode" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+OPTIONS+="link_priority=100" -+OPTIONS+="watch" -+LABEL="md_end" -+ -+ -+KERNEL!="dm-[0-9]*", GOTO="ps_end" -+ACTION=="add", GOTO="ps_end" -+IMPORT{program}="/sbin/dmsetup info -c --nameprefixes --unquoted --rows --noheadings -o name,uuid,suspended,readonly,major,minor,open,tables_loaded,names_using_dev -j%M -m%m" -+ENV{DM_NAME}!="?*", GOTO="ps_end" -+ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="ps_end" -+ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="ps_end" -+ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="ps_end" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+LABEL="ps_end" -diff --git modules/udev-rules/61-persistent-storage.rules modules/udev-rules/61-persistent-storage.rules -new file mode 100644 -index 0000000..9cfdb0b ---- /dev/null -+++ modules/udev-rules/61-persistent-storage.rules -@@ -0,0 +1,20 @@ -+SUBSYSTEM!="block", GOTO="pss_end" -+ACTION!="add|change", GOTO="pss_end" -+ -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss" -+KERNEL=="cciss[0-9]*", GOTO="do_pss" -+KERNEL=="nbd[0-9]*", GOTO="do_pss" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", GOTO="do_pss" -+ -+GOTO="pss_end" -+ -+LABEL="do_pss" -+# by-path (parent device path) -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{program}="path_id %p" -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" -+ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" -+ -+# by-label/by-uuid links (filesystem metadata) -+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -+LABEL="pss_end" -diff --git modules/udev-rules/blacklist.conf modules/udev-rules/blacklist.conf -new file mode 100644 -index 0000000..21ac71c ---- /dev/null -+++ modules/udev-rules/blacklist.conf -@@ -0,0 +1,162 @@ -+blacklist ath_pci -+blacklist evbug -+blacklist usbmouse -+blacklist usbkbd -+blacklist eepro100 -+blacklist de4x5 -+blacklist eth1394 -+blacklist snd_intel8x0m -+blacklist snd_aw2 -+blacklist i2c_i801 -+blacklist prism54 -+blacklist bcm43xx -+blacklist garmin_gps -+blacklist asus_acpi -+blacklist snd_pcsp -+blacklist pcspkr -+blacklist amd76x_edac -+blacklist ohci1394 -+blacklist sbp2 -+blacklist dv1394 -+blacklist raw1394 -+blacklist video1394 -+blacklist aty128fb -+blacklist atyfb -+blacklist radeonfb -+blacklist cirrusfb -+blacklist cyber2000fb -+blacklist cyblafb -+blacklist gx1fb -+blacklist hgafb -+blacklist i810fb -+blacklist intelfb -+blacklist kyrofb -+blacklist lxfb -+blacklist matroxfb_base -+blacklist neofb -+blacklist nvidiafb -+blacklist pm2fb -+blacklist rivafb -+blacklist s1d13xxxfb -+blacklist savagefb -+blacklist sisfb -+blacklist sstfb -+blacklist tdfxfb -+blacklist tridentfb -+blacklist vesafb -+blacklist vfb -+blacklist viafb -+blacklist vt8623fb -+blacklist ac97 -+blacklist ac97_codec -+blacklist ac97_plugin_ad1980 -+blacklist ad1848 -+blacklist ad1889 -+blacklist adlib_card -+blacklist aedsp16 -+blacklist ali5455 -+blacklist btaudio -+blacklist cmpci -+blacklist cs4232 -+blacklist cs4281 -+blacklist cs461x -+blacklist cs46xx -+blacklist emu10k1 -+blacklist es1370 -+blacklist es1371 -+blacklist esssolo1 -+blacklist forte -+blacklist gus -+blacklist i810_audio -+blacklist kahlua -+blacklist mad16 -+blacklist maestro -+blacklist maestro3 -+blacklist maui -+blacklist mpu401 -+blacklist nm256_audio -+blacklist opl3 -+blacklist opl3sa -+blacklist opl3sa2 -+blacklist pas2 -+blacklist pss -+blacklist rme96xx -+blacklist sb -+blacklist sb_lib -+blacklist sgalaxy -+blacklist sonicvibes -+blacklist sound -+blacklist sscape -+blacklist trident -+blacklist trix -+blacklist uart401 -+blacklist uart6850 -+blacklist via82cxxx_audio -+blacklist v_midi -+blacklist wavefront -+blacklist ymfpci -+blacklist ac97_plugin_wm97xx -+blacklist ad1816 -+blacklist audio -+blacklist awe_wave -+blacklist dmasound_core -+blacklist dmasound_pmac -+blacklist harmony -+blacklist sequencer -+blacklist soundcard -+blacklist usb-midi -+blacklist acquirewdt -+blacklist advantechwdt -+blacklist alim1535_wdt -+blacklist alim7101_wdt -+blacklist booke_wdt -+blacklist cpu5wdt -+blacklist eurotechwdt -+blacklist i6300esb -+blacklist i8xx_tco -+blacklist ib700wdt -+blacklist ibmasr -+blacklist indydog -+blacklist iTCO_wdt -+blacklist it8712f_wdt -+blacklist it87_wdt -+blacklist ixp2000_wdt -+blacklist ixp4xx_wdt -+blacklist machzwd -+blacklist mixcomwd -+blacklist mpc8xx_wdt -+blacklist mpcore_wdt -+blacklist mv64x60_wdt -+blacklist pc87413_wdt -+blacklist pcwd -+blacklist pcwd_pci -+blacklist pcwd_usb -+blacklist s3c2410_wdt -+blacklist sa1100_wdt -+blacklist sbc60xxwdt -+blacklist sbc7240_wdt -+blacklist sb8360 -+blacklist sc1200wdt -+blacklist sc520_wdt -+blacklist sch311_wdt -+blacklist scx200_wdt -+blacklist shwdt -+blacklist smsc37b787_wdt -+blacklist softdog -+blacklist twl4030_wdt -+blacklist w83627hf_wdt -+blacklist w83697hf_wdt -+blacklist w83697ug_wdt -+blacklist w83877f_wdt -+blacklist w83977f_wdt -+blacklist wafer5823wdt -+blacklist wdt -+blacklist wdt_pci -+blacklist wm8350_wdt -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -diff --git modules/udev-rules/load-modules.sh modules/udev-rules/load-modules.sh -new file mode 100755 -index 0000000..36972fd ---- /dev/null -+++ modules/udev-rules/load-modules.sh -@@ -0,0 +1,7 @@ -+#!/bin/sh -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+# Implement blacklisting for udev-loaded modules -+ -+modprobe -b "$@" -diff --git modules/udev-rules/module-setup.sh modules/udev-rules/module-setup.sh -new file mode 100755 -index 0000000..b835a0e ---- /dev/null -+++ modules/udev-rules/module-setup.sh -@@ -0,0 +1,57 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+install_module() { -+ # FIXME: would be nice if we didn't have to know which rules to grab.... -+ # ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies -+ # of the rules we want so that we just copy those in would be best -+ dracut_install udevd udevadm /etc/udev/udev.conf /etc/group /bin/mount /sbin/modprobe /sbin/mount.nfs /etc/services /etc/protocols /etc/netconfig -+ inst_rules 50-udev-default.rules 60-persistent-storage.rules \ -+ 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \ -+ 60-pcmcia.rules -+ mkdir -p "$initdir"/etc/modprobe.d -+ inst_simple "$moddir/blacklist.conf" /etc/modprobe.d/ -+ -+ # ignore some devices in the initrd -+ inst_rules "$moddir/01-ignore.rules" -+ -+ # for firmware loading -+ inst_rules 50-firmware.rules -+ -+ if [ ! -x /lib/udev/vol_id ]; then -+ inst_rules "$moddir/59-persistent-storage.rules" -+ else -+ inst_rules "$moddir/59-persistent-storage-volid.rules" -+ fi -+ inst_rules "$moddir/61-persistent-storage.rules" -+ -+ for i in \ -+ ata_id \ -+ cdrom_id \ -+ create_floppy_devices \ -+ edd_id \ -+ firmware.sh \ -+ firmware \ -+ firmware.agent \ -+ hotplug.functions \ -+ fw_unit_symlinks.sh \ -+ hid2hci \ -+ path_id \ -+ scsi_id \ -+ usb_id \ -+ vol_id \ -+ pcmcia-socket-startup \ -+ pcmcia-check-broken-cis \ -+ ; do -+ for utilpath in /lib/udev /sbin /bin -+ do -+ [ -e $utilpath/$i ] && dracut_install $utilpath/$i -+ done -+ done -+ -+ for i in {"$libdir","$usrlibdir"}/libnss_files*; do -+ [ -e "$i" ] && dracut_install "$i" -+ done -+} -+ diff --git a/sys-kernel/calckernel/files/calckernel-3.4.18-r8.patch b/sys-kernel/calckernel/files/calckernel-3.4.18-r8.patch deleted file mode 100644 index e687efd8d..000000000 --- a/sys-kernel/calckernel/files/calckernel-3.4.18-r8.patch +++ /dev/null @@ -1,2128 +0,0 @@ -diff --git defaults/busy-config defaults/busy-config -index 51fdc8e..a1f6858 100644 ---- defaults/busy-config -+++ defaults/busy-config -@@ -462,7 +462,7 @@ CONFIG_MDSTART=y - CONFIG_MORE=y - CONFIG_FEATURE_USE_TERMIOS=y - CONFIG_MOUNT=y --CONFIG_FEATURE_MOUNT_NFS=y -+CONFIG_FEATURE_MOUNT_NFS=n - # CONFIG_FEATURE_MOUNT_CIFS is not set - CONFIG_FEATURE_MOUNT_FLAGS=y - CONFIG_FEATURE_MOUNT_FSTAB=y -diff --git defaults/initrd.defaults defaults/initrd.defaults -index 76d72a7..0c059a5 100755 ---- defaults/initrd.defaults -+++ defaults/initrd.defaults -@@ -68,6 +68,7 @@ fi - - REAL_ROOT='' - CDROOT='0' -+SCRATCH='0' - CDROOT_DEV='' - CDROOT_TYPE='auto' - NEW_ROOT='/newroot' -diff --git defaults/initrd.scripts defaults/initrd.scripts -index 51ebcce..3979418 100755 ---- defaults/initrd.scripts -+++ defaults/initrd.scripts -@@ -187,23 +187,45 @@ cache_cd_contents() { - # TODO: Check the size of the image versus the size of our tmpfs - # along with the amount of available RAM and increase tmpfs size - # if necessary. (Not having awk sucks...) -- # z=0 -- # for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -- # cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; do -- # z=$(($z + $i)) ; done -- # echo $z -- good_msg "Copying loop file for caching..." -- # Verify that the needed directory exists -- mkdir -p "$(dirname ${NEW_ROOT}/mnt/${LOOP})" -- cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/${LOOP} -- if [ $? -ne 0 ] -+ -+ # getting memory -+ allmemory=0 -+ for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -+ cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; -+ do -+ allmemory=$(($allmemory + $i)) -+ done -+ -+ # getting size tmpfs of default -+ let curtfs=$allmemory/2 -+ -+ # getting size of image -+ let imagesize=`ls -la ${NEW_ROOT}/mnt/cdrom/${LOOP} | sed -r -n 's/(\S*\s*){4}(\S*).*/\2/p'`/20000*21 -+ let addon=$imagesize/10 -+ if [[ $curtfs -gt $(( ${imagesize} + ${addon} )) ]]; - then -- bad_msg "Failed to cache the loop file! Lack of space?" -- rm -rf ${NEW_ROOT}/mnt/livecd.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/image.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/zisofs 2>/dev/null -+ let addon=$(( $curtfs - ${imagesize} )) -+ fi -+ -+ if [[ $((${imagesize} + $addon)) -lt ${allmemory} ]]; -+ then -+ mount -o remount,size=${addon}000 -t tmpfs tmpfs ${NEW_ROOT} -+ mkdir ${NEW_ROOT}/mnt/squash -+ mount -o size=${imagesize}000 -t tmpfs tmpfs ${NEW_ROOT}/mnt/squash -+ good_msg "Copying loop file for caching..." -+ cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/squash/${LOOP} -+ if [ $? -ne 0 ] -+ then -+ bad_msg "Failed to cache the loop file! Lack of space?" -+ umount ${NEW_ROOT}/mnt/squash -+ mount -o remount,size=${curtfs}000 -t tmpfs tmpfs ${NEW_ROOT} -+ else -+ LOOPEXT='../squash/' -+ good_msg "Unmounting media from ${NEW_ROOT}/mnt/cdrom" -+ umount ${NEW_ROOT}/mnt/cdrom -+ fi - else -- LOOPEXT='../' -+ bad_msg "Too low memory for cache the loop file." - fi - fi - fi -@@ -655,7 +677,7 @@ startVolumes() { - [ -d /etc/lvm/cache ] && lvm_commands="${lvm_commands} \nvgscan" - - # To activate volumegroups on all devices in the cache -- lvm_commands="${lvm_commands} \nvgchange -ay --sysinit" -+ lvm_commands="${lvm_commands} \nvgchange -ay --sysinit --noudevsync" - - # And finally execute it all (/proc/... needed if lvm is compiled without readline) - good_msg "Scanning for and activating Volume Groups" -@@ -1082,6 +1104,38 @@ getdvhoff() { - echo $(( $(hexdump -n 4 -s $((316 + 12 * $2)) -e '"%i"' $1) * 512)) - } - -+load_union_module() { -+ UNIONTYPE="" -+ # find module for union file system -+ [ -n "$(find /lib/ -name unionfs.ko)" ] && UNIONTYPE="unionfs" -+ [ -n "$(find /lib/ -name aufs.ko)" ] && UNIONTYPE="aufs" -+ # probably aufs in kernel -+ if [ -n "$(gzip -dc /proc/config.gz | grep CONFIG_AUFS_FS=y )" ] -+ then -+ UNIONTYPE="aufs" -+ else -+ if [ -z "${UNIONTYPE}" ] -+ then -+ bad_msg "Module for union file system is not found!" -+ run_shell -+ else -+ modprobe ${UNIONTYPE} > /dev/null 2>&1 -+ # error on load union module -+ if [ -z "$(lsmod | grep $UNIONTYPE)" ] -+ then -+ bad_msg "Module for union file system is not correct!" -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ bad_msg "Probably kernel compiled without standalone patch." -+ fi -+ run_shell -+ fi -+ -+ good_msg "Loading ${UNIONTYPE}" -+ fi -+ fi -+} -+ - setup_unionfs() { - local rw_dir=$1 - local ro_dir=$2 -@@ -1101,6 +1155,7 @@ setup_unionfs() { - mkdir -p ${UNION} - good_msg "Loading fuse module" - modprobe fuse > /dev/null 2>&1 -+ load_union_module - # if [ -n "${UNIONFS}" ] - # then - # CHANGESDEV=${UNIONFS} -@@ -1130,11 +1185,102 @@ setup_unionfs() { - mkdir /tmp - mkdir -p ${UNION} - # mkdir -p $CHANGES --# mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+## mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+ -+ if [ "${SCRATCH}" -ne 0 ]; -+ then -+ good_msg "Loading in scratch mode" -+ BUILDERDIR=${UNION}/mnt/builder -+ SCRATCHDIR=${UNION}/mnt/scratch -+ DELTADIR=${rw_dir}/mnt/delta -+ WORKSPACEDIR=${rw_dir}/mnt/workspace -+ mount -o remount,rw ${rw_dir}/mnt/cdrom >/dev/null 2>&1 -+ touch ${rw_dir}/mnt/cdrom/livecd >/dev/null 2>&1 -+ if [ "$?" -ne 0 ]; -+ then -+ ISRW=0 -+ else -+ ISRW=1 -+ fi -+ -+ mkdir -p ${DELTADIR} -+ mkdir -p ${WORKSPACEDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${WORKSPACEDIR}=rw:${DELTADIR}=ro+wh:${rw_dir}/mnt/livecd=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${WORKSPACEDIR}=rw:${DELTADIR}=ro:${rw_dir}/mnt/livecd=ro unionfs ${UNION} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${SCRATCHDIR}/calculate -+ mkdir -p ${SCRATCHDIR}/delta -+ mkdir -p ${SCRATCHDIR}/workspace -+ mount -o bind ${rw_dir}/mnt/delta ${SCRATCHDIR}/delta -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind ${rw_dir}/mnt/workspace ${SCRATCHDIR}/workspace -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${BUILDERDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro none ${BUILDERDIR} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro unionfs ${BUILDERDIR} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind,ro ${rw_dir}/mnt/livecd ${SCRATCHDIR}/calculate -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ if [ "$ISRW" -ne 0 ]; -+ then -+ FLASHDIR=${UNION}/mnt/flash -+ mkdir -p ${FLASHDIR} -+ mount -o bind ${rw_dir}/mnt/cdrom ${FLASHDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ mkdir -p ${CDROMDIR} -+ mount -o bind,ro ${rw_dir}/mnt/cdrom ${CDROMDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ fi -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ LIVECDDIR=${UNION}/mnt/livecd -+ -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${rw_dir}:${ro_dir}=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${rw_dir}:${ro_dir}=ro unionfs ${UNION} -+ fi -+ -+ if [[ -n "$( echo ${LOOPEXT} | grep squash )" ]]; -+ then -+ mkdir -p ${UNION}/mnt/squash -+ mount -o bind ${NEW_ROOT}/mnt/squash ${UNION}/mnt/squash &>/dev/null -+ fi -+ -+ chmod 0755 ${UNION} -+ mount -o bind ${rw_dir}/mnt/cdrom ${CDROMDIR} &>/dev/null -+ mount -o bind ${rw_dir}/mnt/livecd ${LIVECDDIR} &>/dev/null -+ ret=$? -+ fi -+ -+ chmod 1777 ${UNION}/tmp - good_msg "Creating union mount" -- unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -- ret=$? -- if [ ${ret} -ne 0 ] -+# unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -+# ret=$? -+ if [ "${ret}" -ne 0 ] - then - bad_msg "Can't setup union mount!" - USE_UNIONFS_NORMAL=0 -@@ -1143,3 +1289,121 @@ setup_unionfs() { - USE_UNIONFS_NORMAL=0 - fi - } -+ -+load_videodrv() { -+ good_msg "Loading frame buffer video driver" -+ # find all available fb drivers -+ videodrv_count=$(find /lib/modules \ -+ -name "nouveau.ko" -o \ -+ -name "uvesafb.ko" -o \ -+ -name "i915.ko" -o \ -+ -name "radeon.ko" | -+ grep -c "") -+ # load specified videodrv -+ modules_list= -+ case "${VIDEODRV}" in -+ nouveau) -+ modules_list="nouveau" -+ ;; -+ radeon) -+ modules_list="radeon" -+ ;; -+ i915|intel) -+ modules_list="i915" -+ ;; -+ ""|auto) -+ # if not livecd and initramfs otimized (aviailable only one video driver) -+ if [ "${CDROOT}" != '1' -a "${videodrv_count}" -le 2 ] -+ then -+ modules_list="nouveau i915 radeon" -+ else -+ if [[ -x /usr/sbin/lspci ]] -+ then -+ if lspci | grep -m1 VGA | grep -qi intel -+ then -+ modules_list="i915" -+ elif lspci | grep -m1 VGA | grep -qi nvidia -+ then -+ modules_list="nouveau" -+ elif lspci | grep -m1 VGA | grep -q -e "Ati" -e "ATI" -+ then -+ modules_list="radeon" -+ else -+ modules_list="" -+ fi -+ else -+ modules_list="i915" -+ fi -+ fi -+ ;; -+ esac -+ for x in $modules_list -+ do -+ if [ "`find /lib/modules -name "${x}.ko" | grep -c ''`" -eq "1" ] -+ then -+ modprobe "${x}" modeset=${USE_MODESET} &>/dev/null -+ lsmod | grep -q "^${x}" && \ -+ [ "`cat /sys/module/${x}/refcnt`" -gt 0 ] && return 0 -+ fi -+ done -+ # else load uvesafb with specified video resolution -+ if [ -n "${VIDEORES}" ] -+ then -+ if ! echo $VIDEORES | grep -q "\-" -+ then -+ VIDEORES="${VIDEORES}-32" -+ fi -+ else -+ VIDEORES="1024x768-32" -+ fi -+ modprobe uvesafb mode_option=${VIDEORES} &>/dev/null -+} -+ -+start_udev() -+{ -+ # start udev -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ echo "" >/proc/sys/kernel/hotplug -+ udevd --daemon &>/dev/null -+ udevadm settle -+ fi -+} -+ -+stop_udev() -+{ -+ # kill udevd -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ pkill udevd &>/dev/null -+ fi -+} -+ -+populate_dev() -+{ -+ good_msg 'Activating udev' -+ # Do not run any init-scripts -+ udevadm control --property=do_not_run_plug_service=1 -+ -+ if [ "${REAL_ROOT}" == "/dev/nfs" ] -+ then -+ # clean blacklist because there are net drivers -+ # keep black video for correct loading prop. nvidia -+ cat </etc/modprobe.d/blacklist.conf -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -+EOF -+ fi -+ # discarding net drivers placed into blacklist.conf -+ udevadm trigger --action="add" -+ -+ # we can speed up booting under these conditions: -+ # * using devtmpfs so kernel creates device nodes for us -+ # * only using kernel created device nodes at boot (in /etc/fstab and elsewhere) -+ udevadm settle --timeout=60 -+} -diff --git defaults/linuxrc defaults/linuxrc -index 0843f5d..8109d09 100755 ---- defaults/linuxrc -+++ defaults/linuxrc -@@ -39,6 +39,13 @@ FAKE_ROOT='' - REAL_ROOTFLAGS='' - ROOTFSTYPE='auto' - CRYPT_SILENT=0 -+VIDEODRV='' -+USE_UDEV=1 -+USE_MODESET=1 -+if [ -e "/etc/calculate/calculate.ini" ] -+then -+ source /etc/calculate/calculate.ini -+fi - for x in ${CMDLINE} - do - case "${x}" in -@@ -57,6 +64,57 @@ do - init_opts\=*) - INIT_OPTS=`parse_opt "${x}"` - ;; -+ nokms) -+ USE_MODESET=0 -+ ;; -+ kms) -+ USE_MODESET=1 -+ ;; -+ noudev) -+ USE_UDEV=0 -+ ;; -+ calculate\=*) -+ CALCULATE=`parse_opt "${x}"` -+ if [[ "${CALCULATE//:/}" != "${CALCULATE}" ]] -+ then -+ for i in ${CALCULATE//,/ } -+ do -+ case "${i}" in -+ video:*) -+ VIDEODRV=`echo "${i}" | cut -s -d: -f2-` -+ ;; -+ resolution:*) -+ RES=`echo "${i}" | cut -s -d: -f2-` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ ;; -+ esac -+ done -+ else -+ RES=`echo "${CALCULATE}" | cut -s -d, -f4` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ VIDEODRV=`echo "${CALCULATE}" | cut -s -d, -f5` -+ fi -+ ;; -+ video\=*) -+ VR=`parse_opt "${x}"` -+ for i in ${VR//,/ } -+ do -+ if [ -z "${i//[0-9-x@]}" ] -+ then -+ VIDEORES=${i} -+ fi -+ done -+ ;; -+ # Scratch usbload -+ scratch) -+ SCRATCH=1 -+ ;; - # Livecd options - cdroot) - CDROOT=1 -@@ -251,15 +309,24 @@ then - REAL_ROOT="${FAKE_ROOT}" - fi - --splash 'init' -- --cmdline_hwopts -+# check udevd -+[ ! -x /sbin/udevd ] && USE_UDEV=0 - - # Mount sysfs - mount_sysfs - -+# start udev -+start_udev -+ -+# load kernel video driver -+load_videodrv -+ -+splash 'init' -+ -+cmdline_hwopts -+ - # Setup hotplugging for firmware loading --setup_hotplug -+[ "${USE_UDEV}" == "0" ] && setup_hotplug - - # Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel - if [ -z "${DO_modules}" ] -@@ -269,7 +336,7 @@ elif [ -d "/lib/modules/${KV}" ] - then - good_msg 'Loading modules' - # Load appropriate kernel modules -- if [ "${NODETECT}" != '1' ] -+ if [ "${USE_UDEV}" != '1' -a "${NODETECT}" != '1' ] - then - for modules in ${MY_HWOPTS} - do -@@ -285,14 +352,20 @@ fi - # Apply scan delay if specified - sdelay - --# Setup slow USB bits --setup_slowusb -+if [ "${USE_UDEV}" == "1" ] -+then -+ # populate /dev with devices already found by the kernel -+ populate_dev -+else -+ # Setup slow USB bits -+ setup_slowusb - --# Start device manager --start_dev_mgr -+ # Start device manager -+ start_dev_mgr - --# if doslowusb is passed, pause other 10 seconds here, after mdev load --[ "${DO_slowusb}" ] && sleep 10 -+ # if doslowusb is passed, pause other 10 seconds here, after mdev load -+ [ "${DO_slowusb}" ] && sleep 10 -+fi - - # Start iSCSI - if [ -e /bin/iscsistart ] -@@ -509,9 +582,50 @@ do - then - break - else -- bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -- got_good_root=0 -- REAL_ROOT='' -+ # check for scratch -+ if [ -e ${NEW_ROOT}/livecd.squashfs -a -d ${NEW_ROOT}/delta -a -d ${NEW_ROOT}/workspace ]; -+ then -+ good_msg 'Found scratch data...' -+ load_union_module -+ modprobe squashfs >/dev/null -+ if mount -o remount,rw ${NEW_ROOT}; -+ then -+ mkdir -p ${NEW_ROOT}/calculate && mkdir -p /union && mkdir -p ${NEW_ROOT}/workspace/mnt/builder && mkdir -p ${NEW_ROOT}/workspace/mnt/scratch -+ if mount -o loop,ro -t squashfs ${NEW_ROOT}/livecd.squashfs ${NEW_ROOT}/calculate; -+ then -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/workspace=rw:${NEW_ROOT}/delta=ro+wh:${NEW_ROOT}/calculate=ro none /union; -+ then -+ mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/delta=rw:${NEW_ROOT}/calculate=ro none /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers!' -+ run_shell -+ fi -+ else -+ if mount -t unionfs -o ro,dirs=${NEW_ROOT}/workspace:${NEW_ROOT}/delta=ro:${NEW_ROOT}/calculate=ro unionfs /union; -+ then -+ mount -t unionfs -o ro,dirs=${NEW_ROOT}/delta:${NEW_ROOT}/calculate=ro unionfs /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers' -+ run_shell -+ fi -+ fi -+ else -+ bad_msg 'Could not mount scratch squashfs image' -+ fi -+ else -+ bad_msg 'Could not remount ${NEW_ROOT}' -+ fi -+ else -+ bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -+ got_good_root=0 -+ REAL_ROOT='' -+ fi - fi - else - bad_msg "Could not mount specified ROOT, try again" -@@ -723,9 +837,12 @@ cd "${CHROOT}" - mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null - echo -ne "${BOLD}.${NORMAL}" - -+# stop udev before move mount points -+stop_udev -+ - # If devtmpfs is mounted, try move it to the new root - # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise --for fs in /dev /sys /proc -+for fs in "/dev " /sys /proc - do - if grep -qs "$fs" /proc/mounts - then -diff --git defaults/modprobe defaults/modprobe -index ba2d890..9280357 100755 ---- defaults/modprobe -+++ defaults/modprobe -@@ -10,8 +10,6 @@ usage() { - echo - echo 'Example:' - echo ' modprobe eepro100' -- echo -- echo 'Note: Do not pass the suffix to modprobe!' - exit 1 - } - -@@ -81,14 +79,29 @@ modprobe2() { - usage - exit 1 - fi -- real_path=`real_mod_path ${1}` -+ local modname=${1} -+ local quiet='' -+ local params='' -+ shift -+ for x in $@ -+ do -+ case ${x} in -+ -n) -+ quiet=1 -+ ;; -+ *) -+ params="${params} ${x}" -+ ;; -+ esac -+ done -+ real_path=`real_mod_path ${modname}` - if [ "${real_path}" = '' -o "${real_path}" = ' ' ] - then -- [ "${2}" = '-n' ] && echo -n " -> $1" -+ [ "${quiet}" = '1' ] && echo -n " -> ${modname}" - echo ' module not found.' - exit 2 - fi -- modlist=`modules_dep_list ${1}` -+ modlist=`modules_dep_list ${modname}` - if [ "${modlist}" != '' -a "${modlist}" != ' ' ] - then - deps=`strip_mod_paths ${modlist}` -@@ -110,13 +123,13 @@ modprobe2() { - filler=1 - fi - done -- ${INSMOD} ${real_path} > /dev/null 2>&1 -+ ${INSMOD} ${real_path} ${params} > /dev/null 2>&1 - ret=$? - if [ ${ret} -eq 0 ] - then - echoAppend=' loaded.' -- [ "${2}" = '-n' ] && echoFlags='-n' && echoAppend=', ' -- echo ${echoFlags} "${1}${echoAppend}" -+ [ "${quiet}" = '1' ] && echoFlags='-n' && echoAppend=', ' -+ echo ${echoFlags} "${modname}${echoAppend}" - fi - return $ret - } -@@ -132,7 +145,7 @@ do - LOADED_MODULES="${LOADED_MODULES} ${x}" - done - --modprobe2 ${1} -+modprobe2 ${@} - modprobe_ret=$? - - [ -f '/modules.cache' ] && rm -f /modules.cache > /dev/null 2>&1 -diff --git dracut_funcs.sh dracut_funcs.sh -new file mode 100755 -index 0000000..e80a638 ---- /dev/null -+++ dracut_funcs.sh -@@ -0,0 +1,752 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+# -+# functions used by dracut and other tools. -+# -+# Copyright 2005-2009 Red Hat, Inc. All rights reserved. -+# -+# 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; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+# -+ -+IF_RTLD="" -+IF_dynamic="" -+ -+# Generic substring function. If $2 is in $1, return 0. -+strstr() { [[ $1 =~ $2 ]]; } -+ -+# Create all subdirectories for given path without creating the last element. -+# $1 = path -+mksubdirs() { mkdir -p ${1%/*}; } -+ -+# Version comparision function. Assumes Linux style version scheme. -+# $1 = version a -+# $2 = comparision op (gt, ge, eq, le, lt, ne) -+# $3 = version b -+vercmp() { -+ local n1=(${1//./ }) op=$2 n2=(${3//./ }) i res -+ -+ for ((i=0; ; i++)) -+ do -+ if [[ ! ${n1[i]}${n2[i]} ]]; then res=0 -+ elif ((${n1[i]:-0} > ${n2[i]:-0})); then res=1 -+ elif ((${n1[i]:-0} < ${n2[i]:-0})); then res=2 -+ else continue -+ fi -+ break -+ done -+ -+ case $op in -+ gt) ((res == 1));; -+ ge) ((res != 2));; -+ eq) ((res == 0));; -+ le) ((res != 1));; -+ lt) ((res == 2));; -+ ne) ((res != 0));; -+ esac -+} -+ -+is_func() { -+ [[ $(type -t $1) = "function" ]] -+} -+ -+# Log initrd creation. -+if ! [[ $dracutlogfile ]]; then -+ [[ $dracutbasedir = /usr/share/dracut ]] && \ -+ dracutlogfile=/var/log/dracut.log || \ -+ dracutlogfile=/tmp/dracut.log -+# [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log -+ if [[ -w $dracutlogfile ]]; then -+ >"$dracutlogfile" -+ fi -+fi -+ -+dwarning() { -+ echo "W: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "W: $@" >>"$dracutlogfile" -+} -+ -+dinfo() { -+ [[ $beverbose ]] && echo "I: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "I: $@" >>"$dracutlogfile" -+} -+ -+derror() { -+ echo "E: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile" -+} -+ -+# Function prints global variables in format name=value line by line. -+# $@ = list of global variables' name -+print_vars() { -+ local var value -+ -+ for var in $@ -+ do -+ value=$(eval echo \$$var) -+ [[ ${value} ]] && echo "${var}=\"${value}\"" -+ done -+} -+ -+get_fs_env() { -+ [[ $1 ]] || return -+ eval $(udevadm info --query=env --name=$1|egrep 'ID_FS_(TYPE|UUID)=') -+ [[ $ID_FS_TYPE ]] && return -+ -+ if [[ -x /lib/udev/vol_id ]]; then -+ eval $(/lib/udev/vol_id --export $1) -+ elif find_binary blkid >/dev/null; then -+ eval $(blkid -o udev $1) -+ else -+ return 1 -+ fi -+} -+ -+get_fs_type() ( -+ [[ $1 ]] || return -+ if [[ $1 != ${1#/dev/block/nfs:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs3:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs4:} ]]; then -+ echo "nfs" -+ return -+ fi -+ get_fs_env $1 || return -+ echo $ID_FS_TYPE -+) -+ -+get_fs_uuid() ( -+ get_fs_env $1 || return -+ echo $ID_FS_UUID -+) -+ -+# finds the major:minor of the block device backing the root filesystem. -+find_block_device() { -+ local x mpt majmin dev fs misc maj min -+ if [[ $use_fstab != yes ]]; then -+ while read x x majmin x mpt x x fs dev misc; do -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $fs = btrfs ]] && { -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ } -+ if [[ $mpt = $1 ]] && [[ ${majmin#0:} = $majmin ]]; then -+ echo $majmin; -+ return 0 # we have a winner! -+ fi -+ done < /proc/self/mountinfo -+ fi -+ # fall back to /etc/fstab -+ while read dev mpt fs misc; do -+ if [[ $mpt = $1 ]]; then -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $dev != ${dev#UUID=} ]] && dev=/dev/disk/by-uuid/${dev#UUID=} -+ [[ $dev != ${dev#LABEL=} ]] && dev=/dev/disk/by-label/${dev#LABEL=} -+ [[ -b $dev ]] || return 1 # oops, not a block device. -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ fi -+ done < /etc/fstab -+ return 1; -+} -+ -+find_root_block_device() { find_block_device /; } -+ -+# Walk all the slave relationships for a given block device. -+# Stop when our helper function returns success -+# $1 = function to call on every found block device -+# $2 = block device in major:minor format -+check_block_and_slaves() { -+ local x -+ [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. -+ "$1" $2 && return -+ check_vol_slaves "$@" && return 0 -+ if [[ -f /sys/dev/block/$2/../dev ]]; then -+ check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0 -+ fi -+ [[ -d /sys/dev/block/$2/slaves ]] || return 1 -+ for x in /sys/dev/block/$2/slaves/*/dev; do -+ [[ -f $x ]] || continue -+ check_block_and_slaves $1 $(cat "$x") && return 0 -+ done -+ return 1 -+} -+ -+get_numeric_dev() { -+ ls -lH "$1" | { read a b c d maj min rest; printf "%d:%d" ${maj%%,} $min;} -+} -+ -+# ugly workaround for the lvm design -+# There is no volume group device, -+# so, there are no slave devices for volume groups. -+# Logical volumes only have the slave devices they really live on, -+# but you cannot create the logical volume without the volume group. -+# And the volume group might be bigger than the devices the LV needs. -+check_vol_slaves() { -+ for i in /dev/mapper/*; do -+ lv=$(get_numeric_dev $i) -+ if [[ $lv = $2 ]]; then -+ vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null) -+ # strip space -+ vg=$(echo $vg) -+ if [[ $vg ]]; then -+ for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \ -+ do -+ check_block_and_slaves $1 $(get_numeric_dev $pv) \ -+ && return 0 -+ done -+ fi -+ fi -+ done -+ return 1 -+} -+ -+# Install a directory, keeping symlinks as on the original system. -+# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file" -+# will create ${initdir}/lib64, ${initdir}/lib64/file, -+# and a symlink ${initdir}/lib -> lib64. -+inst_dir() { -+ local dir="$1" -+ [[ -e ${initdir}$dir ]] && return 0 -+ -+ # iterate over parent directories -+ local file="" -+ local IFS="/" -+ for part in $dir; do -+ [[ $part ]] || continue -+ file="$file/$part" -+ [[ -e ${initdir}$file ]] && continue -+ -+ if [[ -L $file ]]; then -+ # create link as the original -+ local target=$(readlink "$file") -+ ln -sfn "$target" "${initdir}$file" || return 1 -+ # resolve relative path and recursively install destionation -+ [[ $target = ${target##*/} ]] && target="${file%/*}/$target" -+ inst_dir "$target" -+ else -+ # create directory -+ mkdir -p "${initdir}$file" || return 1 -+ fi -+ done -+} -+ -+# $1 = file to copy to ramdisk -+# $2 (optional) Name for the file on the ramdisk -+# Location of the image dir is assumed to be $initdir -+# We never overwrite the target if it exists. -+inst_simple() { -+ local src target -+ [[ -f $1 ]] || return 1 -+ src=$1 target="${2:-$1}" -+ if ! [[ -d ${initdir}$target ]]; then -+ [[ -e ${initdir}$target ]] && return 0 -+ inst_dir "${target%/*}" -+ fi -+ dinfo "Installing $src" -+ cp -pfL "$src" "${initdir}$target" -+} -+ -+# find symlinks linked to given library file -+# $1 = library file -+# Function searches for symlinks by stripping version numbers appended to -+# library filename, checks if it points to the same target and finally -+# prints the list of symlinks to stdout. -+# -+# Example: -+# rev_lib_symlinks libfoo.so.8.1 -+# output: libfoo.so.8 libfoo.so -+# (Only if libfoo.so.8 and libfoo.so exists on host system.) -+rev_lib_symlinks() { -+ [[ ! $1 ]] && return 0 -+ -+ local fn="$1" orig="$(readlink -f "$1")" links='' -+ -+ [[ ${fn} =~ .*\.so\..* ]] || return 1 -+ -+ until [[ ${fn##*.} == so ]]; do -+ fn="${fn%.*}" -+ [[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}" -+ done -+ -+ echo ${links} -+} -+ -+# Same as above, but specialized to handle dynamic libraries. -+# It handles making symlinks according to how the original library -+# is referenced. -+inst_library() { -+ local src=$1 dest=${2:-$1} lib reallib symlink -+ [[ -e $initdir$dest ]] && return 0 -+ if [[ -L $src ]]; then -+ reallib=$(readlink -f "$src") -+ lib=${src##*/} -+ inst_simple "$reallib" "$reallib" -+ inst_dir "${dest%/*}" -+ (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib") -+ else -+ inst_simple "$src" "$dest" -+ fi -+ -+ # Create additional symlinks. See rev_symlinks description. -+ for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do -+ [[ ! -e $initdir$symlink ]] && { -+ dinfo "Creating extra symlink: $symlink" -+ inst_symlink $symlink -+ } -+ done -+} -+ -+# find a binary. If we were not passed the full path directly, -+# search in the usual places to find the binary. -+find_binary() { -+ local binpath="/bin /sbin /usr/bin /usr/sbin" p -+ [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } -+ for p in $binpath; do -+ [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# Same as above, but specialized to install binary executables. -+# Install binary executable, and all shared library dependencies, if any. -+inst_binary() { -+ local bin target -+ bin=$(find_binary "$1") || return 1 -+ target=${2:-$bin} -+ inst_symlink $bin $target && return 0 -+ local LDSO NAME IO FILE ADDR I1 n f TLIBDIR -+ [[ -e $initdir$target ]] && return 0 -+ # I love bash! -+ LC_ALL=C ldd $bin 2>/dev/null | while read line; do -+ [[ $line = 'not a dynamic executable' ]] && return 1 -+ if [[ $line =~ not\ found ]]; then -+ derror "Missing a shared library required by $bin." -+ derror "Run \"ldd $bin\" to find out what it is." -+ derror "dracut cannot create an initrd." -+ exit 1 -+ fi -+ so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)' -+ [[ $line =~ $so_regex ]] || continue -+ FILE=${BASH_REMATCH[1]} -+ [[ -e ${initdir}$FILE ]] && continue -+ # see if we are loading an optimized version of a shared lib. -+ lib_regex='^(/lib[^/]*).*' -+ if [[ $FILE =~ $lib_regex ]]; then -+ TLIBDIR=${BASH_REMATCH[1]} -+ BASE=${FILE##*/} -+ # prefer nosegneg libs, then unoptimized ones. -+ for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do -+ [[ -e $f/$BASE ]] || continue -+ FILE=$f/$BASE -+ break -+ done -+ inst_library "$FILE" "$TLIBDIR/$BASE" -+ IF_dynamic=yes -+ continue -+ fi -+ inst_library "$FILE" -+ done -+ inst_simple "$bin" "$target" -+} -+ -+# same as above, except for shell scripts. -+# If your shell script does not start with shebang, it is not a shell script. -+inst_script() { -+ [[ -f $1 ]] || return 1 -+ local line -+ read -r -n 80 line <"$1" -+ # If debug is set, clean unprintable chars to prevent messing up the term -+ [[ $debug ]] && line=$(echo -n "$line" | tr -c -d '[:print:][:space:]') -+ shebang_regex='(#! *)(/[^ ]+).*' -+ [[ $line =~ $shebang_regex ]] || return 1 -+ inst "${BASH_REMATCH[2]}" && inst_simple "$@" -+} -+ -+# same as above, but specialized for symlinks -+inst_symlink() { -+ local src=$1 target=$initdir${2:-$1} realsrc -+ [[ -L $1 ]] || return 1 -+ [[ -L $target ]] && return 0 -+ realsrc=$(readlink -f "$src") -+ [[ $realsrc = ${realsrc##*/} ]] && realsrc=${src%/*}/$realsrc -+ inst "$realsrc" && mkdir -p "${target%/*}" && \ -+ ln -s "$realsrc" "$target" -+} -+ -+# find a udev rule in the usual places. -+find_rule() { -+ [[ -f $1 ]] && { echo "$1"; return 0; } -+ for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do -+ [[ -f $r/$1 ]] && { echo "$r/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# udev rules always get installed in the same place, so -+# create a function to install them to make life simpler. -+inst_rules() { -+ local target=/etc/udev/rules.d rule found -+ -+ inst_dir "/lib/udev/rules.d" -+ inst_dir "$target" -+ for rule in "$@"; do -+ found=$(find_rule "$rule") && \ -+ inst_simple "$found" "$target/${found##*/}" \ -+ || dinfo "Skipping udev rule: $rule" -+ done -+} -+ -+# general purpose installation function -+# Same args as above. -+inst() { -+ case $# in -+ 1) ;; -+ 2) [[ ! $initdir && -d $2 ]] && export initdir=$2 -+ [[ $initdir = $2 ]] && set $1;; -+ 3) [[ -z $initdir ]] && export initdir=$2 -+ set $1 $3;; -+ *) derror "inst only takes 1 or 2 or 3 arguments" -+ exit 1;; -+ esac -+ for x in inst_symlink inst_script inst_binary inst_simple; do -+ $x "$@" && return 0 -+ done -+ return 1 -+} -+ -+# install function specialized for hooks -+# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook -+# All hooks should be POSIX/SuS compliant, they will be sourced by init. -+inst_hook() { -+ if ! [[ -f $3 ]]; then -+ derror "Cannot install a hook ($3) that does not exist." -+ derror "Aborting initrd creation." -+ exit 1 -+ elif ! strstr "$hookdirs" "$1"; then -+ derror "No such hook type $1. Aborting initrd creation." -+ exit 1 -+ fi -+ inst_simple "$3" "/${1}/${2}${3##*/}" -+} -+ -+dracut_install() { -+ if [[ $1 = '-o' ]]; then -+ local optional=yes -+ shift -+ fi -+ while (($# > 0)); do -+ if ! inst "$1" ; then -+ if [[ $optional = yes ]]; then -+ dwarning "Skipping program $1 as it cannot be found and is flagged to be optional" -+ else -+ derror "Failed to install $1" -+ exit 1 -+ fi -+ fi -+ shift -+ done -+} -+ -+# install function decompressing the target and handling symlinks -+# $@ = list of compressed (gz or bz2) files or symlinks pointing to such files -+# -+# Function install targets in the same paths inside overlay but decompressed -+# and without extensions (.gz, .bz2). -+inst_decompress() { -+ local src dst realsrc realdst cmd -+ -+ for src in $@ -+ do -+ case ${src} in -+ *.gz) cmd='gzip -d' ;; -+ *.bz2) cmd='bzip2 -d' ;; -+ *) return 1 ;; -+ esac -+ -+ if [[ -L ${src} ]] -+ then -+ realsrc="$(readlink -f ${src})" # symlink target with extension -+ dst="${src%.*}" # symlink without extension -+ realdst="${realsrc%.*}" # symlink target without extension -+ mksubdirs "${initdir}/${src}" -+ # Create symlink without extension to target without extension. -+ ln -s "${realdst}" "${initdir}/${dst}" -+ fi -+ -+ # If the source is symlink we operate on its target. -+ [[ ${realsrc} ]] && src=${realsrc} -+ inst ${src} -+ # Decompress with chosen tool. We assume that tool changes name e.g. -+ # from 'name.gz' to 'name'. -+ ${cmd} "${initdir}${src}" -+ done -+} -+ -+# It's similar to above, but if file is not compressed, performs standard -+# install. -+# $@ = list of files -+inst_opt_decompress() { -+ local src -+ -+ for src in $@ -+ do -+ inst_decompress "${src}" || inst "${src}" -+ done -+} -+ -+module_check() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we are unconditionally included -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check $hostonly -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func check || return 0 -+ check -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_depends() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we have no deps -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check -d -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func depends || return 0 -+ depends -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_install() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/install ]] && . "$moddir/install" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func install || return 0 -+ install -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_installkernel() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/installkernel ]] && . "$moddir/installkernel" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func installkernel || return 0 -+ installkernel -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+check_module() { -+ local mod=$1; -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ local moddep; -+ # If we are already scheduled to be loaded, no need to check again. -+ strstr " $mods_to_load " " $mod " && return 0 -+ strstr " $mods_checked_as_dep " " $mod " && return 1 -+ -+ # This should never happen, but... -+ [[ -d $moddir ]] || return 1 -+ -+ [[ $2 ]] || mods_checked_as_dep+=" $mod " -+ -+ strstr " $omit_dracutmodules " " $mod " && return 1 -+ -+ if strstr " $dracutmodules $add_dracutmodules " " $mod "; then -+ module_check $mod; ret=$? -+ # explicit module, so also accept ret=255 -+ [[ $ret = 0 || $ret = 255 ]] || return 1 -+ else -+ # module not in our list -+ if [[ $dracutmodules = all ]]; then -+ # check, if we can and should install this module -+ module_check $mod || return 1 -+ else -+ # skip this module -+ return 1 -+ fi -+ fi -+ -+ for moddep in $(module_depends $mod); do -+ # handle deps as if they were manually added -+ strstr " $add_dracutmodules " " $moddep " || \ -+ add_dracutmodules+=" $moddep " -+ # if a module we depend on fail, fail also -+ check_module $moddep || return 1 -+ done -+ -+ strstr " $mods_to_load " " $mod " || \ -+ mods_to_load+=" $mod " -+ -+ return 0 -+} -+ -+check_module_dir() { -+ local modcheck; -+ local mod; -+ mods_to_load="" -+ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do -+ local mod=${moddir##*/}; mod=${mod#[0-9][0-9]} -+ check_module $mod 1 -+ done -+} -+ -+# Install a single kernel module along with any firmware it may require. -+# $1 = full path to kernel module to install -+install_kmod_with_fw() { -+ local modname=${1##*/} fwdir found -+ modname=${modname%.ko*} -+ inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \ -+ return 0 # no need to go further if the module is already installed -+ for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do -+ found='' -+ for fwdir in $fw_dir; do -+ if [[ -d $fwdir && -f $fwdir/$fw ]]; then -+ inst_simple "$fwdir/$fw" "/lib/firmware/$fw" -+ found=yes -+ fi -+ done -+ if [[ $found != yes ]]; then -+ dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\"" -+ fi -+ done -+} -+ -+# Do something with all the dependencies of a kernel module. -+# Note that kernel modules depend on themselves using the technique we use -+# $1 = function to call for each dependency we find -+# It will be passed the full path to the found kernel module -+# $2 = module to get dependencies for -+# rest of args = arguments to modprobe -+for_each_kmod_dep() { -+ local func=$1 kmod=$2 cmd modpapth options -+ shift 2 -+ modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \ -+ while read cmd modpath options; do -+ [[ $cmd = insmod ]] || continue -+ $func $modpath -+ done -+} -+ -+# filter kernel modules to install certain modules that meet specific -+# requirements. -+# $1 = function to call with module name to filter. -+# This function will be passed the full path to the module to test. -+# The behaviour of this function can vary depending on whether $hostonly is set. -+# If it is, we will only look at modules that are already in memory. -+# If it is not, we will look at all kernel modules -+# This function returns the full filenames of modules that match $1 -+filter_kernel_modules () ( -+ if ! [[ $hostonly ]]; then -+ filtercmd='find "$srcmods/kernel/drivers" "$srcmods/extra" "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz" 2>/dev/null' -+ else -+ filtercmd='cut -d " " -f 1 /dev/null' -+ fi -+ for modname in $(eval $filtercmd); do -+ case $modname in -+ *.ko) "$1" "$modname" && echo "$modname";; -+ *.ko.gz) gzip -dc "$modname" > $initdir/$$.ko -+ $1 $initdir/$$.ko && echo "$modname" -+ rm -f $initdir/$$.ko;; -+ esac -+ done -+) -+ -+# install kernel modules along with all their dependencies. -+instmods() { -+ [[ $no_kernel = yes ]] && return -+ local mod mpargs modpath modname cmd moddirname -+ while (($# > 0)); do -+ mod=${1%.ko*} -+ case $mod in -+ =*) -+ # This introduces 2 incompatible meanings for =* arguments -+ # to instmods. We need to decide which one to keep. -+ if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then -+ instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block") -+ elif [ -f $srcmods/modules.${mod#=} ]; then -+ instmods $mpargs $(cat ${srcmods}/modules.${mod#=} ) -+ else -+ instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*") -+ fi -+ ;; -+ --*) -+ mod=${mod##*/} -+ mpargs+=" $mod";; -+ i2o_scsi) shift; continue;; # Do not load this diagnostic-only module -+ *) mod=${mod##*/} -+ # if we are already installed, skip this module and go on -+ # to the next one. -+ [[ -f $initdir/$1 ]] && { shift; continue; } -+ # If we are building a host-specific initramfs and this -+ # module is not already loaded, move on to the next one. -+ [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \ -+ ! echo $add_drivers | grep -qe "\<${mod}\>" && { -+ shift; continue; -+ } -+ -+ # We use '-d' option in modprobe only if modules prefix path -+ # differs from default '/'. This allows us to use Dracut with -+ # old version of modprobe which doesn't have '-d' option. -+ moddirname=${srcmods%%/lib/modules/*} -+ [[ -n ${moddirname} ]] && moddirname="-d ${moddirname}/" -+ -+ # ok, load the module, all its dependencies, and any firmware -+ # it may require -+ for_each_kmod_dep install_kmod_with_fw $mod \ -+ --set-version $kernel ${moddirname} -+ ;; -+ esac -+ shift -+ done -+} -diff --git gen_cmdline.sh gen_cmdline.sh -index b3e451d..36afb2e 100755 ---- gen_cmdline.sh -+++ gen_cmdline.sh -@@ -22,6 +22,7 @@ longusage() { - echo " --logfile= Output file for debug info" - echo " --color Output debug in color" - echo " --no-color Do not output debug in color" -+ echo " --no-cleartmp Do not clear temp directory" - echo " Kernel Configuration settings" - echo " --menuconfig Run menuconfig after oldconfig" - echo " --no-menuconfig Do not run menuconfig after oldconfig" -@@ -78,6 +79,8 @@ longusage() { - echo " --splash-res= Select splash theme resolutions to install" - echo " --do-keymap-auto Forces keymap selection at boot" - echo " --no-keymap Disables keymap selection support" -+ echo " --udev Include udev in the initramfs" -+ echo " --no-udev Exclude udev from the initramfs" - echo " --lvm Include LVM support" - echo " --mdadm Include MDADM/MDMON support" - echo " --mdadm-config= Use file as mdadm.conf in initramfs" -@@ -97,6 +100,8 @@ longusage() { - echo " --unionfs Include support for unionfs" - echo " --netboot Create a self-contained env in the initramfs" - echo " --real-root= Specify a default for real_root=" -+ echo " --lscpi Include lspci into the initramfs" -+ echo " --no-lscpi Exclude lspci from the initramfs" - echo " Internals" - echo " --arch-override= Force to arch instead of autodetect" - echo " --cachedir= Override the default cache location" -@@ -232,6 +237,30 @@ parse_cmdline() { - CMD_KEYMAP=0 - print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" - ;; -+ --udev) -+ CMD_UDEV=1 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --no-udev) -+ CMD_UDEV=0 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --lspci) -+ CMD_LSPCI=1 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --no-lspci) -+ CMD_LSPCI=0 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --nfsutils) -+ CMD_NFSUTILS=1 -+ print_info 2 "CMD_NFSUTILS: ${CMD_NFSUTILS}" -+ ;; -+ --no-nfsutils) -+ CMD_NFSUTILS=0 -+ print_info 2 "CMD_NFSUTILS: ${CMD_NFSUTILS}" -+ ;; - --lvm) - CMD_LVM=1 - print_info 2 "CMD_LVM: ${CMD_LVM}" -@@ -441,6 +470,10 @@ parse_cmdline() { - print_info 2 "USECOLOR: ${USECOLOR}" - setColorVars - ;; -+ --no-cleartmp) -+ NOCLEARTMP=1 -+ print_info 2 "NOCLEARTMP: ${NOCLEARTMP}" -+ ;; - --logfile=*) - CMD_LOGFILE=`parse_opt "$*"` - LOGFILE=`parse_opt "$*"` -diff --git gen_compile.sh gen_compile.sh -index 0758c3a..8a2339a 100755 ---- gen_compile.sh -+++ gen_compile.sh -@@ -407,7 +407,10 @@ compile_busybox() { - yes '' 2>/dev/null | compile_generic oldconfig utils - - print_info 1 'busybox: >> Compiling...' -+ OLDLOGLEVEL=$LOGLEVEL -+ LOGLEVEL=1 - compile_generic all utils -+ LOGLEVEL=$OLDLOGLEVEL - print_info 1 'busybox: >> Copying to cache...' - [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] || - gen_die 'Busybox executable does not exist!' -diff --git gen_determineargs.sh gen_determineargs.sh -index ce479cb..eb23120 100755 ---- gen_determineargs.sh -+++ gen_determineargs.sh -@@ -107,6 +107,9 @@ determine_real_args() { - set_config_with_override BOOL SYMLINK CMD_SYMLINK - set_config_with_override STRING INSTALL_MOD_PATH CMD_INSTALL_MOD_PATH - set_config_with_override BOOL OLDCONFIG CMD_OLDCONFIG -+ set_config_with_override BOOL UDEV CMD_UDEV -+ set_config_with_override BOOL LSPCI CMD_LSPCI -+ set_config_with_override BOOL NFSUTILS CMD_NFSUTILS - set_config_with_override BOOL LVM CMD_LVM - set_config_with_override BOOL DMRAID CMD_DMRAID - set_config_with_override BOOL ISCSI CMD_ISCSI -diff --git gen_initramfs.sh gen_initramfs.sh -index 7fe4421..2e936e9 100755 ---- gen_initramfs.sh -+++ gen_initramfs.sh -@@ -56,7 +56,13 @@ append_busybox() { - chmod +x "${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/default.script" - - # Set up a few default symlinks -- for i in ${BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}; do -+ if isTrue "${UDEV}" -+ then -+ BUSYBOX_APPLETS="${BUSYBOX_APPLETS:-[ ash sh uname echo cut cat}" -+ else -+ BUSYBOX_APPLETS="{$BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}" -+ fi -+ for i in ${BUSYBOX_APPLETS}; do - rm -f ${TEMP}/initramfs-busybox-temp/bin/$i > /dev/null - ln -s busybox ${TEMP}/initramfs-busybox-temp/bin/$i || - gen_die "Busybox error: could not link ${i}!" -@@ -410,7 +416,7 @@ append_firmware() { - IFS="," - for i in ${FIRMWARE_FILES} - do -- cp -L "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ -+ cp -rL "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ - done - IFS=$OLD_IFS - else -@@ -438,9 +444,76 @@ append_gpg() { - chmod a+x "${TEMP}/initramfs-gpg-temp/sbin/gpg" - cd "${TEMP}/initramfs-gpg-temp/" - find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" - rm -rf "${TEMP}/initramfs-gpg-temp" > /dev/null - } - -+append_udev() { -+ if [ -d "${TEMP}/initramfs-udev-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-udev-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-udev-temp/" -+ udevmod="${GK_SHARE}/modules/udev-rules/" -+ source ${udevmod}/module-setup.sh -+ initdir=${TEMP}/initramfs-udev-temp \ -+ moddir=${udevmod} \ -+ libdir=/lib/ \ -+ usrlibdir=/usr/lib/ \ -+ install_module -+ -+ if isTrue $LSPCI -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ fi -+ if isTrue $NFSUTILS -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /sbin/mount.nfs /etc/services /etc/protocols /etc/netconfig -+ fi -+ # find net modules and sound -+ (for pathname in ${INSTALL_MOD_PATH}/lib/modules/${KV}/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/drivers/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/sound -+ do -+ [[ -d $pathname ]] && find $pathname -name "*.ko" -+ done | -+ while read module;do -+ # add them prefix blacklist -+ echo "blacklist `basename $module .ko`"; -+ # concat with ready blacklist.conf -+ done;cat "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf") | -+ # sort and rewrite blacklist.conf -+ sort | uniq > "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" -+ mv "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" \ -+ "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf" -+ -+ cd "${TEMP}/initramfs-udev-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-udev-temp" > /dev/null -+} -+ -+append_lspci() { -+ if [ -d "${TEMP}/initramfs-lspci-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-lspci-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-lspci-temp/" -+ -+ initdir=${TEMP}/initramfs-lspci-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ -+ cd "${TEMP}/initramfs-lspci-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-lspci-temp" > /dev/null -+} -+ - print_list() - { - local x -@@ -489,6 +562,11 @@ append_modules() { - print_list ${!group_modules} > "${TEMP}/initramfs-modules-${KV}-temp/etc/modules/${group}" - done - cd "${TEMP}/initramfs-modules-${KV}-temp/" -+ # remove sound and media -+ for x in `find . -type d -name media -o -type d -name sound` -+ do -+ rm -r "${x}" &>/dev/null -+ done - find . | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ - || gen_die "compressing modules cpio" - cd "${TEMP}" -@@ -561,11 +639,14 @@ append_auxilary() { - done - echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" - -- if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ if ! isTrue "${UDEV}" - then -- cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -- else -- cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ then -+ cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ else -+ cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ fi - fi - if isTrue $CMD_DOKEYMAPAUTO - then -@@ -582,7 +663,7 @@ append_auxilary() { - chmod +x "${TEMP}/initramfs-aux-temp/init" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" -- chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ isTrue "${UDEV}" || chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" - - if isTrue ${NETBOOT} - then -@@ -609,6 +690,21 @@ append_data() { - fi - } - -+pack_cpio() { -+ print_info 1 " >> Pack cpio data..." -+ if [ -d "${TEMP}/initramfs-repack-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-repack-temp" -+ fi -+ mkdir -p "${TEMP}/initramfs-repack-temp" -+ cd "${TEMP}/initramfs-repack-temp" -+ # unpack and pack cpio remove double files -+ cpio -di <${CPIO} 2>/dev/null -+ find . -print | cpio ${CPIO_ARGS} | gzip -9 >"${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-repack-temp" > /dev/null -+} -+ - create_initramfs() { - print_info 1 "initramfs: >> Initializing..." - -@@ -619,6 +715,11 @@ create_initramfs() { - - append_data 'base_layout' - append_data 'auxilary' "${BUSYBOX}" -+ append_data 'udev' "${UDEV}" -+ if ! isTrue "${UDEV}" -+ then -+ append_data 'lspci' "${LSPCI}" -+ fi - append_data 'busybox' "${BUSYBOX}" - append_data 'lvm' "${LVM}" - append_data 'dmraid' "${DMRAID}" -@@ -652,8 +753,7 @@ create_initramfs() { - append_data 'overlay' - fi - -- gzip -9 "${CPIO}" -- mv -f "${CPIO}.gz" "${CPIO}" -+ pack_cpio - - if isTrue "${INTEGRATED_INITRAMFS}" - then -diff --git genkernel genkernel -index 0a06cdd..1486c61 100755 ---- genkernel -+++ genkernel -@@ -9,6 +9,7 @@ GK_V='3.4.18' - TMPDIR='/var/tmp/genkernel' - - TODEBUGCACHE=1 # Until an error occurs or LOGFILE is fully qualified. -+NOCLEARTMP=0 - - small_die() { - echo $1 -@@ -45,6 +46,7 @@ source ${GK_SHARE}/gen_initramfs.sh || gen_die "Could not read ${GK_SHARE}/gen_i - source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_moddeps.sh" - source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh" - source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh" -+source ${GK_SHARE}/dracut_funcs.sh || gen_die "Could not read ${GK_SHARE}/dracut_funcs.sh" - - TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ - -@@ -55,21 +57,25 @@ trap_cleanup(){ - } - - cleanup(){ -- if [ -n "$TEMP" -a -d "$TEMP" ]; then -- rm -rf "$TEMP" -- fi -- -- if isTrue ${POSTCLEAR} -- then -- echo -- print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -- print_info 1 "CACHE_DIR: ${CACHE_DIR}" -- CLEAR_CACHE_DIR='yes' -- setup_cache_dir -- echo -- print_info 1 "TMPDIR: ${TMPDIR}" -- clear_tmpdir -- fi -+ if [[ ${NOCLEARTMP} -ne 0 ]] -+ then -+ return -+ fi -+ if [ -n "$TEMP" -a -d "$TEMP" ]; then -+ rm -rf "$TEMP" &>/dev/null -+ fi -+ -+ if isTrue ${POSTCLEAR} -+ then -+ echo -+ print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -+ print_info 1 "CACHE_DIR: ${CACHE_DIR}" -+ CLEAR_CACHE_DIR='yes' -+ setup_cache_dir -+ echo -+ print_info 1 "TMPDIR: ${TMPDIR}" -+ clear_tmpdir -+ fi - } - - trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL -diff --git genkernel.conf genkernel.conf -index 24fcd54..b61f1fa 100644 ---- genkernel.conf -+++ genkernel.conf -@@ -52,6 +52,15 @@ USECOLOR="yes" - # argument is: *+1 - # MAKEOPTS="-j2" - -+# Add udev to initramfs -+UDEV="yes" -+ -+# Add lspci to initramfs -+LSPCI="yes" -+ -+# add ntfs-utils to initramfs -+NFSUTILS="yes" -+ - # Add in LVM support from static binaries if they exist on the system, or - # compile static LVM binaries if static ones do not exist. - # LVM="no" -@@ -92,7 +101,7 @@ USECOLOR="yes" - # Specify directory to pull from - # FIRMWARE_DIR="/lib/firmware" - # Specify specific firmware files to include. This overrides FIRMWARE_DIR --# FIRMWARE_FILES="" -+FIRMWARE_FILES="/lib/firmware/radeon" - - # Enable disklabel support (copies blkid to initrd) - DISKLABEL="yes" -diff --git modules/udev-rules/01-ignore.rules modules/udev-rules/01-ignore.rules -new file mode 100644 -index 0000000..b32f22e ---- /dev/null -+++ modules/udev-rules/01-ignore.rules -@@ -0,0 +1 @@ -+KERNEL=="ram[0-9]*", OPTIONS+="ignore_device", OPTIONS+="last_rule" -diff --git modules/udev-rules/59-persistent-storage-volid.rules modules/udev-rules/59-persistent-storage-volid.rules -new file mode 100644 -index 0000000..0b798e6 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage-volid.rules -@@ -0,0 +1,7 @@ -+SUBSYSTEM!="block", GOTO="psv_end" -+ACTION!="add|change", GOTO="psv_end" -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="cciss[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", IMPORT{program}="vol_id --export $tempnode" -+LABEL="psv_end" -diff --git modules/udev-rules/59-persistent-storage.rules modules/udev-rules/59-persistent-storage.rules -new file mode 100644 -index 0000000..2b83e72 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage.rules -@@ -0,0 +1,38 @@ -+SUBSYSTEM!="block", GOTO="ps_end" -+ACTION!="add|change", GOTO="ps_end" -+ -+KERNEL=="cciss[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end" -+ -+# partitions have no md/{array_state,metadata_version} -+ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" -+ -+# container devices have a metadata version of e.g. 'external:ddf' and -+# never leave state 'inactive' -+ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -+TEST!="md/array_state", GOTO="md_end" -+ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -+ -+LABEL="md_ignore_state" -+ -+IMPORT{program}="/sbin/mdadm --detail --export $tempnode" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+OPTIONS+="link_priority=100" -+OPTIONS+="watch" -+LABEL="md_end" -+ -+ -+KERNEL!="dm-[0-9]*", GOTO="ps_end" -+ACTION=="add", GOTO="ps_end" -+IMPORT{program}="/sbin/dmsetup info -c --nameprefixes --unquoted --rows --noheadings -o name,uuid,suspended,readonly,major,minor,open,tables_loaded,names_using_dev -j%M -m%m" -+ENV{DM_NAME}!="?*", GOTO="ps_end" -+ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="ps_end" -+ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="ps_end" -+ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="ps_end" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+LABEL="ps_end" -diff --git modules/udev-rules/61-persistent-storage.rules modules/udev-rules/61-persistent-storage.rules -new file mode 100644 -index 0000000..9cfdb0b ---- /dev/null -+++ modules/udev-rules/61-persistent-storage.rules -@@ -0,0 +1,20 @@ -+SUBSYSTEM!="block", GOTO="pss_end" -+ACTION!="add|change", GOTO="pss_end" -+ -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss" -+KERNEL=="cciss[0-9]*", GOTO="do_pss" -+KERNEL=="nbd[0-9]*", GOTO="do_pss" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", GOTO="do_pss" -+ -+GOTO="pss_end" -+ -+LABEL="do_pss" -+# by-path (parent device path) -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{program}="path_id %p" -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" -+ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" -+ -+# by-label/by-uuid links (filesystem metadata) -+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -+LABEL="pss_end" -diff --git modules/udev-rules/blacklist.conf modules/udev-rules/blacklist.conf -new file mode 100644 -index 0000000..21ac71c ---- /dev/null -+++ modules/udev-rules/blacklist.conf -@@ -0,0 +1,162 @@ -+blacklist ath_pci -+blacklist evbug -+blacklist usbmouse -+blacklist usbkbd -+blacklist eepro100 -+blacklist de4x5 -+blacklist eth1394 -+blacklist snd_intel8x0m -+blacklist snd_aw2 -+blacklist i2c_i801 -+blacklist prism54 -+blacklist bcm43xx -+blacklist garmin_gps -+blacklist asus_acpi -+blacklist snd_pcsp -+blacklist pcspkr -+blacklist amd76x_edac -+blacklist ohci1394 -+blacklist sbp2 -+blacklist dv1394 -+blacklist raw1394 -+blacklist video1394 -+blacklist aty128fb -+blacklist atyfb -+blacklist radeonfb -+blacklist cirrusfb -+blacklist cyber2000fb -+blacklist cyblafb -+blacklist gx1fb -+blacklist hgafb -+blacklist i810fb -+blacklist intelfb -+blacklist kyrofb -+blacklist lxfb -+blacklist matroxfb_base -+blacklist neofb -+blacklist nvidiafb -+blacklist pm2fb -+blacklist rivafb -+blacklist s1d13xxxfb -+blacklist savagefb -+blacklist sisfb -+blacklist sstfb -+blacklist tdfxfb -+blacklist tridentfb -+blacklist vesafb -+blacklist vfb -+blacklist viafb -+blacklist vt8623fb -+blacklist ac97 -+blacklist ac97_codec -+blacklist ac97_plugin_ad1980 -+blacklist ad1848 -+blacklist ad1889 -+blacklist adlib_card -+blacklist aedsp16 -+blacklist ali5455 -+blacklist btaudio -+blacklist cmpci -+blacklist cs4232 -+blacklist cs4281 -+blacklist cs461x -+blacklist cs46xx -+blacklist emu10k1 -+blacklist es1370 -+blacklist es1371 -+blacklist esssolo1 -+blacklist forte -+blacklist gus -+blacklist i810_audio -+blacklist kahlua -+blacklist mad16 -+blacklist maestro -+blacklist maestro3 -+blacklist maui -+blacklist mpu401 -+blacklist nm256_audio -+blacklist opl3 -+blacklist opl3sa -+blacklist opl3sa2 -+blacklist pas2 -+blacklist pss -+blacklist rme96xx -+blacklist sb -+blacklist sb_lib -+blacklist sgalaxy -+blacklist sonicvibes -+blacklist sound -+blacklist sscape -+blacklist trident -+blacklist trix -+blacklist uart401 -+blacklist uart6850 -+blacklist via82cxxx_audio -+blacklist v_midi -+blacklist wavefront -+blacklist ymfpci -+blacklist ac97_plugin_wm97xx -+blacklist ad1816 -+blacklist audio -+blacklist awe_wave -+blacklist dmasound_core -+blacklist dmasound_pmac -+blacklist harmony -+blacklist sequencer -+blacklist soundcard -+blacklist usb-midi -+blacklist acquirewdt -+blacklist advantechwdt -+blacklist alim1535_wdt -+blacklist alim7101_wdt -+blacklist booke_wdt -+blacklist cpu5wdt -+blacklist eurotechwdt -+blacklist i6300esb -+blacklist i8xx_tco -+blacklist ib700wdt -+blacklist ibmasr -+blacklist indydog -+blacklist iTCO_wdt -+blacklist it8712f_wdt -+blacklist it87_wdt -+blacklist ixp2000_wdt -+blacklist ixp4xx_wdt -+blacklist machzwd -+blacklist mixcomwd -+blacklist mpc8xx_wdt -+blacklist mpcore_wdt -+blacklist mv64x60_wdt -+blacklist pc87413_wdt -+blacklist pcwd -+blacklist pcwd_pci -+blacklist pcwd_usb -+blacklist s3c2410_wdt -+blacklist sa1100_wdt -+blacklist sbc60xxwdt -+blacklist sbc7240_wdt -+blacklist sb8360 -+blacklist sc1200wdt -+blacklist sc520_wdt -+blacklist sch311_wdt -+blacklist scx200_wdt -+blacklist shwdt -+blacklist smsc37b787_wdt -+blacklist softdog -+blacklist twl4030_wdt -+blacklist w83627hf_wdt -+blacklist w83697hf_wdt -+blacklist w83697ug_wdt -+blacklist w83877f_wdt -+blacklist w83977f_wdt -+blacklist wafer5823wdt -+blacklist wdt -+blacklist wdt_pci -+blacklist wm8350_wdt -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -diff --git modules/udev-rules/load-modules.sh modules/udev-rules/load-modules.sh -new file mode 100755 -index 0000000..36972fd ---- /dev/null -+++ modules/udev-rules/load-modules.sh -@@ -0,0 +1,7 @@ -+#!/bin/sh -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+# Implement blacklisting for udev-loaded modules -+ -+modprobe -b "$@" -diff --git modules/udev-rules/module-setup.sh modules/udev-rules/module-setup.sh -new file mode 100755 -index 0000000..1005627 ---- /dev/null -+++ modules/udev-rules/module-setup.sh -@@ -0,0 +1,57 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+install_module() { -+ # FIXME: would be nice if we didn't have to know which rules to grab.... -+ # ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies -+ # of the rules we want so that we just copy those in would be best -+ dracut_install udevd udevadm /etc/udev/udev.conf /etc/group /bin/mount /sbin/modprobe -+ inst_rules 50-udev-default.rules 60-persistent-storage.rules \ -+ 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \ -+ 60-pcmcia.rules -+ mkdir -p "$initdir"/etc/modprobe.d -+ inst_simple "$moddir/blacklist.conf" /etc/modprobe.d/ -+ -+ # ignore some devices in the initrd -+ inst_rules "$moddir/01-ignore.rules" -+ -+ # for firmware loading -+ inst_rules 50-firmware.rules -+ -+ if [ ! -x /lib/udev/vol_id ]; then -+ inst_rules "$moddir/59-persistent-storage.rules" -+ else -+ inst_rules "$moddir/59-persistent-storage-volid.rules" -+ fi -+ inst_rules "$moddir/61-persistent-storage.rules" -+ -+ for i in \ -+ ata_id \ -+ cdrom_id \ -+ create_floppy_devices \ -+ edd_id \ -+ firmware.sh \ -+ firmware \ -+ firmware.agent \ -+ hotplug.functions \ -+ fw_unit_symlinks.sh \ -+ hid2hci \ -+ path_id \ -+ scsi_id \ -+ usb_id \ -+ vol_id \ -+ pcmcia-socket-startup \ -+ pcmcia-check-broken-cis \ -+ ; do -+ for utilpath in /lib/udev /sbin /bin -+ do -+ [ -e $utilpath/$i ] && dracut_install $utilpath/$i -+ done -+ done -+ -+ for i in {"$libdir","$usrlibdir"}/libnss_files*; do -+ [ -e "$i" ] && dracut_install "$i" -+ done -+} -+ diff --git a/sys-kernel/calckernel/files/calckernel-3.4.18-r9.patch b/sys-kernel/calckernel/files/calckernel-3.4.18-r9.patch deleted file mode 100644 index 9a97c592b..000000000 --- a/sys-kernel/calckernel/files/calckernel-3.4.18-r9.patch +++ /dev/null @@ -1,2159 +0,0 @@ -diff --git defaults/busy-config defaults/busy-config -index 51fdc8e..a1f6858 100644 ---- defaults/busy-config -+++ defaults/busy-config -@@ -462,7 +462,7 @@ CONFIG_MDSTART=y - CONFIG_MORE=y - CONFIG_FEATURE_USE_TERMIOS=y - CONFIG_MOUNT=y --CONFIG_FEATURE_MOUNT_NFS=y -+CONFIG_FEATURE_MOUNT_NFS=n - # CONFIG_FEATURE_MOUNT_CIFS is not set - CONFIG_FEATURE_MOUNT_FLAGS=y - CONFIG_FEATURE_MOUNT_FSTAB=y -diff --git defaults/initrd.defaults defaults/initrd.defaults -index 76d72a7..0c059a5 100755 ---- defaults/initrd.defaults -+++ defaults/initrd.defaults -@@ -68,6 +68,7 @@ fi - - REAL_ROOT='' - CDROOT='0' -+SCRATCH='0' - CDROOT_DEV='' - CDROOT_TYPE='auto' - NEW_ROOT='/newroot' -diff --git defaults/initrd.scripts defaults/initrd.scripts -index 51ebcce..7feaf7b 100755 ---- defaults/initrd.scripts -+++ defaults/initrd.scripts -@@ -187,23 +187,45 @@ cache_cd_contents() { - # TODO: Check the size of the image versus the size of our tmpfs - # along with the amount of available RAM and increase tmpfs size - # if necessary. (Not having awk sucks...) -- # z=0 -- # for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -- # cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; do -- # z=$(($z + $i)) ; done -- # echo $z -- good_msg "Copying loop file for caching..." -- # Verify that the needed directory exists -- mkdir -p "$(dirname ${NEW_ROOT}/mnt/${LOOP})" -- cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/${LOOP} -- if [ $? -ne 0 ] -+ -+ # getting memory -+ allmemory=0 -+ for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -+ cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; -+ do -+ allmemory=$(($allmemory + $i)) -+ done -+ -+ # getting size tmpfs of default -+ let curtfs=$allmemory/2 -+ -+ # getting size of image -+ let imagesize=`ls -la ${NEW_ROOT}/mnt/cdrom/${LOOP} | sed -r -n 's/(\S*\s*){4}(\S*).*/\2/p'`/20000*21 -+ let addon=$imagesize/10 -+ if [[ $curtfs -gt $(( ${imagesize} + ${addon} )) ]]; - then -- bad_msg "Failed to cache the loop file! Lack of space?" -- rm -rf ${NEW_ROOT}/mnt/livecd.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/image.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/zisofs 2>/dev/null -+ let addon=$(( $curtfs - ${imagesize} )) -+ fi -+ -+ if [[ $((${imagesize} + $addon)) -lt ${allmemory} ]]; -+ then -+ mount -o remount,size=${addon}000 -t tmpfs tmpfs ${NEW_ROOT} -+ mkdir ${NEW_ROOT}/mnt/squash -+ mount -o size=${imagesize}000 -t tmpfs tmpfs ${NEW_ROOT}/mnt/squash -+ good_msg "Copying loop file for caching..." -+ cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/squash/${LOOP} -+ if [ $? -ne 0 ] -+ then -+ bad_msg "Failed to cache the loop file! Lack of space?" -+ umount ${NEW_ROOT}/mnt/squash -+ mount -o remount,size=${curtfs}000 -t tmpfs tmpfs ${NEW_ROOT} -+ else -+ LOOPEXT='../squash/' -+ good_msg "Unmounting media from ${NEW_ROOT}/mnt/cdrom" -+ umount ${NEW_ROOT}/mnt/cdrom -+ fi - else -- LOOPEXT='../' -+ bad_msg "Too low memory for cache the loop file." - fi - fi - fi -@@ -306,7 +328,9 @@ run_shell() { - /bin/ash - } - --runmdev() { -+make_devfs() { -+ # make /run in root -+ mkdir /run - # Use devtmpfs if enabled in kernel, - # else tmpfs. Always run mdev just in case - devfs=tmpfs -@@ -321,6 +345,10 @@ runmdev() { - # http://git.busybox.net/busybox/plain/docs/mdev.txt - mkdir -m 0755 /dev/pts - mount -t devpts -o gid=5,mode=0620 devpts /dev/pts || bad_msg "Failed to mount /dev/pts" -+} -+ -+runmdev() { -+ make_devfs - mdev -s || bad_msg "Failed to receive dynamic updates from mdev" - } - -@@ -655,7 +683,7 @@ startVolumes() { - [ -d /etc/lvm/cache ] && lvm_commands="${lvm_commands} \nvgscan" - - # To activate volumegroups on all devices in the cache -- lvm_commands="${lvm_commands} \nvgchange -ay --sysinit" -+ lvm_commands="${lvm_commands} \nvgchange -ay --sysinit --noudevsync" - - # And finally execute it all (/proc/... needed if lvm is compiled without readline) - good_msg "Scanning for and activating Volume Groups" -@@ -1082,6 +1110,38 @@ getdvhoff() { - echo $(( $(hexdump -n 4 -s $((316 + 12 * $2)) -e '"%i"' $1) * 512)) - } - -+load_union_module() { -+ UNIONTYPE="" -+ # find module for union file system -+ [ -n "$(find /lib/ -name unionfs.ko)" ] && UNIONTYPE="unionfs" -+ [ -n "$(find /lib/ -name aufs.ko)" ] && UNIONTYPE="aufs" -+ # probably aufs in kernel -+ if [ -n "$(gzip -dc /proc/config.gz | grep CONFIG_AUFS_FS=y )" ] -+ then -+ UNIONTYPE="aufs" -+ else -+ if [ -z "${UNIONTYPE}" ] -+ then -+ bad_msg "Module for union file system is not found!" -+ run_shell -+ else -+ modprobe ${UNIONTYPE} > /dev/null 2>&1 -+ # error on load union module -+ if [ -z "$(lsmod | grep $UNIONTYPE)" ] -+ then -+ bad_msg "Module for union file system is not correct!" -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ bad_msg "Probably kernel compiled without standalone patch." -+ fi -+ run_shell -+ fi -+ -+ good_msg "Loading ${UNIONTYPE}" -+ fi -+ fi -+} -+ - setup_unionfs() { - local rw_dir=$1 - local ro_dir=$2 -@@ -1101,6 +1161,7 @@ setup_unionfs() { - mkdir -p ${UNION} - good_msg "Loading fuse module" - modprobe fuse > /dev/null 2>&1 -+ load_union_module - # if [ -n "${UNIONFS}" ] - # then - # CHANGESDEV=${UNIONFS} -@@ -1130,11 +1191,102 @@ setup_unionfs() { - mkdir /tmp - mkdir -p ${UNION} - # mkdir -p $CHANGES --# mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+## mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+ -+ if [ "${SCRATCH}" -ne 0 ]; -+ then -+ good_msg "Loading in scratch mode" -+ BUILDERDIR=${UNION}/mnt/builder -+ SCRATCHDIR=${UNION}/mnt/scratch -+ DELTADIR=${rw_dir}/mnt/delta -+ WORKSPACEDIR=${rw_dir}/mnt/workspace -+ mount -o remount,rw ${rw_dir}/mnt/cdrom >/dev/null 2>&1 -+ touch ${rw_dir}/mnt/cdrom/livecd >/dev/null 2>&1 -+ if [ "$?" -ne 0 ]; -+ then -+ ISRW=0 -+ else -+ ISRW=1 -+ fi -+ -+ mkdir -p ${DELTADIR} -+ mkdir -p ${WORKSPACEDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${WORKSPACEDIR}=rw:${DELTADIR}=ro+wh:${rw_dir}/mnt/livecd=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${WORKSPACEDIR}=rw:${DELTADIR}=ro:${rw_dir}/mnt/livecd=ro unionfs ${UNION} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${SCRATCHDIR}/calculate -+ mkdir -p ${SCRATCHDIR}/delta -+ mkdir -p ${SCRATCHDIR}/workspace -+ mount -o bind ${rw_dir}/mnt/delta ${SCRATCHDIR}/delta -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind ${rw_dir}/mnt/workspace ${SCRATCHDIR}/workspace -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${BUILDERDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro none ${BUILDERDIR} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro unionfs ${BUILDERDIR} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind,ro ${rw_dir}/mnt/livecd ${SCRATCHDIR}/calculate -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ if [ "$ISRW" -ne 0 ]; -+ then -+ FLASHDIR=${UNION}/mnt/flash -+ mkdir -p ${FLASHDIR} -+ mount -o bind ${rw_dir}/mnt/cdrom ${FLASHDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ mkdir -p ${CDROMDIR} -+ mount -o bind,ro ${rw_dir}/mnt/cdrom ${CDROMDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ fi -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ LIVECDDIR=${UNION}/mnt/livecd -+ -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${rw_dir}:${ro_dir}=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${rw_dir}:${ro_dir}=ro unionfs ${UNION} -+ fi -+ -+ if [[ -n "$( echo ${LOOPEXT} | grep squash )" ]]; -+ then -+ mkdir -p ${UNION}/mnt/squash -+ mount -o bind ${NEW_ROOT}/mnt/squash ${UNION}/mnt/squash &>/dev/null -+ fi -+ -+ chmod 0755 ${UNION} -+ mount -o bind ${rw_dir}/mnt/cdrom ${CDROMDIR} &>/dev/null -+ mount -o bind ${rw_dir}/mnt/livecd ${LIVECDDIR} &>/dev/null -+ ret=$? -+ fi -+ -+ chmod 1777 ${UNION}/tmp - good_msg "Creating union mount" -- unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -- ret=$? -- if [ ${ret} -ne 0 ] -+# unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -+# ret=$? -+ if [ "${ret}" -ne 0 ] - then - bad_msg "Can't setup union mount!" - USE_UNIONFS_NORMAL=0 -@@ -1143,3 +1295,122 @@ setup_unionfs() { - USE_UNIONFS_NORMAL=0 - fi - } -+ -+load_videodrv() { -+ good_msg "Loading frame buffer video driver" -+ # find all available fb drivers -+ videodrv_count=$(find /lib/modules \ -+ -name "nouveau.ko" -o \ -+ -name "uvesafb.ko" -o \ -+ -name "i915.ko" -o \ -+ -name "radeon.ko" | -+ grep -c "") -+ # load specified videodrv -+ modules_list= -+ case "${VIDEODRV}" in -+ nouveau) -+ modules_list="nouveau" -+ ;; -+ radeon) -+ modules_list="radeon" -+ ;; -+ i915|intel) -+ modules_list="i915" -+ ;; -+ ""|auto) -+ # if not livecd and initramfs otimized (aviailable only one video driver) -+ if [ "${CDROOT}" != '1' -a "${videodrv_count}" -le 2 ] -+ then -+ modules_list="nouveau i915 radeon" -+ else -+ if [[ -x /usr/sbin/lspci ]] -+ then -+ if lspci | grep -m1 VGA | grep -qi intel -+ then -+ modules_list="i915" -+ elif lspci | grep -m1 VGA | grep -qi nvidia -+ then -+ modules_list="nouveau" -+ elif lspci | grep -m1 VGA | grep -q -e "Ati" -e "ATI" -+ then -+ modules_list="radeon" -+ else -+ modules_list="" -+ fi -+ else -+ modules_list="i915" -+ fi -+ fi -+ ;; -+ esac -+ for x in $modules_list -+ do -+ if [ "`find /lib/modules -name "${x}.ko" | grep -c ''`" -eq "1" ] -+ then -+ modprobe "${x}" modeset=${USE_MODESET} &>/dev/null -+ lsmod | grep -q "^${x}" && \ -+ [ "`cat /sys/module/${x}/refcnt`" -gt 0 ] && return 0 -+ fi -+ done -+ # else load uvesafb with specified video resolution -+ if [ -n "${VIDEORES}" ] -+ then -+ if ! echo $VIDEORES | grep -q "\-" -+ then -+ VIDEORES="${VIDEORES}-32" -+ fi -+ else -+ VIDEORES="1024x768-32" -+ fi -+ modprobe uvesafb mode_option=${VIDEORES} &>/dev/null -+} -+ -+start_udev() -+{ -+ # start udev -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ echo "" >/proc/sys/kernel/hotplug -+ make_devfs -+ udevd --daemon &>/dev/null -+ udevadm settle -+ fi -+} -+ -+stop_udev() -+{ -+ # kill udevd -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ pkill udevd &>/dev/null -+ fi -+} -+ -+populate_dev() -+{ -+ good_msg 'Activating udev' -+ # Do not run any init-scripts -+ udevadm control --property=do_not_run_plug_service=1 -+ -+ if [ "${REAL_ROOT}" == "/dev/nfs" ] -+ then -+ # clean blacklist because there are net drivers -+ # keep black video for correct loading prop. nvidia -+ cat </etc/modprobe.d/blacklist.conf -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -+EOF -+ fi -+ # discarding net drivers placed into blacklist.conf -+ udevadm trigger --action="add" -+ -+ # we can speed up booting under these conditions: -+ # * using devtmpfs so kernel creates device nodes for us -+ # * only using kernel created device nodes at boot (in /etc/fstab and elsewhere) -+ udevadm settle --timeout=60 -+} -diff --git defaults/linuxrc defaults/linuxrc -index 0843f5d..8109d09 100755 ---- defaults/linuxrc -+++ defaults/linuxrc -@@ -39,6 +39,13 @@ FAKE_ROOT='' - REAL_ROOTFLAGS='' - ROOTFSTYPE='auto' - CRYPT_SILENT=0 -+VIDEODRV='' -+USE_UDEV=1 -+USE_MODESET=1 -+if [ -e "/etc/calculate/calculate.ini" ] -+then -+ source /etc/calculate/calculate.ini -+fi - for x in ${CMDLINE} - do - case "${x}" in -@@ -57,6 +64,57 @@ do - init_opts\=*) - INIT_OPTS=`parse_opt "${x}"` - ;; -+ nokms) -+ USE_MODESET=0 -+ ;; -+ kms) -+ USE_MODESET=1 -+ ;; -+ noudev) -+ USE_UDEV=0 -+ ;; -+ calculate\=*) -+ CALCULATE=`parse_opt "${x}"` -+ if [[ "${CALCULATE//:/}" != "${CALCULATE}" ]] -+ then -+ for i in ${CALCULATE//,/ } -+ do -+ case "${i}" in -+ video:*) -+ VIDEODRV=`echo "${i}" | cut -s -d: -f2-` -+ ;; -+ resolution:*) -+ RES=`echo "${i}" | cut -s -d: -f2-` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ ;; -+ esac -+ done -+ else -+ RES=`echo "${CALCULATE}" | cut -s -d, -f4` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ VIDEODRV=`echo "${CALCULATE}" | cut -s -d, -f5` -+ fi -+ ;; -+ video\=*) -+ VR=`parse_opt "${x}"` -+ for i in ${VR//,/ } -+ do -+ if [ -z "${i//[0-9-x@]}" ] -+ then -+ VIDEORES=${i} -+ fi -+ done -+ ;; -+ # Scratch usbload -+ scratch) -+ SCRATCH=1 -+ ;; - # Livecd options - cdroot) - CDROOT=1 -@@ -251,15 +309,24 @@ then - REAL_ROOT="${FAKE_ROOT}" - fi - --splash 'init' -- --cmdline_hwopts -+# check udevd -+[ ! -x /sbin/udevd ] && USE_UDEV=0 - - # Mount sysfs - mount_sysfs - -+# start udev -+start_udev -+ -+# load kernel video driver -+load_videodrv -+ -+splash 'init' -+ -+cmdline_hwopts -+ - # Setup hotplugging for firmware loading --setup_hotplug -+[ "${USE_UDEV}" == "0" ] && setup_hotplug - - # Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel - if [ -z "${DO_modules}" ] -@@ -269,7 +336,7 @@ elif [ -d "/lib/modules/${KV}" ] - then - good_msg 'Loading modules' - # Load appropriate kernel modules -- if [ "${NODETECT}" != '1' ] -+ if [ "${USE_UDEV}" != '1' -a "${NODETECT}" != '1' ] - then - for modules in ${MY_HWOPTS} - do -@@ -285,14 +352,20 @@ fi - # Apply scan delay if specified - sdelay - --# Setup slow USB bits --setup_slowusb -+if [ "${USE_UDEV}" == "1" ] -+then -+ # populate /dev with devices already found by the kernel -+ populate_dev -+else -+ # Setup slow USB bits -+ setup_slowusb - --# Start device manager --start_dev_mgr -+ # Start device manager -+ start_dev_mgr - --# if doslowusb is passed, pause other 10 seconds here, after mdev load --[ "${DO_slowusb}" ] && sleep 10 -+ # if doslowusb is passed, pause other 10 seconds here, after mdev load -+ [ "${DO_slowusb}" ] && sleep 10 -+fi - - # Start iSCSI - if [ -e /bin/iscsistart ] -@@ -509,9 +582,50 @@ do - then - break - else -- bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -- got_good_root=0 -- REAL_ROOT='' -+ # check for scratch -+ if [ -e ${NEW_ROOT}/livecd.squashfs -a -d ${NEW_ROOT}/delta -a -d ${NEW_ROOT}/workspace ]; -+ then -+ good_msg 'Found scratch data...' -+ load_union_module -+ modprobe squashfs >/dev/null -+ if mount -o remount,rw ${NEW_ROOT}; -+ then -+ mkdir -p ${NEW_ROOT}/calculate && mkdir -p /union && mkdir -p ${NEW_ROOT}/workspace/mnt/builder && mkdir -p ${NEW_ROOT}/workspace/mnt/scratch -+ if mount -o loop,ro -t squashfs ${NEW_ROOT}/livecd.squashfs ${NEW_ROOT}/calculate; -+ then -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/workspace=rw:${NEW_ROOT}/delta=ro+wh:${NEW_ROOT}/calculate=ro none /union; -+ then -+ mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/delta=rw:${NEW_ROOT}/calculate=ro none /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers!' -+ run_shell -+ fi -+ else -+ if mount -t unionfs -o ro,dirs=${NEW_ROOT}/workspace:${NEW_ROOT}/delta=ro:${NEW_ROOT}/calculate=ro unionfs /union; -+ then -+ mount -t unionfs -o ro,dirs=${NEW_ROOT}/delta:${NEW_ROOT}/calculate=ro unionfs /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers' -+ run_shell -+ fi -+ fi -+ else -+ bad_msg 'Could not mount scratch squashfs image' -+ fi -+ else -+ bad_msg 'Could not remount ${NEW_ROOT}' -+ fi -+ else -+ bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -+ got_good_root=0 -+ REAL_ROOT='' -+ fi - fi - else - bad_msg "Could not mount specified ROOT, try again" -@@ -723,9 +837,12 @@ cd "${CHROOT}" - mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null - echo -ne "${BOLD}.${NORMAL}" - -+# stop udev before move mount points -+stop_udev -+ - # If devtmpfs is mounted, try move it to the new root - # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise --for fs in /dev /sys /proc -+for fs in "/dev " /sys /proc - do - if grep -qs "$fs" /proc/mounts - then -diff --git defaults/modprobe defaults/modprobe -index ba2d890..9280357 100755 ---- defaults/modprobe -+++ defaults/modprobe -@@ -10,8 +10,6 @@ usage() { - echo - echo 'Example:' - echo ' modprobe eepro100' -- echo -- echo 'Note: Do not pass the suffix to modprobe!' - exit 1 - } - -@@ -81,14 +79,29 @@ modprobe2() { - usage - exit 1 - fi -- real_path=`real_mod_path ${1}` -+ local modname=${1} -+ local quiet='' -+ local params='' -+ shift -+ for x in $@ -+ do -+ case ${x} in -+ -n) -+ quiet=1 -+ ;; -+ *) -+ params="${params} ${x}" -+ ;; -+ esac -+ done -+ real_path=`real_mod_path ${modname}` - if [ "${real_path}" = '' -o "${real_path}" = ' ' ] - then -- [ "${2}" = '-n' ] && echo -n " -> $1" -+ [ "${quiet}" = '1' ] && echo -n " -> ${modname}" - echo ' module not found.' - exit 2 - fi -- modlist=`modules_dep_list ${1}` -+ modlist=`modules_dep_list ${modname}` - if [ "${modlist}" != '' -a "${modlist}" != ' ' ] - then - deps=`strip_mod_paths ${modlist}` -@@ -110,13 +123,13 @@ modprobe2() { - filler=1 - fi - done -- ${INSMOD} ${real_path} > /dev/null 2>&1 -+ ${INSMOD} ${real_path} ${params} > /dev/null 2>&1 - ret=$? - if [ ${ret} -eq 0 ] - then - echoAppend=' loaded.' -- [ "${2}" = '-n' ] && echoFlags='-n' && echoAppend=', ' -- echo ${echoFlags} "${1}${echoAppend}" -+ [ "${quiet}" = '1' ] && echoFlags='-n' && echoAppend=', ' -+ echo ${echoFlags} "${modname}${echoAppend}" - fi - return $ret - } -@@ -132,7 +145,7 @@ do - LOADED_MODULES="${LOADED_MODULES} ${x}" - done - --modprobe2 ${1} -+modprobe2 ${@} - modprobe_ret=$? - - [ -f '/modules.cache' ] && rm -f /modules.cache > /dev/null 2>&1 -diff --git dracut_funcs.sh dracut_funcs.sh -new file mode 100755 -index 0000000..e80a638 ---- /dev/null -+++ dracut_funcs.sh -@@ -0,0 +1,752 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+# -+# functions used by dracut and other tools. -+# -+# Copyright 2005-2009 Red Hat, Inc. All rights reserved. -+# -+# 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; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+# -+ -+IF_RTLD="" -+IF_dynamic="" -+ -+# Generic substring function. If $2 is in $1, return 0. -+strstr() { [[ $1 =~ $2 ]]; } -+ -+# Create all subdirectories for given path without creating the last element. -+# $1 = path -+mksubdirs() { mkdir -p ${1%/*}; } -+ -+# Version comparision function. Assumes Linux style version scheme. -+# $1 = version a -+# $2 = comparision op (gt, ge, eq, le, lt, ne) -+# $3 = version b -+vercmp() { -+ local n1=(${1//./ }) op=$2 n2=(${3//./ }) i res -+ -+ for ((i=0; ; i++)) -+ do -+ if [[ ! ${n1[i]}${n2[i]} ]]; then res=0 -+ elif ((${n1[i]:-0} > ${n2[i]:-0})); then res=1 -+ elif ((${n1[i]:-0} < ${n2[i]:-0})); then res=2 -+ else continue -+ fi -+ break -+ done -+ -+ case $op in -+ gt) ((res == 1));; -+ ge) ((res != 2));; -+ eq) ((res == 0));; -+ le) ((res != 1));; -+ lt) ((res == 2));; -+ ne) ((res != 0));; -+ esac -+} -+ -+is_func() { -+ [[ $(type -t $1) = "function" ]] -+} -+ -+# Log initrd creation. -+if ! [[ $dracutlogfile ]]; then -+ [[ $dracutbasedir = /usr/share/dracut ]] && \ -+ dracutlogfile=/var/log/dracut.log || \ -+ dracutlogfile=/tmp/dracut.log -+# [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log -+ if [[ -w $dracutlogfile ]]; then -+ >"$dracutlogfile" -+ fi -+fi -+ -+dwarning() { -+ echo "W: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "W: $@" >>"$dracutlogfile" -+} -+ -+dinfo() { -+ [[ $beverbose ]] && echo "I: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "I: $@" >>"$dracutlogfile" -+} -+ -+derror() { -+ echo "E: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile" -+} -+ -+# Function prints global variables in format name=value line by line. -+# $@ = list of global variables' name -+print_vars() { -+ local var value -+ -+ for var in $@ -+ do -+ value=$(eval echo \$$var) -+ [[ ${value} ]] && echo "${var}=\"${value}\"" -+ done -+} -+ -+get_fs_env() { -+ [[ $1 ]] || return -+ eval $(udevadm info --query=env --name=$1|egrep 'ID_FS_(TYPE|UUID)=') -+ [[ $ID_FS_TYPE ]] && return -+ -+ if [[ -x /lib/udev/vol_id ]]; then -+ eval $(/lib/udev/vol_id --export $1) -+ elif find_binary blkid >/dev/null; then -+ eval $(blkid -o udev $1) -+ else -+ return 1 -+ fi -+} -+ -+get_fs_type() ( -+ [[ $1 ]] || return -+ if [[ $1 != ${1#/dev/block/nfs:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs3:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs4:} ]]; then -+ echo "nfs" -+ return -+ fi -+ get_fs_env $1 || return -+ echo $ID_FS_TYPE -+) -+ -+get_fs_uuid() ( -+ get_fs_env $1 || return -+ echo $ID_FS_UUID -+) -+ -+# finds the major:minor of the block device backing the root filesystem. -+find_block_device() { -+ local x mpt majmin dev fs misc maj min -+ if [[ $use_fstab != yes ]]; then -+ while read x x majmin x mpt x x fs dev misc; do -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $fs = btrfs ]] && { -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ } -+ if [[ $mpt = $1 ]] && [[ ${majmin#0:} = $majmin ]]; then -+ echo $majmin; -+ return 0 # we have a winner! -+ fi -+ done < /proc/self/mountinfo -+ fi -+ # fall back to /etc/fstab -+ while read dev mpt fs misc; do -+ if [[ $mpt = $1 ]]; then -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $dev != ${dev#UUID=} ]] && dev=/dev/disk/by-uuid/${dev#UUID=} -+ [[ $dev != ${dev#LABEL=} ]] && dev=/dev/disk/by-label/${dev#LABEL=} -+ [[ -b $dev ]] || return 1 # oops, not a block device. -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ fi -+ done < /etc/fstab -+ return 1; -+} -+ -+find_root_block_device() { find_block_device /; } -+ -+# Walk all the slave relationships for a given block device. -+# Stop when our helper function returns success -+# $1 = function to call on every found block device -+# $2 = block device in major:minor format -+check_block_and_slaves() { -+ local x -+ [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. -+ "$1" $2 && return -+ check_vol_slaves "$@" && return 0 -+ if [[ -f /sys/dev/block/$2/../dev ]]; then -+ check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0 -+ fi -+ [[ -d /sys/dev/block/$2/slaves ]] || return 1 -+ for x in /sys/dev/block/$2/slaves/*/dev; do -+ [[ -f $x ]] || continue -+ check_block_and_slaves $1 $(cat "$x") && return 0 -+ done -+ return 1 -+} -+ -+get_numeric_dev() { -+ ls -lH "$1" | { read a b c d maj min rest; printf "%d:%d" ${maj%%,} $min;} -+} -+ -+# ugly workaround for the lvm design -+# There is no volume group device, -+# so, there are no slave devices for volume groups. -+# Logical volumes only have the slave devices they really live on, -+# but you cannot create the logical volume without the volume group. -+# And the volume group might be bigger than the devices the LV needs. -+check_vol_slaves() { -+ for i in /dev/mapper/*; do -+ lv=$(get_numeric_dev $i) -+ if [[ $lv = $2 ]]; then -+ vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null) -+ # strip space -+ vg=$(echo $vg) -+ if [[ $vg ]]; then -+ for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \ -+ do -+ check_block_and_slaves $1 $(get_numeric_dev $pv) \ -+ && return 0 -+ done -+ fi -+ fi -+ done -+ return 1 -+} -+ -+# Install a directory, keeping symlinks as on the original system. -+# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file" -+# will create ${initdir}/lib64, ${initdir}/lib64/file, -+# and a symlink ${initdir}/lib -> lib64. -+inst_dir() { -+ local dir="$1" -+ [[ -e ${initdir}$dir ]] && return 0 -+ -+ # iterate over parent directories -+ local file="" -+ local IFS="/" -+ for part in $dir; do -+ [[ $part ]] || continue -+ file="$file/$part" -+ [[ -e ${initdir}$file ]] && continue -+ -+ if [[ -L $file ]]; then -+ # create link as the original -+ local target=$(readlink "$file") -+ ln -sfn "$target" "${initdir}$file" || return 1 -+ # resolve relative path and recursively install destionation -+ [[ $target = ${target##*/} ]] && target="${file%/*}/$target" -+ inst_dir "$target" -+ else -+ # create directory -+ mkdir -p "${initdir}$file" || return 1 -+ fi -+ done -+} -+ -+# $1 = file to copy to ramdisk -+# $2 (optional) Name for the file on the ramdisk -+# Location of the image dir is assumed to be $initdir -+# We never overwrite the target if it exists. -+inst_simple() { -+ local src target -+ [[ -f $1 ]] || return 1 -+ src=$1 target="${2:-$1}" -+ if ! [[ -d ${initdir}$target ]]; then -+ [[ -e ${initdir}$target ]] && return 0 -+ inst_dir "${target%/*}" -+ fi -+ dinfo "Installing $src" -+ cp -pfL "$src" "${initdir}$target" -+} -+ -+# find symlinks linked to given library file -+# $1 = library file -+# Function searches for symlinks by stripping version numbers appended to -+# library filename, checks if it points to the same target and finally -+# prints the list of symlinks to stdout. -+# -+# Example: -+# rev_lib_symlinks libfoo.so.8.1 -+# output: libfoo.so.8 libfoo.so -+# (Only if libfoo.so.8 and libfoo.so exists on host system.) -+rev_lib_symlinks() { -+ [[ ! $1 ]] && return 0 -+ -+ local fn="$1" orig="$(readlink -f "$1")" links='' -+ -+ [[ ${fn} =~ .*\.so\..* ]] || return 1 -+ -+ until [[ ${fn##*.} == so ]]; do -+ fn="${fn%.*}" -+ [[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}" -+ done -+ -+ echo ${links} -+} -+ -+# Same as above, but specialized to handle dynamic libraries. -+# It handles making symlinks according to how the original library -+# is referenced. -+inst_library() { -+ local src=$1 dest=${2:-$1} lib reallib symlink -+ [[ -e $initdir$dest ]] && return 0 -+ if [[ -L $src ]]; then -+ reallib=$(readlink -f "$src") -+ lib=${src##*/} -+ inst_simple "$reallib" "$reallib" -+ inst_dir "${dest%/*}" -+ (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib") -+ else -+ inst_simple "$src" "$dest" -+ fi -+ -+ # Create additional symlinks. See rev_symlinks description. -+ for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do -+ [[ ! -e $initdir$symlink ]] && { -+ dinfo "Creating extra symlink: $symlink" -+ inst_symlink $symlink -+ } -+ done -+} -+ -+# find a binary. If we were not passed the full path directly, -+# search in the usual places to find the binary. -+find_binary() { -+ local binpath="/bin /sbin /usr/bin /usr/sbin" p -+ [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } -+ for p in $binpath; do -+ [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# Same as above, but specialized to install binary executables. -+# Install binary executable, and all shared library dependencies, if any. -+inst_binary() { -+ local bin target -+ bin=$(find_binary "$1") || return 1 -+ target=${2:-$bin} -+ inst_symlink $bin $target && return 0 -+ local LDSO NAME IO FILE ADDR I1 n f TLIBDIR -+ [[ -e $initdir$target ]] && return 0 -+ # I love bash! -+ LC_ALL=C ldd $bin 2>/dev/null | while read line; do -+ [[ $line = 'not a dynamic executable' ]] && return 1 -+ if [[ $line =~ not\ found ]]; then -+ derror "Missing a shared library required by $bin." -+ derror "Run \"ldd $bin\" to find out what it is." -+ derror "dracut cannot create an initrd." -+ exit 1 -+ fi -+ so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)' -+ [[ $line =~ $so_regex ]] || continue -+ FILE=${BASH_REMATCH[1]} -+ [[ -e ${initdir}$FILE ]] && continue -+ # see if we are loading an optimized version of a shared lib. -+ lib_regex='^(/lib[^/]*).*' -+ if [[ $FILE =~ $lib_regex ]]; then -+ TLIBDIR=${BASH_REMATCH[1]} -+ BASE=${FILE##*/} -+ # prefer nosegneg libs, then unoptimized ones. -+ for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do -+ [[ -e $f/$BASE ]] || continue -+ FILE=$f/$BASE -+ break -+ done -+ inst_library "$FILE" "$TLIBDIR/$BASE" -+ IF_dynamic=yes -+ continue -+ fi -+ inst_library "$FILE" -+ done -+ inst_simple "$bin" "$target" -+} -+ -+# same as above, except for shell scripts. -+# If your shell script does not start with shebang, it is not a shell script. -+inst_script() { -+ [[ -f $1 ]] || return 1 -+ local line -+ read -r -n 80 line <"$1" -+ # If debug is set, clean unprintable chars to prevent messing up the term -+ [[ $debug ]] && line=$(echo -n "$line" | tr -c -d '[:print:][:space:]') -+ shebang_regex='(#! *)(/[^ ]+).*' -+ [[ $line =~ $shebang_regex ]] || return 1 -+ inst "${BASH_REMATCH[2]}" && inst_simple "$@" -+} -+ -+# same as above, but specialized for symlinks -+inst_symlink() { -+ local src=$1 target=$initdir${2:-$1} realsrc -+ [[ -L $1 ]] || return 1 -+ [[ -L $target ]] && return 0 -+ realsrc=$(readlink -f "$src") -+ [[ $realsrc = ${realsrc##*/} ]] && realsrc=${src%/*}/$realsrc -+ inst "$realsrc" && mkdir -p "${target%/*}" && \ -+ ln -s "$realsrc" "$target" -+} -+ -+# find a udev rule in the usual places. -+find_rule() { -+ [[ -f $1 ]] && { echo "$1"; return 0; } -+ for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do -+ [[ -f $r/$1 ]] && { echo "$r/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# udev rules always get installed in the same place, so -+# create a function to install them to make life simpler. -+inst_rules() { -+ local target=/etc/udev/rules.d rule found -+ -+ inst_dir "/lib/udev/rules.d" -+ inst_dir "$target" -+ for rule in "$@"; do -+ found=$(find_rule "$rule") && \ -+ inst_simple "$found" "$target/${found##*/}" \ -+ || dinfo "Skipping udev rule: $rule" -+ done -+} -+ -+# general purpose installation function -+# Same args as above. -+inst() { -+ case $# in -+ 1) ;; -+ 2) [[ ! $initdir && -d $2 ]] && export initdir=$2 -+ [[ $initdir = $2 ]] && set $1;; -+ 3) [[ -z $initdir ]] && export initdir=$2 -+ set $1 $3;; -+ *) derror "inst only takes 1 or 2 or 3 arguments" -+ exit 1;; -+ esac -+ for x in inst_symlink inst_script inst_binary inst_simple; do -+ $x "$@" && return 0 -+ done -+ return 1 -+} -+ -+# install function specialized for hooks -+# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook -+# All hooks should be POSIX/SuS compliant, they will be sourced by init. -+inst_hook() { -+ if ! [[ -f $3 ]]; then -+ derror "Cannot install a hook ($3) that does not exist." -+ derror "Aborting initrd creation." -+ exit 1 -+ elif ! strstr "$hookdirs" "$1"; then -+ derror "No such hook type $1. Aborting initrd creation." -+ exit 1 -+ fi -+ inst_simple "$3" "/${1}/${2}${3##*/}" -+} -+ -+dracut_install() { -+ if [[ $1 = '-o' ]]; then -+ local optional=yes -+ shift -+ fi -+ while (($# > 0)); do -+ if ! inst "$1" ; then -+ if [[ $optional = yes ]]; then -+ dwarning "Skipping program $1 as it cannot be found and is flagged to be optional" -+ else -+ derror "Failed to install $1" -+ exit 1 -+ fi -+ fi -+ shift -+ done -+} -+ -+# install function decompressing the target and handling symlinks -+# $@ = list of compressed (gz or bz2) files or symlinks pointing to such files -+# -+# Function install targets in the same paths inside overlay but decompressed -+# and without extensions (.gz, .bz2). -+inst_decompress() { -+ local src dst realsrc realdst cmd -+ -+ for src in $@ -+ do -+ case ${src} in -+ *.gz) cmd='gzip -d' ;; -+ *.bz2) cmd='bzip2 -d' ;; -+ *) return 1 ;; -+ esac -+ -+ if [[ -L ${src} ]] -+ then -+ realsrc="$(readlink -f ${src})" # symlink target with extension -+ dst="${src%.*}" # symlink without extension -+ realdst="${realsrc%.*}" # symlink target without extension -+ mksubdirs "${initdir}/${src}" -+ # Create symlink without extension to target without extension. -+ ln -s "${realdst}" "${initdir}/${dst}" -+ fi -+ -+ # If the source is symlink we operate on its target. -+ [[ ${realsrc} ]] && src=${realsrc} -+ inst ${src} -+ # Decompress with chosen tool. We assume that tool changes name e.g. -+ # from 'name.gz' to 'name'. -+ ${cmd} "${initdir}${src}" -+ done -+} -+ -+# It's similar to above, but if file is not compressed, performs standard -+# install. -+# $@ = list of files -+inst_opt_decompress() { -+ local src -+ -+ for src in $@ -+ do -+ inst_decompress "${src}" || inst "${src}" -+ done -+} -+ -+module_check() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we are unconditionally included -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check $hostonly -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func check || return 0 -+ check -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_depends() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we have no deps -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check -d -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func depends || return 0 -+ depends -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_install() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/install ]] && . "$moddir/install" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func install || return 0 -+ install -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_installkernel() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/installkernel ]] && . "$moddir/installkernel" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func installkernel || return 0 -+ installkernel -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+check_module() { -+ local mod=$1; -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ local moddep; -+ # If we are already scheduled to be loaded, no need to check again. -+ strstr " $mods_to_load " " $mod " && return 0 -+ strstr " $mods_checked_as_dep " " $mod " && return 1 -+ -+ # This should never happen, but... -+ [[ -d $moddir ]] || return 1 -+ -+ [[ $2 ]] || mods_checked_as_dep+=" $mod " -+ -+ strstr " $omit_dracutmodules " " $mod " && return 1 -+ -+ if strstr " $dracutmodules $add_dracutmodules " " $mod "; then -+ module_check $mod; ret=$? -+ # explicit module, so also accept ret=255 -+ [[ $ret = 0 || $ret = 255 ]] || return 1 -+ else -+ # module not in our list -+ if [[ $dracutmodules = all ]]; then -+ # check, if we can and should install this module -+ module_check $mod || return 1 -+ else -+ # skip this module -+ return 1 -+ fi -+ fi -+ -+ for moddep in $(module_depends $mod); do -+ # handle deps as if they were manually added -+ strstr " $add_dracutmodules " " $moddep " || \ -+ add_dracutmodules+=" $moddep " -+ # if a module we depend on fail, fail also -+ check_module $moddep || return 1 -+ done -+ -+ strstr " $mods_to_load " " $mod " || \ -+ mods_to_load+=" $mod " -+ -+ return 0 -+} -+ -+check_module_dir() { -+ local modcheck; -+ local mod; -+ mods_to_load="" -+ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do -+ local mod=${moddir##*/}; mod=${mod#[0-9][0-9]} -+ check_module $mod 1 -+ done -+} -+ -+# Install a single kernel module along with any firmware it may require. -+# $1 = full path to kernel module to install -+install_kmod_with_fw() { -+ local modname=${1##*/} fwdir found -+ modname=${modname%.ko*} -+ inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \ -+ return 0 # no need to go further if the module is already installed -+ for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do -+ found='' -+ for fwdir in $fw_dir; do -+ if [[ -d $fwdir && -f $fwdir/$fw ]]; then -+ inst_simple "$fwdir/$fw" "/lib/firmware/$fw" -+ found=yes -+ fi -+ done -+ if [[ $found != yes ]]; then -+ dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\"" -+ fi -+ done -+} -+ -+# Do something with all the dependencies of a kernel module. -+# Note that kernel modules depend on themselves using the technique we use -+# $1 = function to call for each dependency we find -+# It will be passed the full path to the found kernel module -+# $2 = module to get dependencies for -+# rest of args = arguments to modprobe -+for_each_kmod_dep() { -+ local func=$1 kmod=$2 cmd modpapth options -+ shift 2 -+ modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \ -+ while read cmd modpath options; do -+ [[ $cmd = insmod ]] || continue -+ $func $modpath -+ done -+} -+ -+# filter kernel modules to install certain modules that meet specific -+# requirements. -+# $1 = function to call with module name to filter. -+# This function will be passed the full path to the module to test. -+# The behaviour of this function can vary depending on whether $hostonly is set. -+# If it is, we will only look at modules that are already in memory. -+# If it is not, we will look at all kernel modules -+# This function returns the full filenames of modules that match $1 -+filter_kernel_modules () ( -+ if ! [[ $hostonly ]]; then -+ filtercmd='find "$srcmods/kernel/drivers" "$srcmods/extra" "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz" 2>/dev/null' -+ else -+ filtercmd='cut -d " " -f 1 /dev/null' -+ fi -+ for modname in $(eval $filtercmd); do -+ case $modname in -+ *.ko) "$1" "$modname" && echo "$modname";; -+ *.ko.gz) gzip -dc "$modname" > $initdir/$$.ko -+ $1 $initdir/$$.ko && echo "$modname" -+ rm -f $initdir/$$.ko;; -+ esac -+ done -+) -+ -+# install kernel modules along with all their dependencies. -+instmods() { -+ [[ $no_kernel = yes ]] && return -+ local mod mpargs modpath modname cmd moddirname -+ while (($# > 0)); do -+ mod=${1%.ko*} -+ case $mod in -+ =*) -+ # This introduces 2 incompatible meanings for =* arguments -+ # to instmods. We need to decide which one to keep. -+ if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then -+ instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block") -+ elif [ -f $srcmods/modules.${mod#=} ]; then -+ instmods $mpargs $(cat ${srcmods}/modules.${mod#=} ) -+ else -+ instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*") -+ fi -+ ;; -+ --*) -+ mod=${mod##*/} -+ mpargs+=" $mod";; -+ i2o_scsi) shift; continue;; # Do not load this diagnostic-only module -+ *) mod=${mod##*/} -+ # if we are already installed, skip this module and go on -+ # to the next one. -+ [[ -f $initdir/$1 ]] && { shift; continue; } -+ # If we are building a host-specific initramfs and this -+ # module is not already loaded, move on to the next one. -+ [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \ -+ ! echo $add_drivers | grep -qe "\<${mod}\>" && { -+ shift; continue; -+ } -+ -+ # We use '-d' option in modprobe only if modules prefix path -+ # differs from default '/'. This allows us to use Dracut with -+ # old version of modprobe which doesn't have '-d' option. -+ moddirname=${srcmods%%/lib/modules/*} -+ [[ -n ${moddirname} ]] && moddirname="-d ${moddirname}/" -+ -+ # ok, load the module, all its dependencies, and any firmware -+ # it may require -+ for_each_kmod_dep install_kmod_with_fw $mod \ -+ --set-version $kernel ${moddirname} -+ ;; -+ esac -+ shift -+ done -+} -diff --git gen_cmdline.sh gen_cmdline.sh -index b3e451d..36afb2e 100755 ---- gen_cmdline.sh -+++ gen_cmdline.sh -@@ -22,6 +22,7 @@ longusage() { - echo " --logfile= Output file for debug info" - echo " --color Output debug in color" - echo " --no-color Do not output debug in color" -+ echo " --no-cleartmp Do not clear temp directory" - echo " Kernel Configuration settings" - echo " --menuconfig Run menuconfig after oldconfig" - echo " --no-menuconfig Do not run menuconfig after oldconfig" -@@ -78,6 +79,8 @@ longusage() { - echo " --splash-res= Select splash theme resolutions to install" - echo " --do-keymap-auto Forces keymap selection at boot" - echo " --no-keymap Disables keymap selection support" -+ echo " --udev Include udev in the initramfs" -+ echo " --no-udev Exclude udev from the initramfs" - echo " --lvm Include LVM support" - echo " --mdadm Include MDADM/MDMON support" - echo " --mdadm-config= Use file as mdadm.conf in initramfs" -@@ -97,6 +100,8 @@ longusage() { - echo " --unionfs Include support for unionfs" - echo " --netboot Create a self-contained env in the initramfs" - echo " --real-root= Specify a default for real_root=" -+ echo " --lscpi Include lspci into the initramfs" -+ echo " --no-lscpi Exclude lspci from the initramfs" - echo " Internals" - echo " --arch-override= Force to arch instead of autodetect" - echo " --cachedir= Override the default cache location" -@@ -232,6 +237,30 @@ parse_cmdline() { - CMD_KEYMAP=0 - print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" - ;; -+ --udev) -+ CMD_UDEV=1 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --no-udev) -+ CMD_UDEV=0 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --lspci) -+ CMD_LSPCI=1 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --no-lspci) -+ CMD_LSPCI=0 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --nfsutils) -+ CMD_NFSUTILS=1 -+ print_info 2 "CMD_NFSUTILS: ${CMD_NFSUTILS}" -+ ;; -+ --no-nfsutils) -+ CMD_NFSUTILS=0 -+ print_info 2 "CMD_NFSUTILS: ${CMD_NFSUTILS}" -+ ;; - --lvm) - CMD_LVM=1 - print_info 2 "CMD_LVM: ${CMD_LVM}" -@@ -441,6 +470,10 @@ parse_cmdline() { - print_info 2 "USECOLOR: ${USECOLOR}" - setColorVars - ;; -+ --no-cleartmp) -+ NOCLEARTMP=1 -+ print_info 2 "NOCLEARTMP: ${NOCLEARTMP}" -+ ;; - --logfile=*) - CMD_LOGFILE=`parse_opt "$*"` - LOGFILE=`parse_opt "$*"` -diff --git gen_compile.sh gen_compile.sh -index 0758c3a..8a2339a 100755 ---- gen_compile.sh -+++ gen_compile.sh -@@ -407,7 +407,10 @@ compile_busybox() { - yes '' 2>/dev/null | compile_generic oldconfig utils - - print_info 1 'busybox: >> Compiling...' -+ OLDLOGLEVEL=$LOGLEVEL -+ LOGLEVEL=1 - compile_generic all utils -+ LOGLEVEL=$OLDLOGLEVEL - print_info 1 'busybox: >> Copying to cache...' - [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] || - gen_die 'Busybox executable does not exist!' -diff --git gen_determineargs.sh gen_determineargs.sh -index ce479cb..eb23120 100755 ---- gen_determineargs.sh -+++ gen_determineargs.sh -@@ -107,6 +107,9 @@ determine_real_args() { - set_config_with_override BOOL SYMLINK CMD_SYMLINK - set_config_with_override STRING INSTALL_MOD_PATH CMD_INSTALL_MOD_PATH - set_config_with_override BOOL OLDCONFIG CMD_OLDCONFIG -+ set_config_with_override BOOL UDEV CMD_UDEV -+ set_config_with_override BOOL LSPCI CMD_LSPCI -+ set_config_with_override BOOL NFSUTILS CMD_NFSUTILS - set_config_with_override BOOL LVM CMD_LVM - set_config_with_override BOOL DMRAID CMD_DMRAID - set_config_with_override BOOL ISCSI CMD_ISCSI -diff --git gen_initramfs.sh gen_initramfs.sh -index 7fe4421..2e936e9 100755 ---- gen_initramfs.sh -+++ gen_initramfs.sh -@@ -56,7 +56,13 @@ append_busybox() { - chmod +x "${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/default.script" - - # Set up a few default symlinks -- for i in ${BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}; do -+ if isTrue "${UDEV}" -+ then -+ BUSYBOX_APPLETS="${BUSYBOX_APPLETS:-[ ash sh uname echo cut cat}" -+ else -+ BUSYBOX_APPLETS="{$BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}" -+ fi -+ for i in ${BUSYBOX_APPLETS}; do - rm -f ${TEMP}/initramfs-busybox-temp/bin/$i > /dev/null - ln -s busybox ${TEMP}/initramfs-busybox-temp/bin/$i || - gen_die "Busybox error: could not link ${i}!" -@@ -410,7 +416,7 @@ append_firmware() { - IFS="," - for i in ${FIRMWARE_FILES} - do -- cp -L "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ -+ cp -rL "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ - done - IFS=$OLD_IFS - else -@@ -438,9 +444,76 @@ append_gpg() { - chmod a+x "${TEMP}/initramfs-gpg-temp/sbin/gpg" - cd "${TEMP}/initramfs-gpg-temp/" - find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" - rm -rf "${TEMP}/initramfs-gpg-temp" > /dev/null - } - -+append_udev() { -+ if [ -d "${TEMP}/initramfs-udev-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-udev-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-udev-temp/" -+ udevmod="${GK_SHARE}/modules/udev-rules/" -+ source ${udevmod}/module-setup.sh -+ initdir=${TEMP}/initramfs-udev-temp \ -+ moddir=${udevmod} \ -+ libdir=/lib/ \ -+ usrlibdir=/usr/lib/ \ -+ install_module -+ -+ if isTrue $LSPCI -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ fi -+ if isTrue $NFSUTILS -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /sbin/mount.nfs /etc/services /etc/protocols /etc/netconfig -+ fi -+ # find net modules and sound -+ (for pathname in ${INSTALL_MOD_PATH}/lib/modules/${KV}/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/drivers/net \ -+ ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/sound -+ do -+ [[ -d $pathname ]] && find $pathname -name "*.ko" -+ done | -+ while read module;do -+ # add them prefix blacklist -+ echo "blacklist `basename $module .ko`"; -+ # concat with ready blacklist.conf -+ done;cat "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf") | -+ # sort and rewrite blacklist.conf -+ sort | uniq > "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" -+ mv "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf.new" \ -+ "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf" -+ -+ cd "${TEMP}/initramfs-udev-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-udev-temp" > /dev/null -+} -+ -+append_lspci() { -+ if [ -d "${TEMP}/initramfs-lspci-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-lspci-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-lspci-temp/" -+ -+ initdir=${TEMP}/initramfs-lspci-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ -+ cd "${TEMP}/initramfs-lspci-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-lspci-temp" > /dev/null -+} -+ - print_list() - { - local x -@@ -489,6 +562,11 @@ append_modules() { - print_list ${!group_modules} > "${TEMP}/initramfs-modules-${KV}-temp/etc/modules/${group}" - done - cd "${TEMP}/initramfs-modules-${KV}-temp/" -+ # remove sound and media -+ for x in `find . -type d -name media -o -type d -name sound` -+ do -+ rm -r "${x}" &>/dev/null -+ done - find . | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ - || gen_die "compressing modules cpio" - cd "${TEMP}" -@@ -561,11 +639,14 @@ append_auxilary() { - done - echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" - -- if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ if ! isTrue "${UDEV}" - then -- cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -- else -- cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ then -+ cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ else -+ cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ fi - fi - if isTrue $CMD_DOKEYMAPAUTO - then -@@ -582,7 +663,7 @@ append_auxilary() { - chmod +x "${TEMP}/initramfs-aux-temp/init" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" -- chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ isTrue "${UDEV}" || chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" - - if isTrue ${NETBOOT} - then -@@ -609,6 +690,21 @@ append_data() { - fi - } - -+pack_cpio() { -+ print_info 1 " >> Pack cpio data..." -+ if [ -d "${TEMP}/initramfs-repack-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-repack-temp" -+ fi -+ mkdir -p "${TEMP}/initramfs-repack-temp" -+ cd "${TEMP}/initramfs-repack-temp" -+ # unpack and pack cpio remove double files -+ cpio -di <${CPIO} 2>/dev/null -+ find . -print | cpio ${CPIO_ARGS} | gzip -9 >"${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-repack-temp" > /dev/null -+} -+ - create_initramfs() { - print_info 1 "initramfs: >> Initializing..." - -@@ -619,6 +715,11 @@ create_initramfs() { - - append_data 'base_layout' - append_data 'auxilary' "${BUSYBOX}" -+ append_data 'udev' "${UDEV}" -+ if ! isTrue "${UDEV}" -+ then -+ append_data 'lspci' "${LSPCI}" -+ fi - append_data 'busybox' "${BUSYBOX}" - append_data 'lvm' "${LVM}" - append_data 'dmraid' "${DMRAID}" -@@ -652,8 +753,7 @@ create_initramfs() { - append_data 'overlay' - fi - -- gzip -9 "${CPIO}" -- mv -f "${CPIO}.gz" "${CPIO}" -+ pack_cpio - - if isTrue "${INTEGRATED_INITRAMFS}" - then -diff --git genkernel genkernel -index 0a06cdd..1486c61 100755 ---- genkernel -+++ genkernel -@@ -9,6 +9,7 @@ GK_V='3.4.18' - TMPDIR='/var/tmp/genkernel' - - TODEBUGCACHE=1 # Until an error occurs or LOGFILE is fully qualified. -+NOCLEARTMP=0 - - small_die() { - echo $1 -@@ -45,6 +46,7 @@ source ${GK_SHARE}/gen_initramfs.sh || gen_die "Could not read ${GK_SHARE}/gen_i - source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_moddeps.sh" - source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh" - source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh" -+source ${GK_SHARE}/dracut_funcs.sh || gen_die "Could not read ${GK_SHARE}/dracut_funcs.sh" - - TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ - -@@ -55,21 +57,25 @@ trap_cleanup(){ - } - - cleanup(){ -- if [ -n "$TEMP" -a -d "$TEMP" ]; then -- rm -rf "$TEMP" -- fi -- -- if isTrue ${POSTCLEAR} -- then -- echo -- print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -- print_info 1 "CACHE_DIR: ${CACHE_DIR}" -- CLEAR_CACHE_DIR='yes' -- setup_cache_dir -- echo -- print_info 1 "TMPDIR: ${TMPDIR}" -- clear_tmpdir -- fi -+ if [[ ${NOCLEARTMP} -ne 0 ]] -+ then -+ return -+ fi -+ if [ -n "$TEMP" -a -d "$TEMP" ]; then -+ rm -rf "$TEMP" &>/dev/null -+ fi -+ -+ if isTrue ${POSTCLEAR} -+ then -+ echo -+ print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -+ print_info 1 "CACHE_DIR: ${CACHE_DIR}" -+ CLEAR_CACHE_DIR='yes' -+ setup_cache_dir -+ echo -+ print_info 1 "TMPDIR: ${TMPDIR}" -+ clear_tmpdir -+ fi - } - - trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL -diff --git genkernel.conf genkernel.conf -index 24fcd54..b61f1fa 100644 ---- genkernel.conf -+++ genkernel.conf -@@ -52,6 +52,15 @@ USECOLOR="yes" - # argument is: *+1 - # MAKEOPTS="-j2" - -+# Add udev to initramfs -+UDEV="yes" -+ -+# Add lspci to initramfs -+LSPCI="yes" -+ -+# add ntfs-utils to initramfs -+NFSUTILS="yes" -+ - # Add in LVM support from static binaries if they exist on the system, or - # compile static LVM binaries if static ones do not exist. - # LVM="no" -@@ -92,7 +101,7 @@ USECOLOR="yes" - # Specify directory to pull from - # FIRMWARE_DIR="/lib/firmware" - # Specify specific firmware files to include. This overrides FIRMWARE_DIR --# FIRMWARE_FILES="" -+FIRMWARE_FILES="/lib/firmware/radeon" - - # Enable disklabel support (copies blkid to initrd) - DISKLABEL="yes" -diff --git modules/udev-rules/01-ignore.rules modules/udev-rules/01-ignore.rules -new file mode 100644 -index 0000000..b32f22e ---- /dev/null -+++ modules/udev-rules/01-ignore.rules -@@ -0,0 +1 @@ -+KERNEL=="ram[0-9]*", OPTIONS+="ignore_device", OPTIONS+="last_rule" -diff --git modules/udev-rules/59-persistent-storage-volid.rules modules/udev-rules/59-persistent-storage-volid.rules -new file mode 100644 -index 0000000..0b798e6 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage-volid.rules -@@ -0,0 +1,7 @@ -+SUBSYSTEM!="block", GOTO="psv_end" -+ACTION!="add|change", GOTO="psv_end" -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="cciss[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", IMPORT{program}="vol_id --export $tempnode" -+LABEL="psv_end" -diff --git modules/udev-rules/59-persistent-storage.rules modules/udev-rules/59-persistent-storage.rules -new file mode 100644 -index 0000000..2b83e72 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage.rules -@@ -0,0 +1,38 @@ -+SUBSYSTEM!="block", GOTO="ps_end" -+ACTION!="add|change", GOTO="ps_end" -+ -+KERNEL=="cciss[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end" -+ -+# partitions have no md/{array_state,metadata_version} -+ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" -+ -+# container devices have a metadata version of e.g. 'external:ddf' and -+# never leave state 'inactive' -+ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -+TEST!="md/array_state", GOTO="md_end" -+ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -+ -+LABEL="md_ignore_state" -+ -+IMPORT{program}="/sbin/mdadm --detail --export $tempnode" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+OPTIONS+="link_priority=100" -+OPTIONS+="watch" -+LABEL="md_end" -+ -+ -+KERNEL!="dm-[0-9]*", GOTO="ps_end" -+ACTION=="add", GOTO="ps_end" -+IMPORT{program}="/sbin/dmsetup info -c --nameprefixes --unquoted --rows --noheadings -o name,uuid,suspended,readonly,major,minor,open,tables_loaded,names_using_dev -j%M -m%m" -+ENV{DM_NAME}!="?*", GOTO="ps_end" -+ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="ps_end" -+ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="ps_end" -+ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="ps_end" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+LABEL="ps_end" -diff --git modules/udev-rules/61-persistent-storage.rules modules/udev-rules/61-persistent-storage.rules -new file mode 100644 -index 0000000..9cfdb0b ---- /dev/null -+++ modules/udev-rules/61-persistent-storage.rules -@@ -0,0 +1,20 @@ -+SUBSYSTEM!="block", GOTO="pss_end" -+ACTION!="add|change", GOTO="pss_end" -+ -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss" -+KERNEL=="cciss[0-9]*", GOTO="do_pss" -+KERNEL=="nbd[0-9]*", GOTO="do_pss" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", GOTO="do_pss" -+ -+GOTO="pss_end" -+ -+LABEL="do_pss" -+# by-path (parent device path) -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{program}="path_id %p" -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" -+ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" -+ -+# by-label/by-uuid links (filesystem metadata) -+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -+LABEL="pss_end" -diff --git modules/udev-rules/blacklist.conf modules/udev-rules/blacklist.conf -new file mode 100644 -index 0000000..21ac71c ---- /dev/null -+++ modules/udev-rules/blacklist.conf -@@ -0,0 +1,162 @@ -+blacklist ath_pci -+blacklist evbug -+blacklist usbmouse -+blacklist usbkbd -+blacklist eepro100 -+blacklist de4x5 -+blacklist eth1394 -+blacklist snd_intel8x0m -+blacklist snd_aw2 -+blacklist i2c_i801 -+blacklist prism54 -+blacklist bcm43xx -+blacklist garmin_gps -+blacklist asus_acpi -+blacklist snd_pcsp -+blacklist pcspkr -+blacklist amd76x_edac -+blacklist ohci1394 -+blacklist sbp2 -+blacklist dv1394 -+blacklist raw1394 -+blacklist video1394 -+blacklist aty128fb -+blacklist atyfb -+blacklist radeonfb -+blacklist cirrusfb -+blacklist cyber2000fb -+blacklist cyblafb -+blacklist gx1fb -+blacklist hgafb -+blacklist i810fb -+blacklist intelfb -+blacklist kyrofb -+blacklist lxfb -+blacklist matroxfb_base -+blacklist neofb -+blacklist nvidiafb -+blacklist pm2fb -+blacklist rivafb -+blacklist s1d13xxxfb -+blacklist savagefb -+blacklist sisfb -+blacklist sstfb -+blacklist tdfxfb -+blacklist tridentfb -+blacklist vesafb -+blacklist vfb -+blacklist viafb -+blacklist vt8623fb -+blacklist ac97 -+blacklist ac97_codec -+blacklist ac97_plugin_ad1980 -+blacklist ad1848 -+blacklist ad1889 -+blacklist adlib_card -+blacklist aedsp16 -+blacklist ali5455 -+blacklist btaudio -+blacklist cmpci -+blacklist cs4232 -+blacklist cs4281 -+blacklist cs461x -+blacklist cs46xx -+blacklist emu10k1 -+blacklist es1370 -+blacklist es1371 -+blacklist esssolo1 -+blacklist forte -+blacklist gus -+blacklist i810_audio -+blacklist kahlua -+blacklist mad16 -+blacklist maestro -+blacklist maestro3 -+blacklist maui -+blacklist mpu401 -+blacklist nm256_audio -+blacklist opl3 -+blacklist opl3sa -+blacklist opl3sa2 -+blacklist pas2 -+blacklist pss -+blacklist rme96xx -+blacklist sb -+blacklist sb_lib -+blacklist sgalaxy -+blacklist sonicvibes -+blacklist sound -+blacklist sscape -+blacklist trident -+blacklist trix -+blacklist uart401 -+blacklist uart6850 -+blacklist via82cxxx_audio -+blacklist v_midi -+blacklist wavefront -+blacklist ymfpci -+blacklist ac97_plugin_wm97xx -+blacklist ad1816 -+blacklist audio -+blacklist awe_wave -+blacklist dmasound_core -+blacklist dmasound_pmac -+blacklist harmony -+blacklist sequencer -+blacklist soundcard -+blacklist usb-midi -+blacklist acquirewdt -+blacklist advantechwdt -+blacklist alim1535_wdt -+blacklist alim7101_wdt -+blacklist booke_wdt -+blacklist cpu5wdt -+blacklist eurotechwdt -+blacklist i6300esb -+blacklist i8xx_tco -+blacklist ib700wdt -+blacklist ibmasr -+blacklist indydog -+blacklist iTCO_wdt -+blacklist it8712f_wdt -+blacklist it87_wdt -+blacklist ixp2000_wdt -+blacklist ixp4xx_wdt -+blacklist machzwd -+blacklist mixcomwd -+blacklist mpc8xx_wdt -+blacklist mpcore_wdt -+blacklist mv64x60_wdt -+blacklist pc87413_wdt -+blacklist pcwd -+blacklist pcwd_pci -+blacklist pcwd_usb -+blacklist s3c2410_wdt -+blacklist sa1100_wdt -+blacklist sbc60xxwdt -+blacklist sbc7240_wdt -+blacklist sb8360 -+blacklist sc1200wdt -+blacklist sc520_wdt -+blacklist sch311_wdt -+blacklist scx200_wdt -+blacklist shwdt -+blacklist smsc37b787_wdt -+blacklist softdog -+blacklist twl4030_wdt -+blacklist w83627hf_wdt -+blacklist w83697hf_wdt -+blacklist w83697ug_wdt -+blacklist w83877f_wdt -+blacklist w83977f_wdt -+blacklist wafer5823wdt -+blacklist wdt -+blacklist wdt_pci -+blacklist wm8350_wdt -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -diff --git modules/udev-rules/load-modules.sh modules/udev-rules/load-modules.sh -new file mode 100755 -index 0000000..36972fd ---- /dev/null -+++ modules/udev-rules/load-modules.sh -@@ -0,0 +1,7 @@ -+#!/bin/sh -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+# Implement blacklisting for udev-loaded modules -+ -+modprobe -b "$@" -diff --git modules/udev-rules/module-setup.sh modules/udev-rules/module-setup.sh -new file mode 100755 -index 0000000..93c01f4 ---- /dev/null -+++ modules/udev-rules/module-setup.sh -@@ -0,0 +1,65 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+install_module() { -+ # FIXME: would be nice if we didn't have to know which rules to grab.... -+ # ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies -+ # of the rules we want so that we just copy those in would be best -+ [[ -x /sbin/udevd ]] && dracut_install udevd -+ dracut_install udevadm /etc/udev/udev.conf /etc/group /bin/mount /sbin/modprobe -+ inst_rules 50-udev-default.rules 60-persistent-storage.rules \ -+ 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \ -+ 60-pcmcia.rules -+ mkdir -p "$initdir"/etc/modprobe.d -+ inst_simple "$moddir/blacklist.conf" /etc/modprobe.d/ -+ -+ # ignore some devices in the initrd -+ inst_rules "$moddir/01-ignore.rules" -+ -+ # for firmware loading -+ inst_rules 50-firmware.rules -+ -+ if [ ! -x /lib/udev/vol_id ]; then -+ inst_rules "$moddir/59-persistent-storage.rules" -+ else -+ inst_rules "$moddir/59-persistent-storage-volid.rules" -+ fi -+ inst_rules "$moddir/61-persistent-storage.rules" -+ -+ for i in \ -+ ata_id \ -+ cdrom_id \ -+ create_floppy_devices \ -+ edd_id \ -+ firmware.sh \ -+ firmware \ -+ firmware.agent \ -+ hotplug.functions \ -+ fw_unit_symlinks.sh \ -+ hid2hci \ -+ path_id \ -+ scsi_id \ -+ usb_id \ -+ vol_id \ -+ pcmcia-socket-startup \ -+ pcmcia-check-broken-cis \ -+ udevd \ -+ ; do -+ for utilpath in /lib/udev /sbin /bin -+ do -+ [ -e $utilpath/$i ] && dracut_install $utilpath/$i -+ done -+ done -+ -+ if ! [ -e "$initdir/sbin/udevd" ]; then -+ if [ -x /lib/udev/udevd ]; then -+ ln -s /lib/udev/udevd "$initdir/sbin/udevd" -+ fi -+ fi -+ -+ for i in {"$libdir","$usrlibdir"}/libnss_files*; do -+ [ -e "$i" ] && dracut_install "$i" -+ done -+} -+ diff --git a/sys-kernel/calckernel/files/calckernel-3.4.18.patch b/sys-kernel/calckernel/files/calckernel-3.4.18.patch deleted file mode 100644 index cdf521b53..000000000 --- a/sys-kernel/calckernel/files/calckernel-3.4.18.patch +++ /dev/null @@ -1,2078 +0,0 @@ -diff --git defaults/initrd.defaults defaults/initrd.defaults -index 76d72a7..0c059a5 100755 ---- defaults/initrd.defaults -+++ defaults/initrd.defaults -@@ -68,6 +68,7 @@ fi - - REAL_ROOT='' - CDROOT='0' -+SCRATCH='0' - CDROOT_DEV='' - CDROOT_TYPE='auto' - NEW_ROOT='/newroot' -diff --git defaults/initrd.scripts defaults/initrd.scripts -index 51ebcce..3723854 100755 ---- defaults/initrd.scripts -+++ defaults/initrd.scripts -@@ -187,23 +187,45 @@ cache_cd_contents() { - # TODO: Check the size of the image versus the size of our tmpfs - # along with the amount of available RAM and increase tmpfs size - # if necessary. (Not having awk sucks...) -- # z=0 -- # for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -- # cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; do -- # z=$(($z + $i)) ; done -- # echo $z -- good_msg "Copying loop file for caching..." -- # Verify that the needed directory exists -- mkdir -p "$(dirname ${NEW_ROOT}/mnt/${LOOP})" -- cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/${LOOP} -- if [ $? -ne 0 ] -+ -+ # getting memory -+ allmemory=0 -+ for i in $(cat /proc/meminfo | grep -e ^MemFree -e ^Cached | \ -+ cut -d: -f2 | cut -dk -f1 | sed -e "s/^\s*//") ; -+ do -+ allmemory=$(($allmemory + $i)) -+ done -+ -+ # getting size tmpfs of default -+ let curtfs=$allmemory/2 -+ -+ # getting size of image -+ let imagesize=`ls -la ${NEW_ROOT}/mnt/cdrom/${LOOP} | sed -r -n 's/(\S*\s*){4}(\S*).*/\2/p'`/20000*21 -+ let addon=$imagesize/10 -+ if [[ $curtfs -gt $(( ${imagesize} + ${addon} )) ]]; - then -- bad_msg "Failed to cache the loop file! Lack of space?" -- rm -rf ${NEW_ROOT}/mnt/livecd.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/image.* 2>/dev/null -- rm -rf ${NEW_ROOT}/mnt/zisofs 2>/dev/null -+ let addon=$(( $curtfs - ${imagesize} )) -+ fi -+ -+ if [[ $((${imagesize} + $addon)) -lt ${allmemory} ]]; -+ then -+ mount -o remount,size=${addon}000 -t tmpfs tmpfs ${NEW_ROOT} -+ mkdir ${NEW_ROOT}/mnt/squash -+ mount -o size=${imagesize}000 -t tmpfs tmpfs ${NEW_ROOT}/mnt/squash -+ good_msg "Copying loop file for caching..." -+ cp -a ${NEW_ROOT}/mnt/cdrom/${LOOP} ${NEW_ROOT}/mnt/squash/${LOOP} -+ if [ $? -ne 0 ] -+ then -+ bad_msg "Failed to cache the loop file! Lack of space?" -+ umount ${NEW_ROOT}/mnt/squash -+ mount -o remount,size=${curtfs}000 -t tmpfs tmpfs ${NEW_ROOT} -+ else -+ LOOPEXT='../squash/' -+ good_msg "Unmounting media from ${NEW_ROOT}/mnt/cdrom" -+ umount ${NEW_ROOT}/mnt/cdrom -+ fi - else -- LOOPEXT='../' -+ bad_msg "Too low memory for cache the loop file." - fi - fi - fi -@@ -655,7 +677,7 @@ startVolumes() { - [ -d /etc/lvm/cache ] && lvm_commands="${lvm_commands} \nvgscan" - - # To activate volumegroups on all devices in the cache -- lvm_commands="${lvm_commands} \nvgchange -ay --sysinit" -+ lvm_commands="${lvm_commands} \nvgchange -ay --sysinit --noudevsync" - - # And finally execute it all (/proc/... needed if lvm is compiled without readline) - good_msg "Scanning for and activating Volume Groups" -@@ -1082,6 +1104,38 @@ getdvhoff() { - echo $(( $(hexdump -n 4 -s $((316 + 12 * $2)) -e '"%i"' $1) * 512)) - } - -+load_union_module() { -+ UNIONTYPE="" -+ # find module for union file system -+ [ -n "$(find /lib/ -name unionfs.ko)" ] && UNIONTYPE="unionfs" -+ [ -n "$(find /lib/ -name aufs.ko)" ] && UNIONTYPE="aufs" -+ # probably aufs in kernel -+ if [ -n "$(gzip -dc /proc/config.gz | grep CONFIG_AUFS_FS=y )" ] -+ then -+ UNIONTYPE="aufs" -+ else -+ if [ -z "${UNIONTYPE}" ] -+ then -+ bad_msg "Module for union file system is not found!" -+ run_shell -+ else -+ modprobe ${UNIONTYPE} > /dev/null 2>&1 -+ # error on load union module -+ if [ -z "$(lsmod | grep $UNIONTYPE)" ] -+ then -+ bad_msg "Module for union file system is not correct!" -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ bad_msg "Probably kernel compiled without standalone patch." -+ fi -+ run_shell -+ fi -+ -+ good_msg "Loading ${UNIONTYPE}" -+ fi -+ fi -+} -+ - setup_unionfs() { - local rw_dir=$1 - local ro_dir=$2 -@@ -1101,6 +1155,7 @@ setup_unionfs() { - mkdir -p ${UNION} - good_msg "Loading fuse module" - modprobe fuse > /dev/null 2>&1 -+ load_union_module - # if [ -n "${UNIONFS}" ] - # then - # CHANGESDEV=${UNIONFS} -@@ -1130,11 +1185,102 @@ setup_unionfs() { - mkdir /tmp - mkdir -p ${UNION} - # mkdir -p $CHANGES --# mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+## mount -t unionfs -o dirs=$CHANGES=rw unionfs ${UNION} -+ -+ if [ "${SCRATCH}" -ne 0 ]; -+ then -+ good_msg "Loading in scratch mode" -+ BUILDERDIR=${UNION}/mnt/builder -+ SCRATCHDIR=${UNION}/mnt/scratch -+ DELTADIR=${rw_dir}/mnt/delta -+ WORKSPACEDIR=${rw_dir}/mnt/workspace -+ mount -o remount,rw ${rw_dir}/mnt/cdrom >/dev/null 2>&1 -+ touch ${rw_dir}/mnt/cdrom/livecd >/dev/null 2>&1 -+ if [ "$?" -ne 0 ]; -+ then -+ ISRW=0 -+ else -+ ISRW=1 -+ fi -+ -+ mkdir -p ${DELTADIR} -+ mkdir -p ${WORKSPACEDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${WORKSPACEDIR}=rw:${DELTADIR}=ro+wh:${rw_dir}/mnt/livecd=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${WORKSPACEDIR}=rw:${DELTADIR}=ro:${rw_dir}/mnt/livecd=ro unionfs ${UNION} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${SCRATCHDIR}/calculate -+ mkdir -p ${SCRATCHDIR}/delta -+ mkdir -p ${SCRATCHDIR}/workspace -+ mount -o bind ${rw_dir}/mnt/delta ${SCRATCHDIR}/delta -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind ${rw_dir}/mnt/workspace ${SCRATCHDIR}/workspace -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mkdir -p ${BUILDERDIR} -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro none ${BUILDERDIR} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${DELTADIR}=rw:${rw_dir}/mnt/livecd=ro unionfs ${BUILDERDIR} -+ fi -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ mount -o bind,ro ${rw_dir}/mnt/livecd ${SCRATCHDIR}/calculate -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ if [ "$ISRW" -ne 0 ]; -+ then -+ FLASHDIR=${UNION}/mnt/flash -+ mkdir -p ${FLASHDIR} -+ mount -o bind ${rw_dir}/mnt/cdrom ${FLASHDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ mkdir -p ${CDROMDIR} -+ mount -o bind,ro ${rw_dir}/mnt/cdrom ${CDROMDIR} -+ tmpret=$?;[ "$tmpret" -ne 0 ] && ret=$tmpret -+ fi -+ else -+ CDROMDIR=${UNION}/mnt/cdrom -+ LIVECDDIR=${UNION}/mnt/livecd -+ -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if ! mount -t aufs -o udba=reval,br:${rw_dir}:${ro_dir}=ro none ${UNION} -+ then -+ bad_msg "Can't setup union mount!" -+ run_shell -+ fi -+ else -+ mount -t unionfs -o dirs=${rw_dir}:${ro_dir}=ro unionfs ${UNION} -+ fi -+ -+ if [[ -n "$( echo ${LOOPEXT} | grep squash )" ]]; -+ then -+ mkdir -p ${UNION}/mnt/squash -+ mount -o bind ${NEW_ROOT}/mnt/squash ${UNION}/mnt/squash &>/dev/null -+ fi -+ -+ chmod 0755 ${UNION} -+ mount -o bind ${rw_dir}/mnt/cdrom ${CDROMDIR} &>/dev/null -+ mount -o bind ${rw_dir}/mnt/livecd ${LIVECDDIR} &>/dev/null -+ ret=$? -+ fi -+ -+ chmod 1777 ${UNION}/tmp - good_msg "Creating union mount" -- unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -- ret=$? -- if [ ${ret} -ne 0 ] -+# unionfs -o allow_other,cow,noinitgroups,suid,dev,default_permissions,use_ino ${rw_dir}=RW:${ro_dir}=RO ${UNION} 2>/dev/null -+# ret=$? -+ if [ "${ret}" -ne 0 ] - then - bad_msg "Can't setup union mount!" - USE_UNIONFS_NORMAL=0 -@@ -1143,3 +1289,106 @@ setup_unionfs() { - USE_UNIONFS_NORMAL=0 - fi - } -+ -+load_videodrv() { -+ good_msg "Loading frame buffer video driver" -+ # find all available fb drivers -+ videodrv_count=$(find /lib/modules \ -+ -name "nouveau.ko" -o \ -+ -name "uvesafb.ko" -o \ -+ -name "i915.ko" -o \ -+ -name "radeon.ko" | -+ grep -c "") -+ # load specified videodrv -+ modules_list= -+ case "${VIDEODRV}" in -+ nouveau) -+ modules_list="nouveau" -+ ;; -+ radeon) -+ modules_list="radeon" -+ ;; -+ i915|intel) -+ modules_list="i915" -+ ;; -+ ""|auto) -+ # if not livecd and initramfs otimized (aviailable only one video driver) -+ if [ "${CDROOT}" != '1' -a "${videodrv_count}" -le 2 ] -+ then -+ modules_list="nouveau i915 radeon" -+ else -+ if [[ -x /usr/sbin/lspci ]] -+ then -+ if lspci | grep -m1 VGA | grep -qi intel -+ then -+ modules_list="i915" -+ elif lspci | grep -m1 VGA | grep -qi nvidia -+ then -+ modules_list="nouveau" -+ elif lspci | grep -m1 VGA | grep -q -e "Ati" -e "ATI" -+ then -+ modules_list="radeon" -+ else -+ modules_list="" -+ fi -+ else -+ modules_list="i915" -+ fi -+ fi -+ ;; -+ esac -+ for x in $modules_list -+ do -+ if [ "`find /lib/modules -name "${x}.ko" | grep -c ''`" -eq "1" ] -+ then -+ modprobe "${x}" modeset=${USE_MODESET} &>/dev/null -+ lsmod | grep -q "${x}" && return 0 -+ fi -+ done -+ # else load uvesafb with specified video resolution -+ if [ -n "${VIDEORES}" ] -+ then -+ if ! echo $VIDEORES | grep -q "\-" -+ then -+ VIDEORES="${VIDEORES}-32" -+ fi -+ else -+ VIDEORES="1024x768-32" -+ fi -+ modprobe uvesafb mode_option=${VIDEORES} &>/dev/null -+} -+ -+start_udev() -+{ -+ # start udev -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ echo "" >/proc/sys/kernel/hotplug -+ udevd --daemon &>/dev/null -+ udevadm settle -+ fi -+} -+ -+stop_udev() -+{ -+ # kill udevd -+ if [ "${USE_UDEV}" == "1" ] -+ then -+ pkill udevd &>/dev/null -+ fi -+} -+ -+populate_dev() -+{ -+ good_msg 'Activating udev' -+ # Do not run any init-scripts -+ udevadm control --property=do_not_run_plug_service=1 -+ -+ # discarding net drivers placed into blacklist.conf -+ udevadm trigger --action="add" -+ -+ # we can speed up booting under these conditions: -+ # * using devtmpfs so kernel creates device nodes for us -+ # * only using kernel created device nodes at boot (in /etc/fstab and elsewhere) -+ udevadm settle --timeout=60 -+} -diff --git defaults/linuxrc defaults/linuxrc -index 0843f5d..8109d09 100755 ---- defaults/linuxrc -+++ defaults/linuxrc -@@ -39,6 +39,13 @@ FAKE_ROOT='' - REAL_ROOTFLAGS='' - ROOTFSTYPE='auto' - CRYPT_SILENT=0 -+VIDEODRV='' -+USE_UDEV=1 -+USE_MODESET=1 -+if [ -e "/etc/calculate/calculate.ini" ] -+then -+ source /etc/calculate/calculate.ini -+fi - for x in ${CMDLINE} - do - case "${x}" in -@@ -57,6 +64,57 @@ do - init_opts\=*) - INIT_OPTS=`parse_opt "${x}"` - ;; -+ nokms) -+ USE_MODESET=0 -+ ;; -+ kms) -+ USE_MODESET=1 -+ ;; -+ noudev) -+ USE_UDEV=0 -+ ;; -+ calculate\=*) -+ CALCULATE=`parse_opt "${x}"` -+ if [[ "${CALCULATE//:/}" != "${CALCULATE}" ]] -+ then -+ for i in ${CALCULATE//,/ } -+ do -+ case "${i}" in -+ video:*) -+ VIDEODRV=`echo "${i}" | cut -s -d: -f2-` -+ ;; -+ resolution:*) -+ RES=`echo "${i}" | cut -s -d: -f2-` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ ;; -+ esac -+ done -+ else -+ RES=`echo "${CALCULATE}" | cut -s -d, -f4` -+ if [ -n "${RES}" -a "${RES}" != "auto" ] -+ then -+ VIDEORES=${RES}-32 -+ fi -+ VIDEODRV=`echo "${CALCULATE}" | cut -s -d, -f5` -+ fi -+ ;; -+ video\=*) -+ VR=`parse_opt "${x}"` -+ for i in ${VR//,/ } -+ do -+ if [ -z "${i//[0-9-x@]}" ] -+ then -+ VIDEORES=${i} -+ fi -+ done -+ ;; -+ # Scratch usbload -+ scratch) -+ SCRATCH=1 -+ ;; - # Livecd options - cdroot) - CDROOT=1 -@@ -251,15 +309,24 @@ then - REAL_ROOT="${FAKE_ROOT}" - fi - --splash 'init' -- --cmdline_hwopts -+# check udevd -+[ ! -x /sbin/udevd ] && USE_UDEV=0 - - # Mount sysfs - mount_sysfs - -+# start udev -+start_udev -+ -+# load kernel video driver -+load_videodrv -+ -+splash 'init' -+ -+cmdline_hwopts -+ - # Setup hotplugging for firmware loading --setup_hotplug -+[ "${USE_UDEV}" == "0" ] && setup_hotplug - - # Load modules listed in MY_HWOPTS if /lib/modules exists for the running kernel - if [ -z "${DO_modules}" ] -@@ -269,7 +336,7 @@ elif [ -d "/lib/modules/${KV}" ] - then - good_msg 'Loading modules' - # Load appropriate kernel modules -- if [ "${NODETECT}" != '1' ] -+ if [ "${USE_UDEV}" != '1' -a "${NODETECT}" != '1' ] - then - for modules in ${MY_HWOPTS} - do -@@ -285,14 +352,20 @@ fi - # Apply scan delay if specified - sdelay - --# Setup slow USB bits --setup_slowusb -+if [ "${USE_UDEV}" == "1" ] -+then -+ # populate /dev with devices already found by the kernel -+ populate_dev -+else -+ # Setup slow USB bits -+ setup_slowusb - --# Start device manager --start_dev_mgr -+ # Start device manager -+ start_dev_mgr - --# if doslowusb is passed, pause other 10 seconds here, after mdev load --[ "${DO_slowusb}" ] && sleep 10 -+ # if doslowusb is passed, pause other 10 seconds here, after mdev load -+ [ "${DO_slowusb}" ] && sleep 10 -+fi - - # Start iSCSI - if [ -e /bin/iscsistart ] -@@ -509,9 +582,50 @@ do - then - break - else -- bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -- got_good_root=0 -- REAL_ROOT='' -+ # check for scratch -+ if [ -e ${NEW_ROOT}/livecd.squashfs -a -d ${NEW_ROOT}/delta -a -d ${NEW_ROOT}/workspace ]; -+ then -+ good_msg 'Found scratch data...' -+ load_union_module -+ modprobe squashfs >/dev/null -+ if mount -o remount,rw ${NEW_ROOT}; -+ then -+ mkdir -p ${NEW_ROOT}/calculate && mkdir -p /union && mkdir -p ${NEW_ROOT}/workspace/mnt/builder && mkdir -p ${NEW_ROOT}/workspace/mnt/scratch -+ if mount -o loop,ro -t squashfs ${NEW_ROOT}/livecd.squashfs ${NEW_ROOT}/calculate; -+ then -+ if [[ ${UNIONTYPE} = aufs ]] -+ then -+ if mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/workspace=rw:${NEW_ROOT}/delta=ro+wh:${NEW_ROOT}/calculate=ro none /union; -+ then -+ mount -t aufs -o ro,udba=reval,br:${NEW_ROOT}/delta=rw:${NEW_ROOT}/calculate=ro none /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers!' -+ run_shell -+ fi -+ else -+ if mount -t unionfs -o ro,dirs=${NEW_ROOT}/workspace:${NEW_ROOT}/delta=ro:${NEW_ROOT}/calculate=ro unionfs /union; -+ then -+ mount -t unionfs -o ro,dirs=${NEW_ROOT}/delta:${NEW_ROOT}/calculate=ro unionfs /union/mnt/builder -+ CHROOT=/union -+ break; -+ else -+ bad_msg 'Could not merge scratch layers' -+ run_shell -+ fi -+ fi -+ else -+ bad_msg 'Could not mount scratch squashfs image' -+ fi -+ else -+ bad_msg 'Could not remount ${NEW_ROOT}' -+ fi -+ else -+ bad_msg "The filesystem mounted at ${REAL_ROOT} does not appear to be a valid /, try again" -+ got_good_root=0 -+ REAL_ROOT='' -+ fi - fi - else - bad_msg "Could not mount specified ROOT, try again" -@@ -723,9 +837,12 @@ cd "${CHROOT}" - mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null - echo -ne "${BOLD}.${NORMAL}" - -+# stop udev before move mount points -+stop_udev -+ - # If devtmpfs is mounted, try move it to the new root - # If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise --for fs in /dev /sys /proc -+for fs in "/dev " /sys /proc - do - if grep -qs "$fs" /proc/mounts - then -diff --git defaults/modprobe defaults/modprobe -index ba2d890..9280357 100755 ---- defaults/modprobe -+++ defaults/modprobe -@@ -10,8 +10,6 @@ usage() { - echo - echo 'Example:' - echo ' modprobe eepro100' -- echo -- echo 'Note: Do not pass the suffix to modprobe!' - exit 1 - } - -@@ -81,14 +79,29 @@ modprobe2() { - usage - exit 1 - fi -- real_path=`real_mod_path ${1}` -+ local modname=${1} -+ local quiet='' -+ local params='' -+ shift -+ for x in $@ -+ do -+ case ${x} in -+ -n) -+ quiet=1 -+ ;; -+ *) -+ params="${params} ${x}" -+ ;; -+ esac -+ done -+ real_path=`real_mod_path ${modname}` - if [ "${real_path}" = '' -o "${real_path}" = ' ' ] - then -- [ "${2}" = '-n' ] && echo -n " -> $1" -+ [ "${quiet}" = '1' ] && echo -n " -> ${modname}" - echo ' module not found.' - exit 2 - fi -- modlist=`modules_dep_list ${1}` -+ modlist=`modules_dep_list ${modname}` - if [ "${modlist}" != '' -a "${modlist}" != ' ' ] - then - deps=`strip_mod_paths ${modlist}` -@@ -110,13 +123,13 @@ modprobe2() { - filler=1 - fi - done -- ${INSMOD} ${real_path} > /dev/null 2>&1 -+ ${INSMOD} ${real_path} ${params} > /dev/null 2>&1 - ret=$? - if [ ${ret} -eq 0 ] - then - echoAppend=' loaded.' -- [ "${2}" = '-n' ] && echoFlags='-n' && echoAppend=', ' -- echo ${echoFlags} "${1}${echoAppend}" -+ [ "${quiet}" = '1' ] && echoFlags='-n' && echoAppend=', ' -+ echo ${echoFlags} "${modname}${echoAppend}" - fi - return $ret - } -@@ -132,7 +145,7 @@ do - LOADED_MODULES="${LOADED_MODULES} ${x}" - done - --modprobe2 ${1} -+modprobe2 ${@} - modprobe_ret=$? - - [ -f '/modules.cache' ] && rm -f /modules.cache > /dev/null 2>&1 -diff --git dracut_funcs.sh dracut_funcs.sh -new file mode 100755 -index 0000000..e80a638 ---- /dev/null -+++ dracut_funcs.sh -@@ -0,0 +1,752 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+# -+# functions used by dracut and other tools. -+# -+# Copyright 2005-2009 Red Hat, Inc. All rights reserved. -+# -+# 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; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+# -+ -+IF_RTLD="" -+IF_dynamic="" -+ -+# Generic substring function. If $2 is in $1, return 0. -+strstr() { [[ $1 =~ $2 ]]; } -+ -+# Create all subdirectories for given path without creating the last element. -+# $1 = path -+mksubdirs() { mkdir -p ${1%/*}; } -+ -+# Version comparision function. Assumes Linux style version scheme. -+# $1 = version a -+# $2 = comparision op (gt, ge, eq, le, lt, ne) -+# $3 = version b -+vercmp() { -+ local n1=(${1//./ }) op=$2 n2=(${3//./ }) i res -+ -+ for ((i=0; ; i++)) -+ do -+ if [[ ! ${n1[i]}${n2[i]} ]]; then res=0 -+ elif ((${n1[i]:-0} > ${n2[i]:-0})); then res=1 -+ elif ((${n1[i]:-0} < ${n2[i]:-0})); then res=2 -+ else continue -+ fi -+ break -+ done -+ -+ case $op in -+ gt) ((res == 1));; -+ ge) ((res != 2));; -+ eq) ((res == 0));; -+ le) ((res != 1));; -+ lt) ((res == 2));; -+ ne) ((res != 0));; -+ esac -+} -+ -+is_func() { -+ [[ $(type -t $1) = "function" ]] -+} -+ -+# Log initrd creation. -+if ! [[ $dracutlogfile ]]; then -+ [[ $dracutbasedir = /usr/share/dracut ]] && \ -+ dracutlogfile=/var/log/dracut.log || \ -+ dracutlogfile=/tmp/dracut.log -+# [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log -+ if [[ -w $dracutlogfile ]]; then -+ >"$dracutlogfile" -+ fi -+fi -+ -+dwarning() { -+ echo "W: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "W: $@" >>"$dracutlogfile" -+} -+ -+dinfo() { -+ [[ $beverbose ]] && echo "I: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "I: $@" >>"$dracutlogfile" -+} -+ -+derror() { -+ echo "E: $@" >&2 -+ [[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile" -+} -+ -+# Function prints global variables in format name=value line by line. -+# $@ = list of global variables' name -+print_vars() { -+ local var value -+ -+ for var in $@ -+ do -+ value=$(eval echo \$$var) -+ [[ ${value} ]] && echo "${var}=\"${value}\"" -+ done -+} -+ -+get_fs_env() { -+ [[ $1 ]] || return -+ eval $(udevadm info --query=env --name=$1|egrep 'ID_FS_(TYPE|UUID)=') -+ [[ $ID_FS_TYPE ]] && return -+ -+ if [[ -x /lib/udev/vol_id ]]; then -+ eval $(/lib/udev/vol_id --export $1) -+ elif find_binary blkid >/dev/null; then -+ eval $(blkid -o udev $1) -+ else -+ return 1 -+ fi -+} -+ -+get_fs_type() ( -+ [[ $1 ]] || return -+ if [[ $1 != ${1#/dev/block/nfs:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs3:} ]] \ -+ || [[ $1 != ${1#/dev/block/nfs4:} ]]; then -+ echo "nfs" -+ return -+ fi -+ get_fs_env $1 || return -+ echo $ID_FS_TYPE -+) -+ -+get_fs_uuid() ( -+ get_fs_env $1 || return -+ echo $ID_FS_UUID -+) -+ -+# finds the major:minor of the block device backing the root filesystem. -+find_block_device() { -+ local x mpt majmin dev fs misc maj min -+ if [[ $use_fstab != yes ]]; then -+ while read x x majmin x mpt x x fs dev misc; do -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $fs = btrfs ]] && { -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ } -+ if [[ $mpt = $1 ]] && [[ ${majmin#0:} = $majmin ]]; then -+ echo $majmin; -+ return 0 # we have a winner! -+ fi -+ done < /proc/self/mountinfo -+ fi -+ # fall back to /etc/fstab -+ while read dev mpt fs misc; do -+ if [[ $mpt = $1 ]]; then -+ [[ $fs = nfs ]] && { echo $dev; return 0;} -+ [[ $fs = nfs3 ]] && { echo $dev; return 0;} -+ [[ $fs = nfs4 ]] && { echo $dev; return 0;} -+ [[ $dev != ${dev#UUID=} ]] && dev=/dev/disk/by-uuid/${dev#UUID=} -+ [[ $dev != ${dev#LABEL=} ]] && dev=/dev/disk/by-label/${dev#LABEL=} -+ [[ -b $dev ]] || return 1 # oops, not a block device. -+ ls -nLl "$dev" | { -+ read x x x x maj min x; -+ maj=${maj//,/}; -+ echo $maj:$min; -+ } && return 0 -+ fi -+ done < /etc/fstab -+ return 1; -+} -+ -+find_root_block_device() { find_block_device /; } -+ -+# Walk all the slave relationships for a given block device. -+# Stop when our helper function returns success -+# $1 = function to call on every found block device -+# $2 = block device in major:minor format -+check_block_and_slaves() { -+ local x -+ [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. -+ "$1" $2 && return -+ check_vol_slaves "$@" && return 0 -+ if [[ -f /sys/dev/block/$2/../dev ]]; then -+ check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0 -+ fi -+ [[ -d /sys/dev/block/$2/slaves ]] || return 1 -+ for x in /sys/dev/block/$2/slaves/*/dev; do -+ [[ -f $x ]] || continue -+ check_block_and_slaves $1 $(cat "$x") && return 0 -+ done -+ return 1 -+} -+ -+get_numeric_dev() { -+ ls -lH "$1" | { read a b c d maj min rest; printf "%d:%d" ${maj%%,} $min;} -+} -+ -+# ugly workaround for the lvm design -+# There is no volume group device, -+# so, there are no slave devices for volume groups. -+# Logical volumes only have the slave devices they really live on, -+# but you cannot create the logical volume without the volume group. -+# And the volume group might be bigger than the devices the LV needs. -+check_vol_slaves() { -+ for i in /dev/mapper/*; do -+ lv=$(get_numeric_dev $i) -+ if [[ $lv = $2 ]]; then -+ vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null) -+ # strip space -+ vg=$(echo $vg) -+ if [[ $vg ]]; then -+ for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \ -+ do -+ check_block_and_slaves $1 $(get_numeric_dev $pv) \ -+ && return 0 -+ done -+ fi -+ fi -+ done -+ return 1 -+} -+ -+# Install a directory, keeping symlinks as on the original system. -+# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file" -+# will create ${initdir}/lib64, ${initdir}/lib64/file, -+# and a symlink ${initdir}/lib -> lib64. -+inst_dir() { -+ local dir="$1" -+ [[ -e ${initdir}$dir ]] && return 0 -+ -+ # iterate over parent directories -+ local file="" -+ local IFS="/" -+ for part in $dir; do -+ [[ $part ]] || continue -+ file="$file/$part" -+ [[ -e ${initdir}$file ]] && continue -+ -+ if [[ -L $file ]]; then -+ # create link as the original -+ local target=$(readlink "$file") -+ ln -sfn "$target" "${initdir}$file" || return 1 -+ # resolve relative path and recursively install destionation -+ [[ $target = ${target##*/} ]] && target="${file%/*}/$target" -+ inst_dir "$target" -+ else -+ # create directory -+ mkdir -p "${initdir}$file" || return 1 -+ fi -+ done -+} -+ -+# $1 = file to copy to ramdisk -+# $2 (optional) Name for the file on the ramdisk -+# Location of the image dir is assumed to be $initdir -+# We never overwrite the target if it exists. -+inst_simple() { -+ local src target -+ [[ -f $1 ]] || return 1 -+ src=$1 target="${2:-$1}" -+ if ! [[ -d ${initdir}$target ]]; then -+ [[ -e ${initdir}$target ]] && return 0 -+ inst_dir "${target%/*}" -+ fi -+ dinfo "Installing $src" -+ cp -pfL "$src" "${initdir}$target" -+} -+ -+# find symlinks linked to given library file -+# $1 = library file -+# Function searches for symlinks by stripping version numbers appended to -+# library filename, checks if it points to the same target and finally -+# prints the list of symlinks to stdout. -+# -+# Example: -+# rev_lib_symlinks libfoo.so.8.1 -+# output: libfoo.so.8 libfoo.so -+# (Only if libfoo.so.8 and libfoo.so exists on host system.) -+rev_lib_symlinks() { -+ [[ ! $1 ]] && return 0 -+ -+ local fn="$1" orig="$(readlink -f "$1")" links='' -+ -+ [[ ${fn} =~ .*\.so\..* ]] || return 1 -+ -+ until [[ ${fn##*.} == so ]]; do -+ fn="${fn%.*}" -+ [[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}" -+ done -+ -+ echo ${links} -+} -+ -+# Same as above, but specialized to handle dynamic libraries. -+# It handles making symlinks according to how the original library -+# is referenced. -+inst_library() { -+ local src=$1 dest=${2:-$1} lib reallib symlink -+ [[ -e $initdir$dest ]] && return 0 -+ if [[ -L $src ]]; then -+ reallib=$(readlink -f "$src") -+ lib=${src##*/} -+ inst_simple "$reallib" "$reallib" -+ inst_dir "${dest%/*}" -+ (cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib") -+ else -+ inst_simple "$src" "$dest" -+ fi -+ -+ # Create additional symlinks. See rev_symlinks description. -+ for symlink in $(rev_lib_symlinks $src) $(rev_lib_symlinks $reallib); do -+ [[ ! -e $initdir$symlink ]] && { -+ dinfo "Creating extra symlink: $symlink" -+ inst_symlink $symlink -+ } -+ done -+} -+ -+# find a binary. If we were not passed the full path directly, -+# search in the usual places to find the binary. -+find_binary() { -+ local binpath="/bin /sbin /usr/bin /usr/sbin" p -+ [[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; } -+ for p in $binpath; do -+ [[ -x $p/$1 ]] && { echo "$p/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# Same as above, but specialized to install binary executables. -+# Install binary executable, and all shared library dependencies, if any. -+inst_binary() { -+ local bin target -+ bin=$(find_binary "$1") || return 1 -+ target=${2:-$bin} -+ inst_symlink $bin $target && return 0 -+ local LDSO NAME IO FILE ADDR I1 n f TLIBDIR -+ [[ -e $initdir$target ]] && return 0 -+ # I love bash! -+ LC_ALL=C ldd $bin 2>/dev/null | while read line; do -+ [[ $line = 'not a dynamic executable' ]] && return 1 -+ if [[ $line =~ not\ found ]]; then -+ derror "Missing a shared library required by $bin." -+ derror "Run \"ldd $bin\" to find out what it is." -+ derror "dracut cannot create an initrd." -+ exit 1 -+ fi -+ so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)' -+ [[ $line =~ $so_regex ]] || continue -+ FILE=${BASH_REMATCH[1]} -+ [[ -e ${initdir}$FILE ]] && continue -+ # see if we are loading an optimized version of a shared lib. -+ lib_regex='^(/lib[^/]*).*' -+ if [[ $FILE =~ $lib_regex ]]; then -+ TLIBDIR=${BASH_REMATCH[1]} -+ BASE=${FILE##*/} -+ # prefer nosegneg libs, then unoptimized ones. -+ for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do -+ [[ -e $f/$BASE ]] || continue -+ FILE=$f/$BASE -+ break -+ done -+ inst_library "$FILE" "$TLIBDIR/$BASE" -+ IF_dynamic=yes -+ continue -+ fi -+ inst_library "$FILE" -+ done -+ inst_simple "$bin" "$target" -+} -+ -+# same as above, except for shell scripts. -+# If your shell script does not start with shebang, it is not a shell script. -+inst_script() { -+ [[ -f $1 ]] || return 1 -+ local line -+ read -r -n 80 line <"$1" -+ # If debug is set, clean unprintable chars to prevent messing up the term -+ [[ $debug ]] && line=$(echo -n "$line" | tr -c -d '[:print:][:space:]') -+ shebang_regex='(#! *)(/[^ ]+).*' -+ [[ $line =~ $shebang_regex ]] || return 1 -+ inst "${BASH_REMATCH[2]}" && inst_simple "$@" -+} -+ -+# same as above, but specialized for symlinks -+inst_symlink() { -+ local src=$1 target=$initdir${2:-$1} realsrc -+ [[ -L $1 ]] || return 1 -+ [[ -L $target ]] && return 0 -+ realsrc=$(readlink -f "$src") -+ [[ $realsrc = ${realsrc##*/} ]] && realsrc=${src%/*}/$realsrc -+ inst "$realsrc" && mkdir -p "${target%/*}" && \ -+ ln -s "$realsrc" "$target" -+} -+ -+# find a udev rule in the usual places. -+find_rule() { -+ [[ -f $1 ]] && { echo "$1"; return 0; } -+ for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do -+ [[ -f $r/$1 ]] && { echo "$r/$1"; return 0; } -+ done -+ return 1 -+} -+ -+# udev rules always get installed in the same place, so -+# create a function to install them to make life simpler. -+inst_rules() { -+ local target=/etc/udev/rules.d rule found -+ -+ inst_dir "/lib/udev/rules.d" -+ inst_dir "$target" -+ for rule in "$@"; do -+ found=$(find_rule "$rule") && \ -+ inst_simple "$found" "$target/${found##*/}" \ -+ || dinfo "Skipping udev rule: $rule" -+ done -+} -+ -+# general purpose installation function -+# Same args as above. -+inst() { -+ case $# in -+ 1) ;; -+ 2) [[ ! $initdir && -d $2 ]] && export initdir=$2 -+ [[ $initdir = $2 ]] && set $1;; -+ 3) [[ -z $initdir ]] && export initdir=$2 -+ set $1 $3;; -+ *) derror "inst only takes 1 or 2 or 3 arguments" -+ exit 1;; -+ esac -+ for x in inst_symlink inst_script inst_binary inst_simple; do -+ $x "$@" && return 0 -+ done -+ return 1 -+} -+ -+# install function specialized for hooks -+# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook -+# All hooks should be POSIX/SuS compliant, they will be sourced by init. -+inst_hook() { -+ if ! [[ -f $3 ]]; then -+ derror "Cannot install a hook ($3) that does not exist." -+ derror "Aborting initrd creation." -+ exit 1 -+ elif ! strstr "$hookdirs" "$1"; then -+ derror "No such hook type $1. Aborting initrd creation." -+ exit 1 -+ fi -+ inst_simple "$3" "/${1}/${2}${3##*/}" -+} -+ -+dracut_install() { -+ if [[ $1 = '-o' ]]; then -+ local optional=yes -+ shift -+ fi -+ while (($# > 0)); do -+ if ! inst "$1" ; then -+ if [[ $optional = yes ]]; then -+ dwarning "Skipping program $1 as it cannot be found and is flagged to be optional" -+ else -+ derror "Failed to install $1" -+ exit 1 -+ fi -+ fi -+ shift -+ done -+} -+ -+# install function decompressing the target and handling symlinks -+# $@ = list of compressed (gz or bz2) files or symlinks pointing to such files -+# -+# Function install targets in the same paths inside overlay but decompressed -+# and without extensions (.gz, .bz2). -+inst_decompress() { -+ local src dst realsrc realdst cmd -+ -+ for src in $@ -+ do -+ case ${src} in -+ *.gz) cmd='gzip -d' ;; -+ *.bz2) cmd='bzip2 -d' ;; -+ *) return 1 ;; -+ esac -+ -+ if [[ -L ${src} ]] -+ then -+ realsrc="$(readlink -f ${src})" # symlink target with extension -+ dst="${src%.*}" # symlink without extension -+ realdst="${realsrc%.*}" # symlink target without extension -+ mksubdirs "${initdir}/${src}" -+ # Create symlink without extension to target without extension. -+ ln -s "${realdst}" "${initdir}/${dst}" -+ fi -+ -+ # If the source is symlink we operate on its target. -+ [[ ${realsrc} ]] && src=${realsrc} -+ inst ${src} -+ # Decompress with chosen tool. We assume that tool changes name e.g. -+ # from 'name.gz' to 'name'. -+ ${cmd} "${initdir}${src}" -+ done -+} -+ -+# It's similar to above, but if file is not compressed, performs standard -+# install. -+# $@ = list of files -+inst_opt_decompress() { -+ local src -+ -+ for src in $@ -+ do -+ inst_decompress "${src}" || inst "${src}" -+ done -+} -+ -+module_check() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we are unconditionally included -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check $hostonly -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func check || return 0 -+ check -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_depends() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ # if we do not have a check script, we have no deps -+ [[ -x $moddir/check ]] || return 0 -+ $moddir/check -d -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func depends || return 0 -+ depends -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_install() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/install ]] && . "$moddir/install" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func install || return 0 -+ install -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+module_installkernel() { -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ [[ -d $moddir ]] || return 1 -+ if [[ ! -f $moddir/module-setup.sh ]]; then -+ [[ -x $moddir/installkernel ]] && . "$moddir/installkernel" -+ return $? -+ else -+ unset check depends install installkernel -+ . $moddir/module-setup.sh -+ is_func installkernel || return 0 -+ installkernel -+ ret=$? -+ unset check depends install installkernel -+ return $ret -+ fi -+} -+ -+check_module() { -+ local mod=$1; -+ local moddir=$(echo ${dracutbasedir}/modules.d/??${1}) -+ local moddep; -+ # If we are already scheduled to be loaded, no need to check again. -+ strstr " $mods_to_load " " $mod " && return 0 -+ strstr " $mods_checked_as_dep " " $mod " && return 1 -+ -+ # This should never happen, but... -+ [[ -d $moddir ]] || return 1 -+ -+ [[ $2 ]] || mods_checked_as_dep+=" $mod " -+ -+ strstr " $omit_dracutmodules " " $mod " && return 1 -+ -+ if strstr " $dracutmodules $add_dracutmodules " " $mod "; then -+ module_check $mod; ret=$? -+ # explicit module, so also accept ret=255 -+ [[ $ret = 0 || $ret = 255 ]] || return 1 -+ else -+ # module not in our list -+ if [[ $dracutmodules = all ]]; then -+ # check, if we can and should install this module -+ module_check $mod || return 1 -+ else -+ # skip this module -+ return 1 -+ fi -+ fi -+ -+ for moddep in $(module_depends $mod); do -+ # handle deps as if they were manually added -+ strstr " $add_dracutmodules " " $moddep " || \ -+ add_dracutmodules+=" $moddep " -+ # if a module we depend on fail, fail also -+ check_module $moddep || return 1 -+ done -+ -+ strstr " $mods_to_load " " $mod " || \ -+ mods_to_load+=" $mod " -+ -+ return 0 -+} -+ -+check_module_dir() { -+ local modcheck; -+ local mod; -+ mods_to_load="" -+ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do -+ local mod=${moddir##*/}; mod=${mod#[0-9][0-9]} -+ check_module $mod 1 -+ done -+} -+ -+# Install a single kernel module along with any firmware it may require. -+# $1 = full path to kernel module to install -+install_kmod_with_fw() { -+ local modname=${1##*/} fwdir found -+ modname=${modname%.ko*} -+ inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \ -+ return 0 # no need to go further if the module is already installed -+ for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do -+ found='' -+ for fwdir in $fw_dir; do -+ if [[ -d $fwdir && -f $fwdir/$fw ]]; then -+ inst_simple "$fwdir/$fw" "/lib/firmware/$fw" -+ found=yes -+ fi -+ done -+ if [[ $found != yes ]]; then -+ dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\"" -+ fi -+ done -+} -+ -+# Do something with all the dependencies of a kernel module. -+# Note that kernel modules depend on themselves using the technique we use -+# $1 = function to call for each dependency we find -+# It will be passed the full path to the found kernel module -+# $2 = module to get dependencies for -+# rest of args = arguments to modprobe -+for_each_kmod_dep() { -+ local func=$1 kmod=$2 cmd modpapth options -+ shift 2 -+ modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \ -+ while read cmd modpath options; do -+ [[ $cmd = insmod ]] || continue -+ $func $modpath -+ done -+} -+ -+# filter kernel modules to install certain modules that meet specific -+# requirements. -+# $1 = function to call with module name to filter. -+# This function will be passed the full path to the module to test. -+# The behaviour of this function can vary depending on whether $hostonly is set. -+# If it is, we will only look at modules that are already in memory. -+# If it is not, we will look at all kernel modules -+# This function returns the full filenames of modules that match $1 -+filter_kernel_modules () ( -+ if ! [[ $hostonly ]]; then -+ filtercmd='find "$srcmods/kernel/drivers" "$srcmods/extra" "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz" 2>/dev/null' -+ else -+ filtercmd='cut -d " " -f 1 /dev/null' -+ fi -+ for modname in $(eval $filtercmd); do -+ case $modname in -+ *.ko) "$1" "$modname" && echo "$modname";; -+ *.ko.gz) gzip -dc "$modname" > $initdir/$$.ko -+ $1 $initdir/$$.ko && echo "$modname" -+ rm -f $initdir/$$.ko;; -+ esac -+ done -+) -+ -+# install kernel modules along with all their dependencies. -+instmods() { -+ [[ $no_kernel = yes ]] && return -+ local mod mpargs modpath modname cmd moddirname -+ while (($# > 0)); do -+ mod=${1%.ko*} -+ case $mod in -+ =*) -+ # This introduces 2 incompatible meanings for =* arguments -+ # to instmods. We need to decide which one to keep. -+ if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then -+ instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block") -+ elif [ -f $srcmods/modules.${mod#=} ]; then -+ instmods $mpargs $(cat ${srcmods}/modules.${mod#=} ) -+ else -+ instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*") -+ fi -+ ;; -+ --*) -+ mod=${mod##*/} -+ mpargs+=" $mod";; -+ i2o_scsi) shift; continue;; # Do not load this diagnostic-only module -+ *) mod=${mod##*/} -+ # if we are already installed, skip this module and go on -+ # to the next one. -+ [[ -f $initdir/$1 ]] && { shift; continue; } -+ # If we are building a host-specific initramfs and this -+ # module is not already loaded, move on to the next one. -+ [[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \ -+ ! echo $add_drivers | grep -qe "\<${mod}\>" && { -+ shift; continue; -+ } -+ -+ # We use '-d' option in modprobe only if modules prefix path -+ # differs from default '/'. This allows us to use Dracut with -+ # old version of modprobe which doesn't have '-d' option. -+ moddirname=${srcmods%%/lib/modules/*} -+ [[ -n ${moddirname} ]] && moddirname="-d ${moddirname}/" -+ -+ # ok, load the module, all its dependencies, and any firmware -+ # it may require -+ for_each_kmod_dep install_kmod_with_fw $mod \ -+ --set-version $kernel ${moddirname} -+ ;; -+ esac -+ shift -+ done -+} -diff --git gen_cmdline.sh gen_cmdline.sh -index b3e451d..bc9f2dc 100755 ---- gen_cmdline.sh -+++ gen_cmdline.sh -@@ -22,6 +22,7 @@ longusage() { - echo " --logfile= Output file for debug info" - echo " --color Output debug in color" - echo " --no-color Do not output debug in color" -+ echo " --no-cleartmp Do not clear temp directory" - echo " Kernel Configuration settings" - echo " --menuconfig Run menuconfig after oldconfig" - echo " --no-menuconfig Do not run menuconfig after oldconfig" -@@ -78,6 +79,8 @@ longusage() { - echo " --splash-res= Select splash theme resolutions to install" - echo " --do-keymap-auto Forces keymap selection at boot" - echo " --no-keymap Disables keymap selection support" -+ echo " --udev Include udev in the initramfs" -+ echo " --no-udev Exclude udev from the initramfs" - echo " --lvm Include LVM support" - echo " --mdadm Include MDADM/MDMON support" - echo " --mdadm-config= Use file as mdadm.conf in initramfs" -@@ -97,6 +100,8 @@ longusage() { - echo " --unionfs Include support for unionfs" - echo " --netboot Create a self-contained env in the initramfs" - echo " --real-root= Specify a default for real_root=" -+ echo " --lscpi Include lspci into the initramfs" -+ echo " --no-lscpi Exclude lspci from the initramfs" - echo " Internals" - echo " --arch-override= Force to arch instead of autodetect" - echo " --cachedir= Override the default cache location" -@@ -232,6 +237,22 @@ parse_cmdline() { - CMD_KEYMAP=0 - print_info 2 "CMD_KEYMAP: ${CMD_KEYMAP}" - ;; -+ --udev) -+ CMD_UDEV=1 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --no-udev) -+ CMD_UDEV=0 -+ print_info 2 "CMD_UDEV: ${CMD_UDEV}" -+ ;; -+ --lspci) -+ CMD_LSPCI=1 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; -+ --no-lspci) -+ CMD_UDEV=0 -+ print_info 2 "CMD_LSPCI: ${CMD_LSPCI}" -+ ;; - --lvm) - CMD_LVM=1 - print_info 2 "CMD_LVM: ${CMD_LVM}" -@@ -441,6 +462,10 @@ parse_cmdline() { - print_info 2 "USECOLOR: ${USECOLOR}" - setColorVars - ;; -+ --no-cleartmp) -+ NOCLEARTMP=1 -+ print_info 2 "NOCLEARTMP: ${NOCLEARTMP}" -+ ;; - --logfile=*) - CMD_LOGFILE=`parse_opt "$*"` - LOGFILE=`parse_opt "$*"` -diff --git gen_compile.sh gen_compile.sh -index 0758c3a..8a2339a 100755 ---- gen_compile.sh -+++ gen_compile.sh -@@ -407,7 +407,10 @@ compile_busybox() { - yes '' 2>/dev/null | compile_generic oldconfig utils - - print_info 1 'busybox: >> Compiling...' -+ OLDLOGLEVEL=$LOGLEVEL -+ LOGLEVEL=1 - compile_generic all utils -+ LOGLEVEL=$OLDLOGLEVEL - print_info 1 'busybox: >> Copying to cache...' - [ -f "${TEMP}/${BUSYBOX_DIR}/busybox" ] || - gen_die 'Busybox executable does not exist!' -diff --git gen_determineargs.sh gen_determineargs.sh -index ce479cb..bda14b8 100755 ---- gen_determineargs.sh -+++ gen_determineargs.sh -@@ -107,6 +107,8 @@ determine_real_args() { - set_config_with_override BOOL SYMLINK CMD_SYMLINK - set_config_with_override STRING INSTALL_MOD_PATH CMD_INSTALL_MOD_PATH - set_config_with_override BOOL OLDCONFIG CMD_OLDCONFIG -+ set_config_with_override BOOL UDEV CMD_UDEV -+ set_config_with_override BOOL LSPCI CMD_LSPCI - set_config_with_override BOOL LVM CMD_LVM - set_config_with_override BOOL DMRAID CMD_DMRAID - set_config_with_override BOOL ISCSI CMD_ISCSI -diff --git gen_initramfs.sh gen_initramfs.sh -index 7fe4421..cfd406b 100755 ---- gen_initramfs.sh -+++ gen_initramfs.sh -@@ -56,7 +56,13 @@ append_busybox() { - chmod +x "${TEMP}/initramfs-busybox-temp/usr/share/udhcpc/default.script" - - # Set up a few default symlinks -- for i in ${BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}; do -+ if isTrue "${UDEV}" -+ then -+ BUSYBOX_APPLETS="${BUSYBOX_APPLETS:-[ ash sh uname echo cut cat}" -+ else -+ BUSYBOX_APPLETS="{$BUSYBOX_APPLETS:-[ ash sh mount uname echo cut cat}" -+ fi -+ for i in ${BUSYBOX_APPLETS}; do - rm -f ${TEMP}/initramfs-busybox-temp/bin/$i > /dev/null - ln -s busybox ${TEMP}/initramfs-busybox-temp/bin/$i || - gen_die "Busybox error: could not link ${i}!" -@@ -410,7 +416,7 @@ append_firmware() { - IFS="," - for i in ${FIRMWARE_FILES} - do -- cp -L "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ -+ cp -rL "${i}" ${TEMP}/initramfs-firmware-temp/lib/firmware/ - done - IFS=$OLD_IFS - else -@@ -438,9 +444,66 @@ append_gpg() { - chmod a+x "${TEMP}/initramfs-gpg-temp/sbin/gpg" - cd "${TEMP}/initramfs-gpg-temp/" - find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" - rm -rf "${TEMP}/initramfs-gpg-temp" > /dev/null - } - -+append_udev() { -+ if [ -d "${TEMP}/initramfs-udev-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-udev-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-udev-temp/" -+ udevmod="${GK_SHARE}/modules/udev-rules/" -+ source ${udevmod}/module-setup.sh -+ initdir=${TEMP}/initramfs-udev-temp \ -+ moddir=${udevmod} \ -+ libdir=/lib/ \ -+ usrlibdir=/usr/lib/ \ -+ install_module -+ -+ if isTrue $LSPCI -+ then -+ initdir=${TEMP}/initramfs-udev-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ fi -+ # find net modules and sound -+ ((find ${INSTALL_MOD_PATH}/lib/modules/${KV}/net -name "*.ko"; -+ find ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/net -name "*.ko"; -+ find ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/drivers/net -name "*.ko"; -+ find ${INSTALL_MOD_PATH}/lib/modules/${KV}/kernel/sound -name "*.ko") | -+ # add them prefix blacklist -+ while read module;do -+ echo "blacklist `basename $module .ko`"; -+ # concat with ready blacklist.conf -+ done;cat "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf") | -+ # sort and rewrite blacklist.conf -+ sort | uniq > "${TEMP}/initramfs-udev-temp/etc/modprobe.d/blacklist.conf" -+ -+ cd "${TEMP}/initramfs-udev-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-udev-temp" > /dev/null -+} -+ -+append_lspci() { -+ if [ -d "${TEMP}/initramfs-lspci-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-lspci-temp" -+ fi -+ cd ${TEMP} -+ mkdir -p "${TEMP}/initramfs-lspci-temp/" -+ -+ initdir=${TEMP}/initramfs-lspci-temp \ -+ dracut_install /usr/sbin/lspci /usr/share/misc/pci.ids -+ -+ cd "${TEMP}/initramfs-lspci-temp/" -+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-lspci-temp" > /dev/null -+} -+ - print_list() - { - local x -@@ -489,6 +552,11 @@ append_modules() { - print_list ${!group_modules} > "${TEMP}/initramfs-modules-${KV}-temp/etc/modules/${group}" - done - cd "${TEMP}/initramfs-modules-${KV}-temp/" -+ # remove sound and media -+ for x in `find . -type d -name media -o -type d -name sound` -+ do -+ rm -r "${x}" &>/dev/null -+ done - find . | cpio ${CPIO_ARGS} --append -F "${CPIO}" \ - || gen_die "compressing modules cpio" - cd "${TEMP}" -@@ -561,11 +629,14 @@ append_auxilary() { - done - echo '"' >> "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" - -- if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ if ! isTrue "${UDEV}" - then -- cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -- else -- cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ if [ -f "${GK_SHARE}/arch/${ARCH}/modprobe" ] -+ then -+ cp "${GK_SHARE}/arch/${ARCH}/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ else -+ cp "${GK_SHARE}/defaults/modprobe" "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ fi - fi - if isTrue $CMD_DOKEYMAPAUTO - then -@@ -582,7 +653,7 @@ append_auxilary() { - chmod +x "${TEMP}/initramfs-aux-temp/init" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.scripts" - chmod +x "${TEMP}/initramfs-aux-temp/etc/initrd.defaults" -- chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" -+ isTrue "${UDEV}" || chmod +x "${TEMP}/initramfs-aux-temp/sbin/modprobe" - - if isTrue ${NETBOOT} - then -@@ -609,6 +680,21 @@ append_data() { - fi - } - -+pack_cpio() { -+ print_info 1 " >> Pack cpio data..." -+ if [ -d "${TEMP}/initramfs-repack-temp" ] -+ then -+ rm -r "${TEMP}/initramfs-repack-temp" -+ fi -+ mkdir -p "${TEMP}/initramfs-repack-temp" -+ cd "${TEMP}/initramfs-repack-temp" -+ # unpack and pack cpio remove double files -+ cpio -di <${CPIO} 2>/dev/null -+ find . -print | cpio ${CPIO_ARGS} | gzip -9 >"${CPIO}" -+ cd "${TEMP}" -+ rm -rf "${TEMP}/initramfs-repack-temp" > /dev/null -+} -+ - create_initramfs() { - print_info 1 "initramfs: >> Initializing..." - -@@ -619,6 +705,11 @@ create_initramfs() { - - append_data 'base_layout' - append_data 'auxilary' "${BUSYBOX}" -+ append_data 'udev' "${UDEV}" -+ if ! isTrue "${UDEV}" -+ then -+ append_data 'lspci' "${LSPCI}" -+ fi - append_data 'busybox' "${BUSYBOX}" - append_data 'lvm' "${LVM}" - append_data 'dmraid' "${DMRAID}" -@@ -652,8 +743,7 @@ create_initramfs() { - append_data 'overlay' - fi - -- gzip -9 "${CPIO}" -- mv -f "${CPIO}.gz" "${CPIO}" -+ pack_cpio - - if isTrue "${INTEGRATED_INITRAMFS}" - then -diff --git genkernel genkernel -index 0a06cdd..1486c61 100755 ---- genkernel -+++ genkernel -@@ -9,6 +9,7 @@ GK_V='3.4.18' - TMPDIR='/var/tmp/genkernel' - - TODEBUGCACHE=1 # Until an error occurs or LOGFILE is fully qualified. -+NOCLEARTMP=0 - - small_die() { - echo $1 -@@ -45,6 +46,7 @@ source ${GK_SHARE}/gen_initramfs.sh || gen_die "Could not read ${GK_SHARE}/gen_i - source ${GK_SHARE}/gen_moddeps.sh || gen_die "Could not read ${GK_SHARE}/gen_moddeps.sh" - source ${GK_SHARE}/gen_package.sh || gen_die "Could not read ${GK_SHARE}/gen_package.sh" - source ${GK_SHARE}/gen_bootloader.sh || gen_die "Could not read ${GK_SHARE}/gen_bootloader.sh" -+source ${GK_SHARE}/dracut_funcs.sh || gen_die "Could not read ${GK_SHARE}/dracut_funcs.sh" - - TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ - -@@ -55,21 +57,25 @@ trap_cleanup(){ - } - - cleanup(){ -- if [ -n "$TEMP" -a -d "$TEMP" ]; then -- rm -rf "$TEMP" -- fi -- -- if isTrue ${POSTCLEAR} -- then -- echo -- print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -- print_info 1 "CACHE_DIR: ${CACHE_DIR}" -- CLEAR_CACHE_DIR='yes' -- setup_cache_dir -- echo -- print_info 1 "TMPDIR: ${TMPDIR}" -- clear_tmpdir -- fi -+ if [[ ${NOCLEARTMP} -ne 0 ]] -+ then -+ return -+ fi -+ if [ -n "$TEMP" -a -d "$TEMP" ]; then -+ rm -rf "$TEMP" &>/dev/null -+ fi -+ -+ if isTrue ${POSTCLEAR} -+ then -+ echo -+ print_info 1 'RUNNING FINAL CACHE/TMP CLEANUP' -+ print_info 1 "CACHE_DIR: ${CACHE_DIR}" -+ CLEAR_CACHE_DIR='yes' -+ setup_cache_dir -+ echo -+ print_info 1 "TMPDIR: ${TMPDIR}" -+ clear_tmpdir -+ fi - } - - trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL -diff --git genkernel.conf genkernel.conf -index 24fcd54..41f8e06 100644 ---- genkernel.conf -+++ genkernel.conf -@@ -52,6 +52,12 @@ USECOLOR="yes" - # argument is: *+1 - # MAKEOPTS="-j2" - -+# Add udev to initramfs -+UDEV="yes" -+ -+# Add lspci to initramfs -+LSPCI="yes" -+ - # Add in LVM support from static binaries if they exist on the system, or - # compile static LVM binaries if static ones do not exist. - # LVM="no" -@@ -92,7 +98,7 @@ USECOLOR="yes" - # Specify directory to pull from - # FIRMWARE_DIR="/lib/firmware" - # Specify specific firmware files to include. This overrides FIRMWARE_DIR --# FIRMWARE_FILES="" -+FIRMWARE_FILES="/lib/firmware/radeon" - - # Enable disklabel support (copies blkid to initrd) - DISKLABEL="yes" -diff --git modules/udev-rules/01-ignore.rules modules/udev-rules/01-ignore.rules -new file mode 100644 -index 0000000..b32f22e ---- /dev/null -+++ modules/udev-rules/01-ignore.rules -@@ -0,0 +1 @@ -+KERNEL=="ram[0-9]*", OPTIONS+="ignore_device", OPTIONS+="last_rule" -diff --git modules/udev-rules/59-persistent-storage-volid.rules modules/udev-rules/59-persistent-storage-volid.rules -new file mode 100644 -index 0000000..0b798e6 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage-volid.rules -@@ -0,0 +1,7 @@ -+SUBSYSTEM!="block", GOTO="psv_end" -+ACTION!="add|change", GOTO="psv_end" -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="cciss[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="vol_id --export $tempnode" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", IMPORT{program}="vol_id --export $tempnode" -+LABEL="psv_end" -diff --git modules/udev-rules/59-persistent-storage.rules modules/udev-rules/59-persistent-storage.rules -new file mode 100644 -index 0000000..2b83e72 ---- /dev/null -+++ modules/udev-rules/59-persistent-storage.rules -@@ -0,0 +1,38 @@ -+SUBSYSTEM!="block", GOTO="ps_end" -+ACTION!="add|change", GOTO="ps_end" -+ -+KERNEL=="cciss[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+KERNEL=="nbd[0-9]*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end" -+ -+# partitions have no md/{array_state,metadata_version} -+ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" -+ -+# container devices have a metadata version of e.g. 'external:ddf' and -+# never leave state 'inactive' -+ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -+TEST!="md/array_state", GOTO="md_end" -+ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -+ -+LABEL="md_ignore_state" -+ -+IMPORT{program}="/sbin/mdadm --detail --export $tempnode" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+OPTIONS+="link_priority=100" -+OPTIONS+="watch" -+LABEL="md_end" -+ -+ -+KERNEL!="dm-[0-9]*", GOTO="ps_end" -+ACTION=="add", GOTO="ps_end" -+IMPORT{program}="/sbin/dmsetup info -c --nameprefixes --unquoted --rows --noheadings -o name,uuid,suspended,readonly,major,minor,open,tables_loaded,names_using_dev -j%M -m%m" -+ENV{DM_NAME}!="?*", GOTO="ps_end" -+ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="ps_end" -+ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="ps_end" -+ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="ps_end" -+IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -+ -+ -+LABEL="ps_end" -diff --git modules/udev-rules/61-persistent-storage.rules modules/udev-rules/61-persistent-storage.rules -new file mode 100644 -index 0000000..9cfdb0b ---- /dev/null -+++ modules/udev-rules/61-persistent-storage.rules -@@ -0,0 +1,20 @@ -+SUBSYSTEM!="block", GOTO="pss_end" -+ACTION!="add|change", GOTO="pss_end" -+ -+ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss" -+KERNEL=="cciss[0-9]*", GOTO="do_pss" -+KERNEL=="nbd[0-9]*", GOTO="do_pss" -+KERNEL=="md[0-9]*|md_d[0-9]*|md/*", GOTO="do_pss" -+ -+GOTO="pss_end" -+ -+LABEL="do_pss" -+# by-path (parent device path) -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{program}="path_id %p" -+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" -+ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" -+ -+# by-label/by-uuid links (filesystem metadata) -+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" -+LABEL="pss_end" -diff --git modules/udev-rules/blacklist.conf modules/udev-rules/blacklist.conf -new file mode 100644 -index 0000000..21ac71c ---- /dev/null -+++ modules/udev-rules/blacklist.conf -@@ -0,0 +1,162 @@ -+blacklist ath_pci -+blacklist evbug -+blacklist usbmouse -+blacklist usbkbd -+blacklist eepro100 -+blacklist de4x5 -+blacklist eth1394 -+blacklist snd_intel8x0m -+blacklist snd_aw2 -+blacklist i2c_i801 -+blacklist prism54 -+blacklist bcm43xx -+blacklist garmin_gps -+blacklist asus_acpi -+blacklist snd_pcsp -+blacklist pcspkr -+blacklist amd76x_edac -+blacklist ohci1394 -+blacklist sbp2 -+blacklist dv1394 -+blacklist raw1394 -+blacklist video1394 -+blacklist aty128fb -+blacklist atyfb -+blacklist radeonfb -+blacklist cirrusfb -+blacklist cyber2000fb -+blacklist cyblafb -+blacklist gx1fb -+blacklist hgafb -+blacklist i810fb -+blacklist intelfb -+blacklist kyrofb -+blacklist lxfb -+blacklist matroxfb_base -+blacklist neofb -+blacklist nvidiafb -+blacklist pm2fb -+blacklist rivafb -+blacklist s1d13xxxfb -+blacklist savagefb -+blacklist sisfb -+blacklist sstfb -+blacklist tdfxfb -+blacklist tridentfb -+blacklist vesafb -+blacklist vfb -+blacklist viafb -+blacklist vt8623fb -+blacklist ac97 -+blacklist ac97_codec -+blacklist ac97_plugin_ad1980 -+blacklist ad1848 -+blacklist ad1889 -+blacklist adlib_card -+blacklist aedsp16 -+blacklist ali5455 -+blacklist btaudio -+blacklist cmpci -+blacklist cs4232 -+blacklist cs4281 -+blacklist cs461x -+blacklist cs46xx -+blacklist emu10k1 -+blacklist es1370 -+blacklist es1371 -+blacklist esssolo1 -+blacklist forte -+blacklist gus -+blacklist i810_audio -+blacklist kahlua -+blacklist mad16 -+blacklist maestro -+blacklist maestro3 -+blacklist maui -+blacklist mpu401 -+blacklist nm256_audio -+blacklist opl3 -+blacklist opl3sa -+blacklist opl3sa2 -+blacklist pas2 -+blacklist pss -+blacklist rme96xx -+blacklist sb -+blacklist sb_lib -+blacklist sgalaxy -+blacklist sonicvibes -+blacklist sound -+blacklist sscape -+blacklist trident -+blacklist trix -+blacklist uart401 -+blacklist uart6850 -+blacklist via82cxxx_audio -+blacklist v_midi -+blacklist wavefront -+blacklist ymfpci -+blacklist ac97_plugin_wm97xx -+blacklist ad1816 -+blacklist audio -+blacklist awe_wave -+blacklist dmasound_core -+blacklist dmasound_pmac -+blacklist harmony -+blacklist sequencer -+blacklist soundcard -+blacklist usb-midi -+blacklist acquirewdt -+blacklist advantechwdt -+blacklist alim1535_wdt -+blacklist alim7101_wdt -+blacklist booke_wdt -+blacklist cpu5wdt -+blacklist eurotechwdt -+blacklist i6300esb -+blacklist i8xx_tco -+blacklist ib700wdt -+blacklist ibmasr -+blacklist indydog -+blacklist iTCO_wdt -+blacklist it8712f_wdt -+blacklist it87_wdt -+blacklist ixp2000_wdt -+blacklist ixp4xx_wdt -+blacklist machzwd -+blacklist mixcomwd -+blacklist mpc8xx_wdt -+blacklist mpcore_wdt -+blacklist mv64x60_wdt -+blacklist pc87413_wdt -+blacklist pcwd -+blacklist pcwd_pci -+blacklist pcwd_usb -+blacklist s3c2410_wdt -+blacklist sa1100_wdt -+blacklist sbc60xxwdt -+blacklist sbc7240_wdt -+blacklist sb8360 -+blacklist sc1200wdt -+blacklist sc520_wdt -+blacklist sch311_wdt -+blacklist scx200_wdt -+blacklist shwdt -+blacklist smsc37b787_wdt -+blacklist softdog -+blacklist twl4030_wdt -+blacklist w83627hf_wdt -+blacklist w83697hf_wdt -+blacklist w83697ug_wdt -+blacklist w83877f_wdt -+blacklist w83977f_wdt -+blacklist wafer5823wdt -+blacklist wdt -+blacklist wdt_pci -+blacklist wm8350_wdt -+# Not using kernel video drivers -+blacklist nvidia -+blacklist radeon -+blacklist nouveau -+blacklist i915 -+blacklist uvesafb -+blacklist fglrx -diff --git modules/udev-rules/load-modules.sh modules/udev-rules/load-modules.sh -new file mode 100755 -index 0000000..36972fd ---- /dev/null -+++ modules/udev-rules/load-modules.sh -@@ -0,0 +1,7 @@ -+#!/bin/sh -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+# Implement blacklisting for udev-loaded modules -+ -+modprobe -b "$@" -diff --git modules/udev-rules/module-setup.sh modules/udev-rules/module-setup.sh -new file mode 100755 -index 0000000..1005627 ---- /dev/null -+++ modules/udev-rules/module-setup.sh -@@ -0,0 +1,57 @@ -+#!/bin/bash -+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -+# ex: ts=8 sw=4 sts=4 et filetype=sh -+ -+install_module() { -+ # FIXME: would be nice if we didn't have to know which rules to grab.... -+ # ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies -+ # of the rules we want so that we just copy those in would be best -+ dracut_install udevd udevadm /etc/udev/udev.conf /etc/group /bin/mount /sbin/modprobe -+ inst_rules 50-udev-default.rules 60-persistent-storage.rules \ -+ 61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \ -+ 60-pcmcia.rules -+ mkdir -p "$initdir"/etc/modprobe.d -+ inst_simple "$moddir/blacklist.conf" /etc/modprobe.d/ -+ -+ # ignore some devices in the initrd -+ inst_rules "$moddir/01-ignore.rules" -+ -+ # for firmware loading -+ inst_rules 50-firmware.rules -+ -+ if [ ! -x /lib/udev/vol_id ]; then -+ inst_rules "$moddir/59-persistent-storage.rules" -+ else -+ inst_rules "$moddir/59-persistent-storage-volid.rules" -+ fi -+ inst_rules "$moddir/61-persistent-storage.rules" -+ -+ for i in \ -+ ata_id \ -+ cdrom_id \ -+ create_floppy_devices \ -+ edd_id \ -+ firmware.sh \ -+ firmware \ -+ firmware.agent \ -+ hotplug.functions \ -+ fw_unit_symlinks.sh \ -+ hid2hci \ -+ path_id \ -+ scsi_id \ -+ usb_id \ -+ vol_id \ -+ pcmcia-socket-startup \ -+ pcmcia-check-broken-cis \ -+ ; do -+ for utilpath in /lib/udev /sbin /bin -+ do -+ [ -e $utilpath/$i ] && dracut_install $utilpath/$i -+ done -+ done -+ -+ for i in {"$libdir","$usrlibdir"}/libnss_files*; do -+ [ -e "$i" ] && dracut_install "$i" -+ done -+} -+