Compare commits

...

56 Commits
036 ... 037

Author SHA1 Message Date
Harald Hoyer
96087189e6 NEWS: update for 037 2014-03-19 17:16:08 +01:00
Harald Hoyer
51160a47b1 systemd/dracut-shutdown.service: make failure non-fatal 2014-03-18 13:33:55 +01:00
Harald Hoyer
68dc90c6e9 shutdown: if kexec failed, do a simple reboot 2014-03-18 13:21:22 +01:00
Harald Hoyer
a9d30a4066 network:dhclient-script do PREINIT6 for DHCP6 2014-03-17 13:00:17 +01:00
Harald Hoyer
0cb42c27f9 lvm:lvm_scan.sh handle one LV at a time with lvchange 2014-03-11 12:16:14 +01:00
Harald Hoyer
2bdf760fe0 NEWS: update for dracut-037 2014-03-06 09:55:19 +01:00
Harald Hoyer
ce4167060c AUTHORS: update 2014-03-06 09:55:19 +01:00
Harald Hoyer
ee4b74fb9c Do not wait_for_dev if hostonly_cmdline not set 2014-03-06 09:55:19 +01:00
Harald Hoyer
f60b7d8655 fcoe-up: remove initlog logic 2014-03-05 13:21:25 +01:00
Harald Hoyer
99edb47e85 default conf: set hostonly_cmdline == "no" 2014-03-05 12:33:40 +01:00
Harald Hoyer
8ee1825364 dracut: don't let devices timeout
https://bugzilla.redhat.com/show_bug.cgi?id=949697
2014-03-05 12:32:10 +01:00
Harald Hoyer
83a3cba777 dracut-functions.sh: degrade info about missing binaries to info 2014-03-05 12:23:49 +01:00
Alexander Tsoy
cd501ff74b udev-rules: add 80-net-setup-link.rules and .link files
With systemd >= 209 these file are required for predictable network interface
names
2014-03-05 10:40:22 +01:00
WANG Chao
646e0506f6 Add -[-no]-hostonly-cmdline option handling for getopt
commit ab9457e introduce such new options but it missed to add these
options to getopt arguments.

Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-03-03 12:41:28 +01:00
Harald Hoyer
3a62030116 test/TEST-50-MULTINIC/client-init.sh: skip MAC marker files 2014-02-28 13:26:13 +01:00
Harald Hoyer
be1c0381e5 test/Makefile: add SKIP env to skip certain tests 2014-02-28 13:25:39 +01:00
Harald Hoyer
6fe0abbf12 test: add missing Makefile.testdir 2014-02-28 12:57:57 +01:00
Dave Young
5f6a495bf4 add default values in fstab_lines
It's useful for passing a full fstab line including like fs_passno so fsck
can take effect.

Previously it's assumed that there's no fs_freq and fs_passno in fstab lines
so original code just append "0 0" at the end of each fstab lines.

Improve this issue by assign default value in case they are not passed in.
Three field are handled here:
fs_mntops: default to "defaults"
fs_freq: default to "0"
fs_passno: default to "2"

Signed-off-by: Dave Young <dyoung@redhat.com>
2014-02-28 12:10:47 +01:00
Harald Hoyer
1f680ccc9b systemd: add systemd-sysctl service
https://bugzilla.redhat.com/show_bug.cgi?id=1070086
2014-02-28 12:10:45 +01:00
Harald Hoyer
43a85a7365 network: merge setup_net_$netif.ok and net.$netif.did-setup
one marker per interface is enough
2014-02-28 12:10:41 +01:00
Harald Hoyer
61b4afb424 network: IPv6 status, wait for tentative flag to be cleared
also do not arping the IPv6 address.
2014-02-27 12:13:18 +01:00
Harald Hoyer
2ac599dc75 network/dhclient-script.sh:DHCP IPv6 interface setup
configure IPv6 interface for DHCP6

https://bugzilla.redhat.com/show_bug.cgi?id=1064365
2014-02-26 15:02:51 +01:00
Harald Hoyer
7f70f81153 network/net-lib.sh:wait_for_ipv6_auto() also wait for the tentative flag
Wait until the tentative flag is cleared.

https://bugzilla.redhat.com/show_bug.cgi?id=1069263
2014-02-26 15:02:48 +01:00
Harald Hoyer
79b3c8bfa1 ifcfg/write-ifcfg.sh: do not bind s390 to MAC if SUBCHANNELS set
If SUBCHANNELS are set, do not specify HWADDR, because the SUBCHANNELS
are the identifier for the interface.

https://bugzilla.redhat.com/show_bug.cgi?id=1056438
2014-02-26 15:02:46 +01:00
Harald Hoyer
fa795f29e2 systemd/rootfs-generator.sh: generate units in /run/systemd/generator
Generate the units in /run/systemd/generator, so they are picked up by
systemd.

https://bugzilla.redhat.com/show_bug.cgi?id=1069133
https://bugzilla.redhat.com/show_bug.cgi?id=949697
2014-02-26 15:02:42 +01:00
Harald Hoyer
ab9457efd7 Add flag to toggle hostonly cmdline storing in the initramfs
--hostonly-cmdline:
    Store kernel command line arguments needed in the initramfs

--no-hostonly-cmdline:
    Do not store kernel command line arguments needed in the initramfs
2014-02-26 15:01:55 +01:00
Harald Hoyer
103c5e1ecb systemd: add 70-uaccess.rules 2014-02-26 14:56:28 +01:00
Amadeusz Żołnowski
4eec1a2276 Added missing quotes
See bug report at https://bugs.gentoo.org/show_bug.cgi?id=502064
2014-02-26 14:55:54 +01:00
Alexander Tsoy
8a2db478de Add legacy flag (-l) to lz4 and update magic number
Linux kernel does not support the new default lz4 format.

https://bugs.gentoo.org/show_bug.cgi?id=502102
2014-02-26 14:55:54 +01:00
sfalken@opensuse.org
6e53596cec Patch for Manpage
Patch corrects grub paths in the manpage for both GRUB legacy and GRUB2
2014-02-26 14:55:54 +01:00
Harald Hoyer
dc4c1ee39d dracut.sh: write directly to the output file
Because we already remove the output file before writing to it, we don't
have to play games and write to a temporary file first.
2014-02-19 15:22:39 +01:00
Harald Hoyer
d1c4e5c521 fcoe-uefi: try all FcoeBootDevice-* variables for a DevicePath
try to read the DevicePath from all FcoeBootDevice-* UEFI variables
until one has a MAC.
2014-02-19 15:20:34 +01:00
Harald Hoyer
a324c2111e iscsi: for iBFT read the initiator-name from the correct file
/sys/firmware/ibft/initiator-name should be
/sys/firmware/ibft/initiator/initiator-name

https://github.com/haraldh/dracut/issues/12
2014-02-19 11:49:34 +01:00
Harald Hoyer
e8a7c9bc93 dracut-functions.sh:find_kernel_modules_by_path() fixed updates search
"updates/*" path does not start with "/"
2014-02-17 13:29:42 +01:00
Harald Hoyer
cb802bfbc7 iscsiroot: touch the right marker file 2014-02-12 18:26:36 +01:00
Harald Hoyer
a0b2c69441 kernel-modules: add sdhci_acpi to the static list of kernel modules
Thanks Adam Williamson!

https://bugzilla.redhat.com/show_bug.cgi?id=1063556
2014-02-12 11:23:38 +01:00
Till Maas
9835859f21 Cryptroot-ask.sh: Remove duplicate code
Remove duplicate code introduced with commit
9b5e2e8574.
2014-02-10 11:02:32 +01:00
Till Maas
9b5e2e8574 Cryptroot-ask.sh: Use variables consistently
- Always use $luksname instead of sometimes $2
- define $asked_file instead of using the same path twice
2014-02-09 14:12:44 +01:00
Colin Guthrie
8da51857f0 dracut.sh: Fix variable name typo.
This caused the root_dev variable not to be set which in turn meant that
the root device was not whitelisted in 99base/module-setup.sh when injecting
compile-time devexists hooks in hostonly initrds. This ties the generated
initrd to the root fs device (typically the UUID) rather than relying solely
only the root= kernel command line.

While it is hostonly, not hardcoding e.g. UUIDs is still desirable. Any
swap partition on the host device is still added however.
2014-02-07 18:05:48 +01:00
Brian C. Lane
460cddffa1 new_dhcp_next_server is really new_next_server
The variable that dhclient sets doesn't have dhcp in the name. This
could cause problems with setups where the server is not the same as the
dhcp server.
2014-02-07 18:05:48 +01:00
Harald Hoyer
fac3275a43 network:fix dns parsing in ip= parameter 2014-02-07 15:41:50 +01:00
Harald Hoyer
30e6e809ed Factor out all the "type -V" commands
Add new functions require_binaries() and require_any_binary() to be used
in the check() section of module-setup.sh.

These functions print a warning line telling the user, which binary is
missing for the specific dracut module.

This unifies the way of checking for binaries and makes the life of an
initramfs creator easier, if he wants to find out why a specific dracut
module is not included in the initramfs.
2014-02-06 16:45:20 +01:00
Harald Hoyer
8d21728942 systemd: add sys-kernel-config.mount 2014-02-05 13:58:33 +01:00
Harald Hoyer
352d557d4d Do not reload systemd with wait_for_dev 2014-02-05 13:12:29 +01:00
Harald Hoyer
751c7de98a systemd/dracut-pre-pivot: run for /dev/{nfs,root} and cleanup /dev/nfs
dracut-pre-pivot was not cleaning up /dev/nfs and did not run to clean
up /dev/root.
2014-02-05 13:08:54 +01:00
Harald Hoyer
81aed4f28e nfs/nfsroot: symlink /dev/null to /dev/nfs, as a marker for root=/dev/nfs 2014-02-05 13:06:29 +01:00
Harald Hoyer
c84618d7ac network/ifup: do not run dhclient twice on the same interface 2014-02-04 12:02:34 +01:00
Harald Hoyer
d61a423f7c network/ifup: do not ifup an already setup network interface 2014-02-04 12:02:05 +01:00
Harald Hoyer
f52759131b test: include the same Makefile.testdir 2014-02-04 12:01:11 +01:00
Harald Hoyer
c860837303 base/rdsosreport.sh: add dracut version to rdsosreport 2014-01-31 15:33:41 +01:00
Harald Hoyer
1982098e00 network/ifup.sh: handle $dns1 and $dns2 from "ip=" settings 2014-01-30 17:38:27 +01:00
Harald Hoyer
e95e48c6ee network/net-lib.sh: parse ibft nameserver settings 2014-01-30 17:38:27 +01:00
Harald Hoyer
f57850d7e8 dracut-functions.sh: also search in the updates directory 2014-01-30 17:38:27 +01:00
Harald Hoyer
c8a9a6b4a7 dracut.sh: only set the owner of files to 0:0, if generated as non-root
If the root user generates the initramfs image, preserve the ownership
of the files. This of course cannot be done for non-root users
generating an initramfs image.
2014-01-30 16:18:04 +01:00
Harald Hoyer
66bfe863f5 network: understand ip=.....:<dns1>:<dns2> 2014-01-30 13:50:02 +01:00
Harald Hoyer
d50a99c5ce NEWS: update for version 036 2014-01-29 08:37:43 +01:00
97 changed files with 561 additions and 394 deletions

View File

@@ -13,3 +13,4 @@ Luca Berra <bluca@vodka.it> <bluca@comedia.it>
Dave Young <dyoung@redhat.com> dyoung@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>

21
AUTHORS
View File

@@ -12,25 +12,27 @@ Amerigo Wang <amwang@redhat.com>
Colin Guthrie <colin@mageia.org>
Andrey Borzenkov <arvidjaar@gmail.com>
Peter Jones <pjones@redhat.com>
Andreas Thienemann <andreas@bawue.net>
Hans de Goede <hdegoede@redhat.com>
WANG Chao <chaowang@redhat.com>
Andreas Thienemann <andreas@bawue.net>
Hannes Reinecke <hare@suse.de>
Hans de Goede <hdegoede@redhat.com>
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>
Dan Horák <dhorak@redhat.com>
Baoquan He <bhe@redhat.com>
Leho Kraav <leho@kraav.com>
Brian C. Lane <bcl@redhat.com>
Kamil Rytarowski <n54@gmx.com>
Marc Grimme <grimme@atix.de>
Peter Rajnoha <prajnoha@redhat.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>
Peter Rajnoha <prajnoha@redhat.com>
Radek Vykydal <rvykydal@redhat.com>
Roberto Sassu <roberto.sassu@polito.it>
Anton Blanchard <anton@samba.org>
@@ -42,20 +44,23 @@ Juan RP <xtraeme@gmail.com>
Lance Albertson <lance@osuosl.org>
Marian Ganisin <mganisin@redhat.com>
Michael Ploujnikov <plouj@somanetworks.com>
Stig Telfer <stelfer@cray.com>
Wim Muskee <wimmuskee@gmail.com>
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Alan Pevec <apevec@redhat.com>
Alexander Tsoy <alexander@tsoy.me>
Cristian Rodríguez <crrodriguez@opensuse.org>
Frederick Grose <fgrose@sugarlabs.org>
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>
Mike Snitzer <snitzer@redhat.com>
Przemysław Rudy <prudy1@o2.pl>
Stefan Reimer <it@startux.de>
Thomas Lange <lange@informatik.uni-koeln.de>
Till Maas <opensource@till.name>
Vivek Goyal <vgoyal@redhat.com>
Vladislav Bogdanov <bubble@hoster-ok.com>
Adam Williamson <awilliam@redhat.com>
@@ -73,16 +78,19 @@ Dave Young <dave@redhat.com>
Dennis Schridde <devurandom@gmx.net>
Duane Griffin <duaneg@dghda.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>
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>
Marian Csontos <mcsontos@redhat.com>
Matt <smoothsailing72@hotmail.com>
Matt Smith <shadowfax@gmx.com>
Michal Schmidt <mschmidt@redhat.com>
@@ -91,17 +99,20 @@ Munehiro Matsuda <haro@kgt.co.jp>
Nicolas Chauvet <kwizart@gmail.com>
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>
Pádraig Brady <P@draigBrady.com>
Quentin Armitage <quentin@armitage.org.uk>
Robert Buchholz <rbu@goodpoint.de>
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>
Tomasz Torcz <tomek@pipebreaker.pl>
Vadim Kuznetsov <vadimk@gentoo.org>
Ville Skyttä <ville.skytta@iki.fi>
Vratislav Podzimek <vpodzime@redhat.com>
Yanko Kaneti <yaneti@declera.com>
maximilian attems <max@stro.at>

43
NEWS
View File

@@ -1,3 +1,46 @@
dracut-037
==========
- dracut: hostonly_cmdline variable and command line switch
Toggle hostonly cmdline storing in the initramfs
--hostonly-cmdline:
Store kernel command line arguments needed in the initramfs
--no-hostonly-cmdline:
Do not store kernel command line arguments needed in the initramfs
- dracut: --mount now understands full fstab lines
- dracut now also includes drivers from the /lib/modules/<version>/updates directory
- dracut: only set the owner of files to 0:0, if generated as non-root
- dracut now directly writes to the initramfs file
- dracut: call lz4 with the legacy flag (linux kernel does not support the new format)
- systemd: rootfs-generator generates JobTimeout=0 units for the root device
- systemd: added the systemd-sysctl service
- systemd: add 80-net-setup-link.rules and .link files for persistent interface renaming
- systemd: make dracut-shutdown.service failure non-fatal
- network: various IPv6 fixes
- network: DCHCP for IPv6
- network: understand ip=.....:<dns1>:<dns2>
- network: parse ibft nameserver settings
- shutdown: if kexec fails, just reboot
- lvm: handle one LV at a time with lvchange
- module-setup.sh:
New functions require_binaries() and require_any_binary() to be used
in the check() section of module-setup.sh.
- a lot of small bugfixes
Contributions from:
Harald Hoyer
Alexander Tsoy
Till Maas
Amadeusz Żołnowski
Brian C. Lane
Colin Guthrie
Dave Young
WANG Chao
Shawn W Dunn
dracut-036
==========
- fixed skipcpio signature checking
dracut-035
==========
- changed dracut tarball compression to xz

View File

@@ -35,6 +35,51 @@ fi
# Generic substring function. If $2 is in $1, return 0.
strstr() { [[ $1 = *$2* ]]; }
# helper function for check() in module-setup.sh
# to check for required installed binaries
# issues a standardized warning message
require_binaries() {
local _module_name="${moddir##*/}"
local _ret=0
if [[ "$1" = "-m" ]]; then
_module_name="$2"
shift 2
fi
for cmd in "$@"; do
if ! find_binary "$cmd" &>/dev/null; then
dinfo "$_module_name: Could not find command '$cmd'!"
((_ret++))
fi
done
return $_ret
}
require_any_binary() {
local _module_name="${moddir##*/}"
local _ret=1
if [[ "$1" = "-m" ]]; then
_module_name="$2"
shift 2
fi
for cmd in "$@"; do
if find_binary "$cmd" &>/dev/null; then
_ret=0
break
fi
done
if (( $_ret != 0 )); then
dinfo "$_module_name: Could not find any command of '$@'!"
return 1
fi
return 0
}
# find a binary. If we were not passed the full path directly,
# search in the usual places to find the binary.
find_binary() {
@@ -1084,7 +1129,7 @@ module_check() {
. $_moddir/module-setup.sh
is_func check || return 0
[ $_forced -ne 0 ] && unset hostonly
check $hostonly
moddir=$_moddir check $hostonly
_ret=$?
unset check depends cmdline install installkernel
fi
@@ -1110,7 +1155,7 @@ module_check_mount() {
unset check depends cmdline install installkernel
check() { false; }
. $_moddir/module-setup.sh
check 0
moddir=$_moddir check 0
_ret=$?
unset check depends cmdline install installkernel
fi
@@ -1134,7 +1179,7 @@ module_depends() {
unset check depends cmdline install installkernel
depends() { true; }
. $_moddir/module-setup.sh
depends
moddir=$_moddir depends
_ret=$?
unset check depends cmdline install installkernel
return $_ret
@@ -1155,7 +1200,7 @@ module_cmdline() {
unset check depends cmdline install installkernel
cmdline() { true; }
. $_moddir/module-setup.sh
cmdline
moddir=$_moddir cmdline
_ret=$?
unset check depends cmdline install installkernel
return $_ret
@@ -1176,7 +1221,7 @@ module_install() {
unset check depends cmdline install installkernel
install() { true; }
. $_moddir/module-setup.sh
install
moddir=$_moddir install
_ret=$?
unset check depends cmdline install installkernel
return $_ret
@@ -1197,7 +1242,7 @@ module_installkernel() {
unset check depends cmdline install installkernel
installkernel() { true; }
. $_moddir/module-setup.sh
installkernel
moddir=$_moddir installkernel
_ret=$?
unset check depends cmdline install installkernel
return $_ret
@@ -1551,7 +1596,7 @@ find_kernel_modules_by_path () {
_OLDIFS=$IFS
IFS=:
while read a rest; do
[[ $a = */$1/* ]] || continue
[[ $a = */$1/* ]] || [[ $a = updates/* ]] || continue
printf "%s\n" "$srcmods/$a"
done < "$srcmods/modules.dep"
IFS=$_OLDIFS

View File

@@ -300,6 +300,12 @@ provide a valid _/etc/fstab_.
**-N, --no-hostonly**::
Disable Host-Only mode
**--hostonly-cmdline**:
Store kernel command line arguments needed in the initramfs
**--no-hostonly-cmdline**:
Do not store kernel command line arguments needed in the initramfs
**--persistent-policy** _<policy>_::
Use _<policy>_ to address disks and partitions.
_<policy>_ can be any directory name found in /dev/disk.
@@ -311,9 +317,13 @@ provide a valid _/etc/fstab_.
**--add-fstab** _<filename>_::
Add entries of _<filename>_ to the initramfs /etc/fstab.
**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_"::
Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem
options>_ in the initramfs
**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ [_<filesystem options>_ [_<dump frequency>_ [_<fsck order>_]]]"::
Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ in the
initramfs. _<filesystem options>_, _<dump options>_ and _<fsck order>_ can
be specified, see fstab manpage for the details.
The default _<filesystem options>_ is "defaults".
The default _<dump frequency>_ is "0".
the default _<fsck order>_ is "2".
**--add-device** _<device>_ ::
Bring up _<device>_ in initramfs, _<device>_ should be the device name.

View File

@@ -472,6 +472,13 @@ cannot be used in conjunction with the **ifname** argument for the
same <interface>.
=====================
**ip=**__<client-IP>__:[__<peer>__]:__<gateway-IP>__:__<netmask>__:__<client_hostname>__:__<interface>__:__{none|off|dhcp|on|any|dhcp6|auto6|ibft}__[:[__<dns1>__][:__<dns2>__]]::
explicit network configuration. If you want do define a IPv6 address, put it
in brackets (e.g. [2001:DB8::1]). This parameter can be specified multiple
times. __<peer>__ is optional and is the address of the remote endpoint
for pointopoint interfaces and it may be followed by a slash and a decimal
number, encoding the network prefix length.
**ifname=**__<interface>__:__<MAC>__::
Assign network device name <interface> (ie "bootnet") to the NIC with
MAC <MAC>.

View File

@@ -76,6 +76,9 @@ Configuration files must have the extension .conf; other extensions are ignored.
Host-Only mode: Install only what is needed for booting the local host
instead of a generic host and generate host-specific configuration.
*hostonly_cmdline*"__{yes|no}__"::
If set, store the kernel command line arguments needed in the initramfs
*persistent_policy=*"__<policy>__"::
Use _<policy>_ to address disks and partitions.
_<policy>_ can be any directory name found in /dev/disk.

View File

@@ -13,3 +13,4 @@ systemdsystemunitdir=/usr/lib/systemd/system
systemdsystemconfdir=/etc/systemd/system
udevdir=/usr/lib/udev
hostonly="yes"
hostonly_cmdline="no"

View File

@@ -137,6 +137,10 @@ Creates initial ramdisk images for preloading modules
-H, --hostonly Host-Only mode: Install only what is needed for
booting the local host instead of a generic host.
-N, --no-hostonly Disables Host-Only mode
--hostonly-cmdline Store kernel command line arguments needed
in the initramfs
--no-hostonly-cmdline Do not store kernel command line arguments needed
in the initramfs
--persistent-policy [POLICY]
Use [POLICY] to address disks and partitions.
POLICY can be any directory name found in /dev/disk.
@@ -345,6 +349,8 @@ rearrange_params()
--long host-only \
--long no-hostonly \
--long no-host-only \
--long hostonly-cmdline \
--long no-hostonly-cmdline \
--long persistent-policy: \
--long fstab \
--long help \
@@ -488,9 +494,12 @@ while :; do
-f|--force) force=yes;;
--kernel-only) kernel_only="yes"; no_kernel="no";;
--no-kernel) kernel_only="no"; no_kernel="yes";;
--print-cmdline) print_cmdline="yes"; hostonly_l="yes"; kernel_only="yes"; no_kernel="yes";;
--early-microcode) early_microcode_l="yes";;
--no-early-microcode) early_microcode_l="no";;
--print-cmdline)
print_cmdline="yes"; hostonly_l="yes"; kernel_only="yes"; no_kernel="yes";;
--early-microcode)
early_microcode_l="yes";;
--no-early-microcode)
early_microcode_l="no";;
--strip) do_strip_l="yes";;
--nostrip) do_strip_l="no";;
--prelink) do_prelink_l="yes";;
@@ -517,6 +526,10 @@ while :; do
hostonly_l="yes" ;;
-N|--no-hostonly|--no-host-only)
hostonly_l="no" ;;
--hostonly-cmdline)
hostonly_cmdline_l="yes" ;;
--no-hostonly-cmdline)
hostonly_cmdline_l="no" ;;
--persistent-policy)
persistent_policy_l="$2"; PARMS_TO_STORE+=" '$2'"; shift;;
--fstab) use_fstab_l="yes" ;;
@@ -551,7 +564,7 @@ done
# the old fashioned way
while (($# > 0)); do
if [ ${1%%=*} == "++include" ]; then
if [ "${1%%=*}" == "++include" ]; then
push include_src "$2"
push include_target "$3"
PARMS_TO_STORE+=" --include '$2' '$3'"
@@ -755,6 +768,7 @@ stdloglvl=$((stdloglvl + verbosity_mod_l))
[[ $prefix_l ]] && prefix=$prefix_l
[[ $prefix = "/" ]] && unset prefix
[[ $hostonly_l ]] && hostonly=$hostonly_l
[[ $hostonly_cmdline_l ]] && hostonly_cmdline=$hostonly_cmdline_l
[[ $persistent_policy_l ]] && persistent_policy=$persistent_policy_l
[[ $use_fstab_l ]] && use_fstab=$use_fstab_l
[[ $mdadmconf_l ]] && mdadmconf=$mdadmconf_l
@@ -782,7 +796,7 @@ case $compress in
xz) compress="xz --check=crc32 --lzma2=dict=1MiB -T0";;
gzip) compress="gzip -9"; command -v pigz > /dev/null 2>&1 && compress="pigz -9";;
lzo) compress="lzop -9";;
lz4) compress="lz4 -9";;
lz4) compress="lz4 -l -9";;
esac
if [[ $_no_compress_l = "cat" ]]; then
compress="cat"
@@ -808,7 +822,6 @@ fi
# clean up after ourselves no matter how we die.
trap '
ret=$?;
[[ $outfile ]] && [[ -f $outfile.$$ ]] && rm -f -- "$outfile.$$";
[[ $keep ]] && echo "Not removing $initdir." >&2 || { [[ $initdir ]] && rm -rf -- "$initdir"; };
[[ $keep ]] && echo "Not removing $early_cpio_dir." >&2 || { [[ $early_cpio_dir ]] && rm -Rf -- "$early_cpio_dir"; };
[[ $_dlogdir ]] && rm -Rf -- "$_dlogdir";
@@ -1005,7 +1018,7 @@ if [[ $hostonly ]]; then
_bdev=$(readlink -f "/dev/block/$_dev")
[[ -b $_bdev ]] && _dev=$_bdev
push host_devs $_dev
[[ "$_mp" == "/" ]] && root_dev="$_dev"
[[ "$mp" == "/" ]] && root_dev="$_dev"
push host_devs "$_dev"
done
@@ -1139,7 +1152,7 @@ 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
host_modalias host_modules hostonly_cmdline
mods_to_load=""
# check all our modules to see if they should be sourced.
@@ -1299,7 +1312,11 @@ if [[ $kernel_only != yes ]]; then
[[ $kernel_cmdline ]] && printf "%s\n" "$kernel_cmdline" >> "${initdir}/etc/cmdline.d/01-default.conf"
while pop fstab_lines line; do
printf "%s\n" "$line 0 0" >> "${initdir}/etc/fstab"
line=($line)
[ -z "${line[3]}" ] && line[3]="defaults"
[ -z "${line[4]}" ] && line[4]="0"
[ -z "${line[5]}" ] && line[5]="2"
echo "${line[@]}" >> "${initdir}/etc/fstab"
done
for f in $add_fstab; do
@@ -1462,18 +1479,19 @@ fi
rm -f -- "$outfile"
dinfo "*** Creating image file ***"
[[ "$UID" != 0 ]] && cpio_owner_root="-R 0:0"
if [[ $create_early_cpio = yes ]]; then
echo 1 > "$early_cpio_dir/d/early_cpio"
# The microcode blob is _before_ the initramfs blob, not after
(cd "$early_cpio_dir/d"; find . -print0 | cpio --null -R 0:0 -H newc -o --quiet >../early.cpio)
mv $early_cpio_dir/early.cpio $outfile.$$
(cd "$early_cpio_dir/d"; find . -print0 | cpio --null $cpio_owner_root -H newc -o --quiet > $outfile)
fi
if ! ( umask 077; cd "$initdir"; find . -print0 | cpio --null -R 0:0 -H newc -o --quiet | \
$compress >> "$outfile.$$"; ); then
dfatal "dracut: creation of $outfile.$$ failed"
if ! ( umask 077; cd "$initdir"; find . -print0 | cpio --null $cpio_owner_root -H newc -o --quiet | \
$compress >> "$outfile"; ); then
dfatal "dracut: creation of $outfile failed"
exit 1
fi
mv -- "$outfile.$$" "$outfile"
dinfo "*** Creating image file done ***"
if (( maxloglvl >= 5 )); then

View File

@@ -99,9 +99,9 @@ raid with encryption and LVM on top), as long as you specify the correct
filesystem LABEL or UUID on the kernel command line for your root device, dracut
will find it and boot from it.
The kernel command line usually can be configured in _/boot/grub/grub.conf_, if
grub is your bootloader and it also can be edited in the real boot process in
the grub menu.
The kernel command line usually can be configured in _/boot/grub/grub.conf_ or
_/boot/grub2/grub.cfg_, if grub is your bootloader and it also can be edited in
the real boot process in the grub menu.
The kernel command line can also be provided by the dhcp server with the
root-path option. See <<NetworkBoot>>.

View File

@@ -172,7 +172,7 @@ case $bin in
$'\x71\xc7'*|070701)
CAT="cat --"
;;
$'\x04\x22'*)
$'\x02\x21'*)
CAT="lz4 -d -c";;
*)
CAT="xzcat --";

View File

@@ -4,7 +4,7 @@
# called by dracut
check() {
[ -x /bin/bash ]
require_binaries /bin/bash
}
# called by dracut

View File

@@ -5,7 +5,7 @@
# called by dracut
check() {
[[ "$mount_needs" ]] && return 1
[ -x /sbin/bootchartd ] || return 1
require_binaries /sbin/bootchartd || return 1
return 255
}

View File

@@ -4,7 +4,7 @@
# called by dracut
check() {
[ -x /bin/dash ]
require_binaries /bin/dash
}
# called by dracut

View File

@@ -5,7 +5,7 @@
# called by dracut
check() {
[[ "$mount_needs" ]] && return 1
[ -x $systemdutildir/systemd-bootchart ] || return 1
require_binaries $systemdutildir/systemd-bootchart || return 1
return 255
}

View File

@@ -4,7 +4,7 @@
# called by dracut
check() {
type -P capsh >/dev/null 2>&1
require_binaries capsh
}
# called by dracut
@@ -14,9 +14,13 @@ depends() {
# called by dracut
install() {
inst_hook pre-pivot 00 "$moddir/caps.sh"
inst $(type -P capsh 2>/dev/null) /usr/sbin/capsh
# capsh wants bash and we need bash also
inst /bin/bash
if ! dracut_module_included "systemd"; then
inst_hook pre-pivot 00 "$moddir/caps.sh"
inst $(type -P capsh 2>/dev/null) /usr/sbin/capsh
# capsh wants bash and we need bash also
inst /bin/bash
else
dwarning "caps: does not work with systemd in the initramfs"
fi
}

View File

@@ -9,7 +9,7 @@
# called by dracut
check() {
[[ -x /usr/bin/keyctl ]] || return 1
require_binaries keyctl || return 1
# do not include module in hostonly mode,
# if no keys are present

View File

@@ -4,7 +4,7 @@
# called by dracut
check() {
type -P busybox >/dev/null || return 1
require_binaries busybox || return 1
return 255
}

View File

@@ -6,9 +6,7 @@
check() {
[[ "$mount_needs" ]] && return 1
for i in setfont loadkeys kbd_mode; do
type -P "$i" >/dev/null || return 1
done
require_binaries setfont loadkeys kbd_mode || return 1
return 0
}

View File

@@ -2,6 +2,17 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
PATH=/usr/sbin:/usr/bin:/sbin:/bin
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
# We already need a set netif here
netif=$interface
# Huh? Interface configured?
[ -f "/tmp/net.$netif.up" ] && exit 0
setup_interface() {
ip=$new_ip_address
mtu=$new_interface_mtu
@@ -48,24 +59,42 @@ setup_interface() {
[ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
}
PATH=/usr/sbin:/usr/bin:/sbin:/bin
setup_interface6() {
domain=$new_domain_name
search=$(printf -- "$new_domain_search")
namesrv=$new_domain_name_servers
hostname=$new_host_name
lease_time=$new_dhcp_lease_time
export PS4="dhclient.$interface.$$ + "
[ -e /run/initramfs/loginit.pipe ] && exec >>/run/initramfs/loginit.pipe 2>>/run/initramfs/loginit.pipe
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
[ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override
# We already need a set netif here
netif=$interface
ip -6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \
dev ${netif} scope global valid_lft ${lease_time} \
preferred_lft ${lease_time}
# Huh? Interface configured?
[ -f "/tmp/net.$netif.up" ] && exit 0
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
if [ -n "$namesrv" ] ; then
for s in $namesrv; do
echo nameserver $s
done
fi >> /tmp/net.$netif.resolv.conf
# Note: hostname can be fqdn OR short hostname, so chop off any
# trailing domain name and explicity add any domain if set.
[ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
}
case $reason in
PREINIT)
echo "dhcp: PREINIT $netif up"
linkup $netif
;;
PREINIT6)
echo "dhcp: PREINIT $netif up"
linkup $netif
;;
BOUND)
echo "dhcp: BOND setting $netif"
unset layer2
@@ -90,12 +119,31 @@ case $reason in
echo "setup_net $netif"
echo "source_hook initqueue/online $netif"
[ -e /tmp/net.$netif.manualup ] || echo "/sbin/netroot $netif"
echo "> /tmp/setup_net_$netif.ok"
echo "> /tmp/setup_net_\$(cat /sys/class/net/$netif/address).ok"
echo "rm -f -- $hookdir/initqueue/setup_net_$netif.sh"
} > $hookdir/initqueue/setup_net_$netif.sh
echo "[ -f /tmp/setup_net_$netif.ok ]" > $hookdir/initqueue/finished/dhclient-$netif.sh
echo "[ -f /tmp/net.$netif.did-setup ]" > $hookdir/initqueue/finished/dhclient-$netif.sh
>/tmp/net.$netif.up
;;
BOUND6)
echo "dhcp: BOND6 setting $netif"
setup_interface6
set | while read line; do
[ "${line#new_}" = "$line" ] && continue
echo "$line"
done >/tmp/dhclient.$netif.dhcpopts
{
echo '. /lib/net-lib.sh'
echo "setup_net $netif"
echo "source_hook initqueue/online $netif"
[ -e /tmp/net.$netif.manualup ] || echo "/sbin/netroot $netif"
echo "rm -f -- $hookdir/initqueue/setup_net_$netif.sh"
} > $hookdir/initqueue/setup_net_$netif.sh
echo "[ -f /tmp/net.$netif.did-setup ]" > $hookdir/initqueue/finished/dhclient-$netif.sh
>/tmp/net.$netif.up
;;
*) echo "dhcp: $reason";;

View File

@@ -80,13 +80,22 @@ fi
# in netroot case we prefer netroot to bringup $netif automaticlly
[ -n "$2" -a "$2" = "-m" ] && [ -z "$netroot" ] && manualup="$2"
[ -z "$netroot" ] && [ -z "$manualup" ] && exit 0
[ -n "$manualup" ] && >/tmp/net.$netif.manualup
if [ -n "$manualup" ]; then
>/tmp/net.$netif.manualup
else
[ -e /tmp/net.${netif}.did-setup ] && exit 0
[ -e /sys/class/net/$netif/address ] && \
[ -e /tmp/net.$(cat /sys/class/net/$netif/address).did-setup ] && exit 0
fi
# Run dhclient
do_dhcp() {
# dhclient-script will mark the netif up and generate the online
# event for nfsroot
# XXX add -V vendor class and option parsing per kernel
[ -e /tmp/dhclient.$netif.pid ] && return 0
if ! iface_has_link $netif; then
echo "No carrier detected"
return 1
@@ -129,6 +138,7 @@ do_static() {
if strstr $ip '*:*:*'; then
# note no ip addr flush for ipv6
ip addr add $ip/$mask ${srv:+peer $srv} dev $netif
wait_for_ipv6_dad $netif
else
ip addr flush dev $netif
ip addr add $ip/$mask ${srv:+peer $srv} brd + dev $netif
@@ -137,7 +147,6 @@ do_static() {
[ -n "$gw" ] && echo ip route add default via $gw dev $netif > /tmp/net.$netif.gw
[ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname
> /tmp/setup_net_${netif}.ok
return 0
}
@@ -264,18 +273,15 @@ if [ "$netif" = "$vlanname" ] && [ ! -e /tmp/net.$vlanname.up ]; then
ip link set "$vlanname" up
fi
# setup nameserver
namesrv=$(getargs nameserver)
if [ -n "$namesrv" ] ; then
for s in $namesrv; do
echo nameserver $s
done
fi >> /tmp/net.$netif.resolv.conf
# No ip lines default to dhcp
ip=$(getarg ip)
if [ -z "$ip" ]; then
namesrv=$(getargs nameserver)
for s in $namesrv; do
echo nameserver $s >> /tmp/net.$netif.resolv.conf
done
if [ "$netroot" = "dhcp6" ]; then
do_dhcp -6
else
@@ -307,8 +313,14 @@ for p in $(getargs ip=); do
[ "$use_bridge" != 'true' ] && \
[ "$use_vlan" != 'true' ] && continue
# setup nameserver
namesrv="$dns1 $dns2 $(getargs nameserver)"
for s in $namesrv; do
echo nameserver $s >> /tmp/net.$netif.resolv.conf
done
# Store config for later use
for i in ip srv gw mask hostname macaddr; do
for i in ip srv gw mask hostname macaddr dns1 dns2; do
eval '[ "$'$i'" ] && echo '$i'="$'$i'"'
done > /tmp/net.$netif.override
@@ -316,6 +328,7 @@ for p in $(getargs ip=); do
dhcp|on|any)
do_dhcp -4 ;;
dhcp6)
load_ipv6
do_dhcp -6 ;;
auto6)
do_ipv6auto ;;
@@ -323,6 +336,8 @@ for p in $(getargs ip=); do
do_static ;;
esac
> /tmp/net.${netif}.up
case $autoconf in
dhcp|on|any|dhcp6)
;;
@@ -348,7 +363,7 @@ if [ -n "$DO_BOND_SETUP" -o -n "$DO_TEAM_SETUP" -o -n "$DO_VLAN_SETUP" ]; then
fi
# no ip option directed at our interface?
if [ ! -e /tmp/setup_net_${netif}.ok ]; then
if [ ! -e /tmp/net.${netif}.up ]; then
do_dhcp -4
fi

View File

@@ -6,12 +6,7 @@
check() {
local _program
for _program in ip arping dhclient ; do
if ! type -P $_program >/dev/null; then
derror "Could not find program \"$_program\" required by network."
return 1
fi
done
require_binaries ip arping dhclient || return 1
return 255
}

View File

@@ -89,7 +89,7 @@ command -v fix_bootif >/dev/null || . /lib/net-lib.sh
for iface in $wait_ifaces; do
if [ "$bootdev" = "$iface" ] || [ "$NEEDNET" = "1" ]; then
echo "[ -f /tmp/setup_net_${iface}.ok ]" >$hookdir/initqueue/finished/wait-$iface.sh
echo "[ -f /tmp/net.${iface}.did-setup ]" >$hookdir/initqueue/finished/wait-$iface.sh
fi
done
# Default: We don't know the interface to use, handle all

View File

@@ -82,12 +82,16 @@ ifdown() {
ip addr flush dev $netif
echo "#empty" > /etc/resolv.conf
rm -f -- /tmp/net.$netif.did-setup
[ -e /sys/class/net/$netif/address ] && \
rm -f -- /tmp/net.$(cat /sys/class/net/$netif/address).did-setup
# TODO: send "offline" uevent?
}
setup_net() {
local netif="$1" f="" gw_ip="" netroot_ip="" iface="" IFACES=""
[ -e /tmp/net.$netif.did-setup ] && return
[ -e /sys/class/net/$netif/address ] && \
[ -e /tmp/net.$(cat /sys/class/net/$netif/address).did-setup ] && return
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
[ -z "$IFACES" ] && IFACES="$netif"
# run the scripts written by ifup
@@ -123,12 +127,14 @@ setup_net() {
read layer2 < /sys/class/net/$netif/device/layer2
fi
if [ "$layer2" != "0" ] && [ -n "$dest" ] && ! arping -q -f -w 60 -I $netif $dest ; then
info "Resolving $dest via ARP on $netif failed"
if [ "$layer2" != "0" ] && [ -n "$dest" ] && ! strstr "$dest" ":"; then
arping -q -f -w 60 -I $netif $dest || info "Resolving $dest via ARP on $netif failed"
fi
unset layer2
> /tmp/net.$netif.did-setup
[ -e /sys/class/net/$netif/address ] && \
> /tmp/net.$(cat /sys/class/net/$netif/address).did-setup
}
save_netinfo() {
@@ -185,6 +191,7 @@ ibft_to_cmdline() {
for iface in /sys/firmware/ibft/ethernet*; do
local mac="" dev=""
local dhcp="" ip="" gw="" mask="" hostname=""
local dns1 dns2
[ -e ${iface}/mac ] || continue
mac=$(read a < ${iface}/mac; echo $a)
@@ -203,9 +210,11 @@ ibft_to_cmdline() {
[ "$ip" = "0.0.0.0" ] && continue
[ -e ${iface}/gateway ] && gw=$(read a < ${iface}/gateway; echo $a)
[ -e ${iface}/subnet-mask ] && mask=$(read a < ${iface}/subnet-mask; echo $a)
[ -e ${iface}/primary-dns ] && dns1=$(read a < ${iface}/primary-dns; echo $a)
[ -e ${iface}/secondary-dns ] && dns2=$(read a < ${iface}/secondary-dns; echo $a)
[ -e ${iface}/hostname ] && hostname=$(read a < ${iface}/hostname; echo $a)
if [ -n "$ip" ] && [ -n "$mask" ]; then
echo "ip=$ip::$gw:$mask:$hostname:$dev:none"
echo "ip=$ip::$gw:$mask:$hostname:$dev:none${dns1:+:$dns1}${dns2:+:$dns2}"
else
warn "${iface} does not contain a valid iBFT configuration"
warn "ip-addr=$ip"
@@ -339,7 +348,7 @@ ip_to_var() {
fi
done
unset ip srv gw mask hostname dev autoconf macaddr mtu
unset ip srv gw mask hostname dev autoconf macaddr mtu dns1 dns2
case $# in
0) autoconf="error" ;;
1) autoconf=$1 ;;
@@ -347,11 +356,22 @@ ip_to_var() {
3) [ -n "$1" ] && dev=$1; [ -n "$2" ] && autoconf=$2; [ -n "$3" ] && mtu=$3 ;;
4) [ -n "$1" ] && dev=$1; [ -n "$2" ] && autoconf=$2; [ -n "$3" ] && mtu=$3; [ -n "$4" ] && macaddr=$4 ;;
*) [ -n "$1" ] && ip=$1; [ -n "$2" ] && srv=$2; [ -n "$3" ] && gw=$3; [ -n "$4" ] && mask=$4;
[ -n "$5" ] && hostname=$5; [ -n "$6" ] && dev=$6; [ -n "$7" ] && autoconf=$7; [ -n "$8" ] && mtu=$8;
if [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then
macaddr="${9}:${10}:${11}:${12}:${13}:${14}"
fi
;;
[ -n "$5" ] && hostname=$5; [ -n "$6" ] && dev=$6; [ -n "$7" ] && autoconf=$7;
case "$8" in
[0-9]*:*|[0-9]*.[0-9]*.[0-9]*.[0-9]*)
dns1="$8"
[ -n "$9" ] && dns2="$9"
;;
[0-9]*)
mtu="$8"
;;
*)
if [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then
macaddr="${9}:${10}:${11}:${12}:${13}:${14}"
fi
;;
esac
;;
esac
# ip=<ipv4-address> means anaconda-style static config argument cluster:
@@ -437,12 +457,26 @@ wait_for_route_ok() {
return 1
}
wait_for_ipv6_dad() {
local cnt=0
local li
while [ $cnt -lt 500 ]; do
li=$(ip -6 addr show dev $1)
strstr "$li" "tentative" || return 0
sleep 0.1
cnt=$(($cnt+1))
done
return 1
}
wait_for_ipv6_auto() {
local cnt=0
local li
while [ $cnt -lt 400 ]; do
li=$(ip -6 addr show dev $1)
strstr "$li" "dynamic" && return 0
if ! strstr "$li" "tentative"; then
strstr "$li" "dynamic" && return 0
fi
sleep 0.1
cnt=$(($cnt+1))
done

View File

@@ -55,9 +55,9 @@ print_s390() {
SUBCHANNELS=${SUBCHANNELS%,}
echo "SUBCHANNELS=\"${SUBCHANNELS}\""
CONFIG_LINE=$(get_config_line_by_subchannel $SUBCHANNELS)
[ $? -ne 0 -o -z "$CONFIG_LINE" ] && return
CONFIG_LINE=$(get_config_line_by_subchannel $SUBCHANNELS)
[ $? -ne 0 -o -z "$CONFIG_LINE" ] && return 0
OLD_IFS=$IFS
IFS=","
@@ -77,6 +77,7 @@ print_s390() {
OPTIONS=${OPTIONS## }
echo "NETTYPE=\"${NETTYPE}\""
echo "OPTIONS=\"${OPTIONS}\""
return 0
}
for netup in /tmp/net.*.did-setup ; do
@@ -84,6 +85,7 @@ for netup in /tmp/net.*.did-setup ; do
netif=${netup%%.did-setup}
netif=${netif##*/net.}
strstr "$netif" ":*:*:*:*:" && continue
[ -e /tmp/ifcfg/ifcfg-$netif ] && continue
unset bridge
unset bond
@@ -110,7 +112,8 @@ for netup in /tmp/net.*.did-setup ; do
if [ "$netif" = "$vlanname" ]; then
vlan=yes
fi
cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr
[ -e /sys/class/net/$netif/address ] && \
cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr
{
echo "# Generated by dracut initrd"
echo "DEVICE=\"$netif\""
@@ -159,12 +162,10 @@ for netup in /tmp/net.*.did-setup ; do
if [ -z "$bridge" ] && [ -z "$bond" ] && [ -z "$vlan" ]; then
# standard interface
{
if [ -n "$macaddr" ]; then
echo "MACADDR=\"$macaddr\""
else
echo "HWADDR=\"$(cat /sys/class/net/$netif/address)\""
[ -n "$macaddr" ] && echo "MACADDR=\"$macaddr\""
if ! print_s390 $netif; then
[ -n "$macaddr" ] || echo "HWADDR=\"$(cat /sys/class/net/$netif/address)\""
fi
print_s390 $netif
echo "TYPE=Ethernet"
echo "NAME=\"$netif\""
[ -n "$mtu" ] && echo "MTU=\"$mtu\""

View File

@@ -3,7 +3,7 @@
# called by dracut
check() {
command -v curl >/dev/null || return 1
require_binaries curl || return 1
return 255
}

View File

@@ -5,7 +5,7 @@
# called by dracut
check() {
[[ "$mount_needs" ]] && return 1
type -P plymouthd >/dev/null && type -P plymouth >/dev/null
require_binaries plymouthd plymouth
}
# called by dracut

View File

@@ -7,7 +7,7 @@ check() {
local _rootdev
# if we don't have btrfs installed on the host system,
# no point in trying to support it in the initramfs.
type -P btrfs >/dev/null || return 1
require_binaries btrfs || return 1
[[ $hostonly ]] || [[ $mount_needs ]] && {
for fs in ${host_fs_types[@]}; do

View File

@@ -33,7 +33,7 @@ if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -d -n rd_NO_CRYPTTAB; t
# UUID used in crypttab
if [ "${dev%%=*}" = "UUID" ]; then
if [ "luks-${dev##UUID=}" = "$2" ]; then
if [ "luks-${dev##UUID=}" = "$luksname" ]; then
luksname="$name"
break
fi
@@ -55,7 +55,8 @@ fi
[ -b /dev/mapper/$luksname ] && exit 0
# we already asked for this device
[ -f /tmp/cryptroot-asked-$luksname ] && exit 0
asked_file=/tmp/cryptroot-asked-$luksname
[ -f $asked_file ] && exit 0
# load dm_crypt if it is not already loaded
[ -d /sys/module/dm_crypt ] || modprobe dm_crypt
@@ -159,7 +160,7 @@ fi
unset device luksname luksfile
# mark device as asked
>> /tmp/cryptroot-asked-$luksname
>> $asked_file
need_shutdown
udevsettle

View File

@@ -6,7 +6,7 @@
check() {
local _rootdev
# if cryptsetup is not installed, then we cannot support encrypted devices.
type -P cryptsetup >/dev/null || return 1
require_binaries cryptsetup || return 1
[[ $hostonly ]] || [[ $mount_needs ]] && {
for fs in "${host_fs_types[@]}"; do
@@ -51,8 +51,10 @@ cmdline() {
# called by dracut
install() {
cmdline >> "${initdir}/etc/cmdline.d/90crypt.conf"
echo >> "${initdir}/etc/cmdline.d/90crypt.conf"
if [[ $hostonly_cmdline == "yes" ]]; then
cmdline >> "${initdir}/etc/cmdline.d/90crypt.conf"
echo >> "${initdir}/etc/cmdline.d/90crypt.conf"
fi
inst_multiple cryptsetup rmdir readlink umount
inst_script "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask

View File

@@ -4,7 +4,7 @@
# called by dracut
check() {
type -P dmsetup >/dev/null || return 1
require_binaries dmsetup || return 1
return 255
}

View File

@@ -7,7 +7,7 @@ check() {
local _rootdev
# if we don't have dmraid installed on the host system, no point
# in trying to support it in the initramfs.
type -P dmraid >/dev/null || return 1
require_binaries dmraid || return 1
[[ $hostonly ]] || [[ $mount_needs ]] && {
for dev in "${!host_fs_types[@]}"; do
@@ -65,8 +65,10 @@ cmdline() {
install() {
local _i
cmdline >> "${initdir}/etc/cmdline.d/90dmraid.conf"
echo >> "${initdir}/etc/cmdline.d/90dmraid.conf"
if [[ $hostonly_cmdline == "yes" ]]; then
cmdline >> "${initdir}/etc/cmdline.d/90dmraid.conf"
echo >> "${initdir}/etc/cmdline.d/90dmraid.conf"
fi
inst_multiple dmraid
inst_multiple -o kpartx

View File

@@ -9,7 +9,7 @@ case "$root" in
printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
${root#live:/dev/}
} >> /etc/udev/rules.d/99-live-squash.rules
wait_for_dev "${root#live:}"
wait_for_dev -n "${root#live:}"
;;
live:*)
if [ -f "${root#live:}" ]; then

View File

@@ -56,4 +56,4 @@ info "root was $liveroot, is now $root"
# make sure that init doesn't complain
[ -z "$root" ] && root="live"
wait_for_dev /dev/mapper/live-rw
wait_for_dev -n /dev/mapper/live-rw

View File

@@ -46,7 +46,8 @@ installkernel() {
instmods yenta_socket scsi_dh_rdac scsi_dh_emc \
atkbd i8042 usbhid hid-apple hid-sunplus hid-cherry hid-logitech \
hid-logitech-dj hid-microsoft firewire-ohci \
pcmcia usb_storage nvme hid-hyperv hv-vmbus
pcmcia usb_storage nvme hid-hyperv hv-vmbus \
sdhci_acpi
if [[ "$(uname -p)" == arm* ]]; then
# arm specific modules

View File

@@ -27,7 +27,7 @@ if get_url_handler "$liveurl" >/dev/null; then
netroot="livenet:$liveurl"
root="livenet" # quiet complaints from init
rootok=1
wait_for_dev /dev/root
wait_for_dev -n /dev/root
else
info "livenet: no url handler for $liveurl"
fi

View File

@@ -107,11 +107,13 @@ fi
if [ -n "$LVS" ] ; then
info "Scanning devices $lvmdevs for LVM logical volumes $LVS"
lvm lvscan --ignorelockingfailure 2>&1 | vinfo
if [ -z "$sysinit" ]; then
lvm lvchange --yes -ay --ignorelockingfailure $nopoll --ignoremonitoring $LVS 2>&1 | vinfo
else
lvm lvchange --yes -ay $sysinit $LVS 2>&1 | vinfo
fi
for LV in $LVS; do
if [ -z "$sysinit" ]; then
lvm lvchange --yes -ay --ignorelockingfailure $nopoll --ignoremonitoring $LV 2>&1 | vinfo
else
lvm lvchange --yes -ay $sysinit $LV 2>&1 | vinfo
fi
done
fi
if [ -z "$LVS" -o -n "$VGS" ]; then

View File

@@ -5,7 +5,7 @@
# called by dracut
check() {
# No point trying to support lvm if the binaries are missing
type -P lvm >/dev/null || return 1
require_binaries lvm || return 1
[[ $hostonly ]] || [[ $mount_needs ]] && {
for fs in "${host_fs_types[@]}"; do
@@ -50,8 +50,10 @@ install() {
inst lvm
cmdline >> "${initdir}/etc/cmdline.d/90lvm.conf"
echo >> "${initdir}/etc/cmdline.d/90lvm.conf"
if [[ $hostonly_cmdline == "yes" ]]; then
cmdline >> "${initdir}/etc/cmdline.d/90lvm.conf"
echo >> "${initdir}/etc/cmdline.d/90lvm.conf"
fi
inst_rules "$moddir/64-lvm.rules"

View File

@@ -13,7 +13,7 @@ if ! getargbool 1 rd.lvm -d -n rd_NO_LVM \
rm -f -- /etc/udev/rules.d/64-lvm*.rules
else
for dev in $LV_DEVS; do
wait_for_dev "/dev/$dev"
wait_for_dev -n "/dev/$dev"
done
fi

View File

@@ -6,7 +6,7 @@
check() {
local _rootdev
# No mdadm? No mdraid support.
type -P mdadm >/dev/null || return 1
require_binaries mdadm || return 1
[[ $hostonly ]] || [[ $mount_needs ]] && {
for dev in "${!host_fs_types[@]}"; do
@@ -70,8 +70,10 @@ install() {
inst $(command -v partx) /sbin/partx
inst $(command -v mdadm) /sbin/mdadm
cmdline >> "${initdir}/etc/cmdline.d/90mdraid.conf"
echo >> "${initdir}/etc/cmdline.d/90mdraid.conf"
if [[ $hostonly_cmdline == "yes" ]]; then
cmdline >> "${initdir}/etc/cmdline.d/90mdraid.conf"
echo >> "${initdir}/etc/cmdline.d/90mdraid.conf"
fi
# <mdadm-3.3 udev rule
inst_rules 64-md-raid.rules

View File

@@ -6,7 +6,7 @@
check() {
local _rootdev
# if there's no multipath binary, no go.
type -P multipath >/dev/null || return 1
require_binaries multipath || return 1
is_mpath() {
local _dev=$1

View File

@@ -5,7 +5,7 @@
# GPG support is optional
# called by dracut
check() {
type -P gpg >/dev/null || return 1
require_binaries gpg || return 1
return 255
}

View File

@@ -1,23 +1,27 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
# called by dracut
check() {
type -P losetup >/dev/null || return 1
return 255
require_binaries losetup || return 1
return 255
}
# called by dracut
depends() {
echo crypt
echo crypt
}
# called by dracut
installkernel() {
instmods loop
instmods loop
}
# called by dracut
install() {
inst_multiple losetup
inst "$moddir/crypt-loop-lib.sh" "/lib/dracut-crypt-loop-lib.sh"
dracut_need_initqueue
inst_multiple losetup
inst "$moddir/crypt-loop-lib.sh" "/lib/dracut-crypt-loop-lib.sh"
dracut_need_initqueue
}

View File

@@ -5,7 +5,7 @@
# called by dracut
check() {
# If our prerequisites are not met, fail anyways.
type -P mount.cifs >/dev/null || return 1
require_binaries mount.cifs || return 1
[[ $hostonly ]] || [[ $mount_needs ]] && {
for fs in ${host_fs_types[@]}; do

View File

@@ -5,8 +5,8 @@
# called by dracut
check() {
local _arch=$(uname -m)
[ -x /sbin/normalize_dasd_arg ] || return 1
[ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
require_binaries normalize_dasd_arg || return 1
return 0
}

View File

@@ -6,6 +6,7 @@
check() {
local _arch=$(uname -m)
[ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
require_binaries grep sed seq
return 0
}

View File

@@ -5,8 +5,8 @@
# called by dracut
check() {
local _arch=$(uname -m)
[ -x /sbin/dasd_configure ] || return 1
[ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
require_binaries dasd_configure /usr/lib/udev/collect || return 1
return 0
}

View File

@@ -4,9 +4,7 @@
# called by dracut
check() {
for i in dcbtool fipvlan lldpad ip readlink; do
type -P $i >/dev/null || return 1
done
require_binaries dcbtool fipvlan lldpad ip readlink || return 1
return 0
}

View File

@@ -9,10 +9,10 @@ command -v set_ifname >/dev/null || . /lib/net-lib.sh
print_fcoe_uefi_conf()
{
local mac dev vlan
mac=$(get_fcoe_boot_mac)
[ -z "$mac" ] && continue
mac=$(get_fcoe_boot_mac "$1")
[ -z "$mac" ] && return 1
dev=$(set_ifname fcoe $mac)
vlan=$(get_fcoe_boot_vlan)
vlan=$(get_fcoe_boot_vlan "$1")
if [ "$vlan" -ne "0" ]; then
case "$vlan" in
[0-9]*)
@@ -27,9 +27,10 @@ print_fcoe_uefi_conf()
fi
# fcoe=eth0:nodcb
printf "%s\n" "$dev:nodcb"
return 0
}
if [ -e /sys/firmware/efi/vars/FcoeBootDevice-a0ebca23-5f9c-447a-a268-22b6c158c2ac/data ]; then
print_fcoe_uefi_conf > /etc/cmdline.d/40-fcoe-uefi.conf
fi
for i in /sys/firmware/efi/vars/FcoeBootDevice-*/data; do
[ -e "$i" ] || continue
print_fcoe_uefi_conf $i > /etc/cmdline.d/40-fcoe-uefi.conf && break
done

View File

@@ -9,15 +9,12 @@
# future use.
PATH=/usr/sbin:/usr/bin:/sbin:/bin
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
# Huh? Missing arguments ??
[ -z "$1" -o -z "$2" ] && exit 1
export PS4="fcoe-up.$1.$$ + "
[ -e /run/initramfs/loginit.pipe ] && exec >>/run/initramfs/loginit.pipe 2>>/run/initramfs/loginit.pipe
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh
netif=$1
dcb=$2

View File

@@ -4,10 +4,7 @@
# called by dracut
check() {
for i in dcbtool fipvlan lldpad ip readlink; do
type -P $i >/dev/null || return 1
done
require_binaries dcbtool fipvlan lldpad ip readlink || return 1
return 0
}

View File

@@ -60,7 +60,7 @@ handle_firmware()
fi
if [ -d /sys/class/iscsi_session ]; then
echo 'started' > "/tmp/iscsistarted-iscsi"
echo 'started' > "/tmp/iscsistarted-iscsi:"
echo 'started' > "/tmp/iscsistarted-firmware"
else
return 1
@@ -125,7 +125,7 @@ handle_netroot()
if [ -z $iscsi_initiator ]; then
if [ -f /sys/firmware/ibft/initiator/initiator-name ]; then
iscsi_initiator=$(while read line; do echo $line;done < /sys/firmware/ibft/initiator-name)
iscsi_initiator=$(while read line; do echo $line;done < /sys/firmware/ibft/initiator/initiator-name)
fi
fi
@@ -156,7 +156,7 @@ handle_netroot()
printf 'SYMLINK=="disk/by-path/*-iscsi-*-%s", SYMLINK+="root"\n' $iscsi_lun >> /etc/udev/rules.d/99-iscsi-root.rules
udevadm control --reload
write_fs_tab /dev/root
wait_for_dev /dev/root
wait_for_dev -n /dev/root
# install mount script
[ -z "$DRACUT_SYSTEMD" ] && \

View File

@@ -6,7 +6,7 @@
check() {
local _rootdev
# If our prerequisites are not met, fail anyways.
type -P iscsistart hostname iscsi-iname >/dev/null || return 1
require_binaries iscsistart hostname iscsi-iname || return 1
# If hostonly was requested, fail the check if we are not actually
# booting from root.

View File

@@ -6,7 +6,7 @@
check() {
local _rootdev
# If our prerequisites are not met, fail.
type -P nbd-client >/dev/null || return 1
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.

View File

@@ -102,7 +102,7 @@ if [ "$root" = "block:/dev/root" -o "$root" = "dhcp" ]; then
udevadm control --reload
type write_fs_tab >/dev/null 2>&1 || . /lib/fs-lib.sh
write_fs_tab /dev/root "$nbdfstype" "$fsopts"
wait_for_dev /dev/root
wait_for_dev -n /dev/root
if [ -z "$DRACUT_SYSTEMD" ]; then
printf '/bin/mount %s\n' \

View File

@@ -61,6 +61,6 @@ rootok=1
# Shut up init error check
if [ -z "$root" ]; then
root=block:/dev/root
wait_for_dev /dev/root
wait_for_dev -n /dev/root
fi

View File

@@ -5,8 +5,8 @@
# called by dracut
check() {
# If our prerequisites are not met, fail anyways.
type -P rpcbind >/dev/null || type -P portmap >/dev/null || return 1
type -P rpc.statd mount.nfs mount.nfs4 umount >/dev/null || return 1
require_any_binary rpcbind portmap || return 1
require_binaries rpc.statd mount.nfs mount.nfs4 umount || return 1
[[ $hostonly ]] || [[ $mount_needs ]] && {
for fs in ${host_fs_types[@]}; do

View File

@@ -97,7 +97,7 @@ nfsroot_from_dhcp() {
[ -z "$path" ] && [ "$(getarg root=)" == "/dev/nfs" ] && path=/tftpboot/%s
[ -z "$server" ] && server=$srv
[ -z "$server" ] && server=$new_dhcp_server_identifier
[ -z "$server" ] && server=$new_dhcp_next_server
[ -z "$server" ] && server=$new_next_server
[ -z "$server" ] && server=${new_root_path%%:*}
}

View File

@@ -16,7 +16,7 @@ NEWROOT="$3"
nfs_to_var $root $netif
[ -z "$server" ] && die "Required parameter 'server' is missing"
mount_nfs $root $NEWROOT $netif && { [ -e /dev/root ] || ln -s null /dev/root ; }
mount_nfs $root $NEWROOT $netif && { [ -e /dev/root ] || ln -s null /dev/root ; [ -e /dev/nfs ] || ln -s null /dev/nfs; }
[ -f $NEWROOT/etc/fstab ] && cat $NEWROOT/etc/fstab > /dev/null

View File

@@ -12,19 +12,7 @@ depends() {
echo fs-lib
}
# called by dracut
cmdline() {
local dev=/dev/block/$(find_root_block_device)
if [ -e $dev ]; then
printf " root=%s" "$(shorten_persistent_dev "$(get_persistent_dev "$dev")")"
printf " rootflags=%s" "$(find_mp_fsopts /)"
printf " rootfstype=%s" "$(find_mp_fstype /)"
fi
}
# called by dracut
install() {
cmdline_journal() {
if [[ $hostonly ]]; then
for dev in "${!host_fs_types[@]}"; do
[[ ${host_fs_types[$dev]} = "reiserfs" ]] || [[ ${host_fs_types[$dev]} = "xfs" ]] || continue
@@ -36,10 +24,31 @@ install() {
fi
if [ -n "$journaldev" ]; then
printf "%s\n" "root.journaldev=$journaldev" >> "${initdir}/etc/cmdline.d/95root-journaldev.conf"
printf " root.journaldev=%s" "$journaldev"
fi
done
fi
return 0
}
# called by dracut
cmdline() {
local dev=/dev/block/$(find_root_block_device)
if [ -e $dev ]; then
printf " root=%s" "$(shorten_persistent_dev "$(get_persistent_dev "$dev")")"
printf " rootflags=%s" "$(find_mp_fsopts /)"
printf " rootfstype=%s" "$(find_mp_fstype /)"
fi
cmdline_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
fi
inst_multiple umount
inst_multiple tr

View File

@@ -6,11 +6,11 @@
# called by dracut
check() {
# If our prerequisites are not met, fail.
type -P ssh >/dev/null || return 1
type -P scp >/dev/null || return 1
[[ $mount_needs ]] && return 1
# If our prerequisites are not met, fail.
require_binaries ssh scp || return 1
if [[ $sshkey ]]; then
[ ! -f $sshkey ] && {
derror "ssh key: $sshkey is not found!"

View File

@@ -6,7 +6,7 @@
install() {
local _i
# Fixme: would be nice if we didn't have to know which rules to grab....
# Fixme: would be nice if we didn't have to guess, which rules to grab....
# ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies
# of the rules we want so that we just copy those in would be best
inst_multiple udevadm cat uname blkid \
@@ -32,7 +32,8 @@ install() {
60-pcmcia.rules \
50-udev.rules 95-late.rules \
50-firmware.rules \
75-net-description.rules 80-net-name-slot.rules \
75-net-description.rules \
80-net-name-slot.rules 80-net-setup-link.rules \
"$moddir/59-persistent-storage.rules" \
"$moddir/61-persistent-storage.rules"
@@ -42,6 +43,13 @@ install() {
# eudev rules
inst_rules 80-drivers-modprobe.rules
for _i in \
${systemdutildir}/network/*.link \
${hostonly:+/etc/systemd/network/*.link} \
; do
[[ -e "$_i" ]] && inst "$_i"
done
{
for i in cdrom tape dialout floppy; do
if ! egrep -q "^$i:" "$initdir/etc/group" 2>/dev/null; then

View File

@@ -5,9 +5,10 @@
# called by dracut
check() {
arch=$(uname -m)
[ -x /sbin/zfcp_cio_free ] || return 1
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
require_binaries zfcp_cio_free grep sed seq || return 1
return 0
}

View File

@@ -5,8 +5,8 @@
# called by dracut
check() {
local _arch=$(uname -m)
[ -x /sbin/zfcp_disk_configure ] || return 1
[ "$_arch" = "s390" -o "$_arch" = "s390x" ] || return 1
require_binaries zfcp_disk_configure /usr/lib/udev/collect || return 1
return 0
}

View File

@@ -5,9 +5,10 @@
# called by dracut
check() {
arch=$(uname -m)
[ -z /sbin/znet_cio_free ] || return 1
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
require_binaries znet_cio_free grep sed seq readlink || return 1
return 0
}

View File

@@ -5,7 +5,7 @@
# called by dracut
check() {
[[ "$mount_needs" ]] && return 1
type -P biosdevname >/dev/null || return 1
require_binaries biosdevname || return 1
return 0
}

View File

@@ -5,7 +5,7 @@
# called by dracut
check() {
[[ $hostonly ]] && {
[ -x "/bin/keyctl" ] || return 1
require_binaries keyctl uname || return 1
}
return 255

View File

@@ -19,6 +19,8 @@ ConditionDirectoryNotEmpty=|/lib/dracut/hooks/cleanup
ConditionKernelCommandLine=|rd.break=pre-pivot
ConditionKernelCommandLine=|rd.break=cleanup
ConditionKernelCommandLine=|rd.break
ConditionPathExists=|/dev/root
ConditionPathExists=|/dev/nfs
[Service]
Environment=DRACUT_SYSTEMD=1

View File

@@ -24,5 +24,6 @@ getarg rd.break -d rdbreak && emergency_shell -n switch_root "Break before switc
# remove helper symlink
[ -h /dev/root ] && rm -f -- /dev/root
[ -h /dev/nfs ] && rm -f -- /dev/nfs
exit 0

View File

@@ -15,6 +15,6 @@ ConditionPathExists=/run/initramfs/.need_shutdown
ConditionPathExists=!/run/initramfs/bin/sh
[Service]
ExecStart=/usr/lib/dracut/dracut-initramfs-restore
ExecStart=-/usr/lib/dracut/dracut-initramfs-restore
Type=oneshot
RemainAfterExit=yes

View File

@@ -5,7 +5,7 @@
# called by dracut
check() {
[[ $mount_needs ]] && return 1
if [[ -x $systemdutildir/systemd ]]; then
if require_binaries $systemdutildir/systemd; then
SYSTEMD_VERSION=$($systemdutildir/systemd --version | { read a b a; echo $b; })
(( $SYSTEMD_VERSION >= 198 )) && return 0
return 255
@@ -44,6 +44,7 @@ install() {
$systemdutildir/systemd-modules-load \
$systemdutildir/systemd-vconsole-setup \
$systemdutildir/system-generators/systemd-fstab-generator \
\
$systemdsystemunitdir/cryptsetup.target \
$systemdsystemunitdir/emergency.target \
$systemdsystemunitdir/sysinit.target \
@@ -72,6 +73,9 @@ install() {
$systemdsystemunitdir/timers.target \
$systemdsystemunitdir/paths.target \
$systemdsystemunitdir/umount.target \
\
$systemdsystemunitdir/sys-kernel-config.mount \
\
$systemdsystemunitdir/kmod-static-nodes.service \
$systemdsystemunitdir/systemd-tmpfiles-setup-dev.service \
$systemdsystemunitdir/systemd-ask-password-console.path \
@@ -93,6 +97,7 @@ install() {
$systemdsystemunitdir/systemd-journald.service \
$systemdsystemunitdir/systemd-vconsole-setup.service \
$systemdsystemunitdir/systemd-random-seed-load.service \
$systemdsystemunitdir/systemd-sysctl.service \
\
$systemdsystemunitdir/sysinit.target.wants/systemd-modules-load.service \
$systemdsystemunitdir/sysinit.target.wants/systemd-ask-password-console.path \
@@ -104,6 +109,7 @@ install() {
$systemdsystemunitdir/sysinit.target.wants/systemd-udev-trigger.service \
$systemdsystemunitdir/sysinit.target.wants/kmod-static-nodes.service \
$systemdsystemunitdir/sysinit.target.wants/systemd-tmpfiles-setup-dev.service \
$systemdsystemunitdir/sysinit.target.wants/systemd-sysctl.service \
\
$systemdsystemunitdir/ctrl-alt-del.target \
$systemdsystemunitdir/syslog.socket \
@@ -190,7 +196,7 @@ install() {
inst_binary true
ln_r $(type -P true) "/usr/bin/loginctl"
ln_r $(type -P true) "/bin/loginctl"
inst_rules 71-seat.rules 73-seat-late.rules 99-systemd.rules
inst_rules 70-uaccess.rules 71-seat.rules 73-seat-late.rules 99-systemd.rules
for i in \
emergency.target \

View File

@@ -3,6 +3,37 @@
# ex: ts=8 sw=4 sts=4 et filetype=sh
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
generator_wait_for_dev()
{
local _name
_name="$(str_replace "$1" '/' '\x2f')"
[ -e "$hookdir/initqueue/finished/devexists-${_name}.sh" ] && return 0
printf '[ -e "%s" ]\n' $1 \
>> "$hookdir/initqueue/finished/devexists-${_name}.sh"
{
printf '[ -e "%s" ] || ' $1
printf 'warn "\"%s\" does not exist"\n' $1
} >> "$hookdir/emergency/80-${_name}.sh"
_name=$(dev_unit_name "$1")
if ! [ -L /run/systemd/generator/initrd.target.wants/${_name}.device ]; then
[ -d /run/systemd/generator/initrd.target.wants ] || mkdir -p /run/systemd/generator/initrd.target.wants
ln -s ../${_name}.device /run/systemd/generator/initrd.target.wants/${_name}.device
fi
if ! [ -f /run/systemd/generator/${_name}.device.d/timeout.conf ]; then
mkdir -p /run/systemd/generator/${_name}.device.d
{
echo "[Unit]"
echo "JobTimeoutSec=0"
} > /run/systemd/generator/${_name}.device.d/timeout.conf
fi
}
root=$(getarg root=)
case "$root" in
block:LABEL=*|LABEL=*)
@@ -29,6 +60,6 @@ case "$root" in
rootok=1 ;;
esac
[ "${root%%:*}" = "block" ] && wait_for_dev -n "${root#block:}"
[ "${root%%:*}" = "block" ] && generator_wait_for_dev "${root#block:}"
exit 0

View File

@@ -891,7 +891,7 @@ wait_for_dev()
mkdir -p ${PREFIX}/etc/systemd/system/${_name}.device.d
{
echo "[Unit]"
echo "JobTimeoutSec=3600"
echo "JobTimeoutSec=0"
} > ${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf
_needreload=1
fi

View File

@@ -95,24 +95,26 @@ install() {
ln -sf initrd-release $initdir/etc/os-release
## save host_devs which we need bring up
if [[ -f "$initdir/lib/dracut/need-initqueue" ]] || ! dracut_module_included "systemd"; then
(
if dracut_module_included "systemd"; then
DRACUT_SYSTEMD=1
fi
PREFIX="$initdir"
if [[ $hostonly_cmdline == "yes" ]]; then
if [[ -f "$initdir/lib/dracut/need-initqueue" ]] || ! dracut_module_included "systemd"; then
(
if dracut_module_included "systemd"; then
DRACUT_SYSTEMD=1
fi
PREFIX="$initdir"
. "$moddir/dracut-lib.sh"
. "$moddir/dracut-lib.sh"
for _dev in ${host_devs[@]}; do
[[ "$_dev" == "$root_dev" ]] && continue
_pdev=$(get_persistent_dev $_dev)
for _dev in ${host_devs[@]}; do
[[ "$_dev" == "$root_dev" ]] && continue
_pdev=$(get_persistent_dev $_dev)
case "$_pdev" in
/dev/?*) wait_for_dev $_pdev;;
*) ;;
esac
done
)
case "$_pdev" in
/dev/?*) wait_for_dev $_pdev;;
*) ;;
esac
done
)
fi
fi
}

View File

@@ -8,13 +8,7 @@ exec >/run/initramfs/rdsosreport.txt 2>&1
set -x
cat /proc/self/mountinfo
cat /proc/mounts
blkid
blkid -o udev
ls -l /dev/disk/by*
cat /lib/dracut/dracut-*
cat /proc/cmdline
@@ -26,6 +20,14 @@ for _i in /etc/cmdline.d/*.conf; do
cat $_i
done
cat /proc/self/mountinfo
cat /proc/mounts
blkid
blkid -o udev
ls -l /dev/disk/by*
for _i in /etc/conf.d/*.conf; do
[ -f "$_i" ] || break
echo $_i

View File

@@ -3,9 +3,7 @@
# called by dracut
check() {
for cmd in tar gzip dd; do
command -v $cmd >/dev/null || return 1
done
require_binaries tar gzip dd bash || return 1
return 255
}

View File

@@ -113,6 +113,7 @@ case "$ACTION" in
kexec)
kexec -e
warn "$ACTION failed!"
reboot -f -d -n
;;
*)
warn "Shutdown called with argument '$ACTION'. Rebooting!"

View File

@@ -6,6 +6,7 @@ check:
[ -d $$i ] || continue ; \
[ -f $$i/Makefile ] || continue ; \
if [ -n "$$TESTS" ]; then t=$${i##TEST-}; t=$${t%%-*}; [ "$${TESTS#*$$t*}" != "$$TESTS" ] || continue; fi; \
if [ -n "$$SKIP" ]; then t=$${i##TEST-}; t=$${t%%-*}; [ "$${SKIP#*$$t*}" != "$$SKIP" ] && continue; fi; \
$(MAKE) -C $$i all ; \
done

12
test/Makefile.testdir Normal file
View File

@@ -0,0 +1,12 @@
.PHONY: all setup clean run
all:
@$(MAKE) -s --no-print-directory -C ../.. all
@V=$(V) basedir=../.. testdir=../ ./test.sh --all
setup:
@$(MAKE) --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --setup
clean:
@basedir=../.. testdir=../ ./test.sh --clean
run:
@basedir=../.. testdir=../ ./test.sh --run

View File

@@ -1,10 +1 @@
all:
@$(MAKE) -s --no-print-directory -C ../.. all
@V=$(V) basedir=../.. testdir=../ ./test.sh --all
setup:
@$(MAKE) --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --setup
clean:
@basedir=../.. testdir=../ ./test.sh --clean
run:
@basedir=../.. testdir=../ ./test.sh --run
-include ../Makefile.testdir

View File

@@ -1,10 +1 @@
all:
@$(MAKE) -s --no-print-directory -C ../.. all
@V=$(V) basedir=../.. testdir=../ ./test.sh --all
setup:
@$(MAKE) --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --setup
clean:
@basedir=../.. testdir=../ ./test.sh --clean
run:
@basedir=../.. testdir=../ ./test.sh --run
-include ../Makefile.testdir

View File

@@ -1,10 +1 @@
all:
@$(MAKE) -s --no-print-directory -C ../.. all
@V=$(V) basedir=../.. testdir=../ ./test.sh --all
setup:
@$(MAKE) --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --setup
clean:
@basedir=../.. testdir=../ ./test.sh --clean
run:
@basedir=../.. testdir=../ ./test.sh --run
-include ../Makefile.testdir

View File

@@ -1,10 +1 @@
all:
@$(MAKE) -s --no-print-directory -C ../.. all
@V=$(V) basedir=../.. testdir=../ ./test.sh --all
setup:
@$(MAKE) --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --setup
clean:
@basedir=../.. testdir=../ ./test.sh --clean
run:
@basedir=../.. testdir=../ ./test.sh --run
-include ../Makefile.testdir

View File

@@ -1,10 +1 @@
all:
@$(MAKE) -s --no-print-directory -C ../.. all
@V=$(V) basedir=../.. testdir=../ ./test.sh --all
setup:
@$(MAKE) --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --setup
clean:
@basedir=../.. testdir=../ ./test.sh --clean
run:
@basedir=../.. testdir=../ ./test.sh --run
-include ../Makefile.testdir

View File

@@ -1,10 +1 @@
all:
@$(MAKE) -s --no-print-directory -C ../.. all
@V=$(V) basedir=../.. testdir=../ ./test.sh --all
setup:
@$(MAKE) --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --setup
clean:
@basedir=../.. testdir=../ ./test.sh --clean
run:
@basedir=../.. testdir=../ ./test.sh --run
-include ../Makefile.testdir

View File

@@ -1,10 +1 @@
all:
@$(MAKE) -s --no-print-directory -C ../.. all
@V=$(V) basedir=../.. testdir=../ ./test.sh --all
setup:
@$(MAKE) --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --setup
clean:
@basedir=../.. testdir=../ ./test.sh --clean
run:
@basedir=../.. testdir=../ ./test.sh --run
-include ../Makefile.testdir

View File

@@ -1,10 +1 @@
all:
@$(MAKE) -s --no-print-directory -C ../.. all
@V=$(V) basedir=../.. testdir=../ ./test.sh --all
setup:
@$(MAKE) --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --setup
clean:
@basedir=../.. testdir=../ ./test.sh --clean
run:
@basedir=../.. testdir=../ ./test.sh --run
-include ../Makefile.testdir

View File

@@ -1,10 +1 @@
all:
@make -s --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --all
setup:
@make --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --setup
clean:
@basedir=../.. testdir=../ ./test.sh --clean
run:
@basedir=../.. testdir=../ ./test.sh --run
-include ../Makefile.testdir

View File

@@ -1,10 +1 @@
all:
@$(MAKE) -s --no-print-directory -C ../.. all
@V=$(V) basedir=../.. testdir=../ ./test.sh --all
setup:
@$(MAKE) --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --setup
clean:
@basedir=../.. testdir=../ ./test.sh --clean
run:
@basedir=../.. testdir=../ ./test.sh --run
-include ../Makefile.testdir

View File

@@ -1,10 +1 @@
all:
@$(MAKE) -s --no-print-directory -C ../.. all
@V=$(V) basedir=../.. testdir=../ ./test.sh --all
setup:
@$(MAKE) --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --setup
clean:
@basedir=../.. testdir=../ ./test.sh --clean
run:
@basedir=../.. testdir=../ ./test.sh --run
-include ../Makefile.testdir

View File

@@ -1,10 +1 @@
all:
@$(MAKE) -s --no-print-directory -C ../.. all
@V=$(V) basedir=../.. testdir=../ ./test.sh --all
setup:
@$(MAKE) --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --setup
clean:
@basedir=../.. testdir=../ ./test.sh --clean
run:
@basedir=../.. testdir=../ ./test.sh --run
-include ../Makefile.testdir

View File

@@ -1,10 +1 @@
all:
@$(MAKE) -s --no-print-directory -C ../.. all
@V=$(V) basedir=../.. testdir=../ ./test.sh --all
setup:
@$(MAKE) --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --setup
clean:
@basedir=../.. testdir=../ ./test.sh --clean
run:
@basedir=../.. testdir=../ ./test.sh --run
-include ../Makefile.testdir

View File

@@ -1,10 +1 @@
all:
@$(MAKE) -s --no-print-directory -C ../.. all
@V=$(V) basedir=../.. testdir=../ ./test.sh --all
setup:
@$(MAKE) --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --setup
clean:
@basedir=../.. testdir=../ ./test.sh --clean
run:
@basedir=../.. testdir=../ ./test.sh --run
-include ../Makefile.testdir

View File

@@ -1,10 +1 @@
all:
@$(MAKE) -s --no-print-directory -C ../.. all
@V=$(V) basedir=../.. testdir=../ ./test.sh --all
setup:
@$(MAKE) --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --setup
clean:
@basedir=../.. testdir=../ ./test.sh --clean
run:
@basedir=../.. testdir=../ ./test.sh --run
-include ../Makefile.testdir

View File

@@ -1,10 +1 @@
all:
@$(MAKE) -s --no-print-directory -C ../.. all
@V=$(V) basedir=../.. testdir=../ ./test.sh --all
setup:
@$(MAKE) --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --setup
clean:
@basedir=../.. testdir=../ ./test.sh --clean
run:
@basedir=../.. testdir=../ ./test.sh --run
-include ../Makefile.testdir

View File

@@ -9,6 +9,7 @@ export PS1='initramfs-test:\w\$ '
stty sane
echo "made it to the rootfs! Powering down."
for i in /run/initramfs/net.*.did-setup; do
strstr "$i" ":*:*:*:*:" && continue
i=${i%.did-setup}
IFACES+="${i##*/net.} "
done

View File

@@ -1,10 +1 @@
all:
@$(MAKE) -s --no-print-directory -C ../.. all
@V=$(V) basedir=../.. testdir=../ ./test.sh --all
setup:
@$(MAKE) --no-print-directory -C ../.. all
@basedir=../.. testdir=../ ./test.sh --setup
clean:
@basedir=../.. testdir=../ ./test.sh --clean
run:
@basedir=../.. testdir=../ ./test.sh --run
-include ../Makefile.testdir