Compare commits
495 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
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 |
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 #
|
20
.github/stale.yml
vendored
Normal file
20
.github/stale.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
# 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
|
||||
# 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
|
56
.github/workflows/fedora-31.yml
vendored
Normal file
56
.github/workflows/fedora-31.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
## The test container is created with https://github.com/dracutdevs/fedora-container
|
||||
|
||||
name: Fedora-31
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
tags:
|
||||
- '*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: quay.io/haraldh/dracut-fedora:31
|
||||
options: "--privileged"
|
||||
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",
|
||||
"50",
|
||||
"51",
|
||||
"60",
|
||||
"61",
|
||||
"99",
|
||||
]
|
||||
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 }}
|
56
.github/workflows/fedora-32.yml
vendored
Normal file
56
.github/workflows/fedora-32.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
## The test container is created with https://github.com/dracutdevs/fedora-container
|
||||
|
||||
name: Fedora-32
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
tags:
|
||||
- '*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: quay.io/haraldh/dracut-fedora:32
|
||||
options: "--privileged"
|
||||
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",
|
||||
"50",
|
||||
"51",
|
||||
"60",
|
||||
"61",
|
||||
"99",
|
||||
]
|
||||
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
|
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
|
||||
|
3
.mailmap
3
.mailmap
@@ -31,3 +31,6 @@ 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>
|
||||
|
55
.travis.yml
55
.travis.yml
@@ -1,46 +1,55 @@
|
||||
language: generic
|
||||
dist: bionic
|
||||
sudo: required
|
||||
services:
|
||||
- docker
|
||||
- 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
|
||||
- IMAGE=latest
|
||||
- IMAGE=latest TESTS=01
|
||||
- IMAGE=latest TESTS=12
|
||||
- IMAGE=latest TESTS=20
|
||||
- IMAGE=latest TESTS=21
|
||||
- IMAGE=latest TESTS=50
|
||||
- IMAGE=latest TESTS=51
|
||||
- IMAGE=latest TESTS=30
|
||||
- IMAGE=latest TESTS=31
|
||||
- IMAGE=latest TESTS=35
|
||||
- IMAGE=latest TESTS=36
|
||||
- IMAGE=latest TESTS=40
|
||||
- IMAGE=latest TESTS=41
|
||||
- IMAGE=latest TESTS=60
|
||||
- IMAGE=latest TESTS=61
|
||||
- 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
|
||||
- docker pull quay.io/haraldh/dracut-fedora:$IMAGE
|
||||
- |
|
||||
sudo modprobe kvm-intel nested=1 || :
|
||||
sudo modprobe kvm-amd nested=1 || :
|
||||
dmesg | tail || :
|
||||
- git pull --depth=100
|
||||
- git fetch --tags --unshallow
|
||||
- |
|
||||
git describe --abbrev=0 --tags || :
|
||||
git describe --tags || :
|
||||
|
||||
script:
|
||||
- docker run --privileged -it -v $(pwd)/:/dracut fedora:$IMAGE /dracut/fedora-test.sh $IMAGE-$$ "$TESTS"
|
||||
## The test container is created with https://github.com/dracutdevs/fedora-container
|
||||
- docker run --privileged -it -v $(pwd)/:/dracut quay.io/haraldh/dracut-fedora:$IMAGE /dracut/fedora-test.sh $IMAGE-$$ "$TESTS"
|
||||
|
||||
notifications:
|
||||
webhooks:
|
||||
urls:
|
||||
- https://webhooks.gitter.im/e/effa917ca3e0ed5fd00e
|
||||
- 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
|
||||
|
@@ -35,10 +35,14 @@ 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
|
||||
@@ -49,7 +53,7 @@ case "$COMMAND" in
|
||||
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
|
@@ -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}
|
||||
@@ -98,7 +92,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
|
||||
|
||||
@@ -112,7 +106,11 @@ case "$COMMAND" in
|
||||
echo "initrd $BOOT_DIR/initrd"
|
||||
} > $LOADER_ENTRY
|
||||
else
|
||||
cp -aT "${KERNEL_IMAGE%/*}/bls.conf" $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
|
||||
|
||||
|
110
AUTHORS
110
AUTHORS
@@ -2,65 +2,83 @@ Harald Hoyer <harald@redhat.com>
|
||||
Victor Lowther <victor.lowther@gmail.com>
|
||||
Amadeusz Żołnowski <aidecoe@aidecoe.name>
|
||||
Hannes Reinecke <hare@suse.com>
|
||||
Daniel Molkentin <dmolkentin@suse.com>
|
||||
Will Woods <wwoods@redhat.com>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Kairui Song <kasong@redhat.com>
|
||||
Dave Young <dyoung@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Lukas Nykryn <lnykryn@redhat.com>
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
Michal Soltys <soltys@ziu.info>
|
||||
Colin Guthrie <colin@mageia.org>
|
||||
Daniel Molkentin <dmolkentin@suse.com>
|
||||
Jóhann B. Guðmundsson <johannbg@gmail.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>
|
||||
Colin Walters <walters@verbum.org>
|
||||
John Reiser <jreiser@bitwagon.com>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
Nicolas Chauvet <kwizart@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>
|
||||
Thomas Blume <thomas.blume@suse.com>
|
||||
Ville Skyttä <ville.skytta@iki.fi>
|
||||
Beniamino Galvani <bgalvani@redhat.com>
|
||||
Böszörményi Zoltán <zboszor@pr.hu>
|
||||
Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Dan Horák <dhorak@redhat.com>
|
||||
Renaud Métrich <rmetrich@redhat.com>
|
||||
Baoquan He <bhe@redhat.com>
|
||||
Brendan Germain <brendan.germain@nasdaqomx.com>
|
||||
Colin Walters <walters@verbum.org>
|
||||
Javier Martinez Canillas <javierm@redhat.com>
|
||||
Jonas Witschel <diabonas@gmx.de>
|
||||
Leho Kraav <leho@kraav.com>
|
||||
Moritz Maxeiner <moritz@ucworks.org>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
Nathan Rini <nate@ucar.edu>
|
||||
Ondrej Mosnacek <omosnace@redhat.com>
|
||||
Radek Vykydal <rvykydal@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>
|
||||
Chao Wang <chaowang@redhat.com>
|
||||
David Tardon <dtardon@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>
|
||||
Takashi Iwai <tiwai@suse.de>
|
||||
Tomasz Paweł Gajc <tpgxyz@gmail.com>
|
||||
tpgxyz <tpgxyz@gmail.com>
|
||||
Adam Williamson <awilliam@redhat.com>
|
||||
Anton Blanchard <anton@samba.org>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
@@ -68,32 +86,38 @@ 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>
|
||||
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 +125,20 @@ 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>
|
||||
Lukas Wunner <lukas@wunner.de>
|
||||
Marko Myllynen <myllynen@redhat.com>
|
||||
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>
|
||||
Pingfan Liu <piliu@redhat.com>
|
||||
Przemysław Rudy <prudy1@o2.pl>
|
||||
Robert LeBlanc <robert@leblancnet.us>
|
||||
@@ -120,15 +149,27 @@ 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>
|
||||
Andy Lutomirski <luto@mit.edu>
|
||||
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>
|
||||
@@ -136,49 +177,64 @@ Chad Dupuis <chad.dupuis@cavium.com>
|
||||
Christian Heinz <christian.ch.heinz@gmail.com>
|
||||
Cong Wang <amwang@redhat.com>
|
||||
Dan Fuhry <dfuhry@datto.com>
|
||||
Daniel Molkentin <daniel.molkentin@suse.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>
|
||||
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>
|
||||
@@ -186,30 +242,37 @@ Moritz 'Morty' Strübe <morty@gmx.net>
|
||||
Munehiro Matsuda <haro@kgt.co.jp>
|
||||
Nicolas Porcel <nicolasporcel06@gmail.com>
|
||||
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>
|
||||
Petr Pavlu <petr.pavlu@suse.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>
|
||||
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>
|
||||
@@ -218,11 +281,20 @@ Vratislav Podzimek <vpodzime@redhat.com>
|
||||
Yanko Kaneti <yaneti@declera.com>
|
||||
Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
|
||||
Ziyue Yang <ziyang@redhat.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>
|
||||
xtraeme <xtraeme@voidlinux.eu>
|
||||
Дамјан Георгиевски <gdamjan@gmail.com>
|
||||
|
78
Makefile
78
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 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,9 @@ 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
|
||||
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/
|
||||
|
333
NEWS
333
NEWS
@@ -1,3 +1,332 @@
|
||||
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 +349,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 +539,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".
|
107
README.md
107
README.md
@@ -1,30 +1,89 @@
|
||||
# dracut - master branch
|
||||
dracut
|
||||
====
|
||||
|
||||
dracut is an initramfs infrastructure.
|
||||
|
||||
## Travis
|
||||
dracut is an event driven initramfs infrastructure.
|
||||
|
||||
[](.github/CODE_OF_CONDUCT.md)
|
||||
[](https://travis-ci.org/dracutdevs/dracut)
|
||||
[](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-31)
|
||||
[](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-32)
|
||||
|
||||
## CentOS CI
|
||||
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.
|
||||
|
||||
[](https://ci.centos.org/job/dracut-push-master/)
|
||||
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.
|
||||
|
||||
- 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/)
|
||||
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
|
||||
|
44
configure
vendored
44
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.
|
||||
@@ -57,6 +58,48 @@ if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 23 "; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat <<EOF >conftest.c
|
||||
#include <fts.h>
|
||||
int main() {
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
|
||||
${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
|
||||
${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 +111,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
|
||||
|
||||
{
|
||||
|
@@ -73,6 +73,17 @@ _dracut() {
|
||||
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
|
||||
comps=$(cd /lib/modules; echo [0-9]*)
|
||||
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
complete -F _dracut dracut
|
||||
|
@@ -40,19 +40,48 @@ 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
|
||||
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.
|
||||
@@ -174,9 +203,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 +225,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#*:}))"
|
||||
}
|
||||
@@ -500,7 +526,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 +544,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
|
||||
@@ -595,6 +619,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,9 +660,9 @@ 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
|
||||
@@ -642,6 +672,11 @@ check_kernel_config()
|
||||
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 +711,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 +731,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'
|
||||
}
|
||||
|
272
dracut-init.sh
272
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"
|
||||
@@ -57,7 +57,7 @@ if ! [[ $kernel ]]; then
|
||||
export kernel
|
||||
fi
|
||||
|
||||
srcmods="/lib/modules/$kernel/"
|
||||
srcmods="$dracutsysrootdir/lib/modules/$kernel/"
|
||||
|
||||
[[ $drivers_dir ]] && {
|
||||
if ! command -v kmod &>/dev/null && vercmp "$(modprobe --version | cut -d' ' -f3)" lt 3.7; then
|
||||
@@ -79,17 +79,21 @@ export srcmods
|
||||
export hookdirs
|
||||
}
|
||||
|
||||
DRACUT_LDD=${DRACUT_LDD:-ldd}
|
||||
DRACUT_TESTBIN=${DRACUT_TESTBIN:-/bin/sh}
|
||||
DRACUT_LDCONFIG=${DRACUT_LDCONFIG:-ldconfig}
|
||||
|
||||
. $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)"
|
||||
@@ -150,6 +154,14 @@ dracut_module_included() {
|
||||
[[ " $mods_to_load $modules_loaded " == *\ $*\ * ]]
|
||||
}
|
||||
|
||||
dracut_no_switch_root() {
|
||||
>"$initdir/lib/dracut/no-switch-root"
|
||||
}
|
||||
|
||||
dracut_module_path() {
|
||||
echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; }
|
||||
}
|
||||
|
||||
if ! [[ $DRACUT_INSTALL ]]; then
|
||||
DRACUT_INSTALL=$(find_binary dracut-install)
|
||||
fi
|
||||
@@ -160,7 +172,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 +191,15 @@ 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 "$@" || :
|
||||
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -d "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} -d "$@" || :
|
||||
}
|
||||
|
||||
inst() {
|
||||
@@ -186,8 +209,8 @@ 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} "$@" || :
|
||||
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
}
|
||||
|
||||
inst_simple() {
|
||||
@@ -198,8 +221,8 @@ 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} "$@" || :
|
||||
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@" || :
|
||||
}
|
||||
|
||||
inst_symlink() {
|
||||
@@ -210,15 +233,15 @@ 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} "$@" || :
|
||||
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
}
|
||||
|
||||
inst_multiple() {
|
||||
local _ret
|
||||
$DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
|
||||
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${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} "$@" || :
|
||||
(($_ret != 0)) && 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
|
||||
}
|
||||
|
||||
@@ -235,8 +258,9 @@ dracut_instmods() {
|
||||
done
|
||||
|
||||
$DRACUT_INSTALL \
|
||||
${dracutsysrootdir:+-r "$dracutsysrootdir"} \
|
||||
${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 "$@" || :
|
||||
(($? != 0)) && (($_silent == 0)) && derror FAILED: $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} -m "$@" || :
|
||||
}
|
||||
|
||||
inst_library() {
|
||||
@@ -247,24 +271,24 @@ 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} "$@" || :
|
||||
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || :
|
||||
}
|
||||
|
||||
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} "$@" || :
|
||||
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
|
||||
}
|
||||
|
||||
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} "$@" || :
|
||||
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@"
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || :
|
||||
}
|
||||
|
||||
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 || :
|
||||
$DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" $_helper
|
||||
(($? != 0)) && derror $DRACUT_INSTALL ${dracutsysrootdir:+-r "$dracutsysrootdir"} ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" $_helper || :
|
||||
}
|
||||
|
||||
# Use with form hostonly="$(optional_hostonly)" inst_xxxx <args>
|
||||
@@ -361,12 +385,12 @@ inst_rule_group_owner() {
|
||||
|
||||
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
|
||||
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 +410,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 +419,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
|
||||
@@ -437,6 +461,14 @@ inst_rules_wildcard() {
|
||||
|
||||
prepare_udev_rules() {
|
||||
[ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version)
|
||||
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"
|
||||
@@ -517,7 +549,7 @@ inst_libdir_file() {
|
||||
for _i in "$@"; do
|
||||
for _f in "$_dir"/$_i; do
|
||||
[[ "$_f" =~ $_pattern ]] || continue
|
||||
[[ -e "$_f" ]] && _files+="$_f "
|
||||
[[ -e "$dracutsysrootdir$_f" ]] && _files+="$_f "
|
||||
done
|
||||
done
|
||||
done
|
||||
@@ -525,7 +557,7 @@ inst_libdir_file() {
|
||||
for _dir in $libdirs; do
|
||||
for _i in "$@"; do
|
||||
for _f in "$_dir"/$_i; do
|
||||
[[ -e "$_f" ]] && _files+="$_f "
|
||||
[[ -e "$dracutsysrootdir$_f" ]] && _files+="$_f "
|
||||
done
|
||||
done
|
||||
done
|
||||
@@ -533,6 +565,14 @@ inst_libdir_file() {
|
||||
[[ $_files ]] && 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
|
||||
@@ -544,11 +584,8 @@ inst_decompress() {
|
||||
|
||||
for _src in $@
|
||||
do
|
||||
case ${_src} in
|
||||
*.gz) _cmd='gzip -f -d' ;;
|
||||
*.bz2) _cmd='bzip2 -d' ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
_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'.
|
||||
@@ -567,15 +604,16 @@ inst_opt_decompress() {
|
||||
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
|
||||
@@ -598,14 +636,15 @@ 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
|
||||
[[ -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
|
||||
@@ -624,12 +663,13 @@ module_check_mount() {
|
||||
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
|
||||
@@ -647,12 +687,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"
|
||||
@@ -668,12 +709,13 @@ module_cmdline() {
|
||||
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"
|
||||
@@ -689,12 +731,13 @@ module_install() {
|
||||
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"
|
||||
@@ -710,15 +753,16 @@ module_installkernel() {
|
||||
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")
|
||||
[ "${#host_fs_types[@]}" -le 0 ] && return 1
|
||||
|
||||
# If we are already scheduled to be loaded, no need to check again.
|
||||
@@ -735,7 +779,7 @@ check_mount() {
|
||||
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 +787,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\ * ]] \
|
||||
@@ -774,15 +818,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 +839,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 +855,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 +866,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\ * ]] \
|
||||
@@ -845,7 +891,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 +903,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 +924,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"
|
||||
@@ -999,6 +971,7 @@ instmods() {
|
||||
|
||||
$DRACUT_INSTALL \
|
||||
${initdir:+-D "$initdir"} \
|
||||
${dracutsysrootdir:+-r "$dracutsysrootdir"} \
|
||||
${loginstall:+-L "$loginstall"} \
|
||||
${hostonly:+-H} \
|
||||
${omit_drivers:+-N "$omit_drivers"} \
|
||||
@@ -1012,6 +985,7 @@ instmods() {
|
||||
derror "FAILED: " \
|
||||
$DRACUT_INSTALL \
|
||||
${initdir:+-D "$initdir"} \
|
||||
${dracutsysrootdir:+-r "$dracutsysrootdir"} \
|
||||
${loginstall:+-L "$loginstall"} \
|
||||
${hostonly:+-H} \
|
||||
${omit_drivers:+-N "$omit_drivers"} \
|
||||
@@ -1037,3 +1011,25 @@ 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
|
||||
vm=$(systemd-detect-virt --vm >/dev/null 2>&1)
|
||||
(($? != 0)) && return 255
|
||||
[[ $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 vendor < $i
|
||||
[[ "$vendor" == "QEMU" ]] && return 0
|
||||
[[ "$vendor" == "Red Hat" ]] && return 0
|
||||
[[ "$vendor" == "Bochs" ]] && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
@@ -40,4 +40,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
|
||||
|
118
dracut.8.asc
118
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
|
||||
@@ -507,6 +520,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 +534,91 @@ 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**.
|
||||
|
||||
_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 +662,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.
|
||||
|
||||
@@ -187,9 +191,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 +201,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 +250,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 +284,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 +305,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 +328,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 +367,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 +483,9 @@ MULTIPATH
|
||||
**rd.multipath=0**::
|
||||
disable multipath detection
|
||||
|
||||
**rd.multipath=default**::
|
||||
use default multipath settings
|
||||
|
||||
FIPS
|
||||
~~~~
|
||||
**rd.fips**::
|
||||
@@ -528,7 +612,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 +655,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 +670,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 +733,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 +845,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 +856,9 @@ iscsistart -b --param node.session.timeo.replacement_timeout=30
|
||||
|
||||
FCoE
|
||||
~~~~
|
||||
**rd.nofcoe=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 +868,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 +936,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
|
||||
|
@@ -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>_
|
||||
|
@@ -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.
|
||||
|
@@ -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> ... ]
|
||||
|
56
dracut.spec
56
dracut.spec
@@ -32,7 +32,7 @@ Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
|
||||
|
||||
BuildRequires: bash
|
||||
BuildRequires: git
|
||||
BuildRequires: kmod-devel >= 23
|
||||
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
|
||||
@@ -222,6 +223,9 @@ rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00bootchart
|
||||
# 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 +261,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 TODO AUTHORS NEWS dracut.html dracut.png dracut.svg
|
||||
%endif
|
||||
%{!?_licensedir:%global license %%doc}
|
||||
%license COPYING lgpl-2.1.txt
|
||||
@@ -316,6 +317,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*
|
||||
@@ -338,7 +342,10 @@ install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kerne
|
||||
%{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
|
||||
%{dracutlibdir}/modules.d/06rngd
|
||||
%{dracutlibdir}/modules.d/10i18n
|
||||
%{dracutlibdir}/modules.d/30convertfs
|
||||
%{dracutlibdir}/modules.d/45url-lib
|
||||
@@ -354,13 +361,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 +400,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 +422,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 +460,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
|
||||
|
@@ -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) {
|
||||
@@ -1124,8 +1330,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 +1390,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 +1469,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 +1572,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 +1942,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 +1970,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 +1985,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);
|
||||
}
|
||||
}
|
||||
|
@@ -3,6 +3,7 @@ LSINITRD(1)
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
:man version: {version}
|
||||
|
||||
NAME
|
||||
----
|
||||
|
60
lsinitrd.sh
60
lsinitrd.sh
@@ -121,6 +121,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 +163,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 +191,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 +236,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 +309,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 +340,7 @@ else
|
||||
echo
|
||||
list_modules
|
||||
list_files
|
||||
list_squash_content
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@@ -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.'
|
||||
|
@@ -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."
|
||||
@@ -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
|
||||
----
|
||||
|
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,10 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
getSystemdVersion() {
|
||||
[ -z "$SYSTEMD_VERSION" ] && SYSTEMD_VERSION=$($systemdutildir/systemd --version | { read a b a; 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=$(getSystemdVersion)
|
||||
(( $SYSTEMD_VERSION >= 198 )) && return 0
|
||||
return 255
|
||||
fi
|
||||
@@ -31,6 +42,12 @@ install() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $(getSystemdVersion) -ge 240 ]; then
|
||||
inst_multiple -o \
|
||||
$systemdutildir/system-generators/systemd-debug-generator \
|
||||
$systemdsystemunitdir/debug-shell.service
|
||||
fi
|
||||
|
||||
inst_multiple -o \
|
||||
$systemdutildir/systemd \
|
||||
$systemdutildir/systemd-coredump \
|
||||
@@ -43,10 +60,13 @@ install() {
|
||||
$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/cryptsetup-pre.target \
|
||||
$systemdsystemunitdir/remote-cryptsetup.target \
|
||||
$systemdsystemunitdir/emergency.target \
|
||||
$systemdsystemunitdir/sysinit.target \
|
||||
$systemdsystemunitdir/basic.target \
|
||||
@@ -99,6 +119,7 @@ install() {
|
||||
$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 \
|
||||
@@ -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,7 +166,7 @@ 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
|
||||
case $_line in
|
||||
@@ -189,17 +211,17 @@ install() {
|
||||
|
||||
# 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"
|
||||
@@ -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
|
||||
|
@@ -36,33 +36,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
|
||||
}
|
||||
|
||||
|
@@ -48,12 +48,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 +61,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,7 +7,7 @@ check() {
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
return 0
|
||||
return "watchdog-modules"
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
@@ -27,53 +27,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
|
||||
local _i _path _busybox
|
||||
local _progs=()
|
||||
_busybox=$(type -P 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
|
||||
|
70
modules.d/06dbus/module-setup.sh
Executable file
70
modules.d/06dbus/module-setup.sh
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
require_binaries dbus-daemon || return 1
|
||||
|
||||
return 255
|
||||
}
|
||||
|
||||
depends() {
|
||||
echo systemd
|
||||
return 0
|
||||
}
|
||||
|
||||
adjust_dependencies() {
|
||||
sed -i -e \
|
||||
'/^\[Unit\]/aDefaultDependencies=no\
|
||||
Conflicts=shutdown.target\
|
||||
Before=shutdown.target' \
|
||||
"$initdir"${1}
|
||||
|
||||
}
|
||||
|
||||
install() {
|
||||
|
||||
inst_multiple \
|
||||
$systemdsystemunitdir/dbus.service \
|
||||
$systemdsystemunitdir/dbus.socket \
|
||||
/usr/bin/dbus-send \
|
||||
/usr/bin/busctl
|
||||
adjust_dependencies $systemdsystemunitdir/dbus.service
|
||||
|
||||
if [[ -e /usr/bin/dbus-daemon ]]; then
|
||||
inst_multiple \
|
||||
/usr/bin/dbus-daemon
|
||||
fi
|
||||
|
||||
if [[ -e /usr/bin/dbus-broker ]]; then
|
||||
inst_multiple \
|
||||
$systemdsystemunitdir/dbus-broker.service \
|
||||
/usr/bin/dbus-broker \
|
||||
/usr/bin/dbus-broker-launch
|
||||
adjust_dependencies $systemdsystemunitdir/dbus-broker.service
|
||||
fi
|
||||
|
||||
inst_dir /etc/dbus-1/system.d
|
||||
inst_dir /usr/share/dbus-1/services
|
||||
inst_dir /usr/share/dbus-1/system-services
|
||||
inst_multiple /etc/dbus-1/system.conf
|
||||
inst_multiple /usr/share/dbus-1/system.conf \
|
||||
/usr/share/dbus-1/services/org.freedesktop.systemd1.service
|
||||
inst_multiple $(find /var/lib/dbus)
|
||||
|
||||
grep '^\(d\|message\)bus:' /etc/passwd >> "$initdir/etc/passwd"
|
||||
grep '^\(d\|message\)bus:' /etc/group >> "$initdir/etc/group"
|
||||
|
||||
sed -i -e \
|
||||
'/^\[Unit\]/aDefaultDependencies=no\
|
||||
Conflicts=shutdown.target\
|
||||
Before=shutdown.target
|
||||
/^\[Socket\]/aRemoveOnStop=yes' \
|
||||
"$initdir"/usr/lib/systemd/system/dbus.socket
|
||||
|
||||
#We need to make sure that systemd-tmpfiles-setup.service->dbus.socket will not wait 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"/usr/lib/systemd/system/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/>.
|
||||
#
|
||||
|
||||
depends() {
|
||||
echo systemd
|
||||
return 0
|
||||
}
|
||||
|
||||
check() {
|
||||
# if there's no rngd binary, no go.
|
||||
require_binaries rngd || return 1
|
||||
|
||||
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
|
||||
}
|
8
modules.d/06rngd/rngd.service
Normal file
8
modules.d/06rngd/rngd.service
Normal file
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Hardware RNG Entropy Gatherer Daemon
|
||||
DefaultDependencies=no
|
||||
Before=systemd-udevd.service
|
||||
ConditionVirtualization=!container
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/rngd -f
|
@@ -8,7 +8,7 @@ fi
|
||||
|
||||
[ -e /etc/vconsole.conf ] && . /etc/vconsole.conf
|
||||
|
||||
DEFAULT_FONT=LatArCyrHeb-16
|
||||
DEFAULT_FONT=eurlatgr
|
||||
DEFAULT_KEYMAP=/etc/sysconfig/console/default.kmap
|
||||
|
||||
set_keyboard() {
|
||||
|
@@ -19,11 +19,11 @@ install() {
|
||||
if dracut_module_included "systemd"; then
|
||||
unset FONT
|
||||
unset KEYMAP
|
||||
[[ -f /etc/vconsole.conf ]] && . /etc/vconsole.conf
|
||||
[[ -f $dracutsysrootdir/etc/vconsole.conf ]] && . $dracutsysrootdir/etc/vconsole.conf
|
||||
fi
|
||||
|
||||
KBDSUBDIRS=consolefonts,consoletrans,keymaps,unimaps
|
||||
DEFAULT_FONT="${i18n_default_font:-LatArCyrHeb-16}"
|
||||
DEFAULT_FONT="${i18n_default_font:-eurlatgr}"
|
||||
I18N_CONF="/etc/locale.conf"
|
||||
VCONFIG_CONF="/etc/vconsole.conf"
|
||||
|
||||
@@ -32,11 +32,11 @@ install() {
|
||||
local MAPS=$1
|
||||
local MAPNAME=${1%.map*}
|
||||
local map
|
||||
[[ ! -f $MAPS ]] && \
|
||||
MAPS=$(find ${kbddir}/keymaps -type f -name ${MAPNAME} -o -name ${MAPNAME}.map -o -name ${MAPNAME}.map.\*)
|
||||
[[ ! -f $dracutsysrootdir$MAPS ]] && \
|
||||
MAPS=$(find $dracutsysrootdir${kbddir}/keymaps -type f -name ${MAPNAME} -o -name ${MAPNAME}.map -o -name ${MAPNAME}.map.\*)
|
||||
|
||||
for map in $MAPS; do
|
||||
KEYMAPS="$KEYMAPS $map"
|
||||
KEYMAPS="$KEYMAPS $map "
|
||||
case $map in
|
||||
*.gz) cmd=zgrep;;
|
||||
*.bz2) cmd=bzgrep;;
|
||||
@@ -44,8 +44,8 @@ install() {
|
||||
esac
|
||||
|
||||
for INCL in $($cmd "^include " $map | while read a a b || [ -n "$a" ]; do echo ${a//\"/}; done); do
|
||||
for FN in $(find ${kbddir}/keymaps -type f -name $INCL\*); do
|
||||
strstr "$KEYMAPS" "$FN" || findkeymap $FN
|
||||
for FN in $(find $dracutsysrootdir${kbddir}/keymaps -type f -name $INCL\*); do
|
||||
strstr "$KEYMAPS" " $FN " || findkeymap $FN
|
||||
done
|
||||
done
|
||||
done
|
||||
@@ -87,8 +87,8 @@ install() {
|
||||
for map in ${item[1]//,/ }
|
||||
do
|
||||
map=(${map//-/ })
|
||||
if [[ -f "${item[0]}" ]]; then
|
||||
value=$(grep "^${map[0]}=" "${item[0]}")
|
||||
if [[ -f "$dracutsysrootdir${item[0]}" ]]; then
|
||||
value=$(grep "^${map[0]}=" "$dracutsysrootdir${item[0]}")
|
||||
value=${value#*=}
|
||||
echo "${map[1]:-${map[0]}}=${value}"
|
||||
fi
|
||||
@@ -116,9 +116,10 @@ install() {
|
||||
install_all_kbd() {
|
||||
local rel f
|
||||
|
||||
for _src in $(eval echo ${kbddir}/{${KBDSUBDIRS}}); do
|
||||
for __src in $(eval echo $dracutsysrootdir${kbddir}/{${KBDSUBDIRS}}); do
|
||||
_src=${__src#$dracutsysrootdir}
|
||||
inst_dir "$_src"
|
||||
$DRACUT_CP -L -t "${initdir}/${_src}" "$_src"/*
|
||||
$DRACUT_CP -L -t "${initdir}/${_src}" "$__src"/*
|
||||
done
|
||||
|
||||
# remove unnecessary files
|
||||
@@ -139,8 +140,8 @@ install() {
|
||||
local map
|
||||
|
||||
eval $(gather_vars ${i18n_vars})
|
||||
[ -f $I18N_CONF ] && . $I18N_CONF
|
||||
[ -f $VCONFIG_CONF ] && . $VCONFIG_CONF
|
||||
[ -f $dracutsysrootdir$I18N_CONF ] && . $dracutsysrootdir$I18N_CONF
|
||||
[ -f $dracutsysrootdir$VCONFIG_CONF ] && . $dracutsysrootdir$VCONFIG_CONF
|
||||
|
||||
shopt -q -s nocasematch
|
||||
if [[ ${UNICODE} ]]
|
||||
@@ -222,16 +223,14 @@ install() {
|
||||
inst_simple ${kbddir}/unimaps/${FONT_UNIMAP}.uni
|
||||
fi
|
||||
|
||||
if dracut_module_included "systemd" && [[ -f ${I18N_CONF} ]]; then
|
||||
if dracut_module_included "systemd" && [[ -f $dracutsysrootdir${I18N_CONF} ]]; then
|
||||
inst_simple ${I18N_CONF}
|
||||
else
|
||||
mksubdirs ${initdir}${I18N_CONF}
|
||||
print_vars LC_ALL LANG >> ${initdir}${I18N_CONF}
|
||||
fi
|
||||
|
||||
if dracut_module_included "systemd" && [[ -f ${VCONFIG_CONF} ]]; then
|
||||
inst_simple ${VCONFIG_CONF}
|
||||
else
|
||||
if ! dracut_module_included "systemd"; then
|
||||
mksubdirs ${initdir}${VCONFIG_CONF}
|
||||
print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> ${initdir}${VCONFIG_CONF}
|
||||
fi
|
||||
@@ -242,16 +241,16 @@ install() {
|
||||
checks() {
|
||||
for kbddir in ${kbddir} /usr/lib/kbd /lib/kbd /usr/share /usr/share/kbd
|
||||
do
|
||||
[[ -d "${kbddir}" ]] && \
|
||||
[[ -d "$dracutsysrootdir${kbddir}" ]] && \
|
||||
for dir in ${KBDSUBDIRS//,/ }
|
||||
do
|
||||
[[ -d "${kbddir}/${dir}" ]] && continue
|
||||
[[ -d "$dracutsysrootdir${kbddir}/${dir}" ]] && continue
|
||||
false
|
||||
done && break
|
||||
kbddir=''
|
||||
done
|
||||
|
||||
[[ -f $I18N_CONF && -f $VCONFIG_CONF ]] || \
|
||||
[[ -f $dracutsysrootdir$I18N_CONF && -f $dracutsysrootdir$VCONFIG_CONF ]] || \
|
||||
[[ ! ${hostonly} || ${i18n_vars} ]] || {
|
||||
derror 'i18n_vars not set! Please set up i18n_vars in ' \
|
||||
'configuration file.'
|
||||
@@ -262,6 +261,11 @@ install() {
|
||||
if checks; then
|
||||
install_base
|
||||
|
||||
# https://github.com/dracutdevs/dracut/issues/796
|
||||
if dracut_module_included "systemd" && [[ -f $dracutsysrootdir${VCONFIG_CONF} ]]; then
|
||||
inst_simple ${VCONFIG_CONF}
|
||||
fi
|
||||
|
||||
if [[ ${hostonly} ]] && ! [[ ${i18n_install_all} == "yes" ]]; then
|
||||
install_local_i18n || install_all_kbd
|
||||
else
|
||||
|
@@ -75,8 +75,8 @@ setup_interface() {
|
||||
|
||||
setup_interface6() {
|
||||
domain=$new_domain_name
|
||||
search=$(printf -- "$new_domain_search")
|
||||
namesrv=$new_domain_name_servers
|
||||
search=$(printf -- "$new_dhcp6_domain_search")
|
||||
namesrv=$new_dhcp6_name_servers
|
||||
hostname=$new_host_name
|
||||
[ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time
|
||||
[ -n "$new_max_life" ] && lease_time=$new_max_life
|
||||
@@ -126,9 +126,11 @@ parse_option_121() {
|
||||
elif [ $mask -gt 8 ]; then
|
||||
destination="$1.$2.0.0/$mask"
|
||||
shift; shift
|
||||
else
|
||||
elif [ $mask -gt 0 ]; then
|
||||
destination="$1.0.0.0/$mask"
|
||||
shift
|
||||
else
|
||||
destination="0.0.0.0/$mask"
|
||||
fi
|
||||
|
||||
# Read the gateway
|
||||
@@ -138,13 +140,13 @@ parse_option_121() {
|
||||
# Multicast routing on Linux
|
||||
# - If you set a next-hop address for a multicast group, this breaks with Cisco switches
|
||||
# - If you simply leave it link-local and attach it to an interface, it works fine.
|
||||
if [ $multicast -eq 1 ]; then
|
||||
if [ $multicast -eq 1 -o "$gateway" = "0.0.0.0" ]; then
|
||||
temp_result="$destination dev $interface"
|
||||
else
|
||||
temp_result="$destination via $gateway dev $interface"
|
||||
fi
|
||||
|
||||
echo "/sbin/ip route add $temp_result"
|
||||
echo "/sbin/ip route replace $temp_result"
|
||||
done
|
||||
}
|
||||
|
||||
@@ -162,7 +164,7 @@ case $reason in
|
||||
;;
|
||||
|
||||
BOUND)
|
||||
echo "dhcp: BOND setting $netif"
|
||||
echo "dhcp: BOUND setting up $netif"
|
||||
unset layer2
|
||||
if [ -f /sys/class/net/$netif/device/layer2 ]; then
|
||||
read layer2 < /sys/class/net/$netif/device/layer2
|
||||
@@ -221,7 +223,7 @@ case $reason in
|
||||
;;
|
||||
|
||||
BOUND6)
|
||||
echo "dhcp: BOND6 setting $netif"
|
||||
echo "dhcp: BOUND6 setting up $netif"
|
||||
setup_interface6
|
||||
|
||||
set | while read line || [ -n "$line" ]; do
|
||||
|
@@ -50,8 +50,9 @@ do_dhcp() {
|
||||
while [ $_COUNT -lt $_DHCPRETRY ]; do
|
||||
info "Starting dhcp for interface $netif"
|
||||
dhclient "$@" \
|
||||
${_timeout:+-timeout $_timeout} \
|
||||
${_timeout:+--timeout $_timeout} \
|
||||
-q \
|
||||
-1 \
|
||||
-cf /etc/dhclient.conf \
|
||||
-pf /tmp/dhclient.$netif.pid \
|
||||
-lf /tmp/dhclient.$netif.lease \
|
||||
@@ -61,6 +62,9 @@ do_dhcp() {
|
||||
[ $_COUNT -lt $_DHCPRETRY ] && sleep 1
|
||||
done
|
||||
warn "dhcp for interface $netif failed"
|
||||
# nuke those files since we failed; we might retry dhcp again if it's e.g.
|
||||
# `ip=dhcp,dhcp6` and we check for the PID file at the top
|
||||
rm -f /tmp/dhclient.$netif.{pid,lease}
|
||||
return 1
|
||||
}
|
||||
|
||||
@@ -372,23 +376,6 @@ else
|
||||
fi
|
||||
|
||||
|
||||
# No ip lines default to dhcp
|
||||
ip=$(getarg ip)
|
||||
|
||||
if [ -z "$NO_AUTO_DHCP" ] && [ -z "$ip" ]; then
|
||||
if [ "$netroot" = "dhcp6" ]; then
|
||||
do_dhcp -6
|
||||
else
|
||||
do_dhcp -4
|
||||
fi
|
||||
|
||||
for s in $(getargs nameserver); do
|
||||
[ -n "$s" ] || continue
|
||||
echo nameserver $s >> /tmp/net.$netif.resolv.conf
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Specific configuration, spin through the kernel command line
|
||||
# looking for ip= lines
|
||||
for p in $(getargs ip=); do
|
||||
@@ -408,7 +395,11 @@ for p in $(getargs ip=); do
|
||||
esac
|
||||
|
||||
# If this option isn't directed at our interface, skip it
|
||||
[ -n "$dev" ] && [ "$dev" != "$netif" ] && continue
|
||||
if [ -n "$dev" ]; then
|
||||
[ "$dev" != "$netif" ] && continue
|
||||
else
|
||||
iface_is_enslaved "$netif" && continue
|
||||
fi
|
||||
|
||||
# Store config for later use
|
||||
for i in ip srv gw mask hostname macaddr mtu dns1 dns2; do
|
||||
@@ -445,40 +436,59 @@ for p in $(getargs ip=); do
|
||||
> /tmp/net.$(cat /sys/class/net/${netif}/address).up
|
||||
fi
|
||||
|
||||
case $autoconf in
|
||||
dhcp|on|any|dhcp6)
|
||||
;;
|
||||
*)
|
||||
if [ $ret -eq 0 ]; then
|
||||
setup_net $netif
|
||||
source_hook initqueue/online $netif
|
||||
if [ -z "$manualup" ]; then
|
||||
/sbin/netroot $netif
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
# and finally, finish interface set up if there isn't already a script
|
||||
# to do so (which is the case in the dhcp path)
|
||||
if [ ! -e $hookdir/initqueue/setup_net_$netif.sh ]; then
|
||||
setup_net $netif
|
||||
source_hook initqueue/online $netif
|
||||
if [ -z "$manualup" ]; then
|
||||
/sbin/netroot $netif
|
||||
fi
|
||||
fi
|
||||
|
||||
if command -v wicked >/dev/null && [ -z "$manualup" ]; then
|
||||
/sbin/netroot $netif
|
||||
fi
|
||||
|
||||
exit $ret
|
||||
fi
|
||||
done
|
||||
|
||||
# no ip option directed at our interface?
|
||||
if [ -z "$NO_AUTO_DHCP" ] && [ ! -e /tmp/net.${netif}.up ]; then
|
||||
ret=1
|
||||
if [ -e /tmp/net.bootdev ]; then
|
||||
BOOTDEV=$(cat /tmp/net.bootdev)
|
||||
if [ "$netif" = "$BOOTDEV" ] || [ "$BOOTDEV" = "$(cat /sys/class/net/${netif}/address)" ]; then
|
||||
load_ipv6
|
||||
do_dhcp
|
||||
ret=$?
|
||||
fi
|
||||
else
|
||||
if getargs 'ip=dhcp6'; then
|
||||
# No ip lines, no bootdev -> default to dhcp
|
||||
ip=$(getarg ip)
|
||||
|
||||
if getargs 'ip=dhcp6' || [ -z "$ip" -a "$netroot" = "dhcp6" ]; then
|
||||
load_ipv6
|
||||
do_dhcp -6
|
||||
ret=$?
|
||||
fi
|
||||
if getargs 'ip=dhcp'; then
|
||||
if getargs 'ip=dhcp' || [ -z "$ip" -a "$netroot" != "dhcp6" ]; then
|
||||
do_dhcp -4
|
||||
ret=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
for s in $(getargs nameserver); do
|
||||
[ -n "$s" ] || continue
|
||||
echo nameserver $s >> /tmp/net.$netif.resolv.conf
|
||||
done
|
||||
|
||||
if [ "$ret" -eq 0 ] && [ -n "$(ls /tmp/leaseinfo.${netif}*)" ]; then
|
||||
> /tmp/net.${netif}.did-setup
|
||||
if [ -e /sys/class/net/${netif}/address ]; then
|
||||
> /tmp/net.$(cat /sys/class/net/${netif}/address).did-setup
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
@@ -36,7 +36,6 @@ install() {
|
||||
inst_simple -H "/etc/dhclient.conf"
|
||||
cat "$moddir/dhclient.conf" >> "${initdir}/etc/dhclient.conf"
|
||||
inst_hook pre-udev 60 "$moddir/net-genrules.sh"
|
||||
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
|
||||
inst_hook cmdline 92 "$moddir/parse-ibft.sh"
|
||||
inst_hook cmdline 95 "$moddir/parse-vlan.sh"
|
||||
inst_hook cmdline 96 "$moddir/parse-bond.sh"
|
||||
@@ -83,7 +82,7 @@ install() {
|
||||
)
|
||||
done
|
||||
|
||||
_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.*"
|
||||
|
@@ -65,9 +65,9 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
|
||||
bootdev=$(cat /tmp/net.bootdev)
|
||||
fi
|
||||
|
||||
ifup='/sbin/ifup $env{INTERFACE}'
|
||||
ifup='/sbin/ifup $name'
|
||||
|
||||
runcmd="RUN+=\"/sbin/initqueue --name ifup-\$env{INTERFACE} --unique --onetime $ifup\""
|
||||
runcmd="RUN+=\"/sbin/initqueue --name ifup-\$name --unique --onetime $ifup\""
|
||||
|
||||
# We have some specific interfaces to handle
|
||||
if [ -n "${RAW_IFACES}${IFACES}" ]; then
|
||||
@@ -96,7 +96,11 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
|
||||
|
||||
for iface in $IFACES; do
|
||||
if [ "$bootdev" = "$iface" ] || [ "$NEEDNET" = "1" ]; then
|
||||
echo "[ -f /tmp/net.${iface}.did-setup ]" >$hookdir/initqueue/finished/wait-$iface.sh
|
||||
if [ -n "$netroot" ] && [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
echo "systemctl is-active initrd-root-device.target || [ -f /tmp/net.${iface}.did-setup ]"
|
||||
else
|
||||
echo "[ -f /tmp/net.${iface}.did-setup ]"
|
||||
fi >$hookdir/initqueue/finished/wait-$iface.sh
|
||||
fi
|
||||
done
|
||||
# Default: We don't know the interface to use, handle all
|
||||
|
@@ -1,9 +1,12 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Format:
|
||||
# team=<teammaster>:<teamslaves>
|
||||
# team=<teammaster>:<teamslaves>[:<teamrunner>]
|
||||
#
|
||||
# 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
|
||||
#
|
||||
|
||||
parseteam() {
|
||||
@@ -15,8 +18,11 @@ parseteam() {
|
||||
done
|
||||
|
||||
case $# in
|
||||
2) teammaster=$1; teamslaves=$(str_replace "$2" "," " ") ;;
|
||||
*) die "team= requires two parameters" ;;
|
||||
0) teammaster=team0; teamslaves="eth0 eth1"; teamrunner="activebackup" ;;
|
||||
1) teammaster=$1; teamslaves="eth0 eth1"; teamrunner="activebackup" ;;
|
||||
2) teammaster=$1; teamslaves=$(str_replace "$2" "," " "); teamrunner="activebackup" ;;
|
||||
3) teammaster=$1; teamslaves=$(str_replace "$2" "," " "); teamrunner=$3 ;;
|
||||
*) die "team= requires zero to three parameters" ;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
@@ -26,16 +32,18 @@ for team in $(getargs team); do
|
||||
|
||||
unset teammaster
|
||||
unset teamslaves
|
||||
unset teamrunner
|
||||
|
||||
parseteam "$team" || continue
|
||||
|
||||
echo "teammaster=$teammaster" > /tmp/team.${teammaster}.info
|
||||
echo "teamslaves=\"$teamslaves\"" >> /tmp/team.${teammaster}.info
|
||||
echo "teamrunner=\"$teamrunner\"" >> /tmp/team.${teammaster}.info
|
||||
|
||||
if ! [ -e /etc/teamd/${teammaster}.conf ]; then
|
||||
warn "Team master $teammaster specified, but no /etc/teamd/$teammaster.conf present. Using activebackup."
|
||||
warn "Team master $teammaster specified, but no /etc/teamd/$teammaster.conf present. Using $teamrunner."
|
||||
mkdir -p /etc/teamd
|
||||
printf -- "%s" '{"runner": {"name": "activebackup"}, "link_watch": {"name": "ethtool"}}' > "/etc/teamd/${teammaster}.conf"
|
||||
printf -- "%s" "{\"runner\": {\"name\": \"$teamrunner\"}, \"link_watch\": {\"name\": \"ethtool\"}}" > "/tmp/${teammaster}.conf"
|
||||
fi
|
||||
done
|
||||
|
||||
|
@@ -26,7 +26,9 @@ install() {
|
||||
|
||||
_nm_version=$(NetworkManager --version)
|
||||
|
||||
inst_multiple sed grep
|
||||
# We don't need `ip` but having it is *really* useful for people debugging
|
||||
# in an emergency shell.
|
||||
inst_multiple ip sed grep
|
||||
|
||||
inst NetworkManager
|
||||
inst /usr/libexec/nm-initrd-generator
|
||||
@@ -35,6 +37,7 @@ install() {
|
||||
inst_hook initqueue/settled 99 "$moddir/nm-run.sh"
|
||||
inst_rules 85-nm-unmanaged.rules
|
||||
inst_libdir_file "NetworkManager/$_nm_version/libnm-device-plugin-team.so"
|
||||
inst_simple "$moddir/nm-lib.sh" "/lib/nm-lib.sh"
|
||||
|
||||
if [[ -x "$initdir/usr/sbin/dhclient" ]]; then
|
||||
inst /usr/libexec/nm-dhcp-helper
|
||||
@@ -45,8 +48,11 @@ install() {
|
||||
fi
|
||||
|
||||
# We don't install the ifcfg files from the host automatically.
|
||||
# But if the user chooses to include them, we pull in the machinery to read them.
|
||||
if ! [[ -d "$initdir/etc/sysconfig/network-scripts" ]]; then
|
||||
inst_libdir_file "NetworkManager/$_nm_version/libnm-settings-plugin-ifcfg-rh.so"
|
||||
fi
|
||||
# But the user might choose to include them, so we pull in the machinery to read them.
|
||||
inst_libdir_file "NetworkManager/$_nm_version/libnm-settings-plugin-ifcfg-rh.so"
|
||||
|
||||
_arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
|
||||
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
|
||||
{"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*"
|
||||
}
|
||||
|
@@ -1,3 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
/usr/libexec/nm-initrd-generator -- $(getcmdline)
|
||||
type nm_generate_connections >/dev/null 2>&1 || . /lib/nm-lib.sh
|
||||
|
||||
if [ -n "$netroot" ] || [ -e /tmp/net.ifaces ]; then
|
||||
echo rd.neednet >> /etc/cmdline.d/35-neednet.conf
|
||||
fi
|
||||
|
||||
nm_generate_connections
|
||||
|
20
modules.d/35network-manager/nm-lib.sh
Normal file
20
modules.d/35network-manager/nm-lib.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
type getcmdline >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
nm_generate_connections()
|
||||
{
|
||||
rm -f /run/NetworkManager/system-connections/*
|
||||
/usr/libexec/nm-initrd-generator -- $(getcmdline)
|
||||
|
||||
if getargbool 0 rd.neednet; then
|
||||
for i in /usr/lib/NetworkManager/system-connections/* \
|
||||
/run/NetworkManager/system-connections/* \
|
||||
/etc/NetworkManager/system-connections/* \
|
||||
/etc/sysconfig/network-scripts/ifcfg-*; do
|
||||
[ -f "$i" ] || continue
|
||||
echo '[ -f /tmp/nm.done ]' >$hookdir/initqueue/finished/nm.sh
|
||||
break
|
||||
done
|
||||
fi
|
||||
}
|
@@ -1,16 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
if getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then
|
||||
/usr/sbin/NetworkManager --configure-and-quit=initrd --debug --log-level=trace
|
||||
else
|
||||
/usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon
|
||||
fi
|
||||
for i in /usr/lib/NetworkManager/system-connections/* \
|
||||
/run/NetworkManager/system-connections/* \
|
||||
/etc/NetworkManager/system-connections/* \
|
||||
/etc/sysconfig/network-scripts/ifcfg-*; do
|
||||
[ -f "$i" ] || continue
|
||||
if getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then
|
||||
/usr/sbin/NetworkManager --configure-and-quit=initrd --debug --log-level=trace
|
||||
else
|
||||
/usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon
|
||||
fi
|
||||
|
||||
for _i in /sys/class/net/*/
|
||||
if [ -s /run/NetworkManager/initrd/hostname ]; then
|
||||
cat /run/NetworkManager/initrd/hostname > /proc/sys/kernel/hostname
|
||||
fi
|
||||
break
|
||||
done
|
||||
|
||||
for _i in /sys/class/net/*
|
||||
do
|
||||
state=/run/NetworkManager/devices/$(cat $_i/ifindex)
|
||||
grep -q managed=true $state 2>/dev/null || continue
|
||||
ifname=$(basename $_i)
|
||||
sed -n 's/root-path/new_root_path/p' <$state >/tmp/dhclient.$ifname.dhcpopts
|
||||
grep -q connection-uuid= $state 2>/dev/null || continue
|
||||
ifname=${_i##*/}
|
||||
sed -n 's/root-path/new_root_path/p;s/next-server/new_next_server/p' <$state >/tmp/dhclient.$ifname.dhcpopts
|
||||
source_hook initqueue/online $ifname
|
||||
/sbin/netroot $ifname
|
||||
done
|
||||
|
||||
> /tmp/nm.done
|
||||
|
66
modules.d/35network-wicked/module-setup.sh
Executable file
66
modules.d/35network-wicked/module-setup.sh
Executable file
@@ -0,0 +1,66 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
local _program
|
||||
|
||||
require_binaries wicked || return 1
|
||||
|
||||
# do not add this module by default
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo systemd dbus
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_hook cmdline 99 "$moddir/wicked-config.sh"
|
||||
|
||||
# Seems to not execute if in initqueue/settled
|
||||
inst_hook pre-udev 99 "$moddir/wicked-run.sh"
|
||||
|
||||
# even with wicked configuring the interface, ip is useful
|
||||
inst_multiple ip
|
||||
|
||||
inst_dir /etc/wicked/extensions
|
||||
inst_dir /usr/share/wicked/schema
|
||||
inst_dir /usr/lib/wicked/bin
|
||||
inst_dir /var/lib/wicked
|
||||
|
||||
inst_multiple /etc/wicked/*.xml
|
||||
inst_multiple /etc/wicked/extensions/*
|
||||
inst_multiple /etc/dbus-1/system.d/org.opensuse.Network*
|
||||
inst_multiple /usr/share/wicked/schema/*
|
||||
inst_multiple /usr/lib/wicked/bin/*
|
||||
inst_multiple /usr/libexec/wicked/bin/*
|
||||
inst_multiple /usr/sbin/wicked*
|
||||
|
||||
wicked_units="
|
||||
$systemdsystemunitdir/wickedd.service \
|
||||
$systemdsystemunitdir/wickedd-auto4.service \
|
||||
$systemdsystemunitdir/wickedd-dhcp4.service \
|
||||
$systemdsystemunitdir/wickedd-dhcp6.service \
|
||||
$systemdsystemunitdir/wickedd-nanny.service"
|
||||
|
||||
inst_multiple $wicked_units
|
||||
|
||||
for unit in $wicked_units; do
|
||||
sed -i 's/^After=.*/After=dbus.service/g' $initdir/$unit
|
||||
sed -i 's/^Before=\(.*\)/Before=\1 dracut-pre-udev.service/g' $initdir/$unit
|
||||
sed -i 's/^Wants=\(.*\)/Wants=\1 dbus.service/g' $initdir/$unit
|
||||
sed -i -e \
|
||||
'/^\[Unit\]/aDefaultDependencies=no\
|
||||
Conflicts=shutdown.target\
|
||||
Before=shutdown.target' \
|
||||
"$initdir"$unit
|
||||
done
|
||||
}
|
5
modules.d/35network-wicked/wicked-config.sh
Executable file
5
modules.d/35network-wicked/wicked-config.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
getcmdline > /tmp/cmdline.$$.conf
|
||||
wicked show-config --ifconfig dracut:cmdline:/tmp/cmdline.$$.conf > /tmp/dracut.xml
|
||||
rm -f /tmp/cmdline.$$.conf
|
6
modules.d/35network-wicked/wicked-run.sh
Executable file
6
modules.d/35network-wicked/wicked-run.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# ensure wickedd is running
|
||||
systemctl start wickedd
|
||||
# detection wrapper around ifup --ifconfig "final xml" all
|
||||
wicked bootstrap --ifconfig /tmp/dracut.xml all
|
@@ -1,13 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo -n "kernel-network-modules "
|
||||
if ! dracut_module_included "network-legacy" && [ -x "/usr/libexec/nm-initrd-generator" ] ; then
|
||||
echo "network-manager"
|
||||
else
|
||||
echo "network-legacy"
|
||||
fi
|
||||
is_qemu_virtualized && echo -n "qemu-net "
|
||||
|
||||
for module in network-wicked network-manager network-legacy ; do
|
||||
if dracut_module_included "$module" ; then
|
||||
network_handler="$module"
|
||||
break
|
||||
fi
|
||||
done;
|
||||
|
||||
if [ -z "$network_handler" ]; then
|
||||
if require_binaries wicked; then
|
||||
network_handler="network-wicked"
|
||||
elif [ -x "$dracutsysrootdir/usr/libexec/nm-initrd-generator" ]; then
|
||||
network_handler="network-manager"
|
||||
else
|
||||
network_handler="network-legacy"
|
||||
fi
|
||||
fi
|
||||
echo "kernel-network-modules $network_handler"
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -23,6 +41,7 @@ install() {
|
||||
inst_script "$moddir/netroot.sh" "/sbin/netroot"
|
||||
inst_simple "$moddir/net-lib.sh" "/lib/net-lib.sh"
|
||||
inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
|
||||
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
|
||||
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
@@ -14,20 +14,20 @@ is_ip() {
|
||||
|
||||
get_ip() {
|
||||
local iface="$1" ip=""
|
||||
ip=$(ip -o -f inet addr show $iface)
|
||||
ip=$(ip -f inet addr show $iface)
|
||||
ip=${ip%%/*}
|
||||
ip=${ip##* }
|
||||
echo $ip
|
||||
}
|
||||
|
||||
iface_for_remote_addr() {
|
||||
set -- $(ip -o route get to $1)
|
||||
echo $5
|
||||
set -- $(ip route get to $1 | sed 's/.*\bdev\b//p;q')
|
||||
echo $1
|
||||
}
|
||||
|
||||
iface_for_ip() {
|
||||
set -- $(ip -o addr show to $1)
|
||||
echo $2
|
||||
set -- $(ip addr show to $1)
|
||||
echo ${2%:}
|
||||
}
|
||||
|
||||
iface_for_mac() {
|
||||
@@ -129,7 +129,7 @@ setup_net() {
|
||||
for _p in $(getargs rd.route); do
|
||||
route_to_var "$_p" || continue
|
||||
[ -n "$route_dev" ] && [ "$route_dev" != "$netif" ] && continue
|
||||
ip route add "$route_mask" ${route_gw:+via "$route_gw"} ${route_dev:+dev "$route_dev"}
|
||||
ip route add "$route_mask" ${route_gw:+via $route_gw} ${route_dev:+dev $route_dev}
|
||||
if strstr "$route_mask" ":"; then
|
||||
printf -- "%s\n" "$route_mask ${route_gw:+via $route_gw} ${route_dev:+dev $route_dev}" \
|
||||
> /tmp/net.route6."$netif"
|
||||
@@ -251,8 +251,10 @@ ibft_to_cmdline() {
|
||||
[ -e ${iface}/flags ] && flags=$(read a < ${iface}/flags; echo $a)
|
||||
# Skip invalid interfaces
|
||||
(( $flags & 1 )) || continue
|
||||
# Skip interfaces not used for booting
|
||||
(( $flags & 2 )) || continue
|
||||
# Skip interfaces not used for booting unless using multipath
|
||||
if ! getargbool 0 rd.iscsi.mp ; then
|
||||
(( $flags & 2 )) || continue
|
||||
fi
|
||||
[ -e ${iface}/dhcp ] && dhcp=$(read a < ${iface}/dhcp; echo $a)
|
||||
[ -e ${iface}/origin ] && origin=$(read a < ${iface}/origin; echo $a)
|
||||
[ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a)
|
||||
@@ -463,7 +465,7 @@ ip_to_var() {
|
||||
# ip=<ipv4-address> means anaconda-style static config argument cluster
|
||||
autoconf="$1"
|
||||
|
||||
if strstr "$autoconf" "*.*.*.*"; then
|
||||
if strglob "$autoconf" "*.*.*.*"; then
|
||||
# ip=<ipv4-address> means anaconda-style static config argument cluster:
|
||||
# ip=<ip> gateway=<gw> netmask=<nm> hostname=<host> mtu=<mtu>
|
||||
# ksdevice={link|bootif|ibft|<MAC>|<ifname>}
|
||||
@@ -508,7 +510,7 @@ ip_to_var() {
|
||||
[ -n "$6" ] && dev=$6
|
||||
[ -n "$7" ] && autoconf=$7
|
||||
case "$8" in
|
||||
[0-9]*:*|[0-9]*.[0-9]*.[0-9]*.[0-9]*)
|
||||
[0-9a-fA-F]*:*|[0-9]*.[0-9]*.[0-9]*.[0-9]*)
|
||||
dns1="$8"
|
||||
[ -n "$9" ] && dns2="$9"
|
||||
;;
|
||||
@@ -568,6 +570,11 @@ parse_ifname_opts() {
|
||||
# udev requires MAC addresses to be lower case
|
||||
ifname_mac=$(echo $2:$3:$4:$5:$6:$7 | sed 'y/ABCDEF/abcdef/')
|
||||
;;
|
||||
21)
|
||||
ifname_if=$1
|
||||
# udev requires MAC addresses to be lower case
|
||||
ifname_mac=$(echo $2:$3:$4:$5:$6:$7:$8:$9:${10}:${11}:${12}:${13}:${14}:${15}:${16}:${17}:${18}:${19}:${20}:${21} | sed 'y/ABCDEF/abcdef/')
|
||||
;;
|
||||
*)
|
||||
die "Invalid arguments for ifname="
|
||||
;;
|
||||
@@ -593,7 +600,7 @@ wait_for_if_link() {
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
li=$(ip -o link show dev $1 2>/dev/null)
|
||||
li=$(ip link show dev $1 2>/dev/null)
|
||||
[ -n "$li" ] && return 0
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
@@ -609,7 +616,7 @@ wait_for_if_up() {
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
li=$(ip -o link show up dev $1)
|
||||
li=$(ip link show up dev $1)
|
||||
if [ -n "$li" ]; then
|
||||
case "$li" in
|
||||
*\<UP*)
|
||||
@@ -653,8 +660,8 @@ wait_for_ipv6_dad_link() {
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
[ -z "$(ip -6 addr show dev "$1" scope link tentative)" ] \
|
||||
&& [ -n "$(ip -6 route list proto ra dev "$1" | grep ^default)" ] \
|
||||
[ -n "$(ip -6 addr show dev "$1" scope link)" ] \
|
||||
&& [ -z "$(ip -6 addr show dev "$1" scope link tentative)" ] \
|
||||
&& return 0
|
||||
[ -n "$(ip -6 addr show dev "$1" scope link dadfailed)" ] \
|
||||
&& return 1
|
||||
@@ -671,7 +678,8 @@ wait_for_ipv6_dad() {
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
[ -z "$(ip -6 addr show dev "$1" tentative)" ] \
|
||||
[ -n "$(ip -6 addr show dev "$1")" ] \
|
||||
&& [ -z "$(ip -6 addr show dev "$1" tentative)" ] \
|
||||
&& [ -n "$(ip -6 route list proto ra dev "$1" | grep ^default)" ] \
|
||||
&& return 0
|
||||
[ -n "$(ip -6 addr show dev "$1" dadfailed)" ] \
|
||||
@@ -716,17 +724,17 @@ iface_has_carrier() {
|
||||
interface="/sys/class/net/$interface"
|
||||
[ -d "$interface" ] || return 2
|
||||
local timeout="$(getargs rd.net.timeout.carrier=)"
|
||||
timeout=${timeout:-5}
|
||||
timeout=${timeout:-10}
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
linkup "$1"
|
||||
|
||||
li=$(ip -o link show up dev $1)
|
||||
li=$(ip link show up dev $1)
|
||||
strstr "$li" "NO-CARRIER" && _no_carrier_flag=1
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
if [ -n "$_no_carrier_flag" ]; then
|
||||
li=$(ip -o link show up dev $1)
|
||||
li=$(ip link show up dev $1)
|
||||
# NO-CARRIER flag was cleared
|
||||
strstr "$li" "NO-CARRIER" || return 0
|
||||
elif ! [ -e "$interface/carrier" ]; then
|
||||
@@ -745,6 +753,13 @@ iface_has_link() {
|
||||
iface_has_carrier "$@"
|
||||
}
|
||||
|
||||
iface_is_enslaved() {
|
||||
local _li
|
||||
_li=$(ip link show dev $1)
|
||||
strstr "$_li" " master " || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
find_iface_with_link() {
|
||||
local iface_path="" iface=""
|
||||
for iface_path in /sys/class/net/*; do
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
[[ -d /etc/sysconfig/network-scripts ]] && return 0
|
||||
[[ -d $dracutsysrootdir/etc/sysconfig/network-scripts ]] && return 0
|
||||
return 255
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_binary sort
|
||||
inst_binary awk
|
||||
inst_hook pre-pivot 85 "$moddir/write-ifcfg.sh"
|
||||
}
|
||||
|
||||
|
@@ -270,7 +270,7 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
done
|
||||
fi
|
||||
i=1
|
||||
for ns in $(getargs nameserver); do
|
||||
for ns in $(getargs nameserver) $dns1 $dns2; do
|
||||
echo "DNS${i}=\"${ns}\"" >> /tmp/ifcfg/ifcfg-$netif
|
||||
i=$((i+1))
|
||||
done
|
||||
@@ -288,7 +288,7 @@ echo "files /var/lib/dhclient" >> /run/initramfs/rwtab
|
||||
cp /tmp/net.* /run/initramfs/
|
||||
for i in /tmp/net.*.resolv.conf; do
|
||||
[ -f "$i" ] && cat "$i"
|
||||
done | sort -u > /run/initramfs/state/etc/resolv.conf
|
||||
done | awk '!($0 in a) { a[$0]; print }' > /run/initramfs/state/etc/resolv.conf
|
||||
[ -s /run/initramfs/state/etc/resolv.conf ] || rm -f /run/initramfs/state/etc/resolv.conf
|
||||
copytree /tmp/ifcfg /run/initramfs/state/etc/sysconfig/network-scripts
|
||||
cp /tmp/ifcfg-leases/* /run/initramfs/state/var/lib/dhclient
|
||||
|
@@ -19,21 +19,23 @@ install() {
|
||||
inst_simple "$moddir/url-lib.sh" "/lib/url-lib.sh"
|
||||
inst_multiple -o ctorrent
|
||||
inst_multiple curl
|
||||
# also install libs for curl https
|
||||
inst_libdir_file "libnsspem.so*"
|
||||
inst_libdir_file "libnsssysinit.so*"
|
||||
inst_libdir_file "libsoftokn3.so*"
|
||||
inst_libdir_file "libsqlite3.so*"
|
||||
if curl --version | grep -qi '\bNSS\b'; then
|
||||
# also install libs for curl https
|
||||
inst_libdir_file "libnsspem.so*"
|
||||
inst_libdir_file "libnsssysinit.so*"
|
||||
inst_libdir_file "libsoftokn3.so*"
|
||||
inst_libdir_file "libsqlite3.so*"
|
||||
fi
|
||||
|
||||
for _dir in $libdirs; do
|
||||
[[ -d $_dir ]] || continue
|
||||
for _lib in $_dir/libcurl.so.*; do
|
||||
[[ -d $dracutsysrootdir$_dir ]] || continue
|
||||
for _lib in $dracutsysrootdir$_dir/libcurl.so.*; do
|
||||
[[ -e $_lib ]] || continue
|
||||
[[ $_nssckbi ]] || _nssckbi=$(grep -F --binary-files=text -z libnssckbi $_lib)
|
||||
_crt=$(grep -F --binary-files=text -z .crt $_lib)
|
||||
[[ $_crt ]] || continue
|
||||
[[ $_crt == /*/* ]] || continue
|
||||
if ! inst "$_crt"; then
|
||||
if ! inst "${_crt#$dracutsysrootdir}"; then
|
||||
dwarn "Couldn't install '$_crt' SSL CA cert bundle; HTTPS might not work."
|
||||
continue
|
||||
fi
|
||||
@@ -49,23 +51,23 @@ install() {
|
||||
_found=1
|
||||
inst_libdir_file "libnssckbi.so*" || _found=
|
||||
for _dir in $libdirs; do
|
||||
[[ -e $_dir/libnssckbi.so ]] || continue
|
||||
[[ -e $dracutsysrootdir$_dir/libnssckbi.so ]] || continue
|
||||
# this looks for directory-ish strings in the file
|
||||
for _p11roots in $(grep -o --binary-files=text "/[[:alpha:]][[:print:]]*" $_dir/libnssckbi.so) ; do
|
||||
for _p11roots in $(grep -o --binary-files=text "/[[:alpha:]][[:print:]]*" $dracutsysrootdir$_dir/libnssckbi.so) ; do
|
||||
# the string can be a :-separated list of dirs
|
||||
for _p11root in $(echo "$_p11roots" | tr ':' '\n') ; do
|
||||
# check if it's actually a directory (there are
|
||||
# several false positives in the results)
|
||||
[[ -d "$_p11root" ]] || continue
|
||||
[[ -d "$dracutsysrootdir$_p11root" ]] || continue
|
||||
# check if it has some specific subdirs that all
|
||||
# p11-kit trust dirs have
|
||||
[[ -d "${_p11root}/anchors" ]] || continue
|
||||
[[ -d "${_p11root}/blacklist" ]] || continue
|
||||
[[ -d "$dracutsysrootdir${_p11root}/anchors" ]] || continue
|
||||
[[ -d "$dracutsysrootdir${_p11root}/blacklist" ]] || continue
|
||||
# so now we know it's really a p11-kit trust dir;
|
||||
# install everything in it
|
||||
for _p11item in $(find "$_p11root") ; do
|
||||
if ! inst "$_p11item" ; then
|
||||
dwarn "Couldn't install '$_p11item' from p11-kit trust dir '$_p11root'; HTTPS might not work."
|
||||
for _p11item in $(find "$dracutsysrootdir$_p11root") ; do
|
||||
if ! inst "${_p11item#$dracutsysrootdir}" ; then
|
||||
dwarn "Couldn't install '${_p11item#$dracutsysrootdir}' from p11-kit trust dir '${_p11root#$dracutsysrootdir}'; HTTPS might not work."
|
||||
continue
|
||||
fi
|
||||
done
|
||||
|
@@ -15,7 +15,7 @@ installkernel() {
|
||||
local _modname
|
||||
# Include KMS capable drm drivers
|
||||
|
||||
if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]]; then
|
||||
if [[ "${DRACUT_ARCH:-$(uname -m)}" == arm* || "${DRACUT_ARCH:-$(uname -m)}" == aarch64 ]]; then
|
||||
# arm/aarch64 specific modules needed by drm
|
||||
instmods \
|
||||
"=drivers/gpu/drm/i2c" \
|
||||
@@ -31,15 +31,15 @@ installkernel() {
|
||||
# as we could e.g. be in the installer; nokmsboot boot parameter will disable
|
||||
# loading of the driver if needed
|
||||
if [[ $hostonly ]]; then
|
||||
for i in /sys/bus/{pci/devices,virtio/devices,soc/devices/soc?}/*/modalias; do
|
||||
for i in /sys/bus/{pci/devices,platform/devices,virtio/devices,soc/devices/soc?}/*/modalias; do
|
||||
[[ -e $i ]] || continue
|
||||
if hostonly="" dracut_instmods --silent -s "drm_crtc_init" -S "iw_handler_get_spy" $(<$i); then
|
||||
if strstr "$(modinfo -F filename $(<$i) 2>/dev/null)" radeon.ko; then
|
||||
if hostonly="" dracut_instmods --silent -s "drm_crtc_init|drm_dev_register|drm_encoder_init" -S "iw_handler_get_spy" $(<"$i"); then
|
||||
if strstr "$(modinfo -F filename $(<"$i") 2>/dev/null)" radeon.ko; then
|
||||
hostonly='' instmods amdkfd
|
||||
fi
|
||||
fi
|
||||
done
|
||||
else
|
||||
dracut_instmods -o -s "drm_crtc_init" "=drivers/gpu/drm" "=drivers/staging"
|
||||
dracut_instmods -o -s "drm_crtc_init|drm_dev_register|drm_encoder_init" "=drivers/gpu/drm" "=drivers/staging"
|
||||
fi
|
||||
}
|
||||
|
@@ -52,7 +52,7 @@ install() {
|
||||
_splash_res=${DRACUT_GENSPLASH_RES}
|
||||
elif [[ ${hostonly} ]]; then
|
||||
# Settings from config only in hostonly
|
||||
[[ -e /etc/conf.d/splash ]] && source /etc/conf.d/splash
|
||||
[[ -e $dracutsysrootdir/etc/conf.d/splash ]] && source $dracutsysrootdir/etc/conf.d/splash
|
||||
[[ ! ${_splash_theme} ]] && _splash_theme=default
|
||||
[[ ${_splash_res} ]] && _opts+=" -r ${_splash_res}"
|
||||
else
|
||||
|
@@ -6,7 +6,7 @@ pkglib_dir() {
|
||||
_dirs+=" /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/plymouth"
|
||||
fi
|
||||
for _dir in $_dirs; do
|
||||
if [ -x $_dir/plymouth-populate-initrd ]; then
|
||||
if [ -x $dracutsysrootdir$_dir/plymouth-populate-initrd ]; then
|
||||
echo $_dir
|
||||
return
|
||||
fi
|
||||
@@ -29,12 +29,12 @@ depends() {
|
||||
# called by dracut
|
||||
install() {
|
||||
PKGLIBDIR=$(pkglib_dir)
|
||||
if grep -q nash ${PKGLIBDIR}/plymouth-populate-initrd \
|
||||
|| [ ! -x ${PKGLIBDIR}/plymouth-populate-initrd ]; then
|
||||
if grep -q nash $dracutsysrootdir${PKGLIBDIR}/plymouth-populate-initrd \
|
||||
|| [ ! -x $dracutsysrootdir${PKGLIBDIR}/plymouth-populate-initrd ]; then
|
||||
. "$moddir"/plymouth-populate-initrd.sh
|
||||
else
|
||||
PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \
|
||||
${PKGLIBDIR}/plymouth-populate-initrd -t "$initdir"
|
||||
$dracutsysrootdir${PKGLIBDIR}/plymouth-populate-initrd -t "$initdir"
|
||||
fi
|
||||
|
||||
inst_hook emergency 50 "$moddir"/plymouth-emergency.sh
|
||||
|
@@ -17,25 +17,25 @@ if [[ $hostonly ]]; then
|
||||
"/usr/share/plymouth/themes/details/details.plymouth" \
|
||||
"/usr/share/plymouth/themes/text/text.plymouth" \
|
||||
|
||||
if [[ -d /usr/share/plymouth/themes/${PLYMOUTH_THEME} ]]; then
|
||||
if [[ -d $dracutsysrootdir/usr/share/plymouth/themes/${PLYMOUTH_THEME} ]]; then
|
||||
for x in "/usr/share/plymouth/themes/${PLYMOUTH_THEME}"/* ; do
|
||||
[[ -f "$x" ]] || break
|
||||
[[ -f "$dracutsysrootdir$x" ]] || break
|
||||
inst $x
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -L /usr/share/plymouth/themes/default.plymouth ]; then
|
||||
if [ -L $dracutsysrootdir/usr/share/plymouth/themes/default.plymouth ]; then
|
||||
inst /usr/share/plymouth/themes/default.plymouth
|
||||
# Install plugin for this theme
|
||||
PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth | while read a b c || [ -n "$b" ]; do echo $b; done;)
|
||||
PLYMOUTH_PLUGIN=$(grep "^ModuleName=" $dracutsysrootdir/usr/share/plymouth/themes/default.plymouth | while read a b c || [ -n "$b" ]; do echo $b; done;)
|
||||
inst_libdir_file "plymouth/${PLYMOUTH_PLUGIN}.so"
|
||||
fi
|
||||
else
|
||||
for x in /usr/share/plymouth/themes/{text,details}/* ; do
|
||||
for x in $dracutsysrootdir/usr/share/plymouth/themes/{text,details}/* ; do
|
||||
[[ -f "$x" ]] || continue
|
||||
THEME_DIR=$(dirname "$x")
|
||||
THEME_DIR=$(dirname "${x#$dracutsysrootdir}")
|
||||
mkdir -m 0755 -p "${initdir}/$THEME_DIR"
|
||||
inst_multiple "$x"
|
||||
inst_multiple "${x#$dracutsysrootdir}"
|
||||
done
|
||||
(
|
||||
cd ${initdir}/usr/share/plymouth/themes;
|
||||
|
@@ -35,4 +35,9 @@ fi
|
||||
IFACES="$IFACES $DEVICE"
|
||||
echo "$IFACES" >> /tmp/net.ifaces
|
||||
|
||||
exec ifup "$DEVICE"
|
||||
if [ -x /usr/libexec/nm-initrd-generator ]; then
|
||||
type nm_generate_connections >/dev/null 2>&1 || . /lib/nm-lib.sh
|
||||
nm_generate_connections
|
||||
else
|
||||
exec ifup "$DEVICE"
|
||||
fi
|
||||
|
@@ -164,11 +164,11 @@ processcmsfile()
|
||||
driver=$NETTYPE
|
||||
fi
|
||||
|
||||
printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="%s", KERNELS=="%s", ENV{INTERFACE}=="?*", RUN+="/sbin/initqueue --onetime --unique --name cmsifup-$env{INTERFACE} /sbin/cmsifup $env{INTERFACE}"\n' "$driver" "$devbusid" > /etc/udev/rules.d/99-cms.rules
|
||||
printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="%s", KERNELS=="%s", ENV{INTERFACE}=="?*", RUN+="/sbin/initqueue --onetime --unique --name cmsifup-$name /sbin/cmsifup $name"\n' "$driver" "$devbusid" > /etc/udev/rules.d/99-cms.rules
|
||||
# remove the default net rules
|
||||
rm -f -- /etc/udev/rules.d/91-default-net.rules
|
||||
[[ -f /etc/udev/rules.d/90-net.rules ]] \
|
||||
|| printf 'SUBSYSTEM=="net", ACTION=="online", RUN+="/sbin/initqueue --onetime --env netif=$env{INTERFACE} source_hook initqueue/online"\n' >> /etc/udev/rules.d/99-cms.rules
|
||||
|| printf 'SUBSYSTEM=="net", ACTION=="online", RUN+="/sbin/initqueue --onetime --env netif=$name source_hook initqueue/online"\n' >> /etc/udev/rules.d/99-cms.rules
|
||||
udevadm control --reload
|
||||
znet_cio_free
|
||||
fi
|
||||
|
@@ -2,14 +2,14 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
arch=$(uname -m)
|
||||
arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
arch=$(uname -m)
|
||||
arch=${DRACUT_ARCH:-$(uname -m)}
|
||||
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
|
||||
echo znet zfcp dasd dasd_mod
|
||||
return 0
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user