Compare commits
111 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 | ||
![]() |
c9364f6ea2 |
@@ -1,2 +1,3 @@
|
|||||||
(setq sh-basic-offset: 4)
|
((nil . ((setq sh-basic-offset: 4)
|
||||||
(setq indent-tabs-mode nil)
|
(setq indent-tabs-mode nil)
|
||||||
|
)))
|
||||||
|
@@ -12,18 +12,20 @@ case "$COMMAND" in
|
|||||||
if [[ -f ${INITRD_IMAGE_PREGENERATED} ]]; then
|
if [[ -f ${INITRD_IMAGE_PREGENERATED} ]]; then
|
||||||
# we found an initrd at the same place as the kernel
|
# we found an initrd at the same place as the kernel
|
||||||
# use this and don't generate a new one
|
# 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" \
|
&& chown root:root "$BOOT_DIR_ABS/initrd" \
|
||||||
&& chmod 0600 "$BOOT_DIR_ABS/initrd" \
|
&& chmod 0600 "$BOOT_DIR_ABS/initrd" \
|
||||||
&& exit 0
|
&& exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f /etc/kernel/cmdline ]]; then
|
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
|
fi
|
||||||
|
|
||||||
if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
|
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
|
||||||
read -ar BOOT_OPTIONS < /proc/cmdline
|
read -r -d '' -a BOOT_OPTIONS < /proc/cmdline
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset noimageifnotneeded
|
unset noimageifnotneeded
|
||||||
|
@@ -57,7 +57,7 @@ if [[ ! -f $INITRDFILE ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -f $NEW_KERNEL_IMAGE ]]; then
|
if [[ ! -f $NEW_KERNEL_IMAGE ]]; then
|
||||||
cp "$KERNEL_IMAGE" "$NEW_KERNEL_IMAGE"
|
cp --reflink=auto "$KERNEL_IMAGE" "$NEW_KERNEL_IMAGE"
|
||||||
((ret+=$?))
|
((ret+=$?))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -40,12 +40,22 @@ fi
|
|||||||
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||||||
|
|
||||||
if [[ -f /etc/kernel/cmdline ]]; then
|
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
|
fi
|
||||||
|
|
||||||
if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
|
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
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -69,7 +79,7 @@ case "$COMMAND" in
|
|||||||
|
|
||||||
[[ -d "$BOOT_DIR_ABS" ]] || mkdir -p "$BOOT_DIR_ABS"
|
[[ -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
|
echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/linux'!" >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
26
AUTHORS
26
AUTHORS
@@ -9,8 +9,8 @@ Dave Young <dyoung@redhat.com>
|
|||||||
David Dillow <dave@thedillows.org>
|
David Dillow <dave@thedillows.org>
|
||||||
Hannes Reinecke <hare@suse.de>
|
Hannes Reinecke <hare@suse.de>
|
||||||
Michal Soltys <soltys@ziu.info>
|
Michal Soltys <soltys@ziu.info>
|
||||||
Amerigo Wang <amwang@redhat.com>
|
|
||||||
Colin Guthrie <colin@mageia.org>
|
Colin Guthrie <colin@mageia.org>
|
||||||
|
Amerigo Wang <amwang@redhat.com>
|
||||||
Thomas Renninger <trenn@suse.de>
|
Thomas Renninger <trenn@suse.de>
|
||||||
WANG Chao <chaowang@redhat.com>
|
WANG Chao <chaowang@redhat.com>
|
||||||
Andrey Borzenkov <arvidjaar@gmail.com>
|
Andrey Borzenkov <arvidjaar@gmail.com>
|
||||||
@@ -27,12 +27,16 @@ Baoquan He <bhe@redhat.com>
|
|||||||
Leho Kraav <leho@kraav.com>
|
Leho Kraav <leho@kraav.com>
|
||||||
Kamil Rytarowski <n54@gmx.com>
|
Kamil Rytarowski <n54@gmx.com>
|
||||||
Marc Grimme <grimme@atix.de>
|
Marc Grimme <grimme@atix.de>
|
||||||
|
NeilBrown <neilb@suse.de>
|
||||||
Peter Rajnoha <prajnoha@redhat.com>
|
Peter Rajnoha <prajnoha@redhat.com>
|
||||||
Radek Vykydal <rvykydal@redhat.com>
|
Radek Vykydal <rvykydal@redhat.com>
|
||||||
Thorsten Behrens <tbehrens@suse.com>
|
Thorsten Behrens <tbehrens@suse.com>
|
||||||
Chao Wang <chaowang@redhat.com>
|
Chao Wang <chaowang@redhat.com>
|
||||||
Colin Walters <walters@verbum.org>
|
Colin Walters <walters@verbum.org>
|
||||||
|
Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||||
|
Fabian Deutsch <fabiand@fedoraproject.org>
|
||||||
Frederic Crozat <fcrozat@suse.com>
|
Frederic Crozat <fcrozat@suse.com>
|
||||||
|
James Lee <jlee@thestaticvoid.com>
|
||||||
Jesse Keating <jkeating@redhat.com>
|
Jesse Keating <jkeating@redhat.com>
|
||||||
Milan Broz <mbroz@redhat.com>
|
Milan Broz <mbroz@redhat.com>
|
||||||
Nicolas Chauvet <kwizart@gmail.com>
|
Nicolas Chauvet <kwizart@gmail.com>
|
||||||
@@ -40,7 +44,6 @@ Roberto Sassu <roberto.sassu@polito.it>
|
|||||||
Anton Blanchard <anton@samba.org>
|
Anton Blanchard <anton@samba.org>
|
||||||
Bill Nottingham <notting@redhat.com>
|
Bill Nottingham <notting@redhat.com>
|
||||||
Chapman Flack <g2@anastigmatix.net>
|
Chapman Flack <g2@anastigmatix.net>
|
||||||
Cristian Rodríguez <crrodriguez@opensuse.org>
|
|
||||||
David Cantrell <dcantrell@redhat.com>
|
David Cantrell <dcantrell@redhat.com>
|
||||||
Dennis Gilmore <dennis@ausil.us>
|
Dennis Gilmore <dennis@ausil.us>
|
||||||
Jon Ander Hernandez <jonan.h@gmail.com>
|
Jon Ander Hernandez <jonan.h@gmail.com>
|
||||||
@@ -52,21 +55,24 @@ Peter Robinson <pbrobinson@gmail.com>
|
|||||||
Stefan Reimer <it@startux.de>
|
Stefan Reimer <it@startux.de>
|
||||||
Stig Telfer <stelfer@cray.com>
|
Stig Telfer <stelfer@cray.com>
|
||||||
Vasiliy Tolstov <v.tolstov@selfip.ru>
|
Vasiliy Tolstov <v.tolstov@selfip.ru>
|
||||||
|
Ville Skyttä <ville.skytta@iki.fi>
|
||||||
Wim Muskee <wimmuskee@gmail.com>
|
Wim Muskee <wimmuskee@gmail.com>
|
||||||
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
||||||
Alan Pevec <apevec@redhat.com>
|
Alan Pevec <apevec@redhat.com>
|
||||||
Alex Harpin <development@landsofshadow.co.uk>
|
Alex Harpin <development@landsofshadow.co.uk>
|
||||||
Daniel Schaal <farbing@web.de>
|
Daniel Schaal <farbing@web.de>
|
||||||
|
Erwan Velu <erwan.velu@enovance.com>
|
||||||
Frederick Grose <fgrose@sugarlabs.org>
|
Frederick Grose <fgrose@sugarlabs.org>
|
||||||
Hari Bathini <hbathini@linux.vnet.ibm.com>
|
Hari Bathini <hbathini@linux.vnet.ibm.com>
|
||||||
Ian Dall <ian@beware.dropbear.id.au>
|
Ian Dall <ian@beware.dropbear.id.au>
|
||||||
James Buren <ryuo@frugalware.org>
|
James Buren <ryuo@frugalware.org>
|
||||||
James Lee <jlee@thestaticvoid.com>
|
Jan Synacek <jsynacek@redhat.com>
|
||||||
Joey Boggs <jboggs@redhat.com>
|
Joey Boggs <jboggs@redhat.com>
|
||||||
Koen Kooi <koen@dominion.thruhere.net>
|
Koen Kooi <koen@dominion.thruhere.net>
|
||||||
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||||
Kyle McMartin <kmcmarti@redhat.com>
|
Kyle McMartin <kmcmarti@redhat.com>
|
||||||
Lubomir Rintel <lkundrak@v3.sk>
|
Lubomir Rintel <lkundrak@v3.sk>
|
||||||
|
Lukas Wunner <lukas@wunner.de>
|
||||||
Mike Snitzer <snitzer@redhat.com>
|
Mike Snitzer <snitzer@redhat.com>
|
||||||
Minfei Huang <mhuang@redhat.com>
|
Minfei Huang <mhuang@redhat.com>
|
||||||
Przemysław Rudy <prudy1@o2.pl>
|
Przemysław Rudy <prudy1@o2.pl>
|
||||||
@@ -82,25 +88,29 @@ Anssi Hannula <anssi@mageia.org>
|
|||||||
Antony Messerli <amesserl@rackspace.com>
|
Antony Messerli <amesserl@rackspace.com>
|
||||||
Brandon Philips <brandon@ifup.co>
|
Brandon Philips <brandon@ifup.co>
|
||||||
Canek Peláez Valdés <caneko@gmail.com>
|
Canek Peláez Valdés <caneko@gmail.com>
|
||||||
|
Chao Fan <cfan@redhat.com>
|
||||||
Chris Leech <cleech@redhat.com>
|
Chris Leech <cleech@redhat.com>
|
||||||
Christian Heinz <christian.ch.heinz@gmail.com>
|
Christian Heinz <christian.ch.heinz@gmail.com>
|
||||||
|
Christian Rodrigues <crrodriguez@opensuse.org>
|
||||||
Cong Wang <amwang@redhat.com>
|
Cong Wang <amwang@redhat.com>
|
||||||
Daniel Drake <drake@endlessm.com>
|
Daniel Drake <drake@endlessm.com>
|
||||||
Dave Jones <davej@redhat.com>
|
Dave Jones <davej@redhat.com>
|
||||||
Dennis Schridde <devurandom@gmx.net>
|
Dennis Schridde <devurandom@gmx.net>
|
||||||
|
Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
|
||||||
Duane Griffin <duaneg@dghda.com>
|
Duane Griffin <duaneg@dghda.com>
|
||||||
Erwan Velu <erwan.velu@enovance.com>
|
Gerd von Egidy <gerd.von.egidy@intra2net.com>
|
||||||
Glen Gray <slaine@slaine.org>
|
Glen Gray <slaine@slaine.org>
|
||||||
Hermann Gausterer <git-dracut-2012@mrq1.org>
|
Hermann Gausterer <git-dracut-2012@mrq1.org>
|
||||||
James Laska <jlaska@redhat.com>
|
James Laska <jlaska@redhat.com>
|
||||||
Jan Stodola <jstodola@redhat.com>
|
Jan Stodola <jstodola@redhat.com>
|
||||||
Jiri Pirko <jiri@resnulli.us>
|
Jiri Pirko <jiri@resnulli.us>
|
||||||
Joe Lawrence <Joe.Lawrence@stratus.com>
|
Joe Lawrence <Joe.Lawrence@stratus.com>
|
||||||
|
Jonas Jonsson <jonas@websystem.se>
|
||||||
Julian Wolf <juwolf@suse.com>
|
Julian Wolf <juwolf@suse.com>
|
||||||
Kevin Yung <Kevin.Yung@myob.com>
|
Kevin Yung <Kevin.Yung@myob.com>
|
||||||
Lars R. Damerow <lars@pixar.com>
|
Lars R. Damerow <lars@pixar.com>
|
||||||
Lennert Buytenhek <buytenh@wantstofly.org>
|
Lennert Buytenhek <buytenh@wantstofly.org>
|
||||||
Lukas Wunner <lukas@wunner.de>
|
Lukas Nykryn <lnykryn@redhat.com>
|
||||||
Major Hayden <major@mhtx.net>
|
Major Hayden <major@mhtx.net>
|
||||||
Marian Csontos <mcsontos@redhat.com>
|
Marian Csontos <mcsontos@redhat.com>
|
||||||
Marko Myllynen <myllynen@redhat.com>
|
Marko Myllynen <myllynen@redhat.com>
|
||||||
@@ -108,8 +118,9 @@ Matt <smoothsailing72@hotmail.com>
|
|||||||
Matt Smith <shadowfax@gmx.com>
|
Matt Smith <shadowfax@gmx.com>
|
||||||
Michal Schmidt <mschmidt@redhat.com>
|
Michal Schmidt <mschmidt@redhat.com>
|
||||||
Mike Gorse <mgorse@suse.com>
|
Mike Gorse <mgorse@suse.com>
|
||||||
|
Moritz 'Morty' Strübe <morty@gmx.net>
|
||||||
Munehiro Matsuda <haro@kgt.co.jp>
|
Munehiro Matsuda <haro@kgt.co.jp>
|
||||||
NeilBrown <neilb@suse.de>
|
Nikoli <nikoli@gmx.us>
|
||||||
Nikoli <nikoli@lavabit.com>
|
Nikoli <nikoli@lavabit.com>
|
||||||
Olivier Blin <dev@blino.org>
|
Olivier Blin <dev@blino.org>
|
||||||
P J P <ppandit@redhat.com>
|
P J P <ppandit@redhat.com>
|
||||||
@@ -119,6 +130,7 @@ Praveen_Paladugu@Dell.com <Praveen_Paladugu@Dell.com>
|
|||||||
Pádraig Brady <P@draigBrady.com>
|
Pádraig Brady <P@draigBrady.com>
|
||||||
Quentin Armitage <quentin@armitage.org.uk>
|
Quentin Armitage <quentin@armitage.org.uk>
|
||||||
Robert Buchholz <rbu@goodpoint.de>
|
Robert Buchholz <rbu@goodpoint.de>
|
||||||
|
Rusty Bird <rustybird@openmailbox.org>
|
||||||
Sergey Fionov <fionov@gmail.com>
|
Sergey Fionov <fionov@gmail.com>
|
||||||
Shawn W Dunn <sfalken@opensuse.org>
|
Shawn W Dunn <sfalken@opensuse.org>
|
||||||
Srinivasa T N <seenutn@linux.vnet.ibm.com>
|
Srinivasa T N <seenutn@linux.vnet.ibm.com>
|
||||||
@@ -128,8 +140,8 @@ Tom Gundersen <teg@jklm.no>
|
|||||||
Tomasz Torcz <tomek@pipebreaker.pl>
|
Tomasz Torcz <tomek@pipebreaker.pl>
|
||||||
Vadim Kuznetsov <vadimk@gentoo.org>
|
Vadim Kuznetsov <vadimk@gentoo.org>
|
||||||
Vaughan Cao <vaughan.cao@oracle.com>
|
Vaughan Cao <vaughan.cao@oracle.com>
|
||||||
Ville Skyttä <ville.skytta@iki.fi>
|
|
||||||
Vratislav Podzimek <vpodzime@redhat.com>
|
Vratislav Podzimek <vpodzime@redhat.com>
|
||||||
Yanko Kaneti <yaneti@declera.com>
|
Yanko Kaneti <yaneti@declera.com>
|
||||||
jloeser <jloeser@suse.de>
|
jloeser <jloeser@suse.de>
|
||||||
maximilian attems <max@stro.at>
|
maximilian attems <max@stro.at>
|
||||||
|
xtraeme <xtraeme@voidlinux.eu>
|
||||||
|
39
Makefile
39
Makefile
@@ -15,6 +15,7 @@ mandir ?= ${prefix}/share/man
|
|||||||
CFLAGS ?= -O2 -g -Wall
|
CFLAGS ?= -O2 -g -Wall
|
||||||
CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -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
|
bashcompletiondir ?= ${datadir}/bash-completion/completions
|
||||||
|
pkgconfigdatadir ?= $(datadir)/pkgconfig
|
||||||
|
|
||||||
man1pages = lsinitrd.1
|
man1pages = lsinitrd.1
|
||||||
|
|
||||||
@@ -28,20 +29,20 @@ man8pages = dracut.8 \
|
|||||||
dracut-catimages.8 \
|
dracut-catimages.8 \
|
||||||
mkinitrd.8 \
|
mkinitrd.8 \
|
||||||
mkinitrd-suse.8 \
|
mkinitrd-suse.8 \
|
||||||
modules.d/98systemd/dracut-cmdline.service.8 \
|
modules.d/98dracut-systemd/dracut-cmdline.service.8 \
|
||||||
modules.d/98systemd/dracut-initqueue.service.8 \
|
modules.d/98dracut-systemd/dracut-initqueue.service.8 \
|
||||||
modules.d/98systemd/dracut-mount.service.8 \
|
modules.d/98dracut-systemd/dracut-mount.service.8 \
|
||||||
modules.d/98systemd/dracut-shutdown.service.8 \
|
modules.d/98dracut-systemd/dracut-shutdown.service.8 \
|
||||||
modules.d/98systemd/dracut-pre-mount.service.8 \
|
modules.d/98dracut-systemd/dracut-pre-mount.service.8 \
|
||||||
modules.d/98systemd/dracut-pre-pivot.service.8 \
|
modules.d/98dracut-systemd/dracut-pre-pivot.service.8 \
|
||||||
modules.d/98systemd/dracut-pre-trigger.service.8 \
|
modules.d/98dracut-systemd/dracut-pre-trigger.service.8 \
|
||||||
modules.d/98systemd/dracut-pre-udev.service.8
|
modules.d/98dracut-systemd/dracut-pre-udev.service.8
|
||||||
|
|
||||||
manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages)
|
manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages)
|
||||||
|
|
||||||
.PHONY: install clean archive rpm testimage test all check AUTHORS doc dracut-version.sh
|
.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 = \
|
DRACUT_INSTALL_OBJECTS = \
|
||||||
install/dracut-install.o \
|
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
|
http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl dracut.xml
|
||||||
rm -f -- dracut.xml
|
rm -f -- dracut.xml
|
||||||
|
|
||||||
install: dracut-version.sh
|
dracut.pc: Makefile.inc Makefile
|
||||||
|
@echo "Name: dracut" > dracut.pc
|
||||||
|
@echo "Description: dracut" >> dracut.pc
|
||||||
|
@echo "Version: $(VERSION)$(GITVERSION)" >> dracut.pc
|
||||||
|
@echo "dracutdir=$(pkglibdir)" >> dracut.pc
|
||||||
|
@echo "dracutmodulesdir=$(pkglibdir)/modules.d" >> dracut.pc
|
||||||
|
@echo "dracutconfdir=$(pkglibdir)/dracut.conf.d" >> dracut.pc
|
||||||
|
|
||||||
|
install: all
|
||||||
mkdir -p $(DESTDIR)$(pkglibdir)
|
mkdir -p $(DESTDIR)$(pkglibdir)
|
||||||
mkdir -p $(DESTDIR)$(bindir)
|
mkdir -p $(DESTDIR)$(bindir)
|
||||||
mkdir -p $(DESTDIR)$(sysconfdir)
|
mkdir -p $(DESTDIR)$(sysconfdir)
|
||||||
@@ -124,7 +133,7 @@ ifneq ($(enable_documentation),no)
|
|||||||
endif
|
endif
|
||||||
if [ -n "$(systemdsystemunitdir)" ]; then \
|
if [ -n "$(systemdsystemunitdir)" ]; then \
|
||||||
mkdir -p $(DESTDIR)$(systemdsystemunitdir); \
|
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; \
|
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants; \
|
||||||
ln -s ../dracut-shutdown.service \
|
ln -s ../dracut-shutdown.service \
|
||||||
$(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants/dracut-shutdown.service; \
|
$(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants/dracut-shutdown.service; \
|
||||||
@@ -138,7 +147,7 @@ endif
|
|||||||
dracut-pre-trigger.service \
|
dracut-pre-trigger.service \
|
||||||
dracut-pre-udev.service \
|
dracut-pre-udev.service \
|
||||||
; do \
|
; 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 \
|
ln -s ../$$i \
|
||||||
$(DESTDIR)$(systemdsystemunitdir)/initrd.target.wants/$$i; \
|
$(DESTDIR)$(systemdsystemunitdir)/initrd.target.wants/$$i; \
|
||||||
done \
|
done \
|
||||||
@@ -155,6 +164,8 @@ endif
|
|||||||
mkdir -p $(DESTDIR)${bashcompletiondir}
|
mkdir -p $(DESTDIR)${bashcompletiondir}
|
||||||
install -m 0644 dracut-bash-completion.sh $(DESTDIR)${bashcompletiondir}/dracut
|
install -m 0644 dracut-bash-completion.sh $(DESTDIR)${bashcompletiondir}/dracut
|
||||||
install -m 0644 lsinitrd-bash-completion.sh $(DESTDIR)${bashcompletiondir}/lsinitrd
|
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:
|
dracut-version.sh:
|
||||||
@echo "DRACUT_VERSION=$(VERSION)$(GITVERSION)" > dracut-version.sh
|
@echo "DRACUT_VERSION=$(VERSION)$(GITVERSION)" > dracut-version.sh
|
||||||
@@ -212,7 +223,7 @@ check: all syncheck rpm
|
|||||||
@$(MAKE) -C test check
|
@$(MAKE) -C test check
|
||||||
|
|
||||||
testimage: all
|
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
|
@echo wrote test-$(shell uname -r).img
|
||||||
|
|
||||||
debugtestimage: all
|
debugtestimage: all
|
||||||
@@ -234,7 +245,7 @@ hostimage: all
|
|||||||
@echo wrote test-$(shell uname -r).img
|
@echo wrote test-$(shell uname -r).img
|
||||||
|
|
||||||
AUTHORS:
|
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
|
dracut.html.sign: dracut-$(VERSION).tar.xz dracut.html
|
||||||
gpg-sign-all dracut-$(VERSION).tar.xz dracut.html
|
gpg-sign-all dracut-$(VERSION).tar.xz dracut.html
|
||||||
|
31
NEWS
31
NEWS
@@ -1,3 +1,34 @@
|
|||||||
|
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
|
dracut-041
|
||||||
==========
|
==========
|
||||||
- fixed the shutdown loop
|
- fixed the shutdown loop
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
For the testsuite to work, you will have to install at least the following software packages:
|
For the testsuite to work, you will have to install at least the following software packages:
|
||||||
dash \
|
dash \
|
||||||
|
bridge-utils \
|
||||||
asciidoc \
|
asciidoc \
|
||||||
mdadm \
|
mdadm \
|
||||||
lvm2 \
|
lvm2 \
|
||||||
|
2
TODO
2
TODO
@@ -6,6 +6,8 @@ Items are ordered in priority.
|
|||||||
|
|
||||||
INITRAMFS TODO
|
INITRAMFS TODO
|
||||||
|
|
||||||
|
- search domain string
|
||||||
|
- peerdns=no
|
||||||
- allow dual stack configuration (IPv4, IPv6) for the same interface
|
- allow dual stack configuration (IPv4, IPv6) for the same interface
|
||||||
- "bind-mount" kernel drivers in real root for the rescue image,
|
- "bind-mount" kernel drivers in real root for the rescue image,
|
||||||
if the real root does not have any kernel modules for this kernel
|
if the real root does not have any kernel modules for this kernel
|
||||||
|
@@ -32,6 +32,7 @@ _dracut() {
|
|||||||
--xz --no-compress --gzip --list-modules --show-modules --keep
|
--xz --no-compress --gzip --list-modules --show-modules --keep
|
||||||
--printsize --regenerate-all --noimageifnotneeded --early-microcode
|
--printsize --regenerate-all --noimageifnotneeded --early-microcode
|
||||||
--no-early-microcode --print-cmdline --prelink --noprelink --reproducible
|
--no-early-microcode --print-cmdline --prelink --noprelink --reproducible
|
||||||
|
--uefi
|
||||||
'
|
'
|
||||||
|
|
||||||
[ARG]='-a -m -o -d -I -k -c -L --kver --add --force-add --add-drivers
|
[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
|
--fwdir --libdirs --fscks --add-fstab --mount --device --nofscks
|
||||||
--kmoddir --conf --confdir --tmpdir --stdlog --compress --prefix
|
--kmoddir --conf --confdir --tmpdir --stdlog --compress --prefix
|
||||||
--kernel-cmdline --sshkey --persistent-policy --install-optional
|
--kernel-cmdline --sshkey --persistent-policy --install-optional
|
||||||
--loginstall
|
--loginstall --uefi-stub --kernel-image
|
||||||
'
|
'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -309,7 +309,7 @@ get_fs_env() {
|
|||||||
[[ $1 ]] || return
|
[[ $1 ]] || return
|
||||||
unset ID_FS_TYPE
|
unset ID_FS_TYPE
|
||||||
ID_FS_TYPE=$(blkid -u filesystem -o export -- "$1" \
|
ID_FS_TYPE=$(blkid -u filesystem -o export -- "$1" \
|
||||||
| while read line; do
|
| while read line || [ -n "$line" ]; do
|
||||||
if [[ "$line" == TYPE\=* ]]; then
|
if [[ "$line" == TYPE\=* ]]; then
|
||||||
printf "%s" "${line#TYPE=}";
|
printf "%s" "${line#TYPE=}";
|
||||||
exit 0;
|
exit 0;
|
||||||
@@ -435,7 +435,7 @@ find_block_device() {
|
|||||||
if [[ $use_fstab != yes ]]; then
|
if [[ $use_fstab != yes ]]; then
|
||||||
[[ -d $_find_mpt/. ]]
|
[[ -d $_find_mpt/. ]]
|
||||||
findmnt -e -v -n -o 'MAJ:MIN,SOURCE' --target "$_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 [[ -b $_dev ]]; then
|
||||||
if ! [[ $_majmin ]] || [[ $_majmin == 0:* ]]; then
|
if ! [[ $_majmin ]] || [[ $_majmin == 0:* ]]; then
|
||||||
_majmin=$(get_maj_min $_dev)
|
_majmin=$(get_maj_min $_dev)
|
||||||
@@ -456,7 +456,7 @@ find_block_device() {
|
|||||||
# fall back to /etc/fstab
|
# fall back to /etc/fstab
|
||||||
|
|
||||||
findmnt -e --fstab -v -n -o 'MAJ:MIN,SOURCE' --target "$_find_mpt" | { \
|
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
|
if ! [[ $_dev ]]; then
|
||||||
_dev="$_majmin"
|
_dev="$_majmin"
|
||||||
unset _majmin
|
unset _majmin
|
||||||
@@ -492,7 +492,7 @@ find_mp_fstype() {
|
|||||||
|
|
||||||
if [[ $use_fstab != yes ]]; then
|
if [[ $use_fstab != yes ]]; then
|
||||||
findmnt -e -v -n -o 'FSTYPE' --target "$1" | { \
|
findmnt -e -v -n -o 'FSTYPE' --target "$1" | { \
|
||||||
while read _fs; do
|
while read _fs || [ -n "$_fs" ]; do
|
||||||
[[ $_fs ]] || continue
|
[[ $_fs ]] || continue
|
||||||
[[ $_fs = "autofs" ]] && continue
|
[[ $_fs = "autofs" ]] && continue
|
||||||
printf "%s" "$_fs"
|
printf "%s" "$_fs"
|
||||||
@@ -501,7 +501,7 @@ find_mp_fstype() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
findmnt --fstab -e -v -n -o 'FSTYPE' --target "$1" | { \
|
findmnt --fstab -e -v -n -o 'FSTYPE' --target "$1" | { \
|
||||||
while read _fs; do
|
while read _fs || [ -n "$_fs" ]; do
|
||||||
[[ $_fs ]] || continue
|
[[ $_fs ]] || continue
|
||||||
[[ $_fs = "autofs" ]] && continue
|
[[ $_fs = "autofs" ]] && continue
|
||||||
printf "%s" "$_fs"
|
printf "%s" "$_fs"
|
||||||
@@ -528,7 +528,7 @@ find_dev_fstype() {
|
|||||||
|
|
||||||
if [[ $use_fstab != yes ]]; then
|
if [[ $use_fstab != yes ]]; then
|
||||||
findmnt -e -v -n -o 'FSTYPE' --source "$_find_dev" | { \
|
findmnt -e -v -n -o 'FSTYPE' --source "$_find_dev" | { \
|
||||||
while read _fs; do
|
while read _fs || [ -n "$_fs" ]; do
|
||||||
[[ $_fs ]] || continue
|
[[ $_fs ]] || continue
|
||||||
[[ $_fs = "autofs" ]] && continue
|
[[ $_fs = "autofs" ]] && continue
|
||||||
printf "%s" "$_fs"
|
printf "%s" "$_fs"
|
||||||
@@ -537,7 +537,7 @@ find_dev_fstype() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
findmnt --fstab -e -v -n -o 'FSTYPE' --source "$_find_dev" | { \
|
findmnt --fstab -e -v -n -o 'FSTYPE' --source "$_find_dev" | { \
|
||||||
while read _fs; do
|
while read _fs || [ -n "$_fs" ]; do
|
||||||
[[ $_fs ]] || continue
|
[[ $_fs ]] || continue
|
||||||
[[ $_fs = "autofs" ]] && continue
|
[[ $_fs = "autofs" ]] && continue
|
||||||
printf "%s" "$_fs"
|
printf "%s" "$_fs"
|
||||||
@@ -977,7 +977,7 @@ inst_rules_wildcard() {
|
|||||||
_found=$_rule
|
_found=$_rule
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ -n ${hostonly} ] ; then
|
if [[ -n ${hostonly} ]] ; then
|
||||||
for _rule in ${_target}/$1 ; do
|
for _rule in ${_target}/$1 ; do
|
||||||
if [[ -f $_rule ]]; then
|
if [[ -f $_rule ]]; then
|
||||||
inst_rule_programs "$_rule"
|
inst_rule_programs "$_rule"
|
||||||
@@ -997,7 +997,7 @@ prepare_udev_rules() {
|
|||||||
for f in "$@"; do
|
for f in "$@"; do
|
||||||
f="${initdir}/etc/udev/rules.d/$f"
|
f="${initdir}/etc/udev/rules.d/$f"
|
||||||
[ -e "$f" ] || continue
|
[ -e "$f" ] || continue
|
||||||
while read line; do
|
while read line || [ -n "$line" ]; do
|
||||||
if [ "${line%%IMPORT PATH_ID}" != "$line" ]; then
|
if [ "${line%%IMPORT PATH_ID}" != "$line" ]; then
|
||||||
if [ $UDEVVERSION -ge 174 ]; then
|
if [ $UDEVVERSION -ge 174 ]; then
|
||||||
printf '%sIMPORT{builtin}="path_id"\n' "${line%%IMPORT PATH_ID}"
|
printf '%sIMPORT{builtin}="path_id"\n' "${line%%IMPORT PATH_ID}"
|
||||||
@@ -1130,7 +1130,7 @@ inst_opt_decompress() {
|
|||||||
# or the "check" script, if module-setup.sh is not found
|
# or the "check" script, if module-setup.sh is not found
|
||||||
# "check $hostonly" is called
|
# "check $hostonly" is called
|
||||||
module_check() {
|
module_check() {
|
||||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||||
local _ret
|
local _ret
|
||||||
local _forced=0
|
local _forced=0
|
||||||
local _hostonly=$hostonly
|
local _hostonly=$hostonly
|
||||||
@@ -1161,7 +1161,7 @@ module_check() {
|
|||||||
# or the "check" script, if module-setup.sh is not found
|
# or the "check" script, if module-setup.sh is not found
|
||||||
# "mount_needs=1 check 0" is called
|
# "mount_needs=1 check 0" is called
|
||||||
module_check_mount() {
|
module_check_mount() {
|
||||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||||
local _ret
|
local _ret
|
||||||
mount_needs=1
|
mount_needs=1
|
||||||
[[ -d $_moddir ]] || return 1
|
[[ -d $_moddir ]] || return 1
|
||||||
@@ -1186,7 +1186,7 @@ module_check_mount() {
|
|||||||
# execute the depends() function of module-setup.sh of <dracut module>
|
# execute the depends() function of module-setup.sh of <dracut module>
|
||||||
# or the "depends" script, if module-setup.sh is not found
|
# or the "depends" script, if module-setup.sh is not found
|
||||||
module_depends() {
|
module_depends() {
|
||||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||||
local _ret
|
local _ret
|
||||||
[[ -d $_moddir ]] || return 1
|
[[ -d $_moddir ]] || return 1
|
||||||
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
||||||
@@ -1209,7 +1209,7 @@ module_depends() {
|
|||||||
# execute the cmdline() function of module-setup.sh of <dracut module>
|
# execute the cmdline() function of module-setup.sh of <dracut module>
|
||||||
# or the "cmdline" script, if module-setup.sh is not found
|
# or the "cmdline" script, if module-setup.sh is not found
|
||||||
module_cmdline() {
|
module_cmdline() {
|
||||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||||
local _ret
|
local _ret
|
||||||
[[ -d $_moddir ]] || return 1
|
[[ -d $_moddir ]] || return 1
|
||||||
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
||||||
@@ -1230,7 +1230,7 @@ module_cmdline() {
|
|||||||
# execute the install() function of module-setup.sh of <dracut module>
|
# execute the install() function of module-setup.sh of <dracut module>
|
||||||
# or the "install" script, if module-setup.sh is not found
|
# or the "install" script, if module-setup.sh is not found
|
||||||
module_install() {
|
module_install() {
|
||||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||||
local _ret
|
local _ret
|
||||||
[[ -d $_moddir ]] || return 1
|
[[ -d $_moddir ]] || return 1
|
||||||
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
||||||
@@ -1251,7 +1251,7 @@ module_install() {
|
|||||||
# execute the installkernel() function of module-setup.sh of <dracut module>
|
# execute the installkernel() function of module-setup.sh of <dracut module>
|
||||||
# or the "installkernel" script, if module-setup.sh is not found
|
# or the "installkernel" script, if module-setup.sh is not found
|
||||||
module_installkernel() {
|
module_installkernel() {
|
||||||
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1})
|
local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; })
|
||||||
local _ret
|
local _ret
|
||||||
[[ -d $_moddir ]] || return 1
|
[[ -d $_moddir ]] || return 1
|
||||||
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
if [[ ! -f $_moddir/module-setup.sh ]]; then
|
||||||
@@ -1273,7 +1273,7 @@ module_installkernel() {
|
|||||||
# device and filesystem types in "${host_fs_types[@]}"
|
# device and filesystem types in "${host_fs_types[@]}"
|
||||||
check_mount() {
|
check_mount() {
|
||||||
local _mod=$1
|
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 _ret
|
||||||
local _moddep
|
local _moddep
|
||||||
|
|
||||||
@@ -1338,7 +1338,7 @@ check_mount() {
|
|||||||
# that the modules were checked for the dependency tracking process
|
# that the modules were checked for the dependency tracking process
|
||||||
check_module() {
|
check_module() {
|
||||||
local _mod=$1
|
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 _ret
|
||||||
local _moddep
|
local _moddep
|
||||||
# If we are already scheduled to be loaded, no need to check again.
|
# If we are already scheduled to be loaded, no need to check again.
|
||||||
@@ -1512,7 +1512,7 @@ for_each_kmod_dep() {
|
|||||||
local _func=$1 _kmod=$2 _cmd _modpath _options
|
local _func=$1 _kmod=$2 _cmd _modpath _options
|
||||||
shift 2
|
shift 2
|
||||||
modprobe "$@" --ignore-install --show-depends $_kmod 2>&${_fderr} | (
|
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
|
[[ $_cmd = insmod ]] || continue
|
||||||
$_func ${_modpath} || exit $?
|
$_func ${_modpath} || exit $?
|
||||||
done
|
done
|
||||||
@@ -1528,7 +1528,7 @@ dracut_kernel_post() {
|
|||||||
--ignore-install --show-depends --set-version $kernel \
|
--ignore-install --show-depends --set-version $kernel \
|
||||||
< "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist" 2>/dev/null \
|
< "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist" 2>/dev/null \
|
||||||
| sort -u \
|
| sort -u \
|
||||||
| while read _cmd _modpath _options; do
|
| while read _cmd _modpath _options || [ -n "$_cmd" ]; do
|
||||||
[[ $_cmd = insmod ]] || continue
|
[[ $_cmd = insmod ]] || continue
|
||||||
echo "$_modpath"
|
echo "$_modpath"
|
||||||
done > "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
|
done > "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
|
||||||
@@ -1537,7 +1537,7 @@ dracut_kernel_post() {
|
|||||||
if [[ $DRACUT_INSTALL ]] && [[ -z $_moddirname ]]; then
|
if [[ $DRACUT_INSTALL ]] && [[ -z $_moddirname ]]; then
|
||||||
xargs -r $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} -a < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
|
xargs -r $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} -a < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
|
||||||
else
|
else
|
||||||
while read _modpath; do
|
while read _modpath || [ -n "$_modpath" ]; do
|
||||||
local _destpath=$_modpath
|
local _destpath=$_modpath
|
||||||
[[ $_moddirname ]] && _destpath=${_destpath##$_moddirname/}
|
[[ $_moddirname ]] && _destpath=${_destpath##$_moddirname/}
|
||||||
_destpath=${_destpath##*/lib/modules/$kernel/}
|
_destpath=${_destpath##*/lib/modules/$kernel/}
|
||||||
@@ -1545,12 +1545,12 @@ dracut_kernel_post() {
|
|||||||
done < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
|
done < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep"
|
||||||
fi
|
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##*:}
|
_pid=${_pid##*:}
|
||||||
|
|
||||||
if [[ $DRACUT_INSTALL ]]; then
|
if [[ $DRACUT_INSTALL ]]; then
|
||||||
xargs -r modinfo -k $kernel -F firmware < "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist.dep" \
|
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
|
for _fwdir in $fw_dir; do
|
||||||
echo $_fwdir/$line;
|
echo $_fwdir/$line;
|
||||||
done;
|
done;
|
||||||
@@ -1635,7 +1635,7 @@ find_kernel_modules_by_path () {
|
|||||||
|
|
||||||
_OLDIFS=$IFS
|
_OLDIFS=$IFS
|
||||||
IFS=:
|
IFS=:
|
||||||
while read a rest; do
|
while read a rest || [ -n "$a" ]; do
|
||||||
[[ $a = */$1/* ]] || [[ $a = updates/* ]] || continue
|
[[ $a = */$1/* ]] || [[ $a = updates/* ]] || continue
|
||||||
printf "%s\n" "$srcmods/$a"
|
printf "%s\n" "$srcmods/$a"
|
||||||
done < "$srcmods/modules.dep"
|
done < "$srcmods/modules.dep"
|
||||||
@@ -1730,7 +1730,7 @@ instmods() {
|
|||||||
function instmods_1() {
|
function instmods_1() {
|
||||||
local _mod _mpargs
|
local _mod _mpargs
|
||||||
if (($# == 0)); then # filenames from stdin
|
if (($# == 0)); then # filenames from stdin
|
||||||
while read _mod; do
|
while read _mod || [ -n "$_mod" ]; do
|
||||||
inst1mod "${_mod%.ko*}" || {
|
inst1mod "${_mod%.ko*}" || {
|
||||||
if [[ "$_check" == "yes" ]] && [[ "$_silent" == "no" ]]; then
|
if [[ "$_check" == "yes" ]] && [[ "$_silent" == "no" ]]; then
|
||||||
dfatal "Failed to install module $_mod"
|
dfatal "Failed to install module $_mod"
|
||||||
@@ -1753,7 +1753,7 @@ instmods() {
|
|||||||
# Capture all stderr from modprobe to _fderr. We could use {var}>...
|
# Capture all stderr from modprobe to _fderr. We could use {var}>...
|
||||||
# redirections, but that would make dracut require bash4 at least.
|
# redirections, but that would make dracut require bash4 at least.
|
||||||
eval "( instmods_1 \"\$@\" ) ${_fderr}>&1" \
|
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=$?
|
_ret=$?
|
||||||
return $_ret
|
return $_ret
|
||||||
}
|
}
|
||||||
|
@@ -14,6 +14,8 @@ SKIP="$dracutbasedir/skipcpio"
|
|||||||
|
|
||||||
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
[[ -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
|
if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
|
||||||
IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
|
IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
|
||||||
fi
|
fi
|
||||||
@@ -22,6 +24,7 @@ fi
|
|||||||
cd /run/initramfs
|
cd /run/initramfs
|
||||||
|
|
||||||
[ -f .need_shutdown -a -f "$IMG" ] || exit 1
|
[ -f .need_shutdown -a -f "$IMG" ] || exit 1
|
||||||
|
|
||||||
if $SKIP "$IMG" | zcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
|
if $SKIP "$IMG" | zcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
|
||||||
rm -f -- .need_shutdown
|
rm -f -- .need_shutdown
|
||||||
elif $SKIP "$IMG" | xzcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
|
elif $SKIP "$IMG" | xzcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
|
||||||
|
@@ -365,7 +365,7 @@ dlog() {
|
|||||||
if (( $# > 1 )); then
|
if (( $# > 1 )); then
|
||||||
_do_dlog "$@"
|
_do_dlog "$@"
|
||||||
else
|
else
|
||||||
while read line; do
|
while read line || [ -n "$line" ]; do
|
||||||
_do_dlog "$1" "$line"
|
_do_dlog "$1" "$line"
|
||||||
done
|
done
|
||||||
fi
|
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).
|
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,
|
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.
|
(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
|
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
|
command line. _/run/initramfs/rdsosreport.txt_ contains all logs and the output
|
||||||
@@ -465,6 +465,20 @@ will not be able to boot.
|
|||||||
**--loginstall _<DIR>_::
|
**--loginstall _<DIR>_::
|
||||||
Log all files installed from the host to _<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
|
FILES
|
||||||
-----
|
-----
|
||||||
_/var/log/dracut.log_::
|
_/var/log/dracut.log_::
|
||||||
|
@@ -163,7 +163,7 @@ Misc
|
|||||||
Debug
|
Debug
|
||||||
~~~~~
|
~~~~~
|
||||||
If you are dropped to an emergency shell, the file
|
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
|
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.
|
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.
|
_/run/initramfs/rdsosreport.txt_ contains all logs and the output of some tools.
|
||||||
@@ -834,11 +834,39 @@ Enables debug output from the live boot process.
|
|||||||
Specifies the directory within the squashfs where the ext3fs.img or rootfs.img
|
Specifies the directory within the squashfs where the ext3fs.img or rootfs.img
|
||||||
can be found. By default, this is __LiveOS__.
|
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::
|
**rd.writable.fsimg=**1::
|
||||||
Enables writable filesystem support. The system will boot with a fully
|
Enables writable filesystem support. The system will boot with a fully
|
||||||
writable filesystem without snapshots __(see notes above about available live boot options)__.
|
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
|
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)__.
|
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
|
Plymouth Boot Splash
|
||||||
|
@@ -10,7 +10,8 @@ dracut.conf - configuration file(s) for dracut
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
--------
|
--------
|
||||||
_/etc/dracut.conf_ _/etc/dracut.conf.d/*.conf_
|
_/etc/dracut.conf_
|
||||||
|
_/etc/dracut.conf.d/\*.conf_
|
||||||
_/usr/lib/dracut/dracut.conf.d/*.conf_
|
_/usr/lib/dracut/dracut.conf.d/*.conf_
|
||||||
|
|
||||||
Description
|
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,
|
Specify additional files to include in the initramfs, separated by spaces,
|
||||||
if they exist.
|
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}__"::
|
*do_strip=*"__{yes|no}__"::
|
||||||
Strip binaries in the initramfs (default=yes)
|
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
|
Host-Only mode: Install only what is needed for booting the local host
|
||||||
instead of a generic host and generate host-specific configuration.
|
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
|
If set, store the kernel command line arguments needed in the initramfs
|
||||||
|
|
||||||
*persistent_policy=*"__<policy>__"::
|
*persistent_policy=*"__<policy>__"::
|
||||||
@@ -189,6 +197,16 @@ provide a valid _/etc/fstab_.
|
|||||||
*loginstall=*"__<DIR>__"::
|
*loginstall=*"__<DIR>__"::
|
||||||
Log all files installed from the host to _<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
|
Files
|
||||||
-----
|
-----
|
||||||
_/etc/dracut.conf_::
|
_/etc/dracut.conf_::
|
||||||
|
@@ -15,4 +15,5 @@ systemdsystemunitdir=/usr/lib/systemd/system
|
|||||||
systemdsystemconfdir=/etc/systemd/system
|
systemdsystemconfdir=/etc/systemd/system
|
||||||
udevdir=/usr/lib/udev
|
udevdir=/usr/lib/udev
|
||||||
hostonly="yes"
|
hostonly="yes"
|
||||||
|
hostonly_cmdline="no"
|
||||||
early_microcode="yes"
|
early_microcode="yes"
|
||||||
|
@@ -19,7 +19,7 @@ you can replace init with your own version of _99base_, this is not encouraged.
|
|||||||
Instead you should use, if possible, the hooks of dracut. All hooks, and the
|
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>>.
|
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
|
arguments and sets up the directory, in which everything is installed. It then
|
||||||
executes all check, install, installkernel scripts found in the modules, which
|
executes all check, install, installkernel scripts found in the modules, which
|
||||||
are to be processed. After everything is installed, the install directory is
|
are to be processed. After everything is installed, the install directory is
|
||||||
|
221
dracut.sh
221
dracut.sh
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash --norc
|
||||||
#
|
#
|
||||||
# Generator script for a dracut initramfs
|
# Generator script for a dracut initramfs
|
||||||
# Tries to retain some degree of compatibility with the command line
|
# 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)
|
--logfile [FILE] Logfile to use (overrides configuration setting)
|
||||||
--reproducible Create reproducible images
|
--reproducible Create reproducible images
|
||||||
--loginstall [DIR] Log all files installed from the host to [DIR]
|
--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.
|
If [LIST] has multiple arguments, then you have to put these in quotes.
|
||||||
|
|
||||||
@@ -389,6 +393,9 @@ rearrange_params()
|
|||||||
--long no-early-microcode \
|
--long no-early-microcode \
|
||||||
--long reproducible \
|
--long reproducible \
|
||||||
--long loginstall: \
|
--long loginstall: \
|
||||||
|
--long uefi \
|
||||||
|
--long uefi-stub: \
|
||||||
|
--long kernel-image: \
|
||||||
-- "$@")
|
-- "$@")
|
||||||
|
|
||||||
if (( $? != 0 )); then
|
if (( $? != 0 )); then
|
||||||
@@ -577,6 +584,11 @@ while :; do
|
|||||||
--regenerate-all) regenerate_all="yes";;
|
--regenerate-all) regenerate_all="yes";;
|
||||||
--noimageifnotneeded) noimageifnotneeded="yes";;
|
--noimageifnotneeded) noimageifnotneeded="yes";;
|
||||||
--reproducible) reproducible_l="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;;
|
--) shift; break;;
|
||||||
|
|
||||||
*) # should not even reach this point
|
*) # should not even reach this point
|
||||||
@@ -809,7 +821,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
|
|||||||
[[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l
|
[[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l
|
||||||
[[ $lvmconf_l ]] && lvmconf=$lvmconf_l
|
[[ $lvmconf_l ]] && lvmconf=$lvmconf_l
|
||||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
|
[[ $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_l ]] && tmpdir="$tmpdir_l"
|
||||||
[[ $tmpdir ]] || tmpdir=/var/tmp
|
[[ $tmpdir ]] || tmpdir=/var/tmp
|
||||||
[[ $INITRD_COMPRESS ]] && compress=$INITRD_COMPRESS
|
[[ $INITRD_COMPRESS ]] && compress=$INITRD_COMPRESS
|
||||||
@@ -822,6 +834,8 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
|
|||||||
[[ $logfile_l ]] && logfile="$logfile_l"
|
[[ $logfile_l ]] && logfile="$logfile_l"
|
||||||
[[ $reproducible_l ]] && reproducible="$reproducible_l"
|
[[ $reproducible_l ]] && reproducible="$reproducible_l"
|
||||||
[[ $loginstall_l ]] && loginstall="$loginstall_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
|
# eliminate IFS hackery when messing with fw_dir
|
||||||
fw_dir=${fw_dir//:/ }
|
fw_dir=${fw_dir//:/ }
|
||||||
@@ -839,7 +853,8 @@ fi
|
|||||||
# handle compression options.
|
# handle compression options.
|
||||||
[[ $compress ]] || compress="gzip"
|
[[ $compress ]] || compress="gzip"
|
||||||
case $compress in
|
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";;
|
lzma) compress="lzma -9 -T0";;
|
||||||
xz) compress="xz --check=crc32 --lzma2=dict=1MiB -T0";;
|
xz) compress="xz --check=crc32 --lzma2=dict=1MiB -T0";;
|
||||||
gzip) compress="gzip -n -9";
|
gzip) compress="gzip -n -9";
|
||||||
@@ -880,6 +895,7 @@ trap '
|
|||||||
ret=$?;
|
ret=$?;
|
||||||
[[ $keep ]] && echo "Not removing $initdir." >&2 || { [[ $initdir ]] && rm -rf -- "$initdir"; };
|
[[ $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 $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";
|
[[ $_dlogdir ]] && rm -Rf -- "$_dlogdir";
|
||||||
exit $ret;
|
exit $ret;
|
||||||
' EXIT
|
' EXIT
|
||||||
@@ -919,7 +935,7 @@ if ! [[ $print_cmdline ]]; then
|
|||||||
rm -fr -- ${initdir}/*
|
rm -fr -- ${initdir}/*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Verify bash version, current minimum is 3.1
|
# Verify bash version, current minimum is 4
|
||||||
if (( BASH_VERSINFO[0] < 4 )); then
|
if (( BASH_VERSINFO[0] < 4 )); then
|
||||||
dfatal 'You need at least Bash 4 to use dracut, sorry.'
|
dfatal 'You need at least Bash 4 to use dracut, sorry.'
|
||||||
exit 1
|
exit 1
|
||||||
@@ -1031,6 +1047,48 @@ if [[ ! $print_cmdline ]]; then
|
|||||||
fi
|
fi
|
||||||
loginstall=$(readlink -f "$loginstall")
|
loginstall=$(readlink -f "$loginstall")
|
||||||
fi
|
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
|
fi
|
||||||
|
|
||||||
if [[ $acpi_override = yes ]] && ! check_kernel_config CONFIG_ACPI_INITRD_TABLE_OVERRIDE; then
|
if [[ $acpi_override = yes ]] && ! check_kernel_config CONFIG_ACPI_INITRD_TABLE_OVERRIDE; then
|
||||||
@@ -1094,7 +1152,7 @@ done
|
|||||||
|
|
||||||
for f in $add_fstab; do
|
for f in $add_fstab; do
|
||||||
[[ -e $f ]] || continue
|
[[ -e $f ]] || continue
|
||||||
while read dev rest; do
|
while read dev rest || [ -n "$dev" ]; do
|
||||||
push_host_devs "$dev"
|
push_host_devs "$dev"
|
||||||
done < "$f"
|
done < "$f"
|
||||||
done
|
done
|
||||||
@@ -1141,11 +1199,11 @@ if [[ $hostonly ]]; then
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [[ -f /proc/swaps ]] && [[ -f /etc/fstab ]]; then
|
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
|
[[ -b $dev ]] || continue
|
||||||
[[ "$type" == "partition" ]] || 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
|
||||||
[[ $_d ]] || continue
|
[[ $_d ]] || continue
|
||||||
[[ $_t != "swap" ]] && continue
|
[[ $_t != "swap" ]] && continue
|
||||||
@@ -1155,7 +1213,7 @@ if [[ $hostonly ]]; then
|
|||||||
[[ "$_d" -ef "$dev" ]] || continue
|
[[ "$_d" -ef "$dev" ]] || continue
|
||||||
|
|
||||||
if [[ -f /etc/crypttab ]]; then
|
if [[ -f /etc/crypttab ]]; then
|
||||||
while read _mapper _a _p _o; do
|
while read _mapper _a _p _o || [ -n "$_mapper" ]; do
|
||||||
[[ $_mapper = \#* ]] && continue
|
[[ $_mapper = \#* ]] && continue
|
||||||
[[ "$_d" -ef /dev/mapper/"$_mapper" ]] || continue
|
[[ "$_d" -ef /dev/mapper/"$_mapper" ]] || continue
|
||||||
[[ "$_o" ]] || _o="$_p"
|
[[ "$_o" ]] || _o="$_p"
|
||||||
@@ -1166,7 +1224,9 @@ if [[ $hostonly ]]; then
|
|||||||
done < /etc/crypttab
|
done < /etc/crypttab
|
||||||
fi
|
fi
|
||||||
|
|
||||||
push_host_devs "$(readlink -f "$dev")"
|
_dev="$(readlink -f "$dev")"
|
||||||
|
push_host_devs "$_dev"
|
||||||
|
push swap_devs "$_dev"
|
||||||
break
|
break
|
||||||
done < /etc/fstab
|
done < /etc/fstab
|
||||||
done < /proc/swaps
|
done < /proc/swaps
|
||||||
@@ -1174,8 +1234,8 @@ if [[ $hostonly ]]; then
|
|||||||
# record all host modaliases
|
# record all host modaliases
|
||||||
declare -A host_modalias
|
declare -A host_modalias
|
||||||
find /sys/devices/ -name uevent -print > "$initdir/.modalias"
|
find /sys/devices/ -name uevent -print > "$initdir/.modalias"
|
||||||
while read m; do
|
while read m || [ -n "$m" ]; do
|
||||||
while read line; do
|
while read line || [ -n "$line" ]; do
|
||||||
[[ "$line" != MODALIAS\=* ]] && continue
|
[[ "$line" != MODALIAS\=* ]] && continue
|
||||||
modalias="${line##MODALIAS=}" && [[ $modalias ]] && host_modalias["$modalias"]=1
|
modalias="${line##MODALIAS=}" && [[ $modalias ]] && host_modalias["$modalias"]=1
|
||||||
break
|
break
|
||||||
@@ -1184,14 +1244,14 @@ if [[ $hostonly ]]; then
|
|||||||
|
|
||||||
rm -f -- "$initdir/.modalias"
|
rm -f -- "$initdir/.modalias"
|
||||||
|
|
||||||
while read _k _s _v; do
|
while read _k _s _v || [ -n "$_k" ]; do
|
||||||
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
|
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
|
||||||
host_modalias["$_v"]=1
|
host_modalias["$_v"]=1
|
||||||
done </proc/crypto
|
done </proc/crypto
|
||||||
|
|
||||||
# check /proc/modules
|
# check /proc/modules
|
||||||
declare -A host_modules
|
declare -A host_modules
|
||||||
while read m rest; do
|
while read m rest || [ -n "$m" ]; do
|
||||||
host_modules["$m"]=1
|
host_modules["$m"]=1
|
||||||
done </proc/modules
|
done </proc/modules
|
||||||
fi
|
fi
|
||||||
@@ -1277,7 +1337,7 @@ export initdir dracutbasedir \
|
|||||||
omit_drivers mdadmconf lvmconf root_dev \
|
omit_drivers mdadmconf lvmconf root_dev \
|
||||||
use_fstab fstab_lines libdirs fscks nofscks ro_mnt \
|
use_fstab fstab_lines libdirs fscks nofscks ro_mnt \
|
||||||
stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \
|
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 \
|
DRACUT_VERSION udevdir prefix filesystems drivers \
|
||||||
systemdutildir systemdsystemunitdir systemdsystemconfdir \
|
systemdutildir systemdsystemunitdir systemdsystemconfdir \
|
||||||
host_modalias host_modules hostonly_cmdline loginstall \
|
host_modalias host_modules hostonly_cmdline loginstall \
|
||||||
@@ -1291,14 +1351,24 @@ for_each_module_dir check_mount
|
|||||||
|
|
||||||
dracut_module_included "fips" && export DRACUT_FIPS_MODE=1
|
dracut_module_included "fips" && export DRACUT_FIPS_MODE=1
|
||||||
|
|
||||||
if [[ $print_cmdline ]]; then
|
do_print_cmdline()
|
||||||
modules_loaded=" "
|
{
|
||||||
|
local -A _mods_to_print
|
||||||
|
for i in $modules_loaded $mods_to_load; do
|
||||||
|
_mods_to_print[$i]=1
|
||||||
|
done
|
||||||
|
|
||||||
# source our modules.
|
# source our modules.
|
||||||
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||||
_d_mod=${moddir##*/}; _d_mod=${_d_mod#[0-9][0-9]}
|
_d_mod=${moddir##*/}; _d_mod=${_d_mod#[0-9][0-9]}
|
||||||
|
[[ ${_mods_to_print[$_d_mod]} ]] || continue
|
||||||
module_cmdline "$_d_mod"
|
module_cmdline "$_d_mod"
|
||||||
done
|
done
|
||||||
unset moddir
|
unset moddir
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ $print_cmdline ]]; then
|
||||||
|
do_print_cmdline
|
||||||
printf "\n"
|
printf "\n"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@@ -1317,7 +1387,7 @@ if [[ $prefix ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $kernel_only != yes ]]; then
|
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
|
[[ -e "${initdir}${prefix}/$d" ]] && continue
|
||||||
if [ -L "/$d" ]; then
|
if [ -L "/$d" ]; then
|
||||||
inst_symlink "/$d" "${prefix}/$d"
|
inst_symlink "/$d" "${prefix}/$d"
|
||||||
@@ -1364,36 +1434,35 @@ modules_loaded=" "
|
|||||||
# source our modules.
|
# source our modules.
|
||||||
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
for moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do
|
||||||
_d_mod=${moddir##*/}; _d_mod=${_d_mod#[0-9][0-9]}
|
_d_mod=${moddir##*/}; _d_mod=${_d_mod#[0-9][0-9]}
|
||||||
if [[ "$mods_to_load" == *\ $_d_mod\ * ]]; then
|
[[ "$mods_to_load" == *\ $_d_mod\ * ]] || continue
|
||||||
if [[ $show_modules = yes ]]; then
|
if [[ $show_modules = yes ]]; then
|
||||||
printf "%s\n" "$_d_mod"
|
printf "%s\n" "$_d_mod"
|
||||||
else
|
else
|
||||||
dinfo "*** Including module: $_d_mod ***"
|
dinfo "*** Including module: $_d_mod ***"
|
||||||
fi
|
fi
|
||||||
if [[ $kernel_only == yes ]]; then
|
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" || {
|
module_installkernel "$_d_mod" || {
|
||||||
dfatal "installkernel failed in module $_d_mod"
|
dfatal "installkernel failed in module $_d_mod"
|
||||||
exit 1
|
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
|
fi
|
||||||
mods_to_load=${mods_to_load// $_d_mod /}
|
fi
|
||||||
modules_loaded+="$_d_mod "
|
mods_to_load=${mods_to_load// $_d_mod /}
|
||||||
|
modules_loaded+="$_d_mod "
|
||||||
|
|
||||||
#print the module install size
|
#print the module install size
|
||||||
if [ -n "$printsize" ]; then
|
if [ -n "$printsize" ]; then
|
||||||
_isize_new=$(du -sk ${initdir}|cut -f1)
|
_isize_new=$(du -sk ${initdir}|cut -f1)
|
||||||
_isize_delta=$((_isize_new - _isize))
|
_isize_delta=$((_isize_new - _isize))
|
||||||
printf "%s\n" "$_d_mod install size: ${_isize_delta}k"
|
printf "%s\n" "$_d_mod install size: ${_isize_delta}k"
|
||||||
_isize=$_isize_new
|
_isize=$_isize_new
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
unset moddir
|
unset moddir
|
||||||
@@ -1452,6 +1521,7 @@ if [[ $kernel_only != yes ]]; then
|
|||||||
[ -z "${line[3]}" ] && line[3]="defaults"
|
[ -z "${line[3]}" ] && line[3]="defaults"
|
||||||
[ -z "${line[4]}" ] && line[4]="0"
|
[ -z "${line[4]}" ] && line[4]="0"
|
||||||
[ -z "${line[5]}" ] && line[5]="2"
|
[ -z "${line[5]}" ] && line[5]="2"
|
||||||
|
strstr "${line[2]}" "nfs" && line[5]="0"
|
||||||
echo "${line[@]}" >> "${initdir}/etc/fstab"
|
echo "${line[@]}" >> "${initdir}/etc/fstab"
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -1485,27 +1555,29 @@ if [[ $kernel_only != yes ]]; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while pop include_src src && pop include_target tgt; do
|
while pop include_src src && pop include_target target; do
|
||||||
if [[ $src && $tgt ]]; then
|
if [[ $src && $target ]]; then
|
||||||
if [[ -f $src ]]; then
|
if [[ -f $src ]]; then
|
||||||
inst $src $tgt
|
inst $src $target
|
||||||
else
|
else
|
||||||
ddebug "Including directory: $src"
|
ddebug "Including directory: $src"
|
||||||
destdir="${initdir}/${tgt}"
|
destdir="${initdir}/${target}"
|
||||||
mkdir -p "$destdir"
|
mkdir -p "$destdir"
|
||||||
# check for preexisting symlinks, so we can cope with the
|
# check for preexisting symlinks, so we can cope with the
|
||||||
# symlinks to $prefix
|
# symlinks to $prefix
|
||||||
for i in "$src"/*; do
|
# Objectname is a file or a directory
|
||||||
[[ -e "$i" || -h "$i" ]] || continue
|
for objectname in "$src"/*; do
|
||||||
s=${destdir}/${i#$src/}
|
[[ -e "$objectname" || -h "$objectname" ]] || continue
|
||||||
if [[ -d "$i" ]]; then
|
if [[ -d "$objectname" ]]; then
|
||||||
if ! [[ -e "$s" ]]; then
|
# objectname is a directory, let's compute the final directory name
|
||||||
mkdir -m 0755 -p "$s"
|
object_destdir=${destdir}/${objectname#$src/}
|
||||||
chmod --reference="$i" "$s"
|
if ! [[ -e "$object_destdir" ]]; then
|
||||||
|
mkdir -m 0755 -p "$object_destdir"
|
||||||
|
chmod --reference="$objectname" "$object_destdir"
|
||||||
fi
|
fi
|
||||||
cp --reflink=auto --sparse=auto -fa -t "$s" "$i"/*
|
cp --reflink=auto --sparse=auto -fa -t "$object_destdir" "$objectname"/*
|
||||||
else
|
else
|
||||||
cp --reflink=auto --sparse=auto -fa -t "$destdir" "$i"
|
cp --reflink=auto --sparse=auto -fa -t "$destdir" "$objectname"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
@@ -1565,7 +1637,7 @@ if [[ $do_strip = yes ]] && ! [[ $DRACUT_FIPS_MODE ]]; then
|
|||||||
|
|
||||||
# strip kernel modules, but do not touch signed modules
|
# strip kernel modules, but do not touch signed modules
|
||||||
find "$initdir" -type f -path '*/lib/modules/*.ko' -print0 \
|
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=$(tail -c 28 "$f")
|
||||||
[[ $SIG == '~Module signature appended~' ]] || { printf "%s\000" "$f"; }
|
[[ $SIG == '~Module signature appended~' ]] || { printf "%s\000" "$f"; }
|
||||||
done | xargs -r -0 strip -g
|
done | xargs -r -0 strip -g
|
||||||
@@ -1634,7 +1706,14 @@ if [[ $hostonly_cmdline ]] ; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
rm -f -- "$outfile"
|
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
|
if [[ $DRACUT_REPRODUCIBLE ]]; then
|
||||||
find "$initdir" -newer "$dracutbasedir/dracut-functions.sh" -print0 \
|
find "$initdir" -newer "$dracutbasedir/dracut-functions.sh" -print0 \
|
||||||
@@ -1670,7 +1749,7 @@ if ! (
|
|||||||
dfatal "dracut: creation of $outfile failed"
|
dfatal "dracut: creation of $outfile failed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
dinfo "*** Creating image file done ***"
|
dinfo "*** Creating initrd image file '$outfile' done ***"
|
||||||
|
|
||||||
if (( maxloglvl >= 5 )); then
|
if (( maxloglvl >= 5 )); then
|
||||||
if [[ $allowlocal ]]; then
|
if [[ $allowlocal ]]; then
|
||||||
@@ -1680,4 +1759,32 @@ if (( maxloglvl >= 5 )); then
|
|||||||
fi
|
fi
|
||||||
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
|
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.
|
This package contains tools to assemble the local initrd and host configuration.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-%{version}
|
%autosetup -n %{name}-%{version} -S git_am
|
||||||
cp %{SOURCE1} .
|
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
|
%build
|
||||||
%configure --systemdsystemunitdir=%{_unitdir} --bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) --libdir=%{_prefix}/lib \
|
%configure --systemdsystemunitdir=%{_unitdir} --bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) --libdir=%{_prefix}/lib \
|
||||||
%if %{without doc}
|
%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
|
> $RPM_BUILD_ROOT/etc/system-fips
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# create compat symlink
|
|
||||||
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
|
|
||||||
ln -sr $RPM_BUILD_ROOT%{_bindir}/dracut $RPM_BUILD_ROOT%{_sbindir}/dracut
|
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf -- $RPM_BUILD_ROOT
|
rm -rf -- $RPM_BUILD_ROOT
|
||||||
|
|
||||||
@@ -301,8 +286,6 @@ rm -rf -- $RPM_BUILD_ROOT
|
|||||||
%{!?_licensedir:%global license %%doc}
|
%{!?_licensedir:%global license %%doc}
|
||||||
%license COPYING lgpl-2.1.txt
|
%license COPYING lgpl-2.1.txt
|
||||||
%{_bindir}/dracut
|
%{_bindir}/dracut
|
||||||
# compat symlink
|
|
||||||
%{_sbindir}/dracut
|
|
||||||
%{_datadir}/bash-completion/completions/dracut
|
%{_datadir}/bash-completion/completions/dracut
|
||||||
%{_datadir}/bash-completion/completions/lsinitrd
|
%{_datadir}/bash-completion/completions/lsinitrd
|
||||||
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
|
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
|
||||||
@@ -324,6 +307,7 @@ rm -rf -- $RPM_BUILD_ROOT
|
|||||||
%endif
|
%endif
|
||||||
%dir %{_sysconfdir}/dracut.conf.d
|
%dir %{_sysconfdir}/dracut.conf.d
|
||||||
%dir %{dracutlibdir}/dracut.conf.d
|
%dir %{dracutlibdir}/dracut.conf.d
|
||||||
|
%{_datadir}/pkgconfig/dracut.pc
|
||||||
|
|
||||||
%if %{with doc}
|
%if %{with doc}
|
||||||
%{_mandir}/man8/dracut.8*
|
%{_mandir}/man8/dracut.8*
|
||||||
@@ -345,6 +329,8 @@ rm -rf -- $RPM_BUILD_ROOT
|
|||||||
%{dracutlibdir}/modules.d/00bootchart
|
%{dracutlibdir}/modules.d/00bootchart
|
||||||
%endif
|
%endif
|
||||||
%{dracutlibdir}/modules.d/00bash
|
%{dracutlibdir}/modules.d/00bash
|
||||||
|
%{dracutlibdir}/modules.d/00systemd
|
||||||
|
%{dracutlibdir}/modules.d/01systemd-initrd
|
||||||
%{dracutlibdir}/modules.d/03modsign
|
%{dracutlibdir}/modules.d/03modsign
|
||||||
%{dracutlibdir}/modules.d/03rescue
|
%{dracutlibdir}/modules.d/03rescue
|
||||||
%{dracutlibdir}/modules.d/04watchdog
|
%{dracutlibdir}/modules.d/04watchdog
|
||||||
@@ -389,7 +375,7 @@ rm -rf -- $RPM_BUILD_ROOT
|
|||||||
%{dracutlibdir}/modules.d/98pollcdrom
|
%{dracutlibdir}/modules.d/98pollcdrom
|
||||||
%{dracutlibdir}/modules.d/98selinux
|
%{dracutlibdir}/modules.d/98selinux
|
||||||
%{dracutlibdir}/modules.d/98syslog
|
%{dracutlibdir}/modules.d/98syslog
|
||||||
%{dracutlibdir}/modules.d/98systemd
|
%{dracutlibdir}/modules.d/98dracut-systemd
|
||||||
%{dracutlibdir}/modules.d/98usrmount
|
%{dracutlibdir}/modules.d/98usrmount
|
||||||
%{dracutlibdir}/modules.d/99base
|
%{dracutlibdir}/modules.d/99base
|
||||||
%{dracutlibdir}/modules.d/99fs-lib
|
%{dracutlibdir}/modules.d/99fs-lib
|
||||||
@@ -422,7 +408,9 @@ rm -rf -- $RPM_BUILD_ROOT
|
|||||||
|
|
||||||
%files network
|
%files network
|
||||||
%defattr(-,root,root,0755)
|
%defattr(-,root,root,0755)
|
||||||
|
%{dracutlibdir}/modules.d/02systemd-networkd
|
||||||
%{dracutlibdir}/modules.d/40network
|
%{dracutlibdir}/modules.d/40network
|
||||||
|
%{dracutlibdir}/modules.d/90kernel-network-modules
|
||||||
%{dracutlibdir}/modules.d/95fcoe
|
%{dracutlibdir}/modules.d/95fcoe
|
||||||
%{dracutlibdir}/modules.d/95iscsi
|
%{dracutlibdir}/modules.d/95iscsi
|
||||||
%{dracutlibdir}/modules.d/90livenet
|
%{dracutlibdir}/modules.d/90livenet
|
||||||
|
@@ -222,7 +222,7 @@ static int cp(const char *src, const char *dst)
|
|||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
struct timeval tv[2];
|
struct timeval tv[2];
|
||||||
if (fchown(dest_desc, sb.st_uid, sb.st_gid) != 0)
|
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);
|
log_error("Failed to chown %s: %m", dst);
|
||||||
tv[0].tv_sec = sb.st_atime;
|
tv[0].tv_sec = sb.st_atime;
|
||||||
tv[0].tv_usec = 0;
|
tv[0].tv_usec = 0;
|
||||||
@@ -388,6 +388,11 @@ static int resolve_deps(const char *src)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* musl ldd */
|
||||||
|
if (strstr(buf, "Not a valid dynamic program"))
|
||||||
|
break;
|
||||||
|
|
||||||
|
/* glibc */
|
||||||
if (strstr(buf, "not a dynamic executable"))
|
if (strstr(buf, "not a dynamic executable"))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@@ -20,6 +20,8 @@
|
|||||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
||||||
***/
|
***/
|
||||||
|
|
||||||
|
#define _GNU_SOURCE
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
@@ -27,6 +29,7 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
17
lsinitrd.sh
17
lsinitrd.sh
@@ -108,6 +108,12 @@ if ! [[ -f "$image" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
dracutlibdirs() {
|
||||||
|
for d in lib64/dracut lib/dracut usr/lib64/dracut usr/lib/dracut; do
|
||||||
|
echo "$d/$1"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
extract_files()
|
extract_files()
|
||||||
{
|
{
|
||||||
(( ${#filenames[@]} == 1 )) && nofileinfo=1
|
(( ${#filenames[@]} == 1 )) && nofileinfo=1
|
||||||
@@ -124,7 +130,8 @@ extract_files()
|
|||||||
list_modules()
|
list_modules()
|
||||||
{
|
{
|
||||||
echo "dracut 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+=$?))
|
((ret+=$?))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,7 +149,7 @@ list_files()
|
|||||||
|
|
||||||
|
|
||||||
if (( ${#filenames[@]} <= 0 )); then
|
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 "========================================================================"
|
echo "========================================================================"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -217,7 +224,8 @@ ret=0
|
|||||||
if (( ${#filenames[@]} > 0 )); then
|
if (( ${#filenames[@]} > 0 )); then
|
||||||
extract_files
|
extract_files
|
||||||
else
|
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+=$?))
|
((ret+=$?))
|
||||||
echo "Version: $version"
|
echo "Version: $version"
|
||||||
echo
|
echo
|
||||||
@@ -226,7 +234,8 @@ else
|
|||||||
echo "========================================================================"
|
echo "========================================================================"
|
||||||
else
|
else
|
||||||
echo -n "Arguments: "
|
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
|
echo
|
||||||
list_modules
|
list_modules
|
||||||
list_files
|
list_files
|
||||||
|
@@ -51,14 +51,14 @@ install() {
|
|||||||
$systemdsystemunitdir/basic.target \
|
$systemdsystemunitdir/basic.target \
|
||||||
$systemdsystemunitdir/halt.target \
|
$systemdsystemunitdir/halt.target \
|
||||||
$systemdsystemunitdir/kexec.target \
|
$systemdsystemunitdir/kexec.target \
|
||||||
$systemdsystemunitdir/initrd.target \
|
|
||||||
$systemdsystemunitdir/initrd-fs.target \
|
|
||||||
$systemdsystemunitdir/initrd-root-fs.target \
|
|
||||||
$systemdsystemunitdir/local-fs.target \
|
$systemdsystemunitdir/local-fs.target \
|
||||||
$systemdsystemunitdir/local-fs-pre.target \
|
$systemdsystemunitdir/local-fs-pre.target \
|
||||||
$systemdsystemunitdir/remote-fs.target \
|
$systemdsystemunitdir/remote-fs.target \
|
||||||
$systemdsystemunitdir/remote-fs-pre.target \
|
$systemdsystemunitdir/remote-fs-pre.target \
|
||||||
|
$systemdsystemunitdir/multi-user.target \
|
||||||
$systemdsystemunitdir/network.target \
|
$systemdsystemunitdir/network.target \
|
||||||
|
$systemdsystemunitdir/network-pre.target \
|
||||||
|
$systemdsystemunitdir/network-online.target \
|
||||||
$systemdsystemunitdir/nss-lookup.target \
|
$systemdsystemunitdir/nss-lookup.target \
|
||||||
$systemdsystemunitdir/nss-user-lookup.target \
|
$systemdsystemunitdir/nss-user-lookup.target \
|
||||||
$systemdsystemunitdir/poweroff.target \
|
$systemdsystemunitdir/poweroff.target \
|
||||||
@@ -98,6 +98,7 @@ install() {
|
|||||||
$systemdsystemunitdir/systemd-journald.service \
|
$systemdsystemunitdir/systemd-journald.service \
|
||||||
$systemdsystemunitdir/systemd-vconsole-setup.service \
|
$systemdsystemunitdir/systemd-vconsole-setup.service \
|
||||||
$systemdsystemunitdir/systemd-random-seed-load.service \
|
$systemdsystemunitdir/systemd-random-seed-load.service \
|
||||||
|
$systemdsystemunitdir/systemd-random-seed.service \
|
||||||
$systemdsystemunitdir/systemd-sysctl.service \
|
$systemdsystemunitdir/systemd-sysctl.service \
|
||||||
\
|
\
|
||||||
$systemdsystemunitdir/sysinit.target.wants/systemd-modules-load.service \
|
$systemdsystemunitdir/sysinit.target.wants/systemd-modules-load.service \
|
||||||
@@ -115,19 +116,20 @@ install() {
|
|||||||
$systemdsystemunitdir/sysinit.target.wants/systemd-sysctl.service \
|
$systemdsystemunitdir/sysinit.target.wants/systemd-sysctl.service \
|
||||||
\
|
\
|
||||||
$systemdsystemunitdir/ctrl-alt-del.target \
|
$systemdsystemunitdir/ctrl-alt-del.target \
|
||||||
|
$systemdsystemunitdir/reboot.target \
|
||||||
|
$systemdsystemunitdir/systemd-reboot.service \
|
||||||
$systemdsystemunitdir/syslog.socket \
|
$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/slices.target \
|
||||||
$systemdsystemunitdir/system.slice \
|
$systemdsystemunitdir/system.slice \
|
||||||
\
|
\
|
||||||
$tmpfilesdir/systemd.conf \
|
$tmpfilesdir/systemd.conf \
|
||||||
\
|
\
|
||||||
journalctl systemctl echo swapoff systemd-cgls systemd-tmpfiles
|
journalctl systemctl \
|
||||||
|
echo swapoff \
|
||||||
|
kmod insmod rmmod modprobe modinfo depmod lsmod \
|
||||||
|
mount umount reboot poweroff \
|
||||||
|
systemd-cgls systemd-tmpfiles
|
||||||
|
|
||||||
inst_multiple -o \
|
inst_multiple -o \
|
||||||
/usr/lib/modules-load.d/*.conf \
|
/usr/lib/modules-load.d/*.conf \
|
||||||
@@ -137,7 +139,7 @@ install() {
|
|||||||
local _line i
|
local _line i
|
||||||
for i in "$1"/*.conf; do
|
for i in "$1"/*.conf; do
|
||||||
[[ -f $i ]] || continue
|
[[ -f $i ]] || continue
|
||||||
while read _line; do
|
while read _line || [ -n "$_line" ]; do
|
||||||
case $_line in
|
case $_line in
|
||||||
\#*)
|
\#*)
|
||||||
;;
|
;;
|
||||||
@@ -175,30 +177,15 @@ install() {
|
|||||||
|
|
||||||
# install adm user/group for journald
|
# install adm user/group for journald
|
||||||
inst_multiple nologin
|
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 '^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 "/init"
|
||||||
ln_r $systemdutildir/systemd "/sbin/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
|
inst_binary true
|
||||||
ln_r $(type -P true) "/usr/bin/loginctl"
|
ln_r $(type -P true) "/usr/bin/loginctl"
|
||||||
ln_r $(type -P true) "/bin/loginctl"
|
ln_r $(type -P true) "/bin/loginctl"
|
||||||
@@ -211,8 +198,7 @@ install() {
|
|||||||
|
|
||||||
for i in \
|
for i in \
|
||||||
emergency.target \
|
emergency.target \
|
||||||
dracut-emergency.service \
|
rescue.target \
|
||||||
rescue.service \
|
|
||||||
systemd-ask-password-console.service \
|
systemd-ask-password-console.service \
|
||||||
systemd-ask-password-plymouth.service \
|
systemd-ask-password-plymouth.service \
|
||||||
; do
|
; do
|
||||||
@@ -221,24 +207,6 @@ install() {
|
|||||||
"${systemdsystemunitdir}/${i}.wants/systemd-vconsole-setup.service"
|
"${systemdsystemunitdir}/${i}.wants/systemd-vconsole-setup.service"
|
||||||
done
|
done
|
||||||
|
|
||||||
mkdir -p "${initdir}/$systemdsystemunitdir/initrd.target.wants"
|
|
||||||
for i in \
|
|
||||||
dracut-cmdline.service \
|
|
||||||
dracut-cmdline-ask.service \
|
|
||||||
dracut-initqueue.service \
|
|
||||||
dracut-mount.service \
|
|
||||||
dracut-pre-mount.service \
|
|
||||||
dracut-pre-pivot.service \
|
|
||||||
dracut-pre-trigger.service \
|
|
||||||
dracut-pre-udev.service \
|
|
||||||
; do
|
|
||||||
inst_simple "$moddir/${i}" "$systemdsystemunitdir/${i}"
|
|
||||||
ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/initrd.target.wants/${i}"
|
|
||||||
done
|
|
||||||
|
|
||||||
inst_simple "$moddir/dracut-tmpfiles.conf" "$tmpfilesdir/dracut-tmpfiles.conf"
|
|
||||||
|
|
||||||
|
|
||||||
mkdir -p "$initdir/etc/systemd"
|
mkdir -p "$initdir/etc/systemd"
|
||||||
# turn off RateLimit for journal
|
# turn off RateLimit for journal
|
||||||
{
|
{
|
||||||
@@ -247,5 +215,6 @@ install() {
|
|||||||
echo "RateLimitBurst=0"
|
echo "RateLimitBurst=0"
|
||||||
} >> "$initdir/etc/systemd/journald.conf"
|
} >> "$initdir/etc/systemd/journald.conf"
|
||||||
|
|
||||||
|
ln_r "${systemdsystemunitdir}/multi-user.target" "${systemdsystemunitdir}/default.target"
|
||||||
}
|
}
|
||||||
|
|
@@ -59,8 +59,8 @@ do_rhevh_check()
|
|||||||
kpath=${1}
|
kpath=${1}
|
||||||
|
|
||||||
# If we're on RHEV-H, the kernel is in /run/initramfs/live/vmlinuz0
|
# 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_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; do printf "%s\n" $a; done || return 1)
|
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
|
if [ -z "$HMAC_SUM_ORIG" ] || [ -z "$HMAC_SUM_CALC" ] || [ "${HMAC_SUM_ORIG}" != "${HMAC_SUM_CALC}" ]; then
|
||||||
warn "HMAC sum mismatch"
|
warn "HMAC sum mismatch"
|
||||||
return 1
|
return 1
|
||||||
@@ -92,7 +92,7 @@ do_fips()
|
|||||||
if ! modprobe "${_module}"; then
|
if ! modprobe "${_module}"; then
|
||||||
# check if kernel provides generic algo
|
# check if kernel provides generic algo
|
||||||
_found=0
|
_found=0
|
||||||
while read _k _s _v; do
|
while read _k _s _v || [ -n "$_k" ]; do
|
||||||
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
|
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
|
||||||
[ "$_v" != "$_module" ] && continue
|
[ "$_v" != "$_module" ] && continue
|
||||||
_found=1
|
_found=1
|
||||||
|
@@ -14,10 +14,11 @@ depends() {
|
|||||||
installkernel() {
|
installkernel() {
|
||||||
local _fipsmodules _mod
|
local _fipsmodules _mod
|
||||||
_fipsmodules="aead aes_generic aes-x86_64 ansi_cprng arc4 blowfish camellia cast6 cbc ccm "
|
_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+="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+="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+="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"
|
mkdir -m 0755 -p "${initdir}/etc/modprobe.d"
|
||||||
|
|
||||||
|
68
modules.d/01systemd-initrd/module-setup.sh
Executable file
68
modules.d/01systemd-initrd/module-setup.sh
Executable file
@@ -0,0 +1,68 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# called by dracut
|
||||||
|
check() {
|
||||||
|
[[ $mount_needs ]] && return 1
|
||||||
|
|
||||||
|
if ! dracut_module_included "systemd"; then
|
||||||
|
derror "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
|
if [ "$capsmode" = "1" ]; then
|
||||||
CAPS_INIT_DROP=$(getarg rd.caps.initdrop=)
|
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_MODULES_DISABLED=$(getarg rd.caps.disablemodules=)
|
||||||
CAPS_KEXEC_DISABLED=$(getarg rd.caps.disablekexec=)
|
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 ;;
|
*) cmd=grep ;;
|
||||||
esac
|
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
|
for FN in $(find ${kbddir}/keymaps -type f -name $INCL\*); do
|
||||||
findkeymap $FN
|
findkeymap $FN
|
||||||
done
|
done
|
||||||
@@ -114,12 +114,12 @@ install() {
|
|||||||
rm -f -- "${initdir}${kbddir}/consoletrans/utflist"
|
rm -f -- "${initdir}${kbddir}/consoletrans/utflist"
|
||||||
find "${initdir}${kbddir}/" -name README\* -delete
|
find "${initdir}${kbddir}/" -name README\* -delete
|
||||||
find "${initdir}${kbddir}/" -name '*.gz' -print -quit \
|
find "${initdir}${kbddir}/" -name '*.gz' -print -quit \
|
||||||
| while read line; do
|
| while read line || [ -n "$line" ]; do
|
||||||
inst_multiple gzip
|
inst_multiple gzip
|
||||||
done
|
done
|
||||||
|
|
||||||
find "${initdir}${kbddir}/" -name '*.bz2' -print -quit \
|
find "${initdir}${kbddir}/" -name '*.bz2' -print -quit \
|
||||||
| while read line; do
|
| while read line || [ -n "$line" ]; do
|
||||||
inst_multiple bzip2
|
inst_multiple bzip2
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
@@ -74,7 +74,7 @@ rm -f -- "$testfile"
|
|||||||
find_mount() {
|
find_mount() {
|
||||||
local dev mnt etc wanted_dev
|
local dev mnt etc wanted_dev
|
||||||
wanted_dev="$(readlink -e -q $1)"
|
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
|
[ "$dev" = "$wanted_dev" ] && echo "$dev" && return 0
|
||||||
done < /proc/mounts
|
done < /proc/mounts
|
||||||
return 1
|
return 1
|
||||||
@@ -93,7 +93,7 @@ else
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
while read a m a; do
|
while read a m a || [ -n "$m" ]; do
|
||||||
[ "$m" = "$1" ] && return 0
|
[ "$m" = "$1" ] && return 0
|
||||||
done < /proc/mounts
|
done < /proc/mounts
|
||||||
return 1
|
return 1
|
||||||
|
@@ -43,7 +43,13 @@ setup_interface() {
|
|||||||
valid_lft ${lease_time} preferred_lft ${lease_time} \
|
valid_lft ${lease_time} preferred_lft ${lease_time} \
|
||||||
dev $netif
|
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
|
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
|
||||||
if [ -n "$namesrv" ] ; then
|
if [ -n "$namesrv" ] ; then
|
||||||
@@ -93,8 +99,9 @@ case $reason in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
PREINIT6)
|
PREINIT6)
|
||||||
echo "dhcp: PREINIT $netif up"
|
echo "dhcp: PREINIT6 $netif up"
|
||||||
linkup $netif
|
linkup $netif
|
||||||
|
wait_for_ipv6_dad $netif
|
||||||
;;
|
;;
|
||||||
|
|
||||||
BOUND)
|
BOUND)
|
||||||
@@ -111,7 +118,7 @@ case $reason in
|
|||||||
fi
|
fi
|
||||||
unset layer2
|
unset layer2
|
||||||
setup_interface
|
setup_interface
|
||||||
set | while read line; do
|
set | while read line || [ -n "$line" ]; do
|
||||||
[ "${line#new_}" = "$line" ] && continue
|
[ "${line#new_}" = "$line" ] && continue
|
||||||
echo "$line"
|
echo "$line"
|
||||||
done >/tmp/dhclient.$netif.dhcpopts
|
done >/tmp/dhclient.$netif.dhcpopts
|
||||||
@@ -132,7 +139,7 @@ case $reason in
|
|||||||
echo "dhcp: BOND6 setting $netif"
|
echo "dhcp: BOND6 setting $netif"
|
||||||
setup_interface6
|
setup_interface6
|
||||||
|
|
||||||
set | while read line; do
|
set | while read line || [ -n "$line" ]; do
|
||||||
[ "${line#new_}" = "$line" ] && continue
|
[ "${line#new_}" = "$line" ] && continue
|
||||||
echo "$line"
|
echo "$line"
|
||||||
done >/tmp/dhclient.$netif.dhcpopts
|
done >/tmp/dhclient.$netif.dhcpopts
|
||||||
|
@@ -11,61 +11,13 @@ check() {
|
|||||||
|
|
||||||
# called by dracut
|
# called by dracut
|
||||||
depends() {
|
depends() {
|
||||||
|
echo "kernel-network-modules"
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# called by dracut
|
# called by dracut
|
||||||
installkernel() {
|
installkernel() {
|
||||||
# Include wired net drivers, excluding wireless
|
return 0
|
||||||
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
|
# called by dracut
|
||||||
|
@@ -94,13 +94,13 @@ setup_net() {
|
|||||||
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
|
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
|
||||||
[ -z "$IFACES" ] && IFACES="$netif"
|
[ -z "$IFACES" ] && IFACES="$netif"
|
||||||
# run the scripts written by ifup
|
# 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.hostname ] && . /tmp/net.$netif.hostname
|
||||||
[ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
[ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
||||||
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||||
# set up resolv.conf
|
# set up resolv.conf
|
||||||
[ -e /tmp/net.$netif.resolv.conf ] && \
|
[ -e /tmp/net.$netif.resolv.conf ] && \
|
||||||
cp -f /tmp/net.$netif.resolv.conf /etc/resolv.conf
|
cp -f /tmp/net.$netif.resolv.conf /etc/resolv.conf
|
||||||
|
[ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw
|
||||||
|
|
||||||
# add static route
|
# add static route
|
||||||
for _p in $(getargs rd.route); do
|
for _p in $(getargs rd.route); do
|
||||||
@@ -520,7 +520,7 @@ wait_for_ipv6_dad() {
|
|||||||
local cnt=0
|
local cnt=0
|
||||||
local li
|
local li
|
||||||
while [ $cnt -lt 500 ]; do
|
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
|
strstr "$li" "tentative" || return 0
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
cnt=$(($cnt+1))
|
cnt=$(($cnt+1))
|
||||||
@@ -554,13 +554,18 @@ type hostname >/dev/null 2>&1 || \
|
|||||||
}
|
}
|
||||||
|
|
||||||
iface_has_link() {
|
iface_has_link() {
|
||||||
|
local cnt=0
|
||||||
local interface="$1" flags=""
|
local interface="$1" flags=""
|
||||||
[ -n "$interface" ] || return 2
|
[ -n "$interface" ] || return 2
|
||||||
interface="/sys/class/net/$interface"
|
interface="/sys/class/net/$interface"
|
||||||
[ -d "$interface" ] || return 2
|
[ -d "$interface" ] || return 2
|
||||||
linkup "$1"
|
linkup "$1"
|
||||||
[ "$(cat $interface/carrier)" = 1 ] || return 1
|
while [ $cnt -lt 50 ]; do
|
||||||
# XXX Do we need to reset the flags here? anaconda never bothered..
|
[ "$(cat $interface/carrier)" = 1 ] && return 0
|
||||||
|
sleep 0.1
|
||||||
|
cnt=$(($cnt+1))
|
||||||
|
done
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
find_iface_with_link() {
|
find_iface_with_link() {
|
||||||
|
@@ -22,7 +22,7 @@ get_config_line_by_subchannel()
|
|||||||
local line
|
local line
|
||||||
|
|
||||||
CHANNELS="$1"
|
CHANNELS="$1"
|
||||||
while read line; do
|
while read line || [ -n "$line" ]; do
|
||||||
if strstr "$line" "$CHANNELS"; then
|
if strstr "$line" "$CHANNELS"; then
|
||||||
echo $line
|
echo $line
|
||||||
return 0
|
return 0
|
||||||
@@ -137,6 +137,8 @@ for netup in /tmp/net.*.did-setup ; do
|
|||||||
unset macaddr
|
unset macaddr
|
||||||
unset slave
|
unset slave
|
||||||
unset ethname
|
unset ethname
|
||||||
|
unset vlan
|
||||||
|
|
||||||
[ -e /tmp/bond.${netif}.info ] && . /tmp/bond.${netif}.info
|
[ -e /tmp/bond.${netif}.info ] && . /tmp/bond.${netif}.info
|
||||||
|
|
||||||
uuid=$(cat /proc/sys/kernel/random/uuid)
|
uuid=$(cat /proc/sys/kernel/random/uuid)
|
||||||
|
@@ -120,7 +120,7 @@ command -v ctorrent >/dev/null \
|
|||||||
|
|
||||||
nfs_already_mounted() {
|
nfs_already_mounted() {
|
||||||
local server="$1" path="$2" localdir="" s="" p=""
|
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
|
splitsep ":" "$src" s p
|
||||||
if [ "$server" = "$s" ]; then
|
if [ "$server" = "$s" ]; then
|
||||||
if [ "$path" = "$p" ]; then
|
if [ "$path" = "$p" ]; then
|
||||||
|
@@ -22,7 +22,7 @@ installkernel() {
|
|||||||
local _merge=8 _side2=9
|
local _merge=8 _side2=9
|
||||||
function nmf1() {
|
function nmf1() {
|
||||||
local _fname _fcont
|
local _fname _fcont
|
||||||
while read _fname; do
|
while read _fname || [ -n "$_fname" ]; do
|
||||||
case "$_fname" in
|
case "$_fname" in
|
||||||
*.ko) _fcont="$(< $_fname)" ;;
|
*.ko) _fcont="$(< $_fname)" ;;
|
||||||
*.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
|
*.ko.gz) _fcont="$(gzip -dc $_fname)" ;;
|
||||||
@@ -35,7 +35,7 @@ installkernel() {
|
|||||||
}
|
}
|
||||||
function rotor() {
|
function rotor() {
|
||||||
local _f1 _f2
|
local _f1 _f2
|
||||||
while read _f1; do
|
while read _f1 || [ -n "$_f1" ]; do
|
||||||
echo "$_f1"
|
echo "$_f1"
|
||||||
if read _f2; then
|
if read _f2; then
|
||||||
echo "$_f2" 1>&${_side2}
|
echo "$_f2" 1>&${_side2}
|
||||||
@@ -60,6 +60,8 @@ installkernel() {
|
|||||||
${NULL}
|
${NULL}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
instmods amdkfd hyperv_fb
|
||||||
|
|
||||||
for _modname in $(find_kernel_modules_by_path drivers/gpu/drm \
|
for _modname in $(find_kernel_modules_by_path drivers/gpu/drm \
|
||||||
| drm_module_filter) ; do
|
| drm_module_filter) ; do
|
||||||
# if the hardware is present, include module even if it is not currently loaded,
|
# 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' \
|
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
|
| grep -qxf - /sys/bus/{pci/devices,soc/devices/soc?}/*/modalias 2>/dev/null; then
|
||||||
hostonly='' instmods $_modname
|
hostonly='' instmods $_modname
|
||||||
|
# if radeon.ko is installed, we want amdkfd also
|
||||||
|
if strstr "$_modname" radeon.ko; then
|
||||||
|
hostonly='' instmods amdkfd
|
||||||
|
fi
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
instmods $_modname
|
instmods $_modname
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
# called by dracut
|
# called by dracut
|
||||||
check() {
|
check() {
|
||||||
[[ "$mount_needs" ]] && return 1
|
[[ "$mount_needs" ]] && return 1
|
||||||
require_binaries plymouthd plymouth
|
require_binaries plymouthd plymouth plymouth-set-default-theme
|
||||||
}
|
}
|
||||||
|
|
||||||
# called by dracut
|
# called by dracut
|
||||||
|
@@ -26,7 +26,7 @@ if [[ $hostonly ]]; then
|
|||||||
if [ -L /usr/share/plymouth/themes/default.plymouth ]; then
|
if [ -L /usr/share/plymouth/themes/default.plymouth ]; then
|
||||||
inst /usr/share/plymouth/themes/default.plymouth
|
inst /usr/share/plymouth/themes/default.plymouth
|
||||||
# Install plugin for this theme
|
# 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"
|
inst_libdir_file "plymouth/${PLYMOUTH_PLUGIN}.so"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
@@ -42,7 +42,7 @@ function dasd_settle() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function dasd_settle_all() {
|
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
|
if ! dasd_settle $dasdccw ; then
|
||||||
echo $"Could not access DASD $dasdccw in time"
|
echo $"Could not access DASD $dasdccw in time"
|
||||||
return 1
|
return 1
|
||||||
@@ -84,7 +84,7 @@ function readcmsfile() # $1=dasdport $2=filename
|
|||||||
# dasd_mod must be loaded without setting any DASD online
|
# dasd_mod must be loaded without setting any DASD online
|
||||||
dev=$(canonicalize_devno $1)
|
dev=$(canonicalize_devno $1)
|
||||||
numcpus=$(
|
numcpus=$(
|
||||||
while read line; do
|
while read line || [ -n "$line" ]; do
|
||||||
if strstr "$line" "# processors"; then
|
if strstr "$line" "# processors"; then
|
||||||
echo ${line##*:};
|
echo ${line##*:};
|
||||||
break;
|
break;
|
||||||
@@ -181,7 +181,7 @@ processcmsfile()
|
|||||||
|
|
||||||
unset _do_zfcp
|
unset _do_zfcp
|
||||||
for i in ${!FCP_*}; do
|
for i in ${!FCP_*}; do
|
||||||
echo "${!i}" | while read port rest; do
|
echo "${!i}" | while read port rest || [ -n "$port" ]; do
|
||||||
case $port in
|
case $port in
|
||||||
*.*.*)
|
*.*.*)
|
||||||
;;
|
;;
|
||||||
|
@@ -7,7 +7,7 @@ crypttab_contains() {
|
|||||||
local luks="$1"
|
local luks="$1"
|
||||||
local l d rest
|
local l d rest
|
||||||
if [ -f /etc/crypttab ]; then
|
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 "${l##luks-}" "${luks##luks-}" && return 0
|
||||||
strstr "$d" "${luks##luks-}" && return 0
|
strstr "$d" "${luks##luks-}" && return 0
|
||||||
done < /etc/crypttab
|
done < /etc/crypttab
|
||||||
@@ -42,10 +42,10 @@ ask_for_password() {
|
|||||||
|
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
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;;
|
--ply-cmd) ply_cmd="$2"; shift;;
|
||||||
--tty-cmd) tty_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;;
|
--ply-prompt) ply_prompt="$2"; shift;;
|
||||||
--tty-prompt) tty_prompt="$2"; shift;;
|
--tty-prompt) tty_prompt="$2"; shift;;
|
||||||
--tries) ply_tries="$2"; tty_tries="$2"; shift;;
|
--tries) ply_tries="$2"; tty_tries="$2"; shift;;
|
||||||
@@ -155,7 +155,7 @@ getkey() {
|
|||||||
[ -f "$keys_file" ] || return 1
|
[ -f "$keys_file" ] || return 1
|
||||||
|
|
||||||
local IFS=:
|
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
|
if match_dev "$luks_dev" "$for_dev"; then
|
||||||
echo "${key_dev}:${key_path}"
|
echo "${key_dev}:${key_path}"
|
||||||
return 0
|
return 0
|
||||||
|
@@ -23,7 +23,7 @@ numtries=${3:-10}
|
|||||||
|
|
||||||
# TODO: improve to support what cmdline does
|
# TODO: improve to support what cmdline does
|
||||||
if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -d -n rd_NO_CRYPTTAB; then
|
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
|
# ignore blank lines and comments
|
||||||
if [ -z "$name" -o "${name#\#}" != "$name" ]; then
|
if [ -z "$name" -o "${name#\#}" != "$name" ]; then
|
||||||
continue
|
continue
|
||||||
|
@@ -35,7 +35,7 @@ cmdline() {
|
|||||||
|
|
||||||
UUID=$(
|
UUID=$(
|
||||||
blkid -u crypto -o export $dev \
|
blkid -u crypto -o export $dev \
|
||||||
| while read line; do
|
| while read line || [ -n "$line" ]; do
|
||||||
[[ ${line#UUID} = $line ]] && continue
|
[[ ${line#UUID} = $line ]] && continue
|
||||||
printf "%s" "${line#UUID=}"
|
printf "%s" "${line#UUID=}"
|
||||||
break
|
break
|
||||||
@@ -65,7 +65,7 @@ install() {
|
|||||||
|
|
||||||
if [[ $hostonly ]] && [[ -f /etc/crypttab ]]; then
|
if [[ $hostonly ]] && [[ -f /etc/crypttab ]]; then
|
||||||
# filter /etc/crypttab for the devices we need
|
# filter /etc/crypttab for the devices we need
|
||||||
while read _mapper _dev _rest; do
|
while read _mapper _dev _rest || [ -n "$_mapper" ]; do
|
||||||
[[ $_mapper = \#* ]] && continue
|
[[ $_mapper = \#* ]] && continue
|
||||||
[[ $_dev ]] || continue
|
[[ $_dev ]] || continue
|
||||||
|
|
||||||
|
@@ -14,6 +14,12 @@ else
|
|||||||
LUKS=$(getargs rd.luks.uuid -d rd_LUKS_UUID)
|
LUKS=$(getargs rd.luks.uuid -d rd_LUKS_UUID)
|
||||||
tout=$(getarg rd.luks.key.tout)
|
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
|
if [ -n "$LUKS" ]; then
|
||||||
for luksid in $LUKS; do
|
for luksid in $LUKS; do
|
||||||
|
|
||||||
|
@@ -1,11 +1,12 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
_do_dm_shutdown() {
|
_do_dm_shutdown() {
|
||||||
local ret
|
local ret=0
|
||||||
local final=$1
|
local final=$1
|
||||||
info "Disassembling device-mapper devices"
|
info "Disassembling device-mapper devices"
|
||||||
dmsetup -v remove_all
|
for dev in $(dmsetup info -c --noheadings -o name) ; do
|
||||||
ret=$?
|
dmsetup -v --noudevsync remove "$dev" || ret=$?
|
||||||
|
done
|
||||||
if [ "x$final" != "x" ]; then
|
if [ "x$final" != "x" ]; then
|
||||||
info "dmsetup ls --tree"
|
info "dmsetup ls --tree"
|
||||||
dmsetup ls --tree 2>&1 | vinfo
|
dmsetup ls --tree 2>&1 | vinfo
|
||||||
|
@@ -37,6 +37,7 @@ if [ -n "$DM_RAIDS" ] || getargbool 0 rd.auto; then
|
|||||||
info "Activating $s"
|
info "Activating $s"
|
||||||
dmraid -ay -i -p --rm_partitions "$s" 2>&1 | vinfo
|
dmraid -ay -i -p --rm_partitions "$s" 2>&1 | vinfo
|
||||||
[ -e "/dev/mapper/$s" ] && kpartx -a "/dev/mapper/$s" 2>&1 | vinfo
|
[ -e "/dev/mapper/$s" ] && kpartx -a "/dev/mapper/$s" 2>&1 | vinfo
|
||||||
|
udevsettle
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -1,17 +1,20 @@
|
|||||||
#!/bin/sh
|
#!/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..."
|
info "Applying updates to live image..."
|
||||||
mount -o bind /run $NEWROOT/run
|
mount -o bind /run $NEWROOT/run
|
||||||
# avoid overwriting symlinks (e.g. /lib -> /usr/lib) with directories
|
# avoid overwriting symlinks (e.g. /lib -> /usr/lib) with directories
|
||||||
(
|
for d in /updates /run/initramfs/live/updates; do
|
||||||
cd /updates
|
[ -d "$d" ] || continue
|
||||||
find . -depth -type d | while read dir; do
|
(
|
||||||
mkdir -p "$NEWROOT/$dir"
|
cd $d
|
||||||
done
|
find . -depth -type d | while read dir; do
|
||||||
find . -depth \! -type d | while read file; do
|
mkdir -p "$NEWROOT/$dir"
|
||||||
cp -a "$file" "$NEWROOT/$file"
|
done
|
||||||
done
|
find . -depth \! -type d | while read file; do
|
||||||
)
|
cp -a "$file" "$NEWROOT/$file"
|
||||||
|
done
|
||||||
|
)
|
||||||
|
done
|
||||||
umount $NEWROOT/run
|
umount $NEWROOT/run
|
||||||
fi
|
fi
|
||||||
|
@@ -30,6 +30,8 @@ getargbool 0 rd.writable.fsimg -d -y writable_fsimg && writable_fsimg="yes"
|
|||||||
overlay_size=$(getarg rd.live.overlay.size=)
|
overlay_size=$(getarg rd.live.overlay.size=)
|
||||||
[ -z "$overlay_size" ] && overlay_size=512
|
[ -z "$overlay_size" ] && overlay_size=512
|
||||||
|
|
||||||
|
getargbool 0 rd.live.overlay.thin && thin_snapshot="yes"
|
||||||
|
|
||||||
# CD/DVD media check
|
# CD/DVD media check
|
||||||
[ -b $livedev ] && fs=$(blkid -s TYPE -o value $livedev)
|
[ -b $livedev ] && fs=$(blkid -s TYPE -o value $livedev)
|
||||||
if [ "$fs" = "iso9660" -o "$fs" = "udf" ]; then
|
if [ "$fs" = "iso9660" -o "$fs" = "udf" ]; then
|
||||||
@@ -146,7 +148,31 @@ do_live_overlay() {
|
|||||||
base=$BASE_LOOPDEV
|
base=$BASE_LOOPDEV
|
||||||
over=$OVERLAY_LOOPDEV
|
over=$OVERLAY_LOOPDEV
|
||||||
fi
|
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
|
# Create a device that always points to a ro base image
|
||||||
echo 0 $sz linear $base 0 | dmsetup create --readonly live-base
|
echo 0 $sz linear $base 0 | dmsetup create --readonly live-base
|
||||||
@@ -174,29 +200,6 @@ if [ -n "$OSMINSQFS" ]; then
|
|||||||
umount -l /run/initramfs/squashfs.osmin
|
umount -l /run/initramfs/squashfs.osmin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# we might have an embedded fs image to use as rootfs (uncompressed live)
|
|
||||||
if [ -e /run/initramfs/live/${live_dir}/ext3fs.img ]; then
|
|
||||||
FSIMG="/run/initramfs/live/${live_dir}/ext3fs.img"
|
|
||||||
elif [ -e /run/initramfs/live/${live_dir}/rootfs.img ]; then
|
|
||||||
FSIMG="/run/initramfs/live/${live_dir}/rootfs.img"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$FSIMG" ] ; then
|
|
||||||
BASE_LOOPDEV=$( losetup -f )
|
|
||||||
|
|
||||||
if [ -n "$writable_fsimg" ] ; then
|
|
||||||
# mount the provided fileysstem read/write
|
|
||||||
echo "Unpacking live filesystem (may take some time)"
|
|
||||||
unpack_archive $FSIMG /run/initramfs/fsimg/
|
|
||||||
losetup $BASE_LOOPDEV /run/initramfs/fsimg/rootfs.img
|
|
||||||
echo "0 $( blockdev --getsize $BASE_LOOPDEV ) linear $BASE_LOOPDEV 0" | dmsetup create live-rw
|
|
||||||
else
|
|
||||||
# mount the filesystem read-only and add a dm snapshot for writes
|
|
||||||
losetup -r $BASE_LOOPDEV $FSIMG
|
|
||||||
do_live_from_base_loop
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# we might have an embedded fs image on squashfs (compressed live)
|
# we might have an embedded fs image on squashfs (compressed live)
|
||||||
if [ -e /run/initramfs/live/${live_dir}/${squash_image} ]; then
|
if [ -e /run/initramfs/live/${live_dir}/${squash_image} ]; then
|
||||||
SQUASHED="/run/initramfs/live/${live_dir}/${squash_image}"
|
SQUASHED="/run/initramfs/live/${live_dir}/${squash_image}"
|
||||||
@@ -217,18 +220,42 @@ if [ -e "$SQUASHED" ] ; then
|
|||||||
mkdir -m 0755 -p /run/initramfs/squashfs
|
mkdir -m 0755 -p /run/initramfs/squashfs
|
||||||
mount -n -t squashfs -o ro $SQUASHED_LOOPDEV /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
|
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
|
if [ -b "$OSMIN_LOOPDEV" ]; then
|
||||||
# set up the devicemapper snapshot device, which will merge
|
# set up the devicemapper snapshot device, which will merge
|
||||||
# the normal live fs image, and the delta, into a minimzied fs image
|
# the normal live fs image, and the delta, into a minimzied fs image
|
||||||
@@ -241,7 +268,10 @@ if [ -n "$ROOTFLAGS" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
ln -s /dev/mapper/live-rw /dev/root
|
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
|
need_shutdown
|
||||||
|
|
||||||
|
@@ -22,7 +22,7 @@ installkernel() {
|
|||||||
|
|
||||||
# called by dracut
|
# called by dracut
|
||||||
install() {
|
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_multiple -o checkisomd5
|
||||||
inst_hook cmdline 30 "$moddir/parse-dmsquash-live.sh"
|
inst_hook cmdline 30 "$moddir/parse-dmsquash-live.sh"
|
||||||
inst_hook cmdline 31 "$moddir/parse-iso-scan.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_hook pre-pivot 20 "$moddir/apply-live-updates.sh"
|
||||||
inst_script "$moddir/dmsquash-live-root.sh" "/sbin/dmsquash-live-root"
|
inst_script "$moddir/dmsquash-live-root.sh" "/sbin/dmsquash-live-root"
|
||||||
inst_script "$moddir/iso-scan.sh" "/sbin/iso-scan"
|
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
|
# should probably just be generally included
|
||||||
inst_rules 60-cdrom_id.rules
|
inst_rules 60-cdrom_id.rules
|
||||||
inst_simple "$moddir/checkisomd5@.service" "/etc/systemd/system/checkisomd5@.service"
|
inst_simple "$moddir/checkisomd5@.service" "/etc/systemd/system/checkisomd5@.service"
|
||||||
|
@@ -13,7 +13,7 @@ if [ "${root%%:*}" = "live" ] ; then
|
|||||||
liveroot=$root
|
liveroot=$root
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ "${liveroot%%:*}" = "live" ] || return
|
[ "${liveroot%%:*}" = "live" ] || return 1
|
||||||
|
|
||||||
modprobe -q loop
|
modprobe -q loop
|
||||||
|
|
||||||
@@ -49,9 +49,14 @@ case "$liveroot" in
|
|||||||
live:/*.[Ii][Mm][Gg]|/*.[Ii][Mm][Gg])
|
live:/*.[Ii][Mm][Gg]|/*.[Ii][Mm][Gg])
|
||||||
[ -f "${root#live:}" ] && rootok=1 ;;
|
[ -f "${root#live:}" ] && rootok=1 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
[ "$rootok" = "1" ] || return 1
|
||||||
|
|
||||||
info "root was $liveroot, is now $root"
|
info "root was $liveroot, is now $root"
|
||||||
|
|
||||||
# make sure that init doesn't complain
|
# make sure that init doesn't complain
|
||||||
[ -z "$root" ] && root="live"
|
[ -z "$root" ] && root="live"
|
||||||
|
|
||||||
wait_for_dev -n /dev/mapper/live-rw
|
wait_for_dev -n /dev/mapper/live-rw
|
||||||
|
|
||||||
|
return 0
|
||||||
|
@@ -9,7 +9,7 @@ installkernel() {
|
|||||||
local _merge=8 _side2=9
|
local _merge=8 _side2=9
|
||||||
function bmf1() {
|
function bmf1() {
|
||||||
local _f
|
local _f
|
||||||
while read _f; do case "$_f" in
|
while read _f || [ -n "$_f" ]; do case "$_f" in
|
||||||
*.ko) [[ $(< $_f) =~ $_blockfuncs ]] && echo "$_f" ;;
|
*.ko) [[ $(< $_f) =~ $_blockfuncs ]] && echo "$_f" ;;
|
||||||
*.ko.gz) [[ $(gzip -dc <$_f) =~ $_blockfuncs ]] && echo "$_f" ;;
|
*.ko.gz) [[ $(gzip -dc <$_f) =~ $_blockfuncs ]] && echo "$_f" ;;
|
||||||
*.ko.xz) [[ $(xz -dc <$_f) =~ $_blockfuncs ]] && echo "$_f" ;;
|
*.ko.xz) [[ $(xz -dc <$_f) =~ $_blockfuncs ]] && echo "$_f" ;;
|
||||||
@@ -19,7 +19,7 @@ installkernel() {
|
|||||||
}
|
}
|
||||||
function rotor() {
|
function rotor() {
|
||||||
local _f1 _f2
|
local _f1 _f2
|
||||||
while read _f1; do
|
while read _f1 || [ -n "$_f1" ]; do
|
||||||
echo "$_f1"
|
echo "$_f1"
|
||||||
if read _f2; then
|
if read _f2; then
|
||||||
echo "$_f2" 1>&${_side2}
|
echo "$_f2" 1>&${_side2}
|
||||||
@@ -41,10 +41,13 @@ installkernel() {
|
|||||||
uhci-hcd \
|
uhci-hcd \
|
||||||
xhci-hcd xhci-pci xhci-plat-hcd
|
xhci-hcd xhci-pci xhci-plat-hcd
|
||||||
|
|
||||||
|
instmods \
|
||||||
|
"=drivers/hid" \
|
||||||
|
"=drivers/input/serio" \
|
||||||
|
"=drivers/input/keyboard"
|
||||||
|
|
||||||
instmods yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
|
instmods yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
|
||||||
atkbd i8042 usbhid hid-apple hid-sunplus hid-cherry hid-logitech \
|
atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus
|
||||||
hid-logitech-dj hid-microsoft hid-lcpower firewire-ohci \
|
|
||||||
pcmcia hid-hyperv hv-vmbus hyperv-keyboard
|
|
||||||
|
|
||||||
if [[ "$(uname -p)" == arm* ]]; then
|
if [[ "$(uname -p)" == arm* ]]; then
|
||||||
# arm specific modules
|
# 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"
|
info "Scanning devices $lvmdevs for LVM logical volumes $LVS"
|
||||||
lvm lvscan --ignorelockingfailure 2>&1 | vinfo
|
lvm lvscan --ignorelockingfailure 2>&1 | vinfo
|
||||||
for LV in $LVS; do
|
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
|
if [ -z "$sysinit" ]; then
|
||||||
lvm lvchange --yes -ay --ignorelockingfailure $nopoll --ignoremonitoring $LV 2>&1 | vinfo
|
lvm lvchange --yes -ay --ignorelockingfailure $nopoll --ignoremonitoring $LV 2>&1 | vinfo
|
||||||
else
|
else
|
||||||
|
@@ -67,6 +67,20 @@ install() {
|
|||||||
sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 4/' ${initdir}/etc/lvm/lvm.conf
|
sed -i -e 's/\(^[[:space:]]*\)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
|
sed -i -e 's/\(^[[:space:]]*\)use_lvmetad[[:space:]]*=[[:space:]]*[[:digit:]]/\1use_lvmetad = 0/' ${initdir}/etc/lvm/lvm.conf
|
||||||
fi
|
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
|
fi
|
||||||
|
|
||||||
if ! [[ -e ${initdir}/etc/lvm/lvm.conf ]]; then
|
if ! [[ -e ${initdir}/etc/lvm/lvm.conf ]]; then
|
||||||
|
@@ -27,6 +27,7 @@ _md_force_run() {
|
|||||||
|
|
||||||
_path_d="${_path_s%/*}/degraded"
|
_path_d="${_path_s%/*}/degraded"
|
||||||
[ ! -r "$_path_d" ] && continue
|
[ ! -r "$_path_d" ] && continue
|
||||||
|
> $hookdir/initqueue/work
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -46,7 +46,7 @@ cmdline() {
|
|||||||
|
|
||||||
UUID=$(
|
UUID=$(
|
||||||
/sbin/mdadm --examine --export $dev \
|
/sbin/mdadm --examine --export $dev \
|
||||||
| while read line; do
|
| while read line || [ -n "$line" ]; do
|
||||||
[[ ${line#MD_UUID=} = $line ]] && continue
|
[[ ${line#MD_UUID=} = $line ]] && continue
|
||||||
printf "%s" "${line#MD_UUID=} "
|
printf "%s" "${line#MD_UUID=} "
|
||||||
done
|
done
|
||||||
|
@@ -10,7 +10,7 @@ else
|
|||||||
if [ -n "$MD_UUID" ]; then
|
if [ -n "$MD_UUID" ]; then
|
||||||
for f in /etc/udev/rules.d/65-md-incremental*.rules; do
|
for f in /etc/udev/rules.d/65-md-incremental*.rules; do
|
||||||
[ -e "$f" ] || continue
|
[ -e "$f" ] || continue
|
||||||
while read line; do
|
while read line || [ -n "$line" ]; do
|
||||||
if [ "${line%%UUID CHECK}" != "$line" ]; then
|
if [ "${line%%UUID CHECK}" != "$line" ]; then
|
||||||
printf 'IMPORT{program}="/sbin/mdadm --examine --export $tempnode"\n'
|
printf 'IMPORT{program}="/sbin/mdadm --examine --export $tempnode"\n'
|
||||||
for uuid in $MD_UUID; do
|
for uuid in $MD_UUID; do
|
||||||
|
@@ -46,7 +46,7 @@ installkernel() {
|
|||||||
local _merge=8 _side2=9
|
local _merge=8 _side2=9
|
||||||
function bmf1() {
|
function bmf1() {
|
||||||
local _f
|
local _f
|
||||||
while read _f; do
|
while read _f || [ -n "$_f" ]; do
|
||||||
case "$_f" in
|
case "$_f" in
|
||||||
*.ko) [[ $(< $_f) =~ $_funcs ]] && echo "$_f" ;;
|
*.ko) [[ $(< $_f) =~ $_funcs ]] && echo "$_f" ;;
|
||||||
*.ko.gz) [[ $(gzip -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
|
*.ko.gz) [[ $(gzip -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
|
||||||
@@ -58,7 +58,7 @@ installkernel() {
|
|||||||
|
|
||||||
function rotor() {
|
function rotor() {
|
||||||
local _f1 _f2
|
local _f1 _f2
|
||||||
while read _f1; do
|
while read _f1 || [ -n "$_f1" ]; do
|
||||||
echo "$_f1"
|
echo "$_f1"
|
||||||
if read _f2; then
|
if read _f2; then
|
||||||
echo "$_f2" 1>&${_side2}
|
echo "$_f2" 1>&${_side2}
|
||||||
|
@@ -19,8 +19,6 @@ loop_decrypt() {
|
|||||||
local key="/dev/mapper/${mntp##*/}"
|
local key="/dev/mapper/${mntp##*/}"
|
||||||
|
|
||||||
if [ ! -b $key ]; then
|
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 loopdev=$(losetup -f "${mntp}/${keypath}" --show)
|
||||||
local opts="-d - luksOpen $loopdev ${key##*/}"
|
local opts="-d - luksOpen $loopdev ${key##*/}"
|
||||||
|
|
||||||
@@ -29,14 +27,12 @@ loop_decrypt() {
|
|||||||
--prompt "Password ($keypath on $keydev for $device)" \
|
--prompt "Password ($keypath on $keydev for $device)" \
|
||||||
--tty-echo-off
|
--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##*/}" \
|
initqueue --onetime --finished --unique --name "crypt-loop-cleanup-10-${key##*/}" \
|
||||||
$(command -v cryptsetup) "luksClose $key"
|
$(command -v cryptsetup) "luksClose $key"
|
||||||
initqueue --onetime --finished --unique --name "crypt-loop-cleanup-20-${loopdev##*/}" \
|
initqueue --onetime --finished --unique --name "crypt-loop-cleanup-20-${loopdev##*/}" \
|
||||||
$(command -v losetup) "-d $loopdev"
|
$(command -v losetup) "-d $loopdev"
|
||||||
else
|
|
||||||
info "Existing keyfile found, re-using it for $device"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat $key
|
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
|
# called by dracut
|
||||||
installkernel() {
|
installkernel() {
|
||||||
instmods loop
|
hostonly='' instmods loop
|
||||||
}
|
}
|
||||||
|
|
||||||
# called by dracut
|
# called by dracut
|
||||||
|
@@ -13,8 +13,11 @@ depends() {
|
|||||||
|
|
||||||
# called by dracut
|
# called by dracut
|
||||||
install() {
|
install() {
|
||||||
inst_multiple -o ps grep more cat rm strace free showmount \
|
inst_multiple -o cat ls ps grep more cat rm strace free showmount \
|
||||||
ping netstat rpcinfo vi scp ping6 ssh find vi \
|
ping netstat rpcinfo vi scp ping6 ssh find vi \
|
||||||
fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat e2fsck
|
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
|
# called by dracut
|
||||||
check() {
|
check() {
|
||||||
|
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||||
|
[ -d /sys/firmware/efi ] || return 255
|
||||||
|
}
|
||||||
require_binaries dcbtool fipvlan lldpad ip readlink || return 1
|
require_binaries dcbtool fipvlan lldpad ip readlink || return 1
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
0
modules.d/95fcoe/lldpad.sh
Normal file → Executable file
0
modules.d/95fcoe/lldpad.sh
Normal file → Executable file
@@ -20,9 +20,9 @@
|
|||||||
|
|
||||||
|
|
||||||
# BRCM: Later, should check whether bnx2x is loaded first before loading bnx2fc so do not load bnx2fc when there are no Broadcom adapters
|
# BRCM: Later, should check whether bnx2x is loaded first before loading bnx2fc so do not load bnx2fc when there are no Broadcom adapters
|
||||||
[ -d /sys/module/fcoe ] || modprobe -a fcoe || die "FCoE requested but kernel/initrd does not support FCoE"
|
[ -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
|
udevadm settle --timeout=30
|
||||||
|
|
||||||
parse_fcoe_opts() {
|
parse_fcoe_opts() {
|
||||||
|
@@ -7,7 +7,7 @@ fstab_mount() {
|
|||||||
local _dev _mp _fs _opts _dump _pass _rest
|
local _dev _mp _fs _opts _dump _pass _rest
|
||||||
test -e "$1" || return 1
|
test -e "$1" || return 1
|
||||||
info "Mounting from $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
|
[ -z "${_dev%%#*}" ] && continue # Skip comment lines
|
||||||
ismounted $_mp && continue # Skip mounted filesystem
|
ismounted $_mp && continue # Skip mounted filesystem
|
||||||
if [ "$_pass" -gt 0 ] && ! strstr "$_opts" _netdev; then
|
if [ "$_pass" -gt 0 ] && ! strstr "$_opts" _netdev; then
|
||||||
|
@@ -123,7 +123,7 @@ handle_netroot()
|
|||||||
|
|
||||||
if [ -z $iscsi_initiator ]; then
|
if [ -z $iscsi_initiator ]; then
|
||||||
if [ -f /sys/firmware/ibft/initiator/initiator-name ]; 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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@@ -166,7 +166,7 @@ installkernel() {
|
|||||||
local _merge=8 _side2=9
|
local _merge=8 _side2=9
|
||||||
function bmf1() {
|
function bmf1() {
|
||||||
local _f
|
local _f
|
||||||
while read _f; do
|
while read _f || [ -n "$_f" ]; do
|
||||||
case "$_f" in
|
case "$_f" in
|
||||||
*.ko) [[ $(< $_f) =~ $_funcs ]] && echo "$_f" ;;
|
*.ko) [[ $(< $_f) =~ $_funcs ]] && echo "$_f" ;;
|
||||||
*.ko.gz) [[ $(gzip -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
|
*.ko.gz) [[ $(gzip -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
|
||||||
@@ -178,7 +178,7 @@ installkernel() {
|
|||||||
|
|
||||||
function rotor() {
|
function rotor() {
|
||||||
local _f1 _f2
|
local _f1 _f2
|
||||||
while read _f1; do
|
while read _f1 || [ -n "$_f1" ]; do
|
||||||
echo "$_f1"
|
echo "$_f1"
|
||||||
if read _f2; then
|
if read _f2; then
|
||||||
echo "$_f2" 1>&${_side2}
|
echo "$_f2" 1>&${_side2}
|
||||||
|
@@ -60,19 +60,15 @@ fi
|
|||||||
# iscsi_firmware does not need argument checking
|
# iscsi_firmware does not need argument checking
|
||||||
if [ -n "$iscsi_firmware" ] ; then
|
if [ -n "$iscsi_firmware" ] ; then
|
||||||
[ -z "$netroot" ] && netroot=iscsi:
|
[ -z "$netroot" ] && netroot=iscsi:
|
||||||
modprobe -q iscsi_boot_sysfs 2>/dev/null
|
modprobe -b -q iscsi_boot_sysfs 2>/dev/null
|
||||||
modprobe -q iscsi_ibft
|
modprobe -b -q iscsi_ibft
|
||||||
initqueue --onetime --timeout /sbin/iscsiroot dummy "$netroot" "$NEWROOT"
|
initqueue --onetime --timeout /sbin/iscsiroot dummy "$netroot" "$NEWROOT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If it's not iscsi we don't continue
|
# If it's not iscsi we don't continue
|
||||||
[ "${netroot%%:*}" = "iscsi" ] || return
|
[ "${netroot%%:*}" = "iscsi" ] || return
|
||||||
|
|
||||||
modprobe -q qla4xxx
|
initqueue --onetime modprobe --all -b -q qla4xxx cxgb3i cxgb4i bnx2i be2iscsi
|
||||||
modprobe -q cxgb3i
|
|
||||||
modprobe -q cxgb4i
|
|
||||||
modprobe -q bnx2i
|
|
||||||
modprobe -q be2iscsi
|
|
||||||
|
|
||||||
if [ -z "$iscsi_firmware" ] ; then
|
if [ -z "$iscsi_firmware" ] ; then
|
||||||
type parse_iscsi_root >/dev/null 2>&1 || . /lib/net-lib.sh
|
type parse_iscsi_root >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||||
@@ -81,7 +77,7 @@ fi
|
|||||||
|
|
||||||
# ISCSI actually supported?
|
# ISCSI actually supported?
|
||||||
if ! [ -e /sys/module/iscsi_tcp ]; then
|
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
|
fi
|
||||||
|
|
||||||
if [ -n "$netroot" ] && [ "$root" != "/dev/root" ] && [ "$root" != "dhcp" ]; then
|
if [ -n "$netroot" ] && [ "$root" != "/dev/root" ] && [ "$root" != "dhcp" ]; then
|
||||||
|
@@ -57,7 +57,14 @@ fi
|
|||||||
|
|
||||||
case "$netroot" in
|
case "$netroot" in
|
||||||
/dev/nfs) netroot=nfs;;
|
/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
|
# LEGACY: root=<server-ip>:/<path
|
||||||
[0-9]*:/*|[0-9]*\.[0-9]*\.[0-9]*[!:]|/*)
|
[0-9]*:/*|[0-9]*\.[0-9]*\.[0-9]*[!:]|/*)
|
||||||
netroot=nfs:$netroot;;
|
netroot=nfs:$netroot;;
|
||||||
|
@@ -37,6 +37,8 @@ esac
|
|||||||
|
|
||||||
if ! getarg noresume; then
|
if ! getarg noresume; then
|
||||||
if [ -n "$resume" ]; then
|
if [ -n "$resume" ]; then
|
||||||
|
wait_for_dev /dev/resume
|
||||||
|
|
||||||
{
|
{
|
||||||
printf "KERNEL==\"%s\", ACTION==\"add|change\", SYMLINK+=\"resume\"\n" \
|
printf "KERNEL==\"%s\", ACTION==\"add|change\", SYMLINK+=\"resume\"\n" \
|
||||||
${resume#/dev/};
|
${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"'
|
printf -- '%s\n' ' RUN+="/sbin/initqueue --finished --unique --name 00resume echo %M:%m > /sys/power/resume"'
|
||||||
} >> /etc/udev/rules.d/99-resume.rules
|
} >> /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
|
"$resume" "$resume" "$hookdir" >> $hookdir/initqueue/settled/resume.sh
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@@ -30,11 +30,19 @@ cmdline_journal() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmdline_rootfs() {
|
cmdline_rootfs() {
|
||||||
local dev=/dev/block/$(find_root_block_device)
|
local _dev=/dev/block/$(find_root_block_device)
|
||||||
if [ -e $dev ]; then
|
local _fstype _flags _subvol
|
||||||
printf " root=%s" "$(shorten_persistent_dev "$(get_persistent_dev "$dev")")"
|
if [ -e $_dev ]; then
|
||||||
printf " rootflags=%s" "$(find_mp_fsopts /)"
|
printf " root=%s" "$(shorten_persistent_dev "$(get_persistent_dev "$_dev")")"
|
||||||
printf " rootfstype=%s" "$(find_mp_fstype /)"
|
_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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -81,7 +81,7 @@ mount_root() {
|
|||||||
# the root filesystem,
|
# the root filesystem,
|
||||||
# remount it with the proper options
|
# remount it with the proper options
|
||||||
rootopts="defaults"
|
rootopts="defaults"
|
||||||
while read dev mp fs opts dump fsck; do
|
while read dev mp fs opts dump fsck || [ -n "$dev" ]; do
|
||||||
# skip comments
|
# skip comments
|
||||||
[ "${dev%%#*}" != "$dev" ] && continue
|
[ "${dev%%#*}" != "$dev" ] && continue
|
||||||
|
|
||||||
|
@@ -44,7 +44,7 @@ inst_sshenv()
|
|||||||
if [[ -f /etc/ssh/ssh_config ]]; then
|
if [[ -f /etc/ssh/ssh_config ]]; then
|
||||||
inst_simple /etc/ssh/ssh_config
|
inst_simple /etc/ssh/ssh_config
|
||||||
sed -i -e 's/\(^[[:space:]]*\)ProxyCommand/\1# ProxyCommand/' ${initdir}/etc/ssh/ssh_config
|
sed -i -e 's/\(^[[:space:]]*\)ProxyCommand/\1# ProxyCommand/' ${initdir}/etc/ssh/ssh_config
|
||||||
while read key val; do
|
while read key val || [ -n "$key" ]; do
|
||||||
[[ $key != "GlobalKnownHostsFile" ]] && continue
|
[[ $key != "GlobalKnownHostsFile" ]] && continue
|
||||||
inst_simple "$val"
|
inst_simple "$val"
|
||||||
break
|
break
|
||||||
|
@@ -7,8 +7,9 @@ install() {
|
|||||||
# Fixme: would be nice if we didn't have to guess, which rules to grab....
|
# 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
|
# 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
|
# of the rules we want so that we just copy those in would be best
|
||||||
inst_multiple udevadm cat uname blkid \
|
inst_multiple udevadm cat uname blkid
|
||||||
/etc/udev/udev.conf
|
inst_dir /etc/udev
|
||||||
|
inst_multiple -o /etc/udev/udev.conf
|
||||||
|
|
||||||
[ -d ${initdir}/$systemdutildir ] || mkdir -p ${initdir}/$systemdutildir
|
[ -d ${initdir}/$systemdutildir ] || mkdir -p ${initdir}/$systemdutildir
|
||||||
for _i in ${systemdutildir}/systemd-udevd ${udevdir}/udevd /sbin/udevd; do
|
for _i in ${systemdutildir}/systemd-udevd ${udevdir}/udevd /sbin/udevd; do
|
||||||
@@ -25,16 +26,25 @@ install() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
inst_rules 50-udev-default.rules 60-persistent-storage.rules \
|
inst_rules \
|
||||||
61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \
|
|
||||||
60-pcmcia.rules \
|
|
||||||
50-udev.rules 95-late.rules \
|
|
||||||
50-firmware.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 \
|
59-scsi-sg3_utils.rules \
|
||||||
55-scsi-sg3_id.rules 58-scsi-sg3_symlink.rules \
|
60-block.rules \
|
||||||
70-uaccess.rules 71-seat.rules 73-seat-late.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 \
|
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/59-persistent-storage.rules" \
|
||||||
"$moddir/61-persistent-storage.rules"
|
"$moddir/61-persistent-storage.rules"
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@ mount_root() {
|
|||||||
# the root filesystem,
|
# the root filesystem,
|
||||||
# remount it with the proper options
|
# remount it with the proper options
|
||||||
rootopts="defaults"
|
rootopts="defaults"
|
||||||
while read dev mp fs opts rest; do
|
while read dev mp fs opts rest || [ -n "$dev" ]; do
|
||||||
# skip comments
|
# skip comments
|
||||||
[ "${dev%%#*}" != "$dev" ] && continue
|
[ "${dev%%#*}" != "$dev" ] && continue
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@ echo
|
|||||||
echo
|
echo
|
||||||
echo
|
echo
|
||||||
echo "Enter additional kernel command line parameter (end with ctrl-d or .)"
|
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" == "." ]] && break
|
||||||
[[ "$line" ]] && printf -- "%s\n" "$line" >> /etc/cmdline.d/99-cmdline-ask.conf
|
[[ "$line" ]] && printf -- "%s\n" "$line" >> /etc/cmdline.d/99-cmdline-ask.conf
|
||||||
done
|
done
|
@@ -60,6 +60,7 @@ while :; do
|
|||||||
job=$job . $job
|
job=$job . $job
|
||||||
udevadm settle --timeout=0 >/dev/null 2>&1 || main_loop=0
|
udevadm settle --timeout=0 >/dev/null 2>&1 || main_loop=0
|
||||||
[ -f $hookdir/initqueue/work ] && main_loop=0
|
[ -f $hookdir/initqueue/work ] && main_loop=0
|
||||||
|
[ $main_loop -eq 0 ] && break
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user