Compare commits
828 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b490820a67 | ||
![]() |
3178e5d9e6 | ||
![]() |
7ceaad3400 | ||
![]() |
d8caac65a7 | ||
![]() |
d2846fdcce | ||
![]() |
6414f18c34 | ||
![]() |
77359602a2 | ||
![]() |
e318a113be | ||
![]() |
cba4eac067 | ||
![]() |
6e49e06cfe | ||
![]() |
faa3920f1d | ||
![]() |
44678ee989 | ||
![]() |
386875cc9e | ||
![]() |
ac607d92dc | ||
![]() |
8d32f7965f | ||
![]() |
945b5334ca | ||
![]() |
fa870823fe | ||
![]() |
6b06a771cf | ||
![]() |
89cd64a635 | ||
![]() |
e953f9e688 | ||
![]() |
5b276e8015 | ||
![]() |
0314ef5451 | ||
![]() |
1984bb42e3 | ||
![]() |
417ae3f1ad | ||
![]() |
210431852f | ||
![]() |
82bafb320b | ||
![]() |
a3e2bb4eba | ||
![]() |
6dfff71f85 | ||
![]() |
3860f27881 | ||
![]() |
fa3638a353 | ||
![]() |
cf729a109d | ||
![]() |
7b991e9702 | ||
![]() |
936bd1e05f | ||
![]() |
1e7a5c2617 | ||
![]() |
0aa4e3149f | ||
![]() |
bd49ce86ec | ||
![]() |
75cc5ac016 | ||
![]() |
25c7c10c58 | ||
![]() |
c1b5163c29 | ||
![]() |
a8fb48486c | ||
![]() |
841fc1e3a7 | ||
![]() |
ec3fd83dc1 | ||
![]() |
284c8be768 | ||
![]() |
f3763b75dd | ||
![]() |
9877bf26df | ||
![]() |
20b51b686b | ||
![]() |
d3fd23a1e1 | ||
![]() |
97ff4a0003 | ||
![]() |
3559c0b6cf | ||
![]() |
2822eb855a | ||
![]() |
53c46459df | ||
![]() |
adf1849bf9 | ||
![]() |
197e35b75b | ||
![]() |
ba0b653658 | ||
![]() |
f22abb4b3e | ||
![]() |
f53a0f20fd | ||
![]() |
724674d178 | ||
![]() |
d65cf005bb | ||
![]() |
def98684d4 | ||
![]() |
d1e6cd0f30 | ||
![]() |
d3b8ab7783 | ||
![]() |
f0c92896e7 | ||
![]() |
95dfe9d02b | ||
![]() |
1c5b7848e1 | ||
![]() |
40586a2b7b | ||
![]() |
7ea1b49819 | ||
![]() |
cb9f6af094 | ||
![]() |
faa17f0921 | ||
![]() |
2413fcbc60 | ||
![]() |
a0aeaa381f | ||
![]() |
cfc02869e4 | ||
![]() |
b75196ac27 | ||
![]() |
9a2f5592c5 | ||
![]() |
1d85a6fe6d | ||
![]() |
dd9b5df3b9 | ||
![]() |
afd17a3ec5 | ||
![]() |
dbd8c68b7a | ||
![]() |
a22c502d86 | ||
![]() |
ee2cd169bd | ||
![]() |
9a35a62bf1 | ||
![]() |
93d3f433fe | ||
![]() |
de176906ff | ||
![]() |
b9ec6563e7 | ||
![]() |
76fa8652d2 | ||
![]() |
158fab27b7 | ||
![]() |
81134e54ad | ||
![]() |
77d76bad4d | ||
![]() |
1d71152bd1 | ||
![]() |
754beeddf2 | ||
![]() |
92d595398f | ||
![]() |
85dde6406d | ||
![]() |
7decd80f44 | ||
![]() |
e0459b1e97 | ||
![]() |
64eb996323 | ||
![]() |
991a8728d0 | ||
![]() |
3b4bc498e1 | ||
![]() |
e654485a8e | ||
![]() |
1636712f09 | ||
![]() |
581452062f | ||
![]() |
a2c0b852a0 | ||
![]() |
1cb33f3954 | ||
![]() |
f2c3a039da | ||
![]() |
e1fd8dd119 | ||
![]() |
93950912ea | ||
![]() |
0fa047fcf1 | ||
![]() |
36d52d765e | ||
![]() |
5f99314801 | ||
![]() |
a77208565d | ||
![]() |
a74acc38e2 | ||
![]() |
f52ee9073e | ||
![]() |
9ea87dfdad | ||
![]() |
8485c3205f | ||
![]() |
e92ca555bf | ||
![]() |
ff53445872 | ||
![]() |
dbc92d85f2 | ||
![]() |
90e189b042 | ||
![]() |
8a3fe63a08 | ||
![]() |
0ec43d7a56 | ||
![]() |
3bbd0c7764 | ||
![]() |
00056957bf | ||
![]() |
6bc37a9952 | ||
![]() |
019b3f0277 | ||
![]() |
0147a3be17 | ||
![]() |
6dd298ff9b | ||
![]() |
90689543da | ||
![]() |
7596b72b39 | ||
![]() |
f22f08d857 | ||
![]() |
6efc9e13be | ||
![]() |
39086d914f | ||
![]() |
51b048c3e4 | ||
![]() |
d2ea3cac52 | ||
![]() |
cfe414dce8 | ||
![]() |
c76de095b2 | ||
![]() |
1587cc7724 | ||
![]() |
15097b4ab9 | ||
![]() |
f3516c8db5 | ||
![]() |
3c12f005f8 | ||
![]() |
2cfbfbba06 | ||
![]() |
6410b72af6 | ||
![]() |
2396effc41 | ||
![]() |
0269b775fc | ||
![]() |
dd8d25ba3e | ||
![]() |
1fd259f340 | ||
![]() |
96bfc02133 | ||
![]() |
8cdad31667 | ||
![]() |
0cd9406149 | ||
![]() |
2e1cccc9ca | ||
![]() |
418b762dc2 | ||
![]() |
8e08cf65ab | ||
![]() |
d3b8373f4a | ||
![]() |
655d9cb4a3 | ||
![]() |
386d61d344 | ||
![]() |
c99fbb55e4 | ||
![]() |
cbc8b70f7a | ||
![]() |
b405725794 | ||
![]() |
76766f9fab | ||
![]() |
dfd0775ce1 | ||
![]() |
69c9fb1122 | ||
![]() |
278cc2e163 | ||
![]() |
76904bf6d2 | ||
![]() |
4fa79aedff | ||
![]() |
9db27c4679 | ||
![]() |
531df99049 | ||
![]() |
676a8c4262 | ||
![]() |
584ee33fa0 | ||
![]() |
94b12823ad | ||
![]() |
b3d287ae35 | ||
![]() |
011800434a | ||
![]() |
c1cb0de4d5 | ||
![]() |
bb2981ef4e | ||
![]() |
e88e72e77e | ||
![]() |
6794a14d78 | ||
![]() |
108d50e915 | ||
![]() |
6b08647649 | ||
![]() |
02762f03af | ||
![]() |
b74e7abd6c | ||
![]() |
dd8a1899b7 | ||
![]() |
2e03ba69ee | ||
![]() |
229525f896 | ||
![]() |
5678b583f3 | ||
![]() |
112cd50eba | ||
![]() |
9ee1b78fcb | ||
![]() |
d239bca13f | ||
![]() |
f5e4937240 | ||
![]() |
0f5b9bad74 | ||
![]() |
edcd4c2bd7 | ||
![]() |
89f35f9df1 | ||
![]() |
25e1d28d75 | ||
![]() |
c0f212dbbc | ||
![]() |
ff349b0812 | ||
![]() |
a223be3c54 | ||
![]() |
28b5496083 | ||
![]() |
0a5ac37bc3 | ||
![]() |
ba4b902a70 | ||
![]() |
a0ea3ac575 | ||
![]() |
1444e3e777 | ||
![]() |
f9833db0ca | ||
![]() |
c0d440be71 | ||
![]() |
c1d82f2cac | ||
![]() |
9259945f93 | ||
![]() |
ab6977f0a6 | ||
![]() |
40104e4a2b | ||
![]() |
a10364d4ee | ||
![]() |
18a6ce9d25 | ||
![]() |
6b3248074b | ||
![]() |
d31ba0f55e | ||
![]() |
ead064e33d | ||
![]() |
5018463c5e | ||
![]() |
13e2ceeed9 | ||
![]() |
22f07c112d | ||
![]() |
6ff9d5e086 | ||
![]() |
592dabba90 | ||
![]() |
bf57d7f563 | ||
![]() |
c61cec19fa | ||
![]() |
42720f51f0 | ||
![]() |
412ff7139b | ||
![]() |
d350485721 | ||
![]() |
6d3cc779c6 | ||
![]() |
4ac0cbad25 | ||
![]() |
3bc65506b0 | ||
![]() |
60e4486b53 | ||
![]() |
bea581515c | ||
![]() |
6fa9f8b150 | ||
![]() |
cda0d40758 | ||
![]() |
85d7ac93e9 | ||
![]() |
0ce3429c6b | ||
![]() |
902dc2cb20 | ||
![]() |
1817cb215d | ||
![]() |
cfb4747e57 | ||
![]() |
e45a2dba9d | ||
![]() |
c4634f5bb4 | ||
![]() |
cf3d51ba6a | ||
![]() |
2af86a7080 | ||
![]() |
44e90e5c5a | ||
![]() |
b5b5ff12a8 | ||
![]() |
e2f1c1f88c | ||
![]() |
5a2034943d | ||
![]() |
7e7308158c | ||
![]() |
663ea6df17 | ||
![]() |
3901c9c45a | ||
![]() |
33b00dd5d3 | ||
![]() |
ae35574230 | ||
![]() |
8a886909d0 | ||
![]() |
75cffbd155 | ||
![]() |
a9ebf4e13c | ||
![]() |
3539eec0c1 | ||
![]() |
dc3066da86 | ||
![]() |
c73bba03f8 | ||
![]() |
c3a4119beb | ||
![]() |
e8a848333f | ||
![]() |
8a6939656f | ||
![]() |
a735202636 | ||
![]() |
8c4549ff18 | ||
![]() |
ca77f36f8e | ||
![]() |
f4dad88085 | ||
![]() |
cbea975b98 | ||
![]() |
26c4321fa9 | ||
![]() |
2f25c3f4a5 | ||
![]() |
0828d4c357 | ||
![]() |
70dfe537d2 | ||
![]() |
810270eb00 | ||
![]() |
aee0e16994 | ||
![]() |
d084697710 | ||
![]() |
1d942b8875 | ||
![]() |
f8dd8dcf14 | ||
![]() |
d3898996b0 | ||
![]() |
7cfd77a0f1 | ||
![]() |
e48ff7a5ef | ||
![]() |
a2c1759356 | ||
![]() |
d06ffa49ac | ||
![]() |
63de73ece6 | ||
![]() |
5ee37e0ab4 | ||
![]() |
f35ef174ca | ||
![]() |
46b58d1eef | ||
![]() |
a35aefbf1a | ||
![]() |
1c1f927e29 | ||
![]() |
2a951b1010 | ||
![]() |
c30d8d49cd | ||
![]() |
2df596227c | ||
![]() |
863e5f75a7 | ||
![]() |
b30302eba2 | ||
![]() |
e0c31e098e | ||
![]() |
92f0589585 | ||
![]() |
9426b6be6a | ||
![]() |
711e599ee3 | ||
![]() |
6e42a506b5 | ||
![]() |
179acdbf1e | ||
![]() |
81160d216e | ||
![]() |
94d70b3724 | ||
![]() |
77818e694f | ||
![]() |
52ce3484e3 | ||
![]() |
e7a2d1951e | ||
![]() |
d4974c3452 | ||
![]() |
336f147365 | ||
![]() |
9fd0454107 | ||
![]() |
8d03d1d597 | ||
![]() |
d344f44317 | ||
![]() |
a6688b76a6 | ||
![]() |
1113178730 | ||
![]() |
13c5bb8e63 | ||
![]() |
6b9bc307d7 | ||
![]() |
3626f8270a | ||
![]() |
b01d764b5a | ||
![]() |
3eb019d36b | ||
![]() |
3fef20c9c5 | ||
![]() |
a2a62799f2 | ||
![]() |
1e42363dfd | ||
![]() |
619a609bea | ||
![]() |
60953678c2 | ||
![]() |
6fd000939e | ||
![]() |
08c9da4c2c | ||
![]() |
b0908bcc6f | ||
![]() |
afef8f701f | ||
![]() |
e06063284c | ||
![]() |
90ff109156 | ||
![]() |
13df047b8e | ||
![]() |
ee5bdb2a55 | ||
![]() |
2ad6b48506 | ||
![]() |
fd7c4d2834 | ||
![]() |
d207cf3a74 | ||
![]() |
7085fee2e0 | ||
![]() |
855adf33de | ||
![]() |
f30a0b78b8 | ||
![]() |
bff7ebeb0c | ||
![]() |
6cb85f40fb | ||
![]() |
5c57cf40d8 | ||
![]() |
5fc1eb3820 | ||
![]() |
1e4ba0739b | ||
![]() |
acf43f032a | ||
![]() |
24e0eb7247 | ||
![]() |
7803caa833 | ||
![]() |
919efa1894 | ||
![]() |
459cbc4075 | ||
![]() |
bd087db248 | ||
![]() |
e632ecf64a | ||
![]() |
f180f9f344 | ||
![]() |
b609cf0255 | ||
![]() |
0aa41e0a47 | ||
![]() |
88d3b8bcee | ||
![]() |
eff7f5adf6 | ||
![]() |
73bbcaaacf | ||
![]() |
45e48d41d8 | ||
![]() |
3ff8c64d56 | ||
![]() |
ed3b393b7b | ||
![]() |
aaed7a7abb | ||
![]() |
0b860653be | ||
![]() |
ebede24bd4 | ||
![]() |
871085b8b2 | ||
![]() |
a553865994 | ||
![]() |
a748da9c27 | ||
![]() |
29502af63d | ||
![]() |
1b02a85be8 | ||
![]() |
3e592297cd | ||
![]() |
e20777d90e | ||
![]() |
9ec50d3dbb | ||
![]() |
41594890af | ||
![]() |
6bb1a78b81 | ||
![]() |
97c25fe67d | ||
![]() |
ee7820d04c | ||
![]() |
0df77fb0e9 | ||
![]() |
1b8636aa8e | ||
![]() |
a621fc0be8 | ||
![]() |
eeee01e534 | ||
![]() |
4e558ef5ca | ||
![]() |
95d580507e | ||
![]() |
3d81d725e5 | ||
![]() |
3a6a6b7a05 | ||
![]() |
cf6a399dc8 | ||
![]() |
162cfd6be4 | ||
![]() |
d2f762de55 | ||
![]() |
2403d615f6 | ||
![]() |
f32cc501ae | ||
![]() |
c00d8dc143 | ||
![]() |
2edc0d682c | ||
![]() |
2979071476 | ||
![]() |
98b9ab580a | ||
![]() |
cee6b34456 | ||
![]() |
d44a916dd1 | ||
![]() |
e3e6814eee | ||
![]() |
071cba4de2 | ||
![]() |
c2d781453d | ||
![]() |
3501a9be20 | ||
![]() |
f01253ac3a | ||
![]() |
aafa510eb0 | ||
![]() |
29f9e9ad4b | ||
![]() |
5db3f2daca | ||
![]() |
af39a960a4 | ||
![]() |
2a9b5f1070 | ||
![]() |
e0869cc42d | ||
![]() |
0376e6c0f1 | ||
![]() |
ae7d963f24 | ||
![]() |
bec946f131 | ||
![]() |
05e42bd49b | ||
![]() |
fe57e7f43c | ||
![]() |
e05dff553c | ||
![]() |
7d0a30088e | ||
![]() |
e99d30edf8 | ||
![]() |
23c6493093 | ||
![]() |
95cad9133a | ||
![]() |
3092987a7f | ||
![]() |
6083ccf000 | ||
![]() |
4d85598c4b | ||
![]() |
33d1be3fa2 | ||
![]() |
37646c0f76 | ||
![]() |
8bb18dd465 | ||
![]() |
d0ad543882 | ||
![]() |
c4b4668b38 | ||
![]() |
e484218385 | ||
![]() |
833de7c70a | ||
![]() |
707fb5982c | ||
![]() |
3ee26913e7 | ||
![]() |
4bb570c9a4 | ||
![]() |
0e8b76a57e | ||
![]() |
2dfdcbf4e7 | ||
![]() |
1b3bdcc1a6 | ||
![]() |
dc5bb506ff | ||
![]() |
074d12c1fa | ||
![]() |
80deff7c4b | ||
![]() |
b7b6c6e1c6 | ||
![]() |
651f3f3d1a | ||
![]() |
0bc4ef1caf | ||
![]() |
dc0a0f6c93 | ||
![]() |
63d8d27b03 | ||
![]() |
dc40ea7fa1 | ||
![]() |
0fae59d6eb | ||
![]() |
5c7821b6c5 | ||
![]() |
f5745ec58b | ||
![]() |
b21d5cb2dc | ||
![]() |
74c5dd2158 | ||
![]() |
b5664d5d02 | ||
![]() |
506c7f2ab0 | ||
![]() |
17dcc1a801 | ||
![]() |
9b37edbff5 | ||
![]() |
e22cdb9ef8 | ||
![]() |
636fa8bea8 | ||
![]() |
9799e0ad8e | ||
![]() |
6ca1d346be | ||
![]() |
e1603bf7e4 | ||
![]() |
5c554bd278 | ||
![]() |
71cfa2e225 | ||
![]() |
bb2200ffca | ||
![]() |
66e45737e1 | ||
![]() |
695de8493d | ||
![]() |
c5488692d4 | ||
![]() |
0a19e31886 | ||
![]() |
2c2e3ad860 | ||
![]() |
938dbad1e8 | ||
![]() |
ff0bfa28d3 | ||
![]() |
d3e11cf813 | ||
![]() |
9993392f6d | ||
![]() |
e891618572 | ||
![]() |
96f8e314b3 | ||
![]() |
0edcf5fa8b | ||
![]() |
0cd23d778e | ||
![]() |
14f6ad921b | ||
![]() |
8e93970944 | ||
![]() |
b65f499f60 | ||
![]() |
c2bcc5be2f | ||
![]() |
ba67b9239b | ||
![]() |
f4f45af792 | ||
![]() |
9cce5af5af | ||
![]() |
2e6b98c7f6 | ||
![]() |
a8dbfbb8ce | ||
![]() |
a68c99c94e | ||
![]() |
00da3293e2 | ||
![]() |
6a0ce0a518 | ||
![]() |
7ce55fd6b7 | ||
![]() |
6cc96b358a | ||
![]() |
4d6660c2ed | ||
![]() |
f5b01e3c57 | ||
![]() |
57c6b805ce | ||
![]() |
17ed15182a | ||
![]() |
77eaa2fea1 | ||
![]() |
3c56f37265 | ||
![]() |
4073e3a325 | ||
![]() |
48df9fcc11 | ||
![]() |
bad6113059 | ||
![]() |
9e7ac6982a | ||
![]() |
47ab3b6c5e | ||
![]() |
c761b26aef | ||
![]() |
4ee9ce444b | ||
![]() |
01ba5f2192 | ||
![]() |
b869710aff | ||
![]() |
323428ced5 | ||
![]() |
8f99a7f6e3 | ||
![]() |
aff873923c | ||
![]() |
4d1661d39a | ||
![]() |
a34a0df207 | ||
![]() |
5841610c7f | ||
![]() |
557ea7a8da | ||
![]() |
7f1282834f | ||
![]() |
4e0ef1d982 | ||
![]() |
734a0d9ebc | ||
![]() |
4d66861107 | ||
![]() |
44a6a0d941 | ||
![]() |
95940758e9 | ||
![]() |
bfd98ad44b | ||
![]() |
b59d3549fd | ||
![]() |
5f7149068e | ||
![]() |
8ec6bfcbe7 | ||
![]() |
200e59149c | ||
![]() |
978d78f7b2 | ||
![]() |
03d8ec2601 | ||
![]() |
b941e8fb9f | ||
![]() |
394f30d8d4 | ||
![]() |
1e0eb68b69 | ||
![]() |
f791957ae3 | ||
![]() |
f21b3f874f | ||
![]() |
8fa510d483 | ||
![]() |
ff777576d8 | ||
![]() |
3b6c1c661e | ||
![]() |
8686bd554b | ||
![]() |
62cfb5c161 | ||
![]() |
349bac4214 | ||
![]() |
c3844cbf4a | ||
![]() |
556e4ccb42 | ||
![]() |
116cb137fe | ||
![]() |
d7b97367b2 | ||
![]() |
b82e22dcaf | ||
![]() |
95bde7588c | ||
![]() |
13425eb243 | ||
![]() |
5bde13f927 | ||
![]() |
78b52181bd | ||
![]() |
a790547896 | ||
![]() |
fe32b77f87 | ||
![]() |
dd854ea985 | ||
![]() |
121e7b3e2d | ||
![]() |
15c82415c2 | ||
![]() |
5d791c0ea9 | ||
![]() |
07db0defa7 | ||
![]() |
41f8a4f14f | ||
![]() |
778d2ba28b | ||
![]() |
dc490a0f08 | ||
![]() |
641eae0f5a | ||
![]() |
2cc8cbeaf4 | ||
![]() |
24dcacc78f | ||
![]() |
157a8ddf5c | ||
![]() |
08d82be71d | ||
![]() |
ba54a4c747 | ||
![]() |
b26260a0b9 | ||
![]() |
ffd0861b7c | ||
![]() |
e5ccf5eb93 | ||
![]() |
67307075d1 | ||
![]() |
42c719474e | ||
![]() |
4d9b6060d4 | ||
![]() |
2331d1ff15 | ||
![]() |
218292f6b1 | ||
![]() |
95c07b4659 | ||
![]() |
186b9c9aac | ||
![]() |
1ccc0fad27 | ||
![]() |
3e0f415fc6 | ||
![]() |
5af0cf0ce6 | ||
![]() |
8aa36728f5 | ||
![]() |
f2a716d47c | ||
![]() |
4431431c23 | ||
![]() |
13ef589dc8 | ||
![]() |
ac36d5db7e | ||
![]() |
cdc74b198e | ||
![]() |
8d0a55cfac | ||
![]() |
3f793c91f4 | ||
![]() |
2dc4a31b6c | ||
![]() |
40ef4325d9 | ||
![]() |
16da29bf9d | ||
![]() |
9fbe8a001b | ||
![]() |
f12b432efd | ||
![]() |
e71a5ca5f2 | ||
![]() |
837a5a6021 | ||
![]() |
7a6e646c83 | ||
![]() |
a71f1b4917 | ||
![]() |
5fb4ac2286 | ||
![]() |
98f25e9694 | ||
![]() |
d92ca28b16 | ||
![]() |
d1dd6bb746 | ||
![]() |
bf87d252f3 | ||
![]() |
8f397a9be7 | ||
![]() |
ca270f7c17 | ||
![]() |
a8a3ca5102 | ||
![]() |
2c78a5a5a0 | ||
![]() |
2521f714f9 | ||
![]() |
95b4875c8a | ||
![]() |
ec01ab23fb | ||
![]() |
34debf18bf | ||
![]() |
4592b6983a | ||
![]() |
a0e44f97bd | ||
![]() |
de439e24d7 | ||
![]() |
187d04ccb0 | ||
![]() |
f214273fd6 | ||
![]() |
52aeb3f312 | ||
![]() |
d84c1df906 | ||
![]() |
a1dd79d4fe | ||
![]() |
0519556070 | ||
![]() |
d64d04df39 | ||
![]() |
cf476dbc41 | ||
![]() |
8bfed103d8 | ||
![]() |
e9b6e4e839 | ||
![]() |
1dc53cfd1e | ||
![]() |
f57b5bc735 | ||
![]() |
d46c2e8b0a | ||
![]() |
f6d1cb89de | ||
![]() |
0e0031dc61 | ||
![]() |
2168327bfa | ||
![]() |
5cf5569d6e | ||
![]() |
b4391067ff | ||
![]() |
1961248339 | ||
![]() |
13d942e163 | ||
![]() |
99fd62e3be | ||
![]() |
0cded44025 | ||
![]() |
a8aad9de61 | ||
![]() |
ffe53c91c5 | ||
![]() |
9a2860a3ee | ||
![]() |
896199c652 | ||
![]() |
5fcc6b4a0a | ||
![]() |
678b3605e8 | ||
![]() |
b9c4654a63 | ||
![]() |
845dd50275 | ||
![]() |
23aa204856 | ||
![]() |
8eb16b0827 | ||
![]() |
fc1abcfa1f | ||
![]() |
c53acc3015 | ||
![]() |
7a34efa5c4 | ||
![]() |
2727e45b43 | ||
![]() |
5e5ec023be | ||
![]() |
d6a5b04043 | ||
![]() |
1de9edc06e | ||
![]() |
9a99c974a4 | ||
![]() |
bf84ee3c7c | ||
![]() |
f8545d04b7 | ||
![]() |
e73c975bad | ||
![]() |
0f7e10cef4 | ||
![]() |
689f9b8af7 | ||
![]() |
654cbf0687 | ||
![]() |
041b0d76ca | ||
![]() |
24bac034d1 | ||
![]() |
094097fab3 | ||
![]() |
26fbe9a101 | ||
![]() |
f8ddafcca2 | ||
![]() |
04a8f224c1 | ||
![]() |
597839331c | ||
![]() |
26b72485cf | ||
![]() |
7dbaf59ccf | ||
![]() |
95cf0a8803 | ||
![]() |
1dd5bc3fba | ||
![]() |
bf55e2c5d3 | ||
![]() |
4d92475240 | ||
![]() |
a52586e8ea | ||
![]() |
5759574b26 | ||
![]() |
56580efe68 | ||
![]() |
68f28d6976 | ||
![]() |
5c3f5746bb | ||
![]() |
54a73cbb2b | ||
![]() |
ab0f04844b | ||
![]() |
ad8f03af22 | ||
![]() |
3329f92136 | ||
![]() |
c27ec060da | ||
![]() |
82b2189d01 | ||
![]() |
4ce52970c0 | ||
![]() |
99433dd289 | ||
![]() |
b94c520660 | ||
![]() |
2f02ae9d45 | ||
![]() |
11fcc8c8f9 | ||
![]() |
e8cf498dcc | ||
![]() |
2178a00eea | ||
![]() |
33ff830c1b | ||
![]() |
5a8d8dfbb6 | ||
![]() |
8238850caa | ||
![]() |
fc3c64c8d4 | ||
![]() |
1888e57bf9 | ||
![]() |
94dcc5b8d8 | ||
![]() |
4839a7995e | ||
![]() |
1aca526cb4 | ||
![]() |
9541165d33 | ||
![]() |
600131fe85 | ||
![]() |
8c45b484ce | ||
![]() |
650da7bada | ||
![]() |
247c9f70bf | ||
![]() |
233f79df99 | ||
![]() |
236852c109 | ||
![]() |
6f0e469d79 | ||
![]() |
f9749f368f | ||
![]() |
f165864f09 | ||
![]() |
dc077a52c9 | ||
![]() |
0b2de1f895 | ||
![]() |
94eb3cf222 | ||
![]() |
cb47caf786 | ||
![]() |
d9f0633878 | ||
![]() |
71094bee63 | ||
![]() |
f5c4374d2c | ||
![]() |
aa297ca6b6 | ||
![]() |
4712e4ece6 | ||
![]() |
e51b607189 | ||
![]() |
fdf2a763d4 | ||
![]() |
f25c9697f8 | ||
![]() |
7e282f5df1 | ||
![]() |
0e9bb3f30c | ||
![]() |
3bb5b261c7 | ||
![]() |
273b197d75 | ||
![]() |
906dedf4d5 | ||
![]() |
4f4a79b1a1 | ||
![]() |
587b3497c1 | ||
![]() |
1753a63081 | ||
![]() |
96f3cf1d27 | ||
![]() |
e4dec3d6b6 | ||
![]() |
429aa1a2c2 | ||
![]() |
d889c019e7 | ||
![]() |
52168b7b9d | ||
![]() |
d6462323d6 | ||
![]() |
1d368457e3 | ||
![]() |
7c3fe07ac0 | ||
![]() |
194f7d125f | ||
![]() |
8ef0be5671 | ||
![]() |
b809e77f54 | ||
![]() |
780afa9876 | ||
![]() |
5ebc1acb7f | ||
![]() |
59580f28a1 | ||
![]() |
533d7dc4ab | ||
![]() |
ec74fa8789 | ||
![]() |
988061a5ee | ||
![]() |
c10d53bf0c | ||
![]() |
54b87586aa | ||
![]() |
461ff22cd5 | ||
![]() |
b1a4919cb2 | ||
![]() |
c1d670a893 | ||
![]() |
b6bf29b054 | ||
![]() |
5c6a593f2e | ||
![]() |
f4c36b28f6 | ||
![]() |
73e649b5f5 | ||
![]() |
ba72631039 | ||
![]() |
a89fb6daa5 | ||
![]() |
6568d86aec | ||
![]() |
3508cc816e | ||
![]() |
ffa264f077 | ||
![]() |
84c2266f1a | ||
![]() |
973c23b0d6 | ||
![]() |
9ede1929b2 | ||
![]() |
054e038512 | ||
![]() |
fb8923f681 | ||
![]() |
240cc7c480 | ||
![]() |
8d04a1287d | ||
![]() |
16df64ef1f | ||
![]() |
f76ef3aa3d | ||
![]() |
59c88f499f | ||
![]() |
afe25d0ccc | ||
![]() |
bdccc34e7e | ||
![]() |
495a964322 | ||
![]() |
9defc609e8 | ||
![]() |
68b26290f0 | ||
![]() |
d41f7ae750 | ||
![]() |
e15bc1f330 | ||
![]() |
a607b7d4b8 | ||
![]() |
1a4c4015bc | ||
![]() |
d7df77d172 | ||
![]() |
7e2b4f8367 | ||
![]() |
bc9ae19deb | ||
![]() |
17829e94aa | ||
![]() |
e0dca0e43c | ||
![]() |
4e207ec862 | ||
![]() |
b5ccf21d2b | ||
![]() |
62bde8ed7e | ||
![]() |
dc670134f8 | ||
![]() |
39d6cb5df4 | ||
![]() |
ddfd1d10a0 | ||
![]() |
0c1a8ebc37 | ||
![]() |
bd4c4bcb76 | ||
![]() |
161efa1f40 | ||
![]() |
ebdddd29d3 | ||
![]() |
2790d5b2ed | ||
![]() |
98adb06ea3 | ||
![]() |
0b90cfaa9f | ||
![]() |
ded38dbfbd | ||
![]() |
5d12f1a485 | ||
![]() |
7addf9d430 | ||
![]() |
6d0480426d | ||
![]() |
5a8b143888 | ||
![]() |
5bf0b329c9 | ||
![]() |
51123629d7 | ||
![]() |
0ad78ae8e7 | ||
![]() |
1c6e9e5c0a | ||
![]() |
0b610a002c | ||
![]() |
0f1361ee1c | ||
![]() |
b806825d2a | ||
![]() |
f905c1d7d6 | ||
![]() |
926b2c3337 | ||
![]() |
fc900b8be4 | ||
![]() |
88838bf238 | ||
![]() |
ed2de829e1 | ||
![]() |
ff34c9dcd4 | ||
![]() |
3d4641fd98 | ||
![]() |
860ace56f8 | ||
![]() |
ed6220fd25 | ||
![]() |
be9ca6c8a8 | ||
![]() |
148284ced6 | ||
![]() |
1def132d53 | ||
![]() |
0de910602c | ||
![]() |
3714170f33 | ||
![]() |
c6ca79eb4e | ||
![]() |
a15ad925e9 | ||
![]() |
13d5225fc8 | ||
![]() |
e3052553cf | ||
![]() |
cc0e7a369b | ||
![]() |
7f819d7041 | ||
![]() |
dfba82b3d3 | ||
![]() |
3ae2f09a04 | ||
![]() |
a2a2a956dd | ||
![]() |
fa9d7304bf | ||
![]() |
c56b63d1bd | ||
![]() |
2e44f115b9 | ||
![]() |
0c296f15b1 | ||
![]() |
345f573546 | ||
![]() |
69288348dd | ||
![]() |
9babe97e6f | ||
![]() |
863fa9c295 | ||
![]() |
766968bb6f | ||
![]() |
123e04b23e | ||
![]() |
9d2eb35d7a | ||
![]() |
67a38adacf | ||
![]() |
80aa303c29 | ||
![]() |
5ea16f2790 | ||
![]() |
2f24b79ddd | ||
![]() |
d9f8feb04a | ||
![]() |
bb57587b42 | ||
![]() |
b61ca28260 | ||
![]() |
a3f4e7709b | ||
![]() |
984a819b92 | ||
![]() |
edae4b5efb | ||
![]() |
2098ebf712 | ||
![]() |
f72c10f657 | ||
![]() |
645bde35d3 | ||
![]() |
0c39f9f6f6 |
3
.dir-locals.el
Normal file
3
.dir-locals.el
Normal file
@@ -0,0 +1,3 @@
|
||||
((nil . ((setq sh-basic-offset: 4)
|
||||
(setq indent-tabs-mode nil)
|
||||
)))
|
1
.kateconfig
Normal file
1
.kateconfig
Normal file
@@ -0,0 +1 @@
|
||||
kate: space-indent on; tab-width 4; indent-width 4; replace-tabs on; eol unix;
|
9
.kateproject
Normal file
9
.kateproject
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "Kate"
|
||||
, "files": [ { "git": 1 } ]
|
||||
, "build": {
|
||||
"directory": "build"
|
||||
, "build": "make -j $(getconf _NPROCESSORS_ONLN) all"
|
||||
, "clean": "make clean"
|
||||
}
|
||||
}
|
6
.mailmap
Normal file
6
.mailmap
Normal file
@@ -0,0 +1,6 @@
|
||||
Philippe Seewer <philippe.seewer@bfh.ch> <philippe.seewer-omB+W0Dpw2o@public.gmane.org>
|
||||
Seewer Philippe <philippe.seewer@bfh.ch> <philippe.seewer@bfh.ch>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch> <philippe.seewer@bfh.ch>
|
||||
Victor Lowther <victor.lowther@gmail.com> <victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
|
||||
Harald Hoyer <harald@redhat.com> <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
|
||||
Harald Hoyer <harald@redhat.com> <harald@eeepc.(none)>
|
37
AUTHORS
37
AUTHORS
@@ -1,11 +1,32 @@
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Seewer Philippe <philippe.seewer@bfh.ch>
|
||||
Victor Lowther <victor.lowther@gmail.com>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Luca Berra <bluca@comedia.it>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
Andrey Borzenkov <arvidjaar@mail.ru>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
David Cantrell <dcantrell@redhat.com>
|
||||
Lance Albertson <lance@osuosl.org>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
||||
Dan Horák <dan@danny.cz>
|
||||
Joey Boggs <jboggs@redhat.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Mike Snitzer <msnitzer@redhat.com>
|
||||
Mike Snitzer <snitzer@redhat.com>
|
||||
Munehiro Matsuda <haro@kgt.co.jp>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Quentin Armitage <quentin@armitage.org.uk>
|
||||
Sergey Fionov <fionov@gmail.com>
|
||||
Thilo Bangert <thilo.bangert@gmx.net>
|
||||
Yanko Kaneti <yaneti@declera.com>
|
||||
|
85
Makefile
85
Makefile
@@ -1,35 +1,60 @@
|
||||
VERSION=0.7
|
||||
VERSION=004
|
||||
GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8)
|
||||
|
||||
prefix = /usr
|
||||
datadir = ${prefix}/share
|
||||
pkglibdir = ${datadir}/dracut
|
||||
sysconfdir = ${prefix}/etc
|
||||
sbindir = ${prefix}/sbin
|
||||
mandir = ${prefix}/share/man
|
||||
prefix ?= /usr
|
||||
datadir ?= ${prefix}/share
|
||||
pkglibdir ?= ${datadir}/dracut
|
||||
sysconfdir ?= ${prefix}/etc
|
||||
sbindir ?= ${prefix}/sbin
|
||||
mandir ?= ${prefix}/share/man
|
||||
|
||||
|
||||
.PHONY: install clean archive rpm testimage test all check AUTHORS
|
||||
|
||||
ifeq (1,${WITH_SWITCH_ROOT})
|
||||
targets = modules.d/99base/switch_root
|
||||
else
|
||||
targets =
|
||||
endif
|
||||
|
||||
all: $(targets) dracut-rhel6.html
|
||||
|
||||
dracut-rhel6.html: dracut-rhel6.xml
|
||||
xsltproc -o dracut-rhel6.html --xinclude -nonet \
|
||||
--stringparam draft.mode yes \
|
||||
--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-rhel6.xml
|
||||
|
||||
modules.d/99base/switch_root: switch_root.c
|
||||
gcc -D _GNU_SOURCE -D 'PACKAGE_STRING="dracut"' -std=gnu99 -fsigned-char -g -O2 -o modules.d/99base/switch_root switch_root.c
|
||||
|
||||
all: modules.d/99base/switch_root
|
||||
|
||||
.PHONY: install clean archive rpm testimage test all check
|
||||
|
||||
install:
|
||||
mkdir -p $(DESTDIR)$(pkglibdir)
|
||||
mkdir -p $(DESTDIR)$(sbindir)
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)
|
||||
mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
|
||||
mkdir -p $(DESTDIR)$(mandir)/man8
|
||||
mkdir -p $(DESTDIR)$(mandir)/man{1,5,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
|
||||
ifeq (1,${WITH_SWITCH_ROOT})
|
||||
install -m 0755 modules.d/99base/switch_root $(DESTDIR)$(sbindir)/switch_root
|
||||
endif
|
||||
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
|
||||
cp -arx modules.d $(DESTDIR)$(pkglibdir)
|
||||
install -m 0644 dracut.8 $(DESTDIR)$(mandir)/man8
|
||||
install -m 0644 mkinitrd.8 $(DESTDIR)$(mandir)/man8
|
||||
install -m 0644 lsinitrd.1 $(DESTDIR)$(mandir)/man1
|
||||
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
|
||||
ifeq (1,${WITH_SWITCH_ROOT})
|
||||
rm $(DESTDIR)$(pkglibdir)/modules.d/99base/switch_root
|
||||
endif
|
||||
|
||||
clean:
|
||||
rm -f *~
|
||||
@@ -45,23 +70,33 @@ 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)-$(GITVERSION).tar.bz2:
|
||||
git archive --format=tar HEAD --prefix=dracut-$(VERSION)-$(GITVERSION)/ |bzip2 > dracut-$(VERSION)-$(GITVERSION).tar.bz2
|
||||
|
||||
|
||||
rpm: clean dracut-$(VERSION).tar.bz2
|
||||
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" -ba dracut.spec
|
||||
rm -fr BUILD BUILDROOT
|
||||
rpm: dracut-$(VERSION).tar.bz2
|
||||
rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \
|
||||
cp dracut-$(VERSION).tar.bz2 "$$rpmbuild"; \
|
||||
$$src/git2spec.pl $(VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \
|
||||
(cd "$$rpmbuild"; rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
|
||||
--define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \
|
||||
--define "_rpmdir $$PWD" -ba dracut.spec; ) && \
|
||||
( mv "$$rpmbuild"/noarch/*.rpm .; mv "$$rpmbuild"/*.src.rpm .;rm -fr "$$rpmbuild"; ls *.rpm )
|
||||
|
||||
gitrpm: dracut-$(VERSION)-$(GITVERSION).tar.bz2
|
||||
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" --define "gittag $(GITVERSION)" -ba dracut.spec
|
||||
rm -fr BUILD BUILDROOT
|
||||
|
||||
check: all
|
||||
syncheck:
|
||||
@ret=0;for i in modules.d/99base/init modules.d/*/*.sh; do \
|
||||
[ "$${i##*/}" = "caps.sh" ] && continue; \
|
||||
dash -n "$$i" ; ret=$$(($$ret+$$?)); \
|
||||
done;exit $$ret
|
||||
make -C test check
|
||||
@ret=0;for i in dracut modules.d/02caps/caps.sh modules.d/*/install modules.d/*/installkernel modules.d/*/check; do \
|
||||
bash -n "$$i" ; ret=$$(($$ret+$$?)); \
|
||||
done;exit $$ret
|
||||
|
||||
check: all syncheck
|
||||
$(MAKE) -C test check
|
||||
|
||||
testimage: all
|
||||
./dracut -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
|
||||
@@ -72,6 +107,10 @@ testimages: all
|
||||
@echo wrote test-$(shell uname -r).img
|
||||
./dracut -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)
|
||||
@echo wrote test-$(shell uname -r).img
|
||||
|
||||
AUTHORS:
|
||||
git shortlog --numbered --summary -e |while read a rest; do echo $$rest;done > AUTHORS
|
||||
|
286
NEWS
Normal file
286
NEWS
Normal file
@@ -0,0 +1,286 @@
|
||||
dracut-006
|
||||
==========
|
||||
- fixed mdraid with IMSM
|
||||
- fixed dracut manpages
|
||||
- dmraid parse different error messages
|
||||
- add cdrom polling mechanism for slow cdroms
|
||||
- add module btrfs
|
||||
- add btrfsctl scan for btrfs multi-devices (raid)
|
||||
- teach dmsquash live-root to use rootflags
|
||||
- trigger udev with action=add
|
||||
- fixed add_drivers handling
|
||||
- add sr_mod
|
||||
- use pigz instead of gzip, if available
|
||||
|
||||
dracut-005
|
||||
==========
|
||||
- dcb support to dracut's FCoE support
|
||||
- add readonly overlay support for dmsquash
|
||||
- add keyboard kernel modules
|
||||
- dracut.conf: added add_dracutmodules
|
||||
- add /etc/dracut.conf.d
|
||||
- add preliminary IPv6 support
|
||||
- bugfixes
|
||||
|
||||
|
||||
dracut-004
|
||||
==========
|
||||
- dracut-lib: read multiple lines from $init/etc/cmdline
|
||||
- lsinitrd and mkinitrd
|
||||
- dmsquash: add support for loopmounted *.iso files
|
||||
- lvm: add rd_LVM_LV and "--poll n"
|
||||
- user suspend support
|
||||
- add additional drivers in host-only mode, too
|
||||
- improved emergency shell
|
||||
- support for compressed kernel modules
|
||||
- support for loading Xen modules
|
||||
- rdloaddriver kernel command line parameter
|
||||
- man pages for dracut-catimages and dracut-gencmdline
|
||||
- bugfixes
|
||||
|
||||
dracut-003
|
||||
==========
|
||||
- add debian package modules
|
||||
- add dracut.conf manpage
|
||||
- add module 90multipath
|
||||
- add module 01fips
|
||||
- crypt: ignore devices in /etc/crypttab (root is not in there)
|
||||
unless rd_NO_CRYPTTAB is specified
|
||||
- kernel-modules: add scsi_dh scsi_dh_rdac scsi_dh_emc
|
||||
- add multinic support
|
||||
- add s390 zfcp support
|
||||
- add s390 dasd support
|
||||
- add s390 network support
|
||||
- fixed dracut-gencmdline for root=UUID or LABEL
|
||||
- do not destroy assembled raid arrays if mdadm.conf present
|
||||
- mount /dev/shm
|
||||
- let udevd not resolve group and user names
|
||||
- moved network from udev to initqueue
|
||||
- improved debug output: specifying "rdinitdebug" now logs
|
||||
to dmesg, console and /init.log
|
||||
- strip kernel modules which have no x bit set
|
||||
- redirect stdin, stdout, stderr all RW to /dev/console
|
||||
so the user can use "less" to view /init.log and dmesg
|
||||
- add new device mapper udev rules and dmeventd
|
||||
- fixed dracut-gencmdline for root=UUID or LABEL
|
||||
- do not destroy assembled raid arrays if mdadm.conf present
|
||||
- mount /dev/shm
|
||||
- let udevd not resolve group and user names
|
||||
- preserve timestamps of tools on initramfs generation
|
||||
- generate symlinks for binaries correctly
|
||||
- moved network from udev to initqueue
|
||||
- mount nfs3 with nfsvers=3 option and retry with nfsvers=2
|
||||
- fixed nbd initqueue-finished
|
||||
- improved debug output: specifying "rdinitdebug" now logs
|
||||
to dmesg, console and /init.log
|
||||
- strip kernel modules which have no x bit set
|
||||
- redirect stdin, stdout, stderr all RW to /dev/console
|
||||
so the user can use "less" to view /init.log and dmesg
|
||||
- make install of new dm/lvm udev rules optionally
|
||||
- add new device mapper udev rules and dmeventd
|
||||
- Fix LiveCD boot regression
|
||||
- bail out if selinux policy could not be loaded and
|
||||
selinux=0 not specified on kernel command line
|
||||
- do not cleanup dmraids
|
||||
- copy over lvm.conf
|
||||
|
||||
dracut-002
|
||||
==========
|
||||
- add ifname= argument for persistent netdev names
|
||||
- new /initqueue-finished to check if the main loop can be left
|
||||
- copy mdadm.conf if --mdadmconf set or mdadmconf in dracut.conf
|
||||
- plymouth: use plymouth-populate-initrd
|
||||
- add add_drivers for dracut and dracut.conf
|
||||
- add modprobe scsi_wait_scan to be sure everything was scanned
|
||||
- fix for several problems with md raid containers
|
||||
- fix for selinux policy loading
|
||||
- fix for mdraid for IMSM
|
||||
- fix for bug, which prevents installing 61-persistent-storage.rules (bug #520109)
|
||||
- fix for missing grep for md
|
||||
|
||||
dracut-001
|
||||
==========
|
||||
- better --hostonly checks
|
||||
- better lvm/mdraid/dmraid handling
|
||||
- fcoe booting support
|
||||
Supported cmdline formats:
|
||||
fcoe=<networkdevice>:<dcb|nodcb>
|
||||
fcoe=<macaddress>:<dcb|nodcb>
|
||||
|
||||
Note currently only nodcb is supported, the dcb option is reserved for
|
||||
future use.
|
||||
|
||||
Note letters in the macaddress must be lowercase!
|
||||
|
||||
Examples:
|
||||
fcoe=eth0:nodcb
|
||||
fcoe=4A:3F:4C:04:F8:D7:nodcb
|
||||
|
||||
- Syslog support for dracut
|
||||
This module provides syslog functionality in the initrd.
|
||||
This is especially interesting when complex configuration being
|
||||
used to provide access to the device the rootfs resides on.
|
||||
|
||||
|
||||
dracut-0.9
|
||||
==========
|
||||
- let plymouth attach to the terminal (nice text output now)
|
||||
- new kernel command line parameter "rdinfo" show dracut output, even when
|
||||
"quiet" is specified
|
||||
- rd_LUKS_UUID is now handled correctly
|
||||
- dracut-gencmdline: rd_LUKS_UUID and rd_MD_UUID is now correctly generated
|
||||
- now generates initrd-generic with around 15MB
|
||||
- smaller bugfixes
|
||||
|
||||
dracut-0.8
|
||||
==========
|
||||
- iSCSI with username and password
|
||||
- support for live images (dmsquashed live images)
|
||||
- iscsi_firmware fixes
|
||||
- smaller images
|
||||
- bugfixes
|
||||
|
||||
dracut-0.7
|
||||
==========
|
||||
- dracut: strip binaries in initramfs
|
||||
|
||||
--strip
|
||||
strip binaries in the initramfs (default)
|
||||
|
||||
--nostrip
|
||||
do not strip binaries in the initramfs
|
||||
- dracut-catimages
|
||||
|
||||
Usage: ./dracut-catimages [OPTION]... <initramfs> <base image>
|
||||
[<image>...]
|
||||
Creates initial ramdisk image by concatenating several images from the
|
||||
command
|
||||
line and /boot/dracut/
|
||||
|
||||
-f, --force Overwrite existing initramfs file.
|
||||
-i, --imagedir Directory with additional images to add
|
||||
(default: /boot/dracut/)
|
||||
-o, --overlaydir Overlay directory, which contains 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 This message
|
||||
--debug Output debug information of the build process
|
||||
-v, --verbose Verbose output during the build process
|
||||
|
||||
- s390 dasd support
|
||||
|
||||
dracut-0.6
|
||||
==========
|
||||
- dracut: add --kernel-only and --no-kernel arguments
|
||||
|
||||
--kernel-only
|
||||
only install kernel drivers and firmware files
|
||||
|
||||
--no-kernel
|
||||
do not install kernel drivers and firmware files
|
||||
|
||||
All kernel module related install commands moved from "install"
|
||||
to "installkernel".
|
||||
|
||||
For "--kernel-only" all installkernel scripts of the specified
|
||||
modules are used, regardless of any checks, so that all modules
|
||||
which might be needed by any dracut generic image are in.
|
||||
|
||||
The basic idea is to create two images. One image with the kernel
|
||||
modules and one without. So if the kernel changes, you only have
|
||||
to replace one image.
|
||||
|
||||
Grub and the kernel can handle multiple images, so grub entry can
|
||||
look like this:
|
||||
|
||||
title Fedora (2.6.29.5-191.fc11.i586)
|
||||
root (hd0,0)
|
||||
kernel /vmlinuz-2.6.29.5-191.fc11.i586 ro rhgb quiet
|
||||
initrd /initrd-20090722.img /initrd-kernel-2.6.29.5-191.fc11.i586.img /initrd-config.img
|
||||
|
||||
initrd-20090722.img
|
||||
the image provided by the initrd rpm
|
||||
one old backup version is kept like with the kernel
|
||||
|
||||
initrd-kernel-2.6.29.5-191.fc11.i586.img
|
||||
the image provided by the kernel rpm
|
||||
|
||||
initrd-config.img
|
||||
optional image with local configuration files
|
||||
|
||||
- dracut: add --kmoddir directory, where to look for kernel modules
|
||||
|
||||
-k, --kmoddir [DIR]
|
||||
specify the directory, where to look for kernel modules
|
||||
|
||||
|
||||
|
||||
dracut-0.5
|
||||
==========
|
||||
- more generic (all plymouth modules, all keyboards, all console fonts)
|
||||
- more kernel command line parameters (see also man dracut(8))
|
||||
- a helper tool, which generates the kernel command line (dracut-gencmdline)
|
||||
- bridged network boot
|
||||
- a lot of new command line parameter
|
||||
|
||||
dracut-0.4
|
||||
==========
|
||||
- bugfixes
|
||||
- firmware loading support
|
||||
- new internal queue (initqueue)
|
||||
initqueue now loops until /dev/root exists or root is mounted
|
||||
|
||||
init now has the following points to inject scripts:
|
||||
|
||||
/cmdline/*.sh
|
||||
scripts for command line parsing
|
||||
|
||||
/pre-udev/*.sh
|
||||
scripts to run before udev is started
|
||||
|
||||
/pre-trigger/*.sh
|
||||
scripts to run before the main udev trigger is pulled
|
||||
|
||||
/initqueue/*.sh
|
||||
runs in parallel to the udev trigger
|
||||
Udev events can add scripts here with /sbin/initqueue.
|
||||
If /sbin/initqueue is called with the "--onetime" option, the script
|
||||
will be removed after it was run.
|
||||
If /initqueue/work is created and udev >= 143 then this loop can
|
||||
process the jobs in parallel to the udevtrigger.
|
||||
If the udev queue is empty and no root device is found or no root
|
||||
filesystem was mounted, the user will be dropped to a shell after
|
||||
a timeout.
|
||||
Scripts can remove themselves from the initqueue by "rm $job".
|
||||
|
||||
/pre-mount/*.sh
|
||||
scripts to run before the root filesystem is mounted
|
||||
NFS is an exception, because it has no device node to be created
|
||||
and mounts in the udev events
|
||||
|
||||
/mount/*.sh
|
||||
scripts to mount the root filesystem
|
||||
NFS is an exception, because it has no device node to be created
|
||||
and mounts in the udev events
|
||||
If the udev queue is empty and no root device is found or no root
|
||||
filesystem was mounted, the user will be dropped to a shell after
|
||||
a timeout.
|
||||
|
||||
/pre-pivot/*.sh
|
||||
scripts to run before the real init is executed and the initramfs
|
||||
disappears
|
||||
All processes started before should be killed here.
|
||||
|
||||
The behaviour of the dmraid module demonstrates how to use the new
|
||||
mechanism. If it detects a device which is part of a raidmember from a
|
||||
udev rule, it installs a job to scan for dmraid devices, if the udev
|
||||
queue is empty. After a scan, it removes itsself from the queue.
|
||||
|
||||
|
||||
|
||||
dracut-0.3
|
||||
==========
|
||||
|
||||
- first public version
|
||||
|
10
README
10
README
@@ -21,8 +21,10 @@ as hooks are guaranteed to be the path to slow-down.
|
||||
|
||||
Most of the initrd generation functionality in dracut is provided by a bunch
|
||||
of generator modules that are sourced by the main dracut script to install
|
||||
specific functionality into the initrd. They live in the modules.d subdirectory,
|
||||
and use functionality provided by dracut-functions to do their work.
|
||||
specific functionality into the initrd. They live in the modules.d
|
||||
subdirectory, and use functionality provided by dracut-functions to do their
|
||||
work.
|
||||
|
||||
Some general rules for writing modules:
|
||||
* Use one of the inst family of functions to actually install files
|
||||
on to the initrd. They handle mangling the pathnames and (for binaries,
|
||||
@@ -59,13 +61,13 @@ the documentation, git access, etc.
|
||||
|
||||
Git Repository:
|
||||
http://dracut.git.sourceforge.net/
|
||||
git://dracut.git.sourceforge.net/gitroot/dracut
|
||||
git://dracut.git.sourceforge.net/gitroot/dracut/dracut
|
||||
|
||||
Trac Instance:
|
||||
http://apps.sourceforge.net/trac/dracut/
|
||||
|
||||
The git tree can be found at
|
||||
git://dracut.git.sourceforge.net/gitroot/dracut for now. See the TODO
|
||||
git://dracut.git.sourceforge.net/gitroot/dracut/dracut for now. See the TODO
|
||||
file for things which still need to be done and HACKING for some
|
||||
instructions on how to get started. There is also a mailing list that
|
||||
is being used for the discussion -- initramfs@vger.kernel.org. It is
|
||||
|
@@ -8,3 +8,6 @@ To build a generic initramfs, you have to install the following software package
|
||||
* mdadm
|
||||
* net-tools iproute
|
||||
|
||||
Generic initramfs'es are huge (usually over 10 megs in size uncompressed), but
|
||||
should be able to automatically boot any bootable configuration with appropriate
|
||||
boot flags (root device, network configuration information, etc.)
|
@@ -35,7 +35,7 @@ check: Dracut calls this program to check and see if a module can be installed
|
||||
are present. It should exit with a 0 if they are, and a 1 if they are
|
||||
not.
|
||||
|
||||
When called with -H, it should perform the same check that it would
|
||||
When called with -h, it should perform the same check that it would
|
||||
without any options, and it should also check to see if the
|
||||
functionality the module implements is being used on the host system.
|
||||
For example, if this module handles installing support for LUKS
|
||||
@@ -43,9 +43,12 @@ check: Dracut calls this program to check and see if a module can be installed
|
||||
encrpted volumes are available and the host system has the root
|
||||
partition on an encrypted volume, 1 otherwise.
|
||||
|
||||
When called with -d, it should output a list of dracut modules
|
||||
that it relies upon. An example would be the nfs and iscsi modules,
|
||||
which rely on the network module to detect and configure network
|
||||
interfaces.
|
||||
|
||||
Check may take additional options in the future.
|
||||
We will most likely grow a module dependency checking system in the
|
||||
near future, and check will need to handle a -d option when we do.
|
||||
|
||||
Any other files in the module will not be touched by dracut directly.
|
||||
|
||||
|
53
debian/changelog
vendored
Normal file
53
debian/changelog
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
dracut (2.26) unstable; urgency=low
|
||||
|
||||
[ Harald Hoyer ]
|
||||
* multipath: install udev rules and helper tools
|
||||
* NEWS update
|
||||
* multipath: install xdr utils
|
||||
* multipath: install multipath kernel module
|
||||
* specfile update
|
||||
* dracut.8: fixed formatting for rootfs and mount options
|
||||
* dracut: check more return codes, check for permissions and use
|
||||
derror
|
||||
* dracut: create initramfs-$(kernelversion).img by default
|
||||
* Makefile: add WITH_SWITCH_ROOT
|
||||
* fips: search different lib paths
|
||||
* kernel-modules: add firewire-ohci to hardcoded modules list
|
||||
* 90dm: install more device mapper kernel modules
|
||||
* specfile update
|
||||
|
||||
[ Peter Jones ]
|
||||
* Use glob for libdir when installing multipath libraries.
|
||||
* Add #!/bin/bash for consistency.
|
||||
* Make sure and get all the multipath related modules.
|
||||
* Bring up multipath devices that are configured in multipath.conf.
|
||||
* Fix missing shell variables.
|
||||
* This has to be executable.
|
||||
* Handle modules with hyphens in their names properly.
|
||||
|
||||
[ Harald Hoyer ]
|
||||
* lvm: scan without monitor
|
||||
|
||||
[ Yanko Kaneti ]
|
||||
* Wildcards need dracut_install
|
||||
|
||||
[ Harald Hoyer ]
|
||||
* lvm/dmraid: make LIBDIR depend on the binary
|
||||
* nfs: install passwd entries for nobody and nfsnobody
|
||||
* nfs: add rd_NFS_DOMAIN parameter to set the NFSv4 domain name
|
||||
* dracut-functions: inst_simple(): do not bail out if target is a dir
|
||||
and exists
|
||||
* dm: install dmsetup
|
||||
* multipath: corrected initqueue parameter
|
||||
* rootfs-block/mount-root: remount root with /etc/fstab filesystem
|
||||
options
|
||||
* test: set PATH
|
||||
|
||||
-- Philippe Seewer <philippe.seewer@.bfh.ch> Fri, 27 Nov 2009 10:58:26 +0100
|
||||
|
||||
dracut (2.21) unstable; urgency=low
|
||||
[ Harald Hoyer ]
|
||||
* fix rd_DASD argument handling (bug #531720)
|
||||
* Resolves: rhbz#531720
|
||||
|
||||
-- Philippe Seewer <philippe.seewer@.bfh.ch> Fri, 06 Nov 2009 15:52:00 +0100
|
1
debian/compat
vendored
Normal file
1
debian/compat
vendored
Normal file
@@ -0,0 +1 @@
|
||||
5
|
40
debian/control
vendored
Normal file
40
debian/control
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
Source: dracut
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Maintainer: Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
Build-Depends: debhelper (>= 5.0), cdbs
|
||||
Standards-Version: 3.8.3
|
||||
Vcs-Browser: http://dracut.git.sourceforge.net/git/gitweb-index.cgi
|
||||
Vcs-Git: git://dracut.git.sourceforge.net/gitroot/dracut/dracut
|
||||
|
||||
Package: dracut
|
||||
Architecture: all
|
||||
Recommends: cryptsetup, dmsetup, dmraid, lvm2, mdadm
|
||||
Depends: cpio, module-init-tools, udev, ${misc:Depends}
|
||||
Provides: linux-initramfs-tool
|
||||
Description: A new initramfs infrastructure
|
||||
Unlike existing initramfs's, this is an attempt at having as little as
|
||||
possible hard-coded into the initramfs as possible. The initramfs has
|
||||
(basically) one purpose in life -- getting the rootfs mounted so that
|
||||
we can transition to the real rootfs. This is all driven off of
|
||||
device availability. Therefore, instead of scripts hard-coded to do
|
||||
various things, we depend on udev to create device nodes for us and
|
||||
then when we have the rootfs's device node, we mount and carry on.
|
||||
Having the root on MD, LVM2, LUKS is supported as well as NFS, iSCSI,
|
||||
NBD and FCOE with dracut-network.
|
||||
|
||||
Package: dracut-network
|
||||
Architecture: all
|
||||
Recommends: nfs-common, open-iscsi, nbd-client
|
||||
Depends: dracut, iputils-arping, dhcp3-client, ${misc:Depends}
|
||||
Description: A new initramfs infrastucture
|
||||
Unlike existing initramfs's, this is an attempt at having as little as
|
||||
possible hard-coded into the initramfs as possible. The initramfs has
|
||||
(basically) one purpose in life -- getting the rootfs mounted so that
|
||||
we can transition to the real rootfs. This is all driven off of
|
||||
device availability. Therefore, instead of scripts hard-coded to do
|
||||
various things, we depend on udev to create device nodes for us and
|
||||
then when we have the rootfs's device node, we mount and carry on.
|
||||
Having the root on MD, LVM2, LUKS is supported as well as NFS, iSCSI,
|
||||
NBD and FCOE with dracut-network.
|
||||
|
39
debian/copyright
vendored
Normal file
39
debian/copyright
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
This package was debianized by Philippe Seewer <philippe.seewer@bfh.ch> on
|
||||
Fri Nov 20 15:45:00 +0100
|
||||
|
||||
Sources can be downloaded from:
|
||||
|
||||
https://sourceforge.net/projects/dracut/
|
||||
|
||||
Upstream Maintainer:
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
|
||||
Updstream Authors:
|
||||
Victor Lowther <victor.lowther@gmail.com>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
Lance Albertson <lance@osuosl.org>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Quentin Armitage <quentin@armitage.org.uk>
|
||||
Sergey Fionov <fionov@gmail.com>
|
||||
Thilo Bangert <thilo.bangert@gmx.net>
|
||||
|
||||
Copyright:
|
||||
Copyright 2009 Harald Hoyer <harald@redhat.com>
|
||||
|
||||
|
||||
License: GPLv2
|
||||
|
||||
On Debian systems, the complete text of the GNU General Public
|
||||
License version 2 can be found in `/usr/share/common-licenses/GPL-2'.
|
5
debian/dracut-net.dirs
vendored
Normal file
5
debian/dracut-net.dirs
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
usr/share/dracut/modules.d/40network
|
||||
usr/share/dracut/modules.d/95fcoe
|
||||
usr/share/dracut/modules.d/95iscsi
|
||||
usr/share/dracut/modules.d/95nbd
|
||||
usr/share/dracut/modules.d/95nfs
|
5
debian/dracut-net.install
vendored
Normal file
5
debian/dracut-net.install
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
modules.d/40network usr/share/dracut/modules.d
|
||||
modules.d/95fcoe usr/share/dracut/modules.d
|
||||
modules.d/95iscsi usr/share/dracut/modules.d
|
||||
modules.d/95nbd usr/share/dracut/modules.d
|
||||
modules.d/95nfs usr/share/dracut/modules.d
|
22
debian/dracut.dirs
vendored
Normal file
22
debian/dracut.dirs
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
usr/share/dracut
|
||||
usr/share/dracut/modules.d/00dash
|
||||
usr/share/dracut/modules.d/01fips
|
||||
usr/share/dracut/modules.d/90crypt
|
||||
usr/share/dracut/modules.d/90dm
|
||||
usr/share/dracut/modules.d/90dmraid
|
||||
usr/share/dracut/modules.d/90kernel-modules
|
||||
usr/share/dracut/modules.d/90lvm
|
||||
usr/share/dracut/modules.d/90mdraid
|
||||
usr/share/dracut/modules.d/90multipath
|
||||
usr/share/dracut/modules.d/95dasd
|
||||
usr/share/dracut/modules.d/95dasd_mod
|
||||
usr/share/dracut/modules.d/95debug
|
||||
usr/share/dracut/modules.d/95resume
|
||||
usr/share/dracut/modules.d/95rootfs-block
|
||||
usr/share/dracut/modules.d/95terminfo
|
||||
usr/share/dracut/modules.d/95udev-rules
|
||||
usr/share/dracut/modules.d/95zfcp
|
||||
usr/share/dracut/modules.d/95znet
|
||||
usr/share/dracut/modules.d/98syslog
|
||||
usr/share/dracut/modules.d/99base
|
||||
/var/lib/dracut
|
4
debian/dracut.docs
vendored
Normal file
4
debian/dracut.docs
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
HACKING
|
||||
README.generic
|
||||
README.kernel
|
||||
README.modules
|
25
debian/dracut.install
vendored
Normal file
25
debian/dracut.install
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
dracut usr/sbin
|
||||
dracut-catimages usr/sbin
|
||||
dracut-update-initramfs usr/sbin
|
||||
dracut-functions usr/share/dracut
|
||||
dracut.conf etc
|
||||
modules.d/00dash usr/share/dracut/modules.d
|
||||
modules.d/01fips usr/share/dracut/modules.d
|
||||
modules.d/90crypt usr/share/dracut/modules.d
|
||||
modules.d/90dm usr/share/dracut/modules.d
|
||||
modules.d/90dmraid usr/share/dracut/modules.d
|
||||
modules.d/90kernel-modules usr/share/dracut/modules.d
|
||||
modules.d/90lvm usr/share/dracut/modules.d
|
||||
modules.d/90mdraid usr/share/dracut/modules.d
|
||||
modules.d/90multipath usr/share/dracut/modules.d
|
||||
modules.d/95dasd usr/share/dracut/modules.d
|
||||
modules.d/95dasd_mod usr/share/dracut/modules.d
|
||||
modules.d/95debug usr/share/dracut/modules.d
|
||||
modules.d/95resume usr/share/dracut/modules.d
|
||||
modules.d/95rootfs-block usr/share/dracut/modules.d
|
||||
modules.d/95terminfo usr/share/dracut/modules.d
|
||||
modules.d/95udev-rules usr/share/dracut/modules.d
|
||||
modules.d/95zfcp usr/share/dracut/modules.d
|
||||
modules.d/95znet usr/share/dracut/modules.d
|
||||
modules.d/98syslog usr/share/dracut/modules.d
|
||||
modules.d/99base usr/share/dracut/modules.d
|
2
debian/dracut.manpages
vendored
Normal file
2
debian/dracut.manpages
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
dracut.8
|
||||
dracut.conf.5
|
8
debian/dracut.postinst
vendored
Normal file
8
debian/dracut.postinst
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
# Regenerate initramfs when we're `installed`
|
||||
DPKG_MAINTSCRIPT_PACKAGE='' dracut-update-initramfs -u
|
||||
|
||||
#DEBHELPER#
|
1
debian/dracut.triggers
vendored
Normal file
1
debian/dracut.triggers
vendored
Normal file
@@ -0,0 +1 @@
|
||||
interest update-initramfs
|
3
debian/rules
vendored
Executable file
3
debian/rules
vendored
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
include /usr/share/cdbs/1/rules/debhelper.mk
|
222
dracut
222
dracut
@@ -21,6 +21,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# store for logging
|
||||
dracut_args="$@"
|
||||
|
||||
usage() {
|
||||
# 80x25 linebreak here ^
|
||||
@@ -34,7 +36,14 @@ Creates initial ramdisk images for preloading modules
|
||||
-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
|
||||
include in the initramfs.
|
||||
exclusively include in the initramfs.
|
||||
--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.
|
||||
-k, --kmoddir [DIR] Specify the directory, where to look for kernel
|
||||
modules
|
||||
--fwdir [DIR] Specify additional directories, where to look for
|
||||
@@ -43,6 +52,10 @@ Creates initial ramdisk images for preloading modules
|
||||
--no-kernel Do not install kernel drivers and firmware files
|
||||
--strip Strip binaries in the initramfs (default)
|
||||
--nostrip Do not strip binaries in the initramfs
|
||||
--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
|
||||
-h, --help This message
|
||||
--debug Output debug information of the build process
|
||||
-v, --verbose Verbose output during the build process
|
||||
@@ -69,18 +82,26 @@ while (($# > 0)); do
|
||||
-o|--omit) omit_dracutmodules_l="$2"; shift;;
|
||||
-a|--add) add_dracutmodules_l="$2"; shift;;
|
||||
-d|--drivers) drivers_l="$2"; shift;;
|
||||
--add-drivers) add_drivers_l="$2"; shift;;
|
||||
--omit-drivers) omit_drivers_l+="$2"; shift;;
|
||||
--filesystems) filesystems_l="$2"; shift;;
|
||||
-k|--kmoddir) drivers_dir_l="$2"; shift;;
|
||||
--fwdir) fw_dir_l="$2"; shift;;
|
||||
--kernel-only) kernel_only="yes"; nokernel="no";;
|
||||
--kernel-only) kernel_only="yes"; no_kernel="no";;
|
||||
--no-kernel) kernel_only="no"; no_kernel="yes";;
|
||||
--strip) do_strip_l="yes";;
|
||||
--nostrip) do_strip_l="no";;
|
||||
--mdadmconf) mdadmconf_l="yes";;
|
||||
--nomdadmconf) mdadmconf_l="no";;
|
||||
--lvmconf) lvmconf_l="yes";;
|
||||
--nolvmconf) lvmconf_l="no";;
|
||||
-h|--help) usage; exit 1 ;;
|
||||
--debug) debug="yes";;
|
||||
-v|--verbose) beverbose="yes";;
|
||||
-c|--conf) conffile="$2"; shift;;
|
||||
--confdir) confdir="$2"; shift;;
|
||||
-l|--local) allowlocal="yes" ;;
|
||||
-H|--hostonly) hostonly="-h" ;;
|
||||
-H|--hostonly) hostonly_l="yes" ;;
|
||||
-i|--include) include_src="$2"; include_target="$3"; shift 2;;
|
||||
-I|--install) install_items="$2"; shift;;
|
||||
-*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
|
||||
@@ -89,117 +110,183 @@ while (($# > 0)); do
|
||||
shift
|
||||
done
|
||||
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
export PATH
|
||||
unset LD_LIBRARY_PATH
|
||||
unset GREP_OPTIONS
|
||||
|
||||
[[ $debug ]] && {
|
||||
export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
|
||||
set -x
|
||||
}
|
||||
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
|
||||
|
||||
[[ $allowlocal && -f "$(readlink -f $(dirname $0))/dracut-functions" ]] && dracutbasedir="$(dirname $0)"
|
||||
|
||||
# if we were not passed a config file, try the default one
|
||||
[[ ! -f $conffile ]] && conffile="/etc/dracut.conf"
|
||||
if [[ ! -f $conffile ]]; then
|
||||
[[ $allowlocal ]] || conffile="/etc/dracut.conf"
|
||||
[[ $allowlocal ]] && conffile="$dracutbasedir/dracut.conf"
|
||||
fi
|
||||
|
||||
if [[ ! -d $confdir ]]; then
|
||||
[[ $allowlocal ]] || confdir="/etc/dracut.conf.d"
|
||||
[[ $allowlocal ]] && confdir="$dracutbasedir/dracut.conf.d"
|
||||
fi
|
||||
|
||||
# source our config dir
|
||||
if [ "$confdir" ] && [ -d "$confdir" ]; then
|
||||
for f in "$confdir"/*.conf; do
|
||||
[ -e "$f" ] && . "$f"
|
||||
done
|
||||
fi
|
||||
|
||||
# source our config file
|
||||
[[ -f $conffile ]] && . "$conffile"
|
||||
|
||||
# these optins add to the stuff in the config file
|
||||
[[ $add_dracutmodules_l ]] && add_dracutmodules+=" $add_dracutmodules_l"
|
||||
[[ $add_drivers_l ]] && add_drivers+=" $add_drivers_l"
|
||||
[[ $omit_drivers_l ]] && omit_drivers+=" $omit_drivers_l"
|
||||
|
||||
# these options override the stuff in the config file
|
||||
[[ $dracutmodules_l ]] && dracutmodules=$dracutmodules_l
|
||||
[[ $omit_dracutmodules_l ]] && omit_dracutmodules=$omit_dracutmodules_l
|
||||
[[ $add_dracutmodules_l ]] && add_dracutmodules="$add_dracutmodules $add_dracutmodules_l"
|
||||
[[ $drivers_l ]] && drivers=$drivers_l
|
||||
[[ $filesystems_l ]] && filesystems=$filesystems_l
|
||||
[[ $drivers_dir_l ]] && drivers_dir=$drivers_dir_l
|
||||
[[ $fw_dir_l ]] && fw_dir=$fw_dir_l
|
||||
[[ $do_strip_l ]] && do_strip=$do_strip_l
|
||||
[[ $hostonly_l ]] && hostonly=$hostonly_l
|
||||
[[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l
|
||||
[[ $lvmconf_l ]] && lvmconf=$lvmconf_l
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
|
||||
[[ $fw_dir ]] || fw_dir=/lib/firmware
|
||||
[[ $do_strip ]] || do_strip=yes
|
||||
# eliminate IFS hackery when messing with fw_dir
|
||||
fw_dir=${fw_dir//:/ }
|
||||
|
||||
[[ $allowlocal && -f "$(dirname $0)/dracut-functions" ]] && dsrc="$(dirname $0)" || dsrc=$dracutbasedir
|
||||
[[ $hostonly = yes ]] && hostonly="-h"
|
||||
[[ $hostonly != "-h" ]] && unset hostonly
|
||||
|
||||
if [[ -f $dsrc/dracut-functions ]]; then
|
||||
. $dsrc/dracut-functions
|
||||
if [[ -f $dracutbasedir/dracut-functions ]]; then
|
||||
. $dracutbasedir/dracut-functions
|
||||
else
|
||||
echo "Cannot find $dsrc/dracut-functions. Are you running from a git checkout?"
|
||||
echo "Cannot find $dracutbasedir/dracut-functions. Are you running from a git checkout?"
|
||||
echo "Try passing -l as an argument to $0"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dracutfunctions=$dsrc/dracut-functions
|
||||
dracutfunctions=$dracutbasedir/dracut-functions
|
||||
export dracutfunctions
|
||||
|
||||
dinfo "Executing $0 $dracut_args"
|
||||
|
||||
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
|
||||
|
||||
# This is kinda legacy -- eventually it should go away.
|
||||
case $dracutmodules in
|
||||
""|auto) dracutmodules="all" ;;
|
||||
esac
|
||||
|
||||
[[ $2 ]] && kernel=$2 || kernel=$(uname -r)
|
||||
[[ $1 ]] && outfile=$(readlink -f $1) || outfile="/boot/initrd-$kernel.img"
|
||||
[[ $1 ]] && outfile=$1 || outfile="/boot/initramfs-$kernel.img"
|
||||
abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile"
|
||||
|
||||
srcmods="/lib/modules/$kernel/"
|
||||
[ -n "$drivers_dir" ] && srcmods="$drivers_dir"
|
||||
[[ $drivers_dir ]] && srcmods="$drivers_dir"
|
||||
export srcmods
|
||||
|
||||
if [[ -f $outfile && ! $force ]]; then
|
||||
echo "Will not override existing initramfs ($outfile) without --force"
|
||||
derror "Will not override existing initramfs ($outfile) without --force"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
hookdirs="cmdline pre-udev pre-trigger netroot pre-mount pre-pivot mount emergency"
|
||||
outdir=$(dirname "$outfile")
|
||||
if ! [[ -d "$outdir" ]]; then
|
||||
derror "Can't write $outfile: Directory $outdir does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [[ -w "$outdir" ]]; then
|
||||
derror "No permission to write $outdir."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -f "$outfile" ]] && ! [[ -w "$outfile" ]]; then
|
||||
derror "No permission to write $outfile."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
hookdirs="cmdline pre-udev pre-trigger netroot pre-mount pre-pivot mount emergency initqueue initqueue-finished initqueue-settled initqueue-timeout
|
||||
"
|
||||
|
||||
[[ -n "$TMPDIR" ]] && ! [[ -w "$TMPDIR" ]] && unset TMPDIR
|
||||
readonly initdir=$(mktemp -d -t initramfs.XXXXXX)
|
||||
trap 'rm -rf "$initdir"' 0 # clean up after ourselves no matter how we die.
|
||||
|
||||
trap 'ret=$?;rm -rf "$initdir";exit $ret;' EXIT # clean up after ourselves no matter how we die.
|
||||
trap 'exit 1;' SIGINT # clean up after ourselves no matter how we die.
|
||||
|
||||
# Need to be able to have non-root users read stuff (rpcbind etc)
|
||||
chmod 755 "$initdir"
|
||||
|
||||
export initdir hookdirs dsrc dracutmodules drivers \
|
||||
fw_dir drivers_dir debug beverbose no_kernel kernel_only
|
||||
export initdir hookdirs dracutbasedir dracutmodules drivers \
|
||||
fw_dir drivers_dir debug beverbose no_kernel kernel_only \
|
||||
add_drivers omit_drivers mdadmconf lvmconf filesystems
|
||||
|
||||
if [[ "$kernel_only" != "yes" ]]; then
|
||||
if [[ $kernel_only != yes ]]; then
|
||||
# Create some directory structure first
|
||||
for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot tmp dev/pts var/run; do
|
||||
mkdir -p "$initdir/$d";
|
||||
for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot tmp dev/pts var/log var/run $hookdirs; do
|
||||
inst_dir "/$d"
|
||||
done
|
||||
fi
|
||||
|
||||
# check all our modules to see if they should be sourced.
|
||||
# This builds a list of modules that we will install next.
|
||||
check_modules
|
||||
|
||||
#source our modules.
|
||||
for moddir in "$dsrc/modules.d"/[0-9][0-9]*; do
|
||||
mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
|
||||
if strstr "$mods_to_load" " $mod "; then
|
||||
if [[ "$kernel_only" = "yes" ]]; then
|
||||
[[ -x "$moddir/installkernel" ]] && . "$moddir/installkernel"
|
||||
modules_loaded=" "
|
||||
# source our modules.
|
||||
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||
_d_mod=${moddir##*/}; _d_mod=${_d_mod#[0-9][0-9]}
|
||||
if strstr "$mods_to_load" " $_d_mod "; then
|
||||
if [[ $kernel_only = yes ]]; then
|
||||
[[ -x $moddir/installkernel ]] && . "$moddir/installkernel"
|
||||
else
|
||||
. "$moddir/install"
|
||||
if [[ "$no_kernel" != "yes" && -x "$moddir/installkernel" ]]; then
|
||||
[[ -x "$moddir/install" ]] && . "$moddir/install"
|
||||
if [[ $no_kernel != yes && -x $moddir/installkernel ]]; then
|
||||
. "$moddir/installkernel"
|
||||
fi
|
||||
fi
|
||||
mods_to_load=${mods_to_load// $mod /}
|
||||
modules_loaded+="$_d_mod "
|
||||
mods_to_load=${mods_to_load// $_d_mod /}
|
||||
fi
|
||||
done
|
||||
unset moddir
|
||||
echo $mods_to_load
|
||||
|
||||
## final stuff that has to happen
|
||||
|
||||
# generate module dependencies for the initrd
|
||||
if [ -d "$initdir/lib/modules/$kernel" ]; then
|
||||
if [[ -d $initdir/lib/modules/$kernel ]]; then
|
||||
if ! depmod -a -b "$initdir" $kernel; then
|
||||
echo "\"depmod -a $kernel\" failed."
|
||||
derror "\"depmod -a $kernel\" failed."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# make sure that library links are correct and up to date
|
||||
ldconfig -n -r "$initdir" /lib* /usr/lib*
|
||||
|
||||
if [[ $include_src && $include_target ]]; then
|
||||
mkdir -p "$initdir$include_target"
|
||||
cp -a -t "$initdir$include_target" "$include_src"/*
|
||||
if [[ -f $include_src ]]; then
|
||||
inst $include_src $include_target
|
||||
else
|
||||
mkdir -p "$initdir$include_target"
|
||||
cp -a -t "$initdir$include_target" "$include_src"/*
|
||||
fi
|
||||
fi
|
||||
|
||||
for item in $install_items; do
|
||||
@@ -207,40 +294,53 @@ for item in $install_items; do
|
||||
done
|
||||
unset item
|
||||
|
||||
[[ "$beverbose" = "yes" ]] && (du -c "$initdir" | sort -n)
|
||||
# make sure that library links are correct and up to date
|
||||
cp -ar /etc/ld.so.conf* "$initdir"/etc
|
||||
ldconfig -r "$initdir" || [[ $(id -u) != "0" ]] && dinfo "ldconfig might need uid=0 (root) for chroot()"
|
||||
|
||||
[[ $beverbose = yes ]] && (du -c "$initdir" | sort -n)
|
||||
|
||||
# strip binaries
|
||||
if [ "$do_strip" = "yes" ] ; then
|
||||
for p in strip objdump sed grep find; do
|
||||
if [[ $do_strip = yes ]] ; then
|
||||
for p in strip grep find; do
|
||||
if ! which $p >/dev/null 2>&1; then
|
||||
derror "Could not find '$p'. You should run $0 with '--nostrip'."
|
||||
dwarn "Could not find '$p'. Not stripping binaries in the initramfs."
|
||||
do_strip=no
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$do_strip" = "yes" ] ; then
|
||||
for f in $(find "$initdir" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; |
|
||||
grep -v ' shared object,' |
|
||||
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'); do
|
||||
dinfo "Stripping $f"
|
||||
strip -g "$f" || :
|
||||
#
|
||||
# FIXME: only strip -g for now
|
||||
#
|
||||
#strip -g --strip-unneeded "$f" || :
|
||||
#note="-R .note"
|
||||
#if objdump -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \
|
||||
# grep -q ALLOC; then
|
||||
# note=
|
||||
#fi
|
||||
#strip -R .comment $note "$f" || :
|
||||
if [[ $do_strip = yes ]] ; then
|
||||
for f in $(find "$initdir" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 -or -path '*/lib/modules/*.ko' \) ); do
|
||||
# do not strip files with a .hmac file,
|
||||
# because that would alter the checksum
|
||||
if ! [[ -f "${f%/*}/.${f##*/}.hmac" ]]; then
|
||||
dinfo "Stripping '$f'"
|
||||
strip -g "$f" 2>/dev/null|| :
|
||||
else
|
||||
dinfo "Not stripping '$f', because it has a hmac checksum file."
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
( cd "$initdir"; find . |cpio -H newc -o |gzip -9 > "$outfile"; )
|
||||
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
|
||||
done
|
||||
fi
|
||||
|
||||
[[ "$beverbose" = "yes" ]] && ls -lh "$outfile"
|
||||
type pigz &>/dev/null && gzip=pigz || gzip=gzip
|
||||
if ! ( set -o pipefail; umask 077; cd "$initdir"; find . |cpio -R root:root -H newc -o --quiet| \
|
||||
$gzip -9 > "$outfile"; ); then
|
||||
derror "dracut: creation of $outfile failed"
|
||||
rm -f "$outfile"
|
||||
exit 1
|
||||
fi
|
||||
dinfo "Wrote $outfile"
|
||||
dinfo $(ls -l "$outfile")
|
||||
|
||||
exit 0
|
||||
|
||||
|
@@ -70,7 +70,7 @@ done
|
||||
|
||||
outfile=$1; shift
|
||||
|
||||
if [ -z "$outfile" ]; then
|
||||
if [[ -z $outfile ]]; then
|
||||
derror "No output file specified."
|
||||
usage
|
||||
exit 1
|
||||
@@ -78,45 +78,48 @@ fi
|
||||
|
||||
baseimage=$1; shift
|
||||
|
||||
if [ -z "$baseimage" ]; then
|
||||
if [[ -z $baseimage ]]; then
|
||||
derror "No base image specified."
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f $outfile -a -z "$force" ]; then
|
||||
if [[ -f $outfile && ! $force ]]; then
|
||||
derror "Will not override existing initramfs ($outfile) without --force"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$no_imagedir" -a ! -d "$imagedir" ]; then
|
||||
if [[ ! $no_imagedir && ! -d $imagedir ]]; then
|
||||
derror "Image directory $overlay is not a directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$no_overlay" -a ! -d "$overlay" ]; then
|
||||
if [[ ! $no_overlay && ! -d $overlay ]]; then
|
||||
derror "Overlay $overlay is not a directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$no_overlay" ]; then
|
||||
if [[ ! $no_overlay ]]; then
|
||||
ofile="$imagedir/90-overlay.img"
|
||||
dinfo "Creating image $ofile from directory $overlay"
|
||||
( cd "$overlay"; find . |cpio --quiet -H newc -o |gzip -9 > "$ofile"; )
|
||||
type pigz &>/dev/null && gzip=pigz || gzip=gzip
|
||||
( cd "$overlay"; find . |cpio --quiet -H newc -o |$gzip -9 > "$ofile"; )
|
||||
fi
|
||||
|
||||
if [ -z "$no_imagedir" ]; then
|
||||
images=$(for i in $imagedir/*.img;do [ -f $i ] || continue; echo $i; done)
|
||||
if [[ ! $no_imagedir ]]; then
|
||||
for i in "$imagedir/"*.img; do
|
||||
[[ -f $i ]] && images+=("$i")
|
||||
done
|
||||
fi
|
||||
|
||||
images="$images $@"
|
||||
images+=($@)
|
||||
|
||||
dinfo "Using base image $baseimage"
|
||||
cat $baseimage > $outfile
|
||||
cat "$baseimage" > "$outfile"
|
||||
|
||||
for i in $images; do
|
||||
for i in "${images[@]}"; do
|
||||
dinfo "Appending $i"
|
||||
cat $i >> $outfile
|
||||
cat "$i" >> "$outfile"
|
||||
done
|
||||
|
||||
dinfo "Created $outfile"
|
||||
|
52
dracut-catimages.8
Normal file
52
dracut-catimages.8
Normal file
@@ -0,0 +1,52 @@
|
||||
.TH DRACUT-CATIMAGES 8 "June 2009" "Linux"
|
||||
.SH NAME
|
||||
dracut-catimages \- creates initial ramdisk image by concatenating images
|
||||
.SH SYNOPSIS
|
||||
\fBdracut-catimages\fR [\fIOPTION\fR]... \fI<initramfs base image>\fR \fI[<image>...]\fR
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B dracut-catimages
|
||||
creates an initial ramdisk image by concatenating several images from the command
|
||||
line and /boot/dracut/*.img
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BR \-f ", " \-\-force
|
||||
overwrite existing initramfs file.
|
||||
.TP
|
||||
.BR \-i ", " \-\-imagedir
|
||||
Directory with additional images to add (default: /boot/dracut/)
|
||||
.TP
|
||||
.BR \-o ", " \-\-overlaydir
|
||||
Overlay directory, which contains additional files that will be used to create an additional image
|
||||
.TP
|
||||
.BR \-\-nooverlay
|
||||
Do not use the overlay directory
|
||||
.TP
|
||||
.BR \-\-noimagedir
|
||||
Do not use the additional image directory
|
||||
.TP
|
||||
.BR \-h ", " \-\-help
|
||||
display help text and exit.
|
||||
.TP
|
||||
.B \-\-debug
|
||||
output debug information of the build process
|
||||
.TP
|
||||
.BR \-v ", " \-\-verbose
|
||||
verbose output during the build process
|
||||
|
||||
.SH FILES
|
||||
.TP
|
||||
.B /boot/dracut/*.img
|
||||
.TP
|
||||
.B
|
||||
.SH AUTHORS
|
||||
.nf
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
The dracut-catimages command is part of the dracut package and is available from
|
||||
http://sourceforge.net/apps/trac/dracut/wiki
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR dracut (8)
|
514
dracut-functions
514
dracut-functions
@@ -22,30 +22,228 @@ IF_RTLD=""
|
||||
IF_dynamic=""
|
||||
|
||||
# Generic substring function. If $2 is in $1, return 0.
|
||||
strstr() { [[ ! ${1#*$2*} = $1 ]]; }
|
||||
strstr() { [[ $1 =~ $2 ]]; }
|
||||
|
||||
# Log initrd creation.
|
||||
if ! [[ $dracutlogfile ]]; then
|
||||
[[ $dsrc = /usr/share/dracut ]] && \
|
||||
dracutlogfile=/var/log/dracut.log || \
|
||||
dracutlogfile=/tmp/dracut.log
|
||||
[[ -w "$dracutlogfile" ]] || dracutlogfile=/tmp/dracut.log
|
||||
>"$dracutlogfile"
|
||||
[[ $dracutbasedir = /usr/share/dracut ]] && \
|
||||
dracutlogfile=/var/log/dracut.log || \
|
||||
dracutlogfile=$HOME/dracut.log
|
||||
if [[ -w ${dracutlogfile%/*} ]]; then
|
||||
>>"$dracutlogfile"
|
||||
fi
|
||||
fi
|
||||
|
||||
dwarning() {
|
||||
echo "W: $@" >&2
|
||||
[[ -w "$dracutlogfile" ]] && echo "W: $@" >>"$dracutlogfile"
|
||||
[[ -w $dracutlogfile ]] && echo $(date) "Warn:" $@ >>"$dracutlogfile"
|
||||
}
|
||||
|
||||
dinfo() {
|
||||
[[ $beverbose ]] && echo "I: $@" >&2
|
||||
[[ -w "$dracutlogfile" ]] && echo "I: $@" >>"$dracutlogfile"
|
||||
[[ -w $dracutlogfile ]] && echo $(date) "Info:" $@ >>"$dracutlogfile"
|
||||
}
|
||||
|
||||
derror() {
|
||||
echo "E: $@" >&2
|
||||
[[ -w "$dracutlogfile" ]] && echo "E: $@" >>"$dracutlogfile"
|
||||
[[ -w $dracutlogfile ]] && echo $(date) "Err:" $@ >>"$dracutlogfile"
|
||||
}
|
||||
|
||||
|
||||
|
||||
# normalize_path <path>
|
||||
# Prints the normalized path, where it removes any duplicated
|
||||
# and trailing slashes.
|
||||
# Example:
|
||||
# $ normalize_path ///test/test//
|
||||
# /test/test
|
||||
normalize_path() {
|
||||
shopt -q -s extglob
|
||||
set -- "${1//+(\/)//}"
|
||||
shopt -q -u extglob
|
||||
echo "${1%/}"
|
||||
}
|
||||
|
||||
# convert_abs_rel <from> <to>
|
||||
# Prints the relative path, when creating a symlink to <to> from <from>.
|
||||
# Example:
|
||||
# $ convert_abs_rel /usr/bin/test /bin/test-2
|
||||
# ../../bin/test-2
|
||||
# $ ln -s $(convert_abs_rel /usr/bin/test /bin/test-2) /usr/bin/test
|
||||
convert_abs_rel() {
|
||||
local __current __absolute __abssize __cursize __newpath
|
||||
local -i __i __level
|
||||
|
||||
set -- "$(normalize_path "$1")" "$(normalize_path "$2")"
|
||||
|
||||
# corner case #1 - self looping link
|
||||
[[ "$1" == "$2" ]] && { echo "${1##*/}"; return; }
|
||||
|
||||
# corner case #2 - own dir link
|
||||
[[ "${1%/*}" == "$2" ]] && { echo "."; return; }
|
||||
|
||||
IFS="/" __current=($1)
|
||||
IFS="/" __absolute=($2)
|
||||
|
||||
__abssize=${#__absolute[@]}
|
||||
__cursize=${#__current[@]}
|
||||
|
||||
while [[ ${__absolute[__level]} == ${__current[__level]} ]]
|
||||
do
|
||||
(( __level++ ))
|
||||
if (( __level > __abssize || __level > __cursize ))
|
||||
then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
for ((__i = __level; __i < __cursize-1; __i++))
|
||||
do
|
||||
if ((__i > __level))
|
||||
then
|
||||
__newpath=$__newpath"/"
|
||||
fi
|
||||
__newpath=$__newpath".."
|
||||
done
|
||||
|
||||
for ((__i = __level; __i < __abssize; __i++))
|
||||
do
|
||||
if [[ -n $__newpath ]]
|
||||
then
|
||||
__newpath=$__newpath"/"
|
||||
fi
|
||||
__newpath=$__newpath${__absolute[__i]}
|
||||
done
|
||||
|
||||
echo "$__newpath"
|
||||
}
|
||||
|
||||
# returns OK if $1 contains $2 at the beginning
|
||||
str_starts() {
|
||||
[ "${1#$2*}" != "$1" ]
|
||||
}
|
||||
|
||||
ln_r() {
|
||||
local _source=$1
|
||||
local _dest=$2
|
||||
|
||||
if ! str_starts "$_source" "/"; then
|
||||
ln -sfn "$_source" "${initdir}/${_dest}"
|
||||
else
|
||||
[[ -d "${_dest%/*}" ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/}
|
||||
ln -sfn $(convert_abs_rel "${_dest}" "${_source}") "${initdir}/${_dest}"
|
||||
fi
|
||||
}
|
||||
|
||||
get_fs_env() {
|
||||
if [[ -x /lib/udev/vol_id ]]; then
|
||||
eval $(/lib/udev/vol_id --export $1)
|
||||
elif find_binary blkid >/dev/null; then
|
||||
eval $(blkid -o udev $1)
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
get_fs_type() (
|
||||
get_fs_env $1 || return
|
||||
echo $ID_FS_TYPE
|
||||
)
|
||||
|
||||
get_fs_uuid() (
|
||||
get_fs_env $1 || return
|
||||
echo $ID_FS_UUID
|
||||
)
|
||||
|
||||
# finds the major:minor of the block device backing the root filesystem.
|
||||
find_block_device() {
|
||||
local rootdev blkdev fs type opts misc
|
||||
while read blkdev fs type opts misc; do
|
||||
[[ $blkdev = rootfs ]] && continue # skip rootfs entry
|
||||
[[ $fs = $1 ]] && { rootdev=$blkdev; break; } # we have a winner!
|
||||
done < /proc/mounts
|
||||
[[ -b $rootdev ]] || return 1 # oops, not a block device.
|
||||
# get major/minor for the device
|
||||
ls -nLl "$rootdev" | \
|
||||
(read x x x x maj min x; maj=${maj//,/}; echo $maj:$min)
|
||||
}
|
||||
|
||||
find_root_block_device() { find_block_device /; }
|
||||
|
||||
# Walk all the slave relationships for a given block device.
|
||||
# Stop when our helper function returns success
|
||||
# $1 = function to call on every found block device
|
||||
# $2 = block device in major:minor format
|
||||
check_block_and_slaves() {
|
||||
local x
|
||||
[[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry.
|
||||
"$1" $2 && return
|
||||
check_vol_slaves "$@" && return 0
|
||||
if [[ -f "/sys/dev/block/$2/../dev" ]]; then
|
||||
check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0
|
||||
fi
|
||||
[[ -d /sys/dev/block/$2/slaves ]] || return 1
|
||||
for x in /sys/dev/block/$2/slaves/*/dev; do
|
||||
[[ -f $x ]] || continue
|
||||
check_block_and_slaves $1 $(cat "$x") && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
get_numeric_dev() {
|
||||
ls -lH "$1" | { read a b c d maj min rest; printf "%d:%d" ${maj%%,} $min;}
|
||||
}
|
||||
|
||||
# ugly workaround for the lvm design
|
||||
# There is no volume group device,
|
||||
# so, there are no slave devices for volume groups.
|
||||
# Logical volumes only have the slave devices they really live on,
|
||||
# but you cannot create the logical volume without the volume group.
|
||||
# And the volume group might be bigger than the devices the LV needs.
|
||||
check_vol_slaves() {
|
||||
for i in /dev/mapper/*; do
|
||||
lv=$(get_numeric_dev $i)
|
||||
if [[ $lv = $2 ]]; then
|
||||
vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null)
|
||||
# strip space
|
||||
vg=$(echo $vg)
|
||||
if [[ $vg ]]; then
|
||||
for pv in $(lvm vgs --noheadings -o pv_name "$vg" 2>/dev/null); \
|
||||
do
|
||||
check_block_and_slaves $1 $(get_numeric_dev $pv) \
|
||||
&& return 0
|
||||
done
|
||||
fi
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# Install a directory, keeping symlinks as on the original system.
|
||||
# Example: if /lib points to /lib64 on the host, "inst_dir /lib/file"
|
||||
# will create ${initdir}/lib64, ${initdir}/lib64/file,
|
||||
# and a symlink ${initdir}/lib -> lib64.
|
||||
inst_dir() {
|
||||
[[ -e ${initdir}/"$1" ]] && return 0 # already there
|
||||
|
||||
local _dir="$1" _part="${1%/*}" _file
|
||||
while [[ "$_part" != "${_part%/*}" ]] && ! [[ -e "${initdir}/${_part}" ]]; do
|
||||
_dir="$_part $_dir"
|
||||
_part=${_part%/*}
|
||||
done
|
||||
|
||||
# iterate over parent directories
|
||||
for _file in $_dir; do
|
||||
[[ -e "${initdir}/$_file" ]] && continue
|
||||
if [[ -L $_file ]]; then
|
||||
inst_symlink "$_file"
|
||||
else
|
||||
# create directory
|
||||
mkdir -m 0755 -p "${initdir}/$_file" || return 1
|
||||
[[ -e "$_file" ]] && chmod --reference="$_file" "${initdir}/$_file"
|
||||
chmod u+w "${initdir}/$_file"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# $1 = file to copy to ramdisk
|
||||
@@ -53,27 +251,37 @@ derror() {
|
||||
# Location of the image dir is assumed to be $initdir
|
||||
# We never overwrite the target if it exists.
|
||||
inst_simple() {
|
||||
local src target
|
||||
local src target
|
||||
[[ -f $1 ]] || return 1
|
||||
src=$1 target="${initdir}${2:-$1}"
|
||||
[[ -f $target ]] && return 0
|
||||
mkdir -p "${target%/*}"
|
||||
src=$1 target="${2:-$1}"
|
||||
if ! [[ -d ${initdir}$target ]]; then
|
||||
[[ -e ${initdir}$target ]] && return 0
|
||||
inst_dir "${target%/*}"
|
||||
fi
|
||||
# install checksum files also
|
||||
if [[ -e "${src%/*}/.${src##*/}.hmac" ]]; then
|
||||
inst "${src%/*}/.${src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
|
||||
fi
|
||||
dinfo "Installing $src"
|
||||
cp -fL "$src" "$target"
|
||||
cp -pfL "$src" "${initdir}$target"
|
||||
}
|
||||
|
||||
# Same as above, but specialzed to handle dynamic libraries.
|
||||
# Same as above, but specialized to handle dynamic libraries.
|
||||
# It handles making symlinks according to how the original library
|
||||
# is referenced.
|
||||
inst_library() {
|
||||
local src=$1 dest=${2:-$1}
|
||||
[[ -f $initdir$dest ]] && return 0
|
||||
[[ -e $initdir$dest ]] && return 0
|
||||
if [[ -L $src ]]; then
|
||||
reallib="$(readlink -f "$src")"
|
||||
# install checksum files also
|
||||
if [[ -e "${src%/*}/.${src##*/}.hmac" ]]; then
|
||||
inst "${src%/*}/.${src##*/}.hmac" "${dest%/*}/.${dest##*/}.hmac"
|
||||
fi
|
||||
reallib=$(readlink -f "$src")
|
||||
lib=${src##*/}
|
||||
inst_simple "$reallib" "$reallib"
|
||||
mkdir -p ${initdir}${dest%/*}
|
||||
(cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib")
|
||||
inst_dir "${dest%/*}"
|
||||
ln_r "$reallib" "$dest"
|
||||
else
|
||||
inst_simple "$src" "$dest"
|
||||
fi
|
||||
@@ -83,7 +291,7 @@ inst_library() {
|
||||
# search in the usual places to find the binary.
|
||||
find_binary() {
|
||||
local binpath="/bin /sbin /usr/bin /usr/sbin" p
|
||||
[[ -x $1 ]] && { echo $1; return 0; }
|
||||
[[ -z ${1##/*} && -x $1 ]] && { echo $1; return 0; }
|
||||
for p in $binpath; do
|
||||
[[ -x $p/$1 ]] && { echo "$p/$1"; return 0; }
|
||||
done
|
||||
@@ -96,10 +304,11 @@ inst_binary() {
|
||||
local bin target
|
||||
bin=$(find_binary "$1") || return 1
|
||||
target=${2:-$bin}
|
||||
inst_symlink $bin $target && return 0
|
||||
local LDSO NAME IO FILE ADDR I1 n f TLIBDIR
|
||||
[[ -f $initdir$target ]] && return 0
|
||||
[[ -e $initdir$target ]] && return 0
|
||||
# I love bash!
|
||||
ldd $bin 2>/dev/null | while read line; do
|
||||
LC_ALL=C ldd $bin 2>/dev/null | while read line; do
|
||||
[[ $line = 'not a dynamic executable' ]] && return 1
|
||||
if [[ $line =~ not\ found ]]; then
|
||||
derror "Missing a shared library required by $bin."
|
||||
@@ -110,20 +319,20 @@ inst_binary() {
|
||||
so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)'
|
||||
[[ $line =~ $so_regex ]] || continue
|
||||
FILE=${BASH_REMATCH[1]}
|
||||
[[ -f ${initdir}$FILE ]] && continue
|
||||
[[ -e ${initdir}$FILE ]] && continue
|
||||
# see if we are loading an optimized version of a shared lib.
|
||||
lib_regex='^(/lib[^/]*).*'
|
||||
if [[ $FILE =~ $lib_regex ]]; then
|
||||
TLIBDIR=${BASH_REMATCH[1]}
|
||||
BASE="${FILE##*/}"
|
||||
BASE=${FILE##*/}
|
||||
# prefer nosegneg libs, then unoptimized ones.
|
||||
for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do
|
||||
[[ -f $f/$BASE ]] || continue
|
||||
FILE="$f/$BASE"
|
||||
[[ -e $f/$BASE ]] || continue
|
||||
FILE=$f/$BASE
|
||||
break
|
||||
done
|
||||
inst_library "$FILE" "$TLIBDIR/$BASE"
|
||||
IF_dynamic="yes"
|
||||
IF_dynamic=yes
|
||||
continue
|
||||
fi
|
||||
inst_library "$FILE"
|
||||
@@ -146,18 +355,28 @@ inst_script() {
|
||||
|
||||
# same as above, but specialized for symlinks
|
||||
inst_symlink() {
|
||||
local src=$1 target=$initdir${2:-$1} realsrc
|
||||
local _src=$1 _target=${2:-$1} _realsrc
|
||||
strstr "$1" "/" || return 1
|
||||
[[ -L $1 ]] || return 1
|
||||
[[ -L $target ]] && return 0
|
||||
realsrc=$(readlink -f "$src")
|
||||
[[ $realsrc = ${realsrc##*/} ]] && realsrc="${src%/*}/$realsrc"
|
||||
inst "$realsrc" && ln -s "$realsrc" "$target"
|
||||
[[ -L $initdir/$_target ]] && return 0
|
||||
_realsrc=$(readlink -f "$_src")
|
||||
[[ ${_realsrc#/} = ${_realsrc} ]] && _realsrc="${_src%/*}/${_realsrc}"
|
||||
if ! [[ -e $initdir/$_realsrc ]]; then
|
||||
if [[ -d $_realsrc ]]; then
|
||||
inst_dir "$_realsrc"
|
||||
else
|
||||
inst "$_realsrc"
|
||||
fi
|
||||
fi
|
||||
[[ ! -e $initdir/${_target%/*} ]] && inst_dir "${_target%/*}"
|
||||
|
||||
ln_r "${_realsrc}" "${_target}"
|
||||
}
|
||||
|
||||
# find a rule in the usual places.
|
||||
# find a udev rule in the usual places.
|
||||
find_rule() {
|
||||
[[ -f $1 ]] && { echo "$1"; return 0; }
|
||||
for r in . /lib/udev/rules.d /etc/udev/rules.d $dsrc/rules.d; do
|
||||
for r in . /lib/udev/rules.d /etc/udev/rules.d $dracutbasedir/rules.d; do
|
||||
[[ -f $r/$1 ]] && { echo "$r/$1"; return 0; }
|
||||
done
|
||||
return 1
|
||||
@@ -166,10 +385,11 @@ find_rule() {
|
||||
# udev rules always get installed in the same place, so
|
||||
# create a function to install them to make life simpler.
|
||||
inst_rules() {
|
||||
local target="/etc/udev/rules.d"
|
||||
mkdir -p "$initdir/lib/udev/rules.d" "$initdir$target"
|
||||
local target=/etc/udev/rules.d
|
||||
inst_dir "/lib/udev/rules.d"
|
||||
inst_dir "$target"
|
||||
for rule in "$@"; do
|
||||
rule=$(find_rule $rule) && \
|
||||
rule=$(find_rule "$rule") && \
|
||||
inst_simple "$rule" "$target/${rule##*/}"
|
||||
done
|
||||
}
|
||||
@@ -177,10 +397,21 @@ inst_rules() {
|
||||
# general purpose installation function
|
||||
# Same args as above.
|
||||
inst() {
|
||||
if (($# != 1 && $# != 2 )); then
|
||||
derror "inst only takes 1 or 2 arguments"
|
||||
exit 1
|
||||
fi
|
||||
case $# in
|
||||
1) ;;
|
||||
2)
|
||||
[[ -z $initdir ]] && [[ -d $2 ]] && export initdir=$2
|
||||
[[ $initdir = $2 ]] && set $1
|
||||
;;
|
||||
3)
|
||||
[[ -z $initdir ]] && export initdir=$2
|
||||
set $1 $3
|
||||
;;
|
||||
*)
|
||||
derror "inst only takes 1 or 2 or 3 arguments"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
for x in inst_symlink inst_script inst_binary inst_simple; do
|
||||
$x "$@" && return 0
|
||||
done
|
||||
@@ -203,34 +434,29 @@ inst_hook() {
|
||||
}
|
||||
|
||||
dracut_install() {
|
||||
local optional=
|
||||
if [[ $1 = '-o' ]]; then
|
||||
local optional=yes
|
||||
shift
|
||||
fi
|
||||
while (($# > 0)); do
|
||||
# Might be nice to optionally install a binary
|
||||
if [ "$1" == "-o" ]; then
|
||||
optional="yes"
|
||||
shift
|
||||
continue
|
||||
fi
|
||||
if inst "$1" ; then
|
||||
shift
|
||||
continue
|
||||
fi
|
||||
if [ "$optional" == "yes" ]; then
|
||||
dwarning "Skipping program $1 as it cannot be found and is flagged to be optional"
|
||||
shift
|
||||
continue
|
||||
else
|
||||
derror "Failed to install $1"; exit 1
|
||||
fi
|
||||
if ! inst "$1" ; then
|
||||
if [[ $optional = yes ]]; then
|
||||
dinfo "Skipping program $1 as it cannot be found and is flagged to be optional"
|
||||
else
|
||||
derror "Failed to install $1"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
check_module_deps() {
|
||||
local moddir dep ret
|
||||
# if we are already set to be loaded, we do not have to be checked again.
|
||||
strstr "$mods_to_load" " $1 "
|
||||
strstr "$mods_to_load" " $1 " && return
|
||||
# turn a module name into a directory, if we can.
|
||||
moddir=$(echo ${dsrc}/modules.d/??${1})
|
||||
moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
[[ -d $moddir && -x $moddir/install ]] || return 1
|
||||
# if we do not have a check script, we are unconditionally included
|
||||
if [[ -x $moddir/check ]]; then
|
||||
@@ -249,22 +475,24 @@ check_module_deps() {
|
||||
|
||||
should_source_module() {
|
||||
local dep
|
||||
[[ -x $1/install ]] || return 1
|
||||
if [[ "$kernel_only" = "yes" ]]; then
|
||||
if [[ $kernel_only = yes ]]; then
|
||||
[[ -x $1/installkernel ]] && return 0
|
||||
return 1
|
||||
fi
|
||||
[[ -x $1/install ]] || [[ -x $1/installkernel ]] || return 1
|
||||
[[ -x $1/check ]] || return 0
|
||||
"$1/check" $hostonly || return 1
|
||||
for dep in $("$1/check" -d); do
|
||||
check_module_deps "$dep" && continue
|
||||
dwarning "Cannot load $mod, dependencies failed."
|
||||
dwarning "Cannot load dracut module \"$mod\", dependencies failed."
|
||||
return 1
|
||||
done
|
||||
}
|
||||
|
||||
check_modules() {
|
||||
for moddir in "$dsrc/modules.d"/[0-9][0-9]*; do
|
||||
local modcheck;
|
||||
local mod;
|
||||
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||
local mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
|
||||
# If we are already scheduled to be loaded, no need to check again.
|
||||
strstr "$mods_to_load" " $mod " && continue
|
||||
@@ -278,18 +506,114 @@ check_modules() {
|
||||
fi
|
||||
mods_to_load+=" $mod "
|
||||
done
|
||||
|
||||
modcheck=$add_dracutmodules
|
||||
[[ $dracutmodules != all ]] && modcheck="$m $dracutmodules"
|
||||
for mod in $modcheck; do
|
||||
strstr "$mods_to_load" "$mod" && continue
|
||||
strstr "$omit_dracutmodules" "$mod" && continue
|
||||
dwarning "Dracut module \"$mod\" cannot be found."
|
||||
done
|
||||
}
|
||||
|
||||
# install kernel modules, and handle installing all their dependencies as well.
|
||||
# Install a single kernel module along with any firmware it may require.
|
||||
# $1 = full path to kernel module to install
|
||||
install_kmod_with_fw() {
|
||||
local modname=${1##*/} fwdir found
|
||||
modname=${modname%.ko*}
|
||||
# no need to go further if the module is already installed
|
||||
[[ -e "${initdir}/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" ]] && return 0
|
||||
|
||||
if [[ $omit_drivers ]]; then
|
||||
local _kmod=${1##*/}
|
||||
_kmod=${_kmod%.ko}
|
||||
_kmod=${_kmod/-/_}
|
||||
if [[ "$_kmod" =~ $omit_drivers ]]; then
|
||||
dinfo "Omitting driver $_kmod"
|
||||
return 1
|
||||
fi
|
||||
if [[ "${1##*/lib/modules/$kernel/}" =~ $omit_drivers ]]; then
|
||||
dinfo "Omitting driver $_kmod"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \
|
||||
return $?
|
||||
|
||||
for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do
|
||||
found=''
|
||||
for fwdir in $fw_dir; do
|
||||
if [[ -d $fwdir && -f $fwdir/$fw ]]; then
|
||||
inst_simple "$fwdir/$fw" "/lib/firmware/$fw"
|
||||
found=yes
|
||||
fi
|
||||
done
|
||||
if [[ $found != yes ]]; then
|
||||
dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\""
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
# Do something with all the dependencies of a kernel module.
|
||||
# Note that kernel modules depend on themselves using the technique we use
|
||||
# $1 = function to call for each dependency we find
|
||||
# It will be passed the full path to the found kernel module
|
||||
# $2 = module to get dependencies for
|
||||
# rest of args = arguments to modprobe
|
||||
for_each_kmod_dep() {
|
||||
local func=$1 kmod=$2 cmd modpapth options
|
||||
shift 2
|
||||
modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | ( \
|
||||
local found=0;
|
||||
while read cmd modpath options; do
|
||||
[[ $cmd = insmod ]] || continue
|
||||
$func ${modpath} || exit $?
|
||||
found=1
|
||||
done; [[ $found -eq 0 ]] && exit 1; exit 0;)
|
||||
return $?
|
||||
}
|
||||
|
||||
# filter kernel modules to install certain modules that meet specific
|
||||
# requirements.
|
||||
# $1 = function to call with module name to filter.
|
||||
# This function will be passed the full path to the module to test.
|
||||
# The behaviour of this function can vary depending on whether $hostonly is set.
|
||||
# If it is, we will only look at modules that are already in memory.
|
||||
# If it is not, we will look at all kernel modules
|
||||
# This function returns the full filenames of modules that match $1
|
||||
filter_kernel_modules () (
|
||||
if ! [[ $hostonly ]]; then
|
||||
filtercmd='find "$srcmods/kernel/drivers" "$srcmods/updates" "$srcmods/extra" "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz" 2>/dev/null'
|
||||
else
|
||||
filtercmd='cut -d " " -f 1 </proc/modules|xargs modinfo -F filename -k $kernel'
|
||||
fi
|
||||
for modname in $(eval $filtercmd); do
|
||||
case $modname in
|
||||
*.ko)
|
||||
"$1" "$modname" && echo "$modname"
|
||||
;;
|
||||
*.ko.gz)
|
||||
gzip -dc "$modname" > $initdir/$$.ko
|
||||
$1 $initdir/$$.ko && echo "$modname"
|
||||
rm -f $initdir/$$.ko
|
||||
;;
|
||||
esac
|
||||
done
|
||||
)
|
||||
|
||||
# install kernel modules along with all their dependencies.
|
||||
instmods() {
|
||||
[[ "$no_kernel" = "yes" ]] && return
|
||||
[[ $no_kernel = yes ]] && return
|
||||
local mod mpargs modpath modname cmd
|
||||
local ret=0
|
||||
while (($# > 0)); do
|
||||
mod=${1%.ko}
|
||||
mod=${1%.ko*}
|
||||
case $mod in
|
||||
=*) # This introduces 2 incompatible meanings for =* arguments
|
||||
# to instmods. We need to decide which one to keep.
|
||||
if [ "$mod" = "=ata" -a -f $srcmods/modules.block ] ; then
|
||||
if [[ $mod = =ata && -f $srcmods/modules.block ]] ; then
|
||||
instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block")
|
||||
elif [ -f $srcmods/modules.${mod#=} ]; then
|
||||
instmods $mpargs $(cat ${srcmods}/modules.${mod#=} )
|
||||
@@ -297,49 +621,41 @@ instmods() {
|
||||
instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*")
|
||||
fi
|
||||
;;
|
||||
--*) mpargs+=" $mod";;
|
||||
--*)
|
||||
mod=${mod##*/}
|
||||
mpargs+=" $mod";;
|
||||
i2o_scsi)
|
||||
# Must never run this diagnostic-only module
|
||||
shift; continue;
|
||||
;;
|
||||
*) mod=${mod##*/}
|
||||
# if we are already installed, skip this module and go on
|
||||
*)
|
||||
# if we are already installed, skip this module and go on
|
||||
# to the next one.
|
||||
[[ -f $initdir/$1 ]] && { shift; continue; }
|
||||
|
||||
mod=${mod##*/}
|
||||
|
||||
if [[ $omit_drivers ]] && [[ "$1" =~ $omit_drivers ]]; then
|
||||
dinfo "Omitting driver ${mod##$srcmods}"
|
||||
shift; continue;
|
||||
fi
|
||||
|
||||
# If we are building a host-specific initramfs and this
|
||||
# module is not already loaded, move on to the next one.
|
||||
[[ $hostonly ]] && ! grep -q "$mod" /proc/modules && {
|
||||
[[ $hostonly ]] && ! grep -q "${mod//-/_}" /proc/modules && \
|
||||
! echo $add_drivers | grep -qe "\<${mod}\>" && {
|
||||
shift; continue;
|
||||
}
|
||||
modprobe $mpargs --ignore-install --set-version $kernel -d ${srcmods%%/lib/modules/*}/ \
|
||||
--show-depends $mod 2>/dev/null | \
|
||||
while read cmd modpath options; do
|
||||
[[ $cmd = insmod ]] || continue
|
||||
modname=${modpath##*/}
|
||||
modname=${modname%.ko}
|
||||
if [[ ${mod/-/_} != ${modname/-/_} ]]; then
|
||||
dinfo "Installing dependencies for $mod ($modpath)"
|
||||
instmods $mpargs $modname
|
||||
fi
|
||||
inst_simple "$modpath" "/lib/modules/$kernel/${modpath##*/lib/modules/$kernel/}"
|
||||
for fw in $(modinfo -k $kernel -F firmware $modpath 2>/dev/null); do
|
||||
unset found
|
||||
IFS=:
|
||||
for fwdir in $fw_dir; do
|
||||
if [ -d "$fwdir" -a -f $fwdir/$fw ]; then
|
||||
inst_simple "$fwdir/$fw" "/lib/firmware/$fw"
|
||||
found=yes
|
||||
fi
|
||||
done
|
||||
if [ "$found" != "yes" ]; then
|
||||
dwarning "Possible missing firmware ${fw} for module ${mod}.ko"
|
||||
fi
|
||||
done
|
||||
done
|
||||
;;
|
||||
# ok, load the module, all its dependencies, and any firmware
|
||||
# it may require
|
||||
for_each_kmod_dep install_kmod_with_fw $mod \
|
||||
--set-version $kernel -d ${srcmods%%/lib/modules/*}/
|
||||
ret=$((ret+$?))
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
return $ret
|
||||
}
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
|
@@ -19,24 +19,46 @@
|
||||
#
|
||||
#. /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() {
|
||||
local NONL=""
|
||||
if [ "$1" == "-n" ]; then
|
||||
NONL="-n"
|
||||
shift
|
||||
fi
|
||||
echo $NONL "$@" >&2
|
||||
echo "$@" >&2
|
||||
}
|
||||
|
||||
function vecho() {
|
||||
return
|
||||
local NONL=""
|
||||
if [ "$1" == "-n" ]; then
|
||||
NONL="-n"
|
||||
shift
|
||||
fi
|
||||
is_verbose && echo $NONL "$@"
|
||||
is_verbose && echo "$@"
|
||||
}
|
||||
|
||||
# module dep finding and installation functions
|
||||
@@ -52,18 +74,11 @@ moduledep() {
|
||||
[ -n "$deps" ] && vecho ": $deps" || vecho
|
||||
}
|
||||
|
||||
if [ $UID != 0 ]; then
|
||||
error "$0 must be run as root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export MALLOC_PERTURB_=204
|
||||
|
||||
PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
|
||||
export PATH
|
||||
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
# Set the umask. For iscsi, the initrd can contain plaintext
|
||||
# password (chap secret), so only allow read by owner.
|
||||
umask 077
|
||||
@@ -137,13 +152,21 @@ qpopd() {
|
||||
popd >/dev/null 2>&1
|
||||
}
|
||||
|
||||
resolve_device_name() {
|
||||
echo "$1"
|
||||
# echo "resolve_device_name $1" 1>&2
|
||||
}
|
||||
|
||||
freadlink() {
|
||||
/usr/bin/readlink -f "$1"
|
||||
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() {
|
||||
@@ -189,7 +212,7 @@ findstoragedriverinsys () {
|
||||
sysfs=$(freadlink ${sysfs%/*})
|
||||
fi
|
||||
|
||||
if [[ ! "$sysfs" =~ '^/sys/.*block/.*$' ]]; then
|
||||
if [[ ! "$sysfs" =~ ^/sys/.*block/.*$ ]]; then
|
||||
#error "WARNING: $sysfs is a not a block sysfs path, skipping"
|
||||
return
|
||||
fi
|
||||
@@ -200,12 +223,12 @@ findstoragedriverinsys () {
|
||||
*) handleddevices="$handleddevices $sysfs" ;;
|
||||
esac
|
||||
|
||||
if [[ "$sysfs" =~ '^/sys/.*block/md[0-9]+$' ]]; then
|
||||
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
|
||||
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
|
||||
@@ -589,9 +612,7 @@ done
|
||||
else
|
||||
# check if it's root by label
|
||||
rdev=$rootdev
|
||||
if [[ "$rdev" =~ ^(UUID=|LABEL=) ]]; then
|
||||
rdev=$(resolve_device_name "$rdev")
|
||||
fi
|
||||
rdev=$(resolve_device_name "$rdev")
|
||||
rootopts=$(echo $rootopts | sed -e 's/^r[ow],//' -e 's/,_netdev//' -e 's/_netdev//' -e 's/,r[ow],$//' -e 's/,r[ow],/,/' -e 's/^r[ow]$/defaults/' -e 's/$/,ro/')
|
||||
findstoragedriver "$rdev"
|
||||
fi
|
||||
@@ -600,9 +621,7 @@ done
|
||||
[ -z "$thawdev" ] && thawdev=$(awk '/^[ \t]*[^#]/ { if ($3 == "swap") { print $1; exit }}' $fstab)
|
||||
swsuspdev="$thawdev"
|
||||
if [ -n "$swsuspdev" ]; then
|
||||
if [[ "$swsuspdev" =~ ^(UUID=|LABEL=) ]]; then
|
||||
swsuspdev=$(resolve_device_name "$swsuspdev")
|
||||
fi
|
||||
swsuspdev=$(resolve_device_name "$swsuspdev")
|
||||
findstoragedriver "$swsuspdev"
|
||||
fi
|
||||
|
||||
@@ -643,36 +662,41 @@ emitcrypto()
|
||||
if [ -z "$luksuuid" ]; then
|
||||
luksuuid="$2"
|
||||
fi
|
||||
luksuuid=${luksuuid##UUID=}
|
||||
echo -n "rd_LUKS_UUID=$luksuuid "
|
||||
}
|
||||
|
||||
for cryptdev in ${!cryptopart@} ; do
|
||||
emitcrypto `eval echo '$'$cryptdev`
|
||||
done
|
||||
|
||||
if [ -n "$raiddevices" ]; then
|
||||
for dev in $raiddevices; do
|
||||
echo -n "rd_MD_UUID=${dev} "
|
||||
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
|
||||
|
||||
for cryptdev in ${!cryptoraid@} ; do
|
||||
emitcrypto `eval echo '$'$cryptdev`
|
||||
done
|
||||
|
||||
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
|
||||
|
||||
for cryptdev in ${!cryptolv@} ; do
|
||||
emitcrypto `eval echo '$'$cryptdev`
|
||||
done
|
||||
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
|
||||
. /etc/sysconfig/keyboard
|
||||
. /etc/sysconfig/i18n
|
||||
[ -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)
|
||||
@@ -687,13 +711,5 @@ if [ -n "$rootdev" ]; then
|
||||
echo -n "root=$rootdev "
|
||||
fi
|
||||
|
||||
if [ -L /usr/share/plymouth/themes/default.plymouth ]; then
|
||||
theme=$(basename \
|
||||
$(dirname \
|
||||
$(readlink -f \
|
||||
/usr/share/plymouth/themes/default.plymouth)))
|
||||
[ -n "$theme" ] && echo -n "rd_plytheme=$theme "
|
||||
fi
|
||||
|
||||
echo
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
|
20
dracut-gencmdline.8
Normal file
20
dracut-gencmdline.8
Normal file
@@ -0,0 +1,20 @@
|
||||
.TH DRACUT-GENCMDLINE 8 "June 2009" "Linux"
|
||||
.SH NAME
|
||||
dracut-gencmdline \- generates kernel command line parameters for the dracut generated initramfs
|
||||
.SH SYNOPSIS
|
||||
.BR dracut-gencmdline
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B dracut-gencmdline
|
||||
generates kernel command line parameters for the dracut generated initramfs, which are very specific to the host system.
|
||||
|
||||
.SH AUTHORS
|
||||
.nf
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
The dracut-gencmdline command is part of the dracut package and is available from
|
||||
http://sourceforge.net/apps/trac/dracut/wiki
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR dracut (8)
|
1764
dracut-rhel6.xml
Normal file
1764
dracut-rhel6.xml
Normal file
File diff suppressed because it is too large
Load Diff
558
dracut-update-initramfs
Executable file
558
dracut-update-initramfs
Executable file
@@ -0,0 +1,558 @@
|
||||
#!/bin/sh
|
||||
|
||||
STATEDIR=/var/lib/dracut
|
||||
BOOTDIR=/boot
|
||||
CONF=/etc/dracut.conf
|
||||
KPKGCONF=/etc/kernel-img.conf
|
||||
USETRIGGERS=true
|
||||
mode=""
|
||||
version=""
|
||||
|
||||
set -e
|
||||
|
||||
if $USETRIGGERS \
|
||||
&& [ x"$DPKG_MAINTSCRIPT_PACKAGE" != x ] \
|
||||
&& [ $# = 1 ] \
|
||||
&& [ x"$1" = x-u ] \
|
||||
&& dpkg-trigger --check-supported 2>/dev/null
|
||||
then
|
||||
if dpkg-trigger --no-await update-initramfs; then
|
||||
echo "dracut-update-initramfs: deferring update (trigger activated)"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
usage()
|
||||
{
|
||||
if [ -n "${1}" ]; then
|
||||
printf "${@}\n\n" >&2
|
||||
fi
|
||||
cat >&2 << EOF
|
||||
Usage: ${0} [OPTION]...
|
||||
|
||||
Options:
|
||||
-k [version] Specify kernel version or 'all'
|
||||
-c Create a new initramfs
|
||||
-u Update an existing initramfs
|
||||
-d Remove an existing initramfs
|
||||
-t Take over a custom initramfs with this one
|
||||
-b Set alternate boot directory
|
||||
-v Be verbose
|
||||
-h This message
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
# chroot check
|
||||
chrooted()
|
||||
{
|
||||
# borrowed from udev's postinst
|
||||
if [ "$(stat -c %d/%i /)" = "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ]; then
|
||||
# the devicenumber/inode pair of / is the same as that of
|
||||
# /sbin/init's root, so we're *not* in a chroot and hence
|
||||
# return false.
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
mild_panic()
|
||||
{
|
||||
if [ -n "${1}" ]; then
|
||||
printf "${@}\n" >&2
|
||||
fi
|
||||
exit 0
|
||||
}
|
||||
|
||||
panic()
|
||||
{
|
||||
if [ -n "${1}" ]; then
|
||||
printf "${@}\n" >&2
|
||||
fi
|
||||
exit 1
|
||||
}
|
||||
|
||||
verbose()
|
||||
{
|
||||
if [ "${verbose}" = 1 ]; then
|
||||
printf "${@}\n"
|
||||
fi
|
||||
}
|
||||
|
||||
version_exists()
|
||||
{
|
||||
[ -e "${STATEDIR}/${1}" ] && [ -e "${initramfs}" ]
|
||||
return $?
|
||||
}
|
||||
|
||||
set_initramfs()
|
||||
{
|
||||
initramfs="${BOOTDIR}/dracut.img-${version}"
|
||||
}
|
||||
|
||||
|
||||
# backup initramfs while running
|
||||
backup_initramfs()
|
||||
{
|
||||
[ ! -r "${initramfs}" ] && return 0
|
||||
initramfs_bak="${initramfs}.dpkg-bak"
|
||||
[ -r "${initramfs_bak}" ] && rm -f "${initramfs_bak}"
|
||||
ln -f "${initramfs}" "${initramfs_bak}" \
|
||||
|| cp -a "${initramfs}" "${initramfs_bak}"
|
||||
verbose "Keeping ${initramfs_bak}"
|
||||
}
|
||||
|
||||
# keep booted initramfs
|
||||
backup_booted_initramfs()
|
||||
{
|
||||
initramfs_bak="${initramfs}.dpkg-bak"
|
||||
|
||||
# first time run thus no backup
|
||||
[ ! -r "${initramfs_bak}" ] && return 0
|
||||
|
||||
# chroot with no /proc
|
||||
[ ! -r /proc/uptime ] && rm -f "${initramfs_bak}" && return 0
|
||||
|
||||
# no kept backup wanted
|
||||
[ "${backup_initramfs}" = "no" ] && rm -f "${initramfs_bak}" && return 0
|
||||
|
||||
# no backup yet
|
||||
if [ ! -r "${initramfs}.bak" ]; then
|
||||
mv -f ${initramfs_bak} "${initramfs}.bak"
|
||||
verbose "Backup ${initramfs}.bak"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# keep booted initramfs
|
||||
uptime_days=$(awk '{printf "%d", $1 / 3600 / 24}' /proc/uptime)
|
||||
if [ -n "$uptime_days" ]; then
|
||||
boot_initramfs=$(find "${initramfs}.bak" -mtime +${uptime_days})
|
||||
fi
|
||||
if [ -n "${boot_initramfs}" ]; then
|
||||
mv -f "${initramfs_bak}" "${initramfs}.bak"
|
||||
verbose "Backup ${initramfs}.bak"
|
||||
return 0
|
||||
fi
|
||||
verbose "Removing current backup ${initramfs_bak}"
|
||||
rm -f ${initramfs_bak}
|
||||
}
|
||||
|
||||
# nuke generated copy
|
||||
remove_initramfs()
|
||||
{
|
||||
[ -z "${initramfs_bak}" ] && return 0
|
||||
rm -f "${initramfs_bak}"
|
||||
verbose "Removing ${initramfs_bak}"
|
||||
}
|
||||
|
||||
|
||||
generate_initramfs()
|
||||
{
|
||||
echo "dracut-update-initramfs: Generating ${initramfs}"
|
||||
OPTS=""
|
||||
if [ "${verbose}" = 1 ]; then
|
||||
OPTS="-v ${OPTS}"
|
||||
fi
|
||||
##WORK HERE!
|
||||
if dracut ${OPTS} "${initramfs}.new" "${version}"; then
|
||||
mv -f "${initramfs}.new" "${initramfs}"
|
||||
set_sha1
|
||||
else
|
||||
mkinitramfs_return="$?"
|
||||
remove_initramfs
|
||||
rm -f "${initramfs}.new"
|
||||
if [ "$mkinitramfs_return" = "2" ]; then
|
||||
# minversion wasn't met, exit 0
|
||||
exit 0
|
||||
fi
|
||||
echo "update-initramfs: failed for ${initramfs}"
|
||||
exit $mkinitramfs_return
|
||||
fi
|
||||
}
|
||||
|
||||
# lilo call
|
||||
run_lilo()
|
||||
{
|
||||
# show lilo errors on failure
|
||||
if ! lilo -t > /dev/null 2>&1 ; then
|
||||
echo "ERROR lilo fails for new ${initramfs}:"
|
||||
echo
|
||||
lilo -t
|
||||
fi
|
||||
lilo
|
||||
}
|
||||
|
||||
# check if lilo is on mbr
|
||||
mbr_check()
|
||||
{
|
||||
# try to discover grub|grub2 and be happy
|
||||
[ -r /boot/grub/grub.cfg ] \
|
||||
&& groot=$(awk '/^set root=/{print substr($2, 7, 3); exit}' \
|
||||
/boot/grub/grub.cfg)
|
||||
[ -r /boot/grub/menu.lst ] \
|
||||
&& groot=$(awk '/^root/{print substr($2, 2, 3); exit}' \
|
||||
/boot/grub/menu.lst)
|
||||
[ -e /boot/grub/device.map ] && [ -n "${groot}" ] \
|
||||
&& dev=$(awk "/${groot}/{ print \$NF}" /boot/grub/device.map)
|
||||
[ -n "${dev}" ] && [ -r ${dev} ] \
|
||||
&& dd if="${dev}" bs=512 skip=0 count=1 2> /dev/null \
|
||||
| grep -q GRUB && return 0
|
||||
|
||||
# check out lilo.conf for validity
|
||||
boot=$(awk -F = '/^boot=/{ print $2}' /etc/lilo.conf)
|
||||
[ -z "${boot}" ] && return 0
|
||||
case ${boot} in
|
||||
/dev/md/*)
|
||||
if [ -r /proc/mdstat ]; then
|
||||
MD=${boot#/dev/md/}
|
||||
boot="/dev/$(awk "/^md${MD}/{print substr(\$5, 1, 3)}" \
|
||||
/proc/mdstat)"
|
||||
fi
|
||||
;;
|
||||
/dev/md*)
|
||||
if [ -r /proc/mdstat ]; then
|
||||
MD=${boot#/dev/}
|
||||
boot="/dev/$(awk "/^${MD}/{print substr(\$5, 1, 3)}" \
|
||||
/proc/mdstat)"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
[ ! -r "${boot}" ] && return 0
|
||||
dd if="${boot}" bs=512 skip=0 count=1 2> /dev/null | grep -q LILO \
|
||||
&& run_lilo && return 0
|
||||
|
||||
# no idea which bootloader is used
|
||||
echo
|
||||
echo "WARNING: grub and lilo installed."
|
||||
echo "If you use grub as bootloader everything is fine."
|
||||
echo "If you use lilo as bootloader you must run lilo!"
|
||||
echo
|
||||
}
|
||||
|
||||
# Invoke bootloader
|
||||
run_bootloader()
|
||||
{
|
||||
# if both lilo and grub around, figure out if lilo needs to be run
|
||||
if ( command -v update-grub >/dev/null 2>&1 \
|
||||
|| [ -e /boot/grub/menu.lst ] || [ -e /boot/grub/grub.cfg ] ) \
|
||||
&& ( [ -e /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1 ); then
|
||||
[ -r "${KPKGCONF}" ] && \
|
||||
do_b=$(awk '/^do_bootloader/{print $3}' "${KPKGCONF}")
|
||||
if [ "${do_b}" = "yes" ] || [ "${do_b}" = "Yes" ] \
|
||||
|| [ "${do_b}" = "YES" ]; then
|
||||
run_lilo
|
||||
return 0
|
||||
elif [ "${do_b}" = "no" ] || [ "${do_b}" = "No" ] \
|
||||
|| [ "${do_b}" = "NO" ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
# do_bootloader unconfigured
|
||||
mbr_check
|
||||
return 0
|
||||
fi
|
||||
if [ -r /etc/lilo.conf ] && command -v lilo >/dev/null 2>&1; then
|
||||
run_lilo
|
||||
return 0
|
||||
fi
|
||||
if command -v elilo >/dev/null 2>&1; then
|
||||
elilo
|
||||
return 0
|
||||
fi
|
||||
if [ -r /etc/zipl.conf ]; then
|
||||
zipl
|
||||
fi
|
||||
if flash-kernel --supported >/dev/null 2>&1; then
|
||||
flash-kernel ${version}
|
||||
fi
|
||||
}
|
||||
|
||||
compare_sha1()
|
||||
{
|
||||
sha1sum "${initramfs}" | diff "${STATEDIR}/${version}" - >/dev/null 2>&1
|
||||
return $?
|
||||
}
|
||||
|
||||
# Note that this must overwrite so that updates work.
|
||||
set_sha1()
|
||||
{
|
||||
sha1sum "${initramfs}" > "${STATEDIR}/${version}"
|
||||
}
|
||||
|
||||
delete_sha1()
|
||||
{
|
||||
rm -f "${STATEDIR}/${version}"
|
||||
}
|
||||
|
||||
# ro /boot is not modified
|
||||
ro_boot_check()
|
||||
{
|
||||
# check irrelevant inside of a chroot
|
||||
if [ ! -r /proc/mounts ] || chrooted; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
boot_opts=$(awk '/boot/{if ((match($4, /^ro/) || match($4, /,ro/)) \
|
||||
&& $2 == "/boot") print "ro"}' /proc/mounts)
|
||||
if [ -n "${boot_opts}" ]; then
|
||||
echo "WARNING: /boot is ro mounted."
|
||||
echo "update-initramfs: Not updating ${initramfs}"
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
get_sorted_versions()
|
||||
{
|
||||
version_list=""
|
||||
|
||||
for gsv_x in "${STATEDIR}"/*; do
|
||||
gsv_x="$(basename "${gsv_x}")"
|
||||
if [ "${gsv_x}" = '*' ]; then
|
||||
return 0
|
||||
fi
|
||||
worklist=""
|
||||
for gsv_i in $version_list; do
|
||||
if dpkg --compare-versions "${gsv_x}" '>' "${gsv_i}"; then
|
||||
worklist="${worklist} ${gsv_x} ${gsv_i}"
|
||||
gsv_x=""
|
||||
else
|
||||
worklist="${worklist} ${gsv_i}"
|
||||
fi
|
||||
done
|
||||
if [ "${gsv_x}" != "" ]; then
|
||||
worklist="${worklist} ${gsv_x}"
|
||||
fi
|
||||
version_list="${worklist}"
|
||||
done
|
||||
|
||||
verbose "Available versions: ${version_list}"
|
||||
}
|
||||
|
||||
set_current_version()
|
||||
{
|
||||
if [ -f /boot/dracut.img-`uname -r` ]; then
|
||||
version=`uname -r`
|
||||
fi
|
||||
}
|
||||
|
||||
set_linked_version()
|
||||
{
|
||||
if [ -e /initrd.img ] && [ -L /initrd.img ]; then
|
||||
linktarget="$(basename "$(readlink /initrd.img)")"
|
||||
fi
|
||||
|
||||
if [ -e /boot/initrd.img ] && [ -L /boot/initrd.img ]; then
|
||||
linktarget="$(basename "$(readlink /boot/initrd.img)")"
|
||||
fi
|
||||
|
||||
if [ -z "${linktarget}" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
version="${linktarget##*img-}"
|
||||
}
|
||||
|
||||
set_highest_version()
|
||||
{
|
||||
get_sorted_versions
|
||||
set -- ${version_list}
|
||||
version=${1}
|
||||
}
|
||||
|
||||
create()
|
||||
{
|
||||
if [ -z "${version}" ]; then
|
||||
usage "Create mode requires a version argument"
|
||||
fi
|
||||
|
||||
set_initramfs
|
||||
|
||||
if [ "${takeover}" = 0 ]; then
|
||||
if version_exists "${version}"; then
|
||||
panic "Cannot create version ${version}: already exists"
|
||||
fi
|
||||
|
||||
if [ -e "${initramfs}" ]; then
|
||||
panic "${initramfs} already exists, cannot create."
|
||||
fi
|
||||
fi
|
||||
|
||||
generate_initramfs
|
||||
}
|
||||
|
||||
update()
|
||||
{
|
||||
if [ "${update_initramfs}" = "no" ]; then
|
||||
echo "update-initramfs: Not updating initramfs."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -z "${version}" ]; then
|
||||
set_highest_version
|
||||
fi
|
||||
|
||||
if [ -z "${version}" ]; then
|
||||
set_linked_version
|
||||
fi
|
||||
|
||||
if [ -z "${version}" ]; then
|
||||
set_current_version
|
||||
fi
|
||||
|
||||
if [ -z "${version}" ]; then
|
||||
verbose "Nothing to do, exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
set_initramfs
|
||||
|
||||
ro_boot_check
|
||||
|
||||
altered_check
|
||||
|
||||
backup_initramfs
|
||||
|
||||
generate_initramfs
|
||||
|
||||
run_bootloader
|
||||
|
||||
backup_booted_initramfs
|
||||
}
|
||||
|
||||
delete()
|
||||
{
|
||||
if [ -z "${version}" ]; then
|
||||
usage "Delete mode requires a version argument"
|
||||
fi
|
||||
|
||||
set_initramfs
|
||||
|
||||
if [ ! -e "${initramfs}" ]; then
|
||||
panic "Cannot delete ${initramfs}, doesn't exist."
|
||||
fi
|
||||
|
||||
if ! version_exists "${version}"; then
|
||||
panic "Cannot delete version ${version}: Not created by this utility."
|
||||
fi
|
||||
|
||||
altered_check
|
||||
|
||||
echo "update-initramfs: Deleting ${initramfs}"
|
||||
|
||||
delete_sha1
|
||||
|
||||
rm -f "${initramfs}"
|
||||
}
|
||||
|
||||
# Check for update mode on existing and modified initramfs
|
||||
altered_check()
|
||||
{
|
||||
# No check on takeover
|
||||
[ "${takeover}" = 1 ] && return 0
|
||||
if [ ! -e "${initramfs}" ]; then
|
||||
mild_panic "${initramfs} does not exist. Cannot update."
|
||||
fi
|
||||
if ! compare_sha1; then
|
||||
echo "update-initramfs: ${initramfs} has been altered." >&2
|
||||
mild_panic "update-initramfs: Cannot update. Override with -t option."
|
||||
fi
|
||||
}
|
||||
|
||||
# Defaults
|
||||
verbose=0
|
||||
yes=0
|
||||
# We default to takeover=1 in Ubuntu, but not Debian
|
||||
takeover=0
|
||||
|
||||
##
|
||||
|
||||
while getopts "k:cudyvtb:h?" flag; do
|
||||
case "${flag}" in
|
||||
k)
|
||||
version="${OPTARG}"
|
||||
;;
|
||||
c)
|
||||
mode="c"
|
||||
;;
|
||||
d)
|
||||
mode="d"
|
||||
;;
|
||||
u)
|
||||
mode="u"
|
||||
;;
|
||||
v)
|
||||
verbose="1"
|
||||
;;
|
||||
y)
|
||||
yes="1"
|
||||
;;
|
||||
t)
|
||||
takeover="1"
|
||||
;;
|
||||
b)
|
||||
BOOTDIR="${OPTARG}"
|
||||
if [ ! -d "${BOOTDIR}" ]; then
|
||||
echo "Error: ${BOOTDIR} is not a directory."
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
h|?)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $((${OPTIND} - 1))
|
||||
|
||||
if [ $# -ne 0 ]; then
|
||||
echo "Invalid argument for option -k."
|
||||
usage
|
||||
fi
|
||||
|
||||
# Validate arguments
|
||||
if [ -z "${mode}" ]; then
|
||||
usage "You must specify at least one of -c, -u, or -d."
|
||||
fi
|
||||
|
||||
if [ "${version}" = "all" ] \
|
||||
|| ( [ "${update_initramfs}" = "all" ] && [ -z "${version}" ] ); then
|
||||
: FIXME check for --yes, and if not ask are you sure
|
||||
get_sorted_versions
|
||||
if [ -z "${version_list}" ]; then
|
||||
verbose "Nothing to do, exiting."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
OPTS="-b ${BOOTDIR}"
|
||||
if [ "${verbose}" = "1" ]; then
|
||||
OPTS="${OPTS} -v"
|
||||
fi
|
||||
if [ "${takeover}" = "1" ]; then
|
||||
OPTS="${OPTS} -t"
|
||||
fi
|
||||
if [ "${yes}" = "1" ]; then
|
||||
OPTS="${OPTS} -y"
|
||||
fi
|
||||
for u_version in ${version_list}; do
|
||||
# Don't stop if one version doesn't work.
|
||||
set +e
|
||||
verbose "Execute: ${0} -${mode} -k \"${u_version}\" ${OPTS}"
|
||||
"${0}" -${mode} -k "${u_version}" ${OPTS}
|
||||
set -e
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
||||
case "${mode}" in
|
||||
c)
|
||||
create
|
||||
;;
|
||||
d)
|
||||
delete
|
||||
;;
|
||||
u)
|
||||
update
|
||||
;;
|
||||
esac
|
452
dracut.8
452
dracut.8
@@ -1,16 +1,16 @@
|
||||
.TH DRACUT 8 "June 2009" "Linux"
|
||||
.SH NAME
|
||||
switch_root \- switch to another filesystem as the root of the mount tree.
|
||||
dracut \- create initial ramdisk images for preloading modules
|
||||
.SH SYNOPSIS
|
||||
\fBdracut\fR [\fIOPTION\fR]... \fI<image>\fR \fI<kernel-version>\fR
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B switch_root
|
||||
\fBdracut\fR creates an initial image used by the kernel for
|
||||
.B 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.
|
||||
|
||||
.SH OPTIONS
|
||||
.SS Options
|
||||
.TP
|
||||
.BR \-f ", " \-\-force
|
||||
overwrite existing initramfs file.
|
||||
@@ -28,7 +28,27 @@ omit a space-separated list of dracut modules.
|
||||
add a space-separated list of dracut modules.
|
||||
.TP
|
||||
.BR \-d ", " \-\-drivers " \fILIST\fR"
|
||||
specify a space-separated list of kernel modules to include in the initramfs.
|
||||
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.
|
||||
.TP
|
||||
.BR \-\-add-drivers " \fILIST\fR"
|
||||
specify a space-separated list of kernel modules to add to the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix.
|
||||
.TP
|
||||
.BR \-\-omit-drivers " \fILIST\fR"
|
||||
specify a space-separated list of kernel modules to omit from the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix.
|
||||
Regular expressions are also allowed like ".*/fs/ocfs/.*".
|
||||
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes.
|
||||
|
||||
example:
|
||||
# dracut --omit "module1 module2" ...
|
||||
.TP
|
||||
.BR \-\-filesystems " \fILIST\fR"
|
||||
specify a space-separated list of kernel filesystem modules to exclusively
|
||||
include in the generic initramfs.
|
||||
.TP
|
||||
.BR \-k ", " \-\-kmoddir " \fI{DIR}\fR
|
||||
specify the directory, where to look for kernel modules
|
||||
@@ -42,6 +62,12 @@ only install kernel drivers and firmware files
|
||||
.BR \-\-no-kernel
|
||||
do not install kernel drivers and firmware files
|
||||
.TP
|
||||
.BR \-\-mdadmconf
|
||||
include local /etc/mdadm.conf
|
||||
.TP
|
||||
.BR \-\-nomdadmconf
|
||||
do not include local /etc/mdadm.conf
|
||||
.TP
|
||||
.BR \-\-strip
|
||||
strip binaries in the initramfs (default)
|
||||
.TP
|
||||
@@ -62,6 +88,11 @@ specify configuration file to use.
|
||||
Default:
|
||||
.IR /etc/dracut.conf
|
||||
.TP
|
||||
.BR \-\-confdir " \fIDIR\fR"
|
||||
specify configuration directory to use.
|
||||
Default:
|
||||
.IR /etc/dracut.conf.d
|
||||
.TP
|
||||
.BR \-l ", " \-\-local
|
||||
local mode. Use modules from the current working
|
||||
directory instead of the system-wide installed in
|
||||
@@ -79,7 +110,7 @@ target directory in the final initramfs.
|
||||
.BR \-I ", " \-\-install " \fILIST\fR"
|
||||
install the space separated list of files into the initramfs.
|
||||
|
||||
.SH KERNEL COMMAND LINE
|
||||
.SH "KERNEL COMMAND LINE"
|
||||
The root filesystem used by the kernel is specified in the boot configuration
|
||||
file, as always. The traditional \fBroot=/dev/hda1\fR style device
|
||||
specification is allowed. If a label is used, as in \fBroot=LABEL=rootPart\fR
|
||||
@@ -88,111 +119,257 @@ with the appropriate label, and mount that device as the root filesystem.
|
||||
\fBroot=UUID=uuidnumber\fR will mount the partition with that UUID as the
|
||||
root filesystem.
|
||||
|
||||
.SH Standard
|
||||
.SS Standard
|
||||
.TP
|
||||
.B init=<path to real init>
|
||||
.BR init= "<path to real init>"
|
||||
.TP
|
||||
.B root=<path to blockdevice>
|
||||
specify e.g. \fI/dev/sda1\fR or
|
||||
\fI/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1\fR
|
||||
.BR root= "<path to blockdevice>"
|
||||
specify blockdevice to use as root filesystem.
|
||||
e.g.
|
||||
root=/dev/sda1
|
||||
root=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1
|
||||
.TP
|
||||
.BR rootfstype= "<filesystem type>"
|
||||
"auto" if not specified, e.g. rootfstype=ext3
|
||||
.TP
|
||||
.BR 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.
|
||||
.TP
|
||||
\fBrootfallback=\fR\fI<path to blockdevice>\fR
|
||||
specify the block device to use as the root filesystem, if the normal root cannot be found\&. This can only be a simple block device with a simple file system, for which the filesystem driver is either compiled in, or added manually to the initramfs\&. This parameter can be specified multiple times\&.
|
||||
.TP
|
||||
.B rd_NO_FSTAB
|
||||
do not honor special mount options for the root filesystem found in
|
||||
/etc/fstab of the real root.
|
||||
|
||||
.SH I18N
|
||||
e.g. LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=de-latin1-nodeadkeys
|
||||
.SS Misc
|
||||
.TP
|
||||
.B KEYBOARDTYPE=sun|pc
|
||||
.BR hostname= "<hostname>"
|
||||
set the initial hostname
|
||||
.TP
|
||||
.BR rdblacklist= "<drivername>"
|
||||
do not load kernel module <drivername>
|
||||
This parameter can be specified multiple times.
|
||||
.TP
|
||||
.BR rdloaddriver= "<drivername>"
|
||||
force loading kernel module <drivername>
|
||||
This parameter can be specified multiple times.
|
||||
.TP
|
||||
.BR rd_retry= "<seconds>"
|
||||
wait <seconds> until dracut tries to force assemble LVM or RAID volumes. If the root device is not found within <seconds>*2 then dracut fails and either drops to a shell, if rdshell is on the kernel command line, or exits with 1, which normally causes a kernel panic.
|
||||
|
||||
Default: rd_retry=40
|
||||
|
||||
.SS Debug
|
||||
.TP
|
||||
.B rdinfo
|
||||
print informational output though "quiet" is set
|
||||
.TP
|
||||
.B rdshell
|
||||
allow dropping to a shell, if root mounting fails
|
||||
.TP
|
||||
.B rdinitdebug
|
||||
set -x for the dracut shell and logs to dmesg, console and /init.log
|
||||
.TP
|
||||
.B rdbreak
|
||||
drop to a shell at the end
|
||||
.TP
|
||||
.ad l
|
||||
.BR rdbreak= \%{cmdline\:|pre-udev\:|pre-trigger\:|initqueue\:|pre-mount\:|mount\:|pre-pivot}
|
||||
.ad
|
||||
drop to a shell on defined breakpoint
|
||||
.TP
|
||||
.B rdudevinfo
|
||||
set udev to loglevel info
|
||||
.TP
|
||||
.B rdudevdebug
|
||||
set udev to loglevel debug
|
||||
|
||||
.SS I18N
|
||||
e.g.
|
||||
LANG=en_US.UTF-8
|
||||
SYSFONT=latarcyrheb-sun16
|
||||
KEYTABLE=de-latin1-nodeadkeys
|
||||
.TP
|
||||
.BR KEYBOARDTYPE= sun|pc
|
||||
will be written to /etc/sysconfig/keyboard in the initramfs
|
||||
.TP
|
||||
.B KEYTABLE=<keytable filename>
|
||||
.BR KEYTABLE= "<keytable filename>"
|
||||
will be written to /etc/sysconfig/keyboard in the initramfs
|
||||
.TP
|
||||
.B SYSFONT= Console font
|
||||
.BR SYSFONT= "Console font"
|
||||
will be written to /etc/sysconfig/i18n in the initramfs
|
||||
.TP
|
||||
.B SYSFONTACM= Unicode font map
|
||||
.BR SYSFONTACM= "Unicode font map"
|
||||
will be written to /etc/sysconfig/i18n in the initramfs
|
||||
.TP
|
||||
.B UNIMAP= Unicode font map
|
||||
.BR UNIMAP= "Unicode font map"
|
||||
will be written to /etc/sysconfig/i18n in the initramfs
|
||||
.TP
|
||||
.B LANG=<locale>
|
||||
.BR LANG= <locale>
|
||||
will be written to /etc/sysconfig/i18n in the initramfs
|
||||
|
||||
.SH Bootsplash - plymouth
|
||||
.SS LVM
|
||||
.TP
|
||||
.B rd_plytheme=<theme name>
|
||||
specify the plymouth bootsplash theme (fallback is text)
|
||||
|
||||
.SH LVM
|
||||
.TP
|
||||
.B rd_NO_LVM
|
||||
.BR rd_NO_LVM
|
||||
disable LVM detection
|
||||
.TP
|
||||
.B rd_LVM_VG=<volume group name>
|
||||
.BR rd_LVM_VG= "<volume group name>"
|
||||
only activate the volume groups with the given name
|
||||
|
||||
.SH crypto LUKS
|
||||
rd_LVM_VG can be specified multiple times on the kernel command line.
|
||||
.TP
|
||||
.B rd_NO_LUKS
|
||||
.BR 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.
|
||||
.TP
|
||||
.BR rd_NO_LVMCONF
|
||||
remove any /etc/lvm/lvm.conf, which may exist in the initramfs
|
||||
|
||||
.SS "crypto LUKS"
|
||||
.TP
|
||||
.BR rd_NO_LUKS
|
||||
disable crypto LUKS detection
|
||||
.TP
|
||||
.B rd_LUKS_UUID=<luks uuid>
|
||||
.BR rd_LUKS_UUID= "<luks uuid>"
|
||||
only activate the LUKS partitions with the given UUID
|
||||
|
||||
.SH MD
|
||||
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.
|
||||
.TP
|
||||
.B rd_NO_MD
|
||||
.BR rd_NO_CRYPTTAB
|
||||
do not check, if LUKS partition is in /etc/crypttab
|
||||
|
||||
.SS MD
|
||||
.TP
|
||||
.BR rd_NO_MD
|
||||
disable MD RAID detection
|
||||
.TP
|
||||
.B rd_NO_MDIMSM
|
||||
.BR rd_NO_MDIMSM
|
||||
no MD RAID for imsm/isw raids, use dmraid instead
|
||||
.TP
|
||||
.B rd_MD_UUID=<md uuid>
|
||||
only activate the raid sets with the given UUID
|
||||
|
||||
.SH DMRAID
|
||||
.BR rd_NO_MDADMCONF
|
||||
ignore mdadm.conf included in initramfs
|
||||
.TP
|
||||
.B rd_NO_DM
|
||||
.BR rd_MD_UUID= "<md uuid>"
|
||||
only activate the raid sets with the given UUID.
|
||||
This parameter can be specified multiple times.
|
||||
|
||||
.SS DMRAID
|
||||
.TP
|
||||
.BR rd_NO_DM
|
||||
disable DM RAID detection
|
||||
.TP
|
||||
.B rd_DM_UUID=<dmraid uuid>
|
||||
only activate the raid sets with the given UUID
|
||||
.BR rd_DM_UUID= "<dmraid uuid>"
|
||||
only activate the raid sets with the given UUID.
|
||||
This parameter can be specified multiple times.
|
||||
|
||||
.SH DASD
|
||||
.SS MULTIPATH
|
||||
.TP
|
||||
.B dasd=....
|
||||
same syntax as the kernel module parameter (s390 only)
|
||||
.BR rd_NO_MULTIPATH
|
||||
disable multipath in the initramfs
|
||||
|
||||
.SH DHCP
|
||||
.SS FIPS
|
||||
.TP
|
||||
.B root=dhcp
|
||||
get IP from dhcp server, root-path option from dhcp specifies root location
|
||||
.BR fips=1
|
||||
enable FIPS
|
||||
.TP
|
||||
.BR 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>
|
||||
|
||||
.SH NFS
|
||||
If the root device is encrypted, the /boot partition must reside on a seperate partition and has to be specified.
|
||||
|
||||
.SS Network
|
||||
.TP
|
||||
.B root=[<server-ip>:]<root-dir>[:<nfs-options>]
|
||||
.BR 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.
|
||||
.sp
|
||||
\fBauto6\fR: IPv6 autoconfiguration
|
||||
.sp
|
||||
\fBdhcp6\fR: IPv6 DHCP
|
||||
.sp
|
||||
\fBibft\fR: iBFT autoconfiguration
|
||||
|
||||
.TP
|
||||
.BR ip= <interface>:{dhcp|on|any|dhcp6|auto6}
|
||||
dhcp|on|any|dhcp6: get ip from dhcp server on a specific interface
|
||||
auto6: do IPv6 autoconfiguration
|
||||
This parameter can be specified multiple times.
|
||||
|
||||
.TP
|
||||
.ad l
|
||||
.BR ip= "\%<client-IP>\::[<server-id>]\::<gateway-IP>\::<netmask>\::<client\%hostname>\::<interface>\::{none|off}"
|
||||
.ad
|
||||
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.
|
||||
.TP
|
||||
.BR ifname= <interface>:<MAC>
|
||||
Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>.
|
||||
Note that if you use this option you \fBmust\fR specify an ifname= argument
|
||||
for all interfaces used in ip= or fcoe= arguments
|
||||
This parameter can be specified multiple times.
|
||||
.TP
|
||||
.BR bootdev= <interface>
|
||||
specify network interface to use routing and netroot information from.
|
||||
Required if multiple ip= lines are used.
|
||||
.TP
|
||||
.BR nameserver= "<IP> [nameserver=<IP> ...]"
|
||||
specify nameserver(s) to use
|
||||
.TP
|
||||
.BR 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)
|
||||
This parameter can be specified multiple times.
|
||||
.TP
|
||||
.BR 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
|
||||
.TP
|
||||
.BR 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
|
||||
.TP
|
||||
.BR biosdevname={0|1]}
|
||||
turn off/on biosdevname network interface renaming
|
||||
.SS NFS
|
||||
.TP
|
||||
.BR 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.
|
||||
NFS options can be appended with the prefix "." or ","
|
||||
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 ",".
|
||||
.TP
|
||||
.B root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>]
|
||||
.BR root= "nfs:[<server-ip>:]<root-dir>[:<nfs-options>]"
|
||||
.TP
|
||||
.B root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]
|
||||
.BR root= "nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]"
|
||||
.TP
|
||||
.B root=dhcp
|
||||
.BR 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>]
|
||||
.TP
|
||||
.B root=/dev/nfs nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
|
||||
.BR root= /dev/nfs " nfsroot=" "[<server-ip>:]<root-dir>[,<nfs-options>]"
|
||||
\fBDeprecated!\fR kernel Documentation/filesystems/nfsroot.txt defines
|
||||
this method.
|
||||
This is supported by dracut but not recommended.
|
||||
|
||||
.SH iSCSI
|
||||
.TP
|
||||
.B root=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname>
|
||||
.BR rd_NFS_DOMAIN= "<NFSv4 domain name>"
|
||||
Set the NFSv4 domain name. Will overwrite the settings in /etc/idmap.conf.
|
||||
|
||||
.SS iSCSI
|
||||
.TP
|
||||
.ad l
|
||||
.BR root= "\%iscsi:[username:password\:[:reverse:password]@]\:[<servername>]\::[<protocol>]\::[<port>]\:[:[<iscsi_iface_name>]:[<netdev_name>]]\::[<LUN>]\::<targetname>"
|
||||
.ad
|
||||
protocol defaults to "6", LUN defaults to "0".
|
||||
|
||||
If the "servername" field is provided by BOOTP or DHCP, then that
|
||||
@@ -205,95 +382,130 @@ associated fields.
|
||||
http://tools.ietf.org/html/rfc4173
|
||||
|
||||
.TP
|
||||
.B root=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname>
|
||||
.ad l
|
||||
.BR root= "\%iscsi:[username:password\:[:reverse:password]@]\:[<servername>]\::[<protocol>]\::[<port>]\:[:[<iscsi_iface_name>]:[<netdev_name>]]\::[<LUN>]\::<targetname>"
|
||||
.ad
|
||||
e.g. root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
|
||||
|
||||
.ad l
|
||||
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
|
||||
.TP
|
||||
.B root=??? netroot=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname> ...
|
||||
.ad l
|
||||
.BR root= ??? " netroot=" "\%iscsi:[username:password[:reverse:password]@]\:[<servername>]\::[<protocol>]\::[<port>]\:[:[<iscsi_iface_name>]:[<netdev_name>]]\::[<LUN>]\::<targetname> ..."
|
||||
.ad
|
||||
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
|
||||
.B not yet implemented
|
||||
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
|
||||
|
||||
.ad l
|
||||
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
|
||||
.TP
|
||||
.B root=??? iscsi_initiator= iscsi_target_name= iscsi_target_ip= iscsi_target_port= iscsi_target_group= iscsi_username= iscsi_password= iscsi_in_username= iscsi_in_password=
|
||||
.ad l
|
||||
.BR \%root= \%??? " \%iscsi_initiator=" \%<initiator> " \%iscsi_target_name=" "<target name>" " \%iscsi_target_ip=" "<target ip>" " \%iscsi_target_port=" "<target port>" " \%iscsi_target_group=" "<target group>" " \%iscsi_username=" "<username>" " \%iscsi_password=" <password> " \%iscsi_in_username=" "<in username>" " \%iscsi_in_password=" "<in password>"
|
||||
.ad
|
||||
manually specify all iscsistart parameter (see \fIiscsistart\ --help\fR)
|
||||
|
||||
.TP
|
||||
.B root=??? iscsi_firmware
|
||||
.BR root= ??? " netroot=iscsi iscsi_firmware"
|
||||
will read the iscsi parameter from the BIOS firmware
|
||||
|
||||
.SH NBD
|
||||
.TP
|
||||
.B root=nbd:<server>:<port>[:<fstype>][:<mountopts>]
|
||||
.BR 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 iscsi_param=node.session.timeo.replacement_timeout=30"
|
||||
will result in
|
||||
iscsistart -b --param node.session.timeo.replacement_timeout=30
|
||||
|
||||
.SS FCoE
|
||||
.TP
|
||||
.BR fcoe=<edd|interface|MAC>:<dcb|nodcb>
|
||||
Try to connect to a FCoE SAN through the NIC specified by <interface> or <MAC> or EDD settings.
|
||||
This parameter can be specified multiple times.
|
||||
|
||||
.SS NBD
|
||||
.TP
|
||||
.BR root= nbd:<server>:<port>[:<fstype>][:<mountopts>]
|
||||
mount nbd share from <server>
|
||||
.TP
|
||||
.B root=dhcp
|
||||
with dhcp root-path=nbd:<server>:<port>[:<fstype>][:<mountopts>]
|
||||
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.
|
||||
.BR root= dhcp
|
||||
with dhcp root-path=nbd:<server>:<port>[:<fstype>][:<mountopts>]
|
||||
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.
|
||||
|
||||
.SH Network
|
||||
.TP bootdev=<interface>
|
||||
.B specify the network interface to boot from
|
||||
.TP
|
||||
.B ip={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.
|
||||
.TP
|
||||
.B ip=<interface>:{dhcp|on|any}
|
||||
get ip from dhcp server on a specific interface
|
||||
.TP
|
||||
.B ip=<client-IP-number>:[<server-id>]:<gateway-IP-number>:<netmask>:<client-hostname>:<interface>:{none|off}
|
||||
explicit network configuration
|
||||
|
||||
.SH Misc
|
||||
.SS DASD
|
||||
.TP
|
||||
.B rdblacklist=<drivername>
|
||||
do not load kernel module <drivername>
|
||||
.BR rd_DASD_MOD= ....
|
||||
same syntax as the kernel module parameter (s390 only)
|
||||
|
||||
.SH Debug
|
||||
.TP
|
||||
.B rdshell
|
||||
allow dropping to a shell, if root mounting fails
|
||||
.TP
|
||||
.B rdinitdebug
|
||||
set -x for the dracut shell
|
||||
.TP
|
||||
.B rdbreak
|
||||
drop to a shell at the end
|
||||
.TP
|
||||
.B rdbreak={pre-udev|pre-mount|mount|pre-pivot|commandline|initqueue}
|
||||
drop to a shell on defined breakpoint
|
||||
.TP
|
||||
.B rdudevinfo
|
||||
set udev to loglevel info
|
||||
.TP
|
||||
.B rdudevdebug
|
||||
set udev to loglevel debug
|
||||
.TP
|
||||
.B rdnetdebug
|
||||
debug network scripts in dracut. Output is written to /tmp/
|
||||
.ad l
|
||||
.BR rd_DASD= "\%<dasd adaptor device bus ID>\:[,readonly=X]\:[,use_diag=X]\:[,erplog=X]\:[,failfast=X]"
|
||||
.ad
|
||||
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.
|
||||
|
||||
.SH CONFIGURATION IN INITRAMFS
|
||||
.SS ZFCP
|
||||
.TP
|
||||
.BR rd_ZFCP= "<zfcp adaptor device bus ID>,\:<WWPN>,\:<FCPLUN>"
|
||||
rd_ZFCP can be specified multiple times on the kernel command line.
|
||||
|
||||
example: rd_ZFCP=0.0.4000,0x5005076300C213e9,0x5022000000000000
|
||||
.TP
|
||||
.BR rd_NO_ZFCPCONF
|
||||
ignore zfcp.conf included in the initramfs
|
||||
|
||||
.SS ZNET
|
||||
.TP
|
||||
.BR rd_ZNET= "<nettype>,<subchannels>,<options>"
|
||||
rd_ZNET can be specified multiple times on the kernel command line. Examples:
|
||||
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
|
||||
|
||||
.SS "Plymouth Boot Splash"
|
||||
.TP
|
||||
.BR rd_NO_PLYMOUTH
|
||||
do not start plymouth. This will not work with encrypted partitions.
|
||||
|
||||
.SH FILES
|
||||
.TP
|
||||
.B /var/log/dracut.log
|
||||
.TP
|
||||
.B /etc/dracut.conf
|
||||
see \fBdracut.conf\fR(5)
|
||||
.SS "Configuration in the Initramfs"
|
||||
.TP
|
||||
.B /conf/conf.d/
|
||||
Any files found in /conf/conf.d/ will be sourced in the initramfs to
|
||||
.B /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.
|
||||
.TP
|
||||
.B /etc/cmdline
|
||||
Can contain additional command line options.
|
||||
|
||||
.SH AUTHORS
|
||||
.nf
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Seewer Philippe <philippe.seewer@bfh.ch>
|
||||
Victor Lowther <victor.lowther@gmail.com>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
David Dillow <dave@thedillows.org>
|
||||
.fi
|
||||
.SH AVAILABILITY
|
||||
The dracut command is part of the dracut package and is available from
|
||||
https://sourceforge.net/apps/trac/dracut/wiki
|
||||
|
||||
http://sourceforge.net/apps/trac/dracut/wiki
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR dracut.conf (5)
|
||||
|
24
dracut.conf
24
dracut.conf
@@ -1,10 +1,26 @@
|
||||
# Sample dracut config file
|
||||
|
||||
# Specific list of dracut modules to use
|
||||
#dracutmodules=""
|
||||
#dracutmodules+=""
|
||||
|
||||
# Dracut modules to omit
|
||||
#omit_dracutmodules=""
|
||||
#omit_dracutmodules+=""
|
||||
|
||||
# Additional kernel modules to install
|
||||
#drivers=""
|
||||
# Dracut modules to add to the default
|
||||
#add_dracutmodules+=""
|
||||
|
||||
# additional kernel modules to the default
|
||||
#add_drivers+=""
|
||||
|
||||
# list of kernel filesystem modules to be included in the generic initramfs
|
||||
#filesystems+=""
|
||||
|
||||
# build initrd only to boot current hardware
|
||||
#hostonly="yes"
|
||||
#
|
||||
|
||||
# install local /etc/mdadm.conf
|
||||
mdadmconf="yes"
|
||||
|
||||
# install local /etc/lvm/lvm.conf
|
||||
lvmconf="yes"
|
||||
|
78
dracut.conf.5
Normal file
78
dracut.conf.5
Normal file
@@ -0,0 +1,78 @@
|
||||
.TH DRACUT.CONF 5 "NOV 2009" "Linux"
|
||||
.SH NAME
|
||||
dracut.conf \- configuration file for dracut
|
||||
|
||||
.SH SYNOPSIS
|
||||
\fB/etc/dracut.conf\fR
|
||||
|
||||
.SH DESCRIPTION
|
||||
.B dracut.conf
|
||||
is loaded during the initialisation phase of dracut.
|
||||
Command line parameter will overwrite any values set here.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BR dracutmodules+= \%"\ [LIST]\ "
|
||||
Specify a space-separated list of dracut modules to
|
||||
call when building the initramfs. Modules are located
|
||||
in /usr/share/dracut/modules.d.
|
||||
.TP
|
||||
.BR omit_dracutmodules+= \%"\ [LIST]\ "
|
||||
Omit a space-separated list of dracut modules.
|
||||
.TP
|
||||
.BR add_dracutmodules+= \%"\ [LIST]\ "
|
||||
Add a space-separated list of dracut modules.
|
||||
.TP
|
||||
.BR drivers+= \%"\ [LIST]\ "
|
||||
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.
|
||||
.TP
|
||||
.BR add_drivers+= \%"\ [LIST]\ "
|
||||
Specify a space-separated list of kernel
|
||||
modules to add to the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix.
|
||||
.TP
|
||||
.BR omit_drivers+= \%"\ [LIST]\ "
|
||||
Specify a space-separated list of kernel
|
||||
modules to omit from the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix.
|
||||
Regular expressions are also allowed like ".*/fs/foo/.* .*/fs/bar/.*".
|
||||
.TP
|
||||
.BR filesystems+= \%"\ [LIST]\ "
|
||||
Specify a space-separated list of kernel filesystem
|
||||
modules to exclusively include in the generic
|
||||
initramfs.
|
||||
.TP
|
||||
.BR drivers_dir= \%"<dir>"
|
||||
Specify the directory, where to look for kernel modules
|
||||
.TP
|
||||
.BR fw_dir+= \%":<dir>[:<dir>\ ...]"
|
||||
Specify additional directories, where to look for firmwares, separated by :
|
||||
.TP
|
||||
.BR do_strip= \%"yes|no"
|
||||
Strip binaries in the initramfs (default=yes)
|
||||
.TP
|
||||
.BR hostonly= \%"yes|no"
|
||||
Host-Only mode: Install only what is needed for booting
|
||||
the local host instead of a generic host.
|
||||
.TP
|
||||
.BR mdadmconf= \%"yes|no"
|
||||
Include local /etc/mdadm.conf (default=yes)
|
||||
.TP
|
||||
.BR lvmconf= \%"yes|no"
|
||||
Include local /etc/lvm/lvm.conf (default=yes)
|
||||
.TP
|
||||
.BR kernel_only= \%"yes|no"
|
||||
Only install kernel drivers and firmware files. (default=no)
|
||||
.TP
|
||||
.BR no_kernel= \%"yes|no"
|
||||
Do not install kernel drivers and firmware files (default=no)
|
||||
.TP
|
||||
\fBinstall_items+=\fR"\ \&\fI<file>\fR[ \fI<file>\fR\ \&\&...]\ \&"
|
||||
|
||||
Specify additional files to include in the initramfs, separated by spaces.
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR dracut (8)
|
||||
|
9
dracut.logrotate
Normal file
9
dracut.logrotate
Normal file
@@ -0,0 +1,9 @@
|
||||
/var/log/dracut.log {
|
||||
missingok
|
||||
notifempty
|
||||
compress
|
||||
delaycompress
|
||||
copytruncate
|
||||
size 1M
|
||||
create 0600 root root
|
||||
}
|
BIN
dracut.png
Normal file
BIN
dracut.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
313
dracut.spec
313
dracut.spec
@@ -1,140 +1,291 @@
|
||||
%if 0%{?fedora} < 12
|
||||
%define with_switch_root 1
|
||||
%else
|
||||
%define with_switch_root 1
|
||||
%endif
|
||||
# Variables must be defined
|
||||
%define with_switch_root 1
|
||||
%define with_nbd 1
|
||||
|
||||
%if %{defined gittag}
|
||||
%define rdist 1.git%{gittag}%{?dist}
|
||||
%define dashgittag -%{gittag}
|
||||
%else
|
||||
%define rdist %{?dist}
|
||||
# switchroot provided by util-linux-ng in F-12+
|
||||
%if 0%{?fedora} > 11 || 0%{?rhel} >= 6
|
||||
%define with_switch_root 0
|
||||
%endif
|
||||
# nbd in Fedora only
|
||||
%if 0%{?rhel} >= 6
|
||||
%define with_nbd 0
|
||||
%endif
|
||||
|
||||
Name: dracut
|
||||
Version: 0.7
|
||||
Release: 1%{?rdist}
|
||||
Version: 004
|
||||
Release: 1%{?dist}
|
||||
Summary: Initramfs generator using udev
|
||||
Group: System Environment/Base
|
||||
License: GPLv2+
|
||||
Group: System Environment/Base
|
||||
License: GPLv2+
|
||||
URL: http://apps.sourceforge.net/trac/dracut/wiki
|
||||
Source0: dracut-%{version}%{?dashgittag}.tar.bz2
|
||||
|
||||
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.bz2
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
Requires: udev
|
||||
Requires: util-linux-ng
|
||||
Requires: module-init-tools
|
||||
Requires: cpio
|
||||
Requires: coreutils
|
||||
Requires: findutils
|
||||
Requires: binutils
|
||||
Requires: grep
|
||||
Requires: mktemp
|
||||
Requires: mount
|
||||
Requires: bash
|
||||
Requires: /bin/sh
|
||||
Requires: fileutils, grep, mount, gzip, tar, mktemp >= 1.5-5, findutils
|
||||
Requires: lvm2 >= 2.02.33-9, dhclient
|
||||
Requires: filesystem >= 2.1.0, cpio, device-mapper, initscripts >= 8.63-1
|
||||
Requires: e2fsprogs >= 1.38-12, libselinux, libsepol, coreutils
|
||||
Requires: mdadm, elfutils-libelf, plymouth >= 0.7.0
|
||||
Requires: cryptsetup-luks
|
||||
Requires: bridge-utils
|
||||
%ifnarch s390 s390x
|
||||
Requires: dmraid
|
||||
Requires: kbd
|
||||
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6
|
||||
# no "provides", because dracut does not offer
|
||||
# all functionality of the obsoleted packages
|
||||
Obsoletes: mkinitrd <= 6.0.93
|
||||
Obsoletes: mkinitrd-devel <= 6.0.93
|
||||
Obsoletes: nash <= 6.0.93
|
||||
Obsoletes: libbdevid-python <= 6.0.93
|
||||
%endif
|
||||
|
||||
Requires: bash
|
||||
Requires: bzip2
|
||||
Requires: coreutils
|
||||
Requires: cpio
|
||||
Requires: dash
|
||||
Requires: filesystem >= 2.1.0
|
||||
Requires: findutils
|
||||
Requires: grep
|
||||
Requires: gzip
|
||||
Requires: initscripts >= 8.63-1
|
||||
Requires: kbd
|
||||
Requires: mktemp >= 1.5-5
|
||||
Requires: module-init-tools >= 3.7-9
|
||||
Requires: mount
|
||||
Requires: plymouth >= 0.8.0-0.2009.29.09.19.1
|
||||
Requires: plymouth-scripts
|
||||
Requires: sed
|
||||
Requires: tar
|
||||
Requires: udev
|
||||
Requires: util-linux-ng >= 2.16
|
||||
Requires: which
|
||||
Requires: file
|
||||
|
||||
%if ! 0%{?with_switch_root}
|
||||
Requires: /sbin/switch_root
|
||||
Requires: util-linux-ng >= 2.16
|
||||
BuildArch: noarch
|
||||
%endif
|
||||
|
||||
BuildRequires: docbook-style-xsl docbook-dtds libxslt
|
||||
BuildRequires: dash bash git
|
||||
|
||||
%description
|
||||
dracut is a new, event-driven initramfs infrastructure based around udev.
|
||||
|
||||
%package network
|
||||
Summary: Dracut modules to build a dracut initramfs with network support
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: dhclient rpcbind nfs-utils
|
||||
Requires: iscsi-initiator-utils
|
||||
%if %{with_nbd}
|
||||
Requires: nbd
|
||||
%endif
|
||||
Requires: net-tools iproute
|
||||
Requires: bridge-utils
|
||||
|
||||
%description network
|
||||
This package requires everything which is needed to build a generic
|
||||
all purpose initramfs with network support with dracut.
|
||||
|
||||
%package fips
|
||||
Summary: Dracut modules to build a dracut initramfs with an integrity check
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: hmaccalc fipscheck
|
||||
%if 0%{?rhel} > 5
|
||||
# For Alpha 3, we want nss instead of nss-softokn
|
||||
Requires: nss
|
||||
%else
|
||||
Requires: nss-softokn
|
||||
%endif
|
||||
Requires: nss-softokn-freebl >= 3.14.3-22.el6_6
|
||||
|
||||
%description fips
|
||||
This package requires everything which is needed to build an
|
||||
all purpose initramfs with dracut, which does an integrity check.
|
||||
|
||||
%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}
|
||||
Requires: libcap
|
||||
|
||||
%description caps
|
||||
This package requires everything which is needed to build an
|
||||
all purpose initramfs with dracut, which drops capabilities.
|
||||
|
||||
%package generic
|
||||
Summary: Metapackage to build a generic initramfs with dracut
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: rpcbind nfs-utils
|
||||
Requires: iscsi-initiator-utils
|
||||
Requires: nbd
|
||||
Requires: net-tools iproute
|
||||
Requires: plymouth-system-theme plymouth-theme-charge plymouth-theme-solar
|
||||
Requires: %{name}-network = %{version}-%{release}
|
||||
|
||||
%description generic
|
||||
This package requires everything which is needed to build a generic
|
||||
all purpose initramfs with dracut.
|
||||
|
||||
|
||||
%package kernel
|
||||
Summary: Metapackage to build generic initramfs with dracut with only kernel modules
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: ql2100-firmware
|
||||
Requires: ql2200-firmware
|
||||
Requires: ql23xx-firmware
|
||||
Requires: ql2400-firmware
|
||||
Requires: ql2500-firmware
|
||||
|
||||
%description kernel
|
||||
This package requires everything which is needed to build a initramfs with all
|
||||
kernel modules and firmware files needed by dracut modules.
|
||||
|
||||
%package tools
|
||||
Summary: dracut tools to build the local initramfs
|
||||
Summary: Dracut tools to build the local initramfs
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: ql2100-firmware
|
||||
Requires: ql2200-firmware
|
||||
Requires: ql23xx-firmware
|
||||
Requires: ql2400-firmware
|
||||
Requires: ql2500-firmware
|
||||
Requires: coreutils cryptsetup-luks device-mapper
|
||||
Requires: diffutils dmraid findutils gawk grep lvm2
|
||||
Requires: module-init-tools sed
|
||||
Requires: cpio gzip
|
||||
|
||||
%description tools
|
||||
This package contains tools to assemble the local initrd and host configuration.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}%{?dashgittag}
|
||||
%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
|
||||
|
||||
chmod 0755 modules.d/*/check
|
||||
# make rpmlint happy
|
||||
chmod 0755 modules.d/*/install
|
||||
chmod 0755 modules.d/*/installkernel
|
||||
chmod 0755 modules.d/*/*.sh
|
||||
|
||||
%build
|
||||
make
|
||||
|
||||
make WITH_SWITCH_ROOT=0%{?with_switch_root}
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin sysconfdir=/etc mandir=%{_mandir}
|
||||
make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin \
|
||||
sysconfdir=/etc mandir=%{_mandir} WITH_SWITCH_ROOT=0%{?with_switch_root}
|
||||
|
||||
%if ! 0%{?with_switch_root}
|
||||
rm -f $RPM_BUILD_ROOT/sbin/switch_root
|
||||
%endif
|
||||
echo %{name}-%{version}-%{release} > $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/10rpmversion/dracut-version
|
||||
rm $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/01fips/check
|
||||
rm $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/02fips-aesni/check
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/boot/dracut
|
||||
mkdir -p $RPM_BUILD_ROOT/var/lib/dracut/overlay
|
||||
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log
|
||||
touch $RPM_BUILD_ROOT%{_localstatedir}/log/dracut.log
|
||||
|
||||
%if 0%{?fedora} <= 12 && 0%{?rhel} < 6
|
||||
rm $RPM_BUILD_ROOT/sbin/mkinitrd
|
||||
rm $RPM_BUILD_ROOT/sbin/lsinitrd
|
||||
%endif
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
|
||||
install -m 0644 dracut.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/dracut
|
||||
|
||||
echo 'do_strip=no' > $RPM_BUILD_ROOT/etc/dracut.conf.d/02-fips.conf
|
||||
> $RPM_BUILD_ROOT/etc/system-fips
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,0755)
|
||||
%doc README HACKING TODO COPYING AUTHORS
|
||||
%doc README HACKING TODO COPYING AUTHORS NEWS dracut-rhel6.html
|
||||
/sbin/dracut
|
||||
%if 0%{?with_switch_root}
|
||||
/sbin/switch_root
|
||||
%endif
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6
|
||||
/sbin/mkinitrd
|
||||
/sbin/lsinitrd
|
||||
%endif
|
||||
%dir %{_datadir}/dracut
|
||||
%{_datadir}/dracut/dracut-functions
|
||||
%{_datadir}/dracut/modules.d
|
||||
%config(noreplace) /etc/dracut.conf
|
||||
%dir /etc/dracut.conf.d
|
||||
%config(noreplace) /etc/logrotate.d/dracut
|
||||
%{_mandir}/man1/lsinitrd.1*
|
||||
%{_mandir}/man8/mkinitrd.8*
|
||||
%{_mandir}/man8/dracut.8*
|
||||
%{_mandir}/man5/dracut.conf.5*
|
||||
%{_datadir}/dracut/modules.d/00dash
|
||||
%{_datadir}/dracut/modules.d/10redhat-i18n
|
||||
%{_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/95debug
|
||||
%{_datadir}/dracut/modules.d/95fstab-sys
|
||||
%{_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/95zfcp
|
||||
%{_datadir}/dracut/modules.d/95znet
|
||||
%{_datadir}/dracut/modules.d/95terminfo
|
||||
%{_datadir}/dracut/modules.d/95udev-rules
|
||||
%{_datadir}/dracut/modules.d/95uswsusp
|
||||
%{_datadir}/dracut/modules.d/96insmodpost
|
||||
%{_datadir}/dracut/modules.d/97biosdevname
|
||||
%{_datadir}/dracut/modules.d/98syslog
|
||||
%{_datadir}/dracut/modules.d/99base
|
||||
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
|
||||
|
||||
%files network
|
||||
%defattr(-,root,root,0755)
|
||||
%doc README HACKING TODO COPYING AUTHORS NEWS
|
||||
%{_datadir}/dracut/modules.d/40network
|
||||
%{_datadir}/dracut/modules.d/95fcoe
|
||||
%{_datadir}/dracut/modules.d/95iscsi
|
||||
%{_datadir}/dracut/modules.d/95nbd
|
||||
%{_datadir}/dracut/modules.d/95nfs
|
||||
%{_datadir}/dracut/modules.d/45ifcfg
|
||||
|
||||
%files fips
|
||||
%defattr(-,root,root,0755)
|
||||
%doc COPYING
|
||||
%{_datadir}/dracut/modules.d/01fips
|
||||
%config(noreplace) /etc/dracut.conf.d/02-fips.conf
|
||||
%config(missingok) /etc/system-fips
|
||||
|
||||
%files fips-aesni
|
||||
%defattr(-,root,root,0755)
|
||||
%doc COPYING
|
||||
%{_datadir}/dracut/modules.d/02fips-aesni
|
||||
|
||||
%files caps
|
||||
%defattr(-,root,root,0755)
|
||||
%doc COPYING
|
||||
%{_datadir}/dracut/modules.d/02caps
|
||||
|
||||
%files kernel
|
||||
%defattr(-,root,root,0755)
|
||||
%doc README.kernel
|
||||
|
||||
%files generic
|
||||
%defattr(-,root,root,0755)
|
||||
%doc README.generic
|
||||
|
||||
%files kernel
|
||||
%files tools
|
||||
%defattr(-,root,root,0755)
|
||||
%doc README.kernel
|
||||
|
||||
%files tools
|
||||
%defattr(-,root,root,0755)
|
||||
%doc COPYING
|
||||
%doc COPYING NEWS
|
||||
%{_mandir}/man8/dracut-gencmdline.8*
|
||||
%{_mandir}/man8/dracut-catimages.8*
|
||||
/sbin/dracut-gencmdline
|
||||
/sbin/dracut-catimages
|
||||
%dir /boot/dracut
|
||||
@@ -142,27 +293,3 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%dir /var/lib/dracut/overlay
|
||||
|
||||
%changelog
|
||||
* Fri Jul 24 2009 Harald Hoyer <harald@redhat.com> 0.7-1
|
||||
- version 0.7
|
||||
|
||||
* Wed Jul 22 2009 Harald Hoyer <harald@redhat.com> 0.6-1
|
||||
- version 0.6
|
||||
|
||||
* Fri Jul 17 2009 Harald Hoyer <harald@redhat.com> 0.5-1
|
||||
- version 0.5
|
||||
|
||||
* Sat Jul 04 2009 Harald Hoyer <harald@redhat.com> 0.4-1
|
||||
- version 0.4
|
||||
|
||||
* Thu Jul 02 2009 Harald Hoyer <harald@redhat.com> 0.3-1
|
||||
- version 0.3
|
||||
|
||||
* Wed Jul 01 2009 Harald Hoyer <harald@redhat.com> 0.2-1
|
||||
- version 0.2
|
||||
|
||||
* Fri Jun 19 2009 Harald Hoyer <harald@redhat.com> 0.1-1
|
||||
- first release
|
||||
|
||||
* Thu Dec 18 2008 Jeremy Katz <katzj@redhat.com> - 0.0-1
|
||||
- Initial build
|
||||
|
||||
|
1701
dracut.svg
Normal file
1701
dracut.svg
Normal file
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 68 KiB |
61
git2spec.pl
Executable file
61
git2spec.pl
Executable file
@@ -0,0 +1,61 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
sub last_tag {
|
||||
open( GIT, 'git log --pretty=format:%H |');
|
||||
LINE: while( <GIT> ) {
|
||||
open( GIT2, "git tag --contains $_ |");
|
||||
while( <GIT2> ) {
|
||||
chomp;
|
||||
last LINE if /..*/;
|
||||
}
|
||||
close GIT2;
|
||||
}
|
||||
$tag=$_;
|
||||
close GIT2;
|
||||
close GIT; # be done
|
||||
return $tag;
|
||||
};
|
||||
|
||||
sub create_patches {
|
||||
my $tag=shift;
|
||||
my $pdir=shift;
|
||||
my $num=0;
|
||||
open( GIT, 'git format-patch -M -N --no-signature -o "'.$pdir.'" '.$tag.' |');
|
||||
@lines=<GIT>;
|
||||
close GIT; # be done
|
||||
return @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, $pdir);
|
||||
my $num=$#patches + 2;
|
||||
$tag=~s/[^0-9]+?([0-9]+)/$1/;
|
||||
my $release="$num.git$datestr";
|
||||
$release="1" if $num == 1;
|
||||
|
||||
while(<>) {
|
||||
if (/^Version:/) {
|
||||
print "Version: $tag\n";
|
||||
}
|
||||
elsif (/^Release:/) {
|
||||
print "Release: $release%{?dist}\n";
|
||||
}
|
||||
elsif ((/^Source0:/) || (/^Source:/)) {
|
||||
print $_;
|
||||
$num=1;
|
||||
for(@patches) {
|
||||
s/.*\///g;
|
||||
print "Patch$num: $_";
|
||||
$num++;
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
else {
|
||||
print $_;
|
||||
}
|
||||
}
|
1
install/.kateconfig
Normal file
1
install/.kateconfig
Normal file
@@ -0,0 +1 @@
|
||||
kate: space-indent on; tab-width 8; indent-width 8; replace-tabs on; eol unix;
|
141
lsinitrd
Executable file
141
lsinitrd
Executable file
@@ -0,0 +1,141 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Copyright 2005-2010 Harald Hoyer <harald@redhat.com>
|
||||
# Copyright 2005-2010 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/>.
|
||||
#
|
||||
|
||||
usage()
|
||||
{
|
||||
{
|
||||
echo "Usage: ${0##*/} [options] [<initramfs file> [<filename> [<filename> [...] ]]]"
|
||||
echo "Usage: ${0##*/} [options] -k <kernel version>"
|
||||
echo
|
||||
echo "-h, --help print a help message and exit."
|
||||
echo "-s, --size sort the contents of the initramfs by size."
|
||||
echo "-f, --file <filename> print the contents of <filename>."
|
||||
echo "-k, --kver <kernel version> inspect the initramfs of <kernel version>."
|
||||
echo
|
||||
} >&2
|
||||
}
|
||||
|
||||
sorted=0
|
||||
declare -A filenames
|
||||
|
||||
unset POSIXLY_CORRECT
|
||||
TEMP=$(getopt \
|
||||
-o "shf:k:" \
|
||||
--long kver: \
|
||||
--long file: \
|
||||
--long help \
|
||||
--long size \
|
||||
-- "$@")
|
||||
|
||||
if (( $? != 0 )); then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
eval set -- "$TEMP"
|
||||
|
||||
while (($# > 0)); do
|
||||
case $1 in
|
||||
-k|--kver) KERNEL_VERSION="$2"; shift;;
|
||||
-f|--file) filenames[${2#/}]=1; shift;;
|
||||
-s|--size) sorted=1;;
|
||||
-h|--help) usage; exit 0;;
|
||||
--) shift;break;;
|
||||
*) usage; exit 1;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
[[ $KERNEL_VERSION ]] || KERNEL_VERSION="$(uname -r)"
|
||||
|
||||
if [[ $1 ]]; then
|
||||
image="$1"
|
||||
if ! [[ -f "$image" ]]; then
|
||||
{
|
||||
echo "$image does not exist"
|
||||
echo
|
||||
} >&2
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
image="/boot/initramfs-${KERNEL_VERSION}.img"
|
||||
fi
|
||||
|
||||
shift
|
||||
while (($# > 0)); do
|
||||
filenames[${1#/}]=1;
|
||||
shift
|
||||
done
|
||||
|
||||
if ! [[ -f "$image" ]]; then
|
||||
{
|
||||
echo "No <initramfs file> specified and the default image '$image' cannot be accessed!"
|
||||
echo
|
||||
} >&2
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
read -N 6 bin < "$image"
|
||||
case $bin in
|
||||
$'\x1f\x8b'*)
|
||||
CAT="zcat";;
|
||||
BZh*)
|
||||
CAT="bzcat";;
|
||||
070701)
|
||||
CAT="cat";;
|
||||
*)
|
||||
CAT="xzcat";
|
||||
if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
|
||||
CAT="xzcat --single-stream"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
ret=0
|
||||
|
||||
if (( ${#filenames[@]} > 0 )); then
|
||||
(( ${#filenames[@]} == 1 )) && nofileinfo=1
|
||||
for f in ${!filenames[@]}; do
|
||||
[[ $nofileinfo ]] || echo "initramfs:/$f"
|
||||
[[ $nofileinfo ]] || echo "========================================================================"
|
||||
$CAT -- $image | cpio --extract --verbose --quiet --to-stdout $f 2>/dev/null
|
||||
((ret+=$?))
|
||||
[[ $nofileinfo ]] || echo "========================================================================"
|
||||
[[ $nofileinfo ]] || echo
|
||||
done
|
||||
else
|
||||
echo "Image: $image: $(du -h $image | while read a b; do echo $a;done)"
|
||||
echo "========================================================================"
|
||||
$CAT -- "$image" | cpio --extract --verbose --quiet --to-stdout -- 'dracut-*' 2>/dev/null
|
||||
((ret+=$?))
|
||||
echo "========================================================================"
|
||||
if [ "$sorted" -eq 1 ]; then
|
||||
$CAT -- "$image" | cpio --extract --verbose --quiet --list | sort -n -k5
|
||||
else
|
||||
$CAT -- "$image" | cpio --extract --verbose --quiet --list | sort -k9
|
||||
fi
|
||||
((ret+=$?))
|
||||
echo "========================================================================"
|
||||
fi
|
||||
|
||||
exit $ret
|
73
lsinitrd.1
Normal file
73
lsinitrd.1
Normal file
@@ -0,0 +1,73 @@
|
||||
'\" t
|
||||
.\" Title: lsinitrd
|
||||
.\" Author: [see the "AUTHORS" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
|
||||
.\" Date: 07/17/2013
|
||||
.\" Manual: dracut
|
||||
.\" Source: dracut
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "LSINITRD" "1" "07/17/2013" "dracut" "dracut"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
.SH "NAME"
|
||||
lsinitrd \- tool to show the contents of an initramfs image
|
||||
.SH "SYNOPSIS"
|
||||
.sp
|
||||
\fBlsinitrd\fR [\fIOPTION\&...\fR] [<image> [<filename> [<filename> [\&...] ]]]
|
||||
.sp
|
||||
\fBlsinitrd\fR [\fIOPTION\&...\fR] \-k <kernel\-version>
|
||||
.SH "DESCRIPTION"
|
||||
.sp
|
||||
lsinitrd shows the contents of an initramfs image\&. if <image> is omitted, then lsinitrd uses the default image \fI/boot/<machine\-id>/<kernel\-version>/initrd\fR or \fI/boot/initramfs\-<kernel\-version>\&.img\fR\&.
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
\fB\-h, \-\-help\fR
|
||||
.RS 4
|
||||
print a help message and exit\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-s, \-\-size\fR
|
||||
.RS 4
|
||||
sort the contents of the initramfs by size\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-f, \-\-file\fR\ \&\fI<filename>\fR
|
||||
.RS 4
|
||||
print the contents of <filename>\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-k, \-\-kver\fR\ \&\fI<kernel version>\fR
|
||||
.RS 4
|
||||
inspect the initramfs of <kernel version>\&.
|
||||
.RE
|
||||
.SH "AVAILABILITY"
|
||||
.sp
|
||||
The lsinitrd command is part of the dracut package and is available from \m[blue]\fBhttps://dracut\&.wiki\&.kernel\&.org\fR\m[]
|
||||
.SH "AUTHORS"
|
||||
.sp
|
||||
Harald Hoyer
|
||||
.sp
|
||||
Amerigo Wang
|
||||
.sp
|
||||
Nikoli
|
||||
.SH "SEE ALSO"
|
||||
.sp
|
||||
\fBdracut\fR(8)
|
150
mkinitrd-dracut.sh
Normal file
150
mkinitrd-dracut.sh
Normal file
@@ -0,0 +1,150 @@
|
||||
#!/bin/bash --norc
|
||||
|
||||
error() {
|
||||
local NONL=""
|
||||
if [ "$1" == "-n" ]; then
|
||||
NONL="-n"
|
||||
shift
|
||||
fi
|
||||
echo $NONL "$@" > /dev/stderr
|
||||
}
|
||||
|
||||
usage () {
|
||||
if [ "$1" == "-n" ]; then
|
||||
cmd=echo
|
||||
else
|
||||
cmd=error
|
||||
fi
|
||||
|
||||
$cmd "usage: `basename $0` [--version] [--help] [-v] [-f] [--preload <module>]"
|
||||
$cmd " [--image-version] [--with=<module>]"
|
||||
$cmd " <initrd-image> <kernel-version>"
|
||||
$cmd ""
|
||||
$cmd " (ex: `basename $0` /boot/initramfs-$(uname -r).img $(uname -r))"
|
||||
|
||||
if [ "$1" == "-n" ]; then
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
--with-usb*)
|
||||
if [ "$1" != "${1##--with-usb=}" ]; then
|
||||
usbmodule=${1##--with-usb=}
|
||||
else
|
||||
usbmodule="usb-storage"
|
||||
fi
|
||||
basicmodules="$basicmodules $usbmodule"
|
||||
unset usbmodule
|
||||
;;
|
||||
--with-avail*)
|
||||
if [ "$1" != "${1##--with-avail=}" ]; then
|
||||
modname=${1##--with-avail=}
|
||||
else
|
||||
modname=$2
|
||||
shift
|
||||
fi
|
||||
|
||||
basicmodules="$basicmodules $modname"
|
||||
;;
|
||||
--with*)
|
||||
if [ "$1" != "${1##--with=}" ]; then
|
||||
modname=${1##--with=}
|
||||
else
|
||||
modname=$2
|
||||
shift
|
||||
fi
|
||||
|
||||
basicmodules="$basicmodules $modname"
|
||||
;;
|
||||
--version)
|
||||
echo "mkinitrd: dracut compatibility wrapper"
|
||||
exit 0
|
||||
;;
|
||||
-v|--verbose)
|
||||
dracut_args="${dracut_args} -v"
|
||||
;;
|
||||
-f|--force)
|
||||
dracut_args="${dracut_args} -f"
|
||||
;;
|
||||
--preload*)
|
||||
if [ "$1" != "${1##--preload=}" ]; then
|
||||
modname=${1##--preload=}
|
||||
else
|
||||
modname=$2
|
||||
shift
|
||||
fi
|
||||
basicmodules="$basicmodules $modname"
|
||||
;;
|
||||
--image-version)
|
||||
img_vers=yes
|
||||
;;
|
||||
--rootfs*)
|
||||
if [ "$1" != "${1##--rootfs=}" ]; then
|
||||
rootfs="${1##--rootfs=}"
|
||||
else
|
||||
rootfs="$2"
|
||||
shift
|
||||
fi
|
||||
dracut_args="${dracut_args} --filesystems $rootfs"
|
||||
;;
|
||||
--builtin*) ;;
|
||||
--without*) ;;
|
||||
--without-usb) ;;
|
||||
--fstab*) ;;
|
||||
--nocompress) ;;
|
||||
--ifneeded) ;;
|
||||
--omit-scsi-modules) ;;
|
||||
--omit-ide-modules) ;;
|
||||
--omit-raid-modules) ;;
|
||||
--omit-lvm-modules) ;;
|
||||
--omit-dmraid) ;;
|
||||
--allow-missing) ;;
|
||||
--net-dev*) ;;
|
||||
--noresume) ;;
|
||||
--rootdev*) ;;
|
||||
--thawdev*) ;;
|
||||
--rootopts*) ;;
|
||||
--root*) ;;
|
||||
--loopdev*) ;;
|
||||
--loopfs*) ;;
|
||||
--loopopts*) ;;
|
||||
--looppath*) ;;
|
||||
--dsdt*) ;;
|
||||
--bootchart) ;;
|
||||
--help)
|
||||
usage -n
|
||||
;;
|
||||
*)
|
||||
if [ -z "$target" ]; then
|
||||
target=$1
|
||||
elif [ -z "$kernel" ]; then
|
||||
kernel=$1
|
||||
else
|
||||
usage
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
shift
|
||||
done
|
||||
|
||||
if [ -z "$target" -o -z "$kernel" ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ -n "$img_vers" ]; then
|
||||
target="$target-$kernel"
|
||||
fi
|
||||
|
||||
if [ -n "$basicmodules" ]; then
|
||||
dracut $dracut_args --add-drivers "$basicmodules" "$target" "$kernel"
|
||||
else
|
||||
dracut $dracut_args "$target" "$kernel"
|
||||
fi
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
103
mkinitrd.8
Normal file
103
mkinitrd.8
Normal file
@@ -0,0 +1,103 @@
|
||||
'\" t
|
||||
.\" Title: mkinitrd
|
||||
.\" Author: [see the "AUTHORS" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
|
||||
.\" Date: 07/17/2013
|
||||
.\" Manual: dracut
|
||||
.\" Source: dracut
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "MKINITRD" "8" "07/17/2013" "dracut" "dracut"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
.SH "NAME"
|
||||
mkinitrd \- is a compat wrapper, which calls dracut to generate an initramfs
|
||||
.SH "SYNOPSIS"
|
||||
.sp
|
||||
\fBmkinitrd\fR [\fIOPTION\&...\fR] [<initrd\-image>] <kernel\-version>
|
||||
.SH "DESCRIPTION"
|
||||
.sp
|
||||
mkinitrd creates an initramfs image <initrd\-image> for the kernel with version <kernel\-version> by calling "dracut"\&.
|
||||
.if n \{\
|
||||
.sp
|
||||
.\}
|
||||
.RS 4
|
||||
.it 1 an-trap
|
||||
.nr an-no-space-flag 1
|
||||
.nr an-break-flag 1
|
||||
.br
|
||||
.ps +1
|
||||
\fBImportant\fR
|
||||
.ps -1
|
||||
.br
|
||||
.sp
|
||||
If a more fine grained control over the resulting image is needed, "dracut" should be called directly\&.
|
||||
.sp .5v
|
||||
.RE
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
\fB\-\-version\fR
|
||||
.RS 4
|
||||
print info about the version
|
||||
.RE
|
||||
.PP
|
||||
\fB\-v, \-\-verbose\fR
|
||||
.RS 4
|
||||
increase verbosity level
|
||||
.RE
|
||||
.PP
|
||||
\fB\-f, \-\-force\fR
|
||||
.RS 4
|
||||
overwrite existing initramfs file\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB*\-\-image\-version\fR
|
||||
.RS 4
|
||||
append the kernel version to the target image <initrd\-image>\-<kernel\-version>\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-\-with=<module>\fR
|
||||
.RS 4
|
||||
add the kernel module <module> to the initramfs\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-\-preload=<module>\fR
|
||||
.RS 4
|
||||
preload the kernel module <module> in the initramfs before any other kernel modules are loaded\&. This can be used to ensure a certain device naming, which should in theory be avoided and the use of symbolic links in /dev is encouraged\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-\-nocompress\fR
|
||||
.RS 4
|
||||
do not compress the resulting image\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-\-help\fR
|
||||
.RS 4
|
||||
print a help message and exit\&.
|
||||
.RE
|
||||
.SH "AVAILABILITY"
|
||||
.sp
|
||||
The mkinitrd command is part of the dracut package and is available from \m[blue]\fBhttps://dracut\&.wiki\&.kernel\&.org\fR\m[]
|
||||
.SH "AUTHORS"
|
||||
.sp
|
||||
Harald Hoyer
|
||||
.SH "SEE ALSO"
|
||||
.sp
|
||||
\fBdracut\fR(8)
|
5
modules.d/01fips/check
Executable file
5
modules.d/01fips/check
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
[[ $1 = -d ]] && exit 0
|
||||
exit 255
|
||||
|
12
modules.d/01fips/fips-boot.sh
Executable file
12
modules.d/01fips/fips-boot.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
|
||||
rm -f /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
elif getarg boot= >/dev/null; then
|
||||
. /sbin/fips.sh
|
||||
if mount_boot; then
|
||||
do_fips || die "FIPS integrity test failed"
|
||||
fi
|
||||
fi
|
11
modules.d/01fips/fips-noboot.sh
Executable file
11
modules.d/01fips/fips-noboot.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
|
||||
rm -f /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
elif ! [ -f /tmp/fipsdone ]; then
|
||||
. /sbin/fips.sh
|
||||
mount_boot
|
||||
do_fips || die "FIPS integrity test failed"
|
||||
fi
|
124
modules.d/01fips/fips.sh
Executable file
124
modules.d/01fips/fips.sh
Executable file
@@ -0,0 +1,124 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
mount_boot()
|
||||
{
|
||||
boot=$(getarg boot=)
|
||||
|
||||
if [ -n "$boot" ]; then
|
||||
case "$boot" in
|
||||
LABEL=*)
|
||||
boot="$(echo $boot | sed 's,/,\\x2f,g')"
|
||||
boot="/dev/disk/by-label/${boot#LABEL=}"
|
||||
;;
|
||||
UUID=*)
|
||||
boot="/dev/disk/by-uuid/${boot#UUID=}"
|
||||
;;
|
||||
/dev/*)
|
||||
;;
|
||||
*)
|
||||
die "You have to specify boot=<boot device> as a boot option for fips=1" ;;
|
||||
esac
|
||||
|
||||
if ! [ -e "$boot" ]; then
|
||||
udevadm trigger --action=add >/dev/null 2>&1
|
||||
[ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version)
|
||||
i=0
|
||||
while ! [ -e $boot ]; do
|
||||
if [ $UDEVVERSION -ge 143 ]; then
|
||||
udevadm settle --exit-if-exists=$boot >/dev/null 2>&1
|
||||
else
|
||||
udevadm settle --timeout=30 >/dev/null 2>&1
|
||||
fi
|
||||
[ -e $boot ] && break
|
||||
modprobe scsi_wait_scan && rmmod scsi_wait_scan
|
||||
[ -e $boot ] && break
|
||||
sleep 0.5
|
||||
i=$(($i+1))
|
||||
[ $i -gt 40 ] && break
|
||||
done
|
||||
fi
|
||||
|
||||
[ -e "$boot" ] || return 1
|
||||
|
||||
mkdir /boot
|
||||
info "Mounting $boot as /boot"
|
||||
mount -oro "$boot" /boot || return 1
|
||||
elif [ -d "$NEWROOT/boot" ]; then
|
||||
rm -fr /boot
|
||||
ln -sf "$NEWROOT/boot" /boot
|
||||
fi
|
||||
}
|
||||
|
||||
do_rhevh_check()
|
||||
{
|
||||
KERNEL=$(uname -r)
|
||||
kpath=${1}
|
||||
|
||||
# If we're on RHEV-H, the kernel is in /dev/.initramfs/live/vmlinuz0
|
||||
HMAC_SUM_ORIG=$(cat $NEWROOT/boot/.vmlinuz-${KERNEL}.hmac | while read a b; do printf "%s\n" $a; done)
|
||||
HMAC_SUM_CALC=$(sha512hmac $kpath | while read a b; do printf "%s\n" $a; done || return 1)
|
||||
if [ -z "$HMAC_SUM_ORIG" ] || [ -z "$HMAC_SUM_CALC" ] || [ "${HMAC_SUM_ORIG}" != "${HMAC_SUM_CALC}" ]; then
|
||||
warn "HMAC sum mismatch"
|
||||
return 1
|
||||
fi
|
||||
info "rhevh_check OK"
|
||||
return 0
|
||||
}
|
||||
|
||||
do_fips()
|
||||
{
|
||||
local _v
|
||||
local _s
|
||||
local _v
|
||||
local _module
|
||||
info "Checking integrity of kernel"
|
||||
KERNEL=$(uname -r)
|
||||
|
||||
if ! [ -e "/boot/.vmlinuz-${KERNEL}.hmac" ]; then
|
||||
warn "/boot/.vmlinuz-${KERNEL}.hmac does not exist"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -e "/dev/.initramfs/live/vmlinuz0" ]; then
|
||||
do_rhevh_check /dev/.initramfs/live/vmlinuz0 || return 1
|
||||
elif [ -e "/dev/.initramfs/live/isolinux/vmlinuz0" ]; then
|
||||
do_rhevh_check /dev/.initramfs/live/isolinux/vmlinuz0 || return 1
|
||||
else
|
||||
sha512hmac -c "/boot/.vmlinuz-${KERNEL}.hmac" || return 1
|
||||
fi
|
||||
|
||||
FIPSMODULES=$(cat /etc/fipsmodules)
|
||||
|
||||
info "Loading and integrity checking all crypto modules"
|
||||
mv /etc/modprobe.d/fips.conf /etc/modprobe.d/fips.conf.bak
|
||||
for _module in $FIPSMODULES; do
|
||||
if [ "$_module" != "tcrypt" ]; then
|
||||
if ! modprobe "${_module}"; then
|
||||
# check if kernel provides generic algo
|
||||
_found=0
|
||||
while read _k _s _v; do
|
||||
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
|
||||
[ "$_k" = "driver" ] && _v=$(str_replace "$_v" "_" "-")
|
||||
[ "$_v" != "$_module" ] && continue
|
||||
_found=1
|
||||
break
|
||||
done </proc/crypto
|
||||
[ "$_found" = "0" ] && return 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
mv /etc/modprobe.d/fips.conf.bak /etc/modprobe.d/fips.conf
|
||||
|
||||
info "Self testing crypto algorithms"
|
||||
modprobe tcrypt || return 1
|
||||
rmmod tcrypt
|
||||
info "All initrd crypto checks done"
|
||||
|
||||
> /tmp/fipsdone
|
||||
|
||||
umount /boot >/dev/null 2>&1
|
||||
|
||||
return 0
|
||||
}
|
35
modules.d/01fips/install
Executable file
35
modules.d/01fips/install
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
inst_hook pre-trigger 01 "$moddir/fips-boot.sh"
|
||||
inst_hook pre-pivot 01 "$moddir/fips-noboot.sh"
|
||||
inst "$moddir/fips.sh" /sbin/fips.sh
|
||||
dracut_install sha512hmac rmmod insmod mount uname umount
|
||||
|
||||
libdir="lib"
|
||||
if ldd $(find_binary sha512hmac) 2>/dev/null | grep -q /lib64/; then
|
||||
libdir="lib64"
|
||||
fi
|
||||
|
||||
if [ -e /usr/$libdir/libsoftokn3.so ]; then
|
||||
dracut_install \
|
||||
/usr/$libdir/libsoftokn3.so /usr/$libdir/libsoftokn3.chk
|
||||
else
|
||||
dracut_install \
|
||||
/$libdir/libsoftokn3.so /$libdir/libsoftokn3.chk
|
||||
fi
|
||||
|
||||
for i in /{usr,}/$libdir/libssl.so* /{usr,}/$libdir/libcrypto.so* \
|
||||
/{usr,}/$libdir/.libssl.so*.hmac /{usr,}/$libdir/.libcrypto.so*.hmac; do
|
||||
[ -e $i ] || continue
|
||||
dracut_install $i
|
||||
done
|
||||
|
||||
dracut_install -o /usr/$libdir/hmaccalc/sha*hmac.hmac
|
||||
dracut_install fipscheck
|
||||
dracut_install /etc/system-fips
|
||||
|
||||
if command -v prelink >/dev/null; then
|
||||
dracut_install prelink
|
||||
fi
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
18
modules.d/01fips/installkernel
Executable file
18
modules.d/01fips/installkernel
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
_fipsmodules="aead aes_generic aes-x86_64 ansi_cprng arc4 blowfish camellia cast6 cbc ccm "
|
||||
_fipsmodules+="chainiv crc32c cryptomgr crypto_null ctr cts deflate des des3_ede dm-crypt dm-mod drbg "
|
||||
_fipsmodules+="ecb eseqiv fcrypt gcm ghash_generic hmac khazad lzo md4 md5 michael_mic rmd128 "
|
||||
_fipsmodules+="rmd160 rmd256 rmd320 rot13 salsa20 seed seqiv serpent sha1 sha224 sha256 sha256_generic "
|
||||
_fipsmodules+="sha384 sha512 sha512_generic tcrypt tea tnepres twofish wp256 wp384 wp512 xeta xtea xts zlib"
|
||||
|
||||
mkdir -p "${initdir}/etc/modprobe.d"
|
||||
|
||||
for mod in $_fipsmodules; do
|
||||
if hostonly='' instmods $mod; then
|
||||
echo $mod >> "${initdir}/etc/fipsmodules"
|
||||
echo "blacklist $mod" >> "${initdir}/etc/modprobe.d/fips.conf"
|
||||
fi
|
||||
done
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
33
modules.d/02caps/README
Normal file
33
modules.d/02caps/README
Normal file
@@ -0,0 +1,33 @@
|
||||
This adds the following parameters:
|
||||
rd.caps=1
|
||||
turn the caps module on/off
|
||||
rd.caps.initdrop=cap_sys_module,cap_sys_rawio
|
||||
drop the specified comma seperated capabilities
|
||||
rd.caps.disablemodules=1
|
||||
turn off module loading
|
||||
rd.caps.disablekexec=1
|
||||
turn off the kexec functionality
|
||||
|
||||
If module loading is turned off, all modules have to be loaded in the
|
||||
initramfs, which are used later on. This can be done with
|
||||
"rdloaddriver="
|
||||
rdloaddriver=autofs4,sunrpc,ipt_REJECT,nf_conntrack_ipv4,....
|
||||
|
||||
Because the kernel command line would get huge with all those drivers, I
|
||||
recommend to make use of $initramfs/etc/cmdline.
|
||||
|
||||
So, all rd.caps.* and rdloaddriver arguments are in caps.conf can be
|
||||
copied to $initramfs/etc/cmdline with "-i caps.conf /etc/cmdline".
|
||||
|
||||
Also all modules have to be loaded in the initramfs via "--add-drivers".
|
||||
|
||||
The resulting initramfs creation would look like this:
|
||||
|
||||
--add-drivers "autofs4 sunrpc ipt_REJECT nf_conntrack_ipv4 \
|
||||
nf_defrag_ipv4 iptable_filter ip_tables
|
||||
ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack
|
||||
ip6table_filter ip6_tables dm_mirror dm_region_hash dm_log uinput ppdev
|
||||
parport_pc parport ipv6 sg 8139too 8139cp mii i2c_piix4 i2c_core ext3
|
||||
jbd mbcache sd_mod crc_t10dif sr_mod cdrom ata_generic pata_acpi ata_piix
|
||||
dm_mod" \
|
||||
/boot/initramfs-caps.img
|
36
modules.d/02caps/caps.sh
Executable file
36
modules.d/02caps/caps.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
capsmode=$(getarg rd.caps)
|
||||
|
||||
if [ "$capsmode" = "1" ]; then
|
||||
CAPS_INIT_DROP=$(getarg rd.caps.initdrop=)
|
||||
CAPS_USERMODEHELPER_BSET=$(capsh --drop="$CAPS_INIT_DROP" -- -c 'while read a b ; do [ "$a" = "CapBnd:" ] && echo $((0x${b:$((${#b}-8)):8})) $((0x${b:$((${#b}-16)):8})) && break; done < /proc/self/status')
|
||||
CAPS_MODULES_DISABLED=$(getarg rd.caps.disablemodules=)
|
||||
CAPS_KEXEC_DISABLED=$(getarg rd.caps.disablekexec=)
|
||||
|
||||
info "Loading CAPS_MODULES $CAPS_MODULES"
|
||||
for i in $CAPS_MODULES;do modprobe $i 2>&1 >/dev/null | vinfo; done
|
||||
|
||||
if [ "$CAPS_MODULES_DISABLED" = "1" -a -e /proc/sys/kernel/modules_disabled ]; then
|
||||
info "Disabling module loading."
|
||||
echo $CAPS_MODULES_DISABLED > /proc/sys/kernel/modules_disabled
|
||||
fi
|
||||
|
||||
if [ "$CAPS_KEXEC_DISABLED" = "1" -a -e /proc/sys/kernel/kexec_disabled ]; then
|
||||
info "Disabling kexec."
|
||||
echo $CAPS_KEXEC_DISABLED > /proc/sys/kernel/kexec_disabled
|
||||
fi
|
||||
|
||||
info "CAPS_USERMODEHELPER_BSET=$CAPS_USERMODEHELPER_BSET"
|
||||
if [ -e /proc/sys/kernel/usermodehelper/bset ]; then
|
||||
info "Setting usermode helper bounding set."
|
||||
echo $CAPS_USERMODEHELPER_BSET > /proc/sys/kernel/usermodehelper/bset
|
||||
echo $CAPS_USERMODEHELPER_BSET > /proc/sys/kernel/usermodehelper/inheritable
|
||||
fi
|
||||
|
||||
echo "CAPS_INIT_DROP=\"$CAPS_INIT_DROP\"" > /etc/capsdrop
|
||||
info "Will drop capabilities $CAPS_INIT_DROP from init."
|
||||
fi
|
||||
|
8
modules.d/02caps/check
Executable file
8
modules.d/02caps/check
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
[[ $1 = -d ]] && exit 0
|
||||
|
||||
type -P capsh >/dev/null 2>&1 || exit 1
|
||||
|
||||
exit 0
|
||||
|
10
modules.d/02caps/install
Executable file
10
modules.d/02caps/install
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
inst_hook pre-pivot 99 "$moddir/caps.sh"
|
||||
dracut_install capsh
|
||||
# capsh wants bash and we need bash also
|
||||
inst /bin/bash && ln -sf bash "${initdir}/bin/sh"
|
||||
|
||||
|
5
modules.d/02fips-aesni/check
Executable file
5
modules.d/02fips-aesni/check
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
[[ $1 = -d ]] && exit 0
|
||||
exit 255
|
||||
|
14
modules.d/02fips-aesni/installkernel
Executable file
14
modules.d/02fips-aesni/installkernel
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
FIPSMODULES="aesni-intel"
|
||||
|
||||
mkdir -p "${initdir}/etc/modprobe.d"
|
||||
|
||||
for mod in $FIPSMODULES; do
|
||||
if hostonly='' instmods $mod; then
|
||||
echo $mod >> "${initdir}/etc/fipsmodules"
|
||||
echo "blacklist $mod" >> "${initdir}/etc/modprobe.d/fips.conf"
|
||||
fi
|
||||
done
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
@@ -3,7 +3,7 @@
|
||||
findkeymap () {
|
||||
local MAP=$1
|
||||
[[ ! -f $MAP ]] && \
|
||||
MAP=$(find /lib/kbd/keymaps -type f -name $MAP -o -name $MAP.\* | head -n1)
|
||||
MAP=$(find ${kbddir}/keymaps -type f -name $MAP -o -name $MAP.\* | head -n1)
|
||||
[[ " $KEYMAPS " = *" $MAP "* ]] && return
|
||||
KEYMAPS="$KEYMAPS $MAP"
|
||||
case $MAP in
|
||||
@@ -13,7 +13,7 @@ findkeymap () {
|
||||
esac
|
||||
|
||||
for INCL in $($cmd "^include " $MAP | cut -d' ' -f2 | tr -d '"'); do
|
||||
for FN in $(find /lib/kbd/keymaps -type f -name $INCL\*); do
|
||||
for FN in $(find ${kbddir}/keymaps -type f -name $INCL\*); do
|
||||
findkeymap $FN
|
||||
done
|
||||
done
|
||||
@@ -27,12 +27,20 @@ install_local()
|
||||
KEYMAP=/etc/sysconfig/console/default.kmap
|
||||
else
|
||||
. /etc/sysconfig/keyboard
|
||||
[[ $KEYTABLE && -d /lib/kbd/keymaps ]] && KEYMAP="$KEYTABLE.map"
|
||||
if [[ $KEYTABLE && -d ${kbddir}/keymaps ]]; then
|
||||
[[ $KEYTABLE =~ *.uni ]] && UNIKEYMAP="$KEYTABLE.map" \
|
||||
|| UNIKEYMAP="$KEYTABLE.uni.map"
|
||||
KEYMAP="$KEYTABLE.map"
|
||||
fi
|
||||
fi
|
||||
if [[ $KEYMAP ]]; then
|
||||
[ -f /etc/sysconfig/keyboard ] && inst /etc/sysconfig/keyboard
|
||||
inst loadkeys
|
||||
findkeymap $KEYMAP
|
||||
[[ $UNIKEYMAP ]] && findkeymap $UNIKEYMAP
|
||||
[[ $GRP_TOGGLE ]] && findkeymap $GRP_TOGGLE.map
|
||||
findkeymap delete.map
|
||||
findkeymap backspace.map
|
||||
|
||||
for FN in $KEYMAPS; do
|
||||
if [ -L $FN ]; then
|
||||
@@ -58,28 +66,35 @@ install_local()
|
||||
[[ $SYSFONT ]] || SYSFONT=latarcyrheb-sun16
|
||||
inst setfont
|
||||
|
||||
for FN in /lib/kbd/consolefonts/$SYSFONT.* ; do
|
||||
for FN in ${kbddir}/consolefonts/$SYSFONT.* ; do
|
||||
inst "$FN"
|
||||
case $FN in
|
||||
*.gz) gzip -d "$initdir$FN" ;;
|
||||
*.bz2) bzip2 -d "$initdir$FN" ;;
|
||||
esac
|
||||
done
|
||||
[[ $SYSFONTACM ]] && inst /lib/kbd/consoletrans/$SYSFONTACM
|
||||
[[ $UNIMAP ]] && inst /lib/kbd/unimaps/$UNIMAP
|
||||
[[ $SYSFONTACM ]] && inst ${kbddir}/consoletrans/$SYSFONTACM
|
||||
[[ $UNIMAP ]] && inst ${kbddir}/unimaps/$UNIMAP
|
||||
fi
|
||||
}
|
||||
|
||||
for kbddir in /usr/lib/kbd /lib/kbd; do
|
||||
[[ -d ${kbddir} ]] && break
|
||||
done
|
||||
|
||||
if [[ $hostonly ]]; then
|
||||
install_local
|
||||
else
|
||||
for i in $(find /lib/kbd -type f -print); do
|
||||
for i in $(find ${kbddir} -type f -print); do
|
||||
dracut_install $i
|
||||
done
|
||||
# remove unnecessary files
|
||||
rm -f "$initdir${kbddir}/consoletrans/utflist" 2>/dev/null
|
||||
find "$initdir${kbddir}/" -name README\* -exec rm -f '{}' \;
|
||||
dracut_install gzip bzip2
|
||||
fi
|
||||
|
||||
dracut_install /lib/udev/console_*
|
||||
[ -x /lib/udev/console_init ] && dracut_install /lib/udev/console_init
|
||||
dracut_install setfont loadkeys
|
||||
inst_rules 10-console.rules
|
||||
inst_hook cmdline 20 "$moddir/parse-i18n.sh"
|
||||
|
@@ -3,7 +3,6 @@ inst_key_val()
|
||||
local value
|
||||
value=$(getarg $1)
|
||||
[ -n "$value" ] && printf '%s="%s"\n' $1 $value >> $2
|
||||
initrdargs="$initrdargs $1"
|
||||
}
|
||||
|
||||
mkdir -p /etc/sysconfig
|
||||
|
3
modules.d/10rpmversion/check
Executable file
3
modules.d/10rpmversion/check
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
[ -f /etc/redhat-release ]
|
||||
|
13
modules.d/10rpmversion/install
Executable file
13
modules.d/10rpmversion/install
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -e "$moddir/dracut-version" ]; then
|
||||
dracut_rpm_version=$(cat "$moddir/dracut-version")
|
||||
inst "$moddir/dracut-version" /$dracut_rpm_version
|
||||
else
|
||||
if rpm -qf $(which $0) &>/dev/null; then
|
||||
dracut_rpm_version=$(rpm -qf --qf '%{name}-%{version}-%{release}\n' $(which $0) | { ver="";while read line;do ver=$line;done;echo $ver;} )
|
||||
echo $dracut_rpm_version > $initdir/$dracut_rpm_version
|
||||
fi
|
||||
fi
|
||||
inst_hook cmdline 01 "$moddir/version.sh"
|
||||
|
6
modules.d/10rpmversion/version.sh
Normal file
6
modules.d/10rpmversion/version.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
for i in dracut-*; do
|
||||
if [ -f $i ]; then
|
||||
vinfo < $i
|
||||
fi
|
||||
done
|
||||
unset i
|
@@ -1,19 +1,27 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $1 = -d ]]; then
|
||||
[ -d /etc/sysconfig/network-scripts/ ] && echo ifcfg
|
||||
exit 0
|
||||
fi
|
||||
|
||||
. $dracutfunctions
|
||||
|
||||
for program in ip hostname; do
|
||||
for program in ip arping; do
|
||||
which $program >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
dwarning "Could not find program \"$program\" required by network."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
for program in dhclient brctl; do
|
||||
for program in dhclient brctl ifenslave tr; do
|
||||
which $program >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
dwarning "Could not find program \"$program\" it might be required by network."
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
|
||||
exit 255
|
||||
|
||||
|
@@ -13,13 +13,24 @@ setup_interface() {
|
||||
|
||||
[ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
||||
|
||||
if [ -n "$mtu" ] ; then
|
||||
echo ip link set $netif down
|
||||
echo ip link set $netif mtu $mtu
|
||||
echo ip link set $netif up
|
||||
fi > /tmp/net.$netif.up
|
||||
# Taken from debian dhclient-script:
|
||||
# The 576 MTU is only used for X.25 and dialup connections
|
||||
# where the admin wants low latency. Such a low MTU can cause
|
||||
# problems with UDP traffic, among other things. As such,
|
||||
# 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
|
||||
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
|
||||
|
||||
> /tmp/net.$netif.up
|
||||
|
||||
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
|
||||
|
||||
@@ -30,38 +41,39 @@ setup_interface() {
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
|
||||
[ -n "$hostname" ] && echo hostname $hostname > /tmp/net.$netif.hostname
|
||||
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
}
|
||||
|
||||
PATH=$PATH:/sbin:/usr/sbin
|
||||
|
||||
export PS4="dhclient.$interface.$$ + "
|
||||
exec >>/dev/initlog.pipe 2>>/dev/initlog.pipe
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
if getarg rdnetdebug ; then
|
||||
exec >/tmp/dhclient.$interface.$$.out
|
||||
exec 2>>/tmp/dhclient.$interface.$$.out
|
||||
set -x
|
||||
fi
|
||||
|
||||
# We already need a set netif here
|
||||
netif=$interface
|
||||
|
||||
# Huh? Interface configured?
|
||||
[ -f "/tmp/net.$netif.up" ] && exit 0
|
||||
|
||||
case $reason in
|
||||
PREINIT)
|
||||
echo "dhcp: PREINIT $netif up"
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
;;
|
||||
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
|
||||
fi
|
||||
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
|
||||
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
|
||||
;;
|
||||
*) ;;
|
||||
*) echo "dhcp: $reason";;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
@@ -7,14 +7,17 @@
|
||||
[ -z "$root" ] && root=$(getarg root=)
|
||||
[ -z "$netroot" ] && netroot=$(getarg netroot=)
|
||||
|
||||
if [ "$root" = "dhcp" ] || [ "$netroot" = "dhcp" ] ; then
|
||||
if [ "$root" = "dhcp" ] || [ "$root" = "dhcp6" ] || [ "$netroot" = "dhcp" ] ; then
|
||||
# Tell ip= checker that we need dhcp
|
||||
NEEDDHCP="1"
|
||||
|
||||
# Done, all good!
|
||||
rootok=1
|
||||
netroot=dhcp
|
||||
if [ "$netroot" != "dhcp" ] ; then
|
||||
netroot=$root
|
||||
fi
|
||||
|
||||
# Shut up init error check
|
||||
[ -z "$root" ] && root="dhcp"
|
||||
echo '[ -d $NEWROOT/proc -o -e /dev/root ]' > /initqueue-finished/dhcp.sh
|
||||
fi
|
||||
|
27
modules.d/40network/ifname-genrules.sh
Executable file
27
modules.d/40network/ifname-genrules.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
# if there are no ifname parameters, just use NAME=KERNEL
|
||||
if ! getarg ifname= >/dev/null ; then
|
||||
return
|
||||
fi
|
||||
|
||||
{
|
||||
|
||||
echo 'SUBSYSTEM!="net", GOTO="ifname_end"'
|
||||
echo 'ACTION!="add", GOTO="ifname_end"'
|
||||
echo 'ATTR{type}!="1", GOTO="ifname_end"'
|
||||
|
||||
for p in $(getargs ifname=); do
|
||||
parse_ifname_opts $p
|
||||
printf 'DRIVERS=="?*", ATTR{address}=="%s", NAME="%s", GOTO="ifname_end"\n' "$ifname_mac" "$ifname_if"
|
||||
done
|
||||
|
||||
# Rename non named interfaces out of the way for named ones.
|
||||
for p in $(getargs ifname=); do
|
||||
parse_ifname_opts $p
|
||||
printf 'DRIVERS=="?*", ATTR{address}!="%s", KERNEL=="%s", NAME="rename$attr{ifindex}", GOTO="ifname_end"\n' "$ifname_mac" "$ifname_if"
|
||||
done
|
||||
|
||||
echo 'LABEL="ifname_end"'
|
||||
|
||||
} > /etc/udev/rules.d/50-ifname.rules
|
@@ -3,56 +3,111 @@
|
||||
# We don't need to check for ip= errors here, that is handled by the
|
||||
# cmdline parser script
|
||||
#
|
||||
PATH=$PATH:/sbin:/usr/sbin
|
||||
|
||||
# Sadly there's no easy way to split ':' separated lines into variables
|
||||
ip_to_var() {
|
||||
local v=${1}:
|
||||
set --
|
||||
while [ -n "$v" ]; do
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
done
|
||||
export PS4="ifup.$1.$$ + "
|
||||
|
||||
unset ip srv gw mask hostname dev autoconf
|
||||
case $# in
|
||||
0) autoconf="error" ;;
|
||||
1) autoconf=$1 ;;
|
||||
2) dev=$1; autoconf=$2 ;;
|
||||
*) ip=$1; srv=$2; gw=$3; mask=$4; hostname=$5; dev=$6; autoconf=$7 ;;
|
||||
esac
|
||||
}
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
[ "$RDDEBUG" = "yes" ] \
|
||||
&& [ -e /dev/initlog.pipe ] \
|
||||
&& exec >>/dev/initlog.pipe 2>>/dev/initlog.pipe
|
||||
|
||||
# Run dhclient
|
||||
do_dhcp() {
|
||||
# /sbin/dhclient-script will mark the netif up and generate the online
|
||||
# event for nfsroot
|
||||
# XXX add -V vendor class and option parsing per kernel
|
||||
dhclient -1 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif
|
||||
#echo "Starting dhcp for interface $netif"
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
[ -n "$macaddr" ] && ip link set address $macaddr dev $netif
|
||||
[ -n "$mtu" ] && ip link set mtu $mtu dev $netif
|
||||
dhclient "$@" -1 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif &
|
||||
|
||||
# increase wait time for DHCP
|
||||
echo '[ $(($RDRETRY-$main_loop)) -lt 720 ] && RDRETRY=$(($main_loop+720)); rm -f "$job"' > /initqueue/rd_retry_inc_dhclient.$netif.sh
|
||||
|
||||
#|| echo "dhcp failed"
|
||||
}
|
||||
|
||||
load_ipv6() {
|
||||
modprobe ipv6
|
||||
i=0
|
||||
while [ ! -d /proc/sys/net/ipv6 ]; do
|
||||
i=$(($i+1))
|
||||
[ $i -gt 10 ] && break
|
||||
sleep 0.1
|
||||
done
|
||||
}
|
||||
|
||||
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
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
[ -n "$macaddr" ] && ip link set address $macaddr dev $netif
|
||||
[ -n "$mtu" ] && ip link set mtu $mtu dev $netif
|
||||
}
|
||||
> /tmp/net.$netif.up
|
||||
|
||||
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
|
||||
namesrv=$(getargs nameserver)
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
|
||||
|
||||
echo online > /sys/class/net/$netif/uevent
|
||||
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
|
||||
}
|
||||
|
||||
# Handle static ip configuration
|
||||
do_static() {
|
||||
{
|
||||
echo ip link set $netif up
|
||||
echo ip addr flush dev $netif
|
||||
echo ip addr add $ip/$mask dev $netif
|
||||
} > /tmp/net.$netif.up
|
||||
strstr $ip '*:*:*' && load_ipv6
|
||||
|
||||
{
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
[ -n "$macaddr" ] && ip link set address $macaddr dev $netif
|
||||
[ -n "$mtu" ] && ip link set mtu $mtu dev $netif
|
||||
# do not flush addr for ipv6
|
||||
#strstr $ip '*:*:*' || \
|
||||
# ip addr flush dev $netif
|
||||
ip addr add $ip/$mask brd + dev $netif
|
||||
}
|
||||
> /tmp/net.$netif.up
|
||||
|
||||
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
|
||||
[ -n "$hostname" ] && echo hostname $hostname > /tmp/net.$netif.hostname
|
||||
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
|
||||
namesrv=$(getargs nameserver)
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
|
||||
echo online > /sys/class/net/$netif/uevent
|
||||
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
|
||||
}
|
||||
|
||||
PATH=$PATH:/sbin:/usr/sbin
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
if getarg rdnetdebug ; then
|
||||
exec >/tmp/ifup.$1.$$.out
|
||||
exec 2>>/tmp/ifup.$1.$$.out
|
||||
set -x
|
||||
fi
|
||||
get_vid() {
|
||||
case "$1" in
|
||||
vlan*)
|
||||
echo ${1#vlan}
|
||||
;;
|
||||
*.*)
|
||||
echo ${1##*.}
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Huh? No $1?
|
||||
[ -z "$1" ] && exit 1
|
||||
@@ -60,14 +115,47 @@ fi
|
||||
# $netif reads easier than $1
|
||||
netif=$1
|
||||
|
||||
# check, if we need VLAN's for this interface
|
||||
if [ -z "$DO_VLAN_PHY" ] && [ -e /tmp/vlan.${netif}.phy ]; then
|
||||
NO_AUTO_DHCP=yes DO_VLAN_PHY=yes ifup "$netif"
|
||||
modprobe -b -q 8021q
|
||||
|
||||
for i in /tmp/vlan.*.${netif}; do
|
||||
[ -e "$i" ] || continue
|
||||
read vlanname < "$i"
|
||||
if [ -n "$vlanname" ]; then
|
||||
ip link set "$netif" up
|
||||
wait_for_if_up "$netif"
|
||||
ip link add dev "$vlanname" link "$netif" type vlan id "$(get_vid $vlanname)"
|
||||
ifup "$vlanname"
|
||||
fi
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# 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
|
||||
netif="$bridgename"
|
||||
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
|
||||
@@ -83,38 +171,121 @@ if [ "$netif" = "lo" ] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# start bond if needed
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
|
||||
if [ "$netif" = "$bondname" ] && [ ! -e /tmp/net.$bondname.up ] ; then # We are master bond device
|
||||
modprobe bonding
|
||||
echo "+$netif" > /sys/class/net/bonding_masters
|
||||
ip link set $netif down
|
||||
|
||||
# Stolen from ifup-eth
|
||||
# add the bits to setup driver parameters here
|
||||
for arg in $bondoptions ; do
|
||||
key=${arg%%=*};
|
||||
value=${arg##*=};
|
||||
# %{value:0:1} is replaced with non-bash specific construct
|
||||
if [ "${key}" = "arp_ip_target" -a "${#value}" != "0" -a "+${value%%+*}" != "+" ]; then
|
||||
OLDIFS=$IFS;
|
||||
IFS=',';
|
||||
for arp_ip in $value; do
|
||||
echo +$arp_ip > /sys/class/net/${netif}/bonding/$key
|
||||
done
|
||||
IFS=$OLDIFS;
|
||||
else
|
||||
echo $value > /sys/class/net/${netif}/bonding/$key
|
||||
fi
|
||||
done
|
||||
|
||||
ip link set $netif up
|
||||
|
||||
for slave in $bondslaves ; do
|
||||
ip link set $slave down
|
||||
ifenslave $bondname $slave
|
||||
ip link set $slave up
|
||||
wait_for_if_up $slave
|
||||
done
|
||||
|
||||
# add the bits to setup the needed post enslavement parameters
|
||||
for arg in $BONDING_OPTS ; do
|
||||
key=${arg%%=*};
|
||||
value=${arg##*=};
|
||||
if [ "${key}" = "primary" ]; then
|
||||
echo $value > /sys/class/net/${netif}/bonding/$key
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# XXX need error handling like dhclient-script
|
||||
|
||||
# start bridge if necessary
|
||||
if [ "$netif" = "$bridgename" ] && [ ! -e /tmp/net.$bridgename.up ]; then
|
||||
ip link set $ethname up
|
||||
if [ "$ethname" = "$bondname" ] ; then
|
||||
DO_BOND_SETUP=yes /sbin/ifup $bondname
|
||||
else
|
||||
ip link set $ethname up
|
||||
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
|
||||
|
||||
|
||||
# No ip lines default to dhcp
|
||||
ip=$(getarg ip)
|
||||
[ -z "$ip" ] && do_dhcp;
|
||||
|
||||
if [ -z "$NO_AUTO_DHCP" ] && [ -z "$ip" ]; then
|
||||
if [ "$netroot" = "dhcp6" ]; then
|
||||
do_dhcp -6
|
||||
else
|
||||
do_dhcp -4
|
||||
fi
|
||||
fi
|
||||
|
||||
# Specific configuration, spin through the kernel command line
|
||||
# looking for ip= lines
|
||||
for p in $(getargs ip=); do
|
||||
ip_to_var $p
|
||||
|
||||
|
||||
# If this option isn't directed at our interface, skip it
|
||||
[ -n "$dev" ] && [ "$dev" != "$netif" ] && continue
|
||||
|
||||
# skip ibft
|
||||
if [ "$autoconf" = "ibft" ]; then
|
||||
if [ -n "$mtu" ] || mtu=$(getarg "mtu="); then
|
||||
ip link set mtu $mtu dev $netif
|
||||
fi
|
||||
continue
|
||||
fi
|
||||
|
||||
# Store config for later use
|
||||
for i in ip srv gw mask hostname; do
|
||||
for i in ip srv gw mask hostname macaddr mtu; do
|
||||
eval '[ "$'$i'" ] && echo '$i'="$'$i'"'
|
||||
done > /tmp/net.$netif.override
|
||||
|
||||
case $autoconf in
|
||||
dhcp|on|any) do_dhcp ;;
|
||||
*) do_static ;;
|
||||
esac
|
||||
OLDIFS="$IFS"
|
||||
IFS=,
|
||||
set -- $autoconf
|
||||
IFS="$OLDIFS"
|
||||
|
||||
for autoconf in "$@"; do
|
||||
case $autoconf in
|
||||
dhcp|on|any)
|
||||
do_dhcp -4 ;;
|
||||
dhcp6)
|
||||
do_dhcp -6 ;;
|
||||
auto6)
|
||||
do_ipv6auto ;;
|
||||
*)
|
||||
do_static ;;
|
||||
esac
|
||||
done
|
||||
break
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
@@ -1,17 +1,36 @@
|
||||
#!/bin/bash
|
||||
dracut_install ip dhclient hostname brctl
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
dracut_install ip dhclient brctl arping ifenslave tr
|
||||
|
||||
inst "$moddir/ifup" "/sbin/ifup"
|
||||
inst "$moddir/netroot" "/sbin/netroot"
|
||||
inst "$moddir/dhclient-script" "/sbin/dhclient-script"
|
||||
inst "$moddir/dhclient.conf" "/etc/dhclient.conf"
|
||||
inst "$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 99 "$moddir/parse-ip-opts.sh"
|
||||
|
||||
inst_hook cmdline 94 "$moddir/parse-ibft.sh"
|
||||
inst_hook cmdline 95 "$moddir/parse-vlan.sh"
|
||||
inst_hook cmdline 97 "$moddir/parse-bond.sh"
|
||||
inst_hook cmdline 98 "$moddir/parse-bridge.sh"
|
||||
inst_hook cmdline 99 "$moddir/parse-ip-opts.sh"
|
||||
|
||||
inst_hook cmdline 99 "$moddir/parse-ifname.sh"
|
||||
inst_hook pre-pivot 10 "$moddir/kill-dhclient.sh"
|
||||
|
||||
# TODO ifcfg config style is redhat specific, this should probably
|
||||
# go into its own module at one time
|
||||
inst_hook pre-pivot 85 "$moddir/write-ifcfg.sh"
|
||||
if ldd $(which sh) 2>/dev/null | grep -q lib64; then
|
||||
LIBDIR="/lib64"
|
||||
else
|
||||
LIBDIR="/lib"
|
||||
fi
|
||||
|
||||
ARCH=$(uname -m)
|
||||
|
||||
for dir in /usr/$LIBDIR/tls/$ARCH/ /usr/$LIBDIR/tls/ /usr/$LIBDIR/$ARCH/ /usr/$LIBDIR/ /$LIBDIR/; do
|
||||
for i in $(ls $dir/libnss_dns.so.* $dir/libnss_mdns4_minimal.so.* 2>/dev/null); do
|
||||
dracut_install $i
|
||||
done
|
||||
done
|
||||
|
||||
mkdir -p "${initdir}/var/run"
|
||||
|
@@ -1,14 +1,23 @@
|
||||
#!/bin/bash
|
||||
# Include wired net drivers, excluding wireless
|
||||
for modname in $(find "$srcmods/kernel/drivers" -name '*.ko'); do
|
||||
if nm -uPA $modname | grep -q eth_type_trans; then
|
||||
if echo "$modname" | grep -q wireless; then
|
||||
continue
|
||||
else
|
||||
instmods $modname
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
net_module_test() {
|
||||
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 ]]
|
||||
}
|
||||
|
||||
instmods $(filter_kernel_modules net_module_test)
|
||||
|
||||
instmods ecb arc4
|
||||
# bridge modules
|
||||
instmods bridge stp llc
|
||||
instmods ipv6
|
||||
# vlan
|
||||
instmods 8021q
|
||||
# bonding
|
||||
instmods bonding
|
||||
# hyperv
|
||||
hostonly='' instmods hv_netvsc
|
||||
|
@@ -1,4 +1,6 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# pxelinux provides macaddr '-' separated, but we need ':'
|
||||
fix_bootif() {
|
||||
@@ -6,7 +8,9 @@ fix_bootif() {
|
||||
local IFS='-'
|
||||
macaddr=$(for i in ${macaddr} ; do echo -n $i:; done)
|
||||
macaddr=${macaddr%:}
|
||||
echo $macaddr
|
||||
# strip hardware type field from pxelinux
|
||||
[ -n "${macaddr%??:??:??:??:??:??}" ] && macaddr=${macaddr#??:}
|
||||
echo $macaddr | tr '[:upper:]' '[:lower:]'
|
||||
}
|
||||
|
||||
# Don't continue if we don't need network
|
||||
@@ -17,27 +21,36 @@ fix_bootif() {
|
||||
# bridge: attempt only the defined interface
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
IFACES=$ethname
|
||||
IFACES="$IFACES $ethname"
|
||||
fi
|
||||
|
||||
for i in /tmp/vlan.*.phy; do
|
||||
[ -e "$i" ] || continue
|
||||
IFACES="$IFACES $(cat "$i")"
|
||||
done
|
||||
|
||||
# bond: attempt only the defined interface (override bridge defines)
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
# It is enough to fire up only one
|
||||
IFACES=${bondslaves%% *}
|
||||
fi
|
||||
|
||||
# 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+="/sbin/initqueue --onetime --unique --name ifup-$env{INTERFACE} /sbin/ifup $env{INTERFACE}"\n' "$BOOTIF"
|
||||
|
||||
# If we have to handle multiple interfaces, handle only them.
|
||||
elif [ -n "$IFACES" ] ; then
|
||||
for iface in $IFACES ; do
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", KERNEL=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$iface"
|
||||
printf 'SUBSYSTEM=="net", ENV{INTERFACE}=="%s", RUN+="/sbin/initqueue --onetime --unique --name ifup-$env{INTERFACE} /sbin/ifup $env{INTERFACE}"\n' "$iface"
|
||||
done
|
||||
|
||||
# Default: We don't know the interface to use, handle all
|
||||
else
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", RUN+="/sbin/ifup $env{INTERFACE}"\n'
|
||||
printf 'SUBSYSTEM=="net", ENV{INTERFACE}=="?*", RUN+="/sbin/initqueue --onetime --unique --name ifup-$env{INTERFACE} /sbin/ifup $env{INTERFACE}"\n'
|
||||
fi
|
||||
|
||||
# Udev event 'online' only gets fired from ifup/dhclient-script.
|
||||
# No special rules required
|
||||
printf 'ACTION=="online", SUBSYSTEM=="net", RUN+="/sbin/netroot $env{INTERFACE}"\n'
|
||||
} > /etc/udev/rules.d/60-net.rules
|
||||
|
@@ -4,33 +4,17 @@ PATH=$PATH:/sbin:/usr/sbin
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
if getarg rdnetdebug ; then
|
||||
exec >/tmp/netroot.$1.$$.out
|
||||
exec 2>>/tmp/netroot.$1.$$.out
|
||||
set -x
|
||||
fi
|
||||
[ "$RDDEBUG" = "yes" ] \
|
||||
&& [ -e /dev/initlog.pipe ] \
|
||||
&& exec >>/dev/initlog.pipe 2>>/dev/initlog.pipe
|
||||
|
||||
# Huh? Empty $1?
|
||||
[ -z "$1" ] && exit 1
|
||||
|
||||
# Huh? No interface config?
|
||||
[ ! -e /tmp/net.$1.up ] && exit 1
|
||||
|
||||
# Only try to configure from one network interface at a time
|
||||
#
|
||||
if [ -z "$NETROOT_LOCKED" ] ; then
|
||||
NETROOT_LOCKED=true
|
||||
export NETROOT_LOCKED
|
||||
exec flock -xo /tmp/netroot.lock -c "$0 $*"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 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
|
||||
@@ -42,11 +26,15 @@ done
|
||||
|
||||
# Set or override primary interface
|
||||
netif=$1
|
||||
[ -e "/tmp/net.bootdev" ] && read netif < /tmp/net.bootdev
|
||||
if [ -e "/tmp/net.bootdev" ]; then
|
||||
read netif < /tmp/net.bootdev
|
||||
# only boot from $netif
|
||||
[ -n "$1" ] && [ -n "$netif"] && [ "$netif" != "$1" ] && exit 1
|
||||
fi
|
||||
|
||||
# Figure out the handler for root=dhcp by recalling all netroot cmdline
|
||||
# handlers
|
||||
if [ "$netroot" = "dhcp" ] ; then
|
||||
if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] ; then
|
||||
# Unset root so we can check later
|
||||
unset root
|
||||
|
||||
@@ -71,6 +59,37 @@ else
|
||||
rootok="1"
|
||||
fi
|
||||
|
||||
# We're here, so we can assume that upping interfaces is now ok
|
||||
[ -z "$IFACES" ] && IFACES="$netif"
|
||||
|
||||
[ -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 default router 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
|
||||
[ -n "$new_routers" ] && dest=${new_routers%%,*}
|
||||
[ -n "$gw" ] && dest=$gw
|
||||
if [ -z "$dest" ] ; then
|
||||
dummy=${netroot#*:}
|
||||
dummy=${dummy%%:*}
|
||||
case "$dummy" in
|
||||
[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*) dest=$dummy;;
|
||||
esac
|
||||
fi
|
||||
[ -n "$dest" ] && arping -q -f -w 60 -I $netif $dest
|
||||
|
||||
[ -d $NEWROOT/proc ] && exit 0
|
||||
[ -z "$netroot" ] && exit 1
|
||||
|
||||
# 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'"
|
||||
@@ -82,16 +101,6 @@ 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
|
||||
|
||||
# Source netroot hooks before we start the handler
|
||||
source_all netroot
|
||||
|
||||
@@ -100,20 +109,20 @@ source_all netroot
|
||||
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
|
||||
[ -s /tmp/dhclient.$iface.lease ] && cp /tmp/dhclient.$iface.lease /tmp/net.$iface.lease
|
||||
[ -s /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"
|
||||
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
|
||||
# if [ -z "$BOOTDEV" ] ; then
|
||||
# ip link set $netif down
|
||||
# ip addr flush dev $netif
|
||||
# echo "#empty" > /etc/resolv.conf
|
||||
# fi
|
||||
fi
|
||||
exit 0
|
||||
|
63
modules.d/40network/parse-bond.sh
Executable file
63
modules.d/40network/parse-bond.sh
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Format:
|
||||
# bond=<bondname>[:<bondslaves>:[:<options>]]
|
||||
#
|
||||
# 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 include 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
|
||||
#
|
||||
|
||||
# return if bond already parsed
|
||||
[ -n "$bondname" ] && return
|
||||
|
||||
# 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
|
||||
# Ditto for bonding options
|
||||
parsebond() {
|
||||
local v=${1}:
|
||||
set --
|
||||
while [ -n "$v" ]; do
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
done
|
||||
|
||||
unset bondname bondslaves bondoptions
|
||||
case $# in
|
||||
0) bondname=bond0; bondslaves="eth0 eth1" ;;
|
||||
1) bondname=$1; bondslaves="eth0 eth1" ;;
|
||||
2) bondname=$1; bondslaves=$(echo $2|tr "," " ") ;;
|
||||
3) bondname=$1; bondslaves=$(echo $2|tr "," " "); bondoptions=$(echo $3|tr "," " ") ;;
|
||||
*) die "bond= requires zero to four parameters" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
unset bondname bondslaves bondoptions
|
||||
|
||||
# Parse bond for bondname, bondslaves, bondmode and bondoptions
|
||||
if getarg bond >/dev/null; then
|
||||
# Read bond= parameters if they exist
|
||||
bond="$(getarg bond=)"
|
||||
if [ ! "$bond" = "bond" ]; then
|
||||
parsebond "$(getarg bond=)"
|
||||
fi
|
||||
# Simple default bond
|
||||
if [ -z "$bondname" ]; then
|
||||
bondname=bond0
|
||||
bondslaves="eth0 eth1"
|
||||
fi
|
||||
# Make it suitable for initscripts export
|
||||
bondoptions=$(echo $bondoptions|tr ";" ",")
|
||||
echo "bondname=$bondname" > /tmp/bond.info
|
||||
echo "bondslaves=\"$bondslaves\"" >> /tmp/bond.info
|
||||
echo "bondoptions=\"$bondoptions\"" >> /tmp/bond.info
|
||||
return
|
||||
fi
|
23
modules.d/40network/parse-bridge.sh
Normal file → Executable file
23
modules.d/40network/parse-bridge.sh
Normal file → Executable file
@@ -10,7 +10,7 @@
|
||||
[ -n "$bridgename" ] && return
|
||||
|
||||
# Check if bridge parameter is valid
|
||||
if getarg ip= >/dev/null ; then
|
||||
if getarg bridge= >/dev/null ; then
|
||||
if [ -z "$netroot" ] ; then
|
||||
die "No netboot configured, bridge is invalid"
|
||||
fi
|
||||
@@ -26,27 +26,34 @@ parsebridge() {
|
||||
|
||||
unset bridgename ethname
|
||||
case $# in
|
||||
0) bridgename=br0; ethname=eth0 ;;
|
||||
1) die "bridge= requires two parameters" ;;
|
||||
2) bridgename=$1; ethname=$2 ;;
|
||||
*) die "bridge= requires two parameters" ;;
|
||||
0) bridgename=br0; ethname=$iface ;;
|
||||
1) die "bridge= requires two parameters" ;;
|
||||
2) bridgename=$1; ethname=$2 ;;
|
||||
*) die "bridge= requires two parameters" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
unset bridgename ethname
|
||||
|
||||
iface=eth0
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
if [ -n "$bondname" ] ; then
|
||||
iface=$bondname
|
||||
fi
|
||||
fi
|
||||
|
||||
# Parse bridge for bridgename and ethname
|
||||
if getarg bridge >/dev/null; then
|
||||
initrdargs="$initrdargs bridge"
|
||||
# Read bridge= parameters if they exist
|
||||
bridge="$(getarg bridge=)"
|
||||
if [ ! "$bridge" = "bridge" ]; then
|
||||
if [ ! "$bridge" = "bridge" ]; then
|
||||
parsebridge "$(getarg bridge=)"
|
||||
fi
|
||||
# Simple default bridge
|
||||
if [ -z "$bridgename" ]; then
|
||||
bridgename=br0
|
||||
ethname=eth0
|
||||
ethname=$iface
|
||||
fi
|
||||
echo "bridgename=$bridgename" > /tmp/bridge.info
|
||||
echo "ethname=$ethname" >> /tmp/bridge.info
|
||||
|
85
modules.d/40network/parse-ibft.sh
Executable file
85
modules.d/40network/parse-ibft.sh
Executable file
@@ -0,0 +1,85 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
for p in $(getargs ip=); do
|
||||
[ "ibft" = "$p" ] || continue
|
||||
|
||||
modprobe iscsi_ibft
|
||||
num=0
|
||||
(
|
||||
for iface in /sys/firmware/ibft/ethernet*; do
|
||||
unset ifname_mac
|
||||
unset ifname_if
|
||||
unset dhcp
|
||||
unset ip
|
||||
unset gw
|
||||
unset mask
|
||||
unset hostname
|
||||
unset vlan
|
||||
unset dns1
|
||||
unset dns2
|
||||
[ -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
|
||||
|
||||
if [ -e ${iface}/vlan ]; then
|
||||
vlan=$(read a < ${iface}/vlan; echo $a)
|
||||
if [ "$vlan" -ne "0" ]; then
|
||||
case "$vlan" in
|
||||
[0-9]*)
|
||||
[ -e /tmp/net.${dev}.${vlan}.has_ibft_config ] && continue
|
||||
echo "vlan=$dev.$vlan:$dev"
|
||||
dev="${dev}.${vlan}"
|
||||
;;
|
||||
*)
|
||||
[ -e /tmp/net.${vlan}.has_ibft_config ] && continue
|
||||
echo "vlan=$vlan:$dev"
|
||||
dev="${vlan}"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
[ -e /tmp/net.${dev}.has_ibft_config ] && continue
|
||||
|
||||
[ -e ${iface}/dhcp ] && dhcp=$(read a < ${iface}/dhcp; echo $a)
|
||||
|
||||
if [ -n "$dhcp" ]; then
|
||||
echo "ip=$dev:dhcp"
|
||||
else
|
||||
[ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a)
|
||||
[ "$ip" = "0.0.0.0" ] && unset ip
|
||||
[ -e ${iface}/gateway ] && gw=$(read a < ${iface}/gateway; echo $a)
|
||||
[ -e ${iface}/subnet-mask ] && mask=$(read a < ${iface}/subnet-mask; echo $a)
|
||||
[ -e ${iface}/hostname ] && hostname=$(read a < ${iface}/hostname; echo $a)
|
||||
[ -n "$ip" ] && echo "ip=$ip::$gw:$mask:$hostname:$dev:none"
|
||||
|
||||
[ -e ${iface}/primary-dns ] && dns1=$(read a < ${iface}/primary-dns; echo $a) \
|
||||
&& echo "nameserver=${dns1}"
|
||||
[ -e ${iface}/secondary-dns ] && dns2=$(read a < ${iface}/secondary-dns; echo $a) \
|
||||
&& echo "nameserver=${dns2}"
|
||||
fi
|
||||
|
||||
echo $mac > /tmp/net.${dev}.has_ibft_config
|
||||
done
|
||||
) >> /etc/cmdline
|
||||
# reread cmdline
|
||||
unset CMDLINE
|
||||
done
|
37
modules.d/40network/parse-ifname.sh
Executable file
37
modules.d/40network/parse-ifname.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Format:
|
||||
# ifname=<interface>:<mac>
|
||||
#
|
||||
#
|
||||
# Examples:
|
||||
# ifname=eth0:4a:3f:4c:04:f8:d7
|
||||
#
|
||||
# Note when using ifname= to get persistent interface names, you must specify
|
||||
# an ifname= argument for each interface used in an ip= or fcoe= argument
|
||||
|
||||
parse_ifname_opts() {
|
||||
local IFS=:
|
||||
set $1
|
||||
|
||||
case $# in
|
||||
7)
|
||||
ifname_if=$1
|
||||
# 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="
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# check if there are any ifname parameters
|
||||
if ! getarg ifname= >/dev/null ; then
|
||||
return
|
||||
fi
|
||||
|
||||
# Check ifname= lines
|
||||
for p in $(getargs ifname=); do
|
||||
parse_ifname_opts $p
|
||||
done
|
@@ -1,4 +1,6 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Format:
|
||||
# ip=[dhcp|on|any]
|
||||
@@ -12,23 +14,7 @@
|
||||
# routing,dns,dhcp-options,etc.
|
||||
#
|
||||
|
||||
# Sadly there's no easy way to split ':' separated lines into variables
|
||||
ip_to_var() {
|
||||
local v=${1}:
|
||||
set --
|
||||
while [ -n "$v" ]; do
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
done
|
||||
|
||||
unset ip srv gw mask hostname dev autoconf
|
||||
case $# in
|
||||
0) autoconf="error" ;;
|
||||
1) autoconf=$1 ;;
|
||||
2) dev=$1; autoconf=$2 ;;
|
||||
*) ip=$1; srv=$2; gw=$3; mask=$4; hostname=$5; dev=$6; autoconf=$7 ;;
|
||||
esac
|
||||
}
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
# Check if ip= lines should be used
|
||||
if getarg ip= >/dev/null ; then
|
||||
@@ -51,18 +37,21 @@ if [ -n "$netroot" ] && [ -z "$(getarg ip=)" ] ; then
|
||||
fi
|
||||
|
||||
# Count ip= lines to decide whether we need bootdev= or not
|
||||
if [ -z "$NEEDBOOTDEV" ] ; then
|
||||
local count=0
|
||||
for p in $(getargs ip=); do
|
||||
count=$(( $count + 1 ))
|
||||
done
|
||||
[ $count -gt 1 ] && NEEDBOOTDEV=1
|
||||
if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ]; then
|
||||
if [ -z "$NEEDBOOTDEV" ] ; then
|
||||
local count=0
|
||||
for p in $(getargs ip=); do
|
||||
count=$(( $count + 1 ))
|
||||
done
|
||||
[ $count -gt 1 ] && NEEDBOOTDEV=1
|
||||
fi
|
||||
fi
|
||||
|
||||
# If needed, check if bootdev= contains anything usable
|
||||
BOOTDEV=$(getarg bootdev=)
|
||||
|
||||
if [ -n "$NEEDBOOTDEV" ] ; then
|
||||
BOOTDEV=$(getarg bootdev=) || die "Please supply bootdev argument for multiple ip= lines"
|
||||
[ -z "$BOOTDEV" ] && die "Bootdev argument is empty"
|
||||
[ -z "$BOOTDEV" ] && warn "Please supply bootdev argument for multiple ip= lines"
|
||||
fi
|
||||
|
||||
# Check ip= lines
|
||||
@@ -70,6 +59,9 @@ fi
|
||||
for p in $(getargs ip=); do
|
||||
ip_to_var $p
|
||||
|
||||
# skip ibft
|
||||
[ "$autoconf" = "ibft" ] && continue
|
||||
|
||||
# We need to have an ip= line for the specified bootdev
|
||||
[ -n "$NEEDBOOTDEV" ] && [ "$dev" = "$BOOTDEV" ] && BOOTDEVOK=1
|
||||
|
||||
@@ -78,40 +70,44 @@ for p in $(getargs ip=); do
|
||||
warn "Empty autoconf values default to dhcp"
|
||||
autoconf="dhcp"
|
||||
fi
|
||||
|
||||
# Error checking for autoconf in combination with other values
|
||||
case $autoconf in
|
||||
error) die "Error parsing option 'ip=$p'";;
|
||||
bootp|rarp|both) die "Sorry, ip=$autoconf is currenty unsupported";;
|
||||
none|off) \
|
||||
[ -z "$ip" ] && \
|
||||
OLDIFS="$IFS"
|
||||
IFS=,
|
||||
set -- $autoconf
|
||||
IFS="$OLDIFS"
|
||||
for autoconf in "$@"; do
|
||||
# Error checking for autoconf in combination with other values
|
||||
case $autoconf in
|
||||
error) die "Error parsing option 'ip=$p'";;
|
||||
bootp|rarp|both) die "Sorry, ip=$autoconf is currenty unsupported";;
|
||||
none|off) \
|
||||
[ -z "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nValue '$autoconf' without static configuration does not make sense"
|
||||
[ -z "$mask" ] && \
|
||||
die "Sorry, automatic calculation of netmask is not yet supported"
|
||||
;;
|
||||
dhcp|on|any) \
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
|
||||
[ -z "$mask" ] && \
|
||||
die "Sorry, automatic calculation of netmask is not yet supported"
|
||||
;;
|
||||
auto6);;
|
||||
dhcp|dhcp6|on|any) \
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
|
||||
die "Sorry, 'ip=$p' does not make sense for multiple interface configurations"
|
||||
[ -n "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoconf'"
|
||||
;;
|
||||
*) die "For argument 'ip=$p'\nSorry, unknown value '$autoconf'";;
|
||||
esac
|
||||
[ -n "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoconf'"
|
||||
;;
|
||||
*) die "For argument 'ip=$p'\nSorry, unknown value '$autoconf'";;
|
||||
esac
|
||||
_part=${_part%,*}
|
||||
done
|
||||
|
||||
if [ -n "$dev" ] ; then
|
||||
# We don't like duplicate device configs
|
||||
if [ -n "$IFACES" ] ; then
|
||||
for i in $IFACES ; do
|
||||
[ "$dev" = "$i" ] && die "For argument 'ip=$p'\nDuplication configurations for '$dev'"
|
||||
[ "$dev" = "$i" ] && warn "For argument 'ip=$p'\nDuplication configurations for '$dev'"
|
||||
done
|
||||
fi
|
||||
# IFACES list for later use
|
||||
IFACES="$IFACES $dev"
|
||||
fi
|
||||
|
||||
# Small optimization for udev rules
|
||||
[ -z "$NEEDBOOTDEV" ] && [ -n "$dev" ] && BOOTDEV=$dev
|
||||
|
||||
# Do we need to check for specific options?
|
||||
if [ -n "$NEEDDHCP" ] || [ -n "$DHCPORSERVER" ] ; then
|
||||
# Correct device? (Empty is ok as well)
|
||||
|
32
modules.d/40network/parse-vlan.sh
Executable file
32
modules.d/40network/parse-vlan.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Format:
|
||||
# vlan=<vlanname>:<phydevice>
|
||||
#
|
||||
|
||||
parsevlan() {
|
||||
local v=${1}:
|
||||
set --
|
||||
while [ -n "$v" ]; do
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
done
|
||||
|
||||
case $# in
|
||||
2) vlanname=$1; phydevice=$2 ; return 0 ;;
|
||||
*) die "vlan= requires two parameters" ;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
unset vlanname phydevice
|
||||
|
||||
for vlan in $(getargs vlan); do
|
||||
[ "$vlan" = "vlan" ] && continue
|
||||
unset vlanname phydevice
|
||||
if parsevlan "$(getarg vlan=)"; then
|
||||
echo "$phydevice" > /tmp/vlan.${phydevice}.phy
|
||||
echo "$phydevice" >> /tmp/net.ifaces
|
||||
echo "$vlanname" > /tmp/vlan.${vlanname}.${phydevice}
|
||||
fi
|
||||
done
|
@@ -1,49 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# NFS root might have reached here before /tmp/net.ifaces was written
|
||||
udevadm settle --timeout=30
|
||||
# Don't write anything if we don't know our bootdev
|
||||
[ -f /tmp/net.ifaces ] || return 1
|
||||
|
||||
read IFACES < /tmp/net.ifaces
|
||||
|
||||
for netif in $IFACES ; do
|
||||
# bridge?
|
||||
unset bridge
|
||||
if [ "$netif" = "$bridgename" ]; then
|
||||
bridge=yes
|
||||
fi
|
||||
cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr
|
||||
echo "# Generated by dracut initrd" > /tmp/net.$netif.ifcfg
|
||||
echo "DEVICE=$netif" >> /tmp/net.$netif.ifcfg
|
||||
echo "ONBOOT=yes" >> /tmp/net.$netif.ifcfg
|
||||
if [ -f /tmp/net.$netif.lease ]; then
|
||||
echo "BOOTPROTO=dhcp" >> /tmp/net.$netif.ifcfg
|
||||
else
|
||||
echo "BOOTPROTO=none" >> /tmp/net.$netif.ifcfg
|
||||
# If we've booted with static ip= lines, the override file is there
|
||||
. /tmp/net.$netif.override
|
||||
echo "IPADDR=$ip" >> /tmp/net.$netif.ifcfg
|
||||
echo "NETMASK=$mask" >> /tmp/net.$netif.ifcfg
|
||||
[ -n "$gw" ] && echo "GATEWAY=$gw" >> /tmp/net.$netif.ifcfg
|
||||
fi
|
||||
|
||||
# bridge needs differente things written to ifcfg
|
||||
if [ -z "$bridge" ]; then
|
||||
# standard interface
|
||||
echo "HWADDR=$(cat /sys/class/net/$netif/address)" >> /tmp/net.$netif.ifcfg
|
||||
echo "TYPE=Ethernet" >> /tmp/net.$netif.ifcfg
|
||||
echo "NAME=\"Boot Disk\"" >> /tmp/net.$netif.ifcfg
|
||||
else
|
||||
# bridge
|
||||
echo "TYPE=Bridge" >> /tmp/net.$netif.ifcfg
|
||||
echo "NAME=\"Boot Disk\"" >> /tmp/net.$netif.ifcfg
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
echo "DEVICE=$ethname" >> /tmp/net.$ethname.ifcfg
|
||||
echo "TYPE=Ethernet" >> /tmp/net.$ethname.ifcfg
|
||||
echo "ONBOOT=yes" >> /tmp/net.$ethname.ifcfg
|
||||
echo "HWADDR=$(cat /sys/class/net/$ethname/address)" >> /tmp/net.$ethname.ifcfg
|
||||
echo "BRIDGE=$netif" >> /tmp/net.$ethname.ifcfg
|
||||
echo "NAME=$ethname" >> /tmp/net.$ethname.ifcfg
|
||||
fi
|
||||
done
|
6
modules.d/45ifcfg/check
Executable file
6
modules.d/45ifcfg/check
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# ifcfg is required by network
|
||||
#[[ $1 = -d ]] && echo network
|
||||
|
||||
exit 255
|
2
modules.d/45ifcfg/install
Executable file
2
modules.d/45ifcfg/install
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
inst_hook pre-pivot 85 "$moddir/write-ifcfg.sh"
|
168
modules.d/45ifcfg/write-ifcfg.sh
Normal file
168
modules.d/45ifcfg/write-ifcfg.sh
Normal file
@@ -0,0 +1,168 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# NFS root might have reached here before /tmp/net.ifaces was written
|
||||
udevadm settle --timeout=30
|
||||
# Don't write anything if we don't know our bootdev
|
||||
[ -f /tmp/net.ifaces ] || return 1
|
||||
|
||||
read IFACES < /tmp/net.ifaces
|
||||
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
fi
|
||||
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
fi
|
||||
|
||||
mkdir -p /tmp/ifcfg/
|
||||
|
||||
for netif in $IFACES ; do
|
||||
unset bridge
|
||||
unset bond
|
||||
unset vlan
|
||||
unset phydevice
|
||||
unset vlanname
|
||||
unset uuid
|
||||
unset ip
|
||||
unset gw
|
||||
unset mtu
|
||||
unset mask
|
||||
unset macaddr
|
||||
|
||||
# bridge?
|
||||
if [ "$netif" = "$bridgename" ]; then
|
||||
bridge=yes
|
||||
elif [ "$netif" = "$bondname" ]; then
|
||||
# $netif can't be bridge and bond at the same time
|
||||
bond=yes
|
||||
fi
|
||||
|
||||
for i in /tmp/vlan.${netif}.*; do
|
||||
[ ! -e "$i" ] && continue
|
||||
. "$i"
|
||||
vlan=yes
|
||||
break
|
||||
done
|
||||
|
||||
cat /sys/class/net/$netif/address > /tmp/net.${netif}.hwaddr
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$netif"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
if [ -f /tmp/dhclient.${netif}.dhcpopts ]; then
|
||||
strstr "$ip" '*:*:*' && echo "DHCPV6C=yes"
|
||||
echo "BOOTPROTO=dhcp"
|
||||
[ -f /tmp/dhclient.${netif}.lease ] && cp /tmp/dhclient.${netif}.lease /tmp/net.${netif}.lease
|
||||
[ -f /tmp/dhclient.${netif}.dhcpopts ] && cp /tmp/dhclient.${netif}.dhcpopts /tmp/net.${netif}.dhcpopts
|
||||
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"
|
||||
[ -n "$gw" ] && echo "GATEWAY=$gw"
|
||||
fi
|
||||
} > /tmp/ifcfg/ifcfg-$netif
|
||||
|
||||
# bridge needs different things written to ifcfg
|
||||
if [ -z "$bridge" ] && [ -z "$bond" ] && [ -z "$vlan" ]; then
|
||||
# standard interface
|
||||
{
|
||||
echo "HWADDR=$(cat /sys/class/net/$netif/address)"
|
||||
echo "TYPE=Ethernet"
|
||||
echo "NAME=\"Boot Disk\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
fi
|
||||
|
||||
if [ -n "$vlan" ] ; then
|
||||
{
|
||||
echo "TYPE=Vlan"
|
||||
echo "NAME=\"$netif\""
|
||||
echo "VLAN=yes"
|
||||
echo "PHYSDEV=\"$phydevice\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
fi
|
||||
|
||||
if [ -n "$bond" ] ; then
|
||||
# bond interface
|
||||
{
|
||||
# This variable is an indicator of a bond interface for initscripts
|
||||
echo "BONDING_OPTS=\"$bondoptions\""
|
||||
echo "NAME=\"Boot Disk\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
|
||||
for slave in $bondslaves ; do
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$slave"
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "HWADDR=$(cat /sys/class/net/$slave/address)"
|
||||
echo "SLAVE=yes"
|
||||
echo "MASTER=$netif"
|
||||
echo "NAME=$slave"
|
||||
} >> /tmp/ifcfg/ifcfg-$slave
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -n "$bridge" ] ; then
|
||||
# bridge
|
||||
{
|
||||
echo "TYPE=Bridge"
|
||||
echo "NAME=\"Boot Disk\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
if [ "$ethname" = "$bondname" ] ; then
|
||||
{
|
||||
# This variable is an indicator of a bond interface for initscripts
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$bondname"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "BONDING_OPTS=\"$bondoptions\""
|
||||
echo "BRIDGE=$netif"
|
||||
echo "NAME=\"$bondname\""
|
||||
} >> /tmp/ifcfg/ifcfg-$bondname
|
||||
for slave in $bondslaves ; do
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
# yes, duplicated code at this moment
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$slave"
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "HWADDR=$(cat /sys/class/net/$slave/address)"
|
||||
echo "SLAVE=yes"
|
||||
echo "MASTER=$bondname"
|
||||
echo "NAME=$slave"
|
||||
} >> /tmp/ifcfg/ifcfg-$slave
|
||||
done
|
||||
else
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$ethname"
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "HWADDR=$(cat /sys/class/net/$ethname/address)"
|
||||
echo "BRIDGE=$netif"
|
||||
echo "NAME=$ethname"
|
||||
} >> /tmp/ifcfg/ifcfg-$ethname
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Pass network opts
|
||||
mkdir /dev/.initramfs/
|
||||
cp /tmp/net.* /dev/.initramfs/ >/dev/null 2>&1
|
||||
mkdir -p /dev/.initramfs/state/etc/sysconfig/network-scripts/
|
||||
cp /tmp/net.$netif.resolv.conf /dev/.initramfs/state/etc/ >/dev/null 2>&1
|
||||
echo "files /etc/sysconfig/network-scripts" > /dev/.initramfs/rwtab
|
||||
cp -a /tmp/ifcfg/* /dev/.initramfs/state/etc/sysconfig/network-scripts/ >/dev/null 2>&1
|
@@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
[[ $1 = -d ]] && echo crypt
|
||||
[[ $1 = -d ]] && which cryptsetup &>/dev/null && echo crypt
|
||||
[[ -x /sbin/plymouthd && -x /bin/plymouth && -x /usr/sbin/plymouth-set-default-theme ]]
|
||||
|
@@ -1,41 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# do not ask, if we already have root
|
||||
[ -f /sysroot/proc ] && exit 0
|
||||
|
||||
# check if destination already exists
|
||||
[ -b /dev/mapper/$2 ] && exit 0
|
||||
|
||||
# we already asked for this device
|
||||
[ -f /tmp/cryptroot-asked-$2 ] && exit 0
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
LUKS=$(getargs rd_LUKS_UUID=)
|
||||
ask=1
|
||||
|
||||
if [ -n "$LUKS" ]; then
|
||||
ask=0
|
||||
for luks in $LUKS; do
|
||||
if [ "${2##$luks}" != "$2" ]; then
|
||||
ask=1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ $ask -gt 0 ]; then
|
||||
# flock against other interactive activities
|
||||
{ flock -s 9;
|
||||
/bin/plymouth ask-for-password \
|
||||
--prompt "$1 is password protected" \
|
||||
--command="/sbin/cryptsetup luksOpen -T1 $1 $2"
|
||||
} 9>/.console.lock
|
||||
fi
|
||||
|
||||
# mark device as asked
|
||||
>> /tmp/cryptroot-asked-$2
|
||||
|
||||
unset LUKS
|
||||
unset ask
|
||||
unset luks
|
||||
exit 0
|
||||
|
@@ -1,7 +1,15 @@
|
||||
#!/bin/bash
|
||||
. "$moddir"/plymouth-populate-initrd
|
||||
inst_hook cmdline 30 "$moddir/parse-plymouth.sh"
|
||||
|
||||
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
|
||||
else
|
||||
PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \
|
||||
/usr/libexec/plymouth/plymouth-populate-initrd -t $initdir
|
||||
fi
|
||||
|
||||
inst_hook pre-pivot 90 "$moddir"/plymouth-newroot.sh
|
||||
inst_hook pre-trigger 10 "$moddir"/plymouth-pretrigger.sh
|
||||
inst_hook emergency 50 "$moddir"/plymouth-emergency.sh
|
||||
inst "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask
|
||||
inst_hook emergency 00 "$moddir"/plymouth-emergency.sh
|
||||
inst readlink
|
||||
|
@@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
# Include KMS capable drm drivers
|
||||
for modname in $(find "$srcmods/kernel/drivers/gpu/drm" -name '*.ko'); do
|
||||
nm -uPA $modname | grep -q drm_crtc_init && instmods $modname
|
||||
for modname in $(find "$srcmods/kernel/drivers/gpu/drm" -name '*.ko' 2>/dev/null); do
|
||||
grep -q drm_crtc_init $modname && instmods $modname
|
||||
done
|
||||
|
||||
hostonly='' instmods hyperv_fb
|
||||
|
@@ -1,19 +0,0 @@
|
||||
initrdargs="$initrdargs rd_plytheme"
|
||||
|
||||
PLYMOUTH_THEMEDIR=/usr/share/plymouth/themes
|
||||
PLYMOUTH_THEME=$(getarg rd_plytheme=)
|
||||
if [ -n "$PLYMOUTH_THEME" ]; then
|
||||
if [ -f "${PLYMOUTH_THEMEDIR}/${PLYMOUTH_THEME}/${PLYMOUTH_THEME}.plymouth" ]; then
|
||||
info "Setting theme $PLYMOUTH_THEME"
|
||||
(
|
||||
cd $PLYMOUTH_THEMEDIR;
|
||||
ln -fs "${PLYMOUTH_THEME}/${PLYMOUTH_THEME}.plymouth" default.plymouth 2>&1 | vinfo;
|
||||
)
|
||||
else
|
||||
warn "Theme $PLYMOUTH_THEME not found!"
|
||||
fi
|
||||
fi
|
||||
|
||||
unset PLYMOUTH_THEME
|
||||
unset PLYMOUTH_THEMEDIR
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
if ldd /sbin/plymouthd |grep -q lib64; then
|
||||
if ldd /sbin/plymouthd 2>/dev/null | grep -q lib64; then
|
||||
LIBDIR="/usr/lib64"
|
||||
else
|
||||
LIBDIR="/usr/lib"
|
||||
@@ -30,18 +30,19 @@ if [[ $hostonly ]]; then
|
||||
if [ -L /usr/share/plymouth/themes/default.plymouth ]; then
|
||||
inst /usr/share/plymouth/themes/default.plymouth
|
||||
# Install plugin for this theme
|
||||
PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth |awk -F= {'print $2'})
|
||||
PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth | while read a b c; do echo $b; done;)
|
||||
inst ${LIBDIR}/plymouth/${PLYMOUTH_PLUGIN}.so
|
||||
fi
|
||||
else
|
||||
for x in /usr/share/plymouth/themes/*/* ; do
|
||||
for x in /usr/share/plymouth/themes/{text,details}/* ; do
|
||||
[[ -f "$x" ]] || continue
|
||||
THEME_DIR=$(dirname "$x")
|
||||
mkdir -p "${initdir}/$THEME_DIR"
|
||||
dracut_install "$x"
|
||||
done
|
||||
for x in ${LIBDIR}/plymouth/*.so ; do
|
||||
for x in ${LIBDIR}/plymouth/{text,details}.so ; do
|
||||
[[ -f "$x" ]] || continue
|
||||
[[ "$x" != "${x%%/label.so}" ]] && continue
|
||||
dracut_install "$x"
|
||||
done
|
||||
(
|
||||
|
@@ -1,18 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -c /dev/null ] || mknod /dev/null c 1 3
|
||||
# first trigger graphics subsystem
|
||||
udevadm trigger --attr-match=class=0x030000 >/dev/null 2>&1
|
||||
# first trigger graphics and tty subsystem
|
||||
udevadm trigger --subsystem-match=graphics --subsystem-match=drm --subsystem-match=tty >/dev/null 2>&1
|
||||
if ! getarg rd_NO_PLYMOUTH; then
|
||||
[ -c /dev/null ] || mknod -m 0666 /dev/null c 1 3
|
||||
# first trigger graphics subsystem
|
||||
udevadm trigger --attr-match=class=0x030000 >/dev/null 2>&1
|
||||
# first trigger graphics and tty subsystem
|
||||
udevadm trigger --subsystem-match=graphics --subsystem-match=drm --subsystem-match=tty --subsystem-match=acpi >/dev/null 2>&1
|
||||
|
||||
udevadm settle --timeout=30 2>&1 | vinfo
|
||||
[ -c /dev/zero ] || mknod /dev/zero c 1 5
|
||||
[ -c /dev/systty ] || mknod /dev/systty c 4 0
|
||||
[ -c /dev/fb ] || mknod /dev/fb c 29 0
|
||||
[ -c /dev/hvc0 ] || mknod /dev/hvc0 c 229 0
|
||||
udevadm settle --timeout=30 >/dev/null 2>&1
|
||||
[ -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
|
||||
[ -c /dev/hvc0 ] || mknod -m 0600 /dev/hvc0 c 229 0
|
||||
|
||||
info "Starting plymouth daemon"
|
||||
[ -x /bin/plymouthd ] && /bin/plymouthd
|
||||
/bin/plymouth --show-splash 2>&1 | vinfo
|
||||
info "Starting plymouth daemon"
|
||||
consoledev=$(getarg console= | sed -e 's/,.*//')
|
||||
consoledev=${consoledev:-tty0}
|
||||
[ -x /lib/udev/console_init ] && /lib/udev/console_init "/dev/$consoledev"
|
||||
|
||||
[ -x /bin/plymouthd ] && /bin/plymouthd --attach-to-session
|
||||
/bin/plymouth --show-splash 2>&1 | vinfo
|
||||
fi
|
||||
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
|
14
modules.d/60xen/check
Executable file
14
modules.d/60xen/check
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# No Xen-detect? Boo!!
|
||||
XENDETECT=$(which xen-detect 2>/dev/null)
|
||||
[ -z "$XENDETECT" ] && [ -d "/usr/lib/xen-default" ] && XENDETECT="/usr/lib/xen-default/bin/xen-detect"
|
||||
[ -z "$XENDETECT" ] && exit 1
|
||||
|
||||
. $dracutfunctions
|
||||
[[ $debug ]] && set -x
|
||||
|
||||
# Yes, we are under Xen PV env.
|
||||
$XENDETECT | egrep -q -v 'PV' || exit 0
|
||||
|
||||
exit 1
|
6
modules.d/60xen/install
Executable file
6
modules.d/60xen/install
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
XENDETECT=$(which xen-detect)
|
||||
[ -z "$XENDETECT" ] && [ -d "/usr/lib/xen-default" ] && XENDETECT="/usr/lib/xen-default/bin/xen-detect"
|
||||
inst $XENDETECT /sbin/xen-detect
|
||||
inst_hook pre-udev 40 "$moddir/xen-pre-udev.sh"
|
||||
|
9
modules.d/60xen/installkernel
Normal file
9
modules.d/60xen/installkernel
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
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
|
||||
|
10
modules.d/60xen/xen-pre-udev.sh
Normal file
10
modules.d/60xen/xen-pre-udev.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
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
|
8
modules.d/90btrfs/40-btrfs.rules
Normal file
8
modules.d/90btrfs/40-btrfs.rules
Normal file
@@ -0,0 +1,8 @@
|
||||
SUBSYSTEM!="block", GOTO="btrfs_end"
|
||||
ACTION!="add|change", GOTO="btrfs_end"
|
||||
|
||||
ENV{ID_FS_TYPE}=="btrfs", RUN+="/sbin/modprobe btrfs"
|
||||
ENV{ID_FS_TYPE}=="btrfs", RUN+="/sbin/btrfsctl -A $env{DEVNAME}"
|
||||
|
||||
LABEL="btrfs_end"
|
||||
|
10
modules.d/90btrfs/check
Executable file
10
modules.d/90btrfs/check
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# We depend on udev-rules being loaded
|
||||
[ "$1" = "-d" ] && exit 0
|
||||
|
||||
# if we don't have btrfs (btrfsctl) installed on the host system,
|
||||
# no point in trying to support it in the initramfs.
|
||||
which btrfsctl >/dev/null 2>&1 || exit 1
|
||||
|
||||
exit 0
|
4
modules.d/90btrfs/install
Executable file
4
modules.d/90btrfs/install
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
inst_rules "$moddir/40-btrfs.rules"
|
||||
dracut_install btrfsctl
|
@@ -1,12 +0,0 @@
|
||||
# hacky rules to try to try unlocking dm-crypt devs
|
||||
#
|
||||
# Copyright 2008, Red Hat, Inc.
|
||||
# Jeremy Katz <katzj@redhat.com>
|
||||
|
||||
|
||||
SUBSYSTEM!="block", GOTO="luks_end"
|
||||
ACTION!="add|change", GOTO="luks_end"
|
||||
|
||||
ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/initqueue --onetime /sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"
|
||||
|
||||
LABEL="luks_end"
|
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
# if cryptsetup is not installed, then we cannot support encrypted devices.
|
||||
which cryptsetup >/dev/null 2>&1 || exit 1
|
||||
@@ -6,8 +6,21 @@ which cryptsetup >/dev/null 2>&1 || exit 1
|
||||
# hostonly checking should only return true if root is on a LUKS device
|
||||
# in some way, but I am too lazy to figure out how to do that.
|
||||
# Instead, fail if we do not have a LUKS device in use somewhere.
|
||||
if [ "$1" = "-h" ] ; then
|
||||
blkid | grep -q crypt_LUKS || exit 1
|
||||
fi
|
||||
|
||||
. $dracutfunctions
|
||||
|
||||
is_crypt() { [[ $(get_fs_type /dev/block/$1) = crypto_LUKS ]]; }
|
||||
|
||||
[[ $1 = '-h' ]] && {
|
||||
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" || exit 1
|
||||
else
|
||||
# root is not on a block device, use the shotgun approach
|
||||
blkid | grep -q crypto\?_LUKS || exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
exit 0
|
||||
|
7
modules.d/90crypt/crypt-cleanup.sh
Executable file
7
modules.d/90crypt/crypt-cleanup.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
# close everything which is not busy
|
||||
rm -f /etc/udev/rules.d/70-luks.rules >/dev/null 2>&1
|
||||
|
||||
for i in /dev/mapper/luks-*; do
|
||||
cryptsetup luksClose $i >/dev/null 2>&1
|
||||
done
|
222
modules.d/90crypt/crypt-lib.sh
Normal file
222
modules.d/90crypt/crypt-lib.sh
Normal file
@@ -0,0 +1,222 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
command -v getarg >/dev/null || . /lib/dracut-lib.sh
|
||||
|
||||
# ask_for_password
|
||||
#
|
||||
# Wraps around plymouth ask-for-password and adds fallback to tty password ask
|
||||
# if plymouth is not present.
|
||||
#
|
||||
# --cmd command
|
||||
# Command to execute. Required.
|
||||
# --prompt prompt
|
||||
# Password prompt. Note that function already adds ':' at the end.
|
||||
# Recommended.
|
||||
# --tries n
|
||||
# How many times repeat command on its failure. Default is 3.
|
||||
# --ply-[cmd|prompt|tries]
|
||||
# Command/prompt/tries specific for plymouth password ask only.
|
||||
# --tty-[cmd|prompt|tries]
|
||||
# Command/prompt/tries specific for tty password ask only.
|
||||
# --tty-echo-off
|
||||
# Turn off input echo before tty command is executed and turn on after.
|
||||
# It's useful when password is read from stdin.
|
||||
ask_for_password() {
|
||||
local cmd; local prompt; local tries=3
|
||||
local ply_cmd; local ply_prompt; local ply_tries=3
|
||||
local tty_cmd; local tty_prompt; local tty_tries=3
|
||||
local ret
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--cmd) ply_cmd="$2"; tty_cmd="$2" shift;;
|
||||
--ply-cmd) ply_cmd="$2"; shift;;
|
||||
--tty-cmd) tty_cmd="$2"; shift;;
|
||||
--prompt) ply_prompt="$2"; tty_prompt="$2" shift;;
|
||||
--ply-prompt) ply_prompt="$2"; shift;;
|
||||
--tty-prompt) tty_prompt="$2"; shift;;
|
||||
--tries) ply_tries="$2"; tty_tries="$2"; shift;;
|
||||
--ply-tries) ply_tries="$2"; shift;;
|
||||
--tty-tries) tty_tries="$2"; shift;;
|
||||
--tty-echo-off) tty_echo_off=yes;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
{ flock -s 9;
|
||||
# Prompt for password with plymouth, if installed and running.
|
||||
if [ -x /bin/plymouth ] && /bin/plymouth --ping; then
|
||||
/bin/plymouth ask-for-password \
|
||||
--prompt "$ply_prompt" --number-of-tries=$ply_tries \
|
||||
--command="$ply_cmd"
|
||||
ret=$?
|
||||
else
|
||||
if [ "$tty_echo_off" = yes ]; then
|
||||
stty_orig="$(stty -g)"
|
||||
stty -echo
|
||||
fi
|
||||
|
||||
local i=1
|
||||
while [ $i -le $tty_tries ]; do
|
||||
[ -n "$tty_prompt" ] && \
|
||||
printf "$tty_prompt [$i/$tty_tries]:" >&2
|
||||
eval "$tty_cmd" && ret=0 && break
|
||||
ret=$?
|
||||
i=$(($i+1))
|
||||
[ -n "$tty_prompt" ] && printf '\n' >&2
|
||||
done
|
||||
|
||||
[ "$tty_echo_off" = yes ] && stty $stty_orig
|
||||
fi
|
||||
} 9>/.console_lock
|
||||
|
||||
[ $ret -ne 0 ] && echo "Wrong password" >&2
|
||||
return $ret
|
||||
}
|
||||
|
||||
# Try to mount specified device (by path, by UUID or by label) and check
|
||||
# the path with 'test'.
|
||||
#
|
||||
# example:
|
||||
# test_dev -f LABEL="nice label" /some/file1
|
||||
test_dev() {
|
||||
local test_op=$1; local dev="$2"; local f="$3"
|
||||
local ret=1; local mount_point=$(mkuniqdir /mnt testdev)
|
||||
local path
|
||||
|
||||
[ -n "$dev" -a -n "$*" ] || return 1
|
||||
[ -d "$mount_point" ] || die 'Mount point does not exist!'
|
||||
|
||||
if mount -r "$dev" "$mount_point" >/dev/null 2>&1; then
|
||||
test $test_op "${mount_point}/${f}"
|
||||
ret=$?
|
||||
umount "$mount_point"
|
||||
fi
|
||||
|
||||
rmdir "$mount_point"
|
||||
|
||||
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
|
||||
# expanded to kernel names and then compared. If name of 'dev' is on list of
|
||||
# names of devices matching 'devpattern', the test is positive. 'dev' and
|
||||
# 'devpattern' may be anything which function 'devnames' recognizes.
|
||||
#
|
||||
# If 'devpattern' is empty or '*' then function just returns true.
|
||||
#
|
||||
# Example:
|
||||
# match_dev UUID=123 /dev/dm-1
|
||||
# Returns true if /dev/dm-1 UUID starts with "123".
|
||||
match_dev() {
|
||||
[ -z "$1" -o "$1" = '*' ] && return 0
|
||||
local devlist; local dev
|
||||
|
||||
devlist="$(devnames "$1")" || return 255
|
||||
dev="$(devnames "$2")" || return 255
|
||||
|
||||
strstr "
|
||||
$devlist
|
||||
" "
|
||||
$dev
|
||||
"
|
||||
}
|
||||
|
||||
# getkey keysfile for_dev
|
||||
#
|
||||
# Reads file <keysfile> produced by probe-keydev and looks for first line to
|
||||
# which device <for_dev> matches. The successful result is printed in format
|
||||
# "<keydev>:<keypath>". When nothing found, just false is returned.
|
||||
#
|
||||
# Example:
|
||||
# getkey /tmp/luks.keys /dev/sdb1
|
||||
# May print:
|
||||
# /dev/sdc1:/keys/some.key
|
||||
getkey() {
|
||||
local keys_file="$1"; local for_dev="$2"
|
||||
local luks_dev; local key_dev; local key_path
|
||||
|
||||
[ -z "$keys_file" -o -z "$for_dev" ] && die 'getkey: wrong usage!'
|
||||
[ -f "$keys_file" ] || return 1
|
||||
|
||||
local IFS=:
|
||||
while read luks_dev key_dev key_path; do
|
||||
if match_dev "$luks_dev" "$for_dev"; then
|
||||
echo "${key_dev}:${key_path}"
|
||||
return 0
|
||||
fi
|
||||
done < "$keys_file"
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
# readkey keypath keydev device
|
||||
#
|
||||
# Mounts <keydev>, reads key from file <keypath>, optionally processes it (e.g.
|
||||
# if encrypted with GPG) and prints to standard output which is supposed to be
|
||||
# read by cryptsetup. <device> is just passed to helper function for
|
||||
# informational purpose.
|
||||
readkey() {
|
||||
local keypath="$1"
|
||||
local keydev="$2"
|
||||
local device="$3"
|
||||
|
||||
local mntp=$(mkuniqdir /mnt keydev)
|
||||
mount -r "$keydev" "$mntp" || die 'Mounting rem. dev. failed!'
|
||||
|
||||
case "${keypath##*.}" in
|
||||
gpg)
|
||||
if [ -f /lib/dracut-crypt-gpg-lib.sh ]; then
|
||||
. /lib/dracut-crypt-gpg-lib.sh
|
||||
gpg_decrypt "$mntp" "$keypath" "$keydev" "$device"
|
||||
else
|
||||
die "No GPG support to decrypt '$keypath' on '$keydev'."
|
||||
fi
|
||||
;;
|
||||
*) cat "$mntp/$keypath" ;;
|
||||
esac
|
||||
|
||||
umount "$mntp"
|
||||
rmdir "$mntp"
|
||||
}
|
@@ -1,7 +1,12 @@
|
||||
#!/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
|
||||
NEWROOT=${NEWROOT:-"/sysroot"}
|
||||
|
||||
# do not ask, if we already have root
|
||||
[ -f /sysroot/proc ] && exit 0
|
||||
[ -f $NEWROOT/proc ] && exit 0
|
||||
|
||||
# check if destination already exists
|
||||
[ -b /dev/mapper/$2 ] && exit 0
|
||||
@@ -9,28 +14,109 @@
|
||||
# we already asked for this device
|
||||
[ -f /tmp/cryptroot-asked-$2 ] && exit 0
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
LUKS=$(getargs rd_LUKS_UUID=)
|
||||
ask=1
|
||||
# load dm_crypt if it is not already loaded
|
||||
[ -d /sys/module/dm_crypt ] || modprobe dm_crypt
|
||||
|
||||
if [ -n "$LUKS" ]; then
|
||||
ask=0
|
||||
for luks in $LUKS; do
|
||||
if [ "${2##$luks}" != "$2" ]; then
|
||||
ask=1
|
||||
fi
|
||||
. /lib/dracut-crypt-lib.sh
|
||||
|
||||
# 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")"
|
||||
else
|
||||
device="$1"
|
||||
fi
|
||||
|
||||
# TODO: improve to support what cmdline does
|
||||
if [ -f /etc/crypttab ] && ! getargs rd_NO_CRYPTTAB; then
|
||||
while read name dev luksfile rest || [ -n "$name" ] ; do
|
||||
# ignore blank lines and comments
|
||||
if [ -z "$name" -o "${name#\#}" != "$name" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# UUID used in crypttab
|
||||
if [ "${dev%%=*}" = "UUID" ]; then
|
||||
if [ "luks-${dev##UUID=}" = "$2" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
|
||||
# path used in crypttab
|
||||
else
|
||||
cdev=$(readlink -f $dev)
|
||||
mdev=$(readlink -f $device)
|
||||
if [ "$cdev" = "$mdev" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done < /etc/crypttab
|
||||
unset name dev rest
|
||||
fi
|
||||
|
||||
#
|
||||
# Open LUKS device
|
||||
#
|
||||
|
||||
info "luksOpen $device $luksname $luksfile"
|
||||
|
||||
if [ -n "$luksfile" -a "$luksfile" != "none" -a -e "$luksfile" ]; then
|
||||
if cryptsetup --key-file "$luksfile" luksOpen "$device" "$luksname"; then
|
||||
ask_passphrase=0
|
||||
fi
|
||||
else
|
||||
while [ -n "$(getarg rd.luks.key)" ]; do
|
||||
if tmp=$(getkey /tmp/luks.keys $device); then
|
||||
keydev="${tmp%%:*}"
|
||||
keypath="${tmp#*:}"
|
||||
else
|
||||
if [ $# -eq 3 ]; then
|
||||
if [ $3 -eq 0 ]; then
|
||||
info "No key found for $device. Fallback to passphrase mode."
|
||||
break
|
||||
fi
|
||||
info "No key found for $device. Will try $3 time(s) more later."
|
||||
set -- "$1" "$2" "$(($3 - 1))"
|
||||
else
|
||||
info "No key found for $device. Will try later."
|
||||
fi
|
||||
initqueue --unique --onetime --settled \
|
||||
--name cryptroot-ask-$luksname \
|
||||
$(command -v cryptroot-ask) "$@"
|
||||
exit 0
|
||||
fi
|
||||
unset tmp
|
||||
|
||||
info "Using '$keypath' on '$keydev'"
|
||||
readkey "$keypath" "$keydev" "$device" \
|
||||
| cryptsetup -d - luksOpen "$device" "$luksname"
|
||||
unset keypath keydev
|
||||
ask_passphrase=0
|
||||
break
|
||||
done
|
||||
fi
|
||||
|
||||
if [ $ask -gt 0 ]; then
|
||||
# flock against other interactive activities
|
||||
{ flock -s 9;
|
||||
echo -n "$1 is password protected "
|
||||
/sbin/cryptsetup luksOpen -T1 $1 $2
|
||||
} 9>/.console.lock
|
||||
if [ $ask_passphrase -ne 0 ]; then
|
||||
luks_open="$(command -v cryptsetup) luksOpen"
|
||||
ask_for_password --ply-tries 5 \
|
||||
--ply-cmd "$luks_open -T1 $device $luksname" \
|
||||
--ply-prompt "Password ($device)" \
|
||||
--tty-tries 1 \
|
||||
--tty-cmd "$luks_open -T5 $device $luksname"
|
||||
unset luks_open
|
||||
fi
|
||||
|
||||
unset device luksname luksfile
|
||||
|
||||
# mark device as asked
|
||||
>> /tmp/cryptroot-asked-$2
|
||||
|
||||
exit 0
|
||||
udevsettle
|
||||
|
||||
exit 0
|
||||
|
@@ -1,5 +1,11 @@
|
||||
#!/bin/bash
|
||||
inst cryptsetup
|
||||
inst_rules "$moddir/70-luks.rules"
|
||||
inst cryptsetup
|
||||
inst rmdir
|
||||
inst readlink
|
||||
inst umount
|
||||
inst "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask
|
||||
inst_hook cmdline 30 "$moddir/parse-crypt.sh"
|
||||
inst_hook pre-pivot 30 "$moddir/crypt-cleanup.sh"
|
||||
inst_hook pre-pivot 31 "$moddir/crypt-cleanup.sh"
|
||||
inst "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh"
|
||||
inst /etc/crypttab
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user