Compare commits
793 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
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 |
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
|
||||
*~
|
||||
|
2
.mailmap
2
.mailmap
@@ -4,3 +4,5 @@ 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>
|
||||
|
||||
|
41
AUTHORS
41
AUTHORS
@@ -1,30 +1,53 @@
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
Victor Lowther <victor.lowther@gmail.com>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
Amadeusz Żołnowski <aidecoe@aidecoe.name>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Luca Berra <bluca@comedia.it>
|
||||
Will Woods <wwoods@redhat.com>
|
||||
Andrey Borzenkov <arvidjaar@mail.ru>
|
||||
Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
David Cantrell <dcantrell@redhat.com>
|
||||
Lance Albertson <lance@osuosl.org>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
||||
Dan Horák <dan@danny.cz>
|
||||
Andrey Borzenkov <arvidjaar@mail.ru>
|
||||
Dave Jones <davej@redhat.com>
|
||||
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Mike Snitzer <msnitzer@redhat.com>
|
||||
Munehiro Matsuda <haro@kgt.co.jp>
|
||||
Joey Boggs <jboggs@redhat.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>
|
||||
Jon Ander Hernandez <jonan.h@gmail.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>
|
||||
Michal Soltys <soltys@ziu.info>
|
||||
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>
|
||||
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:
|
||||
|
87
Makefile
87
Makefile
@@ -1,4 +1,4 @@
|
||||
VERSION=004
|
||||
VERSION=012
|
||||
GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8)
|
||||
|
||||
prefix ?= /usr
|
||||
@@ -8,81 +8,84 @@ sysconfdir ?= ${prefix}/etc
|
||||
sbindir ?= ${prefix}/sbin
|
||||
mandir ?= ${prefix}/share/man
|
||||
|
||||
manpages = dracut.8 dracut.kernel.7 dracut.conf.5 dracut-catimages.8 dracut-gencmdline.8
|
||||
|
||||
.PHONY: install clean archive rpm testimage test all check AUTHORS
|
||||
.PHONY: install clean archive rpm testimage test all check AUTHORS doc
|
||||
|
||||
ifeq (1,${WITH_SWITCH_ROOT})
|
||||
targets = modules.d/99base/switch_root
|
||||
else
|
||||
targets =
|
||||
endif
|
||||
doc: $(manpages) dracut.html
|
||||
all: syncheck
|
||||
|
||||
all: $(targets)
|
||||
%: %.xml
|
||||
xsltproc -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
|
||||
|
||||
modules.d/99base/switch_root: switch_root.c
|
||||
gcc -D _GNU_SOURCE -D 'PACKAGE_STRING="dracut"' -std=gnu99 -fsigned-char -g -O2 -o modules.d/99base/switch_root switch_root.c
|
||||
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:
|
||||
install: doc
|
||||
mkdir -p $(DESTDIR)$(pkglibdir)
|
||||
mkdir -p $(DESTDIR)$(sbindir)
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)
|
||||
mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
|
||||
mkdir -p $(DESTDIR)$(mandir)/man{5,8}
|
||||
mkdir -p $(DESTDIR)$(mandir)/man{5,7,8}
|
||||
install -m 0755 dracut $(DESTDIR)$(sbindir)/dracut
|
||||
install -m 0755 dracut-gencmdline $(DESTDIR)$(sbindir)/dracut-gencmdline
|
||||
install -m 0755 dracut-catimages $(DESTDIR)$(sbindir)/dracut-catimages
|
||||
install -m 0755 mkinitrd-dracut.sh $(DESTDIR)$(sbindir)/mkinitrd
|
||||
install -m 0755 lsinitrd $(DESTDIR)$(sbindir)/lsinitrd
|
||||
ifeq (1,${WITH_SWITCH_ROOT})
|
||||
install -m 0755 modules.d/99base/switch_root $(DESTDIR)$(sbindir)/switch_root
|
||||
endif
|
||||
install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d
|
||||
install -m 0755 dracut-functions $(DESTDIR)$(pkglibdir)/dracut-functions
|
||||
install -m 0755 dracut-logger $(DESTDIR)$(pkglibdir)/dracut-logger
|
||||
cp -arx modules.d $(DESTDIR)$(pkglibdir)
|
||||
install -m 0644 dracut.8 $(DESTDIR)$(mandir)/man8
|
||||
install -m 0644 dracut-catimages.8 $(DESTDIR)$(mandir)/man8
|
||||
install -m 0644 dracut-gencmdline.8 $(DESTDIR)$(mandir)/man8
|
||||
install -m 0644 dracut.conf.5 $(DESTDIR)$(mandir)/man5
|
||||
ifeq (1,${WITH_SWITCH_ROOT})
|
||||
rm $(DESTDIR)$(pkglibdir)/modules.d/99base/switch_root
|
||||
endif
|
||||
install -m 0644 dracut.kernel.7 $(DESTDIR)$(mandir)/man7
|
||||
|
||||
clean:
|
||||
rm -f *~
|
||||
rm -f modules.d/99base/switch_root
|
||||
rm -f test-*.img
|
||||
rm -f dracut-*.rpm dracut-*.tar.bz2
|
||||
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
|
||||
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 )
|
||||
|
||||
rpm: clean dracut-$(VERSION).tar.bz2
|
||||
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" -ba dracut.spec
|
||||
rm -fr BUILD BUILDROOT
|
||||
|
||||
gitrpm: dracut-$(VERSION)-$(GITVERSION).tar.bz2
|
||||
echo "%define gittag $(GITVERSION)" > dracut.spec.git
|
||||
cat dracut.spec >> dracut.spec.git
|
||||
mv dracut.spec dracut.spec.bak
|
||||
mv dracut.spec.git dracut.spec
|
||||
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" --define "gittag $(GITVERSION)" -ba dracut.spec || :
|
||||
mv dracut.spec.bak dracut.spec
|
||||
rm -fr BUILD BUILDROOT
|
||||
|
||||
check: all
|
||||
@ret=0;for i in modules.d/99base/init modules.d/*/*.sh; do \
|
||||
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 -a debug -f test-$(shell uname -r).img $(shell uname -r)
|
||||
|
176
NEWS
176
NEWS
@@ -1,3 +1,119 @@
|
||||
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
|
||||
@@ -28,7 +144,7 @@ dracut-003
|
||||
- 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
|
||||
- mount /dev/shm
|
||||
- let udevd not resolve group and user names
|
||||
- moved network from udev to initqueue
|
||||
- improved debug output: specifying "rdinitdebug" now logs
|
||||
@@ -36,7 +152,7 @@ dracut-003
|
||||
- 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
|
||||
- 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
|
||||
@@ -81,17 +197,17 @@ dracut-001
|
||||
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
|
||||
- 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.
|
||||
@@ -118,20 +234,20 @@ dracut-0.8
|
||||
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/)
|
||||
@@ -148,44 +264,44 @@ dracut-0.7
|
||||
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
|
||||
|
||||
@@ -205,18 +321,18 @@ dracut-0.4
|
||||
- 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.
|
||||
@@ -228,12 +344,12 @@ dracut-0.4
|
||||
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
|
||||
@@ -241,12 +357,12 @@ dracut-0.4
|
||||
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
|
||||
|
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
|
||||
}
|
60
README
60
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,19 +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.d
|
||||
subdirectory, and use functionality provided by dracut-functions to do their
|
||||
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,
|
||||
@@ -44,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/dracut
|
||||
|
||||
Trac Instance:
|
||||
http://apps.sourceforge.net/trac/dracut/
|
||||
|
||||
The git tree can be found at
|
||||
git://dracut.git.sourceforge.net/gitroot/dracut/dracut for now. See the TODO
|
||||
file for things which still need to be done and HACKING for some
|
||||
instructions on how to get started. There is also a mailing list that
|
||||
is being used for the discussion -- initramfs@vger.kernel.org. It is
|
||||
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,7 +1,7 @@
|
||||
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
|
||||
|
@@ -1,6 +1,3 @@
|
||||
dracut-kernel is used to pull in all firmware files to build an initrd with
|
||||
only kernel modules and firmware files.
|
||||
|
||||
dracut --kernel-only only executes "installkernel" in the modules
|
||||
subdirectories.
|
||||
"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,45 +12,55 @@ 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 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.
|
||||
|
||||
When called with -d, it should output a list of dracut modules
|
||||
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.
|
||||
|
||||
Check may take additional options in the future.
|
||||
|
||||
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.
|
||||
|
||||
@@ -60,39 +70,39 @@ HOOKS
|
||||
|
||||
init has the following hook points to inject scripts:
|
||||
|
||||
/cmdline/*.sh
|
||||
/lib/dracut/hooks/cmdline/*.sh
|
||||
scripts for command line parsing
|
||||
|
||||
/pre-udev/*.sh
|
||||
/lib/dracut/hooks/pre-udev/*.sh
|
||||
scripts to run before udev is started
|
||||
|
||||
/pre-trigger/*.sh
|
||||
/lib/dracut/hooks/pre-trigger/*.sh
|
||||
scripts to run before the main udev trigger is pulled
|
||||
|
||||
/initqueue/*.sh
|
||||
/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 /initqueue/work is created and udev >= 143 then this loop can
|
||||
process the jobs in parallel to the udevtrigger.
|
||||
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".
|
||||
|
||||
/pre-mount/*.sh
|
||||
/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
|
||||
Network filesystems like NFS that do not use device files are an
|
||||
exception. Root can be mounted already at this point.
|
||||
|
||||
/mount/*.sh
|
||||
/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.
|
||||
|
||||
/pre-pivot/*.sh
|
||||
/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.
|
||||
|
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
|
||||
|
||||
|
53
debian/changelog
vendored
53
debian/changelog
vendored
@@ -1,53 +0,0 @@
|
||||
dracut (2.26) unstable; urgency=low
|
||||
|
||||
[ Harald Hoyer ]
|
||||
* multipath: install udev rules and helper tools
|
||||
* NEWS update
|
||||
* multipath: install xdr utils
|
||||
* multipath: install multipath kernel module
|
||||
* specfile update
|
||||
* dracut.8: fixed formatting for rootfs and mount options
|
||||
* dracut: check more return codes, check for permissions and use
|
||||
derror
|
||||
* dracut: create initramfs-$(kernelversion).img by default
|
||||
* Makefile: add WITH_SWITCH_ROOT
|
||||
* fips: search different lib paths
|
||||
* kernel-modules: add firewire-ohci to hardcoded modules list
|
||||
* 90dm: install more device mapper kernel modules
|
||||
* specfile update
|
||||
|
||||
[ Peter Jones ]
|
||||
* Use glob for libdir when installing multipath libraries.
|
||||
* Add #!/bin/bash for consistency.
|
||||
* Make sure and get all the multipath related modules.
|
||||
* Bring up multipath devices that are configured in multipath.conf.
|
||||
* Fix missing shell variables.
|
||||
* This has to be executable.
|
||||
* Handle modules with hyphens in their names properly.
|
||||
|
||||
[ Harald Hoyer ]
|
||||
* lvm: scan without monitor
|
||||
|
||||
[ Yanko Kaneti ]
|
||||
* Wildcards need dracut_install
|
||||
|
||||
[ Harald Hoyer ]
|
||||
* lvm/dmraid: make LIBDIR depend on the binary
|
||||
* nfs: install passwd entries for nobody and nfsnobody
|
||||
* nfs: add rd_NFS_DOMAIN parameter to set the NFSv4 domain name
|
||||
* dracut-functions: inst_simple(): do not bail out if target is a dir
|
||||
and exists
|
||||
* dm: install dmsetup
|
||||
* multipath: corrected initqueue parameter
|
||||
* rootfs-block/mount-root: remount root with /etc/fstab filesystem
|
||||
options
|
||||
* test: set PATH
|
||||
|
||||
-- Philippe Seewer <philippe.seewer@.bfh.ch> Fri, 27 Nov 2009 10:58:26 +0100
|
||||
|
||||
dracut (2.21) unstable; urgency=low
|
||||
[ Harald Hoyer ]
|
||||
* fix rd_DASD argument handling (bug #531720)
|
||||
* Resolves: rhbz#531720
|
||||
|
||||
-- Philippe Seewer <philippe.seewer@.bfh.ch> Fri, 06 Nov 2009 15:52:00 +0100
|
1
debian/compat
vendored
1
debian/compat
vendored
@@ -1 +0,0 @@
|
||||
5
|
40
debian/control
vendored
40
debian/control
vendored
@@ -1,40 +0,0 @@
|
||||
Source: dracut
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Maintainer: Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
Build-Depends: debhelper (>= 5.0), cdbs
|
||||
Standards-Version: 3.8.3
|
||||
Vcs-Browser: http://dracut.git.sourceforge.net/git/gitweb-index.cgi
|
||||
Vcs-Git: git://dracut.git.sourceforge.net/gitroot/dracut/dracut
|
||||
|
||||
Package: dracut
|
||||
Architecture: all
|
||||
Recommends: cryptsetup, dmsetup, dmraid, lvm2, mdadm
|
||||
Depends: cpio, module-init-tools, udev, ${misc:Depends}
|
||||
Provides: linux-initramfs-tool
|
||||
Description: A new initramfs infrastructure
|
||||
Unlike existing initramfs's, this is an attempt at having as little as
|
||||
possible hard-coded into the initramfs as possible. The initramfs has
|
||||
(basically) one purpose in life -- getting the rootfs mounted so that
|
||||
we can transition to the real rootfs. This is all driven off of
|
||||
device availability. Therefore, instead of scripts hard-coded to do
|
||||
various things, we depend on udev to create device nodes for us and
|
||||
then when we have the rootfs's device node, we mount and carry on.
|
||||
Having the root on MD, LVM2, LUKS is supported as well as NFS, iSCSI,
|
||||
NBD and FCOE with dracut-network.
|
||||
|
||||
Package: dracut-network
|
||||
Architecture: all
|
||||
Recommends: nfs-common, open-iscsi, nbd-client
|
||||
Depends: dracut, iputils-arping, dhcp3-client, ${misc:Depends}
|
||||
Description: A new initramfs infrastucture
|
||||
Unlike existing initramfs's, this is an attempt at having as little as
|
||||
possible hard-coded into the initramfs as possible. The initramfs has
|
||||
(basically) one purpose in life -- getting the rootfs mounted so that
|
||||
we can transition to the real rootfs. This is all driven off of
|
||||
device availability. Therefore, instead of scripts hard-coded to do
|
||||
various things, we depend on udev to create device nodes for us and
|
||||
then when we have the rootfs's device node, we mount and carry on.
|
||||
Having the root on MD, LVM2, LUKS is supported as well as NFS, iSCSI,
|
||||
NBD and FCOE with dracut-network.
|
||||
|
39
debian/copyright
vendored
39
debian/copyright
vendored
@@ -1,39 +0,0 @@
|
||||
This package was debianized by Philippe Seewer <philippe.seewer@bfh.ch> on
|
||||
Fri Nov 20 15:45:00 +0100
|
||||
|
||||
Sources can be downloaded from:
|
||||
|
||||
https://sourceforge.net/projects/dracut/
|
||||
|
||||
Upstream Maintainer:
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
|
||||
Updstream Authors:
|
||||
Victor Lowther <victor.lowther@gmail.com>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
Lance Albertson <lance@osuosl.org>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Quentin Armitage <quentin@armitage.org.uk>
|
||||
Sergey Fionov <fionov@gmail.com>
|
||||
Thilo Bangert <thilo.bangert@gmx.net>
|
||||
|
||||
Copyright:
|
||||
Copyright 2009 Harald Hoyer <harald@redhat.com>
|
||||
|
||||
|
||||
License: GPLv2
|
||||
|
||||
On Debian systems, the complete text of the GNU General Public
|
||||
License version 2 can be found in `/usr/share/common-licenses/GPL-2'.
|
5
debian/dracut-net.dirs
vendored
5
debian/dracut-net.dirs
vendored
@@ -1,5 +0,0 @@
|
||||
usr/share/dracut/modules.d/40network
|
||||
usr/share/dracut/modules.d/95fcoe
|
||||
usr/share/dracut/modules.d/95iscsi
|
||||
usr/share/dracut/modules.d/95nbd
|
||||
usr/share/dracut/modules.d/95nfs
|
5
debian/dracut-net.install
vendored
5
debian/dracut-net.install
vendored
@@ -1,5 +0,0 @@
|
||||
modules.d/40network usr/share/dracut/modules.d
|
||||
modules.d/95fcoe usr/share/dracut/modules.d
|
||||
modules.d/95iscsi usr/share/dracut/modules.d
|
||||
modules.d/95nbd usr/share/dracut/modules.d
|
||||
modules.d/95nfs usr/share/dracut/modules.d
|
22
debian/dracut.dirs
vendored
22
debian/dracut.dirs
vendored
@@ -1,22 +0,0 @@
|
||||
usr/share/dracut
|
||||
usr/share/dracut/modules.d/00dash
|
||||
usr/share/dracut/modules.d/01fips
|
||||
usr/share/dracut/modules.d/90crypt
|
||||
usr/share/dracut/modules.d/90dm
|
||||
usr/share/dracut/modules.d/90dmraid
|
||||
usr/share/dracut/modules.d/90kernel-modules
|
||||
usr/share/dracut/modules.d/90lvm
|
||||
usr/share/dracut/modules.d/90mdraid
|
||||
usr/share/dracut/modules.d/90multipath
|
||||
usr/share/dracut/modules.d/95dasd
|
||||
usr/share/dracut/modules.d/95dasd_mod
|
||||
usr/share/dracut/modules.d/95debug
|
||||
usr/share/dracut/modules.d/95resume
|
||||
usr/share/dracut/modules.d/95rootfs-block
|
||||
usr/share/dracut/modules.d/95terminfo
|
||||
usr/share/dracut/modules.d/95udev-rules
|
||||
usr/share/dracut/modules.d/95zfcp
|
||||
usr/share/dracut/modules.d/95znet
|
||||
usr/share/dracut/modules.d/98syslog
|
||||
usr/share/dracut/modules.d/99base
|
||||
/var/lib/dracut
|
4
debian/dracut.docs
vendored
4
debian/dracut.docs
vendored
@@ -1,4 +0,0 @@
|
||||
HACKING
|
||||
README.generic
|
||||
README.kernel
|
||||
README.modules
|
25
debian/dracut.install
vendored
25
debian/dracut.install
vendored
@@ -1,25 +0,0 @@
|
||||
dracut usr/sbin
|
||||
dracut-catimages usr/sbin
|
||||
dracut-update-initramfs usr/sbin
|
||||
dracut-functions usr/share/dracut
|
||||
dracut.conf etc
|
||||
modules.d/00dash usr/share/dracut/modules.d
|
||||
modules.d/01fips usr/share/dracut/modules.d
|
||||
modules.d/90crypt usr/share/dracut/modules.d
|
||||
modules.d/90dm usr/share/dracut/modules.d
|
||||
modules.d/90dmraid usr/share/dracut/modules.d
|
||||
modules.d/90kernel-modules usr/share/dracut/modules.d
|
||||
modules.d/90lvm usr/share/dracut/modules.d
|
||||
modules.d/90mdraid usr/share/dracut/modules.d
|
||||
modules.d/90multipath usr/share/dracut/modules.d
|
||||
modules.d/95dasd usr/share/dracut/modules.d
|
||||
modules.d/95dasd_mod usr/share/dracut/modules.d
|
||||
modules.d/95debug usr/share/dracut/modules.d
|
||||
modules.d/95resume usr/share/dracut/modules.d
|
||||
modules.d/95rootfs-block usr/share/dracut/modules.d
|
||||
modules.d/95terminfo usr/share/dracut/modules.d
|
||||
modules.d/95udev-rules usr/share/dracut/modules.d
|
||||
modules.d/95zfcp usr/share/dracut/modules.d
|
||||
modules.d/95znet usr/share/dracut/modules.d
|
||||
modules.d/98syslog usr/share/dracut/modules.d
|
||||
modules.d/99base usr/share/dracut/modules.d
|
2
debian/dracut.manpages
vendored
2
debian/dracut.manpages
vendored
@@ -1,2 +0,0 @@
|
||||
dracut.8
|
||||
dracut.conf.5
|
8
debian/dracut.postinst
vendored
8
debian/dracut.postinst
vendored
@@ -1,8 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
# Regenerate initramfs when we're `installed`
|
||||
DPKG_MAINTSCRIPT_PACKAGE='' dracut-update-initramfs -u
|
||||
|
||||
#DEBHELPER#
|
1
debian/dracut.triggers
vendored
1
debian/dracut.triggers
vendored
@@ -1 +0,0 @@
|
||||
interest update-initramfs
|
3
debian/rules
vendored
3
debian/rules
vendored
@@ -1,3 +0,0 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
include /usr/share/cdbs/1/rules/debhelper.mk
|
624
dracut
624
dracut
@@ -1,11 +1,13 @@
|
||||
#!/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 2005-2009 Red Hat, Inc. All rights reserved.
|
||||
# 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
|
||||
@@ -21,10 +23,13 @@
|
||||
# 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.
|
||||
@@ -35,255 +40,614 @@ Creates initial ramdisk images for preloading modules
|
||||
-a, --add [LIST] Add a space-separated list of dracut modules.
|
||||
-d, --drivers [LIST] Specify a space-separated list of kernel modules to
|
||||
exclusively include in the initramfs.
|
||||
--add-drivers [LIST] Specify a space-separated list of kernel
|
||||
--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
|
||||
-k, --kmoddir [DIR] Specify the directory, where to look for kernel
|
||||
modules
|
||||
--fwdir [DIR] Specify additional directories, where to look for
|
||||
--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 (default)
|
||||
--nostrip Do not strip binaries in the initramfs
|
||||
--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
|
||||
--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
|
||||
-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;;
|
||||
--add-drivers) add_drivers_l="$2"; shift;;
|
||||
--filesystems) filesystems_l="$2"; shift;;
|
||||
-k|--kmoddir) drivers_dir_l="$2"; shift;;
|
||||
--fwdir) fw_dir_l="$2"; shift;;
|
||||
--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";;
|
||||
--mdadmconf) mdadmconf_l="yes";;
|
||||
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";;
|
||||
-h|--help) usage; exit 1 ;;
|
||||
--debug) debug="yes";;
|
||||
-v|--verbose) beverbose="yes";;
|
||||
-c|--conf) conffile="$2"; shift;;
|
||||
-l|--local) allowlocal="yes" ;;
|
||||
-H|--hostonly) hostonly_l="yes" ;;
|
||||
-i|--include) include_src="$2"; include_target="$3"; shift 2;;
|
||||
-I|--install) install_items="$2"; shift;;
|
||||
-*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
|
||||
*) break ;;
|
||||
--lvmconf) lvmconf_l="yes";;
|
||||
--nolvmconf) lvmconf_l="no";;
|
||||
--debug) debug="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=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
export PATH
|
||||
|
||||
[[ $debug ]] && {
|
||||
[[ $debug ]] && {
|
||||
export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
|
||||
set -x
|
||||
}
|
||||
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
|
||||
|
||||
[[ $allowlocal && -f "$(readlink -f $(dirname $0))/dracut-functions" ]] && dracutbasedir="$(dirname $0)"
|
||||
[[ $allowlocal && -f "$(readlink -f ${0%/*})/dracut-functions" ]] && \
|
||||
dracutbasedir="$(readlink -f ${0%/*})"
|
||||
|
||||
# if we were not passed a config file, try the default one
|
||||
if [[ ! -f $conffile ]]; then
|
||||
[[ $allowlocal ]] || conffile="/etc/dracut.conf"
|
||||
[[ $allowlocal ]] && conffile="$dracutbasedir/dracut.conf"
|
||||
[[ $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"
|
||||
|
||||
# source our config dir
|
||||
if [[ $confdir && -d $confdir ]]; then
|
||||
for f in "$confdir"/*.conf; do
|
||||
[[ -e $f ]] && . "$f"
|
||||
done
|
||||
fi
|
||||
|
||||
# these optins add to the stuff in the config file
|
||||
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
|
||||
[[ $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
|
||||
[[ $add_drivers_l ]] && add_drivers=$add_drivers_l
|
||||
[[ $filesystems_l ]] && filesystems=$filesystems_l
|
||||
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
|
||||
[[ $fw_dir_l ]] && fw_dir=$fw_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
|
||||
[[ $do_strip ]] || do_strip=yes
|
||||
[[ $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
|
||||
. $dracutbasedir/dracut-functions
|
||||
else
|
||||
echo "Cannot find $dracutbasedir/dracut-functions. Are you running from a git checkout?"
|
||||
echo "Try passing -l as an argument to $0"
|
||||
exit 1
|
||||
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/initramfs-$kernel.img"
|
||||
abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile"
|
||||
|
||||
srcmods="/lib/modules/$kernel/"
|
||||
[[ $drivers_dir ]] && srcmods="$drivers_dir"
|
||||
[[ $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
|
||||
|
||||
if ! [[ -w $(dirname $outfile) ]]; then
|
||||
echo "No permission to write $outfile."
|
||||
outdir=${outfile%/*}
|
||||
[[ $outdir ]] || outdir="/"
|
||||
|
||||
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
|
||||
|
||||
hookdirs="cmdline pre-udev pre-trigger netroot pre-mount pre-pivot mount emergency"
|
||||
readonly TMPDIR=/var/tmp
|
||||
readonly initdir=$(mktemp --tmpdir=/var/tmp/ -d -t initramfs.XXXXXX)
|
||||
|
||||
[[ -n "$TMPDIR" ]] && ! [[ -w "$TMPDIR" ]] && unset TMPDIR
|
||||
readonly initdir=$(mktemp -d -t initramfs.XXXXXX)
|
||||
|
||||
trap 'ret=$?;rm -rf "$initdir";exit $ret;' EXIT # clean up after ourselves no matter how we die.
|
||||
trap 'exit 1;' SIGINT # clean up after ourselves no matter how we die.
|
||||
# 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 dracutbasedir dracutmodules drivers \
|
||||
fw_dir drivers_dir debug beverbose no_kernel kernel_only \
|
||||
add_drivers mdadmconf lvmconf filesystems
|
||||
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
|
||||
[[ $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
|
||||
# Create some directory structure first
|
||||
for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot tmp dev/pts var/run; do
|
||||
inst_dir "/$d";
|
||||
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
|
||||
|
||||
check_module_dir
|
||||
modules_loaded=" "
|
||||
# source our modules.
|
||||
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||
mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
|
||||
if strstr "$mods_to_load" " $mod "; then
|
||||
if [[ $kernel_only = yes ]]; then
|
||||
[[ -x $moddir/installkernel ]] && . "$moddir/installkernel"
|
||||
else
|
||||
. "$moddir/install"
|
||||
if [[ $no_kernel != yes && -x $moddir/installkernel ]]; then
|
||||
. "$moddir/installkernel"
|
||||
fi
|
||||
fi
|
||||
mods_to_load=${mods_to_load// $mod /}
|
||||
_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
|
||||
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
|
||||
derror "\"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)
|
||||
|
||||
# strip binaries
|
||||
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 ]] && dracut_install "$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
|
||||
|
||||
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 objdump sed grep find; do
|
||||
if ! which $p >/dev/null 2>&1; then
|
||||
derror "Could not find '$p'. You should run $0 with '--nostrip'."
|
||||
do_strip=no
|
||||
fi
|
||||
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' \) -exec file {} \; |
|
||||
grep -v ' shared object,' |
|
||||
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'); do
|
||||
dinfo "Stripping $f"
|
||||
strip -g "$f" || :
|
||||
#
|
||||
# FIXME: only strip -g for now
|
||||
#
|
||||
#strip -g --strip-unneeded "$f" || :
|
||||
#note="-R .note"
|
||||
#if objdump -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \
|
||||
# grep -q ALLOC; then
|
||||
# note=
|
||||
#fi
|
||||
#strip -R .comment $note "$f" || :
|
||||
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
|
||||
|
||||
( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet |gzip -9 > "$outfile"; )
|
||||
if [ $? -ne 0 ]; then
|
||||
derror "dracut: creation of $outfile failed"
|
||||
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
|
||||
fi
|
||||
|
||||
[[ $beverbose = yes ]] && ls -lh "$outfile"
|
||||
dinfo "Wrote $outfile:"
|
||||
dinfo "$(ls -l "$outfile")"
|
||||
|
||||
exit 0
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
#!/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
|
||||
@@ -31,12 +33,13 @@ derror() {
|
||||
|
||||
usage() {
|
||||
# 80x25 linebreak here ^
|
||||
echo "Usage: $0 [OPTION]... <initramfs> <base image> [<image>...]
|
||||
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
|
||||
-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
|
||||
@@ -45,7 +48,7 @@ line and /boot/dracut/
|
||||
-h, --help This message
|
||||
--debug Output debug information of the build process
|
||||
-v, --verbose Verbose output during the build process
|
||||
"
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
@@ -54,16 +57,16 @@ 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 ;;
|
||||
-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
|
||||
@@ -102,12 +105,13 @@ fi
|
||||
if [[ ! $no_overlay ]]; then
|
||||
ofile="$imagedir/90-overlay.img"
|
||||
dinfo "Creating image $ofile from directory $overlay"
|
||||
( cd "$overlay"; find . |cpio --quiet -H newc -o |gzip -9 > "$ofile"; )
|
||||
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")
|
||||
[[ -f $i ]] && images+=("$i")
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -116,7 +120,7 @@ images+=($@)
|
||||
dinfo "Using base image $baseimage"
|
||||
cat "$baseimage" > "$outfile"
|
||||
|
||||
for i in "${images[@]}"; do
|
||||
for i in "${images[@]}"; do
|
||||
dinfo "Appending $i"
|
||||
cat "$i" >> "$outfile"
|
||||
done
|
||||
|
@@ -1,52 +0,0 @@
|
||||
.TH DRACUT-CATIMAGES 8 "June 2009" "Linux"
|
||||
.SH NAME
|
||||
dracut-catimages \- creates initial ramdisk image by concatenating images
|
||||
.SH SYNOPSIS
|
||||
\fBdracut-catimages\fR [\fIOPTION\fR]... \fI<initramfs base image>\fR \fI[<image>...]\fR
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B dracut-catimages
|
||||
creates an initial ramdisk image by concatenating several images from the command
|
||||
line and /boot/dracut/*.img
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BR \-f ", " \-\-force
|
||||
overwrite existing initramfs file.
|
||||
.TP
|
||||
.BR \-i ", " \-\-imagedir
|
||||
Directory with additional images to add (default: /boot/dracut/)
|
||||
.TP
|
||||
.BR \-o ", " \-\-overlaydir
|
||||
Overlay directory, which contains additional files that will be used to create an additional image
|
||||
.TP
|
||||
.BR \-\-nooverlay
|
||||
Do not use the overlay directory
|
||||
.TP
|
||||
.BR \-\-noimagedir
|
||||
Do not use the additional image directory
|
||||
.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
|
||||
|
||||
.SH FILES
|
||||
.TP
|
||||
.B /boot/dracut/*.img
|
||||
.TP
|
||||
.B
|
||||
.SH AUTHORS
|
||||
.nf
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
The dracut-catimages command is part of the dracut package and is available from
|
||||
http://sourceforge.net/apps/trac/dracut/wiki
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR dracut (8)
|
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>
|
||||
|
979
dracut-functions
979
dracut-functions
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,6 @@
|
||||
#!/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.
|
||||
#
|
||||
@@ -43,13 +45,13 @@ function get_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
|
||||
(
|
||||
fmt="%d:%d"
|
||||
if [ "$1" == "hex" ]; then
|
||||
fmt="%x:%x"
|
||||
fi
|
||||
ls -lH "$2" | awk '{ sub(/,/, "", $5); printf("'"$fmt"'", $5, $6); }'
|
||||
) 2>/dev/null
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +72,7 @@ moduledep() {
|
||||
fi
|
||||
vecho -n "Looking for deps of module $1"
|
||||
deps=""
|
||||
deps=$(modprobe $MPARGS --set-version $kernel --show-depends $1 2>/dev/null| awk '/^insmod / { print gensub(".*/","","g",$2) }' | while read foo ; do [ "${foo%%.ko}" != "$1" ] && echo -n "${foo%%.ko} " ; done)
|
||||
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
|
||||
}
|
||||
|
||||
@@ -166,14 +168,14 @@ resolve_device_name() {
|
||||
real=$(freadlink /dev/disk/by-label/${1##LABEL=})
|
||||
[ -b $real ] && { echo $real; return; }
|
||||
fi
|
||||
echo "$1"
|
||||
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)
|
||||
echo "$majmin" | cmp -s $device && echo $device ; done)
|
||||
if [ -n "$dev" ]; then
|
||||
dev=${dev%%/dev}
|
||||
dev=${dev%%/}
|
||||
@@ -306,20 +308,20 @@ iscsi_set_parameters() {
|
||||
chap=${result}
|
||||
if [ -n "${chap}" -a "${chap}" != "<empty>" ]; then
|
||||
chap="-u ${chap}"
|
||||
iscsi_get_rec_val $tmpfile "node.session.auth.password"
|
||||
iscsi_get_rec_val $tmpfile "node.session.auth.password"
|
||||
chap_pw="-w ${result}"
|
||||
else
|
||||
chap=""
|
||||
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"
|
||||
iscsi_get_rec_val $tmpfile "node.session.auth.password_in"
|
||||
chap_in_pw="-W ${result}"
|
||||
else
|
||||
chap_in=""
|
||||
chap_in=""
|
||||
fi
|
||||
|
||||
rm $tmpfile
|
||||
@@ -341,7 +343,7 @@ 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
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
@@ -395,29 +397,29 @@ handledm() {
|
||||
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
|
||||
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
|
||||
break
|
||||
fi
|
||||
done
|
||||
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() {
|
||||
@@ -440,25 +442,25 @@ handleraid() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
levels=$(awk "/^$1[ ]*:/ { print\$4 }" /proc/mdstat)
|
||||
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"
|
||||
;;
|
||||
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
|
||||
@@ -474,7 +476,7 @@ lvshow() {
|
||||
|
||||
vgdisplay() {
|
||||
lvm vgdisplay --ignorelockingfailure -v $1 2>/dev/null |
|
||||
sed -n 's/PV Name//p'
|
||||
sed -n 's/PV Name//p'
|
||||
}
|
||||
|
||||
dmmods_found="n"
|
||||
@@ -508,78 +510,78 @@ while [ $# -gt 0 ]; do
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--rootdev*)
|
||||
--rootdev*)
|
||||
if [ "$1" != "${1##--rootdev=}" ]; then
|
||||
rootdev="${1##--rootdev=}"
|
||||
else
|
||||
rootdev="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--thawdev*)
|
||||
;;
|
||||
--thawdev*)
|
||||
if [ "$1" != "${1##--thawdev=}" ]; then
|
||||
thawdev="${1##--thawdev=}"
|
||||
else
|
||||
thawdev="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--rootfs*)
|
||||
;;
|
||||
--rootfs*)
|
||||
if [ "$1" != "${1##--rootfs=}" ]; then
|
||||
rootfs="${1##--rootfs=}"
|
||||
else
|
||||
rootfs="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--rootopts*)
|
||||
;;
|
||||
--rootopts*)
|
||||
if [ "$1" != "${1##--rootopts=}" ]; then
|
||||
rootopts="${1##--rootopts=}"
|
||||
else
|
||||
rootopts="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--root*)
|
||||
;;
|
||||
--root*)
|
||||
if [ "$1" != "${1##--root=}" ]; then
|
||||
root="${1##--root=}"
|
||||
else
|
||||
root="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--loopdev*)
|
||||
;;
|
||||
--loopdev*)
|
||||
if [ "$1" != "${1##--loopdev=}" ]; then
|
||||
loopdev="${1##--loopdev=}"
|
||||
else
|
||||
loopdev="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--loopfs*)
|
||||
;;
|
||||
--loopfs*)
|
||||
if [ "$1" != "${1##--loopfs=}" ]; then
|
||||
loopfs="${1##--loopfs=}"
|
||||
else
|
||||
loopfs="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--loopopts*)
|
||||
;;
|
||||
--loopopts*)
|
||||
if [ "$1" != "${1##--loopopts=}" ]; then
|
||||
loopopts="${1##--loopopts=}"
|
||||
else
|
||||
loopopts="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--looppath*)
|
||||
;;
|
||||
--looppath*)
|
||||
if [ "$1" != "${1##--looppath=}" ]; then
|
||||
looppath="${1##--looppath=}"
|
||||
else
|
||||
looppath="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
;;
|
||||
--help)
|
||||
usage -n
|
||||
;;
|
||||
@@ -597,38 +599,38 @@ while [ $# -gt 0 ]; do
|
||||
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 "$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)
|
||||
[ -z "$rootdev" ] && rootdev=$(awk '/^[ \t]*[^#]/ { if ($2 == "/") { print $1; }}' $fstab)
|
||||
# check if it's nfsroot
|
||||
physdev=""
|
||||
if [ "$rootfs" == "nfs" ]; then
|
||||
if [ "x$net_list" == "x" ]; then
|
||||
handlenfs $rootdev
|
||||
fi
|
||||
else
|
||||
# check if it's root by label
|
||||
rdev=$rootdev
|
||||
rdev=$(resolve_device_name "$rdev")
|
||||
rootopts=$(echo $rootopts | sed -e 's/^r[ow],//' -e 's/,_netdev//' -e 's/_netdev//' -e 's/,r[ow],$//' -e 's/,r[ow],/,/' -e 's/^r[ow]$/defaults/' -e 's/$/,ro/')
|
||||
findstoragedriver "$rdev"
|
||||
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
|
||||
[ -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
|
||||
cat
|
||||
}
|
||||
|
||||
emit()
|
||||
@@ -638,7 +640,7 @@ emit()
|
||||
NONL="-n"
|
||||
shift
|
||||
fi
|
||||
echo $NONL "$@"
|
||||
echo $NONL "$@"
|
||||
}
|
||||
|
||||
emitdmraids()
|
||||
@@ -676,9 +678,9 @@ 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 "
|
||||
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 "
|
||||
@@ -712,4 +714,3 @@ if [ -n "$rootdev" ]; then
|
||||
fi
|
||||
|
||||
echo
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
|
@@ -1,20 +0,0 @@
|
||||
.TH DRACUT-GENCMDLINE 8 "June 2009" "Linux"
|
||||
.SH NAME
|
||||
dracut-gencmdline \- generates kernel command line parameters for the dracut generated initramfs
|
||||
.SH SYNOPSIS
|
||||
.BR dracut-gencmdline
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B dracut-gencmdline
|
||||
generates kernel command line parameters for the dracut generated initramfs, which are very specific to the host system.
|
||||
|
||||
.SH AUTHORS
|
||||
.nf
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
The dracut-gencmdline command is part of the dracut package and is available from
|
||||
http://sourceforge.net/apps/trac/dracut/wiki
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR dracut (8)
|
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 "$@"
|
||||
}
|
@@ -1,558 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
STATEDIR=/var/lib/dracut
|
||||
BOOTDIR=/boot
|
||||
CONF=/etc/dracut.conf
|
||||
KPKGCONF=/etc/kernel-img.conf
|
||||
USETRIGGERS=true
|
||||
mode=""
|
||||
version=""
|
||||
|
||||
set -e
|
||||
|
||||
if $USETRIGGERS \
|
||||
&& [ x"$DPKG_MAINTSCRIPT_PACKAGE" != x ] \
|
||||
&& [ $# = 1 ] \
|
||||
&& [ x"$1" = x-u ] \
|
||||
&& dpkg-trigger --check-supported 2>/dev/null
|
||||
then
|
||||
if dpkg-trigger --no-await update-initramfs; then
|
||||
echo "dracut-update-initramfs: deferring update (trigger activated)"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
usage()
|
||||
{
|
||||
if [ -n "${1}" ]; then
|
||||
printf "${@}\n\n" >&2
|
||||
fi
|
||||
cat >&2 << EOF
|
||||
Usage: ${0} [OPTION]...
|
||||
|
||||
Options:
|
||||
-k [version] Specify kernel version or 'all'
|
||||
-c Create a new initramfs
|
||||
-u Update an existing initramfs
|
||||
-d Remove an existing initramfs
|
||||
-t Take over a custom initramfs with this one
|
||||
-b Set alternate boot directory
|
||||
-v Be verbose
|
||||
-h This message
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# chroot check
|
||||
chrooted()
|
||||
{
|
||||
# borrowed from udev's postinst
|
||||
if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ]; then
|
||||
# the devicenumber/inode pair of / is the same as that of
|
||||
# /sbin/init's root, so we're *not* in a chroot and hence
|
||||
# return false.
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
mild_panic()
|
||||
{
|
||||
if [ -n "${1}" ]; then
|
||||
printf "${@}\n" >&2
|
||||
fi
|
||||
exit 0
|
||||
}
|
||||
|
||||
panic()
|
||||
{
|
||||
if [ -n "${1}" ]; then
|
||||
printf "${@}\n" >&2
|
||||
fi
|
||||
exit 1
|
||||
}
|
||||
|
||||
verbose()
|
||||
{
|
||||
if [ "${verbose}" = 1 ]; then
|
||||
printf "${@}\n"
|
||||
fi
|
||||
}
|
||||
|
||||
version_exists()
|
||||
{
|
||||
[ -e "${STATEDIR}/${1}" ] && [ -e "${initramfs}" ]
|
||||
return $?
|
||||
}
|
||||
|
||||
set_initramfs()
|
||||
{
|
||||
initramfs="${BOOTDIR}/dracut.img-${version}"
|
||||
}
|
||||
|
||||
|
||||
# backup initramfs while running
|
||||
backup_initramfs()
|
||||
{
|
||||
[ ! -r "${initramfs}" ] && return 0
|
||||
initramfs_bak="${initramfs}.dpkg-bak"
|
||||
[ -r "${initramfs_bak}" ] && rm -f "${initramfs_bak}"
|
||||
ln -f "${initramfs}" "${initramfs_bak}" \
|
||||
|| cp -a "${initramfs}" "${initramfs_bak}"
|
||||
verbose "Keeping ${initramfs_bak}"
|
||||
}
|
||||
|
||||
# keep booted initramfs
|
||||
backup_booted_initramfs()
|
||||
{
|
||||
initramfs_bak="${initramfs}.dpkg-bak"
|
||||
|
||||
# first time run thus no backup
|
||||
[ ! -r "${initramfs_bak}" ] && return 0
|
||||
|
||||
# chroot with no /proc
|
||||
[ ! -r /proc/uptime ] && rm -f "${initramfs_bak}" && return 0
|
||||
|
||||
# no kept backup wanted
|
||||
[ "${backup_initramfs}" = "no" ] && rm -f "${initramfs_bak}" && return 0
|
||||
|
||||
# no backup yet
|
||||
if [ ! -r "${initramfs}.bak" ]; then
|
||||
mv -f ${initramfs_bak} "${initramfs}.bak"
|
||||
verbose "Backup ${initramfs}.bak"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# keep booted initramfs
|
||||
uptime_days=$(awk '{printf "%d", $1 / 3600 / 24}' /proc/uptime)
|
||||
if [ -n "$uptime_days" ]; then
|
||||
boot_initramfs=$(find "${initramfs}.bak" -mtime +${uptime_days})
|
||||
fi
|
||||
if [ -n "${boot_initramfs}" ]; then
|
||||
mv -f "${initramfs_bak}" "${initramfs}.bak"
|
||||
verbose "Backup ${initramfs}.bak"
|
||||
return 0
|
||||
fi
|
||||
verbose "Removing current backup ${initramfs_bak}"
|
||||
rm -f ${initramfs_bak}
|
||||
}
|
||||
|
||||
# nuke generated copy
|
||||
remove_initramfs()
|
||||
{
|
||||
[ -z "${initramfs_bak}" ] && return 0
|
||||
rm -f "${initramfs_bak}"
|
||||
verbose "Removing ${initramfs_bak}"
|
||||
}
|
||||
|
||||
|
||||
generate_initramfs()
|
||||
{
|
||||
echo "dracut-update-initramfs: Generating ${initramfs}"
|
||||
OPTS=""
|
||||
if [ "${verbose}" = 1 ]; then
|
||||
OPTS="-v ${OPTS}"
|
||||
fi
|
||||
##WORK HERE!
|
||||
if dracut ${OPTS} "${initramfs}.new" "${version}"; then
|
||||
mv -f "${initramfs}.new" "${initramfs}"
|
||||
set_sha1
|
||||
else
|
||||
mkinitramfs_return="$?"
|
||||
remove_initramfs
|
||||
rm -f "${initramfs}.new"
|
||||
if [ "$mkinitramfs_return" = "2" ]; then
|
||||
# minversion wasn't met, exit 0
|
||||
exit 0
|
||||
fi
|
||||
echo "update-initramfs: failed for ${initramfs}"
|
||||
exit $mkinitramfs_return
|
||||
fi
|
||||
}
|
||||
|
||||
# lilo call
|
||||
run_lilo()
|
||||
{
|
||||
# show lilo errors on failure
|
||||
if ! lilo -t > /dev/null 2>&1 ; then
|
||||
echo "ERROR lilo fails for new ${initramfs}:"
|
||||
echo
|
||||
lilo -t
|
||||
fi
|
||||
lilo
|
||||
}
|
||||
|
||||
# check if lilo is on mbr
|
||||
mbr_check()
|
||||
{
|
||||
# try to discover grub|grub2 and be happy
|
||||
[ -r /boot/grub/grub.cfg ] \
|
||||
&& groot=$(awk '/^set root=/{print substr($2, 7, 3); exit}' \
|
||||
/boot/grub/grub.cfg)
|
||||
[ -r /boot/grub/menu.lst ] \
|
||||
&& groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \
|
||||
/boot/grub/menu.lst)
|
||||
[ -e /boot/grub/device.map ] && [ -n "${groot}" ] \
|
||||
&& dev=$(awk "/${groot}/{ print \$NF}" /boot/grub/device.map)
|
||||
[ -n "${dev}" ] && [ -r ${dev} ] \
|
||||
&& dd if="${dev}" bs=512 skip=0 count=1 2> /dev/null \
|
||||
| grep -q GRUB && return 0
|
||||
|
||||
# check out lilo.conf for validity
|
||||
boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf)
|
||||
[ -z "${boot}" ] && return 0
|
||||
case ${boot} in
|
||||
/dev/md/*)
|
||||
if [ -r /proc/mdstat ]; then
|
||||
MD=${boot#/dev/md/}
|
||||
boot="/dev/$(awk "/^md${MD}/{print substr(\$5, 1, 3)}" \
|
||||
/proc/mdstat)"
|
||||
fi
|
||||
;;
|
||||
/dev/md*)
|
||||
if [ -r /proc/mdstat ]; then
|
||||
MD=${boot#/dev/}
|
||||
boot="/dev/$(awk "/^${MD}/{print substr(\$5, 1, 3)}" \
|
||||
/proc/mdstat)"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
[ ! -r "${boot}" ] && return 0
|
||||
dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO \
|
||||
&& run_lilo && return 0
|
||||
|
||||
# no idea which bootloader is used
|
||||
echo
|
||||
echo "WARNING: grub and lilo installed."
|
||||
echo "If you use grub as bootloader everything is fine."
|
||||
echo "If you use lilo as bootloader you must run lilo!"
|
||||
echo
|
||||
}
|
||||
|
||||
# Invoke bootloader
|
||||
run_bootloader()
|
||||
{
|
||||
# if both lilo and grub around, figure out if lilo needs to be run
|
||||
if ( command -v update-grub >/dev/null 2>&1 \
|
||||
|| [ -e /boot/grub/menu.lst ] || [ -e /boot/grub/grub.cfg ] ) \
|
||||
&& ( [ -e /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1 ); then
|
||||
[ -r "${KPKGCONF}" ] && \
|
||||
do_b=$(awk '/^do_bootloader/{print $3}' "${KPKGCONF}")
|
||||
if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \
|
||||
|| [ "${do_b}" = "YES" ]; then
|
||||
run_lilo
|
||||
return 0
|
||||
elif [ "${do_b}" = "no" ] || [ "${do_b}" = "No" ] \
|
||||
|| [ "${do_b}" = "NO" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# do_bootloader unconfigured
|
||||
mbr_check
|
||||
return 0
|
||||
fi
|
||||
if [ -r /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1; then
|
||||
run_lilo
|
||||
return 0
|
||||
fi
|
||||
if command -v elilo >/dev/null 2>&1; then
|
||||
elilo
|
||||
return 0
|
||||
fi
|
||||
if [ -r /etc/zipl.conf ]; then
|
||||
zipl
|
||||
fi
|
||||
if flash-kernel --supported >/dev/null 2>&1; then
|
||||
flash-kernel ${version}
|
||||
fi
|
||||
}
|
||||
|
||||
compare_sha1()
|
||||
{
|
||||
sha1sum "${initramfs}" | diff "${STATEDIR}/${version}" - >/dev/null 2>&1
|
||||
return $?
|
||||
}
|
||||
|
||||
# Note that this must overwrite so that updates work.
|
||||
set_sha1()
|
||||
{
|
||||
sha1sum "${initramfs}" > "${STATEDIR}/${version}"
|
||||
}
|
||||
|
||||
delete_sha1()
|
||||
{
|
||||
rm -f "${STATEDIR}/${version}"
|
||||
}
|
||||
|
||||
# ro /boot is not modified
|
||||
ro_boot_check()
|
||||
{
|
||||
# check irrelevant inside of a chroot
|
||||
if [ ! -r /proc/mounts ] || chrooted; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
boot_opts=$(awk '/boot/{if ((match($4, /^ro/) || match($4, /,ro/)) \
|
||||
&& $2 == "/boot") print "ro"}' /proc/mounts)
|
||||
if [ -n "${boot_opts}" ]; then
|
||||
echo "WARNING: /boot is ro mounted."
|
||||
echo "update-initramfs: Not updating ${initramfs}"
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
get_sorted_versions()
|
||||
{
|
||||
version_list=""
|
||||
|
||||
for gsv_x in "${STATEDIR}"/*; do
|
||||
gsv_x="$(basename "${gsv_x}")"
|
||||
if [ "${gsv_x}" = '*' ]; then
|
||||
return 0
|
||||
fi
|
||||
worklist=""
|
||||
for gsv_i in $version_list; do
|
||||
if dpkg --compare-versions "${gsv_x}" '>' "${gsv_i}"; then
|
||||
worklist="${worklist} ${gsv_x} ${gsv_i}"
|
||||
gsv_x=""
|
||||
else
|
||||
worklist="${worklist} ${gsv_i}"
|
||||
fi
|
||||
done
|
||||
if [ "${gsv_x}" != "" ]; then
|
||||
worklist="${worklist} ${gsv_x}"
|
||||
fi
|
||||
version_list="${worklist}"
|
||||
done
|
||||
|
||||
verbose "Available versions: ${version_list}"
|
||||
}
|
||||
|
||||
set_current_version()
|
||||
{
|
||||
if [ -f /boot/dracut.img-`uname -r` ]; then
|
||||
version=`uname -r`
|
||||
fi
|
||||
}
|
||||
|
||||
set_linked_version()
|
||||
{
|
||||
if [ -e /initrd.img ] && [ -L /initrd.img ]; then
|
||||
linktarget="$(basename "$(readlink /initrd.img)")"
|
||||
fi
|
||||
|
||||
if [ -e /boot/initrd.img ] && [ -L /boot/initrd.img ]; then
|
||||
linktarget="$(basename "$(readlink /boot/initrd.img)")"
|
||||
fi
|
||||
|
||||
if [ -z "${linktarget}" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
version="${linktarget##*img-}"
|
||||
}
|
||||
|
||||
set_highest_version()
|
||||
{
|
||||
get_sorted_versions
|
||||
set -- ${version_list}
|
||||
version=${1}
|
||||
}
|
||||
|
||||
create()
|
||||
{
|
||||
if [ -z "${version}" ]; then
|
||||
usage "Create mode requires a version argument"
|
||||
fi
|
||||
|
||||
set_initramfs
|
||||
|
||||
if [ "${takeover}" = 0 ]; then
|
||||
if version_exists "${version}"; then
|
||||
panic "Cannot create version ${version}: already exists"
|
||||
fi
|
||||
|
||||
if [ -e "${initramfs}" ]; then
|
||||
panic "${initramfs} already exists, cannot create."
|
||||
fi
|
||||
fi
|
||||
|
||||
generate_initramfs
|
||||
}
|
||||
|
||||
update()
|
||||
{
|
||||
if [ "${update_initramfs}" = "no" ]; then
|
||||
echo "update-initramfs: Not updating initramfs."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "${version}" ]; then
|
||||
set_highest_version
|
||||
fi
|
||||
|
||||
if [ -z "${version}" ]; then
|
||||
set_linked_version
|
||||
fi
|
||||
|
||||
if [ -z "${version}" ]; then
|
||||
set_current_version
|
||||
fi
|
||||
|
||||
if [ -z "${version}" ]; then
|
||||
verbose "Nothing to do, exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
set_initramfs
|
||||
|
||||
ro_boot_check
|
||||
|
||||
altered_check
|
||||
|
||||
backup_initramfs
|
||||
|
||||
generate_initramfs
|
||||
|
||||
run_bootloader
|
||||
|
||||
backup_booted_initramfs
|
||||
}
|
||||
|
||||
delete()
|
||||
{
|
||||
if [ -z "${version}" ]; then
|
||||
usage "Delete mode requires a version argument"
|
||||
fi
|
||||
|
||||
set_initramfs
|
||||
|
||||
if [ ! -e "${initramfs}" ]; then
|
||||
panic "Cannot delete ${initramfs}, doesn't exist."
|
||||
fi
|
||||
|
||||
if ! version_exists "${version}"; then
|
||||
panic "Cannot delete version ${version}: Not created by this utility."
|
||||
fi
|
||||
|
||||
altered_check
|
||||
|
||||
echo "update-initramfs: Deleting ${initramfs}"
|
||||
|
||||
delete_sha1
|
||||
|
||||
rm -f "${initramfs}"
|
||||
}
|
||||
|
||||
# Check for update mode on existing and modified initramfs
|
||||
altered_check()
|
||||
{
|
||||
# No check on takeover
|
||||
[ "${takeover}" = 1 ] && return 0
|
||||
if [ ! -e "${initramfs}" ]; then
|
||||
mild_panic "${initramfs} does not exist. Cannot update."
|
||||
fi
|
||||
if ! compare_sha1; then
|
||||
echo "update-initramfs: ${initramfs} has been altered." >&2
|
||||
mild_panic "update-initramfs: Cannot update. Override with -t option."
|
||||
fi
|
||||
}
|
||||
|
||||
# Defaults
|
||||
verbose=0
|
||||
yes=0
|
||||
# We default to takeover=1 in Ubuntu, but not Debian
|
||||
takeover=0
|
||||
|
||||
##
|
||||
|
||||
while getopts "k:cudyvtb:h?" flag; do
|
||||
case "${flag}" in
|
||||
k)
|
||||
version="${OPTARG}"
|
||||
;;
|
||||
c)
|
||||
mode="c"
|
||||
;;
|
||||
d)
|
||||
mode="d"
|
||||
;;
|
||||
u)
|
||||
mode="u"
|
||||
;;
|
||||
v)
|
||||
verbose="1"
|
||||
;;
|
||||
y)
|
||||
yes="1"
|
||||
;;
|
||||
t)
|
||||
takeover="1"
|
||||
;;
|
||||
b)
|
||||
BOOTDIR="${OPTARG}"
|
||||
if [ ! -d "${BOOTDIR}" ]; then
|
||||
echo "Error: ${BOOTDIR} is not a directory."
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
h|?)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $((${OPTIND} - 1))
|
||||
|
||||
if [ $# -ne 0 ]; then
|
||||
echo "Invalid argument for option -k."
|
||||
usage
|
||||
fi
|
||||
|
||||
# Validate arguments
|
||||
if [ -z "${mode}" ]; then
|
||||
usage "You must specify at least one of -c, -u, or -d."
|
||||
fi
|
||||
|
||||
if [ "${version}" = "all" ] \
|
||||
|| ( [ "${update_initramfs}" = "all" ] && [ -z "${version}" ] ); then
|
||||
: FIXME check for --yes, and if not ask are you sure
|
||||
get_sorted_versions
|
||||
if [ -z "${version_list}" ]; then
|
||||
verbose "Nothing to do, exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
OPTS="-b ${BOOTDIR}"
|
||||
if [ "${verbose}" = "1" ]; then
|
||||
OPTS="${OPTS} -v"
|
||||
fi
|
||||
if [ "${takeover}" = "1" ]; then
|
||||
OPTS="${OPTS} -t"
|
||||
fi
|
||||
if [ "${yes}" = "1" ]; then
|
||||
OPTS="${OPTS} -y"
|
||||
fi
|
||||
for u_version in ${version_list}; do
|
||||
# Don't stop if one version doesn't work.
|
||||
set +e
|
||||
verbose "Execute: ${0} -${mode} -k \"${u_version}\" ${OPTS}"
|
||||
"${0}" -${mode} -k "${u_version}" ${OPTS}
|
||||
set -e
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
case "${mode}" in
|
||||
c)
|
||||
create
|
||||
;;
|
||||
d)
|
||||
delete
|
||||
;;
|
||||
u)
|
||||
update
|
||||
;;
|
||||
esac
|
398
dracut.8
398
dracut.8
@@ -1,398 +0,0 @@
|
||||
.TH DRACUT 8 "June 2009" "Linux"
|
||||
.SH NAME
|
||||
dracut \- create initial ramdisk images for preloading modules
|
||||
.SH SYNOPSIS
|
||||
\fBdracut\fR [\fIOPTION\fR]... \fI<image>\fR \fI<kernel-version>\fR
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B dracut
|
||||
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 exclusively include in the initramfs.
|
||||
.BR \-\-add-drivers " \fILIST\fR"
|
||||
specify a space-separated list of kernel modules to add to the initramfs.
|
||||
.TP
|
||||
.BR \-\-filesystems " \fILIST\fR"
|
||||
specify a space-separated list of kernel filesystem modules to exclusively include in the generic initramfs.
|
||||
.TP
|
||||
.BR \-k ", " \-\-kmoddir " \fI{DIR}\fR
|
||||
specify the directory, where to look for kernel modules
|
||||
.TP
|
||||
.BR " \-\-fwdir " \fI{DIR}\fR
|
||||
specify additional directory, where to look for firmwares
|
||||
.TP
|
||||
.BR \-\-kernel-only
|
||||
only install kernel drivers and firmware files
|
||||
.TP
|
||||
.BR \-\-no-kernel
|
||||
do not install kernel drivers and firmware files
|
||||
.TP
|
||||
.BR \-\-mdadmconf
|
||||
include local /etc/mdadm.conf
|
||||
.TP
|
||||
.BR \-\-nomdadmconf
|
||||
do not include local /etc/mdadm.conf
|
||||
.TP
|
||||
.BR \-\-strip
|
||||
strip binaries in the initramfs (default)
|
||||
.TP
|
||||
.BR \-\-nostrip
|
||||
do not strip binaries 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 blockdevice to use as root filesystem.
|
||||
e.g. \fI/dev/sda1\fR
|
||||
e.g. \fI/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1\fR
|
||||
.TP
|
||||
.B rootfstype=<filesystem type>
|
||||
"auto" if not specified, e.g. \fIrootfstype=ext3\fR
|
||||
.TP
|
||||
.B rootflags=<mount options>
|
||||
specify additional mount options for the root filesystem. If not set, /etc/fstab
|
||||
of the real root will be parsed for special mount options and mounted
|
||||
accordingly.
|
||||
.TP
|
||||
.B rd_NO_FSTAB
|
||||
do not honor special mount options for the root filesystem found in
|
||||
/etc/fstab of the real root.
|
||||
|
||||
.SH I18N
|
||||
.ad l
|
||||
e.g. LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=de-latin1-nodeadkeys
|
||||
.ad
|
||||
.TP
|
||||
.B KEYBOARDTYPE=sun|pc
|
||||
will be written to /etc/sysconfig/keyboard in the initramfs
|
||||
.TP
|
||||
.B KEYTABLE=<keytable filename>
|
||||
will be written to /etc/sysconfig/keyboard in the initramfs
|
||||
.TP
|
||||
.B SYSFONT= Console font
|
||||
will be written to /etc/sysconfig/i18n in the initramfs
|
||||
.TP
|
||||
.B SYSFONTACM= Unicode font map
|
||||
will be written to /etc/sysconfig/i18n in the initramfs
|
||||
.TP
|
||||
.B UNIMAP= Unicode font map
|
||||
will be written to /etc/sysconfig/i18n in the initramfs
|
||||
.TP
|
||||
.B LANG=<locale>
|
||||
will be written to /etc/sysconfig/i18n in the initramfs
|
||||
|
||||
.SH LVM
|
||||
.TP
|
||||
.B rd_NO_LVM
|
||||
disable LVM detection
|
||||
.TP
|
||||
.B rd_LVM_VG=<volume group name>
|
||||
only activate the volume groups with the given name
|
||||
rd_LVM_VG can be specified multiple times on the kernel command line.
|
||||
.TP
|
||||
.B rd_LVM_LV=<logical volume name>
|
||||
only activate the volume groups with the given name
|
||||
rd_LVM_LV can be specified multiple times on the kernel command line.
|
||||
.TP
|
||||
.B rd_NO_LVMCONF
|
||||
remove any /etc/lvm/lvm.conf, which may exist in the initramfs
|
||||
|
||||
.SH crypto LUKS
|
||||
.TP
|
||||
.B rd_NO_LUKS
|
||||
disable crypto LUKS detection
|
||||
.TP
|
||||
.B rd_LUKS_UUID=<luks uuid>
|
||||
only activate the LUKS partitions with the given UUID
|
||||
Any "luks-" of the LUKS UUID is removed before comparing to <luks uuid>.
|
||||
The comparisons also matches, if <luks uuid> is only the beginning of the
|
||||
LUKS UUID, so you don't have to specify the full UUID.
|
||||
.B rd_NO_CRYPTTAB
|
||||
do not check if LUKS partition is in /etc/crypttab
|
||||
|
||||
.SH MD
|
||||
.TP
|
||||
.B rd_NO_MD
|
||||
disable MD RAID detection
|
||||
.TP
|
||||
.B rd_NO_MDIMSM
|
||||
no MD RAID for imsm/isw raids, use dmraid instead
|
||||
.TP
|
||||
.B rd_NO_MDADMCONF
|
||||
ignore mdadm.conf included in initramfs
|
||||
.TP
|
||||
.B rd_MD_UUID=<md uuid>
|
||||
only activate the raid sets with the given UUID
|
||||
|
||||
.SH DMRAID
|
||||
.TP
|
||||
.B rd_NO_DM
|
||||
disable DM RAID detection
|
||||
.TP
|
||||
.B rd_DM_UUID=<dmraid uuid>
|
||||
only activate the raid sets with the given UUID
|
||||
|
||||
.SH DASD
|
||||
.TP
|
||||
.B rd_DASD_MOD=....
|
||||
same syntax as the kernel module parameter (s390 only)
|
||||
|
||||
.TP
|
||||
.B rd_DASD=<dasd adaptor device bus ID>[,readonly=X][,use_diag=X][,erplog=X][,failfast=X]
|
||||
activate DASD device with the given adaptor device bus ID and setting the sysfs attributes
|
||||
to the specified values
|
||||
|
||||
.SH ZFCP
|
||||
.TP
|
||||
.B rd_ZFCP=<zfcp adaptor device bus ID>,<WWPN>,<FCPLUN>
|
||||
rd_ZFCP can be specified multiple times on the kernel command line.
|
||||
|
||||
example: rd_ZFCP=0.0.4000,0x5005076300C213e9,0x5022000000000000
|
||||
.TP
|
||||
.B rd_NO_ZFCPCONF
|
||||
ignore zfcp.conf included in the initramfs
|
||||
|
||||
.SH CCW
|
||||
.TP
|
||||
.B rd_CCW=<nettype>,<subchannels>,<options>
|
||||
rd_CCW can be specified multiple times on the kernel command line. Examples:
|
||||
rd_CCW=qeth,0.0.0600,0.0.0601,0.0.0602,layer2=1,portname=foo
|
||||
rd_CCW=ctc,0.0.0600,0.0.0601,0.0.0602,protocol=bar
|
||||
.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.
|
||||
.TP
|
||||
.B rd_NFS_DOMAIN=<NFSv4 domain name>
|
||||
Set the NFSv4 domain name. Will overwrite the settings in /etc/idmap.conf.
|
||||
|
||||
.SH iSCSI
|
||||
.TP
|
||||
.B root=iscsi:[username:password[:reverse:password]@][<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:[username:password[:reverse:password]@][<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname>
|
||||
e.g. root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
|
||||
.TP
|
||||
.B root=??? netroot=iscsi:[username:password[:reverse:password]@][<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname> ...
|
||||
.ad l
|
||||
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!
|
||||
.ad
|
||||
.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 FCoE
|
||||
.TP
|
||||
.B netroot=fcoe:<interface|MAC>:<dcb|nodcb>
|
||||
Try to connect to a FCoE SAN through the NIC specified by <interface> or <MAC>,
|
||||
for the second argument, currently only nodcb is supported. Note letters in
|
||||
the MAC-address must be lowercase!
|
||||
|
||||
.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
|
||||
.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
|
||||
.ad l
|
||||
.B ip=<client-IP>:[<server-id>]:<gateway-IP>:<netmask>:<client\%hostname>:<interface>:{none|off}
|
||||
.ad
|
||||
explicit network configuration
|
||||
.TP
|
||||
.B ifname=<interface>:<MAC>
|
||||
Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>.
|
||||
Note letters in the MAC-address must be lowercase!
|
||||
Note that if you use this option you \fBmust\fR specify an ifname= argument
|
||||
for all interfaces used in ip= or fcoe= arguments
|
||||
.TP
|
||||
.B bootdev=<interface>
|
||||
specify network interface to use routing and netroot information from. Required if multiple ip= lines are used.
|
||||
|
||||
.SH Plymouth Boot Splash
|
||||
.TP
|
||||
.B rd_NO_PLYMOUTH
|
||||
do not start plymouth. This will not work with encrypted partitions.
|
||||
|
||||
.SH Misc
|
||||
.TP
|
||||
.B rdblacklist=<drivername>
|
||||
do not load kernel module <drivername>
|
||||
.TP
|
||||
.B rdloaddriver=<drivername>
|
||||
force loading kernel module <drivername>
|
||||
|
||||
.SH Debug
|
||||
.TP
|
||||
.B rdinfo
|
||||
print informational output though "quiet" is set
|
||||
.TP
|
||||
.B rdshell
|
||||
allow dropping to a shell, if root mounting fails
|
||||
.TP
|
||||
.B rdinitdebug
|
||||
set -x for the dracut shell and logs to dmesg, console and /init.log
|
||||
.TP
|
||||
.B rdbreak
|
||||
drop to a shell at the end
|
||||
.TP
|
||||
.B rdbreak={cmdline | pre-udev | pre-trigger | initqueue | pre-mount | mount | pre-pivot}
|
||||
drop to a 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.
|
||||
.TP
|
||||
.B /etc/cmdline
|
||||
Can contain additional command line options.
|
||||
|
||||
.SH FILES
|
||||
.TP
|
||||
.B /var/log/dracut.log
|
||||
.TP
|
||||
.B /tmp/dracut.log
|
||||
.TP
|
||||
.B /etc/dracut.conf
|
||||
|
||||
.SH AUTHORS
|
||||
.nf
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
Victor Lowther <victor.lowther@gmail.com>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
David Dillow <dave@thedillows.org>
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
The dracut command is part of the dracut package and is available from
|
||||
http://sourceforge.net/apps/trac/dracut/wiki
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR dracut.conf (5)
|
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>
|
18
dracut.conf
18
dracut.conf
@@ -1,16 +1,24 @@
|
||||
# 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+=""
|
||||
|
||||
# Dracut modules to add to the default
|
||||
#add_dracutmodules+=""
|
||||
|
||||
# additional kernel modules to the default
|
||||
#add_drivers=""
|
||||
#add_drivers+=""
|
||||
|
||||
# list of kernel filesystem modules to be included in the generic initramfs
|
||||
#filesystems=""
|
||||
#filesystems+=""
|
||||
|
||||
# build initrd only to boot current hardware
|
||||
#hostonly="yes"
|
||||
|
@@ -1,66 +0,0 @@
|
||||
.TH DRACUT.CONF 5 "NOV 2009" "Linux"
|
||||
.SH NAME
|
||||
dracut.conf \- configuration file for dracut
|
||||
|
||||
.SH SYNOPSIS
|
||||
\fB/etc/dracut.conf\fR
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B dracut.conf
|
||||
is loaded during the initialisation phase of dracut.
|
||||
Command line parameter will overwrite any values set here.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BR dracutmodules="[LIST]"
|
||||
Specify a space-separated list of dracut modules to
|
||||
call when building the initramfs. Modules are located
|
||||
in /usr/share/dracut/modules.d.
|
||||
.TP
|
||||
.BR omit_dracutmodules="[LIST]"
|
||||
Omit a space-separated list of dracut modules.
|
||||
.TP
|
||||
.BR add_dracutmodules="[LIST]"
|
||||
Add a space-separated list of dracut modules.
|
||||
.TP
|
||||
.BR drivers="[LIST]"
|
||||
Specify a space-separated list of kernel modules to
|
||||
exclusively include in the initramfs.
|
||||
.TP
|
||||
.BR add_drivers="[LIST]"
|
||||
Specify a space-separated list of kernel
|
||||
modules to add to the initramfs.
|
||||
.TP
|
||||
.BR filesystems="[LIST]"
|
||||
Specify a space-separated list of kernel filesystem
|
||||
modules to exclusively include in the generic
|
||||
initramfs.
|
||||
.TP
|
||||
.BR drivers_dir="<dir>"
|
||||
Specify the directory, where to look for kernel modules
|
||||
.TP
|
||||
.BR fw_dir="<dir>[:<dir> ...]"
|
||||
Specify additional directories, where to look for firmwares, separated by :
|
||||
.TP
|
||||
.BR do_strip="yes|no"
|
||||
Strip binaries in the initramfs (default=yes)
|
||||
.TP
|
||||
.BR hostonly="yes|no"
|
||||
Host-Only mode: Install only what is needed for booting
|
||||
the local host instead of a generic host.
|
||||
.TP
|
||||
.BR mdadmconf="yes|no"
|
||||
Include local /etc/mdadm.conf (default=yes)
|
||||
.TP
|
||||
.BR lvmconf="yes|no"
|
||||
Include local /etc/lvm/lvm.conf (default=yes)
|
||||
.TP
|
||||
.BR kernel_only="yes|no"
|
||||
Only install kernel drivers and firmware files. (default=no)
|
||||
.TP
|
||||
.BR no_kernel="yes|no"
|
||||
Do not install kernel drivers and firmware files (default=no)
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR dracut (8)
|
||||
|
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 |
478
dracut.spec
478
dracut.spec
@@ -1,34 +1,44 @@
|
||||
# Variables must be defined
|
||||
%define with_switch_root 1
|
||||
%define with_nbd 1
|
||||
%define with_nbd 1
|
||||
|
||||
# switchroot provided by util-linux-ng in F-12+
|
||||
%if 0%{?fedora} > 11 || 0%{?rhel} >= 6
|
||||
%define with_switch_root 0
|
||||
%endif
|
||||
# nbd in Fedora only
|
||||
%if 0%{?rhel} >= 6
|
||||
%define with_nbd 0
|
||||
%endif
|
||||
|
||||
%if %{defined gittag}
|
||||
%define rdist .git%{gittag}%{?dist}
|
||||
%define dashgittag -%{gittag}
|
||||
%else
|
||||
%define rdist %{?dist}
|
||||
Name: dracut
|
||||
Version: xxx
|
||||
Release: xxx
|
||||
|
||||
Summary: Initramfs generator using udev
|
||||
%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)
|
||||
%endif
|
||||
%if 0%{?suse_version}
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
%endif
|
||||
|
||||
Name: dracut
|
||||
Version: 004
|
||||
Release: 1%{?rdist}
|
||||
Summary: Initramfs generator using udev
|
||||
Group: System Environment/Base
|
||||
License: GPLv2+
|
||||
URL: http://apps.sourceforge.net/trac/dracut/wiki
|
||||
# Source can be generated by
|
||||
# http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=snapshot;h=%{?dashgittag};sf=tgz
|
||||
Source0: dracut-%{version}%{?dashgittag}.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
%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
|
||||
@@ -39,59 +49,79 @@ Obsoletes: nash <= 6.0.93
|
||||
Obsoletes: libbdevid-python <= 6.0.93
|
||||
%endif
|
||||
|
||||
Requires: udev
|
||||
Requires: util-linux-ng
|
||||
Requires: module-init-tools >= 3.7-9
|
||||
Requires: cpio
|
||||
Requires: coreutils
|
||||
Requires: findutils
|
||||
Requires: binutils
|
||||
Requires: grep
|
||||
Requires: which
|
||||
Requires: mktemp >= 1.5-5
|
||||
Requires: mount
|
||||
Requires: bash
|
||||
Requires: dash
|
||||
Requires: /bin/sh
|
||||
Requires: fileutils, gzip, tar
|
||||
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
|
||||
Requires(pre): plymouth >= 0.8.0-0.2009.29.09.19.1
|
||||
Requires: plymouth >= 0.8.0-0.2009.29.09.19.1
|
||||
Requires: cryptsetup-luks
|
||||
Requires: file
|
||||
Requires: bzip2
|
||||
Requires: dmraid
|
||||
Requires: kbd
|
||||
Requires: plymouth-scripts
|
||||
|
||||
%if ! 0%{?with_switch_root}
|
||||
Requires: util-linux-ng >= 2.16
|
||||
BuildArch: noarch
|
||||
%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 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
|
||||
%endif
|
||||
Requires: net-tools iproute
|
||||
Requires: iproute
|
||||
Requires: bridge-utils
|
||||
|
||||
%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 with network support with dracut.
|
||||
|
||||
%if 0%{?fedora}
|
||||
%package fips
|
||||
Summary: dracut modules to build a dracut initramfs with an integrity check.
|
||||
Summary: Dracut modules to build a dracut initramfs with an integrity check
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: hmaccalc
|
||||
%if 0%{?rhel} > 5
|
||||
@@ -105,88 +135,100 @@ 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 generic
|
||||
Summary: Metapackage to build a generic initramfs with dracut
|
||||
%package caps
|
||||
Summary: Dracut modules to build a dracut initramfs which drops capabilities
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: %{name}-network = %{version}-%{release}
|
||||
Requires: libcap
|
||||
|
||||
%description generic
|
||||
This package requires everything which is needed to build a generic
|
||||
all purpose initramfs with dracut.
|
||||
|
||||
|
||||
%package kernel
|
||||
Summary: Metapackage to build generic initramfs with dracut with only kernel modules
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: ql2100-firmware
|
||||
Requires: ql2200-firmware
|
||||
Requires: ql23xx-firmware
|
||||
Requires: ql2400-firmware
|
||||
Requires: ql2500-firmware
|
||||
|
||||
%description kernel
|
||||
This package requires everything which is needed to build a initramfs with all
|
||||
kernel modules and firmware files needed by dracut modules.
|
||||
%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: coreutils cryptsetup-luks device-mapper
|
||||
Requires: diffutils dmraid findutils gawk grep lvm2
|
||||
Requires: module-init-tools sed
|
||||
Requires: cpio gzip
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description tools
|
||||
This package contains tools to assemble the local initrd and host configuration.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}%{?dashgittag}
|
||||
%setup -q -n %{name}-%{version}
|
||||
|
||||
%build
|
||||
make WITH_SWITCH_ROOT=0%{?with_switch_root}
|
||||
make
|
||||
|
||||
%install
|
||||
%if 0%{?fedora}
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%endif
|
||||
make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin \
|
||||
sysconfdir=/etc mandir=%{_mandir} WITH_SWITCH_ROOT=0%{?with_switch_root}
|
||||
sysconfdir=/etc mandir=%{_mandir}
|
||||
|
||||
echo %{name}-%{version}-%{release} > $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/10rpmversion/dracut-version
|
||||
rm $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/01fips/check
|
||||
|
||||
%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} <= 12 && 0%{?rhel} < 6
|
||||
%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 NEWS
|
||||
%doc README HACKING TODO COPYING AUTHORS NEWS dracut.html dracut.png dracut.svg
|
||||
/sbin/dracut
|
||||
%if 0%{?with_switch_root}
|
||||
/sbin/switch_root
|
||||
%endif
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6
|
||||
%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/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/10redhat-i18n
|
||||
%{_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
|
||||
@@ -195,46 +237,53 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_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/95znet
|
||||
%{_datadir}/dracut/modules.d/95terminfo
|
||||
%{_datadir}/dracut/modules.d/95udev-rules
|
||||
%{_datadir}/dracut/modules.d/95uswsusp
|
||||
%{_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 network
|
||||
%doc README HACKING TODO COPYING AUTHORS NEWS
|
||||
%defattr(-,root,root,0755)
|
||||
%{_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)
|
||||
%doc COPYING
|
||||
%{_datadir}/dracut/modules.d/01fips
|
||||
%config(noreplace) /etc/dracut.conf.d/40-fips.conf
|
||||
%endif
|
||||
|
||||
%files kernel
|
||||
%files caps
|
||||
%defattr(-,root,root,0755)
|
||||
%doc README.kernel
|
||||
%{_datadir}/dracut/modules.d/02caps
|
||||
|
||||
%files generic
|
||||
%files tools
|
||||
%defattr(-,root,root,0755)
|
||||
%doc README.generic
|
||||
|
||||
%files tools
|
||||
%defattr(-,root,root,0755)
|
||||
%doc COPYING NEWS
|
||||
%{_mandir}/man8/dracut-gencmdline.8*
|
||||
%{_mandir}/man8/dracut-catimages.8*
|
||||
/sbin/dracut-gencmdline
|
||||
@@ -244,222 +293,3 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%dir /var/lib/dracut/overlay
|
||||
|
||||
%changelog
|
||||
* Fri Jan 15 2010 Harald Hoyer <harald@redhat.com> 004-1
|
||||
- version 004
|
||||
- Resolves: rhbz#529339 rhbz#533494 rhbz#548550
|
||||
- Resolves: rhbz#548555 rhbz#553195
|
||||
|
||||
* Wed Jan 13 2010 Harald Hoyer <harald@redhat.com> 003-3
|
||||
- add Obsoletes of mkinitrd/nash/libbdevid-python
|
||||
- Related: rhbz#543948
|
||||
|
||||
* Wed Jan 13 2010 Warren Togami <wtogami@redhat.com> 003-2
|
||||
- nbd is Fedora only
|
||||
|
||||
* Fri Nov 27 2009 Harald Hoyer <harald@redhat.com> 003-1
|
||||
- version 003
|
||||
|
||||
* Mon Nov 23 2009 Harald Hoyer <harald@redhat.com> 002-26
|
||||
- add WITH_SWITCH_ROOT make flag
|
||||
- add fips requirement conditional
|
||||
- add more device mapper modules (bug #539656)
|
||||
|
||||
* Fri Nov 20 2009 Dennis Gregorovic <dgregor@redhat.com> - 002-25.1
|
||||
- nss changes for Alpha 3
|
||||
|
||||
* Thu Nov 19 2009 Harald Hoyer <harald@redhat.com> 002-25
|
||||
- add more requirements for dracut-fips (bug #539257)
|
||||
|
||||
* Tue Nov 17 2009 Harald Hoyer <harald@redhat.com> 002-24
|
||||
- put fips module in a subpackage (bug #537619)
|
||||
|
||||
* Tue Nov 17 2009 Harald Hoyer <harald@redhat.com> 002-23
|
||||
- install xdr utils for multipath (bug #463458)
|
||||
|
||||
* Thu Nov 12 2009 Harald Hoyer <harald@redhat.com> 002-22
|
||||
- add module 90multipath
|
||||
- add module 01fips
|
||||
- renamed module 95ccw to 95znet (bug #533833)
|
||||
- crypt: ignore devices in /etc/crypttab (root is not in there)
|
||||
- dasd: only install /etc/dasd.conf in hostonly mode (bug #533833)
|
||||
- zfcp: only install /etc/zfcp.conf in hostonly mode (bug #533833)
|
||||
- kernel-modules: add scsi_dh scsi_dh_rdac scsi_dh_emc (bug #527750)
|
||||
- dasd: use dasdconf.sh from s390utils (bug #533833)
|
||||
|
||||
* Fri Nov 06 2009 Harald Hoyer <harald@redhat.com> 002-21
|
||||
- fix rd_DASD argument handling (bug #531720)
|
||||
- Resolves: rhbz#531720
|
||||
|
||||
* Wed Nov 04 2009 Harald Hoyer <harald@redhat.com> 002-20
|
||||
- fix rd_DASD argument handling (bug #531720)
|
||||
- Resolves: rhbz#531720
|
||||
|
||||
* Tue Nov 03 2009 Harald Hoyer <harald@redhat.com> 002-19
|
||||
- changed rd_DASD to rd_DASD_MOD (bug #531720)
|
||||
- Resolves: rhbz#531720
|
||||
|
||||
* Tue Oct 27 2009 Harald Hoyer <harald@redhat.com> 002-18
|
||||
- renamed lvm/device-mapper udev rules according to upstream changes
|
||||
- fixed dracut search path issue
|
||||
|
||||
* Mon Oct 26 2009 Harald Hoyer <harald@redhat.com> 002-17
|
||||
- load dm_mod module (bug #530540)
|
||||
|
||||
* Fri Oct 09 2009 Jesse Keating <jkeating@redhat.com> - 002-16
|
||||
- Upgrade plymouth to Requires(pre) to make it show up before kernel
|
||||
|
||||
* Thu Oct 08 2009 Harald Hoyer <harald@redhat.com> 002-15
|
||||
- s390 ccw: s/layer1/layer2/g
|
||||
|
||||
* Thu Oct 08 2009 Harald Hoyer <harald@redhat.com> 002-14
|
||||
- add multinic support
|
||||
- add s390 zfcp support
|
||||
- add s390 network support
|
||||
|
||||
* Wed Oct 07 2009 Harald Hoyer <harald@redhat.com> 002-13
|
||||
- fixed init=<command> handling
|
||||
- kill loginit if "rdinitdebug" specified
|
||||
- run dmsquash-live-root after udev has settled (bug #527514)
|
||||
|
||||
* Tue Oct 06 2009 Harald Hoyer <harald@redhat.com> 002-12
|
||||
- add missing loginit helper
|
||||
- corrected dracut manpage
|
||||
|
||||
* Thu Oct 01 2009 Harald Hoyer <harald@redhat.com> 002-11
|
||||
- fixed dracut-gencmdline for root=UUID or LABEL
|
||||
|
||||
* Thu Oct 01 2009 Harald Hoyer <harald@redhat.com> 002-10
|
||||
- do not destroy assembled raid arrays if mdadm.conf present
|
||||
- mount /dev/shm
|
||||
- let udevd not resolve group and user names
|
||||
- preserve timestamps of tools on initramfs generation
|
||||
- generate symlinks for binaries correctly
|
||||
- moved network from udev to initqueue
|
||||
- mount nfs3 with nfsvers=3 option and retry with nfsvers=2
|
||||
- fixed nbd initqueue-finished
|
||||
- improved debug output: specifying "rdinitdebug" now logs
|
||||
to dmesg, console and /init.log
|
||||
- stop udev before killing it
|
||||
- add ghost /var/log/dracut.log
|
||||
- dmsquash: use info() and die() rather than echo
|
||||
- strip kernel modules which have no x bit set
|
||||
- redirect stdin, stdout, stderr all RW to /dev/console
|
||||
so the user can use "less" to view /init.log and dmesg
|
||||
|
||||
* Tue Sep 29 2009 Harald Hoyer <harald@redhat.com> 002-9
|
||||
- make install of new dm/lvm udev rules optionally
|
||||
- correct dasd module typo
|
||||
|
||||
* Fri Sep 25 2009 Warren Togami <wtogami@redhat.com> 002-8
|
||||
- revert back to dracut-002-5 tarball 845dd502
|
||||
lvm2 was reverted to pre-udev
|
||||
|
||||
* Wed Sep 23 2009 Harald Hoyer <harald@redhat.com> 002-7
|
||||
- build with the correct tarball
|
||||
|
||||
* Wed Sep 23 2009 Harald Hoyer <harald@redhat.com> 002-6
|
||||
- add new device mapper udev rules and dmeventd
|
||||
bug 525319, 525015
|
||||
|
||||
* Wed Sep 23 2009 Warren Togami <wtogami@redaht.com> 002-5
|
||||
- Revert back to -3, Add umount back to initrd
|
||||
This makes no functional difference to LiveCD. See Bug #525319
|
||||
|
||||
* Mon Sep 21 2009 Warren Togami <wtogami@redhat.com> 002-4
|
||||
- Fix LiveCD boot regression
|
||||
|
||||
* Mon Sep 21 2009 Harald Hoyer <harald@redhat.com> 002-3
|
||||
- bail out if selinux policy could not be loaded and
|
||||
selinux=0 not specified on kernel command line
|
||||
(bug #524113)
|
||||
- set finished criteria for dmsquash live images
|
||||
|
||||
* Fri Sep 18 2009 Harald Hoyer <harald@redhat.com> 002-2
|
||||
- do not cleanup dmraids
|
||||
- copy over lvm.conf
|
||||
|
||||
* Thu Sep 17 2009 Harald Hoyer <harald@redhat.com> 002-1
|
||||
- version 002
|
||||
- set correct PATH
|
||||
- workaround for broken mdmon implementation
|
||||
|
||||
* Wed Sep 16 2009 Harald Hoyer <harald@redhat.com> 001-12
|
||||
- removed lvm/mdraid/dmraid lock files
|
||||
- add missing ifname= files
|
||||
|
||||
* Wed Sep 16 2009 Harald Hoyer <harald@redhat.com> 001-11
|
||||
- generate dracut-version during rpm build time
|
||||
|
||||
* Tue Sep 15 2009 Harald Hoyer <harald@redhat.com> 001-10
|
||||
- add ifname= argument for persistent netdev names
|
||||
- new /initqueue-finished to check if the main loop can be left
|
||||
- copy mdadm.conf if --mdadmconf set or mdadmconf in dracut.conf
|
||||
|
||||
* Wed Sep 09 2009 Harald Hoyer <harald@redhat.com> 001-9
|
||||
- added Requires: plymouth-scripts
|
||||
|
||||
* Wed Sep 09 2009 Harald Hoyer <harald@redhat.com> 001-8
|
||||
- plymouth: use plymouth-populate-initrd
|
||||
- add add_drivers for dracut and dracut.conf
|
||||
- do not mount /proc and /selinux manually in selinux-load-policy
|
||||
|
||||
* Wed Sep 09 2009 Harald Hoyer <harald@redhat.com> 001-7
|
||||
- add scsi_wait_scan to be sure everything was scanned
|
||||
|
||||
* Tue Sep 08 2009 Harald Hoyer <harald@redhat.com> 001-6
|
||||
- fixed several problems with md raid containers
|
||||
- fixed selinux policy loading
|
||||
|
||||
* Tue Sep 08 2009 Harald Hoyer <harald@redhat.com> 001-5
|
||||
- patch does not honor file modes, fixed them manually
|
||||
|
||||
* Mon Sep 07 2009 Harald Hoyer <harald@redhat.com> 001-4
|
||||
- fixed mdraid for IMSM
|
||||
|
||||
* Mon Sep 07 2009 Harald Hoyer <harald@redhat.com> 001-3
|
||||
- fixed bug, which prevents installing 61-persistent-storage.rules (bug #520109)
|
||||
|
||||
* Thu Sep 03 2009 Harald Hoyer <harald@redhat.com> 001-2
|
||||
- fixed missing grep for md
|
||||
- reorder cleanup
|
||||
|
||||
* Wed Sep 02 2009 Harald Hoyer <harald@redhat.com> 001-1
|
||||
- version 001
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Fri Aug 14 2009 Harald Hoyer <harald@redhat.com> 0.9-1
|
||||
- version 0.9
|
||||
|
||||
* Thu Aug 06 2009 Harald Hoyer <harald@redhat.com> 0.8-1
|
||||
- version 0.8
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Fri Jul 24 2009 Harald Hoyer <harald@redhat.com> 0.7-1
|
||||
- version 0.7
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Wed Jul 22 2009 Harald Hoyer <harald@redhat.com> 0.6-1
|
||||
- version 0.6
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Fri Jul 17 2009 Harald Hoyer <harald@redhat.com> 0.5-1
|
||||
- version 0.5
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Sat Jul 04 2009 Harald Hoyer <harald@redhat.com> 0.4-1
|
||||
- version 0.4
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Thu Jul 02 2009 Harald Hoyer <harald@redhat.com> 0.3-1
|
||||
- version 0.3
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Wed Jul 01 2009 Harald Hoyer <harald@redhat.com> 0.2-1
|
||||
- version 0.2
|
||||
|
||||
* 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 $_;
|
||||
}
|
||||
}
|
50
lsinitrd
50
lsinitrd
@@ -1,11 +1,49 @@
|
||||
#!/bin/bash
|
||||
#!/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/>.
|
||||
#
|
||||
|
||||
[[ $# -eq 1 ]] || { echo "Usage: $(basename $0) <initramfs file>" ; exit 1 ; }
|
||||
[[ -f $1 ]] || { echo "$1 does not exist" ; exit 1 ; }
|
||||
[[ $# -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 ; }
|
||||
|
||||
echo "$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 "========================================================================"
|
||||
zcat $1 | cpio --extract --verbose --quiet --to-stdout 'dracut-*' 2>/dev/null
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout 'lib/dracut/dracut-*' 2>/dev/null
|
||||
echo "========================================================================"
|
||||
zcat $1 | cpio --extract --verbose --quiet --list
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --list
|
||||
echo "========================================================================"
|
||||
|
@@ -1,102 +1,65 @@
|
||||
#!/bin/bash --norc
|
||||
kver=$(uname -r)
|
||||
|
||||
error() {
|
||||
local NONL=""
|
||||
if [ "$1" == "-n" ]; then
|
||||
NONL="-n"
|
||||
shift
|
||||
fi
|
||||
echo $NONL "$@" > /dev/stderr
|
||||
}
|
||||
error() { echo "$@" >&2; }
|
||||
|
||||
usage () {
|
||||
if [ "$1" == "-n" ]; then
|
||||
cmd=echo
|
||||
else
|
||||
cmd=error
|
||||
fi
|
||||
[[ $1 = '-n' ]] && cmd=echo || cmd=error
|
||||
|
||||
$cmd "usage: `basename $0` [--version] [--help] [-v] [-f] [--preload <module>]"
|
||||
$cmd "usage: ${0##*/} [--version] [--help] [-v] [-f] [--preload <module>]"
|
||||
$cmd " [--image-version] [--with=<module>]"
|
||||
$cmd " <initrd-image> <kernel-version>"
|
||||
$cmd ""
|
||||
$cmd " (ex: `basename $0` /boot/initramfs-$(uname -r).img $(uname -r))"
|
||||
$cmd " (ex: ${0##*/} /boot/initramfs-$kver.img $kver)"
|
||||
|
||||
if [ "$1" == "-n" ]; then
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
[[ $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 [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
--with-usb*)
|
||||
if [ "$1" != "${1##--with-usb=}" ]; then
|
||||
usbmodule=${1##--with-usb=}
|
||||
else
|
||||
usbmodule="usb-storage"
|
||||
fi
|
||||
basicmodules="$basicmodules $usbmodule"
|
||||
unset usbmodule
|
||||
;;
|
||||
--with-avail*)
|
||||
if [ "$1" != "${1##--with-avail=}" ]; then
|
||||
modname=${1##--with-avail=}
|
||||
else
|
||||
modname=$2
|
||||
shift
|
||||
fi
|
||||
|
||||
basicmodules="$basicmodules $modname"
|
||||
;;
|
||||
--with*)
|
||||
if [ "$1" != "${1##--with=}" ]; then
|
||||
modname=${1##--with=}
|
||||
else
|
||||
modname=$2
|
||||
shift
|
||||
fi
|
||||
|
||||
basicmodules="$basicmodules $modname"
|
||||
;;
|
||||
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)
|
||||
dracut_args="${dracut_args} -f"
|
||||
;;
|
||||
--preload*)
|
||||
if [ "$1" != "${1##--preload=}" ]; then
|
||||
modname=${1##--preload=}
|
||||
else
|
||||
modname=$2
|
||||
shift
|
||||
fi
|
||||
basicmodules="$basicmodules $modname"
|
||||
;;
|
||||
--image-version)
|
||||
img_vers=yes
|
||||
;;
|
||||
--rootfs*)
|
||||
if [ "$1" != "${1##--rootfs=}" ]; then
|
||||
rootfs="${1##--rootfs=}"
|
||||
else
|
||||
rootfs="$2"
|
||||
shift
|
||||
fi
|
||||
dracut_args="${dracut_args} --filesystems $rootfs"
|
||||
;;
|
||||
--builtin*) ;;
|
||||
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*) ;;
|
||||
--nocompress) ;;
|
||||
--ifneeded) ;;
|
||||
--omit-scsi-modules) ;;
|
||||
--omit-ide-modules) ;;
|
||||
@@ -106,45 +69,32 @@ while [ $# -gt 0 ]; do
|
||||
--allow-missing) ;;
|
||||
--net-dev*) ;;
|
||||
--noresume) ;;
|
||||
--rootdev*) ;;
|
||||
--thawdev*) ;;
|
||||
--rootopts*) ;;
|
||||
--root*) ;;
|
||||
--loopdev*) ;;
|
||||
--loopfs*) ;;
|
||||
--loopopts*) ;;
|
||||
--looppath*) ;;
|
||||
--dsdt*) ;;
|
||||
--rootdev*) ;;
|
||||
--thawdev*) ;;
|
||||
--rootopts*) ;;
|
||||
--root*) ;;
|
||||
--loopdev*) ;;
|
||||
--loopfs*) ;;
|
||||
--loopopts*) ;;
|
||||
--looppath*) ;;
|
||||
--dsdt*) ;;
|
||||
--bootchart) ;;
|
||||
--help)
|
||||
usage -n
|
||||
;;
|
||||
*)
|
||||
if [ -z "$target" ]; then
|
||||
target=$1
|
||||
elif [ -z "$kernel" ]; then
|
||||
kernel=$1
|
||||
*) if [[ ! $target ]]; then
|
||||
target=$1
|
||||
elif [[ ! $kernel ]]; then
|
||||
kernel=$1
|
||||
else
|
||||
usage
|
||||
fi
|
||||
;;
|
||||
usage
|
||||
fi;;
|
||||
esac
|
||||
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -z "$target" -o -z "$kernel" ]; then
|
||||
usage
|
||||
fi
|
||||
[[ $target && $kernel ]] || usage
|
||||
[[ $img_vers ]] && target="$target-$kernel"
|
||||
|
||||
if [ -n "$img_vers" ]; then
|
||||
target="$target-$kernel"
|
||||
fi
|
||||
|
||||
if [ -n "$basicmodules" ]; then
|
||||
dracut -H $dracut_args --add-drivers "$basicmodules" "$target" "$kernel"
|
||||
if [[ $basicmodules ]]; then
|
||||
dracut $dracut_args --add-drivers "$basicmodules" "$target" "$kernel"
|
||||
else
|
||||
dracut -H $dracut_args "$target" "$kernel"
|
||||
dracut $dracut_args "$target" "$kernel"
|
||||
fi
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
|
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"
|
||||
}
|
||||
|
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
. $dracutfunctions
|
||||
|
||||
for program in ip arping; do
|
||||
which $program >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
dwarning "Could not find program \"$program\" required by network."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
for program in dhclient brctl; do
|
||||
which $program >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
dwarning "Could not find program \"$program\" it might be required by network."
|
||||
fi
|
||||
done
|
||||
exit 255
|
||||
|
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
|
@@ -1,49 +1,69 @@
|
||||
#!/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()
|
||||
{
|
||||
FIPSMODULES=$(cat /etc/fipsmodules)
|
||||
BOOT=$(getarg boot=)
|
||||
KERNEL=$(uname -r)
|
||||
udevadm trigger >/dev/null 2>&1
|
||||
case "$boot" in
|
||||
block:LABEL=*|LABEL=*)
|
||||
boot="${boot#block:}"
|
||||
boot="$(echo $boot | sed 's,/,\\x2f,g')"
|
||||
boot="/dev/disk/by-label/${boot#LABEL=}"
|
||||
bootok=1 ;;
|
||||
block:UUID=*|UUID=*)
|
||||
boot="${boot#block:}"
|
||||
boot="/dev/disk/by-uuid/${root#UUID=}"
|
||||
bootok=1 ;;
|
||||
/dev/*)
|
||||
bootok=1 ;;
|
||||
esac
|
||||
|
||||
[ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version)
|
||||
|
||||
if [ $UDEVVERSION -ge 143 ]; then
|
||||
udevadm settle --exit-if-exists=$boot
|
||||
else
|
||||
udevadm settle --timeout=30
|
||||
fi
|
||||
|
||||
[ -e "$boot" ]
|
||||
|
||||
mkdir /boot
|
||||
info "Mounting $boot as /boot"
|
||||
mount -oro "$boot" /boot
|
||||
|
||||
info "Checking integrity of kernel"
|
||||
newroot=$NEWROOT
|
||||
KERNEL=$(uname -r)
|
||||
|
||||
if ! [ -e "/boot/.vmlinuz-${KERNEL}.hmac" ]; then
|
||||
warn "/boot/.vmlinuz-${KERNEL}.hmac does not exist"
|
||||
[ -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 "/boot/.vmlinuz-${KERNEL}.hmac" || return 1
|
||||
sha512hmac -c "$newroot/boot/.vmlinuz-${KERNEL}.hmac" || return 1
|
||||
|
||||
info "Umounting /boot"
|
||||
umount /boot
|
||||
FIPSMODULES=$(cat /etc/fipsmodules)
|
||||
|
||||
info "Loading and integrity checking all crypto modules"
|
||||
for module in $FIPSMODULES; do
|
||||
@@ -52,19 +72,13 @@ do_fips()
|
||||
fi
|
||||
done
|
||||
info "Self testing crypto algorithms"
|
||||
modprobe tcrypt noexit=1 || return 1
|
||||
modprobe tcrypt || return 1
|
||||
rmmod tcrypt
|
||||
info "All initrd crypto checks done"
|
||||
info "All initrd crypto checks done"
|
||||
|
||||
> /tmp/fipsdone
|
||||
|
||||
umount /boot >/dev/null 2>&1
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
if ! fipsmode=$(getarg fips) || [ $fipsmode == "0" ]; then
|
||||
rm -f /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
else
|
||||
set -e
|
||||
do_fips || die "FIPS integrity test failed"
|
||||
set +e
|
||||
fi
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
|
@@ -1,23 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
inst_hook pre-trigger 01 "$moddir/fips.sh"
|
||||
dracut_install sha512hmac rmmod insmod mount uname umount
|
||||
|
||||
libdir="lib"
|
||||
if ldd $(find_binary sha512hmac) |grep -q /lib64/libc; then
|
||||
libdir="lib64"
|
||||
fi
|
||||
|
||||
if [ -e /usr/$libdir/libsoftokn3.so ]; then
|
||||
dracut_install \
|
||||
/usr/$libdir/libsoftokn3.so /usr/$libdir/libsoftokn3.chk \
|
||||
/usr/$libdir/libfreebl3.so /usr/$libdir/libfreebl3.chk
|
||||
else
|
||||
dracut_install \
|
||||
/$libdir/libsoftokn3.so /$libdir/libsoftokn3.chk \
|
||||
/$libdir/libfreebl3.so /$libdir/libfreebl3.chk
|
||||
fi
|
||||
|
||||
dracut_install /usr/$libdir/hmaccalc/sha512hmac.hmac
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
@@ -1,16 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
FIPSMODULES="aead aes_generic aes-x86_64 ansi_cprng cbc ccm chainiv ctr"
|
||||
FIPSMODULES="$FIPSMODULES des deflate ecb eseqiv hmac seqiv sha256 sha512"
|
||||
FIPSMODULES="$FIPSMODULES cryptomgr crypto_null tcrypt"
|
||||
|
||||
mkdir -p "${initdir}/etc/modprobe.d"
|
||||
|
||||
for mod in $FIPSMODULES; do
|
||||
if instmods $mod; then
|
||||
echo $mod >> "${initdir}/etc/fipsmodules"
|
||||
echo "blacklist $mod" >> "${initdir}/etc/modprobe.d/fips.conf"
|
||||
fi
|
||||
done
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
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 $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 ${kbddir}/consoletrans/${FONT_MAP}.trans
|
||||
fi
|
||||
|
||||
if [[ ${FONT_UNIMAP} ]]
|
||||
then
|
||||
FONT_UNIMAP=${FONT_UNIMAP%.uni}
|
||||
inst ${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,100 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
install_local()
|
||||
{
|
||||
# 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
|
||||
if [[ $KEYTABLE && -d ${kbddir}/keymaps ]]; then
|
||||
[[ $KEYTABLE =~ *.uni ]] && UNIKEYMAP="$KEYTABLE.map" \
|
||||
|| UNIKEYMAP="$KEYTABLE.uni.map"
|
||||
KEYMAP="$KEYTABLE.map"
|
||||
fi
|
||||
fi
|
||||
if [[ $KEYMAP ]]; then
|
||||
[ -f /etc/sysconfig/keyboard ] && inst /etc/sysconfig/keyboard
|
||||
inst loadkeys
|
||||
findkeymap $KEYMAP
|
||||
[[ $UNIKEYMAP ]] && findkeymap $UNIKEYMAP
|
||||
[[ $GRP_TOGGLE ]] && findkeymap $GRP_TOGGLE.map
|
||||
findkeymap delete.map
|
||||
findkeymap backspace.map
|
||||
|
||||
for FN in $KEYMAPS; do
|
||||
if [ -L $FN ]; then
|
||||
TARGET=$(readlink -f $FN)
|
||||
TG=$(echo $TARGET | sed -e 's/\.gz$//' -e 's/\.bz2$//')
|
||||
LN=$(echo $FN | sed -e 's/\.gz$//' -e 's/\.bz2$//')
|
||||
mkdir -p "$initdir/$(dirname $LN)"
|
||||
ln -s "$TG" "$initdir/$LN"
|
||||
FN=$TARGET
|
||||
fi
|
||||
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 ${kbddir}/consolefonts/$SYSFONT.* ; do
|
||||
inst "$FN"
|
||||
case $FN in
|
||||
*.gz) gzip -d "$initdir$FN" ;;
|
||||
*.bz2) bzip2 -d "$initdir$FN" ;;
|
||||
esac
|
||||
done
|
||||
[[ $SYSFONTACM ]] && inst ${kbddir}/consoletrans/$SYSFONTACM
|
||||
[[ $UNIMAP ]] && inst ${kbddir}/unimaps/$UNIMAP
|
||||
fi
|
||||
}
|
||||
|
||||
for kbddir in /usr/lib/kbd /lib/kbd; do
|
||||
[[ -d ${kbddir} ]] && break
|
||||
done
|
||||
|
||||
if [[ $hostonly ]]; then
|
||||
install_local
|
||||
else
|
||||
for i in $(find ${kbddir} -type f -print); do
|
||||
dracut_install $i
|
||||
done
|
||||
# remove unnecessary files
|
||||
rm -f "$initdir${kbddir}/consoletrans/utflist" 2>/dev/null
|
||||
find "$initdir${kbddir}/" -name README\* -exec rm -f '{}' \;
|
||||
dracut_install gzip bzip2
|
||||
fi
|
||||
|
||||
dracut_install /lib/udev/console_init
|
||||
dracut_install setfont loadkeys
|
||||
inst_rules 10-console.rules
|
||||
inst_hook cmdline 20 "$moddir/parse-i18n.sh"
|
@@ -1,20 +0,0 @@
|
||||
inst_key_val()
|
||||
{
|
||||
local value
|
||||
value=$(getarg $1)
|
||||
[ -n "$value" ] && printf '%s="%s"\n' $1 $value >> $2
|
||||
}
|
||||
|
||||
mkdir -p /etc/sysconfig
|
||||
inst_key_val KEYBOARDTYPE /etc/sysconfig/keyboard
|
||||
inst_key_val KEYTABLE /etc/sysconfig/keyboard
|
||||
inst_key_val SYSFONT /etc/sysconfig/i18n
|
||||
inst_key_val SYSFONTACM /etc/sysconfig/i18n
|
||||
inst_key_val UNIMAP /etc/sysconfig/i18n
|
||||
inst_key_val LANG /etc/sysconfig/i18n
|
||||
|
||||
if [ -f /etc/sysconfig/i18n ]; then
|
||||
. /etc/sysconfig/i18n
|
||||
export LANG
|
||||
fi
|
||||
|
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
[ -f /etc/redhat-release ]
|
||||
|
@@ -1,11 +0,0 @@
|
||||
if [ -e "$moddir/dracut-version" ]; then
|
||||
dracut_rpm_version=$(cat "$moddir/dracut-version")
|
||||
inst "$moddir/dracut-version" /$dracut_rpm_version
|
||||
else
|
||||
if rpm -qf $(which $0) &>/dev/null; then
|
||||
dracut_rpm_version=$(rpm -qf --qf '%{name}-%{version}-%{release}\n' $(which $0) | { ver="";while read line;do ver=$line;done;echo $ver;} )
|
||||
echo $dracut_rpm_version > $initdir/$dracut_rpm_version
|
||||
fi
|
||||
fi
|
||||
inst_hook cmdline 01 "$moddir/version.sh"
|
||||
|
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"
|
||||
|
||||
}
|
||||
|
5
modules.d/10rpmversion/version.sh
Normal file → Executable file
5
modules.d/10rpmversion/version.sh
Normal file → Executable file
@@ -1,4 +1,7 @@
|
||||
for i in dracut-*; do
|
||||
#!/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
|
||||
|
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
. $dracutfunctions
|
||||
|
||||
for program in ip arping; do
|
||||
which $program >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
dwarning "Could not find program \"$program\" required by network."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
for program in dhclient brctl; do
|
||||
which $program >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
dwarning "Could not find program \"$program\" it might be required by network."
|
||||
fi
|
||||
done
|
||||
exit 255
|
||||
|
@@ -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
|
||||
@@ -20,12 +22,12 @@ setup_interface() {
|
||||
# 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"
|
||||
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
|
||||
@@ -34,23 +36,19 @@ setup_interface() {
|
||||
|
||||
[ -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 "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
|
||||
@@ -60,23 +58,25 @@ netif=$interface
|
||||
|
||||
case $reason in
|
||||
PREINIT)
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
;;
|
||||
echo "dhcp: PREINIT $netif up"
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
;;
|
||||
BOUND)
|
||||
if ! arping -q -D -c 2 -I $netif $new_ip_address ; then
|
||||
warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying"
|
||||
exit 1
|
||||
fi
|
||||
setup_interface
|
||||
set | while read line; do
|
||||
[ "${line#new_}" = "$line" ] && continue
|
||||
echo "$line"
|
||||
done >/tmp/dhclient.$netif.dhcpopts
|
||||
echo online > /sys/class/net/$netif/uevent
|
||||
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
|
||||
;;
|
||||
*) ;;
|
||||
echo "dhcp: 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,15 +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 ]' > /initqueue-finished/dhcp.sh
|
||||
echo '[ -d $NEWROOT/proc -o -e /dev/root ]' > $hookdir/initqueue/finished/dhcp.sh
|
||||
fi
|
||||
|
@@ -1,21 +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
|
||||
echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="?*", ATTR{type}=="1", NAME="%k"' \
|
||||
> /etc/udev/rules.d/50-ifname.rules
|
||||
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"
|
||||
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"
|
||||
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,60 +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() {
|
||||
strstr $ip '*:*:*' && load_ipv6
|
||||
|
||||
{
|
||||
echo ip link set $netif up
|
||||
echo wait_for_if_up $netif
|
||||
echo ip addr flush dev $netif
|
||||
echo ip addr add $ip/$mask dev $netif
|
||||
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 "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
|
||||
namesrv=$(getargs nameserver)
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
|
||||
echo online > /sys/class/net/$netif/uevent
|
||||
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
|
||||
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
|
||||
@@ -62,11 +90,25 @@ 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
|
||||
netif="$bridgename"
|
||||
if [ "$netif" = "$bondname" ] && [ -n "$DO_BOND_SETUP" ] ; then
|
||||
: # We need to really setup bond (recursive call)
|
||||
else
|
||||
netif="$bridgename"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -85,11 +127,62 @@ 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
|
||||
ip link set $ethname up
|
||||
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
|
||||
@@ -99,25 +192,41 @@ 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
|
||||
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,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
dracut_install ip dhclient brctl arping
|
||||
inst "$moddir/ifup" "/sbin/ifup"
|
||||
inst "$moddir/netroot" "/sbin/netroot"
|
||||
inst "$moddir/dhclient-script" "/sbin/dhclient-script"
|
||||
inst "$moddir/dhclient.conf" "/etc/dhclient.conf"
|
||||
inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
|
||||
inst_hook pre-udev 60 "$moddir/net-genrules.sh"
|
||||
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
|
||||
inst_hook cmdline 99 "$moddir/parse-ip-opts.sh"
|
||||
inst_hook cmdline 98 "$moddir/parse-bridge.sh"
|
||||
inst_hook cmdline 99 "$moddir/parse-ifname.sh"
|
||||
inst_hook pre-pivot 10 "$moddir/kill-dhclient.sh"
|
@@ -1,16 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Include wired net drivers, excluding wireless
|
||||
|
||||
net_module_test() {
|
||||
local net_drivers='eth_type_trans|register_virtio_device'
|
||||
local unwanted_drivers='/(wireless|isdn|uwb)/'
|
||||
nm -uPA "$1" | egrep -q $net_drivers && \
|
||||
nm -uPA "$1" | egrep -qv 'iw_handler_get_spy' && \
|
||||
[[ ! $1 =~ $unwanted_drivers ]]
|
||||
}
|
||||
|
||||
instmods $(filter_kernel_modules net_module_test)
|
||||
|
||||
instmods ecb arc4
|
||||
# bridge modules
|
||||
instmods bridge stp llc
|
@@ -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 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 "$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
|
||||
}
|
||||
|
||||
@@ -20,21 +24,28 @@ fix_bootif() {
|
||||
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", NAME=="%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
|
||||
|
||||
} > /etc/udev/rules.d/60-net.rules
|
||||
|
@@ -1,8 +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
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
# Huh? Empty $1?
|
||||
[ -z "$1" ] && exit 1
|
||||
@@ -18,41 +20,42 @@ PATH=$PATH:/sbin:/usr/sbin
|
||||
[ -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
|
||||
|
||||
@@ -62,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
|
||||
@@ -81,21 +84,40 @@ done
|
||||
[ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
||||
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||
|
||||
# Handle STP Timeout: arping default router or if not available the
|
||||
# root server. Note: This assumes that if no router is present the
|
||||
# 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
|
||||
# TODO There's some netroot variants that don't (yet) have their
|
||||
# server-ip netroot
|
||||
[ -n "$new_routers" ] && dest=${new_routers%%,*}
|
||||
[ -n "$gw" ] && dest=$gw
|
||||
if [ -z "$dest" ] ; then
|
||||
|
||||
# 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]*) dest=$dummy;;
|
||||
[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
|
||||
@@ -108,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
|
@@ -1,18 +1,20 @@
|
||||
#!/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=<bridgename>:<ethname>
|
||||
#
|
||||
# bridge without parameters assumes bridge=br0:eth0
|
||||
# bridge without parameters assumes bridge=br0:eth0
|
||||
#
|
||||
|
||||
# return if bridge already parsed
|
||||
[ -n "$bridgename" ] && return
|
||||
|
||||
# Check if bridge parameter is valid
|
||||
# Check if bridge parameter is valid
|
||||
if getarg bridge= >/dev/null ; then
|
||||
if [ -z "$netroot" ] ; then
|
||||
die "No netboot configured, bridge is invalid"
|
||||
die "No netboot configured, bridge is invalid"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -26,26 +28,33 @@ parsebridge() {
|
||||
|
||||
unset bridgename ethname
|
||||
case $# in
|
||||
0) bridgename=br0; ethname=eth0 ;;
|
||||
1) die "bridge= requires two parameters" ;;
|
||||
2) bridgename=$1; ethname=$2 ;;
|
||||
*) die "bridge= requires two parameters" ;;
|
||||
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 getarg bridge >/dev/null; then
|
||||
if bridge="$(getarg bridge)"; then
|
||||
# Read bridge= parameters if they exist
|
||||
bridge="$(getarg bridge=)"
|
||||
if [ ! "$bridge" = "bridge" ]; then
|
||||
parsebridge "$(getarg bridge=)"
|
||||
if [ -n "$bridge" ]; then
|
||||
parsebridge $bridge
|
||||
fi
|
||||
# Simple default bridge
|
||||
if [ -z "$bridgename" ]; then
|
||||
bridgename=br0
|
||||
ethname=eth0
|
||||
ethname=$iface
|
||||
fi
|
||||
echo "bridgename=$bridgename" > /tmp/bridge.info
|
||||
echo "ethname=$ethname" >> /tmp/bridge.info
|
||||
|
@@ -1,7 +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
|
||||
#
|
||||
# Format:
|
||||
# ifname=<interface>:<mac>
|
||||
# ifname=<interface>:<mac>
|
||||
#
|
||||
# Note letters in the macaddress must be lowercase!
|
||||
#
|
||||
|
@@ -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
|
||||
|
||||
@@ -54,7 +40,7 @@ fi
|
||||
if [ -z "$NEEDBOOTDEV" ] ; then
|
||||
local count=0
|
||||
for p in $(getargs ip=); do
|
||||
count=$(( $count + 1 ))
|
||||
count=$(( $count + 1 ))
|
||||
done
|
||||
[ $count -gt 1 ] && NEEDBOOTDEV=1
|
||||
fi
|
||||
@@ -65,48 +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
|
||||
for p in $(getargs ip=); do
|
||||
ip_to_var $p
|
||||
|
||||
# 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 '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"
|
||||
;;
|
||||
dhcp|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'";;
|
||||
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 'ip=$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
|
||||
@@ -114,21 +142,21 @@ for p in $(getargs ip=); 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
|
||||
@@ -137,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=
|
||||
# We need a ip= line for the configured bootdev=
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$BOOTDEVOK" ] && die "Bootdev Argument '$BOOTDEV' not found"
|
||||
|
@@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
[ -d /etc/sysconfig/network-scripts/ ] || exit 1
|
||||
|
||||
[[ $1 = -d ]] && echo network
|
||||
|
||||
exit 255
|
@@ -1,2 +0,0 @@
|
||||
#!/bin/bash
|
||||
inst_hook pre-pivot 85 "$moddir/write-ifcfg.sh"
|
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"
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user