Compare commits
541 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
784df1e4e3 | ||
![]() |
6d82d7bcd5 | ||
![]() |
2614421601 | ||
![]() |
200e235dee | ||
![]() |
0636ce1a7f | ||
![]() |
6042b30c58 | ||
![]() |
604d1eb21a | ||
![]() |
14b43bcaee | ||
![]() |
c79f3883cd | ||
![]() |
df42cd3dbd | ||
![]() |
01bbe8311a | ||
![]() |
21928b97b0 | ||
![]() |
e82e54df2c | ||
![]() |
ecc6da6bf5 | ||
![]() |
b35ff065ec | ||
![]() |
187c355bf4 | ||
![]() |
70516a04fe | ||
![]() |
fcd65d2418 | ||
![]() |
9073ff54c1 | ||
![]() |
840d8e4733 | ||
![]() |
5ad3803dac | ||
![]() |
e04d02cc3a | ||
![]() |
51153fb18c | ||
![]() |
2268e3a32a | ||
![]() |
8b88dc7f71 | ||
![]() |
eecb3d5552 | ||
![]() |
f629355b2f | ||
![]() |
78274fe2b4 | ||
![]() |
4744e27350 | ||
![]() |
31cfc9aa5e | ||
![]() |
a2ead9a486 | ||
![]() |
db2b12fa91 | ||
![]() |
cbf66c5f06 | ||
![]() |
037984c80e | ||
![]() |
9337c692bc | ||
![]() |
c438bdb0d2 | ||
![]() |
144787fe30 | ||
![]() |
8eb81d482c | ||
![]() |
0363998d0a | ||
![]() |
806572d058 | ||
![]() |
81ea383998 | ||
![]() |
8442dc45b6 | ||
![]() |
cfede42fc3 | ||
![]() |
982d59afea | ||
![]() |
ca024e3378 | ||
![]() |
dbf8f6ba0e | ||
![]() |
02805bd1fc | ||
![]() |
965d14726a | ||
![]() |
b0772db56a | ||
![]() |
d695143329 | ||
![]() |
59aa65c9b2 | ||
![]() |
ffc5bf686d | ||
![]() |
ec3c59518d | ||
![]() |
cfe32ef5ba | ||
![]() |
8be5a0fa94 | ||
![]() |
bd4be59fb2 | ||
![]() |
a6d3be9dd5 | ||
![]() |
40913ad219 | ||
![]() |
afd1fd8d41 | ||
![]() |
38111b9622 | ||
![]() |
41153ca4f2 | ||
![]() |
3df2306981 | ||
![]() |
022c5a802f | ||
![]() |
832d85cbbc | ||
![]() |
f72318243c | ||
![]() |
a82d207b8d | ||
![]() |
53e3244dba | ||
![]() |
37427748d1 | ||
![]() |
6e26f9b447 | ||
![]() |
5bfbfbfc22 | ||
![]() |
2c431e8ec4 | ||
![]() |
8aeec251e3 | ||
![]() |
f2d887d7d5 | ||
![]() |
fe98cfee37 | ||
![]() |
cad10a7f80 | ||
![]() |
3734f4ae48 | ||
![]() |
4b13b2e2bf | ||
![]() |
f6a58604a0 | ||
![]() |
65ceb56dd5 | ||
![]() |
cce69be668 | ||
![]() |
a54658c158 | ||
![]() |
335bb5a35b | ||
![]() |
982161e062 | ||
![]() |
5a81678219 | ||
![]() |
168952cea6 | ||
![]() |
5dc1be1df8 | ||
![]() |
cb08b0132f | ||
![]() |
eb6e141adb | ||
![]() |
c6c704fda6 | ||
![]() |
eef7649e71 | ||
![]() |
f8d50f60b3 | ||
![]() |
476eb1b345 | ||
![]() |
c32908cee3 | ||
![]() |
dc1504121b | ||
![]() |
c6a91ec992 | ||
![]() |
689c3e1fcd | ||
![]() |
1bd76bf981 | ||
![]() |
2e7257a2e3 | ||
![]() |
76b83902dc | ||
![]() |
2de297334b | ||
![]() |
b4664769dc | ||
![]() |
7f217d7726 | ||
![]() |
8a1a2f6ca4 | ||
![]() |
bd66d2b59a | ||
![]() |
9f630a1889 | ||
![]() |
04ab68a4dd | ||
![]() |
a7c9cbe1a2 | ||
![]() |
97903dfc47 | ||
![]() |
25ff71b0c7 | ||
![]() |
324be70f80 | ||
![]() |
b8a81fb885 | ||
![]() |
0a35a80b93 | ||
![]() |
c9143a63fe | ||
![]() |
6625b74e90 | ||
![]() |
bd3bf2ce41 | ||
![]() |
f7cadaa843 | ||
![]() |
e173f0b384 | ||
![]() |
1e4a880125 | ||
![]() |
d8f0e320c2 | ||
![]() |
76c14799da | ||
![]() |
ef5c6eb927 | ||
![]() |
50bc2253d3 | ||
![]() |
f5af0df821 | ||
![]() |
b80078af39 | ||
![]() |
990e945ffd | ||
![]() |
8a5456e872 | ||
![]() |
46a1738161 | ||
![]() |
6c3b8e2c17 | ||
![]() |
b48f5e847c | ||
![]() |
bdb818997d | ||
![]() |
fc87119069 | ||
![]() |
078acb598b | ||
![]() |
030b8a160f | ||
![]() |
0e979d4829 | ||
![]() |
66b750a08e | ||
![]() |
31b6f4a3ae | ||
![]() |
a5cde2dd18 | ||
![]() |
2f6fe2ec79 | ||
![]() |
e03c77cb5b | ||
![]() |
b5c2fc1141 | ||
![]() |
513d26f7b7 | ||
![]() |
f1354b8af9 | ||
![]() |
b2de89c5dc | ||
![]() |
8d51acbbe9 | ||
![]() |
ac3f1c6e87 | ||
![]() |
61c4c83235 | ||
![]() |
85f8bb16b2 | ||
![]() |
6dd4370eaa | ||
![]() |
0441230c51 | ||
![]() |
26433e9c1f | ||
![]() |
4dd68ca415 | ||
![]() |
882c4c5a48 | ||
![]() |
2b59885976 | ||
![]() |
cb74b38247 | ||
![]() |
e7da9734d8 | ||
![]() |
0cec230406 | ||
![]() |
f06905139f | ||
![]() |
56bf6156d6 | ||
![]() |
317191848a | ||
![]() |
3d3f32aea3 | ||
![]() |
b7b062ba79 | ||
![]() |
4e25cf6edf | ||
![]() |
5055abb615 | ||
![]() |
abbb76fe93 | ||
![]() |
478314a90e | ||
![]() |
8cd592dfcb | ||
![]() |
d8eb522e80 | ||
![]() |
c3d81de59b | ||
![]() |
02aa795514 | ||
![]() |
0884261283 | ||
![]() |
f94ceb13b8 | ||
![]() |
4ce3a1b1bb | ||
![]() |
888d53f270 | ||
![]() |
dc824f1994 | ||
![]() |
3a00cf9ecc | ||
![]() |
803be5aa50 | ||
![]() |
52c4c9484d | ||
![]() |
7e60091c6b | ||
![]() |
04febed782 | ||
![]() |
2ff3fc73c8 | ||
![]() |
d33d60774f | ||
![]() |
f8208d682f | ||
![]() |
0635530dda | ||
![]() |
6e3cc00f48 | ||
![]() |
25aa3c5a6e | ||
![]() |
4d518aec86 | ||
![]() |
74db72dd0b | ||
![]() |
4fed3ddf16 | ||
![]() |
b8a9dc2d3f | ||
![]() |
2c0317213e | ||
![]() |
5861184e87 | ||
![]() |
6a2c23d125 | ||
![]() |
af8c8ed9f6 | ||
![]() |
b43d651511 | ||
![]() |
66666c670a | ||
![]() |
d37ad6aea0 | ||
![]() |
a3f00efc99 | ||
![]() |
8a0d2fc56f | ||
![]() |
ffcc64bdea | ||
![]() |
778f767bcc | ||
![]() |
e12c1a8da1 | ||
![]() |
8d021e4b8a | ||
![]() |
95268ffed3 | ||
![]() |
9eded206c9 | ||
![]() |
b642ce5340 | ||
![]() |
34769a1445 | ||
![]() |
b7ddf6c1d8 | ||
![]() |
cf38fc7389 | ||
![]() |
ddd01008ff | ||
![]() |
7a5f1ee46a | ||
![]() |
379c34d2cf | ||
![]() |
334cc28327 | ||
![]() |
edea870c3c | ||
![]() |
86191581d1 | ||
![]() |
07f3e4f168 | ||
![]() |
b6f0dcbda1 | ||
![]() |
5e5f3d5e6c | ||
![]() |
25b36ef124 | ||
![]() |
f5a9e45923 | ||
![]() |
1701d7adc8 | ||
![]() |
d18bc9070d | ||
![]() |
86bf239ede | ||
![]() |
d433da4473 | ||
![]() |
3249c257a0 | ||
![]() |
a6b63f9192 | ||
![]() |
b019d405d9 | ||
![]() |
004fd0557d | ||
![]() |
2efa546f26 | ||
![]() |
0330b91987 | ||
![]() |
e0a38de881 | ||
![]() |
d06580986b | ||
![]() |
03a44f0bf0 | ||
![]() |
8b6e099892 | ||
![]() |
34248c926c | ||
![]() |
14c47b0ee4 | ||
![]() |
edd3262efd | ||
![]() |
9cb8447c90 | ||
![]() |
cc227886c6 | ||
![]() |
6d2a7942aa | ||
![]() |
43dfbeec7b | ||
![]() |
3335ed0ef4 | ||
![]() |
b6e244f794 | ||
![]() |
14669e3a86 | ||
![]() |
552ecca6db | ||
![]() |
9373aec650 | ||
![]() |
30befb85e3 | ||
![]() |
ed293f6d0c | ||
![]() |
cd9592385d | ||
![]() |
7e2bca4820 | ||
![]() |
c4e48eaea1 | ||
![]() |
3905f6695e | ||
![]() |
2a3faa2df9 | ||
![]() |
86de902e35 | ||
![]() |
c1df00d2c6 | ||
![]() |
75cade1216 | ||
![]() |
a2c631c0a3 | ||
![]() |
6bee336909 | ||
![]() |
5c4bb360e3 | ||
![]() |
969394f503 | ||
![]() |
4977febf46 | ||
![]() |
285e81c9e2 | ||
![]() |
d663f5aeb0 | ||
![]() |
370329ca3b | ||
![]() |
5978983b30 | ||
![]() |
753c82d0e6 | ||
![]() |
9fcfa04ca9 | ||
![]() |
9c463909d6 | ||
![]() |
9d169a07ce | ||
![]() |
dee929cded | ||
![]() |
e0e2fb26c9 | ||
![]() |
fcbcb2521c | ||
![]() |
28f0b27fb9 | ||
![]() |
0ddc098eb0 | ||
![]() |
11c0e7d44e | ||
![]() |
dfb08e9f1c | ||
![]() |
e539fa9980 | ||
![]() |
e76921a58e | ||
![]() |
96d22bd7d6 | ||
![]() |
927d9273c4 | ||
![]() |
56a4cffd30 | ||
![]() |
682a2a9d1a | ||
![]() |
0b1296aa4f | ||
![]() |
fb67e4aa36 | ||
![]() |
4cfd24d179 | ||
![]() |
81dcf7c90a | ||
![]() |
075de7be45 | ||
![]() |
7b2d3d995c | ||
![]() |
d20d307d69 | ||
![]() |
12018c91ea | ||
![]() |
68910ba4a5 | ||
![]() |
a74eae77ac | ||
![]() |
ce18bc4e97 | ||
![]() |
567cc5d814 | ||
![]() |
56ac6c7e76 | ||
![]() |
59feafc6c7 | ||
![]() |
5ccc88a742 | ||
![]() |
de247618e7 | ||
![]() |
c6c6a08850 | ||
![]() |
204db8a134 | ||
![]() |
96b8d60a9b | ||
![]() |
4951a1199d | ||
![]() |
76a80dff18 | ||
![]() |
9ea901191e | ||
![]() |
3bdc01c9a5 | ||
![]() |
e29d0b8b85 | ||
![]() |
65fe8ae8a5 | ||
![]() |
4b691cccbe | ||
![]() |
935b37ee8b | ||
![]() |
fe266c6c69 | ||
![]() |
c6655c4115 | ||
![]() |
65bb31a405 | ||
![]() |
cc78087b83 | ||
![]() |
0fc2080294 | ||
![]() |
957bc5c92f | ||
![]() |
418febfc44 | ||
![]() |
6aafdc5c04 | ||
![]() |
a178ca6b5c | ||
![]() |
9d5e3ed740 | ||
![]() |
415d268051 | ||
![]() |
43a8f6133d | ||
![]() |
437cecb967 | ||
![]() |
61ad49e7d3 | ||
![]() |
2cf328ad0a | ||
![]() |
dfbb922ddb | ||
![]() |
fe51c4ab3c | ||
![]() |
e684ee786a | ||
![]() |
c416b1de5a | ||
![]() |
e4d85a77aa | ||
![]() |
5ebad51b84 | ||
![]() |
6334ffdbb0 | ||
![]() |
4cbc0c79ac | ||
![]() |
ae8b82e395 | ||
![]() |
38164332e1 | ||
![]() |
92dc0adca2 | ||
![]() |
7f347723d8 | ||
![]() |
a2a74022e2 | ||
![]() |
ba7fa583bf | ||
![]() |
5f282199c8 | ||
![]() |
74132a10f3 | ||
![]() |
4f10ae2b86 | ||
![]() |
4fcd5409e0 | ||
![]() |
a29cf54c02 | ||
![]() |
c254ac796f | ||
![]() |
1b91369455 | ||
![]() |
ccaa9bee2e | ||
![]() |
6769292c0d | ||
![]() |
da55af4763 | ||
![]() |
39339512e2 | ||
![]() |
c96425c364 | ||
![]() |
1fcf2d2f4a | ||
![]() |
3ea5d2e28f | ||
![]() |
7fffc9f11f | ||
![]() |
e38fcc8608 | ||
![]() |
b93aaba84f | ||
![]() |
cdfeb278ab | ||
![]() |
85bb744dfe | ||
![]() |
4401925c82 | ||
![]() |
59ee80764e | ||
![]() |
8e1ffb1859 | ||
![]() |
e7cbf8fd30 | ||
![]() |
b3d838e5d0 | ||
![]() |
acfab3733f | ||
![]() |
2e7b661681 | ||
![]() |
027dbc9f85 | ||
![]() |
e263867f6b | ||
![]() |
0de93fa1da | ||
![]() |
a996d703e9 | ||
![]() |
a75c3afe68 | ||
![]() |
1cc57edaf5 | ||
![]() |
ce32e32f2a | ||
![]() |
a72cae66dc | ||
![]() |
eead773204 | ||
![]() |
d0096de764 | ||
![]() |
426b68b20a | ||
![]() |
1b7fd0fa3e | ||
![]() |
cd7ff122a4 | ||
![]() |
cf5229190d | ||
![]() |
345f9fa77e | ||
![]() |
62073c3048 | ||
![]() |
54f1a77fb6 | ||
![]() |
09ee7234b6 | ||
![]() |
f65b874bda | ||
![]() |
5d55ceb75c | ||
![]() |
fa20c18525 | ||
![]() |
5fae9d9a20 | ||
![]() |
482c573d9e | ||
![]() |
7835e1465f | ||
![]() |
95023eb325 | ||
![]() |
39f87ab2ab | ||
![]() |
dcba56cafa | ||
![]() |
5e90d26658 | ||
![]() |
14599cd760 | ||
![]() |
e74167bd6a | ||
![]() |
70cb8a686f | ||
![]() |
bb61d657c1 | ||
![]() |
5112bfc8cc | ||
![]() |
828feae4f1 | ||
![]() |
4d63882615 | ||
![]() |
43f2185221 | ||
![]() |
480d772f22 | ||
![]() |
7ae5d9d11d | ||
![]() |
ef8b121e2c | ||
![]() |
76bba2a1fc | ||
![]() |
45abddb069 | ||
![]() |
f74775ba1c | ||
![]() |
1939a4f96e | ||
![]() |
452e46dbfc | ||
![]() |
7eb8797b81 | ||
![]() |
ed919de0a7 | ||
![]() |
c5a6599080 | ||
![]() |
a9e8ca4ab4 | ||
![]() |
a1abd64aff | ||
![]() |
2799897ad8 | ||
![]() |
191f6945ac | ||
![]() |
0be1785aea | ||
![]() |
bf7487ab18 | ||
![]() |
4e05cb4023 | ||
![]() |
dd03dea22e | ||
![]() |
0ec40e08d5 | ||
![]() |
d1b7efd578 | ||
![]() |
d00f97a7db | ||
![]() |
7e800bfffc | ||
![]() |
f6783bee07 | ||
![]() |
760dcc6a65 | ||
![]() |
2e1b9171bf | ||
![]() |
ef6900eb79 | ||
![]() |
3fa9d4d717 | ||
![]() |
ecf9496d17 | ||
![]() |
50acb19719 | ||
![]() |
745af91663 | ||
![]() |
87af1cba3c | ||
![]() |
ce335a0d5c | ||
![]() |
01f896d38e | ||
![]() |
9af39cbe31 | ||
![]() |
1133b5e07a | ||
![]() |
470ee2d214 | ||
![]() |
b0692d0311 | ||
![]() |
9549014694 | ||
![]() |
e696ade15d | ||
![]() |
03cec38834 | ||
![]() |
03b5494ca1 | ||
![]() |
028a79b8a1 | ||
![]() |
7c3a7bd1f0 | ||
![]() |
85cda6ae16 | ||
![]() |
f60995adb4 | ||
![]() |
4637c5c242 | ||
![]() |
624c70d763 | ||
![]() |
bfdc0eba0b | ||
![]() |
4f6eb791b4 | ||
![]() |
b01885338b | ||
![]() |
44cef0d563 | ||
![]() |
d73bbd57ee | ||
![]() |
5259da1043 | ||
![]() |
c2801d0938 | ||
![]() |
15a5dc5b89 | ||
![]() |
e2d92b5adf | ||
![]() |
6f00044317 | ||
![]() |
d3be5a89e5 | ||
![]() |
f8342dd5f2 | ||
![]() |
54ba7acba1 | ||
![]() |
2cd4a8065a | ||
![]() |
7e8228cf5a | ||
![]() |
d239b550ce | ||
![]() |
c32bda6bb9 | ||
![]() |
61bc3bbc0e | ||
![]() |
450f5d6694 | ||
![]() |
ffcfc0e432 | ||
![]() |
c44e3cb4e5 | ||
![]() |
4c5da0157f | ||
![]() |
25b45979f2 | ||
![]() |
77270329ba | ||
![]() |
c1609dd497 | ||
![]() |
88b3e00515 | ||
![]() |
0c3a8dea88 | ||
![]() |
e0f9ecc6a4 | ||
![]() |
54ffd5447d | ||
![]() |
e0e9221e23 | ||
![]() |
77a57d5eaf | ||
![]() |
d23159a69c | ||
![]() |
9e103df45e | ||
![]() |
9fc3f04520 | ||
![]() |
ae816bb6aa | ||
![]() |
db9b9f396e | ||
![]() |
08769b7f8a | ||
![]() |
f07aaccd06 | ||
![]() |
7c14b3688c | ||
![]() |
69063507d4 | ||
![]() |
cb28815405 | ||
![]() |
76f5fa549c | ||
![]() |
662ed0a13f | ||
![]() |
75e8f476e7 | ||
![]() |
a025cc17f0 | ||
![]() |
cf5891424e | ||
![]() |
66426469d0 | ||
![]() |
9383421c1c | ||
![]() |
5f6a71b38a | ||
![]() |
e3e5128cf2 | ||
![]() |
6d385c7111 | ||
![]() |
16457c869d | ||
![]() |
d63fdc1198 | ||
![]() |
ca8d4e8933 | ||
![]() |
6d82a0470e | ||
![]() |
e41e5b78c6 | ||
![]() |
baa5c11363 | ||
![]() |
380b8b516e | ||
![]() |
86880b8ff7 | ||
![]() |
59f288ce63 | ||
![]() |
dffb93feaf | ||
![]() |
f9708da223 | ||
![]() |
0024702fe7 | ||
![]() |
881eda695e | ||
![]() |
e6024e0030 | ||
![]() |
ceebd9ac76 | ||
![]() |
3f590c7840 | ||
![]() |
f063d0e89f | ||
![]() |
5f06f0c367 | ||
![]() |
1e2f60993f | ||
![]() |
ed42e64cfc | ||
![]() |
2c0b5281f5 | ||
![]() |
f4ca564ba6 | ||
![]() |
ab55a117e2 | ||
![]() |
a3381af1de | ||
![]() |
82dfee9960 | ||
![]() |
1073b9f93a | ||
![]() |
8cf621ffd9 | ||
![]() |
2e0c003435 | ||
![]() |
1f735f82cc | ||
![]() |
c70f6415f8 | ||
![]() |
07aeaae356 | ||
![]() |
3378a54f15 | ||
![]() |
641d84a4ec | ||
![]() |
581dd40e73 | ||
![]() |
a76dc27801 | ||
![]() |
bc313467bd | ||
![]() |
d619fb5e1c | ||
![]() |
d670e21998 | ||
![]() |
ea8e543bb8 | ||
![]() |
e7b8fe03e8 | ||
![]() |
fb216d1a7c | ||
![]() |
566dab2ac1 | ||
![]() |
4a049ce556 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -8,3 +8,6 @@
|
||||
/modules.d/99base/switch_root
|
||||
/test/*/test.log
|
||||
test*.img
|
||||
/.buildpath
|
||||
/.project
|
||||
/dracut-version.sh
|
||||
|
5
.mailmap
5
.mailmap
@@ -6,4 +6,7 @@ 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>
|
||||
|
31
AUTHORS
31
AUTHORS
@@ -5,47 +5,58 @@ Warren Togami <wtogami@redhat.com>
|
||||
Amadeusz Żołnowski <aidecoe@aidecoe.name>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Michal Soltys <soltys@ziu.info>
|
||||
Will Woods <wwoods@redhat.com>
|
||||
Michal Soltys <soltys@ziu.info>
|
||||
Dave Young <dyoung@redhat.com>
|
||||
Amerigo Wang <amwang@redhat.com>
|
||||
Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
Colin Guthrie <colin@mageia.org>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Luca Berra <bluca@comedia.it>
|
||||
Andrey Borzenkov <arvidjaar@mail.ru>
|
||||
Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
John Reiser <jreiser@bitwagon.com>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
Dan Horák <dhorak@redhat.com>
|
||||
Roberto Sassu <roberto.sassu@polito.it>
|
||||
Amerigo Wang <amwang@redhat.com>
|
||||
Anton Blanchard <anton@samba.org>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
David Cantrell <dcantrell@redhat.com>
|
||||
Lance Albertson <lance@osuosl.org>
|
||||
Marian Ganisin <mganisin@redhat.com>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
||||
Alan Pevec <apevec@redhat.com>
|
||||
Dan Horák <dan@danny.cz>
|
||||
Ian Dall <ian@beware.dropbear.id.au>
|
||||
James Buren <ryuo@frugalware.org>
|
||||
Joey Boggs <jboggs@redhat.com>
|
||||
Jon Ander Hernandez <jonan.h@gmail.com>
|
||||
Mike Snitzer <snitzer@redhat.com>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Przemysław Rudy <prudy1@o2.pl>
|
||||
Vladislav Bogdanov <bubble@hoster-ok.com>
|
||||
Alexander Todorov <atodorov@redhat.com>
|
||||
Andy Lutomirski <luto@mit.edu>
|
||||
Anssi Hannula <anssi@mageia.org>
|
||||
Christian Heinz <christian.ch.heinz@gmail.com>
|
||||
Dan Horák <dhorak@redhat.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
Duane Griffin <duaneg@dghda.com>
|
||||
Frederic Crozat <fcrozat@mandriva.com>
|
||||
Glen Gray <slaine@slaine.org>
|
||||
Ian Dall <ian@beware.dropbear.id.au>
|
||||
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>
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
Matt <smoothsailing72@hotmail.com>
|
||||
Matt Smith <shadowfax@gmx.com>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Munehiro Matsuda <haro@kgt.co.jp>
|
||||
Paolo Bonzini <pbonzini@redhat.com>
|
||||
Peter Robinson <pbrobinson@fedoraproject.org>
|
||||
Pádraig Brady <P@draigBrady.com>
|
||||
Quentin Armitage <quentin@armitage.org.uk>
|
||||
Sergey Fionov <fionov@gmail.com>
|
||||
|
116
Makefile
116
Makefile
@@ -1,50 +1,79 @@
|
||||
VERSION=013
|
||||
VERSION=019
|
||||
GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8)
|
||||
|
||||
prefix ?= /usr
|
||||
libdir ?= ${prefix}/lib
|
||||
datadir ?= ${prefix}/share
|
||||
pkglibdir ?= ${datadir}/dracut
|
||||
pkglibdir ?= ${libdir}/dracut
|
||||
sysconfdir ?= ${prefix}/etc
|
||||
sbindir ?= ${prefix}/sbin
|
||||
bindir ?= ${prefix}/bin
|
||||
mandir ?= ${prefix}/share/man
|
||||
|
||||
manpages = dracut.8 dracut.kernel.7 dracut.conf.5 dracut-catimages.8 dracut-gencmdline.8
|
||||
manpages = dracut.8 dracut.cmdline.7 dracut.conf.5 dracut-catimages.8
|
||||
|
||||
.PHONY: install clean archive rpm testimage test all check AUTHORS doc
|
||||
|
||||
all: syncheck dracut-version.sh
|
||||
|
||||
doc: $(manpages) dracut.html
|
||||
all: syncheck
|
||||
|
||||
%: %.xml
|
||||
xsltproc -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
|
||||
|
||||
dracut.html: dracut.xml $(manpages)
|
||||
%.xml: %.asc
|
||||
asciidoc -d manpage -b docbook -o $@ $<
|
||||
|
||||
dracut.html: dracut.asc $(manpages)
|
||||
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 html.stylesheet \
|
||||
http://docs.redhat.com/docs/en-US/Common_Content/css/default.css \
|
||||
http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl dracut.xml
|
||||
rm dracut.xml
|
||||
|
||||
install: doc
|
||||
install: doc dracut-version.sh
|
||||
mkdir -p $(DESTDIR)$(pkglibdir)
|
||||
mkdir -p $(DESTDIR)$(sbindir)
|
||||
mkdir -p $(DESTDIR)$(bindir)
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)
|
||||
mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
|
||||
mkdir -p $(DESTDIR)$(mandir)/man{5,7,8}
|
||||
install -m 0755 dracut $(DESTDIR)$(sbindir)/dracut
|
||||
install -m 0755 dracut-gencmdline $(DESTDIR)$(sbindir)/dracut-gencmdline
|
||||
install -m 0755 dracut-catimages $(DESTDIR)$(sbindir)/dracut-catimages
|
||||
install -m 0755 mkinitrd-dracut.sh $(DESTDIR)$(sbindir)/mkinitrd
|
||||
install -m 0755 lsinitrd $(DESTDIR)$(sbindir)/lsinitrd
|
||||
mkdir -p $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man7 $(DESTDIR)$(mandir)/man8
|
||||
install -m 0755 dracut.sh $(DESTDIR)$(bindir)/dracut
|
||||
install -m 0755 dracut-catimages.sh $(DESTDIR)$(bindir)/dracut-catimages
|
||||
install -m 0755 mkinitrd-dracut.sh $(DESTDIR)$(bindir)/mkinitrd
|
||||
install -m 0755 lsinitrd.sh $(DESTDIR)$(bindir)/lsinitrd
|
||||
install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d
|
||||
install -m 0755 dracut-functions $(DESTDIR)$(pkglibdir)/dracut-functions
|
||||
install -m 0755 dracut-logger $(DESTDIR)$(pkglibdir)/dracut-logger
|
||||
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
|
||||
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 dracut.8 $(DESTDIR)$(mandir)/man8
|
||||
install -m 0644 dracut-catimages.8 $(DESTDIR)$(mandir)/man8
|
||||
install -m 0644 dracut-gencmdline.8 $(DESTDIR)$(mandir)/man8
|
||||
install -m 0644 dracut.conf.5 $(DESTDIR)$(mandir)/man5
|
||||
install -m 0644 dracut.kernel.7 $(DESTDIR)$(mandir)/man7
|
||||
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
|
||||
if [ -n "$(systemdsystemunitdir)" ]; then \
|
||||
mkdir -p $(DESTDIR)$(systemdsystemunitdir); \
|
||||
for i in \
|
||||
modules.d/98systemd/dracut-initqueue.service \
|
||||
modules.d/98systemd/dracut-pre-pivot.service \
|
||||
modules.d/98systemd/dracut-pre-trigger.service \
|
||||
modules.d/98systemd/dracut-pre-udev.service \
|
||||
modules.d/98systemd/initrd-switch-root.service \
|
||||
modules.d/98systemd/initrd-switch-root.target \
|
||||
dracut-shutdown.service; do \
|
||||
install -m 0644 $$i $(DESTDIR)$(systemdsystemunitdir); \
|
||||
done; \
|
||||
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants; \
|
||||
ln -s ../dracut-shutdown.service \
|
||||
$(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants/dracut-shutdown.service; \
|
||||
fi
|
||||
|
||||
dracut-version.sh:
|
||||
@echo "DRACUT_VERSION=$(VERSION)-$(GITVERSION)" > dracut-version.sh
|
||||
|
||||
clean:
|
||||
$(RM) *~
|
||||
@@ -57,30 +86,35 @@ clean:
|
||||
|
||||
archive: dracut-$(VERSION)-$(GITVERSION).tar.bz2
|
||||
|
||||
dist: dracut-$(VERSION).tar.gz
|
||||
dist: dracut-$(VERSION).tar.bz2
|
||||
|
||||
dracut-$(VERSION).tar.bz2:
|
||||
git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ |bzip2 > dracut-$(VERSION).tar.bz2
|
||||
|
||||
dracut-$(VERSION).tar.gz:
|
||||
git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ |gzip > dracut-$(VERSION).tar.gz
|
||||
dracut-$(VERSION).tar.bz2: doc
|
||||
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)
|
||||
bzip2 -9 dracut-$(VERSION).tar
|
||||
rm -f dracut-$(VERSION).tar
|
||||
|
||||
rpm: dracut-$(VERSION).tar.bz2
|
||||
mkdir -p rpmbuild
|
||||
cp dracut-$(VERSION).tar.bz2 rpmbuild
|
||||
cd rpmbuild; ../git2spec.pl $(VERSION) < ../dracut.spec > dracut.spec; \
|
||||
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
|
||||
rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \
|
||||
cp dracut-$(VERSION).tar.bz2 "$$rpmbuild"; \
|
||||
LANG=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 && \
|
||||
( cd ..; mv rpmbuild/noarch/*.rpm .; mv rpmbuild/*.src.rpm .;rm -fr rpmbuild; ls *.rpm )
|
||||
--define "_rpmdir $$PWD" -ba dracut.spec; ) && \
|
||||
( mv "$$rpmbuild"/noarch/*.rpm .; mv "$$rpmbuild"/*.src.rpm .;rm -fr "$$rpmbuild"; ls *.rpm )
|
||||
|
||||
syncheck:
|
||||
@ret=0;for i in dracut-logger modules.d/99base/init modules.d/*/*.sh; do \
|
||||
@ret=0;for i in dracut-initramfs-restore.sh dracut-logger.sh \
|
||||
modules.d/99base/init.sh modules.d/*/*.sh; do \
|
||||
[ "$${i##*/}" = "module-setup.sh" ] && continue; \
|
||||
[ "$${i##*/}" = "caps.sh" ] && continue; \
|
||||
read line < "$$i"; [ "$${line#*bash*}" != "$$line" ] && continue; \
|
||||
dash -n "$$i" ; ret=$$(($$ret+$$?)); \
|
||||
done;exit $$ret
|
||||
@ret=0;for i in dracut modules.d/02caps/caps.sh modules.d/*/module-setup.sh; do \
|
||||
@ret=0;for i in *.sh mkinitrd-dracut.sh modules.d/*/*.sh \
|
||||
modules.d/*/module-setup.sh; do \
|
||||
bash -n "$$i" ; ret=$$(($$ret+$$?)); \
|
||||
done;exit $$ret
|
||||
|
||||
@@ -88,17 +122,17 @@ check: all syncheck
|
||||
$(MAKE) -C test check
|
||||
|
||||
testimage: all
|
||||
./dracut -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
|
||||
./dracut.sh -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
|
||||
@echo wrote test-$(shell uname -r).img
|
||||
|
||||
testimages: all
|
||||
./dracut -l -a debug --kernel-only -f test-kernel-$(shell uname -r).img $(shell uname -r)
|
||||
./dracut.sh -l -a debug --kernel-only -f test-kernel-$(shell uname -r).img $(shell uname -r)
|
||||
@echo wrote test-$(shell uname -r).img
|
||||
./dracut -l -a debug --no-kernel -f test-dracut.img $(shell uname -r)
|
||||
./dracut.sh -l -a debug --no-kernel -f test-dracut.img $(shell uname -r)
|
||||
@echo wrote test-dracut.img
|
||||
|
||||
hostimage: all
|
||||
./dracut -H -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
|
||||
./dracut.sh -H -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
|
||||
@echo wrote test-$(shell uname -r).img
|
||||
|
||||
AUTHORS:
|
||||
|
133
NEWS
133
NEWS
@@ -1,3 +1,136 @@
|
||||
dracut-019
|
||||
==========
|
||||
- initqueue/online hook
|
||||
- fixes for ifcfg write out
|
||||
- rootfs-block: avoid remount when options don't change
|
||||
- Debian multiarch support
|
||||
- virtfs root filesystem support
|
||||
- cope with systemd-udevd
|
||||
- mount tmpfs with strictatime
|
||||
- include all kernel/drivers/net/phy drivers
|
||||
- add debug_on() and debug_off() functions
|
||||
- add arguments for source_hook() and source_all()
|
||||
- cleanup hook
|
||||
- plymouth: get consoledev from /sys/class/tty/console/active
|
||||
- experimental systemd dracut module for systemd in the initramfs
|
||||
- install xhci-hcd kernel module
|
||||
- dracut: new "--mount" option
|
||||
- lsinitrd: new option --printsize
|
||||
- ARM storage kernel modules added
|
||||
- s390 cms conf file support
|
||||
- /etc/initrd-release in the initrd
|
||||
- vlan support
|
||||
- full bonding and bridge support
|
||||
- removed scsi_wait_scan kernel module from standard install
|
||||
- support rd.luks.allow-discards and honor options in crypttab
|
||||
- lots of bugfixes
|
||||
|
||||
dracut-018
|
||||
==========
|
||||
- lvm: ignore lvm mirrors
|
||||
- lsinitrd: handle LZMA images
|
||||
- iscsi: add rd.iscsi.param
|
||||
- iscsi: add iscsi interface binding
|
||||
- new module cms to read and handle z-Series cms config files
|
||||
- fixed fstab.sys handling
|
||||
- new dracut option "--tmpdir"
|
||||
- new dracut option "--no-hostonly"
|
||||
- nbd: name based nbd connects
|
||||
- converted manpage and documentation source to asciidoc
|
||||
- write-ifcfg fixes and cleanups
|
||||
- ifup is now done in the initqueue
|
||||
- netroot cleanup
|
||||
- initqueue/online is now for hooks, which require network
|
||||
- no more /tmp/root.info
|
||||
- 98pollcdrom: factored out the ugly cdrom polling in the main loop
|
||||
- simplified rd.luks.uuid testing
|
||||
- removed "egrep" and "ls" calls
|
||||
- speedup kernel module installation
|
||||
- make bzip2 optional
|
||||
- lots of bugfixes
|
||||
|
||||
dracut-017
|
||||
==========
|
||||
- a _lot_ faster than dracut-016 in image creation
|
||||
- systemd service dracut-shutdown.service
|
||||
- livenet fixes
|
||||
- ssh-client module install fix
|
||||
- root=iscsi:... fixed
|
||||
- lots of restructuring and optimizing in dracut-functions.sh
|
||||
- usrmount: honor fs_passno in /etc/fstab
|
||||
- renamed all shell scripts to .sh
|
||||
- new option "--omit-drivers" and config option "omit_drivers"
|
||||
- hostonly mode fixups
|
||||
|
||||
dracut-016
|
||||
==========
|
||||
- fixed lsinitrd
|
||||
- honor binaries in sbin first
|
||||
- fixed usrmount module
|
||||
- added systemd service for shutdown
|
||||
- fixed terminfo on distros with /usr/share/terminfo
|
||||
- reload udev rules after "pre-trigger" hook
|
||||
- improved test suite
|
||||
- new parameter "--omit-drivers" and new conf param omit_drivers
|
||||
- "--offroot" support for mdraid
|
||||
- new libs: net-lib.sh, nfs-lib.sh, url-lib.sh, img-lib.sh
|
||||
full of functions to use in your dracut module
|
||||
|
||||
dracut-015
|
||||
==========
|
||||
- hostonly mode automatically adds command line options for root and /usr
|
||||
- --add-fstab --mount parameters
|
||||
- ssh-client module
|
||||
- --ctty option: add job control
|
||||
- cleanup /run/initramfs
|
||||
- convertfs module
|
||||
- /sbin/ifup can be called directly
|
||||
- support kernel modules compressed with xz
|
||||
- s390 iscsi modules added
|
||||
- terminfo module
|
||||
- lsinitrd can handle concatened images
|
||||
- lsinitrd can sort by size
|
||||
|
||||
dracut-014
|
||||
==========
|
||||
- new dracut arguments:
|
||||
--lvmconf
|
||||
--nolvmconf
|
||||
--fscks [LIST]
|
||||
--nofscks
|
||||
- new .conf options:
|
||||
install_items
|
||||
fscks
|
||||
nofscks
|
||||
- new kernel options:
|
||||
rd.md.ddf
|
||||
rd.md.waitclean
|
||||
plymouth.enable
|
||||
- dracut move from /sbin to /usr/bin
|
||||
- dracut modules dir moved from /usr/share/dracut to /usr/lib/dracut
|
||||
- profiling with "dracut --profile"
|
||||
- new TEST-16-DMSQUASH, test for Fedora LiveCDs
|
||||
- speedup of initramfs creation
|
||||
- ask_for_password fallback to CLI
|
||||
- mdraid completely switched to incremental assembly
|
||||
- no more cdrom polling
|
||||
- "switch_root" breakpoint is now very late
|
||||
- /dev/live is gone
|
||||
- /dev/root is gone
|
||||
- fs-lib dracut module for fscks added
|
||||
- xen dracut module removed
|
||||
- usb mass storage kernel drivers now included
|
||||
- usrmount dracut module added:
|
||||
mount /usr if found in /sysroot/etc/fstab
|
||||
- only include fsck helper needed for hostonly
|
||||
- fcoe: support for bnx2fc
|
||||
- support iSCSI drivers: qla4xxx, cxgb3i, cxgb4i, bnx2i, be2iscsi
|
||||
- fips-aesni dracut module added
|
||||
- add install_items to dracut.conf
|
||||
install_items+=" <file>[ <file> ...] "
|
||||
- speedup internal testsuite
|
||||
- internal testsuite: store temporary data in a temporary dir
|
||||
|
||||
dracut-013
|
||||
==========
|
||||
- speedup of initramfs creation
|
||||
|
8
README
8
README
@@ -62,9 +62,17 @@ Git:
|
||||
http://git.kernel.org/pub/scm/boot/dracut/dracut.git
|
||||
https://git.kernel.org/pub/scm/boot/dracut/dracut.git
|
||||
|
||||
git://github.com/haraldh/dracut.git
|
||||
|
||||
git://dracut.git.sourceforge.net/gitroot/dracut/dracut
|
||||
|
||||
Git Web:
|
||||
http://git.kernel.org/?p=boot/dracut/dracut.git
|
||||
|
||||
https://haraldh@github.com/haraldh/dracut.git
|
||||
|
||||
http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut
|
||||
|
||||
Git Web RSS Feed:
|
||||
http://git.kernel.org/?p=boot/dracut/dracut.git;a=rss
|
||||
|
||||
|
@@ -103,6 +103,9 @@ init has the following hook points to inject scripts:
|
||||
a timeout.
|
||||
|
||||
/lib/dracut/hooks/pre-pivot/*.sh
|
||||
scripts to run before latter initramfs cleanups
|
||||
|
||||
/lib/dracut/hooks/cleanup/*.sh
|
||||
scripts to run before the real init is executed and the initramfs
|
||||
disappears
|
||||
All processes started before should be killed here.
|
||||
|
11
README.testsuite
Normal file
11
README.testsuite
Normal file
@@ -0,0 +1,11 @@
|
||||
For the testsuite to work, you will have to install at least the following software packages:
|
||||
dash
|
||||
asciidoc
|
||||
mdadm
|
||||
lvm2
|
||||
cryptsetup
|
||||
nfs-utils
|
||||
netbsd-iscsi
|
||||
nbd
|
||||
dhcp
|
||||
iscsi-initiator-utils
|
26
TODO
26
TODO
@@ -1,24 +1,36 @@
|
||||
Current TODO list, broken into things which are relevant for the initramfs itself (/init et al) vs the generator. A lot of things are/should be marked with "FIXME" in the code
|
||||
Current TODO list, broken into things which are relevant for the
|
||||
initramfs itself (/init et al) vs the generator.
|
||||
A lot of things are/should be marked with "FIXME" in the code.
|
||||
|
||||
Items are ordered in priority.
|
||||
|
||||
INITRAMFS TODO
|
||||
|
||||
- The hard-coded list of udev rules that we care about is kind of lame.
|
||||
- fix btrfs subvolume mounting for /usr (fsck)
|
||||
- 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
|
||||
- the hard-coded list of udev rules that we care about is kind of lame.
|
||||
- automatic kexec fallback
|
||||
- panic fallback
|
||||
- fsck for $NEWROOT/usr
|
||||
|
||||
GENERATOR TODO
|
||||
|
||||
- Default module specification could use some work
|
||||
- udev rule copying, as mentioned above, is a bit too hard-coded
|
||||
- remove /proc/modules use /sys/module
|
||||
- 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
|
||||
|
||||
CODE TODO
|
||||
- document functions
|
||||
|
||||
- document more functions
|
||||
- make function vars local, and prefix with "_"
|
||||
|
||||
Future Enhancement Requests
|
||||
|
||||
- run ssh server to enter crypto password or perform debugging (supported by debian)
|
||||
- Bug 524727 - Dracut + encrypted root + networking
|
||||
- https://bugzilla.redhat.com/show_bug.cgi?id=524727 - Dracut + encrypted root + networking
|
||||
|
||||
|
59
dracut-catimages.8.asc
Normal file
59
dracut-catimages.8.asc
Normal file
@@ -0,0 +1,59 @@
|
||||
DRACUT-CATIMAGES(8)
|
||||
===================
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
|
||||
NAME
|
||||
----
|
||||
dracut-catimages - creates initial ramdisk image by concatenating images
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
**dracut-catimages** [_OPTION_...] _<initramfs base image>_ [_<image>_...]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
dracut-catimages creates an initial ramdisk image by concatenating several
|
||||
images from the command line and /boot/dracut/*.img
|
||||
|
||||
OPTIONS
|
||||
-------
|
||||
**-f, --force**::
|
||||
overwrite existing initramfs file.
|
||||
|
||||
**-i, --imagedir**::
|
||||
Directory with additional images to add (default: /boot/dracut/)
|
||||
|
||||
**-o, --overlaydir**::
|
||||
Overlay directory, which contains additional files that will be used to
|
||||
create an additional image
|
||||
|
||||
**--nooverlay**:: Do not use the overlay directory
|
||||
|
||||
**--noimagedir**:: Do not use the additional image directory
|
||||
|
||||
**-h, --help**:: display help text and exit.
|
||||
|
||||
**--debug**:: output debug information of the build process
|
||||
|
||||
**-v, --verbose**:: verbose output during the build process
|
||||
|
||||
FILES
|
||||
-----
|
||||
_/boot/dracut/*.img_::
|
||||
images to work with
|
||||
|
||||
AUTHORS
|
||||
-------
|
||||
Harald Hoyer
|
||||
|
||||
AVAILABILITY
|
||||
------------
|
||||
The dracut-catimages command is part of the dracut package and is available from
|
||||
link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
*dracut*(8)
|
||||
|
@@ -1,116 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
|
||||
<!-- lifted from troff+man by doclifter -->
|
||||
<refentry id='dracutcatimages8'>
|
||||
<refmeta>
|
||||
<refentrytitle>DRACUT-CATIMAGES</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
<refmiscinfo class='source'>June 2009</refmiscinfo>
|
||||
<refmiscinfo class='manual'>Linux</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>dracut-catimages</refname>
|
||||
<refpurpose>creates initial ramdisk image by concatenating images</refpurpose>
|
||||
</refnamediv>
|
||||
<!-- body begins here -->
|
||||
<refsynopsisdiv id='synopsis'>
|
||||
<cmdsynopsis>
|
||||
<command>dracut-catimages</command> <arg choice='opt' rep='repeat'><replaceable>OPTION</replaceable></arg>
|
||||
<arg choice='plain'><replaceable><initramfs</replaceable></arg>
|
||||
<arg choice='plain'><replaceable>base</replaceable></arg>
|
||||
<arg choice='plain'><replaceable>image></replaceable></arg>
|
||||
<arg choice='opt' rep='repeat'><replaceable><image></replaceable></arg>
|
||||
<sbr/>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
|
||||
<refsect1 id='description'><title>DESCRIPTION</title>
|
||||
<para><command>dracut-catimages</command>
|
||||
creates an initial ramdisk image by concatenating several images from the command
|
||||
line and /boot/dracut/*.img</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='options'><title>OPTIONS</title>
|
||||
<variablelist remap='TP'>
|
||||
<varlistentry>
|
||||
<term><option>-f</option>, <option>--force</option></term>
|
||||
<listitem>
|
||||
<para>overwrite existing initramfs file.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>-i</option>, <option>--imagedir</option></term>
|
||||
<listitem>
|
||||
<para>Directory with additional images to add (default: /boot/dracut/)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>-o</option>, <option>--overlaydir</option></term>
|
||||
<listitem>
|
||||
<para>Overlay directory, which contains additional files that will be used to create an additional image</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>--nooverlay</option></term>
|
||||
<listitem>
|
||||
<para>Do not use the overlay directory</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>--noimagedir</option></term>
|
||||
<listitem>
|
||||
<para>Do not use the additional image directory</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>-h</option>, <option>--help</option></term>
|
||||
<listitem>
|
||||
<para>display help text and exit.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>--debug</option></term>
|
||||
<listitem>
|
||||
<para>output debug information of the build process</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>-v</option>, <option>--verbose</option></term>
|
||||
<listitem>
|
||||
<para>verbose output during the build process</para>
|
||||
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='files'><title>FILES</title>
|
||||
<variablelist remap='TP'>
|
||||
<varlistentry>
|
||||
<term><filename>/boot/dracut/*.img</filename></term>
|
||||
<listitem>
|
||||
<para></para> <!-- FIXME: blank list item -->
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='authors'><title>AUTHORS</title>
|
||||
<literallayout remap='.nf'>
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
</literallayout> <!-- .fi -->
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='availability'><title>AVAILABILITY</title>
|
||||
<para>The dracut-catimages command is part of the dracut package and is available from
|
||||
<ulink url='https://dracut.wiki.kernel.org'>https://dracut.wiki.kernel.org</ulink></para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='see_also'><title>SEE ALSO</title>
|
||||
<para><citerefentry><refentrytitle>dracut</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,716 +0,0 @@
|
||||
#!/bin/bash --norc
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Copyright 2005-2009 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# 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/>.
|
||||
#
|
||||
# code taken from mkinitrd
|
||||
#
|
||||
#. /usr/libexec/initrd-functions
|
||||
|
||||
IF_verbose=""
|
||||
function set_verbose() {
|
||||
case $1 in
|
||||
1|true|yes|on)
|
||||
IF_verbose="-v"
|
||||
;;
|
||||
0|false|no|off)
|
||||
IF_verbose=""
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function is_verbose() {
|
||||
[ -n "$IF_verbose" ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
function get_verbose() {
|
||||
echo "$IF_verbose"
|
||||
is_verbose
|
||||
}
|
||||
|
||||
|
||||
function get_numeric_dev() {
|
||||
(
|
||||
fmt="%d:%d"
|
||||
if [ "$1" == "hex" ]; then
|
||||
fmt="%x:%x"
|
||||
fi
|
||||
ls -lH "$2" | awk '{ sub(/,/, "", $5); printf("'"$fmt"'", $5, $6); }'
|
||||
) 2>/dev/null
|
||||
}
|
||||
|
||||
|
||||
function error() {
|
||||
echo "$@" >&2
|
||||
}
|
||||
|
||||
function vecho() {
|
||||
is_verbose && echo "$@"
|
||||
}
|
||||
|
||||
# module dep finding and installation functions
|
||||
moduledep() {
|
||||
MPARGS=""
|
||||
if [ "$1" == "--ignore-install" ]; then
|
||||
MPARGS="$MPARGS --ignore-install"
|
||||
shift
|
||||
fi
|
||||
vecho -n "Looking for deps of module $1"
|
||||
deps=""
|
||||
deps=$(modprobe $MPARGS --set-version $kernel --quiet --show-depends $1 | awk '/^insmod / { print gensub(".*/","","g",$2) }' | while read foo ; do [ "${foo%%.ko}" != "$1" ] && echo -n "${foo%%.ko} " ; done)
|
||||
[ -n "$deps" ] && vecho ": $deps" || vecho
|
||||
}
|
||||
|
||||
export MALLOC_PERTURB_=204
|
||||
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
|
||||
export PATH
|
||||
|
||||
# Set the umask. For iscsi, the initrd can contain plaintext
|
||||
# password (chap secret), so only allow read by owner.
|
||||
umask 077
|
||||
|
||||
VERSION=6.0.87
|
||||
|
||||
PROBE="yes"
|
||||
MODULES=""
|
||||
GRAPHICSMODS=""
|
||||
PREMODS=""
|
||||
DMRAIDS=""
|
||||
ncryptodevs=0
|
||||
ncryptoparts=0
|
||||
ncryptolvs=0
|
||||
ncryptoraids=0
|
||||
root=""
|
||||
scsi_wait_scan="no"
|
||||
|
||||
NET_LIST=""
|
||||
LD_SO_CONF=/etc/ld.so.conf
|
||||
LD_SO_CONF_D=/etc/ld.so.conf.d/
|
||||
|
||||
[ -e /etc/sysconfig/mkinitrd ] && . /etc/sysconfig/mkinitrd
|
||||
|
||||
CONFMODS="$MODULES"
|
||||
MODULES=""
|
||||
ARCH=$(uname -m | sed -e 's/s390x/s390/')
|
||||
|
||||
compress=1
|
||||
allowmissing=""
|
||||
target=""
|
||||
kernel=""
|
||||
force=""
|
||||
img_vers=""
|
||||
builtins=""
|
||||
modulefile=/etc/modules.conf
|
||||
[ "$ARCH" != "s390" ] && withusb=1
|
||||
rc=0
|
||||
nolvm=""
|
||||
nodmraid=""
|
||||
|
||||
IMAGESIZE=8000
|
||||
PRESCSIMODS=""
|
||||
fstab="/etc/fstab"
|
||||
|
||||
vg_list=""
|
||||
net_list="$NET_LIST"
|
||||
|
||||
usage () {
|
||||
if [ "$1" == "-n" ]; then
|
||||
cmd=echo
|
||||
else
|
||||
cmd=error
|
||||
fi
|
||||
|
||||
$cmd "usage: `basename $0` [--version] [--help] [-v] [-f]"
|
||||
|
||||
if [ "$1" == "-n" ]; then
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
qpushd() {
|
||||
pushd "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
qpopd() {
|
||||
popd >/dev/null 2>&1
|
||||
}
|
||||
|
||||
|
||||
freadlink() {
|
||||
readlink -f "$1"
|
||||
}
|
||||
|
||||
resolve_device_name() {
|
||||
if [ -z "${1##UUID=*}" ]; then
|
||||
real=$(freadlink /dev/disk/by-uuid/${1##UUID=})
|
||||
[ -b $real ] && { echo $real; return; }
|
||||
fi
|
||||
if [ -z "${1##LABEL=*}" ]; then
|
||||
real=$(freadlink /dev/disk/by-label/${1##LABEL=})
|
||||
[ -b $real ] && { echo $real; return; }
|
||||
fi
|
||||
echo "$1"
|
||||
}
|
||||
|
||||
finddevnoinsys() {
|
||||
majmin="$1"
|
||||
if [ -n "$majmin" ]; then
|
||||
dev=$(for x in /sys/block/* ; do find $x/ -name dev ; done | while read device ; do \
|
||||
echo "$majmin" | cmp -s $device && echo $device ; done)
|
||||
if [ -n "$dev" ]; then
|
||||
dev=${dev%%/dev}
|
||||
dev=${dev%%/}
|
||||
echo "$dev"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
finddevicedriverinsys () {
|
||||
if is_iscsi $PWD; then
|
||||
handleiscsi "$PWD"
|
||||
return
|
||||
fi
|
||||
while [ "$PWD" != "/sys/devices" ]; do
|
||||
deps=
|
||||
if [ -f modalias ]; then
|
||||
MODALIAS=$(cat modalias)
|
||||
if [ "${MODALIAS::7}" == "scsi:t-" ]; then
|
||||
scsi_wait_scan=yes
|
||||
fi
|
||||
moduledep $MODALIAS
|
||||
unset MODALIAS
|
||||
fi
|
||||
|
||||
cd ..
|
||||
done
|
||||
}
|
||||
|
||||
findstoragedriverinsys () {
|
||||
local sysfs=$(freadlink "$1")
|
||||
|
||||
# if its a partition look at the device holding the partition
|
||||
if [ -f "$sysfs/start" ]; then
|
||||
sysfs=$(freadlink ${sysfs%/*})
|
||||
fi
|
||||
|
||||
if [[ ! "$sysfs" =~ ^/sys/.*block/.*$ ]]; then
|
||||
#error "WARNING: $sysfs is a not a block sysfs path, skipping"
|
||||
return
|
||||
fi
|
||||
|
||||
case " $handleddevices " in
|
||||
*" $sysfs "*)
|
||||
return ;;
|
||||
*) handleddevices="$handleddevices $sysfs" ;;
|
||||
esac
|
||||
|
||||
if [[ "$sysfs" =~ ^/sys/.*block/md[0-9]+$ ]]; then
|
||||
local raid=${sysfs##*/}
|
||||
vecho "Found MDRAID component $raid"
|
||||
handleraid $raid
|
||||
fi
|
||||
if [[ "$sysfs" =~ ^/sys/.*block/dm-[0-9]+$ ]]; then
|
||||
vecho "Found DeviceMapper component ${sysfs##*/}"
|
||||
handledm $(cat $sysfs/dev |cut -d : -f 1) $(cat $sysfs/dev |cut -d : -f 2)
|
||||
fi
|
||||
|
||||
for slave in $(ls -d "$sysfs"/slaves/* 2>/dev/null) ; do
|
||||
findstoragedriverinsys "$slave"
|
||||
done
|
||||
|
||||
if [ -L "$sysfs/device" ]; then
|
||||
qpushd $(freadlink "$sysfs/device")
|
||||
finddevicedriverinsys
|
||||
qpopd
|
||||
fi
|
||||
}
|
||||
|
||||
findstoragedriver () {
|
||||
local device="$1"
|
||||
|
||||
if [ ! -b "$device" ]; then
|
||||
#error "WARNING: $device is a not a block device, skipping"
|
||||
return
|
||||
fi
|
||||
|
||||
local majmin=$(get_numeric_dev dec "$device")
|
||||
local sysfs=$(finddevnoinsys "$majmin")
|
||||
|
||||
if [ -z "$sysfs" ]; then
|
||||
#error "WARNING: $device major:minor $majmin not found, skipping"
|
||||
return
|
||||
fi
|
||||
|
||||
vecho "Looking for driver for $device in $sysfs"
|
||||
findstoragedriverinsys "$sysfs"
|
||||
}
|
||||
|
||||
iscsi_get_rec_val() {
|
||||
|
||||
# The open-iscsi 742 release changed to using flat files in
|
||||
# /var/lib/iscsi.
|
||||
|
||||
result=$(grep "^${2} = " "$1" | sed -e s'/.* = //')
|
||||
}
|
||||
|
||||
iscsi_set_parameters() {
|
||||
path=$1
|
||||
vecho setting iscsi parameters
|
||||
|
||||
tmpfile=$(mktemp)
|
||||
|
||||
# Check once before getting explicit values, so we can output a decent
|
||||
# error message.
|
||||
/sbin/iscsiadm --show -m session -r $path > $tmpfile
|
||||
if [ ! -s $tmpfile ]; then
|
||||
echo Unable to find iscsi record for $path
|
||||
exit 1
|
||||
fi
|
||||
|
||||
nit_name=$(grep "^InitiatorName=" /etc/iscsi/initiatorname.iscsi | \
|
||||
sed -e "s/^InitiatorName=//")
|
||||
|
||||
iscsi_get_rec_val $tmpfile "node.name"
|
||||
tgt_name=${result}
|
||||
iscsi_get_rec_val $tmpfile "node.tpgt"
|
||||
tpgt=${result}
|
||||
# iscsistart wants node.conn[0].address / port
|
||||
iscsi_get_rec_val $tmpfile 'node.conn\[0\].address'
|
||||
tgt_ipaddr=${result}
|
||||
iscsi_get_rec_val $tmpfile 'node.conn\[0\].port'
|
||||
tgt_port=${result}
|
||||
|
||||
# Note: we get chap secrets (passwords) in plaintext, and also store
|
||||
# them in the initrd.
|
||||
|
||||
iscsi_get_rec_val $tmpfile "node.session.auth.username"
|
||||
chap=${result}
|
||||
if [ -n "${chap}" -a "${chap}" != "<empty>" ]; then
|
||||
chap="-u ${chap}"
|
||||
iscsi_get_rec_val $tmpfile "node.session.auth.password"
|
||||
chap_pw="-w ${result}"
|
||||
else
|
||||
chap=""
|
||||
fi
|
||||
|
||||
iscsi_get_rec_val $tmpfile "node.session.auth.username_in"
|
||||
chap_in=${result}
|
||||
if [ -n "${chap_in}" -a "${chap_in}" != "<empty>" ]; then
|
||||
chap_in="-U ${chap_in}"
|
||||
iscsi_get_rec_val $tmpfile "node.session.auth.password_in"
|
||||
chap_in_pw="-W ${result}"
|
||||
else
|
||||
chap_in=""
|
||||
fi
|
||||
|
||||
rm $tmpfile
|
||||
}
|
||||
|
||||
emit_iscsi () {
|
||||
if [ -n "${iscsi_devs}" ]; then
|
||||
for dev in ${iscsi_devs}; do
|
||||
iscsi_set_parameters $dev
|
||||
# recid is not really used, just use 0 for it
|
||||
echo "/bin/iscsistart -t ${tgt_name} -i ${nit_name} \
|
||||
-g ${tpgt} -a ${tgt_ipaddr} ${chap} ${chap_pw} \
|
||||
${chap_in} ${chap_in_pw}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
is_iscsi() {
|
||||
path=$1
|
||||
if echo $path | grep -q "/platform/host[0-9]*/session[0-9]*/target[0-9]*:[0-9]*:[0-9]*/[0-9]*:[0-9]*:[0-9]*:[0-9]*"; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
handledm() {
|
||||
major=$1
|
||||
minor=$2
|
||||
while read dmstart dmend dmtype r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 ; do
|
||||
case "$dmtype" in
|
||||
crypt)
|
||||
# this device is encrypted; find the slave device and see
|
||||
# whether the encryption is LUKS; if not, bail.
|
||||
slavedev=$(finddevnoinsys $r3)
|
||||
# get the basename, then s,!,/, in case it's a cciss device
|
||||
slavedev=$(echo ${slavedev##*/} | tr '!' '/')
|
||||
cryptsetup isLuks "/dev/$slavedev" 2>/dev/null || continue
|
||||
find_base_dm_mods
|
||||
dmname=$(dmsetup info -j $major -m $minor -c --noheadings -o name)
|
||||
# do the device resolution dance to get /dev/mapper/foo
|
||||
# since 'lvm lvs' doesn't like dm-X device nodes
|
||||
if [[ "$slavedev" =~ ^dm- ]]; then
|
||||
majmin=$(get_numeric_dev dec "/dev/$slavedev")
|
||||
for dmdev in /dev/mapper/* ; do
|
||||
dmnum=$(get_numeric_dev dev $dmdev)
|
||||
if [ $dmnum = $majmin ]; then
|
||||
slavedev=${dmdev#/dev/}
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# determine if $slavedev is an LV
|
||||
# if so, add the device to latecryptodevs
|
||||
# if not, add the device to cryptodevs
|
||||
local vg=$(lvshow /dev/$slavedev)
|
||||
if [ -n "$vg" ]; then
|
||||
eval cryptolv${ncryptolvs}='"'/dev/$slavedev $dmname'"'
|
||||
let ncryptolvs++
|
||||
elif grep -q "^$slavedev :" /proc/mdstat ; then
|
||||
eval cryptoraid${ncryptoraids}='"'/dev/$slavedev $dmname'"'
|
||||
let ncryptoraids++
|
||||
else
|
||||
eval cryptoparts${ncryptoparts}='"'/dev/$slavedev $dmname'"'
|
||||
let ncryptoparts++
|
||||
fi
|
||||
|
||||
let ncryptodevs++
|
||||
findstoragedriver "/dev/$slavedev"
|
||||
;;
|
||||
esac
|
||||
done << EOF
|
||||
$(dmsetup table -j $major -m $minor 2>/dev/null)
|
||||
EOF
|
||||
local name=$(dmsetup info --noheadings -c -j $major -m $minor -o name)
|
||||
local vg=$(lvshow "/dev/mapper/$name")
|
||||
local raids=$(/sbin/dmraid -s -craidname 2>/dev/null | grep -vi "no raid disks")
|
||||
if [ -n "$vg" ]; then
|
||||
vg=`echo $vg` # strip whitespace
|
||||
case " $vg_list " in
|
||||
*" $vg "*) ;;
|
||||
*) vg_list="$vg_list $vg"
|
||||
[ -z "$nolvm" ] && find_base_dm_mods
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
for raid in $raids ; do
|
||||
if [ "$raid" == "$name" ]; then
|
||||
case " $DMRAIDS " in
|
||||
*" $raid "*) ;;
|
||||
*) DMRAIDS="$DMRAIDS $raid"
|
||||
[ -z "$nodmraid" ] && find_base_dm_mods
|
||||
;;
|
||||
esac
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
handleiscsi() {
|
||||
vecho "Found iscsi component $1"
|
||||
|
||||
# We call iscsi_set_parameters once here to figure out what network to
|
||||
# use (it sets tgt_ipaddr), and once again to emit iscsi values,
|
||||
# not very efficient.
|
||||
iscsi_set_parameters $1
|
||||
iscsi_devs="$iscsi_devs $1"
|
||||
netdev=$(/sbin/ip route get to $tgt_ipaddr | \
|
||||
sed 's|.*dev \(.*\).*|\1|g' | awk '{ print $1; exit }')
|
||||
addnetdev $netdev
|
||||
}
|
||||
|
||||
handleraid() {
|
||||
local start=0
|
||||
|
||||
if [ -n "$noraid" -o ! -f /proc/mdstat ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
levels=$(awk "/^$1[ ]*:/ { print\$4 }" /proc/mdstat)
|
||||
|
||||
for level in $levels ; do
|
||||
case $level in
|
||||
linear)
|
||||
start=1
|
||||
;;
|
||||
multipath)
|
||||
start=1
|
||||
;;
|
||||
raid[01] | raid10)
|
||||
start=1
|
||||
;;
|
||||
raid[456])
|
||||
start=1
|
||||
;;
|
||||
*)
|
||||
error "raid level $level (in /proc/mdstat) not recognized"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
if [ "$start" = 1 ]; then
|
||||
raiddevices="$raiddevices $1"
|
||||
fi
|
||||
return $start
|
||||
}
|
||||
|
||||
lvshow() {
|
||||
lvm lvs --ignorelockingfailure --noheadings -o vg_name \
|
||||
$1 2>/dev/null | egrep -v '^ *(WARNING:|Volume Groups with)'
|
||||
}
|
||||
|
||||
vgdisplay() {
|
||||
lvm vgdisplay --ignorelockingfailure -v $1 2>/dev/null |
|
||||
sed -n 's/PV Name//p'
|
||||
}
|
||||
|
||||
dmmods_found="n"
|
||||
find_base_dm_mods()
|
||||
{
|
||||
[ "$dmmods_found" == "n" ] || return
|
||||
dmmods_found="y"
|
||||
}
|
||||
|
||||
savedargs=$*
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
--fstab*)
|
||||
if [ "$1" != "${1##--fstab=}" ]; then
|
||||
fstab=${1##--fstab=}
|
||||
else
|
||||
fstab=$2
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
|
||||
|
||||
-v|--verbose)
|
||||
set_verbose true
|
||||
;;
|
||||
--net-dev*)
|
||||
if [ "$1" != "${1##--net-dev=}" ]; then
|
||||
net_list="$net_list ${1##--net-dev=}"
|
||||
else
|
||||
net_list="$net_list $2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--rootdev*)
|
||||
if [ "$1" != "${1##--rootdev=}" ]; then
|
||||
rootdev="${1##--rootdev=}"
|
||||
else
|
||||
rootdev="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--thawdev*)
|
||||
if [ "$1" != "${1##--thawdev=}" ]; then
|
||||
thawdev="${1##--thawdev=}"
|
||||
else
|
||||
thawdev="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--rootfs*)
|
||||
if [ "$1" != "${1##--rootfs=}" ]; then
|
||||
rootfs="${1##--rootfs=}"
|
||||
else
|
||||
rootfs="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--rootopts*)
|
||||
if [ "$1" != "${1##--rootopts=}" ]; then
|
||||
rootopts="${1##--rootopts=}"
|
||||
else
|
||||
rootopts="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--root*)
|
||||
if [ "$1" != "${1##--root=}" ]; then
|
||||
root="${1##--root=}"
|
||||
else
|
||||
root="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--loopdev*)
|
||||
if [ "$1" != "${1##--loopdev=}" ]; then
|
||||
loopdev="${1##--loopdev=}"
|
||||
else
|
||||
loopdev="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--loopfs*)
|
||||
if [ "$1" != "${1##--loopfs=}" ]; then
|
||||
loopfs="${1##--loopfs=}"
|
||||
else
|
||||
loopfs="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--loopopts*)
|
||||
if [ "$1" != "${1##--loopopts=}" ]; then
|
||||
loopopts="${1##--loopopts=}"
|
||||
else
|
||||
loopopts="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--looppath*)
|
||||
if [ "$1" != "${1##--looppath=}" ]; then
|
||||
looppath="${1##--looppath=}"
|
||||
else
|
||||
looppath="$2"
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
--help)
|
||||
usage -n
|
||||
;;
|
||||
*)
|
||||
if [ -z "$target" ]; then
|
||||
target=$1
|
||||
elif [ -z "$kernel" ]; then
|
||||
kernel=$1
|
||||
else
|
||||
usage
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
shift
|
||||
done
|
||||
|
||||
[ -z "$rootfs" ] && rootfs=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $3; }}' $fstab)
|
||||
[ -z "$rootopts" ] && rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' $fstab)
|
||||
[ -z "$rootopts" ] && rootopts="defaults"
|
||||
|
||||
|
||||
[ -z "$rootdev" ] && rootdev=$(awk '/^[ \t]*[^#]/ { if ($2 == "/") { print $1; }}' $fstab)
|
||||
# check if it's nfsroot
|
||||
physdev=""
|
||||
if [ "$rootfs" == "nfs" ]; then
|
||||
if [ "x$net_list" == "x" ]; then
|
||||
handlenfs $rootdev
|
||||
fi
|
||||
else
|
||||
# check if it's root by label
|
||||
rdev=$rootdev
|
||||
rdev=$(resolve_device_name "$rdev")
|
||||
rootopts=$(echo $rootopts | sed -e 's/^r[ow],//' -e 's/,_netdev//' -e 's/_netdev//' -e 's/,_rnetdev//' -e 's/_rnetdev//' -e 's/,r[ow],$//' -e 's/,r[ow],/,/' -e 's/^r[ow]$/defaults/' -e 's/$/,ro/')
|
||||
findstoragedriver "$rdev"
|
||||
fi
|
||||
|
||||
# find the first swap dev which would get used for swsusp
|
||||
[ -z "$thawdev" ] && thawdev=$(awk '/^[ \t]*[^#]/ { if ($3 == "swap") { print $1; exit }}' $fstab)
|
||||
swsuspdev="$thawdev"
|
||||
if [ -n "$swsuspdev" ]; then
|
||||
swsuspdev=$(resolve_device_name "$swsuspdev")
|
||||
findstoragedriver "$swsuspdev"
|
||||
fi
|
||||
|
||||
|
||||
cemit()
|
||||
{
|
||||
cat
|
||||
}
|
||||
|
||||
emit()
|
||||
{
|
||||
NONL=""
|
||||
if [ "$1" == "-n" ]; then
|
||||
NONL="-n"
|
||||
shift
|
||||
fi
|
||||
echo $NONL "$@"
|
||||
}
|
||||
|
||||
emitdmraids()
|
||||
{
|
||||
if [ -z "$nodmraid" -a -n "$DMRAIDS" ]; then
|
||||
for raid in $DMRAIDS; do
|
||||
echo -n "rd_DM_UUID=$raid "
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# HACK: module loading + device creation isn't necessarily synchronous...
|
||||
# this will make sure that we have all of our devices before trying
|
||||
# things like RAID or LVM
|
||||
emitdmraids
|
||||
|
||||
emitcrypto()
|
||||
{
|
||||
local luksuuid=$(grep "^$2 " /etc/crypttab 2>/dev/null| awk '{ print $2 }')
|
||||
if [ -z "$luksuuid" ]; then
|
||||
luksuuid="$2"
|
||||
fi
|
||||
luksuuid=${luksuuid##UUID=}
|
||||
echo -n "rd_LUKS_UUID=$luksuuid "
|
||||
}
|
||||
|
||||
if [ -n "$raiddevices" ]; then
|
||||
for dev in $raiddevices; do
|
||||
uid=$(udevadm info --query=env --name /dev/${dev}|grep MD_UUID)
|
||||
uid=${uid##MD_UUID=}
|
||||
[ -n "$uid" ] && echo -n "rd_MD_UUID=$uid "
|
||||
done
|
||||
else
|
||||
echo -n "rd_NO_MD "
|
||||
fi
|
||||
|
||||
if [ -z "$nolvm" -a -n "$vg_list" ]; then
|
||||
for vg in $vg_list; do
|
||||
echo -n "rd_LVM_VG=$vg "
|
||||
done
|
||||
else
|
||||
echo -n "rd_NO_LVM "
|
||||
fi
|
||||
|
||||
cryptdevs="$(echo ${!cryptoraid@} ${!cryptopart@} ${!cryptolv@})"
|
||||
|
||||
if [ -z "$cryptdevs" ]; then
|
||||
echo -n "rd_NO_LUKS "
|
||||
else
|
||||
for cryptdev in ${!cryptoraid@} ${!cryptopart@} ${!cryptolv@} ; do
|
||||
emitcrypto `eval echo '$'$cryptdev`
|
||||
done
|
||||
fi
|
||||
|
||||
# output local keyboard/18n settings
|
||||
[ -e /etc/sysconfig/keyboard ] && . /etc/sysconfig/keyboard
|
||||
[ -e /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
|
||||
|
||||
for i in KEYTABLE SYSFONT SYSFONTACM UNIMAP LANG; do
|
||||
val=$(eval echo \$$i)
|
||||
[[ $val ]] && echo -n "$i=$val "
|
||||
done
|
||||
|
||||
if [ -n "$KEYBOARDTYPE" -a "$KEYBOARDTYPE" != "pc" ]; then
|
||||
echo -n "KEYBOARDTYPE=$KEYBOARDTYPE "
|
||||
fi
|
||||
|
||||
if [ -n "$rootdev" ]; then
|
||||
echo -n "root=$rootdev "
|
||||
fi
|
||||
|
||||
echo
|
@@ -1,46 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
|
||||
<!-- lifted from troff+man by doclifter -->
|
||||
<refentry id='dracutgencmdline8'>
|
||||
<refmeta>
|
||||
<refentrytitle>DRACUT-GENCMDLINE</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
<refmiscinfo class='source'>June 2009</refmiscinfo>
|
||||
<refmiscinfo class='manual'>Linux</refmiscinfo>
|
||||
</refmeta>
|
||||
<refnamediv id='name'>
|
||||
<refname>dracut-gencmdline</refname>
|
||||
<refpurpose>generates kernel command line parameters for the dracut generated initramfs</refpurpose>
|
||||
</refnamediv>
|
||||
<!-- body begins here -->
|
||||
<refsynopsisdiv id='synopsis'>
|
||||
<cmdsynopsis>
|
||||
<command>dracut-gencmdline</command>
|
||||
<sbr/>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
|
||||
<refsect1 id='description'><title>DESCRIPTION</title>
|
||||
<para><command>dracut-gencmdline</command>
|
||||
generates kernel command line parameters for the dracut generated initramfs, which are very specific to the host system.</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='authors'><title>AUTHORS</title>
|
||||
<literallayout remap='.nf'>
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
</literallayout> <!-- .fi -->
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='availability'><title>AVAILABILITY</title>
|
||||
<para>The dracut-gencmdline command is part of the dracut package and is available from
|
||||
<ulink url='https://dracut.wiki.kernel.org'>https://dracut.wiki.kernel.org</ulink></para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 id='see_also'><title>SEE ALSO</title>
|
||||
<para><citerefentry><refentrytitle>dracut</refentrytitle><manvolnum>8</manvolnum></citerefentry></para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
19
dracut-initramfs-restore.sh
Normal file
19
dracut-initramfs-restore.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
set -e
|
||||
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
|
||||
else
|
||||
# something failed, so we clean up
|
||||
rm -f /run/initramfs/shutdown
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
@@ -271,12 +271,8 @@ _dlvl2syslvl() {
|
||||
# - @c INFO to @c info
|
||||
# - @c DEBUG and @c TRACE both to @c debug
|
||||
_do_dlog() {
|
||||
[ -z "$maxloglvl" ] && return 0
|
||||
local lvl="$1"; shift
|
||||
local lvlc=$(_lvl2char "$lvl") || return 0
|
||||
|
||||
[ $lvl -le $maxloglvl ] || return 0
|
||||
|
||||
local msg="$lvlc: $*"
|
||||
|
||||
[ $lvl -le $stdloglvl ] && echo "$msg" >&2
|
||||
@@ -307,6 +303,9 @@ _do_dlog() {
|
||||
# dwarn "This is a warning"
|
||||
# echo "This is a warning" | dwarn
|
||||
dlog() {
|
||||
[ -z "$maxloglvl" ] && return 0
|
||||
[ $1 -le $maxloglvl ] || return 0
|
||||
|
||||
if [ $# -gt 1 ]; then
|
||||
_do_dlog "$@"
|
||||
else
|
||||
@@ -314,7 +313,6 @@ dlog() {
|
||||
_do_dlog "$1" "$line"
|
||||
done
|
||||
fi
|
||||
[ -n "$debug" ] && set -x || :
|
||||
}
|
||||
|
||||
## @brief Logs message at TRACE level (6)
|
||||
@@ -324,6 +322,7 @@ dlog() {
|
||||
dtrace() {
|
||||
set +x
|
||||
dlog 6 "$@"
|
||||
[ -n "$debug" ] && set -x || :
|
||||
}
|
||||
|
||||
## @brief Logs message at DEBUG level (5)
|
||||
@@ -333,6 +332,7 @@ dtrace() {
|
||||
ddebug() {
|
||||
set +x
|
||||
dlog 5 "$@"
|
||||
[ -n "$debug" ] && set -x || :
|
||||
}
|
||||
|
||||
## @brief Logs message at INFO level (4)
|
||||
@@ -342,6 +342,7 @@ ddebug() {
|
||||
dinfo() {
|
||||
set +x
|
||||
dlog 4 "$@"
|
||||
[ -n "$debug" ] && set -x || :
|
||||
}
|
||||
|
||||
## @brief Logs message at WARN level (3)
|
||||
@@ -351,6 +352,7 @@ dinfo() {
|
||||
dwarn() {
|
||||
set +x
|
||||
dlog 3 "$@"
|
||||
[ -n "$debug" ] && set -x || :
|
||||
}
|
||||
|
||||
## @brief It's an alias to dwarn() function.
|
||||
@@ -360,6 +362,7 @@ dwarn() {
|
||||
dwarning() {
|
||||
set +x
|
||||
dwarn "$@"
|
||||
[ -n "$debug" ] && set -x || :
|
||||
}
|
||||
|
||||
## @brief Logs message at ERROR level (2)
|
||||
@@ -369,6 +372,7 @@ dwarning() {
|
||||
derror() {
|
||||
set +x
|
||||
dlog 2 "$@"
|
||||
[ -n "$debug" ] && set -x || :
|
||||
}
|
||||
|
||||
## @brief Logs message at FATAL level (1)
|
||||
@@ -378,4 +382,5 @@ derror() {
|
||||
dfatal() {
|
||||
set +x
|
||||
dlog 1 "$@"
|
||||
[ -n "$debug" ] && set -x || :
|
||||
}
|
19
dracut-shutdown.service
Normal file
19
dracut-shutdown.service
Normal file
@@ -0,0 +1,19 @@
|
||||
# This file is part of systemd.
|
||||
#
|
||||
# systemd 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.
|
||||
|
||||
[Unit]
|
||||
Description=Restore /run/initramfs
|
||||
After=getty@tty1.service prefdm.service
|
||||
Before=reboot.service
|
||||
DefaultDependencies=no
|
||||
ConditionPathExists=/run/initramfs/.need_shutdown
|
||||
ConditionPathExists=!/run/initramfs/bin/sh
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/lib/dracut/dracut-initramfs-restore
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
387
dracut.8.asc
Normal file
387
dracut.8.asc
Normal file
@@ -0,0 +1,387 @@
|
||||
DRACUT(8)
|
||||
=========
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
|
||||
NAME
|
||||
----
|
||||
dracut - low-level tool for generating an initramfs image
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
*dracut* ['OPTION...'] [<image> [_<kernel version>_]]
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
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.
|
||||
|
||||
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)
|
||||
|
||||
OPTIONS
|
||||
-------
|
||||
**-f, --force**::
|
||||
overwrite existing initramfs file.
|
||||
|
||||
**-m, --modules** _<list of 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_. This
|
||||
parameter can be specified multiple times.
|
||||
+
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
----
|
||||
# dracut --modules "module1 module2" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**-o, --omit** _<list of dracut modules>_::
|
||||
omit a space-separated list of dracut modules. This parameter can be
|
||||
specified multiple times.
|
||||
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
----
|
||||
# dracut --omit "module1 module2" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**-a, --add** _<list of dracut modules>_::
|
||||
add a space-separated list of dracut modules to the default set of modules.
|
||||
This parameter can be specified multiple times.
|
||||
+
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
----
|
||||
# dracut --add "module1 module2" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**--force-add** _<list of dracut modules>_::
|
||||
force to add a space-separated list of dracut modules to the default set of
|
||||
modules, when -H is specified. This parameter can be specified multiple
|
||||
times.
|
||||
+
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
----
|
||||
# dracut --force-add "module1 module2" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**-d, --drivers** _<list of kernel modules>_::
|
||||
specify a space-separated list of kernel modules to exclusively include
|
||||
in the initramfs. The kernel modules have to be specified without the ".ko"
|
||||
suffix. This parameter can be specified multiple times.
|
||||
+
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
----
|
||||
# dracut --drivers "kmodule1 kmodule2" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**--add-drivers** _<list of kernel modules>_::
|
||||
specify a space-separated list of kernel modules to add to the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix. This
|
||||
parameter can be specified multiple times.
|
||||
+
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
----
|
||||
# dracut --add-drivers "kmodule1 kmodule2" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**--omit-drivers** _<list of kernel modules>_::
|
||||
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. This
|
||||
parameter can be specified multiple times.
|
||||
+
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
----
|
||||
# dracut --omit-drivers "kmodule1 kmodule2" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**--filesystems** _<list of filesystems>_::
|
||||
specify a space-separated list of kernel filesystem modules to exclusively
|
||||
include in the generic initramfs. This parameter can be specified multiple
|
||||
times.
|
||||
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
----
|
||||
# dracut --filesystems "filesystem1 filesystem2" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**-k, --kmoddir** _<kernel directory>_::
|
||||
specify the directory, where to look for kernel modules
|
||||
|
||||
**--fwdir** _<dir>[:<dir>...]++_::
|
||||
specify additional directories, where to look for firmwares. This parameter
|
||||
can be specified multiple times.
|
||||
|
||||
**--kernel-only**::
|
||||
only install kernel drivers and firmware files
|
||||
|
||||
**--no-kernel**::
|
||||
do not install kernel drivers and firmware files
|
||||
|
||||
**--mdadmconf**::
|
||||
include local _/etc/mdadm.conf_
|
||||
|
||||
**--nomdadmconf**::
|
||||
do not include local _/etc/mdadm.conf_
|
||||
|
||||
**--lvmconf**::
|
||||
include local _/etc/lvm/lvm.conf_
|
||||
|
||||
**--nolvmconf**::
|
||||
do not include local _/etc/lvm/lvm.conf_
|
||||
|
||||
**--fscks** [LIST]::
|
||||
add a space-separated list of fsck tools, in addition to _dracut.conf_'s
|
||||
specification; the installation is opportunistic (non-existing tools are
|
||||
ignored)
|
||||
+
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
----
|
||||
# dracut --fscks "fsck.foo barfsck" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**--nofscks**::
|
||||
inhibit installation of any fsck tools
|
||||
|
||||
**--strip**::
|
||||
strip binaries in the initramfs (default)
|
||||
|
||||
**--nostrip**::
|
||||
do not strip binaries in the initramfs
|
||||
|
||||
**--prefix** _<dir>_::
|
||||
prefix initramfs files with the specified directory
|
||||
|
||||
**--noprefix**::
|
||||
do not prefix initramfs files (default)
|
||||
|
||||
**-h, --help**::
|
||||
display help text and exit.
|
||||
|
||||
**--debug**::
|
||||
output debug information of the build process
|
||||
|
||||
**-v, --verbose**::
|
||||
increase verbosity level (default is info(4))
|
||||
|
||||
**-q, --quiet**:: decrease verbosity level (default is info(4))
|
||||
|
||||
**-c, --conf** _<dracut configuration file>_::
|
||||
specify configuration file to use.
|
||||
+
|
||||
Default:
|
||||
_/etc/dracut.conf_
|
||||
|
||||
**--confdir** _<configuration directory>_::
|
||||
specify configuration directory to use.
|
||||
+
|
||||
Default:
|
||||
_/etc/dracut.conf.d_
|
||||
|
||||
**--tmpdir** _<temporary directory>_::
|
||||
specify temporary directory to use.
|
||||
+
|
||||
Default:
|
||||
_/var/tmp_
|
||||
|
||||
**--sshkey** _<sshkey file>_:: ssh key file used with ssh-client module.
|
||||
|
||||
**-l, --local**::
|
||||
activates the local mode. dracut will use modules from the current working
|
||||
directory instead of the system-wide installed modules in
|
||||
_/usr/lib/dracut/modules.d_.
|
||||
This is useful when running dracut from a git checkout.
|
||||
|
||||
**-H, --hostonly**::
|
||||
Host-Only mode: Install only what is needed for booting
|
||||
the local host instead of a generic host.
|
||||
+
|
||||
[WARNING]
|
||||
====
|
||||
If chrooted to another root other than the real root device, use "--fstab" and
|
||||
provide a valid _/etc/fstab_.
|
||||
====
|
||||
|
||||
**--no-hostonly**::
|
||||
Disable Host-Only mode
|
||||
|
||||
**--fstab**::
|
||||
Use _/etc/fstab_ instead of _/proc/self/mountinfo_.
|
||||
|
||||
**--add-fstab** _<filename>_ ::
|
||||
Add entries of _<filename>_ to the initramfs /etc/fstab.
|
||||
|
||||
**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_"::
|
||||
Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem
|
||||
options>_ in the initramfs
|
||||
|
||||
**-i, --include** _<SOURCE>_ _<TARGET>_::
|
||||
include the files in the SOURCE directory into the
|
||||
TARGET directory in the final initramfs. If SOURCE is a file, it will be
|
||||
installed to TARGET in the final initramfs. This parameter can be specified
|
||||
multiple times.
|
||||
|
||||
**-I, --install** _<file list>_::
|
||||
install the space separated list of files into the initramfs.
|
||||
+
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
+
|
||||
----
|
||||
# dracut --install "/bin/foo /sbin/bar" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**--gzip**::
|
||||
Compress the generated initramfs using gzip. This will be done by default,
|
||||
unless another compression option or --no-compress is passed. Equivalent to
|
||||
"--compress=gzip -9"
|
||||
|
||||
**--bzip2**::
|
||||
Compress the generated initramfs using bzip2.
|
||||
+
|
||||
[WARNING]
|
||||
====
|
||||
Make sure your kernel has bzip2 decompression support compiled in, otherwise you
|
||||
will not be able to boot. Equivalent to "--compress=bzip2"
|
||||
====
|
||||
|
||||
**--lzma**::
|
||||
Compress the generated initramfs using lzma.
|
||||
+
|
||||
[WARNING]
|
||||
====
|
||||
Make sure your kernel has lzma decompression support compiled in, otherwise you
|
||||
will not be able to boot. Equivalent to "--compress=lzma -9"
|
||||
====
|
||||
|
||||
**--xz**::
|
||||
Compress the generated initramfs using xz.
|
||||
+
|
||||
[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"
|
||||
====
|
||||
|
||||
**--compress** _<compressor>_::
|
||||
Compress the generated initramfs using the passed compression program. If
|
||||
you pass it just the name of a compression program, it will call that
|
||||
program with known-working arguments. If you pass a quoted string with
|
||||
arguments, it will be called with exactly those arguments. Depending on what
|
||||
you pass, this may result in an initramfs that the kernel cannot decompress.
|
||||
|
||||
**--no-compress**::
|
||||
Do not compress the generated initramfs. This will override any other
|
||||
compression options.
|
||||
|
||||
**--list-modules**::
|
||||
List all available dracut modules.
|
||||
|
||||
**-M, --show-modules**::
|
||||
Print included module's name to standard output during build.
|
||||
|
||||
**--keep**::
|
||||
Keep the initramfs temporary directory for debugging purposes.
|
||||
|
||||
FILES
|
||||
-----
|
||||
_/var/log/dracut.log_::
|
||||
logfile of initramfs image creation
|
||||
|
||||
_/tmp/dracut.log_::
|
||||
logfile of initramfs image creation, if _/var/log/dracut.log_ is not
|
||||
writable
|
||||
|
||||
_/etc/dracut.conf_::
|
||||
see dracut.conf5
|
||||
|
||||
_/etc/dracut.conf.d/*.conf_::
|
||||
see dracut.conf5
|
||||
|
||||
Configuration in the initramfs
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
_/etc/conf.d/_::
|
||||
Any files found in _/etc/conf.d/_ will be sourced in the initramfs to
|
||||
set initial values. Command line options will override these values
|
||||
set in the configuration files.
|
||||
|
||||
_/etc/cmdline_::
|
||||
Can contain additional command line options.
|
||||
|
||||
AVAILABILITY
|
||||
------------
|
||||
The dracut command is part of the dracut package and is available from
|
||||
link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
|
||||
|
||||
AUTHORS
|
||||
-------
|
||||
*Harald Hoyer*::
|
||||
Project Leader and Developer
|
||||
|
||||
*Victor Lowther*::
|
||||
Developer
|
||||
|
||||
*Philippe Seewer*::
|
||||
Developer
|
||||
|
||||
*Warren Togami*::
|
||||
Developer
|
||||
|
||||
*Amadeusz Żołnowski*::
|
||||
Developer
|
||||
|
||||
*Jeremy Katz*::
|
||||
Developer
|
||||
|
||||
*David Dillow*::
|
||||
Developer
|
||||
|
||||
*Will Woods*::
|
||||
Developer
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
*dracut.cmdline*(7) *dracut.conf*(5)
|
558
dracut.8.xml
558
dracut.8.xml
@@ -1,558 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- This document was created with Syntext Serna Free. --><!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
|
||||
<refentry id="dracut8">
|
||||
<refentryinfo>
|
||||
<title>dracut</title>
|
||||
<productname>dracut</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Project Leader, Developer</contrib>
|
||||
<firstname>Harald</firstname>
|
||||
<surname>Hoyer</surname>
|
||||
<email>harald@redhat.com</email>
|
||||
</author>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Victor</firstname>
|
||||
<surname>Lowther</surname>
|
||||
<email>victor.lowther@gmail.com</email>
|
||||
</author>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Warren</firstname>
|
||||
<surname>Togami</surname>
|
||||
<email>wtogami@redhat.com</email>
|
||||
</author>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Jeremy</firstname>
|
||||
<surname>Katz</surname>
|
||||
<email>katzj@redhat.com</email>
|
||||
</author>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Philippe</firstname>
|
||||
<surname>Seewer</surname>
|
||||
<email>philippe.seewer@bfh.ch</email>
|
||||
</author>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>David</firstname>
|
||||
<surname>Dillow</surname>
|
||||
<email>dave@thedillows.org</email>
|
||||
</author>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Amadeusz</firstname>
|
||||
<surname>Żołnowski</surname>
|
||||
<email>aidecoe@aidecoe.name</email>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>dracut</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
<refmiscinfo class="version"/>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>dracut</refname>
|
||||
<refpurpose>create initial ramdisk images for preloading modules</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>dracut</command>
|
||||
<arg choice="opt" rep="repeat">
|
||||
<replaceable>OPTION</replaceable>
|
||||
</arg>
|
||||
<arg choice="opt">
|
||||
<replaceable><image></replaceable>
|
||||
<arg choice="opt">
|
||||
<replaceable><kernel-version></replaceable>
|
||||
</arg>
|
||||
</arg>
|
||||
<sbr/>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<para><command>dracut</command>
|
||||
creates an initial image used by the kernel for
|
||||
preloading the block device modules (such as IDE, SCSI or RAID)
|
||||
which are needed to access the root filesystem.</para>
|
||||
<para>
|
||||
For a complete list of kernel command line options see
|
||||
<citerefentry>
|
||||
<refentrytitle>dracut.kernel</refentrytitle>
|
||||
<manvolnum>7</manvolnum>
|
||||
</citerefentry>
|
||||
</para>
|
||||
<refsect2>
|
||||
<title>Options</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-f</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--force</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>overwrite existing initramfs file.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-m</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--modules <replaceable><list of dracut modules></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify a space-separated list of dracut modules to call
|
||||
when building the initramfs.
|
||||
Modules are located in
|
||||
<filename>/usr/share/dracut/modules.d</filename>. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-o</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--omit <replaceable><list of dracut modules></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>omit a space-separated list of dracut modules. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-a</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--add <replaceable><list of dracut modules></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>add a space-separated list of dracut modules to the default set of modules. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--force-add <replaceable><list of dracut modules></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>force to add a space-separated list of dracut modules to the default set of modules, when -H is specified. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-d</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--drivers <replaceable><list of kernel modules></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify a space-separated list of kernel modules to exclusively include
|
||||
in the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--add-drivers <replaceable><list of kernel modules></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify a space-separated list of kernel modules to add to the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--filesystems <replaceable><list of filesystems></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify a space-separated list of kernel filesystem modules to exclusively
|
||||
include in the generic initramfs. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-k</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--kmoddir <replaceable><kernel directory></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify the directory, where to look for kernel modules</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option> --fwdir <replaceable><dir>[:<dir>...]</replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify additional directories, where to look for firmwares. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--kernel-only</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>only install kernel drivers and firmware files</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--no-kernel</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not install kernel drivers and firmware files</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--mdadmconf</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>include local <filename>/etc/mdadm.conf</filename></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--nomdadmconf</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not include local <filename>/etc/mdadm.conf</filename></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--strip</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>strip binaries in the initramfs (default)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--nostrip</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not strip binaries in the initramfs</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--prefix</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>prefix initramfs files with /run/initramfs/</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--noprefix</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>do not prefix initramfs files with /run/initramfs/ (default)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-h</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--help</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>display help text and exit.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--debug</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>output debug information of the build process</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-v</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--verbose</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>increase verbosity level (default is info(4))</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-q</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--quiet</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>decrease verbosity level (default is info(4))</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-c</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--conf <replaceable><dracut configuration file></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify configuration file to use.
|
||||
Default:
|
||||
<filename>/etc/dracut.conf</filename></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--confdir <replaceable><configuration directory></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>specify configuration directory to use.
|
||||
Default:
|
||||
<filename>/etc/dracut.conf.d</filename></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-l</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--local</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>activates the local mode. dracut will use modules from the current working
|
||||
directory instead of the system-wide installed modules in
|
||||
<filename>/usr/share/dracut/modules.d</filename>.
|
||||
This is useful when running dracut from a git checkout.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-H</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--hostonly</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Host-Only mode: Install only what is needed for booting
|
||||
the local host instead of a generic host.
|
||||
<warning>
|
||||
<para>If chrooted to another root other than the real root device, use "--fstab" and provide a valid <filename>/etc/fstab</filename>.</para>
|
||||
</warning></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--fstab</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Use <filename>/etc/fstab</filename> instead of <filename>/proc/self/mountinfo</filename>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-i</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--include <replaceable><SOURCE></replaceable> <replaceable><TARGET></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>include the files in the SOURCE directory into the
|
||||
TARGET directory in the final initramfs. If SOURCE is a file, it will be installed to TARGET in the final initramfs. This parameter can be specified multiple times.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-I</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--install <replaceable><file list></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>install the space separated list of files into the initramfs.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--gzip</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Compress the generated initramfs using gzip.
|
||||
This will be done by default, unless another compression option or --no-compress is passed. Equivalent to "--compress=gzip -9"</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--bzip2</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Compress the generated initramfs using bzip2.
|
||||
<warning>
|
||||
<para>Make sure your kernel has bzip2 decompression support compiled in, otherwise you will not be able to boot. Equivalent to "--compress=bzip2"</para>
|
||||
</warning></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--lzma</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Compress the generated initramfs using lzma.
|
||||
<warning>
|
||||
<para>Make sure your kernel has lzma decompression support compiled in, otherwise you will not be able to boot. Equivalent to "--compress=lzma -9"</para>
|
||||
</warning></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--xz</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Compress the generated initramfs using xz.
|
||||
<warning>
|
||||
<para>Make sure your kernel has xz decompression support compiled in, otherwise you will not be able to boot. Equivalent to "--compress=xz --check=crc32 --lzma2=dict=1MiB"</para>
|
||||
</warning></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--compress <replaceable><compressor></replaceable></option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Compress the generated initramfs using the passed compression program. If you pass it just the name of a compression program, it will call that program with known-working arguments. If you pass a quoted string with arguments, it will be called with exactly those arguments. Depending on what you pass, this may result in an initramfs that the kernel cannot decompress.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--no-compress</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Do not compress the generated initramfs. This will override any other compression options.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--list-modules</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>List all available dracut modules.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-M</option>
|
||||
</term>
|
||||
<term>
|
||||
<option>--show-modules</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Print included module's name to standard output during build.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--keep</option>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Keep the initramfs temporary directory for debugging purposes.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Files</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/var/log/dracut.log</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>logfile of initramfs image creation</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/tmp/dracut.log</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>logfile of initramfs image creation, if <filename>/var/log/dracut.log</filename> is not writable</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/dracut.conf</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>see <citerefentry>
|
||||
<refentrytitle>dracut.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/dracut.conf.d/*.conf</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>see <citerefentry>
|
||||
<refentrytitle>dracut.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
<refsect2>
|
||||
<title>Configuration in the Initramfs</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/conf.d/</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Any files found in <filename>/etc/conf.d/</filename> will be sourced in the initramfs to
|
||||
set initial values. Command line options will override these values
|
||||
set in the configuration files.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/cmdline</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Can contain additional command line options.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect2>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Availability</title>
|
||||
<para>The dracut command is part of the dracut package and is available from
|
||||
<ulink url='https://dracut.wiki.kernel.org'>https://dracut.wiki.kernel.org</ulink></para>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
<para>
|
||||
<citerefentry>
|
||||
<refentrytitle>dracut.kernel</refentrytitle>
|
||||
<manvolnum>7</manvolnum>
|
||||
</citerefentry>
|
||||
<citerefentry>
|
||||
<refentrytitle>dracut.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</citerefentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
1033
dracut.asc
Normal file
1033
dracut.asc
Normal file
File diff suppressed because it is too large
Load Diff
653
dracut.cmdline.7.asc
Normal file
653
dracut.cmdline.7.asc
Normal file
@@ -0,0 +1,653 @@
|
||||
DRACUT.CMDLINE(7)
|
||||
=================
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
|
||||
NAME
|
||||
----
|
||||
dracut.cmdline - dracut kernel command line options
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
The root device used by the kernel is specified in the boot configuration
|
||||
file on the kernel command line, as always.
|
||||
|
||||
The traditional _root=/dev/sda1_ style device specification is allowed, but not
|
||||
encouraged. The root device should better be identified by LABEL or UUID. If a
|
||||
label is used, as in _root=LABEL=<label_of_root>_ the initramfs will search all
|
||||
available devices for a filesystem with the appropriate label, and mount that
|
||||
device as the root filesystem. _root=UUID=<uuidnumber>_ will mount the partition
|
||||
with that UUID as the root filesystem.
|
||||
|
||||
In the following all kernel command line parameters, which are processed by
|
||||
dracut, are described.
|
||||
|
||||
"rd.*" parameters mentioned without "=" are boolean parameters. They can be
|
||||
turned on/off by setting them to {0|1}. If the assignment with "=" is missing
|
||||
"=1" is implied. For example _rd.info_ can be turned off with _rd.info=0_ or
|
||||
turned on with _rd.info=1_ or _rd.info_. The last value in the kernel command
|
||||
line is the value, which is honored.
|
||||
|
||||
Standard
|
||||
~~~~~~~~
|
||||
**init=**_<path to real init>_::
|
||||
specify the path to the init programm to be started after the initramfs has
|
||||
finished
|
||||
|
||||
**root=**_<path to blockdevice>_::
|
||||
specify the block device to use as the root filesystem.
|
||||
+
|
||||
E.g.:
|
||||
+
|
||||
----
|
||||
root=/dev/sda1
|
||||
root=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1
|
||||
root=/dev/disk/by-label/Root
|
||||
root=LABEL=Root
|
||||
root=/dev/disk/by-uuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7
|
||||
root=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7
|
||||
----
|
||||
|
||||
**rootfstype=**_<filesystem type>_:: "auto" if not specified, e.g.:
|
||||
+
|
||||
----
|
||||
rootfstype=ext3
|
||||
----
|
||||
|
||||
**rootflags=**_<mount options>_::
|
||||
specify additional mount options for the root filesystem. If not set,
|
||||
_/etc/fstab_ of the real root will be parsed for special mount options and
|
||||
mounted accordingly.
|
||||
|
||||
**rd.fstab=0**::
|
||||
do not honor special mount options for the root filesystem found in
|
||||
_/etc/fstab_ of the real root.
|
||||
|
||||
**resume=**_<path to resume partition>_
|
||||
+
|
||||
E.g.:
|
||||
+
|
||||
----
|
||||
resume=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1
|
||||
resume=/dev/disk/by-uuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7
|
||||
resume=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7
|
||||
----
|
||||
|
||||
|
||||
Misc
|
||||
~~~~
|
||||
**rd.driver.blacklist=**_<drivername>[,<drivername>,...]_::
|
||||
do not load kernel module <drivername>. This parameter can be specified
|
||||
multiple times.
|
||||
|
||||
**rd.driver.pre=**_<drivername>[,<drivername>,...]_::
|
||||
force loading kernel module <drivername>. This parameter can be specified
|
||||
multiple times.
|
||||
|
||||
**rd.driver.post=**_<drivername>[,<drivername>,...]_::
|
||||
force loading kernel module <drivername> after all automatic loading modules
|
||||
have been loaded. This parameter can be specified multiple times.
|
||||
|
||||
[[dracutkerneldebug]]
|
||||
Debug
|
||||
~~~~~
|
||||
**rd.info**::
|
||||
print informational output though "quiet" is set
|
||||
|
||||
**rd.shell**::
|
||||
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_
|
||||
|
||||
**rd.break**::
|
||||
drop to a shell at the end
|
||||
|
||||
**rd.break=**_{cmdline|pre-udev|pre-trigger|initqueue|pre-mount|mount|pre-pivot|cleanup}_::
|
||||
drop to a shell on defined breakpoint
|
||||
|
||||
**rd.udev.info**::
|
||||
set udev to loglevel info
|
||||
|
||||
**rd.udev.debug**::
|
||||
set udev to loglevel debug
|
||||
|
||||
I18N
|
||||
~~~~
|
||||
**vconsole.keymap=**_<keymap base file name>_::
|
||||
keyboard translation table loaded by loadkeys; taken from keymaps directory;
|
||||
will be written as KEYMAP to _/etc/vconsole.conf_ in the initramfs, e.g.:
|
||||
+
|
||||
----
|
||||
vconsole.keymap=de-latin1-nodeadkeys
|
||||
----
|
||||
|
||||
**vconsole.keymap.ext=**_<list of keymap base file names>_::
|
||||
list of extra keymaps to bo loaded (sep. by space); will be written as
|
||||
EXT_KEYMAP to _/etc/vconsole.conf_ in the initramfs
|
||||
|
||||
**vconsole.unicode**[=_{0|1}_]::
|
||||
boolean, indicating UTF-8 mode; will be written as UNICODE to
|
||||
_/etc/vconsole.conf_ in the initramfs
|
||||
|
||||
**vconsole.font=**_<font base file name>_::
|
||||
console font; taken from consolefonts directory; will be written as FONT to
|
||||
_/etc/vconsole.conf_ in the initramfs; e.g.:
|
||||
+
|
||||
----
|
||||
vconsole.font=LatArCyrHeb-16
|
||||
----
|
||||
|
||||
**vconsole.font.map=**_<console map base file name>_::
|
||||
see description of '-m' parameter in setfont manual; taken from consoletrans
|
||||
directory; will be written as FONT_MAP to _/etc/vconsole.conf_ in the
|
||||
initramfs
|
||||
|
||||
**vconsole.font.unimap=**_<unicode table base file name>_::
|
||||
see description of '-u' parameter in setfont manual; taken from unimaps
|
||||
directory; will be written as FONT_UNIMAP to _/etc/vconsole.conf_ in the
|
||||
initramfs
|
||||
|
||||
**locale.LANG=**_<locale>_::
|
||||
taken from the environment; if no UNICODE is defined we set its value in
|
||||
basis of LANG value (whether it ends with ".utf8" (or similar) or not); will
|
||||
be written as LANG to _/etc/locale.conf_ in the initramfs; e.g.:
|
||||
+
|
||||
----
|
||||
locale.LANG=pl_PL.utf8
|
||||
----
|
||||
|
||||
**locale.LC_ALL=**_<locale>_::
|
||||
taken from the environment; will be written as LC_ALL to _/etc/locale.conf_
|
||||
in the initramfs
|
||||
|
||||
LVM
|
||||
~~~
|
||||
**rd.lvm=0**::
|
||||
disable LVM detection
|
||||
|
||||
**rd.lvm.vg=**_<volume group name>_::
|
||||
only activate the volume groups with the given name. rd.lvm.vg can be
|
||||
specified multiple times on the kernel command line.
|
||||
|
||||
**rd.lvm.lv=**_<logical volume name>_::
|
||||
only activate the logical volumes with the given name. rd.lvm.lv can be
|
||||
specified multiple times on the kernel command line.
|
||||
|
||||
**rd.lvm.conf=0**::
|
||||
remove any _/etc/lvm/lvm.conf_, which may exist in the initramfs
|
||||
|
||||
crypto LUKS
|
||||
~~~~~~~~~~~
|
||||
**rd.luks=0**::
|
||||
disable crypto LUKS detection
|
||||
|
||||
**rd.luks.uuid=**_<luks uuid>_::
|
||||
only activate the LUKS partitions with the given UUID. Any "luks-" of the
|
||||
LUKS UUID is removed before comparing to _<luks uuid>_.
|
||||
The comparisons also matches, if _<luks uuid>_ is only the beginning of the
|
||||
LUKS UUID, so you don't have to specify the full UUID.
|
||||
This parameter can be specified multiple times.
|
||||
|
||||
**rd.luks.allow-discards=**_<luks uuid>_::
|
||||
Allow using of discards (TRIM) requests for LUKS partitions with the given UUID.
|
||||
Any "luks-" of the LUKS UUID is removed before comparing to _<luks uuid>_.
|
||||
The comparisons also matches, if _<luks uuid>_ is only the beginning of the
|
||||
LUKS UUID, so you don't have to specify the full UUID.
|
||||
This parameter can be specified multiple times.
|
||||
|
||||
**rd.luks.allow-discards::
|
||||
Allow using of discards (TRIM) requests on all LUKS partitions.
|
||||
|
||||
**rd.luks.crypttab=0**::
|
||||
do not check, if LUKS partition is in _/etc/crypttab_
|
||||
|
||||
crypto LUKS - key on removable device support
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
**rd.luks.key=**_<keypath>:<keydev>:<luksdev>_::
|
||||
_keypath_ is a path to key file to look for. It's REQUIRED. When _keypath_ ends with '.gpg' it's considered to be key encrypted symmetrically with GPG. You will be prompted for password on boot. GPG support comes with 'crypt-gpg' module which needs to be added explicitly.
|
||||
+
|
||||
_keydev_ is a device on which key file resides. It might be kernel name of devices (should start with "/dev/"), UUID (prefixed with "UUID=") or label (prefix with "LABEL="). You don't have to specify full UUID. Just its beginning will suffice, even if its ambiguous. All matching devices will be probed. This parameter is recommended, but not required. If not present, all block devices will be probed, which may significantly increase boot time.
|
||||
+
|
||||
If _luksdev_ is given, the specified key will only be applied for that LUKS device. Possible values are the same as for _keydev_. Unless you have several LUKS devices, you don't have to specify this parameter. The simplest usage is:
|
||||
+
|
||||
----
|
||||
rd.luks.key=/foo/bar.key
|
||||
----
|
||||
+
|
||||
As you see, you can skip colons in such a case.
|
||||
|
||||
MD RAID
|
||||
~~~~~~~
|
||||
**rd.md=0**::
|
||||
disable MD RAID detection
|
||||
|
||||
**rd.md.imsm=0**::
|
||||
disable MD RAID for imsm/isw raids, use DM RAID instead
|
||||
|
||||
**rd.md.ddf=0**::
|
||||
disable MD RAID for SNIA ddf raids, use DM RAID instead
|
||||
|
||||
**rd.md.conf=0**::
|
||||
ignore mdadm.conf included in initramfs
|
||||
|
||||
**rd.md.waitclean=1**::
|
||||
wait for any resync, recovery, or reshape activity to finish before continuing
|
||||
|
||||
**rd.md.uuid=**_<md raid uuid>_::
|
||||
only activate the raid sets with the given UUID. This parameter can be
|
||||
specified multiple times.
|
||||
|
||||
DM RAID
|
||||
~~~~~~~
|
||||
**rd.dm=0**::
|
||||
disable DM RAID detection
|
||||
|
||||
**rd.dm.uuid=**_<dm raid uuid>_::
|
||||
only activate the raid sets with the given UUID. This parameter can be
|
||||
specified multiple times.
|
||||
|
||||
FIPS
|
||||
~~~~
|
||||
**rd.fips**::
|
||||
enable FIPS
|
||||
|
||||
**boot=**_<boot device>_::
|
||||
specify the device, where /boot is located. e.g.
|
||||
+
|
||||
----
|
||||
boot=/dev/sda1
|
||||
boot=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1
|
||||
boot=UUID=<uuid>
|
||||
boot=LABEL=<label>
|
||||
----
|
||||
|
||||
**rd.fips.skipkernel**::
|
||||
skip checksum check of the kernel image. Useful, if the kernel image is not
|
||||
in a separate boot partition.
|
||||
|
||||
Network
|
||||
~~~~~~~
|
||||
**ip=**_{dhcp|on|any|dhcp6|auto6|ibft}_::
|
||||
dhcp|on|any::: get ip from dhcp server from all interfaces. If root=dhcp, loop
|
||||
sequentially through all interfaces (eth0, eth1, ...) and use the first with
|
||||
a valid DHCP root-path.
|
||||
|
||||
auto6::: IPv6 autoconfiguration
|
||||
|
||||
dhcp6::: IPv6 DHCP
|
||||
|
||||
ibft::: iBFT autoconfiguration
|
||||
|
||||
**ip=**_<interface>_:_{dhcp|on|any|dhcp6|auto6}_[:[_<mtu>_][:_<macaddr>_]]::
|
||||
This parameter can be specified multiple times.
|
||||
+
|
||||
dhcp|on|any|dhcp6::: get ip from dhcp server on a specific interface
|
||||
auto6::: do IPv6 autoconfiguration
|
||||
<macaddr>::: optionally set <macaddr> on the <interface>
|
||||
|
||||
**ip=**_<client-IP>_:_<server-IP>_:_<gateway-IP>_:_<netmask>_:_<client_hostname>_:_<interface>_:_{none|off|dhcp|on|any|dhcp6|auto6|ibft}_[:[_<mtu>_][:_<macaddr>_]]::
|
||||
explicit network configuration. If you want do define a IPv6 address, put it
|
||||
in brackets (e.g. [2001:DB8::1]). This parameter can be specified multiple
|
||||
times.
|
||||
+
|
||||
<macaddr>::: optionally set <macaddr> on the <interface>
|
||||
|
||||
**ifname=**_<interface>_:_<MAC>_::
|
||||
Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>.
|
||||
Note: If you use this option you _must_ specify an ifname= argument for all
|
||||
interfaces used in ip= or fcoe= arguments. However, if the interface in
|
||||
ip= or fcoe= is a bridge, bonding or vlan interface, you should specify
|
||||
an ifname= for _each_ of its underlying interfaces. This parameter can be
|
||||
specified multiple times.
|
||||
|
||||
**bootdev=**_<interface>_::
|
||||
specify network interface to use routing and netroot information from.
|
||||
Required if multiple ip= lines are used.
|
||||
|
||||
**nameserver=**__<IP>__ [**nameserver=**__<IP>__ ...]::
|
||||
specify nameserver(s) to use
|
||||
|
||||
**biosdevname=0**::
|
||||
boolean, turn off biosdevname network interface renaming
|
||||
|
||||
**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),
|
||||
DEV_PLUS_VID (eth0.0005), DEV_PLUS_VID_NO_PAD (eth0.5)
|
||||
|
||||
**bond=_<bondname>_[:_<bondslaves>_:[:_<options>_]]**::
|
||||
Setup bonding device <bondname> on top of <bondslaves>.
|
||||
<bondslaves> is a comma-separated list of physical (ethernet) interfaces.
|
||||
<options> is a comma-separated list on bonding options (modinfo bonding for details)
|
||||
in format compatible with initscripts. If <options> includes multi-valued arp_ip_target option,
|
||||
then its values should be separated by semicolon.
|
||||
Bond without parameters assumes bond=bond0:eth0,eth1:mode=balance-rr
|
||||
|
||||
**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
|
||||
|
||||
|
||||
NFS
|
||||
~~~
|
||||
**root=**[_<server-ip>_:]_<root-dir>_[:_<nfs-options>_]::
|
||||
mount nfs share from <server-ip>:/<root-dir>, if no server-ip is given, use
|
||||
dhcp next_server. if server-ip is an IPv6 address it has to be put in
|
||||
brackets, e.g. [2001:DB8::1]. NFS options can be appended with the prefix
|
||||
":" or "," and are seperated by ",".
|
||||
|
||||
**root=**nfs:[_<server-ip>_:]_<root-dir>_[:_<nfs-options>_], **root=**nfs4:[_<server-ip>_:]_<root-dir>_[:_<nfs-options>_], **root=**_{dhcp|dhcp6}_::
|
||||
root=dhcp alone directs initrd to look at the DHCP root-path where NFS
|
||||
options can be specified.
|
||||
+
|
||||
----
|
||||
root-path=<server-ip>:<root-dir>[,<nfs-options>]
|
||||
root-path=nfs:<server-ip>:<root-dir>[,<nfs-options>]
|
||||
root-path=nfs4:<server-ip>:<root-dir>[,<nfs-options>]
|
||||
----
|
||||
|
||||
**root=**_/dev/nfs_ nfsroot=[_<server-ip>_:]_<root-dir>_[:_<nfs-options>_]::
|
||||
_Deprecated!_ kernel Documentation_/filesystems/nfsroot.txt_ defines this
|
||||
method. This is supported by dracut, but not recommended.
|
||||
|
||||
**rd.nfs.domain=**_<NFSv4 domain name>_::
|
||||
Set the NFSv4 domain name. Will overwrite the settings in _/etc/idmap.conf_.
|
||||
|
||||
iSCSI
|
||||
~~~~~
|
||||
**root=**iscsi:[_<username>_:_<password>_[:_<reverse>_:_<password>_]@][_<servername>_]:[_<protocol>_]:[_<port>_][:[_<iscsi_iface_name>_]:[_<netdev_name>_]]:[_<LUN>_]:_<targetname>_::
|
||||
protocol defaults to "6", LUN defaults to "0". If the "servername" field is
|
||||
provided by BOOTP or DHCP, then that field is used in conjunction with other
|
||||
associated fields to contact the boot server in the Boot stage. However, if
|
||||
the "servername" field is not provided, then the "targetname" field is then
|
||||
used in the Discovery Service stage in conjunction with other associated
|
||||
fields. See
|
||||
link:$$http://tools.ietf.org/html/rfc4173#section-5$$[rfc4173].
|
||||
e.g.:
|
||||
+
|
||||
----
|
||||
root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
|
||||
----
|
||||
+
|
||||
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
|
||||
----
|
||||
|
||||
**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.:
|
||||
+
|
||||
----
|
||||
root=UUID=12424547
|
||||
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
|
||||
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1
|
||||
----
|
||||
+
|
||||
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
|
||||
----
|
||||
|
||||
**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+**)
|
||||
|
||||
**root=**_???_ **netroot=**iscsi **rd.iscsi.firmware=1**::
|
||||
will read the iscsi parameter from the BIOS firmware
|
||||
|
||||
**rd.iscsi.param=**_<param>_::
|
||||
<param> will be passed as "--param <param>" to iscsistart.
|
||||
This parameter can be specified multiple times.
|
||||
e.g.:
|
||||
+
|
||||
----
|
||||
"netroot=iscsi iscsi_firmware rd.iscsi.param=node.session.timeo.replacement_timeout=30"
|
||||
----
|
||||
+
|
||||
will result in
|
||||
+
|
||||
----
|
||||
iscsistart -b --param node.session.timeo.replacement_timeout=30
|
||||
----
|
||||
|
||||
FCoE
|
||||
~~~~
|
||||
**fcoe=**_<edd|interface|MAC>_:_{dcb|nodcb}_::
|
||||
Try to connect to a FCoE SAN through the NIC specified by _<interface>_ or
|
||||
_<MAC>_ or EDD settings. For the second argument, currently only nodcb is
|
||||
supported. This parameter can be specified multiple times. Note: letters in
|
||||
the MAC-address must be lowercase!
|
||||
|
||||
NBD
|
||||
~~~
|
||||
**root=**??? **netroot=**nbd:_<server>_:_<port>_[:_<fstype>_[:_<mountopts>_[:_<nbdopts>_]]]::
|
||||
mount nbd share from <server>
|
||||
|
||||
**root=dhcp** with **dhcp** **root-path=**nbd:_<server>_:_<port>_[:_<fstype>_[:_<mountopts>_[:_<nbdopts>_]]]::
|
||||
root=dhcp alone directs initrd to look at the DHCP root-path where NBD
|
||||
options can be specified. This syntax is only usable in cases where you are
|
||||
directly mounting the volume as the rootfs.
|
||||
|
||||
DASD
|
||||
~~~~
|
||||
**rd.dasd_mod.dasd=**....::
|
||||
same syntax as the kernel module parameter (s390 only)
|
||||
|
||||
**rd.dasd=**_<dasd_adaptor device bus ID>_[,readonly=_X_][,use_diag=_X_][,erplog=_X_]::
|
||||
activate DASD device with the given adaptor device bus ID and setting the
|
||||
sysfs attributes to the specified values. This parameter can be specified
|
||||
multiple times.
|
||||
|
||||
ZFCP
|
||||
~~~~
|
||||
**rd.zfcp=**_<zfcp adaptor device bus ID>_,_<WWPN>_,_<FCPLUN>_::
|
||||
rd.zfcp can be specified multiple times on the kernel command line. e.g.:
|
||||
+
|
||||
----
|
||||
rd.zfcp=0.0.4000,0x5005076300C213e9,0x5022000000000000
|
||||
----
|
||||
|
||||
**rd.zfcp.conf=0**::
|
||||
ignore zfcp.conf included in the initramfs
|
||||
|
||||
ZNET
|
||||
~~~~
|
||||
**rd.znet=**_<nettype>_,_<subchannels>_,_<options>_::
|
||||
rd.znet can be specified multiple times on the kernel command line. e.g.:
|
||||
+
|
||||
----
|
||||
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
|
||||
----
|
||||
|
||||
Plymouth Boot Splash
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
**plymouth.enable=0**::
|
||||
disable the plymouth bootsplash completly.
|
||||
|
||||
**rd.plymouth=0**::
|
||||
disable the plymouth bootsplash only for the initramfs.
|
||||
|
||||
Kernel keys
|
||||
~~~~~~~~~~~
|
||||
**masterkey=**_<kernel master key path name>_::
|
||||
Set the path name of the kernel master key. e.g.:
|
||||
+
|
||||
----
|
||||
masterkey=/etc/keys/kmk-trusted.blob
|
||||
----
|
||||
|
||||
**masterkeytype=**_<kernel master key type>_::
|
||||
Set the type of the kernel master key. e.g.:
|
||||
+
|
||||
----
|
||||
masterkeytype=trusted
|
||||
----
|
||||
|
||||
**evmkey=**_<EVM key path name>_::
|
||||
Set the path name of the EVM key. e.g.:
|
||||
+
|
||||
----
|
||||
evmkey=/etc/keys/evm-trusted.blob
|
||||
----
|
||||
|
||||
**ecryptfskey=**_<eCryptfs key path name>_::
|
||||
Set the path name of the eCryptfs key. e.g.:
|
||||
+
|
||||
----
|
||||
ecryptfskey=/etc/keys/ecryptfs-trusted.blob
|
||||
----
|
||||
|
||||
Deprecated, renamed Options
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Here is a list of options, which were used in dracut prior to version 008, and their new replacement.
|
||||
|
||||
rdbreak:: rd.break
|
||||
|
||||
rd_CCW:: rd.ccw
|
||||
|
||||
rd_DASD_MOD:: rd.dasd_mod.dasd
|
||||
|
||||
rd_DASD:: rd.dasd
|
||||
|
||||
rdinitdebug rdnetdebug:: rd.debug
|
||||
|
||||
rd_NO_DM:: rd.dm=0
|
||||
|
||||
rd_DM_UUID:: rd.dm.uuid
|
||||
|
||||
rdblacklist:: rd.driver.blacklist
|
||||
|
||||
rdinsmodpost:: rd.driver.post
|
||||
|
||||
rdloaddriver:: rd.driver.pre
|
||||
|
||||
rd_NO_FSTAB:: rd.fstab=0
|
||||
|
||||
rdinfo:: rd.info
|
||||
|
||||
check:: rd.live.check
|
||||
|
||||
rdlivedebug:: rd.live.debug
|
||||
|
||||
live_dir:: rd.live.dir
|
||||
|
||||
liveimg:: rd.live.image
|
||||
|
||||
overlay:: rd.live.overlay
|
||||
|
||||
readonly_overlay:: rd.live.overlay.readonly
|
||||
|
||||
reset_overlay:: rd.live.overlay.reset
|
||||
|
||||
live_ram:: rd.live.ram
|
||||
|
||||
rd_NO_CRYPTTAB:: rd.luks.crypttab=0
|
||||
|
||||
rd_LUKS_KEYDEV_UUID:: rd.luks.keydev.uuid
|
||||
|
||||
rd_LUKS_KEYPATH:: rd.luks.keypath
|
||||
|
||||
rd_NO_LUKS:: rd.luks=0
|
||||
|
||||
rd_LUKS_UUID:: rd.luks.uuid
|
||||
|
||||
rd_NO_LVMCONF:: rd.lvm.conf
|
||||
|
||||
rd_LVM_LV:: rd.lvm.lv
|
||||
|
||||
rd_NO_LVM:: rd.lvm=0
|
||||
|
||||
rd_LVM_SNAPSHOT:: rd.lvm.snapshot
|
||||
|
||||
rd_LVM_SNAPSIZE:: rd.lvm.snapsize
|
||||
|
||||
rd_LVM_VG:: rd.lvm.vg
|
||||
|
||||
rd_NO_MDADMCONF:: rd.md.conf=0
|
||||
|
||||
rd_NO_MDIMSM:: rd.md.imsm=0
|
||||
|
||||
rd_NO_MD:: rd.md=0
|
||||
|
||||
rd_MD_UUID:: rd.md.uuid
|
||||
|
||||
rd_NFS_DOMAIN:: rd.nfs.domain
|
||||
|
||||
iscsi_initiator:: rd.iscsi.initiator
|
||||
|
||||
iscsi_target_name:: rd.iscsi.target.name
|
||||
|
||||
iscsi_target_ip:: rd.iscsi.target.ip
|
||||
|
||||
iscsi_target_port:: rd.iscsi.target.port
|
||||
|
||||
iscsi_target_group:: rd.iscsi.target.group
|
||||
|
||||
iscsi_username:: rd.iscsi.username
|
||||
|
||||
iscsi_password:: rd.iscsi.password
|
||||
|
||||
iscsi_in_username:: rd.iscsi.in.username
|
||||
|
||||
iscsi_in_password:: rd.iscsi.in.password
|
||||
|
||||
iscsi_firmware:: rd.iscsi.firmware=0
|
||||
|
||||
rd_NO_PLYMOUTH:: rd.plymouth=0
|
||||
|
||||
rd_retry:: rd.retry
|
||||
|
||||
rdshell:: rd.shell
|
||||
|
||||
rd_NO_SPLASH:: rd.splash
|
||||
|
||||
rdudevdebug:: rd.udev.debug
|
||||
|
||||
rdudevinfo:: rd.udev.info
|
||||
|
||||
rd_NO_ZFCPCONF:: rd.zfcp.conf=0
|
||||
|
||||
rd_ZFCP:: rd.zfcp
|
||||
|
||||
rd_ZNET:: rd.znet
|
||||
|
||||
KEYMAP:: vconsole.keymap
|
||||
|
||||
KEYTABLE:: vconsole.keymap
|
||||
|
||||
SYSFONT:: vconsole.font
|
||||
|
||||
CONTRANS:: vconsole.font.map
|
||||
|
||||
UNIMAP:: vconsole.font.unimap
|
||||
|
||||
UNICODE:: vconsole.unicode
|
||||
|
||||
EXT_KEYMAP:: vconsole.keymap.ext
|
||||
|
||||
Configuration in the Initramfs
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
_/etc/conf.d/_::
|
||||
Any files found in _/etc/conf.d/_ will be sourced in the initramfs to
|
||||
set initial values. Command line options will override these values
|
||||
set in the configuration files.
|
||||
|
||||
_/etc/cmdline_::
|
||||
Can contain additional command line options.
|
||||
|
||||
_/etc/cmdline.d/*.conf_::
|
||||
Can contain additional command line options.
|
||||
|
||||
AUTHOR
|
||||
------
|
||||
*Harald Hoyer*::
|
||||
Project Leader and Developer
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
*dracut*(8) *dracut.conf*(5)
|
17
dracut.conf
17
dracut.conf
@@ -1,3 +1,7 @@
|
||||
# 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
|
||||
|
||||
# Sample dracut config file
|
||||
|
||||
logfile=/var/log/dracut.log
|
||||
@@ -29,3 +33,16 @@ mdadmconf="yes"
|
||||
|
||||
# install local /etc/lvm/lvm.conf
|
||||
lvmconf="yes"
|
||||
|
||||
# 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
|
||||
# xfs_repair e2fsck jfs_fsck reiserfsck btrfsck". The installation is
|
||||
# opportunistic, so non-existing tools are just ignored.
|
||||
#fscks=""
|
||||
|
||||
# inhibit installation of any fsck tools
|
||||
#nofscks="yes"
|
||||
|
||||
# set the directory for temporary files
|
||||
# default: /var/tmp
|
||||
#tmpdir=/tmp
|
||||
|
138
dracut.conf.5.asc
Normal file
138
dracut.conf.5.asc
Normal file
@@ -0,0 +1,138 @@
|
||||
DRACUT.CONF(5)
|
||||
==============
|
||||
:doctype: manpage
|
||||
:man source: dracut
|
||||
:man manual: dracut
|
||||
|
||||
NAME
|
||||
----
|
||||
dracut.conf - configuration file(s) for dracut
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
_/etc/dracut.conf_ _/etc/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
|
||||
_/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.
|
||||
|
||||
*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_.
|
||||
|
||||
*omit_dracutmodules+=*" __<dracut modules>__ "::
|
||||
Omit a space-separated list of dracut modules.
|
||||
|
||||
*add_dracutmodules+=*" __<dracut modules>__ "::
|
||||
Add a space-separated list of dracut modules.
|
||||
|
||||
*drivers+=*" __<kernel modules>__ "::
|
||||
Specify a space-separated list of kernel modules to exclusively include in
|
||||
the initramfs. The kernel modules have to be specified without the ".ko"
|
||||
suffix.
|
||||
|
||||
*add_drivers+=*" __<kernel modules>__ "::
|
||||
Specify a space-separated list of kernel modules to add to the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix.
|
||||
|
||||
*omit_drivers+=*" __<kernel modules>__ "::
|
||||
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.
|
||||
|
||||
*drivers_dir=*"__<kernel modules directory>__"::
|
||||
Specify the directory, where to look for kernel modules
|
||||
|
||||
*fw_dir+=*" :__<dir>__[:__<dir>__ ...] "::
|
||||
Specify additional directories, where to look for firmwares, separated by :
|
||||
|
||||
*install_items+=*" __<file>__[ __<file>__ ...] "::
|
||||
Specify additional files to include in the initramfs, separated by spaces.
|
||||
|
||||
*do_strip=*"__{yes|no}__"::
|
||||
Strip binaries in the initramfs (default=yes)
|
||||
|
||||
*hostonly=*"__{yes|no}__"::
|
||||
Host-Only mode: Install only what is needed for booting the local host instead of a generic host.
|
||||
|
||||
*tmpdir=*"__<temporary directory>__"::
|
||||
Specify temporary directory to use.
|
||||
|
||||
[WARNING]
|
||||
====
|
||||
If chrooted to another root other than the real root device, use --fstab and provide a valid _/etc/fstab_.
|
||||
====
|
||||
|
||||
*use_fstab=*"__{yes|no}__"::
|
||||
Use _/etc/fstab_ instead of _/proc/self/mountinfo_.
|
||||
|
||||
*add_fstab+=*" __<filename>__ "::
|
||||
Add entries of __<filename>__ to the initramfs /etc/fstab.
|
||||
|
||||
*mdadmconf=*"__{yes|no}__"::
|
||||
Include local _/etc/mdadm.conf_ (default=yes)
|
||||
|
||||
*lvmconf=*"__{yes|no}__"::
|
||||
Include local _/etc/lvm/lvm.conf_ (default=yes)
|
||||
|
||||
*fscks=*" __<fsck tools>__ "::
|
||||
Add a space-separated list of fsck tools. If nothing is specified, the
|
||||
default is: "umount mount /sbin/fsck* xfs_db xfs_check xfs_repair e2fsck
|
||||
jfs_fsck reiserfsck btrfsck". The installation is opportunistic
|
||||
(non-existing tools are ignored).
|
||||
|
||||
*nofscks=*"__{yes|no}__"::
|
||||
If specified, inhibit installation of any fsck tools.
|
||||
|
||||
*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)
|
||||
|
||||
*stdloglvl*="__\{0-6\}__"::
|
||||
Set logging to standard error level.
|
||||
|
||||
*sysloglvl*="__\{0-6\}__"::
|
||||
Set logging to syslog level.
|
||||
|
||||
*fileloglvl=*"__\{0-6\}__"::
|
||||
Set logging to file level.
|
||||
|
||||
*logfile=*"__<file>__"::
|
||||
Path to log file.
|
||||
|
||||
*show_modules=*"__{yes|no}__"::
|
||||
Print included module's name 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/_::
|
||||
Any _/etc/dracut/conf.d/*.conf_ file can overwrite the values in
|
||||
_/etc/dracut.conf_. The configuration files are read in alphanumerical
|
||||
order.
|
||||
|
||||
AUTHOR
|
||||
------
|
||||
Harald Hoyer
|
||||
|
||||
See Also
|
||||
--------
|
||||
*dracut*(8) *dracut.cmdline*(7)
|
||||
|
@@ -1,241 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- This document was created with Syntext Serna Free. --><!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
|
||||
<refentry id="dracutconf5">
|
||||
<refentryinfo>
|
||||
<title>dracut.conf</title>
|
||||
<productname>dracut</productname>
|
||||
<authorgroup>
|
||||
<author>
|
||||
<contrib>Developer</contrib>
|
||||
<firstname>Harald</firstname>
|
||||
<surname>Hoyer</surname>
|
||||
<email>harald@redhat.com</email>
|
||||
</author>
|
||||
</authorgroup>
|
||||
</refentryinfo>
|
||||
<refmeta>
|
||||
<refentrytitle>dracut.conf</refentrytitle>
|
||||
<manvolnum>5</manvolnum>
|
||||
</refmeta>
|
||||
<refnamediv>
|
||||
<refname>dracut.conf</refname>
|
||||
<refpurpose>configuration file(s) for dracut</refpurpose>
|
||||
</refnamediv>
|
||||
<refsynopsisdiv>
|
||||
<cmdsynopsis>
|
||||
<command>/etc/dracut.conf</command>
|
||||
<arg choice="plain">
|
||||
<replaceable>/etc/dracut.conf.d/*.conf</replaceable>
|
||||
</arg>
|
||||
<sbr/>
|
||||
</cmdsynopsis>
|
||||
</refsynopsisdiv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
<para><filename>dracut.conf</filename>
|
||||
is loaded during the initialisation phase of dracut.
|
||||
Command line parameter will overwrite any values set here.
|
||||
<emphasis><filename>dracut.conf.d/*.conf</filename> files are read in alphanumerical order and will</emphasis>
|
||||
overwrite parameters set in <filename>/etc/dracut.conf</filename>. Each line specifies an attribute and a value. A '#' indicates the beginning of a comment; following characters, up to the end of the line are not interpreted.</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>dracutmodules+=" <replaceable><dracut modules></replaceable> "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Specify a space-separated list of dracut modules to
|
||||
call when building the initramfs. Modules are located
|
||||
in <filename>/usr/share/dracut/modules.d</filename>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>omit_dracutmodules+=" <replaceable><dracut modules></replaceable> "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Omit a space-separated list of dracut modules.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>add_dracutmodules+=" <replaceable><dracut modules></replaceable> "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Add a space-separated list of dracut modules.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>drivers+=" <replaceable><kernel modules></replaceable> "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Specify a space-separated list of kernel modules to
|
||||
exclusively include in the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>add_drivers+=" <replaceable><kernel modules></replaceable> "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Specify a space-separated list of kernel
|
||||
modules to add to the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>filesystems+=" <replaceable><filesystem names></replaceable> "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Specify a space-separated list of kernel filesystem
|
||||
modules to exclusively include in the generic
|
||||
initramfs.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>drivers_dir="<replaceable><kernel modules directory></replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Specify the directory, where to look for kernel modules</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>fw_dir+=" :<replaceable><dir></replaceable>[:<replaceable><dir></replaceable> ...] "</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Specify additional directories, where to look for firmwares, separated by <constant>:</constant></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>do_strip="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Strip binaries in the initramfs (default=yes)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>hostonly="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Host-Only mode: Install only what is needed for booting
|
||||
the local host instead of a generic host.
|
||||
<warning><para>If chrooted to another root other than the real root device, use <option>--fstab</option> and provide a valid <filename>/etc/fstab</filename>.</para>
|
||||
</warning>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>use_fstab="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Use <filename>/etc/fstab</filename> instead of <filename>/proc/self/mountinfo</filename>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>mdadmconf="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Include local <filename>/etc/mdadm.conf</filename> (default=yes)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>lvmconf="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Include local <filename>/etc/lvm/lvm.conf</filename> (default=yes)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>kernel_only="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Only install kernel drivers and firmware files. (default=no)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>no_kernel="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Do not install kernel drivers and firmware files (default=no)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>stdloglvl="<replaceable>{0-6}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Set logging to standard error level.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>sysloglvl="<replaceable>{0-6}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Set logging to syslog level.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>fileloglvl="<replaceable>{0-6}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Set logging to file level.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>logfile="<replaceable><file></replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Path to log file.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<envar>show_modules="<replaceable>{yes|no}</replaceable>"</envar>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Print included module's name to standard output during build.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>Files</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<filename>/etc/dracut/conf.d/</filename>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Any <filename>/etc/dracut/conf.d/*.conf</filename> file can overwrite the values in <filename>/etc/dracut.conf</filename>.
|
||||
The configuration files are read in alphanumerical order.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1>
|
||||
<title>See Also</title>
|
||||
<para><citerefentry>
|
||||
<refentrytitle>dracut</refentrytitle>
|
||||
<manvolnum>8</manvolnum>
|
||||
</citerefentry>
|
||||
<citerefentry>
|
||||
<refentrytitle>dracut.kernel</refentrytitle>
|
||||
<manvolnum>7</manvolnum>
|
||||
</citerefentry>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
@@ -2,6 +2,9 @@
|
||||
|
||||
# i18n
|
||||
i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP"
|
||||
add_dracutmodules+=" rpmversion "
|
||||
omit_dracutmodules+=" dash "
|
||||
omit_drivers+=" .*/fs/ocfs/.* "
|
||||
stdloglvl=3
|
||||
prefix=/run/initramfs
|
||||
realinitpath="/usr/lib/systemd/systemd"
|
||||
install_items+=" vi /etc/virc ps grep cat rm "
|
||||
prefix="/"
|
||||
|
1274
dracut.kernel.7.xml
1274
dracut.kernel.7.xml
File diff suppressed because it is too large
Load Diff
@@ -27,21 +27,31 @@
|
||||
dracut_args="$@"
|
||||
|
||||
usage() {
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
|
||||
if [[ -f $dracutbasedir/dracut-version.sh ]]; then
|
||||
. $dracutbasedir/dracut-version.sh
|
||||
fi
|
||||
|
||||
# 80x25 linebreak here ^
|
||||
cat << EOF
|
||||
Usage: $0 [OPTION]... <initramfs> <kernel-version>
|
||||
|
||||
Version: $DRACUT_VERSION
|
||||
|
||||
Creates initial ramdisk images for preloading modules
|
||||
|
||||
-f, --force Overwrite existing initramfs file.
|
||||
-m, --modules [LIST] Specify a space-separated list of dracut modules to
|
||||
call when building the initramfs. Modules are located
|
||||
in /usr/share/dracut/modules.d.
|
||||
in /usr/lib/dracut/modules.d.
|
||||
-o, --omit [LIST] Omit a space-separated list of dracut modules.
|
||||
-a, --add [LIST] Add a space-separated list of dracut modules.
|
||||
-d, --drivers [LIST] Specify a space-separated list of kernel modules to
|
||||
exclusively include in the initramfs.
|
||||
--add-drivers [LIST] Specify a space-separated list of kernel
|
||||
--add-drivers [LIST] Specify a space-separated list of kernel
|
||||
modules to add to the initramfs.
|
||||
--omit-drivers [LIST] Specify a space-separated list of kernel
|
||||
modules not to add to the initramfs.
|
||||
--filesystems [LIST] Specify a space-separated list of kernel filesystem
|
||||
modules to exclusively include in the generic
|
||||
initramfs.
|
||||
@@ -59,6 +69,8 @@ Creates initial ramdisk images for preloading modules
|
||||
--nomdadmconf Do not include local /etc/mdadm.conf
|
||||
--lvmconf Include local /etc/lvm/lvm.conf
|
||||
--nolvmconf Do not include local /etc/lvm/lvm.conf
|
||||
--fscks [LIST] Add a space-separated list of fsck helpers.
|
||||
--nofscks Inhibit installation of any fsck helpers.
|
||||
-h, --help This message
|
||||
--debug Output debug information of the build process
|
||||
--profile Output profile information of the build process
|
||||
@@ -76,13 +88,20 @@ Creates initial ramdisk images for preloading modules
|
||||
Default: /etc/dracut.conf
|
||||
--confdir [DIR] Specify configuration directory to use *.conf files
|
||||
from. Default: /etc/dracut.conf.d
|
||||
--tmpdir [DIR] Temporary directory to be used instead of default
|
||||
/var/tmp.
|
||||
-l, --local Local mode. Use modules from the current working
|
||||
directory instead of the system-wide installed in
|
||||
/usr/share/dracut/modules.d.
|
||||
/usr/lib/dracut/modules.d.
|
||||
Useful when running dracut from a git checkout.
|
||||
-H, --hostonly Host-Only mode: Install only what is needed for
|
||||
booting the local host instead of a generic host.
|
||||
--no-hostonly Disables Host-Only mode
|
||||
--fstab Use /etc/fstab to determine the root device.
|
||||
--add-fstab [FILE] Add file to the initramfs fstab
|
||||
--mount "[DEV] [MP] [FSTYPE] [FSOPTS]"
|
||||
Mount device [DEV] on mountpoint [MP] with filesystem
|
||||
[FSTYPE] and options [FSOPTS] in the initramfs
|
||||
-i, --include [SOURCE] [TARGET]
|
||||
Include the files in the SOURCE directory into the
|
||||
Target directory in the final initramfs.
|
||||
@@ -112,6 +131,12 @@ Creates initial ramdisk images for preloading modules
|
||||
-M, --show-modules Print included module's name to standard output during
|
||||
build.
|
||||
--keep Keep the temporary initramfs for debugging purposes
|
||||
--printsize Print out the module install size
|
||||
--sshkey [SSHKEY] Add ssh key to initramfs (use with ssh-client module)
|
||||
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes.
|
||||
For example:
|
||||
# dracut --add-drivers "module1 module2" ...
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -198,18 +223,23 @@ while (($# > 0)); do
|
||||
-a|--add) push_arg add_dracutmodules_l "$@" || shift;;
|
||||
--force-add) push_arg force_add_dracutmodules_l "$@" || shift;;
|
||||
--add-drivers) push_arg add_drivers_l "$@" || shift;;
|
||||
--omit-drivers) push_arg omit_drivers_l "$@" || shift;;
|
||||
-m|--modules) push_arg dracutmodules_l "$@" || shift;;
|
||||
-o|--omit) push_arg omit_dracutmodules_l "$@" || shift;;
|
||||
-d|--drivers) push_arg drivers_l "$@" || shift;;
|
||||
--filesystems) push_arg filesystems_l "$@" || shift;;
|
||||
-I|--install) push_arg install_items "$@" || shift;;
|
||||
-I|--install) push_arg install_items_l "$@" || shift;;
|
||||
--fwdir) push_arg fw_dir_l "$@" || shift;;
|
||||
--libdirs) push_arg libdirs_l "$@" || shift;;
|
||||
--fscks) push_arg fscks_l "$@" || shift;;
|
||||
--add-fstab) push_arg add_fstab_l "$@" || shift;;
|
||||
--mount) push_arg fstab_lines "$@" || shift;;
|
||||
--nofscks) nofscks_l="yes";;
|
||||
-k|--kmoddir) read_arg drivers_dir_l "$@" || shift;;
|
||||
-c|--conf) read_arg conffile "$@" || shift;;
|
||||
--confdir) read_arg confdir "$@" || shift;;
|
||||
--tmpdir) read_arg tmpdir_l "$@" || shift;;
|
||||
-L|--stdlog) read_arg stdloglvl_l "$@" || shift;;
|
||||
-I|--install) read_arg install_items "$@" || shift;;
|
||||
--fwdir) read_arg fw_dir_l "$@" || shift;;
|
||||
--compress) read_arg compress_l "$@" || shift;;
|
||||
--prefix) read_arg prefix_l "$@" || shift;;
|
||||
-f|--force) force=yes;;
|
||||
@@ -224,10 +254,16 @@ while (($# > 0)); do
|
||||
--nolvmconf) lvmconf_l="no";;
|
||||
--debug) debug="yes";;
|
||||
--profile) profile="yes";;
|
||||
--sshkey) read_arg sshkey "$@" || shift;;
|
||||
-v|--verbose) ((verbosity_mod_l++));;
|
||||
-q|--quiet) ((verbosity_mod_l--));;
|
||||
-l|--local) allowlocal="yes" ;;
|
||||
-l|--local)
|
||||
allowlocal="yes"
|
||||
[[ -f "$(readlink -f ${0%/*})/dracut-functions.sh" ]] \
|
||||
&& dracutbasedir="$(readlink -f ${0%/*})"
|
||||
;;
|
||||
-H|--hostonly) hostonly_l="yes" ;;
|
||||
--no-hostonly) hostonly_l="no" ;;
|
||||
--fstab) use_fstab_l="yes" ;;
|
||||
-h|--help) usage; exit 1 ;;
|
||||
-i|--include) push include_src "$2"
|
||||
@@ -245,6 +281,7 @@ while (($# > 0)); do
|
||||
show_modules_l="yes"
|
||||
;;
|
||||
--keep) keep="yes";;
|
||||
--printsize) printsize="yes";;
|
||||
-*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
|
||||
*)
|
||||
if ! [[ ${outfile+x} ]]; then
|
||||
@@ -263,8 +300,17 @@ if ! [[ $kernel ]]; then
|
||||
fi
|
||||
[[ $outfile ]] || outfile="/boot/initramfs-$kernel.img"
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
export PATH
|
||||
for i in /usr/sbin /sbin /usr/bin /bin; do
|
||||
rl=$i
|
||||
if [ -L "$i" ]; then
|
||||
rl=$(readlink -f $i)
|
||||
fi
|
||||
NPATH+=":$rl"
|
||||
done
|
||||
export PATH="${NPATH#:}"
|
||||
unset NPATH
|
||||
unset LD_LIBRARY_PATH
|
||||
unset GREP_OPTIONS
|
||||
|
||||
[[ $debug ]] && {
|
||||
export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
|
||||
@@ -277,10 +323,7 @@ export PATH
|
||||
debug=yes
|
||||
}
|
||||
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
|
||||
|
||||
[[ $allowlocal && -f "$(readlink -f ${0%/*})/dracut-functions" ]] && \
|
||||
dracutbasedir="$(readlink -f ${0%/*})"
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
|
||||
|
||||
# if we were not passed a config file, try the default one
|
||||
if [[ ! -f $conffile ]]; then
|
||||
@@ -316,10 +359,27 @@ if (( ${#force_add_dracutmodules_l[@]} )); then
|
||||
done
|
||||
fi
|
||||
|
||||
if (( ${#fscks_l[@]} )); then
|
||||
while pop fscks_l val; do
|
||||
fscks+=" $val "
|
||||
done
|
||||
fi
|
||||
|
||||
if (( ${#add_drivers_l[@]} )); then
|
||||
while pop add_drivers_l val; do
|
||||
add_drivers+=" $val "
|
||||
if (( ${#add_fstab_l[@]} )); then
|
||||
while pop add_fstab_l val; do
|
||||
add_fstab+=" $val "
|
||||
done
|
||||
fi
|
||||
|
||||
if (( ${#fstab_lines_l[@]} )); then
|
||||
while pop fstab_lines_l val; do
|
||||
push fstab_lines $val
|
||||
done
|
||||
fi
|
||||
|
||||
if (( ${#install_items_l[@]} )); then
|
||||
while pop install_items_l val; do
|
||||
install_items+=" $val "
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -338,13 +398,6 @@ if (( ${#omit_dracutmodules_l[@]} )); then
|
||||
done
|
||||
fi
|
||||
|
||||
if (( ${#drivers_l[@]} )); then
|
||||
drivers=''
|
||||
while pop drivers_l val; do
|
||||
drivers+="$val "
|
||||
done
|
||||
fi
|
||||
|
||||
if (( ${#filesystems_l[@]} )); then
|
||||
filesystems=''
|
||||
while pop filesystems_l val; do
|
||||
@@ -359,6 +412,13 @@ if (( ${#fw_dir_l[@]} )); then
|
||||
done
|
||||
fi
|
||||
|
||||
if (( ${#libdirs_l[@]} )); then
|
||||
libdirs=''
|
||||
while pop libdirs_l val; do
|
||||
libdirs+="$val "
|
||||
done
|
||||
fi
|
||||
|
||||
[[ $stdloglvl_l ]] && stdloglvl=$stdloglvl_l
|
||||
[[ ! $stdloglvl ]] && stdloglvl=4
|
||||
stdloglvl=$((stdloglvl + verbosity_mod_l))
|
||||
@@ -373,11 +433,14 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
|
||||
[[ $use_fstab_l ]] && use_fstab=$use_fstab_l
|
||||
[[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l
|
||||
[[ $lvmconf_l ]] && lvmconf=$lvmconf_l
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
|
||||
[[ $fw_dir ]] || fw_dir="/lib/firmware/updates /lib/firmware"
|
||||
[[ $tmpdir_l ]] && tmpdir="$tmpdir_l"
|
||||
[[ $tmpdir ]] || tmpdir=/var/tmp
|
||||
[[ $do_strip ]] || do_strip=no
|
||||
[[ $compress_l ]] && compress=$compress_l
|
||||
[[ $show_modules_l ]] && show_modules=$show_modules_l
|
||||
[[ $nofscks_l ]] && nofscks="yes"
|
||||
# eliminate IFS hackery when messing with fw_dir
|
||||
fw_dir=${fw_dir//:/ }
|
||||
|
||||
@@ -397,18 +460,60 @@ fi
|
||||
[[ $hostonly = yes ]] && hostonly="-h"
|
||||
[[ $hostonly != "-h" ]] && unset hostonly
|
||||
|
||||
if [[ -f $dracutbasedir/dracut-functions ]]; then
|
||||
. $dracutbasedir/dracut-functions
|
||||
if [[ -f $dracutbasedir/dracut-functions.sh ]]; then
|
||||
. $dracutbasedir/dracut-functions.sh
|
||||
else
|
||||
echo "Cannot find $dracutbasedir/dracut-functions." >&2
|
||||
echo "Cannot find $dracutbasedir/dracut-functions.sh." >&2
|
||||
echo "Are you running from a git checkout?" >&2
|
||||
echo "Try passing -l as an argument to $0" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dracutfunctions=$dracutbasedir/dracut-functions
|
||||
if [[ -f $dracutbasedir/dracut-version.sh ]]; then
|
||||
. $dracutbasedir/dracut-version.sh
|
||||
fi
|
||||
|
||||
# Verify bash version, curret minimum is 3.1
|
||||
if (( ${BASH_VERSINFO[0]} < 3 ||
|
||||
( ${BASH_VERSINFO[0]} == 3 && ${BASH_VERSINFO[1]} < 1 ) )); then
|
||||
dfatal 'You need at least Bash 3.1 to use dracut, sorry.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dracutfunctions=$dracutbasedir/dracut-functions.sh
|
||||
export dracutfunctions
|
||||
|
||||
if (( ${#drivers_l[@]} )); then
|
||||
drivers=''
|
||||
while pop drivers_l val; do
|
||||
drivers+="$val "
|
||||
done
|
||||
fi
|
||||
drivers=${drivers/-/_}
|
||||
|
||||
if (( ${#add_drivers_l[@]} )); then
|
||||
while pop add_drivers_l val; do
|
||||
add_drivers+=" $val "
|
||||
done
|
||||
fi
|
||||
add_drivers=${add_drivers/-/_}
|
||||
|
||||
if (( ${#omit_drivers_l[@]} )); then
|
||||
while pop omit_drivers_l val; do
|
||||
omit_drivers+=" $val "
|
||||
done
|
||||
fi
|
||||
omit_drivers=${omit_drivers/-/_}
|
||||
|
||||
omit_drivers_corrected=""
|
||||
for d in $omit_drivers; do
|
||||
strstr " $drivers $add_drivers " " $d " && continue
|
||||
omit_drivers_corrected+="$d|"
|
||||
done
|
||||
omit_drivers="${omit_drivers_corrected%|}"
|
||||
unset omit_drivers_corrected
|
||||
|
||||
|
||||
ddebug "Executing $0 $dracut_args"
|
||||
|
||||
[[ $do_list = yes ]] && {
|
||||
@@ -422,16 +527,23 @@ ddebug "Executing $0 $dracut_args"
|
||||
}
|
||||
|
||||
# Detect lib paths
|
||||
[[ $libdir ]] || for libdir in /lib64 /lib; do
|
||||
[[ -d $libdir ]] && break
|
||||
done || {
|
||||
dfatal 'No lib directory?!!!'
|
||||
exit 1
|
||||
}
|
||||
|
||||
[[ $usrlibdir ]] || for usrlibdir in /usr/lib64 /usr/lib; do
|
||||
[[ -d $usrlibdir ]] && break
|
||||
done || dwarn 'No usr/lib directory!'
|
||||
if ! [[ $libdir ]] || ! [[ $usrlibdir ]] ; then
|
||||
if strstr "$(ldd /bin/sh)" "/lib64/" &>/dev/null \
|
||||
&& [[ -d /lib64 ]]; then
|
||||
libdir=/lib64
|
||||
usrlibdir=/usr/lib64
|
||||
else
|
||||
libdir=/lib
|
||||
usrlibdir=/usr/lib
|
||||
fi
|
||||
for i in $libdir $usrlibdir; do
|
||||
if [[ -d $i ]]; then
|
||||
libdirs+=" $i"
|
||||
else
|
||||
dwarn 'No $i directory??!!'
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# This is kinda legacy -- eventually it should go away.
|
||||
case $dracutmodules in
|
||||
@@ -469,8 +581,12 @@ elif [[ -f "$outfile" && ! -w "$outfile" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
readonly TMPDIR=/var/tmp
|
||||
readonly initdir=$(mktemp --tmpdir=/var/tmp/ -d -t initramfs.XXXXXX)
|
||||
readonly TMPDIR="$tmpdir"
|
||||
readonly initdir=$(mktemp --tmpdir="$TMPDIR/" -d -t initramfs.XXXXXX)
|
||||
[ -d "$initdir" ] || {
|
||||
dfatal "mktemp failed."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# clean up after ourselves no matter how we die.
|
||||
trap 'ret=$?;[[ $keep ]] && echo "Not removing $initdir." >&2 || rm -rf "$initdir";exit $ret;' EXIT
|
||||
@@ -480,12 +596,74 @@ trap 'exit 1;' SIGINT
|
||||
# Need to be able to have non-root users read stuff (rpcbind etc)
|
||||
chmod 755 "$initdir"
|
||||
|
||||
for line in "${fstab_lines[@]}"; do
|
||||
set -- $line
|
||||
#dev mp fs fsopts
|
||||
push host_devs "$1"
|
||||
push host_fs_types "$1|$3"
|
||||
done
|
||||
|
||||
for f in $add_fstab; do
|
||||
[ -e $f ] || continue
|
||||
while read dev rest; do
|
||||
push host_devs $dev
|
||||
done < $f
|
||||
done
|
||||
|
||||
if [[ $hostonly ]]; then
|
||||
# in hostonly mode, determine all devices, which have to be accessed
|
||||
# and examine them for filesystem types
|
||||
|
||||
push host_mp \
|
||||
"/" \
|
||||
"/etc" \
|
||||
"/usr" \
|
||||
"/usr/bin" \
|
||||
"/usr/sbin" \
|
||||
"/usr/lib" \
|
||||
"/usr/lib64" \
|
||||
"/boot"
|
||||
|
||||
for mp in "${host_mp[@]}"; do
|
||||
mountpoint "$mp" >/dev/null 2>&1 || continue
|
||||
push host_devs $(readlink -f "/dev/block/$(find_block_device "$mp")")
|
||||
done
|
||||
fi
|
||||
|
||||
_get_fs_type() (
|
||||
[[ $1 ]] || return
|
||||
if [[ -b $1 ]] && get_fs_env $1; then
|
||||
echo "$(readlink -f $1)|$ID_FS_TYPE"
|
||||
return 1
|
||||
fi
|
||||
if [[ -b /dev/block/$1 ]] && get_fs_env /dev/block/$1; then
|
||||
echo "$(readlink -f /dev/block/$1)|$ID_FS_TYPE"
|
||||
return 1
|
||||
fi
|
||||
if fstype=$(find_dev_fstype $1); then
|
||||
echo "$1|$fstype"
|
||||
return 1
|
||||
fi
|
||||
return 1
|
||||
)
|
||||
|
||||
for dev in "${host_devs[@]}"; do
|
||||
unset fs_type
|
||||
for fstype in $(_get_fs_type $dev) \
|
||||
$(check_block_and_slaves _get_fs_type $(get_maj_min $dev)); do
|
||||
if ! strstr " ${host_fs_types[*]} " " $fstype ";then
|
||||
push host_fs_types "$fstype"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
export initdir dracutbasedir dracutmodules drivers \
|
||||
fw_dir drivers_dir debug no_kernel kernel_only \
|
||||
add_drivers mdadmconf lvmconf filesystems \
|
||||
use_fstab libdir usrlibdir \
|
||||
add_drivers omit_drivers mdadmconf lvmconf filesystems \
|
||||
use_fstab fstab_lines libdir usrlibdir fscks nofscks \
|
||||
stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \
|
||||
debug
|
||||
debug host_fs_types host_devs sshkey add_fstab \
|
||||
DRACUT_VERSION
|
||||
|
||||
# Create some directory structure first
|
||||
[[ $prefix ]] && mkdir -m 0755 -p "${initdir}${prefix}"
|
||||
@@ -500,18 +678,18 @@ if [[ $prefix ]]; then
|
||||
fi
|
||||
|
||||
if [[ $kernel_only != yes ]]; then
|
||||
for d in bin etc lib "$libdir" sbin tmp usr var usr/bin usr/sbin; do
|
||||
for d in usr/bin usr/sbin bin etc lib "$libdir" sbin tmp usr var var/log var/run var/lock; do
|
||||
[[ -e "${initdir}${prefix}/$d" ]] && continue
|
||||
if [ -h "/$d" ]; then
|
||||
inst "/$d" "${prefix}/$d"
|
||||
if [ -L "/$d" ]; then
|
||||
inst_symlink "/$d" "${prefix}/$d"
|
||||
else
|
||||
mkdir -m 0755 -p "${initdir}${prefix}/$d"
|
||||
fi
|
||||
done
|
||||
|
||||
for d in proc sys sysroot root run run/lock run/initramfs; do
|
||||
if [ -h "/$d" ]; then
|
||||
inst "/$d"
|
||||
for d in dev proc sys sysroot root run run/lock run/initramfs; do
|
||||
if [ -L "/$d" ]; then
|
||||
inst_symlink "/$d"
|
||||
else
|
||||
mkdir -m 0755 -p "$initdir/$d"
|
||||
fi
|
||||
@@ -530,9 +708,25 @@ else
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ $kernel_only != yes ]]; then
|
||||
mkdir -p "${initdir}/etc/cmdline.d"
|
||||
for _d in $hookdirs; do
|
||||
mkdir -m 0755 -p ${initdir}/lib/dracut/hooks/$_d
|
||||
done
|
||||
if [[ "$UID" = "0" ]]; then
|
||||
cp -a /dev/kmsg /dev/null /dev/console $initdir/dev
|
||||
fi
|
||||
fi
|
||||
|
||||
mkdir -p "$initdir/.kernelmodseen"
|
||||
|
||||
mods_to_load=""
|
||||
# check all our modules to see if they should be sourced.
|
||||
# This builds a list of modules that we will install next.
|
||||
check_module_dir
|
||||
for_each_module_dir check_module
|
||||
for_each_module_dir check_mount
|
||||
|
||||
_isize=0 #initramfs size
|
||||
modules_loaded=" "
|
||||
# source our modules.
|
||||
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||
@@ -541,18 +735,37 @@ for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||
[[ $show_modules = yes ]] && echo "$_d_mod" || \
|
||||
dinfo "*** Including module: $_d_mod ***"
|
||||
if [[ $kernel_only = yes ]]; then
|
||||
module_installkernel $_d_mod
|
||||
module_installkernel $_d_mod || {
|
||||
dfatal "installkernel failed in module $_d_mod"
|
||||
exit 1
|
||||
}
|
||||
else
|
||||
module_install $_d_mod
|
||||
if [[ $no_kernel != yes ]]; then
|
||||
module_installkernel $_d_mod
|
||||
module_installkernel $_d_mod || {
|
||||
dfatal "installkernel failed in module $_d_mod"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
fi
|
||||
mods_to_load=${mods_to_load// $_d_mod /}
|
||||
modules_loaded+="$_d_mod "
|
||||
|
||||
#print the module install size
|
||||
if [ -n "$printsize" ]; then
|
||||
_isize_new=$(du -sk ${initdir}|cut -f1)
|
||||
_isize_delta=$(($_isize_new - $_isize))
|
||||
echo "$_d_mod install size: ${_isize_delta}k"
|
||||
_isize=$_isize_new
|
||||
fi
|
||||
fi
|
||||
done
|
||||
unset moddir
|
||||
|
||||
for i in $modules_loaded; do
|
||||
echo "$i" >> $initdir/lib/dracut/modules.txt
|
||||
done
|
||||
|
||||
dinfo "*** Including modules done ***"
|
||||
|
||||
## final stuff that has to happen
|
||||
@@ -590,18 +803,23 @@ while pop include_src src && pop include_target tgt; do
|
||||
fi
|
||||
done
|
||||
|
||||
while pop install_items items; do
|
||||
for item in $items; do
|
||||
if [[ $kernel_only != yes ]]; then
|
||||
for item in $install_items; do
|
||||
dracut_install "$item"
|
||||
done
|
||||
done
|
||||
unset item
|
||||
unset item
|
||||
|
||||
while pop fstab_lines line; do
|
||||
echo "$line 0 0" >> "${initdir}/etc/fstab"
|
||||
done
|
||||
|
||||
for f in $add_fstab; do
|
||||
cat $f >> "${initdir}/etc/fstab"
|
||||
done
|
||||
|
||||
if [[ $kernel_only != yes ]]; then
|
||||
# make sure that library links are correct and up to date
|
||||
for f in /etc/ld.so.conf /etc/ld.so.conf.d/*; do
|
||||
[[ -e $f ]] && inst_simple "$f"
|
||||
[[ -f $f ]] && inst_simple "$f"
|
||||
done
|
||||
if ! ldconfig -r "$initdir"; then
|
||||
if [[ $UID = 0 ]]; then
|
||||
@@ -612,6 +830,9 @@ if [[ $kernel_only != yes ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -fr "$initdir/.kernelmodseen"
|
||||
|
||||
|
||||
if (($maxloglvl >= 5)); then
|
||||
ddebug "Listing sizes of included files:"
|
||||
du -c "$initdir" | sort -n | ddebug
|
||||
@@ -641,15 +862,18 @@ type hardlink &>/dev/null && {
|
||||
}
|
||||
|
||||
if strstr "$modules_loaded" " fips " && command -v prelink >/dev/null; then
|
||||
for i in $initdir/bin/* \
|
||||
$initdir/bin/* \
|
||||
$initdir/usr/bin/* \
|
||||
$initdir/usr/sbin/*; do
|
||||
[ -x $i ] && prelink -u $i &>/dev/null
|
||||
for dir in "$initdir/bin" \
|
||||
"$initdir/sbin" \
|
||||
"$initdir/usr/bin" \
|
||||
"$initdir/usr/sbin"; do
|
||||
[[ -L "$dir" ]] && continue
|
||||
for i in "$dir"/*; do
|
||||
[[ -x $i ]] && prelink -u $i &>/dev/null
|
||||
done
|
||||
done
|
||||
fi
|
||||
|
||||
if ! ( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet | \
|
||||
if ! ( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet| \
|
||||
$compress > "$outfile"; ); then
|
||||
dfatal "dracut: creation of $outfile failed"
|
||||
exit 1
|
261
dracut.spec
261
dracut.spec
@@ -1,3 +1,5 @@
|
||||
%define dracutlibdir %{_prefix}/lib/dracut
|
||||
|
||||
# Variables must be defined
|
||||
%define with_nbd 1
|
||||
|
||||
@@ -11,7 +13,7 @@ Version: xxx
|
||||
Release: xxx
|
||||
|
||||
Summary: Initramfs generator using udev
|
||||
%if 0%{?fedora}
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
Group: System Environment/Base
|
||||
%endif
|
||||
%if 0%{?suse_version}
|
||||
@@ -24,23 +26,26 @@ URL: https://dracut.wiki.kernel.org/
|
||||
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.bz2
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: dash bash
|
||||
%if 0%{?fedora}
|
||||
BuildRequires: dash bash git
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
%endif
|
||||
%if 0%{?suse_version}
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora}
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
BuildRequires: docbook-style-xsl docbook-dtds libxslt
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version}
|
||||
BuildRequires: docbook-xsl-stylesheets libxslt
|
||||
-BuildRequires: docbook-xsl-stylesheets libxslt
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6
|
||||
BuildRequires: asciidoc
|
||||
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel}
|
||||
# no "provides", because dracut does not offer
|
||||
# all functionality of the obsoleted packages
|
||||
Obsoletes: mkinitrd <= 6.0.93
|
||||
@@ -49,6 +54,10 @@ Obsoletes: nash <= 6.0.93
|
||||
Obsoletes: libbdevid-python <= 6.0.93
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} > 16 || 0%{?rhel} > 6
|
||||
BuildRequires: systemd-units
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version} > 9999
|
||||
Obsoletes: mkinitrd < 2.6.1
|
||||
Provides: mkinitrd = 2.6.1
|
||||
@@ -58,32 +67,28 @@ Obsoletes: dracut-kernel < 005
|
||||
Provides: dracut-kernel = %{version}-%{release}
|
||||
|
||||
Requires: bash
|
||||
Requires: bzip2
|
||||
Requires: coreutils
|
||||
Requires: cpio
|
||||
Requires: dash
|
||||
Requires: filesystem >= 2.1.0
|
||||
Requires: findutils
|
||||
Requires: grep
|
||||
Requires: gzip
|
||||
Requires: kbd
|
||||
Requires: mktemp >= 1.5-5
|
||||
Requires: hardlink
|
||||
Requires: gzip xz
|
||||
Requires: module-init-tools >= 3.7-9
|
||||
Requires: sed
|
||||
Requires: tar
|
||||
Requires: udev
|
||||
|
||||
%if 0%{?fedora}
|
||||
Requires: util-linux >= 2.16
|
||||
Requires: initscripts >= 8.63-1
|
||||
Requires: plymouth >= 0.8.0-0.2009.29.09.19.1
|
||||
Requires: file
|
||||
Requires: udev > 166
|
||||
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||
Requires: util-linux >= 2.21
|
||||
%else
|
||||
Requires: util-linux-ng >= 2.21
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version}
|
||||
Requires: util-linux >= 2.16
|
||||
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||
Conflicts: initscripts < 8.63-1
|
||||
Conflicts: plymouth < 0.8.0-0.2009.29.09.19.1
|
||||
%endif
|
||||
|
||||
|
||||
%description
|
||||
Dracut contains tools to create a bootable initramfs for 2.6 Linux kernels.
|
||||
Unlike existing implementations, dracut does hard-code as little as possible
|
||||
@@ -94,24 +99,6 @@ NFS, iSCSI, NBD, FCoE with the dracut-network package.
|
||||
%package network
|
||||
Summary: Dracut modules to build a dracut initramfs with network support
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: rpcbind
|
||||
%if %{with_nbd}
|
||||
Requires: nbd
|
||||
%endif
|
||||
Requires: iproute
|
||||
Requires: bridge-utils
|
||||
|
||||
%if 0%{?fedora}
|
||||
Requires: iscsi-initiator-utils
|
||||
Requires: nfs-utils
|
||||
Requires: dhclient
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version}
|
||||
Requires: dhcp-client
|
||||
Requires: nfs-client
|
||||
Requires: vlan
|
||||
%endif
|
||||
Obsoletes: dracut-generic < 008
|
||||
Provides: dracut-generic = %{version}-%{release}
|
||||
|
||||
@@ -119,7 +106,7 @@ Provides: dracut-generic = %{version}-%{release}
|
||||
This package requires everything which is needed to build a generic
|
||||
all purpose initramfs with network support with dracut.
|
||||
|
||||
%if 0%{?fedora}
|
||||
%if 0%{?fedora} || 0%{?rhel} >= 6
|
||||
%package fips
|
||||
Summary: Dracut modules to build a dracut initramfs with an integrity check
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
@@ -137,6 +124,15 @@ This package requires everything which is needed to build an
|
||||
all purpose initramfs with dracut, which does an integrity check.
|
||||
%endif
|
||||
|
||||
%package fips-aesni
|
||||
Summary: Dracut modules to build a dracut initramfs with an integrity check with aesni-intel
|
||||
Requires: %{name}-fips = %{version}-%{release}
|
||||
|
||||
%description fips-aesni
|
||||
This package requires everything which is needed to build an
|
||||
all purpose initramfs with dracut, which does an integrity check
|
||||
and adds the aesni-intel kernel module.
|
||||
|
||||
%package caps
|
||||
Summary: Dracut modules to build a dracut initramfs which drops capabilities
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
@@ -156,24 +152,49 @@ This package contains tools to assemble the local initrd and host configuration.
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}
|
||||
|
||||
%if %{defined PATCH1}
|
||||
git init
|
||||
git config user.email "dracut-maint@redhat.com"
|
||||
git config user.name "Fedora dracut team"
|
||||
git add .
|
||||
git commit -a -q -m "%{version} baseline."
|
||||
|
||||
# Apply all the patches.
|
||||
git am -p1 %{patches}
|
||||
%endif
|
||||
|
||||
%build
|
||||
make
|
||||
make all
|
||||
|
||||
%install
|
||||
%if 0%{?fedora}
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%endif
|
||||
make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin \
|
||||
make install DESTDIR=$RPM_BUILD_ROOT \
|
||||
libdir=%{_prefix}/lib \
|
||||
bindir=%{_bindir} \
|
||||
%if %{defined _unitdir}
|
||||
systemdsystemunitdir=%{_unitdir} \
|
||||
%endif
|
||||
sysconfdir=/etc mandir=%{_mandir}
|
||||
|
||||
echo %{name}-%{version}-%{release} > $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/10rpmversion/dracut-version
|
||||
echo "DRACUT_VERSION=%{version}-%{release}" > $RPM_BUILD_ROOT/%{dracutlibdir}/dracut-version.sh
|
||||
|
||||
%if 0%{?fedora} == 0
|
||||
rm -fr $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/01fips
|
||||
%if 0%{?fedora} == 0 && 0%{?rhel} == 0
|
||||
rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/01fips
|
||||
rm -fr $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/02fips-aesni
|
||||
%endif
|
||||
|
||||
# remove gentoo specific modules
|
||||
rm -fr $RPM_BUILD_ROOT/%{_datadir}/dracut/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
|
||||
%endif
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/boot/dracut
|
||||
mkdir -p $RPM_BUILD_ROOT/var/lib/dracut/overlay
|
||||
@@ -181,7 +202,7 @@ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log
|
||||
touch $RPM_BUILD_ROOT%{_localstatedir}/log/dracut.log
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/initramfs
|
||||
|
||||
%if 0%{?fedora}
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/01-dist.conf
|
||||
install -m 0644 dracut.conf.d/fips.conf.example $RPM_BUILD_ROOT/etc/dracut.conf.d/40-fips.conf
|
||||
%endif
|
||||
@@ -191,103 +212,131 @@ install -m 0644 dracut.conf.d/suse.conf.example $RPM_BUILD_ROOT/etc/dracut.con
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} <= 12 && 0%{?rhel} < 6 && 0%{?suse_version} <= 9999
|
||||
rm $RPM_BUILD_ROOT/sbin/mkinitrd
|
||||
rm $RPM_BUILD_ROOT/sbin/lsinitrd
|
||||
rm $RPM_BUILD_ROOT%{_bindir}/mkinitrd
|
||||
rm $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
|
||||
|
||||
# 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
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,0755)
|
||||
%doc README HACKING TODO COPYING AUTHORS NEWS dracut.html dracut.png dracut.svg
|
||||
%{_bindir}/dracut
|
||||
# compat symlink
|
||||
/sbin/dracut
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
|
||||
/sbin/mkinitrd
|
||||
/sbin/lsinitrd
|
||||
%{_bindir}/mkinitrd
|
||||
%{_bindir}/lsinitrd
|
||||
%endif
|
||||
%dir %{_datadir}/dracut
|
||||
%dir %{_datadir}/dracut/modules.d
|
||||
%{_datadir}/dracut/dracut-functions
|
||||
%{_datadir}/dracut/dracut-logger
|
||||
%dir %{dracutlibdir}
|
||||
%dir %{dracutlibdir}/modules.d
|
||||
%{dracutlibdir}/dracut-functions.sh
|
||||
%{dracutlibdir}/dracut-functions
|
||||
%{dracutlibdir}/dracut-version.sh
|
||||
%{dracutlibdir}/dracut-logger.sh
|
||||
%{dracutlibdir}/dracut-initramfs-restore
|
||||
%config(noreplace) /etc/dracut.conf
|
||||
%if 0%{?fedora} || 0%{?suse_version}
|
||||
%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel}
|
||||
%config /etc/dracut.conf.d/01-dist.conf
|
||||
%endif
|
||||
%dir /etc/dracut.conf.d
|
||||
%{_mandir}/man8/dracut.8*
|
||||
%{_mandir}/man7/dracut.kernel.7*
|
||||
%{_mandir}/man7/dracut.cmdline.7*
|
||||
%{_mandir}/man5/dracut.conf.5*
|
||||
%{_datadir}/dracut/modules.d/00bootchart
|
||||
%{_datadir}/dracut/modules.d/00dash
|
||||
%{_datadir}/dracut/modules.d/05busybox
|
||||
%{_datadir}/dracut/modules.d/10i18n
|
||||
%{_datadir}/dracut/modules.d/10rpmversion
|
||||
%{_datadir}/dracut/modules.d/50plymouth
|
||||
%{_datadir}/dracut/modules.d/60xen
|
||||
%{_datadir}/dracut/modules.d/90btrfs
|
||||
%{_datadir}/dracut/modules.d/90crypt
|
||||
%{_datadir}/dracut/modules.d/90dm
|
||||
%{_datadir}/dracut/modules.d/90dmraid
|
||||
%{_datadir}/dracut/modules.d/90dmsquash-live
|
||||
%{_datadir}/dracut/modules.d/90kernel-modules
|
||||
%{_datadir}/dracut/modules.d/90lvm
|
||||
%{_datadir}/dracut/modules.d/90mdraid
|
||||
%{_datadir}/dracut/modules.d/90multipath
|
||||
%{_datadir}/dracut/modules.d/91crypt-gpg
|
||||
%{_datadir}/dracut/modules.d/95debug
|
||||
%{_datadir}/dracut/modules.d/95resume
|
||||
%{_datadir}/dracut/modules.d/95rootfs-block
|
||||
%{_datadir}/dracut/modules.d/95dasd
|
||||
%{_datadir}/dracut/modules.d/95dasd_mod
|
||||
%{_datadir}/dracut/modules.d/95fstab-sys
|
||||
%{_datadir}/dracut/modules.d/95zfcp
|
||||
%{_datadir}/dracut/modules.d/95terminfo
|
||||
%{_datadir}/dracut/modules.d/95udev-rules
|
||||
%{_datadir}/dracut/modules.d/97biosdevname
|
||||
%{_datadir}/dracut/modules.d/97masterkey
|
||||
%{_datadir}/dracut/modules.d/98ecryptfs
|
||||
%{_datadir}/dracut/modules.d/98integrity
|
||||
%{_datadir}/dracut/modules.d/98selinux
|
||||
%{_datadir}/dracut/modules.d/98syslog
|
||||
%{_datadir}/dracut/modules.d/99base
|
||||
%{_datadir}/dracut/modules.d/99fs-lib
|
||||
%{_datadir}/dracut/modules.d/99shutdown
|
||||
%{dracutlibdir}/modules.d/00bootchart
|
||||
%{dracutlibdir}/modules.d/00dash
|
||||
%{dracutlibdir}/modules.d/05busybox
|
||||
%{dracutlibdir}/modules.d/10i18n
|
||||
%{dracutlibdir}/modules.d/30convertfs
|
||||
%{dracutlibdir}/modules.d/45url-lib
|
||||
%{dracutlibdir}/modules.d/50plymouth
|
||||
%{dracutlibdir}/modules.d/80cms
|
||||
%{dracutlibdir}/modules.d/90btrfs
|
||||
%{dracutlibdir}/modules.d/90crypt
|
||||
%{dracutlibdir}/modules.d/90dm
|
||||
%{dracutlibdir}/modules.d/90dmraid
|
||||
%{dracutlibdir}/modules.d/90dmsquash-live
|
||||
%{dracutlibdir}/modules.d/90kernel-modules
|
||||
%{dracutlibdir}/modules.d/90lvm
|
||||
%{dracutlibdir}/modules.d/90mdraid
|
||||
%{dracutlibdir}/modules.d/90multipath
|
||||
%{dracutlibdir}/modules.d/91crypt-gpg
|
||||
%{dracutlibdir}/modules.d/95debug
|
||||
%{dracutlibdir}/modules.d/95resume
|
||||
%{dracutlibdir}/modules.d/95rootfs-block
|
||||
%{dracutlibdir}/modules.d/95dasd
|
||||
%{dracutlibdir}/modules.d/95dasd_mod
|
||||
%{dracutlibdir}/modules.d/95fstab-sys
|
||||
%{dracutlibdir}/modules.d/95zfcp
|
||||
%{dracutlibdir}/modules.d/95terminfo
|
||||
%{dracutlibdir}/modules.d/95udev-rules
|
||||
%{dracutlibdir}/modules.d/95virtfs
|
||||
%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/98syslog
|
||||
%{dracutlibdir}/modules.d/98systemd
|
||||
%{dracutlibdir}/modules.d/98usrmount
|
||||
%{dracutlibdir}/modules.d/99base
|
||||
%{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}/*.service
|
||||
%{_unitdir}/*.target
|
||||
%{_unitdir}/*/*.service
|
||||
%endif
|
||||
|
||||
%files network
|
||||
%defattr(-,root,root,0755)
|
||||
%{_datadir}/dracut/modules.d/40network
|
||||
%{_datadir}/dracut/modules.d/95fcoe
|
||||
%{_datadir}/dracut/modules.d/95iscsi
|
||||
%{_datadir}/dracut/modules.d/90livenet
|
||||
%{_datadir}/dracut/modules.d/95nbd
|
||||
%{_datadir}/dracut/modules.d/95nfs
|
||||
%{_datadir}/dracut/modules.d/45ifcfg
|
||||
%{_datadir}/dracut/modules.d/95znet
|
||||
%{dracutlibdir}/modules.d/40network
|
||||
%{dracutlibdir}/modules.d/95fcoe
|
||||
%{dracutlibdir}/modules.d/95iscsi
|
||||
%{dracutlibdir}/modules.d/90livenet
|
||||
%{dracutlibdir}/modules.d/95nbd
|
||||
%{dracutlibdir}/modules.d/95nfs
|
||||
%{dracutlibdir}/modules.d/95ssh-client
|
||||
%{dracutlibdir}/modules.d/45ifcfg
|
||||
%{dracutlibdir}/modules.d/95znet
|
||||
|
||||
%if 0%{?fedora}
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
%files fips
|
||||
%defattr(-,root,root,0755)
|
||||
%{_datadir}/dracut/modules.d/01fips
|
||||
%{dracutlibdir}/modules.d/01fips
|
||||
%config(noreplace) /etc/dracut.conf.d/40-fips.conf
|
||||
%endif
|
||||
|
||||
%files fips-aesni
|
||||
%defattr(-,root,root,0755)
|
||||
%doc COPYING
|
||||
%{dracutlibdir}/modules.d/02fips-aesni
|
||||
|
||||
%files caps
|
||||
%defattr(-,root,root,0755)
|
||||
%{_datadir}/dracut/modules.d/02caps
|
||||
%{dracutlibdir}/modules.d/02caps
|
||||
|
||||
%files tools
|
||||
%defattr(-,root,root,0755)
|
||||
%{_mandir}/man8/dracut-gencmdline.8*
|
||||
%{_mandir}/man8/dracut-catimages.8*
|
||||
/sbin/dracut-gencmdline
|
||||
/sbin/dracut-catimages
|
||||
%{_bindir}/dracut-catimages
|
||||
%dir /boot/dracut
|
||||
%dir /var/lib/dracut
|
||||
%dir /var/lib/dracut/overlay
|
||||
|
729
dracut.xml
729
dracut.xml
@@ -1,729 +0,0 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- This document was created with Syntext Serna Free. -->
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" []>
|
||||
<book>
|
||||
<title><inlinemediaobject>
|
||||
<imageobject>
|
||||
<imagedata valign="middle" fileref="dracut.png" format="PNG"/>
|
||||
</imageobject>
|
||||
<imageobject>
|
||||
<imagedata valign="middle" fileref="dracut.svg" format="SVG"/>
|
||||
</imageobject>
|
||||
<imageobject>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dracut.svg" encoding="UTF-8" parse="xml"/>
|
||||
</imageobject>
|
||||
</inlinemediaobject>dracut</title>
|
||||
<bookinfo>
|
||||
<author>
|
||||
<firstname>Harald</firstname>
|
||||
<surname>Hoyer</surname>
|
||||
</author>
|
||||
<pubdate>2010</pubdate>
|
||||
<edition>Version 1.0</edition>
|
||||
<copyright>
|
||||
<year>2010</year>
|
||||
<holder>Harald Hoyer</holder>
|
||||
</copyright>
|
||||
<legalnotice>
|
||||
<para>
|
||||
This work is licensed under the Creative Commons Attribution/Share-Alike License. To view a copy of this license, visit <ulink url="http://creativecommons.org/licenses/by-sa/3.0/">http://creativecommons.org/licenses/by-sa/3.0/</ulink> or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
|
||||
</para>
|
||||
</legalnotice>
|
||||
</bookinfo>
|
||||
<toc/>
|
||||
<chapter>
|
||||
<chapterinfo>
|
||||
<legalnotice>
|
||||
<para>
|
||||
This section is a modified version of <ulink url="http://en.wikipedia.org/wiki/Initrd">http://en.wikipedia.org/wiki/Initrd</ulink>, which is licensed under the Creative Commons Attribution/Share-Alike License.
|
||||
</para>
|
||||
</legalnotice>
|
||||
</chapterinfo>
|
||||
<title>Introduction</title>
|
||||
<section>
|
||||
<title>Definition</title>
|
||||
<para>An <emphasis>initial ramdisk</emphasis> is a temporary file system used in the boot process of the Linux kernel. <emphasis>initrd</emphasis> and <emphasis>initramfs</emphasis> refer to slightly different schemes for loading this file system into memory. Both are commonly used to make preparations before the real root file system can be mounted.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Rationale </title>
|
||||
<para>Many Linux distributions ship a single, generic kernel image that is intended to boot as wide a variety of hardware as possible. The device drivers for this generic kernel image are included as loadable modules, as it is not possible to statically compile them all into the one kernel without making it too large to boot from computers with limited memory or from lower-capacity media like floppy disks.
|
||||
</para>
|
||||
<para>This then raises the problem of detecting and loading the modules necessary to mount the root file system at boot time (or, for that matter, deducing where or what the root file system is).
|
||||
</para>
|
||||
<para>To further complicate matters, the root file system may be on a software <acronym>RAID</acronym> volume, <acronym>LVM</acronym>, <acronym>NFS</acronym> (on diskless workstations), or on an encrypted partition. All of these require special preparations to mount.
|
||||
</para>
|
||||
<para>Another complication is kernel support for hibernation, which suspends the computer to disk by dumping an image of the entire system to a swap partition or a regular file, then powering off. On next boot, this image has to be made accessible before it can be loaded back into memory. </para>
|
||||
<para>To avoid having to hardcode handling for so many special cases into the kernel, an initial boot stage with a temporary root file system—now dubbed early user space—is used. This root file system would contain user-space helpers that would do the hardware detection, module loading and device discovery necessary to get the real root file system mounted.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Implementation </title>
|
||||
<para>An image of this initial root file system (along with the kernel image) must be stored somewhere accessible by the Linux bootloader or the boot firmware of the computer. This can be: </para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>The root file system itself </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>A boot image on an optical disc
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>A small ext2/ext3 or <acronym>FAT</acronym>-formatted partition on a local disk (a <emphasis>boot partition</emphasis>)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>A <acronym>TFTP</acronym> server (on systems that can boot from Ethernet) </para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<para>The bootloader will load the kernel and initial root file system image into memory and then start the kernel, passing in the memory address of the image.
|
||||
</para>
|
||||
<para>Depending on which algorithms were compiled statically into it, the kernel can currently unpack initrd/initramfs images compressed with gzip, bzip2 and <acronym>LZMA</acronym>. </para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Mount preparations </title>
|
||||
<para>dracut can generate a customized initrams image which contains only whatever is necessary to boot some particular computer, such as <acronym>ATA</acronym>, <acronym>SCSI</acronym> and filesystem kernel modules (host-only mode).</para>
|
||||
<para>dracut can also generate a more generic initramfs image (default mode). </para>
|
||||
<para>dracut's initramfs starts only with the device name of the root file system (or its <acronym>UUID</acronym>) and must discover everything else at boot time. A complex cascade of tasks must be performed to get the root file system mounted: </para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>Any hardware drivers that the boot process depends on must be loaded. All kernel modules for common storage devices are packed onto the initramfs and then udev pulls in modules matching the computer's detected hardware. </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>On systems which display a boot rd.splash screen, the video hardware must be initialized and a user-space helper started to paint animations onto the display in lockstep with the boot process. </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>If the root file system is on NFS, dracut does then: <itemizedlist>
|
||||
<listitem>
|
||||
<para>Bring up the primary network interface. </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Invoke a DHCP client, with which it can obtain a DHCP lease. </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Extract the name of the NFS share and the address of the NFS server from the lease. </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Mount the <acronym>NFS</acronym> share. </para>
|
||||
</listitem>
|
||||
</itemizedlist></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>If the root file system appears to be on a software <acronym>RAID</acronym> device, there is no way of knowing which devices the <acronym>RAID</acronym> volume spans; the standard <acronym>MD</acronym> utilities must be invoked to scan all available block devices with a raid signature and bring the required ones online. </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>If the root file system appears to be on a logical volume, the <acronym>LVM</acronym> utilities must be invoked to scan for and activate the volume group containing it. </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>If the root file system is on an encrypted block device: <itemizedlist>
|
||||
<listitem>
|
||||
<para>Invoke a helper script to prompt the user to type in a passphrase and/or insert a hardware token (such as a smart card or a <acronym>USB</acronym> security dongle). </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Create a decryption target with the device mapper. </para>
|
||||
</listitem>
|
||||
</itemizedlist></para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<para>dracut uses udev, an event-driven hotplug agent, which invokes helper programs as hardware devices, disk partitions and storage volumes matching certain rules come online. This allows discovery to run in parallel, and to progressively cascade into arbitrary nestings of <acronym>LVM</acronym>, <acronym>RAID</acronym> or encryption to get at the root file system. </para>
|
||||
<para>When the root file system finally becomes visible: <itemizedlist>
|
||||
<listitem>
|
||||
<para>Any maintenance tasks which cannot run on a mounted root file system are done. </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>The root file system is mounted read-only. </para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Any processes which must continue running (such as the rd.splash screen helper and its command <acronym>FIFO</acronym>) are hoisted into the newly-mounted root file system. </para>
|
||||
</listitem>
|
||||
</itemizedlist></para>
|
||||
<para>The final root file system cannot simply be mounted over /, since that would make the scripts and tools on the initial root file system inaccessible for any final cleanup tasks. On an initramfs, the initial root file system cannot be rotated away. Instead, it is simply emptied and the final root file system mounted over the top.
|
||||
</para>
|
||||
</section>
|
||||
</chapter>
|
||||
<chapter>
|
||||
<title>User Manual</title>
|
||||
<section>
|
||||
<title>Creating an initramfs Image</title>
|
||||
<para>To create a initramfs image, the most simple command is:</para>
|
||||
<screen># dracut</screen>
|
||||
<para>This will generate a general purpose initramfs image, with all possible functionality resulting of the combination of the installed dracut modules and system tools. The image is /boot/initramfs-<replaceable><kernel version></replaceable>.img and contains the kernel modules of the currently active kernel with version <replaceable><kernel version></replaceable>.</para>
|
||||
<para>If the initramfs image already exists, dracut will display an error message, and to overwrite the existing image, you have to use the <option>--force</option> option. </para>
|
||||
<screen># dracut --force</screen>
|
||||
<para>If you want to specify another filename for the resulting image you would issue a command like:</para>
|
||||
<screen># dracut foobar.img</screen>
|
||||
<para>To generate an image for a specific kernel version, the command would be:</para>
|
||||
<screen># dracut foobar.img 2.6.40-1.rc5.f20</screen>
|
||||
<para>A shortcut to generate the image at the default location for a specific kernel version is:</para>
|
||||
<screen># dracut '' 2.6.40-1.rc5.f20</screen>
|
||||
<para>If you want to create lighter, smaller initramfs images, you may want to specify the <option>--host-only</option> or <option>-H</option> option. Using this option, the resulting image will contain only those dracut modules, kernel modules and filesystems, which are needed to boot this specific machine. This has the drawback, that you can't put the disk on another controller or machine, and that you can't switch to another root filesystem, without recreating the initramfs image. The usage of the <option>--host-only</option> option is only for experts and you will have to keep the broken pieces. At least keep a copy of a general purpose image (and corresponding kernel) as a fallback to rescue your system.</para>
|
||||
<section>
|
||||
<title>Inspecting the Contents</title>
|
||||
<para>To see the contents of the image created by dracut, you can use the <command>lsinitrd</command> tool.</para>
|
||||
<screen># lsinitrd /boot/initramfs-$(uname -r).img | less</screen>
|
||||
<para>To display the contents of a file in the initramfs also use the <command>lsinitrd</command> tool:</para>
|
||||
<screen># lsinitrd /boot/initramfs-$(uname -r).img /etc/ld.so.conf
|
||||
include ld.so.conf.d/*.conf</screen>
|
||||
</section>
|
||||
<section>
|
||||
<title>Adding dracut Modules</title>
|
||||
<para>Some dracut modules are turned off by default and have to be activated manually. You can do this by adding the dracut modules to the configuration file <filename>/etc/dracut.conf</filename> or <filename>/etc/dracut.conf.d/myconf.conf</filename>. See the man page <xref linkend="dracutconf5"/>. You can also add dracut modules on the command line by using the <option>-a</option> or <option>--add</option> option:</para>
|
||||
<screen># dracut --add bootchart initramfs-bootchart.img</screen>
|
||||
<para>To see a list of available dracut modules, use the <option>--list-modules</option> option:</para>
|
||||
<screen># dracut --list-modules</screen>
|
||||
<para>or, if you have a dracut version earlier than <literal>008</literal>, issue the command:</para>
|
||||
<screen># for mod in /usr/share/dracut/modules.d/*; do echo ${mod##*/??}; done</screen>
|
||||
</section>
|
||||
<section>
|
||||
<title>Omitting dracut Modules</title>
|
||||
<para>Sometimes you don't want a dracut module to be included for reasons of speed, size or functionality. To do this, either specify the <envar>omit_dracutmodules</envar> variable in the <filename>dracut.conf</filename> or <filename>/etc/dracut.conf.d/myconf.conf</filename> configuration file (see man page <xref linkend="dracutconf5"/>), or use the <option>-o</option> or <option>--omit</option> option on the command line:</para>
|
||||
<screen># dracut -o "multipath lvm" no-multipath-lvm.img</screen>
|
||||
</section>
|
||||
<section>
|
||||
<title>Adding Kernel Modules</title>
|
||||
<para>If you need a special kernel module in the initramfs, which is not automatically picked up by dracut, you have the use the <option>--add-drivers</option> option on the command line or the drivers vaiable in the <filename>/etc/dracut.conf</filename> or <filename>/etc/dracut.conf.d/myconf.conf</filename> configuration file (see man page <xref linkend="dracutconf5"/>):</para>
|
||||
<screen># dracut --add-drivers mymod initramfs-with-mymod.img</screen>
|
||||
</section>
|
||||
</section>
|
||||
<section>
|
||||
<title>Boot parameters</title>
|
||||
<para>The generated initramfs.img file normally does not contain any system configuration files (except for some special exceptions), so the configuration has to be done on the kernel command line. With this flexibility, you can easily boot from a changed root partition, without the need to recompile the initramfs image. So, you could completly change your root partition (move it inside a md raid with encryption and LVM on top), as long as you specify the correct filesystem <varname>LABEL</varname> or <varname>UUID</varname> on the kernel command line for your root device, dracut will find it and boot from it.</para>
|
||||
<para>The kernel command line usually can be configured in <filename>/boot/grub/grub.conf</filename>, if grub is your bootloader and it also can be edited in the real boot process in the grub menu.</para>
|
||||
<para>The kernel command line can also be provided by the dhcp server with the root-path option. See <xref linkend="NetworkBoot"/>.</para>
|
||||
<para>For a full reference of all kernel command line parameters, see the <xref linkend="dracutconf5"/> or <xref linkend="dracut8"/> man page.</para>
|
||||
<section>
|
||||
<title>Specifying the root Device</title>
|
||||
<para>This is the only option dracut really needs to boot from your root partition. Because your root partition can live in various environments, there are a lot of formats for the <envar>root=</envar> option. The most basic one is <envar>root=<replaceable><path to device node></replaceable></envar>:</para>
|
||||
<screen>root=/dev/sda2</screen>
|
||||
<para>Because device node names can change, dependent on the drive ordering, you are encouraged to use the filesystem identifier (UUID) or filesystem label (LABEL) to specify your root partition:</para>
|
||||
<screen>root=UUID=19e9dda3-5a38-484d-a9b0-fa6b067d0331</screen>
|
||||
<para>or</para>
|
||||
<screen>root=LABEL=myrootpartitionlabel</screen>
|
||||
<para>To see all <envar>UUID</envar>s or <envar>LABEL</envar>s on your system, do:</para>
|
||||
<screen># ls -l /dev/disk/by-uuid</screen>
|
||||
<para>or</para>
|
||||
<screen># ls -l /dev/disk/by-label</screen>
|
||||
<para>If your root partition is on the network see <xref linkend="NetworkBoot"/>.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Keyboard Settings</title>
|
||||
<para>If you have to input passwords for encrypted disk volumes, you might want to set the keyboard layout and specify a display font.</para>
|
||||
<para>A typical german kernel command would contain:</para>
|
||||
<screen>vconsole.font=latarcyrheb-sun16 vconsole.keymap=de-latin1-nodeadkeys locale.LANG=de_DE.UTF-8</screen>
|
||||
<para>Setting these options can override the setting stored on your system, if you use a modern init system, like systemd.</para>
|
||||
<para>For dracut versions prior to version <literal>008</literal> the line would look like:</para>
|
||||
<screen>LANG=de_DE.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=de-latin1-nodeadkeys</screen>
|
||||
</section>
|
||||
<section>
|
||||
<title>Blacklisting Kernel Modules</title>
|
||||
<para>Sometimes it is required to prevent the automatic kernel module loading of a specific kernel module. To do this, just add <envar>rd.blacklist=<replaceable><kernel module name></replaceable></envar>, with <replaceable><kernel module name></replaceable> not containing the <filename>.ko</filename> suffix, to the kernel command line. For example:</para>
|
||||
<screen>rd.blacklist=mptsas rd.blacklist=nouveau</screen>
|
||||
<para>The option can be specified multiple times on the kernel command line.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Speeding up the Boot Process</title>
|
||||
<para>If you want to speed up the boot process, you can specify as much information for dracut on the kernel command as possible. For example, you can tell dracut, that you root partition is not on a <acronym>LVM</acronym> volume or not on a raid partition, or that it lives inside a specific crypto <acronym>LUKS</acronym> encrypted volume. By default, dracut searches everywhere. A typical dracut kernel command line for a plain primary or logical partition would contain:</para>
|
||||
<screen>rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0</screen>
|
||||
<para>on systems with dracut version prior to <literal>008</literal> the line would look like:</para>
|
||||
<screen>rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM</screen>
|
||||
<para>This turns off every automatic assembly of <acronym>LVM</acronym>, <acronym>MD</acronym> raids, <acronym>DM</acronym> raids and crypto <acronym>LUKS</acronym>.</para>
|
||||
<para>Of course, you could also omit the dracut modules in the initramfs creation process, but then you would lose the posibility to turn it on on demand.</para>
|
||||
</section>
|
||||
<section id="Injecting">
|
||||
<title>Injecting custom Files</title>
|
||||
<para>To add your own files to the initramfs image, you have several possibilities.</para>
|
||||
<para>The <option>--include</option> option let you specify a source path and a target path. For example</para>
|
||||
<screen># dracut --include cmdline-preset /etc/cmdline initramfs-cmdline-pre.img</screen>
|
||||
<para>will create an initramfs image, where the file cmdline-preset will be copied inside the initramfs to <filename>/etc/cmdline</filename>. <option>--include</option> can only be specified once.</para>
|
||||
<screen># mkdir rd.live.overlay
|
||||
# mkdir rd.live.overlay/etc
|
||||
# mkdir rd.live.overlay/etc/conf.d
|
||||
# echo "ip=auto" >> rd.live.overlay/etc/cmdline
|
||||
# echo export TESTVAR=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
|
||||
# echo export TESTVAR=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
|
||||
# tree rd.live.overlay/
|
||||
rd.live.overlay/
|
||||
└── etc
|
||||
├── cmdline
|
||||
└── conf.d
|
||||
└── testvar.conf
|
||||
# dracut --include rd.live.overlay / initramfs-rd.live.overlay.img</screen>
|
||||
<para>This will put the contents of the rd.live.overlay directory into the root of the initramfs image.</para>
|
||||
<para>The <option>--install</option> option let you specify several files, which will get installed in the initramfs image at the same location, as they are present on initramfs creation time.</para>
|
||||
<screen># dracut --install 'strace fsck.ext3 ssh' initramfs-dbg.img</screen>
|
||||
<para>This will create an initramfs with the <command>strace</command>, <command>fsck.ext3</command> and <command>ssh</command> executables, together with the libraries needed to start those. The <option>--install</option> option can be specified multiple times.</para>
|
||||
</section>
|
||||
</section>
|
||||
<section id="NetworkBoot">
|
||||
<title>Network Boot</title>
|
||||
<para>If your root partition is on a network drive, you have to have the network dracut modules installed to create a network aware initramfs image.</para>
|
||||
<para>On a Red Hat Enterprise Linux or Fedora system, this means, you have to install the <filename>dracut-network</filename> rpm package:</para>
|
||||
<screen># yum install dracut-network</screen>
|
||||
<para>The resulting initramfs image can be served by a boot manager residing on your local hard drive or it can be served by a <acronym>PXE</acronym>/<acronym>TFTP</acronym> server.</para>
|
||||
<para>How to setup your <acronym>PXE</acronym>/<acronym>TFTP</acronym> server can be found in the <ulink url="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/">Red Hat Enterprise Linux Storage Administration Guide</ulink>.</para>
|
||||
<para>If you specify <envar>rd.ip=auto</envar> on the kernel command line, then dracut asks a dhcp server about the ip adress for the machine. The dhcp server can also serve an additional root-path, which will set the root device for dracut. With this mechanism, you have static configuration on your client machine and a centralized boot configuration on your <acronym>TFTP</acronym>/<acronym>DHCP</acronym> server. If you can't pass a kernel command line, then you can inject <filename>/etc/cmdline</filename>, with a method described in <xref linkend="Injecting"/>.
|
||||
</para>
|
||||
<section>
|
||||
<title>Reducing the Image Size</title>
|
||||
<para>To reduce the size of the initramfs, you should create it with by ommitting all dracut modules, which you know, you don't need to boot the machine.</para>
|
||||
<para>You can also specify the exact dracut and kernel modules to produce a very tiny initramfs image.</para>
|
||||
<para>For example for a <acronym>NFS</acronym> image, you would do:</para>
|
||||
<screen># dracut -m "nfs network base" initramfs-nfs-only.img</screen>
|
||||
<para>Then you would boot from this image with your target machine and reduce the size once more by creating it on the target machine with the <option>--host-only</option> option:</para>
|
||||
<screen># dracut -m "nfs network base" --host-only initramfs-nfs-host-only.img</screen>
|
||||
<para>This will reduce the size of the initramfs image significantly.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>NFS Root Device</title>
|
||||
<para/>
|
||||
</section>
|
||||
<section>
|
||||
<title>iSCSI Root Device</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>FCoE Root Device</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
<section>
|
||||
<title>Troubleshooting</title>
|
||||
<para>If the boot process does not succeed, you have several options to debug the situation. Some of the basic operations are covered here. For more information you should also visit: <ulink url="http://fedoraproject.org/wiki/How_to_debug_Dracut_problems">http://fedoraproject.org/wiki/How_to_debug_Dracut_problems</ulink></para>
|
||||
<section id="identifying-your-problem-area">
|
||||
<title>Identifying your problem area</title>
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>Remove ''rhgb'' and ''quiet'' from the kernel command line
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Add ''rd.shell'' to the kernel command line. This will present a shell should dracut be unable to locate your root device
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Add ''rd.shell rd.debug'' to the kernel command line so that dracut shell commands are printed as they are executed
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>With dracut >= 002-11, you can inspect the rd.debug output with:
|
||||
</para>
|
||||
<screen># less /run/initramfs/init.log
|
||||
# dmesg | less</screen>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</section>
|
||||
<section id="information-to-include-in-your-report">
|
||||
<title id="information-to-include-in-your-report-title">Information to include in your report</title>
|
||||
<section id="all-bug-reports">
|
||||
<title id="all-bug-reports-title">All bug reports</title>
|
||||
<para>In all cases, the following should be mentioned and attached to your bug report:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>The exact kernel command-line used. Typically from the bootloader configuration file (e.g. <filename>/etc/grub.conf</filename>) or from <filename>/proc/cmdline</filename>.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>A copy of your disk partition information from <filename>/etc/fstab</filename>, which might be obtained booting an old working initramfs or a rescue medium.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>A device listing from device-mapper. This can be obtained by running the command <screen># dmsetup ls --tree</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>A list of block device attributes including vol_id compatible mode. This can be obtained by running the commands: <screen># blkid -p
|
||||
# blkid -p -o udev</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Turn on dracut debugging (see <filename>the 'debugging dracut' section</filename>), and attach all relevant information from the boot log. This can be obtained by running the command <screen># dmesg|grep dracut</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>If you use a dracut configuration file, please include <filename>/etc/dracut.conf</filename>
|
||||
and all files in <filename>/etc/dracut.conf.d/*.conf</filename></para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section id="logical-volume-management-related-problems">
|
||||
<title id="logical-volume-management-related-problems-title">Logical Volume Management related problems</title>
|
||||
<para>As well as the information from <xref linkend="all-bug-reports"/> include the following information:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>Include physical volume information by running the command: <screen># lvm pvdisplay</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Include volume group information by running the command: <screen># lvm vgdisplay</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Include logical volume information by running the command: <screen># lvm lvdisplay</screen></para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section id="software-raid-related-problems">
|
||||
<title id="software-raid-related-problems-title">Software RAID related problems</title>
|
||||
<para>As well as the information from <xref linkend="all-bug-reports"/>, include the following information:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>If using software RAID disk partitions, please include the output of <screen># cat /proc/mdstat</screen></para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
<section id="network-root-device-related-problems">
|
||||
<title id="network-root-device-related-problems-title">Network root device related problems</title>
|
||||
<para>This section details information to include when experiencing problems on a system whose root device is located on a network attached volume (e.g. iSCSI, NFS or NBD). As well as the information from <xref linkend="all-bug-reports"/>, include the following information:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>Please include the output of <screen># /sbin/ifup <replaceable><interfacename></replaceable>
|
||||
# ip addr show</screen></para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</section>
|
||||
</section>
|
||||
<section id="debugging-dracut">
|
||||
<title id="debugging-dracut-title">Debugging dracut</title>
|
||||
<section id="configure-a-serial-console">
|
||||
<title id="configure-a-serial-console-title">Configure a serial console</title>
|
||||
<para>Successfully debugging dracut will require some form of console logging during the system boot. This section documents configuring a serial console connection to record boot messages.
|
||||
</para>
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>First, enable serial console output for both the kernel and the bootloader.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Open the file <filename>/etc/grub.conf</filename> for editing. Below the line ''timeout=5'', add the following:
|
||||
<screen>serial --unit=0 --speed=9600
|
||||
terminal --timeout=5 serial console</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Also in <filename>/etc/grub.conf</filename>, add the following boot arguemnts to the ''kernel'' line:
|
||||
<screen>console=tty0 console=ttyS0,9600</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>When finished, the <filename>/etc/grub.conf</filename> file should look similar to the example below.
|
||||
<screen>default=0
|
||||
timeout=5
|
||||
serial --unit=0 --speed=9600
|
||||
terminal --timeout=5 serial console
|
||||
title Fedora (2.6.29.5-191.fc11.x86_64)
|
||||
root (hd0,0)
|
||||
kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 console=ttyS0,9600
|
||||
initrd /dracut-2.6.29.5-191.fc11.x86_64.img</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>More detailed information on how to configure the kernel for console output can be found at <ulink url="http://www.faqs.org/docs/Linux-HOWTO/Remote-Serial-Console-HOWTO.html#CONFIGURE-KERNEL">http://www.faqs.org/docs/Linux-HOWTO/Remote-Serial-Console-HOWTO.html#CONFIGURE-KERNEL</ulink>.
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
<note>
|
||||
<title>Redirecting non-interactive output</title>
|
||||
<para>You can redirect all non-interactive output to <filename>/dev/kmsg</filename> and the kernel will put it out on the console when it reaches the kernel buffer by doing<screen># exec >/dev/kmsg 2>&1 </dev/console</screen></para>
|
||||
</note>
|
||||
</section>
|
||||
<section id="using-the-dracut-shell">
|
||||
<title id="using-the-dracut-shell-title">Using the dracut shell</title>
|
||||
<para>Dracut offers a shell for interactive debugging in the event dracut fails to locate your root filesystem. To enable the shell:
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>Add the boot parameter ''rd.shell'' to your bootloader configuration file (e.g. <filename>/etc/grub.conf</filename>)</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Remove the boot arguments ''rhgb'' and ''quiet''
|
||||
</para>
|
||||
<para>
|
||||
A sample <filename>/etc/grub.conf</filename> bootloader configuration file is listed below.
|
||||
</para>
|
||||
<para><screen>default=0
|
||||
timeout=5
|
||||
serial --unit=0 --speed=9600
|
||||
terminal --timeout=5 serial console
|
||||
title Fedora (2.6.29.5-191.fc11.x86_64)
|
||||
root (hd0,0)
|
||||
kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 rd.shell
|
||||
initrd /dracut-2.6.29.5-191.fc11.x86_64.img</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>If system boot fails, you will be dropped into a shell as seen in the example below.
|
||||
<screen>No root device found
|
||||
Dropping to debug shell.
|
||||
|
||||
sh: can't access tty; job control turned off
|
||||
|
||||
# </screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Use this shell prompt to gather the information requested above (see <xref linkend="all-bug-reports"/>).
|
||||
</para>
|
||||
</listitem>
|
||||
</orderedlist></para>
|
||||
</section>
|
||||
<section id="accessing-the-root-volume-from-the-dracut-shell">
|
||||
<title id="accessing-the-root-volume-from-the-dracut-shell-title">Accessing the root volume from the dracut shell</title>
|
||||
<para>From the dracut debug shell, you can manually perform the task of locating and preparing your root volume for boot. The required steps will depend on how your root volume is configured. Common scenarios include:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>A block device (e.g. <filename>/dev/sda7</filename>)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>A LVM logical volume (e.g. <filename>/dev/VolGroup00/LogVol00</filename>)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>An encrypted device (e.g. <filename>/dev/mapper/luks-4d5972ea-901c-4584-bd75-1da802417d83</filename>)
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>A network attached device (e.g. netroot=iscsi:@192.168.0.4::3260::iqn.2009-02.org.fedoraproject:for.all)
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<para>The exact method for locating and preparing will vary. However, to continue with a successful boot, the objective is to locate your root volume and create a symlink <filename>/dev/root</filename> which points to the file system. For example, the following example demonstrates accessing and booting a root volume that is an encrypted LVM Logical volume. </para>
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>Inspect your partitions using <command>parted</command><screen># parted /dev/sda -s p
|
||||
Model: ATA HTS541060G9AT00 (scsi)
|
||||
Disk /dev/sda: 60.0GB
|
||||
Sector size (logical/physical): 512B/512B
|
||||
Partition Table: msdos
|
||||
Number Start End Size Type File system Flags
|
||||
1 32.3kB 10.8GB 107MB primary ext4 boot
|
||||
2 10.8GB 55.6GB 44.7GB logical lvm</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>You recall that your root volume was a LVM logical volume. Scan and activate any logical volumes.
|
||||
<screen># lvm vgscan
|
||||
# lvm vgchange -ay</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>You should see any logical volumes now using the command <command>blkid</command>:
|
||||
<screen># blkid
|
||||
/dev/sda1: UUID="3de247f3-5de4-4a44-afc5-1fe179750cf7" TYPE="ext4"
|
||||
/dev/sda2: UUID="Ek4dQw-cOtq-5MJu-OGRF-xz5k-O2l8-wdDj0I" TYPE="LVM2_member"
|
||||
/dev/mapper/linux-root: UUID="def0269e-424b-4752-acf3-1077bf96ad2c" TYPE="crypto_LUKS"
|
||||
/dev/mapper/linux-home: UUID="c69127c1-f153-4ea2-b58e-4cbfa9257c5e" TYPE="ext3"
|
||||
/dev/mapper/linux-swap: UUID="47b4d329-975c-4c08-b218-f9c9bf3635f1" TYPE="swap"
|
||||
</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>From the output above, you recall that your root volume exists on an encrypted block device. Following the guidance disk encryption guidance from the Installation Guide, you unlock your encrypted root volume.
|
||||
<screen># UUID=$(cryptsetup luksUUID /dev/mapper/linux-root)
|
||||
# cryptsetup luksOpen /dev/mapper/linux-root luks-$UUID
|
||||
Enter passphrase for /dev/mapper/linux-root:
|
||||
Key slot 0 unlocked. </screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Next, make a symbolic link to the unlocked root volume
|
||||
<screen># ln -s /dev/mapper/luks-$UUID /dev/root</screen></para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>With the root volume available, you may continue booting the system by exiting the dracut shell
|
||||
<screen># exit</screen></para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
</section>
|
||||
<section id="additional-dracut-boot-parameters">
|
||||
<title id="additional-dracut-boot-parameters-title">Additional dracut boot parameters</title>
|
||||
<para>For more debugging options, see <xref linkend="dracut-kernel-debug"/> in the man page <xref linkend="dracutkernel7"/>.</para>
|
||||
</section>
|
||||
</section>
|
||||
</section>
|
||||
</chapter>
|
||||
<chapter>
|
||||
<title>Developer Manual</title>
|
||||
<section>
|
||||
<title>dracut Components</title>
|
||||
<para>dracut uses a modular system to build and extend the initramfs image. All modules are located in <filename>/usr/share/dracut/modules.d</filename> or in <filename><replaceable><git-src></replaceable>/modules.d</filename>. The most basic dracut module is <filename>99base</filename>. In <filename>99base</filename> the initial shell script <command>init</command> is defined, which gets run by the kernel after initramfs loading. Although you can replace <command>init</command> with your own version of <filename>99base</filename>, this is not encouraged. Instead you should use, if possible, the hooks of dracut. All hooks, and the point of time in which they are executed, are described in <xref linkend="stages"/>.</para>
|
||||
<para>The main script, which creates the initramfs is <command>dracut</command> itsself. It parses all arguments and sets up the directory, in which everything is installed. It then executes all <command>check</command>, <command>install</command>, <command>installkernel</command> scripts found in the modules, which are to be processed. After everything is installed, the install directory is archived and compressed to the final initramfs image. All helper functions used by <command>check</command>, <command>install</command> and <command>installkernel</command> are found in in the file <filename>dracut-functions</filename>. These shell functions are available to all module installer (<command>install</command>, <command>installkernel</command>) scripts, without the need to source <filename>dracut-functions</filename>.</para>
|
||||
<para>A module can check the preconditions for <command>install</command> and <command>installkernel</command> with the <command>check</command> script. Also dependencies can be expressed with <command>check</command>. If a module passed <command>check</command>, <command>install</command> and <command>installkernel</command> will be called to install all of the necessary files for the module. To split between kernel and non-kernel parts of the installation, all kernel module related parts have to be in <command>installkernel</command>. All other files found in a module directory are module specific and mostly are hook scripts and udev rules.</para>
|
||||
</section>
|
||||
<section id="stages">
|
||||
<title>Boot Process Stages</title>
|
||||
<para>The <command>init</command> script in <filename>99base</filename> is the main script, which prepares the root file system for usage, runs udev, mounts the real root device, kills the remaining processes, and switches to the real root device for further booting. dracut modules can insert custom script at various points, to control the boot process. These hooks are plain directories containing shell scripts ending with ".sh", which are sourced by <command>init</command>.
|
||||
Common used functions are in <filename>dracut-lib.sh</filename>, which can be sourced by any script. </para>
|
||||
<section>
|
||||
<title>Basic Setup</title>
|
||||
<para>The first thing <command>init</command> does, is to mount <filename>/proc</filename> and <filename>/sys</filename> and manually create the basic device nodes and symbolic links in <filename>/dev</filename> needed to execute basic commands. Then logging is setup according to kernel command line arguments. <filename>/dev/pts</filename> and <filename>/dev/shm</filename> are mounted and the first hook is sourced.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Hook: cmdline</title>
|
||||
<para>The <literal>
|
||||
<function>cmdline</function>
|
||||
</literal> hook is a place to insert scripts to parse the kernel command line and prepare the later actions, like setting up udev rules and configuration files.</para>
|
||||
<para>In this hook the most important environment variable is defined: <envar>root</envar>. The second one is <envar>rootok</envar>, which indicates, that a module claimed to be able to parse the <envar>root</envar> defined. So for example, <envar>root=</envar><replaceable>iscsi:....</replaceable> will be claimed by the <function>iscsi</function> dracut module, which then sets <envar>rootok</envar>.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Hook: pre-udev</title>
|
||||
<para>This hook is executed right after the <function>cmdline</function> hook and a check if <envar>root</envar> and <envar>rootok</envar> were set. Here modules can take action with the final <envar>root</envar>, and before <command>udev</command> has been run.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Start Udev</title>
|
||||
<para>Now <command>udev</command> is started and the logging for <command>udev</command> is setup.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Hook: pre-trigger</title>
|
||||
<para>In this hook, you can set udev environment variables with <code>udevadm control --property=<envar>KEY</envar>=<replaceable>value</replaceable></code> or control the further execution of <command>udev</command> with <command>udevadm</command>.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Trigger Udev</title>
|
||||
<para><command>udev</command> is triggered by calling <command>udevadm trigger</command>, which sends <constant>add</constant> events for all devices and subsystems.
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Main Loop</title>
|
||||
<para>Now the main loop of <command>99base/init</command> begins. Here we loop until <command>udev</command> has settled and all scripts in <filename>initqueue/finished</filename> returned true. In this loop there are three hooks, where scripts can be inserted by calling <command>/sbin/initqueue</command>.
|
||||
</para>
|
||||
<section>
|
||||
<title>Initqueue</title>
|
||||
<para>This hook gets executed every time a script is inserted here, regardless of the <command>udev</command> state.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Initqueue settled</title>
|
||||
<para>This hooks gets executed every time <command>udev</command> has settled.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Initqueue timeout</title>
|
||||
<para>This hooks gets executed, when the main loop counter becomes half of the rd.retry counter.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Initqueue finished</title>
|
||||
<para>This hook is called after <command>udev</command> has settled and if all scripts herein return <errorcode>0</errorcode> the main loop will be ended.</para>
|
||||
</section>
|
||||
</section>
|
||||
<section>
|
||||
<title>Hook: pre-mount</title>
|
||||
<para>Before the root device is mounted all scripts in the hook pre-mount are executed. In some cases (e.g. <acronym>NFS</acronym>) the real root device is already mounted, though.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Hook: mount</title>
|
||||
<para>This hook is mainly to mount the real root device.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Hook: pre-pivot</title>
|
||||
<para>This hook is the last hook and is called before init finally switches root to the real root device. This is a good place to clean up and kill processes not needed anymore.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Cleanup and switch_root</title>
|
||||
<para>Init kills all <command>udev</command> processes, cleans up the environment, sets up the arguments for the real <command>init</command> process and finally calls <command>switch_root</command>. <command>switch_root</command> removes the whole filesystem hierarchy of the initramfs, chroot()s to the real root device and calls <command>/sbin/init</command> with the specified arguments.</para>
|
||||
<para>To ensure all files in the initramfs hierarchy can be removed, all processes still running from the initramfs should not have any open file descriptors left.</para>
|
||||
</section>
|
||||
</section>
|
||||
<section>
|
||||
<title>Network Infrastructure</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Writing a Module</title>
|
||||
<para>A simple example module is <filename>96insmodpost</filename>, which modprobes a kernel module after udev has settled and the basic device drivers have been loaded.</para>
|
||||
<para>All module installation information is in the file module-setup.sh.</para>
|
||||
<para>First we create a <function>check()</function> function, which just exits with <errorcode>0</errorcode> indicating that this module should be included by default.</para>
|
||||
<para><function>check()</function>:</para>
|
||||
<programlisting>return 0</programlisting>
|
||||
<para>The we create the <function>install()</function> function, which installs a cmdline hook with priority number 20 called <filename>parse-insmodpost.sh</filename>. It also installs the <filename>insmodpost.sh</filename> script in <filename>/sbin</filename>.</para>
|
||||
<para><function>install()</function>:</para>
|
||||
<programlisting>inst_hook cmdline 20 "$moddir/parse-insmodpost.sh"
|
||||
inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh</programlisting>
|
||||
<para>The <filename>pase-instmodpost.sh</filename> parses the kernel command line for a argument <envar>rd.driver.post</envar>, blacklists the module from being autoloaded and installs the hook <filename>insmodpost.sh</filename> in the <filename>initqueue/settled</filename>.</para>
|
||||
<para><filename>parse-insmodpost.sh</filename>:</para>
|
||||
<programlisting>for p in $(getargs rd.driver.post=); do
|
||||
echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
|
||||
_do_insmodpost=1
|
||||
done
|
||||
|
||||
[ -n "$_do_insmodpost" ] && /sbin/initqueue --settled --unique --onetime /sbin/insmodpost.sh
|
||||
unset _do_insmodpost
|
||||
</programlisting>
|
||||
<para><filename>insmodpost.sh</filename>, which is called in the <filename>initqueue/settled</filename> hook will just modprobe the kernel modules specified in all <envar>rd.driver.post</envar> kernel command line parameters. It runs after <command>udev</command> has settled and is only called once (<parameter>--onetime</parameter>).</para>
|
||||
<para><filename>insmodpost.sh</filename>:</para>
|
||||
<programlisting>. /lib/dracut-lib.sh
|
||||
|
||||
for p in $(getargs rd.driver.post=); do
|
||||
modprobe $p
|
||||
done
|
||||
</programlisting>
|
||||
<section>
|
||||
<title>check()</title>
|
||||
<para><filename>
|
||||
<function>check()</function>
|
||||
</filename> is called by dracut to evaluate the inclusion of a dracut module in the initramfs.</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term> $hostonly</term>
|
||||
<listitem>
|
||||
<para>If the $hostonly variable is set, then the module check() function should be in "hostonly" mode, which means, that the check() should only return 0, if the module is really needed to boot this specific host.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
<para><function>check()</function> should return with:</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>0</term>
|
||||
<listitem>
|
||||
<para>Include the dracut module in the initramfs.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>1</term>
|
||||
<listitem>
|
||||
<para>Do not include the dracut module. The requirements are not fullfilled (missing tools, etc.)</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>255</term>
|
||||
<listitem>
|
||||
<para>Only include the dracut module, if another module requires it or if explicitly specified in the config file or on the argument list.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</section>
|
||||
<section>
|
||||
<title>depends()</title>
|
||||
<para>The function <function>depends()</function> should <function>echo</function> all other dracut module names the module depends on.</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>install()</title>
|
||||
<para>dracut_install</para>
|
||||
<para>inst</para>
|
||||
<para>inst_hook</para>
|
||||
<para>inst_rules</para>
|
||||
<para/>
|
||||
</section>
|
||||
<section>
|
||||
<title>installkernel()</title>
|
||||
<para>instmods</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Creation Functions</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Initramfs Functions</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
<section>
|
||||
<title>Network Modules</title>
|
||||
<para>
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
</chapter>
|
||||
<appendix>
|
||||
<title>Man Pages</title>
|
||||
<section id="dracut.man">
|
||||
<title>dracut</title>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dracut.8.xml" encoding="UTF-8" parse="xml"/>
|
||||
</section>
|
||||
<section id="dracut.conf">
|
||||
<title>dracut.conf</title>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dracut.conf.5.xml" encoding="UTF-8" parse="xml"/>
|
||||
</section>
|
||||
<section id="dracut.kernel">
|
||||
<title>dracut.kernel</title>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dracut.kernel.7.xml" encoding="UTF-8" parse="xml"/>
|
||||
</section>
|
||||
</appendix>
|
||||
</book>
|
26
git2spec.pl
26
git2spec.pl
@@ -18,27 +18,21 @@ sub last_tag {
|
||||
|
||||
sub create_patches {
|
||||
my $tag=shift;
|
||||
my $pdir=shift;
|
||||
my $num=0;
|
||||
open( GIT, 'git format-patch --no-renames -N --no-signature '.$tag.' |');
|
||||
open( GIT, 'git format-patch -M -N --no-signature -o "'.$pdir.'" '.$tag.' |');
|
||||
@lines=<GIT>;
|
||||
close GIT; # be done
|
||||
return @lines;
|
||||
};
|
||||
|
||||
sub filter_patch {
|
||||
my $patch=shift;
|
||||
open(P, $patch);
|
||||
@lines=<P>;
|
||||
close(P);
|
||||
grep (/^ 0 files changed/, @lines);
|
||||
}
|
||||
|
||||
use POSIX qw(strftime);
|
||||
my $datestr = strftime "%Y%m%d", gmtime;
|
||||
|
||||
my $tag=shift;
|
||||
my $pdir=shift;
|
||||
$tag=&last_tag if not defined $tag;
|
||||
my @patches=&create_patches($tag);
|
||||
my @patches=&create_patches($tag, $pdir);
|
||||
my $num=$#patches + 2;
|
||||
$tag=~s/[^0-9]+?([0-9]+)/$1/;
|
||||
my $release="$num.git$datestr";
|
||||
@@ -55,22 +49,12 @@ while(<>) {
|
||||
print $_;
|
||||
$num=1;
|
||||
for(@patches) {
|
||||
next if filter_patch $_;
|
||||
s/.*\///g;
|
||||
print "Patch$num: $_";
|
||||
$num++;
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
elsif (/^%setup/) {
|
||||
print $_;
|
||||
$num=1;
|
||||
for(@patches) {
|
||||
next if filter_patch $_;
|
||||
print "%patch$num -p1\n";
|
||||
$num++;
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
else {
|
||||
print $_;
|
||||
}
|
||||
|
@@ -19,21 +19,37 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
[[ $# -le 2 ]] || { echo "Usage: $(basename $0) [<initramfs file> [<filename>]]" ; exit 1 ; }
|
||||
[[ $# -le 2 ]] || { echo "Usage: $(basename $0) [-s] [<initramfs file> [<filename>]]" ; exit 1 ; }
|
||||
|
||||
sorted=0
|
||||
while getopts "s" opt; do
|
||||
case $opt in
|
||||
s) sorted=1;;
|
||||
\?) exit 1;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND-1))
|
||||
|
||||
image="${1:-/boot/initramfs-$(uname -r).img}"
|
||||
[[ -f "$image" ]] || { echo "$image does not exist" ; exit 1 ; }
|
||||
|
||||
CAT=zcat
|
||||
FILE_T=$(file "$image")
|
||||
FILE_T=$(file --dereference "$image")
|
||||
|
||||
if [[ "$FILE_T" =~ ": gzip compressed data" ]]; then
|
||||
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
|
||||
elif [[ "$FILE_T" =~ ": XZ compressed data" ]]; then
|
||||
CAT=xzcat
|
||||
elif [[ "$FILE_T" =~ ": data" ]]; then
|
||||
CAT=lzcat
|
||||
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
|
||||
@@ -45,5 +61,9 @@ echo "$image: $(du -h $image | awk '{print $1}')"
|
||||
echo "========================================================================"
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout 'lib/dracut/dracut-*' 2>/dev/null
|
||||
echo "========================================================================"
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --list
|
||||
if [ "$sorted" -eq 1 ]; then
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --list | sort -n -k5
|
||||
else
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --list
|
||||
fi
|
||||
echo "========================================================================"
|
@@ -8,6 +8,7 @@ usage () {
|
||||
|
||||
$cmd "usage: ${0##*/} [--version] [--help] [-v] [-f] [--preload <module>]"
|
||||
$cmd " [--image-version] [--with=<module>]"
|
||||
$cmd " [--nocompress]"
|
||||
$cmd " <initrd-image> <kernel-version>"
|
||||
$cmd ""
|
||||
$cmd " (ex: ${0##*/} /boot/initramfs-$kver.img $kver)"
|
||||
@@ -49,10 +50,10 @@ while (($# > 0)); do
|
||||
exit 0;;
|
||||
-v|--verbose) dracut_args="${dracut_args} -v";;
|
||||
-f|--force) dracut_args="${dracut_args} -f";;
|
||||
--preload) read_args modname "$@" || shift
|
||||
--preload) read_arg modname "$@" || shift
|
||||
basicmodules="$basicmodules $modname";;
|
||||
--image-version) img_vers=yes;;
|
||||
--rootfs) read_args rootfs "$@" || shift
|
||||
--rootfs) read_arg rootfs "$@" || shift
|
||||
dracut_args="${dracut_args} --filesystems $rootfs";;
|
||||
--nocompress) dracut_args="$dracut_args --no-compress";;
|
||||
--help) usage -n;;
|
||||
|
@@ -3,6 +3,7 @@
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
[[ "$mount_needs" ]] && return 1
|
||||
[ -x /sbin/bootchartd ] || return 1
|
||||
return 255
|
||||
}
|
||||
|
@@ -12,18 +12,19 @@ depends() {
|
||||
|
||||
installkernel() {
|
||||
local _fipsmodules _mod
|
||||
_fipsmodules="aead aes_generici aes-xts aes-x86_64 ansi_cprng cbc ccm chainiv ctr"
|
||||
_fipsmodules="aead aes_generic aes-xts aes-x86_64 ansi_cprng cbc ccm chainiv ctr"
|
||||
_fipsmodules+=" des deflate ecb eseqiv hmac seqiv sha256 sha512"
|
||||
_fipsmodules+=" cryptomgr crypto_null tcrypt dm-mod dm-crypt"
|
||||
|
||||
mkdir -m 0755 -p "${initdir}/etc/modprobe.d"
|
||||
|
||||
for _mod in $_fipsmodules; do
|
||||
if instmods $_mod; then
|
||||
if hostonly='' instmods $_mod; then
|
||||
echo $_mod >> "${initdir}/etc/fipsmodules"
|
||||
echo "blacklist $_mod" >> "${initdir}/etc/modprobe.d/fips.conf"
|
||||
fi
|
||||
done
|
||||
hostonly='' instmods scsi_wait_scan
|
||||
}
|
||||
|
||||
install() {
|
||||
@@ -34,12 +35,11 @@ install() {
|
||||
|
||||
dracut_install sha512hmac rmmod insmod mount uname umount
|
||||
|
||||
for _dir in "$usrlibdir" "$libdir"; do
|
||||
[[ -e $_dir/libsoftokn3.so ]] && \
|
||||
dracut_install $_dir/libsoftokn3.so $_dir/libsoftokn3.chk \
|
||||
$_dir/libfreebl3.so $_dir/libfreebl3.chk && \
|
||||
break
|
||||
done
|
||||
inst_libdir_file libsoftokn3.so
|
||||
inst_libdir_file libsoftokn3.so
|
||||
inst_libdir_file libsoftokn3.chk
|
||||
inst_libdir_file libfreebl3.so
|
||||
inst_libdir_file libfreebl3.chk
|
||||
|
||||
dracut_install $usrlibdir/hmaccalc/sha512hmac.hmac
|
||||
if command -v prelink >/dev/null; then
|
||||
|
30
modules.d/02fips-aesni/module-setup.sh
Executable file
30
modules.d/02fips-aesni/module-setup.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
return 255
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
local _fipsmodules _mod
|
||||
_fipsmodules="aesni-intel"
|
||||
|
||||
mkdir -m 0755 -p "${initdir}/etc/modprobe.d"
|
||||
|
||||
for _mod in $_fipsmodules; do
|
||||
if instmods $_mod; then
|
||||
echo $_mod >> "${initdir}/etc/fipsmodules"
|
||||
echo "blacklist $_mod" >> "${initdir}/etc/modprobe.d/fips.conf"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
install() {
|
||||
return 0
|
||||
}
|
||||
|
@@ -47,6 +47,8 @@ The following variables are used by i18n install script and at initramfs
|
||||
runtime:
|
||||
|
||||
KEYMAP - keyboard translation table loaded by loadkeys
|
||||
KEYTABLE - base name for keyboard translation table; if UNICODE is
|
||||
true, Unicode version will be loaded. Overrides KEYMAP.
|
||||
EXT_KEYMAPS - list of extra keymaps to bo loaded (sep. by space)
|
||||
UNICODE - boolean, indicating UTF-8 mode
|
||||
FONT - console font
|
||||
|
@@ -22,6 +22,7 @@ set_terminal() {
|
||||
stty -F ${dev} iutf8
|
||||
else
|
||||
printf '\033%%@' >&7
|
||||
stty -F ${dev} -iutf8
|
||||
fi
|
||||
}
|
||||
|
@@ -3,6 +3,7 @@
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
[[ "$mount_needs" ]] && return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -83,7 +84,7 @@ install() {
|
||||
install_base() {
|
||||
dracut_install setfont loadkeys kbd_mode stty
|
||||
|
||||
inst ${moddir}/console_init /lib/udev/console_init
|
||||
inst ${moddir}/console_init.sh /lib/udev/console_init
|
||||
inst_rules ${moddir}/10-console.rules
|
||||
inst_hook cmdline 20 "${moddir}/parse-i18n.sh"
|
||||
}
|
||||
@@ -91,16 +92,23 @@ install() {
|
||||
install_all_kbd() {
|
||||
local rel f
|
||||
|
||||
for f in $(eval find ${kbddir}/{${KBDSUBDIRS}} -type f -print)
|
||||
do
|
||||
find $(eval echo ${kbddir}/{${KBDSUBDIRS}}) -type f -print | \
|
||||
while read f; do
|
||||
inst_simple $f
|
||||
done
|
||||
|
||||
# remove unnecessary files
|
||||
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
|
||||
done
|
||||
|
||||
dracut_install gzip bzip2
|
||||
find "${initdir}${kbddir}/" -name '*.bz2' -print -quit \
|
||||
| while read line; do
|
||||
dracut_install bzip2
|
||||
done
|
||||
}
|
||||
|
||||
install_local_i18n() {
|
||||
@@ -110,8 +118,38 @@ install() {
|
||||
[ -f $I18N_CONF ] && . $I18N_CONF
|
||||
[ -f $VCONFIG_CONF ] && . $VCONFIG_CONF
|
||||
|
||||
shopt -q -s nocasematch
|
||||
if [[ ${UNICODE} ]]
|
||||
then
|
||||
if [[ ${UNICODE} = YES || ${UNICODE} = 1 ]]
|
||||
then
|
||||
UNICODE=1
|
||||
elif [[ ${UNICODE} = NO || ${UNICODE} = 0 ]]
|
||||
then
|
||||
UNICODE=0
|
||||
else
|
||||
UNICODE=''
|
||||
fi
|
||||
fi
|
||||
if [[ ! ${UNICODE} && ${LANG} =~ .*\.UTF-?8 ]]
|
||||
then
|
||||
UNICODE=1
|
||||
fi
|
||||
shopt -q -u nocasematch
|
||||
|
||||
# Gentoo user may have KEYMAP set to something like "-u pl2",
|
||||
KEYMAP=${KEYMAP#-* }
|
||||
|
||||
# KEYTABLE is a bit special - it defines base keymap name and UNICODE
|
||||
# determines whether non-UNICODE or UNICODE version is used
|
||||
|
||||
if [[ ${KEYTABLE} ]]; then
|
||||
if [[ ${UNICODE} == 1 ]]; then
|
||||
[[ ${KEYTABLE} =~ .*\.uni.* ]] || KEYTABLE=${KEYTABLE%.map*}.uni
|
||||
fi
|
||||
KEYMAP=${KEYTABLE}
|
||||
fi
|
||||
|
||||
# I'm not sure of the purpose of UNIKEYMAP and GRP_TOGGLE. They were in
|
||||
# original redhat-i18n module. Anyway it won't hurt.
|
||||
EXT_KEYMAPS+=\ ${UNIKEYMAP}\ ${GRP_TOGGLE}
|
||||
@@ -150,23 +188,6 @@ install() {
|
||||
inst_simple ${kbddir}/unimaps/${FONT_UNIMAP}.uni
|
||||
fi
|
||||
|
||||
if [[ ${UNICODE} ]]
|
||||
then
|
||||
if [[ ${UNICODE^^} = YES || ${UNICODE} = 1 ]]
|
||||
then
|
||||
UNICODE=1
|
||||
elif [[ ${UNICODE^^} = NO || ${UNICODE} = 0 ]]
|
||||
then
|
||||
UNICODE=0
|
||||
else
|
||||
UNICODE=''
|
||||
fi
|
||||
fi
|
||||
if [[ ! ${UNICODE} && ${LANG^^} =~ .*\.UTF-?8 ]]
|
||||
then
|
||||
UNICODE=1
|
||||
fi
|
||||
|
||||
mksubdirs ${initdir}${I18N_CONF}
|
||||
mksubdirs ${initdir}${VCONFIG_CONF}
|
||||
print_vars LC_ALL LANG >> ${initdir}${I18N_CONF}
|
||||
|
@@ -1,29 +0,0 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
[ -f /etc/redhat-release ]
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
local _line
|
||||
local _dracut_rpm_version
|
||||
if [ -e "$moddir/dracut-version" ]; then
|
||||
_dracut_rpm_version=$(cat "$moddir/dracut-version")
|
||||
inst "$moddir/dracut-version" /lib/dracut/$_dracut_rpm_version
|
||||
else
|
||||
if rpm -qf $(type -P $0) &>/dev/null; then
|
||||
_dracut_rpm_version=$(rpm -qf --qf '%{name}-%{version}-%{release}\n' $(type -P $0) | { ver="";while read _line;do ver=$_line;done;echo $ver;} )
|
||||
mkdir -m 0755 -p $initdir/lib/dracut
|
||||
echo $_dracut_rpm_version > $initdir/lib/dracut/$_dracut_rpm_version
|
||||
fi
|
||||
fi
|
||||
inst_hook cmdline 01 "$moddir/version.sh"
|
||||
|
||||
}
|
||||
|
184
modules.d/30convertfs/convertfs.sh
Executable file
184
modules.d/30convertfs/convertfs.sh
Executable file
@@ -0,0 +1,184 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
ROOT="$1"
|
||||
|
||||
if [[ ! -d "$ROOT" ]]; then
|
||||
echo "Usage: $0 <rootdir>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "$ROOT" -ef / ]]; then
|
||||
echo "Can't convert the running system."
|
||||
echo "Please boot with 'rd.convertfs' on the kernel command line,"
|
||||
echo "to update with the help of the initramfs,"
|
||||
echo "or run this script from a rescue system."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while [[ "$ROOT" != "${ROOT%/}" ]]; do
|
||||
ROOT=${ROOT%/}
|
||||
done
|
||||
|
||||
if [ ! -L $ROOT/var/run -a -e $ROOT/var/run ]; then
|
||||
echo "Converting /var/run to symlink"
|
||||
mv -f $ROOT/var/run $ROOT/var/run.runmove~
|
||||
ln -sfn ../run $ROOT/var/run
|
||||
fi
|
||||
|
||||
if [ ! -L $ROOT/var/lock -a -e $ROOT/var/lock ]; then
|
||||
echo "Converting /var/lock to symlink"
|
||||
mv -f $ROOT/var/lock $ROOT/var/lock.lockmove~
|
||||
ln -sfn ../run/lock $ROOT/var/lock
|
||||
fi
|
||||
|
||||
needconvert() {
|
||||
for dir in "$ROOT/bin" "$ROOT/sbin" "$ROOT/lib" "$ROOT/lib64"; do
|
||||
if [[ -e "$dir" ]]; then
|
||||
[[ -L "$dir" ]] || return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
if ! [ -e "$ROOT/usr/bin" ]; then
|
||||
echo "$ROOT/usr/bin does not exist!"
|
||||
echo "Make sure, the kernel command line has enough information"
|
||||
echo "to mount /usr (man dracut.cmdline)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
if ! needconvert; then
|
||||
echo "Your system is already converted."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
testfile="$ROOT/.usrmovecheck$$"
|
||||
rm -f "$testfile"
|
||||
> "$testfile"
|
||||
if [[ ! -e "$testfile" ]]; then
|
||||
echo "Cannot write to $ROOT/"
|
||||
exit 1
|
||||
fi
|
||||
rm -f "$testfile"
|
||||
|
||||
testfile="$ROOT/usr/.usrmovecheck$$"
|
||||
rm -f "$testfile"
|
||||
> "$testfile"
|
||||
if [[ ! -e "$testfile" ]]; then
|
||||
echo "Cannot write to $ROOT/usr/"
|
||||
exit 1
|
||||
fi
|
||||
rm -f "$testfile"
|
||||
|
||||
ismounted() {
|
||||
while read a m a; do
|
||||
[[ "$m" = "$1" ]] && return 0
|
||||
done < /proc/mounts
|
||||
return 1
|
||||
}
|
||||
|
||||
# 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"
|
||||
if [[ -d "${dir}.usrmove-old" ]]; then
|
||||
mv "$dir" "${dir}.del~"
|
||||
mv "${dir}.usrmove-old" "$dir"
|
||||
rm -fr "${dir}.del~"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
trap 'ret=$?; [[ $ret -ne 0 ]] && cleanup;exit $ret;' EXIT
|
||||
trap 'exit 1;' SIGINT
|
||||
|
||||
ismounted "$ROOT/usr" || CP_HARDLINK="-l"
|
||||
|
||||
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"
|
||||
[[ -L "$ROOT/$dir" ]] && continue
|
||||
[[ -d "$ROOT/$dir" ]] || continue
|
||||
echo "Make a copy of \`$ROOT/usr/$dir'."
|
||||
[[ -d "$ROOT/usr/$dir" ]] \
|
||||
&& cp -ax -l "$ROOT/usr/$dir" "$ROOT/usr/${dir}.usrmove-new"
|
||||
echo "Merge the copy with \`$ROOT/$dir'."
|
||||
[[ -d "$ROOT/usr/${dir}.usrmove-new" ]] \
|
||||
|| mkdir -p "$ROOT/usr/${dir}.usrmove-new"
|
||||
cp -axT $CP_HARDLINK --backup --suffix=.usrmove~ "$ROOT/$dir" "$ROOT/usr/${dir}.usrmove-new"
|
||||
echo "Clean up duplicates in \`$ROOT/usr/$dir'."
|
||||
# delete all symlinks that have been backed up
|
||||
find "$ROOT/usr/${dir}.usrmove-new" -type l -name '*.usrmove~' -delete || :
|
||||
# replace symlink with backed up binary
|
||||
find "$ROOT/usr/${dir}.usrmove-new" \
|
||||
-name '*.usrmove~' \
|
||||
-type f \
|
||||
-exec bash -c 'p="{}";o=${p%%%%.usrmove~};
|
||||
[[ -L "$o" ]] && mv -f "$p" "$o"' ';' || :
|
||||
done
|
||||
# switch over merged dirs in /usr
|
||||
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"
|
||||
mv "$ROOT/usr/$dir" "$ROOT/usr/${dir}.usrmove-old"
|
||||
mv "$ROOT/usr/${dir}.usrmove-new" "$ROOT/usr/$dir"
|
||||
done
|
||||
|
||||
# replace dirs in / with links to /usr
|
||||
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" || :
|
||||
mv "$ROOT/$dir" "$ROOT/${dir}.usrmove-old"
|
||||
ln -sfn usr/$dir "$ROOT/$dir"
|
||||
done
|
||||
|
||||
echo "Clean up backup files."
|
||||
# everything seems to work; cleanup
|
||||
for dir in bin sbin lib lib64; do
|
||||
# if we get killed in the middle of "rm -rf", ensure not to leave
|
||||
# an incomplete directory, which is moved back by cleanup()
|
||||
[[ -d "$ROOT/usr/${dir}.usrmove-old" ]] \
|
||||
&& mv "$ROOT/usr/${dir}.usrmove-old" "$ROOT/usr/${dir}.usrmove-old~"
|
||||
[[ -d "$ROOT/${dir}.usrmove-old" ]] \
|
||||
&& mv "$ROOT/${dir}.usrmove-old" "$ROOT/${dir}.usrmove-old~"
|
||||
done
|
||||
|
||||
for dir in bin sbin lib lib64; do
|
||||
[[ -d "$ROOT/usr/${dir}.usrmove-old~" ]] \
|
||||
&& rm -rf "$ROOT/usr/${dir}.usrmove-old~" || :
|
||||
[[ -d "$ROOT/${dir}.usrmove-old~" ]] \
|
||||
&& rm -rf "$ROOT/${dir}.usrmove-old~" || :
|
||||
done
|
||||
|
||||
for dir in lib lib64; do
|
||||
[[ -d "$ROOT/$dir" ]] || continue
|
||||
for lib in "$ROOT"/usr/${dir}/lib*.so*.usrmove~; do
|
||||
[[ -f $lib ]] || continue
|
||||
mv $lib ${lib/.so/_so}
|
||||
done
|
||||
done
|
||||
|
||||
set +e
|
||||
|
||||
echo "Run ldconfig."
|
||||
ldconfig -r "$ROOT"
|
||||
|
||||
. $ROOT/etc/selinux/config
|
||||
if [ -n "$(command -v setfiles)" ] && [ "$SELINUX" != "disabled" ] && [ -f /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts ]; then
|
||||
echo "Fixing SELinux labels"
|
||||
setfiles -r $ROOT -p /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts $ROOT/sbin $ROOT/bin $ROOT/lib $ROOT/lib64 $ROOT/usr/lib $ROOT/usr/lib64 $ROOT/etc/ld.so.cache $ROOT/var/cache/ldconfig || :
|
||||
fi
|
||||
|
||||
echo "Done."
|
||||
exit 0
|
11
modules.d/30convertfs/do-convertfs.sh
Executable file
11
modules.d/30convertfs/do-convertfs.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if getargbool 0 rd.convertfs; then
|
||||
if getargbool 0 rd.debug; then
|
||||
bash -x convertfs "$NEWROOT" 2>&1 | vinfo
|
||||
else
|
||||
convertfs "$NEWROOT" 2>&1 | vinfo
|
||||
fi
|
||||
fi
|
20
modules.d/30convertfs/module-setup.sh
Executable file
20
modules.d/30convertfs/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() {
|
||||
[[ $mount_needs ]] && return 1
|
||||
return 255
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
dracut_install bash
|
||||
dracut_install find ldconfig mv rm cp ln
|
||||
inst_hook pre-pivot 99 "$moddir/do-convertfs.sh"
|
||||
inst "$moddir/convertfs.sh" /usr/bin/convertfs
|
||||
}
|
||||
|
@@ -22,15 +22,15 @@ setup_interface() {
|
||||
# disallow MTUs from 576 and below by default, so that broken
|
||||
# MTUs are ignored, but higher stuff is allowed (1492, 1500, etc).
|
||||
if [ -n "$mtu" ] && [ $mtu -gt 576 ] ; then
|
||||
echo "if ! ip link set $netif mtu $mtu ; then"
|
||||
echo "ip link set $netif down"
|
||||
echo "ip link set $netif mtu $mtu"
|
||||
echo "ip link set $netif up"
|
||||
echo wait_for_if_up $netif
|
||||
echo "fi"
|
||||
fi > /tmp/net.$netif.up
|
||||
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
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif >> /tmp/net.$netif.up
|
||||
ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif
|
||||
|
||||
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
|
||||
|
||||
@@ -41,7 +41,9 @@ setup_interface() {
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
|
||||
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
# 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
|
||||
}
|
||||
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
@@ -64,17 +66,32 @@ case $reason in
|
||||
;;
|
||||
BOUND)
|
||||
echo "dhcp: BOND setting $netif"
|
||||
if ! arping -q -D -c 2 -I $netif $new_ip_address ; then
|
||||
warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying"
|
||||
exit 1
|
||||
unset layer2
|
||||
if [ -f /sys/class/net/$netif/device/layer2 ]; then
|
||||
read layer2 < /sys/class/net/$netif/device/layer2
|
||||
fi
|
||||
if [ "$layer2" != "0" ]; then
|
||||
if ! arping -q -D -c 2 -I $netif $new_ip_address ; then
|
||||
warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
unset layer2
|
||||
setup_interface
|
||||
set | while read line; do
|
||||
[ "${line#new_}" = "$line" ] && continue
|
||||
echo "$line"
|
||||
done >/tmp/dhclient.$netif.dhcpopts
|
||||
echo online > /sys/class/net/$netif/uevent
|
||||
initqueue --onetime --name netroot-$netif netroot $netif
|
||||
|
||||
{
|
||||
echo '. /lib/net-lib.sh'
|
||||
echo "setup_net $netif"
|
||||
echo "source_hook initqueue/online $netif"
|
||||
[ -e /tmp/net.$netif.manualup ] || echo "/sbin/netroot $netif"
|
||||
echo "rm -f $hookdir/initqueue/setup_net_$netif.sh"
|
||||
} > $hookdir/initqueue/setup_net_$netif.sh
|
||||
|
||||
>/tmp/net.$netif.up
|
||||
;;
|
||||
*) echo "dhcp: $reason";;
|
||||
esac
|
@@ -5,9 +5,59 @@
|
||||
# We don't need to check for ip= errors here, that is handled by the
|
||||
# cmdline parser script
|
||||
#
|
||||
# without $2 means this is for real netroot case
|
||||
# or it is for manually bring up network ie. for kdump scp vmcore
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
|
||||
# Huh? No $1?
|
||||
[ -z "$1" ] && exit 1
|
||||
|
||||
# $netif reads easier than $1
|
||||
netif=$1
|
||||
|
||||
# enslave this interface to bond?
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
for slave in $bondslaves ; do
|
||||
if [ "$netif" = "$slave" ] ; then
|
||||
netif=$bondname
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# bridge this interface?
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
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
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -e /tmp/vlan.info ]; then
|
||||
. /tmp/vlan.info
|
||||
if [ "$netif" = "$phydevice" ]; then
|
||||
if [ "$netif" = "$bondname" ] && [ -n "$DO_BOND_SETUP" ] ; then
|
||||
: # We need to really setup bond (recursive call)
|
||||
else
|
||||
netif="$vlanname"
|
||||
fi
|
||||
fi
|
||||
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"
|
||||
[ -z "$netroot" ] && [ -z "$manualup" ] && exit 0
|
||||
[ -n "$manualup" ] && >/tmp/net.$netif.manualup
|
||||
|
||||
# Run dhclient
|
||||
do_dhcp() {
|
||||
@@ -31,13 +81,11 @@ load_ipv6() {
|
||||
|
||||
do_ipv6auto() {
|
||||
load_ipv6
|
||||
{
|
||||
echo 0 > /proc/sys/net/ipv6/conf/$netif/forwarding
|
||||
echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_ra
|
||||
echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_redirects
|
||||
echo ip link set $netif up
|
||||
echo wait_for_if_up $netif
|
||||
} > /tmp/net.$netif.up
|
||||
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
|
||||
|
||||
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
|
||||
@@ -47,24 +95,20 @@ do_ipv6auto() {
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
|
||||
|
||||
echo online > /sys/class/net/$netif/uevent
|
||||
initqueue --onetime --name netroot-$netif netroot $netif
|
||||
}
|
||||
|
||||
# Handle static ip configuration
|
||||
do_static() {
|
||||
strstr $ip '*:*:*' && load_ipv6
|
||||
|
||||
{
|
||||
echo ip link set $netif up
|
||||
echo wait_for_if_up $netif
|
||||
# do not flush addr for ipv6
|
||||
strstr $ip '*:*:*' || \
|
||||
echo ip addr flush dev $netif
|
||||
echo ip addr add $ip/$mask dev $netif
|
||||
} > /tmp/net.$netif.up
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
[ -n "$macaddr" ] && ip link set address $macaddr
|
||||
[ -n "$mtu" ] && ip link set mtu $mtu
|
||||
# do not flush addr for ipv6
|
||||
strstr $ip '*:*:*' || \
|
||||
ip addr flush dev $netif
|
||||
ip addr add $ip/$mask brd + dev $netif
|
||||
|
||||
[ -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
|
||||
@@ -75,55 +119,12 @@ do_static() {
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
|
||||
echo online > /sys/class/net/$netif/uevent
|
||||
initqueue --onetime --name netroot-$netif netroot $netif
|
||||
}
|
||||
|
||||
export PS4="ifup.$1.$$ + "
|
||||
exec >>/run/initramfs/loginit.pipe 2>>/run/initramfs/loginit.pipe
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
# Huh? No $1?
|
||||
[ -z "$1" ] && exit 1
|
||||
|
||||
# $netif reads easier than $1
|
||||
netif=$1
|
||||
|
||||
# enslave this interface to bond?
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
for slave in $bondslaves ; do
|
||||
if [ "$netif" = "$slave" ] ; then
|
||||
netif=$bondname
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# bridge this interface?
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
if [ "$netif" = "$ethname" ]; then
|
||||
if [ "$netif" = "$bondname" ] && [ -n "$DO_BOND_SETUP" ] ; then
|
||||
: # We need to really setup bond (recursive call)
|
||||
else
|
||||
netif="$bridgename"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# bail immediately if the interface is already up
|
||||
# or we don't need the network
|
||||
[ -f "/tmp/net.$netif.up" ] && exit 0
|
||||
[ -f "/tmp/root.info" ] || exit 0
|
||||
. /tmp/root.info
|
||||
[ -z "$netroot" ] && exit 0
|
||||
|
||||
# loopback is always handled the same way
|
||||
if [ "$netif" = "lo" ] ; then
|
||||
ip link set lo up
|
||||
ip addr add 127.0.0.1/8 dev lo
|
||||
>/tmp/net.$netif.up
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -157,7 +158,7 @@ if [ -e /tmp/bond.info ]; then
|
||||
|
||||
for slave in $bondslaves ; do
|
||||
ip link set $slave down
|
||||
ifenslave $bondname $slave
|
||||
echo "+$slave" > /sys/class/net/$bondname/bonding/slaves
|
||||
ip link set $slave up
|
||||
wait_for_if_up $slave
|
||||
done
|
||||
@@ -176,18 +177,40 @@ fi
|
||||
|
||||
# XXX need error handling like dhclient-script
|
||||
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
# start bridge if necessary
|
||||
if [ "$netif" = "$bridgename" ] && [ ! -e /tmp/net.$bridgename.up ]; then
|
||||
if [ "$ethname" = "$bondname" ] ; then
|
||||
DO_BOND_SETUP=yes ifup $bondname
|
||||
else
|
||||
ip link set $ethname up
|
||||
if [ "$netif" = "$bridgename" ] && [ ! -e /tmp/net.$bridgename.up ]; then
|
||||
brctl addbr $bridgename
|
||||
brctl setfd $bridgename 0
|
||||
for ethname in $ethnames ; do
|
||||
if [ "$ethname" = "$bondname" ] ; then
|
||||
DO_BOND_SETUP=yes ifup $bondname
|
||||
else
|
||||
ip link set $ethname up
|
||||
fi
|
||||
wait_for_if_up $ethname
|
||||
brctl addif $bridgename $ethname
|
||||
done
|
||||
fi
|
||||
wait_for_if_up $ethname
|
||||
# Create bridge and add eth to bridge
|
||||
brctl addbr $bridgename
|
||||
brctl setfd $bridgename 0
|
||||
brctl addif $bridgename $ethname
|
||||
fi
|
||||
|
||||
get_vid() {
|
||||
case "$1" in
|
||||
vlan*)
|
||||
return ${1#vlan}
|
||||
;;
|
||||
*.*)
|
||||
return ${1##*.}
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
if [ "$netif" = "$vlanname" ] && [ ! -e /tmp/net.$vlanname.up ]; then
|
||||
modprobe 8021q
|
||||
ip link set "$phydevice" up
|
||||
wait_for_if_up "$phydevice"
|
||||
ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname; echo $?)"
|
||||
fi
|
||||
|
||||
# No ip lines default to dhcp
|
||||
@@ -207,12 +230,12 @@ for p in $(getargs ip=); do
|
||||
ip_to_var $p
|
||||
# skip ibft
|
||||
[ "$autoconf" = "ibft" ] && continue
|
||||
|
||||
|
||||
# If this option isn't directed at our interface, skip it
|
||||
[ -n "$dev" ] && [ "$dev" != "$netif" ] && continue
|
||||
|
||||
# Store config for later use
|
||||
for i in ip srv gw mask hostname; do
|
||||
for i in ip srv gw mask hostname macaddr; do
|
||||
eval '[ "$'$i'" ] && echo '$i'="$'$i'"'
|
||||
done > /tmp/net.$netif.override
|
||||
|
||||
@@ -226,7 +249,21 @@ for p in $(getargs ip=); do
|
||||
*)
|
||||
do_static ;;
|
||||
esac
|
||||
|
||||
case $autoconf in
|
||||
dhcp|on|any|dhcp6)
|
||||
;;
|
||||
*)
|
||||
if [ $? -eq 0 ]; then
|
||||
setup_net $netif
|
||||
source_hook initqueue/online $netif
|
||||
if [ -z "$manualup" ]; then
|
||||
/sbin/netroot $netif
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
break
|
||||
done
|
||||
|
||||
exit 0
|
@@ -5,7 +5,7 @@
|
||||
for f in /tmp/dhclient.*.pid; do
|
||||
[ -e $f ] || continue
|
||||
read PID < $f;
|
||||
kill $PID;
|
||||
kill $PID >/dev/null 2>&1
|
||||
done
|
||||
|
||||
sleep 0.1
|
||||
@@ -13,5 +13,5 @@ sleep 0.1
|
||||
for f in /tmp/dhclient.*.pid; do
|
||||
[ -e $f ] || continue
|
||||
read PID < $f;
|
||||
kill -9 $PID;
|
||||
kill -9 $PID >/dev/null 2>&1
|
||||
done
|
||||
|
@@ -24,49 +24,79 @@ depends() {
|
||||
installkernel() {
|
||||
# Include wired net drivers, excluding wireless
|
||||
|
||||
net_module_test() {
|
||||
net_module_filter() {
|
||||
local _net_drivers='eth_type_trans|register_virtio_device'
|
||||
local _unwanted_drivers='/(wireless|isdn|uwb)/'
|
||||
egrep -q $_net_drivers "$1" && \
|
||||
egrep -qv 'iw_handler_get_spy' "$1" && \
|
||||
[[ ! $1 =~ $_unwanted_drivers ]]
|
||||
local _ret
|
||||
# subfunctions inherit following FDs
|
||||
local _merge=8 _side2=9
|
||||
function nmf1() {
|
||||
local _fname _fcont
|
||||
while read _fname; do
|
||||
[[ $_fname =~ $_unwanted_drivers ]] && continue
|
||||
case "$_fname" in
|
||||
*.ko) _fcont="$(< $_fname)" ;;
|
||||
*.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
|
||||
*.ko.xz) _fcont="$(xz -dc $_fname)" ;;
|
||||
esac
|
||||
[[ $_fcont =~ $_net_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"
|
||||
_ret=$?
|
||||
[[ $debug ]] && set -x
|
||||
return $_ret
|
||||
}
|
||||
|
||||
instmods $(filter_kernel_modules_by_path drivers/net net_module_test)
|
||||
{ find_kernel_modules_by_path drivers/net; find_kernel_modules_by_path drivers/s390/net; } \
|
||||
| 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
|
||||
}
|
||||
|
||||
install() {
|
||||
local _arch _i _dir
|
||||
dracut_install ip arping tr dhclient
|
||||
dracut_install -o brctl ifenslave
|
||||
inst "$moddir/ifup" "/sbin/ifup"
|
||||
inst "$moddir/netroot" "/sbin/netroot"
|
||||
inst "$moddir/dhclient-script" "/sbin/dhclient-script"
|
||||
dracut_install -o brctl
|
||||
inst "$moddir/ifup.sh" "/sbin/ifup"
|
||||
inst "$moddir/netroot.sh" "/sbin/netroot"
|
||||
inst "$moddir/dhclient-script.sh" "/sbin/dhclient-script"
|
||||
inst "$moddir/net-lib.sh" "/lib/net-lib.sh"
|
||||
inst_simple "$moddir/dhclient.conf" "/etc/dhclient.conf"
|
||||
inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
|
||||
inst_hook pre-udev 60 "$moddir/net-genrules.sh"
|
||||
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
|
||||
inst_hook cmdline 95 "$moddir/parse-vlan.sh"
|
||||
inst_hook cmdline 96 "$moddir/parse-bond.sh"
|
||||
inst_hook cmdline 97 "$moddir/parse-bridge.sh"
|
||||
inst_hook cmdline 98 "$moddir/parse-ip-opts.sh"
|
||||
inst_hook cmdline 99 "$moddir/parse-ifname.sh"
|
||||
inst_hook pre-pivot 10 "$moddir/kill-dhclient.sh"
|
||||
inst_hook cleanup 10 "$moddir/kill-dhclient.sh"
|
||||
|
||||
_arch=$(uname -m)
|
||||
|
||||
for _dir in "$usrlibdir/tls/$_arch" "$usrlibdir/tls" "$usrlibdir/$_arch" \
|
||||
"$usrlibdir" "$libdir"; do
|
||||
for _i in "$_dir"/libnss_dns.so.* "$_dir"/libnss_mdns4_minimal.so.*; do
|
||||
[ -e "$_i" ] && dracut_install "$_i"
|
||||
done
|
||||
done
|
||||
|
||||
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*"
|
||||
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*"
|
||||
}
|
||||
|
||||
|
@@ -14,14 +14,14 @@ fix_bootif() {
|
||||
}
|
||||
|
||||
# Don't continue if we don't need network
|
||||
[ -z "$netroot" ] && return;
|
||||
[ -z "$netroot" ] && ! [ -e "/tmp/net.ifaces" ] && return;
|
||||
|
||||
# Write udev rules
|
||||
{
|
||||
# bridge: attempt only the defined interface
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
IFACES=$ethname
|
||||
IFACES=${ethnames%% *}
|
||||
fi
|
||||
|
||||
# bond: attempt only the defined interface (override bridge defines)
|
||||
@@ -31,21 +31,29 @@ fix_bootif() {
|
||||
IFACES=${bondslaves%% *}
|
||||
fi
|
||||
|
||||
if [ -e /tmp/vlan.info ]; then
|
||||
. /tmp/vlan.info
|
||||
IFACES=$phydevice
|
||||
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+="/sbin/ifup $env{INTERFACE}"\n' "$BOOTIF"
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="%s"\n' "$BOOTIF" "/sbin/initqueue --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+="/sbin/ifup $env{INTERFACE}"\n' "$iface"
|
||||
printf 'SUBSYSTEM=="net", ENV{INTERFACE}=="%s", RUN+="%s"\n' "$iface" "/sbin/initqueue --onetime $ifup"
|
||||
done
|
||||
|
||||
# Default: We don't know the interface to use, handle all
|
||||
else
|
||||
printf 'SUBSYSTEM=="net", RUN+="/sbin/ifup $env{INTERFACE}"\n'
|
||||
printf 'SUBSYSTEM=="net", RUN+="%s"\n' "/sbin/initqueue --onetime $ifup"
|
||||
fi
|
||||
|
||||
} > /etc/udev/rules.d/60-net.rules
|
||||
|
291
modules.d/40network/net-lib.sh
Normal file
291
modules.d/40network/net-lib.sh
Normal file
@@ -0,0 +1,291 @@
|
||||
#!/bin/sh
|
||||
|
||||
get_ip() {
|
||||
local iface="$1" ip=""
|
||||
ip=$(ip -o -f inet addr show $iface)
|
||||
ip=${ip%%/*}
|
||||
ip=${ip##* }
|
||||
}
|
||||
|
||||
iface_for_remote_addr() {
|
||||
set -- $(ip -o route get to $1)
|
||||
echo $5
|
||||
}
|
||||
|
||||
iface_for_mac() {
|
||||
local interface="" mac="$(echo $1 | tr '[:upper:]' '[:lower:]')"
|
||||
for interface in /sys/class/net/*; do
|
||||
if [ $(cat $interface/address) = "$mac" ]; then
|
||||
echo ${interface##*/}
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
iface_has_link() {
|
||||
local interface="$1" flags=""
|
||||
[ -n "$interface" ] || return 2
|
||||
interface="/sys/class/net/$interface"
|
||||
[ -d "$interface" ] || return 2
|
||||
flags=$(cat $interface/flags)
|
||||
echo $(($flags|0x41)) > $interface/flags # 0x41: IFF_UP|IFF_RUNNING
|
||||
[ "$(cat $interface/carrier)" = 1 ] || return 1
|
||||
# XXX Do we need to reset the flags here? anaconda never bothered..
|
||||
}
|
||||
|
||||
all_ifaces_up() {
|
||||
local iface="" IFACES=""
|
||||
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
|
||||
for iface in $IFACES; do
|
||||
[ -e /tmp/net.$iface.up ] || return 1
|
||||
done
|
||||
}
|
||||
|
||||
get_netroot_ip() {
|
||||
local prefix="" server="" rest=""
|
||||
splitsep "$1" ":" prefix server rest
|
||||
case $server in
|
||||
[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*) echo "$server"; return 0 ;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
ip_is_local() {
|
||||
strstr "$(ip route get $1 2>/dev/null)" " via "
|
||||
}
|
||||
|
||||
ifdown() {
|
||||
local netif="$1"
|
||||
# ip down/flush ensures that routing info goes away as well
|
||||
ip link set $netif down
|
||||
ip addr flush dev $netif
|
||||
echo "#empty" > /etc/resolv.conf
|
||||
rm -f /tmp/net.$netif.did-setup
|
||||
# TODO: send "offline" uevent?
|
||||
}
|
||||
|
||||
setup_net() {
|
||||
local netif="$1" f="" gw_ip="" netroot_ip="" iface="" IFACES=""
|
||||
[ -e /tmp/net.$netif.did-setup ] && return
|
||||
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
|
||||
[ -z "$IFACES" ] && IFACES="$netif"
|
||||
# run the scripts written by ifup
|
||||
[ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw
|
||||
[ -e /tmp/net.$netif.hostname ] && . /tmp/net.$netif.hostname
|
||||
[ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
||||
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||
# set up resolv.conf
|
||||
[ -e /tmp/net.$netif.resolv.conf ] && \
|
||||
cp -f /tmp/net.$netif.resolv.conf /etc/resolv.conf
|
||||
|
||||
# Handle STP Timeout: arping the default gateway.
|
||||
# (or the root server, if a) it's local or b) there's no gateway.)
|
||||
# Note: This assumes that if no router is present the
|
||||
# root server is on the same subnet.
|
||||
|
||||
# Get DHCP-provided router IP, or the cmdline-provided "gw=" argument
|
||||
[ -n "$new_routers" ] && gw_ip=${new_routers%%,*}
|
||||
[ -n "$gw" ] && gw_ip=$gw
|
||||
|
||||
# Get the "netroot" IP (if there's an IP address in there)
|
||||
netroot_ip=$(get_netroot_ip $netroot)
|
||||
|
||||
# try netroot if it's local (or there's no gateway)
|
||||
if ip_is_local $netroot_ip || [ -z "$gw_ip" ]; then
|
||||
dest="$netroot_ip"
|
||||
else
|
||||
dest="$gw_ip"
|
||||
fi
|
||||
|
||||
unset layer2
|
||||
if [ -f /sys/class/net/$netif/device/layer2 ]; then
|
||||
read layer2 < /sys/class/net/$netif/device/layer2
|
||||
fi
|
||||
|
||||
if [ "$layer2" != "0" ] && [ -n "$dest" ] && ! arping -q -f -w 60 -I $netif $dest ; then
|
||||
info "Resolving $dest via ARP on $netif failed"
|
||||
fi
|
||||
unset layer2
|
||||
|
||||
> /tmp/net.$netif.did-setup
|
||||
}
|
||||
|
||||
save_netinfo() {
|
||||
local netif="$1" IFACES="" f="" i=""
|
||||
[ -e /tmp/net.ifaces ] && read IFACES < /tmp/net.ifaces
|
||||
# Add $netif to the front of IFACES (if it's not there already).
|
||||
set -- "$netif"
|
||||
for i in $IFACES; do [ "$i" != "$netif" ] && set -- "$@" "$i"; done
|
||||
IFACES="$*"
|
||||
for i in $IFACES; do
|
||||
for f in /tmp/dhclient.$i.*; do
|
||||
[ -f $f ] && cp -f $f /tmp/net.${f#/tmp/dhclient.}
|
||||
done
|
||||
done
|
||||
echo $IFACES > /tmp/.net.ifaces.new
|
||||
mv /tmp/.net.ifaces.new /tmp/net.ifaces
|
||||
}
|
||||
|
||||
set_ifname() {
|
||||
local name="$1" mac="$2" num=0 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
|
||||
echo "ifname=$name$num:$mac" >> /etc/cmdline.d/45-ifname.conf
|
||||
echo "$name$num"
|
||||
}
|
||||
|
||||
ibft_to_cmdline() {
|
||||
local iface="" mac="" dev=""
|
||||
local dhcp="" ip="" gw="" mask="" hostname=""
|
||||
modprobe -q iscsi_ibft
|
||||
(
|
||||
for iface in /sys/firmware/ibft/ethernet*; do
|
||||
[ -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)
|
||||
if [ -n "$dhcp" ]; then
|
||||
echo "ip=$dev:dhcp"
|
||||
else
|
||||
ip=$(read a < ${iface}/ip-addr; echo $a)
|
||||
gw=$(read a < ${iface}/gateway; echo $a)
|
||||
mask=$(read a < ${iface}/subnet-mask; echo $a)
|
||||
hostname=$(read a < ${iface}/hostname; echo $a)
|
||||
echo "ip=$ip::$gw:$mask:$hostname:$dev:none"
|
||||
fi
|
||||
done
|
||||
) >> /etc/cmdline.d/40-ibft.conf
|
||||
# reread cmdline
|
||||
unset CMDLINE
|
||||
}
|
||||
|
||||
parse_iscsi_root()
|
||||
{
|
||||
local v
|
||||
v=${1#iscsi:}
|
||||
|
||||
# extract authentication info
|
||||
case "$v" in
|
||||
*@*:*:*:*:*)
|
||||
authinfo=${v%%@*}
|
||||
v=${v#*@}
|
||||
# allow empty authinfo to allow having an @ in iscsi_target_name like this:
|
||||
# netroot=iscsi:@192.168.1.100::3260::iqn.2009-01.com.example:testdi@sk
|
||||
if [ -n "$authinfo" ]; then
|
||||
OLDIFS="$IFS"
|
||||
IFS=:
|
||||
set $authinfo
|
||||
IFS="$OLDIFS"
|
||||
if [ $# -gt 4 ]; then
|
||||
warn "Wrong authentication info in iscsi: parameter!"
|
||||
return 1
|
||||
fi
|
||||
iscsi_username=$1
|
||||
iscsi_password=$2
|
||||
if [ $# -gt 2 ]; then
|
||||
iscsi_in_username=$3
|
||||
iscsi_in_password=$4
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# extract target ip
|
||||
case "$v" in
|
||||
[[]*[]]:*)
|
||||
iscsi_target_ip=${v#[[]}
|
||||
iscsi_target_ip=${iscsi_target_ip%%[]]*}
|
||||
v=${v#[[]$iscsi_target_ip[]]:}
|
||||
;;
|
||||
*)
|
||||
iscsi_target_ip=${v%%[:]*}
|
||||
v=${v#$iscsi_target_ip:}
|
||||
;;
|
||||
esac
|
||||
|
||||
# extract target name
|
||||
case "$v" in
|
||||
*:iqn.*)
|
||||
iscsi_target_name=iqn.${v##*:iqn.}
|
||||
v=${v%:iqn.*}:
|
||||
;;
|
||||
*:eui.*)
|
||||
iscsi_target_name=iqn.${v##*:eui.}
|
||||
v=${v%:iqn.*}:
|
||||
;;
|
||||
*:naa.*)
|
||||
iscsi_target_name=iqn.${v##*:naa.}
|
||||
v=${v%:iqn.*}:
|
||||
;;
|
||||
*)
|
||||
warn "Invalid iscii target name, should begin with 'iqn.' or 'eui.' or 'naa.'"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# parse the rest
|
||||
OLDIFS="$IFS"
|
||||
IFS=:
|
||||
set $v
|
||||
IFS="$OLDIFS"
|
||||
|
||||
iscsi_protocol=$1; shift # ignored
|
||||
iscsi_target_port=$1; shift
|
||||
if [ $# -eq 3 ]; then
|
||||
iscsi_iface_name=$1; shift
|
||||
fi
|
||||
if [ $# -eq 2 ]; then
|
||||
iscsi_netdev_name=$1; shift
|
||||
fi
|
||||
iscsi_lun=$1; shift
|
||||
if [ $# -ne 0 ]; then
|
||||
warn "Invalid parameter in iscsi: parameter!"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
ip_to_var() {
|
||||
local v=${1}:
|
||||
local i
|
||||
set --
|
||||
while [ -n "$v" ]; do
|
||||
if [ "${v#\[*:*:*\]:}" != "$v" ]; then
|
||||
# handle IPv6 address
|
||||
i="${v%%\]:*}"
|
||||
i="${i##\[}"
|
||||
set -- "$@" "$i"
|
||||
v=${v#\[$i\]:}
|
||||
else
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
fi
|
||||
done
|
||||
|
||||
unset ip srv gw mask hostname dev autoconf macaddr mtu
|
||||
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 ;;
|
||||
esac
|
||||
# anaconda-style argument cluster
|
||||
if strstr "$autoconf" "*.*.*.*"; then
|
||||
ip="$autoconf"
|
||||
gw=$(getarg gateway=)
|
||||
mask=$(getarg netmask=)
|
||||
hostname=$(getarg hostname=)
|
||||
dev=$(getarg ksdevice=)
|
||||
autoconf="none"
|
||||
mtu=$(getarg mtu=)
|
||||
case "$dev" in
|
||||
# ignore fancy values for ksdevice=XXX
|
||||
link|bootif|BOOTIF|ibft|*:*:*:*:*:*) dev="" ;;
|
||||
esac
|
||||
fi
|
||||
}
|
@@ -1,149 +0,0 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
# Huh? Empty $1?
|
||||
[ -z "$1" ] && exit 1
|
||||
|
||||
# Huh? No interface config?
|
||||
[ ! -e /tmp/net.$1.up ] && exit 1
|
||||
|
||||
# There's no sense in doing something if no (net)root info is available
|
||||
# or root is already there
|
||||
[ -e /tmp/root.info ] || exit 1
|
||||
. /tmp/root.info
|
||||
[ -d $NEWROOT/proc ] && exit 0
|
||||
[ -z "$netroot" ] && exit 1
|
||||
|
||||
# Let's see if we have to wait for other interfaces
|
||||
# Note: exit works just fine, since the last interface to be
|
||||
# online'd should see all files
|
||||
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
|
||||
for iface in $IFACES ; do
|
||||
[ -e /tmp/net.$iface.up ] || exit 1
|
||||
done
|
||||
|
||||
# Set or override primary interface
|
||||
netif=$1
|
||||
[ -e "/tmp/net.bootdev" ] && read netif < /tmp/net.bootdev
|
||||
|
||||
# Figure out the handler for root=dhcp by recalling all netroot cmdline
|
||||
# handlers
|
||||
if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] ; then
|
||||
# Unset root so we can check later
|
||||
unset root
|
||||
|
||||
# Load dhcp options
|
||||
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||
|
||||
# If we have a specific bootdev with no dhcpoptions or empty root-path,
|
||||
# we die. Otherwise we just warn
|
||||
if [ -z "$new_root_path" ] ; then
|
||||
[ -n "$BOOTDEV" ] && die "No dhcp root-path received for '$BOOTDEV'"
|
||||
warn "No dhcp root-path received for '$BOOTDEV' trying other interfaces if available"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set netroot to new_root_path, so cmdline parsers don't call
|
||||
netroot=$new_root_path
|
||||
|
||||
# FIXME!
|
||||
for f in $hookdir/cmdline/90*.sh; do
|
||||
[ -f "$f" ] && . "$f";
|
||||
done
|
||||
else
|
||||
rootok="1"
|
||||
fi
|
||||
|
||||
# Check: do we really know how to handle (net)root?
|
||||
[ -z "$root" ] && die "No or empty root= argument"
|
||||
[ -z "$rootok" ] && die "Don't know how to handle 'root=$root'"
|
||||
|
||||
handler=${netroot%%:*}
|
||||
handler=${handler%%4}
|
||||
handler=$(command -v ${handler}root)
|
||||
if [ -z "$netroot" ] || [ ! -e "$handler" ] ; then
|
||||
die "No handler for netroot type '$netroot'"
|
||||
fi
|
||||
|
||||
# We're here, so we can assume that upping interfaces is now ok
|
||||
[ -z "$IFACES" ] && IFACES="$netif"
|
||||
for iface in $IFACES ; do
|
||||
. /tmp/net.$iface.up
|
||||
done
|
||||
|
||||
[ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw
|
||||
[ -e /tmp/net.$netif.hostname ] && . /tmp/net.$netif.hostname
|
||||
[ -e /tmp/net.$netif.resolv.conf ] && cp -f /tmp/net.$netif.resolv.conf /etc/resolv.conf
|
||||
|
||||
# Load interface options
|
||||
[ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
||||
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||
|
||||
# Handle STP Timeout: arping the default router if root server is
|
||||
# unknown or not local, or if not available the root server.
|
||||
# Note: This assumes that if no router is present the
|
||||
# root server is on the same subnet.
|
||||
#
|
||||
# TODO There's some netroot variants that don't (yet) have their
|
||||
# server-ip netroot
|
||||
|
||||
# Get router IP if set
|
||||
[ -n "$new_routers" ] && gw_ip=${new_routers%%,*}
|
||||
[ -n "$gw" ] && gw_ip=$gw
|
||||
# Get root server IP if set
|
||||
if [ -n "$netroot" ]; then
|
||||
dummy=${netroot#*:}
|
||||
dummy=${dummy%%:*}
|
||||
case "$dummy" in
|
||||
[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*) netroot_ip=$dummy;;
|
||||
esac
|
||||
fi
|
||||
# Default arping dest to router
|
||||
dest="$gw_ip"
|
||||
# Change to arping root server if appropriate
|
||||
if [ -n "$netroot_ip" ]; then
|
||||
if [ -z "$dest" ]; then
|
||||
# no gateway so check root server
|
||||
dest="$netroot_ip"
|
||||
else
|
||||
r=$(ip route get "$netroot_ip")
|
||||
if ! strstr "$r" ' via ' ; then
|
||||
# local root server, so don't arping gateway
|
||||
dest="$netroot_ip"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ -n "$dest" ] && ! arping -q -f -w 60 -I $netif $dest ; then
|
||||
die "Resolving $dest via ARP on $netif failed"
|
||||
fi
|
||||
|
||||
# Source netroot hooks before we start the handler
|
||||
source_all netroot
|
||||
|
||||
# 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
|
||||
# Network rootfs mount successful
|
||||
for iface in $IFACES ; do
|
||||
[ -f /tmp/dhclient.$iface.lease ] && cp /tmp/dhclient.$iface.lease /tmp/net.$iface.lease
|
||||
[ -f /tmp/dhclient.$iface.dhcpopts ] && cp /tmp/dhclient.$iface.dhcpopts /tmp/net.$iface.dhcpopts
|
||||
done
|
||||
|
||||
# Save used netif for later use
|
||||
[ ! -f /tmp/net.ifaces ] && echo $netif > /tmp/net.ifaces
|
||||
else
|
||||
warn "Mounting root via '$netif' failed"
|
||||
# If we're trying with multiple interfaces, put that one down.
|
||||
# ip down/flush ensures that routeing info goes away as well
|
||||
if [ -z "$BOOTDEV" ] ; then
|
||||
ip link set $netif down
|
||||
ip addr flush dev $netif
|
||||
echo "#empty" > /etc/resolv.conf
|
||||
fi
|
||||
fi
|
||||
exit 0
|
73
modules.d/40network/netroot.sh
Executable file
73
modules.d/40network/netroot.sh
Executable file
@@ -0,0 +1,73 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
command -v getarg >/dev/null || . /lib/dracut-lib.sh
|
||||
command -v setup_net >/dev/null || . /lib/net-lib.sh
|
||||
|
||||
# Huh? Empty $1?
|
||||
[ -z "$1" ] && exit 1
|
||||
|
||||
# [ ! -z $2 ] means this is for manually bringing up network
|
||||
# instead of real netroot; If It's called without $2, then there's
|
||||
# no sense in doing something if no (net)root info is available
|
||||
# or root is already there
|
||||
[ -d $NEWROOT/proc ] && exit 0
|
||||
[ -z "$netroot" ] && exit 1
|
||||
|
||||
# Set or override primary interface
|
||||
netif=$1
|
||||
[ -e "/tmp/net.bootdev" ] && read netif < /tmp/net.bootdev
|
||||
|
||||
# Figure out the handler for root=dhcp by recalling all netroot cmdline
|
||||
# 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
|
||||
|
||||
# If we have a specific bootdev with no dhcpoptions or empty root-path,
|
||||
# we die. Otherwise we just warn
|
||||
if [ -z "$new_root_path" ] ; then
|
||||
[ -n "$BOOTDEV" ] && die "No dhcp root-path received for '$BOOTDEV'"
|
||||
warn "No dhcp root-path received for '$BOOTDEV' trying other interfaces if available"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set netroot to new_root_path, so cmdline parsers don't call
|
||||
netroot=$new_root_path
|
||||
|
||||
# FIXME!
|
||||
for f in $hookdir/cmdline/90*.sh; do
|
||||
[ -f "$f" ] && . "$f";
|
||||
done
|
||||
else
|
||||
rootok="1"
|
||||
fi
|
||||
|
||||
# Check: do we really know how to handle (net)root?
|
||||
[ -z "$root" ] && die "No or empty root= argument"
|
||||
[ -z "$rootok" ] && die "Don't know how to handle 'root=$root'"
|
||||
|
||||
handler=${netroot%%:*}
|
||||
handler=${handler%%4}
|
||||
handler=$(command -v ${handler}root)
|
||||
if [ -z "$netroot" ] || [ ! -e "$handler" ] ; then
|
||||
die "No handler for netroot type '$netroot'"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Source netroot hooks before we start the handler
|
||||
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
|
||||
# Network rootfs mount successful - save interface info for ifcfg etc.
|
||||
save_netinfo $netif
|
||||
fi
|
||||
exit 0
|
@@ -15,9 +15,7 @@
|
||||
|
||||
# Check if bond parameter is valid
|
||||
if getarg bond= >/dev/null ; then
|
||||
if [ -z "$netroot" ] ; then
|
||||
die "No netboot configured, bond is invalid"
|
||||
fi
|
||||
:
|
||||
fi
|
||||
|
||||
# We translate list of slaves to space-separated here to mwke it easier to loop over them in ifup
|
||||
|
@@ -3,8 +3,9 @@
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Format:
|
||||
# bridge=<bridgename>:<ethname>
|
||||
# bridge=<bridgename>:<ethnames>
|
||||
#
|
||||
# <ethnames> is a comma-separated list of physical (ethernet) interfaces
|
||||
# bridge without parameters assumes bridge=br0:eth0
|
||||
#
|
||||
|
||||
@@ -13,9 +14,7 @@
|
||||
|
||||
# Check if bridge parameter is valid
|
||||
if getarg bridge= >/dev/null ; then
|
||||
if [ -z "$netroot" ] ; then
|
||||
die "No netboot configured, bridge is invalid"
|
||||
fi
|
||||
command -v brctl >/dev/null 2>&1 || die "No 'brctl' installed"
|
||||
fi
|
||||
|
||||
parsebridge() {
|
||||
@@ -26,16 +25,16 @@ parsebridge() {
|
||||
v=${v#*:}
|
||||
done
|
||||
|
||||
unset bridgename ethname
|
||||
unset bridgename ethnames
|
||||
case $# in
|
||||
0) bridgename=br0; ethname=$iface ;;
|
||||
0) bridgename=br0; ethnames=$iface ;;
|
||||
1) die "bridge= requires two parameters" ;;
|
||||
2) bridgename=$1; ethname=$2 ;;
|
||||
2) bridgename=$1; ethnames=$(echo $2|tr "," " ") ;;
|
||||
*) die "bridge= requires two parameters" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
unset bridgename ethname
|
||||
unset bridgename ethnames
|
||||
|
||||
iface=eth0
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
@@ -45,7 +44,7 @@ if [ -e /tmp/bond.info ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Parse bridge for bridgename and ethname
|
||||
# Parse bridge for bridgename and ethnames
|
||||
if bridge="$(getarg bridge)"; then
|
||||
# Read bridge= parameters if they exist
|
||||
if [ -n "$bridge" ]; then
|
||||
@@ -54,9 +53,9 @@ if bridge="$(getarg bridge)"; then
|
||||
# Simple default bridge
|
||||
if [ -z "$bridgename" ]; then
|
||||
bridgename=br0
|
||||
ethname=$iface
|
||||
ethnames=$iface
|
||||
fi
|
||||
echo "bridgename=$bridgename" > /tmp/bridge.info
|
||||
echo "ethname=$ethname" >> /tmp/bridge.info
|
||||
echo "ethnames=\"$ethnames\"" >> /tmp/bridge.info
|
||||
return
|
||||
fi
|
||||
|
@@ -25,7 +25,8 @@ parse_ifname_opts() {
|
||||
case $# in
|
||||
7)
|
||||
ifname_if=$1
|
||||
ifname_mac=$2:$3:$4:$5:$6:$7
|
||||
# udev requires MAC addresses to be lower case
|
||||
ifname_mac=`echo $2:$3:$4:$5:$6:$7 | tr '[:upper:]' '[:lower:]'`
|
||||
;;
|
||||
*)
|
||||
die "Invalid arguments for ifname="
|
||||
|
@@ -5,24 +5,17 @@
|
||||
# Format:
|
||||
# ip=[dhcp|on|any]
|
||||
#
|
||||
# ip=<interface>:[dhcp|on|any]
|
||||
# ip=<interface>:[dhcp|on|any][:[<mtu>][:<macaddr>]]
|
||||
#
|
||||
# ip=<client-IP-number>:<server-id>:<gateway-IP-number>:<netmask>:<client-hostname>:<interface>:[dhcp|on|any|none|off]
|
||||
# ip=<client-IP-number>:<server-IP-number>:<gateway-IP-number>:<netmask>:<client-hostname>:<interface>:{dhcp|on|any|none|off}[:[<mtu>][:<macaddr>]]
|
||||
#
|
||||
# When supplying more than only ip= line, <interface> is mandatory and
|
||||
# bootdev= must contain the name of the primary interface to use for
|
||||
# routing,dns,dhcp-options,etc.
|
||||
#
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
# Check if ip= lines should be used
|
||||
if getarg ip= >/dev/null ; then
|
||||
if [ -z "$netroot" ] ; then
|
||||
echo "Warning: No netboot configured, ignoring ip= lines"
|
||||
return;
|
||||
fi
|
||||
fi
|
||||
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 && \
|
||||
@@ -38,12 +31,13 @@ fi
|
||||
|
||||
# Count ip= lines to decide whether we need bootdev= or not
|
||||
if [ -z "$NEEDBOOTDEV" ] ; then
|
||||
local count=0
|
||||
count=0
|
||||
for p in $(getargs ip=); do
|
||||
count=$(( $count + 1 ))
|
||||
done
|
||||
[ $count -gt 1 ] && NEEDBOOTDEV=1
|
||||
fi
|
||||
unset count
|
||||
|
||||
# If needed, check if bootdev= contains anything usable
|
||||
if [ -n "$NEEDBOOTDEV" ] ; then
|
||||
@@ -51,50 +45,15 @@ if [ -n "$NEEDBOOTDEV" ] ; then
|
||||
[ -z "$BOOTDEV" ] && die "Bootdev argument is empty"
|
||||
fi
|
||||
|
||||
if [ "ibft" = "$(getarg ip=)" ]; then
|
||||
modprobe iscsi_ibft
|
||||
num=0
|
||||
(
|
||||
for iface in /sys/firmware/ibft/ethernet*; do
|
||||
[ -e ${iface}/mac ] || continue
|
||||
ifname_mac=$(read a < ${iface}/mac; echo $a)
|
||||
[ -z "$ifname_mac" ] && continue
|
||||
unset dev
|
||||
for ifname in $(getargs ifname=); do
|
||||
if strstr "$ifname" "$ifname_mac"; then
|
||||
dev=${ifname%%:*}
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ -z "$dev" ]; then
|
||||
ifname_if=ibft$num
|
||||
num=$(( $num + 1 ))
|
||||
echo "ifname=$ifname_if:$ifname_mac"
|
||||
dev=$ifname_if
|
||||
fi
|
||||
|
||||
dhcp=$(read a < ${iface}/dhcp; echo $a)
|
||||
if [ -n "$dhcp" ]; then
|
||||
echo "ip=$dev:dhcp"
|
||||
else
|
||||
ip=$(read a < ${iface}/ip-addr; echo $a)
|
||||
gw=$(read a < ${iface}/gateway; echo $a)
|
||||
mask=$(read a < ${iface}/subnet-mask; echo $a)
|
||||
hostname=$(read a < ${iface}/hostname; echo $a)
|
||||
echo "ip=$ip::$gw:$mask:$hostname:$dev:none"
|
||||
fi
|
||||
done
|
||||
) >> /etc/cmdline
|
||||
# reread cmdline
|
||||
unset CMDLINE
|
||||
fi
|
||||
# If ibft is requested, read ibft vals and write ip=XXX cmdline args
|
||||
[ "ibft" = "$(getarg ip=)" ] && ibft_to_cmdline
|
||||
|
||||
# Check ip= lines
|
||||
# XXX Would be nice if we could errorcheck ip addresses here as well
|
||||
for p in $(getargs ip=); do
|
||||
ip_to_var $p
|
||||
|
||||
# skip ibft
|
||||
# skip ibft since we did it above
|
||||
[ "$autoconf" = "ibft" ] && continue
|
||||
|
||||
# We need to have an ip= line for the specified bootdev
|
||||
@@ -110,7 +69,7 @@ for p in $(getargs ip=); do
|
||||
case $autoconf in
|
||||
error) die "Error parsing option 'ip=$p'";;
|
||||
bootp|rarp|both) die "Sorry, ip=$autoconf is currenty unsupported";;
|
||||
none|off) \
|
||||
none|off)
|
||||
[ -z "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nValue '$autoconf' without static configuration does not make sense"
|
||||
[ -z "$mask" ] && \
|
||||
|
42
modules.d/40network/parse-vlan.sh
Normal file
42
modules.d/40network/parse-vlan.sh
Normal file
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Format:
|
||||
# vlan=<vlanname>:<phydevice>
|
||||
#
|
||||
|
||||
# return if vlan already parsed
|
||||
[ -n "$vlanname" ] && return
|
||||
|
||||
# Check if vlan parameter is valid
|
||||
if getarg vlan= >/dev/null ; then
|
||||
:
|
||||
fi
|
||||
|
||||
parsevlan() {
|
||||
local v=${1}:
|
||||
set --
|
||||
while [ -n "$v" ]; do
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
done
|
||||
|
||||
unset vlanname phydevice
|
||||
case $# in
|
||||
2) vlanname=$1; phydevice=$2 ;;
|
||||
*) die "vlan= requires two parameters" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
unset vlanname phydevice
|
||||
|
||||
if getarg vlan >/dev/null; then
|
||||
# Read vlan= parameters if they exist
|
||||
vlan="$(getarg vlan=)"
|
||||
if [ ! "$vlan" = "vlan" ]; then
|
||||
parsevlan "$(getarg vlan=)"
|
||||
fi
|
||||
|
||||
echo "vlanname=\"$vlanname\"" > /tmp/vlan.info
|
||||
echo "phydevice=\"$phydevice\"" >> /tmp/vlan.info
|
||||
return
|
||||
fi
|
@@ -18,11 +18,77 @@ if [ -e /tmp/bridge.info ]; then
|
||||
fi
|
||||
|
||||
mkdir -m 0755 -p /tmp/ifcfg/
|
||||
mkdir -m 0755 -p /tmp/ifcfg-leases/
|
||||
|
||||
get_config_line_by_subchannel()
|
||||
{
|
||||
local CHANNEL
|
||||
local line
|
||||
|
||||
CHANNELS="$1"
|
||||
while read line; do
|
||||
if strstr "$line" "$CHANNELS"; then
|
||||
echo $line
|
||||
return 0
|
||||
fi
|
||||
done < /etc/ccw.conf
|
||||
return 1
|
||||
}
|
||||
|
||||
print_s390() {
|
||||
local _netif
|
||||
local SUBCHANNELS
|
||||
local OPTIONS
|
||||
local NETTYPE
|
||||
local CONFIG_LINE
|
||||
local i
|
||||
local channel
|
||||
local OLD_IFS
|
||||
|
||||
_netif="$1"
|
||||
# if we find ccw channel, then use those, instead of
|
||||
# of the MAC
|
||||
SUBCHANNELS=$({
|
||||
for i in /sys/class/net/$_netif/device/cdev[0-9]*; do
|
||||
[ -e $i ] || continue
|
||||
channel=$(readlink -f $i)
|
||||
echo -n "${channel##*/},"
|
||||
done
|
||||
})
|
||||
[ -n "$SUBCHANNELS" ] || return 1
|
||||
|
||||
SUBCHANNELS=${SUBCHANNELS%,}
|
||||
echo "SUBCHANNELS=\"${SUBCHANNELS}\""
|
||||
CONFIG_LINE=$(get_config_line_by_subchannel $SUBCHANNELS)
|
||||
|
||||
[ $? -ne 0 -o -z "$CONFIG_LINE" ] && return
|
||||
|
||||
OLD_IFS=$IFS
|
||||
IFS=","
|
||||
set -- $CONFIG_LINE
|
||||
IFS=$OLD_IFS
|
||||
NETTYPE=$1
|
||||
shift
|
||||
SUBCHANNELS="$1"
|
||||
OPTIONS=""
|
||||
shift
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
*=*) OPTIONS="$OPTIONS $1";;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
OPTIONS=${OPTIONS## }
|
||||
echo "NETTYPE=\"${NETTYPE}\""
|
||||
echo "OPTIONS=\"${OPTIONS}\""
|
||||
}
|
||||
|
||||
|
||||
for netif in $IFACES ; do
|
||||
# bridge?
|
||||
unset bridge
|
||||
unset bond
|
||||
uuid=$(cat /proc/sys/kernel/random/uuid)
|
||||
if [ "$netif" = "$bridgename" ]; then
|
||||
bridge=yes
|
||||
elif [ "$netif" = "$bondname" ]; then
|
||||
@@ -35,16 +101,23 @@ for netif in $IFACES ; do
|
||||
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
|
||||
else
|
||||
echo "BOOTPROTO=none"
|
||||
# If we've booted with static ip= lines, the override file is there
|
||||
[ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
||||
echo "IPADDR=$ip"
|
||||
echo "NETMASK=$mask"
|
||||
if strstr "$mask" "."; then
|
||||
echo "NETMASK=$mask"
|
||||
else
|
||||
echo "PREFIX=$mask"
|
||||
fi
|
||||
[ -n "$gw" ] && echo "GATEWAY=$gw"
|
||||
fi
|
||||
} > /tmp/ifcfg/ifcfg-$netif
|
||||
@@ -53,9 +126,15 @@ for netif in $IFACES ; do
|
||||
if [ -z "$bridge" ] && [ -z "$bond" ]; then
|
||||
# standard interface
|
||||
{
|
||||
echo "HWADDR=$(cat /sys/class/net/$netif/address)"
|
||||
if [ -n "$macaddr" ]; then
|
||||
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"
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
fi
|
||||
|
||||
@@ -131,14 +210,21 @@ for netif in $IFACES ; do
|
||||
} >> /tmp/ifcfg/ifcfg-$ethname
|
||||
fi
|
||||
fi
|
||||
i=1
|
||||
for ns in $(getargs nameserver); do
|
||||
echo "DNS${i}=${ns}" >> /tmp/ifcfg/ifcfg-$netif
|
||||
i=$((i+1))
|
||||
done
|
||||
done
|
||||
|
||||
# Pass network opts
|
||||
[ -d /run/initramfs ] || mkdir -m 0755 -p /run/initramfs
|
||||
cp /tmp/net.* /run/initramfs/ >/dev/null 2>&1
|
||||
for i in /run/initramfs/state /run/initramfs/state/etc/ /run/initramfs/state/etc/sysconfig /run/initramfs/state/etc/sysconfig/network-scripts; do
|
||||
[ -d $i ] || mkdir -m 0755 -p $i
|
||||
done
|
||||
cp /tmp/net.$netif.resolv.conf /run/initramfs/state/etc/ >/dev/null 2>&1
|
||||
echo "files /etc/sysconfig/network-scripts" > /run/initramfs/rwtab
|
||||
cp -a -t /run/initramfs/state/etc/sysconfig/network-scripts/ /tmp/ifcfg/* >/dev/null 2>&1
|
||||
mkdir -m 0755 -p /run/initramfs/state/etc/sysconfig/network-scripts
|
||||
mkdir -m 0755 -p /run/initramfs/state/var/lib/dhclient
|
||||
echo "files /etc/sysconfig/network-scripts" >> /run/initramfs/rwtab
|
||||
echo "files /var/lib/dhclient" >> /run/initramfs/rwtab
|
||||
{
|
||||
cp /tmp/net.* /run/initramfs/
|
||||
cp /tmp/net.$netif.resolv.conf /run/initramfs/state/etc/resolv.conf
|
||||
copytree /tmp/ifcfg /run/initramfs/state/etc/sysconfig/network-scripts
|
||||
cp /tmp/ifcfg-leases/* /run/initramfs/state/var/lib/dhclient
|
||||
} > /dev/null 2>&1
|
||||
|
24
modules.d/45url-lib/module-setup.sh
Executable file
24
modules.d/45url-lib/module-setup.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
# module-setup for url-lib
|
||||
|
||||
check() {
|
||||
command -v curl >/dev/null || return 1
|
||||
return 255
|
||||
}
|
||||
|
||||
depends() {
|
||||
echo network
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
inst "$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
|
||||
}
|
||||
|
118
modules.d/45url-lib/url-lib.sh
Executable file
118
modules.d/45url-lib/url-lib.sh
Executable file
@@ -0,0 +1,118 @@
|
||||
#!/bin/sh
|
||||
# url-lib.sh - functions for handling URLs (file fetching etc.)
|
||||
#
|
||||
# Authors:
|
||||
# Will Woods <wwoods@redhat.com>
|
||||
|
||||
type mkuniqdir >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
# fetch_url URL [OUTFILE]
|
||||
# fetch the given URL to a locally-visible location.
|
||||
# if OUTFILE is given, the URL will be fetched to that filename,
|
||||
# overwriting it if present.
|
||||
# If the URL is something mountable (e.g. nfs://) and no OUTFILE is given,
|
||||
# the server will be left mounted until pre-pivot.
|
||||
# the return values are as follows:
|
||||
# 0: success
|
||||
# 253: unknown error (file missing)
|
||||
# 254: unhandled URL scheme / protocol
|
||||
# 255: bad arguments / unparseable URLs
|
||||
# other: fetch command failure (whatever curl/mount/etc return)
|
||||
fetch_url() {
|
||||
local url="$1" outloc="$2"
|
||||
local handler="$(get_url_handler $url)"
|
||||
[ -n "$handler" ] || return 254
|
||||
[ -n "$url" ] || return 255
|
||||
$handler "$url" "$outloc"
|
||||
}
|
||||
|
||||
# get_url_handler URL
|
||||
# returns the first HANDLERNAME corresponding to the URL's scheme
|
||||
get_url_handler() {
|
||||
local scheme="${1%%:*}" item=""
|
||||
for item in $url_handler_map; do
|
||||
[ "$scheme" = "${item%%:*}" ] && echo "${item#*:}" && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# add_url_handler HANDLERNAME SCHEME [SCHEME...]
|
||||
# associate the named handler with the named scheme(s).
|
||||
add_url_handler() {
|
||||
local handler="$1"; shift
|
||||
local schemes="$@" scheme=""
|
||||
set --
|
||||
for scheme in $schemes; do
|
||||
[ "$(get_url_handler $scheme)" = "$handler" ] && continue
|
||||
set -- "$@" "$scheme:$handler"
|
||||
done
|
||||
set -- $@ $url_handler_map # add new items to *front* of list
|
||||
url_handler_map="$@"
|
||||
}
|
||||
|
||||
### HTTP, HTTPS, FTP #################################################
|
||||
|
||||
export CURL_HOME="/run/initramfs/url-lib"
|
||||
mkdir -p $CURL_HOME
|
||||
curl_args="--location --retry 3 --fail --show-error"
|
||||
|
||||
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 $?
|
||||
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 [ -z "$2" ]; then echo "$outloc" ; fi
|
||||
}
|
||||
add_url_handler curl_fetch_url http https ftp
|
||||
|
||||
set_http_header() {
|
||||
echo "header = \"$1: $2\"" >> $CURL_HOME/.curlrc
|
||||
}
|
||||
|
||||
### NFS ##############################################################
|
||||
|
||||
[ -e /lib/nfs-lib.sh ] && . /lib/nfs-lib.sh
|
||||
|
||||
nfs_already_mounted() {
|
||||
local server="$1" path="$2" localdir="" s="" p=""
|
||||
cat /proc/mounts | while read src mnt rest; do
|
||||
splitsep ":" "$src" s p
|
||||
if [ "$server" = "$s" ]; then
|
||||
if [ "$path" = "$p" ]; then
|
||||
echo $mnt
|
||||
elif str_starts "$path" "$p"; then
|
||||
echo $mnt/${path#$p/}
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
nfs_fetch_url() {
|
||||
local url="$1" outloc="$2" nfs="" server="" path="" options=""
|
||||
nfs_to_var "$url" || return 255
|
||||
local filepath="${path%/*}" filename="${path##*/}" mntdir=""
|
||||
|
||||
# skip mount if server:/filepath is already mounted
|
||||
mntdir=$(nfs_already_mounted $server $path)
|
||||
if [ -z "$mntdir" ]; then
|
||||
local mntdir="$(mkuniqdir /run nfs_mnt)"
|
||||
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
|
||||
fi
|
||||
|
||||
if [ -z "$outloc" ]; then
|
||||
outloc="$mntdir/$filename"
|
||||
else
|
||||
cp -f "$mntdir/$filename" "$outloc" || return $?
|
||||
fi
|
||||
[ -f "$outloc" ] || return 253
|
||||
if [ -z "$2" ]; then echo "$outloc" ; fi
|
||||
}
|
||||
command -v nfs_to_var >/dev/null && add_url_handler nfs_fetch_url nfs nfs4
|
@@ -3,6 +3,7 @@
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
[[ "$mount_needs" ]] && return 1
|
||||
[[ -x /sbin/plymouthd && -x /bin/plymouth && -x /usr/sbin/plymouth-set-default-theme ]]
|
||||
}
|
||||
|
||||
@@ -13,8 +14,23 @@ depends() {
|
||||
installkernel() {
|
||||
local _modname
|
||||
# Include KMS capable drm drivers
|
||||
for _modname in $(find "$srcmods/kernel/drivers/gpu/drm" "$srcmods/extra" -name '*.ko' 2>/dev/null); do
|
||||
grep -q drm_crtc_init $_modname && instmods $_modname
|
||||
for _modname in $(find "$srcmods/kernel/drivers/gpu/drm" "$srcmods/extra" \( -name '*.ko' -o -name '*.ko.gz' -o -name '*.ko.xz' \) 2>/dev/null); do
|
||||
case $_modname in
|
||||
*.ko) grep -q drm_crtc_init $_modname ;;
|
||||
*.ko.gz) zgrep -q drm_crtc_init $_modname ;;
|
||||
*.ko.xz) xzgrep -q drm_crtc_init $_modname ;;
|
||||
esac
|
||||
if test $? -eq 0; then
|
||||
# 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
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
@@ -22,7 +38,7 @@ install() {
|
||||
if grep -q nash /usr/libexec/plymouth/plymouth-populate-initrd \
|
||||
|| ! grep -q PLYMOUTH_POPULATE_SOURCE_FUNCTIONS /usr/libexec/plymouth/plymouth-populate-initrd \
|
||||
|| [ ! -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then
|
||||
. "$moddir"/plymouth-populate-initrd
|
||||
. "$moddir"/plymouth-populate-initrd.sh
|
||||
else
|
||||
PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \
|
||||
/usr/libexec/plymouth/plymouth-populate-initrd -t $initdir
|
||||
|
@@ -2,25 +2,29 @@
|
||||
# -*- 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.plymouth -n rd_NO_PLYMOUTH; then
|
||||
[ -c /dev/null ] || mknod -m 0666 /dev/null c 1 3
|
||||
# first trigger graphics subsystem
|
||||
udevadm trigger --action=add --attr-match=class=0x030000 >/dev/null 2>&1
|
||||
# first trigger graphics and tty subsystem
|
||||
udevadm trigger --action=add --subsystem-match=graphics --subsystem-match=drm --subsystem-match=tty >/dev/null 2>&1
|
||||
if [ -x /bin/plymouthd ]; then
|
||||
if getargbool 1 plymouth.enable && getargbool 1 rd.plymouth -n rd_NO_PLYMOUTH; then
|
||||
[ -c /dev/null ] || mknod -m 0666 /dev/null c 1 3
|
||||
# first trigger graphics subsystem
|
||||
udevadm trigger --action=add --attr-match=class=0x030000 >/dev/null 2>&1
|
||||
# first trigger graphics and tty subsystem
|
||||
udevadm trigger --action=add --subsystem-match=graphics --subsystem-match=drm --subsystem-match=tty >/dev/null 2>&1
|
||||
|
||||
udevadm settle --timeout=30 2>&1 | vinfo
|
||||
[ -c /dev/zero ] || mknod -m 0666 /dev/zero c 1 5
|
||||
[ -c /dev/tty0 ] || mknod -m 0620 /dev/tty0 c 4 0
|
||||
[ -e /dev/systty ] || ln -s tty0 /dev/systty
|
||||
[ -c /dev/fb0 ] || mknod -m 0660 /dev/fb0 c 29 0
|
||||
[ -e /dev/fb ] || ln -s fb0 /dev/fb
|
||||
udevadm settle --timeout=30 2>&1 | vinfo
|
||||
[ -c /dev/zero ] || mknod -m 0666 /dev/zero c 1 5
|
||||
[ -c /dev/tty0 ] || mknod -m 0620 /dev/tty0 c 4 0
|
||||
[ -e /dev/systty ] || ln -s tty0 /dev/systty
|
||||
[ -c /dev/fb0 ] || mknod -m 0660 /dev/fb0 c 29 0
|
||||
[ -e /dev/fb ] || ln -s fb0 /dev/fb
|
||||
|
||||
info "Starting plymouth daemon"
|
||||
mkdir -m 0755 /run/plymouth
|
||||
[ -x /lib/udev/console_init ] && /lib/udev/console_init /dev/tty0
|
||||
[ -x /bin/plymouthd ] && /bin/plymouthd --attach-to-session --pid-file /run/plymouth/pid
|
||||
/bin/plymouth --show-splash 2>&1 | vinfo
|
||||
# reset tty after plymouth messed with it
|
||||
[ -x /lib/udev/console_init ] && /lib/udev/console_init /dev/tty0
|
||||
info "Starting plymouth daemon"
|
||||
mkdir -m 0755 /run/plymouth
|
||||
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
|
||||
# reset tty after plymouth messed with it
|
||||
[ -x /lib/udev/console_init -a -e "/dev/$consoledev" ] && /lib/udev/console_init "/dev/$consoledev"
|
||||
fi
|
||||
fi
|
||||
|
@@ -1,42 +0,0 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
# No Xen-detect? Boo!!
|
||||
if ! hash xen-detect 2>/dev/null; then
|
||||
[[ -d /usr/lib/xen-default ]] && \
|
||||
hash -p /usr/lib/xen-default/bin/xen-detect xen-detect || return 1
|
||||
fi
|
||||
|
||||
. $dracutfunctions
|
||||
[[ $debug ]] && set -x
|
||||
|
||||
# Yes, we are under Xen PV env.
|
||||
xen-detect | grep -q -v PV || return 0
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
local _i
|
||||
for _i in \
|
||||
xenbus_probe_frontend xen-pcifront \
|
||||
xen-fbfront xen-kbdfront xen-blkfront xen-netfront \
|
||||
; do
|
||||
modinfo -k $kernel $_i >/dev/null 2>&1 && instmods $_i
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
install() {
|
||||
hash xen-detect 2>/dev/null || \
|
||||
hash -p /usr/lib/xen-default/bin/xen-detect xen-detect
|
||||
inst "$(hash -t xen-detect)" /sbin/xen-detect
|
||||
inst_hook pre-udev 40 "$moddir/xen-pre-udev.sh"
|
||||
}
|
||||
|
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
xen-detect
|
||||
RC=$?
|
||||
if [ "$RC" = "1" ] ; then
|
||||
modprobe xenbus_probe_frontend
|
||||
modprobe xen-kbdfront
|
||||
modprobe xen-fbfront
|
||||
modprobe xen-blkfront
|
||||
modprobe xen-netfront
|
||||
modprobe xen-pcifront
|
||||
fi
|
104
modules.d/80cms/cms-write-ifcfg.sh
Executable file
104
modules.d/80cms/cms-write-ifcfg.sh
Executable file
@@ -0,0 +1,104 @@
|
||||
#!/bin/bash
|
||||
# -*- 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
|
||||
|
||||
mkdir -m 0755 -p /run/initramfs/state/etc/sysconfig/network-scripts
|
||||
|
||||
function cms_write_config()
|
||||
{
|
||||
. /tmp/cms.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
|
||||
fi
|
||||
|
||||
DEVICE=$(cd /sys/devices/${driver}/$devbusid/net/ && set -- * && [ "$1" != "*" ] && echo $1)
|
||||
|
||||
uuid=$(cat /proc/sys/kernel/random/uuid)
|
||||
|
||||
IFCFGFILE=/run/initramfs/state/etc/sysconfig/network-scripts/ifcfg-$DEVICE
|
||||
|
||||
strstr "$IPADDR" '*:*:*' && ipv6=1
|
||||
|
||||
# to please NetworkManager on startup in loader before loader reconfigures net
|
||||
cat > /etc/sysconfig/network << EOF
|
||||
HOSTNAME=$HOSTNAME
|
||||
EOF
|
||||
if [ "$ipv6" ]; then
|
||||
echo "NETWORKING_IPV6=yes" >> /etc/sysconfig/network
|
||||
else
|
||||
echo "NETWORKING=yes" >> /etc/sysconfig/network
|
||||
fi
|
||||
|
||||
cat > $IFCFGFILE << EOF
|
||||
DEVICE=$DEVICE
|
||||
UUID=$uuid
|
||||
ONBOOT=yes
|
||||
BOOTPROTO=static
|
||||
MTU=$MTU
|
||||
SUBCHANNELS=$SUBCHANNELS
|
||||
EOF
|
||||
if [ "$ipv6" ]; then
|
||||
cat >> $IFCFGFILE << EOF
|
||||
IPV6INIT=yes
|
||||
IPV6_AUTOCONF=no
|
||||
IPV6ADDR=$IPADDR/$NETMASK
|
||||
IPV6_DEFAULTGW=$GATEWAY
|
||||
EOF
|
||||
else
|
||||
cat >> $IFCFGFILE << EOF
|
||||
IPADDR=$IPADDR
|
||||
NETMASK=$NETMASK
|
||||
BROADCAST=$BROADCAST
|
||||
GATEWAY=$GATEWAY
|
||||
EOF
|
||||
fi
|
||||
if [ "$ipv6" ]; then
|
||||
DNS1=$(set -- ${DNS/,/ }; echo $1)
|
||||
DNS2=$(set -- ${DNS/,/ }; echo $2)
|
||||
else
|
||||
DNS1=$(set -- ${DNS/:/ }; echo $1)
|
||||
DNS2=$(set -- ${DNS/:/ }; echo $2)
|
||||
fi
|
||||
# real DNS config for NetworkManager to generate /etc/resolv.conf
|
||||
[ "$DNS1" != "" ] && echo "DNS1=$DNS1" >> $IFCFGFILE
|
||||
[ "$DNS2" != "" ] && echo "DNS2=$DNS2" >> $IFCFGFILE
|
||||
# just to please loader's readNetInfo && writeEnabledNetInfo
|
||||
# which eats DNS1,DNS2,... and generates it themselves based on DNS
|
||||
if [ "$ipv6" ]; then
|
||||
[ "$DNS" != "" ] && echo "DNS=\"$DNS\"" >> $IFCFGFILE
|
||||
else
|
||||
[ "$DNS" != "" ] && echo "DNS=\"${DNS/:/,}\"" >> $IFCFGFILE
|
||||
fi
|
||||
# colons in SEARCHDNS already replaced with spaces above for /etc/resolv.conf
|
||||
[ "$SEARCHDNS" != "" ] && echo "DOMAIN=\"$SEARCHDNS\"" >> $IFCFGFILE
|
||||
[ "$NETTYPE" != "" ] && echo "NETTYPE=$NETTYPE" >> $IFCFGFILE
|
||||
[ "$PEERID" != "" ] && echo "PEERID=$PEERID" >> $IFCFGFILE
|
||||
[ "$PORTNAME" != "" ] && echo "PORTNAME=$PORTNAME" >> $IFCFGFILE
|
||||
[ "$CTCPROT" != "" ] && echo "CTCPROT=$CTCPROT" >> $IFCFGFILE
|
||||
[ "$MACADDR" != "" ] && echo "MACADDR=$MACADDR" >> $IFCFGFILE
|
||||
optstr=""
|
||||
for option in LAYER2 PORTNO; do
|
||||
[ -z "${!option}" ] && continue
|
||||
[ -n "$optstr" ] && optstr=${optstr}" "
|
||||
optstr=${optstr}$(echo ${option} | tr [[:upper:]] [[:lower:]])"="${!option}
|
||||
done
|
||||
# write single quotes since network.py removes double quotes but we need quotes
|
||||
echo "OPTIONS='$optstr'" >> $IFCFGFILE
|
||||
unset option
|
||||
unset optstr
|
||||
unset DNS1
|
||||
unset DNS2
|
||||
echo "files /etc/sysconfig/network-scripts" >> /run/initramfs/rwtab
|
||||
echo "files /var/lib/dhclient" >> /run/initramfs/rwtab
|
||||
}
|
||||
|
||||
[ -f /tmp/cms.conf ] && cms_write_config
|
41
modules.d/80cms/cmsifup.sh
Executable file
41
modules.d/80cms/cmsifup.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
# -*- 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
|
||||
|
||||
DEVICE=$1
|
||||
|
||||
. /tmp/cms.conf
|
||||
|
||||
strstr "$IPADDR" '*:*:*' && ipv6=1
|
||||
|
||||
if [ "$ipv6" ] && ! str_starts "$IPADDR" "["; then
|
||||
IPADDR="[$IPADDR]"
|
||||
fi
|
||||
|
||||
if [ "$ipv6" ] && ! str_starts "$GATEWAY" "["; then
|
||||
GATEWAY="[$GATEWAY]"
|
||||
fi
|
||||
|
||||
if [ "$ipv6" ]; then
|
||||
DNS1=$(set -- ${DNS/,/ }; echo $1)
|
||||
DNS2=$(set -- ${DNS/,/ }; echo $2)
|
||||
else
|
||||
DNS1=$(set -- ${DNS/:/ }; echo $1)
|
||||
DNS2=$(set -- ${DNS/:/ }; echo $2)
|
||||
fi
|
||||
|
||||
{
|
||||
echo "ip=$IPADDR::$GATEWAY:$NETMASK:$HOSTNAME:$DEVICE:none:$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"
|
||||
echo "$IFACES" >> /tmp/net.ifaces
|
||||
|
||||
ifup $DEVICE -m
|
200
modules.d/80cms/cmssetup.sh
Executable file
200
modules.d/80cms/cmssetup.sh
Executable file
@@ -0,0 +1,200 @@
|
||||
#!/bin/bash
|
||||
# -*- 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
|
||||
|
||||
function sysecho () {
|
||||
file="$1"
|
||||
shift
|
||||
local i=1
|
||||
while [ $i -le 10 ] ; do
|
||||
if [ ! -f "$file" ]; then
|
||||
sleep 1
|
||||
i=$((i+1))
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
local status
|
||||
read status < "$file"
|
||||
if [[ ! $status == $* ]]; then
|
||||
[ -f "$file" ] && echo $* > "$file"
|
||||
fi
|
||||
}
|
||||
|
||||
function dasd_settle() {
|
||||
local dasd_status=/sys/bus/ccw/devices/$1/status
|
||||
if [ ! -f $dasd_status ]; then
|
||||
return 1
|
||||
fi
|
||||
local i=1
|
||||
while [ $i -le 60 ] ; do
|
||||
local status
|
||||
read status < $dasd_status
|
||||
case $status in
|
||||
online|unformatted)
|
||||
return 0 ;;
|
||||
*)
|
||||
sleep 0.1
|
||||
i=$((i+1)) ;;
|
||||
esac
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
function dasd_settle_all() {
|
||||
for dasdccw in $(while read line; do echo ${line%%(*}; done < /proc/dasd/devices) ; do
|
||||
if ! dasd_settle $dasdccw ; then
|
||||
echo $"Could not access DASD $dasdccw in time"
|
||||
return 1
|
||||
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
|
||||
}
|
||||
|
||||
# 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
|
||||
# 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
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
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
|
||||
|
||||
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"
|
||||
#return 1
|
||||
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
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
[[ -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
|
||||
|
||||
znet_cio_free
|
||||
fi
|
||||
|
||||
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=")
|
||||
|
||||
# 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
|
||||
fi
|
||||
fi
|
38
modules.d/80cms/module-setup.sh
Executable file
38
modules.d/80cms/module-setup.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
arch=$(uname -m)
|
||||
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
|
||||
return 255
|
||||
}
|
||||
|
||||
depends() {
|
||||
arch=$(uname -m)
|
||||
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
|
||||
echo znet zfcp dasd dasd_mod
|
||||
return 0
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
instmods zfcp
|
||||
}
|
||||
|
||||
install() {
|
||||
inst_hook pre-trigger 30 "$moddir/cmssetup.sh"
|
||||
inst_hook pre-pivot 95 "$moddir/cms-write-ifcfg.sh"
|
||||
inst "$moddir/cmsifup.sh" /sbin/cmsifup
|
||||
inst /etc/cmsfs-fuse/filetypes.conf
|
||||
inst /etc/udev/rules.d/99-fuse.rules
|
||||
inst /etc/fuse.conf
|
||||
|
||||
for file in $(rpm -ql s390utils-base); do
|
||||
[[ -f $file ]] && inst $file
|
||||
done
|
||||
|
||||
inst_libdir_file "gconv/*"
|
||||
#inst /usr/lib/locale/locale-archive
|
||||
|
||||
dracut_install cmsfs-fuse fusermount ulockmgr_server bash tr insmod rmmod cat normalize_dasd_arg
|
||||
}
|
@@ -4,15 +4,21 @@
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
if [ -e /dev/root ]; then
|
||||
if strstr "$(udevadm info --query=env --name=/dev/root)" "ID_FS_TYPE=btrfs"; then
|
||||
info "Checking, if btrfs device complete"
|
||||
unset __btrfs_mount
|
||||
mount -o ro /dev/root /tmp >/dev/null 2>&1
|
||||
__btrfs_mount=$?
|
||||
[ $__btrfs_mount -eq 0 ] && umount /dev/root >/dev/null 2>&1
|
||||
exit $__btrfs_mount
|
||||
fi
|
||||
fi
|
||||
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"
|
||||
unset __btrfs_mount
|
||||
mount -o ro "$_dev" /tmp >/dev/null 2>&1
|
||||
__btrfs_mount=$?
|
||||
[ $__btrfs_mount -eq 0 ] && umount "$_dev" >/dev/null 2>&1
|
||||
return $__btrfs_mount
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
exit 0
|
||||
btrfs_check_complete $1
|
||||
exit $?
|
||||
|
@@ -11,14 +11,14 @@ check() {
|
||||
. $dracutfunctions
|
||||
[[ $debug ]] && set -x
|
||||
|
||||
is_btrfs() { get_fs_type /dev/block/$1 | grep -q btrfs; }
|
||||
|
||||
if [[ $hostonly ]]; then
|
||||
_rootdev=$(find_root_block_device)
|
||||
if [[ $_rootdev ]]; then
|
||||
is_btrfs "$_rootdev" || return 1
|
||||
fi
|
||||
fi
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
local _found
|
||||
for fs in ${host_fs_types[@]}; do
|
||||
strstr "$fs" "\|btrfs" && _found="1"
|
||||
done
|
||||
[[ $_found ]] || return 1
|
||||
unset _found
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
@@ -29,7 +29,7 @@ depends() {
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
instmods btrfs
|
||||
instmods btrfs crc32c
|
||||
}
|
||||
|
||||
install() {
|
||||
|
@@ -4,7 +4,7 @@
|
||||
# close everything which is not busy
|
||||
rm -f /etc/udev/rules.d/70-luks.rules >/dev/null 2>&1
|
||||
|
||||
if ! getarg rd.luks.uuid rd_LUKS_UUID && getargbool 1 rd.luks -n rd_NO_LUKS; then
|
||||
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
|
||||
while true; do
|
||||
local do_break="y"
|
||||
for i in /dev/mapper/luks-*; do
|
||||
|
39
modules.d/90crypt/crypt-lib.sh
Normal file → Executable file
39
modules.d/90crypt/crypt-lib.sh
Normal file → Executable file
@@ -47,7 +47,7 @@ ask_for_password() {
|
||||
|
||||
{ flock -s 9;
|
||||
# Prompt for password with plymouth, if installed and running.
|
||||
if [ -x /bin/plymouth ]; then
|
||||
if [ -x /bin/plymouth ] && /bin/plymouth --ping; then
|
||||
/bin/plymouth ask-for-password \
|
||||
--prompt "$ply_prompt" --number-of-tries=$ply_tries \
|
||||
--command="$ply_cmd"
|
||||
@@ -100,43 +100,6 @@ test_dev() {
|
||||
return $ret
|
||||
}
|
||||
|
||||
# Get kernel name for given device. Device may be the name too (then the same
|
||||
# is returned), a symlink (full path), UUID (prefixed with "UUID=") or label
|
||||
# (prefixed with "LABEL="). If just a beginning of the UUID is specified or
|
||||
# even an empty, function prints all device names which UUIDs match - every in
|
||||
# single line.
|
||||
#
|
||||
# NOTICE: The name starts with "/dev/".
|
||||
#
|
||||
# Example:
|
||||
# devnames UUID=123
|
||||
# May print:
|
||||
# /dev/dm-1
|
||||
# /dev/sdb1
|
||||
# /dev/sdf3
|
||||
devnames() {
|
||||
local dev="$1"; local d; local names
|
||||
|
||||
case "$dev" in
|
||||
UUID=*)
|
||||
dev="$(foreach_uuid_until '! blkid -U $___' "${dev#UUID=}")" \
|
||||
&& return 255
|
||||
[ -z "$dev" ] && return 255
|
||||
;;
|
||||
LABEL=*) dev="$(blkid -L "${dev#LABEL=}")" || return 255 ;;
|
||||
/dev/?*) ;;
|
||||
*) return 255 ;;
|
||||
esac
|
||||
|
||||
for d in $dev; do
|
||||
names="$names
|
||||
$(readlink -e -q "$d")" || return 255
|
||||
done
|
||||
|
||||
echo "${names#
|
||||
}"
|
||||
}
|
||||
|
||||
# match_dev devpattern dev
|
||||
#
|
||||
# Returns true if 'dev' matches 'devpattern'. Both 'devpattern' and 'dev' are
|
||||
|
@@ -22,6 +22,9 @@ NEWROOT=${NEWROOT:-"/sysroot"}
|
||||
# default luksname - luks-UUID
|
||||
luksname=$2
|
||||
|
||||
# fallback to passphrase
|
||||
ask_passphrase=1
|
||||
|
||||
# if device name is /dev/dm-X, convert to /dev/mapper/name
|
||||
if [ "${1##/dev/dm-}" != "$1" ]; then
|
||||
device="/dev/mapper/$(dmsetup info -c --noheadings -o name "$1")"
|
||||
@@ -29,9 +32,12 @@ else
|
||||
device="$1"
|
||||
fi
|
||||
|
||||
# number of tries
|
||||
numtries=${3:-10}
|
||||
|
||||
# TODO: improve to support what cmdline does
|
||||
if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -n rd_NO_CRYPTTAB; then
|
||||
while read name dev rest; do
|
||||
while read name dev luksfile luksoptions; do
|
||||
# ignore blank lines and comments
|
||||
if [ -z "$name" -o "${name#\#}" != "$name" ]; then
|
||||
continue
|
||||
@@ -54,34 +60,91 @@ if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -n rd_NO_CRYPTTAB; then
|
||||
fi
|
||||
fi
|
||||
done < /etc/crypttab
|
||||
unset name dev rest
|
||||
unset name dev
|
||||
fi
|
||||
|
||||
#
|
||||
# Open LUKS device
|
||||
#
|
||||
|
||||
info "luksOpen $device $luksname"
|
||||
info "luksOpen $device $luksname $luksfile $luksoptions"
|
||||
|
||||
if [ -n "$(getarg rd.luks.key)" ]; then
|
||||
if tmp=$(getkey /tmp/luks.keys $device); then
|
||||
keydev="${tmp%%:*}"
|
||||
keypath="${tmp#*:}"
|
||||
else
|
||||
info "No key found for $device. Will try later."
|
||||
initqueue --unique --onetime --settled \
|
||||
--name cryptroot-ask-$luksname \
|
||||
$(command -v cryptroot-ask) "$@"
|
||||
exit 0
|
||||
OLD_IFS="$IFS"
|
||||
IFS=,
|
||||
set -- $luksoptions
|
||||
IFS="$OLD_IFS"
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
noauto)
|
||||
# skip this
|
||||
exit 0
|
||||
;;
|
||||
swap)
|
||||
# skip this
|
||||
exit 0
|
||||
;;
|
||||
tmp)
|
||||
# skip this
|
||||
exit 0
|
||||
;;
|
||||
allow-discards)
|
||||
allowdiscards="--allow-discards"
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# parse for allow-discards
|
||||
if strstr "$(cryptsetup --help)" "allow-discards"; then
|
||||
if discarduuids=$(getargs "rd.luks.allow-discards"); then
|
||||
if strstr " $discarduuids " " ${luksdev##luks-}"; then
|
||||
allowdiscards="--allow-discards"
|
||||
fi
|
||||
elif getargbool rd.luks.allow-discards; then
|
||||
allowdiscards="--allow-discards"
|
||||
fi
|
||||
unset tmp
|
||||
fi
|
||||
|
||||
info "Using '$keypath' on '$keydev'"
|
||||
readkey "$keypath" "$keydev" "$device" \
|
||||
| cryptsetup -d - luksOpen "$device" "$luksname"
|
||||
unset keypath keydev
|
||||
if strstr "$(cryptsetup --help)" "allow-discards"; then
|
||||
cryptsetupopts="$cryptsetupopts $allowdiscards"
|
||||
fi
|
||||
|
||||
unset allowdiscards
|
||||
|
||||
if [ -n "$luksfile" -a "$luksfile" != "none" -a -e "$luksfile" ]; then
|
||||
if cryptsetup --key-file "$luksfile" $cryptsetupopts luksOpen "$device" "$luksname"; then
|
||||
ask_passphrase=0
|
||||
fi
|
||||
else
|
||||
luks_open="$(command -v cryptsetup) luksOpen"
|
||||
while [ -n "$(getarg rd.luks.key)" ]; do
|
||||
if tmp=$(getkey /tmp/luks.keys $device); then
|
||||
keydev="${tmp%%:*}"
|
||||
keypath="${tmp#*:}"
|
||||
else
|
||||
if [ $numtries -eq 0 ]; then
|
||||
warn "No key found for $device. Fallback to passphrase mode."
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
info "No key found for $device. Will try $numtries time(s) more later."
|
||||
initqueue --unique --onetime --settled \
|
||||
--name cryptroot-ask-$luksname \
|
||||
$(command -v cryptroot-ask) "$device" "$luksname" "$(($numtries-1))"
|
||||
exit 0
|
||||
fi
|
||||
unset tmp
|
||||
|
||||
info "Using '$keypath' on '$keydev'"
|
||||
readkey "$keypath" "$keydev" "$device" \
|
||||
| cryptsetup -d - $cryptsetupopts luksOpen "$device" "$luksname"
|
||||
unset keypath keydev
|
||||
ask_passphrase=0
|
||||
break
|
||||
done
|
||||
fi
|
||||
|
||||
if [ $ask_passphrase -ne 0 ]; then
|
||||
luks_open="$(command -v cryptsetup) $cryptsetupopts luksOpen"
|
||||
ask_for_password --ply-tries 5 \
|
||||
--ply-cmd "$luks_open -T1 $device $luksname" \
|
||||
--ply-prompt "Password ($device)" \
|
||||
@@ -90,11 +153,12 @@ else
|
||||
unset luks_open
|
||||
fi
|
||||
|
||||
unset device luksname
|
||||
unset device luksname luksfile
|
||||
|
||||
# mark device as asked
|
||||
>> /tmp/cryptroot-asked-$2
|
||||
|
||||
need_shutdown
|
||||
udevsettle
|
||||
|
||||
exit 0
|
||||
|
@@ -9,18 +9,25 @@ check() {
|
||||
|
||||
. $dracutfunctions
|
||||
|
||||
is_crypt() { [[ $(get_fs_type /dev/block/$1) = crypto_LUKS ]]; }
|
||||
|
||||
[[ $hostonly ]] && {
|
||||
_rootdev=$(find_root_block_device)
|
||||
if [[ $_rootdev ]]; then
|
||||
# root lives on a block device, so we can be more precise about
|
||||
# hostonly checking
|
||||
check_block_and_slaves is_crypt "$_rootdev" || return 1
|
||||
else
|
||||
# root is not on a block device, use the shotgun approach
|
||||
blkid | grep -q crypto\?_LUKS || return 1
|
||||
check_crypt() {
|
||||
local dev=$1 fs=$2
|
||||
[[ $fs = "crypto_LUKS" ]] || return 1
|
||||
ID_FS_UUID=$(udevadm info --query=property --name=$dev \
|
||||
| while read line; do
|
||||
[[ ${line#ID_FS_UUID} = $line ]] && continue
|
||||
eval "$line"
|
||||
echo $ID_FS_UUID
|
||||
break
|
||||
done)
|
||||
[[ ${ID_FS_UUID} ]] || return 1
|
||||
if ! [[ $kernel_only ]]; then
|
||||
echo " rd.luks.uuid=luks-${ID_FS_UUID} " >> "${initdir}/etc/cmdline.d/90crypt.conf"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for_each_host_dev_fs check_crypt || return 1
|
||||
}
|
||||
|
||||
return 0
|
||||
@@ -41,7 +48,7 @@ install() {
|
||||
inst "$moddir"/probe-keydev.sh /sbin/probe-keydev
|
||||
inst_hook cmdline 10 "$moddir/parse-keydev.sh"
|
||||
inst_hook cmdline 30 "$moddir/parse-crypt.sh"
|
||||
inst_hook pre-pivot 30 "$moddir/crypt-cleanup.sh"
|
||||
inst_hook cleanup 30 "$moddir/crypt-cleanup.sh"
|
||||
inst_simple /etc/crypttab
|
||||
inst "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh"
|
||||
}
|
||||
|
@@ -11,6 +11,7 @@ else
|
||||
} > /etc/udev/rules.d/70-luks.rules.new
|
||||
|
||||
LUKS=$(getargs rd.luks.uuid rd_LUKS_UUID)
|
||||
tout=$(getarg rd.luks.key.tout)
|
||||
|
||||
if [ -n "$LUKS" ]; then
|
||||
for luksid in $LUKS; do
|
||||
@@ -20,11 +21,14 @@ else
|
||||
printf -- 'ENV{ID_FS_UUID}=="*%s*", ' $luksid
|
||||
printf -- 'RUN+="%s --unique --onetime ' $(command -v initqueue)
|
||||
printf -- '--name cryptroot-ask-%%k %s ' $(command -v cryptroot-ask)
|
||||
printf -- '$env{DEVNAME} luks-$env{ID_FS_UUID}"\n'
|
||||
printf -- '$env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $tout
|
||||
} >> /etc/udev/rules.d/70-luks.rules.new
|
||||
|
||||
printf -- '[ -e /dev/disk/by-uuid/*%s* ]\n' $luksid \
|
||||
uuid=$luksid
|
||||
while [ "$uuid" != "${uuid#*-}" ]; do uuid=${uuid%%-*}${uuid#*-}; done
|
||||
printf -- '[ -e /dev/disk/by-id/dm-uuid-CRYPT-LUKS?-*%s*-* ] || exit 1\n' $uuid \
|
||||
>> $hookdir/initqueue/finished/90-crypt.sh
|
||||
|
||||
{
|
||||
printf -- '[ -e /dev/disk/by-uuid/*%s* ] || ' $luksid
|
||||
printf -- 'warn "crypto LUKS UUID "%s" not found"\n' $luksid
|
||||
@@ -34,7 +38,7 @@ else
|
||||
{
|
||||
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' $(command -v initqueue)
|
||||
printf -- '--unique --onetime --name cryptroot-ask-%%k '
|
||||
printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID}"\n' $(command -v cryptroot-ask)
|
||||
printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' $(command -v cryptroot-ask) $tout
|
||||
} >> /etc/udev/rules.d/70-luks.rules.new
|
||||
fi
|
||||
|
||||
|
0
modules.d/90crypt/parse-keydev.sh
Normal file → Executable file
0
modules.d/90crypt/parse-keydev.sh
Normal file → Executable file
0
modules.d/90dm/dm-shutdown.sh
Normal file → Executable file
0
modules.d/90dm/dm-shutdown.sh
Normal file → Executable file
@@ -22,9 +22,7 @@ install() {
|
||||
|
||||
type -P dmeventd >/dev/null && dracut_install dmeventd
|
||||
|
||||
for _i in {"$libdir","$usrlibdir"}/libdmraid-events*.so; do
|
||||
[ -e "$_i" ] && dracut_install "$_i"
|
||||
done
|
||||
inst_libdir_file "libdevmapper-event.so*"
|
||||
|
||||
inst_rules 10-dm.rules 13-dm-disk.rules 95-dm-notify.rules
|
||||
# Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules
|
||||
|
@@ -10,6 +10,7 @@ ENV{ID_FS_TYPE}=="linux_raid_member", GOTO="dm_end"
|
||||
ENV{ID_FS_TYPE}!="*_raid_member", , GOTO="dm_end"
|
||||
|
||||
ENV{ID_FS_TYPE}=="isw_raid_member", ENV{rd_NO_MDIMSM}!="?*", GOTO="dm_end"
|
||||
ENV{ID_FS_TYPE}=="ddf_raid_member", ENV{rd_NO_MDDDF}!="?*", GOTO="dm_end"
|
||||
|
||||
ENV{rd_NO_DM}=="?*", GOTO="dm_end"
|
||||
|
||||
|
@@ -40,3 +40,4 @@ else
|
||||
done
|
||||
fi
|
||||
|
||||
need_shutdown
|
||||
|
@@ -11,19 +11,37 @@ check() {
|
||||
. $dracutfunctions
|
||||
[[ $debug ]] && set -x
|
||||
|
||||
is_dmraid() { get_fs_type /dev/block/$1 |grep -v linux_raid_member | \
|
||||
grep -q _raid_member; }
|
||||
check_dmraid() {
|
||||
local dev=$1 fs=$2 holder DEVPATH DM_NAME
|
||||
[[ "$fs" = "${fs%%_raid_member}" ]] && return 1
|
||||
|
||||
[[ $hostonly ]] && {
|
||||
_rootdev=$(find_root_block_device)
|
||||
if [[ $_rootdev ]]; then
|
||||
# root lives on a block device, so we can be more precise about
|
||||
# hostonly checking
|
||||
check_block_and_slaves is_dmraid "$_rootdev" || return 1
|
||||
else
|
||||
# root is not on a block device, use the shotgun approach
|
||||
dmraid -r | grep -q ok || return 1
|
||||
DEVPATH=$(udevadm info --query=property --name=$dev \
|
||||
| while read line; do
|
||||
[[ ${line#DEVPATH} = $line ]] && continue
|
||||
eval "$line"
|
||||
echo $DEVPATH
|
||||
break
|
||||
done)
|
||||
for holder in /sys/$DEVPATH/holders/*; do
|
||||
[[ -e $holder ]] || continue
|
||||
DM_NAME=$(udevadm info --query=property --path=$holder \
|
||||
| while read line; do
|
||||
[[ ${line#DM_NAME} = $line ]] && continue
|
||||
eval "$line"
|
||||
echo $DM_NAME
|
||||
break
|
||||
done)
|
||||
done
|
||||
|
||||
[[ ${DM_NAME} ]] || return 1
|
||||
if ! [[ $kernel_only ]]; then
|
||||
echo " rd.dm.uuid=${DM_NAME} " >> "${initdir}/etc/cmdline.d/90dmraid.conf"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for_each_host_dev_fs check_dmraid || return 1
|
||||
}
|
||||
|
||||
return 0
|
||||
@@ -40,9 +58,9 @@ install() {
|
||||
|
||||
inst "$moddir/dmraid.sh" /sbin/dmraid_scan
|
||||
|
||||
if [ ! -x /lib/udev/vol_id ]; then
|
||||
inst_rules 64-md-raid.rules
|
||||
fi
|
||||
inst_rules 64-md-raid.rules
|
||||
|
||||
inst_libdir_file "libdmraid-events*.so*"
|
||||
|
||||
inst_rules "$moddir/61-dmraid-imsm.rules"
|
||||
#inst "$moddir/dmraid-cleanup.sh" /sbin/dmraid-cleanup
|
||||
|
@@ -12,3 +12,7 @@ if ! command -v mdadm >/dev/null || ! getargbool 1 rd.md.imsm -n rd_NO_MDIMSM |
|
||||
udevproperty rd_NO_MDIMSM=1
|
||||
fi
|
||||
|
||||
if ! command -v mdadm >/dev/null || ! getargbool 1 rd.md.ddf -n rd_NO_MDDDF || getarg noddfmd; then
|
||||
info "rd.md.ddf=0: no MD RAID for SNIA ddf raids"
|
||||
udevproperty rd_NO_MDDDF=1
|
||||
fi
|
||||
|
@@ -1,7 +1,15 @@
|
||||
#!/bin/sh
|
||||
if [ -b /dev/mapper/live-rw ]; then
|
||||
if [ "`echo /updates/*`" != "/updates/*" ]; then
|
||||
echo "Applying updates to live image..."
|
||||
/bin/cp -a /updates/* $NEWROOT
|
||||
fi
|
||||
|
||||
if [ -b /dev/mapper/live-rw ] && [ -d /updates ]; then
|
||||
info "Applying updates to live image..."
|
||||
# avoid overwriting symlinks (e.g. /lib -> /usr/lib) with directories
|
||||
(
|
||||
cd /updates
|
||||
find . -depth -type d | while read dir; do
|
||||
[ -d "$NEWROOT/$dir" ] || mkdir -p "$NEWROOT/$dir"
|
||||
done
|
||||
find . -depth \! -type d | while read file; do
|
||||
cp -a "$file" "$NEWROOT/$file"
|
||||
done
|
||||
)
|
||||
fi
|
||||
|
@@ -3,24 +3,17 @@
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
case "$root" in
|
||||
live:/dev/*)
|
||||
{
|
||||
printf 'KERNEL=="%s", SYMLINK+="live"\n' \
|
||||
${root#live:/dev/}
|
||||
printf 'SYMLINK=="%s", SYMLINK+="live"\n' \
|
||||
${root#live:/dev/}
|
||||
} >> $UDEVRULESD/99-live-mount.rules
|
||||
{
|
||||
printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
|
||||
${root#live:/dev/}
|
||||
printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
|
||||
${root#live:/dev/}
|
||||
} >> $UDEVRULESD/99-live-squash.rules
|
||||
echo '[ -e /dev/root ]' > $hookdir/initqueue/finished/dmsquash.sh
|
||||
} >> /etc/udev/rules.d/99-live-squash.rules
|
||||
wait_for_dev "${root#live:}"
|
||||
;;
|
||||
live:*)
|
||||
if [ -f "${root#live:}" ]; then
|
||||
/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root "${root#live:}"
|
||||
echo '[ -e /dev/root ]' > $hookdir/initqueue/finished/dmsquash.sh
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
@@ -3,7 +3,7 @@
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
[ -f /tmp/root.info ] && . /tmp/root.info
|
||||
type det_fs >/dev/null 2>&1 || . /lib/fs-lib.sh
|
||||
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
@@ -33,7 +33,7 @@ fi
|
||||
getarg rd.live.check check || check=""
|
||||
if [ -n "$check" ]; then
|
||||
[ -x /bin/plymouth ] && /bin/plymouth --hide-splash
|
||||
checkisomd5 --verbose $livedev || :
|
||||
checkisomd5 --verbose $livedev
|
||||
if [ $? -ne 0 ]; then
|
||||
die "CD check failed!"
|
||||
exit 1
|
||||
@@ -41,11 +41,11 @@ if [ -n "$check" ]; then
|
||||
[ -x /bin/plymouth ] && /bin/plymouth --show-splash
|
||||
fi
|
||||
|
||||
ln -s $livedev /run/initramfs/livedev
|
||||
|
||||
# determine filesystem type for a filesystem image
|
||||
det_img_fs() {
|
||||
local _img="$1" _loop=$(losetup -f) _fs
|
||||
losetup $_loop $_img; _fs=$(det_fs $_loop); losetup -d $_loop
|
||||
echo $_fs
|
||||
blkid -s TYPE -u noraid -o value "$1"
|
||||
}
|
||||
|
||||
for arg in $CMDLINE; do case $arg in ro|rw) liverw=$arg ;; esac; done
|
||||
@@ -54,11 +54,13 @@ mkdir -m 0755 -p /run/initramfs/live
|
||||
if [ -f $livedev ]; then
|
||||
# no mount needed - we've already got the LiveOS image in initramfs
|
||||
# check filesystem type and handle accordingly
|
||||
case `det_img_fs $livedev` in
|
||||
squashfs) SQUASHED=$livedev ;;
|
||||
fstype=$(det_img_fs $livedev)
|
||||
case $fstype in
|
||||
squashfs) SQUASHED=$livedev;;
|
||||
auto) die "cannot mount live image (unknown filesystem type)" ;;
|
||||
*) FSIMG=$livedev ;;
|
||||
esac
|
||||
[ -e /sys/fs/$fstype ] || modprobe $fstype
|
||||
else
|
||||
mount -n -t $fstype -o ${liverw:-ro} $livedev /run/initramfs/live
|
||||
if [ "$?" != "0" ]; then
|
||||
@@ -198,7 +200,12 @@ if [ -n "$ROOTFLAGS" ]; then
|
||||
ROOTFLAGS="-o $ROOTFLAGS"
|
||||
fi
|
||||
|
||||
if [ -b "$BASE_LOOPDEV" ]; then
|
||||
ln -s $BASE_LOOPDEV /run/initramfs/live-baseloop
|
||||
fi
|
||||
ln -s /dev/mapper/live-rw /dev/root
|
||||
printf '/bin/mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > $hookdir/mount/01-$$-live.sh
|
||||
printf 'mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > $hookdir/mount/01-$$-live.sh
|
||||
|
||||
need_shutdown
|
||||
|
||||
exit 0
|
@@ -6,5 +6,4 @@ if [ "${root%%:*}" = "liveiso" ]; then
|
||||
printf 'KERNEL=="loop0", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root `/sbin/losetup -f --show %s`"\n' \
|
||||
${root#liveiso:}
|
||||
} >> /etc/udev/rules.d/99-liveiso-mount.rules
|
||||
echo '[ -e /dev/root ]' > $hookdir/initqueue/finished/dmsquash.sh
|
||||
fi
|
||||
|
@@ -5,7 +5,7 @@
|
||||
check() {
|
||||
# a live host-only image doesn't really make a lot of sense
|
||||
[[ $hostonly ]] && return 1
|
||||
return 0
|
||||
return 255
|
||||
}
|
||||
|
||||
depends() {
|
||||
@@ -16,7 +16,7 @@ depends() {
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
instmods squashfs
|
||||
instmods squashfs loop
|
||||
}
|
||||
|
||||
install() {
|
||||
@@ -35,7 +35,7 @@ install() {
|
||||
inst_hook pre-udev 30 "$moddir/dmsquash-live-genrules.sh"
|
||||
inst_hook pre-udev 30 "$moddir/dmsquash-liveiso-genrules.sh"
|
||||
inst_hook pre-pivot 20 "$moddir/apply-live-updates.sh"
|
||||
inst "$moddir/dmsquash-live-root" "/sbin/dmsquash-live-root"
|
||||
inst "$moddir/dmsquash-live-root.sh" "/sbin/dmsquash-live-root"
|
||||
# should probably just be generally included
|
||||
inst_rules 60-cdrom_id.rules
|
||||
}
|
||||
|
@@ -17,6 +17,8 @@ fi
|
||||
|
||||
[ "${liveroot%%:*}" = "live" ] || return
|
||||
|
||||
modprobe -q loop
|
||||
|
||||
case "$liveroot" in
|
||||
live:LABEL=*|LABEL=*) \
|
||||
root="${root#live:}"
|
||||
@@ -41,7 +43,9 @@ case "$liveroot" in
|
||||
live:/*.[Ii][Mm][Gg]|/*.[Ii][Mm][Gg])
|
||||
[ -f "${root#live:}" ] && rootok=1 ;;
|
||||
esac
|
||||
info "root was $root, liveroot is now $liveroot"
|
||||
info "root was $liveroot, is now $root"
|
||||
|
||||
# make sure that init doesn't complain
|
||||
[ -z "$root" ] && root="live"
|
||||
|
||||
wait_for_dev /dev/mapper/live-rw
|
||||
|
@@ -4,60 +4,89 @@
|
||||
|
||||
installkernel() {
|
||||
if [[ -z $drivers ]]; then
|
||||
block_module_test() {
|
||||
local blockfuncs='ahci_init_controller|ata_scsi_ioctl|scsi_add_host|blk_init_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device'
|
||||
|
||||
egrep -q "$blockfuncs" "$1"
|
||||
block_module_filter() {
|
||||
local _blockfuncs='ahci_init_controller|ata_scsi_ioctl|scsi_add_host|blk_init_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect'
|
||||
# subfunctions inherit following FDs
|
||||
local _merge=8 _side2=9
|
||||
function bmf1() {
|
||||
local _f
|
||||
while read _f; do case "$_f" in
|
||||
*.ko) [[ $(< $_f) =~ $_blockfuncs ]] && echo "$_f" ;;
|
||||
*.ko.gz) [[ $(gzip -dc <$_f) =~ $_blockfuncs ]] && echo "$_f" ;;
|
||||
*.ko.xz) [[ $(xz -dc <$_f) =~ $_blockfuncs ]] && echo "$_f" ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
function rotor() {
|
||||
local _f1 _f2
|
||||
while read _f1; do
|
||||
echo "$_f1"
|
||||
if read _f2; then
|
||||
echo "$_f2" 1>&${_side2}
|
||||
fi
|
||||
done | bmf1 1>&${_merge}
|
||||
}
|
||||
# Use two parallel streams to filter alternating modules.
|
||||
set +x
|
||||
eval "( ( rotor ) ${_side2}>&1 | bmf1 ) ${_merge}>&1"
|
||||
[[ $debug ]] && set -x
|
||||
}
|
||||
hostonly='' instmods sr_mod sd_mod scsi_dh scsi_dh_rdac scsi_dh_emc
|
||||
hostonly='' instmods sr_mod sd_mod scsi_dh scsi_dh_rdac scsi_dh_emc ata_piix
|
||||
hostonly='' instmods pcmcia firewire-ohci
|
||||
hostonly='' instmods usb_storage sdhci sdhci-pci
|
||||
|
||||
# arm specific modules
|
||||
hostonly='' instmods sdhci_esdhc_imx mmci sdhci_tegra mvsdio omap sdhci_dove ahci_platform pata_imx sata_mv
|
||||
|
||||
# install keyboard support
|
||||
hostonly='' instmods atkbd i8042 usbhid hid-apple hid-sunplus hid-cherry hid-logitech hid-microsoft ehci-hcd ohci-hcd uhci-hcd
|
||||
hostonly='' instmods atkbd i8042 usbhid hid-apple hid-sunplus hid-cherry hid-logitech hid-logitech-dj hid-microsoft ehci-hcd ohci-hcd uhci-hcd xhci-hcd
|
||||
# install unix socket support
|
||||
hostonly='' instmods unix
|
||||
instmods "=drivers/pcmcia" =ide "=drivers/usb/storage"
|
||||
instmods $(filter_kernel_modules block_module_test)
|
||||
find_kernel_modules | block_module_filter | instmods
|
||||
# if not on hostonly mode, install all known filesystems,
|
||||
# if the required list is not set via the filesystems variable
|
||||
if ! [[ $hostonly ]]; then
|
||||
if [[ -z $filesystems ]]; then
|
||||
instmods '=fs'
|
||||
# hardcoded list of exceptions
|
||||
# to save a lot of space
|
||||
rm -fr ${initdir}/lib/modules/*/kernel/fs/ocfs2
|
||||
omit_drivers="$omit_drivers|kernel/fs/nfs|kernel/fs/nfsd|kernel/fs/lockd" omit_drivers="${omit_drivers##|}" instmods '=fs'
|
||||
fi
|
||||
else
|
||||
hostonly='' instmods $(get_fs_type "/dev/block/$(find_root_block_device)")
|
||||
inst_fs() {
|
||||
[[ $2 ]] || return 1
|
||||
hostonly='' instmods $2
|
||||
}
|
||||
for_each_host_dev_fs inst_fs
|
||||
fi
|
||||
else
|
||||
hostonly='' instmods $drivers
|
||||
fi
|
||||
|
||||
[[ $add_drivers ]] && hostonly='' instmods $add_drivers
|
||||
[[ $filesystems ]] && hostonly='' instmods $filesystems
|
||||
|
||||
# force install of scsi_wait_scan
|
||||
hostonly='' instmods scsi_wait_scan
|
||||
}
|
||||
|
||||
install() {
|
||||
local _f
|
||||
[ -f /etc/modprobe.conf ] && dracut_install /etc/modprobe.conf
|
||||
for i in $(find /etc/modprobe.d/ -type f -name '*.conf'); do
|
||||
inst_simple "$i"
|
||||
done
|
||||
inst_hook cmdline 01 "$moddir/parse-kernel.sh"
|
||||
inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh
|
||||
|
||||
local f
|
||||
if [[ $add_drivers ]]; then
|
||||
hostonly='' instmods -c $add_drivers || return 1
|
||||
fi
|
||||
if [[ $filesystems ]]; then
|
||||
hostonly='' instmods -c $filesystems || return 1
|
||||
fi
|
||||
|
||||
for _f in modules.builtin.bin modules.builtin; do
|
||||
[[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f" \
|
||||
&& break
|
||||
[[ $srcmods/$_f ]] && break
|
||||
done || {
|
||||
dfatal "No modules.builtin.bin and modules.builtin found!"
|
||||
return 1
|
||||
}
|
||||
|
||||
for _f in modules.builtin.bin modules.builtin modules.order; do
|
||||
[[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
install() {
|
||||
local _f i
|
||||
[ -f /etc/modprobe.conf ] && dracut_install /etc/modprobe.conf
|
||||
for i in $(find -L /etc/modprobe.d/ -maxdepth 1 -type f -name '*.conf'); do
|
||||
inst_simple "$i"
|
||||
done
|
||||
inst_hook cmdline 01 "$moddir/parse-kernel.sh"
|
||||
inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh
|
||||
}
|
||||
|
31
modules.d/90livenet/fetch-liveupdate.sh
Executable file
31
modules.d/90livenet/fetch-liveupdate.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/sh
|
||||
# fetch-liveupdate - fetch an update image for dmsquash-live media.
|
||||
# this gets called by the "initqueue/online" hook for each network interface
|
||||
# that comes online.
|
||||
|
||||
# no updates requested? we're not needed.
|
||||
[ -e /tmp/liveupdates.info ] || return 0
|
||||
|
||||
command -v getarg >/dev/null || . /lib/dracut-lib.sh
|
||||
command -v fetch_url >/dev/null || . /lib/url-lib.sh
|
||||
command -v unpack_img >/dev/null || . /lib/img-lib.sh
|
||||
|
||||
read url < /tmp/liveupdates.info
|
||||
|
||||
info "fetching live updates from $url"
|
||||
|
||||
fetch_url "$url" /tmp/updates.img
|
||||
if [ $? != 0 ]; then
|
||||
warn "failed to fetch update image!"
|
||||
warn "url: $url"
|
||||
return 1
|
||||
fi
|
||||
|
||||
unpack_img /tmp/updates.img /updates.tmp.$$
|
||||
if [ $? != 0 ]; then
|
||||
warn "failed to unpack update image!"
|
||||
warn "url: $url"
|
||||
return 1
|
||||
fi
|
||||
copytree /updates.tmp.$$ /updates
|
||||
mv /tmp/liveupdates.info /tmp/liveupdates.done
|
@@ -1,41 +0,0 @@
|
||||
#!/bin/bash
|
||||
# livenetroot - fetch a live image from the network and run it
|
||||
#
|
||||
# TODO:
|
||||
# * HTTPS: arg to use --no-check-certificate with https (boo)
|
||||
# args for --certificate, --ca-certificate
|
||||
# * NFS support?
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
[ -f /tmp/root.info ] && . /tmp/root.info
|
||||
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
# args get passed from 40network/netroot
|
||||
netroot=$2
|
||||
|
||||
liveurl=${netroot#livenet:}
|
||||
|
||||
if [ ${liveurl##*.} == "iso" ]; then
|
||||
imgfile="/run/live.iso"
|
||||
else
|
||||
imgfile="/run/rootfs.img"
|
||||
fi
|
||||
|
||||
|
||||
case "$liveurl" in
|
||||
http://*|https://*|ftp://*)
|
||||
wget -O $imgfile "$liveurl"
|
||||
;;
|
||||
*) die "don't know how to handle URL: $liveurl" ;;
|
||||
esac
|
||||
[ $? == 0 ] || die "failed to download live image"
|
||||
|
||||
|
||||
if [ ${imgfile##*.} == "iso" ]; then
|
||||
root=$(losetup -f)
|
||||
losetup $root $imgfile
|
||||
else
|
||||
root=$imgfile
|
||||
fi
|
||||
exec /sbin/dmsquash-live-root $root
|
25
modules.d/90livenet/livenetroot.sh
Executable file
25
modules.d/90livenet/livenetroot.sh
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
# livenetroot - fetch a live image from the network and run it
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
. /lib/url-lib.sh
|
||||
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
# args get passed from 40network/netroot
|
||||
netroot="$2"
|
||||
liveurl="${netroot#livenet:}"
|
||||
info "fetching $liveurl"
|
||||
imgfile=$(fetch_url "$liveurl")
|
||||
[ $? = 0 ] || die "failed to download live image: error $?"
|
||||
|
||||
# TODO: couldn't dmsquash-live-root handle this?
|
||||
if [ ${imgfile##*.} = "iso" ]; then
|
||||
root=$(losetup -f)
|
||||
losetup $root $imgfile
|
||||
else
|
||||
root=$imgfile
|
||||
fi
|
||||
|
||||
exec /sbin/dmsquash-live-root $root
|
@@ -2,24 +2,17 @@
|
||||
# module-setup.sh for livenet
|
||||
|
||||
check() {
|
||||
# a live, host-only image doesn't really make a lot of sense
|
||||
[[ $hostonly ]] && return 1
|
||||
return 0
|
||||
return 255
|
||||
}
|
||||
|
||||
depends() {
|
||||
echo network dmsquash-live
|
||||
echo network url-lib dmsquash-live
|
||||
return 0
|
||||
}
|
||||
|
||||
install() {
|
||||
dracut_install wget
|
||||
mkdir -m 0755 -p "$initdir/etc/ssl/certs"
|
||||
if ! inst_simple /etc/ssl/certs/ca-bundle.crt; then
|
||||
dwarn "Couldn't find SSL CA cert bundle; HTTPS won't work."
|
||||
fi
|
||||
|
||||
inst_hook cmdline 29 "$moddir/parse-livenet.sh"
|
||||
inst "$moddir/livenetroot" "/sbin/livenetroot"
|
||||
inst_hook initqueue/online 95 "$moddir/fetch-liveupdate.sh"
|
||||
inst "$moddir/livenetroot.sh" "/sbin/livenetroot"
|
||||
}
|
||||
|
||||
|
@@ -1,19 +1,34 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
# live net images - just like live images, but specified like:
|
||||
# root=live:[url-to-backing-file]
|
||||
|
||||
[ -z "$root" ] && root=$(getarg root=)
|
||||
. /lib/url-lib.sh
|
||||
|
||||
str_starts $root "live:" && liveurl=$root
|
||||
str_starts $liveurl "live:" || return
|
||||
# live updates
|
||||
updates=$(getarg live.updates=)
|
||||
if [ -n "$updates" ]; then
|
||||
# make sure network comes up even if we're doing a local live device
|
||||
if [ -z "$netroot" ]; then
|
||||
echo > /tmp/net.ifaces
|
||||
unset CMDLINE
|
||||
fi
|
||||
echo "$updates" > /tmp/liveupdates.info
|
||||
echo '[ -e /tmp/liveupdates.done ]' > \
|
||||
$hookdir/initqueue/finished/liveupdates.sh
|
||||
fi
|
||||
|
||||
str_starts "$root" "live:" && liveurl="$root"
|
||||
str_starts "$liveurl" "live:" || return
|
||||
liveurl="${liveurl#live:}"
|
||||
|
||||
# setting netroot to "livenet:..." makes "livenetroot" get run after ifup
|
||||
case "$liveurl" in
|
||||
http://*|https://*|ftp://*)
|
||||
netroot="livenet:$liveurl"
|
||||
rootok=1 ;;
|
||||
esac
|
||||
|
||||
root="livenet" # quiet complaints from init
|
||||
echo '[ -e /dev/root ]' > $hookdir/initqueue/finished/livenet.sh
|
||||
if get_url_handler "$liveurl" >/dev/null; then
|
||||
info "livenet: root image at $liveurl"
|
||||
netroot="livenet:$liveurl"
|
||||
root="livenet" # quiet complaints from init
|
||||
rootok=1
|
||||
wait_for_dev /dev/root
|
||||
else
|
||||
info "livenet: no url handler for $liveurl"
|
||||
fi
|
||||
|
@@ -13,7 +13,7 @@ PROGRAM=="/bin/sh -c 'for i in $sys/$devpath/holders/dm-[0-9]*; do [ -e $$i ] &&
|
||||
GOTO="lvm_end"
|
||||
|
||||
RUN+="/sbin/initqueue --settled --onetime --unique /sbin/lvm_scan"
|
||||
RUN+="/sbin/initqueue --timeout --onetime --unique /sbin/lvm_scan --partial"
|
||||
RUN+="/sbin/initqueue --timeout --name 51-lvm_scan --onetime --unique /sbin/lvm_scan --partial"
|
||||
RUN+="/bin/sh -c '>/tmp/.lvm_scan-%k;'"
|
||||
|
||||
LABEL="lvm_end"
|
||||
|
@@ -35,10 +35,12 @@ if [ ! -e /etc/lvm/lvm.conf ]; then
|
||||
if [ -n $SNAPSHOT ]; then
|
||||
echo 'global {';
|
||||
echo ' locking_type = 1';
|
||||
echo ' use_lvmetad = 0';
|
||||
echo '}';
|
||||
else
|
||||
echo 'global {';
|
||||
echo ' locking_type = 4';
|
||||
echo ' use_lvmetad = 0';
|
||||
echo '}';
|
||||
fi
|
||||
} > /etc/lvm/lvm.conf
|
||||
@@ -126,3 +128,5 @@ if [ "$lvmwritten" ]; then
|
||||
rm -f /etc/lvm/lvm.conf
|
||||
fi
|
||||
unset lvmwritten
|
||||
|
||||
need_shutdown
|
||||
|
@@ -3,25 +3,29 @@
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
check() {
|
||||
local _rootdev
|
||||
local _rootdev _activated
|
||||
# No point trying to support lvm if the binaries are missing
|
||||
type -P lvm >/dev/null || return 1
|
||||
|
||||
. $dracutfunctions
|
||||
[[ $debug ]] && set -x
|
||||
|
||||
is_lvm() { [[ $(get_fs_type /dev/block/$1) = LVM2_member ]]; }
|
||||
|
||||
[[ $hostonly ]] && {
|
||||
_rootdev=$(find_root_block_device)
|
||||
if [[ $_rootdev ]]; then
|
||||
# root lives on a block device, so we can be more precise about
|
||||
# hostonly checking
|
||||
check_block_and_slaves is_lvm "$_rootdev" || return 1
|
||||
else
|
||||
# root is not on a block device, use the shotgun approach
|
||||
blkid | grep -q LVM2_member || return 1
|
||||
check_lvm() {
|
||||
local DM_VG_NAME DM_LV_NAME DM_UDEV_DISABLE_DISK_RULES_FLAG
|
||||
eval $(udevadm info --query=property --name=$1|egrep '(DM_VG_NAME|DM_LV_NAME|DM_UDEV_DISABLE_DISK_RULES_FLAG)=')
|
||||
[[ "$DM_UDEV_DISABLE_DISK_RULES_FLAG" = "1" ]] && return 1
|
||||
[[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 1
|
||||
if ! strstr " ${_activated[*]} " " ${DM_VG_NAME}/${DM_LV_NAME} "; then
|
||||
if ! [[ $kernel_only ]]; then
|
||||
echo " rd.lvm.lv=${DM_VG_NAME}/${DM_LV_NAME} " >> "${initdir}/etc/cmdline.d/90lvm.conf"
|
||||
fi
|
||||
push _activated "${DM_VG_NAME}/${DM_LV_NAME}"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for_each_host_dev_fs check_lvm || return 1
|
||||
}
|
||||
|
||||
return 0
|
||||
@@ -45,10 +49,11 @@ install() {
|
||||
# FIXME: near-term hack to establish read-only locking;
|
||||
# use command-line lvm.conf editor once it is available
|
||||
sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 4/' ${initdir}/etc/lvm/lvm.conf
|
||||
sed -i -e 's/\(^[[:space:]]*\)use_lvmetad[[:space:]]*=[[:space:]]*[[:digit:]]/\1use_lvmetad = 0/' ${initdir}/etc/lvm/lvm.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
inst_rules 10-dm.rules 13-dm-disk.rules 95-dm-notify.rules 11-dm-lvm.rules
|
||||
inst_rules 11-dm-lvm.rules
|
||||
# Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules
|
||||
# files, but provides the one below:
|
||||
inst_rules 64-device-mapper.rules
|
||||
@@ -56,8 +61,6 @@ install() {
|
||||
inst "$moddir/lvm_scan.sh" /sbin/lvm_scan
|
||||
inst_hook cmdline 30 "$moddir/parse-lvm.sh"
|
||||
|
||||
for _i in {"$libdir","$usrlibdir"}/libdevmapper-event-lvm*.so; do
|
||||
[ -e "$_i" ] && dracut_install "$_i"
|
||||
done
|
||||
inst_libdir_file "libdevmapper-event-lvm*.so"
|
||||
}
|
||||
|
||||
|
@@ -10,12 +10,7 @@ if ! getargbool 1 rd.lvm -n rd_NO_LVM; then
|
||||
rm -f /etc/udev/rules.d/64-lvm*.rules
|
||||
else
|
||||
for dev in $(getargs rd.lvm.vg rd_LVM_VG=) $(getargs rd.lvm.lv rd_LVM_LV=); do
|
||||
printf '[ -e "/dev/%s" ] || return 1\n' $dev \
|
||||
>> $hookdir/initqueue/finished/lvm.sh
|
||||
{
|
||||
printf '[ -e "/dev/%s" ] || ' $dev
|
||||
printf 'warn "LVM "%s" not found"\n' $dev
|
||||
} >> $hookdir/emergency/90-lvm.sh
|
||||
wait_for_dev "/dev/$dev"
|
||||
done
|
||||
fi
|
||||
|
||||
|
@@ -2,87 +2,39 @@
|
||||
# automatically cause mdadm to be run.
|
||||
# See udev(8) for syntax
|
||||
|
||||
ACTION!="add|change", GOTO="md_inc_end"
|
||||
SUBSYSTEM!="block", GOTO="md_inc_end"
|
||||
ENV{ID_FS_TYPE}!="linux_raid_member|isw_raid_member", GOTO="md_inc_end"
|
||||
ACTION!="add|change", GOTO="md_end"
|
||||
SUBSYSTEM!="block", GOTO="md_end"
|
||||
ENV{rd_NO_MD}=="?*", GOTO="md_end"
|
||||
KERNEL=="md*", GOTO="md_end"
|
||||
|
||||
ENV{ID_FS_TYPE}=="isw_raid_member", ENV{rd_NO_MDIMSM}=="?*", GOTO="md_inc_end"
|
||||
ENV{ID_FS_TYPE}=="ddf_raid_member|isw_raid_member|linux_raid_member", GOTO="md_try"
|
||||
GOTO="md_end"
|
||||
|
||||
ENV{rd_NO_MD}=="?*", GOTO="md_inc_end"
|
||||
LABEL="md_try"
|
||||
ENV{ID_FS_TYPE}=="isw_raid_member", ENV{rd_NO_MDIMSM}=="?*", GOTO="md_end"
|
||||
ENV{ID_FS_TYPE}=="ddf_raid_member", ENV{rd_NO_MDDDF}=="?*", GOTO="md_end"
|
||||
|
||||
PROGRAM=="/bin/sh -c 'for i in $sys/$devpath/holders/md[0-9]*; do [ -e $$i ] && exit 0; done; exit 1;' ", \
|
||||
GOTO="md_inc_end"
|
||||
# already done ?
|
||||
PROGRAM="/bin/sh -c 'for i in $sys/$devpath/holders/md[0-9_]*; do [ -e $$i ] && exit 0; done; exit 1;' ", \
|
||||
GOTO="md_end"
|
||||
|
||||
# for native arrays - array's uuid has to be specified
|
||||
# for containers - container's uuid has to be specified
|
||||
# TODO : how to get embedded array's uuid having container's component ?
|
||||
#
|
||||
# UUID CHECK
|
||||
|
||||
ENV{DEVTYPE}!="partition", \
|
||||
RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}"
|
||||
|
||||
KERNEL!="md*", IMPORT{program}="/sbin/mdadm --examine --export $tempnode"
|
||||
|
||||
# UUID CHECK
|
||||
|
||||
LABEL="do_md_inc"
|
||||
RUN+="/sbin/initqueue --timeout --name 50-mdraid_start --onetime --unique /sbin/mdraid_start"
|
||||
|
||||
#
|
||||
# if rd_MDADMCONF do not assemble incrementally
|
||||
# defer auto assembly until the udev queue is settled
|
||||
# Incrementally build the md array; this will automatically assemble
|
||||
# any eventual containers as well (imsm, ddf)
|
||||
#
|
||||
ENV{rd_MDADMCONF}!="?*", GOTO="md_auto_end"
|
||||
LABEL="md_incremental"
|
||||
|
||||
RUN+="/sbin/initqueue --finished --unique --name md_finished /sbin/md_finished.sh"
|
||||
RUN+="/sbin/initqueue --timeout --onetime --unique /sbin/mdadm_auto"
|
||||
RUN+="/sbin/mdadm $env{rd_MD_OFFROOT} -I $env{DEVNAME}"
|
||||
|
||||
GOTO="md_inc_end"
|
||||
|
||||
LABEL="md_auto_end"
|
||||
|
||||
#
|
||||
# Incrementally build the md array
|
||||
#
|
||||
RUN+="/sbin/mdadm -I $env{DEVNAME}"
|
||||
|
||||
RUN+="/sbin/initqueue --finished --unique --name md_finished /sbin/md_finished.sh"
|
||||
|
||||
LABEL="md_inc_end"
|
||||
|
||||
#
|
||||
# Handle non-container raid arrays
|
||||
#
|
||||
ACTION=="add|change", \
|
||||
KERNEL=="md[0-9]*|md/*", \
|
||||
ENV{MD_LEVEL}!="container", \
|
||||
ENV{MD_CONTAINER}!="?*", \
|
||||
ENV{rd_MDADMCONF}!="?*", \
|
||||
ENV{rd_NO_MD}!="?*", \
|
||||
GOTO="do_raidstart"
|
||||
|
||||
GOTO="end_raidstart"
|
||||
|
||||
LABEL="do_raidstart"
|
||||
|
||||
# check if array is not inactive anymore
|
||||
TEST=="md/array_state", ATTR{md/array_state}!="|inactive", GOTO="end_raidstart"
|
||||
|
||||
RUN+="/sbin/initqueue --finished --unique --name md_finished /sbin/md_finished.sh"
|
||||
RUN+="/sbin/initqueue --timeout --onetime --unique /sbin/mdraid_start"
|
||||
|
||||
LABEL="end_raidstart"
|
||||
|
||||
#
|
||||
# Handle container raid arrays
|
||||
#
|
||||
ACTION=="add|change", \
|
||||
KERNEL=="md[0-9]*|md/*", \
|
||||
ENV{DEVTYPE}!="partition", \
|
||||
ENV{MD_LEVEL}=="container", \
|
||||
ENV{rd_MDADMCONF}!="?*", \
|
||||
ENV{rd_NO_MD}!="?*", \
|
||||
GOTO="do_container"
|
||||
|
||||
GOTO="end_container"
|
||||
|
||||
LABEL="do_container"
|
||||
|
||||
RUN+="/sbin/initqueue --finished --unique --name md_finished /sbin/md_finished.sh"
|
||||
RUN+="/sbin/initqueue --timeout --onetime --unique --name mdcontainer_start-%k /sbin/mdcontainer_start $env{DEVNAME}"
|
||||
|
||||
LABEL="end_container"
|
||||
LABEL="md_end"
|
||||
|
@@ -1,9 +1,5 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
for i in lib/dracut/dracut-*; do
|
||||
if [ -f $i ]; then
|
||||
vinfo < $i
|
||||
fi
|
||||
done
|
||||
unset i
|
||||
info "rd.md.ddf=0: no MD RAID for SNIA ddf raids"
|
||||
udevproperty rd_NO_MDDDF=1
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user