Compare commits
410 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b490820a67 | ||
![]() |
3178e5d9e6 | ||
![]() |
7ceaad3400 | ||
![]() |
d8caac65a7 | ||
![]() |
d2846fdcce | ||
![]() |
6414f18c34 | ||
![]() |
77359602a2 | ||
![]() |
e318a113be | ||
![]() |
cba4eac067 | ||
![]() |
6e49e06cfe | ||
![]() |
faa3920f1d | ||
![]() |
44678ee989 | ||
![]() |
386875cc9e | ||
![]() |
ac607d92dc | ||
![]() |
8d32f7965f | ||
![]() |
945b5334ca | ||
![]() |
fa870823fe | ||
![]() |
6b06a771cf | ||
![]() |
89cd64a635 | ||
![]() |
e953f9e688 | ||
![]() |
5b276e8015 | ||
![]() |
0314ef5451 | ||
![]() |
1984bb42e3 | ||
![]() |
417ae3f1ad | ||
![]() |
210431852f | ||
![]() |
82bafb320b | ||
![]() |
a3e2bb4eba | ||
![]() |
6dfff71f85 | ||
![]() |
3860f27881 | ||
![]() |
fa3638a353 | ||
![]() |
cf729a109d | ||
![]() |
7b991e9702 | ||
![]() |
936bd1e05f | ||
![]() |
1e7a5c2617 | ||
![]() |
0aa4e3149f | ||
![]() |
bd49ce86ec | ||
![]() |
75cc5ac016 | ||
![]() |
25c7c10c58 | ||
![]() |
c1b5163c29 | ||
![]() |
a8fb48486c | ||
![]() |
841fc1e3a7 | ||
![]() |
ec3fd83dc1 | ||
![]() |
284c8be768 | ||
![]() |
f3763b75dd | ||
![]() |
9877bf26df | ||
![]() |
20b51b686b | ||
![]() |
d3fd23a1e1 | ||
![]() |
97ff4a0003 | ||
![]() |
3559c0b6cf | ||
![]() |
2822eb855a | ||
![]() |
53c46459df | ||
![]() |
adf1849bf9 | ||
![]() |
197e35b75b | ||
![]() |
ba0b653658 | ||
![]() |
f22abb4b3e | ||
![]() |
f53a0f20fd | ||
![]() |
724674d178 | ||
![]() |
d65cf005bb | ||
![]() |
def98684d4 | ||
![]() |
d1e6cd0f30 | ||
![]() |
d3b8ab7783 | ||
![]() |
f0c92896e7 | ||
![]() |
95dfe9d02b | ||
![]() |
1c5b7848e1 | ||
![]() |
40586a2b7b | ||
![]() |
7ea1b49819 | ||
![]() |
cb9f6af094 | ||
![]() |
faa17f0921 | ||
![]() |
2413fcbc60 | ||
![]() |
a0aeaa381f | ||
![]() |
cfc02869e4 | ||
![]() |
b75196ac27 | ||
![]() |
9a2f5592c5 | ||
![]() |
1d85a6fe6d | ||
![]() |
dd9b5df3b9 | ||
![]() |
afd17a3ec5 | ||
![]() |
dbd8c68b7a | ||
![]() |
a22c502d86 | ||
![]() |
ee2cd169bd | ||
![]() |
9a35a62bf1 | ||
![]() |
93d3f433fe | ||
![]() |
de176906ff | ||
![]() |
b9ec6563e7 | ||
![]() |
76fa8652d2 | ||
![]() |
158fab27b7 | ||
![]() |
81134e54ad | ||
![]() |
77d76bad4d | ||
![]() |
1d71152bd1 | ||
![]() |
754beeddf2 | ||
![]() |
92d595398f | ||
![]() |
85dde6406d | ||
![]() |
7decd80f44 | ||
![]() |
e0459b1e97 | ||
![]() |
64eb996323 | ||
![]() |
991a8728d0 | ||
![]() |
3b4bc498e1 | ||
![]() |
e654485a8e | ||
![]() |
1636712f09 | ||
![]() |
581452062f | ||
![]() |
a2c0b852a0 | ||
![]() |
1cb33f3954 | ||
![]() |
f2c3a039da | ||
![]() |
e1fd8dd119 | ||
![]() |
93950912ea | ||
![]() |
0fa047fcf1 | ||
![]() |
36d52d765e | ||
![]() |
5f99314801 | ||
![]() |
a77208565d | ||
![]() |
a74acc38e2 | ||
![]() |
f52ee9073e | ||
![]() |
9ea87dfdad | ||
![]() |
8485c3205f | ||
![]() |
e92ca555bf | ||
![]() |
ff53445872 | ||
![]() |
dbc92d85f2 | ||
![]() |
90e189b042 | ||
![]() |
8a3fe63a08 | ||
![]() |
0ec43d7a56 | ||
![]() |
3bbd0c7764 | ||
![]() |
00056957bf | ||
![]() |
6bc37a9952 | ||
![]() |
019b3f0277 | ||
![]() |
0147a3be17 | ||
![]() |
6dd298ff9b | ||
![]() |
90689543da | ||
![]() |
7596b72b39 | ||
![]() |
f22f08d857 | ||
![]() |
6efc9e13be | ||
![]() |
39086d914f | ||
![]() |
51b048c3e4 | ||
![]() |
d2ea3cac52 | ||
![]() |
cfe414dce8 | ||
![]() |
c76de095b2 | ||
![]() |
1587cc7724 | ||
![]() |
15097b4ab9 | ||
![]() |
f3516c8db5 | ||
![]() |
3c12f005f8 | ||
![]() |
2cfbfbba06 | ||
![]() |
6410b72af6 | ||
![]() |
2396effc41 | ||
![]() |
0269b775fc | ||
![]() |
dd8d25ba3e | ||
![]() |
1fd259f340 | ||
![]() |
96bfc02133 | ||
![]() |
8cdad31667 | ||
![]() |
0cd9406149 | ||
![]() |
2e1cccc9ca | ||
![]() |
418b762dc2 | ||
![]() |
8e08cf65ab | ||
![]() |
d3b8373f4a | ||
![]() |
655d9cb4a3 | ||
![]() |
386d61d344 | ||
![]() |
c99fbb55e4 | ||
![]() |
cbc8b70f7a | ||
![]() |
b405725794 | ||
![]() |
76766f9fab | ||
![]() |
dfd0775ce1 | ||
![]() |
69c9fb1122 | ||
![]() |
278cc2e163 | ||
![]() |
76904bf6d2 | ||
![]() |
4fa79aedff | ||
![]() |
9db27c4679 | ||
![]() |
531df99049 | ||
![]() |
676a8c4262 | ||
![]() |
584ee33fa0 | ||
![]() |
94b12823ad | ||
![]() |
b3d287ae35 | ||
![]() |
011800434a | ||
![]() |
c1cb0de4d5 | ||
![]() |
bb2981ef4e | ||
![]() |
e88e72e77e | ||
![]() |
6794a14d78 | ||
![]() |
108d50e915 | ||
![]() |
6b08647649 | ||
![]() |
02762f03af | ||
![]() |
b74e7abd6c | ||
![]() |
dd8a1899b7 | ||
![]() |
2e03ba69ee | ||
![]() |
229525f896 | ||
![]() |
5678b583f3 | ||
![]() |
112cd50eba | ||
![]() |
9ee1b78fcb | ||
![]() |
d239bca13f | ||
![]() |
f5e4937240 | ||
![]() |
0f5b9bad74 | ||
![]() |
edcd4c2bd7 | ||
![]() |
89f35f9df1 | ||
![]() |
25e1d28d75 | ||
![]() |
c0f212dbbc | ||
![]() |
ff349b0812 | ||
![]() |
a223be3c54 | ||
![]() |
28b5496083 | ||
![]() |
0a5ac37bc3 | ||
![]() |
ba4b902a70 | ||
![]() |
a0ea3ac575 | ||
![]() |
1444e3e777 | ||
![]() |
f9833db0ca | ||
![]() |
c0d440be71 | ||
![]() |
c1d82f2cac | ||
![]() |
9259945f93 | ||
![]() |
ab6977f0a6 | ||
![]() |
40104e4a2b | ||
![]() |
a10364d4ee | ||
![]() |
18a6ce9d25 | ||
![]() |
6b3248074b | ||
![]() |
d31ba0f55e | ||
![]() |
ead064e33d | ||
![]() |
5018463c5e | ||
![]() |
13e2ceeed9 | ||
![]() |
22f07c112d | ||
![]() |
6ff9d5e086 | ||
![]() |
592dabba90 | ||
![]() |
bf57d7f563 | ||
![]() |
c61cec19fa | ||
![]() |
42720f51f0 | ||
![]() |
412ff7139b | ||
![]() |
d350485721 | ||
![]() |
6d3cc779c6 | ||
![]() |
4ac0cbad25 | ||
![]() |
3bc65506b0 | ||
![]() |
60e4486b53 | ||
![]() |
bea581515c | ||
![]() |
6fa9f8b150 | ||
![]() |
cda0d40758 | ||
![]() |
85d7ac93e9 | ||
![]() |
0ce3429c6b | ||
![]() |
902dc2cb20 | ||
![]() |
1817cb215d | ||
![]() |
cfb4747e57 | ||
![]() |
e45a2dba9d | ||
![]() |
c4634f5bb4 | ||
![]() |
cf3d51ba6a | ||
![]() |
2af86a7080 | ||
![]() |
44e90e5c5a | ||
![]() |
b5b5ff12a8 | ||
![]() |
e2f1c1f88c | ||
![]() |
5a2034943d | ||
![]() |
7e7308158c | ||
![]() |
663ea6df17 | ||
![]() |
3901c9c45a | ||
![]() |
33b00dd5d3 | ||
![]() |
ae35574230 | ||
![]() |
8a886909d0 | ||
![]() |
75cffbd155 | ||
![]() |
a9ebf4e13c | ||
![]() |
3539eec0c1 | ||
![]() |
dc3066da86 | ||
![]() |
c73bba03f8 | ||
![]() |
c3a4119beb | ||
![]() |
e8a848333f | ||
![]() |
8a6939656f | ||
![]() |
a735202636 | ||
![]() |
8c4549ff18 | ||
![]() |
ca77f36f8e | ||
![]() |
f4dad88085 | ||
![]() |
cbea975b98 | ||
![]() |
26c4321fa9 | ||
![]() |
2f25c3f4a5 | ||
![]() |
0828d4c357 | ||
![]() |
70dfe537d2 | ||
![]() |
810270eb00 | ||
![]() |
aee0e16994 | ||
![]() |
d084697710 | ||
![]() |
1d942b8875 | ||
![]() |
f8dd8dcf14 | ||
![]() |
d3898996b0 | ||
![]() |
7cfd77a0f1 | ||
![]() |
e48ff7a5ef | ||
![]() |
a2c1759356 | ||
![]() |
d06ffa49ac | ||
![]() |
63de73ece6 | ||
![]() |
5ee37e0ab4 | ||
![]() |
f35ef174ca | ||
![]() |
46b58d1eef | ||
![]() |
a35aefbf1a | ||
![]() |
1c1f927e29 | ||
![]() |
2a951b1010 | ||
![]() |
c30d8d49cd | ||
![]() |
2df596227c | ||
![]() |
863e5f75a7 | ||
![]() |
b30302eba2 | ||
![]() |
e0c31e098e | ||
![]() |
92f0589585 | ||
![]() |
9426b6be6a | ||
![]() |
711e599ee3 | ||
![]() |
6e42a506b5 | ||
![]() |
179acdbf1e | ||
![]() |
81160d216e | ||
![]() |
94d70b3724 | ||
![]() |
77818e694f | ||
![]() |
52ce3484e3 | ||
![]() |
e7a2d1951e | ||
![]() |
d4974c3452 | ||
![]() |
336f147365 | ||
![]() |
9fd0454107 | ||
![]() |
8d03d1d597 | ||
![]() |
d344f44317 | ||
![]() |
a6688b76a6 | ||
![]() |
1113178730 | ||
![]() |
13c5bb8e63 | ||
![]() |
6b9bc307d7 | ||
![]() |
3626f8270a | ||
![]() |
b01d764b5a | ||
![]() |
3eb019d36b | ||
![]() |
3fef20c9c5 | ||
![]() |
a2a62799f2 | ||
![]() |
1e42363dfd | ||
![]() |
619a609bea | ||
![]() |
60953678c2 | ||
![]() |
6fd000939e | ||
![]() |
08c9da4c2c | ||
![]() |
b0908bcc6f | ||
![]() |
afef8f701f | ||
![]() |
e06063284c | ||
![]() |
90ff109156 | ||
![]() |
13df047b8e | ||
![]() |
ee5bdb2a55 | ||
![]() |
2ad6b48506 | ||
![]() |
fd7c4d2834 | ||
![]() |
d207cf3a74 | ||
![]() |
7085fee2e0 | ||
![]() |
855adf33de | ||
![]() |
f30a0b78b8 | ||
![]() |
bff7ebeb0c | ||
![]() |
6cb85f40fb | ||
![]() |
5c57cf40d8 | ||
![]() |
5fc1eb3820 | ||
![]() |
1e4ba0739b | ||
![]() |
acf43f032a | ||
![]() |
24e0eb7247 | ||
![]() |
7803caa833 | ||
![]() |
919efa1894 | ||
![]() |
459cbc4075 | ||
![]() |
bd087db248 | ||
![]() |
e632ecf64a | ||
![]() |
f180f9f344 | ||
![]() |
b609cf0255 | ||
![]() |
0aa41e0a47 | ||
![]() |
88d3b8bcee | ||
![]() |
eff7f5adf6 | ||
![]() |
73bbcaaacf | ||
![]() |
45e48d41d8 | ||
![]() |
3ff8c64d56 | ||
![]() |
ed3b393b7b | ||
![]() |
aaed7a7abb | ||
![]() |
0b860653be | ||
![]() |
ebede24bd4 | ||
![]() |
871085b8b2 | ||
![]() |
a553865994 | ||
![]() |
a748da9c27 | ||
![]() |
29502af63d | ||
![]() |
1b02a85be8 | ||
![]() |
3e592297cd | ||
![]() |
e20777d90e | ||
![]() |
9ec50d3dbb | ||
![]() |
41594890af | ||
![]() |
6bb1a78b81 | ||
![]() |
97c25fe67d | ||
![]() |
ee7820d04c | ||
![]() |
0df77fb0e9 | ||
![]() |
1b8636aa8e | ||
![]() |
a621fc0be8 | ||
![]() |
eeee01e534 | ||
![]() |
4e558ef5ca | ||
![]() |
95d580507e | ||
![]() |
3d81d725e5 | ||
![]() |
3a6a6b7a05 | ||
![]() |
cf6a399dc8 | ||
![]() |
162cfd6be4 | ||
![]() |
d2f762de55 | ||
![]() |
2403d615f6 | ||
![]() |
f32cc501ae | ||
![]() |
c00d8dc143 | ||
![]() |
2edc0d682c | ||
![]() |
2979071476 | ||
![]() |
98b9ab580a | ||
![]() |
cee6b34456 | ||
![]() |
d44a916dd1 | ||
![]() |
e3e6814eee | ||
![]() |
071cba4de2 | ||
![]() |
c2d781453d | ||
![]() |
3501a9be20 | ||
![]() |
f01253ac3a | ||
![]() |
aafa510eb0 | ||
![]() |
29f9e9ad4b | ||
![]() |
5db3f2daca | ||
![]() |
af39a960a4 | ||
![]() |
2a9b5f1070 | ||
![]() |
e0869cc42d | ||
![]() |
0376e6c0f1 | ||
![]() |
ae7d963f24 | ||
![]() |
bec946f131 | ||
![]() |
05e42bd49b | ||
![]() |
fe57e7f43c | ||
![]() |
e05dff553c | ||
![]() |
7d0a30088e | ||
![]() |
e99d30edf8 | ||
![]() |
23c6493093 | ||
![]() |
95cad9133a | ||
![]() |
3092987a7f | ||
![]() |
6083ccf000 | ||
![]() |
4d85598c4b | ||
![]() |
33d1be3fa2 | ||
![]() |
37646c0f76 | ||
![]() |
8bb18dd465 | ||
![]() |
d0ad543882 | ||
![]() |
c4b4668b38 | ||
![]() |
e484218385 | ||
![]() |
833de7c70a | ||
![]() |
707fb5982c |
3
.dir-locals.el
Normal file
3
.dir-locals.el
Normal file
@@ -0,0 +1,3 @@
|
||||
((nil . ((setq sh-basic-offset: 4)
|
||||
(setq indent-tabs-mode nil)
|
||||
)))
|
1
.kateconfig
Normal file
1
.kateconfig
Normal file
@@ -0,0 +1 @@
|
||||
kate: space-indent on; tab-width 4; indent-width 4; replace-tabs on; eol unix;
|
9
.kateproject
Normal file
9
.kateproject
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "Kate"
|
||||
, "files": [ { "git": 1 } ]
|
||||
, "build": {
|
||||
"directory": "build"
|
||||
, "build": "make -j $(getconf _NPROCESSORS_ONLN) all"
|
||||
, "clean": "make clean"
|
||||
}
|
||||
}
|
6
AUTHORS
6
AUTHORS
@@ -1,7 +1,7 @@
|
||||
Harald Hoyer <harald@redhat.com>
|
||||
Victor Lowther <victor.lowther@gmail.com>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
@@ -9,6 +9,7 @@ Hans de Goede <hdegoede@redhat.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Luca Berra <bluca@comedia.it>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
Andrey Borzenkov <arvidjaar@mail.ru>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
David Cantrell <dcantrell@redhat.com>
|
||||
@@ -16,12 +17,13 @@ Lance Albertson <lance@osuosl.org>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
||||
Dan Horák <dan@danny.cz>
|
||||
Andrey Borzenkov <arvidjaar@mail.ru>
|
||||
Joey Boggs <jboggs@redhat.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Mike Snitzer <msnitzer@redhat.com>
|
||||
Mike Snitzer <snitzer@redhat.com>
|
||||
Munehiro Matsuda <haro@kgt.co.jp>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Quentin Armitage <quentin@armitage.org.uk>
|
||||
|
46
Makefile
46
Makefile
@@ -17,7 +17,13 @@ else
|
||||
targets =
|
||||
endif
|
||||
|
||||
all: $(targets)
|
||||
all: $(targets) dracut-rhel6.html
|
||||
|
||||
dracut-rhel6.html: dracut-rhel6.xml
|
||||
xsltproc -o dracut-rhel6.html --xinclude -nonet \
|
||||
--stringparam draft.mode yes \
|
||||
--stringparam html.stylesheet http://docs.redhat.com/docs/en-US/Common_Content/css/default.css \
|
||||
http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl dracut-rhel6.xml
|
||||
|
||||
modules.d/99base/switch_root: switch_root.c
|
||||
gcc -D _GNU_SOURCE -D 'PACKAGE_STRING="dracut"' -std=gnu99 -fsigned-char -g -O2 -o modules.d/99base/switch_root switch_root.c
|
||||
@@ -27,7 +33,7 @@ install:
|
||||
mkdir -p $(DESTDIR)$(sbindir)
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)
|
||||
mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
|
||||
mkdir -p $(DESTDIR)$(mandir)/man{5,8}
|
||||
mkdir -p $(DESTDIR)$(mandir)/man{1,5,8}
|
||||
install -m 0755 dracut $(DESTDIR)$(sbindir)/dracut
|
||||
install -m 0755 dracut-gencmdline $(DESTDIR)$(sbindir)/dracut-gencmdline
|
||||
install -m 0755 dracut-catimages $(DESTDIR)$(sbindir)/dracut-catimages
|
||||
@@ -37,9 +43,12 @@ ifeq (1,${WITH_SWITCH_ROOT})
|
||||
install -m 0755 modules.d/99base/switch_root $(DESTDIR)$(sbindir)/switch_root
|
||||
endif
|
||||
install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d
|
||||
install -m 0755 dracut-functions $(DESTDIR)$(pkglibdir)/dracut-functions
|
||||
cp -arx modules.d $(DESTDIR)$(pkglibdir)
|
||||
install -m 0644 dracut.8 $(DESTDIR)$(mandir)/man8
|
||||
install -m 0644 mkinitrd.8 $(DESTDIR)$(mandir)/man8
|
||||
install -m 0644 lsinitrd.1 $(DESTDIR)$(mandir)/man1
|
||||
install -m 0644 dracut-catimages.8 $(DESTDIR)$(mandir)/man8
|
||||
install -m 0644 dracut-gencmdline.8 $(DESTDIR)$(mandir)/man8
|
||||
install -m 0644 dracut.conf.5 $(DESTDIR)$(mandir)/man5
|
||||
@@ -61,28 +70,33 @@ dist: dracut-$(VERSION).tar.bz2
|
||||
dracut-$(VERSION).tar.bz2:
|
||||
git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ |bzip2 > dracut-$(VERSION).tar.bz2
|
||||
|
||||
dracut-$(VERSION).tar.gz:
|
||||
git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ |gzip > dracut-$(VERSION).tar.gz
|
||||
|
||||
dracut-$(VERSION)-$(GITVERSION).tar.bz2:
|
||||
git archive --format=tar HEAD --prefix=dracut-$(VERSION)-$(GITVERSION)/ |bzip2 > dracut-$(VERSION)-$(GITVERSION).tar.bz2
|
||||
|
||||
|
||||
rpm: clean dracut-$(VERSION).tar.bz2
|
||||
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" -ba dracut.spec
|
||||
rm -fr BUILD BUILDROOT
|
||||
rpm: dracut-$(VERSION).tar.bz2
|
||||
rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \
|
||||
cp dracut-$(VERSION).tar.bz2 "$$rpmbuild"; \
|
||||
$$src/git2spec.pl $(VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \
|
||||
(cd "$$rpmbuild"; rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
|
||||
--define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \
|
||||
--define "_rpmdir $$PWD" -ba dracut.spec; ) && \
|
||||
( mv "$$rpmbuild"/noarch/*.rpm .; mv "$$rpmbuild"/*.src.rpm .;rm -fr "$$rpmbuild"; ls *.rpm )
|
||||
|
||||
gitrpm: dracut-$(VERSION)-$(GITVERSION).tar.bz2
|
||||
echo "%define gittag $(GITVERSION)" > dracut.spec.git
|
||||
cat dracut.spec >> dracut.spec.git
|
||||
mv dracut.spec dracut.spec.bak
|
||||
mv dracut.spec.git dracut.spec
|
||||
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" --define "gittag $(GITVERSION)" -ba dracut.spec || :
|
||||
mv dracut.spec.bak dracut.spec
|
||||
rm -fr BUILD BUILDROOT
|
||||
|
||||
check: all
|
||||
syncheck:
|
||||
@ret=0;for i in modules.d/99base/init modules.d/*/*.sh; do \
|
||||
[ "$${i##*/}" = "caps.sh" ] && continue; \
|
||||
dash -n "$$i" ; ret=$$(($$ret+$$?)); \
|
||||
done;exit $$ret
|
||||
make -C test check
|
||||
@ret=0;for i in dracut modules.d/02caps/caps.sh modules.d/*/install modules.d/*/installkernel modules.d/*/check; do \
|
||||
bash -n "$$i" ; ret=$$(($$ret+$$?)); \
|
||||
done;exit $$ret
|
||||
|
||||
check: all syncheck
|
||||
$(MAKE) -C test check
|
||||
|
||||
testimage: all
|
||||
./dracut -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
|
||||
|
25
NEWS
25
NEWS
@@ -1,3 +1,28 @@
|
||||
dracut-006
|
||||
==========
|
||||
- fixed mdraid with IMSM
|
||||
- fixed dracut manpages
|
||||
- dmraid parse different error messages
|
||||
- add cdrom polling mechanism for slow cdroms
|
||||
- add module btrfs
|
||||
- add btrfsctl scan for btrfs multi-devices (raid)
|
||||
- teach dmsquash live-root to use rootflags
|
||||
- trigger udev with action=add
|
||||
- fixed add_drivers handling
|
||||
- add sr_mod
|
||||
- use pigz instead of gzip, if available
|
||||
|
||||
dracut-005
|
||||
==========
|
||||
- dcb support to dracut's FCoE support
|
||||
- add readonly overlay support for dmsquash
|
||||
- add keyboard kernel modules
|
||||
- dracut.conf: added add_dracutmodules
|
||||
- add /etc/dracut.conf.d
|
||||
- add preliminary IPv6 support
|
||||
- bugfixes
|
||||
|
||||
|
||||
dracut-004
|
||||
==========
|
||||
- dracut-lib: read multiple lines from $init/etc/cmdline
|
||||
|
143
dracut
143
dracut
@@ -21,6 +21,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# store for logging
|
||||
dracut_args="$@"
|
||||
|
||||
usage() {
|
||||
# 80x25 linebreak here ^
|
||||
@@ -37,6 +39,8 @@ Creates initial ramdisk images for preloading modules
|
||||
exclusively include in the initramfs.
|
||||
--add-drivers [LIST] Specify a space-separated list of kernel
|
||||
modules to add to the initramfs.
|
||||
--omit-drivers [LIST] Specify a space-separated list of kernel
|
||||
modules not to add to the initramfs.
|
||||
--filesystems [LIST] Specify a space-separated list of kernel filesystem
|
||||
modules to exclusively include in the generic
|
||||
initramfs.
|
||||
@@ -79,6 +83,7 @@ while (($# > 0)); do
|
||||
-a|--add) add_dracutmodules_l="$2"; shift;;
|
||||
-d|--drivers) drivers_l="$2"; shift;;
|
||||
--add-drivers) add_drivers_l="$2"; shift;;
|
||||
--omit-drivers) omit_drivers_l+="$2"; shift;;
|
||||
--filesystems) filesystems_l="$2"; shift;;
|
||||
-k|--kmoddir) drivers_dir_l="$2"; shift;;
|
||||
--fwdir) fw_dir_l="$2"; shift;;
|
||||
@@ -94,6 +99,7 @@ while (($# > 0)); do
|
||||
--debug) debug="yes";;
|
||||
-v|--verbose) beverbose="yes";;
|
||||
-c|--conf) conffile="$2"; shift;;
|
||||
--confdir) confdir="$2"; shift;;
|
||||
-l|--local) allowlocal="yes" ;;
|
||||
-H|--hostonly) hostonly_l="yes" ;;
|
||||
-i|--include) include_src="$2"; include_target="$3"; shift 2;;
|
||||
@@ -106,6 +112,8 @@ done
|
||||
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
export PATH
|
||||
unset LD_LIBRARY_PATH
|
||||
unset GREP_OPTIONS
|
||||
|
||||
[[ $debug ]] && {
|
||||
export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
|
||||
@@ -122,15 +130,30 @@ if [[ ! -f $conffile ]]; then
|
||||
[[ $allowlocal ]] && conffile="$dracutbasedir/dracut.conf"
|
||||
fi
|
||||
|
||||
if [[ ! -d $confdir ]]; then
|
||||
[[ $allowlocal ]] || confdir="/etc/dracut.conf.d"
|
||||
[[ $allowlocal ]] && confdir="$dracutbasedir/dracut.conf.d"
|
||||
fi
|
||||
|
||||
# source our config dir
|
||||
if [ "$confdir" ] && [ -d "$confdir" ]; then
|
||||
for f in "$confdir"/*.conf; do
|
||||
[ -e "$f" ] && . "$f"
|
||||
done
|
||||
fi
|
||||
|
||||
# source our config file
|
||||
[[ -f $conffile ]] && . "$conffile"
|
||||
|
||||
# these optins add to the stuff in the config file
|
||||
[[ $add_dracutmodules_l ]] && add_dracutmodules+=" $add_dracutmodules_l"
|
||||
[[ $add_drivers_l ]] && add_drivers+=" $add_drivers_l"
|
||||
[[ $omit_drivers_l ]] && omit_drivers+=" $omit_drivers_l"
|
||||
|
||||
# these options override the stuff in the config file
|
||||
[[ $dracutmodules_l ]] && dracutmodules=$dracutmodules_l
|
||||
[[ $omit_dracutmodules_l ]] && omit_dracutmodules=$omit_dracutmodules_l
|
||||
[[ $add_dracutmodules_l ]] && add_dracutmodules="$add_dracutmodules $add_dracutmodules_l"
|
||||
[[ $drivers_l ]] && drivers=$drivers_l
|
||||
[[ $add_drivers_l ]] && add_drivers=$add_drivers_l
|
||||
[[ $filesystems_l ]] && filesystems=$filesystems_l
|
||||
[[ $drivers_dir_l ]] && drivers_dir=$drivers_dir_l
|
||||
[[ $fw_dir_l ]] && fw_dir=$fw_dir_l
|
||||
@@ -158,29 +181,52 @@ fi
|
||||
dracutfunctions=$dracutbasedir/dracut-functions
|
||||
export dracutfunctions
|
||||
|
||||
dinfo "Executing $0 $dracut_args"
|
||||
|
||||
omit_drivers_corrected=""
|
||||
for d in $omit_drivers; do
|
||||
strstr " $drivers $add_drivers " " $d " && continue
|
||||
omit_drivers_corrected+="$d|"
|
||||
done
|
||||
omit_drivers="${omit_drivers_corrected%|}"
|
||||
unset omit_drivers_corrected
|
||||
|
||||
# This is kinda legacy -- eventually it should go away.
|
||||
case $dracutmodules in
|
||||
""|auto) dracutmodules="all" ;;
|
||||
esac
|
||||
|
||||
[[ $2 ]] && kernel=$2 || kernel=$(uname -r)
|
||||
[[ $1 ]] && outfile=$(readlink -f $1) || outfile="/boot/initramfs-$kernel.img"
|
||||
[[ $1 ]] && outfile=$1 || outfile="/boot/initramfs-$kernel.img"
|
||||
abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile"
|
||||
|
||||
srcmods="/lib/modules/$kernel/"
|
||||
[[ $drivers_dir ]] && srcmods="$drivers_dir"
|
||||
export srcmods
|
||||
|
||||
if [[ -f $outfile && ! $force ]]; then
|
||||
echo "Will not override existing initramfs ($outfile) without --force"
|
||||
derror "Will not override existing initramfs ($outfile) without --force"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [[ -w $(dirname $outfile) ]]; then
|
||||
echo "No permission to write $outfile."
|
||||
outdir=$(dirname "$outfile")
|
||||
if ! [[ -d "$outdir" ]]; then
|
||||
derror "Can't write $outfile: Directory $outdir does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
hookdirs="cmdline pre-udev pre-trigger netroot pre-mount pre-pivot mount emergency"
|
||||
if ! [[ -w "$outdir" ]]; then
|
||||
derror "No permission to write $outdir."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -f "$outfile" ]] && ! [[ -w "$outfile" ]]; then
|
||||
derror "No permission to write $outfile."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
hookdirs="cmdline pre-udev pre-trigger netroot pre-mount pre-pivot mount emergency initqueue initqueue-finished initqueue-settled initqueue-timeout
|
||||
"
|
||||
|
||||
[[ -n "$TMPDIR" ]] && ! [[ -w "$TMPDIR" ]] && unset TMPDIR
|
||||
readonly initdir=$(mktemp -d -t initramfs.XXXXXX)
|
||||
@@ -193,32 +239,33 @@ chmod 755 "$initdir"
|
||||
|
||||
export initdir hookdirs dracutbasedir dracutmodules drivers \
|
||||
fw_dir drivers_dir debug beverbose no_kernel kernel_only \
|
||||
add_drivers mdadmconf lvmconf filesystems
|
||||
add_drivers omit_drivers mdadmconf lvmconf filesystems
|
||||
|
||||
if [[ $kernel_only != yes ]]; then
|
||||
# Create some directory structure first
|
||||
for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot tmp dev/pts var/run; do
|
||||
inst_dir "/$d";
|
||||
for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot tmp dev/pts var/log var/run $hookdirs; do
|
||||
inst_dir "/$d"
|
||||
done
|
||||
fi
|
||||
|
||||
# check all our modules to see if they should be sourced.
|
||||
# This builds a list of modules that we will install next.
|
||||
check_modules
|
||||
|
||||
modules_loaded=" "
|
||||
# source our modules.
|
||||
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||
mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
|
||||
if strstr "$mods_to_load" " $mod "; then
|
||||
_d_mod=${moddir##*/}; _d_mod=${_d_mod#[0-9][0-9]}
|
||||
if strstr "$mods_to_load" " $_d_mod "; then
|
||||
if [[ $kernel_only = yes ]]; then
|
||||
[[ -x $moddir/installkernel ]] && . "$moddir/installkernel"
|
||||
else
|
||||
. "$moddir/install"
|
||||
[[ -x "$moddir/install" ]] && . "$moddir/install"
|
||||
if [[ $no_kernel != yes && -x $moddir/installkernel ]]; then
|
||||
. "$moddir/installkernel"
|
||||
fi
|
||||
fi
|
||||
mods_to_load=${mods_to_load// $mod /}
|
||||
modules_loaded+="$_d_mod "
|
||||
mods_to_load=${mods_to_load// $_d_mod /}
|
||||
fi
|
||||
done
|
||||
unset moddir
|
||||
@@ -233,12 +280,13 @@ if [[ -d $initdir/lib/modules/$kernel ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# make sure that library links are correct and up to date
|
||||
ldconfig -n -r "$initdir" /lib* /usr/lib*
|
||||
|
||||
if [[ $include_src && $include_target ]]; then
|
||||
mkdir -p "$initdir$include_target"
|
||||
cp -a -t "$initdir$include_target" "$include_src"/*
|
||||
if [[ -f $include_src ]]; then
|
||||
inst $include_src $include_target
|
||||
else
|
||||
mkdir -p "$initdir$include_target"
|
||||
cp -a -t "$initdir$include_target" "$include_src"/*
|
||||
fi
|
||||
fi
|
||||
|
||||
for item in $install_items; do
|
||||
@@ -246,44 +294,53 @@ for item in $install_items; do
|
||||
done
|
||||
unset item
|
||||
|
||||
# make sure that library links are correct and up to date
|
||||
cp -ar /etc/ld.so.conf* "$initdir"/etc
|
||||
ldconfig -r "$initdir" || [[ $(id -u) != "0" ]] && dinfo "ldconfig might need uid=0 (root) for chroot()"
|
||||
|
||||
[[ $beverbose = yes ]] && (du -c "$initdir" | sort -n)
|
||||
|
||||
# strip binaries
|
||||
if [[ $do_strip = yes ]] ; then
|
||||
for p in strip objdump sed grep find; do
|
||||
for p in strip grep find; do
|
||||
if ! which $p >/dev/null 2>&1; then
|
||||
derror "Could not find '$p'. You should run $0 with '--nostrip'."
|
||||
dwarn "Could not find '$p'. Not stripping binaries in the initramfs."
|
||||
do_strip=no
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ $do_strip = yes ]] ; then
|
||||
for f in $(find "$initdir" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 -or -path '/lib/modules/*.ko' \) -exec file {} \; |
|
||||
grep -v ' shared object,' |
|
||||
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'); do
|
||||
dinfo "Stripping $f"
|
||||
strip -g "$f" || :
|
||||
#
|
||||
# FIXME: only strip -g for now
|
||||
#
|
||||
#strip -g --strip-unneeded "$f" || :
|
||||
#note="-R .note"
|
||||
#if objdump -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \
|
||||
# grep -q ALLOC; then
|
||||
# note=
|
||||
#fi
|
||||
#strip -R .comment $note "$f" || :
|
||||
for f in $(find "$initdir" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 -or -path '*/lib/modules/*.ko' \) ); do
|
||||
# do not strip files with a .hmac file,
|
||||
# because that would alter the checksum
|
||||
if ! [[ -f "${f%/*}/.${f##*/}.hmac" ]]; then
|
||||
dinfo "Stripping '$f'"
|
||||
strip -g "$f" 2>/dev/null|| :
|
||||
else
|
||||
dinfo "Not stripping '$f', because it has a hmac checksum file."
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet |gzip -9 > "$outfile"; )
|
||||
if [ $? -ne 0 ]; then
|
||||
derror "dracut: creation of $outfile failed"
|
||||
exit 1
|
||||
fi
|
||||
if strstr "$modules_loaded" " fips " && command -v prelink >/dev/null; then
|
||||
for i in $initdir/bin/* \
|
||||
$initdir/bin/* \
|
||||
$initdir/usr/bin/* \
|
||||
$initdir/usr/sbin/*; do
|
||||
[ -x $i ] && prelink -u $i &>/dev/null
|
||||
done
|
||||
fi
|
||||
|
||||
[[ $beverbose = yes ]] && ls -lh "$outfile"
|
||||
type pigz &>/dev/null && gzip=pigz || gzip=gzip
|
||||
if ! ( set -o pipefail; umask 077; cd "$initdir"; find . |cpio -R root:root -H newc -o --quiet| \
|
||||
$gzip -9 > "$outfile"; ); then
|
||||
derror "dracut: creation of $outfile failed"
|
||||
rm -f "$outfile"
|
||||
exit 1
|
||||
fi
|
||||
dinfo "Wrote $outfile"
|
||||
dinfo $(ls -l "$outfile")
|
||||
|
||||
exit 0
|
||||
|
||||
|
@@ -102,7 +102,8 @@ fi
|
||||
if [[ ! $no_overlay ]]; then
|
||||
ofile="$imagedir/90-overlay.img"
|
||||
dinfo "Creating image $ofile from directory $overlay"
|
||||
( cd "$overlay"; find . |cpio --quiet -H newc -o |gzip -9 > "$ofile"; )
|
||||
type pigz &>/dev/null && gzip=pigz || gzip=gzip
|
||||
( cd "$overlay"; find . |cpio --quiet -H newc -o |$gzip -9 > "$ofile"; )
|
||||
fi
|
||||
|
||||
if [[ ! $no_imagedir ]]; then
|
||||
|
233
dracut-functions
233
dracut-functions
@@ -28,26 +28,111 @@ strstr() { [[ $1 =~ $2 ]]; }
|
||||
if ! [[ $dracutlogfile ]]; then
|
||||
[[ $dracutbasedir = /usr/share/dracut ]] && \
|
||||
dracutlogfile=/var/log/dracut.log || \
|
||||
dracutlogfile=/tmp/dracut.log
|
||||
# [[ -w $dracutlogfile ]] || dracutlogfile=/tmp/dracut.log
|
||||
if [[ -w $dracutlogfile ]]; then
|
||||
>"$dracutlogfile"
|
||||
dracutlogfile=$HOME/dracut.log
|
||||
if [[ -w ${dracutlogfile%/*} ]]; then
|
||||
>>"$dracutlogfile"
|
||||
fi
|
||||
fi
|
||||
|
||||
dwarning() {
|
||||
echo "W: $@" >&2
|
||||
[[ -w $dracutlogfile ]] && echo "W: $@" >>"$dracutlogfile"
|
||||
[[ -w $dracutlogfile ]] && echo $(date) "Warn:" $@ >>"$dracutlogfile"
|
||||
}
|
||||
|
||||
dinfo() {
|
||||
[[ $beverbose ]] && echo "I: $@" >&2
|
||||
[[ -w $dracutlogfile ]] && echo "I: $@" >>"$dracutlogfile"
|
||||
[[ -w $dracutlogfile ]] && echo $(date) "Info:" $@ >>"$dracutlogfile"
|
||||
}
|
||||
|
||||
derror() {
|
||||
echo "E: $@" >&2
|
||||
[[ -w $dracutlogfile ]] && echo "E: $@" >>"$dracutlogfile"
|
||||
[[ -w $dracutlogfile ]] && echo $(date) "Err:" $@ >>"$dracutlogfile"
|
||||
}
|
||||
|
||||
|
||||
|
||||
# normalize_path <path>
|
||||
# Prints the normalized path, where it removes any duplicated
|
||||
# and trailing slashes.
|
||||
# Example:
|
||||
# $ normalize_path ///test/test//
|
||||
# /test/test
|
||||
normalize_path() {
|
||||
shopt -q -s extglob
|
||||
set -- "${1//+(\/)//}"
|
||||
shopt -q -u extglob
|
||||
echo "${1%/}"
|
||||
}
|
||||
|
||||
# convert_abs_rel <from> <to>
|
||||
# Prints the relative path, when creating a symlink to <to> from <from>.
|
||||
# Example:
|
||||
# $ convert_abs_rel /usr/bin/test /bin/test-2
|
||||
# ../../bin/test-2
|
||||
# $ ln -s $(convert_abs_rel /usr/bin/test /bin/test-2) /usr/bin/test
|
||||
convert_abs_rel() {
|
||||
local __current __absolute __abssize __cursize __newpath
|
||||
local -i __i __level
|
||||
|
||||
set -- "$(normalize_path "$1")" "$(normalize_path "$2")"
|
||||
|
||||
# corner case #1 - self looping link
|
||||
[[ "$1" == "$2" ]] && { echo "${1##*/}"; return; }
|
||||
|
||||
# corner case #2 - own dir link
|
||||
[[ "${1%/*}" == "$2" ]] && { echo "."; return; }
|
||||
|
||||
IFS="/" __current=($1)
|
||||
IFS="/" __absolute=($2)
|
||||
|
||||
__abssize=${#__absolute[@]}
|
||||
__cursize=${#__current[@]}
|
||||
|
||||
while [[ ${__absolute[__level]} == ${__current[__level]} ]]
|
||||
do
|
||||
(( __level++ ))
|
||||
if (( __level > __abssize || __level > __cursize ))
|
||||
then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
for ((__i = __level; __i < __cursize-1; __i++))
|
||||
do
|
||||
if ((__i > __level))
|
||||
then
|
||||
__newpath=$__newpath"/"
|
||||
fi
|
||||
__newpath=$__newpath".."
|
||||
done
|
||||
|
||||
for ((__i = __level; __i < __abssize; __i++))
|
||||
do
|
||||
if [[ -n $__newpath ]]
|
||||
then
|
||||
__newpath=$__newpath"/"
|
||||
fi
|
||||
__newpath=$__newpath${__absolute[__i]}
|
||||
done
|
||||
|
||||
echo "$__newpath"
|
||||
}
|
||||
|
||||
# returns OK if $1 contains $2 at the beginning
|
||||
str_starts() {
|
||||
[ "${1#$2*}" != "$1" ]
|
||||
}
|
||||
|
||||
ln_r() {
|
||||
local _source=$1
|
||||
local _dest=$2
|
||||
|
||||
if ! str_starts "$_source" "/"; then
|
||||
ln -sfn "$_source" "${initdir}/${_dest}"
|
||||
else
|
||||
[[ -d "${_dest%/*}" ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/}
|
||||
ln -sfn $(convert_abs_rel "${_dest}" "${_source}") "${initdir}/${_dest}"
|
||||
fi
|
||||
}
|
||||
|
||||
get_fs_env() {
|
||||
@@ -94,6 +179,9 @@ check_block_and_slaves() {
|
||||
[[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry.
|
||||
"$1" $2 && return
|
||||
check_vol_slaves "$@" && return 0
|
||||
if [[ -f "/sys/dev/block/$2/../dev" ]]; then
|
||||
check_block_and_slaves $1 $(cat "/sys/dev/block/$2/../dev") && return 0
|
||||
fi
|
||||
[[ -d /sys/dev/block/$2/slaves ]] || return 1
|
||||
for x in /sys/dev/block/$2/slaves/*/dev; do
|
||||
[[ -f $x ]] || continue
|
||||
@@ -132,31 +220,28 @@ check_vol_slaves() {
|
||||
}
|
||||
|
||||
# Install a directory, keeping symlinks as on the original system.
|
||||
# Example: if /lib64 points to /lib on the host, "inst_dir /lib/file"
|
||||
# Example: if /lib points to /lib64 on the host, "inst_dir /lib/file"
|
||||
# will create ${initdir}/lib64, ${initdir}/lib64/file,
|
||||
# and a symlink ${initdir}/lib -> lib64.
|
||||
inst_dir() {
|
||||
local dir="$1"
|
||||
[[ -e "${initdir}$dir" ]] && return 0
|
||||
[[ -e ${initdir}/"$1" ]] && return 0 # already there
|
||||
|
||||
# iterate over parent directories
|
||||
local file=""
|
||||
local IFS="/"
|
||||
for part in $dir; do
|
||||
[ -z "$part" ] && continue
|
||||
file="$file/$part"
|
||||
[[ -e "${initdir}$file" ]] && continue
|
||||
local _dir="$1" _part="${1%/*}" _file
|
||||
while [[ "$_part" != "${_part%/*}" ]] && ! [[ -e "${initdir}/${_part}" ]]; do
|
||||
_dir="$_part $_dir"
|
||||
_part=${_part%/*}
|
||||
done
|
||||
|
||||
if [ -L "$file" ]; then
|
||||
# create link as the original
|
||||
local target=$(readlink "$file")
|
||||
ln -sfn "$target" "${initdir}$file" || return 1
|
||||
# resolve relative path and recursively install destionation
|
||||
[[ "$target" = "${target##*/}" ]] && target="${file%/*}/$target"
|
||||
inst_dir "$target"
|
||||
# iterate over parent directories
|
||||
for _file in $_dir; do
|
||||
[[ -e "${initdir}/$_file" ]] && continue
|
||||
if [[ -L $_file ]]; then
|
||||
inst_symlink "$_file"
|
||||
else
|
||||
# create directory
|
||||
mkdir -p "${initdir}$file" || return 1
|
||||
mkdir -m 0755 -p "${initdir}/$_file" || return 1
|
||||
[[ -e "$_file" ]] && chmod --reference="$_file" "${initdir}/$_file"
|
||||
chmod u+w "${initdir}/$_file"
|
||||
fi
|
||||
done
|
||||
}
|
||||
@@ -166,13 +251,17 @@ inst_dir() {
|
||||
# Location of the image dir is assumed to be $initdir
|
||||
# We never overwrite the target if it exists.
|
||||
inst_simple() {
|
||||
local src target
|
||||
local src target
|
||||
[[ -f $1 ]] || return 1
|
||||
src=$1 target="${2:-$1}"
|
||||
if ! [[ -d ${initdir}$target ]]; then
|
||||
[[ -e ${initdir}$target ]] && return 0
|
||||
inst_dir "${target%/*}"
|
||||
fi
|
||||
# install checksum files also
|
||||
if [[ -e "${src%/*}/.${src##*/}.hmac" ]]; then
|
||||
inst "${src%/*}/.${src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
|
||||
fi
|
||||
dinfo "Installing $src"
|
||||
cp -pfL "$src" "${initdir}$target"
|
||||
}
|
||||
@@ -184,11 +273,15 @@ inst_library() {
|
||||
local src=$1 dest=${2:-$1}
|
||||
[[ -e $initdir$dest ]] && return 0
|
||||
if [[ -L $src ]]; then
|
||||
# install checksum files also
|
||||
if [[ -e "${src%/*}/.${src##*/}.hmac" ]]; then
|
||||
inst "${src%/*}/.${src##*/}.hmac" "${dest%/*}/.${dest##*/}.hmac"
|
||||
fi
|
||||
reallib=$(readlink -f "$src")
|
||||
lib=${src##*/}
|
||||
inst_simple "$reallib" "$reallib"
|
||||
inst_dir "${dest%/*}"
|
||||
(cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib")
|
||||
ln_r "$reallib" "$dest"
|
||||
else
|
||||
inst_simple "$src" "$dest"
|
||||
fi
|
||||
@@ -215,7 +308,7 @@ inst_binary() {
|
||||
local LDSO NAME IO FILE ADDR I1 n f TLIBDIR
|
||||
[[ -e $initdir$target ]] && return 0
|
||||
# I love bash!
|
||||
ldd $bin 2>/dev/null | while read line; do
|
||||
LC_ALL=C ldd $bin 2>/dev/null | while read line; do
|
||||
[[ $line = 'not a dynamic executable' ]] && return 1
|
||||
if [[ $line =~ not\ found ]]; then
|
||||
derror "Missing a shared library required by $bin."
|
||||
@@ -262,12 +355,22 @@ inst_script() {
|
||||
|
||||
# same as above, but specialized for symlinks
|
||||
inst_symlink() {
|
||||
local src=$1 target=$initdir${2:-$1} realsrc
|
||||
local _src=$1 _target=${2:-$1} _realsrc
|
||||
strstr "$1" "/" || return 1
|
||||
[[ -L $1 ]] || return 1
|
||||
[[ -L $target ]] && return 0
|
||||
realsrc=$(readlink -f "$src")
|
||||
[[ $realsrc = ${realsrc##*/} ]] && realsrc=${src%/*}/$realsrc
|
||||
inst "$realsrc" && ln -s "$realsrc" "$target"
|
||||
[[ -L $initdir/$_target ]] && return 0
|
||||
_realsrc=$(readlink -f "$_src")
|
||||
[[ ${_realsrc#/} = ${_realsrc} ]] && _realsrc="${_src%/*}/${_realsrc}"
|
||||
if ! [[ -e $initdir/$_realsrc ]]; then
|
||||
if [[ -d $_realsrc ]]; then
|
||||
inst_dir "$_realsrc"
|
||||
else
|
||||
inst "$_realsrc"
|
||||
fi
|
||||
fi
|
||||
[[ ! -e $initdir/${_target%/*} ]] && inst_dir "${_target%/*}"
|
||||
|
||||
ln_r "${_realsrc}" "${_target}"
|
||||
}
|
||||
|
||||
# find a udev rule in the usual places.
|
||||
@@ -338,7 +441,7 @@ dracut_install() {
|
||||
while (($# > 0)); do
|
||||
if ! inst "$1" ; then
|
||||
if [[ $optional = yes ]]; then
|
||||
dwarning "Skipping program $1 as it cannot be found and is flagged to be optional"
|
||||
dinfo "Skipping program $1 as it cannot be found and is flagged to be optional"
|
||||
else
|
||||
derror "Failed to install $1"
|
||||
exit 1
|
||||
@@ -381,12 +484,14 @@ should_source_module() {
|
||||
"$1/check" $hostonly || return 1
|
||||
for dep in $("$1/check" -d); do
|
||||
check_module_deps "$dep" && continue
|
||||
dwarning "Cannot load $mod, dependencies failed."
|
||||
dwarning "Cannot load dracut module \"$mod\", dependencies failed."
|
||||
return 1
|
||||
done
|
||||
}
|
||||
|
||||
check_modules() {
|
||||
local modcheck;
|
||||
local mod;
|
||||
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||
local mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
|
||||
# If we are already scheduled to be loaded, no need to check again.
|
||||
@@ -401,6 +506,14 @@ check_modules() {
|
||||
fi
|
||||
mods_to_load+=" $mod "
|
||||
done
|
||||
|
||||
modcheck=$add_dracutmodules
|
||||
[[ $dracutmodules != all ]] && modcheck="$m $dracutmodules"
|
||||
for mod in $modcheck; do
|
||||
strstr "$mods_to_load" "$mod" && continue
|
||||
strstr "$omit_dracutmodules" "$mod" && continue
|
||||
dwarning "Dracut module \"$mod\" cannot be found."
|
||||
done
|
||||
}
|
||||
|
||||
# Install a single kernel module along with any firmware it may require.
|
||||
@@ -408,8 +521,26 @@ check_modules() {
|
||||
install_kmod_with_fw() {
|
||||
local modname=${1##*/} fwdir found
|
||||
modname=${modname%.ko*}
|
||||
# no need to go further if the module is already installed
|
||||
[[ -e "${initdir}/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" ]] && return 0
|
||||
|
||||
if [[ $omit_drivers ]]; then
|
||||
local _kmod=${1##*/}
|
||||
_kmod=${_kmod%.ko}
|
||||
_kmod=${_kmod/-/_}
|
||||
if [[ "$_kmod" =~ $omit_drivers ]]; then
|
||||
dinfo "Omitting driver $_kmod"
|
||||
return 1
|
||||
fi
|
||||
if [[ "${1##*/lib/modules/$kernel/}" =~ $omit_drivers ]]; then
|
||||
dinfo "Omitting driver $_kmod"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" || \
|
||||
return 0 # no need to go further if the module is already installed
|
||||
return $?
|
||||
|
||||
for fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do
|
||||
found=''
|
||||
for fwdir in $fw_dir; do
|
||||
@@ -419,9 +550,10 @@ install_kmod_with_fw() {
|
||||
fi
|
||||
done
|
||||
if [[ $found != yes ]]; then
|
||||
dinfo "Possible missing firmware ${fw} for module ${mod}.ko"
|
||||
dinfo "Possible missing firmware \"${fw}\" for kernel module \"${mod}.ko\""
|
||||
fi
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
# Do something with all the dependencies of a kernel module.
|
||||
@@ -431,13 +563,16 @@ install_kmod_with_fw() {
|
||||
# $2 = module to get dependencies for
|
||||
# rest of args = arguments to modprobe
|
||||
for_each_kmod_dep() {
|
||||
local func=$1 kmod=$2 cmd modpapth options
|
||||
local func=$1 kmod=$2 cmd modpapth options
|
||||
shift 2
|
||||
modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | \
|
||||
modprobe "$@" --ignore-install --show-depends $kmod 2>/dev/null | ( \
|
||||
local found=0;
|
||||
while read cmd modpath options; do
|
||||
[[ $cmd = insmod ]] || continue
|
||||
$func $modpath
|
||||
done
|
||||
$func ${modpath} || exit $?
|
||||
found=1
|
||||
done; [[ $found -eq 0 ]] && exit 1; exit 0;)
|
||||
return $?
|
||||
}
|
||||
|
||||
# filter kernel modules to install certain modules that meet specific
|
||||
@@ -450,7 +585,7 @@ for_each_kmod_dep() {
|
||||
# This function returns the full filenames of modules that match $1
|
||||
filter_kernel_modules () (
|
||||
if ! [[ $hostonly ]]; then
|
||||
filtercmd='find "$srcmods/kernel/drivers" -name "*.ko" -o -name "*.ko.gz"'
|
||||
filtercmd='find "$srcmods/kernel/drivers" "$srcmods/updates" "$srcmods/extra" "$srcmods/weak-updates" -name "*.ko" -o -name "*.ko.gz" 2>/dev/null'
|
||||
else
|
||||
filtercmd='cut -d " " -f 1 </proc/modules|xargs modinfo -F filename -k $kernel'
|
||||
fi
|
||||
@@ -472,6 +607,7 @@ filter_kernel_modules () (
|
||||
instmods() {
|
||||
[[ $no_kernel = yes ]] && return
|
||||
local mod mpargs modpath modname cmd
|
||||
local ret=0
|
||||
while (($# > 0)); do
|
||||
mod=${1%.ko*}
|
||||
case $mod in
|
||||
@@ -493,10 +629,17 @@ instmods() {
|
||||
shift; continue;
|
||||
;;
|
||||
*)
|
||||
mod=${mod##*/}
|
||||
# if we are already installed, skip this module and go on
|
||||
# to the next one.
|
||||
[[ -f $initdir/$1 ]] && { shift; continue; }
|
||||
|
||||
mod=${mod##*/}
|
||||
|
||||
if [[ $omit_drivers ]] && [[ "$1" =~ $omit_drivers ]]; then
|
||||
dinfo "Omitting driver ${mod##$srcmods}"
|
||||
shift; continue;
|
||||
fi
|
||||
|
||||
# If we are building a host-specific initramfs and this
|
||||
# module is not already loaded, move on to the next one.
|
||||
[[ $hostonly ]] && ! grep -q "${mod//-/_}" /proc/modules && \
|
||||
@@ -507,10 +650,12 @@ instmods() {
|
||||
# it may require
|
||||
for_each_kmod_dep install_kmod_with_fw $mod \
|
||||
--set-version $kernel -d ${srcmods%%/lib/modules/*}/
|
||||
;;
|
||||
ret=$((ret+$?))
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
return $ret
|
||||
}
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
|
1764
dracut-rhel6.xml
Normal file
1764
dracut-rhel6.xml
Normal file
File diff suppressed because it is too large
Load Diff
591
dracut.8
591
dracut.8
@@ -10,7 +10,7 @@ creates an initial image used by the kernel for
|
||||
preloading the block device modules (such as IDE, SCSI or RAID)
|
||||
which are needed to access the root filesystem.
|
||||
|
||||
.SH OPTIONS
|
||||
.SS Options
|
||||
.TP
|
||||
.BR \-f ", " \-\-force
|
||||
overwrite existing initramfs file.
|
||||
@@ -28,12 +28,27 @@ omit a space-separated list of dracut modules.
|
||||
add a space-separated list of dracut modules.
|
||||
.TP
|
||||
.BR \-d ", " \-\-drivers " \fILIST\fR"
|
||||
specify a space-separated list of kernel modules to exclusively include in the initramfs.
|
||||
specify a space-separated list of kernel modules to exclusively include
|
||||
in the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix.
|
||||
.TP
|
||||
.BR \-\-add-drivers " \fILIST\fR"
|
||||
specify a space-separated list of kernel modules to add to the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix.
|
||||
.TP
|
||||
.BR \-\-omit-drivers " \fILIST\fR"
|
||||
specify a space-separated list of kernel modules to omit from the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix.
|
||||
Regular expressions are also allowed like ".*/fs/ocfs/.*".
|
||||
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes.
|
||||
|
||||
example:
|
||||
# dracut --omit "module1 module2" ...
|
||||
.TP
|
||||
.BR \-\-filesystems " \fILIST\fR"
|
||||
specify a space-separated list of kernel filesystem modules to exclusively include in the generic initramfs.
|
||||
specify a space-separated list of kernel filesystem modules to exclusively
|
||||
include in the generic initramfs.
|
||||
.TP
|
||||
.BR \-k ", " \-\-kmoddir " \fI{DIR}\fR
|
||||
specify the directory, where to look for kernel modules
|
||||
@@ -73,6 +88,11 @@ specify configuration file to use.
|
||||
Default:
|
||||
.IR /etc/dracut.conf
|
||||
.TP
|
||||
.BR \-\-confdir " \fIDIR\fR"
|
||||
specify configuration directory to use.
|
||||
Default:
|
||||
.IR /etc/dracut.conf.d
|
||||
.TP
|
||||
.BR \-l ", " \-\-local
|
||||
local mode. Use modules from the current working
|
||||
directory instead of the system-wide installed in
|
||||
@@ -90,7 +110,7 @@ target directory in the final initramfs.
|
||||
.BR \-I ", " \-\-install " \fILIST\fR"
|
||||
install the space separated list of files into the initramfs.
|
||||
|
||||
.SH KERNEL COMMAND LINE
|
||||
.SH "KERNEL COMMAND LINE"
|
||||
The root filesystem used by the kernel is specified in the boot configuration
|
||||
file, as always. The traditional \fBroot=/dev/hda1\fR style device
|
||||
specification is allowed. If a label is used, as in \fBroot=LABEL=rootPart\fR
|
||||
@@ -99,245 +119,50 @@ with the appropriate label, and mount that device as the root filesystem.
|
||||
\fBroot=UUID=uuidnumber\fR will mount the partition with that UUID as the
|
||||
root filesystem.
|
||||
|
||||
.SH Standard
|
||||
.SS Standard
|
||||
.TP
|
||||
.B init=<path to real init>
|
||||
.BR init= "<path to real init>"
|
||||
.TP
|
||||
.B root=<path to blockdevice>
|
||||
specify blockdevice to use as root filesystem.
|
||||
e.g. \fI/dev/sda1\fR
|
||||
e.g. \fI/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1\fR
|
||||
.BR root= "<path to blockdevice>"
|
||||
specify blockdevice to use as root filesystem.
|
||||
e.g.
|
||||
root=/dev/sda1
|
||||
root=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1
|
||||
.TP
|
||||
.B rootfstype=<filesystem type>
|
||||
"auto" if not specified, e.g. \fIrootfstype=ext3\fR
|
||||
.BR rootfstype= "<filesystem type>"
|
||||
"auto" if not specified, e.g. rootfstype=ext3
|
||||
.TP
|
||||
.B rootflags=<mount options>
|
||||
.BR rootflags= "<mount options>"
|
||||
specify additional mount options for the root filesystem. If not set, /etc/fstab
|
||||
of the real root will be parsed for special mount options and mounted
|
||||
accordingly.
|
||||
.TP
|
||||
\fBrootfallback=\fR\fI<path to blockdevice>\fR
|
||||
specify the block device to use as the root filesystem, if the normal root cannot be found\&. This can only be a simple block device with a simple file system, for which the filesystem driver is either compiled in, or added manually to the initramfs\&. This parameter can be specified multiple times\&.
|
||||
.TP
|
||||
.B rd_NO_FSTAB
|
||||
do not honor special mount options for the root filesystem found in
|
||||
/etc/fstab of the real root.
|
||||
|
||||
.SH I18N
|
||||
.ad l
|
||||
e.g. LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=de-latin1-nodeadkeys
|
||||
.ad
|
||||
.SS Misc
|
||||
.TP
|
||||
.B KEYBOARDTYPE=sun|pc
|
||||
will be written to /etc/sysconfig/keyboard in the initramfs
|
||||
.BR hostname= "<hostname>"
|
||||
set the initial hostname
|
||||
.TP
|
||||
.B KEYTABLE=<keytable filename>
|
||||
will be written to /etc/sysconfig/keyboard in the initramfs
|
||||
.TP
|
||||
.B SYSFONT= Console font
|
||||
will be written to /etc/sysconfig/i18n in the initramfs
|
||||
.TP
|
||||
.B SYSFONTACM= Unicode font map
|
||||
will be written to /etc/sysconfig/i18n in the initramfs
|
||||
.TP
|
||||
.B UNIMAP= Unicode font map
|
||||
will be written to /etc/sysconfig/i18n in the initramfs
|
||||
.TP
|
||||
.B LANG=<locale>
|
||||
will be written to /etc/sysconfig/i18n in the initramfs
|
||||
|
||||
.SH LVM
|
||||
.TP
|
||||
.B rd_NO_LVM
|
||||
disable LVM detection
|
||||
.TP
|
||||
.B rd_LVM_VG=<volume group name>
|
||||
only activate the volume groups with the given name
|
||||
rd_LVM_VG can be specified multiple times on the kernel command line.
|
||||
.TP
|
||||
.B rd_LVM_LV=<logical volume name>
|
||||
only activate the volume groups with the given name
|
||||
rd_LVM_LV can be specified multiple times on the kernel command line.
|
||||
.TP
|
||||
.B rd_NO_LVMCONF
|
||||
remove any /etc/lvm/lvm.conf, which may exist in the initramfs
|
||||
|
||||
.SH crypto LUKS
|
||||
.TP
|
||||
.B rd_NO_LUKS
|
||||
disable crypto LUKS detection
|
||||
.TP
|
||||
.B rd_LUKS_UUID=<luks uuid>
|
||||
only activate the LUKS partitions with the given UUID
|
||||
Any "luks-" of the LUKS UUID is removed before comparing to <luks uuid>.
|
||||
The comparisons also matches, if <luks uuid> is only the beginning of the
|
||||
LUKS UUID, so you don't have to specify the full UUID.
|
||||
.B rd_NO_CRYPTTAB
|
||||
do not check if LUKS partition is in /etc/crypttab
|
||||
|
||||
.SH MD
|
||||
.TP
|
||||
.B rd_NO_MD
|
||||
disable MD RAID detection
|
||||
.TP
|
||||
.B rd_NO_MDIMSM
|
||||
no MD RAID for imsm/isw raids, use dmraid instead
|
||||
.TP
|
||||
.B rd_NO_MDADMCONF
|
||||
ignore mdadm.conf included in initramfs
|
||||
.TP
|
||||
.B rd_MD_UUID=<md uuid>
|
||||
only activate the raid sets with the given UUID
|
||||
|
||||
.SH DMRAID
|
||||
.TP
|
||||
.B rd_NO_DM
|
||||
disable DM RAID detection
|
||||
.TP
|
||||
.B rd_DM_UUID=<dmraid uuid>
|
||||
only activate the raid sets with the given UUID
|
||||
|
||||
.SH DASD
|
||||
.TP
|
||||
.B rd_DASD_MOD=....
|
||||
same syntax as the kernel module parameter (s390 only)
|
||||
|
||||
.TP
|
||||
.B rd_DASD=<dasd adaptor device bus ID>[,readonly=X][,use_diag=X][,erplog=X][,failfast=X]
|
||||
activate DASD device with the given adaptor device bus ID and setting the sysfs attributes
|
||||
to the specified values
|
||||
|
||||
.SH ZFCP
|
||||
.TP
|
||||
.B rd_ZFCP=<zfcp adaptor device bus ID>,<WWPN>,<FCPLUN>
|
||||
rd_ZFCP can be specified multiple times on the kernel command line.
|
||||
|
||||
example: rd_ZFCP=0.0.4000,0x5005076300C213e9,0x5022000000000000
|
||||
.TP
|
||||
.B rd_NO_ZFCPCONF
|
||||
ignore zfcp.conf included in the initramfs
|
||||
|
||||
.SH CCW
|
||||
.TP
|
||||
.B rd_CCW=<nettype>,<subchannels>,<options>
|
||||
rd_CCW can be specified multiple times on the kernel command line. Examples:
|
||||
rd_CCW=qeth,0.0.0600,0.0.0601,0.0.0602,layer2=1,portname=foo
|
||||
rd_CCW=ctc,0.0.0600,0.0.0601,0.0.0602,protocol=bar
|
||||
.SH DHCP
|
||||
.TP
|
||||
.B root=dhcp
|
||||
get IP from dhcp server, root-path option from dhcp specifies root location
|
||||
|
||||
.SH NFS
|
||||
.TP
|
||||
.B root=[<server-ip>:]<root-dir>[:<nfs-options>]
|
||||
mount nfs share from <server-ip>:/<root-dir>, if no server-ip is given,
|
||||
use dhcp next_server.
|
||||
NFS options can be appended with the prefix "." or ","
|
||||
.TP
|
||||
.B root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>]
|
||||
.TP
|
||||
.B root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]
|
||||
.TP
|
||||
.B root=dhcp
|
||||
root=dhcp alone directs initrd to look at the DHCP root-path where NFS
|
||||
options can be specified.
|
||||
root-path=<server-ip>:<root-dir>[,<nfs-options>]
|
||||
root-path=nfs:<server-ip>:<root-dir>[,<nfs-options>]
|
||||
root-path=nfs4:<server-ip>:<root-dir>[,<nfs-options>]
|
||||
.TP
|
||||
.B root=/dev/nfs nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
|
||||
\fBDeprecated!\fR kernel Documentation/filesystems/nfsroot.txt defines
|
||||
this method.
|
||||
This is supported by dracut but not recommended.
|
||||
.TP
|
||||
.B rd_NFS_DOMAIN=<NFSv4 domain name>
|
||||
Set the NFSv4 domain name. Will overwrite the settings in /etc/idmap.conf.
|
||||
|
||||
.SH iSCSI
|
||||
.TP
|
||||
.B root=iscsi:[username:password[:reverse:password]@][<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname>
|
||||
protocol defaults to "6", LUN defaults to "0".
|
||||
|
||||
If the "servername" field is provided by BOOTP or DHCP, then that
|
||||
field is used in conjunction with other associated fields to contact
|
||||
the boot server in the Boot stage (Section 7). However, if the
|
||||
"servername" field is not provided, then the "targetname" field is
|
||||
then used in the Discovery Service stage in conjunction with other
|
||||
associated fields.
|
||||
|
||||
http://tools.ietf.org/html/rfc4173
|
||||
|
||||
.TP
|
||||
.B root=iscsi:[username:password[:reverse:password]@][<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname>
|
||||
e.g. root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
|
||||
.TP
|
||||
.B root=??? netroot=iscsi:[username:password[:reverse:password]@][<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname> ...
|
||||
.ad l
|
||||
multiple netroot options allow setting up multiple iscsi disks
|
||||
e.g.
|
||||
root=UUID=12424547
|
||||
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
|
||||
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1
|
||||
|
||||
.B not yet implemented!
|
||||
.ad
|
||||
.TP
|
||||
.B root=??? iscsi_initiator= iscsi_target_name= iscsi_target_ip= iscsi_target_port= iscsi_target_group= iscsi_username= iscsi_password= iscsi_in_username= iscsi_in_password=
|
||||
.TP
|
||||
.B root=??? iscsi_firmware
|
||||
will read the iscsi parameter from the BIOS firmware
|
||||
|
||||
.SH FCoE
|
||||
.TP
|
||||
.B netroot=fcoe:<interface|MAC>:<dcb|nodcb>
|
||||
Try to connect to a FCoE SAN through the NIC specified by <interface> or <MAC>,
|
||||
for the second argument, currently only nodcb is supported. Note letters in
|
||||
the MAC-address must be lowercase!
|
||||
|
||||
.SH NBD
|
||||
.TP
|
||||
.B root=nbd:<server>:<port>[:<fstype>][:<mountopts>]
|
||||
mount nbd share from <server>
|
||||
.TP
|
||||
.B root=dhcp
|
||||
with dhcp root-path=nbd:<server>:<port>[:<fstype>][:<mountopts>]
|
||||
root=dhcp alone directs initrd to look at the DHCP root-path where NBD options can be specified.
|
||||
This syntax is only usable in cases where you are directly mounting the volume as the rootfs.
|
||||
|
||||
.SH Network
|
||||
.TP
|
||||
.B ip={dhcp|on|any}
|
||||
get ip from dhcp server from all interfaces. If root=dhcp, loop sequentially through all interfaces (eth0, eth1, ...) and use the first with a valid DHCP root-path.
|
||||
.TP
|
||||
.B ip=<interface>:{dhcp|on|any}
|
||||
get ip from dhcp server on a specific interface
|
||||
.TP
|
||||
.ad l
|
||||
.B ip=<client-IP>:[<server-id>]:<gateway-IP>:<netmask>:<client\%hostname>:<interface>:{none|off}
|
||||
.ad
|
||||
explicit network configuration
|
||||
.TP
|
||||
.B ifname=<interface>:<MAC>
|
||||
Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>.
|
||||
Note letters in the MAC-address must be lowercase!
|
||||
Note that if you use this option you \fBmust\fR specify an ifname= argument
|
||||
for all interfaces used in ip= or fcoe= arguments
|
||||
.TP
|
||||
.B bootdev=<interface>
|
||||
specify network interface to use routing and netroot information from. Required if multiple ip= lines are used.
|
||||
|
||||
.SH Plymouth Boot Splash
|
||||
.TP
|
||||
.B rd_NO_PLYMOUTH
|
||||
do not start plymouth. This will not work with encrypted partitions.
|
||||
|
||||
.SH Misc
|
||||
.TP
|
||||
.B rdblacklist=<drivername>
|
||||
.BR rdblacklist= "<drivername>"
|
||||
do not load kernel module <drivername>
|
||||
This parameter can be specified multiple times.
|
||||
.TP
|
||||
.B rdloaddriver=<drivername>
|
||||
.BR rdloaddriver= "<drivername>"
|
||||
force loading kernel module <drivername>
|
||||
This parameter can be specified multiple times.
|
||||
.TP
|
||||
.BR rd_retry= "<seconds>"
|
||||
wait <seconds> until dracut tries to force assemble LVM or RAID volumes. If the root device is not found within <seconds>*2 then dracut fails and either drops to a shell, if rdshell is on the kernel command line, or exits with 1, which normally causes a kernel panic.
|
||||
|
||||
.SH Debug
|
||||
Default: rd_retry=40
|
||||
|
||||
.SS Debug
|
||||
.TP
|
||||
.B rdinfo
|
||||
print informational output though "quiet" is set
|
||||
@@ -351,7 +176,9 @@ set -x for the dracut shell and logs to dmesg, console and /init.log
|
||||
.B rdbreak
|
||||
drop to a shell at the end
|
||||
.TP
|
||||
.B rdbreak={cmdline | pre-udev | pre-trigger | initqueue | pre-mount | mount | pre-pivot}
|
||||
.ad l
|
||||
.BR rdbreak= \%{cmdline\:|pre-udev\:|pre-trigger\:|initqueue\:|pre-mount\:|mount\:|pre-pivot}
|
||||
.ad
|
||||
drop to a shell on defined breakpoint
|
||||
.TP
|
||||
.B rdudevinfo
|
||||
@@ -359,27 +186,313 @@ set udev to loglevel info
|
||||
.TP
|
||||
.B rdudevdebug
|
||||
set udev to loglevel debug
|
||||
.TP
|
||||
.B rdnetdebug
|
||||
debug network scripts in dracut. Output is written to /tmp/
|
||||
|
||||
.SH CONFIGURATION IN INITRAMFS
|
||||
.TP
|
||||
.B /conf/conf.d/
|
||||
Any files found in /conf/conf.d/ will be sourced in the initramfs to
|
||||
set initial values. Command line options will override these values
|
||||
set in the configuration files.
|
||||
.SS I18N
|
||||
e.g.
|
||||
LANG=en_US.UTF-8
|
||||
SYSFONT=latarcyrheb-sun16
|
||||
KEYTABLE=de-latin1-nodeadkeys
|
||||
.TP
|
||||
.B /etc/cmdline
|
||||
Can contain additional command line options.
|
||||
.BR KEYBOARDTYPE= sun|pc
|
||||
will be written to /etc/sysconfig/keyboard in the initramfs
|
||||
.TP
|
||||
.BR KEYTABLE= "<keytable filename>"
|
||||
will be written to /etc/sysconfig/keyboard in the initramfs
|
||||
.TP
|
||||
.BR SYSFONT= "Console font"
|
||||
will be written to /etc/sysconfig/i18n in the initramfs
|
||||
.TP
|
||||
.BR SYSFONTACM= "Unicode font map"
|
||||
will be written to /etc/sysconfig/i18n in the initramfs
|
||||
.TP
|
||||
.BR UNIMAP= "Unicode font map"
|
||||
will be written to /etc/sysconfig/i18n in the initramfs
|
||||
.TP
|
||||
.BR LANG= <locale>
|
||||
will be written to /etc/sysconfig/i18n in the initramfs
|
||||
|
||||
.SS LVM
|
||||
.TP
|
||||
.BR rd_NO_LVM
|
||||
disable LVM detection
|
||||
.TP
|
||||
.BR rd_LVM_VG= "<volume group name>"
|
||||
only activate the volume groups with the given name
|
||||
rd_LVM_VG can be specified multiple times on the kernel command line.
|
||||
.TP
|
||||
.BR rd_LVM_LV= "<logical volume name>"
|
||||
only activate the logical volumes with the given name
|
||||
rd_LVM_LV can be specified multiple times on the kernel command line.
|
||||
.TP
|
||||
.BR rd_NO_LVMCONF
|
||||
remove any /etc/lvm/lvm.conf, which may exist in the initramfs
|
||||
|
||||
.SS "crypto LUKS"
|
||||
.TP
|
||||
.BR rd_NO_LUKS
|
||||
disable crypto LUKS detection
|
||||
.TP
|
||||
.BR rd_LUKS_UUID= "<luks uuid>"
|
||||
only activate the LUKS partitions with the given UUID
|
||||
Any "luks-" of the LUKS UUID is removed before comparing to <luks uuid>.
|
||||
The comparisons also matches, if <luks uuid> is only the beginning of the
|
||||
LUKS UUID, so you don't have to specify the full UUID.
|
||||
This parameter can be specified multiple times.
|
||||
.TP
|
||||
.BR rd_NO_CRYPTTAB
|
||||
do not check, if LUKS partition is in /etc/crypttab
|
||||
|
||||
.SS MD
|
||||
.TP
|
||||
.BR rd_NO_MD
|
||||
disable MD RAID detection
|
||||
.TP
|
||||
.BR rd_NO_MDIMSM
|
||||
no MD RAID for imsm/isw raids, use dmraid instead
|
||||
.TP
|
||||
.BR rd_NO_MDADMCONF
|
||||
ignore mdadm.conf included in initramfs
|
||||
.TP
|
||||
.BR rd_MD_UUID= "<md uuid>"
|
||||
only activate the raid sets with the given UUID.
|
||||
This parameter can be specified multiple times.
|
||||
|
||||
.SS DMRAID
|
||||
.TP
|
||||
.BR rd_NO_DM
|
||||
disable DM RAID detection
|
||||
.TP
|
||||
.BR rd_DM_UUID= "<dmraid uuid>"
|
||||
only activate the raid sets with the given UUID.
|
||||
This parameter can be specified multiple times.
|
||||
|
||||
.SS MULTIPATH
|
||||
.TP
|
||||
.BR rd_NO_MULTIPATH
|
||||
disable multipath in the initramfs
|
||||
|
||||
.SS FIPS
|
||||
.TP
|
||||
.BR fips=1
|
||||
enable FIPS
|
||||
.TP
|
||||
.BR boot=<boot device>
|
||||
specify the device, where /boot is located
|
||||
e.g.
|
||||
boot=/dev/sda1
|
||||
boot=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1
|
||||
boot=UUID=<uuid>
|
||||
boot=LABEL=<label>
|
||||
|
||||
If the root device is encrypted, the /boot partition must reside on a seperate partition and has to be specified.
|
||||
|
||||
.SS Network
|
||||
.TP
|
||||
.BR ip= {dhcp|on|any|dhcp6|auto6|ibft}
|
||||
dhcp|on|any: get ip from dhcp server from all interfaces. If root=dhcp,
|
||||
loop sequentially through all interfaces (eth0, eth1, ...) and use the first
|
||||
with a valid DHCP root-path.
|
||||
.sp
|
||||
\fBauto6\fR: IPv6 autoconfiguration
|
||||
.sp
|
||||
\fBdhcp6\fR: IPv6 DHCP
|
||||
.sp
|
||||
\fBibft\fR: iBFT autoconfiguration
|
||||
|
||||
.TP
|
||||
.BR ip= <interface>:{dhcp|on|any|dhcp6|auto6}
|
||||
dhcp|on|any|dhcp6: get ip from dhcp server on a specific interface
|
||||
auto6: do IPv6 autoconfiguration
|
||||
This parameter can be specified multiple times.
|
||||
|
||||
.TP
|
||||
.ad l
|
||||
.BR ip= "\%<client-IP>\::[<server-id>]\::<gateway-IP>\::<netmask>\::<client\%hostname>\::<interface>\::{none|off}"
|
||||
.ad
|
||||
explicit network configuration. If you want do define a IPv6 address, put it in brackets (e.g. [2001:DB8::1]).
|
||||
This parameter can be specified multiple times.
|
||||
.TP
|
||||
.BR ifname= <interface>:<MAC>
|
||||
Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>.
|
||||
Note that if you use this option you \fBmust\fR specify an ifname= argument
|
||||
for all interfaces used in ip= or fcoe= arguments
|
||||
This parameter can be specified multiple times.
|
||||
.TP
|
||||
.BR bootdev= <interface>
|
||||
specify network interface to use routing and netroot information from.
|
||||
Required if multiple ip= lines are used.
|
||||
.TP
|
||||
.BR nameserver= "<IP> [nameserver=<IP> ...]"
|
||||
specify nameserver(s) to use
|
||||
.TP
|
||||
.BR vlan= "<vlanname>:<phydevice>"
|
||||
Setup vlan device named <vlanname> on <phydeivce>.
|
||||
We support the four styles of vlan names: VLAN_PLUS_VID (vlan0005), VLAN_PLUS_VID_NO_PAD (vlan5),
|
||||
DEV_PLUS_VID (eth0.0005), DEV_PLUS_VID_NO_PAD (eth0.5)
|
||||
This parameter can be specified multiple times.
|
||||
.TP
|
||||
.BR bridge= "<bridgename>:<ethnames>"
|
||||
Setup bridge <bridgename> with <ethnames>\&. <ethnames> is a comma\-separated list of physical (ethernet) interfaces\&. Bridge without parameters assumes bridge=br0:eth0
|
||||
.TP
|
||||
.BR bond= "<bondname>[:<bondslaves>:[:<options>]]"
|
||||
Setup bonding device <bondname> on top of <bondslaves>\&. <bondslaves> is a comma\-separated list of physical (ethernet) interfaces\&. <options> is a comma\-separated list on bonding options (modinfo bonding for details) in format compatible with initscripts\&. If <options> includes multi\-valued arp_ip_target option, then its values should be separated by semicolon\&. Bond without parameters assumes bond=bond0:eth0,eth1:mode=balance\-rr
|
||||
.TP
|
||||
.BR biosdevname={0|1]}
|
||||
turn off/on biosdevname network interface renaming
|
||||
.SS NFS
|
||||
.TP
|
||||
.BR root= "[<server-ip>:]<root-dir>[:<nfs-options>]"
|
||||
mount nfs share from <server-ip>:/<root-dir>, if no server-ip is given,
|
||||
use dhcp next_server. if server-ip is an IPv6 address it has to be put in brackets, e.g. [2001:DB8::1].
|
||||
NFS options can be appended with the prefix ":" or "," and are seperated by ",".
|
||||
.TP
|
||||
.BR root= "nfs:[<server-ip>:]<root-dir>[:<nfs-options>]"
|
||||
.TP
|
||||
.BR root= "nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]"
|
||||
.TP
|
||||
.BR root= dhcp|dhcp6
|
||||
root=dhcp alone directs initrd to look at the DHCP root-path where NFS
|
||||
options can be specified.
|
||||
root-path=<server-ip>:<root-dir>[,<nfs-options>]
|
||||
root-path=nfs:<server-ip>:<root-dir>[,<nfs-options>]
|
||||
root-path=nfs4:<server-ip>:<root-dir>[,<nfs-options>]
|
||||
.TP
|
||||
.BR root= /dev/nfs " nfsroot=" "[<server-ip>:]<root-dir>[,<nfs-options>]"
|
||||
\fBDeprecated!\fR kernel Documentation/filesystems/nfsroot.txt defines
|
||||
this method.
|
||||
This is supported by dracut but not recommended.
|
||||
.TP
|
||||
.BR rd_NFS_DOMAIN= "<NFSv4 domain name>"
|
||||
Set the NFSv4 domain name. Will overwrite the settings in /etc/idmap.conf.
|
||||
|
||||
.SS iSCSI
|
||||
.TP
|
||||
.ad l
|
||||
.BR root= "\%iscsi:[username:password\:[:reverse:password]@]\:[<servername>]\::[<protocol>]\::[<port>]\:[:[<iscsi_iface_name>]:[<netdev_name>]]\::[<LUN>]\::<targetname>"
|
||||
.ad
|
||||
protocol defaults to "6", LUN defaults to "0".
|
||||
|
||||
If the "servername" field is provided by BOOTP or DHCP, then that
|
||||
field is used in conjunction with other associated fields to contact
|
||||
the boot server in the Boot stage (Section 7). However, if the
|
||||
"servername" field is not provided, then the "targetname" field is
|
||||
then used in the Discovery Service stage in conjunction with other
|
||||
associated fields.
|
||||
|
||||
http://tools.ietf.org/html/rfc4173
|
||||
|
||||
.TP
|
||||
.ad l
|
||||
.BR root= "\%iscsi:[username:password\:[:reverse:password]@]\:[<servername>]\::[<protocol>]\::[<port>]\:[:[<iscsi_iface_name>]:[<netdev_name>]]\::[<LUN>]\::<targetname>"
|
||||
.ad
|
||||
e.g. root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
|
||||
|
||||
.ad l
|
||||
If servername is an IPv6 address, it has to be put in brackets.
|
||||
e.g.
|
||||
root=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0
|
||||
.TP
|
||||
.ad l
|
||||
.BR root= ??? " netroot=" "\%iscsi:[username:password[:reverse:password]@]\:[<servername>]\::[<protocol>]\::[<port>]\:[:[<iscsi_iface_name>]:[<netdev_name>]]\::[<LUN>]\::<targetname> ..."
|
||||
.ad
|
||||
multiple netroot options allow setting up multiple iscsi disks
|
||||
e.g.
|
||||
root=UUID=12424547
|
||||
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
|
||||
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1
|
||||
|
||||
.ad l
|
||||
If servername is an IPv6 address, it has to be put in brackets.
|
||||
e.g.
|
||||
netroot=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0
|
||||
.TP
|
||||
.ad l
|
||||
.BR \%root= \%??? " \%iscsi_initiator=" \%<initiator> " \%iscsi_target_name=" "<target name>" " \%iscsi_target_ip=" "<target ip>" " \%iscsi_target_port=" "<target port>" " \%iscsi_target_group=" "<target group>" " \%iscsi_username=" "<username>" " \%iscsi_password=" <password> " \%iscsi_in_username=" "<in username>" " \%iscsi_in_password=" "<in password>"
|
||||
.ad
|
||||
manually specify all iscsistart parameter (see \fIiscsistart\ --help\fR)
|
||||
|
||||
.TP
|
||||
.BR root= ??? " netroot=iscsi iscsi_firmware"
|
||||
will read the iscsi parameter from the BIOS firmware
|
||||
|
||||
.TP
|
||||
.BR iscsi_param= <param>
|
||||
<param> will be passed as "--param <param>" to iscsistart.
|
||||
This parameter can be specified multiple times.
|
||||
e.g.:
|
||||
"netroot=iscsi iscsi_firmware iscsi_param=node.session.timeo.replacement_timeout=30"
|
||||
will result in
|
||||
iscsistart -b --param node.session.timeo.replacement_timeout=30
|
||||
|
||||
.SS FCoE
|
||||
.TP
|
||||
.BR fcoe=<edd|interface|MAC>:<dcb|nodcb>
|
||||
Try to connect to a FCoE SAN through the NIC specified by <interface> or <MAC> or EDD settings.
|
||||
This parameter can be specified multiple times.
|
||||
|
||||
.SS NBD
|
||||
.TP
|
||||
.BR root= nbd:<server>:<port>[:<fstype>][:<mountopts>]
|
||||
mount nbd share from <server>
|
||||
.TP
|
||||
.BR root= dhcp
|
||||
with dhcp root-path=nbd:<server>:<port>[:<fstype>][:<mountopts>]
|
||||
root=dhcp alone directs initrd to look at the DHCP root-path where NBD
|
||||
options can be specified.
|
||||
This syntax is only usable in cases where you are directly mounting the volume
|
||||
as the rootfs.
|
||||
|
||||
|
||||
.SS DASD
|
||||
.TP
|
||||
.BR rd_DASD_MOD= ....
|
||||
same syntax as the kernel module parameter (s390 only)
|
||||
|
||||
.TP
|
||||
.ad l
|
||||
.BR rd_DASD= "\%<dasd adaptor device bus ID>\:[,readonly=X]\:[,use_diag=X]\:[,erplog=X]\:[,failfast=X]"
|
||||
.ad
|
||||
activate DASD device with the given adaptor device bus ID and setting the sysfs attributes
|
||||
to the specified values
|
||||
This parameter can be specified multiple times.
|
||||
|
||||
.SS ZFCP
|
||||
.TP
|
||||
.BR rd_ZFCP= "<zfcp adaptor device bus ID>,\:<WWPN>,\:<FCPLUN>"
|
||||
rd_ZFCP can be specified multiple times on the kernel command line.
|
||||
|
||||
example: rd_ZFCP=0.0.4000,0x5005076300C213e9,0x5022000000000000
|
||||
.TP
|
||||
.BR rd_NO_ZFCPCONF
|
||||
ignore zfcp.conf included in the initramfs
|
||||
|
||||
.SS ZNET
|
||||
.TP
|
||||
.BR rd_ZNET= "<nettype>,<subchannels>,<options>"
|
||||
rd_ZNET can be specified multiple times on the kernel command line. Examples:
|
||||
rd_ZNET=qeth,0.0.0600,0.0.0601,0.0.0602,layer2=1,portname=foo
|
||||
rd_ZNET=ctc,0.0.0600,0.0.0601,0.0.0602,protocol=bar
|
||||
|
||||
.SS "Plymouth Boot Splash"
|
||||
.TP
|
||||
.BR rd_NO_PLYMOUTH
|
||||
do not start plymouth. This will not work with encrypted partitions.
|
||||
|
||||
.SH FILES
|
||||
.TP
|
||||
.B /var/log/dracut.log
|
||||
.TP
|
||||
.B /tmp/dracut.log
|
||||
.TP
|
||||
.B /etc/dracut.conf
|
||||
see \fBdracut.conf\fR(5)
|
||||
.SS "Configuration in the Initramfs"
|
||||
.TP
|
||||
.B /etc/conf.d/
|
||||
Any files found in /etc/conf.d/ will be sourced in the initramfs to
|
||||
set initial values. Command line options will override these values
|
||||
set in the configuration files.
|
||||
.TP
|
||||
.B /etc/cmdline
|
||||
Can contain additional command line options.
|
||||
|
||||
.SH AUTHORS
|
||||
.nf
|
||||
|
11
dracut.conf
11
dracut.conf
@@ -1,16 +1,19 @@
|
||||
# Sample dracut config file
|
||||
|
||||
# Specific list of dracut modules to use
|
||||
#dracutmodules=""
|
||||
#dracutmodules+=""
|
||||
|
||||
# Dracut modules to omit
|
||||
#omit_dracutmodules=""
|
||||
#omit_dracutmodules+=""
|
||||
|
||||
# Dracut modules to add to the default
|
||||
#add_dracutmodules+=""
|
||||
|
||||
# additional kernel modules to the default
|
||||
#add_drivers=""
|
||||
#add_drivers+=""
|
||||
|
||||
# list of kernel filesystem modules to be included in the generic initramfs
|
||||
#filesystems=""
|
||||
#filesystems+=""
|
||||
|
||||
# build initrd only to boot current hardware
|
||||
#hostonly="yes"
|
||||
|
@@ -12,54 +12,66 @@ Command line parameter will overwrite any values set here.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.BR dracutmodules="[LIST]"
|
||||
.BR dracutmodules+= \%"\ [LIST]\ "
|
||||
Specify a space-separated list of dracut modules to
|
||||
call when building the initramfs. Modules are located
|
||||
in /usr/share/dracut/modules.d.
|
||||
.TP
|
||||
.BR omit_dracutmodules="[LIST]"
|
||||
.BR omit_dracutmodules+= \%"\ [LIST]\ "
|
||||
Omit a space-separated list of dracut modules.
|
||||
.TP
|
||||
.BR add_dracutmodules="[LIST]"
|
||||
.BR add_dracutmodules+= \%"\ [LIST]\ "
|
||||
Add a space-separated list of dracut modules.
|
||||
.TP
|
||||
.BR drivers="[LIST]"
|
||||
.BR drivers+= \%"\ [LIST]\ "
|
||||
Specify a space-separated list of kernel modules to
|
||||
exclusively include in the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix.
|
||||
.TP
|
||||
.BR add_drivers="[LIST]"
|
||||
.BR add_drivers+= \%"\ [LIST]\ "
|
||||
Specify a space-separated list of kernel
|
||||
modules to add to the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix.
|
||||
.TP
|
||||
.BR filesystems="[LIST]"
|
||||
.BR omit_drivers+= \%"\ [LIST]\ "
|
||||
Specify a space-separated list of kernel
|
||||
modules to omit from the initramfs.
|
||||
The kernel modules have to be specified without the ".ko" suffix.
|
||||
Regular expressions are also allowed like ".*/fs/foo/.* .*/fs/bar/.*".
|
||||
.TP
|
||||
.BR filesystems+= \%"\ [LIST]\ "
|
||||
Specify a space-separated list of kernel filesystem
|
||||
modules to exclusively include in the generic
|
||||
initramfs.
|
||||
.TP
|
||||
.BR drivers_dir="<dir>"
|
||||
.BR drivers_dir= \%"<dir>"
|
||||
Specify the directory, where to look for kernel modules
|
||||
.TP
|
||||
.BR fw_dir="<dir>[:<dir> ...]"
|
||||
.BR fw_dir+= \%":<dir>[:<dir>\ ...]"
|
||||
Specify additional directories, where to look for firmwares, separated by :
|
||||
.TP
|
||||
.BR do_strip="yes|no"
|
||||
.BR do_strip= \%"yes|no"
|
||||
Strip binaries in the initramfs (default=yes)
|
||||
.TP
|
||||
.BR hostonly="yes|no"
|
||||
.BR hostonly= \%"yes|no"
|
||||
Host-Only mode: Install only what is needed for booting
|
||||
the local host instead of a generic host.
|
||||
.TP
|
||||
.BR mdadmconf="yes|no"
|
||||
.BR mdadmconf= \%"yes|no"
|
||||
Include local /etc/mdadm.conf (default=yes)
|
||||
.TP
|
||||
.BR lvmconf="yes|no"
|
||||
.BR lvmconf= \%"yes|no"
|
||||
Include local /etc/lvm/lvm.conf (default=yes)
|
||||
.TP
|
||||
.BR kernel_only="yes|no"
|
||||
.BR kernel_only= \%"yes|no"
|
||||
Only install kernel drivers and firmware files. (default=no)
|
||||
.TP
|
||||
.BR no_kernel="yes|no"
|
||||
.BR no_kernel= \%"yes|no"
|
||||
Do not install kernel drivers and firmware files (default=no)
|
||||
.TP
|
||||
\fBinstall_items+=\fR"\ \&\fI<file>\fR[ \fI<file>\fR\ \&\&...]\ \&"
|
||||
|
||||
Specify additional files to include in the initramfs, separated by spaces.
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR dracut (8)
|
||||
|
9
dracut.logrotate
Normal file
9
dracut.logrotate
Normal file
@@ -0,0 +1,9 @@
|
||||
/var/log/dracut.log {
|
||||
missingok
|
||||
notifempty
|
||||
compress
|
||||
delaycompress
|
||||
copytruncate
|
||||
size 1M
|
||||
create 0600 root root
|
||||
}
|
BIN
dracut.png
Normal file
BIN
dracut.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.2 KiB |
368
dracut.spec
368
dracut.spec
@@ -11,23 +11,16 @@
|
||||
%define with_nbd 0
|
||||
%endif
|
||||
|
||||
%if %{defined gittag}
|
||||
%define rdist .git%{gittag}%{?dist}
|
||||
%define dashgittag -%{gittag}
|
||||
%else
|
||||
%define rdist %{?dist}
|
||||
%endif
|
||||
|
||||
Name: dracut
|
||||
Version: 004
|
||||
Release: 1%{?rdist}
|
||||
Release: 1%{?dist}
|
||||
Summary: Initramfs generator using udev
|
||||
Group: System Environment/Base
|
||||
License: GPLv2+
|
||||
Group: System Environment/Base
|
||||
License: GPLv2+
|
||||
URL: http://apps.sourceforge.net/trac/dracut/wiki
|
||||
# Source can be generated by
|
||||
# http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=snapshot;h=%{?dashgittag};sf=tgz
|
||||
Source0: dracut-%{version}%{?dashgittag}.tar.bz2
|
||||
|
||||
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.bz2
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6
|
||||
@@ -39,46 +32,44 @@ Obsoletes: nash <= 6.0.93
|
||||
Obsoletes: libbdevid-python <= 6.0.93
|
||||
%endif
|
||||
|
||||
Requires: udev
|
||||
Requires: util-linux-ng
|
||||
Requires: module-init-tools >= 3.7-9
|
||||
Requires: cpio
|
||||
Requires: coreutils
|
||||
Requires: findutils
|
||||
Requires: binutils
|
||||
Requires: grep
|
||||
Requires: which
|
||||
Requires: mktemp >= 1.5-5
|
||||
Requires: mount
|
||||
Requires: bash
|
||||
Requires: dash
|
||||
Requires: /bin/sh
|
||||
Requires: fileutils, gzip, tar
|
||||
Requires: lvm2 >= 2.02.33-9, dhclient
|
||||
Requires: filesystem >= 2.1.0, cpio, device-mapper, initscripts >= 8.63-1
|
||||
Requires: e2fsprogs >= 1.38-12, libselinux, libsepol, coreutils
|
||||
Requires: mdadm, elfutils-libelf
|
||||
Requires(pre): plymouth >= 0.8.0-0.2009.29.09.19.1
|
||||
Requires: plymouth >= 0.8.0-0.2009.29.09.19.1
|
||||
Requires: cryptsetup-luks
|
||||
Requires: file
|
||||
Requires: bzip2
|
||||
Requires: dmraid
|
||||
Requires: coreutils
|
||||
Requires: cpio
|
||||
Requires: dash
|
||||
Requires: filesystem >= 2.1.0
|
||||
Requires: findutils
|
||||
Requires: grep
|
||||
Requires: gzip
|
||||
Requires: initscripts >= 8.63-1
|
||||
Requires: kbd
|
||||
Requires: mktemp >= 1.5-5
|
||||
Requires: module-init-tools >= 3.7-9
|
||||
Requires: mount
|
||||
Requires: plymouth >= 0.8.0-0.2009.29.09.19.1
|
||||
Requires: plymouth-scripts
|
||||
Requires: sed
|
||||
Requires: tar
|
||||
Requires: udev
|
||||
Requires: util-linux-ng >= 2.16
|
||||
Requires: which
|
||||
Requires: file
|
||||
|
||||
%if ! 0%{?with_switch_root}
|
||||
Requires: util-linux-ng >= 2.16
|
||||
BuildArch: noarch
|
||||
%endif
|
||||
|
||||
BuildRequires: docbook-style-xsl docbook-dtds libxslt
|
||||
BuildRequires: dash bash git
|
||||
|
||||
%description
|
||||
dracut is a new, event-driven initramfs infrastructure based around udev.
|
||||
|
||||
%package network
|
||||
Summary: Dracut modules to build a dracut initramfs with network support
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: rpcbind nfs-utils
|
||||
Requires: dhclient rpcbind nfs-utils
|
||||
Requires: iscsi-initiator-utils
|
||||
%if %{with_nbd}
|
||||
Requires: nbd
|
||||
@@ -91,21 +82,39 @@ This package requires everything which is needed to build a generic
|
||||
all purpose initramfs with network support with dracut.
|
||||
|
||||
%package fips
|
||||
Summary: dracut modules to build a dracut initramfs with an integrity check.
|
||||
Summary: Dracut modules to build a dracut initramfs with an integrity check
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: hmaccalc
|
||||
Requires: hmaccalc fipscheck
|
||||
%if 0%{?rhel} > 5
|
||||
# For Alpha 3, we want nss instead of nss-softokn
|
||||
Requires: nss
|
||||
%else
|
||||
Requires: nss-softokn
|
||||
%endif
|
||||
Requires: nss-softokn-freebl
|
||||
Requires: nss-softokn-freebl >= 3.14.3-22.el6_6
|
||||
|
||||
%description fips
|
||||
This package requires everything which is needed to build an
|
||||
all purpose initramfs with dracut, which does an integrity check.
|
||||
|
||||
%package fips-aesni
|
||||
Summary: Dracut modules to build a dracut initramfs with an integrity check with aesni-intel
|
||||
Requires: %{name}-fips = %{version}-%{release}
|
||||
|
||||
%description fips-aesni
|
||||
This package requires everything which is needed to build an
|
||||
all purpose initramfs with dracut, which does an integrity check
|
||||
and adds the aesni-intel kernel module.
|
||||
|
||||
%package caps
|
||||
Summary: Dracut modules to build a dracut initramfs which drops capabilities
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: libcap
|
||||
|
||||
%description caps
|
||||
This package requires everything which is needed to build an
|
||||
all purpose initramfs with dracut, which drops capabilities.
|
||||
|
||||
%package generic
|
||||
Summary: Metapackage to build a generic initramfs with dracut
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
@@ -119,11 +128,6 @@ all purpose initramfs with dracut.
|
||||
%package kernel
|
||||
Summary: Metapackage to build generic initramfs with dracut with only kernel modules
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: ql2100-firmware
|
||||
Requires: ql2200-firmware
|
||||
Requires: ql23xx-firmware
|
||||
Requires: ql2400-firmware
|
||||
Requires: ql2500-firmware
|
||||
|
||||
%description kernel
|
||||
This package requires everything which is needed to build a initramfs with all
|
||||
@@ -131,6 +135,7 @@ kernel modules and firmware files needed by dracut modules.
|
||||
|
||||
%package tools
|
||||
Summary: Dracut tools to build the local initramfs
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: coreutils cryptsetup-luks device-mapper
|
||||
Requires: diffutils dmraid findutils gawk grep lvm2
|
||||
Requires: module-init-tools sed
|
||||
@@ -140,7 +145,24 @@ Requires: cpio gzip
|
||||
This package contains tools to assemble the local initrd and host configuration.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}%{?dashgittag}
|
||||
%setup -q -n %{name}-%{version}
|
||||
|
||||
%if %{defined PATCH1}
|
||||
git init
|
||||
git config user.email "dracut-maint@redhat.com"
|
||||
git config user.name "Fedora dracut team"
|
||||
git add .
|
||||
git commit -a -q -m "%{version} baseline."
|
||||
|
||||
# Apply all the patches.
|
||||
git am -p1 %{patches}
|
||||
%endif
|
||||
|
||||
chmod 0755 modules.d/*/check
|
||||
# make rpmlint happy
|
||||
chmod 0755 modules.d/*/install
|
||||
chmod 0755 modules.d/*/installkernel
|
||||
chmod 0755 modules.d/*/*.sh
|
||||
|
||||
%build
|
||||
make WITH_SWITCH_ROOT=0%{?with_switch_root}
|
||||
@@ -152,6 +174,7 @@ make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin \
|
||||
|
||||
echo %{name}-%{version}-%{release} > $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/10rpmversion/dracut-version
|
||||
rm $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/01fips/check
|
||||
rm $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/02fips-aesni/check
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/boot/dracut
|
||||
mkdir -p $RPM_BUILD_ROOT/var/lib/dracut/overlay
|
||||
@@ -163,12 +186,18 @@ rm $RPM_BUILD_ROOT/sbin/mkinitrd
|
||||
rm $RPM_BUILD_ROOT/sbin/lsinitrd
|
||||
%endif
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
|
||||
install -m 0644 dracut.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/dracut
|
||||
|
||||
echo 'do_strip=no' > $RPM_BUILD_ROOT/etc/dracut.conf.d/02-fips.conf
|
||||
> $RPM_BUILD_ROOT/etc/system-fips
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,0755)
|
||||
%doc README HACKING TODO COPYING AUTHORS NEWS
|
||||
%doc README HACKING TODO COPYING AUTHORS NEWS dracut-rhel6.html
|
||||
/sbin/dracut
|
||||
%if 0%{?with_switch_root}
|
||||
/sbin/switch_root
|
||||
@@ -180,6 +209,10 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%dir %{_datadir}/dracut
|
||||
%{_datadir}/dracut/dracut-functions
|
||||
%config(noreplace) /etc/dracut.conf
|
||||
%dir /etc/dracut.conf.d
|
||||
%config(noreplace) /etc/logrotate.d/dracut
|
||||
%{_mandir}/man1/lsinitrd.1*
|
||||
%{_mandir}/man8/mkinitrd.8*
|
||||
%{_mandir}/man8/dracut.8*
|
||||
%{_mandir}/man5/dracut.conf.5*
|
||||
%{_datadir}/dracut/modules.d/00dash
|
||||
@@ -187,6 +220,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_datadir}/dracut/modules.d/10rpmversion
|
||||
%{_datadir}/dracut/modules.d/50plymouth
|
||||
%{_datadir}/dracut/modules.d/60xen
|
||||
%{_datadir}/dracut/modules.d/90btrfs
|
||||
%{_datadir}/dracut/modules.d/90crypt
|
||||
%{_datadir}/dracut/modules.d/90dm
|
||||
%{_datadir}/dracut/modules.d/90dmraid
|
||||
@@ -196,6 +230,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_datadir}/dracut/modules.d/90mdraid
|
||||
%{_datadir}/dracut/modules.d/90multipath
|
||||
%{_datadir}/dracut/modules.d/95debug
|
||||
%{_datadir}/dracut/modules.d/95fstab-sys
|
||||
%{_datadir}/dracut/modules.d/95resume
|
||||
%{_datadir}/dracut/modules.d/95rootfs-block
|
||||
%{_datadir}/dracut/modules.d/95dasd
|
||||
@@ -205,13 +240,15 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_datadir}/dracut/modules.d/95terminfo
|
||||
%{_datadir}/dracut/modules.d/95udev-rules
|
||||
%{_datadir}/dracut/modules.d/95uswsusp
|
||||
%{_datadir}/dracut/modules.d/96insmodpost
|
||||
%{_datadir}/dracut/modules.d/97biosdevname
|
||||
%{_datadir}/dracut/modules.d/98syslog
|
||||
%{_datadir}/dracut/modules.d/99base
|
||||
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
|
||||
|
||||
%files network
|
||||
%doc README HACKING TODO COPYING AUTHORS NEWS
|
||||
%defattr(-,root,root,0755)
|
||||
%doc README HACKING TODO COPYING AUTHORS NEWS
|
||||
%{_datadir}/dracut/modules.d/40network
|
||||
%{_datadir}/dracut/modules.d/95fcoe
|
||||
%{_datadir}/dracut/modules.d/95iscsi
|
||||
@@ -223,8 +260,20 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%defattr(-,root,root,0755)
|
||||
%doc COPYING
|
||||
%{_datadir}/dracut/modules.d/01fips
|
||||
%config(noreplace) /etc/dracut.conf.d/02-fips.conf
|
||||
%config(missingok) /etc/system-fips
|
||||
|
||||
%files kernel
|
||||
%files fips-aesni
|
||||
%defattr(-,root,root,0755)
|
||||
%doc COPYING
|
||||
%{_datadir}/dracut/modules.d/02fips-aesni
|
||||
|
||||
%files caps
|
||||
%defattr(-,root,root,0755)
|
||||
%doc COPYING
|
||||
%{_datadir}/dracut/modules.d/02caps
|
||||
|
||||
%files kernel
|
||||
%defattr(-,root,root,0755)
|
||||
%doc README.kernel
|
||||
|
||||
@@ -232,7 +281,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%defattr(-,root,root,0755)
|
||||
%doc README.generic
|
||||
|
||||
%files tools
|
||||
%files tools
|
||||
%defattr(-,root,root,0755)
|
||||
%doc COPYING NEWS
|
||||
%{_mandir}/man8/dracut-gencmdline.8*
|
||||
@@ -244,222 +293,3 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%dir /var/lib/dracut/overlay
|
||||
|
||||
%changelog
|
||||
* Fri Jan 15 2010 Harald Hoyer <harald@redhat.com> 004-1
|
||||
- version 004
|
||||
- Resolves: rhbz#529339 rhbz#533494 rhbz#548550
|
||||
- Resolves: rhbz#548555 rhbz#553195
|
||||
|
||||
* Wed Jan 13 2010 Harald Hoyer <harald@redhat.com> 003-3
|
||||
- add Obsoletes of mkinitrd/nash/libbdevid-python
|
||||
- Related: rhbz#543948
|
||||
|
||||
* Wed Jan 13 2010 Warren Togami <wtogami@redhat.com> 003-2
|
||||
- nbd is Fedora only
|
||||
|
||||
* Fri Nov 27 2009 Harald Hoyer <harald@redhat.com> 003-1
|
||||
- version 003
|
||||
|
||||
* Mon Nov 23 2009 Harald Hoyer <harald@redhat.com> 002-26
|
||||
- add WITH_SWITCH_ROOT make flag
|
||||
- add fips requirement conditional
|
||||
- add more device mapper modules (bug #539656)
|
||||
|
||||
* Fri Nov 20 2009 Dennis Gregorovic <dgregor@redhat.com> - 002-25.1
|
||||
- nss changes for Alpha 3
|
||||
|
||||
* Thu Nov 19 2009 Harald Hoyer <harald@redhat.com> 002-25
|
||||
- add more requirements for dracut-fips (bug #539257)
|
||||
|
||||
* Tue Nov 17 2009 Harald Hoyer <harald@redhat.com> 002-24
|
||||
- put fips module in a subpackage (bug #537619)
|
||||
|
||||
* Tue Nov 17 2009 Harald Hoyer <harald@redhat.com> 002-23
|
||||
- install xdr utils for multipath (bug #463458)
|
||||
|
||||
* Thu Nov 12 2009 Harald Hoyer <harald@redhat.com> 002-22
|
||||
- add module 90multipath
|
||||
- add module 01fips
|
||||
- renamed module 95ccw to 95znet (bug #533833)
|
||||
- crypt: ignore devices in /etc/crypttab (root is not in there)
|
||||
- dasd: only install /etc/dasd.conf in hostonly mode (bug #533833)
|
||||
- zfcp: only install /etc/zfcp.conf in hostonly mode (bug #533833)
|
||||
- kernel-modules: add scsi_dh scsi_dh_rdac scsi_dh_emc (bug #527750)
|
||||
- dasd: use dasdconf.sh from s390utils (bug #533833)
|
||||
|
||||
* Fri Nov 06 2009 Harald Hoyer <harald@redhat.com> 002-21
|
||||
- fix rd_DASD argument handling (bug #531720)
|
||||
- Resolves: rhbz#531720
|
||||
|
||||
* Wed Nov 04 2009 Harald Hoyer <harald@redhat.com> 002-20
|
||||
- fix rd_DASD argument handling (bug #531720)
|
||||
- Resolves: rhbz#531720
|
||||
|
||||
* Tue Nov 03 2009 Harald Hoyer <harald@redhat.com> 002-19
|
||||
- changed rd_DASD to rd_DASD_MOD (bug #531720)
|
||||
- Resolves: rhbz#531720
|
||||
|
||||
* Tue Oct 27 2009 Harald Hoyer <harald@redhat.com> 002-18
|
||||
- renamed lvm/device-mapper udev rules according to upstream changes
|
||||
- fixed dracut search path issue
|
||||
|
||||
* Mon Oct 26 2009 Harald Hoyer <harald@redhat.com> 002-17
|
||||
- load dm_mod module (bug #530540)
|
||||
|
||||
* Fri Oct 09 2009 Jesse Keating <jkeating@redhat.com> - 002-16
|
||||
- Upgrade plymouth to Requires(pre) to make it show up before kernel
|
||||
|
||||
* Thu Oct 08 2009 Harald Hoyer <harald@redhat.com> 002-15
|
||||
- s390 ccw: s/layer1/layer2/g
|
||||
|
||||
* Thu Oct 08 2009 Harald Hoyer <harald@redhat.com> 002-14
|
||||
- add multinic support
|
||||
- add s390 zfcp support
|
||||
- add s390 network support
|
||||
|
||||
* Wed Oct 07 2009 Harald Hoyer <harald@redhat.com> 002-13
|
||||
- fixed init=<command> handling
|
||||
- kill loginit if "rdinitdebug" specified
|
||||
- run dmsquash-live-root after udev has settled (bug #527514)
|
||||
|
||||
* Tue Oct 06 2009 Harald Hoyer <harald@redhat.com> 002-12
|
||||
- add missing loginit helper
|
||||
- corrected dracut manpage
|
||||
|
||||
* Thu Oct 01 2009 Harald Hoyer <harald@redhat.com> 002-11
|
||||
- fixed dracut-gencmdline for root=UUID or LABEL
|
||||
|
||||
* Thu Oct 01 2009 Harald Hoyer <harald@redhat.com> 002-10
|
||||
- do not destroy assembled raid arrays if mdadm.conf present
|
||||
- mount /dev/shm
|
||||
- let udevd not resolve group and user names
|
||||
- preserve timestamps of tools on initramfs generation
|
||||
- generate symlinks for binaries correctly
|
||||
- moved network from udev to initqueue
|
||||
- mount nfs3 with nfsvers=3 option and retry with nfsvers=2
|
||||
- fixed nbd initqueue-finished
|
||||
- improved debug output: specifying "rdinitdebug" now logs
|
||||
to dmesg, console and /init.log
|
||||
- stop udev before killing it
|
||||
- add ghost /var/log/dracut.log
|
||||
- dmsquash: use info() and die() rather than echo
|
||||
- strip kernel modules which have no x bit set
|
||||
- redirect stdin, stdout, stderr all RW to /dev/console
|
||||
so the user can use "less" to view /init.log and dmesg
|
||||
|
||||
* Tue Sep 29 2009 Harald Hoyer <harald@redhat.com> 002-9
|
||||
- make install of new dm/lvm udev rules optionally
|
||||
- correct dasd module typo
|
||||
|
||||
* Fri Sep 25 2009 Warren Togami <wtogami@redhat.com> 002-8
|
||||
- revert back to dracut-002-5 tarball 845dd502
|
||||
lvm2 was reverted to pre-udev
|
||||
|
||||
* Wed Sep 23 2009 Harald Hoyer <harald@redhat.com> 002-7
|
||||
- build with the correct tarball
|
||||
|
||||
* Wed Sep 23 2009 Harald Hoyer <harald@redhat.com> 002-6
|
||||
- add new device mapper udev rules and dmeventd
|
||||
bug 525319, 525015
|
||||
|
||||
* Wed Sep 23 2009 Warren Togami <wtogami@redaht.com> 002-5
|
||||
- Revert back to -3, Add umount back to initrd
|
||||
This makes no functional difference to LiveCD. See Bug #525319
|
||||
|
||||
* Mon Sep 21 2009 Warren Togami <wtogami@redhat.com> 002-4
|
||||
- Fix LiveCD boot regression
|
||||
|
||||
* Mon Sep 21 2009 Harald Hoyer <harald@redhat.com> 002-3
|
||||
- bail out if selinux policy could not be loaded and
|
||||
selinux=0 not specified on kernel command line
|
||||
(bug #524113)
|
||||
- set finished criteria for dmsquash live images
|
||||
|
||||
* Fri Sep 18 2009 Harald Hoyer <harald@redhat.com> 002-2
|
||||
- do not cleanup dmraids
|
||||
- copy over lvm.conf
|
||||
|
||||
* Thu Sep 17 2009 Harald Hoyer <harald@redhat.com> 002-1
|
||||
- version 002
|
||||
- set correct PATH
|
||||
- workaround for broken mdmon implementation
|
||||
|
||||
* Wed Sep 16 2009 Harald Hoyer <harald@redhat.com> 001-12
|
||||
- removed lvm/mdraid/dmraid lock files
|
||||
- add missing ifname= files
|
||||
|
||||
* Wed Sep 16 2009 Harald Hoyer <harald@redhat.com> 001-11
|
||||
- generate dracut-version during rpm build time
|
||||
|
||||
* Tue Sep 15 2009 Harald Hoyer <harald@redhat.com> 001-10
|
||||
- add ifname= argument for persistent netdev names
|
||||
- new /initqueue-finished to check if the main loop can be left
|
||||
- copy mdadm.conf if --mdadmconf set or mdadmconf in dracut.conf
|
||||
|
||||
* Wed Sep 09 2009 Harald Hoyer <harald@redhat.com> 001-9
|
||||
- added Requires: plymouth-scripts
|
||||
|
||||
* Wed Sep 09 2009 Harald Hoyer <harald@redhat.com> 001-8
|
||||
- plymouth: use plymouth-populate-initrd
|
||||
- add add_drivers for dracut and dracut.conf
|
||||
- do not mount /proc and /selinux manually in selinux-load-policy
|
||||
|
||||
* Wed Sep 09 2009 Harald Hoyer <harald@redhat.com> 001-7
|
||||
- add scsi_wait_scan to be sure everything was scanned
|
||||
|
||||
* Tue Sep 08 2009 Harald Hoyer <harald@redhat.com> 001-6
|
||||
- fixed several problems with md raid containers
|
||||
- fixed selinux policy loading
|
||||
|
||||
* Tue Sep 08 2009 Harald Hoyer <harald@redhat.com> 001-5
|
||||
- patch does not honor file modes, fixed them manually
|
||||
|
||||
* Mon Sep 07 2009 Harald Hoyer <harald@redhat.com> 001-4
|
||||
- fixed mdraid for IMSM
|
||||
|
||||
* Mon Sep 07 2009 Harald Hoyer <harald@redhat.com> 001-3
|
||||
- fixed bug, which prevents installing 61-persistent-storage.rules (bug #520109)
|
||||
|
||||
* Thu Sep 03 2009 Harald Hoyer <harald@redhat.com> 001-2
|
||||
- fixed missing grep for md
|
||||
- reorder cleanup
|
||||
|
||||
* Wed Sep 02 2009 Harald Hoyer <harald@redhat.com> 001-1
|
||||
- version 001
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Fri Aug 14 2009 Harald Hoyer <harald@redhat.com> 0.9-1
|
||||
- version 0.9
|
||||
|
||||
* Thu Aug 06 2009 Harald Hoyer <harald@redhat.com> 0.8-1
|
||||
- version 0.8
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Fri Jul 24 2009 Harald Hoyer <harald@redhat.com> 0.7-1
|
||||
- version 0.7
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Wed Jul 22 2009 Harald Hoyer <harald@redhat.com> 0.6-1
|
||||
- version 0.6
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Fri Jul 17 2009 Harald Hoyer <harald@redhat.com> 0.5-1
|
||||
- version 0.5
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Sat Jul 04 2009 Harald Hoyer <harald@redhat.com> 0.4-1
|
||||
- version 0.4
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Thu Jul 02 2009 Harald Hoyer <harald@redhat.com> 0.3-1
|
||||
- version 0.3
|
||||
- see http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut;a=blob_plain;f=NEWS
|
||||
|
||||
* Wed Jul 01 2009 Harald Hoyer <harald@redhat.com> 0.2-1
|
||||
- version 0.2
|
||||
|
||||
* Fri Jun 19 2009 Harald Hoyer <harald@redhat.com> 0.1-1
|
||||
- first release
|
||||
|
||||
* Thu Dec 18 2008 Jeremy Katz <katzj@redhat.com> - 0.0-1
|
||||
- Initial build
|
||||
|
||||
|
1701
dracut.svg
Normal file
1701
dracut.svg
Normal file
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 68 KiB |
61
git2spec.pl
Executable file
61
git2spec.pl
Executable file
@@ -0,0 +1,61 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
sub last_tag {
|
||||
open( GIT, 'git log --pretty=format:%H |');
|
||||
LINE: while( <GIT> ) {
|
||||
open( GIT2, "git tag --contains $_ |");
|
||||
while( <GIT2> ) {
|
||||
chomp;
|
||||
last LINE if /..*/;
|
||||
}
|
||||
close GIT2;
|
||||
}
|
||||
$tag=$_;
|
||||
close GIT2;
|
||||
close GIT; # be done
|
||||
return $tag;
|
||||
};
|
||||
|
||||
sub create_patches {
|
||||
my $tag=shift;
|
||||
my $pdir=shift;
|
||||
my $num=0;
|
||||
open( GIT, 'git format-patch -M -N --no-signature -o "'.$pdir.'" '.$tag.' |');
|
||||
@lines=<GIT>;
|
||||
close GIT; # be done
|
||||
return @lines;
|
||||
};
|
||||
|
||||
use POSIX qw(strftime);
|
||||
my $datestr = strftime "%Y%m%d", gmtime;
|
||||
|
||||
my $tag=shift;
|
||||
my $pdir=shift;
|
||||
$tag=&last_tag if not defined $tag;
|
||||
my @patches=&create_patches($tag, $pdir);
|
||||
my $num=$#patches + 2;
|
||||
$tag=~s/[^0-9]+?([0-9]+)/$1/;
|
||||
my $release="$num.git$datestr";
|
||||
$release="1" if $num == 1;
|
||||
|
||||
while(<>) {
|
||||
if (/^Version:/) {
|
||||
print "Version: $tag\n";
|
||||
}
|
||||
elsif (/^Release:/) {
|
||||
print "Release: $release%{?dist}\n";
|
||||
}
|
||||
elsif ((/^Source0:/) || (/^Source:/)) {
|
||||
print $_;
|
||||
$num=1;
|
||||
for(@patches) {
|
||||
s/.*\///g;
|
||||
print "Patch$num: $_";
|
||||
$num++;
|
||||
}
|
||||
print "\n";
|
||||
}
|
||||
else {
|
||||
print $_;
|
||||
}
|
||||
}
|
1
install/.kateconfig
Normal file
1
install/.kateconfig
Normal file
@@ -0,0 +1 @@
|
||||
kate: space-indent on; tab-width 8; indent-width 8; replace-tabs on; eol unix;
|
148
lsinitrd
148
lsinitrd
@@ -1,11 +1,141 @@
|
||||
#!/bin/bash
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Copyright 2005-2010 Harald Hoyer <harald@redhat.com>
|
||||
# Copyright 2005-2010 Red Hat, Inc. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
[[ $# -eq 1 ]] || { echo "Usage: $(basename $0) <initramfs file>" ; exit 1 ; }
|
||||
[[ -f $1 ]] || { echo "$1 does not exist" ; exit 1 ; }
|
||||
usage()
|
||||
{
|
||||
{
|
||||
echo "Usage: ${0##*/} [options] [<initramfs file> [<filename> [<filename> [...] ]]]"
|
||||
echo "Usage: ${0##*/} [options] -k <kernel version>"
|
||||
echo
|
||||
echo "-h, --help print a help message and exit."
|
||||
echo "-s, --size sort the contents of the initramfs by size."
|
||||
echo "-f, --file <filename> print the contents of <filename>."
|
||||
echo "-k, --kver <kernel version> inspect the initramfs of <kernel version>."
|
||||
echo
|
||||
} >&2
|
||||
}
|
||||
|
||||
echo "$1:"
|
||||
echo "========================================================================"
|
||||
zcat $1 | cpio --extract --verbose --quiet --to-stdout 'dracut-*' 2>/dev/null
|
||||
echo "========================================================================"
|
||||
zcat $1 | cpio --extract --verbose --quiet --list
|
||||
echo "========================================================================"
|
||||
sorted=0
|
||||
declare -A filenames
|
||||
|
||||
unset POSIXLY_CORRECT
|
||||
TEMP=$(getopt \
|
||||
-o "shf:k:" \
|
||||
--long kver: \
|
||||
--long file: \
|
||||
--long help \
|
||||
--long size \
|
||||
-- "$@")
|
||||
|
||||
if (( $? != 0 )); then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
eval set -- "$TEMP"
|
||||
|
||||
while (($# > 0)); do
|
||||
case $1 in
|
||||
-k|--kver) KERNEL_VERSION="$2"; shift;;
|
||||
-f|--file) filenames[${2#/}]=1; shift;;
|
||||
-s|--size) sorted=1;;
|
||||
-h|--help) usage; exit 0;;
|
||||
--) shift;break;;
|
||||
*) usage; exit 1;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
[[ $KERNEL_VERSION ]] || KERNEL_VERSION="$(uname -r)"
|
||||
|
||||
if [[ $1 ]]; then
|
||||
image="$1"
|
||||
if ! [[ -f "$image" ]]; then
|
||||
{
|
||||
echo "$image does not exist"
|
||||
echo
|
||||
} >&2
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
image="/boot/initramfs-${KERNEL_VERSION}.img"
|
||||
fi
|
||||
|
||||
shift
|
||||
while (($# > 0)); do
|
||||
filenames[${1#/}]=1;
|
||||
shift
|
||||
done
|
||||
|
||||
if ! [[ -f "$image" ]]; then
|
||||
{
|
||||
echo "No <initramfs file> specified and the default image '$image' cannot be accessed!"
|
||||
echo
|
||||
} >&2
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
read -N 6 bin < "$image"
|
||||
case $bin in
|
||||
$'\x1f\x8b'*)
|
||||
CAT="zcat";;
|
||||
BZh*)
|
||||
CAT="bzcat";;
|
||||
070701)
|
||||
CAT="cat";;
|
||||
*)
|
||||
CAT="xzcat";
|
||||
if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
|
||||
CAT="xzcat --single-stream"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
ret=0
|
||||
|
||||
if (( ${#filenames[@]} > 0 )); then
|
||||
(( ${#filenames[@]} == 1 )) && nofileinfo=1
|
||||
for f in ${!filenames[@]}; do
|
||||
[[ $nofileinfo ]] || echo "initramfs:/$f"
|
||||
[[ $nofileinfo ]] || echo "========================================================================"
|
||||
$CAT -- $image | cpio --extract --verbose --quiet --to-stdout $f 2>/dev/null
|
||||
((ret+=$?))
|
||||
[[ $nofileinfo ]] || echo "========================================================================"
|
||||
[[ $nofileinfo ]] || echo
|
||||
done
|
||||
else
|
||||
echo "Image: $image: $(du -h $image | while read a b; do echo $a;done)"
|
||||
echo "========================================================================"
|
||||
$CAT -- "$image" | cpio --extract --verbose --quiet --to-stdout -- 'dracut-*' 2>/dev/null
|
||||
((ret+=$?))
|
||||
echo "========================================================================"
|
||||
if [ "$sorted" -eq 1 ]; then
|
||||
$CAT -- "$image" | cpio --extract --verbose --quiet --list | sort -n -k5
|
||||
else
|
||||
$CAT -- "$image" | cpio --extract --verbose --quiet --list | sort -k9
|
||||
fi
|
||||
((ret+=$?))
|
||||
echo "========================================================================"
|
||||
fi
|
||||
|
||||
exit $ret
|
||||
|
73
lsinitrd.1
Normal file
73
lsinitrd.1
Normal file
@@ -0,0 +1,73 @@
|
||||
'\" t
|
||||
.\" Title: lsinitrd
|
||||
.\" Author: [see the "AUTHORS" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
|
||||
.\" Date: 07/17/2013
|
||||
.\" Manual: dracut
|
||||
.\" Source: dracut
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "LSINITRD" "1" "07/17/2013" "dracut" "dracut"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
.SH "NAME"
|
||||
lsinitrd \- tool to show the contents of an initramfs image
|
||||
.SH "SYNOPSIS"
|
||||
.sp
|
||||
\fBlsinitrd\fR [\fIOPTION\&...\fR] [<image> [<filename> [<filename> [\&...] ]]]
|
||||
.sp
|
||||
\fBlsinitrd\fR [\fIOPTION\&...\fR] \-k <kernel\-version>
|
||||
.SH "DESCRIPTION"
|
||||
.sp
|
||||
lsinitrd shows the contents of an initramfs image\&. if <image> is omitted, then lsinitrd uses the default image \fI/boot/<machine\-id>/<kernel\-version>/initrd\fR or \fI/boot/initramfs\-<kernel\-version>\&.img\fR\&.
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
\fB\-h, \-\-help\fR
|
||||
.RS 4
|
||||
print a help message and exit\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-s, \-\-size\fR
|
||||
.RS 4
|
||||
sort the contents of the initramfs by size\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-f, \-\-file\fR\ \&\fI<filename>\fR
|
||||
.RS 4
|
||||
print the contents of <filename>\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-k, \-\-kver\fR\ \&\fI<kernel version>\fR
|
||||
.RS 4
|
||||
inspect the initramfs of <kernel version>\&.
|
||||
.RE
|
||||
.SH "AVAILABILITY"
|
||||
.sp
|
||||
The lsinitrd command is part of the dracut package and is available from \m[blue]\fBhttps://dracut\&.wiki\&.kernel\&.org\fR\m[]
|
||||
.SH "AUTHORS"
|
||||
.sp
|
||||
Harald Hoyer
|
||||
.sp
|
||||
Amerigo Wang
|
||||
.sp
|
||||
Nikoli
|
||||
.SH "SEE ALSO"
|
||||
.sp
|
||||
\fBdracut\fR(8)
|
@@ -68,7 +68,7 @@ while [ $# -gt 0 ]; do
|
||||
-v|--verbose)
|
||||
dracut_args="${dracut_args} -v"
|
||||
;;
|
||||
-f)
|
||||
-f|--force)
|
||||
dracut_args="${dracut_args} -f"
|
||||
;;
|
||||
--preload*)
|
||||
@@ -142,9 +142,9 @@ if [ -n "$img_vers" ]; then
|
||||
fi
|
||||
|
||||
if [ -n "$basicmodules" ]; then
|
||||
dracut -H $dracut_args --add-drivers "$basicmodules" "$target" "$kernel"
|
||||
dracut $dracut_args --add-drivers "$basicmodules" "$target" "$kernel"
|
||||
else
|
||||
dracut -H $dracut_args "$target" "$kernel"
|
||||
dracut $dracut_args "$target" "$kernel"
|
||||
fi
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
|
103
mkinitrd.8
Normal file
103
mkinitrd.8
Normal file
@@ -0,0 +1,103 @@
|
||||
'\" t
|
||||
.\" Title: mkinitrd
|
||||
.\" Author: [see the "AUTHORS" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
|
||||
.\" Date: 07/17/2013
|
||||
.\" Manual: dracut
|
||||
.\" Source: dracut
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "MKINITRD" "8" "07/17/2013" "dracut" "dracut"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
.SH "NAME"
|
||||
mkinitrd \- is a compat wrapper, which calls dracut to generate an initramfs
|
||||
.SH "SYNOPSIS"
|
||||
.sp
|
||||
\fBmkinitrd\fR [\fIOPTION\&...\fR] [<initrd\-image>] <kernel\-version>
|
||||
.SH "DESCRIPTION"
|
||||
.sp
|
||||
mkinitrd creates an initramfs image <initrd\-image> for the kernel with version <kernel\-version> by calling "dracut"\&.
|
||||
.if n \{\
|
||||
.sp
|
||||
.\}
|
||||
.RS 4
|
||||
.it 1 an-trap
|
||||
.nr an-no-space-flag 1
|
||||
.nr an-break-flag 1
|
||||
.br
|
||||
.ps +1
|
||||
\fBImportant\fR
|
||||
.ps -1
|
||||
.br
|
||||
.sp
|
||||
If a more fine grained control over the resulting image is needed, "dracut" should be called directly\&.
|
||||
.sp .5v
|
||||
.RE
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
\fB\-\-version\fR
|
||||
.RS 4
|
||||
print info about the version
|
||||
.RE
|
||||
.PP
|
||||
\fB\-v, \-\-verbose\fR
|
||||
.RS 4
|
||||
increase verbosity level
|
||||
.RE
|
||||
.PP
|
||||
\fB\-f, \-\-force\fR
|
||||
.RS 4
|
||||
overwrite existing initramfs file\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB*\-\-image\-version\fR
|
||||
.RS 4
|
||||
append the kernel version to the target image <initrd\-image>\-<kernel\-version>\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-\-with=<module>\fR
|
||||
.RS 4
|
||||
add the kernel module <module> to the initramfs\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-\-preload=<module>\fR
|
||||
.RS 4
|
||||
preload the kernel module <module> in the initramfs before any other kernel modules are loaded\&. This can be used to ensure a certain device naming, which should in theory be avoided and the use of symbolic links in /dev is encouraged\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-\-nocompress\fR
|
||||
.RS 4
|
||||
do not compress the resulting image\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-\-help\fR
|
||||
.RS 4
|
||||
print a help message and exit\&.
|
||||
.RE
|
||||
.SH "AVAILABILITY"
|
||||
.sp
|
||||
The mkinitrd command is part of the dracut package and is available from \m[blue]\fBhttps://dracut\&.wiki\&.kernel\&.org\fR\m[]
|
||||
.SH "AUTHORS"
|
||||
.sp
|
||||
Harald Hoyer
|
||||
.SH "SEE ALSO"
|
||||
.sp
|
||||
\fBdracut\fR(8)
|
@@ -1,19 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
. $dracutfunctions
|
||||
|
||||
for program in ip arping; do
|
||||
which $program >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
dwarning "Could not find program \"$program\" required by network."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
for program in dhclient brctl; do
|
||||
which $program >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
dwarning "Could not find program \"$program\" it might be required by network."
|
||||
fi
|
||||
done
|
||||
[[ $1 = -d ]] && exit 0
|
||||
exit 255
|
||||
|
||||
|
12
modules.d/01fips/fips-boot.sh
Executable file
12
modules.d/01fips/fips-boot.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
|
||||
rm -f /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
elif getarg boot= >/dev/null; then
|
||||
. /sbin/fips.sh
|
||||
if mount_boot; then
|
||||
do_fips || die "FIPS integrity test failed"
|
||||
fi
|
||||
fi
|
11
modules.d/01fips/fips-noboot.sh
Executable file
11
modules.d/01fips/fips-noboot.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
|
||||
rm -f /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
elif ! [ -f /tmp/fipsdone ]; then
|
||||
. /sbin/fips.sh
|
||||
mount_boot
|
||||
do_fips || die "FIPS integrity test failed"
|
||||
fi
|
@@ -1,70 +1,124 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
mount_boot()
|
||||
{
|
||||
boot=$(getarg boot=)
|
||||
|
||||
if [ -n "$boot" ]; then
|
||||
case "$boot" in
|
||||
LABEL=*)
|
||||
boot="$(echo $boot | sed 's,/,\\x2f,g')"
|
||||
boot="/dev/disk/by-label/${boot#LABEL=}"
|
||||
;;
|
||||
UUID=*)
|
||||
boot="/dev/disk/by-uuid/${boot#UUID=}"
|
||||
;;
|
||||
/dev/*)
|
||||
;;
|
||||
*)
|
||||
die "You have to specify boot=<boot device> as a boot option for fips=1" ;;
|
||||
esac
|
||||
|
||||
if ! [ -e "$boot" ]; then
|
||||
udevadm trigger --action=add >/dev/null 2>&1
|
||||
[ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version)
|
||||
i=0
|
||||
while ! [ -e $boot ]; do
|
||||
if [ $UDEVVERSION -ge 143 ]; then
|
||||
udevadm settle --exit-if-exists=$boot >/dev/null 2>&1
|
||||
else
|
||||
udevadm settle --timeout=30 >/dev/null 2>&1
|
||||
fi
|
||||
[ -e $boot ] && break
|
||||
modprobe scsi_wait_scan && rmmod scsi_wait_scan
|
||||
[ -e $boot ] && break
|
||||
sleep 0.5
|
||||
i=$(($i+1))
|
||||
[ $i -gt 40 ] && break
|
||||
done
|
||||
fi
|
||||
|
||||
[ -e "$boot" ] || return 1
|
||||
|
||||
mkdir /boot
|
||||
info "Mounting $boot as /boot"
|
||||
mount -oro "$boot" /boot || return 1
|
||||
elif [ -d "$NEWROOT/boot" ]; then
|
||||
rm -fr /boot
|
||||
ln -sf "$NEWROOT/boot" /boot
|
||||
fi
|
||||
}
|
||||
|
||||
do_rhevh_check()
|
||||
{
|
||||
KERNEL=$(uname -r)
|
||||
kpath=${1}
|
||||
|
||||
# If we're on RHEV-H, the kernel is in /dev/.initramfs/live/vmlinuz0
|
||||
HMAC_SUM_ORIG=$(cat $NEWROOT/boot/.vmlinuz-${KERNEL}.hmac | while read a b; do printf "%s\n" $a; done)
|
||||
HMAC_SUM_CALC=$(sha512hmac $kpath | while read a b; do printf "%s\n" $a; done || return 1)
|
||||
if [ -z "$HMAC_SUM_ORIG" ] || [ -z "$HMAC_SUM_CALC" ] || [ "${HMAC_SUM_ORIG}" != "${HMAC_SUM_CALC}" ]; then
|
||||
warn "HMAC sum mismatch"
|
||||
return 1
|
||||
fi
|
||||
info "rhevh_check OK"
|
||||
return 0
|
||||
}
|
||||
|
||||
do_fips()
|
||||
{
|
||||
FIPSMODULES=$(cat /etc/fipsmodules)
|
||||
BOOT=$(getarg boot=)
|
||||
KERNEL=$(uname -r)
|
||||
udevadm trigger >/dev/null 2>&1
|
||||
case "$boot" in
|
||||
block:LABEL=*|LABEL=*)
|
||||
boot="${boot#block:}"
|
||||
boot="$(echo $boot | sed 's,/,\\x2f,g')"
|
||||
boot="/dev/disk/by-label/${boot#LABEL=}"
|
||||
bootok=1 ;;
|
||||
block:UUID=*|UUID=*)
|
||||
boot="${boot#block:}"
|
||||
boot="/dev/disk/by-uuid/${root#UUID=}"
|
||||
bootok=1 ;;
|
||||
/dev/*)
|
||||
bootok=1 ;;
|
||||
esac
|
||||
|
||||
[ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version)
|
||||
|
||||
if [ $UDEVVERSION -ge 143 ]; then
|
||||
udevadm settle --exit-if-exists=$boot
|
||||
else
|
||||
udevadm settle --timeout=30
|
||||
fi
|
||||
|
||||
[ -e "$boot" ]
|
||||
|
||||
mkdir /boot
|
||||
info "Mounting $boot as /boot"
|
||||
mount -oro "$boot" /boot
|
||||
|
||||
local _v
|
||||
local _s
|
||||
local _v
|
||||
local _module
|
||||
info "Checking integrity of kernel"
|
||||
KERNEL=$(uname -r)
|
||||
|
||||
if ! [ -e "/boot/.vmlinuz-${KERNEL}.hmac" ]; then
|
||||
warn "/boot/.vmlinuz-${KERNEL}.hmac does not exist"
|
||||
return 1
|
||||
fi
|
||||
|
||||
sha512hmac -c "/boot/.vmlinuz-${KERNEL}.hmac" || return 1
|
||||
if [ -e "/dev/.initramfs/live/vmlinuz0" ]; then
|
||||
do_rhevh_check /dev/.initramfs/live/vmlinuz0 || return 1
|
||||
elif [ -e "/dev/.initramfs/live/isolinux/vmlinuz0" ]; then
|
||||
do_rhevh_check /dev/.initramfs/live/isolinux/vmlinuz0 || return 1
|
||||
else
|
||||
sha512hmac -c "/boot/.vmlinuz-${KERNEL}.hmac" || return 1
|
||||
fi
|
||||
|
||||
info "Umounting /boot"
|
||||
umount /boot
|
||||
FIPSMODULES=$(cat /etc/fipsmodules)
|
||||
|
||||
info "Loading and integrity checking all crypto modules"
|
||||
for module in $FIPSMODULES; do
|
||||
if [ "$module" != "tcrypt" ]; then
|
||||
modprobe ${module} || return 1
|
||||
mv /etc/modprobe.d/fips.conf /etc/modprobe.d/fips.conf.bak
|
||||
for _module in $FIPSMODULES; do
|
||||
if [ "$_module" != "tcrypt" ]; then
|
||||
if ! modprobe "${_module}"; then
|
||||
# check if kernel provides generic algo
|
||||
_found=0
|
||||
while read _k _s _v; do
|
||||
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
|
||||
[ "$_k" = "driver" ] && _v=$(str_replace "$_v" "_" "-")
|
||||
[ "$_v" != "$_module" ] && continue
|
||||
_found=1
|
||||
break
|
||||
done </proc/crypto
|
||||
[ "$_found" = "0" ] && return 1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
mv /etc/modprobe.d/fips.conf.bak /etc/modprobe.d/fips.conf
|
||||
|
||||
info "Self testing crypto algorithms"
|
||||
modprobe tcrypt noexit=1 || return 1
|
||||
modprobe tcrypt || return 1
|
||||
rmmod tcrypt
|
||||
info "All initrd crypto checks done"
|
||||
info "All initrd crypto checks done"
|
||||
|
||||
> /tmp/fipsdone
|
||||
|
||||
umount /boot >/dev/null 2>&1
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
if ! fipsmode=$(getarg fips) || [ $fipsmode == "0" ]; then
|
||||
rm -f /etc/modprobe.d/fips.conf >/dev/null 2>&1
|
||||
else
|
||||
set -e
|
||||
do_fips || die "FIPS integrity test failed"
|
||||
set +e
|
||||
fi
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
|
@@ -1,23 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
inst_hook pre-trigger 01 "$moddir/fips.sh"
|
||||
inst_hook pre-trigger 01 "$moddir/fips-boot.sh"
|
||||
inst_hook pre-pivot 01 "$moddir/fips-noboot.sh"
|
||||
inst "$moddir/fips.sh" /sbin/fips.sh
|
||||
dracut_install sha512hmac rmmod insmod mount uname umount
|
||||
|
||||
libdir="lib"
|
||||
if ldd $(find_binary sha512hmac) |grep -q /lib64/libc; then
|
||||
if ldd $(find_binary sha512hmac) 2>/dev/null | grep -q /lib64/; then
|
||||
libdir="lib64"
|
||||
fi
|
||||
|
||||
if [ -e /usr/$libdir/libsoftokn3.so ]; then
|
||||
dracut_install \
|
||||
/usr/$libdir/libsoftokn3.so /usr/$libdir/libsoftokn3.chk \
|
||||
/usr/$libdir/libfreebl3.so /usr/$libdir/libfreebl3.chk
|
||||
/usr/$libdir/libsoftokn3.so /usr/$libdir/libsoftokn3.chk
|
||||
else
|
||||
dracut_install \
|
||||
/$libdir/libsoftokn3.so /$libdir/libsoftokn3.chk \
|
||||
/$libdir/libfreebl3.so /$libdir/libfreebl3.chk
|
||||
/$libdir/libsoftokn3.so /$libdir/libsoftokn3.chk
|
||||
fi
|
||||
|
||||
dracut_install /usr/$libdir/hmaccalc/sha512hmac.hmac
|
||||
for i in /{usr,}/$libdir/libssl.so* /{usr,}/$libdir/libcrypto.so* \
|
||||
/{usr,}/$libdir/.libssl.so*.hmac /{usr,}/$libdir/.libcrypto.so*.hmac; do
|
||||
[ -e $i ] || continue
|
||||
dracut_install $i
|
||||
done
|
||||
|
||||
dracut_install -o /usr/$libdir/hmaccalc/sha*hmac.hmac
|
||||
dracut_install fipscheck
|
||||
dracut_install /etc/system-fips
|
||||
|
||||
if command -v prelink >/dev/null; then
|
||||
dracut_install prelink
|
||||
fi
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
||||
|
@@ -1,13 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
FIPSMODULES="aead aes_generic aes-x86_64 ansi_cprng cbc ccm chainiv ctr"
|
||||
FIPSMODULES="$FIPSMODULES des deflate ecb eseqiv hmac seqiv sha256 sha512"
|
||||
FIPSMODULES="$FIPSMODULES cryptomgr crypto_null tcrypt"
|
||||
_fipsmodules="aead aes_generic aes-x86_64 ansi_cprng arc4 blowfish camellia cast6 cbc ccm "
|
||||
_fipsmodules+="chainiv crc32c cryptomgr crypto_null ctr cts deflate des des3_ede dm-crypt dm-mod drbg "
|
||||
_fipsmodules+="ecb eseqiv fcrypt gcm ghash_generic hmac khazad lzo md4 md5 michael_mic rmd128 "
|
||||
_fipsmodules+="rmd160 rmd256 rmd320 rot13 salsa20 seed seqiv serpent sha1 sha224 sha256 sha256_generic "
|
||||
_fipsmodules+="sha384 sha512 sha512_generic tcrypt tea tnepres twofish wp256 wp384 wp512 xeta xtea xts zlib"
|
||||
|
||||
mkdir -p "${initdir}/etc/modprobe.d"
|
||||
|
||||
for mod in $FIPSMODULES; do
|
||||
if instmods $mod; then
|
||||
for mod in $_fipsmodules; do
|
||||
if hostonly='' instmods $mod; then
|
||||
echo $mod >> "${initdir}/etc/fipsmodules"
|
||||
echo "blacklist $mod" >> "${initdir}/etc/modprobe.d/fips.conf"
|
||||
fi
|
||||
|
33
modules.d/02caps/README
Normal file
33
modules.d/02caps/README
Normal file
@@ -0,0 +1,33 @@
|
||||
This adds the following parameters:
|
||||
rd.caps=1
|
||||
turn the caps module on/off
|
||||
rd.caps.initdrop=cap_sys_module,cap_sys_rawio
|
||||
drop the specified comma seperated capabilities
|
||||
rd.caps.disablemodules=1
|
||||
turn off module loading
|
||||
rd.caps.disablekexec=1
|
||||
turn off the kexec functionality
|
||||
|
||||
If module loading is turned off, all modules have to be loaded in the
|
||||
initramfs, which are used later on. This can be done with
|
||||
"rdloaddriver="
|
||||
rdloaddriver=autofs4,sunrpc,ipt_REJECT,nf_conntrack_ipv4,....
|
||||
|
||||
Because the kernel command line would get huge with all those drivers, I
|
||||
recommend to make use of $initramfs/etc/cmdline.
|
||||
|
||||
So, all rd.caps.* and rdloaddriver arguments are in caps.conf can be
|
||||
copied to $initramfs/etc/cmdline with "-i caps.conf /etc/cmdline".
|
||||
|
||||
Also all modules have to be loaded in the initramfs via "--add-drivers".
|
||||
|
||||
The resulting initramfs creation would look like this:
|
||||
|
||||
--add-drivers "autofs4 sunrpc ipt_REJECT nf_conntrack_ipv4 \
|
||||
nf_defrag_ipv4 iptable_filter ip_tables
|
||||
ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack
|
||||
ip6table_filter ip6_tables dm_mirror dm_region_hash dm_log uinput ppdev
|
||||
parport_pc parport ipv6 sg 8139too 8139cp mii i2c_piix4 i2c_core ext3
|
||||
jbd mbcache sd_mod crc_t10dif sr_mod cdrom ata_generic pata_acpi ata_piix
|
||||
dm_mod" \
|
||||
/boot/initramfs-caps.img
|
36
modules.d/02caps/caps.sh
Executable file
36
modules.d/02caps/caps.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
capsmode=$(getarg rd.caps)
|
||||
|
||||
if [ "$capsmode" = "1" ]; then
|
||||
CAPS_INIT_DROP=$(getarg rd.caps.initdrop=)
|
||||
CAPS_USERMODEHELPER_BSET=$(capsh --drop="$CAPS_INIT_DROP" -- -c 'while read a b ; do [ "$a" = "CapBnd:" ] && echo $((0x${b:$((${#b}-8)):8})) $((0x${b:$((${#b}-16)):8})) && break; done < /proc/self/status')
|
||||
CAPS_MODULES_DISABLED=$(getarg rd.caps.disablemodules=)
|
||||
CAPS_KEXEC_DISABLED=$(getarg rd.caps.disablekexec=)
|
||||
|
||||
info "Loading CAPS_MODULES $CAPS_MODULES"
|
||||
for i in $CAPS_MODULES;do modprobe $i 2>&1 >/dev/null | vinfo; done
|
||||
|
||||
if [ "$CAPS_MODULES_DISABLED" = "1" -a -e /proc/sys/kernel/modules_disabled ]; then
|
||||
info "Disabling module loading."
|
||||
echo $CAPS_MODULES_DISABLED > /proc/sys/kernel/modules_disabled
|
||||
fi
|
||||
|
||||
if [ "$CAPS_KEXEC_DISABLED" = "1" -a -e /proc/sys/kernel/kexec_disabled ]; then
|
||||
info "Disabling kexec."
|
||||
echo $CAPS_KEXEC_DISABLED > /proc/sys/kernel/kexec_disabled
|
||||
fi
|
||||
|
||||
info "CAPS_USERMODEHELPER_BSET=$CAPS_USERMODEHELPER_BSET"
|
||||
if [ -e /proc/sys/kernel/usermodehelper/bset ]; then
|
||||
info "Setting usermode helper bounding set."
|
||||
echo $CAPS_USERMODEHELPER_BSET > /proc/sys/kernel/usermodehelper/bset
|
||||
echo $CAPS_USERMODEHELPER_BSET > /proc/sys/kernel/usermodehelper/inheritable
|
||||
fi
|
||||
|
||||
echo "CAPS_INIT_DROP=\"$CAPS_INIT_DROP\"" > /etc/capsdrop
|
||||
info "Will drop capabilities $CAPS_INIT_DROP from init."
|
||||
fi
|
||||
|
8
modules.d/02caps/check
Executable file
8
modules.d/02caps/check
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
[[ $1 = -d ]] && exit 0
|
||||
|
||||
type -P capsh >/dev/null 2>&1 || exit 1
|
||||
|
||||
exit 0
|
||||
|
10
modules.d/02caps/install
Executable file
10
modules.d/02caps/install
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
inst_hook pre-pivot 99 "$moddir/caps.sh"
|
||||
dracut_install capsh
|
||||
# capsh wants bash and we need bash also
|
||||
inst /bin/bash && ln -sf bash "${initdir}/bin/sh"
|
||||
|
||||
|
5
modules.d/02fips-aesni/check
Executable file
5
modules.d/02fips-aesni/check
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
[[ $1 = -d ]] && exit 0
|
||||
exit 255
|
||||
|
14
modules.d/02fips-aesni/installkernel
Executable file
14
modules.d/02fips-aesni/installkernel
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
FIPSMODULES="aesni-intel"
|
||||
|
||||
mkdir -p "${initdir}/etc/modprobe.d"
|
||||
|
||||
for mod in $FIPSMODULES; do
|
||||
if hostonly='' instmods $mod; then
|
||||
echo $mod >> "${initdir}/etc/fipsmodules"
|
||||
echo "blacklist $mod" >> "${initdir}/etc/modprobe.d/fips.conf"
|
||||
fi
|
||||
done
|
||||
|
||||
# vim:ts=8:sw=4:sts=4:et
|
@@ -94,7 +94,7 @@ else
|
||||
dracut_install gzip bzip2
|
||||
fi
|
||||
|
||||
dracut_install /lib/udev/console_init
|
||||
[ -x /lib/udev/console_init ] && dracut_install /lib/udev/console_init
|
||||
dracut_install setfont loadkeys
|
||||
inst_rules 10-console.rules
|
||||
inst_hook cmdline 20 "$moddir/parse-i18n.sh"
|
||||
|
@@ -1,3 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -e "$moddir/dracut-version" ]; then
|
||||
dracut_rpm_version=$(cat "$moddir/dracut-version")
|
||||
inst "$moddir/dracut-version" /$dracut_rpm_version
|
||||
|
@@ -1,5 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ $1 = -d ]]; then
|
||||
[ -d /etc/sysconfig/network-scripts/ ] && echo ifcfg
|
||||
exit 0
|
||||
fi
|
||||
|
||||
. $dracutfunctions
|
||||
|
||||
for program in ip arping; do
|
||||
@@ -9,11 +14,14 @@ for program in ip arping; do
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
for program in dhclient brctl; do
|
||||
for program in dhclient brctl ifenslave tr; do
|
||||
which $program >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
dwarning "Could not find program \"$program\" it might be required by network."
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
|
||||
exit 255
|
||||
|
||||
|
@@ -20,15 +20,17 @@ setup_interface() {
|
||||
# disallow MTUs from 576 and below by default, so that broken
|
||||
# MTUs are ignored, but higher stuff is allowed (1492, 1500, etc).
|
||||
if [ -n "$mtu" ] && [ $mtu -gt 576 ] ; then
|
||||
echo "if ! ip link set $netif mtu $mtu ; then"
|
||||
echo "ip link set $netif down"
|
||||
echo "ip link set $netif mtu $mtu"
|
||||
echo "ip link set $netif up"
|
||||
echo wait_for_if_up $netif
|
||||
echo "fi"
|
||||
fi > /tmp/net.$netif.up
|
||||
if ! ip link set $netif mtu $mtu ; then
|
||||
ip link set $netif down
|
||||
ip link set $netif mtu $mtu
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif >> /tmp/net.$netif.up
|
||||
ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif
|
||||
|
||||
> /tmp/net.$netif.up
|
||||
|
||||
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
|
||||
|
||||
@@ -44,26 +46,21 @@ setup_interface() {
|
||||
|
||||
PATH=$PATH:/sbin:/usr/sbin
|
||||
|
||||
export PS4="dhclient.$interface.$$ + "
|
||||
exec >>/dev/initlog.pipe 2>>/dev/initlog.pipe
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
if getarg rdnetdebug ; then
|
||||
exec >/tmp/dhclient.$interface.$$.out
|
||||
exec 2>>/tmp/dhclient.$interface.$$.out
|
||||
set -x
|
||||
fi
|
||||
|
||||
# We already need a set netif here
|
||||
netif=$interface
|
||||
|
||||
# Huh? Interface configured?
|
||||
[ -f "/tmp/net.$netif.up" ] && exit 0
|
||||
|
||||
case $reason in
|
||||
PREINIT)
|
||||
echo "dhcp: PREINIT $netif up"
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
;;
|
||||
BOUND)
|
||||
echo "dhcp: BOND setting $netif"
|
||||
if ! arping -q -D -c 2 -I $netif $new_ip_address ; then
|
||||
warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying"
|
||||
exit 1
|
||||
@@ -76,7 +73,7 @@ case $reason in
|
||||
echo online > /sys/class/net/$netif/uevent
|
||||
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
|
||||
;;
|
||||
*) ;;
|
||||
*) echo "dhcp: $reason";;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
@@ -7,13 +7,15 @@
|
||||
[ -z "$root" ] && root=$(getarg root=)
|
||||
[ -z "$netroot" ] && netroot=$(getarg netroot=)
|
||||
|
||||
if [ "$root" = "dhcp" ] || [ "$netroot" = "dhcp" ] ; then
|
||||
if [ "$root" = "dhcp" ] || [ "$root" = "dhcp6" ] || [ "$netroot" = "dhcp" ] ; then
|
||||
# Tell ip= checker that we need dhcp
|
||||
NEEDDHCP="1"
|
||||
|
||||
# Done, all good!
|
||||
rootok=1
|
||||
netroot=dhcp
|
||||
if [ "$netroot" != "dhcp" ] ; then
|
||||
netroot=$root
|
||||
fi
|
||||
|
||||
# Shut up init error check
|
||||
[ -z "$root" ] && root="dhcp"
|
||||
|
@@ -2,20 +2,26 @@
|
||||
|
||||
# if there are no ifname parameters, just use NAME=KERNEL
|
||||
if ! getarg ifname= >/dev/null ; then
|
||||
echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="?*", ATTR{type}=="1", NAME="%k"' \
|
||||
> /etc/udev/rules.d/50-ifname.rules
|
||||
return
|
||||
fi
|
||||
|
||||
{
|
||||
|
||||
echo 'SUBSYSTEM!="net", GOTO="ifname_end"'
|
||||
echo 'ACTION!="add", GOTO="ifname_end"'
|
||||
echo 'ATTR{type}!="1", GOTO="ifname_end"'
|
||||
|
||||
for p in $(getargs ifname=); do
|
||||
parse_ifname_opts $p
|
||||
printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="%s", ATTR{type}=="1", NAME="%s"\n' "$ifname_mac" "$ifname_if"
|
||||
printf 'DRIVERS=="?*", ATTR{address}=="%s", NAME="%s", GOTO="ifname_end"\n' "$ifname_mac" "$ifname_if"
|
||||
done
|
||||
|
||||
# Rename non named interfaces out of the way for named ones.
|
||||
for p in $(getargs ifname=); do
|
||||
parse_ifname_opts $p
|
||||
printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="?*", ATTR{type}=="1", NAME!="?*", KERNEL=="%s", NAME="%%k-renamed"\n' "$ifname_if"
|
||||
printf 'DRIVERS=="?*", ATTR{address}!="%s", KERNEL=="%s", NAME="rename$attr{ifindex}", GOTO="ifname_end"\n' "$ifname_mac" "$ifname_if"
|
||||
done
|
||||
|
||||
echo 'LABEL="ifname_end"'
|
||||
|
||||
} > /etc/udev/rules.d/50-ifname.rules
|
||||
|
@@ -3,58 +3,111 @@
|
||||
# We don't need to check for ip= errors here, that is handled by the
|
||||
# cmdline parser script
|
||||
#
|
||||
PATH=$PATH:/sbin:/usr/sbin
|
||||
|
||||
# Sadly there's no easy way to split ':' separated lines into variables
|
||||
ip_to_var() {
|
||||
local v=${1}:
|
||||
set --
|
||||
while [ -n "$v" ]; do
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
done
|
||||
export PS4="ifup.$1.$$ + "
|
||||
|
||||
unset ip srv gw mask hostname dev autoconf
|
||||
case $# in
|
||||
0) autoconf="error" ;;
|
||||
1) autoconf=$1 ;;
|
||||
2) dev=$1; autoconf=$2 ;;
|
||||
*) ip=$1; srv=$2; gw=$3; mask=$4; hostname=$5; dev=$6; autoconf=$7 ;;
|
||||
esac
|
||||
}
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
[ "$RDDEBUG" = "yes" ] \
|
||||
&& [ -e /dev/initlog.pipe ] \
|
||||
&& exec >>/dev/initlog.pipe 2>>/dev/initlog.pipe
|
||||
|
||||
# Run dhclient
|
||||
do_dhcp() {
|
||||
# /sbin/dhclient-script will mark the netif up and generate the online
|
||||
# event for nfsroot
|
||||
# XXX add -V vendor class and option parsing per kernel
|
||||
dhclient -1 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif
|
||||
#echo "Starting dhcp for interface $netif"
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
[ -n "$macaddr" ] && ip link set address $macaddr dev $netif
|
||||
[ -n "$mtu" ] && ip link set mtu $mtu dev $netif
|
||||
dhclient "$@" -1 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif &
|
||||
|
||||
# increase wait time for DHCP
|
||||
echo '[ $(($RDRETRY-$main_loop)) -lt 720 ] && RDRETRY=$(($main_loop+720)); rm -f "$job"' > /initqueue/rd_retry_inc_dhclient.$netif.sh
|
||||
|
||||
#|| echo "dhcp failed"
|
||||
}
|
||||
|
||||
# Handle static ip configuration
|
||||
do_static() {
|
||||
{
|
||||
echo ip link set $netif up
|
||||
echo wait_for_if_up $netif
|
||||
echo ip addr flush dev $netif
|
||||
echo ip addr add $ip/$mask dev $netif
|
||||
} > /tmp/net.$netif.up
|
||||
load_ipv6() {
|
||||
modprobe ipv6
|
||||
i=0
|
||||
while [ ! -d /proc/sys/net/ipv6 ]; do
|
||||
i=$(($i+1))
|
||||
[ $i -gt 10 ] && break
|
||||
sleep 0.1
|
||||
done
|
||||
}
|
||||
|
||||
do_ipv6auto() {
|
||||
load_ipv6
|
||||
{
|
||||
echo 0 > /proc/sys/net/ipv6/conf/$netif/forwarding
|
||||
echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_ra
|
||||
echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_redirects
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
[ -n "$macaddr" ] && ip link set address $macaddr dev $netif
|
||||
[ -n "$mtu" ] && ip link set mtu $mtu dev $netif
|
||||
}
|
||||
> /tmp/net.$netif.up
|
||||
|
||||
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
|
||||
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
|
||||
namesrv=$(getargs nameserver)
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
|
||||
|
||||
echo online > /sys/class/net/$netif/uevent
|
||||
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
|
||||
}
|
||||
|
||||
PATH=$PATH:/sbin:/usr/sbin
|
||||
# Handle static ip configuration
|
||||
do_static() {
|
||||
strstr $ip '*:*:*' && load_ipv6
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
{
|
||||
ip link set $netif up
|
||||
wait_for_if_up $netif
|
||||
[ -n "$macaddr" ] && ip link set address $macaddr dev $netif
|
||||
[ -n "$mtu" ] && ip link set mtu $mtu dev $netif
|
||||
# do not flush addr for ipv6
|
||||
#strstr $ip '*:*:*' || \
|
||||
# ip addr flush dev $netif
|
||||
ip addr add $ip/$mask brd + dev $netif
|
||||
}
|
||||
> /tmp/net.$netif.up
|
||||
|
||||
if getarg rdnetdebug ; then
|
||||
exec >/tmp/ifup.$1.$$.out
|
||||
exec 2>>/tmp/ifup.$1.$$.out
|
||||
set -x
|
||||
fi
|
||||
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
|
||||
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
|
||||
namesrv=$(getargs nameserver)
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
|
||||
echo online > /sys/class/net/$netif/uevent
|
||||
/sbin/initqueue --onetime --name netroot-$netif /sbin/netroot $netif
|
||||
}
|
||||
|
||||
get_vid() {
|
||||
case "$1" in
|
||||
vlan*)
|
||||
echo ${1#vlan}
|
||||
;;
|
||||
*.*)
|
||||
echo ${1##*.}
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Huh? No $1?
|
||||
[ -z "$1" ] && exit 1
|
||||
@@ -62,14 +115,47 @@ fi
|
||||
# $netif reads easier than $1
|
||||
netif=$1
|
||||
|
||||
# check, if we need VLAN's for this interface
|
||||
if [ -z "$DO_VLAN_PHY" ] && [ -e /tmp/vlan.${netif}.phy ]; then
|
||||
NO_AUTO_DHCP=yes DO_VLAN_PHY=yes ifup "$netif"
|
||||
modprobe -b -q 8021q
|
||||
|
||||
for i in /tmp/vlan.*.${netif}; do
|
||||
[ -e "$i" ] || continue
|
||||
read vlanname < "$i"
|
||||
if [ -n "$vlanname" ]; then
|
||||
ip link set "$netif" up
|
||||
wait_for_if_up "$netif"
|
||||
ip link add dev "$vlanname" link "$netif" type vlan id "$(get_vid $vlanname)"
|
||||
ifup "$vlanname"
|
||||
fi
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# enslave this interface to bond?
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
for slave in $bondslaves ; do
|
||||
if [ "$netif" = "$slave" ] ; then
|
||||
netif=$bondname
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# bridge this interface?
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
if [ "$netif" = "$ethname" ]; then
|
||||
netif="$bridgename"
|
||||
if [ "$netif" = "$bondname" ] && [ -n "$DO_BOND_SETUP" ] ; then
|
||||
: # We need to really setup bond (recursive call)
|
||||
else
|
||||
netif="$bridgename"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# bail immediately if the interface is already up
|
||||
# or we don't need the network
|
||||
[ -f "/tmp/net.$netif.up" ] && exit 0
|
||||
@@ -85,11 +171,63 @@ if [ "$netif" = "lo" ] ; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# start bond if needed
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
|
||||
if [ "$netif" = "$bondname" ] && [ ! -e /tmp/net.$bondname.up ] ; then # We are master bond device
|
||||
modprobe bonding
|
||||
echo "+$netif" > /sys/class/net/bonding_masters
|
||||
ip link set $netif down
|
||||
|
||||
# Stolen from ifup-eth
|
||||
# add the bits to setup driver parameters here
|
||||
for arg in $bondoptions ; do
|
||||
key=${arg%%=*};
|
||||
value=${arg##*=};
|
||||
# %{value:0:1} is replaced with non-bash specific construct
|
||||
if [ "${key}" = "arp_ip_target" -a "${#value}" != "0" -a "+${value%%+*}" != "+" ]; then
|
||||
OLDIFS=$IFS;
|
||||
IFS=',';
|
||||
for arp_ip in $value; do
|
||||
echo +$arp_ip > /sys/class/net/${netif}/bonding/$key
|
||||
done
|
||||
IFS=$OLDIFS;
|
||||
else
|
||||
echo $value > /sys/class/net/${netif}/bonding/$key
|
||||
fi
|
||||
done
|
||||
|
||||
ip link set $netif up
|
||||
|
||||
for slave in $bondslaves ; do
|
||||
ip link set $slave down
|
||||
ifenslave $bondname $slave
|
||||
ip link set $slave up
|
||||
wait_for_if_up $slave
|
||||
done
|
||||
|
||||
# add the bits to setup the needed post enslavement parameters
|
||||
for arg in $BONDING_OPTS ; do
|
||||
key=${arg%%=*};
|
||||
value=${arg##*=};
|
||||
if [ "${key}" = "primary" ]; then
|
||||
echo $value > /sys/class/net/${netif}/bonding/$key
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# XXX need error handling like dhclient-script
|
||||
|
||||
# start bridge if necessary
|
||||
if [ "$netif" = "$bridgename" ] && [ ! -e /tmp/net.$bridgename.up ]; then
|
||||
ip link set $ethname up
|
||||
if [ "$ethname" = "$bondname" ] ; then
|
||||
DO_BOND_SETUP=yes /sbin/ifup $bondname
|
||||
else
|
||||
ip link set $ethname up
|
||||
fi
|
||||
wait_for_if_up $ethname
|
||||
# Create bridge and add eth to bridge
|
||||
brctl addbr $bridgename
|
||||
@@ -97,27 +235,57 @@ if [ "$netif" = "$bridgename" ] && [ ! -e /tmp/net.$bridgename.up ]; then
|
||||
brctl addif $bridgename $ethname
|
||||
fi
|
||||
|
||||
|
||||
# No ip lines default to dhcp
|
||||
ip=$(getarg ip)
|
||||
[ -z "$ip" ] && do_dhcp;
|
||||
|
||||
if [ -z "$NO_AUTO_DHCP" ] && [ -z "$ip" ]; then
|
||||
if [ "$netroot" = "dhcp6" ]; then
|
||||
do_dhcp -6
|
||||
else
|
||||
do_dhcp -4
|
||||
fi
|
||||
fi
|
||||
|
||||
# Specific configuration, spin through the kernel command line
|
||||
# looking for ip= lines
|
||||
for p in $(getargs ip=); do
|
||||
ip_to_var $p
|
||||
|
||||
|
||||
# If this option isn't directed at our interface, skip it
|
||||
[ -n "$dev" ] && [ "$dev" != "$netif" ] && continue
|
||||
|
||||
# skip ibft
|
||||
if [ "$autoconf" = "ibft" ]; then
|
||||
if [ -n "$mtu" ] || mtu=$(getarg "mtu="); then
|
||||
ip link set mtu $mtu dev $netif
|
||||
fi
|
||||
continue
|
||||
fi
|
||||
|
||||
# Store config for later use
|
||||
for i in ip srv gw mask hostname; do
|
||||
for i in ip srv gw mask hostname macaddr mtu; do
|
||||
eval '[ "$'$i'" ] && echo '$i'="$'$i'"'
|
||||
done > /tmp/net.$netif.override
|
||||
|
||||
case $autoconf in
|
||||
dhcp|on|any) do_dhcp ;;
|
||||
*) do_static ;;
|
||||
esac
|
||||
OLDIFS="$IFS"
|
||||
IFS=,
|
||||
set -- $autoconf
|
||||
IFS="$OLDIFS"
|
||||
|
||||
for autoconf in "$@"; do
|
||||
case $autoconf in
|
||||
dhcp|on|any)
|
||||
do_dhcp -4 ;;
|
||||
dhcp6)
|
||||
do_dhcp -6 ;;
|
||||
auto6)
|
||||
do_ipv6auto ;;
|
||||
*)
|
||||
do_static ;;
|
||||
esac
|
||||
done
|
||||
break
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
@@ -1,13 +1,36 @@
|
||||
#!/bin/bash
|
||||
dracut_install ip dhclient brctl arping
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
dracut_install ip dhclient brctl arping ifenslave tr
|
||||
|
||||
inst "$moddir/ifup" "/sbin/ifup"
|
||||
inst "$moddir/netroot" "/sbin/netroot"
|
||||
inst "$moddir/dhclient-script" "/sbin/dhclient-script"
|
||||
inst "$moddir/dhclient.conf" "/etc/dhclient.conf"
|
||||
inst "$moddir/dhclient.conf" "/etc/dhclient.conf"
|
||||
inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
|
||||
inst_hook pre-udev 60 "$moddir/net-genrules.sh"
|
||||
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
|
||||
inst_hook cmdline 99 "$moddir/parse-ip-opts.sh"
|
||||
|
||||
inst_hook cmdline 94 "$moddir/parse-ibft.sh"
|
||||
inst_hook cmdline 95 "$moddir/parse-vlan.sh"
|
||||
inst_hook cmdline 97 "$moddir/parse-bond.sh"
|
||||
inst_hook cmdline 98 "$moddir/parse-bridge.sh"
|
||||
inst_hook cmdline 99 "$moddir/parse-ip-opts.sh"
|
||||
|
||||
inst_hook cmdline 99 "$moddir/parse-ifname.sh"
|
||||
inst_hook pre-pivot 10 "$moddir/kill-dhclient.sh"
|
||||
|
||||
if ldd $(which sh) 2>/dev/null | grep -q lib64; then
|
||||
LIBDIR="/lib64"
|
||||
else
|
||||
LIBDIR="/lib"
|
||||
fi
|
||||
|
||||
ARCH=$(uname -m)
|
||||
|
||||
for dir in /usr/$LIBDIR/tls/$ARCH/ /usr/$LIBDIR/tls/ /usr/$LIBDIR/$ARCH/ /usr/$LIBDIR/ /$LIBDIR/; do
|
||||
for i in $(ls $dir/libnss_dns.so.* $dir/libnss_mdns4_minimal.so.* 2>/dev/null); do
|
||||
dracut_install $i
|
||||
done
|
||||
done
|
||||
|
||||
|
@@ -4,13 +4,20 @@
|
||||
net_module_test() {
|
||||
local net_drivers='eth_type_trans|register_virtio_device'
|
||||
local unwanted_drivers='/(wireless|isdn|uwb)/'
|
||||
nm -uPA "$1" | egrep -q $net_drivers && \
|
||||
nm -uPA "$1" | egrep -qv 'iw_handler_get_spy' && \
|
||||
egrep -q $net_drivers "$1" && \
|
||||
egrep -qv 'iw_handler_get_spy' "$1" && \
|
||||
[[ ! $1 =~ $unwanted_drivers ]]
|
||||
}
|
||||
|
||||
instmods $(filter_kernel_modules net_module_test)
|
||||
|
||||
|
||||
instmods ecb arc4
|
||||
# bridge modules
|
||||
instmods bridge stp llc
|
||||
instmods ipv6
|
||||
# vlan
|
||||
instmods 8021q
|
||||
# bonding
|
||||
instmods bonding
|
||||
# hyperv
|
||||
hostonly='' instmods hv_netvsc
|
||||
|
@@ -1,4 +1,6 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# pxelinux provides macaddr '-' separated, but we need ':'
|
||||
fix_bootif() {
|
||||
@@ -6,7 +8,9 @@ fix_bootif() {
|
||||
local IFS='-'
|
||||
macaddr=$(for i in ${macaddr} ; do echo -n $i:; done)
|
||||
macaddr=${macaddr%:}
|
||||
echo $macaddr
|
||||
# strip hardware type field from pxelinux
|
||||
[ -n "${macaddr%??:??:??:??:??:??}" ] && macaddr=${macaddr#??:}
|
||||
echo $macaddr | tr '[:upper:]' '[:lower:]'
|
||||
}
|
||||
|
||||
# Don't continue if we don't need network
|
||||
@@ -17,24 +21,36 @@ fix_bootif() {
|
||||
# bridge: attempt only the defined interface
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
IFACES=$ethname
|
||||
IFACES="$IFACES $ethname"
|
||||
fi
|
||||
|
||||
for i in /tmp/vlan.*.phy; do
|
||||
[ -e "$i" ] || continue
|
||||
IFACES="$IFACES $(cat "$i")"
|
||||
done
|
||||
|
||||
# bond: attempt only the defined interface (override bridge defines)
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
# It is enough to fire up only one
|
||||
IFACES=${bondslaves%% *}
|
||||
fi
|
||||
|
||||
# BOOTIF says everything, use only that one
|
||||
BOOTIF=$(getarg 'BOOTIF=')
|
||||
if [ -n "$BOOTIF" ] ; then
|
||||
BOOTIF=$(fix_bootif "$BOOTIF")
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$BOOTIF"
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --unique --name ifup-$env{INTERFACE} /sbin/ifup $env{INTERFACE}"\n' "$BOOTIF"
|
||||
|
||||
# If we have to handle multiple interfaces, handle only them.
|
||||
elif [ -n "$IFACES" ] ; then
|
||||
for iface in $IFACES ; do
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$iface"
|
||||
printf 'SUBSYSTEM=="net", ENV{INTERFACE}=="%s", RUN+="/sbin/initqueue --onetime --unique --name ifup-$env{INTERFACE} /sbin/ifup $env{INTERFACE}"\n' "$iface"
|
||||
done
|
||||
|
||||
# Default: We don't know the interface to use, handle all
|
||||
else
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", RUN+="/sbin/ifup $env{INTERFACE}"\n'
|
||||
printf 'SUBSYSTEM=="net", ENV{INTERFACE}=="?*", RUN+="/sbin/initqueue --onetime --unique --name ifup-$env{INTERFACE} /sbin/ifup $env{INTERFACE}"\n'
|
||||
fi
|
||||
|
||||
} > /etc/udev/rules.d/60-net.rules
|
||||
|
@@ -4,18 +4,17 @@ PATH=$PATH:/sbin:/usr/sbin
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
[ "$RDDEBUG" = "yes" ] \
|
||||
&& [ -e /dev/initlog.pipe ] \
|
||||
&& exec >>/dev/initlog.pipe 2>>/dev/initlog.pipe
|
||||
|
||||
# Huh? Empty $1?
|
||||
[ -z "$1" ] && exit 1
|
||||
|
||||
# Huh? No interface config?
|
||||
[ ! -e /tmp/net.$1.up ] && exit 1
|
||||
|
||||
# There's no sense in doing something if no (net)root info is available
|
||||
# or root is already there
|
||||
[ -e /tmp/root.info ] || exit 1
|
||||
. /tmp/root.info
|
||||
[ -d $NEWROOT/proc ] && exit 0
|
||||
[ -z "$netroot" ] && exit 1
|
||||
|
||||
# Let's see if we have to wait for other interfaces
|
||||
# Note: exit works just fine, since the last interface to be
|
||||
@@ -27,11 +26,15 @@ done
|
||||
|
||||
# Set or override primary interface
|
||||
netif=$1
|
||||
[ -e "/tmp/net.bootdev" ] && read netif < /tmp/net.bootdev
|
||||
if [ -e "/tmp/net.bootdev" ]; then
|
||||
read netif < /tmp/net.bootdev
|
||||
# only boot from $netif
|
||||
[ -n "$1" ] && [ -n "$netif"] && [ "$netif" != "$1" ] && exit 1
|
||||
fi
|
||||
|
||||
# Figure out the handler for root=dhcp by recalling all netroot cmdline
|
||||
# handlers
|
||||
if [ "$netroot" = "dhcp" ] ; then
|
||||
if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] ; then
|
||||
# Unset root so we can check later
|
||||
unset root
|
||||
|
||||
@@ -56,22 +59,8 @@ else
|
||||
rootok="1"
|
||||
fi
|
||||
|
||||
# Check: do we really know how to handle (net)root?
|
||||
[ -z "$root" ] && die "No or empty root= argument"
|
||||
[ -z "$rootok" ] && die "Don't know how to handle 'root=$root'"
|
||||
|
||||
handler=${netroot%%:*}
|
||||
handler=${handler%%4}
|
||||
handler="/sbin/${handler}root"
|
||||
if [ -z "$netroot" ] || [ ! -e "$handler" ] ; then
|
||||
die "No handler for netroot type '$netroot'"
|
||||
fi
|
||||
|
||||
# We're here, so we can assume that upping interfaces is now ok
|
||||
[ -z "$IFACES" ] && IFACES="$netif"
|
||||
for iface in $IFACES ; do
|
||||
. /tmp/net.$iface.up
|
||||
done
|
||||
|
||||
[ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw
|
||||
[ -e /tmp/net.$netif.hostname ] && . /tmp/net.$netif.hostname
|
||||
@@ -96,8 +85,20 @@ if [ -z "$dest" ] ; then
|
||||
[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*) dest=$dummy;;
|
||||
esac
|
||||
fi
|
||||
if [ -n "$dest" ] && ! arping -q -f -w 60 -I $netif $dest ; then
|
||||
die "Resolving $dest via ARP on $netif failed"
|
||||
[ -n "$dest" ] && arping -q -f -w 60 -I $netif $dest
|
||||
|
||||
[ -d $NEWROOT/proc ] && exit 0
|
||||
[ -z "$netroot" ] && exit 1
|
||||
|
||||
# Check: do we really know how to handle (net)root?
|
||||
[ -z "$root" ] && die "No or empty root= argument"
|
||||
[ -z "$rootok" ] && die "Don't know how to handle 'root=$root'"
|
||||
|
||||
handler=${netroot%%:*}
|
||||
handler=${handler%%4}
|
||||
handler="/sbin/${handler}root"
|
||||
if [ -z "$netroot" ] || [ ! -e "$handler" ] ; then
|
||||
die "No handler for netroot type '$netroot'"
|
||||
fi
|
||||
|
||||
# Source netroot hooks before we start the handler
|
||||
@@ -108,20 +109,20 @@ source_all netroot
|
||||
if $handler $netif $netroot $NEWROOT; then
|
||||
# Network rootfs mount successful
|
||||
for iface in $IFACES ; do
|
||||
[ -f /tmp/dhclient.$iface.lease ] && cp /tmp/dhclient.$iface.lease /tmp/net.$iface.lease
|
||||
[ -f /tmp/dhclient.$iface.dhcpopts ] && cp /tmp/dhclient.$iface.dhcpopts /tmp/net.$iface.dhcpopts
|
||||
[ -s /tmp/dhclient.$iface.lease ] && cp /tmp/dhclient.$iface.lease /tmp/net.$iface.lease
|
||||
[ -s /tmp/dhclient.$iface.dhcpopts ] && cp /tmp/dhclient.$iface.dhcpopts /tmp/net.$iface.dhcpopts
|
||||
done
|
||||
|
||||
# Save used netif for later use
|
||||
[ ! -f /tmp/net.ifaces ] && echo $netif > /tmp/net.ifaces
|
||||
else
|
||||
warn "Mounting root via '$netif' failed"
|
||||
echo $netif >> /tmp/net.ifaces
|
||||
#else
|
||||
# warn "Mounting root via '$netif' failed"
|
||||
# If we're trying with multiple interfaces, put that one down.
|
||||
# ip down/flush ensures that routeing info goes away as well
|
||||
if [ -z "$BOOTDEV" ] ; then
|
||||
ip link set $netif down
|
||||
ip addr flush dev $netif
|
||||
echo "#empty" > /etc/resolv.conf
|
||||
fi
|
||||
# if [ -z "$BOOTDEV" ] ; then
|
||||
# ip link set $netif down
|
||||
# ip addr flush dev $netif
|
||||
# echo "#empty" > /etc/resolv.conf
|
||||
# fi
|
||||
fi
|
||||
exit 0
|
||||
|
63
modules.d/40network/parse-bond.sh
Executable file
63
modules.d/40network/parse-bond.sh
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Format:
|
||||
# bond=<bondname>[:<bondslaves>:[:<options>]]
|
||||
#
|
||||
# bondslaves is a comma-separated list of physical (ethernet) interfaces
|
||||
# options is a comma-separated list on bonding options (modinfo bonding for details) in format compatible with initscripts
|
||||
# if options include multi-valued arp_ip_target option, then its values should be separated by semicolon.
|
||||
#
|
||||
# bond without parameters assumes bond=bond0:eth0,eth1:mode=balance-rr
|
||||
#
|
||||
|
||||
# return if bond already parsed
|
||||
[ -n "$bondname" ] && return
|
||||
|
||||
# Check if bond parameter is valid
|
||||
if getarg bond= >/dev/null ; then
|
||||
if [ -z "$netroot" ] ; then
|
||||
die "No netboot configured, bond is invalid"
|
||||
fi
|
||||
fi
|
||||
|
||||
# We translate list of slaves to space-separated here to mwke it easier to loop over them in ifup
|
||||
# Ditto for bonding options
|
||||
parsebond() {
|
||||
local v=${1}:
|
||||
set --
|
||||
while [ -n "$v" ]; do
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
done
|
||||
|
||||
unset bondname bondslaves bondoptions
|
||||
case $# in
|
||||
0) bondname=bond0; bondslaves="eth0 eth1" ;;
|
||||
1) bondname=$1; bondslaves="eth0 eth1" ;;
|
||||
2) bondname=$1; bondslaves=$(echo $2|tr "," " ") ;;
|
||||
3) bondname=$1; bondslaves=$(echo $2|tr "," " "); bondoptions=$(echo $3|tr "," " ") ;;
|
||||
*) die "bond= requires zero to four parameters" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
unset bondname bondslaves bondoptions
|
||||
|
||||
# Parse bond for bondname, bondslaves, bondmode and bondoptions
|
||||
if getarg bond >/dev/null; then
|
||||
# Read bond= parameters if they exist
|
||||
bond="$(getarg bond=)"
|
||||
if [ ! "$bond" = "bond" ]; then
|
||||
parsebond "$(getarg bond=)"
|
||||
fi
|
||||
# Simple default bond
|
||||
if [ -z "$bondname" ]; then
|
||||
bondname=bond0
|
||||
bondslaves="eth0 eth1"
|
||||
fi
|
||||
# Make it suitable for initscripts export
|
||||
bondoptions=$(echo $bondoptions|tr ";" ",")
|
||||
echo "bondname=$bondname" > /tmp/bond.info
|
||||
echo "bondslaves=\"$bondslaves\"" >> /tmp/bond.info
|
||||
echo "bondoptions=\"$bondoptions\"" >> /tmp/bond.info
|
||||
return
|
||||
fi
|
@@ -26,26 +26,34 @@ parsebridge() {
|
||||
|
||||
unset bridgename ethname
|
||||
case $# in
|
||||
0) bridgename=br0; ethname=eth0 ;;
|
||||
1) die "bridge= requires two parameters" ;;
|
||||
2) bridgename=$1; ethname=$2 ;;
|
||||
*) die "bridge= requires two parameters" ;;
|
||||
0) bridgename=br0; ethname=$iface ;;
|
||||
1) die "bridge= requires two parameters" ;;
|
||||
2) bridgename=$1; ethname=$2 ;;
|
||||
*) die "bridge= requires two parameters" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
unset bridgename ethname
|
||||
|
||||
iface=eth0
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
if [ -n "$bondname" ] ; then
|
||||
iface=$bondname
|
||||
fi
|
||||
fi
|
||||
|
||||
# Parse bridge for bridgename and ethname
|
||||
if getarg bridge >/dev/null; then
|
||||
# Read bridge= parameters if they exist
|
||||
bridge="$(getarg bridge=)"
|
||||
if [ ! "$bridge" = "bridge" ]; then
|
||||
if [ ! "$bridge" = "bridge" ]; then
|
||||
parsebridge "$(getarg bridge=)"
|
||||
fi
|
||||
# Simple default bridge
|
||||
if [ -z "$bridgename" ]; then
|
||||
bridgename=br0
|
||||
ethname=eth0
|
||||
ethname=$iface
|
||||
fi
|
||||
echo "bridgename=$bridgename" > /tmp/bridge.info
|
||||
echo "ethname=$ethname" >> /tmp/bridge.info
|
||||
|
85
modules.d/40network/parse-ibft.sh
Executable file
85
modules.d/40network/parse-ibft.sh
Executable file
@@ -0,0 +1,85 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
for p in $(getargs ip=); do
|
||||
[ "ibft" = "$p" ] || continue
|
||||
|
||||
modprobe iscsi_ibft
|
||||
num=0
|
||||
(
|
||||
for iface in /sys/firmware/ibft/ethernet*; do
|
||||
unset ifname_mac
|
||||
unset ifname_if
|
||||
unset dhcp
|
||||
unset ip
|
||||
unset gw
|
||||
unset mask
|
||||
unset hostname
|
||||
unset vlan
|
||||
unset dns1
|
||||
unset dns2
|
||||
[ -e ${iface}/mac ] || continue
|
||||
ifname_mac=$(read a < ${iface}/mac; echo $a)
|
||||
[ -z "$ifname_mac" ] && continue
|
||||
unset dev
|
||||
for ifname in $(getargs ifname=); do
|
||||
if strstr "$ifname" "$ifname_mac"; then
|
||||
dev=${ifname%%:*}
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "$dev" ]; then
|
||||
ifname_if=ibft$num
|
||||
num=$(( $num + 1 ))
|
||||
echo "ifname=$ifname_if:$ifname_mac"
|
||||
dev=$ifname_if
|
||||
fi
|
||||
|
||||
if [ -e ${iface}/vlan ]; then
|
||||
vlan=$(read a < ${iface}/vlan; echo $a)
|
||||
if [ "$vlan" -ne "0" ]; then
|
||||
case "$vlan" in
|
||||
[0-9]*)
|
||||
[ -e /tmp/net.${dev}.${vlan}.has_ibft_config ] && continue
|
||||
echo "vlan=$dev.$vlan:$dev"
|
||||
dev="${dev}.${vlan}"
|
||||
;;
|
||||
*)
|
||||
[ -e /tmp/net.${vlan}.has_ibft_config ] && continue
|
||||
echo "vlan=$vlan:$dev"
|
||||
dev="${vlan}"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
[ -e /tmp/net.${dev}.has_ibft_config ] && continue
|
||||
|
||||
[ -e ${iface}/dhcp ] && dhcp=$(read a < ${iface}/dhcp; echo $a)
|
||||
|
||||
if [ -n "$dhcp" ]; then
|
||||
echo "ip=$dev:dhcp"
|
||||
else
|
||||
[ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a)
|
||||
[ "$ip" = "0.0.0.0" ] && unset ip
|
||||
[ -e ${iface}/gateway ] && gw=$(read a < ${iface}/gateway; echo $a)
|
||||
[ -e ${iface}/subnet-mask ] && mask=$(read a < ${iface}/subnet-mask; echo $a)
|
||||
[ -e ${iface}/hostname ] && hostname=$(read a < ${iface}/hostname; echo $a)
|
||||
[ -n "$ip" ] && echo "ip=$ip::$gw:$mask:$hostname:$dev:none"
|
||||
|
||||
[ -e ${iface}/primary-dns ] && dns1=$(read a < ${iface}/primary-dns; echo $a) \
|
||||
&& echo "nameserver=${dns1}"
|
||||
[ -e ${iface}/secondary-dns ] && dns2=$(read a < ${iface}/secondary-dns; echo $a) \
|
||||
&& echo "nameserver=${dns2}"
|
||||
fi
|
||||
|
||||
echo $mac > /tmp/net.${dev}.has_ibft_config
|
||||
done
|
||||
) >> /etc/cmdline
|
||||
# reread cmdline
|
||||
unset CMDLINE
|
||||
done
|
@@ -3,7 +3,6 @@
|
||||
# Format:
|
||||
# ifname=<interface>:<mac>
|
||||
#
|
||||
# Note letters in the macaddress must be lowercase!
|
||||
#
|
||||
# Examples:
|
||||
# ifname=eth0:4a:3f:4c:04:f8:d7
|
||||
@@ -11,11 +10,6 @@
|
||||
# Note when using ifname= to get persistent interface names, you must specify
|
||||
# an ifname= argument for each interface used in an ip= or fcoe= argument
|
||||
|
||||
# check if there are any ifname parameters
|
||||
if ! getarg ifname= >/dev/null ; then
|
||||
return
|
||||
fi
|
||||
|
||||
parse_ifname_opts() {
|
||||
local IFS=:
|
||||
set $1
|
||||
@@ -23,7 +17,8 @@ parse_ifname_opts() {
|
||||
case $# in
|
||||
7)
|
||||
ifname_if=$1
|
||||
ifname_mac=$2:$3:$4:$5:$6:$7
|
||||
# udev requires MAC addresses to be lower case
|
||||
ifname_mac=$(echo $2:$3:$4:$5:$6:$7 | tr '[:upper:]' '[:lower:]')
|
||||
;;
|
||||
*)
|
||||
die "Invalid arguments for ifname="
|
||||
@@ -31,6 +26,11 @@ parse_ifname_opts() {
|
||||
esac
|
||||
}
|
||||
|
||||
# check if there are any ifname parameters
|
||||
if ! getarg ifname= >/dev/null ; then
|
||||
return
|
||||
fi
|
||||
|
||||
# Check ifname= lines
|
||||
for p in $(getargs ifname=); do
|
||||
parse_ifname_opts $p
|
||||
|
@@ -1,4 +1,6 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Format:
|
||||
# ip=[dhcp|on|any]
|
||||
@@ -12,23 +14,7 @@
|
||||
# routing,dns,dhcp-options,etc.
|
||||
#
|
||||
|
||||
# Sadly there's no easy way to split ':' separated lines into variables
|
||||
ip_to_var() {
|
||||
local v=${1}:
|
||||
set --
|
||||
while [ -n "$v" ]; do
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
done
|
||||
|
||||
unset ip srv gw mask hostname dev autoconf
|
||||
case $# in
|
||||
0) autoconf="error" ;;
|
||||
1) autoconf=$1 ;;
|
||||
2) dev=$1; autoconf=$2 ;;
|
||||
*) ip=$1; srv=$2; gw=$3; mask=$4; hostname=$5; dev=$6; autoconf=$7 ;;
|
||||
esac
|
||||
}
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
# Check if ip= lines should be used
|
||||
if getarg ip= >/dev/null ; then
|
||||
@@ -51,18 +37,21 @@ if [ -n "$netroot" ] && [ -z "$(getarg ip=)" ] ; then
|
||||
fi
|
||||
|
||||
# Count ip= lines to decide whether we need bootdev= or not
|
||||
if [ -z "$NEEDBOOTDEV" ] ; then
|
||||
local count=0
|
||||
for p in $(getargs ip=); do
|
||||
count=$(( $count + 1 ))
|
||||
done
|
||||
[ $count -gt 1 ] && NEEDBOOTDEV=1
|
||||
if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ]; then
|
||||
if [ -z "$NEEDBOOTDEV" ] ; then
|
||||
local count=0
|
||||
for p in $(getargs ip=); do
|
||||
count=$(( $count + 1 ))
|
||||
done
|
||||
[ $count -gt 1 ] && NEEDBOOTDEV=1
|
||||
fi
|
||||
fi
|
||||
|
||||
# If needed, check if bootdev= contains anything usable
|
||||
BOOTDEV=$(getarg bootdev=)
|
||||
|
||||
if [ -n "$NEEDBOOTDEV" ] ; then
|
||||
BOOTDEV=$(getarg bootdev=) || die "Please supply bootdev argument for multiple ip= lines"
|
||||
[ -z "$BOOTDEV" ] && die "Bootdev argument is empty"
|
||||
[ -z "$BOOTDEV" ] && warn "Please supply bootdev argument for multiple ip= lines"
|
||||
fi
|
||||
|
||||
# Check ip= lines
|
||||
@@ -70,6 +59,9 @@ fi
|
||||
for p in $(getargs ip=); do
|
||||
ip_to_var $p
|
||||
|
||||
# skip ibft
|
||||
[ "$autoconf" = "ibft" ] && continue
|
||||
|
||||
# We need to have an ip= line for the specified bootdev
|
||||
[ -n "$NEEDBOOTDEV" ] && [ "$dev" = "$BOOTDEV" ] && BOOTDEVOK=1
|
||||
|
||||
@@ -78,40 +70,44 @@ for p in $(getargs ip=); do
|
||||
warn "Empty autoconf values default to dhcp"
|
||||
autoconf="dhcp"
|
||||
fi
|
||||
|
||||
# Error checking for autoconf in combination with other values
|
||||
case $autoconf in
|
||||
error) die "Error parsing option 'ip=$p'";;
|
||||
bootp|rarp|both) die "Sorry, ip=$autoconf is currenty unsupported";;
|
||||
none|off) \
|
||||
[ -z "$ip" ] && \
|
||||
OLDIFS="$IFS"
|
||||
IFS=,
|
||||
set -- $autoconf
|
||||
IFS="$OLDIFS"
|
||||
for autoconf in "$@"; do
|
||||
# Error checking for autoconf in combination with other values
|
||||
case $autoconf in
|
||||
error) die "Error parsing option 'ip=$p'";;
|
||||
bootp|rarp|both) die "Sorry, ip=$autoconf is currenty unsupported";;
|
||||
none|off) \
|
||||
[ -z "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nValue '$autoconf' without static configuration does not make sense"
|
||||
[ -z "$mask" ] && \
|
||||
die "Sorry, automatic calculation of netmask is not yet supported"
|
||||
;;
|
||||
dhcp|on|any) \
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
|
||||
[ -z "$mask" ] && \
|
||||
die "Sorry, automatic calculation of netmask is not yet supported"
|
||||
;;
|
||||
auto6);;
|
||||
dhcp|dhcp6|on|any) \
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
|
||||
die "Sorry, 'ip=$p' does not make sense for multiple interface configurations"
|
||||
[ -n "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoconf'"
|
||||
;;
|
||||
*) die "For argument 'ip=$p'\nSorry, unknown value '$autoconf'";;
|
||||
esac
|
||||
[ -n "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoconf'"
|
||||
;;
|
||||
*) die "For argument 'ip=$p'\nSorry, unknown value '$autoconf'";;
|
||||
esac
|
||||
_part=${_part%,*}
|
||||
done
|
||||
|
||||
if [ -n "$dev" ] ; then
|
||||
# We don't like duplicate device configs
|
||||
if [ -n "$IFACES" ] ; then
|
||||
for i in $IFACES ; do
|
||||
[ "$dev" = "$i" ] && die "For argument 'ip=$p'\nDuplication configurations for '$dev'"
|
||||
[ "$dev" = "$i" ] && warn "For argument 'ip=$p'\nDuplication configurations for '$dev'"
|
||||
done
|
||||
fi
|
||||
# IFACES list for later use
|
||||
IFACES="$IFACES $dev"
|
||||
fi
|
||||
|
||||
# Small optimization for udev rules
|
||||
[ -z "$NEEDBOOTDEV" ] && [ -n "$dev" ] && BOOTDEV=$dev
|
||||
|
||||
# Do we need to check for specific options?
|
||||
if [ -n "$NEEDDHCP" ] || [ -n "$DHCPORSERVER" ] ; then
|
||||
# Correct device? (Empty is ok as well)
|
||||
|
32
modules.d/40network/parse-vlan.sh
Executable file
32
modules.d/40network/parse-vlan.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Format:
|
||||
# vlan=<vlanname>:<phydevice>
|
||||
#
|
||||
|
||||
parsevlan() {
|
||||
local v=${1}:
|
||||
set --
|
||||
while [ -n "$v" ]; do
|
||||
set -- "$@" "${v%%:*}"
|
||||
v=${v#*:}
|
||||
done
|
||||
|
||||
case $# in
|
||||
2) vlanname=$1; phydevice=$2 ; return 0 ;;
|
||||
*) die "vlan= requires two parameters" ;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
unset vlanname phydevice
|
||||
|
||||
for vlan in $(getargs vlan); do
|
||||
[ "$vlan" = "vlan" ] && continue
|
||||
unset vlanname phydevice
|
||||
if parsevlan "$(getarg vlan=)"; then
|
||||
echo "$phydevice" > /tmp/vlan.${phydevice}.phy
|
||||
echo "$phydevice" >> /tmp/net.ifaces
|
||||
echo "$vlanname" > /tmp/vlan.${vlanname}.${phydevice}
|
||||
fi
|
||||
done
|
4
modules.d/45ifcfg/check
Normal file → Executable file
4
modules.d/45ifcfg/check
Normal file → Executable file
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
[ -d /etc/sysconfig/network-scripts/ ] || exit 1
|
||||
|
||||
[[ $1 = -d ]] && echo network
|
||||
# ifcfg is required by network
|
||||
#[[ $1 = -d ]] && echo network
|
||||
|
||||
exit 255
|
||||
|
0
modules.d/45ifcfg/install
Normal file → Executable file
0
modules.d/45ifcfg/install
Normal file → Executable file
@@ -1,4 +1,6 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
# NFS root might have reached here before /tmp/net.ifaces was written
|
||||
udevadm settle --timeout=30
|
||||
@@ -7,47 +9,153 @@ udevadm settle --timeout=30
|
||||
|
||||
read IFACES < /tmp/net.ifaces
|
||||
|
||||
if [ -e /tmp/bond.info ]; then
|
||||
. /tmp/bond.info
|
||||
fi
|
||||
|
||||
if [ -e /tmp/bridge.info ]; then
|
||||
. /tmp/bridge.info
|
||||
fi
|
||||
|
||||
mkdir -p /tmp/ifcfg/
|
||||
|
||||
for netif in $IFACES ; do
|
||||
mkdir -p /tmp/ifcfg/
|
||||
# bridge?
|
||||
unset bridge
|
||||
unset bond
|
||||
unset vlan
|
||||
unset phydevice
|
||||
unset vlanname
|
||||
unset uuid
|
||||
unset ip
|
||||
unset gw
|
||||
unset mtu
|
||||
unset mask
|
||||
unset macaddr
|
||||
|
||||
# bridge?
|
||||
if [ "$netif" = "$bridgename" ]; then
|
||||
bridge=yes
|
||||
fi
|
||||
cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr
|
||||
echo "# Generated by dracut initrd" > /tmp/ifcfg/ifcfg-$netif
|
||||
echo "DEVICE=$netif" >> /tmp/ifcfg/ifcfg-$netif
|
||||
echo "ONBOOT=yes" >> /tmp/ifcfg/ifcfg-$netif
|
||||
echo "NETBOOT=yes" >> /tmp/ifcfg/ifcfg-$netif
|
||||
if [ -f /tmp/net.$netif.lease ]; then
|
||||
echo "BOOTPROTO=dhcp" >> /tmp/ifcfg/ifcfg-$netif
|
||||
else
|
||||
echo "BOOTPROTO=none" >> /tmp/ifcfg/ifcfg-$netif
|
||||
# If we've booted with static ip= lines, the override file is there
|
||||
. /tmp/net.$netif.override
|
||||
echo "IPADDR=$ip" >> /tmp/ifcfg/ifcfg-$netif
|
||||
echo "NETMASK=$mask" >> /tmp/ifcfg/ifcfg-$netif
|
||||
[ -n "$gw" ] && echo "GATEWAY=$gw" >> /tmp/ifcfg/ifcfg-$netif
|
||||
elif [ "$netif" = "$bondname" ]; then
|
||||
# $netif can't be bridge and bond at the same time
|
||||
bond=yes
|
||||
fi
|
||||
|
||||
for i in /tmp/vlan.${netif}.*; do
|
||||
[ ! -e "$i" ] && continue
|
||||
. "$i"
|
||||
vlan=yes
|
||||
break
|
||||
done
|
||||
|
||||
cat /sys/class/net/$netif/address > /tmp/net.${netif}.hwaddr
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$netif"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
if [ -f /tmp/dhclient.${netif}.dhcpopts ]; then
|
||||
strstr "$ip" '*:*:*' && echo "DHCPV6C=yes"
|
||||
echo "BOOTPROTO=dhcp"
|
||||
[ -f /tmp/dhclient.${netif}.lease ] && cp /tmp/dhclient.${netif}.lease /tmp/net.${netif}.lease
|
||||
[ -f /tmp/dhclient.${netif}.dhcpopts ] && cp /tmp/dhclient.${netif}.dhcpopts /tmp/net.${netif}.dhcpopts
|
||||
else
|
||||
echo "BOOTPROTO=none"
|
||||
# If we've booted with static ip= lines, the override file is there
|
||||
[ -e /tmp/net.${netif}.override ] && . /tmp/net.${netif}.override
|
||||
echo "IPADDR=$ip"
|
||||
echo "NETMASK=$mask"
|
||||
[ -n "$gw" ] && echo "GATEWAY=$gw"
|
||||
fi
|
||||
} > /tmp/ifcfg/ifcfg-$netif
|
||||
|
||||
# bridge needs different things written to ifcfg
|
||||
if [ -z "$bridge" ]; then
|
||||
if [ -z "$bridge" ] && [ -z "$bond" ] && [ -z "$vlan" ]; then
|
||||
# standard interface
|
||||
echo "HWADDR=$(cat /sys/class/net/$netif/address)" >> /tmp/ifcfg/ifcfg-$netif
|
||||
echo "TYPE=Ethernet" >> /tmp/ifcfg/ifcfg-$netif
|
||||
echo "NAME=\"Boot Disk\"" >> /tmp/ifcfg/ifcfg-$netif
|
||||
else
|
||||
{
|
||||
echo "HWADDR=$(cat /sys/class/net/$netif/address)"
|
||||
echo "TYPE=Ethernet"
|
||||
echo "NAME=\"Boot Disk\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
fi
|
||||
|
||||
if [ -n "$vlan" ] ; then
|
||||
{
|
||||
echo "TYPE=Vlan"
|
||||
echo "NAME=\"$netif\""
|
||||
echo "VLAN=yes"
|
||||
echo "PHYSDEV=\"$phydevice\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
fi
|
||||
|
||||
if [ -n "$bond" ] ; then
|
||||
# bond interface
|
||||
{
|
||||
# This variable is an indicator of a bond interface for initscripts
|
||||
echo "BONDING_OPTS=\"$bondoptions\""
|
||||
echo "NAME=\"Boot Disk\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
|
||||
for slave in $bondslaves ; do
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$slave"
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "HWADDR=$(cat /sys/class/net/$slave/address)"
|
||||
echo "SLAVE=yes"
|
||||
echo "MASTER=$netif"
|
||||
echo "NAME=$slave"
|
||||
} >> /tmp/ifcfg/ifcfg-$slave
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -n "$bridge" ] ; then
|
||||
# bridge
|
||||
echo "TYPE=Bridge" >> /tmp/ifcfg/ifcfg-$netif
|
||||
echo "NAME=\"Boot Disk\"" >> /tmp/ifcfg/ifcfg-$netif
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
echo "DEVICE=$ethname" >> /tmp/ifcfg/ifcfg-$ethname
|
||||
echo "TYPE=Ethernet" >> /tmp/ifcfg/ifcfg-$ethname
|
||||
echo "ONBOOT=yes" >> /tmp/ifcfg/ifcfg-$ethname
|
||||
echo "NETBOOT=yes" >> /tmp/ifcfg/ifcfg-$ethname
|
||||
echo "HWADDR=$(cat /sys/class/net/$ethname/address)" >> /tmp/ifcfg/ifcfg-$ethname
|
||||
echo "BRIDGE=$netif" >> /tmp/ifcfg/ifcfg-$ethname
|
||||
echo "NAME=$ethname" >> /tmp/ifcfg/ifcfg-$ethname
|
||||
{
|
||||
echo "TYPE=Bridge"
|
||||
echo "NAME=\"Boot Disk\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
if [ "$ethname" = "$bondname" ] ; then
|
||||
{
|
||||
# This variable is an indicator of a bond interface for initscripts
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$bondname"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "BONDING_OPTS=\"$bondoptions\""
|
||||
echo "BRIDGE=$netif"
|
||||
echo "NAME=\"$bondname\""
|
||||
} >> /tmp/ifcfg/ifcfg-$bondname
|
||||
for slave in $bondslaves ; do
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
# yes, duplicated code at this moment
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$slave"
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "HWADDR=$(cat /sys/class/net/$slave/address)"
|
||||
echo "SLAVE=yes"
|
||||
echo "MASTER=$bondname"
|
||||
echo "NAME=$slave"
|
||||
} >> /tmp/ifcfg/ifcfg-$slave
|
||||
done
|
||||
else
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=$ethname"
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "HWADDR=$(cat /sys/class/net/$ethname/address)"
|
||||
echo "BRIDGE=$netif"
|
||||
echo "NAME=$ethname"
|
||||
} >> /tmp/ifcfg/ifcfg-$ethname
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
@@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
[[ $1 = -d ]] && echo crypt
|
||||
[[ $1 = -d ]] && which cryptsetup &>/dev/null && echo crypt
|
||||
[[ -x /sbin/plymouthd && -x /bin/plymouth && -x /usr/sbin/plymouth-set-default-theme ]]
|
||||
|
@@ -1,83 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# do not ask, if we already have root
|
||||
[ -f /sysroot/proc ] && exit 0
|
||||
|
||||
# check if destination already exists
|
||||
[ -b /dev/mapper/$2 ] && exit 0
|
||||
|
||||
# we already asked for this device
|
||||
[ -f /tmp/cryptroot-asked-$2 ] && exit 0
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
# default luksname - luks-UUID
|
||||
luksname=$2
|
||||
|
||||
# if device name is /dev/dm-X, convert to /dev/mapper/name
|
||||
if [ "${1##/dev/dm-}" != "$1" ]; then
|
||||
device="/dev/mapper/$(dmsetup info -c --noheadings -o name "$1")"
|
||||
else
|
||||
device="$1"
|
||||
fi
|
||||
|
||||
if [ -f /etc/crypttab ] && ! getargs rd_NO_CRYPTTAB; then
|
||||
while read name dev rest; do
|
||||
# ignore blank lines and comments
|
||||
if [ -z "$name" -o "${name#\#}" != "$name" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# UUID used in crypttab
|
||||
if [ "${dev%%=*}" = "UUID" ]; then
|
||||
if [ "luks-${dev##UUID=}" = "$2" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
|
||||
# path used in crypttab
|
||||
else
|
||||
cdev=$(readlink -f $dev)
|
||||
mdev=$(readlink -f $device)
|
||||
if [ "$cdev" = "$mdev" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done < /etc/crypttab
|
||||
unset name dev rest
|
||||
fi
|
||||
|
||||
LUKS=$(getargs rd_LUKS_UUID=)
|
||||
ask=1
|
||||
if [ -n "$LUKS" ]; then
|
||||
ask=0
|
||||
luuid=${2##luks-}
|
||||
for luks in $LUKS; do
|
||||
luks=${luks##luks-}
|
||||
if [ "${luuid##$luks}" != "$luuid" ] || [ "$luksname" = "$luks" ]; then
|
||||
ask=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
unset LUKS luks luuid
|
||||
|
||||
if [ $ask -gt 0 ]; then
|
||||
info "luksOpen $device $luksname"
|
||||
# flock against other interactive activities
|
||||
{ flock -s 9;
|
||||
/bin/plymouth ask-for-password \
|
||||
--prompt "$device ($luksname) is password protected" \
|
||||
--command="/sbin/cryptsetup luksOpen -T1 $device $luksname"
|
||||
} 9>/.console.lock
|
||||
fi
|
||||
unset ask device luksname
|
||||
|
||||
# mark device as asked
|
||||
>> /tmp/cryptroot-asked-$2
|
||||
|
||||
udevsettle
|
||||
|
||||
exit 0
|
||||
# vim:ts=8:sw=4:sts=4:et
|
@@ -11,6 +11,5 @@ fi
|
||||
|
||||
inst_hook pre-pivot 90 "$moddir"/plymouth-newroot.sh
|
||||
inst_hook pre-trigger 10 "$moddir"/plymouth-pretrigger.sh
|
||||
inst_hook emergency 50 "$moddir"/plymouth-emergency.sh
|
||||
inst "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask
|
||||
inst readlink
|
||||
inst_hook emergency 00 "$moddir"/plymouth-emergency.sh
|
||||
inst readlink
|
||||
|
@@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
# Include KMS capable drm drivers
|
||||
for modname in $(find "$srcmods/kernel/drivers/gpu/drm" -name '*.ko' 2>/dev/null); do
|
||||
nm -uPA $modname | grep -q drm_crtc_init && instmods $modname
|
||||
grep -q drm_crtc_init $modname && instmods $modname
|
||||
done
|
||||
|
||||
hostonly='' instmods hyperv_fb
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
if ldd /sbin/plymouthd |grep -q lib64; then
|
||||
if ldd /sbin/plymouthd 2>/dev/null | grep -q lib64; then
|
||||
LIBDIR="/usr/lib64"
|
||||
else
|
||||
LIBDIR="/usr/lib"
|
||||
@@ -30,7 +30,7 @@ if [[ $hostonly ]]; then
|
||||
if [ -L /usr/share/plymouth/themes/default.plymouth ]; then
|
||||
inst /usr/share/plymouth/themes/default.plymouth
|
||||
# Install plugin for this theme
|
||||
PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth |awk -F= {'print $2'})
|
||||
PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth | while read a b c; do echo $b; done;)
|
||||
inst ${LIBDIR}/plymouth/${PLYMOUTH_PLUGIN}.so
|
||||
fi
|
||||
else
|
||||
|
@@ -1,21 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
if ! getarg rd_NO_PLYMOUTH; then
|
||||
[ -c /dev/null ] || mknod /dev/null c 1 3
|
||||
[ -c /dev/null ] || mknod -m 0666 /dev/null c 1 3
|
||||
# first trigger graphics subsystem
|
||||
udevadm trigger --attr-match=class=0x030000 >/dev/null 2>&1
|
||||
# first trigger graphics and tty subsystem
|
||||
udevadm trigger --subsystem-match=graphics --subsystem-match=drm --subsystem-match=tty >/dev/null 2>&1
|
||||
udevadm trigger --subsystem-match=graphics --subsystem-match=drm --subsystem-match=tty --subsystem-match=acpi >/dev/null 2>&1
|
||||
|
||||
udevadm settle --timeout=30 2>&1 | vinfo
|
||||
[ -c /dev/zero ] || mknod /dev/zero c 1 5
|
||||
[ -c /dev/systty ] || mknod /dev/systty c 4 0
|
||||
[ -c /dev/fb ] || mknod /dev/fb c 29 0
|
||||
[ -c /dev/hvc0 ] || mknod /dev/hvc0 c 229 0
|
||||
udevadm settle --timeout=30 >/dev/null 2>&1
|
||||
[ -c /dev/zero ] || mknod -m 0666 /dev/zero c 1 5
|
||||
[ -c /dev/tty0 ] || mknod -m 0620 /dev/tty0 c 4 0
|
||||
[ -e /dev/systty ] || ln -s tty0 /dev/systty
|
||||
[ -c /dev/fb0 ] || mknod -m 0660 /dev/fb0 c 29 0
|
||||
[ -e /dev/fb ] || ln -s fb0 /dev/fb
|
||||
[ -c /dev/hvc0 ] || mknod -m 0600 /dev/hvc0 c 229 0
|
||||
|
||||
info "Starting plymouth daemon"
|
||||
consoledev=$(getarg console= | sed -e 's/,.*//')
|
||||
consoledev=${consoledev:-tty0}
|
||||
[ -x /lib/udev/console_init ] && /lib/udev/console_init "/dev/$consoledev"
|
||||
|
||||
[ -x /bin/plymouthd ] && /bin/plymouthd --attach-to-session
|
||||
/lib/udev/console_init tty0
|
||||
/bin/plymouth --show-splash 2>&1 | vinfo
|
||||
fi
|
||||
|
||||
|
6
modules.d/60xen/check
Normal file → Executable file
6
modules.d/60xen/check
Normal file → Executable file
@@ -1,12 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# No Xen-detect? Boo!!
|
||||
which xen-detect >/dev/null 2>&1 || exit 1
|
||||
XENDETECT=$(which xen-detect 2>/dev/null)
|
||||
[ -z "$XENDETECT" ] && [ -d "/usr/lib/xen-default" ] && XENDETECT="/usr/lib/xen-default/bin/xen-detect"
|
||||
[ -z "$XENDETECT" ] && exit 1
|
||||
|
||||
. $dracutfunctions
|
||||
[[ $debug ]] && set -x
|
||||
|
||||
# Yes, we are under Xen PV env.
|
||||
xen-detect | egrep -q -v 'PV' || exit 0
|
||||
$XENDETECT | egrep -q -v 'PV' || exit 0
|
||||
|
||||
exit 1
|
||||
|
4
modules.d/60xen/install
Normal file → Executable file
4
modules.d/60xen/install
Normal file → Executable file
@@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
inst xen-detect
|
||||
XENDETECT=$(which xen-detect)
|
||||
[ -z "$XENDETECT" ] && [ -d "/usr/lib/xen-default" ] && XENDETECT="/usr/lib/xen-default/bin/xen-detect"
|
||||
inst $XENDETECT /sbin/xen-detect
|
||||
inst_hook pre-udev 40 "$moddir/xen-pre-udev.sh"
|
||||
|
||||
|
8
modules.d/90btrfs/40-btrfs.rules
Normal file
8
modules.d/90btrfs/40-btrfs.rules
Normal file
@@ -0,0 +1,8 @@
|
||||
SUBSYSTEM!="block", GOTO="btrfs_end"
|
||||
ACTION!="add|change", GOTO="btrfs_end"
|
||||
|
||||
ENV{ID_FS_TYPE}=="btrfs", RUN+="/sbin/modprobe btrfs"
|
||||
ENV{ID_FS_TYPE}=="btrfs", RUN+="/sbin/btrfsctl -A $env{DEVNAME}"
|
||||
|
||||
LABEL="btrfs_end"
|
||||
|
10
modules.d/90btrfs/check
Executable file
10
modules.d/90btrfs/check
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
# We depend on udev-rules being loaded
|
||||
[ "$1" = "-d" ] && exit 0
|
||||
|
||||
# if we don't have btrfs (btrfsctl) installed on the host system,
|
||||
# no point in trying to support it in the initramfs.
|
||||
which btrfsctl >/dev/null 2>&1 || exit 1
|
||||
|
||||
exit 0
|
4
modules.d/90btrfs/install
Executable file
4
modules.d/90btrfs/install
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
inst_rules "$moddir/40-btrfs.rules"
|
||||
dracut_install btrfsctl
|
@@ -1,12 +0,0 @@
|
||||
# hacky rules to try to try unlocking dm-crypt devs
|
||||
#
|
||||
# Copyright 2008, Red Hat, Inc.
|
||||
# Jeremy Katz <katzj@redhat.com>
|
||||
|
||||
|
||||
SUBSYSTEM!="block", GOTO="luks_end"
|
||||
ACTION!="add|change", GOTO="luks_end"
|
||||
|
||||
ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/initqueue --unique --onetime --name cryptroot-ask-%k /sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"
|
||||
|
||||
LABEL="luks_end"
|
@@ -19,7 +19,7 @@ is_crypt() { [[ $(get_fs_type /dev/block/$1) = crypto_LUKS ]]; }
|
||||
check_block_and_slaves is_crypt "$rootdev" || exit 1
|
||||
else
|
||||
# root is not on a block device, use the shotgun approach
|
||||
blkid | grep -q crypt_LUKS || exit 1
|
||||
blkid | grep -q crypto\?_LUKS || exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
#!/bin/sh
|
||||
# close everything which is not busy
|
||||
rm -f /etc/udev/rules.d/70-luks.rules >/dev/null 2>&1
|
||||
|
||||
for i in /dev/mapper/luks-*; do
|
||||
cryptsetup luksClose $i >/dev/null 2>&1
|
||||
done
|
||||
|
222
modules.d/90crypt/crypt-lib.sh
Normal file
222
modules.d/90crypt/crypt-lib.sh
Normal file
@@ -0,0 +1,222 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
command -v getarg >/dev/null || . /lib/dracut-lib.sh
|
||||
|
||||
# ask_for_password
|
||||
#
|
||||
# Wraps around plymouth ask-for-password and adds fallback to tty password ask
|
||||
# if plymouth is not present.
|
||||
#
|
||||
# --cmd command
|
||||
# Command to execute. Required.
|
||||
# --prompt prompt
|
||||
# Password prompt. Note that function already adds ':' at the end.
|
||||
# Recommended.
|
||||
# --tries n
|
||||
# How many times repeat command on its failure. Default is 3.
|
||||
# --ply-[cmd|prompt|tries]
|
||||
# Command/prompt/tries specific for plymouth password ask only.
|
||||
# --tty-[cmd|prompt|tries]
|
||||
# Command/prompt/tries specific for tty password ask only.
|
||||
# --tty-echo-off
|
||||
# Turn off input echo before tty command is executed and turn on after.
|
||||
# It's useful when password is read from stdin.
|
||||
ask_for_password() {
|
||||
local cmd; local prompt; local tries=3
|
||||
local ply_cmd; local ply_prompt; local ply_tries=3
|
||||
local tty_cmd; local tty_prompt; local tty_tries=3
|
||||
local ret
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--cmd) ply_cmd="$2"; tty_cmd="$2" shift;;
|
||||
--ply-cmd) ply_cmd="$2"; shift;;
|
||||
--tty-cmd) tty_cmd="$2"; shift;;
|
||||
--prompt) ply_prompt="$2"; tty_prompt="$2" shift;;
|
||||
--ply-prompt) ply_prompt="$2"; shift;;
|
||||
--tty-prompt) tty_prompt="$2"; shift;;
|
||||
--tries) ply_tries="$2"; tty_tries="$2"; shift;;
|
||||
--ply-tries) ply_tries="$2"; shift;;
|
||||
--tty-tries) tty_tries="$2"; shift;;
|
||||
--tty-echo-off) tty_echo_off=yes;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
{ flock -s 9;
|
||||
# Prompt for password with plymouth, if installed and running.
|
||||
if [ -x /bin/plymouth ] && /bin/plymouth --ping; then
|
||||
/bin/plymouth ask-for-password \
|
||||
--prompt "$ply_prompt" --number-of-tries=$ply_tries \
|
||||
--command="$ply_cmd"
|
||||
ret=$?
|
||||
else
|
||||
if [ "$tty_echo_off" = yes ]; then
|
||||
stty_orig="$(stty -g)"
|
||||
stty -echo
|
||||
fi
|
||||
|
||||
local i=1
|
||||
while [ $i -le $tty_tries ]; do
|
||||
[ -n "$tty_prompt" ] && \
|
||||
printf "$tty_prompt [$i/$tty_tries]:" >&2
|
||||
eval "$tty_cmd" && ret=0 && break
|
||||
ret=$?
|
||||
i=$(($i+1))
|
||||
[ -n "$tty_prompt" ] && printf '\n' >&2
|
||||
done
|
||||
|
||||
[ "$tty_echo_off" = yes ] && stty $stty_orig
|
||||
fi
|
||||
} 9>/.console_lock
|
||||
|
||||
[ $ret -ne 0 ] && echo "Wrong password" >&2
|
||||
return $ret
|
||||
}
|
||||
|
||||
# Try to mount specified device (by path, by UUID or by label) and check
|
||||
# the path with 'test'.
|
||||
#
|
||||
# example:
|
||||
# test_dev -f LABEL="nice label" /some/file1
|
||||
test_dev() {
|
||||
local test_op=$1; local dev="$2"; local f="$3"
|
||||
local ret=1; local mount_point=$(mkuniqdir /mnt testdev)
|
||||
local path
|
||||
|
||||
[ -n "$dev" -a -n "$*" ] || return 1
|
||||
[ -d "$mount_point" ] || die 'Mount point does not exist!'
|
||||
|
||||
if mount -r "$dev" "$mount_point" >/dev/null 2>&1; then
|
||||
test $test_op "${mount_point}/${f}"
|
||||
ret=$?
|
||||
umount "$mount_point"
|
||||
fi
|
||||
|
||||
rmdir "$mount_point"
|
||||
|
||||
return $ret
|
||||
}
|
||||
|
||||
# Get kernel name for given device. Device may be the name too (then the same
|
||||
# is returned), a symlink (full path), UUID (prefixed with "UUID=") or label
|
||||
# (prefixed with "LABEL="). If just a beginning of the UUID is specified or
|
||||
# even an empty, function prints all device names which UUIDs match - every in
|
||||
# single line.
|
||||
#
|
||||
# NOTICE: The name starts with "/dev/".
|
||||
#
|
||||
# Example:
|
||||
# devnames UUID=123
|
||||
# May print:
|
||||
# /dev/dm-1
|
||||
# /dev/sdb1
|
||||
# /dev/sdf3
|
||||
devnames() {
|
||||
local dev="$1"; local d; local names
|
||||
|
||||
case "$dev" in
|
||||
UUID=*)
|
||||
dev="$(foreach_uuid_until '! blkid -U $___' "${dev#UUID=}")" \
|
||||
&& return 255
|
||||
[ -z "$dev" ] && return 255
|
||||
;;
|
||||
LABEL=*) dev="$(blkid -L "${dev#LABEL=}")" || return 255 ;;
|
||||
/dev/?*) ;;
|
||||
*) return 255 ;;
|
||||
esac
|
||||
|
||||
for d in $dev; do
|
||||
names="$names
|
||||
$(readlink -e -q "$d")" || return 255
|
||||
done
|
||||
|
||||
echo "${names#
|
||||
}"
|
||||
}
|
||||
|
||||
# match_dev devpattern dev
|
||||
#
|
||||
# Returns true if 'dev' matches 'devpattern'. Both 'devpattern' and 'dev' are
|
||||
# expanded to kernel names and then compared. If name of 'dev' is on list of
|
||||
# names of devices matching 'devpattern', the test is positive. 'dev' and
|
||||
# 'devpattern' may be anything which function 'devnames' recognizes.
|
||||
#
|
||||
# If 'devpattern' is empty or '*' then function just returns true.
|
||||
#
|
||||
# Example:
|
||||
# match_dev UUID=123 /dev/dm-1
|
||||
# Returns true if /dev/dm-1 UUID starts with "123".
|
||||
match_dev() {
|
||||
[ -z "$1" -o "$1" = '*' ] && return 0
|
||||
local devlist; local dev
|
||||
|
||||
devlist="$(devnames "$1")" || return 255
|
||||
dev="$(devnames "$2")" || return 255
|
||||
|
||||
strstr "
|
||||
$devlist
|
||||
" "
|
||||
$dev
|
||||
"
|
||||
}
|
||||
|
||||
# getkey keysfile for_dev
|
||||
#
|
||||
# Reads file <keysfile> produced by probe-keydev and looks for first line to
|
||||
# which device <for_dev> matches. The successful result is printed in format
|
||||
# "<keydev>:<keypath>". When nothing found, just false is returned.
|
||||
#
|
||||
# Example:
|
||||
# getkey /tmp/luks.keys /dev/sdb1
|
||||
# May print:
|
||||
# /dev/sdc1:/keys/some.key
|
||||
getkey() {
|
||||
local keys_file="$1"; local for_dev="$2"
|
||||
local luks_dev; local key_dev; local key_path
|
||||
|
||||
[ -z "$keys_file" -o -z "$for_dev" ] && die 'getkey: wrong usage!'
|
||||
[ -f "$keys_file" ] || return 1
|
||||
|
||||
local IFS=:
|
||||
while read luks_dev key_dev key_path; do
|
||||
if match_dev "$luks_dev" "$for_dev"; then
|
||||
echo "${key_dev}:${key_path}"
|
||||
return 0
|
||||
fi
|
||||
done < "$keys_file"
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
# readkey keypath keydev device
|
||||
#
|
||||
# Mounts <keydev>, reads key from file <keypath>, optionally processes it (e.g.
|
||||
# if encrypted with GPG) and prints to standard output which is supposed to be
|
||||
# read by cryptsetup. <device> is just passed to helper function for
|
||||
# informational purpose.
|
||||
readkey() {
|
||||
local keypath="$1"
|
||||
local keydev="$2"
|
||||
local device="$3"
|
||||
|
||||
local mntp=$(mkuniqdir /mnt keydev)
|
||||
mount -r "$keydev" "$mntp" || die 'Mounting rem. dev. failed!'
|
||||
|
||||
case "${keypath##*.}" in
|
||||
gpg)
|
||||
if [ -f /lib/dracut-crypt-gpg-lib.sh ]; then
|
||||
. /lib/dracut-crypt-gpg-lib.sh
|
||||
gpg_decrypt "$mntp" "$keypath" "$keydev" "$device"
|
||||
else
|
||||
die "No GPG support to decrypt '$keypath' on '$keydev'."
|
||||
fi
|
||||
;;
|
||||
*) cat "$mntp/$keypath" ;;
|
||||
esac
|
||||
|
||||
umount "$mntp"
|
||||
rmdir "$mntp"
|
||||
}
|
@@ -1,7 +1,12 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
NEWROOT=${NEWROOT:-"/sysroot"}
|
||||
|
||||
# do not ask, if we already have root
|
||||
[ -f /sysroot/proc ] && exit 0
|
||||
[ -f $NEWROOT/proc ] && exit 0
|
||||
|
||||
# check if destination already exists
|
||||
[ -b /dev/mapper/$2 ] && exit 0
|
||||
@@ -9,11 +14,17 @@
|
||||
# we already asked for this device
|
||||
[ -f /tmp/cryptroot-asked-$2 ] && exit 0
|
||||
|
||||
. /lib/dracut-lib.sh
|
||||
# load dm_crypt if it is not already loaded
|
||||
[ -d /sys/module/dm_crypt ] || modprobe dm_crypt
|
||||
|
||||
. /lib/dracut-crypt-lib.sh
|
||||
|
||||
# default luksname - luks-UUID
|
||||
luksname=$2
|
||||
|
||||
# fallback to passphrase
|
||||
ask_passphrase=1
|
||||
|
||||
# if device name is /dev/dm-X, convert to /dev/mapper/name
|
||||
if [ "${1##/dev/dm-}" != "$1" ]; then
|
||||
device="/dev/mapper/$(dmsetup info -c --noheadings -o name "$1")"
|
||||
@@ -21,59 +32,91 @@ else
|
||||
device="$1"
|
||||
fi
|
||||
|
||||
# TODO: improve to support what cmdline does
|
||||
if [ -f /etc/crypttab ] && ! getargs rd_NO_CRYPTTAB; then
|
||||
while read name dev rest; do
|
||||
# ignore blank lines and comments
|
||||
if [ -z "$name" -o "${name#\#}" != "$name" ]; then
|
||||
continue
|
||||
fi
|
||||
while read name dev luksfile rest || [ -n "$name" ] ; do
|
||||
# ignore blank lines and comments
|
||||
if [ -z "$name" -o "${name#\#}" != "$name" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
# UUID used in crypttab
|
||||
if [ "${dev%%=*}" = "UUID" ]; then
|
||||
if [ "luks-${dev##UUID=}" = "$2" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
|
||||
# path used in crypttab
|
||||
else
|
||||
cdev=$(readlink -f $dev)
|
||||
mdev=$(readlink -f $device)
|
||||
if [ "$cdev" = "$mdev" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
# UUID used in crypttab
|
||||
if [ "${dev%%=*}" = "UUID" ]; then
|
||||
if [ "luks-${dev##UUID=}" = "$2" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
|
||||
# path used in crypttab
|
||||
else
|
||||
cdev=$(readlink -f $dev)
|
||||
mdev=$(readlink -f $device)
|
||||
if [ "$cdev" = "$mdev" ]; then
|
||||
luksname="$name"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done < /etc/crypttab
|
||||
unset name dev rest
|
||||
fi
|
||||
|
||||
LUKS=$(getargs rd_LUKS_UUID=)
|
||||
ask=1
|
||||
if [ -n "$LUKS" ]; then
|
||||
ask=0
|
||||
luuid=${2##luks-}
|
||||
for luks in $LUKS; do
|
||||
luks=${luks##luks-}
|
||||
if [ "${luuid##$luks}" != "$luuid" ] || [ "$luksname" = "$luks" ]; then
|
||||
ask=1
|
||||
break
|
||||
fi
|
||||
#
|
||||
# Open LUKS device
|
||||
#
|
||||
|
||||
info "luksOpen $device $luksname $luksfile"
|
||||
|
||||
if [ -n "$luksfile" -a "$luksfile" != "none" -a -e "$luksfile" ]; then
|
||||
if cryptsetup --key-file "$luksfile" luksOpen "$device" "$luksname"; then
|
||||
ask_passphrase=0
|
||||
fi
|
||||
else
|
||||
while [ -n "$(getarg rd.luks.key)" ]; do
|
||||
if tmp=$(getkey /tmp/luks.keys $device); then
|
||||
keydev="${tmp%%:*}"
|
||||
keypath="${tmp#*:}"
|
||||
else
|
||||
if [ $# -eq 3 ]; then
|
||||
if [ $3 -eq 0 ]; then
|
||||
info "No key found for $device. Fallback to passphrase mode."
|
||||
break
|
||||
fi
|
||||
info "No key found for $device. Will try $3 time(s) more later."
|
||||
set -- "$1" "$2" "$(($3 - 1))"
|
||||
else
|
||||
info "No key found for $device. Will try later."
|
||||
fi
|
||||
initqueue --unique --onetime --settled \
|
||||
--name cryptroot-ask-$luksname \
|
||||
$(command -v cryptroot-ask) "$@"
|
||||
exit 0
|
||||
fi
|
||||
unset tmp
|
||||
|
||||
info "Using '$keypath' on '$keydev'"
|
||||
readkey "$keypath" "$keydev" "$device" \
|
||||
| cryptsetup -d - luksOpen "$device" "$luksname"
|
||||
unset keypath keydev
|
||||
ask_passphrase=0
|
||||
break
|
||||
done
|
||||
fi
|
||||
unset LUKS luks luuid
|
||||
|
||||
if [ $ask -gt 0 ]; then
|
||||
info "luksOpen $device $luksname"
|
||||
# flock against other interactive activities
|
||||
{ flock -s 9;
|
||||
echo -n "$device ($luksname) is password protected"
|
||||
/sbin/cryptsetup luksOpen -T1 $1 $luksname
|
||||
} 9>/.console.lock
|
||||
if [ $ask_passphrase -ne 0 ]; then
|
||||
luks_open="$(command -v cryptsetup) luksOpen"
|
||||
ask_for_password --ply-tries 5 \
|
||||
--ply-cmd "$luks_open -T1 $device $luksname" \
|
||||
--ply-prompt "Password ($device)" \
|
||||
--tty-tries 1 \
|
||||
--tty-cmd "$luks_open -T5 $device $luksname"
|
||||
unset luks_open
|
||||
fi
|
||||
|
||||
unset device luksname luksfile
|
||||
|
||||
# mark device as asked
|
||||
>> /tmp/cryptroot-asked-$2
|
||||
|
||||
udevsettle
|
||||
|
||||
exit 0
|
||||
# vim:ts=8:sw=4:sts=4:et
|
@@ -1,8 +1,11 @@
|
||||
#!/bin/bash
|
||||
inst cryptsetup
|
||||
inst_rules "$moddir/70-luks.rules"
|
||||
inst rmdir
|
||||
inst readlink
|
||||
inst umount
|
||||
inst "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask
|
||||
inst_hook cmdline 30 "$moddir/parse-crypt.sh"
|
||||
inst_hook pre-pivot 30 "$moddir/crypt-cleanup.sh"
|
||||
inst_hook pre-pivot 31 "$moddir/crypt-cleanup.sh"
|
||||
inst "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh"
|
||||
inst /etc/crypttab
|
||||
|
@@ -1,2 +1,6 @@
|
||||
#!/bin/bash
|
||||
instmods dm_crypt cbc aes sha256 xts
|
||||
hostonly="" instmods \
|
||||
dm_crypt cbc sha256 xts aes aes_generic aesni-intel aes-x86_64 fpu \
|
||||
drbg ecb ctr
|
||||
|
||||
instmods =crypto
|
||||
|
@@ -2,5 +2,26 @@
|
||||
if getarg rd_NO_LUKS; then
|
||||
info "rd_NO_LUKS: removing cryptoluks activation"
|
||||
rm -f /etc/udev/rules.d/70-luks.rules
|
||||
else
|
||||
{
|
||||
echo 'SUBSYSTEM!="block", GOTO="luks_end"'
|
||||
echo 'ACTION!="add|change", GOTO="luks_end"'
|
||||
} > /etc/udev/rules.d/70-luks.rules
|
||||
LUKS=$(getargs rd_LUKS_UUID=)
|
||||
if [ -n "$LUKS" ]; then
|
||||
echo '. /lib/dracut-lib.sh' > /emergency/90-crypt.sh
|
||||
for luksid in $LUKS; do
|
||||
luksid=${luksid##luks-}
|
||||
printf 'ENV{ID_FS_TYPE}=="crypto_LUKS", ENV{ID_FS_UUID}=="%s*", RUN+="/sbin/initqueue --unique --onetime --name cryptroot-ask-%%k /sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"\n' $luksid \
|
||||
>> /etc/udev/rules.d/70-luks.rules
|
||||
printf '[ -e /dev/disk/by-uuid/*%s* ] || exit 1 \n' $luksid >> /initqueue-finished/crypt.sh
|
||||
printf '[ -e /dev/disk/by-uuid/*%s* ] || warn "crypto LUKS UUID "%s" not found" \n' $luksid $luksid >> /emergency/90-crypt.sh
|
||||
done
|
||||
else
|
||||
echo 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/initqueue --unique --onetime --name cryptroot-ask-%k /sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"' \
|
||||
>> /etc/udev/rules.d/70-luks.rules
|
||||
fi
|
||||
echo 'LABEL="luks_end"' >> /etc/udev/rules.d/70-luks.rules
|
||||
|
||||
fi
|
||||
|
||||
|
@@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
which dmsetup >/dev/null 2>&1 || exit 1
|
||||
|
||||
exit 255
|
||||
|
||||
|
@@ -1 +1,2 @@
|
||||
modprobe dm_mod
|
||||
strstr "$(cat /proc/misc)" device-mapper || modprobe dm_mod
|
||||
modprobe dm_mirror 2>/dev/null
|
||||
|
@@ -6,4 +6,15 @@ modinfo -k $kernel dm_mod >/dev/null 2>&1 && \
|
||||
inst dmsetup
|
||||
|
||||
inst dmeventd
|
||||
inst_rules 10-dm.rules 95-dm-notify.rules
|
||||
|
||||
if ldd $(which dmsetup) 2>/dev/null | grep -q lib64; then
|
||||
LIBDIR="/lib64"
|
||||
else
|
||||
LIBDIR="/lib"
|
||||
fi
|
||||
|
||||
for i in $(ls /{usr,}/$LIBDIR/libdevmapper-event.so* 2>/dev/null); do
|
||||
dracut_install $i
|
||||
done
|
||||
|
||||
inst_rules 10-dm.rules 13-dm-disk.rules 95-dm-notify.rules
|
||||
|
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
for i in \
|
||||
dm-snapshot dm-delay dm-mirror dm-mod dm-queue-length \
|
||||
dm-region-hash dm-round-robin dm-service-time dm-snapshot \
|
||||
; do
|
||||
modinfo -k $kernel $i >/dev/null 2>&1 && instmods $i
|
||||
done
|
||||
instmods =drivers/md
|
||||
|
||||
|
||||
|
@@ -13,6 +13,8 @@ ENV{ID_FS_TYPE}=="isw_raid_member", ENV{rd_NO_MDIMSM}!="?*", GOTO="dm_end"
|
||||
|
||||
ENV{rd_NO_DM}=="?*", GOTO="dm_end"
|
||||
|
||||
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="dm_end"
|
||||
|
||||
PROGRAM=="/bin/sh -c 'for i in $sys/$devpath/holders/dm-[0-9]*; do [ -e $$i ] && exit 0; done; exit 1;' ", \
|
||||
GOTO="dm_end"
|
||||
|
||||
|
@@ -10,7 +10,7 @@ DM_CLEANUP="no"
|
||||
info "Scanning for dmraid devices $DM_RAIDS"
|
||||
SETS=$(dmraid -c -s)
|
||||
|
||||
if [ "$SETS" = "no raid disks" ]; then
|
||||
if [ "$SETS" = "no raid disks" -o "$SETS" = "no raid sets" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
#!/bin/bash
|
||||
dracut_install dmraid partx kpartx
|
||||
dracut_install dmraid partx kpartx
|
||||
|
||||
inst dmeventd
|
||||
|
||||
if ldd $(which dmraid) | grep -q lib64; then
|
||||
if ldd $(which dmraid) 2>/dev/null | grep -q lib64; then
|
||||
LIBDIR="/lib64"
|
||||
else
|
||||
LIBDIR="/lib"
|
||||
@@ -13,8 +13,7 @@ for i in $(ls /{usr,}/$LIBDIR/libdmraid-events*.so 2>/dev/null); do
|
||||
dracut_install $i
|
||||
done
|
||||
|
||||
|
||||
inst_rules 10-dm.rules 13-dm-disk.rules 95-dm-notify.rules
|
||||
inst_rules 13-dm-disk.rules
|
||||
|
||||
inst "$moddir/dmraid.sh" /sbin/dmraid_scan
|
||||
|
||||
|
@@ -3,3 +3,9 @@ if getarg rd_NO_DM || getarg nodmraid; then
|
||||
info "rd_NO_DM: removing DM RAID activation"
|
||||
udevproperty rd_NO_DM=1
|
||||
fi
|
||||
|
||||
if [ ! -x /sbin/mdadm ] || getarg rd_NO_MDIMSM || getarg noiswmd; then
|
||||
info "rd_NO_MDIMSM: no MD RAID for imsm/isw raids"
|
||||
udevproperty rd_NO_MDIMSM=1
|
||||
fi
|
||||
|
||||
|
@@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -e /dev/sr0 ] && {
|
||||
blkid /dev/sr0;
|
||||
blkid /dev/sr0;
|
||||
} 2>/dev/null
|
@@ -1,8 +1,12 @@
|
||||
#!/bin/sh
|
||||
which dmsetup >/dev/null 2>&1 || exit 1
|
||||
|
||||
# if dmsetup is not installed, then we cannot support fedora/red hat
|
||||
# style live images
|
||||
which dmsetup >/dev/null 2>&1 || exit 1
|
||||
if [ "$1" = "-d" ]; then
|
||||
echo dm
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# a live host-only image doesn't really make a lot of sense
|
||||
if [ "$1" = "-h" ] ; then
|
||||
|
@@ -1,14 +0,0 @@
|
||||
if [ "${root%%:*}" = "live" ]; then
|
||||
(
|
||||
printf 'KERNEL=="%s", SYMLINK+="live"\n' \
|
||||
${root#live:/dev/}
|
||||
printf 'SYMLINK=="%s", SYMLINK+="live"\n' \
|
||||
${root#live:/dev/}
|
||||
printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
|
||||
${root#live:/dev/}
|
||||
printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
|
||||
${root#live:/dev/}
|
||||
|
||||
) >> /etc/udev/rules.d/99-live-mount.rules
|
||||
echo '[ -e /dev/root ]' > /initqueue-finished/dmsquash.sh
|
||||
fi
|
@@ -19,7 +19,9 @@ livedev="$1"
|
||||
live_dir=$(getarg live_dir)
|
||||
[ -z "$live_dir" ] && live_dir="LiveOS"
|
||||
getarg live_ram && live_ram="yes"
|
||||
getarg no_eject && no_eject="yes"
|
||||
getarg reset_overlay && reset_overlay="yes"
|
||||
getarg readonly_overlay && readonly_overlay="--readonly" || readonly_overlay=""
|
||||
overlay=$(getarg overlay)
|
||||
|
||||
# FIXME: we need to be able to hide the plymouth splash for the check really
|
||||
@@ -40,7 +42,8 @@ getarg ro && liverw=ro
|
||||
getarg rw && liverw=rw
|
||||
[ -z "$liverw" ] && liverw=ro
|
||||
# mount the backing of the live image first
|
||||
mount -n -t $fstype -o $liverw $livedev $NEWROOT
|
||||
mkdir -p /dev/.initramfs/live
|
||||
mount -n -t $fstype -o $liverw $livedev /dev/.initramfs/live
|
||||
RES=$?
|
||||
if [ "$RES" != "0" ]; then
|
||||
die "Failed to mount block device of live image"
|
||||
@@ -95,7 +98,7 @@ do_live_overlay() {
|
||||
fi
|
||||
|
||||
# set up the snapshot
|
||||
echo 0 `blockdev --getsize $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create live-rw
|
||||
echo 0 `blockdev --getsz $BASE_LOOPDEV` snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create $readonly_overlay live-rw
|
||||
}
|
||||
|
||||
# live cd helper function
|
||||
@@ -104,8 +107,8 @@ do_live_from_base_loop() {
|
||||
}
|
||||
|
||||
# we might have a genMinInstDelta delta file for anaconda to take advantage of
|
||||
if [ -e $NEWROOT/${live_dir}/osmin.img ]; then
|
||||
OSMINSQFS=$NEWROOT/${live_dir}/osmin.img
|
||||
if [ -e /dev/.initramfs/live/${live_dir}/osmin.img ]; then
|
||||
OSMINSQFS=/dev/.initramfs/live/${live_dir}/osmin.img
|
||||
fi
|
||||
|
||||
if [ -n "$OSMINSQFS" ]; then
|
||||
@@ -121,21 +124,20 @@ if [ -n "$OSMINSQFS" ]; then
|
||||
fi
|
||||
|
||||
# we might have just an embedded ext3 to use as rootfs (uncompressed live)
|
||||
if [ -e $NEWROOT/${live_dir}/ext3fs.img ]; then
|
||||
EXT3FS="$NEWROOT/${live_dir}/ext3fs.img"
|
||||
if [ -e /dev/.initramfs/live/${live_dir}/ext3fs.img ]; then
|
||||
EXT3FS="/dev/.initramfs/live/${live_dir}/ext3fs.img"
|
||||
fi
|
||||
|
||||
if [ -n "$EXT3FS" ] ; then
|
||||
BASE_LOOPDEV=$( losetup -f )
|
||||
losetup -r $BASE_LOOPDEV $EXT3FS
|
||||
umount -l $NEWROOT
|
||||
|
||||
do_live_from_base_loop
|
||||
fi
|
||||
|
||||
# we might have an embedded ext3 on squashfs to use as rootfs (compressed live)
|
||||
if [ -e $NEWROOT/${live_dir}/squashfs.img ]; then
|
||||
SQUASHED="$NEWROOT/${live_dir}/squashfs.img"
|
||||
if [ -e /dev/.initramfs/live/${live_dir}/squashfs.img ]; then
|
||||
SQUASHED="/dev/.initramfs/live/${live_dir}/squashfs.img"
|
||||
fi
|
||||
|
||||
if [ -e "$SQUASHED" ] ; then
|
||||
@@ -143,9 +145,11 @@ if [ -e "$SQUASHED" ] ; then
|
||||
echo "Copying live image to RAM..."
|
||||
echo "(this may take a few minutes)"
|
||||
dd if=$SQUASHED of=/squashed.img bs=512 2> /dev/null
|
||||
umount -n $NEWROOT
|
||||
umount -n /dev/.initramfs/live
|
||||
echo "Done copying live image to RAM."
|
||||
eject -p $livedev || :
|
||||
if [ ! -n "$no_eject" ]; then
|
||||
eject -p $livedev || :
|
||||
fi
|
||||
SQUASHED="/squashed.img"
|
||||
fi
|
||||
|
||||
@@ -158,9 +162,6 @@ if [ -e "$SQUASHED" ] ; then
|
||||
losetup -r $BASE_LOOPDEV /squashfs/LiveOS/ext3fs.img
|
||||
|
||||
umount -l /squashfs
|
||||
if [ -z "$live_ram" ] ; then
|
||||
umount -l $NEWROOT
|
||||
fi
|
||||
|
||||
do_live_from_base_loop
|
||||
fi
|
||||
@@ -168,10 +169,15 @@ fi
|
||||
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 --getsize $BASE_LOOPDEV ) snapshot $BASE_LOOPDEV $OSMIN_LOOPDEV p 8" | dmsetup create --readonly live-osimg-min
|
||||
echo "0 $( blockdev --getsz $BASE_LOOPDEV ) snapshot $BASE_LOOPDEV $OSMIN_LOOPDEV p 8" | dmsetup create --readonly live-osimg-min
|
||||
fi
|
||||
|
||||
ln -s /dev/mapper/live-rw /dev/root
|
||||
printf '/bin/mount /dev/mapper/live-rw %s\n' "$NEWROOT" > /mount/01-$$-live.sh
|
||||
ROOTFLAGS="$(getarg rootflags)"
|
||||
if [ -n "$ROOTFLAGS" ]; then
|
||||
ROOTFLAGS="-o $ROOTFLAGS"
|
||||
fi
|
||||
|
||||
ln -fs /dev/mapper/live-rw /dev/root
|
||||
printf '/bin/mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > /mount/01-$$-live.sh
|
||||
|
||||
exit 0
|
||||
|
@@ -1,7 +1,7 @@
|
||||
if [ "${root%%:*}" = "liveiso" ]; then
|
||||
(
|
||||
{
|
||||
printf 'KERNEL=="loop0", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root `/sbin/losetup -f --show %s`"\n' \
|
||||
${root#liveiso:}
|
||||
) >> /etc/udev/rules.d/99-liveiso-mount.rules
|
||||
} >> /etc/udev/rules.d/99-liveiso-mount.rules
|
||||
echo '[ -e /dev/root ]' > /initqueue-finished/dmsquash.sh
|
||||
fi
|
||||
|
@@ -16,9 +16,7 @@ fi
|
||||
inst blockdev
|
||||
which checkisomd5 >/dev/null 2>&1 && inst checkisomd5
|
||||
inst_hook cmdline 30 "$moddir/parse-dmsquash-live.sh"
|
||||
inst_hook pre-udev 30 "$moddir/dmsquash-live-genrules.sh"
|
||||
inst_hook pre-udev 30 "$moddir/dmsquash-liveiso-genrules.sh"
|
||||
inst "$moddir/dmsquash-live-root" "/sbin/dmsquash-live-root"
|
||||
# should probably just be generally included
|
||||
inst_rules 60-cdrom_id.rules
|
||||
inst "$moddir/cdrom-hack.sh" /sbin/cdrom-hack.sh
|
||||
|
@@ -39,7 +39,21 @@ case "$liveroot" in
|
||||
esac
|
||||
info "root was $root, liveroot is now $liveroot"
|
||||
|
||||
[ $rootok = "1" ] && initqueue --settled /sbin/cdrom-hack.sh
|
||||
|
||||
# make sure that init doesn't complain
|
||||
[ -z "$root" ] && root="live"
|
||||
if [ "${root##live:/dev/}" != "$root" ]; then
|
||||
[ -d /dev/.udev/rules.d ] || mkdir -p /dev/.udev/rules.d
|
||||
{
|
||||
printf 'KERNEL=="%s", SYMLINK+="live"\n' \
|
||||
${root#live:/dev/}
|
||||
printf 'SYMLINK=="%s", SYMLINK+="live"\n' \
|
||||
${root#live:/dev/}
|
||||
} >> /dev/.udev/rules.d/99-live-mount.rules
|
||||
{
|
||||
printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
|
||||
${root#live:/dev/}
|
||||
printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
|
||||
${root#live:/dev/}
|
||||
} >> /etc/udev/rules.d/98-dracut-20-live-squash.rules
|
||||
echo '[ -e /dev/live ]' > /initqueue-finished/dmsquash.sh
|
||||
root=/dev/mapper/live-rw
|
||||
unset rootok
|
||||
fi
|
||||
|
@@ -2,3 +2,4 @@
|
||||
[ -f /etc/modprobe.conf ] && dracut_install /etc/modprobe.conf
|
||||
dracut_install $(find /etc/modprobe.d/ -type f -name '*.conf')
|
||||
inst_hook cmdline 01 "$moddir/parse-kernel.sh"
|
||||
inst "$srcmods/modules.builtin.bin" "/lib/modules/$kernel/modules.builtin.bin"
|
||||
|
@@ -1,35 +1,41 @@
|
||||
#!/bin/bash
|
||||
if [[ -z $drivers ]]; then
|
||||
block_module_test() {
|
||||
local blockfuncs='ata_scsi_ioctl|scsi_add_host|blk_init_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device'
|
||||
local blockfuncs='ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device'
|
||||
|
||||
nm -uPA "$1" | egrep -q "$blockfuncs"
|
||||
egrep -q "$blockfuncs" "$1"
|
||||
}
|
||||
instmods pcmcia sd_mod scsi_dh scsi_dh_rdac scsi_dh_emc
|
||||
instmods firewire-ohci
|
||||
hostonly='' instmods sr_mod sd_mod scsi_dh scsi_dh_rdac scsi_dh_emc scsi_dh_alua
|
||||
hostonly='' instmods pcmcia firewire-ohci
|
||||
hostonly='' instmods usb_storage sdhci sdhci-pci
|
||||
|
||||
# install keyboard support
|
||||
hostonly='' instmods atkbd i8042 usbhid hid-apple ehci-hcd ohci-hcd uhci-hcd xhci-hcd hyperv_keyboard hid-hyperv
|
||||
|
||||
instmods "=drivers/pcmcia" =ide "=drivers/usb/storage"
|
||||
instmods $(filter_kernel_modules block_module_test)
|
||||
# if not on hostonly mode, install all known filesystems if the required list is not set via the filesystems variable
|
||||
if ! [[ $hostonly ]]; then
|
||||
if [[ -z $filesystems ]]; then
|
||||
instmods '=fs'
|
||||
n_omit_drivers=".*/fs/ocfs/.*|$omit_drivers"
|
||||
n_omit_drivers=${n_omit_drivers%%|}
|
||||
omit_drivers="$n_omit_drivers" instmods '=fs'
|
||||
unset n_omit_drivers
|
||||
# hardcoded list of exceptions
|
||||
# to save a lot of space
|
||||
rm -fr ${initdir}/lib/modules/*/kernel/fs/ocfs2
|
||||
else
|
||||
instmods $filesystems
|
||||
fi
|
||||
else
|
||||
instmods $(get_fs_type "/dev/block/$(find_root_block_device)")
|
||||
hostonly='' instmods $(get_fs_type "/dev/block/$(find_root_block_device)")
|
||||
fi
|
||||
# hardcoded list of exceptions
|
||||
rm -fr ${initdir}/lib/modules/*/kernel/fs/ocfs2
|
||||
else
|
||||
instmods $drivers $filesystems
|
||||
hostonly='' instmods $drivers $filesystems
|
||||
fi
|
||||
|
||||
[[ $add_drivers ]] && instmods $add_drivers
|
||||
[[ $add_drivers ]] && hostonly='' instmods $add_drivers
|
||||
|
||||
# force install of scsi_wait_scan
|
||||
old_hostonly=$hostonly
|
||||
hostonly=''
|
||||
instmods scsi_wait_scan
|
||||
hostonly=$old_hostonly
|
||||
hostonly='' instmods scsi_wait_scan
|
||||
|
||||
|
@@ -1,3 +1,11 @@
|
||||
for p in $(getargs rdloaddriver=); do
|
||||
modprobe $p
|
||||
#!/bin/sh
|
||||
|
||||
for i in $(getargs rdloaddriver=); do
|
||||
(
|
||||
IFS=,
|
||||
for p in $i; do
|
||||
modprobe $p 2>&1 | vinfo
|
||||
done
|
||||
)
|
||||
done
|
||||
|
||||
|
@@ -14,6 +14,7 @@ PROGRAM=="/bin/sh -c 'for i in $sys/$devpath/holders/dm-[0-9]*; do [ -e $$i ] &&
|
||||
GOTO="lvm_end"
|
||||
|
||||
RUN+="/sbin/initqueue --settled --onetime --unique /sbin/lvm_scan"
|
||||
RUN+="/sbin/initqueue --timeout --onetime --unique --name 51-lvm_scan /sbin/lvm_scan --partial"
|
||||
RUN+="/bin/sh -c '>/tmp/.lvm_scan-%k;'"
|
||||
|
||||
LABEL="lvm_end"
|
||||
|
@@ -3,16 +3,36 @@ inst lvm
|
||||
|
||||
inst_rules "$moddir/64-lvm.rules" 64-lvm.rules
|
||||
|
||||
if [[ $hostonly ]] || [[ $lvmconf = "yes" ]]; then
|
||||
if [[ $hostonly ]] || [[ $lvmconf = "yes" ]]; then
|
||||
if [ -f /etc/lvm/lvm.conf ]; then
|
||||
inst /etc/lvm/lvm.conf
|
||||
# FIXME: near-term hack to establish read-only locking;
|
||||
# use command-line lvm.conf editor once it is available
|
||||
sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 4/' ${initdir}/etc/lvm/lvm.conf
|
||||
for f in /etc/lvm/lvm.conf /etc/lvm/lvm_*.conf; do
|
||||
[ -e "$f" ] || continue
|
||||
inst "$f"
|
||||
# FIXME: near-term hack to establish read-only locking;
|
||||
# use command-line lvm.conf editor once it is available
|
||||
[ -f "${initdir}/$f" ] && \
|
||||
sed -i -e \
|
||||
's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 4/' \
|
||||
"${initdir}/$f"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
|
||||
inst_rules 10-dm.rules 13-dm-disk.rules 95-dm-notify.rules 11-dm-lvm.rules
|
||||
inst_rules 11-dm-lvm.rules
|
||||
|
||||
inst "$moddir/lvm_scan.sh" /sbin/lvm_scan
|
||||
inst_hook cmdline 30 "$moddir/parse-lvm.sh"
|
||||
|
||||
if ldd $(which lvm) 2>/dev/null | grep -q lib64; then
|
||||
LIBDIR="/lib64"
|
||||
else
|
||||
LIBDIR="/lib"
|
||||
fi
|
||||
|
||||
for i in $(ls /{usr,}/$LIBDIR/libdevmapper-event-lvm*.so 2>/dev/null); do
|
||||
dracut_install $i
|
||||
done
|
||||
|
||||
dracut_install -o thin_dump thin_restore thin_check thin_repair \
|
||||
cache_dump cache_restore cache_check cache_repair \
|
||||
era_check era_dump era_invalidate era_restore
|
||||
|
@@ -2,6 +2,7 @@
|
||||
|
||||
# run lvm scan if udev has settled
|
||||
|
||||
extraargs="$@"
|
||||
. /lib/dracut-lib.sh
|
||||
|
||||
VGS=$(getargs rd_LVM_VG=)
|
||||
@@ -34,39 +35,58 @@ if [ ! -e /etc/lvm/lvm.conf ]; then
|
||||
fi
|
||||
|
||||
check_lvm_ver() {
|
||||
maj=$1
|
||||
min=$2
|
||||
ver=$3
|
||||
# --poll is supported since 2.2.57
|
||||
[ $1 -lt 2 ] && return 1
|
||||
[ $1 -gt 2 ] && return 0
|
||||
# major is 2
|
||||
[ $2 -lt 2 ] && return 1
|
||||
[ $2 -gt 2 ] && return 0
|
||||
# minor is 2, check for
|
||||
# greater or equal 57
|
||||
[ $3 -ge 57 ] && return 0
|
||||
[ $4 -lt $maj ] && return 1
|
||||
[ $4 -gt $maj ] && return 0
|
||||
[ $5 -lt $min ] && return 1
|
||||
[ $5 -gt $min ] && return 0
|
||||
[ $6 -ge $ver ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
nopoll=$(
|
||||
# hopefully this output format will never change, e.g.:
|
||||
# LVM version: 2.02.53(1) (2009-09-25)
|
||||
lvm version 2>/dev/null | \
|
||||
(
|
||||
IFS=. read maj min sub;
|
||||
maj=${maj##*:};
|
||||
sub=${sub%% *}; sub=${sub%%\(*};
|
||||
check_lvm_ver $maj $min $sub && \
|
||||
echo " --poll n "))
|
||||
# hopefully this output format will never change, e.g.:
|
||||
# LVM version: 2.02.53(1) (2009-09-25)
|
||||
OLDIFS=$IFS
|
||||
IFS=.
|
||||
set $(lvm version 2>/dev/null)
|
||||
IFS=$OLDIFS
|
||||
maj=${1##*:}
|
||||
min=$2
|
||||
sub=${3%% *}
|
||||
sub=${sub%%\(*};
|
||||
|
||||
check_lvm_ver 2 2 57 $maj $min $sub && \
|
||||
nopoll="--poll n"
|
||||
|
||||
if check_lvm_ver 2 2 65 $maj $min $sub; then
|
||||
sysinit=" --sysinit $extraargs"
|
||||
fi
|
||||
|
||||
unset extraargs
|
||||
|
||||
export LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1
|
||||
|
||||
if [ -n "$LVS" ] ; then
|
||||
info "Scanning devices $lvmdevs for LVM logical volumes $LVS"
|
||||
lvm lvscan --ignorelockingfailure 2>&1 | vinfo
|
||||
lvm lvchange -ay --ignorelockingfailure $nopoll --monitor n $LVS 2>&1 | vinfo
|
||||
if [ -z "$sysinit" ]; then
|
||||
lvm lvchange -ay --ignorelockingfailure $nopoll --ignoremonitoring $LVS 2>&1 | vinfo
|
||||
else
|
||||
lvm lvchange --yes -ay $sysinit $LVS 2>&1 | vinfo
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$LVS" -o -n "$VGS" ]; then
|
||||
info "Scanning devices $lvmdevs for LVM volume groups $VGS"
|
||||
lvm vgscan --ignorelockingfailure 2>&1 | vinfo
|
||||
lvm vgchange -ay --ignorelockingfailure $nopoll --monitor n $VGS 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
|
||||
fi
|
||||
|
||||
if [ "$lvmwritten" ]; then
|
||||
|
@@ -1,10 +1,18 @@
|
||||
if getarg rd_NO_LVM; then
|
||||
info "rd_NO_LVM: removing LVM activation"
|
||||
rm -f /etc/udev/rules.d/64-lvm*.rules
|
||||
fi
|
||||
|
||||
if [ -e /etc/lvm/lvm.conf ] && getarg rd_NO_LVMCONF; then
|
||||
rm -f /etc/lvm/lvm.conf
|
||||
fi
|
||||
|
||||
if getarg rd_NO_LVM; then
|
||||
info "rd_NO_LVM: removing LVM activation"
|
||||
rm -f /etc/udev/rules.d/64-lvm*.rules
|
||||
else
|
||||
for dev in $(getargs rd_LVM_VG=) $(getargs rd_LVM_LV=); do
|
||||
printf '[ -e "/dev/%s" ] || exit 1\n' $dev \
|
||||
>> /initqueue-finished/lvm.sh
|
||||
{
|
||||
printf '[ -e "/dev/%s" ] || ' $dev
|
||||
printf 'warn "LVM "%s" not found"\n' $dev
|
||||
} >> /emergency/90-lvm.sh
|
||||
done
|
||||
fi
|
||||
|
||||
|
@@ -22,22 +22,12 @@ KERNEL!="md*", IMPORT{program}="/sbin/mdadm --examine --export $tempnode"
|
||||
|
||||
LABEL="do_md_inc"
|
||||
|
||||
#
|
||||
# if rd_MDADMCONF do not assemble incrementally
|
||||
# defer auto assembly until the udev queue is settled
|
||||
#
|
||||
ENV{rd_MDADMCONF}!="?*", GOTO="md_auto_end"
|
||||
|
||||
RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh;/sbin/initqueue --settled --onetime --unique /sbin/mdadm_auto'"
|
||||
|
||||
GOTO="md_inc_end"
|
||||
|
||||
LABEL="md_auto_end"
|
||||
|
||||
#
|
||||
# Incrementally build the md array
|
||||
#
|
||||
RUN+="/sbin/mdadm -I --no-degraded $env{DEVNAME}"
|
||||
RUN+="/sbin/mdadm -I $env{DEVNAME}"
|
||||
|
||||
RUN+="/bin/ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh"
|
||||
|
||||
@@ -50,7 +40,6 @@ ACTION=="add|change", \
|
||||
KERNEL=="md[0-9]*|md/*", \
|
||||
ENV{MD_LEVEL}!="container", \
|
||||
ENV{MD_CONTAINER}!="?*", \
|
||||
ENV{rd_MDADMCONF}!="?*", \
|
||||
ENV{rd_NO_MD}!="?*", \
|
||||
GOTO="do_raidstart"
|
||||
|
||||
@@ -58,10 +47,12 @@ GOTO="end_raidstart"
|
||||
|
||||
LABEL="do_raidstart"
|
||||
|
||||
# check if array is not inactive anymore
|
||||
TEST=="md/array_state", ATTR{md/array_state}!="|inactive", GOTO="end_raidstart"
|
||||
RUN+="/bin/ln -sf /sbin/md_finished.sh /initqueue-finished/md_finished.sh"
|
||||
|
||||
RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh;/sbin/initqueue --settled --onetime --unique /sbin/mdraid_start'"
|
||||
# check if array is not inactive anymore
|
||||
TEST=="md/array_state", ATTR{md/array_state}=="clean", ENV{MD_UUID}=="?*", GOTO="end_raidstart"
|
||||
|
||||
RUN+="/sbin/initqueue --timeout --onetime --name 51-mdraid_start --unique /sbin/mdraid_start"
|
||||
|
||||
LABEL="end_raidstart"
|
||||
|
||||
@@ -72,7 +63,6 @@ ACTION=="add|change", \
|
||||
KERNEL=="md[0-9]*|md/*", \
|
||||
ENV{DEVTYPE}!="partition", \
|
||||
ENV{MD_LEVEL}=="container", \
|
||||
ENV{rd_MDADMCONF}!="?*", \
|
||||
ENV{rd_NO_MD}!="?*", \
|
||||
GOTO="do_container"
|
||||
|
||||
@@ -80,6 +70,10 @@ GOTO="end_container"
|
||||
|
||||
LABEL="do_container"
|
||||
|
||||
RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh;/sbin/initqueue --settled --onetime --unique --name mdcontainer_start-%k /sbin/mdcontainer_start $env{DEVNAME}'"
|
||||
RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh /initqueue-finished/md_finished.sh"
|
||||
|
||||
TEST=="md/array_state", ATTR{md/array_state}=="clean", ENV{MD_UUID}=="?*", GOTO="end_container"
|
||||
|
||||
RUN+="/sbin/initqueue --timeout --onetime --name 50-mdcontainer_start --unique --name mdcontainer_start-%k /sbin/mdcontainer_start $env{DEVNAME}"
|
||||
|
||||
LABEL="end_container"
|
||||
|
@@ -6,7 +6,7 @@ which mdadm >/dev/null 2>&1 || exit 1
|
||||
. $dracutfunctions
|
||||
[[ $debug ]] && set -x
|
||||
|
||||
is_mdraid() { get_fs_type /dev/block/$1 |egrep -q '(linux|isw)_raid'; }
|
||||
is_mdraid() { [[ -d "/sys/dev/block/$1/md" ]]; }
|
||||
|
||||
[[ $1 = '-h' ]] && {
|
||||
rootdev=$(find_root_block_device)
|
||||
@@ -16,7 +16,7 @@ is_mdraid() { get_fs_type /dev/block/$1 |egrep -q '(linux|isw)_raid'; }
|
||||
check_block_and_slaves is_mdraid "$rootdev" || exit 1
|
||||
else
|
||||
# root is not on a block device, use the shotgun approach
|
||||
blkid | grep -q linux_raid || exit 1
|
||||
blkid | egrep -q '(linux|isw)_raid' || exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
@@ -22,8 +22,11 @@ if ! mdadm -Q -e imsm /dev/null &> /dev/null; then
|
||||
fi
|
||||
|
||||
if [[ $hostonly ]] || [[ $mdadmconf = "yes" ]]; then
|
||||
[ -f /etc/mdadm/mdadm.conf ] && inst /etc/mdadm/mdadm.conf /etc/mdadm.conf
|
||||
[ -f /etc/mdadm.conf ] && inst /etc/mdadm.conf
|
||||
if [ -f /etc/mdadm.conf ]; then
|
||||
inst /etc/mdadm.conf
|
||||
else
|
||||
[ -f /etc/mdadm/mdadm.conf ] && inst /etc/mdadm/mdadm.conf /etc/mdadm.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -x /sbin/mdmon ] ; then
|
||||
|
@@ -4,7 +4,7 @@
|
||||
md=$1
|
||||
udevadm control --stop-exec-queue
|
||||
# and activate any containers
|
||||
mdadm -IR $md 2>&1 | vinfo
|
||||
mdadm -R $md 2>&1 | vinfo
|
||||
ln -s /sbin/mdraid-cleanup /pre-pivot/30-mdraid-cleanup.sh 2>/dev/null
|
||||
ln -s /sbin/mdraid-cleanup /pre-pivot/31-mdraid-cleanup.sh 2>/dev/null
|
||||
udevadm control --start-exec-queue
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user