Compare commits

..

111 Commits
039 ... 041

Author SHA1 Message Date
Harald Hoyer
e97ed33775 NEWS & AUTHORS update 2015-01-31 12:54:52 +01:00
Harald Hoyer
04942c4569 test/*NFS* : add dhcpd debug flag 2015-01-31 12:24:02 +01:00
Harald Hoyer
296d013f1a TEST-30-ISCSI: turn off iscsi_firmware
Having iscsi_firmware on the kernel cmdline stalls until firmware is
found. qemu does not have this.
2015-01-31 12:22:45 +01:00
Harald Hoyer
64a69cb49f README.testsuite: reformat package list for easy copy&paste 2015-01-31 12:21:56 +01:00
Harald Hoyer
70598ac292 lvm: add cache tools for dm-cache usage 2015-01-28 13:33:09 +00:00
Harald Hoyer
2a12e97475 network: do not destroy the team interface on teamd shutdown
when doing switch-root teamd gets killed, which tears down the team
interface, if teamd is not started with "-N".
2015-01-26 15:12:08 +00:00
Harald Hoyer
8a430ab25b test: use the new sfdisk syntax without disk geometry 2015-01-22 16:02:54 +01:00
Harald Hoyer
2a5a7fb662 test/TEST-04-FULL-SYSTEMD/test.sh: fix the find -perm
"find -perm +111" should be "find -perm /0111" as it is deprecated since
a long time
2015-01-22 16:00:50 +01:00
Harald Hoyer
f182cb9599 dracut.sh: simplify the "find" for files with the x bit
'(' -perm -0100 -or -perm -0010 -or -perm -0001 ')'
is the same as
-perm /0111
2015-01-22 15:58:20 +01:00
Harald Hoyer
9dc0c244b8 dmraid: don't include MD rules in DM 2015-01-22 15:57:53 +01:00
Marko Myllynen
b4fb539c9b Change Fedora default console font to eurlatgr
See https://fedoraproject.org/wiki/Changes/NewDefaultConsoleFont
2015-01-22 15:51:03 +01:00
Radek Vykydal
18423f7951 Add rd.live.overlay.size option 2015-01-21 14:10:27 +01:00
Daniel Drake
6dcc5e1158 kernel-modules: increase SDHCI driver inclusion
The sdhci-pci module is currently not being included in the initramfs,
even though other sdhci modules are. This breaks boot on systems that
rely on this driver to access the root filesystem.

Instead of looking for modules that use sdhci_pltfm_init, look for
sdhci_add_host. I checked 3.18 kernel sources, and this change
does not remove any of the previously-matched SDHCI drivers.
It should result in the addition of sdhci-pci, sdhci-s3c, sdhci-spear
and sdhci-acpi.
2015-01-21 14:10:26 +01:00
Harald Hoyer
e3e1f406bb test: turn off hostonly-cmdline and hostonly 2015-01-21 09:33:39 +01:00
Harald Hoyer
496e3d962d dracut.sh: handle empty $initrd/etc/cmdline.d 2015-01-21 09:32:20 +01:00
Harald Hoyer
7cddd7b838 network/net-lib.sh:parse_iscsi_root(): fix c&p bug
fix iscsi_target_name for eui.* and naa.* target names
2015-01-15 10:33:50 +01:00
Harald Hoyer
93342718cd network: add support for comma separated autoconf options
ip=eth0:auto6,dhcp

might work now
2015-01-14 11:41:48 +01:00
Harald Hoyer
4ba44e899c ssh-client: s/key/$key
GlobalKnownHostsFile was not installed, because key was not $key

Thanks Jan Stodola!
2015-01-12 14:21:33 +01:00
Harald Hoyer
36e8ce4fb0 net-lib.sh:parse_iscsi_root() fix target parsing
For targets with colons in the iSCSI target name:
  "iqn.2000-09.com.foo:storage-system.e2000:00000001cm1p1"

the parser was confused with the optional iscsi_iface_name and
iscsi_netdev_name.

This patch reintroduces the old IQN, EUI and NAA parsing and enhances
the fallback parser by checking the LUN for a numerical value.
2015-01-12 14:06:10 +01:00
Harald Hoyer
4089949033 fips: remove c&p "and" 2015-01-09 14:53:42 +01:00
Thomas Backlund
eb8f202ed0 90kernel-modules: update for xhci module split in kernel 3.18
As reported in https://bugs.mageia.org/show_bug.cgi?id=14799

the xhci module got splitted up in upstream linux merged during
3.18 release cycle:

>From 29e409f0f7613f9fd2235e41f0fa33e48e94544e Mon Sep 17 00:00:00 2001
From: Andrew Bresticker <abrestic@chromium.org>
Date: Fri, 3 Oct 2014 11:35:29 +0300
Subject: xhci: Allow xHCI drivers to be built as separate modules

so we need to adjust 90kernel-modules accordingly.

Signed-off-by: Thomas Backlund <tmb@mageia.org>
2015-01-08 15:34:03 +01:00
Lubomir Rintel
c59779cf93 dracut-functions.sh: avoid tokenizing ldconfig output with 'read'
The space does not separate the elements reliably, spaces can be
embedded in parenthesized expressions too:

  libgmpxx.so.4 (libc6, hwcap: 0x0000000004000000) => /lib/sse2/libgmpxx.so.4
  libgmp.so.10 (libc6, hwcap: 0x0000000004000000) => /lib/sse2/libgmp.so.10

This results in dracut creating '0x0000000004000000' and '=>'
directories in the initramfs image.
2015-01-08 15:34:03 +01:00
Harald Hoyer
1dc360790d Makefile: add -Wformat to CFLAGS
-Werror=format-security seems to be ignored without -Wformat

Thanks @ Christoph Brill
2015-01-08 14:56:07 +01:00
Harald Hoyer
e0dc6cd4f6 AUTHORS and .mailmap update 2015-01-08 13:26:52 +01:00
Harald Hoyer
ebc82d38b7 qemu: add virtio_rng kernel module 2015-01-08 13:19:43 +01:00
Erwan Velu
332ecaa900 dracut: Don't fail at copying files when including directories
When including a directory, the files were considered in the directory
name which lead to messages like :

cp: failed to access '/var/tmp/initramfs.L9s2zO///init-func': No such file or directory

This patch does make the destdir more explicit and copy files into the
destination directory instead of destdir/filename/
2014-12-19 13:42:57 +01:00
Harald Hoyer
3e7a05f2a5 systemd: add systemd-journald-audit.socket 2014-12-19 13:17:02 +01:00
Harald Hoyer
733c71ce9e resume: make use of systemd-hibernate-resume, if existant
In systemd mode, and if systemd-hibernate-resume exists, use it
exclusively.
2014-12-17 12:08:37 +01:00
Harald Hoyer
a17d5cf494 Revert "95rootfs-block: Correctly terminate commandline parameter"
This reverts commit 4b6b46bb2a.

$ ./dracut.sh -l --print-cmdline
root=UUID=d5e53483-30bc-4119-8c0c-841d47a2f76brootflags=rw,noatime,compress=lzo,ssd,discard,space_cache,autodefrag,inode_cacherootfstype=btrfs

instead of:

$ ./dracut.sh -l --print-cmdline
 root=UUID=d5e53483-30bc-4119-8c0c-841d47a2f76b
rootflags=rw,noatime,compress=lzo,ssd,discard,space_cache,autodefrag,inode_cache
rootfstype=btrfs

and also

$ make testimage
…
 *** Store current command line parameters ***
Stored kernel commandline:
root=UUID=d5e53483-30bc-4119-8c0c-841d47a2f76brootflags=rw,noatime,compress=lzo,ssd,discard,space_cache,autodefrag,inode_cacherootfstype=btrfs
…
2014-12-17 11:44:18 +01:00
Harald Hoyer
bea41b898a dracut-functions.sh: for module handling, strip all ".ko*"
Just strip anything after ".ko" including ".ko", otherwise compressed
modules are not stripped, if they end on e.g. ".ko.gz"
2014-12-17 11:22:46 +01:00
Thomas Renninger
e683985d10 dracut: nbd: Only complain of missing binary in hostonly mode if
rootfs is on nbd

In not hostonly mode, require_binaries will still complain.
If in hostonly mode and the module is explicitly added via -a nbd, then
install() section will still complain later:
dracut-install: ERROR: installing 'nbd-client'

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Hannes Reinecke
4b6b46bb2a 95rootfs-block: Correctly terminate commandline parameter
95rootfs-block would not terminate the commandline parameter with
a space or newline, instead it'll rely on the main routine from
dracut.sh to do this.
Which will cause unexpected problems for any modules called
after this.

So terminate the commandline parameters correctly here and remove
the newline from dracut.sh.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Thorsten Behrens
fe116c1670 Don't create lots of empty cmdline files for hostonly-cmdline case
This aligns other places piping cmdline() output to cmdline.d files
with the earlier fix for 95rootfs-block.

Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Thorsten Behrens
7700b3df4c Also export root= boot param for hostonly-cmdline case.
If there's a root fallback, at least attempt to have it falling
back to the last root filesystem this system ran off of.

Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Thorsten Behrens
486030575d Fix non-export of journal dev boot options.
cmdline_journal does not contain linefeeds anymore, so read
silently skipped it altogether.

Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Hannes Reinecke
ce8f354dbd 90kernel-modules: install scsi_dh_alua
Install the missing scsi_dh_alua module, too.

References: bnc#871617

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Hannes Reinecke
a262ad91e8 99base: Add chown binary
nvidia driver needs this via modprobe script.
Needs to do change the group after a device node got created.
Add chown instead of chgrp which can also change the owner of a file.

Ask Stefand Dirsch <sndirsch@suse.de> for details.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Hannes Reinecke
681462eca8 40network: add missing _arch variable declaration
The module_setup.sh script was missing an '_arch' declaration,
causing network not to be installed on s390.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Thomas Renninger
9492008435 Enhance suse.conf and debug module example with SUSE-specific settings
SUSE is using specific settings for dracut, so add them
to the suse.conf.example file.

Add vi and find to the debug module add some help text to the suse.conf
file when and how to use it.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Hannes Reinecke
22e837b645 95fcoe: start lldpad separately
lldpad is a system-wide process, which must be started only once.
So we should be separate it from fcoe-up, as it might be called
several times.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
0a68a26cff 95fcoe: skip VLAN devices in fcoe-up
DCB & fipvlan can only be called on real devices, not VLAN
ones. So skip any VLAN devices which might been added to the
list of network interfaces.

References: bnc#878583

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
8b257fcc86 95fcoe: Store current configuration in dracut cmdline
When running with --hostonly-cmdline we should be storing
the current configuration in /etc/cmdline.d so that dracut
will be configure the system automatically.

References: bnc#877288

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
c64a94caa9 95fcoe: update fcoe interface check
The 'create' sysfs entry has been removed for newer fcoe modules,
so just check if the module directory exists.

References: bnc#877288

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thomas Renninger
8d40852e8c dracut: Do not stop installing drivers if one fails
--add-drivers and --filesystems kernel drivers are added via:
instmods -c
The check option makes the function return if one driver could not get
installed without trying to install further drivers which is bad.

The user is still informed ($_silent is by default no), but all modules
passed to instmods are tried to be loaded, even if one fails.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
cd72830807 95iscsi: parse output from iscsiadm correctly
Due to some obsure reason the IFS parameter is not set correctly
when evaluating get_ibft_mod(). So change the parsing to not rely
on IFS altogether.

References: bnc#886199

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thomas Renninger
206345ce9b nfs: Add ip=... and root=nfs... parameters to internal dracut
cmdline

If the rootfs is an nfs mount, also know as nfsroot, add the correct
parameter to the dracut cmdline.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thomas Renninger
4d25892179 dracut.usage.asc: Remove distro specific help from manpage
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thomas Renninger
6df523517f dracut.sh: Fix UUID= fstab parsing in case --mount option is passed
Dracut parses /etc/fstab when --mount is option is passed (e.g. kdump).

In host_devs variable the real block device must be stored, not UUID=
There are other /etc/fstab syntax possibilities we now warn that they
are not correctly parsed. This will be fixed by another patch
when there is time to test this properly.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thomas Renninger
118ca9ecfc dracut.sh: Avoid duplicate devices in host_devs
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
jloeser
3838dc47c3 Check for logfile (--logfile option) and create it if necessary
If a logfile is passed to dracut via --logfile option and doesn't
exist, dracut doesn't create it and logs nothing. Instead, dracut
should try to touch the file and print a warning if creating fails.

References: bnc#892191
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thomas Renninger
5c84d51b3f 90lvm: Install dm-snapshot module
bnc#888530

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thomas Renninger
517d27a75f 99base: Increase initqueue timeout in non systemd case
In case of systemd is used the timeout already is set to 180s, compare
with file: modules.d/98systemd/dracut-initqueue.sh

Do the same if systemd is not used, e.g. in kdump case.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
3ae60e559f Handle module alias properly
Some modules (like ext4) provide aliases by which the modules
can be accessed, too. But when using aliases directly dracut
fails to include the correct module. So translate the alias
into the correct module name before checking the module.

References: bnc#886839

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
7c2311660f 99base: warn on invalid command for initqueue
When 'initqueue' is called with an invalid command it'll generate
invalid job scripts. This will lead to confusing error messages
later on.
So abort in these cases and print out a warning.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thorsten Behrens
bd44831b82 Generate fallback mount unit for root filesystem
If kernel cmdline has no root= provided, *and* the initrd carries
a default value, create a systemd mount unit to have it available
in /sysroot

References: bnc#855258

Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thorsten Behrens
e3eec4b8a2 Align dev_unit_name() with systemd's function.
Add more corner cases from systemd's
unit_name_from_path_instance() C function.

Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
fe273e3901 Print stored dracut commandline during initramfs build
When generating the initramfs we should be printing out the
generated dracut commandline used for booting.
This will simplify debugging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
3244bf5981 Do not call 'lvm' for non-LVM device-mapper devices
If a device-mapper device is not created by LVM it's pointless
to call any 'lvm' programs got extract details; they'll be
failing anyway. So check the UUID before calling 'lvm'.
This speeds up initrd creation and avoids I/O errors on
multipath devices.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
56663e7e32 Implement 'rd.timeout' to modify the device timeout
When generating units for devices the administrator might
want to use a different timeout than the default.
So implement a new parameter 'rd.timeout' for this.

References: bnc#878770

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thomas Renninger
f34a2ef14d iscsi: iscsi.initiator and others can and must only show up once
Make sure duplicates of iscsi.initiator vanish.
Only get one rd.iscsi.* paramter value. If getargs is used and several
parameters are parsed, one gets two values separated by whitespace in a
variable which breaks later code and is not suppported.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
c4d8793c67 95iscsi: generate commandline for software iscsi
When installing on an software iscsi root we need to generate
the correct commandline, otherwise the system cannot boot.

References: bnc#880108
Patch: 0093

When using software iscsi we should be using the existing
configuration from the system for the time being.

References: bnc#884768
Patch: 0095

Avoid bad ip route call on empty address
Patch: 0143

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
54e28d79b9 95iscsi: More empty cmdline fixes
This fixes up some 95iscsi/module-setup.sh which might print out empty
commandline files.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
2e34f38095 95iscsi: Fixup bnx2i offload booting
bnx2i is using a separate iSCSI offload engine with a separate
MAC address. As a result, the iBFT information is displaying
a MAC address which does not relate to any MAC address from
the network interfaces.
In addition, the iSCSI offload engine works independently on
the NIC, so we do not need to enable the NIC for iSCSI offload
to work.
This patch modifies the automatic iBFT detection to not set
the 'ip=ibft' flag when bnx2i offload is detected.

References: bnc#855747

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
9ebf4a5d3c 95iscsi: strip one set of quotes when calling initqueue
The bad initqueue parameter passing is already addressed by git commit:
commit bb8c16d121
and
commit 486a8f33e2

However this appraoch is slightly different:
"$netroot" instead of "'$netroot'", etc.

initqueue will process the arguments, assuming the first non-option
argument to be the program to be executed. Putting the entire
commandline into this argument confuses both, initqueue and the
program in question.

References: bnc#879038

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
a3a2266046 95iscsi: Set correct iscsi_started value for iSCSI firmware
When iSCSI firmware booting is selected we should not rely on
'netroot' or 'iscsiroot' variables to be set.

References: bnc#873448

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01:00
Hannes Reinecke
4aad3438f7 95iscsi: Install libgcc_s library
iscsiuio is using pthread, which requires libgcc_s for
pthread_cancel to work.
Without this library iscsiuio will crash with SIGABRT.

References: bnc#881692

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01:00
Hannes Reinecke
442abd16d2 95iscsi: Autodetect iSCSI firmware
Some iSCSI initiator present firmware information in
/sys/firmware/ibft or /sys/firmware/iscsi_bootX

Whenever we detect one of those directories we should assume
that the iSCSI devices should be activated.

Also incorporates SUSE patches:
0049:
95iscsi: Use 'ip=ibft' for ibft autoconfiguration

For iBFT autoconfiguration we should be setting 'ip=ibft'
instead of rd.neednet. This should instruct dracut to only
enable the iBFT interfaces and leave the rest alone.

References: bnc#879038

0054:
95iscsi: update commandline printing

dracut has a separate callout 'cmdline' which should be used
for printing out the generated commandline.

Signed-off-by: Pavel Wieczorkiewicz <pwieczorkiewicz@suse.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01:00
Hannes Reinecke
8f4ee8c71b 90multipath: install correct multipath rules
The multipath and kpartx rules have different numbers in SUSE.

The 11-dm-mpath.rules file had been missing, causing
blacklisting to not work properly.

References: bnc#873151, bnc#872662, bnc#883149

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01:00
Hannes Reinecke
15eed1e4f1 95udev-rules: Include correct sg3_utils rules
sg3_utils now provides two rules 55-scsi-sg3_id.rules and
58-scsi-sg3_symlink.rules, which need to be included instead
of the older 59-scsi-sg3_utils.rules.

References: bnc#873151

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01:00
NeilBrown
36894743e3 Fixup mdraid setup
This sed script to edit 64-md-raid-assemble.rules needs to
be adjusted for latest mdadm

References: bnc#866660

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01:00
Thomas Renninger
ae8e6ed5af systemd always tries to load autofs4
During boot systemd tries to load autofs4, but dracut will only
add it if it's loaded by the time dracut is run.
Modify dracut to always load autofs4.

References: bnc#869411

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01:00
Thomas Renninger
552c37e156 mkinitrd-suse: Update to sles12 SUSE state
Incorporates these patches:
- 0013 mkinitrd-suse: do not update bootloader if no kernel was found
  bnc#858268
- 0018 mkinitrd-suse: Fix whitespaces when adding drivers
- 0032 mkinitrd-suse.sh: Use '--hostonly' and '--hostonly-cmdline' correctly
  bnc#874000,bnc#874905,bnc#874363
- 0039 Remove --force parameter from mkinitrd
- 0041 mkinitd-suse: remove --hostonly and --hostonly-cmdline
  Should be set via configuration files, not in the script itself.
- 0051 mkinitrd-suse: add 'update bootloader' message
- 0120 mkinitrd-suse.sh: Bail out with exit 1 if initrd cannot be generated
  bnc#886630

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01:00
Harald Hoyer
1f8abe81a9 dmsquash-live: setup the images in /run/initramfs
We want to cleanup / after switch_root. Placing the loop files in /
works, but it is more sane to put them in /run/initramfs
2014-12-16 12:53:18 +01:00
Harald Hoyer
25b987fed6 Fixed the dracut-shutdown.service
Make the service a oneshot service, which remains after exit. This
ensures, that the ExecStop is executed later on, if a shutdown occurs.
2014-12-08 11:32:26 +01:00
Harald Hoyer
414dc51ca2 dracut.conf.d/fedora.conf.example: turn on early_microcode 2014-12-04 11:54:47 +01:00
Tom Gundersen
ca4108b78e initrd-release: move from /etc to /usr/lib
This mimicks the similar move of os-release which was done in systemd. These
files are not configuration, but part of the OS.

Still symlinks are in place for compatibility, but those should probably be
dropped eventually.
2014-12-01 17:02:16 +01:00
Minfei Huang
c440d302f1 40network: Fix the syntax to correct the judgment sentence
In the judgment sentence, it will print the following warning message,
becasuse of lacking the blank on the left of ']'.

/lib/net-lib.sh: line 110: [: missing `]'

Signed-off-by: Minfei Huang <mhuang@redhat.com>
2014-12-01 17:02:15 +01:00
Harald Hoyer
3ae03005b8 cms/cms-write-ifcfg.sh: turn SUBCHANNELS into lowercase 2014-12-01 15:04:53 +01:00
Harald Hoyer
99d4fd6bb7 do not symlink /var/log to /run/log
some programs e.g. systemd-journald expect a directory in /var/log as
the marker to do some actions. Here journald tries to flush
/run/log/journal to /var/log/journal, if the directory is seen.

/var/log is now a symlink to /run/initramfs/log.
2014-12-01 12:36:20 +01:00
Harald Hoyer
3a04bddeed dracut.sh: add $tmpfilesdir to install files to /usr/lib/tmpfiles.d 2014-12-01 12:34:54 +01:00
Harald Hoyer
fa45d0d9c9 base/init.sh: ignore exclamation mark for kmod static-nodes
newer versions add an exclamation mark for the type, to mark it to be
created on boot only.
2014-12-01 11:50:00 +01:00
Harald Hoyer
3659d64df3 fips: add libfreeblpriv3.so and libfreeblpriv3.chk 2014-11-28 15:32:17 +01:00
Harald Hoyer
370035d561 dmsquash-live: do not abort, if user pressed ESC on checkisomd5
If the user pressed ESC while checkisomd5 runs the media check, it will
exit with "2". Previously that would mean, that the media check was not
successful.
2014-11-25 13:44:54 +01:00
Harald Hoyer
2b2033e561 multipath/multipathd.service: add more Conditions
Do not start multipathd on rd.multipath=0 rd_NO_MULTIPATH and if there
is no multipath.conf.
2014-11-25 13:23:21 +01:00
Hannes Reinecke
78a78e4239 90multipath: install dracut-specific service file
The multipathd package might install a service and a socket
file. Using the original service file from the installed
system without the socket file triggers a bug in systemd,
causing systemd to crash.

As we don't actually need to socket file in the initrd we
should be installing our own service file which does not
reference the socket file at all.

References: bnc#871610

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-11-25 13:21:03 +01:00
Hannes Reinecke
856f8265aa 90multipath: Load device_handler modules early during boot
The device handler modules need to be loaded early during boot
to avoid I/O errors being printed to the system log.

References: bnc#871617

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-11-25 13:21:03 +01:00
Hannes Reinecke
cf864c1b80 90multipath: Install libgcc_s library
multipathd is using pthreads, which require libgcc_s for
pthread_cancel to work. Without it multipathd might crash
with SIGABRT.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-11-25 13:21:02 +01:00
Harald Hoyer
26d14fb3d3 dracut-functions.sh: check if dinfo is a function
If "dinfo" is an executable, dracut-logger.sh would never be sourced.

See: https://bugzilla.redhat.com/show_bug.cgi?id=1167082
2014-11-24 15:17:45 +01:00
Harald Hoyer
e1e4ee9d7c TODO: update 2014-11-20 16:22:51 +01:00
Harald Hoyer
778b354360 multipath: add "rd.multipath=0" option 2014-11-20 11:27:40 +01:00
Colin Guthrie
af67d62151 base: Set udevd log level via environment var to cover early startup.
udevd will these days default to 'info' logging and thus will
often print out the 'starting version nnn' message (which is
logged at level 'info'), thus spamming the console, even on
'quiet' boots.

We generally expect a udev log level of err (the old default
from pre-October 2013) so we should set that explicilty before
launching udevd in order to suppress the spurious 'info' message.

As we are using the environment variable approach anyway, we
may as well use this method rather than setting the log level
later via udevadm control commands when rd.udev.info/debug are
given on the kernel command line.

The enviroment variable has been around since udev 6b493a20e1
around 2005 so should be safe to use in all cases without version
checks.
2014-11-12 13:25:27 +01:00
Harald Hoyer
027565d023 systemd: add 90-vconsole.rules
run systemd-vconsole-setup if fbcon device shows up
2014-11-06 10:44:33 +01:00
Harald Hoyer
66fd7e4329 dracut.sh: don't check gzip for --rsyncable, if pigz is available 2014-10-29 14:18:34 +01:00
Minfei Huang
56d2aed1c8 40network: Copy the customize dhcp config
It is not available to valid the customize dhcp config
/etc/dhclient.conf in the initram environment.

Dracut uses the default follow config to construct the initramfs.

request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, domain-search, host-name,
        root-path, interface-mtu;

Copy the customize config to make the config availably in the
initram environment.

Signed-off-by: Minfei Huang <mhuang@redhat.com>
2014-10-29 14:13:50 +01:00
Peter Robinson
27dcc3a583 kernel-modules: Drop explicit modules that are found with block_module_filter
The usb_storage, nvme and sdhci_acpi modules are discovered with the
block_module_filter so there's no need to explicitly list them here.

Signed-off-by: <pbrobinson@gmail.com>
2014-10-29 14:13:49 +01:00
Harald Hoyer
5cac9e14ec shutdown.sh: correct return code of _check_shutdown()
fix commit b09faad877, which reversed the return code
2014-10-29 13:56:55 +01:00
Harald Hoyer
d9935e4664 Merge pull request #30 from vtolstov/master
fix gzip compress then it not supports rsyncable option
2014-10-29 13:53:40 +01:00
Vasiliy Tolstov
f95b78f3eb Merge branch 'master' of github.com:haraldh/dracut 2014-10-29 15:56:00 +03:00
Harald Hoyer
84125ddae1 Merge pull request #28 from l1k/master
shutdown/shutdown.sh: loop over shutdown hooks until all succeed
2014-10-29 13:42:25 +01:00
Harald Hoyer
2f0f1b0bbc dracut-functions.sh: fixup for 34a1ec6 for non-local mode 2014-10-29 13:39:28 +01:00
Harald Hoyer
34a1ec6a36 Merge pull request #29 from Quarky9/master
Fix location of dracut-install for local mode
2014-10-29 13:37:15 +01:00
Stefan Reimer
972d6b44ba Fix location of dracut-install for local mode 2014-10-28 17:58:56 -07:00
Harald Hoyer
3947f07d93 ifcfg/write-ifcfg: only write DEVICE for non-kernel names
Rename an interface to the kernel namespace is not allowed, so don't add
DEVICE="<iface>", if HWADDR is given.
2014-10-28 15:13:35 +01:00
Vasiliy Tolstov
3c90cc2f48 fix gzip compress then it not supports rsyncable option
dracut fail to create initramfs when compressor gzip and
it not have rsyncable option

Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
2014-10-27 13:43:13 +03:00
Harald Hoyer
1c08ad507b NEWS: add 040 entry 2014-10-24 14:41:29 +02:00
Harald Hoyer
ab2f95e45e dracut: fixed module dependency handling
Fail for "--modules" and "--force-add" dracut modules, if they or their
dependencies cannot be included.
2014-10-24 13:19:58 +02:00
Harald Hoyer
eda73c0ad2 test: add "fs-lib" to dracut module list 2014-10-24 13:19:34 +02:00
Harald Hoyer
f44b084660 TEST-99-RPM: ignore more files 2014-10-24 13:18:35 +02:00
Harald Hoyer
cfd51d2be2 TEST-30-ISCSI: udev does not export path_id for iscsi
therefore root=iscsi.... does not work anymore :-/

disabled for now
2014-10-24 13:17:30 +02:00
Harald Hoyer
d829e7fce2 dmsquash-live: addresss the device via it's symlink
Otherwise multipath parts might be passed, before it's assembled.

https://bugzilla.redhat.com/show_bug.cgi?id=1152948
2014-10-24 11:16:26 +02:00
Lukas Wunner
b09faad877 shutdown/shutdown.sh: loop over shutdown hooks until all succeed
Up until now, _check_shutdown() returns true if at least one of
the shutdown hooks succeeded. Change this to only return true if
*all* succeeded. To prevent an infinite loop, introduce an upper
bound of 40 iterations.
2014-10-06 13:43:58 +02:00
98 changed files with 1106 additions and 433 deletions

View File

@@ -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
View File

@@ -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>

View File

@@ -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
View File

@@ -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

View File

@@ -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
View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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
View File

@@ -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 ***"

View 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]]

View File

@@ -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 dont want to clutter the system log.
**--force**::
overwrite existing initramfs file.
**--help**::
print a help message and exit.

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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
}

View File

@@ -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

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -11,3 +11,4 @@ StandardInput=tty-force
StandardOutput=inherit
StandardError=inherit
TimeoutSec=0
SuccessExitStatus=2

View File

@@ -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:}"
;;

View File

@@ -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 )

View File

@@ -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

View File

@@ -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
}

View File

@@ -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

View File

@@ -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
}

View 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

View File

@@ -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

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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"

View 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

View File

@@ -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
}

View File

@@ -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

View File

@@ -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"

View File

@@ -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"

View File

@@ -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

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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 \

View File

@@ -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]

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,3 @@
d /run/initramfs 0755 root root -
d /run/initramfs/log 0755 root root -
L /var/log - - - - ../run/initramfs/log

View File

@@ -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

View File

@@ -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
{

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"'

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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"

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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
}

View File

@@ -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

View File

@@ -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
}

View File

@@ -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

View File

@@ -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
}

View File

@@ -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

View File

@@ -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
}

View File

@@ -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

View File

@@ -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
}

View File

@@ -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

View File

@@ -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
}

View File

@@ -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

View File

@@ -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

View File

@@ -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
}

View File

@@ -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

View File

@@ -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
}

View File

@@ -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/* && \

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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

View File

@@ -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
}

View File

@@ -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)/*" \