Compare commits
222 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
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 | ||
![]() |
e97ed33775 | ||
![]() |
04942c4569 | ||
![]() |
296d013f1a | ||
![]() |
64a69cb49f | ||
![]() |
70598ac292 | ||
![]() |
2a12e97475 | ||
![]() |
8a430ab25b | ||
![]() |
2a5a7fb662 | ||
![]() |
f182cb9599 | ||
![]() |
9dc0c244b8 | ||
![]() |
b4fb539c9b | ||
![]() |
18423f7951 | ||
![]() |
6dcc5e1158 | ||
![]() |
e3e1f406bb | ||
![]() |
496e3d962d | ||
![]() |
7cddd7b838 | ||
![]() |
93342718cd | ||
![]() |
4ba44e899c | ||
![]() |
36e8ce4fb0 | ||
![]() |
4089949033 | ||
![]() |
eb8f202ed0 | ||
![]() |
c59779cf93 | ||
![]() |
1dc360790d | ||
![]() |
e0dc6cd4f6 | ||
![]() |
ebc82d38b7 | ||
![]() |
c9364f6ea2 | ||
![]() |
332ecaa900 | ||
![]() |
3e7a05f2a5 | ||
![]() |
733c71ce9e | ||
![]() |
a17d5cf494 | ||
![]() |
bea41b898a | ||
![]() |
e683985d10 | ||
![]() |
4b6b46bb2a | ||
![]() |
fe116c1670 | ||
![]() |
7700b3df4c | ||
![]() |
486030575d | ||
![]() |
ce8f354dbd | ||
![]() |
a262ad91e8 | ||
![]() |
681462eca8 | ||
![]() |
9492008435 | ||
![]() |
22e837b645 | ||
![]() |
0a68a26cff | ||
![]() |
8b257fcc86 | ||
![]() |
c64a94caa9 | ||
![]() |
8d40852e8c | ||
![]() |
cd72830807 | ||
![]() |
206345ce9b | ||
![]() |
4d25892179 | ||
![]() |
6df523517f | ||
![]() |
118ca9ecfc | ||
![]() |
3838dc47c3 | ||
![]() |
5c84d51b3f | ||
![]() |
517d27a75f | ||
![]() |
3ae60e559f | ||
![]() |
7c2311660f | ||
![]() |
bd44831b82 | ||
![]() |
e3eec4b8a2 | ||
![]() |
fe273e3901 | ||
![]() |
3244bf5981 | ||
![]() |
56663e7e32 | ||
![]() |
f34a2ef14d | ||
![]() |
c4d8793c67 | ||
![]() |
54e28d79b9 | ||
![]() |
2e34f38095 | ||
![]() |
9ebf4a5d3c | ||
![]() |
a3a2266046 | ||
![]() |
4aad3438f7 | ||
![]() |
442abd16d2 | ||
![]() |
8f4ee8c71b | ||
![]() |
15eed1e4f1 | ||
![]() |
36894743e3 | ||
![]() |
ae8e6ed5af | ||
![]() |
552c37e156 | ||
![]() |
1f8abe81a9 | ||
![]() |
25b987fed6 | ||
![]() |
414dc51ca2 | ||
![]() |
ca4108b78e | ||
![]() |
c440d302f1 | ||
![]() |
3ae03005b8 | ||
![]() |
99d4fd6bb7 | ||
![]() |
3a04bddeed | ||
![]() |
fa45d0d9c9 | ||
![]() |
3659d64df3 | ||
![]() |
370035d561 | ||
![]() |
2b2033e561 | ||
![]() |
78a78e4239 | ||
![]() |
856f8265aa | ||
![]() |
cf864c1b80 | ||
![]() |
26d14fb3d3 | ||
![]() |
e1e4ee9d7c | ||
![]() |
778b354360 | ||
![]() |
af67d62151 | ||
![]() |
027565d023 | ||
![]() |
66fd7e4329 | ||
![]() |
56d2aed1c8 | ||
![]() |
27dcc3a583 | ||
![]() |
5cac9e14ec | ||
![]() |
d9935e4664 | ||
![]() |
f95b78f3eb | ||
![]() |
84125ddae1 | ||
![]() |
2f0f1b0bbc | ||
![]() |
34a1ec6a36 | ||
![]() |
972d6b44ba | ||
![]() |
3947f07d93 | ||
![]() |
3c90cc2f48 | ||
![]() |
1c08ad507b | ||
![]() |
ab2f95e45e | ||
![]() |
eda73c0ad2 | ||
![]() |
f44b084660 | ||
![]() |
cfd51d2be2 | ||
![]() |
d829e7fce2 | ||
![]() |
b09faad877 |
@@ -1,2 +1,3 @@
|
||||
(setq sh-basic-offset: 4)
|
||||
(setq indent-tabs-mode nil)
|
||||
((nil . ((setq sh-basic-offset: 4)
|
||||
(setq indent-tabs-mode nil)
|
||||
)))
|
||||
|
4
.mailmap
4
.mailmap
@@ -10,7 +10,9 @@ Andrey Borzenkov <arvidjaar@gmail.com> <arvidjaar@mail.ru>
|
||||
Dan Horák <dhorak@redhat.com> <dan@danny.cz>
|
||||
John Reiser <jreiser@bitwagon.com> <jreiser@BitWagon.com>
|
||||
Luca Berra <bluca@vodka.it> <bluca@comedia.it>
|
||||
Dave Young <dyoung@redhat.com> dyoung@redhat.com
|
||||
Dave Young <dyoung@redhat.com> <dyoung@redhat.com>
|
||||
Dave Young <dyoung@redhat.com> <dave@redhat.com>
|
||||
Frederick Grose <fgrose@sugarlabs.org> <fgrose@gmail.com>
|
||||
Frederic Crozat <fcrozat@suse.com> <fcrozat@mandriva.com>
|
||||
Shawn W Dunn <sfalken@opensuse.org> <sfalken@opensuse.org>
|
||||
Kyle McMartin <kmcmarti@redhat.com> <kyle@redhat.com>
|
||||
|
@@ -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
|
||||
|
||||
|
67
AUTHORS
67
AUTHORS
@@ -7,36 +7,43 @@ Warren Togami <wtogami@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
Dave Young <dyoung@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>
|
||||
WANG Chao <chaowang@redhat.com>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Hannes Reinecke <hare@suse.de>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Alexander Tsoy <alexander@tsoy.me>
|
||||
John Reiser <jreiser@bitwagon.com>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
Thomas Renninger <trenn@suse.de>
|
||||
Alexander Tsoy <alexander@tsoy.me>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
Dan Horák <dhorak@redhat.com>
|
||||
Baoquan He <bhe@redhat.com>
|
||||
Leho Kraav <leho@kraav.com>
|
||||
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>
|
||||
Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Fabian Deutsch <fabiand@fedoraproject.org>
|
||||
Frederic Crozat <fcrozat@suse.com>
|
||||
James Lee <jlee@thestaticvoid.com>
|
||||
Jesse Keating <jkeating@redhat.com>
|
||||
Milan Broz <mbroz@redhat.com>
|
||||
Radek Vykydal <rvykydal@redhat.com>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
Roberto Sassu <roberto.sassu@polito.it>
|
||||
Anton Blanchard <anton@samba.org>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Chapman Flack <g2@anastigmatix.net>
|
||||
David Cantrell <dcantrell@redhat.com>
|
||||
Dennis Gilmore <dennis@ausil.us>
|
||||
Jon Ander Hernandez <jonan.h@gmail.com>
|
||||
@@ -44,21 +51,32 @@ Juan RP <xtraeme@gmail.com>
|
||||
Lance Albertson <lance@osuosl.org>
|
||||
Marian Ganisin <mganisin@redhat.com>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Peter Robinson <pbrobinson@gmail.com>
|
||||
Stefan Reimer <it@startux.de>
|
||||
Stig Telfer <stelfer@cray.com>
|
||||
Vasiliy Tolstov <v.tolstov@selfip.ru>
|
||||
Ville Skyttä <ville.skytta@iki.fi>
|
||||
Wim Muskee <wimmuskee@gmail.com>
|
||||
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
||||
Alan Pevec <apevec@redhat.com>
|
||||
Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Alex Harpin <development@landsofshadow.co.uk>
|
||||
Daniel Schaal <farbing@web.de>
|
||||
Erwan Velu <erwan.velu@enovance.com>
|
||||
Frederick Grose <fgrose@sugarlabs.org>
|
||||
Hari Bathini <hbathini@linux.vnet.ibm.com>
|
||||
Ian Dall <ian@beware.dropbear.id.au>
|
||||
James Buren <ryuo@frugalware.org>
|
||||
James Lee <jlee@thestaticvoid.com>
|
||||
Jan Synacek <jsynacek@redhat.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 Snitzer <snitzer@redhat.com>
|
||||
Minfei Huang <mhuang@redhat.com>
|
||||
Przemysław Rudy <prudy1@o2.pl>
|
||||
Stefan Reimer <it@startux.de>
|
||||
Thomas Backlund <tmb@mageia.org>
|
||||
Thomas Lange <lange@informatik.uni-koeln.de>
|
||||
Till Maas <opensource@till.name>
|
||||
Vivek Goyal <vgoyal@redhat.com>
|
||||
@@ -67,52 +85,63 @@ Adam Williamson <awilliam@redhat.com>
|
||||
Alexander Todorov <atodorov@redhat.com>
|
||||
Andy Lutomirski <luto@mit.edu>
|
||||
Anssi Hannula <anssi@mageia.org>
|
||||
Antony Messerli <amesserl@rackspace.com>
|
||||
Brandon Philips <brandon@ifup.co>
|
||||
Canek Peláez Valdés <caneko@gmail.com>
|
||||
Chao Fan <cfan@redhat.com>
|
||||
Chris Leech <cleech@redhat.com>
|
||||
Christian Heinz <christian.ch.heinz@gmail.com>
|
||||
Christian Rodrigues <crrodriguez@opensuse.org>
|
||||
Cong Wang <amwang@redhat.com>
|
||||
Daniel Schaal <farbing@web.de>
|
||||
Daniel Drake <drake@endlessm.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
Dave Young <dave@redhat.com>
|
||||
Dennis Schridde <devurandom@gmx.net>
|
||||
Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
|
||||
Duane Griffin <duaneg@dghda.com>
|
||||
Gerd von Egidy <gerd.von.egidy@intra2net.com>
|
||||
Glen Gray <slaine@slaine.org>
|
||||
Hari Bathini <hbathini@linux.vnet.ibm.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>
|
||||
Kyle McMartin <kmcmarti@redhat.com>
|
||||
Kyle McMartin <kyle@redhat.com>
|
||||
Lars R. Damerow <lars@pixar.com>
|
||||
Lennert Buytenhek <buytenh@wantstofly.org>
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
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>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Mike Gorse <mgorse@suse.com>
|
||||
Moritz 'Morty' Strübe <morty@gmx.net>
|
||||
Munehiro Matsuda <haro@kgt.co.jp>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
Nikoli <nikoli@gmx.us>
|
||||
Nikoli <nikoli@lavabit.com>
|
||||
Olivier Blin <dev@blino.org>
|
||||
P J P <ppandit@redhat.com>
|
||||
Paolo Bonzini <pbonzini@redhat.com>
|
||||
Peter Robinson <pbrobinson@fedoraproject.org>
|
||||
Praveen_Paladugu@Dell.com <Praveen_Paladugu@Dell.com>
|
||||
Pádraig Brady <P@draigBrady.com>
|
||||
Quentin Armitage <quentin@armitage.org.uk>
|
||||
Robert Buchholz <rbu@goodpoint.de>
|
||||
Rusty Bird <rustybird@openmailbox.org>
|
||||
Sergey Fionov <fionov@gmail.com>
|
||||
Shawn W Dunn <sfalken@opensuse.org>
|
||||
Srinivasa T N <seenutn@linux.vnet.ibm.com>
|
||||
Thilo Bangert <thilo.bangert@gmx.net>
|
||||
Thomas Backlund <tmb@mageia.org>
|
||||
Tobias Geerinckx <tobias.geerinckx@gmail.com>
|
||||
Tom Gundersen <teg@jklm.no>
|
||||
Tomasz Torcz <tomek@pipebreaker.pl>
|
||||
Vadim Kuznetsov <vadimk@gentoo.org>
|
||||
Ville Skyttä <ville.skytta@iki.fi>
|
||||
Vaughan Cao <vaughan.cao@oracle.com>
|
||||
Vratislav Podzimek <vpodzime@redhat.com>
|
||||
Yanko Kaneti <yaneti@declera.com>
|
||||
jloeser <jloeser@suse.de>
|
||||
maximilian attems <max@stro.at>
|
||||
xtraeme <xtraeme@voidlinux.eu>
|
||||
|
41
Makefile
41
Makefile
@@ -13,8 +13,9 @@ sysconfdir ?= ${prefix}/etc
|
||||
bindir ?= ${prefix}/bin
|
||||
mandir ?= ${prefix}/share/man
|
||||
CFLAGS ?= -O2 -g -Wall
|
||||
CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64 -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
|
||||
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 \
|
||||
@@ -96,7 +97,15 @@ dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
|
||||
http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl 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)
|
||||
@@ -124,7 +133,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 +147,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,6 +164,8 @@ 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:
|
||||
@echo "DRACUT_VERSION=$(VERSION)$(GITVERSION)" > dracut-version.sh
|
||||
@@ -212,7 +223,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
|
||||
@@ -234,7 +245,7 @@ hostimage: all
|
||||
@echo wrote test-$(shell uname -r).img
|
||||
|
||||
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
|
||||
|
61
NEWS
61
NEWS
@@ -1,3 +1,64 @@
|
||||
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
|
||||
- fixed gzip compression for versions, which do not have --rsyncable
|
||||
- fixed ifcfg generation for persistent interface names
|
||||
- multipath:
|
||||
* new option to turn off multipath "rd.multipath=0" completly
|
||||
* preload scsi dh modules
|
||||
* start multipathd via systemd service
|
||||
- do not fail, if user pressed ESC during media check
|
||||
- fixed systemd-journal by symlinking /var/log to /run/initramfs/log
|
||||
- initrd-release moved to /usr/lib
|
||||
- lots of iSCSI fixes
|
||||
- new "rd.timeout" to specify the systemd JobTimeoutSec for devices
|
||||
- if $initrd/etc/cmdline.d/* has a "root=" and the kernel cmdline does not,
|
||||
generate a mount unit for it
|
||||
- increased the initqueue timeout for non systemd initramfs to 180s
|
||||
- $initrd/etc/cmdline.d/ hostonly files are now generated for NFS
|
||||
- make use of systemd-hibernate-resume, if available
|
||||
- fixed ldconfig parsing for hwcap output
|
||||
- network: add support for comma separated autoconf options like ip=eth0:auto6,dhcp
|
||||
- new parameter "rd.live.overlay.size" to specify the overlay for live images
|
||||
- changed the test suite for the new sfdisk syntax
|
||||
- added cache tools for dm-cache setups
|
||||
|
||||
dracut-040
|
||||
==========
|
||||
- fixed dracut module dependency checks
|
||||
- fixed test suite
|
||||
|
||||
dracut-039
|
||||
==========
|
||||
- DRACUT_PATH can now be used to specify the PATH used by dracut
|
||||
|
@@ -1,14 +1,17 @@
|
||||
For the testsuite to work, you will have to install at least the following software packages:
|
||||
dash
|
||||
asciidoc
|
||||
mdadm
|
||||
lvm2
|
||||
cryptsetup
|
||||
nfs-utils
|
||||
netbsd-iscsi
|
||||
nbd
|
||||
dhcp (dhcp-server on openSUSE)
|
||||
dash \
|
||||
bridge-utils \
|
||||
asciidoc \
|
||||
mdadm \
|
||||
lvm2 \
|
||||
cryptsetup \
|
||||
nfs-utils \
|
||||
netbsd-iscsi \
|
||||
nbd \
|
||||
dhcp-server \
|
||||
iscsi-initiator-utils
|
||||
|
||||
|
||||
TEST-04-FULL-SYSTEMD: systemd >= 187
|
||||
|
||||
How to run the testsuite:
|
||||
|
3
TODO
3
TODO
@@ -6,6 +6,8 @@ Items are ordered in priority.
|
||||
|
||||
INITRAMFS TODO
|
||||
|
||||
- search domain string
|
||||
- peerdns=no
|
||||
- allow dual stack configuration (IPv4, IPv6) for the same interface
|
||||
- "bind-mount" kernel drivers in real root for the rescue image,
|
||||
if the real root does not have any kernel modules for this kernel
|
||||
@@ -28,6 +30,7 @@ GENERATOR TODO
|
||||
|
||||
- report errors on missing files in check()
|
||||
- remove wait for swap devs, if no "resume=" is given on the kernel command line
|
||||
- remove wait for swap devs, if the "resume" dracut module is not included (omitted)
|
||||
- add presets (predefined set of modules)
|
||||
- add interpreter/plugin-scripts to be sourced at the beginning or end (can use dracut-functions)
|
||||
- add mechanism for module specific command line options
|
||||
|
@@ -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
|
||||
'
|
||||
)
|
||||
|
||||
|
@@ -104,17 +104,7 @@ fi
|
||||
|
||||
ldconfig_paths()
|
||||
{
|
||||
local a i
|
||||
declare -A a
|
||||
for i in $(
|
||||
ldconfig -pN 2>/dev/null | grep -F '=>' | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | while read a b c d; do
|
||||
d=${d%/*}
|
||||
printf "%s\n" "$d";
|
||||
done
|
||||
); do
|
||||
a["$i"]=1;
|
||||
done;
|
||||
printf "%s\n" ${!a[@]}
|
||||
ldconfig -pN 2>/dev/null | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | sed -n 's,.* => \(.*\)/.*,\1,p' | sort | uniq
|
||||
}
|
||||
|
||||
# Detect lib paths
|
||||
@@ -176,7 +166,13 @@ srcmods="/lib/modules/$kernel/"
|
||||
}
|
||||
export srcmods
|
||||
|
||||
if ! type dinfo >/dev/null 2>&1; then
|
||||
# is_func <command>
|
||||
# Check whether $1 is a function.
|
||||
is_func() {
|
||||
[[ "$(type -t "$1")" = "function" ]]
|
||||
}
|
||||
|
||||
if ! is_func dinfo >/dev/null 2>&1; then
|
||||
. "$dracutbasedir/dracut-logger.sh"
|
||||
dlog_init
|
||||
fi
|
||||
@@ -209,12 +205,6 @@ mksubdirs() {
|
||||
[[ -e ${1%/*} ]] || mkdir -m 0755 -p -- "${1%/*}"
|
||||
}
|
||||
|
||||
# is_func <command>
|
||||
# Check whether $1 is a function.
|
||||
is_func() {
|
||||
[[ "$(type -t "$1")" = "function" ]]
|
||||
}
|
||||
|
||||
# Function prints global variables in format name=value line by line.
|
||||
# $@ = list of global variables' name
|
||||
print_vars() {
|
||||
@@ -319,7 +309,7 @@ get_fs_env() {
|
||||
[[ $1 ]] || return
|
||||
unset ID_FS_TYPE
|
||||
ID_FS_TYPE=$(blkid -u filesystem -o export -- "$1" \
|
||||
| while read line; do
|
||||
| while read line || [ -n "$line" ]; do
|
||||
if [[ "$line" == TYPE\=* ]]; then
|
||||
printf "%s" "${line#TYPE=}";
|
||||
exit 0;
|
||||
@@ -445,7 +435,7 @@ find_block_device() {
|
||||
if [[ $use_fstab != yes ]]; then
|
||||
[[ -d $_find_mpt/. ]]
|
||||
findmnt -e -v -n -o 'MAJ:MIN,SOURCE' --target "$_find_mpt" | { \
|
||||
while read _majmin _dev; do
|
||||
while read _majmin _dev || [ -n "$_dev" ]; do
|
||||
if [[ -b $_dev ]]; then
|
||||
if ! [[ $_majmin ]] || [[ $_majmin == 0:* ]]; then
|
||||
_majmin=$(get_maj_min $_dev)
|
||||
@@ -466,7 +456,7 @@ find_block_device() {
|
||||
# fall back to /etc/fstab
|
||||
|
||||
findmnt -e --fstab -v -n -o 'MAJ:MIN,SOURCE' --target "$_find_mpt" | { \
|
||||
while read _majmin _dev; do
|
||||
while read _majmin _dev || [ -n "$_dev" ]; do
|
||||
if ! [[ $_dev ]]; then
|
||||
_dev="$_majmin"
|
||||
unset _majmin
|
||||
@@ -502,7 +492,7 @@ find_mp_fstype() {
|
||||
|
||||
if [[ $use_fstab != yes ]]; then
|
||||
findmnt -e -v -n -o 'FSTYPE' --target "$1" | { \
|
||||
while read _fs; do
|
||||
while read _fs || [ -n "$_fs" ]; do
|
||||
[[ $_fs ]] || continue
|
||||
[[ $_fs = "autofs" ]] && continue
|
||||
printf "%s" "$_fs"
|
||||
@@ -511,7 +501,7 @@ find_mp_fstype() {
|
||||
fi
|
||||
|
||||
findmnt --fstab -e -v -n -o 'FSTYPE' --target "$1" | { \
|
||||
while read _fs; do
|
||||
while read _fs || [ -n "$_fs" ]; do
|
||||
[[ $_fs ]] || continue
|
||||
[[ $_fs = "autofs" ]] && continue
|
||||
printf "%s" "$_fs"
|
||||
@@ -538,7 +528,7 @@ find_dev_fstype() {
|
||||
|
||||
if [[ $use_fstab != yes ]]; then
|
||||
findmnt -e -v -n -o 'FSTYPE' --source "$_find_dev" | { \
|
||||
while read _fs; do
|
||||
while read _fs || [ -n "$_fs" ]; do
|
||||
[[ $_fs ]] || continue
|
||||
[[ $_fs = "autofs" ]] && continue
|
||||
printf "%s" "$_fs"
|
||||
@@ -547,7 +537,7 @@ find_dev_fstype() {
|
||||
fi
|
||||
|
||||
findmnt --fstab -e -v -n -o 'FSTYPE' --source "$_find_dev" | { \
|
||||
while read _fs; do
|
||||
while read _fs || [ -n "$_fs" ]; do
|
||||
[[ $_fs ]] || continue
|
||||
[[ $_fs = "autofs" ]] && continue
|
||||
printf "%s" "$_fs"
|
||||
@@ -698,10 +688,12 @@ for_each_host_dev_and_slaves()
|
||||
# but you cannot create the logical volume without the volume group.
|
||||
# And the volume group might be bigger than the devices the LV needs.
|
||||
check_vol_slaves() {
|
||||
local _lv _vg _pv
|
||||
local _lv _vg _pv _dm
|
||||
for i in /dev/mapper/*; do
|
||||
[[ $i == /dev/mapper/control ]] && continue
|
||||
_lv=$(get_maj_min $i)
|
||||
_dm=/sys/dev/block/$_lv/dm
|
||||
[[ -f $_dm/uuid && $(<$_dm/uuid) =~ LVM-* ]] || continue
|
||||
if [[ $_lv = $2 ]]; then
|
||||
_vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null)
|
||||
# strip space
|
||||
@@ -743,6 +735,8 @@ fi
|
||||
|
||||
if ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/dracut-install ]]; then
|
||||
DRACUT_INSTALL=$dracutbasedir/dracut-install
|
||||
elif ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/install/dracut-install ]]; then
|
||||
DRACUT_INSTALL=$dracutbasedir/install/dracut-install
|
||||
fi
|
||||
|
||||
if ! [[ -x $DRACUT_INSTALL ]]; then
|
||||
@@ -983,7 +977,7 @@ inst_rules_wildcard() {
|
||||
_found=$_rule
|
||||
fi
|
||||
done
|
||||
if [ -n ${hostonly} ] ; then
|
||||
if [[ -n ${hostonly} ]] ; then
|
||||
for _rule in ${_target}/$1 ; do
|
||||
if [[ -f $_rule ]]; then
|
||||
inst_rule_programs "$_rule"
|
||||
@@ -1003,7 +997,7 @@ prepare_udev_rules() {
|
||||
for f in "$@"; do
|
||||
f="${initdir}/etc/udev/rules.d/$f"
|
||||
[ -e "$f" ] || continue
|
||||
while read line; do
|
||||
while read line || [ -n "$line" ]; do
|
||||
if [ "${line%%IMPORT PATH_ID}" != "$line" ]; then
|
||||
if [ $UDEVVERSION -ge 174 ]; then
|
||||
printf '%sIMPORT{builtin}="path_id"\n' "${line%%IMPORT PATH_ID}"
|
||||
@@ -1136,7 +1130,7 @@ inst_opt_decompress() {
|
||||
# or the "check" script, if module-setup.sh is not found
|
||||
# "check $hostonly" is called
|
||||
module_check() {
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _ret
|
||||
local _forced=0
|
||||
local _hostonly=$hostonly
|
||||
@@ -1167,7 +1161,7 @@ module_check() {
|
||||
# or the "check" script, if module-setup.sh is not found
|
||||
# "mount_needs=1 check 0" is called
|
||||
module_check_mount() {
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _ret
|
||||
mount_needs=1
|
||||
[[ -d $_moddir ]] || return 1
|
||||
@@ -1192,7 +1186,7 @@ module_check_mount() {
|
||||
# execute the depends() function of module-setup.sh of <dracut module>
|
||||
# or the "depends" script, if module-setup.sh is not found
|
||||
module_depends() {
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _ret
|
||||
[[ -d $_moddir ]] || return 1
|
||||
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
||||
@@ -1215,7 +1209,7 @@ module_depends() {
|
||||
# execute the cmdline() function of module-setup.sh of <dracut module>
|
||||
# or the "cmdline" script, if module-setup.sh is not found
|
||||
module_cmdline() {
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _ret
|
||||
[[ -d $_moddir ]] || return 1
|
||||
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
||||
@@ -1236,7 +1230,7 @@ module_cmdline() {
|
||||
# execute the install() function of module-setup.sh of <dracut module>
|
||||
# or the "install" script, if module-setup.sh is not found
|
||||
module_install() {
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _ret
|
||||
[[ -d $_moddir ]] || return 1
|
||||
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
||||
@@ -1257,7 +1251,7 @@ module_install() {
|
||||
# execute the installkernel() function of module-setup.sh of <dracut module>
|
||||
# or the "installkernel" script, if module-setup.sh is not found
|
||||
module_installkernel() {
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _ret
|
||||
[[ -d $_moddir ]] || return 1
|
||||
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
||||
@@ -1279,7 +1273,7 @@ module_installkernel() {
|
||||
# device and filesystem types in "${host_fs_types[@]}"
|
||||
check_mount() {
|
||||
local _mod=$1
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _ret
|
||||
local _moddep
|
||||
|
||||
@@ -1314,13 +1308,17 @@ check_mount() {
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
for _moddep in $(module_depends $_mod); do
|
||||
# handle deps as if they were manually added
|
||||
[[ " $add_dracutmodules " == *\ $_moddep\ * ]] || \
|
||||
add_dracutmodules+=" $_moddep "
|
||||
[[ " $force_add_dracutmodules " == *\ $_moddep\ * ]] || \
|
||||
force_add_dracutmodules+=" $_moddep "
|
||||
[[ " $dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& dracutmodules+=" $_moddep "
|
||||
[[ " $add_dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $add_dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& add_dracutmodules+=" $_moddep "
|
||||
[[ " $force_add_dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $force_add_dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& force_add_dracutmodules+=" $_moddep "
|
||||
# if a module we depend on fail, fail also
|
||||
if ! check_module $_moddep; then
|
||||
derror "dracut module '$_mod' depends on '$_moddep', which can't be installed"
|
||||
@@ -1340,7 +1338,7 @@ check_mount() {
|
||||
# that the modules were checked for the dependency tracking process
|
||||
check_module() {
|
||||
local _mod=$1
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||
local _ret
|
||||
local _moddep
|
||||
# If we are already scheduled to be loaded, no need to check again.
|
||||
@@ -1358,7 +1356,7 @@ check_module() {
|
||||
fi
|
||||
|
||||
if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then
|
||||
if [[ " $force_add_dracutmodules " == *\ $_mod\ * ]]; then
|
||||
if [[ " $dracutmodules $force_add_dracutmodules " == *\ $_mod\ * ]]; then
|
||||
module_check $_mod 1; ret=$?
|
||||
else
|
||||
module_check $_mod 0; ret=$?
|
||||
@@ -1369,7 +1367,11 @@ check_module() {
|
||||
# module not in our list
|
||||
if [[ $dracutmodules = all ]]; then
|
||||
# check, if we can and should install this module
|
||||
module_check $_mod || return 1
|
||||
module_check $_mod; ret=$?
|
||||
if [[ $ret != 0 ]]; then
|
||||
[[ $2 ]] && return 1
|
||||
[[ $ret != 255 ]] && return 1
|
||||
fi
|
||||
else
|
||||
# skip this module
|
||||
return 1
|
||||
@@ -1378,10 +1380,15 @@ check_module() {
|
||||
|
||||
for _moddep in $(module_depends $_mod); do
|
||||
# handle deps as if they were manually added
|
||||
[[ " $add_dracutmodules " == *\ $_moddep\ * ]] || \
|
||||
add_dracutmodules+=" $_moddep "
|
||||
[[ " $force_add_dracutmodules " == *\ $_moddep\ * ]] || \
|
||||
force_add_dracutmodules+=" $_moddep "
|
||||
[[ " $dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& dracutmodules+=" $_moddep "
|
||||
[[ " $add_dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $add_dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& add_dracutmodules+=" $_moddep "
|
||||
[[ " $force_add_dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $force_add_dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& force_add_dracutmodules+=" $_moddep "
|
||||
# if a module we depend on fail, fail also
|
||||
if ! check_module $_moddep; then
|
||||
derror "dracut module '$_mod' depends on '$_moddep', which can't be installed"
|
||||
@@ -1418,11 +1425,13 @@ for_each_module_dir() {
|
||||
[[ " $mods_to_load " == *\ $_mod\ * ]] && continue
|
||||
|
||||
[[ " $force_add_dracutmodules " != *\ $_mod\ * ]] \
|
||||
&& [[ " $dracutmodules " != *\ $_mod\ * ]] \
|
||||
&& [[ " $omit_dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& continue
|
||||
|
||||
derror "dracut module '$_mod' cannot be found or installed."
|
||||
[[ " $force_add_dracutmodules " == *\ $_mod\ * ]] && exit 1
|
||||
[[ " $dracutmodules " == *\ $_mod\ * ]] && exit 1
|
||||
[[ " $add_dracutmodules " == *\ $_mod\ * ]] && exit 1
|
||||
done
|
||||
}
|
||||
@@ -1442,7 +1451,7 @@ install_kmod_with_fw() {
|
||||
|
||||
if [[ $omit_drivers ]]; then
|
||||
local _kmod=${1##*/}
|
||||
_kmod=${_kmod%.ko}
|
||||
_kmod=${_kmod%.ko*}
|
||||
_kmod=${_kmod/-/_}
|
||||
if [[ "$_kmod" =~ $omit_drivers ]]; then
|
||||
dinfo "Omitting driver $_kmod"
|
||||
@@ -1456,7 +1465,7 @@ install_kmod_with_fw() {
|
||||
|
||||
if [[ $silent_omit_drivers ]]; then
|
||||
local _kmod=${1##*/}
|
||||
_kmod=${_kmod%.ko}
|
||||
_kmod=${_kmod%.ko*}
|
||||
_kmod=${_kmod/-/_}
|
||||
[[ "$_kmod" =~ $silent_omit_drivers ]] && return 0
|
||||
[[ "${1##*/lib/modules/$kernel/}" =~ $silent_omit_drivers ]] && return 0
|
||||
@@ -1503,7 +1512,7 @@ for_each_kmod_dep() {
|
||||
local _func=$1 _kmod=$2 _cmd _modpath _options
|
||||
shift 2
|
||||
modprobe "$@" --ignore-install --show-depends $_kmod 2>&${_fderr} | (
|
||||
while read _cmd _modpath _options; do
|
||||
while read _cmd _modpath _options || [ -n "$_cmd" ]; do
|
||||
[[ $_cmd = insmod ]] || continue
|
||||
$_func ${_modpath} || exit $?
|
||||
done
|
||||
@@ -1519,7 +1528,7 @@ dracut_kernel_post() {
|
||||
--ignore-install --show-depends --set-version $kernel \
|
||||
< "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist" 2>/dev/null \
|
||||
| sort -u \
|
||||
| while read _cmd _modpath _options; do
|
||||
| while read _cmd _modpath _options || [ -n "$_cmd" ]; do
|
||||
[[ $_cmd = insmod ]] || continue
|
||||
echo "$_modpath"
|
||||
done > "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
|
||||
@@ -1528,7 +1537,7 @@ dracut_kernel_post() {
|
||||
if [[ $DRACUT_INSTALL ]] && [[ -z $_moddirname ]]; then
|
||||
xargs -r $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} -a < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
|
||||
else
|
||||
while read _modpath; do
|
||||
while read _modpath || [ -n "$_modpath" ]; do
|
||||
local _destpath=$_modpath
|
||||
[[ $_moddirname ]] && _destpath=${_destpath##$_moddirname/}
|
||||
_destpath=${_destpath##*/lib/modules/$kernel/}
|
||||
@@ -1536,12 +1545,12 @@ dracut_kernel_post() {
|
||||
done < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
|
||||
fi
|
||||
) &
|
||||
_pid=$(jobs -p | while read a ; do printf ":$a";done)
|
||||
_pid=$(jobs -p | while read a || [ -n "$a" ]; do printf ":$a";done)
|
||||
_pid=${_pid##*:}
|
||||
|
||||
if [[ $DRACUT_INSTALL ]]; then
|
||||
xargs -r modinfo -k $kernel -F firmware < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep" \
|
||||
| while read line; do
|
||||
| while read line || [ -n "$line" ]; do
|
||||
for _fwdir in $fw_dir; do
|
||||
echo $_fwdir/$line;
|
||||
done;
|
||||
@@ -1580,7 +1589,7 @@ module_is_host_only() {
|
||||
local _mod=$1
|
||||
local _modenc a i _k _s _v _aliases
|
||||
_mod=${_mod##*/}
|
||||
_mod=${_mod%.ko}
|
||||
_mod=${_mod%.ko*}
|
||||
_modenc=${_mod//-/_}
|
||||
|
||||
[[ " $add_drivers " == *\ ${_mod}\ * ]] && return 0
|
||||
@@ -1626,7 +1635,7 @@ find_kernel_modules_by_path () {
|
||||
|
||||
_OLDIFS=$IFS
|
||||
IFS=:
|
||||
while read a rest; do
|
||||
while read a rest || [ -n "$a" ]; do
|
||||
[[ $a = */$1/* ]] || [[ $a = updates/* ]] || continue
|
||||
printf "%s\n" "$srcmods/$a"
|
||||
done < "$srcmods/modules.dep"
|
||||
@@ -1670,11 +1679,18 @@ instmods() {
|
||||
--*) _mpargs+=" $_mod" ;;
|
||||
*)
|
||||
_mod=${_mod##*/}
|
||||
# Check for aliased modules
|
||||
_modalias=$(modinfo -k $kernel -F filename $_mod 2> /dev/null)
|
||||
_modalias=${_modalias%.ko*}
|
||||
if [[ $_modalias ]] && [ "${_modalias##*/}" != "${_mod%.ko*}" ] ; then
|
||||
_mod=${_modalias##*/}
|
||||
fi
|
||||
|
||||
# if we are already installed, skip this module and go on
|
||||
# to the next one.
|
||||
if [[ $DRACUT_KERNEL_LAZY_HASHDIR ]] && \
|
||||
[[ -f "$DRACUT_KERNEL_LAZY_HASHDIR/${_mod%.ko}.ko" ]]; then
|
||||
read _ret <"$DRACUT_KERNEL_LAZY_HASHDIR/${_mod%.ko}.ko"
|
||||
[[ -f "$DRACUT_KERNEL_LAZY_HASHDIR/${_mod%.ko*}" ]]; then
|
||||
read _ret <"$DRACUT_KERNEL_LAZY_HASHDIR/${_mod%.ko*}"
|
||||
return $_ret
|
||||
fi
|
||||
|
||||
@@ -1704,7 +1720,7 @@ instmods() {
|
||||
((_ret+=$?))
|
||||
else
|
||||
[[ $DRACUT_KERNEL_LAZY_HASHDIR ]] && \
|
||||
echo $_mod >> "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist"
|
||||
echo ${_mod%.ko*} >> "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
@@ -1714,20 +1730,18 @@ instmods() {
|
||||
function instmods_1() {
|
||||
local _mod _mpargs
|
||||
if (($# == 0)); then # filenames from stdin
|
||||
while read _mod; do
|
||||
while read _mod || [ -n "$_mod" ]; do
|
||||
inst1mod "${_mod%.ko*}" || {
|
||||
if [[ "$_check" == "yes" ]]; then
|
||||
[[ "$_silent" == "no" ]] && dfatal "Failed to install module $_mod"
|
||||
return 1
|
||||
if [[ "$_check" == "yes" ]] && [[ "$_silent" == "no" ]]; then
|
||||
dfatal "Failed to install module $_mod"
|
||||
fi
|
||||
}
|
||||
done
|
||||
fi
|
||||
while (($# > 0)); do # filenames as arguments
|
||||
inst1mod ${1%.ko*} || {
|
||||
if [[ "$_check" == "yes" ]]; then
|
||||
[[ "$_silent" == "no" ]] && dfatal "Failed to install module $1"
|
||||
return 1
|
||||
if [[ "$_check" == "yes" ]] && [[ "$_silent" == "no" ]]; then
|
||||
dfatal "Failed to install module $1"
|
||||
fi
|
||||
}
|
||||
shift
|
||||
@@ -1739,7 +1753,7 @@ instmods() {
|
||||
# Capture all stderr from modprobe to _fderr. We could use {var}>...
|
||||
# redirections, but that would make dracut require bash4 at least.
|
||||
eval "( instmods_1 \"\$@\" ) ${_fderr}>&1" \
|
||||
| while read line; do [[ "$line" =~ $_filter_not_found ]] || echo $line;done | derror
|
||||
| while read line || [ -n "$line" ]; do [[ "$line" =~ $_filter_not_found ]] || echo $line;done | derror
|
||||
_ret=$?
|
||||
return $_ret
|
||||
}
|
||||
|
@@ -2,6 +2,10 @@
|
||||
|
||||
set -e
|
||||
|
||||
# do some sanity checks first
|
||||
[ -e /run/initramfs/bin/sh ] && exit 0
|
||||
[ -e /run/initramfs/.need_shutdown ] || exit 0
|
||||
|
||||
KERNEL_VERSION="$(uname -r)"
|
||||
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
|
||||
@@ -10,6 +14,8 @@ SKIP="$dracutbasedir/skipcpio"
|
||||
|
||||
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||||
|
||||
mount -o ro /boot &>/dev/null
|
||||
|
||||
if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
|
||||
IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
|
||||
fi
|
||||
@@ -18,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
|
||||
|
@@ -365,7 +365,7 @@ dlog() {
|
||||
if (( $# > 1 )); then
|
||||
_do_dlog "$@"
|
||||
else
|
||||
while read line; do
|
||||
while read line || [ -n "$line" ]; do
|
||||
_do_dlog "$1" "$line"
|
||||
done
|
||||
fi
|
||||
|
16
dracut.8.asc
16
dracut.8.asc
@@ -31,7 +31,7 @@ early userspace.
|
||||
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
|
||||
@@ -465,6 +465,20 @@ will not be able to boot.
|
||||
**--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_::
|
||||
|
@@ -142,11 +142,16 @@ Misc
|
||||
have been loaded. This parameter can be specified multiple times.
|
||||
|
||||
**rd.retry=**__<seconds>__::
|
||||
specify how long dracut should wait for devices to appear.
|
||||
specify how long dracut should retry the initqueue to configure devices.
|
||||
The default is 30 seconds. After 2/3 of the time, degraded raids are force
|
||||
started. If you have hardware, which takes a very long time to announce its
|
||||
drives, you might want to extend this value.
|
||||
|
||||
**rd.timeout=**__<seconds>__::
|
||||
specify how long dracut should wait for devices to appear. The
|
||||
default is '0', which means 'forever'. Note that this timeout
|
||||
should be longer than rd.retry to allow for proper configuration.
|
||||
|
||||
**rd.noverifyssl**::
|
||||
accept self-signed certificates for ssl downloads.
|
||||
|
||||
@@ -158,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.
|
||||
@@ -379,6 +384,11 @@ DM RAID
|
||||
only activate the raid sets with the given UUID. This parameter can be
|
||||
specified multiple times.
|
||||
|
||||
MULTIPATH
|
||||
~~~~~~~~~
|
||||
**rd.multipath=0**::
|
||||
disable multipath detection
|
||||
|
||||
FIPS
|
||||
~~~~
|
||||
**rd.fips**::
|
||||
@@ -824,11 +834,39 @@ 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.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)__
|
||||
Allow the usage of a permanent overlay.
|
||||
_<devspec>_ specifies the path to a device with a mountable filesystem.
|
||||
_<pathspec>_ is the path to a file within that filesystem, which shall be used to
|
||||
persist the changes made to the device specified by **root=live:__<url>__** option.
|
||||
+
|
||||
[listing]
|
||||
.Example
|
||||
--
|
||||
rd.live.overlay=/dev/sdb1:persistent-overlay.img
|
||||
--
|
||||
|
||||
**rd.live.overlay.thin=**1::
|
||||
Enables the usage of thin snapshots instead of classic dm snapshots.
|
||||
The advantage of thin snapshots is, that they support discards, and will free
|
||||
blocks which are not claimed by the filesystem. In this use case this means,
|
||||
that memory is given back to the kernel, when the filesystem does not claim it
|
||||
anymore.
|
||||
|
||||
**rd.writable.fsimg=**1::
|
||||
Enables writable filesystem support. The system will boot with a fully
|
||||
writable filesystem without snapshots __(see notes above about available live boot options)__.
|
||||
You can use the **rootflags** option to set mount options for the live
|
||||
filesystem as well __(see documentation about rootflags in the **Standard** section above)__.
|
||||
This implies that the whole image is copied to RAM before the boot continues.
|
||||
+
|
||||
NOTE: There must be enough free RAM available to hold the complete image.
|
||||
+
|
||||
This method is very suitable for diskless boots.
|
||||
|
||||
|
||||
Plymouth Boot Splash
|
||||
@@ -952,6 +990,8 @@ rd_NO_MD:: rd.md=0
|
||||
|
||||
rd_MD_UUID:: rd.md.uuid
|
||||
|
||||
rd_NO_MULTIPATH: rd.multipath=0
|
||||
|
||||
rd_NFS_DOMAIN:: rd.nfs.domain
|
||||
|
||||
iscsi_initiator:: rd.iscsi.initiator
|
||||
|
@@ -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
|
||||
@@ -74,6 +75,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 +92,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 +197,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_::
|
||||
|
@@ -2,8 +2,10 @@
|
||||
|
||||
# i18n
|
||||
i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP"
|
||||
i18n_default_font="latarcyrheb-sun16"
|
||||
i18n_default_font="eurlatgr"
|
||||
i18n_install_all="yes"
|
||||
|
||||
|
||||
stdloglvl=3
|
||||
sysloglvl=5
|
||||
install_optional_items+=" vi /etc/virc ps grep cat rm "
|
||||
@@ -13,3 +15,5 @@ systemdsystemunitdir=/usr/lib/systemd/system
|
||||
systemdsystemconfdir=/etc/systemd/system
|
||||
udevdir=/usr/lib/udev
|
||||
hostonly="yes"
|
||||
hostonly_cmdline="no"
|
||||
early_microcode="yes"
|
||||
|
@@ -1,3 +1,24 @@
|
||||
# SUSE specifc dracut settings
|
||||
#
|
||||
# SUSE by default always builds a as small as possible initrd for performance
|
||||
# and resource reasons.
|
||||
# If you like to build a generic initrd which works on other platforms than
|
||||
# on the one dracut/mkinitrd got called comment out below setting(s).
|
||||
hostonly="yes"
|
||||
hostonly_cmdline="yes"
|
||||
|
||||
compress="xz -0 --check=crc32 --memlimit-compress=50%"
|
||||
|
||||
i18n_vars="/etc/sysconfig/language:RC_LANG-LANG,RC_LC_ALL-LC_ALL /etc/sysconfig/console:CONSOLE_UNICODEMAP-FONT_UNIMAP,CONSOLE_FONT-FONT,CONSOLE_SCREENMAP-FONT_MAP /etc/sysconfig/keyboard:KEYTABLE-KEYMAP"
|
||||
omit_drivers+=" i2o_scsi"
|
||||
|
||||
# Below adds additional tools to the initrd which are not urgently necessary to
|
||||
# bring up the system, but help to debug problems.
|
||||
# See /usr/lib/dracut/modules.d/95debug/module-setup.sh which additional tools
|
||||
# are installed and add more if you need them. This specifically helps if you
|
||||
# use:
|
||||
# rd.break=[cmdline|pre-udev|pre-trigger|initqueue|pre-mount|
|
||||
# mount|pre-pivot|cleanup]
|
||||
# boot parameter or if you are forced to enter the dracut emergency shell.
|
||||
|
||||
# add_dracutmodules+=debug
|
||||
|
@@ -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
|
||||
|
316
dracut.sh
316
dracut.sh
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/bash --norc
|
||||
#
|
||||
# Generator script for a dracut initramfs
|
||||
# Tries to retain some degree of compatibility with the command line
|
||||
@@ -195,6 +195,10 @@ Creates initial ramdisk images for preloading modules
|
||||
--logfile [FILE] Logfile to use (overrides configuration setting)
|
||||
--reproducible Create reproducible images
|
||||
--loginstall [DIR] Log all files installed from the host to [DIR]
|
||||
--uefi Create an UEFI executable with the kernel cmdline and
|
||||
kernel combined
|
||||
--uefi-stub [FILE] Use the UEFI stub [FILE] to create an UEFI executable
|
||||
--kernel-image [FILE] location of the kernel image
|
||||
|
||||
If [LIST] has multiple arguments, then you have to put these in quotes.
|
||||
|
||||
@@ -219,6 +223,16 @@ push() {
|
||||
done
|
||||
}
|
||||
|
||||
# Fills up host_devs stack variable and makes sure there are no duplicates
|
||||
push_host_devs() {
|
||||
local _dev
|
||||
for _dev in ${host_devs[@]}; do
|
||||
[ "$_dev" = "$1" ] && return
|
||||
done
|
||||
push host_devs "$1"
|
||||
}
|
||||
|
||||
|
||||
# function pop()
|
||||
# pops the last value from a stack
|
||||
# assigns value to second argument variable
|
||||
@@ -379,6 +393,9 @@ rearrange_params()
|
||||
--long no-early-microcode \
|
||||
--long reproducible \
|
||||
--long loginstall: \
|
||||
--long uefi \
|
||||
--long uefi-stub: \
|
||||
--long kernel-image: \
|
||||
-- "$@")
|
||||
|
||||
if (( $? != 0 )); then
|
||||
@@ -567,6 +584,11 @@ while :; do
|
||||
--regenerate-all) regenerate_all="yes";;
|
||||
--noimageifnotneeded) noimageifnotneeded="yes";;
|
||||
--reproducible) reproducible_l="yes";;
|
||||
--uefi) uefi="yes";;
|
||||
--uefi-stub)
|
||||
uefi_stub_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--kernel-image)
|
||||
kernel_image_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
|
||||
--) shift; break;;
|
||||
|
||||
*) # should not even reach this point
|
||||
@@ -799,7 +821,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
|
||||
[[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l
|
||||
[[ $lvmconf_l ]] && lvmconf=$lvmconf_l
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
|
||||
[[ $fw_dir ]] || fw_dir="/lib/firmware/updates /lib/firmware"
|
||||
[[ $fw_dir ]] || fw_dir="/lib/firmware/updates /lib/firmware /lib/firmware/$kernel"
|
||||
[[ $tmpdir_l ]] && tmpdir="$tmpdir_l"
|
||||
[[ $tmpdir ]] || tmpdir=/var/tmp
|
||||
[[ $INITRD_COMPRESS ]] && compress=$INITRD_COMPRESS
|
||||
@@ -812,17 +834,36 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
|
||||
[[ $logfile_l ]] && logfile="$logfile_l"
|
||||
[[ $reproducible_l ]] && reproducible="$reproducible_l"
|
||||
[[ $loginstall_l ]] && loginstall="$loginstall_l"
|
||||
[[ $uefi_stub_l ]] && uefi_stub="$uefi_stub_l"
|
||||
[[ $kernel_image_l ]] && kernel_image="$kernel_image_l"
|
||||
|
||||
# eliminate IFS hackery when messing with fw_dir
|
||||
fw_dir=${fw_dir//:/ }
|
||||
|
||||
# check for logfile and try to create one if it doesn't exist
|
||||
if [[ -n "$logfile" ]];then
|
||||
if [[ ! -f "$logfile" ]];then
|
||||
touch "$logfile"
|
||||
if [ ! $? -eq 0 ] ;then
|
||||
printf "%s\n" "dracut: touch $logfile failed." >&2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# handle compression options.
|
||||
[[ $compress ]] || compress="gzip"
|
||||
case $compress in
|
||||
bzip2) compress="bzip2 -9";;
|
||||
bzip2) compress="bzip2 -9";
|
||||
command -v lbzip2 > /dev/null 2>&1 && compress="lbzip2 -9";;
|
||||
lzma) compress="lzma -9 -T0";;
|
||||
xz) compress="xz --check=crc32 --lzma2=dict=1MiB -T0";;
|
||||
gzip) compress="gzip -n -9 --rsyncable"; command -v pigz > /dev/null 2>&1 && compress="pigz -9 -n -T -R";;
|
||||
gzip) compress="gzip -n -9";
|
||||
if command -v pigz > /dev/null 2>&1; then
|
||||
compress="pigz -9 -n -T -R"
|
||||
elif command -v gzip --help 2>&1 | grep -q rsyncable; then
|
||||
compress="gzip -n -9 --rsyncable"
|
||||
fi
|
||||
;;
|
||||
lzo) compress="lzop -9";;
|
||||
lz4) compress="lz4 -l -9";;
|
||||
esac
|
||||
@@ -854,6 +895,7 @@ trap '
|
||||
ret=$?;
|
||||
[[ $keep ]] && echo "Not removing $initdir." >&2 || { [[ $initdir ]] && rm -rf -- "$initdir"; };
|
||||
[[ $keep ]] && echo "Not removing $early_cpio_dir." >&2 || { [[ $early_cpio_dir ]] && rm -Rf -- "$early_cpio_dir"; };
|
||||
[[ $keep ]] && echo "Not removing $uefi_outdir." >&2 || { [[ $uefi_outdir ]] && rm -Rf -- "$uefi_outdir"; };
|
||||
[[ $_dlogdir ]] && rm -Rf -- "$_dlogdir";
|
||||
exit $ret;
|
||||
' EXIT
|
||||
@@ -893,7 +935,7 @@ if ! [[ $print_cmdline ]]; then
|
||||
rm -fr -- ${initdir}/*
|
||||
fi
|
||||
|
||||
# Verify bash version, current minimum is 3.1
|
||||
# Verify bash version, current minimum is 4
|
||||
if (( BASH_VERSINFO[0] < 4 )); then
|
||||
dfatal 'You need at least Bash 4 to use dracut, sorry.'
|
||||
exit 1
|
||||
@@ -1005,6 +1047,48 @@ if [[ ! $print_cmdline ]]; then
|
||||
fi
|
||||
loginstall=$(readlink -f "$loginstall")
|
||||
fi
|
||||
|
||||
if [[ $uefi = yes ]]; then
|
||||
if ! command -v objcopy &>/dev/null; then
|
||||
dfatal "Need 'objcopy' to create a UEFI executable"
|
||||
exit 1
|
||||
fi
|
||||
unset EFI_MACHINE_TYPE_NAME
|
||||
case $(arch) in
|
||||
x86_64)
|
||||
EFI_MACHINE_TYPE_NAME=x64;;
|
||||
ia32)
|
||||
EFI_MACHINE_TYPE_NAME=ia32;;
|
||||
*)
|
||||
dfatal "Architecture '$(arch)' not supported to create a UEFI executable"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if ! [[ -s $uefi_stub ]]; then
|
||||
for uefi_stub in \
|
||||
"/lib/systemd/boot/efi/linux${EFI_MACHINE_TYPE_NAME}.efi.stub" \
|
||||
"/usr/lib/gummiboot/linux${EFI_MACHINE_TYPE_NAME}.efi.stub"; do
|
||||
[[ -s $uefi_stub ]] || continue
|
||||
break
|
||||
done
|
||||
fi
|
||||
if ! [[ -s $uefi_stub ]]; then
|
||||
dfatal "Can't find a uefi stub '$uefi_stub' to create a UEFI executable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! [[ $kernel_image ]]; then
|
||||
for kernel_image in "/lib/modules/$kernel/vmlinuz" "/boot/vmlinuz-$kernel"; do
|
||||
[[ -s "$kernel_image" ]] || continue
|
||||
break
|
||||
done
|
||||
fi
|
||||
if ! [[ -s $kernel_image ]]; then
|
||||
dfatal "Can't find a kernel image '$kernel_image' to create a UEFI executable"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $acpi_override = yes ]] && ! check_kernel_config CONFIG_ACPI_INITRD_TABLE_OVERRIDE; then
|
||||
@@ -1045,26 +1129,42 @@ declare -A host_fs_types
|
||||
|
||||
for line in "${fstab_lines[@]}"; do
|
||||
set -- $line
|
||||
dev="$1"
|
||||
#dev mp fs fsopts
|
||||
push host_devs "$1"
|
||||
host_fs_types["$1"]="$3"
|
||||
case "$dev" in
|
||||
UUID=*)
|
||||
dev=$(blkid -l -t UUID=${dev#UUID=} -o device)
|
||||
;;
|
||||
LABEL=*)
|
||||
dev=$(blkid -l -t LABEL=${dev#LABEL=} -o device)
|
||||
;;
|
||||
PARTUUID=*)
|
||||
dev=$(blkid -l -t PARTUUID=${dev#PARTUUID=} -o device)
|
||||
;;
|
||||
PARTLABEL=*)
|
||||
dev=$(blkid -l -t PARTLABEL=${dev#PARTLABEL=} -o device)
|
||||
;;
|
||||
esac
|
||||
[ -z "$dev" ] && dwarn "Bad fstab entry $@" && continue
|
||||
push_host_devs "$dev"
|
||||
host_fs_types["$dev"]="$3"
|
||||
done
|
||||
|
||||
for f in $add_fstab; do
|
||||
[[ -e $f ]] || continue
|
||||
while read dev rest; do
|
||||
push host_devs "$dev"
|
||||
while read dev rest || [ -n "$dev" ]; do
|
||||
push_host_devs "$dev"
|
||||
done < "$f"
|
||||
done
|
||||
|
||||
for dev in $add_device; do
|
||||
push host_devs "$dev"
|
||||
push_host_devs "$dev"
|
||||
done
|
||||
|
||||
if (( ${#add_device_l[@]} )); then
|
||||
while pop add_device_l val; do
|
||||
add_device+=" $val "
|
||||
push host_devs "$val"
|
||||
push_host_devs "$val"
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -1093,17 +1193,17 @@ if [[ $hostonly ]]; then
|
||||
_dev=$(find_block_device "$mp")
|
||||
_bdev=$(readlink -f "/dev/block/$_dev")
|
||||
[[ -b $_bdev ]] && _dev=$_bdev
|
||||
push host_devs $_dev
|
||||
push_host_devs $_dev
|
||||
[[ "$mp" == "/" ]] && root_dev="$_dev"
|
||||
push host_devs "$_dev"
|
||||
push_host_devs "$_dev"
|
||||
done
|
||||
|
||||
if [[ -f /proc/swaps ]] && [[ -f /etc/fstab ]]; then
|
||||
while read dev type rest; do
|
||||
while read dev type rest || [ -n "$dev" ]; do
|
||||
[[ -b $dev ]] || continue
|
||||
[[ "$type" == "partition" ]] || continue
|
||||
|
||||
while read _d _m _t _o _r; do
|
||||
while read _d _m _t _o _r || [ -n "$_d" ]; do
|
||||
[[ "$_d" == \#* ]] && continue
|
||||
[[ $_d ]] || continue
|
||||
[[ $_t != "swap" ]] && continue
|
||||
@@ -1113,7 +1213,7 @@ if [[ $hostonly ]]; then
|
||||
[[ "$_d" -ef "$dev" ]] || continue
|
||||
|
||||
if [[ -f /etc/crypttab ]]; then
|
||||
while read _mapper _a _p _o; do
|
||||
while read _mapper _a _p _o || [ -n "$_mapper" ]; do
|
||||
[[ $_mapper = \#* ]] && continue
|
||||
[[ "$_d" -ef /dev/mapper/"$_mapper" ]] || continue
|
||||
[[ "$_o" ]] || _o="$_p"
|
||||
@@ -1124,7 +1224,9 @@ if [[ $hostonly ]]; then
|
||||
done < /etc/crypttab
|
||||
fi
|
||||
|
||||
push host_devs "$(readlink -f "$dev")"
|
||||
_dev="$(readlink -f "$dev")"
|
||||
push_host_devs "$_dev"
|
||||
push swap_devs "$_dev"
|
||||
break
|
||||
done < /etc/fstab
|
||||
done < /proc/swaps
|
||||
@@ -1132,8 +1234,8 @@ if [[ $hostonly ]]; then
|
||||
# record all host modaliases
|
||||
declare -A host_modalias
|
||||
find /sys/devices/ -name uevent -print > "$initdir/.modalias"
|
||||
while read m; do
|
||||
while read line; do
|
||||
while read m || [ -n "$m" ]; do
|
||||
while read line || [ -n "$line" ]; do
|
||||
[[ "$line" != MODALIAS\=* ]] && continue
|
||||
modalias="${line##MODALIAS=}" && [[ $modalias ]] && host_modalias["$modalias"]=1
|
||||
break
|
||||
@@ -1142,14 +1244,14 @@ if [[ $hostonly ]]; then
|
||||
|
||||
rm -f -- "$initdir/.modalias"
|
||||
|
||||
while read _k _s _v; do
|
||||
while read _k _s _v || [ -n "$_k" ]; do
|
||||
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
|
||||
host_modalias["$_v"]=1
|
||||
done </proc/crypto
|
||||
|
||||
# check /proc/modules
|
||||
declare -A host_modules
|
||||
while read m rest; do
|
||||
while read m rest || [ -n "$m" ]; do
|
||||
host_modules["$m"]=1
|
||||
done </proc/modules
|
||||
fi
|
||||
@@ -1189,7 +1291,7 @@ for dev in "${!host_fs_types[@]}"; do
|
||||
fi
|
||||
if [[ $journaldev ]]; then
|
||||
dev="$(readlink -f "$dev")"
|
||||
push host_devs "$dev"
|
||||
push_host_devs "$dev"
|
||||
_get_fs_type "$dev"
|
||||
check_block_and_slaves_all _get_fs_type "$(get_maj_min "$dev")"
|
||||
fi
|
||||
@@ -1220,15 +1322,26 @@ fi
|
||||
|
||||
[[ -d "$systemdsystemconfdir" ]] || systemdsystemconfdir=/etc/systemd/system
|
||||
|
||||
export initdir dracutbasedir dracutmodules \
|
||||
[[ -d $tmpfilesdir ]] \
|
||||
|| tmpfilesdir=$(pkg-config systemd --variable=tmpfilesdir 2>/dev/null)
|
||||
|
||||
if ! [[ -d "$tmpfilesdir" ]]; then
|
||||
[[ -f /lib/tmpfiles.d ]] && tmpfilesdir=/lib/tmpfiles.d
|
||||
[[ -f /usr/lib/tmpfiles.d ]] && tmpfilesdir=/usr/lib/tmpfiles.d
|
||||
fi
|
||||
|
||||
export initdir dracutbasedir \
|
||||
dracutmodules force_add_dracutmodules add_dracutmodules omit_dracutmodules \
|
||||
mods_to_load \
|
||||
fw_dir drivers_dir debug no_kernel kernel_only \
|
||||
omit_drivers mdadmconf lvmconf root_dev \
|
||||
use_fstab fstab_lines libdirs fscks nofscks ro_mnt \
|
||||
stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \
|
||||
debug host_fs_types host_devs sshkey add_fstab \
|
||||
debug host_fs_types host_devs swap_devs sshkey add_fstab \
|
||||
DRACUT_VERSION udevdir prefix filesystems drivers \
|
||||
systemdutildir systemdsystemunitdir systemdsystemconfdir \
|
||||
host_modalias host_modules hostonly_cmdline loginstall
|
||||
host_modalias host_modules hostonly_cmdline loginstall \
|
||||
tmpfilesdir
|
||||
|
||||
mods_to_load=""
|
||||
# check all our modules to see if they should be sourced.
|
||||
@@ -1238,14 +1351,24 @@ for_each_module_dir check_mount
|
||||
|
||||
dracut_module_included "fips" && export DRACUT_FIPS_MODE=1
|
||||
|
||||
if [[ $print_cmdline ]]; then
|
||||
modules_loaded=" "
|
||||
do_print_cmdline()
|
||||
{
|
||||
local -A _mods_to_print
|
||||
for i in $modules_loaded $mods_to_load; do
|
||||
_mods_to_print[$i]=1
|
||||
done
|
||||
|
||||
# source our modules.
|
||||
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||
_d_mod=${moddir##*/}; _d_mod=${_d_mod#[0-9][0-9]}
|
||||
[[ ${_mods_to_print[$_d_mod]} ]] || continue
|
||||
module_cmdline "$_d_mod"
|
||||
done
|
||||
unset moddir
|
||||
}
|
||||
|
||||
if [[ $print_cmdline ]]; then
|
||||
do_print_cmdline
|
||||
printf "\n"
|
||||
exit 0
|
||||
fi
|
||||
@@ -1264,7 +1387,7 @@ if [[ $prefix ]]; then
|
||||
fi
|
||||
|
||||
if [[ $kernel_only != yes ]]; then
|
||||
for d in usr/bin usr/sbin bin etc lib sbin tmp usr var $libdirs; do
|
||||
for d in usr/bin usr/sbin bin etc lib sbin tmp usr var var/tmp $libdirs; do
|
||||
[[ -e "${initdir}${prefix}/$d" ]] && continue
|
||||
if [ -L "/$d" ]; then
|
||||
inst_symlink "/$d" "${prefix}/$d"
|
||||
@@ -1283,7 +1406,6 @@ if [[ $kernel_only != yes ]]; then
|
||||
|
||||
ln -sfn ../run "$initdir/var/run"
|
||||
ln -sfn ../run/lock "$initdir/var/lock"
|
||||
ln -sfn ../run/log "$initdir/var/log"
|
||||
else
|
||||
for d in lib "$libdir"; do
|
||||
[[ -e "${initdir}${prefix}/$d" ]] && continue
|
||||
@@ -1312,36 +1434,35 @@ modules_loaded=" "
|
||||
# source our modules.
|
||||
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||
_d_mod=${moddir##*/}; _d_mod=${_d_mod#[0-9][0-9]}
|
||||
if [[ "$mods_to_load" == *\ $_d_mod\ * ]]; then
|
||||
if [[ $show_modules = yes ]]; then
|
||||
printf "%s\n" "$_d_mod"
|
||||
else
|
||||
dinfo "*** Including module: $_d_mod ***"
|
||||
fi
|
||||
if [[ $kernel_only == yes ]]; then
|
||||
[[ "$mods_to_load" == *\ $_d_mod\ * ]] || continue
|
||||
if [[ $show_modules = yes ]]; then
|
||||
printf "%s\n" "$_d_mod"
|
||||
else
|
||||
dinfo "*** Including module: $_d_mod ***"
|
||||
fi
|
||||
if [[ $kernel_only == yes ]]; then
|
||||
module_installkernel "$_d_mod" || {
|
||||
dfatal "installkernel failed in module $_d_mod"
|
||||
exit 1
|
||||
}
|
||||
else
|
||||
module_install "$_d_mod"
|
||||
if [[ $no_kernel != yes ]]; then
|
||||
module_installkernel "$_d_mod" || {
|
||||
dfatal "installkernel failed in module $_d_mod"
|
||||
exit 1
|
||||
}
|
||||
else
|
||||
module_install "$_d_mod"
|
||||
if [[ $no_kernel != yes ]]; then
|
||||
module_installkernel "$_d_mod" || {
|
||||
dfatal "installkernel failed in module $_d_mod"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
fi
|
||||
mods_to_load=${mods_to_load// $_d_mod /}
|
||||
modules_loaded+="$_d_mod "
|
||||
fi
|
||||
mods_to_load=${mods_to_load// $_d_mod /}
|
||||
modules_loaded+="$_d_mod "
|
||||
|
||||
#print the module install size
|
||||
if [ -n "$printsize" ]; then
|
||||
_isize_new=$(du -sk ${initdir}|cut -f1)
|
||||
_isize_delta=$((_isize_new - _isize))
|
||||
printf "%s\n" "$_d_mod install size: ${_isize_delta}k"
|
||||
_isize=$_isize_new
|
||||
fi
|
||||
#print the module install size
|
||||
if [ -n "$printsize" ]; then
|
||||
_isize_new=$(du -sk ${initdir}|cut -f1)
|
||||
_isize_delta=$((_isize_new - _isize))
|
||||
printf "%s\n" "$_d_mod install size: ${_isize_delta}k"
|
||||
_isize=$_isize_new
|
||||
fi
|
||||
done
|
||||
unset moddir
|
||||
@@ -1400,6 +1521,7 @@ if [[ $kernel_only != yes ]]; then
|
||||
[ -z "${line[3]}" ] && line[3]="defaults"
|
||||
[ -z "${line[4]}" ] && line[4]="0"
|
||||
[ -z "${line[5]}" ] && line[5]="2"
|
||||
strstr "${line[2]}" "nfs" && line[5]="0"
|
||||
echo "${line[@]}" >> "${initdir}/etc/fstab"
|
||||
done
|
||||
|
||||
@@ -1418,9 +1540,7 @@ if [[ $kernel_only != yes ]]; then
|
||||
|
||||
if [[ $DRACUT_RESOLVE_LAZY ]] && [[ $DRACUT_INSTALL ]]; then
|
||||
dinfo "*** Resolving executable dependencies ***"
|
||||
find "$initdir" -type f \
|
||||
'(' -perm -0100 -or -perm -0010 -or -perm -0001 ')' \
|
||||
-not -path '*.ko' -print0 \
|
||||
find "$initdir" -type f -perm /0111 -not -path '*.ko' -print0 \
|
||||
| xargs -r -0 $DRACUT_INSTALL ${initdir:+-D "$initdir"} -R ${DRACUT_FIPS_MODE:+-H} --
|
||||
dinfo "*** Resolving executable dependencies done***"
|
||||
fi
|
||||
@@ -1435,26 +1555,29 @@ if [[ $kernel_only != yes ]]; then
|
||||
done
|
||||
fi
|
||||
|
||||
while pop include_src src && pop include_target tgt; do
|
||||
if [[ $src && $tgt ]]; then
|
||||
while pop include_src src && pop include_target target; do
|
||||
if [[ $src && $target ]]; then
|
||||
if [[ -f $src ]]; then
|
||||
inst $src $tgt
|
||||
inst $src $target
|
||||
else
|
||||
ddebug "Including directory: $src"
|
||||
mkdir -p "${initdir}/${tgt}"
|
||||
destdir="${initdir}/${target}"
|
||||
mkdir -p "$destdir"
|
||||
# check for preexisting symlinks, so we can cope with the
|
||||
# symlinks to $prefix
|
||||
for i in "$src"/*; do
|
||||
[[ -e "$i" || -h "$i" ]] || continue
|
||||
s=${initdir}/${tgt}/${i#$src/}
|
||||
if [[ -d "$i" ]]; then
|
||||
if ! [[ -e "$s" ]]; then
|
||||
mkdir -m 0755 -p "$s"
|
||||
chmod --reference="$i" "$s"
|
||||
# Objectname is a file or a directory
|
||||
for objectname in "$src"/*; do
|
||||
[[ -e "$objectname" || -h "$objectname" ]] || continue
|
||||
if [[ -d "$objectname" ]]; then
|
||||
# objectname is a directory, let's compute the final directory name
|
||||
object_destdir=${destdir}/${objectname#$src/}
|
||||
if ! [[ -e "$object_destdir" ]]; then
|
||||
mkdir -m 0755 -p "$object_destdir"
|
||||
chmod --reference="$objectname" "$object_destdir"
|
||||
fi
|
||||
cp --reflink=auto --sparse=auto -fa -t "$s" "$i"/*
|
||||
cp --reflink=auto --sparse=auto -fa -t "$object_destdir" "$objectname"/*
|
||||
else
|
||||
cp --reflink=auto --sparse=auto -fa -t "$s" "$i"
|
||||
cp --reflink=auto --sparse=auto -fa -t "$destdir" "$objectname"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@@ -1514,7 +1637,7 @@ if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then
|
||||
|
||||
# strip kernel modules, but do not touch signed modules
|
||||
find "$initdir" -type f -path '*/lib/modules/*.ko' -print0 \
|
||||
| while read -r -d $'\0' f; do
|
||||
| while read -r -d $'\0' f || [ -n "$f" ]; do
|
||||
SIG=$(tail -c 28 "$f")
|
||||
[[ $SIG == '~Module signature appended~' ]] || { printf "%s\000" "$f"; }
|
||||
done | xargs -r -0 strip -g
|
||||
@@ -1568,8 +1691,29 @@ if ! ( echo $PARMS_TO_STORE > $initdir/lib/dracut/build-parameter.txt ); then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $hostonly_cmdline ]] ; then
|
||||
unset _stored_cmdline
|
||||
if [ -d $initdir/etc/cmdline.d ];then
|
||||
dinfo "Stored kernel commandline:"
|
||||
for conf in $initdir/etc/cmdline.d/*.conf ; do
|
||||
[ -e "$conf" ] || continue
|
||||
dinfo "$(< $conf)"
|
||||
_stored_cmdline=1
|
||||
done
|
||||
fi
|
||||
if ! [[ $_stored_cmdline ]]; then
|
||||
dinfo "No dracut internal kernel commandline stored in initrd"
|
||||
fi
|
||||
fi
|
||||
rm -f -- "$outfile"
|
||||
dinfo "*** Creating image file ***"
|
||||
dinfo "*** Creating image file '$outfile' ***"
|
||||
|
||||
if [[ $uefi = yes ]]; then
|
||||
uefi_outfile="$outfile"
|
||||
readonly uefi_outdir="$(mktemp --tmpdir="$TMPDIR/" -d -t initrd.XXXXXX)"
|
||||
# redirect initrd output
|
||||
outfile="$uefi_outdir/initrd"
|
||||
fi
|
||||
|
||||
if [[ $DRACUT_REPRODUCIBLE ]]; then
|
||||
find "$initdir" -newer "$dracutbasedir/dracut-functions.sh" -print0 \
|
||||
@@ -1605,7 +1749,7 @@ if ! (
|
||||
dfatal "dracut: creation of $outfile failed"
|
||||
exit 1
|
||||
fi
|
||||
dinfo "*** Creating image file done ***"
|
||||
dinfo "*** Creating initrd image file '$outfile' done ***"
|
||||
|
||||
if (( maxloglvl >= 5 )); then
|
||||
if [[ $allowlocal ]]; then
|
||||
@@ -1615,4 +1759,32 @@ if (( maxloglvl >= 5 )); then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $uefi = yes ]]; then
|
||||
if [[ $kernel_cmdline ]]; then
|
||||
echo -n "$kernel_cmdline" > "$uefi_outdir/cmdline.txt"
|
||||
elif [[ $hostonly_cmdline = yes ]] && [ -d $initdir/etc/cmdline.d ];then
|
||||
for conf in $initdir/etc/cmdline.d/*.conf ; do
|
||||
[ -e "$conf" ] || continue
|
||||
printf "%s " "$(< $conf)" >> "$uefi_outdir/cmdline.txt"
|
||||
done
|
||||
else
|
||||
do_print_cmdline > "$uefi_outdir/cmdline.txt"
|
||||
fi
|
||||
echo -ne "\x00" >> "$uefi_outdir/cmdline.txt"
|
||||
|
||||
dinfo "Using UEFI kernel cmdline:"
|
||||
dinfo $(< "$uefi_outdir/cmdline.txt")
|
||||
|
||||
[[ -s /usr/lib/os-release ]] && uefi_osrelease="/usr/lib/os-release"
|
||||
[[ -s /etc/os-release ]] && uefi_osrelease="/etc/os-release"
|
||||
|
||||
objcopy \
|
||||
${uefi_osrelease:+--add-section .osrel=$uefi_osrelease --change-section-vma .osrel=0x20000} \
|
||||
--add-section .cmdline="$uefi_outdir/cmdline.txt" --change-section-vma .cmdline=0x30000 \
|
||||
--add-section .linux="$kernel_image" --change-section-vma .linux=0x40000 \
|
||||
--add-section .initrd="$outfile" --change-section-vma .initrd=0x3000000 \
|
||||
"$uefi_stub" "$uefi_outfile"
|
||||
dinfo "*** Creating UEFI image file '$uefi_outfile' done ***"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
26
dracut.spec
26
dracut.spec
@@ -195,20 +195,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 +275,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 +286,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
|
||||
@@ -324,6 +307,7 @@ rm -rf -- $RPM_BUILD_ROOT
|
||||
%endif
|
||||
%dir %{_sysconfdir}/dracut.conf.d
|
||||
%dir %{dracutlibdir}/dracut.conf.d
|
||||
%{_datadir}/pkgconfig/dracut.pc
|
||||
|
||||
%if %{with doc}
|
||||
%{_mandir}/man8/dracut.8*
|
||||
@@ -345,6 +329,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
|
||||
@@ -389,7 +375,7 @@ 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
|
||||
@@ -422,7 +408,9 @@ 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
|
||||
|
@@ -246,23 +246,6 @@ specified multiple times.
|
||||
If your root partition is on a network drive, you have to have the network
|
||||
dracut modules installed to create a network aware initramfs image.
|
||||
|
||||
On a Red Hat Enterprise Linux or Fedora system, this means, you have to install
|
||||
the _dracut-network_ rpm package:
|
||||
|
||||
|
||||
----
|
||||
# yum install dracut-network
|
||||
----
|
||||
|
||||
The resulting initramfs image can be served by a boot manager residing on your
|
||||
local hard drive or it can be served by a PXE/TFTP server.
|
||||
|
||||
How to setup your PXE/TFTP server can be found in the
|
||||
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/[Red
|
||||
Hat Enterprise Linux 6 Storage Administration Guide]
|
||||
or http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/[Red
|
||||
Hat Enterprise Linux 7 Storage Administration Guide].
|
||||
|
||||
If you specify ip=dhcp on the kernel command line, then dracut asks a dhcp
|
||||
server about the ip adress for the machine. The dhcp server can also serve an
|
||||
additional root-path, which will set the root device for dracut. With this
|
||||
@@ -302,7 +285,7 @@ This will reduce the size of the initramfs image significantly.
|
||||
If the boot process does not succeed, you have several options to debug the
|
||||
situation. Some of the basic operations are covered here. For more information
|
||||
you should also visit:
|
||||
http://fedoraproject.org/wiki/How_to_debug_Dracut_problems
|
||||
https://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
|
||||
|
||||
|
||||
[[identifying-your-problem-area]]
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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>
|
||||
|
17
lsinitrd.sh
17
lsinitrd.sh
@@ -108,6 +108,12 @@ 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
|
||||
@@ -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
|
||||
|
||||
@@ -217,7 +224,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 +234,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
|
||||
|
@@ -76,7 +76,9 @@ OPTIONS
|
||||
|
||||
**-A**::
|
||||
Create a so called "monster initrd" which includes all available
|
||||
features and modules.
|
||||
features and modules. This calls dracut with --no-hostonly and
|
||||
--no-hostonly-cmdline parameters internally, instead of the default
|
||||
--hostonly and --hostonly-cmdline.
|
||||
|
||||
**-v, --verbose**::
|
||||
increase verbosity level
|
||||
@@ -85,9 +87,6 @@ OPTIONS
|
||||
Disable logging to _/var/log/YaST2/mkinitrd.log_. This is useful for
|
||||
testing if you don’t want to clutter the system log.
|
||||
|
||||
**--force**::
|
||||
overwrite existing initramfs file.
|
||||
|
||||
**--help**::
|
||||
print a help message and exit.
|
||||
|
||||
|
@@ -20,8 +20,6 @@
|
||||
|
||||
boot_dir="/boot"
|
||||
quiet=0
|
||||
host_only=1
|
||||
force=0
|
||||
logfile=/var/log/YaST2/mkinitrd.log
|
||||
dracut_cmd=dracut
|
||||
|
||||
@@ -68,10 +66,7 @@ usage () {
|
||||
$cmd " -j device Journal device"
|
||||
$cmd " -D interface Run dhcp on the specified interface."
|
||||
$cmd " -I interface Configure the specified interface statically."
|
||||
$cmd " -a acpi_dsdt Attach compiled ACPI DSDT (Differentiated"
|
||||
$cmd " System Description Table) to initrd. This"
|
||||
$cmd " replaces the DSDT of the BIOS. Defaults to"
|
||||
$cmd " the ACPI_DSDT variable in /etc/sysconfig/kernel."
|
||||
$cmd " -a acpi_dsdt Obsolete, do not use."
|
||||
$cmd " -s size Add splash animation and bootscreen to initrd."
|
||||
|
||||
[[ $1 = '-n' ]] && exit 0
|
||||
@@ -204,8 +199,6 @@ default_kernel_images() {
|
||||
for initrd_image in $initrd_images;do
|
||||
targets="$targets $initrd_image"
|
||||
done
|
||||
host_only=1
|
||||
force=1
|
||||
}
|
||||
|
||||
while (($# > 0)); do
|
||||
@@ -218,8 +211,6 @@ while (($# > 0)); do
|
||||
for kernel_image in $kernel_images;do
|
||||
kernels="$kernels ${kernel_image#*-}"
|
||||
done
|
||||
host_only=1
|
||||
force=1
|
||||
;;
|
||||
-i) read_arg initrd_images "$@" || shift $?
|
||||
for initrd_image in $initrd_images;do
|
||||
@@ -261,7 +252,7 @@ while (($# > 0)); do
|
||||
dracut_cmdline="${dracut_cmdline} ip=$(ipconfig $static_if)":
|
||||
;;
|
||||
-a) read_arg acpi_dsdt "$@" || shift $?
|
||||
echo "mkinitrd: custom DSDT not yet supported"
|
||||
echo "Obsolete -a param, use acpi_table_dir= and acpi_override= variables in /etc/dracut.conf.d/"
|
||||
exit 1
|
||||
;;
|
||||
-s) read_arg boot_splash "$@" || shift $?
|
||||
@@ -275,7 +266,6 @@ while (($# > 0)); do
|
||||
--version|-R)
|
||||
echo "mkinitrd: dracut compatibility wrapper"
|
||||
exit 0;;
|
||||
--force) force=1;;
|
||||
--quiet|-q) quiet=1;;
|
||||
*) if [[ ! $targets ]]; then
|
||||
targets=$1
|
||||
@@ -289,15 +279,17 @@ while (($# > 0)); do
|
||||
done
|
||||
|
||||
[[ $targets && $kernels ]] || default_kernel_images
|
||||
[[ $targets && $kernels ]] || (error "No kernel found in $boot_dir" && usage)
|
||||
if [[ ! $targets || ! $kernels ]];then
|
||||
error "No kernel found in $boot_dir"
|
||||
fi
|
||||
|
||||
# We can have several targets/kernels, transform the list to an array
|
||||
targets=( $targets )
|
||||
[[ $kernels ]] && kernels=( $kernels )
|
||||
|
||||
[[ $logfile ]] && dracut_args="${dracut_args} --logfile $logfile"
|
||||
[[ $host_only == 1 ]] && dracut_args="${dracut_args} --hostonly"
|
||||
[[ $force == 1 ]] && dracut_args="${dracut_args} --force"
|
||||
dracut_args="${dracut_args} --force"
|
||||
|
||||
[[ $dracut_cmdline ]] && dracut_args="${dracut_args} --kernel-cmdline ${dracut_cmdline}"
|
||||
[ -z "$(type -p update-bootloader)" ] && skip_update_bootloader=1
|
||||
|
||||
@@ -306,11 +298,9 @@ if [ -f /etc/sysconfig/kernel ] ; then
|
||||
. /etc/sysconfig/kernel
|
||||
fi
|
||||
[[ $module_list ]] || module_list="${INITRD_MODULES}"
|
||||
basicmodules="$basicmodules ${module_list}"
|
||||
[[ $domu_module_list ]] || domu_module_list="${DOMU_INITRD_MODULES}"
|
||||
[[ $acpi_dsdt ]] || acpi_dsdt="${ACPI_DSDT}"
|
||||
shopt -s extglob
|
||||
|
||||
echo "Creating: target|kernel|dracut args|basicmodules "
|
||||
for ((i=0 ; $i<${#targets[@]} ; i++)); do
|
||||
|
||||
if [[ $img_vers ]];then
|
||||
@@ -320,28 +310,34 @@ for ((i=0 ; $i<${#targets[@]} ; i++)); do
|
||||
fi
|
||||
kernel="${kernels[$i]}"
|
||||
|
||||
if is_xen_kernel $kernel $rootfs ; then
|
||||
modules_all="${module_list} ${domu_module_list}"
|
||||
else
|
||||
modules_all="${module_list}"
|
||||
fi
|
||||
|
||||
# Remove leading and trailing spaces needs (set above): shopt -s extglob
|
||||
modules_all=${modules_all%%+([[:space:]])}
|
||||
modules_all=${modules_all##+([[:space:]])}
|
||||
|
||||
echo "Creating initrd: $target"
|
||||
|
||||
# Duplicate code: No way found how to redirect output based on $quiet
|
||||
if [[ $quiet == 1 ]];then
|
||||
echo "$target|$kernel|$dracut_args|$basicmodules"
|
||||
if is_xen_kernel $kernel $rootfs ; then
|
||||
basicmodules="$basicmodules ${domu_module_list}"
|
||||
fi
|
||||
if [[ $basicmodules ]]; then
|
||||
$dracut_cmd $dracut_args --add-drivers "$basicmodules" "$target" \
|
||||
"$kernel" &>/dev/null
|
||||
else
|
||||
# Duplicate code: --force-drivers must not be called with empty string
|
||||
# -> dracut bug workarounded ugly, because of complex whitespace
|
||||
# expansion magics
|
||||
if [ -n "${modules_all}" ];then
|
||||
$dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel" &>/dev/null
|
||||
else
|
||||
$dracut_cmd $dracut_args "$target" "$kernel" &>/dev/null
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if is_xen_kernel $kernel $rootfs ; then
|
||||
basicmodules="$basicmodules ${domu_module_list}"
|
||||
fi
|
||||
if [[ $basicmodules ]]; then
|
||||
$dracut_cmd $dracut_args --add-drivers "$basicmodules" "$target" \
|
||||
"$kernel"
|
||||
else
|
||||
if [ -n "${modules_all}" ];then
|
||||
$dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel"
|
||||
else
|
||||
$dracut_cmd $dracut_args "$target" "$kernel"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
@@ -18,7 +18,7 @@ depends() {
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
instmods autofs4 ipv6
|
||||
hostonly='' instmods autofs4 ipv6
|
||||
instmods -s efivarfs
|
||||
}
|
||||
|
||||
@@ -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 \
|
||||
@@ -83,6 +83,7 @@ install() {
|
||||
$systemdsystemunitdir/systemd-udevd-kernel.socket \
|
||||
$systemdsystemunitdir/systemd-ask-password-plymouth.path \
|
||||
$systemdsystemunitdir/systemd-journald.socket \
|
||||
$systemdsystemunitdir/systemd-journald-audit.socket \
|
||||
$systemdsystemunitdir/systemd-ask-password-console.service \
|
||||
$systemdsystemunitdir/systemd-modules-load.service \
|
||||
$systemdsystemunitdir/systemd-halt.service \
|
||||
@@ -97,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 \
|
||||
@@ -105,6 +107,7 @@ install() {
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-udevd-control.socket \
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-udevd-kernel.socket \
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-journald.socket \
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-journald-audit.socket \
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-journald-dev-log.socket \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-udevd.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-udev-trigger.service \
|
||||
@@ -113,17 +116,20 @@ 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 \
|
||||
\
|
||||
journalctl systemctl echo swapoff systemd-cgls systemd-tmpfiles
|
||||
$tmpfilesdir/systemd.conf \
|
||||
\
|
||||
journalctl systemctl \
|
||||
echo swapoff \
|
||||
kmod insmod rmmod modprobe modinfo depmod lsmod \
|
||||
mount umount reboot poweroff \
|
||||
systemd-cgls systemd-tmpfiles
|
||||
|
||||
inst_multiple -o \
|
||||
/usr/lib/modules-load.d/*.conf \
|
||||
@@ -133,7 +139,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
|
||||
\#*)
|
||||
;;
|
||||
@@ -171,39 +177,28 @@ 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"
|
||||
inst_rules 70-uaccess.rules 71-seat.rules 73-seat-late.rules 99-systemd.rules
|
||||
inst_rules \
|
||||
70-uaccess.rules \
|
||||
71-seat.rules \
|
||||
73-seat-late.rules \
|
||||
90-vconsole.rules \
|
||||
99-systemd.rules
|
||||
|
||||
for i in \
|
||||
emergency.target \
|
||||
dracut-emergency.service \
|
||||
rescue.service \
|
||||
rescue.target \
|
||||
systemd-ask-password-console.service \
|
||||
systemd-ask-password-plymouth.service \
|
||||
; do
|
||||
@@ -212,21 +207,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
|
||||
|
||||
mkdir -p "$initdir/etc/systemd"
|
||||
# turn off RateLimit for journal
|
||||
{
|
||||
@@ -235,5 +215,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
|
||||
|
@@ -14,10 +14,11 @@ depends() {
|
||||
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+="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"
|
||||
|
||||
@@ -40,7 +41,8 @@ install() {
|
||||
|
||||
inst_libdir_file libsoftokn3.so libsoftokn3.so \
|
||||
libsoftokn3.chk libfreebl3.so libfreebl3.chk \
|
||||
libssl.so 'hmaccalc/sha512hmac.hmac' libssl.so.10
|
||||
libssl.so 'hmaccalc/sha512hmac.hmac' libssl.so.10 \
|
||||
libfreeblpriv3.so libfreeblpriv3.chk
|
||||
|
||||
inst_multiple -o prelink
|
||||
inst_simple /etc/system-fips
|
||||
|
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 "dracut-systemd 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 "dracut-systemd 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
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -43,7 +43,13 @@ setup_interface() {
|
||||
valid_lft ${lease_time} preferred_lft ${lease_time} \
|
||||
dev $netif
|
||||
|
||||
[ -n "$gw" ] && echo ip route replace default via $gw dev $netif > /tmp/net.$netif.gw
|
||||
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
|
||||
|
||||
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
|
||||
if [ -n "$namesrv" ] ; then
|
||||
@@ -93,8 +99,9 @@ case $reason in
|
||||
;;
|
||||
|
||||
PREINIT6)
|
||||
echo "dhcp: PREINIT $netif up"
|
||||
echo "dhcp: PREINIT6 $netif up"
|
||||
linkup $netif
|
||||
wait_for_ipv6_dad $netif
|
||||
;;
|
||||
|
||||
BOUND)
|
||||
@@ -111,7 +118,7 @@ case $reason in
|
||||
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
|
||||
@@ -132,7 +139,7 @@ case $reason in
|
||||
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
|
||||
|
@@ -216,7 +216,7 @@ if [ -e /tmp/team.info ]; then
|
||||
fi
|
||||
done
|
||||
# Do not add slaves now
|
||||
teamd -d -U -n -t $teammaster -f /etc/teamd/$teammaster.conf
|
||||
teamd -d -U -n -N -t $teammaster -f /etc/teamd/$teammaster.conf
|
||||
for slave in $working_slaves; do
|
||||
# team requires the slaves to be down before joining team
|
||||
ip link set $slave down
|
||||
@@ -324,17 +324,19 @@ for p in $(getargs ip=); do
|
||||
eval '[ "$'$i'" ] && echo '$i'="$'$i'"'
|
||||
done > /tmp/net.$netif.override
|
||||
|
||||
case $autoconf in
|
||||
dhcp|on|any)
|
||||
do_dhcp -4 ;;
|
||||
dhcp6)
|
||||
load_ipv6
|
||||
do_dhcp -6 ;;
|
||||
auto6)
|
||||
do_ipv6auto ;;
|
||||
*)
|
||||
do_static ;;
|
||||
esac
|
||||
for autoopt in $(str_replace "$autoconf" "," " "); do
|
||||
case $autoopt in
|
||||
dhcp|on|any)
|
||||
do_dhcp -4 ;;
|
||||
dhcp6)
|
||||
load_ipv6
|
||||
do_dhcp -6 ;;
|
||||
auto6)
|
||||
do_ipv6auto ;;
|
||||
*)
|
||||
do_static ;;
|
||||
esac
|
||||
done
|
||||
|
||||
> /tmp/net.${netif}.up
|
||||
|
||||
|
@@ -11,60 +11,13 @@ check() {
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo "kernel-network-modules"
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
# Include wired net drivers, excluding wireless
|
||||
|
||||
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
|
||||
@@ -79,7 +32,8 @@ install() {
|
||||
inst_script "$moddir/netroot.sh" "/sbin/netroot"
|
||||
inst_script "$moddir/dhclient-script.sh" "/sbin/dhclient-script"
|
||||
inst_simple "$moddir/net-lib.sh" "/lib/net-lib.sh"
|
||||
inst_simple "$moddir/dhclient.conf" "/etc/dhclient.conf"
|
||||
inst_simple -H "/etc/dhclient.conf"
|
||||
cat "$moddir/dhclient.conf" >> "${initdir}/etc/dhclient.conf"
|
||||
inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
|
||||
inst_hook pre-udev 60 "$moddir/net-genrules.sh"
|
||||
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
|
||||
|
@@ -94,18 +94,18 @@ 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
|
||||
[ -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
|
||||
printf -- "%s\n" "$route_mask ${route_gw:+via $route_gw} ${route_dev:+dev $route_dev}" \
|
||||
@@ -308,6 +308,23 @@ parse_iscsi_root()
|
||||
;;
|
||||
esac
|
||||
|
||||
unset iscsi_target_name
|
||||
# extract target name
|
||||
case "$v" in
|
||||
*:iqn.*)
|
||||
iscsi_target_name=iqn.${v##*:iqn.}
|
||||
v=${v%:iqn.*}:
|
||||
;;
|
||||
*:eui.*)
|
||||
iscsi_target_name=eui.${v##*:eui.}
|
||||
v=${v%:eui.*}:
|
||||
;;
|
||||
*:naa.*)
|
||||
iscsi_target_name=naa.${v##*:naa.}
|
||||
v=${v%:naa.*}:
|
||||
;;
|
||||
esac
|
||||
|
||||
# parse the rest
|
||||
OLDIFS="$IFS"
|
||||
IFS=:
|
||||
@@ -317,24 +334,33 @@ parse_iscsi_root()
|
||||
iscsi_protocol=$1; shift # ignored
|
||||
iscsi_target_port=$1; shift
|
||||
|
||||
if [ -n "$iscsi_target_name" ]; then
|
||||
if [ $# -eq 3 ]; then
|
||||
iscsi_iface_name=$1; shift
|
||||
fi
|
||||
if [ $# -eq 2 ]; then
|
||||
iscsi_netdev_name=$1; shift
|
||||
fi
|
||||
iscsi_lun=$1; shift
|
||||
if [ $# -ne 0 ]; then
|
||||
warn "Invalid parameter in iscsi: parameter!"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
||||
if [ $# -gt 3 ] && [ -n "$1$2" ]; then
|
||||
iscsi_iface_name=$1; shift
|
||||
iscsi_netdev_name=$1; shift
|
||||
if [ -z "$3" ] || [ "$3" -ge 0 ] 2>/dev/null ; then
|
||||
iscsi_iface_name=$1; shift
|
||||
iscsi_netdev_name=$1; shift
|
||||
fi
|
||||
fi
|
||||
|
||||
iscsi_lun=$1; shift
|
||||
|
||||
if [ $# -gt 2 ]; then
|
||||
warn "Invalid parameter in iscsi: parameter!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ $# -eq 2 ]; then
|
||||
iscsi_target_name="$1:$2"
|
||||
else
|
||||
iscsi_target_name="$1"
|
||||
fi
|
||||
|
||||
iscsi_target_name=$(printf "%s:" "$@")
|
||||
iscsi_target_name=${iscsi_target_name%:}
|
||||
}
|
||||
|
||||
ip_to_var() {
|
||||
@@ -494,7 +520,7 @@ wait_for_ipv6_dad() {
|
||||
local cnt=0
|
||||
local li
|
||||
while [ $cnt -lt 500 ]; do
|
||||
li=$(ip -6 addr show dev $1)
|
||||
li=$(ip -6 addr show dev $1 scope link)
|
||||
strstr "$li" "tentative" || return 0
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
@@ -528,13 +554,18 @@ 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
|
||||
linkup "$1"
|
||||
[ "$(cat $interface/carrier)" = 1 ] || return 1
|
||||
# XXX Do we need to reset the flags here? anaconda never bothered..
|
||||
while [ $cnt -lt 50 ]; do
|
||||
[ "$(cat $interface/carrier)" = 1 ] && return 0
|
||||
sleep 0.1
|
||||
cnt=$(($cnt+1))
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
find_iface_with_link() {
|
||||
@@ -551,7 +582,19 @@ find_iface_with_link() {
|
||||
}
|
||||
|
||||
is_persistent_ethernet_name() {
|
||||
case "$1" in
|
||||
local _netif="$1"
|
||||
local _name_assign_type="0"
|
||||
|
||||
[ -f "/sys/class/net/$_netif/name_assign_type" ] \
|
||||
&& _name_assign_type=$(cat "/sys/class/net/$_netif/name_assign_type")
|
||||
|
||||
# NET_NAME_ENUM 1
|
||||
[ "$_name_assign_type" = "1" ] && return 1
|
||||
|
||||
# NET_NAME_PREDICTABLE 2
|
||||
[ "$_name_assign_type" = "2" ] && return 0
|
||||
|
||||
case "$_netif" in
|
||||
# udev persistent interface names
|
||||
eno[0-9]|eno[0-9][0-9]|eno[0-9][0-9][0-9]*)
|
||||
;;
|
||||
@@ -571,3 +614,35 @@ is_persistent_ethernet_name() {
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
is_kernel_ethernet_name() {
|
||||
local _netif="$1"
|
||||
local _name_assign_type="1"
|
||||
|
||||
if [ -e "/sys/class/net/$_netif/name_assign_type" ]; then
|
||||
_name_assign_type=$(cat "/sys/class/net/$_netif/name_assign_type")
|
||||
|
||||
case "$_name_assign_type" in
|
||||
2|3|4)
|
||||
# NET_NAME_PREDICTABLE 2
|
||||
# NET_NAME_USER 3
|
||||
# NET_NAME_RENAMED 4
|
||||
return 1
|
||||
;;
|
||||
1|*)
|
||||
# NET_NAME_ENUM 1
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# fallback to error prone manual name check
|
||||
case "$_netif" in
|
||||
eth[0-9]|eth[0-9][0-9]|eth[0-9][0-9][0-9]*)
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
return 1
|
||||
esac
|
||||
|
||||
}
|
||||
|
@@ -64,24 +64,26 @@ for p in $(getargs ip=); do
|
||||
fi
|
||||
|
||||
# Error checking for autoconf in combination with other values
|
||||
case $autoconf in
|
||||
error) die "Error parsing option 'ip=$p'";;
|
||||
bootp|rarp|both) die "Sorry, ip=$autoconf is currenty unsupported";;
|
||||
none|off)
|
||||
[ -z "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nValue '$autoconf' without static configuration does not make sense"
|
||||
[ -z "$mask" ] && \
|
||||
die "Sorry, automatic calculation of netmask is not yet supported"
|
||||
;;
|
||||
auto6);;
|
||||
dhcp|dhcp6|on|any) \
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
|
||||
die "Sorry, 'ip=$p' does not make sense for multiple interface configurations"
|
||||
[ -n "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoconf'"
|
||||
;;
|
||||
*) die "For argument 'ip=$p'\nSorry, unknown value '$autoconf'";;
|
||||
esac
|
||||
for autoopt in $(str_replace "$autoconf" "," " "); do
|
||||
case $autoopt in
|
||||
error) die "Error parsing option 'ip=$p'";;
|
||||
bootp|rarp|both) die "Sorry, ip=$autoopt is currenty unsupported";;
|
||||
none|off)
|
||||
[ -z "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nValue '$autoopt' without static configuration does not make sense"
|
||||
[ -z "$mask" ] && \
|
||||
die "Sorry, automatic calculation of netmask is not yet supported"
|
||||
;;
|
||||
auto6);;
|
||||
dhcp|dhcp6|on|any) \
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
|
||||
die "Sorry, 'ip=$p' does not make sense for multiple interface configurations"
|
||||
[ -n "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoopt'"
|
||||
;;
|
||||
*) die "For argument 'ip=$p'\nSorry, unknown value '$autoopt'";;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -n "$dev" ] ; then
|
||||
# We don't like duplicate device configs
|
||||
|
@@ -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
|
||||
@@ -80,18 +80,41 @@ print_s390() {
|
||||
return 0
|
||||
}
|
||||
|
||||
hw_bind() {
|
||||
local _netif="$1"
|
||||
local _macaddr="$2"
|
||||
|
||||
[ -n "$_macaddr" ] \
|
||||
&& echo "MACADDR=\"$_macaddr\""
|
||||
|
||||
print_s390 "$_netif" \
|
||||
&& return 0
|
||||
|
||||
[ -n "$_macaddr" ] && return 0
|
||||
|
||||
is_persistent_ethernet_name "$_netif" && return 0
|
||||
|
||||
[ -f "/sys/class/net/$_netif/addr_assign_type" ] \
|
||||
&& [ "$(cat "/sys/class/net/$_netif/addr_assign_type")" != "0" ] \
|
||||
&& return 1
|
||||
|
||||
[ -f "/sys/class/net/$_netif/address" ] \
|
||||
|| return 1
|
||||
|
||||
echo "HWADDR=\"$(cat /sys/class/net/$_netif/address)\""
|
||||
}
|
||||
|
||||
interface_bind() {
|
||||
local netif="$1"
|
||||
local macaddr="$2"
|
||||
if ! print_s390 $netif; then
|
||||
if [ -z "$macaddr" ] && \
|
||||
! is_persistent_ethernet_name "$netif" && \
|
||||
[ -f /sys/class/net/$netif/addr_assign_type ] && \
|
||||
[ "$(cat /sys/class/net/$netif/addr_assign_type)" = "0" ] && \
|
||||
[ -f /sys/class/net/$netif/address ]; then
|
||||
echo "HWADDR=\"$(cat /sys/class/net/$netif/address)\""
|
||||
fi
|
||||
local _netif="$1"
|
||||
local _macaddr="$2"
|
||||
|
||||
# see, if we can bind it to some hw parms
|
||||
if hw_bind "$_netif" "$_macaddr"; then
|
||||
# only print out DEVICE, if it's user assigned
|
||||
is_kernel_ethernet_name "$_netif" && return 0
|
||||
fi
|
||||
|
||||
echo "DEVICE=\"$_netif\""
|
||||
}
|
||||
|
||||
for netup in /tmp/net.*.did-setup ; do
|
||||
@@ -114,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)
|
||||
@@ -129,7 +154,8 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=\"$netif\""
|
||||
echo "NAME=\"$netif\""
|
||||
interface_bind "$netif" "$macaddr"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "UUID=\"$uuid\""
|
||||
@@ -175,10 +201,7 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
if [ -z "$bridge" ] && [ -z "$bond" ] && [ -z "$vlan" ]; then
|
||||
# standard interface
|
||||
{
|
||||
[ -n "$macaddr" ] && echo "MACADDR=\"$macaddr\""
|
||||
interface_bind "$netif" "$macaddr"
|
||||
echo "TYPE=Ethernet"
|
||||
echo "NAME=\"$netif\""
|
||||
[ -n "$mtu" ] && echo "MTU=\"$mtu\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
fi
|
||||
@@ -205,16 +228,15 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
(
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=\"$slave\""
|
||||
echo "NAME=\"$slave\""
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "SLAVE=yes"
|
||||
echo "MASTER=\"$netif\""
|
||||
echo "NAME=\"$slave\""
|
||||
echo "UUID=\"$(cat /proc/sys/kernel/random/uuid)\""
|
||||
unset macaddr
|
||||
[ -e /tmp/net.$slave.override ] && . /tmp/net.$slave.override
|
||||
[ -n "$macaddr" ] && echo "MACADDR=\"$macaddr\""
|
||||
interface_bind "$slave" "$macaddr"
|
||||
) >> /tmp/ifcfg/ifcfg-$slave
|
||||
done
|
||||
@@ -230,15 +252,14 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
(
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=\"$slave\""
|
||||
echo "NAME=\"$slave\""
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "BRIDGE=\"$bridgename\""
|
||||
echo "NAME=\"$slave\""
|
||||
echo "UUID=\"$(cat /proc/sys/kernel/random/uuid)\""
|
||||
unset macaddr
|
||||
[ -e /tmp/net.$slave.override ] && . /tmp/net.$slave.override
|
||||
[ -n "$macaddr" ] && echo "MACADDR=\"$macaddr\""
|
||||
interface_bind "$slave" "$macaddr"
|
||||
) >> /tmp/ifcfg/ifcfg-$slave
|
||||
done
|
||||
|
@@ -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
|
||||
|
@@ -7,6 +7,7 @@ mkdir -m 0755 -p /run/initramfs/state/etc/sysconfig/network-scripts
|
||||
function cms_write_config()
|
||||
{
|
||||
. /tmp/cms.conf
|
||||
SUBCHANNELS="$(echo $SUBCHANNELS | sed 'y/ABCDEF/abcdef/')"
|
||||
OLDIFS=$IFS
|
||||
IFS=,
|
||||
read -a subch_array <<< "indexzero,$SUBCHANNELS"
|
||||
|
@@ -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
|
||||
*.*.*)
|
||||
;;
|
||||
|
@@ -7,7 +7,7 @@ crypttab_contains() {
|
||||
local luks="$1"
|
||||
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
|
||||
done < /etc/crypttab
|
||||
@@ -42,10 +42,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 +155,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
|
||||
|
@@ -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
|
||||
|
@@ -35,7 +35,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
|
||||
@@ -50,8 +50,8 @@ cmdline() {
|
||||
install() {
|
||||
|
||||
if [[ $hostonly_cmdline == "yes" ]]; then
|
||||
cmdline >> "${initdir}/etc/cmdline.d/90crypt.conf"
|
||||
echo >> "${initdir}/etc/cmdline.d/90crypt.conf"
|
||||
local _cryptconf=$(cmdline)
|
||||
[[ $_cryptconf ]] && printf "%s\n" "$_cryptconf" >> "${initdir}/etc/cmdline.d/90crypt.conf"
|
||||
fi
|
||||
|
||||
inst_multiple cryptsetup rmdir readlink umount
|
||||
@@ -65,7 +65,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
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -37,6 +37,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
|
||||
|
||||
|
@@ -64,8 +64,8 @@ install() {
|
||||
local _i
|
||||
|
||||
if [[ $hostonly_cmdline == "yes" ]]; then
|
||||
cmdline >> "${initdir}/etc/cmdline.d/90dmraid.conf"
|
||||
echo >> "${initdir}/etc/cmdline.d/90dmraid.conf"
|
||||
local _raidconf=$(cmdline)
|
||||
[[ $_raidconf ]] && printf "%s\n" "$_raidconf" >> "${initdir}/etc/cmdline.d/90dmraid.conf"
|
||||
fi
|
||||
|
||||
inst_multiple dmraid
|
||||
@@ -74,8 +74,6 @@ install() {
|
||||
|
||||
inst "$moddir/dmraid.sh" /sbin/dmraid_scan
|
||||
|
||||
inst_rules 64-md-raid.rules
|
||||
|
||||
inst_libdir_file "libdmraid-events*.so*"
|
||||
|
||||
inst_rules "$moddir/61-dmraid-imsm.rules"
|
||||
|
@@ -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
|
||||
|
@@ -11,3 +11,4 @@ StandardInput=tty-force
|
||||
StandardOutput=inherit
|
||||
StandardError=inherit
|
||||
TimeoutSec=0
|
||||
SuccessExitStatus=2
|
||||
|
@@ -3,10 +3,10 @@
|
||||
case "$root" in
|
||||
live:/dev/*)
|
||||
{
|
||||
printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
|
||||
${root#live:/dev/}
|
||||
printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
|
||||
${root#live:/dev/}
|
||||
printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root %s"\n' \
|
||||
"${root#live:/dev/}" "${root#live:}"
|
||||
printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root %s"\n' \
|
||||
"${root#live:/dev/}" "${root#live:}"
|
||||
} >> /etc/udev/rules.d/99-live-squash.rules
|
||||
wait_for_dev -n "${root#live:}"
|
||||
;;
|
||||
|
@@ -27,6 +27,10 @@ getargbool 0 rd.live.overlay.reset -d -y reset_overlay && reset_overlay="yes"
|
||||
getargbool 0 rd.live.overlay.readonly -d -y readonly_overlay && readonly_overlay="--readonly" || readonly_overlay=""
|
||||
overlay=$(getarg rd.live.overlay -d overlay)
|
||||
getargbool 0 rd.writable.fsimg -d -y writable_fsimg && writable_fsimg="yes"
|
||||
overlay_size=$(getarg rd.live.overlay.size=)
|
||||
[ -z "$overlay_size" ] && overlay_size=512
|
||||
|
||||
getargbool 0 rd.live.overlay.thin && thin_snapshot="yes"
|
||||
|
||||
# CD/DVD media check
|
||||
[ -b $livedev ] && fs=$(blkid -s TYPE -o value $livedev)
|
||||
@@ -42,7 +46,7 @@ if [ -n "$check" ]; then
|
||||
else
|
||||
checkisomd5 --verbose $livedev
|
||||
fi
|
||||
if [ $? -ne 0 ]; then
|
||||
if [ $? -eq 1 ]; then
|
||||
die "CD check failed!"
|
||||
exit 1
|
||||
fi
|
||||
@@ -125,7 +129,7 @@ do_live_overlay() {
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
dd if=/dev/null of=/overlay bs=1024 count=1 seek=$((512*1024)) 2> /dev/null
|
||||
dd if=/dev/null of=/overlay bs=1024 count=1 seek=$((overlay_size*1024)) 2> /dev/null
|
||||
if [ -n "$setup" -a -n "$readonly_overlay" ]; then
|
||||
RO_OVERLAY_LOOPDEV=$( losetup -f )
|
||||
losetup $RO_OVERLAY_LOOPDEV /overlay
|
||||
@@ -144,7 +148,31 @@ do_live_overlay() {
|
||||
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 p 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
|
||||
@@ -162,9 +190,9 @@ fi
|
||||
|
||||
if [ -n "$OSMINSQFS" ]; then
|
||||
# decompress the delta data
|
||||
dd if=$OSMINSQFS of=/osmin.img 2> /dev/null
|
||||
dd if=$OSMINSQFS of=/run/initramfs/osmin.img 2> /dev/null
|
||||
OSMIN_SQUASHED_LOOPDEV=$( losetup -f )
|
||||
losetup -r $OSMIN_SQUASHED_LOOPDEV /osmin.img
|
||||
losetup -r $OSMIN_SQUASHED_LOOPDEV /run/initramfs/osmin.img
|
||||
mkdir -m 0755 -p /run/initramfs/squashfs.osmin
|
||||
mount -n -t squashfs -o ro $OSMIN_SQUASHED_LOOPDEV /run/initramfs/squashfs.osmin
|
||||
OSMIN_LOOPDEV=$( losetup -f )
|
||||
@@ -172,29 +200,6 @@ 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 /tmp/fsimg/
|
||||
losetup $BASE_LOOPDEV /tmp/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}"
|
||||
@@ -204,10 +209,10 @@ if [ -e "$SQUASHED" ] ; then
|
||||
if [ -n "$live_ram" ] ; then
|
||||
echo "Copying live image to RAM..."
|
||||
echo "(this may take a few minutes)"
|
||||
dd if=$SQUASHED of=/squashed.img bs=512 2> /dev/null
|
||||
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="/squashed.img"
|
||||
SQUASHED="/run/initramfs/squashed.img"
|
||||
fi
|
||||
|
||||
SQUASHED_LOOPDEV=$( losetup -f )
|
||||
@@ -215,18 +220,42 @@ 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
|
||||
elif [ -f /run/initramfs/squashfs/LiveOS/rootfs.img ]; then
|
||||
losetup -r $BASE_LOOPDEV /run/initramfs/squashfs/LiveOS/rootfs.img
|
||||
fi
|
||||
|
||||
umount -l /run/initramfs/squashfs
|
||||
|
||||
do_live_from_base_loop
|
||||
fi
|
||||
|
||||
# we might have an embedded fs image to use as rootfs (uncompressed live)
|
||||
if [ -e /run/initramfs/live/${live_dir}/ext3fs.img ]; then
|
||||
FSIMG="/run/initramfs/live/${live_dir}/ext3fs.img"
|
||||
elif [ -e /run/initramfs/live/${live_dir}/rootfs.img ]; then
|
||||
FSIMG="/run/initramfs/live/${live_dir}/rootfs.img"
|
||||
elif [ -f /run/initramfs/squashfs/LiveOS/ext3fs.img ]; then
|
||||
FSIMG="/run/initramfs/squashfs/LiveOS/ext3fs.img"
|
||||
elif [ -f /run/initramfs/squashfs/LiveOS/rootfs.img ]; then
|
||||
FSIMG="/run/initramfs/squashfs/LiveOS/rootfs.img"
|
||||
fi
|
||||
|
||||
if [ -n "$FSIMG" ] ; then
|
||||
BASE_LOOPDEV=$( losetup -f )
|
||||
|
||||
if [ -n "$writable_fsimg" ] ; then
|
||||
# mount the provided fileysstem read/write
|
||||
echo "Unpacking live filesystem (may take some time)"
|
||||
mkdir /run/initramfs/fsimg/
|
||||
if [ -n "$SQUASHED" ]; then
|
||||
cp -v $FSIMG /run/initramfs/fsimg/rootfs.img
|
||||
else
|
||||
unpack_archive $FSIMG /run/initramfs/fsimg/
|
||||
fi
|
||||
losetup $BASE_LOOPDEV /run/initramfs/fsimg/rootfs.img
|
||||
echo "0 $( blockdev --getsize $BASE_LOOPDEV ) linear $BASE_LOOPDEV 0" | dmsetup create live-rw
|
||||
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
|
||||
@@ -239,7 +268,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
|
||||
|
@@ -4,12 +4,12 @@
|
||||
installkernel() {
|
||||
if [[ -z $drivers ]]; then
|
||||
block_module_filter() {
|
||||
local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_pltfm_init'
|
||||
local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host'
|
||||
# subfunctions inherit following FDs
|
||||
local _merge=8 _side2=9
|
||||
function bmf1() {
|
||||
local _f
|
||||
while read _f; 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}
|
||||
@@ -39,13 +39,15 @@ installkernel() {
|
||||
ehci-hcd ehci-pci ehci-platform \
|
||||
ohci-hcd ohci-pci \
|
||||
uhci-hcd \
|
||||
xhci-hcd
|
||||
xhci-hcd xhci-pci xhci-plat-hcd
|
||||
|
||||
instmods yenta_socket scsi_dh_rdac scsi_dh_emc \
|
||||
atkbd i8042 usbhid hid-apple hid-sunplus hid-cherry hid-logitech \
|
||||
hid-logitech-dj hid-microsoft hid-lcpower firewire-ohci \
|
||||
pcmcia usb_storage nvme hid-hyperv hv-vmbus \
|
||||
sdhci_acpi hyperv-keyboard
|
||||
instmods \
|
||||
"=drivers/hid" \
|
||||
"=drivers/input/serio" \
|
||||
"=drivers/input/keyboard"
|
||||
|
||||
instmods yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
|
||||
atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus
|
||||
|
||||
if [[ "$(uname -p)" == arm* ]]; then
|
||||
# arm specific modules
|
||||
|
71
modules.d/90kernel-network-modules/module-setup.sh
Executable file
71
modules.d/90kernel-network-modules/module-setup.sh
Executable file
@@ -0,0 +1,71 @@
|
||||
#!/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
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
return 0
|
||||
}
|
||||
|
@@ -106,6 +106,10 @@ if [ -n "$LVS" ] ; then
|
||||
info "Scanning devices $lvmdevs for LVM logical volumes $LVS"
|
||||
lvm lvscan --ignorelockingfailure 2>&1 | vinfo
|
||||
for LV in $LVS; do
|
||||
if [ "x$(lvm lvs --noheadings --select "lv_attr =~ k" $LV | wc -l)" = "x0" ]; then
|
||||
info "Skipping activation of '$LV' because activationskip is set."
|
||||
continue
|
||||
fi
|
||||
if [ -z "$sysinit" ]; then
|
||||
lvm lvchange --yes -ay --ignorelockingfailure $nopoll --ignoremonitoring $LV 2>&1 | vinfo
|
||||
else
|
||||
|
@@ -42,6 +42,10 @@ cmdline() {
|
||||
done
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
instmods dm-snapshot
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
local _i
|
||||
@@ -49,8 +53,8 @@ install() {
|
||||
inst lvm
|
||||
|
||||
if [[ $hostonly_cmdline == "yes" ]]; then
|
||||
cmdline >> "${initdir}/etc/cmdline.d/90lvm.conf"
|
||||
echo >> "${initdir}/etc/cmdline.d/90lvm.conf"
|
||||
local _lvmconf=$(cmdline)
|
||||
[[ $_lvmconf ]] && printf "%s\n" "$_lvmconf" >> "${initdir}/etc/cmdline.d/90lvm.conf"
|
||||
fi
|
||||
|
||||
inst_rules "$moddir/64-lvm.rules"
|
||||
@@ -63,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)
|
||||
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
|
||||
@@ -107,12 +125,19 @@ install() {
|
||||
dev=$(</sys/block/${dev#/dev/}/dm/name)
|
||||
eval $(dmsetup splitname --nameprefixes --noheadings --rows "$dev" 2>/dev/null)
|
||||
[[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || continue
|
||||
if [[ "$(lvs --noheadings -o segtype ${DM_VG_NAME} 2>/dev/null)" == *thin* ]] ; then
|
||||
inst_multiple -o thin_dump thin_restore thin_check thin_repair
|
||||
break
|
||||
fi
|
||||
case "$(lvs --noheadings -o segtype ${DM_VG_NAME} 2>/dev/null)" in
|
||||
*thin*|*cache*|*era*)
|
||||
inst_multiple -o thin_dump thin_restore thin_check thin_repair \
|
||||
cache_dump cache_restore cache_check cache_repair \
|
||||
era_check era_dump era_invalidate era_restore
|
||||
break;;
|
||||
esac
|
||||
done
|
||||
else
|
||||
inst_multiple -o thin_dump thin_restore thin_check thin_repair
|
||||
fi
|
||||
|
||||
if ! [[ $hostonly ]]; then
|
||||
inst_multiple -o thin_dump thin_restore thin_check thin_repair \
|
||||
cache_dump cache_restore cache_check cache_repair \
|
||||
era_check era_dump era_invalidate era_restore
|
||||
fi
|
||||
}
|
||||
|
@@ -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
|
||||
@@ -71,8 +71,8 @@ install() {
|
||||
inst $(command -v mdadm) /sbin/mdadm
|
||||
|
||||
if [[ $hostonly_cmdline == "yes" ]]; then
|
||||
cmdline >> "${initdir}/etc/cmdline.d/90mdraid.conf"
|
||||
echo >> "${initdir}/etc/cmdline.d/90mdraid.conf"
|
||||
local _raidconf=$(cmdline)
|
||||
[[ $_raidconf ]] && printf "%s\n" "$_raidconf" >> "${initdir}/etc/cmdline.d/90mdraid.conf"
|
||||
fi
|
||||
|
||||
# <mdadm-3.3 udev rule
|
||||
@@ -86,7 +86,7 @@ install() {
|
||||
for rule in 64-md-raid.rules 64-md-raid-assembly.rules; do
|
||||
rule_path="${initdir}${udevdir}/rules.d/${rule}"
|
||||
[ -f "${rule_path}" ] && sed -i -r \
|
||||
-e '/RUN\+?="[[:alpha:]/]*mdadm[[:blank:]]+(--incremental|-I)[[:blank:]]+(\$env\{DEVNAME\}|\$tempnode|\$devnode)/d' \
|
||||
-e '/(RUN|IMPORT\{program\})\+?="[[:alpha:]/]*mdadm[[:blank:]]+(--incremental|-I)[[:blank:]]+(--export )?(\$env\{DEVNAME\}|\$tempnode|\$devnode)/d' \
|
||||
"${rule_path}"
|
||||
done
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -27,6 +27,15 @@ depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
cmdline() {
|
||||
for m in scsi_dh_alua scsi_dh_emc scsi_dh_rdac ; do
|
||||
if module_is_host_only $m ; then
|
||||
printf 'rd.driver.pre=%s ' "$m"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
local _ret
|
||||
@@ -37,7 +46,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" ;;
|
||||
@@ -49,7 +58,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}
|
||||
@@ -87,12 +96,17 @@ install() {
|
||||
inst $(command -v partx) /sbin/partx
|
||||
|
||||
inst_libdir_file "libmultipath*" "multipath/*"
|
||||
inst_libdir_file 'libgcc_s.so*'
|
||||
|
||||
if [[ $hostonly_cmdline ]] ; then
|
||||
local _conf=$(cmdline)
|
||||
[[ $_conf ]] && echo "$_conf" >> "${initdir}/etc/cmdline.d/90multipath.conf"
|
||||
fi
|
||||
|
||||
if dracut_module_included "systemd"; then
|
||||
inst_multiple \
|
||||
$systemdsystemunitdir/multipathd.service
|
||||
mkdir -p "${initdir}${systemdsystemconfdir}/sysinit.target.wants"
|
||||
ln -rfs "${initdir}${systemdsystemunitdir}/multipathd.service" "${initdir}${systemdsystemconfdir}/sysinit.target.wants/multipathd.service"
|
||||
inst_simple "${moddir}/multipathd.service" "${systemdsystemunitdir}/multipathd.service"
|
||||
mkdir -p "${initdir}${systemdsystemunitdir}/sysinit.target.wants"
|
||||
ln -rfs "${initdir}${systemdsystemunitdir}/multipathd.service" "${initdir}${systemdsystemunitdir}/sysinit.target.wants/multipathd.service"
|
||||
else
|
||||
inst_hook pre-trigger 02 "$moddir/multipathd.sh"
|
||||
inst_hook cleanup 02 "$moddir/multipathd-stop.sh"
|
||||
@@ -100,6 +114,9 @@ install() {
|
||||
|
||||
inst_hook cleanup 80 "$moddir/multipathd-needshutdown.sh"
|
||||
|
||||
inst_rules 40-multipath.rules 62-multipath.rules 65-multipath.rules 66-kpartx.rules
|
||||
inst_rules 40-multipath.rules 56-multipath.rules \
|
||||
62-multipath.rules 65-multipath.rules \
|
||||
66-kpartx.rules 67-kpartx-compat.rules \
|
||||
11-dm-mpath.rules
|
||||
}
|
||||
|
||||
|
19
modules.d/90multipath/multipathd.service
Normal file
19
modules.d/90multipath/multipathd.service
Normal file
@@ -0,0 +1,19 @@
|
||||
[Unit]
|
||||
Description=Device-Mapper Multipath Device Controller
|
||||
Before=iscsi.service iscsid.service lvm2-activation-early.service
|
||||
DefaultDependencies=no
|
||||
Conflicts=shutdown.target
|
||||
ConditionKernelCommandLine=!nompath
|
||||
ConditionKernelCommandLine=!rd.multipath=0
|
||||
ConditionKernelCommandLine=!rd_NO_MULTIPATH
|
||||
ConditionPathExists=/etc/multipath.conf
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStartPre=/sbin/modprobe dm-multipath
|
||||
ExecStart=/sbin/multipathd -s -d
|
||||
ExecReload=/sbin/multipathd reconfigure
|
||||
ExecStop=/sbin/multipathd shutdown
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -e /etc/multipath.conf ]; then
|
||||
if getargbool 1 rd.multipath -d -n rd_NO_MULTIPATH && [ -e /etc/multipath.conf ]; then
|
||||
modprobe dm-multipath
|
||||
multipathd -B || multipathd
|
||||
need_shutdown
|
||||
|
@@ -25,5 +25,5 @@ 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_scsi virtio_console virtio_rng
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -13,9 +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 \
|
||||
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
|
||||
}
|
||||
|
@@ -16,16 +16,20 @@ type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
netif=$1
|
||||
dcb=$2
|
||||
|
||||
iflink=$(cat /sys/class/net/$netif/iflink)
|
||||
ifindex=$(cat /sys/class/net/$netif/ifindex)
|
||||
if [ "$iflink" != "$ifindex" ] ; then
|
||||
# Skip VLAN devices
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ip link set dev $netif up
|
||||
linkup "$netif"
|
||||
|
||||
netdriver=$(readlink -f /sys/class/net/$netif/device/driver)
|
||||
netdriver=${netdriver##*/}
|
||||
|
||||
if [ "$dcb" = "dcb" ]; then
|
||||
# Note lldpad will stay running after switchroot, the system initscripts
|
||||
# are to kill it and start a new lldpad to take over. Data is transfered
|
||||
# between the 2 using a shm segment
|
||||
lldpad -d
|
||||
# wait for lldpad to be ready
|
||||
i=0
|
||||
while [ $i -lt 60 ]; do
|
||||
@@ -35,10 +39,6 @@ if [ "$dcb" = "dcb" ]; then
|
||||
i=$(($i+1))
|
||||
done
|
||||
|
||||
# on some systems lldpad needs some time
|
||||
# sleep until we find a better solution
|
||||
sleep 30
|
||||
|
||||
while [ $i -lt 60 ]; do
|
||||
dcbtool sc "$netif" dcb on && break
|
||||
info "Retrying to turn dcb on"
|
||||
|
14
modules.d/95fcoe/lldpad.sh
Executable file
14
modules.d/95fcoe/lldpad.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Note lldpad will stay running after switchroot, the system initscripts
|
||||
# are to kill it and start a new lldpad to take over. Data is transfered
|
||||
# between the 2 using a shm segment
|
||||
lldpad -d
|
||||
# wait for lldpad to be ready
|
||||
i=0
|
||||
while [ $i -lt 60 ]; do
|
||||
lldptool -p && break
|
||||
info "Waiting for lldpad to be ready"
|
||||
sleep 1
|
||||
i=$(($i+1))
|
||||
done
|
@@ -2,7 +2,16 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for c in /sys/bus/fcoe/devices/ctlr_* ; do
|
||||
[ -L $c ] || continue
|
||||
fcoe_ctlr=$c
|
||||
done
|
||||
[ -z "$fcoe_ctlr" ] && return 255
|
||||
}
|
||||
|
||||
require_binaries dcbtool fipvlan lldpad ip readlink || return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -17,15 +26,59 @@ installkernel() {
|
||||
instmods fcoe 8021q edd
|
||||
}
|
||||
|
||||
get_vlan_parent() {
|
||||
local link=$1
|
||||
|
||||
[ -d $link ] || return
|
||||
read iflink < $link/iflink
|
||||
for if in /sys/class/net/* ; do
|
||||
read idx < $if/ifindex
|
||||
if [ $idx -eq $iflink ] ; then
|
||||
echo ${if##*/}
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
cmdline() {
|
||||
|
||||
for c in /sys/bus/fcoe/devices/ctlr_* ; do
|
||||
[ -L $c ] || continue
|
||||
read enabled < $c/enabled
|
||||
[ $enabled -eq 0 ] && continue
|
||||
d=$(cd -P $c; echo $PWD)
|
||||
i=${d%/*}
|
||||
read mac < ${i}/address
|
||||
s=$(dcbtool gc ${i##*/} dcb | sed -n 's/^DCB State:\t*\(.*\)/\1/p')
|
||||
if [ -z "$s" ] ; then
|
||||
p=$(get_vlan_parent ${i})
|
||||
if [ "$p" ] ; then
|
||||
s=$(dcbtool gc ${p} dcb | sed -n 's/^DCB State:\t*\(.*\)/\1/p')
|
||||
fi
|
||||
fi
|
||||
if [ "$s" = "on" ] ; then
|
||||
dcb="dcb"
|
||||
else
|
||||
dcb="nodcb"
|
||||
fi
|
||||
echo "fcoe=${mac}:${dcb}"
|
||||
done
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_multiple ip dcbtool fipvlan lldpad readlink lldptool
|
||||
|
||||
mkdir -m 0755 -p "$initdir/var/lib/lldpad"
|
||||
|
||||
if [[ $hostonly_cmdline == "yes" ]] ; then
|
||||
local _fcoeconf=$(cmdline)
|
||||
[[ $_fcoeconf ]] && printf "%s\n" "$_fcoeconf" >> "${initdir}/etc/cmdline.d/95fcoe.conf"
|
||||
fi
|
||||
inst "$moddir/fcoe-up.sh" "/sbin/fcoe-up"
|
||||
inst "$moddir/fcoe-edd.sh" "/sbin/fcoe-edd"
|
||||
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"
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
@@ -20,14 +20,11 @@
|
||||
|
||||
|
||||
# BRCM: Later, should check whether bnx2x is loaded first before loading bnx2fc so do not load bnx2fc when there are no Broadcom adapters
|
||||
[ -e /sys/module/fcoe/parameters/create ] || modprobe -a fcoe || die "FCoE requested but kernel/initrd does not support FCoE"
|
||||
[ -d /sys/module/fcoe ] || modprobe -b -a fcoe || die "FCoE requested but kernel/initrd does not support FCoE"
|
||||
|
||||
modprobe bnx2fc >/dev/null 2>&1
|
||||
initqueue --onetime modprobe -b -q bnx2fc
|
||||
udevadm settle --timeout=30
|
||||
|
||||
# FCoE actually supported?
|
||||
[ -e /sys/module/fcoe/parameters/create ] || modprobe fcoe || die "FCoE requested but kernel/initrd does not support FCoE"
|
||||
|
||||
parse_fcoe_opts() {
|
||||
local IFS=:
|
||||
set $fcoe
|
||||
|
@@ -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
|
||||
|
@@ -81,23 +81,23 @@ handle_netroot()
|
||||
local p
|
||||
|
||||
# override conf settings by command line options
|
||||
arg=$(getargs rd.iscsi.initiator -d iscsi_initiator=)
|
||||
arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=)
|
||||
[ -n "$arg" ] && iscsi_initiator=$arg
|
||||
arg=$(getargs rd.iscsi.target.name -d iscsi_target_name=)
|
||||
arg=$(getarg rd.iscsi.target.name -d iscsi_target_name=)
|
||||
[ -n "$arg" ] && iscsi_target_name=$arg
|
||||
arg=$(getargs rd.iscsi.target.ip -d iscsi_target_ip)
|
||||
arg=$(getarg rd.iscsi.target.ip -d iscsi_target_ip)
|
||||
[ -n "$arg" ] && iscsi_target_ip=$arg
|
||||
arg=$(getargs rd.iscsi.target.port -d iscsi_target_port=)
|
||||
arg=$(getarg rd.iscsi.target.port -d iscsi_target_port=)
|
||||
[ -n "$arg" ] && iscsi_target_port=$arg
|
||||
arg=$(getargs rd.iscsi.target.group -d iscsi_target_group=)
|
||||
arg=$(getarg rd.iscsi.target.group -d iscsi_target_group=)
|
||||
[ -n "$arg" ] && iscsi_target_group=$arg
|
||||
arg=$(getargs rd.iscsi.username -d iscsi_username=)
|
||||
arg=$(getarg rd.iscsi.username -d iscsi_username=)
|
||||
[ -n "$arg" ] && iscsi_username=$arg
|
||||
arg=$(getargs rd.iscsi.password -d iscsi_password)
|
||||
arg=$(getarg rd.iscsi.password -d iscsi_password)
|
||||
[ -n "$arg" ] && iscsi_password=$arg
|
||||
arg=$(getargs rd.iscsi.in.username -d iscsi_in_username=)
|
||||
arg=$(getarg rd.iscsi.in.username -d iscsi_in_username=)
|
||||
[ -n "$arg" ] && iscsi_in_username=$arg
|
||||
arg=$(getargs rd.iscsi.in.password -d iscsi_in_password=)
|
||||
arg=$(getarg rd.iscsi.in.password -d iscsi_in_password=)
|
||||
[ -n "$arg" ] && iscsi_in_password=$arg
|
||||
for p in $(getargs rd.iscsi.param -d iscsi_param); do
|
||||
iscsi_param="$iscsi_param --param $p"
|
||||
@@ -123,7 +123,7 @@ handle_netroot()
|
||||
|
||||
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)
|
||||
iscsi_initiator=$(while read line || [ -n "$line" ]; do echo $line;done < /sys/firmware/ibft/initiator/initiator-name)
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@@ -28,6 +28,127 @@ check() {
|
||||
return 0
|
||||
}
|
||||
|
||||
get_ibft_mod() {
|
||||
local ibft_mac=$1
|
||||
local iface_mac iface_mod
|
||||
# Return the iSCSI offload module for a given MAC address
|
||||
for iface_desc in $(iscsiadm -m iface | cut -f 2 -d ' '); do
|
||||
iface_mod=${iface_desc%%,*}
|
||||
iface_mac=${iface_desc#*,}
|
||||
iface_mac=${iface_mac%%,*}
|
||||
if [ "$ibft_mac" = "$iface_mac" ] ; then
|
||||
echo $iface_mod
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
install_ibft() {
|
||||
# When iBFT / iscsi_boot is detected:
|
||||
# - Use 'ip=ibft' to set up iBFT network interface
|
||||
# Note: bnx2i is using a different MAC address of iSCSI offloading
|
||||
# so the 'ip=ibft' parameter must not be set
|
||||
# - specify firmware booting cmdline parameter
|
||||
|
||||
for d in /sys/firmware/* ; do
|
||||
if [ -d ${d}/ethernet0 ] ; then
|
||||
read ibft_mac < ${d}/ethernet0/mac
|
||||
ibft_mod=$(get_ibft_mod $ibft_mac)
|
||||
fi
|
||||
if [ -z "$ibft_mod" ] && [ -d ${d}/ethernet1 ] ; then
|
||||
read ibft_mac < ${d}/ethernet1/mac
|
||||
ibft_mod=$(get_ibft_mod $ibft_mac)
|
||||
fi
|
||||
if [ -d ${d}/initiator ] ; then
|
||||
if [ ${d##*/} = "ibft" ] && [ "$ibft_mod" != "bnx2i" ] ; then
|
||||
echo -n "ip=ibft "
|
||||
fi
|
||||
echo -n "rd.iscsi.firmware=1"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
install_iscsiroot() {
|
||||
local devpath=$1
|
||||
local scsi_path iscsi_lun session c d conn
|
||||
local iscsi_session iscsi_address iscsi_port iscsi_targetname iscsi_tpgt
|
||||
|
||||
scsi_path=${devpath%%/block*}
|
||||
[ "$scsi_path" = "$devpath" ] && return 1
|
||||
iscsi_lun=${scsi_path##*:}
|
||||
[ "$iscsi_lun" = "$scsi_path" ] && return 1
|
||||
session=${devpath%%/target*}
|
||||
[ "$session" = "$devpath" ] && return 1
|
||||
iscsi_session=${session##*/}
|
||||
[ "$iscsi_session" = "$session" ] && return 1
|
||||
|
||||
for d in ${session}/* ; do
|
||||
case $d in
|
||||
*connection*)
|
||||
c=${d##*/}
|
||||
conn=${d}/iscsi_connection/${c}
|
||||
if [ -d ${conn} ] ; then
|
||||
iscsi_address=$(cat ${conn}/persistent_address)
|
||||
iscsi_port=$(cat ${conn}/persistent_port)
|
||||
fi
|
||||
;;
|
||||
*session)
|
||||
if [ -d ${d}/${iscsi_session} ] ; then
|
||||
iscsi_initiator=$(cat ${d}/${iscsi_session}/initiatorname)
|
||||
iscsi_targetname=$(cat ${d}/${iscsi_session}/targetname)
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
[ -z "$iscsi_address" ] && return
|
||||
local_address=$(ip -o route get to $iscsi_address | sed -n 's/.*src \([0-9a-f.:]*\).*/\1/p')
|
||||
ifname=$(ip -o route get to $iscsi_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')
|
||||
printf 'ip=%s:static ' ${ifname}
|
||||
|
||||
if [ -e /sys/class/net/$ifname/address ] ; then
|
||||
ifmac=$(cat /sys/class/net/$ifname/address)
|
||||
printf 'ifname=%s:%s ' ${ifname} ${ifmac}
|
||||
fi
|
||||
|
||||
if [ -n "$iscsi_address" -a -n "$iscsi_targetname" ] ; then
|
||||
if [ -n "$iscsi_port" -a "$iscsi_port" -eq 3260 ] ; then
|
||||
iscsi_port=
|
||||
fi
|
||||
if [ -n "$iscsi_lun" -a "$iscsi_lun" -eq 0 ] ; then
|
||||
iscsi_lun=
|
||||
fi
|
||||
# In IPv6 case rd.iscsi.initatior= must pass address in [] brackets
|
||||
case "$iscsi_address" in
|
||||
*:*)
|
||||
iscsi_address="[$iscsi_address]"
|
||||
;;
|
||||
esac
|
||||
# Must be two separate lines, so that "sort | uniq" commands later
|
||||
# can sort out rd.iscsi.initiator= duplicates
|
||||
echo "rd.iscsi.initiator=${iscsi_initiator}"
|
||||
echo "netroot=iscsi:${iscsi_address}::${iscsi_port}:${iscsi_lun}:${iscsi_targetname}"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
install_softiscsi() {
|
||||
[ -d /sys/firmware/ibft ] && return 0
|
||||
|
||||
is_softiscsi() {
|
||||
local _dev=$1
|
||||
local iscsi_dev
|
||||
|
||||
[[ -L "/sys/dev/block/$_dev" ]] || return
|
||||
iscsi_dev=$(cd -P /sys/dev/block/$_dev; echo $PWD)
|
||||
install_iscsiroot $iscsi_dev
|
||||
}
|
||||
|
||||
for_each_host_dev_and_slaves_all is_softiscsi || return 255
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo network rootfs-block
|
||||
@@ -45,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" ;;
|
||||
@@ -57,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}
|
||||
@@ -76,10 +197,30 @@ installkernel() {
|
||||
| iscsi_module_filter | instmods
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
cmdline() {
|
||||
local _iscsiconf=$(install_ibft)
|
||||
{
|
||||
if [ "$_iscsiconf" ] ; then
|
||||
echo ${_iscsiconf}
|
||||
else
|
||||
install_softiscsi
|
||||
fi
|
||||
} | sort | uniq
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_multiple umount iscsistart hostname iscsi-iname
|
||||
inst_multiple -o iscsiuio
|
||||
inst_libdir_file 'libgcc_s.so*'
|
||||
|
||||
# Detect iBFT and perform mandatory steps
|
||||
if [[ $hostonly_cmdline == "yes" ]] ; then
|
||||
local _iscsiconf=$(cmdline)
|
||||
[[ $_iscsiconf ]] && printf "%s\n" "$_iscsiconf" >> "${initdir}/etc/cmdline.d/95iscsi.conf"
|
||||
fi
|
||||
|
||||
inst_hook cmdline 90 "$moddir/parse-iscsiroot.sh"
|
||||
inst_hook cleanup 90 "$moddir/cleanup-iscsi.sh"
|
||||
inst "$moddir/iscsiroot.sh" "/sbin/iscsiroot"
|
||||
|
@@ -59,20 +59,16 @@ fi
|
||||
|
||||
# iscsi_firmware does not need argument checking
|
||||
if [ -n "$iscsi_firmware" ] ; then
|
||||
netroot=${netroot:-iscsi:}
|
||||
modprobe -q iscsi_boot_sysfs 2>/dev/null
|
||||
modprobe -q iscsi_ibft
|
||||
initqueue --onetime --timeout /sbin/iscsiroot dummy "'$netroot'" "'$NEWROOT'"
|
||||
[ -z "$netroot" ] && netroot=iscsi:
|
||||
modprobe -b -q iscsi_boot_sysfs 2>/dev/null
|
||||
modprobe -b -q iscsi_ibft
|
||||
initqueue --onetime --timeout /sbin/iscsiroot dummy "$netroot" "$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
|
||||
initqueue --onetime modprobe --all -b -q qla4xxx cxgb3i cxgb4i bnx2i be2iscsi
|
||||
|
||||
if [ -z "$iscsi_firmware" ] ; then
|
||||
type parse_iscsi_root >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
@@ -81,17 +77,21 @@ fi
|
||||
|
||||
# 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 --onetime --settled /sbin/iscsiroot dummy "$netroot" "$NEWROOT"
|
||||
fi
|
||||
fi
|
||||
|
||||
netroot_enc=$(str_replace "$netroot" '/' '\2f')
|
||||
echo "[ -f '/tmp/iscsistarted-$netroot_enc' ]" > $hookdir/initqueue/finished/iscsi_started.sh
|
||||
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
|
||||
fi
|
||||
|
||||
# Done, all good!
|
||||
rootok=1
|
||||
|
@@ -3,8 +3,6 @@
|
||||
# called by dracut
|
||||
check() {
|
||||
local _rootdev
|
||||
# If our prerequisites are not met, fail.
|
||||
require_binaries nbd-client || return 1
|
||||
|
||||
# if an nbd device is not somewhere in the chain of devices root is
|
||||
# mounted on, fail the hostonly check.
|
||||
@@ -15,6 +13,7 @@ check() {
|
||||
[[ -b /dev/block/$_rootdev ]] || return 1
|
||||
check_block_and_slaves is_nbd "$_rootdev" || return 255
|
||||
}
|
||||
require_binaries nbd-client || return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
|
@@ -14,7 +14,6 @@ check() {
|
||||
done
|
||||
return 255
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -29,6 +28,43 @@ installkernel() {
|
||||
instmods nfs sunrpc ipv6 nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files
|
||||
}
|
||||
|
||||
cmdline() {
|
||||
local nfs_device
|
||||
local nfs_options
|
||||
local nfs_root
|
||||
local nfs_address
|
||||
local lookup
|
||||
local ifname
|
||||
|
||||
### nfsroot= ###
|
||||
nfs_device=$(findmnt -t nfs4 -n -o SOURCE /)
|
||||
if [ -n "$nfs_device" ];then
|
||||
nfs_root="root=nfs4:$nfs_device"
|
||||
else
|
||||
nfs_device=$(findmnt -t nfs -n -o SOURCE /)
|
||||
[ -z "$nfs_device" ] && return
|
||||
nfs_root="root=nfs:$nfs_device"
|
||||
fi
|
||||
nfs_options=$(findmnt -t nfs4,nfs -n -o OPTIONS /)
|
||||
[ -n "$nfs_options" ] && nfs_root="$nfs_root:$nfs_options"
|
||||
echo "$nfs_root"
|
||||
|
||||
### ip= ###
|
||||
if [[ $nfs_device = [0-9]*\.[0-9]*\.[0-9]*.[0-9]* ]] || [[ $nfs_device = \[.*\] ]]; then
|
||||
nfs_address="$nfs_device"
|
||||
else
|
||||
lookup=$(host $(echo ${nfs_device%%:*})| head -n1)
|
||||
nfs_address=${lookup##* }
|
||||
fi
|
||||
ifname=$(ip -o route get to $nfs_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')
|
||||
if [ -e /sys/class/net/$ifname/address ] ; then
|
||||
ifmac=$(cat /sys/class/net/$ifname/address)
|
||||
printf 'ifname=%s:%s ' ${ifname} ${ifmac}
|
||||
fi
|
||||
|
||||
printf 'ip=%s:static\n' ${ifname}
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
local _i
|
||||
@@ -37,6 +73,11 @@ install() {
|
||||
mount.nfs4 umount rpc.idmapd sed /etc/netconfig
|
||||
inst_multiple /etc/services /etc/nsswitch.conf /etc/rpc /etc/protocols /etc/idmapd.conf
|
||||
|
||||
if [[ $hostonly_cmdline == "yes" ]]; then
|
||||
local _netconf="$(cmdline)"
|
||||
[[ $_netconf ]] && printf "%s\n" "$_netconf" >> "${initdir}/etc/cmdline.d/95nfs.conf"
|
||||
fi
|
||||
|
||||
if [ -f /lib/modprobe.d/nfs.conf ]; then
|
||||
inst_multiple /lib/modprobe.d/nfs.conf
|
||||
else
|
||||
@@ -75,4 +116,3 @@ install() {
|
||||
&& chown rpc.rpc "$initdir/var/lib/rpcbind"
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
||||
|
@@ -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;;
|
||||
|
@@ -29,8 +29,17 @@ install() {
|
||||
local _bin
|
||||
|
||||
if [[ $hostonly_cmdline == "yes" ]]; then
|
||||
cmdline >> "${initdir}/etc/cmdline.d/95resume.conf"
|
||||
echo >> "${initdir}/etc/cmdline.d/95resume.conf"
|
||||
local _resumeconf=$(cmdline)
|
||||
[[ $_resumeconf ]] && printf "%s\n" "$_resumeconf" >> "${initdir}/etc/cmdline.d/95resume.conf"
|
||||
fi
|
||||
|
||||
# if systemd is included and has the hibernate-resume tool, use it and nothing else
|
||||
if dracut_module_included "systemd" && [[ -x $systemdutildir/systemd-hibernate-resume ]]; then
|
||||
inst_multiple -o \
|
||||
$systemdutildir/system-generators/systemd-hibernate-resume-generator \
|
||||
$systemdsystemunitdir/systemd-hibernate-resume@.service \
|
||||
$systemdutildir/systemd-hibernate-resume
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Optional uswsusp support
|
||||
|
@@ -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
|
||||
|
||||
{
|
||||
|
@@ -29,23 +29,36 @@ cmdline_journal() {
|
||||
return 0
|
||||
}
|
||||
|
||||
cmdline_rootfs() {
|
||||
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
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
cmdline() {
|
||||
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 /)"
|
||||
fi
|
||||
cmdline_rootfs
|
||||
cmdline_journal
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
if [[ $hostonly_cmdline == "yes" ]]; then
|
||||
cmdline_journal | while read journaldev; do
|
||||
[[ $journaldev ]] && printf "%s\n" "$journaldev" >> "${initdir}/etc/cmdline.d/95root-journaldev.conf"
|
||||
done
|
||||
local _journaldev=$(cmdline_journal)
|
||||
[[ $_journaldev ]] && printf "%s\n" "$_journaldev" >> "${initdir}/etc/cmdline.d/95root-journaldev.conf"
|
||||
local _rootdev=$(cmdline_rootfs)
|
||||
[[ $_rootdev ]] && printf "%s\n" "$_rootdev" >> "${initdir}/etc/cmdline.d/95root-dev.conf"
|
||||
fi
|
||||
|
||||
inst_multiple umount
|
||||
|
@@ -81,7 +81,7 @@ mount_root() {
|
||||
# the root filesystem,
|
||||
# remount it with the proper options
|
||||
rootopts="defaults"
|
||||
while read dev mp fs opts dump fsck; do
|
||||
while read dev mp fs opts dump fsck || [ -n "$dev" ]; do
|
||||
# skip comments
|
||||
[ "${dev%%#*}" != "$dev" ] && continue
|
||||
|
||||
|
@@ -44,8 +44,8 @@ inst_sshenv()
|
||||
if [[ -f /etc/ssh/ssh_config ]]; then
|
||||
inst_simple /etc/ssh/ssh_config
|
||||
sed -i -e 's/\(^[[:space:]]*\)ProxyCommand/\1# ProxyCommand/' ${initdir}/etc/ssh/ssh_config
|
||||
while read key val; do
|
||||
[[ key != "GlobalKnownHostsFile" ]] && continue
|
||||
while read key val || [ -n "$key" ]; do
|
||||
[[ $key != "GlobalKnownHostsFile" ]] && continue
|
||||
inst_simple "$val"
|
||||
break
|
||||
done < /etc/ssh/ssh_config
|
||||
|
@@ -7,8 +7,9 @@ install() {
|
||||
# Fixme: would be nice if we didn't have to guess, which rules to grab....
|
||||
# ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies
|
||||
# of the rules we want so that we just copy those in would be best
|
||||
inst_multiple udevadm cat uname blkid \
|
||||
/etc/udev/udev.conf
|
||||
inst_multiple udevadm cat uname blkid
|
||||
inst_dir /etc/udev
|
||||
inst_multiple -o /etc/udev/udev.conf
|
||||
|
||||
[ -d ${initdir}/$systemdutildir ] || mkdir -p ${initdir}/$systemdutildir
|
||||
for _i in ${systemdutildir}/systemd-udevd ${udevdir}/udevd /sbin/udevd; do
|
||||
@@ -25,15 +26,25 @@ install() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
inst_rules 50-udev-default.rules 60-persistent-storage.rules \
|
||||
61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \
|
||||
60-pcmcia.rules \
|
||||
50-udev.rules 95-late.rules \
|
||||
inst_rules \
|
||||
50-firmware.rules \
|
||||
50-udev.rules \
|
||||
50-udev-default.rules \
|
||||
55-scsi-sg3_id.rules \
|
||||
58-scsi-sg3_symlink.rules \
|
||||
59-scsi-sg3_utils.rules \
|
||||
70-uaccess.rules 71-seat.rules 73-seat-late.rules \
|
||||
60-block.rules \
|
||||
60-pcmcia.rules \
|
||||
60-persistent-storage.rules \
|
||||
61-persistent-storage-edd.rules \
|
||||
70-uaccess.rules \
|
||||
71-seat.rules \
|
||||
73-seat-late.rules \
|
||||
75-net-description.rules \
|
||||
80-net-name-slot.rules 80-net-setup-link.rules \
|
||||
80-drivers.rules 95-udev-late.rules \
|
||||
80-net-name-slot.rules\
|
||||
80-net-setup-link.rules \
|
||||
95-late.rules \
|
||||
"$moddir/59-persistent-storage.rules" \
|
||||
"$moddir/61-persistent-storage.rules"
|
||||
|
||||
|
@@ -42,7 +42,7 @@ mount_root() {
|
||||
# the root filesystem,
|
||||
# remount it with the proper options
|
||||
rootopts="defaults"
|
||||
while read dev mp fs opts rest; do
|
||||
while read dev mp fs opts rest || [ -n "$dev" ]; do
|
||||
# skip comments
|
||||
[ "${dev%%#*}" != "$dev" ] && continue
|
||||
|
||||
|
@@ -13,7 +13,7 @@ DefaultDependencies=no
|
||||
Before=dracut-cmdline.service
|
||||
After=systemd-journald.socket
|
||||
Wants=systemd-journald.socket
|
||||
ConditionPathExists=/etc/initrd-release
|
||||
ConditionPathExists=/usr/lib/initrd-release
|
||||
ConditionKernelCommandLine=rd.cmdline=ask
|
||||
|
||||
[Service]
|
@@ -10,7 +10,7 @@ echo
|
||||
echo
|
||||
echo
|
||||
echo "Enter additional kernel command line parameter (end with ctrl-d or .)"
|
||||
while read -e -p "> " line; do
|
||||
while read -e -p "> " line || [ -n "$line" ]; do
|
||||
[[ "$line" == "." ]] && break
|
||||
[[ "$line" ]] && printf -- "%s\n" "$line" >> /etc/cmdline.d/99-cmdline-ask.conf
|
||||
done
|
@@ -14,7 +14,7 @@ DefaultDependencies=no
|
||||
Before=dracut-pre-udev.service
|
||||
After=systemd-journald.socket
|
||||
Wants=systemd-journald.socket
|
||||
ConditionPathExists=/etc/initrd-release
|
||||
ConditionPathExists=/usr/lib/initrd-release
|
||||
ConditionPathExistsGlob=|/etc/cmdline.d/*.conf
|
||||
ConditionDirectoryNotEmpty=|/lib/dracut/hooks/cmdline
|
||||
ConditionKernelCommandLine=|rd.break=cmdline
|
@@ -5,7 +5,7 @@ if [ -f /dracut-state.sh ]; then
|
||||
fi
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
[ -f /etc/initrd-release ] && . /etc/initrd-release
|
||||
[ -f /usr/lib/initrd-release ] && . /usr/lib/initrd-release
|
||||
[ -n "$VERSION" ] && info "dracut-$VERSION"
|
||||
|
||||
if ! getargbool 1 'rd.hostonly'; then
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user