Compare commits
1329 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e9519a397f | ||
![]() |
2ae52e649b | ||
![]() |
57258a2c64 | ||
![]() |
1610a566c6 | ||
![]() |
7ef8ff9a2e | ||
![]() |
e59f58f854 | ||
![]() |
4073c8159c | ||
![]() |
02a0c05bf7 | ||
![]() |
016c3cfed2 | ||
![]() |
5e802b113a | ||
![]() |
f116ca115c | ||
![]() |
a12db35efa | ||
![]() |
48205bb064 | ||
![]() |
ac965cd828 | ||
![]() |
e22ad50953 | ||
![]() |
d128791b84 | ||
![]() |
1afa0cb674 | ||
![]() |
d6770cf001 | ||
![]() |
bcf94bba99 | ||
![]() |
de0b239907 | ||
![]() |
459bfe02f9 | ||
![]() |
cee3b8966c | ||
![]() |
40e27f1bf0 | ||
![]() |
31f1c02dda | ||
![]() |
0c7112fcff | ||
![]() |
588c362362 | ||
![]() |
bdf96a5d25 | ||
![]() |
5ce355f6c0 | ||
![]() |
3f02ed32a7 | ||
![]() |
e23f46e86f | ||
![]() |
6b592c1487 | ||
![]() |
e7b877427b | ||
![]() |
f295392724 | ||
![]() |
814fa9a58f | ||
![]() |
3236e662d4 | ||
![]() |
8ec1562355 | ||
![]() |
37ee12b0f3 | ||
![]() |
c60dbcc0aa | ||
![]() |
21b691152c | ||
![]() |
fefab84fff | ||
![]() |
1ddaffda88 | ||
![]() |
6d2a79432b | ||
![]() |
031bf1d0fa | ||
![]() |
1eb8e9217f | ||
![]() |
9a716018be | ||
![]() |
a9fa6d265d | ||
![]() |
d765a3e71b | ||
![]() |
6a3c2215bb | ||
![]() |
e51260e4fe | ||
![]() |
d727c5ae7b | ||
![]() |
aaced3f990 | ||
![]() |
6c706227f5 | ||
![]() |
949a077a58 | ||
![]() |
0c71fb672f | ||
![]() |
e1ed2a207b | ||
![]() |
a6c418ee43 | ||
![]() |
b6632d616f | ||
![]() |
626d9eba9c | ||
![]() |
6f09acf855 | ||
![]() |
5a10d93d29 | ||
![]() |
7b07f4e83f | ||
![]() |
a8eecab079 | ||
![]() |
d4bb431621 | ||
![]() |
3cd98a6094 | ||
![]() |
7641c73dec | ||
![]() |
40ee8c1814 | ||
![]() |
a4c235ed3a | ||
![]() |
82eea29797 | ||
![]() |
09e0549d51 | ||
![]() |
c029f4c1da | ||
![]() |
4a855e6beb | ||
![]() |
8570b544e9 | ||
![]() |
b1b678427e | ||
![]() |
9e7f495589 | ||
![]() |
f47e023498 | ||
![]() |
00d89f5170 | ||
![]() |
ceaf49d735 | ||
![]() |
8e448cadf9 | ||
![]() |
4456861f7e | ||
![]() |
2560da6be2 | ||
![]() |
34b22d6049 | ||
![]() |
e45ffb5d1f | ||
![]() |
8a29368bf1 | ||
![]() |
54703a719f | ||
![]() |
8e702c3d0f | ||
![]() |
7893469fca | ||
![]() |
4765889b2e | ||
![]() |
b038e0aac9 | ||
![]() |
d8bf119dd2 | ||
![]() |
d083dd4c39 | ||
![]() |
b52294d00b | ||
![]() |
802e7e1c2e | ||
![]() |
be1762caff | ||
![]() |
6a2a1ea75f | ||
![]() |
565f6fb675 | ||
![]() |
f2c6909468 | ||
![]() |
0e6a94b329 | ||
![]() |
cae57c60a1 | ||
![]() |
657d68cfff | ||
![]() |
20636ce09f | ||
![]() |
168fa7e571 | ||
![]() |
55468fb9b3 | ||
![]() |
7ed1de2f1d | ||
![]() |
c30c65c1b2 | ||
![]() |
2627d8a345 | ||
![]() |
5fe5c7d0b1 | ||
![]() |
0d8c1d7fa1 | ||
![]() |
0216d1cda3 | ||
![]() |
8b2896f9fa | ||
![]() |
e2c5015713 | ||
![]() |
e639630da4 | ||
![]() |
ce4359ea85 | ||
![]() |
9b30d4793d | ||
![]() |
dd483f4f42 | ||
![]() |
543f39cb52 | ||
![]() |
4826b9b0d5 | ||
![]() |
683db19a7d | ||
![]() |
1021371daf | ||
![]() |
6a0b3ccf4e | ||
![]() |
b938443e2f | ||
![]() |
7db18ccd13 | ||
![]() |
c3b0d83ddf | ||
![]() |
785a6cd21c | ||
![]() |
6f22336784 | ||
![]() |
3da7836035 | ||
![]() |
23b28c0ab5 | ||
![]() |
7573ac58f2 | ||
![]() |
6787b8ccee | ||
![]() |
00dd4db5d2 | ||
![]() |
7417574cdb | ||
![]() |
f7c05c5514 | ||
![]() |
29b10e65b1 | ||
![]() |
982e78234c | ||
![]() |
c09a9932b8 | ||
![]() |
7aa622cd14 | ||
![]() |
37b73a235a | ||
![]() |
beb015706b | ||
![]() |
6e43debe67 | ||
![]() |
09a19bb1ba | ||
![]() |
0279111026 | ||
![]() |
f58c3ccf44 | ||
![]() |
3b403b32fc | ||
![]() |
e2cdb570ae | ||
![]() |
9a5393ac7e | ||
![]() |
da5f8554a4 | ||
![]() |
ba902275d5 | ||
![]() |
3909d7edfc | ||
![]() |
2f95d699dc | ||
![]() |
d04de5fdd0 | ||
![]() |
f584c502a6 | ||
![]() |
3cf14ae1ae | ||
![]() |
7c18802966 | ||
![]() |
424ecce632 | ||
![]() |
6019e1053c | ||
![]() |
aad6898fe4 | ||
![]() |
44110df25a | ||
![]() |
c99014d5ef | ||
![]() |
a7ee1cd7f6 | ||
![]() |
c3f7567a65 | ||
![]() |
ba7457ee00 | ||
![]() |
7b069d5ea7 | ||
![]() |
c34130f705 | ||
![]() |
cc8f077e9f | ||
![]() |
ccacb45c52 | ||
![]() |
1325cddee9 | ||
![]() |
80df37f475 | ||
![]() |
979c4a9304 | ||
![]() |
4257798f8a | ||
![]() |
12b9736228 | ||
![]() |
64fcb3cce7 | ||
![]() |
336eb5b04c | ||
![]() |
f024bf0dcd | ||
![]() |
fd786adcf5 | ||
![]() |
0743486127 | ||
![]() |
bf512ee2e0 | ||
![]() |
b99dc517d6 | ||
![]() |
6a168568a5 | ||
![]() |
dbad9f4661 | ||
![]() |
7eb40c488c | ||
![]() |
2a9b703903 | ||
![]() |
65e0dd452c | ||
![]() |
5d7cdc38d0 | ||
![]() |
e1f68dc6a0 | ||
![]() |
06ae51be51 | ||
![]() |
8a6ecb19b9 | ||
![]() |
1254925f1e | ||
![]() |
a6c34848eb | ||
![]() |
182660d864 | ||
![]() |
3fc621ee45 | ||
![]() |
8234b92d85 | ||
![]() |
6822764f25 | ||
![]() |
0d837ebf2a | ||
![]() |
8f5d36896d | ||
![]() |
e365864bbc | ||
![]() |
df60555037 | ||
![]() |
6730280c5b | ||
![]() |
fb59f4c967 | ||
![]() |
77e2cadd88 | ||
![]() |
a2cb4dbc82 | ||
![]() |
36e30eb096 | ||
![]() |
03f405bc04 | ||
![]() |
4abb498d79 | ||
![]() |
ef85627e93 | ||
![]() |
486ec65745 | ||
![]() |
dd26a551c2 | ||
![]() |
93724aa28f | ||
![]() |
4c2a28c64b | ||
![]() |
2a72df9cf0 | ||
![]() |
6600691ff1 | ||
![]() |
d125a47061 | ||
![]() |
8daaa46478 | ||
![]() |
0a9d5422c6 | ||
![]() |
02c1bd6bb6 | ||
![]() |
1cd1da13da | ||
![]() |
ea8ca78af0 | ||
![]() |
dc4fc03e4b | ||
![]() |
76353076c0 | ||
![]() |
829c258554 | ||
![]() |
5dcd565dab | ||
![]() |
7838d85351 | ||
![]() |
db59288d79 | ||
![]() |
82794b4b90 | ||
![]() |
b4fbdbbe1e | ||
![]() |
9853774351 | ||
![]() |
79471f365e | ||
![]() |
98b108284c | ||
![]() |
8ee30d09a4 | ||
![]() |
01583ae4ad | ||
![]() |
249f8b5bfc | ||
![]() |
561d7f4d7c | ||
![]() |
4ad453445a | ||
![]() |
e620bb01da | ||
![]() |
7931bf0420 | ||
![]() |
c174aea07d | ||
![]() |
85323dcbb9 | ||
![]() |
8bc650d9dc | ||
![]() |
ea216a650e | ||
![]() |
a16ebfd56a | ||
![]() |
2aad23443e | ||
![]() |
8a5354a9a5 | ||
![]() |
dbf381f7fb | ||
![]() |
1080ce600a | ||
![]() |
0dd37f13c5 | ||
![]() |
6981a0bfe7 | ||
![]() |
e232c168d8 | ||
![]() |
66259efc14 | ||
![]() |
dc36969ae1 | ||
![]() |
ec88eb91d6 | ||
![]() |
9a54908fd7 | ||
![]() |
5b2cc025f4 | ||
![]() |
1489c9b1af | ||
![]() |
86d404513f | ||
![]() |
adcccd187d | ||
![]() |
956af8f26e | ||
![]() |
d60b71e8e8 | ||
![]() |
d1ef3951f3 | ||
![]() |
e27770e10c | ||
![]() |
0b70674329 | ||
![]() |
b991617f19 | ||
![]() |
9ebc51100b | ||
![]() |
0874654c78 | ||
![]() |
d6d53f60b2 | ||
![]() |
e94f4cce47 | ||
![]() |
07fa164e16 | ||
![]() |
9e7a3bf242 | ||
![]() |
0b53ca70b6 | ||
![]() |
c9f1e3d1f4 | ||
![]() |
c97e1a76f3 | ||
![]() |
94f4923039 | ||
![]() |
e86a6d390d | ||
![]() |
4af5e99124 | ||
![]() |
7bfacf2f21 | ||
![]() |
e43df9e342 | ||
![]() |
52eed26853 | ||
![]() |
4b3124ae85 | ||
![]() |
3a71443953 | ||
![]() |
5e6c3b035d | ||
![]() |
e5e5c8952d | ||
![]() |
19f3a804e7 | ||
![]() |
519d339233 | ||
![]() |
1e64e4939f | ||
![]() |
da22a02130 | ||
![]() |
432196aef8 | ||
![]() |
46265a9d3e | ||
![]() |
1953052994 | ||
![]() |
0afae1c7ce | ||
![]() |
e7b1b342bf | ||
![]() |
f709fa439b | ||
![]() |
510ef3af84 | ||
![]() |
bb08c7632a | ||
![]() |
200c7fd4b2 | ||
![]() |
4f7654715f | ||
![]() |
7fc4fb0131 | ||
![]() |
e103615be2 | ||
![]() |
d486e8f607 | ||
![]() |
66fe35eb3e | ||
![]() |
29cfd6c80b | ||
![]() |
fe17f4e86b | ||
![]() |
6927f09e1c | ||
![]() |
96d1d01572 | ||
![]() |
b151c3b1fe | ||
![]() |
28eb2436c8 | ||
![]() |
4877bb510e | ||
![]() |
2aee7e16ac | ||
![]() |
52881470ee | ||
![]() |
77e607a3a7 | ||
![]() |
1e2a167fe6 | ||
![]() |
2d7fe72bbb | ||
![]() |
661f9a3451 | ||
![]() |
8466db967e | ||
![]() |
486a1b9324 | ||
![]() |
4fea3ea6f1 | ||
![]() |
529349c66d | ||
![]() |
80bafe6d36 | ||
![]() |
7838ab5010 | ||
![]() |
5078c98abe | ||
![]() |
4c4c8b7239 | ||
![]() |
b177e9133e | ||
![]() |
9fe4f5ff25 | ||
![]() |
0ddd68f7e6 | ||
![]() |
533318113b | ||
![]() |
a5e33c7d6f | ||
![]() |
dfec8467b9 | ||
![]() |
44159d0598 | ||
![]() |
fe9cdf741f | ||
![]() |
3d88d27810 | ||
![]() |
d8e8e14e0b | ||
![]() |
fa79f00803 | ||
![]() |
b20ff981c4 | ||
![]() |
535ad9d1fb | ||
![]() |
a382492bf3 | ||
![]() |
8be12be16a | ||
![]() |
6fecffaab5 | ||
![]() |
6767fdaaed | ||
![]() |
fcbcc89bb2 | ||
![]() |
38ba0d7a62 | ||
![]() |
10b5dca0f7 | ||
![]() |
b60d5e90a5 | ||
![]() |
674bdee804 | ||
![]() |
62d0c4e7c1 | ||
![]() |
0b440844bd | ||
![]() |
724b87a6f8 | ||
![]() |
5242d8fb57 | ||
![]() |
1a0d82a3dd | ||
![]() |
ebaee770ac | ||
![]() |
ee89f47453 | ||
![]() |
58dad7025b | ||
![]() |
5d72984a01 | ||
![]() |
f90fd5b34b | ||
![]() |
9d49507f80 | ||
![]() |
e38e9e3f5e | ||
![]() |
6f590cd1c5 | ||
![]() |
41f90cbe50 | ||
![]() |
7d4f1101bc | ||
![]() |
8ce58f1f42 | ||
![]() |
2826a877af | ||
![]() |
53570e16c3 | ||
![]() |
94cce410aa | ||
![]() |
06e07df001 | ||
![]() |
9edf1b206b | ||
![]() |
440a4cc247 | ||
![]() |
b282107fa9 | ||
![]() |
0ce274f02b | ||
![]() |
c0a82e271e | ||
![]() |
ebaed7d51f | ||
![]() |
172d85b9c9 | ||
![]() |
81c6e7fb69 | ||
![]() |
f63c30d89b | ||
![]() |
1cedde0681 | ||
![]() |
c965ed2db4 | ||
![]() |
52889453c1 | ||
![]() |
534b0525a5 | ||
![]() |
051501eea6 | ||
![]() |
71df3c4329 | ||
![]() |
6ae5caf008 | ||
![]() |
b9d7fda0e1 | ||
![]() |
e6752f1a6c | ||
![]() |
46bc0593ac | ||
![]() |
76c4613abc | ||
![]() |
7238aa0cf0 | ||
![]() |
95d2dabc25 | ||
![]() |
07caee2662 | ||
![]() |
b43f4df540 | ||
![]() |
a2b5bb004d | ||
![]() |
444061de67 | ||
![]() |
ee1fa07f3d | ||
![]() |
cf3bc080c1 | ||
![]() |
2ca68bb82b | ||
![]() |
e2d86d001a | ||
![]() |
8082a0946e | ||
![]() |
79799c954f | ||
![]() |
1b434f1ba9 | ||
![]() |
3003cfdf9e | ||
![]() |
7c6eb15280 | ||
![]() |
ab9b7eee0a | ||
![]() |
3f003263d2 | ||
![]() |
b9cc6f7ca9 | ||
![]() |
5b928ffade | ||
![]() |
ae202ef02e | ||
![]() |
7f7a91b75f | ||
![]() |
770b796e52 | ||
![]() |
b2415f4414 | ||
![]() |
2eea164db7 | ||
![]() |
7a8a33b6cd | ||
![]() |
325d491360 | ||
![]() |
91f4d45f93 | ||
![]() |
c7e72136b2 | ||
![]() |
8844cd6b6c | ||
![]() |
ccb0ab7348 | ||
![]() |
5023964844 | ||
![]() |
4af673c3f8 | ||
![]() |
5dc6f24085 | ||
![]() |
e53fdd1c35 | ||
![]() |
040f3d2ffc | ||
![]() |
d884af8077 | ||
![]() |
a4f88b8a49 | ||
![]() |
3d7c58ca1e | ||
![]() |
ce51f3be11 | ||
![]() |
4cba811f6c | ||
![]() |
85de3d281a | ||
![]() |
3817c2f138 | ||
![]() |
13af399f65 | ||
![]() |
2cbcbd7532 | ||
![]() |
c2c3108882 | ||
![]() |
cd7ee4913d | ||
![]() |
856285aa90 | ||
![]() |
0e08f1de8d | ||
![]() |
161da365e2 | ||
![]() |
dbcc4e94c5 | ||
![]() |
d118a5990a | ||
![]() |
498a131239 | ||
![]() |
9840eaade6 | ||
![]() |
f8fcc56ed9 | ||
![]() |
1c290032a4 | ||
![]() |
1fbe575888 | ||
![]() |
6545b9d792 | ||
![]() |
67bde9f067 | ||
![]() |
921f4b5b52 | ||
![]() |
7853bbfa7d | ||
![]() |
c79517b4d9 | ||
![]() |
5e1898fa5a | ||
![]() |
11a2ab6228 | ||
![]() |
c56e44a63a | ||
![]() |
3871942d13 | ||
![]() |
07ecac56da | ||
![]() |
5ce6642fed | ||
![]() |
fb4ba86f44 | ||
![]() |
353ef76019 | ||
![]() |
44b013967a | ||
![]() |
67c0c1847b | ||
![]() |
544de3c87f | ||
![]() |
1be365c500 | ||
![]() |
13f91fc78d | ||
![]() |
256a816c9f | ||
![]() |
ee6fa3240d | ||
![]() |
9b79345001 | ||
![]() |
51c977d1ff | ||
![]() |
577b1fc833 | ||
![]() |
6ef8e5b4d3 | ||
![]() |
9bfff3746f | ||
![]() |
b2559a8895 | ||
![]() |
51b28ba9c4 | ||
![]() |
c8584872be | ||
![]() |
387bf82e30 | ||
![]() |
11adeb7c01 | ||
![]() |
3afca618da | ||
![]() |
2c1f37d45c | ||
![]() |
fa7ada31d0 | ||
![]() |
54b01e99d3 | ||
![]() |
75bb595c6c | ||
![]() |
490f98aa6c | ||
![]() |
e6b637b067 | ||
![]() |
453fd25152 | ||
![]() |
228694e5a9 | ||
![]() |
c54f73a2ff | ||
![]() |
d9416c0df5 | ||
![]() |
771c215192 | ||
![]() |
0a70f452bb | ||
![]() |
bfd602f849 | ||
![]() |
8541b35ed7 | ||
![]() |
57a49c6727 | ||
![]() |
96fb9c8dd7 | ||
![]() |
6daac70e55 | ||
![]() |
d4916e36d0 | ||
![]() |
1b4a9d8ad8 | ||
![]() |
6bde7a17be | ||
![]() |
9d1015b646 | ||
![]() |
2ca35ac7ee | ||
![]() |
4bacdf2811 | ||
![]() |
94388aaffa | ||
![]() |
a8a949d9e5 | ||
![]() |
1b29b0f7cf | ||
![]() |
ecefdfc280 | ||
![]() |
b2dff45423 | ||
![]() |
1f9de919e0 | ||
![]() |
0437ced41d | ||
![]() |
90ccb5efe7 | ||
![]() |
647bef8ca6 | ||
![]() |
2d9f5858bc | ||
![]() |
5b11bb734a | ||
![]() |
430bfefda3 | ||
![]() |
3636d59e38 | ||
![]() |
9346982f22 | ||
![]() |
48d2199e94 | ||
![]() |
f8bc899063 | ||
![]() |
cc02093d69 | ||
![]() |
d95d2f3b44 | ||
![]() |
a79f11d254 | ||
![]() |
89fb4162e3 | ||
![]() |
dab1a1dc99 | ||
![]() |
4c77612245 | ||
![]() |
5acc508cae | ||
![]() |
f844e7dc8f | ||
![]() |
620d031534 | ||
![]() |
e4e3b4c821 | ||
![]() |
094d9cae63 | ||
![]() |
eaa62cd541 | ||
![]() |
ae24b1146b | ||
![]() |
0a325a917d | ||
![]() |
7254c24a76 | ||
![]() |
55309e7800 | ||
![]() |
fa5cd2bf50 | ||
![]() |
1ad309fbc6 | ||
![]() |
f3af7bd66b | ||
![]() |
5fce1ef0c9 | ||
![]() |
85ab21a6e0 | ||
![]() |
1de37e808c | ||
![]() |
b2ff4317f1 | ||
![]() |
690396a5b1 | ||
![]() |
5bc545ed79 | ||
![]() |
644c5241d2 | ||
![]() |
937f678ef6 | ||
![]() |
5b158ad3a9 | ||
![]() |
afbeadb9da | ||
![]() |
8a4745694b | ||
![]() |
ebfdb219c6 | ||
![]() |
6438b4fedf | ||
![]() |
eebc929abb | ||
![]() |
0e4fee3d5a | ||
![]() |
3478b3146f | ||
![]() |
cfa5a0da6d | ||
![]() |
c033d96e49 | ||
![]() |
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 |
11
.gitignore
vendored
11
.gitignore
vendored
@@ -1,3 +1,10 @@
|
||||
/dracut.8
|
||||
/dracut-catimages.8
|
||||
/dracut.conf.5
|
||||
/dracut.conf.d/*.conf
|
||||
/dracut-gencmdline.8
|
||||
/dracut.html
|
||||
/dracut.kernel.7
|
||||
/modules.d/99base/switch_root
|
||||
/test/*/test.log
|
||||
test*.img
|
||||
modules.d/99base/switch_root
|
||||
*~
|
||||
|
9
.mailmap
Normal file
9
.mailmap
Normal file
@@ -0,0 +1,9 @@
|
||||
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)>
|
||||
Mike Snitzer <snitzer@redhat.com> <msnitzer@redhat.com>
|
||||
Amerigo Wang <amwang@redhat.com> <xiyou.wangcong@gmail.com>
|
||||
|
63
AUTHORS
63
AUTHORS
@@ -1,11 +1,58 @@
|
||||
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>
|
||||
|
||||
Amadeusz Żołnowski <aidecoe@aidecoe.name>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Michal Soltys <soltys@ziu.info>
|
||||
Will Woods <wwoods@redhat.com>
|
||||
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>
|
||||
Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
Roberto Sassu <roberto.sassu@polito.it>
|
||||
Amerigo Wang <amwang@redhat.com>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
David Cantrell <dcantrell@redhat.com>
|
||||
Lance Albertson <lance@osuosl.org>
|
||||
Marian Ganisin <mganisin@redhat.com>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
||||
Alan Pevec <apevec@redhat.com>
|
||||
Dan Horák <dan@danny.cz>
|
||||
Joey Boggs <jboggs@redhat.com>
|
||||
Jon Ander Hernandez <jonan.h@gmail.com>
|
||||
Mike Snitzer <snitzer@redhat.com>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Vladislav Bogdanov <bubble@hoster-ok.com>
|
||||
Alexander Todorov <atodorov@redhat.com>
|
||||
Andy Lutomirski <luto@mit.edu>
|
||||
Christian Heinz <christian.ch.heinz@gmail.com>
|
||||
Dan Horák <dhorak@redhat.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
Frederic Crozat <fcrozat@mandriva.com>
|
||||
Glen Gray <slaine@slaine.org>
|
||||
Ian Dall <ian@beware.dropbear.id.au>
|
||||
James Laska <jlaska@redhat.com>
|
||||
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
Matt <smoothsailing72@hotmail.com>
|
||||
Matt Smith <shadowfax@gmx.com>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Munehiro Matsuda <haro@kgt.co.jp>
|
||||
Pádraig Brady <P@draigBrady.com>
|
||||
Quentin Armitage <quentin@armitage.org.uk>
|
||||
Sergey Fionov <fionov@gmail.com>
|
||||
Thilo Bangert <thilo.bangert@gmx.net>
|
||||
Thomas Lange <lange@informatik.uni-koeln.de>
|
||||
Tomasz Torcz <tomek@pipebreaker.pl>
|
||||
Vadim Kuznetsov <vadimk@gentoo.org>
|
||||
Ville Skyttä <ville.skytta@iki.fi>
|
||||
Yanko Kaneti <yaneti@declera.com>
|
||||
maximilian attems <max@stro.at>
|
||||
|
6
HACKING
6
HACKING
@@ -1,11 +1,11 @@
|
||||
Right now, most of the testing is done using a qemu/kvm guest and
|
||||
generating the initramfs on another box but the support is all present
|
||||
to build for the "running" machine. For the former, you can boot the guest
|
||||
using qemu's -kernel and -initrd options.
|
||||
using qemu's -kernel and -initrd options.
|
||||
|
||||
dracut exists and will build an image. It is command-line equivalent
|
||||
to most mkinitrd implementations and should be pretty straight-forward
|
||||
to use.
|
||||
to use.
|
||||
|
||||
To use, just run dracut with an output file name and, optionally, a
|
||||
kernel version (it defaults to using the current). The appropriate
|
||||
@@ -14,7 +14,7 @@ like to customize the list of modules copied in, edit /etc/dracut.conf
|
||||
and set
|
||||
dracutmodules="foo bar baz"
|
||||
|
||||
Note that dracut calls functional components in modules.d "modules"
|
||||
Note that dracut calls functional components in modules.d "modules"
|
||||
while kernel modules are called "drivers".
|
||||
|
||||
Requirements:
|
||||
|
106
Makefile
106
Makefile
@@ -1,65 +1,105 @@
|
||||
VERSION=0.4
|
||||
VERSION=013
|
||||
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
|
||||
|
||||
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
|
||||
manpages = dracut.8 dracut.kernel.7 dracut.conf.5 dracut-catimages.8 dracut-gencmdline.8
|
||||
|
||||
all: modules.d/99base/switch_root
|
||||
.PHONY: install clean archive rpm testimage test all check AUTHORS doc
|
||||
|
||||
.PHONY: install clean archive rpm testimage test all check
|
||||
doc: $(manpages) dracut.html
|
||||
all: syncheck
|
||||
|
||||
install:
|
||||
%: %.xml
|
||||
xsltproc -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
|
||||
|
||||
dracut.html: dracut.xml $(manpages)
|
||||
xsltproc -o dracut.html --xinclude -nonet \
|
||||
--stringparam draft.mode yes \
|
||||
--stringparam html.stylesheet http://docs.redhat.com/docs/en-US/Common_Content/css/default.css \
|
||||
http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl dracut.xml
|
||||
|
||||
install: doc
|
||||
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 modules.d/99base/switch_root $(DESTDIR)$(sbindir)/switch_root
|
||||
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
|
||||
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
|
||||
install -m 0755 dracut-logger $(DESTDIR)$(pkglibdir)/dracut-logger
|
||||
cp -arx modules.d $(DESTDIR)$(pkglibdir)
|
||||
install -m 0644 dracut.8 $(DESTDIR)$(mandir)/man8
|
||||
rm $(DESTDIR)$(pkglibdir)/modules.d/99base/switch_root
|
||||
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
|
||||
|
||||
clean:
|
||||
rm -f *~
|
||||
rm -f modules.d/99base/switch_root
|
||||
rm -f test-*.img
|
||||
make -C test clean
|
||||
$(RM) *~
|
||||
$(RM) */*~
|
||||
$(RM) */*/*~
|
||||
$(RM) test-*.img
|
||||
$(RM) dracut-*.rpm dracut-*.tar.bz2
|
||||
$(RM) $(manpages) dracut.html
|
||||
$(MAKE) -C test clean
|
||||
|
||||
archive: dracut-$(VERSION)-$(GITVERSION).tar.bz2
|
||||
|
||||
dist: dracut-$(VERSION).tar.bz2
|
||||
dist: dracut-$(VERSION).tar.gz
|
||||
|
||||
dracut-$(VERSION).tar.bz2:
|
||||
git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ |bzip2 > dracut-$(VERSION).tar.bz2
|
||||
|
||||
dracut-$(VERSION)-$(GITVERSION).tar.bz2:
|
||||
git archive --format=tar HEAD --prefix=dracut-$(VERSION)-$(GITVERSION)/ |bzip2 > dracut-$(VERSION)-$(GITVERSION).tar.bz2
|
||||
|
||||
dracut-$(VERSION).tar.gz:
|
||||
git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ |gzip > dracut-$(VERSION).tar.gz
|
||||
|
||||
rpm: 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
|
||||
mkdir -p rpmbuild
|
||||
cp dracut-$(VERSION).tar.bz2 rpmbuild
|
||||
cd rpmbuild; ../git2spec.pl $(VERSION) < ../dracut.spec > dracut.spec; \
|
||||
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
|
||||
--define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \
|
||||
--define "_rpmdir $$PWD" -ba dracut.spec && \
|
||||
( cd ..; mv rpmbuild/noarch/*.rpm .; mv rpmbuild/*.src.rpm .;rm -fr rpmbuild; ls *.rpm )
|
||||
|
||||
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
|
||||
rm -fr BUILD BUILDROOT
|
||||
|
||||
check: all
|
||||
@ret=0;for i in modules.d/99base/init modules.d/*/*.sh; do \
|
||||
syncheck:
|
||||
@ret=0;for i in dracut-logger modules.d/99base/init modules.d/*/*.sh; do \
|
||||
[ "$${i##*/}" = "module-setup.sh" ] && continue; \
|
||||
[ "$${i##*/}" = "caps.sh" ] && continue; \
|
||||
dash -n "$$i" ; ret=$$(($$ret+$$?)); \
|
||||
done;exit $$ret
|
||||
make -C test check
|
||||
@ret=0;for i in dracut modules.d/02caps/caps.sh modules.d/*/module-setup.sh; do \
|
||||
bash -n "$$i" ; ret=$$(($$ret+$$?)); \
|
||||
done;exit $$ret
|
||||
|
||||
check: all syncheck
|
||||
$(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
|
||||
|
383
NEWS
Normal file
383
NEWS
Normal file
@@ -0,0 +1,383 @@
|
||||
dracut-013
|
||||
==========
|
||||
- speedup of initramfs creation
|
||||
- fixed inst_dir for symbolic links
|
||||
- add unix kernel module
|
||||
|
||||
dracut-012
|
||||
==========
|
||||
- better fsck handling
|
||||
- fixed wait condition for LVM volumes
|
||||
- fix for hardlinks (welcome Debian! :-)
|
||||
- shutdown bugfixes
|
||||
- automatic busybox symlink creation
|
||||
- try to mount /usr, if init points to a path in /usr
|
||||
- btrfs with multiple devices
|
||||
- "--force-add" option for dracut, to force-add dracut modules,
|
||||
without hostonly checks
|
||||
- lsinitrd also display the initramfs size in human readable form
|
||||
- livenet module, to mount live-isos over http
|
||||
- masterkey,ecryptfs,integrity security modules
|
||||
- initqueue/timeout queue e.g. for starting degraded raids
|
||||
- "make rpm" creates an rpm with an increasing release number from any
|
||||
git checkout
|
||||
- support lvm mirrors
|
||||
- start degraded lvm mirrors after a timeout
|
||||
- start degraded md raids after a timeout
|
||||
- getarg() now returns wildcards without file matching to the current fs
|
||||
- lots of bugfixes
|
||||
|
||||
dracut-011
|
||||
==========
|
||||
- use udev-168 features for shutting down udev
|
||||
- introduce "--prefix" to put all initramfs files in e.g "/run/initramfs"
|
||||
- new shutdown script (called by systemd >= 030) to disassemble the root device
|
||||
- lots of bugfixes
|
||||
- new module for gpg-encrypted keys - 91crypt-gpg
|
||||
|
||||
dracut-010
|
||||
==========
|
||||
- lots of bugfixes
|
||||
- plymouth: use /run/plymouth/pid instead of /run/initramfs/plymouth
|
||||
- add "/lib/firmware/updates" to default firmware path
|
||||
|
||||
dracut-009
|
||||
==========
|
||||
- dracut generator
|
||||
- dracut-logger
|
||||
- xz compression
|
||||
- better argument handling
|
||||
|
||||
- initramfs
|
||||
- hooks moved to /lib/dracut/hooks in initramfs
|
||||
- rd.driver.{blacklist|pre|post} accept comma separated driver list
|
||||
- iSCSI: iSCSI Boot Firmware Table (iBFT) support
|
||||
- support for /run
|
||||
- live image: support for generic rootfs.img (instead of ext3fs.img)
|
||||
- caps module
|
||||
- FCoE: EDD support
|
||||
|
||||
dracut-008
|
||||
==========
|
||||
- removed --ignore-kernel-modules option (no longer necessary)
|
||||
- renamed kernel command line arguments to follow the rd. naming scheme
|
||||
- merged check, install, installkernel to module-setup.sh
|
||||
- support for bzip2 and xz compressed initramfs images.
|
||||
- source code beautification
|
||||
- lots of documentation
|
||||
- lsinitrd: "catinitrd" functionality
|
||||
- dracut: --list-modules
|
||||
- lvm: support for dynamic LVM SNAPSHOT root volume
|
||||
- 95fstab-sys: mount all /etc/fstab.sys volumes before switch_root
|
||||
- 96insmodpost dracut module
|
||||
- rd.shell=1 per default
|
||||
- rootfs-block:mount-root.sh add fsck
|
||||
- busybox shell replacements module
|
||||
- honor old "real_init="
|
||||
- 97biosdevname dracut module
|
||||
|
||||
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 save 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
|
||||
|
21
PKGBUILD
Normal file
21
PKGBUILD
Normal file
@@ -0,0 +1,21 @@
|
||||
pkgname=dracut-git
|
||||
pkgver=$(date +%s)
|
||||
pkgrel=$(git log --pretty=format:%h |head -n 1)
|
||||
pkgdesc="Initramfs generation utility"
|
||||
arch=('i686' 'x86_64')
|
||||
url="https://dracut.wiki.kernel.org/"
|
||||
license=('GPL')
|
||||
conflicts=('dracut' 'mkinitcpio')
|
||||
provides=('dracut=9999' 'mkinitcpio=9999')
|
||||
depends=('bash')
|
||||
optdepends=('cryptsetup' 'lvm2')
|
||||
makedepends=('libxslt')
|
||||
backup=(etc/dracut.conf)
|
||||
source=()
|
||||
md5sums=()
|
||||
|
||||
build() {
|
||||
cd ..
|
||||
make sysconfdir=/etc || return 1
|
||||
make DESTDIR="${pkgdir}" sysconfdir=/etc install || return 1
|
||||
}
|
62
README
62
README
@@ -2,8 +2,8 @@ Dracut
|
||||
------
|
||||
Dracut is a new initramfs infrastructure.
|
||||
|
||||
Information about the initial goals and aims can be found at
|
||||
https://fedoraproject.org/wiki/Initrdrewrite
|
||||
Information about the initial goals and aims can be found at
|
||||
https://fedoraproject.org/wiki/Initrdrewrite
|
||||
|
||||
Unlike existing initramfs's, this is an attempt at having as little as
|
||||
possible hard-coded into the initramfs as possible. The initramfs has
|
||||
@@ -19,17 +19,19 @@ we'll grow some hooks for running arbitrary commands in the flow of
|
||||
the script, but it's worth trying to resist the urge as much as we can
|
||||
as hooks are guaranteed to be the path to slow-down.
|
||||
|
||||
Most of the initrd generation functionality in dracut is provided by a bunch
|
||||
Most of the initramfs 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 initramfs. 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,
|
||||
on to the initramfs. They handle mangling the pathnames and (for binaries,
|
||||
scripts, and kernel modules) installing dependencies as appropriate so
|
||||
you do not have to.
|
||||
* Scripts that end up on the initrd should be POSIX compliant. dracut
|
||||
will try to use /bin/dash as /bin/sh for the initrd if it is available,
|
||||
* Scripts that end up on the initramfs should be POSIX compliant. dracut
|
||||
will try to use /bin/dash as /bin/sh for the initramfs if it is available,
|
||||
so you should install it on your system -- dash aims for strict POSIX
|
||||
compliance to the extent possible.
|
||||
* Hooks MUST be POSIX compliant -- they are sourced by the init script,
|
||||
@@ -42,35 +44,41 @@ Some general rules for writing modules:
|
||||
* We have some breakpoints for debugging your hooks. If you pass 'rdbreak'
|
||||
as a kernel parameter, the initramfs will drop to a shell just before
|
||||
switching to a new root. You can pass 'rdbreak=hookpoint', and the initramfs
|
||||
will break just before hooks in that hookpoint run.
|
||||
will break just before hooks in that hookpoint run.
|
||||
|
||||
Also, there is an attempt to keep things as distribution-agnostic as
|
||||
possible. Every distribution has their own tool here and it's not
|
||||
something which is really interesting to have separate across them.
|
||||
So contributions to help decrease the distro-dependencies are welcome.
|
||||
|
||||
Currently dracut lives on sourceforge.
|
||||
Currently dracut lives on kernel.org.
|
||||
|
||||
The tarballs can be found here:
|
||||
http://www.kernel.org/pub/linux/utils/boot/dracut/
|
||||
ftp://ftp.kernel.org/pub/linux/utils/boot/dracut/
|
||||
|
||||
Git:
|
||||
git://git.kernel.org/pub/scm/boot/dracut/dracut.git
|
||||
http://git.kernel.org/pub/scm/boot/dracut/dracut.git
|
||||
https://git.kernel.org/pub/scm/boot/dracut/dracut.git
|
||||
|
||||
Git Web:
|
||||
http://git.kernel.org/?p=boot/dracut/dracut.git
|
||||
|
||||
Git Web RSS Feed:
|
||||
http://git.kernel.org/?p=boot/dracut/dracut.git;a=rss
|
||||
|
||||
Project Page:
|
||||
https://sourceforge.net/projects/dracut/
|
||||
http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
|
||||
|
||||
Drop Harald Hoyer <harald@redhat.com> a mail, if you want to help with
|
||||
the documentation, git access, etc.
|
||||
Project Wiki:
|
||||
http://dracut.wiki.kernel.org
|
||||
|
||||
Git Repository:
|
||||
http://dracut.git.sourceforge.net/
|
||||
git://dracut.git.sourceforge.net/gitroot/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
|
||||
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
|
||||
a typical vger list, send mail to majordomo@vger.kernel.org with body
|
||||
of 'subscribe initramfs email@host.com'
|
||||
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 a typical vger list, send mail to majordomo@vger.kernel.org with body
|
||||
of 'subscribe initramfs email@host.com'
|
||||
|
||||
|
||||
Licensed under the GPLv2
|
||||
|
@@ -1,10 +1,13 @@
|
||||
To build a generic initramfs, you have to install the following software packages:
|
||||
* device-mapper
|
||||
* cryptsetup-luks
|
||||
* rpcbind nfs-utils
|
||||
* rpcbind nfs-utils
|
||||
* lvm2
|
||||
* iscsi-initiator-utils
|
||||
* nbd
|
||||
* 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.
|
||||
|
@@ -4,7 +4,7 @@ structure:
|
||||
|
||||
dracut_install_dir/modules.d/
|
||||
00modname/
|
||||
install
|
||||
module-setup.sh
|
||||
check
|
||||
<other files as needed by the hook>
|
||||
|
||||
@@ -12,41 +12,98 @@ dracut_install_dir/modules.d/
|
||||
The numeric code must be present and in the range of 00 - 99.
|
||||
Modules with lower numbers are installed first. This is important
|
||||
because the dracut install functions (which install files onto
|
||||
the initrd) refuse to overwrite already installed files. This makes
|
||||
it easy for an earlier module to override the functionality of a
|
||||
the initrd) refuse to overwrite already installed files. This makes
|
||||
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-setup.sh:
|
||||
dracut sources this script to install the functionality that a
|
||||
module implements onto the initrd. For the most part, this amounts
|
||||
to copying files from the host system onto the initrd in a controlled
|
||||
manner. dracut supplies several install functions that are
|
||||
manner.
|
||||
|
||||
install():
|
||||
This function of module-setup.sh is called to install all
|
||||
non-kernel files. dracut supplies several install functions that are
|
||||
specialized for different file types. Browse through dracut-functions
|
||||
fore more details. dracut also provides a $moddir variable if you
|
||||
need to install a file from the module directory, such as an initrd
|
||||
hook, a udev rule, or a specialized executable.
|
||||
|
||||
check: Dracut calls this program to check and see if a module can be installed
|
||||
installkernel():
|
||||
This function of module-setup.sh is called to install all
|
||||
kernel related files.
|
||||
|
||||
|
||||
check():
|
||||
Dracut calls this function to check and see if a module can be installed
|
||||
on the initrd.
|
||||
|
||||
|
||||
When called without options, check should check to make sure that
|
||||
any files it needs to install into the initrd from the host system
|
||||
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
|
||||
without any options, and it should also check to see if the
|
||||
When called with $hostonly set, it should perform the same check
|
||||
that it would without it set, 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
|
||||
encrypted volumes, it should return 0 if all the tools to handle
|
||||
encrpted volumes are available and the host system has the root
|
||||
partition on an encrypted volume, 1 otherwise.
|
||||
|
||||
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.
|
||||
depends():
|
||||
This function 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.
|
||||
|
||||
Any other files in the module will not be touched by dracut directly.
|
||||
Any other files in the module will not be touched by dracut directly.
|
||||
|
||||
You are encouraged to provide a README that describes what the module is for.
|
||||
|
||||
|
||||
HOOKS
|
||||
=====
|
||||
|
||||
init has the following hook points to inject scripts:
|
||||
|
||||
/lib/dracut/hooks/cmdline/*.sh
|
||||
scripts for command line parsing
|
||||
|
||||
/lib/dracut/hooks/pre-udev/*.sh
|
||||
scripts to run before udev is started
|
||||
|
||||
/lib/dracut/hooks/pre-trigger/*.sh
|
||||
scripts to run before the main udev trigger is pulled
|
||||
|
||||
/lib/dracut/hooks/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 /lib/dracut/hooks/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".
|
||||
|
||||
/lib/dracut/hooks/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.
|
||||
|
||||
/lib/dracut/hooks/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.
|
||||
|
||||
/lib/dracut/hooks/pre-pivot/*.sh
|
||||
scripts to run before the real init is executed and the initramfs
|
||||
disappears
|
||||
All processes started before should be killed here.
|
||||
|
||||
You are encouraged to provide a README that descrobes what the module is for.
|
||||
|
24
TODO
24
TODO
@@ -1,2 +1,24 @@
|
||||
See https://sourceforge.net/apps/trac/dracut/wiki/TODO
|
||||
Current TODO list, broken into things which are relevant for the initramfs itself (/init et al) vs the generator. A lot of things are/should be marked with "FIXME" in the code
|
||||
INITRAMFS TODO
|
||||
|
||||
- The hard-coded list of udev rules that we care about is kind of lame.
|
||||
- automatic kexec fallback
|
||||
- panic fallback
|
||||
- fsck for $NEWROOT/usr
|
||||
|
||||
GENERATOR TODO
|
||||
|
||||
- Default module specification could use some work
|
||||
- udev rule copying, as mentioned above, is a bit too hard-coded
|
||||
- pkg-config integration, to make it easy for other packages to use us.
|
||||
- add recovery image creator (mkrecovery)
|
||||
|
||||
CODE TODO
|
||||
- document functions
|
||||
- make function vars local, and prefix with "_"
|
||||
|
||||
Future Enhancement Requests
|
||||
|
||||
- run ssh server to enter crypto password or perform debugging (supported by debian)
|
||||
- Bug 524727 - Dracut + encrypted root + networking
|
||||
|
||||
|
651
dracut
651
dracut
@@ -1,17 +1,35 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Generator script for a dracut initramfs
|
||||
# Tries to retain some degree of compatibility with the command line
|
||||
# of the various mkinitrd implementations out there
|
||||
#
|
||||
|
||||
# Copyright 2008, Red Hat, Inc. Jeremy Katz <katzj@redhat.com>
|
||||
# GPLv2 header here
|
||||
# Copyright 2005-2010 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/>.
|
||||
#
|
||||
|
||||
# store for logging
|
||||
dracut_args="$@"
|
||||
|
||||
usage() {
|
||||
# 80x25 linebreak here ^
|
||||
echo "Usage: $0 [OPTION]... <initramfs> <kernel-version>
|
||||
cat << EOF
|
||||
Usage: $0 [OPTION]... <initramfs> <kernel-version>
|
||||
Creates initial ramdisk images for preloading modules
|
||||
|
||||
-f, --force Overwrite existing initramfs file.
|
||||
@@ -21,150 +39,623 @@ 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
|
||||
--strip Strip binaries in the initramfs
|
||||
--nostrip Do not strip binaries in the initramfs (default)
|
||||
--prefix [DIR] Prefix initramfs files with [DIR]
|
||||
--noprefix Do not prefix initramfs files (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
|
||||
--profile Output profile information of the build process
|
||||
-L, --stdlog [0-6] Specify logging level (to standard error)
|
||||
0 - suppress any messages
|
||||
1 - only fatal errors
|
||||
2 - all errors
|
||||
3 - warnings
|
||||
4 - info (default)
|
||||
5 - debug info (here starts lots of output)
|
||||
6 - trace info (and even more)
|
||||
-v, --verbose Increase verbosity level (default is info(4))
|
||||
-q, --quiet Decrease verbosity level (default is info(4))
|
||||
-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.
|
||||
If SOURCE is a file, it will be installed to TARGET
|
||||
in the final initramfs.
|
||||
-I, --install [LIST] Install the space separated list of files into the
|
||||
initramfs.
|
||||
"
|
||||
--gzip Compress the generated initramfs using gzip.
|
||||
This will be done by default, unless another
|
||||
compression option or --no-compress is passed.
|
||||
--bzip2 Compress the generated initramfs using bzip2.
|
||||
Make sure your kernel has bzip2 decompression support
|
||||
compiled in, otherwise you will not be able to boot.
|
||||
--lzma Compress the generated initramfs using lzma.
|
||||
Make sure your kernel has lzma support compiled in,
|
||||
otherwise you will not be able to boot.
|
||||
--xz Compress the generated initramfs using xz.
|
||||
Make sure that your kernel has xz support compiled
|
||||
in, otherwise you will not be able to boot.
|
||||
--compress [COMPRESSION] Compress the generated initramfs with the
|
||||
passed compression program. Make sure your kernel
|
||||
knows how to decompress the generated initramfs,
|
||||
otherwise you will not be able to boot.
|
||||
--no-compress Do not compress the generated initramfs. This will
|
||||
override any other compression options.
|
||||
--list-modules List all available dracut modules.
|
||||
-M, --show-modules Print included module's name to standard output during
|
||||
build.
|
||||
--keep Keep the temporary initramfs for debugging purposes
|
||||
EOF
|
||||
}
|
||||
|
||||
# function push()
|
||||
# push values to a stack
|
||||
# $1 = stack variable
|
||||
# $2.. values
|
||||
# example:
|
||||
# push stack 1 2 "3 4"
|
||||
push() {
|
||||
local __stack=$1; shift
|
||||
for i in "$@"; do
|
||||
eval ${__stack}'[${#'${__stack}'[@]}]="$i"'
|
||||
done
|
||||
}
|
||||
|
||||
# function pop()
|
||||
# pops the last value from a stack
|
||||
# assigns value to second argument variable
|
||||
# or echo to stdout, if no second argument
|
||||
# $1 = stack variable
|
||||
# $2 = optional variable to store the value
|
||||
# example:
|
||||
# pop stack val
|
||||
# val=$(pop stack)
|
||||
pop() {
|
||||
local __stack=$1; shift
|
||||
local __resultvar=$1
|
||||
local myresult;
|
||||
# check for empty stack
|
||||
eval '[[ ${#'${__stack}'[@]} -eq 0 ]] && return 1'
|
||||
|
||||
eval myresult='${'${__stack}'[${#'${__stack}'[@]}-1]}'
|
||||
|
||||
if [[ "$__resultvar" ]]; then
|
||||
eval $__resultvar="'$myresult'"
|
||||
else
|
||||
echo "$myresult"
|
||||
fi
|
||||
eval unset ${__stack}'[${#'${__stack}'[@]}-1]'
|
||||
return 0
|
||||
}
|
||||
|
||||
# Little helper function for reading args from the commandline.
|
||||
# it automatically handles -a b and -a=b variants, and returns 1 if
|
||||
# we need to shift $3.
|
||||
read_arg() {
|
||||
# $1 = arg name
|
||||
# $2 = arg value
|
||||
# $3 = arg parameter
|
||||
local rematch='^[^=]*=(.*)$'
|
||||
if [[ $2 =~ $rematch ]]; then
|
||||
read "$1" <<< "${BASH_REMATCH[1]}"
|
||||
else
|
||||
read "$1" <<< "$3"
|
||||
# There is no way to shift our callers args, so
|
||||
# return 1 to indicate they should do it instead.
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Little helper function for reading args from the commandline to a stack.
|
||||
# it automatically handles -a b and -a=b variants, and returns 1 if
|
||||
# we need to shift $3.
|
||||
push_arg() {
|
||||
# $1 = arg name
|
||||
# $2 = arg value
|
||||
# $3 = arg parameter
|
||||
local rematch='^[^=]*=(.*)$'
|
||||
if [[ $2 =~ $rematch ]]; then
|
||||
push "$1" "${BASH_REMATCH[1]}"
|
||||
else
|
||||
push "$1" "$3"
|
||||
# There is no way to shift our callers args, so
|
||||
# return 1 to indicate they should do it instead.
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
verbosity_mod_l=0
|
||||
|
||||
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;;
|
||||
-h|--help) usage; exit 1 ;;
|
||||
--debug) debug="yes";;
|
||||
-v|--verbose) beverbose="yes";;
|
||||
-c|--conf) conffile="$2"; shift;;
|
||||
-l|--local) allowlocal="yes" ;;
|
||||
-H|--hostonly) hostonly="-h" ;;
|
||||
-i|--include) include_src="$2"; include_target="$3"; shift 2;;
|
||||
-I|--install) install_items="$2"; shift;;
|
||||
*) break ;;
|
||||
case ${1%%=*} in
|
||||
-a|--add) push_arg add_dracutmodules_l "$@" || shift;;
|
||||
--force-add) push_arg force_add_dracutmodules_l "$@" || shift;;
|
||||
--add-drivers) push_arg add_drivers_l "$@" || shift;;
|
||||
-m|--modules) push_arg dracutmodules_l "$@" || shift;;
|
||||
-o|--omit) push_arg omit_dracutmodules_l "$@" || shift;;
|
||||
-d|--drivers) push_arg drivers_l "$@" || shift;;
|
||||
--filesystems) push_arg filesystems_l "$@" || shift;;
|
||||
-I|--install) push_arg install_items "$@" || shift;;
|
||||
--fwdir) push_arg fw_dir_l "$@" || shift;;
|
||||
-k|--kmoddir) read_arg drivers_dir_l "$@" || shift;;
|
||||
-c|--conf) read_arg conffile "$@" || shift;;
|
||||
--confdir) read_arg confdir "$@" || shift;;
|
||||
-L|--stdlog) read_arg stdloglvl_l "$@" || shift;;
|
||||
-I|--install) read_arg install_items "$@" || shift;;
|
||||
--fwdir) read_arg fw_dir_l "$@" || shift;;
|
||||
--compress) read_arg compress_l "$@" || shift;;
|
||||
--prefix) read_arg prefix_l "$@" || shift;;
|
||||
-f|--force) force=yes;;
|
||||
--kernel-only) kernel_only="yes"; no_kernel="no";;
|
||||
--no-kernel) kernel_only="no"; no_kernel="yes";;
|
||||
--strip) do_strip_l="yes";;
|
||||
--nostrip) do_strip_l="no";;
|
||||
--noprefix) prefix_l="/";;
|
||||
--mdadmconf) mdadmconf_l="yes";;
|
||||
--nomdadmconf) mdadmconf_l="no";;
|
||||
--lvmconf) lvmconf_l="yes";;
|
||||
--nolvmconf) lvmconf_l="no";;
|
||||
--debug) debug="yes";;
|
||||
--profile) profile="yes";;
|
||||
-v|--verbose) ((verbosity_mod_l++));;
|
||||
-q|--quiet) ((verbosity_mod_l--));;
|
||||
-l|--local) allowlocal="yes" ;;
|
||||
-H|--hostonly) hostonly_l="yes" ;;
|
||||
--fstab) use_fstab_l="yes" ;;
|
||||
-h|--help) usage; exit 1 ;;
|
||||
-i|--include) push include_src "$2"
|
||||
push include_target "$3"
|
||||
shift 2;;
|
||||
--bzip2) compress_l="bzip2";;
|
||||
--lzma) compress_l="lzma";;
|
||||
--xz) compress_l="xz";;
|
||||
--no-compress) _no_compress_l="cat";;
|
||||
--gzip) compress_l="gzip";;
|
||||
--list-modules)
|
||||
do_list="yes";
|
||||
;;
|
||||
-M|--show-modules)
|
||||
show_modules_l="yes"
|
||||
;;
|
||||
--keep) keep="yes";;
|
||||
-*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
|
||||
*)
|
||||
if ! [[ ${outfile+x} ]]; then
|
||||
outfile=$1
|
||||
elif ! [[ ${kernel+x} ]]; then
|
||||
kernel=$1
|
||||
else
|
||||
usage; exit 1;
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
if ! [[ $kernel ]]; then
|
||||
kernel=$(uname -r)
|
||||
fi
|
||||
[[ $outfile ]] || outfile="/boot/initramfs-$kernel.img"
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
export PATH
|
||||
|
||||
[[ $debug ]] && {
|
||||
[[ $debug ]] && {
|
||||
export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
|
||||
set -x
|
||||
}
|
||||
|
||||
[[ $profile ]] && {
|
||||
export PS4='+ $(date "+%s.%N") ${BASH_SOURCE}@${LINENO}: ';
|
||||
set -x
|
||||
debug=yes
|
||||
}
|
||||
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
|
||||
|
||||
[[ $allowlocal && -f "$(readlink -f ${0%/*})/dracut-functions" ]] && \
|
||||
dracutbasedir="$(readlink -f ${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="$dracutbasedir/dracut.conf" || \
|
||||
conffile="/etc/dracut.conf"
|
||||
fi
|
||||
|
||||
if [[ ! -d $confdir ]]; then
|
||||
[[ $allowlocal ]] && confdir="$dracutbasedir/dracut.conf.d" || \
|
||||
confdir="/etc/dracut.conf.d"
|
||||
fi
|
||||
|
||||
# source our config file
|
||||
[[ -f $conffile ]] && . "$conffile"
|
||||
|
||||
# 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
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
|
||||
|
||||
[[ $allowlocal && -f "$(dirname $0)/dracut-functions" ]] && dsrc="$(dirname $0)" || dsrc=$dracutbasedir
|
||||
|
||||
if [[ -f $dsrc/dracut-functions ]]; then
|
||||
. $dsrc/dracut-functions
|
||||
else
|
||||
echo "Cannot find $dsrc/dracut-functions. Are you running from a git checkout?"
|
||||
echo "Try passing -l as an argument to $0"
|
||||
exit 1
|
||||
# source our config dir
|
||||
if [[ $confdir && -d $confdir ]]; then
|
||||
for f in "$confdir"/*.conf; do
|
||||
[[ -e $f ]] && . "$f"
|
||||
done
|
||||
fi
|
||||
|
||||
dracutfunctions=$dsrc/dracut-functions
|
||||
# these optins add to the stuff in the config file
|
||||
if (( ${#add_dracutmodules_l[@]} )); then
|
||||
while pop add_dracutmodules_l val; do
|
||||
add_dracutmodules+=" $val "
|
||||
done
|
||||
fi
|
||||
|
||||
if (( ${#force_add_dracutmodules_l[@]} )); then
|
||||
while pop force_add_dracutmodules_l val; do
|
||||
force_add_dracutmodules+=" $val "
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
if (( ${#add_drivers_l[@]} )); then
|
||||
while pop add_drivers_l val; do
|
||||
add_drivers+=" $val "
|
||||
done
|
||||
fi
|
||||
|
||||
# these options override the stuff in the config file
|
||||
if (( ${#dracutmodules_l[@]} )); then
|
||||
dracutmodules=''
|
||||
while pop dracutmodules_l val; do
|
||||
dracutmodules+="$val "
|
||||
done
|
||||
fi
|
||||
|
||||
if (( ${#omit_dracutmodules_l[@]} )); then
|
||||
omit_dracutmodules=''
|
||||
while pop omit_dracutmodules_l val; do
|
||||
omit_dracutmodules+="$val "
|
||||
done
|
||||
fi
|
||||
|
||||
if (( ${#drivers_l[@]} )); then
|
||||
drivers=''
|
||||
while pop drivers_l val; do
|
||||
drivers+="$val "
|
||||
done
|
||||
fi
|
||||
|
||||
if (( ${#filesystems_l[@]} )); then
|
||||
filesystems=''
|
||||
while pop filesystems_l val; do
|
||||
filesystems+="$val "
|
||||
done
|
||||
fi
|
||||
|
||||
if (( ${#fw_dir_l[@]} )); then
|
||||
fw_dir=''
|
||||
while pop fw_dir_l val; do
|
||||
fw_dir+="$val "
|
||||
done
|
||||
fi
|
||||
|
||||
[[ $stdloglvl_l ]] && stdloglvl=$stdloglvl_l
|
||||
[[ ! $stdloglvl ]] && stdloglvl=4
|
||||
stdloglvl=$((stdloglvl + verbosity_mod_l))
|
||||
((stdloglvl > 6)) && stdloglvl=6
|
||||
((stdloglvl < 0)) && stdloglvl=0
|
||||
|
||||
[[ $drivers_dir_l ]] && drivers_dir=$drivers_dir_l
|
||||
[[ $do_strip_l ]] && do_strip=$do_strip_l
|
||||
[[ $prefix_l ]] && prefix=$prefix_l
|
||||
[[ $prefix = "/" ]] && unset prefix
|
||||
[[ $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/updates /lib/firmware"
|
||||
[[ $do_strip ]] || do_strip=no
|
||||
[[ $compress_l ]] && compress=$compress_l
|
||||
[[ $show_modules_l ]] && show_modules=$show_modules_l
|
||||
# eliminate IFS hackery when messing with fw_dir
|
||||
fw_dir=${fw_dir//:/ }
|
||||
|
||||
# handle compression options.
|
||||
[[ $compress ]] || compress="gzip"
|
||||
case $compress in
|
||||
bzip2) compress="bzip2 -9";;
|
||||
lzma) compress="lzma -9";;
|
||||
xz) compress="xz --check=crc32 --lzma2=dict=1MiB";;
|
||||
gzip) command -v pigz > /dev/null 2>&1 && compress="pigz -9" || \
|
||||
compress="gzip -9";;
|
||||
esac
|
||||
if [[ $_no_compress_l = "cat" ]]; then
|
||||
compress="cat"
|
||||
fi
|
||||
|
||||
[[ $hostonly = yes ]] && hostonly="-h"
|
||||
[[ $hostonly != "-h" ]] && unset hostonly
|
||||
|
||||
if [[ -f $dracutbasedir/dracut-functions ]]; then
|
||||
. $dracutbasedir/dracut-functions
|
||||
else
|
||||
echo "Cannot find $dracutbasedir/dracut-functions." >&2
|
||||
echo "Are you running from a git checkout?" >&2
|
||||
echo "Try passing -l as an argument to $0" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dracutfunctions=$dracutbasedir/dracut-functions
|
||||
export dracutfunctions
|
||||
|
||||
ddebug "Executing $0 $dracut_args"
|
||||
|
||||
[[ $do_list = yes ]] && {
|
||||
for mod in $dracutbasedir/modules.d/*; do
|
||||
[[ -d $mod ]] || continue;
|
||||
[[ -e $mod/install || -e $mod/installkernel || \
|
||||
-e $mod/module-setup.sh ]] || continue
|
||||
echo ${mod##*/??}
|
||||
done
|
||||
exit 0
|
||||
}
|
||||
|
||||
# Detect lib paths
|
||||
[[ $libdir ]] || for libdir in /lib64 /lib; do
|
||||
[[ -d $libdir ]] && break
|
||||
done || {
|
||||
dfatal 'No lib directory?!!!'
|
||||
exit 1
|
||||
}
|
||||
|
||||
[[ $usrlibdir ]] || for usrlibdir in /usr/lib64 /usr/lib; do
|
||||
[[ -d $usrlibdir ]] && break
|
||||
done || dwarn 'No usr/lib directory!'
|
||||
|
||||
# This is kinda legacy -- eventually it should go away.
|
||||
case $dracutmodules in
|
||||
""|auto) dracutmodules="all" ;;
|
||||
esac
|
||||
|
||||
[[ $2 ]] && kernel=$2 || kernel=$(uname -r)
|
||||
[[ $1 ]] && outfile=$(readlink -f $1) || outfile="/boot/initrd-$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
|
||||
dfatal '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"
|
||||
dfatal "Will not override existing initramfs ($outfile) without --force"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
hookdirs="cmdline pre-udev pre-trigger netroot pre-mount pre-pivot mount emergency"
|
||||
outdir=${outfile%/*}
|
||||
[[ $outdir ]] || outdir="/"
|
||||
|
||||
readonly initdir=$(mktemp -d -t initramfs.XXXXXX)
|
||||
trap 'rm -rf "$initdir"' 0 # clean up after ourselves no matter how we die.
|
||||
if [[ ! -d "$outdir" ]]; then
|
||||
dfatal "Can't write $outfile: Directory $outdir does not exist."
|
||||
exit 1
|
||||
elif [[ ! -w "$outdir" ]]; then
|
||||
dfatal "No permission to write $outdir."
|
||||
exit 1
|
||||
elif [[ -f "$outfile" && ! -w "$outfile" ]]; then
|
||||
dfatal "No permission to write $outfile."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
readonly TMPDIR=/var/tmp
|
||||
readonly initdir=$(mktemp --tmpdir=/var/tmp/ -d -t initramfs.XXXXXX)
|
||||
|
||||
# clean up after ourselves no matter how we die.
|
||||
trap 'ret=$?;[[ $keep ]] && echo "Not removing $initdir." >&2 || rm -rf "$initdir";exit $ret;' EXIT
|
||||
# clean up after ourselves no matter how we die.
|
||||
trap 'exit 1;' SIGINT
|
||||
|
||||
# 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 dracutbasedir dracutmodules drivers \
|
||||
fw_dir drivers_dir debug no_kernel kernel_only \
|
||||
add_drivers mdadmconf lvmconf filesystems \
|
||||
use_fstab libdir usrlibdir \
|
||||
stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \
|
||||
debug
|
||||
|
||||
# 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
|
||||
[[ $prefix ]] && mkdir -m 0755 -p "${initdir}${prefix}"
|
||||
|
||||
[[ -h /lib ]] || mkdir -m 0755 -p "${initdir}${prefix}/lib"
|
||||
[[ $prefix ]] && ln -sfn "${prefix#/}/lib" "$initdir/lib"
|
||||
|
||||
if [[ $prefix ]]; then
|
||||
for d in bin etc lib "$libdir" sbin tmp usr var; do
|
||||
ln -sfn "${prefix#/}/${d#/}" "$initdir/$d"
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ $kernel_only != yes ]]; then
|
||||
for d in bin etc lib "$libdir" sbin tmp usr var usr/bin usr/sbin; do
|
||||
[[ -e "${initdir}${prefix}/$d" ]] && continue
|
||||
if [ -h "/$d" ]; then
|
||||
inst "/$d" "${prefix}/$d"
|
||||
else
|
||||
mkdir -m 0755 -p "${initdir}${prefix}/$d"
|
||||
fi
|
||||
done
|
||||
|
||||
for d in proc sys sysroot root run run/lock run/initramfs; do
|
||||
if [ -h "/$d" ]; then
|
||||
inst "/$d"
|
||||
else
|
||||
mkdir -m 0755 -p "$initdir/$d"
|
||||
fi
|
||||
done
|
||||
|
||||
ln -sfn /run "$initdir/var/run"
|
||||
ln -sfn /run/lock "$initdir/var/lock"
|
||||
else
|
||||
for d in lib "$libdir"; do
|
||||
[[ -e "${initdir}${prefix}/$d" ]] && continue
|
||||
if [ -h "/$d" ]; then
|
||||
inst "/$d" "${prefix}/$d"
|
||||
else
|
||||
mkdir -m 0755 -p "${initdir}${prefix}/$d"
|
||||
fi
|
||||
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
|
||||
mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
|
||||
if strstr "$mods_to_load" " $mod "; then
|
||||
. "$moddir/install"
|
||||
mods_to_load=${mods_to_load// $mod /}
|
||||
check_module_dir
|
||||
modules_loaded=" "
|
||||
# source our modules.
|
||||
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||
_d_mod=${moddir##*/}; _d_mod=${_d_mod#[0-9][0-9]}
|
||||
if strstr "$mods_to_load" " $_d_mod "; then
|
||||
[[ $show_modules = yes ]] && echo "$_d_mod" || \
|
||||
dinfo "*** Including module: $_d_mod ***"
|
||||
if [[ $kernel_only = yes ]]; then
|
||||
module_installkernel $_d_mod
|
||||
else
|
||||
module_install $_d_mod
|
||||
if [[ $no_kernel != yes ]]; then
|
||||
module_installkernel $_d_mod
|
||||
fi
|
||||
fi
|
||||
mods_to_load=${mods_to_load// $_d_mod /}
|
||||
modules_loaded+="$_d_mod "
|
||||
fi
|
||||
done
|
||||
unset moddir
|
||||
echo $mods_to_load
|
||||
dinfo "*** Including modules done ***"
|
||||
|
||||
## final stuff that has to happen
|
||||
|
||||
# generate module dependencies for the initrd
|
||||
if [ -d "$initdir/lib/modules/$kernel" ]; then
|
||||
if ! depmod -a -b "$initdir" $kernel; then
|
||||
echo "\"depmod -a $kernel\" failed."
|
||||
exit 1
|
||||
if [[ -d $initdir/lib/modules/$kernel ]] && \
|
||||
! depmod -a -b "$initdir" $kernel; then
|
||||
dfatal "\"depmod -a $kernel\" failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while pop include_src src && pop include_target tgt; do
|
||||
if [[ $src && $tgt ]]; then
|
||||
if [[ -f $src ]]; then
|
||||
inst $src $tgt
|
||||
else
|
||||
ddebug "Including directory: $src"
|
||||
mkdir -p "${initdir}/${tgt}"
|
||||
# check for preexisting symlinks, so we can cope with the
|
||||
# symlinks to $prefix
|
||||
for i in "$src"/*; do
|
||||
[[ -e "$i" || -h "$i" ]] || continue
|
||||
s=${initdir}/${tgt}/${i#$src/}
|
||||
if [[ -d "$i" ]]; then
|
||||
if ! [[ -e "$s" ]]; then
|
||||
mkdir -m 0755 -p "$s"
|
||||
chmod --reference="$i" "$s"
|
||||
fi
|
||||
cp -a -t "$s" "$i"/*
|
||||
else
|
||||
cp -a -t "$s" "$i"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# 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"/*
|
||||
fi
|
||||
|
||||
for item in $install_items; do
|
||||
dracut_install "$item"
|
||||
while pop install_items items; do
|
||||
for item in $items; do
|
||||
dracut_install "$item"
|
||||
done
|
||||
done
|
||||
unset item
|
||||
|
||||
[[ "$beverbose" = "yes" ]] && (du -c "$initdir" | sort -n)
|
||||
|
||||
( cd "$initdir"; find . |cpio -H newc -o |gzip -9 > "$outfile"; )
|
||||
if [[ $kernel_only != yes ]]; then
|
||||
# make sure that library links are correct and up to date
|
||||
for f in /etc/ld.so.conf /etc/ld.so.conf.d/*; do
|
||||
[[ -e $f ]] && inst_simple "$f"
|
||||
done
|
||||
if ! ldconfig -r "$initdir"; then
|
||||
if [[ $UID = 0 ]]; then
|
||||
derror "ldconfig exited ungracefully"
|
||||
else
|
||||
derror "ldconfig might need uid=0 (root) for chroot()"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ "$beverbose" = "yes" ]] && ls -lh "$outfile"
|
||||
if (($maxloglvl >= 5)); then
|
||||
ddebug "Listing sizes of included files:"
|
||||
du -c "$initdir" | sort -n | ddebug
|
||||
fi
|
||||
|
||||
# strip binaries
|
||||
if [[ $do_strip = yes ]] ; then
|
||||
for p in strip grep find; do
|
||||
if ! type -P $p >/dev/null; 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|| :
|
||||
done
|
||||
fi
|
||||
|
||||
type hardlink &>/dev/null && {
|
||||
hardlink "$initdir" 2>&1
|
||||
}
|
||||
|
||||
if strstr "$modules_loaded" " fips " && command -v prelink >/dev/null; then
|
||||
for i in $initdir/bin/* \
|
||||
$initdir/bin/* \
|
||||
$initdir/usr/bin/* \
|
||||
$initdir/usr/sbin/*; do
|
||||
[ -x $i ] && prelink -u $i &>/dev/null
|
||||
done
|
||||
fi
|
||||
|
||||
if ! ( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet | \
|
||||
$compress > "$outfile"; ); then
|
||||
dfatal "dracut: creation of $outfile failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dinfo "Wrote $outfile:"
|
||||
dinfo "$(ls -l "$outfile")"
|
||||
|
||||
exit 0
|
||||
|
||||
|
130
dracut-catimages
Executable file
130
dracut-catimages
Executable file
@@ -0,0 +1,130 @@
|
||||
#!/bin/bash --norc
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# 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 ^
|
||||
cat << EOF
|
||||
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
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
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='https://dracut.wiki.kernel.org'>https://dracut.wiki.kernel.org</ulink></para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='see_also'><title>SEE ALSO</title>
|
||||
<para><citerefentry><refentrytitle>dracut</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
1063
dracut-functions
1063
dracut-functions
File diff suppressed because it is too large
Load Diff
716
dracut-gencmdline
Executable file
716
dracut-gencmdline
Executable file
@@ -0,0 +1,716 @@
|
||||
#!/bin/bash --norc
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# 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 --quiet --show-depends $1 | 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/,_rnetdev//' -e 's/_rnetdev//' -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
|
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='https://dracut.wiki.kernel.org'>https://dracut.wiki.kernel.org</ulink></para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='see_also'><title>SEE ALSO</title>
|
||||
<para><citerefentry><refentrytitle>dracut</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
381
dracut-logger
Executable file
381
dracut-logger
Executable file
@@ -0,0 +1,381 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 et filetype=sh
|
||||
#
|
||||
# logging faciality module for dracut both at build- and boot-time
|
||||
#
|
||||
# Copyright 2010 Amadeusz Żołnowski <aidecoe@aidecoe.name>
|
||||
#
|
||||
# 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/>.
|
||||
|
||||
|
||||
__DRACUT_LOGGER__=1
|
||||
|
||||
|
||||
## @brief Logging facility module for Dracut both at build- and boot-time.
|
||||
#
|
||||
# @section intro Introduction
|
||||
#
|
||||
# The logger takes a bit from Log4j philosophy. There are defined 6 logging
|
||||
# levels:
|
||||
# - TRACE (6)
|
||||
# The TRACE Level designates finer-grained informational events than the
|
||||
# DEBUG.
|
||||
# - DEBUG (5)
|
||||
# The DEBUG Level designates fine-grained informational events that are most
|
||||
# useful to debug an application.
|
||||
# - INFO (4)
|
||||
# The INFO level designates informational messages that highlight the
|
||||
# progress of the application at coarse-grained level.
|
||||
# - WARN (3)
|
||||
# The WARN level designates potentially harmful situations.
|
||||
# - ERROR (2)
|
||||
# The ERROR level designates error events that might still allow the
|
||||
# application to continue running.
|
||||
# - FATAL (1)
|
||||
# The FATAL level designates very severe error events that will presumably
|
||||
# lead the application to abort.
|
||||
# Descriptions are borrowed from Log4j documentation:
|
||||
# http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html
|
||||
#
|
||||
# @section usage Usage
|
||||
#
|
||||
# First of all you have to start with dlog_init() function which initializes
|
||||
# required variables. Don't call any other logging function before that one!
|
||||
# If you're ready with this, you can use following functions which corresponds
|
||||
# clearly to levels listed in @ref intro Introduction. Here they are:
|
||||
# - dtrace()
|
||||
# - ddebug()
|
||||
# - dinfo()
|
||||
# - dwarn()
|
||||
# - derror()
|
||||
# - dfatal()
|
||||
# They take all arguments given as a single message to be logged. See dlog()
|
||||
# function for details how it works. Note that you shouldn't use dlog() by
|
||||
# yourself. It's wrapped with above functions.
|
||||
#
|
||||
# @see dlog_init() dlog()
|
||||
#
|
||||
# @section conf Configuration
|
||||
#
|
||||
# Logging is controlled by following global variables:
|
||||
# - @var stdloglvl - logging level to standard error (console output)
|
||||
# - @var sysloglvl - logging level to syslog (by logger command)
|
||||
# - @var fileloglvl - logging level to file
|
||||
# - @var kmsgloglvl - logging level to /dev/kmsg (only for boot-time)
|
||||
# - @var logfile - log file which is used when @var fileloglvl is higher
|
||||
# than 0
|
||||
# and two global variables: @var maxloglvl and @var syslogfacility which <b>must
|
||||
# not</b> be overwritten. Both are set by dlog_init(). @var maxloglvl holds
|
||||
# maximum logging level of those three and indicates that dlog_init() was run.
|
||||
# @var syslogfacility is set either to 'user' (when building initramfs) or
|
||||
# 'daemon' (when booting).
|
||||
#
|
||||
# Logging level set by the variable means that messages from this logging level
|
||||
# and above (FATAL is the highest) will be shown. Logging levels may be set
|
||||
# independently for each destination (stderr, syslog, file, kmsg).
|
||||
#
|
||||
# @see dlog_init()
|
||||
|
||||
|
||||
## @brief Initializes Dracut Logger.
|
||||
#
|
||||
# @retval 1 if something has gone wrong
|
||||
# @retval 0 on success.
|
||||
#
|
||||
# @note This function need to be called before any other from this file.
|
||||
#
|
||||
# If any of the variables is not set, this function set it to default:
|
||||
# - @var stdloglvl = 4 (info)
|
||||
# - @var sysloglvl = 0 (no logging)
|
||||
# - @var fileloglvl is set to 4 when @var logfile is set too, otherwise it's
|
||||
# - @var kmsgloglvl = 0 (no logging)
|
||||
# set to 0
|
||||
#
|
||||
# @warning Function sets global variables @var maxloglvl and @syslogfacility.
|
||||
# See file doc comment for details.
|
||||
dlog_init() {
|
||||
local __oldumask
|
||||
local ret=0; local errmsg
|
||||
[ -z "$stdloglvl" ] && stdloglvl=4
|
||||
[ -z "$sysloglvl" ] && sysloglvl=0
|
||||
[ -z "$kmsgloglvl" ] && kmsgloglvl=0
|
||||
# Skip initialization if it's already done.
|
||||
[ -n "$maxloglvl" ] && return 0
|
||||
|
||||
if [ -z "$fileloglvl" ]; then
|
||||
[ -w "$logfile" ] && fileloglvl=4 || fileloglvl=0
|
||||
elif [ $fileloglvl -gt 0 ]; then
|
||||
__oldumask=$(umask)
|
||||
umask 0377
|
||||
! [ -e "$logfile" ] && >"$logfile"
|
||||
umask $__oldumask
|
||||
if [ -w "$logfile" -a -f "$logfile" ]; then
|
||||
# Mark new run in the log file
|
||||
echo >>"$logfile"
|
||||
if command -v date >/dev/null; then
|
||||
echo "=== $(date) ===" >>"$logfile"
|
||||
else
|
||||
echo "===============================================" >>"$logfile"
|
||||
fi
|
||||
echo >>"$logfile"
|
||||
else
|
||||
# We cannot log to file, so turn this facility off.
|
||||
fileloglvl=0
|
||||
ret=1
|
||||
errmsg="'$logfile' is not a writable file"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $sysloglvl -gt 0 ]; then
|
||||
if ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null
|
||||
then
|
||||
# We cannot log to syslog, so turn this facility off.
|
||||
sysloglvl=0
|
||||
ret=1
|
||||
errmsg="No '/dev/log' or 'logger' included for syslog logging"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $sysloglvl -gt 0 -o $kmsgloglvl -gt 0 ]; then
|
||||
if [ -n "$dracutbasedir" ]; then
|
||||
readonly syslogfacility=user
|
||||
else
|
||||
readonly syslogfacility=daemon
|
||||
fi
|
||||
export syslogfacility
|
||||
fi
|
||||
|
||||
local lvl; local maxloglvl_l=0
|
||||
for lvl in $stdloglvl $sysloglvl $fileloglvl $kmsgloglvl; do
|
||||
[ $lvl -gt $maxloglvl_l ] && maxloglvl_l=$lvl
|
||||
done
|
||||
readonly maxloglvl=$maxloglvl_l
|
||||
export maxloglvl
|
||||
|
||||
[ -n "$errmsg" ] && derror "$errmsg"
|
||||
|
||||
return $ret
|
||||
}
|
||||
|
||||
## @brief Converts numeric logging level to the first letter of level name.
|
||||
#
|
||||
# @param lvl Numeric logging level in range from 1 to 6.
|
||||
# @retval 1 if @a lvl is out of range.
|
||||
# @retval 0 if @a lvl is correct.
|
||||
# @result Echoes first letter of level name.
|
||||
_lvl2char() {
|
||||
case "$1" in
|
||||
1) echo F;;
|
||||
2) echo E;;
|
||||
3) echo W;;
|
||||
4) echo I;;
|
||||
5) echo D;;
|
||||
6) echo T;;
|
||||
*) return 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
## @brief Converts numeric level to logger priority defined by POSIX.2.
|
||||
#
|
||||
# @param lvl Numeric logging level in range from 1 to 6.
|
||||
# @retval 1 if @a lvl is out of range.
|
||||
# @retval 0 if @a lvl is correct.
|
||||
# @result Echoes logger priority.
|
||||
_lvl2syspri() {
|
||||
printf $syslogfacility.
|
||||
case "$1" in
|
||||
1) echo crit;;
|
||||
2) echo error;;
|
||||
3) echo warning;;
|
||||
4) echo info;;
|
||||
5) echo debug;;
|
||||
6) echo debug;;
|
||||
*) return 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
## @brief Converts dracut-logger numeric level to syslog log level
|
||||
#
|
||||
# @param lvl Numeric logging level in range from 1 to 6.
|
||||
# @retval 1 if @a lvl is out of range.
|
||||
# @retval 0 if @a lvl is correct.
|
||||
# @result Echoes kernel console numeric log level
|
||||
#
|
||||
# Conversion is done as follows:
|
||||
#
|
||||
# <tt>
|
||||
# FATAL(1) -> LOG_EMERG (0)
|
||||
# none -> LOG_ALERT (1)
|
||||
# none -> LOG_CRIT (2)
|
||||
# ERROR(2) -> LOG_ERR (3)
|
||||
# WARN(3) -> LOG_WARNING (4)
|
||||
# none -> LOG_NOTICE (5)
|
||||
# INFO(4) -> LOG_INFO (6)
|
||||
# DEBUG(5) -> LOG_DEBUG (7)
|
||||
# TRACE(6) /
|
||||
# </tt>
|
||||
#
|
||||
# @see /usr/include/sys/syslog.h
|
||||
_dlvl2syslvl() {
|
||||
local lvl
|
||||
|
||||
case "$1" in
|
||||
1) lvl=0;;
|
||||
2) lvl=3;;
|
||||
3) lvl=4;;
|
||||
4) lvl=6;;
|
||||
5) lvl=7;;
|
||||
6) lvl=7;;
|
||||
*) return 1;;
|
||||
esac
|
||||
|
||||
[ "$syslogfacility" = user ] && echo $((8+$lvl)) || echo $((24+$lvl))
|
||||
}
|
||||
|
||||
## @brief Prints to stderr and/or writes to file, to syslog and/or /dev/kmsg
|
||||
# given message with given level (priority).
|
||||
#
|
||||
# @param lvl Numeric logging level.
|
||||
# @param msg Message.
|
||||
# @retval 0 It's always returned, even if logging failed.
|
||||
#
|
||||
# @note This function is not supposed to be called manually. Please use
|
||||
# dtrace(), ddebug(), or others instead which wrap this one.
|
||||
#
|
||||
# This is core logging function which logs given message to standard error, file
|
||||
# and/or syslog (with POSIX shell command <tt>logger</tt>) and/or to /dev/kmsg.
|
||||
# The format is following:
|
||||
#
|
||||
# <tt>X: some message</tt>
|
||||
#
|
||||
# where @c X is the first letter of logging level. See module description for
|
||||
# details on that.
|
||||
#
|
||||
# Message to syslog is sent with tag @c dracut. Priorities are mapped as
|
||||
# following:
|
||||
# - @c FATAL to @c crit
|
||||
# - @c ERROR to @c error
|
||||
# - @c WARN to @c warning
|
||||
# - @c INFO to @c info
|
||||
# - @c DEBUG and @c TRACE both to @c debug
|
||||
_do_dlog() {
|
||||
[ -z "$maxloglvl" ] && return 0
|
||||
local lvl="$1"; shift
|
||||
local lvlc=$(_lvl2char "$lvl") || return 0
|
||||
|
||||
[ $lvl -le $maxloglvl ] || return 0
|
||||
|
||||
local msg="$lvlc: $*"
|
||||
|
||||
[ $lvl -le $stdloglvl ] && echo "$msg" >&2
|
||||
if [ $lvl -le $sysloglvl ]; then
|
||||
logger -t "dracut[$$]" -p $(_lvl2syspri $lvl) "$msg"
|
||||
fi
|
||||
if [ $lvl -le $fileloglvl -a -w "$logfile" -a -f "$logfile" ]; then
|
||||
echo "$msg" >>"$logfile"
|
||||
fi
|
||||
[ $lvl -le $kmsgloglvl ] && \
|
||||
echo "<$(_dlvl2syslvl $lvl)>dracut[$$] $msg" >/dev/kmsg
|
||||
}
|
||||
|
||||
## @brief Internal helper function for _do_dlog()
|
||||
#
|
||||
# @param lvl Numeric logging level.
|
||||
# @param msg Message.
|
||||
# @retval 0 It's always returned, even if logging failed.
|
||||
#
|
||||
# @note This function is not supposed to be called manually. Please use
|
||||
# dtrace(), ddebug(), or others instead which wrap this one.
|
||||
#
|
||||
# This function calls _do_dlog() either with parameter msg, or if
|
||||
# none is given, it will read standard input and will use every line as
|
||||
# a message.
|
||||
#
|
||||
# This enables:
|
||||
# dwarn "This is a warning"
|
||||
# echo "This is a warning" | dwarn
|
||||
dlog() {
|
||||
if [ $# -gt 1 ]; then
|
||||
_do_dlog "$@"
|
||||
else
|
||||
while read line; do
|
||||
_do_dlog "$1" "$line"
|
||||
done
|
||||
fi
|
||||
[ -n "$debug" ] && set -x || :
|
||||
}
|
||||
|
||||
## @brief Logs message at TRACE level (6)
|
||||
#
|
||||
# @param msg Message.
|
||||
# @retval 0 It's always returned, even if logging failed.
|
||||
dtrace() {
|
||||
set +x
|
||||
dlog 6 "$@"
|
||||
}
|
||||
|
||||
## @brief Logs message at DEBUG level (5)
|
||||
#
|
||||
# @param msg Message.
|
||||
# @retval 0 It's always returned, even if logging failed.
|
||||
ddebug() {
|
||||
set +x
|
||||
dlog 5 "$@"
|
||||
}
|
||||
|
||||
## @brief Logs message at INFO level (4)
|
||||
#
|
||||
# @param msg Message.
|
||||
# @retval 0 It's always returned, even if logging failed.
|
||||
dinfo() {
|
||||
set +x
|
||||
dlog 4 "$@"
|
||||
}
|
||||
|
||||
## @brief Logs message at WARN level (3)
|
||||
#
|
||||
# @param msg Message.
|
||||
# @retval 0 It's always returned, even if logging failed.
|
||||
dwarn() {
|
||||
set +x
|
||||
dlog 3 "$@"
|
||||
}
|
||||
|
||||
## @brief It's an alias to dwarn() function.
|
||||
#
|
||||
# @param msg Message.
|
||||
# @retval 0 It's always returned, even if logging failed.
|
||||
dwarning() {
|
||||
set +x
|
||||
dwarn "$@"
|
||||
}
|
||||
|
||||
## @brief Logs message at ERROR level (2)
|
||||
#
|
||||
# @param msg Message.
|
||||
# @retval 0 It's always returned, even if logging failed.
|
||||
derror() {
|
||||
set +x
|
||||
dlog 2 "$@"
|
||||
}
|
||||
|
||||
## @brief Logs message at FATAL level (1)
|
||||
#
|
||||
# @param msg Message.
|
||||
# @retval 0 It's always returned, even if logging failed.
|
||||
dfatal() {
|
||||
set +x
|
||||
dlog 1 "$@"
|
||||
}
|
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
|
||||
|
||||
|
558
dracut.8.xml
Normal file
558
dracut.8.xml
Normal file
@@ -0,0 +1,558 @@
|
||||
<?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="dracut8">
|
||||
<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>--force-add <replaceable><list of dracut modules></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>force to add a space-separated list of dracut modules to the default set of modules, when -H is specified. 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>--mdadmconf</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>include local <filename>/etc/mdadm.conf</filename></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--nomdadmconf</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not include local <filename>/etc/mdadm.conf</filename></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>--prefix</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>prefix initramfs files with /run/initramfs/</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--noprefix</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not prefix initramfs files with /run/initramfs/ (default)</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>increase verbosity level (default is info(4))</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-q</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--quiet</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>decrease verbosity level (default is info(4))</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>.
|
||||
This 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 <filename>/etc/fstab</filename>.</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></replaceable> <replaceable><TARGET></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>include the files in the SOURCE directory into the
|
||||
TARGET directory in the final initramfs. If SOURCE is a file, it will be installed to TARGET in the final initramfs. This parameter can be specified multiple times.</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>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--gzip</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Compress the generated initramfs using gzip.
|
||||
This will be done by default, unless another compression option or --no-compress is passed. Equivalent to "--compress=gzip -9"</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--bzip2</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Compress the generated initramfs using bzip2.
|
||||
<warning>
|
||||
<para>Make sure your kernel has bzip2 decompression support compiled in, otherwise you will not be able to boot. Equivalent to "--compress=bzip2"</para>
|
||||
</warning></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--lzma</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Compress the generated initramfs using lzma.
|
||||
<warning>
|
||||
<para>Make sure your kernel has lzma decompression support compiled in, otherwise you will not be able to boot. Equivalent to "--compress=lzma -9"</para>
|
||||
</warning></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--xz</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Compress the generated initramfs using xz.
|
||||
<warning>
|
||||
<para>Make sure your kernel has xz decompression support compiled in, otherwise you will not be able to boot. Equivalent to "--compress=xz --check=crc32 --lzma2=dict=1MiB"</para>
|
||||
</warning></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--compress <replaceable><compressor></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Compress the generated initramfs using the passed compression program. If you pass it just the name of a compression program, it will call that program with known-working arguments. If you pass a quoted string with arguments, it will be called with exactly those arguments. Depending on what you pass, this may result in an initramfs that the kernel cannot decompress.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--no-compress</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Do not compress the generated initramfs. This will override any other compression options.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--list-modules</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>List all available dracut modules.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-M</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--show-modules</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Print included module's name to standard output during build.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--keep</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Keep the initramfs temporary directory for debugging purposes.</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>/etc/conf.d/</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Any files found in <filename>/etc/conf.d/</filename> 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='https://dracut.wiki.kernel.org'>https://dracut.wiki.kernel.org</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>
|
31
dracut.conf
31
dracut.conf
@@ -1,10 +1,31 @@
|
||||
# Sample dracut config file
|
||||
|
||||
# Specific list of dracut modules to use
|
||||
#dracutmodules=""
|
||||
logfile=/var/log/dracut.log
|
||||
fileloglvl=6
|
||||
|
||||
# Exact list of dracut modules to use. Modules not listed here are not going
|
||||
# to be included. If you only want to add some optional modules use
|
||||
# add_dracutmodules option instead.
|
||||
#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"
|
||||
|
241
dracut.conf.5.xml
Normal file
241
dracut.conf.5.xml
Normal file
@@ -0,0 +1,241 @@
|
||||
<?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><filename>dracut.conf</filename>
|
||||
is loaded during the initialisation phase of dracut.
|
||||
Command line parameter will overwrite any values set here.
|
||||
<emphasis><filename>dracut.conf.d/*.conf</filename> files are read in alphanumerical order and will</emphasis>
|
||||
overwrite parameters set in <filename>/etc/dracut.conf</filename>. 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 <filename>/usr/share/dracut/modules.d</filename>.</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 <constant>:</constant></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 <option>--fstab</option> and provide a valid <filename>/etc/fstab</filename>.</para>
|
||||
</warning>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>use_fstab="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Use <filename>/etc/fstab</filename> instead of <filename>/proc/self/mountinfo</filename>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>mdadmconf="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Include local <filename>/etc/mdadm.conf</filename> (default=yes)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>lvmconf="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Include local <filename>/etc/lvm/lvm.conf</filename> (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>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>stdloglvl="<replaceable>{0-6}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Set logging to standard error level.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>sysloglvl="<replaceable>{0-6}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Set logging to syslog level.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>fileloglvl="<replaceable>{0-6}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Set logging to file level.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>logfile="<replaceable><file></replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Path to log file.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>show_modules="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Print included module's name to standard output during build.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Files</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/dracut/conf.d/</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Any <filename>/etc/dracut/conf.d/*.conf</filename> file can overwrite the values in <filename>/etc/dracut.conf</filename>.
|
||||
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>
|
7
dracut.conf.d/fedora.conf.example
Normal file
7
dracut.conf.d/fedora.conf.example
Normal file
@@ -0,0 +1,7 @@
|
||||
# Dracut config file customized for RedHat/Fedora.
|
||||
|
||||
# i18n
|
||||
i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP"
|
||||
add_dracutmodules+=" rpmversion "
|
||||
stdloglvl=3
|
||||
prefix=/run/initramfs
|
3
dracut.conf.d/fips.conf.example
Normal file
3
dracut.conf.d/fips.conf.example
Normal file
@@ -0,0 +1,3 @@
|
||||
# turn on fips module
|
||||
|
||||
add_dracutmodules+=" fips "
|
9
dracut.conf.d/gentoo-openrc.conf.example
Normal file
9
dracut.conf.d/gentoo-openrc.conf.example
Normal file
@@ -0,0 +1,9 @@
|
||||
# /etc/dracut.conf.d/gentoo-openrc.conf
|
||||
# Dracut config file customized for Gentoo Base System release 2
|
||||
|
||||
#
|
||||
# Modules
|
||||
#
|
||||
|
||||
# i18n
|
||||
i18n_vars="/etc/conf.d/keymaps:keymap-KEYMAP,extended_keymaps-EXT_KEYMAPS /etc/conf.d/consolefont:consolefont-FONT,consoletranslation-FONT_MAP /etc/rc.conf:unicode-UNICODE"
|
9
dracut.conf.d/gentoo.conf.example
Normal file
9
dracut.conf.d/gentoo.conf.example
Normal file
@@ -0,0 +1,9 @@
|
||||
# /etc/dracut.conf.d/gentoo.conf
|
||||
# Dracut config file customized for Gentoo Base System release 1
|
||||
|
||||
#
|
||||
# Modules
|
||||
#
|
||||
|
||||
# i18n
|
||||
i18n_vars="/etc/conf.d/keymaps:KEYMAP,EXTENDED_KEYMAPS-EXT_KEYMAPS /etc/conf.d/consolefont:CONSOLEFONT-FONT,CONSOLETRANSLATION-FONT_MAP /etc/rc.conf:UNICODE"
|
2
dracut.conf.d/suse.conf.example
Normal file
2
dracut.conf.d/suse.conf.example
Normal file
@@ -0,0 +1,2 @@
|
||||
i18n_vars="/etc/sysconfig/language:RC_LANG-LANG,RC_LC_ALL-LC_ALL /etc/sysconfig/console:CONSOLE_UNICODEMAP-FONT_UNIMAP,CONSOLE_FONT-FONT,CONSOLE_SCREENMAP-FONT_MAP /etc/sysconfig/keyboard:KEYTABLE-KEYMAP"
|
||||
|
1274
dracut.kernel.7.xml
Normal file
1274
dracut.kernel.7.xml
Normal file
File diff suppressed because it is too large
Load Diff
6
dracut.logrotate
Normal file
6
dracut.logrotate
Normal file
@@ -0,0 +1,6 @@
|
||||
/var/log/dracut.log {
|
||||
missingok
|
||||
notifempty
|
||||
size 30k
|
||||
create 0600 root root
|
||||
}
|
BIN
dracut.png
Normal file
BIN
dracut.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
336
dracut.spec
336
dracut.spec
@@ -1,123 +1,295 @@
|
||||
%if 0%{?fedora} < 12
|
||||
%define with_switch_root 1
|
||||
%else
|
||||
%define with_switch_root 1
|
||||
%endif
|
||||
# Variables must be defined
|
||||
%define with_nbd 1
|
||||
|
||||
%if %{defined gittag}
|
||||
%define rdist 1.git%{gittag}%{?dist}
|
||||
%define dashgittag -%{gittag}
|
||||
%else
|
||||
%define rdist %{?dist}
|
||||
# nbd in Fedora only
|
||||
%if 0%{?rhel} >= 6
|
||||
%define with_nbd 0
|
||||
%endif
|
||||
|
||||
Name: dracut
|
||||
Version: 0.4
|
||||
Release: 1%{?rdist}
|
||||
Version: xxx
|
||||
Release: xxx
|
||||
|
||||
Summary: Initramfs generator using udev
|
||||
Group: System Environment/Base
|
||||
License: GPLv2+
|
||||
URL: http://apps.sourceforge.net/trac/dracut/wiki
|
||||
Source0: dracut-%{version}%{?dashgittag}.tar.bz2
|
||||
%if 0%{?fedora}
|
||||
Group: System Environment/Base
|
||||
%endif
|
||||
%if 0%{?suse_version}
|
||||
Group: System/Base
|
||||
%endif
|
||||
License: GPLv2+
|
||||
URL: https://dracut.wiki.kernel.org/
|
||||
# Source can be generated by
|
||||
# http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%{version};sf=tgz
|
||||
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.bz2
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: dash bash
|
||||
%if 0%{?fedora}
|
||||
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
|
||||
%endif
|
||||
%if 0%{?suse_version}
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
%endif
|
||||
|
||||
%if ! 0%{?with_switch_root}
|
||||
Requires: /sbin/switch_root
|
||||
BuildArch: noarch
|
||||
%if 0%{?fedora}
|
||||
BuildRequires: docbook-style-xsl docbook-dtds libxslt
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version}
|
||||
BuildRequires: docbook-xsl-stylesheets libxslt
|
||||
%endif
|
||||
|
||||
%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
|
||||
|
||||
%if 0%{?suse_version} > 9999
|
||||
Obsoletes: mkinitrd < 2.6.1
|
||||
Provides: mkinitrd = 2.6.1
|
||||
%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: kbd
|
||||
Requires: mktemp >= 1.5-5
|
||||
Requires: module-init-tools >= 3.7-9
|
||||
Requires: sed
|
||||
Requires: tar
|
||||
Requires: udev
|
||||
|
||||
%if 0%{?fedora}
|
||||
Requires: util-linux >= 2.16
|
||||
Requires: initscripts >= 8.63-1
|
||||
Requires: plymouth >= 0.8.0-0.2009.29.09.19.1
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version}
|
||||
Requires: util-linux >= 2.16
|
||||
%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: rpcbind
|
||||
%if %{with_nbd}
|
||||
Requires: nbd
|
||||
Requires: net-tools iproute
|
||||
Requires: kernel-firmware
|
||||
Requires: ql2100-firmware
|
||||
Requires: ql2200-firmware
|
||||
Requires: ql23xx-firmware
|
||||
Requires: ql2400-firmware
|
||||
Requires: ql2500-firmware
|
||||
%endif
|
||||
Requires: iproute
|
||||
Requires: bridge-utils
|
||||
|
||||
%description generic
|
||||
%if 0%{?fedora}
|
||||
Requires: iscsi-initiator-utils
|
||||
Requires: nfs-utils
|
||||
Requires: dhclient
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version}
|
||||
Requires: dhcp-client
|
||||
Requires: nfs-client
|
||||
Requires: vlan
|
||||
%endif
|
||||
Obsoletes: dracut-generic < 008
|
||||
Provides: dracut-generic = %{version}-%{release}
|
||||
|
||||
%description network
|
||||
This package requires everything which is needed to build a generic
|
||||
all purpose initramfs.
|
||||
all purpose initramfs with network support with dracut.
|
||||
|
||||
%if 0%{?fedora}
|
||||
%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.
|
||||
%endif
|
||||
|
||||
%package caps
|
||||
Summary: Dracut modules to build a dracut initramfs which drops capabilities
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: libcap
|
||||
|
||||
%description caps
|
||||
This package requires everything which is needed to build an
|
||||
all purpose initramfs with dracut, which drops capabilities.
|
||||
|
||||
%package tools
|
||||
Summary: Dracut tools to build the local initramfs
|
||||
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}
|
||||
%setup -q -n %{name}-%{version}
|
||||
|
||||
%build
|
||||
make
|
||||
|
||||
|
||||
%install
|
||||
%if 0%{?fedora}
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin sysconfdir=/etc mandir=%{_mandir}
|
||||
|
||||
%if ! 0%{?with_switch_root}
|
||||
rm -f $RPM_BUILD_ROOT/sbin/switch_root
|
||||
%endif
|
||||
make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin \
|
||||
sysconfdir=/etc mandir=%{_mandir}
|
||||
|
||||
echo %{name}-%{version}-%{release} > $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/10rpmversion/dracut-version
|
||||
|
||||
%if 0%{?fedora} == 0
|
||||
rm -fr $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/01fips
|
||||
%endif
|
||||
|
||||
# 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
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/initramfs
|
||||
|
||||
%if 0%{?fedora}
|
||||
install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/01-dist.conf
|
||||
install -m 0644 dracut.conf.d/fips.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/40-fips.conf
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version}
|
||||
install -m 0644 dracut.conf.d/suse.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/01-dist.conf
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} <= 12 && 0%{?rhel} < 6 && 0%{?suse_version} <= 9999
|
||||
rm $RPM_BUILD_ROOT/sbin/mkinitrd
|
||||
rm $RPM_BUILD_ROOT/sbin/lsinitrd
|
||||
%endif
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
|
||||
install -m 0644 dracut.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/dracut_log
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,0755)
|
||||
%doc README HACKING TODO COPYING AUTHORS
|
||||
%doc README HACKING TODO COPYING AUTHORS NEWS dracut.html dracut.png dracut.svg
|
||||
/sbin/dracut
|
||||
%if 0%{?with_switch_root}
|
||||
/sbin/switch_root
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
|
||||
/sbin/mkinitrd
|
||||
/sbin/lsinitrd
|
||||
%endif
|
||||
%dir %{_datadir}/dracut
|
||||
%dir %{_datadir}/dracut/modules.d
|
||||
%{_datadir}/dracut/dracut-functions
|
||||
%{_datadir}/dracut/modules.d
|
||||
%{_datadir}/dracut/dracut-logger
|
||||
%config(noreplace) /etc/dracut.conf
|
||||
%if 0%{?fedora} || 0%{?suse_version}
|
||||
%config /etc/dracut.conf.d/01-dist.conf
|
||||
%endif
|
||||
%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/05busybox
|
||||
%{_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/91crypt-gpg
|
||||
%{_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/95fstab-sys
|
||||
%{_datadir}/dracut/modules.d/95zfcp
|
||||
%{_datadir}/dracut/modules.d/95terminfo
|
||||
%{_datadir}/dracut/modules.d/95udev-rules
|
||||
%{_datadir}/dracut/modules.d/97biosdevname
|
||||
%{_datadir}/dracut/modules.d/97masterkey
|
||||
%{_datadir}/dracut/modules.d/98ecryptfs
|
||||
%{_datadir}/dracut/modules.d/98integrity
|
||||
%{_datadir}/dracut/modules.d/98selinux
|
||||
%{_datadir}/dracut/modules.d/98syslog
|
||||
%{_datadir}/dracut/modules.d/99base
|
||||
%{_datadir}/dracut/modules.d/99fs-lib
|
||||
%{_datadir}/dracut/modules.d/99shutdown
|
||||
%config(noreplace) /etc/logrotate.d/dracut_log
|
||||
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
|
||||
%dir %{_sharedstatedir}/initramfs
|
||||
|
||||
%files generic
|
||||
%files network
|
||||
%defattr(-,root,root,0755)
|
||||
%doc README.generic
|
||||
%{_datadir}/dracut/modules.d/40network
|
||||
%{_datadir}/dracut/modules.d/95fcoe
|
||||
%{_datadir}/dracut/modules.d/95iscsi
|
||||
%{_datadir}/dracut/modules.d/90livenet
|
||||
%{_datadir}/dracut/modules.d/95nbd
|
||||
%{_datadir}/dracut/modules.d/95nfs
|
||||
%{_datadir}/dracut/modules.d/45ifcfg
|
||||
%{_datadir}/dracut/modules.d/95znet
|
||||
|
||||
%if 0%{?fedora}
|
||||
%files fips
|
||||
%defattr(-,root,root,0755)
|
||||
%{_datadir}/dracut/modules.d/01fips
|
||||
%config(noreplace) /etc/dracut.conf.d/40-fips.conf
|
||||
%endif
|
||||
|
||||
%files caps
|
||||
%defattr(-,root,root,0755)
|
||||
%{_datadir}/dracut/modules.d/02caps
|
||||
|
||||
%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
|
||||
* Sat Jul 04 2009 Harald Hoyer <harald@redhat.com> 0.4-1
|
||||
- version 0.4
|
||||
|
||||
* Thu Jul 02 2009 Harald Hoyer <harald@redhat.com> 0.3-1
|
||||
- version 0.3
|
||||
|
||||
* Wed Jul 01 2009 Harald Hoyer <harald@redhat.com> 0.2-1
|
||||
- version 0.2
|
||||
|
||||
* Fri Jun 19 2009 Harald Hoyer <harald@redhat.com> 0.1-1
|
||||
- first release
|
||||
|
||||
* Thu Dec 18 2008 Jeremy Katz <katzj@redhat.com> - 0.0-1
|
||||
- Initial build
|
||||
|
||||
|
1701
dracut.svg
Normal file
1701
dracut.svg
Normal file
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 68 KiB |
729
dracut.xml
Normal file
729
dracut.xml
Normal file
@@ -0,0 +1,729 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- This document was created with Syntext Serna Free. -->
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
|
||||
<book>
|
||||
<title><inlinemediaobject>
|
||||
<imageobject>
|
||||
<imagedata valign="middle" fileref="dracut.png" format="PNG"/>
|
||||
</imageobject>
|
||||
<imageobject>
|
||||
<imagedata valign="middle" fileref="dracut.svg" format="SVG"/>
|
||||
</imageobject>
|
||||
<imageobject>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dracut.svg" encoding="UTF-8" parse="xml"/>
|
||||
</imageobject>
|
||||
</inlinemediaobject>dracut</title>
|
||||
<bookinfo>
|
||||
<author>
|
||||
<firstname>Harald</firstname>
|
||||
<surname>Hoyer</surname>
|
||||
</author>
|
||||
<pubdate>2010</pubdate>
|
||||
<edition>Version 1.0</edition>
|
||||
<copyright>
|
||||
<year>2010</year>
|
||||
<holder>Harald Hoyer</holder>
|
||||
</copyright>
|
||||
<legalnotice>
|
||||
<para>
|
||||
This work is licensed under the Creative Commons Attribution/Share-Alike License. To view a copy of this license, visit <ulink url="http://creativecommons.org/licenses/by-sa/3.0/">http://creativecommons.org/licenses/by-sa/3.0/</ulink> or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
|
||||
</para>
|
||||
</legalnotice>
|
||||
</bookinfo>
|
||||
<toc/>
|
||||
<chapter>
|
||||
<chapterinfo>
|
||||
<legalnotice>
|
||||
<para>
|
||||
This section is a modified version of <ulink url="http://en.wikipedia.org/wiki/Initrd">http://en.wikipedia.org/wiki/Initrd</ulink>, which is licensed under the Creative Commons Attribution/Share-Alike License.
|
||||
</para>
|
||||
</legalnotice>
|
||||
</chapterinfo>
|
||||
<title>Introduction</title>
|
||||
<section>
|
||||
<title>Definition</title>
|
||||
<para>An <emphasis>initial ramdisk</emphasis> is a temporary file system used in the boot process of the Linux kernel. <emphasis>initrd</emphasis> and <emphasis>initramfs</emphasis> refer to slightly different schemes for loading this file system into memory. Both are commonly used to make preparations before the real root file system can be mounted.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Rationale </title>
|
||||
<para>Many Linux distributions ship a single, generic kernel image that is intended to boot as wide a variety of hardware as possible. The device drivers for this generic kernel image are included as loadable modules, as it is not possible to statically compile them all into the one kernel without making it too large to boot from computers with limited memory or from lower-capacity media like floppy disks.
|
||||
</para>
|
||||
<para>This then raises the problem of detecting and loading the modules necessary to mount the root file system at boot time (or, for that matter, deducing where or what the root file system is).
|
||||
</para>
|
||||
<para>To further complicate matters, the root file system may be on a software <acronym>RAID</acronym> volume, <acronym>LVM</acronym>, <acronym>NFS</acronym> (on diskless workstations), or on an encrypted partition. All of these require special preparations to mount.
|
||||
</para>
|
||||
<para>Another complication is kernel support for hibernation, which suspends the computer to disk by dumping an image of the entire system to a swap partition or a regular file, then powering off. On next boot, this image has to be made accessible before it can be loaded back into memory. </para>
|
||||
<para>To avoid having to hardcode handling for so many special cases into the kernel, an initial boot stage with a temporary root file system—now dubbed early user space—is used. This root file system would contain user-space helpers that would do the hardware detection, module loading and device discovery necessary to get the real root file system mounted.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Implementation </title>
|
||||
<para>An image of this initial root file system (along with the kernel image) must be stored somewhere accessible by the Linux bootloader or the boot firmware of the computer. This can be: </para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>The root file system itself </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>A boot image on an optical disc
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>A small ext2/ext3 or <acronym>FAT</acronym>-formatted partition on a local disk (a <emphasis>boot partition</emphasis>)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>A <acronym>TFTP</acronym> server (on systems that can boot from Ethernet) </para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<para>The bootloader will load the kernel and initial root file system image into memory and then start the kernel, passing in the memory address of the image.
|
||||
</para>
|
||||
<para>Depending on which algorithms were compiled statically into it, the kernel can currently unpack initrd/initramfs images compressed with gzip, bzip2 and <acronym>LZMA</acronym>. </para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Mount preparations </title>
|
||||
<para>dracut can generate a customized initrams image which contains only whatever is necessary to boot some particular computer, such as <acronym>ATA</acronym>, <acronym>SCSI</acronym> and filesystem kernel modules (host-only mode).</para>
|
||||
<para>dracut can also generate a more generic initramfs image (default mode). </para>
|
||||
<para>dracut's initramfs starts only with the device name of the root file system (or its <acronym>UUID</acronym>) and must discover everything else at boot time. A complex cascade of tasks must be performed to get the root file system mounted: </para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>Any hardware drivers that the boot process depends on must be loaded. All kernel modules for common storage devices are packed onto the initramfs and then udev pulls in modules matching the computer's detected hardware. </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>On systems which display a boot rd.splash screen, the video hardware must be initialized and a user-space helper started to paint animations onto the display in lockstep with the boot process. </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>If the root file system is on NFS, dracut does then: <itemizedlist>
|
||||
<listitem>
|
||||
<para>Bring up the primary network interface. </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Invoke a DHCP client, with which it can obtain a DHCP lease. </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Extract the name of the NFS share and the address of the NFS server from the lease. </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Mount the <acronym>NFS</acronym> share. </para>
|
||||
</listitem>
|
||||
</itemizedlist></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>If the root file system appears to be on a software <acronym>RAID</acronym> device, there is no way of knowing which devices the <acronym>RAID</acronym> volume spans; the standard <acronym>MD</acronym> utilities must be invoked to scan all available block devices with a raid signature and bring the required ones online. </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>If the root file system appears to be on a logical volume, the <acronym>LVM</acronym> utilities must be invoked to scan for and activate the volume group containing it. </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>If the root file system is on an encrypted block device: <itemizedlist>
|
||||
<listitem>
|
||||
<para>Invoke a helper script to prompt the user to type in a passphrase and/or insert a hardware token (such as a smart card or a <acronym>USB</acronym> security dongle). </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Create a decryption target with the device mapper. </para>
|
||||
</listitem>
|
||||
</itemizedlist></para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<para>dracut uses udev, an event-driven hotplug agent, which invokes helper programs as hardware devices, disk partitions and storage volumes matching certain rules come online. This allows discovery to run in parallel, and to progressively cascade into arbitrary nestings of <acronym>LVM</acronym>, <acronym>RAID</acronym> or encryption to get at the root file system. </para>
|
||||
<para>When the root file system finally becomes visible: <itemizedlist>
|
||||
<listitem>
|
||||
<para>Any maintenance tasks which cannot run on a mounted root file system are done. </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>The root file system is mounted read-only. </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Any processes which must continue running (such as the rd.splash screen helper and its command <acronym>FIFO</acronym>) are hoisted into the newly-mounted root file system. </para>
|
||||
</listitem>
|
||||
</itemizedlist></para>
|
||||
<para>The final root file system cannot simply be mounted over /, since that would make the scripts and tools on the initial root file system inaccessible for any final cleanup tasks. On an initramfs, the initial root file system cannot be rotated away. Instead, it is simply emptied and the final root file system mounted over the top.
|
||||
</para>
|
||||
</section>
|
||||
</chapter>
|
||||
<chapter>
|
||||
<title>User Manual</title>
|
||||
<section>
|
||||
<title>Creating an initramfs Image</title>
|
||||
<para>To create a initramfs image, the most simple command is:</para>
|
||||
<screen># dracut</screen>
|
||||
<para>This will generate a general purpose initramfs image, with all possible functionality resulting of the combination of the installed dracut modules and system tools. The image is /boot/initramfs-<replaceable><kernel version></replaceable>.img and contains the kernel modules of the currently active kernel with version <replaceable><kernel version></replaceable>.</para>
|
||||
<para>If the initramfs image already exists, dracut will display an error message, and to overwrite the existing image, you have to use the <option>--force</option> option. </para>
|
||||
<screen># dracut --force</screen>
|
||||
<para>If you want to specify another filename for the resulting image you would issue a command like:</para>
|
||||
<screen># dracut foobar.img</screen>
|
||||
<para>To generate an image for a specific kernel version, the command would be:</para>
|
||||
<screen># dracut foobar.img 2.6.40-1.rc5.f20</screen>
|
||||
<para>A shortcut to generate the image at the default location for a specific kernel version is:</para>
|
||||
<screen># dracut '' 2.6.40-1.rc5.f20</screen>
|
||||
<para>If you want to create lighter, smaller initramfs images, you may want to specify the <option>--host-only</option> or <option>-H</option> option. Using this option, the resulting image will contain only those dracut modules, kernel modules and filesystems, which are needed to boot this specific machine. This has the drawback, that you can't put the disk on another controller or machine, and that you can't switch to another root filesystem, without recreating the initramfs image. The usage of the <option>--host-only</option> option is only for experts and you will have to keep the broken pieces. At least keep a copy of a general purpose image (and corresponding kernel) as a fallback to rescue your system.</para>
|
||||
<section>
|
||||
<title>Inspecting the Contents</title>
|
||||
<para>To see the contents of the image created by dracut, you can use the <command>lsinitrd</command> tool.</para>
|
||||
<screen># lsinitrd /boot/initramfs-$(uname -r).img | less</screen>
|
||||
<para>To display the contents of a file in the initramfs also use the <command>lsinitrd</command> tool:</para>
|
||||
<screen># lsinitrd /boot/initramfs-$(uname -r).img /etc/ld.so.conf
|
||||
include ld.so.conf.d/*.conf</screen>
|
||||
</section>
|
||||
<section>
|
||||
<title>Adding dracut Modules</title>
|
||||
<para>Some dracut modules are turned off by default and have to be activated manually. You can do this by adding the dracut modules to the configuration file <filename>/etc/dracut.conf</filename> or <filename>/etc/dracut.conf.d/myconf.conf</filename>. See the man page <xref linkend="dracutconf5"/>. You can also add dracut modules on the command line by using the <option>-a</option> or <option>--add</option> option:</para>
|
||||
<screen># dracut --add bootchart initramfs-bootchart.img</screen>
|
||||
<para>To see a list of available dracut modules, use the <option>--list-modules</option> option:</para>
|
||||
<screen># dracut --list-modules</screen>
|
||||
<para>or, if you have a dracut version earlier than <literal>008</literal>, issue the command:</para>
|
||||
<screen># for mod in /usr/share/dracut/modules.d/*; do echo ${mod##*/??}; done</screen>
|
||||
</section>
|
||||
<section>
|
||||
<title>Omitting dracut Modules</title>
|
||||
<para>Sometimes you don't want a dracut module to be included for reasons of speed, size or functionality. To do this, either specify the <envar>omit_dracutmodules</envar> variable in the <filename>dracut.conf</filename> or <filename>/etc/dracut.conf.d/myconf.conf</filename> configuration file (see man page <xref linkend="dracutconf5"/>), or use the <option>-o</option> or <option>--omit</option> option on the command line:</para>
|
||||
<screen># dracut -o "multipath lvm" no-multipath-lvm.img</screen>
|
||||
</section>
|
||||
<section>
|
||||
<title>Adding Kernel Modules</title>
|
||||
<para>If you need a special kernel module in the initramfs, which is not automatically picked up by dracut, you have the use the <option>--add-drivers</option> option on the command line or the drivers vaiable in the <filename>/etc/dracut.conf</filename> or <filename>/etc/dracut.conf.d/myconf.conf</filename> configuration file (see man page <xref linkend="dracutconf5"/>):</para>
|
||||
<screen># dracut --add-drivers mymod initramfs-with-mymod.img</screen>
|
||||
</section>
|
||||
</section>
|
||||
<section>
|
||||
<title>Boot parameters</title>
|
||||
<para>The generated initramfs.img file normally does not contain any system configuration files (except for some special exceptions), so the configuration has to be done on the kernel command line. With this flexibility, you can easily boot from a changed root partition, without the need to recompile the initramfs image. So, you could completly change your root partition (move it inside a md raid with encryption and LVM on top), as long as you specify the correct filesystem <varname>LABEL</varname> or <varname>UUID</varname> on the kernel command line for your root device, dracut will find it and boot from it.</para>
|
||||
<para>The kernel command line usually can be configured in <filename>/boot/grub/grub.conf</filename>, if grub is your bootloader and it also can be edited in the real boot process in the grub menu.</para>
|
||||
<para>The kernel command line can also be provided by the dhcp server with the root-path option. See <xref linkend="NetworkBoot"/>.</para>
|
||||
<para>For a full reference of all kernel command line parameters, see the <xref linkend="dracutconf5"/> or <xref linkend="dracut8"/> man page.</para>
|
||||
<section>
|
||||
<title>Specifying the root Device</title>
|
||||
<para>This is the only option dracut really needs to boot from your root partition. Because your root partition can live in various environments, there are a lot of formats for the <envar>root=</envar> option. The most basic one is <envar>root=<replaceable><path to device node></replaceable></envar>:</para>
|
||||
<screen>root=/dev/sda2</screen>
|
||||
<para>Because device node names can change, dependent on the drive ordering, you are encouraged to use the filesystem identifier (UUID) or filesystem label (LABEL) to specify your root partition:</para>
|
||||
<screen>root=UUID=19e9dda3-5a38-484d-a9b0-fa6b067d0331</screen>
|
||||
<para>or</para>
|
||||
<screen>root=LABEL=myrootpartitionlabel</screen>
|
||||
<para>To see all <envar>UUID</envar>s or <envar>LABEL</envar>s on your system, do:</para>
|
||||
<screen># ls -l /dev/disk/by-uuid</screen>
|
||||
<para>or</para>
|
||||
<screen># ls -l /dev/disk/by-label</screen>
|
||||
<para>If your root partition is on the network see <xref linkend="NetworkBoot"/>.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Keyboard Settings</title>
|
||||
<para>If you have to input passwords for encrypted disk volumes, you might want to set the keyboard layout and specify a display font.</para>
|
||||
<para>A typical german kernel command would contain:</para>
|
||||
<screen>vconsole.font=latarcyrheb-sun16 vconsole.keymap=de-latin1-nodeadkeys locale.LANG=de_DE.UTF-8</screen>
|
||||
<para>Setting these options can override the setting stored on your system, if you use a modern init system, like systemd.</para>
|
||||
<para>For dracut versions prior to version <literal>008</literal> the line would look like:</para>
|
||||
<screen>LANG=de_DE.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=de-latin1-nodeadkeys</screen>
|
||||
</section>
|
||||
<section>
|
||||
<title>Blacklisting Kernel Modules</title>
|
||||
<para>Sometimes it is required to prevent the automatic kernel module loading of a specific kernel module. To do this, just add <envar>rd.blacklist=<replaceable><kernel module name></replaceable></envar>, with <replaceable><kernel module name></replaceable> not containing the <filename>.ko</filename> suffix, to the kernel command line. For example:</para>
|
||||
<screen>rd.blacklist=mptsas rd.blacklist=nouveau</screen>
|
||||
<para>The option can be specified multiple times on the kernel command line.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Speeding up the Boot Process</title>
|
||||
<para>If you want to speed up the boot process, you can specify as much information for dracut on the kernel command as possible. For example, you can tell dracut, that you root partition is not on a <acronym>LVM</acronym> volume or not on a raid partition, or that it lives inside a specific crypto <acronym>LUKS</acronym> encrypted volume. By default, dracut searches everywhere. A typical dracut kernel command line for a plain primary or logical partition would contain:</para>
|
||||
<screen>rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0</screen>
|
||||
<para>on systems with dracut version prior to <literal>008</literal> the line would look like:</para>
|
||||
<screen>rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM</screen>
|
||||
<para>This turns off every automatic assembly of <acronym>LVM</acronym>, <acronym>MD</acronym> raids, <acronym>DM</acronym> raids and crypto <acronym>LUKS</acronym>.</para>
|
||||
<para>Of course, you could also omit the dracut modules in the initramfs creation process, but then you would lose the posibility to turn it on on demand.</para>
|
||||
</section>
|
||||
<section id="Injecting">
|
||||
<title>Injecting custom Files</title>
|
||||
<para>To add your own files to the initramfs image, you have several possibilities.</para>
|
||||
<para>The <option>--include</option> option let you specify a source path and a target path. For example</para>
|
||||
<screen># dracut --include cmdline-preset /etc/cmdline initramfs-cmdline-pre.img</screen>
|
||||
<para>will create an initramfs image, where the file cmdline-preset will be copied inside the initramfs to <filename>/etc/cmdline</filename>. <option>--include</option> can only be specified once.</para>
|
||||
<screen># mkdir rd.live.overlay
|
||||
# mkdir rd.live.overlay/etc
|
||||
# mkdir rd.live.overlay/etc/conf.d
|
||||
# echo "ip=auto" >> rd.live.overlay/etc/cmdline
|
||||
# echo export TESTVAR=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
|
||||
# echo export TESTVAR=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
|
||||
# tree rd.live.overlay/
|
||||
rd.live.overlay/
|
||||
└── etc
|
||||
├── cmdline
|
||||
└── conf.d
|
||||
└── testvar.conf
|
||||
# dracut --include rd.live.overlay / initramfs-rd.live.overlay.img</screen>
|
||||
<para>This will put the contents of the rd.live.overlay directory into the root of the initramfs image.</para>
|
||||
<para>The <option>--install</option> option let you specify several files, which will get installed in the initramfs image at the same location, as they are present on initramfs creation time.</para>
|
||||
<screen># dracut --install 'strace fsck.ext3 ssh' initramfs-dbg.img</screen>
|
||||
<para>This will create an initramfs with the <command>strace</command>, <command>fsck.ext3</command> and <command>ssh</command> executables, together with the libraries needed to start those. The <option>--install</option> option can be specified multiple times.</para>
|
||||
</section>
|
||||
</section>
|
||||
<section id="NetworkBoot">
|
||||
<title>Network Boot</title>
|
||||
<para>If your root partition is on a network drive, you have to have the network dracut modules installed to create a network aware initramfs image.</para>
|
||||
<para>On a Red Hat Enterprise Linux or Fedora system, this means, you have to install the <filename>dracut-network</filename> rpm package:</para>
|
||||
<screen># yum install dracut-network</screen>
|
||||
<para>The resulting initramfs image can be served by a boot manager residing on your local hard drive or it can be served by a <acronym>PXE</acronym>/<acronym>TFTP</acronym> server.</para>
|
||||
<para>How to setup your <acronym>PXE</acronym>/<acronym>TFTP</acronym> server can be found in the <ulink url="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/">Red Hat Enterprise Linux Storage Administration Guide</ulink>.</para>
|
||||
<para>If you specify <envar>rd.ip=auto</envar> on the kernel command line, then dracut asks a dhcp server about the ip adress for the machine. The dhcp server can also serve an additional root-path, which will set the root device for dracut. With this mechanism, you have static configuration on your client machine and a centralized boot configuration on your <acronym>TFTP</acronym>/<acronym>DHCP</acronym> server. If you can't pass a kernel command line, then you can inject <filename>/etc/cmdline</filename>, with a method described in <xref linkend="Injecting"/>.
|
||||
</para>
|
||||
<section>
|
||||
<title>Reducing the Image Size</title>
|
||||
<para>To reduce the size of the initramfs, you should create it with by ommitting all dracut modules, which you know, you don't need to boot the machine.</para>
|
||||
<para>You can also specify the exact dracut and kernel modules to produce a very tiny initramfs image.</para>
|
||||
<para>For example for a <acronym>NFS</acronym> image, you would do:</para>
|
||||
<screen># dracut -m "nfs network base" initramfs-nfs-only.img</screen>
|
||||
<para>Then you would boot from this image with your target machine and reduce the size once more by creating it on the target machine with the <option>--host-only</option> option:</para>
|
||||
<screen># dracut -m "nfs network base" --host-only initramfs-nfs-host-only.img</screen>
|
||||
<para>This will reduce the size of the initramfs image significantly.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>NFS Root Device</title>
|
||||
<para/>
|
||||
</section>
|
||||
<section>
|
||||
<title>iSCSI Root Device</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>FCoE Root Device</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
<section>
|
||||
<title>Troubleshooting</title>
|
||||
<para>If the boot process does not succeed, you have several options to debug the situation. Some of the basic operations are covered here. For more information you should also visit: <ulink url="http://fedoraproject.org/wiki/How_to_debug_Dracut_problems">http://fedoraproject.org/wiki/How_to_debug_Dracut_problems</ulink></para>
|
||||
<section id="identifying-your-problem-area">
|
||||
<title>Identifying your problem area</title>
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>Remove ''rhgb'' and ''quiet'' from the kernel command line
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Add ''rd.shell'' to the kernel command line. This will present a shell should dracut be unable to locate your root device
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Add ''rd.shell rd.debug'' to the kernel command line so that dracut shell commands are printed as they are executed
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>With dracut >= 002-11, you can inspect the rd.debug output with:
|
||||
</para>
|
||||
<screen># less /run/initramfs/init.log
|
||||
# dmesg | less</screen>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</section>
|
||||
<section id="information-to-include-in-your-report">
|
||||
<title id="information-to-include-in-your-report-title">Information to include in your report</title>
|
||||
<section id="all-bug-reports">
|
||||
<title id="all-bug-reports-title">All bug reports</title>
|
||||
<para>In all cases, the following should be mentioned and attached to your bug report:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>The exact kernel command-line used. Typically from the bootloader configuration file (e.g. <filename>/etc/grub.conf</filename>) or from <filename>/proc/cmdline</filename>.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>A copy of your disk partition information from <filename>/etc/fstab</filename>, which might be obtained booting an old working initramfs or a rescue medium.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>A device listing from device-mapper. This can be obtained by running the command <screen># dmsetup ls --tree</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>A list of block device attributes including vol_id compatible mode. This can be obtained by running the commands: <screen># blkid -p
|
||||
# blkid -p -o udev</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Turn on dracut debugging (see <filename>the 'debugging dracut' section</filename>), and attach all relevant information from the boot log. This can be obtained by running the command <screen># dmesg|grep dracut</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>If you use a dracut configuration file, please include <filename>/etc/dracut.conf</filename>
|
||||
and all files in <filename>/etc/dracut.conf.d/*.conf</filename></para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section id="logical-volume-management-related-problems">
|
||||
<title id="logical-volume-management-related-problems-title">Logical Volume Management related problems</title>
|
||||
<para>As well as the information from <xref linkend="all-bug-reports"/> include the following information:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>Include physical volume information by running the command: <screen># lvm pvdisplay</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Include volume group information by running the command: <screen># lvm vgdisplay</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Include logical volume information by running the command: <screen># lvm lvdisplay</screen></para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section id="software-raid-related-problems">
|
||||
<title id="software-raid-related-problems-title">Software RAID related problems</title>
|
||||
<para>As well as the information from <xref linkend="all-bug-reports"/>, include the following information:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>If using software RAID disk partitions, please include the output of <screen># cat /proc/mdstat</screen></para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section id="network-root-device-related-problems">
|
||||
<title id="network-root-device-related-problems-title">Network root device related problems</title>
|
||||
<para>This section details information to include when experiencing problems on a system whose root device is located on a network attached volume (e.g. iSCSI, NFS or NBD). As well as the information from <xref linkend="all-bug-reports"/>, include the following information:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>Please include the output of <screen># /sbin/ifup <replaceable><interfacename></replaceable>
|
||||
# ip addr show</screen></para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
</section>
|
||||
<section id="debugging-dracut">
|
||||
<title id="debugging-dracut-title">Debugging dracut</title>
|
||||
<section id="configure-a-serial-console">
|
||||
<title id="configure-a-serial-console-title">Configure a serial console</title>
|
||||
<para>Successfully debugging dracut will require some form of console logging during the system boot. This section documents configuring a serial console connection to record boot messages.
|
||||
</para>
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>First, enable serial console output for both the kernel and the bootloader.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Open the file <filename>/etc/grub.conf</filename> for editing. Below the line ''timeout=5'', add the following:
|
||||
<screen>serial --unit=0 --speed=9600
|
||||
terminal --timeout=5 serial console</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Also in <filename>/etc/grub.conf</filename>, add the following boot arguemnts to the ''kernel'' line:
|
||||
<screen>console=tty0 console=ttyS0,9600</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>When finished, the <filename>/etc/grub.conf</filename> file should look similar to the example below.
|
||||
<screen>default=0
|
||||
timeout=5
|
||||
serial --unit=0 --speed=9600
|
||||
terminal --timeout=5 serial console
|
||||
title Fedora (2.6.29.5-191.fc11.x86_64)
|
||||
root (hd0,0)
|
||||
kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 console=ttyS0,9600
|
||||
initrd /dracut-2.6.29.5-191.fc11.x86_64.img</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>More detailed information on how to configure the kernel for console output can be found at <ulink url="http://www.faqs.org/docs/Linux-HOWTO/Remote-Serial-Console-HOWTO.html#CONFIGURE-KERNEL">http://www.faqs.org/docs/Linux-HOWTO/Remote-Serial-Console-HOWTO.html#CONFIGURE-KERNEL</ulink>.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
<note>
|
||||
<title>Redirecting non-interactive output</title>
|
||||
<para>You can redirect all non-interactive output to <filename>/dev/kmsg</filename> and the kernel will put it out on the console when it reaches the kernel buffer by doing<screen># exec >/dev/kmsg 2>&1 </dev/console</screen></para>
|
||||
</note>
|
||||
</section>
|
||||
<section id="using-the-dracut-shell">
|
||||
<title id="using-the-dracut-shell-title">Using the dracut shell</title>
|
||||
<para>Dracut offers a shell for interactive debugging in the event dracut fails to locate your root filesystem. To enable the shell:
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>Add the boot parameter ''rd.shell'' to your bootloader configuration file (e.g. <filename>/etc/grub.conf</filename>)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Remove the boot arguments ''rhgb'' and ''quiet''
|
||||
</para>
|
||||
<para>
|
||||
A sample <filename>/etc/grub.conf</filename> bootloader configuration file is listed below.
|
||||
</para>
|
||||
<para><screen>default=0
|
||||
timeout=5
|
||||
serial --unit=0 --speed=9600
|
||||
terminal --timeout=5 serial console
|
||||
title Fedora (2.6.29.5-191.fc11.x86_64)
|
||||
root (hd0,0)
|
||||
kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 rd.shell
|
||||
initrd /dracut-2.6.29.5-191.fc11.x86_64.img</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>If system boot fails, you will be dropped into a shell as seen in the example below.
|
||||
<screen>No root device found
|
||||
Dropping to debug shell.
|
||||
|
||||
sh: can't access tty; job control turned off
|
||||
|
||||
# </screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Use this shell prompt to gather the information requested above (see <xref linkend="all-bug-reports"/>).
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist></para>
|
||||
</section>
|
||||
<section id="accessing-the-root-volume-from-the-dracut-shell">
|
||||
<title id="accessing-the-root-volume-from-the-dracut-shell-title">Accessing the root volume from the dracut shell</title>
|
||||
<para>From the dracut debug shell, you can manually perform the task of locating and preparing your root volume for boot. The required steps will depend on how your root volume is configured. Common scenarios include:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>A block device (e.g. <filename>/dev/sda7</filename>)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>A LVM logical volume (e.g. <filename>/dev/VolGroup00/LogVol00</filename>)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>An encrypted device (e.g. <filename>/dev/mapper/luks-4d5972ea-901c-4584-bd75-1da802417d83</filename>)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>A network attached device (e.g. netroot=iscsi:@192.168.0.4::3260::iqn.2009-02.org.fedoraproject:for.all)
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<para>The exact method for locating and preparing will vary. However, to continue with a successful boot, the objective is to locate your root volume and create a symlink <filename>/dev/root</filename> which points to the file system. For example, the following example demonstrates accessing and booting a root volume that is an encrypted LVM Logical volume. </para>
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>Inspect your partitions using <command>parted</command><screen># parted /dev/sda -s p
|
||||
Model: ATA HTS541060G9AT00 (scsi)
|
||||
Disk /dev/sda: 60.0GB
|
||||
Sector size (logical/physical): 512B/512B
|
||||
Partition Table: msdos
|
||||
Number Start End Size Type File system Flags
|
||||
1 32.3kB 10.8GB 107MB primary ext4 boot
|
||||
2 10.8GB 55.6GB 44.7GB logical lvm</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>You recall that your root volume was a LVM logical volume. Scan and activate any logical volumes.
|
||||
<screen># lvm vgscan
|
||||
# lvm vgchange -ay</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>You should see any logical volumes now using the command <command>blkid</command>:
|
||||
<screen># blkid
|
||||
/dev/sda1: UUID="3de247f3-5de4-4a44-afc5-1fe179750cf7" TYPE="ext4"
|
||||
/dev/sda2: UUID="Ek4dQw-cOtq-5MJu-OGRF-xz5k-O2l8-wdDj0I" TYPE="LVM2_member"
|
||||
/dev/mapper/linux-root: UUID="def0269e-424b-4752-acf3-1077bf96ad2c" TYPE="crypto_LUKS"
|
||||
/dev/mapper/linux-home: UUID="c69127c1-f153-4ea2-b58e-4cbfa9257c5e" TYPE="ext3"
|
||||
/dev/mapper/linux-swap: UUID="47b4d329-975c-4c08-b218-f9c9bf3635f1" TYPE="swap"
|
||||
</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>From the output above, you recall that your root volume exists on an encrypted block device. Following the guidance disk encryption guidance from the Installation Guide, you unlock your encrypted root volume.
|
||||
<screen># UUID=$(cryptsetup luksUUID /dev/mapper/linux-root)
|
||||
# cryptsetup luksOpen /dev/mapper/linux-root luks-$UUID
|
||||
Enter passphrase for /dev/mapper/linux-root:
|
||||
Key slot 0 unlocked. </screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Next, make a symbolic link to the unlocked root volume
|
||||
<screen># ln -s /dev/mapper/luks-$UUID /dev/root</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>With the root volume available, you may continue booting the system by exiting the dracut shell
|
||||
<screen># exit</screen></para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</section>
|
||||
<section id="additional-dracut-boot-parameters">
|
||||
<title id="additional-dracut-boot-parameters-title">Additional dracut boot parameters</title>
|
||||
<para>For more debugging options, see <xref linkend="dracut-kernel-debug"/> in the man page <xref linkend="dracutkernel7"/>.</para>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
</chapter>
|
||||
<chapter>
|
||||
<title>Developer Manual</title>
|
||||
<section>
|
||||
<title>dracut Components</title>
|
||||
<para>dracut uses a modular system to build and extend the initramfs image. All modules are located in <filename>/usr/share/dracut/modules.d</filename> or in <filename><replaceable><git-src></replaceable>/modules.d</filename>. The most basic dracut module is <filename>99base</filename>. In <filename>99base</filename> the initial shell script <command>init</command> is defined, which gets run by the kernel after initramfs loading. Although you can replace <command>init</command> with your own version of <filename>99base</filename>, this is not encouraged. Instead you should use, if possible, the hooks of dracut. All hooks, and the point of time in which they are executed, are described in <xref linkend="stages"/>.</para>
|
||||
<para>The main script, which creates the initramfs is <command>dracut</command> itsself. It parses all arguments and sets up the directory, in which everything is installed. It then executes all <command>check</command>, <command>install</command>, <command>installkernel</command> scripts found in the modules, which are to be processed. After everything is installed, the install directory is archived and compressed to the final initramfs image. All helper functions used by <command>check</command>, <command>install</command> and <command>installkernel</command> are found in in the file <filename>dracut-functions</filename>. These shell functions are available to all module installer (<command>install</command>, <command>installkernel</command>) scripts, without the need to source <filename>dracut-functions</filename>.</para>
|
||||
<para>A module can check the preconditions for <command>install</command> and <command>installkernel</command> with the <command>check</command> script. Also dependencies can be expressed with <command>check</command>. If a module passed <command>check</command>, <command>install</command> and <command>installkernel</command> will be called to install all of the necessary files for the module. To split between kernel and non-kernel parts of the installation, all kernel module related parts have to be in <command>installkernel</command>. All other files found in a module directory are module specific and mostly are hook scripts and udev rules.</para>
|
||||
</section>
|
||||
<section id="stages">
|
||||
<title>Boot Process Stages</title>
|
||||
<para>The <command>init</command> script in <filename>99base</filename> is the main script, which prepares the root file system for usage, runs udev, mounts the real root device, kills the remaining processes, and switches to the real root device for further booting. dracut modules can insert custom script at various points, to control the boot process. These hooks are plain directories containing shell scripts ending with ".sh", which are sourced by <command>init</command>.
|
||||
Common used functions are in <filename>dracut-lib.sh</filename>, which can be sourced by any script. </para>
|
||||
<section>
|
||||
<title>Basic Setup</title>
|
||||
<para>The first thing <command>init</command> does, is to mount <filename>/proc</filename> and <filename>/sys</filename> and manually create the basic device nodes and symbolic links in <filename>/dev</filename> needed to execute basic commands. Then logging is setup according to kernel command line arguments. <filename>/dev/pts</filename> and <filename>/dev/shm</filename> are mounted and the first hook is sourced.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Hook: cmdline</title>
|
||||
<para>The <literal>
|
||||
<function>cmdline</function>
|
||||
</literal> hook is a place to insert scripts to parse the kernel command line and prepare the later actions, like setting up udev rules and configuration files.</para>
|
||||
<para>In this hook the most important environment variable is defined: <envar>root</envar>. The second one is <envar>rootok</envar>, which indicates, that a module claimed to be able to parse the <envar>root</envar> defined. So for example, <envar>root=</envar><replaceable>iscsi:....</replaceable> will be claimed by the <function>iscsi</function> dracut module, which then sets <envar>rootok</envar>.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Hook: pre-udev</title>
|
||||
<para>This hook is executed right after the <function>cmdline</function> hook and a check if <envar>root</envar> and <envar>rootok</envar> were set. Here modules can take action with the final <envar>root</envar>, and before <command>udev</command> has been run.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Start Udev</title>
|
||||
<para>Now <command>udev</command> is started and the logging for <command>udev</command> is setup.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Hook: pre-trigger</title>
|
||||
<para>In this hook, you can set udev environment variables with <code>udevadm control --property=<envar>KEY</envar>=<replaceable>value</replaceable></code> or control the further execution of <command>udev</command> with <command>udevadm</command>.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Trigger Udev</title>
|
||||
<para><command>udev</command> is triggered by calling <command>udevadm trigger</command>, which sends <constant>add</constant> events for all devices and subsystems.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Main Loop</title>
|
||||
<para>Now the main loop of <command>99base/init</command> begins. Here we loop until <command>udev</command> has settled and all scripts in <filename>initqueue/finished</filename> returned true. In this loop there are three hooks, where scripts can be inserted by calling <command>/sbin/initqueue</command>.
|
||||
</para>
|
||||
<section>
|
||||
<title>Initqueue</title>
|
||||
<para>This hook gets executed every time a script is inserted here, regardless of the <command>udev</command> state.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Initqueue settled</title>
|
||||
<para>This hooks gets executed every time <command>udev</command> has settled.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Initqueue timeout</title>
|
||||
<para>This hooks gets executed, when the main loop counter becomes half of the rd.retry counter.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Initqueue finished</title>
|
||||
<para>This hook is called after <command>udev</command> has settled and if all scripts herein return <errorcode>0</errorcode> the main loop will be ended.</para>
|
||||
</section>
|
||||
</section>
|
||||
<section>
|
||||
<title>Hook: pre-mount</title>
|
||||
<para>Before the root device is mounted all scripts in the hook pre-mount are executed. In some cases (e.g. <acronym>NFS</acronym>) the real root device is already mounted, though.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Hook: mount</title>
|
||||
<para>This hook is mainly to mount the real root device.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Hook: pre-pivot</title>
|
||||
<para>This hook is the last hook and is called before init finally switches root to the real root device. This is a good place to clean up and kill processes not needed anymore.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Cleanup and switch_root</title>
|
||||
<para>Init kills all <command>udev</command> processes, cleans up the environment, sets up the arguments for the real <command>init</command> process and finally calls <command>switch_root</command>. <command>switch_root</command> removes the whole filesystem hierarchy of the initramfs, chroot()s to the real root device and calls <command>/sbin/init</command> with the specified arguments.</para>
|
||||
<para>To ensure all files in the initramfs hierarchy can be removed, all processes still running from the initramfs should not have any open file descriptors left.</para>
|
||||
</section>
|
||||
</section>
|
||||
<section>
|
||||
<title>Network Infrastructure</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Writing a Module</title>
|
||||
<para>A simple example module is <filename>96insmodpost</filename>, which modprobes a kernel module after udev has settled and the basic device drivers have been loaded.</para>
|
||||
<para>All module installation information is in the file module-setup.sh.</para>
|
||||
<para>First we create a <function>check()</function> function, which just exits with <errorcode>0</errorcode> indicating that this module should be included by default.</para>
|
||||
<para><function>check()</function>:</para>
|
||||
<programlisting>return 0</programlisting>
|
||||
<para>The we create the <function>install()</function> function, which installs a cmdline hook with priority number 20 called <filename>parse-insmodpost.sh</filename>. It also installs the <filename>insmodpost.sh</filename> script in <filename>/sbin</filename>.</para>
|
||||
<para><function>install()</function>:</para>
|
||||
<programlisting>inst_hook cmdline 20 "$moddir/parse-insmodpost.sh"
|
||||
inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh</programlisting>
|
||||
<para>The <filename>pase-instmodpost.sh</filename> parses the kernel command line for a argument <envar>rd.driver.post</envar>, blacklists the module from being autoloaded and installs the hook <filename>insmodpost.sh</filename> in the <filename>initqueue/settled</filename>.</para>
|
||||
<para><filename>parse-insmodpost.sh</filename>:</para>
|
||||
<programlisting>for p in $(getargs rd.driver.post=); do
|
||||
echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
|
||||
_do_insmodpost=1
|
||||
done
|
||||
|
||||
[ -n "$_do_insmodpost" ] && /sbin/initqueue --settled --unique --onetime /sbin/insmodpost.sh
|
||||
unset _do_insmodpost
|
||||
</programlisting>
|
||||
<para><filename>insmodpost.sh</filename>, which is called in the <filename>initqueue/settled</filename> hook will just modprobe the kernel modules specified in all <envar>rd.driver.post</envar> kernel command line parameters. It runs after <command>udev</command> has settled and is only called once (<parameter>--onetime</parameter>).</para>
|
||||
<para><filename>insmodpost.sh</filename>:</para>
|
||||
<programlisting>. /lib/dracut-lib.sh
|
||||
|
||||
for p in $(getargs rd.driver.post=); do
|
||||
modprobe $p
|
||||
done
|
||||
</programlisting>
|
||||
<section>
|
||||
<title>check()</title>
|
||||
<para><filename>
|
||||
<function>check()</function>
|
||||
</filename> is called by dracut to evaluate the inclusion of a dracut module in the initramfs.</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term> $hostonly</term>
|
||||
<listitem>
|
||||
<para>If the $hostonly variable is set, then the module check() function should be in "hostonly" mode, which means, that the check() should only return 0, if the module is really needed to boot this specific host.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
<para><function>check()</function> should return with:</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>0</term>
|
||||
<listitem>
|
||||
<para>Include the dracut module in the initramfs.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>1</term>
|
||||
<listitem>
|
||||
<para>Do not include the dracut module. The requirements are not fullfilled (missing tools, etc.)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>255</term>
|
||||
<listitem>
|
||||
<para>Only include the dracut module, if another module requires it or if explicitly specified in the config file or on the argument list.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</section>
|
||||
<section>
|
||||
<title>depends()</title>
|
||||
<para>The function <function>depends()</function> should <function>echo</function> all other dracut module names the module depends on.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>install()</title>
|
||||
<para>dracut_install</para>
|
||||
<para>inst</para>
|
||||
<para>inst_hook</para>
|
||||
<para>inst_rules</para>
|
||||
<para/>
|
||||
</section>
|
||||
<section>
|
||||
<title>installkernel()</title>
|
||||
<para>instmods</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Creation Functions</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Initramfs Functions</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Network Modules</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
</chapter>
|
||||
<appendix>
|
||||
<title>Man Pages</title>
|
||||
<section id="dracut.man">
|
||||
<title>dracut</title>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dracut.8.xml" encoding="UTF-8" parse="xml"/>
|
||||
</section>
|
||||
<section id="dracut.conf">
|
||||
<title>dracut.conf</title>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dracut.conf.5.xml" encoding="UTF-8" parse="xml"/>
|
||||
</section>
|
||||
<section id="dracut.kernel">
|
||||
<title>dracut.kernel</title>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dracut.kernel.7.xml" encoding="UTF-8" parse="xml"/>
|
||||
</section>
|
||||
</appendix>
|
||||
</book>
|
77
git2spec.pl
Executable file
77
git2spec.pl
Executable file
@@ -0,0 +1,77 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
sub last_tag {
|
||||
open( GIT, 'git log --pretty=format:%H |');
|
||||
LINE: while( <GIT> ) {
|
||||
open( GIT2, "git tag --contains $_ |");
|
||||
while( <GIT2> ) {
|
||||
chomp;
|
||||
last LINE if /..*/;
|
||||
}
|
||||
close GIT2;
|
||||
}
|
||||
$tag=$_;
|
||||
close GIT2;
|
||||
close GIT; # be done
|
||||
return $tag;
|
||||
};
|
||||
|
||||
sub create_patches {
|
||||
my $tag=shift;
|
||||
my $num=0;
|
||||
open( GIT, 'git format-patch --no-renames -N --no-signature '.$tag.' |');
|
||||
@lines=<GIT>;
|
||||
close GIT; # be done
|
||||
return @lines;
|
||||
};
|
||||
|
||||
sub filter_patch {
|
||||
my $patch=shift;
|
||||
open(P, $patch);
|
||||
@lines=<P>;
|
||||
close(P);
|
||||
grep (/^ 0 files changed/, @lines);
|
||||
}
|
||||
|
||||
use POSIX qw(strftime);
|
||||
my $datestr = strftime "%Y%m%d", gmtime;
|
||||
|
||||
my $tag=shift;
|
||||
$tag=&last_tag if not defined $tag;
|
||||
my @patches=&create_patches($tag);
|
||||
my $num=$#patches + 2;
|
||||
$tag=~s/[^0-9]+?([0-9]+)/$1/;
|
||||
my $release="$num.git$datestr";
|
||||
$release="1" if $num == 1;
|
||||
|
||||
while(<>) {
|
||||
if (/^Version:/) {
|
||||
print "Version: $tag\n";
|
||||
}
|
||||
elsif (/^Release:/) {
|
||||
print "Release: $release%{?dist}\n";
|
||||
}
|
||||
elsif ((/^Source0:/) || (/^Source:/)) {
|
||||
print $_;
|
||||
$num=1;
|
||||
for(@patches) {
|
||||
next if filter_patch $_;
|
||||
print "Patch$num: $_";
|
||||
$num++;
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
elsif (/^%setup/) {
|
||||
print $_;
|
||||
$num=1;
|
||||
for(@patches) {
|
||||
next if filter_patch $_;
|
||||
print "%patch$num -p1\n";
|
||||
$num++;
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
else {
|
||||
print $_;
|
||||
}
|
||||
}
|
49
lsinitrd
Executable file
49
lsinitrd
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Copyright 2005-2010 Harald Hoyer <harald@redhat.com>
|
||||
# Copyright 2005-2010 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/>.
|
||||
#
|
||||
|
||||
[[ $# -le 2 ]] || { echo "Usage: $(basename $0) [<initramfs file> [<filename>]]" ; exit 1 ; }
|
||||
image="${1:-/boot/initramfs-$(uname -r).img}"
|
||||
[[ -f "$image" ]] || { echo "$image does not exist" ; exit 1 ; }
|
||||
|
||||
CAT=zcat
|
||||
FILE_T=$(file "$image")
|
||||
|
||||
if [[ "$FILE_T" =~ ": gzip compressed data" ]]; then
|
||||
CAT=zcat
|
||||
elif [[ "$FILE_T" =~ ": xz compressed data" ]]; then
|
||||
CAT=xzcat
|
||||
elif [[ "$FILE_T" =~ ": XZ compressed data" ]]; then
|
||||
CAT=xzcat
|
||||
elif [[ "$FILE_T" =~ ": data" ]]; then
|
||||
CAT=lzcat
|
||||
fi
|
||||
|
||||
if [[ $# -eq 2 ]]; then
|
||||
$CAT $image | cpio --extract --verbose --quiet --to-stdout ${2#/} 2>/dev/null
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo "$image: $(du -h $image | awk '{print $1}')"
|
||||
echo "========================================================================"
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout 'lib/dracut/dracut-*' 2>/dev/null
|
||||
echo "========================================================================"
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --list
|
||||
echo "========================================================================"
|
100
mkinitrd-dracut.sh
Normal file
100
mkinitrd-dracut.sh
Normal file
@@ -0,0 +1,100 @@
|
||||
#!/bin/bash --norc
|
||||
kver=$(uname -r)
|
||||
|
||||
error() { echo "$@" >&2; }
|
||||
|
||||
usage () {
|
||||
[[ $1 = '-n' ]] && cmd=echo || cmd=error
|
||||
|
||||
$cmd "usage: ${0##*/} [--version] [--help] [-v] [-f] [--preload <module>]"
|
||||
$cmd " [--image-version] [--with=<module>]"
|
||||
$cmd " <initrd-image> <kernel-version>"
|
||||
$cmd ""
|
||||
$cmd " (ex: ${0##*/} /boot/initramfs-$kver.img $kver)"
|
||||
|
||||
[[ $1 = '-n' ]] && exit 0
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Little helper function for reading args from the commandline.
|
||||
# it automatically handles -a b and -a=b variants, and returns 1 if
|
||||
# we need to shift $3.
|
||||
read_arg() {
|
||||
# $1 = arg name
|
||||
# $2 = arg value
|
||||
# $3 = arg parameter
|
||||
local rematch='^[^=]*=(.*)$'
|
||||
if [[ $2 =~ $rematch ]]; then
|
||||
read "$1" <<< "${BASH_REMATCH[1]}"
|
||||
elif [[ $3 != -* ]]; then
|
||||
# Only read next arg if it not an arg itself.
|
||||
read "$1" <<< "$3"
|
||||
# There is no way to shift our callers args, so
|
||||
# return 1 to indicate they should do it instead.
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
while (($# > 0)); do
|
||||
case ${1%%=*} in
|
||||
--with-usb) read_arg usbmodule "$@" || shift
|
||||
basicmodules="$basicmodules ${usbmodule:-usb-storage}"
|
||||
unset usbmodule;;
|
||||
--with-avail) read_arg modname "$@" || shift
|
||||
basicmodules="$basicmodules $modname";;
|
||||
--with) read_arg modname "$@" || shift
|
||||
basicmodules="$basicmodules $modname";;
|
||||
--version)
|
||||
echo "mkinitrd: dracut compatibility wrapper"
|
||||
exit 0;;
|
||||
-v|--verbose) dracut_args="${dracut_args} -v";;
|
||||
-f|--force) dracut_args="${dracut_args} -f";;
|
||||
--preload) read_args modname "$@" || shift
|
||||
basicmodules="$basicmodules $modname";;
|
||||
--image-version) img_vers=yes;;
|
||||
--rootfs) read_args rootfs "$@" || shift
|
||||
dracut_args="${dracut_args} --filesystems $rootfs";;
|
||||
--nocompress) dracut_args="$dracut_args --no-compress";;
|
||||
--help) usage -n;;
|
||||
--builtin) ;;
|
||||
--without*) ;;
|
||||
--without-usb) ;;
|
||||
--fstab*) ;;
|
||||
--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) ;;
|
||||
*) if [[ ! $target ]]; then
|
||||
target=$1
|
||||
elif [[ ! $kernel ]]; then
|
||||
kernel=$1
|
||||
else
|
||||
usage
|
||||
fi;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
[[ $target && $kernel ]] || usage
|
||||
[[ $img_vers ]] && target="$target-$kernel"
|
||||
|
||||
if [[ $basicmodules ]]; then
|
||||
dracut $dracut_args --add-drivers "$basicmodules" "$target" "$kernel"
|
||||
else
|
||||
dracut $dracut_args "$target" "$kernel"
|
||||
fi
|
30
modules.d/00bootchart/module-setup.sh
Executable file
30
modules.d/00bootchart/module-setup.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
[ -x /sbin/bootchartd ] || return 1
|
||||
return 255
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
inst /sbin/bootchartd
|
||||
inst /bin/bash
|
||||
inst_symlink /init /sbin/init
|
||||
inst_dir /lib/bootchart/tmpfs
|
||||
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
|
||||
}
|
||||
|
@@ -1,2 +0,0 @@
|
||||
#!/bin/sh
|
||||
[ -x /bin/dash ]
|
@@ -1,6 +0,0 @@
|
||||
#!/bin/bash
|
||||
# If another shell is already installed, do not use dash
|
||||
[ -x "${initdir}/bin/sh" ] && return
|
||||
|
||||
# Prefer dash as /bin/sh if it is available.
|
||||
inst /bin/dash && ln -sf dash "${initdir}/bin/sh"
|
20
modules.d/00dash/module-setup.sh
Executable file
20
modules.d/00dash/module-setup.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
[ -x /bin/dash ]
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
# If another shell is already installed, do not use dash
|
||||
[[ -x $initdir/bin/sh ]] && return
|
||||
|
||||
# Prefer dash as /bin/sh if it is available.
|
||||
inst /bin/dash && ln -sf dash "${initdir}/bin/sh"
|
||||
}
|
||||
|
12
modules.d/01fips/fips-boot.sh
Executable file
12
modules.d/01fips/fips-boot.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
|
||||
rm -f /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
elif getarg boot= >/dev/null; then
|
||||
. /sbin/fips.sh
|
||||
if mount_boot; then
|
||||
do_fips || die "FIPS integrity test failed"
|
||||
fi
|
||||
fi
|
11
modules.d/01fips/fips-noboot.sh
Executable file
11
modules.d/01fips/fips-noboot.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
|
||||
rm -f /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
elif ! [ -f /tmp/fipsdone ]; then
|
||||
. /sbin/fips.sh
|
||||
mount_boot
|
||||
do_fips || die "FIPS integrity test failed"
|
||||
fi
|
84
modules.d/01fips/fips.sh
Executable file
84
modules.d/01fips/fips.sh
Executable file
@@ -0,0 +1,84 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
mount_boot()
|
||||
{
|
||||
boot=$(getarg boot=)
|
||||
|
||||
if [ -n "$boot" ]; then
|
||||
case "$boot" in
|
||||
LABEL=*)
|
||||
boot="$(echo $boot | sed 's,/,\\x2f,g')"
|
||||
boot="/dev/disk/by-label/${boot#LABEL=}"
|
||||
;;
|
||||
UUID=*)
|
||||
boot="/dev/disk/by-uuid/${boot#UUID=}"
|
||||
;;
|
||||
/dev/*)
|
||||
;;
|
||||
*)
|
||||
die "You have to specify boot=<boot device> as a boot option for fips=1" ;;
|
||||
esac
|
||||
|
||||
if ! [ -e "$boot" ]; then
|
||||
udevadm trigger --action=add >/dev/null 2>&1
|
||||
[ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version)
|
||||
i=0
|
||||
while ! [ -e $boot ]; do
|
||||
if [ $UDEVVERSION -ge 143 ]; then
|
||||
udevadm settle --exit-if-exists=$boot
|
||||
else
|
||||
udevadm settle --timeout=30
|
||||
fi
|
||||
[ -e $boot ] && break
|
||||
modprobe scsi_wait_scan && rmmod scsi_wait_scan
|
||||
[ -e $boot ] && break
|
||||
sleep 0.5
|
||||
i=$(($i+1))
|
||||
[ $i -gt 40 ] && break
|
||||
done
|
||||
fi
|
||||
|
||||
[ -e "$boot" ] || return 1
|
||||
|
||||
mkdir /boot
|
||||
info "Mounting $boot as /boot"
|
||||
mount -oro "$boot" /boot || return 1
|
||||
fi
|
||||
}
|
||||
|
||||
do_fips()
|
||||
{
|
||||
info "Checking integrity of kernel"
|
||||
newroot=$NEWROOT
|
||||
KERNEL=$(uname -r)
|
||||
|
||||
[ -e "$newroot/boot/.vmlinuz-${KERNEL}.hmac" ] || unset newroot
|
||||
|
||||
if ! [ -e "$newroot/boot/.vmlinuz-${KERNEL}.hmac" ]; then
|
||||
warn "$newroot/boot/.vmlinuz-${KERNEL}.hmac does not exist"
|
||||
return 1
|
||||
fi
|
||||
|
||||
sha512hmac -c "$newroot/boot/.vmlinuz-${KERNEL}.hmac" || return 1
|
||||
|
||||
FIPSMODULES=$(cat /etc/fipsmodules)
|
||||
|
||||
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 || return 1
|
||||
rmmod tcrypt
|
||||
info "All initrd crypto checks done"
|
||||
|
||||
> /tmp/fipsdone
|
||||
|
||||
umount /boot >/dev/null 2>&1
|
||||
|
||||
return 0
|
||||
}
|
49
modules.d/01fips/module-setup.sh
Executable file
49
modules.d/01fips/module-setup.sh
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
return 255
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
local _fipsmodules _mod
|
||||
_fipsmodules="aead aes_generici aes-xts aes-x86_64 ansi_cprng cbc ccm chainiv ctr"
|
||||
_fipsmodules+=" des deflate ecb eseqiv hmac seqiv sha256 sha512"
|
||||
_fipsmodules+=" cryptomgr crypto_null tcrypt dm-mod dm-crypt"
|
||||
|
||||
mkdir -m 0755 -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
|
||||
}
|
||||
|
||||
install() {
|
||||
local _dir
|
||||
inst_hook pre-trigger 01 "$moddir/fips-boot.sh"
|
||||
inst_hook pre-pivot 01 "$moddir/fips-noboot.sh"
|
||||
inst "$moddir/fips.sh" /sbin/fips.sh
|
||||
|
||||
dracut_install sha512hmac rmmod insmod mount uname umount
|
||||
|
||||
for _dir in "$usrlibdir" "$libdir"; do
|
||||
[[ -e $_dir/libsoftokn3.so ]] && \
|
||||
dracut_install $_dir/libsoftokn3.so $_dir/libsoftokn3.chk \
|
||||
$_dir/libfreebl3.so $_dir/libfreebl3.chk && \
|
||||
break
|
||||
done
|
||||
|
||||
dracut_install $usrlibdir/hmaccalc/sha512hmac.hmac
|
||||
if command -v prelink >/dev/null; then
|
||||
dracut_install prelink
|
||||
fi
|
||||
}
|
||||
|
33
modules.d/02caps/README
Normal file
33
modules.d/02caps/README
Normal file
@@ -0,0 +1,33 @@
|
||||
This adds the following parameters:
|
||||
rd.caps=1
|
||||
turn the caps module on/off
|
||||
rd.caps.initdrop=cap_sys_module,cap_sys_rawio
|
||||
drop the specified comma separated capabilities
|
||||
rd.caps.disablemodules=1
|
||||
turn off module loading
|
||||
rd.caps.disablekexec=1
|
||||
turn off the kexec functionality
|
||||
|
||||
If module loading is turned off, all modules have to be loaded in the
|
||||
initramfs, which are used later on. This can be done with
|
||||
"rd.driver.pre="
|
||||
rd.driver.pre=autofs4,sunrpc,ipt_REJECT,nf_conntrack_ipv4,....
|
||||
|
||||
Because the kernel command line would get huge with all those drivers, I
|
||||
recommend to make use of $initramfs/etc/cmdline.
|
||||
|
||||
So, all rd.caps.* and rd.driver.pre arguments are in caps.conf can be
|
||||
copied to $initramfs/etc/cmdline with "-i caps.conf /etc/cmdline".
|
||||
|
||||
Also all modules have to be loaded in the initramfs via "--add-drivers".
|
||||
|
||||
The resulting initramfs creation would look like this:
|
||||
|
||||
--add-drivers "autofs4 sunrpc ipt_REJECT nf_conntrack_ipv4 \
|
||||
nf_defrag_ipv4 iptable_filter ip_tables
|
||||
ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack
|
||||
ip6table_filter ip6_tables dm_mirror dm_region_hash dm_log uinput ppdev
|
||||
parport_pc parport ipv6 sg 8139too 8139cp mii i2c_piix4 i2c_core ext3
|
||||
jbd mbcache sd_mod crc_t10dif sr_mod cdrom ata_generic pata_acpi ata_piix
|
||||
dm_mod" \
|
||||
/boot/initramfs-caps.img
|
36
modules.d/02caps/caps.sh
Executable file
36
modules.d/02caps/caps.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
capsmode=$(getarg rd.caps)
|
||||
|
||||
if [ "$capsmode" = "1" ]; then
|
||||
CAPS_INIT_DROP=$(getarg rd.caps.initdrop=)
|
||||
CAPS_USERMODEHELPER_BSET=$(capsh --drop="$CAPS_INIT_DROP" -- -c 'while read a b ; do [ "$a" = "CapBnd:" ] && echo $((0x${b:$((${#b}-8)):8})) $((0x${b:$((${#b}-16)):8})) && break; done < /proc/self/status')
|
||||
CAPS_MODULES_DISABLED=$(getarg rd.caps.disablemodules=)
|
||||
CAPS_KEXEC_DISABLED=$(getarg rd.caps.disablekexec=)
|
||||
|
||||
info "Loading CAPS_MODULES $CAPS_MODULES"
|
||||
for i in $CAPS_MODULES;do modprobe $i 2>&1 >/dev/null | vinfo; done
|
||||
|
||||
if [ "$CAPS_MODULES_DISABLED" = "1" -a -e /proc/sys/kernel/modules_disabled ]; then
|
||||
info "Disabling module loading."
|
||||
echo $CAPS_MODULES_DISABLED > /proc/sys/kernel/modules_disabled
|
||||
fi
|
||||
|
||||
if [ "$CAPS_KEXEC_DISABLED" = "1" -a -e /proc/sys/kernel/kexec_disabled ]; then
|
||||
info "Disabling kexec."
|
||||
echo $CAPS_KEXEC_DISABLED > /proc/sys/kernel/kexec_disabled
|
||||
fi
|
||||
|
||||
info "CAPS_USERMODEHELPER_BSET=$CAPS_USERMODEHELPER_BSET"
|
||||
if [ -e /proc/sys/kernel/usermodehelper/bset ]; then
|
||||
info "Setting usermode helper bounding set."
|
||||
echo $CAPS_USERMODEHELPER_BSET > /proc/sys/kernel/usermodehelper/bset
|
||||
echo $CAPS_USERMODEHELPER_BSET > /proc/sys/kernel/usermodehelper/inheritable
|
||||
fi
|
||||
|
||||
echo "CAPS_INIT_DROP=\"$CAPS_INIT_DROP\"" > /etc/capsdrop
|
||||
info "Will drop capabilities $CAPS_INIT_DROP from init."
|
||||
fi
|
||||
|
19
modules.d/02caps/module-setup.sh
Executable file
19
modules.d/02caps/module-setup.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
type -P capsh >/dev/null 2>&1
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
inst_hook pre-pivot 00 "$moddir/caps.sh"
|
||||
inst $(type -P capsh 2>/dev/null) /usr/sbin/capsh
|
||||
# capsh wants bash and we need bash also
|
||||
inst /bin/bash && ln -sf bash "${initdir}/bin/sh"
|
||||
}
|
||||
|
36
modules.d/05busybox/module-setup.sh
Executable file
36
modules.d/05busybox/module-setup.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
type -P busybox >/dev/null || return 1
|
||||
|
||||
return 255
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
local _i _progs _path
|
||||
inst busybox /usr/bin/busybox
|
||||
for _i in `/sbin/busybox | sed -ne '1,/Currently/!{s/,//g; s/busybox//g; p}'`
|
||||
do
|
||||
_progs="$_progs $_i"
|
||||
done
|
||||
|
||||
# FIXME: switch_root should be in the above list, but busybox version hangs
|
||||
# (using busybox-1.15.1-7.fc14.i686 at the time of writing)
|
||||
|
||||
for _i in $_progs; do
|
||||
_path=$(find_binary "$_i")
|
||||
[ -z "$_path" ] && continue
|
||||
if [[ $_path != ${_path#/usr} ]]; then
|
||||
ln -sf ../../usr/bin/busybox "$initdir/$_path"
|
||||
else
|
||||
ln -sf ../usr/bin/busybox "$initdir/$_path"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
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 $root/$name"
|
122
modules.d/10i18n/README
Normal file
122
modules.d/10i18n/README
Normal file
@@ -0,0 +1,122 @@
|
||||
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/vconsole.conf" and "etc/locale.conf" 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
|
||||
FONT - console font
|
||||
FONT_MAP - see description of '-m' parameter in setfont manual
|
||||
FONT_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 i18n_vars. Here's an example:
|
||||
|
||||
i18n_vars="/etc/conf.d/keymaps:KEYMAP,EXTENDED_KEYMAPS-EXT_KEYMAPS /etc/conf.d/consolefont:CONSOLEFONT-FONT,CONSOLETRANSLATION-FONT_MAP /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: FONT and KEYMAP.
|
88
modules.d/10i18n/console_init
Executable file
88
modules.d/10i18n/console_init
Executable file
@@ -0,0 +1,88 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
[ -e /etc/vconsole.conf ] && . /etc/vconsole.conf
|
||||
|
||||
DEFAULT_FONT=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 "${FONT}" ] && FONT=${DEFAULT_FONT}
|
||||
[ -n "${FONT_MAP}" ] && trans="-m ${FONT_MAP}"
|
||||
[ -n "${FONT_UNIMAP}" ] && uni="-u ${FONT_UNIMAP}"
|
||||
|
||||
setfont ${FONT} -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
|
||||
}
|
||||
|
||||
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
|
||||
|
215
modules.d/10i18n/module-setup.sh
Executable file
215
modules.d/10i18n/module-setup.sh
Executable file
@@ -0,0 +1,215 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
return 0
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
[ -x /lib/systemd/systemd-vconsole-setup ] && dracut_install /lib/systemd/systemd-vconsole-setup
|
||||
KBDSUBDIRS=consolefonts,consoletrans,keymaps,unimaps
|
||||
DEFAULT_FONT=LatArCyrHeb-16
|
||||
I18N_CONF="/etc/locale.conf"
|
||||
VCONFIG_CONF="/etc/vconsole.conf"
|
||||
|
||||
# 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_simple $f
|
||||
done
|
||||
|
||||
# remove unnecessary files
|
||||
rm -f "${initdir}${kbddir}/consoletrans/utflist"
|
||||
find "${initdir}${kbddir}/" -name README\* -delete
|
||||
|
||||
dracut_install gzip bzip2
|
||||
}
|
||||
|
||||
install_local_i18n() {
|
||||
local map
|
||||
|
||||
eval $(gather_vars ${i18n_vars})
|
||||
[ -f $I18N_CONF ] && . $I18N_CONF
|
||||
[ -f $VCONFIG_CONF ] && . $VCONFIG_CONF
|
||||
|
||||
# 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
|
||||
ddebug "Adding extra map: ${map}"
|
||||
findkeymap ${map}
|
||||
done
|
||||
|
||||
inst_opt_decompress ${KEYMAPS}
|
||||
|
||||
inst_opt_decompress ${kbddir}/consolefonts/${DEFAULT_FONT}.*
|
||||
|
||||
if [[ ${FONT} ]]
|
||||
then
|
||||
FONT=${FONT%.psf*}
|
||||
inst_opt_decompress ${kbddir}/consolefonts/${FONT}.*
|
||||
fi
|
||||
|
||||
if [[ ${FONT_MAP} ]]
|
||||
then
|
||||
FONT_MAP=${FONT_MAP%.trans}
|
||||
inst_simple ${kbddir}/consoletrans/${FONT_MAP}.trans
|
||||
fi
|
||||
|
||||
if [[ ${FONT_UNIMAP} ]]
|
||||
then
|
||||
FONT_UNIMAP=${FONT_UNIMAP%.uni}
|
||||
inst_simple ${kbddir}/unimaps/${FONT_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 ${initdir}${I18N_CONF}
|
||||
mksubdirs ${initdir}${VCONFIG_CONF}
|
||||
print_vars LC_ALL LANG >> ${initdir}${I18N_CONF}
|
||||
print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> ${initdir}${VCONFIG_CONF}
|
||||
return 0
|
||||
}
|
||||
|
||||
checks() {
|
||||
for kbddir in ${kbddir} /usr/lib/kbd /lib/kbd /usr/share /usr/share/kbd
|
||||
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
|
||||
}
|
||||
|
||||
[[ -f $I18N_CONF && -f $VCONFIG_CONF ]] || \
|
||||
[[ ! ${hostonly} || ${i18n_vars} ]] || {
|
||||
derror 'i18n_vars not set! Please set up i18n_vars in ' \
|
||||
'configuration file.'
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
if checks
|
||||
then
|
||||
install_base
|
||||
|
||||
if [[ ${hostonly} ]]
|
||||
then
|
||||
install_local_i18n || install_all_kbd
|
||||
else
|
||||
install_all_kbd
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
44
modules.d/10i18n/parse-i18n.sh
Executable file
44
modules.d/10i18n/parse-i18n.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
inst_key_val() {
|
||||
local _value
|
||||
local _file
|
||||
local _default
|
||||
_default=$1
|
||||
shift
|
||||
_file=$1
|
||||
shift
|
||||
_value=$(getarg $@)
|
||||
[ -z "${_value}" ] && _value=$_default
|
||||
if [ -n "${_value}" ]; then
|
||||
printf '%s="%s"\n' $1 ${_value} >> $_file
|
||||
fi
|
||||
unset _file
|
||||
unset _value
|
||||
}
|
||||
|
||||
inst_key_val '' /etc/vconsole.conf KEYMAP vconsole.keymap KEYTABLE
|
||||
inst_key_val '' /etc/vconsole.conf FONT vconsole.font SYSFONT
|
||||
inst_key_val '' /etc/vconsole.conf FONT_MAP vconsole.font.map CONTRANS
|
||||
inst_key_val '' /etc/vconsole.conf FONT_UNIMAP vconsole.font.unimap UNIMAP
|
||||
inst_key_val 1 /etc/vconsole.conf UNICODE vconsole.unicode vconsole.font.unicode
|
||||
inst_key_val '' /etc/vconsole.conf EXT_KEYMAP vconsole.keymap.ext
|
||||
|
||||
inst_key_val '' /etc/locale.conf LANG locale.LANG
|
||||
inst_key_val '' /etc/locale.conf LC_ALL locale.LC_ALL
|
||||
|
||||
if [ -f /etc/locale.conf ]; then
|
||||
. /etc/locale.conf
|
||||
export LANG
|
||||
export LC_ALL
|
||||
fi
|
||||
|
||||
# FIXME: fix systemd-vconsole-setup
|
||||
#if [ -x /lib/systemd/systemd-vconsole-setup ]; then
|
||||
# /lib/systemd/systemd-vconsole-setup
|
||||
# rm -f /{etc,lib}/udev/rules.d/10-console.rules
|
||||
# rm -f /lib/udev/console_init
|
||||
# ln -s /lib/systemd/systemd-vconsole-setup /lib/udev/console_init
|
||||
#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
|
||||
|
29
modules.d/10rpmversion/module-setup.sh
Executable file
29
modules.d/10rpmversion/module-setup.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
[ -f /etc/redhat-release ]
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
local _line
|
||||
local _dracut_rpm_version
|
||||
if [ -e "$moddir/dracut-version" ]; then
|
||||
_dracut_rpm_version=$(cat "$moddir/dracut-version")
|
||||
inst "$moddir/dracut-version" /lib/dracut/$_dracut_rpm_version
|
||||
else
|
||||
if rpm -qf $(type -P $0) &>/dev/null; then
|
||||
_dracut_rpm_version=$(rpm -qf --qf '%{name}-%{version}-%{release}\n' $(type -P $0) | { ver="";while read _line;do ver=$_line;done;echo $ver;} )
|
||||
mkdir -m 0755 -p $initdir/lib/dracut
|
||||
echo $_dracut_rpm_version > $initdir/lib/dracut/$_dracut_rpm_version
|
||||
fi
|
||||
fi
|
||||
inst_hook cmdline 01 "$moddir/version.sh"
|
||||
|
||||
}
|
||||
|
9
modules.d/10rpmversion/version.sh
Executable file
9
modules.d/10rpmversion/version.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
for i in lib/dracut/dracut-*; do
|
||||
if [ -f $i ]; then
|
||||
vinfo < $i
|
||||
fi
|
||||
done
|
||||
unset i
|
@@ -1,4 +0,0 @@
|
||||
#!/bin/sh
|
||||
which ip dhclient hostname >/dev/null 2>&1 || exit 1
|
||||
exit 255
|
||||
|
@@ -1,4 +1,6 @@
|
||||
#!/bin/sh
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
setup_interface() {
|
||||
ip=$new_ip_address
|
||||
@@ -7,41 +9,46 @@ 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
|
||||
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
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
if getarg rdnetdebug ; then
|
||||
exec >/tmp/dhclient.$interface.$$.out
|
||||
exec 2>>/tmp/dhclient.$interface.$$.out
|
||||
set -x
|
||||
fi
|
||||
export PS4="dhclient.$interface.$$ + "
|
||||
exec >>/run/initramfs/loginit.pipe 2>>/run/initramfs/loginit.pipe
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
# We already need a set netif here
|
||||
netif=$interface
|
||||
@@ -51,17 +58,25 @@ netif=$interface
|
||||
|
||||
case $reason in
|
||||
PREINIT)
|
||||
ip link set $netif up
|
||||
;;
|
||||
echo "dhcp: PREINIT $netif up"
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
;;
|
||||
BOUND)
|
||||
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
|
||||
;;
|
||||
*) ;;
|
||||
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
|
||||
initqueue --onetime --name netroot-$netif netroot $netif
|
||||
;;
|
||||
*) echo "dhcp: $reason";;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
@@ -1,3 +1,3 @@
|
||||
request subnet-mask, broadcast-address, time-offset, routers,
|
||||
domain-name, domain-name-servers, domain-search, host-name,
|
||||
root-path, interface-mtu;
|
||||
root-path, interface-mtu;
|
||||
|
@@ -1,4 +1,6 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# Don't continue if root is ok
|
||||
[ -n "$rootok" ] && return
|
||||
@@ -7,14 +9,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 ]' > $hookdir/initqueue/finished/dhcp.sh
|
||||
fi
|
||||
|
21
modules.d/40network/ifname-genrules.sh
Executable file
21
modules.d/40network/ifname-genrules.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=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
|
@@ -1,58 +1,88 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# We don't need to check for ip= errors here, that is handled by the
|
||||
# cmdline parser script
|
||||
#
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
# 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
|
||||
}
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
# Run dhclient
|
||||
do_dhcp() {
|
||||
# /sbin/dhclient-script will mark the netif up and generate the online
|
||||
# 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
|
||||
initqueue --onetime --name netroot-$netif netroot $netif
|
||||
}
|
||||
|
||||
# Handle static ip configuration
|
||||
do_static() {
|
||||
{
|
||||
echo ip link set $netif up
|
||||
echo ip addr flush dev $netif
|
||||
echo ip addr add $ip/$mask dev $netif
|
||||
strstr $ip '*:*:*' && load_ipv6
|
||||
|
||||
{
|
||||
echo ip link set $netif up
|
||||
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
|
||||
initqueue --onetime --name netroot-$netif netroot $netif
|
||||
}
|
||||
|
||||
PATH=$PATH:/sbin:/usr/sbin
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
if getarg rdnetdebug ; then
|
||||
exec >/tmp/ifup.$1.$$.out
|
||||
exec 2>>/tmp/ifup.$1.$$.out
|
||||
set -x
|
||||
fi
|
||||
export PS4="ifup.$1.$$ + "
|
||||
exec >>/run/initramfs/loginit.pipe 2>>/run/initramfs/loginit.pipe
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
# Huh? No $1?
|
||||
[ -z "$1" ] && exit 1
|
||||
@@ -60,6 +90,28 @@ fi
|
||||
# $netif reads easier than $1
|
||||
netif=$1
|
||||
|
||||
# enslave this interface to bond?
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
for slave in $bondslaves ; do
|
||||
if [ "$netif" = "$slave" ] ; then
|
||||
netif=$bondname
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# bridge this interface?
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
if [ "$netif" = "$ethname" ]; then
|
||||
if [ "$netif" = "$bondname" ] && [ -n "$DO_BOND_SETUP" ] ; then
|
||||
: # We need to really setup bond (recursive call)
|
||||
else
|
||||
netif="$bridgename"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# bail immediately if the interface is already up
|
||||
# or we don't need the network
|
||||
[ -f "/tmp/net.$netif.up" ] && exit 0
|
||||
@@ -75,31 +127,106 @@ if [ "$netif" = "lo" ] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# start bond if needed
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
|
||||
if [ "$netif" = "$bondname" ] && [ ! -e /tmp/net.$bondname.up ] ; then # We are master bond device
|
||||
modprobe bonding
|
||||
ip link set $netif down
|
||||
|
||||
# Stolen from ifup-eth
|
||||
# add the bits to setup driver parameters here
|
||||
for arg in $bondoptions ; do
|
||||
key=${arg%%=*};
|
||||
value=${arg##*=};
|
||||
# %{value:0:1} is replaced with non-bash specific construct
|
||||
if [ "${key}" = "arp_ip_target" -a "${#value}" != "0" -a "+${value%%+*}" != "+" ]; then
|
||||
OLDIFS=$IFS;
|
||||
IFS=',';
|
||||
for arp_ip in $value; do
|
||||
echo +$arp_ip > /sys/class/net/${netif}/bonding/$key
|
||||
done
|
||||
IFS=$OLDIFS;
|
||||
else
|
||||
echo $value > /sys/class/net/${netif}/bonding/$key
|
||||
fi
|
||||
done
|
||||
|
||||
ip link set $netif up
|
||||
|
||||
for slave in $bondslaves ; do
|
||||
ip link set $slave down
|
||||
ifenslave $bondname $slave
|
||||
ip link set $slave up
|
||||
wait_for_if_up $slave
|
||||
done
|
||||
|
||||
# add the bits to setup the needed post enslavement parameters
|
||||
for arg in $BONDING_OPTS ; do
|
||||
key=${arg%%=*};
|
||||
value=${arg##*=};
|
||||
if [ "${key}" = "primary" ]; then
|
||||
echo $value > /sys/class/net/${netif}/bonding/$key
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# XXX need error handling like dhclient-script
|
||||
|
||||
# start bridge if necessary
|
||||
if [ "$netif" = "$bridgename" ] && [ ! -e /tmp/net.$bridgename.up ]; then
|
||||
if [ "$ethname" = "$bondname" ] ; then
|
||||
DO_BOND_SETUP=yes ifup $bondname
|
||||
else
|
||||
ip link set $ethname up
|
||||
fi
|
||||
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
|
||||
# skip ibft
|
||||
[ "$autoconf" = "ibft" ] && continue
|
||||
|
||||
# If this option isn't directed at our interface, skip it
|
||||
[ -n "$dev" ] && [ "$dev" != "$netif" ] && continue
|
||||
|
||||
# Store config for later use
|
||||
for i in ip srv gw mask hostname; do
|
||||
eval '[ "$'$i'" ] && echo '$i'="$'$i'"'
|
||||
eval '[ "$'$i'" ] && echo '$i'="$'$i'"'
|
||||
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 +0,0 @@
|
||||
#!/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
|
||||
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 60 "$moddir/net-genrules.sh"
|
||||
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
|
||||
inst_hook cmdline 99 "$moddir/parse-ip-opts.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"
|
||||
|
||||
mkdir -p "${initdir}/var/run"
|
@@ -1,7 +1,17 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
for f in /tmp/dhclient.*.pid; do
|
||||
[ -e $f ] || continue
|
||||
read PID < $f;
|
||||
kill $PID;
|
||||
done
|
||||
|
||||
sleep 0.1
|
||||
|
||||
for f in /tmp/dhclient.*.pid; do
|
||||
[ -e $f ] || continue
|
||||
read PID < $f;
|
||||
kill -9 $PID;
|
||||
done
|
||||
|
72
modules.d/40network/module-setup.sh
Executable file
72
modules.d/40network/module-setup.sh
Executable file
@@ -0,0 +1,72 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
local _program
|
||||
. $dracutfunctions
|
||||
|
||||
for _program in ip arping dhclient ; do
|
||||
if ! type -P $_program >/dev/null; then
|
||||
derror "Could not find program \"$_program\" required by network."
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
|
||||
return 255
|
||||
}
|
||||
|
||||
depends() {
|
||||
[ -d /etc/sysconfig/network-scripts/ ] && echo ifcfg
|
||||
return 0
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
# 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_by_path drivers/net net_module_test)
|
||||
|
||||
instmods ecb arc4
|
||||
# bridge modules
|
||||
instmods bridge stp llc
|
||||
instmods ipv6
|
||||
# bonding
|
||||
instmods bonding
|
||||
}
|
||||
|
||||
install() {
|
||||
local _arch _i _dir
|
||||
dracut_install ip arping tr dhclient
|
||||
dracut_install -o brctl ifenslave
|
||||
inst "$moddir/ifup" "/sbin/ifup"
|
||||
inst "$moddir/netroot" "/sbin/netroot"
|
||||
inst "$moddir/dhclient-script" "/sbin/dhclient-script"
|
||||
inst_simple "$moddir/dhclient.conf" "/etc/dhclient.conf"
|
||||
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 96 "$moddir/parse-bond.sh"
|
||||
inst_hook cmdline 97 "$moddir/parse-bridge.sh"
|
||||
inst_hook cmdline 98 "$moddir/parse-ip-opts.sh"
|
||||
inst_hook cmdline 99 "$moddir/parse-ifname.sh"
|
||||
inst_hook pre-pivot 10 "$moddir/kill-dhclient.sh"
|
||||
|
||||
_arch=$(uname -m)
|
||||
|
||||
for _dir in "$usrlibdir/tls/$_arch" "$usrlibdir/tls" "$usrlibdir/$_arch" \
|
||||
"$usrlibdir" "$libdir"; do
|
||||
for _i in "$_dir"/libnss_dns.so.* "$_dir"/libnss_mdns4_minimal.so.*; do
|
||||
[ -e "$_i" ] && dracut_install "$_i"
|
||||
done
|
||||
done
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,6 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# pxelinux provides macaddr '-' separated, but we need ':'
|
||||
fix_bootif() {
|
||||
@@ -6,6 +8,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,25 +18,34 @@ fix_bootif() {
|
||||
|
||||
# Write udev rules
|
||||
{
|
||||
# bridge: attempt only the defined interface
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
IFACES=$ethname
|
||||
fi
|
||||
|
||||
# bond: attempt only the defined interface (override bridge defines)
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
# It is enough to fire up only one
|
||||
IFACES=${bondslaves%% *}
|
||||
fi
|
||||
|
||||
# BOOTIF says everything, use only that one
|
||||
BOOTIF=$(getarg 'BOOTIF=')
|
||||
if [ -n "$BOOTIF" ] ; then
|
||||
BOOTIF=$(fix_bootif "$BOOTIF")
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$BOOTIF"
|
||||
BOOTIF=$(fix_bootif "$BOOTIF")
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$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"
|
||||
done
|
||||
for iface in $IFACES ; do
|
||||
printf 'SUBSYSTEM=="net", ENV{INTERFACE}=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$iface"
|
||||
done
|
||||
|
||||
# Default: We don't know the interface to use, handle all
|
||||
else
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", RUN+="/sbin/ifup $env{INTERFACE}"\n'
|
||||
printf '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
|
||||
|
@@ -1,14 +1,10 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
PATH=$PATH:/sbin:/usr/sbin
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
if getarg rdnetdebug ; then
|
||||
exec >/tmp/netroot.$1.$$.out
|
||||
exec 2>>/tmp/netroot.$1.$$.out
|
||||
set -x
|
||||
fi
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
# Huh? Empty $1?
|
||||
[ -z "$1" ] && exit 1
|
||||
@@ -16,15 +12,6 @@ fi
|
||||
# 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
|
||||
@@ -33,41 +20,42 @@ fi
|
||||
[ -z "$netroot" ] && exit 1
|
||||
|
||||
# Let's see if we have to wait for other interfaces
|
||||
# Note: exit works just fine, since the last interface to be
|
||||
# Note: exit works just fine, since the last interface to be
|
||||
# online'd should see all files
|
||||
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
|
||||
for iface in $IFACES ; do
|
||||
[ -e /tmp/net.$iface.up ] || exit 1
|
||||
done
|
||||
|
||||
# Set or override primary interface
|
||||
# Set or override primary interface
|
||||
netif=$1
|
||||
[ -e "/tmp/net.bootdev" ] && read netif < /tmp/net.bootdev
|
||||
|
||||
# Figure out the handler for root=dhcp by recalling all netroot cmdline
|
||||
# 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
|
||||
|
||||
# Load dhcp options
|
||||
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||
|
||||
# If we have a specific bootdev with no dhcpoptions or empty root-path,
|
||||
# If we have a specific bootdev with no dhcpoptions or empty root-path,
|
||||
# we die. Otherwise we just warn
|
||||
if [ -z "$new_root_path" ] ; then
|
||||
[ -n "$BOOTDEV" ] && die "No dhcp root-path received for '$BOOTDEV'"
|
||||
warn "No dhcp root-path received for '$BOOTDEV' trying other interfaces if available"
|
||||
exit 1
|
||||
[ -n "$BOOTDEV" ] && die "No dhcp root-path received for '$BOOTDEV'"
|
||||
warn "No dhcp root-path received for '$BOOTDEV' trying other interfaces if available"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set netroot to new_root_path, so cmdline parsers don't call
|
||||
netroot=$new_root_path
|
||||
|
||||
for f in ./cmdline/90*.sh; do
|
||||
[ -f "$f" ] && . "$f";
|
||||
# FIXME!
|
||||
for f in $hookdir/cmdline/90*.sh; do
|
||||
[ -f "$f" ] && . "$f";
|
||||
done
|
||||
else
|
||||
else
|
||||
rootok="1"
|
||||
fi
|
||||
|
||||
@@ -77,7 +65,7 @@ fi
|
||||
|
||||
handler=${netroot%%:*}
|
||||
handler=${handler%%4}
|
||||
handler="/sbin/${handler}root"
|
||||
handler=$(command -v ${handler}root)
|
||||
if [ -z "$netroot" ] || [ ! -e "$handler" ] ; then
|
||||
die "No handler for netroot type '$netroot'"
|
||||
fi
|
||||
@@ -92,6 +80,48 @@ 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 the default router if root server is
|
||||
# unknown or not local, 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
|
||||
|
||||
# Get router IP if set
|
||||
[ -n "$new_routers" ] && gw_ip=${new_routers%%,*}
|
||||
[ -n "$gw" ] && gw_ip=$gw
|
||||
# Get root server IP if set
|
||||
if [ -n "$netroot" ]; then
|
||||
dummy=${netroot#*:}
|
||||
dummy=${dummy%%:*}
|
||||
case "$dummy" in
|
||||
[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*) netroot_ip=$dummy;;
|
||||
esac
|
||||
fi
|
||||
# Default arping dest to router
|
||||
dest="$gw_ip"
|
||||
# Change to arping root server if appropriate
|
||||
if [ -n "$netroot_ip" ]; then
|
||||
if [ -z "$dest" ]; then
|
||||
# no gateway so check root server
|
||||
dest="$netroot_ip"
|
||||
else
|
||||
r=$(ip route get "$netroot_ip")
|
||||
if ! strstr "$r" ' via ' ; then
|
||||
# local root server, so don't arping gateway
|
||||
dest="$netroot_ip"
|
||||
fi
|
||||
fi
|
||||
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
|
||||
|
||||
@@ -100,20 +130,20 @@ source_all netroot
|
||||
if $handler $netif $netroot $NEWROOT; then
|
||||
# Network rootfs mount successful
|
||||
for iface in $IFACES ; do
|
||||
[ -f /tmp/dhclient.$iface.lease ] && cp /tmp/dhclient.$iface.lease /tmp/net.$iface.lease
|
||||
[ -f /tmp/dhclient.$iface.dhcpopts ] && cp /tmp/dhclient.$iface.dhcpopts /tmp/net.$iface.dhcpopts
|
||||
[ -f /tmp/dhclient.$iface.lease ] && cp /tmp/dhclient.$iface.lease /tmp/net.$iface.lease
|
||||
[ -f /tmp/dhclient.$iface.dhcpopts ] && cp /tmp/dhclient.$iface.dhcpopts /tmp/net.$iface.dhcpopts
|
||||
done
|
||||
|
||||
# Save used netif for later use
|
||||
[ ! -f /tmp/net.ifaces ] && echo $netif > /tmp/net.ifaces
|
||||
else
|
||||
else
|
||||
warn "Mounting root via '$netif' failed"
|
||||
# If we're trying with multiple interfaces, put that one down.
|
||||
# ip down/flush ensures that routeing info goes away as well
|
||||
if [ -z "$BOOTDEV" ] ; then
|
||||
ip link set $netif down
|
||||
ip addr flush dev $netif
|
||||
echo "#empty" > /etc/resolv.conf
|
||||
ip link set $netif down
|
||||
ip addr flush dev $netif
|
||||
echo "#empty" > /etc/resolv.conf
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
|
63
modules.d/40network/parse-bond.sh
Executable file
63
modules.d/40network/parse-bond.sh
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Format:
|
||||
# bond=<bondname>[:<bondslaves>:[:<options>]]
|
||||
#
|
||||
# bondslaves is a comma-separated list of physical (ethernet) interfaces
|
||||
# options is a comma-separated list on bonding options (modinfo bonding for details) in format compatible with initscripts
|
||||
# if options include multi-valued arp_ip_target option, then its values should be separated by semicolon.
|
||||
#
|
||||
# bond without parameters assumes bond=bond0:eth0,eth1:mode=balance-rr
|
||||
#
|
||||
|
||||
# return if bond already parsed
|
||||
[ -n "$bondname" ] && return
|
||||
|
||||
# Check if bond parameter is valid
|
||||
if getarg bond= >/dev/null ; then
|
||||
if [ -z "$netroot" ] ; then
|
||||
die "No netboot configured, bond is invalid"
|
||||
fi
|
||||
fi
|
||||
|
||||
# We translate list of slaves to space-separated here to mwke it easier to loop over them in ifup
|
||||
# Ditto for bonding options
|
||||
parsebond() {
|
||||
local v=${1}:
|
||||
set --
|
||||
while [ -n "$v" ]; do
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
done
|
||||
|
||||
unset bondname bondslaves bondoptions
|
||||
case $# in
|
||||
0) bondname=bond0; bondslaves="eth0 eth1" ;;
|
||||
1) bondname=$1; bondslaves="eth0 eth1" ;;
|
||||
2) bondname=$1; bondslaves=$(echo $2|tr "," " ") ;;
|
||||
3) bondname=$1; bondslaves=$(echo $2|tr "," " "); bondoptions=$(echo $3|tr "," " ") ;;
|
||||
*) die "bond= requires zero to four parameters" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
unset bondname bondslaves bondoptions
|
||||
|
||||
# Parse bond for bondname, bondslaves, bondmode and bondoptions
|
||||
if getarg bond >/dev/null; then
|
||||
# Read bond= parameters if they exist
|
||||
bond="$(getarg bond=)"
|
||||
if [ ! "$bond" = "bond" ]; then
|
||||
parsebond "$(getarg bond=)"
|
||||
fi
|
||||
# Simple default bond
|
||||
if [ -z "$bondname" ]; then
|
||||
bondname=bond0
|
||||
bondslaves="eth0 eth1"
|
||||
fi
|
||||
# Make it suitable for initscripts export
|
||||
bondoptions=$(echo $bondoptions|tr ";" ",")
|
||||
echo "bondname=$bondname" > /tmp/bond.info
|
||||
echo "bondslaves=\"$bondslaves\"" >> /tmp/bond.info
|
||||
echo "bondoptions=\"$bondoptions\"" >> /tmp/bond.info
|
||||
return
|
||||
fi
|
62
modules.d/40network/parse-bridge.sh
Executable file
62
modules.d/40network/parse-bridge.sh
Executable file
@@ -0,0 +1,62 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=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=$iface ;;
|
||||
1) die "bridge= requires two parameters" ;;
|
||||
2) bridgename=$1; ethname=$2 ;;
|
||||
*) die "bridge= requires two parameters" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
unset bridgename ethname
|
||||
|
||||
iface=eth0
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
if [ -n "$bondname" ] ; then
|
||||
iface=$bondname
|
||||
fi
|
||||
fi
|
||||
|
||||
# Parse bridge for bridgename and ethname
|
||||
if bridge="$(getarg bridge)"; then
|
||||
# Read bridge= parameters if they exist
|
||||
if [ -n "$bridge" ]; then
|
||||
parsebridge $bridge
|
||||
fi
|
||||
# Simple default bridge
|
||||
if [ -z "$bridgename" ]; then
|
||||
bridgename=br0
|
||||
ethname=$iface
|
||||
fi
|
||||
echo "bridgename=$bridgename" > /tmp/bridge.info
|
||||
echo "ethname=$ethname" >> /tmp/bridge.info
|
||||
return
|
||||
fi
|
39
modules.d/40network/parse-ifname.sh
Executable file
39
modules.d/40network/parse-ifname.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=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
|
@@ -1,40 +1,26 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Format:
|
||||
# ip=[dhcp|on|any]
|
||||
# ip=[dhcp|on|any]
|
||||
#
|
||||
# ip=<interface>:[dhcp|on|any]
|
||||
# ip=<interface>:[dhcp|on|any]
|
||||
#
|
||||
# ip=<client-IP-number>:<server-id>:<gateway-IP-number>:<netmask>:<client-hostname>:<interface>:[dhcp|on|any|none|off]
|
||||
# ip=<client-IP-number>:<server-id>:<gateway-IP-number>:<netmask>:<client-hostname>:<interface>:[dhcp|on|any|none|off]
|
||||
#
|
||||
# When supplying more than only ip= line, <interface> is mandatory and
|
||||
# bootdev= must contain the name of the primary interface to use for
|
||||
# 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
|
||||
}
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
# Check if ip= lines should be used
|
||||
if getarg ip= >/dev/null ; then
|
||||
if [ -z "$netroot" ] ; then
|
||||
echo "Warning: No netboot configured, ignoring ip= lines"
|
||||
return;
|
||||
echo "Warning: No netboot configured, ignoring ip= lines"
|
||||
return;
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -45,18 +31,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
|
||||
@@ -67,51 +51,90 @@ if [ -n "$NEEDBOOTDEV" ] ; then
|
||||
[ -z "$BOOTDEV" ] && die "Bootdev argument is empty"
|
||||
fi
|
||||
|
||||
if [ "ibft" = "$(getarg ip=)" ]; then
|
||||
modprobe iscsi_ibft
|
||||
num=0
|
||||
(
|
||||
for iface in /sys/firmware/ibft/ethernet*; do
|
||||
[ -e ${iface}/mac ] || continue
|
||||
ifname_mac=$(read a < ${iface}/mac; echo $a)
|
||||
[ -z "$ifname_mac" ] && continue
|
||||
unset dev
|
||||
for ifname in $(getargs ifname=); do
|
||||
if strstr "$ifname" "$ifname_mac"; then
|
||||
dev=${ifname%%:*}
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ -z "$dev" ]; then
|
||||
ifname_if=ibft$num
|
||||
num=$(( $num + 1 ))
|
||||
echo "ifname=$ifname_if:$ifname_mac"
|
||||
dev=$ifname_if
|
||||
fi
|
||||
|
||||
dhcp=$(read a < ${iface}/dhcp; echo $a)
|
||||
if [ -n "$dhcp" ]; then
|
||||
echo "ip=$dev:dhcp"
|
||||
else
|
||||
ip=$(read a < ${iface}/ip-addr; echo $a)
|
||||
gw=$(read a < ${iface}/gateway; echo $a)
|
||||
mask=$(read a < ${iface}/subnet-mask; echo $a)
|
||||
hostname=$(read a < ${iface}/hostname; echo $a)
|
||||
echo "ip=$ip::$gw:$mask:$hostname:$dev:none"
|
||||
fi
|
||||
done
|
||||
) >> /etc/cmdline
|
||||
# reread cmdline
|
||||
unset CMDLINE
|
||||
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
|
||||
for p in $(getargs ip=); do
|
||||
ip_to_var $p
|
||||
|
||||
ip_to_var ${p#ip=}
|
||||
# skip ibft
|
||||
[ "$autoconf" = "ibft" ] && continue
|
||||
|
||||
# We need to have an ip= line for the specified bootdev
|
||||
[ -n "$NEEDBOOTDEV" ] && [ "$dev" = "$BOOTDEV" ] && BOOTDEVOK=1
|
||||
|
||||
# Empty autoconf defaults to 'dhcp'
|
||||
if [ -z "$autoconf" ] ; then
|
||||
warn "Empty autoconf values default to dhcp"
|
||||
autoconf="dhcp"
|
||||
warn "Empty autoconf values default to dhcp"
|
||||
autoconf="dhcp"
|
||||
fi
|
||||
|
||||
# Error checking for autoconf in combination with other values
|
||||
case $autoconf in
|
||||
error) die "Error parsing option '$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"
|
||||
[ -z "$mask" ] && \
|
||||
die "Sorry, automatic calculation of netmask is not yet supported"
|
||||
;;
|
||||
dhcp|on|any) \
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
|
||||
die "Sorry, '$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 '$p'\nSorry, unknown value '$autoconf'";;
|
||||
error) die "Error parsing option 'ip=$p'";;
|
||||
bootp|rarp|both) die "Sorry, ip=$autoconf is currenty unsupported";;
|
||||
none|off) \
|
||||
[ -z "$ip" ] && \
|
||||
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"
|
||||
;;
|
||||
auto6);;
|
||||
dhcp|dhcp6|on|any) \
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
|
||||
die "Sorry, 'ip=$p' does not make sense for multiple interface configurations"
|
||||
[ -n "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$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'"
|
||||
done
|
||||
fi
|
||||
# IFACES list for later use
|
||||
IFACES="$IFACES $dev"
|
||||
if [ -n "$IFACES" ] ; then
|
||||
for i in $IFACES ; do
|
||||
[ "$dev" = "$i" ] && die "For argument 'ip=$p'\nDuplication configurations for '$dev'"
|
||||
done
|
||||
fi
|
||||
# IFACES list for later use
|
||||
IFACES="$IFACES $dev"
|
||||
fi
|
||||
|
||||
# Small optimization for udev rules
|
||||
@@ -119,21 +142,21 @@ for p in $CMDLINE; do
|
||||
|
||||
# Do we need to check for specific options?
|
||||
if [ -n "$NEEDDHCP" ] || [ -n "$DHCPORSERVER" ] ; then
|
||||
# Correct device? (Empty is ok as well)
|
||||
[ "$dev" = "$BOOTDEV" ] || continue
|
||||
# Server-ip is there?
|
||||
[ -n "$DHCPORSERVER" ] && [ -n "$srv" ] && continue
|
||||
# dhcp? (It's simpler to check for a set ip. Checks above ensure that if
|
||||
# ip is there, we're static
|
||||
[ -z "$ip" ] && continue
|
||||
# Not good!
|
||||
die "Server-ip or dhcp for netboot needed, but current arguments say otherwise"
|
||||
# Correct device? (Empty is ok as well)
|
||||
[ "$dev" = "$BOOTDEV" ] || continue
|
||||
# Server-ip is there?
|
||||
[ -n "$DHCPORSERVER" ] && [ -n "$srv" ] && continue
|
||||
# dhcp? (It's simpler to check for a set ip. Checks above ensure that if
|
||||
# ip is there, we're static
|
||||
[ -z "$ip" ] && continue
|
||||
# Not good!
|
||||
die "Server-ip or dhcp for netboot needed, but current arguments say otherwise"
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
# This ensures that BOOTDEV is always first in IFACES
|
||||
if [ -n "$BOOTDEV" ] && [ -n "$IFACES" ] ; then
|
||||
if [ -n "$BOOTDEV" ] && [ -n "$IFACES" ] ; then
|
||||
IFACES="${IFACES%$BOOTDEV*} ${IFACES#*$BOOTDEV}"
|
||||
IFACES="$BOOTDEV $IFACES"
|
||||
fi
|
||||
@@ -142,5 +165,5 @@ fi
|
||||
[ -n "$BOOTDEV" ] && echo $BOOTDEV > /tmp/net.bootdev
|
||||
[ -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"
|
||||
# We need a ip= line for the configured bootdev=
|
||||
[ -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
|
16
modules.d/45ifcfg/module-setup.sh
Executable file
16
modules.d/45ifcfg/module-setup.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
return 255
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
inst_hook pre-pivot 85 "$moddir/write-ifcfg.sh"
|
||||
}
|
||||
|
144
modules.d/45ifcfg/write-ifcfg.sh
Executable file
144
modules.d/45ifcfg/write-ifcfg.sh
Executable file
@@ -0,0 +1,144 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=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
|
||||
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
fi
|
||||
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
fi
|
||||
|
||||
mkdir -m 0755 -p /tmp/ifcfg/
|
||||
|
||||
for netif in $IFACES ; do
|
||||
# bridge?
|
||||
unset bridge
|
||||
unset bond
|
||||
if [ "$netif" = "$bridgename" ]; then
|
||||
bridge=yes
|
||||
elif [ "$netif" = "$bondname" ]; then
|
||||
# $netif can't be bridge and bond at the same time
|
||||
bond=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
|
||||
[ -e /tmp/net.$netif.override ] && . /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" ] && [ -z "$bond" ]; then
|
||||
# standard interface
|
||||
{
|
||||
echo "HWADDR=$(cat /sys/class/net/$netif/address)"
|
||||
echo "TYPE=Ethernet"
|
||||
echo "NAME=\"Boot Disk\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
fi
|
||||
|
||||
if [ -n "$bond" ] ; then
|
||||
# bond interface
|
||||
{
|
||||
# This variable is an indicator of a bond interface for initscripts
|
||||
echo "BONDING_OPTS=\"$bondoptions\""
|
||||
echo "NAME=\"Boot Disk\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
|
||||
for slave in $bondslaves ; do
|
||||
# Set ONBOOT=no to prevent initscripts from trying to setup already bonded physical interface
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$slave"
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=no"
|
||||
echo "NETBOOT=yes"
|
||||
echo "HWADDR=$(cat /sys/class/net/$slave/address)"
|
||||
echo "SLAVE=yes"
|
||||
echo "MASTER=$netif"
|
||||
echo "NAME=$slave"
|
||||
} >> /tmp/ifcfg/ifcfg-$slave
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -n "$bridge" ] ; then
|
||||
# bridge
|
||||
{
|
||||
echo "TYPE=Bridge"
|
||||
echo "NAME=\"Boot Disk\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
if [ "$ethname" = "$bondname" ] ; then
|
||||
{
|
||||
# Set ONBOOT=no to prevent initscripts from trying to setup already bridged bond interface
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$bondname"
|
||||
echo "ONBOOT=no"
|
||||
echo "NETBOOT=yes"
|
||||
# This variable is an indicator of a bond interface for initscripts
|
||||
echo "BONDING_OPTS=\"$bondoptions\""
|
||||
echo "BRIDGE=$netif"
|
||||
echo "NAME=\"$bondname\""
|
||||
} >> /tmp/ifcfg/ifcfg-$bondname
|
||||
for slave in $bondslaves ; do
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
# Set ONBOOT=no to prevent initscripts from trying to setup already bridged physical interface
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$slave"
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=no"
|
||||
echo "NETBOOT=yes"
|
||||
echo "HWADDR=$(cat /sys/class/net/$slave/address)"
|
||||
echo "SLAVE=yes"
|
||||
echo "MASTER=$bondname"
|
||||
echo "NAME=$slave"
|
||||
} >> /tmp/ifcfg/ifcfg-$slave
|
||||
done
|
||||
else
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$ethname"
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=no"
|
||||
echo "NETBOOT=yes"
|
||||
echo "HWADDR=$(cat /sys/class/net/$ethname/address)"
|
||||
echo "BRIDGE=$netif"
|
||||
echo "NAME=$ethname"
|
||||
} >> /tmp/ifcfg/ifcfg-$ethname
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Pass network opts
|
||||
[ -d /run/initramfs ] || mkdir -m 0755 -p /run/initramfs
|
||||
cp /tmp/net.* /run/initramfs/ >/dev/null 2>&1
|
||||
for i in /run/initramfs/state /run/initramfs/state/etc/ /run/initramfs/state/etc/sysconfig /run/initramfs/state/etc/sysconfig/network-scripts; do
|
||||
[ -d $i ] || mkdir -m 0755 -p $i
|
||||
done
|
||||
cp /tmp/net.$netif.resolv.conf /run/initramfs/state/etc/ >/dev/null 2>&1
|
||||
echo "files /etc/sysconfig/network-scripts" > /run/initramfs/rwtab
|
||||
cp -a -t /run/initramfs/state/etc/sysconfig/network-scripts/ /tmp/ifcfg/* >/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>,...
|
7
modules.d/50gensplash/gensplash-emergency.sh
Executable file
7
modules.d/50gensplash/gensplash-emergency.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
CDROOT=0
|
||||
. /lib/gensplash-lib.sh
|
||||
splash verbose
|
7
modules.d/50gensplash/gensplash-newroot.sh
Executable file
7
modules.d/50gensplash/gensplash-newroot.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
CDROOT=0
|
||||
. /lib/gensplash-lib.sh
|
||||
splash set_msg 'Switching to new root'
|
17
modules.d/50gensplash/gensplash-pretrigger.sh
Executable file
17
modules.d/50gensplash/gensplash-pretrigger.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if getargbool 1 rd.splash -n 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"
|
||||
|
||||
[ -x /lib/udev/console_init ] && /lib/udev/console_init /dev/tty0
|
||||
CDROOT=0
|
||||
. /lib/gensplash-lib.sh
|
||||
splash init
|
||||
[ -x /lib/udev/console_init ] && /lib/udev/console_init /dev/tty0
|
||||
fi
|
79
modules.d/50gensplash/module-setup.sh
Executable file
79
modules.d/50gensplash/module-setup.sh
Executable file
@@ -0,0 +1,79 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
# TODO: splash_geninitramfs
|
||||
# TODO: /usr/share/splashutils/initrd.splash
|
||||
return 255
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
local _opts
|
||||
local _splash_theme
|
||||
local _splash_res
|
||||
|
||||
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
|
||||
dwarn "${line}"
|
||||
else
|
||||
derror "${line}"
|
||||
(( $_ret == 0 )) && _ret=1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
return ${_ret}
|
||||
}
|
||||
|
||||
type -P splash_geninitramfs >/dev/null || return 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"
|
||||
return 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 +0,0 @@
|
||||
#!/bin/bash
|
||||
[[ $1 = -d ]] && echo crypt
|
||||
[[ -x /sbin/plymouthd && -x /bin/plymouth && -x /usr/sbin/plymouth-set-default-theme ]]
|
@@ -1,21 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# do not ask, if we already have root
|
||||
[ -f /sysroot/proc ] && exit 0
|
||||
|
||||
# check if destination already exists
|
||||
[ -b /dev/mapper/$2 ] && exit 0
|
||||
|
||||
# we already asked for this device
|
||||
[ -f /tmp/cryptroot-asked-$2 ] && exit 0
|
||||
|
||||
# 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"
|
||||
} 9>/.console.lock
|
||||
|
||||
# mark device as asked
|
||||
>> /tmp/cryptroot-asked-$2
|
||||
|
||||
exit 0
|
||||
|
@@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
. "$moddir"/plymouth-populate-initrd
|
||||
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
|
36
modules.d/50plymouth/module-setup.sh
Executable file
36
modules.d/50plymouth/module-setup.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
[[ -x /sbin/plymouthd && -x /bin/plymouth && -x /usr/sbin/plymouth-set-default-theme ]]
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
local _modname
|
||||
# Include KMS capable drm drivers
|
||||
for _modname in $(find "$srcmods/kernel/drivers/gpu/drm" "$srcmods/extra" -name '*.ko' 2>/dev/null); do
|
||||
grep -q drm_crtc_init $_modname && instmods $_modname
|
||||
done
|
||||
}
|
||||
|
||||
install() {
|
||||
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 readlink
|
||||
}
|
||||
|
3
modules.d/50plymouth/plymouth-emergency.sh
Normal file → Executable file
3
modules.d/50plymouth/plymouth-emergency.sh
Normal file → Executable file
@@ -1 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
[ -x /bin/plymouth ] && /bin/plymouth --hide-splash
|
||||
|
@@ -1,5 +1,7 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if [ -x /bin/plymouth ]; then
|
||||
/bin/plymouth --newroot=$NEWROOT
|
||||
/bin/plymouth --newroot=$NEWROOT
|
||||
fi
|
||||
|
@@ -1,38 +1,49 @@
|
||||
#!/bin/bash
|
||||
if ldd /sbin/plymouthd |grep -q lib64; then
|
||||
LIBDIR="/usr/lib64"
|
||||
else
|
||||
LIBDIR="/usr/lib"
|
||||
fi
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
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
|
||||
/etc/system-release
|
||||
|
||||
if [[ -f "${LIBDIR}/plymouth/${PLYMOUTH_THEME:=text}.so" ]]; then
|
||||
dracut_install "${LIBDIR}/plymouth/${PLYMOUTH_THEME:=text}.so"
|
||||
fi
|
||||
mkdir -m 0755 -p "${initdir}/usr/share/plymouth"
|
||||
|
||||
mkdir -p "${initdir}/usr/share/plymouth"
|
||||
if [[ $hostonly ]]; then
|
||||
dracut_install "${usrlibdir}/plymouth/text.so" \
|
||||
"${usrlibdir}/plymouth/details.so" \
|
||||
"/usr/share/plymouth/themes/details/details.plymouth" \
|
||||
"/usr/share/plymouth/themes/text/text.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
|
||||
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 "${usrlibdir}/plymouth/${PLYMOUTH_PLUGIN}.so"
|
||||
fi
|
||||
else
|
||||
for x in /usr/share/plymouth/themes/{text,details}/* ; do
|
||||
[[ -f "$x" ]] || continue
|
||||
THEME_DIR=$(dirname "$x")
|
||||
mkdir -m 0755 -p "${initdir}/$THEME_DIR"
|
||||
dracut_install "$x"
|
||||
done
|
||||
for x in "${usrlibdir}"/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
|
||||
|
||||
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
|
||||
fi
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
|
@@ -1,21 +1,26 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=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 getargbool 1 rd.plymouth -n rd_NO_PLYMOUTH; then
|
||||
[ -c /dev/null ] || mknod -m 0666 /dev/null c 1 3
|
||||
# first trigger graphics subsystem
|
||||
udevadm trigger --action=add --attr-match=class=0x030000 >/dev/null 2>&1
|
||||
# first trigger graphics and tty subsystem
|
||||
udevadm trigger --action=add --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
|
||||
|
||||
[ -x /bin/plymouthd ] && /bin/plymouthd
|
||||
|
||||
/lib/udev/console_init tty0
|
||||
/bin/plymouth --show-splash
|
||||
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
|
||||
|
||||
info "Starting plymouth daemon"
|
||||
mkdir -m 0755 /run/plymouth
|
||||
[ -x /lib/udev/console_init ] && /lib/udev/console_init /dev/tty0
|
||||
[ -x /bin/plymouthd ] && /bin/plymouthd --attach-to-session --pid-file /run/plymouth/pid
|
||||
/bin/plymouth --show-splash 2>&1 | vinfo
|
||||
# reset tty after plymouth messed with it
|
||||
[ -x /lib/udev/console_init ] && /lib/udev/console_init /dev/tty0
|
||||
fi
|
||||
|
42
modules.d/60xen/module-setup.sh
Executable file
42
modules.d/60xen/module-setup.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
# No Xen-detect? Boo!!
|
||||
if ! hash xen-detect 2>/dev/null; then
|
||||
[[ -d /usr/lib/xen-default ]] && \
|
||||
hash -p /usr/lib/xen-default/bin/xen-detect xen-detect || return 1
|
||||
fi
|
||||
|
||||
. $dracutfunctions
|
||||
[[ $debug ]] && set -x
|
||||
|
||||
# Yes, we are under Xen PV env.
|
||||
xen-detect | grep -q -v PV || return 0
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
local _i
|
||||
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
|
||||
|
||||
}
|
||||
|
||||
install() {
|
||||
hash xen-detect 2>/dev/null || \
|
||||
hash -p /usr/lib/xen-default/bin/xen-detect xen-detect
|
||||
inst "$(hash -t xen-detect)" /sbin/xen-detect
|
||||
inst_hook pre-udev 40 "$moddir/xen-pre-udev.sh"
|
||||
}
|
||||
|
13
modules.d/60xen/xen-pre-udev.sh
Executable file
13
modules.d/60xen/xen-pre-udev.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
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
|
11
modules.d/90btrfs/80-btrfs.rules
Normal file
11
modules.d/90btrfs/80-btrfs.rules
Normal file
@@ -0,0 +1,11 @@
|
||||
SUBSYSTEM!="block", GOTO="btrfs_end"
|
||||
ACTION!="add|change", GOTO="btrfs_end"
|
||||
ENV{ID_FS_TYPE}!="btrfs", GOTO="btrfs_end"
|
||||
RUN+="/sbin/modprobe btrfs"
|
||||
RUN+="/sbin/btrfs device scan $env{DEVNAME}"
|
||||
|
||||
RUN+="/sbin/initqueue --finished --unique --name btrfs_finished /sbin/btrfs_finished"
|
||||
RUN+="/sbin/initqueue --timeout --onetime --unique --name btrfs_timeout /sbin/btrfs_timeout"
|
||||
|
||||
LABEL="btrfs_end"
|
||||
|
18
modules.d/90btrfs/btrfs_finished.sh
Executable file
18
modules.d/90btrfs/btrfs_finished.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
if [ -e /dev/root ]; then
|
||||
if strstr "$(udevadm info --query=env --name=/dev/root)" "ID_FS_TYPE=btrfs"; then
|
||||
info "Checking, if btrfs device complete"
|
||||
unset __btrfs_mount
|
||||
mount -o ro /dev/root /tmp >/dev/null 2>&1
|
||||
__btrfs_mount=$?
|
||||
[ $__btrfs_mount -eq 0 ] && umount /dev/root >/dev/null 2>&1
|
||||
exit $__btrfs_mount
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
9
modules.d/90btrfs/btrfs_timeout.sh
Executable file
9
modules.d/90btrfs/btrfs_timeout.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
info "Scanning for all btrfs devices"
|
||||
/sbin/btrfs device scan 2>&1 | vinfo
|
||||
exit 0
|
41
modules.d/90btrfs/module-setup.sh
Executable file
41
modules.d/90btrfs/module-setup.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
local _rootdev
|
||||
# if we don't have btrfs installed on the host system,
|
||||
# no point in trying to support it in the initramfs.
|
||||
type -P btrfs >/dev/null || return 1
|
||||
|
||||
. $dracutfunctions
|
||||
[[ $debug ]] && set -x
|
||||
|
||||
is_btrfs() { get_fs_type /dev/block/$1 | grep -q btrfs; }
|
||||
|
||||
if [[ $hostonly ]]; then
|
||||
_rootdev=$(find_root_block_device)
|
||||
if [[ $_rootdev ]]; then
|
||||
is_btrfs "$_rootdev" || return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
depends() {
|
||||
echo udev-rules
|
||||
return 0
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
instmods btrfs
|
||||
}
|
||||
|
||||
install() {
|
||||
inst_rules "$moddir/80-btrfs.rules"
|
||||
inst "$moddir/btrfs_finished.sh" /sbin/btrfs_finished
|
||||
inst "$moddir/btrfs_timeout.sh" /sbin/btrfs_timeout
|
||||
dracut_install btrfs btrfsck
|
||||
}
|
||||
|
@@ -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 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# if cryptsetup is not installed, then we cannot support encrypted devices.
|
||||
which cryptsetup >/dev/null 2>&1 || exit 1
|
||||
|
||||
# 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
|
||||
|
||||
exit 0
|
15
modules.d/90crypt/crypt-cleanup.sh
Executable file
15
modules.d/90crypt/crypt-cleanup.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
# close everything which is not busy
|
||||
rm -f /etc/udev/rules.d/70-luks.rules >/dev/null 2>&1
|
||||
|
||||
if ! getarg rd.luks.uuid rd_LUKS_UUID && getargbool 1 rd.luks -n rd_NO_LUKS; then
|
||||
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
|
||||
fi
|
222
modules.d/90crypt/crypt-lib.sh
Normal file
222
modules.d/90crypt/crypt-lib.sh
Normal file
@@ -0,0 +1,222 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
command -v getarg >/dev/null || . /lib/dracut-lib.sh
|
||||
|
||||
# ask_for_password
|
||||
#
|
||||
# Wraps around plymouth ask-for-password and adds fallback to tty password ask
|
||||
# if plymouth is not present.
|
||||
#
|
||||
# --cmd command
|
||||
# Command to execute. Required.
|
||||
# --prompt prompt
|
||||
# Password prompt. Note that function already adds ':' at the end.
|
||||
# Recommended.
|
||||
# --tries n
|
||||
# How many times repeat command on its failure. Default is 3.
|
||||
# --ply-[cmd|prompt|tries]
|
||||
# Command/prompt/tries specific for plymouth password ask only.
|
||||
# --tty-[cmd|prompt|tries]
|
||||
# Command/prompt/tries specific for tty password ask only.
|
||||
# --tty-echo-off
|
||||
# Turn off input echo before tty command is executed and turn on after.
|
||||
# It's useful when password is read from stdin.
|
||||
ask_for_password() {
|
||||
local cmd; local prompt; local tries=3
|
||||
local ply_cmd; local ply_prompt; local ply_tries=3
|
||||
local tty_cmd; local tty_prompt; local tty_tries=3
|
||||
local ret
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--cmd) ply_cmd="$2"; tty_cmd="$2" shift;;
|
||||
--ply-cmd) ply_cmd="$2"; shift;;
|
||||
--tty-cmd) tty_cmd="$2"; shift;;
|
||||
--prompt) ply_prompt="$2"; tty_prompt="$2" shift;;
|
||||
--ply-prompt) ply_prompt="$2"; shift;;
|
||||
--tty-prompt) tty_prompt="$2"; shift;;
|
||||
--tries) ply_tries="$2"; tty_tries="$2"; shift;;
|
||||
--ply-tries) ply_tries="$2"; shift;;
|
||||
--tty-tries) tty_tries="$2"; shift;;
|
||||
--tty-echo-off) tty_echo_off=yes;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
{ flock -s 9;
|
||||
# Prompt for password with plymouth, if installed and running.
|
||||
if [ -x /bin/plymouth ]; then
|
||||
/bin/plymouth ask-for-password \
|
||||
--prompt "$ply_prompt" --number-of-tries=$ply_tries \
|
||||
--command="$ply_cmd"
|
||||
ret=$?
|
||||
else
|
||||
if [ "$tty_echo_off" = yes ]; then
|
||||
stty_orig="$(stty -g)"
|
||||
stty -echo
|
||||
fi
|
||||
|
||||
local i=1
|
||||
while [ $i -le $tty_tries ]; do
|
||||
[ -n "$tty_prompt" ] && \
|
||||
printf "$tty_prompt [$i/$tty_tries]:" >&2
|
||||
eval "$tty_cmd" && ret=0 && break
|
||||
ret=$?
|
||||
i=$(($i+1))
|
||||
[ -n "$tty_prompt" ] && printf '\n' >&2
|
||||
done
|
||||
|
||||
[ "$tty_echo_off" = yes ] && stty $stty_orig
|
||||
fi
|
||||
} 9>/.console_lock
|
||||
|
||||
[ $ret -ne 0 ] && echo "Wrong password" >&2
|
||||
return $ret
|
||||
}
|
||||
|
||||
# Try to mount specified device (by path, by UUID or by label) and check
|
||||
# the path with 'test'.
|
||||
#
|
||||
# example:
|
||||
# test_dev -f LABEL="nice label" /some/file1
|
||||
test_dev() {
|
||||
local test_op=$1; local dev="$2"; local f="$3"
|
||||
local ret=1; local mount_point=$(mkuniqdir /mnt testdev)
|
||||
local path
|
||||
|
||||
[ -n "$dev" -a -n "$*" ] || return 1
|
||||
[ -d "$mount_point" ] || die 'Mount point does not exist!'
|
||||
|
||||
if mount -r "$dev" "$mount_point" >/dev/null 2>&1; then
|
||||
test $test_op "${mount_point}/${f}"
|
||||
ret=$?
|
||||
umount "$mount_point"
|
||||
fi
|
||||
|
||||
rmdir "$mount_point"
|
||||
|
||||
return $ret
|
||||
}
|
||||
|
||||
# Get kernel name for given device. Device may be the name too (then the same
|
||||
# is returned), a symlink (full path), UUID (prefixed with "UUID=") or label
|
||||
# (prefixed with "LABEL="). If just a beginning of the UUID is specified or
|
||||
# even an empty, function prints all device names which UUIDs match - every in
|
||||
# single line.
|
||||
#
|
||||
# NOTICE: The name starts with "/dev/".
|
||||
#
|
||||
# Example:
|
||||
# devnames UUID=123
|
||||
# May print:
|
||||
# /dev/dm-1
|
||||
# /dev/sdb1
|
||||
# /dev/sdf3
|
||||
devnames() {
|
||||
local dev="$1"; local d; local names
|
||||
|
||||
case "$dev" in
|
||||
UUID=*)
|
||||
dev="$(foreach_uuid_until '! blkid -U $___' "${dev#UUID=}")" \
|
||||
&& return 255
|
||||
[ -z "$dev" ] && return 255
|
||||
;;
|
||||
LABEL=*) dev="$(blkid -L "${dev#LABEL=}")" || return 255 ;;
|
||||
/dev/?*) ;;
|
||||
*) return 255 ;;
|
||||
esac
|
||||
|
||||
for d in $dev; do
|
||||
names="$names
|
||||
$(readlink -e -q "$d")" || return 255
|
||||
done
|
||||
|
||||
echo "${names#
|
||||
}"
|
||||
}
|
||||
|
||||
# match_dev devpattern dev
|
||||
#
|
||||
# Returns true if 'dev' matches 'devpattern'. Both 'devpattern' and 'dev' are
|
||||
# expanded to kernel names and then compared. If name of 'dev' is on list of
|
||||
# names of devices matching 'devpattern', the test is positive. 'dev' and
|
||||
# 'devpattern' may be anything which function 'devnames' recognizes.
|
||||
#
|
||||
# If 'devpattern' is empty or '*' then function just returns true.
|
||||
#
|
||||
# Example:
|
||||
# match_dev UUID=123 /dev/dm-1
|
||||
# Returns true if /dev/dm-1 UUID starts with "123".
|
||||
match_dev() {
|
||||
[ -z "$1" -o "$1" = '*' ] && return 0
|
||||
local devlist; local dev
|
||||
|
||||
devlist="$(devnames "$1")" || return 255
|
||||
dev="$(devnames "$2")" || return 255
|
||||
|
||||
strstr "
|
||||
$devlist
|
||||
" "
|
||||
$dev
|
||||
"
|
||||
}
|
||||
|
||||
# getkey keysfile for_dev
|
||||
#
|
||||
# Reads file <keysfile> produced by probe-keydev and looks for first line to
|
||||
# which device <for_dev> matches. The successful result is printed in format
|
||||
# "<keydev>:<keypath>". When nothing found, just false is returned.
|
||||
#
|
||||
# Example:
|
||||
# getkey /tmp/luks.keys /dev/sdb1
|
||||
# May print:
|
||||
# /dev/sdc1:/keys/some.key
|
||||
getkey() {
|
||||
local keys_file="$1"; local for_dev="$2"
|
||||
local luks_dev; local key_dev; local key_path
|
||||
|
||||
[ -z "$keys_file" -o -z "$for_dev" ] && die 'getkey: wrong usage!'
|
||||
[ -f "$keys_file" ] || return 1
|
||||
|
||||
local IFS=:
|
||||
while read luks_dev key_dev key_path; do
|
||||
if match_dev "$luks_dev" "$for_dev"; then
|
||||
echo "${key_dev}:${key_path}"
|
||||
return 0
|
||||
fi
|
||||
done < "$keys_file"
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
# readkey keypath keydev device
|
||||
#
|
||||
# Mounts <keydev>, reads key from file <keypath>, optionally processes it (e.g.
|
||||
# if encrypted with GPG) and prints to standard output which is supposed to be
|
||||
# read by cryptsetup. <device> is just passed to helper function for
|
||||
# informational purpose.
|
||||
readkey() {
|
||||
local keypath="$1"
|
||||
local keydev="$2"
|
||||
local device="$3"
|
||||
|
||||
local mntp=$(mkuniqdir /mnt keydev)
|
||||
mount -r "$keydev" "$mntp" || die 'Mounting rem. dev. failed!'
|
||||
|
||||
case "${keypath##*.}" in
|
||||
gpg)
|
||||
if [ -f /lib/dracut-crypt-gpg-lib.sh ]; then
|
||||
. /lib/dracut-crypt-gpg-lib.sh
|
||||
gpg_decrypt "$mntp" "$keypath" "$keydev" "$device"
|
||||
else
|
||||
die "No GPG support to decrypt '$keypath' on '$keydev'."
|
||||
fi
|
||||
;;
|
||||
*) cat "$mntp/$keypath" ;;
|
||||
esac
|
||||
|
||||
umount "$mntp"
|
||||
rmdir "$mntp"
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user