Compare commits
774 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d8cc8c0499 | ||
![]() |
36b2e5e2c2 | ||
![]() |
3c4315fa13 | ||
![]() |
d97d130da9 | ||
![]() |
e0aa98a1df | ||
![]() |
84bc192946 | ||
![]() |
e684eab878 | ||
![]() |
debf483d4d | ||
![]() |
d681df8e5f | ||
![]() |
540a5169b9 | ||
![]() |
12beb05a73 | ||
![]() |
e6aafacb23 | ||
![]() |
8d3d72a68c | ||
![]() |
b2fab575dc | ||
![]() |
de74e1ef41 | ||
![]() |
f2cbd4cbd6 | ||
![]() |
5ecc117a25 | ||
![]() |
00ed3ccfd9 | ||
![]() |
6a877a79c4 | ||
![]() |
cb73315dd6 | ||
![]() |
8552a3270c | ||
![]() |
281327f72c | ||
![]() |
da119ab18c | ||
![]() |
87bd8907a6 | ||
![]() |
a242ef13e0 | ||
![]() |
2b9d8f65a6 | ||
![]() |
ffc68f357e | ||
![]() |
ace51ef520 | ||
![]() |
93b02f502e | ||
![]() |
49c062821a | ||
![]() |
c504d8b435 | ||
![]() |
39fe00ef60 | ||
![]() |
bae44febb5 | ||
![]() |
5c274467d6 | ||
![]() |
c82a11334d | ||
![]() |
f34e1d6b0e | ||
![]() |
a073aa5a26 | ||
![]() |
575733aa25 | ||
![]() |
546d5dacf5 | ||
![]() |
3411ad661a | ||
![]() |
a2b64e30b8 | ||
![]() |
50411d30d5 | ||
![]() |
88c86ac7f0 | ||
![]() |
55c912ae40 | ||
![]() |
b7c770e186 | ||
![]() |
324ea606da | ||
![]() |
df478eee75 | ||
![]() |
8f53670cc5 | ||
![]() |
f071d5574c | ||
![]() |
1743473b2b | ||
![]() |
0d6d85b494 | ||
![]() |
bbc9bfe16e | ||
![]() |
466a59984a | ||
![]() |
8df0b654dc | ||
![]() |
97af51db9d | ||
![]() |
69f7ed9610 | ||
![]() |
67b4a9ea17 | ||
![]() |
dc63e65419 | ||
![]() |
62cdced342 | ||
![]() |
919a7c4d6e | ||
![]() |
f06c2b5852 | ||
![]() |
613ed5cd76 | ||
![]() |
3605b48508 | ||
![]() |
4fe1bdd406 | ||
![]() |
a13bf117d5 | ||
![]() |
730b9b8b77 | ||
![]() |
5e264a5d3e | ||
![]() |
4baac4b291 | ||
![]() |
1f4f8fb9e3 | ||
![]() |
af75a298c1 | ||
![]() |
9fc144451d | ||
![]() |
861d9430c0 | ||
![]() |
e8b9702c0a | ||
![]() |
109283a883 | ||
![]() |
e95b672376 | ||
![]() |
dadd2b698e | ||
![]() |
3e70a25bcf | ||
![]() |
3e6c9011d0 | ||
![]() |
d93fe0fa35 | ||
![]() |
beb26a0847 | ||
![]() |
e84d115b93 | ||
![]() |
7929ec198f | ||
![]() |
0b11ea7199 | ||
![]() |
7deba0428a | ||
![]() |
aacdba2bdb | ||
![]() |
5ae33613ab | ||
![]() |
8652d5493d | ||
![]() |
af11946054 | ||
![]() |
55a0b3abc7 | ||
![]() |
a4f7b50471 | ||
![]() |
226e3710b4 | ||
![]() |
89f7217954 | ||
![]() |
283c34fc2b | ||
![]() |
1cb6524918 | ||
![]() |
ff66b6dad3 | ||
![]() |
64a7eace88 | ||
![]() |
051de5aadc | ||
![]() |
d2765b5175 | ||
![]() |
d27cd4dfdd | ||
![]() |
030b00b8a5 | ||
![]() |
de50e9c002 | ||
![]() |
868f935e23 | ||
![]() |
4ba662ff90 | ||
![]() |
dc7085ceeb | ||
![]() |
9444bf6161 | ||
![]() |
06ca27cdf5 | ||
![]() |
dd82da4e27 | ||
![]() |
190047f161 | ||
![]() |
748867d177 | ||
![]() |
b806625d41 | ||
![]() |
dba2055979 | ||
![]() |
aa23dcd8ae | ||
![]() |
5bbbfeaf19 | ||
![]() |
9b6c5fd7c7 | ||
![]() |
904a76376f | ||
![]() |
52814c0ee3 | ||
![]() |
d124904f2b | ||
![]() |
7fd850d58e | ||
![]() |
71bb2ecd79 | ||
![]() |
6e0348f33b | ||
![]() |
27458b10ff | ||
![]() |
bf27e473cb | ||
![]() |
549442cc2a | ||
![]() |
98836432c1 | ||
![]() |
d988dc30df | ||
![]() |
c5f8b69ad7 | ||
![]() |
2beee35d5e | ||
![]() |
1ae8b8aa02 | ||
![]() |
8f092d0dda | ||
![]() |
d624f60682 | ||
![]() |
5decf6d813 | ||
![]() |
1a1c80febe | ||
![]() |
7b3ff4e055 | ||
![]() |
56b58c0a94 | ||
![]() |
ad2565c8ff | ||
![]() |
9f3d191fce | ||
![]() |
f17c5fa573 | ||
![]() |
99369bea1c | ||
![]() |
45ef8eb723 | ||
![]() |
bc6eae15ab | ||
![]() |
475f3a8128 | ||
![]() |
6b1e7a6ca4 | ||
![]() |
bbaa0d5917 | ||
![]() |
3c4bfd685a | ||
![]() |
9dde7a66b5 | ||
![]() |
34b56de12a | ||
![]() |
951cedf8cb | ||
![]() |
0baf97618d | ||
![]() |
8642792c3e | ||
![]() |
5bbfd48475 | ||
![]() |
c33488feb1 | ||
![]() |
18e61d3d41 | ||
![]() |
fbf717086e | ||
![]() |
5a6a98f875 | ||
![]() |
35857f556c | ||
![]() |
a6865e6897 | ||
![]() |
55068924f7 | ||
![]() |
16addb86fc | ||
![]() |
5f2c30d9bc | ||
![]() |
c00f8e05a6 | ||
![]() |
85231e1ff3 | ||
![]() |
88396c383c | ||
![]() |
df03141dbc | ||
![]() |
bf9cdc472c | ||
![]() |
02b5c8e3a3 | ||
![]() |
f734347ae7 | ||
![]() |
4aca0017e8 | ||
![]() |
1e057b352a | ||
![]() |
431b86c8e9 | ||
![]() |
b093aa2dc7 | ||
![]() |
32bd2fbb4c | ||
![]() |
1d84d6940e | ||
![]() |
87ae968810 | ||
![]() |
f13deabd22 | ||
![]() |
0d59a84b53 | ||
![]() |
68cb510f18 | ||
![]() |
5e60145449 | ||
![]() |
282e0583b0 | ||
![]() |
32d115f385 | ||
![]() |
416d3d6390 | ||
![]() |
8a9a5838f3 | ||
![]() |
a94cd56d6f | ||
![]() |
b819f519cb | ||
![]() |
44d832c5ad | ||
![]() |
4961910fe3 | ||
![]() |
3d0da653f0 | ||
![]() |
4ef0e2d92a | ||
![]() |
bd0f2c034a | ||
![]() |
d8a698713e | ||
![]() |
57f2579281 | ||
![]() |
215ff169db | ||
![]() |
85b458d90d | ||
![]() |
268ae2841b | ||
![]() |
638cad7c97 | ||
![]() |
0fbb79d54f | ||
![]() |
36c34f4e71 | ||
![]() |
373efa4427 | ||
![]() |
cee4599131 | ||
![]() |
c6011f2add | ||
![]() |
f8b958dc62 | ||
![]() |
036712546b | ||
![]() |
391d605790 | ||
![]() |
aef0f55791 | ||
![]() |
66ed711ccf | ||
![]() |
960b1e48e8 | ||
![]() |
437a56dc6b | ||
![]() |
630aed8b66 | ||
![]() |
af6292f0fc | ||
![]() |
b710520a3d | ||
![]() |
66e092bb53 | ||
![]() |
fdc1037b19 | ||
![]() |
76df206685 | ||
![]() |
77364fd6bb | ||
![]() |
41b0e41a09 | ||
![]() |
791532b0ce | ||
![]() |
ad45024416 | ||
![]() |
3ae5ac28af | ||
![]() |
fd28794bbc | ||
![]() |
d18fd0235b | ||
![]() |
15c5c072f4 | ||
![]() |
caf207afa7 | ||
![]() |
57937cf480 | ||
![]() |
feaf30ffaa | ||
![]() |
dcae873414 | ||
![]() |
32214acb3a | ||
![]() |
e64bcf5a99 | ||
![]() |
62cb52f431 | ||
![]() |
cf8b1b7853 | ||
![]() |
bc97e005fa | ||
![]() |
679fa7ed3c | ||
![]() |
4f084f3ab5 | ||
![]() |
af2716626a | ||
![]() |
6625c085ae | ||
![]() |
af2578562c | ||
![]() |
8099e7b1ba | ||
![]() |
0a3e348225 | ||
![]() |
b78e6ac2c3 | ||
![]() |
cbfe65c2fe | ||
![]() |
284d62da81 | ||
![]() |
c6df70fb48 | ||
![]() |
1b8616adee | ||
![]() |
639bd4873b | ||
![]() |
e0904b27ff | ||
![]() |
d9eff33ce2 | ||
![]() |
8974102f6b | ||
![]() |
599182b108 | ||
![]() |
6a736cc129 | ||
![]() |
15b93069bb | ||
![]() |
19b5c10963 | ||
![]() |
bcfbddefe1 | ||
![]() |
780cb33741 | ||
![]() |
8d7c07f191 | ||
![]() |
fefd3f66f9 | ||
![]() |
d57b8833c4 | ||
![]() |
9584c6ae90 | ||
![]() |
021b2fddff | ||
![]() |
b6f2e05819 | ||
![]() |
3ed08d1e4d | ||
![]() |
26a077fc7e | ||
![]() |
8461734ee4 | ||
![]() |
6f4c2dada4 | ||
![]() |
ab42fe38fd | ||
![]() |
3be5d63c2f | ||
![]() |
b4dc22cab7 | ||
![]() |
2b125c69cc | ||
![]() |
9268366cad | ||
![]() |
d0eedc4a5f | ||
![]() |
4460416abc | ||
![]() |
884e1cda7c | ||
![]() |
46a885bf9f | ||
![]() |
7dbca9be86 | ||
![]() |
7d9bb76ac7 | ||
![]() |
26ab7b07a6 | ||
![]() |
14499534ba | ||
![]() |
1540df0e79 | ||
![]() |
5d68c80b16 | ||
![]() |
5f8cd1a4be | ||
![]() |
14201d23e7 | ||
![]() |
a229b17434 | ||
![]() |
ca2c693679 | ||
![]() |
cdcb27a4fe | ||
![]() |
0c5ccb35c7 | ||
![]() |
9d787df196 | ||
![]() |
0290e98271 | ||
![]() |
d136ca4eeb | ||
![]() |
a55f910cf6 | ||
![]() |
96efbc51ac | ||
![]() |
9d36d4fb1d | ||
![]() |
41bfa5dad1 | ||
![]() |
db9fbaf9b8 | ||
![]() |
56fb5c4dbf | ||
![]() |
a8986425a4 | ||
![]() |
ea3c4e8273 | ||
![]() |
6db8c5a5fe | ||
![]() |
ab9b04f55b | ||
![]() |
c4b572b5ca | ||
![]() |
cc6f0925df | ||
![]() |
d50cf62d62 | ||
![]() |
75369f8ba0 | ||
![]() |
8e2bcb4b42 | ||
![]() |
bfac40665b | ||
![]() |
6c6d805765 | ||
![]() |
44f870be42 | ||
![]() |
b37398dc1c | ||
![]() |
1b0a362d83 | ||
![]() |
bb425d20a1 | ||
![]() |
cbd69dc6ff | ||
![]() |
cb8def95c4 | ||
![]() |
78d1d4f86d | ||
![]() |
5bfa3b363a | ||
![]() |
1d4b337543 | ||
![]() |
8c67d395d4 | ||
![]() |
02566acdd7 | ||
![]() |
478aa7dac1 | ||
![]() |
967db70090 | ||
![]() |
619c1bb334 | ||
![]() |
57aa1e9140 | ||
![]() |
af2fcbafe8 | ||
![]() |
7b6bdc3f94 | ||
![]() |
db43f56d94 | ||
![]() |
a1ebd77179 | ||
![]() |
e26d76dca1 | ||
![]() |
d59732004d | ||
![]() |
a3a8f58d73 | ||
![]() |
c9e5b75308 | ||
![]() |
fd191a7b41 | ||
![]() |
e42c7a980c | ||
![]() |
85804a9197 | ||
![]() |
ee2321c91e | ||
![]() |
11fbde4454 | ||
![]() |
fb05f9876a | ||
![]() |
7e9bfdde14 | ||
![]() |
7e9fc37db8 | ||
![]() |
bb278147cf | ||
![]() |
81b676a675 | ||
![]() |
6b46e7baa0 | ||
![]() |
85c85f07e2 | ||
![]() |
c853dc72e9 | ||
![]() |
18d0c9b858 | ||
![]() |
0a5fd0dcec | ||
![]() |
e0e99c59a5 | ||
![]() |
d46394ad33 | ||
![]() |
87dc81a1f6 | ||
![]() |
ce92ca0527 | ||
![]() |
c390590fac | ||
![]() |
fd8e4aef90 | ||
![]() |
c5a742a3bf | ||
![]() |
fc4e10a859 | ||
![]() |
83bb0893ed | ||
![]() |
8fdcc1a9b1 | ||
![]() |
a23b368c92 | ||
![]() |
bbfff3e58b | ||
![]() |
9c322b2f3b | ||
![]() |
dff9a66c44 | ||
![]() |
449b0e0707 | ||
![]() |
4a5a9c6d89 | ||
![]() |
917f3e4d25 | ||
![]() |
7d848c55a6 | ||
![]() |
7d17d6c976 | ||
![]() |
b8060ef781 | ||
![]() |
727543c1e6 | ||
![]() |
c85cda9e2f | ||
![]() |
c0c6c74d99 | ||
![]() |
d26bd6ca55 | ||
![]() |
e22eb857be | ||
![]() |
2fa6fd3aaa | ||
![]() |
dd5875499e | ||
![]() |
d351541ee6 | ||
![]() |
d928724c3c | ||
![]() |
727e68d0b5 | ||
![]() |
8d28614e4f | ||
![]() |
fba5fbbdad | ||
![]() |
d008b6b89f | ||
![]() |
aede120c92 | ||
![]() |
cc2303001e | ||
![]() |
54e7d7c32d | ||
![]() |
bcd352dfa1 | ||
![]() |
d837ac3984 | ||
![]() |
900e15da34 | ||
![]() |
19d69051a3 | ||
![]() |
31737a05e1 | ||
![]() |
1161f03777 | ||
![]() |
cf24ac8c19 | ||
![]() |
af3ef92a6b | ||
![]() |
c46cda8260 | ||
![]() |
34bd2be23f | ||
![]() |
c3dd68fcf1 | ||
![]() |
3e35441f18 | ||
![]() |
dde2db3da9 | ||
![]() |
cbc21754e5 | ||
![]() |
eb2dc8c34b | ||
![]() |
c4e098a514 | ||
![]() |
72875215a3 | ||
![]() |
335bc217b3 | ||
![]() |
510aecdbd8 | ||
![]() |
9dd9d81fc6 | ||
![]() |
a5b48ce798 | ||
![]() |
59afbd8e73 | ||
![]() |
348baca3e4 | ||
![]() |
83691c413f | ||
![]() |
ca36b9b8f8 | ||
![]() |
a9c7dc74c4 | ||
![]() |
ce862de624 | ||
![]() |
500861cd05 | ||
![]() |
44d26d9209 | ||
![]() |
35270e34d0 | ||
![]() |
fe654ff0aa | ||
![]() |
5e1e1ec060 | ||
![]() |
2673ff1932 | ||
![]() |
e8f7ea6794 | ||
![]() |
3899211bfc | ||
![]() |
6e0c1c448d | ||
![]() |
6ae68b4674 | ||
![]() |
41eba87b32 | ||
![]() |
a1084c02fd | ||
![]() |
5ac8420abc | ||
![]() |
24d009507f | ||
![]() |
e9020221a7 | ||
![]() |
b59e9e5724 | ||
![]() |
b5859d6359 | ||
![]() |
dbfaae0e34 | ||
![]() |
8d85429a44 | ||
![]() |
3e4ab73cd4 | ||
![]() |
4e32b2e916 | ||
![]() |
356333b331 | ||
![]() |
f62f3a2191 | ||
![]() |
389333396a | ||
![]() |
cfb7410cd0 | ||
![]() |
f672b1c399 | ||
![]() |
f12f694355 | ||
![]() |
9a9c6e1256 | ||
![]() |
9c65c125a9 | ||
![]() |
7d4d3f8da6 | ||
![]() |
569ffe77bf | ||
![]() |
a42b2b8133 | ||
![]() |
31ba4de21d | ||
![]() |
a005c47763 | ||
![]() |
5db6ca5a4b | ||
![]() |
1a6fdf2417 | ||
![]() |
27a2c3a406 | ||
![]() |
b347edfa23 | ||
![]() |
3ed09d970e | ||
![]() |
a28e2aeefe | ||
![]() |
c6a71c7b8a | ||
![]() |
6ecb9a2d68 | ||
![]() |
918a6874df | ||
![]() |
2663232a01 | ||
![]() |
cebab07e68 | ||
![]() |
a04f3077cd | ||
![]() |
04b873598b | ||
![]() |
22137f9cac | ||
![]() |
54665349ec | ||
![]() |
f251a89772 | ||
![]() |
fbdfa57746 | ||
![]() |
6b095274fb | ||
![]() |
11174408e8 | ||
![]() |
c2117747fd | ||
![]() |
4f6e293308 | ||
![]() |
d9076cac19 | ||
![]() |
ff52ca1b57 | ||
![]() |
8a3c4957fc | ||
![]() |
3f54a83ca8 | ||
![]() |
7fa3b9e376 | ||
![]() |
39135af155 | ||
![]() |
02640e8e65 | ||
![]() |
579f385384 | ||
![]() |
56d60c4b2d | ||
![]() |
62fd2b3644 | ||
![]() |
cd9072d342 | ||
![]() |
19bab59c48 | ||
![]() |
d8b627b9dc | ||
![]() |
6320d072a1 | ||
![]() |
7abeb49878 | ||
![]() |
14fcfbec3e | ||
![]() |
fa9f15e3be | ||
![]() |
ae4758ce0d | ||
![]() |
66f01450a8 | ||
![]() |
e5786ed1b7 | ||
![]() |
b47517140b | ||
![]() |
3de6001e1e | ||
![]() |
c8d685c9d3 | ||
![]() |
d6d3173916 | ||
![]() |
8b6bf0ef57 | ||
![]() |
7bd8f23303 | ||
![]() |
a08ea34aba | ||
![]() |
6cb77ea91f | ||
![]() |
c586b033a7 | ||
![]() |
a9f634f815 | ||
![]() |
551c2dd71f | ||
![]() |
ffc4f173b6 | ||
![]() |
ebd1d65a1b | ||
![]() |
5b68300899 | ||
![]() |
2b6dd6a1fc | ||
![]() |
1d22c670b0 | ||
![]() |
0ae480dcbf | ||
![]() |
256cba18c3 | ||
![]() |
e6fcec9173 | ||
![]() |
1db3d2615d | ||
![]() |
5204d1d36d | ||
![]() |
3fa59d171d | ||
![]() |
d7264a3cc0 | ||
![]() |
9078167927 | ||
![]() |
3bd7fba7af | ||
![]() |
b455451f49 | ||
![]() |
efa5eb424d | ||
![]() |
3baa150bd4 | ||
![]() |
43cc4d84bc | ||
![]() |
6b84015e67 | ||
![]() |
60bbb8fcc9 | ||
![]() |
16c84f2873 | ||
![]() |
579238a3ac | ||
![]() |
2b5cd3dbf8 | ||
![]() |
3d8a164d0e | ||
![]() |
00ae54f00a | ||
![]() |
488d55c546 | ||
![]() |
9d6165f235 | ||
![]() |
2258f00e91 | ||
![]() |
2bac2d6d76 | ||
![]() |
b6b895bab5 | ||
![]() |
fdeae2a3ac | ||
![]() |
040f388331 | ||
![]() |
7990578443 | ||
![]() |
528ae4f46c | ||
![]() |
0fb7b847c5 | ||
![]() |
a67a6f957d | ||
![]() |
965edeb63b | ||
![]() |
329bbd797f | ||
![]() |
065fc56ab2 | ||
![]() |
64d144aece | ||
![]() |
2d9b156e9e | ||
![]() |
2b9be6f707 | ||
![]() |
b26897fb60 | ||
![]() |
8bf25df640 | ||
![]() |
e743cfdd4b | ||
![]() |
636e5cd2d5 | ||
![]() |
f046336c44 | ||
![]() |
665b7e58ba | ||
![]() |
1391a06d80 | ||
![]() |
404815eaf0 | ||
![]() |
6c128565b1 | ||
![]() |
e1cb85802b | ||
![]() |
cbd60fcaaf | ||
![]() |
28a88b6886 | ||
![]() |
7081e99735 | ||
![]() |
dc67eda6bf | ||
![]() |
b85f723535 | ||
![]() |
9ff9dde8d7 | ||
![]() |
8714280104 | ||
![]() |
6d70aa7836 | ||
![]() |
14986b9d58 | ||
![]() |
e5c9bc1198 | ||
![]() |
fc9bc6f8db | ||
![]() |
c62b94614d | ||
![]() |
833685ded5 | ||
![]() |
3cff5fb56f | ||
![]() |
3e6dad37c4 | ||
![]() |
600c876968 | ||
![]() |
cc68f78d92 | ||
![]() |
48ca487621 | ||
![]() |
13cb578a37 | ||
![]() |
df2afa9ff4 | ||
![]() |
76d5c79e9c | ||
![]() |
fdf2b152e5 | ||
![]() |
178c189b0b | ||
![]() |
14be3b16cd | ||
![]() |
2e111dd57a | ||
![]() |
06e9f8870a | ||
![]() |
7e0d508002 | ||
![]() |
585b3b37c0 | ||
![]() |
167a320e5f | ||
![]() |
2242cd92ee | ||
![]() |
d20fb951fa | ||
![]() |
e0a393361d | ||
![]() |
da9c518116 | ||
![]() |
4d51eff05f | ||
![]() |
a6c718ce8e | ||
![]() |
43a050e542 | ||
![]() |
25787f8071 | ||
![]() |
ecfa02bdc8 | ||
![]() |
080d1b718d | ||
![]() |
8ea8d6de80 | ||
![]() |
4dbc1d1bb3 | ||
![]() |
3b9669cff4 | ||
![]() |
a6332e6980 | ||
![]() |
9037b63eb2 | ||
![]() |
308015bc4d | ||
![]() |
2692a42231 | ||
![]() |
e064127729 | ||
![]() |
103281f3b6 | ||
![]() |
69ba546721 | ||
![]() |
d65638dacb | ||
![]() |
a0be1eddcf | ||
![]() |
e1b48995c2 | ||
![]() |
194e074764 | ||
![]() |
7f1d77d9fb | ||
![]() |
3722020071 | ||
![]() |
f7235c223d | ||
![]() |
868eba13f2 | ||
![]() |
2cae00be9e | ||
![]() |
69eba8c40a | ||
![]() |
17b01c5b13 | ||
![]() |
a0508937fc | ||
![]() |
bc07024624 | ||
![]() |
907f75447b | ||
![]() |
500d8e6002 | ||
![]() |
3d12d7a2cc | ||
![]() |
886b9afcc5 | ||
![]() |
f3f9777497 | ||
![]() |
5596b70bd0 | ||
![]() |
4211605000 | ||
![]() |
aa09b74a41 | ||
![]() |
d9a7ea5b43 | ||
![]() |
914f531f39 | ||
![]() |
0fc0dcff60 | ||
![]() |
0e32ce3219 | ||
![]() |
ff0636635a | ||
![]() |
ba111df2b9 | ||
![]() |
dff1671f8f | ||
![]() |
44f77ac1b0 | ||
![]() |
641a8558f4 | ||
![]() |
3bff70ef15 | ||
![]() |
d672bf167c | ||
![]() |
ea62729238 | ||
![]() |
32ec0a762d | ||
![]() |
ca121b1a5c | ||
![]() |
0db77f5a2b | ||
![]() |
cc4037d120 | ||
![]() |
a999414eaf | ||
![]() |
00083a0909 | ||
![]() |
8a7f561ee5 | ||
![]() |
32b2fb8a27 | ||
![]() |
104727ad6e | ||
![]() |
cce471c9ce | ||
![]() |
353e7a7ec3 | ||
![]() |
73088e46f7 | ||
![]() |
52f1b04183 | ||
![]() |
83e0dc7a3d | ||
![]() |
c4bb88715c | ||
![]() |
54c7ace145 | ||
![]() |
c1b8934faa | ||
![]() |
5746f04994 | ||
![]() |
f9452c94c0 | ||
![]() |
68c49db952 | ||
![]() |
f9c7788ba5 | ||
![]() |
68318328f1 | ||
![]() |
c9a9968dfc | ||
![]() |
48dba7f9ac | ||
![]() |
bdf1f472b4 | ||
![]() |
e4297a66b1 | ||
![]() |
ec6d8eab69 | ||
![]() |
dece5ee1f5 | ||
![]() |
a41dc8f969 | ||
![]() |
aa11b710ce | ||
![]() |
6af5a4accf | ||
![]() |
ec8974914f | ||
![]() |
b9775297cd | ||
![]() |
4a6b33f1ee | ||
![]() |
7dd7ff0f33 | ||
![]() |
126732bcc1 | ||
![]() |
23d6dcd125 | ||
![]() |
9fd9e96130 | ||
![]() |
f0a7fc5b43 | ||
![]() |
d82e0d7dd8 | ||
![]() |
5545fc3046 | ||
![]() |
a638056838 | ||
![]() |
1f524c4544 | ||
![]() |
47b8f66ced | ||
![]() |
52da8a514a | ||
![]() |
5cd7c104bd | ||
![]() |
173edca09e | ||
![]() |
506b219237 | ||
![]() |
6c83d7d5bf | ||
![]() |
a059f72b09 | ||
![]() |
afcebd136f | ||
![]() |
3d3c192621 | ||
![]() |
92b3ee855f | ||
![]() |
650ab3b077 | ||
![]() |
474cca1e9d | ||
![]() |
c0cae7f702 | ||
![]() |
3f7e5358e5 | ||
![]() |
3d352f5228 | ||
![]() |
540eca9d9d | ||
![]() |
19cd47fd26 | ||
![]() |
cf62cc435f | ||
![]() |
8b6bdafc39 | ||
![]() |
27790828d1 | ||
![]() |
d782ffb822 | ||
![]() |
5a84ac3fe3 | ||
![]() |
343b7d7488 | ||
![]() |
aefea76cf8 | ||
![]() |
4976edb1a6 | ||
![]() |
171ba532bc | ||
![]() |
bfd2e8c25f | ||
![]() |
b2d225a669 | ||
![]() |
a5f01bbfb5 | ||
![]() |
7e2285a48a | ||
![]() |
3e964eeb96 | ||
![]() |
aec9f902f0 | ||
![]() |
764eb40cc9 | ||
![]() |
95a5b23a38 | ||
![]() |
5d833a9f5b | ||
![]() |
3e51b2f6fc | ||
![]() |
852105dc44 | ||
![]() |
a7473ef379 | ||
![]() |
f7f3792390 | ||
![]() |
2d674a9336 | ||
![]() |
24a38bc1cb | ||
![]() |
82b1739dce | ||
![]() |
fc6b272f41 | ||
![]() |
c9baff669d | ||
![]() |
72ee74b9be | ||
![]() |
cc21808764 | ||
![]() |
78021eace1 | ||
![]() |
65d1a8a4ae | ||
![]() |
187a8e08d5 | ||
![]() |
c9a81c1f91 | ||
![]() |
d580636e97 | ||
![]() |
6ca264a151 | ||
![]() |
aa505d588f | ||
![]() |
96c6fa9202 | ||
![]() |
25706eafac | ||
![]() |
8aa9926839 | ||
![]() |
ff3953efe1 | ||
![]() |
ec5e5ae27a | ||
![]() |
3cc4c8ba9b | ||
![]() |
81672479af | ||
![]() |
6a5170a15f | ||
![]() |
1f4aaaeb5e | ||
![]() |
79148c2945 | ||
![]() |
5767201eaf | ||
![]() |
221c342d50 | ||
![]() |
b56e174322 | ||
![]() |
5afa957915 | ||
![]() |
af3b67b213 | ||
![]() |
93d7b823b4 | ||
![]() |
4a1255bc38 | ||
![]() |
15976a0670 | ||
![]() |
24ba78cb77 | ||
![]() |
15f0b1f624 | ||
![]() |
823311ea3b | ||
![]() |
f67a1f7f64 | ||
![]() |
e625eea4f9 | ||
![]() |
f6297ebe73 | ||
![]() |
372c9b9647 | ||
![]() |
63c65b984a | ||
![]() |
06c6ea654f | ||
![]() |
ab8bfca794 | ||
![]() |
386579a45a | ||
![]() |
f1040fc470 | ||
![]() |
585fd00624 | ||
![]() |
e045e1f386 | ||
![]() |
bf7883ebca | ||
![]() |
a844fb1552 | ||
![]() |
35022f987c | ||
![]() |
8a240aca9e | ||
![]() |
68e7661ca7 | ||
![]() |
e88e3b2797 | ||
![]() |
df68781fca | ||
![]() |
f855f9daaf | ||
![]() |
c5758f2090 | ||
![]() |
3e9b4330a9 | ||
![]() |
c072e13162 | ||
![]() |
f2271428d4 | ||
![]() |
cef379bb03 | ||
![]() |
3e624cd9dc | ||
![]() |
5297d4f5b2 | ||
![]() |
b7c8f59fef | ||
![]() |
13f77e9fd5 | ||
![]() |
472189da15 | ||
![]() |
e5ec81a354 | ||
![]() |
4c3be42cdf | ||
![]() |
24450a5ab7 | ||
![]() |
df7be11b38 | ||
![]() |
52f74c8010 |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
/Makefile.inc
|
||||
/dracut.8
|
||||
/dracut-catimages.8
|
||||
/dracut.conf.5
|
||||
@@ -11,3 +12,8 @@ test*.img
|
||||
/.buildpath
|
||||
/.project
|
||||
/dracut-version.sh
|
||||
/install/dracut-install
|
||||
/*.rpm
|
||||
/*.[0-9]
|
||||
/modules.d/98systemd/*.service.8
|
||||
/*.sign
|
||||
|
27
.mailmap
27
.mailmap
@@ -1,12 +1,15 @@
|
||||
Philippe Seewer <philippe.seewer@bfh.ch> <philippe.seewer-omB+W0Dpw2o@public.gmane.org>
|
||||
Seewer Philippe <philippe.seewer@bfh.ch> <philippe.seewer@bfh.ch>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch> <philippe.seewer@bfh.ch>
|
||||
Victor Lowther <victor.lowther@gmail.com> <victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
|
||||
Harald Hoyer <harald@redhat.com> <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
|
||||
Harald Hoyer <harald@redhat.com> <harald@eeepc.(none)>
|
||||
Mike Snitzer <snitzer@redhat.com> <msnitzer@redhat.com>
|
||||
Amerigo Wang <amwang@redhat.com> <xiyou.wangcong@gmail.com>
|
||||
Andrey Borzenkov <arvidjaar@gmail.com> <arvidjaar@mail.ru>
|
||||
Dan Horák <dhorak@redhat.com> <dan@danny.cz>
|
||||
John Reiser <jreiser@bitwagon.com> <jreiser@BitWagon.com>
|
||||
Luca Berra <bluca@vodka.it> <bluca@comedia.it>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch> <philippe.seewer-omB+W0Dpw2o@public.gmane.org>
|
||||
Seewer Philippe <philippe.seewer@bfh.ch> <philippe.seewer@bfh.ch>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch> <philippe.seewer@bfh.ch>
|
||||
Victor Lowther <victor.lowther@gmail.com> <victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
|
||||
Harald Hoyer <harald@redhat.com> <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
|
||||
Harald Hoyer <harald@redhat.com> <harald@eeepc.(none)>
|
||||
Mike Snitzer <snitzer@redhat.com> <msnitzer@redhat.com>
|
||||
Amerigo Wang <amwang@redhat.com> <xiyou.wangcong@gmail.com>
|
||||
Andrey Borzenkov <arvidjaar@gmail.com> <arvidjaar@mail.ru>
|
||||
Dan Horák <dhorak@redhat.com> <dan@danny.cz>
|
||||
John Reiser <jreiser@bitwagon.com> <jreiser@BitWagon.com>
|
||||
Luca Berra <bluca@vodka.it> <bluca@comedia.it>
|
||||
Dave Young <dyoung@redhat.com> dyoung@redhat.com
|
||||
Frederick Grose <fgrose@sugarlabs.org> <fgrose@gmail.com>
|
||||
Frederic Crozat <fcrozat@suse.com> <fcrozat@mandriva.com>
|
||||
|
33
50-dracut.install
Executable file
33
50-dracut.install
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if [[ -f /etc/kernel/cmdline ]]; then
|
||||
readarray -t BOOT_OPTIONS < /etc/kernel/cmdline
|
||||
fi
|
||||
|
||||
if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
|
||||
readarray -t BOOT_OPTIONS < /proc/cmdline
|
||||
fi
|
||||
|
||||
unset noimageifnotneeded
|
||||
|
||||
for ((i=0; i < "${#BOOT_OPTIONS[@]}"; i++)); do
|
||||
if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then
|
||||
noimageifnotneeded="yes"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
ret=0
|
||||
case "$1" in
|
||||
add)
|
||||
dracut ${noimageifnotneeded:+--noimageifnotneeded} "$3"/initrd "$2"
|
||||
ret=$?
|
||||
;;
|
||||
remove)
|
||||
rm -f -- "$3"/initrd
|
||||
ret=$?
|
||||
;;
|
||||
esac
|
||||
exit $ret
|
70
51-dracut-rescue-postinst.sh
Executable file
70
51-dracut-rescue-postinst.sh
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
export LANG=C
|
||||
|
||||
KERNEL_VERSION="$1"
|
||||
KERNEL_IMAGE="$2"
|
||||
|
||||
[[ -f /etc/os-release ]] && . /etc/os-release
|
||||
|
||||
if [[ ! -f /etc/machine-id ]] || [[ ! -s /etc/machine-id ]]; then
|
||||
systemd-machine-id-setup
|
||||
fi
|
||||
|
||||
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||||
|
||||
[[ $MACHINE_ID ]] || exit 1
|
||||
[[ -f $KERNEL_IMAGE ]] || exit 1
|
||||
|
||||
INITRDFILE="/boot/initramfs-0-rescue-${MACHINE_ID}.img"
|
||||
NEW_KERNEL_IMAGE="${KERNEL_IMAGE%/*}/vmlinuz-0-rescue-${MACHINE_ID}"
|
||||
|
||||
[[ -f $INITRDFILE ]] && [[ -f $NEW_KERNEL_IMAGE ]] && exit 0
|
||||
|
||||
dropindirs_sort()
|
||||
{
|
||||
suffix=$1; shift
|
||||
args=("$@")
|
||||
files=$(
|
||||
while (( $# > 0 )); do
|
||||
for i in ${1}/*${suffix}; do
|
||||
[[ -f $i ]] && echo ${i##*/}
|
||||
done
|
||||
shift
|
||||
done | sort -Vu
|
||||
)
|
||||
|
||||
for f in $files; do
|
||||
for d in "${args[@]}"; do
|
||||
if [[ -f "$d/$f" ]]; then
|
||||
echo "$d/$f"
|
||||
continue 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
# source our config dir
|
||||
for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do
|
||||
[[ -e $f ]] && . "$f"
|
||||
done
|
||||
|
||||
[[ $dracut_rescue_image != "yes" ]] && exit 0
|
||||
|
||||
if [[ ! -f $INITRDFILE ]]; then
|
||||
dracut --no-hostonly -a "rescue" "$INITRDFILE" "$KERNEL_VERSION"
|
||||
((ret+=$?))
|
||||
fi
|
||||
|
||||
if [[ ! -f $NEW_KERNEL_IMAGE ]]; then
|
||||
cp "$KERNEL_IMAGE" "$NEW_KERNEL_IMAGE"
|
||||
((ret+=$?))
|
||||
fi
|
||||
|
||||
new-kernel-pkg --install "$KERNEL_VERSION" --kernel-image "$NEW_KERNEL_IMAGE" --initrdfile "$INITRDFILE" --banner "$NAME $VERSION_ID Rescue $MACHINE_ID"
|
||||
|
||||
((ret+=$?))
|
||||
|
||||
exit $ret
|
103
51-dracut-rescue.install
Executable file
103
51-dracut-rescue.install
Executable file
@@ -0,0 +1,103 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
export LANG=C
|
||||
|
||||
COMMAND="$1"
|
||||
KERNEL_VERSION="$2"
|
||||
BOOT_DIR_ABS="${3%/*}/0-rescue"
|
||||
KERNEL_IMAGE="$4"
|
||||
|
||||
|
||||
dropindirs_sort()
|
||||
{
|
||||
suffix=$1; shift
|
||||
args=("$@")
|
||||
files=$(
|
||||
while (( $# > 0 )); do
|
||||
for i in ${1}/*${suffix}; do
|
||||
[[ -f $i ]] && echo ${i##*/}
|
||||
done
|
||||
shift
|
||||
done | sort -Vu
|
||||
)
|
||||
|
||||
for f in $files; do
|
||||
for d in "${args[@]}"; do
|
||||
if [[ -f "$d/$f" ]]; then
|
||||
echo "$d/$f"
|
||||
continue 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
[[ -f /etc/os-release ]] && . /etc/os-release
|
||||
|
||||
if [[ ! -f /etc/machine-id ]] || [[ ! -s /etc/machine-id ]]; then
|
||||
systemd-machine-id-setup
|
||||
fi
|
||||
|
||||
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||||
|
||||
if [[ -f /etc/kernel/cmdline ]]; then
|
||||
readarray -t BOOT_OPTIONS < /etc/kernel/cmdline
|
||||
fi
|
||||
if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
|
||||
readarray -t BOOT_OPTIONS < /proc/cmdline
|
||||
fi
|
||||
if ! [[ $BOOT_OPTIONS ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LOADER_ENTRY="/boot/loader/entries/${MACHINE_ID}-0-rescue.conf"
|
||||
BOOT_DIR="/${MACHINE_ID}/0-rescue"
|
||||
|
||||
ret=0
|
||||
|
||||
case "$COMMAND" in
|
||||
add)
|
||||
for i in "/boot/loader/entries/${MACHINE_ID}-0-rescue.conf"; do
|
||||
[[ -f $i ]] && exit 0
|
||||
done
|
||||
|
||||
# source our config dir
|
||||
for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do
|
||||
[[ -e $f ]] && . "$f"
|
||||
done
|
||||
|
||||
[[ $dracut_rescue_image != "yes" ]] && exit 0
|
||||
|
||||
[[ -d "$BOOT_DIR_ABS" ]] || mkdir -p "$BOOT_DIR_ABS"
|
||||
|
||||
if ! cp "$KERNEL_IMAGE" "$BOOT_DIR_ABS"/linux; then
|
||||
echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/linux'!" >&2
|
||||
fi
|
||||
|
||||
dracut --no-hostonly -a "rescue" "$BOOT_DIR_ABS"/initrd "$2"
|
||||
((ret+=$?))
|
||||
|
||||
{
|
||||
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+=$?))
|
||||
;;
|
||||
|
||||
remove)
|
||||
exit 0
|
||||
;;
|
||||
|
||||
*)
|
||||
usage
|
||||
ret=1;;
|
||||
esac
|
||||
|
||||
((ret+=$?))
|
||||
|
||||
exit $ret
|
64
AUTHORS
64
AUTHORS
@@ -1,67 +1,103 @@
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
Victor Lowther <victor.lowther@gmail.com>
|
||||
Amadeusz Żołnowski <aidecoe@aidecoe.name>
|
||||
Will Woods <wwoods@redhat.com>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Amadeusz Żołnowski <aidecoe@aidecoe.name>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Will Woods <wwoods@redhat.com>
|
||||
Michal Soltys <soltys@ziu.info>
|
||||
Dave Young <dyoung@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Michal Soltys <soltys@ziu.info>
|
||||
Amerigo Wang <amwang@redhat.com>
|
||||
Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
Colin Guthrie <colin@mageia.org>
|
||||
Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
John Reiser <jreiser@bitwagon.com>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
WANG Chao <chaowang@redhat.com>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
Dan Horák <dhorak@redhat.com>
|
||||
Baoquan He <bhe@redhat.com>
|
||||
Leho Kraav <leho@kraav.com>
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
Kamil Rytarowski <n54@gmx.com>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
Chao Wang <chaowang@redhat.com>
|
||||
Frederic Crozat <fcrozat@suse.com>
|
||||
Jesse Keating <jkeating@redhat.com>
|
||||
Milan Broz <mbroz@redhat.com>
|
||||
Radek Vykydal <rvykydal@redhat.com>
|
||||
Roberto Sassu <roberto.sassu@polito.it>
|
||||
Anton Blanchard <anton@samba.org>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
Colin Walters <walters@verbum.org>
|
||||
David Cantrell <dcantrell@redhat.com>
|
||||
Dennis Gilmore <dennis@ausil.us>
|
||||
Jon Ander Hernandez <jonan.h@gmail.com>
|
||||
Juan RP <xtraeme@gmail.com>
|
||||
Lance Albertson <lance@osuosl.org>
|
||||
Marian Ganisin <mganisin@redhat.com>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Wim Muskee <wimmuskee@gmail.com>
|
||||
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
||||
Alan Pevec <apevec@redhat.com>
|
||||
Frederick Grose <fgrose@sugarlabs.org>
|
||||
Ian Dall <ian@beware.dropbear.id.au>
|
||||
James Buren <ryuo@frugalware.org>
|
||||
James Lee <jlee@thestaticvoid.com>
|
||||
Joey Boggs <jboggs@redhat.com>
|
||||
Jon Ander Hernandez <jonan.h@gmail.com>
|
||||
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
Mike Snitzer <snitzer@redhat.com>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Przemysław Rudy <prudy1@o2.pl>
|
||||
Stefan Reimer <it@startux.de>
|
||||
Thomas Lange <lange@informatik.uni-koeln.de>
|
||||
Vivek Goyal <vgoyal@redhat.com>
|
||||
Vladislav Bogdanov <bubble@hoster-ok.com>
|
||||
Adam Williamson <awilliam@redhat.com>
|
||||
Alexander Todorov <atodorov@redhat.com>
|
||||
Andy Lutomirski <luto@mit.edu>
|
||||
Anssi Hannula <anssi@mageia.org>
|
||||
Brandon Philips <brandon@ifup.co>
|
||||
Canek Peláez Valdés <caneko@gmail.com>
|
||||
Chris Leech <cleech@redhat.com>
|
||||
Christian Heinz <christian.ch.heinz@gmail.com>
|
||||
Cong Wang <amwang@redhat.com>
|
||||
Daniel Schaal <farbing@web.de>
|
||||
Dave Jones <davej@redhat.com>
|
||||
Dave Young <dave@redhat.com>
|
||||
Dennis Schridde <devurandom@gmx.net>
|
||||
Duane Griffin <duaneg@dghda.com>
|
||||
Frederic Crozat <fcrozat@mandriva.com>
|
||||
Glen Gray <slaine@slaine.org>
|
||||
Hermann Gausterer <git-dracut-2012@mrq1.org>
|
||||
James Laska <jlaska@redhat.com>
|
||||
Jan Stodola <jstodola@redhat.com>
|
||||
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
Leho Kraav <leho@kraav.com>
|
||||
Jiri Pirko <jiri@resnulli.us>
|
||||
Joe Lawrence <Joe.Lawrence@stratus.com>
|
||||
Kevin Yung <Kevin.Yung@myob.com>
|
||||
Kyle McMartin <kyle@redhat.com>
|
||||
Lars R. Damerow <lars@pixar.com>
|
||||
Lennert Buytenhek <buytenh@wantstofly.org>
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
Matt <smoothsailing72@hotmail.com>
|
||||
Matt Smith <shadowfax@gmx.com>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Mike Gorse <mgorse@suse.com>
|
||||
Munehiro Matsuda <haro@kgt.co.jp>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
Nikoli <nikoli@lavabit.com>
|
||||
Olivier Blin <dev@blino.org>
|
||||
Paolo Bonzini <pbonzini@redhat.com>
|
||||
Peter Robinson <pbrobinson@fedoraproject.org>
|
||||
Pádraig Brady <P@draigBrady.com>
|
||||
Quentin Armitage <quentin@armitage.org.uk>
|
||||
Robert Buchholz <rbu@goodpoint.de>
|
||||
Sergey Fionov <fionov@gmail.com>
|
||||
Srinivasa T N <seenutn@linux.vnet.ibm.com>
|
||||
Thilo Bangert <thilo.bangert@gmx.net>
|
||||
Thomas Lange <lange@informatik.uni-koeln.de>
|
||||
Thomas Backlund <tmb@mageia.org>
|
||||
Tomasz Torcz <tomek@pipebreaker.pl>
|
||||
Vadim Kuznetsov <vadimk@gentoo.org>
|
||||
Ville Skyttä <ville.skytta@iki.fi>
|
||||
|
42
COPYING
42
COPYING
@@ -1,12 +1,12 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
675 Mass Ave, Cambridge, MA 02139, USA
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
@@ -225,7 +225,7 @@ impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Programs
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -303,16 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
@@ -335,5 +335,5 @@ necessary. Here is a sample; alter the names:
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
|
174
Makefile
174
Makefile
@@ -1,5 +1,9 @@
|
||||
VERSION=021
|
||||
GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8)
|
||||
-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); [ $${v\#*-} != $$v ] && echo -$${v\#*-}; } )
|
||||
|
||||
-include Makefile.inc
|
||||
|
||||
prefix ?= /usr
|
||||
libdir ?= ${prefix}/lib
|
||||
@@ -8,54 +12,79 @@ pkglibdir ?= ${libdir}/dracut
|
||||
sysconfdir ?= ${prefix}/etc
|
||||
bindir ?= ${prefix}/bin
|
||||
mandir ?= ${prefix}/share/man
|
||||
CFLAGS ?= -O2 -g -Wall
|
||||
CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64
|
||||
bashcompletiondir ?= ${datadir}/bash-completion/completions
|
||||
|
||||
manpages = dracut.8 \
|
||||
dracut.cmdline.7 \
|
||||
dracut.conf.5 \
|
||||
dracut-catimages.8 \
|
||||
lsinitrd.1 \
|
||||
mkinitrd.8
|
||||
man1pages = lsinitrd.1
|
||||
|
||||
.PHONY: install clean archive rpm testimage test all check AUTHORS doc
|
||||
man5pages = dracut.conf.5
|
||||
|
||||
all: syncheck dracut-version.sh dracut-install
|
||||
man7pages = dracut.cmdline.7 \
|
||||
dracut.bootup.7
|
||||
|
||||
DRACUT_INSTALL_SOURCE = \
|
||||
install/dracut-install.c \
|
||||
install/hashmap.c\
|
||||
install/log.c \
|
||||
install/util.c
|
||||
man8pages = dracut.8 \
|
||||
dracut-catimages.8 \
|
||||
mkinitrd.8 \
|
||||
modules.d/98systemd/dracut-cmdline.service.8 \
|
||||
modules.d/98systemd/dracut-initqueue.service.8 \
|
||||
modules.d/98systemd/dracut-mount.service.8 \
|
||||
modules.d/98systemd/dracut-shutdown.service.8 \
|
||||
modules.d/98systemd/dracut-pre-mount.service.8 \
|
||||
modules.d/98systemd/dracut-pre-pivot.service.8 \
|
||||
modules.d/98systemd/dracut-pre-trigger.service.8 \
|
||||
modules.d/98systemd/dracut-pre-udev.service.8
|
||||
|
||||
DRACUT_INSTALL_HEADER = \
|
||||
install/hashmap.h \
|
||||
install/log.h \
|
||||
install/macro.h \
|
||||
install/util.h
|
||||
manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages)
|
||||
|
||||
dracut-install: $(DRACUT_INSTALL_SOURCE) $(DRACUT_INSTALL_HEADER)
|
||||
gcc -std=gnu99 -O2 -g -Wall -o dracut-install $(DRACUT_INSTALL_SOURCE)
|
||||
|
||||
.PHONY: install clean archive rpm testimage test all check AUTHORS doc dracut-version.sh
|
||||
|
||||
all: dracut-version.sh dracut-install
|
||||
|
||||
DRACUT_INSTALL_OBJECTS = \
|
||||
install/dracut-install.o \
|
||||
install/hashmap.o\
|
||||
install/log.o \
|
||||
install/util.o
|
||||
|
||||
# deps generated with gcc -MM
|
||||
install/dracut-install.o: install/dracut-install.c install/log.h install/macro.h \
|
||||
install/hashmap.h install/util.h
|
||||
install/hashmap.o: install/hashmap.c install/util.h install/macro.h install/log.h \
|
||||
install/hashmap.h
|
||||
install/log.o: install/log.c install/log.h install/macro.h install/util.h
|
||||
install/util.o: install/util.c install/util.h install/macro.h install/log.h
|
||||
|
||||
install/dracut-install: $(DRACUT_INSTALL_OBJECTS)
|
||||
|
||||
dracut-install: install/dracut-install
|
||||
ln -fs $< $@
|
||||
|
||||
indent:
|
||||
indent -i8 -nut -br -linux -l120 install/dracut-install.c
|
||||
|
||||
doc: $(manpages) dracut.html
|
||||
|
||||
ifneq ($(enable_documentation),no)
|
||||
all: doc
|
||||
endif
|
||||
|
||||
%: %.xml
|
||||
xsltproc -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
|
||||
|
||||
%.xml: %.asc
|
||||
asciidoc -d manpage -b docbook -o $@ $<
|
||||
|
||||
dracut.html: dracut.asc $(manpages)
|
||||
dracut.html: dracut.asc $(manpages) dracut.css
|
||||
asciidoc -a numbered -d book -b docbook -o dracut.xml dracut.asc
|
||||
xsltproc -o dracut.html --xinclude -nonet \
|
||||
--stringparam draft.mode yes \
|
||||
--stringparam html.stylesheet \
|
||||
http://docs.redhat.com/docs/en-US/Common_Content/css/default.css \
|
||||
--stringparam custom.css.source dracut.css \
|
||||
--stringparam generate.css.header 1 \
|
||||
http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl dracut.xml
|
||||
rm dracut.xml
|
||||
rm -f -- dracut.xml
|
||||
|
||||
install: doc dracut-version.sh
|
||||
install: dracut-version.sh
|
||||
mkdir -p $(DESTDIR)$(pkglibdir)
|
||||
mkdir -p $(DESTDIR)$(bindir)
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)
|
||||
@@ -67,78 +96,102 @@ install: doc dracut-version.sh
|
||||
install -m 0755 lsinitrd.sh $(DESTDIR)$(bindir)/lsinitrd
|
||||
install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d
|
||||
mkdir -p $(DESTDIR)$(pkglibdir)/dracut.conf.d
|
||||
install -m 0755 dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions.sh
|
||||
install -m 0755 dracut-version.sh $(DESTDIR)$(pkglibdir)/dracut-version.sh
|
||||
ln -s dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions
|
||||
ln -fs dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions
|
||||
install -m 0755 dracut-logger.sh $(DESTDIR)$(pkglibdir)/dracut-logger.sh
|
||||
install -m 0755 dracut-initramfs-restore.sh $(DESTDIR)$(pkglibdir)/dracut-initramfs-restore
|
||||
cp -arx modules.d $(DESTDIR)$(pkglibdir)
|
||||
install -m 0644 lsinitrd.1 $(DESTDIR)$(mandir)/man1/lsinitrd.1
|
||||
install -m 0644 mkinitrd.8 $(DESTDIR)$(mandir)/man8/mkinitrd.8
|
||||
install -m 0644 dracut.8 $(DESTDIR)$(mandir)/man8/dracut.8
|
||||
install -m 0644 dracut-catimages.8 \
|
||||
$(DESTDIR)$(mandir)/man8/dracut-catimages.8
|
||||
install -m 0644 dracut.conf.5 $(DESTDIR)$(mandir)/man5/dracut.conf.5
|
||||
install -m 0644 dracut.cmdline.7 $(DESTDIR)$(mandir)/man7/dracut.cmdline.7
|
||||
ln -s dracut.cmdline.7 $(DESTDIR)$(mandir)/man7/dracut.kernel.7
|
||||
ifneq ($(enable_documentation),no)
|
||||
for i in $(man1pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man1/$${i##*/}; done
|
||||
for i in $(man5pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man5/$${i##*/}; done
|
||||
for i in $(man7pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man7/$${i##*/}; done
|
||||
for i in $(man8pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man8/$${i##*/}; done
|
||||
ln -fs dracut.cmdline.7 $(DESTDIR)$(mandir)/man7/dracut.kernel.7
|
||||
endif
|
||||
if [ -n "$(systemdsystemunitdir)" ]; then \
|
||||
mkdir -p $(DESTDIR)$(systemdsystemunitdir); \
|
||||
install -m 0644 dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir); \
|
||||
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98systemd/dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown.service; \
|
||||
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants; \
|
||||
ln -s ../dracut-shutdown.service \
|
||||
$(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants/dracut-shutdown.service; \
|
||||
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/initrd.target.wants; \
|
||||
for i in \
|
||||
dracut-cmdline.service \
|
||||
dracut-initqueue.service \
|
||||
dracut-mount.service \
|
||||
dracut-pre-mount.service \
|
||||
dracut-pre-pivot.service \
|
||||
dracut-pre-trigger.service \
|
||||
dracut-pre-udev.service \
|
||||
; do \
|
||||
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98systemd/$$i $(DESTDIR)$(systemdsystemunitdir); \
|
||||
ln -s ../$$i \
|
||||
$(DESTDIR)$(systemdsystemunitdir)/initrd.target.wants/$$i; \
|
||||
done \
|
||||
fi
|
||||
install $(strip) -m 0755 dracut-install $(DESTDIR)$(pkglibdir)/dracut-install
|
||||
if [ -f install/dracut-install ]; then \
|
||||
install -m 0755 install/dracut-install $(DESTDIR)$(pkglibdir)/dracut-install; \
|
||||
fi
|
||||
mkdir -p $(DESTDIR)${prefix}/lib/kernel/install.d
|
||||
install -m 0755 50-dracut.install $(DESTDIR)${prefix}/lib/kernel/install.d/50-dracut.install
|
||||
install -m 0755 51-dracut-rescue.install $(DESTDIR)${prefix}/lib/kernel/install.d/51-dracut-rescue.install
|
||||
mkdir -p $(DESTDIR)${bashcompletiondir}
|
||||
install -m 0644 dracut-bash-completion.sh $(DESTDIR)${bashcompletiondir}/dracut
|
||||
install -m 0644 lsinitrd-bash-completion.sh $(DESTDIR)${bashcompletiondir}/lsinitrd
|
||||
|
||||
dracut-version.sh:
|
||||
@echo "DRACUT_VERSION=$(VERSION)-$(GITVERSION)" > dracut-version.sh
|
||||
@echo "DRACUT_VERSION=$(VERSION)$(GITVERSION)" > dracut-version.sh
|
||||
|
||||
clean:
|
||||
$(RM) *~
|
||||
$(RM) */*~
|
||||
$(RM) */*/*~
|
||||
$(RM) $(manpages:%=%.xml) dracut.xml
|
||||
$(RM) test-*.img
|
||||
$(RM) dracut-*.rpm dracut-*.tar.bz2
|
||||
$(RM) dracut-install
|
||||
$(RM) dracut-version.sh
|
||||
$(RM) dracut-install install/dracut-install $(DRACUT_INSTALL_OBJECTS)
|
||||
$(RM) $(manpages) dracut.html
|
||||
$(MAKE) -C test clean
|
||||
|
||||
archive: dracut-$(VERSION)-$(GITVERSION).tar.bz2
|
||||
|
||||
dist: dracut-$(VERSION).tar.bz2
|
||||
|
||||
dracut-$(VERSION).tar.bz2: doc
|
||||
dracut-$(VERSION).tar.bz2: doc syncheck
|
||||
@echo "DRACUT_VERSION=$(VERSION)" > dracut-version.sh
|
||||
git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ > dracut-$(VERSION).tar
|
||||
mkdir -p dracut-$(VERSION)
|
||||
cp $(manpages) dracut.html dracut-$(VERSION)
|
||||
tar -rf dracut-$(VERSION).tar dracut-$(VERSION)/*.[0-9] dracut-$(VERSION)/dracut.html
|
||||
rm -fr dracut-$(VERSION).tar.bz2 dracut-$(VERSION)
|
||||
for i in $(manpages) dracut.html dracut-version.sh; do [ "$${i%/*}" != "$$i" ] && mkdir -p "dracut-$(VERSION)/$${i%/*}"; cp "$$i" "dracut-$(VERSION)/$$i"; done
|
||||
tar --owner=root --group=root -rf dracut-$(VERSION).tar $$(find dracut-$(VERSION) -type f)
|
||||
rm -fr -- dracut-$(VERSION).tar.bz2 dracut-$(VERSION)
|
||||
bzip2 -9 dracut-$(VERSION).tar
|
||||
rm -f dracut-$(VERSION).tar
|
||||
rm -f -- dracut-$(VERSION).tar
|
||||
|
||||
rpm: dracut-$(VERSION).tar.bz2
|
||||
rpm: dracut-$(VERSION).tar.bz2 syncheck
|
||||
rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \
|
||||
cp dracut-$(VERSION).tar.bz2 "$$rpmbuild"; \
|
||||
LC_MESSAGES=C $$src/git2spec.pl $(VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \
|
||||
(cd "$$rpmbuild"; rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
|
||||
--define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \
|
||||
--define "_rpmdir $$PWD" -ba dracut.spec; ) && \
|
||||
( mv "$$rpmbuild"/$$(arch)/*.rpm .; mv "$$rpmbuild"/*.src.rpm .;rm -fr "$$rpmbuild"; ls *.rpm )
|
||||
( mv "$$rpmbuild"/$$(arch)/*.rpm .; mv "$$rpmbuild"/*.src.rpm .;rm -fr -- "$$rpmbuild"; ls *.rpm )
|
||||
|
||||
syncheck:
|
||||
@ret=0;for i in dracut-initramfs-restore.sh dracut-logger.sh \
|
||||
modules.d/99base/init.sh modules.d/*/*.sh; do \
|
||||
@ret=0;for i in dracut-initramfs-restore.sh modules.d/*/*.sh; do \
|
||||
[ "$${i##*/}" = "module-setup.sh" ] && continue; \
|
||||
read line < "$$i"; [ "$${line#*bash*}" != "$$line" ] && continue; \
|
||||
dash -n "$$i" ; ret=$$(($$ret+$$?)); \
|
||||
[ $$V ] && echo "posix syntax check: $$i"; bash --posix -n "$$i" ; ret=$$(($$ret+$$?)); \
|
||||
[ $$V ] && echo "checking for [[: $$i"; if grep -Fq '[[ ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains [["; fi \
|
||||
done;exit $$ret
|
||||
@ret=0;for i in *.sh mkinitrd-dracut.sh modules.d/*/*.sh \
|
||||
modules.d/*/module-setup.sh; do \
|
||||
bash -n "$$i" ; ret=$$(($$ret+$$?)); \
|
||||
[ $$V ] && echo "bash syntax check: $$i"; bash -n "$$i" ; ret=$$(($$ret+$$?)); \
|
||||
done;exit $$ret
|
||||
|
||||
check: all syncheck
|
||||
$(MAKE) -C test check
|
||||
check: all syncheck rpm
|
||||
@[ "$$EUID" == "0" ] || { echo "'check' must be run as root! Please use 'sudo'."; exit 1; }
|
||||
@$(MAKE) -C test check
|
||||
|
||||
testimage: all
|
||||
./dracut.sh -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
|
||||
@@ -151,8 +204,15 @@ testimages: all
|
||||
@echo wrote test-dracut.img
|
||||
|
||||
hostimage: all
|
||||
./dracut.sh -H -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
|
||||
./dracut.sh -H -l -f test-$(shell uname -r).img $(shell uname -r)
|
||||
@echo wrote test-$(shell uname -r).img
|
||||
|
||||
AUTHORS:
|
||||
git shortlog --numbered --summary -e |while read a rest; do echo $$rest;done > AUTHORS
|
||||
|
||||
dracut.html.sign: dracut-$(VERSION).tar.bz2
|
||||
gpg-sign-all dracut-$(VERSION).tar.bz2 dracut.html
|
||||
|
||||
upload: dracut.html.sign
|
||||
kup put dracut-$(VERSION).tar.bz2 dracut-$(VERSION).tar.sign /pub/linux/utils/boot/dracut/
|
||||
kup put dracut.html dracut.html.sign /pub/linux/utils/boot/dracut/
|
||||
|
266
NEWS
266
NEWS
@@ -1,3 +1,269 @@
|
||||
dracut-033
|
||||
==========
|
||||
- improved hostonly device recognition
|
||||
- improved hostonly module recognition
|
||||
- add dracut.css for dracut.html
|
||||
- do not install udev rules from /etc in generic mode
|
||||
- fixed LABEL= parsing for swap devices
|
||||
- fixed iBFT network setup
|
||||
- url-lib.sh: handle 0-size files with curl
|
||||
- dracut.asc: document debugging dracut on shutdown
|
||||
- if rd.md=0, use dmraid for imsm and ddf
|
||||
- skip empty dracut modules
|
||||
- removed caching of kernel cmdline
|
||||
- fixed iso-scan, if the loop device driver is a kernel module
|
||||
- bcache: support new blkid
|
||||
- fixed ifup udev rules
|
||||
- ifup with dhcp, if no "ip=" specified for the interface
|
||||
|
||||
dracut-032
|
||||
==========
|
||||
- add parameter --print-cmdline
|
||||
This prints the kernel command line parameters for the current disk
|
||||
layout.
|
||||
$ dracut --print-cmdline
|
||||
rd.luks.uuid=luks-e68c8906-6542-4a26-83c4-91b4dd9f0471
|
||||
rd.lvm.lv=debian/root rd.lvm.lv=debian/usr root=/dev/mapper/debian-root
|
||||
rootflags=rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered
|
||||
rootfstype=ext4
|
||||
- dracut.sh: add --persistent-policy option and persistent_policy conf option
|
||||
--persistent-policy <policy>:
|
||||
Use <policy> to address disks and partitions.
|
||||
<policy> can be any directory name found in /dev/disk.
|
||||
E.g. "by-uuid", "by-label"
|
||||
- dracut now creates the initramfs without udevadm
|
||||
that means the udev database does not have to populated
|
||||
and the initramfs can be built in a chroot with
|
||||
/sys /dev /proc mounted
|
||||
- renamed dracut_install() to inst_multiple() for consistent naming
|
||||
- if $libdirs is unset, fall back to ld.so.cache paths
|
||||
- always assemble /usr device in initramfs
|
||||
- bash module added (disable it, if you really want dash)
|
||||
- continue to boot, if the main loop times out, in systemd mode
|
||||
- removed inst*() shell pure versions, dracut-install binary is in charge now
|
||||
- fixed ifcfg file generation for vlan
|
||||
- do not include adjtime and localtime anymore
|
||||
- fixed generation of zfcp.conf of CMS setups
|
||||
- install vt102 terminfo
|
||||
dracut_install() is still there for backwards compat
|
||||
- do not strip files in FIPS mode
|
||||
- fixed iBFT interface configuration
|
||||
- fs-lib: install fsck and fsck.ext*
|
||||
- shutdown: fixed killall_proc_mountpoint()
|
||||
- network: also wait for ethernet interfaces to setup
|
||||
- fixed checking for FIPS mode
|
||||
|
||||
Contributions from:
|
||||
Harald Hoyer
|
||||
WANG Chao
|
||||
Baoquan He
|
||||
Daniel Schaal
|
||||
Dave Young
|
||||
James Lee
|
||||
Radek Vykydal
|
||||
|
||||
|
||||
dracut-031
|
||||
==========
|
||||
- do not include the resume dracut module in hostonly mode,
|
||||
if no swap is present
|
||||
- don't warn twice about omitted modules
|
||||
- use systemd-cat for logging on systemd systems, if logfile is unset
|
||||
- fixed PARTUUID parsing
|
||||
- support kernel module signing keys
|
||||
- do not install the usrmount dracut module in hostonly mode,
|
||||
if /sbin/init does not live in /usr
|
||||
- add debian udev rule files
|
||||
- add support for bcache
|
||||
- network: handle bootif style interfaces
|
||||
e.g. ip=77-77-6f-6f-64-73:dhcp
|
||||
- add support for kmod static devnodes
|
||||
- add vlan support for iBFT
|
||||
|
||||
Contributions from:
|
||||
Harald Hoyer
|
||||
Amadeusz Żołnowski
|
||||
Brandon Philips
|
||||
Colin Walters
|
||||
James Lee
|
||||
Kyle McMartin
|
||||
Peter Jones
|
||||
|
||||
dracut-030
|
||||
==========
|
||||
- support new persistent network interface names
|
||||
- fix findmnt calls, prevents hang on stale NFS mounts
|
||||
- add systemd.slice and slice.target units
|
||||
- major shell cleanup
|
||||
- support root=PARTLABEL= and root=PARTUUID=
|
||||
- terminfo: only install l/linux v/vt100 and v/vt220
|
||||
- unset all LC_* and LANG, 10% faster
|
||||
- fixed dependency loop for dracut-cmdline.service
|
||||
- do not wait_for_dev for the root devices
|
||||
- do not wait_for_dev for devices, if dracut-initqueue is not needed
|
||||
- support early microcode loading with --early-microcode
|
||||
- dmraid, let dmraid setup its own partitions
|
||||
- sosreport renamed to rdsosreport
|
||||
|
||||
Contributions from:
|
||||
Harald Hoyer
|
||||
Konrad Rzeszutek Wilk
|
||||
WANG Chao
|
||||
|
||||
dracut-029
|
||||
==========
|
||||
- wait for IPv6 autoconfiguration
|
||||
- i18n: make the default font configurable
|
||||
To set the default font for your distribution, add
|
||||
i18n_default_font="latarcyrheb-sun16"
|
||||
to your /lib/dracut/dracut.conf.d/01-dist.conf distribution config.
|
||||
- proper handle "rd.break" in systemd mode before switch-root
|
||||
- systemd: make unit files symlinks
|
||||
- build without dash requirement
|
||||
- add dracut-shutdown.service.8 manpage
|
||||
- handle MACs for "ip="
|
||||
"ip=77-77-6f-6f-64-73:dhcp"
|
||||
- don't explode when mixing BOOTIF and ip=
|
||||
- 90lvm/module-setup.sh: redirect error message of lvs to /dev/null
|
||||
|
||||
Contributions from:
|
||||
Harald Hoyer
|
||||
Will Woods
|
||||
Baoquan He
|
||||
|
||||
dracut-028
|
||||
==========
|
||||
- full integration of crypto devs in systemd logic
|
||||
- support for bridge over team and vlan tagged team
|
||||
- support multiple bonding interfaces
|
||||
- new kernel command line param "rd.action_on_fail"
|
||||
to control the emergency action
|
||||
- support for bridge over a vlan tagged interface
|
||||
- support for "iso-scan/filename" kernel parameter
|
||||
- lsinitrd got some love and does not use "file" anymore
|
||||
- fixed issue with noexec mounted tmp dirs
|
||||
- FIPS mode fixed
|
||||
- dracut_install got some love
|
||||
- fixed some /usr mounting problems
|
||||
- ifcfg dracut module got some love and fixes
|
||||
- default installed font is now latarcyrheb-sun16
|
||||
- new parameters rd.live.dir and rd.live.squashimg
|
||||
- lvm: add tools for thin provisioning
|
||||
- also install non-hwcap libs
|
||||
- setup correct system time and time zone in initrd
|
||||
- s390: fixed cms setup
|
||||
- add systemd-udevd persistent network interface naming
|
||||
|
||||
Contributions from:
|
||||
Harald Hoyer
|
||||
Kamil Rytarowski
|
||||
WANG Chao
|
||||
Baoquan He
|
||||
Adam Williamson
|
||||
Colin Guthrie
|
||||
Dan Horák
|
||||
Dave Young
|
||||
Dennis Gilmore
|
||||
Dennis Schridde
|
||||
|
||||
dracut-027
|
||||
==========
|
||||
- dracut now has bash-completion
|
||||
- require bash version 4
|
||||
- systemd module now requires systemd >= 199
|
||||
- dracut makes use of native systemd initrd units
|
||||
- added hooks for new-kernel-pkg and kernel-install
|
||||
- hostonly is now default for fedora
|
||||
- comply with the BootLoaderSpec paths
|
||||
http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec
|
||||
- added rescue module
|
||||
- host_fs_types is now a hashmap
|
||||
- new dracut argument "--regenerate-all"
|
||||
- new dracut argument "--noimageifnotneeded"
|
||||
- new man page dracut.bootup
|
||||
- install all host filesystem drivers
|
||||
- use -D_FILE_OFFSET_BITS=64 to build dracut-install
|
||||
|
||||
dracut-026
|
||||
==========
|
||||
- introduce /usr/lib/dracut/dracut.conf.d/ drop-in directory
|
||||
|
||||
/usr/lib/dracut/dracut.conf.d/*.conf can be overwritten by the same
|
||||
filenames in /etc/dracut.conf.d.
|
||||
|
||||
Packages should use /usr/lib/dracut/dracut.conf.d rather than
|
||||
/etc/dracut.conf.d for drop-in configuration files.
|
||||
|
||||
/etc/dracut.conf and /etc/dracut.conf.d belong to the system administrator.
|
||||
|
||||
- uses systemd-198 native initrd units
|
||||
- totally rely on the fstab-generator in systemd mode for block devices
|
||||
- dracut systemd now uses dracut.target rather than basic.target
|
||||
- dracut systemd services optimize themselves away
|
||||
- fixed hostonly parameter generation
|
||||
- turn off curl globbing (fixes IPv6)
|
||||
- modify the udev rules on install and not runtime time
|
||||
- enable initramfs building without kernel modules (fixed regression)
|
||||
- in the initqueue/timeout,
|
||||
reset the main loop counter, as we see new udev events or initqueue/work
|
||||
- fixed udev rule installation
|
||||
|
||||
dracut-025
|
||||
==========
|
||||
- do not strip signed kernel modules
|
||||
- add sosreport script and generate /run/initramfs/sosreport.txt
|
||||
- make short uuid specification for allow-discards work
|
||||
- turn off RateLimit for the systemd journal
|
||||
- fixed MAC address assignment
|
||||
- add systemd checkisomd5 service
|
||||
- splitout drm kernel modules from plymouth module
|
||||
- add 'swapoff' to initramfs to fix shutdown/reboot
|
||||
- add team device support
|
||||
- add pre-shutdown hook
|
||||
- kill all processes in shutdown and report remaining ones
|
||||
- "--device" changed to "--add-device" and "add_device=" added for conf files
|
||||
- add memory usage trace to different hook points
|
||||
- cope with optional field #7 in /proc/self/mountinfo
|
||||
- lots of small bugfixes
|
||||
|
||||
dracut-024
|
||||
==========
|
||||
- new dracut option "--device"
|
||||
- new dracut kernel command line options "rd.auto"
|
||||
- new dracut kernel command line options "rd.noverifyssl"
|
||||
- new dracut option "--kernel-cmdline" and "kernel_cmdline" option for default parameters
|
||||
- fixes for systemd and crypto
|
||||
- fix for kexec in shutdown, if not included in initramfs
|
||||
- create the initramfs non-world readable
|
||||
- prelink/preunlink in the initramfs
|
||||
- strip binaries in the initramfs by default now
|
||||
- various FIPS fixes
|
||||
- various dracut-install fixes
|
||||
|
||||
dracut-023
|
||||
==========
|
||||
- resume from hibernate fixes
|
||||
- -N option for --no-hostonly
|
||||
- support for systemd crypto handling
|
||||
- new dracut module "crypt-loop"
|
||||
- deprecate the old kernel command line options
|
||||
- more documentation
|
||||
- honor CFLAGS for dracut-install build
|
||||
- multipath fixes
|
||||
- / is mounted according to rootflags parameter but forced ro at first.
|
||||
Later it is remounted according to /etc/fstab + rootflags parameter
|
||||
and "ro"/"rw".
|
||||
- support for xfs / reiserfs separate journal device
|
||||
- new "ro_mnt" option to force ro mount of / and /usr
|
||||
- root on cifs support
|
||||
- dracut-install: fixed issue for /var/tmp containing a symlink
|
||||
- only lazy resolve with ldd, if the /var/tmp partition is not mounted with "noexec"
|
||||
- i18n: fixed inclusion of "include" keymaps
|
||||
|
||||
dracut-022
|
||||
==========
|
||||
- fixed host-only kernel module bug
|
||||
|
||||
dracut-021
|
||||
==========
|
||||
- fixed systemd in the initramfs (requires systemd >= 187)
|
||||
|
4
README
4
README
@@ -1,6 +1,6 @@
|
||||
Dracut
|
||||
dracut
|
||||
------
|
||||
Dracut is a new initramfs infrastructure.
|
||||
dracut is a new initramfs infrastructure.
|
||||
|
||||
Information about the initial goals and aims can be found at
|
||||
https://fedoraproject.org/wiki/Initrdrewrite
|
||||
|
@@ -1,5 +1,5 @@
|
||||
Most of the functionality that dracut implements are actually implemented
|
||||
by dracut modules. Dracut modules live in modules.d, and have the following
|
||||
by dracut modules. dracut modules live in modules.d, and have the following
|
||||
structure:
|
||||
|
||||
dracut_install_dir/modules.d/
|
||||
@@ -38,7 +38,7 @@ installkernel():
|
||||
|
||||
|
||||
check():
|
||||
Dracut calls this function to check and see if a module can be installed
|
||||
dracut calls this function to check and see if a module can be installed
|
||||
on the initrd.
|
||||
|
||||
When called without options, check should check to make sure that
|
||||
|
@@ -7,5 +7,24 @@ cryptsetup
|
||||
nfs-utils
|
||||
netbsd-iscsi
|
||||
nbd
|
||||
dhcp
|
||||
dhcp (dhcp-server on openSUSE)
|
||||
iscsi-initiator-utils
|
||||
TEST-04-FULL-SYSTEMD: systemd >= 187
|
||||
|
||||
How to run the testsuite:
|
||||
|
||||
$ sudo make clean check
|
||||
|
||||
in verbose mode:
|
||||
$ sudo make V=1 clean check
|
||||
|
||||
only specific test:
|
||||
$ sudo make TESTS="01 20 40" clean check
|
||||
only runs the 01, 20 and 40 tests.
|
||||
|
||||
debug a specific test case:
|
||||
$ cd TEST-01-BASIC
|
||||
$ sudo make clean setup run
|
||||
... change some kernel parameters ...
|
||||
$ sudo make run
|
||||
to run the test without doing the setup
|
||||
|
15
TODO
15
TODO
@@ -6,23 +6,32 @@ Items are ordered in priority.
|
||||
|
||||
INITRAMFS TODO
|
||||
|
||||
- use info and warn prefix
|
||||
- generate systemd unit dracut-initramfs-restore in /run/systemd dynamically
|
||||
- put "root=" parsing hooks in separate hook dir
|
||||
- call "root=" parsing hooks after getting new rootpath from dhcp
|
||||
- put mount hook in main initqueue loop / careful about resume!
|
||||
- the hard-coded list of udev rules that we care about is kind of lame.
|
||||
- panic fallback
|
||||
- bridging/bonding without "netroot=" https://bugzilla.redhat.com/show_bug.cgi?id=822750
|
||||
- progress indication for fsck https://bugzilla.redhat.com/show_bug.cgi?id=827118
|
||||
- domain, searchdomain https://bugzilla.redhat.com/show_bug.cgi?id=840778
|
||||
- disable write-ifcfg https://bugzilla.redhat.com/show_bug.cgi?id=840784
|
||||
- check for /var to be mounted in convertfs https://bugzilla.redhat.com/show_bug.cgi?id=848172
|
||||
- probably fix "--include" https://bugzilla.redhat.com/show_bug.cgi?id=849338
|
||||
|
||||
GENERATOR TODO
|
||||
|
||||
- remove wait for swap devs, if no "resume=" is given on the kernel command line
|
||||
- add presets (predefined set of modules)
|
||||
- add interpreter/plugin-scripts to be sourced at the beginning or end (can use dracut-functions)
|
||||
- provide "installkernel" and "new-kernel-pkg"
|
||||
- add mechanism for module specific command line options
|
||||
- pkg-config integration, to make it easy for other packages to use us.
|
||||
- add recovery image creator (mkrecovery)
|
||||
- default module specification could use some work
|
||||
- udev rule copying, as mentioned above, is a bit too hard-coded
|
||||
|
||||
- dracut-install parse LD_SHOW_AUXV="" AT_PLATFORM for lib install
|
||||
|
||||
CODE TODO
|
||||
|
||||
- document more functions
|
||||
@@ -31,5 +40,5 @@ CODE TODO
|
||||
Future Enhancement Requests
|
||||
|
||||
- run ssh server to enter crypto password or perform debugging (supported by debian)
|
||||
- https://bugzilla.redhat.com/show_bug.cgi?id=524727 - Dracut + encrypted root + networking
|
||||
- https://bugzilla.redhat.com/show_bug.cgi?id=524727 - dracut + encrypted root + networking
|
||||
|
||||
|
78
configure
vendored
Executable file
78
configure
vendored
Executable file
@@ -0,0 +1,78 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# We don't support srcdir != builddir
|
||||
echo \#buildapi-variable-no-builddir >/dev/null
|
||||
|
||||
prefix=/usr
|
||||
|
||||
enable_documentation=yes
|
||||
|
||||
# Little helper function for reading args from the commandline.
|
||||
# it automatically handles -a b and -a=b variants, and returns 1 if
|
||||
# we need to shift $3.
|
||||
read_arg() {
|
||||
# $1 = arg name
|
||||
# $2 = arg value
|
||||
# $3 = arg parameter
|
||||
local rematch='^[^=]*=(.*)$'
|
||||
if [[ $2 =~ $rematch ]]; then
|
||||
read "$1" <<< "${BASH_REMATCH[1]}"
|
||||
else
|
||||
read "$1" <<< "$3"
|
||||
# There is no way to shift our callers args, so
|
||||
# return 1 to indicate they should do it instead.
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
while (($# > 0)); do
|
||||
case "${1%%=*}" in
|
||||
--prefix) read_arg prefix "$@" || shift;;
|
||||
--libdir) read_arg libdir "$@" || shift;;
|
||||
--datadir) read_arg datadir "$@" || shift;;
|
||||
--sysconfdir) read_arg sysconfdir "$@" || shift;;
|
||||
--sbindir) read_arg sbindir "$@" || shift;;
|
||||
--mandir) read_arg mandir "$@" || shift;;
|
||||
--disable-documentation) enable_documentation=no;;
|
||||
--program-prefix) read_arg programprefix "$@" || shift;;
|
||||
--exec-prefix) read_arg execprefix "$@" || shift;;
|
||||
--bindir) read_arg bindir "$@" || shift;;
|
||||
--includedir) read_arg includedir "$@" || shift;;
|
||||
--libexecdir) read_arg libexecdir "$@" || shift;;
|
||||
--localstatedir) read_arg localstatedir "$@" || shift;;
|
||||
--sharedstatedir) read_arg sharedstatedir "$@" || shift;;
|
||||
--infodir) read_arg infodir "$@" || shift;;
|
||||
--systemdsystemunitdir) read_arg systemdsystemunitdir "$@" || shift;;
|
||||
--bashcompletiondir) read_arg bashcompletiondir "$@" || shift;;
|
||||
*) echo "Ignoring unknown option '$1'";;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
cat > Makefile.inc.$$ <<EOF
|
||||
prefix ?= ${prefix}
|
||||
libdir ?= ${libdir:-${prefix}/lib}
|
||||
datadir ?= ${datadir:-${prefix}/share}
|
||||
sysconfdir ?= ${sysconfdir:-${prefix}/etc}
|
||||
sbindir ?= ${sbindir:-${prefix}/sbin}
|
||||
mandir ?= ${mandir:-${prefix}/share/man}
|
||||
enable_documentation ?= ${enable_documentation:-yes}
|
||||
bindir ?= ${bindir:-${prefix}/bin}
|
||||
EOF
|
||||
|
||||
{
|
||||
[[ $programprefix ]] && echo "programprefix ?= ${programprefix}"
|
||||
[[ $execprefix ]] && echo "execprefix ?= ${execprefix}"
|
||||
[[ $includedir ]] && echo "includedir ?= ${includedir}"
|
||||
[[ $libexecdir ]] && echo "libexecdir ?= ${libexecdir}"
|
||||
[[ $localstatedir ]] && echo "localstatedir ?= ${localstatedir}"
|
||||
[[ $sharedstatedir ]] && echo "sharedstatedir ?= ${sharedstatedir}"
|
||||
[[ $infodir ]] && echo "infodir ?= ${infodir}"
|
||||
[[ $systemdsystemunitdir ]] && echo "systemdsystemunitdir ?= ${systemdsystemunitdir}"
|
||||
[[ $bashcompletiondir ]] && echo "bashcompletiondir ?= ${bashcompletiondir}"
|
||||
} >> Makefile.inc.$$
|
||||
|
||||
mv Makefile.inc.$$ Makefile.inc
|
79
dracut-bash-completion.sh
Normal file
79
dracut-bash-completion.sh
Normal file
@@ -0,0 +1,79 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Copyright 2013 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
__contains_word () {
|
||||
local word=$1; shift
|
||||
for w in $*; do [[ $w = $word ]] && return 0; done
|
||||
return 1
|
||||
}
|
||||
|
||||
_dracut() {
|
||||
local field_vals= cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
local -A OPTS=(
|
||||
[STANDALONE]='-f -v -q -l -H -h -M -N
|
||||
--ro-mnt --force --kernel-only --no-kernel --strip --nostrip
|
||||
--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
|
||||
--printsize --regenerate-all --noimageifnotneeded --early-microcode
|
||||
--no-early-microcode --print-cmdline'
|
||||
|
||||
[ARG]='-a -m -o -d -I -k -c -L --kver --add --force-add --add-drivers
|
||||
--omit-drivers --modules --omit --drivers --filesystems --install
|
||||
--fwdir --libdirs --fscks --add-fstab --mount --device --nofscks
|
||||
--kmoddir --conf --confdir --tmpdir --stdlog --compress --prefix
|
||||
--kernel-cmdline --sshkey --persistent-policy'
|
||||
)
|
||||
|
||||
if __contains_word "$prev" ${OPTS[ARG]}; then
|
||||
case $prev in
|
||||
--kmoddir|-k|--fwdir|--confdir|--tmpdir)
|
||||
comps=$(compgen -d -- "$cur")
|
||||
compopt -o filenames
|
||||
;;
|
||||
-c|--conf|--sshkey|--add-fstab|--add-device|-I|--install)
|
||||
comps=$(compgen -f -- "$cur")
|
||||
compopt -o filenames
|
||||
;;
|
||||
-a|-m|-o|--add|--modules|--omit)
|
||||
comps=$(dracut --list-modules 2>/dev/null)
|
||||
;;
|
||||
--persistent-policy)
|
||||
comps=$(cd /dev/disk/; echo *)
|
||||
;;
|
||||
--kver)
|
||||
comps=$(cd /lib/modules; echo [0-9]*)
|
||||
;;
|
||||
*)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ $cur = -* ]]; then
|
||||
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
complete -F _dracut dracut
|
@@ -118,11 +118,11 @@ fi
|
||||
images+=($@)
|
||||
|
||||
dinfo "Using base image $baseimage"
|
||||
cat "$baseimage" > "$outfile"
|
||||
cat -- "$baseimage" > "$outfile"
|
||||
|
||||
for i in "${images[@]}"; do
|
||||
dinfo "Appending $i"
|
||||
cat "$i" >> "$outfile"
|
||||
cat -- "$i" >> "$outfile"
|
||||
done
|
||||
|
||||
dinfo "Created $outfile"
|
||||
|
1195
dracut-functions.sh
1195
dracut-functions.sh
File diff suppressed because it is too large
Load Diff
@@ -1,18 +1,29 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
set -e
|
||||
|
||||
KERNEL_VERSION="$(uname -r)"
|
||||
|
||||
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||||
|
||||
if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
|
||||
IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
|
||||
fi
|
||||
[[ -f $IMG ]] || IMG="/boot/initramfs-${KERNEL_VERSION}.img"
|
||||
|
||||
cd /run/initramfs
|
||||
IMG="/boot/initramfs-$(uname -r).img"
|
||||
|
||||
[ -f .need_shutdown -a -f "$IMG" ] || exit 1
|
||||
if zcat "$IMG" | cpio -id >/dev/null 2>&1; then
|
||||
rm .need_shutdown
|
||||
elif xzcat "$IMG" | cpio -id >/dev/null 2>&1; then
|
||||
rm .need_shutdown
|
||||
if zcat "$IMG" | cpio -id --quiet >/dev/null; then
|
||||
rm -f -- .need_shutdown
|
||||
elif xzcat "$IMG" | cpio -id --quiet >/dev/null; then
|
||||
rm -f -- .need_shutdown
|
||||
else
|
||||
# something failed, so we clean up
|
||||
rm -f /run/initramfs/shutdown
|
||||
echo "Unpacking of $IMG to /run/initramfs failed" >&2
|
||||
rm -f -- /run/initramfs/shutdown
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 et filetype=sh
|
||||
#
|
||||
@@ -23,7 +23,7 @@
|
||||
__DRACUT_LOGGER__=1
|
||||
|
||||
|
||||
## @brief Logging facility module for Dracut both at build- and boot-time.
|
||||
## @brief Logging facility module for dracut both at build- and boot-time.
|
||||
#
|
||||
# @section intro Introduction
|
||||
#
|
||||
@@ -89,7 +89,7 @@ __DRACUT_LOGGER__=1
|
||||
# @see dlog_init()
|
||||
|
||||
|
||||
## @brief Initializes Dracut Logger.
|
||||
## @brief Initializes dracut Logger.
|
||||
#
|
||||
# @retval 1 if something has gone wrong
|
||||
# @retval 0 on success.
|
||||
@@ -116,31 +116,42 @@ dlog_init() {
|
||||
|
||||
if [ -z "$fileloglvl" ]; then
|
||||
[ -w "$logfile" ] && fileloglvl=4 || fileloglvl=0
|
||||
elif (( $fileloglvl >= 0 )); then
|
||||
__oldumask=$(umask)
|
||||
umask 0377
|
||||
! [ -e "$logfile" ] && >"$logfile"
|
||||
umask $__oldumask
|
||||
if [ -w "$logfile" -a -f "$logfile" ]; then
|
||||
elif (( $fileloglvl > 0 )); then
|
||||
if [[ $logfile ]]; then
|
||||
__oldumask=$(umask)
|
||||
umask 0377
|
||||
! [ -e "$logfile" ] && >"$logfile"
|
||||
umask $__oldumask
|
||||
if [ -w "$logfile" -a -f "$logfile" ]; then
|
||||
# Mark new run in the log file
|
||||
echo >>"$logfile"
|
||||
if command -v date >/dev/null; then
|
||||
echo "=== $(date) ===" >>"$logfile"
|
||||
echo >>"$logfile"
|
||||
if command -v date >/dev/null; then
|
||||
echo "=== $(date) ===" >>"$logfile"
|
||||
else
|
||||
echo "===============================================" >>"$logfile"
|
||||
fi
|
||||
echo >>"$logfile"
|
||||
else
|
||||
echo "===============================================" >>"$logfile"
|
||||
fi
|
||||
echo >>"$logfile"
|
||||
else
|
||||
# We cannot log to file, so turn this facility off.
|
||||
fileloglvl=0
|
||||
ret=1
|
||||
errmsg="'$logfile' is not a writable file"
|
||||
fileloglvl=0
|
||||
ret=1
|
||||
errmsg="'$logfile' is not a writable file"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if (( $sysloglvl >= 0 )); then
|
||||
if ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null
|
||||
then
|
||||
if (( $sysloglvl > 0 )); then
|
||||
if [[ -d /run/systemd/journal ]] \
|
||||
&& type -P systemd-cat &>/dev/null \
|
||||
&& (( $UID == 0 )) \
|
||||
&& systemctl is-active systemd-journald.socket &>/dev/null; then
|
||||
readonly _dlogdir="$(mktemp --tmpdir="$TMPDIR/" -d -t dracut-log.XXXXXX)"
|
||||
readonly _systemdcatfile="$_dlogdir/systemd-cat"
|
||||
mkfifo "$_systemdcatfile"
|
||||
readonly _dlogfd=15
|
||||
systemd-cat -t 'dracut' <"$_systemdcatfile" &
|
||||
exec 15>"$_systemdcatfile"
|
||||
elif ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null; then
|
||||
# We cannot log to syslog, so turn this facility off.
|
||||
sysloglvl=0
|
||||
ret=1
|
||||
@@ -148,7 +159,7 @@ dlog_init() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if (($sysloglvl >= 0)) || (($kmsgloglvl >= 0 )); then
|
||||
if (($sysloglvl > 0)) || (($kmsgloglvl > 0 )); then
|
||||
if [ -n "$dracutbasedir" ]; then
|
||||
readonly syslogfacility=user
|
||||
else
|
||||
@@ -165,34 +176,34 @@ dlog_init() {
|
||||
export maxloglvl
|
||||
|
||||
|
||||
if (($stdloglvl < 6)) && (($kmsgloglvl < 6)) && (($fileloglvl < 6)); then
|
||||
if (($stdloglvl < 6)) && (($kmsgloglvl < 6)) && (($fileloglvl < 6)) && (($sysloglvl < 6)); then
|
||||
unset dtrace
|
||||
dtrace() { :; };
|
||||
fi
|
||||
|
||||
if (($stdloglvl < 5)) && (($kmsgloglvl < 5)) && (($fileloglvl < 5)); then
|
||||
if (($stdloglvl < 5)) && (($kmsgloglvl < 5)) && (($fileloglvl < 5)) && (($sysloglvl < 5)); then
|
||||
unset ddebug
|
||||
ddebug() { :; };
|
||||
fi
|
||||
|
||||
if (($stdloglvl < 4)) && (($kmsgloglvl < 4)) && (($fileloglvl < 4)); then
|
||||
if (($stdloglvl < 4)) && (($kmsgloglvl < 4)) && (($fileloglvl < 4)) && (($sysloglvl < 4)); then
|
||||
unset dinfo
|
||||
dinfo() { :; };
|
||||
fi
|
||||
|
||||
if (($stdloglvl < 3)) && (($kmsgloglvl < 3)) && (($fileloglvl < 3)); then
|
||||
if (($stdloglvl < 3)) && (($kmsgloglvl < 3)) && (($fileloglvl < 3)) && (($sysloglvl < 3)); then
|
||||
unset dwarn
|
||||
dwarn() { :; };
|
||||
unset dwarning
|
||||
dwarning() { :; };
|
||||
fi
|
||||
|
||||
if (($stdloglvl < 2)) && (($kmsgloglvl < 2)) && (($fileloglvl < 2)); then
|
||||
if (($stdloglvl < 2)) && (($kmsgloglvl < 2)) && (($fileloglvl < 2)) && (($sysloglvl < 2)); then
|
||||
unset derror
|
||||
derror() { :; };
|
||||
fi
|
||||
|
||||
if (($stdloglvl < 1)) && (($kmsgloglvl < 1)) && (($fileloglvl < 1)); then
|
||||
if (($stdloglvl < 1)) && (($kmsgloglvl < 1)) && (($fileloglvl < 1)) && (($sysloglvl < 1)); then
|
||||
unset dfatal
|
||||
dfatal() { :; };
|
||||
fi
|
||||
@@ -306,15 +317,23 @@ _dlvl2syslvl() {
|
||||
_do_dlog() {
|
||||
local lvl="$1"; shift
|
||||
local lvlc=$(_lvl2char "$lvl") || return 0
|
||||
local msg="$lvlc: $*"
|
||||
local msg="$*"
|
||||
local lmsg="$lvlc: $*"
|
||||
|
||||
(( $lvl <= $stdloglvl )) && echo "$msg" >&2
|
||||
|
||||
if (( $lvl <= $sysloglvl )); then
|
||||
logger -t "dracut[$$]" -p $(_lvl2syspri $lvl) "$msg"
|
||||
if [[ "$_dlogfd" ]]; then
|
||||
echo "<$(_dlvl2syslvl $lvl)>$msg" >&$_dlogfd
|
||||
else
|
||||
logger -t "dracut[$$]" -p $(_lvl2syspri $lvl) -- "$msg"
|
||||
fi
|
||||
fi
|
||||
|
||||
if (( $lvl <= $fileloglvl )) && [[ -w "$logfile" ]] && [[ -f "$logfile" ]]; then
|
||||
echo "$msg" >>"$logfile"
|
||||
echo "$lmsg" >>"$logfile"
|
||||
fi
|
||||
|
||||
(( $lvl <= $kmsgloglvl )) && \
|
||||
echo "<$(_dlvl2syslvl $lvl)>dracut[$$] $msg" >/dev/kmsg
|
||||
}
|
||||
|
129
dracut.8.asc
129
dracut.8.asc
@@ -14,6 +14,12 @@ SYNOPSIS
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
|
||||
Create an initramfs <image> for the kernel with the version <kernel version>.
|
||||
If <kernel version> is omitted, then the version of the actual running
|
||||
kernel is used. If <image> is omitted or empty, then the default location
|
||||
/boot/initramfs-<kernel version>.img is used.
|
||||
|
||||
dracut creates an initial image used by the kernel for preloading the block
|
||||
device modules (such as IDE, SCSI or RAID) which are needed to access the root
|
||||
filesystem, mounting the root filesystem and booting into the real system.
|
||||
@@ -22,7 +28,62 @@ At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it
|
||||
as initial root file system. All finding of the root device happens in this
|
||||
early userspace.
|
||||
|
||||
For a complete list of kernel command line options see *dracut.cmdline*(7)
|
||||
For a complete list of kernel command line options see *dracut.cmdline*(7).
|
||||
|
||||
If you are dropped to an emergency shell, while booting your initramfs,
|
||||
the file _/run/initramfs/rdsosreport.txt_ is created, which can be safed to a
|
||||
(to be mounted by hand) partition (usually /boot) or a USB stick.
|
||||
Additional debugging info can be produced by adding **rd.debug** to the kernel command line.
|
||||
_/run/initramfs/rdsosreport.txt_ contains all logs and the output of some tools.
|
||||
It should be attached to any report about dracut problems.
|
||||
|
||||
EXAMPLE
|
||||
-------
|
||||
|
||||
To create a initramfs image, the most simple command is:
|
||||
----
|
||||
# dracut
|
||||
----
|
||||
|
||||
This will generate a general purpose initramfs image, with all possible
|
||||
functionality resulting of the combination of the installed dracut modules and
|
||||
system tools. The image is /boot/initramfs-_++<kernel version>++_.img and
|
||||
contains the kernel modules of the currently active kernel with version
|
||||
_++<kernel version>++_.
|
||||
|
||||
If the initramfs image already exists, dracut will display an error message, and
|
||||
to overwrite the existing image, you have to use the --force option.
|
||||
----
|
||||
# dracut --force
|
||||
----
|
||||
|
||||
If you want to specify another filename for the resulting image you would issue
|
||||
a command like:
|
||||
----
|
||||
# dracut foobar.img
|
||||
----
|
||||
|
||||
To generate an image for a specific kernel version, the command would be:
|
||||
----
|
||||
# dracut foobar.img 2.6.40-1.rc5.f20
|
||||
----
|
||||
|
||||
A shortcut to generate the image at the default location for a specific kernel
|
||||
version is:
|
||||
----
|
||||
# dracut --kver 2.6.40-1.rc5.f20
|
||||
----
|
||||
|
||||
If you want to create lighter, smaller initramfs images, you may want to specify
|
||||
the --hostonly or -H option. Using this option, the resulting image will
|
||||
contain only those dracut modules, kernel modules and filesystems, which are
|
||||
needed to boot this specific machine. This has the drawback, that you can't put
|
||||
the disk on another controller or machine, and that you can't switch to another
|
||||
root filesystem, without recreating the initramfs image. The usage of the
|
||||
--hostonly option is only for experts and you will have to keep the broken
|
||||
pieces. At least keep a copy of a general purpose image (and corresponding
|
||||
kernel) as a fallback to rescue your system.
|
||||
|
||||
|
||||
OPTIONS
|
||||
-------
|
||||
@@ -154,12 +215,25 @@ example:
|
||||
specify additional directories, where to look for firmwares. This parameter
|
||||
can be specified multiple times.
|
||||
|
||||
**--kernel-cmdline <parameters>**::
|
||||
specify default kernel command line parameters
|
||||
|
||||
|
||||
**--kernel-only**::
|
||||
only install kernel drivers and firmware files
|
||||
|
||||
**--no-kernel**::
|
||||
do not install kernel drivers and firmware files
|
||||
|
||||
**--early-microcode**::
|
||||
Combine early microcode with ramdisk
|
||||
|
||||
**--no-early-microcode**::
|
||||
Do not combine early microcode with ramdisk
|
||||
|
||||
**--print-cmdline**::
|
||||
print the kernel command line for the current disk layout
|
||||
|
||||
**--mdadmconf**::
|
||||
include local _/etc/mdadm.conf_
|
||||
|
||||
@@ -190,10 +264,10 @@ example:
|
||||
inhibit installation of any fsck tools
|
||||
|
||||
**--strip**::
|
||||
strip binaries in the initramfs
|
||||
strip binaries in the initramfs (default)
|
||||
|
||||
**--nostrip**::
|
||||
do not strip binaries in the initramfs (default)
|
||||
do not strip binaries in the initramfs
|
||||
|
||||
**--hardlink**::
|
||||
hardlink files in the initramfs (default)
|
||||
@@ -254,9 +328,14 @@ If chrooted to another root other than the real root device, use "--fstab" and
|
||||
provide a valid _/etc/fstab_.
|
||||
====
|
||||
|
||||
**--no-hostonly**::
|
||||
**-N, --no-hostonly**::
|
||||
Disable Host-Only mode
|
||||
|
||||
**--persistent-policy** _<policy>_::
|
||||
Use _<policy>_ to address disks and partitions.
|
||||
_<policy>_ can be any directory name found in /dev/disk.
|
||||
E.g. "by-uuid", "by-label"
|
||||
|
||||
**--fstab**::
|
||||
Use _/etc/fstab_ instead of _/proc/self/mountinfo_.
|
||||
|
||||
@@ -267,6 +346,12 @@ provide a valid _/etc/fstab_.
|
||||
Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem
|
||||
options>_ in the initramfs
|
||||
|
||||
**--add-device** _<device>_ ::
|
||||
Bring up _<device>_ in initramfs, _<device>_ should be the device name.
|
||||
This can be useful in hostonly mode for resume support when your swap is on
|
||||
LVM or an encrypted partition.
|
||||
[NB --device can be used for compatibility with earlier releases]
|
||||
|
||||
**-i, --include** _<SOURCE>_ _<TARGET>_::
|
||||
include the files in the SOURCE directory into the
|
||||
TARGET directory in the final initramfs. If SOURCE is a file, it will be
|
||||
@@ -305,7 +390,7 @@ will not be able to boot. Equivalent to "--compress=bzip2"
|
||||
[WARNING]
|
||||
====
|
||||
Make sure your kernel has lzma decompression support compiled in, otherwise you
|
||||
will not be able to boot. Equivalent to "--compress=lzma -9"
|
||||
will not be able to boot. Equivalent to "lzma --compress=lzma -9"
|
||||
====
|
||||
|
||||
**--xz**::
|
||||
@@ -314,8 +399,7 @@ will not be able to boot. Equivalent to "--compress=lzma -9"
|
||||
[WARNING]
|
||||
====
|
||||
Make sure your kernel has xz decompression support compiled in, otherwise you
|
||||
will not be able to boot. Equivalent to "--compress=xz --check=crc32
|
||||
--lzma2=dict=1MiB"
|
||||
will not be able to boot. Equivalent to "lzma --compress=xz --check=crc32 --lzma2=dict=1MiB"
|
||||
====
|
||||
|
||||
**--compress** _<compressor>_::
|
||||
@@ -338,6 +422,31 @@ will not be able to boot. Equivalent to "--compress=xz --check=crc32
|
||||
**--keep**::
|
||||
Keep the initramfs temporary directory for debugging purposes.
|
||||
|
||||
**--printsize**::
|
||||
Print out the module install size
|
||||
|
||||
**--profile**:
|
||||
Output profile information of the build process
|
||||
|
||||
**--ro-mnt**:
|
||||
Mount / and /usr read-only by default.
|
||||
|
||||
**-L, --stdlog** _<level>_::
|
||||
[0-6] Specify logging level (to standard error)
|
||||
----
|
||||
0 - suppress any messages
|
||||
1 - only fatal errors
|
||||
2 - all errors
|
||||
3 - warnings
|
||||
4 - info
|
||||
5 - debug info (here starts lots of output)
|
||||
6 - trace info (and even more)
|
||||
----
|
||||
|
||||
**--regenerate-all**::
|
||||
Regenerate all initramfs images at the default location with the kernel versions found on the system.
|
||||
Additional parameters are passed through.
|
||||
|
||||
FILES
|
||||
-----
|
||||
_/var/log/dracut.log_::
|
||||
@@ -353,6 +462,9 @@ _/etc/dracut.conf_::
|
||||
_/etc/dracut.conf.d/*.conf_::
|
||||
see dracut.conf5
|
||||
|
||||
_/usr/lib/dracut/dracut.conf.d/*.conf_::
|
||||
see dracut.conf5
|
||||
|
||||
Configuration in the initramfs
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
_/etc/conf.d/_::
|
||||
@@ -361,6 +473,9 @@ _/etc/conf.d/_::
|
||||
set in the configuration files.
|
||||
|
||||
_/etc/cmdline_::
|
||||
Can contain additional command line options. Deprecated, better use /etc/cmdline.d/*.conf.
|
||||
|
||||
_/etc/cmdline.d/*.conf::
|
||||
Can contain additional command line options.
|
||||
|
||||
AVAILABILITY
|
||||
|
180
dracut.asc
180
dracut.asc
@@ -79,7 +79,7 @@ udev pulls in modules matching the computer's detected hardware.
|
||||
initialized and a user-space helper started to paint animations onto the display
|
||||
in lockstep with the boot process.
|
||||
|
||||
* If the root file system is on NFS, dracut does then:
|
||||
* If the root file system is on NFS, dracut does then:
|
||||
** Bring up the primary network interface.
|
||||
** Invoke a DHCP client, with which it can obtain a DHCP lease.
|
||||
** Extract the name of the NFS share and the address of the NFS server from the
|
||||
@@ -120,6 +120,29 @@ final cleanup tasks. On an initramfs, the initial root file system cannot be
|
||||
rotated away. Instead, it is simply emptied and the final root file system
|
||||
mounted over the top.
|
||||
|
||||
If the systemd module is used in the initramfs, the ordering of the services
|
||||
started looks like <<dracutbootup7>>.
|
||||
|
||||
== Dracut on shutdown
|
||||
|
||||
On a systemd driven system, the dracut initramfs is also used for the shutdown procedure.
|
||||
|
||||
The following steps are executed during a shutdown:
|
||||
|
||||
* systemd switches to the shutdown.target
|
||||
* systemd starts /lib/systemd/system/shutdown.target.wants/dracut-shutdown.service
|
||||
* dracut-shutdown.service executes /usr/lib/dracut/dracut-initramfs-restore
|
||||
which unpacks the initramfs to /run/initramfs
|
||||
* systemd finishes shutdown.target
|
||||
* systemd kills all processes
|
||||
* systemd tries to unmount everything and mounts the remaining read-only
|
||||
* systemd checks, if there is a /run/initramfs/shutdown executable
|
||||
* if yes, it does a pivot_root to /run/initramfs and executes ./shutdown.
|
||||
The old root is then mounted on /oldroot. /usr/lib/dracut/modules.d/99shutdown/shutdown.sh is the shutdown executable.
|
||||
* shutdown will try to umount every /oldroot mount and calls the various shutdown hooks from the dracut modules
|
||||
|
||||
This ensures, that all devices are disassembled and unmounted cleanly.
|
||||
|
||||
= User Manual
|
||||
|
||||
== Creating an initramfs Image
|
||||
@@ -328,25 +351,28 @@ To add your own files to the initramfs image, you have several possibilities.
|
||||
|
||||
The --include option let you specify a source path and a target path. For example
|
||||
----
|
||||
# dracut --include cmdline-preset /etc/cmdline initramfs-cmdline-pre.img
|
||||
# dracut --include cmdline-preset /etc/cmdline.d/mycmdline.conf initramfs-cmdline-pre.img
|
||||
----
|
||||
will create an initramfs image, where the file cmdline-preset will be copied
|
||||
inside the initramfs to _/etc/cmdline_. --include can only be specified once.
|
||||
inside the initramfs to _/etc/cmdline.d/mycmdline.conf_. --include can only be specified once.
|
||||
|
||||
|
||||
----
|
||||
# mkdir rd.live.overlay
|
||||
# mkdir rd.live.overlay/etc
|
||||
# mkdir rd.live.overlay/etc/conf.d
|
||||
# echo "ip=auto" >> rd.live.overlay/etc/cmdline
|
||||
# echo export TESTVAR=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
|
||||
# echo export TESTVAR=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
|
||||
# mkdir rd.live.overlay/etc/cmdline.d
|
||||
# echo "ip=auto" >> rd.live.overlay/etc/cmdline.d/mycmdline.conf
|
||||
# echo export FOO=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
|
||||
# echo export BAR=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
|
||||
# tree rd.live.overlay/
|
||||
rd.live.overlay/
|
||||
└── etc
|
||||
├── cmdline
|
||||
└── conf.d
|
||||
└── testvar.conf
|
||||
├── cmdline.d
|
||||
│ └── mycmdline.conf
|
||||
└── conf.d
|
||||
└── testvar.conf
|
||||
|
||||
# dracut --include rd.live.overlay / initramfs-rd.live.overlay.img
|
||||
----
|
||||
|
||||
@@ -388,12 +414,12 @@ How to setup your PXE/TFTP server can be found in the
|
||||
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/[Red
|
||||
Hat Enterprise Linux Storage Administration Guide].
|
||||
|
||||
If you specify rd.ip=auto on the kernel command line, then dracut asks a dhcp
|
||||
If you specify ip=auto on the kernel command line, then dracut asks a dhcp
|
||||
server about the ip adress for the machine. The dhcp server can also serve an
|
||||
additional root-path, which will set the root device for dracut. With this
|
||||
mechanism, you have static configuration on your client machine and a
|
||||
centralized boot configuration on your TFTP/DHCP server. If you can't pass a
|
||||
kernel command line, then you can inject _/etc/cmdline_, with a method described
|
||||
kernel command line, then you can inject _/etc/cmdline.d/mycmdline.conf_, with a method described
|
||||
in <<Injecting>>.
|
||||
|
||||
|
||||
@@ -459,6 +485,14 @@ dracut shell commands are printed as they are executed
|
||||
# less /run/initramfs/init.log
|
||||
# dmesg | less
|
||||
----
|
||||
. With dracut >= 022 and systemd, you can inspect the rd.debug output with:
|
||||
----
|
||||
# journalctl -ab
|
||||
----
|
||||
. With dracut >= 025 the file /run/initramfs/rdsosreport.txt is generated, which contains all the logs and the output of all significant tools, which are mentioned later.
|
||||
|
||||
If you want to save that output, simply mount /boot by hand or insert an USB stick and mount that.
|
||||
Then you can store the output for later inspection.
|
||||
|
||||
[[information-to-include-in-your-report]]
|
||||
=== Information to include in your report
|
||||
@@ -472,7 +506,7 @@ configuration file (e.g. _/etc/grub.conf_) or from _/proc/cmdline_.
|
||||
* A copy of your disk partition information from _/etc/fstab_, which might be
|
||||
obtained booting an old working initramfs or a rescue medium.
|
||||
* A device listing from device-mapper. This can be obtained by running the
|
||||
command
|
||||
command
|
||||
+
|
||||
----
|
||||
# dmsetup ls --tree
|
||||
@@ -500,19 +534,19 @@ all files in _/etc/dracut.conf.d/*.conf_
|
||||
As well as the information from <<all-bug-reports>> include the following
|
||||
information:
|
||||
|
||||
* Include physical volume information by running the command:
|
||||
* Include physical volume information by running the command:
|
||||
+
|
||||
----
|
||||
# lvm pvdisplay
|
||||
----
|
||||
+
|
||||
* Include volume group information by running the command:
|
||||
* Include volume group information by running the command:
|
||||
+
|
||||
----
|
||||
# lvm vgdisplay
|
||||
----
|
||||
+
|
||||
* Include logical volume information by running the command:
|
||||
* Include logical volume information by running the command:
|
||||
+
|
||||
----
|
||||
# lvm lvdisplay
|
||||
@@ -523,7 +557,7 @@ information:
|
||||
As well as the information from <<all-bug-reports>>, include the following
|
||||
information:
|
||||
|
||||
* If using software RAID disk partitions, please include the output of
|
||||
* If using software RAID disk partitions, please include the output of
|
||||
+
|
||||
----
|
||||
# cat /proc/mdstat
|
||||
@@ -602,7 +636,7 @@ will put it out on the console when it reaches the kernel buffer by doing
|
||||
[[using-the-dracut-shell]]
|
||||
==== Using the dracut shell
|
||||
|
||||
Dracut offers a shell for interactive debugging in the event dracut fails to
|
||||
dracut offers a shell for interactive debugging in the event dracut fails to
|
||||
locate your root filesystem. To enable the shell:
|
||||
|
||||
. Add the boot parameter ''rd.shell'' to your bootloader configuration file
|
||||
@@ -628,7 +662,7 @@ title Fedora (2.6.29.5-191.fc11.x86_64)
|
||||
No root device found
|
||||
Dropping to debug shell.
|
||||
|
||||
#
|
||||
#
|
||||
----
|
||||
+
|
||||
. Use this shell prompt to gather the information requested above (see <<all-bug-reports>>).
|
||||
@@ -648,7 +682,7 @@ The exact method for locating and preparing will vary. However, to continue with
|
||||
a successful boot, the objective is to locate your root volume and create a
|
||||
symlink _/dev/root_ which points to the file system. For example, the following
|
||||
example demonstrates accessing and booting a root volume that is an encrypted
|
||||
LVM Logical volume.
|
||||
LVM Logical volume.
|
||||
|
||||
. Inspect your partitions using parted
|
||||
+
|
||||
@@ -664,7 +698,7 @@ Number Start End Size Type File system Flags
|
||||
----
|
||||
+
|
||||
. You recall that your root volume was a LVM logical volume. Scan and activate
|
||||
any logical volumes.
|
||||
any logical volumes.
|
||||
+
|
||||
----
|
||||
# lvm vgscan
|
||||
@@ -690,7 +724,7 @@ Installation Guide, you unlock your encrypted root volume.
|
||||
# UUID=$(cryptsetup luksUUID /dev/mapper/linux-root)
|
||||
# cryptsetup luksOpen /dev/mapper/linux-root luks-$UUID
|
||||
Enter passphrase for /dev/mapper/linux-root:
|
||||
Key slot 0 unlocked.
|
||||
Key slot 0 unlocked.
|
||||
----
|
||||
+
|
||||
. Next, make a symbolic link to the unlocked root volume
|
||||
@@ -710,6 +744,23 @@ the dracut shell
|
||||
==== Additional dracut boot parameters
|
||||
For more debugging options, see <<dracutkerneldebug>> in <<dracutcmdline7>>.
|
||||
|
||||
|
||||
[[debugging-dracut-on-shutdown]]
|
||||
==== Debugging dracut on shutdown
|
||||
|
||||
To debug the shutdown sequence on systemd systems, you can _rd.break_
|
||||
on _pre-shutdown_ or _shutdown_.
|
||||
|
||||
To do this from an already booted system:
|
||||
----
|
||||
# mkdir -p /run/initramfs/etc/cmdline.d
|
||||
# echo "rd.break=pre-shutdown" > /run/initramfs/etc/cmdline.d/debug.conf
|
||||
# touch /run/initramfs/.need_shutdown
|
||||
----
|
||||
|
||||
This will give you a dracut shell after the system pivot'ed back in the initramfs.
|
||||
|
||||
|
||||
= Developer Manual
|
||||
|
||||
== dracut Components
|
||||
@@ -743,24 +794,11 @@ scripts and udev rules.
|
||||
[[stages]]
|
||||
== Boot Process Stages
|
||||
|
||||
The init script in _99base_ is the main script, which prepares the root file
|
||||
system for usage, runs udev, mounts the real root device, kills the remaining
|
||||
processes, and switches to the real root device for further booting. dracut
|
||||
modules can insert custom script at various points, to control the boot process.
|
||||
dracut modules can insert custom script at various points, to control the boot
|
||||
process.
|
||||
These hooks are plain directories containing shell scripts ending with ".sh",
|
||||
which are sourced by init.
|
||||
Common used functions are in _dracut-lib.sh_, which can be sourced by any script.
|
||||
|
||||
|
||||
|
||||
=== Basic Setup
|
||||
|
||||
The first thing init does, is to mount _/proc_ and _/sys_ and manually create
|
||||
the basic device nodes and symbolic links in _/dev_ needed to execute basic
|
||||
commands. Then logging is setup according to kernel command line arguments.
|
||||
_/dev/pts_ and _/dev/shm_ are mounted and the first hook is sourced.
|
||||
|
||||
|
||||
Common used functions are in _dracut-lib.sh_, which can be sourced by any script.
|
||||
|
||||
=== Hook: cmdline
|
||||
|
||||
@@ -779,63 +817,49 @@ This hook is executed right after the cmdline hook and a check if root and
|
||||
rootok were set. Here modules can take action with the final root, and before
|
||||
udev has been run.
|
||||
|
||||
|
||||
|
||||
=== Start Udev
|
||||
|
||||
Now udev is started and the logging for udev is setup.
|
||||
|
||||
|
||||
|
||||
=== Hook: pre-trigger
|
||||
|
||||
In this hook, you can set udev environment variables with **udevadm control
|
||||
--property=KEY=_value_** or control the further execution of udev with
|
||||
udevadm.
|
||||
|
||||
|
||||
|
||||
=== Trigger Udev
|
||||
|
||||
udev is triggered by calling udevadm trigger, which sends add events for all
|
||||
devices and subsystems.
|
||||
|
||||
|
||||
devices and subsystems.
|
||||
|
||||
=== Main Loop
|
||||
|
||||
Now the main loop of 99base/init begins. Here we loop until udev has settled and
|
||||
all scripts in _initqueue/finished_ returned true. In this loop there are three
|
||||
hooks, where scripts can be inserted by calling /sbin/initqueue.
|
||||
|
||||
|
||||
In the main loop of dracut loops until udev has settled and
|
||||
all scripts in _initqueue/finished_ returned true.
|
||||
In this loop there are three hooks, where scripts can be inserted
|
||||
by calling /sbin/initqueue.
|
||||
|
||||
==== Initqueue
|
||||
|
||||
This hook gets executed every time a script is inserted here, regardless of the
|
||||
udev state.
|
||||
|
||||
|
||||
|
||||
==== Initqueue settled
|
||||
|
||||
This hooks gets executed every time udev has settled.
|
||||
|
||||
This hooks (initqueue/settled) gets executed every time udev has settled.
|
||||
|
||||
|
||||
==== Initqueue timeout
|
||||
|
||||
This hooks gets executed, when the main loop counter becomes half of the
|
||||
This hooks (initqueue/timeout) gets executed, when the main loop counter becomes half of the
|
||||
rd.retry counter.
|
||||
|
||||
|
||||
|
||||
==== Initqueue finished
|
||||
|
||||
This hook is called after udev has settled and if all scripts herein return 0
|
||||
the main loop will be ended.
|
||||
|
||||
|
||||
This hook (initqueue/finished) is called after udev has settled and
|
||||
if all scripts herein return 0 the main loop will be ended.
|
||||
Abritary scripts can be added here, to loop in the
|
||||
initqueue until something happens, which a dracut module wants to wait for.
|
||||
|
||||
=== Hook: pre-mount
|
||||
|
||||
@@ -843,20 +867,15 @@ Before the root device is mounted all scripts in the hook pre-mount are
|
||||
executed. In some cases (e.g. NFS) the real root device is already mounted,
|
||||
though.
|
||||
|
||||
|
||||
|
||||
=== Hook: mount
|
||||
|
||||
This hook is mainly to mount the real root device.
|
||||
|
||||
|
||||
|
||||
=== Hook: pre-pivot
|
||||
|
||||
This hook is called before cleanup hook, This is a good place for
|
||||
actions other than cleanups which need to be called before pivot.
|
||||
|
||||
|
||||
=== Hook: cleanup
|
||||
|
||||
This hook is the last hook and is called before init finally switches root to
|
||||
@@ -866,22 +885,18 @@ needed anymore.
|
||||
|
||||
=== Cleanup and switch_root
|
||||
|
||||
Init kills all udev processes, cleans up the environment, sets up the arguments
|
||||
for the real init process and finally calls switch_root. switch_root removes the
|
||||
whole filesystem hierarchy of the initramfs, chroot()s to the real root device
|
||||
and calls /sbin/init with the specified arguments.
|
||||
Init (or systemd) kills all udev processes, cleans up the environment,
|
||||
sets up the arguments for the real init process and finally calls switch_root.
|
||||
switch_root removes the whole filesystem hierarchy of the initramfs,
|
||||
chroot()s to the real root device and calls /sbin/init with the specified arguments.
|
||||
|
||||
To ensure all files in the initramfs hierarchy can be removed, all processes
|
||||
still running from the initramfs should not have any open file descriptors left.
|
||||
|
||||
|
||||
|
||||
== Network Infrastructure
|
||||
|
||||
|
||||
FIXME
|
||||
|
||||
|
||||
== Writing a Module
|
||||
|
||||
A simple example module is _96insmodpost_, which modprobes a kernel module after
|
||||
@@ -893,8 +908,6 @@ First we create a check() function, which just exits with 0 indicating that this
|
||||
module should be included by default.
|
||||
|
||||
check():
|
||||
|
||||
|
||||
----
|
||||
return 0
|
||||
----
|
||||
@@ -904,8 +917,6 @@ priority number 20 called _parse-insmodpost.sh_. It also installs the
|
||||
_insmodpost.sh_ script in _/sbin_.
|
||||
|
||||
install():
|
||||
|
||||
|
||||
----
|
||||
inst_hook cmdline 20 "$moddir/parse-insmodpost.sh"
|
||||
inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh
|
||||
@@ -916,8 +927,6 @@ rd.driver.post, blacklists the module from being autoloaded and installs the
|
||||
hook _insmodpost.sh_ in the _initqueue/settled_.
|
||||
|
||||
_parse-insmodpost.sh_:
|
||||
|
||||
|
||||
----
|
||||
for p in $(getargs rd.driver.post=); do
|
||||
echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
|
||||
@@ -934,8 +943,6 @@ modprobe the kernel modules specified in all rd.driver.post kernel command line
|
||||
parameters. It runs after udev has settled and is only called once (--onetime).
|
||||
|
||||
_insmodpost.sh_:
|
||||
|
||||
|
||||
----
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
@@ -977,7 +984,7 @@ depends on.
|
||||
|
||||
=== install()
|
||||
|
||||
dracut_install
|
||||
inst_multiple
|
||||
|
||||
inst
|
||||
|
||||
@@ -997,13 +1004,11 @@ instmods
|
||||
|
||||
=== Creation Functions
|
||||
|
||||
|
||||
FIXME
|
||||
|
||||
|
||||
=== Initramfs Functions
|
||||
|
||||
|
||||
FIXME
|
||||
|
||||
|
||||
@@ -1011,6 +1016,9 @@ FIXME
|
||||
|
||||
FIXME
|
||||
|
||||
:leveloffset: 1
|
||||
[[dracutbootup7]]
|
||||
include::dracut.bootup.7.asc[]
|
||||
|
||||
:leveloffset: 1
|
||||
[[dracut8]]
|
||||
|
122
dracut.bootup.7.asc
Normal file
122
dracut.bootup.7.asc
Normal file
@@ -0,0 +1,122 @@
|
||||
DRACUT.BOOTUP(7)
|
||||
================
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
|
||||
NAME
|
||||
----
|
||||
dracut.bootup - boot ordering in the initramfs
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
|
||||
This flow chart illustrates the ordering of the services, if systemd is used in the dracut initramfs.
|
||||
----
|
||||
|
||||
systemd-journal.socket
|
||||
|
|
||||
v
|
||||
dracut-cmdline.service
|
||||
|
|
||||
v
|
||||
dracut-pre-udev.service
|
||||
|
|
||||
v
|
||||
systemd-udevd.service
|
||||
|
|
||||
v
|
||||
local-fs-pre.target dracut-pre-trigger.service
|
||||
| |
|
||||
v v
|
||||
(various mounts) (various swap systemd-udev-trigger.service
|
||||
| devices...) | (various low-level (various low-level
|
||||
| | | services: seed, API VFS mounts:
|
||||
v v v tmpfiles, random mqueue, configfs,
|
||||
local-fs.target swap.target dracut-initqueue.service sysctl, ...) debugfs, ...)
|
||||
| | | | |
|
||||
\_______________|____________________ | ___________________|____________________/
|
||||
\|/
|
||||
v
|
||||
sysinit.target
|
||||
|
|
||||
_________________/|\___________________
|
||||
/ | \
|
||||
| | |
|
||||
v | v
|
||||
(various | rescue.service
|
||||
sockets...) | |
|
||||
| | v
|
||||
v | rescue.target
|
||||
sockets.target |
|
||||
| |
|
||||
\_________________ | emergency.service
|
||||
\| |
|
||||
v v
|
||||
basic.target emergency.target
|
||||
|
|
||||
______________________/|
|
||||
/ |
|
||||
| v
|
||||
| dracut-pre-mount.service
|
||||
| |
|
||||
| v
|
||||
| sysroot.mount
|
||||
| |
|
||||
| v
|
||||
| initrd-root-fs.target
|
||||
(custom initrd services) |
|
||||
| v
|
||||
| dracut-mount.service
|
||||
| |
|
||||
| v
|
||||
| initrd-parse-etc.service
|
||||
| |
|
||||
| v
|
||||
| (sysroot-usr.mount and
|
||||
| various mounts marked
|
||||
| with fstab option
|
||||
| x-initrd.mount)
|
||||
| |
|
||||
| v
|
||||
| initrd-fs.target
|
||||
\______________________ |
|
||||
\|
|
||||
v
|
||||
initrd.target
|
||||
|
|
||||
v
|
||||
dracut-pre-pivot.service
|
||||
|
|
||||
v
|
||||
initrd-cleanup.service
|
||||
isolates to
|
||||
initrd-switch-root.target
|
||||
|
|
||||
v
|
||||
______________________/|
|
||||
/ |
|
||||
| initrd-udevadm-cleanup-db.service
|
||||
| |
|
||||
(custom initrd services) |
|
||||
| |
|
||||
\______________________ |
|
||||
\|
|
||||
v
|
||||
initrd-switch-root.target
|
||||
|
|
||||
v
|
||||
initrd-switch-root.service
|
||||
|
|
||||
v
|
||||
switch-root
|
||||
----
|
||||
|
||||
|
||||
AUTHOR
|
||||
------
|
||||
Harald Hoyer
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
*dracut*(8) *bootup*(7)
|
@@ -61,6 +61,18 @@ rootfstype=ext3
|
||||
_/etc/fstab_ of the real root will be parsed for special mount options and
|
||||
mounted accordingly.
|
||||
|
||||
**ro**::
|
||||
force mounting _/_ and _/usr_ (if it is a separate device) read-only. If
|
||||
none of ro and rw is present, both are mounted according to _/etc/fstab_.
|
||||
|
||||
**rw**::
|
||||
force mounting _/_ and _/usr_ (if it is a separate device) read-write.
|
||||
See also ro option.
|
||||
|
||||
**rd.auto** **rd.auto=1**::
|
||||
enable autoassembly of special devices like cryptoLUKS, dmraid, mdraid or lvm.
|
||||
Default is off as of dracut version >= 024.
|
||||
|
||||
**rd.fstab=0**::
|
||||
do not honor special mount options for the root filesystem found in
|
||||
_/etc/fstab_ of the real root.
|
||||
@@ -81,10 +93,6 @@ resume=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7
|
||||
the init system performs fsck before remount, you might want to use this
|
||||
option to avoid duplication.
|
||||
|
||||
**rd.usrmount.ro**:
|
||||
force mounting _/usr_ read-only. Use this option if your init system
|
||||
performs remount of _/usr_ the same as it does with rootfs.
|
||||
|
||||
|
||||
Misc
|
||||
~~~~
|
||||
@@ -100,9 +108,28 @@ Misc
|
||||
force loading kernel module <drivername> after all automatic loading modules
|
||||
have been loaded. This parameter can be specified multiple times.
|
||||
|
||||
**rd.retry=**_<seconds>_::
|
||||
specify how long dracut should wait for devices to appear.
|
||||
The default is 30 seconds. After 2/3 of the time, degraded raids are force
|
||||
started. If you have hardware, which takes a very long time to announce its
|
||||
drives, you might want to extend this value.
|
||||
|
||||
**rd.noverifyssl**::
|
||||
accept self-signed certificates for ssl downloads.
|
||||
|
||||
**rd.ctty=**_<terminal device>_**::
|
||||
specify the controlling terminal for the console.
|
||||
This is useful, if you have multiple "console=" arguments.
|
||||
|
||||
[[dracutkerneldebug]]
|
||||
Debug
|
||||
~~~~~
|
||||
If you are dropped to an emergency shell, the file _/run/initramfs/rdsosreport.txt_ is created,
|
||||
which can be safed to a (to be mounted by hand) partition (usually /boot) or a USB stick.
|
||||
Additional debugging info can be produced by adding **rd.debug** to the kernel command line.
|
||||
_/run/initramfs/rdsosreport.txt_ contains all logs and the output of some tools.
|
||||
It should be attached to any report about dracut problems.
|
||||
|
||||
**rd.info**::
|
||||
print informational output though "quiet" is set
|
||||
|
||||
@@ -110,8 +137,19 @@ Debug
|
||||
allow dropping to a shell, if root mounting fails
|
||||
|
||||
**rd.debug**::
|
||||
set -x for the dracut shell and logs to dmesg, console and
|
||||
_/run/initramfs/init.log_
|
||||
set -x for the dracut shell.
|
||||
If systemd is active in the initramfs, all output is logged to the systemd journal,
|
||||
which you can inspect with "journalctl -ab".
|
||||
If systemd is not active, the logs are written to dmesg and _/run/initramfs/init.log_.
|
||||
If "quiet" is set, it also logs to the console.
|
||||
|
||||
**rd.memdebug=[0-3]**::
|
||||
Print memory usage info at various points, set the verbose level from 0 to 3
|
||||
Higher level means more debugging output:
|
||||
0 - no output
|
||||
1 - partial /proc/meminfo
|
||||
2 - /proc/meminfo
|
||||
3 - /proc/meminfo + /proc/slabinfo
|
||||
|
||||
**rd.break**::
|
||||
drop to a shell at the end
|
||||
@@ -209,7 +247,7 @@ crypto LUKS
|
||||
LUKS UUID, so you don't have to specify the full UUID.
|
||||
This parameter can be specified multiple times.
|
||||
|
||||
**rd.luks.allow-discards::
|
||||
**rd.luks.allow-discards**::
|
||||
Allow using of discards (TRIM) requests on all LUKS partitions.
|
||||
|
||||
**rd.luks.crypttab=0**::
|
||||
@@ -229,6 +267,29 @@ rd.luks.key=/foo/bar.key
|
||||
----
|
||||
+
|
||||
As you see, you can skip colons in such a case.
|
||||
+
|
||||
[NOTE]
|
||||
===============================
|
||||
dracut pipes key to cryptsetup with _-d -_ argument, therefore you need to pipe
|
||||
to crypsetup luksFormat with _-d -_, too!
|
||||
|
||||
Here follows example for key encrypted with GPG:
|
||||
|
||||
----
|
||||
gpg --quiet --decrypt rootkey.gpg \
|
||||
| cryptsetup -d - -v \
|
||||
--cipher serpent-cbc-essiv:sha256 \
|
||||
--key-size 256 luksFormat /dev/sda3
|
||||
----
|
||||
|
||||
If you use plain keys, just add path to _-d_ option:
|
||||
|
||||
----
|
||||
cryptsetup -d rootkey.key -v \
|
||||
--cipher serpent-cbc-essiv:sha256 \
|
||||
--key-size 256 luksFormat /dev/sda3
|
||||
----
|
||||
===============================
|
||||
|
||||
MD RAID
|
||||
~~~~~~~
|
||||
@@ -351,6 +412,9 @@ interface name. Better name it "bootnet" or "bluesocket".
|
||||
**biosdevname=0**::
|
||||
boolean, turn off biosdevname network interface renaming
|
||||
|
||||
**rd.neednet=1**::
|
||||
boolean, bring up network even without netroot set
|
||||
|
||||
**vlan=_<vlanname>_:_<phydevice>_**::
|
||||
Setup vlan device named <vlanname> on <phydeivce>.
|
||||
We support the four styles of vlan names: VLAN_PLUS_VID (vlan0005), VLAN_PLUS_VID_NO_PAD (vlan5),
|
||||
@@ -364,6 +428,10 @@ interface name. Better name it "bootnet" or "bluesocket".
|
||||
then its values should be separated by semicolon.
|
||||
Bond without parameters assumes bond=bond0:eth0,eth1:mode=balance-rr
|
||||
|
||||
**team =_<teammaster>_:_<teamslaves>_**::
|
||||
Setup team device <teammaster> on top of <teamslaves>.
|
||||
<teamslaves> is a comma-separated list of physical (ethernet) interfaces.
|
||||
|
||||
**bridge=_<bridgename>_:_<ethnames>_**::
|
||||
Setup bridge <bridgename> with <ethnames>. <ethnames> is a comma-separated
|
||||
list of physical (ethernet) interfaces. Bridge without parameters assumes bridge=br0:eth0
|
||||
@@ -394,6 +462,31 @@ NFS
|
||||
**rd.nfs.domain=**_<NFSv4 domain name>_::
|
||||
Set the NFSv4 domain name. Will overwrite the settings in _/etc/idmap.conf_.
|
||||
|
||||
CIFS
|
||||
~~~
|
||||
**root=**cifs://[_<username>_[:_<password>_]@]_<server-ip>_:_<root-dir>_::
|
||||
mount cifs 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]. If a username or password are not specified
|
||||
as part of the root, then they must be passed on the command line through
|
||||
cifsuser/cifspass.
|
||||
+
|
||||
[WARNING]
|
||||
====
|
||||
Passwords specified on the kernel command line are visible for all users via the file _/proc/cmdline_ and via dmesg or can be sniffed on the network, when using DHCP with DHCP root-path.
|
||||
====
|
||||
|
||||
**cifsuser=_<username>_::
|
||||
Set the cifs username, if not specified as part of the root.
|
||||
|
||||
**cifspass=_<password>_::
|
||||
Set the cifs password, if not specified as part of the root.
|
||||
+
|
||||
[WARNING]
|
||||
====
|
||||
Passwords specified on the kernel command line are visible for all users via the file _/proc/cmdline_ and via dmesg or can be sniffed on the network, when using DHCP with DHCP root-path.
|
||||
====
|
||||
|
||||
iSCSI
|
||||
~~~~~
|
||||
**root=**iscsi:[_<username>_:_<password>_[:_<reverse>_:_<password>_]@][_<servername>_]:[_<protocol>_]:[_<port>_][:[_<iscsi_iface_name>_]:[_<netdev_name>_]]:[_<LUN>_]:_<targetname>_::
|
||||
@@ -415,6 +508,11 @@ If servername is an IPv6 address, it has to be put in brackets. e.g.:
|
||||
----
|
||||
root=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0
|
||||
----
|
||||
+
|
||||
[WARNING]
|
||||
====
|
||||
Passwords specified on the kernel command line are visible for all users via the file _/proc/cmdline_ and via dmesg or can be sniffed on the network, when using DHCP with DHCP root-path.
|
||||
====
|
||||
|
||||
**root=**_???_ **netroot=**iscsi:[_<username>_:_<password>_[:_<reverse>_:_<password>_]@][_<servername>_]:[_<protocol>_]:[_<port>_][:[_<iscsi_iface_name>_]:[_<netdev_name>_]]:[_<LUN>_]:_<targetname>_ ...::
|
||||
multiple netroot options allow setting up multiple iscsi disks. e.g.:
|
||||
@@ -430,9 +528,19 @@ If servername is an IPv6 address, it has to be put in brackets. e.g.:
|
||||
----
|
||||
netroot=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0
|
||||
----
|
||||
+
|
||||
[WARNING]
|
||||
====
|
||||
Passwords specified on the kernel command line are visible for all users via the file _/proc/cmdline_ and via dmesg or can be sniffed on the network, when using DHCP with DHCP root-path. You may want to use rd.iscsi.firmware.
|
||||
====
|
||||
|
||||
**root=**_???_ **rd.iscsi.initiator=**_<initiator>_ **rd.iscsi.target.name=**_<target name>_ **rd.iscsi.target.ip=**_<target ip>_ **rd.iscsi.target.port=**_<target port>_ **rd.iscsi.target.group=**_<target group>_ **rd.iscsi.username=**_<username>_ **rd.iscsi.password=**_<password>_ **rd.iscsi.in.username=**_<in username>_ **rd.iscsi.in.password=**_<in password>_::
|
||||
manually specify all iscsistart parameter (see **+iscsistart --help+**)
|
||||
+
|
||||
[WARNING]
|
||||
====
|
||||
Passwords specified on the kernel command line are visible for all users via the file _/proc/cmdline_ and via dmesg or can be sniffed on the network, when using DHCP with DHCP root-path. You may want to use rd.iscsi.firmware.
|
||||
====
|
||||
|
||||
**root=**_???_ **netroot=**iscsi **rd.iscsi.firmware=1**::
|
||||
will read the iscsi parameter from the BIOS firmware
|
||||
@@ -443,7 +551,7 @@ netroot=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0
|
||||
e.g.:
|
||||
+
|
||||
----
|
||||
"netroot=iscsi iscsi_firmware rd.iscsi.param=node.session.timeo.replacement_timeout=30"
|
||||
"netroot=iscsi rd.iscsi.firmware=1 rd.iscsi.param=node.session.timeo.replacement_timeout=30"
|
||||
----
|
||||
+
|
||||
will result in
|
||||
@@ -496,7 +604,7 @@ ZNET
|
||||
+
|
||||
----
|
||||
rd.znet=qeth,0.0.0600,0.0.0601,0.0.0602,layer2=1,portname=foo
|
||||
rd.znet=ctc,0.0.0600,0.0.0601,0.0.0602,protocol=bar
|
||||
rd.znet=ctc,0.0.0600,0.0.0601,protocol=bar
|
||||
----
|
||||
|
||||
Plymouth Boot Splash
|
||||
@@ -673,7 +781,7 @@ _/etc/conf.d/_::
|
||||
set in the configuration files.
|
||||
|
||||
_/etc/cmdline_::
|
||||
Can contain additional command line options.
|
||||
Can contain additional command line options. Deprecated, better use /etc/cmdline.d/*.conf.
|
||||
|
||||
_/etc/cmdline.d/*.conf_::
|
||||
Can contain additional command line options.
|
||||
|
17
dracut.conf
17
dracut.conf
@@ -1,21 +1,21 @@
|
||||
# PUT YOUR CONFIG HERE OR IN separate files named *.conf
|
||||
# in /etc/dracut.conf.d
|
||||
# /etc/dracut.conf.d/*.conf will override the settings in here
|
||||
# SEE man dracut.conf(5)
|
||||
|
||||
# Sample dracut config file
|
||||
|
||||
logfile=/var/log/dracut.log
|
||||
fileloglvl=6
|
||||
#logfile=/var/log/dracut.log
|
||||
#fileloglvl=6
|
||||
|
||||
# Exact list of dracut modules to use. Modules not listed here are not going
|
||||
# to be included. If you only want to add some optional modules use
|
||||
# add_dracutmodules option instead.
|
||||
#dracutmodules+=""
|
||||
|
||||
# Dracut modules to omit
|
||||
# dracut modules to omit
|
||||
#omit_dracutmodules+=""
|
||||
|
||||
# Dracut modules to add to the default
|
||||
# dracut modules to add to the default
|
||||
#add_dracutmodules+=""
|
||||
|
||||
# additional kernel modules to the default
|
||||
@@ -29,10 +29,10 @@ fileloglvl=6
|
||||
#
|
||||
|
||||
# install local /etc/mdadm.conf
|
||||
mdadmconf="yes"
|
||||
#mdadmconf="no"
|
||||
|
||||
# install local /etc/lvm/lvm.conf
|
||||
lvmconf="yes"
|
||||
#lvmconf="no"
|
||||
|
||||
# A list of fsck tools to install. If it's not specified, module's hardcoded
|
||||
# default is used, currently: "umount mount /sbin/fsck* xfs_db xfs_check
|
||||
@@ -43,6 +43,9 @@ lvmconf="yes"
|
||||
# inhibit installation of any fsck tools
|
||||
#nofscks="yes"
|
||||
|
||||
# mount / and /usr read-only by default
|
||||
#ro_mnt="no"
|
||||
|
||||
# set the directory for temporary files
|
||||
# default: /var/tmp
|
||||
#tmpdir=/tmp
|
||||
|
@@ -10,17 +10,24 @@ dracut.conf - configuration file(s) for dracut
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
_/etc/dracut.conf_ _/etc/dracut.conf.d/*.conf_
|
||||
_/etc/dracut.conf_ _/etc/dracut.conf.d/*.conf_ _/usr/lib/dracut/dracut.conf.d/*.conf_
|
||||
|
||||
Description
|
||||
-----------
|
||||
_dracut.conf_ is loaded during the initialisation phase of dracut. Command line
|
||||
parameter will overwrite any values set here. _dracut.conf.d/*.conf_ files are
|
||||
read in alphanumerical order and will overwrite parameters set in
|
||||
parameter will overwrite any values set here.
|
||||
|
||||
_*.conf_ files are read from /usr/lib/dracut/dracut.conf.d and /etc/dracut.conf.d.
|
||||
Files with the same name in /etc/dracut.conf.d will replace files in /usr/lib/dracut/dracut.conf.d.
|
||||
The files are then read in alphanumerical order and will overwrite parameters set in
|
||||
_/etc/dracut.conf_. Each line specifies an attribute and a value. A '#'
|
||||
indicates the beginning of a comment; following characters, up to the end of the
|
||||
line are not interpreted.
|
||||
|
||||
dracut command line options will overwrite any values set here.
|
||||
|
||||
Configuration files must have the extension .conf; other extensions are ignored.
|
||||
|
||||
*dracutmodules+=*" __<dracut modules>__ "::
|
||||
Specify a space-separated list of dracut modules to call when building the
|
||||
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.
|
||||
@@ -44,10 +51,6 @@ line are not interpreted.
|
||||
Specify a space-separated list of kernel modules not to add to the
|
||||
initramfs. The kernel modules have to be specified without the ".ko" suffix.
|
||||
|
||||
*install_items+=*" __<kernel modules>__ "::
|
||||
Specify a space-separated list of files, which are added to the initramfs
|
||||
image.
|
||||
|
||||
*filesystems+=*" __<filesystem names>__ "::
|
||||
Specify a space-separated list of kernel filesystem modules to exclusively
|
||||
include in the generic initramfs.
|
||||
@@ -68,6 +71,11 @@ line are not interpreted.
|
||||
Host-Only mode: Install only what is needed for booting the local host
|
||||
instead of a generic host and generate host-specific configuration.
|
||||
|
||||
*persistent_policy=*"__<policy>__"::
|
||||
Use _<policy>_ to address disks and partitions.
|
||||
_<policy>_ can be any directory name found in /dev/disk.
|
||||
E.g. "by-uuid", "by-label"
|
||||
|
||||
*tmpdir=*"__<temporary directory>__"::
|
||||
Specify temporary directory to use.
|
||||
|
||||
@@ -82,6 +90,11 @@ If chrooted to another root other than the real root device, use --fstab and pro
|
||||
*add_fstab+=*" __<filename>__ "::
|
||||
Add entries of __<filename>__ to the initramfs /etc/fstab.
|
||||
|
||||
*add_device+=*" __<device>__ "::
|
||||
Bring up _<device>_ in initramfs, _<device>_ should be the device name.
|
||||
This can be useful in hostonly mode for resume support when your swap is on
|
||||
LVM an encrypted partition.
|
||||
|
||||
*mdadmconf=*"__{yes|no}__"::
|
||||
Include local _/etc/mdadm.conf_ (default=yes)
|
||||
|
||||
@@ -97,12 +110,21 @@ If chrooted to another root other than the real root device, use --fstab and pro
|
||||
*nofscks=*"__{yes|no}__"::
|
||||
If specified, inhibit installation of any fsck tools.
|
||||
|
||||
*ro_mnt=*"__{yes|no}__"::
|
||||
Mount _/_ and _/usr_ read-only by default.
|
||||
|
||||
*kernel_cmdline=*"__parameters__"::
|
||||
Specify default kernel command line parameters
|
||||
|
||||
*kernel_only=*"__{yes|no}__"::
|
||||
Only install kernel drivers and firmware files. (default=no)
|
||||
|
||||
*no_kernel=*"{yes|no}"::
|
||||
Do not install kernel drivers and firmware files (default=no)
|
||||
|
||||
*early_microcode=*"{yes|no}"::
|
||||
Combine early microcode with ramdisk (default=no)
|
||||
|
||||
*stdloglvl*="__\{0-6\}__"::
|
||||
Set logging to standard error level.
|
||||
|
||||
@@ -116,16 +138,16 @@ If chrooted to another root other than the real root device, use --fstab and pro
|
||||
Path to log file.
|
||||
|
||||
*show_modules=*"__{yes|no}__"::
|
||||
Print included module's name to standard output during build.
|
||||
Print the name of the included modules to standard output during build.
|
||||
|
||||
Files
|
||||
-----
|
||||
_/etc/dracut.conf_::
|
||||
Old configuration file. You better use your own file in
|
||||
_/etc/dracut/conf.d/_.
|
||||
_/etc/dracut.conf.d/_.
|
||||
|
||||
_/etc/dracut/conf.d/_::
|
||||
Any _/etc/dracut/conf.d/*.conf_ file can overwrite the values in
|
||||
_/etc/dracut.conf.d/_::
|
||||
Any _/etc/dracut.conf.d/*.conf_ file can overwrite the values in
|
||||
_/etc/dracut.conf_. The configuration files are read in alphanumerical
|
||||
order.
|
||||
|
||||
|
@@ -1,13 +1,14 @@
|
||||
# Dracut config file customized for RedHat/Fedora.
|
||||
# dracut config file customized for RedHat/Fedora.
|
||||
|
||||
# i18n
|
||||
i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP"
|
||||
omit_drivers+=" .*/fs/ocfs/.* "
|
||||
i18n_default_font="latarcyrheb-sun16"
|
||||
stdloglvl=3
|
||||
sysloglvl=5
|
||||
install_items+=" vi /etc/virc ps grep cat rm "
|
||||
prefix="/"
|
||||
systemdutildir=/usr/lib/systemd
|
||||
systemdsystemunitdir=/usr/lib/systemd/system
|
||||
systemdsystemconfdir=/etc/systemd/system
|
||||
udevdir=/usr/lib/udev
|
||||
add_dracutmodules+=" systemd "
|
||||
realinitpath="/usr/lib/systemd/systemd"
|
||||
hostonly="yes"
|
||||
|
@@ -1,9 +0,0 @@
|
||||
# /etc/dracut.conf.d/gentoo-openrc.conf
|
||||
# Dracut config file customized for Gentoo Base System release 2
|
||||
|
||||
#
|
||||
# Modules
|
||||
#
|
||||
|
||||
# i18n
|
||||
i18n_vars="/etc/conf.d/keymaps:keymap-KEYMAP,extended_keymaps-EXT_KEYMAPS /etc/conf.d/consolefont:consolefont-FONT,consoletranslation-FONT_MAP /etc/rc.conf:unicode-UNICODE"
|
5
dracut.conf.d/gentoo-systemd.conf.example
Normal file
5
dracut.conf.d/gentoo-systemd.conf.example
Normal file
@@ -0,0 +1,5 @@
|
||||
# /etc/dracut.conf.d/gentoo-systemd.conf
|
||||
|
||||
# Paths of systemd dirs on Gentoo
|
||||
systemdutildir=/usr/lib/systemd
|
||||
systemdsystemunitdir=/usr/lib/systemd/system
|
@@ -1,9 +1,15 @@
|
||||
# /etc/dracut.conf.d/gentoo.conf
|
||||
# Dracut config file customized for Gentoo Base System release 1
|
||||
# dracut config file customized for Gentoo Base System release 2
|
||||
|
||||
udevdir=/lib/udev
|
||||
ro_mnt=yes
|
||||
|
||||
#
|
||||
# Modules
|
||||
#
|
||||
|
||||
# i18n
|
||||
i18n_vars="/etc/conf.d/keymaps:KEYMAP,EXTENDED_KEYMAPS-EXT_KEYMAPS /etc/conf.d/consolefont:CONSOLEFONT-FONT,CONSOLETRANSLATION-FONT_MAP /etc/rc.conf:UNICODE"
|
||||
i18n_vars="/etc/conf.d/keymaps:keymap-KEYMAP,extended_keymaps-EXT_KEYMAPS /etc/conf.d/consolefont:consolefont-FONT,consoletranslation-FONT_MAP /etc/rc.conf:unicode-UNICODE"
|
||||
i18n_default_font="LatArCyrHeb-16"
|
||||
|
||||
omit_drivers+=" i2o_scsi"
|
||||
|
@@ -1,2 +1,3 @@
|
||||
i18n_vars="/etc/sysconfig/language:RC_LANG-LANG,RC_LC_ALL-LC_ALL /etc/sysconfig/console:CONSOLE_UNICODEMAP-FONT_UNIMAP,CONSOLE_FONT-FONT,CONSOLE_SCREENMAP-FONT_MAP /etc/sysconfig/keyboard:KEYTABLE-KEYMAP"
|
||||
omit_drivers+=" i2o_scsi"
|
||||
|
||||
|
1550
dracut.css
Normal file
1550
dracut.css
Normal file
File diff suppressed because it is too large
Load Diff
189
dracut.spec
189
dracut.spec
@@ -21,8 +21,8 @@ Group: System/Base
|
||||
%endif
|
||||
|
||||
# The entire source code is GPLv2+
|
||||
# except install/* which is LGPLv2.1+
|
||||
License: GPLv2+ and LGPLv2.1+
|
||||
# except install/* which is LGPLv2+
|
||||
License: GPLv2+ and LGPLv2+
|
||||
|
||||
URL: https://dracut.wiki.kernel.org/
|
||||
|
||||
@@ -30,11 +30,17 @@ URL: https://dracut.wiki.kernel.org/
|
||||
# http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%{version};sf=tgz
|
||||
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.bz2
|
||||
|
||||
BuildRequires: dash bash git
|
||||
BuildRequires: bash git
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: pkgconfig
|
||||
%endif
|
||||
%if 0%{?fedora}
|
||||
BuildRequires: bash-completion
|
||||
BuildRequires: pkgconfig
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version}
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
%endif
|
||||
@@ -70,7 +76,11 @@ Provides: mkinitrd = 2.6.1
|
||||
Obsoletes: dracut-kernel < 005
|
||||
Provides: dracut-kernel = %{version}-%{release}
|
||||
|
||||
Requires: bash
|
||||
Obsoletes: dracut <= 029
|
||||
Obsoletes: dracut-norescue
|
||||
Provides: dracut-norescue
|
||||
|
||||
Requires: bash >= 4
|
||||
Requires: coreutils
|
||||
Requires: cpio
|
||||
Requires: filesystem >= 2.1.0
|
||||
@@ -78,14 +88,17 @@ Requires: findutils
|
||||
Requires: grep
|
||||
Requires: hardlink
|
||||
Requires: gzip xz
|
||||
Requires: module-init-tools >= 3.7-9
|
||||
Requires: kmod
|
||||
Requires: sed
|
||||
Requires: file
|
||||
Requires: udev > 166
|
||||
Requires: kpartx
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||
Requires: util-linux >= 2.21
|
||||
Conflicts: systemd < 187
|
||||
Requires: systemd >= 199
|
||||
Requires: procps-ng
|
||||
Conflicts: grubby < 8.23
|
||||
%else
|
||||
Requires: udev > 166
|
||||
Requires: util-linux-ng >= 2.21
|
||||
%endif
|
||||
|
||||
@@ -94,16 +107,21 @@ Conflicts: initscripts < 8.63-1
|
||||
Conflicts: plymouth < 0.8.0-0.2009.29.09.19.1
|
||||
%endif
|
||||
|
||||
Conflicts: mdadm < 3.2.6-14
|
||||
|
||||
%description
|
||||
Dracut contains tools to create a bootable initramfs for 2.6 Linux kernels.
|
||||
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
|
||||
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
|
||||
Summary: dracut modules to build a dracut initramfs with network support
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: iputils
|
||||
Requires: iproute
|
||||
Requires: dhclient
|
||||
Obsoletes: dracut-generic < 008
|
||||
Provides: dracut-generic = %{version}-%{release}
|
||||
|
||||
@@ -113,7 +131,7 @@ 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
|
||||
Summary: dracut modules to build a dracut initramfs with an integrity check
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: hmaccalc
|
||||
%if 0%{?rhel} > 5
|
||||
@@ -126,29 +144,47 @@ Requires: nss-softokn-freebl
|
||||
|
||||
%description fips
|
||||
This package requires everything which is needed to build an
|
||||
all purpose initramfs with dracut, which does an integrity check.
|
||||
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
|
||||
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
|
||||
all purpose initramfs with dracut, which does an integrity check
|
||||
and adds the aesni-intel kernel module.
|
||||
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
|
||||
Summary: dracut modules to build a dracut initramfs which drops capabilities
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: libcap
|
||||
|
||||
%description caps
|
||||
This package requires everything which is needed to build an
|
||||
all purpose initramfs with dracut, which drops capabilities.
|
||||
initramfs with dracut, which drops capabilities.
|
||||
|
||||
%package config-generic
|
||||
Summary: dracut configuration to turn off hostonly image generation
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Obsoletes: dracut-nohostonly
|
||||
Provides: dracut-nohostonly
|
||||
|
||||
%description config-generic
|
||||
This package provides the configuration to turn off the host specific initramfs
|
||||
generation with dracut and generates a generic image by default.
|
||||
|
||||
%package config-rescue
|
||||
Summary: dracut configuration to turn on rescue image generation
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Obsoletes: dracut <= 029
|
||||
|
||||
%description config-rescue
|
||||
This package provides the configuration to turn on the rescue initramfs
|
||||
generation with dracut.
|
||||
|
||||
%package tools
|
||||
Summary: Dracut tools to build the local initramfs
|
||||
Summary: dracut tools to build the local initramfs
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description tools
|
||||
@@ -169,39 +205,41 @@ git am -p1 %{patches}
|
||||
%endif
|
||||
|
||||
%build
|
||||
make all
|
||||
%configure --systemdsystemunitdir=%{_unitdir} --bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) --libdir=%{_prefix}/lib
|
||||
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
rm -rf -- $RPM_BUILD_ROOT
|
||||
%endif
|
||||
make install DESTDIR=$RPM_BUILD_ROOT \
|
||||
libdir=%{_prefix}/lib \
|
||||
bindir=%{_bindir} \
|
||||
%if %{defined _unitdir}
|
||||
systemdsystemunitdir=%{_unitdir} \
|
||||
%endif
|
||||
sysconfdir=/etc mandir=%{_mandir}
|
||||
make %{?_smp_mflags} install \
|
||||
DESTDIR=$RPM_BUILD_ROOT \
|
||||
libdir=%{_prefix}/lib
|
||||
|
||||
echo "DRACUT_VERSION=%{version}-%{release}" > $RPM_BUILD_ROOT/%{dracutlibdir}/dracut-version.sh
|
||||
|
||||
%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
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/01fips
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/02fips-aesni
|
||||
%endif
|
||||
|
||||
%if %{defined _unitdir}
|
||||
# for systemd, better use systemd-bootchart
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00bootchart
|
||||
%endif
|
||||
|
||||
# we do not support dash in the initramfs
|
||||
rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00dash
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00dash
|
||||
|
||||
# remove gentoo specific modules
|
||||
rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/50gensplash
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/50gensplash
|
||||
|
||||
%if %{defined _unitdir}
|
||||
# with systemd IMA and selinux modules do not make sense
|
||||
rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/96securityfs
|
||||
rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/97masterkey
|
||||
rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/98integrity
|
||||
rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/98selinux
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/96securityfs
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/97masterkey
|
||||
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/98integrity
|
||||
%endif
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/boot/dracut
|
||||
@@ -211,28 +249,34 @@ touch $RPM_BUILD_ROOT%{_localstatedir}/log/dracut.log
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/initramfs
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
|
||||
install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/01-dist.conf
|
||||
install -m 0644 dracut.conf.d/fips.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/40-fips.conf
|
||||
install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf
|
||||
install -m 0644 dracut.conf.d/fips.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/40-fips.conf
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version}
|
||||
install -m 0644 dracut.conf.d/suse.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/01-dist.conf
|
||||
install -m 0644 dracut.conf.d/suse.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} <= 12 && 0%{?rhel} < 6 && 0%{?suse_version} <= 9999
|
||||
rm $RPM_BUILD_ROOT%{_bindir}/mkinitrd
|
||||
rm $RPM_BUILD_ROOT%{_bindir}/lsinitrd
|
||||
rm -f -- $RPM_BUILD_ROOT%{_bindir}/mkinitrd
|
||||
rm -f -- $RPM_BUILD_ROOT%{_bindir}/lsinitrd
|
||||
%endif
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
|
||||
install -m 0644 dracut.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/dracut_log
|
||||
%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
|
||||
|
||||
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
|
||||
|
||||
# create compat symlink
|
||||
mkdir -p $RPM_BUILD_ROOT/sbin
|
||||
ln -s /usr/bin/dracut $RPM_BUILD_ROOT/sbin/dracut
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
rm -rf -- $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,0755)
|
||||
@@ -240,6 +284,8 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_bindir}/dracut
|
||||
# compat symlink
|
||||
/sbin/dracut
|
||||
%{_datadir}/bash-completion/completions/dracut
|
||||
%{_datadir}/bash-completion/completions/lsinitrd
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
|
||||
%{_bindir}/mkinitrd
|
||||
%{_bindir}/lsinitrd
|
||||
@@ -252,27 +298,39 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{dracutlibdir}/dracut-logger.sh
|
||||
%{dracutlibdir}/dracut-initramfs-restore
|
||||
%{dracutlibdir}/dracut-install
|
||||
%config(noreplace) /etc/dracut.conf
|
||||
%config(noreplace) %{_sysconfdir}/dracut.conf
|
||||
%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel}
|
||||
%config /etc/dracut.conf.d/01-dist.conf
|
||||
%{dracutlibdir}/dracut.conf.d/01-dist.conf
|
||||
%endif
|
||||
%dir /etc/dracut.conf.d
|
||||
%dir %{_sysconfdir}/dracut.conf.d
|
||||
%dir %{dracutlibdir}/dracut.conf.d
|
||||
%{_mandir}/man8/dracut.8*
|
||||
%{_mandir}/man8/*service.8*
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
|
||||
%{_mandir}/man8/mkinitrd.8*
|
||||
%{_mandir}/man1/lsinitrd.1*
|
||||
%endif
|
||||
%{_mandir}/man7/dracut.kernel.7*
|
||||
%{_mandir}/man7/dracut.cmdline.7*
|
||||
%{_mandir}/man7/dracut.bootup.7*
|
||||
%{_mandir}/man5/dracut.conf.5*
|
||||
%if %{defined _unitdir}
|
||||
%{dracutlibdir}/modules.d/00systemd-bootchart
|
||||
%else
|
||||
%{dracutlibdir}/modules.d/00bootchart
|
||||
%endif
|
||||
%{dracutlibdir}/modules.d/00bash
|
||||
%{dracutlibdir}/modules.d/03modsign
|
||||
%{dracutlibdir}/modules.d/03rescue
|
||||
%{dracutlibdir}/modules.d/04watchdog
|
||||
%{dracutlibdir}/modules.d/05busybox
|
||||
%{dracutlibdir}/modules.d/10i18n
|
||||
%{dracutlibdir}/modules.d/30convertfs
|
||||
%{dracutlibdir}/modules.d/45url-lib
|
||||
%{dracutlibdir}/modules.d/50drm
|
||||
%{dracutlibdir}/modules.d/50plymouth
|
||||
%{dracutlibdir}/modules.d/80cms
|
||||
%{dracutlibdir}/modules.d/90bcache
|
||||
%{dracutlibdir}/modules.d/90btrfs
|
||||
%{dracutlibdir}/modules.d/90crypt
|
||||
%{dracutlibdir}/modules.d/90dm
|
||||
@@ -284,6 +342,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{dracutlibdir}/modules.d/90multipath
|
||||
%{dracutlibdir}/modules.d/90qemu
|
||||
%{dracutlibdir}/modules.d/91crypt-gpg
|
||||
%{dracutlibdir}/modules.d/91crypt-loop
|
||||
%{dracutlibdir}/modules.d/95debug
|
||||
%{dracutlibdir}/modules.d/95resume
|
||||
%{dracutlibdir}/modules.d/95rootfs-block
|
||||
@@ -297,12 +356,12 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%if %{undefined _unitdir}
|
||||
%{dracutlibdir}/modules.d/96securityfs
|
||||
%{dracutlibdir}/modules.d/97masterkey
|
||||
%{dracutlibdir}/modules.d/98selinux
|
||||
%{dracutlibdir}/modules.d/98integrity
|
||||
%endif
|
||||
%{dracutlibdir}/modules.d/97biosdevname
|
||||
%{dracutlibdir}/modules.d/98ecryptfs
|
||||
%{dracutlibdir}/modules.d/98pollcdrom
|
||||
%{dracutlibdir}/modules.d/98selinux
|
||||
%{dracutlibdir}/modules.d/98syslog
|
||||
%{dracutlibdir}/modules.d/98systemd
|
||||
%{dracutlibdir}/modules.d/98usrmount
|
||||
@@ -310,12 +369,29 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{dracutlibdir}/modules.d/99fs-lib
|
||||
%{dracutlibdir}/modules.d/99img-lib
|
||||
%{dracutlibdir}/modules.d/99shutdown
|
||||
%config(noreplace) /etc/logrotate.d/dracut_log
|
||||
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
|
||||
%dir %{_sharedstatedir}/initramfs
|
||||
%if %{defined _unitdir}
|
||||
%{_unitdir}/dracut-shutdown.service
|
||||
%{_unitdir}/shutdown.target.wants/dracut-shutdown.service
|
||||
%{_unitdir}/dracut-cmdline.service
|
||||
%{_unitdir}/dracut-initqueue.service
|
||||
%{_unitdir}/dracut-mount.service
|
||||
%{_unitdir}/dracut-pre-mount.service
|
||||
%{_unitdir}/dracut-pre-pivot.service
|
||||
%{_unitdir}/dracut-pre-trigger.service
|
||||
%{_unitdir}/dracut-pre-udev.service
|
||||
%{_unitdir}/initrd.target.wants/dracut-cmdline.service
|
||||
%{_unitdir}/initrd.target.wants/dracut-initqueue.service
|
||||
%{_unitdir}/initrd.target.wants/dracut-mount.service
|
||||
%{_unitdir}/initrd.target.wants/dracut-pre-mount.service
|
||||
%{_unitdir}/initrd.target.wants/dracut-pre-pivot.service
|
||||
%{_unitdir}/initrd.target.wants/dracut-pre-trigger.service
|
||||
%{_unitdir}/initrd.target.wants/dracut-pre-udev.service
|
||||
|
||||
%endif
|
||||
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||
%{_prefix}/lib/kernel/install.d/50-dracut.install
|
||||
%endif
|
||||
|
||||
%files network
|
||||
@@ -325,6 +401,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{dracutlibdir}/modules.d/95iscsi
|
||||
%{dracutlibdir}/modules.d/90livenet
|
||||
%{dracutlibdir}/modules.d/90qemu-net
|
||||
%{dracutlibdir}/modules.d/95cifs
|
||||
%{dracutlibdir}/modules.d/95nbd
|
||||
%{dracutlibdir}/modules.d/95nfs
|
||||
%{dracutlibdir}/modules.d/95ssh-client
|
||||
@@ -335,7 +412,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%files fips
|
||||
%defattr(-,root,root,0755)
|
||||
%{dracutlibdir}/modules.d/01fips
|
||||
%config(noreplace) /etc/dracut.conf.d/40-fips.conf
|
||||
%{dracutlibdir}/dracut.conf.d/40-fips.conf
|
||||
%endif
|
||||
|
||||
%files fips-aesni
|
||||
@@ -355,4 +432,16 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%dir /var/lib/dracut
|
||||
%dir /var/lib/dracut/overlay
|
||||
|
||||
%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
|
||||
%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install
|
||||
%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
19
git2spec.pl
19
git2spec.pl
@@ -1,21 +1,5 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
sub last_tag {
|
||||
open( GIT, 'git log --pretty=format:%H |');
|
||||
LINE: while( <GIT> ) {
|
||||
open( GIT2, "git tag --contains $_ |");
|
||||
while( <GIT2> ) {
|
||||
chomp;
|
||||
last LINE if /..*/;
|
||||
}
|
||||
close GIT2;
|
||||
}
|
||||
$tag=$_;
|
||||
close GIT2;
|
||||
close GIT; # be done
|
||||
return $tag;
|
||||
};
|
||||
|
||||
sub create_patches {
|
||||
my $tag=shift;
|
||||
my $pdir=shift;
|
||||
@@ -31,7 +15,8 @@ my $datestr = strftime "%Y%m%d", gmtime;
|
||||
|
||||
my $tag=shift;
|
||||
my $pdir=shift;
|
||||
$tag=&last_tag if not defined $tag;
|
||||
$tag=`git describe --abbrev=0 --tags` if not defined $tag;
|
||||
chomp($tag);
|
||||
my @patches=&create_patches($tag, $pdir);
|
||||
my $num=$#patches + 2;
|
||||
$tag=~s/[^0-9]+?([0-9]+)/$1/;
|
||||
|
@@ -62,9 +62,13 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
static size_t dir_len(char const *file)
|
||||
{
|
||||
size_t length;
|
||||
|
||||
if(!file)
|
||||
return 0;
|
||||
|
||||
/* Strip the basename and any redundant slashes before it. */
|
||||
for (length = strlen(file); 0 < length; length--)
|
||||
if (file[length] == '/')
|
||||
for (length = strlen(file)-1; 0 < length; length--)
|
||||
if (file[length] == '/' && file[length-1] != '/')
|
||||
break;
|
||||
return length;
|
||||
}
|
||||
@@ -73,27 +77,38 @@ static char *convert_abs_rel(const char *from, const char *target)
|
||||
{
|
||||
/* we use the 4*MAXPATHLEN, which should not overrun */
|
||||
char relative_from[MAXPATHLEN * 4];
|
||||
char *realtarget = NULL;
|
||||
char *p, *q;
|
||||
_cleanup_free_ char *realtarget = NULL;
|
||||
_cleanup_free_ char *target_dir_p = NULL, *realpath_p = NULL;
|
||||
const char *realfrom = from;
|
||||
int level = 0, fromlevel = 0, targetlevel = 0;
|
||||
int l, i, rl;
|
||||
int dirlen;
|
||||
size_t level = 0, fromlevel = 0, targetlevel = 0;
|
||||
int l;
|
||||
size_t i, rl, dirlen;
|
||||
int ret;
|
||||
|
||||
p = strdup(target);
|
||||
dirlen = dir_len(p);
|
||||
p[dirlen] = '\0';
|
||||
q = realpath(p, NULL);
|
||||
target_dir_p = strdup(target);
|
||||
if (!target_dir_p)
|
||||
return strdup(from);
|
||||
|
||||
if (q == NULL) {
|
||||
free(p);
|
||||
dirlen = dir_len(target_dir_p);
|
||||
target_dir_p[dirlen] = '\0';
|
||||
realpath_p = realpath(target_dir_p, NULL);
|
||||
|
||||
if (realpath_p == NULL) {
|
||||
log_warning("convert_abs_rel(): target '%s' directory has no realpath.", target);
|
||||
return strdup(from);
|
||||
}
|
||||
|
||||
asprintf(&realtarget, "%s/%s", q, &p[dirlen + 1]);
|
||||
free(p);
|
||||
free(q);
|
||||
/* dir_len() skips double /'s e.g. //lib64, so we can't skip just one
|
||||
* character - need to skip all leading /'s */
|
||||
rl = strlen(target);
|
||||
for (i = dirlen+1; i < rl; ++i)
|
||||
if (target_dir_p[i] != '/')
|
||||
break;
|
||||
ret = asprintf(&realtarget, "%s/%s", realpath_p, &target_dir_p[i]);
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* now calculate the relative path from <from> to <target> and
|
||||
store it in <relative_from>
|
||||
@@ -116,8 +131,6 @@ static char *convert_abs_rel(const char *from, const char *target)
|
||||
if (realtarget[i] == '/')
|
||||
level++;
|
||||
|
||||
free(realtarget);
|
||||
|
||||
/* add "../" to the relative_from path, until the common pathname is
|
||||
reached */
|
||||
for (i = level; i < targetlevel; i++) {
|
||||
@@ -149,18 +162,16 @@ static char *convert_abs_rel(const char *from, const char *target)
|
||||
static int ln_r(const char *src, const char *dst)
|
||||
{
|
||||
int ret;
|
||||
const char *points_to = convert_abs_rel(src, dst);
|
||||
_cleanup_free_ const char *points_to = convert_abs_rel(src, dst);
|
||||
|
||||
log_info("ln -s '%s' '%s'", points_to, dst);
|
||||
ret = symlink(points_to, dst);
|
||||
|
||||
if (ret != 0) {
|
||||
log_error("ERROR: ln -s '%s' '%s': %m", points_to, dst);
|
||||
free((char *)points_to);
|
||||
return 1;
|
||||
}
|
||||
|
||||
free((char *)points_to);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -180,11 +191,11 @@ static bool use_clone = true;
|
||||
static int cp(const char *src, const char *dst)
|
||||
{
|
||||
int pid;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
if (use_clone) {
|
||||
struct stat sb;
|
||||
int dest_desc, source_desc;
|
||||
_cleanup_close_ int dest_desc = -1, source_desc = -1;
|
||||
|
||||
if (lstat(src, &sb) != 0)
|
||||
goto normal_copy;
|
||||
@@ -201,20 +212,24 @@ static int cp(const char *src, const char *dst)
|
||||
(sb.st_mode) & (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO));
|
||||
|
||||
if (dest_desc < 0) {
|
||||
close(source_desc);
|
||||
goto normal_copy;
|
||||
}
|
||||
|
||||
ret = clone_file(dest_desc, source_desc);
|
||||
close(source_desc);
|
||||
|
||||
if (ret == 0) {
|
||||
struct timeval tv[2];
|
||||
if (fchown(dest_desc, sb.st_uid, sb.st_gid) != 0)
|
||||
fchown(dest_desc, -1, sb.st_gid);
|
||||
close(dest_desc);
|
||||
fchown(dest_desc, (__uid_t)-1, sb.st_gid);
|
||||
tv[0].tv_sec = sb.st_atime;
|
||||
tv[0].tv_usec = 0;
|
||||
tv[1].tv_sec = sb.st_mtime;
|
||||
tv[1].tv_usec = 0;
|
||||
futimes(dest_desc, tv);
|
||||
return ret;
|
||||
}
|
||||
close(dest_desc);
|
||||
|
||||
dest_desc = -1;
|
||||
/* clone did not work, remove the file */
|
||||
unlink(dst);
|
||||
/* do not try clone again */
|
||||
@@ -224,16 +239,83 @@ static int cp(const char *src, const char *dst)
|
||||
normal_copy:
|
||||
pid = fork();
|
||||
if (pid == 0) {
|
||||
execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode", "-fL", src, dst, NULL);
|
||||
execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode,timestamps", "-fL", src, dst, NULL);
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
while (waitpid(pid, &ret, 0) < 0) {
|
||||
if (errno != EINTR) {
|
||||
ret = -1;
|
||||
log_error("Failed: cp --reflink=auto --sparse=auto --preserve=mode,timestamps -fL %s %s", src, dst);
|
||||
break;
|
||||
}
|
||||
}
|
||||
log_debug("cp ret = %d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int library_install(const char *src, const char *lib)
|
||||
{
|
||||
_cleanup_free_ char *p = NULL;
|
||||
_cleanup_free_ char *pdir = NULL, *ppdir = NULL, *clib = NULL;
|
||||
char *q;
|
||||
int r, ret = 0;
|
||||
|
||||
p = strdup(lib);
|
||||
|
||||
r = dracut_install(p, p, false, false, true);
|
||||
if (r != 0)
|
||||
log_error("ERROR: failed to install '%s' for '%s'", p, src);
|
||||
else
|
||||
log_debug("Lib install: '%s'", p);
|
||||
ret += r;
|
||||
|
||||
/* also install lib.so for lib.so.* files */
|
||||
q = strstr(p, ".so.");
|
||||
if (q) {
|
||||
q[3] = '\0';
|
||||
|
||||
/* ignore errors for base lib symlink */
|
||||
if (dracut_install(p, p, false, false, true) == 0)
|
||||
log_debug("Lib install: '%s'", p);
|
||||
}
|
||||
|
||||
/* Also try to install the same library from one directory above.
|
||||
This fixes the case, where only the HWCAP lib would be installed
|
||||
# ldconfig -p|fgrep libc.so
|
||||
libc.so.6 (libc6,64bit, hwcap: 0x0000001000000000, OS ABI: Linux 2.6.32) => /lib64/power6/libc.so.6
|
||||
libc.so.6 (libc6,64bit, hwcap: 0x0000000000000200, OS ABI: Linux 2.6.32) => /lib64/power6x/libc.so.6
|
||||
libc.so.6 (libc6,64bit, OS ABI: Linux 2.6.32) => /lib64/libc.so.6
|
||||
*/
|
||||
|
||||
free(p);
|
||||
p = strdup(lib);
|
||||
|
||||
pdir = dirname(p);
|
||||
if (!pdir)
|
||||
return ret;
|
||||
|
||||
pdir = strdup(pdir);
|
||||
ppdir = dirname(pdir);
|
||||
if (!ppdir)
|
||||
return ret;
|
||||
|
||||
ppdir = strdup(ppdir);
|
||||
|
||||
strcpy(p, lib);
|
||||
|
||||
clib = strjoin(ppdir, "/", basename(p), NULL);
|
||||
if (dracut_install(clib, clib, false, false, true) == 0)
|
||||
log_debug("Lib install: '%s'", clib);
|
||||
/* also install lib.so for lib.so.* files */
|
||||
q = strstr(clib, ".so.");
|
||||
if (q) {
|
||||
q[3] = '\0';
|
||||
|
||||
/* ignore errors for base lib symlink */
|
||||
if (dracut_install(clib, clib, false, false, true) == 0)
|
||||
log_debug("Lib install: '%s'", p);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -242,17 +324,19 @@ static int resolve_deps(const char *src)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
char *buf = malloc(LINE_MAX);
|
||||
_cleanup_free_ char *buf = malloc(LINE_MAX);
|
||||
size_t linesize = LINE_MAX;
|
||||
FILE *fptr;
|
||||
char *cmd;
|
||||
_cleanup_pclose_ FILE *fptr = NULL;
|
||||
_cleanup_free_ char *cmd = NULL;
|
||||
|
||||
if (strstr(src, ".so") == 0) {
|
||||
int fd;
|
||||
_cleanup_close_ int fd = -1;
|
||||
fd = open(src, O_RDONLY | O_CLOEXEC);
|
||||
if (fd < 0)
|
||||
return -errno;
|
||||
|
||||
read(fd, buf, LINE_MAX);
|
||||
buf[LINE_MAX - 1] = '\0';
|
||||
close(fd);
|
||||
if (buf[0] == '#' && buf[1] == '!') {
|
||||
/* we have a shebang */
|
||||
char *p, *q;
|
||||
@@ -268,7 +352,14 @@ static int resolve_deps(const char *src)
|
||||
}
|
||||
|
||||
/* run ldd */
|
||||
asprintf(&cmd, "ldd %s 2>&1", src);
|
||||
ret = asprintf(&cmd, "ldd %s 2>&1", src);
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
||||
fptr = popen(cmd, "r");
|
||||
|
||||
while (!feof(fptr)) {
|
||||
@@ -279,75 +370,105 @@ static int resolve_deps(const char *src)
|
||||
|
||||
log_debug("ldd: '%s'", buf);
|
||||
|
||||
if (strstr(buf, "you do not have execution permission")) {
|
||||
log_error("%s", buf);
|
||||
ret+=1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (strstr(buf, "not a dynamic executable"))
|
||||
break;
|
||||
|
||||
if (strstr(buf, "loader cannot load itself"))
|
||||
break;
|
||||
|
||||
p = strstr(buf, "/");
|
||||
if (strstr(buf, "not regular file"))
|
||||
break;
|
||||
|
||||
if (strstr(buf, "cannot read header"))
|
||||
break;
|
||||
|
||||
if (strstr(buf, destrootdir))
|
||||
break;
|
||||
|
||||
p = strchr(buf, '/');
|
||||
if (p) {
|
||||
int r;
|
||||
for (q = p; *q && *q != ' ' && *q != '\n'; q++) ;
|
||||
*q = '\0';
|
||||
r = dracut_install(p, p, false, false, true);
|
||||
if (r != 0)
|
||||
log_error("ERROR: failed to install '%s' for '%s'", p, src);
|
||||
else
|
||||
log_debug("Lib install: '%s'", p);
|
||||
ret += r;
|
||||
|
||||
/* also install lib.so for lib.so.* files */
|
||||
q = strstr(p, ".so.");
|
||||
if (q) {
|
||||
q += 3;
|
||||
*q = '\0';
|
||||
ret += library_install(src, p);
|
||||
|
||||
/* ignore errors for base lib symlink */
|
||||
if (dracut_install(p, p, false, false, true) == 0)
|
||||
log_debug("Lib install: '%s'", p);
|
||||
}
|
||||
}
|
||||
}
|
||||
pclose(fptr);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Install ".<filename>.hmac" file for FIPS self-checks */
|
||||
static int hmac_install(const char *src, const char *dst)
|
||||
static int hmac_install(const char *src, const char *dst, const char *hmacpath)
|
||||
{
|
||||
char *srcpath = strdup(src);
|
||||
char *dstpath = strdup(dst);
|
||||
char *srchmacname = NULL;
|
||||
char *dsthmacname = NULL;
|
||||
_cleanup_free_ char *srcpath = strdup(src);
|
||||
_cleanup_free_ char *dstpath = strdup(dst);
|
||||
_cleanup_free_ char *srchmacname = NULL;
|
||||
_cleanup_free_ char *dsthmacname = NULL;
|
||||
int ret;
|
||||
|
||||
if (!(srcpath && dstpath))
|
||||
return -ENOMEM;
|
||||
|
||||
size_t dlen = dir_len(src);
|
||||
|
||||
if (endswith(src, ".hmac"))
|
||||
return 0;
|
||||
|
||||
if (!hmacpath) {
|
||||
hmac_install(src, dst, "/lib/fipscheck");
|
||||
hmac_install(src, dst, "/lib64/fipscheck");
|
||||
hmac_install(src, dst, "/lib/hmaccalc");
|
||||
hmac_install(src, dst, "/lib64/hmaccalc");
|
||||
}
|
||||
|
||||
srcpath[dlen] = '\0';
|
||||
dstpath[dir_len(dst)] = '\0';
|
||||
asprintf(&srchmacname, "%s/.%s.hmac", srcpath, &src[dlen + 1]);
|
||||
asprintf(&dsthmacname, "%s/.%s.hmac", dstpath, &src[dlen + 1]);
|
||||
if (hmacpath) {
|
||||
ret = asprintf(&srchmacname, "%s/%s.hmac", hmacpath, &src[dlen + 1]);
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
ret = asprintf(&dsthmacname, "%s/%s.hmac", hmacpath, &src[dlen + 1]);
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
} else {
|
||||
ret = asprintf(&srchmacname, "%s/.%s.hmac", srcpath, &src[dlen + 1]);
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
ret = asprintf(&dsthmacname, "%s/.%s.hmac", dstpath, &src[dlen + 1]);
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
log_debug("hmac cp '%s' '%s')", srchmacname, dsthmacname);
|
||||
dracut_install(srchmacname, dsthmacname, false, false, true);
|
||||
free(dsthmacname);
|
||||
free(srchmacname);
|
||||
free(srcpath);
|
||||
free(dstpath);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dracut_install(const char *src, const char *dst, bool isdir, bool resolvedeps, bool hashdst)
|
||||
{
|
||||
struct stat sb, db;
|
||||
char *dname = NULL;
|
||||
char *fulldstpath = NULL;
|
||||
char *fulldstdir = NULL;
|
||||
_cleanup_free_ char *fulldstpath = NULL;
|
||||
_cleanup_free_ char *fulldstdir = NULL;
|
||||
int ret;
|
||||
bool src_exists = true;
|
||||
char *i, *existing;
|
||||
char *i = NULL;
|
||||
char *existing;
|
||||
|
||||
log_debug("dracut_install('%s', '%s')", src, dst);
|
||||
|
||||
@@ -380,9 +501,16 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
}
|
||||
|
||||
i = strdup(dst);
|
||||
if (!i)
|
||||
return -ENOMEM;
|
||||
|
||||
hashmap_put(items, i, i);
|
||||
|
||||
asprintf(&fulldstpath, "%s%s", destrootdir, dst);
|
||||
ret = asprintf(&fulldstpath, "%s%s", destrootdir, dst);
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
ret = stat(fulldstpath, &sb);
|
||||
|
||||
@@ -392,10 +520,14 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
}
|
||||
|
||||
if (ret == 0) {
|
||||
log_debug("'%s' already exists", fulldstpath);
|
||||
free(fulldstpath);
|
||||
if (resolvedeps && S_ISREG(sb.st_mode) && (sb.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) {
|
||||
log_debug("'%s' already exists, but checking for any deps", fulldstpath);
|
||||
ret = resolve_deps(src);
|
||||
} else
|
||||
log_debug("'%s' already exists", fulldstpath);
|
||||
|
||||
/* dst does already exist */
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* check destination directory */
|
||||
@@ -405,6 +537,8 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
ret = stat(fulldstdir, &db);
|
||||
|
||||
if (ret < 0) {
|
||||
_cleanup_free_ char *dname = NULL;
|
||||
|
||||
if (errno != ENOENT) {
|
||||
log_error("ERROR: stat '%s': %m", fulldstdir);
|
||||
return 1;
|
||||
@@ -412,35 +546,34 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
/* create destination directory */
|
||||
log_debug("dest dir '%s' does not exist", fulldstdir);
|
||||
dname = strdup(dst);
|
||||
if (!dname)
|
||||
return 1;
|
||||
|
||||
dname[dir_len(dname)] = '\0';
|
||||
ret = dracut_install(dname, dname, true, false, true);
|
||||
|
||||
free(dname);
|
||||
|
||||
if (ret != 0) {
|
||||
log_error("ERROR: failed to create directory '%s'", fulldstdir);
|
||||
free(fulldstdir);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
free(fulldstdir);
|
||||
|
||||
if (isdir && !src_exists) {
|
||||
log_info("mkdir '%s'", fulldstpath);
|
||||
return mkdir(fulldstpath, 0755);
|
||||
ret = mkdir(fulldstpath, 0755);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* ready to install src */
|
||||
|
||||
if (S_ISDIR(sb.st_mode)) {
|
||||
log_info("mkdir '%s'", fulldstpath);
|
||||
return mkdir(fulldstpath, sb.st_mode | S_IWUSR);
|
||||
ret = mkdir(fulldstpath, sb.st_mode | S_IWUSR);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (S_ISLNK(sb.st_mode)) {
|
||||
char *abspath;
|
||||
char *absdestpath = NULL;
|
||||
_cleanup_free_ char *abspath = NULL;
|
||||
|
||||
abspath = realpath(src, NULL);
|
||||
|
||||
@@ -458,18 +591,20 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
}
|
||||
|
||||
if (lstat(fulldstpath, &sb) != 0) {
|
||||
_cleanup_free_ char *absdestpath = NULL;
|
||||
|
||||
asprintf(&absdestpath, "%s%s", destrootdir, abspath);
|
||||
ret = asprintf(&absdestpath, "%s%s", destrootdir, abspath);
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
ln_r(absdestpath, fulldstpath);
|
||||
|
||||
free(absdestpath);
|
||||
}
|
||||
|
||||
free(abspath);
|
||||
if (arg_hmac) {
|
||||
/* copy .hmac files also */
|
||||
hmac_install(src, dst);
|
||||
hmac_install(src, dst, NULL);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -480,12 +615,16 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
ret += resolve_deps(src);
|
||||
if (arg_hmac) {
|
||||
/* copy .hmac files also */
|
||||
hmac_install(src, dst);
|
||||
hmac_install(src, dst, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
log_debug("dracut_install ret = %d", ret);
|
||||
log_info("cp '%s' '%s'", src, fulldstpath);
|
||||
ret += cp(src, fulldstpath);
|
||||
|
||||
log_debug("dracut_install ret = %d", ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -496,48 +635,49 @@ static void item_free(char *i)
|
||||
}
|
||||
|
||||
static void usage(int status)
|
||||
{
|
||||
/* */
|
||||
printf("\
|
||||
Usage: %s -D DESTROOTDIR [OPTION]... -a SOURCE...\n\
|
||||
or: %s -D DESTROOTDIR [OPTION]... SOURCE DEST\n\
|
||||
\n\
|
||||
Install SOURCE to DEST in DESTROOTDIR with all needed dependencies.\n\
|
||||
\n\
|
||||
-D --destrootdir Install all files to DESTROOTDIR as the root\n\
|
||||
-a --all Install all SOURCE arguments to DESTROOTDIR\n\
|
||||
-o --optional If SOURCE does not exist, do not fail\n\
|
||||
-d --dir SOURCE is a directory\n\
|
||||
-l --ldd Also install shebang executables and libraries\n\
|
||||
-R --resolvelazy Only install shebang executables and libraries for all SOURCE files\n\
|
||||
-f --fips Also install all '.SOURCE.hmac' files\n\
|
||||
-v --verbose Show more output\n\
|
||||
--debug Show debug output\n\
|
||||
--version Show package version\n\
|
||||
-h --help Show this help\n\
|
||||
\n\
|
||||
Example:\n\
|
||||
# %s -D /var/tmp/test-root --ldd -a sh tr\n\
|
||||
# tree /var/tmp/test-root\n\
|
||||
/var/tmp/test-root\n\
|
||||
|-- lib64 -> usr/lib64\n\
|
||||
`-- usr\n\
|
||||
|-- bin\n\
|
||||
| |-- bash\n\
|
||||
| |-- sh -> bash\n\
|
||||
| `-- tr\n\
|
||||
`-- lib64\n\
|
||||
|-- ld-2.15.90.so\n\
|
||||
|-- ld-linux-x86-64.so.2 -> ld-2.15.90.so\n\
|
||||
|-- libc-2.15.90.so\n\
|
||||
|-- libc.so\n\
|
||||
|-- libc.so.6 -> libc-2.15.90.so\n\
|
||||
|-- libdl-2.15.90.so\n\
|
||||
|-- libdl.so -> libdl-2.15.90.so\n\
|
||||
|-- libdl.so.2 -> libdl-2.15.90.so\n\
|
||||
|-- libtinfo.so.5 -> libtinfo.so.5.9\n\
|
||||
`-- libtinfo.so.5.9\n\
|
||||
", program_invocation_short_name, program_invocation_short_name, program_invocation_short_name);
|
||||
{
|
||||
/* */
|
||||
printf("Usage: %s -D DESTROOTDIR [OPTION]... -a SOURCE...\n"
|
||||
"or: %s -D DESTROOTDIR [OPTION]... SOURCE DEST\n"
|
||||
"\n"
|
||||
"Install SOURCE to DEST in DESTROOTDIR with all needed dependencies.\n"
|
||||
"\n"
|
||||
" -D --destrootdir Install all files to DESTROOTDIR as the root\n"
|
||||
" -a --all Install all SOURCE arguments to DESTROOTDIR\n"
|
||||
" -o --optional If SOURCE does not exist, do not fail\n"
|
||||
" -d --dir SOURCE is a directory\n"
|
||||
" -l --ldd Also install shebang executables and libraries\n"
|
||||
" -R --resolvelazy Only install shebang executables and libraries\n"
|
||||
" for all SOURCE files\n"
|
||||
" -H --fips Also install all '.SOURCE.hmac' files\n"
|
||||
" -v --verbose Show more output\n"
|
||||
" --debug Show debug output\n"
|
||||
" --version Show package version\n"
|
||||
" -h --help Show this help\n"
|
||||
"\n"
|
||||
"Example:\n"
|
||||
"# mkdir -p /var/tmp/test-root\n"
|
||||
"# %s -D /var/tmp/test-root --ldd -a sh tr\n"
|
||||
"# tree /var/tmp/test-root\n"
|
||||
"/var/tmp/test-root\n"
|
||||
"|-- lib64 -> usr/lib64\n"
|
||||
"`-- usr\n"
|
||||
" |-- bin\n"
|
||||
" | |-- bash\n"
|
||||
" | |-- sh -> bash\n"
|
||||
" | `-- tr\n"
|
||||
" `-- lib64\n"
|
||||
" |-- ld-2.15.90.so\n"
|
||||
" |-- ld-linux-x86-64.so.2 -> ld-2.15.90.so\n"
|
||||
" |-- libc-2.15.90.so\n"
|
||||
" |-- libc.so\n"
|
||||
" |-- libc.so.6 -> libc-2.15.90.so\n"
|
||||
" |-- libdl-2.15.90.so\n"
|
||||
" |-- libdl.so -> libdl-2.15.90.so\n"
|
||||
" |-- libdl.so.2 -> libdl-2.15.90.so\n"
|
||||
" |-- libtinfo.so.5 -> libtinfo.so.5.9\n"
|
||||
" `-- libtinfo.so.5.9\n"
|
||||
, program_invocation_short_name, program_invocation_short_name, program_invocation_short_name);
|
||||
exit(status);
|
||||
}
|
||||
|
||||
@@ -550,7 +690,7 @@ static int parse_argv(int argc, char *argv[])
|
||||
ARG_DEBUG
|
||||
};
|
||||
|
||||
static const struct option const options[] = {
|
||||
static struct option const options[] = {
|
||||
{"help", no_argument, NULL, 'h'},
|
||||
{"version", no_argument, NULL, ARG_VERSION},
|
||||
{"dir", no_argument, NULL, 'd'},
|
||||
@@ -565,7 +705,7 @@ static int parse_argv(int argc, char *argv[])
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
while ((c = getopt_long(argc, argv, "adhloD:DHILR", options, NULL)) != -1) {
|
||||
while ((c = getopt_long(argc, argv, "adhloD:HR", options, NULL)) != -1) {
|
||||
switch (c) {
|
||||
case ARG_VERSION:
|
||||
puts(PROGRAM_VERSION_STRING);
|
||||
@@ -616,7 +756,7 @@ static int parse_argv(int argc, char *argv[])
|
||||
static int resolve_lazy(int argc, char **argv)
|
||||
{
|
||||
int i;
|
||||
int destrootdirlen = strlen(destrootdir);
|
||||
size_t destrootdirlen = strlen(destrootdir);
|
||||
int ret = 0;
|
||||
char *item;
|
||||
for (i = 0; i < argc; i++) {
|
||||
@@ -644,63 +784,117 @@ static int resolve_lazy(int argc, char **argv)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static char *find_binary(const char *src)
|
||||
{
|
||||
_cleanup_free_ char *path = NULL;
|
||||
char *p, *q;
|
||||
bool end = false;
|
||||
char *newsrc = NULL;
|
||||
int ret;
|
||||
|
||||
path = getenv("PATH");
|
||||
|
||||
if (path == NULL) {
|
||||
log_error("PATH is not set");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
path = strdup(path);
|
||||
p = path;
|
||||
|
||||
if (path == NULL) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
log_debug("PATH=%s", path);
|
||||
|
||||
do {
|
||||
struct stat sb;
|
||||
|
||||
for (q = p; *q && *q != ':'; q++) ;
|
||||
|
||||
if (*q == '\0')
|
||||
end = true;
|
||||
else
|
||||
*q = '\0';
|
||||
|
||||
ret = asprintf(&newsrc, "%s/%s", p, src);
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
p = q + 1;
|
||||
|
||||
if (stat(newsrc, &sb) != 0) {
|
||||
log_debug("stat(%s) != 0", newsrc);
|
||||
free(newsrc);
|
||||
newsrc = NULL;
|
||||
continue;
|
||||
}
|
||||
|
||||
end = true;
|
||||
|
||||
} while (!end);
|
||||
|
||||
if (newsrc)
|
||||
log_debug("find_binary(%s) == %s", src, newsrc);
|
||||
|
||||
return newsrc;
|
||||
}
|
||||
|
||||
static int install_one(const char *src, const char *dst)
|
||||
{
|
||||
int r = EXIT_SUCCESS;
|
||||
int ret;
|
||||
|
||||
if (strchr(src, '/') == NULL) {
|
||||
char *newsrc = find_binary(src);
|
||||
if (newsrc) {
|
||||
log_debug("dracut_install '%s' '%s'", newsrc, dst);
|
||||
ret = dracut_install(newsrc, dst, arg_createdir, arg_resolvedeps, true);
|
||||
if (ret == 0) {
|
||||
log_debug("dracut_install '%s' '%s' OK", newsrc, dst);
|
||||
}
|
||||
free(newsrc);
|
||||
} else {
|
||||
ret = -1;
|
||||
}
|
||||
} else {
|
||||
ret = dracut_install(src, dst, arg_createdir, arg_resolvedeps, true);
|
||||
}
|
||||
|
||||
if ((ret != 0) && (!arg_optional)) {
|
||||
log_error("ERROR: installing '%s' to '%s'", src, dst);
|
||||
r = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static int install_all(int argc, char **argv)
|
||||
{
|
||||
int r = 0;
|
||||
int r = EXIT_SUCCESS;
|
||||
int i;
|
||||
for (i = 0; i < argc; i++) {
|
||||
int ret;
|
||||
log_debug("Handle '%s'", argv[i]);
|
||||
|
||||
if (strchr(argv[i], '/') == NULL) {
|
||||
char *path;
|
||||
char *p, *q;
|
||||
bool end = false;
|
||||
path = getenv("PATH");
|
||||
if (path == NULL) {
|
||||
log_error("PATH is not set");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
path = strdup(path);
|
||||
p = path;
|
||||
log_debug("PATH=%s", path);
|
||||
do {
|
||||
char *newsrc = NULL;
|
||||
char *dest;
|
||||
struct stat sb;
|
||||
|
||||
for (q = p; *q && *q != ':'; q++) ;
|
||||
|
||||
if (*q == '\0')
|
||||
end = true;
|
||||
else
|
||||
*q = '\0';
|
||||
|
||||
asprintf(&newsrc, "%s/%s", p, argv[i]);
|
||||
p = q + 1;
|
||||
|
||||
if (stat(newsrc, &sb) != 0) {
|
||||
free(newsrc);
|
||||
ret = -1;
|
||||
continue;
|
||||
}
|
||||
|
||||
dest = strdup(newsrc);
|
||||
|
||||
_cleanup_free_ char *newsrc = find_binary(argv[i]);
|
||||
if (newsrc) {
|
||||
log_debug("dracut_install '%s'", newsrc);
|
||||
ret = dracut_install(newsrc, dest, arg_createdir, arg_resolvedeps, true);
|
||||
ret = dracut_install(newsrc, newsrc, arg_createdir, arg_resolvedeps, true);
|
||||
if (ret == 0) {
|
||||
end = true;
|
||||
log_debug("dracut_install '%s' OK", newsrc);
|
||||
}
|
||||
free(newsrc);
|
||||
free(dest);
|
||||
} while (!end);
|
||||
free(path);
|
||||
} else {
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
} else {
|
||||
char *dest = strdup(argv[i]);
|
||||
_cleanup_free_ char *dest = strdup(argv[i]);
|
||||
ret = dracut_install(argv[i], dest, arg_createdir, arg_resolvedeps, true);
|
||||
free(dest);
|
||||
}
|
||||
|
||||
if ((ret != 0) && (!arg_optional)) {
|
||||
@@ -742,9 +936,17 @@ int main(int argc, char **argv)
|
||||
if (strcmp(destrootdir, "/") == 0) {
|
||||
log_error("Environment DESTROOTDIR or argument -D is set to '/'!");
|
||||
usage(EXIT_FAILURE);
|
||||
|
||||
}
|
||||
|
||||
i = destrootdir;
|
||||
destrootdir = realpath(destrootdir, NULL);
|
||||
if (!destrootdir) {
|
||||
log_error("Environment DESTROOTDIR or argument -D is set to '%s': %m", i);
|
||||
r = EXIT_FAILURE;
|
||||
goto finish;
|
||||
}
|
||||
free(i);
|
||||
|
||||
items = hashmap_new(string_hash_func, string_compare_func);
|
||||
items_failed = hashmap_new(string_hash_func, string_compare_func);
|
||||
|
||||
@@ -775,11 +977,7 @@ int main(int argc, char **argv)
|
||||
r = install_all(argc - optind, &argv[optind]);
|
||||
} else {
|
||||
/* simple "inst src dst" */
|
||||
r = dracut_install(argv[optind], argv[optind + 1], arg_createdir, arg_resolvedeps, true);
|
||||
if ((r != 0) && (!arg_optional)) {
|
||||
log_error("ERROR: installing '%s' to '%s'", argv[optind], argv[optind + 1]);
|
||||
r = EXIT_FAILURE;
|
||||
}
|
||||
r = install_one(argv[optind], argv[optind + 1]);
|
||||
}
|
||||
|
||||
if (arg_optional)
|
||||
|
Binary file not shown.
152
install/macro.h
152
install/macro.h
@@ -1,7 +1,6 @@
|
||||
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
|
||||
|
||||
#ifndef foomacrohfoo
|
||||
#define foomacrohfoo
|
||||
#pragma once
|
||||
|
||||
/***
|
||||
This file is part of systemd.
|
||||
@@ -45,16 +44,38 @@
|
||||
#define _hidden_ __attribute__ ((visibility("hidden")))
|
||||
#define _weakref_(x) __attribute__((weakref(#x)))
|
||||
#define _introspect_(x) __attribute__((section("introspect." x)))
|
||||
#define _alignas_(x) __attribute__((aligned(__alignof(x))))
|
||||
#define _cleanup_(x) __attribute__((cleanup(x)))
|
||||
|
||||
/* automake test harness */
|
||||
#define EXIT_TEST_SKIP 77
|
||||
|
||||
#define XSTRINGIFY(x) #x
|
||||
#define STRINGIFY(x) XSTRINGIFY(x)
|
||||
|
||||
/* Rounds up */
|
||||
#define ALIGN(l) ALIGN_TO((l), sizeof(void*))
|
||||
|
||||
#define ALIGN4(l) (((l) + 3) & ~3)
|
||||
#define ALIGN8(l) (((l) + 7) & ~7)
|
||||
|
||||
#if __SIZEOF_POINTER__ == 8
|
||||
#define ALIGN(l) ALIGN8(l)
|
||||
#elif __SIZEOF_POINTER__ == 4
|
||||
#define ALIGN(l) ALIGN4(l)
|
||||
#else
|
||||
#error "Wut? Pointers are neither 4 nor 8 bytes long?"
|
||||
#endif
|
||||
|
||||
#define ALIGN_PTR(p) ((void*) ALIGN((unsigned long) p))
|
||||
#define ALIGN4_PTR(p) ((void*) ALIGN4((unsigned long) p))
|
||||
#define ALIGN8_PTR(p) ((void*) ALIGN8((unsigned long) p))
|
||||
|
||||
static inline size_t ALIGN_TO(size_t l, size_t ali) {
|
||||
return ((l + ali - 1) & ~(ali - 1));
|
||||
}
|
||||
|
||||
#define ALIGN_TO_PTR(p, ali) ((void*) ALIGN_TO((unsigned long) p))
|
||||
|
||||
#define ELEMENTSOF(x) (sizeof(x)/sizeof((x)[0]))
|
||||
|
||||
/*
|
||||
@@ -64,34 +85,35 @@ static inline size_t ALIGN_TO(size_t l, size_t ali) {
|
||||
* @member: the name of the member within the struct.
|
||||
*
|
||||
*/
|
||||
#define container_of(ptr, type, member) ({ \
|
||||
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
|
||||
(type *)( (char *)__mptr - offsetof(type,member) );})
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(a,b) \
|
||||
__extension__ ({ \
|
||||
typeof(a) _a = (a); \
|
||||
typeof(b) _b = (b); \
|
||||
_a > _b ? _a : _b; \
|
||||
#define container_of(ptr, type, member) \
|
||||
__extension__ ({ \
|
||||
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
|
||||
(type *)( (char *)__mptr - offsetof(type,member) ); \
|
||||
})
|
||||
#endif
|
||||
|
||||
#define MAX3(a,b,c) \
|
||||
MAX(MAX(a,b),c)
|
||||
#undef MAX
|
||||
#define MAX(a,b) \
|
||||
__extension__ ({ \
|
||||
typeof(a) _a = (a); \
|
||||
typeof(b) _b = (b); \
|
||||
_a > _b ? _a : _b; \
|
||||
})
|
||||
|
||||
#ifndef MIN
|
||||
#define MAX3(x,y,z) \
|
||||
__extension__ ({ \
|
||||
typeof(x) _c = MAX(x,y); \
|
||||
MAX(_c, z); \
|
||||
})
|
||||
|
||||
#undef MIN
|
||||
#define MIN(a,b) \
|
||||
__extension__ ({ \
|
||||
typeof(a) _a = (a); \
|
||||
typeof(b) _b = (b); \
|
||||
_a < _b ? _a : _b; \
|
||||
})
|
||||
#endif
|
||||
|
||||
#define MIN3(a,b,c) \
|
||||
MIN(MIN(a,b),c)
|
||||
|
||||
#ifndef CLAMP
|
||||
#define CLAMP(x, low, high) \
|
||||
__extension__ ({ \
|
||||
typeof(x) _x = (x); \
|
||||
@@ -99,6 +121,7 @@ static inline size_t ALIGN_TO(size_t l, size_t ali) {
|
||||
typeof(high) _high = (high); \
|
||||
((_x > _high) ? _high : ((_x < _low) ? _low : _x)); \
|
||||
})
|
||||
#endif
|
||||
|
||||
#define assert_se(expr) \
|
||||
do { \
|
||||
@@ -119,14 +142,21 @@ static inline size_t ALIGN_TO(size_t l, size_t ali) {
|
||||
log_assert_failed_unreachable(t, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
|
||||
} while (false)
|
||||
|
||||
#define assert_cc(expr) \
|
||||
do { \
|
||||
switch (0) { \
|
||||
case 0: \
|
||||
case !!(expr): \
|
||||
; \
|
||||
} \
|
||||
#if defined(static_assert)
|
||||
#define assert_cc(expr) \
|
||||
do { \
|
||||
static_assert(expr, #expr); \
|
||||
} while (false)
|
||||
#else
|
||||
#define assert_cc(expr) \
|
||||
do { \
|
||||
switch (0) { \
|
||||
case 0: \
|
||||
case !!(expr): \
|
||||
; \
|
||||
} \
|
||||
} while (false)
|
||||
#endif
|
||||
|
||||
#define PTR_TO_UINT(p) ((unsigned int) ((uintptr_t) (p)))
|
||||
#define UINT_TO_PTR(u) ((void*) ((uintptr_t) (u)))
|
||||
@@ -149,6 +179,8 @@ static inline size_t ALIGN_TO(size_t l, size_t ali) {
|
||||
#define memzero(x,l) (memset((x), 0, (l)))
|
||||
#define zero(x) (memzero(&(x), sizeof(x)))
|
||||
|
||||
#define CHAR_TO_STR(x) ((char[2]) { x, 0 })
|
||||
|
||||
#define char_array_0(x) x[sizeof(x)-1] = 0;
|
||||
|
||||
#define IOVEC_SET_STRING(i, s) \
|
||||
@@ -187,6 +219,66 @@ static inline size_t IOVEC_INCREMENT(struct iovec *i, unsigned n, size_t k) {
|
||||
return k;
|
||||
}
|
||||
|
||||
#include "log.h"
|
||||
#define VA_FORMAT_ADVANCE(format, ap) \
|
||||
do { \
|
||||
int _argtypes[128]; \
|
||||
size_t _i, _k; \
|
||||
_k = parse_printf_format((format), ELEMENTSOF(_argtypes), _argtypes); \
|
||||
assert(_k < ELEMENTSOF(_argtypes)); \
|
||||
for (_i = 0; _i < _k; _i++) { \
|
||||
if (_argtypes[_i] & PA_FLAG_PTR) { \
|
||||
(void) va_arg(ap, void*); \
|
||||
continue; \
|
||||
} \
|
||||
\
|
||||
switch (_argtypes[_i]) { \
|
||||
case PA_INT: \
|
||||
case PA_INT|PA_FLAG_SHORT: \
|
||||
case PA_CHAR: \
|
||||
(void) va_arg(ap, int); \
|
||||
break; \
|
||||
case PA_INT|PA_FLAG_LONG: \
|
||||
(void) va_arg(ap, long int); \
|
||||
break; \
|
||||
case PA_INT|PA_FLAG_LONG_LONG: \
|
||||
(void) va_arg(ap, long long int); \
|
||||
break; \
|
||||
case PA_WCHAR: \
|
||||
(void) va_arg(ap, wchar_t); \
|
||||
break; \
|
||||
case PA_WSTRING: \
|
||||
case PA_STRING: \
|
||||
case PA_POINTER: \
|
||||
(void) va_arg(ap, void*); \
|
||||
break; \
|
||||
case PA_FLOAT: \
|
||||
case PA_DOUBLE: \
|
||||
(void) va_arg(ap, double); \
|
||||
break; \
|
||||
case PA_DOUBLE|PA_FLAG_LONG_DOUBLE: \
|
||||
(void) va_arg(ap, long double); \
|
||||
break; \
|
||||
default: \
|
||||
assert_not_reached("Unknown format string argument."); \
|
||||
} \
|
||||
} \
|
||||
} while(false)
|
||||
|
||||
#endif
|
||||
/* Because statfs.t_type can be int on some architecures, we have to cast
|
||||
* the const magic to the type, otherwise the compiler warns about
|
||||
* signed/unsigned comparison, because the magic can be 32 bit unsigned.
|
||||
*/
|
||||
#define F_TYPE_CMP(a, b) (a == (typeof(a)) b)
|
||||
|
||||
|
||||
/* Returns the number of chars needed to format variables of the
|
||||
* specified type as a decimal string. Adds in extra space for a
|
||||
* negative '-' prefix. */
|
||||
|
||||
#define DECIMAL_STR_MAX(type) \
|
||||
(1+(sizeof(type) <= 1 ? 3 : \
|
||||
sizeof(type) <= 2 ? 5 : \
|
||||
sizeof(type) <= 4 ? 10 : \
|
||||
sizeof(type) <= 8 ? 20 : sizeof(int[-2*(sizeof(type) > 8)])))
|
||||
|
||||
#include "log.h"
|
||||
|
@@ -185,3 +185,95 @@ static const char *const log_level_table[] = {
|
||||
};
|
||||
|
||||
DEFINE_STRING_TABLE_LOOKUP(log_level, int);
|
||||
|
||||
char *strnappend(const char *s, const char *suffix, size_t b) {
|
||||
size_t a;
|
||||
char *r;
|
||||
|
||||
if (!s && !suffix)
|
||||
return strdup("");
|
||||
|
||||
if (!s)
|
||||
return strndup(suffix, b);
|
||||
|
||||
if (!suffix)
|
||||
return strdup(s);
|
||||
|
||||
assert(s);
|
||||
assert(suffix);
|
||||
|
||||
a = strlen(s);
|
||||
if (b > ((size_t) -1) - a)
|
||||
return NULL;
|
||||
|
||||
r = new(char, a+b+1);
|
||||
if (!r)
|
||||
return NULL;
|
||||
|
||||
memcpy(r, s, a);
|
||||
memcpy(r+a, suffix, b);
|
||||
r[a+b] = 0;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
char *strappend(const char *s, const char *suffix) {
|
||||
return strnappend(s, suffix, suffix ? strlen(suffix) : 0);
|
||||
}
|
||||
|
||||
char *strjoin(const char *x, ...) {
|
||||
va_list ap;
|
||||
size_t l;
|
||||
char *r, *p;
|
||||
|
||||
va_start(ap, x);
|
||||
|
||||
if (x) {
|
||||
l = strlen(x);
|
||||
|
||||
for (;;) {
|
||||
const char *t;
|
||||
size_t n;
|
||||
|
||||
t = va_arg(ap, const char *);
|
||||
if (!t)
|
||||
break;
|
||||
|
||||
n = strlen(t);
|
||||
if (n > ((size_t) -1) - l) {
|
||||
va_end(ap);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
l += n;
|
||||
}
|
||||
} else
|
||||
l = 0;
|
||||
|
||||
va_end(ap);
|
||||
|
||||
r = new(char, l+1);
|
||||
if (!r)
|
||||
return NULL;
|
||||
|
||||
if (x) {
|
||||
p = stpcpy(r, x);
|
||||
|
||||
va_start(ap, x);
|
||||
|
||||
for (;;) {
|
||||
const char *t;
|
||||
|
||||
t = va_arg(ap, const char *);
|
||||
if (!t)
|
||||
break;
|
||||
|
||||
p = stpcpy(p, t);
|
||||
}
|
||||
|
||||
va_end(ap);
|
||||
} else
|
||||
r[0] = 0;
|
||||
|
||||
return r;
|
||||
}
|
||||
|
@@ -507,6 +507,42 @@ void* memdup(const void *p, size_t l);
|
||||
|
||||
int is_kernel_thread(pid_t pid);
|
||||
|
||||
static inline void freep(void *p) {
|
||||
free(*(void**) p);
|
||||
}
|
||||
|
||||
static inline void fclosep(FILE **f) {
|
||||
if (*f)
|
||||
fclose(*f);
|
||||
}
|
||||
|
||||
static inline void pclosep(FILE **f) {
|
||||
if (*f)
|
||||
pclose(*f);
|
||||
}
|
||||
|
||||
static inline void closep(int *fd) {
|
||||
if (*fd >= 0)
|
||||
close_nointr_nofail(*fd);
|
||||
}
|
||||
|
||||
static inline void closedirp(DIR **d) {
|
||||
if (*d)
|
||||
closedir(*d);
|
||||
}
|
||||
|
||||
static inline void umaskp(mode_t *u) {
|
||||
umask(*u);
|
||||
}
|
||||
|
||||
#define _cleanup_free_ _cleanup_(freep)
|
||||
#define _cleanup_fclose_ _cleanup_(fclosep)
|
||||
#define _cleanup_pclose_ _cleanup_(pclosep)
|
||||
#define _cleanup_close_ _cleanup_(closep)
|
||||
#define _cleanup_closedir_ _cleanup_(closedirp)
|
||||
#define _cleanup_umask_ _cleanup_(umaskp)
|
||||
#define _cleanup_globfree_ _cleanup_(globfree)
|
||||
|
||||
int fd_inc_sndbuf(int fd, size_t n);
|
||||
int fd_inc_rcvbuf(int fd, size_t n);
|
||||
|
||||
@@ -524,4 +560,6 @@ bool in_initrd(void);
|
||||
|
||||
void warn_melody(void);
|
||||
|
||||
char *strjoin(const char *x, ...) _sentinel_;
|
||||
|
||||
#endif
|
||||
|
63
lsinitrd-bash-completion.sh
Normal file
63
lsinitrd-bash-completion.sh
Normal file
@@ -0,0 +1,63 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Copyright 2013 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
__contains_word () {
|
||||
local word=$1; shift
|
||||
for w in $*; do [[ $w = $word ]] && return 0; done
|
||||
return 1
|
||||
}
|
||||
|
||||
_lsinitrd() {
|
||||
local field_vals= cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
local -A OPTS=(
|
||||
[STANDALONE]='-s --size -h --help'
|
||||
|
||||
[ARG]='-f --file -k --kver'
|
||||
)
|
||||
|
||||
if __contains_word "$prev" ${OPTS[ARG]}; then
|
||||
case $prev in
|
||||
--file|-f)
|
||||
comps=$(compgen -f -- "$cur")
|
||||
compopt -o filenames
|
||||
;;
|
||||
--kver|-k)
|
||||
comps=$(cd /lib/modules; echo [0-9]*)
|
||||
;;
|
||||
*)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ $cur = -* ]]; then
|
||||
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
|
||||
return 0
|
||||
fi
|
||||
|
||||
comps=$(compgen -f -- "$cur")
|
||||
compopt -o filenames
|
||||
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
|
||||
return 0
|
||||
}
|
||||
|
||||
complete -F _lsinitrd lsinitrd
|
@@ -10,12 +10,15 @@ lsinitrd - tool to show the contents of an initramfs image
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
*lsinit* ['OPTION...'] [<image>]
|
||||
*lsinitrd* ['OPTION...'] [<image> [<filename> [<filename> [...] ]]]
|
||||
|
||||
*lsinitrd* ['OPTION...'] -k <kernel-version>
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
lsinitrd shows the contents of an initramfs image. if <image> is omitted, then
|
||||
lsinitrd uses the default image /boot/initramfs-<kernel version>.img.
|
||||
lsinitrd uses the default image _/boot/<machine-id>/<kernel-version>/initrd_ or
|
||||
_/boot/initramfs-<kernel-version>.img_.
|
||||
|
||||
OPTIONS
|
||||
-------
|
||||
@@ -25,6 +28,12 @@ OPTIONS
|
||||
**-s, --size**::
|
||||
sort the contents of the initramfs by size.
|
||||
|
||||
**-f, --file** _<filename>_::
|
||||
print the contents of <filename>.
|
||||
|
||||
**-k, --kver** _<kernel version>_::
|
||||
inspect the initramfs of <kernel version>.
|
||||
|
||||
AVAILABILITY
|
||||
------------
|
||||
The lsinitrd command is part of the dracut package and is available from
|
||||
|
163
lsinitrd.sh
163
lsinitrd.sh
@@ -21,55 +21,132 @@
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "Usage: $(basename $0) [-s] [<initramfs file> [<filename>]]"
|
||||
{
|
||||
echo "Usage: ${0##*/} [options] [<initramfs file> [<filename> [<filename> [...] ]]]"
|
||||
echo "Usage: ${0##*/} [options] -k <kernel version>"
|
||||
echo
|
||||
echo "-h, --help print a help message and exit."
|
||||
echo "-s, --size sort the contents of the initramfs by size."
|
||||
echo "-f, --file <filename> print the contents of <filename>."
|
||||
echo "-k, --kver <kernel version> inspect the initramfs of <kernel version>."
|
||||
echo
|
||||
} >&2
|
||||
}
|
||||
|
||||
[[ $# -le 2 ]] || { usage ; exit 1 ; }
|
||||
|
||||
sorted=0
|
||||
while getopts "s" opt; do
|
||||
case $opt in
|
||||
s) sorted=1;;
|
||||
h) usage; exit 0;;
|
||||
\?) usage; exit 1;;
|
||||
declare -A filenames
|
||||
|
||||
unset POSIXLY_CORRECT
|
||||
TEMP=$(getopt \
|
||||
-o "shf:k:" \
|
||||
--long kver: \
|
||||
--long file: \
|
||||
--long help \
|
||||
--long size \
|
||||
-- "$@")
|
||||
|
||||
if (( $? != 0 )); then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
eval set -- "$TEMP"
|
||||
|
||||
while (($# > 0)); do
|
||||
case $1 in
|
||||
-k|--kver) KERNEL_VERSION="$2"; shift;;
|
||||
-f|--file) filenames[${2#/}]=1; shift;;
|
||||
-s|--size) sorted=1;;
|
||||
-h|--help) usage; exit 0;;
|
||||
--) shift;break;;
|
||||
*) usage; exit 1;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
image="${1:-/boot/initramfs-$(uname -r).img}"
|
||||
[[ -f "$image" ]] || { echo "$image does not exist" ; exit 1 ; }
|
||||
[[ $KERNEL_VERSION ]] || KERNEL_VERSION="$(uname -r)"
|
||||
|
||||
CAT=zcat
|
||||
FILE_T=$(file --dereference "$image")
|
||||
|
||||
if echo "test"|xz|xz -dc --single-stream >/dev/null 2>&1; then
|
||||
XZ_SINGLE_STREAM="--single-stream"
|
||||
fi
|
||||
|
||||
if [[ "$FILE_T" =~ :\ gzip\ compressed\ data ]]; then
|
||||
CAT=zcat
|
||||
elif [[ "$FILE_T" =~ :\ xz\ compressed\ data ]]; then
|
||||
CAT="xzcat $XZ_SINGLE_STREAM"
|
||||
elif [[ "$FILE_T" =~ :\ XZ\ compressed\ data ]]; then
|
||||
CAT="xzcat $XZ_SINGLE_STREAM"
|
||||
elif [[ "$FILE_T" =~ :\ LZMA ]]; then
|
||||
CAT="xzcat $XZ_SINGLE_STREAM"
|
||||
elif [[ "$FILE_T" =~ :\ data ]]; then
|
||||
CAT="xzcat $XZ_SINGLE_STREAM"
|
||||
fi
|
||||
|
||||
if [[ $# -eq 2 ]]; then
|
||||
$CAT $image | cpio --extract --verbose --quiet --to-stdout ${2#/} 2>/dev/null
|
||||
exit $?
|
||||
fi
|
||||
|
||||
echo "$image: $(du -h $image | while read a b; do echo $a;done)"
|
||||
echo "========================================================================"
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout '*lib/dracut/dracut-*' 2>/dev/null
|
||||
echo "========================================================================"
|
||||
if [ "$sorted" -eq 1 ]; then
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --list | sort -n -k5
|
||||
if [[ $1 ]]; then
|
||||
image="$1"
|
||||
if ! [[ -f "$image" ]]; then
|
||||
{
|
||||
echo "$image does not exist"
|
||||
echo
|
||||
} >&2
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --list
|
||||
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||||
|
||||
if [[ -d /boot/loader/entries || -L /boot/loader/entries ]] \
|
||||
&& [[ $MACHINE_ID ]] \
|
||||
&& [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
|
||||
image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
|
||||
else
|
||||
image="/boot/initramfs-${KERNEL_VERSION}.img"
|
||||
fi
|
||||
fi
|
||||
echo "========================================================================"
|
||||
|
||||
shift
|
||||
while (($# > 0)); do
|
||||
filenames[${1#/}]=1;
|
||||
shift
|
||||
done
|
||||
|
||||
if ! [[ -f "$image" ]]; then
|
||||
{
|
||||
echo "No <initramfs file> specified and the default image '$image' cannot be accessed!"
|
||||
echo
|
||||
} >&2
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
read -N 6 bin < "$image"
|
||||
case $bin in
|
||||
$'\x1f\x8b'*)
|
||||
CAT="zcat";;
|
||||
BZh*)
|
||||
CAT="bzcat";;
|
||||
$'\x71\xc7'*|070701)
|
||||
CAT="cat";;
|
||||
*)
|
||||
CAT="xzcat";
|
||||
if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
|
||||
CAT="xzcat --single-stream"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
ret=0
|
||||
|
||||
if (( ${#filenames[@]} > 0 )); then
|
||||
(( ${#filenames[@]} == 1 )) && nofileinfo=1
|
||||
for f in ${!filenames[@]}; do
|
||||
[[ $nofileinfo ]] || echo "initramfs:/$f"
|
||||
[[ $nofileinfo ]] || echo "========================================================================"
|
||||
$CAT -- $image | cpio --extract --verbose --quiet --to-stdout $f 2>/dev/null
|
||||
((ret+=$?))
|
||||
[[ $nofileinfo ]] || echo "========================================================================"
|
||||
[[ $nofileinfo ]] || echo
|
||||
done
|
||||
else
|
||||
echo "Image: $image: $(du -h $image | while read a b; do echo $a;done)"
|
||||
echo "========================================================================"
|
||||
version=$($CAT -- "$image" | cpio --extract --verbose --quiet --to-stdout -- '*lib/dracut/dracut-*' 2>/dev/null)
|
||||
((ret+=$?))
|
||||
echo "$version with dracut modules:"
|
||||
$CAT -- "$image" | cpio --extract --verbose --quiet --to-stdout -- '*lib/dracut/modules.txt' 2>/dev/null
|
||||
((ret+=$?))
|
||||
echo "========================================================================"
|
||||
if [ "$sorted" -eq 1 ]; then
|
||||
$CAT -- "$image" | cpio --extract --verbose --quiet --list | sort -n -k5
|
||||
else
|
||||
$CAT -- "$image" | cpio --extract --verbose --quiet --list | sort -k9
|
||||
fi
|
||||
((ret+=$?))
|
||||
echo "========================================================================"
|
||||
fi
|
||||
|
||||
exit $ret
|
||||
|
20
modules.d/00bash/module-setup.sh
Executable file
20
modules.d/00bash/module-setup.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
[ -x /bin/bash ]
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
# If another shell is already installed, do not use bash
|
||||
[[ -x $initdir/bin/sh ]] && return
|
||||
|
||||
# Prefer bash as /bin/sh if it is available.
|
||||
inst /bin/bash && ln -sf bash "${initdir}/bin/sh"
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ install() {
|
||||
inst_symlink /init /sbin/init
|
||||
inst_dir /lib/bootchart/tmpfs
|
||||
|
||||
dracut_install bootchartd bash \
|
||||
inst_multiple bootchartd bash \
|
||||
/lib/bootchart/bootchart-collector /etc/bootchartd.conf \
|
||||
accton \
|
||||
echo \
|
||||
|
18
modules.d/00systemd-bootchart/module-setup.sh
Executable file
18
modules.d/00systemd-bootchart/module-setup.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
[[ "$mount_needs" ]] && return 1
|
||||
[ -x $systemdutildir/systemd-bootchart ] || return 1
|
||||
return 255
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
inst_symlink /init /sbin/init
|
||||
inst_multiple $systemdutildir/systemd-bootchart
|
||||
}
|
@@ -3,7 +3,7 @@
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
|
||||
rm -f /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
elif getarg boot= >/dev/null; then
|
||||
. /sbin/fips.sh
|
||||
if mount_boot; then
|
||||
|
@@ -3,7 +3,7 @@
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
|
||||
rm -f /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
elif ! [ -f /tmp/fipsdone ]; then
|
||||
. /sbin/fips.sh
|
||||
mount_boot
|
||||
|
@@ -15,6 +15,12 @@ mount_boot()
|
||||
UUID=*)
|
||||
boot="/dev/disk/by-uuid/${boot#UUID=}"
|
||||
;;
|
||||
PARTUUID=*)
|
||||
boot="/dev/disk/by-partuuid/${boot#PARTUUID=}"
|
||||
;;
|
||||
PARTLABEL=*)
|
||||
boot="/dev/disk/by-partlabel/${boot#PARTLABEL=}"
|
||||
;;
|
||||
/dev/*)
|
||||
;;
|
||||
*)
|
||||
@@ -32,8 +38,6 @@ mount_boot()
|
||||
udevadm settle --timeout=30
|
||||
fi
|
||||
[ -e $boot ] && break
|
||||
modprobe scsi_wait_scan && rmmod scsi_wait_scan
|
||||
[ -e $boot ] && break
|
||||
sleep 0.5
|
||||
i=$(($i+1))
|
||||
[ $i -gt 40 ] && break
|
||||
@@ -45,35 +49,77 @@ mount_boot()
|
||||
mkdir /boot
|
||||
info "Mounting $boot as /boot"
|
||||
mount -oro "$boot" /boot || return 1
|
||||
elif [ -d "$NEWROOT/boot" ]; then
|
||||
rm -fr -- /boot
|
||||
ln -sf "$NEWROOT/boot" /boot
|
||||
fi
|
||||
}
|
||||
|
||||
do_rhevh_check()
|
||||
{
|
||||
KERNEL=$(uname -r)
|
||||
kpath=${1}
|
||||
|
||||
# If we're on RHEV-H, the kernel is in /dev/.initramfs/live/vmlinuz0
|
||||
HMAC_SUM_ORIG=$(cat /boot/.vmlinuz-${KERNEL}.hmac | while read a b; do printf "%s\n" $a; done)
|
||||
HMAC_SUM_CALC=$(sha512hmac $kpath | while read a b; do printf "%s\n" $a; done || return 1)
|
||||
if [ -z "$HMAC_SUM_ORIG" ] || [ -z "$HMAC_SUM_CALC" ] || [ "${HMAC_SUM_ORIG}" != "${HMAC_SUM_CALC}" ]; then
|
||||
warn "HMAC sum mismatch"
|
||||
return 1
|
||||
fi
|
||||
info "rhevh_check OK"
|
||||
return 0
|
||||
}
|
||||
|
||||
do_fips()
|
||||
{
|
||||
info "Checking integrity of kernel"
|
||||
newroot=$NEWROOT
|
||||
local _v
|
||||
local _s
|
||||
local _v
|
||||
local _module
|
||||
|
||||
KERNEL=$(uname -r)
|
||||
|
||||
[ -e "$newroot/boot/.vmlinuz-${KERNEL}.hmac" ] || unset newroot
|
||||
|
||||
if ! [ -e "$newroot/boot/.vmlinuz-${KERNEL}.hmac" ]; then
|
||||
warn "$newroot/boot/.vmlinuz-${KERNEL}.hmac does not exist"
|
||||
if ! [ -e "/boot/.vmlinuz-${KERNEL}.hmac" ]; then
|
||||
warn "/boot/.vmlinuz-${KERNEL}.hmac does not exist"
|
||||
return 1
|
||||
fi
|
||||
|
||||
sha512hmac -c "$newroot/boot/.vmlinuz-${KERNEL}.hmac" || return 1
|
||||
|
||||
FIPSMODULES=$(cat /etc/fipsmodules)
|
||||
|
||||
info "Loading and integrity checking all crypto modules"
|
||||
for module in $FIPSMODULES; do
|
||||
if [ "$module" != "tcrypt" ]; then
|
||||
modprobe ${module} || return 1
|
||||
mv /etc/modprobe.d/fips.conf /etc/modprobe.d/fips.conf.bak
|
||||
for _module in $FIPSMODULES; do
|
||||
if [ "$_module" != "tcrypt" ]; then
|
||||
if ! modprobe "${_module}"; then
|
||||
# check if kernel provides generic algo
|
||||
_found=0
|
||||
while read _k _s _v; do
|
||||
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
|
||||
[ "$_k" = "driver" ] && _v=$(str_replace "$_v" "_" "-")
|
||||
[ "$_v" != "$_module" ] && continue
|
||||
_found=1
|
||||
break
|
||||
done </proc/crypto
|
||||
[ "$_found" = "0" ] && return 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
mv /etc/modprobe.d/fips.conf.bak /etc/modprobe.d/fips.conf
|
||||
|
||||
info "Self testing crypto algorithms"
|
||||
modprobe tcrypt || return 1
|
||||
rmmod tcrypt
|
||||
|
||||
info "Checking integrity of kernel"
|
||||
if [ -e "$NEWROOT/dev/.initramfs/live/vmlinuz0" ]; then
|
||||
do_rhevh_check "$NEWROOT/dev/.initramfs/live/vmlinuz0" || return 1
|
||||
elif [ -e "$NEWROOT/dev/.initramfs/live/isolinux/vmlinuz0" ]; then
|
||||
do_rhevh_check "$NEWROOT/dev/.initramfs/live/isolinux/vmlinuz0" || return 1
|
||||
else
|
||||
sha512hmac -c "/boot/.vmlinuz-${KERNEL}.hmac" || return 1
|
||||
fi
|
||||
|
||||
info "All initrd crypto checks done"
|
||||
|
||||
> /tmp/fipsdone
|
||||
|
@@ -12,9 +12,11 @@ depends() {
|
||||
|
||||
installkernel() {
|
||||
local _fipsmodules _mod
|
||||
_fipsmodules="aead aes_generic xts aes-x86_64 ansi_cprng cbc ccm chainiv ctr gcm ghash_generic"
|
||||
_fipsmodules+=" des deflate ecb eseqiv hmac seqiv sha256 sha256_generic sha512 sha512_generic"
|
||||
_fipsmodules+=" cryptomgr crypto_null tcrypt dm-mod dm-crypt"
|
||||
_fipsmodules="aead aes_generic aes-x86_64 ansi_cprng arc4 blowfish camellia cast6 cbc ccm "
|
||||
_fipsmodules+="chainiv crc32c cryptomgr crypto_null ctr cts deflate des des3_ede dm-crypt dm-mod "
|
||||
_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"
|
||||
|
||||
mkdir -m 0755 -p "${initdir}/etc/modprobe.d"
|
||||
|
||||
@@ -24,7 +26,6 @@ installkernel() {
|
||||
echo "blacklist $_mod" >> "${initdir}/etc/modprobe.d/fips.conf"
|
||||
fi
|
||||
done
|
||||
hostonly='' instmods scsi_wait_scan
|
||||
}
|
||||
|
||||
install() {
|
||||
@@ -33,12 +34,12 @@ install() {
|
||||
inst_hook pre-pivot 01 "$moddir/fips-noboot.sh"
|
||||
inst_script "$moddir/fips.sh" /sbin/fips.sh
|
||||
|
||||
dracut_install sha512hmac rmmod insmod mount uname umount
|
||||
inst_multiple sha512hmac rmmod insmod mount uname umount fipscheck
|
||||
|
||||
inst_libdir_file libsoftokn3.so libsoftokn3.so \
|
||||
libsoftokn3.chk libfreebl3.so libfreebl3.chk \
|
||||
'hmaccalc/sha512hmac.hmac'
|
||||
libssl.so 'hmaccalc/sha512hmac.hmac' libssl.so.10
|
||||
|
||||
dracut_install -o prelink
|
||||
inst_multiple -o prelink
|
||||
}
|
||||
|
||||
|
13
modules.d/03modsign/load-modsign-keys.sh
Normal file
13
modules.d/03modsign/load-modsign-keys.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Licensed under the GPLv2
|
||||
#
|
||||
# Copyright 2013 Red Hat, Inc.
|
||||
# Peter Jones <pjones@redhat.com>
|
||||
|
||||
for x in /lib/modules/keys/* ; do
|
||||
[ "${x}" = "/lib/modules/keys/*" ] && break
|
||||
keyctl padd asymmetric "" @s < ${x}
|
||||
done
|
37
modules.d/03modsign/module-setup.sh
Normal file
37
modules.d/03modsign/module-setup.sh
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Licensed under the GPLv2
|
||||
#
|
||||
# Copyright 2013 Red Hat, Inc.
|
||||
# Peter Jones <pjones@redhat.com>
|
||||
|
||||
check() {
|
||||
[[ -x /usr/bin/keyctl ]] || return 1
|
||||
|
||||
# do not include module in hostonly mode,
|
||||
# if no keys are present
|
||||
if [[ $hostonly ]]; then
|
||||
x=$(echo /lib/modules/keys/*)
|
||||
[[ "${x}" = "/lib/modules/keys/*" ]] && return 255
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
inst_dir /lib/modules/keys
|
||||
inst_binary /usr/bin/keyctl
|
||||
|
||||
inst_hook pre-trigger 01 "$moddir/load-modsign-keys.sh"
|
||||
|
||||
for x in /lib/modules/keys/* ; do
|
||||
[[ "${x}" = "/lib/modules/keys/*" ]] && break
|
||||
inst_simple "${x}"
|
||||
done
|
||||
}
|
19
modules.d/03rescue/module-setup.sh
Executable file
19
modules.d/03rescue/module-setup.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
# do not add this module by default
|
||||
return 255
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
inst_multiple -o ps grep more cat rm strace free showmount \
|
||||
ping netstat rpcinfo vi scp ping6 ssh \
|
||||
fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat e2fsck
|
||||
}
|
||||
|
@@ -23,5 +23,6 @@ install() {
|
||||
inst_hook cleanup 00 "$moddir/watchdog.sh"
|
||||
inst_hook cleanup 99 "$moddir/watchdog.sh"
|
||||
inst_hook emergency 02 "$moddir/watchdog-stop.sh"
|
||||
inst_multiple -o wdctl
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,12 @@
|
||||
#!/bin/sh
|
||||
if [ -e /dev/watchdog ]; then
|
||||
if [ ! -e /tmp/watchdog_timeout ]; then
|
||||
wdctl -s 60 /dev/watchdog >/dev/null 2>&1
|
||||
> /tmp/watchdog_timeout
|
||||
fi
|
||||
info "Triggering watchdog"
|
||||
>/dev/watchdog
|
||||
else
|
||||
modprobe ib700wdt
|
||||
modprobe i6300esb
|
||||
fi
|
||||
|
@@ -13,9 +13,10 @@ depends() {
|
||||
}
|
||||
|
||||
install() {
|
||||
local _i _progs _path
|
||||
inst busybox /usr/bin/busybox
|
||||
for _i in `/sbin/busybox | sed -ne '1,/Currently/!{s/,//g; s/busybox//g; p}'`
|
||||
local _i _progs _path _busybox
|
||||
_busybox=$(type -P busybox)
|
||||
inst $_busybox /usr/bin/busybox
|
||||
for _i in $($_busybox | sed -ne '1,/Currently/!{s/,//g; s/busybox//g; p}')
|
||||
do
|
||||
_progs="$_progs $_i"
|
||||
done
|
||||
@@ -26,11 +27,7 @@ install() {
|
||||
for _i in $_progs; do
|
||||
_path=$(find_binary "$_i")
|
||||
[ -z "$_path" ] && continue
|
||||
if [[ $_path != ${_path#/usr} ]]; then
|
||||
ln -sf ../../usr/bin/busybox "$initdir/$_path"
|
||||
else
|
||||
ln -sf ../usr/bin/busybox "$initdir/$_path"
|
||||
fi
|
||||
ln_r /usr/bin/busybox $_path
|
||||
done
|
||||
}
|
||||
|
||||
|
@@ -1,2 +1,2 @@
|
||||
# Console initialization - keyboard, font, etc.
|
||||
KERNEL=="tty0", RUN+="/lib/udev/console_init $root/$name"
|
||||
KERNEL=="tty0", RUN+="/sbin/initqueue --onetime --unique --name console_init_$name /lib/udev/console_init $root/$name"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
Dracut i18n module
|
||||
dracut i18n module
|
||||
------------------
|
||||
|
||||
INDEX
|
||||
@@ -21,7 +21,7 @@ is intended to be generic across different GNU/Linux distributions.
|
||||
i18n and keyboard settings are stored in different files among
|
||||
distributions. To deal with it avoiding hardcoding those differences in
|
||||
the installation script we handle it by mappings between variables used
|
||||
by Dracut and the ones in the system. Package maintainer is expected to
|
||||
by dracut and the ones in the system. Package maintainer is expected to
|
||||
create those for his/her distribution and it's appreciated to share it
|
||||
with us, so we can include it in source package.
|
||||
|
||||
|
@@ -2,7 +2,11 @@
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
[ -x /lib/systemd/systemd-vconsole-setup ] && exit 0
|
||||
[ -n "$DRACUT_SYSTEMD" ] && exit 0
|
||||
|
||||
if [ -x $systemdutildir/systemd-vconsole-setup ]; then
|
||||
$systemdutildir/systemd-vconsole-setup "$@"
|
||||
fi
|
||||
|
||||
[ -e /etc/vconsole.conf ] && . /etc/vconsole.conf
|
||||
|
||||
|
@@ -4,6 +4,11 @@
|
||||
|
||||
check() {
|
||||
[[ "$mount_needs" ]] && return 1
|
||||
|
||||
for i in setfont loadkeys kbd_mode; do
|
||||
type -P "$i" >/dev/null || return 1
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -12,9 +17,18 @@ depends() {
|
||||
}
|
||||
|
||||
install() {
|
||||
[ -x /lib/systemd/systemd-vconsole-setup ] && dracut_install /lib/systemd/systemd-vconsole-setup
|
||||
if dracut_module_included "systemd"; then
|
||||
[[ -f /etc/vconsole.conf ]] || return 0
|
||||
unset FONT
|
||||
unset KEYMAP
|
||||
. /etc/vconsole.conf
|
||||
# if vconsole.conf has no settings, do not include anything
|
||||
[[ $FONT ]] || [[ $KEYMAP ]] || return 0
|
||||
fi
|
||||
|
||||
inst_multiple -o $systemdutildir/systemd-vconsole-setup
|
||||
KBDSUBDIRS=consolefonts,consoletrans,keymaps,unimaps
|
||||
DEFAULT_FONT=LatArCyrHeb-16
|
||||
DEFAULT_FONT="${i18n_default_font:-LatArCyrHeb-16}"
|
||||
I18N_CONF="/etc/locale.conf"
|
||||
VCONFIG_CONF="/etc/vconsole.conf"
|
||||
|
||||
@@ -31,7 +45,7 @@ install() {
|
||||
*) cmd=grep ;;
|
||||
esac
|
||||
|
||||
for INCL in $($cmd "^include " $MAP | while read a a b; do echo ${a/\"/}; done); do
|
||||
for INCL in $($cmd "^include " $MAP | while read a a b; do echo ${a//\"/}; done); do
|
||||
for FN in $(find ${kbddir}/keymaps -type f -name $INCL\*); do
|
||||
findkeymap $FN
|
||||
done
|
||||
@@ -84,11 +98,13 @@ install() {
|
||||
}
|
||||
|
||||
install_base() {
|
||||
dracut_install setfont loadkeys kbd_mode stty
|
||||
inst_multiple setfont loadkeys kbd_mode stty
|
||||
|
||||
inst ${moddir}/console_init.sh /lib/udev/console_init
|
||||
inst_rules ${moddir}/10-console.rules
|
||||
inst_hook cmdline 20 "${moddir}/parse-i18n.sh"
|
||||
if ! dracut_module_included "systemd"; then
|
||||
inst ${moddir}/console_init.sh /lib/udev/console_init
|
||||
inst_rules ${moddir}/10-console.rules
|
||||
inst_hook cmdline 20 "${moddir}/parse-i18n.sh"
|
||||
fi
|
||||
}
|
||||
|
||||
install_all_kbd() {
|
||||
@@ -96,20 +112,20 @@ install() {
|
||||
|
||||
for _src in $(eval echo ${kbddir}/{${KBDSUBDIRS}}); do
|
||||
inst_dir "$_src"
|
||||
cp --reflink=auto --sparse=auto -prfL -t "${initdir}/${_src%/*}" "$_src"
|
||||
cp --reflink=auto --sparse=auto -prfL -t "${initdir}/${_src}" "$_src"/*
|
||||
done
|
||||
|
||||
# remove unnecessary files
|
||||
rm -f "${initdir}${kbddir}/consoletrans/utflist"
|
||||
rm -f -- "${initdir}${kbddir}/consoletrans/utflist"
|
||||
find "${initdir}${kbddir}/" -name README\* -delete
|
||||
find "${initdir}${kbddir}/" -name '*.gz' -print -quit \
|
||||
| while read line; do
|
||||
dracut_install gzip
|
||||
inst_multiple gzip
|
||||
done
|
||||
|
||||
find "${initdir}${kbddir}/" -name '*.bz2' -print -quit \
|
||||
| while read line; do
|
||||
dracut_install bzip2
|
||||
inst_multiple bzip2
|
||||
done
|
||||
}
|
||||
|
||||
@@ -173,7 +189,7 @@ install() {
|
||||
|
||||
inst_opt_decompress ${kbddir}/consolefonts/${DEFAULT_FONT}.*
|
||||
|
||||
if [[ ${FONT} ]]
|
||||
if [[ ${FONT} ]] && [[ ${FONT} != ${DEFAULT_FONT} ]]
|
||||
then
|
||||
FONT=${FONT%.psf*}
|
||||
inst_opt_decompress ${kbddir}/consolefonts/${FONT}.*
|
||||
@@ -210,12 +226,6 @@ install() {
|
||||
kbddir=''
|
||||
done
|
||||
|
||||
[[ ${kbddir} ]] || {
|
||||
derror "Directories ${KBDSUBDIRS//,/, } not found. Please" \
|
||||
"inform us about the issue including your OS name and version."
|
||||
return 1
|
||||
}
|
||||
|
||||
[[ -f $I18N_CONF && -f $VCONFIG_CONF ]] || \
|
||||
[[ ! ${hostonly} || ${i18n_vars} ]] || {
|
||||
derror 'i18n_vars not set! Please set up i18n_vars in ' \
|
||||
|
@@ -13,21 +13,21 @@ inst_key_val() {
|
||||
_value=$(getarg $@)
|
||||
[ -z "${_value}" ] && _value=$_default
|
||||
if [ -n "${_value}" ]; then
|
||||
printf '%s="%s"\n' $1 ${_value} >> $_file
|
||||
printf '%s="%s"\n' $2 ${_value} >> $_file
|
||||
fi
|
||||
unset _file
|
||||
unset _value
|
||||
}
|
||||
|
||||
inst_key_val '' /etc/vconsole.conf KEYMAP vconsole.keymap KEYTABLE
|
||||
inst_key_val '' /etc/vconsole.conf FONT vconsole.font SYSFONT
|
||||
inst_key_val '' /etc/vconsole.conf FONT_MAP vconsole.font.map CONTRANS
|
||||
inst_key_val '' /etc/vconsole.conf FONT_UNIMAP vconsole.font.unimap UNIMAP
|
||||
inst_key_val 1 /etc/vconsole.conf UNICODE vconsole.unicode vconsole.font.unicode
|
||||
inst_key_val '' /etc/vconsole.conf EXT_KEYMAP vconsole.keymap.ext
|
||||
inst_key_val '' /etc/vconsole.conf vconsole.keymap KEYMAP -d KEYTABLE
|
||||
inst_key_val '' /etc/vconsole.conf vconsole.font FONT -d SYSFONT
|
||||
inst_key_val '' /etc/vconsole.conf vconsole.font.map FONT_MAP -d CONTRANS
|
||||
inst_key_val '' /etc/vconsole.conf vconsole.font.unimap FONT_UNIMAP -d UNIMAP
|
||||
inst_key_val 1 /etc/vconsole.conf vconsole.font.unicode UNICODE vconsole.unicode
|
||||
inst_key_val '' /etc/vconsole.conf vconsole.keymap.ext EXT_KEYMAP
|
||||
|
||||
inst_key_val '' /etc/locale.conf LANG locale.LANG
|
||||
inst_key_val '' /etc/locale.conf LC_ALL locale.LC_ALL
|
||||
inst_key_val '' /etc/locale.conf locale.LANG LANG
|
||||
inst_key_val '' /etc/locale.conf locale.LC_ALL LC_ALL
|
||||
|
||||
if [ -f /etc/locale.conf ]; then
|
||||
. /etc/locale.conf
|
||||
@@ -35,10 +35,8 @@ if [ -f /etc/locale.conf ]; then
|
||||
export LC_ALL
|
||||
fi
|
||||
|
||||
# FIXME: fix systemd-vconsole-setup
|
||||
#if [ -x /lib/systemd/systemd-vconsole-setup ]; then
|
||||
# /lib/systemd/systemd-vconsole-setup
|
||||
# rm -f /{etc,lib}/udev/rules.d/10-console.rules
|
||||
# rm -f /lib/udev/console_init
|
||||
# ln -s /lib/systemd/systemd-vconsole-setup /lib/udev/console_init
|
||||
#fi
|
||||
if [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
rm -f -- /etc/udev/rules.d/10-console.rules
|
||||
rm -f -- /lib/udev/rules.d/10-console.rules
|
||||
rm -f -- /lib/udev/console_init
|
||||
fi
|
||||
|
@@ -56,41 +56,63 @@ if ! needconvert; then
|
||||
fi
|
||||
|
||||
testfile="$ROOT/.usrmovecheck$$"
|
||||
rm -f "$testfile"
|
||||
rm -f -- "$testfile"
|
||||
> "$testfile"
|
||||
if [[ ! -e "$testfile" ]]; then
|
||||
echo "Cannot write to $ROOT/"
|
||||
exit 1
|
||||
fi
|
||||
rm -f "$testfile"
|
||||
rm -f -- "$testfile"
|
||||
|
||||
testfile="$ROOT/usr/.usrmovecheck$$"
|
||||
rm -f "$testfile"
|
||||
rm -f -- "$testfile"
|
||||
> "$testfile"
|
||||
if [[ ! -e "$testfile" ]]; then
|
||||
echo "Cannot write to $ROOT/usr/"
|
||||
exit 1
|
||||
fi
|
||||
rm -f "$testfile"
|
||||
rm -f -- "$testfile"
|
||||
|
||||
ismounted() {
|
||||
while read a m a; do
|
||||
[[ "$m" = "$1" ]] && return 0
|
||||
find_mount() {
|
||||
local dev mnt etc wanted_dev
|
||||
wanted_dev="$(readlink -e -q $1)"
|
||||
while read dev mnt etc; do
|
||||
[ "$dev" = "$wanted_dev" ] && echo "$dev" && return 0
|
||||
done < /proc/mounts
|
||||
return 1
|
||||
}
|
||||
|
||||
# usage: ismounted <mountpoint>
|
||||
# usage: ismounted /dev/<device>
|
||||
if command -v findmnt >/dev/null; then
|
||||
ismounted() {
|
||||
findmnt "$1" > /dev/null 2>&1
|
||||
}
|
||||
else
|
||||
ismounted() {
|
||||
if [ -b "$1" ]; then
|
||||
find_mount "$1" > /dev/null && return 0
|
||||
return 1
|
||||
fi
|
||||
|
||||
while read a m a; do
|
||||
[ "$m" = "$1" ] && return 0
|
||||
done < /proc/mounts
|
||||
return 1
|
||||
}
|
||||
fi
|
||||
|
||||
# clean up after ourselves no matter how we die.
|
||||
cleanup() {
|
||||
echo "Something failed. Move back to the original state"
|
||||
for dir in "$ROOT/bin" "$ROOT/sbin" "$ROOT/lib" "$ROOT/lib64" \
|
||||
"$ROOT/usr/bin" "$ROOT/usr/sbin" "$ROOT/usr/lib" \
|
||||
"$ROOT/usr/lib64"; do
|
||||
[[ -d "${dir}.usrmove-new" ]] && rm -fr "${dir}.usrmove-new"
|
||||
[[ -d "${dir}.usrmove-new" ]] && rm -fr -- "${dir}.usrmove-new"
|
||||
if [[ -d "${dir}.usrmove-old" ]]; then
|
||||
mv "$dir" "${dir}.del~"
|
||||
mv "${dir}.usrmove-old" "$dir"
|
||||
rm -fr "${dir}.del~"
|
||||
rm -fr -- "${dir}.del~"
|
||||
fi
|
||||
done
|
||||
}
|
||||
@@ -104,7 +126,7 @@ set -e
|
||||
|
||||
# merge / and /usr in new dir in /usr
|
||||
for dir in bin sbin lib lib64; do
|
||||
rm -rf "$ROOT/usr/${dir}.usrmove-new"
|
||||
rm -rf -- "$ROOT/usr/${dir}.usrmove-new"
|
||||
[[ -L "$ROOT/$dir" ]] && continue
|
||||
[[ -d "$ROOT/$dir" ]] || continue
|
||||
echo "Make a copy of \`$ROOT/usr/$dir'."
|
||||
@@ -128,7 +150,7 @@ done
|
||||
for dir in bin sbin lib lib64; do
|
||||
[[ -d "$ROOT/usr/${dir}.usrmove-new" ]] || continue
|
||||
echo "Switch to new \`$ROOT/usr/$dir'."
|
||||
rm -fr "$ROOT/usr/${dir}.usrmove-old"
|
||||
rm -fr -- "$ROOT/usr/${dir}.usrmove-old"
|
||||
mv "$ROOT/usr/$dir" "$ROOT/usr/${dir}.usrmove-old"
|
||||
mv "$ROOT/usr/${dir}.usrmove-new" "$ROOT/usr/$dir"
|
||||
done
|
||||
@@ -138,7 +160,7 @@ for dir in bin sbin lib lib64; do
|
||||
[[ -L "$ROOT/$dir" ]] && continue
|
||||
[[ -d "$ROOT/$dir" ]] || continue
|
||||
echo "Create \`$ROOT/$dir' symlink."
|
||||
rm -rf "$ROOT/${dir}.usrmove-old" || :
|
||||
rm -fr -- "$ROOT/${dir}.usrmove-old" || :
|
||||
mv "$ROOT/$dir" "$ROOT/${dir}.usrmove-old"
|
||||
ln -sfn usr/$dir "$ROOT/$dir"
|
||||
done
|
||||
@@ -156,9 +178,9 @@ done
|
||||
|
||||
for dir in bin sbin lib lib64; do
|
||||
[[ -d "$ROOT/usr/${dir}.usrmove-old~" ]] \
|
||||
&& rm -rf "$ROOT/usr/${dir}.usrmove-old~" || :
|
||||
&& rm -rf -- "$ROOT/usr/${dir}.usrmove-old~" || :
|
||||
[[ -d "$ROOT/${dir}.usrmove-old~" ]] \
|
||||
&& rm -rf "$ROOT/${dir}.usrmove-old~" || :
|
||||
&& rm -rf -- "$ROOT/${dir}.usrmove-old~" || :
|
||||
done
|
||||
|
||||
for dir in lib lib64; do
|
||||
|
@@ -12,7 +12,7 @@ depends() {
|
||||
}
|
||||
|
||||
install() {
|
||||
dracut_install bash find ldconfig mv rm cp ln
|
||||
inst_multiple bash find ldconfig mv rm cp ln
|
||||
inst_hook pre-pivot 99 "$moddir/do-convertfs.sh"
|
||||
inst_script "$moddir/convertfs.sh" /usr/bin/convertfs
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ setup_interface() {
|
||||
bcast=$new_broadcast_address
|
||||
gw=${new_routers%%,*}
|
||||
domain=$new_domain_name
|
||||
search=$(printf "$new_domain_search")
|
||||
search=$(printf -- "$new_domain_search")
|
||||
namesrv=$new_domain_name_servers
|
||||
hostname=$new_host_name
|
||||
|
||||
@@ -25,8 +25,7 @@ setup_interface() {
|
||||
if ! ip link set $netif mtu $mtu ; then
|
||||
ip link set $netif down
|
||||
ip link set $netif mtu $mtu
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
linkup $netif
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -43,7 +42,7 @@ setup_interface() {
|
||||
|
||||
# Note: hostname can be fqdn OR short hostname, so chop off any
|
||||
# trailing domain name and explicity add any domain if set.
|
||||
[ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
[ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
}
|
||||
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
@@ -51,6 +50,7 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
export PS4="dhclient.$interface.$$ + "
|
||||
exec >>/run/initramfs/loginit.pipe 2>>/run/initramfs/loginit.pipe
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
|
||||
# We already need a set netif here
|
||||
netif=$interface
|
||||
@@ -61,8 +61,7 @@ netif=$interface
|
||||
case $reason in
|
||||
PREINIT)
|
||||
echo "dhcp: PREINIT $netif up"
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
linkup $netif
|
||||
;;
|
||||
BOUND)
|
||||
echo "dhcp: BOND setting $netif"
|
||||
@@ -89,7 +88,8 @@ case $reason in
|
||||
echo "source_hook initqueue/online $netif"
|
||||
[ -e /tmp/net.$netif.manualup ] || echo "/sbin/netroot $netif"
|
||||
echo "> /tmp/setup_net_$netif.ok"
|
||||
echo "rm -f $hookdir/initqueue/setup_net_$netif.sh"
|
||||
echo "> /tmp/setup_net_\$(cat /sys/class/net/$netif/address).ok"
|
||||
echo "rm -f -- $hookdir/initqueue/setup_net_$netif.sh"
|
||||
} > $hookdir/initqueue/setup_net_$netif.sh
|
||||
|
||||
echo "[ -f /tmp/setup_net_$netif.ok ]" > $hookdir/initqueue/finished/dhclient-$netif.sh
|
||||
|
@@ -2,20 +2,24 @@
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# Don't continue if root is ok
|
||||
[ -n "$rootok" ] && return
|
||||
|
||||
# This script is sourced, so root should be set. But let's be paranoid
|
||||
[ -z "$root" ] && root=$(getarg root=)
|
||||
[ -z "$netroot" ] && netroot=$(getarg netroot=)
|
||||
|
||||
if [ "$root" = "dhcp" ] || [ "$root" = "dhcp6" ] || [ "$netroot" = "dhcp" ] ; then
|
||||
if [ -z "$netroot" ]; then
|
||||
for netroot in $(getargs netroot=); do
|
||||
[ "$netroot" = "dhcp" ] && break
|
||||
[ "$netroot" = "dhcp6" ] && break
|
||||
done
|
||||
[ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] || unset netroot
|
||||
fi
|
||||
|
||||
if [ "$root" = "dhcp" ] || [ "$root" = "dhcp6" ] || [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ]; then
|
||||
# Tell ip= checker that we need dhcp
|
||||
NEEDDHCP="1"
|
||||
|
||||
# Done, all good!
|
||||
rootok=1
|
||||
if [ "$netroot" != "dhcp" ] ; then
|
||||
if [ "$netroot" != "dhcp" ] && [ "$netroot" != "dhcp6" ]; then
|
||||
netroot=$root
|
||||
fi
|
||||
|
||||
|
@@ -17,27 +17,28 @@ type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
|
||||
# $netif reads easier than $1
|
||||
netif=$1
|
||||
use_bridge='false'
|
||||
use_vlan='false'
|
||||
|
||||
# enslave this interface to bond?
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
for i in /tmp/bond.*.info; do
|
||||
[ -e "$i" ] || continue
|
||||
unset bondslaves
|
||||
unset bondname
|
||||
. "$i"
|
||||
for slave in $bondslaves ; do
|
||||
if [ "$netif" = "$slave" ] ; then
|
||||
netif=$bondname
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
# bridge this interface?
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
for ethname in $ethnames ; do
|
||||
if [ "$netif" = "$ethname" ]; then
|
||||
if [ "$netif" = "$bondname" ] && [ -n "$DO_BOND_SETUP" ] ; then
|
||||
: # We need to really setup bond (recursive call)
|
||||
else
|
||||
netif="$bridgename"
|
||||
fi
|
||||
if [ -e /tmp/team.info ]; then
|
||||
. /tmp/team.info
|
||||
for slave in $teamslaves ; do
|
||||
if [ "$netif" = "$slave" ] ; then
|
||||
netif=$teammaster
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@@ -47,12 +48,34 @@ if [ -e /tmp/vlan.info ]; then
|
||||
if [ "$netif" = "$phydevice" ]; then
|
||||
if [ "$netif" = "$bondname" ] && [ -n "$DO_BOND_SETUP" ] ; then
|
||||
: # We need to really setup bond (recursive call)
|
||||
elif [ "$netif" = "$teammaster" ] && [ -n "$DO_TEAM_SETUP" ] ; then
|
||||
: # We need to really setup team (recursive call)
|
||||
else
|
||||
netif="$vlanname"
|
||||
use_vlan='true'
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# bridge this interface?
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
for ethname in $ethnames ; do
|
||||
if [ "$netif" = "$ethname" ]; then
|
||||
if [ "$netif" = "$bondname" ] && [ -n "$DO_BOND_SETUP" ] ; then
|
||||
: # We need to really setup bond (recursive call)
|
||||
elif [ "$netif" = "$teammaster" ] && [ -n "$DO_TEAM_SETUP" ] ; then
|
||||
: # We need to really setup team (recursive call)
|
||||
elif [ "$netif" = "$vlanname" ] && [ -n "$DO_VLAN_SETUP" ]; then
|
||||
: # We need to really setup vlan (recursive call)
|
||||
else
|
||||
netif="$bridgename"
|
||||
use_bridge='true'
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# disable manual ifup while netroot is set for simplifying our logic
|
||||
# in netroot case we prefer netroot to bringup $netif automaticlly
|
||||
[ -n "$2" -a "$2" = "-m" ] && [ -z "$netroot" ] && manualup="$2"
|
||||
@@ -84,44 +107,34 @@ do_ipv6auto() {
|
||||
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
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
linkup $netif
|
||||
wait_for_ipv6_auto $netif
|
||||
|
||||
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
|
||||
namesrv=$(getargs nameserver)
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
return 0
|
||||
}
|
||||
|
||||
# Handle static ip configuration
|
||||
do_static() {
|
||||
strstr $ip '*:*:*' && load_ipv6
|
||||
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
[ -n "$macaddr" ] && ip link set address $macaddr
|
||||
[ -n "$mtu" ] && ip link set mtu $mtu
|
||||
linkup $netif
|
||||
[ -n "$macaddr" ] && ip link set address $macaddr dev $netif
|
||||
[ -n "$mtu" ] && ip link set mtu $mtu dev $netif
|
||||
if strstr $ip '*:*:*'; then
|
||||
# note no ip addr flush for ipv6
|
||||
ip addr add $ip/$mask dev $netif
|
||||
ip addr add $ip/$mask ${srv:+peer $srv} dev $netif
|
||||
else
|
||||
ip addr flush dev $netif
|
||||
ip addr add $ip/$mask brd + dev $netif
|
||||
ip addr add $ip/$mask ${srv:+peer $srv} brd + dev $netif
|
||||
fi
|
||||
|
||||
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
|
||||
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
|
||||
namesrv=$(getargs nameserver)
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
> /tmp/setup_net_${netif}.ok
|
||||
return 0
|
||||
}
|
||||
|
||||
# loopback is always handled the same way
|
||||
@@ -132,11 +145,12 @@ if [ "$netif" = "lo" ] ; then
|
||||
fi
|
||||
|
||||
# start bond if needed
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
if [ -e /tmp/bond.${netif}.info ]; then
|
||||
. /tmp/bond.${netif}.info
|
||||
|
||||
if [ "$netif" = "$bondname" ] && [ ! -e /tmp/net.$bondname.up ] ; then # We are master bond device
|
||||
modprobe bonding
|
||||
echo "+$netif" > /sys/class/net/bonding_masters
|
||||
ip link set $netif down
|
||||
|
||||
# Stolen from ifup-eth
|
||||
@@ -157,13 +171,12 @@ if [ -e /tmp/bond.info ]; then
|
||||
fi
|
||||
done
|
||||
|
||||
ip link set $netif up
|
||||
linkup $netif
|
||||
|
||||
for slave in $bondslaves ; do
|
||||
ip link set $slave down
|
||||
echo "+$slave" > /sys/class/net/$bondname/bonding/slaves
|
||||
ip link set $slave up
|
||||
wait_for_if_up $slave
|
||||
linkup $slave
|
||||
done
|
||||
|
||||
# add the bits to setup the needed post enslavement parameters
|
||||
@@ -177,6 +190,28 @@ if [ -e /tmp/bond.info ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -e /tmp/team.info ]; then
|
||||
. /tmp/team.info
|
||||
if [ "$netif" = "$teammaster" ] && [ ! -e /tmp/net.$teammaster.up ] ; then
|
||||
# We shall only bring up those _can_ come up
|
||||
# in case of some slave is gone in active-backup mode
|
||||
working_slaves=""
|
||||
for slave in $teamslaves ; do
|
||||
ip link set $slave up 2>/dev/null
|
||||
if wait_for_if_up $slave; then
|
||||
working_slaves+="$slave "
|
||||
fi
|
||||
done
|
||||
# Do not add slaves now
|
||||
teamd -d -U -n -t $teammaster -f /etc/teamd/$teammaster.conf
|
||||
for slave in $working_slaves; do
|
||||
# team requires the slaves to be down before joining team
|
||||
ip link set $slave down
|
||||
teamdctl $teammaster port add $slave
|
||||
done
|
||||
ip link set $teammaster up
|
||||
fi
|
||||
fi
|
||||
|
||||
# XXX need error handling like dhclient-script
|
||||
|
||||
@@ -189,10 +224,13 @@ if [ -e /tmp/bridge.info ]; then
|
||||
for ethname in $ethnames ; do
|
||||
if [ "$ethname" = "$bondname" ] ; then
|
||||
DO_BOND_SETUP=yes ifup $bondname -m
|
||||
elif [ "$ethname" = "$teammaster" ] ; then
|
||||
DO_TEAM_SETUP=yes ifup $teammaster -m
|
||||
elif [ "$ethname" = "$vlanname" ]; then
|
||||
DO_VLAN_SETUP=yes ifup $vlanname -m
|
||||
else
|
||||
ip link set $ethname up
|
||||
linkup $ethname
|
||||
fi
|
||||
wait_for_if_up $ethname
|
||||
brctl addif $bridgename $ethname
|
||||
done
|
||||
fi
|
||||
@@ -201,10 +239,10 @@ fi
|
||||
get_vid() {
|
||||
case "$1" in
|
||||
vlan*)
|
||||
return ${1#vlan}
|
||||
echo ${1#vlan}
|
||||
;;
|
||||
*.*)
|
||||
return ${1##*.}
|
||||
echo ${1##*.}
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@@ -213,13 +251,23 @@ if [ "$netif" = "$vlanname" ] && [ ! -e /tmp/net.$vlanname.up ]; then
|
||||
modprobe 8021q
|
||||
if [ "$phydevice" = "$bondname" ] ; then
|
||||
DO_BOND_SETUP=yes ifup $phydevice -m
|
||||
elif [ "$phydevice" = "$teammaster" ] ; then
|
||||
DO_TEAM_SETUP=yes ifup $phydevice -m
|
||||
else
|
||||
ip link set "$phydevice" up
|
||||
linkup "$phydevice"
|
||||
fi
|
||||
wait_for_if_up "$phydevice"
|
||||
ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname; echo $?)"
|
||||
ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname)"
|
||||
ip link set "$vlanname" up
|
||||
fi
|
||||
|
||||
# setup nameserver
|
||||
namesrv=$(getargs nameserver)
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
|
||||
# No ip lines default to dhcp
|
||||
ip=$(getarg ip)
|
||||
|
||||
@@ -231,6 +279,7 @@ if [ -z "$ip" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Specific configuration, spin through the kernel command line
|
||||
# looking for ip= lines
|
||||
for p in $(getargs ip=); do
|
||||
@@ -238,8 +287,21 @@ for p in $(getargs ip=); do
|
||||
# skip ibft
|
||||
[ "$autoconf" = "ibft" ] && continue
|
||||
|
||||
case "$dev" in
|
||||
??:??:??:??:??:??) # MAC address
|
||||
_dev=$(iface_for_mac $dev)
|
||||
[ -n "$_dev" ] && dev="$_dev"
|
||||
;;
|
||||
??-??-??-??-??-??) # MAC address in BOOTIF form
|
||||
_dev=$(iface_for_mac $(fix_bootif $dev))
|
||||
[ -n "$_dev" ] && dev="$_dev"
|
||||
;;
|
||||
esac
|
||||
|
||||
# If this option isn't directed at our interface, skip it
|
||||
[ -n "$dev" ] && [ "$dev" != "$netif" ] && continue
|
||||
[ -n "$dev" ] && [ "$dev" != "$netif" ] && \
|
||||
[ "$use_bridge" != 'true' ] && \
|
||||
[ "$use_vlan" != 'true' ] && continue
|
||||
|
||||
# Store config for later use
|
||||
for i in ip srv gw mask hostname macaddr; do
|
||||
@@ -271,6 +333,12 @@ for p in $(getargs ip=); do
|
||||
;;
|
||||
esac
|
||||
|
||||
break
|
||||
exit 0
|
||||
done
|
||||
|
||||
# no ip option directed at our interface?
|
||||
if [ ! -e /tmp/setup_net_${netif}.ok ]; then
|
||||
do_dhcp -4
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
@@ -16,7 +16,6 @@ check() {
|
||||
}
|
||||
|
||||
depends() {
|
||||
[ -d /etc/sysconfig/network-scripts/ ] && echo ifcfg
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -64,21 +63,17 @@ installkernel() {
|
||||
{ find_kernel_modules_by_path drivers/net; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/net; fi; } \
|
||||
| net_module_filter | instmods
|
||||
|
||||
instmods =drivers/net/phy
|
||||
instmods ecb arc4
|
||||
# bridge modules
|
||||
instmods bridge stp llc
|
||||
instmods ipv6
|
||||
# bonding
|
||||
instmods bonding
|
||||
# vlan
|
||||
instmods 8021q
|
||||
#instmods() will take care of hostonly
|
||||
instmods =drivers/net/phy ecb arc4 bridge stp llc ipv6 bonding 8021q af_packet virtio_net =drivers/net/team
|
||||
}
|
||||
|
||||
install() {
|
||||
local _arch _i _dir
|
||||
dracut_install ip arping dhclient sed
|
||||
dracut_install -o brctl
|
||||
inst_multiple ip arping dhclient sed
|
||||
inst_multiple -o ping ping6
|
||||
inst_multiple -o brctl
|
||||
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"
|
||||
@@ -87,8 +82,10 @@ install() {
|
||||
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"
|
||||
@@ -98,5 +95,7 @@ install() {
|
||||
|
||||
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
|
||||
{"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*"
|
||||
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
||||
|
@@ -2,59 +2,103 @@
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# pxelinux provides macaddr '-' separated, but we need ':'
|
||||
fix_bootif() {
|
||||
local macaddr=${1}
|
||||
local IFS='-'
|
||||
macaddr=$(for i in ${macaddr} ; do echo -n $i:; done)
|
||||
macaddr=${macaddr%:}
|
||||
# strip hardware type field from pxelinux
|
||||
[ -n "${macaddr%??:??:??:??:??:??}" ] && macaddr=${macaddr#??:}
|
||||
# return macaddr with lowercase alpha characters expected by udev
|
||||
echo $macaddr | sed 'y/ABCDEF/abcdef/'
|
||||
}
|
||||
getargbool 0 rd.neednet && NEEDNET=1
|
||||
|
||||
# Don't continue if we don't need network
|
||||
[ -z "$netroot" ] && ! [ -e "/tmp/net.ifaces" ] && return;
|
||||
if [ -z "$netroot" ] && [ ! -e "/tmp/net.ifaces" ] && [ "$NEEDNET" != "1" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
command -v fix_bootif >/dev/null || . /lib/net-lib.sh
|
||||
|
||||
# Write udev rules
|
||||
{
|
||||
# bridge: attempt only the defined interface
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
IFACES+=" ${ethnames%% *}"
|
||||
IFACES="$IFACES ${ethnames%% *}"
|
||||
MASTER_IFACES="$MASTER_IFACES $bridgename"
|
||||
fi
|
||||
|
||||
# bond: attempt only the defined interface (override bridge defines)
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
for i in /tmp/bond.*.info; do
|
||||
[ -e "$i" ] || continue
|
||||
unset bondslaves
|
||||
unset bondname
|
||||
. "$i"
|
||||
# It is enough to fire up only one
|
||||
IFACES+=" ${bondslaves%% *}"
|
||||
IFACES="$IFACES ${bondslaves%% *}"
|
||||
MASTER_IFACES="$MASTER_IFACES ${bondname}"
|
||||
done
|
||||
|
||||
if [ -e /tmp/team.info ]; then
|
||||
. /tmp/team.info
|
||||
IFACES="$IFACES ${teamslaves}"
|
||||
MASTER_IFACES="$MASTER_IFACES ${teammaster}"
|
||||
fi
|
||||
|
||||
if [ -e /tmp/vlan.info ]; then
|
||||
. /tmp/vlan.info
|
||||
IFACES+=" $phydevice"
|
||||
IFACES="$IFACES $phydevice"
|
||||
MASTER_IFACES="$MASTER_IFACES ${vlanname}"
|
||||
fi
|
||||
|
||||
if [ -z "$IFACES" ]; then
|
||||
[ -e /tmp/net.ifaces ] && read IFACES < /tmp/net.ifaces
|
||||
fi
|
||||
|
||||
if [ -e /tmp/net.bootdev ]; then
|
||||
bootdev=$(cat /tmp/net.bootdev)
|
||||
fi
|
||||
|
||||
ifup='/sbin/ifup $env{INTERFACE}'
|
||||
[ -z "$netroot" ] && ifup="$ifup -m"
|
||||
|
||||
# BOOTIF says everything, use only that one
|
||||
BOOTIF=$(getarg 'BOOTIF=')
|
||||
if [ -n "$BOOTIF" ] ; then
|
||||
BOOTIF=$(fix_bootif "$BOOTIF")
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="%s"\n' "$BOOTIF" "/sbin/initqueue --onetime $ifup"
|
||||
runcmd="RUN+=\"/sbin/initqueue --name ifup-\$env{INTERFACE} --unique --onetime $ifup\""
|
||||
|
||||
# If we have to handle multiple interfaces, handle only them.
|
||||
elif [ -n "$IFACES" ] ; then
|
||||
for iface in $IFACES ; do
|
||||
printf 'SUBSYSTEM=="net", ENV{INTERFACE}=="%s", RUN+="%s"\n' "$iface" "/sbin/initqueue --onetime $ifup"
|
||||
# We have some specific interfaces to handle
|
||||
if [ -n "$IFACES" ]; then
|
||||
echo 'SUBSYSTEM!="net", GOTO="net_end"'
|
||||
echo 'ACTION!="add|change|move", GOTO="net_end"'
|
||||
for iface in $IFACES; do
|
||||
case "$iface" in
|
||||
??:??:??:??:??:??) # MAC address
|
||||
cond="ATTR{address}==\"$iface\""
|
||||
echo "$cond, $runcmd, GOTO=\"net_end\""
|
||||
;;
|
||||
??-??-??-??-??-??) # MAC address in BOOTIF form
|
||||
cond="ATTR{address}==\"$(fix_bootif $iface)\""
|
||||
echo "$cond, $runcmd, GOTO=\"net_end\""
|
||||
;;
|
||||
*) # an interface name
|
||||
cond="ENV{INTERFACE}==\"$iface\""
|
||||
echo "$cond, $runcmd, GOTO=\"net_end\""
|
||||
cond="NAME==\"$iface\""
|
||||
echo "$cond, $runcmd, GOTO=\"net_end\""
|
||||
;;
|
||||
esac
|
||||
# The GOTO prevents us from trying to ifup the same device twice
|
||||
done
|
||||
echo 'LABEL="net_end"'
|
||||
|
||||
if [ -n "$MASTER_IFACES" ]; then
|
||||
wait_ifaces=$MASTER_IFACES
|
||||
else
|
||||
wait_ifaces=$IFACES
|
||||
fi
|
||||
|
||||
for iface in $wait_ifaces; do
|
||||
if [ "$bootdev" = "$iface" ] || [ "$NEEDNET" = "1" ]; then
|
||||
echo "[ -f /tmp/setup_net_${iface}.ok ]" >$hookdir/initqueue/finished/wait-$iface.sh
|
||||
fi
|
||||
done
|
||||
# Default: We don't know the interface to use, handle all
|
||||
# Fixme: waiting for the interface as well.
|
||||
else
|
||||
printf 'SUBSYSTEM=="net", RUN+="%s"\n' "/sbin/initqueue --onetime $ifup" > /etc/udev/rules.d/91-default-net.rules
|
||||
cond='ACTION=="add", SUBSYSTEM=="net"'
|
||||
# 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
|
||||
fi
|
||||
|
||||
# if you change the name of "90-net.rules", also change modules.d/80cms/cmssetup.sh
|
||||
} > /etc/udev/rules.d/90-net.rules
|
||||
|
@@ -1,4 +1,6 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
get_ip() {
|
||||
local iface="$1" ip=""
|
||||
@@ -12,6 +14,11 @@ iface_for_remote_addr() {
|
||||
echo $5
|
||||
}
|
||||
|
||||
iface_for_ip() {
|
||||
set -- $(ip -o addr show to $1)
|
||||
echo $2
|
||||
}
|
||||
|
||||
iface_for_mac() {
|
||||
local interface="" mac="$(echo $1 | sed 'y/ABCDEF/abcdef/')"
|
||||
for interface in /sys/class/net/*; do
|
||||
@@ -32,6 +39,45 @@ iface_has_link() {
|
||||
# XXX Do we need to reset the flags here? anaconda never bothered..
|
||||
}
|
||||
|
||||
find_iface_with_link() {
|
||||
local iface_path="" iface=""
|
||||
for iface_path in /sys/class/net/*; do
|
||||
iface=${iface_path##*/}
|
||||
str_starts "$iface" "lo" && continue
|
||||
if iface_has_link $iface; then
|
||||
echo "$iface"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# get the iface name for the given identifier - either a MAC, IP, or iface name
|
||||
iface_name() {
|
||||
case $1 in
|
||||
??:??:??:??:??:??|??-??-??-??-??-??) iface_for_mac $1 ;;
|
||||
*:*:*|*.*.*.*) iface_for_ip $1 ;;
|
||||
*) echo $1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# list the configured interfaces
|
||||
configured_ifaces() {
|
||||
local IFACES="" iface_id="" rv=1
|
||||
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
|
||||
if { pidof udevd || pidof systemd-udevd; } > /dev/null; then
|
||||
for iface_id in $IFACES; do
|
||||
echo $(iface_name $iface_id)
|
||||
rv=0
|
||||
done
|
||||
else
|
||||
warn "configured_ifaces called before udev is running"
|
||||
echo $IFACES
|
||||
[ -n "$IFACES" ] && rv=0
|
||||
fi
|
||||
return $rv
|
||||
}
|
||||
|
||||
all_ifaces_up() {
|
||||
local iface="" IFACES=""
|
||||
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
|
||||
@@ -59,7 +105,7 @@ ifdown() {
|
||||
ip link set $netif down
|
||||
ip addr flush dev $netif
|
||||
echo "#empty" > /etc/resolv.conf
|
||||
rm -f /tmp/net.$netif.did-setup
|
||||
rm -f -- /tmp/net.$netif.did-setup
|
||||
# TODO: send "offline" uevent?
|
||||
}
|
||||
|
||||
@@ -126,41 +172,93 @@ save_netinfo() {
|
||||
}
|
||||
|
||||
set_ifname() {
|
||||
local name="$1" mac="$2" num=0 n=""
|
||||
local name="$1" mac="$2" num=-1 n=""
|
||||
# if it's already set, return the existing name
|
||||
for n in $(getargs ifname=); do
|
||||
strstr "$n" "$mac" && echo ${n%%:*} && return
|
||||
done
|
||||
# otherwise, pick a new name and use that
|
||||
while [ -e /sys/class/$name$num ]; do num=$(($num+1)); done
|
||||
while :; do
|
||||
num=$(($num+1));
|
||||
[ -e /sys/class/net/$name$num ] && continue
|
||||
for n in $(getargs ifname=); do
|
||||
[ "$name$num" = "${n%%:*}" ] && continue 2
|
||||
done
|
||||
break
|
||||
done
|
||||
echo "ifname=$name$num:$mac" >> /etc/cmdline.d/45-ifname.conf
|
||||
echo "$name$num"
|
||||
}
|
||||
|
||||
# pxelinux provides macaddr '-' separated, but we need ':'
|
||||
fix_bootif() {
|
||||
local macaddr=${1}
|
||||
local IFS='-'
|
||||
macaddr=$(for i in ${macaddr} ; do echo -n $i:; done)
|
||||
macaddr=${macaddr%:}
|
||||
# strip hardware type field from pxelinux
|
||||
[ -n "${macaddr%??:??:??:??:??:??}" ] && macaddr=${macaddr#??:}
|
||||
# return macaddr with lowercase alpha characters expected by udev
|
||||
echo $macaddr | sed 'y/ABCDEF/abcdef/'
|
||||
}
|
||||
|
||||
ibft_to_cmdline() {
|
||||
local iface="" mac="" dev=""
|
||||
local dhcp="" ip="" gw="" mask="" hostname=""
|
||||
local iface=""
|
||||
modprobe -q iscsi_ibft
|
||||
(
|
||||
for iface in /sys/firmware/ibft/ethernet*; do
|
||||
local mac="" dev=""
|
||||
local dhcp="" ip="" gw="" mask="" hostname=""
|
||||
|
||||
[ -e ${iface}/mac ] || continue
|
||||
mac=$(read a < ${iface}/mac; echo $a)
|
||||
[ -z "$ifname_mac" ] && continue
|
||||
dev=$(set_ifname ibft $ifname_mac)
|
||||
dhcp=$(read a < ${iface}/dhcp; echo $a)
|
||||
[ -z "$mac" ] && continue
|
||||
dev=$(set_ifname ibft $mac)
|
||||
|
||||
[ -e /tmp/net.${dev}.has_ibft_config ] && continue
|
||||
|
||||
[ -e ${iface}/dhcp ] && dhcp=$(read a < ${iface}/dhcp; echo $a)
|
||||
|
||||
if [ -n "$dhcp" ]; then
|
||||
echo "ip=$dev:dhcp"
|
||||
elif [ -e ${iface}/ip-addr ]; then
|
||||
[ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a)
|
||||
# skip not assigned ip adresses
|
||||
[ "$ip" = "0.0.0.0" ] && continue
|
||||
[ -e ${iface}/gateway ] && gw=$(read a < ${iface}/gateway; echo $a)
|
||||
[ -e ${iface}/subnet-mask ] && mask=$(read a < ${iface}/subnet-mask; echo $a)
|
||||
[ -e ${iface}/hostname ] && hostname=$(read a < ${iface}/hostname; echo $a)
|
||||
if [ -n "$ip" ] && [ -n "$mask" ]; then
|
||||
echo "ip=$ip::$gw:$mask:$hostname:$dev:none"
|
||||
else
|
||||
warn "${iface} does not contain a valid iBFT configuration"
|
||||
warn "ip-addr=$ip"
|
||||
warn "gateway=$gw"
|
||||
warn "subnet-mask=$mask"
|
||||
warn "hostname=$hostname"
|
||||
fi
|
||||
else
|
||||
ip=$(read a < ${iface}/ip-addr; echo $a)
|
||||
gw=$(read a < ${iface}/gateway; echo $a)
|
||||
mask=$(read a < ${iface}/subnet-mask; echo $a)
|
||||
hostname=$(read a < ${iface}/hostname; echo $a)
|
||||
echo "ip=$ip::$gw:$mask:$hostname:$dev:none"
|
||||
info "${iface} does not contain a valid iBFT configuration"
|
||||
ls -l ${iface} | vinfo
|
||||
fi
|
||||
|
||||
if [ -e ${iface}/vlan ]; then
|
||||
vlan=$(read a < ${iface}/vlan; echo $a)
|
||||
if [ "$vlan" -ne "0" ]; then
|
||||
case "$vlan" in
|
||||
[0-9]*)
|
||||
echo "vlan=$dev.$vlan:$dev"
|
||||
;;
|
||||
*)
|
||||
echo "vlan=$vlan:$dev"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
echo $mac > /tmp/net.${dev}.has_ibft_config
|
||||
done
|
||||
) >> /etc/cmdline.d/40-ibft.conf
|
||||
# reread cmdline
|
||||
unset CMDLINE
|
||||
}
|
||||
|
||||
parse_iscsi_root()
|
||||
@@ -269,12 +367,20 @@ ip_to_var() {
|
||||
case $# in
|
||||
0) autoconf="error" ;;
|
||||
1) autoconf=$1 ;;
|
||||
2) dev=$1; autoconf=$2 ;;
|
||||
3) dev=$1; autoconf=$2; mtu=$3 ;;
|
||||
4) dev=$1; autoconf=$2; mtu=$3; macaddr=$4 ;;
|
||||
*) ip=$1; srv=$2; gw=$3; mask=$4; hostname=$5; dev=$6; autoconf=$7; mtu=$8; macaddr=$9 ;;
|
||||
2) [ -n "$1" ] && dev=$1; [ -n "$2" ] && autoconf=$2 ;;
|
||||
3) [ -n "$1" ] && dev=$1; [ -n "$2" ] && autoconf=$2; [ -n "$3" ] && mtu=$3 ;;
|
||||
4) [ -n "$1" ] && dev=$1; [ -n "$2" ] && autoconf=$2; [ -n "$3" ] && mtu=$3; [ -n "$4" ] && macaddr=$4 ;;
|
||||
*) [ -n "$1" ] && ip=$1; [ -n "$2" ] && srv=$2; [ -n "$3" ] && gw=$3; [ -n "$4" ] && mask=$4;
|
||||
[ -n "$5" ] && hostname=$5; [ -n "$6" ] && dev=$6; [ -n "$7" ] && autoconf=$7; [ -n "$8" ] && mtu=$8;
|
||||
if [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then
|
||||
macaddr="${9}:${10}:${11}:${12}:${13}:${14}"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
# anaconda-style argument cluster
|
||||
|
||||
# ip=<ipv4-address> means anaconda-style static config argument cluster:
|
||||
# ip=<ip> gateway=<gw> netmask=<nm> hostname=<host> mtu=<mtu>
|
||||
# ksdevice={link|bootif|ibft|<MAC>|<ifname>}
|
||||
if strstr "$autoconf" "*.*.*.*"; then
|
||||
ip="$autoconf"
|
||||
gw=$(getarg gateway=)
|
||||
@@ -283,9 +389,12 @@ ip_to_var() {
|
||||
dev=$(getarg ksdevice=)
|
||||
autoconf="none"
|
||||
mtu=$(getarg mtu=)
|
||||
|
||||
# handle special values for ksdevice
|
||||
case "$dev" in
|
||||
# ignore fancy values for ksdevice=XXX
|
||||
link|bootif|BOOTIF|ibft|*:*:*:*:*:*) dev="" ;;
|
||||
bootif|BOOTIF) dev=$(fix_bootif $(getarg BOOTIF=)) ;;
|
||||
link) dev="" ;; # FIXME: do something useful with this
|
||||
ibft) dev="" ;; # ignore - ibft is handled elsewhere
|
||||
esac
|
||||
fi
|
||||
}
|
||||
@@ -315,3 +424,62 @@ parse_ifname_opts() {
|
||||
esac
|
||||
|
||||
}
|
||||
|
||||
# some network driver need long time to initialize, wait before it's ready.
|
||||
wait_for_if_link() {
|
||||
local cnt=0
|
||||
local li
|
||||
while [ $cnt -lt 600 ]; do
|
||||
li=$(ip -o link show dev $1 2>/dev/null)
|
||||
[ -n "$li" ] && return 0
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
wait_for_if_up() {
|
||||
local cnt=0
|
||||
local li
|
||||
while [ $cnt -lt 200 ]; do
|
||||
li=$(ip -o link show up dev $1)
|
||||
[ -n "$li" ] && return 0
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
wait_for_route_ok() {
|
||||
local cnt=0
|
||||
while [ $cnt -lt 200 ]; do
|
||||
li=$(ip route show)
|
||||
[ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
wait_for_ipv6_auto() {
|
||||
local cnt=0
|
||||
local li
|
||||
while [ $cnt -lt 400 ]; do
|
||||
li=$(ip -6 addr show dev $1)
|
||||
strstr "$li" "dynamic" && return 0
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
linkup() {
|
||||
wait_for_if_link $1 2>/dev/null\
|
||||
&& ip link set $1 up 2>/dev/null\
|
||||
&& wait_for_if_up $1 2>/dev/null
|
||||
}
|
||||
|
||||
type hostname >/dev/null 2>&1 || \
|
||||
hostname() {
|
||||
cat /proc/sys/kernel/hostname
|
||||
}
|
||||
|
@@ -20,13 +20,22 @@ command -v setup_net >/dev/null || . /lib/net-lib.sh
|
||||
netif=$1
|
||||
[ -e "/tmp/net.bootdev" ] && read netif < /tmp/net.bootdev
|
||||
|
||||
case "$netif" in
|
||||
??:??:??:??:??:??) # MAC address
|
||||
for i in /sys/class/net/*/address; do
|
||||
mac=$(cat $i)
|
||||
if [ "$mac" = "$netif" ]; then
|
||||
i=${i%/address}
|
||||
netif=${i##*/}
|
||||
break
|
||||
fi
|
||||
done
|
||||
esac
|
||||
|
||||
# Figure out the handler for root=dhcp by recalling all netroot cmdline
|
||||
# handlers when this is not called from manually network bringing up.
|
||||
if [ -z "$2" ]; then
|
||||
if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] ; then
|
||||
# Unset root so we can check later
|
||||
unset root
|
||||
|
||||
# Load dhcp options
|
||||
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||
|
||||
@@ -42,6 +51,7 @@ if [ -z "$2" ]; then
|
||||
netroot=$new_root_path
|
||||
|
||||
# FIXME!
|
||||
unset rootok
|
||||
for f in $hookdir/cmdline/90*.sh; do
|
||||
[ -f "$f" ] && . "$f";
|
||||
done
|
||||
@@ -67,6 +77,7 @@ source_hook netroot $netif
|
||||
# Run the handler; don't store the root, it may change from device to device
|
||||
# XXX other variables to export?
|
||||
if $handler $netif $netroot $NEWROOT; then
|
||||
rm -f -- $hookdir/initqueue/finished/dhcp.sh
|
||||
# Network rootfs mount successful - save interface info for ifcfg etc.
|
||||
save_netinfo $netif
|
||||
fi
|
||||
|
@@ -54,8 +54,8 @@ if getarg bond >/dev/null; then
|
||||
fi
|
||||
# Make it suitable for initscripts export
|
||||
bondoptions=$(str_replace "$bondoptions" ";" ",")
|
||||
echo "bondname=$bondname" > /tmp/bond.info
|
||||
echo "bondslaves=\"$bondslaves\"" >> /tmp/bond.info
|
||||
echo "bondoptions=\"$bondoptions\"" >> /tmp/bond.info
|
||||
echo "bondname=$bondname" > /tmp/bond.${bondname}.info
|
||||
echo "bondslaves=\"$bondslaves\"" >> /tmp/bond.${bondname}.info
|
||||
echo "bondoptions=\"$bondoptions\"" >> /tmp/bond.${bondname}.info
|
||||
return
|
||||
fi
|
||||
|
@@ -37,12 +37,6 @@ parsebridge() {
|
||||
unset bridgename ethnames
|
||||
|
||||
iface=eth0
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
if [ -n "$bondname" ] ; then
|
||||
iface=$bondname
|
||||
fi
|
||||
fi
|
||||
|
||||
# Parse bridge for bridgename and ethnames
|
||||
if bridge="$(getarg bridge)"; then
|
||||
|
10
modules.d/40network/parse-ibft.sh
Executable file
10
modules.d/40network/parse-ibft.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
command -v getarg >/dev/null || . /lib/dracut-lib.sh
|
||||
command -v ibft_to_cmdline >/dev/null || . /lib/net-lib.sh
|
||||
|
||||
# If ibft is requested, read ibft vals and write ip=XXX cmdline args
|
||||
[ "ibft" = "$(getarg ip=)" ] && ibft_to_cmdline
|
||||
|
@@ -15,16 +15,8 @@
|
||||
#
|
||||
|
||||
command -v getarg >/dev/null || . /lib/dracut-lib.sh
|
||||
command -v ibft_to_cmdline >/dev/null || . /lib/net-lib.sh
|
||||
|
||||
# Don't mix BOOTIF=macaddr from pxelinux and ip= lines
|
||||
getarg ip= >/dev/null && getarg BOOTIF= >/dev/null && \
|
||||
die "Mixing BOOTIF and ip= lines is dangerous"
|
||||
|
||||
# No more parsing stuff, BOOTIF says everything
|
||||
[ -n "$(getarg BOOTIF)" ] && return
|
||||
|
||||
if [ -n "$netroot" ] && [ -z "$(getarg ip=)" ] ; then
|
||||
if [ -n "$netroot" ] && [ -z "$(getarg ip=)" ] && [ -z "$(getarg BOOTIF=)" ]; then
|
||||
# No ip= argument(s) for netroot provided, defaulting to DHCP
|
||||
return;
|
||||
fi
|
||||
@@ -40,19 +32,23 @@ fi
|
||||
unset count
|
||||
|
||||
# If needed, check if bootdev= contains anything usable
|
||||
if [ -n "$NEEDBOOTDEV" ] ; then
|
||||
BOOTDEV=$(getarg bootdev=) || die "Please supply bootdev argument for multiple ip= lines"
|
||||
[ -z "$BOOTDEV" ] && die "Bootdev argument is empty"
|
||||
fi
|
||||
BOOTDEV=$(getarg bootdev=)
|
||||
|
||||
# If ibft is requested, read ibft vals and write ip=XXX cmdline args
|
||||
[ "ibft" = "$(getarg ip=)" ] && ibft_to_cmdline
|
||||
if [ -n "$NEEDBOOTDEV" ] ; then
|
||||
[ -z "$BOOTDEV" ] && warn "Please supply bootdev argument for multiple ip= lines"
|
||||
fi
|
||||
|
||||
# Check ip= lines
|
||||
# XXX Would be nice if we could errorcheck ip addresses here as well
|
||||
for p in $(getargs ip=); do
|
||||
ip_to_var $p
|
||||
|
||||
# make first device specified the BOOTDEV
|
||||
if [ -z "$BOOTDEV" ] && [ -n "$dev" ]; then
|
||||
BOOTDEV="$dev"
|
||||
[ -n "$NEEDBOOTDEV" ] && warn "Setting bootdev to '$BOOTDEV'"
|
||||
fi
|
||||
|
||||
# skip ibft since we did it above
|
||||
[ "$autoconf" = "ibft" ] && continue
|
||||
|
||||
@@ -96,9 +92,6 @@ for p in $(getargs ip=); do
|
||||
IFACES="$IFACES $dev"
|
||||
fi
|
||||
|
||||
# Small optimization for udev rules
|
||||
[ -z "$NEEDBOOTDEV" ] && [ -n "$dev" ] && BOOTDEV=$dev
|
||||
|
||||
# Do we need to check for specific options?
|
||||
if [ -n "$NEEDDHCP" ] || [ -n "$DHCPORSERVER" ] ; then
|
||||
# Correct device? (Empty is ok as well)
|
||||
@@ -114,6 +107,12 @@ for p in $(getargs ip=); do
|
||||
|
||||
done
|
||||
|
||||
# put BOOTIF in IFACES to make sure it comes up
|
||||
if BOOTIF="$(getarg BOOTIF=)"; then
|
||||
BOOTDEV=$(fix_bootif $BOOTIF)
|
||||
IFACES="$BOOTDEV $IFACES"
|
||||
fi
|
||||
|
||||
# This ensures that BOOTDEV is always first in IFACES
|
||||
if [ -n "$BOOTDEV" ] && [ -n "$IFACES" ] ; then
|
||||
IFACES="${IFACES%$BOOTDEV*} ${IFACES#*$BOOTDEV}"
|
||||
@@ -123,6 +122,3 @@ fi
|
||||
# Store BOOTDEV and IFACES for later use
|
||||
[ -n "$BOOTDEV" ] && echo $BOOTDEV > /tmp/net.bootdev
|
||||
[ -n "$IFACES" ] && echo $IFACES > /tmp/net.ifaces
|
||||
|
||||
# We need a ip= line for the configured bootdev=
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$BOOTDEVOK" ] && die "Bootdev Argument '$BOOTDEV' not found"
|
||||
|
44
modules.d/40network/parse-team.sh
Executable file
44
modules.d/40network/parse-team.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Format:
|
||||
# team=<teammaster>:<teamslaves>
|
||||
#
|
||||
# teamslaves is a comma-separated list of physical (ethernet) interfaces
|
||||
#
|
||||
|
||||
# return if team already parsed
|
||||
[ -n "$teammaster" ] && return
|
||||
|
||||
# Check if team parameter is valid
|
||||
if getarg team= >/dev/null ; then
|
||||
:
|
||||
fi
|
||||
|
||||
parseteam() {
|
||||
local v=${1}:
|
||||
set --
|
||||
while [ -n "$v" ]; do
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
done
|
||||
|
||||
unset teammaster teamslaves
|
||||
case $# in
|
||||
2) teammaster=$1; teamslaves=$(str_replace "$2" "," " ") ;;
|
||||
*) die "team= requires two parameters" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
unset teammaster teamslaves
|
||||
|
||||
if getarg team>/dev/null; then
|
||||
# Read team= parameters if they exist
|
||||
team="$(getarg team=)"
|
||||
if [ ! "$team" = "team" ]; then
|
||||
parseteam "$(getarg team=)"
|
||||
fi
|
||||
|
||||
echo "teammaster=$teammaster" > /tmp/team.info
|
||||
echo "teamslaves=\"$teamslaves\"" >> /tmp/team.info
|
||||
return
|
||||
fi
|
@@ -3,6 +3,7 @@
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
[[ -d /etc/sysconfig/network-scripts ]] && return 0
|
||||
return 255
|
||||
}
|
||||
|
||||
|
@@ -4,19 +4,15 @@
|
||||
|
||||
# NFS root might have reached here before /tmp/net.ifaces was written
|
||||
udevadm settle --timeout=30
|
||||
# Don't write anything if we don't know our bootdev
|
||||
[ -f /tmp/net.ifaces ] || return 1
|
||||
|
||||
read IFACES < /tmp/net.ifaces
|
||||
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
fi
|
||||
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
fi
|
||||
|
||||
if [ -e /tmp/vlan.info ]; then
|
||||
. /tmp/vlan.info
|
||||
fi
|
||||
|
||||
mkdir -m 0755 -p /tmp/ifcfg/
|
||||
mkdir -m 0755 -p /tmp/ifcfg-leases/
|
||||
|
||||
@@ -83,11 +79,27 @@ print_s390() {
|
||||
echo "OPTIONS=\"${OPTIONS}\""
|
||||
}
|
||||
|
||||
for netup in /tmp/net.*.did-setup ; do
|
||||
[ -f $netup ] || continue
|
||||
|
||||
for netif in $IFACES ; do
|
||||
# bridge?
|
||||
netif=${netup%%.did-setup}
|
||||
netif=${netif##*/net.}
|
||||
[ -e /tmp/ifcfg/ifcfg-$netif ] && continue
|
||||
unset bridge
|
||||
unset bond
|
||||
unset bondslaves
|
||||
unset bondname
|
||||
unset bondoptions
|
||||
unset uuid
|
||||
unset ip
|
||||
unset gw
|
||||
unset mtu
|
||||
unset mask
|
||||
unset macaddr
|
||||
unset slave
|
||||
unset ethname
|
||||
[ -e /tmp/bond.${netif}.info ] && . /tmp/bond.${netif}.info
|
||||
|
||||
uuid=$(cat /proc/sys/kernel/random/uuid)
|
||||
if [ "$netif" = "$bridgename" ]; then
|
||||
bridge=yes
|
||||
@@ -95,55 +107,76 @@ for netif in $IFACES ; do
|
||||
# $netif can't be bridge and bond at the same time
|
||||
bond=yes
|
||||
fi
|
||||
if [ "$netif" = "$vlanname" ]; then
|
||||
vlan=yes
|
||||
fi
|
||||
cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$netif"
|
||||
echo "DEVICE=\"$netif\""
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "UUID=$uuid"
|
||||
[ -n "$mtu" ] && echo "MTU=$mtu"
|
||||
if [ -f /tmp/net.$netif.lease ]; then
|
||||
strstr "$ip" '*:*:*' &&
|
||||
echo "DHCPV6C=yes"
|
||||
echo "BOOTPROTO=dhcp"
|
||||
cp /tmp/net.$netif.lease /tmp/ifcfg-leases/dhclient-$uuid-$netif.lease
|
||||
echo "UUID=\"$uuid\""
|
||||
if [ -f /tmp/dhclient.$netif.lease ]; then
|
||||
[ -f /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||
strstr "$ip" '*:*:*' && echo "IPV6INIT=yes"
|
||||
if [ -f /tmp/net.$netif.has_ibft_config ]; then
|
||||
echo "BOOTPROTO=ibft"
|
||||
else
|
||||
echo "BOOTPROTO=dhcp"
|
||||
fi
|
||||
cp /tmp/dhclient.$netif.lease /tmp/ifcfg-leases/dhclient-$uuid-$netif.lease
|
||||
else
|
||||
# If we've booted with static ip= lines, the override file is there
|
||||
[ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
||||
if strstr "$ip" '*:*:*'; then
|
||||
echo "IPV6INIT=yes"
|
||||
echo "IPV6_AUTOCONF=no"
|
||||
echo "IPV6ADDR=$ip/$mask"
|
||||
echo "IPV6ADDR=\"$ip/$mask\""
|
||||
else
|
||||
echo "BOOTPROTO=none"
|
||||
echo "IPADDR=$ip"
|
||||
if strstr "$mask" "."; then
|
||||
echo "NETMASK=$mask"
|
||||
if [ -f /tmp/net.$netif.has_ibft_config ]; then
|
||||
echo "BOOTPROTO=ibft"
|
||||
else
|
||||
echo "PREFIX=$mask"
|
||||
echo "BOOTPROTO=none"
|
||||
echo "IPADDR=\"$ip\""
|
||||
if strstr "$mask" "."; then
|
||||
echo "NETMASK=\"$mask\""
|
||||
else
|
||||
echo "PREFIX=\"$mask\""
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if strstr "$gw" '*:*:*'; then
|
||||
echo "IPV6_DEFAULTGW=$gw"
|
||||
echo "IPV6_DEFAULTGW=\"$gw\""
|
||||
elif [ -n "$gw" ]; then
|
||||
echo "GATEWAY=$gw"
|
||||
echo "GATEWAY=\"$gw\""
|
||||
fi
|
||||
fi
|
||||
[ -n "$mtu" ] && echo "MTU=\"$mtu\""
|
||||
} > /tmp/ifcfg/ifcfg-$netif
|
||||
|
||||
# bridge needs different things written to ifcfg
|
||||
if [ -z "$bridge" ] && [ -z "$bond" ]; then
|
||||
if [ -z "$bridge" ] && [ -z "$bond" ] && [ -z "$vlan" ]; then
|
||||
# standard interface
|
||||
{
|
||||
if [ -n "$macaddr" ]; then
|
||||
echo "MACADDR=$macaddr"
|
||||
echo "MACADDR=\"$macaddr\""
|
||||
else
|
||||
echo "HWADDR=\"$(cat /sys/class/net/$netif/address)\""
|
||||
fi
|
||||
print_s390 $netif
|
||||
echo "TYPE=Ethernet"
|
||||
echo "NAME=\"Boot Disk\""
|
||||
[ -n "$mtu" ] && echo "MTU=$mtu"
|
||||
echo "NAME=\"$netif\""
|
||||
[ -n "$mtu" ] && echo "MTU=\"$mtu\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
fi
|
||||
|
||||
if [ -n "$vlan" ] ; then
|
||||
{
|
||||
echo "TYPE=Vlan"
|
||||
echo "NAME=\"$netif\""
|
||||
echo "VLAN=yes"
|
||||
echo "PHYSDEV=\"$phydevice\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
fi
|
||||
|
||||
@@ -152,22 +185,22 @@ for netif in $IFACES ; do
|
||||
{
|
||||
# This variable is an indicator of a bond interface for initscripts
|
||||
echo "BONDING_OPTS=\"$bondoptions\""
|
||||
echo "NAME=\"Boot Disk\""
|
||||
echo "NAME=\"$netif\""
|
||||
echo "TYPE=Bond"
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
|
||||
for slave in $bondslaves ; do
|
||||
# Set ONBOOT=no to prevent initscripts from trying to setup already bonded physical interface
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$slave"
|
||||
echo "DEVICE=\"$slave\""
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=no"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "HWADDR=$(cat /sys/class/net/$slave/address)"
|
||||
echo "HWADDR=\"$(cat /sys/class/net/$slave/address)\""
|
||||
echo "SLAVE=yes"
|
||||
echo "MASTER=$netif"
|
||||
echo "NAME=$slave"
|
||||
echo "MASTER=\"$netif\""
|
||||
echo "NAME=\"$slave\""
|
||||
} >> /tmp/ifcfg/ifcfg-$slave
|
||||
done
|
||||
fi
|
||||
@@ -176,52 +209,50 @@ for netif in $IFACES ; do
|
||||
# bridge
|
||||
{
|
||||
echo "TYPE=Bridge"
|
||||
echo "NAME=\"Boot Disk\""
|
||||
echo "NAME=\"$netif\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
if [ "$ethname" = "$bondname" ] ; then
|
||||
{
|
||||
# Set ONBOOT=no to prevent initscripts from trying to setup already bridged bond interface
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$bondname"
|
||||
echo "ONBOOT=no"
|
||||
echo "DEVICE=\"$bondname\""
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
# This variable is an indicator of a bond interface for initscripts
|
||||
echo "BONDING_OPTS=\"$bondoptions\""
|
||||
echo "BRIDGE=$netif"
|
||||
echo "BRIDGE=\"$netif\""
|
||||
echo "NAME=\"$bondname\""
|
||||
} >> /tmp/ifcfg/ifcfg-$bondname
|
||||
for slave in $bondslaves ; do
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
# Set ONBOOT=no to prevent initscripts from trying to setup already bridged physical interface
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$slave"
|
||||
echo "DEVICE=\"$slave\""
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=no"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "HWADDR=$(cat /sys/class/net/$slave/address)"
|
||||
echo "HWADDR=\"$(cat /sys/class/net/$slave/address)\""
|
||||
echo "SLAVE=yes"
|
||||
echo "MASTER=$bondname"
|
||||
echo "NAME=$slave"
|
||||
echo "MASTER=\"$bondname\""
|
||||
echo "NAME=\"$slave\""
|
||||
} >> /tmp/ifcfg/ifcfg-$slave
|
||||
done
|
||||
else
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$ethname"
|
||||
echo "DEVICE=\"$ethname\""
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=no"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "HWADDR=$(cat /sys/class/net/$ethname/address)"
|
||||
echo "BRIDGE=$netif"
|
||||
echo "NAME=$ethname"
|
||||
echo "HWADDR=\"$(cat /sys/class/net/$ethname/address)\""
|
||||
echo "BRIDGE=\"$netif\""
|
||||
echo "NAME=\"$ethname\""
|
||||
} >> /tmp/ifcfg/ifcfg-$ethname
|
||||
fi
|
||||
fi
|
||||
i=1
|
||||
for ns in $(getargs nameserver); do
|
||||
echo "DNS${i}=${ns}" >> /tmp/ifcfg/ifcfg-$netif
|
||||
echo "DNS${i}=\"${ns}\"" >> /tmp/ifcfg/ifcfg-$netif
|
||||
i=$((i+1))
|
||||
done
|
||||
done
|
||||
|
@@ -12,13 +12,29 @@ depends() {
|
||||
}
|
||||
|
||||
install() {
|
||||
local _dir _crt _found _lib
|
||||
inst_simple "$moddir/url-lib.sh" "/lib/url-lib.sh"
|
||||
dracut_install curl
|
||||
mkdir -m 0755 -p "$initdir/etc/ssl/certs"
|
||||
if ! inst_any -t /etc/ssl/certs/ca-bundle.crt \
|
||||
/etc/ssl/certs/ca-bundle.crt \
|
||||
/etc/ssl/certs/ca-certificates.crt; then
|
||||
dwarn "Couldn't find SSL CA cert bundle; HTTPS won't work."
|
||||
fi
|
||||
inst_multiple curl
|
||||
# also install libs for curl https
|
||||
inst_libdir_file "libnsspem.so*"
|
||||
inst_libdir_file "libnsssysinit.so*"
|
||||
inst_libdir_file "libsoftokn3.so*"
|
||||
inst_libdir_file "libsqlite3.so*"
|
||||
|
||||
for _dir in $libdirs; do
|
||||
[[ -d $_dir ]] || continue
|
||||
for _lib in $_dir/libcurl.so.*; do
|
||||
[[ -e $_lib ]] || continue
|
||||
_crt=$(grep -F --binary-files=text -z .crt $_lib)
|
||||
[[ $_crt ]] || continue
|
||||
[[ $_crt == /*/* ]] || continue
|
||||
if ! inst_simple "$_crt"; then
|
||||
dwarn "Couldn't install '$_crt' SSL CA cert bundle; HTTPS might not work."
|
||||
continue
|
||||
fi
|
||||
_found=1
|
||||
done
|
||||
done
|
||||
[[ $_found ]] || dwarn "Couldn't find SSL CA cert bundle; HTTPS won't work."
|
||||
}
|
||||
|
||||
|
@@ -23,7 +23,7 @@ fetch_url() {
|
||||
local handler="$(get_url_handler $url)"
|
||||
[ -n "$handler" ] || return 254
|
||||
[ -n "$url" ] || return 255
|
||||
$handler "$url" "$outloc"
|
||||
"$handler" "$url" "$outloc"
|
||||
}
|
||||
|
||||
# get_url_handler URL
|
||||
@@ -54,19 +54,26 @@ add_url_handler() {
|
||||
|
||||
export CURL_HOME="/run/initramfs/url-lib"
|
||||
mkdir -p $CURL_HOME
|
||||
curl_args="--location --retry 3 --fail --show-error"
|
||||
curl_args="--globoff --location --retry 3 --fail --show-error"
|
||||
getargbool 0 rd.noverifyssl && curl_args="$curl_args --insecure"
|
||||
|
||||
proxy=$(getarg proxy=)
|
||||
[ -n "$proxy" ] && curl_args="$curl_args --proxy $proxy"
|
||||
|
||||
curl_fetch_url() {
|
||||
local url="$1" outloc="$2"
|
||||
echo "$url" > /proc/self/fd/0
|
||||
if [ -n "$outloc" ]; then
|
||||
curl $curl_args --output "$outloc" "$url" || return $?
|
||||
curl $curl_args --output - -- "$url" > "$outloc" || return $?
|
||||
else
|
||||
local outdir="$(mkuniqdir /tmp curl_fetch_url)"
|
||||
( cd "$outdir"; curl $curl_args --remote-name "$url" || return $? )
|
||||
outloc="$outdir/$(ls -A $outdir)"
|
||||
fi
|
||||
[ -f "$outloc" ] || return 253
|
||||
if ! [ -f "$outloc" ]; then
|
||||
warn "Downloading '$url' failed!"
|
||||
return 253
|
||||
fi
|
||||
if [ -z "$2" ]; then echo "$outloc" ; fi
|
||||
}
|
||||
add_url_handler curl_fetch_url http https ftp
|
||||
@@ -99,18 +106,18 @@ nfs_fetch_url() {
|
||||
local filepath="${path%/*}" filename="${path##*/}" mntdir=""
|
||||
|
||||
# skip mount if server:/filepath is already mounted
|
||||
mntdir=$(nfs_already_mounted $server $path)
|
||||
mntdir=$(nfs_already_mounted "$server" "$path")
|
||||
if [ -z "$mntdir" ]; then
|
||||
local mntdir="$(mkuniqdir /run nfs_mnt)"
|
||||
mount_nfs $nfs:$server:$filepath${options:+:$options} $mntdir
|
||||
mount_nfs "$nfs:$server:$filepath${options:+:$options}" "$mntdir"
|
||||
# lazy unmount during pre-pivot hook
|
||||
inst_hook --hook pre-pivot --name 99url-lib-umount-nfs umount -l $mntdir
|
||||
inst_hook --hook pre-pivot --name 99url-lib-umount-nfs umount -l -- "$mntdir"
|
||||
fi
|
||||
|
||||
if [ -z "$outloc" ]; then
|
||||
outloc="$mntdir/$filename"
|
||||
else
|
||||
cp -f "$mntdir/$filename" "$outloc" || return $?
|
||||
cp -f -- "$mntdir/$filename" "$outloc" || return $?
|
||||
fi
|
||||
[ -f "$outloc" ] || return 253
|
||||
if [ -z "$2" ]; then echo "$outloc" ; fi
|
||||
|
63
modules.d/50drm/module-setup.sh
Normal file
63
modules.d/50drm/module-setup.sh
Normal file
@@ -0,0 +1,63 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
return 255
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
local _modname
|
||||
# Include KMS capable drm drivers
|
||||
|
||||
drm_module_filter() {
|
||||
local _drm_drivers='drm_crtc_init'
|
||||
local _ret
|
||||
# subfunctions inherit following FDs
|
||||
local _merge=8 _side2=9
|
||||
function nmf1() {
|
||||
local _fname _fcont
|
||||
while read _fname; do
|
||||
case "$_fname" in
|
||||
*.ko) _fcont="$(< $_fname)" ;;
|
||||
*.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
|
||||
*.ko.xz) _fcont="$(xz -dc $_fname)" ;;
|
||||
esac
|
||||
[[ $_fcont =~ $_drm_drivers
|
||||
&& ! $_fcont =~ iw_handler_get_spy ]] \
|
||||
&& echo "$_fname"
|
||||
done
|
||||
}
|
||||
function rotor() {
|
||||
local _f1 _f2
|
||||
while read _f1; do
|
||||
echo "$_f1"
|
||||
if read _f2; then
|
||||
echo "$_f2" 1>&${_side2}
|
||||
fi
|
||||
done | nmf1 1>&${_merge}
|
||||
}
|
||||
# Use two parallel streams to filter alternating modules.
|
||||
set +x
|
||||
eval "( ( rotor ) ${_side2}>&1 | nmf1 ) ${_merge}>&1"
|
||||
[[ $debug ]] && set -x
|
||||
return 0
|
||||
}
|
||||
|
||||
for _modname in $(find_kernel_modules_by_path drivers/gpu/drm \
|
||||
| drm_module_filter) ; do
|
||||
# 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 ]] && modinfo -F alias $_modname | sed -e 's,\?,\.,g' -e 's,\*,\.\*,g' \
|
||||
| grep -qxf - /sys/bus/pci/devices/*/modalias 2>/dev/null; then
|
||||
hostonly='' instmods $_modname
|
||||
continue
|
||||
fi
|
||||
instmods $_modname
|
||||
done
|
||||
}
|
@@ -1,4 +1,4 @@
|
||||
Dracut gensplash module
|
||||
dracut gensplash module
|
||||
-----------------------
|
||||
|
||||
INDEX
|
||||
|
@@ -2,7 +2,7 @@
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if getargbool 1 rd.splash -n rd_NO_SPLASH; then
|
||||
if getargbool 1 rd.splash -d -n rd_NO_SPLASH; then
|
||||
info "Starting Gentoo Splash"
|
||||
|
||||
[ -x /lib/udev/console_init ] && /lib/udev/console_init /dev/tty0
|
||||
|
@@ -71,7 +71,7 @@ install() {
|
||||
mv dev.old dev
|
||||
popd >/dev/null
|
||||
|
||||
dracut_install chvt
|
||||
inst_multiple chvt
|
||||
inst /usr/share/splashutils/initrd.splash /lib/gensplash-lib.sh
|
||||
inst_hook pre-pivot 90 "${moddir}"/gensplash-newroot.sh
|
||||
inst_hook pre-trigger 10 "${moddir}"/gensplash-pretrigger.sh
|
||||
|
@@ -4,63 +4,11 @@
|
||||
|
||||
check() {
|
||||
[[ "$mount_needs" ]] && return 1
|
||||
[[ -x /sbin/plymouthd && -x /bin/plymouth && -x /usr/sbin/plymouth-set-default-theme ]]
|
||||
type -P plymouthd >/dev/null && type -P plymouth >/dev/null
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
local _modname
|
||||
# Include KMS capable drm drivers
|
||||
|
||||
drm_module_filter() {
|
||||
local _drm_drivers='drm_crtc_init'
|
||||
local _ret
|
||||
# subfunctions inherit following FDs
|
||||
local _merge=8 _side2=9
|
||||
function nmf1() {
|
||||
local _fname _fcont
|
||||
while read _fname; do
|
||||
case "$_fname" in
|
||||
*.ko) _fcont="$(< $_fname)" ;;
|
||||
*.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
|
||||
*.ko.xz) _fcont="$(xz -dc $_fname)" ;;
|
||||
esac
|
||||
[[ $_fcont =~ $_drm_drivers
|
||||
&& ! $_fcont =~ iw_handler_get_spy ]] \
|
||||
&& echo "$_fname"
|
||||
done
|
||||
}
|
||||
function rotor() {
|
||||
local _f1 _f2
|
||||
while read _f1; do
|
||||
echo "$_f1"
|
||||
if read _f2; then
|
||||
echo "$_f2" 1>&${_side2}
|
||||
fi
|
||||
done | nmf1 1>&${_merge}
|
||||
}
|
||||
# Use two parallel streams to filter alternating modules.
|
||||
set +x
|
||||
eval "( ( rotor ) ${_side2}>&1 | nmf1 ) ${_merge}>&1"
|
||||
[[ $debug ]] && set -x
|
||||
return 0
|
||||
}
|
||||
|
||||
for _modname in $(find_kernel_modules_by_path drivers/gpu/drm \
|
||||
| drm_module_filter) ; do
|
||||
# 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 ]] && modinfo -F alias $_modname | sed -e 's,\?,\.,g' -e 's,\*,\.\*,g' \
|
||||
| grep -qxf - /sys/bus/pci/devices/*/modalias; then
|
||||
hostonly='' instmods $_modname
|
||||
continue
|
||||
fi
|
||||
instmods $_modname
|
||||
done
|
||||
echo drm
|
||||
}
|
||||
|
||||
install() {
|
||||
@@ -69,16 +17,16 @@ install() {
|
||||
. "$moddir"/plymouth-populate-initrd.sh
|
||||
else
|
||||
PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \
|
||||
/usr/libexec/plymouth/plymouth-populate-initrd -t $initdir
|
||||
/usr/libexec/plymouth/plymouth-populate-initrd -t "$initdir"
|
||||
fi
|
||||
|
||||
inst_hook pre-pivot 90 "$moddir"/plymouth-newroot.sh
|
||||
inst_hook pre-trigger 10 "$moddir"/plymouth-pretrigger.sh
|
||||
inst_hook emergency 50 "$moddir"/plymouth-emergency.sh
|
||||
dracut_install readlink
|
||||
|
||||
if [[ -x $systemdutildir/systemd ]]; then
|
||||
dracut_install -o $systemdsystemunitdir/plymouth-quit-wait.service
|
||||
inst_multiple readlink
|
||||
|
||||
if ! dracut_module_included "systemd"; then
|
||||
inst_hook pre-trigger 10 "$moddir"/plymouth-pretrigger.sh
|
||||
inst_hook pre-pivot 90 "$moddir"/plymouth-newroot.sh
|
||||
fi
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
[ -x /bin/plymouth ] && /bin/plymouth --hide-splash
|
||||
plymouth --hide-splash 2>/dev/null || :
|
||||
|
@@ -2,6 +2,6 @@
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if [ -x /bin/plymouth ]; then
|
||||
/bin/plymouth --newroot=$NEWROOT
|
||||
if type plymouth >/dev/null 2>&1 && [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
plymouth --newroot=$NEWROOT
|
||||
fi
|
||||
|
@@ -4,17 +4,16 @@
|
||||
PLYMOUTH_LOGO_FILE="/usr/share/pixmaps/system-logo-white.png"
|
||||
PLYMOUTH_THEME=$(plymouth-set-default-theme)
|
||||
|
||||
inst /sbin/plymouthd /bin/plymouthd
|
||||
dracut_install /bin/plymouth \
|
||||
inst_multiple plymouthd plymouth \
|
||||
"${PLYMOUTH_LOGO_FILE}" \
|
||||
/etc/system-release
|
||||
|
||||
mkdir -m 0755 -p "${initdir}/usr/share/plymouth"
|
||||
|
||||
inst_libdir_file "plymouth/text.so" "plymouth/details.so"
|
||||
|
||||
|
||||
if [[ $hostonly ]]; then
|
||||
dracut_install \
|
||||
inst_multiple \
|
||||
"/usr/share/plymouth/themes/details/details.plymouth" \
|
||||
"/usr/share/plymouth/themes/text/text.plymouth" \
|
||||
|
||||
@@ -36,7 +35,7 @@ else
|
||||
[[ -f "$x" ]] || continue
|
||||
THEME_DIR=$(dirname "$x")
|
||||
mkdir -m 0755 -p "${initdir}/$THEME_DIR"
|
||||
dracut_install "$x"
|
||||
inst_multiple "$x"
|
||||
done
|
||||
(
|
||||
cd ${initdir}/usr/share/plymouth/themes;
|
||||
|
@@ -2,8 +2,8 @@
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if [ -x /bin/plymouthd ]; then
|
||||
if getargbool 1 plymouth.enable && getargbool 1 rd.plymouth -n rd_NO_PLYMOUTH; then
|
||||
if type plymouthd >/dev/null 2>&1 && [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
if getargbool 1 plymouth.enable && getargbool 1 rd.plymouth -d -n rd_NO_PLYMOUTH; then
|
||||
# first trigger graphics subsystem
|
||||
udevadm trigger --action=add --attr-match=class=0x030000 >/dev/null 2>&1
|
||||
# first trigger graphics and tty subsystem
|
||||
@@ -16,8 +16,8 @@ if [ -x /bin/plymouthd ]; then
|
||||
read consoledev rest < /sys/class/tty/console/active
|
||||
consoledev=${consoledev:-tty0}
|
||||
[ -x /lib/udev/console_init -a -e "/dev/$consoledev" ] && /lib/udev/console_init "/dev/$consoledev"
|
||||
[ -x /bin/plymouthd ] && /bin/plymouthd --attach-to-session --pid-file /run/plymouth/pid
|
||||
/bin/plymouth --show-splash 2>&1 | vinfo
|
||||
plymouthd --attach-to-session --pid-file /run/plymouth/pid
|
||||
plymouth --show-splash 2>&1 | vinfo
|
||||
# reset tty after plymouth messed with it
|
||||
[ -x /lib/udev/console_init -a -e "/dev/$consoledev" ] && /lib/udev/console_init "/dev/$consoledev"
|
||||
fi
|
||||
|
@@ -32,6 +32,7 @@ function cms_write_config()
|
||||
cat > /etc/sysconfig/network << EOF
|
||||
HOSTNAME=$HOSTNAME
|
||||
EOF
|
||||
echo "$HOSTNAME" > /etc/hostname
|
||||
if [ "$ipv6" ]; then
|
||||
echo "NETWORKING_IPV6=yes" >> /etc/sysconfig/network
|
||||
else
|
||||
|
@@ -27,12 +27,11 @@ else
|
||||
fi
|
||||
|
||||
{
|
||||
echo "ip=$IPADDR::$GATEWAY:$NETMASK:$HOSTNAME:$DEVICE:none:$MACADDR"
|
||||
echo "ip=$IPADDR::$GATEWAY:$NETMASK:$HOSTNAME:$DEVICE:none:$MTU:$MACADDR"
|
||||
for i in $DNS1 $DNS2; do
|
||||
echo "nameserver=$i"
|
||||
done
|
||||
} > /etc/cmdline.d/80-cms.conf
|
||||
unset CMDLINE
|
||||
|
||||
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
|
||||
IFACES="$IFACES $DEVICE"
|
||||
|
@@ -51,152 +51,164 @@ function dasd_settle_all() {
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
# prints a canonocalized device bus ID for a given devno of any format
|
||||
function canonicalize_devno()
|
||||
{
|
||||
case ${#1} in
|
||||
3) echo "0.0.0${1}" ;;
|
||||
4) echo "0.0.${1}" ;;
|
||||
*) echo "${1}" ;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
function canonicalize_devno()
|
||||
{
|
||||
case ${#1} in
|
||||
3) echo "0.0.0${1}" ;;
|
||||
4) echo "0.0.${1}" ;;
|
||||
*) echo "${1}" ;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
# read file from CMS and write it to /tmp
|
||||
function readcmsfile() # $1=dasdport $2=filename
|
||||
{
|
||||
local dev
|
||||
local numcpus
|
||||
local devname
|
||||
local ret=0
|
||||
if [ $# -ne 2 ]; then return; fi
|
||||
function readcmsfile() # $1=dasdport $2=filename
|
||||
{
|
||||
local dev
|
||||
local numcpus
|
||||
local devname
|
||||
local ret=0
|
||||
if [ $# -ne 2 ]; then return; fi
|
||||
# precondition: udevd created dasda block device node
|
||||
if ! dasd_cio_free -d $1 ; then
|
||||
echo $"DASD $1 could not be cleared from device blacklist"
|
||||
return 1
|
||||
fi
|
||||
if ! dasd_cio_free -d $1 ; then
|
||||
echo $"DASD $1 could not be cleared from device blacklist"
|
||||
return 1
|
||||
fi
|
||||
|
||||
modprobe dasd_mod dasd=$CMSDASD
|
||||
modprobe dasd_eckd_mod
|
||||
udevadm settle
|
||||
modprobe dasd_mod dasd=$CMSDASD
|
||||
modprobe dasd_eckd_mod
|
||||
udevadm settle
|
||||
|
||||
# precondition: dasd_eckd_mod driver incl. dependencies loaded,
|
||||
# dasd_mod must be loaded without setting any DASD online
|
||||
dev=$(canonicalize_devno $1)
|
||||
numcpus=$(
|
||||
while read line; do
|
||||
if strstr "$line" "# processors"; then
|
||||
echo ${line##*:};
|
||||
break;
|
||||
fi;
|
||||
done < /proc/cpuinfo
|
||||
)
|
||||
dev=$(canonicalize_devno $1)
|
||||
numcpus=$(
|
||||
while read line; do
|
||||
if strstr "$line" "# processors"; then
|
||||
echo ${line##*:};
|
||||
break;
|
||||
fi;
|
||||
done < /proc/cpuinfo
|
||||
)
|
||||
|
||||
if [ ${numcpus} -eq 1 ]; then
|
||||
echo 1 > /sys/bus/ccw/devices/$dev/online
|
||||
else
|
||||
if ! sysecho /sys/bus/ccw/devices/$dev/online 1; then
|
||||
echo $"DASD $dev could not be set online"
|
||||
return 1
|
||||
if [ ${numcpus} -eq 1 ]; then
|
||||
echo 1 > /sys/bus/ccw/devices/$dev/online
|
||||
else
|
||||
if ! sysecho /sys/bus/ccw/devices/$dev/online 1; then
|
||||
echo $"DASD $dev could not be set online"
|
||||
return 1
|
||||
fi
|
||||
udevadm settle
|
||||
if ! dasd_settle $dev ; then
|
||||
echo $"Could not access DASD $dev in time"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
udevadm settle
|
||||
if ! dasd_settle $dev ; then
|
||||
echo $"Could not access DASD $dev in time"
|
||||
return 1
|
||||
|
||||
devname=$(cd /sys/bus/ccw/devices/$dev/block; set -- *; [ -b /dev/$1 ] && echo $1)
|
||||
devname=${devname:-dasda}
|
||||
|
||||
[[ -d /mnt ]] || mkdir /mnt
|
||||
if cmsfs-fuse --to=UTF-8 -a /dev/$devname /mnt; then
|
||||
cat /mnt/$2 > /run/initramfs/$2
|
||||
umount /mnt || umount -l /mnt
|
||||
udevadm settle
|
||||
else
|
||||
echo $"Could not read conf file $2 on CMS DASD $1."
|
||||
ret=1
|
||||
fi
|
||||
fi
|
||||
|
||||
udevadm settle
|
||||
|
||||
devname=$(cd /sys/bus/ccw/devices/$dev/block; set -- *; [ -b /dev/$1 ] && echo $1)
|
||||
devname=${devname:-dasda}
|
||||
|
||||
[[ -d /mnt ]] || mkdir /mnt
|
||||
if cmsfs-fuse --to=UTF-8 -a /dev/$devname /mnt; then
|
||||
cat /mnt/$2 > /run/initramfs/$2
|
||||
umount /mnt || umount -l /mnt
|
||||
udevadm settle
|
||||
else
|
||||
echo $"Could not read conf file $2 on CMS DASD $1."
|
||||
ret=1
|
||||
fi
|
||||
|
||||
if ! sysecho /sys/bus/ccw/devices/$dev/online 0; then
|
||||
echo $"DASD $dev could not be set offline again"
|
||||
if ! sysecho /sys/bus/ccw/devices/$dev/online 0; then
|
||||
echo $"DASD $dev could not be set offline again"
|
||||
#return 1
|
||||
fi
|
||||
udevadm settle
|
||||
fi
|
||||
udevadm settle
|
||||
|
||||
# unbind all dasds to unload the dasd modules for a clean start
|
||||
( cd /sys/bus/ccw/drivers/dasd-eckd; for i in *.*; do echo $i > unbind;done)
|
||||
udevadm settle
|
||||
modprobe -r dasd_eckd_mod
|
||||
udevadm settle
|
||||
modprobe -r dasd_diag_mod
|
||||
udevadm settle
|
||||
modprobe -r dasd_mod
|
||||
udevadm settle
|
||||
return $ret
|
||||
}
|
||||
( cd /sys/bus/ccw/drivers/dasd-eckd; for i in *.*; do echo $i > unbind;done)
|
||||
udevadm settle
|
||||
modprobe -r dasd_eckd_mod
|
||||
udevadm settle
|
||||
modprobe -r dasd_diag_mod
|
||||
udevadm settle
|
||||
modprobe -r dasd_mod
|
||||
udevadm settle
|
||||
return $ret
|
||||
}
|
||||
|
||||
processcmsfile()
|
||||
{
|
||||
source /tmp/cms.conf
|
||||
processcmsfile()
|
||||
{
|
||||
source /tmp/cms.conf
|
||||
|
||||
if [[ $NETTYPE ]]; then
|
||||
(
|
||||
echo -n $NETTYPE,$SUBCHANNELS
|
||||
[[ $PORTNAME ]] && echo ",portname=$PORTNAME"
|
||||
[[ $LAYER2 ]] && echo ",layer2=$LAYER"
|
||||
[[ "$NETTYPE" = "ctc" ]] && [[ $CTCPROT ]] && echo ",protocol=$CTCPROT"
|
||||
echo
|
||||
) >> /etc/ccw.conf
|
||||
if [[ $NETTYPE ]]; then
|
||||
(
|
||||
echo -n $NETTYPE,$SUBCHANNELS
|
||||
[[ $PORTNAME ]] && echo -n ",portname=$PORTNAME"
|
||||
[[ $LAYER2 ]] && echo -n ",layer2=$LAYER2"
|
||||
[[ "$NETTYPE" = "ctc" ]] && [[ $CTCPROT ]] && echo -n ",protocol=$CTCPROT"
|
||||
echo
|
||||
) >> /etc/ccw.conf
|
||||
|
||||
OLDIFS=$IFS
|
||||
IFS=,
|
||||
read -a subch_array <<< "indexzero,$SUBCHANNELS"
|
||||
IFS=$OLDIFS
|
||||
devbusid=${subch_array[1]}
|
||||
if [ "$NETTYPE" = "ctc" ]; then
|
||||
driver="ctcm"
|
||||
else
|
||||
driver=$NETTYPE
|
||||
OLDIFS=$IFS
|
||||
IFS=,
|
||||
read -a subch_array <<< "indexzero,$SUBCHANNELS"
|
||||
IFS=$OLDIFS
|
||||
devbusid=${subch_array[1]}
|
||||
if [ "$NETTYPE" = "ctc" ]; then
|
||||
driver="ctcm"
|
||||
else
|
||||
driver=$NETTYPE
|
||||
fi
|
||||
|
||||
printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="%s", KERNELS=="%s", ENV{INTERFACE}=="?*", RUN+="/sbin/initqueue --onetime --unique --name cmsifup-$env{INTERFACE} /sbin/cmsifup $env{INTERFACE}"\n' "$driver" "$devbusid" > /etc/udev/rules.d/99-cms.rules
|
||||
# remove the default net rules
|
||||
rm -f -- /etc/udev/rules.d/91-default-net.rules
|
||||
[[ -f /etc/udev/rules.d/90-net.rules ]] \
|
||||
|| printf 'SUBSYSTEM=="net", ACTION=="online", RUN+="/sbin/initqueue --onetime --env netif=$env{INTERFACE} source_hook initqueue/online"\n' >> /etc/udev/rules.d/99-cms.rules
|
||||
udevadm control --reload
|
||||
znet_cio_free
|
||||
fi
|
||||
|
||||
printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="%s", KERNELS=="%s", ENV{INTERFACE}=="?*", RUN+="/sbin/initqueue --onetime --unique --name cmsifup-$env{INTERFACE} /sbin/cmsifup $env{INTERFACE}"\n' "$driver" "$devbusid" > /etc/udev/rules.d/99-cms.rules
|
||||
# remove the default net rules
|
||||
rm -f /etc/udev/rules.d/61-default-net.rules
|
||||
[[ -f /etc/udev/rules.d/60-net.rules ]] \
|
||||
|| printf 'SUBSYSTEM=="net", ACTION=="online", RUN+="/sbin/initqueue --onetime --env netif=$env{INTERFACE} source_hook initqueue/online"\n' >> /etc/udev/rules.d/99-cms.rules
|
||||
if [[ $DASD ]]; then
|
||||
echo $DASD | normalize_dasd_arg > /etc/dasd.conf
|
||||
echo "options dasd_mod dasd=$DASD" > /etc/modprobe.d/dasd_mod.conf
|
||||
dasd_cio_free
|
||||
fi
|
||||
|
||||
znet_cio_free
|
||||
fi
|
||||
unset _do_zfcp
|
||||
for i in ${!FCP_*}; do
|
||||
echo "${!i}" | while read port rest; do
|
||||
case $port in
|
||||
*.*.*)
|
||||
;;
|
||||
*.*)
|
||||
port="0.$port"
|
||||
;;
|
||||
*)
|
||||
port="0.0.$port"
|
||||
;;
|
||||
esac
|
||||
echo $port $rest >> /etc/zfcp.conf
|
||||
done
|
||||
_do_zfcp=1
|
||||
done
|
||||
[[ $_do_zfcp ]] && zfcp_cio_free
|
||||
unset _do_zfcp
|
||||
}
|
||||
|
||||
if [[ $DASD ]]; then
|
||||
echo $DASD | normalize_dasd_arg > /etc/dasd.conf
|
||||
echo "options dasd_mod dasd=$DASD" > /etc/modprobe.d/dasd_mod.conf
|
||||
dasd_cio_free
|
||||
fi
|
||||
|
||||
unset _do_zfcp
|
||||
for i in ${!FCP_*}; do
|
||||
echo "${!i}" >> /etc/zfcp.conf
|
||||
_do_zfcp=1
|
||||
done
|
||||
[[ $_do_zfcp ]] && zfcp_cio_free
|
||||
unset _do_zfcp
|
||||
}
|
||||
|
||||
[[ $CMSDASD ]] || CMSDASD=$(getarg "CMSDASD=")
|
||||
[[ $CMSCONFFILE ]] || CMSCONFFILE=$(getarg "CMSCONFFILE=")
|
||||
[[ $CMSDASD ]] || CMSDASD=$(getarg "CMSDASD=")
|
||||
[[ $CMSCONFFILE ]] || CMSCONFFILE=$(getarg "CMSCONFFILE=")
|
||||
|
||||
# Parse configuration
|
||||
if [ -n "$CMSDASD" -a -n "$CMSCONFFILE" ]; then
|
||||
if readcmsfile $CMSDASD $CMSCONFFILE; then
|
||||
ln -s /run/initramfs/$CMSCONFFILE /tmp/$CMSCONFFILE
|
||||
ln -s /run/initramfs/$CMSCONFFILE /tmp/cms.conf
|
||||
processcmsfile
|
||||
if [ -n "$CMSDASD" -a -n "$CMSCONFFILE" ]; then
|
||||
if readcmsfile $CMSDASD $CMSCONFFILE; then
|
||||
ln -s /run/initramfs/$CMSCONFFILE /tmp/$CMSCONFFILE
|
||||
ln -s /run/initramfs/$CMSCONFFILE /tmp/cms.conf
|
||||
processcmsfile
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
@@ -23,10 +23,11 @@ install() {
|
||||
inst_hook pre-trigger 30 "$moddir/cmssetup.sh"
|
||||
inst_hook pre-pivot 95 "$moddir/cms-write-ifcfg.sh"
|
||||
inst_script "$moddir/cmsifup.sh" /sbin/cmsifup
|
||||
dracut_install /etc/cmsfs-fuse/filetypes.conf /etc/udev/rules.d/99-fuse.rules /etc/fuse.conf \
|
||||
inst_multiple /etc/cmsfs-fuse/filetypes.conf /etc/udev/rules.d/99-fuse.rules /etc/fuse.conf \
|
||||
cmsfs-fuse fusermount ulockmgr_server bash insmod rmmod cat normalize_dasd_arg sed \
|
||||
$(rpm -ql s390utils-base)
|
||||
|
||||
inst_libdir_file "gconv/*"
|
||||
#inst /usr/lib/locale/locale-archive
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
33
modules.d/90bcache/module-setup.sh
Executable file
33
modules.d/90bcache/module-setup.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
if ! blkid -k | { while read line; do [[ $line == bcache ]] && exit 0; done; exit 1; } \
|
||||
&& ! type -P probe-bcache >/dev/null; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for fs in "${host_fs_types[@]}"; do
|
||||
[[ $fs = "bcache" ]] && return 0
|
||||
done
|
||||
return 255
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
instmods bcache
|
||||
}
|
||||
|
||||
install() {
|
||||
blkid -k | { while read line; do [[ $line == bcache ]] && exit 0; done; exit 1; } || inst_multiple probe-bcache
|
||||
inst_multiple ${udevdir}/bcache-register
|
||||
inst_rules 61-bcache.rules
|
||||
}
|
@@ -1,11 +1,8 @@
|
||||
SUBSYSTEM!="block", GOTO="btrfs_end"
|
||||
ACTION!="add|change", GOTO="btrfs_end"
|
||||
ENV{ID_FS_TYPE}!="btrfs", GOTO="btrfs_end"
|
||||
RUN+="/sbin/modprobe btrfs"
|
||||
RUN+="/sbin/btrfs device scan $env{DEVNAME}"
|
||||
|
||||
RUN+="/sbin/initqueue --finished --unique --name btrfs_finished /sbin/btrfs_finished"
|
||||
RUN+="/sbin/initqueue --timeout --onetime --unique --name btrfs_timeout /sbin/btrfs_timeout"
|
||||
|
||||
LABEL="btrfs_end"
|
||||
|
||||
|
21
modules.d/90btrfs/btrfs_device_ready.sh
Executable file
21
modules.d/90btrfs/btrfs_device_ready.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
btrfs_check_complete() {
|
||||
local _rootinfo _dev
|
||||
_dev="${1:-/dev/root}"
|
||||
[ -e "$_dev" ] || return 0
|
||||
_rootinfo=$(udevadm info --query=env "--name=$_dev" 2>/dev/null)
|
||||
if strstr "$_rootinfo" "ID_FS_TYPE=btrfs"; then
|
||||
info "Checking, if btrfs device complete"
|
||||
btrfs device ready "$_dev" >/dev/null 2>&1
|
||||
return $?
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
btrfs_check_complete $1
|
||||
exit $?
|
@@ -5,5 +5,4 @@
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
info "Scanning for all btrfs devices"
|
||||
/sbin/btrfs device scan 2>&1 | vinfo
|
||||
exit 0
|
||||
/sbin/btrfs device scan >/dev/null 2>&1
|
||||
|
@@ -9,12 +9,10 @@ check() {
|
||||
type -P btrfs >/dev/null || return 1
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
local _found
|
||||
for fs in ${host_fs_types[@]}; do
|
||||
strstr "$fs" "\|btrfs" && _found="1"
|
||||
[[ "$fs" == "btrfs" ]] && return 0
|
||||
done
|
||||
[[ $_found ]] || return 1
|
||||
unset _found
|
||||
return 255
|
||||
}
|
||||
|
||||
return 0
|
||||
@@ -26,13 +24,26 @@ depends() {
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
instmods btrfs crc32c
|
||||
instmods btrfs
|
||||
}
|
||||
|
||||
install() {
|
||||
inst_rules "$moddir/80-btrfs.rules"
|
||||
inst_script "$moddir/btrfs_finished.sh" /sbin/btrfs_finished
|
||||
inst_script "$moddir/btrfs_timeout.sh" /sbin/btrfs_timeout
|
||||
dracut_install btrfs btrfsck
|
||||
if ! inst_rules 64-btrfs.rules; then
|
||||
inst_rules "$moddir/80-btrfs.rules"
|
||||
case "$(btrfs --help)" in
|
||||
*device\ ready*)
|
||||
inst_script "$moddir/btrfs_device_ready.sh" /sbin/btrfs_finished ;;
|
||||
*)
|
||||
inst_script "$moddir/btrfs_finished.sh" /sbin/btrfs_finished ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if ! dracut_module_included "systemd"; then
|
||||
inst_script "$moddir/btrfs_timeout.sh" \
|
||||
/usr/lib/dracut/hooks/initqueue/timeout/btrfs_timeout.sh
|
||||
fi
|
||||
|
||||
inst_multiple -o btrfsck btrfs-zero-log
|
||||
inst $(command -v btrfs) /sbin/btrfs
|
||||
}
|
||||
|
||||
|
@@ -2,9 +2,9 @@
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
# close everything which is not busy
|
||||
rm -f /etc/udev/rules.d/70-luks.rules >/dev/null 2>&1
|
||||
rm -f -- /etc/udev/rules.d/70-luks.rules >/dev/null 2>&1
|
||||
|
||||
if ! getarg rd.luks.uuid rd_LUKS_UUID >/dev/null 2>&1 && getargbool 1 rd.luks -n rd_NO_LUKS >/dev/null 2>&1; then
|
||||
if ! getarg rd.luks.uuid -d rd_LUKS_UUID >/dev/null 2>&1 && getargbool 1 rd.luks -d -n rd_NO_LUKS >/dev/null 2>&1; then
|
||||
while true; do
|
||||
local do_break="y"
|
||||
for i in /dev/mapper/luks-*; do
|
||||
|
@@ -4,6 +4,19 @@
|
||||
|
||||
command -v getarg >/dev/null || . /lib/dracut-lib.sh
|
||||
|
||||
# check if the crypttab contains an entry for a LUKS UUID
|
||||
crypttab_contains() {
|
||||
local luks="$1"
|
||||
local l d rest
|
||||
if [ -f /etc/crypttab ]; then
|
||||
while read l d rest; do
|
||||
strstr "${l##luks-}" "${luks##luks-}" && return 0
|
||||
strstr "$d" "${luks##luks-}" && return 0
|
||||
done < /etc/crypttab
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
# ask_for_password
|
||||
#
|
||||
# Wraps around plymouth ask-for-password and adds fallback to tty password ask
|
||||
@@ -47,8 +60,8 @@ ask_for_password() {
|
||||
|
||||
{ flock -s 9;
|
||||
# Prompt for password with plymouth, if installed and running.
|
||||
if [ -x /bin/plymouth ] && /bin/plymouth --ping; then
|
||||
/bin/plymouth ask-for-password \
|
||||
if type plymouth >/dev/null 2>&1 && plymouth --ping 2>/dev/null; then
|
||||
plymouth ask-for-password \
|
||||
--prompt "$ply_prompt" --number-of-tries=$ply_tries \
|
||||
--command="$ply_cmd"
|
||||
ret=$?
|
||||
@@ -165,8 +178,15 @@ readkey() {
|
||||
local keydev="$2"
|
||||
local device="$3"
|
||||
|
||||
local mntp=$(mkuniqdir /mnt keydev)
|
||||
mount -r "$keydev" "$mntp" || die 'Mounting rem. dev. failed!'
|
||||
# This creates a unique single mountpoint for *, or several for explicitly
|
||||
# given LUKS devices. It accomplishes unlocking multiple LUKS devices with
|
||||
# a single password entry.
|
||||
local mntp="/mnt/$(str_replace "keydev-$keydev-$keypath" '/' '-')"
|
||||
|
||||
if [ ! -d "$mntp" ]; then
|
||||
mkdir "$mntp"
|
||||
mount -r "$keydev" "$mntp" || die 'Mounting rem. dev. failed!'
|
||||
fi
|
||||
|
||||
case "${keypath##*.}" in
|
||||
gpg)
|
||||
@@ -177,9 +197,22 @@ readkey() {
|
||||
die "No GPG support to decrypt '$keypath' on '$keydev'."
|
||||
fi
|
||||
;;
|
||||
img)
|
||||
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"
|
||||
return 0
|
||||
else
|
||||
die "No loop file support to decrypt '$keypath' on '$keydev'."
|
||||
fi
|
||||
;;
|
||||
*) cat "$mntp/$keypath" ;;
|
||||
esac
|
||||
|
||||
# General unmounting mechanism, modules doing custom cleanup should return earlier
|
||||
# and install a pre-pivot cleanup hook
|
||||
umount "$mntp"
|
||||
rmdir "$mntp"
|
||||
}
|
||||
|
33
modules.d/90crypt/crypt-run-generator.sh
Executable file
33
modules.d/90crypt/crypt-run-generator.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
type crypttab_contains >/dev/null 2>&1 || . /lib/dracut-crypt-lib.sh
|
||||
|
||||
dev=$1
|
||||
luks=$2
|
||||
|
||||
crypttab_contains "$luks" && exit 0
|
||||
|
||||
allowdiscards="-"
|
||||
|
||||
# parse for allow-discards
|
||||
if strstr "$(cryptsetup --help)" "allow-discards"; then
|
||||
if discarduuids=$(getargs "rd.luks.allow-discards"); then
|
||||
discarduuids=$(str_replace "$discarduuids" 'luks-' '')
|
||||
if strstr " $discarduuids " " ${luks##luks-}"; then
|
||||
allowdiscards="allow-discards"
|
||||
fi
|
||||
elif getargbool 0 rd.luks.allow-discards; then
|
||||
allowdiscards="allow-discards"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$luks $dev - timeout=0,$allowdiscards" >> /etc/crypttab
|
||||
|
||||
if command -v systemctl >/dev/null; then
|
||||
systemctl daemon-reload
|
||||
systemctl start cryptsetup.target
|
||||
fi
|
||||
exit 0
|
@@ -36,7 +36,7 @@ fi
|
||||
numtries=${3:-10}
|
||||
|
||||
# TODO: improve to support what cmdline does
|
||||
if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -n rd_NO_CRYPTTAB; then
|
||||
if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -d -n rd_NO_CRYPTTAB; then
|
||||
while read name dev luksfile luksoptions; do
|
||||
# ignore blank lines and comments
|
||||
if [ -z "$name" -o "${name#\#}" != "$name" ]; then
|
||||
@@ -97,10 +97,11 @@ done
|
||||
# parse for allow-discards
|
||||
if strstr "$(cryptsetup --help)" "allow-discards"; then
|
||||
if discarduuids=$(getargs "rd.luks.allow-discards"); then
|
||||
discarduuids=$(str_replace "$discarduuids" 'luks-' '')
|
||||
if strstr " $discarduuids " " ${luksdev##luks-}"; then
|
||||
allowdiscards="--allow-discards"
|
||||
fi
|
||||
elif getargbool rd.luks.allow-discards; then
|
||||
elif getargbool 0 rd.luks.allow-discards; then
|
||||
allowdiscards="--allow-discards"
|
||||
fi
|
||||
fi
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user