Compare commits
523 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
4e8505f200 | ||
![]() |
fb280834d7 | ||
![]() |
a6bc200c28 | ||
![]() |
79a17b0112 | ||
![]() |
76522d58c3 | ||
![]() |
01ffcf342a | ||
![]() |
05dc158e3c | ||
![]() |
a60af53413 | ||
![]() |
f18d069d46 | ||
![]() |
48c283a296 | ||
![]() |
0eef73ea43 | ||
![]() |
765b20333d | ||
![]() |
b38b7fef36 | ||
![]() |
7117bf6270 | ||
![]() |
e54ab383f7 | ||
![]() |
b9af0fcdfb | ||
![]() |
83cbc06ab9 | ||
![]() |
db4d6bb42c | ||
![]() |
f51ab4a81f | ||
![]() |
6d886bb74d | ||
![]() |
225e4b94cb | ||
![]() |
3e676eb12f | ||
![]() |
2257b800ac | ||
![]() |
290df2e1de | ||
![]() |
4be697e5c1 | ||
![]() |
08bdadbf31 | ||
![]() |
734739187b | ||
![]() |
1c4a51c39c | ||
![]() |
0aa2e5f728 | ||
![]() |
5e615f4eb4 | ||
![]() |
9e82732dd4 | ||
![]() |
0454dc247a | ||
![]() |
24f3463bff | ||
![]() |
095e1f37c4 | ||
![]() |
f4334e9bdf | ||
![]() |
838f22259a | ||
![]() |
b3480d31b0 | ||
![]() |
8dd7bb48fc | ||
![]() |
44d1688164 | ||
![]() |
a7d8fc280c | ||
![]() |
e9a84e0a21 | ||
![]() |
d09218823c | ||
![]() |
ae9bc0d72f | ||
![]() |
09ba1b289f | ||
![]() |
9f3c31cd8d | ||
![]() |
eb18a1fe29 | ||
![]() |
789668deb3 | ||
![]() |
e791d753be | ||
![]() |
e0e6d96d69 | ||
![]() |
ee18dd2b88 | ||
![]() |
09132c732a | ||
![]() |
f19063ac71 | ||
![]() |
a17440713a | ||
![]() |
bd03d374b7 | ||
![]() |
06e12e4ba8 | ||
![]() |
f059ce7682 | ||
![]() |
286685cb72 | ||
![]() |
7c62555bcf | ||
![]() |
2699d8ff7e | ||
![]() |
5a8f1aef55 | ||
![]() |
9c034dc326 | ||
![]() |
f8cad00948 | ||
![]() |
c128b969bb | ||
![]() |
f59664a01f | ||
![]() |
67f43d2124 | ||
![]() |
0ae5848245 | ||
![]() |
9f02b291ac | ||
![]() |
2b77ba0b75 | ||
![]() |
6f90be2971 | ||
![]() |
110063c585 | ||
![]() |
51d0a54555 | ||
![]() |
c31a80c9ed | ||
![]() |
79afb279c2 | ||
![]() |
3c8d3a6565 | ||
![]() |
01f9d0d9bf | ||
![]() |
3111988680 | ||
![]() |
1ebbe2eb7b | ||
![]() |
65d16d1914 | ||
![]() |
da5a44cfb7 | ||
![]() |
75b8b144a1 | ||
![]() |
1363167d65 | ||
![]() |
d15c15c8f5 | ||
![]() |
9288d21b9f | ||
![]() |
cafe6675c2 | ||
![]() |
fba4d28433 | ||
![]() |
b7774da97c | ||
![]() |
3c1a083e5c | ||
![]() |
0f294d90b2 | ||
![]() |
a2dbecfcd6 | ||
![]() |
604c09b1da | ||
![]() |
f9c8b3112a | ||
![]() |
bb75d16521 | ||
![]() |
ca8f1c1ba3 | ||
![]() |
94cc856cb8 | ||
![]() |
827a5b1a80 | ||
![]() |
393da0c370 | ||
![]() |
82fe4ea0a5 | ||
![]() |
ffbd37d784 | ||
![]() |
ab94a204e0 | ||
![]() |
6058b06b86 | ||
![]() |
26aea0299a | ||
![]() |
0a80cda0ea | ||
![]() |
6f0500ed4a | ||
![]() |
746135dd1e | ||
![]() |
a762dedb60 | ||
![]() |
a0c915b1e4 | ||
![]() |
99df3d22be | ||
![]() |
be98291caf | ||
![]() |
33782aebbf | ||
![]() |
55a12055c5 | ||
![]() |
25111d717e | ||
![]() |
819ea38651 | ||
![]() |
143420bc05 | ||
![]() |
986b12d391 | ||
![]() |
f81c864eed | ||
![]() |
aac3a0652a | ||
![]() |
a0eadcdc64 | ||
![]() |
e331e06a39 | ||
![]() |
7047294617 | ||
![]() |
1caaeaae1e | ||
![]() |
d63a4e285e | ||
![]() |
9a9c67d61b | ||
![]() |
bc01f822de | ||
![]() |
f265cb67dc | ||
![]() |
f98d3066d9 | ||
![]() |
9d1b81c0d1 | ||
![]() |
e3fb645821 | ||
![]() |
8f77326479 | ||
![]() |
ca77afdeb3 | ||
![]() |
35e86ac117 | ||
![]() |
058ff2f06d | ||
![]() |
efecf0a95e | ||
![]() |
c574c3f565 | ||
![]() |
61ac90fefa | ||
![]() |
432647c278 | ||
![]() |
a695250ec7 | ||
![]() |
6ccb58a5b6 | ||
![]() |
7d0848957c | ||
![]() |
6b7ffedf0d | ||
![]() |
b31f3fe0d1 | ||
![]() |
c1688560ad | ||
![]() |
4cdee66c8e | ||
![]() |
e0ec6f10d4 | ||
![]() |
f4947f8793 | ||
![]() |
ba26c59523 | ||
![]() |
cec0d04112 | ||
![]() |
f4d34357c0 | ||
![]() |
eed91294f8 | ||
![]() |
a73ba9a8ef | ||
![]() |
4f55387829 | ||
![]() |
bca1967c90 | ||
![]() |
d00cfc2a7b | ||
![]() |
e0758c8168 | ||
![]() |
1b72c97cc5 | ||
![]() |
c1c78f8a91 | ||
![]() |
935dd5746a | ||
![]() |
67354eebbc | ||
![]() |
f6e777ec4b | ||
![]() |
df6bb5e959 | ||
![]() |
08e11e30e3 | ||
![]() |
731b37e929 | ||
![]() |
8ad3215590 | ||
![]() |
b2a024991f | ||
![]() |
bfa4e45fa7 | ||
![]() |
c9b5165daa | ||
![]() |
740e41b843 | ||
![]() |
3161dea8e1 | ||
![]() |
cae0004dbe | ||
![]() |
3c8a69677b | ||
![]() |
c4f8329cc2 | ||
![]() |
654484b82b | ||
![]() |
ccaf52901f | ||
![]() |
384eeedd2d | ||
![]() |
65cfabf7a6 | ||
![]() |
2b5192c18d | ||
![]() |
fe6c7e0f06 | ||
![]() |
3c3b2cf093 | ||
![]() |
1f50d5b86d | ||
![]() |
0bb9a683d4 | ||
![]() |
d23f32dd4b | ||
![]() |
ebfd53e1d9 | ||
![]() |
f8c24964cd | ||
![]() |
f8e0c7cc62 | ||
![]() |
3aa37cafde | ||
![]() |
b39b8452d2 | ||
![]() |
48723f28aa | ||
![]() |
3ed33db54a | ||
![]() |
0a68b6a518 | ||
![]() |
7b3f374a82 | ||
![]() |
8ae8652edd | ||
![]() |
5283544cc7 | ||
![]() |
e64dafd1f2 | ||
![]() |
1779aee72c | ||
![]() |
94f61235d7 | ||
![]() |
643be55570 | ||
![]() |
f0094476fd | ||
![]() |
ed2cc8c9b9 | ||
![]() |
421b46f8ae | ||
![]() |
c88c3215e8 | ||
![]() |
f48fb6f4ce | ||
![]() |
cb02ff635c | ||
![]() |
a1c1be4f3e | ||
![]() |
6c7776e344 | ||
![]() |
d7e3bf7abd | ||
![]() |
b25ef46f93 | ||
![]() |
cbb9a4e955 | ||
![]() |
dfbd8f74fd | ||
![]() |
8379784a0e | ||
![]() |
a54206722d | ||
![]() |
83b19de168 | ||
![]() |
9d651355a1 | ||
![]() |
b6054b5de6 | ||
![]() |
308c4066fe | ||
![]() |
bff3ee1936 | ||
![]() |
d842d5cf9e | ||
![]() |
7bb8083562 | ||
![]() |
2a0da60ed1 | ||
![]() |
bce6823a19 | ||
![]() |
33b560fcc2 | ||
![]() |
885b4a17d4 | ||
![]() |
a07b1bb6bb | ||
![]() |
9ed6eb741f | ||
![]() |
b925f7f5d9 | ||
![]() |
637fb76291 | ||
![]() |
8b4b7dc5b2 | ||
![]() |
cc3808184c | ||
![]() |
d888e21b5d | ||
![]() |
5cc17c25c2 | ||
![]() |
2bb4881b82 | ||
![]() |
28a68f1f3c | ||
![]() |
b7a7ab1943 | ||
![]() |
52d19cb161 | ||
![]() |
4c3688d355 | ||
![]() |
8e7d0856d0 | ||
![]() |
6ccb77e19a | ||
![]() |
47f83419a7 | ||
![]() |
c42c387cca | ||
![]() |
b8b341a07f | ||
![]() |
f3e09bf1cb | ||
![]() |
3a6a8d5c83 | ||
![]() |
cd83391c72 | ||
![]() |
0f6d93eb9d | ||
![]() |
33260dac6e | ||
![]() |
8bae047a4e | ||
![]() |
d118e9d940 | ||
![]() |
403f2c3e1d | ||
![]() |
73f89bbadb | ||
![]() |
ea7ffef13e | ||
![]() |
7bc681fd88 | ||
![]() |
d43cccf588 | ||
![]() |
5a8efed021 | ||
![]() |
17414dd01b | ||
![]() |
965cacd43a | ||
![]() |
ba2cfcab1e | ||
![]() |
1f8a7ae799 | ||
![]() |
577f109243 | ||
![]() |
dcacd2b072 | ||
![]() |
d300160e70 | ||
![]() |
c9d207467c | ||
![]() |
68cbbae33a | ||
![]() |
03214e51ae | ||
![]() |
bc4ce61efc | ||
![]() |
d818986db4 | ||
![]() |
8134db6c33 | ||
![]() |
8c3e65d1ce | ||
![]() |
51d2436c22 | ||
![]() |
29a9e92999 | ||
![]() |
de576db3c2 | ||
![]() |
a187bc3ca5 | ||
![]() |
598660bbe6 | ||
![]() |
39ee4fdfbd | ||
![]() |
10f06425a5 | ||
![]() |
d53bb5c017 | ||
![]() |
164760f4b0 | ||
![]() |
fd13d5d4d5 | ||
![]() |
36a8b2e305 | ||
![]() |
4e3eb1e9d1 | ||
![]() |
a3f91db476 | ||
![]() |
2aac319410 | ||
![]() |
43634c2469 | ||
![]() |
8f5c564cb3 | ||
![]() |
07e413bd0f | ||
![]() |
63755f4db8 | ||
![]() |
2d3273f96f | ||
![]() |
a45651c193 | ||
![]() |
12930f30a1 | ||
![]() |
1619e731f7 | ||
![]() |
84912dde41 | ||
![]() |
dfbbb0baf5 | ||
![]() |
c0f2b6bebc | ||
![]() |
8f4f40cb3c | ||
![]() |
fa54381b4e | ||
![]() |
ffbe0373e2 | ||
![]() |
649619f6a5 | ||
![]() |
72f5a098e9 | ||
![]() |
8602e59867 | ||
![]() |
f5c10673de | ||
![]() |
22836a0921 | ||
![]() |
6f1b5c0dab | ||
![]() |
871378aad4 | ||
![]() |
870591acec | ||
![]() |
07e6357483 | ||
![]() |
251afd36b2 | ||
![]() |
8008d47faf | ||
![]() |
af99264a36 | ||
![]() |
239e8ba2ac | ||
![]() |
8d20322f11 | ||
![]() |
d12ce1da85 | ||
![]() |
51f4ab300d | ||
![]() |
9fd3e045d5 | ||
![]() |
c75196e11e | ||
![]() |
d71c9ee286 | ||
![]() |
d066fcc3fb | ||
![]() |
6b96b50d2c | ||
![]() |
611b8ae0d7 | ||
![]() |
fb9970ba2d | ||
![]() |
6b7dca1631 | ||
![]() |
9f2916cce1 | ||
![]() |
df96cccc8f | ||
![]() |
19453dc874 | ||
![]() |
3dbf1f0783 | ||
![]() |
215fe58324 | ||
![]() |
94d09135a7 | ||
![]() |
cd0305cee0 | ||
![]() |
69acd20d4e | ||
![]() |
825730780a | ||
![]() |
2bdce3d461 | ||
![]() |
b36d322bd2 | ||
![]() |
e6199960d9 | ||
![]() |
84fe3c1a20 | ||
![]() |
96d69bbf34 | ||
![]() |
ee6b44342b | ||
![]() |
a13e97e511 | ||
![]() |
1ec2e34adc | ||
![]() |
11b3d60f5c | ||
![]() |
b1e1b6cba3 | ||
![]() |
18a5011ff2 | ||
![]() |
f9042fd839 | ||
![]() |
38ff9dfbe5 | ||
![]() |
28aea41829 | ||
![]() |
d976e19325 | ||
![]() |
9408a2ac33 | ||
![]() |
ed9281d6d1 | ||
![]() |
e190224345 | ||
![]() |
21789cbb0a | ||
![]() |
1751bacda1 | ||
![]() |
4b758ebe22 | ||
![]() |
82651e9ef3 | ||
![]() |
6bc8fbda61 | ||
![]() |
faabcb2360 | ||
![]() |
1df4538662 | ||
![]() |
2c9bcac113 | ||
![]() |
04fa949877 | ||
![]() |
791d801689 | ||
![]() |
8c2aa6161a | ||
![]() |
4c2d98c75b | ||
![]() |
b69ce65bf4 | ||
![]() |
4e3833f6a2 | ||
![]() |
0d947530b2 | ||
![]() |
bf5c53a33f | ||
![]() |
bada26263c | ||
![]() |
7c9e64272e | ||
![]() |
32618b456e | ||
![]() |
28401778c4 | ||
![]() |
b7058d0ce5 | ||
![]() |
795256bbb1 | ||
![]() |
d0eabcab43 | ||
![]() |
4d60324757 | ||
![]() |
ef84ce2521 | ||
![]() |
da97807ccc | ||
![]() |
7dbadcc749 | ||
![]() |
79926486a0 | ||
![]() |
424c065cd9 | ||
![]() |
1499719d25 | ||
![]() |
d000b9a2c7 | ||
![]() |
afe4e2844f | ||
![]() |
15d00459c3 | ||
![]() |
bd93e9287d | ||
![]() |
721bec3f14 | ||
![]() |
5634a31156 | ||
![]() |
37f2fe55d1 | ||
![]() |
e5d6018783 | ||
![]() |
348935e3b6 | ||
![]() |
3bd3ef5819 | ||
![]() |
00f3525a30 | ||
![]() |
0344c2be13 | ||
![]() |
a0799ffb55 | ||
![]() |
65f78f3d74 | ||
![]() |
2b909b9a4b | ||
![]() |
ed25fb0e91 | ||
![]() |
c2408eed7f | ||
![]() |
1792759721 | ||
![]() |
e316ae0e43 | ||
![]() |
5abd692fe4 | ||
![]() |
1279a9e1a0 | ||
![]() |
0baf5a3e99 | ||
![]() |
bdf0f9ce32 | ||
![]() |
ae989390a1 | ||
![]() |
81269979e6 | ||
![]() |
39018c93c2 | ||
![]() |
f496af50b7 | ||
![]() |
c427603cd1 | ||
![]() |
e2b877a18b | ||
![]() |
690b24f02f | ||
![]() |
98663fcaac | ||
![]() |
8523ec50c2 | ||
![]() |
af6eee79e3 | ||
![]() |
9fd0461b7d | ||
![]() |
66a3d4053b | ||
![]() |
b1ae591945 | ||
![]() |
017978f868 | ||
![]() |
2187b3d097 | ||
![]() |
c75ce02775 | ||
![]() |
f24d205537 | ||
![]() |
85ed04e0cf | ||
![]() |
c0371761fb | ||
![]() |
2ceb910a73 | ||
![]() |
72c084918a | ||
![]() |
ad3b209d40 | ||
![]() |
1a95f1f4fc | ||
![]() |
ef025dcbbe | ||
![]() |
d23b0efc1a | ||
![]() |
1bfa75b015 | ||
![]() |
dd75a946db | ||
![]() |
e95a3c36ed | ||
![]() |
400a85ffaf | ||
![]() |
9388d99361 | ||
![]() |
5a532aa83f | ||
![]() |
9cd4edb445 | ||
![]() |
a1d92d8ace | ||
![]() |
fac3e9d975 | ||
![]() |
9b8e6e40a9 | ||
![]() |
a430c3f7a6 | ||
![]() |
e7b343138f | ||
![]() |
4011b48c42 | ||
![]() |
295194ee42 | ||
![]() |
76dd870bfd | ||
![]() |
3e7498ea03 | ||
![]() |
62b7920ed1 | ||
![]() |
5ce7cc7337 | ||
![]() |
d84f4687c3 | ||
![]() |
db17ef6c4f | ||
![]() |
3ad12c7be8 | ||
![]() |
26264af7f5 | ||
![]() |
37437cac8a | ||
![]() |
106255afd4 | ||
![]() |
c1699b59c6 | ||
![]() |
add1ea88d2 | ||
![]() |
3d875f77f3 | ||
![]() |
44302d6f28 | ||
![]() |
38e9d6249a | ||
![]() |
0a50111ab3 | ||
![]() |
937cc53ecb | ||
![]() |
343c74311b | ||
![]() |
c3b6970394 | ||
![]() |
9bf5f989ee | ||
![]() |
940169e8d8 | ||
![]() |
337a55eb2d | ||
![]() |
c8aa1d949a | ||
![]() |
5f923256e3 | ||
![]() |
5e7bbe43a3 | ||
![]() |
3a8ba44026 | ||
![]() |
e0c3b0793f | ||
![]() |
8b0791fa01 | ||
![]() |
e5bf1cecd6 | ||
![]() |
cf9c8c5fe3 | ||
![]() |
05bf320972 | ||
![]() |
2600b54c18 | ||
![]() |
bd355f8643 | ||
![]() |
1362641310 | ||
![]() |
e5d21b80c0 | ||
![]() |
5d1ea2d726 | ||
![]() |
856d039ba4 | ||
![]() |
55c763b1ff | ||
![]() |
c8e531239b | ||
![]() |
624f173cbd | ||
![]() |
9be4be7aa7 | ||
![]() |
bbca3891ed | ||
![]() |
a0d129e33e | ||
![]() |
0c4c9792c8 | ||
![]() |
6ed9975c5a | ||
![]() |
73e30ea106 | ||
![]() |
e3189ab123 | ||
![]() |
cf9a4e0c73 | ||
![]() |
08e51654bf | ||
![]() |
63c7b358f5 | ||
![]() |
70ce5ea256 | ||
![]() |
a0e3794b2a | ||
![]() |
fd24c90c36 | ||
![]() |
1856ae95c8 | ||
![]() |
b71d162a7a | ||
![]() |
3cea065819 | ||
![]() |
87ddd4d9af | ||
![]() |
1e00295a15 | ||
![]() |
b40585e6c7 | ||
![]() |
feaaee4278 | ||
![]() |
892b1fe6b7 | ||
![]() |
2e1861fde2 | ||
![]() |
ab66ef2d4a | ||
![]() |
cc4e507322 | ||
![]() |
29fd71b23d | ||
![]() |
bc6f06a795 | ||
![]() |
7cf2c21798 | ||
![]() |
11947da13f | ||
![]() |
f59548aeab | ||
![]() |
fafb4c0182 | ||
![]() |
0096157e14 | ||
![]() |
9998940493 | ||
![]() |
538ff0fd80 | ||
![]() |
8b6d136e62 | ||
![]() |
ea765c0ee1 | ||
![]() |
e190073b21 | ||
![]() |
ce999bff98 | ||
![]() |
031e2f7bb8 | ||
![]() |
a0545765e8 | ||
![]() |
96b708e178 | ||
![]() |
4c3d99f966 | ||
![]() |
c603419030 | ||
![]() |
0e1b686b83 | ||
![]() |
0982fcb2e5 | ||
![]() |
98047e08d0 | ||
![]() |
2a1723ed83 | ||
![]() |
ccf948f2ab |
15
.mailmap
15
.mailmap
@@ -4,6 +4,7 @@ Philippe Seewer <philippe.seewer@bfh.ch> <philippe.seewer@bfh.ch>
|
||||
Victor Lowther <victor.lowther@gmail.com> <victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
|
||||
Harald Hoyer <harald@redhat.com> <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
|
||||
Harald Hoyer <harald@redhat.com> <harald@eeepc.(none)>
|
||||
Harald Hoyer <harald@redhat.com> <harald@hoyer.xyz>
|
||||
Mike Snitzer <snitzer@redhat.com> <msnitzer@redhat.com>
|
||||
Amerigo Wang <amwang@redhat.com> <xiyou.wangcong@gmail.com>
|
||||
Andrey Borzenkov <arvidjaar@gmail.com> <arvidjaar@mail.ru>
|
||||
@@ -16,3 +17,17 @@ Frederick Grose <fgrose@sugarlabs.org> <fgrose@gmail.com>
|
||||
Frederic Crozat <fcrozat@suse.com> <fcrozat@mandriva.com>
|
||||
Shawn W Dunn <sfalken@opensuse.org> <sfalken@opensuse.org>
|
||||
Kyle McMartin <kmcmarti@redhat.com> <kyle@redhat.com>
|
||||
Angelo "pallotron" Failla <pallotron@fb.com> <pallotron@fb.com>
|
||||
Yu Watanabe <watanabe.yu+github@gmail.com>
|
||||
Martin Wilck <mwilck@suse.de> <mwilck@suse.com>
|
||||
Thomas Renninger <trenn@suse.com> <trenn@suse.de>
|
||||
Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Daniel Drake <drake@endlessm.com> <dsd@laptop.org>
|
||||
Fabian Vogt <fvogt@suse.com>
|
||||
Hannes Reinecke <hare@suse.com> <hare@suse.de>
|
||||
Julian Wolf <juwolf@suse.com> <juwolf@suse.de>
|
||||
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>
|
||||
|
47
.travis.yml
Normal file
47
.travis.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
language: generic
|
||||
sudo: required
|
||||
services:
|
||||
- docker
|
||||
env:
|
||||
matrix:
|
||||
- IMAGE=latest
|
||||
- IMAGE=latest TESTS=01
|
||||
- IMAGE=latest TESTS=12
|
||||
- IMAGE=latest TESTS=20
|
||||
- IMAGE=latest TESTS=50
|
||||
- IMAGE=latest TESTS=30
|
||||
- IMAGE=latest TESTS=31
|
||||
- IMAGE=latest TESTS=70
|
||||
- IMAGE=latest TESTS=99
|
||||
- IMAGE=latest TESTS=02
|
||||
- IMAGE=latest TESTS=03
|
||||
- IMAGE=latest TESTS=04
|
||||
- IMAGE=latest TESTS=10
|
||||
- IMAGE=latest TESTS=11
|
||||
- IMAGE=latest TESTS=13
|
||||
- IMAGE=latest TESTS=14
|
||||
- IMAGE=latest TESTS=15
|
||||
- IMAGE=latest TESTS=17
|
||||
|
||||
before_script:
|
||||
- docker pull fedora:$IMAGE
|
||||
- |
|
||||
sudo modprobe kvm-intel nested=1 || :
|
||||
sudo modprobe kvm-amd nested=1 || :
|
||||
dmesg | tail || :
|
||||
- git pull --depth=100
|
||||
- |
|
||||
git describe --abbrev=0 --tags || :
|
||||
git describe --tags || :
|
||||
|
||||
script:
|
||||
- docker run --privileged -it -v $(pwd)/:/dracut fedora:$IMAGE /dracut/fedora-test.sh $IMAGE-$$ "$TESTS"
|
||||
|
||||
notifications:
|
||||
webhooks:
|
||||
urls:
|
||||
- https://webhooks.gitter.im/e/effa917ca3e0ed5fd00e
|
||||
on_success: change # options: [always|never|change] default: always
|
||||
on_failure: always # options: [always|never|change] default: always
|
||||
on_start: never # options: [always|never|change] default: always
|
||||
|
@@ -5,6 +5,19 @@ KERNEL_VERSION="$2"
|
||||
BOOT_DIR_ABS="$3"
|
||||
KERNEL_IMAGE="$4"
|
||||
|
||||
# If KERNEL_INSTALL_MACHINE_ID is defined but empty, BOOT_DIR_ABS is a fake directory.
|
||||
# So, let's skip to create initrd.
|
||||
if ! [[ ${KERNEL_INSTALL_MACHINE_ID-x} ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ -d "$BOOT_DIR_ABS" ]]; then
|
||||
INITRD="initrd"
|
||||
else
|
||||
BOOT_DIR_ABS="/boot"
|
||||
INITRD="initramfs-${KERNEL_VERSION}.img"
|
||||
fi
|
||||
|
||||
ret=0
|
||||
case "$COMMAND" in
|
||||
add)
|
||||
@@ -12,9 +25,9 @@ case "$COMMAND" in
|
||||
if [[ -f ${INITRD_IMAGE_PREGENERATED} ]]; then
|
||||
# we found an initrd at the same place as the kernel
|
||||
# use this and don't generate a new one
|
||||
cp --reflink=auto "$INITRD_IMAGE_PREGENERATED" "$BOOT_DIR_ABS/initrd" \
|
||||
&& chown root:root "$BOOT_DIR_ABS/initrd" \
|
||||
&& chmod 0600 "$BOOT_DIR_ABS/initrd" \
|
||||
cp --reflink=auto "$INITRD_IMAGE_PREGENERATED" "$BOOT_DIR_ABS/$INITRD" \
|
||||
&& chown root:root "$BOOT_DIR_ABS/$INITRD" \
|
||||
&& chmod 0600 "$BOOT_DIR_ABS/$INITRD" \
|
||||
&& exit 0
|
||||
fi
|
||||
|
||||
@@ -36,11 +49,11 @@ 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)
|
||||
rm -f -- "$BOOT_DIR_ABS"/initrd
|
||||
rm -f -- "$BOOT_DIR_ABS/$INITRD"
|
||||
ret=$?
|
||||
;;
|
||||
esac
|
||||
|
@@ -33,11 +33,15 @@ dropindirs_sort()
|
||||
|
||||
[[ -f /etc/os-release ]] && . /etc/os-release
|
||||
|
||||
if [[ ! -f /etc/machine-id ]] || [[ ! -s /etc/machine-id ]]; then
|
||||
systemd-machine-id-setup
|
||||
if [[ ${KERNEL_INSTALL_MACHINE_ID+x} ]]; then
|
||||
MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
|
||||
elif [[ -f /etc/machine-id ]] ; then
|
||||
read MACHINE_ID < /etc/machine-id
|
||||
fi
|
||||
|
||||
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||||
if ! [[ $MACHINE_ID ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ -f /etc/kernel/cmdline ]]; then
|
||||
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
|
||||
@@ -59,15 +63,26 @@ if ! [[ ${BOOT_OPTIONS[*]} ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BOOT_DIR="/${MACHINE_ID}/0-rescue"
|
||||
BOOT_ROOT=${BOOT_DIR_ABS%$BOOT_DIR}
|
||||
LOADER_ENTRY="$BOOT_ROOT/loader/entries/${MACHINE_ID}-0-rescue.conf"
|
||||
if [[ -d "${BOOT_DIR_ABS%/*}" ]]; then
|
||||
BOOT_DIR="/${MACHINE_ID}/0-rescue"
|
||||
BOOT_ROOT=${BOOT_DIR_ABS%$BOOT_DIR}
|
||||
LOADER_ENTRY="$BOOT_ROOT/loader/entries/${MACHINE_ID}-0-rescue.conf"
|
||||
KERNEL="linux"
|
||||
INITRD="initrd"
|
||||
else
|
||||
BLS_DIR="/boot/loader/entries"
|
||||
BOOT_DIR_ABS="/boot"
|
||||
LOADER_ENTRY="$BLS_DIR/${MACHINE_ID}-0-rescue.conf"
|
||||
KERNEL="vmlinuz-0-rescue-${MACHINE_ID}"
|
||||
INITRD="initramfs-0-rescue-${MACHINE_ID}.img"
|
||||
fi
|
||||
|
||||
ret=0
|
||||
|
||||
case "$COMMAND" in
|
||||
add)
|
||||
[[ -f "$LOADER_ENTRY" ]] && exit 0
|
||||
[[ -f "$LOADER_ENTRY" ]] && [[ -f "$BOOT_DIR_ABS/$KERNEL" ]] \
|
||||
&& [[ -f "$BOOT_DIR_ABS/$INITRD" ]] && exit 0
|
||||
|
||||
# source our config dir
|
||||
for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do
|
||||
@@ -78,21 +93,29 @@ case "$COMMAND" in
|
||||
|
||||
[[ -d "$BOOT_DIR_ABS" ]] || mkdir -p "$BOOT_DIR_ABS"
|
||||
|
||||
if ! cp --reflink=auto "$KERNEL_IMAGE" "$BOOT_DIR_ABS"/linux; then
|
||||
echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/linux'!" >&2
|
||||
if ! cp --reflink=auto "$KERNEL_IMAGE" "$BOOT_DIR_ABS/$KERNEL"; then
|
||||
echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/$KERNEL'!" >&2
|
||||
fi
|
||||
|
||||
dracut --no-hostonly -a "rescue" "$BOOT_DIR_ABS"/initrd "$KERNEL_VERSION"
|
||||
((ret+=$?))
|
||||
if [[ ! -f "$BOOT_DIR_ABS/$INITRD" ]]; then
|
||||
dracut -f --no-hostonly -a "rescue" "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION"
|
||||
((ret+=$?))
|
||||
fi
|
||||
|
||||
if [[ "${BOOT_DIR_ABS}" != "/boot" ]]; then
|
||||
{
|
||||
echo "title $PRETTY_NAME - Rescue Image"
|
||||
echo "version $KERNEL_VERSION"
|
||||
echo "machine-id $MACHINE_ID"
|
||||
echo "options ${BOOT_OPTIONS[@]} rd.auto=1"
|
||||
echo "linux $BOOT_DIR/linux"
|
||||
echo "initrd $BOOT_DIR/initrd"
|
||||
} > $LOADER_ENTRY
|
||||
else
|
||||
cp -aT "${KERNEL_IMAGE%/*}/bls.conf" $LOADER_ENTRY
|
||||
sed -i 's/'$KERNEL_VERSION'/0-rescue-'${MACHINE_ID}'/' $LOADER_ENTRY
|
||||
fi
|
||||
|
||||
{
|
||||
echo "title $PRETTY_NAME - Rescue Image"
|
||||
echo "version $KERNEL_VERSION"
|
||||
echo "machine-id $MACHINE_ID"
|
||||
echo "options ${BOOT_OPTIONS[@]} rd.auto=1"
|
||||
echo "linux $BOOT_DIR/linux"
|
||||
echo "initrd $BOOT_DIR/initrd"
|
||||
} > $LOADER_ENTRY
|
||||
((ret+=$?))
|
||||
;;
|
||||
|
||||
@@ -105,6 +128,4 @@ case "$COMMAND" in
|
||||
ret=1;;
|
||||
esac
|
||||
|
||||
((ret+=$?))
|
||||
|
||||
exit $ret
|
||||
|
111
AUTHORS
111
AUTHORS
@@ -1,44 +1,53 @@
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
Victor Lowther <victor.lowther@gmail.com>
|
||||
Amadeusz Żołnowski <aidecoe@aidecoe.name>
|
||||
Hannes Reinecke <hare@suse.com>
|
||||
Will Woods <wwoods@redhat.com>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Dave Young <dyoung@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Hannes Reinecke <hare@suse.de>
|
||||
Michal Soltys <soltys@ziu.info>
|
||||
Colin Guthrie <colin@mageia.org>
|
||||
Daniel Molkentin <dmolkentin@suse.com>
|
||||
Amerigo Wang <amwang@redhat.com>
|
||||
Thomas Renninger <trenn@suse.de>
|
||||
WANG Chao <chaowang@redhat.com>
|
||||
Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
Thomas Renninger <trenn@suse.com>
|
||||
Lukas Nykryn <lnykryn@redhat.com>
|
||||
Alexander Tsoy <alexander@tsoy.me>
|
||||
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>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Frederick Grose <fgrose@sugarlabs.org>
|
||||
Peter Robinson <pbrobinson@fedoraproject.org>
|
||||
Fabian Vogt <fvogt@suse.com>
|
||||
Kairui Song <kasong@redhat.com>
|
||||
John Reiser <jreiser@bitwagon.com>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
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 <dsd@laptop.org>
|
||||
Peter Robinson <pbrobinson@gmail.com>
|
||||
Ville Skyttä <ville.skytta@iki.fi>
|
||||
Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Dan Horák <dhorak@redhat.com>
|
||||
Daniel Molkentin <dmolkentin@suse.com>
|
||||
Baoquan He <bhe@redhat.com>
|
||||
Brendan Germain <brendan.germain@nasdaqomx.com>
|
||||
Leho Kraav <leho@kraav.com>
|
||||
Xunlei Pang <xlpang@redhat.com>
|
||||
Colin Walters <walters@verbum.org>
|
||||
Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Leho Kraav <leho@kraav.com>
|
||||
Moritz Maxeiner <moritz@ucworks.org>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
Ondrej Mosnacek <omosnace@redhat.com>
|
||||
Fabian Deutsch <fabiand@fedoraproject.org>
|
||||
Javier Martinez Canillas <javierm@redhat.com>
|
||||
Kamil Rytarowski <n54@gmx.com>
|
||||
Lukas Nykryn <lnykryn@redhat.com>
|
||||
Lidong Zhong <lidong.zhong@suse.com>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
NeilBrown <neilb@suse.de>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Radek Vykydal <rvykydal@redhat.com>
|
||||
Thorsten Behrens <tbehrens@suse.com>
|
||||
@@ -46,10 +55,13 @@ Chao Wang <chaowang@redhat.com>
|
||||
Frederic Crozat <fcrozat@suse.com>
|
||||
James Lee <jlee@thestaticvoid.com>
|
||||
Jesse Keating <jkeating@redhat.com>
|
||||
Martin Wilck <mwilck@suse.de>
|
||||
Mike Gilbert <floppym@gentoo.org>
|
||||
Milan Broz <mbroz@redhat.com>
|
||||
Mimi Zohar <zohar@linux.vnet.ibm.com>
|
||||
Roberto Sassu <roberto.sassu@polito.it>
|
||||
Stefan Reimer <it@startux.de>
|
||||
Adam Williamson <awilliam@redhat.com>
|
||||
Anton Blanchard <anton@samba.org>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Chapman Flack <g2@anastigmatix.net>
|
||||
@@ -60,19 +72,22 @@ Jan Synacek <jsynacek@redhat.com>
|
||||
Jon Ander Hernandez <jonan.h@gmail.com>
|
||||
Juan RP <xtraeme@gmail.com>
|
||||
Lance Albertson <lance@osuosl.org>
|
||||
Lidong Zhong <lzhong@suse.com>
|
||||
Marcos Mello <marcosfrm@gmail.com>
|
||||
Marian Ganisin <mganisin@redhat.com>
|
||||
Matthias Gerstner <matthias.gerstner@suse.de>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Mike Gilbert <floppym@gentoo.org>
|
||||
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>
|
||||
Vasiliy Tolstov <v.tolstov@selfip.ru>
|
||||
Wim Muskee <wimmuskee@gmail.com>
|
||||
yuwata <watanabe.yu+github@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 Kahn Gillmor <dkg@fifthhorseman.net>
|
||||
@@ -81,90 +96,106 @@ Denis Silakov <dsilakov@virtuozzo.com>
|
||||
Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
|
||||
Erwan Velu <erwan.velu@enovance.com>
|
||||
Evgeny Vereshchagin <evvers@ya.ru>
|
||||
Fabian Vogt <fvogt@suse.com>
|
||||
Guido Trentalancia <guido@trentalancia.net>
|
||||
Hari Bathini <hbathini@linux.vnet.ibm.com>
|
||||
Ian Dall <ian@beware.dropbear.id.au>
|
||||
Imran Haider <imran1008@gmail.com>
|
||||
James Buren <ryuo@frugalware.org>
|
||||
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>
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
Lukas Wunner <lukas@wunner.de>
|
||||
Mike Snitzer <snitzer@redhat.com>
|
||||
Minfei Huang <mhuang@redhat.com>
|
||||
Moritz Maxeiner <moritz@ucworks.org>
|
||||
Nikoli <nikoli@gmx.us>
|
||||
Pingfan Liu <piliu@redhat.com>
|
||||
Przemysław Rudy <prudy1@o2.pl>
|
||||
Robert LeBlanc <robert@leblancnet.us>
|
||||
Robert Scheck <robert@fedoraproject.org>
|
||||
Stefan Berger <stefanb@us.ibm.com>
|
||||
Thomas Backlund <tmb@mageia.org>
|
||||
Thomas Lange <lange@informatik.uni-koeln.de>
|
||||
Till Maas <opensource@till.name>
|
||||
Tony Asleson <tasleson@redhat.com>
|
||||
Vivek Goyal <vgoyal@redhat.com>
|
||||
Vladislav Bogdanov <bubble@hoster-ok.com>
|
||||
Yu Watanabe <watanabe.yu+github@gmail.com>
|
||||
pallotron <pallotron@fb.com>
|
||||
Adam Williamson <awilliam@redhat.com>
|
||||
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
|
||||
Alexander Kurtz <alexander@kurtz.be>
|
||||
Alexander Todorov <atodorov@redhat.com>
|
||||
Andreas Stieger <astieger@suse.com>
|
||||
Andrei Borzenkov <arvidjaar@gmail.com>
|
||||
Andy Lutomirski <luto@mit.edu>
|
||||
Anssi Hannula <anssi@mageia.org>
|
||||
Artem Savkov <asavkov@redhat.com>
|
||||
B. Wilson <x@wilsonb.com>
|
||||
Brandon Philips <brandon@ifup.co>
|
||||
Bryn M. Reeves <bmr@redhat.com>
|
||||
Canek Peláez Valdés <caneko@gmail.com>
|
||||
Carlo Caione <carlo@endlessm.com>
|
||||
Chad Dupuis <chad.dupuis@cavium.com>
|
||||
Christian Heinz <christian.ch.heinz@gmail.com>
|
||||
Christian Rodrigues <crrodriguez@opensuse.org>
|
||||
Cong Wang <amwang@redhat.com>
|
||||
Dan Fuhry <dfuhry@datto.com>
|
||||
Daniel Drake <drake@endlessm.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
David Disseldorp <ddiss@suse.de>
|
||||
David Michael <david.michael@coreos.com>
|
||||
Dennis Schridde <devurandom@gmx.net>
|
||||
Derek Higgins <derekh@redhat.com>
|
||||
Duane Griffin <duaneg@dghda.com>
|
||||
Elan Ruusamäe <glen@delfi.ee>
|
||||
Fabian <fvogt@suse.com>
|
||||
Enno Boland <g@s01.de>
|
||||
Eugene Syromiatnikov <esyr@redhat.com>
|
||||
Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
|
||||
Florian Gamböck <mail@floga.de>
|
||||
François Cami <fcami@fedoraproject.org>
|
||||
Gerd von Egidy <gerd.von.egidy@intra2net.com>
|
||||
Glen Gray <slaine@slaine.org>
|
||||
HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
|
||||
Hendrik Brueckner <brueckner@linux.ibm.com>
|
||||
Hermann Gausterer <git-dracut-2012@mrq1.org>
|
||||
Imran Haider <imran1008@gmail.com>
|
||||
Hiroaki Mizuguchi <hiroaki-m@iij.ad.jp>
|
||||
Hui Wang <john.wanghui@huawei.com>
|
||||
Ignaz Forster <iforster@suse.com>
|
||||
James Laska <jlaska@redhat.com>
|
||||
Jan Stodola <jstodola@redhat.com>
|
||||
Jason Dana <jasondana@quarksecurity.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>
|
||||
Julian Wolf <juwolf@suse.com>
|
||||
Kevin Yung <Kevin.Yung@myob.com>
|
||||
Lars R. Damerow <lars@pixar.com>
|
||||
Lennert Buytenhek <buytenh@wantstofly.org>
|
||||
Lidong Zhong <lidong.zhong@suse.com>
|
||||
Major Hayden <major@mhtx.net>
|
||||
Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
|
||||
Marian Csontos <mcsontos@redhat.com>
|
||||
Mark Fasheh <mfasheh@suse.de>
|
||||
Marko Myllynen <myllynen@redhat.com>
|
||||
Martin Wilck <mwilck@suse.com>
|
||||
Matt <smoothsailing72@hotmail.com>
|
||||
Matt Smith <shadowfax@gmx.com>
|
||||
Matthew Thode <mthode@mthode.org>
|
||||
Mei Liu <liumbj@linux.vnet.ibm.com>
|
||||
Michael Chapman <mike@very.puzzling.org>
|
||||
Michael McCracken <michael.mccracken@gmail.com>
|
||||
Michal Koutný <mkoutny@suse.com>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Michal Sekletar <msekleta@redhat.com>
|
||||
Mike Gorse <mgorse@suse.com>
|
||||
Moritz 'Morty' Strübe <morty@gmx.net>
|
||||
Munehiro Matsuda <haro@kgt.co.jp>
|
||||
Nikoli <nikoli@gmx.us>
|
||||
Nikoli <nikoli@lavabit.com>
|
||||
Nicolas Porcel <nicolasporcel06@gmail.com>
|
||||
Olivier Blin <dev@blino.org>
|
||||
P J P <ppandit@redhat.com>
|
||||
Paolo Bonzini <pbonzini@redhat.com>
|
||||
Pavel Zhukov <pzhukov@redhat.com>
|
||||
Pawel Wieczorkiewicz <pwieczorkiewicz@suse.de>
|
||||
Pekka Wallendahl <wyrmiyu@gmail.com>
|
||||
Peter Robinson <pbrobinson@fedoraproject.org>
|
||||
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>
|
||||
Rusty Bird <rustybird@openmailbox.org>
|
||||
@@ -172,20 +203,26 @@ 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>
|
||||
Thilo Bangert <thilo.bangert@gmx.net>
|
||||
Thomas Blume <thomas.blume@suse.com>
|
||||
Tobias Geerinckx <tobias.geerinckx@gmail.com>
|
||||
Tobias Klauser <tklauser@distanz.ch>
|
||||
Tom Gundersen <teg@jklm.no>
|
||||
Tomasz Paweł Gajc <tpgxyz@gmail.com>
|
||||
Tomasz Torcz <tomek@pipebreaker.pl>
|
||||
Tong Li <tonli@redhat.com>
|
||||
Vadim Kuznetsov <vadimk@gentoo.org>
|
||||
Vaughan Cao <vaughan.cao@oracle.com>
|
||||
Vratislav Podzimek <vpodzime@redhat.com>
|
||||
Xunlei Pang <xpang@redhat.com>
|
||||
Yanko Kaneti <yaneti@declera.com>
|
||||
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
|
||||
Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
|
||||
Ziyue Yang <ziyang@redhat.com>
|
||||
honza801 <honza801@gmail.com>
|
||||
jloeser <jloeser@suse.de>
|
||||
johannes <johannes.brechtmann@gmail.com>
|
||||
jonathan-teh <30538043+jonathan-teh@users.noreply.github.com>
|
||||
maximilian attems <max@stro.at>
|
||||
privb0x23 <privb0x23@users.noreply.github.com>
|
||||
tpg <tpgxyz@gmail.com>
|
||||
xtraeme <xtraeme@voidlinux.eu>
|
||||
|
24
Makefile
24
Makefile
@@ -1,7 +1,7 @@
|
||||
-include dracut-version.sh
|
||||
|
||||
VERSION ?= $(shell [ -d .git ] && git describe --abbrev=0 --tags 2>/dev/null || echo $(DRACUT_VERSION))
|
||||
GITVERSION ?= $(shell [ -d .git ] && { v=$$(git describe --tags 2>/dev/null); [ -n "$$v" ] && [ $${v\#*-} != $$v ] && echo -$${v\#*-}; } )
|
||||
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\#*-}; } )
|
||||
|
||||
-include Makefile.inc
|
||||
|
||||
@@ -12,8 +12,8 @@ pkglibdir ?= ${libdir}/dracut
|
||||
sysconfdir ?= ${prefix}/etc
|
||||
bindir ?= ${prefix}/bin
|
||||
mandir ?= ${prefix}/share/man
|
||||
CFLAGS ?= -O2 -g -Wall $(KMOD_CFLAGS)
|
||||
CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
|
||||
CFLAGS ?= -O2 -g -Wall
|
||||
CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 $(KMOD_CFLAGS)
|
||||
bashcompletiondir ?= ${datadir}/bash-completion/completions
|
||||
pkgconfigdatadir ?= $(datadir)/pkgconfig
|
||||
|
||||
@@ -40,7 +40,7 @@ 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
|
||||
|
||||
@@ -63,6 +63,9 @@ install/strv.o: install/strv.c install/strv.h install/util.h install/macro.h ins
|
||||
install/dracut-install: $(DRACUT_INSTALL_OBJECTS)
|
||||
$(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) $(KMOD_LIBS)
|
||||
|
||||
logtee: logtee.c
|
||||
$(CC) $(LDFLAGS) -o $@ $<
|
||||
|
||||
dracut-install: install/dracut-install
|
||||
ln -fs $< $@
|
||||
|
||||
@@ -213,6 +216,17 @@ rpm: dracut-$(VERSION).tar.xz syncheck
|
||||
--define "_rpmdir $$PWD" -ba dracut.spec; ) && \
|
||||
( mv "$$rpmbuild"/{,$$(arch)/}*.rpm $(DESTDIR).; rm -fr -- "$$rpmbuild"; ls $(DESTDIR)*.rpm )
|
||||
|
||||
srpm: 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; \
|
||||
(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 \
|
||||
[ "$${i##*/}" = "module-setup.sh" ] && continue; \
|
||||
|
285
NEWS
285
NEWS
@@ -1,3 +1,288 @@
|
||||
dracut-049
|
||||
==========
|
||||
lsinitrd:
|
||||
- record loaded kernel modules when hostonly mode is enabled
|
||||
lsinitrd $image -f */lib/dracut/loaded-kernel-modules.txt
|
||||
- allow to only unpack certain files
|
||||
|
||||
kernel-modules:
|
||||
- add gpio and pinctrl drivers for arm*/aarch64
|
||||
- add nfit
|
||||
|
||||
kernel-network-modules:
|
||||
- add vlan kernel modules
|
||||
|
||||
ifcfg/write-ifcfg.sh:
|
||||
- aggregate resolv.conf
|
||||
|
||||
livenet:
|
||||
- Enable OverlayFS overlay in sysroot.mount generator.
|
||||
|
||||
dmsquash-live:
|
||||
- Support a flattened squashfs.img
|
||||
|
||||
dracut-systemd:
|
||||
- Start systemd-vconsole-setup before dracut-cmdline-ask
|
||||
|
||||
iscsi:
|
||||
- do not install all of /etc/iscsi unless hostonly
|
||||
- start iscsid even w/o systemd
|
||||
|
||||
multipath:
|
||||
- fixed shutdown
|
||||
|
||||
network:
|
||||
- configure NetworkManager to use dhclient
|
||||
|
||||
mdraid:
|
||||
- fixed uuid handling ":" versus "-"
|
||||
|
||||
stratis:
|
||||
- Add additional binaries
|
||||
|
||||
new modules:
|
||||
- 00warpclock
|
||||
- 99squash
|
||||
Adds support for building a squashed initramfs
|
||||
- 35network-legacy
|
||||
the old 40network
|
||||
- 35network-manager
|
||||
alternative to 35network-legacy
|
||||
- 90kernel-modules-extra
|
||||
adds out-of-tree kernel modules
|
||||
|
||||
testsuite:
|
||||
- now runs on travis
|
||||
- support new qemu device options
|
||||
- even runs without kvm now
|
||||
|
||||
dracut-048
|
||||
==========
|
||||
|
||||
dracut.sh:
|
||||
- fixed finding of btrfs devices
|
||||
- harden dracut against BASH_ENV environment variable
|
||||
- no more prelinking
|
||||
- scan and install "external" kernel modules
|
||||
- fixed instmods with zero input
|
||||
- rdsosreport: best effort to strip out passwords
|
||||
- introduce tri-state hostonly mode
|
||||
|
||||
Add a new option --hostonly-mode which accept an <mode> parameter, so we have a tri-state hostonly mode:
|
||||
|
||||
* generic: by passing "--no-hostonly" or not passing anything.
|
||||
"--hostonly-mode" has no effect in such case.
|
||||
* sloppy: by passing "--hostonly --hostonly-mode sloppy". This
|
||||
is also the default mode when only "--hostonly" is given.
|
||||
* strict: by passing "--hostonly --hostonly-mode strict".
|
||||
|
||||
Sloppy mode is the original hostonly mode, the new introduced strict
|
||||
mode will allow modules to ignore more drivers or do some extra job to
|
||||
save memory and disk space, while making the image less portable.
|
||||
|
||||
Also introduced a helper function "optional_hostonly" to make it
|
||||
easier for modules to leverage new hostonly mode.
|
||||
|
||||
To force install modules only in sloppy hostonly mode, use the form:
|
||||
|
||||
hostonly="$(optional_hostonly)" instmods <modules>
|
||||
|
||||
dracut-install:
|
||||
- don't error out, if no modules were installed
|
||||
- support modules.softdep
|
||||
|
||||
lsinitrd.sh:
|
||||
- fixed zstd file signature
|
||||
|
||||
kernel:
|
||||
- include all pci/host modules
|
||||
- add mmc/core for arm
|
||||
- Include Intel Volume Management Device support
|
||||
|
||||
plymouth:
|
||||
- fix detection of plymouth directory
|
||||
|
||||
drm:
|
||||
- make failing installation of drm modules nonfatal
|
||||
- include virtio DRM drivers in hostonly initramfs
|
||||
|
||||
stratis:
|
||||
- initial Stratis support
|
||||
|
||||
crypt:
|
||||
- correct s390 arch to include arch-specific crypto modules
|
||||
- add cmdline rd.luks.partuuid
|
||||
- add timeout option rd.luks.timeout
|
||||
|
||||
shutdown:
|
||||
- sleep a little, if a process was killed
|
||||
|
||||
network:
|
||||
- introduce ip=either6 option
|
||||
|
||||
iscsi:
|
||||
- replace iscsistart with iscsid
|
||||
|
||||
qeth_rules:
|
||||
- new module to copy qeth rules
|
||||
|
||||
multipath-hostonly:
|
||||
- merged back into multipath
|
||||
|
||||
mdraid:
|
||||
- fixed case if rd.md.uuid is in ID_FS_UUID format
|
||||
|
||||
dracut-047
|
||||
==========
|
||||
dracut.sh:
|
||||
- sync initramfs to filesystem with fsfreeze
|
||||
- introduce "--no-hostonly-default-device"
|
||||
- disable lsinitrd logging when quiet
|
||||
- add support for Zstandard compression
|
||||
- fixed relative paths in --kerneldir
|
||||
- if /boot/vmlinuz-$version exists use /boot/ as default output dir
|
||||
- make qemu and qemu-net a default module in non-hostonly mode
|
||||
- fixed relative symlinks
|
||||
- support microcode updates for all AMD CPU families
|
||||
- install all modules-load.d regardless of hostonly
|
||||
- fixed parsing of "-i" and "--include"
|
||||
- bump kmod version to >= 23
|
||||
- enable 'early_microcode' by default
|
||||
- fixed check_block_and_slaves() for nvme
|
||||
|
||||
lsinitrd.sh:
|
||||
- dismiss "cat" error messages
|
||||
|
||||
systemd-bootchart:
|
||||
- removed
|
||||
|
||||
i18n:
|
||||
- install all keymaps for a given locale
|
||||
- add correct fontmaps
|
||||
|
||||
dmsquash-live:
|
||||
- fixed systemd unit escape
|
||||
|
||||
systemd:
|
||||
- enable core dumps with systemd from initrd
|
||||
- fixed setting of timeouts for device units
|
||||
- emergency.service: use Type=idle and fixed task limit
|
||||
|
||||
multipath:
|
||||
- include files from /etc/multipath/conf.d
|
||||
- do not fail startup on missing configuration
|
||||
- start daemon after udev settle
|
||||
- add shutdown script
|
||||
- parse kernel commandline option 'multipath=off'
|
||||
- start before local-fs-pre.target
|
||||
|
||||
dracut-emergency:
|
||||
- optionally print filesystem help
|
||||
|
||||
network:
|
||||
- fixed MTU for bond master
|
||||
- fixed race condition when wait for networks
|
||||
|
||||
fcoe:
|
||||
- handle CNAs with DCB firmware support
|
||||
- allow to specify the FCoE mode via the fcoe= parameter
|
||||
- always set AUTO_VLAN for fcoemon
|
||||
- add shutdown script
|
||||
- fixup fcoe-genrules.sh for VN2VN mode
|
||||
- switch back to using fipvlan for bnx2fc
|
||||
- add timeout mechanism
|
||||
|
||||
crypt:
|
||||
- add basic LUKS detached header support
|
||||
- escape backslashes for systemd unit names correctly
|
||||
- put block_uuid.map into initramfs
|
||||
|
||||
dmraid:
|
||||
- do not delete partitions
|
||||
|
||||
dasd_mod:
|
||||
- do not set module parameters if dasd_cio_free is not present
|
||||
|
||||
nfs:
|
||||
- fix mount if IPv4 address is used in /etc/fstab
|
||||
- support host being a DNS ALIAS
|
||||
|
||||
fips:
|
||||
- fixed creating path to .hmac of kernel based on BOOT_IMAGE
|
||||
|
||||
lunmask:
|
||||
- add module to handle LUN masking
|
||||
|
||||
s390:
|
||||
- add rd.cio_accept
|
||||
|
||||
dcssblk:
|
||||
- add new module for DCSS block devices
|
||||
|
||||
zipl:
|
||||
- add new module to update s390x configuration
|
||||
|
||||
iscsi:
|
||||
- no more iscsid, either iscsistart or iscsid
|
||||
|
||||
integrity:
|
||||
- support loading x509 into the trusted/builtin .evm keyring
|
||||
- support X.509-only EVM configuration
|
||||
|
||||
plymouth:
|
||||
- improve distro compatibility
|
||||
|
||||
dracut-046
|
||||
==========
|
||||
|
||||
dracut.sh:
|
||||
- bail out if module directory does not exist
|
||||
if people want to build the initramfs without kernel modules,
|
||||
then --no-kernel should be specified
|
||||
- add early microcode support for AMD family 16h
|
||||
- collect also all modaliases modules from sysfs for hostonly modules
|
||||
- sync initramfs after creation
|
||||
|
||||
network:
|
||||
- wait for IPv6 RA if using none/static IPv6 assignment
|
||||
- ipv6 improvements
|
||||
- Handle curl using libnssckbi for TLS
|
||||
- fix dhcp classless_static_routes
|
||||
- dhclient: send client-identifier matching hardware address
|
||||
- don't arping for point-to-point connections
|
||||
- only bring up wired network interfaces (no wlan and wwan)
|
||||
|
||||
mraid:
|
||||
- mdraid: wait for rd.md.uuid specified devices to be assembled
|
||||
|
||||
crypt:
|
||||
- handle rd.luks.name
|
||||
|
||||
crypt-gpg:
|
||||
- For GnuPG >= 2.1 support OpenPGP smartcards
|
||||
|
||||
kernel-install:
|
||||
- Skip to create initrd if /etc/machine-id is missing or empty
|
||||
|
||||
nfs:
|
||||
- handle rpcbind /run/rpcbind directory
|
||||
|
||||
s390:
|
||||
- various fixes
|
||||
|
||||
dmsquash-live:
|
||||
- add NTFS support
|
||||
|
||||
multipath:
|
||||
- split out multipath-hostonly module
|
||||
|
||||
lvmmerge:
|
||||
- new module, see README.md in the module directory
|
||||
|
||||
dracut-systemd:
|
||||
- fixed dependencies
|
||||
|
||||
|
||||
dracut-045
|
||||
==========
|
||||
|
||||
|
26
README.md
26
README.md
@@ -2,5 +2,29 @@
|
||||
|
||||
dracut is an initramfs infrastructure.
|
||||
|
||||
CentOS CI: [](https://ci.centos.org/job/dracut-push-master/)
|
||||
## Travis
|
||||
|
||||
[](https://travis-ci.org/dracutdevs/dracut)
|
||||
|
||||
## CentOS CI
|
||||
|
||||
[](https://ci.centos.org/job/dracut-push-master/)
|
||||
|
||||
- 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/)
|
||||
|
8
configure
vendored
8
configure
vendored
@@ -52,8 +52,8 @@ while (($# > 0)); do
|
||||
shift
|
||||
done
|
||||
|
||||
if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 15 "; then
|
||||
echo "dracut needs pkg-config and libkmod >= 15." >&2
|
||||
if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 23 "; then
|
||||
echo "dracut needs pkg-config and libkmod >= 23." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -66,8 +66,8 @@ sbindir ?= ${sbindir:-${prefix}/sbin}
|
||||
mandir ?= ${mandir:-${prefix}/share/man}
|
||||
enable_documentation ?= ${enable_documentation:-yes}
|
||||
bindir ?= ${bindir:-${prefix}/bin}
|
||||
KMOD_CFLAGS ?= $(${PKG_CONFIG} --cflags " libkmod >= 15 ")
|
||||
KMOD_LIBS ?= $(${PKG_CONFIG} --libs " libkmod >= 15 ")
|
||||
KMOD_CFLAGS ?= $(${PKG_CONFIG} --cflags " libkmod >= 23 ")
|
||||
KMOD_LIBS ?= $(${PKG_CONFIG} --libs " libkmod >= 23 ")
|
||||
EOF
|
||||
|
||||
{
|
||||
|
@@ -29,11 +29,9 @@ _dracut() {
|
||||
--hardlink --nohardlink --noprefix --mdadmconf --nomdadmconf
|
||||
--lvmconf --nolvmconf --debug --profile --verbose --quiet
|
||||
--local --hostonly --no-hostonly --fstab --help --bzip2 --lzma
|
||||
--xz --no-compress --gzip --list-modules --show-modules --keep
|
||||
--xz --zstd --no-compress --gzip --list-modules --show-modules --keep
|
||||
--printsize --regenerate-all --noimageifnotneeded --early-microcode
|
||||
--no-early-microcode --print-cmdline --prelink --noprelink --reproducible
|
||||
--uefi
|
||||
'
|
||||
--no-early-microcode --print-cmdline --reproducible --uefi'
|
||||
|
||||
[ARG]='-a -m -o -d -I -k -c -L --kver --add --force-add --add-drivers
|
||||
--omit-drivers --modules --omit --drivers --filesystems --install
|
||||
|
@@ -223,14 +223,20 @@ get_devpath_block() {
|
||||
|
||||
# get a persistent path from a device
|
||||
get_persistent_dev() {
|
||||
local i _tmp _dev
|
||||
local i _tmp _dev _pol
|
||||
|
||||
_dev=$(get_maj_min "$1")
|
||||
[ -z "$_dev" ] && return
|
||||
|
||||
if [[ -n "$persistent_policy" ]]; then
|
||||
_pol="/dev/disk/${persistent_policy}/*"
|
||||
else
|
||||
_pol=
|
||||
fi
|
||||
|
||||
for i in \
|
||||
$_pol \
|
||||
/dev/mapper/* \
|
||||
/dev/disk/${persistent_policy:-by-uuid}/* \
|
||||
/dev/disk/by-uuid/* \
|
||||
/dev/disk/by-label/* \
|
||||
/dev/disk/by-partuuid/* \
|
||||
@@ -468,7 +474,8 @@ for_each_host_dev_fs()
|
||||
local _dev
|
||||
local _ret=1
|
||||
|
||||
[[ "${#host_fs_types[@]}" ]] || return 0
|
||||
[[ "${#host_fs_types[@]}" ]] || return 2
|
||||
|
||||
|
||||
for _dev in "${!host_fs_types[@]}"; do
|
||||
$_func "$_dev" "${host_fs_types[$_dev]}" && _ret=0
|
||||
@@ -490,13 +497,14 @@ check_block_and_slaves() {
|
||||
[[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry.
|
||||
if ! lvm_internal_dev $2; then "$1" $2 && return; fi
|
||||
check_vol_slaves "$@" && return 0
|
||||
if [[ -f /sys/dev/block/$2/../dev ]]; then
|
||||
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/*/dev; do
|
||||
[[ -f $_x ]] || continue
|
||||
check_block_and_slaves $1 $(<"$_x") && return 0
|
||||
for _x in /sys/dev/block/$2/slaves/*; do
|
||||
[[ -f $_x/dev ]] || continue
|
||||
[[ $_x/subsystem -ef /sys/class/block ]] || continue
|
||||
check_block_and_slaves $1 $(<"$_x/dev") && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
@@ -508,13 +516,14 @@ check_block_and_slaves_all() {
|
||||
_ret=0
|
||||
fi
|
||||
check_vol_slaves_all "$@" && return 0
|
||||
if [[ -f /sys/dev/block/$2/../dev ]]; then
|
||||
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/*/dev; do
|
||||
[[ -f $_x ]] || continue
|
||||
check_block_and_slaves_all $1 $(<"$_x") && _ret=0
|
||||
for _x in /sys/dev/block/$2/slaves/*; do
|
||||
[[ -f $_x/dev ]] || continue
|
||||
[[ $_x/subsystem -ef /sys/class/block ]] || continue
|
||||
check_block_and_slaves_all $1 $(<"$_x/dev") && _ret=0
|
||||
done
|
||||
return $_ret
|
||||
}
|
||||
@@ -527,7 +536,7 @@ for_each_host_dev_and_slaves_all()
|
||||
local _dev
|
||||
local _ret=1
|
||||
|
||||
[[ "${host_devs[@]}" ]] || return 0
|
||||
[[ "${host_devs[@]}" ]] || return 2
|
||||
|
||||
for _dev in "${host_devs[@]}"; do
|
||||
[[ -b "$_dev" ]] || continue
|
||||
@@ -543,7 +552,7 @@ for_each_host_dev_and_slaves()
|
||||
local _func="$1"
|
||||
local _dev
|
||||
|
||||
[[ "${host_devs[@]}" ]] || return 0
|
||||
[[ "${host_devs[@]}" ]] || return 2
|
||||
|
||||
for _dev in "${host_devs[@]}"; do
|
||||
[[ -b "$_dev" ]] || continue
|
||||
@@ -559,45 +568,39 @@ for_each_host_dev_and_slaves()
|
||||
# but you cannot create the logical volume without the volume group.
|
||||
# And the volume group might be bigger than the devices the LV needs.
|
||||
check_vol_slaves() {
|
||||
local _lv _vg _pv _dm
|
||||
for i in /dev/mapper/*; do
|
||||
[[ $i == /dev/mapper/control ]] && continue
|
||||
_lv=$(get_maj_min $i)
|
||||
_dm=/sys/dev/block/$_lv/dm
|
||||
[[ -f $_dm/uuid && $(<$_dm/uuid) =~ LVM-* ]] || continue
|
||||
if [[ $_lv = $2 ]]; then
|
||||
_vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null)
|
||||
# strip space
|
||||
_vg="${_vg//[[:space:]]/}"
|
||||
if [[ $_vg ]]; then
|
||||
for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2>/dev/null)
|
||||
do
|
||||
check_block_and_slaves $1 $(get_maj_min $_pv) && return 0
|
||||
done
|
||||
fi
|
||||
fi
|
||||
done
|
||||
local _lv _vg _pv _dm _majmin
|
||||
_majmin="$2"
|
||||
_lv="/dev/block/$_majmin"
|
||||
_dm=/sys/dev/block/$_majmin/dm
|
||||
[[ -f $_dm/uuid && $(<$_dm/uuid) =~ LVM-* ]] || return 1
|
||||
_vg=$(dmsetup splitname --noheadings -o vg_name $(<"$_dm/name") )
|
||||
# strip space
|
||||
_vg="${_vg//[[:space:]]/}"
|
||||
if [[ $_vg ]]; then
|
||||
for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2>/dev/null)
|
||||
do
|
||||
check_block_and_slaves $1 $(get_maj_min $_pv) && return 0
|
||||
done
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
check_vol_slaves_all() {
|
||||
local _lv _vg _pv
|
||||
for i in /dev/mapper/*; do
|
||||
[[ $i == /dev/mapper/control ]] && continue
|
||||
_lv=$(get_maj_min $i)
|
||||
if [[ $_lv = $2 ]]; then
|
||||
_vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null)
|
||||
# strip space
|
||||
_vg="${_vg//[[:space:]]/}"
|
||||
if [[ $_vg ]]; then
|
||||
for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2>/dev/null)
|
||||
do
|
||||
check_block_and_slaves_all $1 $(get_maj_min $_pv)
|
||||
done
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
done
|
||||
local _lv _vg _pv _majmin
|
||||
_majmin="$2"
|
||||
_lv="/dev/block/$_majmin"
|
||||
_dm="/sys/dev/block/$_majmin/dm"
|
||||
[[ -f $_dm/uuid && $(<$_dm/uuid) =~ LVM-* ]] || return 1
|
||||
_vg=$(dmsetup splitname --noheadings -o vg_name $(<"$_dm/name") )
|
||||
# strip space
|
||||
_vg="${_vg//[[:space:]]/}"
|
||||
if [[ $_vg ]]; then
|
||||
for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2>/dev/null)
|
||||
do
|
||||
check_block_and_slaves_all $1 $(get_maj_min $_pv)
|
||||
done
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
@@ -661,9 +664,8 @@ get_ucode_file ()
|
||||
local stepping=`grep -E "stepping" /proc/cpuinfo | head -1 | sed s/.*:\ //`
|
||||
|
||||
if [[ "$(get_cpu_vendor)" == "AMD" ]]; then
|
||||
# If family greater or equal than 0x15
|
||||
if [[ $family -ge 21 ]]; then
|
||||
printf "microcode_amd_fam15h.bin"
|
||||
printf "microcode_amd_fam%xh.bin" $family
|
||||
else
|
||||
printf "microcode_amd.bin"
|
||||
fi
|
||||
@@ -674,6 +676,17 @@ 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() {
|
||||
|
@@ -52,13 +52,6 @@ if ! [[ -d $initdir ]]; then
|
||||
mkdir -p "$initdir"
|
||||
fi
|
||||
|
||||
if [[ $DRACUT_KERNEL_LAZY ]] && ! [[ $DRACUT_KERNEL_LAZY_HASHDIR ]]; then
|
||||
if ! [[ -d "$initdir/.kernelmodseen" ]]; then
|
||||
mkdir -p "$initdir/.kernelmodseen"
|
||||
fi
|
||||
DRACUT_KERNEL_LAZY_HASHDIR="$initdir/.kernelmodseen"
|
||||
fi
|
||||
|
||||
if ! [[ $kernel ]]; then
|
||||
kernel=$(uname -r)
|
||||
export kernel
|
||||
@@ -172,6 +165,13 @@ if ! [[ -x $DRACUT_INSTALL ]]; then
|
||||
exit 10
|
||||
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"
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ $DRACUT_RESOLVE_LAZY ]] || export DRACUT_RESOLVE_DEPS=1
|
||||
inst_dir() {
|
||||
[[ -e ${initdir}/"$1" ]] && return 0 # already there
|
||||
@@ -261,6 +261,24 @@ inst_script() {
|
||||
(($? != 0)) && derror FAILED: $DRACUT_INSTALL ${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 || :
|
||||
}
|
||||
|
||||
# Use with form hostonly="$(optional_hostonly)" inst_xxxx <args>
|
||||
# If hosotnly mode is set to "strict", hostonly restrictions will still
|
||||
# be applied, else will ignore hostonly mode and try to install all
|
||||
# given modules.
|
||||
optional_hostonly() {
|
||||
if [[ $hostonly_mode = "strict" ]]; then
|
||||
printf -- "$hostonly"
|
||||
else
|
||||
printf ""
|
||||
fi
|
||||
}
|
||||
|
||||
mark_hostonly() {
|
||||
for i in "$@"; do
|
||||
echo "$i" >> "$initdir/lib/dracut/hostonly-files"
|
||||
@@ -935,11 +953,8 @@ for_each_kmod_dep() {
|
||||
}
|
||||
|
||||
dracut_kernel_post() {
|
||||
local _moddirname=${srcmods%%/lib/modules/*}
|
||||
local _pid
|
||||
|
||||
for _f in modules.builtin.bin modules.builtin modules.order; do
|
||||
[[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
|
||||
[[ -e $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
|
||||
done
|
||||
|
||||
# generate module dependencies for the initrd
|
||||
@@ -978,6 +993,10 @@ instmods() {
|
||||
set -- "${args[@]}"
|
||||
fi
|
||||
|
||||
if (($# == 0)); then
|
||||
return 0
|
||||
fi
|
||||
|
||||
$DRACUT_INSTALL \
|
||||
${initdir:+-D "$initdir"} \
|
||||
${loginstall:+-L "$loginstall"} \
|
||||
|
@@ -31,6 +31,8 @@ elif $SKIP "$IMG" | xzcat | cpio -id --no-absolute-filenames --quiet >/dev/null;
|
||||
rm -f -- .need_shutdown
|
||||
elif $SKIP "$IMG" | lz4 -d -c | cpio -id --no-absolute-filenames --quiet >/dev/null; then
|
||||
rm -f -- .need_shutdown
|
||||
elif $SKIP "$IMG" | zstd -d -c | cpio -id --no-absolute-filenames --quiet >/dev/null; then
|
||||
rm -f -- .need_shutdown
|
||||
else
|
||||
# something failed, so we clean up
|
||||
echo "Unpacking of $IMG to /run/initramfs failed" >&2
|
||||
@@ -38,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
|
||||
|
18
dracut.8.asc
18
dracut.8.asc
@@ -243,12 +243,6 @@ example:
|
||||
**--nostrip**::
|
||||
do not strip binaries in the initramfs
|
||||
|
||||
**--prelink**::
|
||||
prelink binaries in the initramfs (default)
|
||||
|
||||
**--noprelink**::
|
||||
do not prelink binaries in the initramfs
|
||||
|
||||
**--hardlink**::
|
||||
hardlink files in the initramfs (default)
|
||||
|
||||
@@ -323,6 +317,10 @@ provide a valid _/etc/fstab_.
|
||||
**--no-hostonly-cmdline**:
|
||||
Do not store kernel command line arguments needed in the initramfs
|
||||
|
||||
**--no-hostonly-default-device**:
|
||||
Do not generate implicit host devices like root, swap, fstab, etc.
|
||||
Use "--mount" or "--add-device" to explicitly add devices as needed.
|
||||
|
||||
**--hostonly-i18n**:
|
||||
Install only needed keyboard and font files according to the host configuration (default).
|
||||
|
||||
@@ -428,6 +426,14 @@ Make sure your kernel has lz4 decompression support compiled in, otherwise you
|
||||
will not be able to boot.
|
||||
====
|
||||
|
||||
**--zstd**::
|
||||
Compress the generated initramfs using Zstandard.
|
||||
[WARNING]
|
||||
====
|
||||
Make sure your kernel has zstd decompression support compiled in, otherwise you
|
||||
will not be able to boot.
|
||||
====
|
||||
|
||||
**--compress** _<compressor>_::
|
||||
Compress the generated initramfs using the passed compression program. If
|
||||
you pass it just the name of a compression program, it will call that
|
||||
|
@@ -311,6 +311,11 @@ crypto LUKS
|
||||
**rd.luks.crypttab=0**::
|
||||
do not check, if LUKS partition is in _/etc/crypttab_
|
||||
|
||||
**rd.luks.timeout=**__<seconds>__::
|
||||
specify how long dracut should wait when waiting for the user to enter the
|
||||
password. This avoid blocking the boot if no password is entered. It does
|
||||
not apply to luks key. The default is '0', which means 'forever'.
|
||||
|
||||
crypto LUKS - key on removable device support
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
**rd.luks.key=**__<keypath>__:__<keydev>__:__<luksdev>__::
|
||||
@@ -480,7 +485,7 @@ USB Android phone::
|
||||
* enp0s29u1u2
|
||||
=====================
|
||||
|
||||
**ip=**__{dhcp|on|any|dhcp6|auto6}__::
|
||||
**ip=**__{dhcp|on|any|dhcp6|auto6|either6}__::
|
||||
dhcp|on|any::: get ip from dhcp server from all interfaces. If root=dhcp,
|
||||
loop sequentially through all interfaces (eth0, eth1, ...) and use the first
|
||||
with a valid DHCP root-path.
|
||||
@@ -489,6 +494,8 @@ USB Android phone::
|
||||
|
||||
dhcp6::: IPv6 DHCP
|
||||
|
||||
either6::: if auto6 fails, then dhcp6
|
||||
|
||||
**ip=**__<interface>__:__{dhcp|on|any|dhcp6|auto6}__[:[__<mtu>__][:__<macaddr>__]]::
|
||||
This parameter can be specified multiple times.
|
||||
+
|
||||
@@ -594,7 +601,7 @@ NFS
|
||||
mount nfs share from <server-ip>:/<root-dir>, if no server-ip is given, use
|
||||
dhcp next_server. If server-ip is an IPv6 address it has to be put in
|
||||
brackets, e.g. [2001:DB8::1]. NFS options can be appended with the prefix
|
||||
":" or "," and are seperated by ",".
|
||||
":" or "," and are separated by ",".
|
||||
|
||||
**root=**nfs:\[_<server-ip>_:]__<root-dir>__[:__<nfs-options>__], **root=**nfs4:\[_<server-ip>_:]__<root-dir>__[:__<nfs-options>__], **root=**__{dhcp|dhcp6}__::
|
||||
root=dhcp alone directs initrd to look at the DHCP root-path where NFS
|
||||
@@ -727,6 +734,9 @@ You may want to use rd.iscsi.firmware.
|
||||
**root=**_???_ **netroot=**iscsi **rd.iscsi.firmware=1**::
|
||||
will read the iscsi parameter from the BIOS firmware
|
||||
|
||||
**rd.iscsi.login_retry_max=**__<num>__::
|
||||
maximum number of login retries
|
||||
|
||||
**rd.iscsi.param=**__<param>__::
|
||||
<param> will be passed as "--param <param>" to iscsistart.
|
||||
This parameter can be specified multiple times.
|
||||
@@ -755,10 +765,12 @@ iscsistart -b --param node.session.timeo.replacement_timeout=30
|
||||
|
||||
FCoE
|
||||
~~~~
|
||||
**fcoe=**__<edd|interface|MAC>__:__{dcb|nodcb}__::
|
||||
**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. For the second argument, currently only nodcb is
|
||||
supported. This parameter can be specified multiple times.
|
||||
_<MAC>_ or EDD settings. The second argument specifies if DCB
|
||||
should be used. The optional third argument specifies whether
|
||||
fabric or VN2VN mode should be used.
|
||||
This parameter can be specified multiple times.
|
||||
+
|
||||
NOTE: letters in the MAC-address must be lowercase!
|
||||
|
||||
@@ -788,12 +800,19 @@ DASD
|
||||
ZFCP
|
||||
~~~~
|
||||
**rd.zfcp=**__<zfcp adaptor device bus ID>__,__<WWPN>__,__<FCPLUN>__::
|
||||
rd.zfcp can be specified multiple times on the kernel command line.
|
||||
rd.zfcp can be specified multiple times on the kernel command
|
||||
line.
|
||||
|
||||
**rd.zfcp=**__<zfcp adaptor device bus ID>__::
|
||||
If NPIV is enabled and the 'allow_lun_scan' parameter to the zfcp
|
||||
module is set to 'Y' then the zfcp adaptor will be initiating a
|
||||
scan internally and the <WWPN> and <FCPLUN> parameters can be omitted.
|
||||
+
|
||||
[listing]
|
||||
.Example
|
||||
--
|
||||
rd.zfcp=0.0.4000,0x5005076300C213e9,0x5022000000000000
|
||||
rd.zfcp=0.0.4000
|
||||
--
|
||||
|
||||
**rd.zfcp.conf=0**::
|
||||
@@ -802,6 +821,9 @@ rd.zfcp=0.0.4000,0x5005076300C213e9,0x5022000000000000
|
||||
ZNET
|
||||
~~~~
|
||||
**rd.znet=**__<nettype>__,__<subchannels>__,__<options>__::
|
||||
The whole parameter is appended to /etc/ccw.conf, which is used on
|
||||
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.
|
||||
+
|
||||
[listing]
|
||||
@@ -816,23 +838,24 @@ Booting live images
|
||||
Dracut offers multiple options for live booted images:
|
||||
|
||||
=====================
|
||||
SquashFS with read-only filesystem image::: The system will boot with a read
|
||||
only filesystem from the SquashFS and apply a writable device-mapper snapshot
|
||||
over the read only filesystem. Using this method ensures a relatively fast
|
||||
boot and lower RAM usage. Users **must be careful** to avoid writing too many
|
||||
blocks to the snapshot volume. Once the blocks of the snapshot overlay are
|
||||
exhausted, the root filesystem becomes read only and may cause application
|
||||
failures. The overlay file is marked 'Overflow', and a difficult recovery is
|
||||
required to repair and enlarge the overlay offline. Non-persistent overlays
|
||||
are sparse files in RAM that only consume content space as required blocks are
|
||||
allocated. They default to an apparent size of 32 GiB in RAM. The size can be
|
||||
adjusted with the **rd.live.overlay.size=** kernel command line option.
|
||||
SquashFS with read-only filesystem image::: The system will boot with a
|
||||
read-only filesystem from the SquashFS and apply a writable Device-mapper
|
||||
snapshot or an OverlayFS overlay mount for the read-only base filesystem. This
|
||||
method ensures a relatively fast boot and lower RAM usage. Users **must be
|
||||
careful** to avoid writing too many blocks to a snapshot volume. Once the
|
||||
blocks of the snapshot overlay are exhausted, the root filesystem becomes
|
||||
read-only and may cause application failures. The snapshot overlay file is
|
||||
marked 'Overflow', and a difficult recovery is required to repair and enlarge
|
||||
the overlay offline. Non-persistent overlays are sparse files in RAM that only
|
||||
consume content space as required blocks are allocated. They default to an
|
||||
apparent size of 32 GiB in RAM. The size can be adjusted with the
|
||||
**rd.live.overlay.size=** kernel command line option.
|
||||
+
|
||||
The filesystem structure is expected to be:
|
||||
The filesystem structure is traditionally expected to be:
|
||||
+
|
||||
[listing]
|
||||
--
|
||||
squashfs.img | Squashfs from LiveCD .iso downloaded via network
|
||||
squashfs.img | SquashFS from LiveCD .iso
|
||||
!(mount)
|
||||
/LiveOS
|
||||
|- rootfs.img | Filesystem image to mount read-only
|
||||
@@ -843,21 +866,35 @@ squashfs.img | Squashfs from LiveCD .iso downloaded via network
|
||||
... |
|
||||
--
|
||||
+
|
||||
Dracut uses this method of live booting by default. No additional command line
|
||||
options are required other than **root=live:<URL>** to specify the location
|
||||
of your squashed filesystem.
|
||||
For OverlayFS mount overlays, the filesystem structure may also be a direct
|
||||
compression of the root filesystem:
|
||||
+
|
||||
[listing]
|
||||
--
|
||||
squashfs.img | SquashFS from LiveCD .iso
|
||||
!(mount)
|
||||
/bin | Live filesystem
|
||||
/boot |
|
||||
/dev |
|
||||
... |
|
||||
--
|
||||
+
|
||||
Dracut uses one of the overlay methods of live booting by default. No
|
||||
additional command line options are required other than **root=live:<URL>** to
|
||||
specify the location of your squashed filesystem.
|
||||
+
|
||||
- The compressed SquashFS image can be copied during boot to RAM at
|
||||
`/run/initramfs/squashed.img` by using the **rd.live.ram=1** option.
|
||||
- A device with a persistent overlay can be booted read only by using the
|
||||
- A device with a persistent overlay can be booted read-only by using the
|
||||
**rd.live.overlay.readonly** option on the kernel command line. This will
|
||||
cause a temporary, writable overlay to be stacked over a read-only snapshot
|
||||
of the root filesystem.
|
||||
either cause a temporary, writable overlay to be stacked over a read-only
|
||||
snapshot of the root filesystem or the OverlayFS mount will use an additional
|
||||
lower layer with the root filesystem.
|
||||
+
|
||||
Uncompressed live filesystem image:::
|
||||
When the live system was installed with the '--skipcompress' option of the
|
||||
__livecd-iso-to-disk__ installation script for Live USB devices, the root
|
||||
filesystem image, `rootfs.img`, is expanded on installation and no SquashFS
|
||||
filesystem image, __rootfs.img__, is expanded on installation and no SquashFS
|
||||
is involved during boot.
|
||||
+
|
||||
- If **rd.live.ram=1** is used in this situation, the full, uncompressed
|
||||
@@ -865,12 +902,12 @@ root filesystem is copied during boot to `/run/initramfs/rootfs.img` in the
|
||||
`/run` tmpfs.
|
||||
+
|
||||
- If **rd.live.overlay=none** is provided as a kernel command line option,
|
||||
a writable, linear device-mapper target is created on boot with no overlay.
|
||||
a writable, linear Device-mapper target is created on boot with no overlay.
|
||||
|
||||
writable filesystem image:::
|
||||
Writable filesystem image:::
|
||||
The system will retrieve a compressed filesystem image, extract it to
|
||||
`/run/initramfs/fsimg/rootfs.img`, connect it to a loop device, create a
|
||||
writable, linear device-mapper target at `/dev/mapper/live-rw`, and mount that
|
||||
writable, linear Device-mapper target at `/dev/mapper/live-rw`, and mount that
|
||||
as a writable volume at `/`. More RAM is required during boot but the live
|
||||
filesystem is easier to manage if it becomes full. Users can make a filesystem
|
||||
image of any size and that size will be maintained when the system boots. There
|
||||
@@ -880,7 +917,7 @@ The filesystem structure is expected to be:
|
||||
+
|
||||
[listing]
|
||||
--
|
||||
rootfs.tgz | Compressed tarball containing fileystem image
|
||||
rootfs.tgz | Compressed tarball containing filesystem image
|
||||
!(unpack)
|
||||
/rootfs.img | Filesystem image at /run/initramfs/fsimg/
|
||||
!(mount)
|
||||
@@ -908,10 +945,11 @@ NOTE: There must be enough free RAM available to hold the complete image.
|
||||
This method is very suitable for diskless boots.
|
||||
|
||||
**root=**live:__<url>__::
|
||||
Boots a live image retrieved from __<url>__. Valid handlers: __http, https, ftp, torrent, tftp__.
|
||||
Boots a live image retrieved from __<url>__. Requires the dracut 'livenet'
|
||||
module. Valid handlers: __http, https, ftp, torrent, tftp__.
|
||||
+
|
||||
[listing]
|
||||
.Example
|
||||
.Examples
|
||||
--
|
||||
root=live:http://example.com/liveboot.img
|
||||
root=live:ftp://ftp.example.com/liveboot.img
|
||||
@@ -923,7 +961,7 @@ Enables debug output from the live boot process.
|
||||
|
||||
**rd.live.dir=**__<path>__::
|
||||
Specifies the directory within the boot device where the squashfs.img or
|
||||
rootfs.img can be found. By default, this is __LiveOS__.
|
||||
rootfs.img can be found. By default, this is `/LiveOS`.
|
||||
|
||||
**rd.live.squashimg=**__<filename of SquashFS image>__::
|
||||
Specifies the filename for a SquashFS image of the root filesystem.
|
||||
@@ -931,35 +969,52 @@ By default, this is __squashfs.img__.
|
||||
|
||||
**rd.live.ram=**1::
|
||||
Copy the complete image to RAM and use this for booting. This is useful
|
||||
when the image resides on, i.e., a DVD which needs to be ejected later on.
|
||||
when the image resides on, e.g., a DVD which needs to be ejected later on.
|
||||
|
||||
**rd.live.overlay=**__<devspec>__:__(<pathspec>|auto)__|__none__::
|
||||
Allow the usage of a permanent overlay.
|
||||
- _<devspec>_ specifies the path to a device with a mountable filesystem.
|
||||
- _<pathspec>_ is the path to a file within that filesystem, which shall be
|
||||
**rd.live.overlay={**__<devspec>__[:__{<pathspec>|auto}__]|__none__}::
|
||||
Manage the usage of a permanent overlay.
|
||||
+
|
||||
--
|
||||
* _<devspec>_ specifies the path to a device with a mountable filesystem.
|
||||
* _<pathspec>_ is the path to a file within that filesystem, which shall be
|
||||
used to persist the changes made to the device specified by the
|
||||
**root=live:__<url>__** option.
|
||||
- _none_ specifies no overlay when an uncompressed live root filesystem is
|
||||
available.
|
||||
If a persistent overlay is detected at the standard LiveOS path, the overlay &
|
||||
overlay type detected (whether Device-mapper or OverlayFS) will be used.
|
||||
+
|
||||
The default _pathspec_, when _auto_ or no _:<pathspec>_ is given, is
|
||||
`/<+++<b>rd.live.dir</b>+++>/overlay-<label>-<uuid>`, where _<label>_ is the
|
||||
device LABEL, and _<uuid>_ is the device UUID.
|
||||
* _none_ (the word itself) specifies that no overlay will be used, such as when
|
||||
an uncompressed, writable live root filesystem is available.
|
||||
+
|
||||
If a persistent overlay __is detected__ at the standard LiveOS path, the
|
||||
overlay & overlay type detected, whether Device-mapper or OverlayFS, will be
|
||||
used.
|
||||
--
|
||||
+
|
||||
[listing]
|
||||
.Example
|
||||
.Examples
|
||||
--
|
||||
rd.live.overlay=/dev/sdb1:persistent-overlay.img
|
||||
rd.live.overlay=UUID=99440c1f-8daa-41bf-b965-b7240a8996f4
|
||||
--
|
||||
|
||||
**rd.live.overlay.size=**__<size_MiB>__::
|
||||
Specifies a non-persistent overlay size in MiB. The default is _32768_.
|
||||
Specifies a non-persistent Device-mapper overlay size in MiB. The default is
|
||||
_32768_.
|
||||
|
||||
**rd.live.overlay.readonly=**1::
|
||||
Specifies a non-persistent, writable snapshot overlay to be stacked over a
|
||||
read-only snapshot of the root filesystem, `/dev/mapper/live-ro`, or a read-
|
||||
only loop device of a writable `rootfs.img`.
|
||||
This is used to boot with a normally read-write persistent overlay in a
|
||||
read-only mode. With this option, either an additional, non-persistent,
|
||||
writable snapshot overlay will be stacked over a read-only snapshot,
|
||||
`/dev/mapper/live‑ro`, of the base filesystem with the persistent overlay, or a
|
||||
read-only loop device, in the case of a writable __rootfs.img__, or an OverlayFS
|
||||
mount will use the persistent overlay directory linked at `/run/overlayfs‑r` as
|
||||
an additional lower layer along with the base root filesystem and apply a
|
||||
transient, writable upper directory overlay, in order to complete the booted
|
||||
root filesystem.
|
||||
|
||||
**rd.live.overlay.reset=**1::
|
||||
Specifies that a persistent overlay should be reset on boot. All root
|
||||
Specifies that a persistent overlay should be reset on boot. All previous root
|
||||
filesystem changes are vacated by this action.
|
||||
|
||||
**rd.live.overlay.thin=**1::
|
||||
@@ -970,28 +1025,57 @@ that memory is given back to the kernel when the filesystem does not claim it
|
||||
anymore.
|
||||
|
||||
**rd.live.overlay.overlayfs=**1::
|
||||
Enables the use of the **OverlayFS** kernel module, if available, to provide a
|
||||
Enables the use of the *OverlayFS* kernel module, if available, to provide a
|
||||
copy-on-write union directory for the root filesystem. OverlayFS overlays are
|
||||
directories of the files that have changed on the read-only base (lower)
|
||||
filesystem. The root filesystem is provided through a special overlay type
|
||||
mount that merges the lower and upper directories. If an OverlayFS upper
|
||||
directory is not present on the boot device, a tmpfs directory will be created
|
||||
at /run/overlayfs to provide temporary storage. Persistent storage can be
|
||||
at `/run/overlayfs` to provide temporary storage. Persistent storage can be
|
||||
provided on vfat or msdos formatted devices by supplying the OverlayFS upper
|
||||
directory within an embedded filesystem that supports the creation of trusted.*
|
||||
extended attributes and provides a valid d_type in readdir responses, such as
|
||||
with ext4 and xfs. On non-vfat-formatted devices, a persistent OverlayFS
|
||||
overlay can extend the available root filesystem storage up to the capacity of
|
||||
the LiveOS device.
|
||||
|
||||
the LiveOS disk device.
|
||||
+
|
||||
If a persistent overlay is detected at the standard LiveOS path, the overlay &
|
||||
overlay type detected (whether OverlayFS or Device-mapper) will be used.
|
||||
|
||||
overlay type detected, whether OverlayFS or Device-mapper, will be used.
|
||||
+
|
||||
The **rd.live.overlay.readonly** option, which allows a persistent overlayfs to
|
||||
be mounted read only through a higher level transient overlay directory, has
|
||||
be mounted read-only through a higher level transient overlay directory, has
|
||||
been implemented through the multiple lower layers feature of OverlayFS.
|
||||
|
||||
|
||||
ZIPL
|
||||
~~~~
|
||||
**rd.zipl=**__<path to blockdevice>__::
|
||||
Update the dracut commandline with the values found in the
|
||||
_dracut-cmdline.conf_ file on the given device.
|
||||
The values are merged into the existing commandline values
|
||||
and the udev events are regenerated.
|
||||
+
|
||||
[listing]
|
||||
.Example
|
||||
--
|
||||
rd.zipl=UUID=0fb28157-99e3-4395-adef-da3f7d44835a
|
||||
--
|
||||
|
||||
CIO_IGNORE
|
||||
~~~~~~~~~~
|
||||
**rd.cio_accept=**__<device-ids>__::
|
||||
Remove the devices listed in <device-ids> from the default
|
||||
cio_ignore kernel command-line settings.
|
||||
<device-ids> is a list of comma-separated CCW device ids.
|
||||
The default for this value is taken from the
|
||||
_/boot/zipl/active_devices.txt_ file.
|
||||
+
|
||||
[listing]
|
||||
.Example
|
||||
--
|
||||
rd.cio_accept=0.0.0180,0.0.0800,0.0.0801,0.0.0802
|
||||
--
|
||||
|
||||
Plymouth Boot Splash
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
**plymouth.enable=0**::
|
||||
@@ -1045,7 +1129,8 @@ their new replacement.
|
||||
|
||||
rdbreak:: rd.break
|
||||
|
||||
rd_CCW:: rd.ccw
|
||||
rd.ccw:: rd.znet
|
||||
rd_CCW:: rd.znet
|
||||
|
||||
rd_DASD_MOD:: rd.dasd
|
||||
|
||||
|
@@ -79,7 +79,7 @@ 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|<compressor [args ...]>}__"::
|
||||
*compress=*"__{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
|
||||
@@ -89,15 +89,12 @@ Configuration files must have the extension .conf; other extensions are ignored.
|
||||
*do_strip=*"__{yes|no}__"::
|
||||
Strip binaries in the initramfs (default=yes)
|
||||
|
||||
*do_prelink=*"__{yes|no}__"::
|
||||
Prelink binaries in the initramfs (default=yes)
|
||||
|
||||
*hostonly=*"__{yes|no}__"::
|
||||
Host-Only mode: Install only what is needed for booting the local host
|
||||
instead of a generic host and generate host-specific configuration.
|
||||
|
||||
*hostonly_cmdline=*"__{yes|no}__"::
|
||||
If set, store the kernel command line arguments needed in the initramfs
|
||||
If set to "yes", store the kernel command line arguments needed in the initramfs
|
||||
|
||||
*persistent_policy=*"__<policy>__"::
|
||||
Use _<policy>_ to address disks and partitions.
|
||||
@@ -160,14 +157,14 @@ 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>__"::
|
||||
Directory to search for ACPI tables if acpi_override= is set to yes.
|
||||
|
||||
*early_microcode=*"{yes|no}"::
|
||||
Combine early microcode with ramdisk (default=no)
|
||||
Combine early microcode with ramdisk (default=yes)
|
||||
|
||||
*stdloglvl*="__\{0-6\}__"::
|
||||
Set logging to standard error level.
|
||||
|
@@ -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).
|
||||
|
@@ -212,7 +212,7 @@ check() should return with:
|
||||
|
||||
0:: Include the dracut module in the initramfs.
|
||||
|
||||
1:: Do not include the dracut module. The requirements are not fullfilled
|
||||
1:: Do not include the dracut module. The requirements are not fulfilled
|
||||
(missing tools, etc.)
|
||||
|
||||
255:: Only include the dracut module, if another module requires it or if
|
||||
@@ -255,7 +255,9 @@ not lead to an error.
|
||||
==== inst <src> [<dst>]
|
||||
|
||||
installs _one_ file <src> either to the same place in the initramfs or to an
|
||||
optional <dst>.
|
||||
optional <dst>. inst with more than two arguments is treated the same as
|
||||
inst_multiple, all arguments are treated as files to install and none as
|
||||
install destinations.
|
||||
|
||||
==== inst_hook <hookdir> <prio> <src>
|
||||
|
||||
@@ -264,7 +266,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> ... ]
|
||||
|
295
dracut.sh
295
dracut.sh
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash --norc
|
||||
#!/bin/bash -p
|
||||
#
|
||||
# Generator script for a dracut initramfs
|
||||
# Tries to retain some degree of compatibility with the command line
|
||||
@@ -23,6 +23,8 @@
|
||||
|
||||
# store for logging
|
||||
|
||||
unset BASH_ENV
|
||||
|
||||
# Verify bash version, current minimum is 4
|
||||
if (( BASH_VERSINFO[0] < 4 )); then
|
||||
printf -- 'You need at least Bash 4 to use dracut, sorry.' >&2
|
||||
@@ -108,8 +110,6 @@ Creates initial ramdisk images for preloading modules
|
||||
--kernel-cmdline [PARAMETERS] Specify default kernel command line parameters
|
||||
--strip Strip binaries in the initramfs
|
||||
--nostrip Do not strip binaries in the initramfs
|
||||
--prelink Prelink binaries in the initramfs
|
||||
--noprelink Do not prelink binaries in the initramfs
|
||||
--hardlink Hardlink files in the initramfs
|
||||
--nohardlink Do not hardlink files in the initramfs
|
||||
--prefix [DIR] Prefix initramfs files with [DIR]
|
||||
@@ -147,10 +147,29 @@ Creates initial ramdisk images for preloading modules
|
||||
-H, --hostonly Host-Only mode: Install only what is needed for
|
||||
booting the local host instead of a generic host.
|
||||
-N, --no-hostonly Disables Host-Only mode
|
||||
--hostonly-mode <mode>
|
||||
Specify the hostonly mode to use. <mode> could be
|
||||
one of "sloppy" or "strict". "sloppy" mode is used
|
||||
by default.
|
||||
In "sloppy" hostonly mode, extra drivers and modules
|
||||
will be installed, so minor hardware change won't make
|
||||
the image unbootable (eg. changed keyboard), and the
|
||||
image is still portable among similar hosts.
|
||||
With "strict" mode enabled, anything not necessary
|
||||
for booting the local host in its current state will
|
||||
not be included, and modules may do some extra job
|
||||
to save more space. Minor change of hardware or
|
||||
environment could make the image unbootable.
|
||||
DO NOT use "strict" mode unless you know what you
|
||||
are doing.
|
||||
--hostonly-cmdline Store kernel command line arguments needed
|
||||
in the initramfs
|
||||
--no-hostonly-cmdline Do not store kernel command line arguments needed
|
||||
in the initramfs
|
||||
--no-hostonly-default-device
|
||||
Do not generate implicit host devices like root,
|
||||
swap, fstab, etc. Use "--mount" or "--add-device"
|
||||
to explicitly add devices as needed.
|
||||
--hostonly-i18n Install only needed keyboard and font files according
|
||||
to the host configuration (default).
|
||||
--no-hostonly-i18n Install all keyboard and font files available.
|
||||
@@ -193,6 +212,9 @@ Creates initial ramdisk images for preloading modules
|
||||
--lz4 Compress the generated initramfs using lz4.
|
||||
Make sure that your kernel has lz4 support compiled
|
||||
in, otherwise you will not be able to boot.
|
||||
--zstd Compress the generated initramfs using Zstandard.
|
||||
Make sure that your kernel has zstd support compiled
|
||||
in, otherwise you will not be able to boot.
|
||||
--compress [COMPRESSION] Compress the generated initramfs with the
|
||||
passed compression program. Make sure your kernel
|
||||
knows how to decompress the generated initramfs,
|
||||
@@ -279,11 +301,15 @@ dropindirs_sort()
|
||||
rearrange_params()
|
||||
{
|
||||
# Workaround -i, --include taking 2 arguments
|
||||
set -- "${@/--include/++include}"
|
||||
|
||||
# This prevents any long argument ending with "-i"
|
||||
# -i, like --opt-i but I think we can just prevent that
|
||||
set -- "${@/%-i/++include}"
|
||||
newat=()
|
||||
for i in "$@"; do
|
||||
if [[ $i == "-i" ]] || [[ $i == "--include" ]]; then
|
||||
newat+=("++include") # Replace --include by ++include
|
||||
else
|
||||
newat+=("$i")
|
||||
fi
|
||||
done
|
||||
set -- "${newat[@]}" # Set new $@
|
||||
|
||||
TEMP=$(unset POSIXLY_CORRECT; getopt \
|
||||
-o "a:m:o:d:I:k:c:L:fvqlHhMN" \
|
||||
@@ -306,7 +332,7 @@ rearrange_params()
|
||||
--long mount: \
|
||||
--long device: \
|
||||
--long add-device: \
|
||||
--long nofscks: \
|
||||
--long nofscks \
|
||||
--long ro-mnt \
|
||||
--long kmoddir: \
|
||||
--long conf: \
|
||||
@@ -323,8 +349,6 @@ rearrange_params()
|
||||
--long kernel-cmdline: \
|
||||
--long strip \
|
||||
--long nostrip \
|
||||
--long prelink \
|
||||
--long noprelink \
|
||||
--long hardlink \
|
||||
--long nohardlink \
|
||||
--long noprefix \
|
||||
@@ -343,8 +367,10 @@ rearrange_params()
|
||||
--long host-only \
|
||||
--long no-hostonly \
|
||||
--long no-host-only \
|
||||
--long hostonly-mode: \
|
||||
--long hostonly-cmdline \
|
||||
--long no-hostonly-cmdline \
|
||||
--long no-hostonly-default-device \
|
||||
--long persistent-policy: \
|
||||
--long fstab \
|
||||
--long help \
|
||||
@@ -353,6 +379,7 @@ rearrange_params()
|
||||
--long xz \
|
||||
--long lzo \
|
||||
--long lz4 \
|
||||
--long zstd \
|
||||
--long no-compress \
|
||||
--long gzip \
|
||||
--long list-modules \
|
||||
@@ -447,9 +474,6 @@ if [[ $append_args_l == "yes" ]]; then
|
||||
eval set -- "$TEMP"
|
||||
rearrange_params "$@"
|
||||
fi
|
||||
|
||||
# clean the temporarily used scratch-pad directory
|
||||
rm -rf $scratch_dir
|
||||
fi
|
||||
|
||||
unset PARMS_TO_STORE
|
||||
@@ -507,8 +531,6 @@ while :; do
|
||||
early_microcode_l="no";;
|
||||
--strip) do_strip_l="yes";;
|
||||
--nostrip) do_strip_l="no";;
|
||||
--prelink) do_prelink_l="yes";;
|
||||
--noprelink) do_prelink_l="no";;
|
||||
--hardlink) do_hardlink_l="yes";;
|
||||
--nohardlink) do_hardlink_l="no";;
|
||||
--noprefix) prefix_l="/";;
|
||||
@@ -531,6 +553,8 @@ while :; do
|
||||
hostonly_l="yes" ;;
|
||||
-N|--no-hostonly|--no-host-only)
|
||||
hostonly_l="no" ;;
|
||||
--hostonly-mode)
|
||||
hostonly_mode_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--hostonly-cmdline)
|
||||
hostonly_cmdline_l="yes" ;;
|
||||
--hostonly-i18n)
|
||||
@@ -539,6 +563,8 @@ while :; do
|
||||
i18n_install_all_l="yes" ;;
|
||||
--no-hostonly-cmdline)
|
||||
hostonly_cmdline_l="no" ;;
|
||||
--no-hostonly-default-device)
|
||||
hostonly_default_device="no" ;;
|
||||
--persistent-policy)
|
||||
persistent_policy_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--fstab) use_fstab_l="yes" ;;
|
||||
@@ -550,6 +576,7 @@ while :; do
|
||||
--xz) compress_l="xz";;
|
||||
--lzo) compress_l="lzo";;
|
||||
--lz4) compress_l="lz4";;
|
||||
--zstd) compress_l="zstd";;
|
||||
--no-compress) _no_compress_l="cat";;
|
||||
--gzip) compress_l="gzip";;
|
||||
--list-modules) do_list="yes";;
|
||||
@@ -621,12 +648,6 @@ if ! [[ $kernel ]]; then
|
||||
kernel=$(uname -r)
|
||||
fi
|
||||
|
||||
if [[ $kernel ]]; then
|
||||
if ! [[ -d /lib/modules/$kernel ]] && [[ $no_kernel != yes ]]; then
|
||||
printf -- "Kernel version $kernel has no module directory /lib/modules/$kernel\n" >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
export LC_ALL=C
|
||||
export LANG=C
|
||||
unset LC_MESSAGES
|
||||
@@ -714,14 +735,13 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
|
||||
[[ $drivers_dir_l ]] && drivers_dir=$drivers_dir_l
|
||||
[[ $do_strip_l ]] && do_strip=$do_strip_l
|
||||
[[ $do_strip ]] || do_strip=yes
|
||||
[[ $do_prelink_l ]] && do_prelink=$do_prelink_l
|
||||
[[ $do_prelink ]] || do_prelink=yes
|
||||
[[ $do_hardlink_l ]] && do_hardlink=$do_hardlink_l
|
||||
[[ $do_hardlink ]] || do_hardlink=yes
|
||||
[[ $prefix_l ]] && prefix=$prefix_l
|
||||
[[ $prefix = "/" ]] && unset prefix
|
||||
[[ $hostonly_l ]] && hostonly=$hostonly_l
|
||||
[[ $hostonly_cmdline_l ]] && hostonly_cmdline=$hostonly_cmdline_l
|
||||
[[ $hostonly_mode_l ]] && hostonly_mode=$hostonly_mode_l
|
||||
[[ "$hostonly" == "yes" ]] && ! [[ $hostonly_cmdline ]] && hostonly_cmdline="yes"
|
||||
[[ $i18n_install_all_l ]] && i18n_install_all=$i18n_install_all_l
|
||||
[[ $persistent_policy_l ]] && persistent_policy=$persistent_policy_l
|
||||
@@ -738,7 +758,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
|
||||
[[ $nofscks_l ]] && nofscks="yes"
|
||||
[[ $ro_mnt_l ]] && ro_mnt="yes"
|
||||
[[ $early_microcode_l ]] && early_microcode=$early_microcode_l
|
||||
[[ $early_microcode ]] || early_microcode=no
|
||||
[[ $early_microcode ]] || early_microcode=yes
|
||||
[[ $logfile_l ]] && logfile="$logfile_l"
|
||||
[[ $reproducible_l ]] && reproducible="$reproducible_l"
|
||||
[[ $loginstall_l ]] && loginstall="$loginstall_l"
|
||||
@@ -767,7 +787,9 @@ if ! [[ $outfile ]]; then
|
||||
mkdir -p "$efidir/Linux"
|
||||
outfile="$efidir/Linux/linux-$kernel${MACHINE_ID:+-${MACHINE_ID}}${BUILD_ID:+-${BUILD_ID}}.efi"
|
||||
else
|
||||
if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then
|
||||
if [[ -e "/boot/vmlinuz-$kernel" ]]; then
|
||||
outfile="/boot/initramfs-$kernel.img"
|
||||
elif [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then
|
||||
outfile="/boot/${MACHINE_ID}/$kernel/initrd"
|
||||
else
|
||||
outfile="/boot/initramfs-$kernel.img"
|
||||
@@ -796,7 +818,7 @@ fi
|
||||
|
||||
if ! [[ $compress ]]; then
|
||||
# check all known compressors, if none specified
|
||||
for i in pigz gzip lz4 lzop lzma xz lbzip2 bzip2 cat; do
|
||||
for i in pigz gzip lz4 lzop zstd lzma xz lbzip2 bzip2 cat; do
|
||||
command -v "$i" &>/dev/null || continue
|
||||
compress="$i"
|
||||
break
|
||||
@@ -836,11 +858,27 @@ case $compress in
|
||||
lz4)
|
||||
compress="lz4 -l -9"
|
||||
;;
|
||||
zstd)
|
||||
compress="zstd -15 -q -T0"
|
||||
;;
|
||||
esac
|
||||
|
||||
[[ $hostonly = yes ]] && hostonly="-h"
|
||||
[[ $hostonly != "-h" ]] && unset hostonly
|
||||
|
||||
case $hostonly_mode in
|
||||
'')
|
||||
[[ $hostonly ]] && hostonly_mode="sloppy" ;;
|
||||
sloppy|strict)
|
||||
if [[ ! $hostonly ]]; then
|
||||
unset hostonly_mode
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
printf "%s\n" "dracut: Invalid hostonly mode '$hostonly_mode'." >&2
|
||||
exit 1
|
||||
esac
|
||||
|
||||
[[ $reproducible == yes ]] && DRACUT_REPRODUCIBLE=1
|
||||
|
||||
readonly TMPDIR="$(realpath -e "$tmpdir")"
|
||||
@@ -894,6 +932,12 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $no_kernel != yes ]] && ! [[ -d $srcmods ]]; then
|
||||
printf "%s\n" "dracut: Cannot find module directory $srcmods" >&2
|
||||
printf "%s\n" "dracut: and --no-kernel was not specified" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [[ $print_cmdline ]]; then
|
||||
inst /bin/sh
|
||||
if ! $DRACUT_INSTALL ${initdir:+-D "$initdir"} -R "$initdir/bin/sh" &>/dev/null; then
|
||||
@@ -1053,8 +1097,8 @@ if [[ ! $print_cmdline ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $acpi_override = yes ]] && ! check_kernel_config CONFIG_ACPI_INITRD_TABLE_OVERRIDE; then
|
||||
dwarn "Disabling ACPI override, because kernel does not support it. CONFIG_ACPI_INITRD_TABLE_OVERRIDE!=y"
|
||||
if [[ $acpi_override = yes ]] && ! ( check_kernel_config CONFIG_ACPI_TABLE_UPGRADE || check_kernel_config CONFIG_ACPI_INITRD_TABLE_OVERRIDE ); then
|
||||
dwarn "Disabling ACPI override, because kernel does not support it. CONFIG_ACPI_INITRD_TABLE_OVERRIDE!=y or CONFIG_ACPI_TABLE_UPGRADE!=y"
|
||||
unset acpi_override
|
||||
fi
|
||||
|
||||
@@ -1133,7 +1177,7 @@ if (( ${#add_device_l[@]} )); then
|
||||
push_host_devs "${add_device_l[@]}"
|
||||
fi
|
||||
|
||||
if [[ $hostonly ]]; then
|
||||
if [[ $hostonly ]] && [[ "$hostonly_default_device" != "no" ]]; then
|
||||
# in hostonly mode, determine all devices, which have to be accessed
|
||||
# and examine them for filesystem types
|
||||
|
||||
@@ -1151,6 +1195,7 @@ if [[ $hostonly ]]; then
|
||||
"/usr/lib64" \
|
||||
"/boot" \
|
||||
"/boot/efi" \
|
||||
"/boot/zipl" \
|
||||
;
|
||||
do
|
||||
mp=$(readlink -f "$mp")
|
||||
@@ -1214,7 +1259,7 @@ if [[ $hostonly ]]; then
|
||||
|
||||
push_host_devs "$_dev"
|
||||
if [[ "$_t" == btrfs ]]; then
|
||||
for i in $(find_btrfs_devs "$_m"); do
|
||||
for i in $(btrfs_devs "$_m"); do
|
||||
push_host_devs "$i"
|
||||
done
|
||||
fi
|
||||
@@ -1266,16 +1311,16 @@ done
|
||||
[[ -d $udevdir ]] \
|
||||
|| udevdir="$(pkg-config udev --variable=udevdir 2>/dev/null)"
|
||||
if ! [[ -d "$udevdir" ]]; then
|
||||
[[ ! -h /lib ]] && [[ -d /lib/udev ]] && udevdir=/lib/udev
|
||||
[[ -d /usr/lib/udev ]] && udevdir=/usr/lib/udev
|
||||
[[ -e /lib/udev/collect ]] && udevdir=/lib/udev
|
||||
[[ -e /usr/lib/udev/collect ]] && udevdir=/usr/lib/udev
|
||||
fi
|
||||
|
||||
[[ -d $systemdutildir ]] \
|
||||
|| systemdutildir=$(pkg-config systemd --variable=systemdutildir 2>/dev/null)
|
||||
|
||||
if ! [[ -d "$systemdutildir" ]]; then
|
||||
[[ ! -h /lib ]] && [[ -d /lib/systemd ]] && systemdutildir=/lib/systemd
|
||||
[[ -d /usr/lib/systemd ]] && systemdutildir=/usr/lib/systemd
|
||||
[[ -e /lib/systemd/systemd-udevd ]] && systemdutildir=/lib/systemd
|
||||
[[ -e /usr/lib/systemd/systemd-udevd ]] && systemdutildir=/usr/lib/systemd
|
||||
fi
|
||||
|
||||
[[ -d $systemdsystemunitdir ]] \
|
||||
@@ -1300,7 +1345,7 @@ export initdir dracutbasedir \
|
||||
dracutmodules force_add_dracutmodules add_dracutmodules omit_dracutmodules \
|
||||
mods_to_load \
|
||||
fw_dir drivers_dir debug no_kernel kernel_only \
|
||||
omit_drivers mdadmconf lvmconf root_dev \
|
||||
omit_drivers mdadmconf lvmconf root_devs \
|
||||
use_fstab fstab_lines libdirs fscks nofscks ro_mnt \
|
||||
stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \
|
||||
debug host_fs_types host_devs swap_devs sshkey add_fstab \
|
||||
@@ -1444,12 +1489,15 @@ dinfo "*** Including modules done ***"
|
||||
|
||||
## final stuff that has to happen
|
||||
if [[ $no_kernel != yes ]]; then
|
||||
if [[ $hostonly ]]; then
|
||||
echo "$(get_loaded_kernel_modules)" > $initdir/lib/dracut/loaded-kernel-modules.txt
|
||||
fi
|
||||
|
||||
if [[ $drivers ]]; then
|
||||
hostonly='' instmods $drivers
|
||||
fi
|
||||
|
||||
if [[ $add_drivers ]]; then
|
||||
if [[ -n "${add_drivers// }" ]]; then
|
||||
hostonly='' instmods -c $add_drivers
|
||||
fi
|
||||
if [[ $force_drivers ]]; then
|
||||
@@ -1524,9 +1572,13 @@ if [[ $kernel_only != yes ]]; then
|
||||
dinfo "*** Resolving executable dependencies ***"
|
||||
find "$initdir" -type f -perm /0111 -not -path '*.ko' -print0 \
|
||||
| xargs -r -0 $DRACUT_INSTALL ${initdir:+-D "$initdir"} -R ${DRACUT_FIPS_MODE:+-f} --
|
||||
dinfo "*** Resolving executable dependencies done***"
|
||||
dinfo "*** Resolving executable dependencies done ***"
|
||||
fi
|
||||
|
||||
# Now we are done with lazy resolving, always install dependencies
|
||||
unset DRACUT_RESOLVE_LAZY
|
||||
export DRACUT_RESOLVE_DEPS=1
|
||||
|
||||
# libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so
|
||||
for _dir in $libdirs; do
|
||||
for _f in "$_dir/libpthread.so"*; do
|
||||
@@ -1582,21 +1634,6 @@ if [[ $kernel_only != yes ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
PRELINK_BIN="$(command -v prelink)"
|
||||
if [[ $EUID = 0 ]] && [[ $PRELINK_BIN ]]; then
|
||||
if [[ $DRACUT_FIPS_MODE ]]; then
|
||||
dinfo "*** Installing prelink files ***"
|
||||
inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf /etc/prelink.cache
|
||||
elif [[ $do_prelink == yes ]]; then
|
||||
dinfo "*** Pre-linking files ***"
|
||||
inst_multiple -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf
|
||||
chroot "$initdir" "$PRELINK_BIN" -a
|
||||
rm -f -- "$initdir/$PRELINK_BIN"
|
||||
rm -fr -- "$initdir"/etc/prelink.*
|
||||
dinfo "*** Pre-linking files done ***"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $do_hardlink = yes ]] && command -v hardlink >/dev/null; then
|
||||
dinfo "*** Hardlinking files ***"
|
||||
hardlink "$initdir" 2>&1
|
||||
@@ -1605,7 +1642,11 @@ fi
|
||||
|
||||
# strip binaries
|
||||
if [[ $do_strip = yes ]] ; then
|
||||
for p in strip xargs find; do
|
||||
# Prefer strip from elfutils for package size
|
||||
declare strip_cmd=$(command -v eu-strip)
|
||||
test -z "$strip_cmd" && strip_cmd="strip"
|
||||
|
||||
for p in $strip_cmd xargs find; do
|
||||
if ! type -P $p >/dev/null; then
|
||||
dinfo "Could not find '$p'. Not stripping the initramfs."
|
||||
do_strip=no
|
||||
@@ -1613,18 +1654,23 @@ if [[ $do_strip = yes ]] ; then
|
||||
done
|
||||
fi
|
||||
|
||||
# cleanup empty ldconfig_paths directories
|
||||
for d in $(ldconfig_paths); do
|
||||
rmdir -p --ignore-fail-on-non-empty "$initdir/$d" >/dev/null 2>&1
|
||||
done
|
||||
|
||||
if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then
|
||||
dinfo "*** Stripping files ***"
|
||||
find "$initdir" -type f \
|
||||
-executable -not -path '*/lib/modules/*.ko' -print0 \
|
||||
| xargs -r -0 strip -g 2>/dev/null
|
||||
| xargs -r -0 $strip_cmd -g 2>/dev/null
|
||||
|
||||
# strip kernel modules, but do not touch signed modules
|
||||
find "$initdir" -type f -path '*/lib/modules/*.ko' -print0 \
|
||||
| while read -r -d $'\0' f || [ -n "$f" ]; do
|
||||
SIG=$(tail -c 28 "$f" | tr -d '\000')
|
||||
[[ $SIG == '~Module signature appended~' ]] || { printf "%s\000" "$f"; }
|
||||
done | xargs -r -0 strip -g
|
||||
done | xargs -r -0 $strip_cmd -g
|
||||
|
||||
dinfo "*** Stripping files done ***"
|
||||
fi
|
||||
@@ -1644,7 +1690,7 @@ if [[ $early_microcode = yes ]]; then
|
||||
for _fwdir in $fw_dir; do
|
||||
if [[ -d $_fwdir && -d $_fwdir/$_fw ]]; then
|
||||
_src="*"
|
||||
dinfo "*** Constructing ${ucode_dest[$idx]} ****"
|
||||
dinfo "*** Constructing ${ucode_dest[$idx]} ***"
|
||||
if [[ $hostonly ]]; then
|
||||
_src=$(get_ucode_file)
|
||||
[[ $_src ]] || break
|
||||
@@ -1684,7 +1730,7 @@ if ! ( echo $PARMS_TO_STORE > $initdir/lib/dracut/build-parameter.txt ); then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $hostonly_cmdline ]] ; then
|
||||
if [[ $hostonly_cmdline == "yes" ]] ; then
|
||||
unset _stored_cmdline
|
||||
if [ -d $initdir/etc/cmdline.d ];then
|
||||
dinfo "Stored kernel commandline:"
|
||||
@@ -1701,6 +1747,118 @@ fi
|
||||
|
||||
dinfo "*** Creating image file '$outfile' ***"
|
||||
|
||||
if dracut_module_included "squash"; then
|
||||
if ! check_kernel_config CONFIG_SQUASHFS; then
|
||||
dfatal "CONFIG_SQUASHFS have to be enabled for dracut squash module to work"
|
||||
exit 1
|
||||
fi
|
||||
if ! check_kernel_config CONFIG_OVERLAY_FS; then
|
||||
dfatal "CONFIG_OVERLAY_FS have to be enabled for dracut squash module to work"
|
||||
exit 1
|
||||
fi
|
||||
if ! check_kernel_config CONFIG_DEVTMPFS; then
|
||||
dfatal "CONFIG_DEVTMPFS have to be enabled for dracut squash module to work"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
readonly squash_dir="${DRACUT_TMPDIR}/squashfs"
|
||||
readonly squash_img=$initdir/squash/root.img
|
||||
|
||||
# Currently only move "usr" "etc" to squashdir
|
||||
readonly squash_candidate=( "usr" "etc" )
|
||||
|
||||
mkdir -m 0755 -p $squash_dir
|
||||
for folder in "${squash_candidate[@]}"; do
|
||||
mv $initdir/$folder $squash_dir/$folder
|
||||
done
|
||||
|
||||
# Reinstall required files, because we have moved some important folders to $squash_dir
|
||||
inst_multiple "echo" "sh" "mount" "modprobe" "mkdir" \
|
||||
"systemctl" "udevadm" "$systemdutildir/systemd"
|
||||
hostonly="" instmods "loop" "squashfs" "overlay"
|
||||
|
||||
for folder in "${squash_candidate[@]}"; do
|
||||
# Remove duplicated files in squashfs image, save some more space
|
||||
[[ ! -d $initdir/$folder/ ]] && continue
|
||||
for file in $(find $initdir/$folder/ -not -type d);
|
||||
do
|
||||
if [[ -e $squash_dir${file#$initdir} ]]; then
|
||||
mv $squash_dir${file#$initdir} $file
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
# Move some files out side of the squash image, including:
|
||||
# - Files required to boot and mount the squashfs image
|
||||
# - Files need to be accessible without mounting the squash image
|
||||
required_in_root() {
|
||||
local file=$1
|
||||
local _sqsh_file=$squash_dir/$file
|
||||
local _init_file=$initdir/$file
|
||||
|
||||
if [[ -e $_init_file ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ ! -e $_sqsh_file ]] && [[ ! -L $_sqsh_file ]]; then
|
||||
derror "$file is required to boot a squashed initramfs but it's not installed!"
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ ! -d $(dirname $_init_file) ]]; then
|
||||
required_in_root $(dirname $file)
|
||||
fi
|
||||
|
||||
if [[ -d $_sqsh_file ]]; then
|
||||
if [[ -L $_sqsh_file ]]; then
|
||||
cp --preserve=all -P $_sqsh_file $_init_file
|
||||
else
|
||||
mkdir $_init_file
|
||||
fi
|
||||
else
|
||||
if [[ -L $_sqsh_file ]]; then
|
||||
cp --preserve=all -P $_sqsh_file $_init_file
|
||||
_sqsh_file=$(realpath $_sqsh_file 2>/dev/null)
|
||||
if [[ -e $_sqsh_file ]] && [[ "$_sqsh_file" == "$squash_dir"* ]]; then
|
||||
# Relative symlink
|
||||
required_in_root ${_sqsh_file#$squash_dir/}
|
||||
return
|
||||
fi
|
||||
if [[ -e $squash_dir$_sqsh_file ]]; then
|
||||
# Absolute symlink
|
||||
required_in_root ${_sqsh_file#/}
|
||||
return
|
||||
fi
|
||||
required_in_root ${module_spec#$squash_dir/}
|
||||
else
|
||||
mv $_sqsh_file $_init_file
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
required_in_root etc/initrd-release
|
||||
|
||||
for module_spec in $squash_dir/usr/lib/modules/*/modules.*;
|
||||
do
|
||||
required_in_root ${module_spec#$squash_dir/}
|
||||
done
|
||||
|
||||
for dracut_spec in $squash_dir/usr/lib/dracut/*;
|
||||
do
|
||||
required_in_root ${dracut_spec#$squash_dir/}
|
||||
done
|
||||
|
||||
mv $initdir/init $initdir/init.stock
|
||||
ln -s squash/init.sh $initdir/init
|
||||
|
||||
mksquashfs $squash_dir $squash_img -comp xz -b 64K -Xdict-size 100% &> /dev/null
|
||||
|
||||
if [[ $? != 0 ]]; then
|
||||
dfatal "dracut: Failed making squash image"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $uefi = yes ]]; then
|
||||
readonly uefi_outdir="$DRACUT_TMPDIR/uefi"
|
||||
mkdir "$uefi_outdir"
|
||||
@@ -1748,7 +1906,7 @@ if ! (
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if (( maxloglvl >= 5 )); then
|
||||
if (( maxloglvl >= 5 )) && (( verbosity_mod_l >= 0 )); then
|
||||
if [[ $allowlocal ]]; then
|
||||
"$dracutbasedir/lsinitrd.sh" "${DRACUT_TMPDIR}/initramfs.img"| ddebug
|
||||
else
|
||||
@@ -1802,4 +1960,23 @@ fi
|
||||
|
||||
command -v restorecon &>/dev/null && restorecon -- "$outfile"
|
||||
|
||||
# We sync/fsfreeze only if we're operating on a live booted system.
|
||||
# It's possible for e.g. `kernel` to be installed as an RPM BuildRequires or equivalent,
|
||||
# and there's no reason to sync, and *definitely* no reason to fsfreeze.
|
||||
# Another case where this happens is rpm-ostree, which performs its own sync/fsfreeze
|
||||
# globally. See e.g. https://github.com/ostreedev/ostree/commit/8642ef5ab3fec3ac8eb8f193054852f83a8bc4d0
|
||||
if test -d /run/systemd/system; then
|
||||
if ! sync "$outfile" 2> /dev/null; then
|
||||
dinfo "dracut: sync operation on newly created initramfs $outfile failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# use fsfreeze only if we're not writing to /
|
||||
if [[ "$(stat -c %m -- "$outfile")" != "/" && "$(stat -f -c %T -- "$outfile")" != "msdos" ]]; then
|
||||
if ! $(fsfreeze -f $(dirname "$outfile") 2>/dev/null && fsfreeze -u $(dirname "$outfile") 2>/dev/null); then
|
||||
dinfo "dracut: warning: could not fsfreeze $(dirname "$outfile")"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
256
dracut.spec
256
dracut.spec
@@ -5,18 +5,11 @@
|
||||
# strip the automatically generated dep here and instead co-own the
|
||||
# directory.
|
||||
%global __requires_exclude pkg-config
|
||||
|
||||
# Variables must be defined
|
||||
%define with_nbd 1
|
||||
|
||||
# nbd in Fedora only
|
||||
%if 0%{?rhel} >= 6
|
||||
%define with_nbd 0
|
||||
%endif
|
||||
%define dist_free_release xxx
|
||||
|
||||
Name: dracut
|
||||
Version: xxx
|
||||
Release: xxx
|
||||
Release: %{dist_free_release}%{?dist}
|
||||
|
||||
Summary: Initramfs generator using udev
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
@@ -37,58 +30,40 @@ URL: https://dracut.wiki.kernel.org/
|
||||
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.xz
|
||||
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
|
||||
|
||||
|
||||
BuildRequires: bash git
|
||||
BuildRequires: kmod-devel >= 15
|
||||
BuildRequires: bash
|
||||
BuildRequires: git
|
||||
BuildRequires: kmod-devel >= 23
|
||||
BuildRequires: gcc
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: systemd
|
||||
%endif
|
||||
%if 0%{?fedora}
|
||||
BuildRequires: bash-completion
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version}
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
%endif
|
||||
|
||||
%if %{with doc}
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
BuildRequires: docbook-style-xsl docbook-dtds libxslt
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version}
|
||||
-BuildRequires: docbook-xsl-stylesheets libxslt
|
||||
BuildRequires: docbook-xsl-stylesheets libxslt
|
||||
%endif
|
||||
|
||||
BuildRequires: asciidoc
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel}
|
||||
# no "provides", because dracut does not offer
|
||||
# all functionality of the obsoleted packages
|
||||
Obsoletes: mkinitrd < 6.0.94
|
||||
Obsoletes: mkinitrd-devel < 6.0.94
|
||||
Obsoletes: nash < 6.0.94
|
||||
Obsoletes: libbdevid-python < 6.0.94
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} > 16 || 0%{?rhel} > 6
|
||||
BuildRequires: systemd-units
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version} > 9999
|
||||
Obsoletes: mkinitrd < 2.6.1
|
||||
Provides: mkinitrd = 2.6.1
|
||||
%endif
|
||||
|
||||
Obsoletes: dracut-kernel < 005
|
||||
Provides: dracut-kernel = %{version}-%{release}
|
||||
|
||||
Obsoletes: dracut < 030
|
||||
Obsoletes: dracut-norescue < 030
|
||||
Provides: dracut-norescue = %{version}-%{release}
|
||||
Obsoletes: dracut-fips <= 047
|
||||
Provides: dracut-fips = %{version}-%{release}
|
||||
Obsoletes: dracut-fips-aesni <= 047
|
||||
Provides: dracut-fips-aesni = %{version}-%{release}
|
||||
|
||||
Requires: bash >= 4
|
||||
Requires: coreutils
|
||||
@@ -101,43 +76,45 @@ Requires: sed
|
||||
Requires: xz
|
||||
Requires: gzip
|
||||
|
||||
%if 0%{?fedora} > 22
|
||||
Recommends: grubby
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
Recommends: hardlink
|
||||
Recommends: pigz
|
||||
Recommends: kpartx
|
||||
%else
|
||||
Requires: hardlink
|
||||
Requires: gzip
|
||||
Requires: kpartx
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||
Requires: util-linux >= 2.21
|
||||
Requires: systemd >= 219
|
||||
Requires: systemd-udev >= 219
|
||||
Requires: procps-ng
|
||||
Conflicts: grubby < 8.23
|
||||
Conflicts: initscripts < 8.63-1
|
||||
Conflicts: plymouth < 0.8.0-0.2009.29.09.19.1
|
||||
Conflicts: bcache-tools < 0-0.14.20130909git
|
||||
%else
|
||||
Requires: hardlink
|
||||
Requires: gzip
|
||||
Requires: kpartx
|
||||
Requires: udev > 166
|
||||
Requires: util-linux-ng >= 2.21
|
||||
%endif
|
||||
|
||||
Conflicts: mdadm < 3.2.6-14
|
||||
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
|
||||
Requires: libkcapi-hmaccalc
|
||||
%endif
|
||||
|
||||
%description
|
||||
dracut contains tools to create a bootable initramfs for 2.6 Linux kernels.
|
||||
Unlike existing implementations, dracut does hard-code as little as possible
|
||||
into the initramfs. dracut contains various modules which are driven by the
|
||||
event-based udev. Having root on MD, DM, LVM2, LUKS is supported as well as
|
||||
NFS, iSCSI, NBD, FCoE with the dracut-network package.
|
||||
dracut contains tools to create bootable initramfses for the Linux
|
||||
kernel. Unlike previous 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
|
||||
package.
|
||||
|
||||
%package network
|
||||
Summary: dracut modules to build a dracut initramfs with network support
|
||||
%if 0%{?_module_build}
|
||||
# In the module-build-service, we have pieces of dracut provided by different
|
||||
# modules ("base-runtime" provides most functionality, but we need
|
||||
# dracut-network in "installer". Since these two modules build with separate
|
||||
# dist-tags, we need to reduce this strict requirement to ignore the dist-tag.
|
||||
Requires: %{name} >= %{version}-%{dist_free_release}
|
||||
%else
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
%endif
|
||||
Requires: iputils
|
||||
Requires: iproute
|
||||
Requires: dhclient
|
||||
@@ -148,32 +125,6 @@ Provides: dracut-generic = %{version}-%{release}
|
||||
This package requires everything which is needed to build a generic
|
||||
all purpose initramfs with network support with dracut.
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?suse_version}
|
||||
%package fips
|
||||
Summary: dracut modules to build a dracut initramfs with an integrity check
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: hmaccalc
|
||||
%if 0%{?rhel} > 5
|
||||
# For Alpha 3, we want nss instead of nss-softokn
|
||||
Requires: nss
|
||||
%else
|
||||
Requires: nss-softokn
|
||||
%endif
|
||||
Requires: nss-softokn-freebl
|
||||
|
||||
%description fips
|
||||
This package requires everything which is needed to build an
|
||||
initramfs with dracut, which does an integrity check.
|
||||
%endif
|
||||
|
||||
%package fips-aesni
|
||||
Summary: dracut modules to build a dracut initramfs with an integrity check with aesni-intel
|
||||
Requires: %{name}-fips = %{version}-%{release}
|
||||
|
||||
%description fips-aesni
|
||||
This package requires everything which is needed to build an
|
||||
initramfs with dracut, which does an integrity check and adds the aesni-intel kernel module.
|
||||
|
||||
%package caps
|
||||
Summary: dracut modules to build a dracut initramfs which drops capabilities
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
@@ -185,9 +136,17 @@ initramfs with dracut, which drops capabilities.
|
||||
|
||||
%package live
|
||||
Summary: dracut modules to build a dracut initramfs with live image capabilities
|
||||
%if 0%{?_module_build}
|
||||
# See the network subpackage comment.
|
||||
Requires: %{name} >= %{version}-%{dist_free_release}
|
||||
%else
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
%endif
|
||||
Requires: %{name}-network = %{version}-%{release}
|
||||
Requires: tar gzip coreutils bash device-mapper curl
|
||||
%if 0%{?fedora}
|
||||
Requires: fuse ntfs-3g
|
||||
%endif
|
||||
|
||||
%description live
|
||||
This package requires everything which is needed to build an
|
||||
@@ -219,6 +178,16 @@ Requires: %{name} = %{version}-%{release}
|
||||
%description tools
|
||||
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: squashfs-tools
|
||||
|
||||
%description squash
|
||||
This package provides a dracut module to build an initramfs, but store most files
|
||||
in a squashfs image, result in a smaller initramfs size and reduce runtime memory
|
||||
usage.
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{version} -S git_am
|
||||
cp %{SOURCE1} .
|
||||
@@ -235,9 +204,6 @@ cp %{SOURCE1} .
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
rm -rf -- $RPM_BUILD_ROOT
|
||||
%endif
|
||||
make %{?_smp_mflags} install \
|
||||
DESTDIR=$RPM_BUILD_ROOT \
|
||||
libdir=%{_prefix}/lib
|
||||
@@ -246,7 +212,6 @@ echo "DRACUT_VERSION=%{version}-%{release}" > $RPM_BUILD_ROOT/%{dracutlibdir}/dr
|
||||
|
||||
%if 0%{?fedora} == 0 && 0%{?rhel} == 0 && 0%{?suse_version} == 0
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/01fips
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/02fips-aesni
|
||||
%endif
|
||||
|
||||
%if %{defined _unitdir}
|
||||
@@ -267,6 +232,23 @@ rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/97masterkey
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/98integrity
|
||||
%endif
|
||||
|
||||
%ifnarch s390 s390x
|
||||
# remove architecture specific modules
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/80cms
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/81cio_ignore
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/91zipl
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd_mod
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd_rules
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dcssblk
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95qeth_rules
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95zfcp
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95zfcp_rules
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95znet
|
||||
%else
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00warpclock
|
||||
%endif
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/boot/dracut
|
||||
mkdir -p $RPM_BUILD_ROOT/var/lib/dracut/overlay
|
||||
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log
|
||||
@@ -281,33 +263,21 @@ rm -f $RPM_BUILD_ROOT%{_mandir}/man?/*suse*
|
||||
install -m 0644 dracut.conf.d/suse.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
|
||||
install -m 0644 dracut.conf.d/fips.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/40-fips.conf
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} <= 12 && 0%{?rhel} < 6 && 0%{?suse_version} <= 9999
|
||||
%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
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||
# FIXME: remove after F19
|
||||
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
|
||||
|
||||
%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
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
|
||||
> $RPM_BUILD_ROOT/etc/system-fips
|
||||
# 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
|
||||
|
||||
%clean
|
||||
rm -rf -- $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,0755)
|
||||
%if %{with doc}
|
||||
%doc README HACKING TODO AUTHORS NEWS dracut.html dracut.png dracut.svg
|
||||
%endif
|
||||
@@ -316,7 +286,7 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%{_bindir}/dracut
|
||||
%{_datadir}/bash-completion/completions/dracut
|
||||
%{_datadir}/bash-completion/completions/lsinitrd
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
|
||||
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} > 9999
|
||||
%{_bindir}/mkinitrd
|
||||
%{_bindir}/lsinitrd
|
||||
%endif
|
||||
@@ -342,7 +312,7 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%if %{with doc}
|
||||
%{_mandir}/man8/dracut.8*
|
||||
%{_mandir}/man8/*service.8*
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
|
||||
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} > 9999
|
||||
%{_mandir}/man8/mkinitrd.8*
|
||||
%{_mandir}/man1/lsinitrd.1*
|
||||
%endif
|
||||
@@ -353,13 +323,17 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%{_mandir}/man5/dracut.conf.5*
|
||||
%endif
|
||||
|
||||
%if %{defined _unitdir}
|
||||
%{dracutlibdir}/modules.d/00systemd-bootchart
|
||||
%else
|
||||
%if %{undefined _unitdir}
|
||||
%{dracutlibdir}/modules.d/00bootchart
|
||||
%endif
|
||||
%{dracutlibdir}/modules.d/00bash
|
||||
%{dracutlibdir}/modules.d/00systemd
|
||||
%ifnarch s390 s390x
|
||||
%{dracutlibdir}/modules.d/00warpclock
|
||||
%endif
|
||||
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
|
||||
%{dracutlibdir}/modules.d/01fips
|
||||
%endif
|
||||
%{dracutlibdir}/modules.d/01systemd-initrd
|
||||
%{dracutlibdir}/modules.d/03modsign
|
||||
%{dracutlibdir}/modules.d/03rescue
|
||||
@@ -370,41 +344,51 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%{dracutlibdir}/modules.d/45url-lib
|
||||
%{dracutlibdir}/modules.d/50drm
|
||||
%{dracutlibdir}/modules.d/50plymouth
|
||||
%{dracutlibdir}/modules.d/80cms
|
||||
%{dracutlibdir}/modules.d/80lvmmerge
|
||||
%{dracutlibdir}/modules.d/90btrfs
|
||||
%{dracutlibdir}/modules.d/90crypt
|
||||
%{dracutlibdir}/modules.d/90dm
|
||||
%{dracutlibdir}/modules.d/90dmraid
|
||||
%{dracutlibdir}/modules.d/90kernel-modules
|
||||
%{dracutlibdir}/modules.d/90kernel-modules-extra
|
||||
%{dracutlibdir}/modules.d/90lvm
|
||||
%{dracutlibdir}/modules.d/90mdraid
|
||||
%{dracutlibdir}/modules.d/90multipath
|
||||
%{dracutlibdir}/modules.d/90stratis
|
||||
%{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/95resume
|
||||
%{dracutlibdir}/modules.d/95rootfs-block
|
||||
%{dracutlibdir}/modules.d/95dasd
|
||||
%{dracutlibdir}/modules.d/95dasd_mod
|
||||
%{dracutlibdir}/modules.d/95dasd_rules
|
||||
%{dracutlibdir}/modules.d/95fstab-sys
|
||||
%{dracutlibdir}/modules.d/95zfcp
|
||||
%{dracutlibdir}/modules.d/95zfcp_rules
|
||||
%{dracutlibdir}/modules.d/95terminfo
|
||||
%{dracutlibdir}/modules.d/95udev-rules
|
||||
%{dracutlibdir}/modules.d/95virtfs
|
||||
%ifarch s390 s390x
|
||||
%{dracutlibdir}/modules.d/80cms
|
||||
%{dracutlibdir}/modules.d/81cio_ignore
|
||||
%{dracutlibdir}/modules.d/91zipl
|
||||
%{dracutlibdir}/modules.d/95dasd
|
||||
%{dracutlibdir}/modules.d/95dasd_mod
|
||||
%{dracutlibdir}/modules.d/95dasd_rules
|
||||
%{dracutlibdir}/modules.d/95dcssblk
|
||||
%{dracutlibdir}/modules.d/95qeth_rules
|
||||
%{dracutlibdir}/modules.d/95zfcp
|
||||
%{dracutlibdir}/modules.d/95zfcp_rules
|
||||
%endif
|
||||
%if %{undefined _unitdir}
|
||||
%{dracutlibdir}/modules.d/96securityfs
|
||||
%{dracutlibdir}/modules.d/97masterkey
|
||||
%{dracutlibdir}/modules.d/98integrity
|
||||
%endif
|
||||
%{dracutlibdir}/modules.d/97biosdevname
|
||||
%{dracutlibdir}/modules.d/98dracut-systemd
|
||||
%{dracutlibdir}/modules.d/98ecryptfs
|
||||
%{dracutlibdir}/modules.d/98pollcdrom
|
||||
%{dracutlibdir}/modules.d/98selinux
|
||||
%{dracutlibdir}/modules.d/98syslog
|
||||
%{dracutlibdir}/modules.d/98dracut-systemd
|
||||
%{dracutlibdir}/modules.d/98usrmount
|
||||
%{dracutlibdir}/modules.d/99base
|
||||
%{dracutlibdir}/modules.d/99fs-lib
|
||||
@@ -430,52 +414,40 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%{_unitdir}/initrd.target.wants/dracut-pre-udev.service
|
||||
|
||||
%endif
|
||||
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
%{_prefix}/lib/kernel/install.d/50-dracut.install
|
||||
%endif
|
||||
|
||||
%files network
|
||||
%defattr(-,root,root,0755)
|
||||
%{dracutlibdir}/modules.d/02systemd-networkd
|
||||
%{dracutlibdir}/modules.d/35network-manager
|
||||
%{dracutlibdir}/modules.d/35network-legacy
|
||||
%{dracutlibdir}/modules.d/40network
|
||||
%{dracutlibdir}/modules.d/45ifcfg
|
||||
%{dracutlibdir}/modules.d/90kernel-network-modules
|
||||
%{dracutlibdir}/modules.d/95fcoe
|
||||
%{dracutlibdir}/modules.d/95iscsi
|
||||
%{dracutlibdir}/modules.d/90qemu-net
|
||||
%{dracutlibdir}/modules.d/95cifs
|
||||
%{dracutlibdir}/modules.d/95fcoe
|
||||
%{dracutlibdir}/modules.d/95fcoe-uefi
|
||||
%{dracutlibdir}/modules.d/95iscsi
|
||||
%{dracutlibdir}/modules.d/95nbd
|
||||
%{dracutlibdir}/modules.d/95nfs
|
||||
%{dracutlibdir}/modules.d/95ssh-client
|
||||
%{dracutlibdir}/modules.d/45ifcfg
|
||||
%ifarch s390 s390x
|
||||
%{dracutlibdir}/modules.d/95znet
|
||||
%{dracutlibdir}/modules.d/95fcoe-uefi
|
||||
%endif
|
||||
%{dracutlibdir}/modules.d/99uefi-lib
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
|
||||
%files fips
|
||||
%defattr(-,root,root,0755)
|
||||
%{dracutlibdir}/modules.d/01fips
|
||||
%{dracutlibdir}/dracut.conf.d/40-fips.conf
|
||||
%config(missingok) /etc/system-fips
|
||||
%endif
|
||||
|
||||
%files fips-aesni
|
||||
%defattr(-,root,root,0755)
|
||||
%{dracutlibdir}/modules.d/02fips-aesni
|
||||
|
||||
%files caps
|
||||
%defattr(-,root,root,0755)
|
||||
%{dracutlibdir}/modules.d/02caps
|
||||
|
||||
%files live
|
||||
%defattr(-,root,root,0755)
|
||||
%{dracutlibdir}/modules.d/99img-lib
|
||||
%{dracutlibdir}/modules.d/90dmsquash-live
|
||||
%{dracutlibdir}/modules.d/90dmsquash-live-ntfs
|
||||
%{dracutlibdir}/modules.d/90livenet
|
||||
|
||||
%files tools
|
||||
%defattr(-,root,root,0755)
|
||||
|
||||
%if %{with doc}
|
||||
%doc %{_mandir}/man8/dracut-catimages.8*
|
||||
%endif
|
||||
@@ -485,15 +457,17 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%dir /var/lib/dracut
|
||||
%dir /var/lib/dracut/overlay
|
||||
|
||||
%files squash
|
||||
%{dracutlibdir}/modules.d/99squash
|
||||
|
||||
%files config-generic
|
||||
%defattr(-,root,root,0755)
|
||||
%{dracutlibdir}/dracut.conf.d/02-generic-image.conf
|
||||
|
||||
%files config-rescue
|
||||
%defattr(-,root,root,0755)
|
||||
%{dracutlibdir}/dracut.conf.d/02-rescue.conf
|
||||
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||
%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
|
||||
|
||||
|
@@ -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.
|
||||
@@ -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]]
|
||||
@@ -243,7 +243,7 @@ If your root partition is on a network drive, you have to have the network
|
||||
dracut modules installed to create a network aware initramfs image.
|
||||
|
||||
If you specify ip=dhcp on the kernel command line, then dracut asks a dhcp
|
||||
server about the ip adress for the machine. The dhcp server can also serve an
|
||||
server about the ip address for the machine. The dhcp server can also serve an
|
||||
additional root-path, which will set the root device for dracut. With this
|
||||
mechanism, you have static configuration on your client machine and a
|
||||
centralized boot configuration on your TFTP/DHCP server. If you can't pass a
|
||||
@@ -252,7 +252,7 @@ method described in <<Injecting>>.
|
||||
|
||||
==== Reducing the Image Size
|
||||
|
||||
To reduce the size of the initramfs, you should create it with by ommitting all
|
||||
To reduce the size of the initramfs, you should create it with by omitting all
|
||||
dracut modules, which you know, you don't need to boot the machine.
|
||||
|
||||
You can also specify the exact dracut and kernel modules to produce a very tiny
|
||||
|
61
fedora-test.sh
Executable file
61
fedora-test.sh
Executable file
@@ -0,0 +1,61 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
[[ -d ${0%/*} ]] && cd ${0%/*}
|
||||
|
||||
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)
|
||||
|
||||
if ! [[ $TESTS ]]; then
|
||||
make -j$NCPU all syncheck rpm logtee
|
||||
else
|
||||
make -j$NCPU all logtee
|
||||
|
||||
cd test
|
||||
|
||||
time sudo make \
|
||||
KVERSION=$(rpm -qa kernel --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -rn | head -1) \
|
||||
TEST_RUN_ID=$RUN_ID \
|
||||
${TESTS:+TESTS="$TESTS"} \
|
||||
-k V=2 \
|
||||
check
|
||||
fi
|
32
git2spec.pl
32
git2spec.pl
@@ -3,10 +3,28 @@
|
||||
sub create_patches {
|
||||
my $tag=shift;
|
||||
my $pdir=shift;
|
||||
my $num=0;
|
||||
open( GIT, 'git format-patch -M -N --no-signature -o "'.$pdir.'" '.$tag.' |');
|
||||
@lines=<GIT>;
|
||||
close GIT; # be done
|
||||
my $n=1;
|
||||
my @lines;
|
||||
my $fname;
|
||||
my $f=0;
|
||||
|
||||
mkdir $pdir, 0755;
|
||||
|
||||
open( GIT, 'git log -p --pretty=email --stat -m --first-parent --reverse '.$tag.'..HEAD |');
|
||||
|
||||
while (<GIT>) {
|
||||
if (/^From [a-z0-9]{40} .*$/) {
|
||||
$fname = sprintf("%04d", $n++).".patch";
|
||||
open FH, ">".$pdir."/".$fname;
|
||||
$f=1;
|
||||
}
|
||||
if (/^---$/ && $f == 1) {
|
||||
push @lines, $fname;
|
||||
$f=0;
|
||||
}
|
||||
print FH;
|
||||
}
|
||||
|
||||
return @lines;
|
||||
};
|
||||
|
||||
@@ -27,15 +45,15 @@ while(<>) {
|
||||
if (/^Version:/) {
|
||||
print "Version: $tag\n";
|
||||
}
|
||||
elsif (/^Release:/) {
|
||||
print "Release: $release%{?dist}\n";
|
||||
elsif (/^%define dist_free_release/) {
|
||||
print "%define dist_free_release $release\n";
|
||||
}
|
||||
elsif ((/^Source0:/) || (/^Source:/)) {
|
||||
print $_;
|
||||
$num=1;
|
||||
for(@patches) {
|
||||
s/.*\///g;
|
||||
print "Patch$num: $_";
|
||||
print "Patch$num: $_\n";
|
||||
$num++;
|
||||
}
|
||||
print "\n";
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#include <libkmod.h>
|
||||
#include <fts.h>
|
||||
#include <regex.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "hashmap.h"
|
||||
@@ -54,6 +55,7 @@ static bool arg_optional = false;
|
||||
static bool arg_silent = false;
|
||||
static bool arg_all = false;
|
||||
static bool arg_module = false;
|
||||
static bool arg_modalias = false;
|
||||
static bool arg_resolvelazy = false;
|
||||
static bool arg_resolvedeps = false;
|
||||
static bool arg_hostonly = false;
|
||||
@@ -400,9 +402,9 @@ static int resolve_deps(const char *src)
|
||||
_cleanup_pclose_ FILE *fptr = NULL;
|
||||
_cleanup_free_ char *cmd = NULL;
|
||||
|
||||
buf = malloc(LINE_MAX);
|
||||
if (buf == NULL)
|
||||
return -errno;
|
||||
buf = malloc(LINE_MAX);
|
||||
if (buf == NULL)
|
||||
return -errno;
|
||||
|
||||
if (strstr(src, ".so") == 0) {
|
||||
_cleanup_close_ int fd = -1;
|
||||
@@ -454,11 +456,11 @@ static int resolve_deps(const char *src)
|
||||
break;
|
||||
}
|
||||
|
||||
/* musl ldd */
|
||||
if (strstr(buf, "Not a valid dynamic program"))
|
||||
break;
|
||||
/* musl ldd */
|
||||
if (strstr(buf, "Not a valid dynamic program"))
|
||||
break;
|
||||
|
||||
/* glibc */
|
||||
/* glibc */
|
||||
if (strstr(buf, "cannot execute binary file"))
|
||||
break;
|
||||
|
||||
@@ -477,11 +479,7 @@ static int resolve_deps(const char *src)
|
||||
if (strstr(buf, destrootdir))
|
||||
break;
|
||||
|
||||
p = strstr(buf, "=>");
|
||||
if (!p)
|
||||
p = buf;
|
||||
|
||||
p = strchr(p, '/');
|
||||
p = strchr(buf, '/');
|
||||
if (p) {
|
||||
char *q;
|
||||
|
||||
@@ -631,7 +629,7 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
|
||||
hashmap_put(items, i, i);
|
||||
|
||||
ret = asprintf(&fulldstpath, "%s/%s", destrootdir, dst);
|
||||
ret = asprintf(&fulldstpath, "%s/%s", destrootdir, (dst[0]=='/' ? (dst+1) : dst));
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
@@ -718,7 +716,7 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
if (lstat(fulldstpath, &sb) != 0) {
|
||||
_cleanup_free_ char *absdestpath = NULL;
|
||||
|
||||
ret = asprintf(&absdestpath, "%s/%s", destrootdir, abspath);
|
||||
ret = asprintf(&absdestpath, "%s/%s", destrootdir, (abspath[0]=='/' ? (abspath+1) : abspath));
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
@@ -794,6 +792,7 @@ static void usage(int status)
|
||||
" --kerneldir Specify the kernel module directory\n"
|
||||
" --firmwaredirs Specify the firmware directory search path with : separation\n"
|
||||
" --silent Don't display error messages for kernel module install\n"
|
||||
" --modalias Only generate module list from /sys/devices modalias list\n"
|
||||
" -o --optional If kernel module does not exist, do not fail\n"
|
||||
" -p --mod-filter-path Filter kernel modules by path regexp\n"
|
||||
" -P --mod-filter-nopath Exclude kernel modules by path regexp\n"
|
||||
@@ -818,6 +817,7 @@ static int parse_argv(int argc, char *argv[])
|
||||
enum {
|
||||
ARG_VERSION = 0x100,
|
||||
ARG_SILENT,
|
||||
ARG_MODALIAS,
|
||||
ARG_KERNELDIR,
|
||||
ARG_FIRMWAREDIRS,
|
||||
ARG_DEBUG
|
||||
@@ -843,6 +843,7 @@ static int parse_argv(int argc, char *argv[])
|
||||
{"mod-filter-symbol", required_argument, NULL, 's'},
|
||||
{"mod-filter-nosymbol", required_argument, NULL, 'S'},
|
||||
{"mod-filter-noname", required_argument, NULL, 'N'},
|
||||
{"modalias", no_argument, NULL, ARG_MODALIAS},
|
||||
{"silent", no_argument, NULL, ARG_SILENT},
|
||||
{"kerneldir", required_argument, NULL, ARG_KERNELDIR},
|
||||
{"firmwaredirs", required_argument, NULL, ARG_FIRMWAREDIRS},
|
||||
@@ -863,6 +864,10 @@ static int parse_argv(int argc, char *argv[])
|
||||
case ARG_SILENT:
|
||||
arg_silent = true;
|
||||
break;
|
||||
case ARG_MODALIAS:
|
||||
arg_modalias = true;
|
||||
return 1;
|
||||
break;
|
||||
case 'v':
|
||||
arg_loglevel = LOG_INFO;
|
||||
break;
|
||||
@@ -924,13 +929,6 @@ static int parse_argv(int argc, char *argv[])
|
||||
break;
|
||||
case ARG_KERNELDIR:
|
||||
kerneldir = strdup(optarg);
|
||||
if ((strncmp("/lib/modules/", kerneldir, 13) != 0)
|
||||
&& (strncmp("/usr/lib/modules/", kerneldir, 17) != 0)) {
|
||||
char *p;
|
||||
p = strstr(kerneldir, "/lib/modules/");
|
||||
if (p != NULL)
|
||||
kerneldirlen = p - kerneldir;
|
||||
}
|
||||
break;
|
||||
case ARG_FIRMWAREDIRS:
|
||||
firmwaredirs = strv_split(optarg, ":");
|
||||
@@ -949,6 +947,16 @@ static int parse_argv(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (!kerneldir) {
|
||||
struct utsname buf;
|
||||
uname(&buf);
|
||||
kerneldir = strdup(buf.version);
|
||||
}
|
||||
|
||||
if (arg_modalias) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (arg_module) {
|
||||
if (!firmwaredirs) {
|
||||
char *path = NULL;
|
||||
@@ -965,6 +973,7 @@ static int parse_argv(int argc, char *argv[])
|
||||
firmwaredirs = strv_split(path, ":");
|
||||
}
|
||||
}
|
||||
|
||||
if (!optind || optind == argc) {
|
||||
log_error("No SOURCE argument given");
|
||||
usage(EXIT_FAILURE);
|
||||
@@ -1048,7 +1057,7 @@ static int install_one(const char *src, const char *dst)
|
||||
if (strchr(src, '/') == NULL) {
|
||||
char **p = find_binary(src);
|
||||
if (p) {
|
||||
char **q = NULL;
|
||||
char **q = NULL;
|
||||
STRV_FOREACH(q, p) {
|
||||
char *newsrc = *q;
|
||||
log_debug("dracut_install '%s' '%s'", newsrc, dst);
|
||||
@@ -1084,7 +1093,7 @@ static int install_all(int argc, char **argv)
|
||||
if (strchr(argv[i], '/') == NULL) {
|
||||
char **p = find_binary(argv[i]);
|
||||
if (p) {
|
||||
char **q = NULL;
|
||||
char **q = NULL;
|
||||
STRV_FOREACH(q, p) {
|
||||
char *newsrc = *q;
|
||||
log_debug("dracut_install '%s'", newsrc);
|
||||
@@ -1218,69 +1227,20 @@ static bool check_module_path(const char *path)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool check_module_hostonly(struct kmod_module *mod)
|
||||
static int install_dependent_modules(struct kmod_list *modlist)
|
||||
{
|
||||
const char *name = kmod_module_get_name(mod);
|
||||
|
||||
if (check_hashmap(modules_loaded, name))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static int install_module(struct kmod_module *mod)
|
||||
{
|
||||
int ret = 0;
|
||||
struct kmod_list *itr;
|
||||
_cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL;
|
||||
struct kmod_module *mod;
|
||||
const char *path = NULL;
|
||||
const char *name = NULL;
|
||||
int ret = 0;
|
||||
|
||||
name = kmod_module_get_name(mod);
|
||||
if (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0)) {
|
||||
log_debug("dracut_install '%s' is excluded", name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (arg_hostonly && ! check_module_hostonly(mod)) {
|
||||
log_debug("dracut_install '%s' not hostonly", name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
path = kmod_module_get_path(mod);
|
||||
if (!path)
|
||||
return -ENOENT;
|
||||
|
||||
if (check_hashmap(items_failed, path))
|
||||
return -1;
|
||||
|
||||
if (check_hashmap(items, path))
|
||||
return 0;
|
||||
|
||||
if (!check_module_path(path) || !check_module_symbols(mod)) {
|
||||
log_debug("No symbol or patch match for '%s'", path);
|
||||
return 1;
|
||||
}
|
||||
|
||||
log_debug("dracut_install '%s' '%s'", path, &path[kerneldirlen]);
|
||||
|
||||
ret = dracut_install(path, &path[kerneldirlen], false, false, true);
|
||||
if (ret == 0) {
|
||||
log_debug("dracut_install '%s' OK", kmod_module_get_name(mod));
|
||||
} else if (!arg_optional) {
|
||||
if (!arg_silent)
|
||||
log_error("dracut_install '%s' ERROR", kmod_module_get_name(mod));
|
||||
return ret;
|
||||
}
|
||||
install_firmware(mod);
|
||||
|
||||
modlist = kmod_module_get_dependencies(mod);
|
||||
kmod_list_foreach(itr, modlist) {
|
||||
mod = kmod_module_get_module(itr);
|
||||
path = kmod_module_get_path(mod);
|
||||
|
||||
name = kmod_module_get_name(mod);
|
||||
if (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0)) {
|
||||
if ((path == NULL) || (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0))) {
|
||||
kmod_module_unref(mod);
|
||||
continue;
|
||||
}
|
||||
@@ -1297,62 +1257,210 @@ static int install_module(struct kmod_module *mod)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int install_modules(int argc, char **argv)
|
||||
static int install_module(struct kmod_module *mod)
|
||||
{
|
||||
_cleanup_kmod_unref_ struct kmod_ctx *ctx = NULL;
|
||||
int 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;
|
||||
const char *path = NULL;
|
||||
const char *name = NULL;
|
||||
|
||||
name = kmod_module_get_name(mod);
|
||||
if (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0)) {
|
||||
log_debug("dracut_install '%s' is excluded", name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (arg_hostonly && !check_hashmap(modules_loaded, name)) {
|
||||
log_debug("dracut_install '%s' not hostonly", name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
path = kmod_module_get_path(mod);
|
||||
if (!path)
|
||||
return -ENOENT;
|
||||
|
||||
if (check_hashmap(items_failed, path))
|
||||
return -1;
|
||||
|
||||
if (check_hashmap(items, path))
|
||||
return 0;
|
||||
|
||||
if (!check_module_path(path) || !check_module_symbols(mod)) {
|
||||
log_debug("No symbol or path match for '%s'", path);
|
||||
return 1;
|
||||
}
|
||||
|
||||
log_debug("dracut_install '%s' '%s'", path, &path[kerneldirlen]);
|
||||
|
||||
ret = dracut_install(path, &path[kerneldirlen], false, false, true);
|
||||
if (ret == 0) {
|
||||
log_debug("dracut_install '%s' OK", kmod_module_get_name(mod));
|
||||
} else if (!arg_optional) {
|
||||
if (!arg_silent)
|
||||
log_error("dracut_install '%s' ERROR", kmod_module_get_name(mod));
|
||||
return ret;
|
||||
}
|
||||
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)
|
||||
ret = install_dependent_modules(modpre);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int modalias_list(struct kmod_ctx *ctx)
|
||||
{
|
||||
int err;
|
||||
struct kmod_list *loaded_list = NULL;
|
||||
struct kmod_list *itr, *l;
|
||||
int err;
|
||||
_cleanup_fts_close_ FTS *fts = NULL;
|
||||
|
||||
struct kmod_module *mod = NULL, *mod_o = NULL;
|
||||
{
|
||||
char *paths[] = { "/sys/devices", NULL };
|
||||
fts = fts_open(paths, FTS_NOCHDIR|FTS_NOSTAT, NULL);
|
||||
}
|
||||
for (FTSENT *ftsent = fts_read(fts); ftsent != NULL; ftsent = fts_read(fts)) {
|
||||
_cleanup_fclose_ FILE *f = NULL;
|
||||
_cleanup_kmod_module_unref_list_ struct kmod_list *list = NULL;
|
||||
struct kmod_list *l;
|
||||
|
||||
const char *modname = NULL;
|
||||
int i;
|
||||
int err;
|
||||
|
||||
ctx = kmod_new(kerneldir, NULL);
|
||||
if (arg_hostonly) {
|
||||
err = kmod_module_new_from_loaded(ctx, &loaded_list);
|
||||
if (err < 0) {
|
||||
errno = err;
|
||||
log_error("Could not get list of loaded modules: %m. Switching to non-hostonly mode.");
|
||||
arg_hostonly = false;
|
||||
} else {
|
||||
kmod_list_foreach(itr, loaded_list) {
|
||||
_cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL;
|
||||
char alias[2048];
|
||||
size_t len;
|
||||
|
||||
struct kmod_module *mod = kmod_module_get_module(itr);
|
||||
if (strncmp("modalias", ftsent->fts_name, 8) != 0)
|
||||
continue;
|
||||
if (!(f = fopen(ftsent->fts_accpath, "r")))
|
||||
continue;
|
||||
|
||||
if(!fgets(alias, sizeof(alias), f))
|
||||
continue;
|
||||
|
||||
len = strlen(alias);
|
||||
|
||||
if (len == 0)
|
||||
continue;
|
||||
|
||||
if (alias[len-1] == '\n')
|
||||
alias[len-1] = 0;
|
||||
|
||||
err = kmod_module_new_from_lookup(ctx, alias, &list);
|
||||
if (err < 0)
|
||||
continue;
|
||||
|
||||
kmod_list_foreach(l, list) {
|
||||
struct kmod_module *mod = kmod_module_get_module(l);
|
||||
char *name = strdup(kmod_module_get_name(mod));
|
||||
kmod_module_unref(mod);
|
||||
hashmap_put(modules_loaded, name, name);
|
||||
}
|
||||
}
|
||||
|
||||
err = kmod_module_new_from_loaded(ctx, &loaded_list);
|
||||
if (err < 0) {
|
||||
errno = err;
|
||||
log_error("Could not get list of loaded modules: %m. Switching to non-hostonly mode.");
|
||||
arg_hostonly = false;
|
||||
} else {
|
||||
kmod_list_foreach(itr, loaded_list) {
|
||||
_cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL;
|
||||
|
||||
struct kmod_module *mod = kmod_module_get_module(itr);
|
||||
char *name = strdup(kmod_module_get_name(mod));
|
||||
hashmap_put(modules_loaded, name, name);
|
||||
kmod_module_unref(mod);
|
||||
|
||||
/* also put the modules from the new kernel in the hashmap,
|
||||
* which resolve the name as an alias, in case a kernel module is
|
||||
* renamed.
|
||||
*/
|
||||
err = kmod_module_new_from_lookup(ctx, name, &modlist);
|
||||
if (err < 0)
|
||||
continue;
|
||||
if (!modlist)
|
||||
continue;
|
||||
kmod_list_foreach(l, modlist) {
|
||||
mod = kmod_module_get_module(l);
|
||||
char *name = strdup(kmod_module_get_name(mod));
|
||||
hashmap_put(modules_loaded, name, name);
|
||||
kmod_module_unref(mod);
|
||||
}
|
||||
}
|
||||
kmod_module_unref_list(loaded_list);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* also put the modules from the new kernel in the hashmap,
|
||||
* which resolve the name as an alias, in case a kernel module is
|
||||
* renamed.
|
||||
*/
|
||||
err = kmod_module_new_from_lookup(ctx, name, &modlist);
|
||||
if (err < 0)
|
||||
continue;
|
||||
if (!modlist)
|
||||
continue;
|
||||
kmod_list_foreach(l, modlist) {
|
||||
mod = kmod_module_get_module(l);
|
||||
char *name = strdup(kmod_module_get_name(mod));
|
||||
hashmap_put(modules_loaded, name, name);
|
||||
kmod_module_unref(mod);
|
||||
static int install_modules(int argc, char **argv)
|
||||
{
|
||||
_cleanup_kmod_unref_ struct kmod_ctx *ctx = NULL;
|
||||
struct kmod_list *itr;
|
||||
|
||||
struct kmod_module *mod = NULL, *mod_o = NULL;
|
||||
|
||||
const char *abskpath = NULL;
|
||||
char *p;
|
||||
int i;
|
||||
int modinst = 0;
|
||||
|
||||
ctx = kmod_new(kerneldir, NULL);
|
||||
abskpath = kmod_get_dirname(ctx);
|
||||
|
||||
p = strstr(abskpath, "/lib/modules/");
|
||||
if (p != NULL)
|
||||
kerneldirlen = p - abskpath;
|
||||
|
||||
if (arg_hostonly) {
|
||||
char *modalias_file;
|
||||
modalias_file = getenv("DRACUT_KERNEL_MODALIASES");
|
||||
|
||||
if (modalias_file == NULL) {
|
||||
modalias_list(ctx);
|
||||
} else {
|
||||
_cleanup_fclose_ FILE *f = NULL;
|
||||
if ((f = fopen(modalias_file, "r"))) {
|
||||
char name[2048];
|
||||
|
||||
while (!feof(f)) {
|
||||
size_t len;
|
||||
char *dupname = NULL;
|
||||
|
||||
if(!(fgets(name, sizeof(name), f)))
|
||||
continue;
|
||||
len = strlen(name);
|
||||
|
||||
if (len == 0)
|
||||
continue;
|
||||
|
||||
if (name[len-1] == '\n')
|
||||
name[len-1] = 0;
|
||||
|
||||
log_debug("Adding module '%s' to hostonly module list", name);
|
||||
dupname = strdup(name);
|
||||
hashmap_put(modules_loaded, dupname, dupname);
|
||||
}
|
||||
}
|
||||
kmod_module_unref_list(loaded_list);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
int r = 0;
|
||||
int ret = -1;
|
||||
|
||||
log_debug("Handle module '%s'", argv[i]);
|
||||
|
||||
if (argv[i][0] == '/') {
|
||||
_cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL;
|
||||
_cleanup_free_ const char *modname = NULL;
|
||||
|
||||
r = kmod_module_new_from_path(ctx, argv[i], &mod_o);
|
||||
if (r < 0) {
|
||||
@@ -1362,7 +1470,7 @@ static int install_modules(int argc, char **argv)
|
||||
continue;
|
||||
}
|
||||
/* Check, if we have to load another module with that name instead */
|
||||
modname = kmod_module_get_name(mod_o);
|
||||
modname = strdup(kmod_module_get_name(mod_o));
|
||||
|
||||
if (!modname) {
|
||||
if (!arg_optional) {
|
||||
@@ -1406,6 +1514,7 @@ static int install_modules(int argc, char **argv)
|
||||
return -ENOENT;
|
||||
};
|
||||
ret = ( ret == 0 ? 0 : r );
|
||||
modinst = 1;
|
||||
}
|
||||
} else if (argv[i][0] == '=') {
|
||||
_cleanup_free_ char *path1 = NULL, *path2 = NULL, *path3 = NULL;
|
||||
@@ -1438,6 +1547,7 @@ static int install_modules(int argc, char **argv)
|
||||
|
||||
for (FTSENT *ftsent = fts_read(fts); ftsent != NULL; ftsent = fts_read(fts)) {
|
||||
_cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL;
|
||||
_cleanup_free_ const char *modname = NULL;
|
||||
|
||||
if((ftsent->fts_info == FTS_D) && !check_module_path(ftsent->fts_accpath)) {
|
||||
fts_set(fts, ftsent, FTS_SKIP);
|
||||
@@ -1460,7 +1570,7 @@ static int install_modules(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* Check, if we have to load another module with that name instead */
|
||||
modname = kmod_module_get_name(mod_o);
|
||||
modname = strdup(kmod_module_get_name(mod_o));
|
||||
|
||||
if (!modname) {
|
||||
log_error("Failed to get name for module '%s'", ftsent->fts_accpath);
|
||||
@@ -1499,6 +1609,7 @@ static int install_modules(int argc, char **argv)
|
||||
return -ENOENT;
|
||||
};
|
||||
ret = ( ret == 0 ? 0 : r );
|
||||
modinst = 1;
|
||||
}
|
||||
}
|
||||
if (errno) {
|
||||
@@ -1545,10 +1656,11 @@ static int install_modules(int argc, char **argv)
|
||||
return -ENOENT;
|
||||
};
|
||||
ret = ( ret == 0 ? 0 : r );
|
||||
modinst = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ((ret != 0) && (!arg_optional)) {
|
||||
if ((modinst != 0) && (ret != 0) && (!arg_optional)) {
|
||||
if (!arg_silent)
|
||||
log_error("ERROR: installing '%s'", argv[i]);
|
||||
return EXIT_FAILURE;
|
||||
@@ -1576,6 +1688,20 @@ int main(int argc, char **argv)
|
||||
|
||||
log_open();
|
||||
|
||||
modules_loaded = hashmap_new(string_hash_func, string_compare_func);
|
||||
if (arg_modalias) {
|
||||
Iterator i;
|
||||
char *name;
|
||||
_cleanup_kmod_unref_ struct kmod_ctx *ctx = NULL;
|
||||
ctx = kmod_new(kerneldir, NULL);
|
||||
|
||||
modalias_list(ctx);
|
||||
HASHMAP_FOREACH(name, modules_loaded, i) {
|
||||
printf("%s\n", name);
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
path = getenv("PATH");
|
||||
|
||||
if (path == NULL) {
|
||||
@@ -1614,7 +1740,6 @@ int main(int argc, char **argv)
|
||||
|
||||
items = hashmap_new(string_hash_func, string_compare_func);
|
||||
items_failed = hashmap_new(string_hash_func, string_compare_func);
|
||||
modules_loaded = hashmap_new(string_hash_func, string_compare_func);
|
||||
|
||||
if (!items || !items_failed || !modules_loaded) {
|
||||
log_error("Out of memory");
|
||||
|
@@ -167,7 +167,7 @@ int safe_atoi(const char *s, int *ret_i);
|
||||
int safe_atollu(const char *s, unsigned long long *ret_u);
|
||||
int safe_atolli(const char *s, long long int *ret_i);
|
||||
|
||||
#if __WORDSIZE == 32
|
||||
#if LONG_MAX == INT_MAX
|
||||
static inline int safe_atolu(const char *s, unsigned long *ret_u) {
|
||||
assert_cc(sizeof(unsigned long) == sizeof(unsigned));
|
||||
return safe_atou(s, (unsigned*) ret_u);
|
||||
|
54
logtee.c
Normal file
54
logtee.c
Normal file
@@ -0,0 +1,54 @@
|
||||
#define _GNU_SOURCE
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
|
||||
#define BUFLEN 4096
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
int fd;
|
||||
int len, slen;
|
||||
|
||||
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);
|
||||
if (fd == -1) {
|
||||
perror("open");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
fprintf(stderr, "Logging to %s: ", argv[1]);
|
||||
|
||||
slen = 0;
|
||||
|
||||
do {
|
||||
len = splice(STDIN_FILENO, NULL, fd, NULL,
|
||||
BUFLEN, SPLICE_F_MOVE);
|
||||
|
||||
if (len < 0) {
|
||||
if (errno == EAGAIN)
|
||||
continue;
|
||||
perror("tee");
|
||||
exit(EXIT_FAILURE);
|
||||
} else
|
||||
if (len == 0)
|
||||
break;
|
||||
slen += len;
|
||||
if ((slen/BUFLEN) > 0) {
|
||||
fprintf(stderr, ".");
|
||||
}
|
||||
slen = slen % BUFLEN;
|
||||
|
||||
} while (1);
|
||||
close(fd);
|
||||
fprintf(stderr, "\n");
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
@@ -34,11 +34,17 @@ OPTIONS
|
||||
**-k, --kver** _<kernel version>_::
|
||||
inspect the initramfs of <kernel version>.
|
||||
|
||||
**-m, --mod**::
|
||||
list dracut modules included of the initramfs image.
|
||||
|
||||
**--unpack**::
|
||||
unpack the initramfs to the current directory, instead of displaying the contents.
|
||||
If optional filenames are given, will only unpack specified files, else the whole image will be unpacked.
|
||||
Won't unpack anything from early cpio part.
|
||||
|
||||
**--unpackearly**::
|
||||
unpack the early microcode initramfs to the current directory, instead of displaying the contents.
|
||||
Same as --unpack, but only unpack files from early cpio part.
|
||||
|
||||
**-v, --verbose**::
|
||||
unpack verbosely
|
||||
|
39
lsinitrd.sh
39
lsinitrd.sh
@@ -28,7 +28,10 @@ usage()
|
||||
echo "-m, --mod list modules."
|
||||
echo "-f, --file <filename> print the contents of <filename>."
|
||||
echo "--unpack unpack the initramfs, instead of displaying the contents."
|
||||
echo " If optional filenames are given, will only unpack specified files,"
|
||||
echo " else the whole image will be unpacked. Won't unpack anything from early cpio part."
|
||||
echo "--unpackearly unpack the early microcode part of the initramfs."
|
||||
echo " Same as --unpack, but only unpack files from early cpio part."
|
||||
echo "-v, --verbose unpack verbosely."
|
||||
echo "-k, --kver <kernel version> inspect the initramfs of <kernel version>."
|
||||
echo
|
||||
@@ -130,7 +133,7 @@ extract_files()
|
||||
for f in "${!filenames[@]}"; do
|
||||
[[ $nofileinfo ]] || echo "initramfs:/$f"
|
||||
[[ $nofileinfo ]] || echo "========================================================================"
|
||||
$CAT $image | cpio --extract --verbose --quiet --to-stdout $f 2>/dev/null
|
||||
$CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --to-stdout "$f" 2>/dev/null
|
||||
((ret+=$?))
|
||||
[[ $nofileinfo ]] || echo "========================================================================"
|
||||
[[ $nofileinfo ]] || echo
|
||||
@@ -149,9 +152,9 @@ list_files()
|
||||
{
|
||||
echo "========================================================================"
|
||||
if [ "$sorted" -eq 1 ]; then
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --list | sort -n -k5
|
||||
$CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --list | sort -n -k5
|
||||
else
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --list | sort -k9
|
||||
$CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --list | sort -k9
|
||||
fi
|
||||
((ret+=$?))
|
||||
echo "========================================================================"
|
||||
@@ -159,8 +162,15 @@ list_files()
|
||||
|
||||
unpack_files()
|
||||
{
|
||||
$CAT "$image" | cpio -id --quiet $verbose
|
||||
((ret+=$?))
|
||||
if (( ${#filenames[@]} > 0 )); then
|
||||
for f in "${!filenames[@]}"; do
|
||||
$CAT "$image" 2>/dev/null | cpio -id --quiet $verbose $f
|
||||
((ret+=$?))
|
||||
done
|
||||
else
|
||||
$CAT "$image" 2>/dev/null | cpio -id --quiet $verbose
|
||||
((ret+=$?))
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +185,10 @@ case $bin in
|
||||
CAT="cat --"
|
||||
is_early=$(cpio --extract --verbose --quiet --to-stdout -- 'early_cpio' < "$image" 2>/dev/null)
|
||||
if [[ "$is_early" ]]; then
|
||||
if [[ -n "$unpackearly" ]]; then
|
||||
if [[ -n "$unpack" ]]; then
|
||||
# should use --unpackearly for early CPIO
|
||||
:
|
||||
elif [[ -n "$unpackearly" ]]; then
|
||||
unpack_files
|
||||
elif (( ${#filenames[@]} > 0 )); then
|
||||
extract_files
|
||||
@@ -219,6 +232,9 @@ case $bin in
|
||||
$'\x89'LZO$'\0'*)
|
||||
CAT="lzop -d -c"
|
||||
;;
|
||||
$'\x28\xB5\x2F\xFD'*)
|
||||
CAT="zstd -d -c"
|
||||
;;
|
||||
*)
|
||||
if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
|
||||
CAT="xzcat --single-stream --"
|
||||
@@ -238,6 +254,17 @@ if [[ $SKIP ]]; then
|
||||
CAT=skipcpio
|
||||
fi
|
||||
|
||||
if (( ${#filenames[@]} > 1 )); then
|
||||
TMPFILE="$(mktemp -t --suffix=.cpio lsinitrd.XXXXXX)"
|
||||
$CAT "$image" 2>/dev/null > $TMPFILE
|
||||
trap "rm -f '$TMPFILE'" EXIT
|
||||
pre_decompress()
|
||||
{
|
||||
cat $TMPFILE
|
||||
}
|
||||
CAT=pre_decompress
|
||||
fi
|
||||
|
||||
ret=0
|
||||
|
||||
if [[ -n "$unpack" ]]; then
|
||||
|
@@ -18,7 +18,7 @@ DESCRIPTION
|
||||
version <kernel-version> by calling *dracut*.
|
||||
|
||||
[IMPORTANT]
|
||||
This version of mkinitrd is provided for compability with older
|
||||
This version of mkinitrd is provided for compatibility with older
|
||||
versions of mkinitrd. If a more fine grained control over the
|
||||
resulting image is needed, *dracut* should be called directly.
|
||||
|
||||
@@ -30,7 +30,7 @@ OPTIONS
|
||||
**-k** _<kernel_list>_::
|
||||
List of kernel images for which initrd files are created (relative
|
||||
to _boot_dir_), Image name should begin with the following string,
|
||||
defaults to _vmlinux_ on ppc/ppc64, _image_ on s390/s390x and _vmlinuz_
|
||||
defaults to _vmlinux_ on ppc/ppc64, _image_ on s390/s390x and _vmlinuz_
|
||||
for everything else.
|
||||
|
||||
**-i** _<initrd_list>_::
|
||||
@@ -51,7 +51,7 @@ OPTIONS
|
||||
|
||||
**-d** _<root_device>_::
|
||||
Root device, defaults to the device from which the root_dir is
|
||||
mounted; overwrites the rootdev enviroment variable if set
|
||||
mounted; overwrites the rootdev environment variable if set
|
||||
|
||||
**-s** _<size>_::
|
||||
Add splash animation and bootscreen to initrd.
|
||||
|
@@ -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."
|
||||
@@ -104,7 +104,7 @@ calc_netmask() {
|
||||
local prefix=$1
|
||||
|
||||
[ -z "$prefix" ] && return
|
||||
mask=$(echo "(2 ^ 32) - (2 ^ $prefix)" | bc -l)
|
||||
mask=$(( 0xffffffff << (32 - $prefix) ))
|
||||
byte1=$(( mask >> 24 ))
|
||||
byte2=$(( mask >> 16 ))
|
||||
byte3=$(( mask >> 8 ))
|
||||
@@ -265,7 +265,7 @@ while (($# > 0)); do
|
||||
;;
|
||||
-M) read_arg map_file "$@" || shift $?
|
||||
;;
|
||||
-A) host_only=0;;
|
||||
-A) dracut_args="${dracut_args} --no-host-only";;
|
||||
-B) skip_update_bootloader=1;;
|
||||
-v|--verbose) dracut_args="${dracut_args} -v";;
|
||||
-L) logfile=;;
|
||||
|
@@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
[[ "$mount_needs" ]] && return 1
|
||||
require_binaries $systemdutildir/systemd-bootchart || return 1
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_symlink /init /sbin/init
|
||||
inst_multiple $systemdutildir/systemd-bootchart
|
||||
}
|
@@ -18,7 +18,7 @@ depends() {
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
hostonly='' instmods autofs4 ipv6
|
||||
hostonly='' instmods autofs4 ipv6 algif_hash hmac sha256
|
||||
instmods -s efivarfs
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ install() {
|
||||
|
||||
inst_multiple -o \
|
||||
$systemdutildir/systemd \
|
||||
$systemdutildir/systemd-coredump \
|
||||
$systemdutildir/systemd-cgroups-agent \
|
||||
$systemdutildir/systemd-shutdown \
|
||||
$systemdutildir/systemd-reply-password \
|
||||
@@ -77,6 +78,7 @@ install() {
|
||||
$systemdsystemunitdir/sys-kernel-config.mount \
|
||||
\
|
||||
$systemdsystemunitdir/kmod-static-nodes.service \
|
||||
$systemdsystemunitdir/systemd-tmpfiles-setup.service \
|
||||
$systemdsystemunitdir/systemd-tmpfiles-setup-dev.service \
|
||||
$systemdsystemunitdir/systemd-ask-password-console.path \
|
||||
$systemdsystemunitdir/systemd-udevd-control.socket \
|
||||
@@ -112,6 +114,7 @@ install() {
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-udevd.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-udev-trigger.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/kmod-static-nodes.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-tmpfiles-setup.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-tmpfiles-setup-dev.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-sysctl.service \
|
||||
\
|
||||
@@ -157,7 +160,7 @@ install() {
|
||||
}
|
||||
|
||||
_mods=$(modules_load_get /usr/lib/modules-load.d)
|
||||
[[ $_mods ]] && instmods $_mods
|
||||
[[ $_mods ]] && hostonly='' instmods $_mods
|
||||
|
||||
if [[ $hostonly ]]; then
|
||||
inst_multiple -H -o \
|
||||
@@ -177,7 +180,7 @@ install() {
|
||||
${NULL}
|
||||
|
||||
_mods=$(modules_load_get /etc/modules-load.d)
|
||||
[[ $_mods ]] && instmods $_mods
|
||||
[[ $_mods ]] && hostonly='' instmods $_mods
|
||||
fi
|
||||
|
||||
if ! [[ -e "$initdir/etc/machine-id" ]]; then
|
||||
@@ -194,6 +197,10 @@ install() {
|
||||
grep '^utmp:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^root:' /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"
|
||||
|
||||
ln_r $systemdutildir/systemd "/init"
|
||||
ln_r $systemdutildir/systemd "/sbin/init"
|
||||
|
||||
|
29
modules.d/00warpclock/module-setup.sh
Normal file
29
modules.d/00warpclock/module-setup.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
# hwclock does not exist on S390(x), bail out silently then
|
||||
local _arch=$(uname -m)
|
||||
[ "$_arch" = "s390" -o "$_arch" = "s390x" ] && return 1
|
||||
|
||||
[ -e /etc/localtime -a -e /etc/adjtime ] || return 1
|
||||
require_binaries /sbin/hwclock || return 1
|
||||
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst /usr/share/zoneinfo/UTC
|
||||
inst /etc/localtime
|
||||
inst /etc/adjtime
|
||||
inst_hook pre-trigger 00 "$moddir/warpclock.sh"
|
||||
inst /sbin/hwclock
|
||||
}
|
9
modules.d/00warpclock/warpclock.sh
Normal file
9
modules.d/00warpclock/warpclock.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
if test -e /etc/adjtime ; then
|
||||
while read line ; do
|
||||
if test "$line" = LOCAL ; then
|
||||
hwclock --systz
|
||||
fi
|
||||
done < /etc/adjtime
|
||||
fi
|
@@ -77,12 +77,6 @@ do_fips()
|
||||
local _module
|
||||
|
||||
KERNEL=$(uname -r)
|
||||
BOOT_IMAGE="$(getarg BOOT_IMAGE)"
|
||||
BOOT_IMAGE="${BOOT_IMAGE:-/vmlinuz-${KERNEL}}"
|
||||
if ! [ -e "/boot/.${BOOT_IMAGE}.hmac" ] && ! [ -e "/boot/.vmlinuz-${KERNEL}.hmac" ]; then
|
||||
warn "/boot/.${BOOT_IMAGE}.hmac does not exist"
|
||||
return 1
|
||||
fi
|
||||
|
||||
FIPSMODULES=$(cat /etc/fipsmodules)
|
||||
|
||||
@@ -90,7 +84,7 @@ do_fips()
|
||||
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
|
||||
if ! modprobe "${_module}" 2>/tmp/fips.modprobe_err; then
|
||||
# check if kernel provides generic algo
|
||||
_found=0
|
||||
while read _k _s _v || [ -n "$_k" ]; do
|
||||
@@ -99,7 +93,7 @@ do_fips()
|
||||
_found=1
|
||||
break
|
||||
done </proc/crypto
|
||||
[ "$_found" = "0" ] && return 1
|
||||
[ "$_found" = "0" ] && cat /tmp/fips.modprobe_err >&2 && return 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
@@ -115,7 +109,30 @@ do_fips()
|
||||
elif [ -e "/run/initramfs/live/isolinux/vmlinuz0" ]; then
|
||||
do_rhevh_check /run/initramfs/live/isolinux/vmlinuz0 || return 1
|
||||
else
|
||||
sha512hmac -c "/boot/.${BOOT_IMAGE}.hmac" || return 1
|
||||
BOOT_IMAGE="$(getarg BOOT_IMAGE)"
|
||||
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
|
||||
#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
|
||||
#so if we can't find anything, let's treat it in the same way as if it was empty
|
||||
if ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE_NAME}" ]; then
|
||||
BOOT_IMAGE_NAME="vmlinuz-${KERNEL}"
|
||||
BOOT_IMAGE_PATH=""
|
||||
fi
|
||||
fi
|
||||
|
||||
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
|
||||
fi
|
||||
|
||||
info "All initrd crypto checks done"
|
||||
|
@@ -16,12 +16,27 @@ installkernel() {
|
||||
if [[ -f "${srcmods}/modules.fips" ]]; then
|
||||
_fipsmodules="$(cat "${srcmods}/modules.fips")"
|
||||
else
|
||||
_fipsmodules="aead aes_generic aes-x86_64 ansi_cprng arc4 authenc authencesn blowfish camellia cast6 cbc ccm "
|
||||
_fipsmodules+="chainiv crc32c crct10dif_generic cryptomgr crypto_null ctr cts deflate des des3_ede dm-crypt dm-mod drbg "
|
||||
_fipsmodules+="ecb eseqiv fcrypt gcm ghash_generic hmac khazad lzo md4 md5 michael_mic rmd128 "
|
||||
_fipsmodules+="rmd160 rmd256 rmd320 rot13 salsa20 seed seqiv serpent sha1 sha224 sha256 sha256_generic "
|
||||
_fipsmodules+="sha384 sha512 sha512_generic tcrypt tea tnepres twofish wp256 wp384 wp512 xeta xtea xts zlib "
|
||||
_fipsmodules+="aes_s390 des_s390 prng sha256_s390 sha_common des_check_key ghash_s390 sha1_s390 sha512_s390"
|
||||
_fipsmodules=""
|
||||
|
||||
# Hashes:
|
||||
_fipsmodules+="sha1 sha224 sha256 sha384 sha512 "
|
||||
_fipsmodules+="sha3-224 sha3-256 sha3-384 sha3-512 "
|
||||
_fipsmodules+="crc32c crct10dif ghash "
|
||||
|
||||
# Ciphers:
|
||||
_fipsmodules+="cipher_null des3_ede aes "
|
||||
|
||||
# Modes/templates:
|
||||
_fipsmodules+="ecb cbc ctr xts gcm ccm authenc hmac cmac "
|
||||
|
||||
# Compression algs:
|
||||
_fipsmodules+="deflate lzo zlib "
|
||||
|
||||
# PRNG algs:
|
||||
_fipsmodules+="ansi_cprng "
|
||||
|
||||
# Misc:
|
||||
_fipsmodules+="aead cryptomgr tcrypt crypto_user "
|
||||
fi
|
||||
|
||||
mkdir -m 0755 -p "${initdir}/etc/modprobe.d"
|
||||
@@ -37,18 +52,12 @@ installkernel() {
|
||||
# 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_script "$moddir/fips.sh" /sbin/fips.sh
|
||||
|
||||
inst_multiple sha512hmac rmmod insmod mount uname umount fipscheck
|
||||
inst_multiple sha512hmac rmmod insmod mount uname umount
|
||||
|
||||
inst_libdir_file libsoftokn3.so libsoftokn3.so \
|
||||
libsoftokn3.chk libfreebl3.so libfreebl3.chk \
|
||||
libssl.so 'hmaccalc/sha512hmac.hmac' libssl.so.10 \
|
||||
libfreeblpriv3.so libfreeblpriv3.chk
|
||||
|
||||
inst_multiple -o prelink
|
||||
inst_simple /etc/system-fips
|
||||
[ -c ${initdir}/dev/random ] || mknod ${initdir}/dev/random c 1 8 \
|
||||
|| {
|
||||
|
@@ -38,13 +38,12 @@ install() {
|
||||
|
||||
ln_r "${systemdsystemunitdir}/initrd.target" "${systemdsystemunitdir}/default.target"
|
||||
|
||||
local VERSION=""
|
||||
local PRETTY_NAME=""
|
||||
if [ -e /etc/os-release ]; then
|
||||
. /etc/os-release
|
||||
VERSION+=" "
|
||||
PRETTY_NAME+=" "
|
||||
else
|
||||
VERSION=""
|
||||
PRETTY_NAME=""
|
||||
[[ -n ${VERSION} ]] && VERSION+=" "
|
||||
[[ -n ${PRETTY_NAME} ]] && PRETTY_NAME+=" "
|
||||
fi
|
||||
NAME=dracut
|
||||
ID=dracut
|
||||
|
@@ -1,32 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
local _fipsmodules _mod
|
||||
_fipsmodules="aesni-intel ghash_clmulni_intel"
|
||||
|
||||
mkdir -m 0755 -p "${initdir}/etc/modprobe.d"
|
||||
|
||||
for _mod in $_fipsmodules; do
|
||||
if instmods $_mod; then
|
||||
echo $_mod >> "${initdir}/etc/fipsmodules"
|
||||
echo "blacklist $_mod" >> "${initdir}/etc/modprobe.d/fips.conf"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
return 0
|
||||
}
|
||||
|
@@ -22,9 +22,6 @@ install() {
|
||||
_progs="$_progs $_i"
|
||||
done
|
||||
|
||||
# FIXME: switch_root should be in the above list, but busybox version hangs
|
||||
# (using busybox-1.15.1-7.fc14.i686 at the time of writing)
|
||||
|
||||
for _i in $_progs; do
|
||||
_path=$(find_binary "$_i")
|
||||
[ -z "$_path" ] && continue
|
||||
|
@@ -29,21 +29,24 @@ install() {
|
||||
|
||||
# This is from 10redhat-i18n.
|
||||
findkeymap () {
|
||||
local MAP=$1
|
||||
local MAPS=$1
|
||||
local MAPNAME=${1%.map*}
|
||||
[[ ! -f $MAP ]] && \
|
||||
MAP=$(find ${kbddir}/keymaps -type f -name ${MAPNAME} -o -name ${MAPNAME}.map -o -name ${MAPNAME}.map.\* | head -n1)
|
||||
[[ " $KEYMAPS " = *" $MAP "* ]] && return
|
||||
KEYMAPS="$KEYMAPS $MAP"
|
||||
case $MAP in
|
||||
*.gz) cmd=zgrep;;
|
||||
*.bz2) cmd=bzgrep;;
|
||||
*) cmd=grep ;;
|
||||
esac
|
||||
local map
|
||||
[[ ! -f $MAPS ]] && \
|
||||
MAPS=$(find ${kbddir}/keymaps -type f -name ${MAPNAME} -o -name ${MAPNAME}.map -o -name ${MAPNAME}.map.\*)
|
||||
|
||||
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
|
||||
findkeymap $FN
|
||||
for map in $MAPS; do
|
||||
KEYMAPS="$KEYMAPS $map"
|
||||
case $map in
|
||||
*.gz) cmd=zgrep;;
|
||||
*.bz2) cmd=bzgrep;;
|
||||
*) cmd=grep ;;
|
||||
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
|
||||
done
|
||||
done
|
||||
done
|
||||
}
|
||||
@@ -191,7 +194,9 @@ install() {
|
||||
findkeymap ${map}
|
||||
done
|
||||
|
||||
inst_opt_decompress ${KEYMAPS}
|
||||
for keymap in ${KEYMAPS}; do
|
||||
inst_opt_decompress ${keymap}
|
||||
done
|
||||
|
||||
inst_opt_decompress ${kbddir}/consolefonts/${DEFAULT_FONT}.*
|
||||
|
||||
@@ -204,7 +209,11 @@ install() {
|
||||
if [[ ${FONT_MAP} ]]
|
||||
then
|
||||
FONT_MAP=${FONT_MAP%.trans}
|
||||
inst_simple ${kbddir}/consoletrans/${FONT_MAP}.trans
|
||||
# There are three different formats that setfont supports
|
||||
inst_simple ${kbddir}/consoletrans/${FONT_MAP} \
|
||||
|| inst_simple ${kbddir}/consoletrans/${FONT_MAP}.trans \
|
||||
|| inst_simple ${kbddir}/consoletrans/${FONT_MAP}_to_uni.trans \
|
||||
|| dwarn "Could not find FONT_MAP ${FONT_MAP}!"
|
||||
fi
|
||||
|
||||
if [[ ${FONT_UNIMAP} ]]
|
||||
|
@@ -191,7 +191,10 @@ case $reason in
|
||||
echo '. /lib/net-lib.sh'
|
||||
echo "setup_net $netif"
|
||||
if [ -n "$new_classless_static_routes" ]; then
|
||||
modify_routes add "$(parse_option_121 $new_classless_static_routes)"
|
||||
OLDIFS="$IFS"
|
||||
IFS=".$IFS"
|
||||
parse_option_121 $new_classless_static_routes
|
||||
IFS="$OLDIFS"
|
||||
fi
|
||||
echo "source_hook initqueue/online $netif"
|
||||
[ -e /tmp/net.$netif.manualup ] || echo "/sbin/netroot $netif"
|
8
modules.d/35network-legacy/dhclient.conf
Normal file
8
modules.d/35network-legacy/dhclient.conf
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
option classless-static-routes code 121 = array of unsigned integer 8;
|
||||
|
||||
send dhcp-client-identifier = hardware;
|
||||
|
||||
request subnet-mask, broadcast-address, time-offset, routers,
|
||||
domain-name, domain-name-servers, domain-search, host-name,
|
||||
root-path, interface-mtu, classless-static-routes;
|
@@ -41,6 +41,12 @@ do_dhcp() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ ! -e /run/NetworkManager/conf.d/10-dracut-dhclient.conf ]; then
|
||||
mkdir -p /run/NetworkManager/conf.d
|
||||
echo '[main]' > /run/NetworkManager/conf.d/10-dracut-dhclient.conf
|
||||
echo 'dhcp=dhclient' >>/run/NetworkManager/conf.d/10-dracut-dhclient.conf
|
||||
fi
|
||||
|
||||
while [ $_COUNT -lt $_DHCPRETRY ]; do
|
||||
info "Starting dhcp for interface $netif"
|
||||
dhclient "$@" \
|
||||
@@ -70,23 +76,25 @@ load_ipv6() {
|
||||
}
|
||||
|
||||
do_ipv6auto() {
|
||||
local ret
|
||||
load_ipv6
|
||||
echo 0 > /proc/sys/net/ipv6/conf/$netif/forwarding
|
||||
echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_ra
|
||||
echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_redirects
|
||||
linkup $netif
|
||||
wait_for_ipv6_auto $netif
|
||||
ret=$?
|
||||
|
||||
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
|
||||
return 0
|
||||
return $ret
|
||||
}
|
||||
|
||||
# Handle static ip configuration
|
||||
do_static() {
|
||||
strglobin $ip '*:*:*' && load_ipv6
|
||||
|
||||
if [ -z "$dev" ] && ! iface_has_carrier "$netif"; then
|
||||
if ! iface_has_carrier "$netif"; then
|
||||
warn "No carrier detected on interface $netif"
|
||||
return 1
|
||||
elif ! linkup "$netif"; then
|
||||
@@ -108,17 +116,22 @@ do_static() {
|
||||
if strglobin $ip '*:*:*'; then
|
||||
# note no ip addr flush for ipv6
|
||||
ip addr add $ip/$mask ${srv:+peer $srv} dev $netif
|
||||
echo 0 > /proc/sys/net/ipv6/conf/$netif/forwarding
|
||||
echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_ra
|
||||
echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_redirects
|
||||
wait_for_ipv6_dad $netif
|
||||
else
|
||||
if command -v arping2 >/dev/null; then
|
||||
if arping2 -q -C 1 -c 2 -I $netif -0 $ip ; then
|
||||
warn "Duplicate address detected for $ip for interface $netif."
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
if ! arping -f -q -D -c 2 -I $netif $ip ; then
|
||||
warn "Duplicate address detected for $ip for interface $netif."
|
||||
return 1
|
||||
if [ -z "$srv" ]; then
|
||||
if command -v arping2 >/dev/null; then
|
||||
if arping2 -q -C 1 -c 2 -I $netif -0 $ip ; then
|
||||
warn "Duplicate address detected for $ip for interface $netif."
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
if ! arping -f -q -D -c 2 -I $netif $ip ; then
|
||||
warn "Duplicate address detected for $ip for interface $netif."
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
ip addr flush dev $netif
|
||||
@@ -252,7 +265,7 @@ if [ -z "$NO_BOND_MASTER" ]; then
|
||||
done
|
||||
|
||||
# Set mtu on bond master
|
||||
[ -n "$bondmtu" ] && ip link set mtu $bondmtu dev $netif
|
||||
[ -n "$bondmtu" ] && ip link set mtu $bondmtu dev $bondname
|
||||
|
||||
# add the bits to setup the needed post enslavement parameters
|
||||
for arg in $bondoptions ; do
|
||||
@@ -395,7 +408,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
|
||||
@@ -411,6 +428,8 @@ for p in $(getargs ip=); do
|
||||
do_dhcp -6 ;;
|
||||
auto6)
|
||||
do_ipv6auto ;;
|
||||
either6)
|
||||
do_ipv6auto || do_dhcp -6 ;;
|
||||
*)
|
||||
do_static ;;
|
||||
esac
|
93
modules.d/35network-legacy/module-setup.sh
Executable file
93
modules.d/35network-legacy/module-setup.sh
Executable file
@@ -0,0 +1,93 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
local _program
|
||||
|
||||
require_binaries ip dhclient sed awk grep || return 1
|
||||
require_any_binary arping arping2 || return 1
|
||||
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
local _arch _i _dir
|
||||
inst_multiple ip dhclient sed awk grep
|
||||
|
||||
inst_multiple -o arping arping2
|
||||
strstr "$(arping 2>&1)" "ARPing 2" && mv "$initdir/bin/arping" "$initdir/bin/arping2"
|
||||
|
||||
inst_multiple -o ping ping6
|
||||
inst_multiple -o teamd teamdctl teamnl
|
||||
inst_simple /etc/libnl/classid
|
||||
inst_script "$moddir/ifup.sh" "/sbin/ifup"
|
||||
inst_script "$moddir/dhclient-script.sh" "/sbin/dhclient-script"
|
||||
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"
|
||||
inst_hook cmdline 96 "$moddir/parse-team.sh"
|
||||
inst_hook cmdline 97 "$moddir/parse-bridge.sh"
|
||||
inst_hook cmdline 98 "$moddir/parse-ip-opts.sh"
|
||||
inst_hook cmdline 99 "$moddir/parse-ifname.sh"
|
||||
inst_hook cleanup 10 "$moddir/kill-dhclient.sh"
|
||||
|
||||
# install all config files for teaming
|
||||
unset TEAM_MASTER
|
||||
unset TEAM_CONFIG
|
||||
unset TEAM_PORT_CONFIG
|
||||
unset HWADDR
|
||||
unset SUBCHANNELS
|
||||
for i in /etc/sysconfig/network-scripts/ifcfg-*; do
|
||||
[ -e "$i" ] || continue
|
||||
case "$i" in
|
||||
*~ | *.bak | *.orig | *.rpmnew | *.rpmorig | *.rpmsave)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
(
|
||||
. "$i"
|
||||
if ! [ "${ONBOOT}" = "no" -o "${ONBOOT}" = "NO" ] \
|
||||
&& [ -n "${TEAM_MASTER}${TEAM_CONFIG}${TEAM_PORT_CONFIG}" ]; then
|
||||
if [ -n "$TEAM_CONFIG" ] && [ -n "$DEVICE" ]; then
|
||||
mkdir -p $initdir/etc/teamd
|
||||
printf -- "%s" "$TEAM_CONFIG" > "$initdir/etc/teamd/${DEVICE}.conf"
|
||||
elif [ -n "$TEAM_PORT_CONFIG" ]; then
|
||||
inst_simple "$i"
|
||||
|
||||
HWADDR="$(echo $HWADDR | sed 'y/ABCDEF/abcdef/')"
|
||||
if [ -n "$HWADDR" ]; then
|
||||
ln_r "$i" "/etc/sysconfig/network-scripts/mac-${HWADDR}.conf"
|
||||
fi
|
||||
|
||||
SUBCHANNELS="$(echo $SUBCHANNELS | sed 'y/ABCDEF/abcdef/')"
|
||||
if [ -n "$SUBCHANNELS" ]; then
|
||||
ln_r "$i" "/etc/sysconfig/network-scripts/ccw-${SUBCHANNELS}.conf"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
)
|
||||
done
|
||||
|
||||
_arch=$(uname -m)
|
||||
|
||||
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
|
||||
{"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*"
|
||||
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
@@ -102,9 +102,12 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
|
||||
# Default: We don't know the interface to use, handle all
|
||||
# Fixme: waiting for the interface as well.
|
||||
else
|
||||
cond='ACTION=="add", SUBSYSTEM=="net"'
|
||||
cond='ACTION=="add", SUBSYSTEM=="net", ENV{DEVTYPE}!="wlan|wwan"'
|
||||
# if you change the name of "91-default-net.rules", also change modules.d/80cms/cmssetup.sh
|
||||
echo "$cond, $runcmd" > /etc/udev/rules.d/91-default-net.rules
|
||||
if [ "$NEEDNET" = "1" ]; then
|
||||
echo 'for i in /tmp/net.*.did-setup; do [ -f "$i" ] && exit 0; done; exit 1' >$hookdir/initqueue/finished/wait-network.sh
|
||||
fi
|
||||
fi
|
||||
|
||||
# if you change the name of "90-net.rules", also change modules.d/80cms/cmssetup.sh
|
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Format:
|
||||
# bond=<bondname>[:<bondslaves>:[:<options>[:<mtu>]]]
|
||||
# bond=<bondname>[:<bondslaves>[:<options>[:<mtu>]]]
|
||||
#
|
||||
# bondslaves is a comma-separated list of physical (ethernet) interfaces
|
||||
# options is a comma-separated list on bonding options (modinfo bonding for details) in format compatible with initscripts
|
||||
@@ -12,7 +12,7 @@
|
||||
# if the mtu is specified, it will be set on the bond master
|
||||
#
|
||||
|
||||
# We translate list of slaves to space-separated here to mwke it easier to loop over them in ifup
|
||||
# We translate list of slaves to space-separated here to make it easier to loop over them in ifup
|
||||
# Ditto for bonding options
|
||||
parsebond() {
|
||||
local v=${1}:
|
@@ -76,6 +76,7 @@ for p in $(getargs ip=); do
|
||||
die "Sorry, automatic calculation of netmask is not yet supported"
|
||||
;;
|
||||
auto6);;
|
||||
either6);;
|
||||
dhcp|dhcp6|on|any) \
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
|
||||
die "Sorry, 'ip=$p' does not make sense for multiple interface configurations"
|
52
modules.d/35network-manager/module-setup.sh
Executable file
52
modules.d/35network-manager/module-setup.sh
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
local _program
|
||||
|
||||
require_binaries sed grep || return 1
|
||||
|
||||
# do not add this module by default
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
local _nm_version
|
||||
|
||||
_nm_version=$(NetworkManager --version)
|
||||
|
||||
inst_multiple sed grep
|
||||
|
||||
inst NetworkManager
|
||||
inst /usr/libexec/nm-initrd-generator
|
||||
inst_multiple -o teamd dhclient
|
||||
inst_hook cmdline 99 "$moddir/nm-config.sh"
|
||||
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"
|
||||
|
||||
if [[ -x "$initdir/usr/sbin/dhclient" ]]; then
|
||||
inst /usr/libexec/nm-dhcp-helper
|
||||
elif ! [[ -e "$initdir/etc/machine-id" ]]; then
|
||||
# The internal DHCP client silently fails if we
|
||||
# have no machine-id
|
||||
systemd-machine-id-setup --root="$initdir"
|
||||
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
|
||||
}
|
3
modules.d/35network-manager/nm-config.sh
Executable file
3
modules.d/35network-manager/nm-config.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
/usr/libexec/nm-initrd-generator -- $(getcmdline)
|
17
modules.d/35network-manager/nm-run.sh
Executable file
17
modules.d/35network-manager/nm-run.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/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 /sys/class/net/*/
|
||||
do
|
||||
state=/run/NetworkManager/devices/$(cat $_i/ifindex)
|
||||
grep -q connection-uuid= $state 2>/dev/null || continue
|
||||
ifname=$(basename $_i)
|
||||
sed -n 's/root-path/new_root_path/p' <$state >/tmp/dhclient.$ifname.dhcpopts
|
||||
source_hook initqueue/online $ifname
|
||||
/sbin/netroot $ifname
|
||||
done
|
@@ -1,6 +0,0 @@
|
||||
|
||||
option classless-routes code 121 = array of unsigned integer 8;
|
||||
|
||||
request subnet-mask, broadcast-address, time-offset, routers,
|
||||
domain-name, domain-name-servers, domain-search, host-name,
|
||||
root-path, interface-mtu, classless-routes;
|
@@ -2,17 +2,17 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
local _program
|
||||
|
||||
require_binaries ip dhclient || return 1
|
||||
require_any_binary arping arping2 || return 1
|
||||
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo "kernel-network-modules"
|
||||
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
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -24,71 +24,10 @@ installkernel() {
|
||||
# called by dracut
|
||||
install() {
|
||||
local _arch _i _dir
|
||||
inst_multiple ip dhclient sed awk
|
||||
inst_multiple -o arping arping2
|
||||
inst_multiple -o ping ping6
|
||||
inst_multiple -o teamd teamdctl teamnl
|
||||
inst_simple /etc/libnl/classid
|
||||
inst_script "$moddir/ifup.sh" "/sbin/ifup"
|
||||
|
||||
inst_script "$moddir/netroot.sh" "/sbin/netroot"
|
||||
inst_script "$moddir/dhclient-script.sh" "/sbin/dhclient-script"
|
||||
inst_simple "$moddir/net-lib.sh" "/lib/net-lib.sh"
|
||||
inst_simple -H "/etc/dhclient.conf"
|
||||
cat "$moddir/dhclient.conf" >> "${initdir}/etc/dhclient.conf"
|
||||
inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
|
||||
inst_hook pre-udev 60 "$moddir/net-genrules.sh"
|
||||
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
|
||||
inst_hook cmdline 92 "$moddir/parse-ibft.sh"
|
||||
inst_hook cmdline 95 "$moddir/parse-vlan.sh"
|
||||
inst_hook cmdline 96 "$moddir/parse-bond.sh"
|
||||
inst_hook cmdline 96 "$moddir/parse-team.sh"
|
||||
inst_hook cmdline 97 "$moddir/parse-bridge.sh"
|
||||
inst_hook cmdline 98 "$moddir/parse-ip-opts.sh"
|
||||
inst_hook cmdline 99 "$moddir/parse-ifname.sh"
|
||||
inst_hook cleanup 10 "$moddir/kill-dhclient.sh"
|
||||
|
||||
# install all config files for teaming
|
||||
unset TEAM_MASTER
|
||||
unset TEAM_CONFIG
|
||||
unset TEAM_PORT_CONFIG
|
||||
unset HWADDR
|
||||
unset SUBCHANNELS
|
||||
for i in /etc/sysconfig/network-scripts/ifcfg-*; do
|
||||
[ -e "$i" ] || continue
|
||||
case "$i" in
|
||||
*~ | *.bak | *.orig | *.rpmnew | *.rpmorig | *.rpmsave)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
(
|
||||
. "$i"
|
||||
if ! [ "${ONBOOT}" = "no" -o "${ONBOOT}" = "NO" ] \
|
||||
&& [ -n "${TEAM_MASTER}${TEAM_CONFIG}${TEAM_PORT_CONFIG}" ]; then
|
||||
if [ -n "$TEAM_CONFIG" ] && [ -n "$DEVICE" ]; then
|
||||
mkdir -p $initdir/etc/teamd
|
||||
printf -- "%s" "$TEAM_CONFIG" > "$initdir/etc/teamd/${DEVICE}.conf"
|
||||
elif [ -n "$TEAM_PORT_CONFIG" ]; then
|
||||
inst_simple "$i"
|
||||
|
||||
HWADDR="$(echo $HWADDR | sed 'y/ABCDEF/abcdef/')"
|
||||
if [ -n "$HWADDR" ]; then
|
||||
ln_r "$i" "/etc/sysconfig/network-scripts/mac-${HWADDR}.conf"
|
||||
fi
|
||||
|
||||
SUBCHANNELS="$(echo $SUBCHANNELS | sed 'y/ABCDEF/abcdef/')"
|
||||
if [ -n "$SUBCHANNELS" ]; then
|
||||
ln_r "$i" "/etc/sysconfig/network-scripts/ccw-${SUBCHANNELS}.conf"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
)
|
||||
done
|
||||
|
||||
_arch=$(uname -m)
|
||||
|
||||
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
|
||||
{"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*"
|
||||
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
||||
|
@@ -458,7 +458,7 @@ ip_to_var() {
|
||||
fi
|
||||
|
||||
if [ $# -eq 1 ]; then
|
||||
# format: ip={dhcp|on|any|dhcp6|auto6}
|
||||
# format: ip={dhcp|on|any|dhcp6|auto6|either6}
|
||||
# or
|
||||
# ip=<ipv4-address> means anaconda-style static config argument cluster
|
||||
autoconf="$1"
|
||||
@@ -485,7 +485,7 @@ ip_to_var() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "$2" = "dhcp" -o "$2" = "on" -o "$2" = "any" -o "$2" = "dhcp6" -o "$2" = "auto6" ]; then
|
||||
if [ "$2" = "dhcp" -o "$2" = "on" -o "$2" = "any" -o "$2" = "dhcp6" -o "$2" = "auto6" -o "$2" = "either6" ]; then
|
||||
# format: ip=<interface>:{dhcp|on|any|dhcp6|auto6}[:[<mtu>][:<macaddr>]]
|
||||
[ -n "$1" ] && dev="$1"
|
||||
[ -n "$2" ] && autoconf="$2"
|
||||
@@ -654,6 +654,7 @@ wait_for_ipv6_dad_link() {
|
||||
|
||||
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)" ] \
|
||||
&& return 0
|
||||
[ -n "$(ip -6 addr show dev "$1" scope link dadfailed)" ] \
|
||||
&& return 1
|
||||
@@ -671,6 +672,7 @@ wait_for_ipv6_dad() {
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
[ -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)" ] \
|
||||
&& return 1
|
||||
@@ -688,7 +690,7 @@ wait_for_ipv6_auto() {
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
[ -z "$(ip -6 addr show dev "$1" tentative)" ] \
|
||||
&& [ -n "$(ip -6 route list proto ra dev "$1")" ] \
|
||||
&& [ -n "$(ip -6 route list proto ra dev "$1" | grep ^default)" ] \
|
||||
&& return 0
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
@@ -724,8 +726,12 @@ iface_has_carrier() {
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
if [ -n "$_no_carrier_flag" ]; then
|
||||
li=$(ip -o link show up dev $1)
|
||||
# NO-CARRIER flag was cleared
|
||||
strstr "$li" "NO-CARRIER" || return 0
|
||||
elif ! [ -e "$interface/carrier" ]; then
|
||||
# sysfs not available and "NO-CARRIER" not displayed
|
||||
return 0
|
||||
fi
|
||||
# double check the syscfs carrier flag
|
||||
[ -e "$interface/carrier" ] && [ "$(cat $interface/carrier)" = 1 ] && return 0
|
||||
@@ -739,6 +745,13 @@ iface_has_link() {
|
||||
iface_has_carrier "$@"
|
||||
}
|
||||
|
||||
iface_is_enslaved() {
|
||||
local _li
|
||||
_li=$(ip -o 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
|
||||
|
@@ -46,7 +46,7 @@ if [ -z "$2" ]; then
|
||||
# we die. Otherwise we just warn
|
||||
if [ -z "$new_root_path" ] ; then
|
||||
[ -n "$BOOTDEV" ] && die "No dhcp root-path received for '$BOOTDEV'"
|
||||
warn "No dhcp root-path received for '$BOOTDEV' trying other interfaces if available"
|
||||
warn "No dhcp root-path received for '$netif' trying other interfaces if available"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@@ -14,6 +14,7 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_binary sort
|
||||
inst_hook pre-pivot 85 "$moddir/write-ifcfg.sh"
|
||||
}
|
||||
|
||||
|
@@ -286,7 +286,10 @@ echo "files /etc/sysconfig/network-scripts" >> /run/initramfs/rwtab
|
||||
echo "files /var/lib/dhclient" >> /run/initramfs/rwtab
|
||||
{
|
||||
cp /tmp/net.* /run/initramfs/
|
||||
cp /tmp/net.$netif.resolv.conf /run/initramfs/state/etc/resolv.conf
|
||||
for i in /tmp/net.*.resolv.conf; do
|
||||
[ -f "$i" ] && cat "$i"
|
||||
done | sort -u > /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
|
||||
} > /dev/null 2>&1
|
||||
|
@@ -15,7 +15,7 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
local _dir _crt _found _lib
|
||||
local _dir _crt _found _lib _nssckbi _p11roots _p11root _p11item
|
||||
inst_simple "$moddir/url-lib.sh" "/lib/url-lib.sh"
|
||||
inst_multiple -o ctorrent
|
||||
inst_multiple curl
|
||||
@@ -29,6 +29,7 @@ install() {
|
||||
[[ -d $_dir ]] || continue
|
||||
for _lib in $_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
|
||||
@@ -39,6 +40,39 @@ install() {
|
||||
_found=1
|
||||
done
|
||||
done
|
||||
[[ $_found ]] || dwarn "Couldn't find SSL CA cert bundle; HTTPS won't work."
|
||||
# If we found no cert bundle files referenced in libcurl but we
|
||||
# *did* find a mention of libnssckbi (checked above), install it.
|
||||
# If its truly NSS libnssckbi, it includes its own trust bundle,
|
||||
# but if it's really p11-kit-trust.so, we need to find the dirs
|
||||
# where it will look for a trust bundle and install them too.
|
||||
if ! [[ $_found ]] && [[ $_nssckbi ]] ; then
|
||||
_found=1
|
||||
inst_libdir_file "libnssckbi.so*" || _found=
|
||||
for _dir in $libdirs; do
|
||||
[[ -e $_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
|
||||
# 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
|
||||
# check if it has some specific subdirs that all
|
||||
# p11-kit trust dirs have
|
||||
[[ -d "${_p11root}/anchors" ]] || continue
|
||||
[[ -d "${_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."
|
||||
continue
|
||||
fi
|
||||
done
|
||||
done
|
||||
done
|
||||
done
|
||||
fi
|
||||
[[ $_found ]] || dwarn "Couldn't find SSL CA cert bundle or libnssckbi.so; HTTPS won't work."
|
||||
}
|
||||
|
||||
|
@@ -21,18 +21,17 @@ installkernel() {
|
||||
"=drivers/gpu/drm/i2c" \
|
||||
"=drivers/gpu/drm/panel" \
|
||||
"=drivers/gpu/drm/bridge" \
|
||||
"=drivers/pwm" \
|
||||
"=drivers/video/backlight" \
|
||||
${NULL}
|
||||
fi
|
||||
|
||||
instmods amdkfd hyperv_fb
|
||||
instmods amdkfd hyperv_fb "=drivers/pwm"
|
||||
|
||||
# if the hardware is present, include module even if it is not currently loaded,
|
||||
# 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,soc/devices/soc?}/*/modalias; do
|
||||
for i in /sys/bus/{pci/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
|
||||
@@ -41,6 +40,6 @@ installkernel() {
|
||||
fi
|
||||
done
|
||||
else
|
||||
dracut_instmods -s "drm_crtc_init" "=drivers/gpu/drm"
|
||||
dracut_instmods -o -s "drm_crtc_init" "=drivers/gpu/drm" "=drivers/staging"
|
||||
fi
|
||||
}
|
||||
|
@@ -1,8 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
pkglib_dir() {
|
||||
local _dirs="/usr/lib/plymouth /usr/libexec/plymouth/"
|
||||
if type -P dpkg-architecture &>/dev/null; then
|
||||
_dirs+=" /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/plymouth"
|
||||
fi
|
||||
for _dir in $_dirs; do
|
||||
if [ -x $_dir/plymouth-populate-initrd ]; then
|
||||
echo $_dir
|
||||
return
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
[[ "$mount_needs" ]] && return 1
|
||||
[ -z $(pkglib_dir) ] && return 1
|
||||
|
||||
require_binaries plymouthd plymouth plymouth-set-default-theme
|
||||
}
|
||||
|
||||
@@ -13,12 +28,7 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
PKGLIBDIR="/usr/lib/plymouth"
|
||||
if type -P dpkg-architecture &>/dev/null; then
|
||||
PKGLIBDIR="/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/plymouth"
|
||||
fi
|
||||
[ -x /usr/libexec/plymouth/plymouth-populate-initrd ] && PKGLIBDIR="/usr/libexec/plymouth"
|
||||
|
||||
PKGLIBDIR=$(pkglib_dir)
|
||||
if grep -q nash ${PKGLIBDIR}/plymouth-populate-initrd \
|
||||
|| [ ! -x ${PKGLIBDIR}/plymouth-populate-initrd ]; then
|
||||
. "$moddir"/plymouth-populate-initrd.sh
|
||||
|
@@ -4,9 +4,10 @@ PLYMOUTH_LOGO_FILE="/usr/share/pixmaps/system-logo-white.png"
|
||||
PLYMOUTH_THEME=$(plymouth-set-default-theme)
|
||||
|
||||
inst_multiple plymouthd plymouth \
|
||||
"${PLYMOUTH_LOGO_FILE}" \
|
||||
/etc/system-release
|
||||
|
||||
test -e "${PLYMOUTH_LOGO_FILE}" && inst_simple "${PLYMOUTH_LOGO_FILE}"
|
||||
|
||||
mkdir -m 0755 -p "${initdir}/usr/share/plymouth"
|
||||
|
||||
inst_libdir_file "plymouth/text.so" "plymouth/details.so"
|
||||
|
61
modules.d/80lvmmerge/README.md
Normal file
61
modules.d/80lvmmerge/README.md
Normal file
@@ -0,0 +1,61 @@
|
||||
# lvmmerge - dracut module
|
||||
|
||||
## Preparation
|
||||
- ensure that the lvm thin pool is big enough
|
||||
- backup any (most likely /boot and /boot/efi) device with:
|
||||
```
|
||||
# mkdir /restoredev
|
||||
# dev=<device>; umount $dev; dd if="$dev" of=/restoredev/$(systemd-escape -p "$dev"); mount $dev
|
||||
```
|
||||
- backup the MBR
|
||||
```
|
||||
# dev=<device>; dd if="$dev" of=/restoredev/$(systemd-escape -p "$dev") bs=446 count=1
|
||||
# ls -l /dev/disk/by-path/virtio-pci-0000\:00\:07.0
|
||||
lrwxrwxrwx. 1 root root 9 Jul 24 04:27 /dev/disk/by-path/virtio-pci-0000:00:07.0 -> ../../vda
|
||||
```
|
||||
- backup some partitions
|
||||
```
|
||||
# dev=/dev/disk/by-path/virtio-pci-0000:00:07.0
|
||||
# dd if="$dev" of=/restoredev/$(systemd-escape -p "$dev") bs=446 count=1
|
||||
# umount /boot/efi
|
||||
# dev=/dev/disk/by-partuuid/687177a8-86b3-4e37-a328-91d20db9563c
|
||||
# dd if="$dev" of=/restoredev/$(systemd-escape -p "$dev")
|
||||
# umount /boot
|
||||
# dev=/dev/disk/by-partuuid/4fdf99e9-4f28-4207-a26f-c76546824eaf
|
||||
# dd if="$dev" of=/restoredev/$(systemd-escape -p "$dev")
|
||||
```
|
||||
Final /restoredev
|
||||
```
|
||||
# ls -al /restoredev/
|
||||
total 1253380
|
||||
drwx------. 2 root root 250 Jul 24 04:38 .
|
||||
dr-xr-xr-x. 18 root root 242 Jul 24 04:32 ..
|
||||
-rw-------. 1 root root 209715200 Jul 24 04:34 dev-disk-by\x2dpartuuid-4fdf99e9\x2d4f28\x2d4207\x2da26f\x2dc76546824eaf
|
||||
-rw-------. 1 root root 1073741824 Jul 24 04:34 dev-disk-by\x2dpartuuid-687177a8\x2d86b3\x2d4e37\x2da328\x2d91d20db9563c
|
||||
-rw-------. 1 root root 446 Jul 24 04:38 dev-disk-by\x2dpath-virtio\x2dpci\x2d0000:00:07.0
|
||||
```
|
||||
- make a thin snapshot
|
||||
```
|
||||
# lvm lvcreate -pr -s rhel/root --name reset
|
||||
```
|
||||
|
||||
- mark the snapshot with a tag
|
||||
```
|
||||
# lvm lvchange --addtag reset rhel/reset
|
||||
```
|
||||
|
||||
- remove /restoredev
|
||||
```
|
||||
# rm -fr /restoredev
|
||||
```
|
||||
|
||||
## Operation
|
||||
|
||||
If a boot entry with ```rd.lvm.mergetags=<tag>``` is selected and there are LVs with ```<tag>```
|
||||
dracut will
|
||||
- make a copy of the snapshot
|
||||
- merge it back to the original
|
||||
- rename the copy back to the name of the snapshot
|
||||
- if /restordev appears in the root, then it will restore the images
|
||||
found in that directory. This can be used to restore /boot and /boot/efi and the
|
||||
MBR of the boot device
|
96
modules.d/80lvmmerge/lvmmerge.sh
Executable file
96
modules.d/80lvmmerge/lvmmerge.sh
Executable file
@@ -0,0 +1,96 @@
|
||||
#!/bin/bash
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
do_merge() {
|
||||
sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 1/' \
|
||||
/etc/lvm/lvm.conf
|
||||
|
||||
systemctl --no-block stop sysroot.mount
|
||||
swapoff -a
|
||||
umount -R /sysroot
|
||||
|
||||
for tag in $(getargs rd.lvm.mergetags); do
|
||||
lvm vgs --noheadings -o vg_name | \
|
||||
while read -r vg || [[ -n $vg ]]; do
|
||||
unset LVS
|
||||
declare -a LVS
|
||||
lvs=$(lvm lvs --noheadings -o lv_name "$vg")
|
||||
for lv in $lvs; do
|
||||
lvm lvchange -an "$vg/$lv"
|
||||
|
||||
tags=$(trim "$(lvm lvs --noheadings -o lv_tags "$vg/$lv")")
|
||||
strstr ",${tags}," ",${tag}," || continue
|
||||
|
||||
if ! lvm lvs --noheadings -o lv_name "${vg}/${lv}_dracutsnap" &>/dev/null; then
|
||||
info "Creating backup ${lv}_dracutsnap of ${vg}/${lv}"
|
||||
lvm lvcreate -pr -s "${vg}/${lv}" --name "${lv}_dracutsnap"
|
||||
fi
|
||||
lvm lvchange --addtag "$tag" "${vg}/${lv}_dracutsnap"
|
||||
|
||||
info "Merging back ${vg}/${lv} to the original LV"
|
||||
lvm lvconvert --merge "${vg}/${lv}"
|
||||
|
||||
LVS+=($lv)
|
||||
done
|
||||
|
||||
systemctl --no-block stop sysroot.mount
|
||||
udevadm settle
|
||||
|
||||
for ((i=0; i < 100; i++)); do
|
||||
lvm vgchange -an "$vg" && break
|
||||
sleep 0.5
|
||||
done
|
||||
|
||||
udevadm settle
|
||||
lvm vgchange -ay "$vg"
|
||||
udevadm settle
|
||||
for lv in "${LVS[@]}"; do
|
||||
info "Renaming ${lv}_dracutsnap backup to ${vg}/${lv}"
|
||||
lvm lvrename "$vg" "${lv}_dracutsnap" "${lv}"
|
||||
done
|
||||
udevadm settle
|
||||
done
|
||||
done
|
||||
|
||||
systemctl --no-block reset-failed systemd-fsck-root
|
||||
systemctl --no-block start systemd-fsck-root
|
||||
systemctl --no-block reset-failed sysroot.mount
|
||||
systemctl --no-block start sysroot.mount
|
||||
|
||||
for ((i=0; i < 100; i++)); do
|
||||
[[ -d /sysroot/dev ]] && break
|
||||
sleep 0.5
|
||||
systemctl --no-block start sysroot.mount
|
||||
done
|
||||
|
||||
if [[ -d /sysroot/restoredev ]]; then
|
||||
(
|
||||
if cd /sysroot/restoredev; then
|
||||
# restore devices and partitions
|
||||
for i in *; do
|
||||
target=$(systemd-escape -pu "$i")
|
||||
if ! [[ -b $target ]]; then
|
||||
warn "Not restoring $target, as the device does not exist"
|
||||
continue
|
||||
fi
|
||||
|
||||
# Just in case
|
||||
umount "$target" &> /dev/null
|
||||
|
||||
info "Restoring $target"
|
||||
dd if="$i" of="$target" |& vinfo
|
||||
done
|
||||
fi
|
||||
)
|
||||
mount -o remount,rw /sysroot
|
||||
rm -fr /sysroot/restoredev
|
||||
fi
|
||||
info "Rebooting"
|
||||
reboot
|
||||
}
|
||||
|
||||
if getarg rd.lvm.mergetags; then
|
||||
do_merge
|
||||
fi
|
||||
|
25
modules.d/80lvmmerge/module-setup.sh
Executable file
25
modules.d/80lvmmerge/module-setup.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
# No point trying to support lvm if the binaries are missing
|
||||
require_binaries lvm dd swapoff || return 1
|
||||
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo lvm dracut-systemd systemd
|
||||
return 0
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
hostonly="" instmods dm-snapshot
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_multiple dd swapoff
|
||||
inst_hook cleanup 01 "$moddir/lvmmerge.sh"
|
||||
}
|
40
modules.d/81cio_ignore/module-setup.sh
Executable file
40
modules.d/81cio_ignore/module-setup.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
# do not add this module by default
|
||||
local arch=$(uname -m)
|
||||
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
cmdline() {
|
||||
local cio_accept
|
||||
|
||||
if [ -e /boot/zipl/active_devices.txt ] ; then
|
||||
while read dev etc ; do
|
||||
[ "$dev" = "#" -o "$dev" = "" ] && continue;
|
||||
if [ -z "$cio_accept" ] ; then
|
||||
cio_accept="$dev"
|
||||
else
|
||||
cio_accept="${cio_accept},${dev}"
|
||||
fi
|
||||
done < /boot/zipl/active_devices.txt
|
||||
fi
|
||||
if [ -n "$cio_accept" ] ; then
|
||||
echo "rd.cio_accept=${cio_accept}"
|
||||
fi
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
if [[ $hostonly_cmdline == "yes" ]] ; then
|
||||
local _cio_accept=$(cmdline)
|
||||
[[ $_cio_accept ]] && printf "%s\n" "$_cio_accept" >> "${initdir}/etc/cmdline.d/01cio_accept.conf"
|
||||
fi
|
||||
|
||||
inst_hook cmdline 20 "$moddir/parse-cio_accept.sh"
|
||||
inst_multiple cio_ignore
|
||||
}
|
22
modules.d/81cio_ignore/parse-cio_accept.sh
Executable file
22
modules.d/81cio_ignore/parse-cio_accept.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
CIO_IGNORE=$(getarg cio_ignore)
|
||||
CIO_ACCEPT=$(getarg rd.cio_accept)
|
||||
|
||||
if [ -z $CIO_IGNORE ] ; then
|
||||
info "cio_ignored disabled on commandline"
|
||||
return
|
||||
fi
|
||||
if [ -n "$CIO_ACCEPT" ] ; then
|
||||
OLDIFS="$IFS"
|
||||
IFS=,
|
||||
set -- $CIO_ACCEPT
|
||||
while (($# > 0)) ; do
|
||||
info "Enabling device $1"
|
||||
cio_ignore --remove $1
|
||||
shift
|
||||
done
|
||||
IFS="$OLDIFS"
|
||||
fi
|
@@ -26,6 +26,8 @@ depends() {
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
instmods btrfs
|
||||
# Make sure btfs can use fast crc32c implementations where available (bsc#1011554)
|
||||
instmods crc32c-intel
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
|
@@ -12,10 +12,18 @@ crypttab_contains() {
|
||||
strstr "${l##luks-}" "${luks##luks-}" && return 0
|
||||
strstr "$d" "${luks##luks-}" && return 0
|
||||
if [ -n "$dev" ]; then
|
||||
for _dev in "$(devnames $d)"; do
|
||||
for _dev in $(devnames $d); do
|
||||
[ "$dev" -ef "$_dev" ] && return 0
|
||||
done
|
||||
fi
|
||||
if [ -e /etc/block_uuid.map ]; then
|
||||
# search for line starting with $d
|
||||
_line=$(sed -n "\,^$d .*$,{p}" /etc/block_uuid.map)
|
||||
[ -z "$_line" ] && continue
|
||||
# get second column with uuid
|
||||
_uuid="$(echo $_line | sed 's,^.* \(.*$\),\1,')"
|
||||
strstr "$_uuid" "${luks##luks-}" && return 0
|
||||
fi
|
||||
done < /etc/crypttab
|
||||
fi
|
||||
return 1
|
||||
@@ -210,8 +218,7 @@ readkey() {
|
||||
if [ -f /lib/dracut-crypt-loop-lib.sh ]; then
|
||||
. /lib/dracut-crypt-loop-lib.sh
|
||||
loop_decrypt "$mntp" "$keypath" "$keydev" "$device"
|
||||
initqueue --onetime --finished --unique --name "crypt-loop-cleanup-99-${mntp##*/}" \
|
||||
$(command -v umount) "$mntp; " $(command -v rmdir) "$mntp"
|
||||
printf "%s\n" "umount \"$mntp\"; rmdir \"$mntp\";" > ${hookdir}/cleanup/"crypt-loop-cleanup-99-${mntp##*/}".sh
|
||||
return 0
|
||||
else
|
||||
die "No loop file support to decrypt '$keypath' on '$keydev'."
|
||||
|
@@ -29,13 +29,27 @@ if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -d -n rd_NO_CRYPTTAB; t
|
||||
continue
|
||||
fi
|
||||
|
||||
# PARTUUID used in crypttab
|
||||
if [ "${dev%%=*}" = "PARTUUID" ]; then
|
||||
if [ "luks-${dev##PARTUUID=}" = "$luksname" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
|
||||
# UUID used in crypttab
|
||||
if [ "${dev%%=*}" = "UUID" ]; then
|
||||
elif [ "${dev%%=*}" = "UUID" ]; then
|
||||
if [ "luks-${dev##UUID=}" = "$luksname" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
|
||||
# ID used in crypttab
|
||||
elif [ "${dev%%=*}" = "ID" ]; then
|
||||
if [ "luks-${dev##ID=}" = "$luksname" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
|
||||
# path used in crypttab
|
||||
else
|
||||
cdev=$(readlink -f $dev)
|
||||
@@ -88,6 +102,10 @@ while [ $# -gt 0 ]; do
|
||||
;;
|
||||
allow-discards)
|
||||
allowdiscards="--allow-discards"
|
||||
;;
|
||||
header=*)
|
||||
cryptsetupopts="${cryptsetupopts} --${1}"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
@@ -147,12 +165,15 @@ fi
|
||||
|
||||
if [ $ask_passphrase -ne 0 ]; then
|
||||
luks_open="$(command -v cryptsetup) $cryptsetupopts luksOpen"
|
||||
_timeout=$(getargs "rd.luks.timeout")
|
||||
_timeout=${_timeout:-0}
|
||||
ask_for_password --ply-tries 5 \
|
||||
--ply-cmd "$luks_open -T1 $device $luksname" \
|
||||
--ply-prompt "Password ($device)" \
|
||||
--tty-tries 1 \
|
||||
--tty-cmd "$luks_open -T5 $device $luksname"
|
||||
--tty-cmd "$luks_open -T5 -t $_timeout $device $luksname"
|
||||
unset luks_open
|
||||
unset _timeout
|
||||
fi
|
||||
|
||||
unset device luksname luksfile
|
||||
|
@@ -27,6 +27,7 @@ installkernel() {
|
||||
hostonly="" instmods drbg
|
||||
arch=$(arch)
|
||||
[[ $arch == x86_64 ]] && arch=x86
|
||||
[[ $arch == s390x ]] && arch=s390
|
||||
instmods dm_crypt =crypto =drivers/crypto =arch/$arch/crypto
|
||||
}
|
||||
|
||||
@@ -68,20 +69,50 @@ install() {
|
||||
|
||||
if [[ $hostonly ]] && [[ -f /etc/crypttab ]]; then
|
||||
# filter /etc/crypttab for the devices we need
|
||||
while read _mapper _dev _rest || [ -n "$_mapper" ]; do
|
||||
while read _mapper _dev _luksfile _luksoptions || [ -n "$_mapper" ]; do
|
||||
[[ $_mapper = \#* ]] && continue
|
||||
[[ $_dev ]] || continue
|
||||
|
||||
[[ $_dev == PARTUUID=* ]] && \
|
||||
_dev="/dev/disk/by-partuuid/${_dev#PARTUUID=}"
|
||||
|
||||
[[ $_dev == UUID=* ]] && \
|
||||
_dev="/dev/disk/by-uuid/${_dev#UUID=}"
|
||||
|
||||
for _hdev in "${!host_fs_types[@]}"; do
|
||||
[[ ${host_fs_types[$_hdev]} == "crypto_LUKS" ]] || continue
|
||||
if [[ $_hdev -ef $_dev ]] || [[ /dev/block/$_hdev -ef $_dev ]]; then
|
||||
echo "$_mapper $_dev $_rest"
|
||||
break
|
||||
fi
|
||||
[[ $_dev == ID=* ]] && \
|
||||
_dev="/dev/disk/by-id/${_dev#ID=}"
|
||||
|
||||
echo "$_dev $(blkid $_dev -s UUID -o value)" >> "${initdir}/etc/block_uuid.map"
|
||||
|
||||
# loop through the options to check for the force option
|
||||
luksoptions=${_luksoptions}
|
||||
OLD_IFS="${IFS}"
|
||||
IFS=,
|
||||
set -- ${luksoptions}
|
||||
IFS="${OLD_IFS}"
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
force)
|
||||
forceentry="yes"
|
||||
break
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# include the entry regardless
|
||||
if [ "${forceentry}" = "yes" ]; then
|
||||
echo "$_mapper $_dev $_luksfile $_luksoptions"
|
||||
else
|
||||
for _hdev in "${!host_fs_types[@]}"; do
|
||||
[[ ${host_fs_types[$_hdev]} == "crypto_LUKS" ]] || continue
|
||||
if [[ $_hdev -ef $_dev ]] || [[ /dev/block/$_hdev -ef $_dev ]]; then
|
||||
echo "$_mapper $_dev $_luksfile $_luksoptions"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done < /etc/crypttab > $initdir/etc/crypttab
|
||||
mark_hostonly /etc/crypttab
|
||||
fi
|
||||
|
@@ -2,6 +2,30 @@
|
||||
|
||||
type crypttab_contains >/dev/null 2>&1 || . /lib/dracut-crypt-lib.sh
|
||||
|
||||
|
||||
_cryptgetargsname() {
|
||||
debug_off
|
||||
local _o _found _key
|
||||
unset _o
|
||||
unset _found
|
||||
CMDLINE=$(getcmdline)
|
||||
_key="$1"
|
||||
set --
|
||||
for _o in $CMDLINE; do
|
||||
if [ "$_o" = "$_key" ]; then
|
||||
_found=1;
|
||||
elif [ "${_o%=*}" = "${_key%=}" ]; then
|
||||
[ -n "${_o%=*}" ] && set -- "$@" "${_o#*=}";
|
||||
_found=1;
|
||||
fi
|
||||
done
|
||||
if [ -n "$_found" ]; then
|
||||
[ $# -gt 0 ] && printf '%s' "$*"
|
||||
return 0
|
||||
fi
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ! getargbool 1 rd.luks -d -n rd_NO_LUKS; then
|
||||
info "rd.luks=0: removing cryptoluks activation"
|
||||
rm -f -- /etc/udev/rules.d/70-luks.rules
|
||||
@@ -11,36 +35,110 @@ else
|
||||
echo 'ACTION!="add|change", GOTO="luks_end"'
|
||||
} > /etc/udev/rules.d/70-luks.rules.new
|
||||
|
||||
PARTUUID=$(getargs rd.luks.partuuid -d rd_LUKS_PARTUUID)
|
||||
SERIAL=$(getargs rd.luks.serial -d rd_LUKS_SERIAL)
|
||||
LUKS=$(getargs rd.luks.uuid -d rd_LUKS_UUID)
|
||||
tout=$(getarg rd.luks.key.tout)
|
||||
|
||||
if [ -e /etc/crypttab ]; then
|
||||
while read _mapper _dev _rest ; do
|
||||
set_systemd_timeout_for_dev $_dev
|
||||
while read -r _ _dev _ || [ -n "$_dev" ]; do
|
||||
set_systemd_timeout_for_dev "$_dev"
|
||||
done < /etc/crypttab
|
||||
fi
|
||||
|
||||
if [ -n "$LUKS" ]; then
|
||||
if [ -n "$PARTUUID" ]; then
|
||||
for uuid in $PARTUUID; do
|
||||
|
||||
uuid=${uuid##luks-}
|
||||
if luksname=$(_cryptgetargsname "rd.luks.name=$uuid="); then
|
||||
luksname="${luksname#$uuid=}"
|
||||
else
|
||||
luksname="luks-$uuid"
|
||||
fi
|
||||
|
||||
if [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
{
|
||||
printf -- 'ENV{ID_PART_ENTRY_UUID}=="*%s*", ' "$uuid"
|
||||
printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)"
|
||||
printf -- '--name cryptroot-ask-%%k %s ' "$(command -v cryptroot-ask)"
|
||||
printf -- '$env{DEVNAME} %s %s"\n' "$luksname" "$tout"
|
||||
} >> /etc/udev/rules.d/70-luks.rules.new
|
||||
else
|
||||
luksname=$(dev_unit_name "$luksname")
|
||||
luksname="$(str_replace "$luksname" '\' '\\')"
|
||||
|
||||
if ! crypttab_contains "$uuid"; then
|
||||
{
|
||||
printf -- 'ENV{ID_PART_ENTRY_UUID}=="*%s*", ' "$uuid"
|
||||
printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)"
|
||||
printf -- '--name systemd-cryptsetup-%%k %s start ' "$(command -v systemctl)"
|
||||
printf -- 'systemd-cryptsetup@%s.service"\n' "$luksname"
|
||||
} >> /etc/udev/rules.d/70-luks.rules.new
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
elif [ -n "$SERIAL" ]; then
|
||||
for serialid in $SERIAL; do
|
||||
|
||||
serialid=${serialid##luks-}
|
||||
if luksname=$(_cryptgetargsname "rd.luks.name=$serialid="); then
|
||||
luksname="${luksname#$serialid=}"
|
||||
else
|
||||
luksname="luks-$serialid"
|
||||
fi
|
||||
|
||||
if [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
{
|
||||
printf -- 'ENV{ID_SERIAL_SHORT}=="*%s*", ' "$serialid"
|
||||
printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)"
|
||||
printf -- '--name cryptroot-ask-%%k %s ' "$(command -v cryptroot-ask)"
|
||||
printf -- '$env{DEVNAME} %s %s"\n' "$luksname" "$tout"
|
||||
} >> /etc/udev/rules.d/70-luks.rules.new
|
||||
else
|
||||
luksname=$(dev_unit_name "$luksname")
|
||||
luksname="$(str_replace "$luksname" '\' '\\')"
|
||||
|
||||
if ! crypttab_contains "$serialid"; then
|
||||
{
|
||||
printf -- 'ENV{ID_SERIAL_SHORT}=="*%s*", ' "$serialid"
|
||||
printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)"
|
||||
printf -- '--name systemd-cryptsetup-%%k %s start ' "$(command -v systemctl)"
|
||||
printf -- 'systemd-cryptsetup@%s.service"\n' "$luksname"
|
||||
} >> /etc/udev/rules.d/70-luks.rules.new
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
elif [ -n "$LUKS" ]; then
|
||||
for luksid in $LUKS; do
|
||||
|
||||
luksid=${luksid##luks-}
|
||||
if luksname=$(_cryptgetargsname "rd.luks.name=$luksid="); then
|
||||
luksname="${luksname#$luksid=}"
|
||||
else
|
||||
luksname="luks-$luksid"
|
||||
fi
|
||||
|
||||
if [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
{
|
||||
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", '
|
||||
printf -- 'ENV{ID_FS_UUID}=="*%s*", ' $luksid
|
||||
printf -- 'RUN+="%s --settled --unique --onetime ' $(command -v initqueue)
|
||||
printf -- '--name cryptroot-ask-%%k %s ' $(command -v cryptroot-ask)
|
||||
printf -- '$env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $tout
|
||||
printf -- 'ENV{ID_FS_UUID}=="*%s*", ' "$luksid"
|
||||
printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)"
|
||||
printf -- '--name cryptroot-ask-%%k %s ' "$(command -v cryptroot-ask)"
|
||||
printf -- '$env{DEVNAME} %s %s"\n' "$luksname" "$tout"
|
||||
} >> /etc/udev/rules.d/70-luks.rules.new
|
||||
else
|
||||
luksname=$(dev_unit_name "$luksname")
|
||||
luksname="$(str_replace "$luksname" '\' '\\')"
|
||||
|
||||
if ! crypttab_contains "$luksid"; then
|
||||
{
|
||||
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", '
|
||||
printf -- 'ENV{ID_FS_UUID}=="*%s*", ' $luksid
|
||||
printf -- 'RUN+="%s --settled --unique --onetime ' $(command -v initqueue)
|
||||
printf -- '--name systemd-cryptsetup-%%k %s start ' $(command -v systemctl)
|
||||
printf -- 'systemd-cryptsetup@luks$$(dev_unit_name -$env{ID_FS_UUID}).service"\n'
|
||||
printf -- 'ENV{ID_FS_UUID}=="*%s*", ' "$luksid"
|
||||
printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)"
|
||||
printf -- '--name systemd-cryptsetup-%%k %s start ' "$(command -v systemctl)"
|
||||
printf -- 'systemd-cryptsetup@%s.service"\n' "$luksname"
|
||||
} >> /etc/udev/rules.d/70-luks.rules.new
|
||||
fi
|
||||
fi
|
||||
@@ -48,25 +146,25 @@ else
|
||||
uuid=$luksid
|
||||
while [ "$uuid" != "${uuid#*-}" ]; do uuid=${uuid%%-*}${uuid#*-}; done
|
||||
printf -- '[ -e /dev/disk/by-id/dm-uuid-CRYPT-LUKS?-*%s*-* ] || exit 1\n' $uuid \
|
||||
>> $hookdir/initqueue/finished/90-crypt.sh
|
||||
>> "$hookdir/initqueue/finished/90-crypt.sh"
|
||||
|
||||
{
|
||||
printf -- '[ -e /dev/disk/by-uuid/*%s* ] || ' $luksid
|
||||
printf -- 'warn "crypto LUKS UUID "%s" not found"\n' $luksid
|
||||
} >> $hookdir/emergency/90-crypt.sh
|
||||
} >> "$hookdir/emergency/90-crypt.sh"
|
||||
done
|
||||
elif getargbool 0 rd.auto; then
|
||||
if [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
{
|
||||
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' $(command -v initqueue)
|
||||
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' "$(command -v initqueue)"
|
||||
printf -- '--unique --settled --onetime --name cryptroot-ask-%%k '
|
||||
printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $(command -v cryptroot-ask) $tout
|
||||
printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' "$(command -v cryptroot-ask)" "$tout"
|
||||
} >> /etc/udev/rules.d/70-luks.rules.new
|
||||
else
|
||||
{
|
||||
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' $(command -v initqueue)
|
||||
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' "$(command -v initqueue)"
|
||||
printf -- '--unique --settled --onetime --name crypt-run-generator-%%k '
|
||||
printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID}"\n' $(command -v crypt-run-generator)
|
||||
printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID}"\n' "$(command -v crypt-run-generator)"
|
||||
} >> /etc/udev/rules.d/70-luks.rules.new
|
||||
fi
|
||||
fi
|
||||
|
@@ -1,11 +1,42 @@
|
||||
#!/bin/sh
|
||||
|
||||
_remove_dm() {
|
||||
local dev=$1
|
||||
local s
|
||||
local devname
|
||||
|
||||
for s in /sys/block/${dev}/holders/dm-* ; do
|
||||
[ -e ${s} ] || continue
|
||||
_remove_dm ${s##*/}
|
||||
done
|
||||
# multipath devices might have MD devices on top,
|
||||
# which are removed after this script. So do not
|
||||
# remove those to avoid spurious errors
|
||||
case $(cat /sys/block/${dev}/dm/uuid) in
|
||||
mpath-*)
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
devname=$(cat /sys/block/${dev}/dm/name)
|
||||
dmsetup -v --noudevsync remove "$devname" || return $?
|
||||
;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
_do_dm_shutdown() {
|
||||
local ret=0
|
||||
local final=$1
|
||||
local dev
|
||||
|
||||
info "Disassembling device-mapper devices"
|
||||
for dev in $(dmsetup info -c --noheadings -o name) ; do
|
||||
dmsetup -v --noudevsync remove "$dev" || ret=$?
|
||||
for dev in /sys/block/dm-* ; do
|
||||
[ -e ${dev} ] || continue
|
||||
if [ "x$final" != "x" ]; then
|
||||
_remove_dm ${dev##*/} || ret=$?
|
||||
else
|
||||
_remove_dm ${dev##*/} >/dev/null 2>&1 || ret=$?
|
||||
fi
|
||||
done
|
||||
if [ "x$final" != "x" ]; then
|
||||
info "dmsetup ls --tree"
|
||||
|
@@ -38,6 +38,6 @@ install() {
|
||||
inst_rules "$moddir/59-persistent-storage-dm.rules"
|
||||
prepare_udev_rules 59-persistent-storage-dm.rules
|
||||
|
||||
inst_hook shutdown 30 "$moddir/dm-shutdown.sh"
|
||||
inst_hook shutdown 25 "$moddir/dm-shutdown.sh"
|
||||
}
|
||||
|
||||
|
@@ -23,9 +23,6 @@ ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="dm_end"
|
||||
PROGRAM=="/bin/sh -c 'for i in $sys/$devpath/holders/dm-[0-9]*; do [ -e $$i ] && exit 0; done; exit 1;' ", \
|
||||
GOTO="dm_end"
|
||||
|
||||
ENV{DEVTYPE}!="partition", \
|
||||
RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}"
|
||||
|
||||
RUN+="/sbin/initqueue --onetime --unique --settled /sbin/dmraid_scan $env{DEVNAME}"
|
||||
|
||||
LABEL="dm_end"
|
||||
|
@@ -33,8 +33,6 @@ if [ -n "$DM_RAIDS" ] || getargbool 0 rd.auto; then
|
||||
if [ "${s##$r}" != "$s" ]; then
|
||||
info "Activating $s"
|
||||
dmraid -ay -i -p --rm_partitions "$s" 2>&1 | vinfo
|
||||
[ -e "/dev/mapper/$s" ] && kpartx -a "/dev/mapper/$s" 2>&1 | vinfo
|
||||
udevsettle
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
@@ -74,6 +74,8 @@ install() {
|
||||
|
||||
inst "$moddir/dmraid.sh" /sbin/dmraid_scan
|
||||
|
||||
inst_rules 66-kpartx.rules 67-kpartx-compat.rules
|
||||
|
||||
inst_libdir_file "libdmraid-events*.so*"
|
||||
|
||||
inst_rules "$moddir/61-dmraid-imsm.rules"
|
||||
|
22
modules.d/90dmsquash-live-ntfs/module-setup.sh
Executable file
22
modules.d/90dmsquash-live-ntfs/module-setup.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
command -v
|
||||
|
||||
check() {
|
||||
require_binaries ntfs-3g || return 1
|
||||
return 255
|
||||
}
|
||||
|
||||
depends() {
|
||||
echo dmsquash-live
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
inst_multiple fusermount ulockmgr_server mount.fuse ntfs-3g
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
hostonly='' instmods fuse
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -L /run/rootfsbase ] && [ -d /run/initramfs/live/updates -o -d /updates ]; then
|
||||
if [ -h /dev/root ] && [ -d /run/initramfs/live/updates -o -d /updates ]; then
|
||||
info "Applying updates to live image..."
|
||||
mount -o bind /run $NEWROOT/run
|
||||
# avoid overwriting symlinks (e.g. /lib -> /usr/lib) with directories
|
||||
|
@@ -18,12 +18,12 @@ fi
|
||||
case "$liveroot" in
|
||||
live:LABEL=*|LABEL=*) \
|
||||
root="${root#live:}"
|
||||
root="$(echo $root | sed 's,/,\\x2f,g')"
|
||||
root="${root//\//\\x2f}"
|
||||
root="live:/dev/disk/by-label/${root#LABEL=}"
|
||||
rootok=1 ;;
|
||||
live:CDLABEL=*|CDLABEL=*) \
|
||||
root="${root#live:}"
|
||||
root="$(echo $root | sed 's,/,\\x2f,g')"
|
||||
root="${root//\//\\x2f}"
|
||||
root="live:/dev/disk/by-label/${root#CDLABEL=}"
|
||||
rootok=1 ;;
|
||||
live:UUID=*|UUID=*) \
|
||||
@@ -54,8 +54,10 @@ GENERATOR_DIR="$2"
|
||||
[ -z "$GENERATOR_DIR" ] && exit 1
|
||||
[ -d "$GENERATOR_DIR" ] || mkdir "$GENERATOR_DIR"
|
||||
|
||||
getargbool 0 rd.live.overlay.readonly -d -y readonly_overlay && readonly_overlay="--readonly" || readonly_overlay=""
|
||||
getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes"
|
||||
[ -e /xor_overlayfs ] && xor_overlayfs="yes"
|
||||
[ -e /xor_readonly ] && xor_readonly="--readonly"
|
||||
ROOTFLAGS="$(getarg rootflags)"
|
||||
{
|
||||
echo "[Unit]"
|
||||
@@ -64,13 +66,18 @@ ROOTFLAGS="$(getarg rootflags)"
|
||||
echo "Where=/sysroot"
|
||||
if [ "$overlayfs$xor_overlayfs" = "yes" ]; then
|
||||
echo "What=LiveOS_rootfs"
|
||||
echo "Options=${ROOTFLAGS},lowerdir=/run/rootfsbase,upperdir=/run/overlayfs,workdir=/run/ovlwork"
|
||||
if [ "$readonly_overlay$xor_readonly" = "--readonly" ]; then
|
||||
ovlfs=lowerdir=/run/overlayfs-r:/run/rootfsbase
|
||||
else
|
||||
ovlfs=lowerdir=/run/rootfsbase
|
||||
fi
|
||||
echo "Options=${ROOTFLAGS},${ovlfs},upperdir=/run/overlayfs,workdir=/run/ovlwork"
|
||||
echo "Type=overlay"
|
||||
_dev=LiveOS_rootfs
|
||||
else
|
||||
echo "What=/dev/mapper/live-rw"
|
||||
[ -n "$ROOTFLAGS" ] && echo "Options=${ROOTFLAGS}"
|
||||
_dev=dev-mapper-live\x2drw
|
||||
_dev=$'dev-mapper-live\\x2drw'
|
||||
fi
|
||||
} > "$GENERATOR_DIR"/sysroot.mount
|
||||
|
||||
@@ -78,4 +85,5 @@ mkdir -p "$GENERATOR_DIR/$_dev.device.d"
|
||||
{
|
||||
echo "[Unit]"
|
||||
echo "JobTimeoutSec=3000"
|
||||
echo "JobRunningTimeoutSec=3000"
|
||||
} > "$GENERATOR_DIR/$_dev.device.d/timeout.conf"
|
||||
|
@@ -78,7 +78,20 @@ if [ -f $livedev ]; then
|
||||
esac
|
||||
[ -e /sys/fs/$fstype ] || modprobe $fstype
|
||||
else
|
||||
mount -n -t $fstype -o ${liverw:-ro} $livedev /run/initramfs/live
|
||||
if [ "$(blkid -o value -s TYPE $livedev)" != "ntfs" ]; then
|
||||
mount -n -t $fstype -o ${liverw:-ro} $livedev /run/initramfs/live
|
||||
else
|
||||
# Symlinking /usr/bin/ntfs-3g as /sbin/mount.ntfs seems to boot
|
||||
# at the first glance, but ends with lots and lots of squashfs
|
||||
# errors, because systemd attempts to kill the ntfs-3g process?!
|
||||
if [ -x "/usr/bin/ntfs-3g" ]; then
|
||||
( exec -a @ntfs-3g ntfs-3g -o ${liverw:-ro} $livedev /run/initramfs/live ) | vwarn
|
||||
else
|
||||
die "Failed to mount block device of live image: Missing NTFS support"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$?" != "0" ]; then
|
||||
die "Failed to mount block device of live image"
|
||||
exit 1
|
||||
@@ -96,15 +109,15 @@ do_live_overlay() {
|
||||
|
||||
if [ -z "$overlay" ]; then
|
||||
pathspec="/${live_dir}/overlay-$l-$u"
|
||||
elif ( echo $overlay | grep -q ":" ); then
|
||||
elif strstr $overlay ":"; then
|
||||
# pathspec specified, extract
|
||||
pathspec=$( echo $overlay | sed -e 's/^.*://' )
|
||||
pathspec=${overlay##*:}
|
||||
fi
|
||||
|
||||
if [ -z "$pathspec" -o "$pathspec" = "auto" ]; then
|
||||
pathspec="/${live_dir}/overlay-$l-$u"
|
||||
fi
|
||||
devspec=$( echo $overlay | sed -e 's/:.*$//' )
|
||||
devspec=${overlay%%:*}
|
||||
|
||||
# need to know where to look for the overlay
|
||||
if [ -z "$setup" -a -n "$devspec" -a -n "$pathspec" -a -n "$overlay" ]; then
|
||||
@@ -124,7 +137,7 @@ do_live_overlay() {
|
||||
fi
|
||||
if [ -n "$overlayfs" ]; then
|
||||
unset -v overlayfs
|
||||
[ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit="yes"
|
||||
[ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit=":>/xor_overlayfs;"
|
||||
fi
|
||||
setup="yes"
|
||||
else
|
||||
@@ -133,10 +146,10 @@ do_live_overlay() {
|
||||
[ -d /run/initramfs/overlayfs/ovlwork ]; then
|
||||
ln -s /run/initramfs/overlayfs/overlayfs /run/overlayfs$opt
|
||||
ln -s /run/initramfs/overlayfs/ovlwork /run/ovlwork$opt
|
||||
if [ -z "$overlayfs" ]; then
|
||||
overlayfs="yes"
|
||||
[ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit="yes"
|
||||
if [ -z "$overlayfs" ] && [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
reloadsysrootmountunit=":>/xor_overlayfs;"
|
||||
fi
|
||||
overlayfs="required"
|
||||
setup="yes"
|
||||
fi
|
||||
fi
|
||||
@@ -144,19 +157,24 @@ do_live_overlay() {
|
||||
[ -d /run/initramfs/overlayfs$pathspec/../ovlwork ]; then
|
||||
ln -s /run/initramfs/overlayfs$pathspec /run/overlayfs$opt
|
||||
ln -s /run/initramfs/overlayfs$pathspec/../ovlwork /run/ovlwork$opt
|
||||
if [ -z "$overlayfs" ]; then
|
||||
overlayfs="yes"
|
||||
[ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit="yes"
|
||||
if [ -z "$overlayfs" ] && [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
reloadsysrootmountunit=":>/xor_overlayfs;"
|
||||
fi
|
||||
overlayfs="required"
|
||||
setup="yes"
|
||||
fi
|
||||
fi
|
||||
if [ -n "$overlayfs" ]; then
|
||||
modprobe overlay
|
||||
if [ $? != 0 ]; then
|
||||
if [ "$overlayfs" = required ]; then
|
||||
die "OverlayFS is required but not available."
|
||||
exit 1
|
||||
fi
|
||||
[ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit=":>/xor_overlayfs;"
|
||||
m='OverlayFS is not available; using temporary Device-mapper overlay.'
|
||||
info $m
|
||||
unset -v overlayfs setup
|
||||
[ -n "$reloadsysrootmountunit" ] && unset -v reloadsysrootmountunit
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -165,34 +183,36 @@ do_live_overlay() {
|
||||
warn "Using temporary overlay."
|
||||
elif [ -n "$devspec" -a -n "$pathspec" ]; then
|
||||
[ -z "$m" ] &&
|
||||
m=' Unable to find a persistent overlay; using a temporary one.'
|
||||
m=($'\n' "$m" $'\n'
|
||||
' All root filesystem changes will be lost on shutdown.'
|
||||
$'\n' ' Press any key to continue')
|
||||
echo -e "\n\n\n${m[*]}\n\n\n" > /dev/kmsg
|
||||
m=' Unable to find a persistent overlay; using a temporary one.'
|
||||
m="$m"$'\n All root filesystem changes will be lost on shutdown.'
|
||||
m="$m"$'\n Press [Enter] to continue.'
|
||||
printf "\n\n\n\n${m}\n\n\n" > /dev/kmsg
|
||||
if [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
if plymouth --ping ; then
|
||||
if type plymouth >/dev/null 2>&1 && plymouth --ping ; then
|
||||
if getargbool 0 rhgb || getargbool 0 splash ; then
|
||||
m[0]='>>>'$'\n''>>>'$'\n''>>>'$'\n\n'
|
||||
m[5]=$'\n''<<<'$'\n''<<<'$'\n''<<<'
|
||||
plymouth display-message --text="${m[*]}"
|
||||
m='>>>'$'\n''>>>'$'\n''>>>'$'\n\n\n'"$m"
|
||||
m="${m%n.*}"$'n.\n\n\n''<<<'$'\n''<<<'$'\n''<<<'
|
||||
plymouth display-message --text="${m}"
|
||||
else
|
||||
plymouth ask-question --prompt="${m[*]}" --command=true
|
||||
plymouth ask-question --prompt="${m}" --command=true
|
||||
fi
|
||||
else
|
||||
m[0]='>>>'
|
||||
m[5]='<<<'
|
||||
unset -v m[2] m[4]
|
||||
systemd-ask-password --timeout=0 "${m[*]}"
|
||||
m=">>>${m//.[[:space:]]/.} <<<"
|
||||
systemd-ask-password --timeout=0 "${m}"
|
||||
fi
|
||||
else
|
||||
plymouth --ping && plymouth --quit
|
||||
read -s -r -p $'\n\n'"${m[*]}:" -n 1 reply
|
||||
type plymouth >/dev/null 2>&1 && plymouth --ping && plymouth --quit
|
||||
read -s -r -p $'\n\n'"${m}" -n 1 reply
|
||||
fi
|
||||
fi
|
||||
if [ -n "$overlayfs" ]; then
|
||||
mkdir -m 0755 /run/overlayfs
|
||||
mkdir -m 0755 /run/ovlwork
|
||||
if [ -n "$readonly_overlay" ] && ! [ -h /run/overlayfs-r ]; then
|
||||
info "No persistent overlay found."
|
||||
unset -v readonly_overlay
|
||||
[ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit="${reloadsysrootmountunit}:>/xor_readonly;"
|
||||
fi
|
||||
else
|
||||
dd if=/dev/null of=/overlay bs=1024 count=1 seek=$((overlay_size*1024)) 2> /dev/null
|
||||
if [ -n "$setup" -a -n "$readonly_overlay" ]; then
|
||||
@@ -240,9 +260,13 @@ do_live_overlay() {
|
||||
echo 0 $sz snapshot $base $over PO 8 | dmsetup create live-rw
|
||||
fi
|
||||
|
||||
# Create a device that always points to a ro base image
|
||||
echo 0 $sz linear $BASE_LOOPDEV 0 | dmsetup create --readonly live-base
|
||||
# Create a device for the ro base of overlayed file systems.
|
||||
if [ -z "$overlayfs" ]; then
|
||||
echo 0 $sz linear $BASE_LOOPDEV 0 | dmsetup create --readonly live-base
|
||||
fi
|
||||
ln -s $BASE_LOOPDEV /dev/live-base
|
||||
}
|
||||
# end do_live_overlay()
|
||||
|
||||
# we might have a genMinInstDelta delta file for anaconda to take advantage of
|
||||
if [ -e /run/initramfs/live/${live_dir}/osmin.img ]; then
|
||||
@@ -276,10 +300,21 @@ if [ -e "$SQUASHED" ]; then
|
||||
mkdir -m 0755 -p /run/initramfs/squashfs
|
||||
mount -n -t squashfs -o ro $SQUASHED_LOOPDEV /run/initramfs/squashfs
|
||||
|
||||
if [ -f /run/initramfs/squashfs/LiveOS/rootfs.img ]; then
|
||||
FSIMG="/run/initramfs/squashfs/LiveOS/rootfs.img"
|
||||
elif [ -f /run/initramfs/squashfs/LiveOS/ext3fs.img ]; then
|
||||
FSIMG="/run/initramfs/squashfs/LiveOS/ext3fs.img"
|
||||
if [ -d /run/initramfs/squashfs/LiveOS ]; then
|
||||
if [ -f /run/initramfs/squashfs/LiveOS/rootfs.img ]; then
|
||||
FSIMG="/run/initramfs/squashfs/LiveOS/rootfs.img"
|
||||
elif [ -f /run/initramfs/squashfs/LiveOS/ext3fs.img ]; then
|
||||
FSIMG="/run/initramfs/squashfs/LiveOS/ext3fs.img"
|
||||
fi
|
||||
elif [ -d /run/initramfs/squashfs/proc ]; then
|
||||
FSIMG=$SQUASHED
|
||||
if [ -z "$overlayfs" ] && [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
reloadsysrootmountunit=":>/xor_overlayfs;"
|
||||
fi
|
||||
overlayfs="required"
|
||||
else
|
||||
die "Failed to find a root filesystem in $SQUASHED."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# we might have an embedded fs image to use as rootfs (uncompressed live)
|
||||
@@ -297,8 +332,8 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$FSIMG" ] ; then
|
||||
if [ -n "$writable_fsimg" ] ; then
|
||||
if [ -n "$FSIMG" ]; then
|
||||
if [ -n "$writable_fsimg" ]; then
|
||||
# mount the provided filesystem read/write
|
||||
echo "Unpacking live filesystem (may take some time)" > /dev/kmsg
|
||||
mkdir -m 0755 /run/initramfs/fsimg/
|
||||
@@ -321,9 +356,13 @@ if [ -n "$FSIMG" ] ; then
|
||||
setup=yes
|
||||
fi
|
||||
fi
|
||||
BASE_LOOPDEV=$(losetup -f --show $opt $FSIMG)
|
||||
sz=$(blockdev --getsz $BASE_LOOPDEV)
|
||||
if [ "$setup" == rw ]; then
|
||||
if [ "$FSIMG" = "$SQUASHED" ]; then
|
||||
BASE_LOOPDEV=$SQUASHED_LOOPDEV
|
||||
else
|
||||
BASE_LOOPDEV=$(losetup -f --show $opt $FSIMG)
|
||||
sz=$(blockdev --getsz $BASE_LOOPDEV)
|
||||
fi
|
||||
if [ "$setup" = rw ]; then
|
||||
echo 0 $sz linear $BASE_LOOPDEV 0 | dmsetup create live-rw
|
||||
else
|
||||
# Add a DM snapshot or OverlayFS for writes.
|
||||
@@ -331,8 +370,6 @@ if [ -n "$FSIMG" ] ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
[ -e "$SQUASHED" ] && [ -z "$overlayfs" ] && umount -l /run/initramfs/squashfs
|
||||
|
||||
if [ -b "$OSMIN_LOOPDEV" ]; then
|
||||
# set up the devicemapper snapshot device, which will merge
|
||||
# the normal live fs image, and the delta, into a minimzied fs image
|
||||
@@ -340,7 +377,7 @@ if [ -b "$OSMIN_LOOPDEV" ]; then
|
||||
fi
|
||||
|
||||
if [ -n "$reloadsysrootmountunit" ]; then
|
||||
> /xor_overlayfs
|
||||
eval "$reloadsysrootmountunit"
|
||||
systemctl daemon-reload
|
||||
fi
|
||||
|
||||
@@ -348,33 +385,33 @@ ROOTFLAGS="$(getarg rootflags)"
|
||||
|
||||
if [ -n "$overlayfs" ]; then
|
||||
mkdir -m 0755 /run/rootfsbase
|
||||
if [ -n "$reset_overlay" ] && [ -L /run/overlayfs ]; then
|
||||
if [ -n "$reset_overlay" ] && [ -h /run/overlayfs ]; then
|
||||
ovlfs=$(readlink /run/overlayfs)
|
||||
info "Resetting the OverlayFS overlay directory."
|
||||
rm -r -- ${ovlfs}/* ${ovlfs}/.* >/dev/null 2>&1
|
||||
fi
|
||||
if [ -n "$readonly_overlay" ]; then
|
||||
mkdir -m 0755 /run/rootfsbase-r
|
||||
mount -r $FSIMG /run/rootfsbase-r
|
||||
mount -t overlay LiveOS_rootfs-r -oro,lowerdir=/run/overlayfs-r:/run/rootfsbase-r /run/rootfsbase
|
||||
if [ -n "$readonly_overlay" ] && [ -h /run/overlayfs-r ]; then
|
||||
ovlfs=lowerdir=/run/overlayfs-r:/run/rootfsbase
|
||||
else
|
||||
mount -r $FSIMG /run/rootfsbase
|
||||
ovlfs=lowerdir=/run/rootfsbase
|
||||
fi
|
||||
mount -r $FSIMG /run/rootfsbase
|
||||
if [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
#FIXME What to link to /dev/root? Is it even needed?
|
||||
printf 'mount -t overlay LiveOS_rootfs -o%s,%s %s\n' "$ROOTFLAGS" \
|
||||
'lowerdir=/run/rootfsbase,upperdir=/run/overlayfs,workdir=/run/ovlwork' \
|
||||
"$ovlfs",upperdir=/run/overlayfs,workdir=/run/ovlwork \
|
||||
"$NEWROOT" > $hookdir/mount/01-$$-live.sh
|
||||
fi
|
||||
else
|
||||
ln -s /dev/mapper/live-rw /dev/root
|
||||
if [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
[ -n "$ROOTFLAGS" ] && ROOTFLAGS="-o $ROOTFLAGS"
|
||||
printf 'mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > $hookdir/mount/01-$$-live.sh
|
||||
fi
|
||||
ln -s $BASE_LOOPDEV /run/rootfsbase
|
||||
fi
|
||||
[ -e "$SQUASHED" ] && umount -l /run/initramfs/squashfs
|
||||
|
||||
ln -s null /dev/root
|
||||
|
||||
need_shutdown
|
||||
|
||||
exit 0
|
||||
|
||||
|
@@ -22,7 +22,7 @@ installkernel() {
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_multiple umount dmsetup blkid dd losetup grep blockdev find
|
||||
inst_multiple umount dmsetup blkid dd losetup blockdev find
|
||||
inst_multiple -o checkisomd5
|
||||
inst_hook cmdline 30 "$moddir/parse-dmsquash-live.sh"
|
||||
inst_hook cmdline 31 "$moddir/parse-iso-scan.sh"
|
||||
|
@@ -20,12 +20,12 @@ modprobe -q loop
|
||||
case "$liveroot" in
|
||||
live:LABEL=*|LABEL=*) \
|
||||
root="${root#live:}"
|
||||
root="$(echo $root | sed 's,/,\\x2f,g')"
|
||||
root="${root//\//\\x2f}"
|
||||
root="live:/dev/disk/by-label/${root#LABEL=}"
|
||||
rootok=1 ;;
|
||||
live:CDLABEL=*|CDLABEL=*) \
|
||||
root="${root#live:}"
|
||||
root="$(echo $root | sed 's,/,\\x2f,g')"
|
||||
root="${root//\//\\x2f}"
|
||||
root="live:/dev/disk/by-label/${root#CDLABEL=}"
|
||||
rootok=1 ;;
|
||||
live:UUID=*|UUID=*) \
|
||||
@@ -57,6 +57,6 @@ info "root was $liveroot, is now $root"
|
||||
# make sure that init doesn't complain
|
||||
[ -z "$root" ] && root="live"
|
||||
|
||||
wait_for_dev -n /run/rootfsbase
|
||||
wait_for_dev -n /dev/root
|
||||
|
||||
return 0
|
||||
|
194
modules.d/90kernel-modules-extra/module-setup.sh
Executable file
194
modules.d/90kernel-modules-extra/module-setup.sh
Executable file
@@ -0,0 +1,194 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
#
|
||||
# Parses depmod configuration and calls instmods for out-of-tree kernel
|
||||
# modules found. Specifically, kernel modules inside directories that
|
||||
# come from the following places are included (if these kernel modules
|
||||
# are present in modules.dep):
|
||||
# - "search" configuration option;
|
||||
# - "override" configuration option (matching an exact file name constructed
|
||||
# by concatenating the provided directory and the kernel module name);
|
||||
# - "external" configuration option (if "external" is a part of "search"
|
||||
# configuration).
|
||||
# (See depmod.d(5) for details.)
|
||||
#
|
||||
# This module has the following variables available for configuration:
|
||||
# - "depmod_modules_dep" - Path to the modules.dep file
|
||||
# ("$srcmods/modules.dep" by default);
|
||||
# - "depmod_module_dir" - Directory containing kernel modules ("$srcmods"
|
||||
# by default);
|
||||
# - "depmod_configs" - array of depmod configuration paths to parse
|
||||
# (as supplied to depmod -C, ("/run/depmod.d/"
|
||||
# "/etc/depmod.d/" "/lib/depmod.d/") by default).
|
||||
installkernel()
|
||||
{
|
||||
: "${depmod_modules_dep:=$srcmods/modules.dep}"
|
||||
: "${depmod_module_dir:=$srcmods}"
|
||||
|
||||
[[ -f "${depmod_modules_dep}" ]] || return 0
|
||||
|
||||
# Message printers with custom prefix
|
||||
local mod_name="kernel-modules-extra"
|
||||
prinfo() { dinfo " ${mod_name}: $*"; }
|
||||
prdebug() { ddebug " ${mod_name}: $*"; }
|
||||
|
||||
# Escape a string for usage as a part of extended regular expression.
|
||||
# $1 - string to escape
|
||||
re_escape() {
|
||||
printf "%s" "$1" | sed 's/\([.+?^$\/\\|()\[]\|\]\)/\\\0/'
|
||||
}
|
||||
|
||||
local OLDIFS
|
||||
local cfg
|
||||
local cfgs=()
|
||||
local search_list=""
|
||||
local overrides=()
|
||||
local external_dirs=()
|
||||
local e f
|
||||
|
||||
|
||||
## Gathering and sorting configuration file list
|
||||
|
||||
[ -n "${depmod_configs[@]-}" ] \
|
||||
|| depmod_configs=(/run/depmod.d/ /etc/depmod.d/ /lib/depmod.d/)
|
||||
|
||||
for cfg in "${depmod_configs[@]}"; do
|
||||
[ -e "$cfg" ] || {
|
||||
prdebug "configuration source \"$cfg\" does not exist"
|
||||
continue
|
||||
}
|
||||
|
||||
# '/' is used as a separator between configuration name and
|
||||
# configuration path
|
||||
if [ -d "$cfg" ]; then
|
||||
for f in "$cfg/"*; do
|
||||
[[ -e "$f" && ! -d "$f" ]] || {
|
||||
prdebug "configuration source" \
|
||||
"\"$cfg\" is ignored" \
|
||||
"(directory or doesn't exist)"
|
||||
continue
|
||||
}
|
||||
cfgs+=("$(basename "$f")/$f")
|
||||
done
|
||||
else
|
||||
cfgs+=("$(basename "$cfg")/$cfg")
|
||||
fi
|
||||
done
|
||||
|
||||
OLDIFS="$IFS"
|
||||
IFS=$'\n'
|
||||
LANG=C cfgs=($(printf '%s\n' "${cfgs[@]}" \
|
||||
| sort -u -k1,1 -t '/' | cut -f 2- -d '/'))
|
||||
IFS="$OLDIFS"
|
||||
|
||||
|
||||
## Parse configurations
|
||||
|
||||
for cfg in "${cfgs[@]}"; do
|
||||
prdebug "parsing configuration file \"$cfg\""
|
||||
|
||||
local k v mod kverpat path
|
||||
while read -r k v; do
|
||||
case "$k" in
|
||||
search)
|
||||
search_list="$search_list $v"
|
||||
prdebug "$cfg: added \"$v\" to the list of" \
|
||||
"search directories"
|
||||
;;
|
||||
override) # module_name kver_pattern dir
|
||||
read -r mod kverpat path <<<"$v"
|
||||
|
||||
if [[ ! "$mod" || ! "$kverpat" || ! "$path" ]]
|
||||
then
|
||||
prinfo "$cfg: ignoring incorrect" \
|
||||
"override option: \"$k $v\""
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ '*' = "$kverpat" \
|
||||
|| "$kernel" =~ "$kverpat" ]]
|
||||
then
|
||||
overrides+=("${path}/${mod}")
|
||||
|
||||
prdebug "$cfg: added override" \
|
||||
"\"${path}/${mod}\""
|
||||
else
|
||||
prdebug "$cfg: override \"$v\" is" \
|
||||
"ignored since \"$kverpat\"" \
|
||||
"doesn't match \"$kernel\""
|
||||
fi
|
||||
;;
|
||||
external) # kverpat dir
|
||||
read -r kverpat path <<<"$v"
|
||||
|
||||
if [[ ! "$kverpat" || ! "$path" ]]; then
|
||||
prinfo "$cfg: ignoring incorrect" \
|
||||
"external option: \"$k $v\""
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ '*' = "$kverpat" \
|
||||
|| "$kernel" =~ "$kverpat" ]]
|
||||
then
|
||||
external_dirs+=("$path")
|
||||
|
||||
prdebug "$cfg: added external" \
|
||||
"directory \"$path\""
|
||||
else
|
||||
prdebug "$cfg: external directory" \
|
||||
"\"$path\" is ignored since" \
|
||||
"\"$kverpat\" doesn't match " \
|
||||
"\"$kernel\""
|
||||
fi
|
||||
;;
|
||||
'#'*|'') # comments and empty strings
|
||||
;;
|
||||
include|make_map_files) # ignored by depmod
|
||||
;;
|
||||
*)
|
||||
prinfo "$cfg: unknown depmod configuration" \
|
||||
"option \"$k $v\""
|
||||
;;
|
||||
esac
|
||||
done < "$cfg"
|
||||
done
|
||||
|
||||
# "updates built-in" is the default search list
|
||||
: "${search_list:=updates}"
|
||||
|
||||
|
||||
## Build a list of regular expressions for grepping modules.dep
|
||||
|
||||
local pathlist=()
|
||||
for f in "${overrides[@]}"; do
|
||||
pathlist+=("^$(re_escape "$f")")
|
||||
done
|
||||
|
||||
for f in $(printf "%s" "$search_list"); do
|
||||
# Ignoring builtin modules
|
||||
[ "built-in" != "$f" ] || continue
|
||||
|
||||
if [ "external" = "$f" ]; then
|
||||
for e in "${external_dirs[@]}"; do
|
||||
pathlist+=("$(re_escape "${e%/}")/[^:]+")
|
||||
done
|
||||
fi
|
||||
|
||||
pathlist+=("$(re_escape "${f%/}")/[^:]+")
|
||||
done
|
||||
|
||||
|
||||
## Filter modules.dep, canonicalise the resulting filenames and supply
|
||||
## them to instmods.
|
||||
|
||||
[ 0 -lt "${#pathlist[@]}" ] || return 0
|
||||
|
||||
printf "^%s\.ko(\.gz|\.bz2|\.xz)?:\n" "${pathlist[@]}" \
|
||||
| (LANG=C grep -E -o -f - -- "$depmod_modules_dep" || exit 0) \
|
||||
| tr -d ':' \
|
||||
| (cd "$depmod_module_dir" || exit; xargs -r realpath -e --) \
|
||||
| instmods || return 1
|
||||
|
||||
return 0
|
||||
}
|
@@ -2,6 +2,20 @@
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
find_kernel_modules_external () {
|
||||
local _OLDIFS
|
||||
local external_pattern="^/"
|
||||
|
||||
[[ -f "$srcmods/modules.dep" ]] || return 0
|
||||
|
||||
_OLDIFS=$IFS
|
||||
IFS=:
|
||||
while read a rest; do
|
||||
[[ $a =~ $external_pattern ]] || continue
|
||||
printf "%s\n" "$a"
|
||||
done < "$srcmods/modules.dep"
|
||||
IFS=$_OLDIFS
|
||||
}
|
||||
local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma'
|
||||
|
||||
if [[ -z $drivers ]]; then
|
||||
@@ -11,47 +25,64 @@ installkernel() {
|
||||
ohci-hcd ohci-pci \
|
||||
uhci-hcd \
|
||||
xhci-hcd xhci-pci xhci-plat-hcd \
|
||||
pinctrl-cherryview \
|
||||
"=drivers/pinctrl" \
|
||||
${NULL}
|
||||
|
||||
hostonly=$(optional_hostonly) instmods \
|
||||
"=drivers/hid" \
|
||||
"=drivers/tty/serial" \
|
||||
"=drivers/input/serio" \
|
||||
"=drivers/input/keyboard" \
|
||||
"=drivers/usb/storage" \
|
||||
"=drivers/pci/host" \
|
||||
${NULL}
|
||||
|
||||
instmods \
|
||||
yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
|
||||
atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus \
|
||||
virtio virtio_blk virtio_ring virtio_pci virtio_scsi \
|
||||
"=drivers/pcmcia" =ide nvme
|
||||
"=drivers/pcmcia" =ide nvme vmd nfit
|
||||
|
||||
if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]]; then
|
||||
if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]]; then
|
||||
# arm/aarch64 specific modules
|
||||
_blockfuncs+='|dw_mc_probe|dw_mci_pltfm_register'
|
||||
instmods \
|
||||
"=drivers/clk" \
|
||||
"=drivers/dma" \
|
||||
"=drivers/extcon" \
|
||||
"=drivers/gpio" \
|
||||
"=drivers/hwspinlock" \
|
||||
"=drivers/i2c/busses" \
|
||||
"=drivers/mfd" \
|
||||
"=drivers/mmc/core" \
|
||||
"=drivers/phy" \
|
||||
"=drivers/power" \
|
||||
"=drivers/regulator" \
|
||||
"=drivers/rpmsg" \
|
||||
"=drivers/rtc" \
|
||||
"=drivers/soc" \
|
||||
"=drivers/usb/chipidea" \
|
||||
"=drivers/usb/dwc2" \
|
||||
"=drivers/usb/dwc3" \
|
||||
"=drivers/usb/host" \
|
||||
"=drivers/usb/misc" \
|
||||
"=drivers/usb/musb" \
|
||||
"=drivers/usb/phy" \
|
||||
"=drivers/scsi/hisi_sas" \
|
||||
${NULL}
|
||||
fi
|
||||
|
||||
dracut_instmods -o -s "${_blockfuncs}" "=drivers"
|
||||
|
||||
find_kernel_modules_external | instmods
|
||||
|
||||
# if not on hostonly mode, install all known filesystems,
|
||||
# if the required list is not set via the filesystems variable
|
||||
if ! [[ $hostonly ]]; then
|
||||
if [[ -z $filesystems ]]; then
|
||||
dracut_instmods -o -P ".*/(kernel/fs/nfs|kernel/fs/nfsd|kernel/fs/lockd)/.*" '=fs'
|
||||
fi
|
||||
else
|
||||
elif [[ "${host_fs_types[*]}" ]]; then
|
||||
hostonly='' instmods "${host_fs_types[@]}"
|
||||
fi
|
||||
fi
|
||||
|
@@ -28,7 +28,7 @@ installkernel() {
|
||||
=drivers/net/phy \
|
||||
=drivers/net/team \
|
||||
=drivers/net/ethernet \
|
||||
ecb arc4 bridge stp llc ipv6 bonding 8021q af_packet virtio_net xennet
|
||||
ecb arc4 bridge stp llc ipv6 bonding 8021q ipvlan macvlan af_packet virtio_net xennet
|
||||
hostonly="" instmods iscsi_ibft crc32c iscsi_boot_sysfs
|
||||
}
|
||||
|
||||
|
@@ -43,18 +43,36 @@ GENERATOR_DIR="$2"
|
||||
|
||||
[ -d "$GENERATOR_DIR" ] || mkdir "$GENERATOR_DIR"
|
||||
|
||||
getargbool 0 rd.live.overlay.readonly -d -y readonly_overlay && readonly_overlay="--readonly" || readonly_overlay=""
|
||||
getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes"
|
||||
[ -e /xor_overlayfs ] && xor_overlayfs="yes"
|
||||
[ -e /xor_readonly ] && xor_readonly="--readonly"
|
||||
ROOTFLAGS="$(getarg rootflags)"
|
||||
{
|
||||
echo "[Unit]"
|
||||
echo "Before=initrd-root-fs.target"
|
||||
echo "[Mount]"
|
||||
echo "Where=/sysroot"
|
||||
echo "What=/dev/mapper/live-rw"
|
||||
[ -n "$ROOTFLAGS" ] && echo "Options=${ROOTFLAGS}"
|
||||
if [ "$overlayfs$xor_overlayfs" = "yes" ]; then
|
||||
echo "What=LiveOS_rootfs"
|
||||
if [ "$readonly_overlay$xor_readonly" = "--readonly" ]; then
|
||||
ovlfs=lowerdir=/run/overlayfs-r:/run/rootfsbase
|
||||
else
|
||||
ovlfs=lowerdir=/run/rootfsbase
|
||||
fi
|
||||
echo "Options=${ROOTFLAGS},${ovlfs},upperdir=/run/overlayfs,workdir=/run/ovlwork"
|
||||
echo "Type=overlay"
|
||||
_dev=LiveOS_rootfs
|
||||
else
|
||||
echo "What=/dev/mapper/live-rw"
|
||||
[ -n "$ROOTFLAGS" ] && echo "Options=${ROOTFLAGS}"
|
||||
_dev=$'dev-mapper-live\\x2drw'
|
||||
fi
|
||||
} > "$GENERATOR_DIR"/sysroot.mount
|
||||
|
||||
mkdir -p "$GENERATOR_DIR/dev-mapper-live\x2drw.device.d"
|
||||
mkdir -p "$GENERATOR_DIR/$_dev.device.d"
|
||||
{
|
||||
echo "[Unit]"
|
||||
echo "JobTimeoutSec=3000"
|
||||
} > "$GENERATOR_DIR/dev-mapper-live\x2drw.device.d/timeout.conf"
|
||||
echo "JobRunningTimeoutSec=3000"
|
||||
} > "$GENERATOR_DIR/$_dev.device.d/timeout.conf"
|
||||
|
@@ -114,7 +114,7 @@ if [ -n "$LVS" ] ; then
|
||||
info "Scanning devices $lvmdevs for LVM logical volumes $LVS"
|
||||
lvm lvscan $lvm_ignorelockingfailure 2>&1 | vinfo
|
||||
for LV in $LVS; do
|
||||
lvm lvchange --yes -ay $lvm_quirk_args $LV 2>&1 | vinfo
|
||||
lvm lvchange --yes -K -ay $lvm_quirk_args $LV 2>&1 | vinfo
|
||||
done
|
||||
fi
|
||||
|
||||
|
@@ -43,7 +43,7 @@ cmdline() {
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
instmods dm-snapshot
|
||||
hostonly='' instmods dm-snapshot
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
|
@@ -1,34 +1,72 @@
|
||||
#!/bin/sh
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
_md_force_run() {
|
||||
type getargs >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
_md_start() {
|
||||
local _udevinfo
|
||||
local _path_s
|
||||
local _path_d
|
||||
local _md="$1"
|
||||
local _offroot="$2"
|
||||
|
||||
_udevinfo="$(udevadm info --query=env --name="${_md}")"
|
||||
strstr "$_udevinfo" "MD_LEVEL=container" && continue
|
||||
strstr "$_udevinfo" "DEVTYPE=partition" && continue
|
||||
|
||||
_path_s="/sys/$(udevadm info -q path -n "${_md}")/md/array_state"
|
||||
[ ! -r "$_path_s" ] && continue
|
||||
|
||||
# inactive ?
|
||||
[ "$(cat "$_path_s")" != "inactive" ] && continue
|
||||
|
||||
mdadm $_offroot -R "${_md}" 2>&1 | vinfo
|
||||
|
||||
# still inactive ?
|
||||
[ "$(cat "$_path_s")" = "inactive" ] && continue
|
||||
|
||||
_path_d="${_path_s%/*}/degraded"
|
||||
[ ! -r "$_path_d" ] && continue
|
||||
> $hookdir/initqueue/work
|
||||
}
|
||||
|
||||
_md_force_run() {
|
||||
local _offroot
|
||||
local _md
|
||||
local _UUID
|
||||
local _MD_UUID=$(getargs rd.md.uuid -d rd_MD_UUID=)
|
||||
[ -n "$_MD_UUID" ] || getargbool 0 rd.auto || return
|
||||
|
||||
_offroot=$(strstr "$(mdadm --help-options 2>&1)" offroot && echo --offroot)
|
||||
# try to force-run anything not running yet
|
||||
for md in /dev/md[0-9_]*; do
|
||||
[ -b "$md" ] || continue
|
||||
_udevinfo="$(udevadm info --query=env --name="$md")"
|
||||
strstr "$_udevinfo" "MD_LEVEL=container" && continue
|
||||
strstr "$_udevinfo" "DEVTYPE=partition" && continue
|
||||
|
||||
_path_s="/sys/$(udevadm info -q path -n "$md")/md/array_state"
|
||||
[ ! -r "$_path_s" ] && continue
|
||||
if [ -n "$_MD_UUID" ]; then
|
||||
_MD_UUID=$(str_replace "$_MD_UUID" "-" "")
|
||||
_MD_UUID=$(str_replace "$_MD_UUID" ":" "")
|
||||
|
||||
# inactive ?
|
||||
[ "$(cat "$_path_s")" != "inactive" ] && continue
|
||||
for _md in /dev/md[0-9_]*; do
|
||||
[ -b "$_md" ] || continue
|
||||
_UUID=$(
|
||||
/sbin/mdadm -D --export "$_md" \
|
||||
| while read line || [ -n "$line" ]; do
|
||||
str_starts "$line" "MD_UUID=" || continue
|
||||
printf "%s" "${line#MD_UUID=}"
|
||||
done
|
||||
)
|
||||
|
||||
mdadm $_offroot -R "$md" 2>&1 | vinfo
|
||||
[ -z "$_UUID" ] && continue
|
||||
_UUID=$(str_replace "$_UUID" ":" "")
|
||||
|
||||
# still inactive ?
|
||||
[ "$(cat "$_path_s")" = "inactive" ] && continue
|
||||
# check if we should handle this device
|
||||
strstr " $_MD_UUID " " $_UUID " || continue
|
||||
|
||||
_path_d="${_path_s%/*}/degraded"
|
||||
[ ! -r "$_path_d" ] && continue
|
||||
> $hookdir/initqueue/work
|
||||
done
|
||||
_md_start "${_md}" "${_offroot}"
|
||||
done
|
||||
else
|
||||
# try to force-run anything not running yet
|
||||
for _md in /dev/md[0-9_]*; do
|
||||
[ -b "$_md" ] || continue
|
||||
_md_start "${_md}" "${_offroot}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
_md_force_run
|
||||
|
@@ -4,7 +4,7 @@
|
||||
check() {
|
||||
local _rootdev
|
||||
# No mdadm? No mdraid support.
|
||||
require_binaries mdadm || return 1
|
||||
require_binaries mdadm expr || return 1
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for dev in "${!host_fs_types[@]}"; do
|
||||
@@ -65,7 +65,7 @@ cmdline() {
|
||||
# called by dracut
|
||||
install() {
|
||||
local rule rule_path
|
||||
inst_multiple cat
|
||||
inst_multiple cat expr
|
||||
inst_multiple -o mdmon
|
||||
inst $(command -v partx) /sbin/partx
|
||||
inst $(command -v mdadm) /sbin/mdadm
|
||||
|
@@ -1,6 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
MD_UUID=$(getargs rd.md.uuid -d rd_MD_UUID=)
|
||||
# normalize the uuid
|
||||
MD_UUID=$(str_replace "$MD_UUID" "-" "")
|
||||
MD_UUID=$(str_replace "$MD_UUID" ":" "")
|
||||
|
||||
if ( ! [ -n "$MD_UUID" ] && ! getargbool 0 rd.auto ) || ! getargbool 1 rd.md -d -n rd_NO_MD; then
|
||||
info "rd.md=0: removing MD RAID activation"
|
||||
@@ -12,10 +15,12 @@ else
|
||||
[ -e "$f" ] || continue
|
||||
while read line || [ -n "$line" ]; do
|
||||
if [ "${line%%UUID CHECK}" != "$line" ]; then
|
||||
for uuid in $MD_UUID; do
|
||||
printf 'ENV{ID_FS_UUID}=="%s", GOTO="md_uuid_ok"\n' "$(expr substr $uuid 1 8)-$(expr substr $uuid 9 4)-$(expr substr $uuid 13 4)-$(expr substr $uuid 17 4)-$(expr substr $uuid 21 12)"
|
||||
done;
|
||||
printf 'IMPORT{program}="/sbin/mdadm --examine --export $tempnode"\n'
|
||||
for uuid in $MD_UUID; do
|
||||
printf 'ENV{MD_UUID}=="%s", GOTO="md_uuid_ok"\n' $uuid
|
||||
printf 'ENV{ID_FS_UUID}=="%s", GOTO="md_uuid_ok"\n' $uuid
|
||||
printf 'ENV{MD_UUID}=="%s", GOTO="md_uuid_ok"\n' "$(expr substr $uuid 1 8):$(expr substr $uuid 9 8):$(expr substr $uuid 17 8):$(expr substr $uuid 25 8)"
|
||||
done;
|
||||
printf 'GOTO="md_end"\n'
|
||||
printf 'LABEL="md_uuid_ok"\n'
|
||||
@@ -25,6 +30,10 @@ else
|
||||
done < "${f}" > "${f}.new"
|
||||
mv "${f}.new" "$f"
|
||||
done
|
||||
for uuid in $MD_UUID; do
|
||||
uuid="$(expr substr $uuid 1 8):$(expr substr $uuid 9 8):$(expr substr $uuid 17 8):$(expr substr $uuid 25 8)"
|
||||
wait_for_dev "/dev/disk/by-id/md-uuid-${uuid}"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@@ -18,16 +18,18 @@ majmin_to_mpath_dev() {
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
local _rootdev
|
||||
# if there's no multipath binary, no go.
|
||||
require_binaries multipath || return 1
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for_each_host_dev_and_slaves is_mpath || return 255
|
||||
}
|
||||
|
||||
# if there's no multipath binary, no go.
|
||||
require_binaries multipath || return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -40,7 +42,7 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
cmdline() {
|
||||
for m in scsi_dh_alua scsi_dh_emc scsi_dh_rdac ; do
|
||||
for m in scsi_dh_alua scsi_dh_emc scsi_dh_rdac dm_multipath; do
|
||||
if grep -m 1 -q "$m" /proc/modules ; then
|
||||
printf 'rd.driver.pre=%s ' "$m"
|
||||
fi
|
||||
@@ -64,6 +66,7 @@ installkernel() {
|
||||
# called by dracut
|
||||
install() {
|
||||
local _f _allow
|
||||
|
||||
add_hostonly_mpath_conf() {
|
||||
is_mpath $1 && {
|
||||
local _dev
|
||||
@@ -86,9 +89,10 @@ install() {
|
||||
xdrgetprio \
|
||||
/etc/xdrdevices.conf \
|
||||
/etc/multipath.conf \
|
||||
/etc/multipath/*
|
||||
/etc/multipath/* \
|
||||
/etc/multipath/conf.d/*
|
||||
|
||||
[[ $hostonly ]] && {
|
||||
[[ $hostonly ]] && [[ $hostonly_mode = "strict" ]] && {
|
||||
for_each_host_dev_and_slaves_all add_hostonly_mpath_conf
|
||||
[ -n "$_allow" ] && mpathconf $_allow --outfile ${initdir}/etc/multipath.conf
|
||||
}
|
||||
@@ -113,6 +117,7 @@ install() {
|
||||
fi
|
||||
|
||||
inst_hook cleanup 80 "$moddir/multipathd-needshutdown.sh"
|
||||
inst_hook shutdown 20 "$moddir/multipath-shutdown.sh"
|
||||
|
||||
inst_rules 40-multipath.rules 56-multipath.rules \
|
||||
62-multipath.rules 65-multipath.rules \
|
||||
|
7
modules.d/90multipath/multipath-shutdown.sh
Executable file
7
modules.d/90multipath/multipath-shutdown.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
for i in $(multipath -l -v1); do
|
||||
if ! dmsetup table $i | sed -n '/.*queue_if_no_path.*/q1' ; then
|
||||
dmsetup message $i 0 fail_if_no_path
|
||||
fi
|
||||
done
|
@@ -1,7 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
for i in /dev/mapper/mpath*; do
|
||||
[ -b "$i" ] || continue
|
||||
need_shutdown
|
||||
break
|
||||
for i in $(multipath -l -v1); do
|
||||
if $(dmsetup table $i | sed -n '/.*queue_if_no_path.*/q1') ; then
|
||||
need_shutdown
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user