Compare commits
327 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6612ae0d36 | ||
![]() |
616fdae3cf | ||
![]() |
eb242ada05 | ||
![]() |
4916bf1a58 | ||
![]() |
319867faa8 | ||
![]() |
87e90d7f4a | ||
![]() |
2249e7312e | ||
![]() |
62c00a8896 | ||
![]() |
1a2290ea79 | ||
![]() |
03de49609c | ||
![]() |
e330912be5 | ||
![]() |
33a4198e17 | ||
![]() |
8b5ee88ff6 | ||
![]() |
2bcf4ffe5f | ||
![]() |
a455ad1c27 | ||
![]() |
c44d2252bb | ||
![]() |
90ac2d2429 | ||
![]() |
27d7936f0e | ||
![]() |
2da041d672 | ||
![]() |
63a44c8dc3 | ||
![]() |
602dce9ff2 | ||
![]() |
456f299ab8 | ||
![]() |
7527b90c88 | ||
![]() |
07a081f352 | ||
![]() |
6870007674 | ||
![]() |
d6dfde7830 | ||
![]() |
946722e465 | ||
![]() |
a95a727fdc | ||
![]() |
927d1e28c9 | ||
![]() |
74c9fb947b | ||
![]() |
edbd9ca058 | ||
![]() |
dcc2a4344b | ||
![]() |
ed92ecaa3c | ||
![]() |
98e9db2755 | ||
![]() |
4a6c14f987 | ||
![]() |
561eb42f39 | ||
![]() |
10f8df1bdf | ||
![]() |
35a666d02a | ||
![]() |
5b43377d74 | ||
![]() |
ecdee70c48 | ||
![]() |
b44156c6fc | ||
![]() |
a49c1f049b | ||
![]() |
efba549a26 | ||
![]() |
79cb273dc0 | ||
![]() |
583fb23199 | ||
![]() |
b73e00aff7 | ||
![]() |
b5363e834a | ||
![]() |
19b0065cac | ||
![]() |
df087c45d8 | ||
![]() |
5d90ba4fca | ||
![]() |
e847a78bb6 | ||
![]() |
73833796b4 | ||
![]() |
e803d076f8 | ||
![]() |
7d47178e0d | ||
![]() |
6cfdb5aa1f | ||
![]() |
29b885b46e | ||
![]() |
42b4fc90f2 | ||
![]() |
b519ae7008 | ||
![]() |
195b5d0725 | ||
![]() |
686f9675df | ||
![]() |
26fbe97bbe | ||
![]() |
744c65939b | ||
![]() |
3632be079b | ||
![]() |
782e909eef | ||
![]() |
27a5aecf56 | ||
![]() |
5193198dc9 | ||
![]() |
c606be49d7 | ||
![]() |
f939cffdac | ||
![]() |
a283636b83 | ||
![]() |
4483fff87c | ||
![]() |
c04a321b92 | ||
![]() |
4a88aaff10 | ||
![]() |
dd8d161afe | ||
![]() |
0c004c8e64 | ||
![]() |
9ab5ddf16a | ||
![]() |
93b9885a65 | ||
![]() |
db7d739818 | ||
![]() |
bcbcacb5d6 | ||
![]() |
0a10d7fc51 | ||
![]() |
f5753e1861 | ||
![]() |
9af753c468 | ||
![]() |
20486a16e9 | ||
![]() |
848edf22f0 | ||
![]() |
3913d061c4 | ||
![]() |
cca313fa75 | ||
![]() |
9a5bd6804a | ||
![]() |
4891d9a2ce | ||
![]() |
2448fbf17b | ||
![]() |
6138a45dd2 | ||
![]() |
7391fef29a | ||
![]() |
01430d27d4 | ||
![]() |
ab57132aa5 | ||
![]() |
6251f82c6f | ||
![]() |
3e1c531b4e | ||
![]() |
64c34f3459 | ||
![]() |
2cc5e92e21 | ||
![]() |
875426f2fc | ||
![]() |
53a7384653 | ||
![]() |
c97209fe69 | ||
![]() |
9befacf0c5 | ||
![]() |
8019e0eef3 | ||
![]() |
3177d12d2b | ||
![]() |
fac92cfbad | ||
![]() |
5593ee7172 | ||
![]() |
fc146519f9 | ||
![]() |
87894441c7 | ||
![]() |
49c9d8174f | ||
![]() |
97be933592 | ||
![]() |
8e1c4b354c | ||
![]() |
0d5c02d3ab | ||
![]() |
4cca17eeec | ||
![]() |
eb150a4fee | ||
![]() |
3ce142861d | ||
![]() |
0ea86cb727 | ||
![]() |
9d2a3f80cf | ||
![]() |
10d03bbfbc | ||
![]() |
820f81016a | ||
![]() |
eed08b6988 | ||
![]() |
a9caf07fb3 | ||
![]() |
fc212358da | ||
![]() |
0888cf51ab | ||
![]() |
5cb1e0efea | ||
![]() |
ea877ac6cc | ||
![]() |
5816375273 | ||
![]() |
419105df27 | ||
![]() |
aa169b3bd3 | ||
![]() |
378ed5ecc1 | ||
![]() |
9918afd244 | ||
![]() |
e0a5dec4a4 | ||
![]() |
110858025a | ||
![]() |
0a66b74b51 | ||
![]() |
6802cf2349 | ||
![]() |
feb8dc685d | ||
![]() |
69171aa8fa | ||
![]() |
c22c43f81a | ||
![]() |
52b91b6698 | ||
![]() |
d94050ddae | ||
![]() |
f41720c311 | ||
![]() |
8ba684be1c | ||
![]() |
50e86bf02b | ||
![]() |
4e9ba952bf | ||
![]() |
b1b704bd67 | ||
![]() |
01b23b6900 | ||
![]() |
3c00189988 | ||
![]() |
e6a2555c7d | ||
![]() |
4f50a9bfb1 | ||
![]() |
41ac16b26f | ||
![]() |
396d3cc7ff | ||
![]() |
b05ad85b0c | ||
![]() |
4135eea634 | ||
![]() |
96d694c0b5 | ||
![]() |
da5304aabc | ||
![]() |
cce34acace | ||
![]() |
607ff8204b | ||
![]() |
2082cdf230 | ||
![]() |
c1c96f2c47 | ||
![]() |
693b7a3283 | ||
![]() |
7eeaa4ab14 | ||
![]() |
f4d64d55ea | ||
![]() |
ff55a8939c | ||
![]() |
e50f91e600 | ||
![]() |
7f2ea02b4a | ||
![]() |
24f32511fc | ||
![]() |
5899f2f516 | ||
![]() |
e47907cc6b | ||
![]() |
968280e370 | ||
![]() |
8c7dc032f8 | ||
![]() |
df0bdd5ae9 | ||
![]() |
ee44f62972 | ||
![]() |
e8f19bcf26 | ||
![]() |
cb0913db0d | ||
![]() |
32de4eb5d3 | ||
![]() |
3721635b2c | ||
![]() |
694725abf0 | ||
![]() |
e833e26137 | ||
![]() |
5a66d51102 | ||
![]() |
1cadc26fd4 | ||
![]() |
78362bc5fe | ||
![]() |
7ecb36aef4 | ||
![]() |
3fa31c3a47 | ||
![]() |
9ee2f1e235 | ||
![]() |
e860ef0e30 | ||
![]() |
6c9484f614 | ||
![]() |
162daf0c97 | ||
![]() |
01e60ca4f6 | ||
![]() |
b8efaa0017 | ||
![]() |
6318baa45f | ||
![]() |
3d579309cd | ||
![]() |
f621aeba65 | ||
![]() |
59815841e9 | ||
![]() |
77403e0032 | ||
![]() |
8d09f493a6 | ||
![]() |
777f2db037 | ||
![]() |
ba665de454 | ||
![]() |
57fb6e67de | ||
![]() |
916559e073 | ||
![]() |
3639fe543c | ||
![]() |
7cca5efdce | ||
![]() |
0f89ec314b | ||
![]() |
cf627b20d0 | ||
![]() |
90ff5ad67e | ||
![]() |
08eca6756f | ||
![]() |
d4b93a092d | ||
![]() |
c42064a684 | ||
![]() |
47ff68e78b | ||
![]() |
ac13778f60 | ||
![]() |
aca93e3364 | ||
![]() |
231b3dd432 | ||
![]() |
70de22e63b | ||
![]() |
80dab03a7d | ||
![]() |
eab03540cd | ||
![]() |
a97787c7b5 | ||
![]() |
2c66c3bccf | ||
![]() |
e4e7801d29 | ||
![]() |
e51e7978a8 | ||
![]() |
ca96509c97 | ||
![]() |
04bf862d97 | ||
![]() |
3f979ee495 | ||
![]() |
3944c4b136 | ||
![]() |
97ff396a97 | ||
![]() |
8ff624df9f | ||
![]() |
5711f54312 | ||
![]() |
c3cdd9f6e1 | ||
![]() |
1339095dba | ||
![]() |
4358ace43c | ||
![]() |
8b52e96f09 | ||
![]() |
0ad2471c3a | ||
![]() |
b52cfbeaa5 | ||
![]() |
6755c20855 | ||
![]() |
7c433a0b43 | ||
![]() |
d5e5855b74 | ||
![]() |
3b1d78880f | ||
![]() |
4d9d767da2 | ||
![]() |
b562bc55a8 | ||
![]() |
dfec3c2d8b | ||
![]() |
8c5d18c2cb | ||
![]() |
d6e23c46c2 | ||
![]() |
4f0c7fc917 | ||
![]() |
c4184b5cf1 | ||
![]() |
1a61d85ef2 | ||
![]() |
514aeec5b4 | ||
![]() |
6964169368 | ||
![]() |
acf82efd52 | ||
![]() |
e409c9e8f8 | ||
![]() |
0e5c01f8b8 | ||
![]() |
311aee1bff | ||
![]() |
0b7bfacfea | ||
![]() |
3ac9cdb1c5 | ||
![]() |
c071990c2c | ||
![]() |
ee84640963 | ||
![]() |
f8139a8b28 | ||
![]() |
cfa365a32d | ||
![]() |
a1b4efe6a7 | ||
![]() |
3586a7aa77 | ||
![]() |
81b67232dc | ||
![]() |
27c9d1f20f | ||
![]() |
10e59202c7 | ||
![]() |
7b56b90582 | ||
![]() |
3e3ed34f03 | ||
![]() |
50f8ae457c | ||
![]() |
a601870064 | ||
![]() |
8cd8820547 | ||
![]() |
471439f564 | ||
![]() |
e668f3bc36 | ||
![]() |
351de47882 | ||
![]() |
07d9319d54 | ||
![]() |
7c5ec0f5be | ||
![]() |
79bc77d2f4 | ||
![]() |
874b013573 | ||
![]() |
ffa0ee5d16 | ||
![]() |
a742c80778 | ||
![]() |
04ba461045 | ||
![]() |
6d58fa27a4 | ||
![]() |
822a7ae504 | ||
![]() |
b0b60c8e05 | ||
![]() |
4851deca54 | ||
![]() |
437dad70e9 | ||
![]() |
a3e464ca43 | ||
![]() |
be82884d35 | ||
![]() |
180e9d7851 | ||
![]() |
d3d52b20e9 | ||
![]() |
23446ef1e0 | ||
![]() |
ec06c5d3b5 | ||
![]() |
d3be9275c7 | ||
![]() |
13efce5d1b | ||
![]() |
f53ede36fb | ||
![]() |
97cb17c792 | ||
![]() |
3b82ac1696 | ||
![]() |
99ccbc30df | ||
![]() |
e93d0bea38 | ||
![]() |
833e0f9e83 | ||
![]() |
c902aba0d4 | ||
![]() |
2bc5054a64 | ||
![]() |
b67d810785 | ||
![]() |
bbbdba2ec3 | ||
![]() |
863e18b4cd | ||
![]() |
a18d5494eb | ||
![]() |
cbb4b50e02 | ||
![]() |
ae43adb70d | ||
![]() |
ddfefd05fc | ||
![]() |
25e08a0973 | ||
![]() |
6f92423c89 | ||
![]() |
5641b0974b | ||
![]() |
5c44f43e69 | ||
![]() |
3c20ac5377 | ||
![]() |
afcc697cb8 | ||
![]() |
636d2d46a5 | ||
![]() |
21a209735a | ||
![]() |
bee086532f | ||
![]() |
df1e8127da | ||
![]() |
481ee9e6fc | ||
![]() |
9f0878540b | ||
![]() |
9119059723 | ||
![]() |
28eae10b70 | ||
![]() |
363469d757 | ||
![]() |
dea0634544 | ||
![]() |
1bcb63f97c | ||
![]() |
b0472eac11 | ||
![]() |
d6e34d362a | ||
![]() |
7075a402d7 | ||
![]() |
5729ae8029 | ||
![]() |
a7d3ad67c7 | ||
![]() |
7e9341434f | ||
![]() |
6ac2c83570 | ||
![]() |
05b879ed2a | ||
![]() |
38e217704a | ||
![]() |
c9364f6ea2 |
@@ -1,2 +1,3 @@
|
||||
(setq sh-basic-offset: 4)
|
||||
(setq indent-tabs-mode nil)
|
||||
((nil . ((sh-basic-offset . 4)
|
||||
(indent-tabs-mode . nil)
|
||||
)))
|
||||
|
@@ -12,18 +12,20 @@ case "$COMMAND" in
|
||||
if [[ -f ${INITRD_IMAGE_PREGENERATED} ]]; then
|
||||
# we found an initrd at the same place as the kernel
|
||||
# use this and don't generate a new one
|
||||
cp "$INITRD_IMAGE_PREGENERATED" "$BOOT_DIR_ABS/initrd" \
|
||||
cp --reflink=auto "$INITRD_IMAGE_PREGENERATED" "$BOOT_DIR_ABS/initrd" \
|
||||
&& chown root:root "$BOOT_DIR_ABS/initrd" \
|
||||
&& chmod 0600 "$BOOT_DIR_ABS/initrd" \
|
||||
&& exit 0
|
||||
fi
|
||||
|
||||
if [[ -f /etc/kernel/cmdline ]]; then
|
||||
readarray -t BOOT_OPTIONS < /etc/kernel/cmdline
|
||||
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
|
||||
elif [[ -f /usr/lib/kernel/cmdline ]]; then
|
||||
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
|
||||
fi
|
||||
|
||||
if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
|
||||
read -ar BOOT_OPTIONS < /proc/cmdline
|
||||
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
|
||||
read -r -d '' -a BOOT_OPTIONS < /proc/cmdline
|
||||
fi
|
||||
|
||||
unset noimageifnotneeded
|
||||
|
@@ -57,7 +57,7 @@ if [[ ! -f $INITRDFILE ]]; then
|
||||
fi
|
||||
|
||||
if [[ ! -f $NEW_KERNEL_IMAGE ]]; then
|
||||
cp "$KERNEL_IMAGE" "$NEW_KERNEL_IMAGE"
|
||||
cp --reflink=auto "$KERNEL_IMAGE" "$NEW_KERNEL_IMAGE"
|
||||
((ret+=$?))
|
||||
fi
|
||||
|
||||
|
@@ -40,12 +40,22 @@ fi
|
||||
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||||
|
||||
if [[ -f /etc/kernel/cmdline ]]; then
|
||||
readarray -t BOOT_OPTIONS < /etc/kernel/cmdline
|
||||
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
|
||||
elif [[ -f /usr/lib/kernel/cmdline ]]; then
|
||||
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
|
||||
fi
|
||||
|
||||
if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
|
||||
read -ar BOOT_OPTIONS < /proc/cmdline
|
||||
read -r -d '' -a line < /proc/cmdline
|
||||
for i in "${line[@]}"; do
|
||||
[[ "${i#initrd=*}" != "$i" ]] && continue
|
||||
BOOT_OPTIONS+=("$i")
|
||||
done
|
||||
fi
|
||||
if ! [[ $BOOT_OPTIONS ]]; then
|
||||
|
||||
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
|
||||
echo "Could not determine the kernel command line parameters." >&2
|
||||
echo "Please specify the kernel command line in /etc/kernel/cmdline!" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -69,7 +79,7 @@ case "$COMMAND" in
|
||||
|
||||
[[ -d "$BOOT_DIR_ABS" ]] || mkdir -p "$BOOT_DIR_ABS"
|
||||
|
||||
if ! cp "$KERNEL_IMAGE" "$BOOT_DIR_ABS"/linux; then
|
||||
if ! cp --reflink=auto "$KERNEL_IMAGE" "$BOOT_DIR_ABS"/linux; then
|
||||
echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/linux'!" >&2
|
||||
fi
|
||||
|
||||
|
51
AUTHORS
51
AUTHORS
@@ -4,69 +4,84 @@ Amadeusz Żołnowski <aidecoe@aidecoe.name>
|
||||
Will Woods <wwoods@redhat.com>
|
||||
Philippe Seewer <philippe.seewer@bfh.ch>
|
||||
Warren Togami <wtogami@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
Dave Young <dyoung@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Hannes Reinecke <hare@suse.de>
|
||||
Michal Soltys <soltys@ziu.info>
|
||||
Amerigo Wang <amwang@redhat.com>
|
||||
Colin Guthrie <colin@mageia.org>
|
||||
Amerigo Wang <amwang@redhat.com>
|
||||
Thomas Renninger <trenn@suse.de>
|
||||
WANG Chao <chaowang@redhat.com>
|
||||
Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
Alexander Tsoy <alexander@tsoy.me>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Alexander Tsoy <alexander@tsoy.me>
|
||||
John Reiser <jreiser@bitwagon.com>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
Dan Horák <dhorak@redhat.com>
|
||||
Frederick Grose <fgrose@sugarlabs.org>
|
||||
Baoquan He <bhe@redhat.com>
|
||||
Leho Kraav <leho@kraav.com>
|
||||
Colin Walters <walters@verbum.org>
|
||||
Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Fabian Deutsch <fabiand@fedoraproject.org>
|
||||
Kamil Rytarowski <n54@gmx.com>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
NeilBrown <neilb@suse.de>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Radek Vykydal <rvykydal@redhat.com>
|
||||
Thorsten Behrens <tbehrens@suse.com>
|
||||
Chao Wang <chaowang@redhat.com>
|
||||
Colin Walters <walters@verbum.org>
|
||||
Frederic Crozat <fcrozat@suse.com>
|
||||
James Lee <jlee@thestaticvoid.com>
|
||||
Jesse Keating <jkeating@redhat.com>
|
||||
Milan Broz <mbroz@redhat.com>
|
||||
Mimi Zohar <zohar@linux.vnet.ibm.com>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
Roberto Sassu <roberto.sassu@polito.it>
|
||||
Stefan Reimer <it@startux.de>
|
||||
Anton Blanchard <anton@samba.org>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Chapman Flack <g2@anastigmatix.net>
|
||||
Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Chris Leech <cleech@redhat.com>
|
||||
David Cantrell <dcantrell@redhat.com>
|
||||
Dennis Gilmore <dennis@ausil.us>
|
||||
Jan Synacek <jsynacek@redhat.com>
|
||||
Jon Ander Hernandez <jonan.h@gmail.com>
|
||||
Juan RP <xtraeme@gmail.com>
|
||||
Lance Albertson <lance@osuosl.org>
|
||||
Lidong Zhong <lzhong@suse.com>
|
||||
Marian Ganisin <mganisin@redhat.com>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Peter Robinson <pbrobinson@gmail.com>
|
||||
Stefan Reimer <it@startux.de>
|
||||
Silvio Fricke <silvio.fricke@gmail.com>
|
||||
Stig Telfer <stelfer@cray.com>
|
||||
Vasiliy Tolstov <v.tolstov@selfip.ru>
|
||||
Ville Skyttä <ville.skytta@iki.fi>
|
||||
Wim Muskee <wimmuskee@gmail.com>
|
||||
yuwata <watanabe.yu+github@gmail.com>
|
||||
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
||||
Alan Pevec <apevec@redhat.com>
|
||||
Alex Harpin <development@landsofshadow.co.uk>
|
||||
Antony Messerli <amesserl@rackspace.com>
|
||||
Chao Fan <cfan@redhat.com>
|
||||
Daniel Schaal <farbing@web.de>
|
||||
Frederick Grose <fgrose@sugarlabs.org>
|
||||
Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
|
||||
Erwan Velu <erwan.velu@enovance.com>
|
||||
Hari Bathini <hbathini@linux.vnet.ibm.com>
|
||||
Ian Dall <ian@beware.dropbear.id.au>
|
||||
James Buren <ryuo@frugalware.org>
|
||||
James Lee <jlee@thestaticvoid.com>
|
||||
Joey Boggs <jboggs@redhat.com>
|
||||
Koen Kooi <koen@dominion.thruhere.net>
|
||||
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
Kyle McMartin <kmcmarti@redhat.com>
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
Lukas Wunner <lukas@wunner.de>
|
||||
Mike Gilbert <floppym@gentoo.org>
|
||||
Mike Snitzer <snitzer@redhat.com>
|
||||
Minfei Huang <mhuang@redhat.com>
|
||||
Przemysław Rudy <prudy1@o2.pl>
|
||||
@@ -77,39 +92,44 @@ Vivek Goyal <vgoyal@redhat.com>
|
||||
Vladislav Bogdanov <bubble@hoster-ok.com>
|
||||
Adam Williamson <awilliam@redhat.com>
|
||||
Alexander Todorov <atodorov@redhat.com>
|
||||
Andrei Borzenkov <arvidjaar@gmail.com>
|
||||
Andy Lutomirski <luto@mit.edu>
|
||||
Anssi Hannula <anssi@mageia.org>
|
||||
Antony Messerli <amesserl@rackspace.com>
|
||||
Brandon Philips <brandon@ifup.co>
|
||||
Canek Peláez Valdés <caneko@gmail.com>
|
||||
Chris Leech <cleech@redhat.com>
|
||||
Christian Heinz <christian.ch.heinz@gmail.com>
|
||||
Christian Rodrigues <crrodriguez@opensuse.org>
|
||||
Cong Wang <amwang@redhat.com>
|
||||
Daniel Drake <drake@endlessm.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
Dennis Schridde <devurandom@gmx.net>
|
||||
Duane Griffin <duaneg@dghda.com>
|
||||
Erwan Velu <erwan.velu@enovance.com>
|
||||
Fabian <fvogt@suse.com>
|
||||
Gerd von Egidy <gerd.von.egidy@intra2net.com>
|
||||
Glen Gray <slaine@slaine.org>
|
||||
HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
|
||||
Hermann Gausterer <git-dracut-2012@mrq1.org>
|
||||
James Laska <jlaska@redhat.com>
|
||||
Jan Stodola <jstodola@redhat.com>
|
||||
Jiri Pirko <jiri@resnulli.us>
|
||||
Joe Lawrence <Joe.Lawrence@stratus.com>
|
||||
Jonas Jonsson <jonas@websystem.se>
|
||||
Julian Wolf <juwolf@suse.com>
|
||||
Kevin Yung <Kevin.Yung@myob.com>
|
||||
Lars R. Damerow <lars@pixar.com>
|
||||
Lennert Buytenhek <buytenh@wantstofly.org>
|
||||
Lukas Wunner <lukas@wunner.de>
|
||||
Lukas Nykryn <lnykryn@redhat.com>
|
||||
Major Hayden <major@mhtx.net>
|
||||
Marian Csontos <mcsontos@redhat.com>
|
||||
Marko Myllynen <myllynen@redhat.com>
|
||||
Matt <smoothsailing72@hotmail.com>
|
||||
Matt Smith <shadowfax@gmx.com>
|
||||
Mei Liu <liumbj@linux.vnet.ibm.com>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Mike Gorse <mgorse@suse.com>
|
||||
Moritz 'Morty' Strübe <morty@gmx.net>
|
||||
Munehiro Matsuda <haro@kgt.co.jp>
|
||||
NeilBrown <neilb@suse.de>
|
||||
Nikoli <nikoli@gmx.us>
|
||||
Nikoli <nikoli@lavabit.com>
|
||||
Olivier Blin <dev@blino.org>
|
||||
P J P <ppandit@redhat.com>
|
||||
@@ -119,17 +139,20 @@ Praveen_Paladugu@Dell.com <Praveen_Paladugu@Dell.com>
|
||||
Pádraig Brady <P@draigBrady.com>
|
||||
Quentin Armitage <quentin@armitage.org.uk>
|
||||
Robert Buchholz <rbu@goodpoint.de>
|
||||
Rusty Bird <rustybird@openmailbox.org>
|
||||
Sergey Fionov <fionov@gmail.com>
|
||||
Shawn W Dunn <sfalken@opensuse.org>
|
||||
Srinivasa T N <seenutn@linux.vnet.ibm.com>
|
||||
Stijn Hoop <stijn@sandcat.nl>
|
||||
Thilo Bangert <thilo.bangert@gmx.net>
|
||||
Tobias Geerinckx <tobias.geerinckx@gmail.com>
|
||||
Tom Gundersen <teg@jklm.no>
|
||||
Tomasz Torcz <tomek@pipebreaker.pl>
|
||||
Vadim Kuznetsov <vadimk@gentoo.org>
|
||||
Vaughan Cao <vaughan.cao@oracle.com>
|
||||
Ville Skyttä <ville.skytta@iki.fi>
|
||||
Vratislav Podzimek <vpodzime@redhat.com>
|
||||
Yanko Kaneti <yaneti@declera.com>
|
||||
Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
|
||||
jloeser <jloeser@suse.de>
|
||||
maximilian attems <max@stro.at>
|
||||
xtraeme <xtraeme@voidlinux.eu>
|
||||
|
62
Makefile
62
Makefile
@@ -1,7 +1,7 @@
|
||||
-include dracut-version.sh
|
||||
|
||||
VERSION = $(shell [ -d .git ] && git describe --abbrev=0 --tags 2>/dev/null || echo $(DRACUT_VERSION))
|
||||
GITVERSION = $(shell [ -d .git ] && { v=$$(git describe --tags 2>/dev/null); [ $${v\#*-} != $$v ] && echo -$${v\#*-}; } )
|
||||
VERSION ?= $(shell [ -d .git ] && git describe --abbrev=0 --tags 2>/dev/null || echo $(DRACUT_VERSION))
|
||||
GITVERSION ?= $(shell [ -d .git ] && { v=$$(git describe --tags 2>/dev/null); [ -n "$$v" ] && [ $${v\#*-} != $$v ] && echo -$${v\#*-}; } )
|
||||
|
||||
-include Makefile.inc
|
||||
|
||||
@@ -15,6 +15,7 @@ mandir ?= ${prefix}/share/man
|
||||
CFLAGS ?= -O2 -g -Wall
|
||||
CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
|
||||
bashcompletiondir ?= ${datadir}/bash-completion/completions
|
||||
pkgconfigdatadir ?= $(datadir)/pkgconfig
|
||||
|
||||
man1pages = lsinitrd.1
|
||||
|
||||
@@ -28,20 +29,20 @@ man8pages = dracut.8 \
|
||||
dracut-catimages.8 \
|
||||
mkinitrd.8 \
|
||||
mkinitrd-suse.8 \
|
||||
modules.d/98systemd/dracut-cmdline.service.8 \
|
||||
modules.d/98systemd/dracut-initqueue.service.8 \
|
||||
modules.d/98systemd/dracut-mount.service.8 \
|
||||
modules.d/98systemd/dracut-shutdown.service.8 \
|
||||
modules.d/98systemd/dracut-pre-mount.service.8 \
|
||||
modules.d/98systemd/dracut-pre-pivot.service.8 \
|
||||
modules.d/98systemd/dracut-pre-trigger.service.8 \
|
||||
modules.d/98systemd/dracut-pre-udev.service.8
|
||||
modules.d/98dracut-systemd/dracut-cmdline.service.8 \
|
||||
modules.d/98dracut-systemd/dracut-initqueue.service.8 \
|
||||
modules.d/98dracut-systemd/dracut-mount.service.8 \
|
||||
modules.d/98dracut-systemd/dracut-shutdown.service.8 \
|
||||
modules.d/98dracut-systemd/dracut-pre-mount.service.8 \
|
||||
modules.d/98dracut-systemd/dracut-pre-pivot.service.8 \
|
||||
modules.d/98dracut-systemd/dracut-pre-trigger.service.8 \
|
||||
modules.d/98dracut-systemd/dracut-pre-udev.service.8
|
||||
|
||||
manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages)
|
||||
|
||||
.PHONY: install clean archive rpm testimage test all check AUTHORS doc dracut-version.sh
|
||||
|
||||
all: dracut-version.sh dracut-install skipcpio/skipcpio
|
||||
all: dracut-version.sh dracut.pc dracut-install skipcpio/skipcpio
|
||||
|
||||
DRACUT_INSTALL_OBJECTS = \
|
||||
install/dracut-install.o \
|
||||
@@ -81,22 +82,34 @@ all: doc
|
||||
endif
|
||||
|
||||
%: %.xml
|
||||
xsltproc -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
|
||||
@rm -f -- "$@"
|
||||
xsltproc -o "$@" -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
|
||||
|
||||
%.xml: %.asc
|
||||
asciidoc -d manpage -b docbook -o $@ $<
|
||||
@rm -f -- "$@"
|
||||
asciidoc -d manpage -b docbook -o "$@" $<
|
||||
|
||||
dracut.8: dracut.usage.asc dracut.8.asc
|
||||
|
||||
dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
|
||||
@rm -f -- dracut.xml
|
||||
asciidoc -a numbered -d book -b docbook -o dracut.xml dracut.asc
|
||||
@rm -f -- dracut.html
|
||||
xsltproc -o dracut.html --xinclude -nonet \
|
||||
--stringparam custom.css.source dracut.css \
|
||||
--stringparam generate.css.header 1 \
|
||||
http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl dracut.xml
|
||||
rm -f -- dracut.xml
|
||||
@rm -f -- dracut.xml
|
||||
|
||||
install: dracut-version.sh
|
||||
dracut.pc: Makefile.inc Makefile
|
||||
@echo "Name: dracut" > dracut.pc
|
||||
@echo "Description: dracut" >> dracut.pc
|
||||
@echo "Version: $(VERSION)$(GITVERSION)" >> dracut.pc
|
||||
@echo "dracutdir=$(pkglibdir)" >> dracut.pc
|
||||
@echo "dracutmodulesdir=$(pkglibdir)/modules.d" >> dracut.pc
|
||||
@echo "dracutconfdir=$(pkglibdir)/dracut.conf.d" >> dracut.pc
|
||||
|
||||
install: all
|
||||
mkdir -p $(DESTDIR)$(pkglibdir)
|
||||
mkdir -p $(DESTDIR)$(bindir)
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)
|
||||
@@ -109,6 +122,7 @@ install: dracut-version.sh
|
||||
install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d
|
||||
mkdir -p $(DESTDIR)$(pkglibdir)/dracut.conf.d
|
||||
install -m 0755 dracut-init.sh $(DESTDIR)$(pkglibdir)/dracut-init.sh
|
||||
install -m 0755 dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions.sh
|
||||
install -m 0755 dracut-version.sh $(DESTDIR)$(pkglibdir)/dracut-version.sh
|
||||
ln -fs dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions
|
||||
@@ -124,7 +138,7 @@ ifneq ($(enable_documentation),no)
|
||||
endif
|
||||
if [ -n "$(systemdsystemunitdir)" ]; then \
|
||||
mkdir -p $(DESTDIR)$(systemdsystemunitdir); \
|
||||
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98systemd/dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown.service; \
|
||||
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown.service; \
|
||||
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants; \
|
||||
ln -s ../dracut-shutdown.service \
|
||||
$(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants/dracut-shutdown.service; \
|
||||
@@ -138,7 +152,7 @@ endif
|
||||
dracut-pre-trigger.service \
|
||||
dracut-pre-udev.service \
|
||||
; do \
|
||||
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98systemd/$$i $(DESTDIR)$(systemdsystemunitdir); \
|
||||
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/$$i $(DESTDIR)$(systemdsystemunitdir); \
|
||||
ln -s ../$$i \
|
||||
$(DESTDIR)$(systemdsystemunitdir)/initrd.target.wants/$$i; \
|
||||
done \
|
||||
@@ -155,8 +169,11 @@ endif
|
||||
mkdir -p $(DESTDIR)${bashcompletiondir}
|
||||
install -m 0644 dracut-bash-completion.sh $(DESTDIR)${bashcompletiondir}/dracut
|
||||
install -m 0644 lsinitrd-bash-completion.sh $(DESTDIR)${bashcompletiondir}/lsinitrd
|
||||
mkdir -p $(DESTDIR)${pkgconfigdatadir}
|
||||
install -m 0644 dracut.pc $(DESTDIR)${pkgconfigdatadir}/dracut.pc
|
||||
|
||||
dracut-version.sh:
|
||||
@rm -f dracut-version.sh
|
||||
@echo "DRACUT_VERSION=$(VERSION)$(GITVERSION)" > dracut-version.sh
|
||||
|
||||
clean:
|
||||
@@ -200,7 +217,8 @@ syncheck:
|
||||
[ "$${i##*/}" = "module-setup.sh" ] && continue; \
|
||||
read line < "$$i"; [ "$${line#*bash*}" != "$$line" ] && continue; \
|
||||
[ $$V ] && echo "posix syntax check: $$i"; bash --posix -n "$$i" ; ret=$$(($$ret+$$?)); \
|
||||
[ $$V ] && echo "checking for [[: $$i"; if grep -Fq '[[ ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains [["; fi \
|
||||
[ $$V ] && echo "checking for [[: $$i"; if grep -Fq '[[ ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains [["; fi; \
|
||||
[ $$V ] && echo "checking for echo -n: $$i"; if grep -Fq 'echo -n ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains echo -n"; fi \
|
||||
done;exit $$ret
|
||||
@ret=0;for i in *.sh mkinitrd-dracut.sh modules.d/*/*.sh \
|
||||
modules.d/*/module-setup.sh; do \
|
||||
@@ -212,7 +230,7 @@ check: all syncheck rpm
|
||||
@$(MAKE) -C test check
|
||||
|
||||
testimage: all
|
||||
./dracut.sh -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
|
||||
./dracut.sh -N -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
|
||||
@echo wrote test-$(shell uname -r).img
|
||||
|
||||
debugtestimage: all
|
||||
@@ -233,8 +251,12 @@ hostimage: all
|
||||
./dracut.sh -H -l -f test-$(shell uname -r).img $(shell uname -r)
|
||||
@echo wrote test-$(shell uname -r).img
|
||||
|
||||
efi: all
|
||||
./dracut.sh --uefi -H -l -f linux-$(shell uname -r).efi $(shell uname -r)
|
||||
@echo wrote linux-$(shell uname -r).efi
|
||||
|
||||
AUTHORS:
|
||||
git shortlog --numbered --summary -e |while read a rest; do echo $$rest;done > AUTHORS
|
||||
git shortlog --numbered --summary -e |while read a rest || [ -n "$$rest" ]; do echo $$rest;done > AUTHORS
|
||||
|
||||
dracut.html.sign: dracut-$(VERSION).tar.xz dracut.html
|
||||
gpg-sign-all dracut-$(VERSION).tar.xz dracut.html
|
||||
|
137
NEWS
137
NEWS
@@ -1,3 +1,140 @@
|
||||
dracut-044
|
||||
==========
|
||||
creation:
|
||||
- better udev & systemd dir detection
|
||||
- split dracut-functions.sh in dracut-init.sh and dracut-functions.sh
|
||||
dracut-functions.sh can now be sourced by external tools
|
||||
- detect all btrfs devices needed
|
||||
- added flag file if initqueue is needed
|
||||
- don't overwrite anything, if initramfs image file creation failed
|
||||
- if no compressor is specified, try to find a suitable one
|
||||
- drop scanning kernel config for CONFIG_MICROCODE_*_EARLY
|
||||
- remove "_EARLY" from CONFIG_MICROCODE_* checks
|
||||
- dracut.sh: add command line option for install_i18_all
|
||||
--no-hostonly-i18n -> install_i18n_all=yes
|
||||
--hostonly-i18n -> install_i18n_all=no
|
||||
- --no-reproducible to turn off reproducible mode
|
||||
- dracut-function.sh can now be sourced from outside of dracut
|
||||
- dracut-init.sh contains all functions, which only can be used from
|
||||
within the dracut infrastructure
|
||||
- support --mount with just mountpoint as a parameter
|
||||
- removed action_on_fail support
|
||||
- removed host_modalias concept
|
||||
- do not create microcode, if no firmware is available
|
||||
- skip gpg files in microcode generation
|
||||
|
||||
initramfs:
|
||||
- ensure pre-mount (and resume) run before root fsck
|
||||
- add --online option to initqueue
|
||||
|
||||
qemu:
|
||||
- fixed virtual machine detection
|
||||
|
||||
lvm:
|
||||
- remove all quirk arguments for lvm >= 2.2.221
|
||||
|
||||
dmsquash:
|
||||
- fixup for checkisomd5
|
||||
- increase timeout for checkisomd5
|
||||
- use non-persistent metadata snapshots for transient overlays.
|
||||
- overflow support for persistent snapshot.
|
||||
- use non-persistent metadata snapshots.
|
||||
- avoid an overlay for persistent, uncompressed, read-write live installations.
|
||||
|
||||
multipath:
|
||||
- multipath.conf included in hostonly mode
|
||||
- install all multipath path selector kernel modules
|
||||
|
||||
iSCSI:
|
||||
- use the iBFT initiator name, if found and set
|
||||
- iscsid now present in the initramfs
|
||||
- iscsistart is done with systemd-run asynchrone to do things in
|
||||
paralllel. Also restarted for every new interface which shows up.
|
||||
- If rd.iscsi.waitnet (default) is set, iscsistart is done only
|
||||
after all interfaces are up.
|
||||
- If not all interfaces are up and rd.iscsi.testroute (default) is set,
|
||||
the route to a iscsi target IP is checked and skipped, if there is none.
|
||||
- If all things fail, we issue a "dummy" interface iscsiroot to retry
|
||||
everything in the initqueue/timeout.
|
||||
|
||||
network:
|
||||
- added DHCP RENEW/REBIND
|
||||
- IPv4 DHCP lease time now optional (bootp)
|
||||
- IPv6 nfs parsing
|
||||
- fixed IPv6 route parsing
|
||||
- rd.peerdns=0 parameter to disable DHCP nameserver setting
|
||||
- detect duplicate IPv4 addresses for static addresses
|
||||
- if interfaces are specified with its enx* name, bind the correspondent MAC to the interface name
|
||||
- if multiple "ip=" are present on the kernel command line "rd.neednet=1" is assumed
|
||||
- add options to tweak timeouts
|
||||
rd.net.dhcp.retry=<cnt>
|
||||
If this option is set, dracut will try to connect via dhcp
|
||||
<cnt> times before failing. Default is 1.
|
||||
|
||||
rd.net.timeout.dhcp=<arg>
|
||||
If this option is set, dhclient is called with "-timeout <arg>".
|
||||
|
||||
rd.net.timeout.iflink=<seconds>
|
||||
Wait <seconds> until link shows up. Default is 60 seconds.
|
||||
|
||||
rd.net.timeout.ifup=<seconds>
|
||||
Wait <seconds> until link has state "UP". Default is 20 seconds.
|
||||
|
||||
rd.net.timeout.route=<seconds>
|
||||
Wait <seconds> until route shows up. Default is 20 seconds.
|
||||
|
||||
rd.net.timeout.ipv6dad=<seconds>
|
||||
Wait <seconds> until IPv6 DAD is finished. Default is 50 seconds.
|
||||
|
||||
rd.net.timeout.ipv6auto=<seconds>
|
||||
Wait <seconds> until IPv6 automatic addresses are assigned.
|
||||
Default is 40 seconds.
|
||||
|
||||
rd.net.timeout.carrier=<seconds>
|
||||
Wait <seconds> until carrier is recognized. Default is 5 seconds.
|
||||
|
||||
IMA:
|
||||
- load signed certificates in the IMA keyring, see modules.d/98integrity/README
|
||||
- load EVM public key in the kernel _evm keyring
|
||||
|
||||
FCoE:
|
||||
fcoe: start with fcoemon instead of fipvlan
|
||||
|
||||
dracut-043
|
||||
==========
|
||||
- add missing dmsquash-generator
|
||||
|
||||
dracut-042
|
||||
==========
|
||||
- fixed dmsetup shutdown
|
||||
- new kernel command line option "rd.live.overlay.thin"
|
||||
This option changes the underlying mechanism for the overlay in the
|
||||
dmsquash module.
|
||||
Instead of a plain dm snapshot a dm thin snapshot is used. The advantage
|
||||
of the thin snapshot is, that the TRIM command is recognized, which
|
||||
means that at runtime, only the occupied blocks will be claimed from
|
||||
memory, and freed blocks will really be freed in ram.
|
||||
- dmsquash: Add squashfs support to rd.live.fsimg
|
||||
Previously rd.live.fsimg only supported filesystems residing in
|
||||
(compressed) archives.
|
||||
Now rd.live.fsimg can also be used when a squashfs image is used.
|
||||
This is achieved by extracting the rootfs image from the squashfs and
|
||||
then continue with the default routines for rd.live.fsimg.
|
||||
- lvm: add support for LVM system id
|
||||
- split up the systemd dracut module
|
||||
Basic systemd functionality is in 00systemd now.
|
||||
Switching root and the initrd.target is in 00systemd-initrd.
|
||||
Dracut additions to the systemd initrd are in 98dracut-systemd.
|
||||
- support for creating a UEFI boot executable via argument "--uefi"
|
||||
With an EFI stub, the kernel, the initramfs and a kernel cmdline can be
|
||||
glued together to a single UEFI executable, which can be booted by a
|
||||
UEFI BIOS.
|
||||
- network: split out kernel-network-modules, now in 90kernel-network-modules
|
||||
- support for ethernet point-to-point connections configured via DHCP
|
||||
- kernel-modules: install all HID drivers
|
||||
- dracut.pc pkg-config file
|
||||
- mount /dev, /dev/shm and /run noexec
|
||||
|
||||
dracut-041
|
||||
==========
|
||||
- fixed the shutdown loop
|
||||
|
21
PKGBUILD
21
PKGBUILD
@@ -1,6 +1,6 @@
|
||||
pkgname=dracut-git
|
||||
pkgver=$(date +%s)
|
||||
pkgrel=$(git log --pretty=format:%h |head -n 1)
|
||||
pkgver=1
|
||||
pkgrel=1
|
||||
pkgdesc="Initramfs generation utility"
|
||||
arch=('i686' 'x86_64')
|
||||
url="https://dracut.wiki.kernel.org/"
|
||||
@@ -14,8 +14,25 @@ backup=(etc/dracut.conf)
|
||||
source=()
|
||||
md5sums=()
|
||||
|
||||
# out of tree builds disallowed for this PKGFILE
|
||||
BUILDDIR="${PWD}"
|
||||
PKGDEST="${PWD}"
|
||||
SRCDEST=""
|
||||
SRCPKGDEST=""
|
||||
LOGDEST=""
|
||||
|
||||
pkgver() {
|
||||
cd ..
|
||||
desc="$(git describe)"
|
||||
printf "%s.%s.%s" ${desc//-/ }
|
||||
}
|
||||
|
||||
build() {
|
||||
cd ..
|
||||
make sysconfdir=/etc || return 1
|
||||
}
|
||||
|
||||
package() {
|
||||
cd ..
|
||||
make DESTDIR="${pkgdir}" sysconfdir=/etc install || return 1
|
||||
}
|
||||
|
@@ -1,13 +1,14 @@
|
||||
For the testsuite to work, you will have to install at least the following software packages:
|
||||
dash \
|
||||
bridge-utils \
|
||||
asciidoc \
|
||||
mdadm \
|
||||
lvm2 \
|
||||
cryptsetup \
|
||||
nfs-utils \
|
||||
netbsd-iscsi \
|
||||
nbd \
|
||||
dhcp-server \
|
||||
scsi-target-utils \
|
||||
iscsi-initiator-utils
|
||||
|
||||
|
||||
|
1
TODO
1
TODO
@@ -6,6 +6,7 @@ Items are ordered in priority.
|
||||
|
||||
INITRAMFS TODO
|
||||
|
||||
- search domain string
|
||||
- allow dual stack configuration (IPv4, IPv6) for the same interface
|
||||
- "bind-mount" kernel drivers in real root for the rescue image,
|
||||
if the real root does not have any kernel modules for this kernel
|
||||
|
@@ -32,6 +32,7 @@ _dracut() {
|
||||
--xz --no-compress --gzip --list-modules --show-modules --keep
|
||||
--printsize --regenerate-all --noimageifnotneeded --early-microcode
|
||||
--no-early-microcode --print-cmdline --prelink --noprelink --reproducible
|
||||
--uefi
|
||||
'
|
||||
|
||||
[ARG]='-a -m -o -d -I -k -c -L --kver --add --force-add --add-drivers
|
||||
@@ -39,7 +40,7 @@ _dracut() {
|
||||
--fwdir --libdirs --fscks --add-fstab --mount --device --nofscks
|
||||
--kmoddir --conf --confdir --tmpdir --stdlog --compress --prefix
|
||||
--kernel-cmdline --sshkey --persistent-policy --install-optional
|
||||
--loginstall
|
||||
--loginstall --uefi-stub --kernel-image
|
||||
'
|
||||
)
|
||||
|
||||
|
1195
dracut-functions.sh
1195
dracut-functions.sh
File diff suppressed because it is too large
Load Diff
1160
dracut-init.sh
Normal file
1160
dracut-init.sh
Normal file
File diff suppressed because it is too large
Load Diff
@@ -14,6 +14,8 @@ SKIP="$dracutbasedir/skipcpio"
|
||||
|
||||
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||||
|
||||
mount -o ro /boot &>/dev/null || true
|
||||
|
||||
if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
|
||||
IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
|
||||
fi
|
||||
@@ -22,6 +24,7 @@ fi
|
||||
cd /run/initramfs
|
||||
|
||||
[ -f .need_shutdown -a -f "$IMG" ] || exit 1
|
||||
|
||||
if $SKIP "$IMG" | zcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
|
||||
rm -f -- .need_shutdown
|
||||
elif $SKIP "$IMG" | xzcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
|
||||
|
@@ -148,8 +148,7 @@ dlog_init() {
|
||||
&& type -P systemd-cat &>/dev/null \
|
||||
&& systemctl --quiet is-active systemd-journald.socket &>/dev/null \
|
||||
&& { echo "dracut-$DRACUT_VERSION" | systemd-cat -t 'dracut' &>/dev/null; } ; then
|
||||
readonly _dlogdir="$(mktemp --tmpdir="$TMPDIR/" -d -t dracut-log.XXXXXX)"
|
||||
readonly _systemdcatfile="$_dlogdir/systemd-cat"
|
||||
readonly _systemdcatfile="$DRACUT_TMPDIR/systemd-cat"
|
||||
mkfifo "$_systemdcatfile"
|
||||
readonly _dlogfd=15
|
||||
systemd-cat -t 'dracut' --level-prefix=true <"$_systemdcatfile" &
|
||||
@@ -264,9 +263,9 @@ _lvl2syspri() {
|
||||
# Conversion is done as follows:
|
||||
#
|
||||
# <tt>
|
||||
# FATAL(1) -> LOG_EMERG (0)
|
||||
# none -> LOG_EMERG (0)
|
||||
# none -> LOG_ALERT (1)
|
||||
# none -> LOG_CRIT (2)
|
||||
# FATAL(1) -> LOG_CRIT (2)
|
||||
# ERROR(2) -> LOG_ERR (3)
|
||||
# WARN(3) -> LOG_WARNING (4)
|
||||
# none -> LOG_NOTICE (5)
|
||||
@@ -280,7 +279,7 @@ _dlvl2syslvl() {
|
||||
local lvl
|
||||
|
||||
case "$1" in
|
||||
1) lvl=0;;
|
||||
1) lvl=2;;
|
||||
2) lvl=3;;
|
||||
3) lvl=4;;
|
||||
4) lvl=6;;
|
||||
@@ -324,7 +323,7 @@ _do_dlog() {
|
||||
local msg="$*"
|
||||
local lmsg="$lvlc: $*"
|
||||
|
||||
(( $lvl <= $stdloglvl )) && echo "$msg" >&2
|
||||
(( $lvl <= $stdloglvl )) && printf -- 'dracut: %s\n' "$msg" >&2
|
||||
|
||||
if (( $lvl <= $sysloglvl )); then
|
||||
if [[ "$_dlogfd" ]]; then
|
||||
@@ -365,7 +364,7 @@ dlog() {
|
||||
if (( $# > 1 )); then
|
||||
_do_dlog "$@"
|
||||
else
|
||||
while read line; do
|
||||
while read line || [ -n "$line" ]; do
|
||||
_do_dlog "$1" "$line"
|
||||
done
|
||||
fi
|
||||
|
87
dracut.8.asc
87
dracut.8.asc
@@ -6,7 +6,7 @@ DRACUT(8)
|
||||
|
||||
NAME
|
||||
----
|
||||
dracut - low-level tool for generating an initramfs image
|
||||
dracut - low-level tool for generating an initramfs/initrd image
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
@@ -28,10 +28,12 @@ At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it
|
||||
as initial root file system. All finding of the root device happens in this
|
||||
early userspace.
|
||||
|
||||
Initramfs images are also called "initrd".
|
||||
|
||||
For a complete list of kernel command line options see *dracut.cmdline*(7).
|
||||
|
||||
If you are dropped to an emergency shell, while booting your initramfs,
|
||||
the file _/run/initramfs/rdsosreport.txt_ is created, which can be safed to a
|
||||
the file _/run/initramfs/rdsosreport.txt_ is created, which can be saved to a
|
||||
(to be mounted by hand) partition (usually /boot) or a USB stick.
|
||||
Additional debugging info can be produced by adding **rd.debug** to the kernel
|
||||
command line. _/run/initramfs/rdsosreport.txt_ contains all logs and the output
|
||||
@@ -54,33 +56,6 @@ OPTIONS
|
||||
**-f, --force**::
|
||||
overwrite existing initramfs file.
|
||||
|
||||
**-m, --modules** _<list of dracut modules>_::
|
||||
specify a space-separated list of dracut modules to call when building the
|
||||
initramfs. Modules are located in _/usr/lib/dracut/modules.d_. This
|
||||
parameter can be specified multiple times.
|
||||
+
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
----
|
||||
# dracut --modules "module1 module2" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**-o, --omit** _<list of dracut modules>_::
|
||||
omit a space-separated list of dracut modules. This parameter can be
|
||||
specified multiple times.
|
||||
+
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
----
|
||||
# dracut --omit "module1 module2" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**-a, --add** _<list of dracut modules>_::
|
||||
add a space-separated list of dracut modules to the default set of modules.
|
||||
This parameter can be specified multiple times.
|
||||
@@ -108,6 +83,35 @@ example:
|
||||
----
|
||||
===============================
|
||||
|
||||
**-o, --omit** _<list of dracut modules>_::
|
||||
omit a space-separated list of dracut modules. This parameter can be
|
||||
specified multiple times.
|
||||
+
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
----
|
||||
# dracut --omit "module1 module2" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**-m, --modules** _<list of dracut modules>_::
|
||||
specify a space-separated list of dracut modules to call when building the
|
||||
initramfs. Modules are located in _/usr/lib/dracut/modules.d_. This
|
||||
parameter can be specified multiple times.
|
||||
This option forces dracut to only include the specified dracut modules.
|
||||
In most cases the "--add" option is what you want to use.
|
||||
+
|
||||
[NOTE]
|
||||
===============================
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes. For
|
||||
example:
|
||||
----
|
||||
# dracut --modules "module1 module2" ...
|
||||
----
|
||||
===============================
|
||||
|
||||
**-d, --drivers** _<list of kernel modules>_::
|
||||
specify a space-separated list of kernel modules to exclusively include
|
||||
in the initramfs. The kernel modules have to be specified without the ".ko"
|
||||
@@ -338,6 +342,10 @@ provide a valid _/etc/fstab_.
|
||||
The default _<dump frequency>_ is "0".
|
||||
the default _<fsck order>_ is "2".
|
||||
|
||||
**--mount** "_<mountpoint>_"::
|
||||
Like above, but _<device>_, _<filesystem type>_ and _<filesystem options>_
|
||||
are determined by looking at the current mounts.
|
||||
|
||||
**--add-device** _<device>_ ::
|
||||
Bring up _<device>_ in initramfs, _<device>_ should be the device name.
|
||||
This can be useful in hostonly mode for resume support when your swap is on
|
||||
@@ -428,6 +436,9 @@ will not be able to boot.
|
||||
**--reproducible**::
|
||||
Create reproducible images.
|
||||
|
||||
**--no-reproducible**::
|
||||
Do not create reproducible images.
|
||||
|
||||
**--list-modules**::
|
||||
List all available dracut modules.
|
||||
|
||||
@@ -462,9 +473,23 @@ will not be able to boot.
|
||||
Regenerate all initramfs images at the default location with the kernel
|
||||
versions found on the system. Additional parameters are passed through.
|
||||
|
||||
**--loginstall _<DIR>_::
|
||||
**--loginstall _<DIR>_**::
|
||||
Log all files installed from the host to _<DIR>_.
|
||||
|
||||
**--uefi**::
|
||||
Instead of creating an initramfs image, dracut will create an UEFI executable,
|
||||
which can be executed by an UEFI BIOS.
|
||||
|
||||
**--uefi-stub _<FILE>_**::
|
||||
Specifies the UEFI stub loader, which will load the attached kernel, initramfs and
|
||||
kernel command line and boots the kernel. The default is
|
||||
_/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
|
||||
or _/usr/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
|
||||
|
||||
**--kernel-image _<FILE>_**::
|
||||
Specifies the kernel image, which to include in the UEFI executable. The default is
|
||||
_/lib/modules/<KERNEL-VERSION>/vmlinuz_ or _/boot/vmlinuz-<KERNEL-VERSION>_
|
||||
|
||||
FILES
|
||||
-----
|
||||
_/var/log/dracut.log_::
|
||||
@@ -522,4 +547,4 @@ Will Woods
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
*dracut.cmdline*(7) *dracut.conf*(5)
|
||||
*dracut.cmdline*(7) *dracut.conf*(5) *lsinitrd*(1)
|
||||
|
@@ -163,7 +163,7 @@ Misc
|
||||
Debug
|
||||
~~~~~
|
||||
If you are dropped to an emergency shell, the file
|
||||
_/run/initramfs/rdsosreport.txt_ is created, which can be safed to a (to be
|
||||
_/run/initramfs/rdsosreport.txt_ is created, which can be saved to a (to be
|
||||
mounted by hand) partition (usually /boot) or a USB stick. Additional debugging
|
||||
info can be produced by adding **rd.debug** to the kernel command line.
|
||||
_/run/initramfs/rdsosreport.txt_ contains all logs and the output of some tools.
|
||||
@@ -546,6 +546,9 @@ interface name. Better name it "bootnet" or "bluesocket".
|
||||
**nameserver=**__<IP>__ [**nameserver=**__<IP>__ ...]::
|
||||
specify nameserver(s) to use
|
||||
|
||||
**rd.peerdns=0**::
|
||||
Disable DNS setting of DHCP parameters.
|
||||
|
||||
**biosdevname=0**::
|
||||
boolean, turn off biosdevname network interface renaming
|
||||
|
||||
@@ -603,6 +606,31 @@ NFS
|
||||
**rd.nfs.domain=**__<NFSv4 domain name>__::
|
||||
Set the NFSv4 domain name. Will overwrite the settings in _/etc/idmap.conf_.
|
||||
|
||||
**rd.net.dhcp.retry=**__<cnt>__::
|
||||
If this option is set, dracut will try to connect via dhcp <cnt> times before failing.
|
||||
Default is 1.
|
||||
|
||||
**rd.net.timeout.dhcp=**__<arg>__::
|
||||
If this option is set, dhclient is called with "-timeout <arg>".
|
||||
|
||||
**rd.net.timeout.iflink=**__<seconds>__::
|
||||
Wait <seconds> until link shows up. Default is 60 seconds.
|
||||
|
||||
**rd.net.timeout.ifup=**__<seconds>__::
|
||||
Wait <seconds> until link has state "UP". Default is 20 seconds.
|
||||
|
||||
**rd.net.timeout.route=**__<seconds>__::
|
||||
Wait <seconds> until route shows up. Default is 20 seconds.
|
||||
|
||||
**rd.net.timeout.ipv6dad=**__<seconds>__::
|
||||
Wait <seconds> until IPv6 DAD is finished. Default is 50 seconds.
|
||||
|
||||
**rd.net.timeout.ipv6auto=**__<seconds>__::
|
||||
Wait <seconds> until IPv6 automatic addresses are assigned. Default is 40 seconds.
|
||||
|
||||
**rd.net.timeout.carrier=**__<seconds>__::
|
||||
Wait <seconds> until carrier is recognized. Default is 5 seconds.
|
||||
|
||||
CIFS
|
||||
~~~
|
||||
**root=**cifs://[__<username>__[:__<password>__]@]__<server-ip>__:__<root-dir>__::
|
||||
@@ -710,6 +738,12 @@ iscsistart -b --param node.session.timeo.replacement_timeout=30
|
||||
**rd.iscsi.ibft** **rd.iscsi.ibft=1**:
|
||||
Turn on iBFT autoconfiguration for the interfaces
|
||||
|
||||
**rd.iscsi.waitnet=0**:
|
||||
Turn off waiting for all interfaces to be up before trying to login to the iSCSI targets.
|
||||
|
||||
**rd.iscsi.testroute=0**:
|
||||
Turn off checking, if the route to the iSCSI target IP is possible before trying to login.
|
||||
|
||||
FCoE
|
||||
~~~~
|
||||
**fcoe=**__<edd|interface|MAC>__:__{dcb|nodcb}__::
|
||||
@@ -765,18 +799,21 @@ Booting live images
|
||||
Dracut offers multiple options for live booted images:
|
||||
|
||||
=====================
|
||||
squashfs with read-only filesystem image::: The system will boot with a read
|
||||
only filesystem from the squashfs and apply a writable device mapper snapshot
|
||||
SquashFS with read-only filesystem image::: The system will boot with a read
|
||||
only filesystem from the SquashFS and apply a writable device-mapper snapshot
|
||||
over the read only filesystem. Using this method ensures a relatively fast
|
||||
boot and lower RAM usage. Users **must be careful** to avoid writing too many
|
||||
blocks to the snapshot volume. Once the blocks of the snapshot are exhaused,
|
||||
the live filesystem becomes unusable and requires a reboot.
|
||||
blocks to the snapshot volume. Once the blocks of the snapshot overlay are
|
||||
exhausted, the root filesystem becomes unusable and requires a reboot. A
|
||||
persistent overlay is marked Invalid, and requires a difficult recovery.
|
||||
Non-persistent overlays default to 512 MiB in RAM, but the size can be adjusted
|
||||
with the **rd.live.overlay.size=** kernel command line option.
|
||||
+
|
||||
The filesystem structure is expected to be:
|
||||
+
|
||||
[listing]
|
||||
--
|
||||
squashfs.img | Squashfs downloaded via network
|
||||
squashfs.img | Squashfs from LiveCD .iso downloaded via network
|
||||
!(mount)
|
||||
/LiveOS
|
||||
|- ext3fs.img | Filesystem image to mount read-only
|
||||
@@ -791,11 +828,34 @@ Dracut uses this method of live booting by default. No additional command line
|
||||
options are required other than **root=live:<URL>** to specify the location
|
||||
of your squashed filesystem.
|
||||
+
|
||||
writable filesystem image::: The system will retrieve a compressed filesystem
|
||||
image, connect it to a loopback device, and mount it as a writable volume. More
|
||||
RAM is required during boot but the live filesystem is easier to manage if it
|
||||
becomes full. Users can make a filesystem image of any size and that size will
|
||||
be maintained when the system boots.
|
||||
- The compressed SquashFS image can be copied during boot to RAM at
|
||||
`/run/initramfs/squashed.img` by using the **rd.live.ram=1** option.
|
||||
- A device with a persistent overlay can be booted read only by using the
|
||||
**rd.live.overlay.readonly** option on the kernel command line. This will
|
||||
cause a temporary, writable overlay to be stacked over a read-only snapshot
|
||||
of the root filesystem.
|
||||
+
|
||||
Uncompressed live filesystem image:::
|
||||
When the live system was installed with the '--skipcompress' option of the
|
||||
__livecd-iso-to-disk__ installation script for Live USB devices, the root
|
||||
filesystem image, `ext3fs.img`, is expanded on installation and no SquashFS
|
||||
is involved during boot.
|
||||
+
|
||||
- If **rd.live.ram=1** is used in this situation, the full, uncompressed
|
||||
root filesystem is copied during boot to `/run/initramfs/rootfs.img` in the
|
||||
`/run` tmpfs.
|
||||
+
|
||||
- If **rd.live.overlay=none** is provided as a kernel command line option,
|
||||
a writable, linear device-mapper target is created on boot with no overlay.
|
||||
|
||||
writable filesystem image:::
|
||||
The system will retrieve a compressed filesystem image, extract it to
|
||||
`/run/initramfs/fsimg/rootfs.img`, connect it to a loop device, create a
|
||||
writable, linear device-mapper target at `/dev/mapper/live-rw`, and mount that
|
||||
as a writable volume at `/`. More RAM is required during boot but the live
|
||||
filesystem is easier to manage if it becomes full. Users can make a filesystem
|
||||
image of any size and that size will be maintained when the system boots. There
|
||||
is no persistence of root filesystem changes between boots with this option.
|
||||
+
|
||||
The filesystem structure is expected to be:
|
||||
+
|
||||
@@ -803,7 +863,7 @@ The filesystem structure is expected to be:
|
||||
--
|
||||
rootfs.tgz | Compressed tarball containing fileystem image
|
||||
!(unpack)
|
||||
/rootfs.img | Filesystem image
|
||||
/rootfs.img | Filesystem image at /run/initramfs/fsimg/
|
||||
!(mount)
|
||||
/bin | Live filesystem
|
||||
/boot |
|
||||
@@ -811,11 +871,23 @@ rootfs.tgz | Compressed tarball containing fileystem image
|
||||
... |
|
||||
--
|
||||
+
|
||||
To use this boot option, ensure that **rd.writable_fsimg=1** is in your kernel
|
||||
To use this boot option, ensure that **rd.writable.fsimg=1** is in your kernel
|
||||
command line and add the **root=live:<URL>** to specify the location
|
||||
of your compressed filesystem image tarball.
|
||||
of your compressed filesystem image tarball or SquashFS image.
|
||||
=====================
|
||||
|
||||
**rd.writable.fsimg=**1::
|
||||
Enables writable filesystem support. The system will boot with a fully
|
||||
writable (but non-persistent) filesystem without snapshots __(see notes above
|
||||
about available live boot options)__. You can use the **rootflags** option to
|
||||
set mount options for the live filesystem as well __(see documentation about
|
||||
rootflags in the **Standard** section above)__.
|
||||
This implies that the whole image is copied to RAM before the boot continues.
|
||||
+
|
||||
NOTE: There must be enough free RAM available to hold the complete image.
|
||||
+
|
||||
This method is very suitable for diskless boots.
|
||||
|
||||
**root=**live:__<url>__::
|
||||
Boots a live image retrieved from __<url>__. Valid handlers: __http, https, ftp, torrent, tftp__.
|
||||
+
|
||||
@@ -834,11 +906,46 @@ Enables debug output from the live boot process.
|
||||
Specifies the directory within the squashfs where the ext3fs.img or rootfs.img
|
||||
can be found. By default, this is __LiveOS__.
|
||||
|
||||
**rd.writable.fsimg=**1::
|
||||
Enables writable filesystem support. The system will boot with a fully
|
||||
writable filesystem without snapshots __(see notes above about available live boot options)__.
|
||||
You can use the **rootflags** option to set mount options for the live
|
||||
filesystem as well __(see documentation about rootflags in the **Standard** section above)__.
|
||||
**rd.live.squashimg=**__<filename of SquashFS image>__::
|
||||
Specifies the filename for a SquashFS image of the root filesystem.
|
||||
By default, this is __squashfs.img__.
|
||||
|
||||
**rd.live.ram=**1::
|
||||
Copy the complete image to RAM and use this for booting. This is useful
|
||||
when the image resides on, i.e., a DVD which needs to be ejected later on.
|
||||
|
||||
**rd.live.overlay=**__<devspec>__:__(<pathspec>|auto)__|__none__::
|
||||
Allow the usage of a permanent overlay.
|
||||
- _<devspec>_ specifies the path to a device with a mountable filesystem.
|
||||
- _<pathspec>_ is the path to a file within that filesystem, which shall be
|
||||
used to persist the changes made to the device specified by the
|
||||
**root=live:__<url>__** option.
|
||||
- _none_ specifies no overlay when an uncompressed live root filesystem is
|
||||
available.
|
||||
+
|
||||
[listing]
|
||||
.Example
|
||||
--
|
||||
rd.live.overlay=/dev/sdb1:persistent-overlay.img
|
||||
--
|
||||
|
||||
**rd.live.overlay.size=**__<size_MiB>__::
|
||||
Specifies a non-persistent overlay size in MiB. The default is _512_.
|
||||
|
||||
**rd.live.overlay.readonly=**1::
|
||||
Specifies a non-persistent, writable snapshot overlay to be stacked over a
|
||||
read-only snapshot of the root filesystem, `/dev/mapper/live-ro`.
|
||||
|
||||
**rd.live.overlay.reset=**1::
|
||||
Specifies that a persistent overlay should be reset on boot. All root
|
||||
filesystem changes are vacated by this action.
|
||||
|
||||
**rd.live.overlay.thin=**1::
|
||||
Enables the usage of thin snapshots instead of classic dm snapshots.
|
||||
The advantage of thin snapshots is that they support discards, and will free
|
||||
blocks that are not claimed by the filesystem. In this use case, this means
|
||||
that memory is given back to the kernel when the filesystem does not claim it
|
||||
anymore.
|
||||
|
||||
|
||||
Plymouth Boot Splash
|
||||
|
54
dracut.conf
54
dracut.conf
@@ -1,51 +1,3 @@
|
||||
# PUT YOUR CONFIG HERE OR IN separate files named *.conf
|
||||
# in /etc/dracut.conf.d
|
||||
# SEE man dracut.conf(5)
|
||||
|
||||
# Sample dracut config file
|
||||
|
||||
#logfile=/var/log/dracut.log
|
||||
#fileloglvl=6
|
||||
|
||||
# Exact list of dracut modules to use. Modules not listed here are not going
|
||||
# to be included. If you only want to add some optional modules use
|
||||
# add_dracutmodules option instead.
|
||||
#dracutmodules+=""
|
||||
|
||||
# dracut modules to omit
|
||||
#omit_dracutmodules+=""
|
||||
|
||||
# dracut modules to add to the default
|
||||
#add_dracutmodules+=""
|
||||
|
||||
# additional kernel modules to the default
|
||||
#add_drivers+=""
|
||||
|
||||
# list of kernel filesystem modules to be included in the generic initramfs
|
||||
#filesystems+=""
|
||||
|
||||
# build initrd only to boot current hardware
|
||||
#hostonly="yes"
|
||||
#
|
||||
|
||||
# install local /etc/mdadm.conf
|
||||
#mdadmconf="no"
|
||||
|
||||
# install local /etc/lvm/lvm.conf
|
||||
#lvmconf="no"
|
||||
|
||||
# A list of fsck tools to install. If it's not specified, module's hardcoded
|
||||
# default is used, currently: "umount mount /sbin/fsck* xfs_db xfs_check
|
||||
# xfs_repair e2fsck jfs_fsck reiserfsck btrfsck". The installation is
|
||||
# opportunistic, so non-existing tools are just ignored.
|
||||
#fscks=""
|
||||
|
||||
# inhibit installation of any fsck tools
|
||||
#nofscks="yes"
|
||||
|
||||
# mount / and /usr read-only by default
|
||||
#ro_mnt="no"
|
||||
|
||||
# set the directory for temporary files
|
||||
# default: /var/tmp
|
||||
#tmpdir=/tmp
|
||||
# PUT YOUR CONFIG IN separate files
|
||||
# in /etc/dracut.conf.d named "<name>.conf"
|
||||
# SEE man dracut.conf(5) for options
|
||||
|
@@ -10,7 +10,8 @@ dracut.conf - configuration file(s) for dracut
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
_/etc/dracut.conf_ _/etc/dracut.conf.d/*.conf_
|
||||
_/etc/dracut.conf_
|
||||
_/etc/dracut.conf.d/\*.conf_
|
||||
_/usr/lib/dracut/dracut.conf.d/*.conf_
|
||||
|
||||
Description
|
||||
@@ -30,15 +31,19 @@ dracut command line options will overwrite any values set here.
|
||||
|
||||
Configuration files must have the extension .conf; other extensions are ignored.
|
||||
|
||||
*add_dracutmodules+=*" __<dracut modules>__ "::
|
||||
Add a space-separated list of dracut modules to call when building the
|
||||
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.
|
||||
|
||||
*dracutmodules+=*" __<dracut modules>__ "::
|
||||
Specify a space-separated list of dracut modules to call when building the
|
||||
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.
|
||||
This option forces dracut to only include the specified dracut modules.
|
||||
In most cases the "add_dracutmodules" option is what you want to use.
|
||||
|
||||
*omit_dracutmodules+=*" __<dracut modules>__ "::
|
||||
Omit a space-separated list of dracut modules.
|
||||
|
||||
*add_dracutmodules+=*" __<dracut modules>__ "::
|
||||
Add a space-separated list of dracut modules.
|
||||
Omit a space-separated list of dracut modules to call when building the
|
||||
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.
|
||||
|
||||
*drivers+=*" __<kernel modules>__ "::
|
||||
Specify a space-separated list of kernel modules to exclusively include in
|
||||
@@ -74,6 +79,13 @@ Configuration files must have the extension .conf; other extensions are ignored.
|
||||
Specify additional files to include in the initramfs, separated by spaces,
|
||||
if they exist.
|
||||
|
||||
*compress=*"__{bzip2|lzma|xz|gzip|lzo|lz4|<compressor [args ...]>}__"::
|
||||
Compress the generated initramfs using the passed compression program. If
|
||||
you pass it just the name of a compression program, it will call that
|
||||
program with known-working arguments. If you pass arguments, it will be called
|
||||
with exactly those arguments. Depending on what you pass, this may result in
|
||||
an initramfs that the kernel cannot decompress.
|
||||
|
||||
*do_strip=*"__{yes|no}__"::
|
||||
Strip binaries in the initramfs (default=yes)
|
||||
|
||||
@@ -84,7 +96,7 @@ Configuration files must have the extension .conf; other extensions are ignored.
|
||||
Host-Only mode: Install only what is needed for booting the local host
|
||||
instead of a generic host and generate host-specific configuration.
|
||||
|
||||
*hostonly_cmdline*"__{yes|no}__"::
|
||||
*hostonly_cmdline=*"__{yes|no}__"::
|
||||
If set, store the kernel command line arguments needed in the initramfs
|
||||
|
||||
*persistent_policy=*"__<policy>__"::
|
||||
@@ -189,6 +201,16 @@ provide a valid _/etc/fstab_.
|
||||
*loginstall=*"__<DIR>__"::
|
||||
Log all files installed from the host to _<DIR>_.
|
||||
|
||||
*uefi_stub=*"_<FILE>_"::
|
||||
Specifies the UEFI stub loader, which will load the attached kernel, initramfs and
|
||||
kernel command line and boots the kernel. The default is
|
||||
_/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
|
||||
or _/usr/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
|
||||
|
||||
*kernel_image=*"_<FILE>_"::
|
||||
Specifies the kernel image, which to include in the UEFI executable. The default is
|
||||
_/lib/modules/<KERNEL-VERSION>/vmlinuz_ or _/boot/vmlinuz-<KERNEL-VERSION>_
|
||||
|
||||
Files
|
||||
-----
|
||||
_/etc/dracut.conf_::
|
||||
|
@@ -15,4 +15,6 @@ systemdsystemunitdir=/usr/lib/systemd/system
|
||||
systemdsystemconfdir=/etc/systemd/system
|
||||
udevdir=/usr/lib/udev
|
||||
hostonly="yes"
|
||||
hostonly_cmdline="no"
|
||||
early_microcode="yes"
|
||||
reproducible="yes"
|
||||
|
@@ -19,7 +19,7 @@ you can replace init with your own version of _99base_, this is not encouraged.
|
||||
Instead you should use, if possible, the hooks of dracut. All hooks, and the
|
||||
point of time in which they are executed, are described in <<stages>>.
|
||||
|
||||
The main script, which creates the initramfs is dracut itsself. It parses all
|
||||
The main script, which creates the initramfs is dracut itself. It parses all
|
||||
arguments and sets up the directory, in which everything is installed. It then
|
||||
executes all check, install, installkernel scripts found in the modules, which
|
||||
are to be processed. After everything is installed, the install directory is
|
||||
|
69
dracut.spec
69
dracut.spec
@@ -1,6 +1,11 @@
|
||||
%define dracutlibdir %{_prefix}/lib/dracut
|
||||
%bcond_without doc
|
||||
|
||||
# We ship a .pc file but don't want to have a dep on pkg-config. We
|
||||
# strip the automatically generated dep here and instead co-own the
|
||||
# directory.
|
||||
%global __requires_exclude pkg-config
|
||||
|
||||
# Variables must be defined
|
||||
%define with_nbd 1
|
||||
|
||||
@@ -60,7 +65,6 @@ BuildRequires: docbook-style-xsl docbook-dtds libxslt
|
||||
BuildRequires: asciidoc
|
||||
%endif
|
||||
|
||||
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel}
|
||||
# no "provides", because dracut does not offer
|
||||
# all functionality of the obsoleted packages
|
||||
@@ -92,15 +96,25 @@ Requires: cpio
|
||||
Requires: filesystem >= 2.1.0
|
||||
Requires: findutils
|
||||
Requires: grep
|
||||
Requires: hardlink
|
||||
Requires: gzip xz
|
||||
Requires: kmod
|
||||
Requires: sed
|
||||
Requires: xz
|
||||
Requires: gzip
|
||||
|
||||
%if 0%{?fedora} > 22
|
||||
Recommends: grubby
|
||||
Recommends: hardlink
|
||||
Recommends: pigz
|
||||
Recommends: kpartx
|
||||
%else
|
||||
Requires: hardlink
|
||||
Requires: gzip
|
||||
Requires: kpartx
|
||||
%endif
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} > 6
|
||||
Requires: util-linux >= 2.21
|
||||
Requires: systemd >= 199
|
||||
Requires: systemd >= 219
|
||||
Requires: procps-ng
|
||||
Conflicts: grubby < 8.23
|
||||
Conflicts: initscripts < 8.63-1
|
||||
@@ -168,6 +182,16 @@ Requires: libcap
|
||||
This package requires everything which is needed to build an
|
||||
initramfs with dracut, which drops capabilities.
|
||||
|
||||
%package live
|
||||
Summary: dracut modules to build a dracut initramfs with live image capabilities
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: %{name}-network = %{version}-%{release}
|
||||
Requires: tar gzip coreutils bash device-mapper curl
|
||||
|
||||
%description live
|
||||
This package requires everything which is needed to build an
|
||||
initramfs with dracut, with live image capabilities, like Live CDs.
|
||||
|
||||
%package config-generic
|
||||
Summary: dracut configuration to turn off hostonly image generation
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
@@ -195,20 +219,9 @@ Requires: %{name} = %{version}-%{release}
|
||||
This package contains tools to assemble the local initrd and host configuration.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{name}-%{version}
|
||||
%autosetup -n %{name}-%{version} -S git_am
|
||||
cp %{SOURCE1} .
|
||||
|
||||
%if %{defined PATCH1}
|
||||
git init
|
||||
git config user.email "dracut-maint@redhat.com"
|
||||
git config user.name "Fedora dracut team"
|
||||
git add .
|
||||
git commit -a -q -m "%{version} baseline."
|
||||
|
||||
# Apply all the patches.
|
||||
git am -p1 %{patches}
|
||||
%endif
|
||||
|
||||
%build
|
||||
%configure --systemdsystemunitdir=%{_unitdir} --bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) --libdir=%{_prefix}/lib \
|
||||
%if %{without doc}
|
||||
@@ -286,10 +299,6 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/
|
||||
> $RPM_BUILD_ROOT/etc/system-fips
|
||||
%endif
|
||||
|
||||
# create compat symlink
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
|
||||
ln -sr $RPM_BUILD_ROOT%{_bindir}/dracut $RPM_BUILD_ROOT%{_sbindir}/dracut
|
||||
|
||||
%clean
|
||||
rm -rf -- $RPM_BUILD_ROOT
|
||||
|
||||
@@ -301,8 +310,6 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%{!?_licensedir:%global license %%doc}
|
||||
%license COPYING lgpl-2.1.txt
|
||||
%{_bindir}/dracut
|
||||
# compat symlink
|
||||
%{_sbindir}/dracut
|
||||
%{_datadir}/bash-completion/completions/dracut
|
||||
%{_datadir}/bash-completion/completions/lsinitrd
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
|
||||
@@ -312,6 +319,7 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%dir %{dracutlibdir}
|
||||
%dir %{dracutlibdir}/modules.d
|
||||
%{dracutlibdir}/dracut-functions.sh
|
||||
%{dracutlibdir}/dracut-init.sh
|
||||
%{dracutlibdir}/dracut-functions
|
||||
%{dracutlibdir}/dracut-version.sh
|
||||
%{dracutlibdir}/dracut-logger.sh
|
||||
@@ -324,6 +332,8 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%endif
|
||||
%dir %{_sysconfdir}/dracut.conf.d
|
||||
%dir %{dracutlibdir}/dracut.conf.d
|
||||
%dir %{_datadir}/pkgconfig
|
||||
%{_datadir}/pkgconfig/dracut.pc
|
||||
|
||||
%if %{with doc}
|
||||
%{_mandir}/man8/dracut.8*
|
||||
@@ -345,6 +355,8 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%{dracutlibdir}/modules.d/00bootchart
|
||||
%endif
|
||||
%{dracutlibdir}/modules.d/00bash
|
||||
%{dracutlibdir}/modules.d/00systemd
|
||||
%{dracutlibdir}/modules.d/01systemd-initrd
|
||||
%{dracutlibdir}/modules.d/03modsign
|
||||
%{dracutlibdir}/modules.d/03rescue
|
||||
%{dracutlibdir}/modules.d/04watchdog
|
||||
@@ -359,7 +371,6 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%{dracutlibdir}/modules.d/90crypt
|
||||
%{dracutlibdir}/modules.d/90dm
|
||||
%{dracutlibdir}/modules.d/90dmraid
|
||||
%{dracutlibdir}/modules.d/90dmsquash-live
|
||||
%{dracutlibdir}/modules.d/90kernel-modules
|
||||
%{dracutlibdir}/modules.d/90lvm
|
||||
%{dracutlibdir}/modules.d/90mdraid
|
||||
@@ -389,11 +400,10 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%{dracutlibdir}/modules.d/98pollcdrom
|
||||
%{dracutlibdir}/modules.d/98selinux
|
||||
%{dracutlibdir}/modules.d/98syslog
|
||||
%{dracutlibdir}/modules.d/98systemd
|
||||
%{dracutlibdir}/modules.d/98dracut-systemd
|
||||
%{dracutlibdir}/modules.d/98usrmount
|
||||
%{dracutlibdir}/modules.d/99base
|
||||
%{dracutlibdir}/modules.d/99fs-lib
|
||||
%{dracutlibdir}/modules.d/99img-lib
|
||||
%{dracutlibdir}/modules.d/99shutdown
|
||||
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
|
||||
%dir %{_sharedstatedir}/initramfs
|
||||
@@ -422,10 +432,11 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
|
||||
%files network
|
||||
%defattr(-,root,root,0755)
|
||||
%{dracutlibdir}/modules.d/02systemd-networkd
|
||||
%{dracutlibdir}/modules.d/40network
|
||||
%{dracutlibdir}/modules.d/90kernel-network-modules
|
||||
%{dracutlibdir}/modules.d/95fcoe
|
||||
%{dracutlibdir}/modules.d/95iscsi
|
||||
%{dracutlibdir}/modules.d/90livenet
|
||||
%{dracutlibdir}/modules.d/90qemu-net
|
||||
%{dracutlibdir}/modules.d/95cifs
|
||||
%{dracutlibdir}/modules.d/95nbd
|
||||
@@ -452,6 +463,12 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%defattr(-,root,root,0755)
|
||||
%{dracutlibdir}/modules.d/02caps
|
||||
|
||||
%files live
|
||||
%defattr(-,root,root,0755)
|
||||
%{dracutlibdir}/modules.d/99img-lib
|
||||
%{dracutlibdir}/modules.d/90dmsquash-live
|
||||
%{dracutlibdir}/modules.d/90livenet
|
||||
|
||||
%files tools
|
||||
%defattr(-,root,root,0755)
|
||||
|
||||
|
@@ -99,10 +99,6 @@ raid with encryption and LVM on top), as long as you specify the correct
|
||||
filesystem LABEL or UUID on the kernel command line for your root device, dracut
|
||||
will find it and boot from it.
|
||||
|
||||
The kernel command line usually can be configured in _/boot/grub/grub.conf_ or
|
||||
_/boot/grub2/grub.cfg_, if grub is your bootloader and it also can be edited in
|
||||
the real boot process in the grub menu.
|
||||
|
||||
The kernel command line can also be provided by the dhcp server with the
|
||||
root-path option. See <<NetworkBoot>>.
|
||||
|
||||
@@ -310,7 +306,7 @@ stick and mount that. Then you can store the output for later inspection.
|
||||
In all cases, the following should be mentioned and attached to your bug report:
|
||||
|
||||
* The exact kernel command-line used. Typically from the bootloader
|
||||
configuration file (e.g. _/etc/grub.conf_) or from _/proc/cmdline_.
|
||||
configuration file (e.g. _/boot/grub2/grub.cfg_) or from _/proc/cmdline_.
|
||||
* A copy of your disk partition information from _/etc/fstab_, which might be
|
||||
obtained booting an old working initramfs or a rescue medium.
|
||||
* Turn on dracut debugging (see _the 'debugging dracut' section_), and attach
|
||||
@@ -345,7 +341,7 @@ logging during the system boot. This section documents configuring a
|
||||
serial console connection to record boot messages.
|
||||
|
||||
. First, enable serial console output for both the kernel and the bootloader.
|
||||
. Open the file _/etc/grub.conf_ for editing. Below the line ''timeout=5'', add
|
||||
. Open the file _/boot/grub2/grub.cfg_ for editing. Below the line ''timeout=5'', add
|
||||
the following:
|
||||
+
|
||||
----
|
||||
@@ -353,14 +349,14 @@ serial --unit=0 --speed=9600
|
||||
terminal --timeout=5 serial console
|
||||
----
|
||||
+
|
||||
. Also in _/etc/grub.conf_, add the following boot arguemnts to the ''kernel''
|
||||
. Also in _/boot/grub2/grub.cfg_, add the following boot arguemnts to the ''kernel''
|
||||
line:
|
||||
+
|
||||
----
|
||||
console=tty0 console=ttyS0,9600
|
||||
----
|
||||
+
|
||||
. When finished, the _/etc/grub.conf_ file should look similar to the example
|
||||
. When finished, the _/boot/grub2/grub.cfg_ file should look similar to the example
|
||||
below.
|
||||
+
|
||||
----
|
||||
@@ -395,10 +391,10 @@ dracut offers a shell for interactive debugging in the event dracut fails to
|
||||
locate your root filesystem. To enable the shell:
|
||||
|
||||
. Add the boot parameter ''rd.shell'' to your bootloader configuration file
|
||||
(e.g. _/etc/grub.conf_)
|
||||
(e.g. _/boot/grub2/grub.cfg_)
|
||||
. Remove the boot arguments ''rhgb'' and ''quiet''
|
||||
+
|
||||
A sample _/etc/grub.conf_ bootloader configuration file is listed below.
|
||||
A sample _/boot/grub2/grub.cfg_ bootloader configuration file is listed below.
|
||||
+
|
||||
----
|
||||
default=0
|
||||
|
@@ -222,7 +222,7 @@ static int cp(const char *src, const char *dst)
|
||||
if (ret == 0) {
|
||||
struct timeval tv[2];
|
||||
if (fchown(dest_desc, sb.st_uid, sb.st_gid) != 0)
|
||||
if(fchown(dest_desc, (__uid_t) - 1, sb.st_gid) != 0)
|
||||
if(fchown(dest_desc, (uid_t) - 1, sb.st_gid) != 0)
|
||||
log_error("Failed to chown %s: %m", dst);
|
||||
tv[0].tv_sec = sb.st_atime;
|
||||
tv[0].tv_usec = 0;
|
||||
@@ -388,6 +388,11 @@ static int resolve_deps(const char *src)
|
||||
break;
|
||||
}
|
||||
|
||||
/* musl ldd */
|
||||
if (strstr(buf, "Not a valid dynamic program"))
|
||||
break;
|
||||
|
||||
/* glibc */
|
||||
if (strstr(buf, "not a dynamic executable"))
|
||||
break;
|
||||
|
||||
@@ -704,7 +709,8 @@ static void usage(int status)
|
||||
" -L --logdir <DIR> Log files, which were installed from the host to <DIR>\n"
|
||||
" -R --resolvelazy Only install shebang executables and libraries\n"
|
||||
" for all SOURCE files\n"
|
||||
" -H --fips Also install all '.SOURCE.hmac' files\n"
|
||||
" -H --hostonly Mark all SOURCE files as hostonly\n\n"
|
||||
" -f --fips Also install all '.SOURCE.hmac' files\n"
|
||||
" -v --verbose Show more output\n"
|
||||
" --debug Show debug output\n"
|
||||
" --version Show package version\n"
|
||||
|
@@ -20,6 +20,8 @@
|
||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||
***/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
@@ -27,6 +29,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <sched.h>
|
||||
#include <limits.h>
|
||||
|
78
lsinitrd.sh
78
lsinitrd.sh
@@ -108,10 +108,16 @@ if ! [[ -f "$image" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dracutlibdirs() {
|
||||
for d in lib64/dracut lib/dracut usr/lib64/dracut usr/lib/dracut; do
|
||||
echo "$d/$1"
|
||||
done
|
||||
}
|
||||
|
||||
extract_files()
|
||||
{
|
||||
(( ${#filenames[@]} == 1 )) && nofileinfo=1
|
||||
for f in ${!filenames[@]}; do
|
||||
for f in "${!filenames[@]}"; do
|
||||
[[ $nofileinfo ]] || echo "initramfs:/$f"
|
||||
[[ $nofileinfo ]] || echo "========================================================================"
|
||||
$CAT $image | cpio --extract --verbose --quiet --to-stdout $f 2>/dev/null
|
||||
@@ -124,7 +130,8 @@ extract_files()
|
||||
list_modules()
|
||||
{
|
||||
echo "dracut modules:"
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/modules.txt' 'usr/lib/dracut/modules.txt' 2>/dev/null
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
|
||||
$(dracutlibdirs modules.txt) 2>/dev/null
|
||||
((ret+=$?))
|
||||
}
|
||||
|
||||
@@ -142,7 +149,7 @@ list_files()
|
||||
|
||||
|
||||
if (( ${#filenames[@]} <= 0 )); then
|
||||
echo "Image: $image: $(du -h $image | while read a b; do echo $a;done)"
|
||||
echo "Image: $image: $(du -h $image | while read a b || [ -n "$a" ]; do echo $a;done)"
|
||||
echo "========================================================================"
|
||||
fi
|
||||
|
||||
@@ -169,38 +176,35 @@ case $bin in
|
||||
;;
|
||||
esac
|
||||
|
||||
CAT=$({
|
||||
if [[ $SKIP ]]; then
|
||||
$SKIP "$image"
|
||||
if [[ $SKIP ]] ; then
|
||||
bin="$($SKIP "$image" | { read -N 6 bin && echo "$bin" ; })"
|
||||
else
|
||||
read -N 6 bin < "$image"
|
||||
fi
|
||||
case $bin in
|
||||
$'\x1f\x8b'*)
|
||||
CAT="zcat --"
|
||||
;;
|
||||
BZh*)
|
||||
CAT="bzcat --"
|
||||
;;
|
||||
$'\x71\xc7'*|070701)
|
||||
CAT="cat --"
|
||||
;;
|
||||
$'\x02\x21'*)
|
||||
CAT="lz4 -d -c"
|
||||
;;
|
||||
$'\x89'LZO$'\0'*)
|
||||
CAT="lzop -d -c"
|
||||
;;
|
||||
*)
|
||||
if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
|
||||
CAT="xzcat --single-stream --"
|
||||
else
|
||||
cat "$image"
|
||||
fi } | {
|
||||
read -N 6 bin
|
||||
case $bin in
|
||||
$'\x1f\x8b'*)
|
||||
echo "zcat --"
|
||||
;;
|
||||
BZh*)
|
||||
echo "bzcat --"
|
||||
;;
|
||||
$'\x71\xc7'*|070701)
|
||||
echo "cat --"
|
||||
;;
|
||||
$'\x02\x21'*)
|
||||
echo "lz4 -d -c"
|
||||
;;
|
||||
$'\x89'LZO$'\0'*)
|
||||
echo "lzop -d -c"
|
||||
;;
|
||||
*)
|
||||
if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
|
||||
echo "xzcat --single-stream --"
|
||||
else
|
||||
echo "xzcat --"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
})
|
||||
CAT="xzcat --"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
skipcpio()
|
||||
{
|
||||
@@ -217,7 +221,8 @@ ret=0
|
||||
if (( ${#filenames[@]} > 0 )); then
|
||||
extract_files
|
||||
else
|
||||
version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/dracut-*' 'usr/lib/dracut/dracut-*' 2>/dev/null)
|
||||
version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
|
||||
$(dracutlibdirs 'dracut-*') 2>/dev/null)
|
||||
((ret+=$?))
|
||||
echo "Version: $version"
|
||||
echo
|
||||
@@ -226,7 +231,8 @@ else
|
||||
echo "========================================================================"
|
||||
else
|
||||
echo -n "Arguments: "
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/build-parameter.txt' 'usr/lib/dracut/build-parameter.txt' 2>/dev/null
|
||||
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
|
||||
$(dracutlibdirs build-parameter.txt) 2>/dev/null
|
||||
echo
|
||||
list_modules
|
||||
list_files
|
||||
|
@@ -145,6 +145,33 @@ is_xen_kernel() {
|
||||
return
|
||||
}
|
||||
|
||||
# kernel_image_gz_from_image() and kernel_version_from_image() are helpers
|
||||
# for arm* kernels which produce zImage files which cannot be read from
|
||||
# get_kernel_version -> get rid of this workaround if possible
|
||||
kernel_image_gz_from_image() {
|
||||
local arch=$(uname -i)
|
||||
local r=${1}.gz
|
||||
|
||||
# uImage kernels can't be extracted directly. Use the vmlinux.gz instead
|
||||
r=${r//uImage/vmlinux}
|
||||
|
||||
# on ARM a zImage can't be extracted directly. Other platforms define it
|
||||
# as a gzipped vmlinux file, but not ARM. So only on ARM, use vmlinux.gz.
|
||||
if [[ $arch =~ arm ]] || [[ $arch =~ aarch ]]; then
|
||||
r=${r//zImage/vmlinux}
|
||||
fi
|
||||
|
||||
echo $r
|
||||
}
|
||||
|
||||
kernel_version_from_image() {
|
||||
local kernel_image="$1" kernel_image_gz=$(kernel_image_gz_from_image "$1")
|
||||
|
||||
if get_kernel_version "$kernel_image" 2>/dev/null; then
|
||||
return
|
||||
fi
|
||||
get_kernel_version "$kernel_image_gz" 2>/dev/null
|
||||
}
|
||||
|
||||
# Taken over from SUSE mkinitrd
|
||||
default_kernel_images() {
|
||||
@@ -183,7 +210,8 @@ default_kernel_images() {
|
||||
|
||||
[ -L "$boot_dir/$kernel_image" ] && continue
|
||||
[ "${kernel_image%%.gz}" != "$kernel_image" ] && continue
|
||||
kernel_version=$(/usr/bin/get_kernel_version \
|
||||
|
||||
kernel_version=$(kernel_version_from_image \
|
||||
$boot_dir/$kernel_image 2> /dev/null)
|
||||
initrd_image=$(echo $kernel_image | sed -e "s|${regex}|initrd|")
|
||||
if [ "$kernel_image" != "$initrd_image" -a \
|
||||
@@ -280,7 +308,8 @@ done
|
||||
|
||||
[[ $targets && $kernels ]] || default_kernel_images
|
||||
if [[ ! $targets || ! $kernels ]];then
|
||||
error "No kernel found in $boot_dir"
|
||||
error "No kernel found in $boot_dir or bad modules dir in /lib/modules"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# We can have several targets/kernels, transform the list to an array
|
||||
@@ -301,6 +330,8 @@ fi
|
||||
[[ $domu_module_list ]] || domu_module_list="${DOMU_INITRD_MODULES}"
|
||||
shopt -s extglob
|
||||
|
||||
failed=""
|
||||
|
||||
for ((i=0 ; $i<${#targets[@]} ; i++)); do
|
||||
|
||||
if [[ $img_vers ]];then
|
||||
@@ -329,14 +360,18 @@ for ((i=0 ; $i<${#targets[@]} ; i++)); do
|
||||
# expansion magics
|
||||
if [ -n "${modules_all}" ];then
|
||||
$dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel" &>/dev/null
|
||||
[ $? -ne 0 ] && failed="$failed $target"
|
||||
else
|
||||
$dracut_cmd $dracut_args "$target" "$kernel" &>/dev/null
|
||||
[ $? -ne 0 ] && failed="$failed $target"
|
||||
fi
|
||||
else
|
||||
if [ -n "${modules_all}" ];then
|
||||
$dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel"
|
||||
[ $? -ne 0 ] && failed="$failed $target"
|
||||
else
|
||||
$dracut_cmd $dracut_args "$target" "$kernel"
|
||||
[ $? -ne 0 ] && failed="$failed $target"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
@@ -345,4 +380,12 @@ if [ "$skip_update_bootloader" ] ; then
|
||||
echo 2>&1 "Did not refresh the bootloader. You might need to refresh it manually."
|
||||
else
|
||||
update-bootloader --refresh
|
||||
[ $? -ne 0 ] && echo "Updating bootloader failed" && exit 1
|
||||
fi
|
||||
|
||||
if [ "$failed" != "" ]; then
|
||||
echo "Generating $failed targets failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
@@ -51,14 +51,14 @@ install() {
|
||||
$systemdsystemunitdir/basic.target \
|
||||
$systemdsystemunitdir/halt.target \
|
||||
$systemdsystemunitdir/kexec.target \
|
||||
$systemdsystemunitdir/initrd.target \
|
||||
$systemdsystemunitdir/initrd-fs.target \
|
||||
$systemdsystemunitdir/initrd-root-fs.target \
|
||||
$systemdsystemunitdir/local-fs.target \
|
||||
$systemdsystemunitdir/local-fs-pre.target \
|
||||
$systemdsystemunitdir/remote-fs.target \
|
||||
$systemdsystemunitdir/remote-fs-pre.target \
|
||||
$systemdsystemunitdir/multi-user.target \
|
||||
$systemdsystemunitdir/network.target \
|
||||
$systemdsystemunitdir/network-pre.target \
|
||||
$systemdsystemunitdir/network-online.target \
|
||||
$systemdsystemunitdir/nss-lookup.target \
|
||||
$systemdsystemunitdir/nss-user-lookup.target \
|
||||
$systemdsystemunitdir/poweroff.target \
|
||||
@@ -98,6 +98,7 @@ install() {
|
||||
$systemdsystemunitdir/systemd-journald.service \
|
||||
$systemdsystemunitdir/systemd-vconsole-setup.service \
|
||||
$systemdsystemunitdir/systemd-random-seed-load.service \
|
||||
$systemdsystemunitdir/systemd-random-seed.service \
|
||||
$systemdsystemunitdir/systemd-sysctl.service \
|
||||
\
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-modules-load.service \
|
||||
@@ -115,19 +116,21 @@ install() {
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-sysctl.service \
|
||||
\
|
||||
$systemdsystemunitdir/ctrl-alt-del.target \
|
||||
$systemdsystemunitdir/reboot.target \
|
||||
$systemdsystemunitdir/systemd-reboot.service \
|
||||
$systemdsystemunitdir/syslog.socket \
|
||||
$systemdsystemunitdir/initrd-switch-root.target \
|
||||
$systemdsystemunitdir/initrd-switch-root.service \
|
||||
$systemdsystemunitdir/initrd-cleanup.service \
|
||||
$systemdsystemunitdir/initrd-udevadm-cleanup-db.service \
|
||||
$systemdsystemunitdir/initrd-parse-etc.service \
|
||||
\
|
||||
$systemdsystemunitdir/slices.target \
|
||||
$systemdsystemunitdir/system.slice \
|
||||
\
|
||||
$tmpfilesdir/systemd.conf \
|
||||
\
|
||||
journalctl systemctl echo swapoff systemd-cgls systemd-tmpfiles
|
||||
journalctl systemctl \
|
||||
echo swapoff \
|
||||
kmod insmod rmmod modprobe modinfo depmod lsmod \
|
||||
mount umount reboot poweroff \
|
||||
systemd-run systemd-escape \
|
||||
systemd-cgls systemd-tmpfiles
|
||||
|
||||
inst_multiple -o \
|
||||
/usr/lib/modules-load.d/*.conf \
|
||||
@@ -137,7 +140,7 @@ install() {
|
||||
local _line i
|
||||
for i in "$1"/*.conf; do
|
||||
[[ -f $i ]] || continue
|
||||
while read _line; do
|
||||
while read _line || [ -n "$_line" ]; do
|
||||
case $_line in
|
||||
\#*)
|
||||
;;
|
||||
@@ -175,30 +178,15 @@ install() {
|
||||
|
||||
# install adm user/group for journald
|
||||
inst_multiple nologin
|
||||
egrep '^systemd-journal:' "$initdir/etc/passwd" 2>/dev/null >> "$initdir/etc/passwd"
|
||||
egrep '^systemd-journal:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
egrep '^adm:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
egrep '^systemd-journal:' /etc/group >> "$initdir/etc/group"
|
||||
egrep '^wheel:' /etc/group >> "$initdir/etc/group"
|
||||
egrep '^adm:' /etc/group >> "$initdir/etc/group"
|
||||
|
||||
ln_r $systemdutildir/systemd "/init"
|
||||
ln_r $systemdutildir/systemd "/sbin/init"
|
||||
|
||||
inst_script "$moddir/dracut-emergency.sh" /bin/dracut-emergency
|
||||
inst_simple "$moddir/emergency.service" ${systemdsystemunitdir}/emergency.service
|
||||
inst_simple "$moddir/dracut-emergency.service" ${systemdsystemunitdir}/dracut-emergency.service
|
||||
inst_simple "$moddir/emergency.service" ${systemdsystemunitdir}/rescue.service
|
||||
|
||||
ln_r "${systemdsystemunitdir}/initrd.target" "${systemdsystemunitdir}/default.target"
|
||||
|
||||
inst_script "$moddir/dracut-cmdline.sh" /bin/dracut-cmdline
|
||||
inst_script "$moddir/dracut-cmdline-ask.sh" /bin/dracut-cmdline-ask
|
||||
inst_script "$moddir/dracut-pre-udev.sh" /bin/dracut-pre-udev
|
||||
inst_script "$moddir/dracut-pre-trigger.sh" /bin/dracut-pre-trigger
|
||||
inst_script "$moddir/dracut-initqueue.sh" /bin/dracut-initqueue
|
||||
inst_script "$moddir/dracut-pre-mount.sh" /bin/dracut-pre-mount
|
||||
inst_script "$moddir/dracut-mount.sh" /bin/dracut-mount
|
||||
inst_script "$moddir/dracut-pre-pivot.sh" /bin/dracut-pre-pivot
|
||||
|
||||
inst_script "$moddir/rootfs-generator.sh" $systemdutildir/system-generators/dracut-rootfs-generator
|
||||
|
||||
inst_binary true
|
||||
ln_r $(type -P true) "/usr/bin/loginctl"
|
||||
ln_r $(type -P true) "/bin/loginctl"
|
||||
@@ -211,8 +199,7 @@ install() {
|
||||
|
||||
for i in \
|
||||
emergency.target \
|
||||
dracut-emergency.service \
|
||||
rescue.service \
|
||||
rescue.target \
|
||||
systemd-ask-password-console.service \
|
||||
systemd-ask-password-plymouth.service \
|
||||
; do
|
||||
@@ -221,24 +208,6 @@ install() {
|
||||
"${systemdsystemunitdir}/${i}.wants/systemd-vconsole-setup.service"
|
||||
done
|
||||
|
||||
mkdir -p "${initdir}/$systemdsystemunitdir/initrd.target.wants"
|
||||
for i in \
|
||||
dracut-cmdline.service \
|
||||
dracut-cmdline-ask.service \
|
||||
dracut-initqueue.service \
|
||||
dracut-mount.service \
|
||||
dracut-pre-mount.service \
|
||||
dracut-pre-pivot.service \
|
||||
dracut-pre-trigger.service \
|
||||
dracut-pre-udev.service \
|
||||
; do
|
||||
inst_simple "$moddir/${i}" "$systemdsystemunitdir/${i}"
|
||||
ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/initrd.target.wants/${i}"
|
||||
done
|
||||
|
||||
inst_simple "$moddir/dracut-tmpfiles.conf" "$tmpfilesdir/dracut-tmpfiles.conf"
|
||||
|
||||
|
||||
mkdir -p "$initdir/etc/systemd"
|
||||
# turn off RateLimit for journal
|
||||
{
|
||||
@@ -247,5 +216,6 @@ install() {
|
||||
echo "RateLimitBurst=0"
|
||||
} >> "$initdir/etc/systemd/journald.conf"
|
||||
|
||||
ln_r "${systemdsystemunitdir}/multi-user.target" "${systemdsystemunitdir}/default.target"
|
||||
}
|
||||
|
@@ -59,8 +59,8 @@ do_rhevh_check()
|
||||
kpath=${1}
|
||||
|
||||
# If we're on RHEV-H, the kernel is in /run/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)
|
||||
HMAC_SUM_ORIG=$(cat $NEWROOT/boot/.vmlinuz-${KERNEL}.hmac | while read a b || [ -n "$a" ]; do printf "%s\n" $a; done)
|
||||
HMAC_SUM_CALC=$(sha512hmac $kpath | while read a b || [ -n "$a" ]; 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
|
||||
@@ -92,7 +92,7 @@ do_fips()
|
||||
if ! modprobe "${_module}"; then
|
||||
# check if kernel provides generic algo
|
||||
_found=0
|
||||
while read _k _s _v; do
|
||||
while read _k _s _v || [ -n "$_k" ]; do
|
||||
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
|
||||
[ "$_v" != "$_module" ] && continue
|
||||
_found=1
|
||||
|
@@ -13,11 +13,12 @@ depends() {
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
local _fipsmodules _mod
|
||||
_fipsmodules="aead aes_generic aes-x86_64 ansi_cprng arc4 blowfish camellia cast6 cbc ccm "
|
||||
_fipsmodules+="chainiv crc32c crct10dif_generic cryptomgr crypto_null ctr cts deflate des des3_ede dm-crypt dm-mod "
|
||||
_fipsmodules="aead aes_generic aes-x86_64 ansi_cprng arc4 authenc authencesn blowfish camellia cast6 cbc ccm "
|
||||
_fipsmodules+="chainiv crc32c crct10dif_generic cryptomgr crypto_null ctr cts deflate des des3_ede dm-crypt dm-mod drbg "
|
||||
_fipsmodules+="ecb eseqiv fcrypt gcm ghash_generic hmac khazad lzo md4 md5 michael_mic rmd128 "
|
||||
_fipsmodules+="rmd160 rmd256 rmd320 rot13 salsa20 seed seqiv serpent sha1 sha224 sha256 sha256_generic "
|
||||
_fipsmodules+="sha384 sha512 sha512_generic tcrypt tea tnepres twofish wp256 wp384 wp512 xeta xtea xts zlib"
|
||||
_fipsmodules+="aes_s390 des_s390 prng sha256_s390 sha_common des_check_key ghash_s390 sha1_s390 sha512_s390"
|
||||
|
||||
mkdir -m 0755 -p "${initdir}/etc/modprobe.d"
|
||||
|
||||
|
68
modules.d/01systemd-initrd/module-setup.sh
Executable file
68
modules.d/01systemd-initrd/module-setup.sh
Executable file
@@ -0,0 +1,68 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
[[ $mount_needs ]] && return 1
|
||||
|
||||
if ! dracut_module_included "systemd"; then
|
||||
derror "systemd-initrd needs systemd in the initramfs"
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo "systemd"
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
local _mods
|
||||
|
||||
inst_multiple -o \
|
||||
$systemdsystemunitdir/initrd.target \
|
||||
$systemdsystemunitdir/initrd-fs.target \
|
||||
$systemdsystemunitdir/initrd-root-fs.target \
|
||||
$systemdsystemunitdir/initrd-switch-root.target \
|
||||
$systemdsystemunitdir/initrd-switch-root.service \
|
||||
$systemdsystemunitdir/initrd-cleanup.service \
|
||||
$systemdsystemunitdir/initrd-udevadm-cleanup-db.service \
|
||||
$systemdsystemunitdir/initrd-parse-etc.service
|
||||
|
||||
ln_r "${systemdsystemunitdir}/initrd.target" "${systemdsystemunitdir}/default.target"
|
||||
|
||||
if [ -e /etc/os-release ]; then
|
||||
. /etc/os-release
|
||||
VERSION+=" "
|
||||
PRETTY_NAME+=" "
|
||||
else
|
||||
VERSION=""
|
||||
PRETTY_NAME=""
|
||||
fi
|
||||
NAME=dracut
|
||||
ID=dracut
|
||||
VERSION+="dracut-$DRACUT_VERSION"
|
||||
PRETTY_NAME+="dracut-$DRACUT_VERSION (Initramfs)"
|
||||
VERSION_ID=$DRACUT_VERSION
|
||||
ANSI_COLOR="0;34"
|
||||
|
||||
{
|
||||
echo NAME=\"$NAME\"
|
||||
echo VERSION=\"$VERSION\"
|
||||
echo ID=$ID
|
||||
echo VERSION_ID=$VERSION_ID
|
||||
echo PRETTY_NAME=\"$PRETTY_NAME\"
|
||||
echo ANSI_COLOR=\"$ANSI_COLOR\"
|
||||
} > $initdir/usr/lib/initrd-release
|
||||
echo dracut-$DRACUT_VERSION > $initdir/lib/dracut/dracut-$DRACUT_VERSION
|
||||
ln -sf ../usr/lib/initrd-release $initdir/etc/initrd-release
|
||||
ln -sf initrd-release $initdir/usr/lib/os-release
|
||||
ln -sf initrd-release $initdir/etc/os-release
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@ 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_USERMODEHELPER_BSET=$(capsh --drop="$CAPS_INIT_DROP" -- -c 'while read a b || [ -n "$a" ]; 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=)
|
||||
|
||||
|
71
modules.d/02systemd-networkd/module-setup.sh
Executable file
71
modules.d/02systemd-networkd/module-setup.sh
Executable file
@@ -0,0 +1,71 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
[[ $mount_needs ]] && return 1
|
||||
|
||||
if ! dracut_module_included "systemd"; then
|
||||
derror "systemd-networkd needs systemd in the initramfs"
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo "systemd kernel-network-modules"
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_multiple -o \
|
||||
$systemdutildir/systemd-networkd \
|
||||
$systemdutildir/systemd-networkd-wait-online \
|
||||
$systemdsystemunitdir/systemd-networkd-wait-online.service \
|
||||
$systemdsystemunitdir/systemd-networkd.service \
|
||||
$systemdsystemunitdir/systemd-networkd.socket \
|
||||
$systemdutildir/network/99-default.link \
|
||||
networkctl ip
|
||||
|
||||
#hostnamectl timedatectl
|
||||
# $systemdutildir/systemd-timesyncd \
|
||||
# $systemdutildir/systemd-timedated \
|
||||
# $systemdutildir/systemd-hostnamed \
|
||||
# $systemdutildir/systemd-resolvd \
|
||||
# $systemdutildir/systemd-resolve-host \
|
||||
# $systemdsystemunitdir/systemd-resolved.service \
|
||||
# $systemdsystemunitdir/systemd-hostnamed.service \
|
||||
# $systemdsystemunitdir/systemd-timesyncd.service \
|
||||
# $systemdsystemunitdir/systemd-timedated.service \
|
||||
# $systemdsystemunitdir/time-sync.target \
|
||||
# /etc/systemd/resolved.conf \
|
||||
|
||||
|
||||
# inst_dir /var/lib/systemd/clock
|
||||
|
||||
egrep '^systemd-network:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
egrep '^systemd-network:' /etc/group >> "$initdir/etc/group"
|
||||
# egrep '^systemd-timesync:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
# egrep '^systemd-timesync:' /etc/group >> "$initdir/etc/group"
|
||||
|
||||
_arch=$(uname -m)
|
||||
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
|
||||
{"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*" \
|
||||
{"tls/$_arch/",tls/,"$_arch/",}"libnss_myhostname.so.*" \
|
||||
{"tls/$_arch/",tls/,"$_arch/",}"libnss_resolve.so.*"
|
||||
|
||||
for i in \
|
||||
systemd-networkd-wait-online.service \
|
||||
systemd-networkd.service \
|
||||
systemd-networkd.socket
|
||||
# systemd-timesyncd.service
|
||||
do
|
||||
systemctl --root "$initdir" enable "$i"
|
||||
done
|
||||
}
|
||||
|
@@ -1,2 +1,2 @@
|
||||
#!/bin/sh
|
||||
[ -c /dev/watchdog ] && echo -n 'V' > /dev/watchdog
|
||||
[ -c /dev/watchdog ] && printf 'V' > /dev/watchdog
|
||||
|
@@ -40,7 +40,7 @@ install() {
|
||||
*) cmd=grep ;;
|
||||
esac
|
||||
|
||||
for INCL in $($cmd "^include " $MAP | while read a a b; do echo ${a//\"/}; done); do
|
||||
for INCL in $($cmd "^include " $MAP | while read a a b || [ -n "$a" ]; do echo ${a//\"/}; done); do
|
||||
for FN in $(find ${kbddir}/keymaps -type f -name $INCL\*); do
|
||||
findkeymap $FN
|
||||
done
|
||||
@@ -114,12 +114,12 @@ install() {
|
||||
rm -f -- "${initdir}${kbddir}/consoletrans/utflist"
|
||||
find "${initdir}${kbddir}/" -name README\* -delete
|
||||
find "${initdir}${kbddir}/" -name '*.gz' -print -quit \
|
||||
| while read line; do
|
||||
| while read line || [ -n "$line" ]; do
|
||||
inst_multiple gzip
|
||||
done
|
||||
|
||||
find "${initdir}${kbddir}/" -name '*.bz2' -print -quit \
|
||||
| while read line; do
|
||||
| while read line || [ -n "$line" ]; do
|
||||
inst_multiple bzip2
|
||||
done
|
||||
}
|
||||
|
@@ -74,7 +74,7 @@ rm -f -- "$testfile"
|
||||
find_mount() {
|
||||
local dev mnt etc wanted_dev
|
||||
wanted_dev="$(readlink -e -q $1)"
|
||||
while read dev mnt etc; do
|
||||
while read dev mnt etc || [ -n "$dev" ]; do
|
||||
[ "$dev" = "$wanted_dev" ] && echo "$dev" && return 0
|
||||
done < /proc/mounts
|
||||
return 1
|
||||
@@ -93,7 +93,7 @@ else
|
||||
return 1
|
||||
fi
|
||||
|
||||
while read a m a; do
|
||||
while read a m a || [ -n "$m" ]; do
|
||||
[ "$m" = "$1" ] && return 0
|
||||
done < /proc/mounts
|
||||
return 1
|
||||
|
@@ -8,9 +8,6 @@ type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
# We already need a set netif here
|
||||
netif=$interface
|
||||
|
||||
# Huh? Interface configured?
|
||||
[ -f "/tmp/net.$netif.up" ] && exit 0
|
||||
|
||||
setup_interface() {
|
||||
ip=$new_ip_address
|
||||
mtu=$new_interface_mtu
|
||||
@@ -21,7 +18,10 @@ setup_interface() {
|
||||
search=$(printf -- "$new_domain_search")
|
||||
namesrv=$new_domain_name_servers
|
||||
hostname=$new_host_name
|
||||
lease_time=$new_dhcp_lease_time
|
||||
[ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time
|
||||
[ -n "$new_max_life" ] && lease_time=$new_max_life
|
||||
preferred_lft=$lease_time
|
||||
[ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life
|
||||
|
||||
[ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
||||
|
||||
@@ -39,19 +39,26 @@ setup_interface() {
|
||||
fi
|
||||
fi
|
||||
|
||||
ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} \
|
||||
valid_lft ${lease_time} preferred_lft ${lease_time} \
|
||||
dev $netif
|
||||
ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif \
|
||||
${lease_time:+valid_lft $lease_time} \
|
||||
${preferred_lft:+preferred_lft ${preferred_lft}}
|
||||
|
||||
[ -n "$gw" ] && echo ip route replace default via $gw dev $netif > /tmp/net.$netif.gw
|
||||
|
||||
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
if [ -n "$gw" ] ; then
|
||||
if [ "$mask" = "255.255.255.255" ] ; then
|
||||
# point-to-point connection => set explicit route to gateway
|
||||
echo ip route add $gw dev $netif > /tmp/net.$netif.gw
|
||||
fi
|
||||
echo ip route replace default via $gw dev $netif >> /tmp/net.$netif.gw
|
||||
fi
|
||||
|
||||
if getargbool 1 rd.peerdns; then
|
||||
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
fi
|
||||
# Note: hostname can be fqdn OR short hostname, so chop off any
|
||||
# trailing domain name and explicity add any domain if set.
|
||||
[ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
|
||||
@@ -74,12 +81,14 @@ setup_interface6() {
|
||||
${lease_time:+valid_lft $lease_time} \
|
||||
${preferred_lft:+preferred_lft ${preferred_lft}}
|
||||
|
||||
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
if getargbool 1 rd.peerdns; then
|
||||
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
|
||||
if [ -n "$namesrv" ] ; then
|
||||
for s in $namesrv; do
|
||||
echo nameserver $s
|
||||
done
|
||||
fi >> /tmp/net.$netif.resolv.conf
|
||||
fi
|
||||
|
||||
# Note: hostname can be fqdn OR short hostname, so chop off any
|
||||
# trailing domain name and explicity add any domain if set.
|
||||
@@ -93,8 +102,9 @@ case $reason in
|
||||
;;
|
||||
|
||||
PREINIT6)
|
||||
echo "dhcp: PREINIT $netif up"
|
||||
echo "dhcp: PREINIT6 $netif up"
|
||||
linkup $netif
|
||||
wait_for_ipv6_dad $netif
|
||||
;;
|
||||
|
||||
BOUND)
|
||||
@@ -104,14 +114,14 @@ case $reason in
|
||||
read layer2 < /sys/class/net/$netif/device/layer2
|
||||
fi
|
||||
if [ "$layer2" != "0" ]; then
|
||||
if ! arping -q -D -c 2 -I $netif $new_ip_address ; then
|
||||
if ! arping -f -q -D -c 2 -I $netif $new_ip_address ; then
|
||||
warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
unset layer2
|
||||
setup_interface
|
||||
set | while read line; do
|
||||
set | while read line || [ -n "$line" ]; do
|
||||
[ "${line#new_}" = "$line" ] && continue
|
||||
echo "$line"
|
||||
done >/tmp/dhclient.$netif.dhcpopts
|
||||
@@ -126,13 +136,28 @@ case $reason in
|
||||
|
||||
echo "[ -f /tmp/net.$netif.did-setup ]" > $hookdir/initqueue/finished/dhclient-$netif.sh
|
||||
>/tmp/net.$netif.up
|
||||
if [ -e /sys/class/net/${netif}/address ]; then
|
||||
> /tmp/net.$(cat /sys/class/net/${netif}/address).up
|
||||
fi
|
||||
|
||||
;;
|
||||
|
||||
RENEW|REBIND)
|
||||
unset lease_time
|
||||
[ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time
|
||||
[ -n "$new_max_life" ] && lease_time=$new_max_life
|
||||
preferred_lft=$lease_time
|
||||
[ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life
|
||||
ip -4 addr change ${new_ip_address}/${new_subnet_mask} broadcast ${new_broadcast_address} dev ${interface} \
|
||||
${lease_time:+valid_lft $lease_time} ${preferred_lft:+preferred_lft ${preferred_lft}} \
|
||||
>/dev/null 2>&1
|
||||
;;
|
||||
|
||||
BOUND6)
|
||||
echo "dhcp: BOND6 setting $netif"
|
||||
setup_interface6
|
||||
|
||||
set | while read line; do
|
||||
set | while read line || [ -n "$line" ]; do
|
||||
[ "${line#new_}" = "$line" ] && continue
|
||||
echo "$line"
|
||||
done >/tmp/dhclient.$netif.dhcpopts
|
||||
@@ -147,7 +172,22 @@ case $reason in
|
||||
|
||||
echo "[ -f /tmp/net.$netif.did-setup ]" > $hookdir/initqueue/finished/dhclient-$netif.sh
|
||||
>/tmp/net.$netif.up
|
||||
if [ -e /sys/class/net/${netif}/address ]; then
|
||||
> /tmp/net.$(cat /sys/class/net/${netif}/address).up
|
||||
fi
|
||||
;;
|
||||
|
||||
RENEW6|REBIND6)
|
||||
unset lease_time
|
||||
[ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time
|
||||
[ -n "$new_max_life" ] && lease_time=$new_max_life
|
||||
preferred_lft=$lease_time
|
||||
[ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life
|
||||
ip -6 addr change ${new_ip6_address}/${new_ip6_prefixlen} dev ${interface} scope global \
|
||||
${lease_time:+valid_lft $lease_time} ${preferred_lft:+preferred_lft ${preferred_lft}} \
|
||||
>/dev/null 2>&1
|
||||
;;
|
||||
|
||||
*) echo "dhcp: $reason";;
|
||||
esac
|
||||
|
||||
|
@@ -77,9 +77,10 @@ fi
|
||||
# disable manual ifup while netroot is set for simplifying our logic
|
||||
# in netroot case we prefer netroot to bringup $netif automaticlly
|
||||
[ -n "$2" -a "$2" = "-m" ] && [ -z "$netroot" ] && manualup="$2"
|
||||
[ -z "$netroot" ] && [ -z "$manualup" ] && exit 0
|
||||
|
||||
if [ -n "$manualup" ]; then
|
||||
>/tmp/net.$netif.manualup
|
||||
rm -f /tmp/net.${netif}.did-setup
|
||||
else
|
||||
[ -e /tmp/net.${netif}.did-setup ] && exit 0
|
||||
[ -e /sys/class/net/$netif/address ] && \
|
||||
@@ -92,15 +93,33 @@ do_dhcp() {
|
||||
# event for nfsroot
|
||||
# XXX add -V vendor class and option parsing per kernel
|
||||
|
||||
local _COUNT=0
|
||||
local _timeout=$(getargs rd.net.timeout.dhcp=)
|
||||
local _DHCPRETRY=$(getargs rd.net.dhcp.retry=)
|
||||
_DHCPRETRY=${_DHCPRETRY:-1}
|
||||
|
||||
[ -e /tmp/dhclient.$netif.pid ] && return 0
|
||||
|
||||
if ! iface_has_link $netif; then
|
||||
echo "No carrier detected"
|
||||
warn "No carrier detected on interface $netif"
|
||||
return 1
|
||||
fi
|
||||
echo "Starting dhcp for interface $netif"
|
||||
dhclient "$@" -1 -q -cf /etc/dhclient.conf -pf /tmp/dhclient.$netif.pid -lf /tmp/dhclient.$netif.lease $netif \
|
||||
|| echo "dhcp failed"
|
||||
|
||||
while [ $_COUNT -lt $_DHCPRETRY ]; do
|
||||
info "Starting dhcp for interface $netif"
|
||||
dhclient "$@" \
|
||||
${_timeout:+-timeout $_timeout} \
|
||||
-q \
|
||||
-cf /etc/dhclient.conf \
|
||||
-pf /tmp/dhclient.$netif.pid \
|
||||
-lf /tmp/dhclient.$netif.lease \
|
||||
$netif \
|
||||
&& return 0
|
||||
_COUNT=$(($_COUNT+1))
|
||||
[ $_COUNT -lt $_DHCPRETRY ] && sleep 1
|
||||
done
|
||||
warn "dhcp for interface $netif failed"
|
||||
return 1
|
||||
}
|
||||
|
||||
load_ipv6() {
|
||||
@@ -131,7 +150,20 @@ do_ipv6auto() {
|
||||
do_static() {
|
||||
strglobin $ip '*:*:*' && load_ipv6
|
||||
|
||||
linkup $netif
|
||||
if ! linkup $netif; then
|
||||
warn "Could not bring interface $netif up!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
ip route get "$ip" | {
|
||||
read a rest
|
||||
if [ "$a" = "local" ]; then
|
||||
warn "Not assigning $ip to interface $netif, cause it is already assigned!"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
} || return 1
|
||||
|
||||
[ -n "$macaddr" ] && ip link set address $macaddr dev $netif
|
||||
[ -n "$mtu" ] && ip link set mtu $mtu dev $netif
|
||||
if strglobin $ip '*:*:*'; then
|
||||
@@ -139,6 +171,10 @@ do_static() {
|
||||
ip addr add $ip/$mask ${srv:+peer $srv} dev $netif
|
||||
wait_for_ipv6_dad $netif
|
||||
else
|
||||
if ! arping -f -q -D -c 2 -I $netif $ip; then
|
||||
warn "Duplicate address detected for $ip for interface $netif."
|
||||
return 1
|
||||
fi
|
||||
ip addr flush dev $netif
|
||||
ip addr add $ip/$mask ${srv:+peer $srv} brd + dev $netif
|
||||
fi
|
||||
@@ -277,8 +313,8 @@ fi
|
||||
ip=$(getarg ip)
|
||||
|
||||
if [ -z "$ip" ]; then
|
||||
namesrv=$(getargs nameserver)
|
||||
for s in $namesrv; do
|
||||
for s in $(getargs nameserver); do
|
||||
[ -n "$s" ] || continue
|
||||
echo nameserver $s >> /tmp/net.$netif.resolv.conf
|
||||
done
|
||||
|
||||
@@ -314,8 +350,8 @@ for p in $(getargs ip=); do
|
||||
[ "$use_vlan" != 'true' ] && continue
|
||||
|
||||
# setup nameserver
|
||||
namesrv="$dns1 $dns2 $(getargs nameserver)"
|
||||
for s in $namesrv; do
|
||||
for s in "$dns1" "$dns2" $(getargs nameserver); do
|
||||
[ -n "$s" ] || continue
|
||||
echo nameserver $s >> /tmp/net.$netif.resolv.conf
|
||||
done
|
||||
|
||||
@@ -337,14 +373,19 @@ for p in $(getargs ip=); do
|
||||
do_static ;;
|
||||
esac
|
||||
done
|
||||
ret=$?
|
||||
|
||||
> /tmp/net.${netif}.up
|
||||
|
||||
if [ -e /sys/class/net/${netif}/address ]; then
|
||||
> /tmp/net.$(cat /sys/class/net/${netif}/address).up
|
||||
fi
|
||||
|
||||
case $autoconf in
|
||||
dhcp|on|any|dhcp6)
|
||||
;;
|
||||
*)
|
||||
if [ $? -eq 0 ]; then
|
||||
if [ $ret -eq 0 ]; then
|
||||
setup_net $netif
|
||||
source_hook initqueue/online $netif
|
||||
if [ -z "$manualup" ]; then
|
||||
@@ -366,11 +407,20 @@ fi
|
||||
|
||||
# no ip option directed at our interface?
|
||||
if [ ! -e /tmp/net.${netif}.up ]; then
|
||||
if getargs 'ip=dhcp6'; then
|
||||
load_ipv6
|
||||
do_dhcp -6
|
||||
if [ -e /tmp/net.bootdev ]; then
|
||||
BOOTDEV=$(cat /tmp/net.bootdev)
|
||||
if [ "$netif" = "$BOOTDEV" ] || [ "$BOOTDEV" = "$(cat /sys/class/net/${netif}/address)" ]; then
|
||||
load_ipv6
|
||||
do_dhcp
|
||||
fi
|
||||
else
|
||||
do_dhcp -4
|
||||
if getargs 'ip=dhcp6'; then
|
||||
load_ipv6
|
||||
do_dhcp -6
|
||||
fi
|
||||
if getargs 'ip=dhcp'; then
|
||||
do_dhcp -4
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@@ -11,61 +11,13 @@ check() {
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo "kernel-network-modules"
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
# Include wired net drivers, excluding wireless
|
||||
local _arch=$(uname -m)
|
||||
|
||||
net_module_filter() {
|
||||
local _net_drivers='eth_type_trans|register_virtio_device|usbnet_open'
|
||||
local _unwanted_drivers='/(wireless|isdn|uwb|net/ethernet|net/phy|net/team)/'
|
||||
local _ret
|
||||
# subfunctions inherit following FDs
|
||||
local _merge=8 _side2=9
|
||||
function nmf1() {
|
||||
local _fname _fcont
|
||||
while read _fname; do
|
||||
[[ $_fname =~ $_unwanted_drivers ]] && continue
|
||||
case "$_fname" in
|
||||
*.ko) _fcont="$(< $_fname)" ;;
|
||||
*.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
|
||||
*.ko.xz) _fcont="$(xz -dc $_fname)" ;;
|
||||
esac
|
||||
[[ $_fcont =~ $_net_drivers
|
||||
&& ! $_fcont =~ iw_handler_get_spy ]] \
|
||||
&& echo "$_fname"
|
||||
done
|
||||
return 0
|
||||
}
|
||||
function rotor() {
|
||||
local _f1 _f2
|
||||
while read _f1; do
|
||||
echo "$_f1"
|
||||
if read _f2; then
|
||||
echo "$_f2" 1>&${_side2}
|
||||
fi
|
||||
done | nmf1 1>&${_merge}
|
||||
return 0
|
||||
}
|
||||
# Use two parallel streams to filter alternating modules.
|
||||
set +x
|
||||
eval "( ( rotor ) ${_side2}>&1 | nmf1 ) ${_merge}>&1"
|
||||
[[ $debug ]] && set -x
|
||||
return 0
|
||||
}
|
||||
|
||||
{ find_kernel_modules_by_path drivers/net; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/net; fi; } \
|
||||
| net_module_filter | instmods
|
||||
|
||||
#instmods() will take care of hostonly
|
||||
instmods \
|
||||
=drivers/net/phy \
|
||||
=drivers/net/team \
|
||||
=drivers/net/ethernet \
|
||||
ecb arc4 bridge stp llc ipv6 bonding 8021q af_packet virtio_net
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
|
@@ -50,7 +50,6 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
|
||||
fi
|
||||
|
||||
ifup='/sbin/ifup $env{INTERFACE}'
|
||||
[ -z "$netroot" ] && ifup="$ifup -m"
|
||||
|
||||
runcmd="RUN+=\"/sbin/initqueue --name ifup-\$env{INTERFACE} --unique --onetime $ifup\""
|
||||
|
||||
|
@@ -1,10 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
is_ip() {
|
||||
echo "$1" | {
|
||||
IFS=. read a b c d
|
||||
test "$a" -ge 0 -a "$a" -le 255 \
|
||||
-a "$b" -ge 0 -a "$b" -le 255 \
|
||||
-a "$c" -ge 0 -a "$c" -le 255 \
|
||||
-a "$d" -ge 0 -a "$d" -le 255 \
|
||||
2> /dev/null
|
||||
} && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
get_ip() {
|
||||
local iface="$1" ip=""
|
||||
ip=$(ip -o -f inet addr show $iface)
|
||||
ip=${ip%%/*}
|
||||
ip=${ip##* }
|
||||
echo $ip
|
||||
}
|
||||
|
||||
iface_for_remote_addr() {
|
||||
@@ -60,6 +73,14 @@ all_ifaces_up() {
|
||||
done
|
||||
}
|
||||
|
||||
all_ifaces_setup() {
|
||||
local iface="" IFACES=""
|
||||
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
|
||||
for iface in $IFACES; do
|
||||
[ -e /tmp/net.$iface.did-setup ] || return 1
|
||||
done
|
||||
}
|
||||
|
||||
get_netroot_ip() {
|
||||
local prefix="" server="" rest=""
|
||||
splitsep "$1" ":" prefix server rest
|
||||
@@ -94,20 +115,20 @@ setup_net() {
|
||||
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
|
||||
[ -z "$IFACES" ] && IFACES="$netif"
|
||||
# run the scripts written by ifup
|
||||
[ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw
|
||||
[ -e /tmp/net.$netif.hostname ] && . /tmp/net.$netif.hostname
|
||||
[ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
||||
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||
# set up resolv.conf
|
||||
[ -e /tmp/net.$netif.resolv.conf ] && \
|
||||
cp -f /tmp/net.$netif.resolv.conf /etc/resolv.conf
|
||||
[ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw
|
||||
|
||||
# add static route
|
||||
for _p in $(getargs rd.route); do
|
||||
route_to_var "$_p" || continue
|
||||
[ -n "$route_dev" ] && [ "$route_dev" != "$netif" ] && continue
|
||||
ip route add "$route_mask" ${route_gw:+via "$route_gw"} ${route_dev:+dev "$route_dev"}
|
||||
if strstr ":" "$route_mask"; then
|
||||
if strstr "$route_mask" ":"; then
|
||||
printf -- "%s\n" "$route_mask ${route_gw:+via $route_gw} ${route_dev:+dev $route_dev}" \
|
||||
> /tmp/net.route6."$netif"
|
||||
else
|
||||
@@ -116,6 +137,13 @@ setup_net() {
|
||||
fi
|
||||
done
|
||||
|
||||
# If a static route was necessary to reach the gateway, the
|
||||
# first gateway setup call will have failed with
|
||||
# RTNETLINK answers: Network is unreachable
|
||||
# Replace the default route again after static routes to cover
|
||||
# this scenario.
|
||||
[ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw
|
||||
|
||||
# Handle STP Timeout: arping the default gateway.
|
||||
# (or the root server, if a) it's local or b) there's no gateway.)
|
||||
# Note: This assumes that if no router is present the
|
||||
@@ -189,7 +217,7 @@ set_ifname() {
|
||||
fix_bootif() {
|
||||
local macaddr=${1}
|
||||
local IFS='-'
|
||||
macaddr=$(for i in ${macaddr} ; do echo -n $i:; done)
|
||||
macaddr=$(printf '%s:' ${macaddr})
|
||||
macaddr=${macaddr%:}
|
||||
# strip hardware type field from pxelinux
|
||||
[ -n "${macaddr%??:??:??:??:??:??}" ] && macaddr=${macaddr#??:}
|
||||
@@ -222,9 +250,12 @@ ibft_to_cmdline() {
|
||||
# skip not assigned ip adresses
|
||||
[ "$ip" = "0.0.0.0" ] && continue
|
||||
[ -e ${iface}/gateway ] && gw=$(read a < ${iface}/gateway; echo $a)
|
||||
[ "$gateway" = "0.0.0.0" ] && unset $gateway
|
||||
[ -e ${iface}/subnet-mask ] && mask=$(read a < ${iface}/subnet-mask; echo $a)
|
||||
[ -e ${iface}/primary-dns ] && dns1=$(read a < ${iface}/primary-dns; echo $a)
|
||||
[ "$dns1" = "0.0.0.0" ] && unset $dns1
|
||||
[ -e ${iface}/secondary-dns ] && dns2=$(read a < ${iface}/secondary-dns; echo $a)
|
||||
[ "$dns2" = "0.0.0.0" ] && unset $dns2
|
||||
[ -e ${iface}/hostname ] && hostname=$(read a < ${iface}/hostname; echo $a)
|
||||
if [ -n "$ip" ] && [ -n "$mask" ]; then
|
||||
echo "ip=$ip::$gw:$mask:$hostname:$dev:none${dns1:+:$dns1}${dns2:+:$dns2}"
|
||||
@@ -484,7 +515,11 @@ parse_ifname_opts() {
|
||||
wait_for_if_link() {
|
||||
local cnt=0
|
||||
local li
|
||||
while [ $cnt -lt 600 ]; do
|
||||
local timeout="$(getargs rd.net.timeout.iflink=)"
|
||||
timeout=${timeout:-60}
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
li=$(ip -o link show dev $1 2>/dev/null)
|
||||
[ -n "$li" ] && return 0
|
||||
sleep 0.1
|
||||
@@ -496,9 +531,29 @@ wait_for_if_link() {
|
||||
wait_for_if_up() {
|
||||
local cnt=0
|
||||
local li
|
||||
while [ $cnt -lt 200 ]; do
|
||||
local timeout="$(getargs rd.net.timeout.ifup=)"
|
||||
timeout=${timeout:-20}
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
li=$(ip -o link show up dev $1)
|
||||
[ -n "$li" ] && [ -z "${li##*state UP*}" ] && return 0
|
||||
if ! strstr "$li" "NO-CARRIER"; then
|
||||
if [ -n "$li" ]; then
|
||||
case "$li" in
|
||||
*\<UP*)
|
||||
return 0;;
|
||||
*\<*,UP\>*)
|
||||
return 0;;
|
||||
*\<*,UP,*\>*)
|
||||
return 0;;
|
||||
esac
|
||||
fi
|
||||
if strstr "$li" "LOWER_UP" \
|
||||
&& strstr "$li" "state UNKNOWN" \
|
||||
&& ! strstr "$li" "DORMANT"; then
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
done
|
||||
@@ -507,7 +562,11 @@ wait_for_if_up() {
|
||||
|
||||
wait_for_route_ok() {
|
||||
local cnt=0
|
||||
while [ $cnt -lt 200 ]; do
|
||||
local timeout="$(getargs rd.net.timeout.route=)"
|
||||
timeout=${timeout:-20}
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
li=$(ip route show)
|
||||
[ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0
|
||||
sleep 0.1
|
||||
@@ -519,8 +578,12 @@ wait_for_route_ok() {
|
||||
wait_for_ipv6_dad() {
|
||||
local cnt=0
|
||||
local li
|
||||
while [ $cnt -lt 500 ]; do
|
||||
li=$(ip -6 addr show dev $1)
|
||||
local timeout="$(getargs rd.net.timeout.ipv6dad=)"
|
||||
timeout=${timeout:-50}
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
li=$(ip -6 addr show dev $1 scope link)
|
||||
strstr "$li" "tentative" || return 0
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
@@ -531,7 +594,11 @@ wait_for_ipv6_dad() {
|
||||
wait_for_ipv6_auto() {
|
||||
local cnt=0
|
||||
local li
|
||||
while [ $cnt -lt 400 ]; do
|
||||
local timeout="$(getargs rd.net.timeout.ipv6auto=)"
|
||||
timeout=${timeout:-40}
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
li=$(ip -6 addr show dev $1)
|
||||
if ! strstr "$li" "tentative"; then
|
||||
strstr "$li" "dynamic" && return 0
|
||||
@@ -554,13 +621,22 @@ type hostname >/dev/null 2>&1 || \
|
||||
}
|
||||
|
||||
iface_has_link() {
|
||||
local cnt=0
|
||||
local interface="$1" flags=""
|
||||
[ -n "$interface" ] || return 2
|
||||
interface="/sys/class/net/$interface"
|
||||
[ -d "$interface" ] || return 2
|
||||
local timeout="$(getargs rd.net.timeout.carrier=)"
|
||||
timeout=${timeout:-5}
|
||||
timeout=$(($timeout*10))
|
||||
|
||||
linkup "$1"
|
||||
[ "$(cat $interface/carrier)" = 1 ] || return 1
|
||||
# XXX Do we need to reset the flags here? anaconda never bothered..
|
||||
while [ $cnt -lt $timeout ]; do
|
||||
[ "$(cat $interface/carrier)" = 1 ] && return 0
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
find_iface_with_link() {
|
||||
|
@@ -12,6 +12,11 @@ command -v setup_net >/dev/null || . /lib/net-lib.sh
|
||||
# no sense in doing something if no (net)root info is available
|
||||
# or root is already there
|
||||
[ -d $NEWROOT/proc ] && exit 0
|
||||
|
||||
if [ -z "$netroot" ]; then
|
||||
netroot=$(getarg netroot=)
|
||||
fi
|
||||
|
||||
[ -z "$netroot" ] && exit 1
|
||||
|
||||
# Set or override primary interface
|
||||
@@ -33,7 +38,7 @@ esac
|
||||
# Figure out the handler for root=dhcp by recalling all netroot cmdline
|
||||
# handlers when this is not called from manually network bringing up.
|
||||
if [ -z "$2" ]; then
|
||||
if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] ; then
|
||||
if getarg "root=dhcp" || getarg "netroot=dhcp" || getarg "root=dhcp6" || getarg "netroot=dhcp6"; then
|
||||
# Load dhcp options
|
||||
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||
|
||||
@@ -45,6 +50,8 @@ if [ -z "$2" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -f -- $hookdir/initqueue/finished/dhcp.sh
|
||||
|
||||
# Set netroot to new_root_path, so cmdline parsers don't call
|
||||
netroot=$new_root_path
|
||||
|
||||
@@ -74,9 +81,7 @@ source_hook netroot $netif
|
||||
|
||||
# Run the handler; don't store the root, it may change from device to device
|
||||
# XXX other variables to export?
|
||||
if $handler $netif $netroot $NEWROOT; then
|
||||
rm -f -- $hookdir/initqueue/finished/dhcp.sh
|
||||
# Network rootfs mount successful - save interface info for ifcfg etc.
|
||||
save_netinfo $netif
|
||||
fi
|
||||
[ -n "$handler" ] && "$handler" "$netif" "$netroot" "$NEWROOT"
|
||||
save_netinfo $netif
|
||||
|
||||
exit 0
|
||||
|
@@ -4,5 +4,7 @@ command -v getarg >/dev/null || . /lib/dracut-lib.sh
|
||||
command -v ibft_to_cmdline >/dev/null || . /lib/net-lib.sh
|
||||
|
||||
if getargbool 0 rd.iscsi.ibft -d "ip=ibft"; then
|
||||
modprobe -b -q iscsi_boot_sysfs 2>/dev/null
|
||||
modprobe -b -q iscsi_ibft
|
||||
ibft_to_cmdline
|
||||
fi
|
||||
|
@@ -36,8 +36,10 @@ unset count
|
||||
# If needed, check if bootdev= contains anything usable
|
||||
BOOTDEV=$(getarg bootdev=)
|
||||
|
||||
if [ -n "$NEEDBOOTDEV" ] ; then
|
||||
[ -z "$BOOTDEV" ] && warn "Please supply bootdev argument for multiple ip= lines"
|
||||
if [ -n "$NEEDBOOTDEV" ] && getargbool 1 rd.neednet; then
|
||||
#[ -z "$BOOTDEV" ] && warn "Please supply bootdev argument for multiple ip= lines"
|
||||
echo "rd.neednet=1" > /etc/cmdline.d/dracut-neednet.conf
|
||||
info "Multiple ip= arguments: assuming rd.neednet=1"
|
||||
fi
|
||||
|
||||
# Check ip= lines
|
||||
@@ -48,7 +50,7 @@ for p in $(getargs ip=); do
|
||||
# make first device specified the BOOTDEV
|
||||
if [ -z "$BOOTDEV" ] && [ -n "$dev" ]; then
|
||||
BOOTDEV="$dev"
|
||||
[ -n "$NEEDBOOTDEV" ] && warn "Setting bootdev to '$BOOTDEV'"
|
||||
[ -n "$NEEDBOOTDEV" ] && info "Setting bootdev to '$BOOTDEV'"
|
||||
fi
|
||||
|
||||
# skip ibft since we did it above
|
||||
@@ -109,6 +111,16 @@ for p in $(getargs ip=); do
|
||||
die "Server-ip or dhcp for netboot needed, but current arguments say otherwise"
|
||||
fi
|
||||
|
||||
if str_starts "$dev" "enx" && [ ${#dev} -eq 15 ]; then
|
||||
printf -- "ifname=%s:%s:%s:%s:%s:%s:%s\n" \
|
||||
"$dev" \
|
||||
"${dev:3:2}" \
|
||||
"${dev:5:2}" \
|
||||
"${dev:7:2}" \
|
||||
"${dev:9:2}" \
|
||||
"${dev:11:2}" \
|
||||
"${dev:13:2}" >> /etc/cmdline.d/80-enx.conf
|
||||
fi
|
||||
done
|
||||
|
||||
# put BOOTIF in IFACES to make sure it comes up
|
||||
|
@@ -22,7 +22,7 @@ get_config_line_by_subchannel()
|
||||
local line
|
||||
|
||||
CHANNELS="$1"
|
||||
while read line; do
|
||||
while read line || [ -n "$line" ]; do
|
||||
if strstr "$line" "$CHANNELS"; then
|
||||
echo $line
|
||||
return 0
|
||||
@@ -48,7 +48,7 @@ print_s390() {
|
||||
for i in /sys/class/net/$_netif/device/cdev[0-9]*; do
|
||||
[ -e $i ] || continue
|
||||
channel=$(readlink -f $i)
|
||||
echo -n "${channel##*/},"
|
||||
printf '%s' "${channel##*/},"
|
||||
done
|
||||
})
|
||||
[ -n "$SUBCHANNELS" ] || return 1
|
||||
@@ -137,6 +137,8 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
unset macaddr
|
||||
unset slave
|
||||
unset ethname
|
||||
unset vlan
|
||||
|
||||
[ -e /tmp/bond.${netif}.info ] && . /tmp/bond.${netif}.info
|
||||
|
||||
uuid=$(cat /proc/sys/kernel/random/uuid)
|
||||
|
@@ -120,7 +120,7 @@ command -v ctorrent >/dev/null \
|
||||
|
||||
nfs_already_mounted() {
|
||||
local server="$1" path="$2" localdir="" s="" p=""
|
||||
cat /proc/mounts | while read src mnt rest; do
|
||||
cat /proc/mounts | while read src mnt rest || [ -n "$src" ]; do
|
||||
splitsep ":" "$src" s p
|
||||
if [ "$server" = "$s" ]; then
|
||||
if [ "$path" = "$p" ]; then
|
||||
|
@@ -22,7 +22,7 @@ installkernel() {
|
||||
local _merge=8 _side2=9
|
||||
function nmf1() {
|
||||
local _fname _fcont
|
||||
while read _fname; do
|
||||
while read _fname || [ -n "$_fname" ]; do
|
||||
case "$_fname" in
|
||||
*.ko) _fcont="$(< $_fname)" ;;
|
||||
*.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
|
||||
@@ -35,7 +35,7 @@ installkernel() {
|
||||
}
|
||||
function rotor() {
|
||||
local _f1 _f2
|
||||
while read _f1; do
|
||||
while read _f1 || [ -n "$_f1" ]; do
|
||||
echo "$_f1"
|
||||
if read _f2; then
|
||||
echo "$_f2" 1>&${_side2}
|
||||
@@ -60,6 +60,8 @@ installkernel() {
|
||||
${NULL}
|
||||
fi
|
||||
|
||||
instmods amdkfd hyperv_fb
|
||||
|
||||
for _modname in $(find_kernel_modules_by_path drivers/gpu/drm \
|
||||
| drm_module_filter) ; do
|
||||
# if the hardware is present, include module even if it is not currently loaded,
|
||||
@@ -68,6 +70,10 @@ installkernel() {
|
||||
if [[ $hostonly ]] && modinfo -F alias $_modname | sed -e 's,\?,\.,g' -e 's,\*,\.\*,g' \
|
||||
| grep -qxf - /sys/bus/{pci/devices,soc/devices/soc?}/*/modalias 2>/dev/null; then
|
||||
hostonly='' instmods $_modname
|
||||
# if radeon.ko is installed, we want amdkfd also
|
||||
if strstr "$_modname" radeon.ko; then
|
||||
hostonly='' instmods amdkfd
|
||||
fi
|
||||
continue
|
||||
fi
|
||||
instmods $_modname
|
||||
|
@@ -3,7 +3,7 @@
|
||||
# called by dracut
|
||||
check() {
|
||||
[[ "$mount_needs" ]] && return 1
|
||||
require_binaries plymouthd plymouth
|
||||
require_binaries plymouthd plymouth plymouth-set-default-theme
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
|
@@ -26,7 +26,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 | while read a b c; do echo $b; done;)
|
||||
PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth | while read a b c || [ -n "$b" ]; do echo $b; done;)
|
||||
inst_libdir_file "plymouth/${PLYMOUTH_PLUGIN}.so"
|
||||
fi
|
||||
else
|
||||
|
@@ -35,4 +35,4 @@ fi
|
||||
IFACES="$IFACES $DEVICE"
|
||||
echo "$IFACES" >> /tmp/net.ifaces
|
||||
|
||||
ifup $DEVICE -m
|
||||
exec ifup "$DEVICE"
|
||||
|
@@ -42,7 +42,7 @@ function dasd_settle() {
|
||||
}
|
||||
|
||||
function dasd_settle_all() {
|
||||
for dasdccw in $(while read line; do echo "${line%%(*}"; done < /proc/dasd/devices) ; do
|
||||
for dasdccw in $(while read line || [ -n "$line" ]; do echo "${line%%(*}"; done < /proc/dasd/devices) ; do
|
||||
if ! dasd_settle $dasdccw ; then
|
||||
echo $"Could not access DASD $dasdccw in time"
|
||||
return 1
|
||||
@@ -84,7 +84,7 @@ function readcmsfile() # $1=dasdport $2=filename
|
||||
# dasd_mod must be loaded without setting any DASD online
|
||||
dev=$(canonicalize_devno $1)
|
||||
numcpus=$(
|
||||
while read line; do
|
||||
while read line || [ -n "$line" ]; do
|
||||
if strstr "$line" "# processors"; then
|
||||
echo ${line##*:};
|
||||
break;
|
||||
@@ -181,7 +181,7 @@ processcmsfile()
|
||||
|
||||
unset _do_zfcp
|
||||
for i in ${!FCP_*}; do
|
||||
echo "${!i}" | while read port rest; do
|
||||
echo "${!i}" | while read port rest || [ -n "$port" ]; do
|
||||
case $port in
|
||||
*.*.*)
|
||||
;;
|
||||
|
@@ -27,7 +27,7 @@ install() {
|
||||
inst_script "$moddir/cmsifup.sh" /sbin/cmsifup
|
||||
inst_multiple /etc/cmsfs-fuse/filetypes.conf /etc/udev/rules.d/99-fuse.rules /etc/fuse.conf \
|
||||
cmsfs-fuse fusermount ulockmgr_server bash insmod rmmod cat normalize_dasd_arg sed \
|
||||
$(rpm -ql s390utils-base)
|
||||
$(rpm -ql s390utils-base) awk getopt
|
||||
|
||||
inst_libdir_file "gconv/*"
|
||||
#inst /usr/lib/locale/locale-archive
|
||||
|
@@ -8,7 +8,7 @@ check() {
|
||||
require_binaries btrfs || return 1
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for fs in ${host_fs_types[@]}; do
|
||||
for fs in "${host_fs_types[@]}"; do
|
||||
[[ "$fs" == "btrfs" ]] && return 0
|
||||
done
|
||||
return 255
|
||||
|
@@ -5,11 +5,17 @@ command -v getarg >/dev/null || . /lib/dracut-lib.sh
|
||||
# check if the crypttab contains an entry for a LUKS UUID
|
||||
crypttab_contains() {
|
||||
local luks="$1"
|
||||
local dev="$2"
|
||||
local l d rest
|
||||
if [ -f /etc/crypttab ]; then
|
||||
while read l d rest; do
|
||||
while read l d rest || [ -n "$l" ]; do
|
||||
strstr "${l##luks-}" "${luks##luks-}" && return 0
|
||||
strstr "$d" "${luks##luks-}" && return 0
|
||||
if [ -n "$dev" ]; then
|
||||
for _dev in "$(devnames $d)"; do
|
||||
[ "$dev" -ef "$_dev" ] && return 0
|
||||
done
|
||||
fi
|
||||
done < /etc/crypttab
|
||||
fi
|
||||
return 1
|
||||
@@ -42,10 +48,10 @@ ask_for_password() {
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--cmd) ply_cmd="$2"; tty_cmd="$2" shift;;
|
||||
--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;;
|
||||
--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;;
|
||||
@@ -155,7 +161,7 @@ getkey() {
|
||||
[ -f "$keys_file" ] || return 1
|
||||
|
||||
local IFS=:
|
||||
while read luks_dev key_dev key_path; do
|
||||
while read luks_dev key_dev key_path || [ -n "$luks_dev" ]; do
|
||||
if match_dev "$luks_dev" "$for_dev"; then
|
||||
echo "${key_dev}:${key_path}"
|
||||
return 0
|
||||
|
@@ -6,7 +6,7 @@ type crypttab_contains >/dev/null 2>&1 || . /lib/dracut-crypt-lib.sh
|
||||
dev=$1
|
||||
luks=$2
|
||||
|
||||
crypttab_contains "$luks" && exit 0
|
||||
crypttab_contains "$luks" "$dev" && exit 0
|
||||
|
||||
allowdiscards="-"
|
||||
|
||||
@@ -15,10 +15,10 @@ if strstr "$(cryptsetup --help)" "allow-discards"; then
|
||||
if discarduuids=$(getargs "rd.luks.allow-discards"); then
|
||||
discarduuids=$(str_replace "$discarduuids" 'luks-' '')
|
||||
if strstr " $discarduuids " " ${luks##luks-}"; then
|
||||
allowdiscards="allow-discards"
|
||||
allowdiscards="discard"
|
||||
fi
|
||||
elif getargbool 0 rd.luks.allow-discards; then
|
||||
allowdiscards="allow-discards"
|
||||
allowdiscards="discard"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@@ -23,7 +23,7 @@ numtries=${3:-10}
|
||||
|
||||
# TODO: improve to support what cmdline does
|
||||
if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -d -n rd_NO_CRYPTTAB; then
|
||||
while read name dev luksfile luksoptions; do
|
||||
while read name dev luksfile luksoptions || [ -n "$name" ]; do
|
||||
# ignore blank lines and comments
|
||||
if [ -z "$name" -o "${name#\#}" != "$name" ]; then
|
||||
continue
|
||||
|
@@ -25,6 +25,7 @@ depends() {
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
instmods dm_crypt =crypto
|
||||
hostonly="" instmods drbg
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
@@ -35,7 +36,7 @@ cmdline() {
|
||||
|
||||
UUID=$(
|
||||
blkid -u crypto -o export $dev \
|
||||
| while read line; do
|
||||
| while read line || [ -n "$line" ]; do
|
||||
[[ ${line#UUID} = $line ]] && continue
|
||||
printf "%s" "${line#UUID=}"
|
||||
break
|
||||
@@ -65,7 +66,7 @@ install() {
|
||||
|
||||
if [[ $hostonly ]] && [[ -f /etc/crypttab ]]; then
|
||||
# filter /etc/crypttab for the devices we need
|
||||
while read _mapper _dev _rest; do
|
||||
while read _mapper _dev _rest || [ -n "$_mapper" ]; do
|
||||
[[ $_mapper = \#* ]] && continue
|
||||
[[ $_dev ]] || continue
|
||||
|
||||
@@ -85,14 +86,17 @@ install() {
|
||||
|
||||
inst_simple "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh"
|
||||
|
||||
inst_multiple -o \
|
||||
$systemdutildir/system-generators/systemd-cryptsetup-generator \
|
||||
$systemdutildir/systemd-cryptsetup \
|
||||
$systemdsystemunitdir/systemd-ask-password-console.path \
|
||||
$systemdsystemunitdir/systemd-ask-password-console.service \
|
||||
$systemdsystemunitdir/cryptsetup.target \
|
||||
$systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \
|
||||
systemd-ask-password systemd-tty-ask-password-agent
|
||||
inst_script "$moddir"/crypt-run-generator.sh /sbin/crypt-run-generator
|
||||
if dracut_module_included "systemd"; then
|
||||
inst_multiple -o \
|
||||
$systemdutildir/system-generators/systemd-cryptsetup-generator \
|
||||
$systemdutildir/systemd-cryptsetup \
|
||||
$systemdsystemunitdir/systemd-ask-password-console.path \
|
||||
$systemdsystemunitdir/systemd-ask-password-console.service \
|
||||
$systemdsystemunitdir/cryptsetup.target \
|
||||
$systemdsystemunitdir/sysinit.target.wants/cryptsetup.target \
|
||||
systemd-ask-password systemd-tty-ask-password-agent
|
||||
inst_script "$moddir"/crypt-run-generator.sh /sbin/crypt-run-generator
|
||||
fi
|
||||
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
@@ -14,6 +14,12 @@ else
|
||||
LUKS=$(getargs rd.luks.uuid -d rd_LUKS_UUID)
|
||||
tout=$(getarg rd.luks.key.tout)
|
||||
|
||||
if [ -e /etc/crypttab ]; then
|
||||
while read _mapper _dev _rest ; do
|
||||
set_systemd_timeout_for_dev $_dev
|
||||
done < /etc/crypttab
|
||||
fi
|
||||
|
||||
if [ -n "$LUKS" ]; then
|
||||
for luksid in $LUKS; do
|
||||
|
||||
|
@@ -1,11 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
_do_dm_shutdown() {
|
||||
local ret
|
||||
local ret=0
|
||||
local final=$1
|
||||
info "Disassembling device-mapper devices"
|
||||
dmsetup -v remove_all
|
||||
ret=$?
|
||||
for dev in $(dmsetup info -c --noheadings -o name) ; do
|
||||
dmsetup -v --noudevsync remove "$dev" || ret=$?
|
||||
done
|
||||
if [ "x$final" != "x" ]; then
|
||||
info "dmsetup ls --tree"
|
||||
dmsetup ls --tree 2>&1 | vinfo
|
||||
|
@@ -9,7 +9,7 @@ ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="dm_end"
|
||||
|
||||
ENV{ID_FS_TYPE}=="linux_raid_member", GOTO="dm_end"
|
||||
|
||||
ENV{ID_FS_TYPE}!="*_raid_member", , GOTO="dm_end"
|
||||
ENV{ID_FS_TYPE}!="*_raid_member", GOTO="dm_end"
|
||||
|
||||
ENV{ID_FS_TYPE}=="isw_raid_member", ENV{rd_NO_MDIMSM}!="?*", GOTO="dm_end"
|
||||
ENV{ID_FS_TYPE}=="ddf_raid_member", ENV{rd_NO_MDDDF}!="?*", GOTO="dm_end"
|
||||
@@ -24,6 +24,6 @@ PROGRAM=="/bin/sh -c 'for i in $sys/$devpath/holders/dm-[0-9]*; do [ -e $$i ] &&
|
||||
ENV{DEVTYPE}!="partition", \
|
||||
RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}"
|
||||
|
||||
RUN+="/sbin/initqueue --onetime --unique --settled /sbin/dmraid_scan"
|
||||
RUN+="/sbin/initqueue --onetime --unique --settled /sbin/dmraid_scan $env{DEVNAME}"
|
||||
|
||||
LABEL="dm_end"
|
||||
|
@@ -2,6 +2,13 @@
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
dev="$1"
|
||||
devenc=$(str_replace "$1" '/' '\2f')
|
||||
|
||||
[ -e /tmp/dmraid.$devenc ] && exit 0
|
||||
|
||||
>/tmp/dmraid.$devenc
|
||||
|
||||
DM_RAIDS=$(getargs rd.dm.uuid -d rd_DM_UUID=)
|
||||
|
||||
if [ -n "$DM_RAIDS" ] || getargbool 0 rd.auto; then
|
||||
@@ -37,6 +44,7 @@ if [ -n "$DM_RAIDS" ] || getargbool 0 rd.auto; then
|
||||
info "Activating $s"
|
||||
dmraid -ay -i -p --rm_partitions "$s" 2>&1 | vinfo
|
||||
[ -e "/dev/mapper/$s" ] && kpartx -a "/dev/mapper/$s" 2>&1 | vinfo
|
||||
udevsettle
|
||||
done
|
||||
fi
|
||||
|
||||
|
@@ -1,17 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -b /dev/mapper/live-rw ] && [ -d /updates ]; then
|
||||
if [ -b /dev/mapper/live-rw ] && [ -d /run/initramfs/live/updates -o -d /updates ]; then
|
||||
info "Applying updates to live image..."
|
||||
mount -o bind /run $NEWROOT/run
|
||||
# avoid overwriting symlinks (e.g. /lib -> /usr/lib) with directories
|
||||
(
|
||||
cd /updates
|
||||
find . -depth -type d | while read dir; do
|
||||
mkdir -p "$NEWROOT/$dir"
|
||||
done
|
||||
find . -depth \! -type d | while read file; do
|
||||
cp -a "$file" "$NEWROOT/$file"
|
||||
done
|
||||
)
|
||||
for d in /updates /run/initramfs/live/updates; do
|
||||
[ -d "$d" ] || continue
|
||||
(
|
||||
cd $d
|
||||
find . -depth -type d | while read dir; do
|
||||
mkdir -p "$NEWROOT/$dir"
|
||||
done
|
||||
find . -depth \! -type d | while read file; do
|
||||
cp -a "$file" "$NEWROOT/$file"
|
||||
done
|
||||
)
|
||||
done
|
||||
umount $NEWROOT/run
|
||||
fi
|
||||
|
72
modules.d/90dmsquash-live/dmsquash-generator.sh
Executable file
72
modules.d/90dmsquash-live/dmsquash-generator.sh
Executable file
@@ -0,0 +1,72 @@
|
||||
#!/bin/sh
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
[ -z "$root" ] && root=$(getarg root=)
|
||||
|
||||
# support legacy syntax of passing liveimg and then just the base root
|
||||
if getargbool 0 rd.live.image -d -y liveimg; then
|
||||
liveroot="live:$root"
|
||||
fi
|
||||
|
||||
if [ "${root%%:*}" = "live" ] ; then
|
||||
liveroot=$root
|
||||
fi
|
||||
|
||||
[ "${liveroot%%:*}" = "live" ] || exit 0
|
||||
|
||||
case "$liveroot" in
|
||||
live:LABEL=*|LABEL=*) \
|
||||
root="${root#live:}"
|
||||
root="$(echo $root | sed 's,/,\\x2f,g')"
|
||||
root="live:/dev/disk/by-label/${root#LABEL=}"
|
||||
rootok=1 ;;
|
||||
live:CDLABEL=*|CDLABEL=*) \
|
||||
root="${root#live:}"
|
||||
root="$(echo $root | sed 's,/,\\x2f,g')"
|
||||
root="live:/dev/disk/by-label/${root#CDLABEL=}"
|
||||
rootok=1 ;;
|
||||
live:UUID=*|UUID=*) \
|
||||
root="${root#live:}"
|
||||
root="live:/dev/disk/by-uuid/${root#UUID=}"
|
||||
rootok=1 ;;
|
||||
live:PARTUUID=*|PARTUUID=*) \
|
||||
root="${root#live:}"
|
||||
root="live:/dev/disk/by-partuuid/${root#PARTUUID=}"
|
||||
rootok=1 ;;
|
||||
live:PARTLABEL=*|PARTLABEL=*) \
|
||||
root="${root#live:}"
|
||||
root="live:/dev/disk/by-partlabel/${root#PARTLABEL=}"
|
||||
rootok=1 ;;
|
||||
live:/*.[Ii][Ss][Oo]|/*.[Ii][Ss][Oo])
|
||||
root="${root#live:}"
|
||||
root="liveiso:${root}"
|
||||
rootok=1 ;;
|
||||
live:/dev/*)
|
||||
rootok=1 ;;
|
||||
live:/*.[Ii][Mm][Gg]|/*.[Ii][Mm][Gg])
|
||||
[ -f "${root#live:}" ] && rootok=1 ;;
|
||||
esac
|
||||
|
||||
[ "$rootok" != "1" ] && exit 0
|
||||
|
||||
GENERATOR_DIR="$2"
|
||||
[ -z "$GENERATOR_DIR" ] && exit 1
|
||||
|
||||
[ -d "$GENERATOR_DIR" ] || mkdir "$GENERATOR_DIR"
|
||||
|
||||
ROOTFLAGS="$(getarg rootflags)"
|
||||
{
|
||||
echo "[Unit]"
|
||||
echo "Before=initrd-root-fs.target"
|
||||
echo "[Mount]"
|
||||
echo "Where=/sysroot"
|
||||
echo "What=/dev/mapper/live-rw"
|
||||
[ -n "$ROOTFLAGS" ] && echo "Options=${ROOTFLAGS}"
|
||||
} > "$GENERATOR_DIR"/sysroot.mount
|
||||
|
||||
mkdir -p "$GENERATOR_DIR/dev-mapper-live\x2drw.device.d"
|
||||
{
|
||||
echo "[Unit]"
|
||||
echo "JobTimeoutSec=3000"
|
||||
} > "$GENERATOR_DIR/dev-mapper-live\x2drw.device.d/timeout.conf"
|
@@ -30,6 +30,8 @@ getargbool 0 rd.writable.fsimg -d -y writable_fsimg && writable_fsimg="yes"
|
||||
overlay_size=$(getarg rd.live.overlay.size=)
|
||||
[ -z "$overlay_size" ] && overlay_size=512
|
||||
|
||||
getargbool 0 rd.live.overlay.thin && thin_snapshot="yes"
|
||||
|
||||
# CD/DVD media check
|
||||
[ -b $livedev ] && fs=$(blkid -s TYPE -o value $livedev)
|
||||
if [ "$fs" = "iso9660" -o "$fs" = "udf" ]; then
|
||||
@@ -39,7 +41,7 @@ getarg rd.live.check -d check || check=""
|
||||
if [ -n "$check" ]; then
|
||||
type plymouth >/dev/null 2>&1 && plymouth --hide-splash
|
||||
if [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
p=$(str_replace "$livedev" "-" '\x2d')
|
||||
p=$(dev_unit_name "$livedev")
|
||||
systemctl start checkisomd5@${p}.service
|
||||
else
|
||||
checkisomd5 --verbose $livedev
|
||||
@@ -139,17 +141,41 @@ do_live_overlay() {
|
||||
# set up the snapshot
|
||||
sz=$(blockdev --getsz $BASE_LOOPDEV)
|
||||
if [ -n "$readonly_overlay" ]; then
|
||||
echo 0 $sz snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV p 8 | dmsetup create $readonly_overlay live-ro
|
||||
echo 0 $sz snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV N 8 | dmsetup create --readonly live-ro
|
||||
base="/dev/mapper/live-ro"
|
||||
over=$RO_OVERLAY_LOOPDEV
|
||||
else
|
||||
base=$BASE_LOOPDEV
|
||||
over=$OVERLAY_LOOPDEV
|
||||
fi
|
||||
echo 0 $sz snapshot $base $over p 8 | dmsetup create live-rw
|
||||
|
||||
if [ -n "$thin_snapshot" ]; then
|
||||
modprobe dm_thin_pool
|
||||
mkdir /run/initramfs/thin-overlay
|
||||
|
||||
# In block units (512b)
|
||||
thin_data_sz=$(( $overlay_size * 1024 * 1024 / 512 ))
|
||||
thin_meta_sz=$(( $thin_data_sz / 10 ))
|
||||
|
||||
# It is important to have the backing file on a tmpfs
|
||||
# this is needed to let the loopdevice support TRIM
|
||||
dd if=/dev/null of=/run/initramfs/thin-overlay/meta bs=1b count=1 seek=$((thin_meta_sz)) 2> /dev/null
|
||||
dd if=/dev/null of=/run/initramfs/thin-overlay/data bs=1b count=1 seek=$((thin_data_sz)) 2> /dev/null
|
||||
|
||||
THIN_META_LOOPDEV=$( losetup --show -f /run/initramfs/thin-overlay/meta )
|
||||
THIN_DATA_LOOPDEV=$( losetup --show -f /run/initramfs/thin-overlay/data )
|
||||
|
||||
echo 0 $thin_data_sz thin-pool $THIN_META_LOOPDEV $THIN_DATA_LOOPDEV 1024 1024 | dmsetup create live-overlay-pool
|
||||
dmsetup message /dev/mapper/live-overlay-pool 0 "create_thin 0"
|
||||
|
||||
# Create a snapshot of the base image
|
||||
echo 0 $sz thin /dev/mapper/live-overlay-pool 0 $base | dmsetup create live-rw
|
||||
else
|
||||
echo 0 $sz snapshot $base $over PO 8 | dmsetup create live-rw
|
||||
fi
|
||||
|
||||
# Create a device that always points to a ro base image
|
||||
echo 0 $sz linear $base 0 | dmsetup create --readonly live-base
|
||||
echo 0 $sz linear $BASE_LOOPDEV 0 | dmsetup create --readonly live-base
|
||||
}
|
||||
|
||||
# live cd helper function
|
||||
@@ -174,40 +200,13 @@ if [ -n "$OSMINSQFS" ]; then
|
||||
umount -l /run/initramfs/squashfs.osmin
|
||||
fi
|
||||
|
||||
# we might have an embedded fs image to use as rootfs (uncompressed live)
|
||||
if [ -e /run/initramfs/live/${live_dir}/ext3fs.img ]; then
|
||||
FSIMG="/run/initramfs/live/${live_dir}/ext3fs.img"
|
||||
elif [ -e /run/initramfs/live/${live_dir}/rootfs.img ]; then
|
||||
FSIMG="/run/initramfs/live/${live_dir}/rootfs.img"
|
||||
fi
|
||||
|
||||
if [ -n "$FSIMG" ] ; then
|
||||
BASE_LOOPDEV=$( losetup -f )
|
||||
|
||||
if [ -n "$writable_fsimg" ] ; then
|
||||
# mount the provided fileysstem read/write
|
||||
echo "Unpacking live filesystem (may take some time)"
|
||||
unpack_archive $FSIMG /run/initramfs/fsimg/
|
||||
losetup $BASE_LOOPDEV /run/initramfs/fsimg/rootfs.img
|
||||
echo "0 $( blockdev --getsize $BASE_LOOPDEV ) linear $BASE_LOOPDEV 0" | dmsetup create live-rw
|
||||
else
|
||||
# mount the filesystem read-only and add a dm snapshot for writes
|
||||
losetup -r $BASE_LOOPDEV $FSIMG
|
||||
do_live_from_base_loop
|
||||
fi
|
||||
fi
|
||||
|
||||
# we might have an embedded fs image on squashfs (compressed live)
|
||||
if [ -e /run/initramfs/live/${live_dir}/${squash_image} ]; then
|
||||
SQUASHED="/run/initramfs/live/${live_dir}/${squash_image}"
|
||||
fi
|
||||
|
||||
if [ -e "$SQUASHED" ] ; then
|
||||
if [ -n "$live_ram" ] ; then
|
||||
if [ -n "$live_ram" ]; then
|
||||
echo "Copying live image to RAM..."
|
||||
echo "(this may take a few minutes)"
|
||||
dd if=$SQUASHED of=/run/initramfs/squashed.img bs=512 2> /dev/null
|
||||
umount -n /run/initramfs/live
|
||||
echo "Done copying live image to RAM."
|
||||
SQUASHED="/run/initramfs/squashed.img"
|
||||
fi
|
||||
@@ -217,22 +216,59 @@ if [ -e "$SQUASHED" ] ; then
|
||||
mkdir -m 0755 -p /run/initramfs/squashfs
|
||||
mount -n -t squashfs -o ro $SQUASHED_LOOPDEV /run/initramfs/squashfs
|
||||
|
||||
BASE_LOOPDEV=$( losetup -f )
|
||||
if [ -f /run/initramfs/squashfs/LiveOS/ext3fs.img ]; then
|
||||
losetup -r $BASE_LOOPDEV /run/initramfs/squashfs/LiveOS/ext3fs.img
|
||||
FSIMG="/run/initramfs/squashfs/LiveOS/ext3fs.img"
|
||||
elif [ -f /run/initramfs/squashfs/LiveOS/rootfs.img ]; then
|
||||
losetup -r $BASE_LOOPDEV /run/initramfs/squashfs/LiveOS/rootfs.img
|
||||
FSIMG="/run/initramfs/squashfs/LiveOS/rootfs.img"
|
||||
fi
|
||||
else
|
||||
# we might have an embedded fs image to use as rootfs (uncompressed live)
|
||||
if [ -e /run/initramfs/live/${live_dir}/ext3fs.img ]; then
|
||||
FSIMG="/run/initramfs/live/${live_dir}/ext3fs.img"
|
||||
elif [ -e /run/initramfs/live/${live_dir}/rootfs.img ]; then
|
||||
FSIMG="/run/initramfs/live/${live_dir}/rootfs.img"
|
||||
fi
|
||||
if [ -n "$live_ram" ]; then
|
||||
echo 'Copying live image to RAM...'
|
||||
echo '(this may take a few minutes)'
|
||||
dd if=$FSIMG of=/run/initramfs/rootfs.img bs=512 2> /dev/null
|
||||
echo 'Done copying live image to RAM.'
|
||||
FSIMG='/run/initramfs/rootfs.img'
|
||||
fi
|
||||
|
||||
umount -l /run/initramfs/squashfs
|
||||
|
||||
do_live_from_base_loop
|
||||
fi
|
||||
|
||||
if [ -n "$FSIMG" ] ; then
|
||||
BASE_LOOPDEV=$( losetup -f )
|
||||
|
||||
if [ -n "$writable_fsimg" ] ; then
|
||||
# mount the provided filesystem read/write
|
||||
echo "Unpacking live filesystem (may take some time)"
|
||||
mkdir /run/initramfs/fsimg/
|
||||
if [ -n "$SQUASHED" ]; then
|
||||
cp -v $FSIMG /run/initramfs/fsimg/rootfs.img
|
||||
else
|
||||
unpack_archive $FSIMG /run/initramfs/fsimg/
|
||||
fi
|
||||
FSIMG = /run/initramfs/fsimg/rootfs.img
|
||||
fi
|
||||
if [ -n "$writable_fsimg" ] || [ -z "$SQUASHED" -a -n "$live_ram" ] ||
|
||||
[ "$overlay" = none -o "$overlay" = None -o "$overlay" = NONE ]; then
|
||||
losetup $BASE_LOOPDEV $FSIMG
|
||||
sz=$(blockdev --getsz $BASE_LOOPDEV)
|
||||
echo 0 $sz linear $BASE_LOOPDEV 0 | dmsetup create live-rw
|
||||
else
|
||||
# mount the filesystem read-only and add a dm snapshot for writes
|
||||
losetup -r $BASE_LOOPDEV $FSIMG
|
||||
do_live_from_base_loop
|
||||
fi
|
||||
fi
|
||||
|
||||
[ -e "$SQUASHED" ] && umount -l /run/initramfs/squashfs
|
||||
|
||||
if [ -b "$OSMIN_LOOPDEV" ]; then
|
||||
# set up the devicemapper snapshot device, which will merge
|
||||
# the normal live fs image, and the delta, into a minimzied fs image
|
||||
echo "0 $( blockdev --getsz $BASE_LOOPDEV ) snapshot $BASE_LOOPDEV $OSMIN_LOOPDEV p 8" | dmsetup create --readonly live-osimg-min
|
||||
echo "0 $( blockdev --getsz $BASE_LOOPDEV ) snapshot $BASE_LOOPDEV $OSMIN_LOOPDEV N 8" | dmsetup create --readonly live-osimg-min
|
||||
fi
|
||||
|
||||
ROOTFLAGS="$(getarg rootflags)"
|
||||
@@ -241,7 +277,10 @@ if [ -n "$ROOTFLAGS" ]; then
|
||||
fi
|
||||
|
||||
ln -s /dev/mapper/live-rw /dev/root
|
||||
printf 'mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > $hookdir/mount/01-$$-live.sh
|
||||
|
||||
if [ -z "$DRACUT_SYSTEMD" ]; then
|
||||
printf 'mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > $hookdir/mount/01-$$-live.sh
|
||||
fi
|
||||
|
||||
need_shutdown
|
||||
|
||||
|
@@ -22,7 +22,7 @@ installkernel() {
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_multiple umount dmsetup blkid dd losetup grep blockdev
|
||||
inst_multiple umount dmsetup blkid dd losetup grep blockdev find
|
||||
inst_multiple -o checkisomd5
|
||||
inst_hook cmdline 30 "$moddir/parse-dmsquash-live.sh"
|
||||
inst_hook cmdline 31 "$moddir/parse-iso-scan.sh"
|
||||
@@ -31,6 +31,7 @@ install() {
|
||||
inst_hook pre-pivot 20 "$moddir/apply-live-updates.sh"
|
||||
inst_script "$moddir/dmsquash-live-root.sh" "/sbin/dmsquash-live-root"
|
||||
inst_script "$moddir/iso-scan.sh" "/sbin/iso-scan"
|
||||
inst_script "$moddir/dmsquash-generator.sh" $systemdutildir/system-generators/dracut-dmsquash-generator
|
||||
# should probably just be generally included
|
||||
inst_rules 60-cdrom_id.rules
|
||||
inst_simple "$moddir/checkisomd5@.service" "/etc/systemd/system/checkisomd5@.service"
|
||||
|
@@ -13,7 +13,7 @@ if [ "${root%%:*}" = "live" ] ; then
|
||||
liveroot=$root
|
||||
fi
|
||||
|
||||
[ "${liveroot%%:*}" = "live" ] || return
|
||||
[ "${liveroot%%:*}" = "live" ] || return 1
|
||||
|
||||
modprobe -q loop
|
||||
|
||||
@@ -49,9 +49,14 @@ case "$liveroot" in
|
||||
live:/*.[Ii][Mm][Gg]|/*.[Ii][Mm][Gg])
|
||||
[ -f "${root#live:}" ] && rootok=1 ;;
|
||||
esac
|
||||
|
||||
[ "$rootok" = "1" ] || return 1
|
||||
|
||||
info "root was $liveroot, is now $root"
|
||||
|
||||
# make sure that init doesn't complain
|
||||
[ -z "$root" ] && root="live"
|
||||
|
||||
wait_for_dev -n /dev/mapper/live-rw
|
||||
|
||||
return 0
|
||||
|
@@ -9,7 +9,7 @@ installkernel() {
|
||||
local _merge=8 _side2=9
|
||||
function bmf1() {
|
||||
local _f
|
||||
while read _f; do case "$_f" in
|
||||
while read _f || [ -n "$_f" ]; do case "$_f" in
|
||||
*.ko) [[ $(< $_f) =~ $_blockfuncs ]] && echo "$_f" ;;
|
||||
*.ko.gz) [[ $(gzip -dc <$_f) =~ $_blockfuncs ]] && echo "$_f" ;;
|
||||
*.ko.xz) [[ $(xz -dc <$_f) =~ $_blockfuncs ]] && echo "$_f" ;;
|
||||
@@ -19,7 +19,7 @@ installkernel() {
|
||||
}
|
||||
function rotor() {
|
||||
local _f1 _f2
|
||||
while read _f1; do
|
||||
while read _f1 || [ -n "$_f1" ]; do
|
||||
echo "$_f1"
|
||||
if read _f2; then
|
||||
echo "$_f2" 1>&${_side2}
|
||||
@@ -41,10 +41,13 @@ installkernel() {
|
||||
uhci-hcd \
|
||||
xhci-hcd xhci-pci xhci-plat-hcd
|
||||
|
||||
instmods \
|
||||
"=drivers/hid" \
|
||||
"=drivers/input/serio" \
|
||||
"=drivers/input/keyboard"
|
||||
|
||||
instmods yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
|
||||
atkbd i8042 usbhid hid-apple hid-sunplus hid-cherry hid-logitech \
|
||||
hid-logitech-dj hid-microsoft hid-lcpower firewire-ohci \
|
||||
pcmcia hid-hyperv hv-vmbus hyperv-keyboard
|
||||
atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus
|
||||
|
||||
if [[ "$(uname -p)" == arm* ]]; then
|
||||
# arm specific modules
|
||||
@@ -71,7 +74,7 @@ installkernel() {
|
||||
instmods '=fs'
|
||||
fi
|
||||
else
|
||||
for i in $(host_fs_all); do
|
||||
for i in "${host_fs_types[@]}"; do
|
||||
hostonly='' instmods $i
|
||||
done
|
||||
fi
|
||||
|
72
modules.d/90kernel-network-modules/module-setup.sh
Executable file
72
modules.d/90kernel-network-modules/module-setup.sh
Executable file
@@ -0,0 +1,72 @@
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
return 255
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
# Include wired net drivers, excluding wireless
|
||||
local _arch=$(uname -m)
|
||||
|
||||
net_module_filter() {
|
||||
local _net_drivers='eth_type_trans|register_virtio_device|usbnet_open'
|
||||
local _unwanted_drivers='/(wireless|isdn|uwb|net/ethernet|net/phy|net/team)/'
|
||||
local _ret
|
||||
# subfunctions inherit following FDs
|
||||
local _merge=8 _side2=9
|
||||
function nmf1() {
|
||||
local _fname _fcont
|
||||
while read _fname; do
|
||||
[[ $_fname =~ $_unwanted_drivers ]] && continue
|
||||
case "$_fname" in
|
||||
*.ko) _fcont="$(< $_fname)" ;;
|
||||
*.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
|
||||
*.ko.xz) _fcont="$(xz -dc $_fname)" ;;
|
||||
esac
|
||||
[[ $_fcont =~ $_net_drivers
|
||||
&& ! $_fcont =~ iw_handler_get_spy ]] \
|
||||
&& echo "$_fname"
|
||||
done
|
||||
return 0
|
||||
}
|
||||
function rotor() {
|
||||
local _f1 _f2
|
||||
while read _f1; do
|
||||
echo "$_f1"
|
||||
if read _f2; then
|
||||
echo "$_f2" 1>&${_side2}
|
||||
fi
|
||||
done | nmf1 1>&${_merge}
|
||||
return 0
|
||||
}
|
||||
# Use two parallel streams to filter alternating modules.
|
||||
set +x
|
||||
eval "( ( rotor ) ${_side2}>&1 | nmf1 ) ${_merge}>&1"
|
||||
[[ $debug ]] && set -x
|
||||
return 0
|
||||
}
|
||||
|
||||
{ find_kernel_modules_by_path drivers/net; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/net; fi; } \
|
||||
| net_module_filter | instmods
|
||||
|
||||
#instmods() will take care of hostonly
|
||||
instmods \
|
||||
=drivers/net/phy \
|
||||
=drivers/net/team \
|
||||
=drivers/net/ethernet \
|
||||
ecb arc4 bridge stp llc ipv6 bonding 8021q af_packet virtio_net
|
||||
hostonly="" instmods iscsi_ibft crc32c iscsi_boot_sysfs
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
return 0
|
||||
}
|
||||
|
57
modules.d/90livenet/livenet-generator.sh
Normal file
57
modules.d/90livenet/livenet-generator.sh
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
[ -z "$root" ] && root=$(getarg root=)
|
||||
|
||||
# support legacy syntax of passing liveimg and then just the base root
|
||||
if getargbool 0 rd.live.image -d -y liveimg; then
|
||||
liveroot="live:$root"
|
||||
fi
|
||||
|
||||
if [ "${root%%:*}" = "live" ] ; then
|
||||
liveroot=$root
|
||||
fi
|
||||
|
||||
[ "${liveroot%%:*}" = "live" ] || exit 0
|
||||
|
||||
case "$liveroot" in
|
||||
live:http://*|http://*) \
|
||||
root="${root#live:}"
|
||||
rootok=1 ;;
|
||||
live:https://*|https://*) \
|
||||
root="${root#live:}"
|
||||
rootok=1 ;;
|
||||
live:ftp://*|ftp://*) \
|
||||
root="${root#live:}"
|
||||
rootok=1 ;;
|
||||
live:torrent://*|torrent://*) \
|
||||
root="${root#live:}"
|
||||
rootok=1 ;;
|
||||
live:tftp://*|tftp://*) \
|
||||
root="${root#live:}"
|
||||
rootok=1 ;;
|
||||
esac
|
||||
|
||||
[ "$rootok" != "1" ] && exit 0
|
||||
|
||||
GENERATOR_DIR="$2"
|
||||
[ -z "$GENERATOR_DIR" ] && exit 1
|
||||
|
||||
[ -d "$GENERATOR_DIR" ] || mkdir "$GENERATOR_DIR"
|
||||
|
||||
ROOTFLAGS="$(getarg rootflags)"
|
||||
{
|
||||
echo "[Unit]"
|
||||
echo "Before=initrd-root-fs.target"
|
||||
echo "[Mount]"
|
||||
echo "Where=/sysroot"
|
||||
echo "What=/dev/mapper/live-rw"
|
||||
[ -n "$ROOTFLAGS" ] && echo "Options=${ROOTFLAGS}"
|
||||
} > "$GENERATOR_DIR"/sysroot.mount
|
||||
|
||||
mkdir -p "$GENERATOR_DIR/dev-mapper-live\x2drw.device.d"
|
||||
{
|
||||
echo "[Unit]"
|
||||
echo "JobTimeoutSec=3000"
|
||||
} > "$GENERATOR_DIR/dev-mapper-live\x2drw.device.d/timeout.conf"
|
@@ -7,12 +7,20 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||
|
||||
[ -e /tmp/livenet.downloaded ] && exit 0
|
||||
|
||||
# args get passed from 40network/netroot
|
||||
netroot="$2"
|
||||
liveurl="${netroot#livenet:}"
|
||||
info "fetching $liveurl"
|
||||
imgfile=$(fetch_url "$liveurl")
|
||||
[ $? = 0 ] || die "failed to download live image: error $?"
|
||||
|
||||
if [ $? != 0 ]; then
|
||||
warn "failed to download live image: error $?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
> /tmp/livenet.downloaded
|
||||
|
||||
# TODO: couldn't dmsquash-live-root handle this?
|
||||
if [ ${imgfile##*.} = "iso" ]; then
|
||||
|
@@ -17,6 +17,6 @@ install() {
|
||||
inst_hook cmdline 29 "$moddir/parse-livenet.sh"
|
||||
inst_hook initqueue/online 95 "$moddir/fetch-liveupdate.sh"
|
||||
inst_script "$moddir/livenetroot.sh" "/sbin/livenetroot"
|
||||
inst_script "$moddir/livenet-generator.sh" $systemdutildir/system-generators/dracut-livenet-generator
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
||||
|
@@ -15,14 +15,14 @@ SNAPSIZE=$(getargs rd.lvm.snapsize -d rd_LVM_SNAPSIZE=)
|
||||
lvmdevs=$(
|
||||
for f in /tmp/.lvm_scan-*; do
|
||||
[ -e "$f" ] || continue
|
||||
echo -n "${f##/tmp/.lvm_scan-} "
|
||||
printf '%s' "${f##/tmp/.lvm_scan-} "
|
||||
done
|
||||
)
|
||||
|
||||
if [ ! -e /etc/lvm/lvm.conf ]; then
|
||||
{
|
||||
echo 'devices {';
|
||||
echo -n ' filter = [ '
|
||||
printf ' filter = [ '
|
||||
for dev in $lvmdevs; do
|
||||
printf '"a|^/dev/%s$|", ' $dev;
|
||||
done;
|
||||
@@ -69,11 +69,19 @@ min=$2
|
||||
sub=${3%% *}
|
||||
sub=${sub%%\(*};
|
||||
|
||||
lvm_ignorelockingfailure="--ignorelockingfailure"
|
||||
lvm_quirk_args="--ignorelockingfailure --ignoremonitoring"
|
||||
|
||||
check_lvm_ver 2 2 57 $maj $min $sub && \
|
||||
nopoll="--poll n"
|
||||
lvm_quirk_args="$lvm_quirk_args --poll n"
|
||||
|
||||
if check_lvm_ver 2 2 65 $maj $min $sub; then
|
||||
sysinit=" --sysinit $extraargs"
|
||||
lvm_quirk_args=" --sysinit $extraargs"
|
||||
fi
|
||||
|
||||
if check_lvm_ver 2 2 221 $maj $min $sub; then
|
||||
lvm_quirk_args=" $extraargs"
|
||||
unset lvm_ignorelockingfailure
|
||||
fi
|
||||
|
||||
unset extraargs
|
||||
@@ -104,24 +112,16 @@ fi
|
||||
|
||||
if [ -n "$LVS" ] ; then
|
||||
info "Scanning devices $lvmdevs for LVM logical volumes $LVS"
|
||||
lvm lvscan --ignorelockingfailure 2>&1 | vinfo
|
||||
lvm lvscan $lvm_ignorelockingfailure 2>&1 | vinfo
|
||||
for LV in $LVS; do
|
||||
if [ -z "$sysinit" ]; then
|
||||
lvm lvchange --yes -ay --ignorelockingfailure $nopoll --ignoremonitoring $LV 2>&1 | vinfo
|
||||
else
|
||||
lvm lvchange --yes -ay $sysinit $LV 2>&1 | vinfo
|
||||
fi
|
||||
lvm lvchange --yes -ay $lvm_quirk_args $LV 2>&1 | vinfo
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -z "$LVS" -o -n "$VGS" ]; then
|
||||
info "Scanning devices $lvmdevs for LVM volume groups $VGS"
|
||||
lvm vgscan --ignorelockingfailure 2>&1 | vinfo
|
||||
if [ -z "$sysinit" ]; then
|
||||
lvm vgchange -ay --ignorelockingfailure $nopoll --ignoremonitoring $VGS 2>&1 | vinfo
|
||||
else
|
||||
lvm vgchange -ay $sysinit $VGS 2>&1 | vinfo
|
||||
fi
|
||||
lvm vgscan $lvm_ignorelockingfailure 2>&1 | vinfo
|
||||
lvm vgchange -ay $lvm_quirk_args $VGS 2>&1 | vinfo
|
||||
fi
|
||||
|
||||
if [ "$lvmwritten" ]; then
|
||||
|
@@ -67,6 +67,20 @@ install() {
|
||||
sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 4/' ${initdir}/etc/lvm/lvm.conf
|
||||
sed -i -e 's/\(^[[:space:]]*\)use_lvmetad[[:space:]]*=[[:space:]]*[[:digit:]]/\1use_lvmetad = 0/' ${initdir}/etc/lvm/lvm.conf
|
||||
fi
|
||||
|
||||
export LVM_SUPPRESS_FD_WARNINGS=1
|
||||
# Also install any files needed for LVM system id support.
|
||||
if [ -f /etc/lvm/lvmlocal.conf ]; then
|
||||
inst_simple -H /etc/lvm/lvmlocal.conf
|
||||
fi
|
||||
eval $(lvm dumpconfig global/system_id_source &>/dev/null)
|
||||
if [ "$system_id_source" == "file" ]; then
|
||||
eval $(lvm dumpconfig global/system_id_file)
|
||||
if [ -f "$system_id_file" ]; then
|
||||
inst_simple -H $system_id_file
|
||||
fi
|
||||
fi
|
||||
unset LVM_SUPPRESS_FD_WARNINGS
|
||||
fi
|
||||
|
||||
if ! [[ -e ${initdir}/etc/lvm/lvm.conf ]]; then
|
||||
@@ -126,4 +140,6 @@ install() {
|
||||
cache_dump cache_restore cache_check cache_repair \
|
||||
era_check era_dump era_invalidate era_restore
|
||||
fi
|
||||
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
@@ -27,6 +27,7 @@ _md_force_run() {
|
||||
|
||||
_path_d="${_path_s%/*}/degraded"
|
||||
[ ! -r "$_path_d" ] && continue
|
||||
> $hookdir/initqueue/work
|
||||
done
|
||||
}
|
||||
|
||||
|
@@ -46,7 +46,7 @@ cmdline() {
|
||||
|
||||
UUID=$(
|
||||
/sbin/mdadm --examine --export $dev \
|
||||
| while read line; do
|
||||
| while read line || [ -n "$line" ]; do
|
||||
[[ ${line#MD_UUID=} = $line ]] && continue
|
||||
printf "%s" "${line#MD_UUID=} "
|
||||
done
|
||||
@@ -132,4 +132,5 @@ install() {
|
||||
fi
|
||||
fi
|
||||
inst_hook pre-shutdown 30 "$moddir/mdmon-pre-shutdown.sh"
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@ else
|
||||
if [ -n "$MD_UUID" ]; then
|
||||
for f in /etc/udev/rules.d/65-md-incremental*.rules; do
|
||||
[ -e "$f" ] || continue
|
||||
while read line; do
|
||||
while read line || [ -n "$line" ]; do
|
||||
if [ "${line%%UUID CHECK}" != "$line" ]; then
|
||||
printf 'IMPORT{program}="/sbin/mdadm --examine --export $tempnode"\n'
|
||||
for uuid in $MD_UUID; do
|
||||
|
@@ -1,18 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
is_mpath() {
|
||||
local _dev=$1
|
||||
[ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
|
||||
[[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ mpath- ]] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
majmin_to_mpath_dev() {
|
||||
local _dev
|
||||
for i in `ls -1 /dev/mapper/mpath*`; do
|
||||
dev=$(get_maj_min $i)
|
||||
if [ "$dev" = "$1" ]; then
|
||||
echo $i
|
||||
return
|
||||
fi
|
||||
done
|
||||
}
|
||||
# called by dracut
|
||||
check() {
|
||||
local _rootdev
|
||||
# if there's no multipath binary, no go.
|
||||
require_binaries multipath || return 1
|
||||
|
||||
is_mpath() {
|
||||
local _dev=$1
|
||||
[ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
|
||||
[[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ mpath- ]] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for_each_host_dev_and_slaves is_mpath || return 255
|
||||
}
|
||||
@@ -46,7 +56,7 @@ installkernel() {
|
||||
local _merge=8 _side2=9
|
||||
function bmf1() {
|
||||
local _f
|
||||
while read _f; do
|
||||
while read _f || [ -n "$_f" ]; do
|
||||
case "$_f" in
|
||||
*.ko) [[ $(< $_f) =~ $_funcs ]] && echo "$_f" ;;
|
||||
*.ko.gz) [[ $(gzip -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
|
||||
@@ -58,7 +68,7 @@ installkernel() {
|
||||
|
||||
function rotor() {
|
||||
local _f1 _f2
|
||||
while read _f1; do
|
||||
while read _f1 || [ -n "$_f1" ]; do
|
||||
echo "$_f1"
|
||||
if read _f2; then
|
||||
echo "$_f2" 1>&${_side2}
|
||||
@@ -74,12 +84,23 @@ installkernel() {
|
||||
}
|
||||
|
||||
( find_kernel_modules_by_path drivers/scsi; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/scsi; fi;
|
||||
find_kernel_modules_by_path drivers/md ) | mp_mod_filter | instmods
|
||||
find_kernel_modules_by_path drivers/md ) | mp_mod_filter | hostonly='' instmods
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
local _f
|
||||
local _f _allow
|
||||
add_hostonly_mpath_conf() {
|
||||
is_mpath $1 && {
|
||||
local _dev
|
||||
|
||||
_dev=$(majmin_to_mpath_dev $1)
|
||||
[ -z "$_dev" ] && return
|
||||
strstr "$_allow" "$_dev" && return
|
||||
_allow="$_allow --allow $_dev"
|
||||
}
|
||||
}
|
||||
|
||||
inst_multiple -o \
|
||||
dmsetup \
|
||||
kpartx \
|
||||
@@ -93,6 +114,11 @@ install() {
|
||||
/etc/multipath.conf \
|
||||
/etc/multipath/*
|
||||
|
||||
[[ $hostonly ]] && {
|
||||
for_each_host_dev_and_slaves_all add_hostonly_mpath_conf
|
||||
[ -n "$_allow" ] && mpathconf $_allow --outfile ${initdir}/etc/multipath.conf
|
||||
}
|
||||
|
||||
inst $(command -v partx) /sbin/partx
|
||||
|
||||
inst_libdir_file "libmultipath*" "multipath/*"
|
||||
|
@@ -3,7 +3,7 @@
|
||||
# called by dracut
|
||||
check() {
|
||||
if type -P systemd-detect-virt >/dev/null 2>&1; then
|
||||
vm=$(systemd-detect-virt --vm >/dev/null 2>&1)
|
||||
vm=$(systemd-detect-virt --vm 2>/dev/null)
|
||||
(($? != 0)) && return 255
|
||||
[[ $vm = "qemu" ]] && return 0
|
||||
[[ $vm = "kvm" ]] && return 0
|
||||
@@ -13,8 +13,9 @@ check() {
|
||||
for i in /sys/class/dmi/id/*_vendor; do
|
||||
[[ -f $i ]] || continue
|
||||
read vendor < $i
|
||||
[[ "$vendor" == "QEMU" ]] && return 0
|
||||
[[ "$vendor" == "Bochs" ]] && return 0
|
||||
[[ "$vendor" == "QEMU" ]] && return 0
|
||||
[[ "$vendor" == "Red Hat" ]] && return 0
|
||||
[[ "$vendor" == "Bochs" ]] && return 0
|
||||
done
|
||||
return 255
|
||||
}
|
||||
@@ -25,5 +26,6 @@ installkernel() {
|
||||
hostonly='' instmods \
|
||||
ata_piix ata_generic pata_acpi cdrom sr_mod ahci \
|
||||
virtio_blk virtio virtio_ring virtio_pci \
|
||||
virtio_scsi virtio_console virtio_rng
|
||||
virtio_scsi virtio_console virtio_rng \
|
||||
spapr-vscsi
|
||||
}
|
||||
|
@@ -19,8 +19,6 @@ loop_decrypt() {
|
||||
local key="/dev/mapper/${mntp##*/}"
|
||||
|
||||
if [ ! -b $key ]; then
|
||||
info "Keyfile has .img suffix, treating it as LUKS-encrypted loop keyfile container to unlock $device"
|
||||
|
||||
local loopdev=$(losetup -f "${mntp}/${keypath}" --show)
|
||||
local opts="-d - luksOpen $loopdev ${key##*/}"
|
||||
|
||||
@@ -29,14 +27,12 @@ loop_decrypt() {
|
||||
--prompt "Password ($keypath on $keydev for $device)" \
|
||||
--tty-echo-off
|
||||
|
||||
[ -b $key ] || die "Tried setting it up, but keyfile block device was still not found!"
|
||||
[ -b $key ] || die "Failed to unlock $keypath on $keydev for $device."
|
||||
|
||||
initqueue --onetime --finished --unique --name "crypt-loop-cleanup-10-${key##*/}" \
|
||||
$(command -v cryptsetup) "luksClose $key"
|
||||
initqueue --onetime --finished --unique --name "crypt-loop-cleanup-20-${loopdev##*/}" \
|
||||
$(command -v losetup) "-d $loopdev"
|
||||
else
|
||||
info "Existing keyfile found, re-using it for $device"
|
||||
fi
|
||||
|
||||
cat $key
|
||||
|
2
modules.d/91crypt-loop/module-setup.sh
Normal file → Executable file
2
modules.d/91crypt-loop/module-setup.sh
Normal file → Executable file
@@ -14,7 +14,7 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
instmods loop
|
||||
hostonly='' instmods loop
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
|
@@ -6,7 +6,7 @@ check() {
|
||||
require_binaries mount.cifs || return 1
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for fs in ${host_fs_types[@]}; do
|
||||
for fs in "${host_fs_types[@]}"; do
|
||||
[[ "$fs" == "cifs" ]] && return 0
|
||||
done
|
||||
return 255
|
||||
|
@@ -13,8 +13,11 @@ depends() {
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_multiple -o ps grep more cat rm strace free showmount \
|
||||
ping netstat rpcinfo vi scp ping6 ssh find vi \
|
||||
fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat e2fsck
|
||||
inst_multiple -o cat ls ps grep more cat rm strace free showmount \
|
||||
ping netstat rpcinfo vi scp ping6 ssh find vi \
|
||||
tcpdump cp less hostname mkdir \
|
||||
fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat e2fsck
|
||||
|
||||
egrep '^tcpdump:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
|
||||
}
|
||||
|
||||
|
@@ -2,6 +2,9 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
[ -d /sys/firmware/efi ] || return 255
|
||||
}
|
||||
require_binaries dcbtool fipvlan lldpad ip readlink || return 1
|
||||
return 0
|
||||
}
|
||||
|
10
modules.d/95fcoe/cleanup-fcoe.sh
Normal file
10
modules.d/95fcoe/cleanup-fcoe.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
|
||||
if [ -e /var/run/lldpad.pid ]; then
|
||||
lldpad -k
|
||||
mkdir -m 0755 -p /run/initramfs/state/dev/shm
|
||||
cp /dev/shm/lldpad.state /run/initramfs/state/dev/shm/ > /dev/null 2>&1
|
||||
echo "files /dev/shm/lldpad.state" >> /run/initramfs/rwtab
|
||||
fi
|
@@ -1,23 +1,54 @@
|
||||
#!/bin/sh
|
||||
|
||||
dcb=$1
|
||||
dcb="$1"
|
||||
|
||||
if ! [ -d /sys/firmware/edd ]; then
|
||||
modprobe edd
|
||||
while ! [ -d /sys/firmware/edd ]; do sleep 0.1; done
|
||||
fi
|
||||
_modprobe_r_edd="0"
|
||||
|
||||
check_edd() {
|
||||
local cnt=0
|
||||
|
||||
[ -d /sys/firmware/edd ] && return 0
|
||||
|
||||
_modprobe_r_edd="1"
|
||||
modprobe edd || return $?
|
||||
|
||||
while [ $cnt -lt 600 ]; do
|
||||
[ -d /sys/firmware/edd ] && return 0
|
||||
cnt=$(($cnt+1))
|
||||
sleep 0.1
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
check_edd || exit 1
|
||||
|
||||
for disk in /sys/firmware/edd/int13_*; do
|
||||
[ -d $disk ] || continue
|
||||
for nic in ${disk}/pci_dev/net/*; do
|
||||
[ -d $nic ] || continue
|
||||
[ -d "$disk" ] || continue
|
||||
if [ -e "${disk}/pci_dev/driver" ]; then
|
||||
driver=$(readlink "${disk}/pci_dev/driver")
|
||||
driver=${driver##*/}
|
||||
fi
|
||||
# i40e uses dev_port 1 for a virtual fcoe function
|
||||
if [ "${driver}" == "i40e" ]; then
|
||||
dev_port=1
|
||||
fi
|
||||
for nic in "${disk}"/pci_dev/net/*; do
|
||||
[ -d "$nic" ] || continue
|
||||
if [ -n "${dev_port}" -a -e "${nic}/dev_port" ]; then
|
||||
if [ "$(cat ${nic}/dev_port)" -ne "${dev_port}" ]; then
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
if [ -e ${nic}/address ]; then
|
||||
fcoe_interface=${nic##*/}
|
||||
if ! [ -e "/tmp/.fcoe-$fcoe_interface" ]; then
|
||||
/sbin/fcoe-up $fcoe_interface $dcb
|
||||
/sbin/fcoe-up "$fcoe_interface" "$dcb"
|
||||
> "/tmp/.fcoe-$fcoe_interface"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
modprobe -r edd
|
||||
|
||||
[ "$_modprobe_r_edd" = "1" ] && modprobe -r edd
|
||||
|
||||
unset _modprobe_r_edd
|
||||
|
@@ -15,6 +15,7 @@ type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
|
||||
netif=$1
|
||||
dcb=$2
|
||||
vlan="yes"
|
||||
|
||||
iflink=$(cat /sys/class/net/$netif/iflink)
|
||||
ifindex=$(cat /sys/class/net/$netif/ifindex)
|
||||
@@ -29,6 +30,21 @@ linkup "$netif"
|
||||
netdriver=$(readlink -f /sys/class/net/$netif/device/driver)
|
||||
netdriver=${netdriver##*/}
|
||||
|
||||
write_fcoemon_cfg() {
|
||||
echo FCOE_ENABLE=\"yes\" > /etc/fcoe/cfg-$netif
|
||||
if [ "$dcb" = "dcb" ]; then
|
||||
echo DCB_REQUIRED=\"yes\" >> /etc/fcoe/cfg-$netif
|
||||
else
|
||||
echo DCB_REQUIRED=\"no\" >> /etc/fcoe/cfg-$netif
|
||||
fi
|
||||
if [ "$vlan" = "yes" ]; then
|
||||
echo AUTO_VLAN=\"yes\" >> /etc/fcoe/cfg-$netif
|
||||
else
|
||||
echo AUTO_VLAN=\"no\" >> /etc/fcoe/cfg-$netif
|
||||
fi
|
||||
echo MODE=\"fabric\" >> /etc/fcoe/cfg-$netif
|
||||
}
|
||||
|
||||
if [ "$dcb" = "dcb" ]; then
|
||||
# wait for lldpad to be ready
|
||||
i=0
|
||||
@@ -46,6 +62,13 @@ if [ "$dcb" = "dcb" ]; then
|
||||
i=$(($i+1))
|
||||
done
|
||||
|
||||
while [ $i -lt 60 ]; do
|
||||
dcbtool sc "$netif" pfc e:1 a:1 w:1 && break
|
||||
info "Retrying to turn dcb on"
|
||||
sleep 1
|
||||
i=$(($i+1))
|
||||
done
|
||||
|
||||
while [ $i -lt 60 ]; do
|
||||
dcbtool sc "$netif" app:fcoe e:1 a:1 w:1 && break
|
||||
info "Retrying to turn fcoe on"
|
||||
@@ -55,7 +78,8 @@ if [ "$dcb" = "dcb" ]; then
|
||||
|
||||
sleep 1
|
||||
|
||||
fipvlan "$netif" -c -s
|
||||
write_fcoemon_cfg
|
||||
fcoemon --syslog
|
||||
elif [ "$netdriver" = "bnx2x" ]; then
|
||||
# If driver is bnx2x, do not use /sys/module/fcoe/parameters/create but fipvlan
|
||||
modprobe 8021q
|
||||
@@ -64,7 +88,9 @@ elif [ "$netdriver" = "bnx2x" ]; then
|
||||
sleep 3
|
||||
fipvlan "$netif" -c -s
|
||||
else
|
||||
echo -n "$netif" > /sys/module/fcoe/parameters/create
|
||||
vlan="no"
|
||||
write_fcoemon_cfg
|
||||
fcoemon --syslog
|
||||
fi
|
||||
|
||||
need_shutdown
|
||||
|
0
modules.d/95fcoe/lldpad.sh
Normal file → Executable file
0
modules.d/95fcoe/lldpad.sh
Normal file → Executable file
@@ -10,8 +10,7 @@ check() {
|
||||
[ -z "$fcoe_ctlr" ] && return 255
|
||||
}
|
||||
|
||||
require_binaries dcbtool fipvlan lldpad ip readlink || return 1
|
||||
|
||||
require_binaries dcbtool fipvlan lldpad ip readlink fcoemon fcoeadm || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -67,9 +66,12 @@ cmdline() {
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_multiple ip dcbtool fipvlan lldpad readlink lldptool
|
||||
inst_multiple ip dcbtool fipvlan lldpad readlink lldptool fcoemon fcoeadm
|
||||
inst_libdir_file 'libhbalinux.so*'
|
||||
inst "/etc/hba.conf" "/etc/hba.conf"
|
||||
|
||||
mkdir -m 0755 -p "$initdir/var/lib/lldpad"
|
||||
mkdir -m 0755 -p "$initdir/etc/fcoe"
|
||||
|
||||
if [[ $hostonly_cmdline == "yes" ]] ; then
|
||||
local _fcoeconf=$(cmdline)
|
||||
@@ -80,6 +82,7 @@ install() {
|
||||
inst "$moddir/fcoe-genrules.sh" "/sbin/fcoe-genrules.sh"
|
||||
inst_hook pre-trigger 03 "$moddir/lldpad.sh"
|
||||
inst_hook cmdline 99 "$moddir/parse-fcoe.sh"
|
||||
inst_hook cleanup 90 "$moddir/cleanup-fcoe.sh"
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
||||
|
@@ -18,16 +18,15 @@
|
||||
# If it's not set we don't continue
|
||||
[ -z "$fcoe" ] && return
|
||||
|
||||
[ -e /sys/bus/fcoe/ctlr_create ] || modprobe -b -a fcoe || die "FCoE requested but kernel/initrd does not support FCoE"
|
||||
|
||||
# BRCM: Later, should check whether bnx2x is loaded first before loading bnx2fc so do not load bnx2fc when there are no Broadcom adapters
|
||||
[ -d /sys/module/fcoe ] || modprobe -a fcoe || die "FCoE requested but kernel/initrd does not support FCoE"
|
||||
|
||||
modprobe bnx2fc >/dev/null 2>&1
|
||||
udevadm settle --timeout=30
|
||||
initqueue --onetime modprobe -b -q bnx2fc
|
||||
|
||||
parse_fcoe_opts() {
|
||||
local OLDIFS="$IFS"
|
||||
local IFS=:
|
||||
set $fcoe
|
||||
IFS="$OLDIFS"
|
||||
|
||||
case $# in
|
||||
2)
|
||||
|
@@ -7,7 +7,7 @@ fstab_mount() {
|
||||
local _dev _mp _fs _opts _dump _pass _rest
|
||||
test -e "$1" || return 1
|
||||
info "Mounting from $1"
|
||||
while read _dev _mp _fs _opts _dump _pass _rest; do
|
||||
while read _dev _mp _fs _opts _dump _pass _rest || [ -n "$_dev" ]; do
|
||||
[ -z "${_dev%%#*}" ] && continue # Skip comment lines
|
||||
ismounted $_mp && continue # Skip mounted filesystem
|
||||
if [ "$_pass" -gt 0 ] && ! strstr "$_opts" _netdev; then
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -e /sys/module/bnx2i ] && killproc iscsiuio
|
||||
[ -z "${DRACUT_SYSTEMD}" ] && [ -e /sys/module/bnx2i ] && killproc iscsiuio
|
||||
|
||||
|
@@ -36,36 +36,30 @@ iroot=${iroot#:}
|
||||
# figured out a way how to check whether this is built-in or not
|
||||
modprobe crc32c 2>/dev/null
|
||||
|
||||
if [ -e /sys/module/bnx2i ] && ! [ -e /tmp/iscsiuio-started ]; then
|
||||
if [ -z "${DRACUT_SYSTEMD}" ] && [ -e /sys/module/bnx2i ] && ! [ -e /tmp/iscsiuio-started ]; then
|
||||
iscsiuio
|
||||
> /tmp/iscsiuio-started
|
||||
fi
|
||||
|
||||
handle_firmware()
|
||||
{
|
||||
if ! [ -e /tmp/iscsistarted-firmware ]; then
|
||||
if ! iscsistart -f; then
|
||||
warn "iscistart: Could not get list of targets from firmware."
|
||||
return 1
|
||||
fi
|
||||
|
||||
for p in $(getargs rd.iscsi.param -d iscsi_param); do
|
||||
iscsi_param="$iscsi_param --param $p"
|
||||
done
|
||||
|
||||
if ! iscsistart -b $iscsi_param; then
|
||||
warn "'iscsistart -b $iscsi_param' failed"
|
||||
fi
|
||||
|
||||
if [ -d /sys/class/iscsi_session ]; then
|
||||
echo 'started' > "/tmp/iscsistarted-iscsi:"
|
||||
echo 'started' > "/tmp/iscsistarted-firmware"
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
|
||||
need_shutdown
|
||||
if ! iscsistart -f; then
|
||||
warn "iscistart: Could not get list of targets from firmware."
|
||||
return 1
|
||||
fi
|
||||
|
||||
for p in $(getargs rd.iscsi.param -d iscsi_param); do
|
||||
iscsi_param="$iscsi_param --param $p"
|
||||
done
|
||||
|
||||
if ! iscsistart -b $iscsi_param; then
|
||||
warn "'iscsistart -b $iscsi_param' failed with return code $?"
|
||||
fi
|
||||
|
||||
echo 'started' > "/tmp/iscsistarted-iscsi:"
|
||||
echo 'started' > "/tmp/iscsistarted-firmware"
|
||||
|
||||
need_shutdown
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -105,53 +99,80 @@ handle_netroot()
|
||||
|
||||
parse_iscsi_root "$1" || return 1
|
||||
|
||||
# Bail out early, if there is no route to the destination
|
||||
if is_ip "$iscsi_target_ip" && [ "$netif" != "timeout" ] && ! all_ifaces_setup && getargbool 1 rd.iscsi.testroute; then
|
||||
ip route get "$iscsi_target_ip" >/dev/null 2>&1 || return 0
|
||||
fi
|
||||
|
||||
# XXX is this needed?
|
||||
getarg ro && iscsirw=ro
|
||||
getarg rw && iscsirw=rw
|
||||
fsopts=${fsopts:+$fsopts,}${iscsirw}
|
||||
|
||||
if [ -z $iscsi_initiator ]; then
|
||||
# XXX Where are these from?
|
||||
if [ -z "$iscsi_initiator" ] && [ -f /sys/firmware/ibft/initiator/initiator-name ] && ! [ -f /tmp/iscsi_set_initiator ]; then
|
||||
iscsi_initiator=$(while read line || [ -n "$line" ]; do echo $line;done < /sys/firmware/ibft/initiator/initiator-name)
|
||||
echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi
|
||||
rm -f /etc/iscsi/initiatorname.iscsi
|
||||
mkdir -p /etc/iscsi
|
||||
ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
|
||||
> /tmp/iscsi_set_initiator
|
||||
if [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
systemctl try-restart iscsid
|
||||
# FIXME: iscsid is not yet ready, when the service is :-/
|
||||
sleep 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$iscsi_initiator" ]; then
|
||||
[ -f /run/initiatorname.iscsi ] && . /run/initiatorname.iscsi
|
||||
[ -f /etc/initiatorname.iscsi ] && . /etc/initiatorname.iscsi
|
||||
[ -f /etc/iscsi/initiatorname.iscsi ] && . /etc/iscsi/initiatorname.iscsi
|
||||
iscsi_initiator=$InitiatorName
|
||||
|
||||
# XXX rfc3720 says 'SCSI Initiator Name: The iSCSI Initiator Name specifies
|
||||
# the worldwide unique name of the initiator.' Could we use hostname/ip
|
||||
# if missing?
|
||||
fi
|
||||
|
||||
if [ -z $iscsi_initiator ]; then
|
||||
if [ -f /sys/firmware/ibft/initiator/initiator-name ]; then
|
||||
iscsi_initiator=$(while read line; do echo $line;done < /sys/firmware/ibft/initiator/initiator-name)
|
||||
fi
|
||||
if [ -z "$iscsi_initiator" ]; then
|
||||
iscsi_initiator=$(iscsi-iname)
|
||||
echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi
|
||||
rm -f /etc/iscsi/initiatorname.iscsi
|
||||
mkdir -p /etc/iscsi
|
||||
ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
|
||||
> /tmp/iscsi_set_initiator
|
||||
if [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
systemctl try-restart iscsid
|
||||
# FIXME: iscsid is not yet ready, when the service is :-/
|
||||
sleep 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z $iscsi_target_port ]; then
|
||||
|
||||
if [ -z "$iscsi_target_port" ]; then
|
||||
iscsi_target_port=3260
|
||||
fi
|
||||
|
||||
if [ -z $iscsi_target_group ]; then
|
||||
if [ -z "$iscsi_target_group" ]; then
|
||||
iscsi_target_group=1
|
||||
fi
|
||||
|
||||
if [ -z $iscsi_initiator ]; then
|
||||
# XXX is this correct?
|
||||
iscsi_initiator=$(iscsi-iname)
|
||||
fi
|
||||
|
||||
if [ -z $iscsi_lun ]; then
|
||||
if [ -z "$iscsi_lun" ]; then
|
||||
iscsi_lun=0
|
||||
fi
|
||||
|
||||
echo "InitiatorName='$iscsi_initiator'" > /run/initiatorname.iscsi
|
||||
echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi
|
||||
ln -fs /run/initiatorname.iscsi /dev/.initiatorname.iscsi
|
||||
|
||||
if ! [ -e /etc/iscsi/initiatorname.iscsi ]; then
|
||||
mkdir -p /etc/iscsi
|
||||
ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
|
||||
if [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
systemctl try-restart iscsid
|
||||
# FIXME: iscsid is not yet ready, when the service is :-/
|
||||
sleep 1
|
||||
fi
|
||||
fi
|
||||
# FIXME $iscsi_protocol??
|
||||
|
||||
if [ "$root" = "dhcp" ]; then
|
||||
if [ "$root" = "dhcp" ] || [ "$netroot" = "dhcp" ]; then
|
||||
# if root is not specified try to mount the whole iSCSI LUN
|
||||
printf 'SYMLINK=="disk/by-path/*-iscsi-*-%s", SYMLINK+="root"\n' $iscsi_lun >> /etc/udev/rules.d/99-iscsi-root.rules
|
||||
printf 'SYMLINK=="disk/by-path/*-iscsi-*-%s", SYMLINK+="root"\n' "$iscsi_lun" >> /etc/udev/rules.d/99-iscsi-root.rules
|
||||
udevadm control --reload
|
||||
write_fs_tab /dev/root
|
||||
wait_for_dev -n /dev/root
|
||||
@@ -161,48 +182,85 @@ handle_netroot()
|
||||
echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > $hookdir/mount/01-$$-iscsi.sh
|
||||
fi
|
||||
|
||||
# force udevsettle to break
|
||||
> $hookdir/initqueue/work
|
||||
|
||||
iscsistart -i $iscsi_initiator -t $iscsi_target_name \
|
||||
-g $iscsi_target_group -a $iscsi_target_ip \
|
||||
-p $iscsi_target_port \
|
||||
${iscsi_username:+-u $iscsi_username} \
|
||||
${iscsi_password:+-w $iscsi_password} \
|
||||
${iscsi_in_username:+-U $iscsi_in_username} \
|
||||
${iscsi_in_password:+-W $iscsi_in_password} \
|
||||
${iscsi_iface_name:+--param iface.iscsi_ifacename=$iscsi_iface_name} \
|
||||
${iscsi_netdev_name:+--param iface.net_ifacename=$iscsi_netdev_name} \
|
||||
${iscsi_param} \
|
||||
|| :
|
||||
|
||||
if [ -n "$DRACUT_SYSTEMD" ] && command -v systemd-run >/dev/null 2>&1; then
|
||||
netroot_enc=$(systemd-escape "iscsistart_${1}")
|
||||
status=$(systemctl is-active "$netroot_enc" 2>/dev/null)
|
||||
is_active=$?
|
||||
if [ $is_active -ne 0 ]; then
|
||||
if [ "$status" != "activating" ] && ! systemctl is-failed "$netroot_enc" >/dev/null 2>&1; then
|
||||
systemd-run --no-block --service-type=oneshot --remain-after-exit --quiet \
|
||||
--description="Login iSCSI Target $iscsi_target_name" \
|
||||
--unit="$netroot_enc" -- \
|
||||
$(command -v iscsistart) \
|
||||
-i "$iscsi_initiator" -t "$iscsi_target_name" \
|
||||
-g "$iscsi_target_group" -a "$iscsi_target_ip" \
|
||||
-p "$iscsi_target_port" \
|
||||
${iscsi_username:+-u "$iscsi_username"} \
|
||||
${iscsi_password:+-w "$iscsi_password"} \
|
||||
${iscsi_in_username:+-U "$iscsi_in_username"} \
|
||||
${iscsi_in_password:+-W "$iscsi_in_password"} \
|
||||
${iscsi_iface_name:+--param "iface.iscsi_ifacename=$iscsi_iface_name"} \
|
||||
${iscsi_netdev_name:+--param "iface.net_ifacename=$iscsi_netdev_name"} \
|
||||
${iscsi_param} >/dev/null 2>&1 \
|
||||
&& { > $hookdir/initqueue/work ; }
|
||||
else
|
||||
systemctl --no-block restart "$netroot_enc" >/dev/null 2>&1 \
|
||||
&& { > $hookdir/initqueue/work ; }
|
||||
fi
|
||||
fi
|
||||
else
|
||||
iscsistart -i "$iscsi_initiator" -t "$iscsi_target_name" \
|
||||
-g "$iscsi_target_group" -a "$iscsi_target_ip" \
|
||||
-p "$iscsi_target_port" \
|
||||
${iscsi_username:+-u "$iscsi_username"} \
|
||||
${iscsi_password:+-w "$iscsi_password"} \
|
||||
${iscsi_in_username:+-U "$iscsi_in_username"} \
|
||||
${iscsi_in_password:+-W "$iscsi_in_password"} \
|
||||
${iscsi_iface_name:+--param "iface.iscsi_ifacename=$iscsi_iface_name"} \
|
||||
${iscsi_netdev_name:+--param "iface.net_ifacename=$iscsi_netdev_name"} \
|
||||
${iscsi_param} \
|
||||
&& { > $hookdir/initqueue/work ; }
|
||||
fi
|
||||
netroot_enc=$(str_replace "$1" '/' '\2f')
|
||||
echo 'started' > "/tmp/iscsistarted-iscsi:${netroot_enc}"
|
||||
return 0
|
||||
}
|
||||
|
||||
ret=0
|
||||
|
||||
# loop over all netroot parameter
|
||||
if getarg netroot; then
|
||||
for nroot in $(getargs netroot); do
|
||||
[ "${nroot%%:*}" = "iscsi" ] || continue
|
||||
nroot="${nroot##iscsi:}"
|
||||
if [ -n "$nroot" ]; then
|
||||
handle_netroot "$nroot"
|
||||
ret=$(($ret + $?))
|
||||
fi
|
||||
done
|
||||
if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then
|
||||
if [ "$netif" != "timeout" ] && getargbool 1 rd.iscsi.waitnet; then
|
||||
all_ifaces_setup || exit 0
|
||||
fi
|
||||
|
||||
if [ "$netif" = "timeout" ] && all_ifaces_setup; then
|
||||
# s.th. went wrong and the timeout script hits
|
||||
# restart
|
||||
systemctl restart iscsid
|
||||
# damn iscsid is not ready after unit says it's ready
|
||||
sleep 2
|
||||
fi
|
||||
|
||||
if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then
|
||||
if [ "$netif" = "timeout" ] || [ "$netif" = "online" ]; then
|
||||
handle_firmware
|
||||
ret=$(($ret + $?))
|
||||
fi
|
||||
else
|
||||
if [ -n "$iroot" ]; then
|
||||
handle_netroot "$iroot"
|
||||
ret=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! [ "$netif" = "online" ]; then
|
||||
# loop over all netroot parameter
|
||||
if nroot=$(getarg netroot) && [ "$nroot" != "dhcp" ]; then
|
||||
for nroot in $(getargs netroot); do
|
||||
[ "${nroot%%:*}" = "iscsi" ] || continue
|
||||
nroot="${nroot##iscsi:}"
|
||||
if [ -n "$nroot" ]; then
|
||||
handle_netroot "$nroot"
|
||||
ret=$(($ret + $?))
|
||||
fi
|
||||
done
|
||||
else
|
||||
if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then
|
||||
handle_firmware
|
||||
if [ -n "$iroot" ]; then
|
||||
handle_netroot "$iroot"
|
||||
ret=$?
|
||||
fi
|
||||
fi
|
||||
@@ -210,6 +268,6 @@ fi
|
||||
|
||||
need_shutdown
|
||||
|
||||
# now we have a root filesystem somewhere in /dev/sda*
|
||||
# now we have a root filesystem somewhere in /dev/sd*
|
||||
# let the normal block handler handle root=
|
||||
exit $ret
|
||||
|
@@ -166,7 +166,7 @@ installkernel() {
|
||||
local _merge=8 _side2=9
|
||||
function bmf1() {
|
||||
local _f
|
||||
while read _f; do
|
||||
while read _f || [ -n "$_f" ]; do
|
||||
case "$_f" in
|
||||
*.ko) [[ $(< $_f) =~ $_funcs ]] && echo "$_f" ;;
|
||||
*.ko.gz) [[ $(gzip -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
|
||||
@@ -178,7 +178,7 @@ installkernel() {
|
||||
|
||||
function rotor() {
|
||||
local _f1 _f2
|
||||
while read _f1; do
|
||||
while read _f1 || [ -n "$_f1" ]; do
|
||||
echo "$_f1"
|
||||
if read _f2; then
|
||||
echo "$_f2" 1>&${_side2}
|
||||
@@ -226,6 +226,37 @@ install() {
|
||||
inst "$moddir/iscsiroot.sh" "/sbin/iscsiroot"
|
||||
if ! dracut_module_included "systemd"; then
|
||||
inst "$moddir/mount-lun.sh" "/bin/mount-lun.sh"
|
||||
else
|
||||
inst_multiple -o \
|
||||
$systemdsystemunitdir/iscsi.service \
|
||||
$systemdsystemunitdir/iscsid.service \
|
||||
$systemdsystemunitdir/iscsid.socket \
|
||||
$systemdsystemunitdir/iscsiuio.service \
|
||||
$systemdsystemunitdir/iscsiuio.socket \
|
||||
iscsiadm iscsid
|
||||
|
||||
mkdir -p "${initdir}/$systemdsystemunitdir/sockets.target.wants"
|
||||
for i in \
|
||||
iscsiuio.socket \
|
||||
; do
|
||||
ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/sockets.target.wants/${i}"
|
||||
done
|
||||
|
||||
mkdir -p "${initdir}/$systemdsystemunitdir/basic.target.wants"
|
||||
for i in \
|
||||
iscsid.service \
|
||||
; do
|
||||
ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/basic.target.wants/${i}"
|
||||
done
|
||||
|
||||
# Make sure iscsid is started after dracut-cmdline and ready for the initqueue
|
||||
mkdir -p "${initdir}/$systemdsystemunitdir/iscsid.service.d"
|
||||
(
|
||||
echo "[Unit]"
|
||||
echo "After=dracut-cmdline.service"
|
||||
echo "Before=dracut-initqueue.service"
|
||||
) > "${initdir}/$systemdsystemunitdir/iscsid.service.d/dracut.conf"
|
||||
fi
|
||||
inst_dir /var/lib/iscsi
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
@@ -14,10 +14,17 @@
|
||||
# This script is sourced, so root should be set. But let's be paranoid
|
||||
[ -z "$root" ] && root=$(getarg root=)
|
||||
if [ -z "$netroot" ]; then
|
||||
for netroot in $(getargs netroot=); do
|
||||
[ "${netroot%%:*}" = "iscsi" ] && break
|
||||
for nroot in $(getargs netroot=); do
|
||||
[ "${nroot%%:*}" = "iscsi" ] && break
|
||||
done
|
||||
[ "${netroot%%:*}" = "iscsi" ] || unset netroot
|
||||
if [ "${nroot%%:*}" = "iscsi" ]; then
|
||||
netroot="$nroot"
|
||||
else
|
||||
for nroot in $(getargs netroot=); do
|
||||
[ "${nroot%%:*}" = "dhcp" ] && break
|
||||
done
|
||||
netroot="$nroot"
|
||||
fi
|
||||
fi
|
||||
[ -z "$iscsiroot" ] && iscsiroot=$(getarg iscsiroot=)
|
||||
[ -z "$iscsi_firmware" ] && getargbool 0 rd.iscsi.firmware -y iscsi_firmware && iscsi_firmware="1"
|
||||
@@ -34,13 +41,25 @@ if [ "${root%%:*}" = "iscsi" ] ; then
|
||||
netroot=$root
|
||||
# if root is not specified try to mount the whole iSCSI LUN
|
||||
printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules
|
||||
[ -n "$DRACUT_SYSTEMD" ] && systemctl is-active systemd-udevd && udevadm control --reload-rules
|
||||
root=/dev/root
|
||||
|
||||
write_fs_tab /dev/root
|
||||
fi
|
||||
|
||||
# If it's not empty or iscsi we don't continue
|
||||
[ -z "$netroot" ] || [ "${netroot%%:*}" = "iscsi" ] || return
|
||||
for nroot in $(getargs netroot); do
|
||||
[ "${nroot%%:*}" = "iscsi" ] || continue
|
||||
netroot="$nroot"
|
||||
break
|
||||
done
|
||||
|
||||
# Root takes precedence over netroot
|
||||
if [ "${root}" = "/dev/root" ] && getarg "netroot=dhcp" ; then
|
||||
# if root is not specified try to mount the whole iSCSI LUN
|
||||
printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules
|
||||
[ -n "$DRACUT_SYSTEMD" ] && systemctl is-active systemd-udevd && udevadm control --reload-rules
|
||||
fi
|
||||
|
||||
if [ -n "$iscsiroot" ] ; then
|
||||
[ -z "$netroot" ] && netroot=$root
|
||||
@@ -58,45 +77,79 @@ if [ -n "$iscsiroot" ] ; then
|
||||
fi
|
||||
|
||||
# iscsi_firmware does not need argument checking
|
||||
if [ -n "$iscsi_firmware" ] ; then
|
||||
[ -z "$netroot" ] && netroot=iscsi:
|
||||
modprobe -q iscsi_boot_sysfs 2>/dev/null
|
||||
modprobe -q iscsi_ibft
|
||||
initqueue --onetime --timeout /sbin/iscsiroot dummy "$netroot" "$NEWROOT"
|
||||
if [ -n "$iscsi_firmware" ]; then
|
||||
if [ "$root" != "dhcp" ] && [ "$netroot" != "dhcp" ]; then
|
||||
[ -z "$netroot" ] && netroot=iscsi:
|
||||
fi
|
||||
modprobe -b -q iscsi_boot_sysfs 2>/dev/null
|
||||
modprobe -b -q iscsi_ibft
|
||||
# if no ip= is given, but firmware
|
||||
echo "[ -f '/tmp/iscsistarted-firmware' ]" > $hookdir/initqueue/finished/iscsi_started.sh
|
||||
initqueue --unique --online /sbin/iscsiroot online "iscsi:" "$NEWROOT"
|
||||
initqueue --unique --onetime --timeout /sbin/iscsiroot timeout "iscsi:" "$NEWROOT"
|
||||
initqueue --unique --onetime --settled /sbin/iscsiroot online "iscsi:" "'$NEWROOT'"
|
||||
fi
|
||||
|
||||
# If it's not iscsi we don't continue
|
||||
[ "${netroot%%:*}" = "iscsi" ] || return
|
||||
|
||||
modprobe -q qla4xxx
|
||||
modprobe -q cxgb3i
|
||||
modprobe -q cxgb4i
|
||||
modprobe -q bnx2i
|
||||
modprobe -q be2iscsi
|
||||
|
||||
if [ -z "$iscsi_firmware" ] ; then
|
||||
type parse_iscsi_root >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
parse_iscsi_root "$netroot" || return
|
||||
if [ -z "$netroot" ] || ! [ "${netroot%%:*}" = "iscsi" ]; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
initqueue --unique --onetime --timeout /sbin/iscsiroot timeout "$netroot" "$NEWROOT"
|
||||
|
||||
initqueue --onetime modprobe --all -b -q qla4xxx cxgb3i cxgb4i bnx2i be2iscsi
|
||||
|
||||
# ISCSI actually supported?
|
||||
if ! [ -e /sys/module/iscsi_tcp ]; then
|
||||
modprobe -q iscsi_tcp || die "iscsiroot requested but kernel/initrd does not support iscsi"
|
||||
modprobe -b -q iscsi_tcp || die "iscsiroot requested but kernel/initrd does not support iscsi"
|
||||
fi
|
||||
|
||||
if [ -n "$netroot" ] && [ "$root" != "/dev/root" ] && [ "$root" != "dhcp" ]; then
|
||||
if ! getargbool 1 rd.neednet >/dev/null || ! getarg "ip="; then
|
||||
initqueue --onetime --settled /sbin/iscsiroot dummy "$netroot" "$NEWROOT"
|
||||
initqueue --unique --onetime --settled /sbin/iscsiroot dummy "'$netroot'" "'$NEWROOT'"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$iscsi_firmware" ] ; then
|
||||
echo "[ -f '/tmp/iscsistarted-firmware' ]" > $hookdir/initqueue/finished/iscsi_started.sh
|
||||
else
|
||||
netroot_enc=$(str_replace "$netroot" '/' '\2f')
|
||||
echo "[ -f '/tmp/iscsistarted-$netroot_enc' ]" > $hookdir/initqueue/finished/iscsi_started.sh
|
||||
if arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=) && [ -n "$arg" ] && ! [ -f /run/initiatorname.iscsi ] ; then
|
||||
iscsi_initiator=$arg
|
||||
echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi
|
||||
ln -fs /run/initiatorname.iscsi /dev/.initiatorname.iscsi
|
||||
if ! [ -e /etc/iscsi/initiatorname.iscsi ]; then
|
||||
mkdir -p /etc/iscsi
|
||||
ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
|
||||
if [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
systemctl try-restart iscsid
|
||||
# FIXME: iscsid is not yet ready, when the service is :-/
|
||||
sleep 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# If not given on the cmdline and initiator-name available via iBFT
|
||||
if [ -z $iscsi_initiator ] && [ -f /sys/firmware/ibft/initiator/initiator-name ] && ! [ -f /tmp/iscsi_set_initiator ]; then
|
||||
iscsi_initiator=$(while read line || [ -n "$line" ]; do echo $line;done < /sys/firmware/ibft/initiator/initiator-name)
|
||||
if [ -n "$iscsi_initiator" ]; then
|
||||
echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi
|
||||
rm -f /etc/iscsi/initiatorname.iscsi
|
||||
mkdir -p /etc/iscsi
|
||||
ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
|
||||
> /tmp/iscsi_set_initiator
|
||||
if [ -n "$DRACUT_SYSTEMD" ]; then
|
||||
systemctl try-restart iscsid
|
||||
# FIXME: iscsid is not yet ready, when the service is :-/
|
||||
sleep 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
for nroot in $(getargs netroot); do
|
||||
[ "${nroot%%:*}" = "iscsi" ] || continue
|
||||
type parse_iscsi_root >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
parse_iscsi_root "$nroot" || return 1
|
||||
netroot_enc=$(str_replace "$nroot" '/' '\2f')
|
||||
echo "[ -f '/tmp/iscsistarted-$netroot_enc' ]" > $hookdir/initqueue/finished/iscsi_started.sh
|
||||
done
|
||||
|
||||
# Done, all good!
|
||||
rootok=1
|
||||
|
||||
|
@@ -7,7 +7,7 @@ check() {
|
||||
require_binaries rpc.statd mount.nfs mount.nfs4 umount || return 1
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for fs in ${host_fs_types[@]}; do
|
||||
for fs in "${host_fs_types[@]}"; do
|
||||
[[ "$fs" == "nfs" ]] && return 0
|
||||
[[ "$fs" == "nfs3" ]] && return 0
|
||||
[[ "$fs" == "nfs4" ]] && return 0
|
||||
|
@@ -15,6 +15,7 @@ nfs_to_var() {
|
||||
# FIXME: local netif=${2:-$netif}?
|
||||
case "$1" in
|
||||
nfs://*) rfc2224_nfs_to_var "$1" ;;
|
||||
nfs:*[*) anaconda_nfsv6_to_var "$1" ;;
|
||||
nfs:*:*:/*) anaconda_nfs_to_var "$1" ;;
|
||||
*) nfsroot_to_var "$1" ;;
|
||||
esac
|
||||
@@ -84,6 +85,23 @@ anaconda_nfs_to_var() {
|
||||
path="/${1##*:/}"
|
||||
}
|
||||
|
||||
# IPv6 nfs path will be treated separately
|
||||
anaconda_nfsv6_to_var() {
|
||||
nfs="nfs"
|
||||
path="$1:"
|
||||
options="${path#*:/}"
|
||||
path="/${options%%:*}"
|
||||
server="${1#*nfs:}"
|
||||
if str_starts $server '['; then
|
||||
server="${server%:/*}"
|
||||
options="${options#*:*}"
|
||||
else
|
||||
server="${server%:/*}"
|
||||
options="${server%%:*}"
|
||||
server="${server#*:}"
|
||||
fi
|
||||
}
|
||||
|
||||
# nfsroot_from_dhcp NETIF
|
||||
# fill in missing server/path from DHCP options.
|
||||
nfsroot_from_dhcp() {
|
||||
|
@@ -38,7 +38,7 @@ if [ -n "$netroot" ] ; then
|
||||
[ "$n" = "$netroot" ] && break
|
||||
done
|
||||
if [ "$n" = "$netroot" ]; then
|
||||
warn "Ignoring netroot argument for NFS"
|
||||
#warn "Ignoring netroot argument for NFS"
|
||||
netroot=$root
|
||||
fi
|
||||
else
|
||||
@@ -57,7 +57,14 @@ fi
|
||||
|
||||
case "$netroot" in
|
||||
/dev/nfs) netroot=nfs;;
|
||||
/dev/*) unset netroot; return;;
|
||||
/dev/*)
|
||||
if [ -n "$oldnetroot" ]; then
|
||||
netroot="$oldnetroot"
|
||||
else
|
||||
unset netroot
|
||||
fi
|
||||
return
|
||||
;;
|
||||
# LEGACY: root=<server-ip>:/<path
|
||||
[0-9]*:/*|[0-9]*\.[0-9]*\.[0-9]*[!:]|/*)
|
||||
netroot=nfs:$netroot;;
|
||||
|
@@ -37,6 +37,8 @@ esac
|
||||
|
||||
if ! getarg noresume; then
|
||||
if [ -n "$resume" ]; then
|
||||
wait_for_dev /dev/resume
|
||||
|
||||
{
|
||||
printf "KERNEL==\"%s\", ACTION==\"add|change\", SYMLINK+=\"resume\"\n" \
|
||||
${resume#/dev/};
|
||||
@@ -65,7 +67,7 @@ if ! getarg noresume; then
|
||||
printf -- '%s\n' ' RUN+="/sbin/initqueue --finished --unique --name 00resume echo %M:%m > /sys/power/resume"'
|
||||
} >> /etc/udev/rules.d/99-resume.rules
|
||||
|
||||
printf '[ -e "%s" ] && { ln -s "%s" /dev/resume; rm -f -- "$job" "%s/initqueue/timeout/resume.sh"; }\n' \
|
||||
printf '[ -e "%s" ] && { ln -s "%s" /dev/resume 2> /dev/null; rm -f -- "$job" "%s/initqueue/timeout/resume.sh"; }\n' \
|
||||
"$resume" "$resume" "$hookdir" >> $hookdir/initqueue/settled/resume.sh
|
||||
|
||||
{
|
||||
|
@@ -30,11 +30,19 @@ cmdline_journal() {
|
||||
}
|
||||
|
||||
cmdline_rootfs() {
|
||||
local dev=/dev/block/$(find_root_block_device)
|
||||
if [ -e $dev ]; then
|
||||
printf " root=%s" "$(shorten_persistent_dev "$(get_persistent_dev "$dev")")"
|
||||
printf " rootflags=%s" "$(find_mp_fsopts /)"
|
||||
printf " rootfstype=%s" "$(find_mp_fstype /)"
|
||||
local _dev=/dev/block/$(find_root_block_device)
|
||||
local _fstype _flags _subvol
|
||||
if [ -e $_dev ]; then
|
||||
printf " root=%s" "$(shorten_persistent_dev "$(get_persistent_dev "$_dev")")"
|
||||
_fstype="$(find_mp_fstype /)"
|
||||
_flags="$(find_mp_fsopts /)"
|
||||
printf " rootfstype=%s" "$_fstype"
|
||||
if [[ $use_fstab != yes ]] && [[ $_fstype = btrfs ]]; then
|
||||
_subvol=$(findmnt -e -v -n -o FSROOT --target /) \
|
||||
&& _subvol=${_subvol#/}
|
||||
_flags="$_flags,${_subvol:+subvol=$_subvol}"
|
||||
fi
|
||||
printf " rootflags=%s" "${_flags#,}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user