Compare commits
111 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e97ed33775 | ||
![]() |
04942c4569 | ||
![]() |
296d013f1a | ||
![]() |
64a69cb49f | ||
![]() |
70598ac292 | ||
![]() |
2a12e97475 | ||
![]() |
8a430ab25b | ||
![]() |
2a5a7fb662 | ||
![]() |
f182cb9599 | ||
![]() |
9dc0c244b8 | ||
![]() |
b4fb539c9b | ||
![]() |
18423f7951 | ||
![]() |
6dcc5e1158 | ||
![]() |
e3e1f406bb | ||
![]() |
496e3d962d | ||
![]() |
7cddd7b838 | ||
![]() |
93342718cd | ||
![]() |
4ba44e899c | ||
![]() |
36e8ce4fb0 | ||
![]() |
4089949033 | ||
![]() |
eb8f202ed0 | ||
![]() |
c59779cf93 | ||
![]() |
1dc360790d | ||
![]() |
e0dc6cd4f6 | ||
![]() |
ebc82d38b7 | ||
![]() |
332ecaa900 | ||
![]() |
3e7a05f2a5 | ||
![]() |
733c71ce9e | ||
![]() |
a17d5cf494 | ||
![]() |
bea41b898a | ||
![]() |
e683985d10 | ||
![]() |
4b6b46bb2a | ||
![]() |
fe116c1670 | ||
![]() |
7700b3df4c | ||
![]() |
486030575d | ||
![]() |
ce8f354dbd | ||
![]() |
a262ad91e8 | ||
![]() |
681462eca8 | ||
![]() |
9492008435 | ||
![]() |
22e837b645 | ||
![]() |
0a68a26cff | ||
![]() |
8b257fcc86 | ||
![]() |
c64a94caa9 | ||
![]() |
8d40852e8c | ||
![]() |
cd72830807 | ||
![]() |
206345ce9b | ||
![]() |
4d25892179 | ||
![]() |
6df523517f | ||
![]() |
118ca9ecfc | ||
![]() |
3838dc47c3 | ||
![]() |
5c84d51b3f | ||
![]() |
517d27a75f | ||
![]() |
3ae60e559f | ||
![]() |
7c2311660f | ||
![]() |
bd44831b82 | ||
![]() |
e3eec4b8a2 | ||
![]() |
fe273e3901 | ||
![]() |
3244bf5981 | ||
![]() |
56663e7e32 | ||
![]() |
f34a2ef14d | ||
![]() |
c4d8793c67 | ||
![]() |
54e28d79b9 | ||
![]() |
2e34f38095 | ||
![]() |
9ebf4a5d3c | ||
![]() |
a3a2266046 | ||
![]() |
4aad3438f7 | ||
![]() |
442abd16d2 | ||
![]() |
8f4ee8c71b | ||
![]() |
15eed1e4f1 | ||
![]() |
36894743e3 | ||
![]() |
ae8e6ed5af | ||
![]() |
552c37e156 | ||
![]() |
1f8abe81a9 | ||
![]() |
25b987fed6 | ||
![]() |
414dc51ca2 | ||
![]() |
ca4108b78e | ||
![]() |
c440d302f1 | ||
![]() |
3ae03005b8 | ||
![]() |
99d4fd6bb7 | ||
![]() |
3a04bddeed | ||
![]() |
fa45d0d9c9 | ||
![]() |
3659d64df3 | ||
![]() |
370035d561 | ||
![]() |
2b2033e561 | ||
![]() |
78a78e4239 | ||
![]() |
856f8265aa | ||
![]() |
cf864c1b80 | ||
![]() |
26d14fb3d3 | ||
![]() |
e1e4ee9d7c | ||
![]() |
778b354360 | ||
![]() |
af67d62151 | ||
![]() |
027565d023 | ||
![]() |
66fd7e4329 | ||
![]() |
56d2aed1c8 | ||
![]() |
27dcc3a583 | ||
![]() |
5cac9e14ec | ||
![]() |
d9935e4664 | ||
![]() |
f95b78f3eb | ||
![]() |
84125ddae1 | ||
![]() |
2f0f1b0bbc | ||
![]() |
34a1ec6a36 | ||
![]() |
972d6b44ba | ||
![]() |
3947f07d93 | ||
![]() |
3c90cc2f48 | ||
![]() |
1c08ad507b | ||
![]() |
ab2f95e45e | ||
![]() |
eda73c0ad2 | ||
![]() |
f44b084660 | ||
![]() |
cfd51d2be2 | ||
![]() |
d829e7fce2 | ||
![]() |
b09faad877 |
4
.mailmap
4
.mailmap
@@ -10,7 +10,9 @@ Andrey Borzenkov <arvidjaar@gmail.com> <arvidjaar@mail.ru>
|
||||
Dan Horák <dhorak@redhat.com> <dan@danny.cz>
|
||||
John Reiser <jreiser@bitwagon.com> <jreiser@BitWagon.com>
|
||||
Luca Berra <bluca@vodka.it> <bluca@comedia.it>
|
||||
Dave Young <dyoung@redhat.com> dyoung@redhat.com
|
||||
Dave Young <dyoung@redhat.com> <dyoung@redhat.com>
|
||||
Dave Young <dyoung@redhat.com> <dave@redhat.com>
|
||||
Frederick Grose <fgrose@sugarlabs.org> <fgrose@gmail.com>
|
||||
Frederic Crozat <fcrozat@suse.com> <fcrozat@mandriva.com>
|
||||
Shawn W Dunn <sfalken@opensuse.org> <sfalken@opensuse.org>
|
||||
Kyle McMartin <kmcmarti@redhat.com> <kyle@redhat.com>
|
||||
|
49
AUTHORS
49
AUTHORS
@@ -7,36 +7,40 @@ Warren Togami <wtogami@redhat.com>
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
Dave Young <dyoung@redhat.com>
|
||||
David Dillow <dave@thedillows.org>
|
||||
Hannes Reinecke <hare@suse.de>
|
||||
Michal Soltys <soltys@ziu.info>
|
||||
Amerigo Wang <amwang@redhat.com>
|
||||
Colin Guthrie <colin@mageia.org>
|
||||
Thomas Renninger <trenn@suse.de>
|
||||
WANG Chao <chaowang@redhat.com>
|
||||
Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
Peter Jones <pjones@redhat.com>
|
||||
WANG Chao <chaowang@redhat.com>
|
||||
Andreas Thienemann <andreas@bawue.net>
|
||||
Hannes Reinecke <hare@suse.de>
|
||||
Hans de Goede <hdegoede@redhat.com>
|
||||
Alexander Tsoy <alexander@tsoy.me>
|
||||
John Reiser <jreiser@bitwagon.com>
|
||||
Luca Berra <bluca@vodka.it>
|
||||
Thomas Renninger <trenn@suse.de>
|
||||
Alexander Tsoy <alexander@tsoy.me>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
Brian C. Lane <bcl@redhat.com>
|
||||
Daniel Drake <dsd@laptop.org>
|
||||
Dan Horák <dhorak@redhat.com>
|
||||
Baoquan He <bhe@redhat.com>
|
||||
Leho Kraav <leho@kraav.com>
|
||||
Kamil Rytarowski <n54@gmx.com>
|
||||
Marc Grimme <grimme@atix.de>
|
||||
Peter Rajnoha <prajnoha@redhat.com>
|
||||
Radek Vykydal <rvykydal@redhat.com>
|
||||
Thorsten Behrens <tbehrens@suse.com>
|
||||
Chao Wang <chaowang@redhat.com>
|
||||
Colin Walters <walters@verbum.org>
|
||||
Frederic Crozat <fcrozat@suse.com>
|
||||
Jesse Keating <jkeating@redhat.com>
|
||||
Milan Broz <mbroz@redhat.com>
|
||||
Radek Vykydal <rvykydal@redhat.com>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
Roberto Sassu <roberto.sassu@polito.it>
|
||||
Anton Blanchard <anton@samba.org>
|
||||
Bill Nottingham <notting@redhat.com>
|
||||
Chapman Flack <g2@anastigmatix.net>
|
||||
Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
David Cantrell <dcantrell@redhat.com>
|
||||
Dennis Gilmore <dennis@ausil.us>
|
||||
Jon Ander Hernandez <jonan.h@gmail.com>
|
||||
@@ -44,21 +48,29 @@ Juan RP <xtraeme@gmail.com>
|
||||
Lance Albertson <lance@osuosl.org>
|
||||
Marian Ganisin <mganisin@redhat.com>
|
||||
Michael Ploujnikov <plouj@somanetworks.com>
|
||||
Peter Robinson <pbrobinson@gmail.com>
|
||||
Stefan Reimer <it@startux.de>
|
||||
Stig Telfer <stelfer@cray.com>
|
||||
Vasiliy Tolstov <v.tolstov@selfip.ru>
|
||||
Wim Muskee <wimmuskee@gmail.com>
|
||||
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
|
||||
Alan Pevec <apevec@redhat.com>
|
||||
Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Alex Harpin <development@landsofshadow.co.uk>
|
||||
Daniel Schaal <farbing@web.de>
|
||||
Frederick Grose <fgrose@sugarlabs.org>
|
||||
Hari Bathini <hbathini@linux.vnet.ibm.com>
|
||||
Ian Dall <ian@beware.dropbear.id.au>
|
||||
James Buren <ryuo@frugalware.org>
|
||||
James Lee <jlee@thestaticvoid.com>
|
||||
Joey Boggs <jboggs@redhat.com>
|
||||
Koen Kooi <koen@dominion.thruhere.net>
|
||||
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
Kyle McMartin <kmcmarti@redhat.com>
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
Mike Snitzer <snitzer@redhat.com>
|
||||
Minfei Huang <mhuang@redhat.com>
|
||||
Przemysław Rudy <prudy1@o2.pl>
|
||||
Stefan Reimer <it@startux.de>
|
||||
Thomas Backlund <tmb@mageia.org>
|
||||
Thomas Lange <lange@informatik.uni-koeln.de>
|
||||
Till Maas <opensource@till.name>
|
||||
Vivek Goyal <vgoyal@redhat.com>
|
||||
@@ -67,41 +79,43 @@ Adam Williamson <awilliam@redhat.com>
|
||||
Alexander Todorov <atodorov@redhat.com>
|
||||
Andy Lutomirski <luto@mit.edu>
|
||||
Anssi Hannula <anssi@mageia.org>
|
||||
Antony Messerli <amesserl@rackspace.com>
|
||||
Brandon Philips <brandon@ifup.co>
|
||||
Canek Peláez Valdés <caneko@gmail.com>
|
||||
Chris Leech <cleech@redhat.com>
|
||||
Christian Heinz <christian.ch.heinz@gmail.com>
|
||||
Cong Wang <amwang@redhat.com>
|
||||
Daniel Schaal <farbing@web.de>
|
||||
Daniel Drake <drake@endlessm.com>
|
||||
Dave Jones <davej@redhat.com>
|
||||
Dave Young <dave@redhat.com>
|
||||
Dennis Schridde <devurandom@gmx.net>
|
||||
Duane Griffin <duaneg@dghda.com>
|
||||
Erwan Velu <erwan.velu@enovance.com>
|
||||
Glen Gray <slaine@slaine.org>
|
||||
Hari Bathini <hbathini@linux.vnet.ibm.com>
|
||||
Hermann Gausterer <git-dracut-2012@mrq1.org>
|
||||
James Laska <jlaska@redhat.com>
|
||||
Jan Stodola <jstodola@redhat.com>
|
||||
Jiri Pirko <jiri@resnulli.us>
|
||||
Joe Lawrence <Joe.Lawrence@stratus.com>
|
||||
Julian Wolf <juwolf@suse.com>
|
||||
Kevin Yung <Kevin.Yung@myob.com>
|
||||
Kyle McMartin <kmcmarti@redhat.com>
|
||||
Kyle McMartin <kyle@redhat.com>
|
||||
Lars R. Damerow <lars@pixar.com>
|
||||
Lennert Buytenhek <buytenh@wantstofly.org>
|
||||
Lubomir Rintel <lkundrak@v3.sk>
|
||||
Lukas Wunner <lukas@wunner.de>
|
||||
Major Hayden <major@mhtx.net>
|
||||
Marian Csontos <mcsontos@redhat.com>
|
||||
Marko Myllynen <myllynen@redhat.com>
|
||||
Matt <smoothsailing72@hotmail.com>
|
||||
Matt Smith <shadowfax@gmx.com>
|
||||
Michal Schmidt <mschmidt@redhat.com>
|
||||
Mike Gorse <mgorse@suse.com>
|
||||
Munehiro Matsuda <haro@kgt.co.jp>
|
||||
Nicolas Chauvet <kwizart@gmail.com>
|
||||
NeilBrown <neilb@suse.de>
|
||||
Nikoli <nikoli@lavabit.com>
|
||||
Olivier Blin <dev@blino.org>
|
||||
P J P <ppandit@redhat.com>
|
||||
Paolo Bonzini <pbonzini@redhat.com>
|
||||
Peter Robinson <pbrobinson@fedoraproject.org>
|
||||
Praveen_Paladugu@Dell.com <Praveen_Paladugu@Dell.com>
|
||||
Pádraig Brady <P@draigBrady.com>
|
||||
Quentin Armitage <quentin@armitage.org.uk>
|
||||
Robert Buchholz <rbu@goodpoint.de>
|
||||
@@ -109,10 +123,13 @@ Sergey Fionov <fionov@gmail.com>
|
||||
Shawn W Dunn <sfalken@opensuse.org>
|
||||
Srinivasa T N <seenutn@linux.vnet.ibm.com>
|
||||
Thilo Bangert <thilo.bangert@gmx.net>
|
||||
Thomas Backlund <tmb@mageia.org>
|
||||
Tobias Geerinckx <tobias.geerinckx@gmail.com>
|
||||
Tom Gundersen <teg@jklm.no>
|
||||
Tomasz Torcz <tomek@pipebreaker.pl>
|
||||
Vadim Kuznetsov <vadimk@gentoo.org>
|
||||
Vaughan Cao <vaughan.cao@oracle.com>
|
||||
Ville Skyttä <ville.skytta@iki.fi>
|
||||
Vratislav Podzimek <vpodzime@redhat.com>
|
||||
Yanko Kaneti <yaneti@declera.com>
|
||||
jloeser <jloeser@suse.de>
|
||||
maximilian attems <max@stro.at>
|
||||
|
2
Makefile
2
Makefile
@@ -13,7 +13,7 @@ sysconfdir ?= ${prefix}/etc
|
||||
bindir ?= ${prefix}/bin
|
||||
mandir ?= ${prefix}/share/man
|
||||
CFLAGS ?= -O2 -g -Wall
|
||||
CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64 -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
|
||||
CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
|
||||
bashcompletiondir ?= ${datadir}/bash-completion/completions
|
||||
|
||||
man1pages = lsinitrd.1
|
||||
|
30
NEWS
30
NEWS
@@ -1,3 +1,33 @@
|
||||
dracut-041
|
||||
==========
|
||||
- fixed the shutdown loop
|
||||
- fixed gzip compression for versions, which do not have --rsyncable
|
||||
- fixed ifcfg generation for persistent interface names
|
||||
- multipath:
|
||||
* new option to turn off multipath "rd.multipath=0" completly
|
||||
* preload scsi dh modules
|
||||
* start multipathd via systemd service
|
||||
- do not fail, if user pressed ESC during media check
|
||||
- fixed systemd-journal by symlinking /var/log to /run/initramfs/log
|
||||
- initrd-release moved to /usr/lib
|
||||
- lots of iSCSI fixes
|
||||
- new "rd.timeout" to specify the systemd JobTimeoutSec for devices
|
||||
- if $initrd/etc/cmdline.d/* has a "root=" and the kernel cmdline does not,
|
||||
generate a mount unit for it
|
||||
- increased the initqueue timeout for non systemd initramfs to 180s
|
||||
- $initrd/etc/cmdline.d/ hostonly files are now generated for NFS
|
||||
- make use of systemd-hibernate-resume, if available
|
||||
- fixed ldconfig parsing for hwcap output
|
||||
- network: add support for comma separated autoconf options like ip=eth0:auto6,dhcp
|
||||
- new parameter "rd.live.overlay.size" to specify the overlay for live images
|
||||
- changed the test suite for the new sfdisk syntax
|
||||
- added cache tools for dm-cache setups
|
||||
|
||||
dracut-040
|
||||
==========
|
||||
- fixed dracut module dependency checks
|
||||
- fixed test suite
|
||||
|
||||
dracut-039
|
||||
==========
|
||||
- DRACUT_PATH can now be used to specify the PATH used by dracut
|
||||
|
@@ -1,14 +1,16 @@
|
||||
For the testsuite to work, you will have to install at least the following software packages:
|
||||
dash
|
||||
asciidoc
|
||||
mdadm
|
||||
lvm2
|
||||
cryptsetup
|
||||
nfs-utils
|
||||
netbsd-iscsi
|
||||
nbd
|
||||
dhcp (dhcp-server on openSUSE)
|
||||
dash \
|
||||
asciidoc \
|
||||
mdadm \
|
||||
lvm2 \
|
||||
cryptsetup \
|
||||
nfs-utils \
|
||||
netbsd-iscsi \
|
||||
nbd \
|
||||
dhcp-server \
|
||||
iscsi-initiator-utils
|
||||
|
||||
|
||||
TEST-04-FULL-SYSTEMD: systemd >= 187
|
||||
|
||||
How to run the testsuite:
|
||||
|
1
TODO
1
TODO
@@ -28,6 +28,7 @@ GENERATOR TODO
|
||||
|
||||
- report errors on missing files in check()
|
||||
- remove wait for swap devs, if no "resume=" is given on the kernel command line
|
||||
- remove wait for swap devs, if the "resume" dracut module is not included (omitted)
|
||||
- add presets (predefined set of modules)
|
||||
- add interpreter/plugin-scripts to be sourced at the beginning or end (can use dracut-functions)
|
||||
- add mechanism for module specific command line options
|
||||
|
@@ -104,17 +104,7 @@ fi
|
||||
|
||||
ldconfig_paths()
|
||||
{
|
||||
local a i
|
||||
declare -A a
|
||||
for i in $(
|
||||
ldconfig -pN 2>/dev/null | grep -F '=>' | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | while read a b c d; do
|
||||
d=${d%/*}
|
||||
printf "%s\n" "$d";
|
||||
done
|
||||
); do
|
||||
a["$i"]=1;
|
||||
done;
|
||||
printf "%s\n" ${!a[@]}
|
||||
ldconfig -pN 2>/dev/null | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | sed -n 's,.* => \(.*\)/.*,\1,p' | sort | uniq
|
||||
}
|
||||
|
||||
# Detect lib paths
|
||||
@@ -176,7 +166,13 @@ srcmods="/lib/modules/$kernel/"
|
||||
}
|
||||
export srcmods
|
||||
|
||||
if ! type dinfo >/dev/null 2>&1; then
|
||||
# is_func <command>
|
||||
# Check whether $1 is a function.
|
||||
is_func() {
|
||||
[[ "$(type -t "$1")" = "function" ]]
|
||||
}
|
||||
|
||||
if ! is_func dinfo >/dev/null 2>&1; then
|
||||
. "$dracutbasedir/dracut-logger.sh"
|
||||
dlog_init
|
||||
fi
|
||||
@@ -209,12 +205,6 @@ mksubdirs() {
|
||||
[[ -e ${1%/*} ]] || mkdir -m 0755 -p -- "${1%/*}"
|
||||
}
|
||||
|
||||
# is_func <command>
|
||||
# Check whether $1 is a function.
|
||||
is_func() {
|
||||
[[ "$(type -t "$1")" = "function" ]]
|
||||
}
|
||||
|
||||
# Function prints global variables in format name=value line by line.
|
||||
# $@ = list of global variables' name
|
||||
print_vars() {
|
||||
@@ -698,10 +688,12 @@ for_each_host_dev_and_slaves()
|
||||
# but you cannot create the logical volume without the volume group.
|
||||
# And the volume group might be bigger than the devices the LV needs.
|
||||
check_vol_slaves() {
|
||||
local _lv _vg _pv
|
||||
local _lv _vg _pv _dm
|
||||
for i in /dev/mapper/*; do
|
||||
[[ $i == /dev/mapper/control ]] && continue
|
||||
_lv=$(get_maj_min $i)
|
||||
_dm=/sys/dev/block/$_lv/dm
|
||||
[[ -f $_dm/uuid && $(<$_dm/uuid) =~ LVM-* ]] || continue
|
||||
if [[ $_lv = $2 ]]; then
|
||||
_vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null)
|
||||
# strip space
|
||||
@@ -743,6 +735,8 @@ fi
|
||||
|
||||
if ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/dracut-install ]]; then
|
||||
DRACUT_INSTALL=$dracutbasedir/dracut-install
|
||||
elif ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/install/dracut-install ]]; then
|
||||
DRACUT_INSTALL=$dracutbasedir/install/dracut-install
|
||||
fi
|
||||
|
||||
if ! [[ -x $DRACUT_INSTALL ]]; then
|
||||
@@ -1314,13 +1308,17 @@ check_mount() {
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
for _moddep in $(module_depends $_mod); do
|
||||
# handle deps as if they were manually added
|
||||
[[ " $add_dracutmodules " == *\ $_moddep\ * ]] || \
|
||||
add_dracutmodules+=" $_moddep "
|
||||
[[ " $force_add_dracutmodules " == *\ $_moddep\ * ]] || \
|
||||
force_add_dracutmodules+=" $_moddep "
|
||||
[[ " $dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& dracutmodules+=" $_moddep "
|
||||
[[ " $add_dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $add_dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& add_dracutmodules+=" $_moddep "
|
||||
[[ " $force_add_dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $force_add_dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& force_add_dracutmodules+=" $_moddep "
|
||||
# if a module we depend on fail, fail also
|
||||
if ! check_module $_moddep; then
|
||||
derror "dracut module '$_mod' depends on '$_moddep', which can't be installed"
|
||||
@@ -1358,7 +1356,7 @@ check_module() {
|
||||
fi
|
||||
|
||||
if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then
|
||||
if [[ " $force_add_dracutmodules " == *\ $_mod\ * ]]; then
|
||||
if [[ " $dracutmodules $force_add_dracutmodules " == *\ $_mod\ * ]]; then
|
||||
module_check $_mod 1; ret=$?
|
||||
else
|
||||
module_check $_mod 0; ret=$?
|
||||
@@ -1369,7 +1367,11 @@ check_module() {
|
||||
# module not in our list
|
||||
if [[ $dracutmodules = all ]]; then
|
||||
# check, if we can and should install this module
|
||||
module_check $_mod || return 1
|
||||
module_check $_mod; ret=$?
|
||||
if [[ $ret != 0 ]]; then
|
||||
[[ $2 ]] && return 1
|
||||
[[ $ret != 255 ]] && return 1
|
||||
fi
|
||||
else
|
||||
# skip this module
|
||||
return 1
|
||||
@@ -1378,10 +1380,15 @@ check_module() {
|
||||
|
||||
for _moddep in $(module_depends $_mod); do
|
||||
# handle deps as if they were manually added
|
||||
[[ " $add_dracutmodules " == *\ $_moddep\ * ]] || \
|
||||
add_dracutmodules+=" $_moddep "
|
||||
[[ " $force_add_dracutmodules " == *\ $_moddep\ * ]] || \
|
||||
force_add_dracutmodules+=" $_moddep "
|
||||
[[ " $dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& dracutmodules+=" $_moddep "
|
||||
[[ " $add_dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $add_dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& add_dracutmodules+=" $_moddep "
|
||||
[[ " $force_add_dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& [[ " $force_add_dracutmodules " != *\ $_moddep\ * ]] \
|
||||
&& force_add_dracutmodules+=" $_moddep "
|
||||
# if a module we depend on fail, fail also
|
||||
if ! check_module $_moddep; then
|
||||
derror "dracut module '$_mod' depends on '$_moddep', which can't be installed"
|
||||
@@ -1418,11 +1425,13 @@ for_each_module_dir() {
|
||||
[[ " $mods_to_load " == *\ $_mod\ * ]] && continue
|
||||
|
||||
[[ " $force_add_dracutmodules " != *\ $_mod\ * ]] \
|
||||
&& [[ " $dracutmodules " != *\ $_mod\ * ]] \
|
||||
&& [[ " $omit_dracutmodules " == *\ $_mod\ * ]] \
|
||||
&& continue
|
||||
|
||||
derror "dracut module '$_mod' cannot be found or installed."
|
||||
[[ " $force_add_dracutmodules " == *\ $_mod\ * ]] && exit 1
|
||||
[[ " $dracutmodules " == *\ $_mod\ * ]] && exit 1
|
||||
[[ " $add_dracutmodules " == *\ $_mod\ * ]] && exit 1
|
||||
done
|
||||
}
|
||||
@@ -1442,7 +1451,7 @@ install_kmod_with_fw() {
|
||||
|
||||
if [[ $omit_drivers ]]; then
|
||||
local _kmod=${1##*/}
|
||||
_kmod=${_kmod%.ko}
|
||||
_kmod=${_kmod%.ko*}
|
||||
_kmod=${_kmod/-/_}
|
||||
if [[ "$_kmod" =~ $omit_drivers ]]; then
|
||||
dinfo "Omitting driver $_kmod"
|
||||
@@ -1456,7 +1465,7 @@ install_kmod_with_fw() {
|
||||
|
||||
if [[ $silent_omit_drivers ]]; then
|
||||
local _kmod=${1##*/}
|
||||
_kmod=${_kmod%.ko}
|
||||
_kmod=${_kmod%.ko*}
|
||||
_kmod=${_kmod/-/_}
|
||||
[[ "$_kmod" =~ $silent_omit_drivers ]] && return 0
|
||||
[[ "${1##*/lib/modules/$kernel/}" =~ $silent_omit_drivers ]] && return 0
|
||||
@@ -1580,7 +1589,7 @@ module_is_host_only() {
|
||||
local _mod=$1
|
||||
local _modenc a i _k _s _v _aliases
|
||||
_mod=${_mod##*/}
|
||||
_mod=${_mod%.ko}
|
||||
_mod=${_mod%.ko*}
|
||||
_modenc=${_mod//-/_}
|
||||
|
||||
[[ " $add_drivers " == *\ ${_mod}\ * ]] && return 0
|
||||
@@ -1670,11 +1679,18 @@ instmods() {
|
||||
--*) _mpargs+=" $_mod" ;;
|
||||
*)
|
||||
_mod=${_mod##*/}
|
||||
# Check for aliased modules
|
||||
_modalias=$(modinfo -k $kernel -F filename $_mod 2> /dev/null)
|
||||
_modalias=${_modalias%.ko*}
|
||||
if [[ $_modalias ]] && [ "${_modalias##*/}" != "${_mod%.ko*}" ] ; then
|
||||
_mod=${_modalias##*/}
|
||||
fi
|
||||
|
||||
# if we are already installed, skip this module and go on
|
||||
# to the next one.
|
||||
if [[ $DRACUT_KERNEL_LAZY_HASHDIR ]] && \
|
||||
[[ -f "$DRACUT_KERNEL_LAZY_HASHDIR/${_mod%.ko}.ko" ]]; then
|
||||
read _ret <"$DRACUT_KERNEL_LAZY_HASHDIR/${_mod%.ko}.ko"
|
||||
[[ -f "$DRACUT_KERNEL_LAZY_HASHDIR/${_mod%.ko*}" ]]; then
|
||||
read _ret <"$DRACUT_KERNEL_LAZY_HASHDIR/${_mod%.ko*}"
|
||||
return $_ret
|
||||
fi
|
||||
|
||||
@@ -1704,7 +1720,7 @@ instmods() {
|
||||
((_ret+=$?))
|
||||
else
|
||||
[[ $DRACUT_KERNEL_LAZY_HASHDIR ]] && \
|
||||
echo $_mod >> "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist"
|
||||
echo ${_mod%.ko*} >> "$DRACUT_KERNEL_LAZY_HASHDIR/lazylist"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
@@ -1716,18 +1732,16 @@ instmods() {
|
||||
if (($# == 0)); then # filenames from stdin
|
||||
while read _mod; do
|
||||
inst1mod "${_mod%.ko*}" || {
|
||||
if [[ "$_check" == "yes" ]]; then
|
||||
[[ "$_silent" == "no" ]] && dfatal "Failed to install module $_mod"
|
||||
return 1
|
||||
if [[ "$_check" == "yes" ]] && [[ "$_silent" == "no" ]]; then
|
||||
dfatal "Failed to install module $_mod"
|
||||
fi
|
||||
}
|
||||
done
|
||||
fi
|
||||
while (($# > 0)); do # filenames as arguments
|
||||
inst1mod ${1%.ko*} || {
|
||||
if [[ "$_check" == "yes" ]]; then
|
||||
[[ "$_silent" == "no" ]] && dfatal "Failed to install module $1"
|
||||
return 1
|
||||
if [[ "$_check" == "yes" ]] && [[ "$_silent" == "no" ]]; then
|
||||
dfatal "Failed to install module $1"
|
||||
fi
|
||||
}
|
||||
shift
|
||||
|
@@ -2,6 +2,10 @@
|
||||
|
||||
set -e
|
||||
|
||||
# do some sanity checks first
|
||||
[ -e /run/initramfs/bin/sh ] && exit 0
|
||||
[ -e /run/initramfs/.need_shutdown ] || exit 0
|
||||
|
||||
KERNEL_VERSION="$(uname -r)"
|
||||
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
|
||||
|
@@ -142,11 +142,16 @@ Misc
|
||||
have been loaded. This parameter can be specified multiple times.
|
||||
|
||||
**rd.retry=**__<seconds>__::
|
||||
specify how long dracut should wait for devices to appear.
|
||||
specify how long dracut should retry the initqueue to configure devices.
|
||||
The default is 30 seconds. After 2/3 of the time, degraded raids are force
|
||||
started. If you have hardware, which takes a very long time to announce its
|
||||
drives, you might want to extend this value.
|
||||
|
||||
**rd.timeout=**__<seconds>__::
|
||||
specify how long dracut should wait for devices to appear. The
|
||||
default is '0', which means 'forever'. Note that this timeout
|
||||
should be longer than rd.retry to allow for proper configuration.
|
||||
|
||||
**rd.noverifyssl**::
|
||||
accept self-signed certificates for ssl downloads.
|
||||
|
||||
@@ -379,6 +384,11 @@ DM RAID
|
||||
only activate the raid sets with the given UUID. This parameter can be
|
||||
specified multiple times.
|
||||
|
||||
MULTIPATH
|
||||
~~~~~~~~~
|
||||
**rd.multipath=0**::
|
||||
disable multipath detection
|
||||
|
||||
FIPS
|
||||
~~~~
|
||||
**rd.fips**::
|
||||
@@ -952,6 +962,8 @@ rd_NO_MD:: rd.md=0
|
||||
|
||||
rd_MD_UUID:: rd.md.uuid
|
||||
|
||||
rd_NO_MULTIPATH: rd.multipath=0
|
||||
|
||||
rd_NFS_DOMAIN:: rd.nfs.domain
|
||||
|
||||
iscsi_initiator:: rd.iscsi.initiator
|
||||
|
@@ -2,8 +2,10 @@
|
||||
|
||||
# i18n
|
||||
i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP"
|
||||
i18n_default_font="latarcyrheb-sun16"
|
||||
i18n_default_font="eurlatgr"
|
||||
i18n_install_all="yes"
|
||||
|
||||
|
||||
stdloglvl=3
|
||||
sysloglvl=5
|
||||
install_optional_items+=" vi /etc/virc ps grep cat rm "
|
||||
@@ -13,3 +15,4 @@ systemdsystemunitdir=/usr/lib/systemd/system
|
||||
systemdsystemconfdir=/etc/systemd/system
|
||||
udevdir=/usr/lib/udev
|
||||
hostonly="yes"
|
||||
early_microcode="yes"
|
||||
|
@@ -1,3 +1,24 @@
|
||||
# SUSE specifc dracut settings
|
||||
#
|
||||
# SUSE by default always builds a as small as possible initrd for performance
|
||||
# and resource reasons.
|
||||
# If you like to build a generic initrd which works on other platforms than
|
||||
# on the one dracut/mkinitrd got called comment out below setting(s).
|
||||
hostonly="yes"
|
||||
hostonly_cmdline="yes"
|
||||
|
||||
compress="xz -0 --check=crc32 --memlimit-compress=50%"
|
||||
|
||||
i18n_vars="/etc/sysconfig/language:RC_LANG-LANG,RC_LC_ALL-LC_ALL /etc/sysconfig/console:CONSOLE_UNICODEMAP-FONT_UNIMAP,CONSOLE_FONT-FONT,CONSOLE_SCREENMAP-FONT_MAP /etc/sysconfig/keyboard:KEYTABLE-KEYMAP"
|
||||
omit_drivers+=" i2o_scsi"
|
||||
|
||||
# Below adds additional tools to the initrd which are not urgently necessary to
|
||||
# bring up the system, but help to debug problems.
|
||||
# See /usr/lib/dracut/modules.d/95debug/module-setup.sh which additional tools
|
||||
# are installed and add more if you need them. This specifically helps if you
|
||||
# use:
|
||||
# rd.break=[cmdline|pre-udev|pre-trigger|initqueue|pre-mount|
|
||||
# mount|pre-pivot|cleanup]
|
||||
# boot parameter or if you are forced to enter the dracut emergency shell.
|
||||
|
||||
# add_dracutmodules+=debug
|
||||
|
103
dracut.sh
103
dracut.sh
@@ -219,6 +219,16 @@ push() {
|
||||
done
|
||||
}
|
||||
|
||||
# Fills up host_devs stack variable and makes sure there are no duplicates
|
||||
push_host_devs() {
|
||||
local _dev
|
||||
for _dev in ${host_devs[@]}; do
|
||||
[ "$_dev" = "$1" ] && return
|
||||
done
|
||||
push host_devs "$1"
|
||||
}
|
||||
|
||||
|
||||
# function pop()
|
||||
# pops the last value from a stack
|
||||
# assigns value to second argument variable
|
||||
@@ -816,13 +826,29 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
|
||||
# eliminate IFS hackery when messing with fw_dir
|
||||
fw_dir=${fw_dir//:/ }
|
||||
|
||||
# check for logfile and try to create one if it doesn't exist
|
||||
if [[ -n "$logfile" ]];then
|
||||
if [[ ! -f "$logfile" ]];then
|
||||
touch "$logfile"
|
||||
if [ ! $? -eq 0 ] ;then
|
||||
printf "%s\n" "dracut: touch $logfile failed." >&2
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# handle compression options.
|
||||
[[ $compress ]] || compress="gzip"
|
||||
case $compress in
|
||||
bzip2) compress="bzip2 -9";;
|
||||
lzma) compress="lzma -9 -T0";;
|
||||
xz) compress="xz --check=crc32 --lzma2=dict=1MiB -T0";;
|
||||
gzip) compress="gzip -n -9 --rsyncable"; command -v pigz > /dev/null 2>&1 && compress="pigz -9 -n -T -R";;
|
||||
gzip) compress="gzip -n -9";
|
||||
if command -v pigz > /dev/null 2>&1; then
|
||||
compress="pigz -9 -n -T -R"
|
||||
elif command -v gzip --help 2>&1 | grep -q rsyncable; then
|
||||
compress="gzip -n -9 --rsyncable"
|
||||
fi
|
||||
;;
|
||||
lzo) compress="lzop -9";;
|
||||
lz4) compress="lz4 -l -9";;
|
||||
esac
|
||||
@@ -1045,26 +1071,42 @@ declare -A host_fs_types
|
||||
|
||||
for line in "${fstab_lines[@]}"; do
|
||||
set -- $line
|
||||
dev="$1"
|
||||
#dev mp fs fsopts
|
||||
push host_devs "$1"
|
||||
host_fs_types["$1"]="$3"
|
||||
case "$dev" in
|
||||
UUID=*)
|
||||
dev=$(blkid -l -t UUID=${dev#UUID=} -o device)
|
||||
;;
|
||||
LABEL=*)
|
||||
dev=$(blkid -l -t LABEL=${dev#LABEL=} -o device)
|
||||
;;
|
||||
PARTUUID=*)
|
||||
dev=$(blkid -l -t PARTUUID=${dev#PARTUUID=} -o device)
|
||||
;;
|
||||
PARTLABEL=*)
|
||||
dev=$(blkid -l -t PARTLABEL=${dev#PARTLABEL=} -o device)
|
||||
;;
|
||||
esac
|
||||
[ -z "$dev" ] && dwarn "Bad fstab entry $@" && continue
|
||||
push_host_devs "$dev"
|
||||
host_fs_types["$dev"]="$3"
|
||||
done
|
||||
|
||||
for f in $add_fstab; do
|
||||
[[ -e $f ]] || continue
|
||||
while read dev rest; do
|
||||
push host_devs "$dev"
|
||||
push_host_devs "$dev"
|
||||
done < "$f"
|
||||
done
|
||||
|
||||
for dev in $add_device; do
|
||||
push host_devs "$dev"
|
||||
push_host_devs "$dev"
|
||||
done
|
||||
|
||||
if (( ${#add_device_l[@]} )); then
|
||||
while pop add_device_l val; do
|
||||
add_device+=" $val "
|
||||
push host_devs "$val"
|
||||
push_host_devs "$val"
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -1093,9 +1135,9 @@ if [[ $hostonly ]]; then
|
||||
_dev=$(find_block_device "$mp")
|
||||
_bdev=$(readlink -f "/dev/block/$_dev")
|
||||
[[ -b $_bdev ]] && _dev=$_bdev
|
||||
push host_devs $_dev
|
||||
push_host_devs $_dev
|
||||
[[ "$mp" == "/" ]] && root_dev="$_dev"
|
||||
push host_devs "$_dev"
|
||||
push_host_devs "$_dev"
|
||||
done
|
||||
|
||||
if [[ -f /proc/swaps ]] && [[ -f /etc/fstab ]]; then
|
||||
@@ -1124,7 +1166,7 @@ if [[ $hostonly ]]; then
|
||||
done < /etc/crypttab
|
||||
fi
|
||||
|
||||
push host_devs "$(readlink -f "$dev")"
|
||||
push_host_devs "$(readlink -f "$dev")"
|
||||
break
|
||||
done < /etc/fstab
|
||||
done < /proc/swaps
|
||||
@@ -1189,7 +1231,7 @@ for dev in "${!host_fs_types[@]}"; do
|
||||
fi
|
||||
if [[ $journaldev ]]; then
|
||||
dev="$(readlink -f "$dev")"
|
||||
push host_devs "$dev"
|
||||
push_host_devs "$dev"
|
||||
_get_fs_type "$dev"
|
||||
check_block_and_slaves_all _get_fs_type "$(get_maj_min "$dev")"
|
||||
fi
|
||||
@@ -1220,7 +1262,17 @@ fi
|
||||
|
||||
[[ -d "$systemdsystemconfdir" ]] || systemdsystemconfdir=/etc/systemd/system
|
||||
|
||||
export initdir dracutbasedir dracutmodules \
|
||||
[[ -d $tmpfilesdir ]] \
|
||||
|| tmpfilesdir=$(pkg-config systemd --variable=tmpfilesdir 2>/dev/null)
|
||||
|
||||
if ! [[ -d "$tmpfilesdir" ]]; then
|
||||
[[ -f /lib/tmpfiles.d ]] && tmpfilesdir=/lib/tmpfiles.d
|
||||
[[ -f /usr/lib/tmpfiles.d ]] && tmpfilesdir=/usr/lib/tmpfiles.d
|
||||
fi
|
||||
|
||||
export initdir dracutbasedir \
|
||||
dracutmodules force_add_dracutmodules add_dracutmodules omit_dracutmodules \
|
||||
mods_to_load \
|
||||
fw_dir drivers_dir debug no_kernel kernel_only \
|
||||
omit_drivers mdadmconf lvmconf root_dev \
|
||||
use_fstab fstab_lines libdirs fscks nofscks ro_mnt \
|
||||
@@ -1228,7 +1280,8 @@ export initdir dracutbasedir dracutmodules \
|
||||
debug host_fs_types host_devs sshkey add_fstab \
|
||||
DRACUT_VERSION udevdir prefix filesystems drivers \
|
||||
systemdutildir systemdsystemunitdir systemdsystemconfdir \
|
||||
host_modalias host_modules hostonly_cmdline loginstall
|
||||
host_modalias host_modules hostonly_cmdline loginstall \
|
||||
tmpfilesdir
|
||||
|
||||
mods_to_load=""
|
||||
# check all our modules to see if they should be sourced.
|
||||
@@ -1283,7 +1336,6 @@ if [[ $kernel_only != yes ]]; then
|
||||
|
||||
ln -sfn ../run "$initdir/var/run"
|
||||
ln -sfn ../run/lock "$initdir/var/lock"
|
||||
ln -sfn ../run/log "$initdir/var/log"
|
||||
else
|
||||
for d in lib "$libdir"; do
|
||||
[[ -e "${initdir}${prefix}/$d" ]] && continue
|
||||
@@ -1418,9 +1470,7 @@ if [[ $kernel_only != yes ]]; then
|
||||
|
||||
if [[ $DRACUT_RESOLVE_LAZY ]] && [[ $DRACUT_INSTALL ]]; then
|
||||
dinfo "*** Resolving executable dependencies ***"
|
||||
find "$initdir" -type f \
|
||||
'(' -perm -0100 -or -perm -0010 -or -perm -0001 ')' \
|
||||
-not -path '*.ko' -print0 \
|
||||
find "$initdir" -type f -perm /0111 -not -path '*.ko' -print0 \
|
||||
| xargs -r -0 $DRACUT_INSTALL ${initdir:+-D "$initdir"} -R ${DRACUT_FIPS_MODE:+-H} --
|
||||
dinfo "*** Resolving executable dependencies done***"
|
||||
fi
|
||||
@@ -1441,12 +1491,13 @@ while pop include_src src && pop include_target tgt; do
|
||||
inst $src $tgt
|
||||
else
|
||||
ddebug "Including directory: $src"
|
||||
mkdir -p "${initdir}/${tgt}"
|
||||
destdir="${initdir}/${tgt}"
|
||||
mkdir -p "$destdir"
|
||||
# check for preexisting symlinks, so we can cope with the
|
||||
# symlinks to $prefix
|
||||
for i in "$src"/*; do
|
||||
[[ -e "$i" || -h "$i" ]] || continue
|
||||
s=${initdir}/${tgt}/${i#$src/}
|
||||
s=${destdir}/${i#$src/}
|
||||
if [[ -d "$i" ]]; then
|
||||
if ! [[ -e "$s" ]]; then
|
||||
mkdir -m 0755 -p "$s"
|
||||
@@ -1454,7 +1505,7 @@ while pop include_src src && pop include_target tgt; do
|
||||
fi
|
||||
cp --reflink=auto --sparse=auto -fa -t "$s" "$i"/*
|
||||
else
|
||||
cp --reflink=auto --sparse=auto -fa -t "$s" "$i"
|
||||
cp --reflink=auto --sparse=auto -fa -t "$destdir" "$i"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@@ -1568,6 +1619,20 @@ if ! ( echo $PARMS_TO_STORE > $initdir/lib/dracut/build-parameter.txt ); then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $hostonly_cmdline ]] ; then
|
||||
unset _stored_cmdline
|
||||
if [ -d $initdir/etc/cmdline.d ];then
|
||||
dinfo "Stored kernel commandline:"
|
||||
for conf in $initdir/etc/cmdline.d/*.conf ; do
|
||||
[ -e "$conf" ] || continue
|
||||
dinfo "$(< $conf)"
|
||||
_stored_cmdline=1
|
||||
done
|
||||
fi
|
||||
if ! [[ $_stored_cmdline ]]; then
|
||||
dinfo "No dracut internal kernel commandline stored in initrd"
|
||||
fi
|
||||
fi
|
||||
rm -f -- "$outfile"
|
||||
dinfo "*** Creating image file ***"
|
||||
|
||||
|
@@ -246,23 +246,6 @@ specified multiple times.
|
||||
If your root partition is on a network drive, you have to have the network
|
||||
dracut modules installed to create a network aware initramfs image.
|
||||
|
||||
On a Red Hat Enterprise Linux or Fedora system, this means, you have to install
|
||||
the _dracut-network_ rpm package:
|
||||
|
||||
|
||||
----
|
||||
# yum install dracut-network
|
||||
----
|
||||
|
||||
The resulting initramfs image can be served by a boot manager residing on your
|
||||
local hard drive or it can be served by a PXE/TFTP server.
|
||||
|
||||
How to setup your PXE/TFTP server can be found in the
|
||||
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/[Red
|
||||
Hat Enterprise Linux 6 Storage Administration Guide]
|
||||
or http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/[Red
|
||||
Hat Enterprise Linux 7 Storage Administration Guide].
|
||||
|
||||
If you specify ip=dhcp on the kernel command line, then dracut asks a dhcp
|
||||
server about the ip adress for the machine. The dhcp server can also serve an
|
||||
additional root-path, which will set the root device for dracut. With this
|
||||
@@ -302,7 +285,7 @@ This will reduce the size of the initramfs image significantly.
|
||||
If the boot process does not succeed, you have several options to debug the
|
||||
situation. Some of the basic operations are covered here. For more information
|
||||
you should also visit:
|
||||
http://fedoraproject.org/wiki/How_to_debug_Dracut_problems
|
||||
https://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
|
||||
|
||||
|
||||
[[identifying-your-problem-area]]
|
||||
|
@@ -76,7 +76,9 @@ OPTIONS
|
||||
|
||||
**-A**::
|
||||
Create a so called "monster initrd" which includes all available
|
||||
features and modules.
|
||||
features and modules. This calls dracut with --no-hostonly and
|
||||
--no-hostonly-cmdline parameters internally, instead of the default
|
||||
--hostonly and --hostonly-cmdline.
|
||||
|
||||
**-v, --verbose**::
|
||||
increase verbosity level
|
||||
@@ -85,9 +87,6 @@ OPTIONS
|
||||
Disable logging to _/var/log/YaST2/mkinitrd.log_. This is useful for
|
||||
testing if you don’t want to clutter the system log.
|
||||
|
||||
**--force**::
|
||||
overwrite existing initramfs file.
|
||||
|
||||
**--help**::
|
||||
print a help message and exit.
|
||||
|
||||
|
@@ -20,8 +20,6 @@
|
||||
|
||||
boot_dir="/boot"
|
||||
quiet=0
|
||||
host_only=1
|
||||
force=0
|
||||
logfile=/var/log/YaST2/mkinitrd.log
|
||||
dracut_cmd=dracut
|
||||
|
||||
@@ -68,10 +66,7 @@ usage () {
|
||||
$cmd " -j device Journal device"
|
||||
$cmd " -D interface Run dhcp on the specified interface."
|
||||
$cmd " -I interface Configure the specified interface statically."
|
||||
$cmd " -a acpi_dsdt Attach compiled ACPI DSDT (Differentiated"
|
||||
$cmd " System Description Table) to initrd. This"
|
||||
$cmd " replaces the DSDT of the BIOS. Defaults to"
|
||||
$cmd " the ACPI_DSDT variable in /etc/sysconfig/kernel."
|
||||
$cmd " -a acpi_dsdt Obsolete, do not use."
|
||||
$cmd " -s size Add splash animation and bootscreen to initrd."
|
||||
|
||||
[[ $1 = '-n' ]] && exit 0
|
||||
@@ -204,8 +199,6 @@ default_kernel_images() {
|
||||
for initrd_image in $initrd_images;do
|
||||
targets="$targets $initrd_image"
|
||||
done
|
||||
host_only=1
|
||||
force=1
|
||||
}
|
||||
|
||||
while (($# > 0)); do
|
||||
@@ -218,8 +211,6 @@ while (($# > 0)); do
|
||||
for kernel_image in $kernel_images;do
|
||||
kernels="$kernels ${kernel_image#*-}"
|
||||
done
|
||||
host_only=1
|
||||
force=1
|
||||
;;
|
||||
-i) read_arg initrd_images "$@" || shift $?
|
||||
for initrd_image in $initrd_images;do
|
||||
@@ -261,7 +252,7 @@ while (($# > 0)); do
|
||||
dracut_cmdline="${dracut_cmdline} ip=$(ipconfig $static_if)":
|
||||
;;
|
||||
-a) read_arg acpi_dsdt "$@" || shift $?
|
||||
echo "mkinitrd: custom DSDT not yet supported"
|
||||
echo "Obsolete -a param, use acpi_table_dir= and acpi_override= variables in /etc/dracut.conf.d/"
|
||||
exit 1
|
||||
;;
|
||||
-s) read_arg boot_splash "$@" || shift $?
|
||||
@@ -275,7 +266,6 @@ while (($# > 0)); do
|
||||
--version|-R)
|
||||
echo "mkinitrd: dracut compatibility wrapper"
|
||||
exit 0;;
|
||||
--force) force=1;;
|
||||
--quiet|-q) quiet=1;;
|
||||
*) if [[ ! $targets ]]; then
|
||||
targets=$1
|
||||
@@ -289,15 +279,17 @@ while (($# > 0)); do
|
||||
done
|
||||
|
||||
[[ $targets && $kernels ]] || default_kernel_images
|
||||
[[ $targets && $kernels ]] || (error "No kernel found in $boot_dir" && usage)
|
||||
if [[ ! $targets || ! $kernels ]];then
|
||||
error "No kernel found in $boot_dir"
|
||||
fi
|
||||
|
||||
# We can have several targets/kernels, transform the list to an array
|
||||
targets=( $targets )
|
||||
[[ $kernels ]] && kernels=( $kernels )
|
||||
|
||||
[[ $logfile ]] && dracut_args="${dracut_args} --logfile $logfile"
|
||||
[[ $host_only == 1 ]] && dracut_args="${dracut_args} --hostonly"
|
||||
[[ $force == 1 ]] && dracut_args="${dracut_args} --force"
|
||||
dracut_args="${dracut_args} --force"
|
||||
|
||||
[[ $dracut_cmdline ]] && dracut_args="${dracut_args} --kernel-cmdline ${dracut_cmdline}"
|
||||
[ -z "$(type -p update-bootloader)" ] && skip_update_bootloader=1
|
||||
|
||||
@@ -306,11 +298,9 @@ if [ -f /etc/sysconfig/kernel ] ; then
|
||||
. /etc/sysconfig/kernel
|
||||
fi
|
||||
[[ $module_list ]] || module_list="${INITRD_MODULES}"
|
||||
basicmodules="$basicmodules ${module_list}"
|
||||
[[ $domu_module_list ]] || domu_module_list="${DOMU_INITRD_MODULES}"
|
||||
[[ $acpi_dsdt ]] || acpi_dsdt="${ACPI_DSDT}"
|
||||
shopt -s extglob
|
||||
|
||||
echo "Creating: target|kernel|dracut args|basicmodules "
|
||||
for ((i=0 ; $i<${#targets[@]} ; i++)); do
|
||||
|
||||
if [[ $img_vers ]];then
|
||||
@@ -320,28 +310,34 @@ for ((i=0 ; $i<${#targets[@]} ; i++)); do
|
||||
fi
|
||||
kernel="${kernels[$i]}"
|
||||
|
||||
if is_xen_kernel $kernel $rootfs ; then
|
||||
modules_all="${module_list} ${domu_module_list}"
|
||||
else
|
||||
modules_all="${module_list}"
|
||||
fi
|
||||
|
||||
# Remove leading and trailing spaces needs (set above): shopt -s extglob
|
||||
modules_all=${modules_all%%+([[:space:]])}
|
||||
modules_all=${modules_all##+([[:space:]])}
|
||||
|
||||
echo "Creating initrd: $target"
|
||||
|
||||
# Duplicate code: No way found how to redirect output based on $quiet
|
||||
if [[ $quiet == 1 ]];then
|
||||
echo "$target|$kernel|$dracut_args|$basicmodules"
|
||||
if is_xen_kernel $kernel $rootfs ; then
|
||||
basicmodules="$basicmodules ${domu_module_list}"
|
||||
fi
|
||||
if [[ $basicmodules ]]; then
|
||||
$dracut_cmd $dracut_args --add-drivers "$basicmodules" "$target" \
|
||||
"$kernel" &>/dev/null
|
||||
else
|
||||
# Duplicate code: --force-drivers must not be called with empty string
|
||||
# -> dracut bug workarounded ugly, because of complex whitespace
|
||||
# expansion magics
|
||||
if [ -n "${modules_all}" ];then
|
||||
$dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel" &>/dev/null
|
||||
else
|
||||
$dracut_cmd $dracut_args "$target" "$kernel" &>/dev/null
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if is_xen_kernel $kernel $rootfs ; then
|
||||
basicmodules="$basicmodules ${domu_module_list}"
|
||||
fi
|
||||
if [[ $basicmodules ]]; then
|
||||
$dracut_cmd $dracut_args --add-drivers "$basicmodules" "$target" \
|
||||
"$kernel"
|
||||
else
|
||||
if [ -n "${modules_all}" ];then
|
||||
$dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel"
|
||||
else
|
||||
$dracut_cmd $dracut_args "$target" "$kernel"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
@@ -40,7 +40,8 @@ install() {
|
||||
|
||||
inst_libdir_file libsoftokn3.so libsoftokn3.so \
|
||||
libsoftokn3.chk libfreebl3.so libfreebl3.chk \
|
||||
libssl.so 'hmaccalc/sha512hmac.hmac' libssl.so.10
|
||||
libssl.so 'hmaccalc/sha512hmac.hmac' libssl.so.10 \
|
||||
libfreeblpriv3.so libfreeblpriv3.chk
|
||||
|
||||
inst_multiple -o prelink
|
||||
inst_simple /etc/system-fips
|
||||
|
@@ -216,7 +216,7 @@ if [ -e /tmp/team.info ]; then
|
||||
fi
|
||||
done
|
||||
# Do not add slaves now
|
||||
teamd -d -U -n -t $teammaster -f /etc/teamd/$teammaster.conf
|
||||
teamd -d -U -n -N -t $teammaster -f /etc/teamd/$teammaster.conf
|
||||
for slave in $working_slaves; do
|
||||
# team requires the slaves to be down before joining team
|
||||
ip link set $slave down
|
||||
@@ -324,17 +324,19 @@ for p in $(getargs ip=); do
|
||||
eval '[ "$'$i'" ] && echo '$i'="$'$i'"'
|
||||
done > /tmp/net.$netif.override
|
||||
|
||||
case $autoconf in
|
||||
dhcp|on|any)
|
||||
do_dhcp -4 ;;
|
||||
dhcp6)
|
||||
load_ipv6
|
||||
do_dhcp -6 ;;
|
||||
auto6)
|
||||
do_ipv6auto ;;
|
||||
*)
|
||||
do_static ;;
|
||||
esac
|
||||
for autoopt in $(str_replace "$autoconf" "," " "); do
|
||||
case $autoopt in
|
||||
dhcp|on|any)
|
||||
do_dhcp -4 ;;
|
||||
dhcp6)
|
||||
load_ipv6
|
||||
do_dhcp -6 ;;
|
||||
auto6)
|
||||
do_ipv6auto ;;
|
||||
*)
|
||||
do_static ;;
|
||||
esac
|
||||
done
|
||||
|
||||
> /tmp/net.${netif}.up
|
||||
|
||||
|
@@ -17,6 +17,7 @@ depends() {
|
||||
# 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'
|
||||
@@ -79,7 +80,8 @@ install() {
|
||||
inst_script "$moddir/netroot.sh" "/sbin/netroot"
|
||||
inst_script "$moddir/dhclient-script.sh" "/sbin/dhclient-script"
|
||||
inst_simple "$moddir/net-lib.sh" "/lib/net-lib.sh"
|
||||
inst_simple "$moddir/dhclient.conf" "/etc/dhclient.conf"
|
||||
inst_simple -H "/etc/dhclient.conf"
|
||||
cat "$moddir/dhclient.conf" >> "${initdir}/etc/dhclient.conf"
|
||||
inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
|
||||
inst_hook pre-udev 60 "$moddir/net-genrules.sh"
|
||||
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
|
||||
|
@@ -105,7 +105,7 @@ setup_net() {
|
||||
# add static route
|
||||
for _p in $(getargs rd.route); do
|
||||
route_to_var "$_p" || continue
|
||||
[ -n "$route_dev" ] && [ "$route_dev" != "$netif"] && continue
|
||||
[ -n "$route_dev" ] && [ "$route_dev" != "$netif" ] && continue
|
||||
ip route add "$route_mask" ${route_gw:+via "$route_gw"} ${route_dev:+dev "$route_dev"}
|
||||
if strstr ":" "$route_mask"; then
|
||||
printf -- "%s\n" "$route_mask ${route_gw:+via $route_gw} ${route_dev:+dev $route_dev}" \
|
||||
@@ -308,6 +308,23 @@ parse_iscsi_root()
|
||||
;;
|
||||
esac
|
||||
|
||||
unset iscsi_target_name
|
||||
# extract target name
|
||||
case "$v" in
|
||||
*:iqn.*)
|
||||
iscsi_target_name=iqn.${v##*:iqn.}
|
||||
v=${v%:iqn.*}:
|
||||
;;
|
||||
*:eui.*)
|
||||
iscsi_target_name=eui.${v##*:eui.}
|
||||
v=${v%:eui.*}:
|
||||
;;
|
||||
*:naa.*)
|
||||
iscsi_target_name=naa.${v##*:naa.}
|
||||
v=${v%:naa.*}:
|
||||
;;
|
||||
esac
|
||||
|
||||
# parse the rest
|
||||
OLDIFS="$IFS"
|
||||
IFS=:
|
||||
@@ -317,24 +334,33 @@ parse_iscsi_root()
|
||||
iscsi_protocol=$1; shift # ignored
|
||||
iscsi_target_port=$1; shift
|
||||
|
||||
if [ -n "$iscsi_target_name" ]; then
|
||||
if [ $# -eq 3 ]; then
|
||||
iscsi_iface_name=$1; shift
|
||||
fi
|
||||
if [ $# -eq 2 ]; then
|
||||
iscsi_netdev_name=$1; shift
|
||||
fi
|
||||
iscsi_lun=$1; shift
|
||||
if [ $# -ne 0 ]; then
|
||||
warn "Invalid parameter in iscsi: parameter!"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
|
||||
if [ $# -gt 3 ] && [ -n "$1$2" ]; then
|
||||
iscsi_iface_name=$1; shift
|
||||
iscsi_netdev_name=$1; shift
|
||||
if [ -z "$3" ] || [ "$3" -ge 0 ] 2>/dev/null ; then
|
||||
iscsi_iface_name=$1; shift
|
||||
iscsi_netdev_name=$1; shift
|
||||
fi
|
||||
fi
|
||||
|
||||
iscsi_lun=$1; shift
|
||||
|
||||
if [ $# -gt 2 ]; then
|
||||
warn "Invalid parameter in iscsi: parameter!"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ $# -eq 2 ]; then
|
||||
iscsi_target_name="$1:$2"
|
||||
else
|
||||
iscsi_target_name="$1"
|
||||
fi
|
||||
|
||||
iscsi_target_name=$(printf "%s:" "$@")
|
||||
iscsi_target_name=${iscsi_target_name%:}
|
||||
}
|
||||
|
||||
ip_to_var() {
|
||||
@@ -551,7 +577,19 @@ find_iface_with_link() {
|
||||
}
|
||||
|
||||
is_persistent_ethernet_name() {
|
||||
case "$1" in
|
||||
local _netif="$1"
|
||||
local _name_assign_type="0"
|
||||
|
||||
[ -f "/sys/class/net/$_netif/name_assign_type" ] \
|
||||
&& _name_assign_type=$(cat "/sys/class/net/$_netif/name_assign_type")
|
||||
|
||||
# NET_NAME_ENUM 1
|
||||
[ "$_name_assign_type" = "1" ] && return 1
|
||||
|
||||
# NET_NAME_PREDICTABLE 2
|
||||
[ "$_name_assign_type" = "2" ] && return 0
|
||||
|
||||
case "$_netif" in
|
||||
# udev persistent interface names
|
||||
eno[0-9]|eno[0-9][0-9]|eno[0-9][0-9][0-9]*)
|
||||
;;
|
||||
@@ -571,3 +609,35 @@ is_persistent_ethernet_name() {
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
is_kernel_ethernet_name() {
|
||||
local _netif="$1"
|
||||
local _name_assign_type="1"
|
||||
|
||||
if [ -e "/sys/class/net/$_netif/name_assign_type" ]; then
|
||||
_name_assign_type=$(cat "/sys/class/net/$_netif/name_assign_type")
|
||||
|
||||
case "$_name_assign_type" in
|
||||
2|3|4)
|
||||
# NET_NAME_PREDICTABLE 2
|
||||
# NET_NAME_USER 3
|
||||
# NET_NAME_RENAMED 4
|
||||
return 1
|
||||
;;
|
||||
1|*)
|
||||
# NET_NAME_ENUM 1
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# fallback to error prone manual name check
|
||||
case "$_netif" in
|
||||
eth[0-9]|eth[0-9][0-9]|eth[0-9][0-9][0-9]*)
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
return 1
|
||||
esac
|
||||
|
||||
}
|
||||
|
@@ -64,24 +64,26 @@ for p in $(getargs ip=); do
|
||||
fi
|
||||
|
||||
# Error checking for autoconf in combination with other values
|
||||
case $autoconf in
|
||||
error) die "Error parsing option 'ip=$p'";;
|
||||
bootp|rarp|both) die "Sorry, ip=$autoconf is currenty unsupported";;
|
||||
none|off)
|
||||
[ -z "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nValue '$autoconf' without static configuration does not make sense"
|
||||
[ -z "$mask" ] && \
|
||||
die "Sorry, automatic calculation of netmask is not yet supported"
|
||||
;;
|
||||
auto6);;
|
||||
dhcp|dhcp6|on|any) \
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
|
||||
die "Sorry, 'ip=$p' does not make sense for multiple interface configurations"
|
||||
[ -n "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoconf'"
|
||||
;;
|
||||
*) die "For argument 'ip=$p'\nSorry, unknown value '$autoconf'";;
|
||||
esac
|
||||
for autoopt in $(str_replace "$autoconf" "," " "); do
|
||||
case $autoopt in
|
||||
error) die "Error parsing option 'ip=$p'";;
|
||||
bootp|rarp|both) die "Sorry, ip=$autoopt is currenty unsupported";;
|
||||
none|off)
|
||||
[ -z "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nValue '$autoopt' without static configuration does not make sense"
|
||||
[ -z "$mask" ] && \
|
||||
die "Sorry, automatic calculation of netmask is not yet supported"
|
||||
;;
|
||||
auto6);;
|
||||
dhcp|dhcp6|on|any) \
|
||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \
|
||||
die "Sorry, 'ip=$p' does not make sense for multiple interface configurations"
|
||||
[ -n "$ip" ] && \
|
||||
die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoopt'"
|
||||
;;
|
||||
*) die "For argument 'ip=$p'\nSorry, unknown value '$autoopt'";;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -n "$dev" ] ; then
|
||||
# We don't like duplicate device configs
|
||||
|
@@ -80,18 +80,41 @@ print_s390() {
|
||||
return 0
|
||||
}
|
||||
|
||||
hw_bind() {
|
||||
local _netif="$1"
|
||||
local _macaddr="$2"
|
||||
|
||||
[ -n "$_macaddr" ] \
|
||||
&& echo "MACADDR=\"$_macaddr\""
|
||||
|
||||
print_s390 "$_netif" \
|
||||
&& return 0
|
||||
|
||||
[ -n "$_macaddr" ] && return 0
|
||||
|
||||
is_persistent_ethernet_name "$_netif" && return 0
|
||||
|
||||
[ -f "/sys/class/net/$_netif/addr_assign_type" ] \
|
||||
&& [ "$(cat "/sys/class/net/$_netif/addr_assign_type")" != "0" ] \
|
||||
&& return 1
|
||||
|
||||
[ -f "/sys/class/net/$_netif/address" ] \
|
||||
|| return 1
|
||||
|
||||
echo "HWADDR=\"$(cat /sys/class/net/$_netif/address)\""
|
||||
}
|
||||
|
||||
interface_bind() {
|
||||
local netif="$1"
|
||||
local macaddr="$2"
|
||||
if ! print_s390 $netif; then
|
||||
if [ -z "$macaddr" ] && \
|
||||
! is_persistent_ethernet_name "$netif" && \
|
||||
[ -f /sys/class/net/$netif/addr_assign_type ] && \
|
||||
[ "$(cat /sys/class/net/$netif/addr_assign_type)" = "0" ] && \
|
||||
[ -f /sys/class/net/$netif/address ]; then
|
||||
echo "HWADDR=\"$(cat /sys/class/net/$netif/address)\""
|
||||
fi
|
||||
local _netif="$1"
|
||||
local _macaddr="$2"
|
||||
|
||||
# see, if we can bind it to some hw parms
|
||||
if hw_bind "$_netif" "$_macaddr"; then
|
||||
# only print out DEVICE, if it's user assigned
|
||||
is_kernel_ethernet_name "$_netif" && return 0
|
||||
fi
|
||||
|
||||
echo "DEVICE=\"$_netif\""
|
||||
}
|
||||
|
||||
for netup in /tmp/net.*.did-setup ; do
|
||||
@@ -129,7 +152,8 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
|
||||
{
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=\"$netif\""
|
||||
echo "NAME=\"$netif\""
|
||||
interface_bind "$netif" "$macaddr"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "UUID=\"$uuid\""
|
||||
@@ -175,10 +199,7 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
if [ -z "$bridge" ] && [ -z "$bond" ] && [ -z "$vlan" ]; then
|
||||
# standard interface
|
||||
{
|
||||
[ -n "$macaddr" ] && echo "MACADDR=\"$macaddr\""
|
||||
interface_bind "$netif" "$macaddr"
|
||||
echo "TYPE=Ethernet"
|
||||
echo "NAME=\"$netif\""
|
||||
[ -n "$mtu" ] && echo "MTU=\"$mtu\""
|
||||
} >> /tmp/ifcfg/ifcfg-$netif
|
||||
fi
|
||||
@@ -205,16 +226,15 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
(
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=\"$slave\""
|
||||
echo "NAME=\"$slave\""
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "SLAVE=yes"
|
||||
echo "MASTER=\"$netif\""
|
||||
echo "NAME=\"$slave\""
|
||||
echo "UUID=\"$(cat /proc/sys/kernel/random/uuid)\""
|
||||
unset macaddr
|
||||
[ -e /tmp/net.$slave.override ] && . /tmp/net.$slave.override
|
||||
[ -n "$macaddr" ] && echo "MACADDR=\"$macaddr\""
|
||||
interface_bind "$slave" "$macaddr"
|
||||
) >> /tmp/ifcfg/ifcfg-$slave
|
||||
done
|
||||
@@ -230,15 +250,14 @@ for netup in /tmp/net.*.did-setup ; do
|
||||
# write separate ifcfg file for the raw eth interface
|
||||
(
|
||||
echo "# Generated by dracut initrd"
|
||||
echo "DEVICE=\"$slave\""
|
||||
echo "NAME=\"$slave\""
|
||||
echo "TYPE=Ethernet"
|
||||
echo "ONBOOT=yes"
|
||||
echo "NETBOOT=yes"
|
||||
echo "BRIDGE=\"$bridgename\""
|
||||
echo "NAME=\"$slave\""
|
||||
echo "UUID=\"$(cat /proc/sys/kernel/random/uuid)\""
|
||||
unset macaddr
|
||||
[ -e /tmp/net.$slave.override ] && . /tmp/net.$slave.override
|
||||
[ -n "$macaddr" ] && echo "MACADDR=\"$macaddr\""
|
||||
interface_bind "$slave" "$macaddr"
|
||||
) >> /tmp/ifcfg/ifcfg-$slave
|
||||
done
|
||||
|
@@ -7,6 +7,7 @@ mkdir -m 0755 -p /run/initramfs/state/etc/sysconfig/network-scripts
|
||||
function cms_write_config()
|
||||
{
|
||||
. /tmp/cms.conf
|
||||
SUBCHANNELS="$(echo $SUBCHANNELS | sed 'y/ABCDEF/abcdef/')"
|
||||
OLDIFS=$IFS
|
||||
IFS=,
|
||||
read -a subch_array <<< "indexzero,$SUBCHANNELS"
|
||||
|
@@ -50,8 +50,8 @@ cmdline() {
|
||||
install() {
|
||||
|
||||
if [[ $hostonly_cmdline == "yes" ]]; then
|
||||
cmdline >> "${initdir}/etc/cmdline.d/90crypt.conf"
|
||||
echo >> "${initdir}/etc/cmdline.d/90crypt.conf"
|
||||
local _cryptconf=$(cmdline)
|
||||
[[ $_cryptconf ]] && printf "%s\n" "$_cryptconf" >> "${initdir}/etc/cmdline.d/90crypt.conf"
|
||||
fi
|
||||
|
||||
inst_multiple cryptsetup rmdir readlink umount
|
||||
|
@@ -64,8 +64,8 @@ install() {
|
||||
local _i
|
||||
|
||||
if [[ $hostonly_cmdline == "yes" ]]; then
|
||||
cmdline >> "${initdir}/etc/cmdline.d/90dmraid.conf"
|
||||
echo >> "${initdir}/etc/cmdline.d/90dmraid.conf"
|
||||
local _raidconf=$(cmdline)
|
||||
[[ $_raidconf ]] && printf "%s\n" "$_raidconf" >> "${initdir}/etc/cmdline.d/90dmraid.conf"
|
||||
fi
|
||||
|
||||
inst_multiple dmraid
|
||||
@@ -74,8 +74,6 @@ install() {
|
||||
|
||||
inst "$moddir/dmraid.sh" /sbin/dmraid_scan
|
||||
|
||||
inst_rules 64-md-raid.rules
|
||||
|
||||
inst_libdir_file "libdmraid-events*.so*"
|
||||
|
||||
inst_rules "$moddir/61-dmraid-imsm.rules"
|
||||
|
@@ -11,3 +11,4 @@ StandardInput=tty-force
|
||||
StandardOutput=inherit
|
||||
StandardError=inherit
|
||||
TimeoutSec=0
|
||||
SuccessExitStatus=2
|
||||
|
@@ -3,10 +3,10 @@
|
||||
case "$root" in
|
||||
live:/dev/*)
|
||||
{
|
||||
printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
|
||||
${root#live:/dev/}
|
||||
printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
|
||||
${root#live:/dev/}
|
||||
printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root %s"\n' \
|
||||
"${root#live:/dev/}" "${root#live:}"
|
||||
printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root %s"\n' \
|
||||
"${root#live:/dev/}" "${root#live:}"
|
||||
} >> /etc/udev/rules.d/99-live-squash.rules
|
||||
wait_for_dev -n "${root#live:}"
|
||||
;;
|
||||
|
@@ -27,6 +27,8 @@ getargbool 0 rd.live.overlay.reset -d -y reset_overlay && reset_overlay="yes"
|
||||
getargbool 0 rd.live.overlay.readonly -d -y readonly_overlay && readonly_overlay="--readonly" || readonly_overlay=""
|
||||
overlay=$(getarg rd.live.overlay -d overlay)
|
||||
getargbool 0 rd.writable.fsimg -d -y writable_fsimg && writable_fsimg="yes"
|
||||
overlay_size=$(getarg rd.live.overlay.size=)
|
||||
[ -z "$overlay_size" ] && overlay_size=512
|
||||
|
||||
# CD/DVD media check
|
||||
[ -b $livedev ] && fs=$(blkid -s TYPE -o value $livedev)
|
||||
@@ -42,7 +44,7 @@ if [ -n "$check" ]; then
|
||||
else
|
||||
checkisomd5 --verbose $livedev
|
||||
fi
|
||||
if [ $? -ne 0 ]; then
|
||||
if [ $? -eq 1 ]; then
|
||||
die "CD check failed!"
|
||||
exit 1
|
||||
fi
|
||||
@@ -125,7 +127,7 @@ do_live_overlay() {
|
||||
sleep 5
|
||||
fi
|
||||
|
||||
dd if=/dev/null of=/overlay bs=1024 count=1 seek=$((512*1024)) 2> /dev/null
|
||||
dd if=/dev/null of=/overlay bs=1024 count=1 seek=$((overlay_size*1024)) 2> /dev/null
|
||||
if [ -n "$setup" -a -n "$readonly_overlay" ]; then
|
||||
RO_OVERLAY_LOOPDEV=$( losetup -f )
|
||||
losetup $RO_OVERLAY_LOOPDEV /overlay
|
||||
@@ -162,9 +164,9 @@ fi
|
||||
|
||||
if [ -n "$OSMINSQFS" ]; then
|
||||
# decompress the delta data
|
||||
dd if=$OSMINSQFS of=/osmin.img 2> /dev/null
|
||||
dd if=$OSMINSQFS of=/run/initramfs/osmin.img 2> /dev/null
|
||||
OSMIN_SQUASHED_LOOPDEV=$( losetup -f )
|
||||
losetup -r $OSMIN_SQUASHED_LOOPDEV /osmin.img
|
||||
losetup -r $OSMIN_SQUASHED_LOOPDEV /run/initramfs/osmin.img
|
||||
mkdir -m 0755 -p /run/initramfs/squashfs.osmin
|
||||
mount -n -t squashfs -o ro $OSMIN_SQUASHED_LOOPDEV /run/initramfs/squashfs.osmin
|
||||
OSMIN_LOOPDEV=$( losetup -f )
|
||||
@@ -185,8 +187,8 @@ if [ -n "$FSIMG" ] ; then
|
||||
if [ -n "$writable_fsimg" ] ; then
|
||||
# mount the provided fileysstem read/write
|
||||
echo "Unpacking live filesystem (may take some time)"
|
||||
unpack_archive $FSIMG /tmp/fsimg/
|
||||
losetup $BASE_LOOPDEV /tmp/fsimg/rootfs.img
|
||||
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
|
||||
@@ -204,10 +206,10 @@ if [ -e "$SQUASHED" ] ; then
|
||||
if [ -n "$live_ram" ] ; then
|
||||
echo "Copying live image to RAM..."
|
||||
echo "(this may take a few minutes)"
|
||||
dd if=$SQUASHED of=/squashed.img bs=512 2> /dev/null
|
||||
dd if=$SQUASHED of=/run/initramfs/squashed.img bs=512 2> /dev/null
|
||||
umount -n /run/initramfs/live
|
||||
echo "Done copying live image to RAM."
|
||||
SQUASHED="/squashed.img"
|
||||
SQUASHED="/run/initramfs/squashed.img"
|
||||
fi
|
||||
|
||||
SQUASHED_LOOPDEV=$( losetup -f )
|
||||
|
@@ -4,7 +4,7 @@
|
||||
installkernel() {
|
||||
if [[ -z $drivers ]]; then
|
||||
block_module_filter() {
|
||||
local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_pltfm_init'
|
||||
local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host'
|
||||
# subfunctions inherit following FDs
|
||||
local _merge=8 _side2=9
|
||||
function bmf1() {
|
||||
@@ -39,13 +39,12 @@ installkernel() {
|
||||
ehci-hcd ehci-pci ehci-platform \
|
||||
ohci-hcd ohci-pci \
|
||||
uhci-hcd \
|
||||
xhci-hcd
|
||||
xhci-hcd xhci-pci xhci-plat-hcd
|
||||
|
||||
instmods yenta_socket scsi_dh_rdac scsi_dh_emc \
|
||||
instmods yenta_socket scsi_dh_rdac scsi_dh_emc scsi_dh_alua \
|
||||
atkbd i8042 usbhid hid-apple hid-sunplus hid-cherry hid-logitech \
|
||||
hid-logitech-dj hid-microsoft hid-lcpower firewire-ohci \
|
||||
pcmcia usb_storage nvme hid-hyperv hv-vmbus \
|
||||
sdhci_acpi hyperv-keyboard
|
||||
pcmcia hid-hyperv hv-vmbus hyperv-keyboard
|
||||
|
||||
if [[ "$(uname -p)" == arm* ]]; then
|
||||
# arm specific modules
|
||||
|
@@ -42,6 +42,10 @@ cmdline() {
|
||||
done
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
instmods dm-snapshot
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
local _i
|
||||
@@ -49,8 +53,8 @@ install() {
|
||||
inst lvm
|
||||
|
||||
if [[ $hostonly_cmdline == "yes" ]]; then
|
||||
cmdline >> "${initdir}/etc/cmdline.d/90lvm.conf"
|
||||
echo >> "${initdir}/etc/cmdline.d/90lvm.conf"
|
||||
local _lvmconf=$(cmdline)
|
||||
[[ $_lvmconf ]] && printf "%s\n" "$_lvmconf" >> "${initdir}/etc/cmdline.d/90lvm.conf"
|
||||
fi
|
||||
|
||||
inst_rules "$moddir/64-lvm.rules"
|
||||
@@ -107,12 +111,19 @@ install() {
|
||||
dev=$(</sys/block/${dev#/dev/}/dm/name)
|
||||
eval $(dmsetup splitname --nameprefixes --noheadings --rows "$dev" 2>/dev/null)
|
||||
[[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || continue
|
||||
if [[ "$(lvs --noheadings -o segtype ${DM_VG_NAME} 2>/dev/null)" == *thin* ]] ; then
|
||||
inst_multiple -o thin_dump thin_restore thin_check thin_repair
|
||||
break
|
||||
fi
|
||||
case "$(lvs --noheadings -o segtype ${DM_VG_NAME} 2>/dev/null)" in
|
||||
*thin*|*cache*|*era*)
|
||||
inst_multiple -o thin_dump thin_restore thin_check thin_repair \
|
||||
cache_dump cache_restore cache_check cache_repair \
|
||||
era_check era_dump era_invalidate era_restore
|
||||
break;;
|
||||
esac
|
||||
done
|
||||
else
|
||||
inst_multiple -o thin_dump thin_restore thin_check thin_repair
|
||||
fi
|
||||
|
||||
if ! [[ $hostonly ]]; then
|
||||
inst_multiple -o thin_dump thin_restore thin_check thin_repair \
|
||||
cache_dump cache_restore cache_check cache_repair \
|
||||
era_check era_dump era_invalidate era_restore
|
||||
fi
|
||||
}
|
||||
|
@@ -71,8 +71,8 @@ install() {
|
||||
inst $(command -v mdadm) /sbin/mdadm
|
||||
|
||||
if [[ $hostonly_cmdline == "yes" ]]; then
|
||||
cmdline >> "${initdir}/etc/cmdline.d/90mdraid.conf"
|
||||
echo >> "${initdir}/etc/cmdline.d/90mdraid.conf"
|
||||
local _raidconf=$(cmdline)
|
||||
[[ $_raidconf ]] && printf "%s\n" "$_raidconf" >> "${initdir}/etc/cmdline.d/90mdraid.conf"
|
||||
fi
|
||||
|
||||
# <mdadm-3.3 udev rule
|
||||
@@ -86,7 +86,7 @@ install() {
|
||||
for rule in 64-md-raid.rules 64-md-raid-assembly.rules; do
|
||||
rule_path="${initdir}${udevdir}/rules.d/${rule}"
|
||||
[ -f "${rule_path}" ] && sed -i -r \
|
||||
-e '/RUN\+?="[[:alpha:]/]*mdadm[[:blank:]]+(--incremental|-I)[[:blank:]]+(\$env\{DEVNAME\}|\$tempnode|\$devnode)/d' \
|
||||
-e '/(RUN|IMPORT\{program\})\+?="[[:alpha:]/]*mdadm[[:blank:]]+(--incremental|-I)[[:blank:]]+(--export )?(\$env\{DEVNAME\}|\$tempnode|\$devnode)/d' \
|
||||
"${rule_path}"
|
||||
done
|
||||
|
||||
|
@@ -27,6 +27,15 @@ depends() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
cmdline() {
|
||||
for m in scsi_dh_alua scsi_dh_emc scsi_dh_rdac ; do
|
||||
if module_is_host_only $m ; then
|
||||
printf 'rd.driver.pre=%s ' "$m"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
local _ret
|
||||
@@ -87,12 +96,17 @@ install() {
|
||||
inst $(command -v partx) /sbin/partx
|
||||
|
||||
inst_libdir_file "libmultipath*" "multipath/*"
|
||||
inst_libdir_file 'libgcc_s.so*'
|
||||
|
||||
if [[ $hostonly_cmdline ]] ; then
|
||||
local _conf=$(cmdline)
|
||||
[[ $_conf ]] && echo "$_conf" >> "${initdir}/etc/cmdline.d/90multipath.conf"
|
||||
fi
|
||||
|
||||
if dracut_module_included "systemd"; then
|
||||
inst_multiple \
|
||||
$systemdsystemunitdir/multipathd.service
|
||||
mkdir -p "${initdir}${systemdsystemconfdir}/sysinit.target.wants"
|
||||
ln -rfs "${initdir}${systemdsystemunitdir}/multipathd.service" "${initdir}${systemdsystemconfdir}/sysinit.target.wants/multipathd.service"
|
||||
inst_simple "${moddir}/multipathd.service" "${systemdsystemunitdir}/multipathd.service"
|
||||
mkdir -p "${initdir}${systemdsystemunitdir}/sysinit.target.wants"
|
||||
ln -rfs "${initdir}${systemdsystemunitdir}/multipathd.service" "${initdir}${systemdsystemunitdir}/sysinit.target.wants/multipathd.service"
|
||||
else
|
||||
inst_hook pre-trigger 02 "$moddir/multipathd.sh"
|
||||
inst_hook cleanup 02 "$moddir/multipathd-stop.sh"
|
||||
@@ -100,6 +114,9 @@ install() {
|
||||
|
||||
inst_hook cleanup 80 "$moddir/multipathd-needshutdown.sh"
|
||||
|
||||
inst_rules 40-multipath.rules 62-multipath.rules 65-multipath.rules 66-kpartx.rules
|
||||
inst_rules 40-multipath.rules 56-multipath.rules \
|
||||
62-multipath.rules 65-multipath.rules \
|
||||
66-kpartx.rules 67-kpartx-compat.rules \
|
||||
11-dm-mpath.rules
|
||||
}
|
||||
|
||||
|
19
modules.d/90multipath/multipathd.service
Normal file
19
modules.d/90multipath/multipathd.service
Normal file
@@ -0,0 +1,19 @@
|
||||
[Unit]
|
||||
Description=Device-Mapper Multipath Device Controller
|
||||
Before=iscsi.service iscsid.service lvm2-activation-early.service
|
||||
DefaultDependencies=no
|
||||
Conflicts=shutdown.target
|
||||
ConditionKernelCommandLine=!nompath
|
||||
ConditionKernelCommandLine=!rd.multipath=0
|
||||
ConditionKernelCommandLine=!rd_NO_MULTIPATH
|
||||
ConditionPathExists=/etc/multipath.conf
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStartPre=/sbin/modprobe dm-multipath
|
||||
ExecStart=/sbin/multipathd -s -d
|
||||
ExecReload=/sbin/multipathd reconfigure
|
||||
ExecStop=/sbin/multipathd shutdown
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -e /etc/multipath.conf ]; then
|
||||
if getargbool 1 rd.multipath -d -n rd_NO_MULTIPATH && [ -e /etc/multipath.conf ]; then
|
||||
modprobe dm-multipath
|
||||
multipathd -B || multipathd
|
||||
need_shutdown
|
||||
|
@@ -25,5 +25,5 @@ installkernel() {
|
||||
hostonly='' instmods \
|
||||
ata_piix ata_generic pata_acpi cdrom sr_mod ahci \
|
||||
virtio_blk virtio virtio_ring virtio_pci \
|
||||
virtio_scsi virtio_console
|
||||
virtio_scsi virtio_console virtio_rng
|
||||
}
|
||||
|
@@ -14,8 +14,7 @@ depends() {
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_multiple -o ps grep more cat rm strace free showmount \
|
||||
ping netstat rpcinfo vi scp ping6 ssh \
|
||||
ping netstat rpcinfo vi scp ping6 ssh find vi \
|
||||
fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat e2fsck
|
||||
|
||||
}
|
||||
|
||||
|
@@ -16,16 +16,20 @@ type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
|
||||
netif=$1
|
||||
dcb=$2
|
||||
|
||||
iflink=$(cat /sys/class/net/$netif/iflink)
|
||||
ifindex=$(cat /sys/class/net/$netif/ifindex)
|
||||
if [ "$iflink" != "$ifindex" ] ; then
|
||||
# Skip VLAN devices
|
||||
exit 0
|
||||
fi
|
||||
|
||||
ip link set dev $netif up
|
||||
linkup "$netif"
|
||||
|
||||
netdriver=$(readlink -f /sys/class/net/$netif/device/driver)
|
||||
netdriver=${netdriver##*/}
|
||||
|
||||
if [ "$dcb" = "dcb" ]; then
|
||||
# Note lldpad will stay running after switchroot, the system initscripts
|
||||
# are to kill it and start a new lldpad to take over. Data is transfered
|
||||
# between the 2 using a shm segment
|
||||
lldpad -d
|
||||
# wait for lldpad to be ready
|
||||
i=0
|
||||
while [ $i -lt 60 ]; do
|
||||
@@ -35,10 +39,6 @@ if [ "$dcb" = "dcb" ]; then
|
||||
i=$(($i+1))
|
||||
done
|
||||
|
||||
# on some systems lldpad needs some time
|
||||
# sleep until we find a better solution
|
||||
sleep 30
|
||||
|
||||
while [ $i -lt 60 ]; do
|
||||
dcbtool sc "$netif" dcb on && break
|
||||
info "Retrying to turn dcb on"
|
||||
|
14
modules.d/95fcoe/lldpad.sh
Normal file
14
modules.d/95fcoe/lldpad.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Note lldpad will stay running after switchroot, the system initscripts
|
||||
# are to kill it and start a new lldpad to take over. Data is transfered
|
||||
# between the 2 using a shm segment
|
||||
lldpad -d
|
||||
# wait for lldpad to be ready
|
||||
i=0
|
||||
while [ $i -lt 60 ]; do
|
||||
lldptool -p && break
|
||||
info "Waiting for lldpad to be ready"
|
||||
sleep 1
|
||||
i=$(($i+1))
|
||||
done
|
@@ -2,7 +2,16 @@
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for c in /sys/bus/fcoe/devices/ctlr_* ; do
|
||||
[ -L $c ] || continue
|
||||
fcoe_ctlr=$c
|
||||
done
|
||||
[ -z "$fcoe_ctlr" ] && return 255
|
||||
}
|
||||
|
||||
require_binaries dcbtool fipvlan lldpad ip readlink || return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -17,15 +26,59 @@ installkernel() {
|
||||
instmods fcoe 8021q edd
|
||||
}
|
||||
|
||||
get_vlan_parent() {
|
||||
local link=$1
|
||||
|
||||
[ -d $link ] || return
|
||||
read iflink < $link/iflink
|
||||
for if in /sys/class/net/* ; do
|
||||
read idx < $if/ifindex
|
||||
if [ $idx -eq $iflink ] ; then
|
||||
echo ${if##*/}
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
cmdline() {
|
||||
|
||||
for c in /sys/bus/fcoe/devices/ctlr_* ; do
|
||||
[ -L $c ] || continue
|
||||
read enabled < $c/enabled
|
||||
[ $enabled -eq 0 ] && continue
|
||||
d=$(cd -P $c; echo $PWD)
|
||||
i=${d%/*}
|
||||
read mac < ${i}/address
|
||||
s=$(dcbtool gc ${i##*/} dcb | sed -n 's/^DCB State:\t*\(.*\)/\1/p')
|
||||
if [ -z "$s" ] ; then
|
||||
p=$(get_vlan_parent ${i})
|
||||
if [ "$p" ] ; then
|
||||
s=$(dcbtool gc ${p} dcb | sed -n 's/^DCB State:\t*\(.*\)/\1/p')
|
||||
fi
|
||||
fi
|
||||
if [ "$s" = "on" ] ; then
|
||||
dcb="dcb"
|
||||
else
|
||||
dcb="nodcb"
|
||||
fi
|
||||
echo "fcoe=${mac}:${dcb}"
|
||||
done
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_multiple ip dcbtool fipvlan lldpad readlink lldptool
|
||||
|
||||
mkdir -m 0755 -p "$initdir/var/lib/lldpad"
|
||||
|
||||
if [[ $hostonly_cmdline == "yes" ]] ; then
|
||||
local _fcoeconf=$(cmdline)
|
||||
[[ $_fcoeconf ]] && printf "%s\n" "$_fcoeconf" >> "${initdir}/etc/cmdline.d/95fcoe.conf"
|
||||
fi
|
||||
inst "$moddir/fcoe-up.sh" "/sbin/fcoe-up"
|
||||
inst "$moddir/fcoe-edd.sh" "/sbin/fcoe-edd"
|
||||
inst "$moddir/fcoe-genrules.sh" "/sbin/fcoe-genrules.sh"
|
||||
inst_hook pre-trigger 03 "$moddir/lldpad.sh"
|
||||
inst_hook cmdline 99 "$moddir/parse-fcoe.sh"
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
@@ -20,14 +20,11 @@
|
||||
|
||||
|
||||
# BRCM: Later, should check whether bnx2x is loaded first before loading bnx2fc so do not load bnx2fc when there are no Broadcom adapters
|
||||
[ -e /sys/module/fcoe/parameters/create ] || modprobe -a fcoe || die "FCoE requested but kernel/initrd does not support FCoE"
|
||||
[ -d /sys/module/fcoe ] || modprobe -a fcoe || die "FCoE requested but kernel/initrd does not support FCoE"
|
||||
|
||||
modprobe bnx2fc >/dev/null 2>&1
|
||||
udevadm settle --timeout=30
|
||||
|
||||
# FCoE actually supported?
|
||||
[ -e /sys/module/fcoe/parameters/create ] || modprobe fcoe || die "FCoE requested but kernel/initrd does not support FCoE"
|
||||
|
||||
parse_fcoe_opts() {
|
||||
local IFS=:
|
||||
set $fcoe
|
||||
|
@@ -81,23 +81,23 @@ handle_netroot()
|
||||
local p
|
||||
|
||||
# override conf settings by command line options
|
||||
arg=$(getargs rd.iscsi.initiator -d iscsi_initiator=)
|
||||
arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=)
|
||||
[ -n "$arg" ] && iscsi_initiator=$arg
|
||||
arg=$(getargs rd.iscsi.target.name -d iscsi_target_name=)
|
||||
arg=$(getarg rd.iscsi.target.name -d iscsi_target_name=)
|
||||
[ -n "$arg" ] && iscsi_target_name=$arg
|
||||
arg=$(getargs rd.iscsi.target.ip -d iscsi_target_ip)
|
||||
arg=$(getarg rd.iscsi.target.ip -d iscsi_target_ip)
|
||||
[ -n "$arg" ] && iscsi_target_ip=$arg
|
||||
arg=$(getargs rd.iscsi.target.port -d iscsi_target_port=)
|
||||
arg=$(getarg rd.iscsi.target.port -d iscsi_target_port=)
|
||||
[ -n "$arg" ] && iscsi_target_port=$arg
|
||||
arg=$(getargs rd.iscsi.target.group -d iscsi_target_group=)
|
||||
arg=$(getarg rd.iscsi.target.group -d iscsi_target_group=)
|
||||
[ -n "$arg" ] && iscsi_target_group=$arg
|
||||
arg=$(getargs rd.iscsi.username -d iscsi_username=)
|
||||
arg=$(getarg rd.iscsi.username -d iscsi_username=)
|
||||
[ -n "$arg" ] && iscsi_username=$arg
|
||||
arg=$(getargs rd.iscsi.password -d iscsi_password)
|
||||
arg=$(getarg rd.iscsi.password -d iscsi_password)
|
||||
[ -n "$arg" ] && iscsi_password=$arg
|
||||
arg=$(getargs rd.iscsi.in.username -d iscsi_in_username=)
|
||||
arg=$(getarg rd.iscsi.in.username -d iscsi_in_username=)
|
||||
[ -n "$arg" ] && iscsi_in_username=$arg
|
||||
arg=$(getargs rd.iscsi.in.password -d iscsi_in_password=)
|
||||
arg=$(getarg rd.iscsi.in.password -d iscsi_in_password=)
|
||||
[ -n "$arg" ] && iscsi_in_password=$arg
|
||||
for p in $(getargs rd.iscsi.param -d iscsi_param); do
|
||||
iscsi_param="$iscsi_param --param $p"
|
||||
|
@@ -28,6 +28,127 @@ check() {
|
||||
return 0
|
||||
}
|
||||
|
||||
get_ibft_mod() {
|
||||
local ibft_mac=$1
|
||||
local iface_mac iface_mod
|
||||
# Return the iSCSI offload module for a given MAC address
|
||||
for iface_desc in $(iscsiadm -m iface | cut -f 2 -d ' '); do
|
||||
iface_mod=${iface_desc%%,*}
|
||||
iface_mac=${iface_desc#*,}
|
||||
iface_mac=${iface_mac%%,*}
|
||||
if [ "$ibft_mac" = "$iface_mac" ] ; then
|
||||
echo $iface_mod
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
install_ibft() {
|
||||
# When iBFT / iscsi_boot is detected:
|
||||
# - Use 'ip=ibft' to set up iBFT network interface
|
||||
# Note: bnx2i is using a different MAC address of iSCSI offloading
|
||||
# so the 'ip=ibft' parameter must not be set
|
||||
# - specify firmware booting cmdline parameter
|
||||
|
||||
for d in /sys/firmware/* ; do
|
||||
if [ -d ${d}/ethernet0 ] ; then
|
||||
read ibft_mac < ${d}/ethernet0/mac
|
||||
ibft_mod=$(get_ibft_mod $ibft_mac)
|
||||
fi
|
||||
if [ -z "$ibft_mod" ] && [ -d ${d}/ethernet1 ] ; then
|
||||
read ibft_mac < ${d}/ethernet1/mac
|
||||
ibft_mod=$(get_ibft_mod $ibft_mac)
|
||||
fi
|
||||
if [ -d ${d}/initiator ] ; then
|
||||
if [ ${d##*/} = "ibft" ] && [ "$ibft_mod" != "bnx2i" ] ; then
|
||||
echo -n "ip=ibft "
|
||||
fi
|
||||
echo -n "rd.iscsi.firmware=1"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
install_iscsiroot() {
|
||||
local devpath=$1
|
||||
local scsi_path iscsi_lun session c d conn
|
||||
local iscsi_session iscsi_address iscsi_port iscsi_targetname iscsi_tpgt
|
||||
|
||||
scsi_path=${devpath%%/block*}
|
||||
[ "$scsi_path" = "$devpath" ] && return 1
|
||||
iscsi_lun=${scsi_path##*:}
|
||||
[ "$iscsi_lun" = "$scsi_path" ] && return 1
|
||||
session=${devpath%%/target*}
|
||||
[ "$session" = "$devpath" ] && return 1
|
||||
iscsi_session=${session##*/}
|
||||
[ "$iscsi_session" = "$session" ] && return 1
|
||||
|
||||
for d in ${session}/* ; do
|
||||
case $d in
|
||||
*connection*)
|
||||
c=${d##*/}
|
||||
conn=${d}/iscsi_connection/${c}
|
||||
if [ -d ${conn} ] ; then
|
||||
iscsi_address=$(cat ${conn}/persistent_address)
|
||||
iscsi_port=$(cat ${conn}/persistent_port)
|
||||
fi
|
||||
;;
|
||||
*session)
|
||||
if [ -d ${d}/${iscsi_session} ] ; then
|
||||
iscsi_initiator=$(cat ${d}/${iscsi_session}/initiatorname)
|
||||
iscsi_targetname=$(cat ${d}/${iscsi_session}/targetname)
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
[ -z "$iscsi_address" ] && return
|
||||
local_address=$(ip -o route get to $iscsi_address | sed -n 's/.*src \([0-9a-f.:]*\).*/\1/p')
|
||||
ifname=$(ip -o route get to $iscsi_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')
|
||||
printf 'ip=%s:static ' ${ifname}
|
||||
|
||||
if [ -e /sys/class/net/$ifname/address ] ; then
|
||||
ifmac=$(cat /sys/class/net/$ifname/address)
|
||||
printf 'ifname=%s:%s ' ${ifname} ${ifmac}
|
||||
fi
|
||||
|
||||
if [ -n "$iscsi_address" -a -n "$iscsi_targetname" ] ; then
|
||||
if [ -n "$iscsi_port" -a "$iscsi_port" -eq 3260 ] ; then
|
||||
iscsi_port=
|
||||
fi
|
||||
if [ -n "$iscsi_lun" -a "$iscsi_lun" -eq 0 ] ; then
|
||||
iscsi_lun=
|
||||
fi
|
||||
# In IPv6 case rd.iscsi.initatior= must pass address in [] brackets
|
||||
case "$iscsi_address" in
|
||||
*:*)
|
||||
iscsi_address="[$iscsi_address]"
|
||||
;;
|
||||
esac
|
||||
# Must be two separate lines, so that "sort | uniq" commands later
|
||||
# can sort out rd.iscsi.initiator= duplicates
|
||||
echo "rd.iscsi.initiator=${iscsi_initiator}"
|
||||
echo "netroot=iscsi:${iscsi_address}::${iscsi_port}:${iscsi_lun}:${iscsi_targetname}"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
install_softiscsi() {
|
||||
[ -d /sys/firmware/ibft ] && return 0
|
||||
|
||||
is_softiscsi() {
|
||||
local _dev=$1
|
||||
local iscsi_dev
|
||||
|
||||
[[ -L "/sys/dev/block/$_dev" ]] || return
|
||||
iscsi_dev=$(cd -P /sys/dev/block/$_dev; echo $PWD)
|
||||
install_iscsiroot $iscsi_dev
|
||||
}
|
||||
|
||||
for_each_host_dev_and_slaves_all is_softiscsi || return 255
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
depends() {
|
||||
echo network rootfs-block
|
||||
@@ -76,10 +197,30 @@ installkernel() {
|
||||
| iscsi_module_filter | instmods
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
cmdline() {
|
||||
local _iscsiconf=$(install_ibft)
|
||||
{
|
||||
if [ "$_iscsiconf" ] ; then
|
||||
echo ${_iscsiconf}
|
||||
else
|
||||
install_softiscsi
|
||||
fi
|
||||
} | sort | uniq
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_multiple umount iscsistart hostname iscsi-iname
|
||||
inst_multiple -o iscsiuio
|
||||
inst_libdir_file 'libgcc_s.so*'
|
||||
|
||||
# Detect iBFT and perform mandatory steps
|
||||
if [[ $hostonly_cmdline == "yes" ]] ; then
|
||||
local _iscsiconf=$(cmdline)
|
||||
[[ $_iscsiconf ]] && printf "%s\n" "$_iscsiconf" >> "${initdir}/etc/cmdline.d/95iscsi.conf"
|
||||
fi
|
||||
|
||||
inst_hook cmdline 90 "$moddir/parse-iscsiroot.sh"
|
||||
inst_hook cleanup 90 "$moddir/cleanup-iscsi.sh"
|
||||
inst "$moddir/iscsiroot.sh" "/sbin/iscsiroot"
|
||||
|
@@ -59,10 +59,10 @@ fi
|
||||
|
||||
# iscsi_firmware does not need argument checking
|
||||
if [ -n "$iscsi_firmware" ] ; then
|
||||
netroot=${netroot:-iscsi:}
|
||||
[ -z "$netroot" ] && netroot=iscsi:
|
||||
modprobe -q iscsi_boot_sysfs 2>/dev/null
|
||||
modprobe -q iscsi_ibft
|
||||
initqueue --onetime --timeout /sbin/iscsiroot dummy "'$netroot'" "'$NEWROOT'"
|
||||
initqueue --onetime --timeout /sbin/iscsiroot dummy "$netroot" "$NEWROOT"
|
||||
fi
|
||||
|
||||
# If it's not iscsi we don't continue
|
||||
@@ -86,12 +86,16 @@ fi
|
||||
|
||||
if [ -n "$netroot" ] && [ "$root" != "/dev/root" ] && [ "$root" != "dhcp" ]; then
|
||||
if ! getargbool 1 rd.neednet >/dev/null || ! getarg "ip="; then
|
||||
initqueue --onetime --settled /sbin/iscsiroot dummy "'$netroot'" "'$NEWROOT'"
|
||||
initqueue --onetime --settled /sbin/iscsiroot dummy "$netroot" "$NEWROOT"
|
||||
fi
|
||||
fi
|
||||
|
||||
netroot_enc=$(str_replace "$netroot" '/' '\2f')
|
||||
echo "[ -f '/tmp/iscsistarted-$netroot_enc' ]" > $hookdir/initqueue/finished/iscsi_started.sh
|
||||
if [ -n "$iscsi_firmware" ] ; then
|
||||
echo "[ -f '/tmp/iscsistarted-firmware' ]" > $hookdir/initqueue/finished/iscsi_started.sh
|
||||
else
|
||||
netroot_enc=$(str_replace "$netroot" '/' '\2f')
|
||||
echo "[ -f '/tmp/iscsistarted-$netroot_enc' ]" > $hookdir/initqueue/finished/iscsi_started.sh
|
||||
fi
|
||||
|
||||
# Done, all good!
|
||||
rootok=1
|
||||
|
@@ -3,8 +3,6 @@
|
||||
# called by dracut
|
||||
check() {
|
||||
local _rootdev
|
||||
# If our prerequisites are not met, fail.
|
||||
require_binaries nbd-client || return 1
|
||||
|
||||
# if an nbd device is not somewhere in the chain of devices root is
|
||||
# mounted on, fail the hostonly check.
|
||||
@@ -15,6 +13,7 @@ check() {
|
||||
[[ -b /dev/block/$_rootdev ]] || return 1
|
||||
check_block_and_slaves is_nbd "$_rootdev" || return 255
|
||||
}
|
||||
require_binaries nbd-client || return 1
|
||||
|
||||
return 0
|
||||
}
|
||||
|
@@ -14,7 +14,6 @@ check() {
|
||||
done
|
||||
return 255
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -29,6 +28,43 @@ installkernel() {
|
||||
instmods nfs sunrpc ipv6 nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files
|
||||
}
|
||||
|
||||
cmdline() {
|
||||
local nfs_device
|
||||
local nfs_options
|
||||
local nfs_root
|
||||
local nfs_address
|
||||
local lookup
|
||||
local ifname
|
||||
|
||||
### nfsroot= ###
|
||||
nfs_device=$(findmnt -t nfs4 -n -o SOURCE /)
|
||||
if [ -n "$nfs_device" ];then
|
||||
nfs_root="root=nfs4:$nfs_device"
|
||||
else
|
||||
nfs_device=$(findmnt -t nfs -n -o SOURCE /)
|
||||
[ -z "$nfs_device" ] && return
|
||||
nfs_root="root=nfs:$nfs_device"
|
||||
fi
|
||||
nfs_options=$(findmnt -t nfs4,nfs -n -o OPTIONS /)
|
||||
[ -n "$nfs_options" ] && nfs_root="$nfs_root:$nfs_options"
|
||||
echo "$nfs_root"
|
||||
|
||||
### ip= ###
|
||||
if [[ $nfs_device = [0-9]*\.[0-9]*\.[0-9]*.[0-9]* ]] || [[ $nfs_device = \[.*\] ]]; then
|
||||
nfs_address="$nfs_device"
|
||||
else
|
||||
lookup=$(host $(echo ${nfs_device%%:*})| head -n1)
|
||||
nfs_address=${lookup##* }
|
||||
fi
|
||||
ifname=$(ip -o route get to $nfs_address | sed -n 's/.*dev \([^ ]*\).*/\1/p')
|
||||
if [ -e /sys/class/net/$ifname/address ] ; then
|
||||
ifmac=$(cat /sys/class/net/$ifname/address)
|
||||
printf 'ifname=%s:%s ' ${ifname} ${ifmac}
|
||||
fi
|
||||
|
||||
printf 'ip=%s:static\n' ${ifname}
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
local _i
|
||||
@@ -37,6 +73,11 @@ install() {
|
||||
mount.nfs4 umount rpc.idmapd sed /etc/netconfig
|
||||
inst_multiple /etc/services /etc/nsswitch.conf /etc/rpc /etc/protocols /etc/idmapd.conf
|
||||
|
||||
if [[ $hostonly_cmdline == "yes" ]]; then
|
||||
local _netconf="$(cmdline)"
|
||||
[[ $_netconf ]] && printf "%s\n" "$_netconf" >> "${initdir}/etc/cmdline.d/95nfs.conf"
|
||||
fi
|
||||
|
||||
if [ -f /lib/modprobe.d/nfs.conf ]; then
|
||||
inst_multiple /lib/modprobe.d/nfs.conf
|
||||
else
|
||||
@@ -75,4 +116,3 @@ install() {
|
||||
&& chown rpc.rpc "$initdir/var/lib/rpcbind"
|
||||
dracut_need_initqueue
|
||||
}
|
||||
|
||||
|
@@ -29,8 +29,17 @@ install() {
|
||||
local _bin
|
||||
|
||||
if [[ $hostonly_cmdline == "yes" ]]; then
|
||||
cmdline >> "${initdir}/etc/cmdline.d/95resume.conf"
|
||||
echo >> "${initdir}/etc/cmdline.d/95resume.conf"
|
||||
local _resumeconf=$(cmdline)
|
||||
[[ $_resumeconf ]] && printf "%s\n" "$_resumeconf" >> "${initdir}/etc/cmdline.d/95resume.conf"
|
||||
fi
|
||||
|
||||
# if systemd is included and has the hibernate-resume tool, use it and nothing else
|
||||
if dracut_module_included "systemd" && [[ -x $systemdutildir/systemd-hibernate-resume ]]; then
|
||||
inst_multiple -o \
|
||||
$systemdutildir/system-generators/systemd-hibernate-resume-generator \
|
||||
$systemdsystemunitdir/systemd-hibernate-resume@.service \
|
||||
$systemdutildir/systemd-hibernate-resume
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Optional uswsusp support
|
||||
|
@@ -29,23 +29,28 @@ cmdline_journal() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
cmdline() {
|
||||
cmdline_rootfs() {
|
||||
local dev=/dev/block/$(find_root_block_device)
|
||||
if [ -e $dev ]; then
|
||||
printf " root=%s" "$(shorten_persistent_dev "$(get_persistent_dev "$dev")")"
|
||||
printf " rootflags=%s" "$(find_mp_fsopts /)"
|
||||
printf " rootfstype=%s" "$(find_mp_fstype /)"
|
||||
fi
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
cmdline() {
|
||||
cmdline_rootfs
|
||||
cmdline_journal
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
if [[ $hostonly_cmdline == "yes" ]]; then
|
||||
cmdline_journal | while read journaldev; do
|
||||
[[ $journaldev ]] && printf "%s\n" "$journaldev" >> "${initdir}/etc/cmdline.d/95root-journaldev.conf"
|
||||
done
|
||||
local _journaldev=$(cmdline_journal)
|
||||
[[ $_journaldev ]] && printf "%s\n" "$_journaldev" >> "${initdir}/etc/cmdline.d/95root-journaldev.conf"
|
||||
local _rootdev=$(cmdline_rootfs)
|
||||
[[ $_rootdev ]] && printf "%s\n" "$_rootdev" >> "${initdir}/etc/cmdline.d/95root-dev.conf"
|
||||
fi
|
||||
|
||||
inst_multiple umount
|
||||
|
@@ -45,7 +45,7 @@ inst_sshenv()
|
||||
inst_simple /etc/ssh/ssh_config
|
||||
sed -i -e 's/\(^[[:space:]]*\)ProxyCommand/\1# ProxyCommand/' ${initdir}/etc/ssh/ssh_config
|
||||
while read key val; do
|
||||
[[ key != "GlobalKnownHostsFile" ]] && continue
|
||||
[[ $key != "GlobalKnownHostsFile" ]] && continue
|
||||
inst_simple "$val"
|
||||
break
|
||||
done < /etc/ssh/ssh_config
|
||||
|
@@ -31,6 +31,7 @@ install() {
|
||||
50-udev.rules 95-late.rules \
|
||||
50-firmware.rules \
|
||||
59-scsi-sg3_utils.rules \
|
||||
55-scsi-sg3_id.rules 58-scsi-sg3_symlink.rules \
|
||||
70-uaccess.rules 71-seat.rules 73-seat-late.rules \
|
||||
75-net-description.rules \
|
||||
80-net-name-slot.rules 80-net-setup-link.rules \
|
||||
|
@@ -13,7 +13,7 @@ DefaultDependencies=no
|
||||
Before=dracut-cmdline.service
|
||||
After=systemd-journald.socket
|
||||
Wants=systemd-journald.socket
|
||||
ConditionPathExists=/etc/initrd-release
|
||||
ConditionPathExists=/usr/lib/initrd-release
|
||||
ConditionKernelCommandLine=rd.cmdline=ask
|
||||
|
||||
[Service]
|
||||
|
@@ -14,7 +14,7 @@ DefaultDependencies=no
|
||||
Before=dracut-pre-udev.service
|
||||
After=systemd-journald.socket
|
||||
Wants=systemd-journald.socket
|
||||
ConditionPathExists=/etc/initrd-release
|
||||
ConditionPathExists=/usr/lib/initrd-release
|
||||
ConditionPathExistsGlob=|/etc/cmdline.d/*.conf
|
||||
ConditionDirectoryNotEmpty=|/lib/dracut/hooks/cmdline
|
||||
ConditionKernelCommandLine=|rd.break=cmdline
|
||||
|
@@ -5,7 +5,7 @@ if [ -f /dracut-state.sh ]; then
|
||||
fi
|
||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
|
||||
[ -f /etc/initrd-release ] && . /etc/initrd-release
|
||||
[ -f /usr/lib/initrd-release ] && . /usr/lib/initrd-release
|
||||
[ -n "$VERSION" ] && info "dracut-$VERSION"
|
||||
|
||||
if ! getargbool 1 'rd.hostonly'; then
|
||||
|
@@ -15,7 +15,7 @@ Before=remote-fs-pre.target
|
||||
Wants=remote-fs-pre.target
|
||||
After=systemd-udev-trigger.service
|
||||
Wants=systemd-udev-trigger.service
|
||||
ConditionPathExists=/etc/initrd-release
|
||||
ConditionPathExists=/usr/lib/initrd-release
|
||||
ConditionPathExists=|/lib/dracut/need-initqueue
|
||||
ConditionPathExistsGlob=|/lib/dracut/hooks/initqueue/*.sh
|
||||
ConditionPathExistsGlob=|/lib/dracut/hooks/initqueue/settled/*.sh
|
||||
|
@@ -12,7 +12,7 @@ Description=dracut mount hook
|
||||
Documentation=man:dracut-mount.service(8)
|
||||
After=initrd-root-fs.target initrd-parse-etc.service
|
||||
After=dracut-initqueue.service dracut-pre-mount.service
|
||||
ConditionPathExists=/etc/initrd-release
|
||||
ConditionPathExists=/usr/lib/initrd-release
|
||||
ConditionDirectoryNotEmpty=|/lib/dracut/hooks/mount
|
||||
ConditionKernelCommandLine=|rd.break=mount
|
||||
|
||||
|
@@ -14,7 +14,7 @@ DefaultDependencies=no
|
||||
Before=initrd-root-fs.target sysroot.mount
|
||||
After=dracut-initqueue.service
|
||||
After=cryptsetup.target
|
||||
ConditionPathExists=/etc/initrd-release
|
||||
ConditionPathExists=/usr/lib/initrd-release
|
||||
ConditionDirectoryNotEmpty=|/lib/dracut/hooks/pre-mount
|
||||
ConditionKernelCommandLine=|rd.break=pre-mount
|
||||
|
||||
|
@@ -15,7 +15,7 @@ After=dracut-initqueue.service dracut-pre-mount.service dracut-mount.service
|
||||
Before=initrd-cleanup.service
|
||||
Wants=remote-fs.target
|
||||
After=remote-fs.target
|
||||
ConditionPathExists=/etc/initrd-release
|
||||
ConditionPathExists=/usr/lib/initrd-release
|
||||
ConditionDirectoryNotEmpty=|/lib/dracut/hooks/pre-pivot
|
||||
ConditionDirectoryNotEmpty=|/lib/dracut/hooks/cleanup
|
||||
ConditionKernelCommandLine=|rd.break=pre-pivot
|
||||
|
@@ -14,7 +14,7 @@ DefaultDependencies=no
|
||||
Before=systemd-udev-trigger.service dracut-initqueue.service
|
||||
After=dracut-pre-udev.service systemd-udevd.service systemd-tmpfiles-setup-dev.service
|
||||
Wants=dracut-pre-udev.service systemd-udevd.service
|
||||
ConditionPathExists=/etc/initrd-release
|
||||
ConditionPathExists=/usr/lib/initrd-release
|
||||
ConditionDirectoryNotEmpty=|/lib/dracut/hooks/pre-trigger
|
||||
ConditionKernelCommandLine=|rd.break=pre-trigger
|
||||
|
||||
|
@@ -14,7 +14,7 @@ DefaultDependencies=no
|
||||
Before=systemd-udevd.service dracut-pre-trigger.service
|
||||
After=dracut-cmdline.service
|
||||
Wants=dracut-cmdline.service
|
||||
ConditionPathExists=/etc/initrd-release
|
||||
ConditionPathExists=/usr/lib/initrd-release
|
||||
ConditionDirectoryNotEmpty=|/lib/dracut/hooks/pre-udev
|
||||
ConditionKernelCommandLine=|rd.break=pre-udev
|
||||
ConditionKernelCommandLine=|rd.driver.blacklist
|
||||
|
@@ -8,13 +8,14 @@
|
||||
[Unit]
|
||||
Description=Restore /run/initramfs on shutdown
|
||||
Documentation=man:dracut-shutdown.service(8)
|
||||
After=local-fs.target
|
||||
After=local-fs.target boot.mount boot.automount
|
||||
Wants=local-fs.target
|
||||
Before=systemd-reboot.service shutdown.target
|
||||
Conflicts=shutdown.target umount.target
|
||||
DefaultDependencies=no
|
||||
ConditionPathExists=/run/initramfs/.need_shutdown
|
||||
ConditionPathExists=!/run/initramfs/bin/sh
|
||||
|
||||
[Service]
|
||||
RemainAfterExit=yes
|
||||
Type=oneshot
|
||||
ExecStart=/bin/true
|
||||
ExecStop=/usr/lib/dracut/dracut-initramfs-restore
|
||||
|
3
modules.d/98systemd/dracut-tmpfiles.conf
Normal file
3
modules.d/98systemd/dracut-tmpfiles.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
d /run/initramfs 0755 root root -
|
||||
d /run/initramfs/log 0755 root root -
|
||||
L /var/log - - - - ../run/initramfs/log
|
@@ -6,4 +6,4 @@ After=basic.target rescue.service rescue.target
|
||||
AllowIsolate=yes
|
||||
OnFailure=emergency.target
|
||||
OnFailureIsolate=yes
|
||||
ConditionPathExists=/etc/initrd-release
|
||||
ConditionPathExists=/usr/lib/initrd-release
|
||||
|
@@ -18,7 +18,7 @@ depends() {
|
||||
}
|
||||
|
||||
installkernel() {
|
||||
instmods autofs4 ipv6
|
||||
hostonly='' instmods autofs4 ipv6
|
||||
instmods -s efivarfs
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ install() {
|
||||
$systemdsystemunitdir/systemd-udevd-kernel.socket \
|
||||
$systemdsystemunitdir/systemd-ask-password-plymouth.path \
|
||||
$systemdsystemunitdir/systemd-journald.socket \
|
||||
$systemdsystemunitdir/systemd-journald-audit.socket \
|
||||
$systemdsystemunitdir/systemd-ask-password-console.service \
|
||||
$systemdsystemunitdir/systemd-modules-load.service \
|
||||
$systemdsystemunitdir/systemd-halt.service \
|
||||
@@ -105,6 +106,7 @@ install() {
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-udevd-control.socket \
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-udevd-kernel.socket \
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-journald.socket \
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-journald-audit.socket \
|
||||
$systemdsystemunitdir/sockets.target.wants/systemd-journald-dev-log.socket \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-udevd.service \
|
||||
$systemdsystemunitdir/sysinit.target.wants/systemd-udev-trigger.service \
|
||||
@@ -123,6 +125,8 @@ install() {
|
||||
$systemdsystemunitdir/slices.target \
|
||||
$systemdsystemunitdir/system.slice \
|
||||
\
|
||||
$tmpfilesdir/systemd.conf \
|
||||
\
|
||||
journalctl systemctl echo swapoff systemd-cgls systemd-tmpfiles
|
||||
|
||||
inst_multiple -o \
|
||||
@@ -198,7 +202,12 @@ install() {
|
||||
inst_binary true
|
||||
ln_r $(type -P true) "/usr/bin/loginctl"
|
||||
ln_r $(type -P true) "/bin/loginctl"
|
||||
inst_rules 70-uaccess.rules 71-seat.rules 73-seat-late.rules 99-systemd.rules
|
||||
inst_rules \
|
||||
70-uaccess.rules \
|
||||
71-seat.rules \
|
||||
73-seat-late.rules \
|
||||
90-vconsole.rules \
|
||||
99-systemd.rules
|
||||
|
||||
for i in \
|
||||
emergency.target \
|
||||
@@ -227,6 +236,9 @@ install() {
|
||||
ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/initrd.target.wants/${i}"
|
||||
done
|
||||
|
||||
inst_simple "$moddir/dracut-tmpfiles.conf" "$tmpfilesdir/dracut-tmpfiles.conf"
|
||||
|
||||
|
||||
mkdir -p "$initdir/etc/systemd"
|
||||
# turn off RateLimit for journal
|
||||
{
|
||||
|
@@ -5,8 +5,11 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||
generator_wait_for_dev()
|
||||
{
|
||||
local _name
|
||||
local _timeout
|
||||
|
||||
_name="$(str_replace "$1" '/' '\x2f')"
|
||||
_timeout=$(getarg rd.timeout)
|
||||
_timeout=${_timeout:-0}
|
||||
|
||||
[ -e "$hookdir/initqueue/finished/devexists-${_name}.sh" ] && return 0
|
||||
|
||||
@@ -27,11 +30,40 @@ generator_wait_for_dev()
|
||||
mkdir -p /run/systemd/generator/${_name}.device.d
|
||||
{
|
||||
echo "[Unit]"
|
||||
echo "JobTimeoutSec=0"
|
||||
echo "JobTimeoutSec=$_timeout"
|
||||
} > /run/systemd/generator/${_name}.device.d/timeout.conf
|
||||
fi
|
||||
}
|
||||
|
||||
generator_mount_rootfs()
|
||||
{
|
||||
local _type=$2
|
||||
local _flags=$3
|
||||
local _name
|
||||
|
||||
[ -z "$1" ] && return 0
|
||||
|
||||
_name=$(dev_unit_name "$1")
|
||||
[ -d /run/systemd/generator ] || mkdir -p /run/systemd/generator
|
||||
if ! [ -f /run/systemd/generator/sysroot.mount ]; then
|
||||
{
|
||||
echo "[Unit]"
|
||||
echo "Before=initrd-root-fs.target"
|
||||
echo "RequiresOverridable=systemd-fsck@${_name}.service"
|
||||
echo "After=systemd-fsck@${_name}.service"
|
||||
echo "[Mount]"
|
||||
echo "Where=/sysroot"
|
||||
echo "What=$1"
|
||||
echo "Options=${_flags}"
|
||||
echo "Type=${_type}"
|
||||
} > /run/systemd/generator/sysroot.mount
|
||||
fi
|
||||
if ! [ -L /run/systemd/generator/initrd-root-fs.target.requires/sysroot.mount ]; then
|
||||
[ -d /run/systemd/generator/initrd-root-fs.target.requires ] || mkdir -p /run/systemd/generator/initrd-root-fs.target.requires
|
||||
ln -s ../sysroot.mount /run/systemd/generator/initrd-root-fs.target.requires/sysroot.mount
|
||||
fi
|
||||
}
|
||||
|
||||
root=$(getarg root=)
|
||||
case "$root" in
|
||||
block:LABEL=*|LABEL=*)
|
||||
@@ -58,6 +90,9 @@ case "$root" in
|
||||
rootok=1 ;;
|
||||
esac
|
||||
|
||||
[ "${root%%:*}" = "block" ] && generator_wait_for_dev "${root#block:}"
|
||||
if [ "${root%%:*}" = "block" ]; then
|
||||
generator_wait_for_dev "${root#block:}" "$RDRETRY"
|
||||
grep -q 'root=' /proc/cmdline || generator_mount_rootfs "${root#block:}" "$(getarg rootfstype=)" "$(getarg rootflags=)"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
@@ -6,7 +6,11 @@ if [ -n "$NEWROOT" ]; then
|
||||
[ -d $NEWROOT ] || mkdir -p -m 0755 $NEWROOT
|
||||
fi
|
||||
|
||||
[ -d /run/initramfs ] || mkdir -p -m 0755 /run/initramfs
|
||||
if ! [ -d /run/initramfs ]; then
|
||||
mkdir -p -m 0755 /run/initramfs/log
|
||||
ln -sfn /run/initramfs/log /var/log
|
||||
fi
|
||||
|
||||
[ -d /run/lock ] || mkdir -p -m 0755 /run/lock
|
||||
[ -d /run/log ] || mkdir -p -m 0755 /run/log
|
||||
|
||||
@@ -389,7 +393,7 @@ splitsep() {
|
||||
}
|
||||
|
||||
setdebug() {
|
||||
[ -f /etc/initrd-release ] || return
|
||||
[ -f /usr/lib/initrd-release ] || return
|
||||
if [ -z "$RD_DEBUG" ]; then
|
||||
if [ -e /proc/cmdline ]; then
|
||||
RD_DEBUG=no
|
||||
@@ -862,18 +866,30 @@ wait_for_mount()
|
||||
} >> "$hookdir/emergency/90-${_name}.sh"
|
||||
}
|
||||
|
||||
# get a systemd-compatible unit name from a path
|
||||
# (mimicks unit_name_from_path_instance())
|
||||
dev_unit_name()
|
||||
{
|
||||
local dev="$1"
|
||||
|
||||
if command -v systemd-escape >/dev/null; then
|
||||
systemd-escape -p "$1"
|
||||
systemd-escape -p "$dev"
|
||||
return
|
||||
fi
|
||||
|
||||
_name="${1%%/}"
|
||||
_name="${_name##/}"
|
||||
_name="$(str_replace "$_name" '-' '\x2d')"
|
||||
_name="$(str_replace "$_name" '/' '-')"
|
||||
echo "$_name"
|
||||
if [ "$dev" = "/" -o -z "$dev" ]; then
|
||||
printf -- "-"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
dev="${1%%/}"
|
||||
dev="${dev##/}"
|
||||
dev="$(str_replace "$dev" '\' '\x5c')"
|
||||
dev="$(str_replace "$dev" '-' '\x2d')"
|
||||
dev=${dev/#\./\\x2e}
|
||||
dev="$(str_replace "$dev" '/' '-')"
|
||||
|
||||
printf -- "%s" "$dev"
|
||||
}
|
||||
|
||||
# wait_for_dev <dev>
|
||||
@@ -886,12 +902,16 @@ wait_for_dev()
|
||||
local _name
|
||||
local _needreload
|
||||
local _noreload
|
||||
local _timeout
|
||||
|
||||
if [ "$1" = "-n" ]; then
|
||||
_noreload=1
|
||||
shift
|
||||
fi
|
||||
|
||||
_timeout=$(getarg rd.timeout)
|
||||
_timeout=${_timeout:-0}
|
||||
|
||||
_name="$(str_replace "$1" '/' '\x2f')"
|
||||
|
||||
type mark_hostonly >/dev/null 2>&1 && mark_hostonly "$hookdir/initqueue/finished/devexists-${_name}.sh"
|
||||
@@ -918,7 +938,7 @@ wait_for_dev()
|
||||
mkdir -p ${PREFIX}/etc/systemd/system/${_name}.device.d
|
||||
{
|
||||
echo "[Unit]"
|
||||
echo "JobTimeoutSec=0"
|
||||
echo "JobTimeoutSec=$_timeout"
|
||||
} > ${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf
|
||||
type mark_hostonly >/dev/null 2>&1 && mark_hostonly /etc/systemd/system/${_name}.device.d/timeout.conf
|
||||
_needreload=1
|
||||
|
@@ -73,15 +73,16 @@ fi
|
||||
if command -v kmod >/dev/null 2>/dev/null; then
|
||||
kmod static-nodes --format=tmpfiles 2>/dev/null | \
|
||||
while read type file mode a a a majmin; do
|
||||
case $type in
|
||||
d)
|
||||
mkdir -m $mode -p $file
|
||||
;;
|
||||
c)
|
||||
mknod -m $mode $file $type ${majmin%:*} ${majmin#*:}
|
||||
;;
|
||||
esac
|
||||
done
|
||||
type=${type%\!}
|
||||
case $type in
|
||||
d)
|
||||
mkdir -m $mode -p $file
|
||||
;;
|
||||
c)
|
||||
mknod -m $mode $file $type ${majmin%:*} ${majmin#*:}
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
trap "action_on_fail Signal caught!" 0
|
||||
@@ -105,7 +106,7 @@ else
|
||||
exec 0<>/dev/console 1<>/dev/console 2<>/dev/console
|
||||
fi
|
||||
|
||||
[ -f /etc/initrd-release ] && . /etc/initrd-release
|
||||
[ -f /usr/lib/initrd-release ] && . /usr/lib/initrd-release
|
||||
[ -n "$VERSION_ID" ] && info "$NAME-$VERSION_ID"
|
||||
|
||||
source_conf /etc/conf.d
|
||||
@@ -137,19 +138,19 @@ make_trace_mem "hook pre-udev" '1:shortmem' '2+:mem' '3+:slab'
|
||||
getarg 'rd.break=pre-udev' -d 'rdbreak=pre-udev' && emergency_shell -n pre-udev "Break before pre-udev"
|
||||
source_hook pre-udev
|
||||
|
||||
# start up udev and trigger cold plugs
|
||||
$systemdutildir/systemd-udevd --daemon --resolve-names=never
|
||||
UDEV_LOG=err
|
||||
getargbool 0 rd.udev.info -d -y rdudevinfo && UDEV_LOG=info
|
||||
getargbool 0 rd.udev.debug -d -y rdudevdebug && UDEV_LOG=debug
|
||||
|
||||
# start up udev and trigger cold plugs
|
||||
UDEV_LOG=$UDEV_LOG $systemdutildir/systemd-udevd --daemon --resolve-names=never
|
||||
|
||||
UDEV_LOG_PRIO_ARG=--log-priority
|
||||
UDEV_QUEUE_EMPTY="udevadm settle --timeout=0"
|
||||
|
||||
if [ $UDEVVERSION -lt 140 ]; then
|
||||
UDEV_LOG_PRIO_ARG=--log_priority
|
||||
UDEV_QUEUE_EMPTY="udevadm settle --timeout=1"
|
||||
fi
|
||||
|
||||
getargbool 0 rd.udev.info -d -y rdudevinfo && udevadm control "$UDEV_LOG_PRIO_ARG=info"
|
||||
getargbool 0 rd.udev.debug -d -y rdudevdebug && udevadm control "$UDEV_LOG_PRIO_ARG=debug"
|
||||
udevproperty "hookdir=$hookdir"
|
||||
|
||||
make_trace_mem "hook pre-trigger" '1:shortmem' '2+:mem' '3+:slab'
|
||||
@@ -165,7 +166,7 @@ make_trace_mem "hook initqueue" '1:shortmem' '2+:mem' '3+:slab'
|
||||
getarg 'rd.break=initqueue' -d 'rdbreak=initqueue' && emergency_shell -n initqueue "Break before initqueue"
|
||||
|
||||
RDRETRY=$(getarg rd.retry -d 'rd_retry=')
|
||||
RDRETRY=${RDRETRY:-30}
|
||||
RDRETRY=${RDRETRY:-180}
|
||||
RDRETRY=$(($RDRETRY*2))
|
||||
export RDRETRY
|
||||
main_loop=0
|
||||
|
@@ -42,6 +42,10 @@ exe=$1
|
||||
shift
|
||||
|
||||
[ -x "$exe" ] || exe=$(command -v $exe)
|
||||
if [ -z "$exe" ] ; then
|
||||
echo "Invalid command"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
{
|
||||
[ -n "$onetime" ] && echo '[ -e "$job" ] && rm -f -- "$job"'
|
||||
|
@@ -15,7 +15,7 @@ depends() {
|
||||
install() {
|
||||
local _d
|
||||
|
||||
inst_multiple mount mknod mkdir sleep chroot \
|
||||
inst_multiple mount mknod mkdir sleep chroot chown \
|
||||
sed ls flock cp mv dmesg rm ln rmmod mkfifo umount readlink setsid
|
||||
inst $(command -v modprobe) /sbin/modprobe
|
||||
|
||||
@@ -88,8 +88,10 @@ install() {
|
||||
echo VERSION_ID=$VERSION_ID
|
||||
echo PRETTY_NAME=\"$PRETTY_NAME\"
|
||||
echo ANSI_COLOR=\"$ANSI_COLOR\"
|
||||
} > $initdir/etc/initrd-release
|
||||
} > $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
|
||||
|
||||
## save host_devs which we need bring up
|
||||
|
@@ -84,22 +84,25 @@ fi
|
||||
|
||||
_check_shutdown() {
|
||||
local __f
|
||||
local __s=1
|
||||
local __s=0
|
||||
for __f in $hookdir/shutdown/*.sh; do
|
||||
[ -e "$__f" ] || continue
|
||||
( . "$__f" $1 )
|
||||
if [ $? -eq 0 ]; then
|
||||
rm -f -- $__f
|
||||
__s=0
|
||||
else
|
||||
__s=1
|
||||
fi
|
||||
done
|
||||
return $__s
|
||||
}
|
||||
|
||||
while _check_shutdown; do
|
||||
:
|
||||
_cnt=0
|
||||
while [ $_cnt -le 40 ]; do
|
||||
_check_shutdown && break
|
||||
_cnt=$(($_cnt+1))
|
||||
done
|
||||
_check_shutdown final
|
||||
[ $_cnt -ge 40 ] && _check_shutdown final
|
||||
|
||||
getarg 'rd.break=shutdown' && emergency_shell --shutdown shutdown "Break before shutdown"
|
||||
|
||||
|
@@ -7,8 +7,8 @@ rm -f -- /etc/lvm/lvm.conf
|
||||
udevadm control --reload
|
||||
set -e
|
||||
# save a partition at the beginning for future flagging purposes
|
||||
sfdisk -C 2560 -H 2 -S 32 -L /dev/sda <<EOF
|
||||
,16
|
||||
sfdisk /dev/sda <<EOF
|
||||
,1M
|
||||
,
|
||||
EOF
|
||||
|
||||
|
@@ -69,9 +69,10 @@ test_setup() {
|
||||
# We do it this way so that we do not risk trashing the host mdraid
|
||||
# devices, volume groups, encrypted partitions, etc.
|
||||
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-m "dash udev-rules base rootfs-block kernel-modules" \
|
||||
-m "dash udev-rules base rootfs-block fs-lib kernel-modules fs-lib" \
|
||||
-d "piix ide-gd_mod ata_piix ext3 sd_mod" \
|
||||
--nomdadmconf \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.makeroot $KVERSION || return 1
|
||||
rm -rf -- $TESTDIR/overlay
|
||||
# Invoke KVM and/or QEMU to actually create the target filesystem.
|
||||
@@ -95,6 +96,7 @@ test_setup() {
|
||||
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-a "debug watchdog" \
|
||||
-d "piix ide-gd_mod ata_piix ext3 sd_mod i6300esb ib700wdt" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.testing $KVERSION || return 1
|
||||
|
||||
# -o "plymouth network md dmraid multipath fips caps crypt btrfs resume dmsquash-live dm"
|
||||
|
@@ -7,8 +7,8 @@ rm -f -- /etc/lvm/lvm.conf
|
||||
udevadm control --reload
|
||||
set -e
|
||||
# save a partition at the beginning for future flagging purposes
|
||||
sfdisk -C 2560 -H 2 -S 32 -L /dev/sda <<EOF
|
||||
,16
|
||||
sfdisk /dev/sda <<EOF
|
||||
,1M
|
||||
,
|
||||
EOF
|
||||
|
||||
|
@@ -66,9 +66,10 @@ test_setup() {
|
||||
# We do it this way so that we do not risk trashing the host mdraid
|
||||
# devices, volume groups, encrypted partitions, etc.
|
||||
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-m "dash udev-rules base rootfs-block kernel-modules" \
|
||||
-m "dash udev-rules base rootfs-block fs-lib kernel-modules" \
|
||||
-d "piix ide-gd_mod ata_piix ext3 sd_mod" \
|
||||
--nomdadmconf \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.makeroot $KVERSION || return 1
|
||||
rm -rf -- $TESTDIR/overlay
|
||||
# Invoke KVM and/or QEMU to actually create the target filesystem.
|
||||
@@ -93,6 +94,7 @@ test_setup() {
|
||||
-a "debug systemd" \
|
||||
-o "network" \
|
||||
-d "piix ide-gd_mod ata_piix ext3 sd_mod" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.testing $KVERSION || return 1
|
||||
|
||||
# -o "plymouth network md dmraid multipath fips caps crypt btrfs resume dmsquash-live dm"
|
||||
|
@@ -7,13 +7,13 @@ rm -f -- /etc/lvm/lvm.conf
|
||||
udevadm control --reload
|
||||
set -e
|
||||
# save a partition at the beginning for future flagging purposes
|
||||
sfdisk -C 5120 -H 2 -S 32 -L /dev/sda <<EOF
|
||||
,16
|
||||
sfdisk /dev/sda <<EOF
|
||||
,1M
|
||||
,
|
||||
EOF
|
||||
|
||||
sfdisk -C 5120 -H 2 -S 32 -L /dev/sdb <<EOF
|
||||
,16
|
||||
sfdisk /dev/sdb <<EOF
|
||||
,1M
|
||||
,
|
||||
EOF
|
||||
|
||||
|
@@ -97,10 +97,11 @@ test_setup() {
|
||||
# We do it this way so that we do not risk trashing the host mdraid
|
||||
# devices, volume groups, encrypted partitions, etc.
|
||||
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-m "dash udev-rules btrfs base rootfs-block kernel-modules" \
|
||||
-m "dash udev-rules btrfs base rootfs-block fs-lib kernel-modules" \
|
||||
-d "piix ide-gd_mod ata_piix btrfs sd_mod" \
|
||||
--nomdadmconf \
|
||||
--nohardlink \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.makeroot $KVERSION || return 1
|
||||
|
||||
# Invoke KVM and/or QEMU to actually create the target filesystem.
|
||||
@@ -131,6 +132,7 @@ test_setup() {
|
||||
-a "debug watchdog" \
|
||||
-o "network" \
|
||||
-d "piix ide-gd_mod ata_piix btrfs sd_mod i6300esb ib700wdt" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.testing $KVERSION || return 1
|
||||
|
||||
rm -rf -- $TESTDIR/overlay
|
||||
|
@@ -7,13 +7,13 @@ rm -f -- /etc/lvm/lvm.conf
|
||||
udevadm control --reload
|
||||
set -e
|
||||
# save a partition at the beginning for future flagging purposes
|
||||
sfdisk -C 10240 -H 2 -S 32 -L /dev/sda <<EOF
|
||||
,16
|
||||
sfdisk /dev/sda <<EOF
|
||||
,1M
|
||||
,
|
||||
EOF
|
||||
|
||||
sfdisk -C 10240 -H 2 -S 32 -L /dev/sdb <<EOF
|
||||
,16
|
||||
sfdisk /dev/sdb <<EOF
|
||||
,1M
|
||||
,
|
||||
EOF
|
||||
|
||||
|
@@ -173,6 +173,7 @@ EOF
|
||||
|
||||
# install basic keyboard maps and fonts
|
||||
for i in \
|
||||
/usr/lib/kbd/consolefonts/eurlatgr* \
|
||||
/usr/lib/kbd/consolefonts/latarcyrheb-sun16* \
|
||||
/usr/lib/kbd/keymaps/include/* \
|
||||
/usr/lib/kbd/keymaps/i386/include/* \
|
||||
@@ -190,7 +191,7 @@ EOF
|
||||
# softlink mtab
|
||||
ln -fs /proc/self/mounts $initdir/etc/mtab
|
||||
|
||||
# install any Exec's from the service files
|
||||
# install any Execs from the service files
|
||||
egrep -ho '^Exec[^ ]*=[^ ]+' $initdir/lib/systemd/system/*.service \
|
||||
| while read i; do
|
||||
i=${i##Exec*=}; i=${i##-}
|
||||
@@ -204,7 +205,7 @@ EOF
|
||||
cp -a /etc/ld.so.conf* $initdir/etc
|
||||
ldconfig -r "$initdir"
|
||||
ddebug "Strip binaeries"
|
||||
find "$initdir" -perm +111 -type f | xargs -r strip --strip-unneeded | ddebug
|
||||
find "$initdir" -perm /0111 -type f | xargs -r strip --strip-unneeded | ddebug
|
||||
|
||||
# copy depmod files
|
||||
inst /lib/modules/$kernel/modules.order
|
||||
@@ -232,10 +233,11 @@ EOF
|
||||
# We do it this way so that we do not risk trashing the host mdraid
|
||||
# devices, volume groups, encrypted partitions, etc.
|
||||
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-m "dash udev-rules btrfs base rootfs-block kernel-modules" \
|
||||
-m "dash udev-rules btrfs base rootfs-block fs-lib kernel-modules" \
|
||||
-d "piix ide-gd_mod ata_piix btrfs sd_mod" \
|
||||
--nomdadmconf \
|
||||
--nohardlink \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.makeroot $KVERSION || return 1
|
||||
|
||||
# Invoke KVM and/or QEMU to actually create the target filesystem.
|
||||
@@ -262,6 +264,7 @@ EOF
|
||||
-I "/etc/machine-id /etc/hostname" \
|
||||
-o "dash network plymouth lvm mdraid resume crypt i18n caps dm terminfo usrmount" \
|
||||
-d "piix ide-gd_mod ata_piix btrfs sd_mod i6300esb ib700wdt" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.testing $KVERSION || return 1
|
||||
|
||||
rm -rf -- $TESTDIR/overlay
|
||||
|
@@ -6,11 +6,11 @@ done
|
||||
rm -f -- /etc/lvm/lvm.conf
|
||||
udevadm control --reload
|
||||
# save a partition at the beginning for future flagging purposes
|
||||
sfdisk -C 2560 -H 2 -S 32 -L /dev/sda <<EOF
|
||||
,32
|
||||
,800
|
||||
,800
|
||||
,800
|
||||
sfdisk /dev/sda <<EOF
|
||||
,4M
|
||||
,25M
|
||||
,25M
|
||||
,25M
|
||||
EOF
|
||||
udevadm settle
|
||||
mdadm --create /dev/md0 --run --auto=yes --level=5 --raid-devices=3 /dev/sda2 /dev/sda3 /dev/sda4
|
||||
|
@@ -5,7 +5,7 @@ KVERSION=${KVERSION-$(uname -r)}
|
||||
|
||||
# Uncomment this to debug failures
|
||||
#DEBUGFAIL="rd.shell rd.udev.log-priority=debug loglevel=70 systemd.log_target=kmsg"
|
||||
#DEBUGFAIL="rd.break rd.shell"
|
||||
#DEBUGFAIL="rd.break rd.shell rd.debug debug"
|
||||
test_run() {
|
||||
DISKIMAGE=$TESTDIR/TEST-10-RAID-root.img
|
||||
$testdir/run-qemu \
|
||||
@@ -67,9 +67,10 @@ test_setup() {
|
||||
# We do it this way so that we do not risk trashing the host mdraid
|
||||
# devices, volume groups, encrypted partitions, etc.
|
||||
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-m "dash crypt lvm mdraid udev-rules base rootfs-block kernel-modules" \
|
||||
-m "dash crypt lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules" \
|
||||
-d "piix ide-gd_mod ata_piix ext2 sd_mod" \
|
||||
--nomdadmconf \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.makeroot $KVERSION || return 1
|
||||
rm -rf -- $TESTDIR/overlay
|
||||
# Invoke KVM and/or QEMU to actually create the target filesystem.
|
||||
@@ -99,6 +100,7 @@ test_setup() {
|
||||
-o "plymouth network" \
|
||||
-a "debug" \
|
||||
-d "piix ide-gd_mod ata_piix ext2 sd_mod" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.testing $KVERSION || return 1
|
||||
}
|
||||
|
||||
|
@@ -6,11 +6,11 @@ done
|
||||
rm -f -- /etc/lvm/lvm.conf
|
||||
udevadm control --reload
|
||||
# save a partition at the beginning for future flagging purposes
|
||||
sfdisk -C 1280 -H 2 -S 32 -L /dev/sda <<EOF
|
||||
,1
|
||||
,400
|
||||
,400
|
||||
,400
|
||||
sfdisk /dev/sda <<EOF
|
||||
,1M
|
||||
,10M
|
||||
,10M
|
||||
,10M
|
||||
EOF
|
||||
udevadm settle
|
||||
for i in sda2 sda3 sda4; do
|
||||
|
@@ -65,8 +65,9 @@ test_setup() {
|
||||
# We do it this way so that we do not risk trashing the host mdraid
|
||||
# devices, volume groups, encrypted partitions, etc.
|
||||
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-m "dash lvm mdraid udev-rules base rootfs-block kernel-modules" \
|
||||
-m "dash lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules" \
|
||||
-d "piix ide-gd_mod ata_piix ext2 sd_mod" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.makeroot $KVERSION || return 1
|
||||
rm -rf -- $TESTDIR/overlay
|
||||
# Invoke KVM and/or QEMU to actually create the target filesystem.
|
||||
@@ -86,6 +87,7 @@ test_setup() {
|
||||
-o "plymouth network" \
|
||||
-a "debug" \
|
||||
-d "piix ide-gd_mod ata_piix ext2 sd_mod" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.testing $KVERSION || return 1
|
||||
}
|
||||
|
||||
|
@@ -9,11 +9,11 @@ done
|
||||
rm -f -- /etc/lvm/lvm.conf
|
||||
udevadm control --reload
|
||||
# save a partition at the beginning for future flagging purposes
|
||||
sfdisk -C 1280 -H 2 -S 32 -L /dev/sda <<EOF
|
||||
,16
|
||||
,400
|
||||
,400
|
||||
,400
|
||||
sfdisk /dev/sda <<EOF
|
||||
,5M
|
||||
,10M
|
||||
,10M
|
||||
,10M
|
||||
EOF
|
||||
udevadm settle
|
||||
mdadm --create /dev/md0 --run --auto=yes --level=5 --raid-devices=3 /dev/sdb /dev/sdc /dev/sdd
|
||||
|
@@ -105,8 +105,9 @@ test_setup() {
|
||||
# We do it this way so that we do not risk trashing the host mdraid
|
||||
# devices, volume groups, encrypted partitions, etc.
|
||||
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-m "dash crypt lvm mdraid udev-rules base rootfs-block kernel-modules" \
|
||||
-m "dash crypt lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules" \
|
||||
-d "piix ide-gd_mod ata_piix ext2 sd_mod" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.makeroot $KVERSION || return 1
|
||||
rm -rf -- $TESTDIR/overlay
|
||||
# Invoke KVM and/or QEMU to actually create the target filesystem.
|
||||
@@ -142,6 +143,7 @@ test_setup() {
|
||||
-o "plymouth network" \
|
||||
-a "debug" \
|
||||
-d "piix ide-gd_mod ata_piix ext2 sd_mod" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.testing $KVERSION || return 1
|
||||
}
|
||||
|
||||
|
@@ -7,11 +7,11 @@ done
|
||||
rm -f -- /etc/lvm/lvm.conf
|
||||
udevadm control --reload
|
||||
# save a partition at the beginning for future flagging purposes
|
||||
sfdisk -C 2560 -H 2 -S 32 -L /dev/sda <<EOF
|
||||
,16
|
||||
,800
|
||||
,800
|
||||
,800
|
||||
sfdisk /dev/sda <<EOF
|
||||
,4M
|
||||
,25M
|
||||
,25M
|
||||
,25M
|
||||
EOF
|
||||
udevadm settle
|
||||
echo -n test >keyfile
|
||||
|
@@ -102,8 +102,9 @@ test_setup() {
|
||||
# We do it this way so that we do not risk trashing the host mdraid
|
||||
# devices, volume groups, encrypted partitions, etc.
|
||||
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-m "dash crypt lvm mdraid udev-rules base rootfs-block kernel-modules" \
|
||||
-m "dash crypt lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules" \
|
||||
-d "piix ide-gd_mod ata_piix ext2 sd_mod" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.makeroot $KVERSION || return 1
|
||||
rm -rf -- $TESTDIR/overlay
|
||||
# Invoke KVM and/or QEMU to actually create the target filesystem.
|
||||
@@ -139,6 +140,7 @@ test_setup() {
|
||||
-o "plymouth network" \
|
||||
-a "debug" \
|
||||
-d "piix ide-gd_mod ata_piix ext2 sd_mod" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.testing $KVERSION || return 1
|
||||
}
|
||||
|
||||
|
@@ -22,13 +22,16 @@ for s in $SETS; do
|
||||
done
|
||||
|
||||
udevadm settle
|
||||
sleep 1
|
||||
udevadm settle
|
||||
|
||||
sfdisk -g /dev/mapper/isw*Test0
|
||||
# save a partition at the beginning for future flagging purposes
|
||||
sfdisk -C 2560 -H 2 -S 32 -L /dev/mapper/isw*Test0 <<EOF
|
||||
,1
|
||||
,600
|
||||
,600
|
||||
,600
|
||||
sfdisk --no-reread /dev/mapper/isw*Test0 <<EOF
|
||||
,4M
|
||||
,20M
|
||||
,20M
|
||||
,20M
|
||||
EOF
|
||||
|
||||
udevadm settle
|
||||
|
@@ -93,8 +93,9 @@ test_setup() {
|
||||
# We do it this way so that we do not risk trashing the host mdraid
|
||||
# devices, volume groups, encrypted partitions, etc.
|
||||
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-m "dash lvm mdraid dmraid udev-rules base rootfs-block kernel-modules" \
|
||||
-m "dash lvm mdraid dmraid udev-rules base rootfs-block fs-lib kernel-modules" \
|
||||
-d "piix ide-gd_mod ata_piix ext2 sd_mod dm-multipath dm-crypt dm-round-robin faulty linear multipath raid0 raid10 raid1 raid456" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.makeroot $KVERSION || return 1
|
||||
rm -rf -- $TESTDIR/overlay
|
||||
# Invoke KVM and/or QEMU to actually create the target filesystem.
|
||||
@@ -120,6 +121,7 @@ test_setup() {
|
||||
-o "plymouth network" \
|
||||
-a "debug" \
|
||||
-d "piix ide-gd_mod ata_piix ext2 sd_mod" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.testing $KVERSION || return 1
|
||||
}
|
||||
|
||||
|
@@ -5,24 +5,21 @@ for x in 64-lvm.rules 70-mdadm.rules 99-mount-rules; do
|
||||
done
|
||||
udevadm control --reload
|
||||
# save a partition at the beginning for future flagging purposes
|
||||
sfdisk -C 327800 -H 2 -S 32 -L /dev/sda <<EOF
|
||||
,16
|
||||
,,E
|
||||
;
|
||||
;
|
||||
,5120
|
||||
,5120
|
||||
,5120
|
||||
,5120
|
||||
sfdisk -X gpt /dev/sda <<EOF
|
||||
,10M
|
||||
,200M
|
||||
,200M
|
||||
,200M
|
||||
,200M
|
||||
EOF
|
||||
udevadm settle
|
||||
mkfs.btrfs -draid10 -mraid10 -L root /dev/sda5 /dev/sda6 /dev/sda7 /dev/sda8
|
||||
mkfs.btrfs -draid10 -mraid10 -L root /dev/sda2 /dev/sda3 /dev/sda4 /dev/sda5
|
||||
udevadm settle
|
||||
btrfs device scan
|
||||
udevadm settle
|
||||
set -e
|
||||
mkdir -p /sysroot
|
||||
mount -t btrfs /dev/sda8 /sysroot
|
||||
mount -t btrfs /dev/sda5 /sysroot
|
||||
cp -a -t /sysroot /source/*
|
||||
umount /sysroot
|
||||
echo "dracut-root-block-created" >/dev/sda1
|
||||
|
@@ -13,7 +13,7 @@ test_run() {
|
||||
-net none -kernel /boot/vmlinuz-$KVERSION \
|
||||
-append "root=LABEL=root rw rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 $DEBUGFAIL" \
|
||||
-initrd $TESTDIR/initramfs.testing
|
||||
dd if=$DISKIMAGE bs=512 count=2 | grep -F -m 1 -q dracut-root-block-success $DISKIMAGE || return 1
|
||||
dd if=$DISKIMAGE bs=512 count=4 skip=2048 | grep -F -m 1 -q dracut-root-block-success $DISKIMAGE || return 1
|
||||
}
|
||||
|
||||
test_setup() {
|
||||
@@ -66,9 +66,10 @@ test_setup() {
|
||||
# We do it this way so that we do not risk trashing the host mdraid
|
||||
# devices, volume groups, encrypted partitions, etc.
|
||||
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-m "dash btrfs udev-rules base rootfs-block kernel-modules" \
|
||||
-m "dash btrfs udev-rules base rootfs-block fs-lib kernel-modules" \
|
||||
-d "piix ide-gd_mod ata_piix btrfs sd_mod" \
|
||||
--nomdadmconf \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.makeroot $KVERSION || return 1
|
||||
|
||||
rm -rf -- $TESTDIR/overlay
|
||||
@@ -81,7 +82,7 @@ test_setup() {
|
||||
-append "root=/dev/fakeroot rw quiet console=ttyS0,115200n81 selinux=0" \
|
||||
-initrd $TESTDIR/initramfs.makeroot || return 1
|
||||
|
||||
dd if=$DISKIMAGE bs=512 count=2 | grep -F -m 1 -q dracut-root-block-created || return 1
|
||||
dd if=$DISKIMAGE bs=512 count=4 skip=2048 | grep -F -m 1 -q dracut-root-block-created || return 1
|
||||
|
||||
(
|
||||
export initdir=$TESTDIR/overlay
|
||||
@@ -94,6 +95,7 @@ test_setup() {
|
||||
-o "plymouth network" \
|
||||
-a "debug" \
|
||||
-d "piix ide-gd_mod ata_piix btrfs sd_mod" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.testing $KVERSION || return 1
|
||||
}
|
||||
|
||||
|
@@ -41,6 +41,7 @@ test_setup() {
|
||||
sudo $basedir/dracut.sh -l -i "$TESTDIR"/overlay / \
|
||||
-a "debug dmsquash-live" \
|
||||
-d "piix ide-gd_mod ata_piix ext3 sd_mod" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1
|
||||
|
||||
mkdir -p -- "$TESTDIR"/root-source
|
||||
|
@@ -6,11 +6,11 @@ done
|
||||
rm -f -- /etc/lvm/lvm.conf
|
||||
udevadm control --reload
|
||||
# save a partition at the beginning for future flagging purposes
|
||||
sfdisk -C 2560 -H 2 -S 32 -L /dev/sda <<EOF
|
||||
,1
|
||||
,800
|
||||
,800
|
||||
,800
|
||||
sfdisk /dev/sda <<EOF
|
||||
,4M
|
||||
,25M
|
||||
,25M
|
||||
,25M
|
||||
EOF
|
||||
udevadm settle
|
||||
for i in sda2 sda3 sda4; do
|
||||
|
@@ -65,8 +65,9 @@ test_setup() {
|
||||
# We do it this way so that we do not risk trashing the host mdraid
|
||||
# devices, volume groups, encrypted partitions, etc.
|
||||
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-m "dash lvm mdraid udev-rules base rootfs-block kernel-modules" \
|
||||
-m "dash lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules" \
|
||||
-d "piix ide-gd_mod ata_piix ext2 sd_mod" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.makeroot $KVERSION || return 1
|
||||
rm -rf -- $TESTDIR/overlay
|
||||
# Invoke KVM and/or QEMU to actually create the target filesystem.
|
||||
@@ -86,6 +87,7 @@ test_setup() {
|
||||
-o "plymouth network" \
|
||||
-a "debug" -I lvs \
|
||||
-d "piix ide-gd_mod ata_piix ext2 sd_mod" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.testing $KVERSION || return 1
|
||||
}
|
||||
|
||||
|
@@ -50,7 +50,7 @@ echo > /dev/watchdog
|
||||
echo > /dev/watchdog
|
||||
chmod 777 /var/lib/dhcpd/dhcpd.leases
|
||||
echo > /dev/watchdog
|
||||
dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases
|
||||
dhcpd -d -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases
|
||||
echo -n "V" > /dev/watchdog
|
||||
echo "Serving NFS mounts"
|
||||
while :; do sleep 30; done
|
||||
|
@@ -342,8 +342,9 @@ test_setup() {
|
||||
|
||||
# Make server's dracut image
|
||||
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-m "dash udev-rules base rootfs-block debug kernel-modules watchdog" \
|
||||
-m "dash udev-rules base rootfs-block fs-lib debug kernel-modules watchdog" \
|
||||
-d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod e1000 i6300esb" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.server $KVERSION || return 1
|
||||
|
||||
# Make client's dracut image
|
||||
@@ -351,6 +352,7 @@ test_setup() {
|
||||
-o "plymouth dash" \
|
||||
-a "debug watchdog" \
|
||||
-d "af_packet piix ide-gd_mod ata_piix sd_mod e1000 nfs sunrpc i6300esb" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.testing $KVERSION || return 1
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@ for x in 64-lvm.rules 70-mdadm.rules 99-mount-rules; do
|
||||
done
|
||||
rm -f -- /etc/lvm/lvm.conf
|
||||
udevadm control --reload
|
||||
mkfs.ext3 -j -F /dev/sda && \
|
||||
mkfs.ext3 -j -L singleroot -F /dev/sda && \
|
||||
mkdir -p /sysroot && \
|
||||
mount /dev/sda /sysroot && \
|
||||
cp -a -t /sysroot /source/* && \
|
||||
|
@@ -59,17 +59,18 @@ run_client() {
|
||||
|
||||
do_test_run() {
|
||||
|
||||
run_client "root=dhcp" \
|
||||
"root=dhcp" \
|
||||
|| return 1
|
||||
#
|
||||
# run_client "root=dhcp" \
|
||||
# "root=dhcp" \
|
||||
# || return 1
|
||||
|
||||
run_client "root=iscsi" \
|
||||
"root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0" \
|
||||
run_client "netroot=iscsi target0"\
|
||||
"root=LABEL=singleroot netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0" \
|
||||
"ip=192.168.50.101::192.168.50.1:255.255.255.0:iscsi-1:ens3:off" \
|
||||
|| return 1
|
||||
|
||||
run_client "netroot=iscsi" \
|
||||
"iscsi_firmware root=LABEL=sysroot ip=192.168.50.101::192.168.50.1:255.255.255.0:iscsi-1:ens3:off" \
|
||||
run_client "netroot=iscsi target1 target2" \
|
||||
"root=LABEL=sysroot ip=192.168.50.101::192.168.50.1:255.255.255.0:iscsi-1:ens3:off" \
|
||||
"netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1 netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target2" \
|
||||
|| return 1
|
||||
return 0
|
||||
@@ -115,7 +116,7 @@ test_setup() {
|
||||
mkdir -p -- var/lib/nfs/rpc_pipefs
|
||||
)
|
||||
inst_multiple sh shutdown poweroff stty cat ps ln ip \
|
||||
mount dmesg mkdir cp ping grep
|
||||
mount dmesg mkdir cp ping grep setsid
|
||||
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
|
||||
[ -f ${_terminfodir}/l/linux ] && break
|
||||
done
|
||||
@@ -130,7 +131,7 @@ test_setup() {
|
||||
(
|
||||
export initdir=$TESTDIR/overlay
|
||||
. $basedir/dracut-functions.sh
|
||||
inst_multiple sfdisk mkfs.ext3 poweroff cp umount
|
||||
inst_multiple sfdisk mkfs.ext3 poweroff cp umount setsid
|
||||
inst_hook initqueue 01 ./create-root.sh
|
||||
inst_hook initqueue/finished 01 ./finished-false.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
@@ -140,8 +141,9 @@ test_setup() {
|
||||
# We do it this way so that we do not risk trashing the host mdraid
|
||||
# devices, volume groups, encrypted partitions, etc.
|
||||
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-m "dash crypt lvm mdraid udev-rules base rootfs-block kernel-modules" \
|
||||
-m "dash crypt lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules" \
|
||||
-d "piix ide-gd_mod ata_piix ext3 sd_mod" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.makeroot $KVERSION || return 1
|
||||
rm -rf -- $TESTDIR/overlay
|
||||
|
||||
@@ -174,6 +176,7 @@ test_setup() {
|
||||
-o "dash plymouth dmraid" \
|
||||
-a "debug" \
|
||||
-d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.testing $KVERSION || return 1
|
||||
|
||||
# Make server root
|
||||
@@ -193,7 +196,7 @@ test_setup() {
|
||||
inst /etc/passwd /etc/passwd
|
||||
inst_multiple sh ls shutdown poweroff stty cat ps ln ip \
|
||||
dmesg mkdir cp ping \
|
||||
modprobe tcpdump \
|
||||
modprobe tcpdump setsid \
|
||||
/etc/services sleep mount chmod
|
||||
inst_multiple /usr/sbin/iscsi-target
|
||||
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
|
||||
@@ -222,8 +225,9 @@ test_setup() {
|
||||
|
||||
# Make server's dracut image
|
||||
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-m "dash udev-rules base rootfs-block debug kernel-modules" \
|
||||
-m "dash udev-rules base rootfs-block fs-lib debug kernel-modules" \
|
||||
-d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod e1000" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.server $KVERSION || return 1
|
||||
|
||||
}
|
||||
|
@@ -238,8 +238,9 @@ make_encrypted_root() {
|
||||
# We do it this way so that we do not risk trashing the host mdraid
|
||||
# devices, volume groups, encrypted partitions, etc.
|
||||
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-m "dash crypt lvm mdraid udev-rules base rootfs-block kernel-modules" \
|
||||
-m "dash crypt lvm mdraid udev-rules base rootfs-block fs-lib kernel-modules" \
|
||||
-d "piix ide-gd_mod ata_piix ext2 ext3 sd_mod" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.makeroot $KVERSION || return 1
|
||||
rm -rf -- $TESTDIR/overlay
|
||||
|
||||
@@ -370,14 +371,16 @@ test_setup() {
|
||||
)
|
||||
|
||||
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-m "dash udev-rules rootfs-block base debug kernel-modules" \
|
||||
-m "dash udev-rules rootfs-block fs-lib base debug kernel-modules" \
|
||||
-d "af_packet piix ide-gd_mod ata_piix ext2 ext3 sd_mod e1000" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.server $KVERSION || return 1
|
||||
|
||||
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-o "plymouth" \
|
||||
-a "debug watchdog" \
|
||||
-d "af_packet piix ide-gd_mod ata_piix ext2 ext3 sd_mod e1000 i6300esb ib700wdt" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f $TESTDIR/initramfs.testing $KVERSION || return 1
|
||||
}
|
||||
|
||||
|
@@ -84,7 +84,7 @@ exportfs -r
|
||||
>/dev/watchdog
|
||||
chmod 777 /var/lib/dhcpd/dhcpd.leases
|
||||
>/dev/watchdog
|
||||
dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases
|
||||
dhcpd -d -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases
|
||||
#echo -n 'V' > /dev/watchdog
|
||||
#sh -i
|
||||
#tcpdump -i ens3
|
||||
|
@@ -266,8 +266,9 @@ test_setup() {
|
||||
|
||||
# Make server's dracut image
|
||||
$basedir/dracut.sh -l -i "$TESTDIR"/overlay / \
|
||||
-m "dash udev-rules base rootfs-block debug kernel-modules watchdog" \
|
||||
-m "dash udev-rules base rootfs-block fs-lib debug kernel-modules watchdog" \
|
||||
-d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files nfsd e1000 i6300esb ib700wdt" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f "$TESTDIR"/initramfs.server "$KVERSION" || return 1
|
||||
|
||||
# Make client's dracut image
|
||||
@@ -275,6 +276,7 @@ test_setup() {
|
||||
-o "plymouth" \
|
||||
-a "debug" \
|
||||
-d "af_packet piix sd_mod sr_mod ata_piix ide-gd_mod e1000 nfsv2 nfsv3 nfsv4 nfs_acl nfs_layout_nfsv41_files sunrpc i6300esb ib700wdt" \
|
||||
--no-hostonly-cmdline -N \
|
||||
-f "$TESTDIR"/initramfs.testing "$KVERSION" || return 1
|
||||
}
|
||||
|
||||
|
@@ -50,6 +50,8 @@ find / -xdev -type f -not -path '/var/*' \
|
||||
-not -path '/etc/nsswitch.conf.bak' \
|
||||
-not -path '/etc/iscsi/initiatorname.iscsi' \
|
||||
-not -path '/boot/*0-rescue*' \
|
||||
-not -patch '/usr/share/mime/*' \
|
||||
-not -patch '/etc/crypto-policies/*' \
|
||||
-not -path '/dev/null' \
|
||||
-not -path "/boot/loader/entries/\$(cat /etc/machine-id)-*" \
|
||||
-not -path "/boot/\$(cat /etc/machine-id)/*" \
|
||||
|
Reference in New Issue
Block a user