Compare commits
787 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
59a232ddcd | ||
![]() |
01816f2bb1 | ||
![]() |
0d86614794 | ||
![]() |
8821f4109e | ||
![]() |
783721b34b | ||
![]() |
f6c76abe8e | ||
![]() |
41bad60c82 | ||
![]() |
9c7f67a94d | ||
![]() |
26df1299cb | ||
![]() |
1f03abefad | ||
![]() |
f2db681002 | ||
![]() |
5bb59e428f | ||
![]() |
a1ef436531 | ||
![]() |
c865ecbf32 | ||
![]() |
2576bec68f | ||
![]() |
7c1796860f | ||
![]() |
d350ae6966 | ||
![]() |
9b3d462b68 | ||
![]() |
5150d44a7e | ||
![]() |
30cd3616e9 | ||
![]() |
609d00c467 | ||
![]() |
27e15000d0 | ||
![]() |
029f2691f8 | ||
![]() |
0493f9c849 | ||
![]() |
3eccdb5289 | ||
![]() |
17cb0e3fe8 | ||
![]() |
cdc8d9c403 | ||
![]() |
719cc30626 | ||
![]() |
0ca3a5ee84 | ||
![]() |
62f8a2b63c | ||
![]() |
a0342347e9 | ||
![]() |
076bab08c1 | ||
![]() |
578c24a473 | ||
![]() |
c492fe12c0 | ||
![]() |
e0c1d4e79f | ||
![]() |
0b2ddf8f69 | ||
![]() |
80a18b8bef | ||
![]() |
3a4d0c9c14 | ||
![]() |
3122e93350 | ||
![]() |
21a7b84486 | ||
![]() |
4b0a61c586 | ||
![]() |
cc97412c32 | ||
![]() |
aceaf13b44 | ||
![]() |
d7cc3f2ef5 | ||
![]() |
db3641a2ea | ||
![]() |
8e102a2487 | ||
![]() |
4c2d8f5816 | ||
![]() |
d6351b36b8 | ||
![]() |
d752c51b90 | ||
![]() |
f007e84e8e | ||
![]() |
9c111e59c9 | ||
![]() |
4754226a1a | ||
![]() |
606852a4a6 | ||
![]() |
8220945b2c | ||
![]() |
6292ee9d18 | ||
![]() |
dd2c34a82b | ||
![]() |
1246703bb4 | ||
![]() |
d2a535855b | ||
![]() |
ddd109bdf9 | ||
![]() |
3f62b2637c | ||
![]() |
08852c50b9 | ||
![]() |
bb7645459e | ||
![]() |
e5c6cb2a8c | ||
![]() |
3272ed884f | ||
![]() |
3ad4f77cef | ||
![]() |
e001359311 | ||
![]() |
dcdca91d91 | ||
![]() |
6baa63110e | ||
![]() |
93ad8c19bb | ||
![]() |
2926b5b35d | ||
![]() |
76514565c0 | ||
![]() |
bd324b9d94 | ||
![]() |
a10a1416c1 | ||
![]() |
e13918d24a | ||
![]() |
466f36159d | ||
![]() |
2245f3723b | ||
![]() |
dde97b301f | ||
![]() |
6f9d69c95a | ||
![]() |
adde3a7a27 | ||
![]() |
ed61aae141 | ||
![]() |
26257a5cf4 | ||
![]() |
0e1d2c3efa | ||
![]() |
b8a2f174d7 | ||
![]() |
e9ef52b460 | ||
![]() |
3a4989cae2 | ||
![]() |
ecee64bffa | ||
![]() |
540eb97162 | ||
![]() |
013986a8ad | ||
![]() |
a0af4fa5ea | ||
![]() |
5cae1fe179 | ||
![]() |
91bb250aed | ||
![]() |
40d69001ac | ||
![]() |
06f91665df | ||
![]() |
8442b51e20 | ||
![]() |
e9a9c8bb7e | ||
![]() |
847b618b4c | ||
![]() |
fd2312e03d | ||
![]() |
5f70a1bd06 | ||
![]() |
876bd1a2be | ||
![]() |
87122afcda | ||
![]() |
78cd3b9824 | ||
![]() |
185468f57d | ||
![]() |
45b5a4e142 | ||
![]() |
e4ebd474ec | ||
![]() |
ae5ec68355 | ||
![]() |
95c1941ce5 | ||
![]() |
59a083d8d1 | ||
![]() |
be217dc4d4 | ||
![]() |
e8e4b28dfa | ||
![]() |
1c894acb42 | ||
![]() |
7d86d90d11 | ||
![]() |
532b8c7a43 | ||
![]() |
22ecea456b | ||
![]() |
5f927f201d | ||
![]() |
b48d98dda3 | ||
![]() |
4eab305062 | ||
![]() |
edcd2c5eb7 | ||
![]() |
2c24ee9a72 | ||
![]() |
169f167151 | ||
![]() |
08e10f05f6 | ||
![]() |
bd987e3036 | ||
![]() |
be0921a413 | ||
![]() |
f01d965f0e | ||
![]() |
ecf42850c3 | ||
![]() |
2974f382f8 | ||
![]() |
6a4f980921 | ||
![]() |
5a4bbf1bda | ||
![]() |
123e24a3b5 | ||
![]() |
dcdf5c8801 | ||
![]() |
ed8c7bf5c2 | ||
![]() |
70503db416 | ||
![]() |
a2929f90ff | ||
![]() |
9cdde06d50 | ||
![]() |
b6a7c09070 | ||
![]() |
680ac04370 | ||
![]() |
e54a84113e | ||
![]() |
91d8394093 | ||
![]() |
e02c2d5c43 | ||
![]() |
7c0aa2a2ea | ||
![]() |
9ab1426534 | ||
![]() |
647035f9aa | ||
![]() |
a3afcf2a5a | ||
![]() |
7e33fa5b52 | ||
![]() |
d0ced35fc6 | ||
![]() |
a8ca68a91e | ||
![]() |
5be225d299 | ||
![]() |
a8a103e093 | ||
![]() |
d7a272a95e | ||
![]() |
c198a4bc8c | ||
![]() |
13289be133 | ||
![]() |
3df3a99759 | ||
![]() |
270ba358fa | ||
![]() |
d87c2708ec | ||
![]() |
d8b9844c61 | ||
![]() |
1d323cd938 | ||
![]() |
8f74a60ced | ||
![]() |
127fb81754 | ||
![]() |
ebcfda6c61 | ||
![]() |
bdcb63b0e6 | ||
![]() |
8f4c066020 | ||
![]() |
1fca65c576 | ||
![]() |
da4e644327 | ||
![]() |
c5ef4b63a3 | ||
![]() |
6c980807d0 | ||
![]() |
97add1b383 | ||
![]() |
3de984ba7f | ||
![]() |
85fd75f91f | ||
![]() |
0c88742669 | ||
![]() |
709302e3cc | ||
![]() |
3e96d7aa33 | ||
![]() |
3409c2377f | ||
![]() |
4058d85cb6 | ||
![]() |
2937028c54 | ||
![]() |
56f184310a | ||
![]() |
1d149cd039 | ||
![]() |
dafa4f621f | ||
![]() |
0679a6d24e | ||
![]() |
8ded2a65c0 | ||
![]() |
400723054c | ||
![]() |
7f00669875 | ||
![]() |
c91570782c | ||
![]() |
fede5bbcda | ||
![]() |
e9e93e2ec6 | ||
![]() |
d4abad2288 | ||
![]() |
ddbdebb9c8 | ||
![]() |
4828beb949 | ||
![]() |
9b17b085f3 | ||
![]() |
d293133982 | ||
![]() |
cd83e4c54d | ||
![]() |
fbf1b5b138 | ||
![]() |
58ffd15bff | ||
![]() |
0e0bf83057 | ||
![]() |
d693f34afb | ||
![]() |
d1bae3cd17 | ||
![]() |
7ea25f3a34 | ||
![]() |
e876763655 | ||
![]() |
ab56546dc7 | ||
![]() |
3592d8683b | ||
![]() |
c55b20803a | ||
![]() |
7095aab4a2 | ||
![]() |
8ef5ade737 | ||
![]() |
b3561ee15f | ||
![]() |
16b046d5da | ||
![]() |
37b14e7295 | ||
![]() |
f6458b80ef | ||
![]() |
3b0f71921d | ||
![]() |
df54ef1390 | ||
![]() |
16add2aac7 | ||
![]() |
501cc2458c | ||
![]() |
ee7eb10523 | ||
![]() |
232c082cbc | ||
![]() |
58659bf221 | ||
![]() |
8a08012764 | ||
![]() |
fdc421dbac | ||
![]() |
70aaa95d52 | ||
![]() |
80a6943fc4 | ||
![]() |
72011255e0 | ||
![]() |
de50046cd7 | ||
![]() |
e606012ce6 | ||
![]() |
b63fd4d905 | ||
![]() |
01b8cdffca | ||
![]() |
aab70adc0b | ||
![]() |
7baade2b87 | ||
![]() |
b686095f99 | ||
![]() |
a56e93c10c | ||
![]() |
465f223905 | ||
![]() |
3121677949 | ||
![]() |
a65914b4a2 | ||
![]() |
cff621603c | ||
![]() |
259872feac | ||
![]() |
43f2533977 | ||
![]() |
454771cd86 | ||
![]() |
0ec519f8a4 | ||
![]() |
d793fc2e8b | ||
![]() |
26999d6ddb | ||
![]() |
9232cab470 | ||
![]() |
a15935c143 | ||
![]() |
11ce36d78e | ||
![]() |
4819ae98ac | ||
![]() |
8c8cd69d32 | ||
![]() |
7800cc247e | ||
![]() |
21a74b32b2 | ||
![]() |
1cf0b1750b | ||
![]() |
94d2148707 | ||
![]() |
2c2c45800c | ||
![]() |
edb511860c | ||
![]() |
a39ea24f10 | ||
![]() |
93bc3d440c | ||
![]() |
7e22ab0891 | ||
![]() |
c98bcec89c | ||
![]() |
b456ab777d | ||
![]() |
d43036ffeb | ||
![]() |
54aaad9dad | ||
![]() |
c88b219410 | ||
![]() |
bab749e23e | ||
![]() |
d54a0e5ae8 | ||
![]() |
4dc4cc3fc6 | ||
![]() |
3d45f9bba9 | ||
![]() |
97c97ff6d5 | ||
![]() |
d8231fa5c2 | ||
![]() |
5db587d7c1 | ||
![]() |
3ee26913e7 | ||
![]() |
4bb570c9a4 | ||
![]() |
0e8b76a57e | ||
![]() |
2dfdcbf4e7 | ||
![]() |
1b3bdcc1a6 | ||
![]() |
dc5bb506ff | ||
![]() |
074d12c1fa | ||
![]() |
80deff7c4b | ||
![]() |
b7b6c6e1c6 | ||
![]() |
651f3f3d1a | ||
![]() |
0bc4ef1caf | ||
![]() |
dc0a0f6c93 | ||
![]() |
63d8d27b03 | ||
![]() |
dc40ea7fa1 | ||
![]() |
0fae59d6eb | ||
![]() |
5c7821b6c5 | ||
![]() |
f5745ec58b | ||
![]() |
b21d5cb2dc | ||
![]() |
74c5dd2158 | ||
![]() |
b5664d5d02 | ||
![]() |
506c7f2ab0 | ||
![]() |
17dcc1a801 | ||
![]() |
9b37edbff5 | ||
![]() |
e22cdb9ef8 | ||
![]() |
636fa8bea8 | ||
![]() |
9799e0ad8e | ||
![]() |
6ca1d346be | ||
![]() |
e1603bf7e4 | ||
![]() |
5c554bd278 | ||
![]() |
71cfa2e225 | ||
![]() |
bb2200ffca | ||
![]() |
66e45737e1 | ||
![]() |
695de8493d | ||
![]() |
c5488692d4 | ||
![]() |
0a19e31886 | ||
![]() |
2c2e3ad860 | ||
![]() |
938dbad1e8 | ||
![]() |
ff0bfa28d3 | ||
![]() |
d3e11cf813 | ||
![]() |
9993392f6d | ||
![]() |
e891618572 | ||
![]() |
96f8e314b3 | ||
![]() |
0edcf5fa8b | ||
![]() |
0cd23d778e | ||
![]() |
14f6ad921b | ||
![]() |
8e93970944 | ||
![]() |
b65f499f60 | ||
![]() |
c2bcc5be2f | ||
![]() |
ba67b9239b | ||
![]() |
f4f45af792 | ||
![]() |
9cce5af5af | ||
![]() |
2e6b98c7f6 | ||
![]() |
a8dbfbb8ce | ||
![]() |
a68c99c94e | ||
![]() |
00da3293e2 | ||
![]() |
6a0ce0a518 | ||
![]() |
7ce55fd6b7 | ||
![]() |
6cc96b358a | ||
![]() |
4d6660c2ed | ||
![]() |
f5b01e3c57 | ||
![]() |
57c6b805ce | ||
![]() |
17ed15182a | ||
![]() |
77eaa2fea1 | ||
![]() |
3c56f37265 | ||
![]() |
4073e3a325 | ||
![]() |
48df9fcc11 | ||
![]() |
bad6113059 | ||
![]() |
9e7ac6982a | ||
![]() |
47ab3b6c5e | ||
![]() |
c761b26aef | ||
![]() |
4ee9ce444b | ||
![]() |
01ba5f2192 | ||
![]() |
b869710aff | ||
![]() |
323428ced5 | ||
![]() |
8f99a7f6e3 | ||
![]() |
aff873923c | ||
![]() |
4d1661d39a | ||
![]() |
a34a0df207 | ||
![]() |
5841610c7f | ||
![]() |
557ea7a8da | ||
![]() |
7f1282834f | ||
![]() |
4e0ef1d982 | ||
![]() |
734a0d9ebc | ||
![]() |
4d66861107 | ||
![]() |
44a6a0d941 | ||
![]() |
95940758e9 | ||
![]() |
bfd98ad44b | ||
![]() |
b59d3549fd | ||
![]() |
5f7149068e | ||
![]() |
8ec6bfcbe7 | ||
![]() |
200e59149c | ||
![]() |
978d78f7b2 | ||
![]() |
03d8ec2601 | ||
![]() |
b941e8fb9f | ||
![]() |
394f30d8d4 | ||
![]() |
1e0eb68b69 | ||
![]() |
f791957ae3 | ||
![]() |
f21b3f874f | ||
![]() |
8fa510d483 | ||
![]() |
ff777576d8 | ||
![]() |
3b6c1c661e | ||
![]() |
8686bd554b | ||
![]() |
62cfb5c161 | ||
![]() |
349bac4214 | ||
![]() |
c3844cbf4a | ||
![]() |
556e4ccb42 | ||
![]() |
116cb137fe | ||
![]() |
d7b97367b2 | ||
![]() |
b82e22dcaf | ||
![]() |
95bde7588c | ||
![]() |
13425eb243 | ||
![]() |
5bde13f927 | ||
![]() |
78b52181bd | ||
![]() |
a790547896 | ||
![]() |
fe32b77f87 | ||
![]() |
dd854ea985 | ||
![]() |
121e7b3e2d | ||
![]() |
15c82415c2 | ||
![]() |
5d791c0ea9 | ||
![]() |
07db0defa7 | ||
![]() |
41f8a4f14f | ||
![]() |
778d2ba28b | ||
![]() |
dc490a0f08 | ||
![]() |
641eae0f5a | ||
![]() |
2cc8cbeaf4 | ||
![]() |
24dcacc78f | ||
![]() |
157a8ddf5c | ||
![]() |
08d82be71d | ||
![]() |
ba54a4c747 | ||
![]() |
b26260a0b9 | ||
![]() |
ffd0861b7c | ||
![]() |
e5ccf5eb93 | ||
![]() |
67307075d1 | ||
![]() |
42c719474e | ||
![]() |
4d9b6060d4 | ||
![]() |
2331d1ff15 | ||
![]() |
218292f6b1 | ||
![]() |
95c07b4659 | ||
![]() |
186b9c9aac | ||
![]() |
1ccc0fad27 | ||
![]() |
3e0f415fc6 | ||
![]() |
5af0cf0ce6 | ||
![]() |
8aa36728f5 | ||
![]() |
f2a716d47c | ||
![]() |
4431431c23 | ||
![]() |
13ef589dc8 | ||
![]() |
ac36d5db7e | ||
![]() |
cdc74b198e | ||
![]() |
8d0a55cfac | ||
![]() |
3f793c91f4 | ||
![]() |
2dc4a31b6c | ||
![]() |
40ef4325d9 | ||
![]() |
16da29bf9d | ||
![]() |
9fbe8a001b | ||
![]() |
f12b432efd | ||
![]() |
e71a5ca5f2 | ||
![]() |
837a5a6021 | ||
![]() |
7a6e646c83 | ||
![]() |
a71f1b4917 | ||
![]() |
5fb4ac2286 | ||
![]() |
98f25e9694 | ||
![]() |
d92ca28b16 | ||
![]() |
d1dd6bb746 | ||
![]() |
bf87d252f3 | ||
![]() |
8f397a9be7 | ||
![]() |
ca270f7c17 | ||
![]() |
a8a3ca5102 | ||
![]() |
2c78a5a5a0 | ||
![]() |
2521f714f9 | ||
![]() |
95b4875c8a | ||
![]() |
ec01ab23fb | ||
![]() |
34debf18bf | ||
![]() |
4592b6983a | ||
![]() |
a0e44f97bd | ||
![]() |
de439e24d7 | ||
![]() |
187d04ccb0 | ||
![]() |
f214273fd6 | ||
![]() |
52aeb3f312 | ||
![]() |
d84c1df906 | ||
![]() |
a1dd79d4fe | ||
![]() |
0519556070 | ||
![]() |
d64d04df39 | ||
![]() |
cf476dbc41 | ||
![]() |
8bfed103d8 | ||
![]() |
e9b6e4e839 | ||
![]() |
1dc53cfd1e | ||
![]() |
f57b5bc735 | ||
![]() |
d46c2e8b0a | ||
![]() |
f6d1cb89de | ||
![]() |
0e0031dc61 | ||
![]() |
2168327bfa | ||
![]() |
5cf5569d6e | ||
![]() |
b4391067ff | ||
![]() |
1961248339 | ||
![]() |
13d942e163 | ||
![]() |
99fd62e3be | ||
![]() |
0cded44025 | ||
![]() |
a8aad9de61 | ||
![]() |
ffe53c91c5 | ||
![]() |
9a2860a3ee | ||
![]() |
896199c652 | ||
![]() |
5fcc6b4a0a | ||
![]() |
678b3605e8 | ||
![]() |
b9c4654a63 | ||
![]() |
845dd50275 | ||
![]() |
23aa204856 | ||
![]() |
8eb16b0827 | ||
![]() |
fc1abcfa1f | ||
![]() |
c53acc3015 | ||
![]() |
7a34efa5c4 | ||
![]() |
2727e45b43 | ||
![]() |
5e5ec023be | ||
![]() |
d6a5b04043 | ||
![]() |
1de9edc06e | ||
![]() |
9a99c974a4 | ||
![]() |
bf84ee3c7c | ||
![]() |
f8545d04b7 | ||
![]() |
e73c975bad | ||
![]() |
0f7e10cef4 | ||
![]() |
689f9b8af7 | ||
![]() |
654cbf0687 | ||
![]() |
041b0d76ca | ||
![]() |
24bac034d1 | ||
![]() |
094097fab3 | ||
![]() |
26fbe9a101 | ||
![]() |
f8ddafcca2 | ||
![]() |
04a8f224c1 | ||
![]() |
597839331c | ||
![]() |
26b72485cf | ||
![]() |
7dbaf59ccf | ||
![]() |
95cf0a8803 | ||
![]() |
1dd5bc3fba | ||
![]() |
bf55e2c5d3 | ||
![]() |
4d92475240 | ||
![]() |
a52586e8ea | ||
![]() |
5759574b26 | ||
![]() |
56580efe68 | ||
![]() |
68f28d6976 | ||
![]() |
5c3f5746bb | ||
![]() |
54a73cbb2b | ||
![]() |
ab0f04844b | ||
![]() |
ad8f03af22 | ||
![]() |
3329f92136 | ||
![]() |
c27ec060da | ||
![]() |
82b2189d01 | ||
![]() |
4ce52970c0 | ||
![]() |
99433dd289 | ||
![]() |
b94c520660 | ||
![]() |
2f02ae9d45 | ||
![]() |
11fcc8c8f9 | ||
![]() |
e8cf498dcc | ||
![]() |
2178a00eea | ||
![]() |
33ff830c1b | ||
![]() |
5a8d8dfbb6 | ||
![]() |
8238850caa | ||
![]() |
fc3c64c8d4 | ||
![]() |
1888e57bf9 | ||
![]() |
94dcc5b8d8 | ||
![]() |
4839a7995e | ||
![]() |
1aca526cb4 | ||
![]() |
9541165d33 | ||
![]() |
600131fe85 | ||
![]() |
8c45b484ce | ||
![]() |
650da7bada | ||
![]() |
247c9f70bf | ||
![]() |
233f79df99 | ||
![]() |
236852c109 | ||
![]() |
6f0e469d79 | ||
![]() |
f9749f368f | ||
![]() |
f165864f09 | ||
![]() |
dc077a52c9 | ||
![]() |
0b2de1f895 | ||
![]() |
94eb3cf222 | ||
![]() |
cb47caf786 | ||
![]() |
d9f0633878 | ||
![]() |
71094bee63 | ||
![]() |
f5c4374d2c | ||
![]() |
aa297ca6b6 | ||
![]() |
4712e4ece6 | ||
![]() |
e51b607189 | ||
![]() |
fdf2a763d4 | ||
![]() |
f25c9697f8 | ||
![]() |
7e282f5df1 | ||
![]() |
0e9bb3f30c | ||
![]() |
3bb5b261c7 | ||
![]() |
273b197d75 | ||
![]() |
906dedf4d5 | ||
![]() |
4f4a79b1a1 | ||
![]() |
587b3497c1 | ||
![]() |
1753a63081 | ||
![]() |
96f3cf1d27 | ||
![]() |
e4dec3d6b6 | ||
![]() |
429aa1a2c2 | ||
![]() |
d889c019e7 | ||
![]() |
52168b7b9d | ||
![]() |
d6462323d6 | ||
![]() |
1d368457e3 | ||
![]() |
7c3fe07ac0 | ||
![]() |
194f7d125f | ||
![]() |
8ef0be5671 | ||
![]() |
b809e77f54 | ||
![]() |
780afa9876 | ||
![]() |
5ebc1acb7f | ||
![]() |
59580f28a1 | ||
![]() |
533d7dc4ab | ||
![]() |
ec74fa8789 | ||
![]() |
988061a5ee | ||
![]() |
c10d53bf0c | ||
![]() |
54b87586aa | ||
![]() |
461ff22cd5 | ||
![]() |
b1a4919cb2 | ||
![]() |
c1d670a893 | ||
![]() |
b6bf29b054 | ||
![]() |
5c6a593f2e | ||
![]() |
f4c36b28f6 | ||
![]() |
73e649b5f5 | ||
![]() |
ba72631039 | ||
![]() |
a89fb6daa5 | ||
![]() |
6568d86aec | ||
![]() |
3508cc816e | ||
![]() |
ffa264f077 | ||
![]() |
84c2266f1a | ||
![]() |
973c23b0d6 | ||
![]() |
9ede1929b2 | ||
![]() |
054e038512 | ||
![]() |
fb8923f681 | ||
![]() |
240cc7c480 | ||
![]() |
8d04a1287d | ||
![]() |
16df64ef1f | ||
![]() |
f76ef3aa3d | ||
![]() |
59c88f499f | ||
![]() |
afe25d0ccc | ||
![]() |
bdccc34e7e | ||
![]() |
495a964322 | ||
![]() |
9defc609e8 | ||
![]() |
68b26290f0 | ||
![]() |
d41f7ae750 | ||
![]() |
e15bc1f330 | ||
![]() |
a607b7d4b8 | ||
![]() |
1a4c4015bc | ||
![]() |
d7df77d172 | ||
![]() |
7e2b4f8367 | ||
![]() |
bc9ae19deb | ||
![]() |
17829e94aa | ||
![]() |
e0dca0e43c | ||
![]() |
4e207ec862 | ||
![]() |
b5ccf21d2b | ||
![]() |
62bde8ed7e | ||
![]() |
dc670134f8 | ||
![]() |
39d6cb5df4 | ||
![]() |
ddfd1d10a0 | ||
![]() |
0c1a8ebc37 | ||
![]() |
bd4c4bcb76 | ||
![]() |
161efa1f40 | ||
![]() |
ebdddd29d3 | ||
![]() |
2790d5b2ed | ||
![]() |
98adb06ea3 | ||
![]() |
0b90cfaa9f | ||
![]() |
ded38dbfbd | ||
![]() |
5d12f1a485 | ||
![]() |
7addf9d430 | ||
![]() |
6d0480426d | ||
![]() |
5a8b143888 | ||
![]() |
5bf0b329c9 | ||
![]() |
51123629d7 | ||
![]() |
0ad78ae8e7 | ||
![]() |
1c6e9e5c0a | ||
![]() |
0b610a002c | ||
![]() |
0f1361ee1c | ||
![]() |
b806825d2a | ||
![]() |
f905c1d7d6 | ||
![]() |
926b2c3337 | ||
![]() |
fc900b8be4 | ||
![]() |
88838bf238 | ||
![]() |
ed2de829e1 | ||
![]() |
ff34c9dcd4 | ||
![]() |
3d4641fd98 | ||
![]() |
860ace56f8 | ||
![]() |
ed6220fd25 | ||
![]() |
be9ca6c8a8 | ||
![]() |
148284ced6 | ||
![]() |
1def132d53 | ||
![]() |
0de910602c | ||
![]() |
3714170f33 | ||
![]() |
c6ca79eb4e | ||
![]() |
a15ad925e9 | ||
![]() |
13d5225fc8 | ||
![]() |
e3052553cf | ||
![]() |
cc0e7a369b | ||
![]() |
7f819d7041 | ||
![]() |
dfba82b3d3 | ||
![]() |
3ae2f09a04 | ||
![]() |
a2a2a956dd | ||
![]() |
fa9d7304bf | ||
![]() |
c56b63d1bd | ||
![]() |
2e44f115b9 | ||
![]() |
0c296f15b1 | ||
![]() |
345f573546 | ||
![]() |
69288348dd | ||
![]() |
9babe97e6f | ||
![]() |
863fa9c295 | ||
![]() |
766968bb6f | ||
![]() |
123e04b23e | ||
![]() |
9d2eb35d7a | ||
![]() |
67a38adacf | ||
![]() |
80aa303c29 | ||
![]() |
5ea16f2790 | ||
![]() |
2f24b79ddd | ||
![]() |
d9f8feb04a | ||
![]() |
bb57587b42 | ||
![]() |
b61ca28260 | ||
![]() |
a3f4e7709b | ||
![]() |
984a819b92 | ||
![]() |
edae4b5efb | ||
![]() |
2098ebf712 | ||
![]() |
f72c10f657 | ||
![]() |
645bde35d3 | ||
![]() |
0c39f9f6f6 | ||
![]() |
21007cb6ec | ||
![]() |
31f7db66a8 | ||
![]() |
4f18fe8296 | ||
![]() |
5494f08cc5 | ||
![]() |
c1a37d928f | ||
![]() |
0375106c78 | ||
![]() |
2b9dfbbeae | ||
![]() |
47b5c0f290 | ||
![]() |
4e6d8fd691 | ||
![]() |
34a369ed2d | ||
![]() |
3e6d2b31ea | ||
![]() |
13beb248bc | ||
![]() |
b03edf372f | ||
![]() |
e663608c40 | ||
![]() |
ef380e9de8 | ||
![]() |
39f3a51d65 | ||
![]() |
4809126378 | ||
![]() |
6c4b24afb0 | ||
![]() |
c1b2cc48d6 | ||
![]() |
fdb3d52d59 | ||
![]() |
d726d811f1 | ||
![]() |
2fe2945869 | ||
![]() |
f016dccc89 | ||
![]() |
c993cfb32f | ||
![]() |
9aaf7c3a33 | ||
![]() |
0e77eb3782 | ||
![]() |
93ce0a7a1c | ||
![]() |
a8b15b36bf | ||
![]() |
33ee031c4a | ||
![]() |
f24a2d46b7 | ||
![]() |
6a389cfca8 | ||
![]() |
26537a5b79 | ||
![]() |
aae88014c7 | ||
![]() |
441d31b927 | ||
![]() |
04db5fdc15 | ||
![]() |
0592128b1e | ||
![]() |
308b10311c | ||
![]() |
7045d15460 | ||
![]() |
6c034582d2 | ||
![]() |
57b965ef4b | ||
![]() |
f4785648fb | ||
![]() |
e368513370 | ||
![]() |
b54cac21c1 | ||
![]() |
acff0cc10c | ||
![]() |
a6f8c08347 | ||
![]() |
47e1402108 | ||
![]() |
1336db4f1c | ||
![]() |
6c1d16ad29 | ||
![]() |
0de01de409 | ||
![]() |
499befa692 | ||
![]() |
435185d7ab | ||
![]() |
e0fd2e2f74 | ||
![]() |
024cd021d4 | ||
![]() |
87194701de | ||
![]() |
4578763326 | ||
![]() |
7c00784e5c | ||
![]() |
53e1c5b996 | ||
![]() |
835d568916 | ||
![]() |
4f945a3932 | ||
![]() |
20cfd14f41 | ||
![]() |
376cfd1c27 | ||
![]() |
c0dc4c5d1e | ||
![]() |
532d7d9be4 | ||
![]() |
beb097d9f1 | ||
![]() |
44f1ab8285 | ||
![]() |
81f83dab0a | ||
![]() |
c3cd4c76d7 | ||
![]() |
1702e6c660 | ||
![]() |
e6df817525 | ||
![]() |
f4da80735a | ||
![]() |
d34a6d07c1 | ||
![]() |
f874872fc2 | ||
![]() |
2240d47fe5 | ||
![]() |
449adc611f | ||
![]() |
584e55654c | ||
![]() |
1adaf3372c | ||
![]() |
52c3715fd4 | ||
![]() |
dd1f72b3dd | ||
![]() |
3564cb7c2c | ||
![]() |
3d2a316013 | ||
![]() |
da1c03c8a0 | ||
![]() |
f47478b336 | ||
![]() |
6281504d33 | ||
![]() |
4a4c88236b | ||
![]() |
3e26772cde | ||
![]() |
b2543662a1 | ||
![]() |
3076b67917 | ||
![]() |
21e033f8ef | ||
![]() |
4fafddf78f | ||
![]() |
c81a97d1a7 | ||
![]() |
9a139a430a | ||
![]() |
e3b4125e83 | ||
![]() |
aceddbe8a4 | ||
![]() |
4286a25041 | ||
![]() |
00c5ab3e33 | ||
![]() |
c094baa0fb | ||
![]() |
1c709728ec | ||
![]() |
2a652c0b95 | ||
![]() |
89056045f5 | ||
![]() |
6aca2e0366 | ||
![]() |
07253f00ca | ||
![]() |
04f816de49 | ||
![]() |
14940c2a5c | ||
![]() |
4d06c74ea6 | ||
![]() |
d72eec354a | ||
![]() |
e60123c2ed | ||
![]() |
19c258b689 | ||
![]() |
dacba77805 |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,3 +1,8 @@
|
||||
test*.img
|
||||
modules.d/99base/switch_root
|
||||
*~
|
||||
dracut.kernel.7
|
||||
dracut.conf.5
|
||||
dracut.8
|
||||
dracut-catimages.8
|
||||
dracut-gencmdline.8
|
||||
|
6
.mailmap
Normal file
6
.mailmap
Normal file
@@ -0,0 +1,6 @@
|
||||
Philippe Seewer <philippe.seewer@bfh.ch> <philippe.seewer-omB+W0Dpw2o@public.gmane.org>
|
||||
Seewer Philippe <philippe.seewer@bfh.ch> <philippe.seewer@bfh.ch>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch> <philippe.seewer@bfh.ch>
|
||||
Victor Lowther <victor.lowther@gmail.com> <victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
|
||||
Harald Hoyer <harald@redhat.com> <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
|
||||
Harald Hoyer <harald@redhat.com> <harald@eeepc.(none)>
|
44
AUTHORS
44
AUTHORS
@@ -1,11 +1,39 @@
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Seewer Philippe <philippe.seewer@bfh.ch>
|
||||
Victor Lowther <victor.lowther@gmail.com>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Amadeusz Żołnowski <aidecoe@aidecoe.name>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Luca Berra <bluca@comedia.it>
|
||||
Andrey Borzenkov <arvidjaar@mail.ru>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
David Cantrell <dcantrell@redhat.com>
|
||||
Lance Albertson <lance@osuosl.org>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
||||
Dan Horák <dan@danny.cz>
|
||||
Joey Boggs <jboggs@redhat.com>
|
||||
Alexander Todorov <atodorov@redhat.com>
|
||||
Andy Lutomirski <luto@mit.edu>
|
||||
Dan Horák <dhorak@redhat.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
Frederic Crozat <fcrozat@mandriva.com>
|
||||
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
Matt <smoothsailing72@hotmail.com>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Mike Snitzer <msnitzer@redhat.com>
|
||||
Mike Snitzer <snitzer@redhat.com>
|
||||
Munehiro Matsuda <haro@kgt.co.jp>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Quentin Armitage <quentin@armitage.org.uk>
|
||||
Sergey Fionov <fionov@gmail.com>
|
||||
Thilo Bangert <thilo.bangert@gmx.net>
|
||||
Ville Skyttä <ville.skytta@iki.fi>
|
||||
Yanko Kaneti <yaneti@declera.com>
|
||||
|
86
Makefile
86
Makefile
@@ -1,39 +1,67 @@
|
||||
VERSION=0.4
|
||||
VERSION=007
|
||||
GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8)
|
||||
|
||||
prefix = /usr
|
||||
datadir = ${prefix}/share
|
||||
pkglibdir = ${datadir}/dracut
|
||||
sysconfdir = ${prefix}/etc
|
||||
sbindir = ${prefix}/sbin
|
||||
mandir = ${prefix}/share/man
|
||||
prefix ?= /usr
|
||||
datadir ?= ${prefix}/share
|
||||
pkglibdir ?= ${datadir}/dracut
|
||||
sysconfdir ?= ${prefix}/etc
|
||||
sbindir ?= ${prefix}/sbin
|
||||
mandir ?= ${prefix}/share/man
|
||||
|
||||
manpages = dracut.8 dracut.kernel.7 dracut.conf.5 dracut-catimages.8 dracut-gencmdline.8
|
||||
|
||||
.PHONY: install clean archive rpm testimage test all check AUTHORS
|
||||
|
||||
ifeq (1,${WITH_SWITCH_ROOT})
|
||||
targets = modules.d/99base/switch_root
|
||||
else
|
||||
targets =
|
||||
endif
|
||||
|
||||
all: $(targets) $(manpages)
|
||||
|
||||
%: %.xml
|
||||
xsltproc -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
|
||||
|
||||
modules.d/99base/switch_root: switch_root.c
|
||||
gcc -D _GNU_SOURCE -D 'PACKAGE_STRING="dracut"' -std=gnu99 -fsigned-char -g -O2 -o modules.d/99base/switch_root switch_root.c
|
||||
|
||||
all: modules.d/99base/switch_root
|
||||
|
||||
.PHONY: install clean archive rpm testimage test all check
|
||||
|
||||
install:
|
||||
mkdir -p $(DESTDIR)$(pkglibdir)
|
||||
mkdir -p $(DESTDIR)$(sbindir)
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)
|
||||
mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
|
||||
mkdir -p $(DESTDIR)$(mandir)/man8
|
||||
mkdir -p $(DESTDIR)$(mandir)/man{5,7,8}
|
||||
install -m 0755 dracut $(DESTDIR)$(sbindir)/dracut
|
||||
install -m 0755 dracut-gencmdline $(DESTDIR)$(sbindir)/dracut-gencmdline
|
||||
install -m 0755 dracut-catimages $(DESTDIR)$(sbindir)/dracut-catimages
|
||||
install -m 0755 mkinitrd-dracut.sh $(DESTDIR)$(sbindir)/mkinitrd
|
||||
install -m 0755 lsinitrd $(DESTDIR)$(sbindir)/lsinitrd
|
||||
ifeq (1,${WITH_SWITCH_ROOT})
|
||||
install -m 0755 modules.d/99base/switch_root $(DESTDIR)$(sbindir)/switch_root
|
||||
endif
|
||||
install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d
|
||||
install -m 0755 dracut-functions $(DESTDIR)$(pkglibdir)/dracut-functions
|
||||
cp -arx modules.d $(DESTDIR)$(pkglibdir)
|
||||
install -m 0644 dracut.8 $(DESTDIR)$(mandir)/man8
|
||||
install -m 0644 dracut-catimages.8 $(DESTDIR)$(mandir)/man8
|
||||
install -m 0644 dracut-gencmdline.8 $(DESTDIR)$(mandir)/man8
|
||||
install -m 0644 dracut.conf.5 $(DESTDIR)$(mandir)/man5
|
||||
install -m 0644 dracut.kernel.7 $(DESTDIR)$(mandir)/man7
|
||||
ifeq (1,${WITH_SWITCH_ROOT})
|
||||
rm $(DESTDIR)$(pkglibdir)/modules.d/99base/switch_root
|
||||
endif
|
||||
|
||||
clean:
|
||||
rm -f *~
|
||||
rm -f modules.d/99base/switch_root
|
||||
rm -f test-*.img
|
||||
make -C test clean
|
||||
$(RM) *~
|
||||
$(RM) */*~
|
||||
$(RM) */*/*~
|
||||
$(RM) modules.d/99base/switch_root
|
||||
$(RM) test-*.img
|
||||
$(RM) dracut-*.rpm dracut-*.tar.bz2
|
||||
$(RM) $(manpages)
|
||||
$(MAKE) -C test clean
|
||||
|
||||
archive: dracut-$(VERSION)-$(GITVERSION).tar.bz2
|
||||
|
||||
@@ -46,20 +74,38 @@ dracut-$(VERSION)-$(GITVERSION).tar.bz2:
|
||||
git archive --format=tar HEAD --prefix=dracut-$(VERSION)-$(GITVERSION)/ |bzip2 > dracut-$(VERSION)-$(GITVERSION).tar.bz2
|
||||
|
||||
|
||||
rpm: dracut-$(VERSION).tar.bz2
|
||||
rpm: clean dracut-$(VERSION).tar.bz2
|
||||
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" -ba dracut.spec
|
||||
rm -fr BUILD BUILDROOT
|
||||
|
||||
gitrpm: dracut-$(VERSION)-$(GITVERSION).tar.bz2
|
||||
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" --define "gittag $(GITVERSION)" -ba dracut.spec
|
||||
echo "%define gittag $(GITVERSION)" > dracut.spec.git
|
||||
cat dracut.spec >> dracut.spec.git
|
||||
mv dracut.spec dracut.spec.bak
|
||||
mv dracut.spec.git dracut.spec
|
||||
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" --define "gittag $(GITVERSION)" -ba dracut.spec || :
|
||||
mv dracut.spec.bak dracut.spec
|
||||
rm -fr BUILD BUILDROOT
|
||||
|
||||
check: all
|
||||
@ret=0;for i in modules.d/99base/init modules.d/*/*.sh; do \
|
||||
dash -n "$$i" ; ret=$$(($$ret+$$?)); \
|
||||
done;exit $$ret
|
||||
make -C test check
|
||||
$(MAKE) -C test check
|
||||
|
||||
testimage: all
|
||||
./dracut -l -f test-$(shell uname -r).img $(shell uname -r)
|
||||
./dracut -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
|
||||
@echo wrote test-$(shell uname -r).img
|
||||
|
||||
testimages: all
|
||||
./dracut -l -a debug --kernel-only -f test-kernel-$(shell uname -r).img $(shell uname -r)
|
||||
@echo wrote test-$(shell uname -r).img
|
||||
./dracut -l -a debug --no-kernel -f test-dracut.img $(shell uname -r)
|
||||
@echo wrote test-dracut.img
|
||||
|
||||
hostimage: all
|
||||
./dracut -H -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
|
||||
@echo wrote test-$(shell uname -r).img
|
||||
|
||||
AUTHORS:
|
||||
git shortlog --numbered --summary -e |while read a rest; do echo $$rest;done > AUTHORS
|
||||
|
305
NEWS
Normal file
305
NEWS
Normal file
@@ -0,0 +1,305 @@
|
||||
dracut-007
|
||||
==========
|
||||
- module i18n is no longer fedora/red hat specific (Amadeusz Żołnowski)
|
||||
- distribution specific conf file
|
||||
- bootchartd support
|
||||
- debug module now has fsck
|
||||
- use "hardlink", if available, to safe some space
|
||||
- /etc/dracut.conf can be overwritten by settings in /etc/dracut.conf.d/*.conf
|
||||
- gentoo splash module
|
||||
- --ignore-kernel-modules option
|
||||
- crypto keys on external devices support
|
||||
- bugfixes
|
||||
|
||||
dracut-006
|
||||
==========
|
||||
- fixed mdraid with IMSM
|
||||
- fixed dracut manpages
|
||||
- dmraid parse different error messages
|
||||
- add cdrom polling mechanism for slow cdroms
|
||||
- add module btrfs
|
||||
- add btrfsctl scan for btrfs multi-devices (raid)
|
||||
- teach dmsquash live-root to use rootflags
|
||||
- trigger udev with action=add
|
||||
- fixed add_drivers handling
|
||||
- add sr_mod
|
||||
- use pigz instead of gzip, if available
|
||||
- boot from LVM mirrors and snapshots
|
||||
- iscsi: add support for multiple netroot=iscsi:
|
||||
- Support old version of module-init-tools
|
||||
- got rid of rdnetdebug
|
||||
- fixed "ip=auto6"
|
||||
- dracut.conf: use "+=" as default for config variables
|
||||
- bugfixes
|
||||
|
||||
dracut-005
|
||||
==========
|
||||
- dcb support to dracut's FCoE support
|
||||
- add readonly overlay support for dmsquash
|
||||
- add keyboard kernel modules
|
||||
- dracut.conf: added add_dracutmodules
|
||||
- add /etc/dracut.conf.d
|
||||
- add preliminary IPv6 support
|
||||
- bugfixes
|
||||
|
||||
dracut-004
|
||||
==========
|
||||
- dracut-lib: read multiple lines from $init/etc/cmdline
|
||||
- lsinitrd and mkinitrd
|
||||
- dmsquash: add support for loopmounted *.iso files
|
||||
- lvm: add rd_LVM_LV and "--poll n"
|
||||
- user suspend support
|
||||
- add additional drivers in host-only mode, too
|
||||
- improved emergency shell
|
||||
- support for compressed kernel modules
|
||||
- support for loading Xen modules
|
||||
- rdloaddriver kernel command line parameter
|
||||
- man pages for dracut-catimages and dracut-gencmdline
|
||||
- bugfixes
|
||||
|
||||
dracut-003
|
||||
==========
|
||||
- add debian package modules
|
||||
- add dracut.conf manpage
|
||||
- add module 90multipath
|
||||
- add module 01fips
|
||||
- crypt: ignore devices in /etc/crypttab (root is not in there)
|
||||
unless rd_NO_CRYPTTAB is specified
|
||||
- kernel-modules: add scsi_dh scsi_dh_rdac scsi_dh_emc
|
||||
- add multinic support
|
||||
- add s390 zfcp support
|
||||
- add s390 dasd support
|
||||
- add s390 network support
|
||||
- fixed dracut-gencmdline for root=UUID or LABEL
|
||||
- do not destroy assembled raid arrays if mdadm.conf present
|
||||
- mount /dev/shm
|
||||
- let udevd not resolve group and user names
|
||||
- moved network from udev to initqueue
|
||||
- improved debug output: specifying "rdinitdebug" now logs
|
||||
to dmesg, console and /init.log
|
||||
- strip kernel modules which have no x bit set
|
||||
- redirect stdin, stdout, stderr all RW to /dev/console
|
||||
so the user can use "less" to view /init.log and dmesg
|
||||
- add new device mapper udev rules and dmeventd
|
||||
- fixed dracut-gencmdline for root=UUID or LABEL
|
||||
- do not destroy assembled raid arrays if mdadm.conf present
|
||||
- mount /dev/shm
|
||||
- let udevd not resolve group and user names
|
||||
- preserve timestamps of tools on initramfs generation
|
||||
- generate symlinks for binaries correctly
|
||||
- moved network from udev to initqueue
|
||||
- mount nfs3 with nfsvers=3 option and retry with nfsvers=2
|
||||
- fixed nbd initqueue-finished
|
||||
- improved debug output: specifying "rdinitdebug" now logs
|
||||
to dmesg, console and /init.log
|
||||
- strip kernel modules which have no x bit set
|
||||
- redirect stdin, stdout, stderr all RW to /dev/console
|
||||
so the user can use "less" to view /init.log and dmesg
|
||||
- make install of new dm/lvm udev rules optionally
|
||||
- add new device mapper udev rules and dmeventd
|
||||
- Fix LiveCD boot regression
|
||||
- bail out if selinux policy could not be loaded and
|
||||
selinux=0 not specified on kernel command line
|
||||
- do not cleanup dmraids
|
||||
- copy over lvm.conf
|
||||
|
||||
dracut-002
|
||||
==========
|
||||
- add ifname= argument for persistent netdev names
|
||||
- new /initqueue-finished to check if the main loop can be left
|
||||
- copy mdadm.conf if --mdadmconf set or mdadmconf in dracut.conf
|
||||
- plymouth: use plymouth-populate-initrd
|
||||
- add add_drivers for dracut and dracut.conf
|
||||
- add modprobe scsi_wait_scan to be sure everything was scanned
|
||||
- fix for several problems with md raid containers
|
||||
- fix for selinux policy loading
|
||||
- fix for mdraid for IMSM
|
||||
- fix for bug, which prevents installing 61-persistent-storage.rules (bug #520109)
|
||||
- fix for missing grep for md
|
||||
|
||||
dracut-001
|
||||
==========
|
||||
- better --hostonly checks
|
||||
- better lvm/mdraid/dmraid handling
|
||||
- fcoe booting support
|
||||
Supported cmdline formats:
|
||||
fcoe=<networkdevice>:<dcb|nodcb>
|
||||
fcoe=<macaddress>:<dcb|nodcb>
|
||||
|
||||
Note currently only nodcb is supported, the dcb option is reserved for
|
||||
future use.
|
||||
|
||||
Note letters in the macaddress must be lowercase!
|
||||
|
||||
Examples:
|
||||
fcoe=eth0:nodcb
|
||||
fcoe=4A:3F:4C:04:F8:D7:nodcb
|
||||
|
||||
- Syslog support for dracut
|
||||
This module provides syslog functionality in the initrd.
|
||||
This is especially interesting when complex configuration being
|
||||
used to provide access to the device the rootfs resides on.
|
||||
|
||||
|
||||
dracut-0.9
|
||||
==========
|
||||
- let plymouth attach to the terminal (nice text output now)
|
||||
- new kernel command line parameter "rdinfo" show dracut output, even when
|
||||
"quiet" is specified
|
||||
- rd_LUKS_UUID is now handled correctly
|
||||
- dracut-gencmdline: rd_LUKS_UUID and rd_MD_UUID is now correctly generated
|
||||
- now generates initrd-generic with around 15MB
|
||||
- smaller bugfixes
|
||||
|
||||
dracut-0.8
|
||||
==========
|
||||
- iSCSI with username and password
|
||||
- support for live images (dmsquashed live images)
|
||||
- iscsi_firmware fixes
|
||||
- smaller images
|
||||
- bugfixes
|
||||
|
||||
dracut-0.7
|
||||
==========
|
||||
- dracut: strip binaries in initramfs
|
||||
|
||||
--strip
|
||||
strip binaries in the initramfs (default)
|
||||
|
||||
--nostrip
|
||||
do not strip binaries in the initramfs
|
||||
- dracut-catimages
|
||||
|
||||
Usage: ./dracut-catimages [OPTION]... <initramfs> <base image>
|
||||
[<image>...]
|
||||
Creates initial ramdisk image by concatenating several images from the
|
||||
command
|
||||
line and /boot/dracut/
|
||||
|
||||
-f, --force Overwrite existing initramfs file.
|
||||
-i, --imagedir Directory with additional images to add
|
||||
(default: /boot/dracut/)
|
||||
-o, --overlaydir Overlay directory, which contains files that
|
||||
will be used to create an additional image
|
||||
--nooverlay Do not use the overlay directory
|
||||
--noimagedir Do not use the additional image directory
|
||||
-h, --help This message
|
||||
--debug Output debug information of the build process
|
||||
-v, --verbose Verbose output during the build process
|
||||
|
||||
- s390 dasd support
|
||||
|
||||
dracut-0.6
|
||||
==========
|
||||
- dracut: add --kernel-only and --no-kernel arguments
|
||||
|
||||
--kernel-only
|
||||
only install kernel drivers and firmware files
|
||||
|
||||
--no-kernel
|
||||
do not install kernel drivers and firmware files
|
||||
|
||||
All kernel module related install commands moved from "install"
|
||||
to "installkernel".
|
||||
|
||||
For "--kernel-only" all installkernel scripts of the specified
|
||||
modules are used, regardless of any checks, so that all modules
|
||||
which might be needed by any dracut generic image are in.
|
||||
|
||||
The basic idea is to create two images. One image with the kernel
|
||||
modules and one without. So if the kernel changes, you only have
|
||||
to replace one image.
|
||||
|
||||
Grub and the kernel can handle multiple images, so grub entry can
|
||||
look like this:
|
||||
|
||||
title Fedora (2.6.29.5-191.fc11.i586)
|
||||
root (hd0,0)
|
||||
kernel /vmlinuz-2.6.29.5-191.fc11.i586 ro rhgb quiet
|
||||
initrd /initrd-20090722.img /initrd-kernel-2.6.29.5-191.fc11.i586.img /initrd-config.img
|
||||
|
||||
initrd-20090722.img
|
||||
the image provided by the initrd rpm
|
||||
one old backup version is kept like with the kernel
|
||||
|
||||
initrd-kernel-2.6.29.5-191.fc11.i586.img
|
||||
the image provided by the kernel rpm
|
||||
|
||||
initrd-config.img
|
||||
optional image with local configuration files
|
||||
|
||||
- dracut: add --kmoddir directory, where to look for kernel modules
|
||||
|
||||
-k, --kmoddir [DIR]
|
||||
specify the directory, where to look for kernel modules
|
||||
|
||||
|
||||
|
||||
dracut-0.5
|
||||
==========
|
||||
- more generic (all plymouth modules, all keyboards, all console fonts)
|
||||
- more kernel command line parameters (see also man dracut(8))
|
||||
- a helper tool, which generates the kernel command line (dracut-gencmdline)
|
||||
- bridged network boot
|
||||
- a lot of new command line parameter
|
||||
|
||||
dracut-0.4
|
||||
==========
|
||||
- bugfixes
|
||||
- firmware loading support
|
||||
- new internal queue (initqueue)
|
||||
initqueue now loops until /dev/root exists or root is mounted
|
||||
|
||||
init now has the following points to inject scripts:
|
||||
|
||||
/cmdline/*.sh
|
||||
scripts for command line parsing
|
||||
|
||||
/pre-udev/*.sh
|
||||
scripts to run before udev is started
|
||||
|
||||
/pre-trigger/*.sh
|
||||
scripts to run before the main udev trigger is pulled
|
||||
|
||||
/initqueue/*.sh
|
||||
runs in parallel to the udev trigger
|
||||
Udev events can add scripts here with /sbin/initqueue.
|
||||
If /sbin/initqueue is called with the "--onetime" option, the script
|
||||
will be removed after it was run.
|
||||
If /initqueue/work is created and udev >= 143 then this loop can
|
||||
process the jobs in parallel to the udevtrigger.
|
||||
If the udev queue is empty and no root device is found or no root
|
||||
filesystem was mounted, the user will be dropped to a shell after
|
||||
a timeout.
|
||||
Scripts can remove themselves from the initqueue by "rm $job".
|
||||
|
||||
/pre-mount/*.sh
|
||||
scripts to run before the root filesystem is mounted
|
||||
NFS is an exception, because it has no device node to be created
|
||||
and mounts in the udev events
|
||||
|
||||
/mount/*.sh
|
||||
scripts to mount the root filesystem
|
||||
NFS is an exception, because it has no device node to be created
|
||||
and mounts in the udev events
|
||||
If the udev queue is empty and no root device is found or no root
|
||||
filesystem was mounted, the user will be dropped to a shell after
|
||||
a timeout.
|
||||
|
||||
/pre-pivot/*.sh
|
||||
scripts to run before the real init is executed and the initramfs
|
||||
disappears
|
||||
All processes started before should be killed here.
|
||||
|
||||
The behaviour of the dmraid module demonstrates how to use the new
|
||||
mechanism. If it detects a device which is part of a raidmember from a
|
||||
udev rule, it installs a job to scan for dmraid devices, if the udev
|
||||
queue is empty. After a scan, it removes itsself from the queue.
|
||||
|
||||
|
||||
|
||||
dracut-0.3
|
||||
==========
|
||||
|
||||
- first public version
|
||||
|
10
README
10
README
@@ -21,8 +21,10 @@ as hooks are guaranteed to be the path to slow-down.
|
||||
|
||||
Most of the initrd generation functionality in dracut is provided by a bunch
|
||||
of generator modules that are sourced by the main dracut script to install
|
||||
specific functionality into the initrd. They live in the modules subdirectory,
|
||||
and use functionality provided by dracut-functions to do their work.
|
||||
specific functionality into the initrd. They live in the modules.d
|
||||
subdirectory, and use functionality provided by dracut-functions to do their
|
||||
work.
|
||||
|
||||
Some general rules for writing modules:
|
||||
* Use one of the inst family of functions to actually install files
|
||||
on to the initrd. They handle mangling the pathnames and (for binaries,
|
||||
@@ -59,13 +61,13 @@ the documentation, git access, etc.
|
||||
|
||||
Git Repository:
|
||||
http://dracut.git.sourceforge.net/
|
||||
git://dracut.git.sourceforge.net/gitroot/dracut
|
||||
git://dracut.git.sourceforge.net/gitroot/dracut/dracut
|
||||
|
||||
Trac Instance:
|
||||
http://apps.sourceforge.net/trac/dracut/
|
||||
|
||||
The git tree can be found at
|
||||
git://dracut.git.sourceforge.net/gitroot/dracut for now. See the TODO
|
||||
git://dracut.git.sourceforge.net/gitroot/dracut/dracut for now. See the TODO
|
||||
file for things which still need to be done and HACKING for some
|
||||
instructions on how to get started. There is also a mailing list that
|
||||
is being used for the discussion -- initramfs@vger.kernel.org. It is
|
||||
|
@@ -8,3 +8,6 @@ To build a generic initramfs, you have to install the following software package
|
||||
* mdadm
|
||||
* net-tools iproute
|
||||
|
||||
Generic initramfs'es are huge (usually over 10 megs in size uncompressed), but
|
||||
should be able to automatically boot any bootable configuration with appropriate
|
||||
boot flags (root device, network configuration information, etc.)
|
3
README.kernel
Normal file
3
README.kernel
Normal file
@@ -0,0 +1,3 @@
|
||||
"dracut --kernel-only" is to build an initrd with only kernel modules and firmware files.
|
||||
"dracut --kernel-only" only executes "installkernel" in the modules subdirectories.
|
||||
|
@@ -16,7 +16,7 @@ dracut_install_dir/modules.d/
|
||||
it easy for an earlier module to override the functionality of a
|
||||
later module, so that you can have a distro or system specific
|
||||
module override or modify the functionality of a generic module
|
||||
without having to patch the mode generic module.
|
||||
without having to patch the more generic module.
|
||||
|
||||
install: dracut sources this script to install the functionality that a
|
||||
module implements onto the initrd. For the most part, this amounts
|
||||
@@ -35,7 +35,7 @@ check: Dracut calls this program to check and see if a module can be installed
|
||||
are present. It should exit with a 0 if they are, and a 1 if they are
|
||||
not.
|
||||
|
||||
When called with -H, it should perform the same check that it would
|
||||
When called with -h, it should perform the same check that it would
|
||||
without any options, and it should also check to see if the
|
||||
functionality the module implements is being used on the host system.
|
||||
For example, if this module handles installing support for LUKS
|
||||
@@ -43,10 +43,57 @@ check: Dracut calls this program to check and see if a module can be installed
|
||||
encrpted volumes are available and the host system has the root
|
||||
partition on an encrypted volume, 1 otherwise.
|
||||
|
||||
When called with -d, it should output a list of dracut modules
|
||||
that it relies upon. An example would be the nfs and iscsi modules,
|
||||
which rely on the network module to detect and configure network
|
||||
interfaces.
|
||||
|
||||
Check may take additional options in the future.
|
||||
We will most likely grow a module dependency checking system in the
|
||||
near future, and check will need to handle a -d option when we do.
|
||||
|
||||
Any other files in the module will not be touched by dracut directly.
|
||||
|
||||
You are encouraged to provide a README that descrobes what the module is for.
|
||||
You are encouraged to provide a README that describes what the module is for.
|
||||
|
||||
|
||||
HOOKS
|
||||
=====
|
||||
|
||||
init has the following hook points to inject scripts:
|
||||
|
||||
/cmdline/*.sh
|
||||
scripts for command line parsing
|
||||
|
||||
/pre-udev/*.sh
|
||||
scripts to run before udev is started
|
||||
|
||||
/pre-trigger/*.sh
|
||||
scripts to run before the main udev trigger is pulled
|
||||
|
||||
/initqueue/*.sh
|
||||
runs in parallel to the udev trigger
|
||||
Udev events can add scripts here with /sbin/initqueue.
|
||||
If /sbin/initqueue is called with the "--onetime" option, the script
|
||||
will be removed after it was run.
|
||||
If /initqueue/work is created and udev >= 143 then this loop can
|
||||
process the jobs in parallel to the udevtrigger.
|
||||
If the udev queue is empty and no root device is found or no root
|
||||
filesystem was mounted, the user will be dropped to a shell after
|
||||
a timeout.
|
||||
Scripts can remove themselves from the initqueue by "rm $job".
|
||||
|
||||
/pre-mount/*.sh
|
||||
scripts to run before the root filesystem is mounted
|
||||
Network filesystems like NFS that do not use device files are an
|
||||
exception. Root can be mounted already at this point.
|
||||
|
||||
/mount/*.sh
|
||||
scripts to mount the root filesystem
|
||||
If the udev queue is empty and no root device is found or no root
|
||||
filesystem was mounted, the user will be dropped to a shell after
|
||||
a timeout.
|
||||
|
||||
/pre-pivot/*.sh
|
||||
scripts to run before the real init is executed and the initramfs
|
||||
disappears
|
||||
All processes started before should be killed here.
|
||||
|
||||
|
53
debian/changelog
vendored
Normal file
53
debian/changelog
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
dracut (2.26) unstable; urgency=low
|
||||
|
||||
[ Harald Hoyer ]
|
||||
* multipath: install udev rules and helper tools
|
||||
* NEWS update
|
||||
* multipath: install xdr utils
|
||||
* multipath: install multipath kernel module
|
||||
* specfile update
|
||||
* dracut.8: fixed formatting for rootfs and mount options
|
||||
* dracut: check more return codes, check for permissions and use
|
||||
derror
|
||||
* dracut: create initramfs-$(kernelversion).img by default
|
||||
* Makefile: add WITH_SWITCH_ROOT
|
||||
* fips: search different lib paths
|
||||
* kernel-modules: add firewire-ohci to hardcoded modules list
|
||||
* 90dm: install more device mapper kernel modules
|
||||
* specfile update
|
||||
|
||||
[ Peter Jones ]
|
||||
* Use glob for libdir when installing multipath libraries.
|
||||
* Add #!/bin/bash for consistency.
|
||||
* Make sure and get all the multipath related modules.
|
||||
* Bring up multipath devices that are configured in multipath.conf.
|
||||
* Fix missing shell variables.
|
||||
* This has to be executable.
|
||||
* Handle modules with hyphens in their names properly.
|
||||
|
||||
[ Harald Hoyer ]
|
||||
* lvm: scan without monitor
|
||||
|
||||
[ Yanko Kaneti ]
|
||||
* Wildcards need dracut_install
|
||||
|
||||
[ Harald Hoyer ]
|
||||
* lvm/dmraid: make LIBDIR depend on the binary
|
||||
* nfs: install passwd entries for nobody and nfsnobody
|
||||
* nfs: add rd_NFS_DOMAIN parameter to set the NFSv4 domain name
|
||||
* dracut-functions: inst_simple(): do not bail out if target is a dir
|
||||
and exists
|
||||
* dm: install dmsetup
|
||||
* multipath: corrected initqueue parameter
|
||||
* rootfs-block/mount-root: remount root with /etc/fstab filesystem
|
||||
options
|
||||
* test: set PATH
|
||||
|
||||
-- Philippe Seewer <philippe.seewer@.bfh.ch> Fri, 27 Nov 2009 10:58:26 +0100
|
||||
|
||||
dracut (2.21) unstable; urgency=low
|
||||
[ Harald Hoyer ]
|
||||
* fix rd_DASD argument handling (bug #531720)
|
||||
* Resolves: rhbz#531720
|
||||
|
||||
-- Philippe Seewer <philippe.seewer@.bfh.ch> Fri, 06 Nov 2009 15:52:00 +0100
|
1
debian/compat
vendored
Normal file
1
debian/compat
vendored
Normal file
@@ -0,0 +1 @@
|
||||
5
|
41
debian/control
vendored
Normal file
41
debian/control
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
Source: dracut
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Maintainer: Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
Build-Depends: debhelper (>= 5.0), cdbs
|
||||
Standards-Version: 3.8.4
|
||||
Vcs-Browser: http://dracut.git.sourceforge.net/git/gitweb-index.cgi
|
||||
Vcs-Git: git://dracut.git.sourceforge.net/gitroot/dracut/dracut
|
||||
|
||||
Package: dracut
|
||||
Architecture: all
|
||||
Recommends: cryptsetup, dmsetup, dmraid, lvm2, mdadm
|
||||
Suggests: dracut-network
|
||||
Depends: cpio, module-init-tools, udev, ${misc:Depends}
|
||||
Provides: linux-initramfs-tool
|
||||
Description: A new initramfs infrastructure
|
||||
Unlike existing initramfs's, this is an attempt at having as little as
|
||||
possible hard-coded into the initramfs as possible. The initramfs has
|
||||
(basically) one purpose in life -- getting the rootfs mounted so that
|
||||
we can transition to the real rootfs. This is all driven off of
|
||||
device availability. Therefore, instead of scripts hard-coded to do
|
||||
various things, we depend on udev to create device nodes for us and
|
||||
then when we have the rootfs's device node, we mount and carry on.
|
||||
Having the root on MD, LVM2, LUKS is supported as well as NFS, iSCSI,
|
||||
NBD and FCOE with dracut-network.
|
||||
|
||||
Package: dracut-network
|
||||
Architecture: all
|
||||
Recommends: nfs-common, open-iscsi, nbd-client
|
||||
Depends: dracut, iputils-arping, dhcp3-client, ${misc:Depends}
|
||||
Description: A new initramfs infrastucture
|
||||
Unlike existing initramfs's, this is an attempt at having as little as
|
||||
possible hard-coded into the initramfs as possible. The initramfs has
|
||||
(basically) one purpose in life -- getting the rootfs mounted so that
|
||||
we can transition to the real rootfs. This is all driven off of
|
||||
device availability. Therefore, instead of scripts hard-coded to do
|
||||
various things, we depend on udev to create device nodes for us and
|
||||
then when we have the rootfs's device node, we mount and carry on.
|
||||
Having the root on MD, LVM2, LUKS is supported as well as NFS, iSCSI,
|
||||
NBD and FCOE with dracut-network.
|
||||
|
39
debian/copyright
vendored
Normal file
39
debian/copyright
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
This package was debianized by Philippe Seewer <philippe.seewer@bfh.ch> on
|
||||
Fri Nov 20 15:45:00 +0100
|
||||
|
||||
Sources can be downloaded from:
|
||||
|
||||
https://sourceforge.net/projects/dracut/
|
||||
|
||||
Upstream Maintainer:
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
|
||||
Updstream Authors:
|
||||
Victor Lowther <victor.lowther@gmail.com>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
Lance Albertson <lance@osuosl.org>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Quentin Armitage <quentin@armitage.org.uk>
|
||||
Sergey Fionov <fionov@gmail.com>
|
||||
Thilo Bangert <thilo.bangert@gmx.net>
|
||||
|
||||
Copyright:
|
||||
Copyright 2009 Harald Hoyer <harald@redhat.com>
|
||||
|
||||
|
||||
License: GPLv2
|
||||
|
||||
On Debian systems, the complete text of the GNU General Public
|
||||
License version 2 can be found in `/usr/share/common-licenses/GPL-2'.
|
5
debian/dracut-network.dirs
vendored
Normal file
5
debian/dracut-network.dirs
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
usr/share/dracut/modules.d/40network
|
||||
usr/share/dracut/modules.d/95fcoe
|
||||
usr/share/dracut/modules.d/95iscsi
|
||||
usr/share/dracut/modules.d/95nbd
|
||||
usr/share/dracut/modules.d/95nfs
|
5
debian/dracut-network.install
vendored
Normal file
5
debian/dracut-network.install
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
modules.d/40network usr/share/dracut/modules.d
|
||||
modules.d/95fcoe usr/share/dracut/modules.d
|
||||
modules.d/95iscsi usr/share/dracut/modules.d
|
||||
modules.d/95nbd usr/share/dracut/modules.d
|
||||
modules.d/95nfs usr/share/dracut/modules.d
|
25
debian/dracut.dirs
vendored
Normal file
25
debian/dracut.dirs
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
usr/share/dracut
|
||||
usr/share/dracut/modules.d/00dash
|
||||
usr/share/dracut/modules.d/01fips
|
||||
usr/share/dracut/modules.d/60xen
|
||||
usr/share/dracut/modules.d/90crypt
|
||||
usr/share/dracut/modules.d/90dm
|
||||
usr/share/dracut/modules.d/90dmraid
|
||||
usr/share/dracut/modules.d/90kernel-modules
|
||||
usr/share/dracut/modules.d/90lvm
|
||||
usr/share/dracut/modules.d/90mdraid
|
||||
usr/share/dracut/modules.d/90multipath
|
||||
usr/share/dracut/modules.d/95dasd
|
||||
usr/share/dracut/modules.d/95dasd_mod
|
||||
usr/share/dracut/modules.d/95debug
|
||||
usr/share/dracut/modules.d/95resume
|
||||
usr/share/dracut/modules.d/95rootfs-block
|
||||
usr/share/dracut/modules.d/95terminfo
|
||||
usr/share/dracut/modules.d/95udev-rules
|
||||
usr/share/dracut/modules.d/95uswsusp
|
||||
usr/share/dracut/modules.d/95zfcp
|
||||
usr/share/dracut/modules.d/95znet
|
||||
usr/share/dracut/modules.d/98syslog
|
||||
usr/share/dracut/modules.d/99base
|
||||
/var/lib/dracut
|
||||
/etc/dracut.conf.d
|
4
debian/dracut.docs
vendored
Normal file
4
debian/dracut.docs
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
HACKING
|
||||
README.generic
|
||||
README.kernel
|
||||
README.modules
|
28
debian/dracut.install
vendored
Normal file
28
debian/dracut.install
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
dracut usr/sbin
|
||||
dracut-catimages usr/sbin
|
||||
dracut-update-initramfs usr/sbin
|
||||
dracut-gencmdline usr/sbin
|
||||
dracut-functions usr/share/dracut
|
||||
dracut.conf etc
|
||||
modules.d/00dash usr/share/dracut/modules.d
|
||||
modules.d/01fips usr/share/dracut/modules.d
|
||||
modules.d/60xen usr/share/dracut/modules.d
|
||||
modules.d/90crypt usr/share/dracut/modules.d
|
||||
modules.d/90dm usr/share/dracut/modules.d
|
||||
modules.d/90dmraid usr/share/dracut/modules.d
|
||||
modules.d/90kernel-modules usr/share/dracut/modules.d
|
||||
modules.d/90lvm usr/share/dracut/modules.d
|
||||
modules.d/90mdraid usr/share/dracut/modules.d
|
||||
modules.d/90multipath usr/share/dracut/modules.d
|
||||
modules.d/95dasd usr/share/dracut/modules.d
|
||||
modules.d/95dasd_mod usr/share/dracut/modules.d
|
||||
modules.d/95debug usr/share/dracut/modules.d
|
||||
modules.d/95resume usr/share/dracut/modules.d
|
||||
modules.d/95rootfs-block usr/share/dracut/modules.d
|
||||
modules.d/95terminfo usr/share/dracut/modules.d
|
||||
modules.d/95udev-rules usr/share/dracut/modules.d
|
||||
modules.d/95uswsusp usr/share/dracut/modules.d
|
||||
modules.d/95zfcp usr/share/dracut/modules.d
|
||||
modules.d/95znet usr/share/dracut/modules.d
|
||||
modules.d/98syslog usr/share/dracut/modules.d
|
||||
modules.d/99base usr/share/dracut/modules.d
|
4
debian/dracut.manpages
vendored
Normal file
4
debian/dracut.manpages
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
dracut.8
|
||||
dracut.conf.5
|
||||
dracut-catimages.8
|
||||
dracut-gencmdline.8
|
8
debian/dracut.postinst
vendored
Normal file
8
debian/dracut.postinst
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
# Regenerate initramfs when we're `installed`
|
||||
DPKG_MAINTSCRIPT_PACKAGE='' dracut-update-initramfs -u
|
||||
|
||||
#DEBHELPER#
|
1
debian/dracut.triggers
vendored
Normal file
1
debian/dracut.triggers
vendored
Normal file
@@ -0,0 +1 @@
|
||||
interest update-initramfs
|
3
debian/rules
vendored
Executable file
3
debian/rules
vendored
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
include /usr/share/cdbs/1/rules/debhelper.mk
|
243
dracut
243
dracut
@@ -5,8 +5,21 @@
|
||||
# of the various mkinitrd implementations out there
|
||||
#
|
||||
|
||||
# Copyright 2008, Red Hat, Inc. Jeremy Katz <katzj@redhat.com>
|
||||
# GPLv2 header here
|
||||
# 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 <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
|
||||
usage() {
|
||||
@@ -21,18 +34,42 @@ Creates initial ramdisk images for preloading modules
|
||||
-o, --omit [LIST] Omit a space-separated list of dracut modules.
|
||||
-a, --add [LIST] Add a space-separated list of dracut modules.
|
||||
-d, --drivers [LIST] Specify a space-separated list of kernel modules to
|
||||
include in the initramfs.
|
||||
exclusively include in the initramfs.
|
||||
--add-drivers [LIST] Specify a space-separated list of kernel
|
||||
modules to add to the initramfs.
|
||||
--filesystems [LIST] Specify a space-separated list of kernel filesystem
|
||||
modules to exclusively include in the generic
|
||||
initramfs.
|
||||
-k, --kmoddir [DIR] Specify the directory, where to look for kernel
|
||||
modules
|
||||
--fwdir [DIR] Specify additional directories, where to look for
|
||||
firmwares, separated by :
|
||||
--kernel-only Only install kernel drivers and firmware files
|
||||
--no-kernel Do not install kernel drivers and firmware files
|
||||
--ignore-kernel-modules
|
||||
Don't try to load modules. It automatically implies
|
||||
'--no-kernel'. It's assumed that everything needed
|
||||
is built into kernel.
|
||||
--strip Strip binaries in the initramfs
|
||||
--nostrip Do not strip binaries in the initramfs (default)
|
||||
--mdadmconf Include local /etc/mdadm.conf
|
||||
--nomdadmconf Do not include local /etc/mdadm.conf
|
||||
--lvmconf Include local /etc/lvm/lvm.conf
|
||||
--nolvmconf Do not include local /etc/lvm/lvm.conf
|
||||
-h, --help This message
|
||||
--debug Output debug information of the build process
|
||||
-v, --verbose Verbose output during the build process
|
||||
-c, --conf [FILE] Specify configuration file to use.
|
||||
Default: /etc/dracut.conf
|
||||
--confdir [DIR] Specify configuration directory to use *.conf files from.
|
||||
Default: /etc/dracut.conf.d
|
||||
-l, --local Local mode. Use modules from the current working
|
||||
directory instead of the system-wide installed in
|
||||
/usr/share/dracut/modules.d.
|
||||
Useful when running dracut from a git checkout.
|
||||
-H, --hostonly Host-Only mode: Install only what is needed for
|
||||
-H, --hostonly Host-Only mode: Install only what is needed for
|
||||
booting the local host instead of a generic host.
|
||||
--fstab Use /etc/fstab to determine the root device.
|
||||
-i, --include [SOURCE] [TARGET]
|
||||
Include the files in the SOURCE directory into the
|
||||
Target directory in the final initramfs.
|
||||
@@ -44,54 +81,109 @@ Creates initial ramdisk images for preloading modules
|
||||
while (($# > 0)); do
|
||||
case $1 in
|
||||
-f|--force) force=yes;;
|
||||
-m|--modules) dracutmodules_l="$2"; shift;;
|
||||
-o|--omit) omit_dracutmodules_l="$2"; shift;;
|
||||
-a|--add) add_dracutmodules_l="$2"; shift;;
|
||||
-d|--drivers) drivers_l="$2"; shift;;
|
||||
-m|--modules) dracutmodules_l="$dracutmodules_l $2"; shift;;
|
||||
-o|--omit) omit_dracutmodules_l="$omit_dracutmodules_l $2"; shift;;
|
||||
-a|--add) add_dracutmodules_l="$add_dracutmodules_l $2"; shift;;
|
||||
-d|--drivers) drivers_l="$drivers_l $2"; shift;;
|
||||
--add-drivers) add_drivers_l="$add_drivers_l $2"; shift;;
|
||||
--filesystems) filesystems_l="$filesystems_l $2"; shift;;
|
||||
-k|--kmoddir) drivers_dir_l="$2"; shift;;
|
||||
--fwdir) fw_dir_l="$fw_dir_l:$2"; shift;;
|
||||
--kernel-only) kernel_only="yes"; no_kernel="no";;
|
||||
--no-kernel) kernel_only="no"; no_kernel="yes";;
|
||||
--ignore-kernel-modules) kernel_only="no"; no_kernel="yes"
|
||||
ignore_kmodules="yes"
|
||||
omit_dracutmodules_l+=\ kernel-modules
|
||||
;;
|
||||
--strip) do_strip_l="yes";;
|
||||
--nostrip) do_strip_l="no";;
|
||||
--mdadmconf) mdadmconf_l="yes";;
|
||||
--nomdadmconf) mdadmconf_l="no";;
|
||||
--lvmconf) lvmconf_l="yes";;
|
||||
--nolvmconf) lvmconf_l="no";;
|
||||
-h|--help) usage; exit 1 ;;
|
||||
--debug) debug="yes";;
|
||||
-v|--verbose) beverbose="yes";;
|
||||
-c|--conf) conffile="$2"; shift;;
|
||||
--confdir) confdir="$2"; shift;;
|
||||
-l|--local) allowlocal="yes" ;;
|
||||
-H|--hostonly) hostonly="-h" ;;
|
||||
-H|--hostonly) hostonly_l="yes" ;;
|
||||
--fstab) use_fstab_l="yes" ;;
|
||||
-i|--include) include_src="$2"; include_target="$3"; shift 2;;
|
||||
-I|--install) install_items="$2"; shift;;
|
||||
-*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
|
||||
*) break ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
export PATH
|
||||
|
||||
[[ $debug ]] && {
|
||||
export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
|
||||
set -x
|
||||
}
|
||||
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
|
||||
|
||||
[[ $allowlocal && -f "$(readlink -f $(dirname $0))/dracut-functions" ]] && dracutbasedir="$(dirname $0)"
|
||||
|
||||
# if we were not passed a config file, try the default one
|
||||
[[ ! -f $conffile ]] && conffile="/etc/dracut.conf"
|
||||
if [[ ! -f $conffile ]]; then
|
||||
[[ $allowlocal ]] || conffile="/etc/dracut.conf"
|
||||
[[ $allowlocal ]] && conffile="$dracutbasedir/dracut.conf"
|
||||
fi
|
||||
|
||||
if [[ ! -d $confdir ]]; then
|
||||
[[ $allowlocal ]] || confdir="/etc/dracut.conf.d"
|
||||
[[ $allowlocal ]] && confdir="$dracutbasedir/dracut.conf.d"
|
||||
fi
|
||||
|
||||
# source our config file
|
||||
[[ -f $conffile ]] && . "$conffile"
|
||||
|
||||
# source our config dir
|
||||
if [ "$confdir" ] && [ -d "$confdir" ]; then
|
||||
for f in "$confdir"/*.conf; do
|
||||
[ -e "$f" ] && . "$f"
|
||||
done
|
||||
fi
|
||||
|
||||
# these optins add to the stuff in the config file
|
||||
[[ $add_dracutmodules_l ]] && add_dracutmodules+=" $add_dracutmodules_l"
|
||||
[[ $add_drivers_l ]] && add_drivers+=" $add_drivers_l"
|
||||
|
||||
# these options override the stuff in the config file
|
||||
[[ $dracutmodules_l ]] && dracutmodules=$dracutmodules_l
|
||||
[[ $omit_dracutmodules_l ]] && omit_dracutmodules=$omit_dracutmodules_l
|
||||
[[ $add_dracutmodules_l ]] && add_dracutmodules="$add_dracutmodules $add_dracutmodules_l"
|
||||
[[ $drivers_l ]] && drivers=$drivers_l
|
||||
[[ $filesystems_l ]] && filesystems=$filesystems_l
|
||||
[[ $drivers_dir_l ]] && drivers_dir=$drivers_dir_l
|
||||
[[ $fw_dir_l ]] && fw_dir=$fw_dir_l
|
||||
[[ $do_strip_l ]] && do_strip=$do_strip_l
|
||||
[[ $hostonly_l ]] && hostonly=$hostonly_l
|
||||
[[ $use_fstab_l ]] && use_fstab=$use_fstab_l
|
||||
[[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l
|
||||
[[ $lvmconf_l ]] && lvmconf=$lvmconf_l
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
|
||||
[[ $fw_dir ]] || fw_dir=/lib/firmware
|
||||
[[ $do_strip ]] || do_strip=no
|
||||
# eliminate IFS hackery when messing with fw_dir
|
||||
fw_dir=${fw_dir//:/ }
|
||||
|
||||
[[ $allowlocal && -f "$(dirname $0)/dracut-functions" ]] && dsrc="$(dirname $0)" || dsrc=$dracutbasedir
|
||||
[[ $hostonly = yes ]] && hostonly="-h"
|
||||
[[ $hostonly != "-h" ]] && unset hostonly
|
||||
|
||||
if [[ -f $dsrc/dracut-functions ]]; then
|
||||
. $dsrc/dracut-functions
|
||||
if [[ -f $dracutbasedir/dracut-functions ]]; then
|
||||
. $dracutbasedir/dracut-functions
|
||||
else
|
||||
echo "Cannot find $dsrc/dracut-functions. Are you running from a git checkout?"
|
||||
echo "Cannot find $dracutbasedir/dracut-functions. Are you running from a git checkout?"
|
||||
echo "Try passing -l as an argument to $0"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dracutfunctions=$dsrc/dracut-functions
|
||||
dracutfunctions=$dracutbasedir/dracut-functions
|
||||
export dracutfunctions
|
||||
|
||||
# This is kinda legacy -- eventually it should go away.
|
||||
@@ -100,56 +192,95 @@ case $dracutmodules in
|
||||
esac
|
||||
|
||||
[[ $2 ]] && kernel=$2 || kernel=$(uname -r)
|
||||
[[ $1 ]] && outfile=$(readlink -f $1) || outfile="/boot/initrd-$kernel.img"
|
||||
[[ $1 ]] && outfile=$1 || outfile="/boot/initramfs-$kernel.img"
|
||||
abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile"
|
||||
|
||||
srcmods="/lib/modules/$kernel/"
|
||||
[[ $drivers_dir ]] && {
|
||||
if vercmp $(modprobe --version | cut -d' ' -f3) lt 3.7; then
|
||||
derror 'To use --kmoddir option module-init-tools >= 3.7 is required.'
|
||||
exit 1
|
||||
fi
|
||||
srcmods="$drivers_dir"
|
||||
}
|
||||
export srcmods
|
||||
|
||||
if [[ -f $outfile && ! $force ]]; then
|
||||
echo "Will not override existing initramfs ($outfile) without --force"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
outdir=$(dirname "$outfile")
|
||||
if ! [[ -d "$outdir" ]]; then
|
||||
echo "Can't write $outfile: Directory $outdir does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [[ -w "$outdir" ]]; then
|
||||
echo "No permission to write $outdir."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -f "$outfile" ]] && ! [[ -w "$outfile" ]]; then
|
||||
echo "No permission to write $outfile."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
hookdirs="cmdline pre-udev pre-trigger netroot pre-mount pre-pivot mount emergency"
|
||||
|
||||
[[ -n "$TMPDIR" ]] && ! [[ -w "$TMPDIR" ]] && unset TMPDIR
|
||||
readonly initdir=$(mktemp -d -t initramfs.XXXXXX)
|
||||
trap 'rm -rf "$initdir"' 0 # clean up after ourselves no matter how we die.
|
||||
|
||||
trap 'ret=$?;rm -rf "$initdir";exit $ret;' EXIT # clean up after ourselves no matter how we die.
|
||||
trap 'exit 1;' SIGINT # clean up after ourselves no matter how we die.
|
||||
|
||||
# Need to be able to have non-root users read stuff (rpcbind etc)
|
||||
chmod 755 "$initdir"
|
||||
|
||||
export initdir hookdirs dsrc dracutmodules drivers debug beverbose
|
||||
export initdir hookdirs dracutbasedir dracutmodules drivers \
|
||||
fw_dir drivers_dir debug beverbose no_kernel kernel_only \
|
||||
add_drivers mdadmconf lvmconf filesystems ignore_kmodules \
|
||||
use_fstab
|
||||
|
||||
# Create some directory structure first
|
||||
for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot tmp dev/pts var/run; do
|
||||
mkdir -p "$initdir/$d";
|
||||
done
|
||||
if [[ $kernel_only != yes ]]; then
|
||||
# Create some directory structure first
|
||||
for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot tmp dev/pts var/run; do
|
||||
inst_dir "/$d";
|
||||
done
|
||||
fi
|
||||
|
||||
# check all our modules to see if they should be sourced.
|
||||
# This builds a list of modules that we will install next.
|
||||
check_modules
|
||||
|
||||
#source our modules.
|
||||
for moddir in "$dsrc/modules.d"/[0-9][0-9]*; do
|
||||
# source our modules.
|
||||
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||
mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
|
||||
if strstr "$mods_to_load" " $mod "; then
|
||||
. "$moddir/install"
|
||||
dinfo "*** Sourcing module $mod"
|
||||
if [[ $kernel_only = yes ]]; then
|
||||
[[ -x $moddir/installkernel ]] && . "$moddir/installkernel"
|
||||
else
|
||||
. "$moddir/install"
|
||||
if [[ $no_kernel != yes && -x $moddir/installkernel ]]; then
|
||||
. "$moddir/installkernel"
|
||||
fi
|
||||
fi
|
||||
mods_to_load=${mods_to_load// $mod /}
|
||||
fi
|
||||
done
|
||||
unset moddir
|
||||
echo $mods_to_load
|
||||
|
||||
## final stuff that has to happen
|
||||
|
||||
# generate module dependencies for the initrd
|
||||
if [ -d "$initdir/lib/modules/$kernel" ]; then
|
||||
if [[ -d $initdir/lib/modules/$kernel ]]; then
|
||||
if ! depmod -a -b "$initdir" $kernel; then
|
||||
echo "\"depmod -a $kernel\" failed."
|
||||
derror "\"depmod -a $kernel\" failed."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# make sure that library links are correct and up to date
|
||||
ldconfig -n -r "$initdir" /lib* /usr/lib*
|
||||
|
||||
if [[ $include_src && $include_target ]]; then
|
||||
mkdir -p "$initdir$include_target"
|
||||
cp -a -t "$initdir$include_target" "$include_src"/*
|
||||
@@ -160,11 +291,51 @@ for item in $install_items; do
|
||||
done
|
||||
unset item
|
||||
|
||||
[[ "$beverbose" = "yes" ]] && (du -c "$initdir" | sort -n)
|
||||
# make sure that library links are correct and up to date
|
||||
cp -ar /etc/ld.so.conf* "$initdir"/etc
|
||||
ldconfig -r "$initdir" || [[ $(id -u) != "0" ]] && dinfo "ldconfig might need uid=0 (root) for chroot()"
|
||||
|
||||
( cd "$initdir"; find . |cpio -H newc -o |gzip -9 > "$outfile"; )
|
||||
[[ $beverbose = yes ]] && (du -c "$initdir" | sort -n)
|
||||
|
||||
[[ "$beverbose" = "yes" ]] && ls -lh "$outfile"
|
||||
# strip binaries
|
||||
if [[ $do_strip = yes ]] ; then
|
||||
for p in strip grep find; do
|
||||
if ! which $p >/dev/null 2>&1; then
|
||||
derror "Could not find '$p'. You should run $0 with '--nostrip'."
|
||||
do_strip=no
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ $do_strip = yes ]] ; then
|
||||
for f in $(find "$initdir" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 -or -path '*/lib/modules/*.ko' \) ); do
|
||||
dinfo "Stripping $f"
|
||||
strip -g "$f" 2>/dev/null|| :
|
||||
#
|
||||
# FIXME: only strip -g for now
|
||||
#
|
||||
#strip -g --strip-unneeded "$f" || :
|
||||
#note="-R .note"
|
||||
#if objdump -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \
|
||||
# grep -q ALLOC; then
|
||||
# note=
|
||||
#fi
|
||||
#strip -R .comment $note "$f" || :
|
||||
done
|
||||
fi
|
||||
|
||||
type hardlink &>/dev/null && {
|
||||
hardlink "$initdir" 2>&1
|
||||
}
|
||||
|
||||
type pigz &>/dev/null && gzip=pigz || gzip=gzip
|
||||
( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet |$gzip -9 > "$outfile"; )
|
||||
if [ $? -ne 0 ]; then
|
||||
derror "dracut: creation of $outfile failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
[[ $beverbose = yes ]] && ls -lh "$outfile"
|
||||
|
||||
exit 0
|
||||
|
||||
|
127
dracut-catimages
Executable file
127
dracut-catimages
Executable file
@@ -0,0 +1,127 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
# Copyright 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 <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
|
||||
dwarning() {
|
||||
echo "Warning: $@" >&2
|
||||
}
|
||||
|
||||
dinfo() {
|
||||
[[ $beverbose ]] && echo "$@" >&2
|
||||
}
|
||||
|
||||
derror() {
|
||||
echo "Error: $@" >&2
|
||||
}
|
||||
|
||||
usage() {
|
||||
# 80x25 linebreak here ^
|
||||
echo "Usage: $0 [OPTION]... <initramfs> <base image> [<image>...]
|
||||
Creates initial ramdisk image by concatenating several images from the command
|
||||
line and /boot/dracut/
|
||||
|
||||
-f, --force Overwrite existing initramfs file.
|
||||
-i, --imagedir Directory with additional images to add
|
||||
(default: /boot/dracut/)
|
||||
-o, --overlaydir Overlay directory, which contains files that
|
||||
will be used to create an additional image
|
||||
--nooverlay Do not use the overlay directory
|
||||
--noimagedir Do not use the additional image directory
|
||||
-h, --help This message
|
||||
--debug Output debug information of the build process
|
||||
-v, --verbose Verbose output during the build process
|
||||
"
|
||||
}
|
||||
|
||||
|
||||
imagedir=/boot/dracut/
|
||||
overlay=/var/lib/dracut/overlay
|
||||
|
||||
while (($# > 0)); do
|
||||
case $1 in
|
||||
-f|--force) force=yes;;
|
||||
-i|--imagedir) imagedir=$2;shift;;
|
||||
-o|--overlaydir) overlay=$2;shift;;
|
||||
--nooverlay) no_overlay=yes;shift;;
|
||||
--noimagedir) no_imagedir=yes;shift;;
|
||||
-h|--help) usage; exit 1 ;;
|
||||
--debug) debug="yes";;
|
||||
-v|--verbose) beverbose="yes";;
|
||||
-*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
|
||||
*) break ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
outfile=$1; shift
|
||||
|
||||
if [[ -z $outfile ]]; then
|
||||
derror "No output file specified."
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
baseimage=$1; shift
|
||||
|
||||
if [[ -z $baseimage ]]; then
|
||||
derror "No base image specified."
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -f $outfile && ! $force ]]; then
|
||||
derror "Will not override existing initramfs ($outfile) without --force"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! $no_imagedir && ! -d $imagedir ]]; then
|
||||
derror "Image directory $overlay is not a directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! $no_overlay && ! -d $overlay ]]; then
|
||||
derror "Overlay $overlay is not a directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! $no_overlay ]]; then
|
||||
ofile="$imagedir/90-overlay.img"
|
||||
dinfo "Creating image $ofile from directory $overlay"
|
||||
type pigz &>/dev/null && gzip=pigz || gzip=gzip
|
||||
( cd "$overlay"; find . |cpio --quiet -H newc -o |$gzip -9 > "$ofile"; )
|
||||
fi
|
||||
|
||||
if [[ ! $no_imagedir ]]; then
|
||||
for i in "$imagedir/"*.img; do
|
||||
[[ -f $i ]] && images+=("$i")
|
||||
done
|
||||
fi
|
||||
|
||||
images+=($@)
|
||||
|
||||
dinfo "Using base image $baseimage"
|
||||
cat "$baseimage" > "$outfile"
|
||||
|
||||
for i in "${images[@]}"; do
|
||||
dinfo "Appending $i"
|
||||
cat "$i" >> "$outfile"
|
||||
done
|
||||
|
||||
dinfo "Created $outfile"
|
||||
|
||||
exit 0
|
116
dracut-catimages.8.xml
Normal file
116
dracut-catimages.8.xml
Normal file
@@ -0,0 +1,116 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
|
||||
<!-- lifted from troff+man by doclifter -->
|
||||
<refentry id='dracutcatimages8'>
|
||||
<refmeta>
|
||||
<refentrytitle>DRACUT-CATIMAGES</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
<refmiscinfo class='source'>June 2009</refmiscinfo>
|
||||
<refmiscinfo class='manual'>Linux</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>dracut-catimages</refname>
|
||||
<refpurpose>creates initial ramdisk image by concatenating images</refpurpose>
|
||||
</refnamediv>
|
||||
<!-- body begins here -->
|
||||
<refsynopsisdiv id='synopsis'>
|
||||
<cmdsynopsis>
|
||||
<command>dracut-catimages</command> <arg choice='opt' rep='repeat'><replaceable>OPTION</replaceable></arg>
|
||||
<arg choice='plain'><replaceable><initramfs</replaceable></arg>
|
||||
<arg choice='plain'><replaceable>base</replaceable></arg>
|
||||
<arg choice='plain'><replaceable>image></replaceable></arg>
|
||||
<arg choice='opt' rep='repeat'><replaceable><image></replaceable></arg>
|
||||
<sbr/>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
|
||||
<refsect1 id='description'><title>DESCRIPTION</title>
|
||||
<para><command>dracut-catimages</command>
|
||||
creates an initial ramdisk image by concatenating several images from the command
|
||||
line and /boot/dracut/*.img</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='options'><title>OPTIONS</title>
|
||||
<variablelist remap='TP'>
|
||||
<varlistentry>
|
||||
<term><option>-f</option>, <option>--force</option></term>
|
||||
<listitem>
|
||||
<para>overwrite existing initramfs file.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>-i</option>, <option>--imagedir</option></term>
|
||||
<listitem>
|
||||
<para>Directory with additional images to add (default: /boot/dracut/)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>-o</option>, <option>--overlaydir</option></term>
|
||||
<listitem>
|
||||
<para>Overlay directory, which contains additional files that will be used to create an additional image</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>--nooverlay</option></term>
|
||||
<listitem>
|
||||
<para>Do not use the overlay directory</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>--noimagedir</option></term>
|
||||
<listitem>
|
||||
<para>Do not use the additional image directory</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>-h</option>, <option>--help</option></term>
|
||||
<listitem>
|
||||
<para>display help text and exit.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>--debug</option></term>
|
||||
<listitem>
|
||||
<para>output debug information of the build process</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>-v</option>, <option>--verbose</option></term>
|
||||
<listitem>
|
||||
<para>verbose output during the build process</para>
|
||||
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='files'><title>FILES</title>
|
||||
<variablelist remap='TP'>
|
||||
<varlistentry>
|
||||
<term><filename>/boot/dracut/*.img</filename></term>
|
||||
<listitem>
|
||||
<para></para> <!-- FIXME: blank list item -->
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='authors'><title>AUTHORS</title>
|
||||
<literallayout remap='.nf'>
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
</literallayout> <!-- .fi -->
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='availability'><title>AVAILABILITY</title>
|
||||
<para>The dracut-catimages command is part of the dracut package and is available from
|
||||
<ulink url='http://sourceforge.net/apps/trac/dracut/wiki'>http://sourceforge.net/apps/trac/dracut/wiki</ulink></para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='see_also'><title>SEE ALSO</title>
|
||||
<para><citerefentry><refentrytitle>dracut</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
566
dracut-functions
566
dracut-functions
@@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# functions used by mkinitrd and other tools.
|
||||
# functions used by dracut and other tools.
|
||||
#
|
||||
# Copyright 2005-2008 Red Hat, Inc. All rights reserved.
|
||||
# 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
|
||||
@@ -17,39 +17,225 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Authors:
|
||||
# Peter Jones <pjones@redhat.com>
|
||||
# Jeremy Katz <katzj@redhat.com>
|
||||
# Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
IF_RTLD=""
|
||||
IF_dynamic=""
|
||||
|
||||
# Generic substring function. If $2 is in $1, return 0.
|
||||
strstr() { [[ ! ${1#*$2*} = $1 ]]; }
|
||||
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
|
||||
}
|
||||
|
||||
# Log initrd creation.
|
||||
if ! [[ $dracutlogfile ]]; then
|
||||
[[ $dsrc = /usr/share/dracut ]] && \
|
||||
dracutlogfile=/var/log/dracut.log || \
|
||||
dracutlogfile=/tmp/dracut.log
|
||||
[[ -w "$dracutlogfile" ]] || dracutlogfile=/tmp/dracut.log
|
||||
>"$dracutlogfile"
|
||||
[[ $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"
|
||||
[[ -w $dracutlogfile ]] && echo "W: $@" >>"$dracutlogfile"
|
||||
}
|
||||
|
||||
dinfo() {
|
||||
[[ $beverbose ]] && echo "I: $@" >&2
|
||||
[[ -w "$dracutlogfile" ]] && echo "I: $@" >>"$dracutlogfile"
|
||||
[[ -w $dracutlogfile ]] && echo "I: $@" >>"$dracutlogfile"
|
||||
}
|
||||
|
||||
derror() {
|
||||
echo "E: $@" >&2
|
||||
[[ -w "$dracutlogfile" ]] && echo "E: $@" >>"$dracutlogfile"
|
||||
[[ -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 misc; do
|
||||
[[ $fs = nfs ]] && { echo $dev; return 0;}
|
||||
[[ $fs = nfs3 ]] && { echo $dev; return 0;}
|
||||
[[ $fs = nfs4 ]] && { echo $dev; 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
|
||||
[ -z "$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
|
||||
@@ -59,35 +245,70 @@ derror() {
|
||||
inst_simple() {
|
||||
local src target
|
||||
[[ -f $1 ]] || return 1
|
||||
src=$1 target="${initdir}${2:-$1}"
|
||||
[[ -f $target ]] && return 0
|
||||
mkdir -p "${target%/*}"
|
||||
src=$1 target="${2:-$1}"
|
||||
if ! [[ -d ${initdir}$target ]]; then
|
||||
[[ -e ${initdir}$target ]] && return 0
|
||||
inst_dir "${target%/*}"
|
||||
fi
|
||||
dinfo "Installing $src"
|
||||
cp -fL "$src" "$target"
|
||||
cp -pfL "$src" "${initdir}$target"
|
||||
}
|
||||
|
||||
# Same as above, but specialzed to handle dynamic libraries.
|
||||
# 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}
|
||||
[[ -f $initdir$dest ]] && return 0
|
||||
local src=$1 dest=${2:-$1} lib reallib symlink
|
||||
[[ -e $initdir$dest ]] && return 0
|
||||
if [[ -L $src ]]; then
|
||||
reallib="$(readlink -f "$src")"
|
||||
reallib=$(readlink -f "$src")
|
||||
lib=${src##*/}
|
||||
inst_simple "$reallib" "$reallib"
|
||||
mkdir -p ${initdir}${dest%/*}
|
||||
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
|
||||
[[ -x $1 ]] && { echo $1; return 0; }
|
||||
[[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; }
|
||||
for p in $binpath; do
|
||||
[[ -x $p/$1 ]] && { echo "$p/$1"; return 0; }
|
||||
done
|
||||
@@ -100,10 +321,11 @@ 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
|
||||
[[ -f $initdir$target ]] && return 0
|
||||
[[ -e $initdir$target ]] && return 0
|
||||
# I love bash!
|
||||
ldd $bin 2>/dev/null | while read line; do
|
||||
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."
|
||||
@@ -111,21 +333,23 @@ inst_binary() {
|
||||
derror "dracut cannot create an initrd."
|
||||
exit 1
|
||||
fi
|
||||
[[ $line =~ ([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*) ]] || continue
|
||||
so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)'
|
||||
[[ $line =~ $so_regex ]] || continue
|
||||
FILE=${BASH_REMATCH[1]}
|
||||
[[ -f ${initdir}$FILE ]] && continue
|
||||
[[ -e ${initdir}$FILE ]] && continue
|
||||
# see if we are loading an optimized version of a shared lib.
|
||||
if [[ $FILE =~ ^(/lib[^/]*).* ]]; then
|
||||
lib_regex='^(/lib[^/]*).*'
|
||||
if [[ $FILE =~ $lib_regex ]]; then
|
||||
TLIBDIR=${BASH_REMATCH[1]}
|
||||
BASE="${FILE##*/}"
|
||||
BASE=${FILE##*/}
|
||||
# prefer nosegneg libs, then unoptimized ones.
|
||||
for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do
|
||||
[[ -f $f/$BASE ]] || continue
|
||||
FILE="$f/$BASE"
|
||||
[[ -e $f/$BASE ]] || continue
|
||||
FILE=$f/$BASE
|
||||
break
|
||||
done
|
||||
inst_library "$FILE" "$TLIBDIR/$BASE"
|
||||
IF_dynamic="yes"
|
||||
IF_dynamic=yes
|
||||
continue
|
||||
fi
|
||||
inst_library "$FILE"
|
||||
@@ -141,7 +365,8 @@ inst_script() {
|
||||
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:]')
|
||||
[[ $line =~ (#! *)(/[^ ]+).* ]] || return 1
|
||||
shebang_regex='(#! *)(/[^ ]+).*'
|
||||
[[ $line =~ $shebang_regex ]] || return 1
|
||||
inst "${BASH_REMATCH[2]}" && inst_simple "$@"
|
||||
}
|
||||
|
||||
@@ -151,14 +376,14 @@ inst_symlink() {
|
||||
[[ -L $1 ]] || return 1
|
||||
[[ -L $target ]] && return 0
|
||||
realsrc=$(readlink -f "$src")
|
||||
[[ $realsrc = ${realsrc##*/} ]] && realsrc="${src%/*}/$realsrc"
|
||||
[[ $realsrc = ${realsrc##*/} ]] && realsrc=${src%/*}/$realsrc
|
||||
inst "$realsrc" && ln -s "$realsrc" "$target"
|
||||
}
|
||||
|
||||
# find a rule in the usual places.
|
||||
# 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 $dsrc/rules.d; do
|
||||
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
|
||||
@@ -167,21 +392,35 @@ find_rule() {
|
||||
# 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"
|
||||
mkdir -p "$initdir/lib/udev/rules.d" "$initdir$target"
|
||||
local target=/etc/udev/rules.d rule found
|
||||
|
||||
inst_dir "/lib/udev/rules.d"
|
||||
inst_dir "$target"
|
||||
for rule in "$@"; do
|
||||
rule=$(find_rule $rule) && \
|
||||
inst_simple "$rule" "$target/${rule##*/}"
|
||||
found=$(find_rule "$rule") && \
|
||||
inst_simple "$found" "$target/${found##*/}" \
|
||||
|| dinfo "Skipping udev rule: $rule"
|
||||
done
|
||||
}
|
||||
|
||||
# general purpose installation function
|
||||
# Same args as above.
|
||||
inst() {
|
||||
if (($# != 1 && $# != 2 )); then
|
||||
derror "inst only takes 1 or 2 arguments"
|
||||
exit 1
|
||||
fi
|
||||
case $# in
|
||||
1) ;;
|
||||
2)
|
||||
[[ -z $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
|
||||
@@ -204,21 +443,77 @@ inst_hook() {
|
||||
}
|
||||
|
||||
dracut_install() {
|
||||
if [[ $1 = '-o' ]]; then
|
||||
local optional=yes
|
||||
shift
|
||||
fi
|
||||
while (($# > 0)); do
|
||||
if inst "$1" ; then
|
||||
shift
|
||||
continue
|
||||
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
|
||||
derror "Failed to install $1"; exit 1
|
||||
|
||||
# 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
|
||||
}
|
||||
|
||||
check_module_deps() {
|
||||
local moddir dep ret
|
||||
# if we are already set to be loaded, we do not have to be checked again.
|
||||
strstr "$mods_to_load" " $1 "
|
||||
strstr " $mods_to_load " " $1 " && return
|
||||
strstr " $omit_dracutmodules " " $1 " && return 1
|
||||
# turn a module name into a directory, if we can.
|
||||
moddir=$(echo ${dsrc}/modules.d/??${1})
|
||||
moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
[[ -d $moddir && -x $moddir/install ]] || return 1
|
||||
# if we do not have a check script, we are unconditionally included
|
||||
if [[ -x $moddir/check ]]; then
|
||||
@@ -237,43 +532,138 @@ check_module_deps() {
|
||||
|
||||
should_source_module() {
|
||||
local dep
|
||||
[[ -x $1/install ]] || return 1
|
||||
local ret
|
||||
if [[ $kernel_only = yes ]]; then
|
||||
[[ -x $1/installkernel ]] && return 0
|
||||
return 1
|
||||
fi
|
||||
[[ -x $1/install ]] || [[ -x $1/installkernel ]] || return 1
|
||||
[[ -x $1/check ]] || return 0
|
||||
"$1/check" $hostonly || return 1
|
||||
"$1/check" $hostonly || continue
|
||||
for dep in $("$1/check" -d); do
|
||||
check_module_deps "$dep" && continue
|
||||
dwarning "Cannot load $mod, dependencies failed."
|
||||
dwarning "Cannot load dracut module \"$mod\", dependencies failed."
|
||||
return 1
|
||||
done
|
||||
}
|
||||
|
||||
check_modules() {
|
||||
for moddir in "$dsrc/modules.d"/[0-9][0-9]*; do
|
||||
local modcheck;
|
||||
local mod;
|
||||
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||
local mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
|
||||
# If we are already scheduled to be loaded, no need to check again.
|
||||
strstr "$mods_to_load" " $mod " && continue
|
||||
strstr " $mods_to_load " " $mod " && continue
|
||||
# This should never happen, but...
|
||||
[[ -d $moddir ]] || continue
|
||||
[[ $dracutmodules != all ]] && ! strstr "$dracutmodules" "$mod" && \
|
||||
continue
|
||||
strstr "$omit_dracutmodules" "$mod" && continue
|
||||
if ! strstr "$add_dracutmodules" "$mod"; then
|
||||
should_source_module "$moddir" || continue
|
||||
strstr " $omit_dracutmodules " " $mod " && continue
|
||||
|
||||
if ! strstr " $dracutmodules $add_dracutmodules " " $mod "; then
|
||||
# module not in our list
|
||||
if [[ $dracutmodules = all ]]; then
|
||||
# check, if we can install this module
|
||||
should_source_module "$moddir" || continue
|
||||
else
|
||||
# skip this module
|
||||
continue
|
||||
fi
|
||||
else
|
||||
if [ -x "$moddir/check" ] \
|
||||
&& "$moddir/check" -d > /dev/null 2>&1; then
|
||||
check_module_deps "$mod" || {
|
||||
dwarning "Cannot load dracut module \"$mod\", dependencies failed."
|
||||
continue
|
||||
}
|
||||
fi
|
||||
fi
|
||||
|
||||
mods_to_load+=" $mod "
|
||||
done
|
||||
|
||||
modcheck=$add_dracutmodules
|
||||
[[ $dracutmodules != all ]] && modcheck="$m $dracutmodules"
|
||||
for mod in $modcheck; do
|
||||
strstr " $mods_to_load " " $mod " && continue
|
||||
strstr " $omit_dracutmodules " " $mod " && continue
|
||||
dwarning "Dracut module \"$mod\" cannot be found."
|
||||
done
|
||||
}
|
||||
|
||||
# install kernel modules, and handle installing all their dependencies as well.
|
||||
# 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" -name "*.ko" -o -name "*.ko.gz"'
|
||||
else
|
||||
filtercmd='cut -d " " -f 1 </proc/modules|xargs modinfo -F filename -k $kernel'
|
||||
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() {
|
||||
local mod mpargs modpath modname cmd
|
||||
local srcmods="/lib/modules/$kernel/"
|
||||
[[ $no_kernel = yes ]] && return
|
||||
local mod mpargs modpath modname cmd moddirname
|
||||
while (($# > 0)); do
|
||||
mod=${1%.ko}
|
||||
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" -a -f $srcmods/modules.block ] ; then
|
||||
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#=} )
|
||||
@@ -281,39 +671,35 @@ instmods() {
|
||||
instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*")
|
||||
fi
|
||||
;;
|
||||
--*) mpargs+=" $mod";;
|
||||
--*)
|
||||
mod=${mod##*/}
|
||||
mpargs+=" $mod";;
|
||||
i2o_scsi)
|
||||
# Must never run this diagnostic-only module
|
||||
shift; continue;
|
||||
;;
|
||||
*) mod=${mod##*/}
|
||||
# if we are already installed, skip this module and go on
|
||||
*)
|
||||
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 -q "$mod" /proc/modules && {
|
||||
[[ $hostonly ]] && ! grep -qe "\<${mod//-/_}\>" /proc/modules && \
|
||||
! echo $add_drivers | grep -qe "\<${mod}\>" && {
|
||||
shift; continue;
|
||||
}
|
||||
modprobe $mpargs --ignore-install --set-version $kernel \
|
||||
--show-depends $mod 2>/dev/null | \
|
||||
while read cmd modpath options; do
|
||||
[[ $cmd = insmod ]] || continue
|
||||
modname=${modpath##*/}
|
||||
modname=${modname%.ko}
|
||||
if [[ ${mod/-/_} != ${modname/-/_} ]]; then
|
||||
dinfo "Installing dependencies for $mod ($modpath)"
|
||||
instmods $mpargs $modname
|
||||
fi
|
||||
inst_simple "$modpath"
|
||||
done
|
||||
for fw in $(modinfo -F firmware $mod 2>/dev/null); do
|
||||
if [[ -f /lib/firmware/$fw ]]; then
|
||||
inst_simple "/lib/firmware/$fw"
|
||||
else
|
||||
dwarning "Possible missing firmware /lib/firmware/${fw} for module ${mod}.ko"
|
||||
fi
|
||||
done
|
||||
|
||||
# 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
|
||||
|
715
dracut-gencmdline
Executable file
715
dracut-gencmdline
Executable file
@@ -0,0 +1,715 @@
|
||||
#!/bin/bash --norc
|
||||
#
|
||||
# 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 <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# code taken from mkinitrd
|
||||
#
|
||||
#. /usr/libexec/initrd-functions
|
||||
|
||||
IF_verbose=""
|
||||
function set_verbose() {
|
||||
case $1 in
|
||||
1|true|yes|on)
|
||||
IF_verbose="-v"
|
||||
;;
|
||||
0|false|no|off)
|
||||
IF_verbose=""
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function is_verbose() {
|
||||
[ -n "$IF_verbose" ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
function get_verbose() {
|
||||
echo "$IF_verbose"
|
||||
is_verbose
|
||||
}
|
||||
|
||||
|
||||
function get_numeric_dev() {
|
||||
(
|
||||
fmt="%d:%d"
|
||||
if [ "$1" == "hex" ]; then
|
||||
fmt="%x:%x"
|
||||
fi
|
||||
ls -lH "$2" | awk '{ sub(/,/, "", $5); printf("'"$fmt"'", $5, $6); }'
|
||||
) 2>/dev/null
|
||||
}
|
||||
|
||||
|
||||
function error() {
|
||||
echo "$@" >&2
|
||||
}
|
||||
|
||||
function vecho() {
|
||||
is_verbose && echo "$@"
|
||||
}
|
||||
|
||||
# module dep finding and installation functions
|
||||
moduledep() {
|
||||
MPARGS=""
|
||||
if [ "$1" == "--ignore-install" ]; then
|
||||
MPARGS="$MPARGS --ignore-install"
|
||||
shift
|
||||
fi
|
||||
vecho -n "Looking for deps of module $1"
|
||||
deps=""
|
||||
deps=$(modprobe $MPARGS --set-version $kernel --show-depends $1 2>/dev/null| awk '/^insmod / { print gensub(".*/","","g",$2) }' | while read foo ; do [ "${foo%%.ko}" != "$1" ] && echo -n "${foo%%.ko} " ; done)
|
||||
[ -n "$deps" ] && vecho ": $deps" || vecho
|
||||
}
|
||||
|
||||
export MALLOC_PERTURB_=204
|
||||
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
|
||||
export PATH
|
||||
|
||||
# Set the umask. For iscsi, the initrd can contain plaintext
|
||||
# password (chap secret), so only allow read by owner.
|
||||
umask 077
|
||||
|
||||
VERSION=6.0.87
|
||||
|
||||
PROBE="yes"
|
||||
MODULES=""
|
||||
GRAPHICSMODS=""
|
||||
PREMODS=""
|
||||
DMRAIDS=""
|
||||
ncryptodevs=0
|
||||
ncryptoparts=0
|
||||
ncryptolvs=0
|
||||
ncryptoraids=0
|
||||
root=""
|
||||
scsi_wait_scan="no"
|
||||
|
||||
NET_LIST=""
|
||||
LD_SO_CONF=/etc/ld.so.conf
|
||||
LD_SO_CONF_D=/etc/ld.so.conf.d/
|
||||
|
||||
[ -e /etc/sysconfig/mkinitrd ] && . /etc/sysconfig/mkinitrd
|
||||
|
||||
CONFMODS="$MODULES"
|
||||
MODULES=""
|
||||
ARCH=$(uname -m | sed -e 's/s390x/s390/')
|
||||
|
||||
compress=1
|
||||
allowmissing=""
|
||||
target=""
|
||||
kernel=""
|
||||
force=""
|
||||
img_vers=""
|
||||
builtins=""
|
||||
modulefile=/etc/modules.conf
|
||||
[ "$ARCH" != "s390" ] && withusb=1
|
||||
rc=0
|
||||
nolvm=""
|
||||
nodmraid=""
|
||||
|
||||
IMAGESIZE=8000
|
||||
PRESCSIMODS=""
|
||||
fstab="/etc/fstab"
|
||||
|
||||
vg_list=""
|
||||
net_list="$NET_LIST"
|
||||
|
||||
usage () {
|
||||
if [ "$1" == "-n" ]; then
|
||||
cmd=echo
|
||||
else
|
||||
cmd=error
|
||||
fi
|
||||
|
||||
$cmd "usage: `basename $0` [--version] [--help] [-v] [-f]"
|
||||
|
||||
if [ "$1" == "-n" ]; then
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
qpushd() {
|
||||
pushd "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
qpopd() {
|
||||
popd >/dev/null 2>&1
|
||||
}
|
||||
|
||||
|
||||
freadlink() {
|
||||
readlink -f "$1"
|
||||
}
|
||||
|
||||
resolve_device_name() {
|
||||
if [ -z "${1##UUID=*}" ]; then
|
||||
real=$(freadlink /dev/disk/by-uuid/${1##UUID=})
|
||||
[ -b $real ] && { echo $real; return; }
|
||||
fi
|
||||
if [ -z "${1##LABEL=*}" ]; then
|
||||
real=$(freadlink /dev/disk/by-label/${1##LABEL=})
|
||||
[ -b $real ] && { echo $real; return; }
|
||||
fi
|
||||
echo "$1"
|
||||
}
|
||||
|
||||
finddevnoinsys() {
|
||||
majmin="$1"
|
||||
if [ -n "$majmin" ]; then
|
||||
dev=$(for x in /sys/block/* ; do find $x/ -name dev ; done | while read device ; do \
|
||||
echo "$majmin" | cmp -s $device && echo $device ; done)
|
||||
if [ -n "$dev" ]; then
|
||||
dev=${dev%%/dev}
|
||||
dev=${dev%%/}
|
||||
echo "$dev"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
finddevicedriverinsys () {
|
||||
if is_iscsi $PWD; then
|
||||
handleiscsi "$PWD"
|
||||
return
|
||||
fi
|
||||
while [ "$PWD" != "/sys/devices" ]; do
|
||||
deps=
|
||||
if [ -f modalias ]; then
|
||||
MODALIAS=$(cat modalias)
|
||||
if [ "${MODALIAS::7}" == "scsi:t-" ]; then
|
||||
scsi_wait_scan=yes
|
||||
fi
|
||||
moduledep $MODALIAS
|
||||
unset MODALIAS
|
||||
fi
|
||||
|
||||
cd ..
|
||||
done
|
||||
}
|
||||
|
||||
findstoragedriverinsys () {
|
||||
local sysfs=$(freadlink "$1")
|
||||
|
||||
# if its a partition look at the device holding the partition
|
||||
if [ -f "$sysfs/start" ]; then
|
||||
sysfs=$(freadlink ${sysfs%/*})
|
||||
fi
|
||||
|
||||
if [[ ! "$sysfs" =~ ^/sys/.*block/.*$ ]]; then
|
||||
#error "WARNING: $sysfs is a not a block sysfs path, skipping"
|
||||
return
|
||||
fi
|
||||
|
||||
case " $handleddevices " in
|
||||
*" $sysfs "*)
|
||||
return ;;
|
||||
*) handleddevices="$handleddevices $sysfs" ;;
|
||||
esac
|
||||
|
||||
if [[ "$sysfs" =~ ^/sys/.*block/md[0-9]+$ ]]; then
|
||||
local raid=${sysfs##*/}
|
||||
vecho "Found MDRAID component $raid"
|
||||
handleraid $raid
|
||||
fi
|
||||
if [[ "$sysfs" =~ ^/sys/.*block/dm-[0-9]+$ ]]; then
|
||||
vecho "Found DeviceMapper component ${sysfs##*/}"
|
||||
handledm $(cat $sysfs/dev |cut -d : -f 1) $(cat $sysfs/dev |cut -d : -f 2)
|
||||
fi
|
||||
|
||||
for slave in $(ls -d "$sysfs"/slaves/* 2>/dev/null) ; do
|
||||
findstoragedriverinsys "$slave"
|
||||
done
|
||||
|
||||
if [ -L "$sysfs/device" ]; then
|
||||
qpushd $(freadlink "$sysfs/device")
|
||||
finddevicedriverinsys
|
||||
qpopd
|
||||
fi
|
||||
}
|
||||
|
||||
findstoragedriver () {
|
||||
local device="$1"
|
||||
|
||||
if [ ! -b "$device" ]; then
|
||||
#error "WARNING: $device is a not a block device, skipping"
|
||||
return
|
||||
fi
|
||||
|
||||
local majmin=$(get_numeric_dev dec "$device")
|
||||
local sysfs=$(finddevnoinsys "$majmin")
|
||||
|
||||
if [ -z "$sysfs" ]; then
|
||||
#error "WARNING: $device major:minor $majmin not found, skipping"
|
||||
return
|
||||
fi
|
||||
|
||||
vecho "Looking for driver for $device in $sysfs"
|
||||
findstoragedriverinsys "$sysfs"
|
||||
}
|
||||
|
||||
iscsi_get_rec_val() {
|
||||
|
||||
# The open-iscsi 742 release changed to using flat files in
|
||||
# /var/lib/iscsi.
|
||||
|
||||
result=$(grep "^${2} = " "$1" | sed -e s'/.* = //')
|
||||
}
|
||||
|
||||
iscsi_set_parameters() {
|
||||
path=$1
|
||||
vecho setting iscsi parameters
|
||||
|
||||
tmpfile=$(mktemp)
|
||||
|
||||
# Check once before getting explicit values, so we can output a decent
|
||||
# error message.
|
||||
/sbin/iscsiadm --show -m session -r $path > $tmpfile
|
||||
if [ ! -s $tmpfile ]; then
|
||||
echo Unable to find iscsi record for $path
|
||||
exit 1
|
||||
fi
|
||||
|
||||
nit_name=$(grep "^InitiatorName=" /etc/iscsi/initiatorname.iscsi | \
|
||||
sed -e "s/^InitiatorName=//")
|
||||
|
||||
iscsi_get_rec_val $tmpfile "node.name"
|
||||
tgt_name=${result}
|
||||
iscsi_get_rec_val $tmpfile "node.tpgt"
|
||||
tpgt=${result}
|
||||
# iscsistart wants node.conn[0].address / port
|
||||
iscsi_get_rec_val $tmpfile 'node.conn\[0\].address'
|
||||
tgt_ipaddr=${result}
|
||||
iscsi_get_rec_val $tmpfile 'node.conn\[0\].port'
|
||||
tgt_port=${result}
|
||||
|
||||
# Note: we get chap secrets (passwords) in plaintext, and also store
|
||||
# them in the initrd.
|
||||
|
||||
iscsi_get_rec_val $tmpfile "node.session.auth.username"
|
||||
chap=${result}
|
||||
if [ -n "${chap}" -a "${chap}" != "<empty>" ]; then
|
||||
chap="-u ${chap}"
|
||||
iscsi_get_rec_val $tmpfile "node.session.auth.password"
|
||||
chap_pw="-w ${result}"
|
||||
else
|
||||
chap=""
|
||||
fi
|
||||
|
||||
iscsi_get_rec_val $tmpfile "node.session.auth.username_in"
|
||||
chap_in=${result}
|
||||
if [ -n "${chap_in}" -a "${chap_in}" != "<empty>" ]; then
|
||||
chap_in="-U ${chap_in}"
|
||||
iscsi_get_rec_val $tmpfile "node.session.auth.password_in"
|
||||
chap_in_pw="-W ${result}"
|
||||
else
|
||||
chap_in=""
|
||||
fi
|
||||
|
||||
rm $tmpfile
|
||||
}
|
||||
|
||||
emit_iscsi () {
|
||||
if [ -n "${iscsi_devs}" ]; then
|
||||
for dev in ${iscsi_devs}; do
|
||||
iscsi_set_parameters $dev
|
||||
# recid is not really used, just use 0 for it
|
||||
echo "/bin/iscsistart -t ${tgt_name} -i ${nit_name} \
|
||||
-g ${tpgt} -a ${tgt_ipaddr} ${chap} ${chap_pw} \
|
||||
${chap_in} ${chap_in_pw}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
is_iscsi() {
|
||||
path=$1
|
||||
if echo $path | grep -q "/platform/host[0-9]*/session[0-9]*/target[0-9]*:[0-9]*:[0-9]*/[0-9]*:[0-9]*:[0-9]*:[0-9]*"; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
handledm() {
|
||||
major=$1
|
||||
minor=$2
|
||||
while read dmstart dmend dmtype r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 ; do
|
||||
case "$dmtype" in
|
||||
crypt)
|
||||
# this device is encrypted; find the slave device and see
|
||||
# whether the encryption is LUKS; if not, bail.
|
||||
slavedev=$(finddevnoinsys $r3)
|
||||
# get the basename, then s,!,/, in case it's a cciss device
|
||||
slavedev=$(echo ${slavedev##*/} | tr '!' '/')
|
||||
cryptsetup isLuks "/dev/$slavedev" 2>/dev/null || continue
|
||||
find_base_dm_mods
|
||||
dmname=$(dmsetup info -j $major -m $minor -c --noheadings -o name)
|
||||
# do the device resolution dance to get /dev/mapper/foo
|
||||
# since 'lvm lvs' doesn't like dm-X device nodes
|
||||
if [[ "$slavedev" =~ ^dm- ]]; then
|
||||
majmin=$(get_numeric_dev dec "/dev/$slavedev")
|
||||
for dmdev in /dev/mapper/* ; do
|
||||
dmnum=$(get_numeric_dev dev $dmdev)
|
||||
if [ $dmnum = $majmin ]; then
|
||||
slavedev=${dmdev#/dev/}
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# determine if $slavedev is an LV
|
||||
# if so, add the device to latecryptodevs
|
||||
# if not, add the device to cryptodevs
|
||||
local vg=$(lvshow /dev/$slavedev)
|
||||
if [ -n "$vg" ]; then
|
||||
eval cryptolv${ncryptolvs}='"'/dev/$slavedev $dmname'"'
|
||||
let ncryptolvs++
|
||||
elif grep -q "^$slavedev :" /proc/mdstat ; then
|
||||
eval cryptoraid${ncryptoraids}='"'/dev/$slavedev $dmname'"'
|
||||
let ncryptoraids++
|
||||
else
|
||||
eval cryptoparts${ncryptoparts}='"'/dev/$slavedev $dmname'"'
|
||||
let ncryptoparts++
|
||||
fi
|
||||
|
||||
let ncryptodevs++
|
||||
findstoragedriver "/dev/$slavedev"
|
||||
;;
|
||||
esac
|
||||
done << EOF
|
||||
$(dmsetup table -j $major -m $minor 2>/dev/null)
|
||||
EOF
|
||||
local name=$(dmsetup info --noheadings -c -j $major -m $minor -o name)
|
||||
local vg=$(lvshow "/dev/mapper/$name")
|
||||
local raids=$(/sbin/dmraid -s -craidname 2>/dev/null | grep -vi "no raid disks")
|
||||
if [ -n "$vg" ]; then
|
||||
vg=`echo $vg` # strip whitespace
|
||||
case " $vg_list " in
|
||||
*" $vg "*) ;;
|
||||
*) vg_list="$vg_list $vg"
|
||||
[ -z "$nolvm" ] && find_base_dm_mods
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
for raid in $raids ; do
|
||||
if [ "$raid" == "$name" ]; then
|
||||
case " $DMRAIDS " in
|
||||
*" $raid "*) ;;
|
||||
*) DMRAIDS="$DMRAIDS $raid"
|
||||
[ -z "$nodmraid" ] && find_base_dm_mods
|
||||
;;
|
||||
esac
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
handleiscsi() {
|
||||
vecho "Found iscsi component $1"
|
||||
|
||||
# We call iscsi_set_parameters once here to figure out what network to
|
||||
# use (it sets tgt_ipaddr), and once again to emit iscsi values,
|
||||
# not very efficient.
|
||||
iscsi_set_parameters $1
|
||||
iscsi_devs="$iscsi_devs $1"
|
||||
netdev=$(/sbin/ip route get to $tgt_ipaddr | \
|
||||
sed 's|.*dev \(.*\).*|\1|g' | awk '{ print $1; exit }')
|
||||
addnetdev $netdev
|
||||
}
|
||||
|
||||
handleraid() {
|
||||
local start=0
|
||||
|
||||
if [ -n "$noraid" -o ! -f /proc/mdstat ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
levels=$(awk "/^$1[ ]*:/ { print\$4 }" /proc/mdstat)
|
||||
|
||||
for level in $levels ; do
|
||||
case $level in
|
||||
linear)
|
||||
start=1
|
||||
;;
|
||||
multipath)
|
||||
start=1
|
||||
;;
|
||||
raid[01] | raid10)
|
||||
start=1
|
||||
;;
|
||||
raid[456])
|
||||
start=1
|
||||
;;
|
||||
*)
|
||||
error "raid level $level (in /proc/mdstat) not recognized"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if [ "$start" = 1 ]; then
|
||||
raiddevices="$raiddevices $1"
|
||||
fi
|
||||
return $start
|
||||
}
|
||||
|
||||
lvshow() {
|
||||
lvm lvs --ignorelockingfailure --noheadings -o vg_name \
|
||||
$1 2>/dev/null | egrep -v '^ *(WARNING:|Volume Groups with)'
|
||||
}
|
||||
|
||||
vgdisplay() {
|
||||
lvm vgdisplay --ignorelockingfailure -v $1 2>/dev/null |
|
||||
sed -n 's/PV Name//p'
|
||||
}
|
||||
|
||||
dmmods_found="n"
|
||||
find_base_dm_mods()
|
||||
{
|
||||
[ "$dmmods_found" == "n" ] || return
|
||||
dmmods_found="y"
|
||||
}
|
||||
|
||||
savedargs=$*
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
--fstab*)
|
||||
if [ "$1" != "${1##--fstab=}" ]; then
|
||||
fstab=${1##--fstab=}
|
||||
else
|
||||
fstab=$2
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
|
||||
|
||||
-v|--verbose)
|
||||
set_verbose true
|
||||
;;
|
||||
--net-dev*)
|
||||
if [ "$1" != "${1##--net-dev=}" ]; then
|
||||
net_list="$net_list ${1##--net-dev=}"
|
||||
else
|
||||
net_list="$net_list $2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--rootdev*)
|
||||
if [ "$1" != "${1##--rootdev=}" ]; then
|
||||
rootdev="${1##--rootdev=}"
|
||||
else
|
||||
rootdev="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--thawdev*)
|
||||
if [ "$1" != "${1##--thawdev=}" ]; then
|
||||
thawdev="${1##--thawdev=}"
|
||||
else
|
||||
thawdev="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--rootfs*)
|
||||
if [ "$1" != "${1##--rootfs=}" ]; then
|
||||
rootfs="${1##--rootfs=}"
|
||||
else
|
||||
rootfs="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--rootopts*)
|
||||
if [ "$1" != "${1##--rootopts=}" ]; then
|
||||
rootopts="${1##--rootopts=}"
|
||||
else
|
||||
rootopts="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--root*)
|
||||
if [ "$1" != "${1##--root=}" ]; then
|
||||
root="${1##--root=}"
|
||||
else
|
||||
root="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--loopdev*)
|
||||
if [ "$1" != "${1##--loopdev=}" ]; then
|
||||
loopdev="${1##--loopdev=}"
|
||||
else
|
||||
loopdev="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--loopfs*)
|
||||
if [ "$1" != "${1##--loopfs=}" ]; then
|
||||
loopfs="${1##--loopfs=}"
|
||||
else
|
||||
loopfs="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--loopopts*)
|
||||
if [ "$1" != "${1##--loopopts=}" ]; then
|
||||
loopopts="${1##--loopopts=}"
|
||||
else
|
||||
loopopts="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--looppath*)
|
||||
if [ "$1" != "${1##--looppath=}" ]; then
|
||||
looppath="${1##--looppath=}"
|
||||
else
|
||||
looppath="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--help)
|
||||
usage -n
|
||||
;;
|
||||
*)
|
||||
if [ -z "$target" ]; then
|
||||
target=$1
|
||||
elif [ -z "$kernel" ]; then
|
||||
kernel=$1
|
||||
else
|
||||
usage
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
shift
|
||||
done
|
||||
|
||||
[ -z "$rootfs" ] && rootfs=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $3; }}' $fstab)
|
||||
[ -z "$rootopts" ] && rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' $fstab)
|
||||
[ -z "$rootopts" ] && rootopts="defaults"
|
||||
|
||||
|
||||
[ -z "$rootdev" ] && rootdev=$(awk '/^[ \t]*[^#]/ { if ($2 == "/") { print $1; }}' $fstab)
|
||||
# check if it's nfsroot
|
||||
physdev=""
|
||||
if [ "$rootfs" == "nfs" ]; then
|
||||
if [ "x$net_list" == "x" ]; then
|
||||
handlenfs $rootdev
|
||||
fi
|
||||
else
|
||||
# check if it's root by label
|
||||
rdev=$rootdev
|
||||
rdev=$(resolve_device_name "$rdev")
|
||||
rootopts=$(echo $rootopts | sed -e 's/^r[ow],//' -e 's/,_netdev//' -e 's/_netdev//' -e 's/,r[ow],$//' -e 's/,r[ow],/,/' -e 's/^r[ow]$/defaults/' -e 's/$/,ro/')
|
||||
findstoragedriver "$rdev"
|
||||
fi
|
||||
|
||||
# find the first swap dev which would get used for swsusp
|
||||
[ -z "$thawdev" ] && thawdev=$(awk '/^[ \t]*[^#]/ { if ($3 == "swap") { print $1; exit }}' $fstab)
|
||||
swsuspdev="$thawdev"
|
||||
if [ -n "$swsuspdev" ]; then
|
||||
swsuspdev=$(resolve_device_name "$swsuspdev")
|
||||
findstoragedriver "$swsuspdev"
|
||||
fi
|
||||
|
||||
|
||||
cemit()
|
||||
{
|
||||
cat
|
||||
}
|
||||
|
||||
emit()
|
||||
{
|
||||
NONL=""
|
||||
if [ "$1" == "-n" ]; then
|
||||
NONL="-n"
|
||||
shift
|
||||
fi
|
||||
echo $NONL "$@"
|
||||
}
|
||||
|
||||
emitdmraids()
|
||||
{
|
||||
if [ -z "$nodmraid" -a -n "$DMRAIDS" ]; then
|
||||
for raid in $DMRAIDS; do
|
||||
echo -n "rd_DM_UUID=$raid "
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# HACK: module loading + device creation isn't necessarily synchronous...
|
||||
# this will make sure that we have all of our devices before trying
|
||||
# things like RAID or LVM
|
||||
emitdmraids
|
||||
|
||||
emitcrypto()
|
||||
{
|
||||
local luksuuid=$(grep "^$2 " /etc/crypttab 2>/dev/null| awk '{ print $2 }')
|
||||
if [ -z "$luksuuid" ]; then
|
||||
luksuuid="$2"
|
||||
fi
|
||||
luksuuid=${luksuuid##UUID=}
|
||||
echo -n "rd_LUKS_UUID=$luksuuid "
|
||||
}
|
||||
|
||||
if [ -n "$raiddevices" ]; then
|
||||
for dev in $raiddevices; do
|
||||
uid=$(udevadm info --query=env --name /dev/${dev}|grep MD_UUID)
|
||||
uid=${uid##MD_UUID=}
|
||||
[ -n "$uid" ] && echo -n "rd_MD_UUID=$uid "
|
||||
done
|
||||
else
|
||||
echo -n "rd_NO_MD "
|
||||
fi
|
||||
|
||||
if [ -z "$nolvm" -a -n "$vg_list" ]; then
|
||||
for vg in $vg_list; do
|
||||
echo -n "rd_LVM_VG=$vg "
|
||||
done
|
||||
else
|
||||
echo -n "rd_NO_LVM "
|
||||
fi
|
||||
|
||||
cryptdevs="$(echo ${!cryptoraid@} ${!cryptopart@} ${!cryptolv@})"
|
||||
|
||||
if [ -z "$cryptdevs" ]; then
|
||||
echo -n "rd_NO_LUKS "
|
||||
else
|
||||
for cryptdev in ${!cryptoraid@} ${!cryptopart@} ${!cryptolv@} ; do
|
||||
emitcrypto `eval echo '$'$cryptdev`
|
||||
done
|
||||
fi
|
||||
|
||||
# output local keyboard/18n settings
|
||||
[ -e /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard
|
||||
[ -e /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
|
||||
|
||||
for i in KEYTABLE SYSFONT SYSFONTACM UNIMAP LANG; do
|
||||
val=$(eval echo \$$i)
|
||||
[[ $val ]] && echo -n "$i=$val "
|
||||
done
|
||||
|
||||
if [ -n "$KEYBOARDTYPE" -a "$KEYBOARDTYPE" != "pc" ]; then
|
||||
echo -n "KEYBOARDTYPE=$KEYBOARDTYPE "
|
||||
fi
|
||||
|
||||
if [ -n "$rootdev" ]; then
|
||||
echo -n "root=$rootdev "
|
||||
fi
|
||||
|
||||
echo
|
||||
# vim:ts=8:sw=4:sts=4:et
|
46
dracut-gencmdline.8.xml
Normal file
46
dracut-gencmdline.8.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
|
||||
<!-- lifted from troff+man by doclifter -->
|
||||
<refentry id='dracutgencmdline8'>
|
||||
<refmeta>
|
||||
<refentrytitle>DRACUT-GENCMDLINE</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
<refmiscinfo class='source'>June 2009</refmiscinfo>
|
||||
<refmiscinfo class='manual'>Linux</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>dracut-gencmdline</refname>
|
||||
<refpurpose>generates kernel command line parameters for the dracut generated initramfs</refpurpose>
|
||||
</refnamediv>
|
||||
<!-- body begins here -->
|
||||
<refsynopsisdiv id='synopsis'>
|
||||
<cmdsynopsis>
|
||||
<command>dracut-gencmdline</command>
|
||||
<sbr/>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
|
||||
<refsect1 id='description'><title>DESCRIPTION</title>
|
||||
<para><command>dracut-gencmdline</command>
|
||||
generates kernel command line parameters for the dracut generated initramfs, which are very specific to the host system.</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='authors'><title>AUTHORS</title>
|
||||
<literallayout remap='.nf'>
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
</literallayout> <!-- .fi -->
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='availability'><title>AVAILABILITY</title>
|
||||
<para>The dracut-gencmdline command is part of the dracut package and is available from
|
||||
<ulink url='http://sourceforge.net/apps/trac/dracut/wiki'>http://sourceforge.net/apps/trac/dracut/wiki</ulink></para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='see_also'><title>SEE ALSO</title>
|
||||
<para><citerefentry><refentrytitle>dracut</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
558
dracut-update-initramfs
Executable file
558
dracut-update-initramfs
Executable file
@@ -0,0 +1,558 @@
|
||||
#!/bin/sh
|
||||
|
||||
STATEDIR=/var/lib/dracut
|
||||
BOOTDIR=/boot
|
||||
CONF=/etc/dracut.conf
|
||||
KPKGCONF=/etc/kernel-img.conf
|
||||
USETRIGGERS=true
|
||||
mode=""
|
||||
version=""
|
||||
|
||||
set -e
|
||||
|
||||
if $USETRIGGERS \
|
||||
&& [ x"$DPKG_MAINTSCRIPT_PACKAGE" != x ] \
|
||||
&& [ $# = 1 ] \
|
||||
&& [ x"$1" = x-u ] \
|
||||
&& dpkg-trigger --check-supported 2>/dev/null
|
||||
then
|
||||
if dpkg-trigger --no-await update-initramfs; then
|
||||
echo "dracut-update-initramfs: deferring update (trigger activated)"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
usage()
|
||||
{
|
||||
if [ -n "${1}" ]; then
|
||||
printf "${@}\n\n" >&2
|
||||
fi
|
||||
cat >&2 << EOF
|
||||
Usage: ${0} [OPTION]...
|
||||
|
||||
Options:
|
||||
-k [version] Specify kernel version or 'all'
|
||||
-c Create a new initramfs
|
||||
-u Update an existing initramfs
|
||||
-d Remove an existing initramfs
|
||||
-t Take over a custom initramfs with this one
|
||||
-b Set alternate boot directory
|
||||
-v Be verbose
|
||||
-h This message
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# chroot check
|
||||
chrooted()
|
||||
{
|
||||
# borrowed from udev's postinst
|
||||
if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ]; then
|
||||
# the devicenumber/inode pair of / is the same as that of
|
||||
# /sbin/init's root, so we're *not* in a chroot and hence
|
||||
# return false.
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
mild_panic()
|
||||
{
|
||||
if [ -n "${1}" ]; then
|
||||
printf "${@}\n" >&2
|
||||
fi
|
||||
exit 0
|
||||
}
|
||||
|
||||
panic()
|
||||
{
|
||||
if [ -n "${1}" ]; then
|
||||
printf "${@}\n" >&2
|
||||
fi
|
||||
exit 1
|
||||
}
|
||||
|
||||
verbose()
|
||||
{
|
||||
if [ "${verbose}" = 1 ]; then
|
||||
printf "${@}\n"
|
||||
fi
|
||||
}
|
||||
|
||||
version_exists()
|
||||
{
|
||||
[ -e "${STATEDIR}/${1}" ] && [ -e "${initramfs}" ]
|
||||
return $?
|
||||
}
|
||||
|
||||
set_initramfs()
|
||||
{
|
||||
initramfs="${BOOTDIR}/dracut.img-${version}"
|
||||
}
|
||||
|
||||
|
||||
# backup initramfs while running
|
||||
backup_initramfs()
|
||||
{
|
||||
[ ! -r "${initramfs}" ] && return 0
|
||||
initramfs_bak="${initramfs}.dpkg-bak"
|
||||
[ -r "${initramfs_bak}" ] && rm -f "${initramfs_bak}"
|
||||
ln -f "${initramfs}" "${initramfs_bak}" \
|
||||
|| cp -a "${initramfs}" "${initramfs_bak}"
|
||||
verbose "Keeping ${initramfs_bak}"
|
||||
}
|
||||
|
||||
# keep booted initramfs
|
||||
backup_booted_initramfs()
|
||||
{
|
||||
initramfs_bak="${initramfs}.dpkg-bak"
|
||||
|
||||
# first time run thus no backup
|
||||
[ ! -r "${initramfs_bak}" ] && return 0
|
||||
|
||||
# chroot with no /proc
|
||||
[ ! -r /proc/uptime ] && rm -f "${initramfs_bak}" && return 0
|
||||
|
||||
# no kept backup wanted
|
||||
[ "${backup_initramfs}" = "no" ] && rm -f "${initramfs_bak}" && return 0
|
||||
|
||||
# no backup yet
|
||||
if [ ! -r "${initramfs}.bak" ]; then
|
||||
mv -f ${initramfs_bak} "${initramfs}.bak"
|
||||
verbose "Backup ${initramfs}.bak"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# keep booted initramfs
|
||||
uptime_days=$(awk '{printf "%d", $1 / 3600 / 24}' /proc/uptime)
|
||||
if [ -n "$uptime_days" ]; then
|
||||
boot_initramfs=$(find "${initramfs}.bak" -mtime +${uptime_days})
|
||||
fi
|
||||
if [ -n "${boot_initramfs}" ]; then
|
||||
mv -f "${initramfs_bak}" "${initramfs}.bak"
|
||||
verbose "Backup ${initramfs}.bak"
|
||||
return 0
|
||||
fi
|
||||
verbose "Removing current backup ${initramfs_bak}"
|
||||
rm -f ${initramfs_bak}
|
||||
}
|
||||
|
||||
# nuke generated copy
|
||||
remove_initramfs()
|
||||
{
|
||||
[ -z "${initramfs_bak}" ] && return 0
|
||||
rm -f "${initramfs_bak}"
|
||||
verbose "Removing ${initramfs_bak}"
|
||||
}
|
||||
|
||||
|
||||
generate_initramfs()
|
||||
{
|
||||
echo "dracut-update-initramfs: Generating ${initramfs}"
|
||||
OPTS=""
|
||||
if [ "${verbose}" = 1 ]; then
|
||||
OPTS="-v ${OPTS}"
|
||||
fi
|
||||
##WORK HERE!
|
||||
if dracut ${OPTS} "${initramfs}.new" "${version}"; then
|
||||
mv -f "${initramfs}.new" "${initramfs}"
|
||||
set_sha1
|
||||
else
|
||||
mkinitramfs_return="$?"
|
||||
remove_initramfs
|
||||
rm -f "${initramfs}.new"
|
||||
if [ "$mkinitramfs_return" = "2" ]; then
|
||||
# minversion wasn't met, exit 0
|
||||
exit 0
|
||||
fi
|
||||
echo "update-initramfs: failed for ${initramfs}"
|
||||
exit $mkinitramfs_return
|
||||
fi
|
||||
}
|
||||
|
||||
# lilo call
|
||||
run_lilo()
|
||||
{
|
||||
# show lilo errors on failure
|
||||
if ! lilo -t > /dev/null 2>&1 ; then
|
||||
echo "ERROR lilo fails for new ${initramfs}:"
|
||||
echo
|
||||
lilo -t
|
||||
fi
|
||||
lilo
|
||||
}
|
||||
|
||||
# check if lilo is on mbr
|
||||
mbr_check()
|
||||
{
|
||||
# try to discover grub|grub2 and be happy
|
||||
[ -r /boot/grub/grub.cfg ] \
|
||||
&& groot=$(awk '/^set root=/{print substr($2, 7, 3); exit}' \
|
||||
/boot/grub/grub.cfg)
|
||||
[ -r /boot/grub/menu.lst ] \
|
||||
&& groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \
|
||||
/boot/grub/menu.lst)
|
||||
[ -e /boot/grub/device.map ] && [ -n "${groot}" ] \
|
||||
&& dev=$(awk "/${groot}/{ print \$NF}" /boot/grub/device.map)
|
||||
[ -n "${dev}" ] && [ -r ${dev} ] \
|
||||
&& dd if="${dev}" bs=512 skip=0 count=1 2> /dev/null \
|
||||
| grep -q GRUB && return 0
|
||||
|
||||
# check out lilo.conf for validity
|
||||
boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf)
|
||||
[ -z "${boot}" ] && return 0
|
||||
case ${boot} in
|
||||
/dev/md/*)
|
||||
if [ -r /proc/mdstat ]; then
|
||||
MD=${boot#/dev/md/}
|
||||
boot="/dev/$(awk "/^md${MD}/{print substr(\$5, 1, 3)}" \
|
||||
/proc/mdstat)"
|
||||
fi
|
||||
;;
|
||||
/dev/md*)
|
||||
if [ -r /proc/mdstat ]; then
|
||||
MD=${boot#/dev/}
|
||||
boot="/dev/$(awk "/^${MD}/{print substr(\$5, 1, 3)}" \
|
||||
/proc/mdstat)"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
[ ! -r "${boot}" ] && return 0
|
||||
dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO \
|
||||
&& run_lilo && return 0
|
||||
|
||||
# no idea which bootloader is used
|
||||
echo
|
||||
echo "WARNING: grub and lilo installed."
|
||||
echo "If you use grub as bootloader everything is fine."
|
||||
echo "If you use lilo as bootloader you must run lilo!"
|
||||
echo
|
||||
}
|
||||
|
||||
# Invoke bootloader
|
||||
run_bootloader()
|
||||
{
|
||||
# if both lilo and grub around, figure out if lilo needs to be run
|
||||
if ( command -v update-grub >/dev/null 2>&1 \
|
||||
|| [ -e /boot/grub/menu.lst ] || [ -e /boot/grub/grub.cfg ] ) \
|
||||
&& ( [ -e /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1 ); then
|
||||
[ -r "${KPKGCONF}" ] && \
|
||||
do_b=$(awk '/^do_bootloader/{print $3}' "${KPKGCONF}")
|
||||
if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \
|
||||
|| [ "${do_b}" = "YES" ]; then
|
||||
run_lilo
|
||||
return 0
|
||||
elif [ "${do_b}" = "no" ] || [ "${do_b}" = "No" ] \
|
||||
|| [ "${do_b}" = "NO" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# do_bootloader unconfigured
|
||||
mbr_check
|
||||
return 0
|
||||
fi
|
||||
if [ -r /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1; then
|
||||
run_lilo
|
||||
return 0
|
||||
fi
|
||||
if command -v elilo >/dev/null 2>&1; then
|
||||
elilo
|
||||
return 0
|
||||
fi
|
||||
if [ -r /etc/zipl.conf ]; then
|
||||
zipl
|
||||
fi
|
||||
if flash-kernel --supported >/dev/null 2>&1; then
|
||||
flash-kernel ${version}
|
||||
fi
|
||||
}
|
||||
|
||||
compare_sha1()
|
||||
{
|
||||
sha1sum "${initramfs}" | diff "${STATEDIR}/${version}" - >/dev/null 2>&1
|
||||
return $?
|
||||
}
|
||||
|
||||
# Note that this must overwrite so that updates work.
|
||||
set_sha1()
|
||||
{
|
||||
sha1sum "${initramfs}" > "${STATEDIR}/${version}"
|
||||
}
|
||||
|
||||
delete_sha1()
|
||||
{
|
||||
rm -f "${STATEDIR}/${version}"
|
||||
}
|
||||
|
||||
# ro /boot is not modified
|
||||
ro_boot_check()
|
||||
{
|
||||
# check irrelevant inside of a chroot
|
||||
if [ ! -r /proc/mounts ] || chrooted; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
boot_opts=$(awk '/boot/{if ((match($4, /^ro/) || match($4, /,ro/)) \
|
||||
&& $2 == "/boot") print "ro"}' /proc/mounts)
|
||||
if [ -n "${boot_opts}" ]; then
|
||||
echo "WARNING: /boot is ro mounted."
|
||||
echo "update-initramfs: Not updating ${initramfs}"
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
get_sorted_versions()
|
||||
{
|
||||
version_list=""
|
||||
|
||||
for gsv_x in "${STATEDIR}"/*; do
|
||||
gsv_x="$(basename "${gsv_x}")"
|
||||
if [ "${gsv_x}" = '*' ]; then
|
||||
return 0
|
||||
fi
|
||||
worklist=""
|
||||
for gsv_i in $version_list; do
|
||||
if dpkg --compare-versions "${gsv_x}" '>' "${gsv_i}"; then
|
||||
worklist="${worklist} ${gsv_x} ${gsv_i}"
|
||||
gsv_x=""
|
||||
else
|
||||
worklist="${worklist} ${gsv_i}"
|
||||
fi
|
||||
done
|
||||
if [ "${gsv_x}" != "" ]; then
|
||||
worklist="${worklist} ${gsv_x}"
|
||||
fi
|
||||
version_list="${worklist}"
|
||||
done
|
||||
|
||||
verbose "Available versions: ${version_list}"
|
||||
}
|
||||
|
||||
set_current_version()
|
||||
{
|
||||
if [ -f /boot/dracut.img-`uname -r` ]; then
|
||||
version=`uname -r`
|
||||
fi
|
||||
}
|
||||
|
||||
set_linked_version()
|
||||
{
|
||||
if [ -e /initrd.img ] && [ -L /initrd.img ]; then
|
||||
linktarget="$(basename "$(readlink /initrd.img)")"
|
||||
fi
|
||||
|
||||
if [ -e /boot/initrd.img ] && [ -L /boot/initrd.img ]; then
|
||||
linktarget="$(basename "$(readlink /boot/initrd.img)")"
|
||||
fi
|
||||
|
||||
if [ -z "${linktarget}" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
version="${linktarget##*img-}"
|
||||
}
|
||||
|
||||
set_highest_version()
|
||||
{
|
||||
get_sorted_versions
|
||||
set -- ${version_list}
|
||||
version=${1}
|
||||
}
|
||||
|
||||
create()
|
||||
{
|
||||
if [ -z "${version}" ]; then
|
||||
usage "Create mode requires a version argument"
|
||||
fi
|
||||
|
||||
set_initramfs
|
||||
|
||||
if [ "${takeover}" = 0 ]; then
|
||||
if version_exists "${version}"; then
|
||||
panic "Cannot create version ${version}: already exists"
|
||||
fi
|
||||
|
||||
if [ -e "${initramfs}" ]; then
|
||||
panic "${initramfs} already exists, cannot create."
|
||||
fi
|
||||
fi
|
||||
|
||||
generate_initramfs
|
||||
}
|
||||
|
||||
update()
|
||||
{
|
||||
if [ "${update_initramfs}" = "no" ]; then
|
||||
echo "update-initramfs: Not updating initramfs."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "${version}" ]; then
|
||||
set_highest_version
|
||||
fi
|
||||
|
||||
if [ -z "${version}" ]; then
|
||||
set_linked_version
|
||||
fi
|
||||
|
||||
if [ -z "${version}" ]; then
|
||||
set_current_version
|
||||
fi
|
||||
|
||||
if [ -z "${version}" ]; then
|
||||
verbose "Nothing to do, exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
set_initramfs
|
||||
|
||||
ro_boot_check
|
||||
|
||||
altered_check
|
||||
|
||||
backup_initramfs
|
||||
|
||||
generate_initramfs
|
||||
|
||||
run_bootloader
|
||||
|
||||
backup_booted_initramfs
|
||||
}
|
||||
|
||||
delete()
|
||||
{
|
||||
if [ -z "${version}" ]; then
|
||||
usage "Delete mode requires a version argument"
|
||||
fi
|
||||
|
||||
set_initramfs
|
||||
|
||||
if [ ! -e "${initramfs}" ]; then
|
||||
panic "Cannot delete ${initramfs}, doesn't exist."
|
||||
fi
|
||||
|
||||
if ! version_exists "${version}"; then
|
||||
panic "Cannot delete version ${version}: Not created by this utility."
|
||||
fi
|
||||
|
||||
altered_check
|
||||
|
||||
echo "update-initramfs: Deleting ${initramfs}"
|
||||
|
||||
delete_sha1
|
||||
|
||||
rm -f "${initramfs}"
|
||||
}
|
||||
|
||||
# Check for update mode on existing and modified initramfs
|
||||
altered_check()
|
||||
{
|
||||
# No check on takeover
|
||||
[ "${takeover}" = 1 ] && return 0
|
||||
if [ ! -e "${initramfs}" ]; then
|
||||
mild_panic "${initramfs} does not exist. Cannot update."
|
||||
fi
|
||||
if ! compare_sha1; then
|
||||
echo "update-initramfs: ${initramfs} has been altered." >&2
|
||||
mild_panic "update-initramfs: Cannot update. Override with -t option."
|
||||
fi
|
||||
}
|
||||
|
||||
# Defaults
|
||||
verbose=0
|
||||
yes=0
|
||||
# We default to takeover=1 in Ubuntu, but not Debian
|
||||
takeover=0
|
||||
|
||||
##
|
||||
|
||||
while getopts "k:cudyvtb:h?" flag; do
|
||||
case "${flag}" in
|
||||
k)
|
||||
version="${OPTARG}"
|
||||
;;
|
||||
c)
|
||||
mode="c"
|
||||
;;
|
||||
d)
|
||||
mode="d"
|
||||
;;
|
||||
u)
|
||||
mode="u"
|
||||
;;
|
||||
v)
|
||||
verbose="1"
|
||||
;;
|
||||
y)
|
||||
yes="1"
|
||||
;;
|
||||
t)
|
||||
takeover="1"
|
||||
;;
|
||||
b)
|
||||
BOOTDIR="${OPTARG}"
|
||||
if [ ! -d "${BOOTDIR}" ]; then
|
||||
echo "Error: ${BOOTDIR} is not a directory."
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
h|?)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $((${OPTIND} - 1))
|
||||
|
||||
if [ $# -ne 0 ]; then
|
||||
echo "Invalid argument for option -k."
|
||||
usage
|
||||
fi
|
||||
|
||||
# Validate arguments
|
||||
if [ -z "${mode}" ]; then
|
||||
usage "You must specify at least one of -c, -u, or -d."
|
||||
fi
|
||||
|
||||
if [ "${version}" = "all" ] \
|
||||
|| ( [ "${update_initramfs}" = "all" ] && [ -z "${version}" ] ); then
|
||||
: FIXME check for --yes, and if not ask are you sure
|
||||
get_sorted_versions
|
||||
if [ -z "${version_list}" ]; then
|
||||
verbose "Nothing to do, exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
OPTS="-b ${BOOTDIR}"
|
||||
if [ "${verbose}" = "1" ]; then
|
||||
OPTS="${OPTS} -v"
|
||||
fi
|
||||
if [ "${takeover}" = "1" ]; then
|
||||
OPTS="${OPTS} -t"
|
||||
fi
|
||||
if [ "${yes}" = "1" ]; then
|
||||
OPTS="${OPTS} -y"
|
||||
fi
|
||||
for u_version in ${version_list}; do
|
||||
# Don't stop if one version doesn't work.
|
||||
set +e
|
||||
verbose "Execute: ${0} -${mode} -k \"${u_version}\" ${OPTS}"
|
||||
"${0}" -${mode} -k "${u_version}" ${OPTS}
|
||||
set -e
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
case "${mode}" in
|
||||
c)
|
||||
create
|
||||
;;
|
||||
d)
|
||||
delete
|
||||
;;
|
||||
u)
|
||||
update
|
||||
;;
|
||||
esac
|
212
dracut.8
212
dracut.8
@@ -1,212 +0,0 @@
|
||||
.TH DRACUT 8 "June 2009" "Linux"
|
||||
.SH NAME
|
||||
switch_root \- switch to another filesystem as the root of the mount tree.
|
||||
.SH SYNOPSIS
|
||||
\fBdracut\fR [\fIOPTION\fR]... \fI<image>\fR \fI<kernel-version>\fR
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B switch_root
|
||||
\fBdracut\fR creates an initial image used by the kernel for
|
||||
preloading the block device modules (such as IDE, SCSI or RAID)
|
||||
which are needed to access the root filesystem.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BR \-f ", " \-\-force
|
||||
overwrite existing initramfs file.
|
||||
.TP
|
||||
.BR \-m ", " \-\-modules " \fILIST\fR"
|
||||
specify a space-separated list of dracut modules to call
|
||||
when building the initramfs.
|
||||
Modules are located in
|
||||
.IR /usr/share/dracut/modules.d .
|
||||
.TP
|
||||
.BR \-o ", " \-\-omit " \fILIST\fR"
|
||||
omit a space-separated list of dracut modules.
|
||||
.TP
|
||||
.BR \-a ", " \-\-add " \fILIST\fR"
|
||||
add a space-separated list of dracut modules.
|
||||
.TP
|
||||
.BR \-d ", " \-\-drivers " \fILIST\fR"
|
||||
specify a space-separated list of kernel modules to include in the initramfs.
|
||||
.TP
|
||||
.BR \-h ", " \-\-help
|
||||
display help text and exit.
|
||||
.TP
|
||||
.B \-\-debug
|
||||
output debug information of the build process
|
||||
.TP
|
||||
.BR \-v ", " \-\-verbose
|
||||
verbose output during the build process
|
||||
.TP
|
||||
.BR \-c ", " \-\-conf " \fIFILE\fR"
|
||||
specify configuration file to use.
|
||||
Default:
|
||||
.IR /etc/dracut.conf
|
||||
.TP
|
||||
.BR \-l ", " \-\-local
|
||||
local mode. Use modules from the current working
|
||||
directory instead of the system-wide installed in
|
||||
.IR /usr/share/dracut/modules.d .
|
||||
Useful when running dracut from a git checkout.
|
||||
.TP
|
||||
.BR \-H ", " \-\-hostonly
|
||||
Host-Only mode: Install only what is needed for
|
||||
booting the local host instead of a generic host.
|
||||
.TP
|
||||
.BR \-i ", " \-\-include " \fISOURCE\fR" "" " \fITARGET\fR"
|
||||
include the files in the SOURCE directory into the
|
||||
target directory in the final initramfs.
|
||||
.TP
|
||||
.BR \-I ", " \-\-install " \fILIST\fR"
|
||||
install the space separated list of files into the initramfs.
|
||||
|
||||
.SH KERNEL COMMAND LINE
|
||||
The root filesystem used by the kernel is specified in the boot configuration
|
||||
file, as always. The traditional \fBroot=/dev/hda1\fR style device
|
||||
specification is allowed. If a label is used, as in \fBroot=LABEL=rootPart\fR
|
||||
the initrd will search all available devices for an ext2 or ext3 filesystem
|
||||
with the appropriate label, and mount that device as the root filesystem.
|
||||
\fBroot=UUID=uuidnumber\fR will mount the partition with that UUID as the
|
||||
root filesystem.
|
||||
|
||||
.SH Standard
|
||||
.TP
|
||||
.B init=<path to real init>
|
||||
.TP
|
||||
.B root=<path to blockdevice>
|
||||
specify e.g. \fI/dev/sda1\fR or
|
||||
\fI/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1\fR
|
||||
|
||||
.SH DHCP
|
||||
.TP
|
||||
.B root=dhcp
|
||||
get IP from dhcp server, root-path option from dhcp specifies root location
|
||||
|
||||
.SH NFS
|
||||
.TP
|
||||
.B root=[<server-ip>:]<root-dir>[:<nfs-options>]
|
||||
mount nfs share from <server-ip>:/<root-dir>, if no server-ip is given,
|
||||
use dhcp next_server.
|
||||
NFS options can be appended with the prefix "." or ","
|
||||
.TP
|
||||
.B root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>]
|
||||
.TP
|
||||
.B root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]
|
||||
.TP
|
||||
.B root=dhcp
|
||||
root=dhcp alone directs initrd to look at the DHCP root-path where NFS
|
||||
options can be specified.
|
||||
root-path=<server-ip>:<root-dir>[,<nfs-options>]
|
||||
root-path=nfs:<server-ip>:<root-dir>[,<nfs-options>]
|
||||
root-path=nfs4:<server-ip>:<root-dir>[,<nfs-options>]
|
||||
.TP
|
||||
.B root=/dev/nfs nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
|
||||
\fBDeprecated!\fR kernel Documentation/filesystems/nfsroot.txt defines
|
||||
this method.
|
||||
This is supported by dracut but not recommended.
|
||||
|
||||
.SH iSCSI
|
||||
.TP
|
||||
.B root=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname>
|
||||
protocol defaults to "6", LUN defaults to "0".
|
||||
|
||||
If the "servername" field is provided by BOOTP or DHCP, then that
|
||||
field is used in conjunction with other associated fields to contact
|
||||
the boot server in the Boot stage (Section 7). However, if the
|
||||
"servername" field is not provided, then the "targetname" field is
|
||||
then used in the Discovery Service stage in conjunction with other
|
||||
associated fields.
|
||||
|
||||
http://tools.ietf.org/html/rfc4173
|
||||
|
||||
.TP
|
||||
.B root=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname>
|
||||
e.g. root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
|
||||
|
||||
.TP
|
||||
.B root=??? netroot=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname> ...
|
||||
multiple netroot options allow setting up multiple iscsi disks
|
||||
e.g.
|
||||
root=UUID=12424547 netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0 netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1
|
||||
.B not yet implemented
|
||||
.TP
|
||||
.B root=??? iscsi_initiator= iscsi_target_name= iscsi_target_ip= iscsi_target_port= iscsi_target_group= iscsi_username= iscsi_password= iscsi_in_username= iscsi_in_password=
|
||||
|
||||
.TP
|
||||
.B root=??? iscsi_firmware
|
||||
will read the iscsi parameter from the BIOS firmware
|
||||
|
||||
.SH NBD
|
||||
.TP
|
||||
.B root=nbd:<server>:<port>[:<fstype>][:<mountopts>]
|
||||
mount nbd share from <server>
|
||||
.TP
|
||||
.B root=dhcp
|
||||
with dhcp root-path=nbd:<server>:<port>[:<fstype>][:<mountopts>]
|
||||
root=dhcp alone directs initrd to look at the DHCP root-path where NBD options can be specified.
|
||||
This syntax is only usable in cases where you are directly mounting the volume as the rootfs.
|
||||
|
||||
.SH Network
|
||||
.TP bootdev=<interface>
|
||||
.B specify the network interface to boot from
|
||||
.TP
|
||||
.B ip=[dhcp|on|any]
|
||||
get ip from dhcp server from all interfaces. If root=dhcp, loop sequentially through all interfaces (eth0, eth1, ...) and use the first with a valid DHCP root-path.
|
||||
.TP
|
||||
.B ip=<interface>:[dhcp|on|any]
|
||||
get ip from dhcp server on a specific interface
|
||||
.TP
|
||||
.B ip=<client-IP-number>:<gateway-IP-number>:<netmask>:<client-hostname>:<interface>:[dhcp|on|any|]
|
||||
explicit network configuration
|
||||
|
||||
.SH Misc
|
||||
.TP
|
||||
.B rdblacklist=<drivername>
|
||||
do not load kernel module <drivername>
|
||||
|
||||
.SH Debug
|
||||
.TP
|
||||
.B rdshell
|
||||
drop to a shell, if the imitramfs fails
|
||||
.TP
|
||||
.B rdinitdebug
|
||||
set -x for the dracut shell
|
||||
.TP
|
||||
.B rdbreak=[pre-udev|pre-mount|mount|pre-pivot|]
|
||||
drop the shell on defined breakpoint
|
||||
.TP
|
||||
.B rdudevinfo
|
||||
set udev to loglevel info
|
||||
.TP
|
||||
.B rdudevdebug
|
||||
set udev to loglevel debug
|
||||
.TP
|
||||
.B rdnetdebug
|
||||
debug network scripts in dracut. Output is written to /tmp/
|
||||
|
||||
.SH CONFIGURATION IN INITRAMFS
|
||||
.TP
|
||||
.B /conf/conf.d/
|
||||
Any files found in /conf/conf.d/ will be sourced in the initramfs to
|
||||
set initial values. Command line options will override these values
|
||||
set in the configuration files.
|
||||
|
||||
.SH AUTHORS
|
||||
.nf
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Seewer Philippe <philippe.seewer@bfh.ch>
|
||||
Victor Lowther <victor.lowther@gmail.com>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
The dracut command is part of the dracut package and is available from
|
||||
https://sourceforge.net/apps/trac/dracut/wiki
|
||||
|
||||
|
447
dracut.8.xml
Normal file
447
dracut.8.xml
Normal file
@@ -0,0 +1,447 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- This document was created with Syntext Serna Free. --><!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
|
||||
<refentry>
|
||||
<refentryinfo>
|
||||
<title>dracut</title>
|
||||
<productname>dracut</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Project Leader, Developer</contrib>
|
||||
<firstname>Harald</firstname>
|
||||
<surname>Hoyer</surname>
|
||||
<email>harald@redhat.com</email>
|
||||
</author>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Victor</firstname>
|
||||
<surname>Lowther</surname>
|
||||
<email>victor.lowther@gmail.com</email>
|
||||
</author>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Warren</firstname>
|
||||
<surname>Togami</surname>
|
||||
<email>wtogami@redhat.com</email>
|
||||
</author>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Jeremy</firstname>
|
||||
<surname>Katz</surname>
|
||||
<email>katzj@redhat.com</email>
|
||||
</author>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Philippe</firstname>
|
||||
<surname>Seewer</surname>
|
||||
<email>philippe.seewer@bfh.ch</email>
|
||||
</author>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>David</firstname>
|
||||
<surname>Dillow</surname>
|
||||
<email>dave@thedillows.org</email>
|
||||
</author>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Amadeusz</firstname>
|
||||
<surname>Żołnowski</surname>
|
||||
<email>aidecoe@aidecoe.name</email>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>dracut</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
<refmiscinfo class="version"/>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>dracut</refname>
|
||||
<refpurpose>create initial ramdisk images for preloading modules</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>dracut</command>
|
||||
<arg choice="opt" rep="repeat">
|
||||
<replaceable>OPTION</replaceable>
|
||||
</arg>
|
||||
<arg choice="opt">
|
||||
<replaceable><image></replaceable>
|
||||
<arg choice="opt">
|
||||
<replaceable><kernel-version></replaceable>
|
||||
</arg>
|
||||
</arg>
|
||||
<sbr/>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<para><command>dracut</command>
|
||||
creates an initial image used by the kernel for
|
||||
preloading the block device modules (such as IDE, SCSI or RAID)
|
||||
which are needed to access the root filesystem.</para>
|
||||
<para>
|
||||
For a complete list of kernel command line options see
|
||||
<citerefentry>
|
||||
<refentrytitle>dracut.kernel</refentrytitle>
|
||||
<manvolnum>7</manvolnum>
|
||||
</citerefentry>
|
||||
</para>
|
||||
<refsect2>
|
||||
<title>Options</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-f</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--force</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>overwrite existing initramfs file.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-m</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--modules <replaceable><list of dracut modules></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify a space-separated list of dracut modules to call
|
||||
when building the initramfs.
|
||||
Modules are located in
|
||||
<filename>/usr/share/dracut/modules.d</filename>. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-o</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--omit <replaceable><list of dracut modules></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>omit a space-separated list of dracut modules. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-a</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--add <replaceable><list of dracut modules></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>add a space-separated list of dracut modules to the default set of modules. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-d</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--drivers <replaceable><list of kernel modules></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify a space-separated list of kernel modules to exclusively include
|
||||
in the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--add-drivers <replaceable><list of kernel modules></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify a space-separated list of kernel modules to add to the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--filesystems <replaceable><list of filesystems></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify a space-separated list of kernel filesystem modules to exclusively
|
||||
include in the generic initramfs. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-k</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--kmoddir <replaceable><kernel directory></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify the directory, where to look for kernel modules</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option> --fwdir <replaceable><dir>[:<dir>...]</replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify additional directories, where to look for firmwares. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--kernel-only</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>only install kernel drivers and firmware files</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--no-kernel</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not install kernel drivers and firmware files</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--ignore-kernel-modules</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>don't try to load modules; it automatically implies <option>--no-kernel</option>; it's
|
||||
assumed that everything needed is built into kernel</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--mdadmconf</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>include local /etc/mdadm.conf</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--nomdadmconf</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not include local /etc/mdadm.conf</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--strip</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>strip binaries in the initramfs (default)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--nostrip</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not strip binaries in the initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-h</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--help</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>display help text and exit.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--debug</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>output debug information of the build process</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-v</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--verbose</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>verbose output during the build process</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-c</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--conf <replaceable><dracut configuration file></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify configuration file to use.
|
||||
Default:
|
||||
<filename>/etc/dracut.conf</filename></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--confdir <replaceable><configuration directory></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify configuration directory to use.
|
||||
Default:
|
||||
<filename>/etc/dracut.conf.d</filename></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-l</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--local</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>activates the local mode. Dracut will use modules from the current working
|
||||
directory instead of the system-wide installed modules in
|
||||
<filename>/usr/share/dracut/modules.d</filename>.
|
||||
Thsi is useful when running dracut from a git checkout.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-H</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--hostonly</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Host-Only mode: Install only what is needed for booting
|
||||
the local host instead of a generic host.
|
||||
<warning>
|
||||
<para>If chrooted to another root other than the real root device, use "--fstab" and provide a valid /etc/fstab.</para>
|
||||
</warning>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--fstab</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Use <filename>/etc/fstab</filename> instead of <filename>/proc/self/mountinfo</filename>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-i</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--include <replaceable><source directory></replaceable> <replaceable><target directory></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>include the files in the source directory into the
|
||||
target directory in the final initramfs.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-I</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--install <replaceable><file list></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>install the space separated list of files into the initramfs.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Files</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/var/log/dracut.log</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>logfile of initramfs image creation</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/tmp/dracut.log</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>logfile of initramfs image creation, if <filename>/var/log/dracut.log</filename> is not writable</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/dracut.conf</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>see <citerefentry>
|
||||
<refentrytitle>dracut.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/dracut.conf.d/*.conf</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>see <citerefentry>
|
||||
<refentrytitle>dracut.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
<refsect2>
|
||||
<title>Configuration in the Initramfs</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/conf/conf.d/</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Any files found in /conf/conf.d/ will be sourced in the initramfs to
|
||||
set initial values. Command line options will override these values
|
||||
set in the configuration files.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/cmdline</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Can contain additional command line options.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Availability</title>
|
||||
<para>The dracut command is part of the dracut package and is available from
|
||||
<ulink url="http://sourceforge.net/apps/trac/dracut/wiki">http://sourceforge.net/apps/trac/dracut/wiki</ulink></para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
<para>
|
||||
<citerefentry>
|
||||
<refentrytitle>dracut.kernel</refentrytitle>
|
||||
<manvolnum>7</manvolnum>
|
||||
</citerefentry>
|
||||
<citerefentry>
|
||||
<refentrytitle>dracut.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
24
dracut.conf
24
dracut.conf
@@ -1,10 +1,26 @@
|
||||
# Sample dracut config file
|
||||
|
||||
# Specific list of dracut modules to use
|
||||
#dracutmodules=""
|
||||
#dracutmodules+=""
|
||||
|
||||
# Dracut modules to omit
|
||||
#omit_dracutmodules=""
|
||||
#omit_dracutmodules+=""
|
||||
|
||||
# Additional kernel modules to install
|
||||
#drivers=""
|
||||
# Dracut modules to add to the default
|
||||
#add_dracutmodules+=""
|
||||
|
||||
# additional kernel modules to the default
|
||||
#add_drivers+=""
|
||||
|
||||
# list of kernel filesystem modules to be included in the generic initramfs
|
||||
#filesystems+=""
|
||||
|
||||
# build initrd only to boot current hardware
|
||||
#hostonly="yes"
|
||||
#
|
||||
|
||||
# install local /etc/mdadm.conf
|
||||
mdadmconf="yes"
|
||||
|
||||
# install local /etc/lvm/lvm.conf
|
||||
lvmconf="yes"
|
||||
|
200
dracut.conf.5.xml
Normal file
200
dracut.conf.5.xml
Normal file
@@ -0,0 +1,200 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- This document was created with Syntext Serna Free. --><!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
|
||||
<refentry id="dracutconf5">
|
||||
<refentryinfo>
|
||||
<title>dracut.conf</title>
|
||||
<productname>dracut</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Harald</firstname>
|
||||
<surname>Hoyer</surname>
|
||||
<email>harald@redhat.com</email>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>dracut.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>dracut.conf</refname>
|
||||
<refpurpose>configuration file(s) for dracut</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>/etc/dracut.conf</command>
|
||||
<arg choice="plain">
|
||||
<replaceable>/etc/dracut.conf.d/*.conf</replaceable>
|
||||
</arg>
|
||||
<sbr/>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<para><emphasis>dracut.conf</emphasis>
|
||||
is loaded during the initialisation phase of dracut.
|
||||
Command line parameter will overwrite any values set here.
|
||||
<emphasis>dracut.conf.d/*.conf files are read in alphanumerical order and will</emphasis>
|
||||
overwrite parameters set in /etc/dracut.conf. Each line specifies an attribute and a value. A '#' indicates the beginning of a comment; following characters, up to the end of the line are not interpreted.</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>dracutmodules+=" <replaceable><dracut modules></replaceable> "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Specify a space-separated list of dracut modules to
|
||||
call when building the initramfs. Modules are located
|
||||
in /usr/share/dracut/modules.d.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>omit_dracutmodules+=" <replaceable><dracut modules></replaceable> "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Omit a space-separated list of dracut modules.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>add_dracutmodules+=" <replaceable><dracut modules></replaceable> "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Add a space-separated list of dracut modules.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>drivers+=" <replaceable><kernel modules></replaceable> "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Specify a space-separated list of kernel modules to
|
||||
exclusively include in the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>add_drivers+=" <replaceable><kernel modules></replaceable> "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Specify a space-separated list of kernel
|
||||
modules to add to the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>filesystems+=" <replaceable><filesystem names></replaceable> "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Specify a space-separated list of kernel filesystem
|
||||
modules to exclusively include in the generic
|
||||
initramfs.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>drivers_dir="<replaceable><kernel modules directory></replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Specify the directory, where to look for kernel modules</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>fw_dir+=" :<replaceable><dir></replaceable>[:<replaceable><dir></replaceable> ...] "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Specify additional directories, where to look for firmwares, separated by :</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>do_strip="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Strip binaries in the initramfs (default=yes)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>hostonly="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Host-Only mode: Install only what is needed for booting
|
||||
the local host instead of a generic host.
|
||||
<warning><para>If chrooted to another root other than the real root device, use "--fstab" and provide a valid /etc/fstab.</para></warning>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>use_fstab="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Use /etc/fstab instead of /proc/self/mountinfo.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>mdadmconf="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Include local /etc/mdadm.conf (default=yes)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>lvmconf="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Include local /etc/lvm/lvm.conf (default=yes)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>kernel_only="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Only install kernel drivers and firmware files. (default=no)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>no_kernel="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Do not install kernel drivers and firmware files (default=no)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Files</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/dracut/conf.d/</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Any /etc/dracut/conf.d/*.conf file can overwrite the values in /etc/dracut.conf.
|
||||
The configuration files are read in alphanumerical order.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
<para><citerefentry>
|
||||
<refentrytitle>dracut</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</citerefentry>
|
||||
<citerefentry>
|
||||
<refentrytitle>dracut.kernel</refentrytitle>
|
||||
<manvolnum>7</manvolnum>
|
||||
</citerefentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
6
dracut.conf.d/fedora.conf.example
Normal file
6
dracut.conf.d/fedora.conf.example
Normal file
@@ -0,0 +1,6 @@
|
||||
# /etc/dracut.conf.d/redhat.conf
|
||||
# Dracut config file customized for RedHat/Fedora.
|
||||
|
||||
# i18n
|
||||
keyboard_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP"
|
||||
i18n_vars="/etc/sysconfig/i18n:SYSFONT,SYSFONTACM-CONTRANS,UNIMAP"
|
10
dracut.conf.d/gentoo-openrc.conf.example
Normal file
10
dracut.conf.d/gentoo-openrc.conf.example
Normal file
@@ -0,0 +1,10 @@
|
||||
# /etc/dracut.conf.d/gentoo-openrc.conf
|
||||
# Dracut config file customized for Gentoo Base System release 2
|
||||
|
||||
#
|
||||
# Modules
|
||||
#
|
||||
|
||||
# i18n
|
||||
keyboard_vars="/etc/conf.d/keymaps:keymap-KEYMAP,extended_keymaps-EXT_KEYMAPS"
|
||||
i18n_vars="/etc/conf.d/consolefont:consolefont-SYSFONT,consoletranslation-CONTRANS /etc/rc.conf:unicode-UNICODE"
|
10
dracut.conf.d/gentoo.conf.example
Normal file
10
dracut.conf.d/gentoo.conf.example
Normal file
@@ -0,0 +1,10 @@
|
||||
# /etc/dracut.conf.d/gentoo.conf
|
||||
# Dracut config file customized for Gentoo Base System release 1
|
||||
|
||||
#
|
||||
# Modules
|
||||
#
|
||||
|
||||
# i18n
|
||||
keyboard_vars="/etc/conf.d/keymaps:KEYMAP,EXTENDED_KEYMAPS-EXT_KEYMAPS"
|
||||
i18n_vars="/etc/conf.d/consolefont:CONSOLEFONT-SYSFONT,CONSOLETRANSLATION-CONTRANS /etc/rc.conf:UNICODE"
|
790
dracut.kernel.7.xml
Normal file
790
dracut.kernel.7.xml
Normal file
@@ -0,0 +1,790 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- This document was created with Syntext Serna Free. --><!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" []>
|
||||
<refentry>
|
||||
<refentryinfo>
|
||||
<title>dracut.kernel</title>
|
||||
<productname>dracut</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Harald</firstname>
|
||||
<surname>Hoyer</surname>
|
||||
<email>harald@redhat.com</email>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>dracut.kernel</refentrytitle>
|
||||
<manvolnum>7</manvolnum>
|
||||
<refmiscinfo class="version"/>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>dracut.kernel</refname>
|
||||
<refpurpose>dracut kernel command line options</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<para>The root filesystem used by the kernel is specified in the boot configuration
|
||||
file, as always. The traditional <emphasis remap="B">root=/dev/hda1</emphasis> style device
|
||||
specification is allowed. If a label is used, as in <emphasis remap="B">root=LABEL=rootPart</emphasis>
|
||||
the initramfs will search all available devices for an ext2 or ext3 filesystem
|
||||
with the appropriate label, and mount that device as the root filesystem.
|
||||
<emphasis remap="B">root=UUID=uuidnumber</emphasis> will mount the partition with that UUID as the
|
||||
root filesystem.</para>
|
||||
<refsect2>
|
||||
<title>Standard</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>init=<replaceable><path to real init></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para> </para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>root=<replaceable><path to blockdevice></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify blockdevice to use as root filesystem.
|
||||
e.g.
|
||||
<programlisting>
|
||||
root=/dev/sda1
|
||||
root=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1
|
||||
</programlisting></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rootfstype=<replaceable><filesystem type></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>"auto" if not specified, e.g. rootfstype=ext3</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rootflags=<replaceable><mount options></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify additional mount options for the root filesystem. If not set, /etc/fstab
|
||||
of the real root will be parsed for special mount options and mounted
|
||||
accordingly.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_FSTAB</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not honor special mount options for the root filesystem found in
|
||||
/etc/fstab of the real root.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>Misc</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rdblacklist=<replaceable><drivername></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not load kernel module <drivername>
|
||||
This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rdloaddriver=<replaceable><drivername></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>force loading kernel module <drivername>
|
||||
This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>Debug</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rdinfo</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>print informational output though "quiet" is set</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rdshell</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>allow dropping to a shell, if root mounting fails</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rdinitdebug</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>set -x for the dracut shell and logs to dmesg, console and /init.log</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rdbreak</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>drop to a shell at the end</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><envar>rdbreak=</envar>{cmdline|pre-udev|pre-trigger|initqueue|pre-mount|mount|pre-pivot} </term>
|
||||
<listitem>
|
||||
<para>drop to a shell on defined breakpoint</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rdudevinfo</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>set udev to loglevel info</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rdudevdebug</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>set udev to loglevel debug</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>I18N</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>KEYMAP=</envar>
|
||||
<replaceable><keymap base file name></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>keyboard translation table loaded by loadkeys; taken from keymaps directory; will be written to /etc/sysconfig/keyboard in the initramfs, e.g.: <programlisting>KEYMAP=de-latin1-nodeadkeys</programlisting></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>EXT_KEYMAPS=</envar>
|
||||
<replaceable><list of keymap base file names></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>list of extra keymaps to bo loaded (sep. by space); will be written to /etc/sysconfig/keyboard in the initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>UNICODE=</envar>
|
||||
<replaceable><1|0></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>boolean, indicating UTF-8 mode; will be written to /etc/sysconfig/i18n in the initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>SYSFONT=</envar>
|
||||
<replaceable><font base file name></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>console font; taken from consolefonts directory; will be written to /etc/sysconfig/i18n in the initramfs; e.g.: <programlisting>SYSFONT=LatArCyrHeb-16</programlisting></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>CONTRANS=</envar>
|
||||
<replaceable><console map base file name></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>see description of '-m' parameter in setfont manual; taken from consoletrans directory; will be written to /etc/sysconfig/i18n in the initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>UNIMAP=</envar>
|
||||
<replaceable><unicode table base file name></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>see description of '-u' parameter in setfont manual; taken from unimaps directory; will be written to /etc/sysconfig/i18n in the initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>LANG=</envar>
|
||||
<replaceable><locale></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>taken from the environment; if no UNICODE is defined we set its value in basis of LANG value (whether it ends with ".utf8" (or similar) or not); will be written to /etc/sysconfig/i18n in the initramfs; e.g.: <programlisting>LANG=pl_PL.utf8</programlisting></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>LC_ALL=</envar>
|
||||
<replaceable><locale></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>taken from the environment; will be written to /etc/sysconfig/i18n in the initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>LVM</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_LVM</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>disable LVM detection</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_LVM_VG=<replaceable><volume group name></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>only activate the volume groups with the given name
|
||||
rd_LVM_VG can be specified multiple times on the kernel command line.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_LVM_LV=<replaceable><logical volume name></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>only activate the logical volumes with the given name
|
||||
rd_LVM_LV can be specified multiple times on the kernel command line.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_LVMCONF</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>remove any /etc/lvm/lvm.conf, which may exist in the initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>crypto LUKS</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_LUKS</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>disable crypto LUKS detection</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_LUKS_UUID=<replaceable><luks uuid></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>only activate the LUKS partitions with the given UUID
|
||||
Any "luks-" of the LUKS UUID is removed before comparing to <luks uuid>.
|
||||
The comparisons also matches, if <luks uuid> is only the beginning of the
|
||||
LUKS UUID, so you don't have to specify the full UUID.
|
||||
This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_CRYPTTAB</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not check, if LUKS partition is in /etc/crypttab</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>crypt LUKS - experimental removable keys support</title>
|
||||
<para>works only when plymouth module is not included</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_LUKS_KEYPATH=</envar>
|
||||
<replaceable><path to keyfile></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>path to keyfile inside remove device filesystem</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_LUKS_KEYDEV_UUID=</envar>
|
||||
<replaceable><rem. device uuid></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>UUID of removalbe device storing keyfile; UUID doesn't have to be exact just like for rd_LUKS_UUID</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>MD</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_MD</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>disable MD RAID detection</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_MDIMSM</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>no MD RAID for imsm/isw raids, use dmraid instead</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_MDADMCONF</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>ignore mdadm.conf included in initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_MD_UUID=<replaceable><md uuid></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>only activate the raid sets with the given UUID.
|
||||
This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>DMRAID</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_DM</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>disable DM RAID detection</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_DM_UUID=<replaceable><dmraid uuid></replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>only activate the raid sets with the given UUID.
|
||||
This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>Network</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>ip=</envar>
|
||||
<replaceable>{dhcp|on|any|dhcp6|auto6}</replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>dhcp|on|any: get ip from dhcp server from all interfaces. If root=dhcp,
|
||||
loop sequentially through all interfaces (eth0, eth1, ...) and use the first
|
||||
with a valid DHCP root-path.</para>
|
||||
<para>auto6: do IPv6 autoconfiguration</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><envar>ip=</envar><replaceable><interface></replaceable>:<replaceable>{dhcp|on|any|dhcp6|auto6}</replaceable></term>
|
||||
<listitem>
|
||||
<para>dhcp|on|any|dhcp6: get ip from dhcp server on a specific interface
|
||||
auto6: do IPv6 autoconfiguration
|
||||
This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><envar>ip=</envar><replaceable><client-IP></replaceable>:<optional>
|
||||
<replaceable><server-id></replaceable>
|
||||
</optional>:<replaceable><gateway-IP></replaceable>:<replaceable><netmask></replaceable>:<replaceable><client_hostname></replaceable>:<replaceable><interface></replaceable>:<replaceable>{none|off}</replaceable></term>
|
||||
<listitem>
|
||||
<para>explicit network configuration. If you want do define a IPv6 address, put it in brackets (e.g. [2001:DB8::1]).
|
||||
This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><envar>ifname=</envar><replaceable><interface></replaceable>:<replaceable><MAC></replaceable></term>
|
||||
<listitem>
|
||||
<para>Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>.
|
||||
Note letters in the MAC-address must be lowercase!
|
||||
Note that if you use this option you <emphasis remap="B">must</emphasis> specify an ifname= argument
|
||||
for all interfaces used in ip= or fcoe= arguments
|
||||
This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>bootdev=</envar>
|
||||
<replaceable><interface></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify network interface to use routing and netroot information from.
|
||||
Required if multiple ip= lines are used.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>nameserver=</envar>
|
||||
<replaceable><IP></replaceable>
|
||||
<optional><envar>nameserver</envar>=<replaceable><IP></replaceable> ...</optional>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify nameserver(s) to use</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>NFS</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>root=</envar>
|
||||
<optional><replaceable><server-ip></replaceable>:</optional>
|
||||
<replaceable><root-dir></replaceable>
|
||||
<optional>:<replaceable><nfs-options></replaceable></optional>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>mount nfs share from <server-ip>:/<root-dir>, if no server-ip is given,
|
||||
use dhcp next_server. if server-ip is an IPv6 address it has to be put in brackets, e.g. [2001:DB8::1].
|
||||
NFS options can be appended with the prefix ":" or "," and are seperated by ",".</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><envar>root=</envar>nfs:<optional><replaceable><server-ip></replaceable>:</optional><replaceable><root-dir></replaceable><optional>:<replaceable><nfs-options></replaceable></optional></term>
|
||||
<term><envar>root=</envar>nfs4:<optional><replaceable><server-ip></replaceable>:</optional><replaceable><root-dir></replaceable><optional>:<replaceable><nfs-options></replaceable></optional></term>
|
||||
<term>
|
||||
<envar>root=</envar>
|
||||
<replaceable>{dhcp|dhcp6}</replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>root=dhcp alone directs initrd to look at the DHCP root-path where NFS
|
||||
options can be specified.
|
||||
root-path=<server-ip>:<root-dir>[,<nfs-options>]
|
||||
root-path=nfs:<server-ip>:<root-dir>[,<nfs-options>]
|
||||
root-path=nfs4:<server-ip>:<root-dir>[,<nfs-options>]</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>root=</envar>
|
||||
<filename>/dev/nfs</filename>
|
||||
<envar> nfsroot=</envar>
|
||||
<optional><replaceable><server-ip></replaceable>:</optional>
|
||||
<replaceable><root-dir></replaceable>
|
||||
<optional>:<replaceable><nfs-options></replaceable></optional>
|
||||
</term>
|
||||
<listitem>
|
||||
<para><emphasis remap="B">Deprecated!</emphasis> kernel Documentation/filesystems/nfsroot.txt defines
|
||||
this method.
|
||||
This is supported by dracut but not recommended.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar remap="B">rd_NFS_DOMAIN=</envar>
|
||||
<replaceable><NFSv4 domain name></replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Set the NFSv4 domain name. Will overwrite the settings in /etc/idmap.conf.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>iSCSI</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><envar>root=</envar>iscsi:<optional><replaceable><username></replaceable>:<replaceable><password></replaceable><optional>:<replaceable><reverse></replaceable>:<replaceable><password></replaceable></optional>@</optional><optional>
|
||||
<replaceable><servername></replaceable>
|
||||
</optional>:<optional>
|
||||
<replaceable><protocol></replaceable>
|
||||
</optional>:<optional>
|
||||
<replaceable><port></replaceable>
|
||||
</optional>:<optional>
|
||||
<replaceable><LUN></replaceable>
|
||||
</optional>:<replaceable><targetname></replaceable></term>
|
||||
<listitem>
|
||||
<para>protocol defaults to "6", LUN defaults to "0".</para>
|
||||
<para>If the "servername" field is provided by BOOTP or DHCP, then that
|
||||
field is used in conjunction with other associated fields to contact
|
||||
the boot server in the Boot stage (Section 7). However, if the
|
||||
"servername" field is not provided, then the "targetname" field is
|
||||
then used in the Discovery Service stage in conjunction with other
|
||||
associated fields.</para>
|
||||
<para><ulink url="http://tools.ietf.org/html/rfc4173">http://tools.ietf.org/html/rfc4173</ulink></para>
|
||||
<para>e.g.
|
||||
<programlisting>
|
||||
root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>If servername is an IPv6 address, it has to be put in brackets. e.g.
|
||||
<programlisting>
|
||||
root=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0
|
||||
</programlisting></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><envar>root=</envar><replaceable>???</replaceable><envar> netroot=</envar>iscsi:<optional><replaceable><username></replaceable>:<replaceable><password></replaceable><optional>:<replaceable><reverse></replaceable>:<replaceable><password></replaceable></optional>@</optional><optional>
|
||||
<replaceable><servername></replaceable>
|
||||
</optional>:<optional>
|
||||
<replaceable><protocol></replaceable>
|
||||
</optional>:<optional>
|
||||
<replaceable><port></replaceable>
|
||||
</optional>:<optional>
|
||||
<replaceable><LUN></replaceable>
|
||||
</optional>:<replaceable><targetname></replaceable> ...</term>
|
||||
<listitem>
|
||||
<para>multiple netroot options allow setting up multiple iscsi disks. e.g.
|
||||
<programlisting>
|
||||
root=UUID=12424547
|
||||
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
|
||||
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1
|
||||
</programlisting></para>
|
||||
<para>If servername is an IPv6 address, it has to be put in brackets.
|
||||
e.g.
|
||||
<programlisting>netroot=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0</programlisting></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>root=<replaceable>???</replaceable></envar>
|
||||
<envar> iscsi_initiator=<replaceable><initiator> </replaceable></envar>
|
||||
<envar>iscsi_target_name=<replaceable><target_name> </replaceable></envar>
|
||||
<envar>iscsi_target_ip=<replaceable><target ip> </replaceable></envar>
|
||||
<envar>iscsi_target_port=<replaceable><target port> </replaceable></envar>
|
||||
<envar>iscsi_target_group=<replaceable><target group> </replaceable></envar>
|
||||
<envar>iscsi_username=<replaceable><username> </replaceable></envar>
|
||||
<envar>iscsi_password=<replaceable><password> </replaceable></envar>
|
||||
<envar>iscsi_in_username=<replaceable><in username> </replaceable></envar>
|
||||
<envar>iscsi_in_password=<replaceable><in password> </replaceable></envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>manually specify all iscsistart parameter (see <userinput>iscsistart --help</userinput>)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><envar>root=</envar>???<envar> iscsi_firmware</envar></term>
|
||||
<listitem>
|
||||
<para>will read the iscsi parameter from the BIOS firmware</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>FCoE</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><envar>netroot=</envar>fcoe:<replaceable><interface|MAC></replaceable>:<replaceable>{dcb|nodcb}</replaceable></term>
|
||||
<listitem>
|
||||
<para>Try to connect to a FCoE SAN through the NIC specified by <interface> or <MAC>,
|
||||
for the second argument, currently only nodcb is supported. Note letters in
|
||||
the MAC-address must be lowercase!</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>NBD</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><envar>root=</envar><constant>nbd</constant>:<replaceable><server></replaceable>:<replaceable><port></replaceable><optional>:<replaceable><fstype></replaceable></optional><optional>:<replaceable><mountopts></replaceable></optional></term>
|
||||
<listitem>
|
||||
<para>mount nbd share from <server></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>root=dhcp</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>with dhcp root-path=nbd:<server>:<port>[:<fstype>][:<mountopts>]
|
||||
root=dhcp alone directs initrd to look at the DHCP root-path where NBD
|
||||
options can be specified.
|
||||
This syntax is only usable in cases where you are directly mounting the volume
|
||||
as the rootfs.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>DASD</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><envar>rd_DASD_MOD=</envar>....</term>
|
||||
<listitem>
|
||||
<para>same syntax as the kernel module parameter (s390 only)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_DASD=</envar>
|
||||
<replaceable><dasd_adaptor device bus ID></replaceable>
|
||||
<optional>,readonly=<replaceable>X</replaceable></optional>
|
||||
<optional>,use_diag=<replaceable>X</replaceable></optional>
|
||||
<optional>,erplog=<replaceable>X</replaceable></optional>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>activate DASD device with the given adaptor device bus ID and setting the sysfs attributes
|
||||
to the specified values
|
||||
This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>ZFCP</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><envar>rd_ZFCP=</envar><replaceable><zfcp adaptor device bus ID></replaceable>,<replaceable><WWPN></replaceable>,<replaceable><FCPLUN></replaceable></term>
|
||||
<listitem>
|
||||
<para>rd_ZFCP can be specified multiple times on the kernel command line.</para>
|
||||
<para>example: rd_ZFCP=0.0.4000,0x5005076300C213e9,0x5022000000000000</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_ZFCPCONF</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>ignore zfcp.conf included in the initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>ZNET</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><envar>rd_ZNET=</envar><replaceable><nettype></replaceable>,<replaceable><subchannels></replaceable>,<replaceable><options></replaceable></term>
|
||||
<listitem>
|
||||
<para>rd_ZNET can be specified multiple times on the kernel command line. Examples:
|
||||
rd_ZNET=qeth,0.0.0600,0.0.0601,0.0.0602,layer2=1,portname=foo
|
||||
rd_ZNET=ctc,0.0.0600,0.0.0601,0.0.0602,protocol=bar</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
<refsect2>
|
||||
<title>Plymouth Boot Splash</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>rd_NO_PLYMOUTH</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not start plymouth. This will not work with encrypted partitions.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Files</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/var/log/dracut.log</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>logfile of initramfs image creation</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/tmp/dracut.log</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>logfile of initramfs image creation, if /var/log/dracut.log is not writable</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/dracut.conf</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>see <citerefentry>
|
||||
<refentrytitle>dracut.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/dracut.conf.d/*.conf</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>see <citerefentry>
|
||||
<refentrytitle>dracut.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
<refsect2>
|
||||
<title>Configuration in the Initramfs</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/conf/conf.d/</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Any files found in /conf/conf.d/ will be sourced in the initramfs to
|
||||
set initial values. Command line options will override these values
|
||||
set in the configuration files.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/cmdline</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Can contain additional command line options.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
<para>
|
||||
<citerefentry>
|
||||
<refentrytitle>dracut</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</citerefentry>
|
||||
<citerefentry>
|
||||
<refentrytitle>dracut.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
524
dracut.spec
524
dracut.spec
@@ -1,88 +1,157 @@
|
||||
%if 0%{?fedora} < 12
|
||||
%define with_switch_root 1
|
||||
%else
|
||||
%define with_switch_root 1
|
||||
# Variables must be defined
|
||||
%define with_switch_root 1
|
||||
%define with_nbd 1
|
||||
|
||||
# switchroot provided by util-linux-ng in F-12+
|
||||
%if 0%{?fedora} > 11 || 0%{?rhel} >= 6
|
||||
%define with_switch_root 0
|
||||
%endif
|
||||
# nbd in Fedora only
|
||||
%if 0%{?rhel} >= 6
|
||||
%define with_nbd 0
|
||||
%endif
|
||||
|
||||
%if %{defined gittag}
|
||||
%define rdist 1.git%{gittag}%{?dist}
|
||||
%define rdist .git%{gittag}%{?dist}
|
||||
%define dashgittag -%{gittag}
|
||||
%else
|
||||
%define rdist %{?dist}
|
||||
%endif
|
||||
|
||||
Name: dracut
|
||||
Version: 0.4
|
||||
Version: 007
|
||||
Release: 1%{?rdist}
|
||||
Summary: Initramfs generator using udev
|
||||
Group: System Environment/Base
|
||||
License: GPLv2+
|
||||
Group: System Environment/Base
|
||||
License: GPLv2+
|
||||
URL: http://apps.sourceforge.net/trac/dracut/wiki
|
||||
# Source can be generated by
|
||||
# http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=snapshot;h=%{?dashgittag};sf=tgz
|
||||
Source0: dracut-%{version}%{?dashgittag}.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
Requires: udev
|
||||
Requires: util-linux-ng
|
||||
Requires: module-init-tools
|
||||
Requires: cpio
|
||||
Requires: coreutils
|
||||
Requires: findutils
|
||||
Requires: binutils
|
||||
Requires: grep
|
||||
Requires: mktemp
|
||||
Requires: mount
|
||||
Requires: bash
|
||||
Requires: /bin/sh
|
||||
Requires: fileutils, grep, mount, gzip, tar, mktemp >= 1.5-5, findutils
|
||||
Requires: lvm2 >= 2.02.33-9, dhclient
|
||||
Requires: filesystem >= 2.1.0, cpio, device-mapper, initscripts >= 8.63-1
|
||||
Requires: e2fsprogs >= 1.38-12, libselinux, libsepol, coreutils
|
||||
Requires: mdadm, elfutils-libelf, plymouth >= 0.7.0
|
||||
Requires: cryptsetup-luks
|
||||
%ifnarch s390 s390x
|
||||
Requires: dmraid
|
||||
Requires: kbd
|
||||
BuildRequires: docbook-style-xsl docbook-dtds docbook-style-xsl libxslt
|
||||
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6
|
||||
# no "provides", because dracut does not offer
|
||||
# all functionality of the obsoleted packages
|
||||
Obsoletes: mkinitrd <= 6.0.93
|
||||
Obsoletes: mkinitrd-devel <= 6.0.93
|
||||
Obsoletes: nash <= 6.0.93
|
||||
Obsoletes: libbdevid-python <= 6.0.93
|
||||
%endif
|
||||
Obsoletes: dracut-kernel < 005
|
||||
Provides: dracut-kernel = %{version}-%{release}
|
||||
|
||||
Requires: bash
|
||||
Requires: bzip2
|
||||
Requires: coreutils
|
||||
Requires: cpio
|
||||
Requires: dash
|
||||
Requires: filesystem >= 2.1.0
|
||||
Requires: findutils
|
||||
Requires: grep
|
||||
Requires: gzip
|
||||
Requires: initscripts >= 8.63-1
|
||||
Requires: kbd
|
||||
Requires: mktemp >= 1.5-5
|
||||
Requires: module-init-tools >= 3.7-9
|
||||
Requires: mount
|
||||
Requires: plymouth >= 0.8.0-0.2009.29.09.19.1
|
||||
Requires: sed
|
||||
Requires: tar
|
||||
Requires: udev
|
||||
Requires: util-linux-ng >= 2.16
|
||||
Requires: which
|
||||
|
||||
%if ! 0%{?with_switch_root}
|
||||
Requires: /sbin/switch_root
|
||||
BuildArch: noarch
|
||||
%endif
|
||||
|
||||
%description
|
||||
dracut is a new, event-driven initramfs infrastructure based around udev.
|
||||
Dracut contains tools to create a bootable initramfs for 2.6 Linux kernels.
|
||||
Unlike existing implementations, dracut does hard-code as little as possible
|
||||
into the initramfs. Dracut contains various modules which are driven by the
|
||||
event-based udev. Having root on MD, DM, LVM2, LUKS is supported as well as
|
||||
NFS, iSCSI, NBD, FCoE with the dracut-network package.
|
||||
|
||||
|
||||
%package generic
|
||||
Summary: Metapackage to build a generic initramfs
|
||||
%package network
|
||||
Summary: Dracut modules to build a dracut initramfs with network support
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: rpcbind nfs-utils
|
||||
Requires: iscsi-initiator-utils
|
||||
Requires: dhclient
|
||||
%if %{with_nbd}
|
||||
Requires: nbd
|
||||
%endif
|
||||
Requires: net-tools iproute
|
||||
Requires: kernel-firmware
|
||||
Requires: ql2100-firmware
|
||||
Requires: ql2200-firmware
|
||||
Requires: ql23xx-firmware
|
||||
Requires: ql2400-firmware
|
||||
Requires: ql2500-firmware
|
||||
Requires: bridge-utils
|
||||
Requires: vconfig
|
||||
|
||||
%description network
|
||||
This package requires everything which is needed to build a generic
|
||||
all purpose initramfs with network support with dracut.
|
||||
|
||||
%package fips
|
||||
Summary: Dracut modules to build a dracut initramfs with an integrity check
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: hmaccalc
|
||||
%if 0%{?rhel} > 5
|
||||
# For Alpha 3, we want nss instead of nss-softokn
|
||||
Requires: nss
|
||||
%else
|
||||
Requires: nss-softokn
|
||||
%endif
|
||||
Requires: nss-softokn-freebl
|
||||
|
||||
%description fips
|
||||
This package requires everything which is needed to build an
|
||||
all purpose initramfs with dracut, which does an integrity check.
|
||||
|
||||
%package generic
|
||||
Summary: Metapackage to build a generic initramfs with dracut
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: %{name}-network = %{version}-%{release}
|
||||
|
||||
%description generic
|
||||
This package requires everything which is needed to build a generic
|
||||
all purpose initramfs.
|
||||
all purpose initramfs with dracut.
|
||||
|
||||
%package tools
|
||||
Summary: Dracut tools to build the local initramfs
|
||||
Requires: coreutils cryptsetup-luks device-mapper
|
||||
Requires: diffutils dmraid findutils grep lvm2 gawk
|
||||
Requires: module-init-tools sed
|
||||
Requires: cpio gzip
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description tools
|
||||
This package contains tools to assemble the local initrd and host configuration.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}%{?dashgittag}
|
||||
|
||||
%build
|
||||
make
|
||||
|
||||
make WITH_SWITCH_ROOT=0%{?with_switch_root}
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin sysconfdir=/etc mandir=%{_mandir}
|
||||
make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin \
|
||||
sysconfdir=/etc mandir=%{_mandir} WITH_SWITCH_ROOT=0%{?with_switch_root}
|
||||
|
||||
%if ! 0%{?with_switch_root}
|
||||
rm -f $RPM_BUILD_ROOT/sbin/switch_root
|
||||
echo %{name}-%{version}-%{release} > $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/10rpmversion/dracut-version
|
||||
rm $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/01fips/check
|
||||
# remove gentoo specific modules
|
||||
rm -fr $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/50gensplash
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/boot/dracut
|
||||
mkdir -p $RPM_BUILD_ROOT/var/lib/dracut/overlay
|
||||
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log
|
||||
touch $RPM_BUILD_ROOT%{_localstatedir}/log/dracut.log
|
||||
install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/fedora.conf
|
||||
|
||||
%if 0%{?fedora} <= 12 && 0%{?rhel} < 6
|
||||
rm $RPM_BUILD_ROOT/sbin/mkinitrd
|
||||
rm $RPM_BUILD_ROOT/sbin/lsinitrd
|
||||
%endif
|
||||
|
||||
%clean
|
||||
@@ -90,27 +159,386 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,0755)
|
||||
%doc README HACKING TODO COPYING AUTHORS
|
||||
%doc README HACKING TODO COPYING AUTHORS NEWS
|
||||
/sbin/dracut
|
||||
%if 0%{?with_switch_root}
|
||||
/sbin/switch_root
|
||||
%endif
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6
|
||||
/sbin/mkinitrd
|
||||
/sbin/lsinitrd
|
||||
%endif
|
||||
%dir %{_datadir}/dracut
|
||||
%{_datadir}/dracut/dracut-functions
|
||||
%{_datadir}/dracut/modules.d
|
||||
%config(noreplace) /etc/dracut.conf
|
||||
%config(noreplace) /etc/dracut.conf.d/fedora.conf
|
||||
%dir /etc/dracut.conf.d
|
||||
%{_mandir}/man8/dracut.8*
|
||||
%{_mandir}/man7/dracut.kernel.7*
|
||||
%{_mandir}/man5/dracut.conf.5*
|
||||
%{_datadir}/dracut/modules.d/00bootchart
|
||||
%{_datadir}/dracut/modules.d/00dash
|
||||
%{_datadir}/dracut/modules.d/10i18n
|
||||
%{_datadir}/dracut/modules.d/10rpmversion
|
||||
%{_datadir}/dracut/modules.d/50plymouth
|
||||
%{_datadir}/dracut/modules.d/60xen
|
||||
%{_datadir}/dracut/modules.d/90btrfs
|
||||
%{_datadir}/dracut/modules.d/90crypt
|
||||
%{_datadir}/dracut/modules.d/90dm
|
||||
%{_datadir}/dracut/modules.d/90dmraid
|
||||
%{_datadir}/dracut/modules.d/90dmsquash-live
|
||||
%{_datadir}/dracut/modules.d/90kernel-modules
|
||||
%{_datadir}/dracut/modules.d/90lvm
|
||||
%{_datadir}/dracut/modules.d/90mdraid
|
||||
%{_datadir}/dracut/modules.d/90multipath
|
||||
%{_datadir}/dracut/modules.d/95debug
|
||||
%{_datadir}/dracut/modules.d/95resume
|
||||
%{_datadir}/dracut/modules.d/95rootfs-block
|
||||
%{_datadir}/dracut/modules.d/95dasd
|
||||
%{_datadir}/dracut/modules.d/95dasd_mod
|
||||
%{_datadir}/dracut/modules.d/95zfcp
|
||||
%{_datadir}/dracut/modules.d/95terminfo
|
||||
%{_datadir}/dracut/modules.d/95udev-rules
|
||||
%{_datadir}/dracut/modules.d/95uswsusp
|
||||
%{_datadir}/dracut/modules.d/98selinux
|
||||
%{_datadir}/dracut/modules.d/98syslog
|
||||
%{_datadir}/dracut/modules.d/99base
|
||||
# logfile needs no logrotate, because it gets overwritten
|
||||
# for every dracut run
|
||||
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
|
||||
|
||||
%files network
|
||||
%defattr(-,root,root,0755)
|
||||
%{_datadir}/dracut/modules.d/40network
|
||||
%{_datadir}/dracut/modules.d/95fcoe
|
||||
%{_datadir}/dracut/modules.d/95iscsi
|
||||
%{_datadir}/dracut/modules.d/95nbd
|
||||
%{_datadir}/dracut/modules.d/95nfs
|
||||
%{_datadir}/dracut/modules.d/45ifcfg
|
||||
%{_datadir}/dracut/modules.d/95znet
|
||||
|
||||
%files fips
|
||||
%defattr(-,root,root,0755)
|
||||
%{_datadir}/dracut/modules.d/01fips
|
||||
|
||||
%files generic
|
||||
%defattr(-,root,root,0755)
|
||||
%doc README.generic
|
||||
|
||||
%files tools
|
||||
%defattr(-,root,root,0755)
|
||||
%{_mandir}/man8/dracut-gencmdline.8*
|
||||
%{_mandir}/man8/dracut-catimages.8*
|
||||
/sbin/dracut-gencmdline
|
||||
/sbin/dracut-catimages
|
||||
%dir /boot/dracut
|
||||
%dir /var/lib/dracut
|
||||
%dir /var/lib/dracut/overlay
|
||||
|
||||
%changelog
|
||||
* Thu Jun 17 2010 Harald Hoyer <harald@redhat.com> 006-1
|
||||
- version 006
|
||||
|
||||
* Fri Jun 11 2010 Harald Hoyer <harald@redhat.com>
|
||||
- Remove requirements, which are not really needed
|
||||
Resolves: rhbz#598509
|
||||
- fixed copy of network config to /dev/.initramfs/ (patch 146)
|
||||
Resolves: rhbz#594649
|
||||
- more password beauty (patch 142)
|
||||
Resolves: rhbz#561092
|
||||
- support multiple iSCSI disks (patch 143)
|
||||
Resolves: rbhz#580190
|
||||
- fixed selinux=0 (patch 130)
|
||||
Resolves: rhbz#593080
|
||||
- add support for booting LVM snapshot root volume (patch 145)
|
||||
Resolves: rbhz#602723
|
||||
- remove hardware field from BOOTIF= (patch 148)
|
||||
Resolves: rhbz#599593
|
||||
- add aes kernel modules and fix crypt handling (patch 137, patch 140 and patch 147)
|
||||
Resolves: rhbz#600170
|
||||
|
||||
* Thu May 27 2010 Harald Hoyer <harald@redhat.com>
|
||||
- fixed Requirements
|
||||
- fixed autoip6
|
||||
Resolves: rhbz#538388
|
||||
- fixed multipath
|
||||
Resolves: rhbz#595719
|
||||
|
||||
* Thu May 06 2010 Harald Hoyer <harald@redhat.com>
|
||||
- only display short password messages
|
||||
Resolves: rhbz#561092
|
||||
|
||||
* Thu May 06 2010 Harald Hoyer <harald@redhat.com>
|
||||
- fixed dracut manpages
|
||||
Resolves: rhbz#589109
|
||||
- use ccw-init and ccw rules from s390utils
|
||||
Resolves: rhbz#533494
|
||||
- fixed fcoe
|
||||
Resolves: rhbz#486244
|
||||
- various other bugfixes seen in Fedora
|
||||
|
||||
* Tue Apr 20 2010 Harald Hoyer <harald@redhat.com>
|
||||
- fixed network with multiple nics
|
||||
- fixed nfsidmap paths
|
||||
- do not run blkid on non active container raids
|
||||
- fixed cdrom polling mechanism
|
||||
- update to latest git
|
||||
|
||||
* Thu Apr 15 2010 Harald Hoyer <harald@redhat.com>
|
||||
- fixed dracut manpages
|
||||
- dmraid parse different error messages
|
||||
- add cdrom polling mechanism for slow cdroms
|
||||
- add module btrfs
|
||||
- teach dmsquash live-root to use rootflags
|
||||
- trigger udev with action=add
|
||||
- fixed add_drivers handling
|
||||
- add sr_mod
|
||||
- use pigz instead of gzip, if available
|
||||
|
||||
* Thu Mar 25 2010 Harald Hoyer <harald@redhat.com>
|
||||
- removed firmware requirements (rhbz#572634)
|
||||
- add /etc/dracut.conf.d
|
||||
- Resolves: rhbz#572634
|
||||
|
||||
* Fri Mar 19 2010 Harald Hoyer <harald@redhat.com>
|
||||
- version 005
|
||||
|
||||
* Fri Mar 19 2010 Harald Hoyer <harald@redhat.com>
|
||||
- fixed rpmlint errors (rhbz#570547)
|
||||
- removed firmware package from dracut-kernel (rhbz#572634)
|
||||
- add dcb support to dracut's FCoE support (rhbz#563794)
|
||||
- force install some modules in hostonly mode (rhbz#573094)
|
||||
- various other bugfixes
|
||||
- Resolves: rhbz#570547, rhbz#572634, rhbz#563794, rhbz#573094
|
||||
|
||||
* Thu Feb 18 2010 Harald Hoyer <harald@redhat.com> 004-15
|
||||
- fixed "selinux=0" booting (rhbz#566376)
|
||||
- fixed internal IFS handling
|
||||
- Resolves: rhbz#566376
|
||||
|
||||
* Fri Jan 29 2010 Harald Hoyer <harald@redhat.com> 004-5
|
||||
- fixed firmware.sh bug (#559975 #559597)
|
||||
|
||||
* Tue Jan 26 2010 Harald Hoyer <harald@redhat.com> 004-4
|
||||
- add multipath check
|
||||
|
||||
* Tue Jan 26 2010 Harald Hoyer <harald@redhat.com> 004-3
|
||||
- fix selinux handling if .autorelabel is present
|
||||
- Resolves: rhbz#557744
|
||||
|
||||
* Wed Jan 20 2010 Harald Hoyer <harald@redhat.com> 004-2
|
||||
- fix emergency_shell argument parsing
|
||||
- Related: rhbz#543948
|
||||
|
||||
* Fri Jan 15 2010 Harald Hoyer <harald@redhat.com> 004-1
|
||||
- version 004
|
||||
- Resolves: rhbz#529339 rhbz#533494 rhbz#548550
|
||||
- Resolves: rhbz#548555 rhbz#553195
|
||||
|
||||
* Wed Jan 13 2010 Harald Hoyer <harald@redhat.com> 003-3
|
||||
- add Obsoletes of mkinitrd/nash/libbdevid-python
|
||||
- Related: rhbz#543948
|
||||
|
||||
* Wed Jan 13 2010 Warren Togami <wtogami@redhat.com> 003-2
|
||||
- nbd is Fedora only
|
||||
|
||||
* Fri Nov 27 2009 Harald Hoyer <harald@redhat.com> 003-1
|
||||
- version 003
|
||||
|
||||
* Mon Nov 23 2009 Harald Hoyer <harald@redhat.com> 002-26
|
||||
- add WITH_SWITCH_ROOT make flag
|
||||
- add fips requirement conditional
|
||||
- add more device mapper modules (bug #539656)
|
||||
|
||||
* Fri Nov 20 2009 Dennis Gregorovic <dgregor@redhat.com> - 002-25.1
|
||||
- nss changes for Alpha 3
|
||||
|
||||
* Thu Nov 19 2009 Harald Hoyer <harald@redhat.com> 002-25
|
||||
- add more requirements for dracut-fips (bug #539257)
|
||||
|
||||
* Tue Nov 17 2009 Harald Hoyer <harald@redhat.com> 002-24
|
||||
- put fips module in a subpackage (bug #537619)
|
||||
|
||||
* Tue Nov 17 2009 Harald Hoyer <harald@redhat.com> 002-23
|
||||
- install xdr utils for multipath (bug #463458)
|
||||
|
||||
* Thu Nov 12 2009 Harald Hoyer <harald@redhat.com> 002-22
|
||||
- add module 90multipath
|
||||
- add module 01fips
|
||||
- renamed module 95ccw to 95znet (bug #533833)
|
||||
- crypt: ignore devices in /etc/crypttab (root is not in there)
|
||||
- dasd: only install /etc/dasd.conf in hostonly mode (bug #533833)
|
||||
- zfcp: only install /etc/zfcp.conf in hostonly mode (bug #533833)
|
||||
- kernel-modules: add scsi_dh scsi_dh_rdac scsi_dh_emc (bug #527750)
|
||||
- dasd: use dasdconf.sh from s390utils (bug #533833)
|
||||
|
||||
* Fri Nov 06 2009 Harald Hoyer <harald@redhat.com> 002-21
|
||||
- fix rd_DASD argument handling (bug #531720)
|
||||
- Resolves: rhbz#531720
|
||||
|
||||
* Wed Nov 04 2009 Harald Hoyer <harald@redhat.com> 002-20
|
||||
- fix rd_DASD argument handling (bug #531720)
|
||||
- Resolves: rhbz#531720
|
||||
|
||||
* Tue Nov 03 2009 Harald Hoyer <harald@redhat.com> 002-19
|
||||
- changed rd_DASD to rd_DASD_MOD (bug #531720)
|
||||
- Resolves: rhbz#531720
|
||||
|
||||
* Tue Oct 27 2009 Harald Hoyer <harald@redhat.com> 002-18
|
||||
- renamed lvm/device-mapper udev rules according to upstream changes
|
||||
- fixed dracut search path issue
|
||||
|
||||
* Mon Oct 26 2009 Harald Hoyer <harald@redhat.com> 002-17
|
||||
- load dm_mod module (bug #530540)
|
||||
|
||||
* Fri Oct 09 2009 Jesse Keating <jkeating@redhat.com> - 002-16
|
||||
- Upgrade plymouth to Requires(pre) to make it show up before kernel
|
||||
|
||||
* Thu Oct 08 2009 Harald Hoyer <harald@redhat.com> 002-15
|
||||
- s390 ccw: s/layer1/layer2/g
|
||||
|
||||
* Thu Oct 08 2009 Harald Hoyer <harald@redhat.com> 002-14
|
||||
- add multinic support
|
||||
- add s390 zfcp support
|
||||
- add s390 network support
|
||||
|
||||
* Wed Oct 07 2009 Harald Hoyer <harald@redhat.com> 002-13
|
||||
- fixed init=<command> handling
|
||||
- kill loginit if "rdinitdebug" specified
|
||||
- run dmsquash-live-root after udev has settled (bug #527514)
|
||||
|
||||
* Tue Oct 06 2009 Harald Hoyer <harald@redhat.com> 002-12
|
||||
- add missing loginit helper
|
||||
- corrected dracut manpage
|
||||
|
||||
* Thu Oct 01 2009 Harald Hoyer <harald@redhat.com> 002-11
|
||||
- fixed dracut-gencmdline for root=UUID or LABEL
|
||||
|
||||
* Thu Oct 01 2009 Harald Hoyer <harald@redhat.com> 002-10
|
||||
- do not destroy assembled raid arrays if mdadm.conf present
|
||||
- mount /dev/shm
|
||||
- let udevd not resolve group and user names
|
||||
- preserve timestamps of tools on initramfs generation
|
||||
- generate symlinks for binaries correctly
|
||||
- moved network from udev to initqueue
|
||||
- mount nfs3 with nfsvers=3 option and retry with nfsvers=2
|
||||
- fixed nbd initqueue-finished
|
||||
- improved debug output: specifying "rdinitdebug" now logs
|
||||
to dmesg, console and /init.log
|
||||
- stop udev before killing it
|
||||
- add ghost /var/log/dracut.log
|
||||
- dmsquash: use info() and die() rather than echo
|
||||
- strip kernel modules which have no x bit set
|
||||
- redirect stdin, stdout, stderr all RW to /dev/console
|
||||
so the user can use "less" to view /init.log and dmesg
|
||||
|
||||
* Tue Sep 29 2009 Harald Hoyer <harald@redhat.com> 002-9
|
||||
- make install of new dm/lvm udev rules optionally
|
||||
- correct dasd module typo
|
||||
|
||||
* Fri Sep 25 2009 Warren Togami <wtogami@redhat.com> 002-8
|
||||
- revert back to dracut-002-5 tarball 845dd502
|
||||
lvm2 was reverted to pre-udev
|
||||
|
||||
* Wed Sep 23 2009 Harald Hoyer <harald@redhat.com> 002-7
|
||||
- build with the correct tarball
|
||||
|
||||
* Wed Sep 23 2009 Harald Hoyer <harald@redhat.com> 002-6
|
||||
- add new device mapper udev rules and dmeventd
|
||||
bug 525319, 525015
|
||||
|
||||
* Wed Sep 23 2009 Warren Togami <wtogami@redaht.com> 002-5
|
||||
- Revert back to -3, Add umount back to initrd
|
||||
This makes no functional difference to LiveCD. See Bug #525319
|
||||
|
||||
* Mon Sep 21 2009 Warren Togami <wtogami@redhat.com> 002-4
|
||||
- Fix LiveCD boot regression
|
||||
|
||||
* Mon Sep 21 2009 Harald Hoyer <harald@redhat.com> 002-3
|
||||
- bail out if selinux policy could not be loaded and
|
||||
selinux=0 not specified on kernel command line
|
||||
(bug #524113)
|
||||
- set finished criteria for dmsquash live images
|
||||
|
||||
* Fri Sep 18 2009 Harald Hoyer <harald@redhat.com> 002-2
|
||||
- do not cleanup dmraids
|
||||
- copy over lvm.conf
|
||||
|
||||
* Thu Sep 17 2009 Harald Hoyer <harald@redhat.com> 002-1
|
||||
- version 002
|
||||
- set correct PATH
|
||||
- workaround for broken mdmon implementation
|
||||
|
||||
* Wed Sep 16 2009 Harald Hoyer <harald@redhat.com> 001-12
|
||||
- removed lvm/mdraid/dmraid lock files
|
||||
- add missing ifname= files
|
||||
|
||||
* Wed Sep 16 2009 Harald Hoyer <harald@redhat.com> 001-11
|
||||
- generate dracut-version during rpm build time
|
||||
|
||||
* Tue Sep 15 2009 Harald Hoyer <harald@redhat.com> 001-10
|
||||
- add ifname= argument for persistent netdev names
|
||||
- new /initqueue-finished to check if the main loop can be left
|
||||
- copy mdadm.conf if --mdadmconf set or mdadmconf in dracut.conf
|
||||
|
||||
* Wed Sep 09 2009 Harald Hoyer <harald@redhat.com> 001-9
|
||||
- added Requires: plymouth-scripts
|
||||
|
||||
* Wed Sep 09 2009 Harald Hoyer <harald@redhat.com> 001-8
|
||||
- plymouth: use plymouth-populate-initrd
|
||||
- add add_drivers for dracut and dracut.conf
|
||||
- do not mount /proc and /selinux manually in selinux-load-policy
|
||||
|
||||
* Wed Sep 09 2009 Harald Hoyer <harald@redhat.com> 001-7
|
||||
- add scsi_wait_scan to be sure everything was scanned
|
||||
|
||||
* Tue Sep 08 2009 Harald Hoyer <harald@redhat.com> 001-6
|
||||
- fixed several problems with md raid containers
|
||||
- fixed selinux policy loading
|
||||
|
||||
* Tue Sep 08 2009 Harald Hoyer <harald@redhat.com> 001-5
|
||||
- patch does not honor file modes, fixed them manually
|
||||
|
||||
* Mon Sep 07 2009 Harald Hoyer <harald@redhat.com> 001-4
|
||||
- fixed mdraid for IMSM
|
||||
|
||||
* Mon Sep 07 2009 Harald Hoyer <harald@redhat.com> 001-3
|
||||
- fixed bug, which prevents installing 61-persistent-storage.rules (bug #520109)
|
||||
|
||||
* Thu Sep 03 2009 Harald Hoyer <harald@redhat.com> 001-2
|
||||
- fixed missing grep for md
|
||||
- reorder cleanup
|
||||
|
||||
* Wed Sep 02 2009 Harald Hoyer <harald@redhat.com> 001-1
|
||||
- version 001
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Fri Aug 14 2009 Harald Hoyer <harald@redhat.com> 0.9-1
|
||||
- version 0.9
|
||||
|
||||
* Thu Aug 06 2009 Harald Hoyer <harald@redhat.com> 0.8-1
|
||||
- version 0.8
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Fri Jul 24 2009 Harald Hoyer <harald@redhat.com> 0.7-1
|
||||
- version 0.7
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Wed Jul 22 2009 Harald Hoyer <harald@redhat.com> 0.6-1
|
||||
- version 0.6
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Fri Jul 17 2009 Harald Hoyer <harald@redhat.com> 0.5-1
|
||||
- version 0.5
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Sat Jul 04 2009 Harald Hoyer <harald@redhat.com> 0.4-1
|
||||
- version 0.4
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Thu Jul 02 2009 Harald Hoyer <harald@redhat.com> 0.3-1
|
||||
- version 0.3
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Wed Jul 01 2009 Harald Hoyer <harald@redhat.com> 0.2-1
|
||||
- version 0.2
|
||||
|
11
lsinitrd
Executable file
11
lsinitrd
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
[[ $# -eq 1 ]] || { echo "Usage: $(basename $0) <initramfs file>" ; exit 1 ; }
|
||||
[[ -f $1 ]] || { echo "$1 does not exist" ; exit 1 ; }
|
||||
|
||||
echo "$1:"
|
||||
echo "========================================================================"
|
||||
zcat $1 | cpio --extract --verbose --quiet --to-stdout 'dracut-*' 2>/dev/null
|
||||
echo "========================================================================"
|
||||
zcat $1 | cpio --extract --verbose --quiet --list
|
||||
echo "========================================================================"
|
150
mkinitrd-dracut.sh
Normal file
150
mkinitrd-dracut.sh
Normal file
@@ -0,0 +1,150 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
error() {
|
||||
local NONL=""
|
||||
if [ "$1" == "-n" ]; then
|
||||
NONL="-n"
|
||||
shift
|
||||
fi
|
||||
echo $NONL "$@" > /dev/stderr
|
||||
}
|
||||
|
||||
usage () {
|
||||
if [ "$1" == "-n" ]; then
|
||||
cmd=echo
|
||||
else
|
||||
cmd=error
|
||||
fi
|
||||
|
||||
$cmd "usage: `basename $0` [--version] [--help] [-v] [-f] [--preload <module>]"
|
||||
$cmd " [--image-version] [--with=<module>]"
|
||||
$cmd " <initrd-image> <kernel-version>"
|
||||
$cmd ""
|
||||
$cmd " (ex: `basename $0` /boot/initramfs-$(uname -r).img $(uname -r))"
|
||||
|
||||
if [ "$1" == "-n" ]; then
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
--with-usb*)
|
||||
if [ "$1" != "${1##--with-usb=}" ]; then
|
||||
usbmodule=${1##--with-usb=}
|
||||
else
|
||||
usbmodule="usb-storage"
|
||||
fi
|
||||
basicmodules="$basicmodules $usbmodule"
|
||||
unset usbmodule
|
||||
;;
|
||||
--with-avail*)
|
||||
if [ "$1" != "${1##--with-avail=}" ]; then
|
||||
modname=${1##--with-avail=}
|
||||
else
|
||||
modname=$2
|
||||
shift
|
||||
fi
|
||||
|
||||
basicmodules="$basicmodules $modname"
|
||||
;;
|
||||
--with*)
|
||||
if [ "$1" != "${1##--with=}" ]; then
|
||||
modname=${1##--with=}
|
||||
else
|
||||
modname=$2
|
||||
shift
|
||||
fi
|
||||
|
||||
basicmodules="$basicmodules $modname"
|
||||
;;
|
||||
--version)
|
||||
echo "mkinitrd: dracut compatibility wrapper"
|
||||
exit 0
|
||||
;;
|
||||
-v|--verbose)
|
||||
dracut_args="${dracut_args} -v"
|
||||
;;
|
||||
-f)
|
||||
dracut_args="${dracut_args} -f"
|
||||
;;
|
||||
--preload*)
|
||||
if [ "$1" != "${1##--preload=}" ]; then
|
||||
modname=${1##--preload=}
|
||||
else
|
||||
modname=$2
|
||||
shift
|
||||
fi
|
||||
basicmodules="$basicmodules $modname"
|
||||
;;
|
||||
--image-version)
|
||||
img_vers=yes
|
||||
;;
|
||||
--rootfs*)
|
||||
if [ "$1" != "${1##--rootfs=}" ]; then
|
||||
rootfs="${1##--rootfs=}"
|
||||
else
|
||||
rootfs="$2"
|
||||
shift
|
||||
fi
|
||||
dracut_args="${dracut_args} --filesystems $rootfs"
|
||||
;;
|
||||
--builtin*) ;;
|
||||
--without*) ;;
|
||||
--without-usb) ;;
|
||||
--fstab*) ;;
|
||||
--nocompress) ;;
|
||||
--ifneeded) ;;
|
||||
--omit-scsi-modules) ;;
|
||||
--omit-ide-modules) ;;
|
||||
--omit-raid-modules) ;;
|
||||
--omit-lvm-modules) ;;
|
||||
--omit-dmraid) ;;
|
||||
--allow-missing) ;;
|
||||
--net-dev*) ;;
|
||||
--noresume) ;;
|
||||
--rootdev*) ;;
|
||||
--thawdev*) ;;
|
||||
--rootopts*) ;;
|
||||
--root*) ;;
|
||||
--loopdev*) ;;
|
||||
--loopfs*) ;;
|
||||
--loopopts*) ;;
|
||||
--looppath*) ;;
|
||||
--dsdt*) ;;
|
||||
--bootchart) ;;
|
||||
--help)
|
||||
usage -n
|
||||
;;
|
||||
*)
|
||||
if [ -z "$target" ]; then
|
||||
target=$1
|
||||
elif [ -z "$kernel" ]; then
|
||||
kernel=$1
|
||||
else
|
||||
usage
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -z "$target" -o -z "$kernel" ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ -n "$img_vers" ]; then
|
||||
target="$target-$kernel"
|
||||
fi
|
||||
|
||||
if [ -n "$basicmodules" ]; then
|
||||
dracut -H $dracut_args --add-drivers "$basicmodules" "$target" "$kernel"
|
||||
else
|
||||
dracut -H $dracut_args "$target" "$kernel"
|
||||
fi
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
5
modules.d/00bootchart/check
Normal file
5
modules.d/00bootchart/check
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
[ -x /sbin/bootchartd ] || exit 1
|
||||
|
||||
# do not enable bootchartd by default
|
||||
exit 255
|
15
modules.d/00bootchart/install
Normal file
15
modules.d/00bootchart/install
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
inst /sbin/bootchartd
|
||||
inst /bin/bash
|
||||
ln -s /init "${initdir}/sbin/init"
|
||||
mkdir -p /lib/bootchart/
|
||||
inst /lib/bootchart/bootchart-collector
|
||||
inst /etc/bootchartd.conf
|
||||
inst /sbin/accton
|
||||
inst /usr/bin/pkill /bin/pkill
|
||||
inst /bin/echo
|
||||
inst /bin/grep
|
||||
inst /bin/usleep
|
||||
inst /usr/bin/[ /bin/[
|
||||
mknod -m 0666 "${initdir}/dev/null" c 1 3
|
5
modules.d/01fips/check
Executable file
5
modules.d/01fips/check
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
[[ $1 = -d ]] && exit 0
|
||||
exit 255
|
||||
|
70
modules.d/01fips/fips.sh
Executable file
70
modules.d/01fips/fips.sh
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/bin/sh
|
||||
do_fips()
|
||||
{
|
||||
FIPSMODULES=$(cat /etc/fipsmodules)
|
||||
BOOT=$(getarg boot=)
|
||||
KERNEL=$(uname -r)
|
||||
udevadm trigger --action=add >/dev/null 2>&1
|
||||
case "$boot" in
|
||||
block:LABEL=*|LABEL=*)
|
||||
boot="${boot#block:}"
|
||||
boot="$(echo $boot | sed 's,/,\\x2f,g')"
|
||||
boot="/dev/disk/by-label/${boot#LABEL=}"
|
||||
bootok=1 ;;
|
||||
block:UUID=*|UUID=*)
|
||||
boot="${boot#block:}"
|
||||
boot="/dev/disk/by-uuid/${root#UUID=}"
|
||||
bootok=1 ;;
|
||||
/dev/*)
|
||||
bootok=1 ;;
|
||||
esac
|
||||
|
||||
[ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version)
|
||||
|
||||
if [ $UDEVVERSION -ge 143 ]; then
|
||||
udevadm settle --exit-if-exists=$boot
|
||||
else
|
||||
udevadm settle --timeout=30
|
||||
fi
|
||||
|
||||
[ -e "$boot" ]
|
||||
|
||||
mkdir /boot
|
||||
info "Mounting $boot as /boot"
|
||||
mount -oro "$boot" /boot
|
||||
|
||||
info "Checking integrity of kernel"
|
||||
|
||||
if ! [ -e "/boot/.vmlinuz-${KERNEL}.hmac" ]; then
|
||||
warn "/boot/.vmlinuz-${KERNEL}.hmac does not exist"
|
||||
return 1
|
||||
fi
|
||||
|
||||
sha512hmac -c "/boot/.vmlinuz-${KERNEL}.hmac" || return 1
|
||||
|
||||
info "Umounting /boot"
|
||||
umount /boot
|
||||
|
||||
info "Loading and integrity checking all crypto modules"
|
||||
for module in $FIPSMODULES; do
|
||||
if [ "$module" != "tcrypt" ]; then
|
||||
modprobe ${module} || return 1
|
||||
fi
|
||||
done
|
||||
info "Self testing crypto algorithms"
|
||||
modprobe tcrypt noexit=1 || return 1
|
||||
rmmod tcrypt
|
||||
info "All initrd crypto checks done"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
if ! fipsmode=$(getarg fips) || [ $fipsmode == "0" ]; then
|
||||
rm -f /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
else
|
||||
set -e
|
||||
do_fips || die "FIPS integrity test failed"
|
||||
set +e
|
||||
fi
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
23
modules.d/01fips/install
Executable file
23
modules.d/01fips/install
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
inst_hook pre-trigger 01 "$moddir/fips.sh"
|
||||
dracut_install sha512hmac rmmod insmod mount uname umount
|
||||
|
||||
libdir="lib"
|
||||
if ldd $(find_binary sha512hmac) |grep -q /lib64/; then
|
||||
libdir="lib64"
|
||||
fi
|
||||
|
||||
if [ -e /usr/$libdir/libsoftokn3.so ]; then
|
||||
dracut_install \
|
||||
/usr/$libdir/libsoftokn3.so /usr/$libdir/libsoftokn3.chk \
|
||||
/usr/$libdir/libfreebl3.so /usr/$libdir/libfreebl3.chk
|
||||
else
|
||||
dracut_install \
|
||||
/$libdir/libsoftokn3.so /$libdir/libsoftokn3.chk \
|
||||
/$libdir/libfreebl3.so /$libdir/libfreebl3.chk
|
||||
fi
|
||||
|
||||
dracut_install /usr/$libdir/hmaccalc/sha512hmac.hmac
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
16
modules.d/01fips/installkernel
Executable file
16
modules.d/01fips/installkernel
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
FIPSMODULES="aead aes_generic aes-x86_64 ansi_cprng cbc ccm chainiv ctr"
|
||||
FIPSMODULES="$FIPSMODULES des deflate ecb eseqiv hmac seqiv sha256 sha512"
|
||||
FIPSMODULES="$FIPSMODULES cryptomgr crypto_null tcrypt"
|
||||
|
||||
mkdir -p "${initdir}/etc/modprobe.d"
|
||||
|
||||
for mod in $FIPSMODULES; do
|
||||
if instmods $mod; then
|
||||
echo $mod >> "${initdir}/etc/fipsmodules"
|
||||
echo "blacklist $mod" >> "${initdir}/etc/modprobe.d/fips.conf"
|
||||
fi
|
||||
done
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
2
modules.d/10i18n/10-console.rules
Normal file
2
modules.d/10i18n/10-console.rules
Normal file
@@ -0,0 +1,2 @@
|
||||
# Console initialization - keyboard, font, etc.
|
||||
KERNEL=="tty0", RUN+="/lib/udev/console_init %k"
|
124
modules.d/10i18n/README
Normal file
124
modules.d/10i18n/README
Normal file
@@ -0,0 +1,124 @@
|
||||
Dracut i18n module
|
||||
------------------
|
||||
|
||||
INDEX
|
||||
|
||||
0. Introduction
|
||||
1. Hostonly vs Generic
|
||||
2. Configuration
|
||||
2.1. Variables
|
||||
2.2. Setting up mappings
|
||||
2.3. Additional settings
|
||||
3. Kernel parameters
|
||||
|
||||
~
|
||||
|
||||
0. Introduction
|
||||
|
||||
i18n module provides internationalization for initramfs at runtime. It
|
||||
is intended to be generic across different GNU/Linux distributions.
|
||||
|
||||
i18n and keyboard settings are stored in different files among
|
||||
distributions. To deal with it avoiding hardcoding those differences in
|
||||
the installation script we handle it by mappings between variables used
|
||||
by Dracut and the ones in the system. Package maintainer is expected to
|
||||
create those for his/her distribution and it's appreciated to share it
|
||||
with us, so we can include it in source package.
|
||||
|
||||
|
||||
1. Hostonly vs Generic
|
||||
|
||||
If you invoke dracut with '-H' option, i18n module install script will
|
||||
gather variables values from your configuration files using mappings
|
||||
provided in "/etc/dracut.conf.d/<foo>.conf". Those variables will be
|
||||
put in "etc/sysconfig/{i18n,keyboard}" files inside initramfs image.
|
||||
Next it will install only declared font, keymaps and so.
|
||||
|
||||
When building generic image (dracut without '-H' option), install script
|
||||
copies all content of directories: consolefonts, consoletrans, unimaps
|
||||
and keymaps to image. Take into account that's about 4 MiB.
|
||||
|
||||
|
||||
2. Configuration
|
||||
|
||||
2.1. Variables
|
||||
|
||||
The following variables are used by i18n install script and at initramfs
|
||||
runtime:
|
||||
|
||||
KEYMAP - keyboard translation table loaded by loadkeys
|
||||
EXT_KEYMAPS - list of extra keymaps to bo loaded (sep. by space)
|
||||
UNICODE - boolean, indicating UTF-8 mode
|
||||
SYSFONT - console font
|
||||
CONTRANS - see description of '-m' parameter in setfont manual
|
||||
UNIMAP - see description of '-u' parameter in setfont manual
|
||||
|
||||
The following are appended to EXT_KEYMAPS only during build time:
|
||||
|
||||
UNIKEYMAP
|
||||
GRP_TOGGLE
|
||||
|
||||
They were used in 10redhat-i18n module, but not sure of its purpose.
|
||||
I'm leaving it in case... The following are taken from the environment:
|
||||
|
||||
LANG
|
||||
LC_ALL
|
||||
|
||||
If UNICODE variable is not provided, script indicates if UTF-8 should be
|
||||
used on the basis of LANG value (if it ends with ".utf8" or similar).
|
||||
|
||||
|
||||
2.2. Setting up mappings
|
||||
|
||||
Mappings between variables listed in 2.1. and the ones spread around
|
||||
your system are set up in /etc/dracut.conf.d/<foo>.conf. You need to
|
||||
assign mappings to fields keyboard_vars and i18n_vars. Here's an
|
||||
example:
|
||||
|
||||
keyboard_vars="/etc/conf.d/keymaps:KEYMAP,EXTENDED_KEYMAPS-EXT_KEYMAPS"
|
||||
i18n_vars="/etc/conf.d/consolefont:CONSOLEFONT-SYSFONT,CONSOLETRANSLATION-CONTRANS /etc/rc.conf:UNICODE"
|
||||
|
||||
First we've got name of file in host file system tree. After colon
|
||||
there's mapping: <from>-<to>. If both variables have the same name you
|
||||
can enter just a single, but it's important to specify it! The module
|
||||
will source only variables you've listed.
|
||||
|
||||
Below there's detailed description in BNF:
|
||||
|
||||
<list> ::= <element> | <element> " " <list>
|
||||
<element> ::= <conf-file-name> ":" <map-list>
|
||||
<map-list> ::= <mapping> | <mapping> "," <map-list>
|
||||
<mapping> ::= <src-var> "-" <dst-var> | <src-var>
|
||||
|
||||
We assume no whitespace are allowed between symbols.
|
||||
<conf-file-name> is a file holding <src-var> in your system.
|
||||
<src-var> is a variable holding value of meaning the same as <dst-var>.
|
||||
<dst-var> is a variable which will be set up inside initramfs.
|
||||
If <dst-var> has the same name as <src-var> we can omit <dst-var>.
|
||||
|
||||
Example:
|
||||
/etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS
|
||||
<list> = /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS
|
||||
<element> = /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS
|
||||
<conf-file-name> = /etc/conf.d/keymaps
|
||||
<map-list> = KEYMAP,extended_keymaps-EXT_KEYMAPS
|
||||
<mapping> = KEYMAP
|
||||
<src-var> = KEYMAP
|
||||
<mapping> = extended_keymaps-EXT_KEYMAPS
|
||||
<src-var> = extended_keymaps
|
||||
<dst-var> = EXT_KEYMAPS
|
||||
|
||||
|
||||
2.3. Additional settings
|
||||
|
||||
If you encounter following error message: "Directories consolefonts,
|
||||
consoletrans, keymaps, unimaps not found.", you can provide path where
|
||||
those directories lie in your system by setting kbddir in configuration
|
||||
file (the same where you put mappings).
|
||||
|
||||
|
||||
3. Kernel parameters
|
||||
|
||||
If you create generic initramfs you can set up i18n by kernel
|
||||
parameters using variables listed in 2.1. (except of UNIKEYMAP
|
||||
and GRP_TOGGLE) The recommended minimum is: SYSFONT, KEYMAP and UNICODE.
|
3
modules.d/10i18n/check
Executable file
3
modules.d/10i18n/check
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
exit 0
|
91
modules.d/10i18n/console_init
Executable file
91
modules.d/10i18n/console_init
Executable file
@@ -0,0 +1,91 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -e /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
|
||||
[ -e /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard
|
||||
|
||||
DEFAULT_SYSFONT=LatArCyrHeb-16
|
||||
DEFAULT_KEYMAP=/etc/sysconfig/console/default.kmap
|
||||
|
||||
|
||||
set_keyboard() {
|
||||
local param
|
||||
|
||||
[ "${UNICODE}" = 1 ] && param=-u || param=-a
|
||||
kbd_mode ${param}
|
||||
}
|
||||
|
||||
set_terminal() {
|
||||
local dev=$1
|
||||
|
||||
if [ "${UNICODE}" = 1 ]; then
|
||||
printf '\033%%G' >&7
|
||||
stty -F ${dev} iutf8
|
||||
else
|
||||
printf '\033%%@' >&7
|
||||
fi
|
||||
}
|
||||
|
||||
set_keymap() {
|
||||
local utf_switch
|
||||
|
||||
if [ -z "${KEYMAP}" ]; then
|
||||
[ -f "${DEFAULT_KEYMAP}" ] && KEYMAP=${DEFAULT_KEYMAP}
|
||||
fi
|
||||
|
||||
[ -n "${KEYMAP}" ] || return 1
|
||||
|
||||
[ "${UNICODE}" = 1 ] && utf_switch=-u
|
||||
|
||||
loadkeys -q ${utf_switch} ${KEYMAP} ${EXT_KEYMAPS}
|
||||
}
|
||||
|
||||
set_font() {
|
||||
local dev=$1; local trans=''; local uni=''
|
||||
|
||||
[ -z "${SYSFONT}" ] && SYSFONT=${DEFAULT_SYSFONT}
|
||||
[ -n "${CONTRANS}" ] && trans="-m ${CONTRANS}"
|
||||
[ -n "${UNIMAP}" ] && uni="-u ${UNIMAP}"
|
||||
|
||||
setfont ${SYSFONT} -C ${dev} ${trans} ${uni}
|
||||
}
|
||||
|
||||
dev_close() {
|
||||
exec 6>&-
|
||||
exec 7>&-
|
||||
}
|
||||
|
||||
dev_open() {
|
||||
local dev=$1
|
||||
|
||||
exec 6<${dev} && \
|
||||
exec 7>>${dev}
|
||||
}
|
||||
|
||||
|
||||
dev=/dev/${1#/dev/}
|
||||
devname=${dev#/dev/}
|
||||
|
||||
[ -c "${dev}" ] || {
|
||||
echo "Usage: $0 device" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ -e /tmp/console_init.${devname} ] && exit 0
|
||||
|
||||
dev_open ${dev}
|
||||
|
||||
for fd in 6 7; do
|
||||
if ! [ -t ${fd} ]; then
|
||||
echo "ERROR: File descriptor not opened: ${fd}" >&2
|
||||
dev_close
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
set_keyboard
|
||||
set_terminal ${dev}
|
||||
set_font ${dev}
|
||||
set_keymap
|
||||
|
||||
dev_close
|
||||
>/tmp/console_init.${devname}
|
195
modules.d/10i18n/install
Executable file
195
modules.d/10i18n/install
Executable file
@@ -0,0 +1,195 @@
|
||||
#!/bin/bash
|
||||
|
||||
KBDSUBDIRS=consolefonts,consoletrans,keymaps,unimaps
|
||||
DEFAULT_SYSFONT=LatArCyrHeb-16
|
||||
I18N_CONF="${initdir}/etc/sysconfig/i18n"
|
||||
KEYBOARD_CONF="${initdir}/etc/sysconfig/keyboard"
|
||||
|
||||
|
||||
# This is from 10redhat-i18n.
|
||||
findkeymap () {
|
||||
local MAP=$1
|
||||
[[ ! -f $MAP ]] && \
|
||||
MAP=$(find ${kbddir}/keymaps -type f -name $MAP -o -name $MAP.\* | head -n1)
|
||||
[[ " $KEYMAPS " = *" $MAP "* ]] && return
|
||||
KEYMAPS="$KEYMAPS $MAP"
|
||||
case $MAP in
|
||||
*.gz) cmd=zgrep;;
|
||||
*.bz2) cmd=bzgrep;;
|
||||
*) cmd=grep ;;
|
||||
esac
|
||||
|
||||
for INCL in $($cmd "^include " $MAP | cut -d' ' -f2 | tr -d '"'); do
|
||||
for FN in $(find ${kbddir}/keymaps -type f -name $INCL\*); do
|
||||
findkeymap $FN
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
# Function gathers variables from distributed files among the tree, maps to
|
||||
# specified names and prints the result in format "new-name=value".
|
||||
#
|
||||
# $@ = list in format specified below (BNF notation)
|
||||
#
|
||||
# <list> ::= <element> | <element> " " <list>
|
||||
# <element> ::= <conf-file-name> ":" <map-list>
|
||||
# <map-list> ::= <mapping> | <mapping> "," <map-list>
|
||||
# <mapping> ::= <src-var> "-" <dst-var> | <src-var>
|
||||
#
|
||||
# We assume no whitespace are allowed between symbols.
|
||||
# <conf-file-name> is a file holding <src-var> in your system.
|
||||
# <src-var> is a variable holding value of meaning the same as <dst-var>.
|
||||
# <dst-var> is a variable which will be set up inside initramfs.
|
||||
# If <dst-var> has the same name as <src-var> we can omit <dst-var>.
|
||||
#
|
||||
# Example:
|
||||
# /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS
|
||||
# <list> = /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS
|
||||
# <element> = /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS
|
||||
# <conf-file-name> = /etc/conf.d/keymaps
|
||||
# <map-list> = KEYMAP,extended_keymaps-EXT_KEYMAPS
|
||||
# <mapping> = KEYMAP
|
||||
# <src-var> = KEYMAP
|
||||
# <mapping> = extended_keymaps-EXT_KEYMAPS
|
||||
# <src-var> = extended_keymaps
|
||||
# <dst-var> = EXT_KEYMAPS
|
||||
gather_vars() {
|
||||
local item map value
|
||||
|
||||
for item in $@
|
||||
do
|
||||
item=(${item/:/ })
|
||||
for map in ${item[1]//,/ }
|
||||
do
|
||||
map=(${map//-/ })
|
||||
value=$(grep "^${map[0]}=" "${item[0]}")
|
||||
value=${value#*=}
|
||||
echo "${map[1]:-${map[0]}}=${value}"
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
install_base() {
|
||||
dracut_install setfont loadkeys kbd_mode stty
|
||||
inst ${moddir}/console_init /lib/udev/console_init
|
||||
inst_rules ${moddir}/10-console.rules
|
||||
inst_hook cmdline 20 "${moddir}/parse-i18n.sh"
|
||||
}
|
||||
|
||||
install_all_kbd() {
|
||||
local rel f
|
||||
|
||||
for f in $(eval find ${kbddir}/{${KBDSUBDIRS}} -type f -print)
|
||||
do
|
||||
inst $f
|
||||
done
|
||||
|
||||
# remove unnecessary files
|
||||
rm -f "${initdir}${kbddir}/consoletrans/utflist"
|
||||
find "${initdir}${kbddir}/" -name README\* -delete
|
||||
|
||||
dracut_install gzip bzip2
|
||||
}
|
||||
|
||||
install_local_keyboard() {
|
||||
local map
|
||||
|
||||
eval $(gather_vars ${keyboard_vars})
|
||||
|
||||
# Gentoo user may have KEYMAP set to something like "-u pl2",
|
||||
KEYMAP=${KEYMAP#-* }
|
||||
# I'm not sure of the purpose of UNIKEYMAP and GRP_TOGGLE. They were in
|
||||
# original redhat-i18n module. Anyway it won't hurt.
|
||||
EXT_KEYMAPS+=\ ${UNIKEYMAP}\ ${GRP_TOGGLE}
|
||||
|
||||
[[ ${KEYMAP} ]] || derror 'No KEYMAP.' || return 1
|
||||
findkeymap ${KEYMAP}
|
||||
|
||||
for map in ${EXT_KEYMAPS}
|
||||
do
|
||||
dinfo "Adding extra map: ${map}"
|
||||
findkeymap ${map}
|
||||
done
|
||||
|
||||
inst_opt_decompress ${KEYMAPS}
|
||||
|
||||
mksubdirs ${KEYBOARD_CONF}
|
||||
print_vars KEYMAP EXT_KEYMAPS >> ${KEYBOARD_CONF}
|
||||
}
|
||||
|
||||
install_local_i18n() {
|
||||
eval $(gather_vars ${i18n_vars})
|
||||
|
||||
[[ ${SYSFONT} ]] || SYSFONT=${DEFAULT_SYSFONT}
|
||||
SYSFONT=${SYSFONT%.psf*}
|
||||
inst_opt_decompress ${kbddir}/consolefonts/${SYSFONT}.*
|
||||
|
||||
if [[ ${CONTRANS} ]]
|
||||
then
|
||||
CONTRANS=${CONTRANS%.trans}
|
||||
inst ${kbddir}/consoletrans/${CONTRANS}.trans
|
||||
fi
|
||||
|
||||
if [[ ${UNIMAP} ]]
|
||||
then
|
||||
UNIMAP=${UNIMAP%.uni}
|
||||
inst ${kbddir}/unimaps/${UNIMAP}.uni
|
||||
fi
|
||||
|
||||
if [[ ${UNICODE} ]]
|
||||
then
|
||||
if [[ ${UNICODE^^} = YES || ${UNICODE} = 1 ]]
|
||||
then
|
||||
UNICODE=1
|
||||
elif [[ ${UNICODE^^} = NO || ${UNICODE} = 0 ]]
|
||||
then
|
||||
UNICODE=0
|
||||
else
|
||||
UNICODE=''
|
||||
fi
|
||||
fi
|
||||
if [[ ! ${UNICODE} && ${LANG^^} =~ .*\.UTF-?8 ]]
|
||||
then
|
||||
UNICODE=1
|
||||
fi
|
||||
|
||||
mksubdirs ${I18N_CONF}
|
||||
print_vars LC_ALL LANG UNICODE SYSFONT CONTRANS UNIMAP >> ${I18N_CONF}
|
||||
}
|
||||
|
||||
checks() {
|
||||
for kbddir in ${kbddir} /usr/lib/kbd /lib/kbd /usr/share
|
||||
do
|
||||
[[ -d "${kbddir}" ]] && \
|
||||
for dir in ${KBDSUBDIRS//,/ }
|
||||
do
|
||||
[[ -d "${kbddir}/${dir}" ]] && continue
|
||||
false
|
||||
done && break
|
||||
kbddir=''
|
||||
done
|
||||
|
||||
[[ ${kbddir} ]] || {
|
||||
derror "Directories ${KBDSUBDIRS//,/, } not found. Please inform us about the issue including your OS name and version."
|
||||
return 1
|
||||
}
|
||||
|
||||
[[ ! ${hostonly} || ${keyboard_vars} && ${i18n_vars} ]] || {
|
||||
derror 'Please set up keyboard_vars and i18n_vars in configuration file.'
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if checks
|
||||
then
|
||||
install_base
|
||||
|
||||
if [[ ${hostonly} ]]
|
||||
then
|
||||
install_local_keyboard
|
||||
install_local_i18n
|
||||
else
|
||||
install_all_kbd
|
||||
fi
|
||||
fi
|
24
modules.d/10i18n/parse-i18n.sh
Executable file
24
modules.d/10i18n/parse-i18n.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
inst_key_val() {
|
||||
local value
|
||||
value=$(getarg $1)
|
||||
[ -n "${value}" ] && printf '%s="%s"\n' $1 ${value} >> $2
|
||||
}
|
||||
|
||||
|
||||
mkdir -p /etc/sysconfig
|
||||
inst_key_val KEYMAP /etc/sysconfig/keyboard
|
||||
inst_key_val EXT_KEYMAPS /etc/sysconfig/keyboard
|
||||
inst_key_val UNICODE /etc/sysconfig/i18n
|
||||
inst_key_val SYSFONT /etc/sysconfig/i18n
|
||||
inst_key_val CONTRANS /etc/sysconfig/i18n
|
||||
inst_key_val UNIMAP /etc/sysconfig/i18n
|
||||
inst_key_val LANG /etc/sysconfig/i18n
|
||||
inst_key_val LC_ALL /etc/sysconfig/i18n
|
||||
|
||||
if [ -f /etc/sysconfig/i18n ]; then
|
||||
. /etc/sysconfig/i18n
|
||||
export LANG
|
||||
export LC_ALL
|
||||
fi
|
@@ -1,2 +0,0 @@
|
||||
#!/bin/sh
|
||||
[ -f /etc/redhat-release ]
|
@@ -1,63 +0,0 @@
|
||||
#!/bin/bash
|
||||
findkeymap () {
|
||||
local MAP=$1
|
||||
[[ ! -f $MAP ]] && \
|
||||
MAP=$(find /lib/kbd/keymaps -type f -name $MAP -o -name $MAP.\* | head -n1)
|
||||
[[ " $KEYMAPS " = *" $MAP "* ]] && return
|
||||
KEYMAPS="$KEYMAPS $MAP"
|
||||
case $MAP in
|
||||
*.gz) cmd=zgrep;;
|
||||
*.bz2) cmd=bzgrep;;
|
||||
*) cmd=grep ;;
|
||||
esac
|
||||
|
||||
for INCL in $($cmd "^include " $MAP | cut -d' ' -f2 | tr -d '"'); do
|
||||
for FN in $(find /lib/kbd/keymaps -type f -name $INCL\*); do
|
||||
findkeymap $FN
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
# FIXME: i18n stuff isn't really distro-independent :/
|
||||
if [[ -f /etc/sysconfig/keyboard || -f /etc/sysconfig/console/default.kmap ]]; then
|
||||
if [ -f /etc/sysconfig/console/default.kmap ]; then
|
||||
KEYMAP=/etc/sysconfig/console/default.kmap
|
||||
else
|
||||
. /etc/sysconfig/keyboard
|
||||
[[ $KEYTABLE && -d /lib/kbd/keymaps ]] && KEYMAP="$KEYTABLE.map"
|
||||
fi
|
||||
if [[ $KEYMAP ]]; then
|
||||
[ -f /etc/sysconfig/keyboard ] && inst /etc/sysconfig/keyboard
|
||||
inst loadkeys
|
||||
findkeymap $KEYMAP
|
||||
|
||||
for FN in $KEYMAPS; do
|
||||
inst $FN
|
||||
case $FN in
|
||||
*.gz) gzip -d "$initdir$FN" ;;
|
||||
*.bz2) bzip2 -d "$initdir$FN" ;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f /etc/sysconfig/i18n ]; then
|
||||
. /etc/sysconfig/i18n
|
||||
inst /etc/sysconfig/i18n
|
||||
[[ $SYSFONT ]] || SYSFONT=latarcyrheb-sun16
|
||||
inst setfont
|
||||
|
||||
for FN in /lib/kbd/consolefonts/$SYSFONT.* ; do
|
||||
inst "$FN"
|
||||
case $FN in
|
||||
*.gz) gzip -d "$initdir$FN" ;;
|
||||
*.bz2) bzip2 -d "$initdir$FN" ;;
|
||||
esac
|
||||
done
|
||||
[[ $SYSFONTACM ]] && inst /lib/kbd/consoletrans/$SYSFONTACM
|
||||
[[ $UNIMAP ]] && inst /lib/kbd/unimaps/$UNIMAP
|
||||
fi
|
||||
|
||||
dracut_install /lib/udev/console_*
|
||||
inst_rules 10-console.rules
|
||||
|
3
modules.d/10rpmversion/check
Executable file
3
modules.d/10rpmversion/check
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
[ -f /etc/redhat-release ]
|
||||
|
13
modules.d/10rpmversion/install
Executable file
13
modules.d/10rpmversion/install
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -e "$moddir/dracut-version" ]; then
|
||||
dracut_rpm_version=$(cat "$moddir/dracut-version")
|
||||
inst "$moddir/dracut-version" /$dracut_rpm_version
|
||||
else
|
||||
if rpm -qf $(which $0) &>/dev/null; then
|
||||
dracut_rpm_version=$(rpm -qf --qf '%{name}-%{version}-%{release}\n' $(which $0) | { ver="";while read line;do ver=$line;done;echo $ver;} )
|
||||
echo $dracut_rpm_version > $initdir/$dracut_rpm_version
|
||||
fi
|
||||
fi
|
||||
inst_hook cmdline 01 "$moddir/version.sh"
|
||||
|
6
modules.d/10rpmversion/version.sh
Executable file
6
modules.d/10rpmversion/version.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
for i in dracut-*; do
|
||||
if [ -f $i ]; then
|
||||
vinfo < $i
|
||||
fi
|
||||
done
|
||||
unset i
|
@@ -1,4 +1,27 @@
|
||||
#!/bin/sh
|
||||
which ip dhclient hostname >/dev/null 2>&1 || exit 1
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $1 = -d ]]; then
|
||||
[ -d /etc/sysconfig/network-scripts/ ] && echo ifcfg
|
||||
exit 0
|
||||
fi
|
||||
|
||||
. $dracutfunctions
|
||||
|
||||
for program in ip arping; do
|
||||
which $program >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
dwarning "Could not find program \"$program\" required by network."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
for program in dhclient brctl; do
|
||||
which $program >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
dwarning "Could not find program \"$program\" it might be required by network."
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
|
||||
exit 255
|
||||
|
||||
|
@@ -7,42 +7,47 @@ setup_interface() {
|
||||
bcast=$new_broadcast_address
|
||||
gw=${new_routers%%,*}
|
||||
domain=$new_domain_name
|
||||
search=$new_domain_search
|
||||
search=$(printf "$new_domain_search")
|
||||
namesrv=$new_domain_name_servers
|
||||
hostname=$new_host_name
|
||||
|
||||
[ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
||||
|
||||
if [ -n "$mtu" ] ; then
|
||||
echo ip link set $netif down
|
||||
echo ip link set $netif mtu $mtu
|
||||
echo ip link set $netif up
|
||||
# Taken from debian dhclient-script:
|
||||
# The 576 MTU is only used for X.25 and dialup connections
|
||||
# where the admin wants low latency. Such a low MTU can cause
|
||||
# problems with UDP traffic, among other things. As such,
|
||||
# disallow MTUs from 576 and below by default, so that broken
|
||||
# MTUs are ignored, but higher stuff is allowed (1492, 1500, etc).
|
||||
if [ -n "$mtu" ] && [ $mtu -gt 576 ] ; then
|
||||
echo "if ! ip link set $netif mtu $mtu ; then"
|
||||
echo "ip link set $netif down"
|
||||
echo "ip link set $netif mtu $mtu"
|
||||
echo "ip link set $netif up"
|
||||
echo wait_for_if_up $netif
|
||||
echo "fi"
|
||||
fi > /tmp/net.$netif.up
|
||||
|
||||
echo ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif >> /tmp/net.$netif.up
|
||||
|
||||
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
|
||||
|
||||
[ -n "${search}${domain}" ] && echo search $search $domain > /tmp/net.$netif.resolv.conf
|
||||
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
|
||||
[ -n "$hostname" ] && echo hostname $hostname > /tmp/net.$netif.hostname
|
||||
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
}
|
||||
|
||||
PATH=$PATH:/sbin:/usr/sbin
|
||||
|
||||
export PS4="dhclient.$interface.$$ + "
|
||||
exec >>/dev/initlog.pipe 2>>/dev/initlog.pipe
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
if getarg rdnetdebug ; then
|
||||
exec >/tmp/dhclient.$interface.$$.out
|
||||
exec 2>>/tmp/dhclient.$interface.$$.out
|
||||
set -x
|
||||
fi
|
||||
|
||||
# We already need a set netif here
|
||||
netif=$interface
|
||||
|
||||
@@ -51,17 +56,25 @@ netif=$interface
|
||||
|
||||
case $reason in
|
||||
PREINIT)
|
||||
echo "dhcp: PREINIT $netif up"
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
;;
|
||||
BOUND)
|
||||
echo "dhcp: BOND setting $netif"
|
||||
if ! arping -q -D -c 2 -I $netif $new_ip_address ; then
|
||||
warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying"
|
||||
exit 1
|
||||
fi
|
||||
setup_interface
|
||||
set | while read line; do
|
||||
[ "${line#new_}" = "$line" ] && continue
|
||||
echo "$line"
|
||||
done >/tmp/dhclient.$netif.dhcpopts
|
||||
echo online > /sys/class/net/$netif/uevent
|
||||
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
|
||||
;;
|
||||
*) ;;
|
||||
*) echo "dhcp: $reason";;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
@@ -7,14 +7,17 @@
|
||||
[ -z "$root" ] && root=$(getarg root=)
|
||||
[ -z "$netroot" ] && netroot=$(getarg netroot=)
|
||||
|
||||
if [ "$root" = "dhcp" ] || [ "$netroot" = "dhcp" ] ; then
|
||||
if [ "$root" = "dhcp" ] || [ "$root" = "dhcp6" ] || [ "$netroot" = "dhcp" ] ; then
|
||||
# Tell ip= checker that we need dhcp
|
||||
NEEDDHCP="1"
|
||||
|
||||
# Done, all good!
|
||||
rootok=1
|
||||
netroot=dhcp
|
||||
if [ "$netroot" != "dhcp" ] ; then
|
||||
netroot=$root
|
||||
fi
|
||||
|
||||
# Shut up init error check
|
||||
[ -z "$root" ] && root="dhcp"
|
||||
echo '[ -d $NEWROOT/proc -o -e /dev/root ]' > /initqueue-finished/dhcp.sh
|
||||
fi
|
||||
|
19
modules.d/40network/ifname-genrules.sh
Executable file
19
modules.d/40network/ifname-genrules.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
# if there are no ifname parameters, just use NAME=KERNEL
|
||||
if ! getarg ifname= >/dev/null ; then
|
||||
return
|
||||
fi
|
||||
|
||||
{
|
||||
for p in $(getargs ifname=); do
|
||||
parse_ifname_opts $p
|
||||
printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="%s", ATTR{type}=="1", NAME="%s"\n' "$ifname_mac" "$ifname_if"
|
||||
done
|
||||
|
||||
# Rename non named interfaces out of the way for named ones.
|
||||
for p in $(getargs ifname=); do
|
||||
parse_ifname_opts $p
|
||||
printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="?*", ATTR{type}=="1", NAME!="?*", KERNEL=="%s", NAME="%%k-renamed"\n' "$ifname_if"
|
||||
done
|
||||
} > /etc/udev/rules.d/50-ifname.rules
|
@@ -3,63 +3,101 @@
|
||||
# We don't need to check for ip= errors here, that is handled by the
|
||||
# cmdline parser script
|
||||
#
|
||||
PATH=$PATH:/sbin:/usr/sbin
|
||||
|
||||
# Sadly there's no easy way to split ':' separated lines into variables
|
||||
ip_to_var() {
|
||||
local v=${1}:
|
||||
set --
|
||||
while [ -n "$v" ]; do
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
done
|
||||
|
||||
unset ip srv gw mask hostname dev autoconf
|
||||
case $# in
|
||||
0) autoconf="error" ;;
|
||||
1) autoconf=$1 ;;
|
||||
2) dev=$1; autoconf=$2 ;;
|
||||
*) ip=$1; srv=$2; gw=$3; mask=$4; hostname=$5; dev=$6; autoconf=$7 ;;
|
||||
esac
|
||||
}
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
# Run dhclient
|
||||
do_dhcp() {
|
||||
# /sbin/dhclient-script will mark the netif up and generate the online
|
||||
# event for nfsroot
|
||||
# XXX add -V vendor class and option parsing per kernel
|
||||
dhclient -1 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif
|
||||
echo "Starting dhcp for interface $netif"
|
||||
dhclient "$@" -1 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif \
|
||||
|| echo "dhcp failed"
|
||||
}
|
||||
|
||||
load_ipv6() {
|
||||
modprobe ipv6
|
||||
i=0
|
||||
while [ ! -d /proc/sys/net/ipv6 ]; do
|
||||
i=$(($i+1))
|
||||
[ $i -gt 10 ] && break
|
||||
sleep 0.1
|
||||
done
|
||||
}
|
||||
|
||||
do_ipv6auto() {
|
||||
load_ipv6
|
||||
{
|
||||
echo 0 > /proc/sys/net/ipv6/conf/$netif/forwarding
|
||||
echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_ra
|
||||
echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_redirects
|
||||
echo ip link set $netif up
|
||||
echo wait_for_if_up $netif
|
||||
} > /tmp/net.$netif.up
|
||||
|
||||
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
|
||||
namesrv=$(getargs nameserver)
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
|
||||
|
||||
echo online > /sys/class/net/$netif/uevent
|
||||
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
|
||||
}
|
||||
|
||||
# Handle static ip configuration
|
||||
do_static() {
|
||||
{
|
||||
strstr $ip '*:*:*' && load_ipv6
|
||||
|
||||
{
|
||||
echo ip link set $netif up
|
||||
echo ip addr flush dev $netif
|
||||
echo wait_for_if_up $netif
|
||||
# do not flush addr for ipv6
|
||||
strstr $ip '*:*:*' || \
|
||||
echo ip addr flush dev $netif
|
||||
echo ip addr add $ip/$mask dev $netif
|
||||
} > /tmp/net.$netif.up
|
||||
|
||||
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
|
||||
[ -n "$hostname" ] && echo hostname $hostname > /tmp/net.$netif.hostname
|
||||
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
|
||||
namesrv=$(getargs nameserver)
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
|
||||
echo online > /sys/class/net/$netif/uevent
|
||||
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
|
||||
}
|
||||
|
||||
PATH=$PATH:/sbin:/usr/sbin
|
||||
|
||||
export PS4="ifup.$1.$$ + "
|
||||
exec >>/dev/initlog.pipe 2>>/dev/initlog.pipe
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
if getarg rdnetdebug ; then
|
||||
exec >/tmp/ifup.$1.$$.out
|
||||
exec 2>>/tmp/ifup.$1.$$.out
|
||||
set -x
|
||||
fi
|
||||
|
||||
# Huh? No $1?
|
||||
[ -z "$1" ] && exit 1
|
||||
|
||||
# $netif reads easier than $1
|
||||
netif=$1
|
||||
|
||||
# bridge this interface?
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
if [ "$netif" = "$ethname" ]; then
|
||||
netif="$bridgename"
|
||||
fi
|
||||
fi
|
||||
|
||||
# bail immediately if the interface is already up
|
||||
# or we don't need the network
|
||||
[ -f "/tmp/net.$netif.up" ] && exit 0
|
||||
@@ -77,16 +115,31 @@ fi
|
||||
|
||||
# XXX need error handling like dhclient-script
|
||||
|
||||
# start bridge if necessary
|
||||
if [ "$netif" = "$bridgename" ] && [ ! -e /tmp/net.$bridgename.up ]; then
|
||||
ip link set $ethname up
|
||||
wait_for_if_up $ethname
|
||||
# Create bridge and add eth to bridge
|
||||
brctl addbr $bridgename
|
||||
brctl setfd $bridgename 0
|
||||
brctl addif $bridgename $ethname
|
||||
fi
|
||||
|
||||
# No ip lines default to dhcp
|
||||
ip=$(getarg ip)
|
||||
[ -z "$ip" ] && do_dhcp;
|
||||
|
||||
if [ -z "$ip" ]; then
|
||||
if [ "$netroot" = "dhcp6" ]; then
|
||||
do_dhcp -6
|
||||
else
|
||||
do_dhcp -4
|
||||
fi
|
||||
fi
|
||||
|
||||
# Specific configuration, spin through the kernel command line
|
||||
# looking for ip= lines
|
||||
[ "$CMDLINE" ] || read CMDLINE </proc/cmdline;
|
||||
for p in $CMDLINE; do
|
||||
[ -n "${p%ip=*}" ] && continue
|
||||
ip_to_var ${p#ip=}
|
||||
for p in $(getargs ip=); do
|
||||
ip_to_var $p
|
||||
|
||||
# If this option isn't directed at our interface, skip it
|
||||
[ -n "$dev" ] && [ "$dev" != "$netif" ] && continue
|
||||
@@ -97,9 +150,16 @@ for p in $CMDLINE; do
|
||||
done > /tmp/net.$netif.override
|
||||
|
||||
case $autoconf in
|
||||
dhcp|on|any) do_dhcp ;;
|
||||
*) do_static ;;
|
||||
dhcp|on|any)
|
||||
do_dhcp -4 ;;
|
||||
dhcp6)
|
||||
do_dhcp -6 ;;
|
||||
auto6)
|
||||
do_ipv6auto ;;
|
||||
*)
|
||||
do_static ;;
|
||||
esac
|
||||
break
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
@@ -1,27 +1,28 @@
|
||||
#!/bin/bash
|
||||
dracut_install ip dhclient hostname
|
||||
# Include wired net drivers, excluding wireless
|
||||
for modname in $(find "/lib/modules/$kernel/kernel/drivers" -name '*.ko'); do
|
||||
if nm -uPA $modname | grep -q eth_type_trans; then
|
||||
if echo "$modname" | grep -q wireless; then
|
||||
continue
|
||||
else
|
||||
instmods $modname
|
||||
fi
|
||||
fi
|
||||
done
|
||||
dracut_install ip dhclient brctl arping
|
||||
inst "$moddir/ifup" "/sbin/ifup"
|
||||
inst "$moddir/netroot" "/sbin/netroot"
|
||||
inst "$moddir/dhclient-script" "/sbin/dhclient-script"
|
||||
inst "$moddir/dhclient.conf" "/etc/dhclient.conf"
|
||||
instmods ecb arc4
|
||||
inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
|
||||
inst_hook pre-udev 60 "$moddir/net-genrules.sh"
|
||||
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
|
||||
inst_hook cmdline 99 "$moddir/parse-ip-opts.sh"
|
||||
inst_hook cmdline 98 "$moddir/parse-bridge.sh"
|
||||
inst_hook cmdline 99 "$moddir/parse-ifname.sh"
|
||||
inst_hook pre-pivot 10 "$moddir/kill-dhclient.sh"
|
||||
|
||||
# TODO ifcfg config style is redhat specific, this should probably
|
||||
# go into its own module at one time
|
||||
inst_hook pre-pivot 20 "$moddir/write-ifcfg.sh"
|
||||
if ldd $(which sh) | grep -q lib64; then
|
||||
LIBDIR="/lib64"
|
||||
else
|
||||
LIBDIR="/lib"
|
||||
fi
|
||||
|
||||
ARCH=$(uname -m)
|
||||
|
||||
for dir in /usr/$LIBDIR/tls/$ARCH/ /usr/$LIBDIR/tls/ /usr/$LIBDIR/$ARCH/ /usr/$LIBDIR/ /$LIBDIR/; do
|
||||
for i in $(ls $dir/libnss_dns.so.* $dir/libnss_mdns4_minimal.so.* 2>/dev/null); do
|
||||
dracut_install $i
|
||||
done
|
||||
done
|
||||
|
||||
mkdir -p "${initdir}/var/run"
|
||||
|
17
modules.d/40network/installkernel
Executable file
17
modules.d/40network/installkernel
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
# Include wired net drivers, excluding wireless
|
||||
|
||||
net_module_test() {
|
||||
local net_drivers='eth_type_trans|register_virtio_device'
|
||||
local unwanted_drivers='/(wireless|isdn|uwb)/'
|
||||
egrep -q $net_drivers "$1" && \
|
||||
egrep -qv 'iw_handler_get_spy' "$1" && \
|
||||
[[ ! $1 =~ $unwanted_drivers ]]
|
||||
}
|
||||
|
||||
instmods $(filter_kernel_modules net_module_test)
|
||||
|
||||
instmods ecb arc4
|
||||
# bridge modules
|
||||
instmods bridge stp llc
|
||||
instmods ipv6
|
@@ -6,6 +6,8 @@ fix_bootif() {
|
||||
local IFS='-'
|
||||
macaddr=$(for i in ${macaddr} ; do echo -n $i:; done)
|
||||
macaddr=${macaddr%:}
|
||||
# strip hardware type field from pxelinux
|
||||
[ -n "${macaddr%??:??:??:??:??:??}" ] && macaddr=${macaddr#??:}
|
||||
echo $macaddr
|
||||
}
|
||||
|
||||
@@ -14,6 +16,11 @@ fix_bootif() {
|
||||
|
||||
# Write udev rules
|
||||
{
|
||||
# bridge: attempt only the defined interface
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
IFACES=$ethname
|
||||
fi
|
||||
|
||||
# BOOTIF says everything, use only that one
|
||||
BOOTIF=$(getarg 'BOOTIF=')
|
||||
@@ -24,7 +31,7 @@ fix_bootif() {
|
||||
# If we have to handle multiple interfaces, handle only them.
|
||||
elif [ -n "$IFACES" ] ; then
|
||||
for iface in $IFACES ; do
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", KERNEL=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$iface"
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", ENV{INTERFACE}=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$iface"
|
||||
done
|
||||
|
||||
# Default: We don't know the interface to use, handle all
|
||||
@@ -32,7 +39,4 @@ fix_bootif() {
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", RUN+="/sbin/ifup $env{INTERFACE}"\n'
|
||||
fi
|
||||
|
||||
# Udev event 'online' only gets fired from ifup/dhclient-script.
|
||||
# No special rules required
|
||||
printf 'ACTION=="online", SUBSYSTEM=="net", RUN+="/sbin/netroot $env{INTERFACE}"\n'
|
||||
} > /etc/udev/rules.d/60-net.rules
|
||||
|
@@ -4,27 +4,12 @@ PATH=$PATH:/sbin:/usr/sbin
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
if getarg rdnetdebug ; then
|
||||
exec >/tmp/netroot.$1.$$.out
|
||||
exec 2>>/tmp/netroot.$1.$$.out
|
||||
set -x
|
||||
fi
|
||||
|
||||
# Huh? Empty $1?
|
||||
[ -z "$1" ] && exit 1
|
||||
|
||||
# Huh? No interface config?
|
||||
[ ! -e /tmp/net.$1.up ] && exit 1
|
||||
|
||||
# Only try to configure from one network interface at a time
|
||||
#
|
||||
if [ -z "$NETROOT_LOCKED" ] ; then
|
||||
NETROOT_LOCKED=true
|
||||
export NETROOT_LOCKED
|
||||
exec flock -xo /tmp/netroot.lock -c "$0 $*"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# There's no sense in doing something if no (net)root info is available
|
||||
# or root is already there
|
||||
[ -e /tmp/root.info ] || exit 1
|
||||
@@ -46,7 +31,7 @@ netif=$1
|
||||
|
||||
# Figure out the handler for root=dhcp by recalling all netroot cmdline
|
||||
# handlers
|
||||
if [ "$netroot" = "dhcp" ] ; then
|
||||
if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] ; then
|
||||
# Unset root so we can check later
|
||||
unset root
|
||||
|
||||
@@ -92,6 +77,29 @@ done
|
||||
[ -e /tmp/net.$netif.hostname ] && . /tmp/net.$netif.hostname
|
||||
[ -e /tmp/net.$netif.resolv.conf ] && cp -f /tmp/net.$netif.resolv.conf /etc/resolv.conf
|
||||
|
||||
# Load interface options
|
||||
[ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
||||
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||
|
||||
# Handle STP Timeout: arping default router or if not available the
|
||||
# root server. Note: This assumes that if no router is present the
|
||||
# root server is on the same subnet.
|
||||
#
|
||||
# TODO There's some netroot variants that don't (yet) have their
|
||||
# server-ip netroot
|
||||
[ -n "$new_routers" ] && dest=${new_routers%%,*}
|
||||
[ -n "$gw" ] && dest=$gw
|
||||
if [ -z "$dest" ] ; then
|
||||
dummy=${netroot#*:}
|
||||
dummy=${dummy%%:*}
|
||||
case "$dummy" in
|
||||
[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*) dest=$dummy;;
|
||||
esac
|
||||
fi
|
||||
if [ -n "$dest" ] && ! arping -q -f -w 60 -I $netif $dest ; then
|
||||
die "Resolving $dest via ARP on $netif failed"
|
||||
fi
|
||||
|
||||
# Source netroot hooks before we start the handler
|
||||
source_all netroot
|
||||
|
||||
|
53
modules.d/40network/parse-bridge.sh
Executable file
53
modules.d/40network/parse-bridge.sh
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Format:
|
||||
# bridge=<bridgename>:<ethname>
|
||||
#
|
||||
# bridge without parameters assumes bridge=br0:eth0
|
||||
#
|
||||
|
||||
# return if bridge already parsed
|
||||
[ -n "$bridgename" ] && return
|
||||
|
||||
# Check if bridge parameter is valid
|
||||
if getarg bridge= >/dev/null ; then
|
||||
if [ -z "$netroot" ] ; then
|
||||
die "No netboot configured, bridge is invalid"
|
||||
fi
|
||||
fi
|
||||
|
||||
parsebridge() {
|
||||
local v=${1}:
|
||||
set --
|
||||
while [ -n "$v" ]; do
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
done
|
||||
|
||||
unset bridgename ethname
|
||||
case $# in
|
||||
0) bridgename=br0; ethname=eth0 ;;
|
||||
1) die "bridge= requires two parameters" ;;
|
||||
2) bridgename=$1; ethname=$2 ;;
|
||||
*) die "bridge= requires two parameters" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
unset bridgename ethname
|
||||
|
||||
# Parse bridge for bridgename and ethname
|
||||
if getarg bridge >/dev/null; then
|
||||
# Read bridge= parameters if they exist
|
||||
bridge="$(getarg bridge=)"
|
||||
if [ ! "$bridge" = "bridge" ]; then
|
||||
parsebridge "$(getarg bridge=)"
|
||||
fi
|
||||
# Simple default bridge
|
||||
if [ -z "$bridgename" ]; then
|
||||
bridgename=br0
|
||||
ethname=eth0
|
||||
fi
|
||||
echo "bridgename=$bridgename" > /tmp/bridge.info
|
||||
echo "ethname=$ethname" >> /tmp/bridge.info
|
||||
return
|
||||
fi
|
37
modules.d/40network/parse-ifname.sh
Executable file
37
modules.d/40network/parse-ifname.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Format:
|
||||
# ifname=<interface>:<mac>
|
||||
#
|
||||
# Note letters in the macaddress must be lowercase!
|
||||
#
|
||||
# Examples:
|
||||
# ifname=eth0:4a:3f:4c:04:f8:d7
|
||||
#
|
||||
# Note when using ifname= to get persistent interface names, you must specify
|
||||
# an ifname= argument for each interface used in an ip= or fcoe= argument
|
||||
|
||||
# check if there are any ifname parameters
|
||||
if ! getarg ifname= >/dev/null ; then
|
||||
return
|
||||
fi
|
||||
|
||||
parse_ifname_opts() {
|
||||
local IFS=:
|
||||
set $1
|
||||
|
||||
case $# in
|
||||
7)
|
||||
ifname_if=$1
|
||||
ifname_mac=$2:$3:$4:$5:$6:$7
|
||||
;;
|
||||
*)
|
||||
die "Invalid arguments for ifname="
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Check ifname= lines
|
||||
for p in $(getargs ifname=); do
|
||||
parse_ifname_opts $p
|
||||
done
|
@@ -12,23 +12,7 @@
|
||||
# routing,dns,dhcp-options,etc.
|
||||
#
|
||||
|
||||
# Sadly there's no easy way to split ':' separated lines into variables
|
||||
ip_to_var() {
|
||||
local v=${1}:
|
||||
set --
|
||||
while [ -n "$v" ]; do
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
done
|
||||
|
||||
unset ip srv gw mask hostname dev autoconf
|
||||
case $# in
|
||||
0) autoconf="error" ;;
|
||||
1) autoconf=$1 ;;
|
||||
2) dev=$1; autoconf=$2 ;;
|
||||
*) ip=$1; srv=$2; gw=$3; mask=$4; hostname=$5; dev=$6; autoconf=$7 ;;
|
||||
esac
|
||||
}
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
# Check if ip= lines should be used
|
||||
if getarg ip= >/dev/null ; then
|
||||
@@ -45,18 +29,16 @@ getarg ip= >/dev/null && getarg BOOTIF= >/dev/null && \
|
||||
# No more parsing stuff, BOOTIF says everything
|
||||
[ -n "$(getarg BOOTIF)" ] && return
|
||||
|
||||
# Warn if defaulting to ip=dhcp
|
||||
if [ -n "$netroot" ] && [ -z "$(getarg ip=)" ] ; then
|
||||
warn "No ip= argument(s) for netroot provided, defaulting to DHCP"
|
||||
# No ip= argument(s) for netroot provided, defaulting to DHCP
|
||||
return;
|
||||
fi
|
||||
|
||||
# Count ip= lines to decide whether we need bootdev= or not
|
||||
if [ -z "$NEEDBOOTDEV" ] ; then
|
||||
[ "$CMDLINE" ] || read CMDLINE < /proc/cmdline
|
||||
local count=0
|
||||
for p in $CMDLINE; do
|
||||
[ "${p%%=*}" = "ip" ] && count=$(( $count + 1 ))
|
||||
for p in $(getargs ip=); do
|
||||
count=$(( $count + 1 ))
|
||||
done
|
||||
[ $count -gt 1 ] && NEEDBOOTDEV=1
|
||||
fi
|
||||
@@ -69,11 +51,8 @@ fi
|
||||
|
||||
# Check ip= lines
|
||||
# XXX Would be nice if we could errorcheck ip addresses here as well
|
||||
[ "$CMDLINE" ] || read CMDLINE < /proc/cmdline
|
||||
for p in $CMDLINE; do
|
||||
[ -n "${p%ip=*}" ] && continue
|
||||
|
||||
ip_to_var ${p#ip=}
|
||||
for p in $(getargs ip=); do
|
||||
ip_to_var $p
|
||||
|
||||
# We need to have an ip= line for the specified bootdev
|
||||
[ -n "$NEEDBOOTDEV" ] && [ "$dev" = "$BOOTDEV" ] && BOOTDEVOK=1
|
||||
@@ -86,28 +65,29 @@ for p in $CMDLINE; do
|
||||
|
||||
# Error checking for autoconf in combination with other values
|
||||
case $autoconf in
|
||||
error) die "Error parsing option '$p'";;
|
||||
error) die "Error parsing option 'ip=$p'";;
|
||||
bootp|rarp|both) die "Sorry, ip=$autoconf is currenty unsupported";;
|
||||
none|off) \
|
||||
[ -z "$ip" ] && \
|
||||
die "For argument '$p'\nValue '$autoconf' without static configuration does not make sense"
|
||||
die "For argument 'ip=$p'\nValue '$autoconf' without static configuration does not make sense"
|
||||
[ -z "$mask" ] && \
|
||||
die "Sorry, automatic calculation of netmask is not yet supported"
|
||||
;;
|
||||
dhcp|on|any) \
|
||||
auto6);;
|
||||
dhcp|dhcp6|on|any) \
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
|
||||
die "Sorry, '$p' does not make sense for multiple interface configurations"
|
||||
die "Sorry, 'ip=$p' does not make sense for multiple interface configurations"
|
||||
[ -n "$ip" ] && \
|
||||
die "For argument '$p'\nSorry, setting client-ip does not make sense for '$autoconf'"
|
||||
die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoconf'"
|
||||
;;
|
||||
*) die "For argument '$p'\nSorry, unknown value '$autoconf'";;
|
||||
*) die "For argument 'ip=$p'\nSorry, unknown value '$autoconf'";;
|
||||
esac
|
||||
|
||||
if [ -n "$dev" ] ; then
|
||||
# We don't like duplicate device configs
|
||||
if [ -n "$IFACES" ] ; then
|
||||
for i in $IFACES ; do
|
||||
[ "$dev" = "$i" ] && die "For argument '$p'\nDuplication configurations for '$dev'"
|
||||
[ "$dev" = "$i" ] && die "For argument 'ip=$p'\nDuplication configurations for '$dev'"
|
||||
done
|
||||
fi
|
||||
# IFACES list for later use
|
||||
@@ -143,4 +123,4 @@ fi
|
||||
[ -n "$IFACES" ] && echo $IFACES > /tmp/net.ifaces
|
||||
|
||||
# We need a ip= line for the configured bootdev=
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$BOOTDEVOK" ] && die "Bootdev Argument '$BOOTDEV' not found"
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$BOOTDEVOK" ] && die "Bootdev Argument '$BOOTDEV' not found"
|
||||
|
@@ -1,25 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Don't write anything if we don't know our bootdev
|
||||
[ -f /tmp/net.ifaces ] || return 1
|
||||
|
||||
read IFACES < /tmp/net.ifaces
|
||||
|
||||
for netif in $IFACES ; do
|
||||
cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr
|
||||
echo "# Generated by dracut initrd" > /tmp/net.$netif.ifcfg
|
||||
echo "DEVICE=$netif" >> /tmp/net.$netif.ifcfg
|
||||
echo "HWADDR=$(cat /sys/class/net/$netif/address)" >> /tmp/net.$netif.ifcfg
|
||||
echo "TYPE=Ethernet" >> /tmp/net.$netif.ifcfg
|
||||
echo "ONBOOT=yes" >> /tmp/net.$netif.ifcfg
|
||||
if [ -f /tmp/net.$netif.lease ]; then
|
||||
echo "BOOTPROTO=dhcp" >> /tmp/net.$netif.ifcfg
|
||||
else
|
||||
echo "BOOTPROTO=none" >> /tmp/net.$netif.ifcfg
|
||||
# If we've booted with static ip= lines, the override file is there
|
||||
. /tmp/net.$netif.override
|
||||
echo "IPADDR=$ip" >> /tmp/net.$netif.ifcfg
|
||||
echo "NETMASK=$mask" >> /tmp/net.$netif.ifcfg
|
||||
[ -n "$gw" ] && echo "GATEWAY=$gw" >> /tmp/net.$netif.ifcfg
|
||||
fi
|
||||
done
|
6
modules.d/45ifcfg/check
Executable file
6
modules.d/45ifcfg/check
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# ifcfg is required by network
|
||||
#[[ $1 = -d ]] && echo network
|
||||
|
||||
exit 255
|
2
modules.d/45ifcfg/install
Executable file
2
modules.d/45ifcfg/install
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
inst_hook pre-pivot 85 "$moddir/write-ifcfg.sh"
|
70
modules.d/45ifcfg/write-ifcfg.sh
Executable file
70
modules.d/45ifcfg/write-ifcfg.sh
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/bin/sh
|
||||
|
||||
# NFS root might have reached here before /tmp/net.ifaces was written
|
||||
udevadm settle --timeout=30
|
||||
# Don't write anything if we don't know our bootdev
|
||||
[ -f /tmp/net.ifaces ] || return 1
|
||||
|
||||
read IFACES < /tmp/net.ifaces
|
||||
|
||||
for netif in $IFACES ; do
|
||||
mkdir -p /tmp/ifcfg/
|
||||
# bridge?
|
||||
unset bridge
|
||||
if [ "$netif" = "$bridgename" ]; then
|
||||
bridge=yes
|
||||
fi
|
||||
cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$netif"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
if [ -f /tmp/net.$netif.lease ]; then
|
||||
strstr "$ip" '*:*:*' &&
|
||||
echo "DHCPV6C=yes"
|
||||
echo "BOOTPROTO=dhcp"
|
||||
else
|
||||
echo "BOOTPROTO=none"
|
||||
# If we've booted with static ip= lines, the override file is there
|
||||
. /tmp/net.$netif.override
|
||||
echo "IPADDR=$ip"
|
||||
echo "NETMASK=$mask"
|
||||
[ -n "$gw" ] && echo "GATEWAY=$gw"
|
||||
fi
|
||||
} > /tmp/ifcfg/ifcfg-$netif
|
||||
|
||||
# bridge needs different things written to ifcfg
|
||||
if [ -z "$bridge" ]; then
|
||||
# standard interface
|
||||
{
|
||||
echo "HWADDR=$(cat /sys/class/net/$netif/address)"
|
||||
echo "TYPE=Ethernet"
|
||||
echo "NAME=\"Boot Disk\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
else
|
||||
# bridge
|
||||
{
|
||||
echo "TYPE=Bridge"
|
||||
echo "NAME=\"Boot Disk\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
{
|
||||
echo "DEVICE=$ethname"
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "HWADDR=$(cat /sys/class/net/$ethname/address)"
|
||||
echo "BRIDGE=$netif"
|
||||
echo "NAME=$ethname"
|
||||
} >> /tmp/ifcfg/ifcfg-$ethname
|
||||
fi
|
||||
done
|
||||
|
||||
# Pass network opts
|
||||
mkdir /dev/.initramfs/
|
||||
cp /tmp/net.* /dev/.initramfs/ >/dev/null 2>&1
|
||||
mkdir -p /dev/.initramfs/state/etc/sysconfig/network-scripts/
|
||||
cp /tmp/net.$netif.resolv.conf /dev/.initramfs/state/etc/ >/dev/null 2>&1
|
||||
echo "files /etc/sysconfig/network-scripts" > /dev/.initramfs/rwtab
|
||||
cp -a /tmp/ifcfg/* /dev/.initramfs/state/etc/sysconfig/network-scripts/ >/dev/null 2>&1
|
42
modules.d/50gensplash/README
Normal file
42
modules.d/50gensplash/README
Normal file
@@ -0,0 +1,42 @@
|
||||
Dracut gensplash module
|
||||
-----------------------
|
||||
|
||||
INDEX
|
||||
|
||||
0. Introduction
|
||||
1. Hostonly vs Generic
|
||||
2. Configuration and kernel parameters
|
||||
|
||||
~
|
||||
|
||||
0. Introduction
|
||||
|
||||
gensplash is based on Genkernel code and that's why it's Gentoo-specific. It
|
||||
requires splashutils to work. To set up theme you may edit /etc/conf.d/splash
|
||||
or set DRACUT_GENSPLASH_THEME and DRACUT_GENSPLASH_RES variables. Your theme
|
||||
has to exist in /etc/splash and for every given resolution has to exist config
|
||||
in theme's directory, e.g. there's 1024x768.cfg in /etc/splash/natural_gentoo.
|
||||
List of resolutions is comma-separated.
|
||||
|
||||
NOTE: The module will be rewritten to be distro-neutral. Its name will change
|
||||
to fbsplash.
|
||||
|
||||
|
||||
1. Hostonly vs Generic
|
||||
|
||||
All available themes are installed only if no --hostonly is specified and no
|
||||
DRACUT_GENSPLASH_THEME and DRACUT_GENSPLASH_RES are set. Otherwise those vars
|
||||
are checked and if not set then config /etc/conf.d/splash is read.
|
||||
|
||||
|
||||
2. Configuration and kernel parameters
|
||||
|
||||
Example set up by environment variables:
|
||||
DRACUT_GENSPLASH_THEME=natural_gentoo
|
||||
DRACUT_GENSPLASH_RES=1024x768,1024x600
|
||||
|
||||
Example kernel arguments:
|
||||
splash=silent,theme:natural_gentoo console=tty1 quiet
|
||||
|
||||
You may easily set up the module using Genkernel with arguments:
|
||||
--gensplash=<theme>:<res1>,<res2>,...
|
5
modules.d/50gensplash/check
Executable file
5
modules.d/50gensplash/check
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# TODO: splash_geninitramfs
|
||||
# TODO: /usr/share/splashutils/initrd.splash
|
||||
exit 255
|
5
modules.d/50gensplash/gensplash-emergency.sh
Executable file
5
modules.d/50gensplash/gensplash-emergency.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
CDROOT=0
|
||||
. /lib/gensplash-lib.sh
|
||||
splash verbose
|
5
modules.d/50gensplash/gensplash-newroot.sh
Executable file
5
modules.d/50gensplash/gensplash-newroot.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
CDROOT=0
|
||||
. /lib/gensplash-lib.sh
|
||||
splash set_msg 'Switching to new root'
|
14
modules.d/50gensplash/gensplash-pretrigger.sh
Executable file
14
modules.d/50gensplash/gensplash-pretrigger.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! getarg rd_NO_SPLASH; then
|
||||
[ -c /dev/null ] || mknod /dev/null c 1 3
|
||||
[ -c /dev/console ] || mknod /dev/console c 5 1
|
||||
[ -c /dev/tty0 ] || mknod /dev/tty0 c 4 0
|
||||
|
||||
info "Starting Gentoo Splash"
|
||||
|
||||
/lib/udev/console_init tty0
|
||||
CDROOT=0
|
||||
. /lib/gensplash-lib.sh
|
||||
splash init
|
||||
fi
|
63
modules.d/50gensplash/install
Executable file
63
modules.d/50gensplash/install
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/bin/bash
|
||||
|
||||
call_splash_geninitramfs() {
|
||||
local out ret
|
||||
|
||||
out=$(splash_geninitramfs -c "$1" ${@:2} 2>&1)
|
||||
ret=$?
|
||||
|
||||
if [[ ${out} ]]; then
|
||||
local IFS='
|
||||
'
|
||||
for line in ${out}; do
|
||||
if [[ ${line} =~ ^Warning ]]; then
|
||||
dwarning "${line}"
|
||||
else
|
||||
derror "${line}"
|
||||
(( ret == 0 )) && ret=1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
return ${ret}
|
||||
}
|
||||
|
||||
|
||||
type -P splash_geninitramfs >/dev/null || exit 1
|
||||
|
||||
opts=''
|
||||
|
||||
if [[ ${DRACUT_GENSPLASH_THEME} ]]; then
|
||||
# Variables from the environment
|
||||
# They're supposed to be set up by e.g. Genkernel in basis of cmdline args.
|
||||
# If user set them he/she would expect to be included only given theme
|
||||
# rather then all even if we're building generic initramfs.
|
||||
SPLASH_THEME=${DRACUT_GENSPLASH_THEME}
|
||||
SPLASH_RES=${DRACUT_GENSPLASH_RES}
|
||||
elif [[ ${hostonly} ]]; then
|
||||
# Settings from config only in hostonly
|
||||
[[ -e /etc/conf.d/splash ]] && source /etc/conf.d/splash
|
||||
[[ ! ${SPLASH_THEME} ]] && SPLASH_THEME=default
|
||||
[[ ${SPLASH_RES} ]] && opts+=" -r ${SPLASH_RES}"
|
||||
else
|
||||
# generic
|
||||
SPLASH_THEME=--all
|
||||
fi
|
||||
|
||||
dinfo "Installing Gentoo Splash (using the ${SPLASH_THEME} theme)"
|
||||
|
||||
pushd "${initdir}" >/dev/null
|
||||
mv dev dev.old
|
||||
call_splash_geninitramfs "${initdir}" ${opts} ${SPLASH_THEME} || {
|
||||
derror "Could not build splash"
|
||||
exit 1
|
||||
}
|
||||
rm -rf dev
|
||||
mv dev.old dev
|
||||
popd >/dev/null
|
||||
|
||||
dracut_install chvt
|
||||
inst /usr/share/splashutils/initrd.splash /lib/gensplash-lib.sh
|
||||
inst_hook pre-pivot 90 "${moddir}"/gensplash-newroot.sh
|
||||
inst_hook pre-trigger 10 "${moddir}"/gensplash-pretrigger.sh
|
||||
inst_hook emergency 50 "${moddir}"/gensplash-emergency.sh
|
@@ -1,12 +0,0 @@
|
||||
# hacky rules to try to try unlocking dm-crypt devs
|
||||
#
|
||||
# Copyright 2008, Red Hat, Inc.
|
||||
# Jeremy Katz <katzj@redhat.com>
|
||||
|
||||
|
||||
SUBSYSTEM!="block", GOTO="luks_end"
|
||||
ACTION!="add|change", GOTO="luks_end"
|
||||
|
||||
ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/initqueue --onetime /sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"
|
||||
|
||||
LABEL="luks_end"
|
@@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
[[ $1 = -d ]] && echo crypt
|
||||
[[ $1 = -d ]] && which cryptsetup &>/dev/null && echo crypt
|
||||
[[ -x /sbin/plymouthd && -x /bin/plymouth && -x /usr/sbin/plymouth-set-default-theme ]]
|
||||
|
@@ -9,13 +9,68 @@
|
||||
# we already asked for this device
|
||||
[ -f /tmp/cryptroot-asked-$2 ] && exit 0
|
||||
|
||||
# load dm_crypt if it is not already loaded
|
||||
[ -d /sys/module/dm_crypt ] || modprobe dm_crypt
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
# default luksname - luks-UUID
|
||||
luksname=$2
|
||||
|
||||
# if device name is /dev/dm-X, convert to /dev/mapper/name
|
||||
if [ "${1##/dev/dm-}" != "$1" ]; then
|
||||
device="/dev/mapper/$(dmsetup info -c --noheadings -o name "$1")"
|
||||
else
|
||||
device="$1"
|
||||
fi
|
||||
|
||||
if [ -f /etc/crypttab ] && ! getarg rd_NO_CRYPTTAB; then
|
||||
while read name dev rest; do
|
||||
# ignore blank lines and comments
|
||||
if [ -z "$name" -o "${name#\#}" != "$name" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# UUID used in crypttab
|
||||
if [ "${dev%%=*}" = "UUID" ]; then
|
||||
if [ "luks-${dev##UUID=}" = "$2" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
|
||||
# path used in crypttab
|
||||
else
|
||||
cdev=$(readlink -f $dev)
|
||||
mdev=$(readlink -f $device)
|
||||
if [ "$cdev" = "$mdev" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done < /etc/crypttab
|
||||
unset name dev rest
|
||||
fi
|
||||
|
||||
prompt="Password [$device ($luksname)]:"
|
||||
if [ ${#luksname} -gt 8 ]; then
|
||||
sluksname=${sluksname##luks-}
|
||||
sluksname=${luksname%%${luksname##????????}}
|
||||
prompt="Password for $device ($sluksname...)"
|
||||
fi
|
||||
|
||||
# flock against other interactive activities
|
||||
{ flock -s 9;
|
||||
/bin/plymouth ask-for-password --prompt "$1 is password protected" --command="/sbin/cryptsetup luksOpen -T1 $1 $2"
|
||||
/bin/plymouth ask-for-password \
|
||||
--prompt "$prompt" \
|
||||
--command="/sbin/cryptsetup luksOpen -T1 $device $luksname"
|
||||
} 9>/.console.lock
|
||||
|
||||
unset ask device luksname
|
||||
|
||||
# mark device as asked
|
||||
>> /tmp/cryptroot-asked-$2
|
||||
|
||||
exit 0
|
||||
udevsettle
|
||||
|
||||
exit 0
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
|
@@ -1,10 +1,16 @@
|
||||
#!/bin/bash
|
||||
. "$moddir"/plymouth-populate-initrd
|
||||
|
||||
if grep -q nash /usr/libexec/plymouth/plymouth-populate-initrd \
|
||||
|| ! grep -q PLYMOUTH_POPULATE_SOURCE_FUNCTIONS /usr/libexec/plymouth/plymouth-populate-initrd \
|
||||
|| [ ! -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then
|
||||
. "$moddir"/plymouth-populate-initrd
|
||||
else
|
||||
PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \
|
||||
/usr/libexec/plymouth/plymouth-populate-initrd -t $initdir
|
||||
fi
|
||||
|
||||
inst_hook pre-pivot 90 "$moddir"/plymouth-newroot.sh
|
||||
inst_hook pre-trigger 10 "$moddir"/plymouth-pretrigger.sh
|
||||
inst_hook emergency 50 "$moddir"/plymouth-emergency.sh
|
||||
inst "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask
|
||||
# Include KMS capable drm drivers
|
||||
for modname in $(find "/lib/modules/$kernel/kernel/drivers/gpu/drm" -name '*.ko'); do
|
||||
nm -uPA $modname | grep -q drm_crtc_init && instmods $modname
|
||||
done
|
||||
inst readlink
|
5
modules.d/50plymouth/installkernel
Executable file
5
modules.d/50plymouth/installkernel
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
# Include KMS capable drm drivers
|
||||
for modname in $(find "$srcmods/kernel/drivers/gpu/drm" -name '*.ko' 2>/dev/null); do
|
||||
grep -q drm_crtc_init $modname && instmods $modname
|
||||
done
|
0
modules.d/50plymouth/plymouth-emergency.sh
Normal file → Executable file
0
modules.d/50plymouth/plymouth-emergency.sh
Normal file → Executable file
@@ -8,31 +8,47 @@ PLYMOUTH_LOGO_FILE="/usr/share/pixmaps/system-logo-white.png"
|
||||
PLYMOUTH_THEME=$(plymouth-set-default-theme)
|
||||
|
||||
inst /sbin/plymouthd /bin/plymouthd
|
||||
dracut_install /bin/plymouth "${LIBDIR}/plymouth/text.so" \
|
||||
"${LIBDIR}/plymouth/details.so" \
|
||||
"/usr/share/plymouth/themes/details/details.plymouth" \
|
||||
"/usr/share/plymouth/themes/text/text.plymouth" \
|
||||
dracut_install /bin/plymouth \
|
||||
"${PLYMOUTH_LOGO_FILE}" \
|
||||
/etc/system-release
|
||||
|
||||
if [[ -f "${LIBDIR}/plymouth/${PLYMOUTH_THEME:=text}.so" ]]; then
|
||||
dracut_install "${LIBDIR}/plymouth/${PLYMOUTH_THEME:=text}.so"
|
||||
fi
|
||||
|
||||
mkdir -p "${initdir}/usr/share/plymouth"
|
||||
|
||||
if [[ -d /usr/share/plymouth/themes/${PLYMOUTH_THEME} ]]; then
|
||||
for x in "/usr/share/plymouth/themes/${PLYMOUTH_THEME}"/* ; do
|
||||
[[ -f "$x" ]] || break
|
||||
inst $x
|
||||
done
|
||||
fi
|
||||
if [[ $hostonly ]]; then
|
||||
dracut_install "${LIBDIR}/plymouth/text.so" \
|
||||
"${LIBDIR}/plymouth/details.so" \
|
||||
"/usr/share/plymouth/themes/details/details.plymouth" \
|
||||
"/usr/share/plymouth/themes/text/text.plymouth" \
|
||||
|
||||
if [ -L /usr/share/plymouth/themes/default.plymouth ]; then
|
||||
inst /usr/share/plymouth/themes/default.plymouth
|
||||
# Install plugin for this theme
|
||||
PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth |awk -F= {'print $2'})
|
||||
inst ${LIBDIR}/plymouth/${PLYMOUTH_PLUGIN}.so
|
||||
if [[ -d /usr/share/plymouth/themes/${PLYMOUTH_THEME} ]]; then
|
||||
for x in "/usr/share/plymouth/themes/${PLYMOUTH_THEME}"/* ; do
|
||||
[[ -f "$x" ]] || break
|
||||
inst $x
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -L /usr/share/plymouth/themes/default.plymouth ]; then
|
||||
inst /usr/share/plymouth/themes/default.plymouth
|
||||
# Install plugin for this theme
|
||||
PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth | while read a b c; do echo $b; done;)
|
||||
inst ${LIBDIR}/plymouth/${PLYMOUTH_PLUGIN}.so
|
||||
fi
|
||||
else
|
||||
for x in /usr/share/plymouth/themes/{text,details}/* ; do
|
||||
[[ -f "$x" ]] || continue
|
||||
THEME_DIR=$(dirname "$x")
|
||||
mkdir -p "${initdir}/$THEME_DIR"
|
||||
dracut_install "$x"
|
||||
done
|
||||
for x in ${LIBDIR}/plymouth/{text,details}.so ; do
|
||||
[[ -f "$x" ]] || continue
|
||||
[[ "$x" != "${x%%/label.so}" ]] && continue
|
||||
dracut_install "$x"
|
||||
done
|
||||
(
|
||||
cd ${initdir}/usr/share/plymouth/themes;
|
||||
ln -s text/text.plymouth default.plymouth 2>&1;
|
||||
)
|
||||
fi
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
|
@@ -1,21 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
# first trigger graphics subsystem
|
||||
udevadm trigger --attr-match=class=0x030000
|
||||
# first trigger graphics and tty subsystem
|
||||
udevadm trigger --subsystem-match=graphics --subsystem-match=tty >/dev/null 2>&1
|
||||
# add nomatch for full trigger
|
||||
udevtriggeropts="$udevtriggeropts --subsystem-nomatch=graphics --subsystem-nomatch=tty"
|
||||
if ! getarg rd_NO_PLYMOUTH; then
|
||||
[ -c /dev/null ] || mknod -m 0666 /dev/null c 1 3
|
||||
# first trigger graphics subsystem
|
||||
udevadm trigger --attr-match=class=0x030000 >/dev/null 2>&1
|
||||
# first trigger graphics and tty subsystem
|
||||
udevadm trigger --subsystem-match=graphics --subsystem-match=drm --subsystem-match=tty >/dev/null 2>&1
|
||||
|
||||
udevadm settle --timeout=30 >/dev/null 2>&1
|
||||
[ -c /dev/null ] || mknod /dev/null c 1 3
|
||||
[ -c /dev/zero ] || mknod /dev/zero c 1 5
|
||||
[ -c /dev/systty ] || mknod /dev/systty c 4 0
|
||||
[ -c /dev/fb ] || mknod /dev/fb c 29 0
|
||||
[ -c /dev/hvc0 ] || mknod /dev/hvc0 c 229 0
|
||||
udevadm settle --timeout=30 2>&1 | vinfo
|
||||
[ -c /dev/zero ] || mknod -m 0666 /dev/zero c 1 5
|
||||
[ -c /dev/tty0 ] || mknod -m 0620 /dev/tty0 c 4 0
|
||||
[ -e /dev/systty ] || ln -s tty0 /dev/systty
|
||||
[ -c /dev/fb0 ] || mknod -m 0660 /dev/fb0 c 29 0
|
||||
[ -e /dev/fb ] || ln -s fb0 /dev/fb
|
||||
[ -c /dev/hvc0 ] || mknod -m 0600 /dev/hvc0 c 229 0
|
||||
|
||||
[ -x /bin/plymouthd ] && /bin/plymouthd
|
||||
info "Starting plymouth daemon"
|
||||
[ -x /bin/plymouthd ] && /bin/plymouthd --attach-to-session
|
||||
/lib/udev/console_init tty0
|
||||
/bin/plymouth --show-splash 2>&1 | vinfo
|
||||
fi
|
||||
|
||||
/lib/udev/console_init tty0
|
||||
/bin/plymouth --show-splash
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
|
14
modules.d/60xen/check
Executable file
14
modules.d/60xen/check
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# No Xen-detect? Boo!!
|
||||
XENDETECT=$(which xen-detect 2>/dev/null)
|
||||
[ -z "$XENDETECT" ] && [ -d "/usr/lib/xen-default" ] && XENDETECT="/usr/lib/xen-default/bin/xen-detect"
|
||||
[ -z "$XENDETECT" ] && exit 1
|
||||
|
||||
. $dracutfunctions
|
||||
[[ $debug ]] && set -x
|
||||
|
||||
# Yes, we are under Xen PV env.
|
||||
$XENDETECT | egrep -q -v 'PV' || exit 0
|
||||
|
||||
exit 1
|
6
modules.d/60xen/install
Executable file
6
modules.d/60xen/install
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
XENDETECT=$(which xen-detect)
|
||||
[ -z "$XENDETECT" ] && [ -d "/usr/lib/xen-default" ] && XENDETECT="/usr/lib/xen-default/bin/xen-detect"
|
||||
inst $XENDETECT /sbin/xen-detect
|
||||
inst_hook pre-udev 40 "$moddir/xen-pre-udev.sh"
|
||||
|
9
modules.d/60xen/installkernel
Executable file
9
modules.d/60xen/installkernel
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
for i in \
|
||||
xenbus_probe_frontend xen-pcifront \
|
||||
xen-fbfront xen-kbdfront xen-blkfront xen-netfront \
|
||||
; do
|
||||
modinfo -k $kernel $i >/dev/null 2>&1 && instmods $i
|
||||
done
|
||||
|
10
modules.d/60xen/xen-pre-udev.sh
Executable file
10
modules.d/60xen/xen-pre-udev.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
xen-detect
|
||||
RC=$?
|
||||
if [ "$RC" = "1" ] ; then
|
||||
modprobe xenbus_probe_frontend
|
||||
modprobe xen-kbdfront
|
||||
modprobe xen-fbfront
|
||||
modprobe xen-blkfront
|
||||
modprobe xen-netfront
|
||||
modprobe xen-pcifront
|
||||
fi
|
8
modules.d/90btrfs/40-btrfs.rules
Normal file
8
modules.d/90btrfs/40-btrfs.rules
Normal file
@@ -0,0 +1,8 @@
|
||||
SUBSYSTEM!="block", GOTO="btrfs_end"
|
||||
ACTION!="add|change", GOTO="btrfs_end"
|
||||
|
||||
ENV{ID_FS_TYPE}=="btrfs", RUN+="/sbin/modprobe btrfs"
|
||||
ENV{ID_FS_TYPE}=="btrfs", RUN+="/sbin/btrfsctl -A $env{DEVNAME}"
|
||||
|
||||
LABEL="btrfs_end"
|
||||
|
22
modules.d/90btrfs/check
Executable file
22
modules.d/90btrfs/check
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# We depend on udev-rules being loaded
|
||||
[[ "$1" = "-d" ]] && exit 0
|
||||
|
||||
# if we don't have btrfs (btrfsctl) installed on the host system,
|
||||
# no point in trying to support it in the initramfs.
|
||||
which btrfsctl >/dev/null 2>&1 || exit 1
|
||||
|
||||
. $dracutfunctions
|
||||
[[ $debug ]] && set -x
|
||||
|
||||
is_btrfs() { get_fs_type /dev/block/$1 |grep -q btrfs; }
|
||||
|
||||
if [[ "$1" = "-h" ]]; then
|
||||
rootdev=$(find_root_block_device)
|
||||
if [[ $rootdev ]]; then
|
||||
is_btrfs "$rootdev" || exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
4
modules.d/90btrfs/install
Executable file
4
modules.d/90btrfs/install
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
inst_rules "$moddir/40-btrfs.rules"
|
||||
dracut_install btrfsctl
|
@@ -1,12 +0,0 @@
|
||||
# hacky rules to try to try unlocking dm-crypt devs
|
||||
#
|
||||
# Copyright 2008, Red Hat, Inc.
|
||||
# Jeremy Katz <katzj@redhat.com>
|
||||
|
||||
|
||||
SUBSYSTEM!="block", GOTO="luks_end"
|
||||
ACTION!="add|change", GOTO="luks_end"
|
||||
|
||||
ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/initqueue --onetime /sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"
|
||||
|
||||
LABEL="luks_end"
|
@@ -1,13 +1,28 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
# if cryptsetup is not installed, then we cannot support encrypted devices.
|
||||
which cryptsetup >/dev/null 2>&1 || exit 1
|
||||
|
||||
[ "$1" = "-d" ] && echo dm
|
||||
|
||||
# hostonly checking should only return true if root is on a LUKS device
|
||||
# in some way, but I am too lazy to figure out how to do that.
|
||||
# Instead, fail if we do not have a LUKS device in use somewhere.
|
||||
if [ "$1" = "-h" ] ; then
|
||||
blkid | grep -q crypt_LUKS || exit 1
|
||||
fi
|
||||
|
||||
. $dracutfunctions
|
||||
|
||||
is_crypt() { [[ $(get_fs_type /dev/block/$1) = crypto_LUKS ]]; }
|
||||
|
||||
[[ $1 = '-h' ]] && {
|
||||
rootdev=$(find_root_block_device)
|
||||
if [[ $rootdev ]]; then
|
||||
# root lives on a block device, so we can be more precise about
|
||||
# hostonly checking
|
||||
check_block_and_slaves is_crypt "$rootdev" || exit 1
|
||||
else
|
||||
# root is not on a block device, use the shotgun approach
|
||||
blkid | grep -q crypto\?_LUKS || exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
exit 0
|
||||
|
11
modules.d/90crypt/crypt-cleanup.sh
Executable file
11
modules.d/90crypt/crypt-cleanup.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
# close everything which is not busy
|
||||
rm -f /etc/udev/rules.d/70-luks.rules >/dev/null 2>&1
|
||||
|
||||
while true; do
|
||||
local do_break="y"
|
||||
for i in /dev/mapper/luks-*; do
|
||||
cryptsetup luksClose $i >/dev/null 2>&1 && do_break=n
|
||||
done
|
||||
[ "$do_break" = "y" ] && break
|
||||
done
|
@@ -9,13 +9,124 @@
|
||||
# we already asked for this device
|
||||
[ -f /tmp/cryptroot-asked-$2 ] && exit 0
|
||||
|
||||
# flock against other interactive activities
|
||||
{ flock -s 9;
|
||||
echo -n "$1 is password protected "
|
||||
/sbin/cryptsetup luksOpen -T1 $1 $2
|
||||
} 9>/.console.lock
|
||||
# load dm_crypt if it is not already loaded
|
||||
[ -d /sys/module/dm_crypt ] || modprobe dm_crypt
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
# default luksname - luks-UUID
|
||||
luksname=$2
|
||||
|
||||
# if device name is /dev/dm-X, convert to /dev/mapper/name
|
||||
if [ "${1##/dev/dm-}" != "$1" ]; then
|
||||
device="/dev/mapper/$(dmsetup info -c --noheadings -o name "$1")"
|
||||
else
|
||||
device="$1"
|
||||
fi
|
||||
|
||||
if [ -f /etc/crypttab ] && ! getarg rd_NO_CRYPTTAB; then
|
||||
while read name dev rest; do
|
||||
# ignore blank lines and comments
|
||||
if [ -z "$name" -o "${name#\#}" != "$name" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# UUID used in crypttab
|
||||
if [ "${dev%%=*}" = "UUID" ]; then
|
||||
if [ "luks-${dev##UUID=}" = "$2" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
|
||||
# path used in crypttab
|
||||
else
|
||||
cdev=$(readlink -f $dev)
|
||||
mdev=$(readlink -f $device)
|
||||
if [ "$cdev" = "$mdev" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done < /etc/crypttab
|
||||
unset name dev rest
|
||||
fi
|
||||
|
||||
#
|
||||
# Search key on external devices
|
||||
#
|
||||
|
||||
# Try to mount device specified by UUID and probe for existence of any of
|
||||
# the paths. On success return 0 and print "<uuid> <first-existing-path>",
|
||||
# otherwise return 1.
|
||||
# Function leaves mount point created.
|
||||
probe_keydev() {
|
||||
local uuid="$1"; shift; local keypaths="$*"
|
||||
local ret=1; local mount_point=/mnt/keydev
|
||||
local path
|
||||
|
||||
[ -n "${uuid}" -a -n "${keypaths}" ] || return 1
|
||||
[ -d ${mount_point} ] || mkdir -p "${mount_point}" || return 1
|
||||
|
||||
if mount -r -U "${uuid}" "${mount_point}" 2>/dev/null >/dev/null; then
|
||||
for path in ${keypaths}; do
|
||||
if [ -f "${mount_point}/${path}" ]; then
|
||||
echo "${uuid} ${path}"
|
||||
ret=0
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
umount "${mount_point}" 2>/dev/null >/dev/null
|
||||
|
||||
return ${ret}
|
||||
}
|
||||
|
||||
keypaths="$(getargs rd_LUKS_KEYPATH)"
|
||||
unset keydev_uuid keypath
|
||||
|
||||
if [ -n "$keypaths" ]; then
|
||||
keydev_uuids="$(getargs rd_LUKS_KEYDEV_UUID)"
|
||||
[ -n "$keydev_uuids" ] || {
|
||||
warn 'No UUID of device storing LUKS key specified.'
|
||||
warn 'It is recommended to set rd_LUKS_KEYDEV_UUID.'
|
||||
warn 'Performing scan of *all* devices accessible by UUID...'
|
||||
}
|
||||
tmp=$(foreach_uuid_until "probe_keydev \$full_uuid $keypaths" \
|
||||
$keydev_uuids) && {
|
||||
keydev_uuid="${tmp%% *}"
|
||||
keypath="${tmp#* }"
|
||||
} || {
|
||||
warn "Key for $device not found."
|
||||
}
|
||||
unset tmp keydev_uuids
|
||||
fi
|
||||
|
||||
unset keypaths
|
||||
|
||||
#
|
||||
# Open LUKS device
|
||||
#
|
||||
|
||||
info "luksOpen $device $luksname"
|
||||
|
||||
if [ -n "$keydev_uuid" ]; then
|
||||
mntp=/mnt/keydev
|
||||
mkdir -p "$mntp"
|
||||
mount -r -U "$keydev_uuid" "$mntp"
|
||||
cryptsetup -d "$mntp/$keypath" luksOpen "$device" "$luksname"
|
||||
umount "$mntp"
|
||||
rmdir -p "$mntp" 2>/dev/null
|
||||
else
|
||||
# flock against other interactive activities
|
||||
{ flock -s 9;
|
||||
echo -n "$device ($luksname) is password protected"
|
||||
cryptsetup luksOpen -T1 $1 $luksname
|
||||
} 9>/.console.lock
|
||||
fi
|
||||
|
||||
# mark device as asked
|
||||
>> /tmp/cryptroot-asked-$2
|
||||
|
||||
exit 0
|
||||
exit 0
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
inst cryptsetup
|
||||
instmods dm_crypt cbc aes sha256 xts
|
||||
inst_rules "$moddir/70-luks.rules"
|
||||
inst cryptsetup
|
||||
inst "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask
|
||||
inst_hook cmdline 30 "$moddir/parse-crypt.sh"
|
||||
inst_hook pre-pivot 30 "$moddir/crypt-cleanup.sh"
|
||||
inst /etc/crypttab
|
||||
|
3
modules.d/90crypt/installkernel
Executable file
3
modules.d/90crypt/installkernel
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
instmods dm_crypt cbc sha256 xts aes aes_generic aesni-intel aes-x86_64 fpu
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user