Compare commits
671 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c67b624637 | ||
![]() |
62f3a10d5d | ||
![]() |
1edf54e275 | ||
![]() |
c8ebb80590 | ||
![]() |
d87ae13721 | ||
![]() |
c3f241849d | ||
![]() |
c17c5b7604 | ||
![]() |
34c73b339b | ||
![]() |
6f7823bce6 | ||
![]() |
805b46c2a8 | ||
![]() |
d437970c01 | ||
![]() |
f8b38ecd7c | ||
![]() |
5387ed24c8 | ||
![]() |
9e1c7f3dea | ||
![]() |
2c9debec02 | ||
![]() |
895c2f65d4 | ||
![]() |
3fce68bd1d | ||
![]() |
1a604e2a4a | ||
![]() |
0b86c0607f | ||
![]() |
095b77bee8 | ||
![]() |
d85c71fb69 | ||
![]() |
ebac18baad | ||
![]() |
ad64c6864c | ||
![]() |
cdb714c539 | ||
![]() |
994d003540 | ||
![]() |
63356d544b | ||
![]() |
2d4344bca9 | ||
![]() |
41cfdfc4d3 | ||
![]() |
510a22116b | ||
![]() |
2c10b29999 | ||
![]() |
7b59d15d96 | ||
![]() |
dd8ff5311f | ||
![]() |
6dc1cd052b | ||
![]() |
7310a8484e | ||
![]() |
3483509ef6 | ||
![]() |
aa225ca3b0 | ||
![]() |
6510ab3f9d | ||
![]() |
73f5cc7c37 | ||
![]() |
119bb1b81d | ||
![]() |
18ff79021c | ||
![]() |
060732d927 | ||
![]() |
9ea66e5682 | ||
![]() |
9eb77ff864 | ||
![]() |
10d01cc45d | ||
![]() |
a1b3c13e3a | ||
![]() |
dbdd7ad4c1 | ||
![]() |
9fb16311a4 | ||
![]() |
748293ff56 | ||
![]() |
d18e808358 | ||
![]() |
865390c7ca | ||
![]() |
d4b1d669d7 | ||
![]() |
9c0deb9f68 | ||
![]() |
ce15ca57a2 | ||
![]() |
cfac3a5675 | ||
![]() |
48cc484a4b | ||
![]() |
e4b1460433 | ||
![]() |
760a4370f0 | ||
![]() |
33e9727ee7 | ||
![]() |
87ea36797f | ||
![]() |
b29b9e9627 | ||
![]() |
819b24fe2e | ||
![]() |
d586ff7001 | ||
![]() |
6e70e9f1b1 | ||
![]() |
8eef563f71 | ||
![]() |
7b1d342e60 | ||
![]() |
9c4662d02b | ||
![]() |
0b920b83f2 | ||
![]() |
891ca19c49 | ||
![]() |
7bfe7daa51 | ||
![]() |
0412f42771 | ||
![]() |
5feb62872e | ||
![]() |
cdf03476d1 | ||
![]() |
10f3b19606 | ||
![]() |
e7b4442cfc | ||
![]() |
6d2574d509 | ||
![]() |
aa05b741e3 | ||
![]() |
f9cbd928ce | ||
![]() |
47f3a3d56d | ||
![]() |
e9053b1886 | ||
![]() |
4e3133e622 | ||
![]() |
4e3332ffa8 | ||
![]() |
e770ad31a6 | ||
![]() |
802f8b6218 | ||
![]() |
ecf7e74f4a | ||
![]() |
785d1a1ede | ||
![]() |
22fceeac80 | ||
![]() |
fb7b8be883 | ||
![]() |
f4053eb0c8 | ||
![]() |
7356c828b0 | ||
![]() |
95013ffce9 | ||
![]() |
836e2ffac6 | ||
![]() |
67bcc49304 | ||
![]() |
dbb8a98b29 | ||
![]() |
0f807f49cf | ||
![]() |
79ed45e021 | ||
![]() |
9edabfa600 | ||
![]() |
5cd1a9fb13 | ||
![]() |
dc00256e12 | ||
![]() |
ba3f4cdadc | ||
![]() |
51b36f56d8 | ||
![]() |
dff9baf3b4 | ||
![]() |
ba2e760b91 | ||
![]() |
b56448ba09 | ||
![]() |
1ebf454884 | ||
![]() |
fdbe7f9fbf | ||
![]() |
38ef319390 | ||
![]() |
45907c1d4d | ||
![]() |
35bd0b4ac1 | ||
![]() |
a6faf453a8 | ||
![]() |
16efdfa25c | ||
![]() |
1914a2eba1 | ||
![]() |
786ca932e8 | ||
![]() |
b28e4b20f0 | ||
![]() |
c46ed697a2 | ||
![]() |
fa06924239 | ||
![]() |
d1c8083b3a | ||
![]() |
702e7e83ed | ||
![]() |
767fbf81b6 | ||
![]() |
18d36fabf5 | ||
![]() |
433a9ec014 | ||
![]() |
bbe1434fca | ||
![]() |
03d132a76c | ||
![]() |
ddcdee9147 | ||
![]() |
c409108b04 | ||
![]() |
6eff0ebcf8 | ||
![]() |
07c671cc51 | ||
![]() |
c3446a7ce0 | ||
![]() |
7135c81931 | ||
![]() |
38cd8125f6 | ||
![]() |
791f392ca6 | ||
![]() |
6032ade3cc | ||
![]() |
0ce79d4c72 | ||
![]() |
860b64b92d | ||
![]() |
0f62da0405 | ||
![]() |
1211d6a3fb | ||
![]() |
457e7b7a4a | ||
![]() |
e918f337b6 | ||
![]() |
8a2edb1e4d | ||
![]() |
4026cd3b01 | ||
![]() |
30e49d5175 | ||
![]() |
29e269a522 | ||
![]() |
62d52ad2be | ||
![]() |
c35cbd2e56 | ||
![]() |
939b7e11d5 | ||
![]() |
9553a679f6 | ||
![]() |
1149ed2a3e | ||
![]() |
68dd8af21d | ||
![]() |
bf1a2262ea | ||
![]() |
be30c816d4 | ||
![]() |
a2472e6e60 | ||
![]() |
24ea839079 | ||
![]() |
f824f52675 | ||
![]() |
3c8ca29650 | ||
![]() |
21ee81bfbd | ||
![]() |
7b3c6e1bb0 | ||
![]() |
b955dbf4a9 | ||
![]() |
911c2de9c3 | ||
![]() |
560f45b15f | ||
![]() |
951c6655f1 | ||
![]() |
a47c3f50b6 | ||
![]() |
db36338053 | ||
![]() |
093bc9b5cf | ||
![]() |
8b5a6b91be | ||
![]() |
dd9288bb62 | ||
![]() |
66c27a6d85 | ||
![]() |
1acf52b60e | ||
![]() |
f3cbff1113 | ||
![]() |
c93df5e0ea | ||
![]() |
58d57fc977 | ||
![]() |
77630365ae | ||
![]() |
f1739d4236 | ||
![]() |
33920ee6b0 | ||
![]() |
08ff88f234 | ||
![]() |
28d0fc9347 | ||
![]() |
7c50ed83a3 | ||
![]() |
1ed4b9f100 | ||
![]() |
e473057ae1 | ||
![]() |
b3e55bde30 | ||
![]() |
8cceee8059 | ||
![]() |
5f0d35b665 | ||
![]() |
3a12309c0d | ||
![]() |
cb495a073e | ||
![]() |
7c2521091f | ||
![]() |
6fee16eab0 | ||
![]() |
209f157d2a | ||
![]() |
f57b1b9368 | ||
![]() |
09eb4de3d4 | ||
![]() |
1517f4c504 | ||
![]() |
983aee0ef1 | ||
![]() |
7825c32bd6 | ||
![]() |
5fc7c05321 | ||
![]() |
ed7ce0d64f | ||
![]() |
e1845955ff | ||
![]() |
f8f3b0f358 | ||
![]() |
8c8af8a2cd | ||
![]() |
4339d47cf8 | ||
![]() |
1a5845b45f | ||
![]() |
952c2e4e9b | ||
![]() |
6685d99448 | ||
![]() |
3aec4fca0b | ||
![]() |
6b8ee4fc37 | ||
![]() |
5840c466dc | ||
![]() |
e0524af2bf | ||
![]() |
1ec85e5232 | ||
![]() |
a23a4680e7 | ||
![]() |
0f89c0dff6 | ||
![]() |
09804a4629 | ||
![]() |
831e310adf | ||
![]() |
5698258d30 | ||
![]() |
3b45c7e1a0 | ||
![]() |
5817934936 | ||
![]() |
6375d5d504 | ||
![]() |
5a49fd3656 | ||
![]() |
cbafcd0fc7 | ||
![]() |
ab17cb8515 | ||
![]() |
c69961b403 | ||
![]() |
1e92f7285d | ||
![]() |
e4483e5917 | ||
![]() |
83c65fd3db | ||
![]() |
c050190f86 | ||
![]() |
8f56daa8c3 | ||
![]() |
9fb2431a88 | ||
![]() |
12ab0dce66 | ||
![]() |
f51d013384 | ||
![]() |
512c51d267 | ||
![]() |
7990ab91f9 | ||
![]() |
a298f5f285 | ||
![]() |
811c814677 | ||
![]() |
7ea391b527 | ||
![]() |
7c923f1de8 | ||
![]() |
251b424727 | ||
![]() |
0e2ef80993 | ||
![]() |
f0ac6cb462 | ||
![]() |
e9a614b50c | ||
![]() |
4087fd4d1a | ||
![]() |
ee9b9b1241 | ||
![]() |
4916dfc2b9 | ||
![]() |
ee6ce31003 | ||
![]() |
9eb1d1ed5e | ||
![]() |
dee4f26adc | ||
![]() |
5afd3cfc96 | ||
![]() |
89cd7a4629 | ||
![]() |
38ea7e821b | ||
![]() |
f3e328a7fd | ||
![]() |
37502d4c89 | ||
![]() |
39d90012a6 | ||
![]() |
d76e9ad5d7 | ||
![]() |
f87605e3ab | ||
![]() |
a5372b8ba8 | ||
![]() |
ff2d8bdfb3 | ||
![]() |
d418e292e3 | ||
![]() |
ff78577d3f | ||
![]() |
d2b3289aa5 | ||
![]() |
de27127752 | ||
![]() |
0132527b8f | ||
![]() |
455c5dbd35 | ||
![]() |
cd1a002512 | ||
![]() |
b7a7735c1d | ||
![]() |
fece5bfcac | ||
![]() |
d795211778 | ||
![]() |
497916e13b | ||
![]() |
3b92d8bf84 | ||
![]() |
1855efb15a | ||
![]() |
e096d861ed | ||
![]() |
da4c9a950f | ||
![]() |
31d0b55b86 | ||
![]() |
dae2759e61 | ||
![]() |
fe761330e5 | ||
![]() |
f7e924c577 | ||
![]() |
74f83fb9f3 | ||
![]() |
5da70385bc | ||
![]() |
c4f2b11b89 | ||
![]() |
0e30f33a32 | ||
![]() |
3f4771ebf4 | ||
![]() |
fc1d50b270 | ||
![]() |
cafd314b70 | ||
![]() |
ac733934fa | ||
![]() |
2be5e3ac4c | ||
![]() |
9521b435d0 | ||
![]() |
64748b3383 | ||
![]() |
76d8b30f4e | ||
![]() |
4cd8f2c90e | ||
![]() |
3b20f5c72e | ||
![]() |
27047bb5c6 | ||
![]() |
80f1ce6c13 | ||
![]() |
376ce85105 | ||
![]() |
01b7163a59 | ||
![]() |
fea53784ad | ||
![]() |
f84ad9e062 | ||
![]() |
3f5bf54fbf | ||
![]() |
09a691af3b | ||
![]() |
d9e27b0917 | ||
![]() |
ae83919a7a | ||
![]() |
4159819fbb | ||
![]() |
cfd872392c | ||
![]() |
3a2beb037c | ||
![]() |
dc9596155d | ||
![]() |
acc782bad5 | ||
![]() |
5c025a7d2a | ||
![]() |
07417b7fc5 | ||
![]() |
30ea52f88c | ||
![]() |
e902207014 | ||
![]() |
480aa9695f | ||
![]() |
fe02bc78ac | ||
![]() |
880d155967 | ||
![]() |
6dbae7e772 | ||
![]() |
ceca74ccc3 | ||
![]() |
019610af26 | ||
![]() |
63b05a8e67 | ||
![]() |
fa1b98e4ea | ||
![]() |
05ce5c41b6 | ||
![]() |
f7ad1479f2 | ||
![]() |
0cf01f125a | ||
![]() |
8cb5ac1b30 | ||
![]() |
d9149c6ca7 | ||
![]() |
c437933cb0 | ||
![]() |
e1130a8340 | ||
![]() |
0c1bd016ec | ||
![]() |
317d841c78 | ||
![]() |
5cb2a4004d | ||
![]() |
38ba90bf88 | ||
![]() |
265f696b53 | ||
![]() |
d8d5cb839c | ||
![]() |
3b869230a0 | ||
![]() |
46f3156426 | ||
![]() |
5a4c346933 | ||
![]() |
de3cb0e321 | ||
![]() |
6dafdda4a6 | ||
![]() |
5c3d0a9647 | ||
![]() |
6e1e87cd25 | ||
![]() |
55b0d2edaf | ||
![]() |
2f03d69f9d | ||
![]() |
5f8063c6f2 | ||
![]() |
871d63c3be | ||
![]() |
eb770a4a20 | ||
![]() |
7169e5f0e4 | ||
![]() |
c800d1a7b9 | ||
![]() |
b448655ba7 | ||
![]() |
50cc23ba32 | ||
![]() |
f769154bcc | ||
![]() |
2a61132865 | ||
![]() |
424f01e2a0 | ||
![]() |
1ec7b694b5 | ||
![]() |
ff366790a6 | ||
![]() |
32dfd41688 | ||
![]() |
cb9e6881dd | ||
![]() |
c6a2ebffe5 | ||
![]() |
5bfebf0f04 | ||
![]() |
586a56c287 | ||
![]() |
faea4e4ddb | ||
![]() |
7dd8a2f4d3 | ||
![]() |
49c4172f4e | ||
![]() |
87bffc36e7 | ||
![]() |
3a4a212649 | ||
![]() |
de34ba76e5 | ||
![]() |
8e1a4dc5f8 | ||
![]() |
25c7a13985 | ||
![]() |
872eb69936 | ||
![]() |
11474b808b | ||
![]() |
3b626094bd | ||
![]() |
b8a92b7156 | ||
![]() |
3a043feea1 | ||
![]() |
b68930ed3d | ||
![]() |
defb1611c7 | ||
![]() |
db44331dc4 | ||
![]() |
c490ea8b2b | ||
![]() |
dfe2247a43 | ||
![]() |
17d62d1206 | ||
![]() |
97a931c7d9 | ||
![]() |
91418b13dc | ||
![]() |
ca8ca19091 | ||
![]() |
7069132ec7 | ||
![]() |
3b396a7d50 | ||
![]() |
d5bfaf58ab | ||
![]() |
a22ab24d53 | ||
![]() |
3dcaa97ca4 | ||
![]() |
fc6f458c3b | ||
![]() |
0402b3777b | ||
![]() |
058739bf69 | ||
![]() |
8446c8f9de | ||
![]() |
7fb8f939a5 | ||
![]() |
a76aa8e390 | ||
![]() |
2293609dcb | ||
![]() |
bc1e69b691 | ||
![]() |
0386e46277 | ||
![]() |
7a04712ad0 | ||
![]() |
db9b5851f3 | ||
![]() |
5a720ebf67 | ||
![]() |
18420d9ce5 | ||
![]() |
7ef5ead6f4 | ||
![]() |
eb8a7a9635 | ||
![]() |
9e68789d66 | ||
![]() |
3ba12b2249 | ||
![]() |
00efe708ca | ||
![]() |
0c983cdc49 | ||
![]() |
821e08da03 | ||
![]() |
ebeed55c07 | ||
![]() |
991100ba7a | ||
![]() |
f2d33a7f61 | ||
![]() |
7dc918cad1 | ||
![]() |
452cb40497 | ||
![]() |
286f2a04a1 | ||
![]() |
38c8fed48a | ||
![]() |
5b1d8bcc58 | ||
![]() |
c7403700df | ||
![]() |
ce62465caf | ||
![]() |
b3d40a4390 | ||
![]() |
3d2a6d29d4 | ||
![]() |
1edee0c4a1 | ||
![]() |
ecbdff68af | ||
![]() |
3ea80545d6 | ||
![]() |
ef8915d7af | ||
![]() |
7261a0540a | ||
![]() |
11a5501d0f | ||
![]() |
355df861da | ||
![]() |
8cba0ff833 | ||
![]() |
f1dc2180d4 | ||
![]() |
3f4ffebf33 | ||
![]() |
d5088b1703 | ||
![]() |
9ca53063ee | ||
![]() |
69341c9572 | ||
![]() |
55a974bae6 | ||
![]() |
3703ec8672 | ||
![]() |
74ba8f9e1d | ||
![]() |
a3f73298f2 | ||
![]() |
4b60a34715 | ||
![]() |
7374391434 | ||
![]() |
c6c588d648 | ||
![]() |
77537bf2d7 | ||
![]() |
7c51256eb2 | ||
![]() |
ba66cb2789 | ||
![]() |
2d75433cd7 | ||
![]() |
58ee6dc7f9 | ||
![]() |
0d33ba030b | ||
![]() |
63b67a48f9 | ||
![]() |
4bd0ab61b2 | ||
![]() |
b4de4f287f | ||
![]() |
eb8856a58c | ||
![]() |
3c5036a62f | ||
![]() |
074ac62576 | ||
![]() |
53e299e6f4 | ||
![]() |
2996d9e56f | ||
![]() |
2f78bafa4b | ||
![]() |
f7b9356c9e | ||
![]() |
3aae122c4b | ||
![]() |
93be2bc6ab | ||
![]() |
a8ba1c4e25 | ||
![]() |
4985aa8c6e | ||
![]() |
7795fde44c | ||
![]() |
2dc0cb50e3 | ||
![]() |
150cea0336 | ||
![]() |
4237aeb040 | ||
![]() |
16abea2592 | ||
![]() |
c7ee6b3dbb | ||
![]() |
cdc9cd0e41 | ||
![]() |
76f6566fd7 | ||
![]() |
962310483f | ||
![]() |
579fbb9fc4 | ||
![]() |
f668e7174e | ||
![]() |
1bef2934d7 | ||
![]() |
350ec5d9dd | ||
![]() |
d613d88dd2 | ||
![]() |
2ee69a40c8 | ||
![]() |
d0de58f232 | ||
![]() |
f4ad2e5c89 | ||
![]() |
cb86c560b0 | ||
![]() |
70b19acf94 | ||
![]() |
d5e818f349 | ||
![]() |
4598b5540e | ||
![]() |
5965710e01 | ||
![]() |
05b75703b0 | ||
![]() |
7fea85ce5f | ||
![]() |
2181c80c91 | ||
![]() |
212043f94d | ||
![]() |
958ca9e912 | ||
![]() |
7d47d1c423 | ||
![]() |
ff2043fb42 | ||
![]() |
8996d3dfcd | ||
![]() |
c226bfdda7 | ||
![]() |
9a752007b3 | ||
![]() |
80238086ab | ||
![]() |
50057af19c | ||
![]() |
e863807685 | ||
![]() |
f3f081e542 | ||
![]() |
c9391e8f6a | ||
![]() |
031e949c62 | ||
![]() |
10f8438c1e | ||
![]() |
f5d48a31db | ||
![]() |
fe54c9b7a9 | ||
![]() |
41a37bc626 | ||
![]() |
cf31ed2ae6 | ||
![]() |
62f27ee6f1 | ||
![]() |
718aefda13 | ||
![]() |
6e761674ad | ||
![]() |
687e17aa7f | ||
![]() |
3f4bbca751 | ||
![]() |
cc6792a01e | ||
![]() |
ca4aa84851 | ||
![]() |
ba813779bf | ||
![]() |
9e759aa969 | ||
![]() |
27f758e12c | ||
![]() |
4efcd19a4e | ||
![]() |
0595a79b19 | ||
![]() |
9d88e89350 | ||
![]() |
b552d364a3 | ||
![]() |
a01204202b | ||
![]() |
89bc1aa324 | ||
![]() |
0d609ae274 | ||
![]() |
7ff0fcb723 | ||
![]() |
feebf17187 | ||
![]() |
e3edd247ce | ||
![]() |
916ac45cbe | ||
![]() |
0bac59ee5e | ||
![]() |
fb3d292800 | ||
![]() |
1b38fa412c | ||
![]() |
66bfa66add | ||
![]() |
678627f349 | ||
![]() |
3c8c807db1 | ||
![]() |
78efd6988e | ||
![]() |
1aa2d1eddf | ||
![]() |
519186e9e6 | ||
![]() |
64082786b2 | ||
![]() |
159175d525 | ||
![]() |
9b9dd9993e | ||
![]() |
c0e5e48aab | ||
![]() |
28749d9973 | ||
![]() |
ac7582af48 | ||
![]() |
0d5597044f | ||
![]() |
5fbe772b44 | ||
![]() |
906896e220 | ||
![]() |
f551886f5c | ||
![]() |
1ab6778ee4 | ||
![]() |
7f0b48627a | ||
![]() |
5d88809319 | ||
![]() |
da36b76ab0 | ||
![]() |
a69e6c4eae | ||
![]() |
daa49cc221 | ||
![]() |
224175d8bc | ||
![]() |
b4769b332d | ||
![]() |
72ae1c4fe7 | ||
![]() |
8e9b094b21 | ||
![]() |
8a063c50a3 | ||
![]() |
c9b3c89f94 | ||
![]() |
1fcc70fe57 | ||
![]() |
5e7ef0ab3d | ||
![]() |
42d93d3482 | ||
![]() |
22c8a5c73f | ||
![]() |
ce0344d325 | ||
![]() |
920048ff50 | ||
![]() |
31e18286fc | ||
![]() |
4a8ad28808 | ||
![]() |
9dd9329f7a | ||
![]() |
3436067663 | ||
![]() |
f39aa529c5 | ||
![]() |
0a01086456 | ||
![]() |
707d4e79fe | ||
![]() |
7a3d661971 | ||
![]() |
04ff0a1bae | ||
![]() |
4d573e3be0 | ||
![]() |
4e2cc49d75 | ||
![]() |
8084f3f66d | ||
![]() |
cd181d2c4c | ||
![]() |
ead8729b44 | ||
![]() |
b1c5cae63f | ||
![]() |
38b4f4b21c | ||
![]() |
f4e38c0da8 | ||
![]() |
999cfa8458 | ||
![]() |
b91d3f15bf | ||
![]() |
5b2258ea0d | ||
![]() |
44fb598605 | ||
![]() |
6a74c03b4a | ||
![]() |
d1afff43ae | ||
![]() |
23acf15227 | ||
![]() |
b355c7a532 | ||
![]() |
960d8726db | ||
![]() |
ce4d04bf72 | ||
![]() |
b6b1bf9202 | ||
![]() |
b988934a38 | ||
![]() |
b2616b5268 | ||
![]() |
12f023ab03 | ||
![]() |
c30070c8f5 | ||
![]() |
c8b35bf96a | ||
![]() |
305c6f91bb | ||
![]() |
393fb1ac05 | ||
![]() |
9dfd73bcbd | ||
![]() |
2b1b3bcdcb | ||
![]() |
70787ab619 | ||
![]() |
35efada5ec | ||
![]() |
381ab6b7cd | ||
![]() |
4be95b67a7 | ||
![]() |
5e0f8c8a4c | ||
![]() |
e318ba30fb | ||
![]() |
d9721f20d8 | ||
![]() |
3e53195bce | ||
![]() |
11e1f68065 | ||
![]() |
c21c1d459e | ||
![]() |
43c8c4ce04 | ||
![]() |
7b76fa924d | ||
![]() |
7934c6f918 | ||
![]() |
c27ed38bb2 | ||
![]() |
5a962b5939 | ||
![]() |
705eb4eeb2 | ||
![]() |
cbf3200885 | ||
![]() |
adee5b97bc | ||
![]() |
42e004feb9 | ||
![]() |
91c15babdf | ||
![]() |
4996e53ed3 | ||
![]() |
84c862d8f3 | ||
![]() |
3e67623ab5 | ||
![]() |
86f4dd0273 | ||
![]() |
19e5758590 | ||
![]() |
f6bbd024d9 | ||
![]() |
ab703f44b4 | ||
![]() |
a0d9ad6f70 | ||
![]() |
90ac0a2d77 | ||
![]() |
dddcb80945 | ||
![]() |
d10f6f8367 | ||
![]() |
9f561c54c7 | ||
![]() |
4f19427641 | ||
![]() |
8c6ab479ab | ||
![]() |
9cc1b76087 | ||
![]() |
dc86c12c45 | ||
![]() |
9f96bb4c73 | ||
![]() |
62f939b857 | ||
![]() |
8238f41b34 | ||
![]() |
7a2503ab8c | ||
![]() |
8365177644 | ||
![]() |
33cfad0b8f | ||
![]() |
5916d31b24 | ||
![]() |
fc141f2286 | ||
![]() |
0d08f43d71 | ||
![]() |
94eccd15c5 | ||
![]() |
ad906d85ea | ||
![]() |
38ccf7c8e5 | ||
![]() |
53cb081b4c | ||
![]() |
44f2fe5170 | ||
![]() |
58e0d2d5b5 | ||
![]() |
7c6d2ad916 | ||
![]() |
fca93eac19 | ||
![]() |
88820dc781 | ||
![]() |
1ff306a396 | ||
![]() |
32f68c1f9a | ||
![]() |
61afc70454 | ||
![]() |
09d2a1605b | ||
![]() |
7e944c77c0 | ||
![]() |
f9c96cf56f | ||
![]() |
a3ad33daf9 | ||
![]() |
ebe1821635 | ||
![]() |
b8a8d7a64e | ||
![]() |
712f471ebf | ||
![]() |
c38f9e980c | ||
![]() |
f6e3b59e5e | ||
![]() |
fb280834d7 | ||
![]() |
a6bc200c28 | ||
![]() |
79a17b0112 | ||
![]() |
76522d58c3 | ||
![]() |
01ffcf342a | ||
![]() |
05dc158e3c | ||
![]() |
a60af53413 | ||
![]() |
f18d069d46 | ||
![]() |
48c283a296 | ||
![]() |
0eef73ea43 | ||
![]() |
765b20333d | ||
![]() |
b38b7fef36 | ||
![]() |
7117bf6270 | ||
![]() |
e54ab383f7 | ||
![]() |
b9af0fcdfb | ||
![]() |
83cbc06ab9 | ||
![]() |
db4d6bb42c | ||
![]() |
f51ab4a81f | ||
![]() |
6d886bb74d |
@@ -1,7 +1,25 @@
|
||||
;;; Directory Local Variables
|
||||
;;; For more information see (info "(emacs) Directory Variables")
|
||||
|
||||
((sh-mode
|
||||
(indent-tabs-mode)
|
||||
(sh-basic-offset . 4)))
|
||||
; Directory Local Variables
|
||||
; For more information see (info "(emacs) Directory Variables")
|
||||
; Sets emacs variables based on mode.
|
||||
; A list of (major-mode . ((var1 . value1) (var2 . value2)))
|
||||
; Mode can be nil, which gives default values.
|
||||
; Characters width is set to 109 for .c and XML but for everything else 79.
|
||||
; If you update this file make sure to update .vimrc and .editorconfig too.
|
||||
|
||||
((c-mode . ((fill-column . 109)
|
||||
(c-basic-offset . 8)
|
||||
(eval . (c-set-offset 'substatement-open 0))
|
||||
(eval . (c-set-offset 'statement-case-open 0))
|
||||
(eval . (c-set-offset 'case-label 0))
|
||||
(eval . (c-set-offset 'arglist-intro '++))
|
||||
(eval . (c-set-offset 'arglist-close 0))
|
||||
(eval . (c-set-offset 'arglist-cont-nonempty '(c-lineup-gcc-asm-reg c-lineup-arglist)))))
|
||||
(nxml-mode . ((nxml-child-indent . 2)
|
||||
(fill-column . 109)))
|
||||
(meson-mode . ((meson-indent-basic . 8)))
|
||||
(sh-mode . ((sh-basic-offset . 4)
|
||||
(sh-indentation . 4)))
|
||||
(awk-mode . ((c-basic-offset . 8)))
|
||||
(nil . ((indent-tabs-mode . nil)
|
||||
(tab-width . 8)
|
||||
(fill-column . 79))) )
|
||||
|
29
.editorconfig
Normal file
29
.editorconfig
Normal file
@@ -0,0 +1,29 @@
|
||||
# EditorConfig configuration for dracut
|
||||
# http://EditorConfig.org
|
||||
|
||||
# If you update this file make sure to update .dir-locals.el and .vimrc too.
|
||||
|
||||
# Top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file, utf-8 charset
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
charset = utf-8
|
||||
|
||||
# Match config files, set indent to spaces with width of eight.
|
||||
[*.{c,h}]
|
||||
indent_style = space
|
||||
indent_size = 8
|
||||
|
||||
# Match config files, set indent to spaces with width of four.
|
||||
[*.sh]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
# Match xml man pages, set indent to spaces with width of two.
|
||||
[man/*.xml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
9
.github/CODEOWNERS
vendored
Normal file
9
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# This is a comment.
|
||||
# Each line is a file pattern followed by one or more owners.
|
||||
|
||||
# These owners will be the default owners for everything in
|
||||
# the repo. Unless a later match takes precedence,
|
||||
# @global-owner1 and @global-owner2 will be requested for
|
||||
# review when someone opens a pull request.
|
||||
* @haraldh @danimo @johannbg
|
||||
|
56
.github/CODE_OF_CONDUCT.md
vendored
Normal file
56
.github/CODE_OF_CONDUCT.md
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
# Dracut Code of Conduct
|
||||
|
||||
This code of conduct outlines our expectations for participants within the Dracut community, as well as steps for reporting unacceptable behavior.
|
||||
We are committed to providing a welcoming and inspiring community for all and expect our code of conduct to be honored.
|
||||
Anyone who violates this code of conduct may be banned from the community.
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others’ private information, such as a physical or email address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainer responsible for enforcement Harald Hoyer <harald@redhat.com>.
|
||||
All complaints will be reviewed and investigated promptly and fairly and will result in a response that is deemed necessary and appropriate to the circumstances.
|
||||
Project maintainers are obligated to respect the privacy and security of the reporter of any incident.
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq.
|
||||
Translations are available at https://www.contributor-covenant.org/translations.
|
26
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
26
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
name: "\U0001F41B Bug report"
|
||||
about: A report of an error in a recent Dracut version
|
||||
labels: 'bug'
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the error is.
|
||||
|
||||
**Distribution used**
|
||||
Which distribution was this behaviour seen in?
|
||||
|
||||
**Dracut version**
|
||||
Which dracut version was this behaviour seen in?
|
||||
|
||||
**Init system**
|
||||
Which init system is being used?
|
||||
|
||||
**To Reproduce**
|
||||
Steps or code to reproduce the behavior.
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Additional context**
|
||||
Add any other context you like about the problem here.
|
8
.github/ISSUE_TEMPLATE/documentation.md
vendored
Normal file
8
.github/ISSUE_TEMPLATE/documentation.md
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
name: "\U0001F4D6 Documentation"
|
||||
about: Suggest an improvement for documentation in Dracut
|
||||
labels: 'documents'
|
||||
---
|
||||
|
||||
**Describe the documentation**
|
||||
A clear and concise description of what should be better documented.
|
8
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
8
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
name: "\U00002728 Feature Request"
|
||||
about: A request for enhancement in Dracut
|
||||
labels: 'enhancement'
|
||||
---
|
||||
|
||||
**Describe the enhancement**
|
||||
A clear and concise description of what the enhancement is that you would like to see.
|
3
.github/SECURITY.md
vendored
Normal file
3
.github/SECURITY.md
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
Security is very important to us. If you discover any issue regarding security, we'd appreciate a non-public disclosure of
|
||||
the information, so please disclose the information responsibly by sending an email to Harald Hoyer harald@redhat.com and not by creating a GitHub issue.
|
||||
We will respond swiftly to fix verifiable security issues with the disclosure being coordinated with distributions and relevant security teams.
|
296
.github/labeler.yml
vendored
Normal file
296
.github/labeler.yml
vendored
Normal file
@@ -0,0 +1,296 @@
|
||||
needs review:
|
||||
- "*"
|
||||
|
||||
repository:
|
||||
- ./*
|
||||
|
||||
github:
|
||||
- .github/*
|
||||
- .github/**/*
|
||||
|
||||
dracut-install:
|
||||
- install/*
|
||||
- install/**/*
|
||||
|
||||
example:
|
||||
- examples/*
|
||||
- examples/**/*
|
||||
- examples/**/**/*
|
||||
|
||||
modules:
|
||||
- modules.d/*
|
||||
- modules.d/**/*
|
||||
|
||||
bash:
|
||||
- modules.d/00bash/*
|
||||
|
||||
bootchart:
|
||||
- modules.d/00bootchart/*
|
||||
|
||||
dash:
|
||||
- modules.d/00dash/*
|
||||
|
||||
mksh:
|
||||
- modules.d/00mksh/*
|
||||
|
||||
systemd:
|
||||
- modules.d/00systemd/*
|
||||
|
||||
warpclock:
|
||||
- modules.d/00warpclock/*
|
||||
|
||||
fips:
|
||||
- modules.d/01fips/*
|
||||
|
||||
systemd-initrd:
|
||||
- modules.d/01systemd-initrd/*
|
||||
|
||||
caps:
|
||||
- modules.d/02caps/*
|
||||
|
||||
systemd-networkd:
|
||||
- modules.d/02systemd-networkd/*
|
||||
|
||||
modsign:
|
||||
- modules.d/03modsign/*
|
||||
|
||||
rescue:
|
||||
- modules.d/03rescue/*
|
||||
|
||||
watchdog:
|
||||
- modules.d/04watchdog/*
|
||||
|
||||
busybox:
|
||||
- modules.d/05busybox/*
|
||||
|
||||
rngd:
|
||||
- modules.d/06rngd/*
|
||||
|
||||
i18n:
|
||||
- modules.d/10i18n/*
|
||||
|
||||
convertfs:
|
||||
- modules.d/30convertfs/*
|
||||
|
||||
network-legacy:
|
||||
- modules.d/35network-legacy/*
|
||||
|
||||
network-manager:
|
||||
- modules.d/35network-manager/*
|
||||
|
||||
network:
|
||||
- modules.d/40network/*
|
||||
|
||||
ifcfg:
|
||||
- modules.d/45ifcfg/*
|
||||
|
||||
url-lib:
|
||||
- modules.d/45url-lib/*
|
||||
|
||||
drm:
|
||||
- modules.d/50drm/*
|
||||
|
||||
gensplash:
|
||||
- modules.d/50gensplash/*
|
||||
|
||||
plymouth:
|
||||
- modules.d/50plymouth/*
|
||||
|
||||
cms:
|
||||
- modules.d/80cms/*
|
||||
|
||||
lvmmerge:
|
||||
- modules.d/80lvmmerge/*
|
||||
|
||||
cio_ignore:
|
||||
- modules.d/81cio_ignore/*
|
||||
|
||||
btrfs:
|
||||
- modules.d/90btrfs/*
|
||||
|
||||
crypt:
|
||||
- modules.d/90crypt/*
|
||||
|
||||
dm:
|
||||
- modules.d/90dm/*
|
||||
|
||||
dmraid:
|
||||
- modules.d/90dmraid/*
|
||||
|
||||
dmsquash-live:
|
||||
- modules.d/90dmsquash-live/*
|
||||
|
||||
dmsquash-live-ntfs:
|
||||
- modules.d/90dmsquash-live-ntfs/*
|
||||
|
||||
kernel-modules:
|
||||
- modules.d/90kernel-modules/*
|
||||
|
||||
kernel-modules-extra:
|
||||
- modules.d/90kernel-modules-extra/*
|
||||
|
||||
kernel-network-modules:
|
||||
- modules.d/90kernel-network-modules/*
|
||||
|
||||
livenet:
|
||||
- modules.d/90livenet/*
|
||||
|
||||
lvm:
|
||||
- modules.d/90lvm/*
|
||||
|
||||
mdraid:
|
||||
- modules.d/90mdraid/*
|
||||
|
||||
multipath:
|
||||
- modules.d/90multipath/*
|
||||
|
||||
nvdimm:
|
||||
- modules.d/90nvdimm/*
|
||||
|
||||
ppcmac:
|
||||
- modules.d/90ppcmac/*
|
||||
|
||||
qemu:
|
||||
- modules.d/90qemu/*
|
||||
|
||||
qemu-net:
|
||||
- modules.d/90qemu-net/*
|
||||
|
||||
stratis:
|
||||
- modules.d/90stratis/*
|
||||
|
||||
crypt-gpg:
|
||||
- modules.d/91crypt-gpg/*
|
||||
|
||||
crypt-loop:
|
||||
- modules.d/91crypt-loop/*
|
||||
|
||||
zipl:
|
||||
- modules.d/91zipl/*
|
||||
|
||||
cifs:
|
||||
- modules.d/95cifs/*
|
||||
|
||||
dasd:
|
||||
- modules.d/95dasd/*
|
||||
|
||||
dasd_mod:
|
||||
- modules.d/95dasd_mod/*
|
||||
|
||||
dasd_rules:
|
||||
- modules.d/95dasd_rules/*
|
||||
|
||||
dcssblk:
|
||||
- modules.d/95dcssblk/*
|
||||
|
||||
debug:
|
||||
- modules.d/95debug/*
|
||||
|
||||
fcoe:
|
||||
- modules.d/95fcoe/*
|
||||
|
||||
fcoe-uefi:
|
||||
- modules.d/95fcoe-uefi/*
|
||||
|
||||
fstab-sys:
|
||||
- modules.d/95fstab-sys/*
|
||||
|
||||
iscsi:
|
||||
- modules.d/95iscsi/*
|
||||
|
||||
lunmask:
|
||||
- modules.d/95lunmask/*
|
||||
|
||||
nbd:
|
||||
- modules.d/95nbd/*
|
||||
|
||||
nfs:
|
||||
- modules.d/95nfs/*
|
||||
|
||||
nvmf:
|
||||
- modules.d/95nvmf/*
|
||||
|
||||
qeth_rules:
|
||||
- modules.d/95qeth_rules/*
|
||||
|
||||
resume:
|
||||
- modules.d/95resume/*
|
||||
|
||||
rootfs-block:
|
||||
- modules.d/95rootfs-block/*
|
||||
|
||||
ssh-client:
|
||||
- modules.d/95ssh-client/*
|
||||
|
||||
terminfo:
|
||||
- modules.d/95terminfo/*
|
||||
|
||||
udev-rules:
|
||||
- modules.d/95udev-rules/*
|
||||
|
||||
virtfs:
|
||||
- modules.d/95virtfs/*
|
||||
|
||||
zfcp:
|
||||
- modules.d/95zfcp/*
|
||||
|
||||
zfcp_rules:
|
||||
- modules.d/95zfcp_rules/*
|
||||
|
||||
znet:
|
||||
- modules.d/95znet/*
|
||||
|
||||
securityfs:
|
||||
- modules.d/96securityfs/*
|
||||
|
||||
biosdevname:
|
||||
- modules.d/97biosdevname/*
|
||||
|
||||
masterkey:
|
||||
- modules.d/97masterkey/*
|
||||
|
||||
dracut-systemd:
|
||||
- modules.d/98dracut-systemd/*
|
||||
|
||||
ecryptfs:
|
||||
- modules.d/98ecryptfs/*
|
||||
|
||||
integrity:
|
||||
- modules.d/98integrity/*
|
||||
|
||||
pollcdrom:
|
||||
- modules.d/98pollcdrom/*
|
||||
|
||||
selinux:
|
||||
- modules.d/98selinux/*
|
||||
|
||||
syslog:
|
||||
- modules.d/98syslog/*
|
||||
|
||||
usrmount:
|
||||
- modules.d/98usrmount/*
|
||||
|
||||
base:
|
||||
- modules.d/99base/*
|
||||
|
||||
fs-lib:
|
||||
- modules.d/99fs-lib/*
|
||||
|
||||
img-lib:
|
||||
- modules.d/99img-lib/*
|
||||
|
||||
memstrack:
|
||||
- modules.d/99memstrack/*
|
||||
|
||||
shutdown:
|
||||
- modules.d/99shutdown/*
|
||||
|
||||
squash:
|
||||
- modules.d/99squash/*
|
||||
|
||||
uefi-lib:
|
||||
- modules.d/99uefi-lib/*
|
||||
|
||||
test:
|
||||
- test/*
|
||||
- test/**/*
|
10
.github/pull_request_template.md
vendored
Normal file
10
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
This pull request changes...
|
||||
|
||||
## Changes
|
||||
|
||||
## Checklist
|
||||
- [ ] I have tested it locally
|
||||
- [ ] I have reviewed and updated any documentation if relevant
|
||||
- [ ] I am providing new code and test(s) for it
|
||||
|
||||
Fixes #
|
21
.github/stale.yml
vendored
Normal file
21
.github/stale.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 30
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 7
|
||||
# Issues with these labels will never be considered stale
|
||||
exemptLabels:
|
||||
- documents
|
||||
- enhancement
|
||||
- regression
|
||||
- wiki
|
||||
- bug
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: stale
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue is being marked as stale because it has not had any recent activity.
|
||||
It will be closed if no further activity occurs.
|
||||
If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days.
|
||||
Thank you for your contributions.
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
48
.github/workflows/fedora-32.yml
vendored
Normal file
48
.github/workflows/fedora-32.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
## The test container is created with https://github.com/dracutdevs/fedora-container
|
||||
|
||||
name: Fedora-32
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: quay.io/haraldh/dracut-fedora:32
|
||||
options: "-v /dev/kvm:/dev/kvm"
|
||||
timeout-minutes: 45
|
||||
strategy:
|
||||
matrix:
|
||||
test: [
|
||||
"01",
|
||||
"02",
|
||||
"03",
|
||||
"04",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"17",
|
||||
"20",
|
||||
"21",
|
||||
"30",
|
||||
"31",
|
||||
"35",
|
||||
"36",
|
||||
"40",
|
||||
"41",
|
||||
]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: "Checkout Repository"
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: "TEST-${{ matrix.test }}"
|
||||
run: ./fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
|
49
.github/workflows/fedora-33.yml
vendored
Normal file
49
.github/workflows/fedora-33.yml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
## The test container is created with https://github.com/dracutdevs/fedora-container
|
||||
|
||||
name: Fedora-33
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: quay.io/haraldh/dracut-fedora:33
|
||||
options: "-v /dev/kvm:/dev/kvm"
|
||||
timeout-minutes: 45
|
||||
strategy:
|
||||
matrix:
|
||||
test: [
|
||||
"01",
|
||||
"02",
|
||||
"03",
|
||||
"04",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"17",
|
||||
"20",
|
||||
"21",
|
||||
"30",
|
||||
"31",
|
||||
"35",
|
||||
"36",
|
||||
"40",
|
||||
"41",
|
||||
]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: "Checkout Repository"
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: "TEST-${{ matrix.test }}"
|
||||
run: ./fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
|
48
.github/workflows/fedora-latest.yml
vendored
Normal file
48
.github/workflows/fedora-latest.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
## The test container is created with https://github.com/dracutdevs/fedora-container
|
||||
|
||||
name: Fedora-latest
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: quay.io/haraldh/dracut-fedora:latest
|
||||
options: "-v /dev/kvm:/dev/kvm"
|
||||
timeout-minutes: 45
|
||||
strategy:
|
||||
matrix:
|
||||
test: [
|
||||
"01",
|
||||
"02",
|
||||
"03",
|
||||
"04",
|
||||
"10",
|
||||
"11",
|
||||
"12",
|
||||
"13",
|
||||
"14",
|
||||
"15",
|
||||
"17",
|
||||
"20",
|
||||
"21",
|
||||
"30",
|
||||
"31",
|
||||
"35",
|
||||
"36",
|
||||
"40",
|
||||
"41",
|
||||
]
|
||||
fail-fast: false
|
||||
steps:
|
||||
- name: "Checkout Repository"
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: "TEST-${{ matrix.test }}"
|
||||
run: ./fedora-test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
|
15
.github/workflows/labels.yml
vendored
Normal file
15
.github/workflows/labels.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
name: Label the Pull Requests automatically via Cron
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '*/15 * * * *'
|
||||
|
||||
jobs:
|
||||
label:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: paulfantom/periodic-labeler@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_REPOSITORY: ${{ github.repository }}
|
||||
LABEL_MAPPINGS_FILE: .github/labeler.yml
|
19
.github/workflows/pr.yml
vendored
Normal file
19
.github/workflows/pr.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Commisery
|
||||
on:
|
||||
pull_request:
|
||||
types: [edited, opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
commit-message:
|
||||
name: Conventional Commit Message Checker (Commisery)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check-out the repo under $GITHUB_WORKSPACE
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Run Commisery
|
||||
uses: dracutdevs/commisery-action@master
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
pull_request: ${{ github.event.number }}
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,6 +10,7 @@
|
||||
/dracut-install
|
||||
/modules.d/99base/switch_root
|
||||
/test/*/test.log
|
||||
/test/*/.testdir
|
||||
test*.img
|
||||
/.buildpath
|
||||
/.project
|
||||
|
4
.mailmap
4
.mailmap
@@ -31,3 +31,7 @@ Lidong Zhong <lidong.zhong@suse.com> <lzhong@suse.com>
|
||||
Nikoli <nikoli@gmx.us> <nikoli@lavabit.com>
|
||||
Peter Robinson <pbrobinson@fedoraproject.org> <pbrobinson@gmail.com>
|
||||
Xunlei Pang <xlpang@redhat.com> <xpang@redhat.com>
|
||||
Daniel Molkentin <daniel.molkentin@suse.com> <dmolkentin@suse.com>
|
||||
Thomas Blume <thomas.blume@suse.com> <Thomas.Blume@suse.com>
|
||||
Brian C. Lane <bcl@redhat.com> <bcl@brianlane.com>
|
||||
Tomasz Paweł Gajc <tpgxyz@gmail.com> <tpgxyz@gmail.com>
|
||||
|
58
.packit.yml
Normal file
58
.packit.yml
Normal file
@@ -0,0 +1,58 @@
|
||||
# This file is part of dracut.
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# The name of the upstream package
|
||||
upstream_package_name: dracut
|
||||
|
||||
# The upstream tag versioning scheme
|
||||
upstream_tag_template: "{version}"
|
||||
|
||||
# The URL of the upstream project
|
||||
upstream_project_url: https://github.com/dracutdevs/dracut
|
||||
|
||||
# Relative path to a spec file within the upstream repository
|
||||
specfile_path: dracut.spec
|
||||
|
||||
# Name of the downstream package
|
||||
downstream_package_name: dracut
|
||||
|
||||
# The URL of the downstream project
|
||||
dist_git_base_url: https://src.fedoraproject.org/
|
||||
|
||||
# Sync file(s) from upstream repo to dist-git
|
||||
synced_files:
|
||||
# The dracut spec file is maintained upstream so we sync it downstream.
|
||||
- dracut.spec
|
||||
# We sync the packit file downstream be able to optionally use the sync-from-downstream command
|
||||
- .packit.yaml
|
||||
|
||||
# We want new releases to be automatically built on rawhide and have few jobs
|
||||
# on copr.
|
||||
create_pr: false
|
||||
jobs:
|
||||
- job: propose_downstream
|
||||
trigger: release
|
||||
metadata:
|
||||
dist_git_branches: master
|
||||
|
||||
- job: tests
|
||||
trigger: pull_request
|
||||
metadata:
|
||||
targets:
|
||||
- fedora-rawhide
|
||||
|
||||
- job: copr_build
|
||||
trigger: pull_request
|
||||
metadata:
|
||||
targets:
|
||||
- fedora-rawhide
|
||||
|
||||
- job: copr_build
|
||||
trigger: commit
|
||||
metadata:
|
||||
targets:
|
||||
- fedora-rawhide
|
||||
branch: master
|
||||
owner: "@dracut"
|
||||
project: Dracut
|
||||
preserve_project: True
|
47
.travis.yml
47
.travis.yml
@@ -1,47 +0,0 @@
|
||||
language: generic
|
||||
sudo: required
|
||||
services:
|
||||
- docker
|
||||
env:
|
||||
matrix:
|
||||
- IMAGE=latest
|
||||
- IMAGE=latest TESTS=01
|
||||
- IMAGE=latest TESTS=12
|
||||
- IMAGE=latest TESTS=20
|
||||
- IMAGE=latest TESTS=50
|
||||
- IMAGE=latest TESTS=30
|
||||
- IMAGE=latest TESTS=31
|
||||
- IMAGE=latest TESTS=70
|
||||
- IMAGE=latest TESTS=99
|
||||
- IMAGE=latest TESTS=02
|
||||
- IMAGE=latest TESTS=03
|
||||
- IMAGE=latest TESTS=04
|
||||
- IMAGE=latest TESTS=10
|
||||
- IMAGE=latest TESTS=11
|
||||
- IMAGE=latest TESTS=13
|
||||
- IMAGE=latest TESTS=14
|
||||
- IMAGE=latest TESTS=15
|
||||
- IMAGE=latest TESTS=17
|
||||
|
||||
before_script:
|
||||
- docker pull fedora:$IMAGE
|
||||
- |
|
||||
sudo modprobe kvm-intel nested=1 || :
|
||||
sudo modprobe kvm-amd nested=1 || :
|
||||
dmesg | tail || :
|
||||
- git pull --depth=100
|
||||
- |
|
||||
git describe --abbrev=0 --tags || :
|
||||
git describe --tags || :
|
||||
|
||||
script:
|
||||
- docker run --privileged -it -v $(pwd)/:/dracut fedora:$IMAGE /dracut/fedora-test.sh $IMAGE-$$ "$TESTS"
|
||||
|
||||
notifications:
|
||||
webhooks:
|
||||
urls:
|
||||
- https://webhooks.gitter.im/e/effa917ca3e0ed5fd00e
|
||||
on_success: change # options: [always|never|change] default: always
|
||||
on_failure: always # options: [always|never|change] default: always
|
||||
on_start: never # options: [always|never|change] default: always
|
||||
|
15
.vimrc
Normal file
15
.vimrc
Normal file
@@ -0,0 +1,15 @@
|
||||
" Vim can use per directory configuration files like this.
|
||||
" To enable that feature two lines are needed in your ~/.vimrc
|
||||
" set exrc " enables per-directory .vimrc files
|
||||
" set secure " disable unsafe commands in local .vimrc files
|
||||
" Characters width is set to 109 for .c and XML but for everything else 79.
|
||||
" If you update this file make sure to update .dir-locals.el & .editorconfig
|
||||
|
||||
set tabstop=8
|
||||
set shiftwidth=8
|
||||
set expandtab
|
||||
set makeprg=GCC_COLORS=\ make
|
||||
set tw=79
|
||||
au BufRead,BufNewFile *.xml set tw=109 shiftwidth=2 smarttab
|
||||
au FileType sh set tw=80 shiftwidth=4 smarttab
|
||||
au FileType c set tw=109
|
@@ -35,21 +35,26 @@ case "$COMMAND" in
|
||||
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
|
||||
elif [[ -f /usr/lib/kernel/cmdline ]]; then
|
||||
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
|
||||
fi
|
||||
else
|
||||
declare -a BOOT_OPTIONS
|
||||
|
||||
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
|
||||
read -r -d '' -a BOOT_OPTIONS < /proc/cmdline
|
||||
read -r -d '' -a line < /proc/cmdline
|
||||
for i in "${line[@]}"; do
|
||||
[[ "${i#initrd=*}" != "$i" ]] && continue
|
||||
BOOT_OPTIONS+=("$i")
|
||||
done
|
||||
fi
|
||||
|
||||
unset noimageifnotneeded
|
||||
|
||||
for ((i=0; i < "${#BOOT_OPTIONS[@]}"; i++)); do
|
||||
# shellcheck disable=SC1001
|
||||
if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then
|
||||
noimageifnotneeded="yes"
|
||||
break
|
||||
fi
|
||||
done
|
||||
dracut ${noimageifnotneeded:+--noimageifnotneeded} "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION"
|
||||
dracut -f ${noimageifnotneeded:+--noimageifnotneeded} "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION"
|
||||
ret=$?
|
||||
;;
|
||||
remove)
|
||||
|
@@ -1,68 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
export LANG=C
|
||||
|
||||
KERNEL_VERSION="$1"
|
||||
KERNEL_IMAGE="$2"
|
||||
|
||||
[[ -f /etc/os-release ]] && . /etc/os-release
|
||||
|
||||
if [[ ! -f /etc/machine-id ]] || [[ ! -s /etc/machine-id ]]; then
|
||||
systemd-machine-id-setup
|
||||
fi
|
||||
|
||||
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||||
|
||||
[[ $MACHINE_ID ]] || exit 1
|
||||
[[ -f $KERNEL_IMAGE ]] || exit 1
|
||||
|
||||
INITRDFILE="/boot/initramfs-0-rescue-${MACHINE_ID}.img"
|
||||
NEW_KERNEL_IMAGE="${KERNEL_IMAGE%/*}/vmlinuz-0-rescue-${MACHINE_ID}"
|
||||
|
||||
[[ -f $INITRDFILE ]] && [[ -f $NEW_KERNEL_IMAGE ]] && exit 0
|
||||
|
||||
dropindirs_sort()
|
||||
{
|
||||
suffix=$1; shift
|
||||
args=("$@")
|
||||
files=$(
|
||||
while (( $# > 0 )); do
|
||||
for i in ${1}/*${suffix}; do
|
||||
[[ -f $i ]] && echo ${i##*/}
|
||||
done
|
||||
shift
|
||||
done | sort -Vu
|
||||
)
|
||||
|
||||
for f in $files; do
|
||||
for d in "${args[@]}"; do
|
||||
if [[ -f "$d/$f" ]]; then
|
||||
echo "$d/$f"
|
||||
continue 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
# source our config dir
|
||||
for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do
|
||||
[[ -e $f ]] && . "$f"
|
||||
done
|
||||
|
||||
[[ $dracut_rescue_image != "yes" ]] && exit 0
|
||||
|
||||
if [[ ! -f $INITRDFILE ]]; then
|
||||
dracut --no-hostonly -a "rescue" "$INITRDFILE" "$KERNEL_VERSION"
|
||||
((ret+=$?))
|
||||
fi
|
||||
|
||||
if [[ ! -f $NEW_KERNEL_IMAGE ]]; then
|
||||
cp --reflink=auto "$KERNEL_IMAGE" "$NEW_KERNEL_IMAGE"
|
||||
((ret+=$?))
|
||||
fi
|
||||
|
||||
new-kernel-pkg --install "$KERNEL_VERSION" --kernel-image "$NEW_KERNEL_IMAGE" --initrdfile "$INITRDFILE" --banner "$NAME $VERSION_ID Rescue $MACHINE_ID"
|
||||
|
||||
((ret+=$?))
|
||||
|
||||
exit $ret
|
@@ -14,8 +14,8 @@ dropindirs_sort()
|
||||
args=("$@")
|
||||
files=$(
|
||||
while (( $# > 0 )); do
|
||||
for i in ${1}/*${suffix}; do
|
||||
[[ -f $i ]] && echo ${i##*/}
|
||||
for i in "${1}"/*"${suffix}"; do
|
||||
[[ -f $i ]] && echo "${i##*/}"
|
||||
done
|
||||
shift
|
||||
done | sort -Vu
|
||||
@@ -36,7 +36,7 @@ dropindirs_sort()
|
||||
if [[ ${KERNEL_INSTALL_MACHINE_ID+x} ]]; then
|
||||
MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
|
||||
elif [[ -f /etc/machine-id ]] ; then
|
||||
read MACHINE_ID < /etc/machine-id
|
||||
read -r MACHINE_ID < /etc/machine-id
|
||||
fi
|
||||
|
||||
if ! [[ $MACHINE_ID ]]; then
|
||||
@@ -47,9 +47,9 @@ if [[ -f /etc/kernel/cmdline ]]; then
|
||||
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
|
||||
elif [[ -f /usr/lib/kernel/cmdline ]]; then
|
||||
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
|
||||
fi
|
||||
else
|
||||
declare -a BOOT_OPTIONS
|
||||
|
||||
if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
|
||||
read -r -d '' -a line < /proc/cmdline
|
||||
for i in "${line[@]}"; do
|
||||
[[ "${i#initrd=*}" != "$i" ]] && continue
|
||||
@@ -57,12 +57,6 @@ if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
|
||||
done
|
||||
fi
|
||||
|
||||
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
|
||||
echo "Could not determine the kernel command line parameters." >&2
|
||||
echo "Please specify the kernel command line in /etc/kernel/cmdline!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -d "${BOOT_DIR_ABS%/*}" ]]; then
|
||||
BOOT_DIR="/${MACHINE_ID}/0-rescue"
|
||||
BOOT_ROOT=${BOOT_DIR_ABS%$BOOT_DIR}
|
||||
@@ -86,9 +80,13 @@ case "$COMMAND" in
|
||||
|
||||
# source our config dir
|
||||
for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do
|
||||
[[ -e $f ]] && . "$f"
|
||||
if [[ -e $f ]]; then
|
||||
# shellcheck disable=SC1090
|
||||
. "$f"
|
||||
fi
|
||||
done
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
[[ $dracut_rescue_image != "yes" ]] && exit 0
|
||||
|
||||
[[ -d "$BOOT_DIR_ABS" ]] || mkdir -p "$BOOT_DIR_ABS"
|
||||
@@ -98,7 +96,7 @@ case "$COMMAND" in
|
||||
fi
|
||||
|
||||
if [[ ! -f "$BOOT_DIR_ABS/$INITRD" ]]; then
|
||||
dracut --no-hostonly -a "rescue" "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION"
|
||||
dracut -f --no-hostonly -a "rescue" "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION"
|
||||
((ret+=$?))
|
||||
fi
|
||||
|
||||
@@ -107,13 +105,17 @@ case "$COMMAND" in
|
||||
echo "title $PRETTY_NAME - Rescue Image"
|
||||
echo "version $KERNEL_VERSION"
|
||||
echo "machine-id $MACHINE_ID"
|
||||
echo "options ${BOOT_OPTIONS[@]} rd.auto=1"
|
||||
echo "options ${BOOT_OPTIONS[*]} rd.auto=1"
|
||||
echo "linux $BOOT_DIR/linux"
|
||||
echo "initrd $BOOT_DIR/initrd"
|
||||
} > $LOADER_ENTRY
|
||||
} > "$LOADER_ENTRY"
|
||||
else
|
||||
cp -aT "${KERNEL_IMAGE%/*}/bls.conf" $LOADER_ENTRY
|
||||
sed -i 's/'$KERNEL_VERSION'/0-rescue-'${MACHINE_ID}'/' $LOADER_ENTRY
|
||||
if [[ -e "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" ]]; then
|
||||
cp -aT "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" "$LOADER_ENTRY"
|
||||
else
|
||||
cp -aT "${KERNEL_IMAGE%/*}/bls.conf" "$LOADER_ENTRY"
|
||||
fi
|
||||
sed -i "s/${KERNEL_VERSION}/0-rescue-${MACHINE_ID}/" "$LOADER_ENTRY"
|
||||
fi
|
||||
|
||||
((ret+=$?))
|
||||
|
129
AUTHORS
129
AUTHORS
@@ -2,98 +2,123 @@ Harald Hoyer <harald@redhat.com>
|
||||
Victor Lowther <victor.lowther@gmail.com>
|
||||
Amadeusz Żołnowski <aidecoe@aidecoe.name>
|
||||
Hannes Reinecke <hare@suse.com>
|
||||
Daniel Molkentin <daniel.molkentin@suse.com>
|
||||
Will Woods <wwoods@redhat.com>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Jóhann B. Guðmundsson <johannbg@gmail.com>
|
||||
Kairui Song <kasong@redhat.com>
|
||||
Dave Young <dyoung@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
Lukas Nykryn <lnykryn@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
Michal Soltys <soltys@ziu.info>
|
||||
Colin Guthrie <colin@mageia.org>
|
||||
Daniel Molkentin <dmolkentin@suse.com>
|
||||
Amerigo Wang <amwang@redhat.com>
|
||||
Thomas Renninger <trenn@suse.com>
|
||||
Lukas Nykryn <lnykryn@redhat.com>
|
||||
Alexander Tsoy <alexander@tsoy.me>
|
||||
Martin Wilck <mwilck@suse.de>
|
||||
Frederick Grose <fgrose@sugarlabs.org>
|
||||
WANG Chao <chaowang@redhat.com>
|
||||
Yu Watanabe <watanabe.yu+github@gmail.com>
|
||||
Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Jonathan Lebon <jonathan@jlebon.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Peter Robinson <pbrobinson@fedoraproject.org>
|
||||
Frantisek Sumsal <frantisek@sumsal.cz>
|
||||
Fabian Vogt <fvogt@suse.com>
|
||||
Kairui Song <kasong@redhat.com>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
Zoltán Böszörményi <zboszor@pr.hu>
|
||||
Colin Walters <walters@verbum.org>
|
||||
John Reiser <jreiser@bitwagon.com>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
Tomasz Paweł Gajc <tpgxyz@gmail.com>
|
||||
Xunlei Pang <xlpang@redhat.com>
|
||||
Daniel Drake <drake@endlessm.com>
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
Angelo "pallotron" Failla <pallotron@fb.com>
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
Daniel Drake <drake@endlessm.com>
|
||||
Angelo "pallotron" Failla <pallotron@fb.com>
|
||||
Beniamino Galvani <bgalvani@redhat.com>
|
||||
Thomas Blume <thomas.blume@suse.com>
|
||||
Ville Skyttä <ville.skytta@iki.fi>
|
||||
Böszörményi Zoltán <zboszor@pr.hu>
|
||||
Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Dan Horák <dhorak@redhat.com>
|
||||
Javier Martinez Canillas <javierm@redhat.com>
|
||||
Ondrej Mosnacek <omosnace@redhat.com>
|
||||
Renaud Métrich <rmetrich@redhat.com>
|
||||
Baoquan He <bhe@redhat.com>
|
||||
Brendan Germain <brendan.germain@nasdaqomx.com>
|
||||
Colin Walters <walters@verbum.org>
|
||||
Jonas Witschel <diabonas@gmx.de>
|
||||
Leho Kraav <leho@kraav.com>
|
||||
Moritz Maxeiner <moritz@ucworks.org>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
Ondrej Mosnacek <omosnace@redhat.com>
|
||||
Nathan Rini <nate@ucar.edu>
|
||||
Radek Vykydal <rvykydal@redhat.com>
|
||||
David Tardon <dtardon@redhat.com>
|
||||
Fabian Deutsch <fabiand@fedoraproject.org>
|
||||
Javier Martinez Canillas <javierm@redhat.com>
|
||||
Kamil Rytarowski <n54@gmx.com>
|
||||
Lidong Zhong <lidong.zhong@suse.com>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
Mike Gilbert <floppym@gentoo.org>
|
||||
NeilBrown <neilb@suse.de>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Radek Vykydal <rvykydal@redhat.com>
|
||||
Thorsten Behrens <tbehrens@suse.com>
|
||||
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
|
||||
q66 <daniel@octaforge.org>
|
||||
Đoàn Trần Công Danh <congdanhqx@gmail.com>
|
||||
Adam Williamson <awilliam@redhat.com>
|
||||
Chao Wang <chaowang@redhat.com>
|
||||
Frederic Crozat <fcrozat@suse.com>
|
||||
James Lee <jlee@thestaticvoid.com>
|
||||
Jesse Keating <jkeating@redhat.com>
|
||||
Martin Wilck <mwilck@suse.de>
|
||||
Mike Gilbert <floppym@gentoo.org>
|
||||
Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
|
||||
Milan Broz <mbroz@redhat.com>
|
||||
Mimi Zohar <zohar@linux.vnet.ibm.com>
|
||||
Norbert Lange <norbert.lange@andritz.com>
|
||||
Roberto Sassu <roberto.sassu@polito.it>
|
||||
Stefan Reimer <it@startux.de>
|
||||
Adam Williamson <awilliam@redhat.com>
|
||||
Takashi Iwai <tiwai@suse.de>
|
||||
Anton Blanchard <anton@samba.org>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Chapman Flack <g2@anastigmatix.net>
|
||||
Chris Leech <cleech@redhat.com>
|
||||
David Cantrell <dcantrell@redhat.com>
|
||||
Dennis Gilmore <dennis@ausil.us>
|
||||
Doan Tran Cong Danh <congdanhqx@gmail.com>
|
||||
Gaël PORTAY <gael.portay@collabora.com>
|
||||
Jan Synacek <jsynacek@redhat.com>
|
||||
Jiri Konecny <jkonecny@redhat.com>
|
||||
Jon Ander Hernandez <jonan.h@gmail.com>
|
||||
Juan RP <xtraeme@gmail.com>
|
||||
Lance Albertson <lance@osuosl.org>
|
||||
Marcos Mello <marcosfrm@gmail.com>
|
||||
Marian Ganisin <mganisin@redhat.com>
|
||||
Matthias Gerstner <matthias.gerstner@suse.de>
|
||||
Max Resch <resch.max@gmail.com>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Pratyush Anand <panand@redhat.com>
|
||||
Silvio Fricke <silvio.fricke@gmail.com>
|
||||
Steven Brudenell <steven.brudenell@gmail.com>
|
||||
Stig Telfer <stelfer@cray.com>
|
||||
Thomas Backlund <tmb@mageia.org>
|
||||
Topi Miettinen <toiwoton@gmail.com>
|
||||
Vasiliy Tolstov <v.tolstov@selfip.ru>
|
||||
Wim Muskee <wimmuskee@gmail.com>
|
||||
tpgxyz <tpgxyz@gmail.com>
|
||||
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
||||
Alan Pevec <apevec@redhat.com>
|
||||
Alex Harpin <development@landsofshadow.co.uk>
|
||||
Alexey Shabalin <shaba@altlinux.org>
|
||||
Ankit Kumar <ankit@linux.vnet.ibm.com>
|
||||
Antony Messerli <amesserl@rackspace.com>
|
||||
Chao Fan <cfan@redhat.com>
|
||||
Daniel Cordero <dracut@0xdc.io>
|
||||
Daniel Kahn Gillmor <dkg@fifthhorseman.net>
|
||||
Daniel Schaal <farbing@web.de>
|
||||
Denis Silakov <dsilakov@virtuozzo.com>
|
||||
Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
|
||||
Dusty Mabe <dusty@dustymabe.com>
|
||||
Erwan Velu <erwan.velu@enovance.com>
|
||||
Evgeny Vereshchagin <evvers@ya.ru>
|
||||
Guido Trentalancia <guido@trentalancia.net>
|
||||
@@ -101,15 +126,24 @@ Hari Bathini <hbathini@linux.vnet.ibm.com>
|
||||
Ian Dall <ian@beware.dropbear.id.au>
|
||||
Imran Haider <imran1008@gmail.com>
|
||||
James Buren <ryuo@frugalware.org>
|
||||
Jan Macku <jamacku@redhat.com>
|
||||
Joey Boggs <jboggs@redhat.com>
|
||||
Julian Wolf <juwolf@suse.com>
|
||||
Koen Kooi <koen@dominion.thruhere.net>
|
||||
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
Kyle McMartin <kmcmarti@redhat.com>
|
||||
Luiz Angelo Daros de Luca <luizluca@gmail.com>
|
||||
Lukas Wunner <lukas@wunner.de>
|
||||
Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
|
||||
Marko Myllynen <myllynen@redhat.com>
|
||||
Matthew Thode <mthode@mthode.org>
|
||||
Michal Koutný <mkoutny@suse.com>
|
||||
Mike Snitzer <snitzer@redhat.com>
|
||||
Minfei Huang <mhuang@redhat.com>
|
||||
Nikoli <nikoli@gmx.us>
|
||||
Patrick Talbert <ptalbert@redhat.com>
|
||||
Pedro Monreal <pmgdeb@gmail.com>
|
||||
Petr Pavlu <petr.pavlu@suse.com>
|
||||
Pingfan Liu <piliu@redhat.com>
|
||||
Przemysław Rudy <prudy1@o2.pl>
|
||||
Robert LeBlanc <robert@leblancnet.us>
|
||||
@@ -120,15 +154,29 @@ Till Maas <opensource@till.name>
|
||||
Tony Asleson <tasleson@redhat.com>
|
||||
Vivek Goyal <vgoyal@redhat.com>
|
||||
Vladislav Bogdanov <bubble@hoster-ok.com>
|
||||
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
|
||||
Érico Rolim <erico.erc@gmail.com>
|
||||
наб <nabijaczleweli@nabijaczleweli.xyz>
|
||||
A. Wilcox <AWilcox@Wilcox-Tech.com>
|
||||
Alexander Kurtz <alexander@kurtz.be>
|
||||
Alexander Miroshnichenko <alex@millerson.name>
|
||||
Alexander Sosedkin <asosedkin@redhat.com>
|
||||
Alexander Todorov <atodorov@redhat.com>
|
||||
Alexey Kodanev <alexey.kodanev@oracle.com>
|
||||
Andreas Schwab <schwab@suse.de>
|
||||
Andreas Stieger <astieger@suse.com>
|
||||
Andrew J. Hesford <ajh@sideband.org>
|
||||
Andy Lutomirski <luto@mit.edu>
|
||||
Anjali Kulkarni <anjali.k.kulkarni@oracle.com>
|
||||
Anssi Hannula <anssi@mageia.org>
|
||||
Antz <antzz@protonmail.ch>
|
||||
Arnaud Rebillout <arnaud.rebillout@collabora.com>
|
||||
Artem Savkov <asavkov@redhat.com>
|
||||
Attila Bruncsak <bruncsak@users.noreply.github.com>
|
||||
B. Wilson <x@wilsonb.com>
|
||||
Ben Howard <ben.howard@redhat.com>
|
||||
Benjamin Marzinski <bmarzins@redhat.com>
|
||||
Brandon Philips <brandon@ifup.co>
|
||||
Bruno E. O. Meneguele <bmeneg@redhat.com>
|
||||
Bryn M. Reeves <bmr@redhat.com>
|
||||
Canek Peláez Valdés <caneko@gmail.com>
|
||||
Carlo Caione <carlo@endlessm.com>
|
||||
@@ -139,90 +187,125 @@ Dan Fuhry <dfuhry@datto.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
David Disseldorp <ddiss@suse.de>
|
||||
David Michael <david.michael@coreos.com>
|
||||
Denis Volkov <denis@simpletexting.net>
|
||||
Dennis Schridde <devurandom@gmx.net>
|
||||
Derek Hageman <hageman@inthat.cloud>
|
||||
Derek Higgins <derekh@redhat.com>
|
||||
Donovan Tremura <neurognostic@protonmail.ch>
|
||||
Duane Griffin <duaneg@dghda.com>
|
||||
Elan Ruusamäe <glen@delfi.ee>
|
||||
Enno Boland <g@s01.de>
|
||||
Enzo Matsumiya <ematsumiya@suse.de>
|
||||
Eugene S. Sobolev <sobolev@protei.ru>
|
||||
Eugene Syromiatnikov <esyr@redhat.com>
|
||||
Evgeni Golov <evgeni@golov.de>
|
||||
Fabian Vogt <fvogt@suse.de>
|
||||
Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
|
||||
Florian Gamböck <mail@floga.de>
|
||||
Frank Deng <frank.deng@oracle.com>
|
||||
François Cami <fcami@fedoraproject.org>
|
||||
Gerd von Egidy <gerd.von.egidy@intra2net.com>
|
||||
Glen Gray <slaine@slaine.org>
|
||||
GuoChuang <guo.chuang@zte.com.cn>
|
||||
HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
|
||||
Hendrik Brueckner <brueckner@linux.ibm.com>
|
||||
Hermann Gausterer <git-dracut-2012@mrq1.org>
|
||||
Hiroaki Mizuguchi <hiroaki-m@iij.ad.jp>
|
||||
Hongxu Jia <hongxu.jia@windriver.com>
|
||||
Hui Wang <john.wanghui@huawei.com>
|
||||
Ignaz Forster <iforster@suse.com>
|
||||
Jacob Wen <jian.w.wen@oracle.com>
|
||||
James Laska <jlaska@redhat.com>
|
||||
Jan Stodola <jstodola@redhat.com>
|
||||
Jason Dana <jasondana@quarksecurity.com>
|
||||
Jens Heise <46450477+heisej@users.noreply.github.com>
|
||||
Jeremy Linton <lintonrjeremy@gmail.com>
|
||||
Jiri Pirko <jiri@resnulli.us>
|
||||
Joe Lawrence <Joe.Lawrence@stratus.com>
|
||||
Johannes Thumshirn <jthumshirn@suse.com>
|
||||
Jonas Jonsson <jonas@websystem.se>
|
||||
Jonas Witschel <diabonas@archlinux.org>
|
||||
Kevin Yung <Kevin.Yung@myob.com>
|
||||
Lars R. Damerow <lars@pixar.com>
|
||||
Lee Duncan <lduncan@suse.com>
|
||||
Lennert Buytenhek <buytenh@wantstofly.org>
|
||||
Lianbo Jiang <lijiang@redhat.com>
|
||||
Lucas C. Villa Real <lucasvr@gmail.com>
|
||||
Major Hayden <major@mhtx.net>
|
||||
Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
|
||||
Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
|
||||
Marian Csontos <mcsontos@redhat.com>
|
||||
Mark Fasheh <mfasheh@suse.de>
|
||||
Marko Myllynen <myllynen@redhat.com>
|
||||
Matt <smoothsailing72@hotmail.com>
|
||||
Matt Smith <shadowfax@gmx.com>
|
||||
Matthew Thode <mthode@mthode.org>
|
||||
Mei Liu <liumbj@linux.vnet.ibm.com>
|
||||
Michael Chapman <mike@very.puzzling.org>
|
||||
Michael McCracken <michael.mccracken@gmail.com>
|
||||
Michal Koutný <mkoutny@suse.com>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Michal Sekletar <msekleta@redhat.com>
|
||||
Mike Gorse <mgorse@suse.com>
|
||||
Moritz 'Morty' Strübe <morty@gmx.net>
|
||||
Munehiro Matsuda <haro@kgt.co.jp>
|
||||
Nicolas Porcel <nicolasporcel06@gmail.com>
|
||||
Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
|
||||
Olivier Blin <dev@blino.org>
|
||||
Ondrej Dubaj <odubaj@redhat.com>
|
||||
P J P <ppandit@redhat.com>
|
||||
Paolo Bonzini <pbonzini@redhat.com>
|
||||
Paul Robins <exp@users.noreply.github.com>
|
||||
Pavel Zhukov <pzhukov@redhat.com>
|
||||
Pawel Wieczorkiewicz <pwieczorkiewicz@suse.de>
|
||||
Pekka Wallendahl <wyrmiyu@gmail.com>
|
||||
Peter Georg <peter.georg@physik.uni-regensburg.de>
|
||||
Peter Levine <plevine457@gmail.com>
|
||||
Petr Tesarik <ptesarik@suse.com>
|
||||
Petr Vorel <pvorel@suse.cz>
|
||||
Prarit Bhargava <prarit@redhat.com>
|
||||
Praveen_Paladugu@Dell.com <Praveen_Paladugu@Dell.com>
|
||||
Pádraig Brady <P@draigBrady.com>
|
||||
Quentin Armitage <quentin@armitage.org.uk>
|
||||
Renaud Métrich <rmetrich@redhat.com>
|
||||
Robert Buchholz <rbu@goodpoint.de>
|
||||
Ruben Kerkhof <ruben@rubenkerkhof.com>
|
||||
Rumbaut Thomas <Thomas.Rumbaut@digipolis.gent>
|
||||
Rusty Bird <rustybird@openmailbox.org>
|
||||
Sebastian Mitterle <smitterl@redhat.com>
|
||||
Sergei Iudin <tsipa740@gmail.com>
|
||||
Sergey Fionov <fionov@gmail.com>
|
||||
Shawn W Dunn <sfalken@opensuse.org>
|
||||
Srinivasa T N <seenutn@linux.vnet.ibm.com>
|
||||
Stijn Hoop <stijn@sandcat.nl>
|
||||
Sullivan (CTR), Austin <austin.sullivan.ctr@progeny.net>
|
||||
Thierry Vignaud <thierry.vignaud@gmail.com>
|
||||
Thilo Bangert <thilo.bangert@gmx.net>
|
||||
Thomas Blume <thomas.blume@suse.com>
|
||||
Thomas Abraham <tabraham@suse.com>
|
||||
Tobias Geerinckx <tobias.geerinckx@gmail.com>
|
||||
Tobias Klauser <tklauser@distanz.ch>
|
||||
Tom Gundersen <teg@jklm.no>
|
||||
Tomasz Paweł Gajc <tpgxyz@gmail.com>
|
||||
Tomasz Torcz <tomek@pipebreaker.pl>
|
||||
Tong Li <tonli@redhat.com>
|
||||
Vadim Kuznetsov <vadimk@gentoo.org>
|
||||
Vaughan Cao <vaughan.cao@oracle.com>
|
||||
Vladius25 <vkorol2509@icloud.com>
|
||||
Vratislav Podzimek <vpodzime@redhat.com>
|
||||
Yang Liu <50459973+ly4096x@users.noreply.github.com>
|
||||
Yanko Kaneti <yaneti@declera.com>
|
||||
Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
|
||||
Ziyue Yang <ziyang@redhat.com>
|
||||
foopub <45460217+foopub@users.noreply.github.com>
|
||||
gaoyi <ymuemc@163.com>
|
||||
honza801 <honza801@gmail.com>
|
||||
jbash aka John Bashinski <jbash@velvet.com>
|
||||
jloeser <jloeser@suse.de>
|
||||
johannes <johannes.brechtmann@gmail.com>
|
||||
jonathan-teh <30538043+jonathan-teh@users.noreply.github.com>
|
||||
leo-lb <lle-bout@zaclys.net>
|
||||
logan <logancaldwell23@gmail.com>
|
||||
masem <matej.semian@gmail.com>
|
||||
maximilian attems <max@stro.at>
|
||||
mulhern <amulhern@redhat.com>
|
||||
mwberry <mwberry@users.noreply.github.com>
|
||||
nabijaczleweli <nabijaczleweli@gmail.com>
|
||||
privb0x23 <privb0x23@users.noreply.github.com>
|
||||
tpg <tpgxyz@gmail.com>
|
||||
realtime-neil <neil@rtr.ai>
|
||||
xtraeme <xtraeme@voidlinux.eu>
|
||||
Дамјан Георгиевски <gdamjan@gmail.com>
|
||||
|
23
HACKING
23
HACKING
@@ -1,23 +0,0 @@
|
||||
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.
|
||||
|
||||
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, just run dracut with an output file name and, optionally, a
|
||||
kernel version (it defaults to using the current). The appropriate
|
||||
modules will be copied over and things should be good to go. If you'd
|
||||
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"
|
||||
while kernel modules are called "drivers".
|
||||
|
||||
Requirements:
|
||||
* udev
|
||||
* nfs module: nfs daemon and rpc helper
|
||||
* iscsi: iscsi
|
248
HACKING.md
Normal file
248
HACKING.md
Normal file
@@ -0,0 +1,248 @@
|
||||
# Dracut Developer Guidelines
|
||||
|
||||
## git
|
||||
|
||||
Currently dracut lives on github.com and kernel.org.
|
||||
|
||||
* https://github.com/dracutdevs/dracut.git
|
||||
* https://git.kernel.org/pub/scm/boot/dracut/dracut.git
|
||||
|
||||
Pull requests should be filed preferably on github nowadays.
|
||||
|
||||
### Commit Messages
|
||||
|
||||
Commit messages should answer these questions:
|
||||
|
||||
* What?: a short summary of what you changed in the subject line.
|
||||
* Why?: what the intended outcome of the change is (arguably the most important piece of information that should go into a message).
|
||||
* How?: if multiple approaches for achieving your goal were available, you also want to explain why you chose the used implementation strategy.
|
||||
Note that you should not explain how your change achieves your goal in your commit message.
|
||||
That should be obvious from the code itself.
|
||||
If you cannot achieve that clarity with the used programming language, use comments within the code instead.
|
||||
|
||||
The commit message is primarily the place for documenting the why.
|
||||
|
||||
Commit message titles should follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
|
||||
|
||||
Format is `<type>[optional scope]: <description>`, where `type` is one of:
|
||||
|
||||
* fix: A bug fix
|
||||
* feat: A new feature
|
||||
* perf: A code change that improves performance
|
||||
* refactor: A code change that neither fixes a bug nor adds a feature
|
||||
* style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
||||
* test: Adding missing tests or correcting existing tests
|
||||
* docs: Documentation only changes
|
||||
* revert: Reverts a previous commit
|
||||
* chore: Other changes that don't modify src or test files
|
||||
* build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
|
||||
* ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
|
||||
|
||||
`scope` should be the module name (without numbers) or:
|
||||
|
||||
* cli: for the dracut command line interface
|
||||
* rt: for the dracut initramfs runtime logic
|
||||
* functions: for general purpose dracut functions
|
||||
|
||||
Commit messages are checked with [Commisery](https://github.com/tomtom-international/commisery).
|
||||
|
||||
## Writing modules
|
||||
|
||||
Some general rules for writing modules:
|
||||
|
||||
* Use one of the inst family of functions to actually install files
|
||||
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 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,
|
||||
and having a bashism break your user's ability to boot really sucks.
|
||||
* Generator modules should have a two digit numeric prefix -- they run in
|
||||
ascending sort order. Anything in the 90-99 range is stuff that dracut
|
||||
relies on, so try not to break those hooks.
|
||||
* Hooks must have a .sh extension.
|
||||
* Generator modules are described in more detail later on.
|
||||
* 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.
|
||||
|
||||
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.
|
||||
|
||||
Most of the functionality that dracut implements are actually implemented
|
||||
by dracut modules. dracut modules live in modules.d, and have the following
|
||||
structure:
|
||||
|
||||
```
|
||||
dracut_install_dir/modules.d/
|
||||
00modname/
|
||||
module-setup.sh
|
||||
check
|
||||
<other files as needed by the hook>
|
||||
```
|
||||
|
||||
`00modname`: The name of the module prefixed by a two-digit numeric sort code.
|
||||
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
|
||||
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.
|
||||
|
||||
`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.
|
||||
|
||||
`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.
|
||||
|
||||
`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 $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.
|
||||
|
||||
`depends()`:
|
||||
This function should output a list of dracut modules
|
||||
that it relies upon. An example would be the nfs and iscsi modules,
|
||||
which rely on the network module to detect and configure network
|
||||
interfaces.
|
||||
|
||||
Any other files in the module will not be touched by dracut directly.
|
||||
|
||||
You are encouraged to provide a README that describes what the module is for.
|
||||
|
||||
|
||||
### Hooks
|
||||
|
||||
init has the following hook points to inject scripts:
|
||||
|
||||
`/lib/dracut/hooks/cmdline/*.sh`
|
||||
scripts for command line parsing
|
||||
|
||||
`/lib/dracut/hooks/pre-udev/*.sh`
|
||||
scripts to run before udev is started
|
||||
|
||||
`/lib/dracut/hooks/pre-trigger/*.sh`
|
||||
scripts to run before the main udev trigger is pulled
|
||||
|
||||
`/lib/dracut/hooks/initqueue/*.sh`
|
||||
runs in parallel to the udev trigger
|
||||
Udev events can add scripts here with /sbin/initqueue.
|
||||
If /sbin/initqueue is called with the "--onetime" option, the script
|
||||
will be removed after it was run.
|
||||
If /lib/dracut/hooks/initqueue/work is created and udev >= 143 then
|
||||
this loop can process the jobs in parallel to the udevtrigger.
|
||||
If the udev queue is empty and no root device is found or no root
|
||||
filesystem was mounted, the user will be dropped to a shell after
|
||||
a timeout.
|
||||
Scripts can remove themselves from the initqueue by "rm $job".
|
||||
|
||||
`/lib/dracut/hooks/pre-mount/*.sh`
|
||||
scripts to run before the root filesystem is mounted
|
||||
Network filesystems like NFS that do not use device files are an
|
||||
exception. Root can be mounted already at this point.
|
||||
|
||||
`/lib/dracut/hooks/mount/*.sh`
|
||||
scripts to mount the root filesystem
|
||||
If the udev queue is empty and no root device is found or no root
|
||||
filesystem was mounted, the user will be dropped to a shell after
|
||||
a timeout.
|
||||
|
||||
`/lib/dracut/hooks/pre-pivot/*.sh`
|
||||
scripts to run before latter initramfs cleanups
|
||||
|
||||
`/lib/dracut/hooks/cleanup/*.sh`
|
||||
scripts to run before the real init is executed and the initramfs
|
||||
disappears
|
||||
All processes started before should be killed here.
|
||||
|
||||
|
||||
## Testsuite
|
||||
|
||||
For the testsuite to work, you will have to install at least the following software packages:
|
||||
```
|
||||
dash \
|
||||
asciidoc \
|
||||
mdadm \
|
||||
lvm2 \
|
||||
dmraid \
|
||||
cryptsetup \
|
||||
nfs-utils \
|
||||
nbd \
|
||||
dhcp-server \
|
||||
scsi-target-utils \
|
||||
iscsi-initiator-utils \
|
||||
strace \
|
||||
syslinux \
|
||||
python-imgcreate \
|
||||
genisoimage \
|
||||
btrfs-progs \
|
||||
kmod-devel \
|
||||
gcc \
|
||||
bzip2 \
|
||||
xz \
|
||||
tar \
|
||||
wget \
|
||||
rpm-build \
|
||||
${NULL}
|
||||
```
|
||||
|
||||
How to run the testsuite:
|
||||
|
||||
```
|
||||
$ sudo make clean check
|
||||
```
|
||||
|
||||
in verbose mode:
|
||||
```
|
||||
$ sudo make V=1 clean check
|
||||
```
|
||||
|
||||
only specific test:
|
||||
```
|
||||
$ sudo make TESTS="01 20 40" clean check
|
||||
```
|
||||
only runs the 01, 20 and 40 tests.
|
||||
|
||||
debug a specific test case:
|
||||
```
|
||||
$ cd TEST-01-BASIC
|
||||
$ sudo make clean setup run
|
||||
```
|
||||
... change some kernel parameters ...
|
||||
```
|
||||
$ sudo make run
|
||||
```
|
||||
to run the test without doing the setup
|
81
Makefile
81
Makefile
@@ -1,7 +1,13 @@
|
||||
-include dracut-version.sh
|
||||
|
||||
VERSION ?= $(shell [ -d .git ] && git describe --abbrev=0 --tags --always 2>/dev/null || echo $(DRACUT_VERSION))
|
||||
GITVERSION ?= $(shell [ -d .git ] && { v=$$(git describe --tags --always 2>/dev/null); [ -n "$$v" ] && [ $${v\#*-} != $$v ] && echo -$${v\#*-}; } )
|
||||
DRACUT_MAIN_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :)
|
||||
ifeq ($(DRACUT_MAIN_VERSION),)
|
||||
DRACUT_MAIN_VERSION = $(DRACUT_VERSION)
|
||||
endif
|
||||
DRACUT_FULL_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --tags --always 2>/dev/null || :)
|
||||
ifeq ($(DRACUT_FULL_VERSION),)
|
||||
DRACUT_FULL_VERSION = $(DRACUT_VERSION)
|
||||
endif
|
||||
|
||||
-include Makefile.inc
|
||||
|
||||
@@ -12,8 +18,7 @@ pkglibdir ?= ${libdir}/dracut
|
||||
sysconfdir ?= ${prefix}/etc
|
||||
bindir ?= ${prefix}/bin
|
||||
mandir ?= ${prefix}/share/man
|
||||
CFLAGS ?= -O2 -g -Wall
|
||||
CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 $(KMOD_CFLAGS)
|
||||
CFLAGS ?= -O2 -g -Wall -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
|
||||
bashcompletiondir ?= ${datadir}/bash-completion/completions
|
||||
pkgconfigdatadir ?= $(datadir)/pkgconfig
|
||||
|
||||
@@ -40,10 +45,13 @@ man8pages = dracut.8 \
|
||||
|
||||
manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages)
|
||||
|
||||
.PHONY: install clean archive rpm testimage test all check AUTHORS doc dracut-version.sh
|
||||
.PHONY: install clean archive rpm srpm testimage test all check AUTHORS CONTRIBUTORS doc dracut-version.sh
|
||||
|
||||
all: dracut-version.sh dracut.pc dracut-install skipcpio/skipcpio
|
||||
|
||||
%.o : %.c
|
||||
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(KMOD_CFLAGS) $< -o $@
|
||||
|
||||
DRACUT_INSTALL_OBJECTS = \
|
||||
install/dracut-install.o \
|
||||
install/hashmap.o\
|
||||
@@ -61,7 +69,7 @@ install/util.o: install/util.c install/util.h install/macro.h install/log.h
|
||||
install/strv.o: install/strv.c install/strv.h install/util.h install/macro.h install/log.h
|
||||
|
||||
install/dracut-install: $(DRACUT_INSTALL_OBJECTS)
|
||||
$(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) $(KMOD_LIBS)
|
||||
$(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) $(FTS_LIBS) $(KMOD_LIBS)
|
||||
|
||||
logtee: logtee.c
|
||||
$(CC) $(LDFLAGS) -o $@ $<
|
||||
@@ -91,13 +99,16 @@ endif
|
||||
|
||||
%.xml: %.asc
|
||||
@rm -f -- "$@"
|
||||
asciidoc -d manpage -b docbook -o "$@" $<
|
||||
asciidoc -a "version=$(DRACUT_FULL_VERSION)" -d manpage -b docbook -o "$@" $<
|
||||
|
||||
dracut.8: dracut.usage.asc dracut.8.asc
|
||||
|
||||
dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
|
||||
@rm -f -- dracut.xml
|
||||
asciidoc -a numbered -d book -b docbook -o dracut.xml dracut.asc
|
||||
asciidoc -a "mainversion=$(DRACUT_MAIN_VERSION)" \
|
||||
-a "version=$(DRACUT_FULL_VERSION)" \
|
||||
-a numbered \
|
||||
-d book -b docbook -o dracut.xml dracut.asc
|
||||
@rm -f -- dracut.html
|
||||
xsltproc -o dracut.html --xinclude -nonet \
|
||||
--stringparam custom.css.source dracut.css \
|
||||
@@ -108,7 +119,7 @@ dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
|
||||
dracut.pc: Makefile.inc Makefile
|
||||
@echo "Name: dracut" > dracut.pc
|
||||
@echo "Description: dracut" >> dracut.pc
|
||||
@echo "Version: $(VERSION)$(GITVERSION)" >> dracut.pc
|
||||
@echo "Version: $(DRACUT_FULL_VERSION)" >> dracut.pc
|
||||
@echo "dracutdir=$(pkglibdir)" >> dracut.pc
|
||||
@echo "dracutmodulesdir=$(pkglibdir)/modules.d" >> dracut.pc
|
||||
@echo "dracutconfdir=$(pkglibdir)/dracut.conf.d" >> dracut.pc
|
||||
@@ -178,7 +189,7 @@ endif
|
||||
|
||||
dracut-version.sh:
|
||||
@rm -f dracut-version.sh
|
||||
@echo "DRACUT_VERSION=$(VERSION)$(GITVERSION)" > dracut-version.sh
|
||||
@echo "DRACUT_VERSION=$(DRACUT_FULL_VERSION)" > dracut-version.sh
|
||||
|
||||
clean:
|
||||
$(RM) *~
|
||||
@@ -193,28 +204,39 @@ clean:
|
||||
$(RM) $(manpages) dracut.html
|
||||
$(MAKE) -C test clean
|
||||
|
||||
dist: dracut-$(VERSION).tar.xz
|
||||
dist: dracut-$(DRACUT_MAIN_VERSION).tar.xz
|
||||
|
||||
dracut-$(VERSION).tar.xz: doc syncheck
|
||||
@echo "DRACUT_VERSION=$(VERSION)" > dracut-version.sh
|
||||
git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ > dracut-$(VERSION).tar
|
||||
mkdir -p dracut-$(VERSION)
|
||||
for i in $(manpages) dracut.html dracut-version.sh; do [ "$${i%/*}" != "$$i" ] && mkdir -p "dracut-$(VERSION)/$${i%/*}"; cp "$$i" "dracut-$(VERSION)/$$i"; done
|
||||
tar --owner=root --group=root -rf dracut-$(VERSION).tar $$(find dracut-$(VERSION) -type f)
|
||||
rm -fr -- dracut-$(VERSION).tar.xz dracut-$(VERSION)
|
||||
xz -9 dracut-$(VERSION).tar
|
||||
rm -f -- dracut-$(VERSION).tar
|
||||
dracut-$(DRACUT_MAIN_VERSION).tar.xz: doc syncheck
|
||||
@echo "DRACUT_VERSION=$(DRACUT_MAIN_VERSION)" > dracut-version.sh
|
||||
git archive --format=tar $(DRACUT_MAIN_VERSION) --prefix=dracut-$(DRACUT_MAIN_VERSION)/ > dracut-$(DRACUT_MAIN_VERSION).tar
|
||||
mkdir -p dracut-$(DRACUT_MAIN_VERSION)
|
||||
for i in $(manpages) dracut.html dracut-version.sh; do [ "$${i%/*}" != "$$i" ] && mkdir -p "dracut-$(DRACUT_MAIN_VERSION)/$${i%/*}"; cp "$$i" "dracut-$(DRACUT_MAIN_VERSION)/$$i"; done
|
||||
tar --owner=root --group=root -rf dracut-$(DRACUT_MAIN_VERSION).tar $$(find dracut-$(DRACUT_MAIN_VERSION) -type f)
|
||||
rm -fr -- dracut-$(DRACUT_MAIN_VERSION).tar.xz dracut-$(DRACUT_MAIN_VERSION)
|
||||
xz -9 dracut-$(DRACUT_MAIN_VERSION).tar
|
||||
rm -f -- dracut-$(DRACUT_MAIN_VERSION).tar
|
||||
|
||||
rpm: dracut-$(VERSION).tar.xz syncheck
|
||||
rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \
|
||||
cp dracut-$(VERSION).tar.xz "$$rpmbuild"; \
|
||||
LC_MESSAGES=C $$src/git2spec.pl $(VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \
|
||||
rpm: dracut-$(DRACUT_MAIN_VERSION).tar.xz syncheck
|
||||
rpmbuild=$$(mktemp -d -p /var/tmp rpmbuild-dracut.XXXXXX); src=$$(pwd); \
|
||||
cp dracut-$(DRACUT_MAIN_VERSION).tar.xz "$$rpmbuild"; \
|
||||
LC_MESSAGES=C $$src/git2spec.pl $(DRACUT_MAIN_VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \
|
||||
(cd "$$rpmbuild"; \
|
||||
wget https://www.gnu.org/licenses/lgpl-2.1.txt; \
|
||||
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
|
||||
--define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \
|
||||
--define "_rpmdir $$PWD" -ba dracut.spec; ) && \
|
||||
( mv "$$rpmbuild"/{,$$(arch)/}*.rpm $(DESTDIR).; rm -fr -- "$$rpmbuild"; ls $(DESTDIR)*.rpm )
|
||||
( mv "$$rpmbuild"/{,$$(uname -m)/}*.rpm $(DESTDIR).; rm -fr -- "$$rpmbuild"; ls $(DESTDIR)*.rpm )
|
||||
|
||||
srpm: dracut-$(DRACUT_MAIN_VERSION).tar.xz syncheck
|
||||
rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \
|
||||
cp dracut-$(DRACUT_MAIN_VERSION).tar.xz "$$rpmbuild"; \
|
||||
LC_MESSAGES=C $$src/git2spec.pl $(DRACUT_MAIN_VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \
|
||||
(cd "$$rpmbuild"; \
|
||||
[ -f $$src/lgpl-2.1.txt ] && cp $$src/lgpl-2.1.txt . || wget https://www.gnu.org/licenses/lgpl-2.1.txt; \
|
||||
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
|
||||
--define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \
|
||||
--define "_rpmdir $$PWD" -bs dracut.spec; ) && \
|
||||
( mv "$$rpmbuild"/*.src.rpm $(DESTDIR).; rm -fr -- "$$rpmbuild"; ls $(DESTDIR)*.rpm )
|
||||
|
||||
syncheck:
|
||||
@ret=0;for i in dracut-initramfs-restore.sh modules.d/*/*.sh; do \
|
||||
@@ -262,9 +284,12 @@ efi: all
|
||||
AUTHORS:
|
||||
git shortlog --numbered --summary -e |while read a rest || [ -n "$$rest" ]; do echo $$rest;done > AUTHORS
|
||||
|
||||
dracut.html.sign: dracut-$(VERSION).tar.xz dracut.html
|
||||
gpg-sign-all dracut-$(VERSION).tar.xz dracut.html
|
||||
CONTRIBUTORS:
|
||||
@git shortlog $(DRACUT_MAIN_VERSION).. --numbered --summary -e |while read a rest || [ -n "$$rest" ]; do echo "- $$rest";done
|
||||
|
||||
dracut.html.sign: dracut-$(DRACUT_MAIN_VERSION).tar.xz dracut.html
|
||||
gpg-sign-all dracut-$(DRACUT_MAIN_VERSION).tar.xz dracut.html
|
||||
|
||||
upload: dracut.html.sign
|
||||
kup put dracut-$(VERSION).tar.xz dracut-$(VERSION).tar.sign /pub/linux/utils/boot/dracut/
|
||||
kup put dracut-$(DRACUT_MAIN_VERSION).tar.xz dracut-$(DRACUT_MAIN_VERSION).tar.sign /pub/linux/utils/boot/dracut/
|
||||
kup put dracut.html dracut.html.sign /pub/linux/utils/boot/dracut/
|
||||
|
445
NEWS → NEWS.md
445
NEWS → NEWS.md
@@ -1,3 +1,444 @@
|
||||
Rendered view: https://github.com/dracutdevs/dracut/blob/master/NEWS.md
|
||||
|
||||
dracut-053
|
||||
==========
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* **dracut.sh:**
|
||||
* unfreeze /boot on exit ([d87ae137](https://github.com/dracutdevs/dracut/commit/d87ae13721d04a8a2192d896af224ac6965caf70))
|
||||
* proper return code for inst_multiple in dracut-init.sh ([d437970c](https://github.com/dracutdevs/dracut/commit/d437970c013e3287de263a1e60a117b15239896c))
|
||||
* **fcoe:**
|
||||
* rename rd.nofcoe to rd.fcoe ([6f7823bc](https://github.com/dracutdevs/dracut/commit/6f7823bce65dd4b52497dbb94892b637fd06471a))
|
||||
* rd.nofcoe=0 should disable fcoe ([805b46c2](https://github.com/dracutdevs/dracut/commit/805b46c2a81e04d69fc3af912942568516d05ee7))
|
||||
* **i18n:**
|
||||
* get rid of `eval` calls ([5387ed24](https://github.com/dracutdevs/dracut/commit/5387ed24c8b33da1214232d57ab1831e117aaba0))
|
||||
* create the keyboard symlinks again ([9e1c7f3d](https://github.com/dracutdevs/dracut/commit/9e1c7f3deadd387adaa97b189593b4ba3d7c6d5a))
|
||||
* **network-manager:**
|
||||
* run as a service if systemd module is present ([c17c5b76](https://github.com/dracutdevs/dracut/commit/c17c5b7604c8d61dd1c00ee22d44c3a5d7d6dfee))
|
||||
* rework how NM is started in debug mode ([34c73b33](https://github.com/dracutdevs/dracut/commit/34c73b339baa025dfd8916379c4d191be34a8af5))
|
||||
* **drm:** skip empty modalias files in drm module setup ([c3f24184](https://github.com/dracutdevs/dracut/commit/c3f241849de6434d063ef92e6880f6b0335c1800))
|
||||
|
||||
|
||||
dracut-052
|
||||
==========
|
||||
|
||||
#### Features
|
||||
|
||||
- **dracut:**
|
||||
- allow overriding the systemctl command for sysroot with `$SYSTEMCTL` for cross compilation
|
||||
- add additional global variables
|
||||
|
||||
Variables like `dbusconfdir` or `systemdnetwork` are now exported
|
||||
to the individual modules as global variables. If they are not set
|
||||
in the distribution dracut config files, they are set via `pkg-config`
|
||||
|
||||
- A `--no-uefi` option as been added to the CLI options to disable a default `uefi=yes`
|
||||
set by a configuration file.
|
||||
|
||||
- **kernel-modules:** add modules from `drivers/memory` for arm
|
||||
- **network-legacy:** send dhcp in parallel on all devices via the `single-dhcp` option
|
||||
- **dbus:** introduce a meta module for dbus
|
||||
- **dbus-broker:** introduce the dbus-broker module
|
||||
- **dbus-daemon:** introduce the dbus-daemon module
|
||||
- **systemd-ask-password:** introduce the systemd-ask-password module
|
||||
- **systemd-coredump:** introduce the systemd-coredump module
|
||||
- **systemd-modules-load:** introduce the systemd-modules-load module
|
||||
- **systemd-repart:** introduce the systemd-repart module
|
||||
- **systemd-sysctl:** introduce the systemd-sysctl module
|
||||
- **systemd-sysusers:** introduce the systemd-sysuser module
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
- first round of shellcheck for all shell scripts
|
||||
- revise all module checks to not error out about missing dependencies
|
||||
- use the top-level `/efi` path to address the EFI partition
|
||||
- correct the squash quirk
|
||||
- use `find_binary` instead of other methods, because `find_binary` honors `dracutsysrootdir`
|
||||
- quote globbing in module-setup.sh for `inst_multiple`
|
||||
- move ldconfig after library workaround
|
||||
- do not set cmdline for uefi images unless asked
|
||||
- **dracut:** don't override `PATH`, if `dracutsysrootdir` is set
|
||||
- **dracut-functions.sh:** check kernel config from `dracutsysrootdir`
|
||||
- **dracut-init.sh:** make inst_libdir_file work with `dracutsysrootdir` set
|
||||
- **dracut-install:** allow globbing for multiple sources
|
||||
- **06dbus:**
|
||||
- do not hardcode path to dbus utils
|
||||
- do not hardcode path to systemd unit
|
||||
- **uefi** use efivars fs over the deprecated sysfs entries
|
||||
- **keyring** adding shared keyring mode to systemd unit `dracut-pre-pivot.service`
|
||||
- **35network-manager:** avoid restarting NetworkManager
|
||||
- **90kernel-modules:** install generic crypto modules with hostonly unset
|
||||
- **99squash:** use kernel config instead of modprobe to check modules
|
||||
- **dbus-daemon:** use uid/gid from sysroot if `dracutsysrootdir` is set
|
||||
- **kernel-modules:** add reset controllers for arm
|
||||
- **kernel-network-modules:** also install modules from mdio subdirectory
|
||||
- **mdraid:**
|
||||
- remove the `offroot` option (long deprecated)
|
||||
- add the grow continue service `mdadm-grow-continue`
|
||||
- **network-legacy:** silent the check for dhcp leaseinfo
|
||||
- **network-manager:** allow override network manager version
|
||||
- **plymouth:** install binaries with dependencies
|
||||
- **shutdown:** add timeout to umount calls
|
||||
- **watchdog:** fix dependencies in `module-setup.sh`
|
||||
|
||||
#### Contributors
|
||||
|
||||
- Harald Hoyer <harald@redhat.com>
|
||||
- Jóhann B. Guðmundsson <johannbg@gmail.com>
|
||||
- Zoltán Böszörményi <zboszor@pr.hu>
|
||||
- Alexey Shabalin <shaba@altlinux.org>
|
||||
- Daniel Molkentin <daniel.molkentin@suse.com>
|
||||
- Luiz Angelo Daros de Luca <luizluca@gmail.com>
|
||||
- Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
|
||||
- Alexander Tsoy <alexander@tsoy.me>
|
||||
- Anjali Kulkarni <anjali.k.kulkarni@oracle.com>
|
||||
- Beniamino Galvani <bgalvani@redhat.com>
|
||||
- David Tardon <dtardon@redhat.com>
|
||||
- Javier Martinez Canillas <javierm@redhat.com>
|
||||
- Kairui Song <kasong@redhat.com>
|
||||
- Lukas Nykryn <lnykryn@redhat.com>
|
||||
- Matthew Thode <mthode@mthode.org>
|
||||
- Nicolas Chauvet <kwizart@gmail.com>
|
||||
- Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
|
||||
- Ondrej Mosnacek <omosnace@redhat.com>
|
||||
- Peter Levine <plevine457@gmail.com>
|
||||
- Petr Pavlu <petr.pavlu@suse.com>
|
||||
- Vladius25 <vkorol2509@icloud.com>
|
||||
- Yang Liu <50459973+ly4096x@users.noreply.github.com>
|
||||
- foopub <45460217+foopub@users.noreply.github.com>
|
||||
- realtime-neil <neil@rtr.ai>
|
||||
|
||||
|
||||
dracut-051
|
||||
==========
|
||||
|
||||
dracut:
|
||||
- allow running on a cross-compiled rootfs
|
||||
|
||||
dracutsysrootdir is the root directory, file existence checks use it.
|
||||
|
||||
DRACUT_LDCONFIG can override ldconfig with a different one that works
|
||||
on the sysroot with foreign binaries.
|
||||
|
||||
DRACUT_LDD can override ldd with a different one that works
|
||||
with foreign binaries.
|
||||
|
||||
DRACUT_TESTBIN can override /bin/sh. A cross-compiled sysroot
|
||||
may use symlinks that are valid only when running on the target
|
||||
so a real file must be provided that exist in the sysroot.
|
||||
|
||||
DRACUT_INSTALL now supports debugging dracut-install in itself
|
||||
when run by dracut but without debugging the dracut scripts.
|
||||
E.g. DRACUT_INSTALL="valgrind dracut-install or
|
||||
DRACUT_INSTALL="dracut-install --debug".
|
||||
|
||||
DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_LBZIP2, DRACUT_COMPRESS_LZMA,
|
||||
DRACUT_COMPRESS_XZ, DRACUT_COMPRESS_GZIP, DRACUT_COMPRESS_PIGZ,
|
||||
DRACUT_COMPRESS_LZOP, DRACUT_COMPRESS_ZSTD, DRACUT_COMPRESS_LZ4,
|
||||
DRACUT_COMPRESS_CAT: All of the compression utilities may be
|
||||
overridden, to support the native binaries in non-standard places.
|
||||
|
||||
DRACUT_ARCH overrides "uname -m".
|
||||
|
||||
SYSTEMD_VERSION overrides "systemd --version".
|
||||
|
||||
The dracut-install utility was overhauled to support sysroot via
|
||||
a new option -r and fixes for clang-analyze. It supports
|
||||
cross-compiler-ldd from
|
||||
https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f
|
||||
|
||||
DRACUT_INSTALL_PATH was introduced so dracut-install can work with
|
||||
a different PATH. In a cross-compiled environment (e.g. Yocto), PATH
|
||||
points to natively built binaries that are not in the host's /bin,
|
||||
/usr/bin, etc. dracut-install still needs plain /bin and /usr/bin
|
||||
that are relative to the cross-compiled sysroot.
|
||||
|
||||
DRACUT_INSTALL_LOG_TARGET and DRACUT_INSTALL_LOG_LEVEL were
|
||||
introduced so dracut-install can use different settings from
|
||||
DRACUT_LOG_TARGET and DRACUT_LOG_LEVEL.
|
||||
|
||||
- don't call fsfreeze on subvol of root file system
|
||||
- Use TMPDIR (typically /run/user/$UID) if available
|
||||
- dracut.sh: add check for invalid configuration files
|
||||
Emit a warning about possible misconfigured configuration files, where
|
||||
the spaces around values are missing for +=""
|
||||
- dracut-functions: fix find_binary() to return full path
|
||||
- dracut.sh: FIPS workaround for openssl-libs on Fedora/RHEL
|
||||
- dracut.sh: fix early microcode detection logic
|
||||
- dracut.sh: fix ia32 detection for uefi executables
|
||||
- dracut.sh: Add --version
|
||||
- dracut.sh: Add --hostonly-nics option
|
||||
- EFI Mode: only write kernel cmdline to UEFI binary
|
||||
- Allow $DRACUT_INSTALL to be not an absolute path
|
||||
- Don't print when a module is explicitly omitted (by default)
|
||||
- Remove uses of bash (and bash specific syntax) in runtime scripts
|
||||
- dracut-init.sh: Add a helper for detect device kernel modules
|
||||
- dracut-functions.sh: Fix check_block_and_slaves_all
|
||||
- dracut-functions.sh: add a helper to check if kernel module is available
|
||||
|
||||
Documentation
|
||||
- dracut.cmdline.7.asc: clarify usage of `rd.lvm.vg` and `rd.lvm.lv`
|
||||
- dracut.conf.5.asc: document how to config --no-compress in the config
|
||||
- fix CI badges in README.md and fix dracut description
|
||||
- dracut.modules.7.asc: fix typos
|
||||
- dracut.modules.7.asc: fix reference to insmodpost module
|
||||
- Add --version to man page
|
||||
- Adding code of conduct
|
||||
- Document initqueue/online hook
|
||||
|
||||
|
||||
dracut-install:
|
||||
- install: also install post weak dependencies of kernel modules
|
||||
- install: Globbing support for resolving "firmware:"
|
||||
|
||||
mkinitrd:
|
||||
- use vmlinux regex for ppc*, vmlinuz for i686
|
||||
|
||||
mkinitrd-suse:
|
||||
- fix i586 platform detection
|
||||
|
||||
modules:
|
||||
|
||||
00systemd:
|
||||
- skip dependency add for non-existent units
|
||||
- add missing cryptsetup-related targets
|
||||
|
||||
05busybox:
|
||||
- simplify listing of supported utilities
|
||||
|
||||
06rngd:
|
||||
- install dependant libs too
|
||||
- Do not start inside container
|
||||
|
||||
10i18n:
|
||||
- i18n: Always install /etc/vconsole.conf
|
||||
|
||||
35network-legacy:
|
||||
- dhclient-script: Fix typo in output of BOUND & BOUND6 cases
|
||||
- simplify fallback dhcp setup
|
||||
|
||||
35network-manager:
|
||||
- ensure that nm-run.sh is executed when needed
|
||||
- install libnss DNS and mDNS plugins
|
||||
- always pull in machinery to read ifcfg files
|
||||
- set kernel hostname from the command line
|
||||
- move connection generation to a lib file
|
||||
|
||||
40network:
|
||||
- fix glob matching ipv6 addresses
|
||||
- net-lib.sh: support infiniband network mac addresses
|
||||
|
||||
45url-lib:
|
||||
- drop NSS if it's not in curl --version
|
||||
|
||||
80cms:
|
||||
- regenerate NetworkManager connections
|
||||
|
||||
90btrfs:
|
||||
- force preload btrfs module
|
||||
- Install crypto modules in 90kernel-modules
|
||||
|
||||
90crypt:
|
||||
- cryptroot-ask: no warn if /run/cryptsetup exist
|
||||
- install crypto modules in 90kernel-modules
|
||||
- try to catch kernel config changes
|
||||
- fix force on multiple lines
|
||||
- pull in remote-cryptsetup.target enablement
|
||||
- cryptroot-ask: unify /etc/crypttab and rd.luks.key
|
||||
|
||||
90dmsquash-live:
|
||||
- iso-scan.sh: Provide an easy reference to iso-scan device
|
||||
|
||||
90kernel-modules:
|
||||
- remove nfit from static module list (see nvdimm module)
|
||||
- install crypto modules in 90kernel-modules
|
||||
- add sg kernel module
|
||||
- add pci_hyperv
|
||||
- install block drivers more strictly
|
||||
- install less modules for hostonly mode
|
||||
- arm: add drivers/hwmon for arm/arm64
|
||||
|
||||
90kernel-network-modules
|
||||
- on't install iscsi related module (use 95iscsi)
|
||||
|
||||
90lvm:
|
||||
- remove unnecessary ${initdir} from lvm_scan.sh
|
||||
- fix removal of pvscan from udev rules
|
||||
- do not add newline to cmdline
|
||||
|
||||
90multipath:
|
||||
- add automatic configuration for multipath
|
||||
(adds 'rd.multipath=default' to use the default config)
|
||||
- install kpartx's 11-dm-parts.rules
|
||||
|
||||
90nvdimm:
|
||||
- new module for NVDIMM support
|
||||
|
||||
90ppcmac:
|
||||
- respect DRACUT_ARCH, don't exclude ppcle
|
||||
|
||||
90qemu-net:
|
||||
- in hostonly mode, only install if network is needed
|
||||
- install less module for strict hostonly mode
|
||||
|
||||
91zipl:
|
||||
- parse-zipl.sh: honor SYSTEMD_READY
|
||||
|
||||
95cifs:
|
||||
- pass rootflags to mount
|
||||
- install new softdeps (sha512, gcm, ccm, aead2)
|
||||
|
||||
95dasd:
|
||||
- only install /etc/dasd.conf if present
|
||||
|
||||
95dcssblk:
|
||||
- fix script permissions
|
||||
|
||||
95fcoe:
|
||||
- fix pre-trigger stage by replacing exit with return in lldpad.sh
|
||||
- default rd.nofcoe to false
|
||||
- don't install if there is no FCoE hostonly devices
|
||||
|
||||
95iscsi:
|
||||
- fix missing space when compiling cmdline args
|
||||
- fix ipv6 target discovery
|
||||
|
||||
95nfs:
|
||||
- only install rpc services for NFS < 4 when hostonly is strict
|
||||
- Change the order of NFS servers during the boot
|
||||
(next-server option has higher priority than DHCP-server itself)
|
||||
- install less module if hostonly mode is strict
|
||||
|
||||
95nvmf:
|
||||
- add module for NVMe-oF
|
||||
- add NVMe over TCP support
|
||||
|
||||
95resume:
|
||||
- do not resume on iSCSI, FCoE or NBD
|
||||
|
||||
95rootfs-block:
|
||||
- mount-root.sh: fix writing fstab file with missing fsck flag
|
||||
- only write root argument for block device
|
||||
|
||||
95zfcp:
|
||||
- match simplified rd.zfcp format too
|
||||
|
||||
95zfcp_rules:
|
||||
- parse-zfcp.sh: remove rule existence check
|
||||
|
||||
95znet:
|
||||
- add a rd.znet_ifname= option
|
||||
|
||||
98dracut-systemd:
|
||||
- remove memtrace-ko and rd.memdebug=4 support in dracut
|
||||
- remove cleanup_trace_mem calls
|
||||
- dracut-initqueue: Print more useful info in case of timeout
|
||||
- as of v246 of systemd "syslog" and "syslog-console" switches have been deprecated
|
||||
- don't wait for root device if remote cryptsetup active
|
||||
|
||||
99base:
|
||||
- dracut-lib.sh: quote variables in parameter expansion patterns
|
||||
- remove memtrace-ko and rd.memdebug=4 support in dracut
|
||||
- remove cleanup_trace_mem calls
|
||||
- see new module 99memstrack
|
||||
- prevent creating unexpected files on the host when running dracut
|
||||
|
||||
99memstrack:
|
||||
- memstrack is a new tool to track the overall memory usage and
|
||||
allocation, which can help off load the improve the builtin module
|
||||
memory tracing function in dracut.
|
||||
|
||||
99squash:
|
||||
- don't hardcode the squash sub directories
|
||||
- improve pre-requirements check
|
||||
- check require module earlier, and properly
|
||||
|
||||
new modules:
|
||||
- nvmf
|
||||
- watchdog-modules
|
||||
- dbus
|
||||
- network-wicked
|
||||
|
||||
removed modules:
|
||||
- stratis
|
||||
|
||||
test suite:
|
||||
- use dd from /dev/zero, instead of creating files with a hole
|
||||
- TEST-03-USR-MOUNT/test.sh: increase loglevel
|
||||
- TEST-12-RAID-DEG/create-root.sh: more udevadm settle
|
||||
- TEST-35-ISCSI-MULTI: bump disk space
|
||||
- TEST-41-NBD-NM/Makefile: should be based on TEST-40-NBD not TEST-20-NFS
|
||||
- TEST-99: exclude /etc/dnf/* from check
|
||||
|
||||
dracut-050
|
||||
==========
|
||||
|
||||
dracut:
|
||||
- support for running on a cross-compiled rootfs, see README.cross
|
||||
- add support for creating secureboot signed UEFI images
|
||||
- use microcode found in packed cpio images
|
||||
- `-k/--kmodir` must now contain "lib/modules/$KERNEL_VERSION"
|
||||
use DRACUT_KMODDIR_OVERRIDE=1 to ignore this check
|
||||
- support the EFI Stub loader's splash image feature.
|
||||
`--uefi-splash-image <FILE>`
|
||||
|
||||
dracut modules:
|
||||
- remove bashism in various boot scripts
|
||||
- emergency mode: use sulogin
|
||||
|
||||
fcoe:
|
||||
- add rd.nofcoe option to disable the FCoE module from the command line
|
||||
|
||||
10i18n:
|
||||
- fix keymaps not getting included sometimes
|
||||
- use eurlatgr as default console font
|
||||
|
||||
iscsi:
|
||||
- add option `rd.iscsi.testroute`
|
||||
|
||||
multipath:
|
||||
- fix udev rules detection of multipath devices
|
||||
|
||||
network:
|
||||
- support NetworkManager
|
||||
|
||||
network-legacy:
|
||||
- fix classless static route parsing
|
||||
- ifup: fix typo when calling dhclient --timeout
|
||||
- ifup: nuke pid and lease files if dhclient failed
|
||||
- fix ip=dhcp,dhcp6
|
||||
- use $name instead of $env{INTERFACE} (systemd-udevd regression)
|
||||
|
||||
shutdown:
|
||||
- fix for non-systemd reboot/halt/shutdown commands
|
||||
- set selinux labels
|
||||
- fix shutdown with console=null
|
||||
|
||||
lsinitrd:
|
||||
- list squash content as well
|
||||
- handle UEFI created with dracut --uefi
|
||||
- make lsinitrd usable for images made with Debian mkinitramfs
|
||||
|
||||
dracut-install:
|
||||
- fixed ldd parsing
|
||||
- install kernel module dependencies of dependencies
|
||||
- fixed segfault for hashing NULL pointers
|
||||
- add support for compressed firmware files
|
||||
- dracut_mkdir(): create parent directories as needed.
|
||||
|
||||
configure:
|
||||
- Find FTS library with --as-needed
|
||||
|
||||
test suite:
|
||||
- lots of cleanups
|
||||
- add github actions
|
||||
|
||||
new modules:
|
||||
- rngd
|
||||
- network-manager
|
||||
- ppcmac - thermal/fan control modules on PowerPC based Macs
|
||||
|
||||
dracut-049
|
||||
==========
|
||||
lsinitrd:
|
||||
@@ -20,6 +461,7 @@ livenet:
|
||||
|
||||
dmsquash-live:
|
||||
- Support a flattened squashfs.img
|
||||
- Remove obsolete osmin.img processing
|
||||
|
||||
dracut-systemd:
|
||||
- Start systemd-vconsole-setup before dracut-cmdline-ask
|
||||
@@ -209,6 +651,9 @@ nfs:
|
||||
|
||||
fips:
|
||||
- fixed creating path to .hmac of kernel based on BOOT_IMAGE
|
||||
- turn info calls into fips_info calls
|
||||
- modprobe failures during manual module loading is not fatal
|
||||
|
||||
|
||||
lunmask:
|
||||
- add module to handle LUN masking
|
86
README
86
README
@@ -1,86 +0,0 @@
|
||||
dracut
|
||||
------
|
||||
dracut is an event driven initramfs infrastructure.
|
||||
|
||||
dracut (the tool) is used to create an initramfs image by copying tools
|
||||
and files from an installed system and combining it with the
|
||||
dracut framework, usually found in /usr/lib/dracut/modules.d.
|
||||
|
||||
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.
|
||||
This helps to keep the time required in the initramfs as little as
|
||||
possible so that things like a 5 second boot aren't made impossible as
|
||||
a result of the very existence of an initramfs. It's likely that
|
||||
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 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 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 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 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,
|
||||
and having a bashism break your user's ability to boot really sucks.
|
||||
* Generator modules should have a two digit numeric prefix -- they run in
|
||||
ascending sort order. Anything in the 90-99 range is stuff that dracut
|
||||
relies on, so try not to break those hooks.
|
||||
* Hooks must have a .sh extension.
|
||||
* Generator modules are described in more detail in README.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.
|
||||
|
||||
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 github.com and 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@github.com:dracutdevs/dracut.git
|
||||
|
||||
Git Web:
|
||||
https://github.com/dracutdevs/dracut.git
|
||||
|
||||
http://git.kernel.org/?p=boot/dracut/dracut.git
|
||||
|
||||
Project Documentation:
|
||||
http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
|
||||
|
||||
Project Wiki:
|
||||
http://dracut.wiki.kernel.org
|
||||
|
||||
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
|
70
README.cross
Normal file
70
README.cross
Normal file
@@ -0,0 +1,70 @@
|
||||
Dracut supports running against a sysroot directory that is different
|
||||
from the actual root (/) directory of the running system. It is most
|
||||
useful for creating/bootstrapping a new system that may or may not be
|
||||
using the same CPU architecture as the host system, i.e. building a
|
||||
whole Linux system with a cross-compiler framework like Yocto.
|
||||
|
||||
The user-visible frontend change is the introduction of a new option
|
||||
called "-r" or "--sysroot". It expects a directory that contains the
|
||||
complete Linux system that has all the files (kernel drivers, firmware,
|
||||
executables, libraries and others) necessary to construct the initramfs.
|
||||
|
||||
E.g: dracut --sysroot /path/to/sysroot initramfs.img kernelversion
|
||||
|
||||
To support this, a new global variable was introduced inside dracut.
|
||||
This variable is called "dracutsysrootdir" and all the files installed
|
||||
into the initramfs image is searched relative to the sysroot directory.
|
||||
This variable can also be set externally to dracut without using option
|
||||
-r/--sysroot.
|
||||
|
||||
There are other details that are necessary to tweak to be able to
|
||||
run on cross-compiled (a.k.a. foreign) binaries.
|
||||
|
||||
dracut uses these crucial utilities during its operation:
|
||||
|
||||
ldd
|
||||
===
|
||||
It lists dynamic library dependencies for executables or libraries
|
||||
|
||||
ldconfig
|
||||
========
|
||||
It creates /etc/ld.so.cache, i.e. the cached information about libraries
|
||||
known to the system.
|
||||
|
||||
These utilities the way they exist on the host system only work on
|
||||
the host system.
|
||||
|
||||
To support cross-compiled binaries, a different ldd variant is needed that
|
||||
works on those binaries. One such ldd script is found at
|
||||
https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f
|
||||
|
||||
ldconfig in GLIBC as is does support a sysroot with its -r option.
|
||||
|
||||
Extra environment variables needed to run dracut on the sysroot are
|
||||
documented in the dracut(8) man page.
|
||||
|
||||
For the Plymouth boot splash to be added to the initramfs image,
|
||||
this gitlab PR is needed for Plymouth:
|
||||
https://gitlab.freedesktop.org/plymouth/plymouth/merge_requests/72
|
||||
|
||||
Extensions to be used with Yocto
|
||||
================================
|
||||
|
||||
examples/yocto/classes/dracut.bbclass:
|
||||
Bitbake class for running dracut during the "do_rootfs" stage of
|
||||
creating a distribution image and from the postinstall script of
|
||||
a package. A kernel recipe needs this line to activate it:
|
||||
|
||||
inherit dracut
|
||||
|
||||
examples/yocto/postinst-intercepts/execute_dracut
|
||||
The "intercept" script used during "do_rootfs" mentioned above.
|
||||
|
||||
examples/yocto/recipes/cross-compiler-ldd_git.bb
|
||||
Package recipe for the cross-compiler-ldd script from the above link.
|
||||
|
||||
All the above three need to be added to a Yocto layer to their
|
||||
proper locations.
|
||||
|
||||
They were tested on Yocto 2.7 with MACHINE="intel-core2-32" and
|
||||
MACHINE="genericx86-64".
|
73
README.md
73
README.md
@@ -1,30 +1,55 @@
|
||||
# dracut - master branch
|
||||
dracut
|
||||
====
|
||||
|
||||
dracut is an initramfs infrastructure.
|
||||
dracut is an event driven initramfs infrastructure.
|
||||
|
||||
## Travis
|
||||
[](.github/CODE_OF_CONDUCT.md)
|
||||
[](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-32)
|
||||
[](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-33)
|
||||
[](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-latest)
|
||||
|
||||
[](https://travis-ci.org/dracutdevs/dracut)
|
||||
dracut (the tool) is used to create an initramfs image by copying tools
|
||||
and files from an installed system and combining it with the
|
||||
dracut framework, usually found in /usr/lib/dracut/modules.d.
|
||||
|
||||
## CentOS CI
|
||||
Unlike other implementations, dracut hard-codes as little
|
||||
as possible into the initramfs. 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.
|
||||
This helps to keep the time required in the initramfs as little as
|
||||
possible so that things like a 5 second boot aren't made impossible as
|
||||
a result of the very existence of an initramfs.
|
||||
|
||||
[](https://ci.centos.org/job/dracut-push-master/)
|
||||
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 initramfs. They live in the modules.d
|
||||
subdirectory, and use functionality provided by dracut-functions to do their
|
||||
work.
|
||||
|
||||
- Test 01: [](https://ci.centos.org/job/dracut-matrix-master/TESTS=01,label=dracut-ci-slave01/)
|
||||
- Test 02: [](https://ci.centos.org/job/dracut-matrix-master/TESTS=02,label=dracut-ci-slave01/)
|
||||
- Test 03: [](https://ci.centos.org/job/dracut-matrix-master/TESTS=03,label=dracut-ci-slave01/)
|
||||
- Test 04: [](https://ci.centos.org/job/dracut-matrix-master/TESTS=04,label=dracut-ci-slave01/)
|
||||
- Test 10: [](https://ci.centos.org/job/dracut-matrix-master/TESTS=10,label=dracut-ci-slave01/)
|
||||
- Test 11: [](https://ci.centos.org/job/dracut-matrix-master/TESTS=11,label=dracut-ci-slave01/)
|
||||
- Test 12: [](https://ci.centos.org/job/dracut-matrix-master/TESTS=12,label=dracut-ci-slave01/)
|
||||
- Test 13: [](https://ci.centos.org/job/dracut-matrix-master/TESTS=13,label=dracut-ci-slave01/)
|
||||
- Test 14: [](https://ci.centos.org/job/dracut-matrix-master/TESTS=14,label=dracut-ci-slave01/)
|
||||
- Test 15: [](https://ci.centos.org/job/dracut-matrix-master/TESTS=15,label=dracut-ci-slave01/)
|
||||
- Test 16: [](https://ci.centos.org/job/dracut-matrix-master/TESTS=16,label=dracut-ci-slave01/)
|
||||
- Test 17: [](https://ci.centos.org/job/dracut-matrix-master/TESTS=17,label=dracut-ci-slave01/)
|
||||
- Test 20: [](https://ci.centos.org/job/dracut-matrix-master/TESTS=20,label=dracut-ci-slave01/)
|
||||
- Test 30: [](https://ci.centos.org/job/dracut-matrix-master/TESTS=30,label=dracut-ci-slave01/)
|
||||
- Test 31: [](https://ci.centos.org/job/dracut-matrix-master/TESTS=31,label=dracut-ci-slave01/)
|
||||
- Test 40: [](https://ci.centos.org/job/dracut-matrix-master/TESTS=40,label=dracut-ci-slave01/)
|
||||
- Test 50: [](https://ci.centos.org/job/dracut-matrix-master/TESTS=50,label=dracut-ci-slave01/)
|
||||
- Test 70: [](https://ci.centos.org/job/dracut-matrix-master/TESTS=70,label=dracut-ci-slave01/)
|
||||
Currently dracut lives on github.com and 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:
|
||||
https://github.com/dracutdevs/dracut.git
|
||||
http://git.kernel.org/?p=boot/dracut/dracut.git
|
||||
|
||||
Project Documentation:
|
||||
http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
|
||||
|
||||
Project Wiki:
|
||||
http://dracut.wiki.kernel.org
|
||||
|
||||
See the github issue tracker for things which still need to be done and HACKING.md
|
||||
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
|
||||
|
112
README.modules
112
README.modules
@@ -1,112 +0,0 @@
|
||||
Most of the functionality that dracut implements are actually implemented
|
||||
by dracut modules. dracut modules live in modules.d, and have the following
|
||||
structure:
|
||||
|
||||
dracut_install_dir/modules.d/
|
||||
00modname/
|
||||
module-setup.sh
|
||||
check
|
||||
<other files as needed by the hook>
|
||||
|
||||
00modname: The name of the module prefixed by a two-digit numeric sort code.
|
||||
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
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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 $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.
|
||||
|
||||
depends():
|
||||
This function should output a list of dracut modules
|
||||
that it relies upon. An example would be the nfs and iscsi modules,
|
||||
which rely on the network module to detect and configure network
|
||||
interfaces.
|
||||
|
||||
Any other files in the module will not be touched by dracut directly.
|
||||
|
||||
You are encouraged to provide a README that describes what the module is for.
|
||||
|
||||
|
||||
HOOKS
|
||||
=====
|
||||
|
||||
init has the following hook points to inject scripts:
|
||||
|
||||
/lib/dracut/hooks/cmdline/*.sh
|
||||
scripts for command line parsing
|
||||
|
||||
/lib/dracut/hooks/pre-udev/*.sh
|
||||
scripts to run before udev is started
|
||||
|
||||
/lib/dracut/hooks/pre-trigger/*.sh
|
||||
scripts to run before the main udev trigger is pulled
|
||||
|
||||
/lib/dracut/hooks/initqueue/*.sh
|
||||
runs in parallel to the udev trigger
|
||||
Udev events can add scripts here with /sbin/initqueue.
|
||||
If /sbin/initqueue is called with the "--onetime" option, the script
|
||||
will be removed after it was run.
|
||||
If /lib/dracut/hooks/initqueue/work is created and udev >= 143 then
|
||||
this loop can process the jobs in parallel to the udevtrigger.
|
||||
If the udev queue is empty and no root device is found or no root
|
||||
filesystem was mounted, the user will be dropped to a shell after
|
||||
a timeout.
|
||||
Scripts can remove themselves from the initqueue by "rm $job".
|
||||
|
||||
/lib/dracut/hooks/pre-mount/*.sh
|
||||
scripts to run before the root filesystem is mounted
|
||||
Network filesystems like NFS that do not use device files are an
|
||||
exception. Root can be mounted already at this point.
|
||||
|
||||
/lib/dracut/hooks/mount/*.sh
|
||||
scripts to mount the root filesystem
|
||||
If the udev queue is empty and no root device is found or no root
|
||||
filesystem was mounted, the user will be dropped to a shell after
|
||||
a timeout.
|
||||
|
||||
/lib/dracut/hooks/pre-pivot/*.sh
|
||||
scripts to run before latter initramfs cleanups
|
||||
|
||||
/lib/dracut/hooks/cleanup/*.sh
|
||||
scripts to run before the real init is executed and the initramfs
|
||||
disappears
|
||||
All processes started before should be killed here.
|
||||
|
@@ -1,45 +0,0 @@
|
||||
For the testsuite to work, you will have to install at least the following software packages:
|
||||
dash \
|
||||
asciidoc \
|
||||
mdadm \
|
||||
lvm2 \
|
||||
dmraid \
|
||||
cryptsetup \
|
||||
nfs-utils \
|
||||
nbd \
|
||||
dhcp-server \
|
||||
scsi-target-utils \
|
||||
iscsi-initiator-utils \
|
||||
strace \
|
||||
syslinux \
|
||||
python-imgcreate \
|
||||
genisoimage \
|
||||
btrfs-progs \
|
||||
kmod-devel \
|
||||
gcc \
|
||||
bzip2 \
|
||||
xz \
|
||||
tar \
|
||||
wget \
|
||||
rpm-build \
|
||||
${NULL}
|
||||
|
||||
TEST-04-FULL-SYSTEMD: systemd >= 187
|
||||
|
||||
How to run the testsuite:
|
||||
|
||||
$ sudo make clean check
|
||||
|
||||
in verbose mode:
|
||||
$ sudo make V=1 clean check
|
||||
|
||||
only specific test:
|
||||
$ sudo make TESTS="01 20 40" clean check
|
||||
only runs the 01, 20 and 40 tests.
|
||||
|
||||
debug a specific test case:
|
||||
$ cd TEST-01-BASIC
|
||||
$ sudo make clean setup run
|
||||
... change some kernel parameters ...
|
||||
$ sudo make run
|
||||
to run the test without doing the setup
|
51
TODO
51
TODO
@@ -1,51 +0,0 @@
|
||||
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.
|
||||
|
||||
Items are ordered in priority.
|
||||
|
||||
INITRAMFS TODO
|
||||
|
||||
- search domain string
|
||||
- allow dual stack configuration (IPv4, IPv6) for the same interface
|
||||
- "bind-mount" kernel drivers in real root for the rescue image,
|
||||
if the real root does not have any kernel modules for this kernel
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1046510
|
||||
- use info and warn prefix
|
||||
- generate systemd unit dracut-initramfs-restore in /run/systemd dynamically
|
||||
- put "root=" parsing hooks in separate hook dir
|
||||
- call "root=" parsing hooks after getting new rootpath from dhcp
|
||||
- put mount hook in main initqueue loop / careful about resume!
|
||||
- the hard-coded list of udev rules that we care about is kind of lame.
|
||||
- panic fallback
|
||||
- progress indication for fsck https://bugzilla.redhat.com/show_bug.cgi?id=827118
|
||||
- domain, searchdomain https://bugzilla.redhat.com/show_bug.cgi?id=840778
|
||||
- probably fix "--include" https://bugzilla.redhat.com/show_bug.cgi?id=849338
|
||||
|
||||
GENERATOR TODO
|
||||
|
||||
- report errors on missing files in check()
|
||||
- remove wait for swap devs, if no "resume=" is given on the kernel command line
|
||||
- remove wait for swap devs, if the "resume" dracut module is not included (omitted)
|
||||
- add presets (predefined set of modules)
|
||||
- add interpreter/plugin-scripts to be sourced at the beginning or end (can use dracut-functions)
|
||||
- add mechanism for module specific command line options
|
||||
- pkg-config integration, to make it easy for other packages to use us.
|
||||
- default module specification could use some work
|
||||
- udev rule copying, as mentioned above, is a bit too hard-coded
|
||||
|
||||
- dracut-install parse LD_SHOW_AUXV="" AT_PLATFORM for lib install
|
||||
|
||||
CODE TODO
|
||||
|
||||
- document more functions
|
||||
- make function vars local, and prefix with "_"
|
||||
|
||||
Future Enhancement Requests
|
||||
|
||||
- run ssh server to enter crypto password or perform debugging (supported by debian)
|
||||
- https://bugzilla.redhat.com/show_bug.cgi?id=524727 - dracut + encrypted root + networking
|
||||
|
||||
- lsinitrd --print-cmdline
|
||||
- dracut --print-cmdline error if additional arguments
|
||||
- library for cmdline
|
50
configure
vendored
50
configure
vendored
@@ -7,6 +7,7 @@ prefix=/usr
|
||||
|
||||
enable_documentation=yes
|
||||
|
||||
CC="${CC:-cc}"
|
||||
PKG_CONFIG="${PKG_CONFIG:-pkg-config}"
|
||||
|
||||
# Little helper function for reading args from the commandline.
|
||||
@@ -18,9 +19,9 @@ read_arg() {
|
||||
# $3 = arg parameter
|
||||
local rematch='^[^=]*=(.*)$'
|
||||
if [[ $2 =~ $rematch ]]; then
|
||||
read "$1" <<< "${BASH_REMATCH[1]}"
|
||||
read -r "$1" <<< "${BASH_REMATCH[1]}"
|
||||
else
|
||||
read "$1" <<< "$3"
|
||||
read -r "$1" <<< "$3"
|
||||
# There is no way to shift our callers args, so
|
||||
# return 1 to indicate they should do it instead.
|
||||
return 1
|
||||
@@ -57,6 +58,50 @@ if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 23 "; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat <<EOF >conftest.c
|
||||
#include <fts.h>
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
${CC} $CFLAGS $LDFLAGS conftest.c >/dev/null 2>&1
|
||||
ret=$?
|
||||
rm -f conftest.c a.out
|
||||
|
||||
# musl doesn't have fts.h included
|
||||
if test $ret -ne 0; then
|
||||
echo "dracut needs fts development files." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat <<EOF >conftest.c
|
||||
#include <fts.h>
|
||||
int main(void) {
|
||||
fts_open(0, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
|
||||
found=no
|
||||
for lib in "-lc" "-lfts"; do
|
||||
# shellcheck disable=SC2086
|
||||
${CC} $CFLAGS $LDFLAGS conftest.c -Wl,$lib >/dev/null 2>&1
|
||||
ret=$?
|
||||
if test $ret -eq 0; then
|
||||
FTS_LIBS="$lib"
|
||||
found=yes
|
||||
break;
|
||||
fi
|
||||
done
|
||||
rm -f conftest.c a.out
|
||||
|
||||
if test $found = no; then
|
||||
echo "dracut couldn't find usable fts library" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat > Makefile.inc.$$ <<EOF
|
||||
prefix ?= ${prefix}
|
||||
libdir ?= ${libdir:-${prefix}/lib}
|
||||
@@ -68,6 +113,7 @@ enable_documentation ?= ${enable_documentation:-yes}
|
||||
bindir ?= ${bindir:-${prefix}/bin}
|
||||
KMOD_CFLAGS ?= $(${PKG_CONFIG} --cflags " libkmod >= 23 ")
|
||||
KMOD_LIBS ?= $(${PKG_CONFIG} --libs " libkmod >= 23 ")
|
||||
FTS_LIBS ?= ${FTS_LIBS}
|
||||
EOF
|
||||
|
||||
{
|
||||
|
70
docs/RELEASE.md
Normal file
70
docs/RELEASE.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# Conducting A Successful Release
|
||||
|
||||
This documents contains the necessary steps to conduct a successful release.
|
||||
|
||||
1. Add all items to `NEWS.md`
|
||||
|
||||
Get a first template with [`clog`](https://github.com/clog-tool/clog-cli)
|
||||
```console
|
||||
$ clog -F -r https://github.com/dracutdevs/dracut
|
||||
```
|
||||
|
||||
2. Update the contributors list in NEWS.md
|
||||
|
||||
Produce the list with:
|
||||
```console
|
||||
$ make CONTRIBUTORS
|
||||
```
|
||||
|
||||
Append the list to the section in `NEWS.md`
|
||||
|
||||
3. Update AUTHORS
|
||||
|
||||
```console
|
||||
$ make AUTHORS
|
||||
```
|
||||
|
||||
4. Check in AUTHORS and NEWS.md
|
||||
|
||||
```console
|
||||
$ git ci -m "docs: update NEWS.md and AUTHORS" NEWS.md AUTHORS
|
||||
```
|
||||
|
||||
5. Tag the release and push
|
||||
|
||||
```console
|
||||
$ VERSION=052
|
||||
$ git tag -s "$VERSION"
|
||||
$ git push --tags
|
||||
```
|
||||
|
||||
Add the section from `NEWS.md` to the git tag message.
|
||||
|
||||
6. Push git to kernel.org
|
||||
|
||||
With:
|
||||
```console
|
||||
$ git remote add kernelorg ssh://gitolite@ra.kernel.org/pub/scm/boot/dracut/dracut.git
|
||||
```
|
||||
|
||||
Push to kernel.org git:
|
||||
```console
|
||||
$ git push --atomic kernelorg master "$VERSION"
|
||||
```
|
||||
|
||||
|
||||
7. Sign and upload tarballs to kernel.org
|
||||
|
||||
```console
|
||||
$ make upload
|
||||
```
|
||||
|
||||
This requires `kup` and a kernel.org account.
|
||||
Wait until the tarballs are synced to http://www.kernel.org/pub/linux/utils/boot/dracut/ .
|
||||
|
||||
8. Create a new release on github (https://github.com/dracutdevs/dracut/releases/new)
|
||||
- Add the section from `NEWS.md` to the release.
|
||||
- Attach the tarballs and signature file from http://www.kernel.org/pub/linux/utils/boot/dracut/ to the github release.
|
||||
|
||||
9. Close the github milestone and open a new one (https://github.com/dracutdevs/dracut/milestones)
|
||||
10. Ensure that announcement was sent and reached the linux-initramfs mailinglist (https://www.spinics.net/lists/linux-initramfs/)
|
@@ -1,4 +1,4 @@
|
||||
#
|
||||
#!/bin/bash
|
||||
# Copyright 2013 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -16,13 +16,13 @@
|
||||
#
|
||||
|
||||
__contains_word () {
|
||||
local word=$1; shift
|
||||
for w in $*; do [[ $w = $word ]] && return 0; done
|
||||
local word="$1"; shift
|
||||
for w in "$@"; do [[ $w = "$word" ]] && return 0; done
|
||||
return 1
|
||||
}
|
||||
|
||||
_dracut() {
|
||||
local field_vals= cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
local -A OPTS=(
|
||||
[STANDALONE]='-f -v -q -l -H -h -M -N
|
||||
--ro-mnt --force --kernel-only --no-kernel --strip --nostrip
|
||||
@@ -42,6 +42,7 @@ _dracut() {
|
||||
'
|
||||
)
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
if __contains_word "$prev" ${OPTS[ARG]}; then
|
||||
case $prev in
|
||||
--kmoddir|-k|--fwdir|--confdir|--tmpdir)
|
||||
@@ -56,23 +57,41 @@ _dracut() {
|
||||
comps=$(dracut --list-modules 2>/dev/null)
|
||||
;;
|
||||
--persistent-policy)
|
||||
comps=$(cd /dev/disk/; echo *)
|
||||
comps=$(cd /dev/disk/ || return 0; printf -- "%s " *)
|
||||
;;
|
||||
--kver)
|
||||
comps=$(cd /lib/modules; echo [0-9]*)
|
||||
comps=$(cd /lib/modules || return 0; echo [0-9]*)
|
||||
;;
|
||||
*)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
# shellcheck disable=SC2207
|
||||
# shellcheck disable=SC2016
|
||||
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ $cur = -* ]]; then
|
||||
# shellcheck disable=SC2207
|
||||
# shellcheck disable=SC2016
|
||||
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
|
||||
return 0
|
||||
fi
|
||||
|
||||
local args
|
||||
_count_args
|
||||
if [[ $args -eq 1 ]]; then
|
||||
_filedir
|
||||
return 0
|
||||
elif [[ $args -eq 2 ]]; then
|
||||
# shellcheck disable=SC2034
|
||||
comps=$(cd /lib/modules || return 0; echo [0-9]*)
|
||||
# shellcheck disable=SC2207
|
||||
# shellcheck disable=SC2016
|
||||
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
complete -F _dracut dracut
|
||||
|
@@ -18,7 +18,7 @@
|
||||
|
||||
|
||||
dwarning() {
|
||||
echo "Warning: $@" >&2
|
||||
echo "Warning: $*" >&2
|
||||
}
|
||||
|
||||
dinfo() {
|
||||
@@ -26,7 +26,7 @@ dinfo() {
|
||||
}
|
||||
|
||||
derror() {
|
||||
echo "Error: $@" >&2
|
||||
echo "Error: $*" >&2
|
||||
}
|
||||
|
||||
usage() {
|
||||
@@ -61,7 +61,7 @@ while (($# > 0)); do
|
||||
--nooverlay) no_overlay=yes;shift;;
|
||||
--noimagedir) no_imagedir=yes;shift;;
|
||||
-h|--help) usage; exit 1 ;;
|
||||
--debug) debug="yes";;
|
||||
--debug) export debug="yes";;
|
||||
-v|--verbose) beverbose="yes";;
|
||||
-*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
|
||||
*) break ;;
|
||||
@@ -104,7 +104,7 @@ if [[ ! $no_overlay ]]; then
|
||||
ofile="$imagedir/90-overlay.img"
|
||||
dinfo "Creating image $ofile from directory $overlay"
|
||||
type pigz &>/dev/null && gzip=pigz || gzip=gzip
|
||||
( cd "$overlay"; find . |cpio --quiet -H newc -o |$gzip -9 > "$ofile"; )
|
||||
( cd "$overlay" || return 1 ; find . |cpio --quiet -H newc -o |$gzip -9 > "$ofile"; )
|
||||
fi
|
||||
|
||||
if [[ ! $no_imagedir ]]; then
|
||||
@@ -113,7 +113,7 @@ if [[ ! $no_imagedir ]]; then
|
||||
done
|
||||
fi
|
||||
|
||||
images+=($@)
|
||||
images+=( "$@" )
|
||||
|
||||
dinfo "Using base image $baseimage"
|
||||
cat -- "$baseimage" > "$outfile"
|
||||
|
@@ -31,6 +31,7 @@ strstr() { [[ $1 = *"$2"* ]]; }
|
||||
# Generic glob matching function. If glob pattern $2 matches anywhere in $1, OK
|
||||
strglobin() { [[ $1 = *$2* ]]; }
|
||||
# Generic glob matching function. If glob pattern $2 matches all of $1, OK
|
||||
# shellcheck disable=SC2053
|
||||
strglob() { [[ $1 = $2 ]]; }
|
||||
# returns OK if $1 contains literal string $2 at the beginning, and isn't empty
|
||||
str_starts() { [ "${1#"$2"*}" != "$1" ]; }
|
||||
@@ -40,19 +41,49 @@ str_ends() { [ "${1%*"$2"}" != "$1" ]; }
|
||||
# find a binary. If we were not passed the full path directly,
|
||||
# search in the usual places to find the binary.
|
||||
find_binary() {
|
||||
if [[ -z ${1##/*} ]]; then
|
||||
if [[ -x $1 ]] || { [[ "$1" == *.so* ]] && ldd "$1" &>/dev/null; }; then
|
||||
printf "%s\n" "$1"
|
||||
local _delim
|
||||
local _path
|
||||
local l
|
||||
local p
|
||||
[[ -z ${1##/*} ]] || _delim="/"
|
||||
|
||||
if [[ "$1" == *.so* ]]; then
|
||||
# shellcheck disable=SC2154
|
||||
for l in $libdirs ; do
|
||||
_path="${l}${_delim}${1}"
|
||||
if { $DRACUT_LDD "${dracutsysrootdir}${_path}" &>/dev/null; }; then
|
||||
printf "%s\n" "${_path}"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
_path="${_delim}${1}"
|
||||
if { $DRACUT_LDD "${dracutsysrootdir}${_path}" &>/dev/null; }; then
|
||||
printf "%s\n" "${_path}"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
if [[ "$1" == */* ]]; then
|
||||
_path="${_delim}${1}"
|
||||
if [[ -L ${dracutsysrootdir}${_path} ]] || [[ -x ${dracutsysrootdir}${_path} ]]; then
|
||||
printf "%s\n" "${_path}"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
for p in $DRACUT_PATH ; do
|
||||
_path="${p}${_delim}${1}"
|
||||
if [[ -L ${dracutsysrootdir}${_path} ]] || [[ -x ${dracutsysrootdir}${_path} ]]; then
|
||||
printf "%s\n" "${_path}"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
[[ -n "$dracutsysrootdir" ]] && return 1
|
||||
type -P "${1##*/}"
|
||||
}
|
||||
|
||||
ldconfig_paths()
|
||||
{
|
||||
ldconfig -pN 2>/dev/null | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | sed -n 's,.* => \(.*\)/.*,\1,p' | sort | uniq
|
||||
$DRACUT_LDCONFIG ${dracutsysrootdir:+-r ${dracutsysrootdir} -f /etc/ld.so.conf} -pN 2>/dev/null | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | sed -n 's,.* => \(.*\)/.*,\1,p' | sort | uniq
|
||||
}
|
||||
|
||||
# Version comparision function. Assumes Linux style version scheme.
|
||||
@@ -60,7 +91,12 @@ ldconfig_paths()
|
||||
# $2 = comparision op (gt, ge, eq, le, lt, ne)
|
||||
# $3 = version b
|
||||
vercmp() {
|
||||
local _n1=(${1//./ }) _op=$2 _n2=(${3//./ }) _i _res
|
||||
local _n1
|
||||
read -a _n1 <<< "${1//./ }"
|
||||
local _op=$2
|
||||
local _n2
|
||||
read -a _n2 <<< "${3//./ }"
|
||||
local _i _res
|
||||
|
||||
for ((_i=0; ; _i++))
|
||||
do
|
||||
@@ -85,6 +121,7 @@ vercmp() {
|
||||
# Create all subdirectories for given path without creating the last element.
|
||||
# $1 = path
|
||||
mksubdirs() {
|
||||
# shellcheck disable=SC2174
|
||||
[[ -e ${1%/*} ]] || mkdir -m 0755 -p -- "${1%/*}"
|
||||
}
|
||||
|
||||
@@ -131,8 +168,8 @@ convert_abs_rel() {
|
||||
# corner case #2 - own dir link
|
||||
[[ "${1%/*}" == "$2" ]] && { printf ".\n"; return; }
|
||||
|
||||
IFS="/" __current=($1)
|
||||
IFS="/" __absolute=($2)
|
||||
read -d '/' -r -a __current <<< "$1"
|
||||
read -d '/' -a __absolute <<< "$2"
|
||||
|
||||
__abssize=${#__absolute[@]}
|
||||
__cursize=${#__current[@]}
|
||||
@@ -164,7 +201,7 @@ convert_abs_rel() {
|
||||
__newpath=$__newpath${__absolute[__i]}
|
||||
done
|
||||
|
||||
printf "%s\n" "$__newpath"
|
||||
printf -- "%s\n" "$__newpath"
|
||||
}
|
||||
|
||||
|
||||
@@ -174,9 +211,6 @@ convert_abs_rel() {
|
||||
# $ get_fs_env /dev/sda2
|
||||
# ext4
|
||||
get_fs_env() {
|
||||
local evalstr
|
||||
local found
|
||||
|
||||
[[ $1 ]] || return
|
||||
unset ID_FS_TYPE
|
||||
ID_FS_TYPE=$(blkid -u filesystem -o export -- "$1" \
|
||||
@@ -199,7 +233,7 @@ get_fs_env() {
|
||||
# $ get_maj_min /dev/sda2
|
||||
# 8:2
|
||||
get_maj_min() {
|
||||
local _maj _min _majmin
|
||||
local _majmin
|
||||
_majmin="$(stat -L -c '%t:%T' "$1" 2>/dev/null)"
|
||||
printf "%s" "$((0x${_majmin%:*})):$((0x${_majmin#*:}))"
|
||||
}
|
||||
@@ -309,6 +343,7 @@ shorten_persistent_dev() {
|
||||
find_block_device() {
|
||||
local _dev _majmin _find_mpt
|
||||
_find_mpt="$1"
|
||||
|
||||
if [[ $use_fstab != yes ]]; then
|
||||
[[ -d $_find_mpt/. ]]
|
||||
findmnt -e -v -n -o 'MAJ:MIN,SOURCE' --target "$_find_mpt" | { \
|
||||
@@ -444,11 +479,13 @@ find_mp_fsopts() {
|
||||
# Echo the filesystem options for a given device.
|
||||
# /proc/self/mountinfo is taken as the primary source of information
|
||||
# and /etc/fstab is used as a fallback.
|
||||
# if `use_fstab == yes`, then only `/etc/fstab` is used.
|
||||
#
|
||||
# Example:
|
||||
# $ find_dev_fsopts /dev/sda2
|
||||
# rw,relatime,discard,data=ordered
|
||||
find_dev_fsopts() {
|
||||
local _find_dev _opts
|
||||
local _find_dev
|
||||
_find_dev="$1"
|
||||
if ! [[ "$_find_dev" = /dev* ]]; then
|
||||
[[ -b "/dev/block/$_find_dev" ]] && _find_dev="/dev/block/$_find_dev"
|
||||
@@ -500,7 +537,6 @@ check_block_and_slaves() {
|
||||
if [[ -f /sys/dev/block/$2/../dev ]] && [[ /sys/dev/block/$2/../subsystem -ef /sys/class/block ]]; then
|
||||
check_block_and_slaves $1 $(<"/sys/dev/block/$2/../dev") && return 0
|
||||
fi
|
||||
[[ -d /sys/dev/block/$2/slaves ]] || return 1
|
||||
for _x in /sys/dev/block/$2/slaves/*; do
|
||||
[[ -f $_x/dev ]] || continue
|
||||
[[ $_x/subsystem -ef /sys/class/block ]] || continue
|
||||
@@ -519,7 +555,6 @@ check_block_and_slaves_all() {
|
||||
if [[ -f /sys/dev/block/$2/../dev ]] && [[ /sys/dev/block/$2/../subsystem -ef /sys/class/block ]]; then
|
||||
check_block_and_slaves_all $1 $(<"/sys/dev/block/$2/../dev") && _ret=0
|
||||
fi
|
||||
[[ -d /sys/dev/block/$2/slaves ]] || return 1
|
||||
for _x in /sys/dev/block/$2/slaves/*; do
|
||||
[[ -f $_x/dev ]] || continue
|
||||
[[ $_x/subsystem -ef /sys/class/block ]] || continue
|
||||
@@ -536,7 +571,7 @@ for_each_host_dev_and_slaves_all()
|
||||
local _dev
|
||||
local _ret=1
|
||||
|
||||
[[ "${host_devs[@]}" ]] || return 2
|
||||
[[ "${host_devs[*]}" ]] || return 2
|
||||
|
||||
for _dev in "${host_devs[@]}"; do
|
||||
[[ -b "$_dev" ]] || continue
|
||||
@@ -552,7 +587,7 @@ for_each_host_dev_and_slaves()
|
||||
local _func="$1"
|
||||
local _dev
|
||||
|
||||
[[ "${host_devs[@]}" ]] || return 2
|
||||
[[ "${host_devs[*]}" ]] || return 2
|
||||
|
||||
for _dev in "${host_devs[@]}"; do
|
||||
[[ -b "$_dev" ]] || continue
|
||||
@@ -595,6 +630,12 @@ check_vol_slaves_all() {
|
||||
# strip space
|
||||
_vg="${_vg//[[:space:]]/}"
|
||||
if [[ $_vg ]]; then
|
||||
# when filter/global_filter is set, lvm may be failed
|
||||
lvm lvs --noheadings -o vg_name $_vg 2>/dev/null 1>/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2>/dev/null)
|
||||
do
|
||||
check_block_and_slaves_all $1 $(get_maj_min $_pv)
|
||||
@@ -630,18 +671,23 @@ check_kernel_config()
|
||||
{
|
||||
local _config_opt="$1"
|
||||
local _config_file
|
||||
[[ -f /boot/config-$kernel ]] \
|
||||
[[ -f $dracutsysrootdir/boot/config-$kernel ]] \
|
||||
&& _config_file="/boot/config-$kernel"
|
||||
[[ -f /lib/modules/$kernel/config ]] \
|
||||
[[ -f $dracutsysrootdir/lib/modules/$kernel/config ]] \
|
||||
&& _config_file="/lib/modules/$kernel/config"
|
||||
|
||||
# no kernel config file, so return true
|
||||
[[ $_config_file ]] || return 0
|
||||
|
||||
grep -q -F "${_config_opt}=" "$_config_file" && return 0
|
||||
grep -q -F "${_config_opt}=" "$dracutsysrootdir$_config_file" && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
# 0 if the kernel module is either built-in or available
|
||||
# 1 if the kernel module is not enabled
|
||||
check_kernel_module() {
|
||||
modprobe -S $kernel --dry-run $1 &>/dev/null || return 1
|
||||
}
|
||||
|
||||
# get_cpu_vendor
|
||||
# Only two values are returned: AMD or Intel
|
||||
@@ -676,17 +722,6 @@ get_ucode_file ()
|
||||
fi
|
||||
}
|
||||
|
||||
# Get currently loaded modules
|
||||
# sorted, and delimited by newline
|
||||
get_loaded_kernel_modules ()
|
||||
{
|
||||
local modules=( )
|
||||
while read _module _size _used _used_by; do
|
||||
modules+=( "$_module" )
|
||||
done <<< "$(lsmod | sed -n '1!p')"
|
||||
printf '%s\n' "${modules[@]}" | sort
|
||||
}
|
||||
|
||||
# Not every device in /dev/mapper should be examined.
|
||||
# If it is an LVM device, touch only devices which have /dev/VG/LV symlink.
|
||||
lvm_internal_dev() {
|
||||
@@ -707,3 +742,166 @@ btrfs_devs() {
|
||||
printf -- "%s\n" "$_dev"
|
||||
done
|
||||
}
|
||||
|
||||
iface_for_remote_addr() {
|
||||
set -- $(ip -o route get to "$1")
|
||||
echo $3
|
||||
}
|
||||
|
||||
local_addr_for_remote_addr() {
|
||||
set -- $(ip -o route get to "$1")
|
||||
echo $5
|
||||
}
|
||||
|
||||
peer_for_addr() {
|
||||
local addr=$1
|
||||
local qtd
|
||||
|
||||
# quote periods in IPv4 address
|
||||
qtd=${addr//./\\.}
|
||||
ip -o addr show | \
|
||||
sed -n 's%^.* '"$qtd"' peer \([0-9a-f.:]\{1,\}\(/[0-9]*\)\?\).*$%\1%p'
|
||||
}
|
||||
|
||||
netmask_for_addr() {
|
||||
local addr=$1
|
||||
local qtd
|
||||
|
||||
# quote periods in IPv4 address
|
||||
qtd=${addr//./\\.}
|
||||
ip -o addr show | sed -n 's,^.* '"$qtd"'/\([0-9]*\) .*$,\1,p'
|
||||
}
|
||||
|
||||
gateway_for_iface() {
|
||||
local ifname=$1 addr=$2
|
||||
|
||||
case $addr in
|
||||
*.*) proto=4;;
|
||||
*:*) proto=6;;
|
||||
*) return;;
|
||||
esac
|
||||
ip -o -$proto route show | \
|
||||
sed -n "s/^default via \([0-9a-z.:]\{1,\}\) dev $ifname .*\$/\1/p"
|
||||
}
|
||||
|
||||
# This works only for ifcfg-style network configuration!
|
||||
bootproto_for_iface() {
|
||||
local ifname=$1
|
||||
local dir
|
||||
|
||||
# follow ifcfg settings for boot protocol
|
||||
for dir in network-scripts network; do
|
||||
[ -f "/etc/sysconfig/$dir/ifcfg-$ifname" ] && {
|
||||
sed -n "s/BOOTPROTO=[\"']\?\([[:alnum:]]\{1,\}\)[\"']\?.*\$/\1/p" \
|
||||
"/etc/sysconfig/$dir/ifcfg-$ifname"
|
||||
return
|
||||
}
|
||||
done
|
||||
}
|
||||
|
||||
is_unbracketed_ipv6_address() {
|
||||
strglob "$1" '*:*' && ! strglob "$1" '\[*:*\]'
|
||||
}
|
||||
|
||||
# Create an ip= string to set up networking such that the given
|
||||
# remote address can be reached
|
||||
ip_params_for_remote_addr() {
|
||||
local remote_addr=$1
|
||||
local ifname local_addr peer netmask= gateway ifmac
|
||||
|
||||
[[ $remote_addr ]] || return 1
|
||||
ifname=$(iface_for_remote_addr "$remote_addr")
|
||||
[[ $ifname ]] || {
|
||||
berror "failed to determine interface to connect to $remote_addr"
|
||||
return 1
|
||||
}
|
||||
|
||||
# ifname clause to bind the interface name to a MAC address
|
||||
if [ -d "/sys/class/net/$ifname/bonding" ]; then
|
||||
dinfo "Found bonded interface '${ifname}'. Make sure to provide an appropriate 'bond=' cmdline."
|
||||
elif [ -e "/sys/class/net/$ifname/address" ] ; then
|
||||
ifmac=$(cat "/sys/class/net/$ifname/address")
|
||||
[[ $ifmac ]] && printf 'ifname=%s:%s ' "${ifname}" "${ifmac}"
|
||||
fi
|
||||
|
||||
bootproto=$(bootproto_for_iface "$ifname")
|
||||
case $bootproto in
|
||||
dhcp|dhcp6|auto6) ;;
|
||||
dhcp4)
|
||||
bootproto=dhcp;;
|
||||
static*|"")
|
||||
bootproto=;;
|
||||
*)
|
||||
derror "bootproto \"$bootproto\" is unsupported by dracut, trying static configuration"
|
||||
bootproto=;;
|
||||
esac
|
||||
if [[ $bootproto ]]; then
|
||||
printf 'ip=%s:%s ' "${ifname}" "${bootproto}"
|
||||
else
|
||||
local_addr=$(local_addr_for_remote_addr "$remote_addr")
|
||||
[[ $local_addr ]] || {
|
||||
berror "failed to determine local address to connect to $remote_addr"
|
||||
return 1
|
||||
}
|
||||
peer=$(peer_for_addr "$local_addr")
|
||||
# Set peer or netmask, but not both
|
||||
[[ $peer ]] || netmask=$(netmask_for_addr "$local_addr")
|
||||
gateway=$(gateway_for_iface "$ifname" "$local_addr")
|
||||
# Quote IPv6 addresses with brackets
|
||||
is_unbracketed_ipv6_address "$local_addr" && local_addr="[$local_addr]"
|
||||
is_unbracketed_ipv6_address "$peer" && peer="[$peer]"
|
||||
is_unbracketed_ipv6_address "$gateway" && gateway="[$gateway]"
|
||||
printf 'ip=%s:%s:%s:%s::%s:none ' \
|
||||
"${local_addr}" "${peer}" "${gateway}" "${netmask}" "${ifname}"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
# block_is_nbd <maj:min>
|
||||
# Check whether $1 is an nbd device
|
||||
block_is_nbd() {
|
||||
[[ -b /dev/block/$1 && $1 == 43:* ]]
|
||||
}
|
||||
|
||||
# block_is_iscsi <maj:min>
|
||||
# Check whether $1 is an nbd device
|
||||
block_is_iscsi() {
|
||||
local _dir
|
||||
local _dev=$1
|
||||
[[ -L "/sys/dev/block/$_dev" ]] || return
|
||||
_dir="$(readlink -f "/sys/dev/block/$_dev")" || return
|
||||
until [[ -d "$_dir/sys" || -d "$_dir/iscsi_session" ]]; do
|
||||
_dir="$_dir/.."
|
||||
done
|
||||
[[ -d "$_dir/iscsi_session" ]]
|
||||
}
|
||||
|
||||
# block_is_fcoe <maj:min>
|
||||
# Check whether $1 is an FCoE device
|
||||
# Will not work for HBAs that hide the ethernet aspect
|
||||
# completely and present a pure FC device
|
||||
block_is_fcoe() {
|
||||
local _dir
|
||||
local _dev=$1
|
||||
[[ -L "/sys/dev/block/$_dev" ]] || return
|
||||
_dir="$(readlink -f "/sys/dev/block/$_dev")"
|
||||
until [[ -d "$_dir/sys" ]]; do
|
||||
_dir="$_dir/.."
|
||||
if [[ -d "$_dir/subsystem" ]]; then
|
||||
subsystem=$(basename $(readlink $_dir/subsystem))
|
||||
[[ $subsystem == "fcoe" ]] && return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# block_is_netdevice <maj:min>
|
||||
# Check whether $1 is a net device
|
||||
block_is_netdevice() {
|
||||
block_is_nbd "$1" || block_is_iscsi "$1" || block_is_fcoe "$1"
|
||||
}
|
||||
|
||||
# get the corresponding kernel modules of a /sys/class/*/* or/dev/* device
|
||||
get_dev_module() {
|
||||
udevadm info -a "$1" | sed -n 's/\s*DRIVERS=="\(\S\+\)"/\1/p'
|
||||
}
|
||||
|
442
dracut-init.sh
442
dracut-init.sh
@@ -19,7 +19,7 @@
|
||||
#
|
||||
export LC_MESSAGES=C
|
||||
|
||||
if [[ "$EUID" = "0" ]]; then
|
||||
if [[ "$EUID" = "0" ]] && ! [[ $DRACUT_NO_XATTR ]]; then
|
||||
export DRACUT_CP="cp --reflink=auto --sparse=auto --preserve=mode,timestamps,xattr,links -dfr"
|
||||
else
|
||||
export DRACUT_CP="cp --reflink=auto --sparse=auto --preserve=mode,timestamps,links -dfr"
|
||||
@@ -39,10 +39,12 @@ if ! [[ $dracutbasedir ]]; then
|
||||
fi
|
||||
|
||||
if ! is_func dinfo >/dev/null 2>&1; then
|
||||
# shellcheck source=./dracut-logger.sh
|
||||
. "$dracutbasedir/dracut-logger.sh"
|
||||
dlog_init
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
if ! [[ $initdir ]]; then
|
||||
dfatal "initdir not set"
|
||||
exit 1
|
||||
@@ -57,8 +59,10 @@ if ! [[ $kernel ]]; then
|
||||
export kernel
|
||||
fi
|
||||
|
||||
srcmods="/lib/modules/$kernel/"
|
||||
# shellcheck disable=SC2154
|
||||
srcmods="$dracutsysrootdir/lib/modules/$kernel/"
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
[[ $drivers_dir ]] && {
|
||||
if ! command -v kmod &>/dev/null && vercmp "$(modprobe --version | cut -d' ' -f3)" lt 3.7; then
|
||||
dfatal 'To use --kmoddir option module-init-tools >= 3.7 is required.'
|
||||
@@ -79,17 +83,22 @@ export srcmods
|
||||
export hookdirs
|
||||
}
|
||||
|
||||
. $dracutbasedir/dracut-functions.sh
|
||||
DRACUT_LDD=${DRACUT_LDD:-ldd}
|
||||
DRACUT_TESTBIN=${DRACUT_TESTBIN:-/bin/sh}
|
||||
DRACUT_LDCONFIG=${DRACUT_LDCONFIG:-ldconfig}
|
||||
|
||||
# shellcheck source=./dracut-functions.sh
|
||||
. "$dracutbasedir"/dracut-functions.sh
|
||||
|
||||
# Detect lib paths
|
||||
if ! [[ $libdirs ]] ; then
|
||||
if [[ "$(ldd /bin/sh)" == */lib64/* ]] &>/dev/null \
|
||||
&& [[ -d /lib64 ]]; then
|
||||
if [[ $("$DRACUT_LDD" "$dracutsysrootdir$DRACUT_TESTBIN") == */lib64/* ]] &>/dev/null \
|
||||
&& [[ -d $dracutsysrootdir/lib64 ]]; then
|
||||
libdirs+=" /lib64"
|
||||
[[ -d /usr/lib64 ]] && libdirs+=" /usr/lib64"
|
||||
[[ -d $dracutsysrootdir/usr/lib64 ]] && libdirs+=" /usr/lib64"
|
||||
else
|
||||
libdirs+=" /lib"
|
||||
[[ -d /usr/lib ]] && libdirs+=" /usr/lib"
|
||||
[[ -d $dracutsysrootdir/usr/lib ]] && libdirs+=" /usr/lib"
|
||||
fi
|
||||
|
||||
libdirs+=" $(ldconfig_paths)"
|
||||
@@ -101,6 +110,7 @@ fi
|
||||
# to check for required installed binaries
|
||||
# issues a standardized warning message
|
||||
require_binaries() {
|
||||
# shellcheck disable=SC2154
|
||||
local _module_name="${moddir##*/}"
|
||||
local _ret=0
|
||||
|
||||
@@ -115,7 +125,7 @@ require_binaries() {
|
||||
((_ret++))
|
||||
fi
|
||||
done
|
||||
return $_ret
|
||||
return "$_ret"
|
||||
}
|
||||
|
||||
require_any_binary() {
|
||||
@@ -134,8 +144,8 @@ require_any_binary() {
|
||||
fi
|
||||
done
|
||||
|
||||
if (( $_ret != 0 )); then
|
||||
dinfo "$_module_name: Could not find any command of '$@'!"
|
||||
if (( _ret != 0 )); then
|
||||
dinfo "$_module_name: Could not find any command of '$*'!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
@@ -143,13 +153,29 @@ require_any_binary() {
|
||||
}
|
||||
|
||||
dracut_need_initqueue() {
|
||||
>"$initdir/lib/dracut/need-initqueue"
|
||||
: >"$initdir/lib/dracut/need-initqueue"
|
||||
}
|
||||
|
||||
dracut_module_included() {
|
||||
# shellcheck disable=SC2154
|
||||
[[ " $mods_to_load $modules_loaded " == *\ $*\ * ]]
|
||||
}
|
||||
|
||||
dracut_no_switch_root() {
|
||||
: >"$initdir/lib/dracut/no-switch-root"
|
||||
}
|
||||
|
||||
dracut_module_path() {
|
||||
local _dir
|
||||
|
||||
# shellcheck disable=SC2231
|
||||
for _dir in "${dracutbasedir}"/modules.d/??${1}; do
|
||||
echo "$_dir"
|
||||
return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
if ! [[ $DRACUT_INSTALL ]]; then
|
||||
DRACUT_INSTALL=$(find_binary dracut-install)
|
||||
fi
|
||||
@@ -160,7 +186,18 @@ elif ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/install/dracut-install ]];
|
||||
DRACUT_INSTALL=$dracutbasedir/install/dracut-install
|
||||
fi
|
||||
|
||||
if ! [[ -x $DRACUT_INSTALL ]]; then
|
||||
# Test if dracut-install is a standalone executable with no options.
|
||||
# E.g. DRACUT_INSTALL may be set externally as:
|
||||
# DRACUT_INSTALL="valgrind dracut-install"
|
||||
# or
|
||||
# DRACUT_INSTALL="dracut-install --debug"
|
||||
# in which case the string cannot be tested for being executable.
|
||||
DRINSTALLPARTS=0
|
||||
for i in $DRACUT_INSTALL ; do
|
||||
DRINSTALLPARTS=$((DRINSTALLPARTS+1))
|
||||
done
|
||||
|
||||
if [[ $DRINSTALLPARTS = 1 ]] && ! command -v "$DRACUT_INSTALL" > /dev/null 2>&1 ; then
|
||||
dfatal "dracut-install not found!"
|
||||
exit 10
|
||||
fi
|
||||
@@ -168,15 +205,16 @@ fi
|
||||
if [[ $hostonly == "-h" ]]; then
|
||||
if ! [[ $DRACUT_KERNEL_MODALIASES ]] || ! [[ -f "$DRACUT_KERNEL_MODALIASES" ]]; then
|
||||
export DRACUT_KERNEL_MODALIASES="${DRACUT_TMPDIR}/modaliases"
|
||||
$DRACUT_INSTALL ${srcmods:+--kerneldir "$srcmods"} --modalias > "$DRACUT_KERNEL_MODALIASES"
|
||||
"$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${srcmods:+--kerneldir "$srcmods"} --modalias > "$DRACUT_KERNEL_MODALIASES"
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ $DRACUT_RESOLVE_LAZY ]] || export DRACUT_RESOLVE_DEPS=1
|
||||
inst_dir() {
|
||||
[[ -e ${initdir}/"$1" ]] && return 0 # already there
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} -d "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} -d "$@" || :
|
||||
if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -d "$@"; then
|
||||
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -d "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
inst() {
|
||||
@@ -186,8 +224,10 @@ inst() {
|
||||
shift
|
||||
fi
|
||||
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
# shellcheck disable=SC2154
|
||||
if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then
|
||||
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
inst_simple() {
|
||||
@@ -198,8 +238,9 @@ inst_simple() {
|
||||
fi
|
||||
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
|
||||
[[ -e $1 ]] || return 1 # no source
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@" || :
|
||||
if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@"; then
|
||||
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@" || :
|
||||
fi
|
||||
}
|
||||
|
||||
inst_symlink() {
|
||||
@@ -210,16 +251,20 @@ inst_symlink() {
|
||||
fi
|
||||
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
|
||||
[[ -L $1 ]] || return 1
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then
|
||||
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
fi
|
||||
}
|
||||
|
||||
inst_multiple() {
|
||||
local _ret
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
|
||||
_ret=$?
|
||||
(($_ret != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
return $_ret
|
||||
if "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"; then
|
||||
return 0
|
||||
else
|
||||
_ret=$?
|
||||
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
return $_ret
|
||||
fi
|
||||
}
|
||||
|
||||
dracut_install() {
|
||||
@@ -229,14 +274,20 @@ dracut_install() {
|
||||
dracut_instmods() {
|
||||
local _silent=0;
|
||||
local i;
|
||||
# shellcheck disable=SC2154
|
||||
[[ $no_kernel = yes ]] && return
|
||||
for i in "$@"; do
|
||||
[[ $i == "--silent" ]] && _silent=1
|
||||
done
|
||||
|
||||
$DRACUT_INSTALL \
|
||||
${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} -m "$@"
|
||||
(($? != 0)) && (($_silent == 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} -m "$@" || :
|
||||
# shellcheck disable=SC2154
|
||||
if ! "$DRACUT_INSTALL" \
|
||||
${dracutsysrootdir:+-r "$dracutsysrootdir"} \
|
||||
${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} -m "$@"; then
|
||||
if ((_silent == 0)); then
|
||||
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} -m "$@" || :
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
inst_library() {
|
||||
@@ -247,24 +298,28 @@ inst_library() {
|
||||
fi
|
||||
[[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there
|
||||
[[ -e $1 ]] || return 1 # no source
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"; then
|
||||
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
fi
|
||||
}
|
||||
|
||||
inst_binary() {
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
|
||||
if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"; then
|
||||
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
|
||||
fi
|
||||
}
|
||||
|
||||
inst_script() {
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
|
||||
if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"; then
|
||||
derror FAILED: "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
|
||||
fi
|
||||
}
|
||||
|
||||
inst_fsck_help() {
|
||||
local _helper="/run/dracut/fsck/fsck_help_$1.txt"
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" $_helper
|
||||
(($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" $_helper || :
|
||||
if ! "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" "$_helper"; then
|
||||
derror "$DRACUT_INSTALL" ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" "$_helper" || :
|
||||
fi
|
||||
}
|
||||
|
||||
# Use with form hostonly="$(optional_hostonly)" inst_xxxx <args>
|
||||
@@ -272,8 +327,9 @@ inst_fsck_help() {
|
||||
# be applied, else will ignore hostonly mode and try to install all
|
||||
# given modules.
|
||||
optional_hostonly() {
|
||||
# shellcheck disable=SC2154
|
||||
if [[ $hostonly_mode = "strict" ]]; then
|
||||
printf -- "$hostonly"
|
||||
printf -- "%s" "$hostonly"
|
||||
else
|
||||
printf ""
|
||||
fi
|
||||
@@ -296,28 +352,36 @@ mark_hostonly() {
|
||||
# output: libfoo.so.8 libfoo.so
|
||||
# (Only if libfoo.so.8 and libfoo.so exists on host system.)
|
||||
rev_lib_symlinks() {
|
||||
local _fn
|
||||
local _orig
|
||||
local _links
|
||||
|
||||
[[ ! $1 ]] && return 0
|
||||
|
||||
local fn="$1" orig="$(readlink -f "$1")" links=''
|
||||
_fn="$1"
|
||||
_orig="$(readlink -f "$1")"
|
||||
_links=()
|
||||
|
||||
[[ ${fn} == *.so.* ]] || return 1
|
||||
[[ ${_fn} == *.so.* ]] || return 1
|
||||
|
||||
until [[ ${fn##*.} == so ]]; do
|
||||
fn="${fn%.*}"
|
||||
[[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}"
|
||||
until [[ ${_fn##*.} == so ]]; do
|
||||
_fn="${_fn%.*}"
|
||||
[[ -L ${_fn} ]] && [[ $(readlink -f "${_fn}") == "${_orig}" ]] && _links+=( "${_fn}" )
|
||||
done
|
||||
|
||||
echo "${links}"
|
||||
echo "${_links[*]}}"
|
||||
}
|
||||
|
||||
# attempt to install any programs specified in a udev rule
|
||||
inst_rule_programs() {
|
||||
local _prog _bin
|
||||
|
||||
# shellcheck disable=SC2013
|
||||
for _prog in $(sed -nr 's/.*PROGRAM==?"([^ "]+).*/\1/p' "$1"); do
|
||||
_bin=""
|
||||
if [ -x ${udevdir}/$_prog ]; then
|
||||
_bin=${udevdir}/$_prog
|
||||
# shellcheck disable=SC2154
|
||||
if [[ -x ${udevdir}/$_prog ]]; then
|
||||
_bin="${udevdir}"/$_prog
|
||||
elif [[ "${_prog/\$env\{/}" == "$_prog" ]]; then
|
||||
_bin=$(find_binary "$_prog") || {
|
||||
dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found"
|
||||
@@ -327,9 +391,11 @@ inst_rule_programs() {
|
||||
|
||||
[[ $_bin ]] && inst_binary "$_bin"
|
||||
done
|
||||
|
||||
# shellcheck disable=SC2013
|
||||
for _prog in $(sed -nr 's/.*RUN[+=]=?"([^ "]+).*/\1/p' "$1"); do
|
||||
_bin=""
|
||||
if [ -x ${udevdir}/$_prog ]; then
|
||||
if [[ -x ${udevdir}/$_prog ]]; then
|
||||
_bin=${udevdir}/$_prog
|
||||
elif [[ "${_prog/\$env\{/}" == "$_prog" ]] && [[ "${_prog}" != "/sbin/initqueue" ]]; then
|
||||
_bin=$(find_binary "$_prog") || {
|
||||
@@ -340,9 +406,11 @@ inst_rule_programs() {
|
||||
|
||||
[[ $_bin ]] && inst_binary "$_bin"
|
||||
done
|
||||
|
||||
# shellcheck disable=SC2013
|
||||
for _prog in $(sed -nr 's/.*IMPORT\{program\}==?"([^ "]+).*/\1/p' "$1"); do
|
||||
_bin=""
|
||||
if [ -x ${udevdir}/$_prog ]; then
|
||||
if [[ -x ${udevdir}/$_prog ]]; then
|
||||
_bin=${udevdir}/$_prog
|
||||
elif [[ "${_prog/\$env\{/}" == "$_prog" ]]; then
|
||||
_bin=$(find_binary "$_prog") || {
|
||||
@@ -359,14 +427,17 @@ inst_rule_programs() {
|
||||
inst_rule_group_owner() {
|
||||
local i
|
||||
|
||||
# shellcheck disable=SC2013
|
||||
for i in $(sed -nr 's/.*OWNER=?"([^ "]+).*/\1/p' "$1"); do
|
||||
if ! grep -Eq "^$i:" "$initdir/etc/passwd" 2>/dev/null; then
|
||||
grep -E "^$i:" /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep -E "^$i:" "$dracutsysrootdir"/etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
fi
|
||||
done
|
||||
|
||||
# shellcheck disable=SC2013
|
||||
for i in $(sed -nr 's/.*GROUP=?"([^ "]+).*/\1/p' "$1"); do
|
||||
if ! grep -Eq "^$i:" "$initdir/etc/group" 2>/dev/null; then
|
||||
grep -E "^$i:" /etc/group 2>/dev/null >> "$initdir/etc/group"
|
||||
grep -E "^$i:" "$dracutsysrootdir"/etc/group 2>/dev/null >> "$initdir/etc/group"
|
||||
fi
|
||||
done
|
||||
}
|
||||
@@ -386,7 +457,7 @@ inst_rules() {
|
||||
inst_dir "$_target"
|
||||
for _rule in "$@"; do
|
||||
if [ "${_rule#/}" = "$_rule" ]; then
|
||||
for r in ${udevdir}/rules.d ${hostonly:+/etc/udev/rules.d}; do
|
||||
for r in "$dracutsysrootdir${udevdir}/rules.d" ${hostonly:+"$dracutsysrootdir"/etc/udev/rules.d}; do
|
||||
[[ -e $r/$_rule ]] || continue
|
||||
_found="$r/$_rule"
|
||||
inst_rule_programs "$_found"
|
||||
@@ -395,7 +466,7 @@ inst_rules() {
|
||||
inst_simple "$_found"
|
||||
done
|
||||
fi
|
||||
for r in '' $dracutbasedir/rules.d/; do
|
||||
for r in '' "$dracutsysrootdir$dracutbasedir/rules.d/"; do
|
||||
# skip rules without an absolute path
|
||||
[[ "${r}$_rule" != /* ]] && continue
|
||||
[[ -f ${r}$_rule ]] || continue
|
||||
@@ -436,22 +507,35 @@ inst_rules_wildcard() {
|
||||
}
|
||||
|
||||
prepare_udev_rules() {
|
||||
[ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version)
|
||||
if [ -z "$UDEVVERSION" ]; then
|
||||
UDEVVERSION=$(udevadm --version)
|
||||
export UDEVVERSION
|
||||
fi
|
||||
|
||||
if [ -z "$UDEVVERSION" ]; then
|
||||
derror "Failed to detect udev version!"
|
||||
return 1
|
||||
fi
|
||||
if [ -z "${UDEVVERSION##*[!0-9]*}" ]; then
|
||||
derror "udevadm --version did not report an integer, udev version cannot be determined!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
for f in "$@"; do
|
||||
f="${initdir}/etc/udev/rules.d/$f"
|
||||
[ -e "$f" ] || continue
|
||||
while read line || [ -n "$line" ]; do
|
||||
while read -r line || [ -n "$line" ]; do
|
||||
if [ "${line%%IMPORT PATH_ID}" != "$line" ]; then
|
||||
if [ $UDEVVERSION -ge 174 ]; then
|
||||
if (( UDEVVERSION >= 174 )); then
|
||||
printf '%sIMPORT{builtin}="path_id"\n' "${line%%IMPORT PATH_ID}"
|
||||
else
|
||||
printf '%sIMPORT{program}="path_id %%p"\n' "${line%%IMPORT PATH_ID}"
|
||||
fi
|
||||
elif [ "${line%%IMPORT BLKID}" != "$line" ]; then
|
||||
if [ $UDEVVERSION -ge 176 ]; then
|
||||
if (( UDEVVERSION >= 176 )); then
|
||||
printf '%sIMPORT{builtin}="blkid"\n' "${line%%IMPORT BLKID}"
|
||||
else
|
||||
# shellcheck disable=SC2016
|
||||
printf '%sIMPORT{program}="/sbin/blkid -o udev -p $tempnode"\n' "${line%%IMPORT BLKID}"
|
||||
fi
|
||||
else
|
||||
@@ -509,30 +593,38 @@ inst_any() {
|
||||
# Install a <file> located on a lib directory to the initramfs image
|
||||
# -n <pattern> install matching files
|
||||
inst_libdir_file() {
|
||||
local _files
|
||||
local -a _files
|
||||
if [[ "$1" == "-n" ]]; then
|
||||
local _pattern=$2
|
||||
shift 2
|
||||
for _dir in $libdirs; do
|
||||
for _i in "$@"; do
|
||||
for _f in "$_dir"/$_i; do
|
||||
[[ "$_f" =~ $_pattern ]] || continue
|
||||
[[ -e "$_f" ]] && _files+="$_f "
|
||||
for _f in "$dracutsysrootdir$_dir"/$_i; do
|
||||
[[ "${_f#$dracutsysrootdir}" =~ $_pattern ]] || continue
|
||||
[[ -e "$_f" ]] && _files+=("${_f#$dracutsysrootdir}")
|
||||
done
|
||||
done
|
||||
done
|
||||
else
|
||||
for _dir in $libdirs; do
|
||||
for _i in "$@"; do
|
||||
for _f in "$_dir"/$_i; do
|
||||
[[ -e "$_f" ]] && _files+="$_f "
|
||||
for _f in "$dracutsysrootdir$_dir"/$_i; do
|
||||
[[ -e "$_f" ]] && _files+=("${_f#$dracutsysrootdir}")
|
||||
done
|
||||
done
|
||||
done
|
||||
fi
|
||||
[[ $_files ]] && inst_multiple $_files
|
||||
[[ ${#_files[@]} -gt 0 ]] && inst_multiple "${_files[@]}"
|
||||
}
|
||||
|
||||
# get a command to decompress the given file
|
||||
get_decompress_cmd() {
|
||||
case "$1" in
|
||||
*.gz) echo 'gzip -f -d' ;;
|
||||
*.bz2) echo 'bzip2 -d' ;;
|
||||
*.xz) echo 'xz -f -d' ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# install function decompressing the target and handling symlinks
|
||||
# $@ = list of compressed (gz or bz2) files or symlinks pointing to such files
|
||||
@@ -542,14 +634,10 @@ inst_libdir_file() {
|
||||
inst_decompress() {
|
||||
local _src _cmd
|
||||
|
||||
for _src in $@
|
||||
do
|
||||
case ${_src} in
|
||||
*.gz) _cmd='gzip -f -d' ;;
|
||||
*.bz2) _cmd='bzip2 -d' ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
inst_simple ${_src}
|
||||
for _src in "$@"; do
|
||||
_cmd=$(get_decompress_cmd "${_src}")
|
||||
[[ -z "${_cmd}" ]] && return 1
|
||||
inst_simple "${_src}"
|
||||
# Decompress with chosen tool. We assume that tool changes name e.g.
|
||||
# from 'name.gz' to 'name'.
|
||||
${_cmd} "${initdir}${_src}"
|
||||
@@ -562,35 +650,40 @@ inst_decompress() {
|
||||
inst_opt_decompress() {
|
||||
local _src
|
||||
|
||||
for _src in $@; do
|
||||
for _src in "$@"; do
|
||||
inst_decompress "${_src}" || inst "${_src}"
|
||||
done
|
||||
}
|
||||
|
||||
# module_check <dracut module>
|
||||
# module_check <dracut module> [<forced>] [<module path>]
|
||||
# execute the check() function of module-setup.sh of <dracut module>
|
||||
# or the "check" script, if module-setup.sh is not found
|
||||
# "check $hostonly" is called
|
||||
module_check() {
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _moddir=$3
|
||||
local _ret
|
||||
local _forced=0
|
||||
local _hostonly=$hostonly
|
||||
[[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1")
|
||||
[ $# -eq 2 ] && _forced=$2
|
||||
[[ -d $_moddir ]] || return 1
|
||||
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
||||
# if we do not have a check script, we are unconditionally included
|
||||
[[ -x $_moddir/check ]] || return 0
|
||||
[ $_forced -ne 0 ] && unset hostonly
|
||||
$_moddir/check $hostonly
|
||||
[[ $_forced != 0 ]] && unset hostonly
|
||||
# don't quote $hostonly to leave argument empty
|
||||
# shellcheck disable=SC2086
|
||||
"$_moddir"/check $hostonly
|
||||
_ret=$?
|
||||
else
|
||||
unset check depends cmdline install installkernel
|
||||
check() { true; }
|
||||
. $_moddir/module-setup.sh
|
||||
. "$_moddir"/module-setup.sh
|
||||
is_func check || return 0
|
||||
[ $_forced -ne 0 ] && unset hostonly
|
||||
moddir=$_moddir check $hostonly
|
||||
[[ $_forced != 0 ]] && unset hostonly
|
||||
# don't quote $hostonly to leave argument empty
|
||||
# shellcheck disable=SC2086
|
||||
moddir="$_moddir" check $hostonly
|
||||
_ret=$?
|
||||
unset check depends cmdline install installkernel
|
||||
fi
|
||||
@@ -598,48 +691,50 @@ module_check() {
|
||||
return $_ret
|
||||
}
|
||||
|
||||
# module_check_mount <dracut module>
|
||||
# module_check_mount <dracut module> [<module path>]
|
||||
# execute the check() function of module-setup.sh of <dracut module>
|
||||
# or the "check" script, if module-setup.sh is not found
|
||||
# "mount_needs=1 check 0" is called
|
||||
module_check_mount() {
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _moddir=$2
|
||||
local _ret
|
||||
mount_needs=1
|
||||
export mount_needs=1
|
||||
[[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1")
|
||||
[[ -d $_moddir ]] || return 1
|
||||
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
||||
# if we do not have a check script, we are unconditionally included
|
||||
[[ -x $_moddir/check ]] || return 0
|
||||
mount_needs=1 $_moddir/check 0
|
||||
mount_needs=1 "$_moddir"/check 0
|
||||
_ret=$?
|
||||
else
|
||||
unset check depends cmdline install installkernel
|
||||
check() { false; }
|
||||
. $_moddir/module-setup.sh
|
||||
. "$_moddir"/module-setup.sh
|
||||
moddir=$_moddir check 0
|
||||
_ret=$?
|
||||
unset check depends cmdline install installkernel
|
||||
fi
|
||||
unset mount_needs
|
||||
return $_ret
|
||||
return "$_ret"
|
||||
}
|
||||
|
||||
# module_depends <dracut module>
|
||||
# module_depends <dracut module> [<module path>]
|
||||
# execute the depends() function of module-setup.sh of <dracut module>
|
||||
# or the "depends" script, if module-setup.sh is not found
|
||||
module_depends() {
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _moddir=$2
|
||||
local _ret
|
||||
[[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1")
|
||||
[[ -d $_moddir ]] || return 1
|
||||
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
||||
# if we do not have a check script, we have no deps
|
||||
[[ -x $_moddir/check ]] || return 0
|
||||
$_moddir/check -d
|
||||
"$_moddir"/check -d
|
||||
return $?
|
||||
else
|
||||
unset check depends cmdline install installkernel
|
||||
depends() { true; }
|
||||
. $_moddir/module-setup.sh
|
||||
. "$_moddir"/module-setup.sh
|
||||
moddir=$_moddir depends
|
||||
_ret=$?
|
||||
unset check depends cmdline install installkernel
|
||||
@@ -647,12 +742,13 @@ module_depends() {
|
||||
fi
|
||||
}
|
||||
|
||||
# module_cmdline <dracut module>
|
||||
# module_cmdline <dracut module> [<module path>]
|
||||
# execute the cmdline() function of module-setup.sh of <dracut module>
|
||||
# or the "cmdline" script, if module-setup.sh is not found
|
||||
module_cmdline() {
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _moddir=$2
|
||||
local _ret
|
||||
[[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1")
|
||||
[[ -d $_moddir ]] || return 1
|
||||
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
||||
[[ -x $_moddir/cmdline ]] && . "$_moddir/cmdline"
|
||||
@@ -660,20 +756,21 @@ module_cmdline() {
|
||||
else
|
||||
unset check depends cmdline install installkernel
|
||||
cmdline() { true; }
|
||||
. $_moddir/module-setup.sh
|
||||
moddir=$_moddir cmdline
|
||||
. "$_moddir"/module-setup.sh
|
||||
moddir="$_moddir" cmdline
|
||||
_ret=$?
|
||||
unset check depends cmdline install installkernel
|
||||
return $_ret
|
||||
fi
|
||||
}
|
||||
|
||||
# module_install <dracut module>
|
||||
# module_install <dracut module> [<module path>]
|
||||
# execute the install() function of module-setup.sh of <dracut module>
|
||||
# or the "install" script, if module-setup.sh is not found
|
||||
module_install() {
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _moddir=$2
|
||||
local _ret
|
||||
[[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1")
|
||||
[[ -d $_moddir ]] || return 1
|
||||
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
||||
[[ -x $_moddir/install ]] && . "$_moddir/install"
|
||||
@@ -681,20 +778,21 @@ module_install() {
|
||||
else
|
||||
unset check depends cmdline install installkernel
|
||||
install() { true; }
|
||||
. $_moddir/module-setup.sh
|
||||
moddir=$_moddir install
|
||||
. "$_moddir"/module-setup.sh
|
||||
moddir="$_moddir" install
|
||||
_ret=$?
|
||||
unset check depends cmdline install installkernel
|
||||
return $_ret
|
||||
fi
|
||||
}
|
||||
|
||||
# module_installkernel <dracut module>
|
||||
# module_installkernel <dracut module> [<module path>]
|
||||
# execute the installkernel() function of module-setup.sh of <dracut module>
|
||||
# or the "installkernel" script, if module-setup.sh is not found
|
||||
module_installkernel() {
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _moddir=$2
|
||||
local _ret
|
||||
[[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1")
|
||||
[[ -d $_moddir ]] || return 1
|
||||
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
||||
[[ -x $_moddir/installkernel ]] && . "$_moddir/installkernel"
|
||||
@@ -702,23 +800,25 @@ module_installkernel() {
|
||||
else
|
||||
unset check depends cmdline install installkernel
|
||||
installkernel() { true; }
|
||||
. $_moddir/module-setup.sh
|
||||
moddir=$_moddir installkernel
|
||||
. "$_moddir"/module-setup.sh
|
||||
moddir="$_moddir" installkernel
|
||||
_ret=$?
|
||||
unset check depends cmdline install installkernel
|
||||
return $_ret
|
||||
fi
|
||||
}
|
||||
|
||||
# check_mount <dracut module>
|
||||
# check_mount <dracut module> [<use_as_dep>] [<module path>]
|
||||
# check_mount checks, if a dracut module is needed for the given
|
||||
# device and filesystem types in "${host_fs_types[@]}"
|
||||
check_mount() {
|
||||
local _mod=$1
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _moddir=$3
|
||||
local _ret
|
||||
local _moddep
|
||||
|
||||
[[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1")
|
||||
# shellcheck disable=SC2154
|
||||
[ "${#host_fs_types[@]}" -le 0 ] && return 1
|
||||
|
||||
# If we are already scheduled to be loaded, no need to check again.
|
||||
@@ -730,12 +830,13 @@ check_mount() {
|
||||
|
||||
[[ $2 ]] || mods_checked_as_dep+=" $_mod "
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
if [[ " $omit_dracutmodules " == *\ $_mod\ * ]]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then
|
||||
module_check_mount $_mod; ret=$?
|
||||
module_check_mount "$_mod" "$_moddir"; ret=$?
|
||||
|
||||
# explicit module, so also accept ret=255
|
||||
[[ $ret = 0 || $ret = 255 ]] || return 1
|
||||
@@ -743,14 +844,14 @@ check_mount() {
|
||||
# module not in our list
|
||||
if [[ $dracutmodules = all ]]; then
|
||||
# check, if we can and should install this module
|
||||
module_check_mount $_mod || return 1
|
||||
module_check_mount "$_mod" "$_moddir" || return 1
|
||||
else
|
||||
# skip this module
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
for _moddep in $(module_depends $_mod); do
|
||||
for _moddep in $(module_depends "$_mod" "$_moddir"); do
|
||||
# handle deps as if they were manually added
|
||||
[[ " $dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $dracutmodules " != *\ $_moddep\ * ]] \
|
||||
@@ -762,7 +863,7 @@ check_mount() {
|
||||
&& [[ " $force_add_dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& force_add_dracutmodules+=" $_moddep "
|
||||
# if a module we depend on fail, fail also
|
||||
if ! check_module $_moddep; then
|
||||
if ! check_module "$_moddep"; then
|
||||
derror "dracut module '$_mod' depends on '$_moddep', which can't be installed"
|
||||
return 1
|
||||
fi
|
||||
@@ -774,15 +875,17 @@ check_mount() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# check_module <dracut module> [<use_as_dep>]
|
||||
# check_module <dracut module> [<use_as_dep>] [<module path>]
|
||||
# check if a dracut module is to be used in the initramfs process
|
||||
# if <use_as_dep> is set, then the process also keeps track
|
||||
# that the modules were checked for the dependency tracking process
|
||||
check_module() {
|
||||
local _mod=$1
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _moddir=$3
|
||||
local _ret
|
||||
local _moddep
|
||||
|
||||
[[ -z $_moddir ]] && _moddir=$(dracut_module_path "$1")
|
||||
# If we are already scheduled to be loaded, no need to check again.
|
||||
[[ " $mods_to_load " == *\ $_mod\ * ]] && return 0
|
||||
[[ " $mods_checked_as_dep " == *\ $_mod\ * ]] && return 1
|
||||
@@ -793,15 +896,15 @@ check_module() {
|
||||
[[ $2 ]] || mods_checked_as_dep+=" $_mod "
|
||||
|
||||
if [[ " $omit_dracutmodules " == *\ $_mod\ * ]]; then
|
||||
dinfo "dracut module '$_mod' will not be installed, because it's in the list to be omitted!"
|
||||
ddebug "dracut module '$_mod' will not be installed, because it's in the list to be omitted!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then
|
||||
if [[ " $dracutmodules $force_add_dracutmodules " == *\ $_mod\ * ]]; then
|
||||
module_check $_mod 1; ret=$?
|
||||
module_check "$_mod" 1 "$_moddir"; ret=$?
|
||||
else
|
||||
module_check $_mod 0; ret=$?
|
||||
module_check "$_mod" 0 "$_moddir"; ret=$?
|
||||
fi
|
||||
# explicit module, so also accept ret=255
|
||||
[[ $ret = 0 || $ret = 255 ]] || return 1
|
||||
@@ -809,7 +912,7 @@ check_module() {
|
||||
# module not in our list
|
||||
if [[ $dracutmodules = all ]]; then
|
||||
# check, if we can and should install this module
|
||||
module_check $_mod; ret=$?
|
||||
module_check "$_mod" 0 "$_moddir"; ret=$?
|
||||
if [[ $ret != 0 ]]; then
|
||||
[[ $2 ]] && return 1
|
||||
[[ $ret != 255 ]] && return 1
|
||||
@@ -820,7 +923,7 @@ check_module() {
|
||||
fi
|
||||
fi
|
||||
|
||||
for _moddep in $(module_depends $_mod); do
|
||||
for _moddep in $(module_depends "$_mod" "$_moddir"); do
|
||||
# handle deps as if they were manually added
|
||||
[[ " $dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $dracutmodules " != *\ $_moddep\ * ]] \
|
||||
@@ -832,7 +935,7 @@ check_module() {
|
||||
&& [[ " $force_add_dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& force_add_dracutmodules+=" $_moddep "
|
||||
# if a module we depend on fail, fail also
|
||||
if ! check_module $_moddep; then
|
||||
if ! check_module "$_moddep"; then
|
||||
derror "dracut module '$_mod' depends on '$_moddep', which can't be installed"
|
||||
return 1
|
||||
fi
|
||||
@@ -845,7 +948,7 @@ check_module() {
|
||||
}
|
||||
|
||||
# for_each_module_dir <func>
|
||||
# execute "<func> <dracut module> 1"
|
||||
# execute "<func> <dracut module> 1 <module path>"
|
||||
for_each_module_dir() {
|
||||
local _modcheck
|
||||
local _mod
|
||||
@@ -857,7 +960,7 @@ for_each_module_dir() {
|
||||
[[ -e $_moddir/install || -e $_moddir/installkernel || \
|
||||
-e $_moddir/module-setup.sh ]] || continue
|
||||
_mod=${_moddir##*/}; _mod=${_mod#[0-9][0-9]}
|
||||
$_func $_mod 1
|
||||
$_func "$_mod" 1 "$_moddir"
|
||||
done
|
||||
|
||||
# Report any missing dracut modules, the user has specified
|
||||
@@ -878,80 +981,6 @@ for_each_module_dir() {
|
||||
done
|
||||
}
|
||||
|
||||
# Install a single kernel module along with any firmware it may require.
|
||||
# $1 = full path to kernel module to install
|
||||
install_kmod_with_fw() {
|
||||
# no need to go further if the module is already installed
|
||||
|
||||
[[ -e "${initdir}/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" ]] \
|
||||
&& return 0
|
||||
|
||||
if [[ $omit_drivers ]]; then
|
||||
local _kmod=${1##*/}
|
||||
_kmod=${_kmod%.ko*}
|
||||
_kmod=${_kmod/-/_}
|
||||
if [[ "$_kmod" =~ $omit_drivers ]]; then
|
||||
dinfo "Omitting driver $_kmod"
|
||||
return 0
|
||||
fi
|
||||
if [[ "${1##*/lib/modules/$kernel/}" =~ $omit_drivers ]]; then
|
||||
dinfo "Omitting driver $_kmod"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $silent_omit_drivers ]]; then
|
||||
local _kmod=${1##*/}
|
||||
_kmod=${_kmod%.ko*}
|
||||
_kmod=${_kmod/-/_}
|
||||
[[ "$_kmod" =~ $silent_omit_drivers ]] && return 0
|
||||
[[ "${1##*/lib/modules/$kernel/}" =~ $silent_omit_drivers ]] && return 0
|
||||
fi
|
||||
|
||||
inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}"
|
||||
ret=$?
|
||||
(($ret != 0)) && return $ret
|
||||
|
||||
local _modname=${1##*/} _fwdir _found _fw
|
||||
_modname=${_modname%.ko*}
|
||||
for _fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do
|
||||
_found=''
|
||||
for _fwdir in $fw_dir; do
|
||||
[[ -d $_fwdir && -f $_fwdir/$_fw ]] || continue
|
||||
inst_simple "$_fwdir/$_fw" "/lib/firmware/$_fw"
|
||||
_found=yes
|
||||
done
|
||||
if [[ $_found != yes ]]; then
|
||||
if ! [[ -d $(echo /sys/module/${_modname//-/_}|{ read a b; echo $a; }) ]]; then
|
||||
dinfo "Possible missing firmware \"${_fw}\" for kernel module" \
|
||||
"\"${_modname}.ko\""
|
||||
else
|
||||
dwarn "Possible missing firmware \"${_fw}\" for kernel module" \
|
||||
"\"${_modname}.ko\""
|
||||
fi
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
# Do something with all the dependencies of a kernel module.
|
||||
# Note that kernel modules depend on themselves using the technique we use
|
||||
# $1 = function to call for each dependency we find
|
||||
# It will be passed the full path to the found kernel module
|
||||
# $2 = module to get dependencies for
|
||||
# rest of args = arguments to modprobe
|
||||
# _fderr specifies FD passed from surrounding scope
|
||||
for_each_kmod_dep() {
|
||||
local _func=$1 _kmod=$2 _cmd _modpath _options
|
||||
shift 2
|
||||
modprobe "$@" --ignore-install --show-depends $_kmod 2>&${_fderr} | (
|
||||
while read _cmd _modpath _options || [ -n "$_cmd" ]; do
|
||||
[[ $_cmd = insmod ]] || continue
|
||||
$_func ${_modpath} || exit $?
|
||||
done
|
||||
)
|
||||
}
|
||||
|
||||
dracut_kernel_post() {
|
||||
for _f in modules.builtin.bin modules.builtin modules.order; do
|
||||
[[ -e $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
|
||||
@@ -959,7 +988,7 @@ dracut_kernel_post() {
|
||||
|
||||
# generate module dependencies for the initrd
|
||||
if [[ -d $initdir/lib/modules/$kernel ]] && \
|
||||
! depmod -a -b "$initdir" $kernel; then
|
||||
! depmod -a -b "$initdir" "$kernel"; then
|
||||
dfatal "\"depmod -a $kernel\" failed."
|
||||
exit 1
|
||||
fi
|
||||
@@ -997,8 +1026,9 @@ instmods() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
$DRACUT_INSTALL \
|
||||
"$DRACUT_INSTALL" \
|
||||
${initdir:+-D "$initdir"} \
|
||||
${dracutsysrootdir:+-r "$dracutsysrootdir"} \
|
||||
${loginstall:+-L "$loginstall"} \
|
||||
${hostonly:+-H} \
|
||||
${omit_drivers:+-N "$omit_drivers"} \
|
||||
@@ -1008,10 +1038,11 @@ instmods() {
|
||||
-m "$@"
|
||||
_ret=$?
|
||||
|
||||
if (($_ret != 0)) && [[ -z "$_silent" ]]; then
|
||||
if ((_ret != 0)) && [[ -z "$_silent" ]]; then
|
||||
derror "FAILED: " \
|
||||
$DRACUT_INSTALL \
|
||||
"$DRACUT_INSTALL" \
|
||||
${initdir:+-D "$initdir"} \
|
||||
${dracutsysrootdir:+-r "$dracutsysrootdir"} \
|
||||
${loginstall:+-L "$loginstall"} \
|
||||
${hostonly:+-H} \
|
||||
${omit_drivers:+-N "$omit_drivers"} \
|
||||
@@ -1037,3 +1068,26 @@ else
|
||||
ln -sfn -- "$(convert_abs_rel "${_dest}" "${_source}")" "${initdir}/${_dest}"
|
||||
}
|
||||
fi
|
||||
|
||||
is_qemu_virtualized() {
|
||||
# 0 if a virt environment was detected
|
||||
# 1 if a virt environment could not be detected
|
||||
# 255 if any error was encountered
|
||||
if type -P systemd-detect-virt >/dev/null 2>&1; then
|
||||
if ! vm=$(systemd-detect-virt --vm >/dev/null 2>&1); then
|
||||
return 255
|
||||
fi
|
||||
[[ $vm = "qemu" ]] && return 0
|
||||
[[ $vm = "kvm" ]] && return 0
|
||||
[[ $vm = "bochs" ]] && return 0
|
||||
fi
|
||||
|
||||
for i in /sys/class/dmi/id/*_vendor; do
|
||||
[[ -f $i ]] || continue
|
||||
read -r vendor < "$i"
|
||||
[[ "$vendor" == "QEMU" ]] && return 0
|
||||
[[ "$vendor" == "Red Hat" ]] && return 0
|
||||
[[ "$vendor" == "Bochs" ]] && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
@@ -16,10 +16,17 @@ SKIP="$dracutbasedir/skipcpio"
|
||||
|
||||
mount -o ro /boot &>/dev/null || true
|
||||
|
||||
if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
|
||||
if [[ -d /efi/loader/entries || -L /efi/loader/entries ]] \
|
||||
&& [[ $MACHINE_ID ]] \
|
||||
&& [[ -d /efi/${MACHINE_ID} || -L /efi/${MACHINE_ID} ]] ; then
|
||||
IMG="/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
|
||||
elif [[ -d /boot/loader/entries || -L /boot/loader/entries ]] \
|
||||
&& [[ $MACHINE_ID ]] \
|
||||
&& [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
|
||||
IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
|
||||
else
|
||||
IMG="/boot/initramfs-${KERNEL_VERSION}.img"
|
||||
fi
|
||||
[[ -f $IMG ]] || IMG="/boot/initramfs-${KERNEL_VERSION}.img"
|
||||
|
||||
cd /run/initramfs
|
||||
|
||||
@@ -40,4 +47,18 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -d squash ]]; then
|
||||
unsquashfs -no-xattrs -f -d . squash/root.img >/dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Squash module is enabled for this initramfs but failed to unpack squash/root.img" >&2
|
||||
rm -f -- /run/initramfs/shutdown
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -e /etc/selinux/config -a -x /usr/sbin/setfiles ] ; then
|
||||
. /etc/selinux/config
|
||||
/usr/sbin/setfiles -v -r /run/initramfs /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts /run/initramfs > /dev/null
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
@@ -18,7 +18,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
__DRACUT_LOGGER__=1
|
||||
export __DRACUT_LOGGER__=1
|
||||
|
||||
|
||||
## @brief Logging facility module for dracut both at build- and boot-time.
|
||||
@@ -114,13 +114,13 @@ dlog_init() {
|
||||
|
||||
if [ -z "$fileloglvl" ]; then
|
||||
[ -w "$logfile" ] && fileloglvl=4 || fileloglvl=0
|
||||
elif (( $fileloglvl > 0 )); then
|
||||
elif (( fileloglvl > 0 )); then
|
||||
if [[ $logfile ]]; then
|
||||
__oldumask=$(umask)
|
||||
umask 0377
|
||||
! [ -e "$logfile" ] && >"$logfile"
|
||||
umask $__oldumask
|
||||
if [ -w "$logfile" -a -f "$logfile" ]; then
|
||||
! [ -e "$logfile" ] && : >"$logfile"
|
||||
umask "$__oldumask"
|
||||
if [[ -w $logfile ]] && [[ -f $logfile ]]; then
|
||||
# Mark new run in the log file
|
||||
echo >>"$logfile"
|
||||
if command -v date >/dev/null; then
|
||||
@@ -138,12 +138,12 @@ dlog_init() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if (( $UID != 0 )); then
|
||||
if (( UID != 0 )); then
|
||||
kmsgloglvl=0
|
||||
sysloglvl=0
|
||||
fi
|
||||
|
||||
if (( $sysloglvl > 0 )); then
|
||||
if (( sysloglvl > 0 )); then
|
||||
if [[ -d /run/systemd/journal ]] \
|
||||
&& type -P systemd-cat &>/dev/null \
|
||||
&& systemctl --quiet is-active systemd-journald.socket &>/dev/null \
|
||||
@@ -153,7 +153,7 @@ dlog_init() {
|
||||
readonly _dlogfd=15
|
||||
systemd-cat -t 'dracut' --level-prefix=true <"$_systemdcatfile" &
|
||||
exec 15>"$_systemdcatfile"
|
||||
elif ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null; then
|
||||
elif ! [[ -S /dev/log ]] && [[ -w /dev/log ]] || ! command -v logger >/dev/null; then
|
||||
# We cannot log to syslog, so turn this facility off.
|
||||
kmsgloglvl=$sysloglvl
|
||||
sysloglvl=0
|
||||
@@ -162,7 +162,7 @@ dlog_init() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if (($sysloglvl > 0)) || (($kmsgloglvl > 0 )); then
|
||||
if (( sysloglvl > 0 )) || (( kmsgloglvl > 0 )); then
|
||||
if [ -n "$dracutbasedir" ]; then
|
||||
readonly syslogfacility=user
|
||||
else
|
||||
@@ -173,40 +173,40 @@ dlog_init() {
|
||||
|
||||
local lvl; local maxloglvl_l=0
|
||||
for lvl in $stdloglvl $sysloglvl $fileloglvl $kmsgloglvl; do
|
||||
(( $lvl > $maxloglvl_l )) && maxloglvl_l=$lvl
|
||||
(( lvl > maxloglvl_l )) && maxloglvl_l=$lvl
|
||||
done
|
||||
readonly maxloglvl=$maxloglvl_l
|
||||
export maxloglvl
|
||||
|
||||
|
||||
if (($stdloglvl < 6)) && (($kmsgloglvl < 6)) && (($fileloglvl < 6)) && (($sysloglvl < 6)); then
|
||||
if (( stdloglvl < 6 )) && ((kmsgloglvl < 6)) && ((fileloglvl < 6)) && ((sysloglvl < 6)); then
|
||||
unset dtrace
|
||||
dtrace() { :; };
|
||||
fi
|
||||
|
||||
if (($stdloglvl < 5)) && (($kmsgloglvl < 5)) && (($fileloglvl < 5)) && (($sysloglvl < 5)); then
|
||||
if ((stdloglvl < 5)) && ((kmsgloglvl < 5)) && ((fileloglvl < 5)) && ((sysloglvl < 5)); then
|
||||
unset ddebug
|
||||
ddebug() { :; };
|
||||
fi
|
||||
|
||||
if (($stdloglvl < 4)) && (($kmsgloglvl < 4)) && (($fileloglvl < 4)) && (($sysloglvl < 4)); then
|
||||
if ((stdloglvl < 4)) && ((kmsgloglvl < 4)) && ((fileloglvl < 4)) && ((sysloglvl < 4)); then
|
||||
unset dinfo
|
||||
dinfo() { :; };
|
||||
fi
|
||||
|
||||
if (($stdloglvl < 3)) && (($kmsgloglvl < 3)) && (($fileloglvl < 3)) && (($sysloglvl < 3)); then
|
||||
if ((stdloglvl < 3)) && ((kmsgloglvl < 3)) && ((fileloglvl < 3)) && ((sysloglvl < 3)); then
|
||||
unset dwarn
|
||||
dwarn() { :; };
|
||||
unset dwarning
|
||||
dwarning() { :; };
|
||||
fi
|
||||
|
||||
if (($stdloglvl < 2)) && (($kmsgloglvl < 2)) && (($fileloglvl < 2)) && (($sysloglvl < 2)); then
|
||||
if ((stdloglvl < 2)) && ((kmsgloglvl < 2)) && ((fileloglvl < 2)) && ((sysloglvl < 2)); then
|
||||
unset derror
|
||||
derror() { :; };
|
||||
fi
|
||||
|
||||
if (($stdloglvl < 1)) && (($kmsgloglvl < 1)) && (($fileloglvl < 1)) && (($sysloglvl < 1)); then
|
||||
if ((stdloglvl < 1)) && ((kmsgloglvl < 1)) && ((fileloglvl < 1)) && ((sysloglvl < 1)); then
|
||||
unset dfatal
|
||||
dfatal() { :; };
|
||||
fi
|
||||
@@ -241,7 +241,7 @@ _lvl2char() {
|
||||
# @retval 0 if @a lvl is correct.
|
||||
# @result Echoes logger priority.
|
||||
_lvl2syspri() {
|
||||
printf $syslogfacility.
|
||||
printf "%s" -- "$syslogfacility."
|
||||
case "$1" in
|
||||
1) echo crit;;
|
||||
2) echo error;;
|
||||
@@ -288,7 +288,7 @@ _dlvl2syslvl() {
|
||||
*) return 1;;
|
||||
esac
|
||||
|
||||
[ "$syslogfacility" = user ] && echo $((8+$lvl)) || echo $((24+$lvl))
|
||||
[ "$syslogfacility" = user ] && echo $(( 8 + lvl )) || echo $(( 24 + lvl ))
|
||||
}
|
||||
|
||||
## @brief Prints to stderr and/or writes to file, to syslog and/or /dev/kmsg
|
||||
@@ -323,22 +323,22 @@ _do_dlog() {
|
||||
local msg="$*"
|
||||
local lmsg="$lvlc: $*"
|
||||
|
||||
(( $lvl <= $stdloglvl )) && printf -- 'dracut: %s\n' "$msg" >&2
|
||||
(( lvl <= stdloglvl )) && printf -- 'dracut: %s\n' "$msg" >&2
|
||||
|
||||
if (( $lvl <= $sysloglvl )); then
|
||||
if (( lvl <= sysloglvl )); then
|
||||
if [[ "$_dlogfd" ]]; then
|
||||
printf -- "<%s>%s\n" "$(($(_dlvl2syslvl $lvl) & 7))" "$msg" >&$_dlogfd
|
||||
printf -- "<%s>%s\n" "$(($(_dlvl2syslvl "$lvl") & 7))" "$msg" >&$_dlogfd
|
||||
else
|
||||
logger -t "dracut[$$]" -p $(_lvl2syspri $lvl) -- "$msg"
|
||||
logger -t "dracut[$$]" -p "$(_lvl2syspri "$lvl")" -- "$msg"
|
||||
fi
|
||||
fi
|
||||
|
||||
if (( $lvl <= $fileloglvl )) && [[ -w "$logfile" ]] && [[ -f "$logfile" ]]; then
|
||||
if (( lvl <= fileloglvl )) && [[ -w "$logfile" ]] && [[ -f "$logfile" ]]; then
|
||||
echo "$lmsg" >>"$logfile"
|
||||
fi
|
||||
|
||||
(( $lvl <= $kmsgloglvl )) && \
|
||||
echo "<$(_dlvl2syslvl $lvl)>dracut[$$] $msg" >/dev/kmsg
|
||||
(( lvl <= kmsgloglvl )) && \
|
||||
echo "<$(_dlvl2syslvl "$lvl")>dracut[$$] $msg" >/dev/kmsg
|
||||
}
|
||||
|
||||
## @brief Internal helper function for _do_dlog()
|
||||
@@ -359,12 +359,12 @@ _do_dlog() {
|
||||
# echo "This is a warning" | dwarn
|
||||
dlog() {
|
||||
[ -z "$maxloglvl" ] && return 0
|
||||
(( $1 <= $maxloglvl )) || return 0
|
||||
(( $1 <= maxloglvl )) || return 0
|
||||
|
||||
if (( $# > 1 )); then
|
||||
_do_dlog "$@"
|
||||
else
|
||||
while read line || [ -n "$line" ]; do
|
||||
while read -r line || [ -n "$line" ]; do
|
||||
_do_dlog "$1" "$line"
|
||||
done
|
||||
fi
|
||||
|
127
dracut.8.asc
127
dracut.8.asc
@@ -3,6 +3,7 @@ DRACUT(8)
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
:man version: {version}
|
||||
|
||||
NAME
|
||||
----
|
||||
@@ -264,6 +265,9 @@ example:
|
||||
**-v, --verbose**::
|
||||
increase verbosity level (default is info(4))
|
||||
|
||||
**--version**::
|
||||
display version and exit
|
||||
|
||||
**-q, --quiet**:: decrease verbosity level (default is info(4))
|
||||
|
||||
**-c, --conf** _<dracut configuration file>_::
|
||||
@@ -284,6 +288,15 @@ Default:
|
||||
Default:
|
||||
_/var/tmp_
|
||||
|
||||
**-r, --sysroot** _<sysroot directory>_::
|
||||
specify the sysroot directory to collect files from.
|
||||
This is useful to create the initramfs image from
|
||||
a cross-compiled sysroot directory. For the extra helper
|
||||
variables, see *ENVIRONMENT* below.
|
||||
+
|
||||
Default:
|
||||
_empty_
|
||||
|
||||
**--sshkey** _<sshkey file>_:: ssh key file used with ssh-client module.
|
||||
|
||||
**--logfile** _<logfile>_:: logfile to use; overrides any setting from
|
||||
@@ -497,6 +510,9 @@ will not be able to boot.
|
||||
The <BUILD_ID> is taken from BUILD_ID in _/usr/lib/os-release_ or if it exists
|
||||
_/etc/os-release_ and is left out, if BUILD_ID is non-existant or empty.
|
||||
|
||||
**--no-uefi**::
|
||||
Disables UEFI mode.
|
||||
|
||||
**--no-machineid**::
|
||||
affects the default output filename of **--uefi** and will discard the <MACHINE_ID>
|
||||
part.
|
||||
@@ -507,6 +523,10 @@ will not be able to boot.
|
||||
_$prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
|
||||
or _$prefix/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
|
||||
|
||||
**--uefi-splash-image _<FILE>_**::
|
||||
Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**) image
|
||||
format.
|
||||
|
||||
**--kernel-image _<FILE>_**::
|
||||
Specifies the kernel image, which to include in the UEFI executable. The default is
|
||||
_/lib/modules/<KERNEL-VERSION>/vmlinuz_ or _/boot/vmlinuz-<KERNEL-VERSION>_
|
||||
@@ -517,6 +537,97 @@ ENVIRONMENT
|
||||
_INITRD_COMPRESS_::
|
||||
sets the default compression program. See **--compress**.
|
||||
|
||||
_DRACUT_LDCONFIG_::
|
||||
sets the _ldconfig_ program path and options. Optional.
|
||||
Used for **--sysroot**.
|
||||
+
|
||||
Default:
|
||||
_ldconfig_
|
||||
|
||||
_DRACUT_LDD_::
|
||||
sets the _ldd_ program path and options. Optional.
|
||||
Used for **--sysroot**.
|
||||
+
|
||||
Default:
|
||||
_ldd_
|
||||
|
||||
_DRACUT_TESTBIN_::
|
||||
sets the initially tested binary for detecting library paths.
|
||||
Optional. Used for **--sysroot**. In the cross-compiled sysroot,
|
||||
the default value (_/bin/sh_) is unusable, as it is an absolute
|
||||
symlink and points outside the sysroot directory.
|
||||
+
|
||||
Default:
|
||||
_/bin/sh_
|
||||
|
||||
_DRACUT_INSTALL_::
|
||||
overrides path and options for executing _dracut-install_ internally.
|
||||
Optional. Can be used to debug _dracut-install_ while running the
|
||||
main dracut script.
|
||||
+
|
||||
Default:
|
||||
_dracut-install_
|
||||
+
|
||||
Example:
|
||||
DRACUT_INSTALL="valgrind dracut-install"
|
||||
|
||||
_DRACUT_COMPRESS_BZIP2_::
|
||||
_DRACUT_COMPRESS_BZIP2_::
|
||||
_DRACUT_COMPRESS_LBZIP2_::
|
||||
_DRACUT_COMPRESS_LZMA_::
|
||||
_DRACUT_COMPRESS_XZ_::
|
||||
_DRACUT_COMPRESS_GZIP_::
|
||||
_DRACUT_COMPRESS_PIGZ_::
|
||||
_DRACUT_COMPRESS_LZOP_::
|
||||
_DRACUT_COMPRESS_ZSTD_::
|
||||
_DRACUT_COMPRESS_LZ4_::
|
||||
_DRACUT_COMPRESS_CAT_::
|
||||
overrides for compression utilities to support using them from
|
||||
non-standard paths.
|
||||
+
|
||||
Default values are the default compression utility names to be found in **PATH**.
|
||||
|
||||
_DRACUT_ARCH_::
|
||||
overrides the value of **uname -m**. Used for **--sysroot**.
|
||||
+
|
||||
Default:
|
||||
_empty_ (the value of **uname -m** on the host system)
|
||||
|
||||
_SYSTEMD_VERSION_::
|
||||
overrides systemd version. Used for **--sysroot**.
|
||||
|
||||
_SYSTEMCTL_::
|
||||
overrides the systemctl binary. Used for **--sysroot**.
|
||||
|
||||
_NM_VERSION_::
|
||||
overrides the NetworkManager version. Used for **--sysroot**.
|
||||
|
||||
_DRACUT_INSTALL_PATH_::
|
||||
overrides **PATH** environment for **dracut-install** to look for
|
||||
binaries relative to **--sysroot**. In a cross-compiled environment
|
||||
(e.g. Yocto), PATH points to natively built binaries that are not
|
||||
in the host's /bin, /usr/bin, etc. **dracut-install** still needs plain
|
||||
/bin and /usr/bin that are relative to the cross-compiled sysroot.
|
||||
+
|
||||
Default:
|
||||
_PATH_
|
||||
|
||||
_DRACUT_INSTALL_LOG_TARGET_::
|
||||
overrides **DRACUT_LOG_TARGET** for **dracut-install**. It allows
|
||||
running **dracut-install* to run with different log target that
|
||||
**dracut** runs with.
|
||||
+
|
||||
Default:
|
||||
_DRACUT_LOG_TARGET_
|
||||
|
||||
_DRACUT_INSTALL_LOG_LEVEL_::
|
||||
overrides **DRACUT_LOG_LEVEL** for **dracut-install**. It allows
|
||||
running **dracut-install* to run with different log level that
|
||||
**dracut** runs with.
|
||||
+
|
||||
Default:
|
||||
_DRACUT_LOG_LEVEL_
|
||||
|
||||
FILES
|
||||
-----
|
||||
_/var/log/dracut.log_::
|
||||
@@ -560,18 +671,18 @@ Harald Hoyer
|
||||
|
||||
Victor Lowther
|
||||
|
||||
Amadeusz Żołnowski
|
||||
|
||||
Hannes Reinecke
|
||||
|
||||
Daniel Molkentin
|
||||
|
||||
Will Woods
|
||||
|
||||
Philippe Seewer
|
||||
|
||||
Warren Togami
|
||||
|
||||
Amadeusz Żołnowski
|
||||
|
||||
Jeremy Katz
|
||||
|
||||
David Dillow
|
||||
|
||||
Will Woods
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
*dracut.cmdline*(7) *dracut.conf*(5) *lsinitrd*(1)
|
||||
|
14
dracut.asc
14
dracut.asc
@@ -1,8 +1,8 @@
|
||||
dracut
|
||||
======
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
v3.0, October 2013
|
||||
|
||||
dracut {mainversion}
|
||||
====================
|
||||
:author: Harald Hoyer
|
||||
:email: harald@redhat.com
|
||||
:revnumber: {version}
|
||||
:language: bash
|
||||
|
||||
= Introduction
|
||||
@@ -61,7 +61,7 @@ Depending on which algorithms were compiled statically into it, the kernel can
|
||||
currently unpack initrd/initramfs images compressed with gzip, bzip2 and LZMA.
|
||||
|
||||
== Mount preparations
|
||||
dracut can generate a customized initrams image which contains only whatever is
|
||||
dracut can generate a customized initramfs image which contains only whatever is
|
||||
necessary to boot some particular computer, such as ATA, SCSI and filesystem
|
||||
kernel modules (host-only mode).
|
||||
|
||||
@@ -142,7 +142,7 @@ The following steps are executed during a shutdown:
|
||||
* if yes, it does a pivot_root to /run/initramfs and executes ./shutdown.
|
||||
The old root is then mounted on /oldroot.
|
||||
/usr/lib/dracut/modules.d/99shutdown/shutdown.sh is the shutdown executable.
|
||||
* shutdown will try to umount every /oldroot mount and calls the various
|
||||
* shutdown will try to unmount every /oldroot mount and calls the various
|
||||
shutdown hooks from the dracut modules
|
||||
|
||||
This ensures, that all devices are disassembled and unmounted cleanly.
|
||||
|
@@ -3,6 +3,7 @@ DRACUT.BOOTUP(7)
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
:man version: {version}
|
||||
|
||||
NAME
|
||||
----
|
||||
|
@@ -3,6 +3,7 @@ DRACUT.CMDLINE(7)
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
:man version: {version}
|
||||
|
||||
NAME
|
||||
----
|
||||
@@ -112,6 +113,9 @@ resume=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7
|
||||
iso-scan/filename
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Mount all mountable devices and search for ISO pointed by the argument. When
|
||||
the ISO is found set it up as a loop device. Device containing this ISO
|
||||
image will stay mounted at /run/initramfs/isoscandev.
|
||||
Using iso-scan/filename with a Fedora/Red Hat/CentOS Live iso should just work
|
||||
by copying the original kernel cmdline parameters.
|
||||
|
||||
@@ -163,10 +167,16 @@ Misc
|
||||
specify the controlling terminal for the console.
|
||||
This is useful, if you have multiple "console=" arguments.
|
||||
|
||||
**rd.shutdown.timeout.umount=**__<seconds>__::
|
||||
specify how long dracut should wait for an individual umount to finish
|
||||
during shutdown. This avoids the system from blocking when unmounting a file
|
||||
system cannot complete and waits indefinitely. Value '0' means to wait
|
||||
'forever'. The default is 90 seconds.
|
||||
|
||||
[[dracutkerneldebug]]
|
||||
Debug
|
||||
~~~~~
|
||||
If you are dropped to an emergency shell, the file
|
||||
If you are dropped to an emergency shell, the file
|
||||
_/run/initramfs/rdsosreport.txt_ is created, which can be saved to a (to be
|
||||
mounted by hand) partition (usually /boot) or a USB stick. Additional debugging
|
||||
info can be produced by adding **rd.debug** to the kernel command line.
|
||||
@@ -187,9 +197,9 @@ It should be attached to any report about dracut problems.
|
||||
_/run/initramfs/init.log_.
|
||||
If "quiet" is set, it also logs to the console.
|
||||
|
||||
**rd.memdebug=[0-4]**::
|
||||
Print memory usage info at various points, set the verbose level from 0 to 4.
|
||||
+
|
||||
**rd.memdebug=[0-5]**::
|
||||
Print memory usage info at various points, set the verbose level from 0 to 5.
|
||||
+
|
||||
Higher level means more debugging output:
|
||||
+
|
||||
----
|
||||
@@ -197,10 +207,14 @@ It should be attached to any report about dracut problems.
|
||||
1 - partial /proc/meminfo
|
||||
2 - /proc/meminfo
|
||||
3 - /proc/meminfo + /proc/slabinfo
|
||||
4 - /proc/meminfo + /proc/slabinfo + tracekomem
|
||||
NOTE: tracekomem is a shell script utilizing kernel trace to track
|
||||
the rough total memory consumption of kernel modules during
|
||||
loading. It may override other trace configurations.
|
||||
4 - /proc/meminfo + /proc/slabinfo + memstrack summary
|
||||
NOTE: memstrack is a memory tracing tool that tracks the total memory
|
||||
consumption, and peak memory consumption of each kernel modules
|
||||
and userspace progress during the whole initramfs runtime, report
|
||||
is genereted and the end of initramsfs run.
|
||||
5 - /proc/meminfo + /proc/slabinfo + memstrack (with top memory stacktrace)
|
||||
NOTE: memstrack (with top memory stacktrace) will print top memory
|
||||
allocation stack traces during the whole initramfs runtime.
|
||||
----
|
||||
|
||||
**rd.break**::
|
||||
@@ -242,7 +256,7 @@ rd.vconsole.keymap=de-latin1-nodeadkeys
|
||||
[listing]
|
||||
.Example
|
||||
--
|
||||
rd.vconsole.font=LatArCyrHeb-16
|
||||
rd.vconsole.font=eurlatgr
|
||||
--
|
||||
|
||||
**rd.vconsole.font.map=**__<console map base file name>__::
|
||||
@@ -276,12 +290,12 @@ LVM
|
||||
disable LVM detection
|
||||
|
||||
**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.
|
||||
only activate all logical volumes in the the volume groups with the given name.
|
||||
rd.lvm.vg can be specified multiple times on the kernel command line.
|
||||
|
||||
**rd.lvm.lv=**__<logical volume name>__::
|
||||
only activate the logical volumes with the given name. rd.lvm.lv can be
|
||||
specified multiple times on the kernel command line.
|
||||
**rd.lvm.lv=**__<volume group name>/<logical volume name>__::
|
||||
only activate the logical volumes with the given name.
|
||||
rd.lvm.lv can be specified multiple times on the kernel command line.
|
||||
|
||||
**rd.lvm.conf=0**::
|
||||
remove any _/etc/lvm/lvm.conf_, which may exist in the initramfs
|
||||
@@ -297,6 +311,8 @@ crypto LUKS
|
||||
The comparisons also matches, if _<luks uuid>_ is only the beginning of the
|
||||
LUKS UUID, so you don't have to specify the full UUID.
|
||||
This parameter can be specified multiple times.
|
||||
_<luks uuid>_ may be prefixed by the keyword `keysource:`, see
|
||||
_rd.luks.key_ below.
|
||||
|
||||
**rd.luks.allow-discards=**__<luks uuid>__::
|
||||
Allow using of discards (TRIM) requests for LUKS partitions with the given
|
||||
@@ -318,22 +334,37 @@ crypto LUKS
|
||||
|
||||
crypto LUKS - key on removable device support
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
**rd.luks.key=**__<keypath>__:__<keydev>__:__<luksdev>__::
|
||||
_keypath_ is a path to key file to look for. It's REQUIRED. When _keypath_
|
||||
ends with '.gpg' it's considered to be key encrypted symmetrically with GPG.
|
||||
You will be prompted for password on boot. GPG support comes with
|
||||
'crypt-gpg' module which needs to be added explicitly.
|
||||
|
||||
NB: If systemd is included in the dracut initrd, dracut's built in
|
||||
removable device keying support won't work. systemd will prompt for
|
||||
a password from the console even if you've supplied **rd.luks.key**.
|
||||
You may be able to use standard systemd *fstab*(5) syntax to
|
||||
get the same effect. If you do need **rd.luks.key** to work,
|
||||
you will have to exclude the "systemd" dracut module and any modules
|
||||
that depend on it. See *dracut.conf*(5) and
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=905683 for more
|
||||
information.
|
||||
|
||||
**rd.luks.key=**_<keypath>[:<keydev>[:<luksdev>]]_::
|
||||
_<keypath>_ is the pathname of a key file, relative to the root
|
||||
of the filesystem on some device. It's REQUIRED. When
|
||||
_<keypath>_ ends with '.gpg' it's considered to be key encrypted
|
||||
symmetrically with GPG. You will be prompted for the GPG password on
|
||||
boot. GPG support comes with the 'crypt-gpg' module, which needs to be
|
||||
added explicitly.
|
||||
+
|
||||
_keydev_ is a device on which key file resides. It might be kernel name of
|
||||
devices (should start with "/dev/"), UUID (prefixed with "UUID=") or label
|
||||
(prefix with "LABEL="). You don't have to specify full UUID. Just its beginning
|
||||
will suffice, even if its ambiguous. All matching devices will be probed.
|
||||
This parameter is recommended, but not required. If not present, all block
|
||||
devices will be probed, which may significantly increase boot time.
|
||||
_<keydev>_ identifies the device on which the key file resides. It may
|
||||
be the kernel name of the device (should start with "/dev/"), a UUID
|
||||
(prefixed with "UUID=") or a label (prefix with "LABEL="). You don't
|
||||
have to specify a full UUID. Just its beginning will suffice, even if
|
||||
its ambiguous. All matching devices will be probed. This parameter is
|
||||
recommended, but not required. If it's not present, all block devices will
|
||||
be probed, which may significantly increase boot time.
|
||||
+
|
||||
If _luksdev_ is given, the specified key will only be applied for that LUKS
|
||||
device. Possible values are the same as for _keydev_. Unless you have several
|
||||
LUKS devices, you don't have to specify this parameter. The simplest usage is:
|
||||
If _<luksdev>_ is given, the specified key will only be used for
|
||||
the specified LUKS device. Possible values are the same as for
|
||||
_<keydev>_. Unless you have several LUKS devices, you don't have to
|
||||
specify this parameter. The simplest usage is:
|
||||
+
|
||||
[listing]
|
||||
.Example
|
||||
@@ -342,28 +373,84 @@ rd.luks.key=/foo/bar.key
|
||||
--
|
||||
+
|
||||
As you see, you can skip colons in such a case.
|
||||
+
|
||||
|
||||
[NOTE]
|
||||
===============================
|
||||
dracut pipes key to cryptsetup with _-d -_ argument, therefore you need to pipe
|
||||
to crypsetup luksFormat with _-d -_, too!
|
||||
Your LUKS partition must match your key file.
|
||||
|
||||
Here follows example for key encrypted with GPG:
|
||||
dracut provides keys to cryptsetup with _-d_ (an older alias for
|
||||
_--key-file_). This uses the entire binary
|
||||
content of the key file as part of the secret. If
|
||||
you pipe a password into cryptsetup *without* _-d_ or _--key-file_,
|
||||
it will be treated as text user input, and only characters before
|
||||
the first newline will be used. Therefore, when you're creating
|
||||
an encrypted partition for dracut to mount, and you pipe a key into
|
||||
_cryptsetup luksFormat_,you must use _-d -_.
|
||||
|
||||
Here is an example for a key encrypted with GPG (warning:
|
||||
_--batch-mode_ will overwrite the device without asking for
|
||||
confirmation):
|
||||
|
||||
[listing]
|
||||
--
|
||||
gpg --quiet --decrypt rootkey.gpg | \
|
||||
cryptsetup -d - -v --cipher serpent-cbc-essiv:sha256 \
|
||||
--key-size 256 luksFormat /dev/sda3
|
||||
cryptsetup --batch-mode --key-file - \
|
||||
luksFormat /dev/sda47
|
||||
--
|
||||
|
||||
If you use plain keys, just add path to _-d_ option:
|
||||
If you use unencrypted key files, just use the key file pathname
|
||||
instead of the standard input. For a random key with 256 bits of
|
||||
entropy, you might use:
|
||||
|
||||
[listing]
|
||||
--
|
||||
cryptsetup -d rootkey.key -v --cipher serpent-cbc-essiv:sha256 \
|
||||
--key-size 256 luksFormat /dev/sda3
|
||||
head -32c /dev/urandom > rootkey.key
|
||||
cryptsetup --batch-mode --key-file rootkey.key \
|
||||
luksFormat /dev/sda47
|
||||
--
|
||||
|
||||
You can also use regular key files on an encrypted _keydev_.
|
||||
|
||||
Compared to using GPG encrypted keyfiles on an unencrypted
|
||||
device this provides the following advantages:
|
||||
|
||||
- you can unlock your disk(s) using multiple passphrases
|
||||
- better security by not loosing the key stretching mechanism
|
||||
|
||||
To use an encrypted _keydev_ you *must* ensure that it becomes
|
||||
available by using the keyword `keysource`, e.g.
|
||||
`rd.luks.uuid=keysource:aaaa`
|
||||
_aaaa_ being the uuid of the encrypted _keydev_.
|
||||
|
||||
Example:
|
||||
|
||||
Lets assume you have three disks _A_, _B_ and _C_ with the uuids
|
||||
_aaaa_, _bbbb_ and _cccc_. +
|
||||
You want to unlock _A_ and _B_ using keyfile _keyfile_. +
|
||||
The unlocked volumes be _A'_, _B'_ and _C'_ with the uuids
|
||||
_AAAA_, _BBBB_ and _CCCC_. +
|
||||
_keyfile_ is saved on _C'_ as _/keyfile_.
|
||||
|
||||
One luks keyslot of each _A_, _B_ and _C_ is setup with a
|
||||
passphrase. +
|
||||
Another luks keyslot of each _A_ and _B_ is setup with _keyfile_.
|
||||
|
||||
To boot this configuration you could use:
|
||||
[listing]
|
||||
--
|
||||
rd.luks.uuid=aaaa
|
||||
rd.luks.uuid=bbbb
|
||||
rd.luks.uuid=keysource:cccc
|
||||
rd.luks.key=/keyfile:UUID=CCCC
|
||||
--
|
||||
Dracut asks for the passphrase for _C_ and uses the
|
||||
keyfile to unlock _A_ and _B_. +
|
||||
If getting the passphrase for _C_ fails it falls back to
|
||||
asking for the passphrases for _A_ and _B_.
|
||||
|
||||
If you want _C'_ to stay unlocked, specify a luks name for
|
||||
it, e.g. `rd.luks.name=cccc=mykeys`, otherwise it gets closed
|
||||
when not needed anymore.
|
||||
===============================
|
||||
|
||||
MD RAID
|
||||
@@ -402,6 +489,9 @@ MULTIPATH
|
||||
**rd.multipath=0**::
|
||||
disable multipath detection
|
||||
|
||||
**rd.multipath=default**::
|
||||
use default multipath settings
|
||||
|
||||
FIPS
|
||||
~~~~
|
||||
**rd.fips**::
|
||||
@@ -485,11 +575,17 @@ USB Android phone::
|
||||
* enp0s29u1u2
|
||||
=====================
|
||||
|
||||
**ip=**__{dhcp|on|any|dhcp6|auto6|either6}__::
|
||||
**ip=**__{dhcp|on|any|dhcp6|auto6|either6|single-dhcp}__::
|
||||
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.
|
||||
|
||||
single-dhcp::: Send DHCP on all available interfaces in parallel, as
|
||||
opposed to one after another. After the first DHCP response is received,
|
||||
stop DHCP on all other interfaces. This gives the fastest boot time by
|
||||
using the IP on interface for which DHCP succeeded first during early boot.
|
||||
Caveat: Does not apply to Network Manager and to SUSE using wicked.
|
||||
|
||||
auto6::: IPv6 autoconfiguration
|
||||
|
||||
dhcp6::: IPv6 DHCP
|
||||
@@ -528,7 +624,7 @@ same <interface>.
|
||||
number, encoding the network prefix length.
|
||||
|
||||
**ifname=**__<interface>__:__<MAC>__::
|
||||
Assign network device name <interface> (ie "bootnet") to the NIC with
|
||||
Assign network device name <interface> (i.e. "bootnet") to the NIC with
|
||||
MAC <MAC>.
|
||||
+
|
||||
WARNING: Do **not** use the default kernel naming scheme for the interface name,
|
||||
@@ -571,7 +667,7 @@ interface name. Better name it "bootnet" or "bluesocket".
|
||||
boolean, bring up network even without netroot set
|
||||
|
||||
**vlan=**__<vlanname>__:__<phydevice>__::
|
||||
Setup vlan device named <vlanname> on <phydeivce>.
|
||||
Setup vlan device named <vlanname> on <phydevice>.
|
||||
We support the four styles of vlan names: VLAN_PLUS_VID (vlan0005),
|
||||
VLAN_PLUS_VID_NO_PAD (vlan5), DEV_PLUS_VID (eth0.0005),
|
||||
DEV_PLUS_VID_NO_PAD (eth0.5)
|
||||
@@ -586,9 +682,13 @@ interface name. Better name it "bootnet" or "bluesocket".
|
||||
Bond without parameters assumes
|
||||
bond=bond0:eth0,eth1:mode=balance-rr
|
||||
|
||||
**team=**__<teammaster>__:__<teamslaves>__::
|
||||
**team=**__<teammaster>__:__<teamslaves>__[:__<teamrunner>__]::
|
||||
Setup team device <teammaster> on top of <teamslaves>.
|
||||
<teamslaves> is a comma-separated list of physical (ethernet) interfaces.
|
||||
<teamrunner> is the runner type to be used (see *teamd.conf*(5)); defaults to
|
||||
activebackup.
|
||||
Team without parameters assumes
|
||||
team=team0:eth0,eth1:activebackup
|
||||
|
||||
**bridge=**__<bridgename>__:__<ethnames>__::
|
||||
Setup bridge <bridgename> with <ethnames>. <ethnames> is a comma-separated
|
||||
@@ -645,7 +745,7 @@ NFS
|
||||
Wait <seconds> until IPv6 automatic addresses are assigned. Default is 40 seconds.
|
||||
|
||||
**rd.net.timeout.carrier=**__<seconds>__::
|
||||
Wait <seconds> until carrier is recognized. Default is 5 seconds.
|
||||
Wait <seconds> until carrier is recognized. Default is 10 seconds.
|
||||
|
||||
CIFS
|
||||
~~~
|
||||
@@ -757,6 +857,9 @@ iscsistart -b --param node.session.timeo.replacement_timeout=30
|
||||
**rd.iscsi.ibft** **rd.iscsi.ibft=1**:
|
||||
Turn on iBFT autoconfiguration for the interfaces
|
||||
|
||||
**rd.iscsi.mp** **rd.iscsi.mp=1**:
|
||||
Configure all iBFT interfaces, not only used for booting (multipath)
|
||||
|
||||
**rd.iscsi.waitnet=0**:
|
||||
Turn off waiting for all interfaces to be up before trying to login to the iSCSI targets.
|
||||
|
||||
@@ -765,6 +868,9 @@ iscsistart -b --param node.session.timeo.replacement_timeout=30
|
||||
|
||||
FCoE
|
||||
~~~~
|
||||
**rd.fcoe=0**::
|
||||
disable FCoE and lldpad
|
||||
|
||||
**fcoe=**__<edd|interface|MAC>__:__{dcb|nodcb}__:__{fabric|vn2vn}__::
|
||||
Try to connect to a FCoE SAN through the NIC specified by _<interface>_ or
|
||||
_<MAC>_ or EDD settings. The second argument specifies if DCB
|
||||
@@ -774,6 +880,23 @@ FCoE
|
||||
+
|
||||
NOTE: letters in the MAC-address must be lowercase!
|
||||
|
||||
NVMf
|
||||
~~~~
|
||||
**rd.nvmf.hostnqn=**__<hostNQN>__::
|
||||
NVMe host NQN to use
|
||||
|
||||
**rd.nvmf.hostid=**__<hostID>__::
|
||||
NVMe host id to use
|
||||
|
||||
**rd.nvmf.discover=**__{rdma|fc|tcp}__,__<traddr>__,[__<host_traddr>__],[__<trsvcid>__]::
|
||||
Discover and connect to a NVMe-over-Fabric controller specified by
|
||||
_<traddr>_ and the optionally _<host_traddr>_ or _<trsvcid>_.
|
||||
The first argument specifies the transport to use; currently only
|
||||
'rdma', 'fc', or 'tcp' are supported.
|
||||
The _<traddr>_ parameter can be set to 'auto' to select
|
||||
autodiscovery; in that case all other parameters are ignored.
|
||||
This parameter can be specified multiple times.
|
||||
|
||||
NBD
|
||||
~~~
|
||||
**root=**??? **netroot=**nbd:__<server>__:__<port/exportname>__[:__<fstype>__[:__<mountopts>__[:__<nbdopts>__]]]::
|
||||
@@ -825,6 +948,11 @@ ZNET
|
||||
RHEL/Fedora with ccw_init, which is called from udev for certain
|
||||
devices on z-series.
|
||||
rd.znet can be specified multiple times on the kernel command line.
|
||||
|
||||
**rd.znet_ifname=**__<ifname>__:__<subchannels>__::
|
||||
Assign network device name <interface> (i.e. "bootnet") to the NIC
|
||||
corresponds to the subchannels. This is useful when dracut's default
|
||||
"ifname=" doesn't work due to device having a changing MAC address.
|
||||
+
|
||||
[listing]
|
||||
.Example
|
||||
@@ -981,7 +1109,7 @@ used to persist the changes made to the device specified by the
|
||||
**root=live:__<url>__** option.
|
||||
+
|
||||
The default _pathspec_, when _auto_ or no _:<pathspec>_ is given, is
|
||||
`/<+++<b>rd.live.dir</b>+++>/overlay-<label>-<uuid>`, where _<label>_ is the
|
||||
`/<rd.live.dir>/overlay-<label>-<uuid>`, where _<label>_ is the
|
||||
device LABEL, and _<uuid>_ is the device UUID.
|
||||
* _none_ (the word itself) specifies that no overlay will be used, such as when
|
||||
an uncompressed, writable live root filesystem is available.
|
||||
|
@@ -3,6 +3,7 @@ DRACUT.CONF(5)
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
:man version: {version}
|
||||
|
||||
NAME
|
||||
----
|
||||
@@ -79,12 +80,13 @@ Configuration files must have the extension .conf; other extensions are ignored.
|
||||
Specify additional files to include in the initramfs, separated by spaces,
|
||||
if they exist.
|
||||
|
||||
*compress=*"__{bzip2|lzma|xz|gzip|lzo|lz4|zstd|<compressor [args ...]>}__"::
|
||||
*compress=*"__{cat|bzip2|lzma|xz|gzip|lzo|lz4|zstd|<compressor [args ...]>}__"::
|
||||
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 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.
|
||||
To disable compression, use "cat".
|
||||
|
||||
*do_strip=*"__{yes|no}__"::
|
||||
Strip binaries in the initramfs (default=yes)
|
||||
@@ -157,7 +159,7 @@ provide a valid _/etc/fstab_.
|
||||
archive. This cpio archive gets glued (concatenated, uncompressed one
|
||||
must be the first one) to the compressed cpio archive. The first,
|
||||
uncompressed cpio archive is for data which the kernel must be able
|
||||
to access very early (and cannot make use of uncompress alogrithms yet)
|
||||
to access very early (and cannot make use of uncompress algorithms yet)
|
||||
like microcode or ACPI tables (default=no).
|
||||
|
||||
*acpi_table_dir=*"__<dir>__"::
|
||||
@@ -187,7 +189,7 @@ provide a valid _/etc/fstab_.
|
||||
|
||||
*i18n_default_font=*"__<fontname>__"::
|
||||
The font <fontname> to install, if not specified otherwise.
|
||||
Default is "LatArCyrHeb-16".
|
||||
Default is "eurlatgr".
|
||||
|
||||
*i18n_install_all=*"__{yes|no}__"::
|
||||
Install everything regardless of generic or hostonly mode.
|
||||
@@ -204,6 +206,13 @@ provide a valid _/etc/fstab_.
|
||||
_/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
|
||||
or _/usr/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
|
||||
|
||||
*uefi_splash_image=*"_<FILE>_"::
|
||||
Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**) image format.
|
||||
|
||||
*uefi_secureboot_cert=*"_<FILE>_", *uefi_secureboot_key=*"_<FILE>_"::
|
||||
Specifies a certificate and corresponding key, which are used to sign the created UEFI executable.
|
||||
Requires both certificate and key need to be specified and _sbsign_ to be installed.
|
||||
|
||||
*kernel_image=*"_<FILE>_"::
|
||||
Specifies the kernel image, which to include in the UEFI executable. The default is
|
||||
_/lib/modules/<KERNEL-VERSION>/vmlinuz_ or _/boot/vmlinuz-<KERNEL-VERSION>_
|
||||
|
@@ -10,9 +10,35 @@ stdloglvl=3
|
||||
sysloglvl=5
|
||||
install_optional_items+=" vi /etc/virc ps grep cat rm "
|
||||
prefix="/"
|
||||
environment=/usr/lib/environment.d
|
||||
environmentconfdir=/etc/environment.d
|
||||
dbus=/usr/share/dbus-1
|
||||
dbusinterfaces=/usr/share/dbus-1/interfaces
|
||||
dbusservices=/usr/share/dbus-1/services
|
||||
dbussession=/usr/share/dbus-1/session.d
|
||||
dbussystem=/usr/share/dbus-1/system.d
|
||||
dbussystemservices=/usr/share/dbus-1/system-services
|
||||
dbusconfdir=/etc/dbus-1
|
||||
dbusinterfacesconfdir=/etc/dbus-1/interfaces
|
||||
dbusservicesconfdir=/etc/dbus-1/services
|
||||
dbussessionconfdir=/etc/dbus-1/session.d
|
||||
dbussystem=confdir/etc/dbus-1/system.d
|
||||
dbussystemservicesconfdir=/etc/dbus-1/system-services
|
||||
sysctld=/usr/lib/sysctl.d
|
||||
sysctldconfdir=/etc/sysctl.d
|
||||
systemdutildir=/usr/lib/systemd
|
||||
systemdutilconfdir=/etc/systemd
|
||||
systemdcatalog=/usr/lib/systemd/catalog
|
||||
systemdntpunits=/usr/lib/systemd/ntp-units.d
|
||||
systemdntpunitsconfdir=/etc/systemd/ntp-units.d
|
||||
systemdportable=/usr/lib/systemd/portable
|
||||
systemdportableconfdir=/etc/systemd/portable
|
||||
systemdsystemunitdir=/usr/lib/systemd/system
|
||||
systemdsystemconfdir=/etc/systemd/system
|
||||
systemduser=/usr/lib/systemd/user
|
||||
systemduserconfdir=/etc/systemd/user
|
||||
sysusers=/usr/lib/sysusers.d
|
||||
sysusersconfdir=/etc/sysusers.d
|
||||
udevdir=/usr/lib/udev
|
||||
hostonly="yes"
|
||||
hostonly_cmdline="no"
|
||||
|
@@ -12,4 +12,4 @@ ro_mnt=yes
|
||||
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"
|
||||
i18n_default_font="LatArCyrHeb-16"
|
||||
|
||||
omit_drivers+=" i2o_scsi"
|
||||
omit_drivers+=" i2o_scsi "
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# SUSE specifc dracut settings
|
||||
# SUSE specific dracut settings
|
||||
#
|
||||
# SUSE by default always builds a as small as possible initrd for performance
|
||||
# SUSE by default always builds as small as possible initrd for performance
|
||||
# and resource reasons.
|
||||
# If you like to build a generic initrd which works on other platforms than
|
||||
# on the one dracut/mkinitrd got called comment out below setting(s).
|
||||
@@ -10,7 +10,7 @@ hostonly_cmdline="yes"
|
||||
compress="xz -0 --check=crc32 --memlimit-compress=50%"
|
||||
|
||||
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"
|
||||
omit_drivers+=" i2o_scsi"
|
||||
omit_drivers+=" i2o_scsi "
|
||||
|
||||
# Below adds additional tools to the initrd which are not urgently necessary to
|
||||
# bring up the system, but help to debug problems.
|
||||
|
@@ -1,6 +0,0 @@
|
||||
/var/log/dracut.log {
|
||||
missingok
|
||||
notifempty
|
||||
size 30k
|
||||
create 0600 root root
|
||||
}
|
@@ -3,6 +3,7 @@ DRACUT.MODULES(7)
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
:man version: {version}
|
||||
|
||||
NAME
|
||||
----
|
||||
@@ -92,18 +93,23 @@ udev state.
|
||||
|
||||
==== Initqueue settled
|
||||
|
||||
This hooks (initqueue/settled) gets executed every time udev has settled.
|
||||
This hook (initqueue/settled) gets executed every time udev has settled.
|
||||
|
||||
==== Initqueue timeout
|
||||
|
||||
This hooks (initqueue/timeout) gets executed, when the main loop counter becomes
|
||||
This hook (initqueue/timeout) gets executed, when the main loop counter becomes
|
||||
half of the rd.retry counter.
|
||||
|
||||
==== Initqueue online
|
||||
|
||||
This hook (initqueue/online) gets executed whenever a network interface comes online
|
||||
(that is, once it is up and configured by the configured network module).
|
||||
|
||||
==== Initqueue finished
|
||||
|
||||
This hook (initqueue/finished) is called after udev has settled and
|
||||
if all scripts herein return 0 the main loop will be ended.
|
||||
Abritary scripts can be added here, to loop in the
|
||||
Arbitrary scripts can be added here, to loop in the
|
||||
initqueue until something happens, which a dracut module wants to wait for.
|
||||
|
||||
=== Hook: pre-mount
|
||||
@@ -145,8 +151,8 @@ FIXME
|
||||
|
||||
== Writing a Module
|
||||
|
||||
A simple example module is _96insmodpost_, which modprobes a kernel module after
|
||||
udev has settled and the basic device drivers have been loaded.
|
||||
A simple example module is _90kernel-modules_, which modprobes a kernel module
|
||||
after udev has settled and the basic device drivers have been loaded.
|
||||
|
||||
All module installation information is in the file module-setup.sh.
|
||||
|
||||
@@ -158,7 +164,7 @@ check():
|
||||
return 0
|
||||
----
|
||||
|
||||
The we create the install() function, which installs a cmdline hook with
|
||||
Then we create the install() function, which installs a cmdline hook with
|
||||
priority number 20 called _parse-insmodpost.sh_. It also installs the
|
||||
_insmodpost.sh_ script in _/sbin_.
|
||||
|
||||
@@ -266,7 +272,7 @@ installs an executable/script <src> in the dracut hook <hookdir> with priority
|
||||
|
||||
==== inst_rules <udevrule> [ <udevrule> ...]
|
||||
|
||||
installs one ore more udev rules. Non-existant udev rules are reported, but do
|
||||
installs one or more udev rules. Non-existant udev rules are reported, but do
|
||||
not let dracut fail.
|
||||
|
||||
==== instmods <kernelmodule> [ <kernelmodule> ... ]
|
||||
|
72
dracut.spec
72
dracut.spec
@@ -31,8 +31,8 @@ Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar
|
||||
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
|
||||
|
||||
BuildRequires: bash
|
||||
BuildRequires: git
|
||||
BuildRequires: kmod-devel >= 23
|
||||
BuildRequires: git-core
|
||||
BuildRequires: pkgconfig(libkmod) >= 23
|
||||
BuildRequires: gcc
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
@@ -77,6 +77,7 @@ Requires: xz
|
||||
Requires: gzip
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
Recommends: memstrack
|
||||
Recommends: hardlink
|
||||
Recommends: pigz
|
||||
Recommends: kpartx
|
||||
@@ -98,7 +99,7 @@ Requires: libkcapi-hmaccalc
|
||||
|
||||
%description
|
||||
dracut contains tools to create bootable initramfses for the Linux
|
||||
kernel. Unlike previous implementations, dracut hard-codes as little
|
||||
kernel. Unlike other implementations, dracut hard-codes 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
|
||||
@@ -117,7 +118,8 @@ Requires: %{name} = %{version}-%{release}
|
||||
%endif
|
||||
Requires: iputils
|
||||
Requires: iproute
|
||||
Requires: dhclient
|
||||
Requires: (NetworkManager >= 1.20 or dhclient)
|
||||
Suggests: NetworkManager
|
||||
Obsoletes: dracut-generic < 008
|
||||
Provides: dracut-generic = %{version}-%{release}
|
||||
|
||||
@@ -181,7 +183,7 @@ This package contains tools to assemble the local initrd and host configuration.
|
||||
%package squash
|
||||
Summary: dracut module to build an initramfs with most files in a squashfs image
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: squash-tools
|
||||
Requires: squashfs-tools
|
||||
|
||||
%description squash
|
||||
This package provides a dracut module to build an initramfs, but store most files
|
||||
@@ -201,11 +203,10 @@ cp %{SOURCE1} .
|
||||
%endif
|
||||
${NULL}
|
||||
|
||||
make %{?_smp_mflags}
|
||||
%make_build
|
||||
|
||||
%install
|
||||
make %{?_smp_mflags} install \
|
||||
DESTDIR=$RPM_BUILD_ROOT \
|
||||
%make_install %{?_smp_mflags} \
|
||||
libdir=%{_prefix}/lib
|
||||
|
||||
echo "DRACUT_VERSION=%{version}-%{release}" > $RPM_BUILD_ROOT/%{dracutlibdir}/dracut-version.sh
|
||||
@@ -214,14 +215,12 @@ echo "DRACUT_VERSION=%{version}-%{release}" > $RPM_BUILD_ROOT/%{dracutlibdir}/dr
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/01fips
|
||||
%endif
|
||||
|
||||
%if %{defined _unitdir}
|
||||
# for systemd, better use systemd-bootchart
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00bootchart
|
||||
%endif
|
||||
|
||||
# we do not support dash in the initramfs
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00dash
|
||||
|
||||
# we do not support mksh in the initramfs
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00mksh
|
||||
|
||||
# remove gentoo specific modules
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/50gensplash
|
||||
|
||||
@@ -257,29 +256,26 @@ mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/initramfs
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf
|
||||
rm -f $RPM_BUILD_ROOT%{_mandir}/man?/*suse*
|
||||
%endif
|
||||
%if 0%{?suse_version}
|
||||
install -m 0644 dracut.conf.d/suse.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf
|
||||
%else
|
||||
rm -f $RPM_BUILD_ROOT%{_mandir}/man?/*suse*
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} == 0 && 0%{?rhel} == 0 && 0%{?suse_version} <= 9999
|
||||
rm -f -- $RPM_BUILD_ROOT%{_bindir}/mkinitrd
|
||||
rm -f -- $RPM_BUILD_ROOT%{_bindir}/lsinitrd
|
||||
rm -f -- $RPM_BUILD_ROOT%{_mandir}/man8/mkinitrd.8*
|
||||
rm -f -- $RPM_BUILD_ROOT%{_mandir}/man1/lsinitrd.1*
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
echo 'hostonly="no"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-generic-image.conf
|
||||
echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-rescue.conf
|
||||
|
||||
# FIXME: remove after F30
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/kernel/postinst.d
|
||||
install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
|
||||
%endif
|
||||
|
||||
%files
|
||||
%if %{with doc}
|
||||
%doc README HACKING TODO AUTHORS NEWS dracut.html dracut.png dracut.svg
|
||||
%doc README.md HACKING.md AUTHORS NEWS.md dracut.html dracut.png dracut.svg
|
||||
%endif
|
||||
%{!?_licensedir:%global license %%doc}
|
||||
%license COPYING lgpl-2.1.txt
|
||||
@@ -316,6 +312,9 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
|
||||
%{_mandir}/man8/mkinitrd.8*
|
||||
%{_mandir}/man1/lsinitrd.1*
|
||||
%endif
|
||||
%if 0%{?suse_version}
|
||||
%{_mandir}/man8/mkinitrd-suse.8*
|
||||
%endif
|
||||
%{_mandir}/man7/dracut.kernel.7*
|
||||
%{_mandir}/man7/dracut.cmdline.7*
|
||||
%{_mandir}/man7/dracut.modules.7*
|
||||
@@ -324,7 +323,6 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
|
||||
%endif
|
||||
|
||||
%if %{undefined _unitdir}
|
||||
%{dracutlibdir}/modules.d/00bootchart
|
||||
%endif
|
||||
%{dracutlibdir}/modules.d/00bash
|
||||
%{dracutlibdir}/modules.d/00systemd
|
||||
@@ -334,11 +332,22 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
|
||||
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
|
||||
%{dracutlibdir}/modules.d/01fips
|
||||
%endif
|
||||
%{dracutlibdir}/modules.d/01systemd-ask-password
|
||||
%{dracutlibdir}/modules.d/01systemd-coredump
|
||||
%{dracutlibdir}/modules.d/01systemd-initrd
|
||||
%{dracutlibdir}/modules.d/01systemd-modules-load
|
||||
%{dracutlibdir}/modules.d/01systemd-repart
|
||||
%{dracutlibdir}/modules.d/01systemd-sysctl
|
||||
%{dracutlibdir}/modules.d/01systemd-sysusers
|
||||
%{dracutlibdir}/modules.d/03modsign
|
||||
%{dracutlibdir}/modules.d/03rescue
|
||||
%{dracutlibdir}/modules.d/04watchdog
|
||||
%{dracutlibdir}/modules.d/04watchdog-modules
|
||||
%{dracutlibdir}/modules.d/05busybox
|
||||
%{dracutlibdir}/modules.d/06dbus-broker
|
||||
%{dracutlibdir}/modules.d/06dbus-daemon
|
||||
%{dracutlibdir}/modules.d/06rngd
|
||||
%{dracutlibdir}/modules.d/09dbus
|
||||
%{dracutlibdir}/modules.d/10i18n
|
||||
%{dracutlibdir}/modules.d/30convertfs
|
||||
%{dracutlibdir}/modules.d/45url-lib
|
||||
@@ -354,13 +363,15 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
|
||||
%{dracutlibdir}/modules.d/90lvm
|
||||
%{dracutlibdir}/modules.d/90mdraid
|
||||
%{dracutlibdir}/modules.d/90multipath
|
||||
%{dracutlibdir}/modules.d/90stratis
|
||||
%{dracutlibdir}/modules.d/90nvdimm
|
||||
%{dracutlibdir}/modules.d/90ppcmac
|
||||
%{dracutlibdir}/modules.d/90qemu
|
||||
%{dracutlibdir}/modules.d/91crypt-gpg
|
||||
%{dracutlibdir}/modules.d/91crypt-loop
|
||||
%{dracutlibdir}/modules.d/95debug
|
||||
%{dracutlibdir}/modules.d/95fstab-sys
|
||||
%{dracutlibdir}/modules.d/95lunmask
|
||||
%{dracutlibdir}/modules.d/95nvmf
|
||||
%{dracutlibdir}/modules.d/95resume
|
||||
%{dracutlibdir}/modules.d/95rootfs-block
|
||||
%{dracutlibdir}/modules.d/95terminfo
|
||||
@@ -391,6 +402,7 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
|
||||
%{dracutlibdir}/modules.d/98syslog
|
||||
%{dracutlibdir}/modules.d/98usrmount
|
||||
%{dracutlibdir}/modules.d/99base
|
||||
%{dracutlibdir}/modules.d/99memstrack
|
||||
%{dracutlibdir}/modules.d/99fs-lib
|
||||
%{dracutlibdir}/modules.d/99shutdown
|
||||
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
|
||||
@@ -412,16 +424,14 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
|
||||
%{_unitdir}/initrd.target.wants/dracut-pre-pivot.service
|
||||
%{_unitdir}/initrd.target.wants/dracut-pre-trigger.service
|
||||
%{_unitdir}/initrd.target.wants/dracut-pre-udev.service
|
||||
|
||||
%endif
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
%{_prefix}/lib/kernel/install.d/50-dracut.install
|
||||
%endif
|
||||
|
||||
%files network
|
||||
%{dracutlibdir}/modules.d/02systemd-networkd
|
||||
%{dracutlibdir}/modules.d/35network-manager
|
||||
%{dracutlibdir}/modules.d/35network-legacy
|
||||
%{dracutlibdir}/modules.d/35network-wicked
|
||||
%{dracutlibdir}/modules.d/40network
|
||||
%{dracutlibdir}/modules.d/45ifcfg
|
||||
%{dracutlibdir}/modules.d/90kernel-network-modules
|
||||
@@ -452,23 +462,19 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
|
||||
%doc %{_mandir}/man8/dracut-catimages.8*
|
||||
%endif
|
||||
|
||||
%files squash
|
||||
%{dracutlibdir}/modules.d/99squash
|
||||
|
||||
%{_bindir}/dracut-catimages
|
||||
%dir /boot/dracut
|
||||
%dir /var/lib/dracut
|
||||
%dir /var/lib/dracut/overlay
|
||||
|
||||
%files squash
|
||||
%{dracutlibdir}/modules.d/99squash
|
||||
|
||||
%files config-generic
|
||||
%{dracutlibdir}/dracut.conf.d/02-generic-image.conf
|
||||
|
||||
%files config-rescue
|
||||
%{dracutlibdir}/dracut.conf.d/02-rescue.conf
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install
|
||||
# FIXME: remove after F30
|
||||
%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
@@ -62,7 +62,7 @@ _/etc/dracut.conf_ or _/etc/dracut.conf.d/myconf.conf_. See *dracut.conf*(5).
|
||||
You can also add dracut modules on the command line
|
||||
by using the -a or --add option:
|
||||
----
|
||||
# dracut --add bootchart initramfs-bootchart.img
|
||||
# dracut --add module initramfs-module.img
|
||||
----
|
||||
|
||||
To see a list of available dracut modules, use the --list-modules option:
|
||||
@@ -83,7 +83,7 @@ on the command line:
|
||||
=== Adding Kernel Modules
|
||||
If you need a special kernel module in the initramfs, which is not
|
||||
automatically picked up by dracut, you have the use the --add-drivers option
|
||||
on the command line or the drivers vaiable in the _/etc/dracut.conf_
|
||||
on the command line or the drivers variable in the _/etc/dracut.conf_
|
||||
or _/etc/dracut.conf.d/myconf.conf_ configuration file (see *dracut.conf*(5)):
|
||||
----
|
||||
# dracut --add-drivers mymod initramfs-with-mymod.img
|
||||
@@ -94,7 +94,7 @@ An initramfs generated without the "hostonly" mode, 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
|
||||
image. So, you could completely change your root partition (move it inside a md
|
||||
raid with encryption and LVM on top), as long as you specify the correct
|
||||
filesystem LABEL or UUID on the kernel command line for your root device, dracut
|
||||
will find it and boot from it.
|
||||
@@ -151,9 +151,9 @@ If your root partition is on the network see <<NetworkBoot>>.
|
||||
If you have to input passwords for encrypted disk volumes, you might want to set
|
||||
the keyboard layout and specify a display font.
|
||||
|
||||
A typical german kernel command would contain:
|
||||
A typical german kernel command line would contain:
|
||||
----
|
||||
rd.vconsole.font=latarcyrheb-sun16 rd.vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8
|
||||
rd.vconsole.font=eurlatgr rd.vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8
|
||||
----
|
||||
|
||||
Setting these options can override the setting stored on your system, if you use
|
||||
@@ -185,7 +185,7 @@ This turns off every automatic assembly of LVM, MD raids, DM raids and
|
||||
crypto LUKS.
|
||||
|
||||
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.
|
||||
process, but then you would lose the possibility to turn it on on demand.
|
||||
|
||||
|
||||
[[Injecting]]
|
||||
@@ -262,7 +262,7 @@ For example for a NFS image, you would do:
|
||||
|
||||
|
||||
----
|
||||
# dracut -m "nfs network base" initramfs-nfs-only.img
|
||||
# dracut -m "nfs network base" initramfs-nfs-only.img
|
||||
----
|
||||
|
||||
Then you would boot from this image with your target machine and reduce the size
|
||||
@@ -349,7 +349,7 @@ serial --unit=0 --speed=9600
|
||||
terminal --timeout=5 serial console
|
||||
----
|
||||
+
|
||||
. Also in _/boot/grub2/grub.cfg_, add the following boot arguemnts to the ''kernel''
|
||||
. Also in _/boot/grub2/grub.cfg_, add the following boot arguments to the ''kernel''
|
||||
line:
|
||||
+
|
||||
----
|
||||
|
116
examples/yocto/classes/dracut.bbclass
Normal file
116
examples/yocto/classes/dracut.bbclass
Normal file
@@ -0,0 +1,116 @@
|
||||
DRACUT_PN ??= "${PN}"
|
||||
|
||||
def dracut_compression_type(d):
|
||||
rdtype = d.getVar("INITRAMFS_FSTYPES", True).split('.')
|
||||
if len(rdtype) != 2:
|
||||
return ['','','']
|
||||
if rdtype[0] != 'cpio':
|
||||
return ['','','']
|
||||
cmptypes = [['gz','--gzip','gzip'],['bz2', '--bzip2','bzip2'],['lzma','--lzma','xz'],['xz','--xz','xz'],['lzo','--lzo','lzo'],['lz4','--lz4','lz4'],['zstd','--zstd','zstd']]
|
||||
for cmp in cmptypes:
|
||||
if rdtype[1] == cmp[0]:
|
||||
return cmp
|
||||
return ['','','']
|
||||
|
||||
def dracut_compression_opt(d):
|
||||
cmp = dracut_compression_type(d)
|
||||
return cmp[1]
|
||||
|
||||
def dracut_compression_pkg(d):
|
||||
cmp = dracut_compression_type(d)
|
||||
return cmp[2]
|
||||
|
||||
def dracut_compression_pkg_native(d):
|
||||
cmp = dracut_compression_type(d)
|
||||
if cmp[2] == '':
|
||||
return ''
|
||||
return cmp[2] + '-native'
|
||||
|
||||
DRACUT_COMPRESS_OPT ??= "${@dracut_compression_opt(d)}"
|
||||
DRACUT_COMPRESS_PKG ??= "${@dracut_compression_pkg(d)}"
|
||||
DRACUT_COMPRESS_PKG_NATIVE ??= "${@dracut_compression_pkg_native(d)}"
|
||||
|
||||
DRACUT_OPTS ??= "--early-microcode ${DRACUT_COMPRESS_OPT}"
|
||||
|
||||
python __anonymous () {
|
||||
pkg = d.getVar("DRACUT_PN", True)
|
||||
if pkg != 'dracut':
|
||||
d.appendVar("RDEPENDS_%s" % pkg, " dracut %s " % d.getVar("DRACUT_COMPRESS_PKG", True))
|
||||
if not pkg.startswith('kernel'):
|
||||
d.appendVarFlag("do_configure", "depends", "virtual/kernel:do_shared_workdir")
|
||||
d.appendVarFlag("do_compile", "depends", "virtual/kernel:do_compile_kernelmodules")
|
||||
}
|
||||
|
||||
export BUILD_TIME_KERNEL_VERSION = "${@oe.utils.read_file('${STAGING_KERNEL_BUILDDIR}/kernel-abiversion')}"
|
||||
|
||||
dracut_postinst () {
|
||||
MY_KERNEL_VERSION=$(readlink $D/boot/bzimage | sed 's,^.*bzImage-,,')
|
||||
if [[ -z "$MY_KERNEL_VERSION" ]]; then
|
||||
MY_KERNEL_VERSION="${KERNEL_VERSION}"
|
||||
fi
|
||||
if [[ -z "$MY_KERNEL_VERSION" ]]; then
|
||||
MY_KERNEL_VERSION="${BUILD_TIME_KERNEL_VERSION}"
|
||||
fi
|
||||
if [[ -z "$MY_KERNEL_VERSION" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -n "$D" ]; then
|
||||
#DEBUGOPTS="--debug --keep"
|
||||
DEBUGOPTS="--keep"
|
||||
|
||||
$INTERCEPT_DIR/postinst_intercept execute_dracut ${PKG} mlprefix=${MLPREFIX} \
|
||||
prefix= \
|
||||
MY_KERNEL_VERSION=$MY_KERNEL_VERSION \
|
||||
DEBUGOPTS="\"$DEBUGOPTS\"" \
|
||||
DRACUT_OPTS="\"${DRACUT_OPTS}\"" \
|
||||
systemdutildir=${systemd_unitdir} \
|
||||
systemdsystemunitdir=${systemd_system_unitdir} \
|
||||
systemdsystemconfdir=${sysconfdir}/systemd/system \
|
||||
udevdir=${libdir}/udev \
|
||||
DRACUT_TMPDIR=${WORKDIR}/dracut-tmpdir \
|
||||
DRACUT_ARCH="${TUNE_ARCH}" \
|
||||
DRACUT_COMPRESS_GZIP=$NATIVE_ROOT${bindir}/gzip \
|
||||
DRACUT_COMPRESS_BZIP2=$NATIVE_ROOT${bindir}/bzip2 \
|
||||
DRACUT_COMPRESS_LZMA=$NATIVE_ROOT${bindir}/lzma \
|
||||
DRACUT_LDD="\"PATH='$PATH' ${STAGING_BINDIR_CROSS}/ldd --root $D\"" \
|
||||
DRACUT_LDCONFIG=$NATIVE_ROOT${bindir}/ldconfig \
|
||||
DRACUT_INSTALL="\"$NATIVE_ROOT${libdir}/dracut/dracut-install\"" \
|
||||
PLYMOUTH_LDD="\"${STAGING_BINDIR_CROSS}/ldd --root $D\"" \
|
||||
PLYMOUTH_LDD_PATH="'$PATH'" \
|
||||
PLYMOUTH_PLUGIN_PATH=${libdir}/plymouth \
|
||||
PLYMOUTH_THEME_NAME=${PLYMOUTH_THEME_NAME:-spinner} \
|
||||
PLYMOUTH_THEME=${PLYMOUTH_THEME_NAME:-spinner}
|
||||
else
|
||||
depmod -a $MY_KERNEL_VERSION
|
||||
echo RUNNING: dracut -f ${DRACUT_OPTS} /boot/initramfs.img $MY_KERNEL_VERSION
|
||||
echo "dracut: $(dracut --help | grep 'Version:')"
|
||||
dracut -f ${DRACUT_OPTS} /boot/initramfs.img $MY_KERNEL_VERSION
|
||||
fi
|
||||
}
|
||||
|
||||
dracut_populate_packages[vardeps] += "dracut_postinst"
|
||||
|
||||
python dracut_populate_packages() {
|
||||
localdata = d.createCopy()
|
||||
|
||||
pkg = d.getVar('DRACUT_PN', True)
|
||||
|
||||
postinst = d.getVar('pkg_postinst_%s' % pkg, True)
|
||||
if not postinst:
|
||||
postinst = '#!/bin/sh\n'
|
||||
postinst += localdata.getVar('dracut_postinst', True)
|
||||
d.setVar('pkg_postinst_%s' % pkg, postinst)
|
||||
}
|
||||
|
||||
PACKAGESPLITFUNCS_prepend = "dracut_populate_packages "
|
||||
|
||||
DRACUT_DEPENDS = " \
|
||||
binutils-cross-${TUNE_ARCH} gcc-cross-${TUNE_ARCH} \
|
||||
ldconfig-native coreutils-native findutils-native \
|
||||
cpio-native util-linux-native kmod-native ${DRACUT_COMPRESS_PKG_NATIVE} \
|
||||
dracut-native pkgconfig-native cross-compiler-ldd \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
|
||||
"
|
||||
DEPENDS_append_class-target = " ${DRACUT_DEPENDS}"
|
||||
PACKAGE_WRITE_DEPS_append = " ${DRACUT_DEPENDS}"
|
44
examples/yocto/postinst-intercepts/execute_dracut
Executable file
44
examples/yocto/postinst-intercepts/execute_dracut
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [[ -z "$DRACUT_TMPDIR" ]]; then
|
||||
echo "DRACUT_TMPDIR is unset, exiting"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# We have to unset "prefix" as dracut uses it to move files around.
|
||||
# Yocto has it set as part of the build environment.
|
||||
export prefix=
|
||||
|
||||
# DRACUT settings
|
||||
export UDEVVERSION=241
|
||||
export SYSTEMD_VERSION=241
|
||||
export DRACUT_TESTBIN=/bin/bash.bash
|
||||
export DRACUT_INSTALL_PATH="/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
|
||||
# PLYMOUTH settings
|
||||
export PLYMOUTH_SYSROOT=$D
|
||||
|
||||
export \
|
||||
systemdutildir systemdsystemunitdir systemdsystemconfdir udevdir \
|
||||
DRACUT_ARCH DRACUT_TESTBIN DRACUT_LDD DRACUT_LDCONFIG DRACUT_INSTALL \
|
||||
DRACUT_COMPRESS_GZIP DRACUT_COMPRESS_BZIP2 DRACUT_COMPRESS_LZMA \
|
||||
PLYMOUTH_LDD PLYMOUTH_LDD_PATH PLYMOUTH_PLUGIN_PATH \
|
||||
PLYMOUTH_THEME_NAME PLYMOUTH_THEME
|
||||
|
||||
# List environment for debugging
|
||||
echo ROOTFS-POSTINST-ENVIRONMENT
|
||||
echo -----------
|
||||
env
|
||||
echo -----------
|
||||
|
||||
[[ -d $DRACUT_TMPDIR ]] || mkdir -p $DRACUT_TMPDIR
|
||||
|
||||
# Execute depmod and dracut
|
||||
echo "$(date) - RUNNING: depmod -b $D -a $MY_KERNEL_VERSION"
|
||||
depmod -b $D -a $MY_KERNEL_VERSION
|
||||
echo "dracut: $(dracut --sysroot $D --help | grep 'Version:')"
|
||||
echo "$(date) - RUNNING: dracut -f --sysroot $D --tmpdir $DRACUT_TMPDIR $DRACUT_OPTS $DEBUGOPTS -k $D/lib/modules/$MY_KERNEL_VERSION $D/boot/initramfs.img $MY_KERNEL_VERSION"
|
||||
dracut -f --sysroot $D --tmpdir $DRACUT_TMPDIR $DRACUT_OPTS $DEBUGOPTS -k $D/lib/modules/$MY_KERNEL_VERSION $D/boot/initramfs.img $MY_KERNEL_VERSION
|
||||
echo "$(date) - DONE: dracut"
|
@@ -0,0 +1,19 @@
|
||||
diff --git a/cross-compile-ldd b/cross-compile-ldd
|
||||
index ef2ca20..332d57f 100644
|
||||
--- a/cross-compile-ldd
|
||||
+++ b/cross-compile-ldd
|
||||
@@ -337,13 +337,13 @@ do_scan_etc_ldsoconf() {
|
||||
# Build up the full list of search directories
|
||||
declare -a needed_search_path
|
||||
do_trace "Adding basic lib dirs\n"
|
||||
-ld_library_path="${ld_library_path}:"
|
||||
while [ -n "${ld_library_path}" ]; do
|
||||
d="${ld_library_path%%:*}"
|
||||
if [ -n "${d}" ]; then
|
||||
do_trace "-> adding search dir '%s'\n" "${d}"
|
||||
needed_search_path+=( "${d}" )
|
||||
fi
|
||||
+ [[ "$ld_library_path" == "${ld_library_path#*:}" ]] && break
|
||||
ld_library_path="${ld_library_path#*:}"
|
||||
done
|
||||
do_trace "Done adding basic lib dirs\n"
|
33
examples/yocto/recipes/cross-compiler-ldd_git.bb
Normal file
33
examples/yocto/recipes/cross-compiler-ldd_git.bb
Normal file
@@ -0,0 +1,33 @@
|
||||
SUMMARY = "Cross-compiler LDD"
|
||||
HOMEPAGE = "https://gist.github.com/c403786c1394f53f44a3b61214489e6f"
|
||||
BUGTRACKER = ""
|
||||
LICENSE = "GPLv2"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://cross-compile-ldd;beginline=53;endline=57;md5=2b29d19d18a430b931dda3750e865c84"
|
||||
|
||||
SRCBRANCH = "master"
|
||||
SRCREV = "eb44581caf7dd60b149a6691abef46264c46e866"
|
||||
SRC_URI = " \
|
||||
git://gist.github.com/c403786c1394f53f44a3b61214489e6f.git;protocol=https;branch=${SRCBRANCH} \
|
||||
file://cross-compile-ldd-fix-infinite-loop.patch \
|
||||
"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
inherit siteinfo
|
||||
|
||||
SYSROOT_PREPROCESS_FUNCS += " cross_ldd_populate_sysroot "
|
||||
|
||||
cross_ldd_populate_sysroot() {
|
||||
mkdir -p ${SYSROOT_DESTDIR}${bindir_crossscripts}
|
||||
cat ${S}/cross-compile-ldd | \
|
||||
sed \
|
||||
-e "s,^prefix=.*$,prefix=${TARGET_SYS}," \
|
||||
-e "s,^bits=.*$,bits=${SITEINFO_BITS}," \
|
||||
-e "s,^ld_library_path=.*$,ld_library_path=${LD_LIBRARY_PATH:-/lib:/usr/lib}," \
|
||||
>${SYSROOT_DESTDIR}${bindir_crossscripts}/ldd
|
||||
chmod +x ${SYSROOT_DESTDIR}${bindir_crossscripts}/ldd
|
||||
}
|
||||
|
||||
DEPENDS = "coreutils-native sed-native binutils-cross-${TARGET_ARCH} gcc-cross-${TARGET_ARCH}"
|
||||
PACKAGE_WRITE_DEPS = "coreutils-native sed-native binutils-cross-${TARGET_ARCH} gcc-cross-${TARGET_ARCH}"
|
45
fedora-test-github.sh
Executable file
45
fedora-test-github.sh
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
[[ -d ${0%/*} ]] && cd "${0%/*}"
|
||||
|
||||
RUN_ID="$1"
|
||||
TESTS=$2
|
||||
|
||||
./configure
|
||||
|
||||
NCPU=$(getconf _NPROCESSORS_ONLN)
|
||||
|
||||
if ! [[ $TESTS ]]; then
|
||||
# GitHub workflows fetch a clone of the dracut repository which doesn't
|
||||
# contain git tags, thus "breaking" the RPM build in certain situations
|
||||
# i.e.:
|
||||
# DRACUT_MAIN_VERSION in Makefile is defined as an output of `git describe`,
|
||||
# which in full git clone returns a tag with a numeric version. However,
|
||||
# without tags it returns SHA of the last commit, which later propagates into
|
||||
# `Provides:` attribute of the built RPM and can break dependency tree when
|
||||
# installed
|
||||
[[ -d .git ]] && git fetch --tags && git describe --tags
|
||||
make -j "$NCPU" all syncheck rpm logtee
|
||||
else
|
||||
if [[ $TESTS == "99" ]]; then
|
||||
[[ -d .git ]] && git fetch --tags && git describe --tags
|
||||
make_docs=yes
|
||||
else
|
||||
make_docs=no
|
||||
fi
|
||||
|
||||
make -j "$NCPU" enable_documentation=$make_docs all logtee
|
||||
|
||||
cd test
|
||||
|
||||
time LOGTEE_TIMEOUT_MS=590000 make \
|
||||
enable_documentation=$make_docs \
|
||||
KVERSION="$(rpm -qa kernel --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -rn | head -1)" \
|
||||
DRACUT_NO_XATTR=1 \
|
||||
TEST_RUN_ID="$RUN_ID" \
|
||||
${TESTS:+TESTS="$TESTS"} \
|
||||
-k V=1 \
|
||||
check
|
||||
fi
|
@@ -7,40 +7,6 @@ set -ex
|
||||
RUN_ID="$1"
|
||||
TESTS=$2
|
||||
|
||||
dnf -y update --best --allowerasing &>/dev/null
|
||||
|
||||
dnf -y install --best --allowerasing \
|
||||
dash \
|
||||
asciidoc \
|
||||
mdadm \
|
||||
lvm2 \
|
||||
dmraid \
|
||||
cryptsetup \
|
||||
nfs-utils \
|
||||
nbd \
|
||||
dhcp-server \
|
||||
scsi-target-utils \
|
||||
iscsi-initiator-utils \
|
||||
strace \
|
||||
btrfs-progs \
|
||||
kmod-devel \
|
||||
gcc \
|
||||
bzip2 \
|
||||
xz \
|
||||
tar \
|
||||
wget \
|
||||
rpm-build \
|
||||
make \
|
||||
git \
|
||||
bash-completion \
|
||||
sudo \
|
||||
kernel \
|
||||
dhcp-client \
|
||||
/usr/bin/qemu-kvm \
|
||||
/usr/bin/qemu-system-$(uname -i) \
|
||||
e2fsprogs \
|
||||
$NULL &>/dev/null
|
||||
|
||||
./configure
|
||||
|
||||
NCPU=$(getconf _NPROCESSORS_ONLN)
|
||||
@@ -48,12 +14,15 @@ NCPU=$(getconf _NPROCESSORS_ONLN)
|
||||
if ! [[ $TESTS ]]; then
|
||||
make -j$NCPU all syncheck rpm logtee
|
||||
else
|
||||
make -j$NCPU all logtee
|
||||
[[ $TESTS == "99" ]] && make_docs=yes || make_docs=no
|
||||
make -j$NCPU enable_documentation=$make_docs all logtee
|
||||
|
||||
cd test
|
||||
|
||||
time sudo make \
|
||||
time sudo LOGTEE_TIMEOUT_MS=300000 make \
|
||||
enable_documentation=$make_docs \
|
||||
KVERSION=$(rpm -qa kernel --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -rn | head -1) \
|
||||
DRACUT_NO_XATTR=1 \
|
||||
TEST_RUN_ID=$RUN_ID \
|
||||
${TESTS:+TESTS="$TESTS"} \
|
||||
-k V=2 \
|
||||
|
@@ -10,7 +10,7 @@ sub create_patches {
|
||||
|
||||
mkdir $pdir, 0755;
|
||||
|
||||
open( GIT, 'git log -p --pretty=email --stat -m --first-parent --reverse '.$tag.'..HEAD |');
|
||||
open( GIT, 'git log -p --pretty=email --stat -m --first-parent --reverse --binary '.$tag.'..HEAD |');
|
||||
|
||||
while (<GIT>) {
|
||||
if (/^From [a-z0-9]{40} .*$/) {
|
||||
@@ -37,7 +37,7 @@ $tag=`git describe --abbrev=0 --tags` if not defined $tag;
|
||||
chomp($tag);
|
||||
my @patches=&create_patches($tag, $pdir);
|
||||
my $num=$#patches + 2;
|
||||
$tag=~s/[^0-9]+?([0-9]+)/$1/;
|
||||
$tag=~s/[^0-9]+?([0-9]+)/$1/ if $tag !~ /\b[0-9a-f]{5,40}\b/;
|
||||
my $release="$num.git$datestr";
|
||||
$release="1" if $num == 1;
|
||||
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
#include <glob.h>
|
||||
#include <libgen.h>
|
||||
#include <limits.h>
|
||||
#include <stdbool.h>
|
||||
@@ -59,11 +60,15 @@ static bool arg_modalias = false;
|
||||
static bool arg_resolvelazy = false;
|
||||
static bool arg_resolvedeps = false;
|
||||
static bool arg_hostonly = false;
|
||||
static bool no_xattr = false;
|
||||
static char *destrootdir = NULL;
|
||||
static char *sysrootdir = NULL;
|
||||
static size_t sysrootdirlen = 0;
|
||||
static char *kerneldir = NULL;
|
||||
static size_t kerneldirlen = 0;
|
||||
static char **firmwaredirs = NULL;
|
||||
static char **pathdirs;
|
||||
static char *ldd = NULL;
|
||||
static char *logdir = NULL;
|
||||
static char *logfile = NULL;
|
||||
FILE *logfile_f = NULL;
|
||||
@@ -84,6 +89,11 @@ static bool arg_mod_filter_noname = false;
|
||||
static int dracut_install(const char *src, const char *dst, bool isdir, bool resolvedeps, bool hashdst);
|
||||
|
||||
|
||||
static inline void kmod_module_unrefp(struct kmod_module **p) {
|
||||
if (*p)
|
||||
kmod_module_unref(*p);
|
||||
}
|
||||
#define _cleanup_kmod_module_unref_ _cleanup_(kmod_module_unrefp)
|
||||
|
||||
static inline void kmod_module_unref_listp(struct kmod_list **p) {
|
||||
if (*p)
|
||||
@@ -114,6 +124,7 @@ static inline void fts_closep(FTS **p) {
|
||||
}
|
||||
#define _cleanup_fts_close_ _cleanup_(fts_closep)
|
||||
|
||||
#define _cleanup_globfree_ _cleanup_(globfree)
|
||||
|
||||
|
||||
static size_t dir_len(char const *file)
|
||||
@@ -302,7 +313,7 @@ static int cp(const char *src, const char *dst)
|
||||
normal_copy:
|
||||
pid = fork();
|
||||
if (pid == 0) {
|
||||
if (geteuid() == 0)
|
||||
if (geteuid() == 0 && no_xattr == false)
|
||||
execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode,xattr,timestamps", "-fL", src, dst,
|
||||
NULL);
|
||||
else
|
||||
@@ -314,7 +325,7 @@ static int cp(const char *src, const char *dst)
|
||||
while (waitpid(pid, &ret, 0) < 0) {
|
||||
if (errno != EINTR) {
|
||||
ret = -1;
|
||||
if (geteuid() == 0)
|
||||
if (geteuid() == 0 && no_xattr == false)
|
||||
log_error("Failed: cp --reflink=auto --sparse=auto --preserve=mode,xattr,timestamps -fL %s %s", src,
|
||||
dst);
|
||||
else
|
||||
@@ -393,6 +404,75 @@ static int library_install(const char *src, const char *lib)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char *get_real_file(const char *src, bool fullyresolve)
|
||||
{
|
||||
char linktarget[PATH_MAX + 1];
|
||||
ssize_t linksz;
|
||||
_cleanup_free_ char *fullsrcpath;
|
||||
char *abspath = NULL;
|
||||
struct stat sb;
|
||||
|
||||
if (sysrootdirlen) {
|
||||
if (strncmp(src, sysrootdir, sysrootdirlen) == 0)
|
||||
fullsrcpath = strdup(src);
|
||||
else if (asprintf(&fullsrcpath, "%s/%s", (sysrootdirlen ? sysrootdir : ""), (src[0] == '/' ? src+1 : src)) < 0)
|
||||
_exit(EXIT_FAILURE);
|
||||
} else
|
||||
fullsrcpath = strdup(src);
|
||||
|
||||
log_debug("get_real_file('%s')", fullsrcpath);
|
||||
|
||||
if (lstat(fullsrcpath, &sb) < 0)
|
||||
return NULL;
|
||||
|
||||
switch (sb.st_mode & S_IFMT) {
|
||||
case S_IFDIR:
|
||||
case S_IFREG:
|
||||
return strdup(fullsrcpath);
|
||||
case S_IFLNK:
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
linksz = readlink(fullsrcpath, linktarget, sizeof(linktarget));
|
||||
if (linksz < 0)
|
||||
return NULL;
|
||||
linktarget[linksz] = '\0';
|
||||
|
||||
log_debug("get_real_file: readlink('%s') returns '%s'", fullsrcpath, linktarget);
|
||||
|
||||
if (linktarget[0] == '/') {
|
||||
if (asprintf(&abspath, "%s%s", (sysrootdirlen ? sysrootdir : ""), linktarget) < 0)
|
||||
return NULL;
|
||||
} else {
|
||||
_cleanup_free_ char *fullsrcdir = strdup(fullsrcpath);
|
||||
|
||||
if (!fullsrcdir) {
|
||||
log_error("Out of memory!");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fullsrcdir[dir_len(fullsrcdir)] = '\0';
|
||||
|
||||
if (asprintf(&abspath, "%s/%s", fullsrcdir, linktarget) < 0)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (fullyresolve) {
|
||||
struct stat st;
|
||||
if (lstat(abspath, &st) < 0) {
|
||||
if (errno != ENOENT)
|
||||
return NULL;
|
||||
}
|
||||
if (S_ISLNK(st.st_mode))
|
||||
return get_real_file(abspath, fullyresolve);
|
||||
}
|
||||
|
||||
log_debug("get_real_file('%s') => '%s'", src, abspath);
|
||||
return abspath;
|
||||
}
|
||||
|
||||
static int resolve_deps(const char *src)
|
||||
{
|
||||
int ret = 0;
|
||||
@@ -401,6 +481,12 @@ static int resolve_deps(const char *src)
|
||||
size_t linesize = LINE_MAX;
|
||||
_cleanup_pclose_ FILE *fptr = NULL;
|
||||
_cleanup_free_ char *cmd = NULL;
|
||||
_cleanup_free_ char *fullsrcpath = NULL;
|
||||
|
||||
fullsrcpath = get_real_file(src, true);
|
||||
log_debug("resolve_deps('%s') -> get_real_file('%s', true) = '%s'", src, src, fullsrcpath);
|
||||
if (!fullsrcpath)
|
||||
return 0;
|
||||
|
||||
buf = malloc(LINE_MAX);
|
||||
if (buf == NULL)
|
||||
@@ -408,7 +494,7 @@ static int resolve_deps(const char *src)
|
||||
|
||||
if (strstr(src, ".so") == 0) {
|
||||
_cleanup_close_ int fd = -1;
|
||||
fd = open(src, O_RDONLY | O_CLOEXEC);
|
||||
fd = open(fullsrcpath, O_RDONLY | O_CLOEXEC);
|
||||
if (fd < 0)
|
||||
return -errno;
|
||||
|
||||
@@ -432,12 +518,14 @@ static int resolve_deps(const char *src)
|
||||
}
|
||||
|
||||
/* run ldd */
|
||||
ret = asprintf(&cmd, "ldd %s 2>&1", src);
|
||||
ret = asprintf(&cmd, "%s %s 2>&1", ldd, fullsrcpath);
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
log_debug("%s", cmd);
|
||||
|
||||
ret = 0;
|
||||
|
||||
fptr = popen(cmd, "r");
|
||||
@@ -456,6 +544,13 @@ static int resolve_deps(const char *src)
|
||||
break;
|
||||
}
|
||||
|
||||
/* errors from cross-compiler-ldd */
|
||||
if (strstr(buf, "unable to find sysroot") || strstr(buf, "command not found")) {
|
||||
log_error("%s", buf);
|
||||
ret += 1;
|
||||
break;
|
||||
}
|
||||
|
||||
/* musl ldd */
|
||||
if (strstr(buf, "Not a valid dynamic program"))
|
||||
break;
|
||||
@@ -476,14 +571,13 @@ static int resolve_deps(const char *src)
|
||||
if (strstr(buf, "cannot read header"))
|
||||
break;
|
||||
|
||||
if (strstr(buf, "cannot be preloaded"))
|
||||
break;
|
||||
|
||||
if (strstr(buf, destrootdir))
|
||||
break;
|
||||
|
||||
p = strstr(buf, "=>");
|
||||
if (!p)
|
||||
p = buf;
|
||||
|
||||
p = strchr(p, '/');
|
||||
p = strchr(buf, '/');
|
||||
if (p) {
|
||||
char *q;
|
||||
|
||||
@@ -596,16 +690,80 @@ static bool check_hashmap(Hashmap *hm, const char *item)
|
||||
return false;
|
||||
}
|
||||
|
||||
static int dracut_install(const char *src, const char *dst, bool isdir, bool resolvedeps, bool hashdst)
|
||||
static int dracut_mkdir(const char *src) {
|
||||
_cleanup_free_ char *parent = NULL;
|
||||
char *path;
|
||||
struct stat sb;
|
||||
|
||||
parent = strdup(src);
|
||||
if (!parent)
|
||||
return 1;
|
||||
|
||||
path = parent[0] == '/' ? parent+1 : parent;
|
||||
while (path) {
|
||||
path = strstr(path, "/");
|
||||
if (path)
|
||||
*path = '\0';
|
||||
|
||||
if (stat(parent, &sb) == 0) {
|
||||
if (!S_ISDIR(sb.st_mode)) {
|
||||
log_error("%s exists but is not a directory!", parent);
|
||||
return 1;
|
||||
}
|
||||
} else if (errno != ENOENT) {
|
||||
log_error("ERROR: stat '%s': %s", parent, strerror(errno));
|
||||
return 1;
|
||||
} else {
|
||||
if (mkdir(parent, 0755) < 0) {
|
||||
log_error("ERROR: mkdir '%s': %s", parent, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (path) {
|
||||
*path = '/';
|
||||
path++;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dracut_install(const char *orig_src, const char *orig_dst, bool isdir, bool resolvedeps, bool hashdst)
|
||||
{
|
||||
struct stat sb, db;
|
||||
_cleanup_free_ char *fullsrcpath = NULL;
|
||||
_cleanup_free_ char *fulldstpath = NULL;
|
||||
_cleanup_free_ char *fulldstdir = NULL;
|
||||
int ret;
|
||||
bool src_exists = true;
|
||||
bool src_islink = false;
|
||||
bool src_isdir = false;
|
||||
mode_t src_mode = 0;
|
||||
bool dst_exists = true;
|
||||
char *i = NULL;
|
||||
_cleanup_free_ char *src;
|
||||
_cleanup_free_ char *dst;
|
||||
|
||||
log_debug("dracut_install('%s', '%s')", src, dst);
|
||||
if (sysrootdirlen) {
|
||||
if (strncmp(orig_src, sysrootdir, sysrootdirlen) == 0) {
|
||||
src = strdup(orig_src + sysrootdirlen);
|
||||
fullsrcpath = strdup(orig_src);
|
||||
} else {
|
||||
src = strdup(orig_src);
|
||||
if (asprintf(&fullsrcpath, "%s%s", sysrootdir, src) < 0)
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
if (strncmp(orig_dst, sysrootdir, sysrootdirlen) == 0)
|
||||
dst = strdup(orig_dst + sysrootdirlen);
|
||||
else
|
||||
dst = strdup(orig_dst);
|
||||
} else {
|
||||
src = strdup(orig_src);
|
||||
fullsrcpath = strdup(src);
|
||||
dst = strdup(orig_dst);
|
||||
}
|
||||
|
||||
log_debug("dracut_install('%s', '%s', %d, %d, %d)", src, dst, isdir, resolvedeps, hashdst);
|
||||
|
||||
if (check_hashmap(items_failed, src)) {
|
||||
log_debug("hash hit items_failed for '%s'", src);
|
||||
@@ -617,22 +775,19 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (lstat(src, &sb) < 0) {
|
||||
src_exists = false;
|
||||
if (lstat(fullsrcpath, &sb) < 0) {
|
||||
if (!isdir) {
|
||||
i = strdup(src);
|
||||
hashmap_put(items_failed, i, i);
|
||||
/* src does not exist */
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
src_islink = S_ISLNK(sb.st_mode);
|
||||
src_isdir = S_ISDIR(sb.st_mode);
|
||||
src_mode = sb.st_mode;
|
||||
}
|
||||
|
||||
i = strdup(dst);
|
||||
if (!i)
|
||||
return -ENOMEM;
|
||||
|
||||
hashmap_put(items, i, i);
|
||||
|
||||
ret = asprintf(&fulldstpath, "%s/%s", destrootdir, (dst[0]=='/' ? (dst+1) : dst));
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
@@ -641,120 +796,151 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
|
||||
ret = stat(fulldstpath, &sb);
|
||||
|
||||
if (ret != 0 && (errno != ENOENT)) {
|
||||
log_error("ERROR: stat '%s': %m", fulldstpath);
|
||||
return 1;
|
||||
if (ret != 0) {
|
||||
dst_exists = false;
|
||||
if (errno != ENOENT) {
|
||||
log_error("ERROR: stat '%s': %m", fulldstpath);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
if (resolvedeps && S_ISREG(sb.st_mode) && (sb.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) {
|
||||
log_debug("'%s' already exists, but checking for any deps", fulldstpath);
|
||||
ret = resolve_deps(src);
|
||||
ret = resolve_deps(fullsrcpath + sysrootdirlen);
|
||||
} else
|
||||
log_debug("'%s' already exists", fulldstpath);
|
||||
|
||||
/* dst does already exist */
|
||||
return ret;
|
||||
}
|
||||
} else {
|
||||
|
||||
/* check destination directory */
|
||||
fulldstdir = strdup(fulldstpath);
|
||||
fulldstdir[dir_len(fulldstdir)] = '\0';
|
||||
|
||||
ret = stat(fulldstdir, &db);
|
||||
|
||||
if (ret < 0) {
|
||||
_cleanup_free_ char *dname = NULL;
|
||||
|
||||
if (errno != ENOENT) {
|
||||
log_error("ERROR: stat '%s': %m", fulldstdir);
|
||||
/* check destination directory */
|
||||
fulldstdir = strdup(fulldstpath);
|
||||
if (!fulldstdir) {
|
||||
log_error("Out of memory!");
|
||||
return 1;
|
||||
}
|
||||
/* create destination directory */
|
||||
log_debug("dest dir '%s' does not exist", fulldstdir);
|
||||
dname = strdup(dst);
|
||||
if (!dname)
|
||||
return 1;
|
||||
fulldstdir[dir_len(fulldstdir)] = '\0';
|
||||
|
||||
dname[dir_len(dname)] = '\0';
|
||||
ret = dracut_install(dname, dname, true, false, true);
|
||||
ret = stat(fulldstdir, &db);
|
||||
|
||||
if (ret != 0) {
|
||||
log_error("ERROR: failed to create directory '%s'", fulldstdir);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (ret < 0) {
|
||||
_cleanup_free_ char *dname = NULL;
|
||||
|
||||
if (isdir && !src_exists) {
|
||||
log_info("mkdir '%s'", fulldstpath);
|
||||
ret = mkdir(fulldstpath, 0755);
|
||||
return ret;
|
||||
}
|
||||
if (errno != ENOENT) {
|
||||
log_error("ERROR: stat '%s': %m", fulldstdir);
|
||||
return 1;
|
||||
}
|
||||
/* create destination directory */
|
||||
log_debug("dest dir '%s' does not exist", fulldstdir);
|
||||
dname = strdup(dst);
|
||||
if (!dname)
|
||||
return 1;
|
||||
|
||||
/* ready to install src */
|
||||
dname[dir_len(dname)] = '\0';
|
||||
ret = dracut_install(dname, dname, true, false, true);
|
||||
|
||||
if (S_ISDIR(sb.st_mode)) {
|
||||
log_info("mkdir '%s'", fulldstpath);
|
||||
ret = mkdir(fulldstpath, sb.st_mode | S_IWUSR);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (S_ISLNK(sb.st_mode)) {
|
||||
_cleanup_free_ char *abspath = NULL;
|
||||
|
||||
abspath = realpath(src, NULL);
|
||||
|
||||
if (abspath == NULL)
|
||||
return 1;
|
||||
|
||||
if (dracut_install(abspath, abspath, false, resolvedeps, hashdst)) {
|
||||
log_debug("'%s' install error", abspath);
|
||||
return 1;
|
||||
if (ret != 0) {
|
||||
log_error("ERROR: failed to create directory '%s'", fulldstdir);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (lstat(abspath, &sb) != 0) {
|
||||
log_debug("lstat '%s': %m", abspath);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (lstat(fulldstpath, &sb) != 0) {
|
||||
_cleanup_free_ char *absdestpath = NULL;
|
||||
|
||||
ret = asprintf(&absdestpath, "%s/%s", destrootdir, (abspath[0]=='/' ? (abspath+1) : abspath));
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
if (src_isdir) {
|
||||
if (dst_exists) {
|
||||
if (S_ISDIR(sb.st_mode)) {
|
||||
log_debug("dest dir '%s' already exists", fulldstpath);
|
||||
return 0;
|
||||
}
|
||||
log_error("dest dir '%s' already exists but is not a directory", fulldstpath);
|
||||
return 1;
|
||||
}
|
||||
|
||||
ln_r(absdestpath, fulldstpath);
|
||||
log_info("mkdir '%s'", fulldstpath);
|
||||
ret = dracut_mkdir(fulldstpath);
|
||||
if (ret == 0) {
|
||||
i = strdup(dst);
|
||||
if (!i)
|
||||
return -ENOMEM;
|
||||
|
||||
hashmap_put(items, i, i);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (arg_hmac) {
|
||||
/* copy .hmac files also */
|
||||
hmac_install(src, dst, NULL);
|
||||
/* ready to install src */
|
||||
|
||||
if (src_islink) {
|
||||
_cleanup_free_ char *abspath = NULL;
|
||||
|
||||
abspath = get_real_file(src, false);
|
||||
|
||||
if (abspath == NULL)
|
||||
return 1;
|
||||
|
||||
if (dracut_install(abspath, abspath, false, resolvedeps, hashdst)) {
|
||||
log_debug("'%s' install error", abspath);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (lstat(abspath, &sb) != 0) {
|
||||
log_debug("lstat '%s': %m", abspath);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (lstat(fulldstpath, &sb) != 0) {
|
||||
_cleanup_free_ char *absdestpath = NULL;
|
||||
|
||||
ret = asprintf(&absdestpath, "%s/%s", destrootdir, (abspath[0]=='/' ? (abspath+1) : abspath) + sysrootdirlen);
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
ln_r(absdestpath, fulldstpath);
|
||||
}
|
||||
|
||||
if (arg_hmac) {
|
||||
/* copy .hmac files also */
|
||||
hmac_install(src, dst, NULL);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
if (src_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) {
|
||||
if (resolvedeps)
|
||||
ret += resolve_deps(fullsrcpath + sysrootdirlen);
|
||||
if (arg_hmac) {
|
||||
/* copy .hmac files also */
|
||||
hmac_install(src, dst, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (sb.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) {
|
||||
if (resolvedeps)
|
||||
ret += resolve_deps(src);
|
||||
if (arg_hmac) {
|
||||
/* copy .hmac files also */
|
||||
hmac_install(src, dst, NULL);
|
||||
log_debug("dracut_install ret = %d", ret);
|
||||
|
||||
if (arg_hostonly && !arg_module)
|
||||
mark_hostonly(dst);
|
||||
|
||||
if (isdir) {
|
||||
log_info("mkdir '%s'", fulldstpath);
|
||||
ret += dracut_mkdir(fulldstpath);
|
||||
} else {
|
||||
log_info("cp '%s' '%s'", fullsrcpath, fulldstpath);
|
||||
ret += cp(fullsrcpath, fulldstpath);
|
||||
}
|
||||
}
|
||||
|
||||
log_debug("dracut_install ret = %d", ret);
|
||||
log_info("cp '%s' '%s'", src, fulldstpath);
|
||||
if (ret == 0) {
|
||||
i = strdup(dst);
|
||||
if (!i)
|
||||
return -ENOMEM;
|
||||
|
||||
if (arg_hostonly && !arg_module)
|
||||
mark_hostonly(dst);
|
||||
hashmap_put(items, i, i);
|
||||
|
||||
ret += cp(src, fulldstpath);
|
||||
if (ret == 0 && logfile_f)
|
||||
dracut_log_cp(src);
|
||||
if (logfile_f)
|
||||
dracut_log_cp(src);
|
||||
}
|
||||
|
||||
log_debug("dracut_install ret = %d", ret);
|
||||
|
||||
@@ -770,11 +956,11 @@ static void item_free(char *i)
|
||||
static void usage(int status)
|
||||
{
|
||||
/* */
|
||||
printf("Usage: %s -D DESTROOTDIR [OPTION]... -a SOURCE...\n"
|
||||
"or: %s -D DESTROOTDIR [OPTION]... SOURCE DEST\n"
|
||||
"or: %s -D DESTROOTDIR [OPTION]... -m KERNELMODULE [KERNELMODULE …]\n"
|
||||
printf("Usage: %s -D DESTROOTDIR [-r SYSROOTDIR] [OPTION]... -a SOURCE...\n"
|
||||
"or: %s -D DESTROOTDIR [-r SYSROOTDIR] [OPTION]... SOURCE DEST\n"
|
||||
"or: %s -D DESTROOTDIR [-r SYSROOTDIR] [OPTION]... -m KERNELMODULE [KERNELMODULE …]\n"
|
||||
"\n"
|
||||
"Install SOURCE to DEST in DESTROOTDIR with all needed dependencies.\n"
|
||||
"Install SOURCE (from rootfs or SYSROOTDIR) to DEST in DESTROOTDIR with all needed dependencies.\n"
|
||||
"\n"
|
||||
" KERNELMODULE can have the format:\n"
|
||||
" <absolute path> with a leading /\n"
|
||||
@@ -782,6 +968,7 @@ static void usage(int status)
|
||||
" <module name>\n"
|
||||
"\n"
|
||||
" -D --destrootdir Install all files to DESTROOTDIR as the root\n"
|
||||
" -r --sysrootdir Install all files from SYSROOTDIR\n"
|
||||
" -a --all Install all SOURCE arguments to DESTROOTDIR\n"
|
||||
" -o --optional If SOURCE does not exist, do not fail\n"
|
||||
" -d --dir SOURCE is a directory\n"
|
||||
@@ -841,6 +1028,7 @@ static int parse_argv(int argc, char *argv[])
|
||||
{"module", no_argument, NULL, 'm'},
|
||||
{"fips", no_argument, NULL, 'f'},
|
||||
{"destrootdir", required_argument, NULL, 'D'},
|
||||
{"sysrootdir", required_argument, NULL, 'r'},
|
||||
{"logdir", required_argument, NULL, 'L'},
|
||||
{"mod-filter-path", required_argument, NULL, 'p'},
|
||||
{"mod-filter-nopath", required_argument, NULL, 'P'},
|
||||
@@ -854,7 +1042,7 @@ static int parse_argv(int argc, char *argv[])
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
while ((c = getopt_long(argc, argv, "madfhlL:oD:HRp:P:s:S:N:", options, NULL)) != -1) {
|
||||
while ((c = getopt_long(argc, argv, "madfhlL:oD:Hr:Rp:P:s:S:N:v", options, NULL)) != -1) {
|
||||
switch (c) {
|
||||
case ARG_VERSION:
|
||||
puts(PROGRAM_VERSION_STRING);
|
||||
@@ -893,6 +1081,10 @@ static int parse_argv(int argc, char *argv[])
|
||||
case 'D':
|
||||
destrootdir = strdup(optarg);
|
||||
break;
|
||||
case 'r':
|
||||
sysrootdir = strdup(optarg);
|
||||
sysrootdirlen = strlen(sysrootdir);
|
||||
break;
|
||||
case 'p':
|
||||
if (regcomp(&mod_filter_path, optarg, REG_NOSUB|REG_EXTENDED) != 0) {
|
||||
log_error("Module path filter %s is not a regular expression", optarg);
|
||||
@@ -1021,6 +1213,7 @@ static char **find_binary(const char *src)
|
||||
{
|
||||
char **ret = NULL;
|
||||
char **q;
|
||||
char *fullsrcpath;
|
||||
char *newsrc = NULL;
|
||||
|
||||
STRV_FOREACH(q, pathdirs) {
|
||||
@@ -1033,15 +1226,28 @@ static char **find_binary(const char *src)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (stat(newsrc, &sb) != 0) {
|
||||
log_debug("stat(%s) != 0", newsrc);
|
||||
fullsrcpath = get_real_file(newsrc, false);
|
||||
|
||||
if (!fullsrcpath) {
|
||||
log_debug("get_real_file(%s) not found", newsrc);
|
||||
free(newsrc);
|
||||
newsrc = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (lstat(fullsrcpath, &sb) != 0) {
|
||||
log_debug("stat(%s) != 0", fullsrcpath);
|
||||
free(newsrc);
|
||||
newsrc = NULL;
|
||||
free(fullsrcpath);
|
||||
fullsrcpath = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
strv_push(&ret, newsrc);
|
||||
|
||||
free(fullsrcpath);
|
||||
fullsrcpath = NULL;
|
||||
};
|
||||
|
||||
if (ret) {
|
||||
@@ -1112,8 +1318,30 @@ static int install_all(int argc, char **argv)
|
||||
}
|
||||
|
||||
} else {
|
||||
_cleanup_free_ char *dest = strdup(argv[i]);
|
||||
ret = dracut_install(argv[i], dest, arg_createdir, arg_resolvedeps, true);
|
||||
if (strchr(argv[i], '*') == NULL) {
|
||||
_cleanup_free_ char *dest = strdup(argv[i]);
|
||||
ret = dracut_install(argv[i], dest, arg_createdir, arg_resolvedeps, true);
|
||||
} else {
|
||||
_cleanup_free_ char *realsrc = NULL;
|
||||
_cleanup_globfree_ glob_t globbuf;
|
||||
|
||||
ret = asprintf(&realsrc, "%s%s", sysrootdir ? sysrootdir : "", argv[i]);
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
ret = glob(realsrc, 0, NULL, &globbuf);
|
||||
if (ret == 0) {
|
||||
int j;
|
||||
|
||||
for (j = 0; j < globbuf.gl_pathc; j++) {
|
||||
char *dest = strdup(globbuf.gl_pathv[j] + sysrootdirlen);
|
||||
ret |= dracut_install(globbuf.gl_pathv[j] + sysrootdirlen, dest, arg_createdir, arg_resolvedeps, true);
|
||||
free(dest);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((ret != 0) && (!arg_optional)) {
|
||||
@@ -1124,8 +1352,33 @@ static int install_all(int argc, char **argv)
|
||||
return r;
|
||||
}
|
||||
|
||||
static int install_firmware(struct kmod_module *mod)
|
||||
static int install_firmware_fullpath(const char *fwpath)
|
||||
{
|
||||
const char *fw;
|
||||
_cleanup_free_ char *fwpath_xz = NULL;
|
||||
fw = fwpath;
|
||||
struct stat sb;
|
||||
int ret, r;
|
||||
if (stat(fwpath, &sb) != 0) {
|
||||
r = asprintf(&fwpath_xz, "%s.xz", fwpath);
|
||||
if (r < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (stat(fwpath_xz, &sb) != 0) {
|
||||
log_debug("stat(%s) != 0", fwpath);
|
||||
return 1;
|
||||
}
|
||||
fw = fwpath_xz;
|
||||
}
|
||||
ret = dracut_install(fw, fw, false, false, true);
|
||||
if (ret == 0) {
|
||||
log_debug("dracut_install '%s' OK", fwpath);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int install_firmware(struct kmod_module *mod) {
|
||||
struct kmod_list *l;
|
||||
_cleanup_kmod_module_info_free_list_ struct kmod_list *list = NULL;
|
||||
int ret;
|
||||
@@ -1159,18 +1412,22 @@ static int install_firmware(struct kmod_module *mod)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (stat(fwpath, &sb) != 0) {
|
||||
log_debug("stat(%s) != 0", fwpath);
|
||||
continue;
|
||||
if ((strstr(value, "*") != 0 || strstr(value, "?") != 0 || strstr(value, "[") != 0) && stat(fwpath, &sb) != 0) {
|
||||
int i;
|
||||
_cleanup_globfree_ glob_t globbuf;
|
||||
glob(fwpath, 0, NULL, &globbuf);
|
||||
for (i = 0; i < globbuf.gl_pathc; i++) {
|
||||
install_firmware_fullpath(globbuf.gl_pathv[i]);
|
||||
if (ret != 0) {
|
||||
log_info("Possible missing firmware %s for kernel module %s", value, kmod_module_get_name(mod));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
install_firmware_fullpath(fwpath);
|
||||
if (ret != 0) {
|
||||
log_info("Possible missing firmware %s for kernel module %s", value, kmod_module_get_name(mod));
|
||||
}
|
||||
}
|
||||
|
||||
ret = dracut_install(fwpath, fwpath, false, false, true);
|
||||
if (ret == 0)
|
||||
log_debug("dracut_install '%s' OK", fwpath);
|
||||
}
|
||||
|
||||
if (ret != 0) {
|
||||
log_info("Possible missing firmware %s for kernel module %s", value, kmod_module_get_name(mod));
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -1234,28 +1491,52 @@ static bool check_module_path(const char *path)
|
||||
static int install_dependent_modules(struct kmod_list *modlist)
|
||||
{
|
||||
struct kmod_list *itr;
|
||||
struct kmod_module *mod;
|
||||
const char *path = NULL;
|
||||
const char *name = NULL;
|
||||
int ret = 0;
|
||||
|
||||
kmod_list_foreach(itr, modlist) {
|
||||
_cleanup_kmod_module_unref_ struct kmod_module *mod = NULL;
|
||||
mod = kmod_module_get_module(itr);
|
||||
path = kmod_module_get_path(mod);
|
||||
|
||||
if (path == NULL)
|
||||
continue;
|
||||
|
||||
if (check_hashmap(items_failed, path))
|
||||
return -1;
|
||||
|
||||
if (check_hashmap(items, path)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
name = kmod_module_get_name(mod);
|
||||
if ((path == NULL) || (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0))) {
|
||||
kmod_module_unref(mod);
|
||||
|
||||
if (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ret = dracut_install(path, &path[kerneldirlen], false, false, true);
|
||||
if (ret == 0) {
|
||||
_cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL;
|
||||
_cleanup_kmod_module_unref_list_ struct kmod_list *modpre = NULL;
|
||||
_cleanup_kmod_module_unref_list_ struct kmod_list *modpost = NULL;
|
||||
log_debug("dracut_install '%s' '%s' OK", path, &path[kerneldirlen]);
|
||||
install_firmware(mod);
|
||||
modlist = kmod_module_get_dependencies(mod);
|
||||
ret = install_dependent_modules(modlist);
|
||||
if (ret == 0) {
|
||||
ret = kmod_module_get_softdeps(mod, &modpre, &modpost);
|
||||
if (ret == 0) {
|
||||
int r;
|
||||
ret = install_dependent_modules(modpre);
|
||||
r = install_dependent_modules(modpost);
|
||||
ret = ret ? : r;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
log_error("dracut_install '%s' '%s' ERROR", path, &path[kerneldirlen]);
|
||||
}
|
||||
kmod_module_unref(mod);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -1313,8 +1594,12 @@ static int install_module(struct kmod_module *mod)
|
||||
|
||||
if (ret == 0) {
|
||||
ret = kmod_module_get_softdeps(mod, &modpre, &modpost);
|
||||
if (ret == 0)
|
||||
ret = install_dependent_modules(modpre);
|
||||
if (ret == 0) {
|
||||
int r;
|
||||
ret = install_dependent_modules(modpre);
|
||||
r = install_dependent_modules(modpost);
|
||||
ret = ret ? : r;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -1679,6 +1964,7 @@ int main(int argc, char **argv)
|
||||
int r;
|
||||
char *i;
|
||||
char *path = NULL;
|
||||
char *env_no_xattr = NULL;
|
||||
|
||||
r = parse_argv(argc, argv);
|
||||
if (r <= 0)
|
||||
@@ -1706,7 +1992,13 @@ int main(int argc, char **argv)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
path = getenv("PATH");
|
||||
log_debug("Program arguments:");
|
||||
for (r = 0; r < argc; r++)
|
||||
log_debug("%s", argv[r]);
|
||||
|
||||
path = getenv("DRACUT_INSTALL_PATH");
|
||||
if (path == NULL)
|
||||
path = getenv("PATH");
|
||||
|
||||
if (path == NULL) {
|
||||
log_error("PATH is not set");
|
||||
@@ -1715,6 +2007,15 @@ int main(int argc, char **argv)
|
||||
|
||||
log_debug("PATH=%s", path);
|
||||
|
||||
ldd = getenv("DRACUT_LDD");
|
||||
if (ldd == NULL)
|
||||
ldd = "ldd";
|
||||
log_debug("LDD=%s", ldd);
|
||||
|
||||
env_no_xattr = getenv("DRACUT_NO_XATTR");
|
||||
if (env_no_xattr != NULL)
|
||||
no_xattr = true;
|
||||
|
||||
pathdirs = strv_split(path, ":");
|
||||
|
||||
umask(0022);
|
||||
|
@@ -41,86 +41,10 @@ struct Hashmap {
|
||||
|
||||
struct hashmap_entry *iterate_list_head, *iterate_list_tail;
|
||||
unsigned n_entries;
|
||||
|
||||
bool from_pool;
|
||||
};
|
||||
|
||||
#define BY_HASH(h) ((struct hashmap_entry**) ((uint8_t*) (h) + ALIGN(sizeof(Hashmap))))
|
||||
|
||||
struct pool {
|
||||
struct pool *next;
|
||||
unsigned n_tiles;
|
||||
unsigned n_used;
|
||||
};
|
||||
|
||||
static struct pool *first_hashmap_pool = NULL;
|
||||
static void *first_hashmap_tile = NULL;
|
||||
|
||||
static struct pool *first_entry_pool = NULL;
|
||||
static void *first_entry_tile = NULL;
|
||||
|
||||
static void* allocate_tile(struct pool **first_pool, void **first_tile, size_t tile_size) {
|
||||
unsigned i;
|
||||
|
||||
if (*first_tile) {
|
||||
void *r;
|
||||
|
||||
r = *first_tile;
|
||||
*first_tile = * (void**) (*first_tile);
|
||||
return r;
|
||||
}
|
||||
|
||||
if (_unlikely_(!*first_pool) || _unlikely_((*first_pool)->n_used >= (*first_pool)->n_tiles)) {
|
||||
unsigned n;
|
||||
size_t size;
|
||||
struct pool *p;
|
||||
|
||||
n = *first_pool ? (*first_pool)->n_tiles : 0;
|
||||
n = MAX(512U, n * 2);
|
||||
size = PAGE_ALIGN(ALIGN(sizeof(struct pool)) + n*tile_size);
|
||||
n = (size - ALIGN(sizeof(struct pool))) / tile_size;
|
||||
|
||||
p = malloc(size);
|
||||
if (!p)
|
||||
return NULL;
|
||||
|
||||
p->next = *first_pool;
|
||||
p->n_tiles = n;
|
||||
p->n_used = 0;
|
||||
|
||||
*first_pool = p;
|
||||
}
|
||||
|
||||
i = (*first_pool)->n_used++;
|
||||
|
||||
return ((uint8_t*) (*first_pool)) + ALIGN(sizeof(struct pool)) + i*tile_size;
|
||||
}
|
||||
|
||||
static void deallocate_tile(void **first_tile, void *p) {
|
||||
* (void**) p = *first_tile;
|
||||
*first_tile = p;
|
||||
}
|
||||
|
||||
#ifndef __OPTIMIZE__
|
||||
|
||||
static void drop_pool(struct pool *p) {
|
||||
while (p) {
|
||||
struct pool *n;
|
||||
n = p->next;
|
||||
free(p);
|
||||
p = n;
|
||||
}
|
||||
}
|
||||
|
||||
__attribute__((destructor)) static void cleanup_pool(void) {
|
||||
/* Be nice to valgrind */
|
||||
|
||||
drop_pool(first_hashmap_pool);
|
||||
drop_pool(first_entry_pool);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
unsigned string_hash_func(const void *p) {
|
||||
unsigned hash = 5381;
|
||||
const signed char *c;
|
||||
@@ -146,26 +70,15 @@ int trivial_compare_func(const void *a, const void *b) {
|
||||
}
|
||||
|
||||
Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func) {
|
||||
bool b;
|
||||
Hashmap *h;
|
||||
size_t size;
|
||||
|
||||
b = is_main_thread();
|
||||
|
||||
size = ALIGN(sizeof(Hashmap)) + NBUCKETS * sizeof(struct hashmap_entry*);
|
||||
|
||||
if (b) {
|
||||
h = allocate_tile(&first_hashmap_pool, &first_hashmap_tile, size);
|
||||
if (!h)
|
||||
return NULL;
|
||||
h = malloc0(size);
|
||||
|
||||
memset(h, 0, size);
|
||||
} else {
|
||||
h = malloc0(size);
|
||||
|
||||
if (!h)
|
||||
return NULL;
|
||||
}
|
||||
if (!h)
|
||||
return NULL;
|
||||
|
||||
h->hash_func = hash_func ? hash_func : trivial_hash_func;
|
||||
h->compare_func = compare_func ? compare_func : trivial_compare_func;
|
||||
@@ -173,8 +86,6 @@ Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func) {
|
||||
h->n_entries = 0;
|
||||
h->iterate_list_head = h->iterate_list_tail = NULL;
|
||||
|
||||
h->from_pool = b;
|
||||
|
||||
return h;
|
||||
}
|
||||
|
||||
@@ -245,7 +156,8 @@ static void unlink_entry(Hashmap *h, struct hashmap_entry *e, unsigned hash) {
|
||||
h->n_entries--;
|
||||
}
|
||||
|
||||
static void remove_entry(Hashmap *h, struct hashmap_entry *e) {
|
||||
static void remove_entry(Hashmap *h, struct hashmap_entry **ep) {
|
||||
struct hashmap_entry *e = *ep;
|
||||
unsigned hash;
|
||||
|
||||
assert(h);
|
||||
@@ -255,10 +167,8 @@ static void remove_entry(Hashmap *h, struct hashmap_entry *e) {
|
||||
|
||||
unlink_entry(h, e, hash);
|
||||
|
||||
if (h->from_pool)
|
||||
deallocate_tile(&first_entry_tile, e);
|
||||
else
|
||||
free(e);
|
||||
free(e);
|
||||
*ep = NULL;
|
||||
}
|
||||
|
||||
void hashmap_free(Hashmap*h) {
|
||||
@@ -268,10 +178,7 @@ void hashmap_free(Hashmap*h) {
|
||||
|
||||
hashmap_clear(h);
|
||||
|
||||
if (h->from_pool)
|
||||
deallocate_tile(&first_hashmap_tile, h);
|
||||
else
|
||||
free(h);
|
||||
free(h);
|
||||
}
|
||||
|
||||
void hashmap_free_free(Hashmap *h) {
|
||||
@@ -287,8 +194,10 @@ void hashmap_clear(Hashmap *h) {
|
||||
if (!h)
|
||||
return;
|
||||
|
||||
while (h->iterate_list_head)
|
||||
remove_entry(h, h->iterate_list_head);
|
||||
while (h->iterate_list_head) {
|
||||
struct hashmap_entry *e = h->iterate_list_head;
|
||||
remove_entry(h, &e);
|
||||
}
|
||||
}
|
||||
|
||||
static struct hashmap_entry *hash_scan(Hashmap *h, unsigned hash, const void *key) {
|
||||
@@ -319,10 +228,7 @@ int hashmap_put(Hashmap *h, const void *key, void *value) {
|
||||
return -EEXIST;
|
||||
}
|
||||
|
||||
if (h->from_pool)
|
||||
e = allocate_tile(&first_entry_pool, &first_entry_tile, sizeof(struct hashmap_entry));
|
||||
else
|
||||
e = new(struct hashmap_entry, 1);
|
||||
e = new(struct hashmap_entry, 1);
|
||||
|
||||
if (!e)
|
||||
return -ENOMEM;
|
||||
@@ -381,7 +287,7 @@ void* hashmap_remove(Hashmap *h, const void *key) {
|
||||
return NULL;
|
||||
|
||||
data = e->value;
|
||||
remove_entry(h, e);
|
||||
remove_entry(h, &e);
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -426,7 +332,7 @@ int hashmap_remove_and_replace(Hashmap *h, const void *old_key, const void *new_
|
||||
|
||||
if ((k = hash_scan(h, new_hash, new_key)))
|
||||
if (e != k)
|
||||
remove_entry(h, k);
|
||||
remove_entry(h, &k);
|
||||
|
||||
unlink_entry(h, e, old_hash);
|
||||
|
||||
@@ -453,7 +359,7 @@ void* hashmap_remove_value(Hashmap *h, const void *key, void *value) {
|
||||
if (e->value != value)
|
||||
return NULL;
|
||||
|
||||
remove_entry(h, e);
|
||||
remove_entry(h, &e);
|
||||
|
||||
return value;
|
||||
}
|
||||
@@ -579,6 +485,7 @@ void* hashmap_last(Hashmap *h) {
|
||||
}
|
||||
|
||||
void* hashmap_steal_first(Hashmap *h) {
|
||||
struct hashmap_entry *e;
|
||||
void *data;
|
||||
|
||||
if (!h)
|
||||
@@ -587,13 +494,15 @@ void* hashmap_steal_first(Hashmap *h) {
|
||||
if (!h->iterate_list_head)
|
||||
return NULL;
|
||||
|
||||
data = h->iterate_list_head->value;
|
||||
remove_entry(h, h->iterate_list_head);
|
||||
e = h->iterate_list_head;
|
||||
data = e->value;
|
||||
remove_entry(h, &e);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
void* hashmap_steal_first_key(Hashmap *h) {
|
||||
struct hashmap_entry *e;
|
||||
void *key;
|
||||
|
||||
if (!h)
|
||||
@@ -602,8 +511,9 @@ void* hashmap_steal_first_key(Hashmap *h) {
|
||||
if (!h->iterate_list_head)
|
||||
return NULL;
|
||||
|
||||
key = (void*) h->iterate_list_head->key;
|
||||
remove_entry(h, h->iterate_list_head);
|
||||
e = h->iterate_list_head;
|
||||
key = (void*) e->key;
|
||||
remove_entry(h, &e);
|
||||
|
||||
return key;
|
||||
}
|
||||
@@ -694,22 +604,6 @@ int hashmap_move_one(Hashmap *h, Hashmap *other, const void *key) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Hashmap *hashmap_copy(Hashmap *h) {
|
||||
Hashmap *copy;
|
||||
|
||||
assert(h);
|
||||
|
||||
if (!(copy = hashmap_new(h->hash_func, h->compare_func)))
|
||||
return NULL;
|
||||
|
||||
if (hashmap_merge(copy, h) < 0) {
|
||||
hashmap_free(copy);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
char **hashmap_get_strv(Hashmap *h) {
|
||||
char **sv;
|
||||
Iterator it;
|
||||
|
@@ -46,7 +46,6 @@ int trivial_compare_func(const void *a, const void *b);
|
||||
Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func);
|
||||
void hashmap_free(Hashmap *h);
|
||||
void hashmap_free_free(Hashmap *h);
|
||||
Hashmap *hashmap_copy(Hashmap *h);
|
||||
int hashmap_ensure_allocated(Hashmap **h, hash_func_t hash_func, compare_func_t compare_func);
|
||||
|
||||
int hashmap_put(Hashmap *h, const void *key, void *value);
|
||||
|
@@ -264,14 +264,21 @@ int log_set_max_level_from_string(const char *e) {
|
||||
void log_parse_environment(void) {
|
||||
const char *e;
|
||||
|
||||
if ((e = getenv("DRACUT_LOG_TARGET")))
|
||||
if ((e = getenv("DRACUT_INSTALL_LOG_TARGET"))) {
|
||||
if (log_set_target_from_string(e) < 0)
|
||||
log_warning("Failed to parse log target %s. Ignoring.", e);
|
||||
} else if ((e = getenv("DRACUT_LOG_TARGET"))) {
|
||||
if (log_set_target_from_string(e) < 0)
|
||||
log_warning("Failed to parse log target %s. Ignoring.", e);
|
||||
}
|
||||
|
||||
if ((e = getenv("DRACUT_LOG_LEVEL")))
|
||||
if ((e = getenv("DRACUT_INSTALL_LOG_LEVEL"))) {
|
||||
if (log_set_max_level_from_string(e) < 0)
|
||||
log_warning("Failed to parse log level %s. Ignoring.", e);
|
||||
|
||||
} else if ((e = getenv("DRACUT_LOG_LEVEL"))) {
|
||||
if (log_set_max_level_from_string(e) < 0)
|
||||
log_warning("Failed to parse log level %s. Ignoring.", e);
|
||||
}
|
||||
}
|
||||
|
||||
LogTarget log_get_target(void) {
|
||||
|
25
logtee.c
25
logtee.c
@@ -1,5 +1,6 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
@@ -13,13 +14,26 @@ main(int argc, char *argv[])
|
||||
{
|
||||
int fd;
|
||||
int len, slen;
|
||||
int ret;
|
||||
int timeout;
|
||||
char *timeout_env;
|
||||
struct pollfd fds[] = {{
|
||||
.fd = STDIN_FILENO,
|
||||
.events = POLLIN | POLLERR,
|
||||
}};
|
||||
|
||||
timeout_env = getenv("LOGTEE_TIMEOUT_MS");
|
||||
if (timeout_env)
|
||||
timeout = atoi(timeout_env);
|
||||
else
|
||||
timeout = -1;
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage: %s <file>\n", argv[0]);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0644);
|
||||
fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC | O_NONBLOCK, 0644);
|
||||
if (fd == -1) {
|
||||
perror("open");
|
||||
exit(EXIT_FAILURE);
|
||||
@@ -30,8 +44,13 @@ main(int argc, char *argv[])
|
||||
slen = 0;
|
||||
|
||||
do {
|
||||
ret = poll (fds, sizeof(fds) / sizeof(fds[0]), timeout);
|
||||
if (ret == 0) {
|
||||
fprintf (stderr, "Timed out after %d milliseconds of no output.\n", timeout);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
len = splice(STDIN_FILENO, NULL, fd, NULL,
|
||||
BUFLEN, SPLICE_F_MOVE);
|
||||
BUFLEN, SPLICE_F_MOVE | SPLICE_F_NONBLOCK);
|
||||
|
||||
if (len < 0) {
|
||||
if (errno == EAGAIN)
|
||||
@@ -51,4 +70,4 @@ main(int argc, char *argv[])
|
||||
close(fd);
|
||||
fprintf(stderr, "\n");
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#
|
||||
#!/bin/bash
|
||||
# Copyright 2013 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@@ -16,19 +16,20 @@
|
||||
#
|
||||
|
||||
__contains_word () {
|
||||
local word=$1; shift
|
||||
for w in $*; do [[ $w = $word ]] && return 0; done
|
||||
local word="$1"; shift
|
||||
for w in "$@"; do [[ $w = "$word" ]] && return 0; done
|
||||
return 1
|
||||
}
|
||||
|
||||
_lsinitrd() {
|
||||
local field_vals= cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
local -A OPTS=(
|
||||
[STANDALONE]='-s --size -h --help'
|
||||
|
||||
[ARG]='-f --file -k --kver'
|
||||
)
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
if __contains_word "$prev" ${OPTS[ARG]}; then
|
||||
case $prev in
|
||||
--file|-f)
|
||||
@@ -36,23 +37,30 @@ _lsinitrd() {
|
||||
compopt -o filenames
|
||||
;;
|
||||
--kver|-k)
|
||||
comps=$(cd /lib/modules; echo [0-9]*)
|
||||
comps=$(cd /lib/modules || return 1; echo [0-9]*)
|
||||
;;
|
||||
*)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
# shellcheck disable=SC2207
|
||||
# shellcheck disable=SC2016
|
||||
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ $cur = -* ]]; then
|
||||
# shellcheck disable=SC2207
|
||||
# shellcheck disable=SC2016
|
||||
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
|
||||
return 0
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2034
|
||||
comps=$(compgen -f -- "$cur")
|
||||
compopt -o filenames
|
||||
# shellcheck disable=SC2207
|
||||
# shellcheck disable=SC2016
|
||||
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
|
||||
return 0
|
||||
}
|
||||
|
@@ -3,6 +3,7 @@ LSINITRD(1)
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
:man version: {version}
|
||||
|
||||
NAME
|
||||
----
|
||||
|
66
lsinitrd.sh
66
lsinitrd.sh
@@ -97,7 +97,11 @@ if [[ $1 ]]; then
|
||||
else
|
||||
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||||
|
||||
if [[ -d /boot/loader/entries || -L /boot/loader/entries ]] \
|
||||
if [[ -d /efi/loader/entries || -L /efi/loader/entries ]] \
|
||||
&& [[ $MACHINE_ID ]] \
|
||||
&& [[ -d /efi/${MACHINE_ID} || -L /efi/${MACHINE_ID} ]] ; then
|
||||
image="/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
|
||||
elif [[ -d /boot/loader/entries || -L /boot/loader/entries ]] \
|
||||
&& [[ $MACHINE_ID ]] \
|
||||
&& [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
|
||||
image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
|
||||
@@ -121,6 +125,9 @@ if ! [[ -f "$image" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TMPDIR="$(mktemp -d -t lsinitrd.XXXXXX)"
|
||||
trap "rm -rf '$TMPDIR'" EXIT
|
||||
|
||||
dracutlibdirs() {
|
||||
for d in lib64/dracut lib/dracut usr/lib64/dracut usr/lib/dracut; do
|
||||
echo "$d/$1"
|
||||
@@ -160,6 +167,21 @@ list_files()
|
||||
echo "========================================================================"
|
||||
}
|
||||
|
||||
list_squash_content()
|
||||
{
|
||||
SQUASH_IMG="squash/root.img"
|
||||
SQUASH_TMPFILE="$TMPDIR/initrd.root.sqsh"
|
||||
|
||||
$CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --to-stdout -- \
|
||||
$SQUASH_IMG > "$SQUASH_TMPFILE" 2>/dev/null
|
||||
if [[ -s $SQUASH_TMPFILE ]]; then
|
||||
echo "Squashed content ($SQUASH_IMG):"
|
||||
echo "========================================================================"
|
||||
unsquashfs -ll "$SQUASH_TMPFILE" | tail -n +4
|
||||
echo "========================================================================"
|
||||
fi
|
||||
}
|
||||
|
||||
unpack_files()
|
||||
{
|
||||
if (( ${#filenames[@]} > 0 )); then
|
||||
@@ -173,9 +195,43 @@ unpack_files()
|
||||
fi
|
||||
}
|
||||
|
||||
read -N 2 bin < "$image"
|
||||
if [ "$bin" = "MZ" ]; then
|
||||
command -v objcopy > /dev/null || { echo "Need 'objcopy' to unpack an UEFI executable."; exit 1; }
|
||||
objcopy \
|
||||
--dump-section .linux="$TMPDIR/vmlinuz" \
|
||||
--dump-section .initrd="$TMPDIR/initrd.img" \
|
||||
--dump-section .cmdline="$TMPDIR/cmdline.txt" \
|
||||
--dump-section .osrel="$TMPDIR/osrel.txt" \
|
||||
"$image" /dev/null
|
||||
uefi="$image"
|
||||
image="$TMPDIR/initrd.img"
|
||||
[ -f "$image" ] || exit 1
|
||||
fi
|
||||
|
||||
if (( ${#filenames[@]} <= 0 )) && [[ -z "$unpack" ]] && [[ -z "$unpackearly" ]]; then
|
||||
echo "Image: $image: $(du -h $image | while read a b || [ -n "$a" ]; do echo $a;done)"
|
||||
if [ -n "$uefi" ]; then
|
||||
echo -n "initrd in UEFI: $uefi: "
|
||||
du -h $image | while read a b || [ -n "$a" ]; do echo $a;done
|
||||
if [ -f "$TMPDIR/osrel.txt" ]; then
|
||||
name=$(sed -En '/^PRETTY_NAME/ s/^\w+=["'"'"']?([^"'"'"'$]*)["'"'"']?/\1/p' "$TMPDIR/osrel.txt")
|
||||
id=$(sed -En '/^ID/ s/^\w+=["'"'"']?([^"'"'"'$]*)["'"'"']?/\1/p' "$TMPDIR/osrel.txt")
|
||||
build=$(sed -En '/^BUILD_ID/ s/^\w+=["'"'"']?([^"'"'"'$]*)["'"'"']?/\1/p' "$TMPDIR/osrel.txt")
|
||||
echo "OS Release: $name (${id}-${build})"
|
||||
fi
|
||||
if [ -f "$TMPDIR/vmlinuz" ]; then
|
||||
version=$(strings -n 20 "$TMPDIR/vmlinuz" | sed -En '/[0-9]+\.[0-9]+\.[0-9]+/ { p; q 0 }')
|
||||
echo "Kernel Version: $version"
|
||||
fi
|
||||
if [ -f "$TMPDIR/cmdline.txt" ]; then
|
||||
echo "Command line:"
|
||||
sed -En 's/\s+/\n/g; s/\x00/\n/; p' "$TMPDIR/cmdline.txt"
|
||||
fi
|
||||
else
|
||||
echo -n "Image: $image: "
|
||||
du -h $image | while read a b || [ -n "$a" ]; do echo $a;done
|
||||
fi
|
||||
|
||||
echo "========================================================================"
|
||||
fi
|
||||
|
||||
@@ -184,6 +240,8 @@ case $bin in
|
||||
$'\x71\xc7'*|070701)
|
||||
CAT="cat --"
|
||||
is_early=$(cpio --extract --verbose --quiet --to-stdout -- 'early_cpio' < "$image" 2>/dev/null)
|
||||
# Debian mkinitramfs does not create the file 'early_cpio', so let's check if firmware files exist
|
||||
[[ "$is_early" ]] || is_early=$(cpio --list --verbose --quiet --to-stdout -- 'kernel/*/microcode/*.bin' < "$image" 2>/dev/null)
|
||||
if [[ "$is_early" ]]; then
|
||||
if [[ -n "$unpack" ]]; then
|
||||
# should use --unpackearly for early CPIO
|
||||
@@ -255,9 +313,8 @@ if [[ $SKIP ]]; then
|
||||
fi
|
||||
|
||||
if (( ${#filenames[@]} > 1 )); then
|
||||
TMPFILE="$(mktemp -t --suffix=.cpio lsinitrd.XXXXXX)"
|
||||
TMPFILE="$TMPDIR/initrd.cpio"
|
||||
$CAT "$image" 2>/dev/null > $TMPFILE
|
||||
trap "rm -f '$TMPFILE'" EXIT
|
||||
pre_decompress()
|
||||
{
|
||||
cat $TMPFILE
|
||||
@@ -287,6 +344,7 @@ else
|
||||
echo
|
||||
list_modules
|
||||
list_files
|
||||
list_squash_content
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@@ -36,7 +36,7 @@ read_arg() {
|
||||
else
|
||||
for ((i=3; $i <= $#; i++)); do
|
||||
# Only read next arg if it not an arg itself.
|
||||
if [[ ${@:$i:1} = -* ]];then
|
||||
if [[ ${*:$i:1} = -* ]];then
|
||||
break
|
||||
fi
|
||||
result="$result ${@:$i:1}"
|
||||
@@ -53,20 +53,20 @@ default_kernel_images() {
|
||||
local regex kernel_image kernel_version version_version initrd_image
|
||||
local qf='%{NAME}-%{VERSION}-%{RELEASE}\n'
|
||||
|
||||
case "$(uname -m)" in
|
||||
case "${DRACUT_ARCH:-$(uname -m)}" in
|
||||
s390|s390x)
|
||||
regex='image'
|
||||
;;
|
||||
ppc|ppc64)
|
||||
ppc*)
|
||||
regex='vmlinux'
|
||||
;;
|
||||
i386|x86_64)
|
||||
i?86|x86_64)
|
||||
regex='vmlinuz'
|
||||
;;
|
||||
arm*)
|
||||
regex='[uz]Image'
|
||||
;;
|
||||
aarch64)
|
||||
aarch64|riscv64)
|
||||
regex='Image'
|
||||
;;
|
||||
*) regex='vmlinu.'
|
||||
@@ -153,7 +153,6 @@ while (($# > 0)); do
|
||||
--loopopts*) ;;
|
||||
--looppath*) ;;
|
||||
--dsdt*) ;;
|
||||
--bootchart) ;;
|
||||
-s) ;;
|
||||
--quiet|-q) quiet=1;;
|
||||
-b) read_arg boot_dir "$@" || shift $?
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash --norc
|
||||
#
|
||||
# mkinitrd compability wrapper for SUSE.
|
||||
# mkinitrd compatibility wrapper for SUSE.
|
||||
#
|
||||
# Copyright (c) 2013 SUSE Linux Products GmbH. All rights reserved.
|
||||
#
|
||||
@@ -62,7 +62,7 @@ usage () {
|
||||
$cmd " /etc/sysconfig/kernel."
|
||||
$cmd " -d root_device Root device. Defaults to the device from"
|
||||
$cmd " which / is mounted. Overrides the rootdev"
|
||||
$cmd " enviroment variable if set."
|
||||
$cmd " environment variable if set."
|
||||
$cmd " -j device Journal device"
|
||||
$cmd " -D interface Run dhcp on the specified interface."
|
||||
$cmd " -I interface Configure the specified interface statically."
|
||||
@@ -87,7 +87,7 @@ read_arg() {
|
||||
else
|
||||
for ((i=3; $i <= $#; i++)); do
|
||||
# Only read next arg if it not an arg itself.
|
||||
if [[ ${@:$i:1} = -* ]];then
|
||||
if [[ ${*:$i:1} = -* ]];then
|
||||
break
|
||||
fi
|
||||
result="$result ${@:$i:1}"
|
||||
@@ -145,31 +145,17 @@ is_xen_kernel() {
|
||||
return
|
||||
}
|
||||
|
||||
# kernel_image_gz_from_image() and kernel_version_from_image() are helpers
|
||||
# for arm* kernels which produce zImage files which cannot be read from
|
||||
# get_kernel_version -> get rid of this workaround if possible
|
||||
kernel_image_gz_from_image() {
|
||||
local arch=$(uname -i)
|
||||
local r=${1}.gz
|
||||
|
||||
# uImage kernels can't be extracted directly. Use the vmlinux.gz instead
|
||||
r=${r//uImage/vmlinux}
|
||||
|
||||
# on ARM a zImage can't be extracted directly. Other platforms define it
|
||||
# as a gzipped vmlinux file, but not ARM. So only on ARM, use vmlinux.gz.
|
||||
if [[ $arch =~ arm ]] || [[ $arch =~ aarch ]]; then
|
||||
r=${r//zImage/vmlinux}
|
||||
fi
|
||||
|
||||
echo $r
|
||||
}
|
||||
|
||||
kernel_version_from_image() {
|
||||
local kernel_image="$1" kernel_image_gz=$(kernel_image_gz_from_image "$1")
|
||||
local dir="${1%/*}/"
|
||||
[[ "$dir" != "$1" ]] || dir=""
|
||||
local kernel_image="$1" kernel_image_gz="${dir}vmlinux-${1#*-}.gz"
|
||||
echo kernel_image_gz="'$kernel_image_gz'" >&2
|
||||
|
||||
if get_kernel_version "$kernel_image" 2>/dev/null; then
|
||||
return
|
||||
fi
|
||||
|
||||
# As a last resort, try vmlinux-$version.gz, which might be around
|
||||
get_kernel_version "$kernel_image_gz" 2>/dev/null
|
||||
}
|
||||
|
||||
@@ -178,20 +164,20 @@ default_kernel_images() {
|
||||
local regex kernel_image kernel_version version_version initrd_image
|
||||
local qf='%{NAME}-%{VERSION}-%{RELEASE}\n'
|
||||
|
||||
case "$(uname -m)" in
|
||||
case "${DRACUT_ARCH:-$(uname -m)}" in
|
||||
s390|s390x)
|
||||
regex='image'
|
||||
;;
|
||||
ppc|ppc64)
|
||||
regex='vmlinux'
|
||||
;;
|
||||
i386|x86_64)
|
||||
i?86|x86_64)
|
||||
regex='vmlinuz'
|
||||
;;
|
||||
arm*)
|
||||
regex='[uz]Image'
|
||||
;;
|
||||
aarch64)
|
||||
aarch64|riscv64)
|
||||
regex='Image'
|
||||
;;
|
||||
*) regex='vmlinu.'
|
||||
|
@@ -3,6 +3,7 @@ MKINITRD(8)
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
:man version: {version}
|
||||
|
||||
NAME
|
||||
----
|
||||
|
@@ -1,30 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
[[ "$mount_needs" ]] && return 1
|
||||
require_binaries /sbin/bootchartd || return 1
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_symlink /init /sbin/init
|
||||
inst_dir /lib/bootchart/tmpfs
|
||||
|
||||
inst_multiple bootchartd bash \
|
||||
/lib/bootchart/bootchart-collector /etc/bootchartd.conf \
|
||||
accton \
|
||||
echo \
|
||||
grep \
|
||||
usleep
|
||||
|
||||
inst /usr/bin/pkill /bin/pkill
|
||||
inst /usr/bin/[ /bin/[
|
||||
}
|
||||
|
21
modules.d/00mksh/module-setup.sh
Executable file
21
modules.d/00mksh/module-setup.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
require_binaries /bin/mksh
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
# If another shell is already installed, do not use mksh
|
||||
[[ -x $initdir/bin/sh ]] && return
|
||||
|
||||
# Prefer mksh as /bin/sh if it is available.
|
||||
inst /bin/mksh && ln -sf mksh "${initdir}/bin/sh"
|
||||
}
|
||||
|
@@ -1,11 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
getSystemdVersion() {
|
||||
[ -z "$SYSTEMD_VERSION" ] && SYSTEMD_VERSION=$("$systemdutildir"/systemd --version | { read -r _ b _; echo "$b"; })
|
||||
# Check if the systemd version is a valid number
|
||||
if ! [[ $SYSTEMD_VERSION =~ ^[0-9]+$ ]]; then
|
||||
dfatal "systemd version is not a number ($SYSTEMD_VERSION)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$SYSTEMD_VERSION"
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
[[ $mount_needs ]] && return 1
|
||||
if require_binaries $systemdutildir/systemd; then
|
||||
SYSTEMD_VERSION=$($systemdutildir/systemd --version | { read a b a; echo $b; })
|
||||
(( $SYSTEMD_VERSION >= 198 )) && return 0
|
||||
if require_binaries "$systemdutildir"/systemd; then
|
||||
SYSTEMD_VERSION=$(getSystemdVersion)
|
||||
(( SYSTEMD_VERSION >= 198 )) && return 0
|
||||
return 255
|
||||
fi
|
||||
|
||||
@@ -31,103 +42,113 @@ install() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $(getSystemdVersion) -ge 240 ]]; then
|
||||
inst_multiple -o \
|
||||
$systemdutildir/systemd \
|
||||
$systemdutildir/systemd-coredump \
|
||||
$systemdutildir/systemd-cgroups-agent \
|
||||
$systemdutildir/systemd-shutdown \
|
||||
$systemdutildir/systemd-reply-password \
|
||||
$systemdutildir/systemd-fsck \
|
||||
$systemdutildir/systemd-udevd \
|
||||
$systemdutildir/systemd-journald \
|
||||
$systemdutildir/systemd-sysctl \
|
||||
$systemdutildir/systemd-modules-load \
|
||||
$systemdutildir/systemd-vconsole-setup \
|
||||
$systemdutildir/system-generators/systemd-fstab-generator \
|
||||
$systemdutildir/system-generators/systemd-gpt-auto-generator \
|
||||
"$systemdutildir"/system-generators/systemd-debug-generator \
|
||||
"$systemdsystemunitdir"/debug-shell.service
|
||||
fi
|
||||
|
||||
inst_multiple -o \
|
||||
"$systemdutildir"/systemd \
|
||||
"$systemdutildir"/systemd-coredump \
|
||||
"$systemdutildir"/systemd-cgroups-agent \
|
||||
"$systemdutildir"/systemd-shutdown \
|
||||
"$systemdutildir"/systemd-reply-password \
|
||||
"$systemdutildir"/systemd-fsck \
|
||||
"$systemdutildir"/systemd-udevd \
|
||||
"$systemdutildir"/systemd-journald \
|
||||
"$systemdutildir"/systemd-sysctl \
|
||||
"$systemdutildir"/systemd-modules-load \
|
||||
"$systemdutildir"/systemd-vconsole-setup \
|
||||
"$systemdutildir"/systemd-volatile-root \
|
||||
"$systemdutildir"/system-generators/systemd-fstab-generator \
|
||||
"$systemdutildir"/system-generators/systemd-gpt-auto-generator \
|
||||
\
|
||||
$systemdsystemunitdir/cryptsetup.target \
|
||||
$systemdsystemunitdir/emergency.target \
|
||||
$systemdsystemunitdir/sysinit.target \
|
||||
$systemdsystemunitdir/basic.target \
|
||||
$systemdsystemunitdir/halt.target \
|
||||
$systemdsystemunitdir/kexec.target \
|
||||
$systemdsystemunitdir/local-fs.target \
|
||||
$systemdsystemunitdir/local-fs-pre.target \
|
||||
$systemdsystemunitdir/remote-fs.target \
|
||||
$systemdsystemunitdir/remote-fs-pre.target \
|
||||
$systemdsystemunitdir/multi-user.target \
|
||||
$systemdsystemunitdir/network.target \
|
||||
$systemdsystemunitdir/network-pre.target \
|
||||
$systemdsystemunitdir/network-online.target \
|
||||
$systemdsystemunitdir/nss-lookup.target \
|
||||
$systemdsystemunitdir/nss-user-lookup.target \
|
||||
$systemdsystemunitdir/poweroff.target \
|
||||
$systemdsystemunitdir/reboot.target \
|
||||
$systemdsystemunitdir/rescue.target \
|
||||
$systemdsystemunitdir/rpcbind.target \
|
||||
$systemdsystemunitdir/shutdown.target \
|
||||
$systemdsystemunitdir/final.target \
|
||||
$systemdsystemunitdir/sigpwr.target \
|
||||
$systemdsystemunitdir/sockets.target \
|
||||
$systemdsystemunitdir/swap.target \
|
||||
$systemdsystemunitdir/timers.target \
|
||||
$systemdsystemunitdir/paths.target \
|
||||
$systemdsystemunitdir/umount.target \
|
||||
"$systemdsystemunitdir"/cryptsetup.target \
|
||||
"$systemdsystemunitdir"/cryptsetup-pre.target \
|
||||
"$systemdsystemunitdir"/remote-cryptsetup.target \
|
||||
"$systemdsystemunitdir"/emergency.target \
|
||||
"$systemdsystemunitdir"/sysinit.target \
|
||||
"$systemdsystemunitdir"/basic.target \
|
||||
"$systemdsystemunitdir"/halt.target \
|
||||
"$systemdsystemunitdir"/kexec.target \
|
||||
"$systemdsystemunitdir"/local-fs.target \
|
||||
"$systemdsystemunitdir"/local-fs-pre.target \
|
||||
"$systemdsystemunitdir"/remote-fs.target \
|
||||
"$systemdsystemunitdir"/remote-fs-pre.target \
|
||||
"$systemdsystemunitdir"/multi-user.target \
|
||||
"$systemdsystemunitdir"/network.target \
|
||||
"$systemdsystemunitdir"/network-pre.target \
|
||||
"$systemdsystemunitdir"/network-online.target \
|
||||
"$systemdsystemunitdir"/nss-lookup.target \
|
||||
"$systemdsystemunitdir"/nss-user-lookup.target \
|
||||
"$systemdsystemunitdir"/poweroff.target \
|
||||
"$systemdsystemunitdir"/reboot.target \
|
||||
"$systemdsystemunitdir"/rescue.target \
|
||||
"$systemdsystemunitdir"/rpcbind.target \
|
||||
"$systemdsystemunitdir"/shutdown.target \
|
||||
"$systemdsystemunitdir"/final.target \
|
||||
"$systemdsystemunitdir"/sigpwr.target \
|
||||
"$systemdsystemunitdir"/sockets.target \
|
||||
"$systemdsystemunitdir"/swap.target \
|
||||
"$systemdsystemunitdir"/timers.target \
|
||||
"$systemdsystemunitdir"/paths.target \
|
||||
"$systemdsystemunitdir"/umount.target \
|
||||
\
|
||||
$systemdsystemunitdir/sys-kernel-config.mount \
|
||||
"$systemdsystemunitdir"/sys-kernel-config.mount \
|
||||
\
|
||||
$systemdsystemunitdir/kmod-static-nodes.service \
|
||||
$systemdsystemunitdir/systemd-tmpfiles-setup.service \
|
||||
$systemdsystemunitdir/systemd-tmpfiles-setup-dev.service \
|
||||
$systemdsystemunitdir/systemd-ask-password-console.path \
|
||||
$systemdsystemunitdir/systemd-udevd-control.socket \
|
||||
$systemdsystemunitdir/systemd-udevd-kernel.socket \
|
||||
$systemdsystemunitdir/systemd-ask-password-plymouth.path \
|
||||
$systemdsystemunitdir/systemd-journald.socket \
|
||||
$systemdsystemunitdir/systemd-journald-audit.socket \
|
||||
$systemdsystemunitdir/systemd-ask-password-console.service \
|
||||
$systemdsystemunitdir/systemd-modules-load.service \
|
||||
$systemdsystemunitdir/systemd-halt.service \
|
||||
$systemdsystemunitdir/systemd-poweroff.service \
|
||||
$systemdsystemunitdir/systemd-reboot.service \
|
||||
$systemdsystemunitdir/systemd-kexec.service \
|
||||
$systemdsystemunitdir/systemd-fsck@.service \
|
||||
$systemdsystemunitdir/systemd-udevd.service \
|
||||
$systemdsystemunitdir/systemd-udev-trigger.service \
|
||||
$systemdsystemunitdir/systemd-udev-settle.service \
|
||||
$systemdsystemunitdir/systemd-ask-password-plymouth.service \
|
||||
$systemdsystemunitdir/systemd-journald.service \
|
||||
$systemdsystemunitdir/systemd-vconsole-setup.service \
|
||||
$systemdsystemunitdir/systemd-random-seed-load.service \
|
||||
$systemdsystemunitdir/systemd-random-seed.service \
|
||||
$systemdsystemunitdir/systemd-sysctl.service \
|
||||
"$systemdsystemunitdir"/kmod-static-nodes.service \
|
||||
"$systemdsystemunitdir"/systemd-tmpfiles-setup.service \
|
||||
"$systemdsystemunitdir"/systemd-tmpfiles-setup-dev.service \
|
||||
"$systemdsystemunitdir"/systemd-ask-password-console.path \
|
||||
"$systemdsystemunitdir"/systemd-udevd-control.socket \
|
||||
"$systemdsystemunitdir"/systemd-udevd-kernel.socket \
|
||||
"$systemdsystemunitdir"/systemd-ask-password-plymouth.path \
|
||||
"$systemdsystemunitdir"/systemd-journald.socket \
|
||||
"$systemdsystemunitdir"/systemd-journald-audit.socket \
|
||||
"$systemdsystemunitdir"/systemd-ask-password-console.service \
|
||||
"$systemdsystemunitdir"/systemd-modules-load.service \
|
||||
"$systemdsystemunitdir"/systemd-halt.service \
|
||||
"$systemdsystemunitdir"/systemd-poweroff.service \
|
||||
"$systemdsystemunitdir"/systemd-reboot.service \
|
||||
"$systemdsystemunitdir"/systemd-kexec.service \
|
||||
"$systemdsystemunitdir"/systemd-fsck@.service \
|
||||
"$systemdsystemunitdir"/systemd-udevd.service \
|
||||
"$systemdsystemunitdir"/systemd-udev-trigger.service \
|
||||
"$systemdsystemunitdir"/systemd-udev-settle.service \
|
||||
"$systemdsystemunitdir"/systemd-ask-password-plymouth.service \
|
||||
"$systemdsystemunitdir"/systemd-journald.service \
|
||||
"$systemdsystemunitdir"/systemd-vconsole-setup.service \
|
||||
"$systemdsystemunitdir"/systemd-volatile-root.service \
|
||||
"$systemdsystemunitdir"/systemd-random-seed-load.service \
|
||||
"$systemdsystemunitdir"/systemd-random-seed.service \
|
||||
"$systemdsystemunitdir"/systemd-sysctl.service \
|
||||
\
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-modules-load.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-ask-password-console.path \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-journald.service \
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-udevd-control.socket \
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-udevd-kernel.socket \
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-journald.socket \
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-journald-audit.socket \
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-journald-dev-log.socket \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-udevd.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-udev-trigger.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/kmod-static-nodes.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-tmpfiles-setup.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-tmpfiles-setup-dev.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-sysctl.service \
|
||||
"$systemdsystemunitdir"/sysinit.target.wants/systemd-modules-load.service \
|
||||
"$systemdsystemunitdir"/sysinit.target.wants/systemd-ask-password-console.path \
|
||||
"$systemdsystemunitdir"/sysinit.target.wants/systemd-journald.service \
|
||||
"$systemdsystemunitdir"/sockets.target.wants/systemd-udevd-control.socket \
|
||||
"$systemdsystemunitdir"/sockets.target.wants/systemd-udevd-kernel.socket \
|
||||
"$systemdsystemunitdir"/sockets.target.wants/systemd-journald.socket \
|
||||
"$systemdsystemunitdir"/sockets.target.wants/systemd-journald-audit.socket \
|
||||
"$systemdsystemunitdir"/sockets.target.wants/systemd-journald-dev-log.socket \
|
||||
"$systemdsystemunitdir"/sysinit.target.wants/systemd-udevd.service \
|
||||
"$systemdsystemunitdir"/sysinit.target.wants/systemd-udev-trigger.service \
|
||||
"$systemdsystemunitdir"/sysinit.target.wants/kmod-static-nodes.service \
|
||||
"$systemdsystemunitdir"/sysinit.target.wants/systemd-tmpfiles-setup.service \
|
||||
"$systemdsystemunitdir"/sysinit.target.wants/systemd-tmpfiles-setup-dev.service \
|
||||
"$systemdsystemunitdir"/sysinit.target.wants/systemd-sysctl.service \
|
||||
\
|
||||
$systemdsystemunitdir/ctrl-alt-del.target \
|
||||
$systemdsystemunitdir/reboot.target \
|
||||
$systemdsystemunitdir/systemd-reboot.service \
|
||||
$systemdsystemunitdir/syslog.socket \
|
||||
"$systemdsystemunitdir"/ctrl-alt-del.target \
|
||||
"$systemdsystemunitdir"/reboot.target \
|
||||
"$systemdsystemunitdir"/systemd-reboot.service \
|
||||
"$systemdsystemunitdir"/syslog.socket \
|
||||
\
|
||||
$systemdsystemunitdir/slices.target \
|
||||
$systemdsystemunitdir/system.slice \
|
||||
$systemdsystemunitdir/-.slice \
|
||||
"$systemdsystemunitdir"/slices.target \
|
||||
"$systemdsystemunitdir"/system.slice \
|
||||
"$systemdsystemunitdir"/-.slice \
|
||||
\
|
||||
$tmpfilesdir/systemd.conf \
|
||||
"$tmpfilesdir"/systemd.conf \
|
||||
\
|
||||
journalctl systemctl \
|
||||
echo swapoff \
|
||||
@@ -135,6 +156,7 @@ install() {
|
||||
mount umount reboot poweroff \
|
||||
systemd-run systemd-escape \
|
||||
systemd-cgls systemd-tmpfiles \
|
||||
systemd-ask-password systemd-tty-ask-password-agent \
|
||||
/etc/udev/udev.hwdb \
|
||||
${NULL}
|
||||
|
||||
@@ -144,23 +166,23 @@ install() {
|
||||
|
||||
modules_load_get() {
|
||||
local _line i
|
||||
for i in "$1"/*.conf; do
|
||||
for i in "$dracutsysrootdir$1"/*.conf; do
|
||||
[[ -f $i ]] || continue
|
||||
while read _line || [ -n "$_line" ]; do
|
||||
while read -r _line || [ -n "$_line" ]; do
|
||||
case $_line in
|
||||
\#*)
|
||||
;;
|
||||
\;*)
|
||||
;;
|
||||
*)
|
||||
echo $_line
|
||||
echo "$_line"
|
||||
esac
|
||||
done < "$i"
|
||||
done
|
||||
}
|
||||
|
||||
_mods=$(modules_load_get /usr/lib/modules-load.d)
|
||||
[[ $_mods ]] && hostonly='' instmods $_mods
|
||||
mapfile -t _mods <<< $(modules_load_get /usr/lib/modules-load.d)
|
||||
[[ ${#_mods[@]} -gt 0 ]] && hostonly='' instmods "${_mods[@]}"
|
||||
|
||||
if [[ $hostonly ]]; then
|
||||
inst_multiple -H -o \
|
||||
@@ -179,34 +201,34 @@ install() {
|
||||
/etc/udev/udev.conf \
|
||||
${NULL}
|
||||
|
||||
_mods=$(modules_load_get /etc/modules-load.d)
|
||||
[[ $_mods ]] && hostonly='' instmods $_mods
|
||||
mapfile -t _mods <<< $(modules_load_get /etc/modules-load.d)
|
||||
[[ ${#_mods[@]} -gt 0 ]] && hostonly='' instmods "${_mods[@]}"
|
||||
fi
|
||||
|
||||
if ! [[ -e "$initdir/etc/machine-id" ]]; then
|
||||
> "$initdir/etc/machine-id"
|
||||
: > "$initdir/etc/machine-id"
|
||||
fi
|
||||
|
||||
# install adm user/group for journald
|
||||
inst_multiple nologin
|
||||
grep '^systemd-journal:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^adm:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^systemd-journal:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^wheel:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^adm:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^utmp:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^root:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^systemd-journal:' "$dracutsysrootdir"/etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^adm:' "$dracutsysrootdir"/etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^systemd-journal:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group"
|
||||
grep '^wheel:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group"
|
||||
grep '^adm:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group"
|
||||
grep '^utmp:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group"
|
||||
grep '^root:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group"
|
||||
|
||||
# we don't use systemd-networkd, but the user is in systemd.conf tmpfiles snippet
|
||||
grep '^systemd-network:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^systemd-network:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^systemd-network:' "$dracutsysrootdir"/etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^systemd-network:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group"
|
||||
|
||||
ln_r $systemdutildir/systemd "/init"
|
||||
ln_r $systemdutildir/systemd "/sbin/init"
|
||||
ln_r "$systemdutildir"/systemd "/init"
|
||||
ln_r "$systemdutildir"/systemd "/sbin/init"
|
||||
|
||||
inst_binary true
|
||||
ln_r $(type -P true) "/usr/bin/loginctl"
|
||||
ln_r $(type -P true) "/bin/loginctl"
|
||||
ln_r "$(find_binary true)" "/usr/bin/loginctl"
|
||||
ln_r "$(find_binary true)" "/bin/loginctl"
|
||||
inst_rules \
|
||||
70-uaccess.rules \
|
||||
71-seat.rules \
|
||||
@@ -221,9 +243,8 @@ install() {
|
||||
systemd-ask-password-console.service \
|
||||
systemd-ask-password-plymouth.service \
|
||||
; do
|
||||
mkdir -p "${initdir}${systemdsystemunitdir}/${i}.wants"
|
||||
ln_r "${systemdsystemunitdir}/systemd-vconsole-setup.service" \
|
||||
"${systemdsystemunitdir}/${i}.wants/systemd-vconsole-setup.service"
|
||||
[[ -f "$systemdsystemunitdir"/$i ]] || continue
|
||||
$SYSTEMCTL -q --root "$initdir" add-wants "$i" systemd-vconsole-setup.service
|
||||
done
|
||||
|
||||
mkdir -p "$initdir/etc/systemd"
|
||||
@@ -235,6 +256,5 @@ install() {
|
||||
echo "RateLimitBurst=0"
|
||||
} >> "$initdir/etc/systemd/journald.conf"
|
||||
|
||||
ln_r "${systemdsystemunitdir}/multi-user.target" "${systemdsystemunitdir}/default.target"
|
||||
$SYSTEMCTL -q --root "$initdir" set-default multi-user.target
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
# called by dracut
|
||||
check() {
|
||||
# hwclock does not exist on S390(x), bail out silently then
|
||||
local _arch=$(uname -m)
|
||||
local _arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
[ "$_arch" = "s390" -o "$_arch" = "s390x" ] && return 1
|
||||
|
||||
[ -e /etc/localtime -a -e /etc/adjtime ] || return 1
|
||||
|
@@ -1,7 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
|
||||
if ! fipsmode=$(getarg fips) || [ "$fipsmode" = "0" ]; then
|
||||
rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
elif [ -z "$fipsmode" ]; then
|
||||
die "FIPS mode have to be enabled by 'fips=1' not just 'fips'"
|
||||
elif getarg boot= >/dev/null; then
|
||||
. /sbin/fips.sh
|
||||
if mount_boot; then
|
||||
|
8
modules.d/01fips/fips-load-crypto.sh
Normal file
8
modules.d/01fips/fips-load-crypto.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
|
||||
rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
else
|
||||
. /sbin/fips.sh
|
||||
fips_load_crypto || die "FIPS integrity test failed"
|
||||
fi
|
@@ -1,7 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
|
||||
if ! fipsmode=$(getarg fips) || [ "$fipsmode" = "0" ]; then
|
||||
rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
elif [ -z "$fipsmode" ]; then
|
||||
die "FIPS mode have to be enabled by 'fips=1' not just 'fips'"
|
||||
elif ! [ -f /tmp/fipsdone ]; then
|
||||
. /sbin/fips.sh
|
||||
mount_boot
|
||||
|
@@ -1,5 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
# systemd lets stdout go to journal only, but the system
|
||||
# has to halt when the integrity check fails to satisfy FIPS.
|
||||
if [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
fips_info() {
|
||||
info "$*"
|
||||
}
|
||||
else
|
||||
fips_info() {
|
||||
echo "$*" >&2
|
||||
}
|
||||
fi
|
||||
|
||||
mount_boot()
|
||||
{
|
||||
boot=$(getarg boot=)
|
||||
@@ -45,7 +57,7 @@ mount_boot()
|
||||
[ -e "$boot" ] || return 1
|
||||
|
||||
mkdir /boot
|
||||
info "Mounting $boot as /boot"
|
||||
fips_info "Mounting $boot as /boot"
|
||||
mount -oro "$boot" /boot || return 1
|
||||
elif [ -d "$NEWROOT/boot" ]; then
|
||||
rm -fr -- /boot
|
||||
@@ -65,10 +77,46 @@ do_rhevh_check()
|
||||
warn "HMAC sum mismatch"
|
||||
return 1
|
||||
fi
|
||||
info "rhevh_check OK"
|
||||
fips_info "rhevh_check OK"
|
||||
return 0
|
||||
}
|
||||
|
||||
nonfatal_modprobe()
|
||||
{
|
||||
modprobe $1 2>&1 > /dev/stdout |
|
||||
while read -r line || [ -n "$line" ]; do
|
||||
echo "${line#modprobe: FATAL: }" >&2
|
||||
done
|
||||
}
|
||||
|
||||
fips_load_crypto()
|
||||
{
|
||||
FIPSMODULES=$(cat /etc/fipsmodules)
|
||||
|
||||
fips_info "Loading and integrity checking all crypto modules"
|
||||
mv /etc/modprobe.d/fips.conf /etc/modprobe.d/fips.conf.bak
|
||||
for _module in $FIPSMODULES; do
|
||||
if [ "$_module" != "tcrypt" ]; then
|
||||
if ! nonfatal_modprobe "${_module}" 2>/tmp/fips.modprobe_err; then
|
||||
# check if kernel provides generic algo
|
||||
_found=0
|
||||
while read _k _s _v || [ -n "$_k" ]; do
|
||||
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
|
||||
[ "$_v" != "$_module" ] && continue
|
||||
_found=1
|
||||
break
|
||||
done </proc/crypto
|
||||
[ "$_found" = "0" ] && cat /tmp/fips.modprobe_err >&2 && return 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
mv /etc/modprobe.d/fips.conf.bak /etc/modprobe.d/fips.conf
|
||||
|
||||
fips_info "Self testing crypto algorithms"
|
||||
modprobe tcrypt || return 1
|
||||
rmmod tcrypt
|
||||
}
|
||||
|
||||
do_fips()
|
||||
{
|
||||
local _v
|
||||
@@ -78,44 +126,26 @@ do_fips()
|
||||
|
||||
KERNEL=$(uname -r)
|
||||
|
||||
FIPSMODULES=$(cat /etc/fipsmodules)
|
||||
|
||||
info "Loading and integrity checking all crypto modules"
|
||||
mv /etc/modprobe.d/fips.conf /etc/modprobe.d/fips.conf.bak
|
||||
for _module in $FIPSMODULES; do
|
||||
if [ "$_module" != "tcrypt" ]; then
|
||||
if ! modprobe "${_module}"; then
|
||||
# check if kernel provides generic algo
|
||||
_found=0
|
||||
while read _k _s _v || [ -n "$_k" ]; do
|
||||
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
|
||||
[ "$_v" != "$_module" ] && continue
|
||||
_found=1
|
||||
break
|
||||
done </proc/crypto
|
||||
[ "$_found" = "0" ] && return 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
mv /etc/modprobe.d/fips.conf.bak /etc/modprobe.d/fips.conf
|
||||
|
||||
info "Self testing crypto algorithms"
|
||||
modprobe tcrypt || return 1
|
||||
rmmod tcrypt
|
||||
|
||||
info "Checking integrity of kernel"
|
||||
fips_info "Checking integrity of kernel"
|
||||
if [ -e "/run/initramfs/live/vmlinuz0" ]; then
|
||||
do_rhevh_check /run/initramfs/live/vmlinuz0 || return 1
|
||||
elif [ -e "/run/initramfs/live/isolinux/vmlinuz0" ]; then
|
||||
do_rhevh_check /run/initramfs/live/isolinux/vmlinuz0 || return 1
|
||||
elif [ -e "/run/install/repo/images/pxeboot/vmlinuz" ]; then
|
||||
# This is a boot.iso with the .hmac inside the install.img
|
||||
do_rhevh_check /run/install/repo/images/pxeboot/vmlinuz || return 1
|
||||
else
|
||||
BOOT_IMAGE="$(getarg BOOT_IMAGE)"
|
||||
|
||||
# Trim off any leading GRUB boot device (e.g. ($root) )
|
||||
BOOT_IMAGE="$(echo "${BOOT_IMAGE}" | sed 's/^(.*)//')"
|
||||
|
||||
BOOT_IMAGE_NAME="${BOOT_IMAGE##*/}"
|
||||
BOOT_IMAGE_PATH="${BOOT_IMAGE%${BOOT_IMAGE_NAME}}"
|
||||
|
||||
if [ -z "$BOOT_IMAGE_NAME" ]; then
|
||||
BOOT_IMAGE_NAME="vmlinuz-${KERNEL}"
|
||||
elif ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE}" ]; then
|
||||
elif ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE_NAME}" ]; then
|
||||
#if /boot is not a separate partition BOOT_IMAGE might start with /boot
|
||||
BOOT_IMAGE_PATH=${BOOT_IMAGE_PATH#"/boot"}
|
||||
#on some achitectures BOOT_IMAGE does not contain path to kernel
|
||||
@@ -126,16 +156,16 @@ do_fips()
|
||||
fi
|
||||
fi
|
||||
|
||||
BOOT_IMAGE_HMAC="/boot/${BOOT_IMAGE_PATH}.${BOOT_IMAGE_NAME}.hmac"
|
||||
BOOT_IMAGE_HMAC="/boot/${BOOT_IMAGE_PATH}/.${BOOT_IMAGE_NAME}.hmac"
|
||||
if ! [ -e "${BOOT_IMAGE_HMAC}" ]; then
|
||||
warn "${BOOT_IMAGE_HMAC} does not exist"
|
||||
return 1
|
||||
fi
|
||||
|
||||
sha512hmac -c "${BOOT_IMAGE_HMAC}" || return 1
|
||||
(cd "${BOOT_IMAGE_HMAC%/*}" && sha512hmac -c "${BOOT_IMAGE_HMAC}") || return 1
|
||||
fi
|
||||
|
||||
info "All initrd crypto checks done"
|
||||
fips_info "All initrd crypto checks done"
|
||||
|
||||
> /tmp/fipsdone
|
||||
|
||||
|
@@ -12,7 +12,7 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
local _fipsmodules _mod
|
||||
local _fipsmodules _mod _bootfstype
|
||||
if [[ -f "${srcmods}/modules.fips" ]]; then
|
||||
_fipsmodules="$(cat "${srcmods}/modules.fips")"
|
||||
else
|
||||
@@ -24,10 +24,10 @@ installkernel() {
|
||||
_fipsmodules+="crc32c crct10dif ghash "
|
||||
|
||||
# Ciphers:
|
||||
_fipsmodules+="cipher_null des3_ede aes "
|
||||
_fipsmodules+="cipher_null des3_ede aes cfb "
|
||||
|
||||
# Modes/templates:
|
||||
_fipsmodules+="ecb cbc ctr xts gcm ccm authenc hmac cmac "
|
||||
_fipsmodules+="ecb cbc ctr xts gcm ccm authenc hmac cmac ofb cts "
|
||||
|
||||
# Compression algs:
|
||||
_fipsmodules+="deflate lzo zlib "
|
||||
@@ -47,13 +47,24 @@ installkernel() {
|
||||
echo "blacklist $_mod" >> "${initdir}/etc/modprobe.d/fips.conf"
|
||||
fi
|
||||
done
|
||||
|
||||
# with hostonly_default_device fs module for /boot is not installed by default
|
||||
if [[ $hostonly ]] && [[ "$hostonly_default_device" == "no" ]]; then
|
||||
_bootfstype=$(find_mp_fstype /boot)
|
||||
if [[ -n "$_bootfstype" ]]; then
|
||||
hostonly='' instmods $_bootfstype
|
||||
else
|
||||
dwarning "Can't determine fs type for /boot, FIPS check may fail."
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
local _dir
|
||||
inst_hook pre-trigger 01 "$moddir/fips-boot.sh"
|
||||
inst_hook pre-mount 01 "$moddir/fips-boot.sh"
|
||||
inst_hook pre-pivot 01 "$moddir/fips-noboot.sh"
|
||||
inst_hook pre-udev 01 "$moddir/fips-load-crypto.sh"
|
||||
inst_script "$moddir/fips.sh" /sbin/fips.sh
|
||||
|
||||
inst_multiple sha512hmac rmmod insmod mount uname umount
|
||||
|
59
modules.d/01systemd-ask-password/module-setup.sh
Executable file
59
modules.d/01systemd-ask-password/module-setup.sh
Executable file
@@ -0,0 +1,59 @@
|
||||
#!/bin/sh
|
||||
# This file is part of dracut.
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Prerequisite check(s) for module.
|
||||
check() {
|
||||
|
||||
# If the binary(s) requirements are not fulfilled the module can't be installed
|
||||
require_binaries systemd-ask-password || return 1
|
||||
require_binaries systemd-tty-ask-password-agent || return 1
|
||||
|
||||
# Return 255 to only include the module, if another module requires it.
|
||||
return 255
|
||||
|
||||
}
|
||||
|
||||
# Module dependency requirements.
|
||||
depends() {
|
||||
|
||||
# This module has external dependency on the systemd module.
|
||||
echo systemd
|
||||
# Return 0 to include the dependent systemd module in the initramfs.
|
||||
return 0
|
||||
|
||||
}
|
||||
|
||||
# Install the required file(s) for the module in the initramfs.
|
||||
install() {
|
||||
|
||||
inst_multiple -o \
|
||||
$systemdsystemunitdir/systemd-ask-password-console.path \
|
||||
$systemdsystemunitdir/systemd-ask-password-console.service \
|
||||
$systemdsystemunitdir/multi-user.target.wants/systemd-ask-password-wall.path \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-ask-password-console.path \
|
||||
systemd-ask-password systemd-tty-ask-password-agent
|
||||
|
||||
# Enable the systemd type service unit for systemd-ask-password.
|
||||
$SYSTEMCTL -q --root "$initdir" enable systemd-ask-password-console.service
|
||||
|
||||
# Install systemd-ask-password plymouth units if plymouth is enabled.
|
||||
if dracut_module_included "plymouth"; then
|
||||
inst_multiple -o \
|
||||
$systemdsystemunitdir/systemd-ask-password-plymouth.path \
|
||||
$systemdsystemunitdir/systemd-ask-password-plymouth.service
|
||||
|
||||
$SYSTEMCTL -q --root "$initdir" enable systemd-ask-password-plymouth.service
|
||||
fi
|
||||
|
||||
# Uncomment this section if the usecase for wall module in the initramfs arises.
|
||||
# Install systemd-ask-password wall units if <wall module> is enabled.
|
||||
#if dracut_module_included "<wall module>"; then
|
||||
# inst_multiple -o \
|
||||
# $systemdsystemunitdir/systemd-ask-password-wall.path \
|
||||
# $systemdsystemunitdir/systemd-ask-password-wall.service \
|
||||
# $systemdsystemunitdir/multi-user.target.wants/systemd-ask-password-wall.path
|
||||
#
|
||||
# $SYSTEMCTL -q --root "$initdir" enable systemd-ask-password-wall.service
|
||||
#fi
|
||||
}
|
52
modules.d/01systemd-coredump/module-setup.sh
Executable file
52
modules.d/01systemd-coredump/module-setup.sh
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
# This file is part of dracut.
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Prerequisite check(s) for module.
|
||||
check() {
|
||||
|
||||
# If the binary(s) requirements are not fulfilled the module can't be installed
|
||||
require_binaries coredumpctl || return 1
|
||||
require_binaries $systemdutildir/systemd-coredump || return 1
|
||||
|
||||
# Return 255 to only include the module, if another module requires it.
|
||||
return 255
|
||||
|
||||
}
|
||||
|
||||
# Module dependency requirements.
|
||||
depends() {
|
||||
|
||||
# This module has external dependency on the systemd module.
|
||||
echo systemd systemd-journald systemd-sysctl
|
||||
# Return 0 to include the dependent systemd module in the initramfs.
|
||||
return 0
|
||||
|
||||
}
|
||||
|
||||
# Install the required file(s) and directories for the module in the initramfs.
|
||||
install() {
|
||||
|
||||
inst_dir /var/lib/systemd/coredump
|
||||
inst_multiple -o \
|
||||
$sysctld/50-coredump.conf \
|
||||
$systemdutildir/coredump.conf \
|
||||
$systemdsystemunitdir/systemd-coredump \
|
||||
$systemdsystemunitdir/systemd-coredump.socket \
|
||||
$systemdsystemunitdir/systemd-coredump@.service\
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-coredump.socket \
|
||||
coredumpctl
|
||||
|
||||
# Install the hosts local user configurations if enabled.
|
||||
if [[ $hostonly ]]; then
|
||||
inst_multiple -H -o \
|
||||
$systemdutilconfdir/coredump.conf \
|
||||
$systemdsystemconfdir/coredump.conf.d/*.conf \
|
||||
$systemdsystemconfdir/systemd-coredump.socket \
|
||||
$systemdsystemconfdir/systemd-coredump.socket.d/*.conf \
|
||||
$systemdsystemconfdir/systemd-coredump@.service \
|
||||
$systemdsystemconfdir/systemd-coredump@.service.d/*.conf \
|
||||
$systemdsystemconfdir/sockets.target.wants/systemd-coredump.socket \
|
||||
${NULL}
|
||||
fi
|
||||
}
|
@@ -4,11 +4,6 @@
|
||||
check() {
|
||||
[[ $mount_needs ]] && return 1
|
||||
|
||||
if ! dracut_module_included "systemd"; then
|
||||
derror "systemd-initrd needs systemd in the initramfs"
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -36,33 +31,5 @@ install() {
|
||||
$systemdsystemunitdir/initrd-udevadm-cleanup-db.service \
|
||||
$systemdsystemunitdir/initrd-parse-etc.service
|
||||
|
||||
ln_r "${systemdsystemunitdir}/initrd.target" "${systemdsystemunitdir}/default.target"
|
||||
|
||||
local VERSION=""
|
||||
local PRETTY_NAME=""
|
||||
if [ -e /etc/os-release ]; then
|
||||
. /etc/os-release
|
||||
[[ -n ${VERSION} ]] && VERSION+=" "
|
||||
[[ -n ${PRETTY_NAME} ]] && PRETTY_NAME+=" "
|
||||
fi
|
||||
NAME=dracut
|
||||
ID=dracut
|
||||
VERSION+="dracut-$DRACUT_VERSION"
|
||||
PRETTY_NAME+="dracut-$DRACUT_VERSION (Initramfs)"
|
||||
VERSION_ID=$DRACUT_VERSION
|
||||
ANSI_COLOR="0;34"
|
||||
|
||||
{
|
||||
echo NAME=\"$NAME\"
|
||||
echo VERSION=\"$VERSION\"
|
||||
echo ID=$ID
|
||||
echo VERSION_ID=$VERSION_ID
|
||||
echo PRETTY_NAME=\"$PRETTY_NAME\"
|
||||
echo ANSI_COLOR=\"$ANSI_COLOR\"
|
||||
} > $initdir/usr/lib/initrd-release
|
||||
echo dracut-$DRACUT_VERSION > $initdir/lib/dracut/dracut-$DRACUT_VERSION
|
||||
ln -sf ../usr/lib/initrd-release $initdir/etc/initrd-release
|
||||
ln -sf initrd-release $initdir/usr/lib/os-release
|
||||
ln -sf initrd-release $initdir/etc/os-release
|
||||
$SYSTEMCTL -q --root "$initdir" set-default initrd.target
|
||||
}
|
||||
|
||||
|
49
modules.d/01systemd-modules-load/module-setup.sh
Normal file
49
modules.d/01systemd-modules-load/module-setup.sh
Normal file
@@ -0,0 +1,49 @@
|
||||
#!/bin/sh
|
||||
# This file is part of dracut.
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Prerequisite check(s) for module.
|
||||
check() {
|
||||
|
||||
# If the binary(s) requirements are not fulfilled the module can't be installed
|
||||
require_binaries $systemdutildir/systemd-modules-load || return 1
|
||||
|
||||
# Return 255 to only include the module, if another module requires it.
|
||||
return 255
|
||||
|
||||
}
|
||||
|
||||
# Module dependency requirements.
|
||||
depends() {
|
||||
|
||||
# This module has external dependency on the systemd module.
|
||||
echo systemd
|
||||
# Return 0 to include the dependent systemd module in the initramfs.
|
||||
return 0
|
||||
|
||||
}
|
||||
|
||||
# Install the required file(s) for the module in the initramfs.
|
||||
install() {
|
||||
|
||||
# Create systemd-modules-load related directories.
|
||||
inst_dir $modulesload
|
||||
inst_dir $modulesloadconfdir
|
||||
|
||||
# Install related files for systemd-modules-load
|
||||
inst_multiple -o \
|
||||
$systemdsystemunitdir/systemd-modules-load.service \
|
||||
$systemdutildir/systemd-modules-load
|
||||
|
||||
# Install local user configurations if host only is enabled..
|
||||
if [[ $hostonly ]]; then
|
||||
inst_multiple -H -o \
|
||||
$systemdsystemconfdir/systemd-modules-load.service \
|
||||
$systemdsystemconfdir/systemd-systemd-modules-load.d/*.conf \
|
||||
${NULL}
|
||||
fi
|
||||
|
||||
# Enable the systemd type service unit for systemd-modules-load.
|
||||
$SYSTEMCTL -q --root "$initdir" enable systemd-modules-load.service
|
||||
|
||||
}
|
43
modules.d/01systemd-repart/module-setup.sh
Executable file
43
modules.d/01systemd-repart/module-setup.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
# This file is part of dracut.
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Prerequisite check(s) for module.
|
||||
check() {
|
||||
|
||||
# If the binary(s) requirements are not fulfilled the module can't be installed
|
||||
require_binaries systemd-repart || return 1
|
||||
|
||||
# Return 255 to only include the module, if another module requires it.
|
||||
return 255
|
||||
|
||||
}
|
||||
|
||||
# Module dependency requirements.
|
||||
depends() {
|
||||
|
||||
# This module has external dependency on the systemd module.
|
||||
echo systemd
|
||||
# Return 0 to include the dependent systemd module in the initramfs.
|
||||
return 0
|
||||
|
||||
}
|
||||
|
||||
# Install the required file(s) for the module in the initramfs.
|
||||
install() {
|
||||
|
||||
inst_multiple -o \
|
||||
$libdir/repart.d/*.conf \
|
||||
$systemdsystemunitdir/systemd-repart.service \
|
||||
$systemdsystemunitdir/initrd-root-fs.target.wants/systemd-repart.service \
|
||||
systemd-repart
|
||||
|
||||
# Install the hosts local user configurations if enabled.
|
||||
if [[ $hostonly ]]; then
|
||||
inst_multiple -H -o \
|
||||
/etc/repart.d/*.conf \
|
||||
$systemdsystemconfdir/systemd-repart.service \
|
||||
$systemdsystemconfdir/systemd-repart.service.d/*.conf \
|
||||
${NULL}
|
||||
fi
|
||||
}
|
48
modules.d/01systemd-sysctl/module-setup.sh
Executable file
48
modules.d/01systemd-sysctl/module-setup.sh
Executable file
@@ -0,0 +1,48 @@
|
||||
#!/bin/sh
|
||||
# This file is part of dracut.
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Prerequisite check(s) for module.
|
||||
check() {
|
||||
|
||||
# If the binary(s) requirements are not fulfilled the module can't be installed
|
||||
require_binaries $systemdutildir/systemd-sysctl || return 1
|
||||
|
||||
# Return 255 to only include the module, if another module requires it.
|
||||
return 255
|
||||
|
||||
}
|
||||
|
||||
# Module dependency requirements.
|
||||
depends() {
|
||||
|
||||
# This module has external dependency on other module(s).
|
||||
echo systemd systemd-modules-load
|
||||
# Return 0 to include the dependent module(s) in the initramfs.
|
||||
return 0
|
||||
|
||||
}
|
||||
|
||||
# Install the required file(s) for the module in the initramfs.
|
||||
install() {
|
||||
|
||||
inst_multiple -o \
|
||||
$sysctld/*.conf \
|
||||
$systemdsystemunitdir/systemd-sysctl.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-sysctl.service \
|
||||
$systemdutildir/systemd-sysctl
|
||||
|
||||
# Install the hosts local user configurations if enabled.
|
||||
if [[ $hostonly ]]; then
|
||||
inst_multiple -H -o \
|
||||
/etc/sysctl.conf \
|
||||
$sysctldconfdir/*.conf \
|
||||
$systemdsystemconfdir/systemd-sysctl.service \
|
||||
$systemdsystemconfdir/systemd-sysctl.service.d/*.conf \
|
||||
${NULL}
|
||||
fi
|
||||
|
||||
# Enable the systemd type service unit for sysctl.
|
||||
$SYSTEMCTL -q --root "$initdir" enable systemd-sysctl.service
|
||||
|
||||
}
|
53
modules.d/01systemd-sysusers/module-setup.sh
Normal file
53
modules.d/01systemd-sysusers/module-setup.sh
Normal file
@@ -0,0 +1,53 @@
|
||||
#!/bin/sh
|
||||
# This file is part of dracut.
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Prerequisite check(s) for module.
|
||||
check() {
|
||||
|
||||
# If the binary(s) requirements are not fulfilled
|
||||
# return 1 to not include the binary.
|
||||
require_binaries systemd-sysusers || return 1
|
||||
|
||||
# Return 255 to only include the module, if another module requires it.
|
||||
return 255
|
||||
|
||||
}
|
||||
|
||||
# Module dependency requirements.
|
||||
depends() {
|
||||
|
||||
# This module has external dependency on the systemd module.
|
||||
echo systemd
|
||||
# Return 0 to include the dependent systemd module in the initramfs.
|
||||
return 0
|
||||
|
||||
}
|
||||
|
||||
# Install the required file(s) for the module in the initramfs.
|
||||
install() {
|
||||
|
||||
# Install the system users and groups configuration file.
|
||||
# Install the systemd users and groups configuration file.
|
||||
# Install the systemd type service unit for sysusers.
|
||||
# Install the binary executable(s) for sysusers.
|
||||
inst_multiple -o \
|
||||
$sysusers/basic.conf \
|
||||
$sysusers/systemd.conf \
|
||||
$systemdsystemunitdir/systemd-sysusers.service \
|
||||
systemd-sysusers
|
||||
|
||||
# Install the hosts local user configurations if enabled.
|
||||
if [[ $hostonly ]]; then
|
||||
inst_multiple -H -o \
|
||||
$sysusersconfdir/basic.conf \
|
||||
$sysusersconfdir/systemd.conf \
|
||||
$systemdsystemconfdir/systemd-sysusers.service \
|
||||
$systemdsystemconfdir/systemd-sysusers.service.d/*.conf \
|
||||
${NULL}
|
||||
fi
|
||||
|
||||
# Enable the systemd type service unit for sysusers.
|
||||
$SYSTEMCTL -q --root "$initdir" enable systemd-sysusers.service
|
||||
|
||||
}
|
@@ -4,28 +4,29 @@ capsmode=$(getarg rd.caps)
|
||||
|
||||
if [ "$capsmode" = "1" ]; then
|
||||
CAPS_INIT_DROP=$(getarg rd.caps.initdrop=)
|
||||
# shellcheck disable=SC2016
|
||||
CAPS_USERMODEHELPER_BSET=$(capsh --drop="$CAPS_INIT_DROP" -- -c 'while read a b || [ -n "$a" ]; 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
|
@@ -15,7 +15,7 @@ depends() {
|
||||
install() {
|
||||
if ! dracut_module_included "systemd"; then
|
||||
inst_hook pre-pivot 00 "$moddir/caps.sh"
|
||||
inst $(type -P capsh 2>/dev/null) /usr/sbin/capsh
|
||||
inst $(find_binary capsh 2>/dev/null) /usr/sbin/capsh
|
||||
# capsh wants bash and we need bash also
|
||||
inst /bin/bash
|
||||
else
|
||||
|
@@ -4,11 +4,6 @@
|
||||
check() {
|
||||
[[ $mount_needs ]] && return 1
|
||||
|
||||
if ! dracut_module_included "systemd"; then
|
||||
derror "systemd-networkd needs systemd in the initramfs"
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 255
|
||||
}
|
||||
|
||||
@@ -48,12 +43,12 @@ install() {
|
||||
|
||||
# inst_dir /var/lib/systemd/clock
|
||||
|
||||
grep '^systemd-network:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^systemd-network:' /etc/group >> "$initdir/etc/group"
|
||||
# grep '^systemd-timesync:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
# grep '^systemd-timesync:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^systemd-network:' "$dracutsysrootdir"/etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^systemd-network:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group"
|
||||
# grep '^systemd-timesync:' "$dracutsysrootdir"/etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
# grep '^systemd-timesync:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group"
|
||||
|
||||
_arch=$(uname -m)
|
||||
_arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
|
||||
{"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*" \
|
||||
{"tls/$_arch/",tls/,"$_arch/",}"libnss_myhostname.so.*" \
|
||||
@@ -61,11 +56,11 @@ install() {
|
||||
|
||||
for i in \
|
||||
systemd-networkd-wait-online.service \
|
||||
systemd-networkd.service \
|
||||
systemd-networkd.socket
|
||||
# systemd-timesyncd.service
|
||||
systemd-networkd.service \
|
||||
systemd-networkd.socket
|
||||
# systemd-timesyncd.service
|
||||
do
|
||||
systemctl --root "$initdir" enable "$i"
|
||||
$SYSTEMCTL -q --root "$initdir" enable "$i"
|
||||
done
|
||||
}
|
||||
|
||||
|
@@ -12,8 +12,8 @@ check() {
|
||||
# do not include module in hostonly mode,
|
||||
# if no keys are present
|
||||
if [[ $hostonly ]]; then
|
||||
x=$(echo /lib/modules/keys/*)
|
||||
[[ "${x}" = "/lib/modules/keys/*" ]] && return 255
|
||||
x=$(echo "$dracutsysrootdir"/lib/modules/keys/*)
|
||||
[[ "${x}" = "$dracutsysrootdir/lib/modules/keys/*" ]] && return 255
|
||||
fi
|
||||
|
||||
return 0
|
||||
@@ -31,8 +31,8 @@ install() {
|
||||
|
||||
inst_hook pre-trigger 01 "$moddir/load-modsign-keys.sh"
|
||||
|
||||
for x in /lib/modules/keys/* ; do
|
||||
[[ "${x}" = "/lib/modules/keys/*" ]] && break
|
||||
inst_simple "${x}"
|
||||
for x in "$dracutsysrootdir"/lib/modules/keys/* ; do
|
||||
[[ "${x}" = "$dracutsysrootdir/lib/modules/keys/*" ]] && break
|
||||
inst_simple "${x#$dracutsysrootdir}"
|
||||
done
|
||||
}
|
||||
|
38
modules.d/04watchdog-modules/module-setup.sh
Executable file
38
modules.d/04watchdog-modules/module-setup.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
return 0
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
local -A _drivers
|
||||
local _alldrivers _wdtdrv _wdtppath _dir
|
||||
|
||||
for _wd in /sys/class/watchdog/*; do
|
||||
! [ -e $_wd ] && continue
|
||||
_wdtdrv=$(get_dev_module $_wd)
|
||||
if [[ $_wdtdrv ]]; then
|
||||
instmods $_wdtdrv
|
||||
for i in $_wdtdrv; do
|
||||
_drivers[$i]=1
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
# ensure that watchdog module is loaded as early as possible
|
||||
_alldrivers="${!_drivers[*]}"
|
||||
[[ $_alldrivers ]] && echo "rd.driver.pre=${_alldrivers// /,}" > ${initdir}/etc/cmdline.d/00-watchdog.conf
|
||||
|
||||
return 0
|
||||
}
|
@@ -7,6 +7,7 @@ check() {
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo watchdog-modules
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -27,53 +28,7 @@ install() {
|
||||
inst_hook cleanup 00 "$moddir/watchdog.sh"
|
||||
inst_hook cleanup 99 "$moddir/watchdog.sh"
|
||||
fi
|
||||
|
||||
inst_hook emergency 02 "$moddir/watchdog-stop.sh"
|
||||
inst_multiple -o wdctl
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
local -A _drivers
|
||||
local _alldrivers _active _wdtdrv _wdtppath _dir
|
||||
[[ -d /sys/class/watchdog/ ]] || return
|
||||
for _dir in /sys/class/watchdog/*; do
|
||||
[[ -d "$_dir" ]] || continue
|
||||
[[ -f "$_dir/state" ]] || continue
|
||||
_active=$(< "$_dir/state")
|
||||
! [[ $hostonly ]] || [[ "$_active" = "active" ]] || continue
|
||||
# device/modalias will return driver of this device
|
||||
_wdtdrv=$(< "$_dir/device/modalias")
|
||||
# There can be more than one module represented by same
|
||||
# modalias. Currently load all of them.
|
||||
# TODO: Need to find a way to avoid any unwanted module
|
||||
# represented by modalias
|
||||
_wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null)
|
||||
if [[ $_wdtdrv ]]; then
|
||||
instmods $_wdtdrv
|
||||
for i in $_wdtdrv; do
|
||||
_drivers[$i]=1
|
||||
done
|
||||
fi
|
||||
# however in some cases, we also need to check that if there is
|
||||
# a specific driver for the parent bus/device. In such cases
|
||||
# we also need to enable driver for parent bus/device.
|
||||
_wdtppath=$(readlink -f "$_dir/device")
|
||||
while [[ -d "$_wdtppath" ]] && [[ "$_wdtppath" != "/sys" ]]; do
|
||||
_wdtppath=$(readlink -f "$_wdtppath/..")
|
||||
[[ -f "$_wdtppath/modalias" ]] || continue
|
||||
|
||||
_wdtdrv=$(< "$_wdtppath/modalias")
|
||||
_wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null)
|
||||
if [[ $_wdtdrv ]]; then
|
||||
instmods $_wdtdrv
|
||||
for i in $_wdtdrv; do
|
||||
_drivers[$i]=1
|
||||
done
|
||||
fi
|
||||
done
|
||||
done
|
||||
# ensure that watchdog module is loaded as early as possible
|
||||
_alldrivers="${!_drivers[*]}"
|
||||
[[ $_alldrivers ]] && echo "rd.driver.pre=${_alldrivers// /,}" > ${initdir}/etc/cmdline.d/00-watchdog.conf
|
||||
|
||||
return 0
|
||||
}
|
||||
|
@@ -14,18 +14,16 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
local _i _progs _path _busybox
|
||||
_busybox=$(type -P busybox)
|
||||
local _i _path _busybox
|
||||
local _progs=()
|
||||
_busybox=$(find_binary busybox)
|
||||
inst $_busybox /usr/bin/busybox
|
||||
for _i in $($_busybox | sed -ne '1,/Currently/!{s/,//g; s/busybox//g; p}')
|
||||
do
|
||||
_progs="$_progs $_i"
|
||||
for _i in $($_busybox --list); do
|
||||
[[ ${_i} == busybox ]] && continue
|
||||
_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
|
||||
for _i in "${_progs[@]}"; do
|
||||
_path=$(find_binary "$_i")
|
||||
[ -z "$_path" ] && continue
|
||||
ln_r /usr/bin/busybox $_path
|
||||
|
89
modules.d/06dbus-broker/module-setup.sh
Executable file
89
modules.d/06dbus-broker/module-setup.sh
Executable file
@@ -0,0 +1,89 @@
|
||||
#!/bin/sh
|
||||
# This file is part of dracut.
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Prerequisite check(s) for module.
|
||||
check() {
|
||||
|
||||
# If the binary(s) requirements are not fulfilled the module can't be installed
|
||||
require_binaries busctl || return 1
|
||||
require_binaries dbus-broker || return 1
|
||||
require_binaries dbus-broker-launch || return 1
|
||||
|
||||
# Return 255 to only include the module, if another module requires it.
|
||||
return 255
|
||||
|
||||
}
|
||||
|
||||
# Module dependency requirements.
|
||||
depends() {
|
||||
# This module has external dependency on the systemd module.
|
||||
echo systemd systemd-sysusers
|
||||
# Return 0 to include the dependent systemd module in the initramfs.
|
||||
return 0
|
||||
|
||||
}
|
||||
|
||||
# Install the required file(s) and directories for the module in the initramfs.
|
||||
install() {
|
||||
|
||||
# Create dbus related directories.
|
||||
inst_dir $dbus
|
||||
inst_dir $dbusinterfaces
|
||||
inst_dir $dbusservices
|
||||
inst_dir $dbussession
|
||||
inst_dir $dbussystem
|
||||
inst_dir $dbussystemservices
|
||||
inst_dir $dbusconfdir
|
||||
inst_dir $dbusinterfacesconfdir
|
||||
inst_dir $dbusservicesconfdir
|
||||
inst_dir $dbussessionconfdir
|
||||
inst_dir $dbussystemconfdir
|
||||
inst_dir $dbussystemservicesconfdir
|
||||
|
||||
inst_multiple -o \
|
||||
$dbus/session.conf \
|
||||
$dbus/system.conf \
|
||||
$dbussystem/org.freedesktop.systemd1.conf \
|
||||
$dbusservicesconfdir/org.freedesktop.systemd1.service \
|
||||
$dbussystemservices/org.freedesktop.systemd1.service \
|
||||
$sysusers/dbus.conf \
|
||||
$systemdcatalog/dbus-broker.catalog \
|
||||
$systemdcatalog/dbus-broker-launch.catalog \
|
||||
$systemdsystemunitdir/dbus-broker.service \
|
||||
$systemduser/dbus-broker.service \
|
||||
$systemdsystemunitdir/dbus.socket \
|
||||
$systemduser/dbus.socket \
|
||||
$systemdsystemunitdir/dbus.target.wants \
|
||||
busctl dbus-broker dbus-broker-launch
|
||||
|
||||
# Adjusting dependencies for initramfs in the dbus socket unit.
|
||||
sed -i -e \
|
||||
'/^\[Unit\]/aDefaultDependencies=no\
|
||||
Conflicts=shutdown.target\
|
||||
Before=shutdown.target
|
||||
/^\[Socket\]/aRemoveOnStop=yes' \
|
||||
"$initdir$systemdsystemunitdir/dbus.socket"
|
||||
|
||||
|
||||
# Install the hosts local user configurations if enabled.
|
||||
if [[ $hostonly ]]; then
|
||||
inst_multiple -H -o \
|
||||
$dbusconfdir/session.conf \
|
||||
$dbusconfdir/system.conf \
|
||||
$sysusersconfdir/dbus.conf \
|
||||
$systemdsystemconfdir/dbus.socket \
|
||||
$systemdsystemconfdir/dbus.socket.d/*.conf \
|
||||
$systemdsystemconfdir/dbus-broker.service \
|
||||
$systemdsystemconfdir/dbus-broker.service.d/*.conf \
|
||||
${NULL}
|
||||
fi
|
||||
|
||||
# We need to make sure that systemd-tmpfiles-setup.service->dbus.socket
|
||||
# will not wait for local-fs.target to start if swap is encrypted,
|
||||
# this would make dbus wait the timeout for the swap before loading.
|
||||
# This could delay sysinit services that are dependent on dbus.service.
|
||||
sed -i -Ee \
|
||||
'/^After/s/(After[[:space:]]*=.*)(local-fs.target[[:space:]]*)(.*)/\1-\.mount \3/' \
|
||||
"$initdir$systemdsystemunitdir/systemd-tmpfiles-setup.service"
|
||||
}
|
96
modules.d/06dbus-daemon/module-setup.sh
Executable file
96
modules.d/06dbus-daemon/module-setup.sh
Executable file
@@ -0,0 +1,96 @@
|
||||
#!/bin/sh
|
||||
# This file is part of dracut.
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# Prerequisite check(s) for module.
|
||||
check() {
|
||||
|
||||
# If the binary(s) requirements are not fulfilled the module can't be installed
|
||||
require_binaries busctl || return 1
|
||||
require_binaries dbus-daemon || return 1
|
||||
require_binaries dbus-send || return 1
|
||||
|
||||
# dbus conflicts with dbus-broker.
|
||||
if dracut_module_included "dbus-broker"; then
|
||||
derror "dbus conflicts with dbus-broker in the initramfs."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Return 255 to only include the module, if another module requires it.
|
||||
return 255
|
||||
}
|
||||
|
||||
# Module dependency requirements.
|
||||
depends() {
|
||||
|
||||
# This module has external dependency on the systemd module.
|
||||
echo systemd
|
||||
# Return 0 to include the dependent systemd module in the initramfs.
|
||||
return 0
|
||||
}
|
||||
|
||||
# Install the required file(s) and directories for the module in the initramfs.
|
||||
install() {
|
||||
|
||||
# Create dbus related directories.
|
||||
inst_dir $dbus
|
||||
inst_dir $dbusinterfaces
|
||||
inst_dir $dbusservices
|
||||
inst_dir $dbussession
|
||||
inst_dir $dbussystem
|
||||
inst_dir $dbussystemservices
|
||||
inst_dir $dbusconfdir
|
||||
inst_dir $dbusinterfacesconfdir
|
||||
inst_dir $dbusservicesconfdir
|
||||
inst_dir $dbussessionconfdir
|
||||
inst_dir $dbussystemconfdir
|
||||
inst_dir $dbussystemservicesconfdir
|
||||
|
||||
inst_multiple -o \
|
||||
$dbus/system.conf \
|
||||
$dbussystem/org.freedesktop.systemd1.conf \
|
||||
$dbusservicesconfdir/org.freedesktop.systemd1.service \
|
||||
$dbussystemservices/org.freedesktop.systemd1.service \
|
||||
$systemdsystemunitdir/dbus.service \
|
||||
$systemdsystemunitdir/dbus.socket \
|
||||
$systemdsystemunitdir/dbus.target.wants \
|
||||
busctl dbus-send dbus-daemon
|
||||
|
||||
# Adjusting dependencies for initramfs in the dbus service unit.
|
||||
sed -i -e \
|
||||
'/^\[Unit\]/aDefaultDependencies=no\
|
||||
Conflicts=shutdown.target\
|
||||
Before=shutdown.target' \
|
||||
"$initdir$systemdsystemunitdir/dbus.service"
|
||||
|
||||
# Adjusting dependencies for initramfs in the dbus socket unit.
|
||||
sed -i -e \
|
||||
'/^\[Unit\]/aDefaultDependencies=no\
|
||||
Conflicts=shutdown.target\
|
||||
Before=shutdown.target
|
||||
/^\[Socket\]/aRemoveOnStop=yes' \
|
||||
"$initdir$systemdsystemunitdir/dbus.socket"
|
||||
|
||||
# Adding the user and group for dbus
|
||||
grep '^\(d\|message\)bus:' "$dracutsysrootdir"/etc/passwd >> "$initdir/etc/passwd"
|
||||
grep '^\(d\|message\)bus:' "$dracutsysrootdir"/etc/group >> "$initdir/etc/group"
|
||||
|
||||
# Install the hosts local user configurations if enabled.
|
||||
if [[ $hostonly ]]; then
|
||||
inst_multiple -H -o \
|
||||
$dbusconfdir/system.conf \
|
||||
$systemdsystemconfdir/dbus.socket \
|
||||
$systemdsystemconfdir/dbus.socket.d/*.conf \
|
||||
$systemdsystemconfdir/dbus.service \
|
||||
$systemdsystemconfdir/dbus.service.d/*.conf \
|
||||
${NULL}
|
||||
fi
|
||||
|
||||
# We need to make sure that systemd-tmpfiles-setup.service->dbus.socket
|
||||
# will not wait for local-fs.target to start if swap is encrypted,
|
||||
# this would make dbus wait the timeout for the swap before loading.
|
||||
# This could delay sysinit services that are dependent on dbus.service.
|
||||
sed -i -Ee \
|
||||
'/^After/s/(After[[:space:]]*=.*)(local-fs.target[[:space:]]*)(.*)/\1-\.mount \3/' \
|
||||
"$initdir$systemdsystemunitdir/systemd-tmpfiles-setup.service"
|
||||
}
|
40
modules.d/06rngd/module-setup.sh
Normal file
40
modules.d/06rngd/module-setup.sh
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
# vim: set tabstop=8 shiftwidth=4 softtabstop=4 expandtab smarttab colorcolumn=80:
|
||||
#
|
||||
# Copyright (c) 2019 Red Hat, Inc.
|
||||
# Author: Renaud Métrich <rmetrich@redhat.com>
|
||||
#
|
||||
# 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 3 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/>.
|
||||
#
|
||||
|
||||
check() {
|
||||
# if there's no rngd binary, no go.
|
||||
require_binaries rngd || return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
depends() {
|
||||
echo systemd
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
inst rngd
|
||||
inst_simple "${moddir}/rngd.service" "${systemdsystemunitdir}/rngd.service"
|
||||
# make sure dependant libs are installed too
|
||||
inst_libdir_file opensc-pkcs11.so
|
||||
|
||||
$SYSTEMCTL -q --root "$initdir" add-wants sysinit.target rngd.service
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user