Compare commits
516 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
39c9b67f86 | ||
![]() |
685d8619d0 | ||
![]() |
15d103f911 | ||
![]() |
a63cc421a5 | ||
![]() |
b4cf58f038 | ||
![]() |
a99bbe8fa8 | ||
![]() |
f0bfada399 | ||
![]() |
041e49ee2a | ||
![]() |
811a070d6c | ||
![]() |
5401d1f86f | ||
![]() |
e8dc8c4d89 | ||
![]() |
65960fda7e | ||
![]() |
25895a7769 | ||
![]() |
144a3d85d0 | ||
![]() |
e6390b5a70 | ||
![]() |
c1cec35469 | ||
![]() |
8078a9c8ea | ||
![]() |
2931eaa800 | ||
![]() |
1f1aa43573 | ||
![]() |
1dd68c2f23 | ||
![]() |
1d75490767 | ||
![]() |
ca6be905f0 | ||
![]() |
67ae4f20b8 | ||
![]() |
b2f751db04 | ||
![]() |
6eb80b3278 | ||
![]() |
a1ba30cf4f | ||
![]() |
0042f2568d | ||
![]() |
b0d6254dad | ||
![]() |
f3f37f3cce | ||
![]() |
9ae7ed1a1d | ||
![]() |
e1171941c2 | ||
![]() |
1fc68b989d | ||
![]() |
917e1b6b5b | ||
![]() |
eec49634d4 | ||
![]() |
bd4aa25741 | ||
![]() |
7a44fea98c | ||
![]() |
53475faa81 | ||
![]() |
6a6c09e33c | ||
![]() |
4efe015bfb | ||
![]() |
3c6337f68e | ||
![]() |
f1b65e92af | ||
![]() |
ea28824027 | ||
![]() |
d13071d7a6 | ||
![]() |
196bb03477 | ||
![]() |
285495814b | ||
![]() |
fd79054610 | ||
![]() |
73fb5e769b | ||
![]() |
37a2343509 | ||
![]() |
0c5e5f271b | ||
![]() |
e752d42de9 | ||
![]() |
6ed73e37f2 | ||
![]() |
f1c790495b | ||
![]() |
4693daa5fa | ||
![]() |
7c29d205f4 | ||
![]() |
35bf607087 | ||
![]() |
d8a01fea33 | ||
![]() |
a9f04fcc4a | ||
![]() |
4e669086a3 | ||
![]() |
bdd626059c | ||
![]() |
043d8f401b | ||
![]() |
05c2080e51 | ||
![]() |
e7838a8312 | ||
![]() |
dec4b2cdd4 | ||
![]() |
2bd8b227de | ||
![]() |
2949dcba29 | ||
![]() |
0cf826a11a | ||
![]() |
a1595cf5f9 | ||
![]() |
6aec6a7e2f | ||
![]() |
647b521fc7 | ||
![]() |
076fcd1652 | ||
![]() |
83a6d6f928 | ||
![]() |
8a32bf6107 | ||
![]() |
1d832b4bf4 | ||
![]() |
5ebf48d2ba | ||
![]() |
be5025bf55 | ||
![]() |
7e51a94f5b | ||
![]() |
73b9eaab1d | ||
![]() |
f13278eac2 | ||
![]() |
5c57209ba5 | ||
![]() |
2870b7d243 | ||
![]() |
33a5586cae | ||
![]() |
ffc2ca202b | ||
![]() |
a6229a8f9a | ||
![]() |
727e2a1d9d | ||
![]() |
0676c1e0d0 | ||
![]() |
b2f6409a22 | ||
![]() |
39c725dc4e | ||
![]() |
85c8217db0 | ||
![]() |
f2c423651b | ||
![]() |
a35fab2cf1 | ||
![]() |
4a739be99c | ||
![]() |
d4793cdbdb | ||
![]() |
32f5af2f5e | ||
![]() |
01030beda2 | ||
![]() |
7a5949ffcd | ||
![]() |
52c295c161 | ||
![]() |
34986d538a | ||
![]() |
e69da98de1 | ||
![]() |
7957bd01b0 | ||
![]() |
9ffab3f3a5 | ||
![]() |
cc81672cef | ||
![]() |
aa6885fbaf | ||
![]() |
beaddf6881 | ||
![]() |
dfb3db3dad | ||
![]() |
43adba3a71 | ||
![]() |
e63ac4433a | ||
![]() |
d941f0e015 | ||
![]() |
f81806db20 | ||
![]() |
f0c9ae4d36 | ||
![]() |
e35d1451f5 | ||
![]() |
eac751f1e0 | ||
![]() |
e80ac43710 | ||
![]() |
b1a39dbcc2 | ||
![]() |
0eb7a7c479 | ||
![]() |
924a669a1b | ||
![]() |
6ee83a0bd1 | ||
![]() |
93d7b95ad4 | ||
![]() |
caa6d12fd7 | ||
![]() |
ffcbde7fe2 | ||
![]() |
44766d1f1f | ||
![]() |
86f0904004 | ||
![]() |
e22e04ae15 | ||
![]() |
2811e4ed22 | ||
![]() |
5d274f9365 | ||
![]() |
4dbb4dc5bc | ||
![]() |
597b159248 | ||
![]() |
0db98910a1 | ||
![]() |
a5b2d8fe74 | ||
![]() |
69395a528a | ||
![]() |
ca31a7e368 | ||
![]() |
e7f52635d9 | ||
![]() |
2afd60baa6 | ||
![]() |
bd98b88447 | ||
![]() |
ec44ed1d9d | ||
![]() |
61c761bc2c | ||
![]() |
b8278a99ab | ||
![]() |
7e8f8ddbf8 | ||
![]() |
4a7b55ee7e | ||
![]() |
ddfcfdf199 | ||
![]() |
fc44fdb5ac | ||
![]() |
b08ad7f7d8 | ||
![]() |
b29901c083 | ||
![]() |
a69d137338 | ||
![]() |
479b5cd94f | ||
![]() |
de7ab164dd | ||
![]() |
bb47ec5499 | ||
![]() |
3966a1e1ee | ||
![]() |
d8c75b5f38 | ||
![]() |
a1ea214a87 | ||
![]() |
1d9d43713d | ||
![]() |
b37b141ecc | ||
![]() |
223547feab | ||
![]() |
3568d947db | ||
![]() |
ff6077789e | ||
![]() |
bafc82e732 | ||
![]() |
8205c25ef9 | ||
![]() |
fea9be7ac1 | ||
![]() |
c85034c91f | ||
![]() |
d7c9ad504e | ||
![]() |
00ca15abbf | ||
![]() |
dba974844e | ||
![]() |
a84c391b87 | ||
![]() |
86eb0b1b83 | ||
![]() |
69c6435acd | ||
![]() |
b05cd20695 | ||
![]() |
1090a8826a | ||
![]() |
1a7b71bb14 | ||
![]() |
5db79ae414 | ||
![]() |
f367b73852 | ||
![]() |
f47090f918 | ||
![]() |
e168eeef67 | ||
![]() |
c7c8c4981a | ||
![]() |
1de836c763 | ||
![]() |
242c03d6fb | ||
![]() |
88f9d6140d | ||
![]() |
740c46c022 | ||
![]() |
73db316ef2 | ||
![]() |
38b9558333 | ||
![]() |
1c132d39a6 | ||
![]() |
c45e856a65 | ||
![]() |
9264b0cba6 | ||
![]() |
aaaf035aed | ||
![]() |
9853791d37 | ||
![]() |
5a3773dbe6 | ||
![]() |
24113c3a11 | ||
![]() |
34a42f9f49 | ||
![]() |
5d4aaaa2a3 | ||
![]() |
828257dd82 | ||
![]() |
f8ff380bd5 | ||
![]() |
b1ec9d737f | ||
![]() |
5d013e5e3c | ||
![]() |
88d8ad663f | ||
![]() |
4af4fe4a69 | ||
![]() |
9f521f76a0 | ||
![]() |
3889234f71 | ||
![]() |
c98d1756f7 | ||
![]() |
b039b20ec2 | ||
![]() |
f8242a6a60 | ||
![]() |
f6fa9ef101 | ||
![]() |
7e51abc81f | ||
![]() |
c000a21c25 | ||
![]() |
8261d2367e | ||
![]() |
18729719a7 | ||
![]() |
36867f1abf | ||
![]() |
0092942531 | ||
![]() |
781f1971c3 | ||
![]() |
3847bd450d | ||
![]() |
8fce2c4d5e | ||
![]() |
9e19c0512d | ||
![]() |
4e882b8090 | ||
![]() |
8e01095755 | ||
![]() |
99b70a787c | ||
![]() |
71867b665c | ||
![]() |
f3355208f9 | ||
![]() |
2602a74edf | ||
![]() |
55b99a0e4c | ||
![]() |
d4efc0aeee | ||
![]() |
1901500187 | ||
![]() |
292548be6e | ||
![]() |
d6145ece6d | ||
![]() |
016613c774 | ||
![]() |
a365b67db0 | ||
![]() |
699414f5a5 | ||
![]() |
ab4cccf2a7 | ||
![]() |
5dea430e08 | ||
![]() |
e4749a35e5 | ||
![]() |
ae753baec0 | ||
![]() |
7b79d63fa4 | ||
![]() |
bb44294b62 | ||
![]() |
4fa5c235a7 | ||
![]() |
cf376023e6 | ||
![]() |
5f91ed0b53 | ||
![]() |
bf75218e45 | ||
![]() |
fe83231e30 | ||
![]() |
3f60444ec1 | ||
![]() |
eab32bda80 | ||
![]() |
fa295f0bcd | ||
![]() |
0297fdcb3e | ||
![]() |
9d74747f92 | ||
![]() |
74e2d1e69f | ||
![]() |
ad438af207 | ||
![]() |
f3f019d947 | ||
![]() |
2db14045c1 | ||
![]() |
db7d61cff7 | ||
![]() |
b99e72427b | ||
![]() |
6fcd5c8e3b | ||
![]() |
b14b039e90 | ||
![]() |
7ef36aef28 | ||
![]() |
9bb030c5d8 | ||
![]() |
fe6e0c23ad | ||
![]() |
8d9ab2755d | ||
![]() |
607fec3e79 | ||
![]() |
794b2d2c75 | ||
![]() |
ff8f702689 | ||
![]() |
98fd06934c | ||
![]() |
374ef3ed2b | ||
![]() |
f7f5b82b43 | ||
![]() |
c395993eaf | ||
![]() |
06a1d07690 | ||
![]() |
bcabe0fe25 | ||
![]() |
dec3dfa4b3 | ||
![]() |
9430ae301e | ||
![]() |
97bbba6938 | ||
![]() |
e343c85763 | ||
![]() |
3aac682744 | ||
![]() |
89da227de9 | ||
![]() |
472928ec3d | ||
![]() |
b127294def | ||
![]() |
556ff7c76a | ||
![]() |
cb6d49bc9d | ||
![]() |
caf12d6717 | ||
![]() |
fe6455a6e8 | ||
![]() |
4d3e54e01a | ||
![]() |
6a97d2fc89 | ||
![]() |
4ab6447c2a | ||
![]() |
eddca3c9c2 | ||
![]() |
6bc2096cf5 | ||
![]() |
b4dd861a0b | ||
![]() |
f4f8fb5c10 | ||
![]() |
43819af68c | ||
![]() |
9542f2fee4 | ||
![]() |
bb1b924792 | ||
![]() |
24a78b2697 | ||
![]() |
918fbfcf6b | ||
![]() |
28058a2e37 | ||
![]() |
2fd8588da5 | ||
![]() |
efbc47b8e4 | ||
![]() |
b019952f6d | ||
![]() |
0a7d7f6310 | ||
![]() |
60928f36b6 | ||
![]() |
e93ff1cf9a | ||
![]() |
3f5e60bfc9 | ||
![]() |
07149fe6be | ||
![]() |
c41df7e1db | ||
![]() |
b8bccd398a | ||
![]() |
b830a31331 | ||
![]() |
b070c1d360 | ||
![]() |
df95b1003c | ||
![]() |
efd3a6db74 | ||
![]() |
4bcd41389c | ||
![]() |
8d26b5661e | ||
![]() |
ce9a398771 | ||
![]() |
54e09dfb72 | ||
![]() |
88ba9372be | ||
![]() |
5d8d0ac814 | ||
![]() |
6ed1d9fd07 | ||
![]() |
6612ae0d36 | ||
![]() |
616fdae3cf | ||
![]() |
eb242ada05 | ||
![]() |
4916bf1a58 | ||
![]() |
319867faa8 | ||
![]() |
87e90d7f4a | ||
![]() |
2249e7312e | ||
![]() |
62c00a8896 | ||
![]() |
1a2290ea79 | ||
![]() |
03de49609c | ||
![]() |
e330912be5 | ||
![]() |
33a4198e17 | ||
![]() |
8b5ee88ff6 | ||
![]() |
2bcf4ffe5f | ||
![]() |
a455ad1c27 | ||
![]() |
c44d2252bb | ||
![]() |
90ac2d2429 | ||
![]() |
27d7936f0e | ||
![]() |
2da041d672 | ||
![]() |
63a44c8dc3 | ||
![]() |
602dce9ff2 | ||
![]() |
456f299ab8 | ||
![]() |
7527b90c88 | ||
![]() |
07a081f352 | ||
![]() |
6870007674 | ||
![]() |
d6dfde7830 | ||
![]() |
946722e465 | ||
![]() |
a95a727fdc | ||
![]() |
927d1e28c9 | ||
![]() |
74c9fb947b | ||
![]() |
edbd9ca058 | ||
![]() |
dcc2a4344b | ||
![]() |
ed92ecaa3c | ||
![]() |
98e9db2755 | ||
![]() |
4a6c14f987 | ||
![]() |
561eb42f39 | ||
![]() |
10f8df1bdf | ||
![]() |
35a666d02a | ||
![]() |
5b43377d74 | ||
![]() |
ecdee70c48 | ||
![]() |
b44156c6fc | ||
![]() |
a49c1f049b | ||
![]() |
efba549a26 | ||
![]() |
79cb273dc0 | ||
![]() |
583fb23199 | ||
![]() |
b73e00aff7 | ||
![]() |
b5363e834a | ||
![]() |
19b0065cac | ||
![]() |
df087c45d8 | ||
![]() |
5d90ba4fca | ||
![]() |
e847a78bb6 | ||
![]() |
73833796b4 | ||
![]() |
e803d076f8 | ||
![]() |
7d47178e0d | ||
![]() |
6cfdb5aa1f | ||
![]() |
29b885b46e | ||
![]() |
42b4fc90f2 | ||
![]() |
b519ae7008 | ||
![]() |
195b5d0725 | ||
![]() |
686f9675df | ||
![]() |
26fbe97bbe | ||
![]() |
744c65939b | ||
![]() |
3632be079b | ||
![]() |
782e909eef | ||
![]() |
27a5aecf56 | ||
![]() |
5193198dc9 | ||
![]() |
c606be49d7 | ||
![]() |
f939cffdac | ||
![]() |
a283636b83 | ||
![]() |
4483fff87c | ||
![]() |
c04a321b92 | ||
![]() |
4a88aaff10 | ||
![]() |
dd8d161afe | ||
![]() |
0c004c8e64 | ||
![]() |
9ab5ddf16a | ||
![]() |
93b9885a65 | ||
![]() |
db7d739818 | ||
![]() |
bcbcacb5d6 | ||
![]() |
0a10d7fc51 | ||
![]() |
f5753e1861 | ||
![]() |
9af753c468 | ||
![]() |
20486a16e9 | ||
![]() |
848edf22f0 | ||
![]() |
3913d061c4 | ||
![]() |
cca313fa75 | ||
![]() |
9a5bd6804a | ||
![]() |
4891d9a2ce | ||
![]() |
2448fbf17b | ||
![]() |
6138a45dd2 | ||
![]() |
7391fef29a | ||
![]() |
01430d27d4 | ||
![]() |
ab57132aa5 | ||
![]() |
6251f82c6f | ||
![]() |
3e1c531b4e | ||
![]() |
64c34f3459 | ||
![]() |
2cc5e92e21 | ||
![]() |
875426f2fc | ||
![]() |
53a7384653 | ||
![]() |
c97209fe69 | ||
![]() |
9befacf0c5 | ||
![]() |
8019e0eef3 | ||
![]() |
3177d12d2b | ||
![]() |
fac92cfbad | ||
![]() |
5593ee7172 | ||
![]() |
fc146519f9 | ||
![]() |
87894441c7 | ||
![]() |
49c9d8174f | ||
![]() |
97be933592 | ||
![]() |
8e1c4b354c | ||
![]() |
0d5c02d3ab | ||
![]() |
4cca17eeec | ||
![]() |
eb150a4fee | ||
![]() |
3ce142861d | ||
![]() |
0ea86cb727 | ||
![]() |
9d2a3f80cf | ||
![]() |
10d03bbfbc | ||
![]() |
820f81016a | ||
![]() |
eed08b6988 | ||
![]() |
a9caf07fb3 | ||
![]() |
fc212358da | ||
![]() |
0888cf51ab | ||
![]() |
5cb1e0efea | ||
![]() |
ea877ac6cc | ||
![]() |
5816375273 | ||
![]() |
419105df27 | ||
![]() |
aa169b3bd3 | ||
![]() |
378ed5ecc1 | ||
![]() |
9918afd244 | ||
![]() |
e0a5dec4a4 | ||
![]() |
110858025a | ||
![]() |
0a66b74b51 | ||
![]() |
6802cf2349 | ||
![]() |
feb8dc685d | ||
![]() |
69171aa8fa | ||
![]() |
c22c43f81a | ||
![]() |
52b91b6698 | ||
![]() |
d94050ddae | ||
![]() |
f41720c311 | ||
![]() |
8ba684be1c | ||
![]() |
50e86bf02b | ||
![]() |
4e9ba952bf | ||
![]() |
b1b704bd67 | ||
![]() |
01b23b6900 | ||
![]() |
3c00189988 | ||
![]() |
e6a2555c7d | ||
![]() |
4f50a9bfb1 | ||
![]() |
41ac16b26f | ||
![]() |
396d3cc7ff | ||
![]() |
b05ad85b0c | ||
![]() |
4135eea634 | ||
![]() |
96d694c0b5 | ||
![]() |
da5304aabc | ||
![]() |
cce34acace | ||
![]() |
607ff8204b | ||
![]() |
2082cdf230 | ||
![]() |
c1c96f2c47 | ||
![]() |
693b7a3283 | ||
![]() |
7eeaa4ab14 | ||
![]() |
f4d64d55ea | ||
![]() |
ff55a8939c | ||
![]() |
e50f91e600 | ||
![]() |
7f2ea02b4a | ||
![]() |
24f32511fc | ||
![]() |
5899f2f516 | ||
![]() |
e47907cc6b | ||
![]() |
968280e370 | ||
![]() |
8c7dc032f8 | ||
![]() |
df0bdd5ae9 | ||
![]() |
ee44f62972 | ||
![]() |
e8f19bcf26 | ||
![]() |
cb0913db0d | ||
![]() |
32de4eb5d3 | ||
![]() |
3721635b2c | ||
![]() |
694725abf0 | ||
![]() |
e833e26137 | ||
![]() |
5a66d51102 | ||
![]() |
1cadc26fd4 | ||
![]() |
78362bc5fe | ||
![]() |
7ecb36aef4 | ||
![]() |
3fa31c3a47 | ||
![]() |
9ee2f1e235 | ||
![]() |
e860ef0e30 | ||
![]() |
6c9484f614 | ||
![]() |
162daf0c97 | ||
![]() |
01e60ca4f6 | ||
![]() |
b8efaa0017 | ||
![]() |
6318baa45f | ||
![]() |
3d579309cd | ||
![]() |
f621aeba65 | ||
![]() |
59815841e9 | ||
![]() |
77403e0032 | ||
![]() |
8d09f493a6 | ||
![]() |
777f2db037 | ||
![]() |
ba665de454 | ||
![]() |
57fb6e67de | ||
![]() |
916559e073 | ||
![]() |
3639fe543c | ||
![]() |
7cca5efdce | ||
![]() |
0f89ec314b | ||
![]() |
cf627b20d0 | ||
![]() |
90ff5ad67e | ||
![]() |
08eca6756f | ||
![]() |
d4b93a092d | ||
![]() |
c42064a684 | ||
![]() |
47ff68e78b | ||
![]() |
ac13778f60 | ||
![]() |
aca93e3364 | ||
![]() |
231b3dd432 | ||
![]() |
70de22e63b | ||
![]() |
80dab03a7d |
@@ -1,3 +1,7 @@
|
||||
((nil . ((setq sh-basic-offset: 4)
|
||||
(setq indent-tabs-mode nil)
|
||||
)))
|
||||
;;; Directory Local Variables
|
||||
;;; For more information see (info "(emacs) Directory Variables")
|
||||
|
||||
((sh-mode
|
||||
(indent-tabs-mode)
|
||||
(sh-basic-offset . 4)))
|
||||
|
||||
|
6
.gitignore
vendored
6
.gitignore
vendored
@@ -6,6 +6,8 @@
|
||||
/dracut-gencmdline.8
|
||||
/dracut.html
|
||||
/dracut.kernel.7
|
||||
/dracut.pc
|
||||
/dracut-install
|
||||
/modules.d/99base/switch_root
|
||||
/test/*/test.log
|
||||
test*.img
|
||||
@@ -15,5 +17,7 @@ test*.img
|
||||
/install/dracut-install
|
||||
/*.rpm
|
||||
/*.[0-9]
|
||||
/modules.d/98systemd/*.service.8
|
||||
/modules.d/98dracut-systemd/*.service.8
|
||||
/*.sign
|
||||
*.o
|
||||
skipcpio/skipcpio
|
||||
|
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "Kate"
|
||||
"name": "Dracut"
|
||||
, "files": [ { "git": 1 } ]
|
||||
, "build": {
|
||||
"directory": "build"
|
||||
"directory": "./"
|
||||
, "build": "make -j $(getconf _NPROCESSORS_ONLN) all"
|
||||
, "clean": "make clean"
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
COMMAND="$1"
|
||||
KERNEL_VERSION="$2"
|
||||
|
@@ -59,16 +59,15 @@ if ! [[ ${BOOT_OPTIONS[*]} ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LOADER_ENTRY="/boot/loader/entries/${MACHINE_ID}-0-rescue.conf"
|
||||
BOOT_DIR="/${MACHINE_ID}/0-rescue"
|
||||
BOOT_ROOT=${BOOT_DIR_ABS%$BOOT_DIR}
|
||||
LOADER_ENTRY="$BOOT_ROOT/loader/entries/${MACHINE_ID}-0-rescue.conf"
|
||||
|
||||
ret=0
|
||||
|
||||
case "$COMMAND" in
|
||||
add)
|
||||
for i in "/boot/loader/entries/${MACHINE_ID}-0-rescue.conf"; do
|
||||
[[ -f $i ]] && exit 0
|
||||
done
|
||||
[[ -f "$LOADER_ENTRY" ]] && exit 0
|
||||
|
||||
# source our config dir
|
||||
for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do
|
||||
|
76
AUTHORS
76
AUTHORS
@@ -4,8 +4,8 @@ Amadeusz Żołnowski <aidecoe@aidecoe.name>
|
||||
Will Woods <wwoods@redhat.com>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
Dave Young <dyoung@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Hannes Reinecke <hare@suse.de>
|
||||
Michal Soltys <soltys@ziu.info>
|
||||
@@ -14,59 +14,78 @@ Amerigo Wang <amwang@redhat.com>
|
||||
Thomas Renninger <trenn@suse.de>
|
||||
WANG Chao <chaowang@redhat.com>
|
||||
Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
Alexander Tsoy <alexander@tsoy.me>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Alexander Tsoy <alexander@tsoy.me>
|
||||
Frederick Grose <fgrose@sugarlabs.org>
|
||||
John Reiser <jreiser@bitwagon.com>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
Peter Robinson <pbrobinson@gmail.com>
|
||||
Ville Skyttä <ville.skytta@iki.fi>
|
||||
Dan Horák <dhorak@redhat.com>
|
||||
Daniel Molkentin <dmolkentin@suse.com>
|
||||
Baoquan He <bhe@redhat.com>
|
||||
Brendan Germain <brendan.germain@nasdaqomx.com>
|
||||
Leho Kraav <leho@kraav.com>
|
||||
Xunlei Pang <xlpang@redhat.com>
|
||||
Colin Walters <walters@verbum.org>
|
||||
Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Fabian Deutsch <fabiand@fedoraproject.org>
|
||||
Kamil Rytarowski <n54@gmx.com>
|
||||
Lukas Nykryn <lnykryn@redhat.com>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
NeilBrown <neilb@suse.de>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Radek Vykydal <rvykydal@redhat.com>
|
||||
Thorsten Behrens <tbehrens@suse.com>
|
||||
Chao Wang <chaowang@redhat.com>
|
||||
Colin Walters <walters@verbum.org>
|
||||
Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Fabian Deutsch <fabiand@fedoraproject.org>
|
||||
Frederic Crozat <fcrozat@suse.com>
|
||||
James Lee <jlee@thestaticvoid.com>
|
||||
Jesse Keating <jkeating@redhat.com>
|
||||
Milan Broz <mbroz@redhat.com>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
Mimi Zohar <zohar@linux.vnet.ibm.com>
|
||||
Roberto Sassu <roberto.sassu@polito.it>
|
||||
Stefan Reimer <it@startux.de>
|
||||
Anton Blanchard <anton@samba.org>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Chapman Flack <g2@anastigmatix.net>
|
||||
Chris Leech <cleech@redhat.com>
|
||||
David Cantrell <dcantrell@redhat.com>
|
||||
Dennis Gilmore <dennis@ausil.us>
|
||||
Jan Synacek <jsynacek@redhat.com>
|
||||
Jon Ander Hernandez <jonan.h@gmail.com>
|
||||
Juan RP <xtraeme@gmail.com>
|
||||
Lance Albertson <lance@osuosl.org>
|
||||
Lidong Zhong <lzhong@suse.com>
|
||||
Marian Ganisin <mganisin@redhat.com>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Peter Robinson <pbrobinson@gmail.com>
|
||||
Stefan Reimer <it@startux.de>
|
||||
Mike Gilbert <floppym@gentoo.org>
|
||||
Pratyush Anand <panand@redhat.com>
|
||||
Silvio Fricke <silvio.fricke@gmail.com>
|
||||
Stig Telfer <stelfer@cray.com>
|
||||
Vasiliy Tolstov <v.tolstov@selfip.ru>
|
||||
Ville Skyttä <ville.skytta@iki.fi>
|
||||
Wim Muskee <wimmuskee@gmail.com>
|
||||
yuwata <watanabe.yu+github@gmail.com>
|
||||
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
||||
Alan Pevec <apevec@redhat.com>
|
||||
Alex Harpin <development@landsofshadow.co.uk>
|
||||
Antony Messerli <amesserl@rackspace.com>
|
||||
Chao Fan <cfan@redhat.com>
|
||||
Daniel Kahn Gillmor <dkg@fifthhorseman.net>
|
||||
Daniel Schaal <farbing@web.de>
|
||||
Denis Silakov <dsilakov@virtuozzo.com>
|
||||
Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
|
||||
Erwan Velu <erwan.velu@enovance.com>
|
||||
Frederick Grose <fgrose@sugarlabs.org>
|
||||
Evgeny Vereshchagin <evvers@ya.ru>
|
||||
Fabian Vogt <fvogt@suse.com>
|
||||
Guido Trentalancia <guido@trentalancia.net>
|
||||
Hari Bathini <hbathini@linux.vnet.ibm.com>
|
||||
Ian Dall <ian@beware.dropbear.id.au>
|
||||
James Buren <ryuo@frugalware.org>
|
||||
Jan Synacek <jsynacek@redhat.com>
|
||||
Joey Boggs <jboggs@redhat.com>
|
||||
Koen Kooi <koen@dominion.thruhere.net>
|
||||
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
@@ -75,32 +94,44 @@ Lubomir Rintel <lkundrak@v3.sk>
|
||||
Lukas Wunner <lukas@wunner.de>
|
||||
Mike Snitzer <snitzer@redhat.com>
|
||||
Minfei Huang <mhuang@redhat.com>
|
||||
Moritz Maxeiner <moritz@ucworks.org>
|
||||
Przemysław Rudy <prudy1@o2.pl>
|
||||
Stefan Berger <stefanb@us.ibm.com>
|
||||
Thomas Backlund <tmb@mageia.org>
|
||||
Thomas Lange <lange@informatik.uni-koeln.de>
|
||||
Till Maas <opensource@till.name>
|
||||
Vivek Goyal <vgoyal@redhat.com>
|
||||
Vladislav Bogdanov <bubble@hoster-ok.com>
|
||||
Yu Watanabe <watanabe.yu+github@gmail.com>
|
||||
pallotron <pallotron@fb.com>
|
||||
Adam Williamson <awilliam@redhat.com>
|
||||
Alexander Kurtz <alexander@kurtz.be>
|
||||
Alexander Todorov <atodorov@redhat.com>
|
||||
Andreas Stieger <astieger@suse.com>
|
||||
Andrei Borzenkov <arvidjaar@gmail.com>
|
||||
Andy Lutomirski <luto@mit.edu>
|
||||
Anssi Hannula <anssi@mageia.org>
|
||||
Antony Messerli <amesserl@rackspace.com>
|
||||
Brandon Philips <brandon@ifup.co>
|
||||
Canek Peláez Valdés <caneko@gmail.com>
|
||||
Chao Fan <cfan@redhat.com>
|
||||
Chris Leech <cleech@redhat.com>
|
||||
Chad Dupuis <chad.dupuis@cavium.com>
|
||||
Christian Heinz <christian.ch.heinz@gmail.com>
|
||||
Christian Rodrigues <crrodriguez@opensuse.org>
|
||||
Cong Wang <amwang@redhat.com>
|
||||
Dan Fuhry <dfuhry@datto.com>
|
||||
Daniel Drake <drake@endlessm.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
David Disseldorp <ddiss@suse.de>
|
||||
David Michael <david.michael@coreos.com>
|
||||
Dennis Schridde <devurandom@gmx.net>
|
||||
Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
|
||||
Duane Griffin <duaneg@dghda.com>
|
||||
Elan Ruusamäe <glen@delfi.ee>
|
||||
Fabian <fvogt@suse.com>
|
||||
Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
|
||||
Gerd von Egidy <gerd.von.egidy@intra2net.com>
|
||||
Glen Gray <slaine@slaine.org>
|
||||
HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
|
||||
Hermann Gausterer <git-dracut-2012@mrq1.org>
|
||||
Imran Haider <imran1008@gmail.com>
|
||||
James Laska <jlaska@redhat.com>
|
||||
Jan Stodola <jstodola@redhat.com>
|
||||
Jiri Pirko <jiri@resnulli.us>
|
||||
@@ -110,12 +141,16 @@ Julian Wolf <juwolf@suse.com>
|
||||
Kevin Yung <Kevin.Yung@myob.com>
|
||||
Lars R. Damerow <lars@pixar.com>
|
||||
Lennert Buytenhek <buytenh@wantstofly.org>
|
||||
Lukas Nykryn <lnykryn@redhat.com>
|
||||
Lidong Zhong <lidong.zhong@suse.com>
|
||||
Major Hayden <major@mhtx.net>
|
||||
Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
|
||||
Marian Csontos <mcsontos@redhat.com>
|
||||
Marko Myllynen <myllynen@redhat.com>
|
||||
Martin Wilck <mwilck@suse.com>
|
||||
Matt <smoothsailing72@hotmail.com>
|
||||
Matt Smith <shadowfax@gmx.com>
|
||||
Mei Liu <liumbj@linux.vnet.ibm.com>
|
||||
Michael Chapman <mike@very.puzzling.org>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Mike Gorse <mgorse@suse.com>
|
||||
Moritz 'Morty' Strübe <morty@gmx.net>
|
||||
@@ -125,23 +160,32 @@ Nikoli <nikoli@lavabit.com>
|
||||
Olivier Blin <dev@blino.org>
|
||||
P J P <ppandit@redhat.com>
|
||||
Paolo Bonzini <pbonzini@redhat.com>
|
||||
Pekka Wallendahl <wyrmiyu@gmail.com>
|
||||
Peter Robinson <pbrobinson@fedoraproject.org>
|
||||
Praveen_Paladugu@Dell.com <Praveen_Paladugu@Dell.com>
|
||||
Pádraig Brady <P@draigBrady.com>
|
||||
Quentin Armitage <quentin@armitage.org.uk>
|
||||
Robert Buchholz <rbu@goodpoint.de>
|
||||
Ruben Kerkhof <ruben@rubenkerkhof.com>
|
||||
Rusty Bird <rustybird@openmailbox.org>
|
||||
Sergey Fionov <fionov@gmail.com>
|
||||
Shawn W Dunn <sfalken@opensuse.org>
|
||||
Srinivasa T N <seenutn@linux.vnet.ibm.com>
|
||||
Stijn Hoop <stijn@sandcat.nl>
|
||||
Thilo Bangert <thilo.bangert@gmx.net>
|
||||
Tobias Geerinckx <tobias.geerinckx@gmail.com>
|
||||
Tom Gundersen <teg@jklm.no>
|
||||
Tomasz Torcz <tomek@pipebreaker.pl>
|
||||
Tong Li <tonli@redhat.com>
|
||||
Vadim Kuznetsov <vadimk@gentoo.org>
|
||||
Vaughan Cao <vaughan.cao@oracle.com>
|
||||
Vratislav Podzimek <vpodzime@redhat.com>
|
||||
Xunlei Pang <xpang@redhat.com>
|
||||
Yanko Kaneti <yaneti@declera.com>
|
||||
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
|
||||
Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
|
||||
honza801 <honza801@gmail.com>
|
||||
jloeser <jloeser@suse.de>
|
||||
maximilian attems <max@stro.at>
|
||||
tpg <tpgxyz@gmail.com>
|
||||
xtraeme <xtraeme@voidlinux.eu>
|
||||
|
28
Makefile
28
Makefile
@@ -1,7 +1,7 @@
|
||||
-include dracut-version.sh
|
||||
|
||||
VERSION = $(shell [ -d .git ] && git describe --abbrev=0 --tags 2>/dev/null || echo $(DRACUT_VERSION))
|
||||
GITVERSION = $(shell [ -d .git ] && { v=$$(git describe --tags 2>/dev/null); [ $${v\#*-} != $$v ] && echo -$${v\#*-}; } )
|
||||
VERSION ?= $(shell [ -d .git ] && git describe --abbrev=0 --tags 2>/dev/null || echo $(DRACUT_VERSION))
|
||||
GITVERSION ?= $(shell [ -d .git ] && { v=$$(git describe --tags 2>/dev/null); [ -n "$$v" ] && [ $${v\#*-} != $$v ] && echo -$${v\#*-}; } )
|
||||
|
||||
-include Makefile.inc
|
||||
|
||||
@@ -12,7 +12,7 @@ pkglibdir ?= ${libdir}/dracut
|
||||
sysconfdir ?= ${prefix}/etc
|
||||
bindir ?= ${prefix}/bin
|
||||
mandir ?= ${prefix}/share/man
|
||||
CFLAGS ?= -O2 -g -Wall
|
||||
CFLAGS ?= -O2 -g -Wall $(KMOD_CFLAGS)
|
||||
CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
|
||||
bashcompletiondir ?= ${datadir}/bash-completion/completions
|
||||
pkgconfigdatadir ?= $(datadir)/pkgconfig
|
||||
@@ -61,6 +61,7 @@ install/util.o: install/util.c install/util.h install/macro.h install/log.h
|
||||
install/strv.o: install/strv.c install/strv.h install/util.h install/macro.h install/log.h
|
||||
|
||||
install/dracut-install: $(DRACUT_INSTALL_OBJECTS)
|
||||
$(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) $(KMOD_LIBS)
|
||||
|
||||
dracut-install: install/dracut-install
|
||||
ln -fs $< $@
|
||||
@@ -82,20 +83,24 @@ all: doc
|
||||
endif
|
||||
|
||||
%: %.xml
|
||||
xsltproc -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
|
||||
@rm -f -- "$@"
|
||||
xsltproc -o "$@" -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
|
||||
|
||||
%.xml: %.asc
|
||||
asciidoc -d manpage -b docbook -o $@ $<
|
||||
@rm -f -- "$@"
|
||||
asciidoc -d manpage -b docbook -o "$@" $<
|
||||
|
||||
dracut.8: dracut.usage.asc dracut.8.asc
|
||||
|
||||
dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
|
||||
@rm -f -- dracut.xml
|
||||
asciidoc -a numbered -d book -b docbook -o dracut.xml dracut.asc
|
||||
@rm -f -- dracut.html
|
||||
xsltproc -o dracut.html --xinclude -nonet \
|
||||
--stringparam custom.css.source dracut.css \
|
||||
--stringparam generate.css.header 1 \
|
||||
http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl dracut.xml
|
||||
rm -f -- dracut.xml
|
||||
@rm -f -- dracut.xml
|
||||
|
||||
dracut.pc: Makefile.inc Makefile
|
||||
@echo "Name: dracut" > dracut.pc
|
||||
@@ -118,6 +123,7 @@ install: all
|
||||
install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d
|
||||
mkdir -p $(DESTDIR)$(pkglibdir)/dracut.conf.d
|
||||
install -m 0755 dracut-init.sh $(DESTDIR)$(pkglibdir)/dracut-init.sh
|
||||
install -m 0755 dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions.sh
|
||||
install -m 0755 dracut-version.sh $(DESTDIR)$(pkglibdir)/dracut-version.sh
|
||||
ln -fs dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions
|
||||
@@ -168,6 +174,7 @@ endif
|
||||
install -m 0644 dracut.pc $(DESTDIR)${pkgconfigdatadir}/dracut.pc
|
||||
|
||||
dracut-version.sh:
|
||||
@rm -f dracut-version.sh
|
||||
@echo "DRACUT_VERSION=$(VERSION)$(GITVERSION)" > dracut-version.sh
|
||||
|
||||
clean:
|
||||
@@ -204,14 +211,15 @@ rpm: dracut-$(VERSION).tar.xz syncheck
|
||||
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
|
||||
--define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \
|
||||
--define "_rpmdir $$PWD" -ba dracut.spec; ) && \
|
||||
( mv "$$rpmbuild"/$$(arch)/*.rpm .; mv "$$rpmbuild"/*.src.rpm .;rm -fr -- "$$rpmbuild"; ls *.rpm )
|
||||
( mv "$$rpmbuild"/{,$$(arch)/}*.rpm $(DESTDIR).; rm -fr -- "$$rpmbuild"; ls $(DESTDIR)*.rpm )
|
||||
|
||||
syncheck:
|
||||
@ret=0;for i in dracut-initramfs-restore.sh modules.d/*/*.sh; do \
|
||||
[ "$${i##*/}" = "module-setup.sh" ] && continue; \
|
||||
read line < "$$i"; [ "$${line#*bash*}" != "$$line" ] && continue; \
|
||||
[ $$V ] && echo "posix syntax check: $$i"; bash --posix -n "$$i" ; ret=$$(($$ret+$$?)); \
|
||||
[ $$V ] && echo "checking for [[: $$i"; if grep -Fq '[[ ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains [["; fi \
|
||||
[ $$V ] && echo "checking for [[: $$i"; if grep -Fq '[[ ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains [["; fi; \
|
||||
[ $$V ] && echo "checking for echo -n: $$i"; if grep -Fq 'echo -n ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains echo -n"; fi \
|
||||
done;exit $$ret
|
||||
@ret=0;for i in *.sh mkinitrd-dracut.sh modules.d/*/*.sh \
|
||||
modules.d/*/module-setup.sh; do \
|
||||
@@ -244,6 +252,10 @@ hostimage: all
|
||||
./dracut.sh -H -l -f test-$(shell uname -r).img $(shell uname -r)
|
||||
@echo wrote test-$(shell uname -r).img
|
||||
|
||||
efi: all
|
||||
./dracut.sh --uefi -H -l -f linux-$(shell uname -r).efi $(shell uname -r)
|
||||
@echo wrote linux-$(shell uname -r).efi
|
||||
|
||||
AUTHORS:
|
||||
git shortlog --numbered --summary -e |while read a rest || [ -n "$$rest" ]; do echo $$rest;done > AUTHORS
|
||||
|
||||
|
273
NEWS
273
NEWS
@@ -1,3 +1,276 @@
|
||||
dracut-045
|
||||
==========
|
||||
|
||||
Important: dracut now requires libkmod for the dracut-install binary helper,
|
||||
which nows handles kernel module installing and filtering.
|
||||
|
||||
dracut.sh:
|
||||
- restorecon final image file
|
||||
- fail hard, if we find modules and modules.dep is missing
|
||||
- support --tmpdir as a relative path
|
||||
- add default path for --uefi
|
||||
|
||||
dracut-functions.sh:
|
||||
- fix check_vol_slaves() volume group name stripping
|
||||
|
||||
dracut-install:
|
||||
- catch ldd message "cannot execute binary file"
|
||||
- added kernel module handling with libkmod
|
||||
Added parameters:
|
||||
--module,-m
|
||||
--mod-filter-path, -p
|
||||
--mod-filter-nopath, -P
|
||||
--mod-filter-symbol, -s
|
||||
--mod-filter-nosymbol, -S
|
||||
--mod-filter-noname, -N
|
||||
--silent
|
||||
--kerneldir
|
||||
--firmwaredirs
|
||||
- fallback to non-hostonly mode if lsmod fails
|
||||
|
||||
lsinitrd:
|
||||
- new option "--unpack"
|
||||
- new option "--unpackearly"
|
||||
- and "--verbose"
|
||||
|
||||
general initramfs fixes:
|
||||
- don't remove 99-cmdline-ask on 'hostonly' cleanup
|
||||
- call dracut-cmdline-ask.service, if /etc/cmdline.d/*.conf exists
|
||||
- break at switch_root only for bare rd.break
|
||||
- add rd.emergency=[reboot|poweroff|halt]
|
||||
specifies what action to execute in case of a critical failure
|
||||
- rd.memdebug=4 gives information, about kernel module memory consumption
|
||||
during loading
|
||||
|
||||
dmsquash-live:
|
||||
- fixed livenet-generator execution flag
|
||||
and include only, if systemd is used
|
||||
- fixed dmsquash-live-root.sh for cases where the fstype of the liveimage is squashfs
|
||||
- fixed typo for rootfs.img
|
||||
- enable the use of the OverlayFS for the LiveOS root filesystem
|
||||
Patch notes:
|
||||
Integrate the option to use an OverlayFS as the root filesystem
|
||||
into the 90dmsquash-live module for testing purposes.
|
||||
|
||||
The rd.live.overlay.overlayfs option allows one to request an
|
||||
OverlayFS overlay. If a persistent overlay is detected at the
|
||||
standard LiveOS path, the overlay & type detected will be used.
|
||||
|
||||
Tested primarily with transient, in-RAM overlay boots on vfat-
|
||||
formatted Live USB devices, with persistent overlay directories
|
||||
on ext4-formatted Live USB devices, and with embedded, persistent
|
||||
overlay directories on vfat-formatted devices. (Persistent overlay
|
||||
directories on a vfat-formatted device must be in an embedded
|
||||
filesystem that supports the creation of trusted.* extended
|
||||
attributes, and must provide valid d_type in readdir responses.)
|
||||
|
||||
The rd.live.overlay.readonly option, which allows a persistent
|
||||
overlayfs to be mounted read only through a higher level transient
|
||||
overlay directory, has been implemented through the multiple lower
|
||||
layers feature of OverlayFS.
|
||||
|
||||
The default transient DM overlay size has been adjusted up to 32 GiB.
|
||||
This change supports comparison of transient Device-mapper vs.
|
||||
transient OverlayFS overlay performance. A transient DM overlay
|
||||
is a sparse file in memory, so this setting does not consume more
|
||||
RAM for legacy applications. It does permit a user to use all of
|
||||
the available root filesystem storage, and fails gently when it is
|
||||
consumed, as the available free root filesystem storage on a typical
|
||||
LiveOS build is only a few GiB. Thus, when booted on other-
|
||||
than-small RAM systems, the transient DM overlay should not overflow.
|
||||
|
||||
OverlayFS offers the potential to use all of the available free RAM
|
||||
or all of the available free disc storage (on non-vfat-devices)
|
||||
in its overlay, even beyond the root filesystem available space,
|
||||
because the OverlayFS root filesystem is a union of directories on
|
||||
two different partitions.
|
||||
|
||||
This patch also cleans up some message spew at shutdown, shortens
|
||||
the execution path in a couple of places, and uses persistent
|
||||
DM targets where required.
|
||||
|
||||
dmraid:
|
||||
- added "nowatch" option in udev rule, otherwise udev would reread partitions for raid members
|
||||
- allow booting from degraded MD RAID arrays
|
||||
|
||||
shutdown:
|
||||
- handle readonly /run on shutdown
|
||||
|
||||
kernel-modules:
|
||||
- add all HID drivers, regardless of hostonly mode
|
||||
people swap keyboards sometimes and should be able to enter their disk password
|
||||
- add usb-storage
|
||||
To save the rdsosreport.txt to a USB stick, the usb-storage module is needed.
|
||||
- add xennet
|
||||
- add nvme
|
||||
|
||||
systemd:
|
||||
- add /etc/machine-info
|
||||
- fixed systemd-escape call for names beginning with "-"
|
||||
- install missing drop-in configuration files for
|
||||
/etc/systemd/{journal.conf,system.conf}
|
||||
|
||||
filesystems:
|
||||
- add support to F2FS filesystem (fsck and modules)
|
||||
|
||||
network:
|
||||
- fix carrier detection
|
||||
- correctly set mac address for ip=...:<mtu>:<mac>
|
||||
- fixed vlan, bonding, bridging, team logic
|
||||
call ifup for the slaves and assemble afterwards
|
||||
- add mtu to list of variables to store in override
|
||||
- for rd.neednet=0 a bootdev is not needed anymore
|
||||
- dhclient-script.sh: add classless-static-routes support
|
||||
- support for iBFT IPv6
|
||||
- support macaddr in brackets [] (commit 740c46c0224a187d6b5a42b4aa56e173238884cc)
|
||||
- use arping2, if available
|
||||
- support multiple default gateways from DHCP server
|
||||
- fixup VLAN handling
|
||||
- enhance team support
|
||||
- differ between ipv6 local and global tentative
|
||||
- ipv6: wait for a router advertised route
|
||||
- add 'mtu' parameter for bond options
|
||||
- use 'ip' instead of 'brctl'
|
||||
|
||||
nbd:
|
||||
- add systemd generator
|
||||
- use export names instead of port numbers, because port number based
|
||||
exports are deprecated and were removed.
|
||||
|
||||
fcoe:
|
||||
- no more /dev/shm state copying
|
||||
|
||||
multipath:
|
||||
- check all /dev/mapper devices if they are multipath devices, not only mpath*
|
||||
|
||||
fips:
|
||||
- fixed .hmac installation in FIPS mode
|
||||
|
||||
plymouth:
|
||||
- also trigger the acpi subsystem
|
||||
|
||||
syslog:
|
||||
- add imjournal.so to read systemd journal
|
||||
- move start from udev to initqueue/online
|
||||
|
||||
caps:
|
||||
- make it a non default module
|
||||
|
||||
livenet:
|
||||
- support nfs:// urls in livenet-generator
|
||||
|
||||
nfs:
|
||||
- install all nfs modules non-hostonly
|
||||
|
||||
crypt:
|
||||
- support keyfiles embedded in the initramfs
|
||||
|
||||
testsuite:
|
||||
- add TEST-70-BONDBRIDGETEAMVLAN
|
||||
- make "-cpu host" the default
|
||||
|
||||
dracut-044
|
||||
==========
|
||||
creation:
|
||||
- better udev & systemd dir detection
|
||||
- split dracut-functions.sh in dracut-init.sh and dracut-functions.sh
|
||||
dracut-functions.sh can now be sourced by external tools
|
||||
- detect all btrfs devices needed
|
||||
- added flag file if initqueue is needed
|
||||
- don't overwrite anything, if initramfs image file creation failed
|
||||
- if no compressor is specified, try to find a suitable one
|
||||
- drop scanning kernel config for CONFIG_MICROCODE_*_EARLY
|
||||
- remove "_EARLY" from CONFIG_MICROCODE_* checks
|
||||
- dracut.sh: add command line option for install_i18_all
|
||||
--no-hostonly-i18n -> install_i18n_all=yes
|
||||
--hostonly-i18n -> install_i18n_all=no
|
||||
- --no-reproducible to turn off reproducible mode
|
||||
- dracut-function.sh can now be sourced from outside of dracut
|
||||
- dracut-init.sh contains all functions, which only can be used from
|
||||
within the dracut infrastructure
|
||||
- support --mount with just mountpoint as a parameter
|
||||
- removed action_on_fail support
|
||||
- removed host_modalias concept
|
||||
- do not create microcode, if no firmware is available
|
||||
- skip gpg files in microcode generation
|
||||
|
||||
initramfs:
|
||||
- ensure pre-mount (and resume) run before root fsck
|
||||
- add --online option to initqueue
|
||||
|
||||
qemu:
|
||||
- fixed virtual machine detection
|
||||
|
||||
lvm:
|
||||
- remove all quirk arguments for lvm >= 2.2.221
|
||||
|
||||
dmsquash:
|
||||
- fixup for checkisomd5
|
||||
- increase timeout for checkisomd5
|
||||
- use non-persistent metadata snapshots for transient overlays.
|
||||
- overflow support for persistent snapshot.
|
||||
- use non-persistent metadata snapshots.
|
||||
- avoid an overlay for persistent, uncompressed, read-write live installations.
|
||||
|
||||
multipath:
|
||||
- multipath.conf included in hostonly mode
|
||||
- install all multipath path selector kernel modules
|
||||
|
||||
iSCSI:
|
||||
- use the iBFT initiator name, if found and set
|
||||
- iscsid now present in the initramfs
|
||||
- iscsistart is done with systemd-run asynchrone to do things in
|
||||
paralllel. Also restarted for every new interface which shows up.
|
||||
- If rd.iscsi.waitnet (default) is set, iscsistart is done only
|
||||
after all interfaces are up.
|
||||
- If not all interfaces are up and rd.iscsi.testroute (default) is set,
|
||||
the route to a iscsi target IP is checked and skipped, if there is none.
|
||||
- If all things fail, we issue a "dummy" interface iscsiroot to retry
|
||||
everything in the initqueue/timeout.
|
||||
|
||||
network:
|
||||
- added DHCP RENEW/REBIND
|
||||
- IPv4 DHCP lease time now optional (bootp)
|
||||
- IPv6 nfs parsing
|
||||
- fixed IPv6 route parsing
|
||||
- rd.peerdns=0 parameter to disable DHCP nameserver setting
|
||||
- detect duplicate IPv4 addresses for static addresses
|
||||
- if interfaces are specified with its enx* name, bind the correspondent MAC to the interface name
|
||||
- if multiple "ip=" are present on the kernel command line "rd.neednet=1" is assumed
|
||||
- add options to tweak timeouts
|
||||
rd.net.dhcp.retry=<cnt>
|
||||
If this option is set, dracut will try to connect via dhcp
|
||||
<cnt> times before failing. Default is 1.
|
||||
|
||||
rd.net.timeout.dhcp=<arg>
|
||||
If this option is set, dhclient is called with "-timeout <arg>".
|
||||
|
||||
rd.net.timeout.iflink=<seconds>
|
||||
Wait <seconds> until link shows up. Default is 60 seconds.
|
||||
|
||||
rd.net.timeout.ifup=<seconds>
|
||||
Wait <seconds> until link has state "UP". Default is 20 seconds.
|
||||
|
||||
rd.net.timeout.route=<seconds>
|
||||
Wait <seconds> until route shows up. Default is 20 seconds.
|
||||
|
||||
rd.net.timeout.ipv6dad=<seconds>
|
||||
Wait <seconds> until IPv6 DAD is finished. Default is 50 seconds.
|
||||
|
||||
rd.net.timeout.ipv6auto=<seconds>
|
||||
Wait <seconds> until IPv6 automatic addresses are assigned.
|
||||
Default is 40 seconds.
|
||||
|
||||
rd.net.timeout.carrier=<seconds>
|
||||
Wait <seconds> until carrier is recognized. Default is 5 seconds.
|
||||
|
||||
IMA:
|
||||
- load signed certificates in the IMA keyring, see modules.d/98integrity/README
|
||||
- load EVM public key in the kernel _evm keyring
|
||||
|
||||
FCoE:
|
||||
fcoe: start with fcoemon instead of fipvlan
|
||||
|
||||
dracut-043
|
||||
==========
|
||||
- add missing dmsquash-generator
|
||||
|
21
PKGBUILD
21
PKGBUILD
@@ -1,6 +1,6 @@
|
||||
pkgname=dracut-git
|
||||
pkgver=$(date +%s)
|
||||
pkgrel=$(git log --pretty=format:%h |head -n 1)
|
||||
pkgver=1
|
||||
pkgrel=1
|
||||
pkgdesc="Initramfs generation utility"
|
||||
arch=('i686' 'x86_64')
|
||||
url="https://dracut.wiki.kernel.org/"
|
||||
@@ -14,8 +14,25 @@ backup=(etc/dracut.conf)
|
||||
source=()
|
||||
md5sums=()
|
||||
|
||||
# out of tree builds disallowed for this PKGFILE
|
||||
BUILDDIR="${PWD}"
|
||||
PKGDEST="${PWD}"
|
||||
SRCDEST=""
|
||||
SRCPKGDEST=""
|
||||
LOGDEST=""
|
||||
|
||||
pkgver() {
|
||||
cd ..
|
||||
desc="$(git describe)"
|
||||
printf "%s.%s.%s" ${desc//-/ }
|
||||
}
|
||||
|
||||
build() {
|
||||
cd ..
|
||||
make sysconfdir=/etc || return 1
|
||||
}
|
||||
|
||||
package() {
|
||||
cd ..
|
||||
make DESTDIR="${pkgdir}" sysconfdir=/etc install || return 1
|
||||
}
|
||||
|
24
README
24
README
@@ -1,9 +1,10 @@
|
||||
dracut
|
||||
------
|
||||
dracut is a new initramfs infrastructure.
|
||||
dracut is an event driven initramfs infrastructure.
|
||||
|
||||
Information about the initial goals and aims can be found at
|
||||
https://fedoraproject.org/wiki/Initrdrewrite
|
||||
dracut (the tool) is used to create an initramfs image by copying tools
|
||||
and files from an installed system and combining it with the
|
||||
dracut framework, usually found in /usr/lib/dracut/modules.d.
|
||||
|
||||
Unlike existing initramfs's, this is an attempt at having as little as
|
||||
possible hard-coded into the initramfs as possible. The initramfs has
|
||||
@@ -51,7 +52,7 @@ possible. Every distribution has their own tool here and it's not
|
||||
something which is really interesting to have separate across them.
|
||||
So contributions to help decrease the distro-dependencies are welcome.
|
||||
|
||||
Currently dracut lives on kernel.org.
|
||||
Currently dracut lives on github.com and kernel.org.
|
||||
|
||||
The tarballs can be found here:
|
||||
http://www.kernel.org/pub/linux/utils/boot/dracut/
|
||||
@@ -62,21 +63,14 @@ Git:
|
||||
http://git.kernel.org/pub/scm/boot/dracut/dracut.git
|
||||
https://git.kernel.org/pub/scm/boot/dracut/dracut.git
|
||||
|
||||
git://github.com/haraldh/dracut.git
|
||||
|
||||
git://dracut.git.sourceforge.net/gitroot/dracut/dracut
|
||||
git@github.com:dracutdevs/dracut.git
|
||||
|
||||
Git Web:
|
||||
http://git.kernel.org/?p=boot/dracut/dracut.git
|
||||
https://github.com/dracutdevs/dracut.git
|
||||
|
||||
https://haraldh@github.com/haraldh/dracut.git
|
||||
http://git.kernel.org/?p=boot/dracut/dracut.git
|
||||
|
||||
http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut
|
||||
|
||||
Git Web RSS Feed:
|
||||
http://git.kernel.org/?p=boot/dracut/dracut.git;a=rss
|
||||
|
||||
Project Page:
|
||||
Project Documentation:
|
||||
http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
|
||||
|
||||
Project Wiki:
|
||||
|
6
README.md
Normal file
6
README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# dracut - master branch
|
||||
|
||||
dracut is an initramfs infrastructure.
|
||||
|
||||
CentOS CI: [](https://ci.centos.org/job/dracut-push-master/)
|
||||
|
@@ -1,16 +1,28 @@
|
||||
For the testsuite to work, you will have to install at least the following software packages:
|
||||
dash \
|
||||
bridge-utils \
|
||||
asciidoc \
|
||||
mdadm \
|
||||
lvm2 \
|
||||
dmraid \
|
||||
cryptsetup \
|
||||
nfs-utils \
|
||||
netbsd-iscsi \
|
||||
nbd \
|
||||
dhcp-server \
|
||||
iscsi-initiator-utils
|
||||
|
||||
scsi-target-utils \
|
||||
iscsi-initiator-utils \
|
||||
strace \
|
||||
syslinux \
|
||||
python-imgcreate \
|
||||
genisoimage \
|
||||
btrfs-progs \
|
||||
kmod-devel \
|
||||
gcc \
|
||||
bzip2 \
|
||||
xz \
|
||||
tar \
|
||||
wget \
|
||||
rpm-build \
|
||||
${NULL}
|
||||
|
||||
TEST-04-FULL-SYSTEMD: systemd >= 187
|
||||
|
||||
|
4
TODO
4
TODO
@@ -7,7 +7,6 @@ Items are ordered in priority.
|
||||
INITRAMFS TODO
|
||||
|
||||
- search domain string
|
||||
- peerdns=no
|
||||
- allow dual stack configuration (IPv4, IPv6) for the same interface
|
||||
- "bind-mount" kernel drivers in real root for the rescue image,
|
||||
if the real root does not have any kernel modules for this kernel
|
||||
@@ -19,11 +18,8 @@ INITRAMFS TODO
|
||||
- put mount hook in main initqueue loop / careful about resume!
|
||||
- the hard-coded list of udev rules that we care about is kind of lame.
|
||||
- panic fallback
|
||||
- bridging/bonding without "netroot=" https://bugzilla.redhat.com/show_bug.cgi?id=822750
|
||||
- progress indication for fsck https://bugzilla.redhat.com/show_bug.cgi?id=827118
|
||||
- domain, searchdomain https://bugzilla.redhat.com/show_bug.cgi?id=840778
|
||||
- disable write-ifcfg https://bugzilla.redhat.com/show_bug.cgi?id=840784
|
||||
- check for /var to be mounted in convertfs https://bugzilla.redhat.com/show_bug.cgi?id=848172
|
||||
- probably fix "--include" https://bugzilla.redhat.com/show_bug.cgi?id=849338
|
||||
|
||||
GENERATOR TODO
|
||||
|
9
configure
vendored
9
configure
vendored
@@ -7,6 +7,8 @@ prefix=/usr
|
||||
|
||||
enable_documentation=yes
|
||||
|
||||
PKG_CONFIG="${PKG_CONFIG:-pkg-config}"
|
||||
|
||||
# Little helper function for reading args from the commandline.
|
||||
# it automatically handles -a b and -a=b variants, and returns 1 if
|
||||
# we need to shift $3.
|
||||
@@ -50,6 +52,11 @@ while (($# > 0)); do
|
||||
shift
|
||||
done
|
||||
|
||||
if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 15 "; then
|
||||
echo "dracut needs pkg-config and libkmod >= 15." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat > Makefile.inc.$$ <<EOF
|
||||
prefix ?= ${prefix}
|
||||
libdir ?= ${libdir:-${prefix}/lib}
|
||||
@@ -59,6 +66,8 @@ sbindir ?= ${sbindir:-${prefix}/sbin}
|
||||
mandir ?= ${mandir:-${prefix}/share/man}
|
||||
enable_documentation ?= ${enable_documentation:-yes}
|
||||
bindir ?= ${bindir:-${prefix}/bin}
|
||||
KMOD_CFLAGS ?= $(${PKG_CONFIG} --cflags " libkmod >= 15 ")
|
||||
KMOD_LIBS ?= $(${PKG_CONFIG} --libs " libkmod >= 15 ")
|
||||
EOF
|
||||
|
||||
{
|
||||
|
1220
dracut-functions.sh
1220
dracut-functions.sh
File diff suppressed because it is too large
Load Diff
1020
dracut-init.sh
Normal file
1020
dracut-init.sh
Normal file
File diff suppressed because it is too large
Load Diff
@@ -14,7 +14,7 @@ SKIP="$dracutbasedir/skipcpio"
|
||||
|
||||
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||||
|
||||
mount -o ro /boot &>/dev/null
|
||||
mount -o ro /boot &>/dev/null || true
|
||||
|
||||
if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
|
||||
IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
|
||||
|
@@ -148,8 +148,7 @@ dlog_init() {
|
||||
&& type -P systemd-cat &>/dev/null \
|
||||
&& systemctl --quiet is-active systemd-journald.socket &>/dev/null \
|
||||
&& { echo "dracut-$DRACUT_VERSION" | systemd-cat -t 'dracut' &>/dev/null; } ; then
|
||||
readonly _dlogdir="$(mktemp --tmpdir="$TMPDIR/" -d -t dracut-log.XXXXXX)"
|
||||
readonly _systemdcatfile="$_dlogdir/systemd-cat"
|
||||
readonly _systemdcatfile="$DRACUT_TMPDIR/systemd-cat"
|
||||
mkfifo "$_systemdcatfile"
|
||||
readonly _dlogfd=15
|
||||
systemd-cat -t 'dracut' --level-prefix=true <"$_systemdcatfile" &
|
||||
@@ -264,9 +263,9 @@ _lvl2syspri() {
|
||||
# Conversion is done as follows:
|
||||
#
|
||||
# <tt>
|
||||
# FATAL(1) -> LOG_EMERG (0)
|
||||
# none -> LOG_EMERG (0)
|
||||
# none -> LOG_ALERT (1)
|
||||
# none -> LOG_CRIT (2)
|
||||
# FATAL(1) -> LOG_CRIT (2)
|
||||
# ERROR(2) -> LOG_ERR (3)
|
||||
# WARN(3) -> LOG_WARNING (4)
|
||||
# none -> LOG_NOTICE (5)
|
||||
@@ -280,7 +279,7 @@ _dlvl2syslvl() {
|
||||
local lvl
|
||||
|
||||
case "$1" in
|
||||
1) lvl=0;;
|
||||
1) lvl=2;;
|
||||
2) lvl=3;;
|
||||
3) lvl=4;;
|
||||
4) lvl=6;;
|
||||
@@ -324,7 +323,7 @@ _do_dlog() {
|
||||
local msg="$*"
|
||||
local lmsg="$lvlc: $*"
|
||||
|
||||
(( $lvl <= $stdloglvl )) && echo "$msg" >&2
|
||||
(( $lvl <= $stdloglvl )) && printf -- 'dracut: %s\n' "$msg" >&2
|
||||
|
||||
if (( $lvl <= $sysloglvl )); then
|
||||
if [[ "$_dlogfd" ]]; then
|
||||
|
96
dracut.8.asc
96
dracut.8.asc
@@ -6,7 +6,7 @@ DRACUT(8)
|
||||
|
||||
NAME
|
||||
----
|
||||
dracut - low-level tool for generating an initramfs image
|
||||
dracut - low-level tool for generating an initramfs/initrd image
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
@@ -28,6 +28,8 @@ At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it
|
||||
as initial root file system. All finding of the root device happens in this
|
||||
early userspace.
|
||||
|
||||
Initramfs images are also called "initrd".
|
||||
|
||||
For a complete list of kernel command line options see *dracut.cmdline*(7).
|
||||
|
||||
If you are dropped to an emergency shell, while booting your initramfs,
|
||||
@@ -54,33 +56,6 @@ OPTIONS
|
||||
**-f, --force**::
|
||||
overwrite existing initramfs file.
|
||||
|
||||
**-m, --modules** _<list of dracut modules>_::
|
||||
specify a space-separated list of dracut modules to call when building the
|
||||
initramfs. Modules are located in _/usr/lib/dracut/modules.d_. This
|
||||
parameter can be specified multiple times.
|
||||
+
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
----
|
||||
# dracut --modules "module1 module2" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**-o, --omit** _<list of dracut modules>_::
|
||||
omit a space-separated list of dracut modules. This parameter can be
|
||||
specified multiple times.
|
||||
+
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
----
|
||||
# dracut --omit "module1 module2" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**-a, --add** _<list of dracut modules>_::
|
||||
add a space-separated list of dracut modules to the default set of modules.
|
||||
This parameter can be specified multiple times.
|
||||
@@ -108,6 +83,35 @@ example:
|
||||
----
|
||||
===============================
|
||||
|
||||
**-o, --omit** _<list of dracut modules>_::
|
||||
omit a space-separated list of dracut modules. This parameter can be
|
||||
specified multiple times.
|
||||
+
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
----
|
||||
# dracut --omit "module1 module2" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**-m, --modules** _<list of dracut modules>_::
|
||||
specify a space-separated list of dracut modules to call when building the
|
||||
initramfs. Modules are located in _/usr/lib/dracut/modules.d_. This
|
||||
parameter can be specified multiple times.
|
||||
This option forces dracut to only include the specified dracut modules.
|
||||
In most cases the "--add" option is what you want to use.
|
||||
+
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
----
|
||||
# dracut --modules "module1 module2" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**-d, --drivers** _<list of kernel modules>_::
|
||||
specify a space-separated list of kernel modules to exclusively include
|
||||
in the initramfs. The kernel modules have to be specified without the ".ko"
|
||||
@@ -319,6 +323,12 @@ provide a valid _/etc/fstab_.
|
||||
**--no-hostonly-cmdline**:
|
||||
Do not store kernel command line arguments needed in the initramfs
|
||||
|
||||
**--hostonly-i18n**:
|
||||
Install only needed keyboard and font files according to the host configuration (default).
|
||||
|
||||
**--no-hostonly-i18n**:
|
||||
Install all keyboard and font files available.
|
||||
|
||||
**--persistent-policy** _<policy>_::
|
||||
Use _<policy>_ to address disks and partitions.
|
||||
_<policy>_ can be any directory name found in /dev/disk.
|
||||
@@ -338,6 +348,10 @@ provide a valid _/etc/fstab_.
|
||||
The default _<dump frequency>_ is "0".
|
||||
the default _<fsck order>_ is "2".
|
||||
|
||||
**--mount** "_<mountpoint>_"::
|
||||
Like above, but _<device>_, _<filesystem type>_ and _<filesystem options>_
|
||||
are determined by looking at the current mounts.
|
||||
|
||||
**--add-device** _<device>_ ::
|
||||
Bring up _<device>_ in initramfs, _<device>_ should be the device name.
|
||||
This can be useful in hostonly mode for resume support when your swap is on
|
||||
@@ -420,6 +434,7 @@ will not be able to boot.
|
||||
program with known-working arguments. If you pass a quoted string with
|
||||
arguments, it will be called with exactly those arguments. Depending on what
|
||||
you pass, this may result in an initramfs that the kernel cannot decompress.
|
||||
The default value can also be set via the _INITRD_COMPRESS_ environment variable.
|
||||
|
||||
**--no-compress**::
|
||||
Do not compress the generated initramfs. This will override any other
|
||||
@@ -428,6 +443,9 @@ will not be able to boot.
|
||||
**--reproducible**::
|
||||
Create reproducible images.
|
||||
|
||||
**--no-reproducible**::
|
||||
Do not create reproducible images.
|
||||
|
||||
**--list-modules**::
|
||||
List all available dracut modules.
|
||||
|
||||
@@ -467,18 +485,32 @@ will not be able to boot.
|
||||
|
||||
**--uefi**::
|
||||
Instead of creating an initramfs image, dracut will create an UEFI executable,
|
||||
which can be executed by an UEFI BIOS.
|
||||
which can be executed by an UEFI BIOS. The default output filename is
|
||||
_<EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi_. <EFI> might be
|
||||
_/efi_, _/boot_ or _/boot/efi_ depending on where the ESP partition is mounted.
|
||||
The <BUILD_ID> is taken from BUILD_ID in _/usr/lib/os-release_ or if it exists
|
||||
_/etc/os-release_ and is left out, if BUILD_ID is non-existant or empty.
|
||||
|
||||
**--no-machineid**::
|
||||
affects the default output filename of **--uefi** and will discard the <MACHINE_ID>
|
||||
part.
|
||||
|
||||
**--uefi-stub _<FILE>_**::
|
||||
Specifies the UEFI stub loader, which will load the attached kernel, initramfs and
|
||||
kernel command line and boots the kernel. The default is
|
||||
_/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
|
||||
or _/usr/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
|
||||
_$prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
|
||||
or _$prefix/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
|
||||
|
||||
**--kernel-image _<FILE>_**::
|
||||
Specifies the kernel image, which to include in the UEFI executable. The default is
|
||||
_/lib/modules/<KERNEL-VERSION>/vmlinuz_ or _/boot/vmlinuz-<KERNEL-VERSION>_
|
||||
|
||||
ENVIRONMENT
|
||||
-----------
|
||||
|
||||
_INITRD_COMPRESS_::
|
||||
sets the default compression program. See **--compress**.
|
||||
|
||||
FILES
|
||||
-----
|
||||
_/var/log/dracut.log_::
|
||||
@@ -536,4 +568,4 @@ Will Woods
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
*dracut.cmdline*(7) *dracut.conf*(5)
|
||||
*dracut.cmdline*(7) *dracut.conf*(5) *lsinitrd*(1)
|
||||
|
@@ -132,7 +132,7 @@ The following steps are executed during a shutdown:
|
||||
|
||||
* systemd switches to the shutdown.target
|
||||
* systemd starts
|
||||
/lib/systemd/system/shutdown.target.wants/dracut-shutdown.service
|
||||
$prefix/lib/systemd/system/shutdown.target.wants/dracut-shutdown.service
|
||||
* dracut-shutdown.service executes /usr/lib/dracut/dracut-initramfs-restore
|
||||
which unpacks the initramfs to /run/initramfs
|
||||
* systemd finishes shutdown.target
|
||||
|
@@ -32,7 +32,7 @@ line is the value, which is honored.
|
||||
Standard
|
||||
~~~~~~~~
|
||||
**init=**__<path to real init>__::
|
||||
specify the path to the init programm to be started after the initramfs has
|
||||
specify the path to the init program to be started after the initramfs has
|
||||
finished
|
||||
|
||||
**root=**__<path to blockdevice>__::
|
||||
@@ -129,6 +129,10 @@ menuentry 'Live Fedora 20' --class fedora --class gnu-linux --class gnu --class
|
||||
|
||||
Misc
|
||||
~~~~
|
||||
**rd.emergency=**__[reboot|poweroff|halt]__::
|
||||
specify, what action to execute in case of a critical failure. rd.shell=0 also
|
||||
be specified.
|
||||
|
||||
**rd.driver.blacklist=**__<drivername>__[,__<drivername>__,...]::
|
||||
do not load kernel module <drivername>. This parameter can be specified
|
||||
multiple times.
|
||||
@@ -183,8 +187,8 @@ It should be attached to any report about dracut problems.
|
||||
_/run/initramfs/init.log_.
|
||||
If "quiet" is set, it also logs to the console.
|
||||
|
||||
**rd.memdebug=[0-3]**::
|
||||
Print memory usage info at various points, set the verbose level from 0 to 3.
|
||||
**rd.memdebug=[0-4]**::
|
||||
Print memory usage info at various points, set the verbose level from 0 to 4.
|
||||
+
|
||||
Higher level means more debugging output:
|
||||
+
|
||||
@@ -193,6 +197,10 @@ It should be attached to any report about dracut problems.
|
||||
1 - partial /proc/meminfo
|
||||
2 - /proc/meminfo
|
||||
3 - /proc/meminfo + /proc/slabinfo
|
||||
4 - /proc/meminfo + /proc/slabinfo + tracekomem
|
||||
NOTE: tracekomem is a shell script utilizing kernel trace to track
|
||||
the rough total memory consumption of kernel modules during
|
||||
loading. It may override other trace configurations.
|
||||
----
|
||||
|
||||
**rd.break**::
|
||||
@@ -492,7 +500,7 @@ cannot be used in conjunction with the **ifname** argument for the
|
||||
same <interface>.
|
||||
=====================
|
||||
|
||||
**ip=**__<client-IP>__:[__<peer>__]:__<gateway-IP>__:__<netmask>__:__<client_hostname>__:__<interface>__:__{none|off|dhcp|on|any|dhcp6|auto6|ibft}__:[:[__<mtu>__][:__<macaddr>__]]::
|
||||
**ip=**__<client-IP>__:[__<peer>__]:__<gateway-IP>__:__<netmask>__:__<client_hostname>__:__<interface>__:__{none|off|dhcp|on|any|dhcp6|auto6|ibft}__[:[__<mtu>__][:__<macaddr>__]]::
|
||||
explicit network configuration. If you want do define a IPv6 address, put it
|
||||
in brackets (e.g. [2001:DB8::1]). This parameter can be specified multiple
|
||||
times. __<peer>__ is optional and is the address of the remote endpoint
|
||||
@@ -546,6 +554,9 @@ interface name. Better name it "bootnet" or "bluesocket".
|
||||
**nameserver=**__<IP>__ [**nameserver=**__<IP>__ ...]::
|
||||
specify nameserver(s) to use
|
||||
|
||||
**rd.peerdns=0**::
|
||||
Disable DNS setting of DHCP parameters.
|
||||
|
||||
**biosdevname=0**::
|
||||
boolean, turn off biosdevname network interface renaming
|
||||
|
||||
@@ -558,13 +569,14 @@ interface name. Better name it "bootnet" or "bluesocket".
|
||||
VLAN_PLUS_VID_NO_PAD (vlan5), DEV_PLUS_VID (eth0.0005),
|
||||
DEV_PLUS_VID_NO_PAD (eth0.5)
|
||||
|
||||
**bond=**__<bondname>__[:__<bondslaves>__:[:__<options>__]]::
|
||||
**bond=**__<bondname>__[:__<bondslaves>__:[:__<options>__[:<mtu>]]]::
|
||||
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
|
||||
semicolon. if the mtu is specified, it will be set on the bond master.
|
||||
Bond without parameters assumes
|
||||
bond=bond0:eth0,eth1:mode=balance-rr
|
||||
|
||||
**team=**__<teammaster>__:__<teamslaves>__::
|
||||
@@ -601,7 +613,32 @@ NFS
|
||||
method. This is supported by dracut, but not recommended.
|
||||
|
||||
**rd.nfs.domain=**__<NFSv4 domain name>__::
|
||||
Set the NFSv4 domain name. Will overwrite the settings in _/etc/idmap.conf_.
|
||||
Set the NFSv4 domain name. Will override the settings in _/etc/idmap.conf_.
|
||||
|
||||
**rd.net.dhcp.retry=**__<cnt>__::
|
||||
If this option is set, dracut will try to connect via dhcp <cnt> times before failing.
|
||||
Default is 1.
|
||||
|
||||
**rd.net.timeout.dhcp=**__<arg>__::
|
||||
If this option is set, dhclient is called with "-timeout <arg>".
|
||||
|
||||
**rd.net.timeout.iflink=**__<seconds>__::
|
||||
Wait <seconds> until link shows up. Default is 60 seconds.
|
||||
|
||||
**rd.net.timeout.ifup=**__<seconds>__::
|
||||
Wait <seconds> until link has state "UP". Default is 20 seconds.
|
||||
|
||||
**rd.net.timeout.route=**__<seconds>__::
|
||||
Wait <seconds> until route shows up. Default is 20 seconds.
|
||||
|
||||
**rd.net.timeout.ipv6dad=**__<seconds>__::
|
||||
Wait <seconds> until IPv6 DAD is finished. Default is 50 seconds.
|
||||
|
||||
**rd.net.timeout.ipv6auto=**__<seconds>__::
|
||||
Wait <seconds> until IPv6 automatic addresses are assigned. Default is 40 seconds.
|
||||
|
||||
**rd.net.timeout.carrier=**__<seconds>__::
|
||||
Wait <seconds> until carrier is recognized. Default is 5 seconds.
|
||||
|
||||
CIFS
|
||||
~~~
|
||||
@@ -710,6 +747,12 @@ iscsistart -b --param node.session.timeo.replacement_timeout=30
|
||||
**rd.iscsi.ibft** **rd.iscsi.ibft=1**:
|
||||
Turn on iBFT autoconfiguration for the interfaces
|
||||
|
||||
**rd.iscsi.waitnet=0**:
|
||||
Turn off waiting for all interfaces to be up before trying to login to the iSCSI targets.
|
||||
|
||||
**rd.iscsi.testroute=0**:
|
||||
Turn off checking, if the route to the iSCSI target IP is possible before trying to login.
|
||||
|
||||
FCoE
|
||||
~~~~
|
||||
**fcoe=**__<edd|interface|MAC>__:__{dcb|nodcb}__::
|
||||
@@ -721,13 +764,21 @@ NOTE: letters in the MAC-address must be lowercase!
|
||||
|
||||
NBD
|
||||
~~~
|
||||
**root=**??? **netroot=**nbd:__<server>__:__<port>__[:__<fstype>__[:__<mountopts>__[:__<nbdopts>__]]]::
|
||||
mount nbd share from <server>
|
||||
**root=**??? **netroot=**nbd:__<server>__:__<port/exportname>__[:__<fstype>__[:__<mountopts>__[:__<nbdopts>__]]]::
|
||||
mount nbd share from <server>.
|
||||
+
|
||||
NOTE:
|
||||
If "exportname" instead of "port" is given the standard port is used.
|
||||
Newer versions of nbd are only supported with "exportname".
|
||||
|
||||
**root=dhcp** with **dhcp** **root-path=**nbd:__<server>__:__<port>__[:__<fstype>__[:__<mountopts>__[:__<nbdopts>__]]]::
|
||||
**root=dhcp** with **dhcp** **root-path=**nbd:__<server>__:__<port/exportname>__[:__<fstype>__[:__<mountopts>__[:__<nbdopts>__]]]::
|
||||
root=dhcp alone directs initrd to look at the DHCP root-path where NBD
|
||||
options can be specified. This syntax is only usable in cases where you are
|
||||
directly mounting the volume as the rootfs.
|
||||
+
|
||||
NOTE:
|
||||
If "exportname" instead of "port" is given the standard port is used.
|
||||
Newer versions of nbd are only supported with "exportname".
|
||||
|
||||
DASD
|
||||
~~~~
|
||||
@@ -765,21 +816,26 @@ Booting live images
|
||||
Dracut offers multiple options for live booted images:
|
||||
|
||||
=====================
|
||||
squashfs with read-only filesystem image::: The system will boot with a read
|
||||
only filesystem from the squashfs and apply a writable device mapper snapshot
|
||||
SquashFS with read-only filesystem image::: The system will boot with a read
|
||||
only filesystem from the SquashFS and apply a writable device-mapper snapshot
|
||||
over the read only filesystem. Using this method ensures a relatively fast
|
||||
boot and lower RAM usage. Users **must be careful** to avoid writing too many
|
||||
blocks to the snapshot volume. Once the blocks of the snapshot are exhaused,
|
||||
the live filesystem becomes unusable and requires a reboot.
|
||||
blocks to the snapshot volume. Once the blocks of the snapshot overlay are
|
||||
exhausted, the root filesystem becomes read only and may cause application
|
||||
failures. The overlay file is marked 'Overflow', and a difficult recovery is
|
||||
required to repair and enlarge the overlay offline. Non-persistent overlays
|
||||
are sparse files in RAM that only consume content space as required blocks are
|
||||
allocated. They default to an apparent size of 32 GiB in RAM. The size can be
|
||||
adjusted with the **rd.live.overlay.size=** kernel command line option.
|
||||
+
|
||||
The filesystem structure is expected to be:
|
||||
+
|
||||
[listing]
|
||||
--
|
||||
squashfs.img | Squashfs downloaded via network
|
||||
squashfs.img | Squashfs from LiveCD .iso downloaded via network
|
||||
!(mount)
|
||||
/LiveOS
|
||||
|- ext3fs.img | Filesystem image to mount read-only
|
||||
|- rootfs.img | Filesystem image to mount read-only
|
||||
!(mount)
|
||||
/bin | Live filesystem
|
||||
/boot |
|
||||
@@ -791,11 +847,34 @@ Dracut uses this method of live booting by default. No additional command line
|
||||
options are required other than **root=live:<URL>** to specify the location
|
||||
of your squashed filesystem.
|
||||
+
|
||||
writable filesystem image::: The system will retrieve a compressed filesystem
|
||||
image, connect it to a loopback device, and mount it as a writable volume. More
|
||||
RAM is required during boot but the live filesystem is easier to manage if it
|
||||
becomes full. Users can make a filesystem image of any size and that size will
|
||||
be maintained when the system boots.
|
||||
- The compressed SquashFS image can be copied during boot to RAM at
|
||||
`/run/initramfs/squashed.img` by using the **rd.live.ram=1** option.
|
||||
- A device with a persistent overlay can be booted read only by using the
|
||||
**rd.live.overlay.readonly** option on the kernel command line. This will
|
||||
cause a temporary, writable overlay to be stacked over a read-only snapshot
|
||||
of the root filesystem.
|
||||
+
|
||||
Uncompressed live filesystem image:::
|
||||
When the live system was installed with the '--skipcompress' option of the
|
||||
__livecd-iso-to-disk__ installation script for Live USB devices, the root
|
||||
filesystem image, `rootfs.img`, is expanded on installation and no SquashFS
|
||||
is involved during boot.
|
||||
+
|
||||
- If **rd.live.ram=1** is used in this situation, the full, uncompressed
|
||||
root filesystem is copied during boot to `/run/initramfs/rootfs.img` in the
|
||||
`/run` tmpfs.
|
||||
+
|
||||
- If **rd.live.overlay=none** is provided as a kernel command line option,
|
||||
a writable, linear device-mapper target is created on boot with no overlay.
|
||||
|
||||
writable filesystem image:::
|
||||
The system will retrieve a compressed filesystem image, extract it to
|
||||
`/run/initramfs/fsimg/rootfs.img`, connect it to a loop device, create a
|
||||
writable, linear device-mapper target at `/dev/mapper/live-rw`, and mount that
|
||||
as a writable volume at `/`. More RAM is required during boot but the live
|
||||
filesystem is easier to manage if it becomes full. Users can make a filesystem
|
||||
image of any size and that size will be maintained when the system boots. There
|
||||
is no persistence of root filesystem changes between boots with this option.
|
||||
+
|
||||
The filesystem structure is expected to be:
|
||||
+
|
||||
@@ -803,7 +882,7 @@ The filesystem structure is expected to be:
|
||||
--
|
||||
rootfs.tgz | Compressed tarball containing fileystem image
|
||||
!(unpack)
|
||||
/rootfs.img | Filesystem image
|
||||
/rootfs.img | Filesystem image at /run/initramfs/fsimg/
|
||||
!(mount)
|
||||
/bin | Live filesystem
|
||||
/boot |
|
||||
@@ -811,11 +890,23 @@ rootfs.tgz | Compressed tarball containing fileystem image
|
||||
... |
|
||||
--
|
||||
+
|
||||
To use this boot option, ensure that **rd.writable_fsimg=1** is in your kernel
|
||||
To use this boot option, ensure that **rd.writable.fsimg=1** is in your kernel
|
||||
command line and add the **root=live:<URL>** to specify the location
|
||||
of your compressed filesystem image tarball.
|
||||
of your compressed filesystem image tarball or SquashFS image.
|
||||
=====================
|
||||
|
||||
**rd.writable.fsimg=**1::
|
||||
Enables writable filesystem support. The system will boot with a fully
|
||||
writable (but non-persistent) filesystem without snapshots __(see notes above
|
||||
about available live boot options)__. You can use the **rootflags** option to
|
||||
set mount options for the live filesystem as well __(see documentation about
|
||||
rootflags in the **Standard** section above)__.
|
||||
This implies that the whole image is copied to RAM before the boot continues.
|
||||
+
|
||||
NOTE: There must be enough free RAM available to hold the complete image.
|
||||
+
|
||||
This method is very suitable for diskless boots.
|
||||
|
||||
**root=**live:__<url>__::
|
||||
Boots a live image retrieved from __<url>__. Valid handlers: __http, https, ftp, torrent, tftp__.
|
||||
+
|
||||
@@ -831,18 +922,27 @@ root=live:torrent://example.com/liveboot.img.torrent
|
||||
Enables debug output from the live boot process.
|
||||
|
||||
**rd.live.dir=**__<path>__::
|
||||
Specifies the directory within the squashfs where the ext3fs.img or rootfs.img
|
||||
can be found. By default, this is __LiveOS__.
|
||||
Specifies the directory within the boot device where the squashfs.img or
|
||||
rootfs.img can be found. By default, this is __LiveOS__.
|
||||
|
||||
**rd.live.squashimg=**__<filename of SquashFS image>__::
|
||||
Specifies the filename for a SquashFS image of the root filesystem.
|
||||
By default, this is __squashfs.img__.
|
||||
|
||||
**rd.live.ram=**1::
|
||||
Copy the complete image to RAM and use this for booting. This is useful
|
||||
when the image resides on i.e. a DVD which needs to be ejected later on.
|
||||
when the image resides on, i.e., a DVD which needs to be ejected later on.
|
||||
|
||||
**rd.live.overlay=**_<devspec>_:_(<pathspec>|auto)__
|
||||
**rd.live.overlay=**__<devspec>__:__(<pathspec>|auto)__|__none__::
|
||||
Allow the usage of a permanent overlay.
|
||||
_<devspec>_ specifies the path to a device with a mountable filesystem.
|
||||
_<pathspec>_ is the path to a file within that filesystem, which shall be used to
|
||||
persist the changes made to the device specified by **root=live:__<url>__** option.
|
||||
- _<devspec>_ specifies the path to a device with a mountable filesystem.
|
||||
- _<pathspec>_ is the path to a file within that filesystem, which shall be
|
||||
used to persist the changes made to the device specified by the
|
||||
**root=live:__<url>__** option.
|
||||
- _none_ specifies no overlay when an uncompressed live root filesystem is
|
||||
available.
|
||||
If a persistent overlay is detected at the standard LiveOS path, the overlay &
|
||||
overlay type detected (whether Device-mapper or OverlayFS) will be used.
|
||||
+
|
||||
[listing]
|
||||
.Example
|
||||
@@ -850,23 +950,46 @@ persist the changes made to the device specified by **root=live:__<url>__** opti
|
||||
rd.live.overlay=/dev/sdb1:persistent-overlay.img
|
||||
--
|
||||
|
||||
**rd.live.overlay.size=**__<size_MiB>__::
|
||||
Specifies a non-persistent overlay size in MiB. The default is _32768_.
|
||||
|
||||
**rd.live.overlay.readonly=**1::
|
||||
Specifies a non-persistent, writable snapshot overlay to be stacked over a
|
||||
read-only snapshot of the root filesystem, `/dev/mapper/live-ro`, or a read-
|
||||
only loop device of a writable `rootfs.img`.
|
||||
|
||||
**rd.live.overlay.reset=**1::
|
||||
Specifies that a persistent overlay should be reset on boot. All root
|
||||
filesystem changes are vacated by this action.
|
||||
|
||||
**rd.live.overlay.thin=**1::
|
||||
Enables the usage of thin snapshots instead of classic dm snapshots.
|
||||
The advantage of thin snapshots is, that they support discards, and will free
|
||||
blocks which are not claimed by the filesystem. In this use case this means,
|
||||
that memory is given back to the kernel, when the filesystem does not claim it
|
||||
The advantage of thin snapshots is that they support discards, and will free
|
||||
blocks that are not claimed by the filesystem. In this use case, this means
|
||||
that memory is given back to the kernel when the filesystem does not claim it
|
||||
anymore.
|
||||
|
||||
**rd.writable.fsimg=**1::
|
||||
Enables writable filesystem support. The system will boot with a fully
|
||||
writable filesystem without snapshots __(see notes above about available live boot options)__.
|
||||
You can use the **rootflags** option to set mount options for the live
|
||||
filesystem as well __(see documentation about rootflags in the **Standard** section above)__.
|
||||
This implies that the whole image is copied to RAM before the boot continues.
|
||||
+
|
||||
NOTE: There must be enough free RAM available to hold the complete image.
|
||||
+
|
||||
This method is very suitable for diskless boots.
|
||||
**rd.live.overlay.overlayfs=**1::
|
||||
Enables the use of the **OverlayFS** kernel module, if available, to provide a
|
||||
copy-on-write union directory for the root filesystem. OverlayFS overlays are
|
||||
directories of the files that have changed on the read-only base (lower)
|
||||
filesystem. The root filesystem is provided through a special overlay type
|
||||
mount that merges the lower and upper directories. If an OverlayFS upper
|
||||
directory is not present on the boot device, a tmpfs directory will be created
|
||||
at /run/overlayfs to provide temporary storage. Persistent storage can be
|
||||
provided on vfat or msdos formatted devices by supplying the OverlayFS upper
|
||||
directory within an embedded filesystem that supports the creation of trusted.*
|
||||
extended attributes and provides a valid d_type in readdir responses, such as
|
||||
with ext4 and xfs. On non-vfat-formatted devices, a persistent OverlayFS
|
||||
overlay can extend the available root filesystem storage up to the capacity of
|
||||
the LiveOS device.
|
||||
|
||||
If a persistent overlay is detected at the standard LiveOS path, the overlay &
|
||||
overlay type detected (whether OverlayFS or Device-mapper) will be used.
|
||||
|
||||
The **rd.live.overlay.readonly** option, which allows a persistent overlayfs to
|
||||
be mounted read only through a higher level transient overlay directory, has
|
||||
been implemented through the multiple lower layers feature of OverlayFS.
|
||||
|
||||
|
||||
Plymouth Boot Splash
|
||||
|
54
dracut.conf
54
dracut.conf
@@ -1,51 +1,3 @@
|
||||
# PUT YOUR CONFIG HERE OR IN separate files named *.conf
|
||||
# in /etc/dracut.conf.d
|
||||
# SEE man dracut.conf(5)
|
||||
|
||||
# Sample dracut config file
|
||||
|
||||
#logfile=/var/log/dracut.log
|
||||
#fileloglvl=6
|
||||
|
||||
# Exact list of dracut modules to use. Modules not listed here are not going
|
||||
# to be included. If you only want to add some optional modules use
|
||||
# add_dracutmodules option instead.
|
||||
#dracutmodules+=""
|
||||
|
||||
# dracut modules to omit
|
||||
#omit_dracutmodules+=""
|
||||
|
||||
# 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="no"
|
||||
|
||||
# install local /etc/lvm/lvm.conf
|
||||
#lvmconf="no"
|
||||
|
||||
# A list of fsck tools to install. If it's not specified, module's hardcoded
|
||||
# default is used, currently: "umount mount /sbin/fsck* xfs_db xfs_check
|
||||
# xfs_repair e2fsck jfs_fsck reiserfsck btrfsck". The installation is
|
||||
# opportunistic, so non-existing tools are just ignored.
|
||||
#fscks=""
|
||||
|
||||
# inhibit installation of any fsck tools
|
||||
#nofscks="yes"
|
||||
|
||||
# mount / and /usr read-only by default
|
||||
#ro_mnt="no"
|
||||
|
||||
# set the directory for temporary files
|
||||
# default: /var/tmp
|
||||
#tmpdir=/tmp
|
||||
# PUT YOUR CONFIG IN separate files
|
||||
# in /etc/dracut.conf.d named "<name>.conf"
|
||||
# SEE man dracut.conf(5) for options
|
||||
|
@@ -17,29 +17,33 @@ _/usr/lib/dracut/dracut.conf.d/*.conf_
|
||||
Description
|
||||
-----------
|
||||
_dracut.conf_ is loaded during the initialisation phase of dracut. Command line
|
||||
parameter will overwrite any values set here.
|
||||
parameter will override any values set here.
|
||||
|
||||
_*.conf_ files are read from /usr/lib/dracut/dracut.conf.d and
|
||||
/etc/dracut.conf.d. Files with the same name in /etc/dracut.conf.d will replace
|
||||
files in /usr/lib/dracut/dracut.conf.d.
|
||||
The files are then read in alphanumerical order and will overwrite parameters
|
||||
The files are then read in alphanumerical order and will override parameters
|
||||
set in _/etc/dracut.conf_. Each line specifies an attribute and a value. A '#'
|
||||
indicates the beginning of a comment; following characters, up to the end of the
|
||||
line are not interpreted.
|
||||
|
||||
dracut command line options will overwrite any values set here.
|
||||
dracut command line options will override any values set here.
|
||||
|
||||
Configuration files must have the extension .conf; other extensions are ignored.
|
||||
|
||||
*add_dracutmodules+=*" __<dracut modules>__ "::
|
||||
Add a space-separated list of dracut modules to call when building the
|
||||
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.
|
||||
|
||||
*dracutmodules+=*" __<dracut modules>__ "::
|
||||
Specify a space-separated list of dracut modules to call when building the
|
||||
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.
|
||||
This option forces dracut to only include the specified dracut modules.
|
||||
In most cases the "add_dracutmodules" option is what you want to use.
|
||||
|
||||
*omit_dracutmodules+=*" __<dracut modules>__ "::
|
||||
Omit a space-separated list of dracut modules.
|
||||
|
||||
*add_dracutmodules+=*" __<dracut modules>__ "::
|
||||
Add a space-separated list of dracut modules.
|
||||
Omit a space-separated list of dracut modules to call when building the
|
||||
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.
|
||||
|
||||
*drivers+=*" __<kernel modules>__ "::
|
||||
Specify a space-separated list of kernel modules to exclusively include in
|
||||
@@ -180,7 +184,7 @@ provide a valid _/etc/fstab_.
|
||||
*show_modules=*"__{yes|no}__"::
|
||||
Print the name of the included modules to standard output during build.
|
||||
|
||||
*i18n_vars="__<variable mapping>__"::
|
||||
*i18n_vars=*"__<variable mapping>__"::
|
||||
Distribution specific variable mapping.
|
||||
See dracut/modules.d/10i18n/README for a detailed description.
|
||||
|
||||
@@ -214,7 +218,7 @@ _/etc/dracut.conf_::
|
||||
_/etc/dracut.conf.d/_.
|
||||
|
||||
_/etc/dracut.conf.d/_::
|
||||
Any _/etc/dracut.conf.d/*.conf_ file can overwrite the values in
|
||||
Any _/etc/dracut.conf.d/*.conf_ file can override the values in
|
||||
_/etc/dracut.conf_. The configuration files are read in alphanumerical
|
||||
order.
|
||||
|
||||
|
@@ -17,3 +17,4 @@ udevdir=/usr/lib/udev
|
||||
hostonly="yes"
|
||||
hostonly_cmdline="no"
|
||||
early_microcode="yes"
|
||||
reproducible="yes"
|
||||
|
@@ -168,7 +168,7 @@ inst_hook cmdline 20 "$moddir/parse-insmodpost.sh"
|
||||
inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh
|
||||
----
|
||||
|
||||
The _pase-instmodpost.sh_ parses the kernel command line for a argument
|
||||
The _parse-instmodpost.sh_ parses the kernel command line for a argument
|
||||
rd.driver.post, blacklists the module from being autoloaded and installs the
|
||||
hook _insmodpost.sh_ in the _initqueue/settled_.
|
||||
|
||||
|
BIN
dracut.png
BIN
dracut.png
Binary file not shown.
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 6.2 KiB |
75
dracut.spec
75
dracut.spec
@@ -1,6 +1,11 @@
|
||||
%define dracutlibdir %{_prefix}/lib/dracut
|
||||
%bcond_without doc
|
||||
|
||||
# We ship a .pc file but don't want to have a dep on pkg-config. We
|
||||
# strip the automatically generated dep here and instead co-own the
|
||||
# directory.
|
||||
%global __requires_exclude pkg-config
|
||||
|
||||
# Variables must be defined
|
||||
%define with_nbd 1
|
||||
|
||||
@@ -28,12 +33,13 @@ License: GPLv2+ and LGPLv2+
|
||||
URL: https://dracut.wiki.kernel.org/
|
||||
|
||||
# Source can be generated by
|
||||
# http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%{version};sf=tgz
|
||||
# http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%%{version};sf=tgz
|
||||
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.xz
|
||||
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
|
||||
|
||||
|
||||
BuildRequires: bash git
|
||||
BuildRequires: kmod-devel >= 15
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel}
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
@@ -41,7 +47,6 @@ BuildRequires: pkgconfig
|
||||
%endif
|
||||
%if 0%{?fedora}
|
||||
BuildRequires: bash-completion
|
||||
BuildRequires: pkgconfig
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version}
|
||||
@@ -60,14 +65,13 @@ BuildRequires: docbook-style-xsl docbook-dtds libxslt
|
||||
BuildRequires: asciidoc
|
||||
%endif
|
||||
|
||||
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel}
|
||||
# no "provides", because dracut does not offer
|
||||
# all functionality of the obsoleted packages
|
||||
Obsoletes: mkinitrd <= 6.0.93
|
||||
Obsoletes: mkinitrd-devel <= 6.0.93
|
||||
Obsoletes: nash <= 6.0.93
|
||||
Obsoletes: libbdevid-python <= 6.0.93
|
||||
Obsoletes: mkinitrd < 6.0.94
|
||||
Obsoletes: mkinitrd-devel < 6.0.94
|
||||
Obsoletes: nash < 6.0.94
|
||||
Obsoletes: libbdevid-python < 6.0.94
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} > 16 || 0%{?rhel} > 6
|
||||
@@ -82,9 +86,9 @@ Provides: mkinitrd = 2.6.1
|
||||
Obsoletes: dracut-kernel < 005
|
||||
Provides: dracut-kernel = %{version}-%{release}
|
||||
|
||||
Obsoletes: dracut <= 029
|
||||
Obsoletes: dracut-norescue
|
||||
Provides: dracut-norescue
|
||||
Obsoletes: dracut < 030
|
||||
Obsoletes: dracut-norescue < 030
|
||||
Provides: dracut-norescue = %{version}-%{release}
|
||||
|
||||
Requires: bash >= 4
|
||||
Requires: coreutils
|
||||
@@ -92,15 +96,26 @@ Requires: cpio
|
||||
Requires: filesystem >= 2.1.0
|
||||
Requires: findutils
|
||||
Requires: grep
|
||||
Requires: hardlink
|
||||
Requires: gzip xz
|
||||
Requires: kmod
|
||||
Requires: sed
|
||||
Requires: xz
|
||||
Requires: gzip
|
||||
|
||||
%if 0%{?fedora} > 22
|
||||
Recommends: grubby
|
||||
Recommends: hardlink
|
||||
Recommends: pigz
|
||||
Recommends: kpartx
|
||||
%else
|
||||
Requires: hardlink
|
||||
Requires: gzip
|
||||
Requires: kpartx
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||
Requires: util-linux >= 2.21
|
||||
Requires: systemd >= 199
|
||||
Requires: systemd >= 219
|
||||
Requires: systemd-udev >= 219
|
||||
Requires: procps-ng
|
||||
Conflicts: grubby < 8.23
|
||||
Conflicts: initscripts < 8.63-1
|
||||
@@ -168,11 +183,21 @@ Requires: libcap
|
||||
This package requires everything which is needed to build an
|
||||
initramfs with dracut, which drops capabilities.
|
||||
|
||||
%package live
|
||||
Summary: dracut modules to build a dracut initramfs with live image capabilities
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: %{name}-network = %{version}-%{release}
|
||||
Requires: tar gzip coreutils bash device-mapper curl
|
||||
|
||||
%description live
|
||||
This package requires everything which is needed to build an
|
||||
initramfs with dracut, with live image capabilities, like Live CDs.
|
||||
|
||||
%package config-generic
|
||||
Summary: dracut configuration to turn off hostonly image generation
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Obsoletes: dracut-nohostonly
|
||||
Provides: dracut-nohostonly
|
||||
Obsoletes: dracut-nohostonly < 030
|
||||
Provides: dracut-nohostonly = %{version}-%{release}
|
||||
|
||||
%description config-generic
|
||||
This package provides the configuration to turn off the host specific initramfs
|
||||
@@ -181,7 +206,7 @@ generation with dracut and generates a generic image by default.
|
||||
%package config-rescue
|
||||
Summary: dracut configuration to turn on rescue image generation
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Obsoletes: dracut <= 029
|
||||
Obsoletes: dracut < 030
|
||||
|
||||
%description config-rescue
|
||||
This package provides the configuration to turn on the rescue initramfs
|
||||
@@ -199,10 +224,13 @@ This package contains tools to assemble the local initrd and host configuration.
|
||||
cp %{SOURCE1} .
|
||||
|
||||
%build
|
||||
%configure --systemdsystemunitdir=%{_unitdir} --bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) --libdir=%{_prefix}/lib \
|
||||
%configure --systemdsystemunitdir=%{_unitdir} \
|
||||
--bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) \
|
||||
--libdir=%{_prefix}/lib \
|
||||
%if %{without doc}
|
||||
--disable-documentation
|
||||
--disable-documentation \
|
||||
%endif
|
||||
${NULL}
|
||||
|
||||
make %{?_smp_mflags}
|
||||
|
||||
@@ -295,6 +323,7 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%dir %{dracutlibdir}
|
||||
%dir %{dracutlibdir}/modules.d
|
||||
%{dracutlibdir}/dracut-functions.sh
|
||||
%{dracutlibdir}/dracut-init.sh
|
||||
%{dracutlibdir}/dracut-functions
|
||||
%{dracutlibdir}/dracut-version.sh
|
||||
%{dracutlibdir}/dracut-logger.sh
|
||||
@@ -307,6 +336,7 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%endif
|
||||
%dir %{_sysconfdir}/dracut.conf.d
|
||||
%dir %{dracutlibdir}/dracut.conf.d
|
||||
%dir %{_datadir}/pkgconfig
|
||||
%{_datadir}/pkgconfig/dracut.pc
|
||||
|
||||
%if %{with doc}
|
||||
@@ -345,7 +375,6 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%{dracutlibdir}/modules.d/90crypt
|
||||
%{dracutlibdir}/modules.d/90dm
|
||||
%{dracutlibdir}/modules.d/90dmraid
|
||||
%{dracutlibdir}/modules.d/90dmsquash-live
|
||||
%{dracutlibdir}/modules.d/90kernel-modules
|
||||
%{dracutlibdir}/modules.d/90lvm
|
||||
%{dracutlibdir}/modules.d/90mdraid
|
||||
@@ -379,7 +408,6 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%{dracutlibdir}/modules.d/98usrmount
|
||||
%{dracutlibdir}/modules.d/99base
|
||||
%{dracutlibdir}/modules.d/99fs-lib
|
||||
%{dracutlibdir}/modules.d/99img-lib
|
||||
%{dracutlibdir}/modules.d/99shutdown
|
||||
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
|
||||
%dir %{_sharedstatedir}/initramfs
|
||||
@@ -413,7 +441,6 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%{dracutlibdir}/modules.d/90kernel-network-modules
|
||||
%{dracutlibdir}/modules.d/95fcoe
|
||||
%{dracutlibdir}/modules.d/95iscsi
|
||||
%{dracutlibdir}/modules.d/90livenet
|
||||
%{dracutlibdir}/modules.d/90qemu-net
|
||||
%{dracutlibdir}/modules.d/95cifs
|
||||
%{dracutlibdir}/modules.d/95nbd
|
||||
@@ -440,6 +467,12 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%defattr(-,root,root,0755)
|
||||
%{dracutlibdir}/modules.d/02caps
|
||||
|
||||
%files live
|
||||
%defattr(-,root,root,0755)
|
||||
%{dracutlibdir}/modules.d/99img-lib
|
||||
%{dracutlibdir}/modules.d/90dmsquash-live
|
||||
%{dracutlibdir}/modules.d/90livenet
|
||||
|
||||
%files tools
|
||||
%defattr(-,root,root,0755)
|
||||
|
||||
|
@@ -99,10 +99,6 @@ raid with encryption and LVM on top), as long as you specify the correct
|
||||
filesystem LABEL or UUID on the kernel command line for your root device, dracut
|
||||
will find it and boot from it.
|
||||
|
||||
The kernel command line usually can be configured in _/boot/grub/grub.conf_ or
|
||||
_/boot/grub2/grub.cfg_, if grub is your bootloader and it also can be edited in
|
||||
the real boot process in the grub menu.
|
||||
|
||||
The kernel command line can also be provided by the dhcp server with the
|
||||
root-path option. See <<NetworkBoot>>.
|
||||
|
||||
@@ -310,7 +306,7 @@ stick and mount that. Then you can store the output for later inspection.
|
||||
In all cases, the following should be mentioned and attached to your bug report:
|
||||
|
||||
* The exact kernel command-line used. Typically from the bootloader
|
||||
configuration file (e.g. _/etc/grub.conf_) or from _/proc/cmdline_.
|
||||
configuration file (e.g. _/boot/grub2/grub.cfg_) or from _/proc/cmdline_.
|
||||
* A copy of your disk partition information from _/etc/fstab_, which might be
|
||||
obtained booting an old working initramfs or a rescue medium.
|
||||
* Turn on dracut debugging (see _the 'debugging dracut' section_), and attach
|
||||
@@ -345,7 +341,7 @@ logging during the system boot. This section documents configuring a
|
||||
serial console connection to record boot messages.
|
||||
|
||||
. First, enable serial console output for both the kernel and the bootloader.
|
||||
. Open the file _/etc/grub.conf_ for editing. Below the line ''timeout=5'', add
|
||||
. Open the file _/boot/grub2/grub.cfg_ for editing. Below the line ''timeout=5'', add
|
||||
the following:
|
||||
+
|
||||
----
|
||||
@@ -353,14 +349,14 @@ serial --unit=0 --speed=9600
|
||||
terminal --timeout=5 serial console
|
||||
----
|
||||
+
|
||||
. Also in _/etc/grub.conf_, add the following boot arguemnts to the ''kernel''
|
||||
. Also in _/boot/grub2/grub.cfg_, add the following boot arguemnts to the ''kernel''
|
||||
line:
|
||||
+
|
||||
----
|
||||
console=tty0 console=ttyS0,9600
|
||||
----
|
||||
+
|
||||
. When finished, the _/etc/grub.conf_ file should look similar to the example
|
||||
. When finished, the _/boot/grub2/grub.cfg_ file should look similar to the example
|
||||
below.
|
||||
+
|
||||
----
|
||||
@@ -395,10 +391,10 @@ dracut offers a shell for interactive debugging in the event dracut fails to
|
||||
locate your root filesystem. To enable the shell:
|
||||
|
||||
. Add the boot parameter ''rd.shell'' to your bootloader configuration file
|
||||
(e.g. _/etc/grub.conf_)
|
||||
(e.g. _/boot/grub2/grub.cfg_)
|
||||
. Remove the boot arguments ''rhgb'' and ''quiet''
|
||||
+
|
||||
A sample _/etc/grub.conf_ bootloader configuration file is listed below.
|
||||
A sample _/boot/grub2/grub.cfg_ bootloader configuration file is listed below.
|
||||
+
|
||||
----
|
||||
default=0
|
||||
|
@@ -17,12 +17,12 @@
|
||||
along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#define PROGRAM_VERSION_STRING "1"
|
||||
#define PROGRAM_VERSION_STRING "2"
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
#undef _FILE_OFFSET_BITS
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
@@ -38,6 +38,9 @@
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <libkmod.h>
|
||||
#include <fts.h>
|
||||
#include <regex.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "hashmap.h"
|
||||
@@ -48,19 +51,69 @@ static bool arg_hmac = false;
|
||||
static bool arg_createdir = false;
|
||||
static int arg_loglevel = -1;
|
||||
static bool arg_optional = false;
|
||||
static bool arg_silent = false;
|
||||
static bool arg_all = false;
|
||||
static bool arg_module = false;
|
||||
static bool arg_resolvelazy = false;
|
||||
static bool arg_resolvedeps = false;
|
||||
static bool arg_hostonly = false;
|
||||
static char *destrootdir = NULL;
|
||||
static char *kerneldir = NULL;
|
||||
static size_t kerneldirlen = 0;
|
||||
static char **firmwaredirs = NULL;
|
||||
static char **pathdirs;
|
||||
static char *logdir = NULL;
|
||||
static char *logfile = NULL;
|
||||
FILE *logfile_f = NULL;
|
||||
static Hashmap *items = NULL;
|
||||
static Hashmap *items_failed = NULL;
|
||||
static Hashmap *modules_loaded = NULL;
|
||||
static regex_t mod_filter_path;
|
||||
static regex_t mod_filter_nopath;
|
||||
static regex_t mod_filter_symbol;
|
||||
static regex_t mod_filter_nosymbol;
|
||||
static regex_t mod_filter_noname;
|
||||
static bool arg_mod_filter_path = false;
|
||||
static bool arg_mod_filter_nopath = false;
|
||||
static bool arg_mod_filter_symbol = false;
|
||||
static bool arg_mod_filter_nosymbol = false;
|
||||
static bool arg_mod_filter_noname = false;
|
||||
|
||||
static int dracut_install(const char *src, const char *dst, bool isdir, bool resolvedeps, bool hashdst);
|
||||
|
||||
|
||||
|
||||
static inline void kmod_module_unref_listp(struct kmod_list **p) {
|
||||
if (*p)
|
||||
kmod_module_unref_list(*p);
|
||||
}
|
||||
#define _cleanup_kmod_module_unref_list_ _cleanup_(kmod_module_unref_listp)
|
||||
|
||||
static inline void kmod_module_info_free_listp(struct kmod_list **p) {
|
||||
if (*p)
|
||||
kmod_module_info_free_list(*p);
|
||||
}
|
||||
#define _cleanup_kmod_module_info_free_list_ _cleanup_(kmod_module_info_free_listp)
|
||||
|
||||
static inline void kmod_unrefp(struct kmod_ctx **p) {
|
||||
kmod_unref(*p);
|
||||
}
|
||||
#define _cleanup_kmod_unref_ _cleanup_(kmod_unrefp)
|
||||
|
||||
static inline void kmod_module_dependency_symbols_free_listp(struct kmod_list **p) {
|
||||
if (*p)
|
||||
kmod_module_dependency_symbols_free_list(*p);
|
||||
}
|
||||
#define _cleanup_kmod_module_dependency_symbols_free_list_ _cleanup_(kmod_module_dependency_symbols_free_listp)
|
||||
|
||||
static inline void fts_closep(FTS **p) {
|
||||
if (*p)
|
||||
fts_close(*p);
|
||||
}
|
||||
#define _cleanup_fts_close_ _cleanup_(fts_closep)
|
||||
|
||||
|
||||
|
||||
static size_t dir_len(char const *file)
|
||||
{
|
||||
size_t length;
|
||||
@@ -222,8 +275,13 @@ static int cp(const char *src, const char *dst)
|
||||
if (ret == 0) {
|
||||
struct timeval tv[2];
|
||||
if (fchown(dest_desc, sb.st_uid, sb.st_gid) != 0)
|
||||
if(fchown(dest_desc, (uid_t) - 1, sb.st_gid) != 0)
|
||||
log_error("Failed to chown %s: %m", dst);
|
||||
if(fchown(dest_desc, (uid_t) - 1, sb.st_gid) != 0) {
|
||||
if (geteuid() == 0)
|
||||
log_error("Failed to chown %s: %m", dst);
|
||||
else
|
||||
log_info("Failed to chown %s: %m", dst);
|
||||
}
|
||||
|
||||
tv[0].tv_sec = sb.st_atime;
|
||||
tv[0].tv_usec = 0;
|
||||
tv[1].tv_sec = sb.st_mtime;
|
||||
@@ -242,16 +300,24 @@ static int cp(const char *src, const char *dst)
|
||||
normal_copy:
|
||||
pid = fork();
|
||||
if (pid == 0) {
|
||||
execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode,timestamps", "-fL", src, dst,
|
||||
NULL);
|
||||
if (geteuid() == 0)
|
||||
execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode,xattr,timestamps", "-fL", src, dst,
|
||||
NULL);
|
||||
else
|
||||
execlp("cp", "cp", "--reflink=auto", "--sparse=auto", "--preserve=mode,timestamps", "-fL", src, dst,
|
||||
NULL);
|
||||
_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
while (waitpid(pid, &ret, 0) < 0) {
|
||||
if (errno != EINTR) {
|
||||
ret = -1;
|
||||
log_error("Failed: cp --reflink=auto --sparse=auto --preserve=mode,timestamps -fL %s %s", src,
|
||||
dst);
|
||||
if (geteuid() == 0)
|
||||
log_error("Failed: cp --reflink=auto --sparse=auto --preserve=mode,xattr,timestamps -fL %s %s", src,
|
||||
dst);
|
||||
else
|
||||
log_error("Failed: cp --reflink=auto --sparse=auto --preserve=mode,timestamps -fL %s %s", src,
|
||||
dst);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -287,7 +353,7 @@ static int library_install(const char *src, const char *lib)
|
||||
|
||||
/* Also try to install the same library from one directory above.
|
||||
This fixes the case, where only the HWCAP lib would be installed
|
||||
# ldconfig -p|fgrep libc.so
|
||||
# ldconfig -p|grep -F libc.so
|
||||
libc.so.6 (libc6,64bit, hwcap: 0x0000001000000000, OS ABI: Linux 2.6.32) => /lib64/power6/libc.so.6
|
||||
libc.so.6 (libc6,64bit, hwcap: 0x0000000000000200, OS ABI: Linux 2.6.32) => /lib64/power6x/libc.so.6
|
||||
libc.so.6 (libc6,64bit, OS ABI: Linux 2.6.32) => /lib64/libc.so.6
|
||||
@@ -393,6 +459,9 @@ static int resolve_deps(const char *src)
|
||||
break;
|
||||
|
||||
/* glibc */
|
||||
if (strstr(buf, "cannot execute binary file"))
|
||||
break;
|
||||
|
||||
if (strstr(buf, "not a dynamic executable"))
|
||||
break;
|
||||
|
||||
@@ -513,6 +582,18 @@ void dracut_log_cp(const char *path)
|
||||
log_error("Could not append '%s' to logfile '%s': %m", path, logfile);
|
||||
}
|
||||
|
||||
static bool check_hashmap(Hashmap *hm, const char *item)
|
||||
{
|
||||
char *existing;
|
||||
existing = hashmap_get(hm, item);
|
||||
if (existing) {
|
||||
if (strcmp(existing, item) == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static int dracut_install(const char *src, const char *dst, bool isdir, bool resolvedeps, bool hashdst)
|
||||
{
|
||||
struct stat sb, db;
|
||||
@@ -521,26 +602,17 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
int ret;
|
||||
bool src_exists = true;
|
||||
char *i = NULL;
|
||||
char *existing;
|
||||
|
||||
log_debug("dracut_install('%s', '%s')", src, dst);
|
||||
|
||||
existing = hashmap_get(items_failed, src);
|
||||
if (existing) {
|
||||
if (strcmp(existing, src) == 0) {
|
||||
log_debug("hash hit items_failed for '%s'", src);
|
||||
return 1;
|
||||
}
|
||||
if (check_hashmap(items_failed, src)) {
|
||||
log_debug("hash hit items_failed for '%s'", src);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (hashdst) {
|
||||
existing = hashmap_get(items, dst);
|
||||
if (existing) {
|
||||
if (strcmp(existing, dst) == 0) {
|
||||
log_debug("hash hit items for '%s'", dst);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (hashdst && check_hashmap(items, dst)) {
|
||||
log_debug("hash hit items for '%s'", dst);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (lstat(src, &sb) < 0) {
|
||||
@@ -559,7 +631,7 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
|
||||
hashmap_put(items, i, i);
|
||||
|
||||
ret = asprintf(&fulldstpath, "%s%s", destrootdir, dst);
|
||||
ret = asprintf(&fulldstpath, "%s/%s", destrootdir, dst);
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
@@ -646,7 +718,7 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
if (lstat(fulldstpath, &sb) != 0) {
|
||||
_cleanup_free_ char *absdestpath = NULL;
|
||||
|
||||
ret = asprintf(&absdestpath, "%s%s", destrootdir, abspath);
|
||||
ret = asprintf(&absdestpath, "%s/%s", destrootdir, abspath);
|
||||
if (ret < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
@@ -675,7 +747,7 @@ static int dracut_install(const char *src, const char *dst, bool isdir, bool res
|
||||
log_debug("dracut_install ret = %d", ret);
|
||||
log_info("cp '%s' '%s'", src, fulldstpath);
|
||||
|
||||
if (arg_hostonly)
|
||||
if (arg_hostonly && !arg_module)
|
||||
mark_hostonly(dst);
|
||||
|
||||
ret += cp(src, fulldstpath);
|
||||
@@ -695,48 +767,46 @@ static void item_free(char *i)
|
||||
|
||||
static void usage(int status)
|
||||
{
|
||||
/* */
|
||||
/* */
|
||||
printf("Usage: %s -D DESTROOTDIR [OPTION]... -a SOURCE...\n"
|
||||
"or: %s -D DESTROOTDIR [OPTION]... SOURCE DEST\n"
|
||||
"or: %s -D DESTROOTDIR [OPTION]... -m KERNELMODULE [KERNELMODULE …]\n"
|
||||
"\n"
|
||||
"Install SOURCE to DEST in DESTROOTDIR with all needed dependencies.\n"
|
||||
"\n"
|
||||
" -D --destrootdir Install all files to DESTROOTDIR as the root\n"
|
||||
" -a --all Install all SOURCE arguments to DESTROOTDIR\n"
|
||||
" -o --optional If SOURCE does not exist, do not fail\n"
|
||||
" -d --dir SOURCE is a directory\n"
|
||||
" -l --ldd Also install shebang executables and libraries\n"
|
||||
" -L --logdir <DIR> Log files, which were installed from the host to <DIR>\n"
|
||||
" -R --resolvelazy Only install shebang executables and libraries\n"
|
||||
" for all SOURCE files\n"
|
||||
" -H --fips Also install all '.SOURCE.hmac' files\n"
|
||||
" -v --verbose Show more output\n"
|
||||
" --debug Show debug output\n"
|
||||
" --version Show package version\n"
|
||||
" -h --help Show this help\n"
|
||||
" KERNELMODULE can have the format:\n"
|
||||
" <absolute path> with a leading /\n"
|
||||
" =<kernel subdir>[/<kernel subdir>…] like '=drivers/hid'\n"
|
||||
" <module name>\n"
|
||||
"\n"
|
||||
"Example:\n"
|
||||
"# mkdir -p /var/tmp/test-root\n"
|
||||
"# %s -D /var/tmp/test-root --ldd -a sh tr\n"
|
||||
"# tree /var/tmp/test-root\n"
|
||||
"/var/tmp/test-root\n"
|
||||
"|-- lib64 -> usr/lib64\n"
|
||||
"`-- usr\n"
|
||||
" |-- bin\n"
|
||||
" | |-- bash\n"
|
||||
" | |-- sh -> bash\n"
|
||||
" | `-- tr\n"
|
||||
" `-- lib64\n"
|
||||
" |-- ld-2.15.90.so\n"
|
||||
" |-- ld-linux-x86-64.so.2 -> ld-2.15.90.so\n"
|
||||
" |-- libc-2.15.90.so\n"
|
||||
" |-- libc.so\n"
|
||||
" |-- libc.so.6 -> libc-2.15.90.so\n"
|
||||
" |-- libdl-2.15.90.so\n"
|
||||
" |-- libdl.so -> libdl-2.15.90.so\n"
|
||||
" |-- libdl.so.2 -> libdl-2.15.90.so\n"
|
||||
" |-- libtinfo.so.5 -> libtinfo.so.5.9\n"
|
||||
" `-- libtinfo.so.5.9\n", program_invocation_short_name, program_invocation_short_name,
|
||||
" -D --destrootdir Install all files to DESTROOTDIR as the root\n"
|
||||
" -a --all Install all SOURCE arguments to DESTROOTDIR\n"
|
||||
" -o --optional If SOURCE does not exist, do not fail\n"
|
||||
" -d --dir SOURCE is a directory\n"
|
||||
" -l --ldd Also install shebang executables and libraries\n"
|
||||
" -L --logdir <DIR> Log files, which were installed from the host to <DIR>\n"
|
||||
" -R --resolvelazy Only install shebang executables and libraries\n"
|
||||
" for all SOURCE files\n"
|
||||
" -H --hostonly Mark all SOURCE files as hostonly\n\n"
|
||||
" -f --fips Also install all '.SOURCE.hmac' files\n"
|
||||
"\n"
|
||||
" --module,-m Install kernel modules, instead of files\n"
|
||||
" --kerneldir Specify the kernel module directory\n"
|
||||
" --firmwaredirs Specify the firmware directory search path with : separation\n"
|
||||
" --silent Don't display error messages for kernel module install\n"
|
||||
" -o --optional If kernel module does not exist, do not fail\n"
|
||||
" -p --mod-filter-path Filter kernel modules by path regexp\n"
|
||||
" -P --mod-filter-nopath Exclude kernel modules by path regexp\n"
|
||||
" -s --mod-filter-symbol Filter kernel modules by symbol regexp\n"
|
||||
" -S --mod-filter-nosymbol Exclude kernel modules by symbol regexp\n"
|
||||
" -N --mod-filter-noname Exclude kernel modules by name regexp\n"
|
||||
"\n"
|
||||
" -v --verbose Show more output\n"
|
||||
" --debug Show debug output\n"
|
||||
" --version Show package version\n"
|
||||
" -h --help Show this help\n"
|
||||
"\n",
|
||||
program_invocation_short_name, program_invocation_short_name,
|
||||
program_invocation_short_name);
|
||||
exit(status);
|
||||
}
|
||||
@@ -747,6 +817,9 @@ static int parse_argv(int argc, char *argv[])
|
||||
|
||||
enum {
|
||||
ARG_VERSION = 0x100,
|
||||
ARG_SILENT,
|
||||
ARG_KERNELDIR,
|
||||
ARG_FIRMWAREDIRS,
|
||||
ARG_DEBUG
|
||||
};
|
||||
|
||||
@@ -761,13 +834,22 @@ static int parse_argv(int argc, char *argv[])
|
||||
{"optional", no_argument, NULL, 'o'},
|
||||
{"hostonly", no_argument, NULL, 'H'},
|
||||
{"all", no_argument, NULL, 'a'},
|
||||
{"module", no_argument, NULL, 'm'},
|
||||
{"fips", no_argument, NULL, 'f'},
|
||||
{"destrootdir", required_argument, NULL, 'D'},
|
||||
{"logdir", required_argument, NULL, 'L'},
|
||||
{"mod-filter-path", required_argument, NULL, 'p'},
|
||||
{"mod-filter-nopath", required_argument, NULL, 'P'},
|
||||
{"mod-filter-symbol", required_argument, NULL, 's'},
|
||||
{"mod-filter-nosymbol", required_argument, NULL, 'S'},
|
||||
{"mod-filter-noname", required_argument, NULL, 'N'},
|
||||
{"silent", no_argument, NULL, ARG_SILENT},
|
||||
{"kerneldir", required_argument, NULL, ARG_KERNELDIR},
|
||||
{"firmwaredirs", required_argument, NULL, ARG_FIRMWAREDIRS},
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
while ((c = getopt_long(argc, argv, "adfhlL:oD:HR", options, NULL)) != -1) {
|
||||
while ((c = getopt_long(argc, argv, "madfhlL:oD:HRp:P:s:S:N:", options, NULL)) != -1) {
|
||||
switch (c) {
|
||||
case ARG_VERSION:
|
||||
puts(PROGRAM_VERSION_STRING);
|
||||
@@ -778,6 +860,9 @@ static int parse_argv(int argc, char *argv[])
|
||||
case ARG_DEBUG:
|
||||
arg_loglevel = LOG_DEBUG;
|
||||
break;
|
||||
case ARG_SILENT:
|
||||
arg_silent = true;
|
||||
break;
|
||||
case 'v':
|
||||
arg_loglevel = LOG_INFO;
|
||||
break;
|
||||
@@ -793,12 +878,63 @@ static int parse_argv(int argc, char *argv[])
|
||||
case 'a':
|
||||
arg_all = true;
|
||||
break;
|
||||
case 'm':
|
||||
arg_module = true;
|
||||
break;
|
||||
case 'D':
|
||||
destrootdir = strdup(optarg);
|
||||
break;
|
||||
case 'p':
|
||||
if (regcomp(&mod_filter_path, optarg, REG_NOSUB|REG_EXTENDED) != 0) {
|
||||
log_error("Module path filter %s is not a regular expression", optarg);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
arg_mod_filter_path = true;
|
||||
break;
|
||||
case 'P':
|
||||
if (regcomp(&mod_filter_nopath, optarg, REG_NOSUB|REG_EXTENDED) != 0) {
|
||||
log_error("Module path filter %s is not a regular expression", optarg);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
arg_mod_filter_nopath = true;
|
||||
break;
|
||||
case 's':
|
||||
if (regcomp(&mod_filter_symbol, optarg, REG_NOSUB|REG_EXTENDED) != 0) {
|
||||
log_error("Module symbol filter %s is not a regular expression", optarg);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
arg_mod_filter_symbol = true;
|
||||
break;
|
||||
case 'S':
|
||||
if (regcomp(&mod_filter_nosymbol, optarg, REG_NOSUB|REG_EXTENDED) != 0) {
|
||||
log_error("Module symbol filter %s is not a regular expression", optarg);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
arg_mod_filter_nosymbol = true;
|
||||
break;
|
||||
case 'N':
|
||||
if (regcomp(&mod_filter_noname, optarg, REG_NOSUB|REG_EXTENDED) != 0) {
|
||||
log_error("Module symbol filter %s is not a regular expression", optarg);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
arg_mod_filter_noname = true;
|
||||
break;
|
||||
case 'L':
|
||||
logdir = strdup(optarg);
|
||||
break;
|
||||
case ARG_KERNELDIR:
|
||||
kerneldir = strdup(optarg);
|
||||
if ((strncmp("/lib/modules/", kerneldir, 13) != 0)
|
||||
&& (strncmp("/usr/lib/modules/", kerneldir, 17) != 0)) {
|
||||
char *p;
|
||||
p = strstr(kerneldir, "/lib/modules/");
|
||||
if (p != NULL)
|
||||
kerneldirlen = p - kerneldir;
|
||||
}
|
||||
break;
|
||||
case ARG_FIRMWAREDIRS:
|
||||
firmwaredirs = strv_split(optarg, ":");
|
||||
break;
|
||||
case 'f':
|
||||
arg_hmac = true;
|
||||
break;
|
||||
@@ -813,6 +949,22 @@ static int parse_argv(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (arg_module) {
|
||||
if (!firmwaredirs) {
|
||||
char *path = NULL;
|
||||
|
||||
path = getenv("DRACUT_FIRMWARE_PATH");
|
||||
|
||||
if (path == NULL) {
|
||||
log_error("Environment variable DRACUT_FIRMWARE_PATH is not set");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
log_debug("DRACUT_FIRMWARE_PATH=%s", path);
|
||||
|
||||
firmwaredirs = strv_split(path, ":");
|
||||
}
|
||||
}
|
||||
if (!optind || optind == argc) {
|
||||
log_error("No SOURCE argument given");
|
||||
usage(EXIT_FAILURE);
|
||||
@@ -854,24 +1006,11 @@ static int resolve_lazy(int argc, char **argv)
|
||||
|
||||
static char **find_binary(const char *src)
|
||||
{
|
||||
char *path = NULL;
|
||||
_cleanup_strv_free_ char **p = NULL;
|
||||
char **ret = NULL;
|
||||
char **q;
|
||||
char *newsrc = NULL;
|
||||
|
||||
path = getenv("PATH");
|
||||
|
||||
if (path == NULL) {
|
||||
log_error("PATH is not set");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
log_debug("PATH=%s", path);
|
||||
|
||||
p = strv_split(path, ":");
|
||||
|
||||
STRV_FOREACH(q, p) {
|
||||
STRV_FOREACH(q, pathdirs) {
|
||||
struct stat sb;
|
||||
int r;
|
||||
|
||||
@@ -972,10 +1111,458 @@ static int install_all(int argc, char **argv)
|
||||
return r;
|
||||
}
|
||||
|
||||
static int install_firmware(struct kmod_module *mod)
|
||||
{
|
||||
struct kmod_list *l;
|
||||
_cleanup_kmod_module_info_free_list_ struct kmod_list *list = NULL;
|
||||
int ret;
|
||||
|
||||
char **q;
|
||||
|
||||
ret = kmod_module_get_info(mod, &list);
|
||||
if (ret < 0) {
|
||||
log_error("could not get modinfo from '%s': %s\n",
|
||||
kmod_module_get_name(mod), strerror(-ret));
|
||||
return ret;
|
||||
}
|
||||
kmod_list_foreach(l, list) {
|
||||
const char *key = kmod_module_info_get_key(l);
|
||||
const char *value = NULL;
|
||||
|
||||
if (!streq("firmware", key))
|
||||
continue;
|
||||
|
||||
value = kmod_module_info_get_value(l);
|
||||
log_debug("Firmware %s", value);
|
||||
ret = -1;
|
||||
STRV_FOREACH(q, firmwaredirs) {
|
||||
_cleanup_free_ char *fwpath = NULL;
|
||||
struct stat sb;
|
||||
int r;
|
||||
|
||||
r = asprintf(&fwpath, "%s/%s", *q, value);
|
||||
if (r < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (stat(fwpath, &sb) != 0) {
|
||||
log_debug("stat(%s) != 0", fwpath);
|
||||
continue;
|
||||
}
|
||||
|
||||
ret = dracut_install(fwpath, fwpath, false, false, true);
|
||||
if (ret == 0)
|
||||
log_debug("dracut_install '%s' OK", fwpath);
|
||||
}
|
||||
|
||||
if (ret != 0) {
|
||||
log_info("Possible missing firmware %s for kernel module %s", value, kmod_module_get_name(mod));
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool check_module_symbols(struct kmod_module *mod)
|
||||
{
|
||||
struct kmod_list *itr;
|
||||
_cleanup_kmod_module_dependency_symbols_free_list_ struct kmod_list *deplist = NULL;
|
||||
|
||||
if (!arg_mod_filter_symbol && !arg_mod_filter_nosymbol)
|
||||
return true;
|
||||
|
||||
if (kmod_module_get_dependency_symbols(mod, &deplist) < 0) {
|
||||
log_debug("kmod_module_get_dependency_symbols failed");
|
||||
if (arg_mod_filter_symbol)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (arg_mod_filter_nosymbol) {
|
||||
kmod_list_foreach(itr, deplist) {
|
||||
const char *symbol = kmod_module_symbol_get_symbol(itr);
|
||||
// log_debug("Checking symbol %s", symbol);
|
||||
if (regexec(&mod_filter_nosymbol, symbol, 0, NULL, 0) == 0) {
|
||||
log_debug("Module %s: symbol %s matched exclusion filter", kmod_module_get_name(mod), symbol);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (arg_mod_filter_symbol) {
|
||||
kmod_list_foreach(itr, deplist) {
|
||||
const char *symbol = kmod_module_dependency_symbol_get_symbol(itr);
|
||||
// log_debug("Checking symbol %s", symbol);
|
||||
if (regexec(&mod_filter_symbol, symbol, 0, NULL, 0) == 0) {
|
||||
log_debug("Module %s: symbol %s matched inclusion filter", kmod_module_get_name(mod), symbol);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool check_module_path(const char *path)
|
||||
{
|
||||
if (arg_mod_filter_nopath && (regexec(&mod_filter_nopath, path, 0, NULL, 0) == 0)) {
|
||||
log_debug("Path %s matched exclusion filter", path);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (arg_mod_filter_path && (regexec(&mod_filter_path, path, 0, NULL, 0) != 0)) {
|
||||
log_debug("Path %s matched inclusion filter", path);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool check_module_hostonly(struct kmod_module *mod)
|
||||
{
|
||||
const char *name = kmod_module_get_name(mod);
|
||||
|
||||
if (check_hashmap(modules_loaded, name))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static int install_module(struct kmod_module *mod)
|
||||
{
|
||||
int ret = 0;
|
||||
struct kmod_list *itr;
|
||||
_cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL;
|
||||
const char *path = NULL;
|
||||
const char *name = NULL;
|
||||
|
||||
name = kmod_module_get_name(mod);
|
||||
if (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0)) {
|
||||
log_debug("dracut_install '%s' is excluded", name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (arg_hostonly && ! check_module_hostonly(mod)) {
|
||||
log_debug("dracut_install '%s' not hostonly", name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
path = kmod_module_get_path(mod);
|
||||
if (!path)
|
||||
return -ENOENT;
|
||||
|
||||
if (check_hashmap(items_failed, path))
|
||||
return -1;
|
||||
|
||||
if (check_hashmap(items, path))
|
||||
return 0;
|
||||
|
||||
if (!check_module_path(path) || !check_module_symbols(mod)) {
|
||||
log_debug("No symbol or patch match for '%s'", path);
|
||||
return 1;
|
||||
}
|
||||
|
||||
log_debug("dracut_install '%s' '%s'", path, &path[kerneldirlen]);
|
||||
|
||||
ret = dracut_install(path, &path[kerneldirlen], false, false, true);
|
||||
if (ret == 0) {
|
||||
log_debug("dracut_install '%s' OK", kmod_module_get_name(mod));
|
||||
} else if (!arg_optional) {
|
||||
if (!arg_silent)
|
||||
log_error("dracut_install '%s' ERROR", kmod_module_get_name(mod));
|
||||
return ret;
|
||||
}
|
||||
install_firmware(mod);
|
||||
|
||||
modlist = kmod_module_get_dependencies(mod);
|
||||
kmod_list_foreach(itr, modlist) {
|
||||
mod = kmod_module_get_module(itr);
|
||||
path = kmod_module_get_path(mod);
|
||||
|
||||
name = kmod_module_get_name(mod);
|
||||
if (arg_mod_filter_noname && (regexec(&mod_filter_noname, name, 0, NULL, 0) == 0)) {
|
||||
kmod_module_unref(mod);
|
||||
continue;
|
||||
}
|
||||
ret = dracut_install(path, &path[kerneldirlen], false, false, true);
|
||||
if (ret == 0) {
|
||||
log_debug("dracut_install '%s' '%s' OK", path, &path[kerneldirlen]);
|
||||
install_firmware(mod);
|
||||
} else {
|
||||
log_error("dracut_install '%s' '%s' ERROR", path, &path[kerneldirlen]);
|
||||
}
|
||||
kmod_module_unref(mod);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int install_modules(int argc, char **argv)
|
||||
{
|
||||
_cleanup_kmod_unref_ struct kmod_ctx *ctx = NULL;
|
||||
struct kmod_list *loaded_list = NULL;
|
||||
struct kmod_list *itr, *l;
|
||||
int err;
|
||||
|
||||
struct kmod_module *mod = NULL, *mod_o = NULL;
|
||||
|
||||
const char *modname = NULL;
|
||||
int i;
|
||||
|
||||
ctx = kmod_new(kerneldir, NULL);
|
||||
if (arg_hostonly) {
|
||||
err = kmod_module_new_from_loaded(ctx, &loaded_list);
|
||||
if (err < 0) {
|
||||
errno = err;
|
||||
log_error("Could not get list of loaded modules: %m. Switching to non-hostonly mode.");
|
||||
arg_hostonly = false;
|
||||
} else {
|
||||
kmod_list_foreach(itr, loaded_list) {
|
||||
_cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL;
|
||||
|
||||
struct kmod_module *mod = kmod_module_get_module(itr);
|
||||
char *name = strdup(kmod_module_get_name(mod));
|
||||
hashmap_put(modules_loaded, name, name);
|
||||
kmod_module_unref(mod);
|
||||
|
||||
/* also put the modules from the new kernel in the hashmap,
|
||||
* which resolve the name as an alias, in case a kernel module is
|
||||
* renamed.
|
||||
*/
|
||||
err = kmod_module_new_from_lookup(ctx, name, &modlist);
|
||||
if (err < 0)
|
||||
continue;
|
||||
if (!modlist)
|
||||
continue;
|
||||
kmod_list_foreach(l, modlist) {
|
||||
mod = kmod_module_get_module(l);
|
||||
char *name = strdup(kmod_module_get_name(mod));
|
||||
hashmap_put(modules_loaded, name, name);
|
||||
kmod_module_unref(mod);
|
||||
}
|
||||
}
|
||||
kmod_module_unref_list(loaded_list);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
int r = 0;
|
||||
int ret = -1;
|
||||
|
||||
log_debug("Handle module '%s'", argv[i]);
|
||||
|
||||
if (argv[i][0] == '/') {
|
||||
_cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL;
|
||||
|
||||
r = kmod_module_new_from_path(ctx, argv[i], &mod_o);
|
||||
if (r < 0) {
|
||||
log_debug("Failed to lookup modules path '%s': %m", argv[i]);
|
||||
if (!arg_optional)
|
||||
return -ENOENT;
|
||||
continue;
|
||||
}
|
||||
/* Check, if we have to load another module with that name instead */
|
||||
modname = kmod_module_get_name(mod_o);
|
||||
|
||||
if (!modname) {
|
||||
if (!arg_optional) {
|
||||
if (!arg_silent)
|
||||
log_error("Failed to get name for module '%s'", argv[i]);
|
||||
return -ENOENT;
|
||||
}
|
||||
log_info("Failed to get name for module '%s'", argv[i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
r = kmod_module_new_from_lookup(ctx, modname, &modlist);
|
||||
kmod_module_unref(mod_o);
|
||||
mod_o = NULL;
|
||||
|
||||
if (r < 0) {
|
||||
if (!arg_optional) {
|
||||
if (!arg_silent)
|
||||
log_error("3 Failed to lookup alias '%s': %d", modname, r);
|
||||
return -ENOENT;
|
||||
}
|
||||
log_info("3 Failed to lookup alias '%s': %d", modname, r);
|
||||
continue;
|
||||
}
|
||||
if (!modlist) {
|
||||
if (!arg_optional) {
|
||||
if (!arg_silent)
|
||||
log_error("Failed to find module '%s' %s", modname, argv[i]);
|
||||
return -ENOENT;
|
||||
}
|
||||
log_info("Failed to find module '%s' %s", modname, argv[i]);
|
||||
continue;
|
||||
}
|
||||
kmod_list_foreach(itr, modlist) {
|
||||
mod = kmod_module_get_module(itr);
|
||||
r = install_module(mod);
|
||||
kmod_module_unref(mod);
|
||||
if ((r < 0) && !arg_optional) {
|
||||
if (!arg_silent)
|
||||
log_error("ERROR: installing module '%s'", modname);
|
||||
return -ENOENT;
|
||||
};
|
||||
ret = ( ret == 0 ? 0 : r );
|
||||
}
|
||||
} else if (argv[i][0] == '=') {
|
||||
_cleanup_free_ char *path1 = NULL, *path2 = NULL, *path3 = NULL;
|
||||
_cleanup_fts_close_ FTS *fts = NULL;
|
||||
|
||||
log_debug("Handling =%s", &argv[i][1]);
|
||||
/* FIXME and add more paths*/
|
||||
r = asprintf(&path2, "%s/kernel/%s", kerneldir, &argv[i][1]);
|
||||
if (r < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
r = asprintf(&path1, "%s/extra/%s", kerneldir, &argv[i][1]);
|
||||
if (r < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
r = asprintf(&path3, "%s/updates/%s", kerneldir, &argv[i][1]);
|
||||
if (r < 0) {
|
||||
log_error("Out of memory!");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
{
|
||||
char *paths[] = { path1, path2, path3, NULL };
|
||||
fts = fts_open(paths, FTS_COMFOLLOW|FTS_NOCHDIR|FTS_NOSTAT|FTS_LOGICAL, NULL);
|
||||
}
|
||||
|
||||
for (FTSENT *ftsent = fts_read(fts); ftsent != NULL; ftsent = fts_read(fts)) {
|
||||
_cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL;
|
||||
|
||||
if((ftsent->fts_info == FTS_D) && !check_module_path(ftsent->fts_accpath)) {
|
||||
fts_set(fts, ftsent, FTS_SKIP);
|
||||
log_debug("Skipping %s", ftsent->fts_accpath);
|
||||
continue;
|
||||
}
|
||||
if((ftsent->fts_info != FTS_F) && (ftsent->fts_info != FTS_SL)) {
|
||||
log_debug("Ignoring %s", ftsent->fts_accpath);
|
||||
continue;
|
||||
}
|
||||
log_debug("Handling %s", ftsent->fts_accpath);
|
||||
r = kmod_module_new_from_path(ctx, ftsent->fts_accpath, &mod_o);
|
||||
if (r < 0) {
|
||||
log_debug("Failed to lookup modules path '%s': %m",
|
||||
ftsent->fts_accpath);
|
||||
if (!arg_optional) {
|
||||
return -ENOENT;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Check, if we have to load another module with that name instead */
|
||||
modname = kmod_module_get_name(mod_o);
|
||||
|
||||
if (!modname) {
|
||||
log_error("Failed to get name for module '%s'", ftsent->fts_accpath);
|
||||
if (!arg_optional) {
|
||||
return -ENOENT;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
r = kmod_module_new_from_lookup(ctx, modname, &modlist);
|
||||
kmod_module_unref(mod_o);
|
||||
mod_o = NULL;
|
||||
|
||||
if (r < 0) {
|
||||
log_error("Failed to lookup alias '%s': %m", modname);
|
||||
if (!arg_optional) {
|
||||
return -ENOENT;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!modlist) {
|
||||
log_error("Failed to find module '%s' %s", modname,
|
||||
ftsent->fts_accpath);
|
||||
if (!arg_optional) {
|
||||
return -ENOENT;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
kmod_list_foreach(itr, modlist) {
|
||||
mod = kmod_module_get_module(itr);
|
||||
r = install_module(mod);
|
||||
kmod_module_unref(mod);
|
||||
if ((r < 0) && !arg_optional) {
|
||||
if (!arg_silent)
|
||||
log_error("ERROR: installing module '%s'", modname);
|
||||
return -ENOENT;
|
||||
};
|
||||
ret = ( ret == 0 ? 0 : r );
|
||||
}
|
||||
}
|
||||
if (errno) {
|
||||
log_error("FTS ERROR: %m");
|
||||
}
|
||||
} else {
|
||||
_cleanup_kmod_module_unref_list_ struct kmod_list *modlist = NULL;
|
||||
char *modname = argv[i];
|
||||
|
||||
if (endswith(modname, ".ko")) {
|
||||
int len = strlen(modname);
|
||||
modname[len-3]=0;
|
||||
}
|
||||
if (endswith(modname, ".ko.xz") || endswith(modname, ".ko.gz")) {
|
||||
int len = strlen(modname);
|
||||
modname[len-6]=0;
|
||||
}
|
||||
r = kmod_module_new_from_lookup(ctx, modname, &modlist);
|
||||
if (r < 0) {
|
||||
if (!arg_optional) {
|
||||
if (!arg_silent)
|
||||
log_error("Failed to lookup alias '%s': %m", modname);
|
||||
return -ENOENT;
|
||||
}
|
||||
log_info("Failed to lookup alias '%s': %m", modname);
|
||||
continue;
|
||||
}
|
||||
if (!modlist) {
|
||||
if (!arg_optional) {
|
||||
if (!arg_silent)
|
||||
log_error("Failed to find module '%s'", modname);
|
||||
return -ENOENT;
|
||||
}
|
||||
log_info("Failed to find module '%s'", modname);
|
||||
continue;
|
||||
}
|
||||
kmod_list_foreach(itr, modlist) {
|
||||
mod = kmod_module_get_module(itr);
|
||||
r = install_module(mod);
|
||||
kmod_module_unref(mod);
|
||||
if ((r < 0) && !arg_optional) {
|
||||
if (!arg_silent)
|
||||
log_error("ERROR: installing '%s'", argv[i]);
|
||||
return -ENOENT;
|
||||
};
|
||||
ret = ( ret == 0 ? 0 : r );
|
||||
}
|
||||
}
|
||||
|
||||
if ((ret != 0) && (!arg_optional)) {
|
||||
if (!arg_silent)
|
||||
log_error("ERROR: installing '%s'", argv[i]);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int r;
|
||||
char *i;
|
||||
char *path = NULL;
|
||||
|
||||
r = parse_argv(argc, argv);
|
||||
if (r <= 0)
|
||||
@@ -989,6 +1576,17 @@ int main(int argc, char **argv)
|
||||
|
||||
log_open();
|
||||
|
||||
path = getenv("PATH");
|
||||
|
||||
if (path == NULL) {
|
||||
log_error("PATH is not set");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
log_debug("PATH=%s", path);
|
||||
|
||||
pathdirs = strv_split(path, ":");
|
||||
|
||||
umask(0022);
|
||||
|
||||
if (destrootdir == NULL || strlen(destrootdir) == 0) {
|
||||
@@ -1016,8 +1614,9 @@ int main(int argc, char **argv)
|
||||
|
||||
items = hashmap_new(string_hash_func, string_compare_func);
|
||||
items_failed = hashmap_new(string_hash_func, string_compare_func);
|
||||
modules_loaded = hashmap_new(string_hash_func, string_compare_func);
|
||||
|
||||
if (!items || !items_failed) {
|
||||
if (!items || !items_failed || !modules_loaded) {
|
||||
log_error("Out of memory");
|
||||
r = EXIT_FAILURE;
|
||||
goto finish;
|
||||
@@ -1055,7 +1654,9 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (arg_resolvelazy) {
|
||||
if (arg_module) {
|
||||
r = install_modules(argc - optind, &argv[optind]);
|
||||
} else if (arg_resolvelazy) {
|
||||
r = resolve_lazy(argc - optind, &argv[optind]);
|
||||
} else if (arg_all || (argc - optind > 2) || ((argc - optind) == 1)) {
|
||||
r = install_all(argc - optind, &argv[optind]);
|
||||
@@ -1071,6 +1672,9 @@ int main(int argc, char **argv)
|
||||
if (logfile_f)
|
||||
fclose(logfile_f);
|
||||
|
||||
while ((i = hashmap_steal_first(modules_loaded)))
|
||||
item_free(i);
|
||||
|
||||
while ((i = hashmap_steal_first(items)))
|
||||
item_free(i);
|
||||
|
||||
@@ -1079,8 +1683,10 @@ int main(int argc, char **argv)
|
||||
|
||||
hashmap_free(items);
|
||||
hashmap_free(items_failed);
|
||||
hashmap_free(modules_loaded);
|
||||
|
||||
free(destrootdir);
|
||||
|
||||
strv_free(firmwaredirs);
|
||||
strv_free(pathdirs);
|
||||
return r;
|
||||
}
|
||||
|
@@ -34,6 +34,15 @@ OPTIONS
|
||||
**-k, --kver** _<kernel version>_::
|
||||
inspect the initramfs of <kernel version>.
|
||||
|
||||
**--unpack**::
|
||||
unpack the initramfs to the current directory, instead of displaying the contents.
|
||||
|
||||
**--unpackearly**::
|
||||
unpack the early microcode initramfs to the current directory, instead of displaying the contents.
|
||||
|
||||
**-v, --verbose**::
|
||||
unpack verbosely
|
||||
|
||||
AVAILABILITY
|
||||
------------
|
||||
The lsinitrd command is part of the dracut package and is available from
|
||||
|
109
lsinitrd.sh
109
lsinitrd.sh
@@ -27,6 +27,9 @@ usage()
|
||||
echo "-s, --size sort the contents of the initramfs by size."
|
||||
echo "-m, --mod list modules."
|
||||
echo "-f, --file <filename> print the contents of <filename>."
|
||||
echo "--unpack unpack the initramfs, instead of displaying the contents."
|
||||
echo "--unpackearly unpack the early microcode part of the initramfs."
|
||||
echo "-v, --verbose unpack verbosely."
|
||||
echo "-k, --kver <kernel version> inspect the initramfs of <kernel version>."
|
||||
echo
|
||||
} >&2
|
||||
@@ -37,16 +40,20 @@ usage()
|
||||
|
||||
sorted=0
|
||||
modules=0
|
||||
unset verbose
|
||||
declare -A filenames
|
||||
|
||||
unset POSIXLY_CORRECT
|
||||
TEMP=$(getopt \
|
||||
-o "shmf:k:" \
|
||||
-o "vshmf:k:" \
|
||||
--long kver: \
|
||||
--long file: \
|
||||
--long mod \
|
||||
--long help \
|
||||
--long size \
|
||||
--long unpack \
|
||||
--long unpackearly \
|
||||
--long verbose \
|
||||
-- "$@")
|
||||
|
||||
if (( $? != 0 )); then
|
||||
@@ -58,13 +65,16 @@ 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;;
|
||||
-m|--mod) modules=1;;
|
||||
--) shift;break;;
|
||||
*) usage; exit 1;;
|
||||
-k|--kver) KERNEL_VERSION="$2"; shift;;
|
||||
-f|--file) filenames[${2#/}]=1; shift;;
|
||||
-s|--size) sorted=1;;
|
||||
-h|--help) usage; exit 0;;
|
||||
-m|--mod) modules=1;;
|
||||
-v|--verbose) verbose="--verbose";;
|
||||
--unpack) unpack=1;;
|
||||
--unpackearly) unpackearly=1;;
|
||||
--) shift;break;;
|
||||
*) usage; exit 1;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
@@ -117,7 +127,7 @@ dracutlibdirs() {
|
||||
extract_files()
|
||||
{
|
||||
(( ${#filenames[@]} == 1 )) && nofileinfo=1
|
||||
for f in ${!filenames[@]}; do
|
||||
for f in "${!filenames[@]}"; do
|
||||
[[ $nofileinfo ]] || echo "initramfs:/$f"
|
||||
[[ $nofileinfo ]] || echo "========================================================================"
|
||||
$CAT $image | cpio --extract --verbose --quiet --to-stdout $f 2>/dev/null
|
||||
@@ -147,8 +157,14 @@ list_files()
|
||||
echo "========================================================================"
|
||||
}
|
||||
|
||||
unpack_files()
|
||||
{
|
||||
$CAT "$image" | cpio -id --quiet $verbose
|
||||
((ret+=$?))
|
||||
}
|
||||
|
||||
if (( ${#filenames[@]} <= 0 )); then
|
||||
|
||||
if (( ${#filenames[@]} <= 0 )) && [[ -z "$unpack" ]] && [[ -z "$unpackearly" ]]; then
|
||||
echo "Image: $image: $(du -h $image | while read a b || [ -n "$a" ]; do echo $a;done)"
|
||||
echo "========================================================================"
|
||||
fi
|
||||
@@ -159,13 +175,19 @@ case $bin in
|
||||
CAT="cat --"
|
||||
is_early=$(cpio --extract --verbose --quiet --to-stdout -- 'early_cpio' < "$image" 2>/dev/null)
|
||||
if [[ "$is_early" ]]; then
|
||||
if (( ${#filenames[@]} > 0 )); then
|
||||
if [[ -n "$unpackearly" ]]; then
|
||||
unpack_files
|
||||
elif (( ${#filenames[@]} > 0 )); then
|
||||
extract_files
|
||||
else
|
||||
echo "Early CPIO image"
|
||||
list_files
|
||||
fi
|
||||
SKIP="$dracutbasedir/skipcpio"
|
||||
if [[ -d "$dracutbasedir/skipcpio" ]]; then
|
||||
SKIP="$dracutbasedir/skipcpio/skipcpio"
|
||||
else
|
||||
SKIP="$dracutbasedir/skipcpio"
|
||||
fi
|
||||
if ! [[ -x $SKIP ]]; then
|
||||
echo
|
||||
echo "'$SKIP' not found, cannot display remaining contents!" >&2
|
||||
@@ -176,38 +198,35 @@ case $bin in
|
||||
;;
|
||||
esac
|
||||
|
||||
CAT=$({
|
||||
if [[ $SKIP ]]; then
|
||||
$SKIP "$image"
|
||||
if [[ $SKIP ]] ; then
|
||||
bin="$($SKIP "$image" | { read -N 6 bin && echo "$bin" ; })"
|
||||
else
|
||||
read -N 6 bin < "$image"
|
||||
fi
|
||||
case $bin in
|
||||
$'\x1f\x8b'*)
|
||||
CAT="zcat --"
|
||||
;;
|
||||
BZh*)
|
||||
CAT="bzcat --"
|
||||
;;
|
||||
$'\x71\xc7'*|070701)
|
||||
CAT="cat --"
|
||||
;;
|
||||
$'\x02\x21'*)
|
||||
CAT="lz4 -d -c"
|
||||
;;
|
||||
$'\x89'LZO$'\0'*)
|
||||
CAT="lzop -d -c"
|
||||
;;
|
||||
*)
|
||||
if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
|
||||
CAT="xzcat --single-stream --"
|
||||
else
|
||||
cat "$image"
|
||||
fi } | {
|
||||
read -N 6 bin
|
||||
case $bin in
|
||||
$'\x1f\x8b'*)
|
||||
echo "zcat --"
|
||||
;;
|
||||
BZh*)
|
||||
echo "bzcat --"
|
||||
;;
|
||||
$'\x71\xc7'*|070701)
|
||||
echo "cat --"
|
||||
;;
|
||||
$'\x02\x21'*)
|
||||
echo "lz4 -d -c"
|
||||
;;
|
||||
$'\x89'LZO$'\0'*)
|
||||
echo "lzop -d -c"
|
||||
;;
|
||||
*)
|
||||
if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
|
||||
echo "xzcat --single-stream --"
|
||||
else
|
||||
echo "xzcat --"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
})
|
||||
CAT="xzcat --"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
skipcpio()
|
||||
{
|
||||
@@ -221,7 +240,9 @@ fi
|
||||
|
||||
ret=0
|
||||
|
||||
if (( ${#filenames[@]} > 0 )); then
|
||||
if [[ -n "$unpack" ]]; then
|
||||
unpack_files
|
||||
elif (( ${#filenames[@]} > 0 )); then
|
||||
extract_files
|
||||
else
|
||||
version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
|
||||
|
@@ -29,8 +29,9 @@ OPTIONS
|
||||
|
||||
**-k** _<kernel_list>_::
|
||||
List of kernel images for which initrd files are created (relative
|
||||
to _boot_dir_), defaults to _vmlinux_ on ppc/ppc64, _image_ on s390/s390x
|
||||
and _vmlinuz_ for everything else.
|
||||
to _boot_dir_), Image name should begin with the following string,
|
||||
defaults to _vmlinux_ on ppc/ppc64, _image_ on s390/s390x and _vmlinuz_
|
||||
for everything else.
|
||||
|
||||
**-i** _<initrd_list>_::
|
||||
List of file names (relative to _boot_dir_) for the initrd; positions
|
||||
|
@@ -145,6 +145,33 @@ is_xen_kernel() {
|
||||
return
|
||||
}
|
||||
|
||||
# kernel_image_gz_from_image() and kernel_version_from_image() are helpers
|
||||
# for arm* kernels which produce zImage files which cannot be read from
|
||||
# get_kernel_version -> get rid of this workaround if possible
|
||||
kernel_image_gz_from_image() {
|
||||
local arch=$(uname -i)
|
||||
local r=${1}.gz
|
||||
|
||||
# uImage kernels can't be extracted directly. Use the vmlinux.gz instead
|
||||
r=${r//uImage/vmlinux}
|
||||
|
||||
# on ARM a zImage can't be extracted directly. Other platforms define it
|
||||
# as a gzipped vmlinux file, but not ARM. So only on ARM, use vmlinux.gz.
|
||||
if [[ $arch =~ arm ]] || [[ $arch =~ aarch ]]; then
|
||||
r=${r//zImage/vmlinux}
|
||||
fi
|
||||
|
||||
echo $r
|
||||
}
|
||||
|
||||
kernel_version_from_image() {
|
||||
local kernel_image="$1" kernel_image_gz=$(kernel_image_gz_from_image "$1")
|
||||
|
||||
if get_kernel_version "$kernel_image" 2>/dev/null; then
|
||||
return
|
||||
fi
|
||||
get_kernel_version "$kernel_image_gz" 2>/dev/null
|
||||
}
|
||||
|
||||
# Taken over from SUSE mkinitrd
|
||||
default_kernel_images() {
|
||||
@@ -183,7 +210,8 @@ default_kernel_images() {
|
||||
|
||||
[ -L "$boot_dir/$kernel_image" ] && continue
|
||||
[ "${kernel_image%%.gz}" != "$kernel_image" ] && continue
|
||||
kernel_version=$(/usr/bin/get_kernel_version \
|
||||
|
||||
kernel_version=$(kernel_version_from_image \
|
||||
$boot_dir/$kernel_image 2> /dev/null)
|
||||
initrd_image=$(echo $kernel_image | sed -e "s|${regex}|initrd|")
|
||||
if [ "$kernel_image" != "$initrd_image" -a \
|
||||
@@ -209,11 +237,13 @@ while (($# > 0)); do
|
||||
-k) # Would be nice to get a list of images here
|
||||
read_arg kernel_images "$@" || shift $?
|
||||
for kernel_image in $kernel_images;do
|
||||
[ -L "/boot/$kernel_image" ] && kernel_image="$(readlink "/boot/$kernel_image")"
|
||||
kernels="$kernels ${kernel_image#*-}"
|
||||
done
|
||||
;;
|
||||
-i) read_arg initrd_images "$@" || shift $?
|
||||
for initrd_image in $initrd_images;do
|
||||
[ -L "/boot/$initrd_image" ] && initrd_image="$(readlink "/boot/$initrd_image")"
|
||||
# Check if the initrd_image contains a path.
|
||||
# if not, then add the default boot_dir
|
||||
dname=`dirname $initrd_image`
|
||||
@@ -280,7 +310,8 @@ done
|
||||
|
||||
[[ $targets && $kernels ]] || default_kernel_images
|
||||
if [[ ! $targets || ! $kernels ]];then
|
||||
error "No kernel found in $boot_dir"
|
||||
error "No kernel found in $boot_dir or bad modules dir in /lib/modules"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# We can have several targets/kernels, transform the list to an array
|
||||
@@ -301,6 +332,8 @@ fi
|
||||
[[ $domu_module_list ]] || domu_module_list="${DOMU_INITRD_MODULES}"
|
||||
shopt -s extglob
|
||||
|
||||
failed=""
|
||||
|
||||
for ((i=0 ; $i<${#targets[@]} ; i++)); do
|
||||
|
||||
if [[ $img_vers ]];then
|
||||
@@ -329,14 +362,18 @@ for ((i=0 ; $i<${#targets[@]} ; i++)); do
|
||||
# expansion magics
|
||||
if [ -n "${modules_all}" ];then
|
||||
$dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel" &>/dev/null
|
||||
[ $? -ne 0 ] && failed="$failed $target"
|
||||
else
|
||||
$dracut_cmd $dracut_args "$target" "$kernel" &>/dev/null
|
||||
[ $? -ne 0 ] && failed="$failed $target"
|
||||
fi
|
||||
else
|
||||
if [ -n "${modules_all}" ];then
|
||||
$dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel"
|
||||
[ $? -ne 0 ] && failed="$failed $target"
|
||||
else
|
||||
$dracut_cmd $dracut_args "$target" "$kernel"
|
||||
[ $? -ne 0 ] && failed="$failed $target"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
@@ -345,4 +382,12 @@ if [ "$skip_update_bootloader" ] ; then
|
||||
echo 2>&1 "Did not refresh the bootloader. You might need to refresh it manually."
|
||||
else
|
||||
update-bootloader --refresh
|
||||
[ $? -ne 0 ] && echo "Updating bootloader failed" && exit 1
|
||||
fi
|
||||
|
||||
if [ "$failed" != "" ]; then
|
||||
echo "Generating $failed targets failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
@@ -122,6 +122,7 @@ install() {
|
||||
\
|
||||
$systemdsystemunitdir/slices.target \
|
||||
$systemdsystemunitdir/system.slice \
|
||||
$systemdsystemunitdir/-.slice \
|
||||
\
|
||||
$tmpfilesdir/systemd.conf \
|
||||
\
|
||||
@@ -129,7 +130,10 @@ install() {
|
||||
echo swapoff \
|
||||
kmod insmod rmmod modprobe modinfo depmod lsmod \
|
||||
mount umount reboot poweroff \
|
||||
systemd-cgls systemd-tmpfiles
|
||||
systemd-run systemd-escape \
|
||||
systemd-cgls systemd-tmpfiles \
|
||||
/etc/udev/udev.hwdb \
|
||||
${NULL}
|
||||
|
||||
inst_multiple -o \
|
||||
/usr/lib/modules-load.d/*.conf \
|
||||
@@ -158,14 +162,19 @@ install() {
|
||||
if [[ $hostonly ]]; then
|
||||
inst_multiple -H -o \
|
||||
/etc/systemd/journald.conf \
|
||||
/etc/systemd/journald.conf.d/*.conf \
|
||||
/etc/systemd/system.conf \
|
||||
/etc/systemd/system.conf.d/*.conf \
|
||||
/etc/hostname \
|
||||
/etc/machine-id \
|
||||
/etc/machine-info \
|
||||
/etc/vconsole.conf \
|
||||
/etc/locale.conf \
|
||||
/etc/modules-load.d/*.conf \
|
||||
/etc/sysctl.d/*.conf \
|
||||
/etc/sysctl.conf
|
||||
/etc/sysctl.conf \
|
||||
/etc/udev/udev.conf \
|
||||
${NULL}
|
||||
|
||||
_mods=$(modules_load_get /etc/modules-load.d)
|
||||
[[ $_mods ]] && instmods $_mods
|
||||
@@ -177,11 +186,13 @@ install() {
|
||||
|
||||
# install adm user/group for journald
|
||||
inst_multiple nologin
|
||||
egrep '^systemd-journal:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
egrep '^adm:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
egrep '^systemd-journal:' /etc/group >> "$initdir/etc/group"
|
||||
egrep '^wheel:' /etc/group >> "$initdir/etc/group"
|
||||
egrep '^adm:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^systemd-journal:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^adm:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^systemd-journal:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^wheel:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^adm:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^utmp:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^root:' /etc/group >> "$initdir/etc/group"
|
||||
|
||||
ln_r $systemdutildir/systemd "/init"
|
||||
ln_r $systemdutildir/systemd "/sbin/init"
|
||||
@@ -194,7 +205,8 @@ install() {
|
||||
71-seat.rules \
|
||||
73-seat-late.rules \
|
||||
90-vconsole.rules \
|
||||
99-systemd.rules
|
||||
99-systemd.rules \
|
||||
${NULL}
|
||||
|
||||
for i in \
|
||||
emergency.target \
|
||||
@@ -208,9 +220,10 @@ install() {
|
||||
done
|
||||
|
||||
mkdir -p "$initdir/etc/systemd"
|
||||
# turn off RateLimit for journal
|
||||
# We must use a volatile journal, and we don't want rate-limiting
|
||||
{
|
||||
echo "[Journal]"
|
||||
echo "Storage=volatile"
|
||||
echo "RateLimitInterval=0"
|
||||
echo "RateLimitBurst=0"
|
||||
} >> "$initdir/etc/systemd/journald.conf"
|
||||
|
@@ -77,9 +77,10 @@ do_fips()
|
||||
local _module
|
||||
|
||||
KERNEL=$(uname -r)
|
||||
|
||||
if ! [ -e "/boot/.vmlinuz-${KERNEL}.hmac" ]; then
|
||||
warn "/boot/.vmlinuz-${KERNEL}.hmac does not exist"
|
||||
BOOT_IMAGE="$(getarg BOOT_IMAGE)"
|
||||
BOOT_IMAGE="${BOOT_IMAGE:-/vmlinuz-${KERNEL}}"
|
||||
if ! [ -e "/boot/.${BOOT_IMAGE}.hmac" ] && ! [ -e "/boot/.vmlinuz-${KERNEL}.hmac" ]; then
|
||||
warn "/boot/.${BOOT_IMAGE}.hmac does not exist"
|
||||
return 1
|
||||
fi
|
||||
|
||||
@@ -114,7 +115,7 @@ do_fips()
|
||||
elif [ -e "/run/initramfs/live/isolinux/vmlinuz0" ]; then
|
||||
do_rhevh_check /run/initramfs/live/isolinux/vmlinuz0 || return 1
|
||||
else
|
||||
sha512hmac -c "/boot/.vmlinuz-${KERNEL}.hmac" || return 1
|
||||
sha512hmac -c "/boot/.${BOOT_IMAGE}.hmac" || return 1
|
||||
fi
|
||||
|
||||
info "All initrd crypto checks done"
|
||||
|
@@ -13,12 +13,16 @@ depends() {
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
local _fipsmodules _mod
|
||||
_fipsmodules="aead aes_generic aes-x86_64 ansi_cprng arc4 blowfish camellia cast6 cbc ccm "
|
||||
_fipsmodules+="chainiv crc32c crct10dif_generic cryptomgr crypto_null ctr cts deflate des des3_ede dm-crypt dm-mod drbg "
|
||||
_fipsmodules+="ecb eseqiv fcrypt gcm ghash_generic hmac khazad lzo md4 md5 michael_mic rmd128 "
|
||||
_fipsmodules+="rmd160 rmd256 rmd320 rot13 salsa20 seed seqiv serpent sha1 sha224 sha256 sha256_generic "
|
||||
_fipsmodules+="sha384 sha512 sha512_generic tcrypt tea tnepres twofish wp256 wp384 wp512 xeta xtea xts zlib"
|
||||
_fipsmodules+="aes_s390 des_s390 prng sha256_s390 sha_common des_check_key ghash_s390 sha1_s390 sha512_s390"
|
||||
if [[ -f "${srcmods}/modules.fips" ]]; then
|
||||
_fipsmodules="$(cat "${srcmods}/modules.fips")"
|
||||
else
|
||||
_fipsmodules="aead aes_generic aes-x86_64 ansi_cprng arc4 authenc authencesn blowfish camellia cast6 cbc ccm "
|
||||
_fipsmodules+="chainiv crc32c crct10dif_generic cryptomgr crypto_null ctr cts deflate des des3_ede dm-crypt dm-mod drbg "
|
||||
_fipsmodules+="ecb eseqiv fcrypt gcm ghash_generic hmac khazad lzo md4 md5 michael_mic rmd128 "
|
||||
_fipsmodules+="rmd160 rmd256 rmd320 rot13 salsa20 seed seqiv serpent sha1 sha224 sha256 sha256_generic "
|
||||
_fipsmodules+="sha384 sha512 sha512_generic tcrypt tea tnepres twofish wp256 wp384 wp512 xeta xtea xts zlib "
|
||||
_fipsmodules+="aes_s390 des_s390 prng sha256_s390 sha_common des_check_key ghash_s390 sha1_s390 sha512_s390"
|
||||
fi
|
||||
|
||||
mkdir -m 0755 -p "${initdir}/etc/modprobe.d"
|
||||
|
||||
@@ -46,5 +50,16 @@ install() {
|
||||
|
||||
inst_multiple -o prelink
|
||||
inst_simple /etc/system-fips
|
||||
[ -c ${initdir}/dev/random ] || mknod ${initdir}/dev/random c 1 8 \
|
||||
|| {
|
||||
dfatal "Cannot create /dev/random"
|
||||
dfatal "To create an initramfs with fips support, dracut has to run as root"
|
||||
return 1
|
||||
}
|
||||
[ -c ${initdir}/dev/urandom ] || mknod ${initdir}/dev/urandom c 1 9 \
|
||||
|| {
|
||||
dfatal "Cannot create /dev/random"
|
||||
dfatal "To create an initramfs with fips support, dracut has to run as root"
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@ check() {
|
||||
[[ $mount_needs ]] && return 1
|
||||
|
||||
if ! dracut_module_included "systemd"; then
|
||||
derror "dracut-systemd needs systemd in the initramfs"
|
||||
derror "systemd-initrd needs systemd in the initramfs"
|
||||
return 1
|
||||
fi
|
||||
|
||||
@@ -28,6 +28,7 @@ install() {
|
||||
inst_multiple -o \
|
||||
$systemdsystemunitdir/initrd.target \
|
||||
$systemdsystemunitdir/initrd-fs.target \
|
||||
$systemdsystemunitdir/initrd-root-device.target \
|
||||
$systemdsystemunitdir/initrd-root-fs.target \
|
||||
$systemdsystemunitdir/initrd-switch-root.target \
|
||||
$systemdsystemunitdir/initrd-switch-root.service \
|
||||
|
@@ -3,6 +3,7 @@
|
||||
# called by dracut
|
||||
check() {
|
||||
require_binaries capsh
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
|
@@ -5,7 +5,7 @@ check() {
|
||||
[[ $mount_needs ]] && return 1
|
||||
|
||||
if ! dracut_module_included "systemd"; then
|
||||
derror "dracut-systemd needs systemd in the initramfs"
|
||||
derror "systemd-networkd needs systemd in the initramfs"
|
||||
return 1
|
||||
fi
|
||||
|
||||
@@ -48,10 +48,10 @@ install() {
|
||||
|
||||
# inst_dir /var/lib/systemd/clock
|
||||
|
||||
egrep '^systemd-network:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
egrep '^systemd-network:' /etc/group >> "$initdir/etc/group"
|
||||
# egrep '^systemd-timesync:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
# egrep '^systemd-timesync:' /etc/group >> "$initdir/etc/group"
|
||||
grep '^systemd-network:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^systemd-network:' /etc/group >> "$initdir/etc/group"
|
||||
# grep '^systemd-timesync:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
# grep '^systemd-timesync:' /etc/group >> "$initdir/etc/group"
|
||||
|
||||
_arch=$(uname -m)
|
||||
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
|
||||
|
@@ -15,6 +15,6 @@ depends() {
|
||||
install() {
|
||||
inst_multiple -o ps grep more cat rm strace free showmount \
|
||||
ping netstat rpcinfo vi scp ping6 ssh \
|
||||
fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat e2fsck
|
||||
fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.f2fs fsck.vfat e2fsck
|
||||
}
|
||||
|
||||
|
@@ -12,18 +12,68 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_hook cmdline 00 "$moddir/watchdog.sh"
|
||||
inst_hook cmdline 50 "$moddir/watchdog.sh"
|
||||
inst_hook pre-trigger 00 "$moddir/watchdog.sh"
|
||||
inst_hook initqueue 00 "$moddir/watchdog.sh"
|
||||
inst_hook mount 00 "$moddir/watchdog.sh"
|
||||
inst_hook mount 50 "$moddir/watchdog.sh"
|
||||
inst_hook mount 99 "$moddir/watchdog.sh"
|
||||
inst_hook pre-pivot 00 "$moddir/watchdog.sh"
|
||||
inst_hook pre-pivot 99 "$moddir/watchdog.sh"
|
||||
inst_hook cleanup 00 "$moddir/watchdog.sh"
|
||||
inst_hook cleanup 99 "$moddir/watchdog.sh"
|
||||
# Do not add watchdog hooks if systemd module is included
|
||||
# In that case, systemd will manage watchdog kick
|
||||
if ! dracut_module_included "systemd"; then
|
||||
inst_hook cmdline 00 "$moddir/watchdog.sh"
|
||||
inst_hook cmdline 50 "$moddir/watchdog.sh"
|
||||
inst_hook pre-trigger 00 "$moddir/watchdog.sh"
|
||||
inst_hook initqueue 00 "$moddir/watchdog.sh"
|
||||
inst_hook mount 00 "$moddir/watchdog.sh"
|
||||
inst_hook mount 50 "$moddir/watchdog.sh"
|
||||
inst_hook mount 99 "$moddir/watchdog.sh"
|
||||
inst_hook pre-pivot 00 "$moddir/watchdog.sh"
|
||||
inst_hook pre-pivot 99 "$moddir/watchdog.sh"
|
||||
inst_hook cleanup 00 "$moddir/watchdog.sh"
|
||||
inst_hook cleanup 99 "$moddir/watchdog.sh"
|
||||
fi
|
||||
inst_hook emergency 02 "$moddir/watchdog-stop.sh"
|
||||
inst_multiple -o wdctl
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
local -A _drivers
|
||||
local _alldrivers _active _wdtdrv _wdtppath _dir
|
||||
[[ -d /sys/class/watchdog/ ]] || return
|
||||
for _dir in /sys/class/watchdog/*; do
|
||||
[[ -d "$_dir" ]] || continue
|
||||
[[ -f "$_dir/state" ]] || continue
|
||||
_active=$(< "$_dir/state")
|
||||
! [[ $hostonly ]] || [[ "$_active" = "active" ]] || continue
|
||||
# device/modalias will return driver of this device
|
||||
_wdtdrv=$(< "$_dir/device/modalias")
|
||||
# There can be more than one module represented by same
|
||||
# modalias. Currently load all of them.
|
||||
# TODO: Need to find a way to avoid any unwanted module
|
||||
# represented by modalias
|
||||
_wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null)
|
||||
if [[ $_wdtdrv ]]; then
|
||||
instmods $_wdtdrv
|
||||
for i in $_wdtdrv; do
|
||||
_drivers[$i]=1
|
||||
done
|
||||
fi
|
||||
# however in some cases, we also need to check that if there is
|
||||
# a specific driver for the parent bus/device. In such cases
|
||||
# we also need to enable driver for parent bus/device.
|
||||
_wdtppath=$(readlink -f "$_dir/device")
|
||||
while [[ -d "$_wdtppath" ]] && [[ "$_wdtppath" != "/sys" ]]; do
|
||||
_wdtppath=$(readlink -f "$_wdtppath/..")
|
||||
[[ -f "$_wdtppath/modalias" ]] || continue
|
||||
|
||||
_wdtdrv=$(< "$_wdtppath/modalias")
|
||||
_wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null)
|
||||
if [[ $_wdtdrv ]]; then
|
||||
instmods $_wdtdrv
|
||||
for i in $_wdtdrv; do
|
||||
_drivers[$i]=1
|
||||
done
|
||||
fi
|
||||
done
|
||||
done
|
||||
# ensure that watchdog module is loaded as early as possible
|
||||
_alldrivers="${!_drivers[*]}"
|
||||
[[ $_alldrivers ]] && echo "rd.driver.pre=${_alldrivers// /,}" > ${initdir}/etc/cmdline.d/00-watchdog.conf
|
||||
|
||||
return 0
|
||||
}
|
||||
|
@@ -1,2 +1,2 @@
|
||||
#!/bin/sh
|
||||
[ -c /dev/watchdog ] && echo -n 'V' > /dev/watchdog
|
||||
[ -c /dev/watchdog ] && printf 'V' > /dev/watchdog
|
||||
|
@@ -30,8 +30,9 @@ install() {
|
||||
# This is from 10redhat-i18n.
|
||||
findkeymap () {
|
||||
local MAP=$1
|
||||
local MAPNAME=${1%.map*}
|
||||
[[ ! -f $MAP ]] && \
|
||||
MAP=$(find ${kbddir}/keymaps -type f -name $MAP -o -name $MAP.\* | head -n1)
|
||||
MAP=$(find ${kbddir}/keymaps -type f -name ${MAPNAME} -o -name ${MAPNAME}.map -o -name ${MAPNAME}.map.\* | head -n1)
|
||||
[[ " $KEYMAPS " = *" $MAP "* ]] && return
|
||||
KEYMAPS="$KEYMAPS $MAP"
|
||||
case $MAP in
|
||||
@@ -100,6 +101,13 @@ install() {
|
||||
inst_rules ${moddir}/10-console.rules
|
||||
inst_hook cmdline 20 "${moddir}/parse-i18n.sh"
|
||||
fi
|
||||
|
||||
if [[ ${kbddir} != "/usr/share" ]]; then
|
||||
inst_dir /usr/share
|
||||
for _src in $(eval echo {${KBDSUBDIRS}}); do
|
||||
[ ! -e "${initdir}/usr/share/${_src}" ] && ln -s "${kbddir}/${_src}" "${initdir}/usr/share/${_src}"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
install_all_kbd() {
|
||||
@@ -107,7 +115,7 @@ install() {
|
||||
|
||||
for _src in $(eval echo ${kbddir}/{${KBDSUBDIRS}}); do
|
||||
inst_dir "$_src"
|
||||
cp --reflink=auto --sparse=auto -prfL -t "${initdir}/${_src}" "$_src"/*
|
||||
$DRACUT_CP -L -t "${initdir}/${_src}" "$_src"/*
|
||||
done
|
||||
|
||||
# remove unnecessary files
|
||||
|
@@ -8,9 +8,6 @@ type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
# We already need a set netif here
|
||||
netif=$interface
|
||||
|
||||
# Huh? Interface configured?
|
||||
[ -f "/tmp/net.$netif.up" ] && exit 0
|
||||
|
||||
setup_interface() {
|
||||
ip=$new_ip_address
|
||||
mtu=$new_interface_mtu
|
||||
@@ -21,7 +18,10 @@ setup_interface() {
|
||||
search=$(printf -- "$new_domain_search")
|
||||
namesrv=$new_domain_name_servers
|
||||
hostname=$new_host_name
|
||||
lease_time=$new_dhcp_lease_time
|
||||
[ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time
|
||||
[ -n "$new_max_life" ] && lease_time=$new_max_life
|
||||
preferred_lft=$lease_time
|
||||
[ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life
|
||||
|
||||
[ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
||||
|
||||
@@ -39,25 +39,35 @@ setup_interface() {
|
||||
fi
|
||||
fi
|
||||
|
||||
ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} \
|
||||
valid_lft ${lease_time} preferred_lft ${lease_time} \
|
||||
dev $netif
|
||||
ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif \
|
||||
${lease_time:+valid_lft $lease_time} \
|
||||
${preferred_lft:+preferred_lft ${preferred_lft}}
|
||||
|
||||
if [ -n "$gw" ] ; then
|
||||
if [ "$mask" == "255.255.255.255" ] ; then
|
||||
if [ "$mask" = "255.255.255.255" ] ; then
|
||||
# point-to-point connection => set explicit route to gateway
|
||||
echo ip route add $gw dev $netif > /tmp/net.$netif.gw
|
||||
fi
|
||||
echo ip route replace default via $gw dev $netif >> /tmp/net.$netif.gw
|
||||
|
||||
echo "$gw" | {
|
||||
IFS=' ' read -r main_gw other_gw
|
||||
echo ip route replace default via $main_gw dev $netif >> /tmp/net.$netif.gw
|
||||
if [ -n "$other_gw" ] ; then
|
||||
for g in $other_gw; do
|
||||
echo ip route add default via $g dev $netif >> /tmp/net.$netif.gw
|
||||
done
|
||||
fi
|
||||
}
|
||||
fi
|
||||
|
||||
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
|
||||
if getargbool 1 rd.peerdns; then
|
||||
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
fi
|
||||
# Note: hostname can be fqdn OR short hostname, so chop off any
|
||||
# trailing domain name and explicity add any domain if set.
|
||||
[ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
@@ -80,18 +90,65 @@ setup_interface6() {
|
||||
${lease_time:+valid_lft $lease_time} \
|
||||
${preferred_lft:+preferred_lft ${preferred_lft}}
|
||||
|
||||
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
if getargbool 1 rd.peerdns; then
|
||||
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
fi
|
||||
|
||||
# Note: hostname can be fqdn OR short hostname, so chop off any
|
||||
# trailing domain name and explicity add any domain if set.
|
||||
[ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
}
|
||||
|
||||
parse_option_121() {
|
||||
while [ $# -ne 0 ]; do
|
||||
mask="$1"
|
||||
shift
|
||||
|
||||
# Is the destination a multicast group?
|
||||
if [ $1 -ge 224 -a $1 -lt 240 ]; then
|
||||
multicast=1
|
||||
else
|
||||
multicast=0
|
||||
fi
|
||||
|
||||
# Parse the arguments into a CIDR net/mask string
|
||||
if [ $mask -gt 24 ]; then
|
||||
destination="$1.$2.$3.$4/$mask"
|
||||
shift; shift; shift; shift
|
||||
elif [ $mask -gt 16 ]; then
|
||||
destination="$1.$2.$3.0/$mask"
|
||||
shift; shift; shift
|
||||
elif [ $mask -gt 8 ]; then
|
||||
destination="$1.$2.0.0/$mask"
|
||||
shift; shift
|
||||
else
|
||||
destination="$1.0.0.0/$mask"
|
||||
shift
|
||||
fi
|
||||
|
||||
# Read the gateway
|
||||
gateway="$1.$2.$3.$4"
|
||||
shift; shift; shift; shift
|
||||
|
||||
# Multicast routing on Linux
|
||||
# - If you set a next-hop address for a multicast group, this breaks with Cisco switches
|
||||
# - If you simply leave it link-local and attach it to an interface, it works fine.
|
||||
if [ $multicast -eq 1 ]; then
|
||||
temp_result="$destination dev $interface"
|
||||
else
|
||||
temp_result="$destination via $gateway dev $interface"
|
||||
fi
|
||||
|
||||
echo "/sbin/ip route add $temp_result"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
case $reason in
|
||||
PREINIT)
|
||||
echo "dhcp: PREINIT $netif up"
|
||||
@@ -101,7 +158,7 @@ case $reason in
|
||||
PREINIT6)
|
||||
echo "dhcp: PREINIT6 $netif up"
|
||||
linkup $netif
|
||||
wait_for_ipv6_dad $netif
|
||||
wait_for_ipv6_dad_link $netif
|
||||
;;
|
||||
|
||||
BOUND)
|
||||
@@ -111,9 +168,16 @@ case $reason in
|
||||
read layer2 < /sys/class/net/$netif/device/layer2
|
||||
fi
|
||||
if [ "$layer2" != "0" ]; then
|
||||
if ! arping -q -D -c 2 -I $netif $new_ip_address ; then
|
||||
warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying"
|
||||
exit 1
|
||||
if command -v arping2 >/dev/null; then
|
||||
if arping2 -q -C 1 -c 2 -I $netif -0 $new_ip_address ; then
|
||||
warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
if ! arping -f -q -D -c 2 -I $netif $new_ip_address ; then
|
||||
warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
unset layer2
|
||||
@@ -126,6 +190,9 @@ case $reason in
|
||||
{
|
||||
echo '. /lib/net-lib.sh'
|
||||
echo "setup_net $netif"
|
||||
if [ -n "$new_classless_static_routes" ]; then
|
||||
modify_routes add "$(parse_option_121 $new_classless_static_routes)"
|
||||
fi
|
||||
echo "source_hook initqueue/online $netif"
|
||||
[ -e /tmp/net.$netif.manualup ] || echo "/sbin/netroot $netif"
|
||||
echo "rm -f -- $hookdir/initqueue/setup_net_$netif.sh"
|
||||
@@ -133,6 +200,21 @@ case $reason in
|
||||
|
||||
echo "[ -f /tmp/net.$netif.did-setup ]" > $hookdir/initqueue/finished/dhclient-$netif.sh
|
||||
>/tmp/net.$netif.up
|
||||
if [ -e /sys/class/net/${netif}/address ]; then
|
||||
> /tmp/net.$(cat /sys/class/net/${netif}/address).up
|
||||
fi
|
||||
|
||||
;;
|
||||
|
||||
RENEW|REBIND)
|
||||
unset lease_time
|
||||
[ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time
|
||||
[ -n "$new_max_life" ] && lease_time=$new_max_life
|
||||
preferred_lft=$lease_time
|
||||
[ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life
|
||||
ip -4 addr change ${new_ip_address}/${new_subnet_mask} broadcast ${new_broadcast_address} dev ${interface} \
|
||||
${lease_time:+valid_lft $lease_time} ${preferred_lft:+preferred_lft ${preferred_lft}} \
|
||||
>/dev/null 2>&1
|
||||
;;
|
||||
|
||||
BOUND6)
|
||||
@@ -154,7 +236,22 @@ case $reason in
|
||||
|
||||
echo "[ -f /tmp/net.$netif.did-setup ]" > $hookdir/initqueue/finished/dhclient-$netif.sh
|
||||
>/tmp/net.$netif.up
|
||||
if [ -e /sys/class/net/${netif}/address ]; then
|
||||
> /tmp/net.$(cat /sys/class/net/${netif}/address).up
|
||||
fi
|
||||
;;
|
||||
|
||||
RENEW6|REBIND6)
|
||||
unset lease_time
|
||||
[ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time
|
||||
[ -n "$new_max_life" ] && lease_time=$new_max_life
|
||||
preferred_lft=$lease_time
|
||||
[ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life
|
||||
ip -6 addr change ${new_ip6_address}/${new_ip6_prefixlen} dev ${interface} scope global \
|
||||
${lease_time:+valid_lft $lease_time} ${preferred_lft:+preferred_lft ${preferred_lft}} \
|
||||
>/dev/null 2>&1
|
||||
;;
|
||||
|
||||
*) echo "dhcp: $reason";;
|
||||
esac
|
||||
|
||||
|
@@ -1,3 +1,6 @@
|
||||
|
||||
option classless-routes code 121 = array of unsigned integer 8;
|
||||
|
||||
request subnet-mask, broadcast-address, time-offset, routers,
|
||||
domain-name, domain-name-servers, domain-search, host-name,
|
||||
root-path, interface-mtu;
|
||||
root-path, interface-mtu, classless-routes;
|
||||
|
@@ -15,75 +15,12 @@ type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
|
||||
# $netif reads easier than $1
|
||||
netif=$1
|
||||
use_bridge='false'
|
||||
use_vlan='false'
|
||||
|
||||
# enslave this interface to bond?
|
||||
for i in /tmp/bond.*.info; do
|
||||
[ -e "$i" ] || continue
|
||||
unset bondslaves
|
||||
unset bondname
|
||||
. "$i"
|
||||
for slave in $bondslaves ; do
|
||||
if [ "$netif" = "$slave" ] ; then
|
||||
netif=$bondname
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
if [ -e /tmp/team.info ]; then
|
||||
. /tmp/team.info
|
||||
for slave in $teamslaves ; do
|
||||
if [ "$netif" = "$slave" ] ; then
|
||||
netif=$teammaster
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -e /tmp/vlan.info ]; then
|
||||
. /tmp/vlan.info
|
||||
if [ "$netif" = "$phydevice" ]; then
|
||||
if [ "$netif" = "$bondname" ] && [ -n "$DO_BOND_SETUP" ] ; then
|
||||
: # We need to really setup bond (recursive call)
|
||||
elif [ "$netif" = "$teammaster" ] && [ -n "$DO_TEAM_SETUP" ] ; then
|
||||
: # We need to really setup team (recursive call)
|
||||
else
|
||||
netif="$vlanname"
|
||||
use_vlan='true'
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# bridge this interface?
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
for ethname in $bridgeslaves ; do
|
||||
if [ "$netif" = "$ethname" ]; then
|
||||
if [ "$netif" = "$bondname" ] && [ -n "$DO_BOND_SETUP" ] ; then
|
||||
: # We need to really setup bond (recursive call)
|
||||
elif [ "$netif" = "$teammaster" ] && [ -n "$DO_TEAM_SETUP" ] ; then
|
||||
: # We need to really setup team (recursive call)
|
||||
elif [ "$netif" = "$vlanname" ] && [ -n "$DO_VLAN_SETUP" ]; then
|
||||
: # We need to really setup vlan (recursive call)
|
||||
else
|
||||
netif="$bridgename"
|
||||
use_bridge='true'
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# disable manual ifup while netroot is set for simplifying our logic
|
||||
# in netroot case we prefer netroot to bringup $netif automaticlly
|
||||
[ -n "$2" -a "$2" = "-m" ] && [ -z "$netroot" ] && manualup="$2"
|
||||
[ -z "$netroot" ] && [ -z "$manualup" ] && exit 0
|
||||
if [ -n "$manualup" ]; then
|
||||
>/tmp/net.$netif.manualup
|
||||
else
|
||||
[ -e /tmp/net.${netif}.did-setup ] && exit 0
|
||||
[ -e /sys/class/net/$netif/address ] && \
|
||||
[ -e /tmp/net.$(cat /sys/class/net/$netif/address).did-setup ] && exit 0
|
||||
# loopback is always handled the same way
|
||||
if [ "$netif" = "lo" ] ; then
|
||||
ip link set lo up
|
||||
ip addr add 127.0.0.1/8 dev lo
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Run dhclient
|
||||
@@ -92,15 +29,33 @@ do_dhcp() {
|
||||
# event for nfsroot
|
||||
# XXX add -V vendor class and option parsing per kernel
|
||||
|
||||
local _COUNT=0
|
||||
local _timeout=$(getargs rd.net.timeout.dhcp=)
|
||||
local _DHCPRETRY=$(getargs rd.net.dhcp.retry=)
|
||||
_DHCPRETRY=${_DHCPRETRY:-1}
|
||||
|
||||
[ -e /tmp/dhclient.$netif.pid ] && return 0
|
||||
|
||||
if ! iface_has_link $netif; then
|
||||
echo "No carrier detected"
|
||||
if ! iface_has_carrier $netif; then
|
||||
warn "No carrier detected on interface $netif"
|
||||
return 1
|
||||
fi
|
||||
echo "Starting dhcp for interface $netif"
|
||||
dhclient "$@" -1 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif \
|
||||
|| echo "dhcp failed"
|
||||
|
||||
while [ $_COUNT -lt $_DHCPRETRY ]; do
|
||||
info "Starting dhcp for interface $netif"
|
||||
dhclient "$@" \
|
||||
${_timeout:+-timeout $_timeout} \
|
||||
-q \
|
||||
-cf /etc/dhclient.conf \
|
||||
-pf /tmp/dhclient.$netif.pid \
|
||||
-lf /tmp/dhclient.$netif.lease \
|
||||
$netif \
|
||||
&& return 0
|
||||
_COUNT=$(($_COUNT+1))
|
||||
[ $_COUNT -lt $_DHCPRETRY ] && sleep 1
|
||||
done
|
||||
warn "dhcp for interface $netif failed"
|
||||
return 1
|
||||
}
|
||||
|
||||
load_ipv6() {
|
||||
@@ -131,7 +86,23 @@ do_ipv6auto() {
|
||||
do_static() {
|
||||
strglobin $ip '*:*:*' && load_ipv6
|
||||
|
||||
linkup $netif
|
||||
if [ -z "$dev" ] && ! iface_has_carrier "$netif"; then
|
||||
warn "No carrier detected on interface $netif"
|
||||
return 1
|
||||
elif ! linkup "$netif"; then
|
||||
warn "Could not bring interface $netif up!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
ip route get "$ip" | {
|
||||
read a rest
|
||||
if [ "$a" = "local" ]; then
|
||||
warn "Not assigning $ip to interface $netif, cause it is already assigned!"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
} || return 1
|
||||
|
||||
[ -n "$macaddr" ] && ip link set address $macaddr dev $netif
|
||||
[ -n "$mtu" ] && ip link set mtu $mtu dev $netif
|
||||
if strglobin $ip '*:*:*'; then
|
||||
@@ -139,6 +110,17 @@ do_static() {
|
||||
ip addr add $ip/$mask ${srv:+peer $srv} dev $netif
|
||||
wait_for_ipv6_dad $netif
|
||||
else
|
||||
if command -v arping2 >/dev/null; then
|
||||
if arping2 -q -C 1 -c 2 -I $netif -0 $ip ; then
|
||||
warn "Duplicate address detected for $ip for interface $netif."
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
if ! arping -f -q -D -c 2 -I $netif $ip ; then
|
||||
warn "Duplicate address detected for $ip for interface $netif."
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
ip addr flush dev $netif
|
||||
ip addr add $ip/$mask ${srv:+peer $srv} brd + dev $netif
|
||||
fi
|
||||
@@ -149,106 +131,6 @@ do_static() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# loopback is always handled the same way
|
||||
if [ "$netif" = "lo" ] ; then
|
||||
ip link set lo up
|
||||
ip addr add 127.0.0.1/8 dev lo
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# start bond if needed
|
||||
if [ -e /tmp/bond.${netif}.info ]; then
|
||||
. /tmp/bond.${netif}.info
|
||||
|
||||
if [ "$netif" = "$bondname" ] && [ ! -e /tmp/net.$bondname.up ] ; then # We are master bond device
|
||||
modprobe bonding
|
||||
echo "+$netif" > /sys/class/net/bonding_masters
|
||||
ip link set $netif down
|
||||
|
||||
# Stolen from ifup-eth
|
||||
# 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
|
||||
|
||||
linkup $netif
|
||||
|
||||
for slave in $bondslaves ; do
|
||||
ip link set $slave down
|
||||
cat /sys/class/net/$slave/address > /tmp/net.${netif}.${slave}.hwaddr
|
||||
echo "+$slave" > /sys/class/net/$bondname/bonding/slaves
|
||||
linkup $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
|
||||
|
||||
if [ -e /tmp/team.info ]; then
|
||||
. /tmp/team.info
|
||||
if [ "$netif" = "$teammaster" ] && [ ! -e /tmp/net.$teammaster.up ] ; then
|
||||
# We shall only bring up those _can_ come up
|
||||
# in case of some slave is gone in active-backup mode
|
||||
working_slaves=""
|
||||
for slave in $teamslaves ; do
|
||||
ip link set $slave up 2>/dev/null
|
||||
if wait_for_if_up $slave; then
|
||||
working_slaves+="$slave "
|
||||
fi
|
||||
done
|
||||
# Do not add slaves now
|
||||
teamd -d -U -n -N -t $teammaster -f /etc/teamd/$teammaster.conf
|
||||
for slave in $working_slaves; do
|
||||
# team requires the slaves to be down before joining team
|
||||
ip link set $slave down
|
||||
teamdctl $teammaster port add $slave
|
||||
done
|
||||
ip link set $teammaster up
|
||||
fi
|
||||
fi
|
||||
|
||||
# XXX need error handling like dhclient-script
|
||||
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
# start bridge if necessary
|
||||
if [ "$netif" = "$bridgename" ] && [ ! -e /tmp/net.$bridgename.up ]; then
|
||||
brctl addbr $bridgename
|
||||
brctl setfd $bridgename 0
|
||||
for ethname in $bridgeslaves ; do
|
||||
if [ "$ethname" = "$bondname" ] ; then
|
||||
DO_BOND_SETUP=yes ifup $bondname -m
|
||||
elif [ "$ethname" = "$teammaster" ] ; then
|
||||
DO_TEAM_SETUP=yes ifup $teammaster -m
|
||||
elif [ "$ethname" = "$vlanname" ]; then
|
||||
DO_VLAN_SETUP=yes ifup $vlanname -m
|
||||
else
|
||||
linkup $ethname
|
||||
fi
|
||||
brctl addif $bridgename $ethname
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
get_vid() {
|
||||
case "$1" in
|
||||
vlan*)
|
||||
@@ -260,33 +142,237 @@ get_vid() {
|
||||
esac
|
||||
}
|
||||
|
||||
if [ "$netif" = "$vlanname" ] && [ ! -e /tmp/net.$vlanname.up ]; then
|
||||
modprobe 8021q
|
||||
if [ "$phydevice" = "$bondname" ] ; then
|
||||
DO_BOND_SETUP=yes ifup $phydevice -m
|
||||
elif [ "$phydevice" = "$teammaster" ] ; then
|
||||
DO_TEAM_SETUP=yes ifup $phydevice -m
|
||||
else
|
||||
linkup "$phydevice"
|
||||
fi
|
||||
ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname)"
|
||||
ip link set "$vlanname" up
|
||||
# check, if we need VLAN's for this interface
|
||||
if [ -z "$DO_VLAN_PHY" ] && [ -e /tmp/vlan.${netif}.phy ]; then
|
||||
unset DO_VLAN
|
||||
NO_AUTO_DHCP=yes DO_VLAN_PHY=yes ifup "$netif"
|
||||
modprobe -b -q 8021q
|
||||
|
||||
for i in /tmp/vlan.*.${netif}; do
|
||||
[ -e "$i" ] || continue
|
||||
unset vlanname
|
||||
unset phydevice
|
||||
. "$i"
|
||||
if [ -n "$vlanname" ]; then
|
||||
linkup "$phydevice"
|
||||
ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname)"
|
||||
ifup "$vlanname"
|
||||
fi
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check, if interface is VLAN interface
|
||||
if ! [ -e /tmp/vlan.${netif}.phy ]; then
|
||||
for i in /tmp/vlan.${netif}.*; do
|
||||
[ -e "$i" ] || continue
|
||||
export DO_VLAN=yes
|
||||
break
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# bridge this interface?
|
||||
if [ -z "$NO_BRIDGE_MASTER" ]; then
|
||||
for i in /tmp/bridge.*.info; do
|
||||
[ -e "$i" ] || continue
|
||||
unset bridgeslaves
|
||||
unset bridgename
|
||||
. "$i"
|
||||
for ethname in $bridgeslaves ; do
|
||||
[ "$netif" != "$ethname" ] && continue
|
||||
|
||||
NO_BRIDGE_MASTER=yes NO_AUTO_DHCP=yes ifup $ethname
|
||||
linkup $ethname
|
||||
if [ ! -e /tmp/bridge.$bridgename.up ]; then
|
||||
ip link add name $bridgename type bridge
|
||||
echo 0 > /sys/devices/virtual/net/$bridgename/bridge/forward_delay
|
||||
> /tmp/bridge.$bridgename.up
|
||||
fi
|
||||
ip link set dev $ethname master $bridgename
|
||||
ifup $bridgename
|
||||
exit 0
|
||||
done
|
||||
done
|
||||
fi
|
||||
|
||||
# enslave this interface to bond?
|
||||
if [ -z "$NO_BOND_MASTER" ]; then
|
||||
for i in /tmp/bond.*.info; do
|
||||
[ -e "$i" ] || continue
|
||||
unset bondslaves
|
||||
unset bondname
|
||||
. "$i"
|
||||
for slave in $bondslaves ; do
|
||||
[ "$netif" != "$slave" ] && continue
|
||||
|
||||
# already setup
|
||||
[ -e /tmp/bond.$bondname.up ] && exit 0
|
||||
|
||||
# wait for all slaves to show up
|
||||
for slave in $bondslaves ; do
|
||||
# try to create the slave (maybe vlan or bridge)
|
||||
NO_BOND_MASTER=yes NO_AUTO_DHCP=yes ifup $slave
|
||||
|
||||
if ! ip link show dev $slave >/dev/null 2>&1; then
|
||||
# wait for the last slave to show up
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
modprobe -q -b bonding
|
||||
echo "+$bondname" > /sys/class/net/bonding_masters 2>/dev/null
|
||||
ip link set $bondname 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/${bondname}/bonding/$key
|
||||
done
|
||||
IFS=$OLDIFS;
|
||||
else
|
||||
echo $value > /sys/class/net/${bondname}/bonding/$key
|
||||
fi
|
||||
done
|
||||
|
||||
linkup $bondname
|
||||
|
||||
for slave in $bondslaves ; do
|
||||
cat /sys/class/net/$slave/address > /tmp/net.${bondname}.${slave}.hwaddr
|
||||
ip link set $slave down
|
||||
echo "+$slave" > /sys/class/net/$bondname/bonding/slaves
|
||||
linkup $slave
|
||||
done
|
||||
|
||||
# Set mtu on bond master
|
||||
[ -n "$bondmtu" ] && ip link set mtu $bondmtu dev $netif
|
||||
|
||||
# add the bits to setup the needed post enslavement parameters
|
||||
for arg in $bondoptions ; do
|
||||
key=${arg%%=*};
|
||||
value=${arg##*=};
|
||||
if [ "${key}" = "primary" ]; then
|
||||
echo $value > /sys/class/net/${bondname}/bonding/$key
|
||||
fi
|
||||
done
|
||||
|
||||
> /tmp/bond.$bondname.up
|
||||
|
||||
NO_BOND_MASTER=yes ifup $bondname
|
||||
exit $?
|
||||
done
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -z "$NO_TEAM_MASTER" ]; then
|
||||
for i in /tmp/team.*.info; do
|
||||
[ -e "$i" ] || continue
|
||||
unset teammaster
|
||||
unset teamslaves
|
||||
. "$i"
|
||||
for slave in $teamslaves ; do
|
||||
[ "$netif" != "$slave" ] && continue
|
||||
|
||||
[ -e /tmp/team.$teammaster.up ] && exit 0
|
||||
|
||||
# wait for all slaves to show up
|
||||
for slave in $teamslaves ; do
|
||||
# try to create the slave (maybe vlan or bridge)
|
||||
NO_TEAM_MASTER=yes NO_AUTO_DHCP=yes ifup $slave
|
||||
|
||||
if ! ip link show dev $slave >/dev/null 2>&1; then
|
||||
# wait for the last slave to show up
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -e /tmp/team.$teammaster.up ] ; then
|
||||
# We shall only bring up those _can_ come up
|
||||
# in case of some slave is gone in active-backup mode
|
||||
working_slaves=""
|
||||
for slave in $teamslaves ; do
|
||||
teamdctl ${teammaster} port present ${slave} 2>/dev/null \
|
||||
&& continue
|
||||
ip link set dev $slave up 2>/dev/null
|
||||
if wait_for_if_up $slave; then
|
||||
working_slaves="$working_slaves$slave "
|
||||
fi
|
||||
done
|
||||
# Do not add slaves now
|
||||
teamd -d -U -n -N -t $teammaster -f /etc/teamd/${teammaster}.conf
|
||||
for slave in $working_slaves; do
|
||||
# team requires the slaves to be down before joining team
|
||||
ip link set dev $slave down
|
||||
(
|
||||
unset TEAM_PORT_CONFIG
|
||||
_hwaddr=$(cat /sys/class/net/$slave/address)
|
||||
_subchannels=$(iface_get_subchannels "$slave")
|
||||
if [ -n "$_hwaddr" ] && [ -e "/etc/sysconfig/network-scripts/mac-${_hwaddr}.conf" ]; then
|
||||
. "/etc/sysconfig/network-scripts/mac-${_hwaddr}.conf"
|
||||
elif [ -n "$_subchannels" ] && [ -e "/etc/sysconfig/network-scripts/ccw-${_subchannels}.conf" ]; then
|
||||
. "/etc/sysconfig/network-scripts/ccw-${_subchannels}.conf"
|
||||
elif [ -e "/etc/sysconfig/network-scripts/ifcfg-${slave}" ]; then
|
||||
. "/etc/sysconfig/network-scripts/ifcfg-${slave}"
|
||||
fi
|
||||
|
||||
if [ -n "${TEAM_PORT_CONFIG}" ]; then
|
||||
/usr/bin/teamdctl ${teammaster} port config update ${slave} "${TEAM_PORT_CONFIG}"
|
||||
fi
|
||||
)
|
||||
teamdctl $teammaster port add $slave
|
||||
done
|
||||
|
||||
ip link set dev $teammaster up
|
||||
|
||||
> /tmp/team.$teammaster.up
|
||||
NO_TEAM_MASTER=yes ifup $teammaster
|
||||
exit $?
|
||||
fi
|
||||
done
|
||||
done
|
||||
fi
|
||||
|
||||
# all synthetic interfaces done.. now check if the interface is available
|
||||
if ! ip link show dev $netif >/dev/null 2>&1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# disable manual ifup while netroot is set for simplifying our logic
|
||||
# in netroot case we prefer netroot to bringup $netif automaticlly
|
||||
[ -n "$2" -a "$2" = "-m" ] && [ -z "$netroot" ] && manualup="$2"
|
||||
|
||||
if [ -n "$manualup" ]; then
|
||||
>/tmp/net.$netif.manualup
|
||||
rm -f /tmp/net.${netif}.did-setup
|
||||
else
|
||||
[ -e /tmp/net.${netif}.did-setup ] && exit 0
|
||||
[ -z "$DO_VLAN" ] && \
|
||||
[ -e /sys/class/net/$netif/address ] && \
|
||||
[ -e /tmp/net.$(cat /sys/class/net/$netif/address).did-setup ] && exit 0
|
||||
fi
|
||||
|
||||
|
||||
# No ip lines default to dhcp
|
||||
ip=$(getarg ip)
|
||||
|
||||
if [ -z "$ip" ]; then
|
||||
namesrv=$(getargs nameserver)
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s >> /tmp/net.$netif.resolv.conf
|
||||
done
|
||||
|
||||
if [ -z "$NO_AUTO_DHCP" ] && [ -z "$ip" ]; then
|
||||
if [ "$netroot" = "dhcp6" ]; then
|
||||
do_dhcp -6
|
||||
else
|
||||
do_dhcp -4
|
||||
fi
|
||||
|
||||
for s in $(getargs nameserver); do
|
||||
[ -n "$s" ] || continue
|
||||
echo nameserver $s >> /tmp/net.$netif.resolv.conf
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
@@ -309,18 +395,10 @@ for p in $(getargs ip=); do
|
||||
esac
|
||||
|
||||
# If this option isn't directed at our interface, skip it
|
||||
[ -n "$dev" ] && [ "$dev" != "$netif" ] && \
|
||||
[ "$use_bridge" != 'true' ] && \
|
||||
[ "$use_vlan" != 'true' ] && continue
|
||||
|
||||
# setup nameserver
|
||||
namesrv="$dns1 $dns2 $(getargs nameserver)"
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s >> /tmp/net.$netif.resolv.conf
|
||||
done
|
||||
[ -n "$dev" ] && [ "$dev" != "$netif" ] && continue
|
||||
|
||||
# Store config for later use
|
||||
for i in ip srv gw mask hostname macaddr dns1 dns2; do
|
||||
for i in ip srv gw mask hostname macaddr mtu dns1 dns2; do
|
||||
eval '[ "$'$i'" ] && echo '$i'="$'$i'"'
|
||||
done > /tmp/net.$netif.override
|
||||
|
||||
@@ -337,40 +415,54 @@ for p in $(getargs ip=); do
|
||||
do_static ;;
|
||||
esac
|
||||
done
|
||||
ret=$?
|
||||
|
||||
> /tmp/net.${netif}.up
|
||||
# setup nameserver
|
||||
for s in "$dns1" "$dns2" $(getargs nameserver); do
|
||||
[ -n "$s" ] || continue
|
||||
echo nameserver $s >> /tmp/net.$netif.resolv.conf
|
||||
done
|
||||
|
||||
case $autoconf in
|
||||
dhcp|on|any|dhcp6)
|
||||
if [ $ret -eq 0 ]; then
|
||||
> /tmp/net.${netif}.up
|
||||
|
||||
if [ -z "$DO_VLAN" ] && [ -e /sys/class/net/${netif}/address ]; then
|
||||
> /tmp/net.$(cat /sys/class/net/${netif}/address).up
|
||||
fi
|
||||
|
||||
case $autoconf in
|
||||
dhcp|on|any|dhcp6)
|
||||
;;
|
||||
*)
|
||||
if [ $? -eq 0 ]; then
|
||||
setup_net $netif
|
||||
source_hook initqueue/online $netif
|
||||
if [ -z "$manualup" ]; then
|
||||
/sbin/netroot $netif
|
||||
*)
|
||||
if [ $ret -eq 0 ]; then
|
||||
setup_net $netif
|
||||
source_hook initqueue/online $netif
|
||||
if [ -z "$manualup" ]; then
|
||||
/sbin/netroot $netif
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
exit $ret
|
||||
fi
|
||||
done
|
||||
|
||||
# netif isn't the top stack? Then we should exit here.
|
||||
# eg. netif is bond0. br0 is on top of it. dhcp br0 is correct but dhcp
|
||||
# bond0 doesn't make sense.
|
||||
if [ -n "$DO_BOND_SETUP" -o -n "$DO_TEAM_SETUP" -o -n "$DO_VLAN_SETUP" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# no ip option directed at our interface?
|
||||
if [ ! -e /tmp/net.${netif}.up ]; then
|
||||
if getargs 'ip=dhcp6'; then
|
||||
load_ipv6
|
||||
do_dhcp -6
|
||||
if [ -z "$NO_AUTO_DHCP" ] && [ ! -e /tmp/net.${netif}.up ]; then
|
||||
if [ -e /tmp/net.bootdev ]; then
|
||||
BOOTDEV=$(cat /tmp/net.bootdev)
|
||||
if [ "$netif" = "$BOOTDEV" ] || [ "$BOOTDEV" = "$(cat /sys/class/net/${netif}/address)" ]; then
|
||||
load_ipv6
|
||||
do_dhcp
|
||||
fi
|
||||
else
|
||||
do_dhcp -4
|
||||
if getargs 'ip=dhcp6'; then
|
||||
load_ipv6
|
||||
do_dhcp -6
|
||||
fi
|
||||
if getargs 'ip=dhcp'; then
|
||||
do_dhcp -4
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@@ -4,7 +4,8 @@
|
||||
check() {
|
||||
local _program
|
||||
|
||||
require_binaries ip arping dhclient || return 1
|
||||
require_binaries ip dhclient || return 1
|
||||
require_any_binary arping arping2 || return 1
|
||||
|
||||
return 255
|
||||
}
|
||||
@@ -23,9 +24,9 @@ installkernel() {
|
||||
# called by dracut
|
||||
install() {
|
||||
local _arch _i _dir
|
||||
inst_multiple ip arping dhclient sed
|
||||
inst_multiple ip dhclient sed awk
|
||||
inst_multiple -o arping arping2
|
||||
inst_multiple -o ping ping6
|
||||
inst_multiple -o brctl
|
||||
inst_multiple -o teamd teamdctl teamnl
|
||||
inst_simple /etc/libnl/classid
|
||||
inst_script "$moddir/ifup.sh" "/sbin/ifup"
|
||||
@@ -46,6 +47,43 @@ install() {
|
||||
inst_hook cmdline 99 "$moddir/parse-ifname.sh"
|
||||
inst_hook cleanup 10 "$moddir/kill-dhclient.sh"
|
||||
|
||||
# install all config files for teaming
|
||||
unset TEAM_MASTER
|
||||
unset TEAM_CONFIG
|
||||
unset TEAM_PORT_CONFIG
|
||||
unset HWADDR
|
||||
unset SUBCHANNELS
|
||||
for i in /etc/sysconfig/network-scripts/ifcfg-*; do
|
||||
[ -e "$i" ] || continue
|
||||
case "$i" in
|
||||
*~ | *.bak | *.orig | *.rpmnew | *.rpmorig | *.rpmsave)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
(
|
||||
. "$i"
|
||||
if ! [ "${ONBOOT}" = "no" -o "${ONBOOT}" = "NO" ] \
|
||||
&& [ -n "${TEAM_MASTER}${TEAM_CONFIG}${TEAM_PORT_CONFIG}" ]; then
|
||||
if [ -n "$TEAM_CONFIG" ] && [ -n "$DEVICE" ]; then
|
||||
mkdir -p $initdir/etc/teamd
|
||||
printf -- "%s" "$TEAM_CONFIG" > "$initdir/etc/teamd/${DEVICE}.conf"
|
||||
elif [ -n "$TEAM_PORT_CONFIG" ]; then
|
||||
inst_simple "$i"
|
||||
|
||||
HWADDR="$(echo $HWADDR | sed 'y/ABCDEF/abcdef/')"
|
||||
if [ -n "$HWADDR" ]; then
|
||||
ln_r "$i" "/etc/sysconfig/network-scripts/mac-${HWADDR}.conf"
|
||||
fi
|
||||
|
||||
SUBCHANNELS="$(echo $SUBCHANNELS | sed 'y/ABCDEF/abcdef/')"
|
||||
if [ -n "$SUBCHANNELS" ]; then
|
||||
ln_r "$i" "/etc/sysconfig/network-scripts/ccw-${SUBCHANNELS}.conf"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
)
|
||||
done
|
||||
|
||||
_arch=$(uname -m)
|
||||
|
||||
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
|
||||
|
@@ -12,11 +12,14 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
|
||||
# Write udev rules
|
||||
{
|
||||
# bridge: attempt only the defined interface
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
IFACES="$IFACES ${bridgeslaves%% *}"
|
||||
for i in /tmp/bridge.*.info; do
|
||||
[ -e "$i" ] || continue
|
||||
unset bridgeslaves
|
||||
unset bridgename
|
||||
. "$i"
|
||||
RAW_IFACES="$RAW_IFACES $bridgeslaves"
|
||||
MASTER_IFACES="$MASTER_IFACES $bridgename"
|
||||
fi
|
||||
done
|
||||
|
||||
# bond: attempt only the defined interface (override bridge defines)
|
||||
for i in /tmp/bond.*.info; do
|
||||
@@ -25,21 +28,34 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
|
||||
unset bondname
|
||||
. "$i"
|
||||
# It is enough to fire up only one
|
||||
IFACES="$IFACES ${bondslaves%% *}"
|
||||
RAW_IFACES="$RAW_IFACES $bondslaves"
|
||||
MASTER_IFACES="$MASTER_IFACES ${bondname}"
|
||||
done
|
||||
|
||||
if [ -e /tmp/team.info ]; then
|
||||
. /tmp/team.info
|
||||
IFACES="$IFACES ${teamslaves}"
|
||||
for i in /tmp/team.*.info; do
|
||||
[ -e "$i" ] || continue
|
||||
unset teamslaves
|
||||
unset teammaster
|
||||
. "$i"
|
||||
RAW_IFACES="$RAW_IFACES ${teamslaves}"
|
||||
MASTER_IFACES="$MASTER_IFACES ${teammaster}"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -e /tmp/vlan.info ]; then
|
||||
. /tmp/vlan.info
|
||||
IFACES="$IFACES $phydevice"
|
||||
MASTER_IFACES="$MASTER_IFACES ${vlanname}"
|
||||
fi
|
||||
for i in /tmp/vlan.*.phy; do
|
||||
[ -e "$i" ] || continue
|
||||
unset phydevice
|
||||
. "$i"
|
||||
RAW_IFACES="$RAW_IFACES $phydevice"
|
||||
for j in /tmp/vlan.*.${phydevice}; do
|
||||
[ -e "$j" ] || continue
|
||||
unset vlanname
|
||||
. "$j"
|
||||
MASTER_IFACES="$MASTER_IFACES ${vlanname}"
|
||||
done
|
||||
done
|
||||
|
||||
MASTER_IFACES="$(trim "$MASTER_IFACES")"
|
||||
RAW_IFACES="$(trim "$RAW_IFACES")"
|
||||
|
||||
if [ -z "$IFACES" ]; then
|
||||
[ -e /tmp/net.ifaces ] && read IFACES < /tmp/net.ifaces
|
||||
@@ -50,15 +66,14 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
|
||||
fi
|
||||
|
||||
ifup='/sbin/ifup $env{INTERFACE}'
|
||||
[ -z "$netroot" ] && ifup="$ifup -m"
|
||||
|
||||
runcmd="RUN+=\"/sbin/initqueue --name ifup-\$env{INTERFACE} --unique --onetime $ifup\""
|
||||
|
||||
# We have some specific interfaces to handle
|
||||
if [ -n "$IFACES" ]; then
|
||||
if [ -n "${RAW_IFACES}${IFACES}" ]; then
|
||||
echo 'SUBSYSTEM!="net", GOTO="net_end"'
|
||||
echo 'ACTION!="add|change|move", GOTO="net_end"'
|
||||
for iface in $IFACES; do
|
||||
for iface in $IFACES $RAW_IFACES; do
|
||||
case "$iface" in
|
||||
??:??:??:??:??:??) # MAC address
|
||||
cond="ATTR{address}==\"$iface\""
|
||||
@@ -79,13 +94,7 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
|
||||
done
|
||||
echo 'LABEL="net_end"'
|
||||
|
||||
if [ -n "$MASTER_IFACES" ]; then
|
||||
wait_ifaces=$MASTER_IFACES
|
||||
else
|
||||
wait_ifaces=$IFACES
|
||||
fi
|
||||
|
||||
for iface in $wait_ifaces; do
|
||||
for iface in $IFACES; do
|
||||
if [ "$bootdev" = "$iface" ] || [ "$NEEDNET" = "1" ]; then
|
||||
echo "[ -f /tmp/net.${iface}.did-setup ]" >$hookdir/initqueue/finished/wait-$iface.sh
|
||||
fi
|
||||
|
@@ -1,10 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
is_ip() {
|
||||
echo "$1" | {
|
||||
IFS=. read a b c d
|
||||
test "$a" -ge 0 -a "$a" -le 255 \
|
||||
-a "$b" -ge 0 -a "$b" -le 255 \
|
||||
-a "$c" -ge 0 -a "$c" -le 255 \
|
||||
-a "$d" -ge 0 -a "$d" -le 255 \
|
||||
2> /dev/null
|
||||
} && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
get_ip() {
|
||||
local iface="$1" ip=""
|
||||
ip=$(ip -o -f inet addr show $iface)
|
||||
ip=${ip%%/*}
|
||||
ip=${ip##* }
|
||||
echo $ip
|
||||
}
|
||||
|
||||
iface_for_remote_addr() {
|
||||
@@ -60,6 +73,14 @@ all_ifaces_up() {
|
||||
done
|
||||
}
|
||||
|
||||
all_ifaces_setup() {
|
||||
local iface="" IFACES=""
|
||||
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
|
||||
for iface in $IFACES; do
|
||||
[ -e /tmp/net.$iface.did-setup ] || return 1
|
||||
done
|
||||
}
|
||||
|
||||
get_netroot_ip() {
|
||||
local prefix="" server="" rest=""
|
||||
splitsep "$1" ":" prefix server rest
|
||||
@@ -80,7 +101,8 @@ ifdown() {
|
||||
ip addr flush dev $netif
|
||||
echo "#empty" > /etc/resolv.conf
|
||||
rm -f -- /tmp/net.$netif.did-setup
|
||||
[ -e /sys/class/net/$netif/address ] && \
|
||||
[ -z "$DO_VLAN" ] && \
|
||||
[ -e /sys/class/net/$netif/address ] && \
|
||||
rm -f -- /tmp/net.$(cat /sys/class/net/$netif/address).did-setup
|
||||
# TODO: send "offline" uevent?
|
||||
}
|
||||
@@ -89,7 +111,8 @@ setup_net() {
|
||||
local netif="$1" f="" gw_ip="" netroot_ip="" iface="" IFACES=""
|
||||
local _p
|
||||
[ -e /tmp/net.$netif.did-setup ] && return
|
||||
[ -e /sys/class/net/$netif/address ] && \
|
||||
[ -z "$DO_VLAN" ] && \
|
||||
[ -e /sys/class/net/$netif/address ] && \
|
||||
[ -e /tmp/net.$(cat /sys/class/net/$netif/address).did-setup ] && return
|
||||
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
|
||||
[ -z "$IFACES" ] && IFACES="$netif"
|
||||
@@ -99,7 +122,7 @@ setup_net() {
|
||||
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||
# set up resolv.conf
|
||||
[ -e /tmp/net.$netif.resolv.conf ] && \
|
||||
cp -f /tmp/net.$netif.resolv.conf /etc/resolv.conf
|
||||
awk '!array[$0]++' /tmp/net.$netif.resolv.conf > /etc/resolv.conf
|
||||
[ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw
|
||||
|
||||
# add static route
|
||||
@@ -107,7 +130,7 @@ setup_net() {
|
||||
route_to_var "$_p" || continue
|
||||
[ -n "$route_dev" ] && [ "$route_dev" != "$netif" ] && continue
|
||||
ip route add "$route_mask" ${route_gw:+via "$route_gw"} ${route_dev:+dev "$route_dev"}
|
||||
if strstr ":" "$route_mask"; then
|
||||
if strstr "$route_mask" ":"; then
|
||||
printf -- "%s\n" "$route_mask ${route_gw:+via $route_gw} ${route_dev:+dev $route_dev}" \
|
||||
> /tmp/net.route6."$netif"
|
||||
else
|
||||
@@ -116,6 +139,13 @@ setup_net() {
|
||||
fi
|
||||
done
|
||||
|
||||
# If a static route was necessary to reach the gateway, the
|
||||
# first gateway setup call will have failed with
|
||||
# RTNETLINK answers: Network is unreachable
|
||||
# Replace the default route again after static routes to cover
|
||||
# this scenario.
|
||||
[ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw
|
||||
|
||||
# Handle STP Timeout: arping the default gateway.
|
||||
# (or the root server, if a) it's local or b) there's no gateway.)
|
||||
# Note: This assumes that if no router is present the
|
||||
@@ -141,12 +171,17 @@ setup_net() {
|
||||
fi
|
||||
|
||||
if [ "$layer2" != "0" ] && [ -n "$dest" ] && ! strstr "$dest" ":"; then
|
||||
arping -q -f -w 60 -I $netif $dest || info "Resolving $dest via ARP on $netif failed"
|
||||
if command -v arping2 >/dev/null; then
|
||||
arping2 -q -C 1 -c 60 -I $netif $dest || info "Resolving $dest via ARP on $netif failed"
|
||||
else
|
||||
arping -q -f -w 60 -I $netif $dest || info "Resolving $dest via ARP on $netif failed"
|
||||
fi
|
||||
fi
|
||||
unset layer2
|
||||
|
||||
> /tmp/net.$netif.did-setup
|
||||
[ -e /sys/class/net/$netif/address ] && \
|
||||
[ -z "$DO_VLAN" ] && \
|
||||
[ -e /sys/class/net/$netif/address ] && \
|
||||
> /tmp/net.$(cat /sys/class/net/$netif/address).did-setup
|
||||
}
|
||||
|
||||
@@ -189,7 +224,7 @@ set_ifname() {
|
||||
fix_bootif() {
|
||||
local macaddr=${1}
|
||||
local IFS='-'
|
||||
macaddr=$(for i in ${macaddr} ; do echo -n $i:; done)
|
||||
macaddr=$(printf '%s:' ${macaddr})
|
||||
macaddr=${macaddr%:}
|
||||
# strip hardware type field from pxelinux
|
||||
[ -n "${macaddr%??:??:??:??:??:??}" ] && macaddr=${macaddr#??:}
|
||||
@@ -213,20 +248,55 @@ ibft_to_cmdline() {
|
||||
|
||||
[ -e /tmp/net.${dev}.has_ibft_config ] && continue
|
||||
|
||||
[ -e ${iface}/flags ] && flags=$(read a < ${iface}/flags; echo $a)
|
||||
# Skip invalid interfaces
|
||||
(( $flags & 1 )) || continue
|
||||
# Skip interfaces not used for booting
|
||||
(( $flags & 2 )) || continue
|
||||
[ -e ${iface}/dhcp ] && dhcp=$(read a < ${iface}/dhcp; echo $a)
|
||||
[ -e ${iface}/origin ] && origin=$(read a < ${iface}/origin; echo $a)
|
||||
[ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a)
|
||||
|
||||
if [ -n "$dhcp" ]; then
|
||||
echo "ip=$dev:dhcp"
|
||||
if [ -n "$ip" ] ; then
|
||||
case "$ip" in
|
||||
*.*.*.*)
|
||||
family=ipv4
|
||||
;;
|
||||
*:*)
|
||||
family=ipv6
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ -n "$dhcp" ] || [ "$origin" -eq 3 ]; then
|
||||
if [ "$family" = "ipv6" ] ; then
|
||||
echo "ip=$dev:dhcp6"
|
||||
else
|
||||
echo "ip=$dev:dhcp"
|
||||
fi
|
||||
elif [ -e ${iface}/ip-addr ]; then
|
||||
[ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a)
|
||||
# skip not assigned ip adresses
|
||||
[ "$ip" = "0.0.0.0" ] && continue
|
||||
[ -e ${iface}/gateway ] && gw=$(read a < ${iface}/gateway; echo $a)
|
||||
[ "$gateway" = "0.0.0.0" ] && unset $gateway
|
||||
[ -e ${iface}/subnet-mask ] && mask=$(read a < ${iface}/subnet-mask; echo $a)
|
||||
[ -e ${iface}/prefix-len ] && prefix=$(read a < ${iface}/prefix-len; echo $a)
|
||||
[ -e ${iface}/primary-dns ] && dns1=$(read a < ${iface}/primary-dns; echo $a)
|
||||
[ "$dns1" = "0.0.0.0" ] && unset $dns1
|
||||
[ -e ${iface}/secondary-dns ] && dns2=$(read a < ${iface}/secondary-dns; echo $a)
|
||||
[ "$dns2" = "0.0.0.0" ] && unset $dns2
|
||||
[ -e ${iface}/hostname ] && hostname=$(read a < ${iface}/hostname; echo $a)
|
||||
if [ -n "$ip" ] && [ -n "$mask" ]; then
|
||||
if [ "$family" = "ipv6" ] ; then
|
||||
if [ -n "$ip" ] ; then
|
||||
ip="[$ip]"
|
||||
[ -n "$prefix" ] || prefix=64
|
||||
ip="[${ip}/${prefix}]"
|
||||
mask=
|
||||
fi
|
||||
if [ -n "$gw" ] ; then
|
||||
gw="[${gw}]"
|
||||
fi
|
||||
fi
|
||||
if [ -n "$ip" ] && [ -n "$mask" -o -n "$prefix" ]; then
|
||||
echo "ip=$ip::$gw:$mask:$hostname:$dev:none${dns1:+:$dns1}${dns2:+:$dns2}"
|
||||
else
|
||||
warn "${iface} does not contain a valid iBFT configuration"
|
||||
@@ -381,50 +451,84 @@ ip_to_var() {
|
||||
done
|
||||
|
||||
unset ip srv gw mask hostname dev autoconf macaddr mtu dns1 dns2
|
||||
case $# in
|
||||
0) autoconf="error" ;;
|
||||
1) autoconf=$1 ;;
|
||||
2) [ -n "$1" ] && dev=$1; [ -n "$2" ] && autoconf=$2 ;;
|
||||
3) [ -n "$1" ] && dev=$1; [ -n "$2" ] && autoconf=$2; [ -n "$3" ] && mtu=$3 ;;
|
||||
4) [ -n "$1" ] && dev=$1; [ -n "$2" ] && autoconf=$2; [ -n "$3" ] && mtu=$3; [ -n "$4" ] && macaddr=$4 ;;
|
||||
*) [ -n "$1" ] && ip=$1; [ -n "$2" ] && srv=$2; [ -n "$3" ] && gw=$3; [ -n "$4" ] && mask=$4;
|
||||
[ -n "$5" ] && hostname=$5; [ -n "$6" ] && dev=$6; [ -n "$7" ] && autoconf=$7;
|
||||
case "$8" in
|
||||
[0-9]*:*|[0-9]*.[0-9]*.[0-9]*.[0-9]*)
|
||||
dns1="$8"
|
||||
[ -n "$9" ] && dns2="$9"
|
||||
;;
|
||||
[0-9]*)
|
||||
mtu="$8"
|
||||
;;
|
||||
*)
|
||||
if [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then
|
||||
macaddr="${9}:${10}:${11}:${12}:${13}:${14}"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
|
||||
# ip=<ipv4-address> means anaconda-style static config argument cluster:
|
||||
# ip=<ip> gateway=<gw> netmask=<nm> hostname=<host> mtu=<mtu>
|
||||
# ksdevice={link|bootif|ibft|<MAC>|<ifname>}
|
||||
if strglob "$autoconf" "*.*.*.*"; then
|
||||
ip="$autoconf"
|
||||
gw=$(getarg gateway=)
|
||||
mask=$(getarg netmask=)
|
||||
hostname=$(getarg hostname=)
|
||||
dev=$(getarg ksdevice=)
|
||||
autoconf="none"
|
||||
mtu=$(getarg mtu=)
|
||||
|
||||
# handle special values for ksdevice
|
||||
case "$dev" in
|
||||
bootif|BOOTIF) dev=$(fix_bootif $(getarg BOOTIF=)) ;;
|
||||
link) dev="" ;; # FIXME: do something useful with this
|
||||
ibft) dev="" ;; # ignore - ibft is handled elsewhere
|
||||
esac
|
||||
if [ $# -eq 0 ]; then
|
||||
autoconf="error"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ $# -eq 1 ]; then
|
||||
# format: ip={dhcp|on|any|dhcp6|auto6}
|
||||
# or
|
||||
# ip=<ipv4-address> means anaconda-style static config argument cluster
|
||||
autoconf="$1"
|
||||
|
||||
if strstr "$autoconf" "*.*.*.*"; then
|
||||
# ip=<ipv4-address> means anaconda-style static config argument cluster:
|
||||
# ip=<ip> gateway=<gw> netmask=<nm> hostname=<host> mtu=<mtu>
|
||||
# ksdevice={link|bootif|ibft|<MAC>|<ifname>}
|
||||
ip="$autoconf"
|
||||
gw=$(getarg gateway=)
|
||||
mask=$(getarg netmask=)
|
||||
hostname=$(getarg hostname=)
|
||||
dev=$(getarg ksdevice=)
|
||||
autoconf="none"
|
||||
mtu=$(getarg mtu=)
|
||||
|
||||
# handle special values for ksdevice
|
||||
case "$dev" in
|
||||
bootif|BOOTIF) dev=$(fix_bootif $(getarg BOOTIF=)) ;;
|
||||
link) dev="" ;; # FIXME: do something useful with this
|
||||
ibft) dev="" ;; # ignore - ibft is handled elsewhere
|
||||
esac
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "$2" = "dhcp" -o "$2" = "on" -o "$2" = "any" -o "$2" = "dhcp6" -o "$2" = "auto6" ]; then
|
||||
# format: ip=<interface>:{dhcp|on|any|dhcp6|auto6}[:[<mtu>][:<macaddr>]]
|
||||
[ -n "$1" ] && dev="$1"
|
||||
[ -n "$2" ] && autoconf="$2"
|
||||
[ -n "$3" ] && mtu=$3
|
||||
if [ -z "$5" ]; then
|
||||
macaddr="$4"
|
||||
else
|
||||
macaddr="${4}:${5}:${6}:${7}:${8}:${9}"
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
# format: ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}:[:[<mtu>][:<macaddr>]]
|
||||
|
||||
[ -n "$1" ] && ip=$1
|
||||
[ -n "$2" ] && srv=$2
|
||||
[ -n "$3" ] && gw=$3
|
||||
[ -n "$4" ] && mask=$4
|
||||
[ -n "$5" ] && hostname=$5
|
||||
[ -n "$6" ] && dev=$6
|
||||
[ -n "$7" ] && autoconf=$7
|
||||
case "$8" in
|
||||
[0-9]*:*|[0-9]*.[0-9]*.[0-9]*.[0-9]*)
|
||||
dns1="$8"
|
||||
[ -n "$9" ] && dns2="$9"
|
||||
;;
|
||||
[0-9]*)
|
||||
mtu="$8"
|
||||
if [ -n "${9}" -a -z "${10}" ]; then
|
||||
macaddr="${9}"
|
||||
elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then
|
||||
macaddr="${9}:${10}:${11}:${12}:${13}:${14}"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
if [ -n "${9}" -a -z "${10}" ]; then
|
||||
macaddr="${9}"
|
||||
elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then
|
||||
macaddr="${9}:${10}:${11}:${12}:${13}:${14}"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
route_to_var() {
|
||||
@@ -484,7 +588,11 @@ parse_ifname_opts() {
|
||||
wait_for_if_link() {
|
||||
local cnt=0
|
||||
local li
|
||||
while [ $cnt -lt 600 ]; do
|
||||
local timeout="$(getargs rd.net.timeout.iflink=)"
|
||||
timeout=${timeout:-60}
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
li=$(ip -o link show dev $1 2>/dev/null)
|
||||
[ -n "$li" ] && return 0
|
||||
sleep 0.1
|
||||
@@ -496,9 +604,27 @@ wait_for_if_link() {
|
||||
wait_for_if_up() {
|
||||
local cnt=0
|
||||
local li
|
||||
while [ $cnt -lt 200 ]; do
|
||||
local timeout="$(getargs rd.net.timeout.ifup=)"
|
||||
timeout=${timeout:-20}
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
li=$(ip -o link show up dev $1)
|
||||
[ -n "$li" ] && [ -z "${li##*state UP*}" ] && return 0
|
||||
if [ -n "$li" ]; then
|
||||
case "$li" in
|
||||
*\<UP*)
|
||||
return 0;;
|
||||
*\<*,UP\>*)
|
||||
return 0;;
|
||||
*\<*,UP,*\>*)
|
||||
return 0;;
|
||||
esac
|
||||
fi
|
||||
if strstr "$li" "LOWER_UP" \
|
||||
&& strstr "$li" "state UNKNOWN" \
|
||||
&& ! strstr "$li" "DORMANT"; then
|
||||
return 0
|
||||
fi
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
done
|
||||
@@ -507,7 +633,11 @@ wait_for_if_up() {
|
||||
|
||||
wait_for_route_ok() {
|
||||
local cnt=0
|
||||
while [ $cnt -lt 200 ]; do
|
||||
local timeout="$(getargs rd.net.timeout.route=)"
|
||||
timeout=${timeout:-20}
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
li=$(ip route show)
|
||||
[ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0
|
||||
sleep 0.1
|
||||
@@ -516,12 +646,34 @@ wait_for_route_ok() {
|
||||
return 1
|
||||
}
|
||||
|
||||
wait_for_ipv6_dad_link() {
|
||||
local cnt=0
|
||||
local timeout="$(getargs rd.net.timeout.ipv6dad=)"
|
||||
timeout=${timeout:-50}
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
[ -z "$(ip -6 addr show dev "$1" scope link tentative)" ] \
|
||||
&& return 0
|
||||
[ -n "$(ip -6 addr show dev "$1" scope link dadfailed)" ] \
|
||||
&& return 1
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
wait_for_ipv6_dad() {
|
||||
local cnt=0
|
||||
local li
|
||||
while [ $cnt -lt 500 ]; do
|
||||
li=$(ip -6 addr show dev $1 scope link)
|
||||
strstr "$li" "tentative" || return 0
|
||||
local timeout="$(getargs rd.net.timeout.ipv6dad=)"
|
||||
timeout=${timeout:-50}
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
[ -z "$(ip -6 addr show dev "$1" tentative)" ] \
|
||||
&& return 0
|
||||
[ -n "$(ip -6 addr show dev "$1" dadfailed)" ] \
|
||||
&& return 1
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
done
|
||||
@@ -530,12 +682,14 @@ wait_for_ipv6_dad() {
|
||||
|
||||
wait_for_ipv6_auto() {
|
||||
local cnt=0
|
||||
local li
|
||||
while [ $cnt -lt 400 ]; do
|
||||
li=$(ip -6 addr show dev $1)
|
||||
if ! strstr "$li" "tentative"; then
|
||||
strstr "$li" "dynamic" && return 0
|
||||
fi
|
||||
local timeout="$(getargs rd.net.timeout.ipv6auto=)"
|
||||
timeout=${timeout:-40}
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
[ -z "$(ip -6 addr show dev "$1" tentative)" ] \
|
||||
&& [ -n "$(ip -6 route list proto ra dev "$1")" ] \
|
||||
&& return 0
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
done
|
||||
@@ -553,21 +707,38 @@ type hostname >/dev/null 2>&1 || \
|
||||
cat /proc/sys/kernel/hostname
|
||||
}
|
||||
|
||||
iface_has_link() {
|
||||
iface_has_carrier() {
|
||||
local cnt=0
|
||||
local interface="$1" flags=""
|
||||
[ -n "$interface" ] || return 2
|
||||
interface="/sys/class/net/$interface"
|
||||
[ -d "$interface" ] || return 2
|
||||
local timeout="$(getargs rd.net.timeout.carrier=)"
|
||||
timeout=${timeout:-5}
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
linkup "$1"
|
||||
while [ $cnt -lt 50 ]; do
|
||||
[ "$(cat $interface/carrier)" = 1 ] && return 0
|
||||
|
||||
li=$(ip -o link show up dev $1)
|
||||
strstr "$li" "NO-CARRIER" && _no_carrier_flag=1
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
if [ -n "$_no_carrier_flag" ]; then
|
||||
# NO-CARRIER flag was cleared
|
||||
strstr "$li" "NO-CARRIER" || return 0
|
||||
fi
|
||||
# double check the syscfs carrier flag
|
||||
[ -e "$interface/carrier" ] && [ "$(cat $interface/carrier)" = 1 ] && return 0
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
iface_has_link() {
|
||||
iface_has_carrier "$@"
|
||||
}
|
||||
|
||||
find_iface_with_link() {
|
||||
local iface_path="" iface=""
|
||||
for iface_path in /sys/class/net/*; do
|
||||
@@ -646,3 +817,21 @@ is_kernel_ethernet_name() {
|
||||
esac
|
||||
|
||||
}
|
||||
|
||||
iface_get_subchannels() {
|
||||
local _netif
|
||||
local _subchannels
|
||||
|
||||
_netif="$1"
|
||||
|
||||
_subchannels=$({
|
||||
for i in /sys/class/net/$_netif/device/cdev[0-9]*; do
|
||||
[ -e $i ] || continue
|
||||
channel=$(readlink -f $i)
|
||||
printf -- "%s" "${channel##*/},"
|
||||
done
|
||||
})
|
||||
[ -n "$_subchannels" ] || return 1
|
||||
|
||||
printf -- "%s" ${_subchannels%,}
|
||||
}
|
||||
|
@@ -12,6 +12,11 @@ command -v setup_net >/dev/null || . /lib/net-lib.sh
|
||||
# no sense in doing something if no (net)root info is available
|
||||
# or root is already there
|
||||
[ -d $NEWROOT/proc ] && exit 0
|
||||
|
||||
if [ -z "$netroot" ]; then
|
||||
netroot=$(getarg netroot=)
|
||||
fi
|
||||
|
||||
[ -z "$netroot" ] && exit 1
|
||||
|
||||
# Set or override primary interface
|
||||
@@ -33,7 +38,7 @@ esac
|
||||
# Figure out the handler for root=dhcp by recalling all netroot cmdline
|
||||
# handlers when this is not called from manually network bringing up.
|
||||
if [ -z "$2" ]; then
|
||||
if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] ; then
|
||||
if getarg "root=dhcp" || getarg "netroot=dhcp" || getarg "root=dhcp6" || getarg "netroot=dhcp6"; then
|
||||
# Load dhcp options
|
||||
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||
|
||||
@@ -45,6 +50,8 @@ if [ -z "$2" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -f -- $hookdir/initqueue/finished/dhcp.sh
|
||||
|
||||
# Set netroot to new_root_path, so cmdline parsers don't call
|
||||
netroot=$new_root_path
|
||||
|
||||
@@ -74,9 +81,7 @@ source_hook netroot $netif
|
||||
|
||||
# Run the handler; don't store the root, it may change from device to device
|
||||
# XXX other variables to export?
|
||||
if $handler $netif $netroot $NEWROOT; then
|
||||
rm -f -- $hookdir/initqueue/finished/dhcp.sh
|
||||
# Network rootfs mount successful - save interface info for ifcfg etc.
|
||||
save_netinfo $netif
|
||||
fi
|
||||
[ -n "$handler" ] && "$handler" "$netif" "$netroot" "$NEWROOT"
|
||||
save_netinfo $netif
|
||||
|
||||
exit 0
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Format:
|
||||
# bond=<bondname>[:<bondslaves>:[:<options>]]
|
||||
# bond=<bondname>[:<bondslaves>:[:<options>[:<mtu>]]]
|
||||
#
|
||||
# bondslaves is a comma-separated list of physical (ethernet) interfaces
|
||||
# options is a comma-separated list on bonding options (modinfo bonding for details) in format compatible with initscripts
|
||||
@@ -9,14 +9,8 @@
|
||||
#
|
||||
# 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
|
||||
:
|
||||
fi
|
||||
# if the mtu is specified, it will be set on the bond master
|
||||
#
|
||||
|
||||
# We translate list of slaves to space-separated here to mwke it easier to loop over them in ifup
|
||||
# Ditto for bonding options
|
||||
@@ -28,24 +22,24 @@ parsebond() {
|
||||
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=$(str_replace "$2" "," " ") ;;
|
||||
3) bondname=$1; bondslaves=$(str_replace "$2" "," " "); bondoptions=$(str_replace "$3" "," " ") ;;
|
||||
4) bondname=$1; bondslaves=$(str_replace "$2" "," " "); bondoptions=$(str_replace "$3" "," " "); bondmtu=$4;;
|
||||
*) 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=)"
|
||||
# Parse bond for bondname, bondslaves, bondmode, bondoptions and bondmtu
|
||||
for bond in $(getargs bond=); do
|
||||
unset bondname
|
||||
unset bondslaves
|
||||
unset bondoptions
|
||||
unset bondmtu
|
||||
if [ "$bond" != "bond" ]; then
|
||||
parsebond "$bond"
|
||||
fi
|
||||
# Simple default bond
|
||||
if [ -z "$bondname" ]; then
|
||||
@@ -57,5 +51,5 @@ if getarg bond >/dev/null; then
|
||||
echo "bondname=$bondname" > /tmp/bond.${bondname}.info
|
||||
echo "bondslaves=\"$bondslaves\"" >> /tmp/bond.${bondname}.info
|
||||
echo "bondoptions=\"$bondoptions\"" >> /tmp/bond.${bondname}.info
|
||||
return
|
||||
fi
|
||||
echo "bondmtu=\"$bondmtu\"" >> /tmp/bond.${bondname}.info
|
||||
done
|
||||
|
@@ -7,14 +7,6 @@
|
||||
# bridge without parameters assumes bridge=br0:eth0
|
||||
#
|
||||
|
||||
# return if bridge already parsed
|
||||
[ -n "$bridgename" ] && return
|
||||
|
||||
# Check if bridge parameter is valid
|
||||
if getarg bridge= >/dev/null ; then
|
||||
command -v brctl >/dev/null 2>&1 || die "No 'brctl' installed"
|
||||
fi
|
||||
|
||||
parsebridge() {
|
||||
local v=${1}:
|
||||
set --
|
||||
@@ -22,8 +14,6 @@ parsebridge() {
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
done
|
||||
|
||||
unset bridgename bridgeslaves
|
||||
case $# in
|
||||
0) bridgename=br0; bridgeslaves=$iface ;;
|
||||
1) die "bridge= requires two parameters" ;;
|
||||
@@ -32,14 +22,13 @@ parsebridge() {
|
||||
esac
|
||||
}
|
||||
|
||||
unset bridgename bridgeslaves
|
||||
|
||||
iface=eth0
|
||||
|
||||
# Parse bridge for bridgename and bridgeslaves
|
||||
if bridge="$(getarg bridge)"; then
|
||||
for bridge in $(getargs bridge=); do
|
||||
unset bridgename
|
||||
unset bridgeslaves
|
||||
iface=eth0
|
||||
# Read bridge= parameters if they exist
|
||||
if [ -n "$bridge" ]; then
|
||||
if [ "$bridge" != "bridge" ]; then
|
||||
parsebridge $bridge
|
||||
fi
|
||||
# Simple default bridge
|
||||
@@ -47,7 +36,6 @@ if bridge="$(getarg bridge)"; then
|
||||
bridgename=br0
|
||||
bridgeslaves=$iface
|
||||
fi
|
||||
echo "bridgename=$bridgename" > /tmp/bridge.info
|
||||
echo "bridgeslaves=\"$bridgeslaves\"" >> /tmp/bridge.info
|
||||
return
|
||||
fi
|
||||
echo "bridgename=$bridgename" > /tmp/bridge.${bridgename}.info
|
||||
echo "bridgeslaves=\"$bridgeslaves\"" >> /tmp/bridge.${bridgename}.info
|
||||
done
|
||||
|
@@ -4,5 +4,7 @@ command -v getarg >/dev/null || . /lib/dracut-lib.sh
|
||||
command -v ibft_to_cmdline >/dev/null || . /lib/net-lib.sh
|
||||
|
||||
if getargbool 0 rd.iscsi.ibft -d "ip=ibft"; then
|
||||
modprobe -b -q iscsi_boot_sysfs 2>/dev/null
|
||||
modprobe -b -q iscsi_ibft
|
||||
ibft_to_cmdline
|
||||
fi
|
||||
|
@@ -36,8 +36,12 @@ unset count
|
||||
# If needed, check if bootdev= contains anything usable
|
||||
BOOTDEV=$(getarg bootdev=)
|
||||
|
||||
if [ -n "$NEEDBOOTDEV" ] ; then
|
||||
[ -z "$BOOTDEV" ] && warn "Please supply bootdev argument for multiple ip= lines"
|
||||
if [ -n "$NEEDBOOTDEV" ] && getargbool 1 rd.neednet; then
|
||||
#[ -z "$BOOTDEV" ] && warn "Please supply bootdev argument for multiple ip= lines"
|
||||
echo "rd.neednet=1" > /etc/cmdline.d/dracut-neednet.conf
|
||||
info "Multiple ip= arguments: assuming rd.neednet=1"
|
||||
else
|
||||
unset NEEDBOOTDEV
|
||||
fi
|
||||
|
||||
# Check ip= lines
|
||||
@@ -46,17 +50,14 @@ for p in $(getargs ip=); do
|
||||
ip_to_var $p
|
||||
|
||||
# make first device specified the BOOTDEV
|
||||
if [ -z "$BOOTDEV" ] && [ -n "$dev" ]; then
|
||||
if [ -n "$NEEDBOOTDEV" ] && [ -z "$BOOTDEV" ] && [ -n "$dev" ]; then
|
||||
BOOTDEV="$dev"
|
||||
[ -n "$NEEDBOOTDEV" ] && warn "Setting bootdev to '$BOOTDEV'"
|
||||
info "Setting bootdev to '$BOOTDEV'"
|
||||
fi
|
||||
|
||||
# skip ibft since we did it above
|
||||
[ "$autoconf" = "ibft" ] && continue
|
||||
|
||||
# We need to have an ip= line for the specified bootdev
|
||||
[ -n "$NEEDBOOTDEV" ] && [ "$dev" = "$BOOTDEV" ] && BOOTDEVOK=1
|
||||
|
||||
# Empty autoconf defaults to 'dhcp'
|
||||
if [ -z "$autoconf" ] ; then
|
||||
warn "Empty autoconf values default to dhcp"
|
||||
@@ -109,6 +110,16 @@ for p in $(getargs ip=); do
|
||||
die "Server-ip or dhcp for netboot needed, but current arguments say otherwise"
|
||||
fi
|
||||
|
||||
if str_starts "$dev" "enx" && [ ${#dev} -eq 15 ]; then
|
||||
printf -- "ifname=%s:%s:%s:%s:%s:%s:%s\n" \
|
||||
"$dev" \
|
||||
"${dev:3:2}" \
|
||||
"${dev:5:2}" \
|
||||
"${dev:7:2}" \
|
||||
"${dev:9:2}" \
|
||||
"${dev:11:2}" \
|
||||
"${dev:13:2}" >> /etc/cmdline.d/80-enx.conf
|
||||
fi
|
||||
done
|
||||
|
||||
# put BOOTIF in IFACES to make sure it comes up
|
||||
|
@@ -6,14 +6,6 @@
|
||||
# teamslaves is a comma-separated list of physical (ethernet) interfaces
|
||||
#
|
||||
|
||||
# return if team already parsed
|
||||
[ -n "$teammaster" ] && return
|
||||
|
||||
# Check if team parameter is valid
|
||||
if getarg team= >/dev/null ; then
|
||||
:
|
||||
fi
|
||||
|
||||
parseteam() {
|
||||
local v=${1}:
|
||||
set --
|
||||
@@ -22,23 +14,28 @@ parseteam() {
|
||||
v=${v#*:}
|
||||
done
|
||||
|
||||
unset teammaster teamslaves
|
||||
case $# in
|
||||
2) teammaster=$1; teamslaves=$(str_replace "$2" "," " ") ;;
|
||||
*) die "team= requires two parameters" ;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
unset teammaster teamslaves
|
||||
for team in $(getargs team); do
|
||||
[ "$team" = "team" ] && continue
|
||||
|
||||
if getarg team>/dev/null; then
|
||||
# Read team= parameters if they exist
|
||||
team="$(getarg team=)"
|
||||
if [ ! "$team" = "team" ]; then
|
||||
parseteam "$(getarg team=)"
|
||||
unset teammaster
|
||||
unset teamslaves
|
||||
|
||||
parseteam "$team" || continue
|
||||
|
||||
echo "teammaster=$teammaster" > /tmp/team.${teammaster}.info
|
||||
echo "teamslaves=\"$teamslaves\"" >> /tmp/team.${teammaster}.info
|
||||
|
||||
if ! [ -e /etc/teamd/${teammaster}.conf ]; then
|
||||
warn "Team master $teammaster specified, but no /etc/teamd/$teammaster.conf present. Using activebackup."
|
||||
mkdir -p /etc/teamd
|
||||
printf -- "%s" '{"runner": {"name": "activebackup"}, "link_watch": {"name": "ethtool"}}' > "/etc/teamd/${teammaster}.conf"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "teammaster=$teammaster" > /tmp/team.info
|
||||
echo "teamslaves=\"$teamslaves\"" >> /tmp/team.info
|
||||
return
|
||||
fi
|
||||
|
@@ -4,14 +4,6 @@
|
||||
# vlan=<vlanname>:<phydevice>
|
||||
#
|
||||
|
||||
# return if vlan already parsed
|
||||
[ -n "$vlanname" ] && return
|
||||
|
||||
# Check if vlan parameter is valid
|
||||
if getarg vlan= >/dev/null ; then
|
||||
:
|
||||
fi
|
||||
|
||||
parsevlan() {
|
||||
local v=${1}:
|
||||
set --
|
||||
@@ -27,16 +19,16 @@ parsevlan() {
|
||||
esac
|
||||
}
|
||||
|
||||
unset vlanname phydevice
|
||||
|
||||
if getarg vlan >/dev/null; then
|
||||
# Read vlan= parameters if they exist
|
||||
vlan="$(getarg vlan=)"
|
||||
for vlan in $(getargs vlan=); do
|
||||
unset vlanname
|
||||
unset phydevice
|
||||
if [ ! "$vlan" = "vlan" ]; then
|
||||
parsevlan "$(getarg vlan=)"
|
||||
parsevlan "$vlan"
|
||||
fi
|
||||
|
||||
echo "vlanname=\"$vlanname\"" > /tmp/vlan.info
|
||||
echo "phydevice=\"$phydevice\"" >> /tmp/vlan.info
|
||||
return
|
||||
fi
|
||||
echo "phydevice=\"$phydevice\"" > /tmp/vlan.${phydevice}.phy
|
||||
{
|
||||
echo "vlanname=\"$vlanname\""
|
||||
echo "phydevice=\"$phydevice\""
|
||||
} > /tmp/vlan.${vlanname}.${phydevice}
|
||||
done
|
||||
|
@@ -5,14 +5,6 @@ type is_persistent_ethernet_name >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
|
||||
udevadm settle --timeout=30
|
||||
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
fi
|
||||
|
||||
if [ -e /tmp/vlan.info ]; then
|
||||
. /tmp/vlan.info
|
||||
fi
|
||||
|
||||
mkdir -m 0755 -p /tmp/ifcfg/
|
||||
mkdir -m 0755 -p /tmp/ifcfg-leases/
|
||||
|
||||
@@ -48,7 +40,7 @@ print_s390() {
|
||||
for i in /sys/class/net/$_netif/device/cdev[0-9]*; do
|
||||
[ -e $i ] || continue
|
||||
channel=$(readlink -f $i)
|
||||
echo -n "${channel##*/},"
|
||||
printf '%s' "${channel##*/},"
|
||||
done
|
||||
})
|
||||
[ -n "$SUBCHANNELS" ] || return 1
|
||||
@@ -129,6 +121,9 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
unset bondslaves
|
||||
unset bondname
|
||||
unset bondoptions
|
||||
unset bridgename
|
||||
unset bridgeslaves
|
||||
unset team
|
||||
unset uuid
|
||||
unset ip
|
||||
unset gw
|
||||
@@ -138,24 +133,37 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
unset slave
|
||||
unset ethname
|
||||
unset vlan
|
||||
unset vlanname
|
||||
unset phydevice
|
||||
|
||||
[ -e /tmp/bond.${netif}.info ] && . /tmp/bond.${netif}.info
|
||||
[ -e /tmp/bridge.${netif}.info ] && . /tmp/bridge.${netif}.info
|
||||
[ -e /tmp/team.${netif}.info ] && . /tmp/team.${netif}.info
|
||||
|
||||
uuid=$(cat /proc/sys/kernel/random/uuid)
|
||||
if [ "$netif" = "$bridgename" ]; then
|
||||
bridge=yes
|
||||
elif [ "$netif" = "$teammaster" ]; then
|
||||
team=yes
|
||||
elif [ "$netif" = "$bondname" ]; then
|
||||
# $netif can't be bridge and bond at the same time
|
||||
# $netif can't be bridge and bond at the same time
|
||||
bond=yes
|
||||
fi
|
||||
if [ "$netif" = "$vlanname" ]; then
|
||||
|
||||
for i in /tmp/vlan.${netif}.*; do
|
||||
[ ! -e "$i" ] && continue
|
||||
. "$i"
|
||||
vlan=yes
|
||||
fi
|
||||
break
|
||||
done
|
||||
|
||||
# skip team interfaces for now, the host config must be in sync
|
||||
[ "$netif" = "$teammaster" ] && continue
|
||||
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "NAME=\"$netif\""
|
||||
interface_bind "$netif" "$macaddr"
|
||||
[ -z "$vlan" ] && interface_bind "$netif" "$macaddr"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "UUID=\"$uuid\""
|
||||
@@ -198,18 +206,15 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
} > /tmp/ifcfg/ifcfg-$netif
|
||||
|
||||
# bridge needs different things written to ifcfg
|
||||
if [ -z "$bridge" ] && [ -z "$bond" ] && [ -z "$vlan" ]; then
|
||||
if [ -z "$bridge" ] && [ -z "$bond" ] && [ -z "$vlan" ] && [ -z "$team" ]; then
|
||||
# standard interface
|
||||
{
|
||||
echo "TYPE=Ethernet"
|
||||
[ -n "$mtu" ] && echo "MTU=\"$mtu\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
echo "TYPE=Ethernet" >> /tmp/ifcfg/ifcfg-$netif
|
||||
fi
|
||||
|
||||
if [ -n "$vlan" ] ; then
|
||||
{
|
||||
echo "TYPE=Vlan"
|
||||
echo "NAME=\"$netif\""
|
||||
echo "DEVICE=\"$netif\""
|
||||
echo "VLAN=yes"
|
||||
echo "PHYSDEV=\"$phydevice\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
|
@@ -32,7 +32,7 @@ install() {
|
||||
_crt=$(grep -F --binary-files=text -z .crt $_lib)
|
||||
[[ $_crt ]] || continue
|
||||
[[ $_crt == /*/* ]] || continue
|
||||
if ! inst_simple "$_crt"; then
|
||||
if ! inst "$_crt"; then
|
||||
dwarn "Couldn't install '$_crt' SSL CA cert bundle; HTTPS might not work."
|
||||
continue
|
||||
fi
|
||||
|
@@ -15,67 +15,32 @@ installkernel() {
|
||||
local _modname
|
||||
# Include KMS capable drm drivers
|
||||
|
||||
drm_module_filter() {
|
||||
local _drm_drivers='drm_crtc_init'
|
||||
local _ret
|
||||
# subfunctions inherit following FDs
|
||||
local _merge=8 _side2=9
|
||||
function nmf1() {
|
||||
local _fname _fcont
|
||||
while read _fname || [ -n "$_fname" ]; do
|
||||
case "$_fname" in
|
||||
*.ko) _fcont="$(< $_fname)" ;;
|
||||
*.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
|
||||
*.ko.xz) _fcont="$(xz -dc $_fname)" ;;
|
||||
esac
|
||||
[[ $_fcont =~ $_drm_drivers
|
||||
&& ! $_fcont =~ iw_handler_get_spy ]] \
|
||||
&& echo "$_fname"
|
||||
done
|
||||
}
|
||||
function rotor() {
|
||||
local _f1 _f2
|
||||
while read _f1 || [ -n "$_f1" ]; do
|
||||
echo "$_f1"
|
||||
if read _f2; then
|
||||
echo "$_f2" 1>&${_side2}
|
||||
fi
|
||||
done | nmf1 1>&${_merge}
|
||||
}
|
||||
# Use two parallel streams to filter alternating modules.
|
||||
set +x
|
||||
eval "( ( rotor ) ${_side2}>&1 | nmf1 ) ${_merge}>&1"
|
||||
[[ $debug ]] && set -x
|
||||
return 0
|
||||
}
|
||||
|
||||
if [[ "$(uname -p)" == arm* ]]; then
|
||||
# arm specific modules needed by drm
|
||||
if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]]; then
|
||||
# arm/aarch64 specific modules needed by drm
|
||||
instmods \
|
||||
"=drivers/gpu/drm/i2c" \
|
||||
"=drivers/gpu/drm/panel" \
|
||||
"=drivers/gpu/drm/bridge" \
|
||||
"=drivers/pwm" \
|
||||
"=drivers/video/backlight" \
|
||||
"=drivers/video/fbdev/omap2/displays-new" \
|
||||
${NULL}
|
||||
fi
|
||||
|
||||
instmods amdkfd hyperv_fb
|
||||
|
||||
for _modname in $(find_kernel_modules_by_path drivers/gpu/drm \
|
||||
| drm_module_filter) ; do
|
||||
# if the hardware is present, include module even if it is not currently loaded,
|
||||
# as we could e.g. be in the installer; nokmsboot boot parameter will disable
|
||||
# loading of the driver if needed
|
||||
if [[ $hostonly ]] && modinfo -F alias $_modname | sed -e 's,\?,\.,g' -e 's,\*,\.\*,g' \
|
||||
| grep -qxf - /sys/bus/{pci/devices,soc/devices/soc?}/*/modalias 2>/dev/null; then
|
||||
hostonly='' instmods $_modname
|
||||
# if radeon.ko is installed, we want amdkfd also
|
||||
if strstr "$_modname" radeon.ko; then
|
||||
hostonly='' instmods amdkfd
|
||||
# if the hardware is present, include module even if it is not currently loaded,
|
||||
# as we could e.g. be in the installer; nokmsboot boot parameter will disable
|
||||
# loading of the driver if needed
|
||||
if [[ $hostonly ]]; then
|
||||
for i in /sys/bus/{pci/devices,soc/devices/soc?}/*/modalias; do
|
||||
[[ -e $i ]] || continue
|
||||
if hostonly="" dracut_instmods --silent -s "drm_crtc_init" -S "iw_handler_get_spy" $(<$i); then
|
||||
if strstr "$(modinfo -F filename $(<$i) 2>/dev/null)" radeon.ko; then
|
||||
hostonly='' instmods amdkfd
|
||||
fi
|
||||
fi
|
||||
continue
|
||||
fi
|
||||
instmods $_modname
|
||||
done
|
||||
done
|
||||
else
|
||||
dracut_instmods -s "drm_crtc_init" "=drivers/gpu/drm"
|
||||
fi
|
||||
}
|
||||
|
@@ -5,9 +5,14 @@ if type plymouthd >/dev/null 2>&1 && [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
# first trigger graphics subsystem
|
||||
udevadm trigger --action=add --attr-match=class=0x030000 >/dev/null 2>&1
|
||||
# first trigger graphics and tty subsystem
|
||||
udevadm trigger --action=add --subsystem-match=graphics --subsystem-match=drm --subsystem-match=tty >/dev/null 2>&1
|
||||
udevadm trigger --action=add \
|
||||
--subsystem-match=graphics \
|
||||
--subsystem-match=drm \
|
||||
--subsystem-match=tty \
|
||||
--subsystem-match=acpi \
|
||||
>/dev/null 2>&1
|
||||
|
||||
udevadm settle --timeout=30 2>&1 | vinfo
|
||||
udevadm settle --timeout=180 2>&1 | vinfo
|
||||
|
||||
info "Starting plymouth daemon"
|
||||
mkdir -m 0755 /run/plymouth
|
||||
|
@@ -35,4 +35,4 @@ fi
|
||||
IFACES="$IFACES $DEVICE"
|
||||
echo "$IFACES" >> /tmp/net.ifaces
|
||||
|
||||
ifup $DEVICE -m
|
||||
exec ifup "$DEVICE"
|
||||
|
@@ -27,7 +27,7 @@ install() {
|
||||
inst_script "$moddir/cmsifup.sh" /sbin/cmsifup
|
||||
inst_multiple /etc/cmsfs-fuse/filetypes.conf /etc/udev/rules.d/99-fuse.rules /etc/fuse.conf \
|
||||
cmsfs-fuse fusermount ulockmgr_server bash insmod rmmod cat normalize_dasd_arg sed \
|
||||
$(rpm -ql s390utils-base)
|
||||
$(rpm -ql s390utils-base) awk getopt
|
||||
|
||||
inst_libdir_file "gconv/*"
|
||||
#inst /usr/lib/locale/locale-archive
|
||||
|
@@ -8,7 +8,7 @@ check() {
|
||||
require_binaries btrfs || return 1
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for fs in ${host_fs_types[@]}; do
|
||||
for fs in "${host_fs_types[@]}"; do
|
||||
[[ "$fs" == "btrfs" ]] && return 0
|
||||
done
|
||||
return 255
|
||||
|
@@ -5,11 +5,17 @@ command -v getarg >/dev/null || . /lib/dracut-lib.sh
|
||||
# check if the crypttab contains an entry for a LUKS UUID
|
||||
crypttab_contains() {
|
||||
local luks="$1"
|
||||
local dev="$2"
|
||||
local l d rest
|
||||
if [ -f /etc/crypttab ]; then
|
||||
while read l d rest || [ -n "$l" ]; do
|
||||
strstr "${l##luks-}" "${luks##luks-}" && return 0
|
||||
strstr "$d" "${luks##luks-}" && return 0
|
||||
if [ -n "$dev" ]; then
|
||||
for _dev in "$(devnames $d)"; do
|
||||
[ "$dev" -ef "$_dev" ] && return 0
|
||||
done
|
||||
fi
|
||||
done < /etc/crypttab
|
||||
fi
|
||||
return 1
|
||||
@@ -176,14 +182,19 @@ readkey() {
|
||||
local keydev="$2"
|
||||
local device="$3"
|
||||
|
||||
# This creates a unique single mountpoint for *, or several for explicitly
|
||||
# given LUKS devices. It accomplishes unlocking multiple LUKS devices with
|
||||
# a single password entry.
|
||||
local mntp="/mnt/$(str_replace "keydev-$keydev-$keypath" '/' '-')"
|
||||
# No mounting needed if the keyfile resides inside the initrd
|
||||
if [ "/" == "$keydev" ]; then
|
||||
local mntp=/
|
||||
else
|
||||
# This creates a unique single mountpoint for *, or several for explicitly
|
||||
# given LUKS devices. It accomplishes unlocking multiple LUKS devices with
|
||||
# a single password entry.
|
||||
local mntp="/mnt/$(str_replace "keydev-$keydev-$keypath" '/' '-')"
|
||||
|
||||
if [ ! -d "$mntp" ]; then
|
||||
mkdir "$mntp"
|
||||
mount -r "$keydev" "$mntp" || die 'Mounting rem. dev. failed!'
|
||||
if [ ! -d "$mntp" ]; then
|
||||
mkdir "$mntp"
|
||||
mount -r "$keydev" "$mntp" || die 'Mounting rem. dev. failed!'
|
||||
fi
|
||||
fi
|
||||
|
||||
case "${keypath##*.}" in
|
||||
@@ -209,8 +220,11 @@ readkey() {
|
||||
*) cat "$mntp/$keypath" ;;
|
||||
esac
|
||||
|
||||
# General unmounting mechanism, modules doing custom cleanup should return earlier
|
||||
# and install a pre-pivot cleanup hook
|
||||
umount "$mntp"
|
||||
rmdir "$mntp"
|
||||
# No unmounting if the keyfile resides inside the initrd
|
||||
if [ "/" != "$keydev" ]; then
|
||||
# General unmounting mechanism, modules doing custom cleanup should return earlier
|
||||
# and install a pre-pivot cleanup hook
|
||||
umount "$mntp"
|
||||
rmdir "$mntp"
|
||||
fi
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ type crypttab_contains >/dev/null 2>&1 || . /lib/dracut-crypt-lib.sh
|
||||
dev=$1
|
||||
luks=$2
|
||||
|
||||
crypttab_contains "$luks" && exit 0
|
||||
crypttab_contains "$luks" "$dev" && exit 0
|
||||
|
||||
allowdiscards="-"
|
||||
|
||||
@@ -15,10 +15,10 @@ if strstr "$(cryptsetup --help)" "allow-discards"; then
|
||||
if discarduuids=$(getargs "rd.luks.allow-discards"); then
|
||||
discarduuids=$(str_replace "$discarduuids" 'luks-' '')
|
||||
if strstr " $discarduuids " " ${luks##luks-}"; then
|
||||
allowdiscards="allow-discards"
|
||||
allowdiscards="discard"
|
||||
fi
|
||||
elif getargbool 0 rd.luks.allow-discards; then
|
||||
allowdiscards="allow-discards"
|
||||
allowdiscards="discard"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
check() {
|
||||
local _rootdev
|
||||
# if cryptsetup is not installed, then we cannot support encrypted devices.
|
||||
require_binaries cryptsetup || return 1
|
||||
require_any_binary $systemdutildir/systemd-cryptsetup cryptsetup || return 1
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for fs in "${host_fs_types[@]}"; do
|
||||
@@ -24,7 +24,10 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
instmods dm_crypt =crypto
|
||||
hostonly="" instmods drbg
|
||||
arch=$(arch)
|
||||
[[ $arch == x86_64 ]] && arch=x86
|
||||
instmods dm_crypt =crypto =drivers/crypto =arch/$arch/crypto
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
@@ -54,12 +57,12 @@ install() {
|
||||
[[ $_cryptconf ]] && printf "%s\n" "$_cryptconf" >> "${initdir}/etc/cmdline.d/90crypt.conf"
|
||||
fi
|
||||
|
||||
inst_multiple cryptsetup rmdir readlink umount
|
||||
inst_script "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask
|
||||
inst_script "$moddir"/probe-keydev.sh /sbin/probe-keydev
|
||||
inst_hook cmdline 10 "$moddir/parse-keydev.sh"
|
||||
inst_hook cmdline 30 "$moddir/parse-crypt.sh"
|
||||
if ! dracut_module_included "systemd"; then
|
||||
inst_multiple cryptsetup rmdir readlink umount
|
||||
inst_script "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask
|
||||
inst_script "$moddir"/probe-keydev.sh /sbin/probe-keydev
|
||||
inst_hook cmdline 10 "$moddir/parse-keydev.sh"
|
||||
inst_hook cleanup 30 "$moddir/crypt-cleanup.sh"
|
||||
fi
|
||||
|
||||
@@ -85,14 +88,17 @@ install() {
|
||||
|
||||
inst_simple "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh"
|
||||
|
||||
inst_multiple -o \
|
||||
$systemdutildir/system-generators/systemd-cryptsetup-generator \
|
||||
$systemdutildir/systemd-cryptsetup \
|
||||
$systemdsystemunitdir/systemd-ask-password-console.path \
|
||||
$systemdsystemunitdir/systemd-ask-password-console.service \
|
||||
$systemdsystemunitdir/cryptsetup.target \
|
||||
$systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \
|
||||
systemd-ask-password systemd-tty-ask-password-agent
|
||||
inst_script "$moddir"/crypt-run-generator.sh /sbin/crypt-run-generator
|
||||
if dracut_module_included "systemd"; then
|
||||
inst_multiple -o \
|
||||
$systemdutildir/system-generators/systemd-cryptsetup-generator \
|
||||
$systemdutildir/systemd-cryptsetup \
|
||||
$systemdsystemunitdir/systemd-ask-password-console.path \
|
||||
$systemdsystemunitdir/systemd-ask-password-console.service \
|
||||
$systemdsystemunitdir/cryptsetup.target \
|
||||
$systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \
|
||||
systemd-ask-password systemd-tty-ask-password-agent
|
||||
inst_script "$moddir"/crypt-run-generator.sh /sbin/crypt-run-generator
|
||||
fi
|
||||
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
@@ -17,7 +17,12 @@ if getargbool 1 rd.luks -n rd_NO_LUKS && \
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ -n "$keydev" ]; then
|
||||
# A keydev of '/' is treated as the initrd itself
|
||||
if [ "/" == "$keydev" ]; then
|
||||
[ -z "$luksdev" ] && luksdev='*'
|
||||
echo "$luksdev:$keydev:$keypath" >> /tmp/luks.keys
|
||||
continue
|
||||
elif [ -n "$keydev" ]; then
|
||||
udevmatch "$keydev" >&7 || {
|
||||
warn 'keydev incorrect!'
|
||||
continue
|
||||
|
@@ -14,7 +14,8 @@ _do_dm_shutdown() {
|
||||
return $ret
|
||||
}
|
||||
|
||||
if command -v dmsetup >/dev/null; then
|
||||
if command -v dmsetup >/dev/null &&
|
||||
[ "x$(dmsetup status)" != "xNo devices found" ]; then
|
||||
_do_dm_shutdown $1
|
||||
else
|
||||
:
|
||||
|
@@ -13,8 +13,7 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
instmods =drivers/md
|
||||
instmods dm_mod dm-cache dm-cache-mq dm-cache-cleaner
|
||||
instmods =drivers/md dm_mod dm-cache dm-cache-mq dm-cache-cleaner
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
|
@@ -9,13 +9,15 @@ ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="dm_end"
|
||||
|
||||
ENV{ID_FS_TYPE}=="linux_raid_member", GOTO="dm_end"
|
||||
|
||||
ENV{ID_FS_TYPE}!="*_raid_member", , GOTO="dm_end"
|
||||
ENV{ID_FS_TYPE}!="*_raid_member", GOTO="dm_end"
|
||||
|
||||
ENV{ID_FS_TYPE}=="isw_raid_member", ENV{rd_NO_MDIMSM}!="?*", GOTO="dm_end"
|
||||
ENV{ID_FS_TYPE}=="ddf_raid_member", ENV{rd_NO_MDDDF}!="?*", GOTO="dm_end"
|
||||
|
||||
ENV{rd_NO_DM}=="?*", GOTO="dm_end"
|
||||
|
||||
OPTIONS:="nowatch"
|
||||
|
||||
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="dm_end"
|
||||
|
||||
PROGRAM=="/bin/sh -c 'for i in $sys/$devpath/holders/dm-[0-9]*; do [ -e $$i ] && exit 0; done; exit 1;' ", \
|
||||
@@ -24,6 +26,6 @@ PROGRAM=="/bin/sh -c 'for i in $sys/$devpath/holders/dm-[0-9]*; do [ -e $$i ] &&
|
||||
ENV{DEVTYPE}!="partition", \
|
||||
RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}"
|
||||
|
||||
RUN+="/sbin/initqueue --onetime --unique --settled /sbin/dmraid_scan"
|
||||
RUN+="/sbin/initqueue --onetime --unique --settled /sbin/dmraid_scan $env{DEVNAME}"
|
||||
|
||||
LABEL="dm_end"
|
||||
|
@@ -2,6 +2,13 @@
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
dev="$1"
|
||||
devenc=$(str_replace "$1" '/' '\2f')
|
||||
|
||||
[ -e /tmp/dmraid.$devenc ] && exit 0
|
||||
|
||||
>/tmp/dmraid.$devenc
|
||||
|
||||
DM_RAIDS=$(getargs rd.dm.uuid -d rd_DM_UUID=)
|
||||
|
||||
if [ -n "$DM_RAIDS" ] || getargbool 0 rd.auto; then
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -b /dev/mapper/live-rw ] && [ -d /run/initramfs/live/updates -o -d /updates ]; then
|
||||
if [ -L /run/rootfsbase ] && [ -d /run/initramfs/live/updates -o -d /updates ]; then
|
||||
info "Applying updates to live image..."
|
||||
mount -o bind /run $NEWROOT/run
|
||||
# avoid overwriting symlinks (e.g. /lib -> /usr/lib) with directories
|
||||
|
@@ -52,15 +52,30 @@ esac
|
||||
|
||||
GENERATOR_DIR="$2"
|
||||
[ -z "$GENERATOR_DIR" ] && exit 1
|
||||
|
||||
[ -d "$GENERATOR_DIR" ] || mkdir "$GENERATOR_DIR"
|
||||
|
||||
getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes"
|
||||
[ -e /xor_overlayfs ] && xor_overlayfs="yes"
|
||||
ROOTFLAGS="$(getarg rootflags)"
|
||||
{
|
||||
echo "[Unit]"
|
||||
echo "Before=initrd-root-fs.target"
|
||||
echo "[Mount]"
|
||||
echo "Where=/sysroot"
|
||||
echo "What=/dev/mapper/live-rw"
|
||||
[ -n "$ROOTFLAGS" ] && echo "Options=${ROOTFLAGS}"
|
||||
if [ "$overlayfs$xor_overlayfs" = "yes" ]; then
|
||||
echo "What=LiveOS_rootfs"
|
||||
echo "Options=${ROOTFLAGS},lowerdir=/run/rootfsbase,upperdir=/run/overlayfs,workdir=/run/ovlwork"
|
||||
echo "Type=overlay"
|
||||
_dev=LiveOS_rootfs
|
||||
else
|
||||
echo "What=/dev/mapper/live-rw"
|
||||
[ -n "$ROOTFLAGS" ] && echo "Options=${ROOTFLAGS}"
|
||||
_dev=dev-mapper-live\x2drw
|
||||
fi
|
||||
} > "$GENERATOR_DIR"/sysroot.mount
|
||||
|
||||
mkdir -p "$GENERATOR_DIR/$_dev.device.d"
|
||||
{
|
||||
echo "[Unit]"
|
||||
echo "JobTimeoutSec=3000"
|
||||
} > "$GENERATOR_DIR/$_dev.device.d/timeout.conf"
|
||||
|
@@ -28,9 +28,10 @@ getargbool 0 rd.live.overlay.readonly -d -y readonly_overlay && readonly_overlay
|
||||
overlay=$(getarg rd.live.overlay -d overlay)
|
||||
getargbool 0 rd.writable.fsimg -d -y writable_fsimg && writable_fsimg="yes"
|
||||
overlay_size=$(getarg rd.live.overlay.size=)
|
||||
[ -z "$overlay_size" ] && overlay_size=512
|
||||
[ -z "$overlay_size" ] && overlay_size=32768
|
||||
|
||||
getargbool 0 rd.live.overlay.thin && thin_snapshot="yes"
|
||||
getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes"
|
||||
|
||||
# CD/DVD media check
|
||||
[ -b $livedev ] && fs=$(blkid -s TYPE -o value $livedev)
|
||||
@@ -41,7 +42,7 @@ getarg rd.live.check -d check || check=""
|
||||
if [ -n "$check" ]; then
|
||||
type plymouth >/dev/null 2>&1 && plymouth --hide-splash
|
||||
if [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
p=$(str_replace "$livedev" "-" '\x2d')
|
||||
p=$(dev_unit_name "$livedev")
|
||||
systemctl start checkisomd5@${p}.service
|
||||
else
|
||||
checkisomd5 --verbose $livedev
|
||||
@@ -57,7 +58,7 @@ ln -s $livedev /run/initramfs/livedev
|
||||
|
||||
# determine filesystem type for a filesystem image
|
||||
det_img_fs() {
|
||||
udevadm settle
|
||||
udevadm settle >&2
|
||||
blkid -s TYPE -u noraid -o value "$1"
|
||||
}
|
||||
|
||||
@@ -89,7 +90,6 @@ do_live_overlay() {
|
||||
# create a sparse file for the overlay
|
||||
# overlay: if non-ram overlay searching is desired, do it,
|
||||
# otherwise, create traditional overlay in ram
|
||||
OVERLAY_LOOPDEV=$( losetup -f )
|
||||
|
||||
l=$(blkid -s LABEL -o value $livedev) || l=""
|
||||
u=$(blkid -s UUID -o value $livedev) || u=""
|
||||
@@ -107,51 +107,117 @@ do_live_overlay() {
|
||||
devspec=$( echo $overlay | sed -e 's/:.*$//' )
|
||||
|
||||
# need to know where to look for the overlay
|
||||
setup=""
|
||||
if [ -n "$devspec" -a -n "$pathspec" -a -n "$overlay" ]; then
|
||||
if [ -z "$setup" -a -n "$devspec" -a -n "$pathspec" -a -n "$overlay" ]; then
|
||||
mkdir -m 0755 /run/initramfs/overlayfs
|
||||
opt=''
|
||||
[ -n "$readonly_overlay" ] && opt=-r
|
||||
mount -n -t auto $devspec /run/initramfs/overlayfs || :
|
||||
if [ -f /run/initramfs/overlayfs$pathspec -a -w /run/initramfs/overlayfs$pathspec ]; then
|
||||
losetup $OVERLAY_LOOPDEV /run/initramfs/overlayfs$pathspec
|
||||
if [ -n "$reset_overlay" ]; then
|
||||
dd if=/dev/zero of=$OVERLAY_LOOPDEV bs=64k count=1 conv=fsync 2>/dev/null
|
||||
OVERLAY_LOOPDEV=$(losetup -f --show $opt /run/initramfs/overlayfs$pathspec)
|
||||
over=$OVERLAY_LOOPDEV
|
||||
umount -l /run/initramfs/overlayfs || :
|
||||
oltype=$(det_img_fs $OVERLAY_LOOPDEV)
|
||||
if [ -z "$oltype" ] || [ "$oltype" = DM_snapshot_cow ]; then
|
||||
if [ -n "$reset_overlay" ]; then
|
||||
info "Resetting the Device-mapper overlay."
|
||||
dd if=/dev/zero of=$OVERLAY_LOOPDEV bs=64k count=1 conv=fsync 2>/dev/null
|
||||
fi
|
||||
if [ -n "$overlayfs" ]; then
|
||||
unset -v overlayfs
|
||||
[ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit="yes"
|
||||
fi
|
||||
setup="yes"
|
||||
else
|
||||
mount -n -t $oltype $opt $OVERLAY_LOOPDEV /run/initramfs/overlayfs
|
||||
if [ -d /run/initramfs/overlayfs/overlayfs ] &&
|
||||
[ -d /run/initramfs/overlayfs/ovlwork ]; then
|
||||
ln -s /run/initramfs/overlayfs/overlayfs /run/overlayfs$opt
|
||||
ln -s /run/initramfs/overlayfs/ovlwork /run/ovlwork$opt
|
||||
if [ -z "$overlayfs" ]; then
|
||||
overlayfs="yes"
|
||||
[ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit="yes"
|
||||
fi
|
||||
setup="yes"
|
||||
fi
|
||||
fi
|
||||
elif [ -d /run/initramfs/overlayfs$pathspec ] &&
|
||||
[ -d /run/initramfs/overlayfs$pathspec/../ovlwork ]; then
|
||||
ln -s /run/initramfs/overlayfs$pathspec /run/overlayfs$opt
|
||||
ln -s /run/initramfs/overlayfs$pathspec/../ovlwork /run/ovlwork$opt
|
||||
if [ -z "$overlayfs" ]; then
|
||||
overlayfs="yes"
|
||||
[ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit="yes"
|
||||
fi
|
||||
setup="yes"
|
||||
fi
|
||||
umount -l /run/initramfs/overlayfs || :
|
||||
fi
|
||||
if [ -n "$overlayfs" ]; then
|
||||
modprobe overlay
|
||||
if [ $? != 0 ]; then
|
||||
m='OverlayFS is not available; using temporary Device-mapper overlay.'
|
||||
unset -v overlayfs setup
|
||||
[ -n "$reloadsysrootmountunit" ] && unset -v reloadsysrootmountunit
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$setup" -o -n "$readonly_overlay" ]; then
|
||||
if [ -n "$setup" ]; then
|
||||
warn "Using temporary overlay."
|
||||
elif [ -n "$devspec" -a -n "$pathspec" ]; then
|
||||
warn "Unable to find persistent overlay; using temporary"
|
||||
sleep 5
|
||||
[ -z "$m" ] &&
|
||||
m=' Unable to find a persistent overlay; using a temporary one.'
|
||||
m=($'\n' "$m" $'\n'
|
||||
' All root filesystem changes will be lost on shutdown.'
|
||||
$'\n' ' Press any key to continue')
|
||||
echo -e "\n\n\n${m[*]}\n\n\n" > /dev/kmsg
|
||||
if [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
if plymouth --ping ; then
|
||||
if getargbool 0 rhgb || getargbool 0 splash ; then
|
||||
m[0]='>>>'$'\n''>>>'$'\n''>>>'$'\n\n'
|
||||
m[5]=$'\n''<<<'$'\n''<<<'$'\n''<<<'
|
||||
plymouth display-message --text="${m[*]}"
|
||||
else
|
||||
plymouth ask-question --prompt="${m[*]}" --command=true
|
||||
fi
|
||||
else
|
||||
m[0]='>>>'
|
||||
m[5]='<<<'
|
||||
unset -v m[2] m[4]
|
||||
systemd-ask-password --timeout=0 "${m[*]}"
|
||||
fi
|
||||
else
|
||||
plymouth --ping && plymouth --quit
|
||||
read -s -r -p $'\n\n'"${m[*]}:" -n 1 reply
|
||||
fi
|
||||
fi
|
||||
|
||||
dd if=/dev/null of=/overlay bs=1024 count=1 seek=$((overlay_size*1024)) 2> /dev/null
|
||||
if [ -n "$setup" -a -n "$readonly_overlay" ]; then
|
||||
RO_OVERLAY_LOOPDEV=$( losetup -f )
|
||||
losetup $RO_OVERLAY_LOOPDEV /overlay
|
||||
if [ -n "$overlayfs" ]; then
|
||||
mkdir -m 0755 /run/overlayfs
|
||||
mkdir -m 0755 /run/ovlwork
|
||||
else
|
||||
losetup $OVERLAY_LOOPDEV /overlay
|
||||
dd if=/dev/null of=/overlay bs=1024 count=1 seek=$((overlay_size*1024)) 2> /dev/null
|
||||
if [ -n "$setup" -a -n "$readonly_overlay" ]; then
|
||||
RO_OVERLAY_LOOPDEV=$(losetup -f --show /overlay)
|
||||
over=$RO_OVERLAY_LOOPDEV
|
||||
else
|
||||
OVERLAY_LOOPDEV=$(losetup -f --show /overlay)
|
||||
over=$OVERLAY_LOOPDEV
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# set up the snapshot
|
||||
sz=$(blockdev --getsz $BASE_LOOPDEV)
|
||||
if [ -n "$readonly_overlay" ]; then
|
||||
echo 0 $sz snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create $readonly_overlay live-ro
|
||||
base="/dev/mapper/live-ro"
|
||||
over=$RO_OVERLAY_LOOPDEV
|
||||
else
|
||||
base=$BASE_LOOPDEV
|
||||
over=$OVERLAY_LOOPDEV
|
||||
if [ -z "$overlayfs" ]; then
|
||||
if [ -n "$readonly_overlay" ] && [ -n "$OVERLAY_LOOPDEV" ]; then
|
||||
echo 0 $sz snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV P 8 | dmsetup create --readonly live-ro
|
||||
base="/dev/mapper/live-ro"
|
||||
else
|
||||
base=$BASE_LOOPDEV
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$thin_snapshot" ]; then
|
||||
modprobe dm_thin_pool
|
||||
mkdir /run/initramfs/thin-overlay
|
||||
mkdir -m 0755 /run/initramfs/thin-overlay
|
||||
|
||||
# In block units (512b)
|
||||
thin_data_sz=$(( $overlay_size * 1024 * 1024 / 512 ))
|
||||
@@ -170,25 +236,17 @@ do_live_overlay() {
|
||||
|
||||
# Create a snapshot of the base image
|
||||
echo 0 $sz thin /dev/mapper/live-overlay-pool 0 $base | dmsetup create live-rw
|
||||
else
|
||||
echo 0 $sz snapshot $base $over p 8 | dmsetup create live-rw
|
||||
elif [ -z "$overlayfs" ]; then
|
||||
echo 0 $sz snapshot $base $over PO 8 | dmsetup create live-rw
|
||||
fi
|
||||
|
||||
# Create a device that always points to a ro base image
|
||||
echo 0 $sz linear $base 0 | dmsetup create --readonly live-base
|
||||
}
|
||||
|
||||
# live cd helper function
|
||||
do_live_from_base_loop() {
|
||||
do_live_overlay
|
||||
echo 0 $sz linear $BASE_LOOPDEV 0 | dmsetup create --readonly live-base
|
||||
}
|
||||
|
||||
# we might have a genMinInstDelta delta file for anaconda to take advantage of
|
||||
if [ -e /run/initramfs/live/${live_dir}/osmin.img ]; then
|
||||
OSMINSQFS=/run/initramfs/live/${live_dir}/osmin.img
|
||||
fi
|
||||
|
||||
if [ -n "$OSMINSQFS" ]; then
|
||||
# decompress the delta data
|
||||
dd if=$OSMINSQFS of=/run/initramfs/osmin.img 2> /dev/null
|
||||
OSMIN_SQUASHED_LOOPDEV=$( losetup -f )
|
||||
@@ -204,14 +262,12 @@ fi
|
||||
if [ -e /run/initramfs/live/${live_dir}/${squash_image} ]; then
|
||||
SQUASHED="/run/initramfs/live/${live_dir}/${squash_image}"
|
||||
fi
|
||||
|
||||
if [ -e "$SQUASHED" ] ; then
|
||||
if [ -n "$live_ram" ] ; then
|
||||
echo "Copying live image to RAM..."
|
||||
echo "(this may take a few minutes)"
|
||||
if [ -e "$SQUASHED" ]; then
|
||||
if [ -n "$live_ram" ]; then
|
||||
echo 'Copying live image to RAM...' > /dev/kmsg
|
||||
echo ' (this may take a minute)' > /dev/kmsg
|
||||
dd if=$SQUASHED of=/run/initramfs/squashed.img bs=512 2> /dev/null
|
||||
umount -n /run/initramfs/live
|
||||
echo "Done copying live image to RAM."
|
||||
echo 'Done copying live image to RAM.' > /dev/kmsg
|
||||
SQUASHED="/run/initramfs/squashed.img"
|
||||
fi
|
||||
|
||||
@@ -220,57 +276,103 @@ if [ -e "$SQUASHED" ] ; then
|
||||
mkdir -m 0755 -p /run/initramfs/squashfs
|
||||
mount -n -t squashfs -o ro $SQUASHED_LOOPDEV /run/initramfs/squashfs
|
||||
|
||||
fi
|
||||
|
||||
# we might have an embedded fs image to use as rootfs (uncompressed live)
|
||||
if [ -e /run/initramfs/live/${live_dir}/ext3fs.img ]; then
|
||||
FSIMG="/run/initramfs/live/${live_dir}/ext3fs.img"
|
||||
elif [ -e /run/initramfs/live/${live_dir}/rootfs.img ]; then
|
||||
FSIMG="/run/initramfs/live/${live_dir}/rootfs.img"
|
||||
elif [ -f /run/initramfs/squashfs/LiveOS/ext3fs.img ]; then
|
||||
FSIMG="/run/initramfs/squashfs/LiveOS/ext3fs.img"
|
||||
elif [ -f /run/initramfs/squashfs/LiveOS/rootfs.img ]; then
|
||||
FSIMG="/run/initramfs/squashfs/LiveOS/rootfs.img"
|
||||
if [ -f /run/initramfs/squashfs/LiveOS/rootfs.img ]; then
|
||||
FSIMG="/run/initramfs/squashfs/LiveOS/rootfs.img"
|
||||
elif [ -f /run/initramfs/squashfs/LiveOS/ext3fs.img ]; then
|
||||
FSIMG="/run/initramfs/squashfs/LiveOS/ext3fs.img"
|
||||
fi
|
||||
else
|
||||
# we might have an embedded fs image to use as rootfs (uncompressed live)
|
||||
if [ -e /run/initramfs/live/${live_dir}/rootfs.img ]; then
|
||||
FSIMG="/run/initramfs/live/${live_dir}/rootfs.img"
|
||||
elif [ -e /run/initramfs/live/${live_dir}/ext3fs.img ]; then
|
||||
FSIMG="/run/initramfs/live/${live_dir}/ext3fs.img"
|
||||
fi
|
||||
if [ -n "$live_ram" ]; then
|
||||
echo 'Copying live image to RAM...' > /dev/kmsg
|
||||
echo ' (this may take a minute or so)' > /dev/kmsg
|
||||
dd if=$FSIMG of=/run/initramfs/rootfs.img bs=512 2> /dev/null
|
||||
echo 'Done copying live image to RAM.' > /dev/kmsg
|
||||
FSIMG='/run/initramfs/rootfs.img'
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$FSIMG" ] ; then
|
||||
BASE_LOOPDEV=$( losetup -f )
|
||||
|
||||
if [ -n "$writable_fsimg" ] ; then
|
||||
# mount the provided fileysstem read/write
|
||||
echo "Unpacking live filesystem (may take some time)"
|
||||
mkdir /run/initramfs/fsimg/
|
||||
# mount the provided filesystem read/write
|
||||
echo "Unpacking live filesystem (may take some time)" > /dev/kmsg
|
||||
mkdir -m 0755 /run/initramfs/fsimg/
|
||||
if [ -n "$SQUASHED" ]; then
|
||||
cp -v $FSIMG /run/initramfs/fsimg/rootfs.img
|
||||
else
|
||||
unpack_archive $FSIMG /run/initramfs/fsimg/
|
||||
fi
|
||||
losetup $BASE_LOOPDEV /run/initramfs/fsimg/rootfs.img
|
||||
echo "0 $( blockdev --getsize $BASE_LOOPDEV ) linear $BASE_LOOPDEV 0" | dmsetup create live-rw
|
||||
FSIMG=/run/initramfs/fsimg/rootfs.img
|
||||
fi
|
||||
opt=-r
|
||||
# For writable DM images...
|
||||
if [ -z "$SQUASHED" -a -n "$live_ram" -a -z "$overlayfs" ] ||
|
||||
[ -n "$writable_fsimg" ] ||
|
||||
[ "$overlay" = none -o "$overlay" = None -o "$overlay" = NONE ]; then
|
||||
if [ -z "$readonly_overlay" ]; then
|
||||
opt=''
|
||||
setup=rw
|
||||
else
|
||||
setup=yes
|
||||
fi
|
||||
fi
|
||||
BASE_LOOPDEV=$(losetup -f --show $opt $FSIMG)
|
||||
sz=$(blockdev --getsz $BASE_LOOPDEV)
|
||||
if [ "$setup" == rw ]; then
|
||||
echo 0 $sz linear $BASE_LOOPDEV 0 | dmsetup create live-rw
|
||||
else
|
||||
# mount the filesystem read-only and add a dm snapshot for writes
|
||||
losetup -r $BASE_LOOPDEV $FSIMG
|
||||
do_live_from_base_loop
|
||||
# Add a DM snapshot or OverlayFS for writes.
|
||||
do_live_overlay
|
||||
fi
|
||||
fi
|
||||
|
||||
[ -e "$SQUASHED" ] && umount -l /run/initramfs/squashfs
|
||||
[ -e "$SQUASHED" ] && [ -z "$overlayfs" ] && umount -l /run/initramfs/squashfs
|
||||
|
||||
if [ -b "$OSMIN_LOOPDEV" ]; then
|
||||
# set up the devicemapper snapshot device, which will merge
|
||||
# the normal live fs image, and the delta, into a minimzied fs image
|
||||
echo "0 $( blockdev --getsz $BASE_LOOPDEV ) snapshot $BASE_LOOPDEV $OSMIN_LOOPDEV p 8" | dmsetup create --readonly live-osimg-min
|
||||
echo "0 $sz snapshot $BASE_LOOPDEV $OSMIN_LOOPDEV P 8" | dmsetup create --readonly live-osimg-min
|
||||
fi
|
||||
|
||||
if [ -n "$reloadsysrootmountunit" ]; then
|
||||
> /xor_overlayfs
|
||||
systemctl daemon-reload
|
||||
fi
|
||||
|
||||
ROOTFLAGS="$(getarg rootflags)"
|
||||
if [ -n "$ROOTFLAGS" ]; then
|
||||
ROOTFLAGS="-o $ROOTFLAGS"
|
||||
fi
|
||||
|
||||
ln -s /dev/mapper/live-rw /dev/root
|
||||
|
||||
if [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
printf 'mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > $hookdir/mount/01-$$-live.sh
|
||||
if [ -n "$overlayfs" ]; then
|
||||
mkdir -m 0755 /run/rootfsbase
|
||||
if [ -n "$reset_overlay" ] && [ -L /run/overlayfs ]; then
|
||||
ovlfs=$(readlink /run/overlayfs)
|
||||
info "Resetting the OverlayFS overlay directory."
|
||||
rm -r -- ${ovlfs}/* ${ovlfs}/.* >/dev/null 2>&1
|
||||
fi
|
||||
if [ -n "$readonly_overlay" ]; then
|
||||
mkdir -m 0755 /run/rootfsbase-r
|
||||
mount -r $FSIMG /run/rootfsbase-r
|
||||
mount -t overlay LiveOS_rootfs-r -oro,lowerdir=/run/overlayfs-r:/run/rootfsbase-r /run/rootfsbase
|
||||
else
|
||||
mount -r $FSIMG /run/rootfsbase
|
||||
fi
|
||||
if [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
#FIXME What to link to /dev/root? Is it even needed?
|
||||
printf 'mount -t overlay LiveOS_rootfs -o%s,%s %s\n' "$ROOTFLAGS" \
|
||||
'lowerdir=/run/rootfsbase,upperdir=/run/overlayfs,workdir=/run/ovlwork' \
|
||||
"$NEWROOT" > $hookdir/mount/01-$$-live.sh
|
||||
fi
|
||||
else
|
||||
ln -s /dev/mapper/live-rw /dev/root
|
||||
if [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
[ -n "$ROOTFLAGS" ] && ROOTFLAGS="-o $ROOTFLAGS"
|
||||
printf 'mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > $hookdir/mount/01-$$-live.sh
|
||||
fi
|
||||
ln -s $BASE_LOOPDEV /run/rootfsbase
|
||||
fi
|
||||
|
||||
need_shutdown
|
||||
|
@@ -17,7 +17,7 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
instmods squashfs loop iso9660
|
||||
instmods squashfs loop iso9660 overlay
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
|
@@ -57,6 +57,6 @@ info "root was $liveroot, is now $root"
|
||||
# make sure that init doesn't complain
|
||||
[ -z "$root" ] && root="live"
|
||||
|
||||
wait_for_dev -n /dev/mapper/live-rw
|
||||
wait_for_dev -n /run/rootfsbase
|
||||
|
||||
return 0
|
||||
|
@@ -2,81 +2,57 @@
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
if [[ -z $drivers ]]; then
|
||||
block_module_filter() {
|
||||
local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host'
|
||||
# subfunctions inherit following FDs
|
||||
local _merge=8 _side2=9
|
||||
function bmf1() {
|
||||
local _f
|
||||
while read _f || [ -n "$_f" ]; do case "$_f" in
|
||||
*.ko) [[ $(< $_f) =~ $_blockfuncs ]] && echo "$_f" ;;
|
||||
*.ko.gz) [[ $(gzip -dc <$_f) =~ $_blockfuncs ]] && echo "$_f" ;;
|
||||
*.ko.xz) [[ $(xz -dc <$_f) =~ $_blockfuncs ]] && echo "$_f" ;;
|
||||
esac
|
||||
done
|
||||
return 0
|
||||
}
|
||||
function rotor() {
|
||||
local _f1 _f2
|
||||
while read _f1 || [ -n "$_f1" ]; do
|
||||
echo "$_f1"
|
||||
if read _f2; then
|
||||
echo "$_f2" 1>&${_side2}
|
||||
fi
|
||||
done | bmf1 1>&${_merge}
|
||||
return 0
|
||||
}
|
||||
# Use two parallel streams to filter alternating modules.
|
||||
set +x
|
||||
eval "( ( rotor ) ${_side2}>&1 | bmf1 ) ${_merge}>&1"
|
||||
[[ $debug ]] && set -x
|
||||
return 0
|
||||
}
|
||||
local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma'
|
||||
|
||||
if [[ -z $drivers ]]; then
|
||||
hostonly='' instmods \
|
||||
sr_mod sd_mod scsi_dh ata_piix hid_generic unix \
|
||||
ehci-hcd ehci-pci ehci-platform \
|
||||
ohci-hcd ohci-pci \
|
||||
uhci-hcd \
|
||||
xhci-hcd xhci-pci xhci-plat-hcd
|
||||
|
||||
instmods \
|
||||
xhci-hcd xhci-pci xhci-plat-hcd \
|
||||
pinctrl-cherryview \
|
||||
"=drivers/hid" \
|
||||
"=drivers/input/serio" \
|
||||
"=drivers/input/keyboard"
|
||||
"=drivers/input/keyboard" \
|
||||
"=drivers/usb/storage" \
|
||||
${NULL}
|
||||
|
||||
instmods yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
|
||||
atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus
|
||||
instmods \
|
||||
yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
|
||||
atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus \
|
||||
virtio virtio_blk virtio_ring virtio_pci virtio_scsi \
|
||||
"=drivers/pcmcia" =ide nvme
|
||||
|
||||
if [[ "$(uname -p)" == arm* ]]; then
|
||||
# arm specific modules
|
||||
if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]]; then
|
||||
# arm/aarch64 specific modules
|
||||
instmods \
|
||||
"=drivers/clk" \
|
||||
"=drivers/dma" \
|
||||
"=drivers/i2c/busses" \
|
||||
"=drivers/phy" \
|
||||
"=drivers/power" \
|
||||
"=drivers/regulator" \
|
||||
"=drivers/rtc" \
|
||||
"=drivers/usb/chipidea" \
|
||||
"=drivers/usb/dwc2" \
|
||||
"=drivers/usb/dwc3" \
|
||||
"=drivers/usb/host" \
|
||||
"=drivers/usb/musb" \
|
||||
"=drivers/usb/phy" \
|
||||
${NULL}
|
||||
fi
|
||||
|
||||
# install virtual machine support
|
||||
instmods virtio virtio_blk virtio_ring virtio_pci virtio_scsi \
|
||||
"=drivers/pcmcia" =ide "=drivers/usb/storage"
|
||||
|
||||
find_kernel_modules | block_module_filter | instmods
|
||||
dracut_instmods -o -s "${_blockfuncs}" "=drivers"
|
||||
|
||||
# if not on hostonly mode, install all known filesystems,
|
||||
# if the required list is not set via the filesystems variable
|
||||
if ! [[ $hostonly ]]; then
|
||||
if [[ -z $filesystems ]]; then
|
||||
silent_omit_drivers="kernel/fs/nfs|kernel/fs/nfsd|kernel/fs/lockd" \
|
||||
instmods '=fs'
|
||||
dracut_instmods -o -P ".*/(kernel/fs/nfs|kernel/fs/nfsd|kernel/fs/lockd)/.*" '=fs'
|
||||
fi
|
||||
else
|
||||
for i in $(host_fs_all); do
|
||||
hostonly='' instmods $i
|
||||
done
|
||||
hostonly='' instmods "${host_fs_types[@]}"
|
||||
fi
|
||||
fi
|
||||
:
|
||||
|
@@ -14,54 +14,22 @@ depends() {
|
||||
installkernel() {
|
||||
# Include wired net drivers, excluding wireless
|
||||
local _arch=$(uname -m)
|
||||
local _net_drivers='eth_type_trans|register_virtio_device|usbnet_open'
|
||||
local _unwanted_drivers='/(wireless|isdn|uwb|net/ethernet|net/phy|net/team)/'
|
||||
|
||||
net_module_filter() {
|
||||
local _net_drivers='eth_type_trans|register_virtio_device|usbnet_open'
|
||||
local _unwanted_drivers='/(wireless|isdn|uwb|net/ethernet|net/phy|net/team)/'
|
||||
local _ret
|
||||
# subfunctions inherit following FDs
|
||||
local _merge=8 _side2=9
|
||||
function nmf1() {
|
||||
local _fname _fcont
|
||||
while read _fname; do
|
||||
[[ $_fname =~ $_unwanted_drivers ]] && continue
|
||||
case "$_fname" in
|
||||
*.ko) _fcont="$(< $_fname)" ;;
|
||||
*.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
|
||||
*.ko.xz) _fcont="$(xz -dc $_fname)" ;;
|
||||
esac
|
||||
[[ $_fcont =~ $_net_drivers
|
||||
&& ! $_fcont =~ iw_handler_get_spy ]] \
|
||||
&& echo "$_fname"
|
||||
done
|
||||
return 0
|
||||
}
|
||||
function rotor() {
|
||||
local _f1 _f2
|
||||
while read _f1; do
|
||||
echo "$_f1"
|
||||
if read _f2; then
|
||||
echo "$_f2" 1>&${_side2}
|
||||
fi
|
||||
done | nmf1 1>&${_merge}
|
||||
return 0
|
||||
}
|
||||
# Use two parallel streams to filter alternating modules.
|
||||
set +x
|
||||
eval "( ( rotor ) ${_side2}>&1 | nmf1 ) ${_merge}>&1"
|
||||
[[ $debug ]] && set -x
|
||||
return 0
|
||||
}
|
||||
if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then
|
||||
_s390drivers="=drivers/s390/net"
|
||||
fi
|
||||
|
||||
{ find_kernel_modules_by_path drivers/net; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/net; fi; } \
|
||||
| net_module_filter | instmods
|
||||
dracut_instmods -o -P ".*${_unwanted_drivers}.*" -s "$_net_drivers" "=drivers/net" ${_s390drivers:+"$_s390drivers"}
|
||||
|
||||
#instmods() will take care of hostonly
|
||||
instmods \
|
||||
=drivers/net/phy \
|
||||
=drivers/net/team \
|
||||
=drivers/net/ethernet \
|
||||
ecb arc4 bridge stp llc ipv6 bonding 8021q af_packet virtio_net
|
||||
ecb arc4 bridge stp llc ipv6 bonding 8021q af_packet virtio_net xennet
|
||||
hostonly="" instmods iscsi_ibft crc32c iscsi_boot_sysfs
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
|
60
modules.d/90livenet/livenet-generator.sh
Executable file
60
modules.d/90livenet/livenet-generator.sh
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/bin/sh
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
[ -z "$root" ] && root=$(getarg root=)
|
||||
|
||||
# support legacy syntax of passing liveimg and then just the base root
|
||||
if getargbool 0 rd.live.image -d -y liveimg; then
|
||||
liveroot="live:$root"
|
||||
fi
|
||||
|
||||
if [ "${root%%:*}" = "live" ] ; then
|
||||
liveroot=$root
|
||||
fi
|
||||
|
||||
[ "${liveroot%%:*}" = "live" ] || exit 0
|
||||
|
||||
case "$liveroot" in
|
||||
live:nfs://*|nfs://*) \
|
||||
root="${root#live:}"
|
||||
rootok=1 ;;
|
||||
live:http://*|http://*) \
|
||||
root="${root#live:}"
|
||||
rootok=1 ;;
|
||||
live:https://*|https://*) \
|
||||
root="${root#live:}"
|
||||
rootok=1 ;;
|
||||
live:ftp://*|ftp://*) \
|
||||
root="${root#live:}"
|
||||
rootok=1 ;;
|
||||
live:torrent://*|torrent://*) \
|
||||
root="${root#live:}"
|
||||
rootok=1 ;;
|
||||
live:tftp://*|tftp://*) \
|
||||
root="${root#live:}"
|
||||
rootok=1 ;;
|
||||
esac
|
||||
|
||||
[ "$rootok" != "1" ] && exit 0
|
||||
|
||||
GENERATOR_DIR="$2"
|
||||
[ -z "$GENERATOR_DIR" ] && exit 1
|
||||
|
||||
[ -d "$GENERATOR_DIR" ] || mkdir "$GENERATOR_DIR"
|
||||
|
||||
ROOTFLAGS="$(getarg rootflags)"
|
||||
{
|
||||
echo "[Unit]"
|
||||
echo "Before=initrd-root-fs.target"
|
||||
echo "[Mount]"
|
||||
echo "Where=/sysroot"
|
||||
echo "What=/dev/mapper/live-rw"
|
||||
[ -n "$ROOTFLAGS" ] && echo "Options=${ROOTFLAGS}"
|
||||
} > "$GENERATOR_DIR"/sysroot.mount
|
||||
|
||||
mkdir -p "$GENERATOR_DIR/dev-mapper-live\x2drw.device.d"
|
||||
{
|
||||
echo "[Unit]"
|
||||
echo "JobTimeoutSec=3000"
|
||||
} > "$GENERATOR_DIR/dev-mapper-live\x2drw.device.d/timeout.conf"
|
@@ -7,12 +7,20 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
[ -e /tmp/livenet.downloaded ] && exit 0
|
||||
|
||||
# args get passed from 40network/netroot
|
||||
netroot="$2"
|
||||
liveurl="${netroot#livenet:}"
|
||||
info "fetching $liveurl"
|
||||
imgfile=$(fetch_url "$liveurl")
|
||||
[ $? = 0 ] || die "failed to download live image: error $?"
|
||||
|
||||
if [ $? != 0 ]; then
|
||||
warn "failed to download live image: error $?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
> /tmp/livenet.downloaded
|
||||
|
||||
# TODO: couldn't dmsquash-live-root handle this?
|
||||
if [ ${imgfile##*.} = "iso" ]; then
|
||||
|
@@ -17,6 +17,8 @@ install() {
|
||||
inst_hook cmdline 29 "$moddir/parse-livenet.sh"
|
||||
inst_hook initqueue/online 95 "$moddir/fetch-liveupdate.sh"
|
||||
inst_script "$moddir/livenetroot.sh" "/sbin/livenetroot"
|
||||
if dracut_module_included "systemd-initrd"; then
|
||||
inst_script "$moddir/livenet-generator.sh" $systemdutildir/system-generators/dracut-livenet-generator
|
||||
fi
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
||||
|
@@ -15,14 +15,14 @@ SNAPSIZE=$(getargs rd.lvm.snapsize -d rd_LVM_SNAPSIZE=)
|
||||
lvmdevs=$(
|
||||
for f in /tmp/.lvm_scan-*; do
|
||||
[ -e "$f" ] || continue
|
||||
echo -n "${f##/tmp/.lvm_scan-} "
|
||||
printf '%s' "${f##/tmp/.lvm_scan-} "
|
||||
done
|
||||
)
|
||||
|
||||
if [ ! -e /etc/lvm/lvm.conf ]; then
|
||||
{
|
||||
echo 'devices {';
|
||||
echo -n ' filter = [ '
|
||||
printf ' filter = [ '
|
||||
for dev in $lvmdevs; do
|
||||
printf '"a|^/dev/%s$|", ' $dev;
|
||||
done;
|
||||
@@ -69,11 +69,19 @@ min=$2
|
||||
sub=${3%% *}
|
||||
sub=${sub%%\(*};
|
||||
|
||||
lvm_ignorelockingfailure="--ignorelockingfailure"
|
||||
lvm_quirk_args="--ignorelockingfailure --ignoremonitoring"
|
||||
|
||||
check_lvm_ver 2 2 57 $maj $min $sub && \
|
||||
nopoll="--poll n"
|
||||
lvm_quirk_args="$lvm_quirk_args --poll n"
|
||||
|
||||
if check_lvm_ver 2 2 65 $maj $min $sub; then
|
||||
sysinit=" --sysinit $extraargs"
|
||||
lvm_quirk_args=" --sysinit $extraargs"
|
||||
fi
|
||||
|
||||
if check_lvm_ver 2 2 221 $maj $min $sub; then
|
||||
lvm_quirk_args=" $extraargs"
|
||||
unset lvm_ignorelockingfailure
|
||||
fi
|
||||
|
||||
unset extraargs
|
||||
@@ -104,28 +112,16 @@ fi
|
||||
|
||||
if [ -n "$LVS" ] ; then
|
||||
info "Scanning devices $lvmdevs for LVM logical volumes $LVS"
|
||||
lvm lvscan --ignorelockingfailure 2>&1 | vinfo
|
||||
lvm lvscan $lvm_ignorelockingfailure 2>&1 | vinfo
|
||||
for LV in $LVS; do
|
||||
if [ "x$(lvm lvs --noheadings --select "lv_attr =~ k" $LV | wc -l)" = "x0" ]; then
|
||||
info "Skipping activation of '$LV' because activationskip is set."
|
||||
continue
|
||||
fi
|
||||
if [ -z "$sysinit" ]; then
|
||||
lvm lvchange --yes -ay --ignorelockingfailure $nopoll --ignoremonitoring $LV 2>&1 | vinfo
|
||||
else
|
||||
lvm lvchange --yes -ay $sysinit $LV 2>&1 | vinfo
|
||||
fi
|
||||
lvm lvchange --yes -ay $lvm_quirk_args $LV 2>&1 | vinfo
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -z "$LVS" -o -n "$VGS" ]; then
|
||||
info "Scanning devices $lvmdevs for LVM volume groups $VGS"
|
||||
lvm vgscan --ignorelockingfailure 2>&1 | vinfo
|
||||
if [ -z "$sysinit" ]; then
|
||||
lvm vgchange -ay --ignorelockingfailure $nopoll --ignoremonitoring $VGS 2>&1 | vinfo
|
||||
else
|
||||
lvm vgchange -ay $sysinit $VGS 2>&1 | vinfo
|
||||
fi
|
||||
lvm vgscan $lvm_ignorelockingfailure 2>&1 | vinfo
|
||||
lvm vgchange -ay $lvm_quirk_args $VGS 2>&1 | vinfo
|
||||
fi
|
||||
|
||||
if [ "$lvmwritten" ]; then
|
||||
|
@@ -73,7 +73,7 @@ install() {
|
||||
if [ -f /etc/lvm/lvmlocal.conf ]; then
|
||||
inst_simple -H /etc/lvm/lvmlocal.conf
|
||||
fi
|
||||
eval $(lvm dumpconfig global/system_id_source)
|
||||
eval $(lvm dumpconfig global/system_id_source &>/dev/null)
|
||||
if [ "$system_id_source" == "file" ]; then
|
||||
eval $(lvm dumpconfig global/system_id_file)
|
||||
if [ -f "$system_id_file" ]; then
|
||||
@@ -140,4 +140,6 @@ install() {
|
||||
cache_dump cache_restore cache_check cache_repair \
|
||||
era_check era_dump era_invalidate era_restore
|
||||
fi
|
||||
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
@@ -130,6 +130,13 @@ install() {
|
||||
if [ -e $systemdsystemunitdir/mdmon@.service ]; then
|
||||
inst_simple $systemdsystemunitdir/mdmon@.service
|
||||
fi
|
||||
if [ -e $systemdsystemunitdir/mdadm-last-resort@.service ]; then
|
||||
inst_simple $systemdsystemunitdir/mdadm-last-resort@.service
|
||||
fi
|
||||
if [ -e $systemdsystemunitdir/mdadm-last-resort@.timer ]; then
|
||||
inst_simple $systemdsystemunitdir/mdadm-last-resort@.timer
|
||||
fi
|
||||
fi
|
||||
inst_hook pre-shutdown 30 "$moddir/mdmon-pre-shutdown.sh"
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
@@ -1,18 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
is_mpath() {
|
||||
local _dev=$1
|
||||
[ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
|
||||
[[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ mpath- ]] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
majmin_to_mpath_dev() {
|
||||
local _dev
|
||||
for i in /dev/mapper/*; do
|
||||
[[ $i == /dev/mapper/control ]] && continue
|
||||
_dev=$(get_maj_min $i)
|
||||
if [ "$_dev" = "$1" ]; then
|
||||
echo $i
|
||||
return
|
||||
fi
|
||||
done
|
||||
}
|
||||
# called by dracut
|
||||
check() {
|
||||
local _rootdev
|
||||
# if there's no multipath binary, no go.
|
||||
require_binaries multipath || return 1
|
||||
|
||||
is_mpath() {
|
||||
local _dev=$1
|
||||
[ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
|
||||
[[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ mpath- ]] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for_each_host_dev_and_slaves is_mpath || return 255
|
||||
}
|
||||
@@ -30,7 +41,7 @@ depends() {
|
||||
# called by dracut
|
||||
cmdline() {
|
||||
for m in scsi_dh_alua scsi_dh_emc scsi_dh_rdac ; do
|
||||
if module_is_host_only $m ; then
|
||||
if grep -m 1 -q "$m" /proc/modules ; then
|
||||
printf 'rd.driver.pre=%s ' "$m"
|
||||
fi
|
||||
done
|
||||
@@ -40,46 +51,30 @@ cmdline() {
|
||||
installkernel() {
|
||||
local _ret
|
||||
local _arch=$(uname -m)
|
||||
mp_mod_filter() {
|
||||
local _funcs='scsi_register_device_handler|dm_dirty_log_type_register|dm_register_path_selector|dm_register_target'
|
||||
# subfunctions inherit following FDs
|
||||
local _merge=8 _side2=9
|
||||
function bmf1() {
|
||||
local _f
|
||||
while read _f || [ -n "$_f" ]; do
|
||||
case "$_f" in
|
||||
*.ko) [[ $(< $_f) =~ $_funcs ]] && echo "$_f" ;;
|
||||
*.ko.gz) [[ $(gzip -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
|
||||
*.ko.xz) [[ $(xz -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
|
||||
esac
|
||||
done
|
||||
return 0
|
||||
}
|
||||
local _funcs='scsi_register_device_handler|dm_dirty_log_type_register|dm_register_path_selector|dm_register_target'
|
||||
local _s390
|
||||
|
||||
function rotor() {
|
||||
local _f1 _f2
|
||||
while read _f1 || [ -n "$_f1" ]; do
|
||||
echo "$_f1"
|
||||
if read _f2; then
|
||||
echo "$_f2" 1>&${_side2}
|
||||
fi
|
||||
done | bmf1 1>&${_merge}
|
||||
return 0
|
||||
}
|
||||
# Use two parallel streams to filter alternating modules.
|
||||
set +x
|
||||
eval "( ( rotor ) ${_side2}>&1 | bmf1 ) ${_merge}>&1"
|
||||
[[ $debug ]] && set -x
|
||||
return 0
|
||||
}
|
||||
if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then
|
||||
_s390drivers="=drivers/s390/scsi"
|
||||
fi
|
||||
|
||||
( find_kernel_modules_by_path drivers/scsi; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/scsi; fi;
|
||||
find_kernel_modules_by_path drivers/md ) | mp_mod_filter | instmods
|
||||
hostonly='' dracut_instmods -o -s "$_funcs" "=drivers/scsi" "=drivers/md" ${_s390drivers:+"$_s390drivers"}
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
local _f
|
||||
local _f _allow
|
||||
add_hostonly_mpath_conf() {
|
||||
is_mpath $1 && {
|
||||
local _dev
|
||||
|
||||
_dev=$(majmin_to_mpath_dev $1)
|
||||
[ -z "$_dev" ] && return
|
||||
strstr "$_allow" "$_dev" && return
|
||||
_allow="$_allow --allow $_dev"
|
||||
}
|
||||
}
|
||||
|
||||
inst_multiple -o \
|
||||
dmsetup \
|
||||
kpartx \
|
||||
@@ -93,6 +88,11 @@ install() {
|
||||
/etc/multipath.conf \
|
||||
/etc/multipath/*
|
||||
|
||||
[[ $hostonly ]] && {
|
||||
for_each_host_dev_and_slaves_all add_hostonly_mpath_conf
|
||||
[ -n "$_allow" ] && mpathconf $_allow --outfile ${initdir}/etc/multipath.conf
|
||||
}
|
||||
|
||||
inst $(command -v partx) /sbin/partx
|
||||
|
||||
inst_libdir_file "libmultipath*" "multipath/*"
|
||||
|
@@ -3,7 +3,7 @@
|
||||
# called by dracut
|
||||
check() {
|
||||
if type -P systemd-detect-virt >/dev/null 2>&1; then
|
||||
vm=$(systemd-detect-virt --vm >/dev/null 2>&1)
|
||||
vm=$(systemd-detect-virt --vm 2>/dev/null)
|
||||
(($? != 0)) && return 255
|
||||
[[ $vm = "qemu" ]] && return 0
|
||||
[[ $vm = "kvm" ]] && return 0
|
||||
@@ -13,8 +13,9 @@ check() {
|
||||
for i in /sys/class/dmi/id/*_vendor; do
|
||||
[[ -f $i ]] || continue
|
||||
read vendor < $i
|
||||
[[ "$vendor" == "QEMU" ]] && return 0
|
||||
[[ "$vendor" == "Bochs" ]] && return 0
|
||||
[[ "$vendor" == "QEMU" ]] && return 0
|
||||
[[ "$vendor" == "Red Hat" ]] && return 0
|
||||
[[ "$vendor" == "Bochs" ]] && return 0
|
||||
done
|
||||
return 255
|
||||
}
|
||||
@@ -25,5 +26,7 @@ installkernel() {
|
||||
hostonly='' instmods \
|
||||
ata_piix ata_generic pata_acpi cdrom sr_mod ahci \
|
||||
virtio_blk virtio virtio_ring virtio_pci \
|
||||
virtio_scsi virtio_console virtio_rng
|
||||
virtio_scsi virtio_console virtio_rng \
|
||||
spapr-vscsi \
|
||||
qemu_fw_cfg
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ check() {
|
||||
require_binaries mount.cifs || return 1
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for fs in ${host_fs_types[@]}; do
|
||||
for fs in "${host_fs_types[@]}"; do
|
||||
[[ "$fs" == "cifs" ]] && return 0
|
||||
done
|
||||
return 255
|
||||
@@ -24,6 +24,12 @@ depends() {
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
instmods cifs ipv6
|
||||
# hash algos
|
||||
instmods md4 md5 sha256
|
||||
# ciphers
|
||||
instmods aes arc4 des ecb
|
||||
# macs
|
||||
instmods hmac cmac
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
|
@@ -16,8 +16,8 @@ install() {
|
||||
inst_multiple -o cat ls ps grep more cat rm strace free showmount \
|
||||
ping netstat rpcinfo vi scp ping6 ssh find vi \
|
||||
tcpdump cp less hostname mkdir \
|
||||
fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat e2fsck
|
||||
fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.f2fs fsck.vfat e2fsck
|
||||
|
||||
egrep '^tcpdump:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
grep '^tcpdump:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
}
|
||||
|
||||
|
@@ -2,6 +2,14 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
local _fcoe_ctlr
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for c in /sys/bus/fcoe/devices/ctlr_* ; do
|
||||
[ -L $c ] || continue
|
||||
_fcoe_ctlr=$c
|
||||
done
|
||||
[ -z "$_fcoe_ctlr" ] && return 255
|
||||
}
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
[ -d /sys/firmware/efi ] || return 255
|
||||
}
|
||||
|
14
modules.d/95fcoe/cleanup-fcoe.sh
Normal file
14
modules.d/95fcoe/cleanup-fcoe.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if [ -e /var/run/lldpad.pid ]; then
|
||||
lldpad -k
|
||||
# with systemd version 230, this is not necessary anymore
|
||||
# systemd commit cacf980ed44a28e276a6cc7f8fc41f991e2ab354
|
||||
if [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
mkdir -m 0755 -p /run/initramfs/state/dev/shm
|
||||
cp /dev/shm/lldpad.state /run/initramfs/state/dev/shm/ > /dev/null 2>&1
|
||||
echo "files /dev/shm/lldpad.state" >> /run/initramfs/rwtab
|
||||
fi
|
||||
fi
|
@@ -1,23 +1,54 @@
|
||||
#!/bin/sh
|
||||
|
||||
dcb=$1
|
||||
dcb="$1"
|
||||
|
||||
if ! [ -d /sys/firmware/edd ]; then
|
||||
modprobe edd
|
||||
while ! [ -d /sys/firmware/edd ]; do sleep 0.1; done
|
||||
fi
|
||||
_modprobe_r_edd="0"
|
||||
|
||||
check_edd() {
|
||||
local cnt=0
|
||||
|
||||
[ -d /sys/firmware/edd ] && return 0
|
||||
|
||||
_modprobe_r_edd="1"
|
||||
modprobe edd || return $?
|
||||
|
||||
while [ $cnt -lt 600 ]; do
|
||||
[ -d /sys/firmware/edd ] && return 0
|
||||
cnt=$(($cnt+1))
|
||||
sleep 0.1
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
check_edd || exit 1
|
||||
|
||||
for disk in /sys/firmware/edd/int13_*; do
|
||||
[ -d $disk ] || continue
|
||||
for nic in ${disk}/pci_dev/net/*; do
|
||||
[ -d $nic ] || continue
|
||||
[ -d "$disk" ] || continue
|
||||
if [ -e "${disk}/pci_dev/driver" ]; then
|
||||
driver=$(readlink "${disk}/pci_dev/driver")
|
||||
driver=${driver##*/}
|
||||
fi
|
||||
# i40e uses dev_port 1 for a virtual fcoe function
|
||||
if [ "${driver}" = "i40e" ]; then
|
||||
dev_port=1
|
||||
fi
|
||||
for nic in "${disk}"/pci_dev/net/*; do
|
||||
[ -d "$nic" ] || continue
|
||||
if [ -n "${dev_port}" -a -e "${nic}/dev_port" ]; then
|
||||
if [ "$(cat ${nic}/dev_port)" -ne "${dev_port}" ]; then
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
if [ -e ${nic}/address ]; then
|
||||
fcoe_interface=${nic##*/}
|
||||
if ! [ -e "/tmp/.fcoe-$fcoe_interface" ]; then
|
||||
/sbin/fcoe-up $fcoe_interface $dcb
|
||||
/sbin/fcoe-up "$fcoe_interface" "$dcb"
|
||||
> "/tmp/.fcoe-$fcoe_interface"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
modprobe -r edd
|
||||
|
||||
[ "$_modprobe_r_edd" = "1" ] && modprobe -r edd
|
||||
|
||||
unset _modprobe_r_edd
|
||||
|
@@ -15,6 +15,7 @@ type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
|
||||
netif=$1
|
||||
dcb=$2
|
||||
vlan="yes"
|
||||
|
||||
iflink=$(cat /sys/class/net/$netif/iflink)
|
||||
ifindex=$(cat /sys/class/net/$netif/ifindex)
|
||||
@@ -29,6 +30,21 @@ linkup "$netif"
|
||||
netdriver=$(readlink -f /sys/class/net/$netif/device/driver)
|
||||
netdriver=${netdriver##*/}
|
||||
|
||||
write_fcoemon_cfg() {
|
||||
echo FCOE_ENABLE=\"yes\" > /etc/fcoe/cfg-$netif
|
||||
if [ "$dcb" = "dcb" ]; then
|
||||
echo DCB_REQUIRED=\"yes\" >> /etc/fcoe/cfg-$netif
|
||||
else
|
||||
echo DCB_REQUIRED=\"no\" >> /etc/fcoe/cfg-$netif
|
||||
fi
|
||||
if [ "$vlan" = "yes" ]; then
|
||||
echo AUTO_VLAN=\"yes\" >> /etc/fcoe/cfg-$netif
|
||||
else
|
||||
echo AUTO_VLAN=\"no\" >> /etc/fcoe/cfg-$netif
|
||||
fi
|
||||
echo MODE=\"fabric\" >> /etc/fcoe/cfg-$netif
|
||||
}
|
||||
|
||||
if [ "$dcb" = "dcb" ]; then
|
||||
# wait for lldpad to be ready
|
||||
i=0
|
||||
@@ -46,6 +62,13 @@ if [ "$dcb" = "dcb" ]; then
|
||||
i=$(($i+1))
|
||||
done
|
||||
|
||||
while [ $i -lt 60 ]; do
|
||||
dcbtool sc "$netif" pfc e:1 a:1 w:1 && break
|
||||
info "Retrying to turn dcb on"
|
||||
sleep 1
|
||||
i=$(($i+1))
|
||||
done
|
||||
|
||||
while [ $i -lt 60 ]; do
|
||||
dcbtool sc "$netif" app:fcoe e:1 a:1 w:1 && break
|
||||
info "Retrying to turn fcoe on"
|
||||
@@ -55,16 +78,19 @@ if [ "$dcb" = "dcb" ]; then
|
||||
|
||||
sleep 1
|
||||
|
||||
fipvlan "$netif" -c -s
|
||||
write_fcoemon_cfg
|
||||
fcoemon --syslog
|
||||
elif [ "$netdriver" = "bnx2x" ]; then
|
||||
# If driver is bnx2x, do not use /sys/module/fcoe/parameters/create but fipvlan
|
||||
modprobe 8021q
|
||||
udevadm settle --timeout=30
|
||||
# Sleep for 3 s to allow dcb negotiation
|
||||
sleep 3
|
||||
# Sleep for 13 s to allow dcb negotiation
|
||||
sleep 13
|
||||
fipvlan "$netif" -c -s
|
||||
else
|
||||
echo -n "$netif" > /sys/module/fcoe/parameters/create
|
||||
vlan="no"
|
||||
write_fcoemon_cfg
|
||||
fcoemon --syslog
|
||||
fi
|
||||
|
||||
need_shutdown
|
||||
|
@@ -2,16 +2,16 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
local _fcoe_ctlr
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for c in /sys/bus/fcoe/devices/ctlr_* ; do
|
||||
[ -L $c ] || continue
|
||||
fcoe_ctlr=$c
|
||||
_fcoe_ctlr=$c
|
||||
done
|
||||
[ -z "$fcoe_ctlr" ] && return 255
|
||||
[ -z "$_fcoe_ctlr" ] && return 255
|
||||
}
|
||||
|
||||
require_binaries dcbtool fipvlan lldpad ip readlink || return 1
|
||||
|
||||
require_binaries dcbtool fipvlan lldpad ip readlink fcoemon fcoeadm || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -67,9 +67,12 @@ cmdline() {
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_multiple ip dcbtool fipvlan lldpad readlink lldptool
|
||||
inst_multiple ip dcbtool fipvlan lldpad readlink lldptool fcoemon fcoeadm
|
||||
inst_libdir_file 'libhbalinux.so*'
|
||||
inst "/etc/hba.conf" "/etc/hba.conf"
|
||||
|
||||
mkdir -m 0755 -p "$initdir/var/lib/lldpad"
|
||||
mkdir -m 0755 -p "$initdir/etc/fcoe"
|
||||
|
||||
if [[ $hostonly_cmdline == "yes" ]] ; then
|
||||
local _fcoeconf=$(cmdline)
|
||||
@@ -80,6 +83,7 @@ install() {
|
||||
inst "$moddir/fcoe-genrules.sh" "/sbin/fcoe-genrules.sh"
|
||||
inst_hook pre-trigger 03 "$moddir/lldpad.sh"
|
||||
inst_hook cmdline 99 "$moddir/parse-fcoe.sh"
|
||||
inst_hook cleanup 90 "$moddir/cleanup-fcoe.sh"
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
||||
|
@@ -18,16 +18,15 @@
|
||||
# If it's not set we don't continue
|
||||
[ -z "$fcoe" ] && return
|
||||
|
||||
|
||||
# BRCM: Later, should check whether bnx2x is loaded first before loading bnx2fc so do not load bnx2fc when there are no Broadcom adapters
|
||||
[ -d /sys/module/fcoe ] || modprobe -b -a fcoe || die "FCoE requested but kernel/initrd does not support FCoE"
|
||||
[ -e /sys/bus/fcoe/ctlr_create ] || modprobe -b -a fcoe || die "FCoE requested but kernel/initrd does not support FCoE"
|
||||
|
||||
initqueue --onetime modprobe -b -q bnx2fc
|
||||
udevadm settle --timeout=30
|
||||
|
||||
parse_fcoe_opts() {
|
||||
local OLDIFS="$IFS"
|
||||
local IFS=:
|
||||
set $fcoe
|
||||
IFS="$OLDIFS"
|
||||
|
||||
case $# in
|
||||
2)
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -e /sys/module/bnx2i ] && killproc iscsiuio
|
||||
[ -z "${DRACUT_SYSTEMD}" ] && [ -e /sys/module/bnx2i ] && killproc iscsiuio
|
||||
|
||||
|
@@ -36,36 +36,30 @@ iroot=${iroot#:}
|
||||
# figured out a way how to check whether this is built-in or not
|
||||
modprobe crc32c 2>/dev/null
|
||||
|
||||
if [ -e /sys/module/bnx2i ] && ! [ -e /tmp/iscsiuio-started ]; then
|
||||
if [ -z "${DRACUT_SYSTEMD}" ] && [ -e /sys/module/bnx2i ] && ! [ -e /tmp/iscsiuio-started ]; then
|
||||
iscsiuio
|
||||
> /tmp/iscsiuio-started
|
||||
fi
|
||||
|
||||
handle_firmware()
|
||||
{
|
||||
if ! [ -e /tmp/iscsistarted-firmware ]; then
|
||||
if ! iscsistart -f; then
|
||||
warn "iscistart: Could not get list of targets from firmware."
|
||||
return 1
|
||||
fi
|
||||
|
||||
for p in $(getargs rd.iscsi.param -d iscsi_param); do
|
||||
iscsi_param="$iscsi_param --param $p"
|
||||
done
|
||||
|
||||
if ! iscsistart -b $iscsi_param; then
|
||||
warn "'iscsistart -b $iscsi_param' failed"
|
||||
fi
|
||||
|
||||
if [ -d /sys/class/iscsi_session ]; then
|
||||
echo 'started' > "/tmp/iscsistarted-iscsi:"
|
||||
echo 'started' > "/tmp/iscsistarted-firmware"
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
|
||||
need_shutdown
|
||||
if ! iscsistart -f; then
|
||||
warn "iscistart: Could not get list of targets from firmware."
|
||||
return 1
|
||||
fi
|
||||
|
||||
for p in $(getargs rd.iscsi.param -d iscsi_param); do
|
||||
iscsi_param="$iscsi_param --param $p"
|
||||
done
|
||||
|
||||
if ! iscsistart -b $iscsi_param; then
|
||||
warn "'iscsistart -b $iscsi_param' failed with return code $?"
|
||||
fi
|
||||
|
||||
echo 'started' > "/tmp/iscsistarted-iscsi:"
|
||||
echo 'started' > "/tmp/iscsistarted-firmware"
|
||||
|
||||
need_shutdown
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -105,53 +99,80 @@ handle_netroot()
|
||||
|
||||
parse_iscsi_root "$1" || return 1
|
||||
|
||||
# Bail out early, if there is no route to the destination
|
||||
if is_ip "$iscsi_target_ip" && [ "$netif" != "timeout" ] && ! all_ifaces_setup && getargbool 1 rd.iscsi.testroute; then
|
||||
ip route get "$iscsi_target_ip" >/dev/null 2>&1 || return 0
|
||||
fi
|
||||
|
||||
# XXX is this needed?
|
||||
getarg ro && iscsirw=ro
|
||||
getarg rw && iscsirw=rw
|
||||
fsopts=${fsopts:+$fsopts,}${iscsirw}
|
||||
|
||||
if [ -z $iscsi_initiator ]; then
|
||||
# XXX Where are these from?
|
||||
if [ -z "$iscsi_initiator" ] && [ -f /sys/firmware/ibft/initiator/initiator-name ] && ! [ -f /tmp/iscsi_set_initiator ]; then
|
||||
iscsi_initiator=$(while read line || [ -n "$line" ]; do echo $line;done < /sys/firmware/ibft/initiator/initiator-name)
|
||||
echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi
|
||||
rm -f /etc/iscsi/initiatorname.iscsi
|
||||
mkdir -p /etc/iscsi
|
||||
ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
|
||||
> /tmp/iscsi_set_initiator
|
||||
if [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
systemctl try-restart iscsid
|
||||
# FIXME: iscsid is not yet ready, when the service is :-/
|
||||
sleep 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$iscsi_initiator" ]; then
|
||||
[ -f /run/initiatorname.iscsi ] && . /run/initiatorname.iscsi
|
||||
[ -f /etc/initiatorname.iscsi ] && . /etc/initiatorname.iscsi
|
||||
[ -f /etc/iscsi/initiatorname.iscsi ] && . /etc/iscsi/initiatorname.iscsi
|
||||
iscsi_initiator=$InitiatorName
|
||||
|
||||
# XXX rfc3720 says 'SCSI Initiator Name: The iSCSI Initiator Name specifies
|
||||
# the worldwide unique name of the initiator.' Could we use hostname/ip
|
||||
# if missing?
|
||||
fi
|
||||
|
||||
if [ -z $iscsi_initiator ]; then
|
||||
if [ -f /sys/firmware/ibft/initiator/initiator-name ]; then
|
||||
iscsi_initiator=$(while read line || [ -n "$line" ]; do echo $line;done < /sys/firmware/ibft/initiator/initiator-name)
|
||||
fi
|
||||
if [ -z "$iscsi_initiator" ]; then
|
||||
iscsi_initiator=$(iscsi-iname)
|
||||
echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi
|
||||
rm -f /etc/iscsi/initiatorname.iscsi
|
||||
mkdir -p /etc/iscsi
|
||||
ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
|
||||
> /tmp/iscsi_set_initiator
|
||||
if [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
systemctl try-restart iscsid
|
||||
# FIXME: iscsid is not yet ready, when the service is :-/
|
||||
sleep 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z $iscsi_target_port ]; then
|
||||
|
||||
if [ -z "$iscsi_target_port" ]; then
|
||||
iscsi_target_port=3260
|
||||
fi
|
||||
|
||||
if [ -z $iscsi_target_group ]; then
|
||||
if [ -z "$iscsi_target_group" ]; then
|
||||
iscsi_target_group=1
|
||||
fi
|
||||
|
||||
if [ -z $iscsi_initiator ]; then
|
||||
# XXX is this correct?
|
||||
iscsi_initiator=$(iscsi-iname)
|
||||
fi
|
||||
|
||||
if [ -z $iscsi_lun ]; then
|
||||
if [ -z "$iscsi_lun" ]; then
|
||||
iscsi_lun=0
|
||||
fi
|
||||
|
||||
echo "InitiatorName='$iscsi_initiator'" > /run/initiatorname.iscsi
|
||||
echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi
|
||||
ln -fs /run/initiatorname.iscsi /dev/.initiatorname.iscsi
|
||||
|
||||
if ! [ -e /etc/iscsi/initiatorname.iscsi ]; then
|
||||
mkdir -p /etc/iscsi
|
||||
ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
|
||||
if [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
systemctl try-restart iscsid
|
||||
# FIXME: iscsid is not yet ready, when the service is :-/
|
||||
sleep 1
|
||||
fi
|
||||
fi
|
||||
# FIXME $iscsi_protocol??
|
||||
|
||||
if [ "$root" = "dhcp" ]; then
|
||||
if [ "$root" = "dhcp" ] || [ "$netroot" = "dhcp" ]; then
|
||||
# if root is not specified try to mount the whole iSCSI LUN
|
||||
printf 'SYMLINK=="disk/by-path/*-iscsi-*-%s", SYMLINK+="root"\n' $iscsi_lun >> /etc/udev/rules.d/99-iscsi-root.rules
|
||||
printf 'SYMLINK=="disk/by-path/*-iscsi-*-%s", SYMLINK+="root"\n' "$iscsi_lun" >> /etc/udev/rules.d/99-iscsi-root.rules
|
||||
udevadm control --reload
|
||||
write_fs_tab /dev/root
|
||||
wait_for_dev -n /dev/root
|
||||
@@ -161,48 +182,86 @@ handle_netroot()
|
||||
echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > $hookdir/mount/01-$$-iscsi.sh
|
||||
fi
|
||||
|
||||
# force udevsettle to break
|
||||
> $hookdir/initqueue/work
|
||||
|
||||
iscsistart -i $iscsi_initiator -t $iscsi_target_name \
|
||||
-g $iscsi_target_group -a $iscsi_target_ip \
|
||||
-p $iscsi_target_port \
|
||||
${iscsi_username:+-u $iscsi_username} \
|
||||
${iscsi_password:+-w $iscsi_password} \
|
||||
${iscsi_in_username:+-U $iscsi_in_username} \
|
||||
${iscsi_in_password:+-W $iscsi_in_password} \
|
||||
${iscsi_iface_name:+--param iface.iscsi_ifacename=$iscsi_iface_name} \
|
||||
${iscsi_netdev_name:+--param iface.net_ifacename=$iscsi_netdev_name} \
|
||||
${iscsi_param} \
|
||||
|| :
|
||||
|
||||
if [ -n "$DRACUT_SYSTEMD" ] && command -v systemd-run >/dev/null 2>&1; then
|
||||
netroot_enc=$(systemd-escape "iscsistart_${1}")
|
||||
status=$(systemctl is-active "$netroot_enc" 2>/dev/null)
|
||||
is_active=$?
|
||||
if [ $is_active -ne 0 ]; then
|
||||
if [ "$status" != "activating" ] && ! systemctl is-failed "$netroot_enc" >/dev/null 2>&1; then
|
||||
systemd-run --no-block --service-type=oneshot --remain-after-exit --quiet \
|
||||
--description="Login iSCSI Target $iscsi_target_name" \
|
||||
-p 'DefaultDependencies=no' \
|
||||
--unit="$netroot_enc" -- \
|
||||
$(command -v iscsistart) \
|
||||
-i "$iscsi_initiator" -t "$iscsi_target_name" \
|
||||
-g "$iscsi_target_group" -a "$iscsi_target_ip" \
|
||||
-p "$iscsi_target_port" \
|
||||
${iscsi_username:+-u "$iscsi_username"} \
|
||||
${iscsi_password:+-w "$iscsi_password"} \
|
||||
${iscsi_in_username:+-U "$iscsi_in_username"} \
|
||||
${iscsi_in_password:+-W "$iscsi_in_password"} \
|
||||
${iscsi_iface_name:+--param "iface.iscsi_ifacename=$iscsi_iface_name"} \
|
||||
${iscsi_netdev_name:+--param "iface.net_ifacename=$iscsi_netdev_name"} \
|
||||
${iscsi_param} >/dev/null 2>&1 \
|
||||
&& { > $hookdir/initqueue/work ; }
|
||||
else
|
||||
systemctl --no-block restart "$netroot_enc" >/dev/null 2>&1 \
|
||||
&& { > $hookdir/initqueue/work ; }
|
||||
fi
|
||||
fi
|
||||
else
|
||||
iscsistart -i "$iscsi_initiator" -t "$iscsi_target_name" \
|
||||
-g "$iscsi_target_group" -a "$iscsi_target_ip" \
|
||||
-p "$iscsi_target_port" \
|
||||
${iscsi_username:+-u "$iscsi_username"} \
|
||||
${iscsi_password:+-w "$iscsi_password"} \
|
||||
${iscsi_in_username:+-U "$iscsi_in_username"} \
|
||||
${iscsi_in_password:+-W "$iscsi_in_password"} \
|
||||
${iscsi_iface_name:+--param "iface.iscsi_ifacename=$iscsi_iface_name"} \
|
||||
${iscsi_netdev_name:+--param "iface.net_ifacename=$iscsi_netdev_name"} \
|
||||
${iscsi_param} \
|
||||
&& { > $hookdir/initqueue/work ; }
|
||||
fi
|
||||
netroot_enc=$(str_replace "$1" '/' '\2f')
|
||||
echo 'started' > "/tmp/iscsistarted-iscsi:${netroot_enc}"
|
||||
return 0
|
||||
}
|
||||
|
||||
ret=0
|
||||
|
||||
# loop over all netroot parameter
|
||||
if getarg netroot; then
|
||||
for nroot in $(getargs netroot); do
|
||||
[ "${nroot%%:*}" = "iscsi" ] || continue
|
||||
nroot="${nroot##iscsi:}"
|
||||
if [ -n "$nroot" ]; then
|
||||
handle_netroot "$nroot"
|
||||
ret=$(($ret + $?))
|
||||
fi
|
||||
done
|
||||
if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then
|
||||
if [ "$netif" != "timeout" ] && getargbool 1 rd.iscsi.waitnet; then
|
||||
all_ifaces_setup || exit 0
|
||||
fi
|
||||
|
||||
if [ "$netif" = "timeout" ] && all_ifaces_setup; then
|
||||
# s.th. went wrong and the timeout script hits
|
||||
# restart
|
||||
systemctl restart iscsid
|
||||
# damn iscsid is not ready after unit says it's ready
|
||||
sleep 2
|
||||
fi
|
||||
|
||||
if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then
|
||||
if [ "$netif" = "timeout" ] || [ "$netif" = "online" ]; then
|
||||
handle_firmware
|
||||
ret=$(($ret + $?))
|
||||
fi
|
||||
else
|
||||
if [ -n "$iroot" ]; then
|
||||
handle_netroot "$iroot"
|
||||
ret=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! [ "$netif" = "online" ]; then
|
||||
# loop over all netroot parameter
|
||||
if nroot=$(getarg netroot) && [ "$nroot" != "dhcp" ]; then
|
||||
for nroot in $(getargs netroot); do
|
||||
[ "${nroot%%:*}" = "iscsi" ] || continue
|
||||
nroot="${nroot##iscsi:}"
|
||||
if [ -n "$nroot" ]; then
|
||||
handle_netroot "$nroot"
|
||||
ret=$(($ret + $?))
|
||||
fi
|
||||
done
|
||||
else
|
||||
if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then
|
||||
handle_firmware
|
||||
if [ -n "$iroot" ]; then
|
||||
handle_netroot "$iroot"
|
||||
ret=$?
|
||||
fi
|
||||
fi
|
||||
@@ -210,6 +269,6 @@ fi
|
||||
|
||||
need_shutdown
|
||||
|
||||
# now we have a root filesystem somewhere in /dev/sda*
|
||||
# now we have a root filesystem somewhere in /dev/sd*
|
||||
# let the normal block handler handle root=
|
||||
exit $ret
|
||||
|
@@ -157,44 +157,17 @@ depends() {
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
local _arch=$(uname -m)
|
||||
local _funcs='iscsi_register_transport'
|
||||
|
||||
instmods bnx2i qla4xxx cxgb3i cxgb4i be2iscsi
|
||||
hostonly="" instmods iscsi_tcp iscsi_ibft crc32c iscsi_boot_sysfs
|
||||
iscsi_module_filter() {
|
||||
local _funcs='iscsi_register_transport'
|
||||
# subfunctions inherit following FDs
|
||||
local _merge=8 _side2=9
|
||||
function bmf1() {
|
||||
local _f
|
||||
while read _f || [ -n "$_f" ]; do
|
||||
case "$_f" in
|
||||
*.ko) [[ $(< $_f) =~ $_funcs ]] && echo "$_f" ;;
|
||||
*.ko.gz) [[ $(gzip -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
|
||||
*.ko.xz) [[ $(xz -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
|
||||
esac
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
function rotor() {
|
||||
local _f1 _f2
|
||||
while read _f1 || [ -n "$_f1" ]; do
|
||||
echo "$_f1"
|
||||
if read _f2; then
|
||||
echo "$_f2" 1>&${_side2}
|
||||
fi
|
||||
done | bmf1 1>&${_merge}
|
||||
return 0
|
||||
}
|
||||
# Use two parallel streams to filter alternating modules.
|
||||
set +x
|
||||
eval "( ( rotor ) ${_side2}>&1 | bmf1 ) ${_merge}>&1"
|
||||
[[ $debug ]] && set -x
|
||||
return 0
|
||||
}
|
||||
if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then
|
||||
_s390drivers="=drivers/s390/scsi"
|
||||
fi
|
||||
|
||||
dracut_instmods -o -s "$_funcs" "=drivers/scsi" ${_s390drivers:+"$_s390drivers"}
|
||||
|
||||
{ find_kernel_modules_by_path drivers/scsi; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/scsi; fi;} \
|
||||
| iscsi_module_filter | instmods
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
@@ -226,6 +199,37 @@ install() {
|
||||
inst "$moddir/iscsiroot.sh" "/sbin/iscsiroot"
|
||||
if ! dracut_module_included "systemd"; then
|
||||
inst "$moddir/mount-lun.sh" "/bin/mount-lun.sh"
|
||||
else
|
||||
inst_multiple -o \
|
||||
$systemdsystemunitdir/iscsi.service \
|
||||
$systemdsystemunitdir/iscsid.service \
|
||||
$systemdsystemunitdir/iscsid.socket \
|
||||
$systemdsystemunitdir/iscsiuio.service \
|
||||
$systemdsystemunitdir/iscsiuio.socket \
|
||||
iscsiadm iscsid
|
||||
|
||||
mkdir -p "${initdir}/$systemdsystemunitdir/sockets.target.wants"
|
||||
for i in \
|
||||
iscsiuio.socket \
|
||||
; do
|
||||
ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/sockets.target.wants/${i}"
|
||||
done
|
||||
|
||||
mkdir -p "${initdir}/$systemdsystemunitdir/basic.target.wants"
|
||||
for i in \
|
||||
iscsid.service \
|
||||
; do
|
||||
ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/basic.target.wants/${i}"
|
||||
done
|
||||
|
||||
# Make sure iscsid is started after dracut-cmdline and ready for the initqueue
|
||||
mkdir -p "${initdir}/$systemdsystemunitdir/iscsid.service.d"
|
||||
(
|
||||
echo "[Unit]"
|
||||
echo "After=dracut-cmdline.service"
|
||||
echo "Before=dracut-initqueue.service"
|
||||
) > "${initdir}/$systemdsystemunitdir/iscsid.service.d/dracut.conf"
|
||||
fi
|
||||
inst_dir /var/lib/iscsi
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
@@ -14,10 +14,17 @@
|
||||
# This script is sourced, so root should be set. But let's be paranoid
|
||||
[ -z "$root" ] && root=$(getarg root=)
|
||||
if [ -z "$netroot" ]; then
|
||||
for netroot in $(getargs netroot=); do
|
||||
[ "${netroot%%:*}" = "iscsi" ] && break
|
||||
for nroot in $(getargs netroot=); do
|
||||
[ "${nroot%%:*}" = "iscsi" ] && break
|
||||
done
|
||||
[ "${netroot%%:*}" = "iscsi" ] || unset netroot
|
||||
if [ "${nroot%%:*}" = "iscsi" ]; then
|
||||
netroot="$nroot"
|
||||
else
|
||||
for nroot in $(getargs netroot=); do
|
||||
[ "${nroot%%:*}" = "dhcp" ] && break
|
||||
done
|
||||
netroot="$nroot"
|
||||
fi
|
||||
fi
|
||||
[ -z "$iscsiroot" ] && iscsiroot=$(getarg iscsiroot=)
|
||||
[ -z "$iscsi_firmware" ] && getargbool 0 rd.iscsi.firmware -y iscsi_firmware && iscsi_firmware="1"
|
||||
@@ -34,13 +41,25 @@ if [ "${root%%:*}" = "iscsi" ] ; then
|
||||
netroot=$root
|
||||
# if root is not specified try to mount the whole iSCSI LUN
|
||||
printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules
|
||||
[ -n "$DRACUT_SYSTEMD" ] && systemctl is-active systemd-udevd && udevadm control --reload-rules
|
||||
root=/dev/root
|
||||
|
||||
write_fs_tab /dev/root
|
||||
fi
|
||||
|
||||
# If it's not empty or iscsi we don't continue
|
||||
[ -z "$netroot" ] || [ "${netroot%%:*}" = "iscsi" ] || return
|
||||
for nroot in $(getargs netroot); do
|
||||
[ "${nroot%%:*}" = "iscsi" ] || continue
|
||||
netroot="$nroot"
|
||||
break
|
||||
done
|
||||
|
||||
# Root takes precedence over netroot
|
||||
if [ "${root}" = "/dev/root" ] && getarg "netroot=dhcp" ; then
|
||||
# if root is not specified try to mount the whole iSCSI LUN
|
||||
printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules
|
||||
[ -n "$DRACUT_SYSTEMD" ] && systemctl is-active systemd-udevd && udevadm control --reload-rules
|
||||
fi
|
||||
|
||||
if [ -n "$iscsiroot" ] ; then
|
||||
[ -z "$netroot" ] && netroot=$root
|
||||
@@ -58,23 +77,27 @@ if [ -n "$iscsiroot" ] ; then
|
||||
fi
|
||||
|
||||
# iscsi_firmware does not need argument checking
|
||||
if [ -n "$iscsi_firmware" ] ; then
|
||||
[ -z "$netroot" ] && netroot=iscsi:
|
||||
if [ -n "$iscsi_firmware" ]; then
|
||||
if [ "$root" != "dhcp" ] && [ "$netroot" != "dhcp" ]; then
|
||||
[ -z "$netroot" ] && netroot=iscsi:
|
||||
fi
|
||||
modprobe -b -q iscsi_boot_sysfs 2>/dev/null
|
||||
modprobe -b -q iscsi_ibft
|
||||
initqueue --onetime --timeout /sbin/iscsiroot dummy "$netroot" "$NEWROOT"
|
||||
# if no ip= is given, but firmware
|
||||
echo "[ -f '/tmp/iscsistarted-firmware' ]" > $hookdir/initqueue/finished/iscsi_started.sh
|
||||
initqueue --unique --online /sbin/iscsiroot online "iscsi:" "$NEWROOT"
|
||||
initqueue --unique --onetime --timeout /sbin/iscsiroot timeout "iscsi:" "$NEWROOT"
|
||||
initqueue --unique --onetime --settled /sbin/iscsiroot online "iscsi:" "'$NEWROOT'"
|
||||
fi
|
||||
|
||||
# If it's not iscsi we don't continue
|
||||
[ "${netroot%%:*}" = "iscsi" ] || return
|
||||
if [ -z "$netroot" ] || ! [ "${netroot%%:*}" = "iscsi" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
initqueue --unique --onetime --timeout /sbin/iscsiroot timeout "$netroot" "$NEWROOT"
|
||||
|
||||
initqueue --onetime modprobe --all -b -q qla4xxx cxgb3i cxgb4i bnx2i be2iscsi
|
||||
|
||||
if [ -z "$iscsi_firmware" ] ; then
|
||||
type parse_iscsi_root >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
parse_iscsi_root "$netroot" || return
|
||||
fi
|
||||
|
||||
# ISCSI actually supported?
|
||||
if ! [ -e /sys/module/iscsi_tcp ]; then
|
||||
modprobe -b -q iscsi_tcp || die "iscsiroot requested but kernel/initrd does not support iscsi"
|
||||
@@ -82,17 +105,51 @@ fi
|
||||
|
||||
if [ -n "$netroot" ] && [ "$root" != "/dev/root" ] && [ "$root" != "dhcp" ]; then
|
||||
if ! getargbool 1 rd.neednet >/dev/null || ! getarg "ip="; then
|
||||
initqueue --onetime --settled /sbin/iscsiroot dummy "$netroot" "$NEWROOT"
|
||||
initqueue --unique --onetime --settled /sbin/iscsiroot dummy "'$netroot'" "'$NEWROOT'"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$iscsi_firmware" ] ; then
|
||||
echo "[ -f '/tmp/iscsistarted-firmware' ]" > $hookdir/initqueue/finished/iscsi_started.sh
|
||||
else
|
||||
netroot_enc=$(str_replace "$netroot" '/' '\2f')
|
||||
echo "[ -f '/tmp/iscsistarted-$netroot_enc' ]" > $hookdir/initqueue/finished/iscsi_started.sh
|
||||
if arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=) && [ -n "$arg" ] && ! [ -f /run/initiatorname.iscsi ] ; then
|
||||
iscsi_initiator=$arg
|
||||
echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi
|
||||
ln -fs /run/initiatorname.iscsi /dev/.initiatorname.iscsi
|
||||
if ! [ -e /etc/iscsi/initiatorname.iscsi ]; then
|
||||
mkdir -p /etc/iscsi
|
||||
ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
|
||||
if [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
systemctl try-restart iscsid
|
||||
# FIXME: iscsid is not yet ready, when the service is :-/
|
||||
sleep 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# If not given on the cmdline and initiator-name available via iBFT
|
||||
if [ -z $iscsi_initiator ] && [ -f /sys/firmware/ibft/initiator/initiator-name ] && ! [ -f /tmp/iscsi_set_initiator ]; then
|
||||
iscsi_initiator=$(while read line || [ -n "$line" ]; do echo $line;done < /sys/firmware/ibft/initiator/initiator-name)
|
||||
if [ -n "$iscsi_initiator" ]; then
|
||||
echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi
|
||||
rm -f /etc/iscsi/initiatorname.iscsi
|
||||
mkdir -p /etc/iscsi
|
||||
ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
|
||||
> /tmp/iscsi_set_initiator
|
||||
if [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
systemctl try-restart iscsid
|
||||
# FIXME: iscsid is not yet ready, when the service is :-/
|
||||
sleep 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
for nroot in $(getargs netroot); do
|
||||
[ "${nroot%%:*}" = "iscsi" ] || continue
|
||||
type parse_iscsi_root >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
parse_iscsi_root "$nroot" || return 1
|
||||
netroot_enc=$(str_replace "$nroot" '/' '\2f')
|
||||
echo "[ -f '/tmp/iscsistarted-$netroot_enc' ]" > $hookdir/initqueue/finished/iscsi_started.sh
|
||||
done
|
||||
|
||||
# Done, all good!
|
||||
rootok=1
|
||||
|
||||
|
@@ -34,6 +34,9 @@ install() {
|
||||
inst nbd-client
|
||||
inst_hook cmdline 90 "$moddir/parse-nbdroot.sh"
|
||||
inst_script "$moddir/nbdroot.sh" "/sbin/nbdroot"
|
||||
if dracut_module_included "systemd-initrd"; then
|
||||
inst_script "$moddir/nbd-generator.sh" $systemdutildir/system-generators/dracut-nbd-generator
|
||||
fi
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user