Compare commits

...

2499 Commits
038 ... master

Author SHA1 Message Date
Harald Hoyer 631d5f72a2 docs: update NEWS.md and AUTHORS
Signed-off-by: Harald Hoyer <harald@profian.com>
2022-02-18 12:32:53 +01:00
David Disseldorp acc629abb0 fix(cpio): correct dev_t -> rmajor/rminor mapping
dev_t -> major/minor number mapping is more complicated than the
incorrect major=(dev_t >> 8) minor=(dev_t & 0xff) mapping that we
currently perform. Fix mapping to match Linux / glibc behaviour.

Fixes: https://github.com/dracutdevs/dracut/issues/1695
Reported-by: Ethan Wu <ethanwu10@gmail.com>
Signed-off-by: David Disseldorp <ddiss@suse.de>
2022-02-17 19:28:33 +00:00
David Disseldorp 8bd7ddf819 ci(cpio): add test_archive_dev_maj_min
This tests dracut-cpio's handling of rmajor / rminor values compared to
GNU cpio. The test requires root, due to mknod invocation for block
device node creation.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2022-02-17 19:28:33 +00:00
David Disseldorp 80e70f76d9 ci(cpio): add TempWorkDir.create_tmp_mknod helper
This will be used for future device major/minor testing. Convert the
current fifo test to use it.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2022-02-17 19:28:33 +00:00
Thomas Blume 5de6e4d56e fix(dasd_rules): correct udev dasd rules parsing 2022-02-12 08:19:07 +00:00
Thomas Blume 5925266832 fix(zfcp_rules): correct udev zfcp rules parsing 2022-02-12 08:19:07 +00:00
Jóhann B. Guðmundsson dcaff88ac9 feat(pcsc): introducing the pcsc module 2022-02-08 04:36:00 +00:00
Antonio Alvarez Feijoo d03fb675d8 fix(bluetooth): make hostonly configuration files optional
Do not fail if any of the expected configuration files don't exist.
2022-02-05 19:52:26 +00:00
Jóhann B. Guðmundsson 34b1dd2e26 fix(bluetooth): dbus configuration path fixes
Add a missing /usr/share path ( fixes #1627 )
Use variable instead of hard path
2022-02-05 19:49:16 +00:00
Henrik Gombos 51ce8893d9 fix(img-lib): install rmdir
rmdir is used in img-lib module.
2022-02-05 13:02:23 +00:00
Jóhann B. Guðmundsson 4753738b62 fix(fido2): add a missing library 2022-02-05 11:49:40 +00:00
Jóhann B. Guðmundsson c656b612b1 fix(tpm2-tss): add a missing library 2022-02-05 11:49:40 +00:00
Martin Wilck d754e1c6f0 fix(dracut-functions.sh): ip route parsing
The code for determining local interface and address works
only for peers that are reachable in a single hop.

This is parsed correctly:
192.168.110.1 dev br0 src 192.168.110.160 uid 0 \    cache

But this isn't:
192.168.1.4 via 192.168.110.1 dev br0 src 192.168.110.160 uid 0 \    cache

Fix it.

Fixes: ceca74cc ("dracut-functions: add ip_params_for_remote_addr() helper")
2022-02-04 18:35:33 +00:00
Antonio Alvarez Feijoo 9371dcaba3 fix(fedora.conf.example): rename misspelled variable
There is a typo in the dbussystemconfdir variable.
2022-02-04 13:27:31 +01:00
Renaud Métrich 22a80629b4 fix(dracut): be more robust when using 'set -u'
From bash manpage, FUNCNAME exists only inside functions. When in debug
mode, make sure to use an empty default value as FUNCNAME[0] when
outside of functions.

With bash4 this wasn't an issue, but is with bash5 with hardening option
'set -u' used, as shown in the example below:

Incorrect:

$ bash -u -c 'echo -n ${FUNCNAME[0]}'
bash: line 1: FUNCNAME[0]: unbound variable
$

Correct:

$ bash -u -c 'echo -n ${FUNCNAME[0]-}'
$

This hardening enables sourcing dracut-lib.sh from external utilities
executing in the initramfs such as clevis-luks-askpass, which uses
hardening option 'set -u' internally.
(see Clevis PR https://github.com/latchset/clevis/pull/340)

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
2022-02-04 12:24:22 +00:00
Jóhann B. Guðmundsson c5907f82d8 feat(pkcs11): include the module in the spec file
Adding the module to the spec file
2022-02-02 23:14:00 +00:00
Jóhann B. Guðmundsson 83ea8cf001 feat(pkcs11): introducing the pkcs11 module
This module allows unlocking of an encrypted filesystem using pkcs11.
2022-02-02 23:14:00 +00:00
Jóhann B. Guðmundsson 56f4fb6cb7 feat(crypt): check if pkcs11 module is needed in hostonly mode
In hostonly mode, include the pkcs11 module if any encrypted volumes
are configured to be decrypted using pkcs11.
2022-02-02 23:14:00 +00:00
Antonio Alvarez Feijoo 857b17f090 fix(fips): missing sourcing of dracut-lib
Make sure dracut-lib is sourced inside the fips-noboot script.
2022-02-02 23:02:03 +00:00
Antonio Alvarez Feijoo e8121bfddd fix(fips): add and remove local variables 2022-02-02 23:02:03 +00:00
Antonio Alvarez Feijoo 7f10c483b6 fix(fips): wrong error message
When /dev/urandom cannot be created, the error message displays /dev/random instead.
2022-02-02 23:02:03 +00:00
Lubomir Rintel bc4f196f98 fix(dracut-init): unbreak a comment
A dreadful copy & paste or kill-ring-save & yank error, most surely.
2022-02-02 23:00:48 +00:00
Kairui Song 67fc670a88 feat(dracut.sh): add --aggresive-strip option
Dracut currently calls `eu-strip` or `strip` with -g, which only strips
out .debug_* sections. symtab and strtab are kept, but are not required
for runtime, and people will rarely need to do binary level debugging
work in initramfs.

So introduce a --aggresive-strip options, try strip out all sections
that are not required for runtime. This can help reduce the binary size
by a lot.

For example, the size of libc.so is reduced by a lot when stripped
with no option than with -g.

    3014184 libc-2.28.orig.so
    2970920 libc-2.28.strip-g.so
    1460904 libc-2.28.strip.so

Signed-off-by: Kairui Song <kasong@tencent.com>
2022-02-02 22:59:27 +00:00
Antonio Alvarez Feijoo 22e683077a fix(network): wrong test of wicked unit
The test for the wicked service is never met because it
does not have execute permission.
2022-02-02 22:56:23 +00:00
Antonio Alvarez Feijoo e86397de24 fix(dracut-initramfs-restore.sh): add missing compression options
The unpack fails if the initrd is not compressed or compressed with
bzip2 or LZO.

Fix issue #1463
2022-02-02 22:55:49 +00:00
Renaud Métrich 7ab1d00227 fix(dracut-shutdown): add cleanup handler on failure
It may happen that dracut-shutdown.service fails, for example on timeout
due to very low bandwidth.
In such case, for hardening purposes, a new dracut-shutdown-onfailure.service
unit doing dracut-shutdown.service cleanup needs to execute to make sure
switching root to an incomplete initramfs won't occur later.

See also RHBZ #1924587 (https://bugzilla.redhat.com/show_bug.cgi?id=1924587).
2022-02-02 22:53:31 +00:00
Thomas Blume d40c49a8df fix(zfcp_rules): remove collect based udev rule creators
The collect binary has been removed, so the rules are broken
2022-02-02 22:52:19 +00:00
Thomas Blume ebafbd8241 fix(dasd_rules): remove collect based udev rule creators
The collect binary has been removed, so the rules are broken
2022-02-02 22:52:19 +00:00
Kairui Song 35822f3997 fix(memstrack): drop bash runtime requirement
Use nohup instead of disown, and let systemd track the service properly.
This makes the scripts POSIX compatible and bash is no longer needed.

Signed-off-by: Kairui Song <kasong@tencent.com>
2022-02-02 22:51:54 +00:00
Dirk Müller b3d2dcb71e fix(kernel-modules-extra): handle zstd module extension
The regular expression here is trying to handle various kernel
module compression schemas and was missing the zst extension
which indicates use of zstd.
2022-02-02 22:50:41 +00:00
Adrien Thierry 0e80ff72e0 fix(kernel-modules): add mailbox drivers for arm
Mailbox drivers might be needed by some of the devices used in the
initrd. For example, on the Raspberry Pi 4, the MMC 'sdhci-iproc' driver
depends on 'bcm2835-mailbox'.

Signed-off-by: Adrien Thierry <athierry@redhat.com>
2022-02-02 22:48:59 +00:00
David Teigland 164e5ebb11 fix(lvm): restore setting LVM_MD_PV_ACTIVATED
The 69-dm-lvm-metad.rules udev rule has been removed from
the initrd, because it's been dropped by recent upstream
lvm versions, and it never performed any primary function
within the initrd.  But, it did have the job of setting
LVM_MD_PV_ACTIVATED=1 for active md devices used by PVs.
That step needs to be restored, and is now included in
64-lvm.rules.
2022-02-02 22:48:13 +00:00
David Teigland 1af4674319 feat(lvm): only run lvchange for LV that is seen on devices
Change the command listing LVs from lvscan to lvs, and list
only the LV names that are being activated.  Before attempting
to activate an LV, check that that LV name appears in the
lvs command output.  This avoids wasting time running an
lvchange command that we know will fail.
2022-02-02 22:48:13 +00:00
David Teigland 7ffc5e388b feat(lvm): use generated filter when none is set
Previously, the lvm device filter generated by dracut
would not be used if any lvm.conf file existed in the
initrd.  Change this so that the generated filter will
be used when the included lvm.conf has no filter set.
2022-02-02 22:48:13 +00:00
David Teigland c0a54f2993 feat(lvm): update lvm command options
Drop checking for options that have been available for
at least ten years.  This simplifies code maintenance.

Add the new --nohints option (when available) to disable
the use of hints which is not useful during startup.
2022-02-02 22:48:13 +00:00
David Teigland 97543cca48 fix(lvm): replace --partial option
The --partial option will activate a linear (or other) LV
without segments for missing devices, which is unlikely to
be useful. The intention was to activate raid LVs in a useful
form while missing devices, which is specified with the option
--activationmode degraded.
2022-02-02 22:48:13 +00:00
David Teigland 50e7466843 revert(lvm): remove 69-dm-lvm-metad.rules
This udev rule runs pvscan to autoactivate VGs, which dracut
does not want to do, and previously disabled by editing the
rule file and commenting out lines.

This also stops /dev/disk/by-id/lvm-pv-uuid-* symlinks from
being created in the initrd.
2022-02-02 22:48:13 +00:00
David Teigland f6f393f550 revert(lvm): remove lvmetad config changes
Remove support for modifying use_lvmetad and locking_type
settings in lvm.conf for lvm versions 2.2.*.  Recent lvm
versions (2.3.*) do not include lvmetad or locking_type.
This cleanup simplifies code maintenance.

To use the lvm module with older versions (2.2), a user
would need to ensure that lvmetad settings are disabled
in the initrd's lvm.conf rather than relying on the lvm
dracut mode to modify their lvm.conf.
2022-02-02 22:48:13 +00:00
David Teigland 1549d5e898 revert(lvm): remove snapshot feature
The feature of managing lvm snapshots has no known
recent usage.  It is unknown if it works.  The lvm
developers do not wish to maintain or support it.
2022-02-02 22:48:13 +00:00
Martin Wilck 4318533e14 fix(multipath): check if mpathconf is available
Not all distributions utilize and ship the mpathconf utilitiy.
Avoid error messages and systemd complaints about
multipathd-configure.service in this case.
2022-02-02 22:47:25 +00:00
Martin Wilck 6246da400f fix(multipathd.service): drop dependencies on iscsi and iscsid
These dependencies are redundant and will be dropped in upstream
multipath-tools, too.
2022-02-02 22:47:25 +00:00
Martin Wilck a247d2bc0d fix(multipathd.service): adapt to upstream multipath-tools unit file
In the long run, it's desirable to be able to drop dracut's copy of
multipathd.service and use the upstream one from multipath-tools instead.
This patch makes a step in that direction.

With these changes, the only remaining difference is the support for
rd.multipath=0 and rd_NO_MULTIPATH, which must obviously be ignored in the
upstream unit.

The modifications in this patch are minor and will have no effect in the
initramfs.
2022-02-02 22:47:25 +00:00
Martin Wilck 371b338a5f fix(multipathd.service): remove dependency on systemd-udev-settle
The dependency of multipathd on "udev settle" has recently been removed in
c9689b6 ("multipathd: Remove dependency on systemd-udev-settle.service").

But this dependency has never been necessary in the initramfs environment. It
was only required after switching root, because multipathd would potentially
tear down valid multipath maps after switching from initrd to root FS. This can
happen because dm devices "survive" the root FS switch in the udev data
base (they have the "db_persist" flag set), whereas their component devices
(SCSI etc) do not. But this can only happen after initrd-udevadm-cleanup-db.service
has been run, which happens after initrd processing.

The only dependency that's really needed is that on
systemd-udevd-kernel.socket, because multipathd depends on uevents for
devices being delivered via systemd-udevd.
2022-02-02 22:47:25 +00:00
Martin Wilck 3f2c76bb14 fix(40network): consistent use of "$gw" for gateway
Replace wrong use of $gateway with $gw.

Signed-off-by: Martin Wilck <mwilck@suse.com>
2022-02-02 22:40:07 +00:00
Tony Asleson fe8df0240a feat(spec): add systemd-integritysetup module
Signed-off-by: Tony Asleson <tasleson@redhat.com>
2022-01-14 14:17:18 +00:00
Tony Asleson 33cf47a608 feat(systemd-integritysetup): introducing the systemd-integritysetup module
Module to allow root FS to be a dm-integrity volume.  Utilizes
functionality added with: https://github.com/systemd/systemd/pull/20902

Information on dm-integrity:
https://www.kernel.org/doc/html/latest/admin-guide/device-mapper/dm-integrity.html

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2022-01-14 14:17:18 +00:00
joshuacov1 4e85874108 fix(base): do not change the provided UUID
During boot dracut parses the provided UUID to lower case and thus starts an
endless loop wating for the devise to appear. The device is actually mapped
correctly by the kernel (which doesn't tweak the UUID) but because we are
waiting for a name with lower charachters the expeted device never appers which
drops us at the emergency shell leaving the system unbootable.
This happens especially on nfts/fat filesystems because technically those don't
have a UUID but searial numbers which are used by the linux tools as UUID.
2022-01-09 18:23:11 +00:00
Laszlo Gombos 813577e2ba fix(dmsquash-live): option to use overlayfs on a block device root
An example kernel command line option for this configuration
root=/dev/sda1 ro rd.live.image rd.live.overlay.overlayfs=1

The change checks if $FSIMG is empty and adds a symlink from
/run/rootfsbase to /run/initramfs/live and changes the place
of the creation of the required mount point directories.
2021-12-11 11:05:02 -05:00
Antonio Alvarez Feijoo 7de9ffc057 fix(dracut.sh): do not ignore invalid config file or dir path
Fix issue #1136
2021-12-11 15:58:50 +00:00
Jóhann B. Guðmundsson 3d8e1ad2ae fix(dracut-initramfs-restore.sh): add missing default paths
Adding missing default paths.
Fixes #1628
2021-12-11 10:58:18 -05:00
Antonio Alvarez Feijoo d3b5bc17eb fix(network-wicked): multiple path corrections
Since wicked-0.6.67, its dbus configuration files can be installed in /etc or /usr/share.

Also, check if it's using libexec or lib instead of displaying always an error.
2021-12-11 14:32:49 +00:00
David Disseldorp 0af11c5ea5 fix(cpio): write zeros instead of seek for padding and alignment
This is a workaround for GRUB2's Btrfs implementation, which doesn't
correctly handle gaps between extents.

A fix has already been proposed upstream via
https://lists.gnu.org/archive/html/grub-devel/2021-10/msg00206.html

Given that this bug is severe, it makes sense to include this minimal
workaround.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-12-10 08:06:40 -05:00
Laszlo Gombos 3326e4c957 fix(rootfs-block): make the base module dependency explicit
When dracut.sh is called with "--modules rootfs-block",
make sure dracut-lib.sh is installed by making the base module an
explicit dependency.
2021-12-10 08:01:02 -05:00
Cornelius Hoffmann fec93bb221 fix(systemd-sysusers): use split systemd sysuser configs
Fixes the regression introduced by https://github.com/systemd/systemd/pull/20056
As discussed in #1656 and #1657
2021-12-10 12:59:09 +00:00
Cornelius Hoffmann dcbe23c14d fix(systemd-sysusers): override systemd-sysusers.service
Fixes a regression with systemd not running units with ConditionNeedsUpdate set in initrds
2021-12-10 12:58:35 +00:00
Antonio Alvarez Feijoo e3bb1815bb fix(url-lib): improve ca-bundle detection
The current detection routine for openssl-based libcurl assumes that
libcurl has its own hardcoded path to the ca-bundle. Fix the
cases where curl is compiled with:

  --with-ca-fallback --without-ca-path --without-ca-bundle

In this case, we must also grep in OpenSSLs libcrypto.

Other changes:
  - Filter reported but non-existant paths.
  - Strip nul bytes returned by grep.
  - Consider that ca-bundles might use '.pem' instead of '.crt'.

Original-patch-by: Daniel Molkentin <daniel.molkentin@suse.com>
2021-12-10 12:56:14 +00:00
Glenn Morris d9c3c77437 fix(network-manager): skip non-directories in /sys/class/net
There can be files in this directory, eg "bonding_masters" if a
network bond is in use.
2021-12-10 12:54:32 +00:00
Hans de Goede 14d97a6a28 fix(drm): add privacy screen modules to the initrd
Starting with kernel 5.17 the kernel supports the builtin privacy screens
built into the LCD panel of some new laptop models.

This means that the drm drivers will now return -EPROBE_DEFER from their
probe() method on models with a builtin privacy screen when the privacy
screen provider driver has not been loaded yet.

Make dracut add the privacy screen providing drivers to the initrd
(when necessary for hostmode=yes), so that drm drivers on affected
drivers can probe() successfully.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-12-10 12:40:17 +00:00
Martin Wilck 475497b1bd fix(dracut.sh): check kernel zstd support early
Rather than checking late and falling back to "cat" if the kernel
doesn't support zstd decompression, do this early, and use the
fallback code path.
2021-11-26 17:01:45 +00:00
Martin Wilck bdac657bf6 fix(dracut.sh): check availability of configured compression
If the configured compression command is unavailable, reset $compress,
and fall back to auto-detection. This allows building an initramfs
even if the configured compression command is not installed. This can
happen e.g. if the distribution uses a preconfigured default, but the
user deinstalled the respective tool.
2021-11-26 17:01:45 +00:00
Martin Wilck 06d47ded67 fix(dracut.sh): inform user about auto-selected compression method
If the compression method is unset, or had to be reset because of
missing dependencies, inform the user what's being used. Also,
replace the printf in the "cat" case with a dwarn.
2021-11-26 17:01:45 +00:00
Martin Wilck 586d3e7664 fix(dracut.sh): drop pointless check for module compression method
There's no need to decompress the kernel modules in dracut, and
"$kcompress" is never referenced. dracut can build the initramfs
just fine if there's no tool for decompressing modules.
2021-11-26 17:01:45 +00:00
Pavel Valena 7938935267 fix(network): add errors and warnings when network interface does not exist
End with error, or show a warning when nonexistent device is specified for network setup like
`ip=10.12.8.12::10.12.255.254:255.255.0.0:xk12:eth0:off`.

I've added the error only for `write-ifcfg.sh`, as I think no such setup should be written.

Resolves: #1712424
2021-11-25 08:58:37 +00:00
Jóhann B. Guðmundsson 5b18b06c7d ci: remove Fedora 33 container
Fedora 33 is scheduled to reach end-of-life (EOL) on 2021-11-30.
No new dracut releases should be ending up in that Fedora release at this point.
2021-11-25 09:23:58 +01:00
José María Fernández c459373448 fix(resume): resume using /usr/lib64/suspend
Now resume binary is detected in case it is at
/usr/lib64/suspend (like it happens in Gentoo).
2021-11-24 12:17:27 +00:00
José María Fernández e8c18c9f7f fix(base): add default device choice
when the device is no one of the previous patterns,
substitute the empty default by the input,
to return the same input
2021-11-24 12:17:27 +00:00
Antonio Alvarez Feijoo d5fd030cc2 feat(crypt): check if fido2 module is needed in hostonly mode
In hostonly mode, include the fido2 module if any encrypted volumes
are configured to be decrypted using a FIDO2 security token.
2021-11-24 12:15:42 +00:00
Antonio Alvarez Feijoo dc3b976f33 fix(dracut-functions.sh): get block device driver if in a virtual subsystem
dracut does not install the kernel module of the block device that contains
the root filesystem if the following preconditions are met:
- Running in host-only mode.
- Symlinks of all block devices needed to boot the system pointing to virtual
subsystems.

The get_dev_module function uses "udevadm info -a" to get the corresponding
kernel modules of a /sys/class/*/* or /dev/* device. This function is called
in modules.d/90kernel-modules/module-setup.sh to detect if dracut must install
block device drivers in host-only mode. The symlinks in /sys/dev/block/
usually point to "real" devices in /sys/devices/pci*. But, we have come across
some NVMe systems where the kernel creates the symlinks in /sys/dev/block/
pointing to "virtual" devices instead. In this case, udevadm never finds any
"driver" attributes following up the chain of parent devices.
2021-11-24 11:15:25 +01:00
Alexander Wenzel d364ce8334 fix(mdraid): allow UUID comparison for more than one UUID
If the system provides more than one UUID, the _MD_UUID var
contains a line break after each UUID. Therefore the strstr
function could not find any UUID, caused by the additional
spaces provided to the function.

Furthermore this could lead to a boot interruption, because
the start of a degraded raid1 won't be executed. So, manual
interaction is necessary.
2021-11-24 11:15:11 +01:00
David Disseldorp 8104bf0e83 ci(TEST-63-DRACUT-CPIO): kernel extraction tests for dracut-cpio
dracut-cpio already carries a bunch of unit tests covering compression
and GNU cpio extraction. The purpose of these tests is to exercise the
dracut.sh --enhanced-cpio code-paths as well as kernel cpio archive
extraction.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-11-24 11:14:54 +01:00
David Disseldorp afe4a6dbb7 feat(dracut.sh): add "--enhanced-cpio" option for calling dracut-cpio
The new dracut-cpio binary is capable of performing copy-on-write
optimized initramfs archive creation, but due to the rust dependency
isn't built / installed by default.
This change adds a new "--enhanced-cpio" parameter for dracut which
sees dracut-cpio called for archive creation instead of GNU cpio.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-11-24 11:14:54 +01:00
David Disseldorp 51d21c6b37 feat(Makefile): cargo wrapper for dracut-cpio build
If configured with --enable-dracut-cpio, call cargo to build the
dracut-cpio release binary.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-11-24 11:14:54 +01:00
David Disseldorp a9c6704643 feat(cpio): add newc archive creation utility
dracut-cpio is a minimal cpio archive creation utility written in Rust.
It provides support for a minimal set of features needed to create
performant and space-efficient initramfs archives:
- "newc" archive format only
- reproducible; inode numbers, uid/gid and mtime can be explicitly set
- data segment copy-on-write reflinks
  + using Rust io::copy()'s native copy_file_range() support[1]
  + optional archive data segment alignment for optimal reflink use[2]
- hardlink support
- comprehensive tests asserting GNU cpio binary output compatibility

1. Rust io::copy() copy_file_range()
   https://github.com/rust-lang/rust/pull/75272

2. Data segment alignment
   We're bending the newc spec a bit to inject zeros after the file path
   to provide data segment alignment. These zeros are accounted for in
   the namesize, but some applications may only expect a single
   zero-terminator (and 4 byte alignment). GNU cpio and Linux initramfs
   handle this fine as long as PATH_MAX isn't exceeded.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-11-24 11:14:54 +01:00
David Disseldorp 94fc50262f feat(cpio): add rust argument parsing library from crosvm
Crosvm's rust argument library is very small and simple, while still
providing helpful functionality. It will be consumed by dracut-cpio in a
subsequent commit.

The unmodified, BSD licensed argument.rs source is lifted as-is from
https://chromium.googlesource.com/chromiumos/platform/crosvm
(release-R92-13982.B b6ae6517aeef9ae1e3a39c55b52f9ac6de8edb31).
The one-line crosvm.rs wrapper is needed to ensure that crosvm::argument
imports continue to work.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-11-24 11:14:54 +01:00
David Disseldorp 3a0f423309 ci(TEST-62-SKIPCPIO): add simple skipcpio test
Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-11-24 11:14:54 +01:00
David Disseldorp 86bba3d4d4 ci(test): export basedir and testdir as absolute paths
Individual test scripts may change working directory, so relative paths
should be avoided.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-11-24 11:14:54 +01:00
David Disseldorp 1c3f79fb0a ci(TEST-60-BONDBRIDGEVLANIFCFG): use toplevel Makefile
Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-11-24 11:14:54 +01:00
Brandon Sloane 5789abcbe0 fix(fips.sh): repsect rd.fips.skipkernel
Support for this flag was broken in 4257798f8a
2021-11-24 11:14:39 +01:00
Dan Horák 0b97790626 fix(resume): check for presence of /sys/power/resume
On platforms where the kernel is built without suspend/resume support we
see "cat: /sys/power/resume: No such file or directory" message when
creating an initrd image. Check for the presence of /sys/power/resume
first before reading it.

Signed-off-by: Dan Horák <dan@danny.cz>
2021-11-24 09:56:27 +00:00
Alexander Wenzel 4855242ce5 fix(man): default value of rd.retry was increased to 180 seconds
The man page still states the old value of 30 seconds,
which does not reflect the current situation of 180 seconds.
2021-11-24 09:55:51 +00:00
Antonio Alvarez Feijoo 049973b708 feat(fido2): introducing the fido2 module
This module allows to unlock an encrypted filesystem using a FIDO2
security token.
2021-11-24 09:54:44 +00:00
Antonio Alvarez Feijoo 5d990a004b feat(crypt): check if tpm2-tss module is needed in hostonly mode
In hostonly mode, include the tpm2-tss module if any encrypted volumes
are configured to be decrypted using the TPM2 device.
2021-11-24 06:49:39 +00:00
Laszlo Gombos bf8738d31c fix(dmsquash-live): do not install systemd files when systemd is not enabled
Systemd is an optional module for the dmsquash-live module. This scenario
is properly handled for other modules (for example livenet module) but not
for dmsquash-live module.
2021-11-23 05:53:33 +00:00
Thomas Blume f905c3a72c fix(s390_rules): drop collect installation
/usr/lib/udev/collect has been removed from udev-v246, so remove it
from the initrd too
2021-11-22 18:09:55 +00:00
Laszlo Gombos 75ad269931 fix(dmsquash-live-ntfs): fuse3 no longer requires ulockmgr_server
fuse3 no longer includes ulockmgr_server.
https://github.com/libfuse/libfuse/blob/master/ChangeLog.rst#libfuse-300-2016-12-08
2021-11-22 09:40:05 +00:00
Renaud Métrich b9ba3c8bb8 fix(shutdown): be robust against forced shutdown
When a forced shutdown is issued through sending a burst of Ctrl-Alt-Del
keys, systemd sends SIGTERM to all processes. This ends up killing
dracut-initramfs-restore as well, preventing the script from detecting
that the unpack of the initramfs is incomplete, which later causes a
crash to happen when "shutdown" tries to execute from the unpacked
initramfs.

This fix makes sure dracut-initramfs-restore remains alive to detect
the unpack failed (because cpio was killed by systemd too).

Refs:
 * https://bugzilla.redhat.com/show_bug.cgi?id=2023665
2021-11-16 18:29:32 +00:00
Frantisek Sumsal 3f56d481e8 test: don't use `-cpu max` in GH Actions
There appears to be an issue with newer QEMU versions (spotted with Arch
Linux and C9S containers) which causes the respective GH Action to hang
when booting a QEMU VM in combination with the `-cpu max` parameter.

During (a particularly painful) debugging session I once managed to get
some output from such "frozen" machine (using `earlycon` and
`earlyprintk` kernel cmdline options), and in that particular case the
VM died with a trap caused by an invalid opcode.

I couldn't reproduce this locally, only in GH Actions environment with
Arch Linux and C9S containers. Also, so far I haven't found out which
specific CPUID flag causes this, but using the `IvyBridge-v2` feature
set seems to mitigate the issue.
2021-11-15 11:37:22 +00:00
Andrey Sokolov 5c2f72f152 fix(install): segfault on popen error 2021-11-09 07:01:25 +00:00
Peter Robinson 1539845868 fix(90kernel-modules): add isp1760 USB controller
Like the dwc/chipidea controllers the isp1760 can act in either
host or gadget mode so it ends up in it's own directory. Add this
driver into the initrd as it's part of some arm platforms and
is needed to be able to boot off USB storage.

Fixes issue #1619

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2021-10-28 08:52:03 +02:00
Beniamino Galvani f6e6be245d fix(network-manager): disable tty output if the console is not usable
The network-manager module also writes logs to the console, so that it's easier
to debug network-related boot issues. If systemd can't open the console, the
service fails and network doesn't get configured.

Add a check to disable tty output when the console is not present or not
usable.

https://github.com/coreos/fedora-coreos-tracker/issues/943
2021-10-21 13:38:41 +00:00
Beniamino Galvani e07b7ad0e7 fix(network-manager): show output on console only with rd.debug enabled
The module should show the output on console only when initrd debugging is
enabled.
2021-10-21 13:38:41 +00:00
Harald Hoyer 51c06d9fea chore: change my email address
Signed-off-by: Harald Hoyer <harald@profian.com>
2021-10-13 09:07:39 +02:00
Renaud Métrich d502d2a816 feat(systemd): enable support for systemd compiled with ASAN
When systemd is compiled with ASAN library to troubleshoot memory issues
within systemd code, the libasan library expects to have /proc be
available as soon as systemd starts, which isn't the case currently,
causing an assertion to fail, systemd to crash and kernel to panic:

==1==AddressSanitizer CHECK failed: ../../../../libsanitizer/sanitizer_common/sanitizer_procmaps_common.cc:75 "((data_.proc_self_maps.len)) > ((0))" (0x0, 0x0)
    <empty stack>

X.XXXXXXX Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
[...]
2021-10-12 18:52:06 +02:00
David Disseldorp 96f3177c33 refactor(install): use check_hashmap helper consistently
Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-10-12 13:39:17 +00:00
Peter Robinson a1287c627f fix(90kernel-modules): add Type-C USB drivers for generic initrd
We need to pull in Type-C USB drivers as they can provide a number of
differnet bits of functionality in early boot including input, display
(altmode DP) and storage so we need to have them available to ensure
functionality attached to those buses/interfaces are available in early
boot.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2021-10-12 13:29:27 +00:00
Laszlo Gombos e19e38904c fix(dmsquash-live): iso-scan requires rmdir 2021-10-12 13:29:03 +00:00
Harald Hoyer 0c631efb10 fix(dmsquash-live): correct regression introduced with shellcheck changes
`"$opt"` with empty `opt` will give errors for `losetup`.

https://github.com/dracutdevs/dracut/issues/1576

Rename the variable and set the arguments dynamically, if the variable
is set.
2021-10-06 18:08:01 +02:00
David Disseldorp 5c5b73c681 chore(.gitignore): update src and man paths
.gitignore wasn't updated when things were shuffled under src and man
subdirectories.

Signed-off-by: David Disseldorp <ddiss@suse.de>
2021-10-02 06:57:28 +00:00
Luca BRUNO 9491e59928 fix(multipath): drop ExecStop= setting from service unit
This removes the 'ExecStop=' field from `multipathd.service`.
Sometimes CI runs do encounter a failure related to this
service in initrd, which seems to be stemming from a socket
I/O race between the client and the server on shutdown.
It looks like the client (`multipathd shutdown`) can lose the race,
hit an I/O error, and cause the whole unit to fail (even if the server
managed to shutdown properly already).

Notably, the upstream unit does not have such stop command
as the daemon can already perform a graceful exit through
its signal handler.

As such, this commit partially re-aligns the two units,
trying to sidestep any of the existing races.

Refs:
 * https://github.com/coreos/fedora-coreos-tracker/issues/803
 * https://github.com/opensvc/multipath-tools/blob/0.8.7/multipathd/multipathd.service
2021-09-23 09:45:27 +00:00
David Tardon 10ed204f87 fix(install): extend hwcaps library handling to libraries under glibc-hwcaps/ 2021-09-13 12:26:14 +00:00
Antonio Alvarez Feijoo 591118c56d feat(dracut.sh): check if target kernel has zstd support compiled in
If compression option is zstd, check if target kernel supports it.
Otherwise, do not compress the initramfs image.
2021-09-11 06:44:40 +00:00
Antonio Alvarez Feijoo 768dd59ef0 ci(suse.conf.example): change default compression option for SUSE
Due to an internal company decision, SUSE aims to change the default compression
method of the initramfs image to zstd.
2021-09-11 06:44:40 +00:00
Antonio Alvarez Feijoo acfd97a943 fix(dracut.sh): change misspelled variable name 2021-09-09 10:14:27 +00:00
Antonio Alvarez Feijoo f1245b5bc1 fix(dracut.sh): remove wrong $ in loop sequence 2021-09-09 06:43:02 +00:00
Shreenidhi Shedi 3fb8723ce0 fix(skipcpio): calculate and use CPIO_MAGIC_LEN
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-08-27 17:25:35 +00:00
Shreenidhi Shedi f6d16b6bbd fix(skipcpio): improve error checking
Some other minor tweaks

Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-08-27 17:25:35 +00:00
Andre Russ dfbfd33b24 fix(base): tr needs to be installed 2021-08-25 23:58:12 +00:00
Andre Russ a93fbc4ae0 fix(crypt-gpg): tr needs to be installed 2021-08-25 23:58:12 +00:00
Charles Rose 655c65e6ce fix(nvmf): validate_ip_conn
Fix how ifname for a given local_address is found.
Fix logic to detect presence of ifname and route.

Signed-off-by: Charles Rose <charles.rose@dell.com>
2021-08-23 20:20:11 +00:00
Alexander Tsoy 4afdcba212 fix(usrmount): do not empty _dev variable
Currently $_dev is always overridden with the value returned by
label_uuid_to_dev(). This results in an empty value if $_dev is a
device path. Fix this by calling label_uuid_to_dev() conditionally.

Bug: https://bugs.gentoo.org/807971
Fixes: d3532978de
2021-08-17 07:48:15 +00:00
Thomas Blume 7374943ae3 fix(iscsi): add support for the new iscsiadm "no-wait" (-W) command
remove connection timeout for iscsi firmware targets serving system root
2021-08-17 07:47:20 +00:00
Pingfan Liu c86f4d2860 fix(kernel-modules): detect block device's hardware driver
On hostonly mode, the platform driver is not copied blindless. There
should be a way to detect the real hardware driver, which probes a block
device.

/sys/dev/block/major:minor is a symbol link, which points to the real
device, recording the hardware stack. And those info can help to
identify the associated drivers for the hardware stack.

Signed-off-by: Pingfan Liu <piliu@redhat.com>
---
v2 -> v3:
  address shellcheck in dracut-functions.sh
v1 -> v2:
  remove local variable _extra_mod
  shorten subject
2021-08-13 11:36:25 +00:00
Lukas Nykryn b292ce7295 fix(kernel-modules): add blk_mq_alloc_disk and blk_cleanup_disk to blockfuncs
Since kernel 5-14 those are used by many drivers for example:
xen-blkfront, loop, nbd, pd
2021-08-13 11:27:15 +00:00
Beniamino Galvani 38320fce56 fix(network-manager): write DHCP filename option to dhcpopts file
Anaconda parses the 'filename' variable [1] set in /tmp/net.$netif.dhcpopts to
determine the name of the kickstart file to use.

[1] https://github.com/rhinstaller/anaconda/blob/anaconda-35.21-1/dracut/fetch-kickstart-net.sh#L31-L34
2021-08-10 15:16:48 +00:00
Shreenidhi Shedi 55468a2d40 fix(install): use size_t to avoid -Wsign-compare warning
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-08-09 17:11:22 +00:00
Shreenidhi Shedi ef0f848a67 fix(install): improve gettid definition
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-08-09 17:11:22 +00:00
Shreenidhi Shedi 19537f8943 fix(install): validate return values log.c
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-08-09 17:11:22 +00:00
Shreenidhi Shedi b5cf7ec784 fix(install): rectify unused function args in log.c
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-08-09 17:11:22 +00:00
Shreenidhi Shedi e2a61595d2 fix(install): use wrapper for asprintf
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-08-09 17:11:22 +00:00
Kairui Song 5ab18dee99 fix(squash): apply FIPS and libpthread workaround
There are some workarounds in dracut.sh for FIPS/libpthread covering
some hidden lib dependency issues. These workarounds didn't take effect
for the squash loader since the squash loader is installed
independently. So apply these workarounds again.

Also skip the lib detection code, since these extra installed libs
are small, and squash loader contents are dropped after switch root,
won't be an issue to be always installed. And this makes the code
cleaner.

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-08-09 17:08:52 +00:00
Beniamino Galvani 07977ee5c5 fix(cms): reload NetworkManager connections
When NetworkManager is running as systemd service, it's not enough to write
connection files; the module should also tell NetworkManager to reload the
connections from disk so that any new connection can be auto-activated.

https://bugzilla.redhat.com/show_bug.cgi?id=1975929
2021-08-09 17:07:50 +00:00
Beniamino Galvani 5ee7e249b8 fix(network-manager): check for nm-initrd-generator in both /usr/{libexec,lib}
Sice commit 22d6863ef1 ("fix(network-manager): cope with distributions not
using `libexec`") nm-initrd-generator can be installed in either /usr/libexec
or /usr/lib. Change other modules to check for the binary in both locations.
2021-08-09 17:07:50 +00:00
Shreenidhi Shedi 74a4179948 fix(install): use unsigned int instead of unsigned
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-08-07 20:14:03 +00:00
Shreenidhi Shedi b0bf8187d5 fix(install): reduce cppcheck warnings
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-08-07 20:14:03 +00:00
Thomas Haller e509c638e6 fix(network-manager): ensure safe content of /tmp/dhclient."$ifname".dhcpopts
NetworkManager leaves state files behind in "/run/NetworkManager/devices".
These files are in keyfile format (glib's GKeyFile API [1]).

From the statefile, the dracut module writes a .dhcpopts file. And other users
want to parse that file, for example anaconda ([2]). To be fair,
anaconda seems to parse a different file, so I am a bit confused who
uses this file how. In any case, it seems somebody might be tempted to
execute this as a script.

We need to write the .dhcpopts file in a format that is defined and easy
to handle from a shell script. As already previously, this format is
a bash script that sets certain variables. That means, to load the file,
the user could execute it as bash script. But this is dangerous, as the
file contains potentially untrusted data from the network.
Optimally, users still don't trust the .dhcpopts file to be safe for
executing! It would be better if users too try to parse the file
instead of executing it. That is not trivial however because in face
of special characters, as we use bash's `printf '%q'` to escape the values
and parsing bash escaping is not trivial.

Anyway, make sure we properly quote and handle the content so that also
executing is safe. In the best case, there are no special characters
that require escaping, and naive parsing can be done with `sed`.
Otherwise, executing is now also supposed to be safe.

In this case we parse DHCP options from the state file. They are themselves
backslash escaped UTF-8 strings (C escape sequences), which then are stored
via keyfile API. The properly parse them, we would first need to load the file
with GKeyFile (which undoes one level of backslash escaping) and then
use g_str_compress() (to undo the second level). We mimic that with
shell.

[1] b3411d6780/dracut/fetch-kickstart-net.sh (L30)
[2] https://developer.gnome.org/glib/stable/glib-Key-value-file-parser.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
2021-08-07 19:56:07 +00:00
Beniamino Galvani c868feb1b1 docs: add a note about other network modules in 'man dracut.cmdline' 2021-08-06 15:59:29 +02:00
Stefan Berger 9da76af8e7 fix(integrity): add support for loading multiple EVM x509 certs
Add support for loading EVM x509 certs from a directory that the user can
specify with the EVMKEYSDIR variable in the evm config file. By default
the additional certs are loaded from /etc/keys/evm.

Support for multiple EVM keys allows the usage in a system of files with
signed metadata from multiple parties.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Roberto Sassu <roberto.sassu@huawei.com>
2021-08-06 13:58:01 +00:00
Mike Gilbert f649cd10b2 fix(base): do not quote $initargs for switch_root
We want word splitting to occur so that the arguments are passed
separately, and we don't end up passing an empty string if no arguments
are specified.

Bug: https://bugs.gentoo.org/803548
Fixes: 2fabaaa62d
2021-08-06 13:52:19 +00:00
Kairui Song cbd85597e3 fix(squash): remove tailing '/' when installing ld.so.conf.d
This tailing '/' will result in following error:

dracut-install: ERROR: installing '/etc/ld.so.conf.d/'
dracut: FAILED: /usr/lib/dracut/dracut-install -D /var/tmp/dracut.kEFQLs/initramfs -d /etc/ld.so.conf.d/

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-08-06 13:41:23 +00:00
Beniamino Galvani 0e5905315e fix(network-manager): include nm-daemon-helper binary
Since version 1.32, NetworkManager launches a tiny external helper to determine
the hostname via reverse DNS resolution through glibc's nss-dns. Include the
binary.
2021-08-06 13:40:56 +00:00
Zoltán Böszörményi d7acf107f2 fix(base): repair installing dracut-util
inst_binary uses ${dracutsysrootdir} internally to find the source
file.

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
2021-07-23 13:11:17 +00:00
Andreas Schwab 3cc9f1c10c fix(kernel-modules): add more modules on RISC-V
Include the same extra modules for ARM also on RISC-V and add drivers/mmc/host
and drivers/spi to the list.
2021-07-21 15:10:00 +00:00
Zbigniew Jędrzejewski-Szmek a7f5429cb8 fix(dracut-systemd): do not use Requires for vconsole-setup.service
systemd-vconsole-setup.service may fail if the user specifies a missing keymap,
see [1,2,3], or font. This is unfortunate, but the system should not refuse
boot. It is better to continue, possible without the desired font or keymap.
All other systemd services that depend on systemd-vconsole-setup.service do so
without a hard Requires=.

(In particular, systemd-vconsole-setup internally will try to do as much setup
as possible, and will load the font even if it cannot load the keymap and vice
versa.)

[1] https://fedoraproject.org/wiki/Common_F34_bugs#kbd-legacy-media
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1955162
[3] https://bugzilla.redhat.com/show_bug.cgi?id=1955793
2021-07-20 20:53:19 +02:00
Pingfan Liu dc21638c3f fix(squash): keep ld cache under initdir
When running kdump on PowerPC, the following bug is hit:
[    0.391629] Freeing unused kernel memory: 5568K
[    0.391634] This architecture does not have kernel memory protection.
/bin/sh: error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory
[    0.392214] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
[    0.392214]
[    0.392223] CPU: 6 PID: 1 Comm: init Not tainted 4.18.0-319.el8.ppc64le #1
[    0.392228] Call Trace:
[    0.392234] [c00000000c703c10] [c000000008ecb94c] dump_stack+0xb0/0xf4 (unreliable)
[    0.392243] [c00000000c703c50] [c000000008167324] panic+0x148/0x3c4
[    0.392249] [c00000000c703cf0] [c000000008170474] do_exit+0xcd4/0xd40
[    0.392255] [c00000000c703dc0] [c0000000081705b0] do_group_exit+0x60/0x110
[    0.392261] [c00000000c703e00] [c000000008170684] sys_exit_group+0x24/0x30
[    0.392268] [c00000000c703e20] [c00000000800b408] system_call+0x5c/0x70

This is due to the non-conventional library path:
ldd /bin/bash
        linux-vdso64.so.1 (0x00007fffbdc90000)
        libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007fffbda80000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fffbda50000)
        libc.so.6 => /lib64/glibc-hwcaps/power9/libc-2.28.so (0x00007fffbd830000)
                            ^^^
        /lib64/ld64.so.2 (0x00007fffbdcb0000)

ldd finds the path by libc.so.6 -> /usr/lib64/libc.so.6 ->
/usr/lib64/glibc-hwcaps/power9/libc-2.28.so and cache the result. So
when dracut_install, it only saw
'/usr/lib64/glibc-hwcaps/power9/libc-2.28.so' and blind to
'/usr/lib64/libc.so.6'

In the final kdumpimg, the symlink /usr/lib64/libc.so.6 is not created,
hence ld.so can not find the /usr/lib64/glibc-hwcaps/power9/libc-2.28.so

On the other hand, during the process of building kdumpimg, all of dynamic library info
have been cached in ld.so.cache. Hence this bug can be simplely resolved
by keeping ld cache under $initdir/etc.

Signed-off-by: Pingfan Liu <piliu@redhat.com>
---
v3 -> v4:
  use inst() instead of copy
v2 -> v3:
  fix format by shfmt -s -w modules.d/99squash/module-setup.sh
v1 -> v2:
  cp -r /etc/ld.so* instead of move, since after switch-root, initdir
can not be seen any longer
2021-07-20 12:41:58 +00:00
Zoltán Böszörményi 1beeaf3b71 fix(dracut-install): tweaks to get_real_file()
Fix potential memory leaks in two locations and use
_exit(EXIT_FAILURE) if asprintf(&abspath, ...) fails.

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
2021-07-19 19:39:57 +00:00
Coiby Xu 6c71ba4121 fix(qeth_rules): check the existence of /sys/devices/qeth/*/online beforehand
On s390x KVM machines, the follow errors occurred,
    $ kdumpctl rebuild
    kdump: Rebuilding /boot/initramfs-4.18.0-321.el8.s390xkdump.img
    /usr/lib/dracut/modules.d/95qeth_rules/module-setup.sh: line 13: /sys/devices/qeth/*/online: No such file or directory
    /usr/lib/dracut/modules.d/95qeth_rules/module-setup.sh: line 13: /sys/devices/qeth/*/online: No such file or directory

because s390x KVM uses virtual devices and /sys/devices/qeth/*/online
doesn't exist. Eliminate this error by checking the existence
beforehand.
2021-07-14 12:46:23 +00:00
Dusty Mabe a0f12fb6a0 fix(network-manager): don't pull in systemd-udev-settle
We get a nice warning about it being deprecated:

```
systemd-udev-settle.service is deprecated. Please fix nm-initrd.service not to pull it in.
```

The service is deprecated because its purpose was to wait for the
discovery of all hardware, but it didn't guarantee that (see the
systemd-udev-settle man page).

NM now runs as an independent service and can deal with devices showing
up at any point, but it does need udev to be started. For now just
Want/After systemd-udev-trigger.
2021-07-01 10:34:37 +02:00
Masahiro Matsuya ec50cec3bd fix: SC2046: Quote this to prevent word splitting 2021-06-29 22:03:38 +00:00
Masahiro Matsuya acb18869e9 fix: SC2086: Double quote to prevent globbing and word splitting 2021-06-29 22:03:38 +00:00
Masahiro Matsuya 2f091b1707 fix(url-lib): make pre-pivot hook separetely per nfs mount 2021-06-29 22:03:38 +00:00
Tomasz Paweł Gajc f806a628aa fix(mksh): requires printf 2021-06-30 00:01:41 +02:00
LinkTed 6610093698 fix(crypt-gpg): execute --card-status on each try
If the gpg card is not inserted before the --card-status command is
executed then the public key is not linked with the card. Therefore,
the LUKS partition cannot be decrypted. To solve this, the
--card--status command is executed on each try.
2021-06-29 22:00:03 +00:00
Kairui Song c7fbc0c890 fix(dracut.sh): handle symlinks appropriately while using '-i' option
[[ -d $symlink ]] will return true if the symlink points to a directory.
So the symlink will not be copied, instead a directory is created with
the symlink name and the content is copied.

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-06-29 09:53:19 +02:00
Hari Bathini f1138012c9 fix(dracut.sh): handle '-i' option to include files beginning with '.'
While including a directory using '--include' option, the file and
subdirectory names that begin with '.' are not included. Also, dracut
throws a warning message when a subdirectory is empty or only has
files or subdirectories that begin with '.'.

For example, while trying to include /tmpdata directory with the
below tree:

  # tree -a /tmpdata
  /tmpdata
  ├── .anothertestdir
  ├── testdir
  │   └── .testsubdir
  └── .testfile

dracut throws the below warning message:

  # dracut --include /tmpdata /root
  cp: cannot stat '/tmpdata/testdir/*': No such file or directory
  #

and this is how the included /tmpdata directory tree looks:

  # tree -a root
  root
  └── testdir

No file or directory beginning with '.' is included & also, copying
/tmpdata/testdir reported "No such file or directory" warning. Using
'.' instead of '*' in the below command will fix the warning whether
the directory being copied is empty or only has files or directories
that begin with dot:

  $DRACUT_CP -t "$object_destdir" "$dracutsysrootdir$objectname"/*

Also, enable 'dotglob' temporarily to include files and directories
beginning with a `.' in the results of pathname expansion of source
directory being included.

Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
2021-06-29 09:53:19 +02:00
Dusty Mabe a97d2cedcf fix(network-manager): support teaming under NM+systemd
Previously when NM was run without dbus then teaming would come
up appropriately [1], but now that dbus exists we also need to
include some supporting infrastructure to allow for it to work
again.

[1] d689380cfc
2021-06-28 11:30:34 +00:00
Kairui Song a2b6be4479 fix(squash): create relative symlinks
Don't use absolute path, or it may resolve to wrong files after unpack
the initramfs to a sub path on a running system.

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-06-28 11:25:58 +00:00
Jonathan Lebon 78557f05a6 fix(fips): handle s390x OSTree systems
On s390x, the `BOOT_IMAGE` karg injected by the bootloader is not a path
to the kernel image, but rather an integer describing the index of the
menu entry selected. Because of the way the s390x bootloader works,
there is no information retained about e.g. the path of the kernel that
was loaded.

This causes issues for the FIPS code which assumes that `BOOT_IMAGE` is
a path to the kernel image to derive the HMAC path. In non-OSTree
systems, this ends up working anyway, because the kernel is located at
the root of the boot partition.  In OSTree systems, this is not the
case. However, OSTree systems use BLS configs, and they are named in
reverse order of precedence (i.e. menu ordering). So from the
`BOOT_IMAGE` integer, we can figure out which BLS entry was selected.

Add some code to do just this on s390x. This isn't completely foolproof,
because it presumes that (1) BLS configs were used to populate the
bootloader (and that they were exactly in the same state they currently
are when `zipl` was run), and (2) there are no other menu entries
originating from outside the BLS configs. However, if these assumptions
are wrong we would simply fail the boot, which is currently what is
happening anyway.

See also:
https://github.com/openshift/os/pull/546
https://github.com/ibm-s390-linux/s390-tools/issues/78

Tested-by: Muhammad Adeel <muhammad.adeel@ibm.com>
2021-06-28 11:25:20 +00:00
David Tardon 2e3c5444d2 fix(multipath): get config. dir from configuration 2021-06-28 13:21:33 +02:00
Frantisek Sumsal 6a44426162 fix(install): add a missing ret value assignment
Spotted when reconfiguring LGTM for RHEL 9 dracut repo.
2021-06-28 11:20:21 +00:00
Dusty Mabe a97d6e2b13 fix(network-manager): pull in network.target in nm-initrd.service
Otherwise units with `After=network.target` won't have any effect.
2021-06-28 10:58:10 +00:00
Kairui Song 563f543424 feat(squash): install umount util
Also install umount binary, make it possible to cleanup squash overlay
mounts. This is useful for other tools reusing the dracut initramfs built
with squash module enabled.

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-06-25 21:11:58 +02:00
Matthias Berndt 8b17105bed fix(tpm2-tss): typo in depends()
There is no systemd-udev module, only systemd-udevd
2021-06-22 15:32:28 +02:00
lapseofreason e0abf88a15 fix(crypt): remove quotes from cryptsetupopts
Fixes #1528.
2021-06-08 19:28:45 +00:00
Harald Hoyer 86bf2533d7 docs: update NEWS.md and AUTHORS 2021-05-27 14:34:19 +02:00
Tomasz Paweł Gajc 12beeac741 fix(fs-lib): install fsck utilities 2021-05-27 09:13:04 +02:00
Stefan Berger b12d91c431 fix(integrity): require ALLOW_METADATA_WRITES to come from EVM config file
Upcoming versions of EVM will not require the ALLOW_METADATA_WRITES anymore,
therefore we remove it from the script and require it to be set in the EVM
config file variable EVM_ACTIVATION_BITS for those versions that need it.

Patch 9 in this patch set deprecates the EVM_ALLOW_METADATA_WRITES flag:
https://lore.kernel.org/linux-integrity/20210514152753.982958-1-roberto.sassu@huawei.com/

Suggested-by: Roberto Sassu <roberto.sassu@huawei.com>
Reviewed-by: Roberto Sassu <roberto.sassu@huawei.com>
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-05-26 17:11:07 +02:00
Marcos Mello 5eb24aa21d fix(install): configure logging earlier
There are log_error() and log_debug() calls in parse_argv().
2021-05-26 09:22:09 +02:00
Jóhann B. Guðmundsson 7d205598c6 fix(warpclock): minor cleanups
- Removing shell mode lines
- Remove uncessary file requirements
- Remove hard coded path to binary
- Add missing license header
- Document sections
- refactor install section
2021-05-25 14:00:52 +02:00
Jóhann B. Guðmundsson f4ea5f8734 fix(dash): minor cleanups
- Remove hard coded path to binary
- Add missing license header
- Document sections
- refactor install section
2021-05-25 11:59:08 +00:00
Jóhann B. Guðmundsson 6c673298f3 fix(mksh): minor cleanups
- Remove hard coded path to binary
- Add missing license header
- Document sections
- refactor install section
2021-05-25 11:58:43 +00:00
Marcos Mello 4cb086fa29 feat(install): add default value for --firmwaredirs
If not specified, use /lib/firmware.
2021-05-25 11:48:59 +02:00
Harald Hoyer a277a5fc7a fix(dracut-functions): get_maj_min without get_maj_min_cache_file set
If `get_maj_min_cache_file` is unset `get_maj_min()` would error out.

Fix it to work without a cache file set.
2021-05-21 14:17:07 +02:00
Harald Hoyer 0a6007bf4f fix(dracut): pipe hardlink output to `dinfo`
Otherwise the output is cluttered with:
```
Mode:           real
Files:          1364
Linked:         5 files
Compared:       0 xattrs
Compared:       384 files
Saved:          12.84 KiB
Duration:       0.052674 seconds
```
2021-05-21 14:16:43 +02:00
Marcos Mello c1ab36139d fix(install): sane default --kerneldir
If --kerneldir is not specified, use /lib/modules/$(uname -r).

Fixes #1505
2021-05-20 23:56:40 +00:00
Jóhann B. Guðmundsson 9355cb8ea5 fix(bash): minor cleanups
- Remove hard coded path to binary
- Add missing license header
- Document sections
- refactor install section
2021-05-19 10:29:34 +00:00
Kairui Song 636d6df313 fix(squash): don't mount the mount points if already mounted
It is possible that user setup some early mount in the rootfs even
earlier, so just be more robust and cover that case too.

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-05-19 08:46:34 +00:00
Harald Hoyer fa63c9be13 ci: add shfmt to Fedora containers 2021-05-18 11:33:27 +02:00
Harald Hoyer 148e420be5 fix(base): add missing `str_replace` to `dracut-dev-lib.sh`
```
dracut-dev-lib.sh: line 92: str_replace: command not found
dracut-dev-lib.sh: line 98: /var/tmp/dracut.sabKZg/initramfs/initqueue/finished/devexists-.sh: No such file or directory
dracut-dev-lib.sh: line 83: /var/tmp/dracut.sabKZg/initramfs/emergency/80-.sh: No such file or directory
```
2021-05-18 11:31:16 +02:00
Harald Hoyer 7275c6f6a0 feat(dracut.sh): detect running in a container
Don't try to `mknod` by setting DRACUT_NO_MKNOD.
Don't try to `cp` extended attributrs by setting DRACUT_NO_XATTR.
2021-05-17 16:23:00 +02:00
Harald Hoyer c08bc8109d fix(base): split out `dracut-dev-lib.sh`
To share the `wait_for_dev` function and use it without side effects on
install time, split out the needed functions in an extra library.
2021-05-17 16:22:49 +02:00
Lars Wendler b9b6f0ee5b fix(dracut-util): print error message with trailing newline
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
2021-05-14 15:48:32 +00:00
Jóhann B. Guðmundsson f634448b29 fix(packit): downstream has renamed the master branch to main 2021-05-14 15:50:38 +02:00
Harald Hoyer 53337dfdc3 docs: update NEWS.md and AUTHORS 2021-05-14 15:21:11 +02:00
Harald Hoyer b2cf61d97f ci: run the integration tests on more distributions
Add OpenSuse and Arch Linux to limited tests.

Only run the full tests against the latest stable Fedora version
to reduce the workload.

Also remove the `hung_task_panic=1` on the kernel command line, as qemu
tends to be really slow in non-kvm mode.
2021-05-14 13:08:07 +02:00
Harald Hoyer 12d0213885 ci: create a fedora rawhide container
Remove Fedora 34 for now, as it is fedora:latest
2021-05-14 12:39:40 +02:00
Jóhann B. Guðmundsson fc88af5413 feat(systemd-sysext): introducing the systemd-sysext module
Introducing the systemd-sysext module.
2021-05-14 11:35:34 +02:00
Harald Hoyer 5a04bd2dd3 docs: document testing with containers 2021-05-14 08:35:39 +02:00
Harald Hoyer de0c0872fc fix(dracut): prevent symbolic links containing `//`
Results in `usr/lib64 -> ..//usr/lib` for Arch Linux otherwise.
2021-05-14 08:35:30 +02:00
Harald Hoyer 22d6863ef1 fix(network-manager): cope with distributions not using `libexec` 2021-05-14 08:35:22 +02:00
Harald Hoyer 3ad3b3a40d fix: cope with distributions with `/usr/etc` files 2021-05-14 08:35:09 +02:00
Harald Hoyer 6209edeb5c fix(nbd): assume nbd version >= 3.8
This reduces the quirks.
2021-05-14 08:34:59 +02:00
Harald Hoyer 66b920c651 fix(iscsi): replace sed call with bash internals
This removes a fork/exec and additionally gives more information in debug logs.
2021-05-14 08:34:48 +02:00
Harald Hoyer 8b2afb08ba fix: make testsuite pass on OpenSuse and Arch
This removes some hard assumptions about the file system layout.

It also hardens the tests with network interface renaming rules and
guards.
2021-05-14 08:34:38 +02:00
Harald Hoyer 44fd1c1355 fix(crypt-gpg): cope with different scdaemon location
On Arch things are different for some reason.
2021-05-14 08:34:27 +02:00
Mikhail Novosyolov 5f6be51595 fix(url-lib): fix passing args
Fixes: 8e84fa726 ("fix(url-lib): shellcheck for modules.d/45url-lib")

Behaviour introduced by that commit made the following to be run:
curl "--globoff --location --retry 3 --fail --show-error" http://192.168.1.173:8000/test.ks
instead of:
curl --globoff --location --retry 3 --fail --show-error http://192.168.1.173:8000/test.ks

This broke downloading kickstart file in anaconda-dracut.
2021-05-14 08:33:22 +02:00
Jóhann B. Guðmundsson 61f4564358 fix: adding crc32c for ext3
Noticed that ext3 is still being used in the wild so let's add it to the crc32c list
so downstream does not have to carry a patch for it.
2021-05-14 08:18:40 +02:00
Harald Hoyer 805686930b ci: ensure pigz is installed in the CI containers
pigz speeds up things considerably. Although pigz is already installed
by default, explicitely adding it makes sure, it will not disappear
unnoticed.
2021-05-12 15:48:53 +02:00
Harald Hoyer e0c0791594 ci: add cpio and pigz to arch container 2021-05-12 15:26:07 +02:00
Harald Hoyer d24e67e24d ci: really, really cleanup the arch container 2021-05-12 14:59:42 +02:00
Harald Hoyer 886b04abfe ci: cleanup the arch container 2021-05-12 14:34:31 +02:00
Harald Hoyer c7d8334d26 ci: don't use `rpm` to determine the kernel version
for `/etc/profile.d/dracut-test.sh`
2021-05-12 14:21:00 +02:00
Harald Hoyer 3c67644fe6 ci: build container images and push to ghcr.io 2021-05-12 13:26:06 +02:00
Jóhann B. Guðmundsson 5c94cf41e8 fix: deprecate gummiboot
Gummiboot was merged into systemd and official became systemd-boot in 2015 ( 6 years ago )
and no longer was being maintained as Gummiboot from that point.

It's safe to say distribution should have migrated to sd-boot by now so let's deprecate
it.
2021-05-11 17:13:09 +02:00
Jaroslav Jindrak d1a36d3d80 fix(install): handle $LIB in ldd output parsing
The ldd output can contain the variable $LIB, which is a documented feature of
ldd. In a previous commit [0], dracut-install received support for this
variable, but that was later reverted [1] due to issues [2][3] on Gentoo ARM64.

The part before '=>' does not necessarily refer to an existing file (e.g. due
to the usage of $LIB) and thus [1] could be seen as a regression to anyone
that uses this ldd feature. This PR combines both cases together and whenever
it find a '$' character (i.e. a variable) on the left side of the '=>' symbol,
it uses the right hand path (and thus uses evaluation done by ldd), otherwise
falls back to the behavior set by [1].

Reproducer that was presented to me:

$ grep "ibz.so" /etc/ld.so.preload || cat << EOF >> /etc/ld.so.preload
/\$LIB/libz.so.1.2.11
EOF
$ mkdir -p /var/tmp/dracut.xitk6p/initramfs
$ strace /usr/lib/dracut/dracut-install -D /var/tmp/dracut.xitk6p/initramfs -l /bin/bash 2>&1|grep ibz
$ rm -rf /var/tmp/dracut.xitk6p/

[0] 45404a2
[1] 6d886bb
[2] #471
[3] https://bugs.gentoo.org/667752
2021-05-10 15:55:41 +02:00
Jóhann B. Guðmundsson 3697891b75 feat(systemd-journald): introducing the systemd-journald module 2021-05-06 16:59:38 +02:00
Jóhann B. Guðmundsson 0eca191405 chore(tree): move html files to the dosc directory
Moving the html files into the docs directory.
2021-05-06 16:59:14 +02:00
Jóhann B. Guðmundsson 3420a70dee chore(install): move install to src directory
Moving install to the src directory
2021-05-06 16:25:32 +02:00
Jóhann B. Guðmundsson 215365441e feat(systemd-rfkill): introducing the systemd-rfkill module
Introducing the systemd-rfkill module
2021-05-06 15:50:15 +02:00
Jóhann B. Guðmundsson 563c434ecb feat(systemd-ldconfig): introducing the systemd-ldconfig module
Introducing the systemd-ldconfig module
2021-05-06 15:49:48 +02:00
Jóhann B. Guðmundsson 8849dd8d1a fix: add a missing tmpfilesconfdir global variable
Adding a missing tmpfilesconfdir global variable
2021-05-06 15:49:18 +02:00
Jóhann B. Guðmundsson 2b61be32b8 feat(systemd-tmpfiles): introducing the systemd-tmpfiles module
Introducing the systemd-tmpfiles module
2021-05-06 15:49:18 +02:00
Jóhann B. Guðmundsson 9ffe2e4c4b refactor(systemd-networkd): cosmetic move to 01
Moving systemd-networkd to 01 systemd namespace to keep everything in
order.
2021-05-06 15:48:13 +02:00
Harald Hoyer 6feaaabc22 fix(base): suppress calls to getarg in build phase
Setting `DEBUG_MEM_LEVEL` in the build phase prevents
`setmemdebug()` to call `getargnum`, which would use `dracut-getarg`
in the initrd runtime phase.

No more:

```
modules.d/99base/dracut-lib.sh: line 217: dracut-getarg: command not found
```
2021-05-06 10:39:34 +02:00
Renaud Métrich c3bb9d18dc fix(dracut-functions): implement a cache for get_maj_min
On systems with a large number of devices, usually multipath devices,
dracut can spend a lot of time stat'ing the devices to collect the
major/minor numbers, leading to huge slowness rebuilding the initramfs
when stat'ing devices is slow (seen with oracleasm file systems in
particular).
This commit implements a basic cache stored in a file under
DRACUT_TMPDIR storing the major:minor corresponding to the specified
device.

Reproducer: create N loopback devices used as a LVM extension to volume
group hosting the root file system

  # LVMVG="rhel"
  # NDEVICES=200
  # mkdir devices; for i in $(seq 1 $NDEVICES); do
    truncate -s 10m devices/$i; losetup loop$i devices/$i
  done
  # vgextend $LVMVG $(/bin/ls -1 /dev/loop[0-9]*)

With standard code (tested with RHEL8.3 dracut):

  # dracut -f --debug /tmp/initramfs.img $(uname -r) >/tmp/debug 2>&1
  # grep -c "stat -L -c" /tmp/debug
  2440

With this code:

  # dracut -f --debug /tmp/initramfs.img $(uname -r) >/tmp/debug_optim 2>&1
  # grep -c "stat -L -c" /tmp/debug_optim
  205

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
2021-05-06 09:14:10 +02:00
David Tardon 543b8014fc fix(fips): add dh and ecdh ciphers 2021-05-05 16:24:18 +02:00
Harald Hoyer 909961d048 fix: shellcheck 0.7.2
github action `luizm/action-sh-checker@v0.2.2` uses `shellcheck-0.7.2`,
which detects more non-posix shell code and complains accordingly.
2021-05-05 14:55:30 +02:00
Harald Hoyer 0dc87f7b9e docs: install `which` in Arch container 2021-05-04 18:39:31 +02:00
Mikhail Novosyolov ce9af251af feat: support ZSTD-compressed kernel modules
Modern Linux kernels support zstd-compressed modules, which was added
by commit 73f3d1b48f50 ("lib: Add zstd modules").

Commit c3d7ef377eb ("kbuild: add support for zstd compressed modules")
added support of compressing modules with zstd to kernel Makefiles.

libkmod >= 28 built with libzstd is also required.
2021-05-04 15:55:19 +00:00
Harald Hoyer 4a76c187d0 docs: document how to run the test suite in podman on Fedora and Arch 2021-05-04 16:34:10 +02:00
Harald Hoyer 373eadaa9c style: make indent and let shfmt fail again
The bump of removed the `-d` option for `shfmt`. Readd it until upstream
is fixed.

See also:
https://github.com/luizm/action-sh-checker/issues/44
2021-05-04 15:39:55 +02:00
Jóhann B. Guðmundsson 0620677238 chore(tree): move package build files in their own directory
Creating pkgbuild directory and move relevant files there.
2021-05-04 15:39:34 +02:00
Harald Hoyer 82e780af25 test(NFS): let it run in an Arch container
`dhclient` on Arch does not understand the `--timeout` parameter.

`/etc/virc` does not need to be installed in tests. This is a debugging
leftover.
2021-05-04 13:47:03 +02:00
Harald Hoyer 7f63374713 fix: include `modules.builtin.alias` in the initramfs
Let's also resolve the compiled in aliases to builtin modules.
2021-05-04 13:34:16 +02:00
Harald Hoyer ece67c7e2d test(FULL SYSTEMD): try pacman rather than rpm on Arch
If there is no `rpm`, try `pacman` to get a full list of systemd files
to install into the real test root.
2021-05-04 13:23:56 +02:00
Harald Hoyer 50a01dd4b2 fix: install all depmod relevant configuration files
This is important for running `depmod` in the initrd.
2021-05-04 13:15:49 +02:00
Harald Hoyer 87c4c17850 fix: add `modules.builtin.modinfo` to the initramfs
This solves all issues, where builtin kernel modules are not recognized
as such.

Fixes: https://github.com/dracutdevs/dracut/issues/1146
Fixes: https://github.com/dracutdevs/dracut/issues/1099
2021-05-04 11:45:53 +02:00
Harald Hoyer 10f9e569c5 fix(crypt): install all crypto modules in the generic initrd
Just install all `=crypto` drivers in the generic initramfs, because who
are we to decide which combinations are allowed in current and future
`cryptsetup`. We only could install blacklist filter in the future, if
there are modules, which are definetely not used and are huge in size.
2021-05-04 11:25:55 +02:00
Harald Hoyer 33e27fab59 feat: also restore the initramfs from /lib/modules
Fallback to /lib/modules/$(uname -r)/initrd, if present and all other
files don't exist.
2021-05-04 11:25:32 +02:00
Harald Hoyer 625f11dca7 chore: skip rpmbuild, if there is no rpmbuild installed
On non-rpm distributions this does not make sense.
2021-05-04 10:39:41 +02:00
Harald Hoyer 44ca04c843 chore: fix indent-c path for src directory 2021-05-04 10:39:28 +02:00
Harald Hoyer 060e1f192e test: use `uname -m` to determine qemu-system
E.g. `uname -i` does not work in Arch Linux containers.
2021-05-04 10:14:08 +02:00
Jóhann B. Guðmundsson 7359ba8aca fix(systemd-sysusers): misc fixes and cleanup
- module-setup.sh file permission corrected
- comment section cleaned up
- removal of dependency on systemd module
- added inclution of the unit into the sysinit target
- removal of systemctl enablement of type unit
2021-05-04 10:05:25 +02:00
Jóhann B. Guðmundsson 9f9bf8a178 chore(tree): move src into their own src directory
Moving sources into their src directory
2021-05-04 10:02:04 +02:00
Jóhann B. Guðmundsson a02d17f7af chore(tree): move tools into their own directory
Moving tools into their own directory
2021-05-04 10:01:14 +02:00
Jóhann B. Guðmundsson a876c27085 chore(tree): move docs into the docs directory
Consolidating all the projects documentation into the docs
directory with the exception of news and readme.
2021-05-04 09:31:11 +02:00
Jóhann B. Guðmundsson 49717458e8 chore(tree): move kernel install files into its own directory
Move kernel install files into it's own directory within the tree.
2021-05-04 09:24:16 +02:00
Jóhann B. Guðmundsson e5ac28a5be chore(tree): move man pages into a man directory
Moving man pages into it's own man directory within the tree
2021-05-04 09:23:51 +02:00
Jóhann B. Guðmundsson b544bd6bfa chore(tree): move shell completion into a directory
Moving shell completion into it's own directory for a more organized and
cleaner tree.
2021-05-04 09:22:22 +02:00
Jóhann B. Guðmundsson 86b756346a fix(mdraid): remove dependency statements
mdadm 4.1 was released 2 years ago so it's safe to assume
that everyone are on 4.1.X branch now...
2021-05-03 13:44:29 +02:00
Jóhann B. Guðmundsson 12bef83cda fix(systemd-resolved): remove nss libraries
Removing inclution of nss libraries since they are part of
the systemd module now.
2021-05-03 10:16:48 +02:00
Jóhann B. Guðmundsson b3bbf5fb6a fix(systemd): include all nss libraries
Include all nss libraries so other modules dont have to.
2021-05-03 10:16:22 +02:00
Jóhann B. Guðmundsson 562cb77b5a fix(systemd-udevd): add udev id program files
Adding missing udev id program files
2021-05-03 10:14:37 +02:00
Stefan Berger 4bdd7eb23a fix(integrity): properly set up EVM when using an x509 cert
The current EVM script does not handle the EVM setup properly when X509
certificates are involved. In this patch we extend the setup and add
the necessary flags for support of EVM activation that include
x509 certificates, possibly in conjunction with an HMAC key. We also
first try activating EVM for x509 certificates using
EVM_ALLOW_METADATA_WRITES for newer kernels, then without it for older
ones that did not support this flag.

We add support for additional EVM activation bits to be set, such
as EVM_SETUP_COMPLETE (0x80000000) via the config file and
EVM_ACTIVATION_BITS variable.

To avoid error messages related to unloading the HMAC key if none is
used, only attempt to unload the HMAC key if one was actually set.

We add documentation about the variables that can be set in the EVM
config file.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Cc: Roberto Sassu <roberto.sassu@huawei.com>
2021-05-03 08:13:48 +00:00
Jóhann B. Guðmundsson 8f99fadabe fix(tpm2-tss): add tpm2 requirement 2021-05-03 10:08:51 +02:00
Jóhann B. Guðmundsson 8743b07356 feat(tpm2-tss): introducing the tpm2-tss module
Introducing the tpm2-tss module
2021-05-03 10:08:51 +02:00
Jóhann B. Guðmundsson 69f4e7cdc3 fix(udev-rules): remove sourcing of network link files
Removing sourcing of network link files from the udev-rules module.
What always should be included should be placed in the systemd-network
module and other modules that provide/require spesific link files
should add them, themselves via their relevant include section.
2021-05-03 10:07:48 +02:00
Jóhann B. Guðmundsson fd883a58d1 fix(systemd-udev): use global vars instead of fixed path 2021-04-30 10:18:02 +02:00
Harald Hoyer 851a801178 ci: switch to action-sh-checker v0.2.0
See also:
https://github.com/luizm/action-sh-checker/pull/40#issuecomment-829260125
2021-04-29 16:09:02 +02:00
Harald Hoyer 1ffbcadad4 ci: remove label cron job
With the event called pull_request_target added to GitHub Actions, the
cron job can be removed.

See:
https://www.jclem.net/posts/labeling-prs-on-public-github-repositories
2021-04-29 14:57:44 +02:00
Jóhann B. Guðmundsson f35d479d2b fix(dracut): adding missing globalvars for udev
Adding missing global variables for udev
udevconfdir --> /etc/udev
udevrulesdir --> /usr/lib/udev/rules.d
udevrulesconfdir --> /etc/udev/rules.d
2021-04-29 14:39:51 +02:00
Jóhann B. Guðmundsson 3534789cc4 feat(systemd-udevd): introducing the systemd-udevd module
Introducing the systemd-udevd module
2021-04-29 14:39:21 +02:00
Jóhann B. Guðmundsson 57eefcf705 fix(network): use wicked unit instead of find_binary
dracut-install triggers "ERROR: installing '/usr/lib/wicked/bin/*'"
when find_binary is being used to determine if wicked is installed
so let's just check for the wicked type service unit instead.
2021-04-28 13:21:57 +02:00
Harald Hoyer 3c244c7ca3 fix(multipath): stop multipath before udev db cleanup
All device-mapper based devices, including device-mapper-multipath,
do reuse the udev db from the initramfs after switching to the root fs.

Therefore device-mapper devices have to be correctly initialized before
the udev daemon is stopped, to have the correct entries in the udev db.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1949076
2021-04-28 13:19:33 +02:00
Jóhann B. Guðmundsson abfd547a85 fix(network-legacy): add missing options to dhclient.conf
Adding the following commonly used options to dhclient.conf
- netbios-name-servers
- netbios-scope
- ntp-servers
- dhcp6.domain-search
- dhcp6.fqdn
- dhcp6.name-servers
- dhcp6.sntp-servers
2021-04-28 09:03:48 +02:00
Jóhann B. Guðmundsson ba92d1fcad fix(systemd-verity): incorrect reference to cryptsetup target
Incorrect include of remote-cryptsetup.target in hostonly.
Corrected to point to remote-veritysetup.target
2021-04-27 15:05:12 +02:00
Jóhann B. Guðmundsson 0267f3c355 fix(systemd-verity): re-naming module to veritysetup
Renaming the module from systemd-verity to systemd-veritysetup to be inline
with the systemd-cryptsetup module.
2021-04-27 15:05:12 +02:00
Jóhann B. Guðmundsson 3d4dea58f9 feat(systemd-verity): introducing the systemd-verity module
Introducing the systemd-verity module.
2021-04-27 10:32:24 +02:00
Harald Hoyer ec18a3eb83 ci: reorder the tests 2021-04-26 17:31:54 +02:00
Harald Hoyer bb6770f1a4 fix(iscsi): add iscsid.service requirements
Since Fedora 34, iscsid.service requires:
- iscsi-init.service
- iscsi-shutdown.service
- a non-empty /var/lib/iscsi/nodes/.dracut
2021-04-26 15:34:24 +02:00
Harald Hoyer 2c5bb67d83 test(ISCSI): fix the watchdog loop
Test for `pidof tgtd` and not the shell background jobs.
2021-04-26 14:13:41 +02:00
Kairui Song 3fdc734a5c fix: search for btrfs devices from actual mount poiont
Currently when dracut search for btrfs device used for initramfs, it
assumes the mount points passed in with "--mount" are all mounted with
given mount path. If user want the device to be mounted to a different
location in initramfs, this will not be true.

eg. with "--mount '/dev/mapper/vol /sysroot btrfs rw,relatime,subvolid=256,subvol=/root'"
and having '/dev/mapper/vol' currently mounted on '/', will raise an
error:
    ERROR: cannot access '/sysroot': No such file or directory

So search for actual mount point of given device.

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-04-26 13:41:15 +02:00
Harald Hoyer b92af86bd5 test: don't fail on modprobe btrfs in create-root.sh 2021-04-26 13:13:59 +02:00
Harald Hoyer f5721c5921 ci: run all Fedora CI in a matrix
Also automatically cancel it, if the PR is updated
2021-04-26 12:48:27 +02:00
Harald Hoyer 0eb87d7810 fix(iscsi): only rely on socket activiation
Only rely on socket activation. This speeds up in case iscsi isn't used
and also prevents failures, where iscsiuio stopping somehow disables
iscsi.
2021-04-26 11:12:31 +02:00
Jóhann B. Guðmundsson 5eb736103d feat(systemd-initrd): add initrd-usr-fs.target
Adding a new systemd initrd-usr-fs.target to the systemd-initrd module
2021-04-23 11:19:58 +02:00
Jóhann B. Guðmundsson aaea54c732 fix: quotes in systemd modules
Fixing quotes around *.conf in systemd modules
2021-04-23 10:56:51 +02:00
Jóhann B. Guðmundsson 2f217abdb3 refactor: check() in systemd modules
Refactoring require_binaries in check() for systemd modules
2021-04-23 10:48:54 +02:00
Harald Hoyer 8a51ee1fa6 fix(network-manager): set timeout via command line option
With Fedora 32, only the command line option works for `nm-online`.
2021-04-22 16:17:11 +02:00
Jóhann B. Guðmundsson e942d86c9d feat(systemd-network-management): introducing systemd-network-management module
Introducing the systemd-network-management meta module which will
allow distribution users and vendors to easily include
systemd + systemd's network management modules by simply include this
module instead of systemd network modules individually.

Obviously if the intent is to glue together somekind of network stack
out of random existing modules such as NetworkManager and or Wicked,
this meta module should not be enabled.
2021-04-22 16:00:16 +02:00
Jóhann B. Guðmundsson 4982e16dd5 fix(network): user variable for sdnetworkd instead of path
Use globalvariable for systemd networkd instead of path
2021-04-22 15:40:58 +02:00
Jóhann B. Guðmundsson 2aa652349c fix(systemd-hostnamed): extra quote 2021-04-22 15:10:15 +02:00
Jóhann B. Guðmundsson ea779750c3 fix(systemd-networkd): make systemd-networkd a proper network provider
Make systemd-networkd a proper network service provider. Fixes #737
2021-04-22 14:45:23 +02:00
Jóhann B. Guðmundsson 020212534b feat(systemd-timedated): add systemd-timedated module to the spec file 2021-04-22 14:25:36 +02:00
Jóhann B. Guðmundsson 1c41cc90c5 feat(systemd-timedated): introducing the systemd-timedated module
Introducing the systemd-timedated module
2021-04-22 14:25:36 +02:00
Harald Hoyer 4d03404f49 fix(network-manager): run after dracut-cmdline
dracut-cmdline runs `nm-config.sh`, which generates the configurations.

Also remove the now unused `nm-run.service`.
2021-04-22 13:10:19 +02:00
Lev Veyde 85eb96802c fix(img-lib): ignored null byte in input
The system currently throws numerous nasty warning messages during
the boot, about ignored null bytes in input.

This patch adds a filter to the dd command, to filter these null
bytes out, and thus to prevent these warning messages.

Signed-off-by: Lev Veyde <lveyde@redhat.com>
2021-04-22 11:23:22 +02:00
Jóhann B. Guðmundsson 782ac8f1f6 fix(systemd-modules-load): misc repairs
- Removing dependency on the systemd meta module since it causes circular dependency,
  prevents the existance of multiple systemd based meta modules and is redunant.

- Removing directory creation for modules-load since it should not be
  necessary and if it turns out that it is, it will be re-introduced in the
  form of a systemd tmpfile instead of inst_dir.

- Add a missing inclusion of configuration files placed in /usr/lib/modules-load.d
  and /etc/modules-load.d ( hostonly ) directories.

- Fix a spelling error in the systemd type unit file conf directory overwrite
  in the hostonly section.
2021-04-22 10:50:20 +02:00
Jóhann B. Guðmundsson b7d3caef67 feat(systemd-resolved): introducing the systemd-resolved module
Introducing the systemd-resolved module
2021-04-22 10:48:56 +02:00
Jóhann B. Guðmundsson bf273e3e86 feat(systemd-hostnamed): introducing the systemd-hostnamed module
Introducing the systemd-hostnamed module.
2021-04-22 10:47:35 +02:00
Jóhann B. Guðmundsson e740723069 feat(systemd-ac-power): introducing the systemd-ac-power module
Introducing the systemd-ac-power module
2021-04-22 10:44:29 +02:00
Jóhann B. Guðmundsson afef455718 fix(systemd-modules): remove dependency on systemd meta module
Depending on systemd meta module causes circular dependency,
prevents the existance of multiple systemd based meta modules
and is redunant.
2021-04-22 10:40:48 +02:00
Jóhann B. Guðmundsson 2257d54583 feat(systemd-timesyncd): introducing the systemd-timesyncd module
Introducing the systemd-timesyncd module
2021-04-22 10:39:59 +02:00
Harald Hoyer 49b614961d fix(network-manager): create /run directories
Create the `/run/NetworkManager/initrd` directory before creating
`/run/NetworkManager/initrd/neednet`. Somehow on Fedora 32 this
directory is missing, when the script is running.

This fixes all NetworkManager tests for Fedora 32.
2021-04-22 09:28:35 +02:00
Harald Hoyer b80ee08093 ci: use /dev/disk/by-id
Due to parallel probing of the linux kernel `/dev/sd*` can't be used to
reliably address a hard disk. This can be seen by the many spurious
failures of the dracut CI, where `mdadm` failed with error 524 or tests
failed due to the success marker message written to the wrong disk.

* don't rely on `/dev/sd*` but use disk ids and `/dev/disk/by-id/ata-disk_<name>`

* specify the exact qemu machine architecture `-M q35` needed for the
  disk ids. A later patch will move this to `run-qemu`, when all tests are converted

* due to `-M q35` the interface names have changed from
  `ens2` -> `enp0s1` and `ens3` -> `enp0s2`
2021-04-22 02:55:31 +02:00
Jóhann B. Guðmundsson 5912f4fbc0 fix(systemd): include hosts and nsswitch.conf in hostonly mode
Adding /etc/hosts and /etc/nsswitch.conf to the hostonly install section.
2021-04-21 15:13:35 +02:00
Peter Robinson 3a60c036db fix(90kernel-modules): add watchdog drivers for generic initrd
The watchdog module pulls in the device specific watchdog if that
module is enabled, but in the case where we need a generic initrd
we don't get all watchdog drivers which means if we have a watchdog
enabled for that usecase it may get kicked too late in the boot
process so we need the drivers in the initrd for the generic case too.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2021-04-21 14:31:30 +02:00
Jóhann B. Guðmundsson b37c90c8e0 fix(examples): remove the examples directory and reference to it
Let's leave it up to the yocto community to keep and maintain their own
examples.
2021-04-21 09:02:35 +02:00
Jóhann B. Guðmundsson ec4539c606 fix(dracut.sh): add global vars for modules-load
Adding modulesload modulesloadconfdir global variables
2021-04-20 16:10:12 +02:00
Jóhann B. Guðmundsson 02acedd09e fix(systemd-sysctl): sysctl global variables 2021-04-20 10:52:45 +02:00
Jóhann B. Guðmundsson 3ca9aa1d7b fix(dracut): sysctl global variables 2021-04-20 10:52:45 +02:00
Jóhann B. Guðmundsson fd15dbad6e fix(nbd): remove old udev version requirements 2021-04-20 10:51:31 +02:00
Jóhann B. Guðmundsson be30d98751 fix(fips): remove old udev version requirements 2021-04-20 10:51:31 +02:00
Jóhann B. Guðmundsson fc53987bec fix(systemd): remove old systemd version requirements 2021-04-20 10:51:31 +02:00
Harald Hoyer 7790644362 fix(nbd): make nbd work again with systemd
* Correct the systemd generated sysroot.mount unit with the options
received by the DHCP request and do a `daemon-reload`.

* Inject the `nbd-client -check /dev/nbd0` in the finished initqueue.

* Reactivate the NBD tests and prepare them for NetworkManager tests.
2021-04-19 22:41:01 +02:00
Harald Hoyer 8cd50230d9 ci: use disk ids for TEST 35 ISCSI MULTI
Due to parallel probing of the linux kernel `/dev/sd*` can't be used to
reliably address a hard disk. This can be seen by the many spurious
failures of the dracut CI, where `mdadm` failed with error 524 or tests
failed due to the success marker message written to the wrong disk.

* don't rely on `/dev/sd*` but use disk ids and `/dev/disk/by-id/ata-disk_<name>`

* specify the exact qemu machine architecture `-M q35` needed for the
  disk ids. A later patch will move this to `run-qemu`, when all tests are converted

* due to `-M q35` the interface names have changed from
  `ens2` -> `enp0s1` and `ens3` -> `enp0s2`
2021-04-19 22:32:00 +02:00
Harald Hoyer 2cfd778a45 ci: add function to generate qemu disk arguments
`qemu_add_drive_args` can be used to generate arguments to specify disks
for a qemu machine (`-M q35`).

This is mostly useful to address those raw disks via `/dev/disk/by-id`,
because due to parallel probing in the kernel `/dev/sd*` can point to
anything.
2021-04-19 22:32:00 +02:00
Harald Hoyer 97b86d37f9 fix(bluetooth): shellcheck and hostonly corrections
Don't install files from `/var` in the non-hostonly case.

Use fileglobs, instead of `find`.
2021-04-17 14:07:41 +02:00
Harald Hoyer ae4fbb3db4 fix(dbus-daemon): only error out in install()
Don't hard exit in `check()`. The transaction logic only checks if it
should/can include the module. Just return `255` and the `dbus` meta
module will pick its dependency.
2021-04-17 13:22:58 +02:00
Adam Alves 64ee2a5386 feat(bluetooth): implement bluetooth support in initrd
- Included a bluetooth module that installs modules, firmware, udev rules and bluetoothd.
- systemd and dbus are required by bluetoothd
- Include bluetooth by default if BT keyboard or combo found
2021-04-16 18:43:31 +00:00
Harald Hoyer 4baedd019b fix(TEST ISCSI): try to debug md error 524
While creating the striped md raid0 sometimes this error occures:

```
mdadm: Defaulting to version 1.2 metadata
mdadm: RUN_ARRAY failed: Unknown error 524
  Failed to clear hint file.
  Device /dev/md0 not found.
Powering off.
```

Add debug output with the size of the disks.

Also create disks with multiple of 4096.
2021-04-16 16:27:16 +02:00
Harald Hoyer 31612c7337 ci: remove packit config causing errors
remove the offending parameters, which cause errors described in
https://github.com/dracutdevs/dracut/issues/1346

until we found the correct config to be used.
2021-04-16 16:26:23 +02:00
Beniamino Galvani 112f03f9e2 feat(network-manager): run as daemon with D-Bus
This commit changes how NM is started inside the initrd. Instead of running NM
in the special --configure-and-quit=initrd mode, which sets up network and
quits, start it as a daemon.

This has multiple advantages. First, we no longer need to run NM in a special
mode that requires additional code and maintenance. NetworkManager works
exactly as in the real root.

One problem of the current configure-and-quit approach is that once NM has
quit, dynamic addresses can expire if the initrd setup takes longer than the
DHCP lease interval or than the IPv6 address lifetime. Running NM as a service
solves this problem.

Now NM runs with D-Bus support and therefore its API can be used by other
modules. This open the possibility, for example, to integrate nm-cloud-setup to
automatically configure networking based on cloud metadata.

Use the NetworkManager-wait-online.service, ordered before
dracut-initqueue.service, to delay the initqueue until NM has terminated its
configuration.
2021-04-16 16:15:00 +02:00
Dusty Mabe 6a37c6f630 fix(network-manager): use /run/NetworkManager/initrd/neednet in initqueue
We don't want to start NetworkManager if networking is not needed.
Right now nm-config.sh lays down /usr/lib/dracut/hooks/initqueue/finished/nm.sh
which will cause the initqueue to run. If nothing exists in
/usr/lib/dracut/hooks/initqueue/finished/ then it will short circuit and
the initqueue won't run anything. But what if something else needed
something to run in the initqueue? nm-run.sh would still get started,
even though /usr/lib/dracut/hooks/initqueue/finished/nm.sh didn't exist.
In this case let's just trigger off of /run/NetworkManager/initrd/neednet
like we are doing in the systemd unit (nm-run.service).
2021-04-16 11:12:49 +02:00
Dusty Mabe ac0e8f7dcc fix(network-manager): only run NetworkManager if rd.neednet=1
Don't run the new systemd unit (nm-run.service) if rd.neednet=1
isn't set. nm-initrd-generator will generate configuration even
without rd.neednet=1 so determining if we should start based on
just if connection profiles exist isn't enough. We need some other
indicator. In this case we lay down a /run/NetworkManager/initrd/neednet
if rd.neednet=1, which is used by nm-run.service to determine the
need to run.
2021-04-16 11:12:49 +02:00
Dusty Mabe 1f21fac646 fix(network-manager): nm-run.service: don't kill forked processes
If teaming is set up via NetworkManager we don't want systemd to take
down the userspace teamd process when NetworkManager quits. `KillMode=process`
will allow it to leave those processes behind.

This is fallout from the change to run NetworkManager via systemd (c17c5b7).

With `KillMode=process` we get something like:

```
sh-5.1# journalctl -u nm-run -o cat | tail
<info>  [1618411262.7030] quitting now that startup is complete
<info>  [1618411262.7030] device (team0): carrier: link connected
<info>  [1618411262.7033] device (team0): team port ens2 was released
<info>  [1618411262.7033] device (team0): team port ens3 was released
<info>  [1618411262.7033] manager: NetworkManager state is now CONNECTED_SITE
<info>  [1618411262.7034] exiting (success)
nm-run.service: Deactivated successfully.
nm-run.service: Unit process 476 (teamd) remains running after unit stopped.
Finished nm-run.service.
```
2021-04-15 13:07:07 +02:00
Dusty Mabe 4fbccde504 fix(dracut-logger.sh): double dash trigger unknown logger warnings during run
There are a bunch of `logger: unknown facility name: --user` errors
during a run. This is because logger is getting passed something like:

```
logger -p --user.info
```

Where it should be something like:

```
logger -p user.info
```
2021-04-15 12:58:49 +02:00
Đoàn Trần Công Danh 651fe01e79 fix(i18n): skip if data is missing
On system that doesn't have either consolefonts, consoletrans, keymaps,
or unimaps, "kbddir" is empty, thus the followed installation will
broken with errors like:

	cp: cannot stat '/consolefonts/*': No such file or directory

Let's report the checks as failure if "kbddir" is empty.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2021-04-13 11:12:37 +02:00
Jóhann B. Guðmundsson 96c313333d fix(dracut.sh): omission is an addition to other omissions in conf files
When omitting a module from the command line via -o or --omit
it's expected that it behaves in the same manner as adding a module from the
command line as in it does not overwrite existing omissions of other modules in
configuration file(s).
2021-04-12 09:18:25 +02:00
Kairui Song 122657b2fe fix(dracut-functions): word splitting issue for sed in get_ucode_file
This unquated regex could be splitted into two arguments and sed will
not work. I've see giving error of wrong arguments being used on my
desktop.

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-04-12 09:17:18 +02:00
Harald Hoyer 2d83bce21b fix(nbd): shellcheck regression
`$opts`, `$preopts` and `$nbdport` shouldn't have been quoted as they
can expand to multiple options.

Fixes: https://github.com/dracutdevs/dracut/issues/1270
2021-03-31 21:32:36 +02:00
Harald Hoyer bb69aff14d docs: clarify `netroot=dhcp`
`root=dhcp` does not work with systemd, so `netroot=dhcp` should be
used.
2021-03-31 21:32:23 +02:00
Harald Hoyer 7fcc495588 fix(dracut-systemd): regression on root=block:
Commit 3532978de04c7 introduced a regression, where the `root` could be
`root=block:block:/dev/foo`.
2021-03-31 21:31:57 +02:00
Harald Hoyer 8059bcb2c8 fix(base): source hooks without exec
Patch 2fabaaa62d changed the behaviour for `dash`
under the assumption, that dash does not take parameters for `.` aka
`source`. Although this is true, the original positional parameters of
the `source_all` function are still in place, so everything is
fine with the old way of sourcing.
2021-03-31 21:31:00 +02:00
Harald Hoyer 36af0518b3 fix(network): correct regression in iface_has_carrier
Commit e25c536c70 introduced a regression in iface_has_carrier
due to unclear variable naming.
2021-03-31 21:29:52 +02:00
Harald Hoyer ba4bcf5f4f fix(network-manager): no default deps for nm-run.service
Otherwise nm-run.service will run only in basic.target, which is too
late in the initramfs.
2021-03-31 21:29:33 +02:00
Harald Hoyer 56606b0a1b fix(lunmask): shellcheck regression
`parse-lunmask.sh` is not a bash script
and dash doesn't understand `read -a`.

Revert to the initial code.

Fixes: https://github.com/dracutdevs/dracut/issues/1271
2021-03-31 12:13:31 +02:00
Harald Hoyer fd4b04da66 fix(lvmmerge): depend on bash 2021-03-31 11:32:48 +02:00
Harald Hoyer 5b965f6308 fix(livenet): fetch-liveupdate.sh does not require bash 2021-03-31 11:32:29 +02:00
Harald Hoyer fd3698aa42 fix(cms): require bash 2021-03-31 11:32:00 +02:00
Harald Hoyer 3402142e34 fix(network-manager): nm-lib.sh does not require bash 2021-03-31 11:31:47 +02:00
Harald Hoyer 6b499ec14b fix(zipl): don't depend on grub2
There is no grub2 dracut module.
2021-03-31 11:31:30 +02:00
Harald Hoyer 09356085b6 ci: enable shellcheck for everything 2021-03-31 11:31:17 +02:00
Harald Hoyer 1dc61299f7 fix(kernel-modules): shellcheck regression
`$_hostonly_drvs` contained multiple arguments and was quoted.

This patch converts `_hostonly_drvs` into an associative array, which
enables easy deduplication and proper quoting in bash.

Fixes: https://github.com/dracutdevs/dracut/issues/1276
2021-03-31 11:30:49 +02:00
Harald Hoyer 7b8c78ff43 fix(multipath): revise multipathd-stop
A shellcheck regression quoted `HARD` in
```shell
    kill "$HARD" "$pid" > /dev/null 2>&1
```

which would error on an empty "HARD".

Instead of fixing this, use `pkill` instead and also add it to the
non-optional list of binaries to install, which was revised also.

Fixes: https://github.com/dracutdevs/dracut/issues/1275
2021-03-31 11:30:10 +02:00
Harald Hoyer 85378f44af fix(multipath): shellcheck regression
`$_allow` should not have been quoted, because it can be multiple options.

Instead of unquoting it, convert it to an associative array with easy
deduplication and prefix every device with the `--allow` option.

Fixes: https://github.com/dracutdevs/dracut/issues/1274
2021-03-31 11:29:31 +02:00
Harald Hoyer af3cd22425 fix(nvdimm): shellcheck regression
`_provider_dirs` should not have been quoted, because it should expand
to multiple arguments.

Just remove the whole variable and add those arguments.

Fixes: https://github.com/dracutdevs/dracut/issues/1273
2021-03-31 11:29:07 +02:00
Harald Hoyer f450ebfdf2 fix(convertfs): require bash 2021-03-31 11:05:29 +02:00
Harald Hoyer f5046e56bc fix(caps): require bash 2021-03-31 11:04:52 +02:00
Harald Hoyer 007df5adc1 test: mark the whole test subdir as shellcheck'ed 2021-03-31 09:33:03 +02:00
Harald Hoyer 29f335070a fix(dracut-initramfs-restore.sh): shellcheck for dracut-initramfs-restore.sh 2021-03-31 09:32:33 +02:00
Harald Hoyer 7ee8dfca6a fix(examples/yocto): shellcheck again 2021-03-31 09:32:07 +02:00
Harald Hoyer cd8db54a3d fix(dasd_rules): add bash dependency 2021-03-30 21:10:44 +00:00
Harald Hoyer 23d303f8a0 fix(fcoe-uefi): add bash dependency 2021-03-30 21:04:48 +00:00
Harald Hoyer c864f8938c fix(TEST MULTINIC): shellcheck 2021-03-30 22:59:46 +02:00
Harald Hoyer f9b9faf433 fix(fcoe): remove needless bash dependency 2021-03-30 20:04:52 +00:00
Harald Hoyer f0c606f91d fix(lunmask): remove needless bash dependency 2021-03-30 21:21:01 +02:00
Jóhann B. Guðmundsson a4cc196467 fix(crypt): include cryptsetups tmpfile 2021-03-30 19:14:38 +00:00
Harald Hoyer beb3e54ece fix(TEST BASIC): shellcheck 2021-03-30 21:09:06 +02:00
Harald Hoyer d174e18d2a fix(TEST SYSTEMD): shellcheck 2021-03-30 21:06:09 +02:00
Harald Hoyer 4c4cd24b7c fix(TEST USR-MOUNT): shellcheck 2021-03-30 20:57:04 +02:00
Harald Hoyer 7e140a407b fix(TEST FULL-SYSTEMD): shellcheck 2021-03-30 20:54:26 +02:00
Harald Hoyer 6e7db0467a fix(TEST RAID): shellcheck 2021-03-30 20:48:22 +02:00
Harald Hoyer 34600bbead fix(TEST LVM): shellcheck 2021-03-30 20:38:52 +02:00
Harald Hoyer cdebbcc684 fix(TEST RAID-DEG): shellcheck 2021-03-30 20:16:02 +02:00
Harald Hoyer 07c944b48c fix(TEST IMSM): shellcheck 2021-03-30 19:56:28 +02:00
Harald Hoyer 92798d7d1b fix(TEST DMSQUASH): shellcheck 2021-03-30 19:33:37 +02:00
Harald Hoyer d0c9fd6609 fix(TEST LVM-THIN): shellcheck 2021-03-30 19:24:10 +02:00
Harald Hoyer 1c6dd0ddfd fix(TEST NFS): shellcheck 2021-03-30 19:20:45 +02:00
Harald Hoyer 2aa97ff299 fix(TEST ISCSI): shellcheck 2021-03-30 19:06:07 +02:00
Harald Hoyer 7c77835cd6 fix(zfcp_rules): require bash 2021-03-30 17:55:15 +02:00
Harald Hoyer c2ecc4d131 fix(memstrack): correct dependencies
memstrack does not need to depend on `bash` but does on `systemd`.
2021-03-30 17:51:55 +02:00
Harald Hoyer e6e78b14dd ci: disable fedora-eln for now
Seems like there is a missing glib2 build in the pipeline, so
fedora-eln only fails, and therefore is of no use for us.
2021-03-30 16:48:48 +02:00
Harald Hoyer 957ab750f0 fix(usrmount): shellcheck for modules.d/98usrmount 2021-03-30 16:35:31 +02:00
Harald Hoyer f7844c296a fix(TEST ENC-RAID-LVM): shellcheck 2021-03-30 16:34:17 +02:00
Harald Hoyer 79f9b17feb fix(TEST BTRFSRAID): shellcheck 2021-03-30 16:31:54 +02:00
Harald Hoyer f9f1314acb fix(TEST ISCSI-MULTI): shellcheck 2021-03-30 15:54:54 +02:00
Harald Hoyer 77854c6d2d fix(TEST NBD): shellcheck 2021-03-30 15:53:47 +02:00
Harald Hoyer 6e5878188b fix(TEST BONDBRIDGEVLANIFCFG): shellcheck 2021-03-30 15:53:21 +02:00
Harald Hoyer 90b9c00695 fix(TEST GETARG): shellcheck 2021-03-30 14:57:52 +02:00
Harald Hoyer 718ad799ac fix(TEST RPM): shellcheck 2021-03-30 14:55:29 +02:00
Beniamino Galvani df1e5f06a5 fix(dbus-broker): enable the service
dbus-broker.service has a 'dbus.service' alias which is installed when the
service gets enabled.

If the alias is not present in the initrd image, services requiring D-Bus in
the initrd fail to start because they depend on dbus.service, which doesn't
exist.

Therefore, enable the service to create the alias.
2021-03-30 14:45:47 +02:00
Harald Hoyer dd3cac269b fix(examples/yocto): shellcheck 2021-03-30 13:02:21 +02:00
Harald Hoyer 0ce54e8033 fix(lsinitrd.sh): shellcheck for lsinitrd.sh 2021-03-30 12:59:06 +02:00
Harald Hoyer 43df4ee274 feat(mkinitrd): remove mkinitrd
It was not working anyway, so nobody used it for years.
If it is not used, just remove it.
mkinitrd-suse.sh will be maintained by SUSE as it is SUSE specific
anyway.
2021-03-30 12:38:11 +02:00
Harald Hoyer baa4acd402 fix(test/test-functions): shellcheck for test/test-functions 2021-03-30 12:30:41 +02:00
Harald Hoyer e010f45524 fix(test/run-qemu): shellcheck for test/run-qemu 2021-03-30 12:26:14 +02:00
Harald Hoyer 51b6784217 fix(fedora-test.sh): shellcheck for fedora-test.sh 2021-03-30 10:47:05 +02:00
Harald Hoyer f6597b0d51 fix(dm): shellcheck for modules.d/90dm 2021-03-30 10:28:54 +02:00
Harald Hoyer 2536a9eaff fix(install): handle builtin modules
If a `kmod_module` is missing the `path`, it is `builtin`.
2021-03-30 10:27:02 +02:00
Harald Hoyer 8c0fcdd931 fix(network-legacy): shellcheck for modules.d/35network-legacy 2021-03-30 10:14:34 +02:00
Harald Hoyer 6bc9942b41 fix(systemd-modules-load): shellcheck for modules.d/01systemd-modules-load 2021-03-30 10:13:10 +02:00
Harald Hoyer c94bd1cd82 fix(busybox): shellcheck for modules.d/05busybox 2021-03-30 10:11:24 +02:00
Harald Hoyer 428ef5e471 fix(securityfs): shellcheck for modules.d/96securityfs 2021-03-30 10:07:31 +02:00
Harald Hoyer a490409702 fix(iscsi): shellcheck for modules.d/95iscsi 2021-03-30 08:56:18 +02:00
Harald Hoyer 77fa33017d fix(mdraid): shellcheck for modules.d/90mdraid 2021-03-30 04:16:57 +02:00
Harald Hoyer ae9aa8f174 fix(TEST-30-ISCSI): add sync to client root creation 2021-03-30 04:05:34 +02:00
Harald Hoyer 4148f08bd3 fix(cifs): shellcheck for modules.d/95cifs 2021-03-30 03:39:47 +02:00
Harald Hoyer d97f88f28b test(FULL-SYSTEMD): add fuse kernel module in test root
systemd wants to use it
2021-03-29 16:16:09 +02:00
Harald Hoyer 94b0d89f17 fix(dmsquash-live): shellcheck for modules.d/90dmsquash-live 2021-03-29 15:00:07 +02:00
Harald Hoyer b130927514 fix(crypt-gpg): shellcheck for modules.d/91crypt-gpg 2021-03-29 14:45:07 +02:00
Harald Hoyer eb0d3fb9c1 fix(fcoe-uefi): shellcheck for modules.d/95fcoe-uefi 2021-03-29 14:23:02 +02:00
Harald Hoyer 3a04fdff87 fix(fstab-sys): shellcheck for modules.d/95fstab-sys 2021-03-29 13:36:58 +02:00
Harald Hoyer d8d0b03cb4 fix(lunmask): shellcheck for modules.d/95lunmask 2021-03-29 13:36:38 +02:00
Harald Hoyer a201be999e fix(nbd): shellcheck for modules.d/95nbd 2021-03-29 13:36:20 +02:00
Harald Hoyer c5dd11f99f fix(fcoe): shellcheck for modules.d/95fcoe 2021-03-29 13:21:55 +02:00
Harald Hoyer 11e82f3ecc fix(nfs): shellcheck for modules.d/95nfs 2021-03-29 11:40:39 +02:00
Harald Hoyer c305877c58 fix(nvmf): shellcheck for modules.d/95nvmf 2021-03-29 11:39:52 +02:00
Harald Hoyer d15441cef4 fix(qeth_rules): shellcheck for modules.d/95qeth_rules 2021-03-29 11:39:07 +02:00
Harald Hoyer 88a83e0db1 fix(resume): shellcheck for modules.d/95resume 2021-03-29 11:37:56 +02:00
Harald Hoyer 4cbe12a31f fix(rootfs-block): shellcheck for modules.d/95rootfs-block 2021-03-29 11:35:08 +02:00
Harald Hoyer a15a7a1a34 fix(ssh-client): shellcheck for modules.d/95ssh-client 2021-03-29 11:34:46 +02:00
Harald Hoyer 0c4b5cabcf fix(udev-rules): shellcheck for modules.d/95udev-rules 2021-03-29 11:34:31 +02:00
Harald Hoyer e72c1310fa fix(virtfs): shellcheck for modules.d/95virtfs 2021-03-29 11:34:13 +02:00
Harald Hoyer 2e3e2e0820 fix(zfcp): shellcheck for modules.d/95zfcp 2021-03-29 11:31:55 +02:00
Harald Hoyer 032ecd95c9 fix(zfcp_rules): shellcheck for modules.d/95zfcp_rules 2021-03-29 11:31:31 +02:00
Harald Hoyer c0efaeca11 fix(znet): shellcheck for modules.d/95znet 2021-03-29 11:30:55 +02:00
Harald Hoyer f07e695fc5 fix(masterkey): shellcheck for modules.d/97masterkey 2021-03-29 11:30:31 +02:00
Harald Hoyer 7b584edac0 fix(dracut-systemd): shellcheck for modules.d/98dracut-systemd 2021-03-29 11:30:05 +02:00
Harald Hoyer 94157eec8e fix(ecryptfs): shellcheck for modules.d/98ecryptfs 2021-03-29 11:21:35 +02:00
Harald Hoyer 895dd4eb25 fix(integrity): shellcheck for modules.d/98integrity 2021-03-29 11:21:13 +02:00
Harald Hoyer a2faaf8652 fix(pollcdrom): shellcheck for modules.d/98pollcdrom 2021-03-29 11:20:08 +02:00
Harald Hoyer cdf927d3ba fix(selinux): shellcheck for modules.d/98selinux 2021-03-29 11:19:47 +02:00
Harald Hoyer 005a7bda8d fix(img-lib): shellcheck for modules.d/99img-lib 2021-03-29 11:19:26 +02:00
Harald Hoyer f5a14d0f30 fix(memstrack): shellcheck for modules.d/99memstrack 2021-03-29 11:18:14 +02:00
Harald Hoyer 56ea45bd5a fix(shutdown): shellcheck for modules.d/99shutdown 2021-03-29 11:17:11 +02:00
Harald Hoyer 3e1248da7d fix(syslog): shellcheck for modules.d/98syslog 2021-03-29 11:16:05 +02:00
Harald Hoyer 82d9fbf193 fix(fs-lib): shellcheck for modules.d/99fs-lib 2021-03-29 11:15:27 +02:00
Harald Hoyer 4fdc34e503 fix(uefi-lib): shellcheck for modules.d/99uefi-lib 2021-03-29 10:59:40 +02:00
Harald Hoyer f732667d14 fix(dcssblk): shellcheck for modules.d/95dcssblk 2021-03-29 10:56:39 +02:00
Harald Hoyer a19ab29197 fix(dasd_rules): shellcheck for modules.d/95dasd_rules 2021-03-29 10:56:21 +02:00
Harald Hoyer f1c7833a56 fix(dasd_mod): shellcheck for modules.d/95dasd_mod 2021-03-29 10:55:46 +02:00
Harald Hoyer 9dd4d42265 fix(dasd): shellcheck for modules.d/95dasd 2021-03-29 10:55:34 +02:00
Harald Hoyer d75b029a8c fix(zipl): shellcheck for modules.d/91zipl 2021-03-29 10:54:23 +02:00
Harald Hoyer 2d98cb6f63 fix(crypt-loop): shellcheck for modules.d/91crypt-loop 2021-03-29 10:53:56 +02:00
Harald Hoyer ad4f8d13f1 fix(qemu): shellcheck for modules.d/90qemu 2021-03-29 10:53:27 +02:00
Harald Hoyer e601a1ee46 fix(ppcmac): shellcheck for modules.d/90ppcmac 2021-03-29 10:53:07 +02:00
Harald Hoyer 352d6110d0 fix(nvdimm): shellcheck for modules.d/90nvdimm 2021-03-29 10:52:44 +02:00
Harald Hoyer 80f5e83ed5 fix(multipath): shellcheck for modules.d/90multipath 2021-03-29 10:52:28 +02:00
Harald Hoyer 37b1f66f00 fix(lvm): shellcheck for modules.d/90lvm 2021-03-29 10:51:34 +02:00
Harald Hoyer 0315e16955 fix(livenet): shellcheck for modules.d/90livenet 2021-03-29 10:50:51 +02:00
Harald Hoyer f0ad24623a fix(kernel-network-modules): shellcheck for modules.d/90kernel-network-modules 2021-03-29 10:50:16 +02:00
Harald Hoyer 27f5e75893 fix(kernel-modules-extra): shellcheck for modules.d/90kernel-modules-extra 2021-03-29 10:49:52 +02:00
Harald Hoyer a26e12cefc fix(kernel-modules): shellcheck for modules.d/90kernel-modules 2021-03-29 10:46:46 +02:00
Harald Hoyer 1b3b55894e fix(dmraid): shellcheck for modules.d/90dmraid 2021-03-29 10:45:33 +02:00
Harald Hoyer e08c644ee6 fix(cms): shellcheck for modules.d/80cms 2021-03-29 10:43:55 +02:00
Harald Hoyer a4cdc25210 fix(plymouth): shellcheck for modules.d/50plymouth 2021-03-29 10:42:20 +02:00
Harald Hoyer 91f49acd1c fix(gensplash): shellcheck for modules.d/50gensplash 2021-03-29 10:41:38 +02:00
Harald Hoyer 0ba7a48695 fix(drm): shellcheck for modules.d/50drm 2021-03-29 10:12:46 +02:00
Harald Hoyer 8e84fa7262 fix(url-lib): shellcheck for modules.d/45url-lib 2021-03-29 10:12:19 +02:00
Harald Hoyer 8df14af245 fix(ifcfg): shellcheck for modules.d/45ifcfg 2021-03-29 10:11:15 +02:00
Harald Hoyer e8857c59b1 fix(lvmmerge): shellcheck for modules.d/80lvmmerge 2021-03-29 10:10:06 +02:00
Harald Hoyer abc9879c9d fix(cio_ignore): shellcheck for modules.d/81cio_ignore 2021-03-29 10:09:51 +02:00
Harald Hoyer 640458bbf6 fix(btrfs): shellcheck for modules.d/90btrfs 2021-03-29 10:09:26 +02:00
Harald Hoyer 682b297207 fix(crypt): shellcheck for modules.d/90crypt 2021-03-29 10:08:59 +02:00
Harald Hoyer e25c536c70 fix(network): shellcheck for modules.d/40network 2021-03-29 09:57:50 +02:00
Harald Hoyer d76a2cfe21 fix(network-wicked): shellcheck for modules.d/35network-wicked 2021-03-29 09:57:23 +02:00
Harald Hoyer 00ca6bed37 fix(i18n): shellcheck for modules.d/10i18n 2021-03-29 09:56:49 +02:00
Harald Hoyer 2b5ddc7722 fix: shellcheck for dracut*.sh 2021-03-29 09:54:52 +02:00
Harald Hoyer 0342a7d11c docs: add docs/BASH.md
Add a little document providing help in common bash problems.
2021-03-26 16:08:49 +01:00
Harald Hoyer 10616019de fix(systemd): shellcheck for modules.d/00systemd 2021-03-26 15:16:07 +01:00
Harald Hoyer 25f6841344 fix(network-manager): shellcheck for modules.d/35network-manager 2021-03-26 15:02:59 +01:00
Harald Hoyer ec12017055 fix(convertfs): shellcheck for modules.d/30convertfs 2021-03-26 13:44:20 +01:00
Harald Hoyer 4042816955 fix(dbus-daemon): shellcheck for modules.d/06dbus-daemon 2021-03-26 13:24:45 +01:00
Harald Hoyer 5a420e6183 fix(watchdog): shellcheck for modules.d/04watchdog 2021-03-26 13:24:17 +01:00
Harald Hoyer 7193b6f0cb fix(dbus-broker): shellcheck for modules.d/06dbus-broker 2021-03-26 13:23:59 +01:00
Harald Hoyer 95729721cc fix(watchdog-modules): shellcheck for modules.d/04watchdog-modules 2021-03-26 13:22:53 +01:00
Harald Hoyer fac7505b69 fix(modsign): shellcheck for modules.d/03modsign 2021-03-26 13:14:16 +01:00
Harald Hoyer 231917e9b5 fix(systemd-networkd): shellcheck for modules.d/02systemd-networkd 2021-03-26 13:02:57 +01:00
Harald Hoyer 3dbc6c3d44 fix(caps): shellcheck for modules.d/02caps 2021-03-26 13:01:34 +01:00
Harald Hoyer 8bf6861b58 fix(systemd-sysusers): shellcheck for modules.d/01systemd-sysusers 2021-03-26 13:01:17 +01:00
Harald Hoyer 8e10fa7d27 fix(systemd-sysctl): shellcheck for modules.d/01systemd-sysctl 2021-03-26 12:59:52 +01:00
Harald Hoyer ddc7bf456a fix(systemd-repart): shellcheck for modules.d/01systemd-repart 2021-03-26 12:59:20 +01:00
Harald Hoyer c3a9a8cf3d fix(systemd-initrd): shellcheck for modules.d/01systemd-initrd 2021-03-26 12:27:24 +01:00
Harald Hoyer b8ca67280f fix(systemd-coredump): shellcheck for modules.d/01systemd-coredump 2021-03-26 12:24:22 +01:00
Harald Hoyer 3f114d3e31 fix(systemd-ask-password): shellcheck for modules.d/01systemd-ask-password 2021-03-26 12:21:09 +01:00
Harald Hoyer 6aa59dd8ab fix(fips): shellcheck for modules.d/01fips 2021-03-26 12:20:15 +01:00
Harald Hoyer f8e90c8f70 fix(warpclock): shellcheck for modules.d/00warpclock 2021-03-26 12:17:19 +01:00
Harald Hoyer 2fabaaa62d fix(base): shellcheck for modules.d/99base
Also remove some functions, which are not used and broken anyway.
2021-03-26 12:17:00 +01:00
Harald Hoyer cbef7cf3da fix(squash): shellcheck for modules.d/99squash 2021-03-26 11:26:02 +01:00
Harald Hoyer f274cf4c81 fix(biosdevname): shellcheck for modules.d/97biosdevname 2021-03-26 11:23:23 +01:00
Harald Hoyer 2097e38490 fix(terminfo): shellcheck for modules.d/95terminfo 2021-03-26 11:22:09 +01:00
Harald Hoyer 3736ed7ca4 fix(debug): shellcheck for modules.d/95debug 2021-03-26 11:19:13 +01:00
Harald Hoyer fb3a30efbf fix(qemu-net): shellcheck for modules.d/90qemu-net 2021-03-26 11:17:07 +01:00
Harald Hoyer 8109b6c0d4 fix(dmsquash-live-ntfs): shellcheck for modules.d/90dmsquash-live-ntfs 2021-03-26 11:13:04 +01:00
Harald Hoyer 1ce0eeffab fix(dbus): shellcheck for modules.d/09dbus 2021-03-26 11:07:59 +01:00
Harald Hoyer 74668e212d fix(rngd): shellcheck for modules.d/06rngd 2021-03-26 11:07:45 +01:00
Harald Hoyer f32b5e582e fix(rescue): shellcheck for modules.d/03rescue 2021-03-26 11:06:05 +01:00
Harald Hoyer f506c4268b fix(mksh): shellcheck for modules.d/00mksh 2021-03-26 10:56:54 +01:00
Harald Hoyer b470a79c18 fix(dash): shellcheck for modules.d/00dash 2021-03-26 10:55:53 +01:00
Harald Hoyer dafdf37268 fix(bash): shellcheck for modules.d/00bash 2021-03-26 10:55:36 +01:00
Harald Hoyer 90c679e753 ci: shellcheck all directories with .sh 2021-03-26 09:35:30 +01:00
Harald Hoyer d376b98537 test: add shellcheck to Makefile 2021-03-26 09:35:30 +01:00
Harald Hoyer cc914eaa8b style: use shfmt 3.2.4 2021-03-19 11:34:05 +01:00
David Hildenbrand f3dcb60619 feat(qemu): include the virtio_mem kernel module
This adds support for virtio-mem devices, which provide a dynamic
amount of memory in a VM. Right now, the driver gets loaded and any
memory gets added to the system when loading the kernel module from disk.

While not strictly required to boot, we want to be able to
1) add virito-mem provided memory to the system early while booting up
2) add virtio-mem provided memory even when booting without a disk
3) add virtio-mem devices without adding actual memory in kdump
   environments such that we can query things like:
 a) is a certain PFN currently plugged in the hypervisor and, therefore,
    should actually be read when creating a system dump. (kexec-tools
    prepares the vmcore header, like on x86-64)
 b) which ranges of a virtio-mem device are currently plugged in the
    hypervisor and, therefore, should be added to the dump. (vmcore header
    gets prepared by the crashkernel, like on s390x)
 Note that loading virtio-mem in kdump environments currently fails with
 -EBUSY -- but there are plans to install proper hooks instead to support
  especially a) in the near future.

1) and 2) are only really effective when memory hotplug is configured to
automatically online all added system RAM in the kernel (and not late,
via udev rules): e.g., via "mhp_default_state=online" on the kernel
cmdline or via CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE in the kernel.

Especially 2) and 3) require the module to be present inside the initial
ramdisk. The primary use case for including it in the initial ramdisk
is 3).

Signed-off-by: David Hildenbrand <david@redhat.com>
2021-03-18 15:04:10 +01:00
Harald Hoyer 2ec7fa190e style(install): astyle post correction 2021-03-15 15:37:08 +01:00
Harald Hoyer b7b8eedab5 docs: document astyle in HACKING.md 2021-03-15 15:37:08 +01:00
Harald Hoyer f1ed92c348 style: use astyle for C formatting 2021-03-15 15:37:08 +01:00
Harald Hoyer 5667978e7b style: use astyle instead of indent 2021-03-15 15:37:08 +01:00
Harald Hoyer 0850cf532d style(install): use block for the FOREACH macros 2021-03-15 15:37:08 +01:00
Harald Hoyer 9e587f0008 ci: splitout indent-c from indent
... to be able to call it from CI
2021-03-15 15:37:08 +01:00
Harald Hoyer 07b65603ff test: check for shfmt in Makefile 2021-03-15 15:37:08 +01:00
Jóhann B. Guðmundsson 01126a209a chore(.packit.yml): adding all fedora release + centos to packit
With this config change,copr builds will happen on pull requests
for all fedora development branches and the next major RHEL release
( fedora-eln ) and on commits, copr builds will happen on all fedora
release and the next major RHEL release.
2021-03-15 10:20:08 +01:00
Harald Hoyer 567c455753 fix(udev-rules): add btrfs udev rules by default
Install `64-btrfs.rules` unconditionally to mark btrfs devices ready or
not.

In case no `btrfs` kernel module is available in the initramfs, the
device should not be ready.

Depends on: https://github.com/systemd/systemd/pull/18802

Fixes: https://github.com/dracutdevs/dracut/issues/947
2021-03-13 20:13:13 +01:00
Harald Hoyer d4caa86aba feat(btrfs): add 64-btrfs-dm.rules rules 2021-03-13 19:12:54 +00:00
Harald Hoyer d85b7e4edd ci: add lint for C and shell format 2021-03-13 20:10:43 +01:00
Harald Hoyer 0561f953c4 docs: document code formatting in HACKING.md 2021-03-13 20:10:43 +01:00
Harald Hoyer 9bc5282e30 style: `make indent` for C 2021-03-13 20:10:43 +01:00
Harald Hoyer 2b50b67c50 style: shfmt post reformat 2021-03-13 20:10:43 +01:00
Harald Hoyer 75d758e8f1 style: shfmt -s reformat
reproducible with:

```
$ shfmt_version=3.0.1
$ wget "https://github.com/mvdan/sh/releases/download/v${shfmt_version}/shfmt_v${shfmt_version}_linux_amd64" -O shfmt
$ chmod u+x shfmt
$ ./shfmt -w -s .
```
2021-03-13 20:10:43 +01:00
Harald Hoyer 9a52c3fdb0 style: shfmt reformat
reproducible with:

```
$ shfmt_version=3.0.1
$ wget "https://github.com/mvdan/sh/releases/download/v${shfmt_version}/shfmt_v${shfmt_version}_linux_amd64" -O shfmt
$ chmod u+x shfmt
$ ./shfmt -w .
```
2021-03-13 20:10:43 +01:00
Harald Hoyer 560402c3dc style: shfmt pre correction 2021-03-13 20:10:43 +01:00
Harald Hoyer e0a0fa6174 feat: extend Makefile indent target
- extend the C indent file pattern
- add shfmt, if installed
2021-03-13 20:10:43 +01:00
Harald Hoyer eddca44221 chore: add .shellcheckrc 2021-03-13 20:10:43 +01:00
Harald Hoyer 9012f3996b fix: set vimrc and emacs indention according to .editorconfig 2021-03-13 20:10:43 +01:00
Harald Hoyer 1f621aba37 feat: customize .editorconfig according to shfmt 2021-03-13 20:10:43 +01:00
Harald Hoyer 5d99b4d0eb test: fix test 98 getarg
Fix a mis-replaced comparison.
2021-03-12 09:20:32 +01:00
Harald Hoyer 60a34d8b11 fix(network-legacy): silence getargs 2021-03-10 19:31:19 +01:00
Harald Hoyer 72cba8aecd test: sync and poweroff in create-root.sh 2021-03-10 19:31:19 +01:00
Harald Hoyer 1b61cfdbec fix: use getargs with _cryptgetargsname 2021-03-10 19:31:19 +01:00
Harald Hoyer 455329cf71 test: change the LABEL to include spaces
Test for root device with a LABEL, which includes spaces.
2021-03-10 19:31:19 +01:00
Harald Hoyer b800edd698 fix(base): wait_for_dev quote shell variables 2021-03-10 19:31:19 +01:00
Harald Hoyer d3532978de refactor: factor out label_uuid_to_dev 2021-03-10 19:31:19 +01:00
Harald Hoyer 40fc0ad40d chore: update .gitignore 2021-03-10 19:31:19 +01:00
Harald Hoyer 501d82f796 fix: correctly handle kernel parameters
The kernel has an odd way to handle `"` surrounded parameters.
To handle the parameters as the kernel would do, no simple shell script
suffices, so a new utility `dracut-util` is introduced. Written in "C"
it handles `dracut-getarg` and `dracut-getargs` as the old shell script
functions `_dogetarg` and `_dogetargs` would.
2021-03-10 19:31:19 +01:00
Harald Hoyer d643156d56 fix: remove dracut.pc on `make clean` 2021-03-10 17:58:37 +01:00
Harald Hoyer d8a454a537 fix: honor KVERSION environment in the Makefile 2021-03-10 17:58:08 +01:00
Jonas Jelten b12f8188a4 feat(nbd): support ipv6 link local nbds 2021-03-09 13:58:10 +00:00
Kairui Song 7c0bc0b2fd perf: disable initrd compression when squash module is enabled
With squash module, the initramfs is double compressed, which slow down
the build progress and doesn't shrink the size much.
2021-03-09 13:40:35 +00:00
Kairui Song 5d05ffbd87 feat: squash module follow --compress option
Try to make mksquashfs follow --compress option if squash module is
included, if not specified or invalid, fall back to use mksquashfs's
default compressor.
2021-03-09 13:40:35 +00:00
Kairui Song a9345f6800 refactor: delay compressor detection
No function change, decide which compressor to use right before
compressing the initramfs.

This may delay the print of this message:
"dracut: no compression tool available. Initramfs image is going to be big."
but should be OK, this message is not an error.
2021-03-09 13:40:35 +00:00
Kairui Song 90f269f6af feat(squash): use busybox for early setup if available
Use busybox can help reduce the size of early setup environment.

With this change, everything is packed in the squash image, and
the setup files will be dropped once squash image setup is done,
so initramfs stage memory usage is reduced to the minimun,
and initramfs decompress is also faster.

File layout of a squash initramfs looks like this:

========================================================================
drwxr-xr-x   1 root     root            0 Feb 15 14:07 .
-rwxr-xr-x   1 root     root          946 Feb 15 14:07 init
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 lib -> usr/lib
drwxr-xr-x   1 root     root            0 Feb 15 14:07 squash
-rw-r--r--   1 root     root     91000832 Feb 15 14:07 squash-root.img
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/bin
-rwxr-xr-x   1 root     root      1293688 Jul 27  2020 usr/bin/busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/echo -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/mkdir -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/modprobe -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/mount -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/sh -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/switch_root -> busybox
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib/dracut
-rw-r--r--   1 root     root           23 Feb 15 14:07 usr/lib/dracut/build-parameter.txt
-rw-r--r--   1 root     root           31 Feb 15 14:07 usr/lib/dracut/dracut-051-93.git20210215.fc33
-rw-r--r--   1 root     root          358 Feb 15 14:07 usr/lib/dracut/modules.txt
-rw-r--r--   1 root     root            0 Feb 15 14:07 usr/lib/dracut/need-initqueue
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib/modules
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib/modules/5.10.11-200.fc33.x86_64
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib/modules/5.10.11-200.fc33.x86_64/kernel
<... kernel module misc files skipped ... >
========================================================================
2021-03-09 13:40:35 +00:00
Kairui Song 8f7c332e48 refactor(squash): structure in a cleaner way
Simplify the squash mount layout. Instead of overlay on each top
directory (/etc, /usr), just mount and switch_root into the squash
image, with a overlay on top of it.

Also install the binaries and setup scripts separately, so the squash
setup code and the squash image content is independent of each other,
all squash setup script and binaries can be deleted safely upon
switch_root.

With this change, previous squash clean up service and other tricky
implementations are all gone.

This commit depends on systemd commits from:
https://github.com/systemd/systemd/pull/18124

Previouly systemd doesn't recognize non-ramfs initramfs, now this is
doable with SYSTEMD_IN_INITRD=lenient

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-03-09 13:40:35 +00:00
Kairui Song bdd194bb8c refactor(squash): don't record mount points in text file
The squasn mount points are recorded in text file so later clean up
script can umount them, this is not needed, the mount points are fixed
so just detect the umount by hardcoded pattern.
2021-03-09 13:40:35 +00:00
Kairui Song 5a18b24a8b feat(squash): install and depmod modules seperately
Separately install the modules required for squash image setup.
These modules can be deleted after squash image setup to save
memory.

Signed-off-by: Kairui Song <kasong@redhat.com>
2021-03-09 13:40:35 +00:00
Kairui Song f9f4264d03 refactor(squash): move all setup code to init-squash.sh
Seperate of init.sh and setup-squash.sh is pointless, merge them into one.
2021-03-09 13:40:35 +00:00
Kairui Song 8c8aecdc63 fix(squash): post install should be the last step before stripping
Ensure dracut squash module doesn't effect other steps, and stripping
can cover the new binaries installed by it.
2021-03-09 13:40:35 +00:00
Kairui Song 95ea16aa60 refactor(squash): move the post install scripts into the module-setup.sh
No function change, just move the post install code to 99squash to clean
up dracut.sh.
2021-03-09 13:40:35 +00:00
Kairui Song c552c99ef8 fix(squash): this module shouldn't depend on bash
Any other shell should just work.
2021-03-09 13:40:35 +00:00
Jóhann B. Guðmundsson 28545cda45 chore(labeler): remove the needs review label
There is no longer need to have pull requests labeled with the needs
review label since reviews are now mandatory on pull request.
2021-03-03 13:23:15 +00:00
Jóhann B. Guðmundsson 9cf7b1c529 fix: always use mkdir -p
Ensuring that directory creations dont trigger error if directory
previously existed as well as create parent directories if needed.
2021-03-03 13:06:02 +01:00
Daniel Molkentin 92e6a8f879 fix(kernel-modules): optionally add /usr/lib/modules.d to initramfs
On SUSE, there is no /lib/modules.d, only /usr/lib/modules.d.

Upstream-Bug: http://bugzilla.opensuse.org/show_bug.cgi?id=1180822

Reference: bsc#1180822
2021-03-03 11:42:09 +01:00
Lennart Poettering a96900a82c fix(dracut-systemd): don't refuse root=tmpfs when systemd is used
A match for systemd PR#18847
2021-03-02 21:23:03 +00:00
Renaud Métrich d8e47e201a fix(dracut.sh): harden dracut against GZIP environment variable
When a GZIP environment variable is set, this leads to various breakage:

In case 'pigz' is installed and GZIP is defined as a path, e.g.
/usr/local/bin/gzip, then dracut will fail with the following message:

   "
   pigz: abort: cannot provide files in GZIP environment variable
   "

In case 'pigz' isn't installed and regular 'gzip' is used and GZIP is
defined as a path, e.g. /usr/local/bin/gzip, then the path will be
zipped and dracut will fail for no obvious reason.  Trying again, dracut
will then fail with following message:

   "
   gzip: /usr/local/bin/gzip.gz already exists;	not overwritten
   "

In any case, GZIP environment should be unset to avoid breakage or
unwanted behaviour. This variable is anyway obsolescent, from gzip(1)
manpage.

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
2021-03-02 11:05:52 +01:00
Harald Hoyer 630334950c feat(skipcpio): speed up and harden skipcpio
Before:
```
Benchmark #1: ./skipcpio/skipcpio test-5.10.15-200.fc33.x86_64.img >/dev/null
  Time (mean ± σ):     125.5 ms ±   0.9 ms    [User: 97.4 ms, System: 27.9 ms]
  Range (min … max):   124.8 ms … 129.4 ms    23 runs
```

After:
```
Benchmark #1: ./skipcpio/skipcpio test-5.10.15-200.fc33.x86_64.img >/dev/null
  Time (mean ± σ):      12.2 ms ±   0.3 ms    [User: 2.7 ms, System: 9.5 ms]
  Range (min … max):    11.7 ms …  13.6 ms    212 runs
```

Besides the speedup, skipcpio now parses the cpio header and is not
falsely ending when the early cpio payload contains `TRAILER!!!`.

Fixes: https://github.com/dracutdevs/dracut/issues/1123
2021-02-25 14:48:22 +01:00
Harald Hoyer c67b624637 docs: update NEWS.md and AUTHORS 2021-02-23 16:11:01 +01:00
Harald Hoyer 62f3a10d5d docs: update RELEASE.md
* clog from last tag
* push commits to kernelorg also
2021-02-23 16:11:01 +01:00
Jóhann B. Guðmundsson 1edf54e275 feat(github): adding packit support for fedora maintenance
Adding initial packit [1] support for fedora maintenance which
should automate the release process from upstream release to fedora.

1. https://packit.dev
2021-02-23 16:04:23 +01:00
Harald Hoyer c8ebb80590 fix(dracut.sh): remove unneeded variables
There is no `fstab_lines_l` variable used before.

The `--include` option was turned into `++include` and therefore the
switch option is not reachable anymore.
2021-02-23 16:03:44 +01:00
Sergei Iudin d87ae13721 fix(dracut.sh): unfreeze /boot on exit
If SIGWHATEVER will be processed after fsfreeze -f, but before fsfreeze
-u we will end up with /boot/ never unfrozen, let's try to minimize risk of this.
2021-02-23 09:25:08 +01:00
Evgeni Golov c3f241849d fix: skip empty modalias files in drm module setup
on my system (ThinkPad X201s) I have several modalias entries that are
empty:

    /sys/bus/platform/devices/dock.0/modalias
    /sys/bus/platform/devices/dock.1/modalias
    /sys/bus/platform/devices/dock.2/modalias

executing the drm module setup thus results in the following errors

    dracut-install: No SOURCE argument given

when calling dracut_instmods and hostonly mode is enabled.

Skip those entries, as there are no modules to load in this case
anyways.

Note: it is not sufficient to use [['s -s test (file size is greater
than zero), as all those files are 4096B if you stat them.
2021-02-22 14:55:44 +01:00
Lukas Nykryn c17c5b7604 fix(network-manager): run as a service if systemd module is present
In the current state, services that depend on network need to
use dracut hooks, since nothing with pull in the network
targets into the transaction.

In the future, it would be nice to provide developers on systemd-only
systems the possibility to not use dracut hooks at all, but simply put
normal systemd services into the initrd.

Also, some modules even right now depend on systemd ordering, like
cryptsetup, so let's make sure, that the ordering inside systemd work
properly as well.
2021-02-19 11:20:59 +01:00
Lukas Nykryn 34c73b339b fix(network-manager): rework how NM is started in debug mode
Instead of running directly NM with --debug, create a drop-in in
nm-config.sh. This will make sure, that we can get the debug output
regardless the way how NM will be started.
2021-02-19 11:20:59 +01:00
Lukas Nykryn 6f7823bce6 fix(fcoe): rename rd.nofcoe to rd.fcoe
The current name of this bool is kinda stupid. Based on the manpage
setting it to 0 turns off fcoe, which means that nofcoe=1 should mean
that it is on.

Let's just do the same thing as with rd.lvm=0, rd.luks=0,....
2021-02-19 09:28:57 +00:00
Lukas Nykryn 805b46c2a8 fix(fcoe): rd.nofcoe=0 should disable fcoe
8446c8f9 Changed the default behavior, but also flipped meaning of 0/1.
Right now rd.nofcoe=0 enables fcoe, which is the opposite what manpage
says.
2021-02-19 09:28:57 +00:00
Andrew J. Hesford d437970c01 fix: proper return code for inst_multiple in dracut-init.sh
A test of the form

    if ! command; then
        _ret=$?
        ...
        return _ret
    fi

does not capture the return code of `command`, but the negation of the
return code, leaving _ret == 0. The test of this form in inst_multiple
has been refactored to capture and return the right value.
2021-02-19 09:03:53 +01:00
Tomasz Paweł Gajc f8b38ecd7c chore: update authors in .mailmap 2021-02-18 14:10:23 +00:00
Harald Hoyer 5387ed24c8 fix(i18n): get rid of `eval` calls
By changing KBDSUBDIRS to a bash array, all kinds of `eval` quirks are
avoided.
2021-02-16 15:49:02 +01:00
Harald Hoyer 9e1c7f3dea fix(i18n): create the keyboard symlinks again
Invalid space broke the creation of the keyboard subdirectories,
leading to a symbolic link

usr/share/consolefonts,consoletrans,keymaps,unimaps ->
/usr/lib/kbd/consolefonts,consoletrans,keymaps,unimaps

in the created initramfs.

With this fix the correct symlinks are created again:

usr/share/consolefonts -> /usr/lib/kbd/consolefonts
usr/share/consoletrans -> /usr/lib/kbd/consoletrans
usr/share/keymaps -> /usr/lib/kbd/keymaps
usr/share/unimaps -> /usr/lib/kbd/unimaps
2021-02-16 15:49:02 +01:00
Jóhann B. Guðmundsson 2c9debec02 fix(github): exempt issues with the label bug
Let's exempt issues with the label bugs being processed by stalebot.
2021-02-16 10:16:10 +01:00
Harald Hoyer 895c2f65d4 docs: update docs/RELEASE.md 2021-02-16 10:15:39 +01:00
Harald Hoyer 3fce68bd1d docs: update NEWS.md and AUTHORS 2021-02-15 17:30:54 +01:00
Harald Hoyer 1a604e2a4a chore: add `CONTRIBUTORS` target to Makefile 2021-02-15 16:54:44 +01:00
Harald Hoyer 0b86c0607f docs: update docs/RELEASE.md 2021-02-15 16:53:51 +01:00
Harald Hoyer 095b77bee8 docs: move NEWS to NEWS.md 2021-02-15 15:33:41 +01:00
Harald Hoyer d85c71fb69 ci: force binary files for grep on disk images
Because some of the CI tests fail randomly while grepping for the
test success marker, let's be specific of the file format grep will
search to eleminate all failure sources.
2021-02-15 15:05:15 +01:00
Jóhann B. Guðmundsson ebac18baad docs: RELEASE.md
Creating the /docs directory which will contain all project related
documentation and will also host the projects github based website
in the future.

Adding RELEASE.md which is a document that outlines the release process.
2021-02-15 12:48:16 +01:00
Harald Hoyer ad64c6864c fix: shellcheck for dracut-init.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer cdb714c539 fix: shellcheck for dracut-init.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 994d003540 fix: shellcheck for dracut-init.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 63356d544b fix: shellcheck for dracut-init.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 2d4344bca9 fix: shellcheck for dracut-init.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 41cfdfc4d3 fix: shellcheck for dracut.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 510a22116b fix: shellcheck for dracut.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 2c10b29999 fix: shellcheck for dracut.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 7b59d15d96 fix: shellcheck for dracut.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer dd8ff5311f fix: shellcheck for dracut.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 6dc1cd052b fix: shellcheck for dracut.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 7310a8484e fix: shellcheck for dracut.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 3483509ef6 fix: shellcheck for dracut-functions.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer aa225ca3b0 fix: shellcheck for dracut-logger.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 6510ab3f9d fix: shellcheck for modules.d/99squash/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 73f5cc7c37 fix: shellcheck for modules.d/99squash/clear-squash.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 119bb1b81d fix: shellcheck for modules.d/99fs-lib/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 18ff79021c fix: shellcheck for modules.d/99base/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 060732d927 fix: shellcheck for modules.d/99base/dracut-lib.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 9ea66e5682 fix: shellcheck for modules.d/95zfcp_rules/parse-zfcp.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 9eb77ff864 fix: shellcheck for modules.d/95udev-rules/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 10d01cc45d fix: shellcheck for modules.d/95terminfo/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer a1b3c13e3a fix: shellcheck for modules.d/95ssh-client/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer dbdd7ad4c1 fix: shellcheck for modules.d/95rootfs-block/block-genrules.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 9fb16311a4 fix: shellcheck for modules.d/95resume/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 748293ff56 fix: shellcheck for modules.d/95nfs/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer d18e808358 fix: shellcheck for modules.d/95iscsi/cleanup-iscsi.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 865390c7ca fix: shellcheck for modules.d/95fstab-sys/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer d4b1d669d7 fix: shellcheck for modules.d/95fcoe/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 9c0deb9f68 fix: shellcheck for modules.d/95fcoe/cleanup-fcoe.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer ce15ca57a2 fix: shellcheck for modules.d/95debug/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer cfac3a5675 fix: shellcheck for modules.d/95dcssblk/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 48cc484a4b fix: shellcheck for modules.d/95dasd_rules/parse-dasd.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer e4b1460433 fix: shellcheck for modules.d/95cifs/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 760a4370f0 fix: shellcheck for modules.d/95cifs/cifsroot.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 33e9727ee7 fix: shellcheck for modules.d/91crypt-gpg/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 87ea36797f fix: shellcheck for modules.d/90mdraid/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer b29b9e9627 fix: shellcheck for modules.d/90mdraid/mdraid_start.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 819b24fe2e fix: shellcheck for modules.d/90lvm/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer d586ff7001 fix: shellcheck for modules.d/90lvm/lvm_scan.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 6e70e9f1b1 fix: shellcheck for modules.d/90kernel-network-modules/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 8eef563f71 fix: shellcheck for modules.d/90kernel-modules-extra/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 7b1d342e60 fix: shellcheck for modules.d/90dmsquash-live/apply-live-updates.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 9c4662d02b fix: shellcheck for modules.d/90dm/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 0b920b83f2 fix: shellcheck for modules.d/90crypt/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 891ca19c49 fix: shellcheck for modules.d/90btrfs/btrfs_finished.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 7bfe7daa51 fix: shellcheck for modules.d/90btrfs/btrfs_device_ready.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 0412f42771 fix: shellcheck for modules.d/50plymouth/plymouth-populate-initrd.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 5feb62872e fix: shellcheck for modules.d/50gensplash/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer cdf03476d1 fix: shellcheck for modules.d/45url-lib/url-lib.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 10f3b19606 fix: shellcheck for modules.d/40network/net-lib.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer e7b4442cfc fix: shellcheck for modules.d/40network/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 6d2574d509 fix: shellcheck for modules.d/10i18n/parse-i18n.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer aa05b741e3 fix: shellcheck for modules.d/10i18n/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer f9cbd928ce fix: shellcheck for modules.d/06dbus-daemon/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 47f3a3d56d fix: shellcheck for modules.d/03modsign/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer e9053b1886 fix: shellcheck for modules.d/02systemd-networkd/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 4e3133e622 fix: shellcheck for modules.d/02caps/caps.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 4e3332ffa8 fix: shellcheck for modules.d/00systemd/module-setup.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer e770ad31a6 fix: shellcheck for mkinitrd-suse.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 802f8b6218 fix: shellcheck for mkinitrd-dracut.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer ecf7e74f4a fix: shellcheck for lsinitrd-bash-completion.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 785d1a1ede fix: shellcheck for fedora-test-github.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 22fceeac80 fix: shellcheck for dracut-catimages.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer fb7b8be883 fix: shellcheck for dracut-bash-completion.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer f4053eb0c8 fix: shellcheck for configure 2021-02-15 11:00:37 +01:00
Harald Hoyer 7356c828b0 fix: shellcheck for 51-dracut-rescue.install 2021-02-15 11:00:37 +01:00
Harald Hoyer 95013ffce9 fix: shellcheck for 50-dracut.install 2021-02-15 11:00:37 +01:00
Harald Hoyer 836e2ffac6 fix: shellcheck for modules.d/99squash/setup-squash.sh 2021-02-15 11:00:37 +01:00
Harald Hoyer 67bcc49304 docs: fix dracut.cmdline.7
```
asciidoc: WARNING: dracut.cmdline.7.asc: line 1115: nested inline passthrough
```
2021-02-15 09:31:57 +01:00
Harald Hoyer dbb8a98b29 ci: wait for udev before doing sfdisk
might be responsible for some flakiness
2021-02-15 09:31:01 +01:00
Harald Hoyer 0f807f49cf ci: more disk space for test 30 iscsi
```
mke2fs 1.45.6 (20-Mar-2020)

Filesystem too small for a journal
Discarding device blocks:          done
Creating filesystem with 1024 1k blocks and 128 inodes

Allocating group tables: 0/1   done
Writing inode tables: 0/1   done
Writing superblocks and filesystem accounting information: 0/1   done

cp: error writing '/sysroot/usr/bin/bash': No space left on device
cp: error writing '/sysroot/usr/bin/grep': No space left on device
cp: error writing '/sysroot/usr/bin/ping': No space left on device
[…]
```
2021-02-15 09:30:29 +01:00
Beniamino Galvani 79ed45e021 fix: update dbus module directory in spec file
The directory name was changed in 16efdfa25c.
2021-02-15 08:07:33 +00:00
Jóhann B. Guðmundsson 9edabfa600 fix: add sdaskpw and sdsyctl to spec file
Adding systemd-ask-password and systemd-sysctl to the spec file

Alphabeticaly order the newly introduced systemd based module
in the spec file.
2021-02-10 21:26:56 +01:00
Jóhann B. Guðmundsson 5cd1a9fb13 fix: cosmetic comment fixes
This rephrases a comment in the check() as requested on another PR
and generalizes the install() section comments on par with other recent
module changes.
2021-02-10 21:26:35 +01:00
Jóhann B. Guðmundsson dc00256e12 feat(systemd-ask-password): introducing systemd-ask-password module
Introducing systemd-ask-password module which is used to query a
system password or passphrase from the user.

This module can be used standalone ( systemd-ask-password )
( which is without plymouth & wall support )
With plymouth module ( systemd-ask-password + plymouth )
With wall module ( systemd-ask-password + wall ), which is currently
commented out since there is no forceable usecase for it or even exiting
wall module.

This is a standalone systemd module which means it depends on no other module than systemd.
2021-02-10 15:10:56 +01:00
Luiz Angelo Daros de Luca ba3f4cdadc Revert "nbd: use systemd-run to start nbd-client"
systemd-run runs nbd-client in parallel. This introduces a possible
race condition when /dev/nbd0 is not directly used by /sysroot mount
but used by another dracut module as in:

  netroot=nbd:ip:port:fstype root=live:/dev/nbd0

Before nbd0 usages are synchronized, it is better to keep it serial.

This reverts commit 9fd0461b7d.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2021-02-10 15:02:41 +01:00
Luiz Angelo Daros de Luca 51b36f56d8 dmsquash-live-root: squashfs in bare device
Check if dev in root=live:<dev> might be already the squashfs image.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
2021-02-10 15:02:41 +01:00
Jóhann B. Guðmundsson dff9baf3b4 feat(systemd-sysctl): introducing systemd-sysctl module
Introducing systemd-sysctl module which is an early boot
service that configures sysctl.

The systemd-sysctl module has dependency's on systemd and
systemd-modules-load module.
2021-02-10 15:00:45 +01:00
Jóhann B. Guðmundsson ba2e760b91 fix: adding missing efi paths 2021-02-10 14:39:54 +01:00
Harald Hoyer b56448ba09 docs: fix CI badges in README 2021-02-10 14:39:11 +01:00
Harald Hoyer 1ebf454884 fix: correct the squash quirk
Previously with `no_kernel` the `for` loop errored on the modules
wildcard. By checking, if the file exists, this is mitigated.

"mv" asked interactively, if aliased in the user session, so a "--force"
was added.
2021-02-10 14:14:39 +01:00
Jóhann B. Guðmundsson fdbe7f9fbf feat(systemd-modules-load): introducing systemd-modules-load module
Introducing systemd-modules-load which is an early boot service
that loads kernel modules from a static list, which is required for
kernel modules that do for example not support automatic module loading
( like key type parsers ).
2021-02-10 13:13:18 +00:00
Petr Pavlu 38ef319390 fix(shutdown): add timeout to umount calls
When terminating a system, the shutdown module attempts to unmount all
file systems from under /oldroot. This reaps remaining file systems that
systemd cannot unmount and detaches /oldroot itself.

In case that running umount for some file system repeatedly fails, the
module reports this error and continues the processing in order to
shutdown the system. This handles a condition when the umount command
actually terminates but it can happen in some cases that it waits
indefinitely.

An example with NFS mounts:
# mount -t nfs 192.168.0.1:/srv/nfs/dir /mnt/nfs
# mkdir /mnt/nfs/dir2
# mount -t nfs 192.168.0.1:/srv/nfs/dir2 /mnt/nfs/dir2
# touch /mnt/nfs/dir2/file
# systemd-run -pKillMode=none -pSendSIGKILL=no tail -f /mnt/nfs/dir2/file
Running as unit: run-r367825c967ca4d88a793ae4793c02f8b.service
# systemctl poweroff

The invoked tail command escapes normal termination by systemd and
prevents stopping mnt-nfs.mount and mnt-nfs-dir2.mount as it makes the
mounts busy. Systemd then again attempts to unmount these file systems
in systemd-shutdown but this fails as well. The utility tries to unmount
/mnt/nfs/dir2 but the kernel waits indefinitely doing a path lookup for
/mnt/nfs because network is no longer available at that point. The
systemd-shutdown gives up after 90 seconds. Finally, the control is
transferred to dracut which tries to unmount the file systems in the
same way and ends up indefinitely waiting on umount to finish.

This situation causes that the system hangs during shutdown. The patch
improves the shutdown module to add a timeout of 90 seconds for the
umount operation and continue with the shutdown if it gets reached,
similarly to what systemd-shutdown does.
2021-02-10 14:06:37 +01:00
Harald Hoyer 45907c1d4d ci: disable tests with NFS kernel crashes
Tests 50, 51, 60, 61 all suffer from kernel crashes in the kernel nfsd.

Until this is resolved, disable these tests.
2021-02-10 13:56:40 +01:00
Harald Hoyer 35bd0b4ac1 ci: only bind /dev/kvm into the container
dracut is only interested to use `/dev/kvm` if available.
2021-02-10 13:56:40 +01:00
Harald Hoyer a6faf453a8 ci: reduce CI workload
Only run `fedora-latest` and `fedora-32` on actual merge.
2021-02-10 13:56:40 +01:00
Harald Hoyer 16efdfa25c fix: revise all module checks
1. no module checks for modules which are in depends()
2. no `derror` for optional (255) modules checking for dependencies
3. fix dbus meta module
2021-02-10 13:29:17 +01:00
Harald Hoyer 1914a2eba1 fix: add missing line continuation 2021-02-10 12:05:24 +01:00
Daniel Molkentin 786ca932e8 fix: BuildRequiring git-core is enough in dracut.spec 2021-02-10 11:12:02 +01:00
Nicolas Saenz Julienne b28e4b20f0 fix(kernel-modules): add reset controllers for arm
Reset controllers might be needed by some of the devices used in the
initrd. Particularly on the Raspberry Pi 4, 'xhci-pci' depends on a
platform specific reset controller.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
2021-02-09 20:35:11 +00:00
David Tardon c46ed697a2 35network-legacy: discard pointless RTNETLINK message
This command prints

    RTNETLINK answers: Network is unreachable

to stderr if IP is not assigned yet, but that's the thing we are
checking for, so there's no point in showing the message.
2021-02-09 21:04:23 +01:00
Zoltán Böszörményi fa06924239 fix(plymouth): install binaries with dependencies
If plymouth is used then its own installation script is preferred.
While plymouth's own variant of inst_binary resolves the library
dependencies properly, its inst_library shell function doesn't
actually install them in some cases properly.

Make sure to install both the required binaries and their
dependencies. In the worst case, it's a NOP.

Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-02-09 18:17:12 +01:00
Harald Hoyer d1c8083b3a fix: correct the line continuation
Comments will break bash line continuation.
Also added some missing line continuation here and there.
2021-02-09 15:33:34 +01:00
Zoltán Böszörményi 702e7e83ed fix(dbus-daemon): use uid/gid from sysroot is dracutsysrootdir is set
Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-02-09 07:09:28 +00:00
Zoltán Böszörményi 767fbf81b6 fix(network-manager): allow override network manager version
With dracutsysrootdir set and foreign binaries in sysroot,
running NetworkManager --version is not possible and it may be
different than the one installed on the host.
NM_VERSION can be used to override it.

Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-02-09 07:09:28 +00:00
Zoltán Böszörményi 18d36fabf5 feat(dracut.sh): allow overriding the systemctl command for sysroot
Allow overriding the systemctl command for sysroot with $SYSTEMCTL
Modified every modules' module-setup.sh to use the envvar instead
of the hardcoded command name.

Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-02-09 07:09:28 +00:00
Zoltán Böszörményi 433a9ec014 fix: use find_binary
Use find_binary instead of type -P because the former works if
dracutsysrootdir is set.

Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-02-09 07:09:28 +00:00
Zoltán Böszörményi bbe1434fca fix(dracut.sh): don't override path with foreign sysroot
Don't override PATH with foreign sysroot and
trim the sysroot prefix from NPATH elements.

Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-02-09 07:09:28 +00:00
Zoltán Böszörményi 03d132a76c fix: quote globbing in module-setup.sh for inst_multiple
Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-02-09 07:09:28 +00:00
Zoltán Böszörményi ddcdee9147 fix(dracut-install): allow globbing for multiple sources
Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-02-09 07:09:28 +00:00
foopub c409108b04 Fix bad ls parsing
This used to cause some echo write/invalid argument errors. Simplest fix is to use readlink with -f for absolute path and -n to remove trailing newline. 
See previous discussion here:
https://github.com/void-linux/void-packages/issues/13024
2021-02-08 23:12:15 +01:00
Alexander Tsoy 6eff0ebcf8 fix: move ldconfig after library workaround
Commit de3cb0e321 moved libpthread workaround after the code that runs
ldconfig. As a result, if installed in a non-default path, libgcc_s.so.1
could not be found by dynamic linker.
2021-02-08 22:44:32 +01:00
Nicolas Chauvet 07c671cc51 feat(kernel-modules): add driver memory
External Memory Controller (EMC) drivers can be built as a module.

On Tegra, this allows tegra_drm to load faster and without deferred
probes, instead of waiting for the rootfs for the tegra*_emc dependencies.

Tested on jetson-tk1 and ac100.

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2021-02-08 21:15:48 +00:00
Jóhann B. Guðmundsson c3446a7ce0 feat(systemd-repart): introducing systemd-repart module
This modules introduces systemd-repart which can be used
to generate partition(s), via a simple systemd-repart
drop-in(s), which can be useful in wide varity of usecase.

feat(systemd-repart): adding module to spec file

feat(systemd-repart): removing unessary requirement on type unit

fix: spelling error
2021-02-08 20:32:16 +00:00
Jóhann B. Guðmundsson 7135c81931 feat(dbus-daemon): introducing the dbus-daemon module
Introdusing dbus-daemon which is based on but superseeds
the previous 06dbus implementation with various enhancements and fixes.

fix: adding new modules to rpm spec file

fix: missed an echo
2021-02-08 20:18:25 +01:00
Jóhann B. Guðmundsson 38cd8125f6 feat(dbus-broker): introducing the dbus-broker module
Introducing the dbus-broker module.
2021-02-08 20:18:25 +01:00
Jóhann B. Guðmundsson 791f392ca6 feat(dbus): introducing a meta module for dbus
We require a meta module to handle multiple modules
2021-02-08 20:18:25 +01:00
Harald Hoyer 6032ade3cc fix(network-legacy): silent check for leaseinfo
Reroute negative checks for leaseinfo to /dev/null to suppress:
```
ls: cannot access '/tmp/leaseinfo.ens2*': No such file or directory
```
2021-02-08 17:18:02 +01:00
Harald Hoyer 0ce79d4c72 ci: mount host /dev into container
might pickup /dev/kvm if we are lucky?
2021-02-08 16:07:37 +01:00
Harald Hoyer 860b64b92d ci: remove `--privileged` option from docker containers
This option should not be needed anymore with "mount -o loop" removed.
2021-02-08 16:07:37 +01:00
Harald Hoyer 0f62da0405 ci: get rid of "mount -o loop"
This finally allows running the test suite completely in a rootless container:
```
❯ podman run \
         --user 0 \
         -v /dev:/dev \
         -v ./:/dracut \
         -it \
         quay.io/haraldh/dracut-fedora:33 \
         bash -c 'cd /dracut; make DRACUT_NO_XATTR=1 check'
```
2021-02-08 16:07:37 +01:00
Harald Hoyer 1211d6a3fb ci: disable TEST 99
1. people got annoyed by merge conflicts
2. spec file can be update per release
3. uses "mount" preventing container testing
2021-02-08 16:07:37 +01:00
Harald Hoyer 457e7b7a4a docs: remove TODO file
TODO file copied to https://github.com/dracutdevs/dracut/issues/1068
and also filed as individual issues on
https://github.com/dracutdevs/dracut/issues
2021-02-08 14:17:13 +01:00
Kairui Song e918f337b6 95nfs: fix rpc.statd installation
commit 5840c466d tried to make it create the right directory according
to the directory layout on current host, but added "$initdir" prefix
to the if statement by accident, so the installation code have no
effect now. Just fix it.
2021-02-08 12:20:48 +01:00
Matthew Thode 8a2edb1e4d fix: do not set cmdline for uefi images unless asked
The kernel does not allow the cmdline to be overridden if one is defined
in the uefi image.  This means that bootloaders like systemd-boot or
grub cannot manage boot options (editing at boot for debug being a use
case).  This patchset allows for no cmdline to be set (instead of force
setting one if none is provided).

Fixes: https://github.com/dracutdevs/dracut/issues/1012
Signed-off-by: Matthew Thode <mthode@mthode.org>
2021-02-08 10:37:22 +01:00
Anjali Kulkarni 4026cd3b01 feat(network-legacy): send dhcp in parallel on all devices
We can drastically improve boot times on some machines, or BM or VM
shapes, if we send DHCP requests in parallel on all interfaces
Add ip=single-dhcp as a kernel boot parameter, to send DHCP requests in
parallel on all interfaces. Thus, DHCP on each interface is overlapped
thereby reducing boot times for multiple interface machines.
This can help reduce the boot time by 1 minute per interface.
In addition, we may also save another 40 secs delay per interface, if
the link on which we try to send DHCP is in DOWN state. This can be
reduced by giving the following kernel command line parameter while
booting - rd.net.timeout.carrier=<timeout>.
Added manpage for ip=single-dhcp with the caveat that it does not
apply to Network Manager or SUSE wicked.

Signed-off-by: Anjali Kulkarni <anjali.k.kulkarni@oracle.com>
2021-02-05 11:11:22 +01:00
Mariusz Tkaczyk 30e49d5175 fix(mdraid): remove offroot
offroot is deprecated and can be safety removed.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
2021-02-05 10:59:50 +01:00
Mariusz Tkaczyk 29e269a522 fix(mdraid): add grow continue service
During raid assembly mdadm will call mdadm-grow-continue.service if
reshape is in progress.
If service doesn't exist then it is done via fork and systemd will kill
it unconditionally after processing all events.

Add proper service to allow systemd to manage reshape correctly.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
2021-02-05 10:59:50 +01:00
Lukas Nykryn 62d52ad2be fix(spec): add new systemd-coredump module to spec 2021-02-04 13:19:09 +01:00
Peter Levine c35cbd2e56 fix(watchdog): replace return with echo 2021-02-03 12:23:57 +00:00
Jóhann B. Guðmundsson 939b7e11d5 feat(systemd-coredump): introducing systemd-coredump module
This pull request introduces systemd-coredump as a seperated
module and adds the systemdutilconfdir global variable.
2021-02-02 18:01:06 +00:00
Harald Hoyer 9553a679f6 ci: remove Travis and include Fedora-latest
Also remove Fedora 31.

Github CI should suffice. The only missing piece was Fedora-latest.

Signed-off-by: Harald Hoyer <harald@redhat.com>
2021-01-27 16:58:58 +01:00
Harald Hoyer 1149ed2a3e test: incr. disk size for TEST 35 ISCSI-MULTI 2021-01-27 13:15:37 +01:00
realtime-neil 68dd8af21d fix(skipcpio): edit skipcpio.c: strstr -> memmem
because CPIO_END might follow a NULL byte in buf
2021-01-26 21:06:15 +00:00
Jóhann B. Guðmundsson bf1a2262ea fix(1007): adding shared keyring mode to type unit
Fixes: https://github.com/dracutdevs/dracut/issues/1007
2021-01-26 18:05:18 +00:00
Harald Hoyer be30c816d4 ci: use our own version of commisery
This should hopefully fix:
* not checking the PR github title
* not error on the auto merge commit message
2021-01-26 17:57:25 +01:00
Jóhann B. Guðmundsson a2472e6e60 feat(systemd-sysusers): introducing systemd-sysuser module 2021-01-26 00:00:28 +00:00
Jóhann B. Guðmundsson 24ea839079 feat(systemd-sysusers): introducing systemd-sysuser module 2021-01-26 00:00:28 +00:00
Daniel Molkentin f824f52675 fix(1001): use efivars fs over the deprecated sysfs entries
sysfs efi vars has been dropped for non-x86 systems since kernel 5.10.
2021-01-25 14:58:11 +00:00
Javier Martinez Canillas 3c8ca29650 fix(kernel-network-modules): also install modules from mdio subdirectory
A recent change in Linux kernel v5.10 split the MDIO drivers from the PHY
subdirectory into a new MDIO subdirectory [0]. This caused MDIO drivers
to not be included in the initramfs.

Also include the modules of this new subdirectory to prevent this issue.

[0]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a9770eac511

Suggested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2021-01-22 15:58:58 +01:00
Alexey Shabalin 21ee81bfbd fix(06dbus): do not hardcode path to dbus utils 2021-01-21 16:53:30 +00:00
Alexey Shabalin 7b3c6e1bb0 fix(06dbus): do not hardcode path to systemd unit
Use $systemdsystemunitdir instead /usr/lib/systemd/system.
2021-01-21 16:53:30 +00:00
Zoltán Böszörményi b955dbf4a9 fix(dracut-init.sh): make inst_libdir_file work with dracutsysrootdir set
Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-01-21 16:33:18 +00:00
Zoltán Böszörményi 911c2de9c3 fix(99squash): use kernel config instead of modprobe to check modules
Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-01-21 16:33:18 +00:00
Zoltán Böszörményi 560f45b15f fix(dracut-functions.sh): check kernel config from $dracutsysrootdir
Signed-off-by: Zoltán Böszörményi <zboszor@pr.hu>
2021-01-21 16:33:18 +00:00
Ondrej Mosnacek 951c6655f1 fix(90kernel-modules): install generic crypto modules with hostonly unset
Otherwise e.g. the xts(aes) implementation provided by the vmx_crypto
module (which does usually get included on ppc64le) fails to initialize
when xts is built as a module (CONFIG_CRYPTO_XTS=m), because it can't
instantiate the fallback generic xts(aes) implementation (needs the
generic xts module).

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
2021-01-21 12:20:22 +01:00
Jóhann B. Guðmundsson a47c3f50b6 feat: add addional global variables 2021-01-20 12:40:04 +00:00
Jóhann B. Guðmundsson db36338053 feat: add addional global variables 2021-01-20 12:40:04 +00:00
Jóhann B. Guðmundsson 093bc9b5cf fix: add a missing efi support 2021-01-19 00:44:17 +00:00
Jóhann B. Guðmundsson 8b5a6b91be chore(removal): eliminate bootchart module 2021-01-19 00:44:30 +01:00
Jóhann B. Guðmundsson dd9288bb62 chore(removal): eliminate bootchart module 2021-01-19 00:44:30 +01:00
Jóhann B. Guðmundsson 66c27a6d85 chore(removal): eliminate bootchart module 2021-01-19 00:44:30 +01:00
Jóhann B. Guðmundsson 1acf52b60e feat: add addional global variables 2021-01-18 14:45:18 +00:00
Vladius25 f3cbff1113 feat(cli): add --no-uefi option
To be able to turn off UEFI mode, when it's enabled in config.
2021-01-18 08:30:00 +00:00
Harald Hoyer c93df5e0ea chore(github): add CODEOWNERS file
All CODEOWNERS are automatically added as reviewers.
2021-01-16 03:14:03 +00:00
Jóhann B. Guðmundsson 58d57fc977 chore(cleanup): remove logrotate file 2021-01-16 03:00:50 +00:00
Yang Liu 77630365ae fix(35network-manager): avoid restarting NetworkManager
On EL8.3 the NetworkManager keep restarting even if it exits successfully while waiting for Clevis to unlock. This patch ensures NetworkManager runs only once in initrd.
2021-01-15 11:18:24 +01:00
Jóhann B. Guðmundsson f1739d4236 chore: Add configuration for vim 2021-01-14 09:20:34 +00:00
Jóhann B. Guðmundsson 33920ee6b0 chore: Add editorconfig 2021-01-14 09:20:34 +00:00
Jóhann B. Guðmundsson 08ff88f234 chore: Editors 2021-01-14 09:20:34 +00:00
Harald Hoyer 28d0fc9347 ci: add testing with Fedora 33
To test a more recent version of Fedora, add Fedora 33.
2020-12-16 15:34:29 +01:00
Harald Hoyer 7c50ed83a3 test(conventional): add Conventional Commits PR github action
To ease the creation of the release notes, enforce some style on the git
commit message titles with `Commisery`.

https://github.com/marketplace/actions/commisery

Using https://github.com/clog-tool/clog-cli later on these commits will
generate a pretty nice base for the release notes.
2020-12-16 15:10:18 +01:00
Harald Hoyer 1ed4b9f100 docs(development): add HACKING.md
Merge HACKING, README.modules, README.testsuite into HACKING.md.

Provide a new paragraph about git commit messages.
2020-12-16 14:59:35 +01:00
Daniel Molkentin e473057ae1 Update AUTHORS, NEWS 2020-12-14 15:34:35 +01:00
Adam Williamson b3e55bde30 Drop 51-dracut-rescue-postinst.sh entirely
It is only installed on RHEL 8+, but as noted in the first commit
that tried to do this - 0bb9a683 - we already have branches for
all RHEL releases, so there's no point keeping such a conditional
on the master branch. After 0bb9a683, 51-dracut-rescue-postinst.sh
was re-added because Fedora 30 needed it, with a FIXME saying to
remove it after F30 was released. But instead of that happening, it
got changed to a conditional to install it on Fedora <= 30 or RHEL
<= 8 in 9e68789d and the FIXME was removed, then in 9eb1d1ed that
conditional was simplified to only refer to RHEL, so we wound up
with this situation.

Note the last two commits were never ported to the RHEL-8 branch,
so it's broken, I will send a separate PR for that.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2020-12-14 14:01:28 +01:00
Daniel Molkentin 8cceee8059 Revert "Retrieve service, rpc and protcol entries via getent in hostonly mode"
The underlying issues this was trying to solve is to get a cheap
workaround for the fact that (open)SUSE with atomic support moved
/etc stock files to /usr/etc in order to improve compatibility. But
now that even nsswitch.conf moved, this is no longer enough. And it
might be more trouble to support once it's in an official release.

So let's rather drop it now.

This reverts commit e0524af2bf.
2020-12-14 12:44:00 +01:00
Jóhann B. Guðmundsson 5f0d35b665 Adding stalebot file 2020-12-14 11:59:16 +01:00
Daniel Molkentin 3a12309c0d Revert "Add --uefi-output for custom output filename"
This reverts commit f8f3b0f358.
2020-12-02 00:25:20 +01:00
Jiri Konecny cb495a073e Improve documentation of iso-scan/filename feature
From the current man page it's really hard to tell what will be output of this
command.
2020-12-01 01:12:37 +01:00
Lukas Nykryn 7c2521091f multipathd: fix the comparison
From shellcheck:
/usr/lib/dracut/modules.d/90multipath/multipathd.sh:3:32: warning[SC2039]: In POSIX sh, == in place of = is undefined.
/usr/lib/dracut/modules.d/90multipath/multipathd.sh:3:32: warning[SC2193]: The arguments to this comparison can never be equal.
2020-11-27 10:00:03 +01:00
Daniel Molkentin 6fee16eab0 06dbus: consider dbus-broker 2020-11-25 18:21:39 +01:00
Daniel Molkentin 209f157d2a 06dbus: Add busctl as a more useful tool 2020-11-25 18:21:39 +01:00
Daniel Molkentin f57b1b9368 06dbus: Include dbus or messagebus group and user, depending on distro 2020-11-25 18:21:39 +01:00
Daniel Molkentin 09eb4de3d4 35network-wicked: openSUSE Factory has reintroduced libexec 2020-11-25 18:21:39 +01:00
Daniel Molkentin 1517f4c504 35network-wicked: install ip utility anyway 2020-11-25 18:21:39 +01:00
Daniel Molkentin 983aee0ef1 35network-wicked: Run wicked early enough to unlock block devices 2020-11-25 18:21:39 +01:00
Daniel Molkentin 7825c32bd6 06dbus: Do not install superfluous services 2020-11-25 18:21:39 +01:00
Daniel Molkentin 5fc7c05321 40network: introduce wicked option 2020-11-25 18:21:39 +01:00
Daniel Molkentin ed7ce0d64f 35network-wicked: introduce wicked support module 2020-11-25 18:21:39 +01:00
Daniel Molkentin e1845955ff 06dbus: introduce dbus support 2020-11-25 18:21:39 +01:00
leo-lb f8f3b0f358 Add --uefi-output for custom output filename
Closes #921
2020-11-24 19:38:30 +01:00
Kairui Song 8c8af8a2cd 95fcoe: don't install if there is no FCoE hostonly devices
When in hostonly mode, 95fcoe module will still be installed even there
is no FCoE hostonly device. So use the new block_is_fcoe helper to check
for hostonly device in hostonly mode, avoid installing unneccessary module.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-11-23 17:23:38 +01:00
Kairui Song 4339d47cf8 95fcoe: ensure needed modules are installed
If fcoe module is loaded, the initramfs will always try load libfcoe
and bnx2fc, so also ensure they are installed if needed.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-11-18 14:18:01 +01:00
Daniel Molkentin 1a5845b45f dracut-install: Globbing support for resolving "firmware:"
Implements #849
2020-11-18 14:11:30 +01:00
Gaël PORTAY 952c2e4e9b dracut-bash-completion.sh: add positional argument completion 2020-11-16 00:00:04 +01:00
Petr Pavlu 6685d99448 Prevent creating unexpected files on the host when running dracut
Library file modules.d/99base/dracut-lib.sh contains initialization code
that makes sure certain directories and links are created when a system
runs from the produced initramfs. This file is normally sourced only
from initramfs scripts. However, modules.d/99base/module-setup.sh
includes it also when an initramfs image is being created to gain access
to some of the functions in this library. This can result in creating
unexpected directories and links on the current root file system when
the dracut command is executed.

For instance, during a system installation when dracut is invoked to
create an initial initramfs, the target sysroot might not contain
directory /run/initramfs but have /var/log. This situation results in
the code in modules.d/99base/dracut-lib.sh creating an unexpected link
/var/log/log that points to /run/initramfs/log. This link is then also
present on the installed system.

The patch fixes the problem by skipping the described logic in
modules.d/99base/dracut-lib.sh when the PREFIX variable is non-empty
which indicates that a target initramfs is being prepared. The variable
is set by modules.d/99base/module-setup.sh prior to including
dracut-lib.sh.
2020-11-15 00:47:39 +01:00
A. Wilcox 3aec4fca0b configure: Find FTS library with --as-needed
When LDFLAGS contains ``-Wl,--as-needed``, the FTS library will be
ignored if it is specified before the .c source.

Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
Fixes: 62f27ee6f1 ("configure: find cflags and libs for fts on musl")
2020-11-15 00:32:14 +01:00
Colin Walters 6b8ee4fc37 Don't print when a module is explicitly omitted (by default)
dracut builds today are fairly verbose to start, but on top of
that many of the messages tend to liberally use the
exclamation point `!` which calls attention to them.

I see these a lot when looking at rpm-ostree build logs
and it'd be nicer if we were quiet when there wasn't
an actual problem.

In this specific case, if the builder is explicitly adding
`--omit=foo`, there's no reason for us to say:

`dracut: dracut module 'foo' will not be installed, because it's in the list to be omitted!`

We already print the command line to start, so the information
is there.

Demote this message to debug.
2020-11-14 19:38:29 +01:00
Daniel Molkentin 5840c466dc 95nfs: /var/lib/nfs/statd/sm is /var/lib/nfs/sm on SUSE
Reference: boo#1177462
2020-11-14 19:28:56 +01:00
Daniel Molkentin e0524af2bf Retrieve service, rpc and protcol entries via getent in hostonly mode
Sometimes, systems have more elaborate backends in nsswitch.conf,
the complexity of which we do not want in the initrd. SUSE systems
with atomic for instance, where those files may also reside in /usr/etc.

With this change, the unavaiable nsswitch.conf backends will be silently
ignored, and we still end up with all the information we need.

Reference: boo#1165366
2020-11-14 19:28:56 +01:00
Daniel Molkentin 1ec85e5232 Remove uses of bash (and bash specific syntax) in runtime scripts
dracutinstall picks up interpreters and includes bash despite
the users' wishes or expectations, as modules should not require
bashisms at runtime.

Fixes #951
2020-11-14 16:36:38 +01:00
Jonathan Lebon a23a4680e7 90crypt: pull in remote-cryptsetup.target enablement
This should've been part of #964. As mentioned there, the
`initrd-cryptsetup.target` approach was reverted in the end, and we went
back to relying in `remote-cryptsetup.target`:

https://github.com/systemd/systemd/pull/17467

So we do need to ship the enablement symlink for it.
2020-11-14 15:30:34 +01:00
David Tardon 0f89c0dff6 90multipath: install kpartx's 11-dm-parts.rules
This makes /dev/disk/by-uuid links point to the right device.
2020-11-14 15:15:13 +01:00
Jonathan Lebon 09804a4629 Revert "90crypt: ship initrd-cryptsetup.target"
This reverts commit 8f56daa8c3.

The addition of `initrd-cryptsetup.target` was reverted in systemd:
https://github.com/systemd/systemd/pull/17467
2020-11-05 14:22:52 +01:00
Kairui Song 831e310adf 90qemu-net: install less module for strict hostonly mode 2020-10-30 10:13:37 +01:00
Kairui Song 5698258d30 90qemu-net: in hostonly mode, only install if network is needed
Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-30 10:13:37 +01:00
Kairui Song 3b45c7e1a0 95nfs: Install less module if hostonly mode is strict
For strict hostonly mode, only install currently loaded modules instead
of a bunch of driver that may not be needed.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-30 10:13:37 +01:00
Kairui Song 5817934936 90kernel-modules: Install less modules for hostonly mode
Rearrange some module installation mode, install less modules for
hostonly mode.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-30 10:13:37 +01:00
Kairui Song 6375d5d504 90kernel-modules: install block drivers more strictly
For strict hostonly mode, only install block drivers needed for hostonly
devices.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-30 10:13:37 +01:00
Kairui Song 5a49fd3656 04watchdog-modules: Simplify install_kernel using new added helper
The new added get_dev_modules helper can help simplify the driver
detection code by a lot.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-30 10:13:37 +01:00
Kairui Song cbafcd0fc7 dracut-init.sh: Add a helper for detect device kernel modules
Use udevadm to detect the required kernel modules to load a given
device. udevadm will follow the device chain, help detect all required
parent device drivers as well.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-30 10:13:37 +01:00
Kairui Song ab17cb8515 dracut-functions.sh: Fix check_block_and_slaves_all
check_block_and_slaves_all $func $dev should return 0, if $func return 0
for any checked device. Currently if any device don't have any sub
device, 1 is returned instead.

So remove the sub device checking statement. Also remove the same
statement in check_block_and_slaves, the "[[ -f $_x/dev ]]" in the for
loop is enought to ensure sub device exists.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-30 10:13:37 +01:00
Kairui Song c69961b403 90kernel-network-modules: Don't install iscsi related module
These modules are installed in 95iscsi, no need to repeat here.
2020-10-26 14:16:19 +01:00
Kairui Song 1e92f7285d Add a --hostonly-nics option
Currently when network is enabled, dracut will install all network
drivers that are currently loaded, but some time only one NIC is needed
for the initramfs.

So for strict hostonly mode, add a --hostonly-nics option, user can
provide a list of NICs to be enabled, and only needed drivers for
specifed NICs will be installed so save space.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-26 14:16:19 +01:00
Rumbaut Thomas e4483e5917 Configure the runner for team interfaces
https://bugzilla.redhat.com/show_bug.cgi?id=1881463
2020-10-26 12:52:24 +01:00
Kairui Song 83c65fd3db 99squash: Check require module earlier, and properly
Let 99squash fail earlier if required modules are not enabled or
missing, using the new added helper.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-21 17:04:00 +02:00
Kairui Song c050190f86 dracut-functions: add a helper to check if kernel module is available
It's like check_kernel_config, help to check if a kernel module is
enabled (cover built-in or compiled module case).

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-10-21 17:04:00 +02:00
Jonathan Lebon 8f56daa8c3 90crypt: ship initrd-cryptsetup.target
This was added in https://github.com/systemd/systemd/pull/17149 and is
the designated cryptsetup target for all encrypted volumes that need to
be opened in the initrd.

So it effectively replaces `cryptsetup.target` and
`remote-cryptsetup.target` there. I've removed the latter since it was
added recently (by me) in #930, but kept `cryptsetup.target` since we've
been shipping it for a long time now.
2020-10-21 16:43:53 +02:00
Jonathan Lebon 9fb2431a88 Revert "90crypt: pull in remote-cryptsetup.target enablement"
This reverts commit 7ea391b527.

We've moved away from this in
https://github.com/systemd/systemd/pull/17149.
2020-10-21 16:43:53 +02:00
Frederick Grose 12ab0dce66 dmsquash-live/iso-scan: Provide an easy reference to iso-scan device.
With commit 3c8c807, /run/initramfs/isoscan and /run/initramfs/live
mountpoints are unmounted upon rd.live.ram boots.  Save a link to
the iso-scan device in /run/initramfs/isoscandev to easily remount
the source, if desired.
2020-10-20 15:46:49 +02:00
Daniel Molkentin f51d013384 99memstrack: use /bin/bash
/usr/local/bin causes trouble for distros that do not use /usr/bin == /bin
/usr/bin/env likewise, plus the use of env is not needed here
2020-10-12 14:05:09 +02:00
Jonathan Lebon 512c51d267 98dracut-systemd: don't wait for root device if remote cryptsetup active
This is a plain and simple hack around dependency issues between dracut
and systemd.

When using Tang-pinned LUKS root devices, we want to rely on
`systemd-cryptsetup@.service` to unlock it. However, that service only
runs `After=remote-fs-pre.target`, while `dracut-initqueue.service` has
`Before=remote-fs-pre.target` (which makes sense because we don't want
to attempt networked root devices before networking is up).

However, the rootfs-generator here wants to make sure that the root
device exists *before* exiting the initqueue via an initqueue/finished
"devexists" hook. This will never work though because by design
`systemd-cryptsetup@.service`, which unlocks the root device, won't run
until after we exit.

So we have a dependency cycle:

    initqueue -> devexists hook -> root device ->
        systemd-cryptsetup@.service -> remote-fs-pre.target -> initqueue

There's no clean way to break this. The root issue is that there's no
way right now to split sequencing of systemd services across the
initqueue/online and initqueue/finished events because it's all bundled
in a single service. (The deeper root issue of course is that we have
two init systems. :) ).

Here we do a tactical fix: if there's a `systemd-cryptsetup@.service`
instance, let's assume it's for the root device and skip waiting for it
to show up if it depends on `remote-fs-pre.target`.
2020-10-12 11:07:41 +02:00
Đoàn Trần Công Danh 7990ab91f9 cryptroot-ask: unify /etc/crypttab and rd.luks.key
dracut feeds whatever it receives in password field of
crypttab(5) to `cryptsetup -d`, treating them as plain-text key file.

Meanwhile, dracut treats the key file from `rd.luks.key` differently,
by have some special rules to decrypt those key files that has extension of
`gpg` and `img`.

Let's begin to treat them the same.

This is a backward-incompatible change for those people
that uses plain-text key-file that has extension of `gpg` and `img`.
However, those setup is questionable to begin with.
2020-10-08 13:56:44 +02:00
Nicolas Chauvet a298f5f285 90kernel-modules: arm: add drivers/hwmon for arm/arm64
In the case of the s805x the drivers/hwmon directory contains the
scpi_hwmon kernel module.
On a running system, lsmod would output the following dependencies:
 arm_scpi               24576  2 clk_scpi,scpi_hwmon

It means that if the clock driver is bundled in the initramfs it will
bring arm_scpi. But if scpi_hwmon is missing the scpi will be incomplete
and it can lead to crashes.

When the hwmon is bundled, no crash occurs

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2020-10-07 16:04:08 +02:00
Đoàn Trần Công Danh 811c814677 rootfs-block: only write root argument for block device
Some filesystem (e.g. ZFS, and btrfs subvolumes) don't use block
devices. Should they be mounted as `/`, `find_root_block_device`
yields nothing, hence dracut will append this problematic argument
to kernel cmdline:

	root=/dev/block

On a machine that employ root ZFS on LUKS, which was setup with
an OpenPGP-encrypted key file, this argument renders that machine
unbootable. Remove that `root=/dev/block` manually could boot the
machine.

Let check if that device is a block device before write down `root`
argument. This is consistent with the check for block device in
`find_block_device`.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2020-10-05 17:17:40 +02:00
Jonathan Lebon 7ea391b527 90crypt: pull in remote-cryptsetup.target enablement
This is enabled upstream in
https://github.com/systemd/systemd/pull/17149.
2020-10-05 15:53:32 +02:00
Jonathan Lebon 7c923f1de8 00systemd: add missing cryptsetup-related targets
We want these in the initramfs. Things related to clevis and systemd's
`cryptsetup-generator` reference these targets.
2020-10-05 14:43:58 +02:00
Hannes Reinecke 251b424727 95nvmf: Implement 'fc,auto' commandline syntax
Add a 'fc,auto' commandline syntax for nvmf.discover to force
nvmf autodiscovery on FC-NVMe.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2020-10-02 15:55:14 +02:00
Hannes Reinecke 0e2ef80993 95nvmf: add nvmf-autoconnect script
Add a script to run FC autoconnect.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2020-10-02 15:55:14 +02:00
Hannes Reinecke f0ac6cb462 95nvmf: Fixup FC connections
D-Bus doesn't run in the initrd, so our usual trick of activating
custom systemd services from udev doesn't work.
So add a rule to create initqueue entries for each possible
connection.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2020-10-02 15:55:14 +02:00
Hannes Reinecke e9a614b50c 95nvmf: add documentation
Add documentation for 95nvmf module to dracut.cmdline

Signed-off-by: Hannes Reinecke <hare@suse.de>
2020-10-02 15:55:14 +02:00
Hannes Reinecke 4087fd4d1a 95nvmf: rework parameter handling
Always add the nvmf.discover parameters to /etc/nvme/discovery
when parsing the dracut commandline, and rely on NVMe autodiscovery
when no parameters are given.
And modify the syntax to use a comma ',' as a separator for nvmf.discover
as the semicolon ':' is already used for the FC-NVMe transport address format.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2020-10-02 15:55:14 +02:00
Daniel Molkentin ee9b9b1241 dracut-install: fix edge-case regression with weak modules
This was introduced with 6dafdda4a6, but
is actually caused by the fact that modules that have already been
installed cause dracut_install() to return without adding the module
to the hashmap. This can happen if an earlier-run dracut module chose
to install the same module. Now modprobe statements like:

softdep usb_storage post: uas
softdep uas pre: usb_storage

(which look weird, but are perfectly valid), cause
dracut_install() to enter an infinite recursion if and only if
at least one of the files has previously been installed by another
module.

Fix this by also adding already installed modules to the hashmap.
2020-10-02 15:49:09 +02:00
David Tardon 4916dfc2b9 dracut-install: ignore bogus preload libs
If there are any nonexistent libraries listed in /etc/ld.so.preload, ldd
prints error messages like:

ERROR: ld.so: object '/usr/lib64/libfoo.so.1' from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.

This causes resolve_deps() to return error, which leads to symlinks
(like usr/bin/awk) not being copied into the initrd.
2020-10-02 15:34:40 +02:00
Harald Hoyer ee6ce31003 dracut.spec: Use make macros
https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
2020-10-02 14:05:51 +02:00
Harald Hoyer 9eb1d1ed5e dracut.spec: remove fedora pre 30 quirks 2020-10-02 13:48:48 +02:00
Nicolas Chauvet dee4f26adc 50drm: Check drm_encoder_init along drm_crtc_init
Some modules are involved in the display output without to rely on
drm_crtc_init.

This is the case for the meson_dw_hdmi. This module need to be included
into the initramfs in both hostonly and generic modes.

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2020-09-28 21:08:12 +00:00
Nicolas Chauvet 5afd3cfc96 50drm: Include drm platform drivers in hostonly
On arm, many drm drivers are located in the plaform bus.

Adding the platform bus will allow drm drivers to be included in the
initramfs when using hostonly mode.

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2020-09-28 21:08:12 +00:00
Nicolas Chauvet 89cd7a4629 50drm: fix ambiguous redirects
If i contains a space, there is a need to protect the variable usage in some cases.

This will occurs when a next patch will enable platform bus with such case:
'/sys/bus/platform/devices/Fixed MDIO bus.0'

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2020-09-28 21:08:12 +00:00
Peter Robinson 38ea7e821b Include devfreq drivers in initrd
Some SoCs now have drivers that user devfreq in early init and fail
if the drivers are missing so make sure we have them in the initrd.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2020-09-23 13:44:21 +02:00
Beniamino Galvani f3e328a7fd dracut.spec: include the 04watchdog-modules module
Include the 04watchdog-modules module that was added in 39d90012a6
("04watchdog: split the watchdog module install").
2020-09-21 13:25:14 +02:00
Antz 37502d4c89 90crypt: make `rd.luks.key` usable with encrypted keydev.
Introduce prefix `keysource:` for the values of `rd.luks.partuuid`,
`rd.luks.serial` and `rd.luks.uuid`.
If specified, ask for passphrase instead of waiting for keydevs to come
online.
2020-09-18 21:59:00 +02:00
Kairui Song 39d90012a6 04watchdog: split the watchdog module install
In some cases, user only want to include the watchdog module, not the
wdctl or any other userspace helper. For example, systemd have a
RebootWatchdogSec option that use watchdog to prevent reboot hangs. And
it can help prevent machines hangs when reboot directly within the
initramfs stage. So split the module installation to a standlone module.

Also when watchdog-module get included, install driver for all loaded
watchdog instaed of only install driver for active watchdog. Both
watchdog and watchdog-module return 255 in check(), so it's enabled only
when manually included, the watchdog may get configured/activated later.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-09-17 14:52:48 +02:00
GuoChuang d76e9ad5d7 fix graphics startup failure with the rhgb paramter in CentOS8.2 2020-09-03 15:27:14 +02:00
Beniamino Galvani f87605e3ab dracut.cmdline.7.asc: fix typo 2020-09-02 22:35:28 +02:00
Daniel Molkentin a5372b8ba8 Add --version to man page 2020-08-28 23:28:25 +02:00
Daniel Molkentin ff2d8bdfb3 dracut.sh: Add --version 2020-08-28 23:28:25 +02:00
Jóhann B. Guðmundsson d418e292e3 Fix CoC URL 2020-08-28 18:04:03 +00:00
Jóhann B. Guðmundsson ff78577d3f Fix Unicode and dracut install labeler 2020-08-28 17:41:41 +00:00
Jóhann B. Guðmundsson d2b3289aa5 Fix Unicode 2020-08-28 17:16:53 +00:00
Jóhann B. Guðmundsson de27127752 Adding security policy 2020-08-28 18:58:52 +02:00
Jóhann B. Guðmundsson 0132527b8f Adding documentation template 2020-08-28 18:58:52 +02:00
Jóhann B. Guðmundsson 455c5dbd35 Adding a feature request template 2020-08-28 18:58:52 +02:00
Jóhann B. Guðmundsson cd1a002512 Adding a bug report template 2020-08-28 18:58:52 +02:00
Tomasz Paweł Gajc b7a7735c1d Do not start inside container
Host should take care of good entropy pool
#791
2020-08-28 17:34:22 +02:00
Jóhann B. Guðmundsson fece5bfcac Adding a pull request template 2020-08-28 14:03:11 +00:00
Jóhann B. Guðmundsson d795211778 Adding code of conduct 2020-08-28 13:55:54 +00:00
Érico Rolim 497916e13b dracut.sh: fix some indentation.
Command level inside conditional and tab/space usage.
2020-08-24 11:29:34 +02:00
Érico Rolim 3b92d8bf84 dracut.sh: fix errors pointed out by shellcheck.
- use [ ] instead of calling test manually, as most of the script is
doing.

- use quotes in hostonly_cmdline blocks, specially when dealing with the
conf files, whose names are set by users/system administrators

- uefi_splash_image was being assigned set to `${dracutsysroot}...`, which
is a variable that doesn't exist.

- we don't want the conditional to run the output of fsfreeze as
commands. Instead, we just need to know if any of the fsfreeze commands
failed.
2020-08-24 10:27:29 +02:00
Daniel Molkentin 1855efb15a Document initqueue/online hook 2020-08-21 17:40:59 +02:00
Daniel Molkentin e096d861ed 01fips: turn info calls into fips_info calls
systemd lets stdout go to journal only. Usually, this is desired
behavior to ensure that plymouth does not get disrupted.

However in the 01fips case, the system has to halt when the integrity
check fails to satisfy FIPS requirements. So the user will not be able
to inspect the journal.

As this is special to the fips module, we introduce a fips_info() which
works like info(), but deviates the output to stderr when running with
systemd.

Reference: bsc#1164076
2020-08-21 15:56:53 +02:00
Daniel Molkentin da4c9a950f 01fips: modprobe failures during manual module loading is not fatal
Users might see

"modprobe: FATAL: Module xyz not found in directory"

The output from modprobe is semantically wrong in this case and
confuses users. Keep the warning for debugging purposes, but reduce
the severeness.

It now reads "Module xyz not found in directory"

Reference: bsc#1169997
2020-08-21 15:56:53 +02:00
наб 31d0b55b86 95cifs: pass rootflags to mount 2020-08-21 15:24:58 +02:00
наб dae2759e61 95cifs: install new softdeps (sha512, gcm, ccm, aead2) 2020-08-21 15:24:58 +02:00
mulhern fe761330e5 Remove stratis module
It is obsolete. An approach which does not start the daemon is being worked
on.

Signed-off-by: mulhern <amulhern@redhat.com>
2020-08-20 18:39:44 +02:00
Frederick Grose f7e924c577 dmsquash-live-root: Remove obsolete osmin.img processing.
osmin.img is no longer used by anaconda or generated by
livemedia-creator.  livecd-creator will soon drop it as well.
Removing this code will allow OverlayFS boots to proceed  when
osmin.img is present in the .iso image.
2020-08-11 20:18:44 +02:00
Daniel Molkentin 74f83fb9f3 95nvmf: fix typo in the example documentation 2020-08-11 20:00:12 +02:00
Jóhann B. Guðmundsson 5da70385bc Removing dracut entry not compat with new plugin 2020-08-07 21:25:56 +02:00
Jóhann B. Guðmundsson c4f2b11b89 New label trigger file 2020-08-07 20:47:13 +02:00
Jóhann B. Guðmundsson 0e30f33a32 New labels file 2020-08-07 20:47:13 +02:00
Daniel Molkentin 3f4771ebf4 .github: fix path to label workflow mapping file 2020-08-07 19:05:20 +02:00
Jóhann B. Guðmundsson fc1d50b270 Update master-labels.yml
Removing branches not sure if they work with the cron scheduler in workflow actions
2020-08-07 18:23:43 +02:00
Jóhann B. Guðmundsson cafd314b70 Update master-labels.yml
Fixing bad intentation
2020-08-07 18:03:25 +02:00
Jóhann B. Guðmundsson ac733934fa Switching label triggers from pull requests to cron 2020-08-07 18:03:25 +02:00
Jóhann B. Guðmundsson 2be5e3ac4c Adding the labels trigger file for the RHEL-8 branch 2020-08-07 17:04:02 +02:00
Jóhann B. Guðmundsson 9521b435d0 Adding the labels trigger file for the RHEL-7 branch 2020-08-07 17:04:02 +02:00
Jóhann B. Guðmundsson 64748b3383 Adding the labels trigger file for the RHEL-6 branch 2020-08-07 17:04:02 +02:00
Jóhann B. Guðmundsson 76d8b30f4e Adding the labels trigger file for the Master branch 2020-08-07 17:04:02 +02:00
Jóhann B. Guðmundsson 4cd8f2c90e Adding the labels file for the RHEL-8 branch 2020-08-07 17:04:02 +02:00
Jóhann B. Guðmundsson 3b20f5c72e Adding the labels file for the RHEL-7 branch 2020-08-07 17:04:02 +02:00
Jóhann B. Guðmundsson 27047bb5c6 Adding the labels file for the RHEL-6 branch 2020-08-07 17:04:02 +02:00
Jóhann B. Guðmundsson 80f1ce6c13 Adding the labels file for master 2020-08-07 17:04:02 +02:00
Thomas Blume 376ce85105 net-lib.sh: support infiniband network mac addresses
Infiniband MAC addresses have 20 octets.

Reference: bsc#996146
2020-08-07 12:00:59 +02:00
Daniel Molkentin 01b7163a59 90lvm: do not add newline to cmdline
Fixes #862
2020-08-06 09:53:55 +02:00
mwberry fea53784ad UEFI Mode: only write kernel cmdline to UEFI binary
The kernel command line was being written both into
/etc/cmdline.d/01-default.conf and the UEFI executable.
During boot, getcmdline would concatenate these two
resulting in all arguments being duplicated. Some
args, such as ip=, are sensitive to the number of
times they are specified.
2020-08-05 18:30:44 +02:00
Mikhail Novosyolov f84ad9e062 Allow $DRACUT_INSTALL to be not an absolute path
/usr/sbin/dracut-install is a symlink:
$ file /usr/sbin/dracut-install
/usr/sbin/dracut-install: symbolic link to ../lib/dracut/dracut-install

It resulted to "dracut-install not found" error:

+++ for p in $DRACUT_PATH
+++ [[ -L /sbin/dracut-install ]]
+++ [[ -x /sbin/dracut-install ]]
+++ for p in $DRACUT_PATH
+++ [[ -L /bin/dracut-install ]]
+++ [[ -x /bin/dracut-install ]]
+++ for p in $DRACUT_PATH
+++ [[ -L /usr/sbin/dracut-install ]]
+++ printf '%s\n' dracut-install
+++ return 0
++ DRACUT_INSTALL=dracut-install
++ [[ -n dracut-install ]]
++ [[ -n dracut-install ]]
++ DRINSTALLPARTS=0
++ for i in $DRACUT_INSTALL
++ DRINSTALLPARTS=1
++ [[ 1 = 1 ]]
++ [[ -x dracut-install ]]
++ dfatal 'dracut-install not found!'
++ set +x
dracut: dracut-install not found!

[ -x <not a path to file> ] is not correct and will always be false.
But actually it is available. Let's just allow it to be not an absolute path.
Maybe some other places can be improved to avoid DRACUT_INSTALL being not an absolute path.

Signed-off-by: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
2020-08-05 17:46:30 +02:00
Thomas Blume 3f5bf54fbf 35network-legacy: simplify fallback dhcp setup
suppress redundant calls to network setup

combine code for "no ip option directed at our interface" and
"No ip lines default to dhcp"
correct evaluation of return code for creating did-setup files
fix application of "load_ipv6" call to ipv6 setup only

Reference: bsc#1173402
2020-08-05 12:32:24 +02:00
Denis Volkov 09a691af3b Change the order of NFS servers during the boot
NFS server provided by DHCP in next-server option has higher priority than DHCP-server itself
2020-08-04 17:33:41 +02:00
David Tardon d9e27b0917 match simplified rd.zfcp format too
The simplified format was introduced by commit
c8aa1d949a .
2020-08-04 16:27:48 +02:00
David Tardon ae83919a7a match the whole string 2020-08-04 16:27:48 +02:00
Kairui Song 4159819fbb 99squash: simplify the code
The new dracutsysrootdir could be used to replace the shell function
required_in_root, so drop it and also simplify the code.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-08-04 14:24:53 +02:00
Kairui Song cfd872392c 99squash: improve pre-requirements check
Check for systemd-initrd and squashfs-tools in check() to fail early if
it won't work.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-08-04 14:24:53 +02:00
Kairui Song 3a2beb037c 99squash: Don't hardcode the squash sub directories
Signed-off-by: Kairui Song <kasong@redhat.com>
2020-08-04 14:24:53 +02:00
Kairui Song dc9596155d dracut-initqueue: Print more useful info in case of timeout
Currently when initqueue timeout, it span the console with
"dracut-initqueue timeout - starting timeout scripts", which isn't very
helpful as we still don't know what actually happened. Try to improve
this by print what is actually being waited.

Besides, only print "starting timeout scripts" when there are
actual timeout scripts to use.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-08-04 14:00:06 +02:00
Norbert Lange acc782bad5 mount-root.sh: fix writing fstab file with missing fsck flag
if the kernel argument rootflags is set, then dracut will
not parse the rootfs fstab and rootfsck wil not be set.

if the filesystem can be fsck'ed then its unmounted,
and an entry to the local fstab is written, omitting the last
field.

mounting /sysroot using fstab will then fail.

This change makes sure that the filed is always written.

Signed-off-by: Norbert Lange <norbert.lange@andritz.com>
2020-08-04 13:26:33 +02:00
Kairui Song 5c025a7d2a 99memstrack: Only start tracking service when rd.memdebug=4|5
Currently systemd will always start the tracking service, it will
exit early if rd.memdebug<=3 so there is no issue here, but it
leave a message of: "Started Memstrack Anylazing Service.".
Better to avoid such message if it's not used.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-08-04 12:53:14 +02:00
Alexander Tsoy 07417b7fc5 lvm: fix removal of pvscan from udev rules
udev rules provided by lvm 2.02.128 and newer uses '+=' instead of '='.
2020-08-04 12:30:40 +02:00
Gaël PORTAY 30ea52f88c dracut.modules.7.asc: fix reference to insmodpost module
The module 96insmodpost was renamed to 90kernel-modules since commit
5078c98a (move insmodpost and blacklisting to 90kernel-modules)
2020-08-04 11:08:10 +02:00
Gaël PORTAY e902207014 dracut.modules.7.asc: fix another typo 2020-08-04 11:08:10 +02:00
Daniel Molkentin 480aa9695f 95resume: Do not resume on iSCSI, FCoE or NBD
The iSCSI configuration is started after dracut checks for resume,
so we run into a timeout here. Additionally it's questionable if
resume on iSCSI makes sense (or is even supported on the platform).

Same holds true for Network Block Devices and FcOE, cover those as well

References: bsc#999663

Original-patch-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Daniel Molkentin <daniel.molkentin@suse.com>
2020-08-04 10:37:57 +02:00
Alexander Tsoy fe02bc78ac lvm: remove unnecessary ${initdir} from lvm_scan.sh
lvm_scan.sh runs in the initramfs, so paths should not be prefixed with
${initdir}.
2020-08-04 09:53:51 +02:00
Martin Wilck 880d155967 95nfs: use ip_params_for_remote_addr()
Use the new helper function.
2020-08-04 08:43:32 +02:00
Martin Wilck 6dbae7e772 95iscsi: use ip_params_for_remote_addr()
Use the new helper function.
2020-08-04 08:43:32 +02:00
Martin Wilck ceca74ccc3 dracut-functions: add ip_params_for_remote_addr() helper
This helper function takes a remote IP address, and tries to
determine the dracut command line arguments ip= and ifname= that
will make this remote address reachable during boot.

Functionality was taken from the module-setup.sh scripts of 95iscsi and 95nfs,
cleaned up and fixed some issues in particular with statically configured
networks, where the old code would print the unsupported string
"$ifname:static".
2020-08-04 08:43:32 +02:00
Enzo Matsumiya 019610af26 95nvmf: add NVMe over TCP support
Add support to boot from an NVMe over TCP device.

Example of supported command line formats:

nvme.discover=tcp:192.168.1.3::4420
nvme.discover=tcp:192.168.1.3 # will use 4420 as default svcid

- Create is_nvmf() function to handle all fabrics types
- Fix parse_nvmf_discover() to correctly use the default values
- Auxiliary function to validate an IP connection
- Fix inverted result for getargbool when reading "rd.nonvmf" command line parameter

Requires rd.neednet=1
Requires adding/replacing STARTMODE in /etc/sysconfig/network/ifcfg-ethX to "nfsroot"
to avoid shutdown hanging in initiator

Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
2020-08-04 08:22:25 +02:00
q66 63b05a8e67 dracut.sh: fix ia32 detection for uefi executables 2020-08-03 18:51:49 +02:00
q66 fa1b98e4ea mkinitrd-dracut.sh: use vmlinux regex for ppc*, vmlinuz for i686
Previously this would not catch ppc64le, now it does; same with
i686.
2020-08-03 17:59:01 +02:00
q66 05ce5c41b6 90ppcmac: respect DRACUT_ARCH, don't exclude ppcle 2020-08-03 16:47:51 +02:00
Kairui Song f7ad1479f2 90kernel-modules: add pci_hyperv
Install pci_hyperv for SR-IOV devices on hyperv machines.
2020-08-03 15:57:04 +02:00
Jóhann B. Guðmundsson 0cf01f125a As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Jóhann B. Guðmundsson 8cb5ac1b30 As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Jóhann B. Guðmundsson d9149c6ca7 As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Jóhann B. Guðmundsson c437933cb0 As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Jóhann B. Guðmundsson e1130a8340 As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Jóhann B. Guðmundsson 0c1bd016ec As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Jóhann B. Guðmundsson 317d841c78 As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Jóhann B. Guðmundsson 5cb2a4004d As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Jóhann B. Guðmundsson 38ba90bf88 As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
Jóhann B. Guðmundsson 265f696b53 As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated 2020-07-31 17:11:25 +02:00
q66 d8d5cb839c dracut.sh: fix early microcode detection logic
This fixes two issues:

1) on non-x86 systems in non-hostonly config this would cause
   an annoying warning on every initramfs generation
2) on non-x86 systems in hostonly config this would result in
   early microcode not getting disabled
2020-07-26 10:25:42 +02:00
Thomas Blume 3b869230a0 95iscsi: fix ipv6 target discovery
ipv6 addresses need square brackets, otherwise the iscsi discovery and log-in,
which adds the iscsi port after another colon will get confused and fail.
2020-07-09 21:19:43 +02:00
Martin Wilck 46f3156426 91zipl: parse-zipl.sh: honor SYSTEMD_READY
The zipl partition should not be mounted if SYSTEMD_READY=0 is set.
Otherwise booting issues with multipath will result.
2020-07-09 18:06:50 +02:00
Kairui Song 5a4c346933 dracut.sh: FIPS workaround for openssl-libs on Fedora/RHEL
On Fedora/RHEL, libcryto will verify both itself and libssl on start, if
libssl is missing, FIPS self test will fail. However libssl is not a
dependency of libcryto so dracut will not install it, unless some other
binary or library pulls it in. Systemd requires libssl, so in most cases
it just worked, but could fail in some corner cases where systemd is not
used.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-07-02 17:05:23 +02:00
Kairui Song de3cb0e321 dracut.sh: Move the library workaround after squash
Ensure the workaround is also valid when dracut-squash module is used

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-07-02 17:05:23 +02:00
Lukas Nykryn 6dafdda4a6 install: also install post weak dependencies of kernel modules 2020-07-02 16:06:44 +02:00
Beniamino Galvani 5c3d0a9647 cms: regenerate NetworkManager connections
After changing the kernel command line, the cmsifup script calls ifup
to activate the interface. However, ifup is only available in the
network-legacy module; when using the network-manager module, we
should regenerate connections according to the command line; then
later NM will be run and will activate the device.
2020-06-25 10:58:34 +02:00
Beniamino Galvani 6e1e87cd25 network-manager: move connection generation to a lib file
Move the connection generation code to a library file so that it can
be reused from other places.
2020-06-25 10:58:34 +02:00
Daniel Molkentin 55b0d2edaf 95iscsi: fix missing space when compiling cmdline args
Reference: bsc#1172816
2020-06-17 21:01:03 +02:00
Hannes Reinecke 2f03d69f9d 95nvmf: add module for NVMe-oF
Add a module for booting from NVMe-oF devices.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2020-06-17 09:34:53 +02:00
Kairui Song 5f8063c6f2 95nfs: only install rpc services for NFS < 4 when hostonly is strict
Most rpc services are not needed for NFSv4, so skip these components
to save space. rpc.idmapd is still needed in case of
nfs4_disable_idmapping is set to 0.
2020-05-29 16:51:45 +02:00
Harald Hoyer 871d63c3be Fix CI badges in README.md and fix dracut description
While fixing the CI badges, I removed some old crufty README text.
2020-05-29 16:15:42 +02:00
Beniamino Galvani eb770a4a20 network-manager: set kernel hostname from the command line
Since commit ff70adf873ef ("initrd: save hostname to a file in /run"),
the initrd generator of NetworkManager parses the hostname from 'ip='
options of the kernel command line and writes it to
/run/NetworkManager/initrd/hostname.

When that file exists, set the kernel hostname.

In presence of multiple hostnames in the command line, the last one
wins. Hostnames from command line always have precedence over ones
received through DHCP. This is a bit different from the legacy network
module that gives higher precedence to the hostname (from DHCP or
command line) of the last interface that is brought up, which depends
on the udev order.
2020-05-29 14:42:42 +02:00
Harald Hoyer 7169e5f0e4 dracut.conf.5.asc: document how to config --no-compress in the config
Fixes: https://github.com/dracutdevs/dracut/issues/824
2020-05-29 14:08:52 +02:00
Harald Hoyer c800d1a7b9 dracut.cmdline.7.asc: clarify usage of `rd.lvm.vg` and `rd.lvm.lv`
Fixes: https://github.com/dracutdevs/dracut/issues/816
2020-05-29 13:28:27 +02:00
Harald Hoyer b448655ba7 CI: remove Fedora 30, add Fedora 32 2020-05-29 10:53:57 +02:00
Alexander Tsoy 50cc23ba32 busybox: simplify listing of supported utilities
'--list' option is supported since busybox-1.20.0, which was released
in 2010.
2020-05-29 10:27:59 +02:00
Alexander Tsoy f769154bcc dracut-functions: fix find_binary() to return full path
Fixes: a01204202b (Allow running on a cross-compiled rootfs)
2020-05-29 10:27:59 +02:00
Kairui Song 2a61132865 Remove cleanup_trace_mem calls
In commit 49c4172 all shell based memory tracing functions are removed,
there are some left over. Remove them as well.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-05-27 16:51:52 +02:00
Kairui Song 424f01e2a0 99memstrack: hook script should not call exit
With memstrack module, rd.break may not work because the hook scripts
are sourced, not executed, so the exit call will make pre-pivot queue
exit early. See 98dracut-systemd/dracut-pre-pivot.sh, everything after
"source_hook cleanup" will be ignored.

Replace with return instead.

Credits go to Lukas Nykryn <lnykryn@redhat.com> who helped discover and
debug this issue.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-05-27 16:51:52 +02:00
Tomasz Paweł Gajc 1ec7b694b5 install dependant libs too
By default rng-tools are compiled with pkcs11 support.
Make sure opensc-pkcs11.so library is installed inside initramfs to prevent error on boot
2020-05-20 15:45:38 +02:00
Javier Martinez Canillas ff366790a6 51-dracut-rescue.install: Don't use BLS fragment shipped by kernel package
For the GRUB and zipl bootloaders the BLS fragment that is shipped by the
kernel package is used, so the same fragment is used for the rescue entry.

But there are cases where this BLS fragment is not suitable. For example,
if the boot directory is on a btrfs subvolume the path in the linux and
initrd fiels need to be adjusted with the real path. Otherwise GRUB won't
be able to read them.

The GRUB and zipl kernel-install plugins already take care of this before
installing the BLS fragments, so just copy the installed fragment that has
the updated paths instead of using the BLS shipped by the kernel package.

Resolves: rhbz#1827882

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2020-05-07 15:16:00 +02:00
Fabian Vogt 32dfd41688 Fix test in lsinitrd
If $uefi is empty, this evaluated to true previously,
resulting in "initrd in UEFI: : 13M".
2020-05-04 11:48:09 +02:00
Derek Hageman cb9e6881dd 90crypt/module-setup.sh: fix force on multiple lines
The first line in crypttab with a "force" option causes all subsequent
lines to be included as if they also had it set because the variable
used to track it is not reset between loop iterations.  So fix that by
just setting it to empty before the check for the force option.
2020-05-01 11:43:47 +02:00
Harald Hoyer c6a2ebffe5 90kernel-modules/module-setup.sh: add sg kernel module
Fixes udevd messages about failure of `modprobe -bv sg`.
2020-04-30 21:51:58 +02:00
Harald Hoyer 5bfebf0f04 90crypt/module-setup.sh: try to catch kernel config changes
If a crypto kernel module changes from compiled in to module, the
encrypted disk might fail to open, because the kernel module was
not included in the initramfs.

This patch tries heuristically to catch such modules.

Fixes https://github.com/dracutdevs/dracut/issues/706
2020-04-24 12:29:05 +02:00
Harald Hoyer 586a56c287 Install crypto modules in 90kernel-modules
We don't want to play catch up with hash and encryption algorithms.
To be safe, just use the hammer and include all crypto.

Fixes https://github.com/dracutdevs/dracut/issues/802
2020-04-24 11:40:15 +02:00
Peter Georg faea4e4ddb Always pull in machinery to read ifcfg files
So far machinery is only pulled in if the user has not yet included any
ifcfg files.
2020-04-21 22:27:11 +02:00
Kairui Song 7dd8a2f4d3 Add 99memstrack module
memstrack is a new tool to track the overall memory usage and
allocation, which can help off load the improve the builtin module
memory tracing function in dracut.

With this change, the rd.memdebug=4 behavior is similiar with before,
but the report is defered to pre-pivot, so the memory usage info
during the whole initramfs run is traced. And the ourput format is
changed a bit:

  dracut-pre-pivot[519]: ======== Report format module_summary: ========
  dracut-pre-pivot[519]: Module squashfs using 10.4MB (2658 pages), peak allocation 10.4MB (2671 pages)
  dracut-pre-pivot[519]: Module qxl using 3.4MB (865 pages), peak allocation 3.4MB (880 pages)
  dracut-pre-pivot[519]: Module crc32c_intel using 2.0MB (519 pages), peak allocation 3.0MB (769 pages)
  dracut-pre-pivot[519]: Module serio_raw using 2.0MB (505 pages), peak allocation 3.6MB (918 pages)
  dracut-pre-pivot[519]: Module virtio_console using 1.6MB (416 pages), peak allocation 1.6MB (419 pages)
  ... snip ...
  dracut-pre-pivot[519]: ======== Report format module_summary END ========

It now contains more detail and also includes the peak usage which could
be more helpful.

And now it have a rd.memdebug=5, which will print more detail about
the stack trace of the top memory user, also printed on pri-pivot:

  dracut-pre-pivot[519]: ======== Report format module_top: ========
  dracut-pre-pivot[519]: Top stack usage of module squashfs:
  dracut-pre-pivot[519]:   (null) Pages: 2658 (peak: 2671)
  dracut-pre-pivot[519]:     (null) Pages: 2658 (peak: 2671)
  dracut-pre-pivot[519]:       async_page_fault (0xffffffff81a01149) Pages: 1448 (peak: 1461)
  dracut-pre-pivot[519]:         do_async_page_fault (0xffffffff8105c509) Pages: 1448 (peak: 1461)
  dracut-pre-pivot[519]:           do_page_fault (0xffffffff8106296a) Pages: 1448 (peak: 1461)
  dracut-pre-pivot[519]:             do_user_addr_fault (0xffffffff810626bd) Pages: 1448 (peak: 1461)
  dracut-pre-pivot[519]:               handle_mm_fault (0xffffffff812940c4) Pages: 1448 (peak: 1461)
  dracut-pre-pivot[519]:                 __handle_mm_fault (0xffffffff81293627) Pages: 1195 (peak: 1208)
  dracut-pre-pivot[519]:                   __do_fault (0xffffffff8128b07e) Pages: 1195 (peak: 1208)
  dracut-pre-pivot[519]:                     filemap_fault (0xffffffff8124c0b9) Pages: 1195 (peak: 1208)
  dracut-pre-pivot[519]:                       __do_page_cache_readahead (0xffffffff812585da) Pages: 1063 (peak: 1076)
  dracut-pre-pivot[519]:                         read_pages (0xffffffff812583c2) Pages: 1063 (peak: 1076)
  dracut-pre-pivot[519]:                           squashfs_readpage squashfs (0xffffffffc0022073) Pages: 1039 (peak: 1052)
  dracut-pre-pivot[519]:                             squashfs_readpage_block squashfs (0xffffffffc0024334) Pages: 744 (peak: 744)
  dracut-pre-pivot[519]:                               squashfs_copy_cache squashfs (0xffffffffc0021a3f) Pages: 744 (peak: 744)
  dracut-pre-pivot[519]:                                 pagecache_get_page (0xffffffff8124abf7) Pages: 744 (peak: 744)
  dracut-pre-pivot[519]:                                   __page_cache_alloc (0xffffffff81247df6) Pages: 744 (peak: 744)
  dracut-pre-pivot[519]:                                     alloc_pages_current (0xffffffff812cdca7) Pages: 744 (peak: 744)
  dracut-pre-pivot[519]:                                       __alloc_pages_nodemask (0xffffffff812b3107) Pages: 744 (peak: 744)
  dracut-pre-pivot[519]:                                         __alloc_pages_nodemask (0xffffffff812b3107) Pages: 1488 (peak: 1488)
  dracut-pre-pivot[519]: Top stack usage of module qxl:
  dracut-pre-pivot[519]:   (null) Pages: 865 (peak: 880)
  dracut-pre-pivot[519]:     entry_SYSCALL_64_after_hwframe (0xffffffff81a0008c) Pages: 855 (peak: 858)
  dracut-pre-pivot[519]:       do_syscall_64 (0xffffffff81002a5a) Pages: 855 (peak: 858)
  dracut-pre-pivot[519]:         __x64_sys_finit_module (0xffffffff8117ccea) Pages: 811 (peak: 811)
  dracut-pre-pivot[519]:           __do_sys_finit_module (0xffffffff8117cc6e) Pages: 811 (peak: 811)
  dracut-pre-pivot[519]:             load_module (0xffffffff8117c6be) Pages: 802 (peak: 802)
  dracut-pre-pivot[519]:               do_init_module (0xffffffff81179e72) Pages: 802 (peak: 802)
  dracut-pre-pivot[519]:                 do_one_initcall (0xffffffff81000d5a) Pages: 802 (peak: 802)
  dracut-pre-pivot[519]:                   serio_raw_poll serio_raw (0xffffffffc0200054) Pages: 802 (peak: 802)
  dracut-pre-pivot[519]:                     __pci_register_driver (0xffffffff81557804) Pages: 802 (peak: 802)
  dracut-pre-pivot[519]:                       driver_register (0xffffffff8167ed24) Pages: 802 (peak: 802)
  dracut-pre-pivot[519]:                         bus_add_driver (0xffffffff8167cbb2) Pages: 801 (peak: 801)
  dracut-pre-pivot[519]:                           driver_attach (0xffffffff8167d28e) Pages: 801 (peak: 801)
  dracut-pre-pivot[519]:                             bus_for_each_dev (0xffffffff8167b62c) Pages: 801 (peak: 801)
  dracut-pre-pivot[519]:                               __driver_attach (0xffffffff8167e18f) Pages: 801 (peak: 801)
  dracut-pre-pivot[519]:                                 device_driver_attach (0xffffffff8167e0ed) Pages: 801 (peak: 801)
  dracut-pre-pivot[519]:                                   driver_probe_device (0xffffffff8167de6c) Pages: 801 (peak: 801)
  dracut-pre-pivot[519]:                                     really_probe (0xffffffff8167d9c9) Pages: 801 (peak: 801)
  dracut-pre-pivot[519]:                                       pci_device_probe (0xffffffff81559627) Pages: 801 (peak: 801)
  dracut-pre-pivot[519]:                                         local_pci_probe (0xffffffff81557f98) Pages: 801 (peak: 801)
  dracut-pre-pivot[519]:                                           qxl_pci_probe qxl (0xffffffffc01f0387) Pages: 773 (peak: 773)
  dracut-pre-pivot[519]:                                             drm_fbdev_generic_setup drm_kms_helper (0xffffffffc01b30c5) Pages: 773 (peak: 773)
  dracut-pre-pivot[519]:                                               drm_fbdev_client_hotplug drm_kms_helper (0xffffffffc01b2656) Pages: 773 (peak: 773)
  dracut-pre-pivot[519]:                                                 __drm_fb_helper_initial_config_and_unlock drm_kms_helper (0xffffffffc01b1a28) Pages: 770 (peak: 770)
  dracut-pre-pivot[519]:                                                   drm_fb_helper_generic_probe drm_kms_helper (0xffffffffc01b2fa5) Pages: 770 (peak: 770)
  dracut-pre-pivot[519]:                                                     vzalloc (0xffffffff812aa39c) Pages: 770 (peak: 770)
  dracut-pre-pivot[519]:                                                       __vmalloc_node_range (0xffffffff812aa200) Pages: 768 (peak: 768)
  ... snip ...
  ======== Report format module_top END ========

This could be very helpful for debuging memory usage issues.
2020-04-20 20:22:37 +02:00
Kairui Song 49c4172f4e Remove memtrace-ko and rd.memdebug=4 support in dracut
This feature could be off loaded to memstrack, which have better
accurecy, better performance, and have more detailed tracing features.

Also simplify make_trace_mem a bit.

And currently rd.memdebug=4 is unstable, fails from time to time.
2020-04-20 20:22:37 +02:00
Beniamino Galvani 87bffc36e7 network-manager: install libnss DNS and mDNS plugins
Install libnss_dns.so and libnss_mdns4_minimal.so plugins for the Name
Service Switch (NSS) functionality of glibc so that name resolution
through /etc/resolv.conf and mDNS works in the initrd.

Fixes: #772
2020-04-20 16:47:56 +02:00
Harald Hoyer 3a4a212649 systemd: skip dependency add for non-existent units
Fixes: https://github.com/dracutdevs/dracut/issues/795
2020-04-20 16:24:15 +02:00
Mikhail Novosyolov de34ba76e5 i18n: Always install /etc/vconsole.conf
/etc/vconsole.conf must be installed always, even in generic initrds, not only host-only ones.
systemd-vconsole-setup is run at initrd stage and expects either /etc/vconsole.conf or kernel cmdline options to exist.

I have also proposed a change in systemd-vconsole-setup that makes it behave better if /etc/vconsole.conf does not exist:
https://github.com/systemd/systemd/pull/15479
But it is just a fallback. If /etc/vconsole.conf does not exist in initrd and if that patch is applied on systemd,
then the default consoel font is set despite the one being set in /etc/vconsole.conf and this setting is inherited
when new TTYs are opened. This leads to full ignorance of settings in /etc/vconsole.conf.
It is incorrect, and that is why this file must be copied to initrds always, but not only on host-only initrds.

Fixes: https://github.com/dracutdevs/dracut/issues/796

Signed-off-by: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
2020-04-20 15:37:28 +02:00
Jonas Witschel 8e1a4dc5f8 dracut-lib.sh: quote variables in parameter expansion patterns
According to POSIX.1-2017, 2.6.2 Parameter Expansion:

${parameter%[word]} [...] The word shall be expanded to produce a
pattern.

This means if word contains variables that itself contain special
characters like asterisks or backslashes, these are treated as pattern
characters unless the variable is quoted. Try e.g. the following example
in bash, dash or (busybox) ash:

i='a\c'; j='\'; echo "${i%$j*}"

This prints "a\c" because "$j*" is expanded to "\*", escaping the
asterisk. In contrast,

i='a\c'; j='\'; echo "${i%"$j"*}"

produces the expected result "a" because the backslash is not specially
treated any more after quoting.

The quotes that this commit adds have been previously removed in commit
f9c96cf56f, citing issues with busybox
hush without further specifying the actual error. I tested a recent
busybox build (upstream commit 9aa751b08ab03d6396f86c3df77937a19687981b)
and couldn't find any problems. Note that the above example always
produces "a\c" in hush regardless of quoting $j, making hush unsuitable
for use with dracut, but using quotes in parameter expansions generally
works.

The unquoted variables break the "rd.luks.uuid/name" kernel command line
options in dracut 050 because

str_replace "$luksname" '\' '\\'

in modules.d/90crypt/parse-crypt.sh is not able to escape the
backslashes any more, see GH-723, GH-727: backslashes in the
systemd-cryptsetup@.service unit name stay unescaped for use in udev
(cf. commit 0f6d93eb9d), leading to
failures in starting the unit.

This partially reverts commit f9c96cf56f.
2020-04-20 14:59:02 +02:00
Martin Wilck 25c7a13985 90nvdimm: include nvdimm keys in initrd
This is necessary to actually unlock NVDIMM keys during boot.
2020-04-17 18:22:36 +02:00
Kairui Song 872eb69936 95znet: Add a rd.znet_ifname= option
qeth device may have a different IP for each boot, so the rd.ifname=
option will no longer work. So for znet device, introduce a
rd.znet_ifname= options, to subchannel id instead of MAC address as the
identifier and rename the interface.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-04-14 12:56:13 +02:00
Harald Hoyer 11474b808b TEST-99: exclude /etc/dnf/* from check
file /etc/dnf/modules.d/eclipse.module.rpmmoved is not owned by any package
2020-04-09 22:11:16 +02:00
Daniel Molkentin 3b626094bd mkinitrd-suse.sh: Fix i586 platform detection
Reference: boo#1168341
2020-04-07 21:10:43 +02:00
Ben Howard b8a92b7156 multipath: add automatic configuration for multipath
Add support for 'rd.multipath=default' for using the default
configuration on boot. The intended purpose for this is to help support
ostree-based image boots from multipathed devices (such as Fedora and
Red Hat CoreOS).
2020-04-03 23:48:32 +02:00
Alexander Sosedkin 3a043feea1 url-lib: drop NSS if it's not in curl --version 2020-04-02 22:09:39 +02:00
Patrick Talbert b68930ed3d dhclient-script: Fix typo in output of BOUND & BOUND6 cases
No bonding going on here.

Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
2020-03-19 20:45:41 +01:00
Sebastian Mitterle defb1611c7 dasd: only install /etc/dasd.conf if present
`dasd.conf` needn't be present on system even if modules have been loaded.

Check if file exists to avoid error message during kernel update
```bash
dracut-install: ERROR: installing '/etc/dasd.conf'
dracut: FAILED: /usr/lib/dracut/dracut-install -D /var/tmp/dracut.YvVRx5/initramfs -H /etc/dasd.conf
```
2020-03-19 18:05:30 +01:00
Daniel Molkentin db44331dc4 Makefile: really make externally defined CFLAGS work
The fix in aed52a6cfb43ebea372328fd5837c1f341c3f0df does not
work (second line will be ignored on override), so expand the implicitly
defined rule and add them there.
2020-03-19 16:46:54 +01:00
Daniel Molkentin c490ea8b2b Make externally defined CFLAGS work 2020-03-19 16:46:54 +01:00
Harald Hoyer dfe2247a43 dracut.sh: add check for invalid configuration files
Emit a warning about possible misconfigured configuration files, where
the spaces around values are missing for +=""

Better report a possible source of problems. We can fix annoying false
positives later.
2020-03-18 16:34:35 +01:00
Đoàn Trần Công Danh 17d62d1206 cryptroot-ask: no warn if /run/cryptsetup exist
In either case:
- encrypted device is decrypted, udev will trigger device changes again,
- multiple encrypted device,

cryptroot-ask will run multiple time, then report:
> mkdir: cannot create directory '/run/cryptsetup': File exists

Pass `-p` into mkdir to ignore that warning.
2020-03-16 18:26:33 +01:00
Dusty Mabe 97a931c7d9 don't prefer $TMPDIR over --tmpdir
Ability to use `$TMPDIR` was introduced in bc1e69b but
causes the `--tmpdir` option on the command line to be
ignored. Switch to only using `$TMPDIR` if `--tmpdir`
wasn't specified.
2020-03-16 14:45:01 +01:00
Harald Hoyer 91418b13dc TEST-03-USR-MOUNT/test.sh: increase loglevel
to debug the spurious fails
2020-03-12 14:17:45 +01:00
Harald Hoyer ca8ca19091 .travis.yml: reformat 2020-03-12 13:54:39 +01:00
Lukas Nykryn 7069132ec7 network: fix glob matching ipv6 addresses
In this case we want to cover three cases
1) ip_address:ip_address
2) number:macaddress
3) :macaddress

We consider something an IPv6 address if it starts with number and
contains ":", but IPv6 addresses are in hexa.
2020-03-12 13:46:46 +01:00
Harald Hoyer 3b396a7d50 TEST-41-NBD-NM/Makefile: should be based on TEST-40-NBD not TEST-20-NFS 2020-03-12 13:30:24 +01:00
Harald Hoyer d5bfaf58ab github actions: use test container directly 2020-03-12 13:21:42 +01:00
Harald Hoyer a22ab24d53 test: use dd from /dev/zero, instead of creating files with a hole 2020-03-12 12:46:15 +01:00
Beniamino Galvani 3dcaa97ca4 network-manager: ensure that nm-run.sh is executed when needed
The network-manager command line hook must install a
initqueue/finished hook to ensure that nm-run.sh is executed when
there are network connections to activate.

Fixes: #694
2020-03-12 11:42:37 +01:00
Harald Hoyer fc6f458c3b TEST-12-RAID-DEG/create-root.sh: more udevadm settle 2020-03-11 14:02:46 +01:00
Harald Hoyer 0402b3777b btrfs: force preload btrfs module
fixes https://github.com/dracutdevs/dracut/issues/658

raid6_pq and xor takes time doing benchmarking

[    3.983009] request_module fs-btrfs succeeded, but still no fs?
2020-03-11 13:38:12 +01:00
Harald Hoyer 058739bf69 README.md: fix github action badge links 2020-03-11 12:59:58 +01:00
Thomas Blume 8446c8f9de 95fcoe: default rd.nofcoe to false
rd.nofcoe should default to false, e.g. fcoe should be enabled unless
overwritten from the command line.
The same applies for lldapd.sh.
2020-03-11 12:29:03 +01:00
Radek Vykydal 7fb8f939a5 Fix pre-trigger stage by replacing exit with return in lldpad.sh
Using exit makes the pre-trigger stage finish after running 03-lldpad.sh
pre-trigger hook.
2020-03-10 12:47:55 +01:00
Alexander Tsoy a76aa8e390 Makefile: fix VERSION again
The variable is not undefined anymore after the first assignment, so
we should check if variable is empty instead.
2020-03-09 08:50:20 +01:00
Daniel Molkentin 2293609dcb 95dcssblk: fix script permissions 2020-03-06 13:51:06 +01:00
Topi Miettinen bc1e69b691 Use TMPDIR if available
Use environment variable TMPDIR (typically /run/user/$UID) as default
temporary directory, if available. This should be more private
location than /var/tmp. Path specified with --tmpdir is takes
precedence over TMPDIR and /var/tmp is still used as last resort if
neither TMPDIR is set nor --tmpdir is used.

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
2020-03-06 11:40:00 +01:00
Martin Wilck 0386e46277 dracut.sh: don't call fsfreeze on subvol of root file system
dracut.sh already doesn't call fsfreeze if the output file is on
the root file system. For btrfs, however, this is not sufficient.
Because fsfreeze is a superblock operation, and all btrfs subvolumes
share the same superblock, fsfreeze may freeze the entire system
if the subvolume on which the output file is written and / are
subvolumes of the same file system. Avoid this by comparing file
system UUIDs for btrfs.

Fixes: de576db3c2 ("call fsfreeze(8) on /boot to flush initramfs data & metadata to media")
2020-03-06 11:37:16 +01:00
Daniel Molkentin 7a04712ad0 95zfcp_rules/parse-zfcp.sh: remove rule existence check
Reference: bsc#1008352

Original-Patch-By: Michal Suchanek <msuchanek@suse.com>
2020-03-06 11:32:41 +01:00
Daniel Molkentin db9b5851f3 99base: Remove duplicate nfsroot_to_var from dracut-lib.sh
It already lives in nfs-lib.sh, which is the more correct library scope.

Fixes #17
2020-03-06 11:02:15 +01:00
Martin Wilck 5a720ebf67 dracut.spec: add 90nvdimm 2020-03-06 10:52:06 +01:00
Martin Wilck 18420d9ce5 90kernel-modules: remove nfit from static module list
The 90nvdimm module now resolves the nfit dependency when it's
necessary, so it's not necessary any more to pack it always.
2020-03-06 10:52:06 +01:00
Martin Wilck 7ef5ead6f4 Add module "90nvdimm" for NVDIMM support
Detection of persistent memory devices works mostly out of the box
already. Only the "provider" modules for ndbus devices, which are responsible
to extract information of available NVDIMM devices and their configuration
from system firmware, are only indirectly linked into the module stack.
Examples for such modules are nfit.ko, nd_e820.ko, and virtio-pmem.ko.

Add a module that resolves these dependencies.
2020-03-06 10:52:06 +01:00
Đoàn Trần Công Danh eb8a7a9635 Makefile: merge main-version and git-version earlier
With GNU Make 4.3 on both ArchLinux, and VoidLinux,
GITVERION is always empty because of bad substitution.
Change '\#' to simply '#' can fix it,
but we don't need that complation.

We can merge DRACUT_MAIN_VERSION and GITVERSION into DRACUT_FULL_VERSION.
Because, GITVERSION will be attached back to DRACUT_MAIN_VERSION in all
situation.

While we're at it, detect if we're in git worktree by:
limiting GIT_CEILING_DIRECTORIES to parent directory of
dracut's top level directory; instead of checking for .git directory,
in order to support git-worktree, in such case, .git will be a file, see
gitrepository-layout(5)
2020-03-06 09:49:40 +01:00
Harald Hoyer 9e68789d66 dracut.spec: add version check for deprecated files 2020-03-04 14:39:39 +01:00
Harald Hoyer 3ba12b2249 test/TEST-35-ISCSI-MULTI: bump disk space 2020-03-04 14:39:22 +01:00
Harald Hoyer 00efe708ca NEWS, AUTHORS: update 2020-03-04 11:43:22 +01:00
Harald Hoyer 0c983cdc49 TEST-14-IMSM: clear marker disk 2020-03-04 11:06:04 +01:00
Harald Hoyer 821e08da03 fedora-test-github.sh: only fetch tags, if building rpm 2020-03-04 11:06:04 +01:00
Marek Marczykowski-Górecki ebeed55c07 Consider also drm_dev_register when looking for gpu driver
DRM drivers are filtered for drm_crtc_init symbol,
but not all drivers use it. Especially, cirrus driver
doesn't use it since Linux 5.2.

The practical result is text plymouth theme instead of graphical when in qemu.

Fix it by looking also for drm_dev_register symbol.
Suggested by @haraldh
Fixes #712
2020-03-04 10:41:04 +01:00
Harald Hoyer 991100ba7a .github/workflows: bump timeout to 45min 2020-03-04 09:23:46 +01:00
Daniel Molkentin f2d33a7f61 90kernel-modules: Add PCI host controller modules
Currently there is no usb support on RPi4 in the
initrd phase as the pcie-brcmstb module is missing.
If part of the boot is handled from a USB stick
(e.g. with Ignition), the stick cannot be accessed.

Reference: boo#1162669
2020-03-04 09:23:09 +01:00
Daniel Molkentin 7dc918cad1 90crypt: install crypt-run-generator in non-systemd environments 2020-03-04 09:22:09 +01:00
Daniel Molkentin 452cb40497 90crypt: Do not call cryptsetup in a systemd environment
systemd provides its own cryptsetup facilities, and the
cryptsetup binary might not even exist, failing
to execute the discard flag processing.

Fixes #602
2020-03-04 09:22:09 +01:00
Daniel Molkentin 286f2a04a1 Merge branch 'regenerate_all' 2020-03-03 20:09:45 +01:00
nabijaczleweli 38c8fed48a Enable resume module if hibernation's enabled on the host
Ref: 34b56de12a
Fixes https://github.com/dracutdevs/dracut/issues/496
2020-03-03 19:51:08 +01:00
Daniel Molkentin 5b1d8bcc58
Merge branch 'master' into regenerate_all 2020-03-03 19:25:16 +01:00
Harald Hoyer c7403700df TEST-04-FULL-SYSTEMD: use seperate marker disk for root creation 2020-03-03 16:56:43 +01:00
Topi Miettinen ce62465caf Make lsinitrd usable for images made with Debian mkinitramfs
Debian mkinitramfs does not create the file 'early_cpio', so detection
of additional cpio images fails and only the first cpio is listed.

I checked some Arch and Gentoo initramfs files and these didn't have
'early_cpio' either, but they also have only one cpio part.

Fix this so that if check for 'early_cpio' fails, check if firmware
files ('/kernel/*/microcode/*.bin') exist.

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
2020-03-03 12:48:58 +01:00
Harald Hoyer b3d40a4390 TEST-04-FULL-SYSTEMD: change error reporting 2020-03-02 14:55:51 +01:00
Lucas C. Villa Real 3d2a6d29d4 dracut_mkdir(): create parent directories as needed. 2020-03-02 14:48:11 +01:00
Harald Hoyer 1edee0c4a1 test/TEST-0[34] remove qemu return check
remove check of qemu return code $?

seems like it randomly returns with != 0
2020-03-02 14:42:27 +01:00
Topi Miettinen ecbdff68af Don't resolve libraries lazily if tmpdir is mounted with 'noexec'
If the temporary directory for images is mounted with 'noexec', dracut
would construct unbootable images because most dynamic libraries
aren't installed. Avoid this by not resolving library dependencies
lazily if the temporary directory is mounted with 'noexec'.

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
2020-03-02 09:56:26 +01:00
Alexander Miroshnichenko 3ea80545d6 stratis module: fix start order
Change start script order to pre-mount as stratis require fully initialized udev.
2020-02-28 20:43:01 +01:00
Frantisek Sumsal ef8915d7af fcoe/fcoe-genrules.sh: use $name instead of $env{INTERFACE}
Followup to a8ba1c4e25 and
11a5501d0f
2020-02-28 20:41:37 +01:00
Frantisek Sumsal 7261a0540a github: fetch git tags before testing
GitHub workflows fetch a clone of the dracut repository which doesn't
contain git tags, thus "breaking" the RPM build in certain situations
i.e.:
DRACUT_MAIN_VERSION in Makefile is defined as an output of `git describe`,
which in full git clone returns a tag with a numeric version. However,
without tags it returns SHA of the last commit, which later propagates into
`Provides:` attribute of the built RPM and can break dependency tree when
installed
2020-02-28 20:39:35 +01:00
Frantisek Sumsal 11a5501d0f cms/cmssetup.sh: use $name instead of $env{INTERFACE}
Followup to a8ba1c4e25
2020-02-28 16:32:11 +01:00
Frantisek Sumsal 355df861da test: build docs when running TEST-99-RPM 2020-02-28 16:31:43 +01:00
Frantisek Sumsal 8cba0ff833 github: add TEST-99 to the workflow 2020-02-28 16:31:43 +01:00
Frantisek Sumsal f1dc2180d4 TEST-99-RPM: ignore weak dependencies in dnf
Weak dependencies are useless for this test and pollute the chroot,
causing unexpected fails.
2020-02-28 16:31:43 +01:00
Frantisek Sumsal 3f4ffebf33 Makefile: fix RPM build
`make rpm` usually chose `/tmp` as the `$rpmbuild` dir, which breaks the
dracut build, since it needs to execute `./configure`, but `/tmp` is
mounted with `-o noexec`, leading to:

```
/var/tmp/rpm-tmp.SwEhJO: line 46: ./configure: Permission denied
error: Bad exit status from /var/tmp/rpm-tmp.SwEhJO (%build)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.SwEhJO (%build)
```

Switching to `/var/tmp` helps in this case.
2020-02-28 16:31:43 +01:00
Harald Hoyer d5088b1703 TEST-12-RAID-DEG: harden test
use whole sda as marker disk and clear it completly between test runs
2020-02-28 14:41:15 +01:00
Harald Hoyer 9ca53063ee test: use dd to write status to marker disk 2020-02-28 14:41:15 +01:00
Harald Hoyer 69341c9572 fedora-test.sh: set logtee timeout to 5 minutes 2020-02-28 14:41:15 +01:00
Harald Hoyer 55a974bae6 fedora-test.sh / fedora-test-github.sh: don't build the documentation
don't build the documentation, if running a test
2020-02-28 13:02:50 +01:00
Harald Hoyer 3703ec8672 Disable NetworkManager tests for Fedora 30 2020-02-28 12:53:48 +01:00
Harald Hoyer 74ba8f9e1d .travis.yml: add note about test container 2020-02-28 12:53:42 +01:00
Harald Hoyer a3f73298f2 testsuite: refactor qemu options
- refactor common qemu options
- fix the ens[0-9] interface shift
- add split network-[legacy|network] tests
2020-02-28 12:53:42 +01:00
Harald Hoyer 4b60a34715 Revert "test: run-qemu refactor common qemu parameters"
This reverts commit 77537bf2d7.

Sorry, for the noise!
2020-02-28 08:51:44 +01:00
Harald Hoyer 7374391434 Revert "test/run-qemu: add "-serial stdio""
This reverts commit c6c588d648.
2020-02-28 08:51:31 +01:00
Harald Hoyer c6c588d648 test/run-qemu: add "-serial stdio" 2020-02-28 08:47:52 +01:00
Harald Hoyer 77537bf2d7 test: run-qemu refactor common qemu parameters 2020-02-28 08:39:31 +01:00
Harald Hoyer 7c51256eb2 TEST-40-NBD: disable again
NBD is still too flaky and hangs hard sometimes
2020-02-27 16:44:28 +01:00
Harald Hoyer ba66cb2789 TEST-04-FULL-SYSTEMD: more info on failure 2020-02-27 16:42:21 +01:00
Harald Hoyer 2d75433cd7 test/test-functions: colorize startup 2020-02-27 16:17:23 +01:00
Harald Hoyer 58ee6dc7f9 .travis.yml: fix docker pull 2020-02-27 15:51:12 +01:00
Harald Hoyer 0d33ba030b test/TEST-40-NBD/test.sh: bail out early if mount fails 2020-02-27 15:27:30 +01:00
Harald Hoyer 63b67a48f9 nbd/parse-nbdroot.sh: don't create mount unit
let the generator do its thing
2020-02-27 15:27:30 +01:00
Harald Hoyer 4bd0ab61b2 test: remove "sudo" calls in test scripts 2020-02-27 15:27:30 +01:00
Harald Hoyer b4de4f287f test: do btrfs filesystem sync in create-root.sh 2020-02-27 15:27:30 +01:00
Harald Hoyer eb8856a58c TEST-40-NBD: run the working tests 2020-02-27 15:27:30 +01:00
Harald Hoyer 3c5036a62f TEST-03-USR-MOUNT: more debugging 2020-02-27 15:27:30 +01:00
Harald Hoyer 074ac62576 TEST-04-FULL-SYSTEMD: report failure on rootfs creation 2020-02-27 15:27:30 +01:00
Harald Hoyer 53e299e6f4 TEST-20-NFS/test.sh TEST-30-ISCSI/test.sh reduce debug output 2020-02-27 15:27:30 +01:00
Harald Hoyer 2996d9e56f test/TEST-60-IFCFG/test.sh: fixed qemu hubport netifs
netifs are offset by one if qemu hubport is used
2020-02-27 15:27:30 +01:00
Harald Hoyer 2f78bafa4b tests: untabify, reformat 2020-02-27 15:27:30 +01:00
Harald Hoyer f7b9356c9e test: fix server init scripts for network 2020-02-27 15:27:30 +01:00
Harald Hoyer 3aae122c4b Add github workflow 2020-02-27 15:27:30 +01:00
Harald Hoyer 93be2bc6ab add DRACUT_NO_XATTR global environment variable
Useful, if you know, that those can't be copied anyway.
2020-02-27 13:49:21 +01:00
Harald Hoyer a8ba1c4e25 network-legacy/net-genrules.sh: use $name instead of $env{INTERFACE}
The original behavior of $env{INTERFACE} was undocumented and changed in
the recent udev versions, breaking the ability to bring up networking
reliably. Switching to $name directive should fix this issue.

Related links:
 - systemd/systemd#12700 (udev PR)
 - systemd/systemd#12291 (related udev issue)
 - systemd/systemd#14935 (this issue, udev side)
 - #732 (this issue, dracut side)

Fixes: #732
2020-02-27 13:49:21 +01:00
Jonathan Lebon 4985aa8c6e network-legacy/ifup: fix ip=dhcp,dhcp6 setup_net logic
Previously, we were doing `setup_net` from `ifup` for any setup that
wasn't DHCP, since those are already taken care of by `dhclient-script`.

The issue is that the case-statement we use to detect this doesn't catch
options like `ip=dhcp,dhcp6`.

Fix this by reworking the logic here to just check if a
`setup_net_$netif.sh` hook exists. If so, then we know that `setup_net`
will be called for this interface later.

This was causing issues in RHCOS which now ships with `ip=dhcp,dhcp6` to
support IPv6 environments[1]. The code here would make us do `setup_net`
pre-emptively which IIUC would then cause the initqueue to finish
earlier even if we had more udev netif events to process.

[1] https://github.com/coreos/coreos-assembler/pull/1067

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1803926
2020-02-25 14:34:58 +01:00
Jonathan Lebon 7795fde44c network-legacy/ifup: drop redundant if-statement
No need to check that `$ret` is 0, we're already running inside an
if-statement block which checks this.
2020-02-25 14:34:58 +01:00
Harald Hoyer 2dc0cb50e3
Revert "github workflow"
This reverts commit 150cea0336.
2020-02-25 14:06:36 +01:00
Harald Hoyer 150cea0336
github workflow 2020-02-25 14:01:13 +01:00
Donovan Tremura 4237aeb040 Support the EFI Stub loader's splash image feature.
Checks if `uefi_splash_image` exists in `dracutsysroot` if not unset
`uefi_splash_image`. Alternate Value parameter expansion adds section-vma
for splash image to EFI stub loader when the path to image is valid and
not an empty file.

I did not test on other distributions, but on Arch Linux the `systemd`
package includes a splash image at the path
`/usr/share/systemd/bootctl/splash-arch.bmp`. Perhaps, if this is a
common practice, a default image could be gathered from that directory.

It is required that the image be in bitmap (`.bmp`) format according to
`splash.c`.

The code for `stub.c` and `splash.c` can be found at:
https://github.com/systemd/systemd/blob/master/src/boot/efi/stub.c
https://github.com/systemd/systemd/blob/master/src/boot/efi/splash.c
2020-02-20 11:03:30 +01:00
Harald Hoyer 16abea2592
systemd: install systemd-tty-ask-password-agent systemd-ask-password
fixes https://github.com/dracutdevs/dracut/issues/726
2020-02-18 15:33:23 +01:00
Eugene S. Sobolev c7ee6b3dbb network/net-lib.sh: Configure all iBFT interfaces
Added boolean command line option rd.iscsi.mp
2020-02-14 10:42:34 +01:00
Renaud Métrich cdc9cd0e41 dracut.sh: added help for --regenerate-all 2020-02-13 11:37:13 +01:00
Lukas Nykryn 76f6566fd7 Revert "wait for IPv6 RA if using none/static IPv6 assignment"
This reverts commit c603419030.

wait_for_ipv6_dad_link is only called from dhclient script,
so the original intent "wait for IPv6 RA if using none/static IPv6 assignment"
does not seem to be correct.

Anyway, this brings an issue on isolated networks, where you don't
have any routes outside. dhclient-script hangs on this check
and after it times out, dhclient is able to set the address normally.
2020-02-11 14:23:27 +01:00
Lukas Nykryn 962310483f dhclient-script: ipv6 uses different variables for nameservers
new_domain_name_servers and new_domain_search is only provided vit IPv4

see: https://src.fedoraproject.org/rpms/dhcp/blob/HEAD/f/dhclient-script#_148
2020-02-11 14:23:03 +01:00
Lukas Nykryn 579fbb9fc4 40network: bump rd.net.timeout.carrier to 10 seconds
On some devices kernel currently takes 5.2 seconds to detect carrier,
so let's make the default in dracut bit more sensible.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1772010
2020-02-10 14:37:15 +01:00
Daniel Cordero f668e7174e dracut.sh: check kmoddir is properly formed
Due to the way dracut-install handles modules from custom kmoddirs, add
a test that ensures the kmoddir argument seems sane.

In addition to erroring out, provide some guidance on how to proceed, as
well as a method of skipping the test via environment variable.
2020-01-27 09:02:46 +01:00
Daniel Cordero 1bef2934d7 dracut-install: fetch kernel modules from kmoddir
dracut, when passing --kmoddir, would only install modules that exist at
the same location as it will appear in the initramfs.

For most (possibly all) outputs, the output path would be /lib/modules,
so previously all kernel modules must be copied there or the module
installation silently fails.

Now use the original path variable, and install to the shortened path
variable (as calculated by kerneldirlen).

Note: This means that the argument to --kmoddir (and the modules filetree)
should be a directory that ends in 'lib/modules/$kernelversion'.
2020-01-27 09:02:46 +01:00
Harald Hoyer 350ec5d9dd
uefi-lib/uefi-lib.sh: fixed script for bash version 5
bash 5 `read` behaves differently and returns != 0 for 0 bytes read

fix it with the best effort
2020-01-24 13:42:46 +01:00
Jonas Witschel d613d88dd2 ucode: use microcode found in packed cpio images
Some distributions (Arch, Gentoo) ship prepacked microcode images. These
are cpio images that follow the structure specified in the Linux kernel
documentation (x86/microcode.rst, "Early load microcode"), the same
structure dracut uses for its early microcode images.

In case of Arch Linux, the microcode for Intel CPUs is currently only
available in this packed form, /usr/lib/firmware/intel-ucode does not
exist. This commit adds a way to make use of these images on such
systems by unpacking them to the early cpio directory. (Note that the
packed image cannot be used directly since dracut might need to add ACPI
tables to the early initramfs.)

This approach has the drawback that it is not possible to control the
selection of CPUs to be included in the microcode file in host-only
mode, so we only try it as a last ressort if no unpacked microcode could
be found in fw_dir.

The list of possible file names for the packed microcode image is taken
from GRUB (cf. GRUB_EARLY_INITRD_LINUX_STOCK), but can be adapted by
setting "early_microcode_image_name" (and "early_microcode_image_dir")
in a dracut configuration file.
2020-01-24 09:06:32 +01:00
Harald Hoyer 2ee69a40c8
add missing crypto modules for aarch64
Fixes https://github.com/dracutdevs/dracut/issues/711
2020-01-23 13:47:53 +01:00
Jonathan Lebon d0de58f232 network-legacy/ifup: nuke pid and lease files if dhclient failed
Otherwise we won't retry dhclient again on that interface. In
FCOS/RHCOS, we want to bake in `ip=dhcp,dhcp6` so we automatically try
getting a DHCPv6 lease if DHCPv4 failed.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1793591
2020-01-23 09:32:25 +01:00
Kairui Song f4ad2e5c89 90kernel-modules: don't install any block driver if not needed
If hostonly mode is in use, and there isn't any block device included
as hostonly device, then the initramfs won't need any block driver.

Eg. for kdump built image, there could be only one nfs mount point,
or the initramfs may only execute some network operation then reboot.

In such case, skip block driver installation to save space and time.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-01-17 07:26:24 +01:00
Jan Macku cb86c560b0 Write dns values passed by ip argument to ifcfg-* files 2020-01-14 09:33:38 +01:00
Jan Macku 70b19acf94 Replace ln with systemctl 2020-01-14 09:29:51 +01:00
Jacob Wen d5e818f349 35network-legacy: using 'replace' instead of 'add' to add route
This is a simple trick to honor RFC 3442:
If the DHCP server returns both a Classless Static Routes option and
a Router option, the DHCP client MUST ignore the Router option.

Signed-off-by: Jacob Wen <jian.w.wen@oracle.com>
2020-01-14 09:26:12 +01:00
Kairui Song 4598b5540e 95iscsi: Fix /etc/iscsi installation
Previous all files are installed with inst_dir, which will not install
the files under /etc/iscsi/, and it create folders with the same of the
files which is wrong.

Now only use inst_dir to install the config dir and ensure it
exists, and use inst_multiple to install the config files.

Signed-off-by: Kairui Song <kasong@redhat.com>
2020-01-14 09:25:29 +01:00
Lubomir Rintel 5965710e01 network-manager: don't run NetworkManager when there are no connections
NetworkManager would unnecessarily bring up the devices, colliding with
further attempts to rename the devices.

This is arguably a NetworkManager bug and should eventually be fixed there.
Running NetworkManager without the connection is unnecessary regardless.
2020-01-14 09:24:42 +01:00
Brian C. Lane 05b75703b0 Check .hmac of boot.iso in fips mode
Instead of carrying the kernel and hmac in the install.img (which takes
up more space) use the vmlinuz installed under /images/pxeboot/ and the
.hmac in the install.img /boot.

This check is triggered by the presence of /run/install/repo/images/pxeboot/vmlinuz

Related: rhbz#1782737
2020-01-14 09:23:21 +01:00
Colin Walters 7fea85ce5f modules/network-manager: Install `ip`
We don't need `ip` but having it is *really* useful for people debugging
in an emergency shell.
2020-01-14 09:17:22 +01:00
Lukas Nykryn 2181c80c91 network-legacy/ifup: dhclient should be started in oneshot mode
since we handle the retries explicitly via rd.net.dhcp.retry

Without -1 if user sets ip=dhcp6 and there is no dhcp on the network,
dhclient seems to wait indefinitely, ignoring rd.net.timeout.dhcp
2020-01-14 09:16:48 +01:00
Lukas Nykryn 212043f94d network-legacy/ifup: fix typo when calling dhclient --timeout 2020-01-14 09:16:23 +01:00
Alexey Kodanev 958ca9e912 fips: add 'ofb' and 'cts' block cipher modes
Add cts, Linux-5.0 commit:
* 196ad6043e9f ("crypto: testmgr - mark cts(cbc(aes)) as FIPS allowed")

Linux 4.20 commits for 'ofb':
* dfb89ab3f0a7 ("crypto: tcrypt - add OFB functional tests")
* e497c51896b3 ("crypto: ofb - add output feedback mode")

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
2019-11-29 18:56:56 +01:00
Petr Tesarik 7d47d1c423 95ssh-client: improve nsswitch.conf parser
The actual syntax of nsswitch.conf is slightly different from the
current regular expression:

- A comment can appear anywhere, not just at the beginning of a
  line.
- Action items take the general form [STATUS=ACTION] or
  [!STATUS=ACTION] (with some optional whitespace).
- A service name cannot include a colon. This is a nitpick,
  because there should never be more than a single colon per
  line.

Signed-off-by: Petr Tesarik <ptesarik@suse.com>
2019-11-22 17:54:00 +01:00
Lubomir Rintel ff2043fb42 Revert "travis: run TEST-14-IMSM on Fedora 29"
We're on Fedora 31 that should be good enough for this test.

This reverts commit 7a2503ab8c.
2019-11-13 10:08:32 +01:00
Daniel Molkentin 8996d3dfcd test: use hosts randomness, not rngd 2019-11-13 09:07:45 +01:00
Daniel Molkentin c226bfdda7 test: Provide host's randomness via virtio 2019-11-13 09:07:45 +01:00
Lubomir Rintel 9a752007b3 TEST-30-ISCSI: test iBFT boot as well
Setting up the machinery to boot with the aid of real networked boot loader
(such as iPXE) would involve much hassle, including possibly serving the kernel
and initrd via TFTP, etc.

Let us generate the iBFT table ourselves, with a Perl script. Include the
pregenerated table as well so that the test run won't depend on Perl. In the
end it's just reproducibly built static data, totally independent of the host
system.
2019-11-12 13:27:59 +01:00
Lubomir Rintel 80238086ab git2spec: include contents of binaries in patches
The patches don't include the binary files, such as the iBFT table for testing,
which makes %autosetup sad.
2019-11-12 13:27:59 +01:00
Daniel Molkentin 50057af19c Documentation: dynamically set current version
Fixes #369
2019-11-12 13:24:41 +01:00
Lubomir Rintel e863807685 spec: dracut-network is happy with either NM or dhclient 2019-11-12 13:11:40 +01:00
Lubomir Rintel f3f081e542 TEST-{20,50,60,70): set MACAddressPolicy=keep
New systemd defaults to generating MAC addresses for software devices (whereas
previously they would inherit them from the first enslaved slave).

Sadly, among the things this breaks is our test fixture, where the dhcp servers
are configured to expect a particular MAC address. Disable this for the
affected tests, which are essentially the ones that use bridges and bonds.
2019-11-11 21:17:31 +01:00
Lubomir Rintel c9391e8f6a TEST-{20,30,31,40,50,60,70): wait for server interfaces to come up
The network interfaces appear asynchronously and sometimes just too late,
after we're already halfway throught server-init.sh:

  + ip link set dev eth0 name ens3
  Cannot find device "eth0"
  + ip addr add 192.168.50.1/24 dev ens3
  Cannot find device "ens3"
  + dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases ens3 ens5
  ...
  [    8.040825] e1000 0000:00:03.0 eth0: (PCI:33MHz:32-bit) 52:54:01:12:34:56
  [    8.047105] e1000 0000:00:03.0 eth0: Intel(R) PRO/1000 Network Connection
  ...
  No subnet declaration for ens3 (no IPv4 addresses).
  ** Ignoring requests on ens3.  If this is not what
     you want, please write a subnet declaration
     in your dhcpd.conf file for the network segment
     to which interface ens3 is attached. **

Whoopsie. Let's ensure all the interfaces are there before we proceed
fiddling around with them.
2019-11-11 21:16:47 +01:00
Lubomir Rintel 031e949c62 TEST-50-MULTINIC: fix how a basename is determined
Analogous to what commit 687e17aa7f ("network-manager: fix getting of
ifname from the sysfs path") fixes.
2019-11-11 21:15:52 +01:00
Lubomir Rintel 10f8438c1e logtee: time out after a period of no output
Travis cuts us short after 10 minutes of slience, giving us no chance to puke
out the output. Be faster.
2019-11-11 20:30:45 +01:00
Lubomir Rintel f5d48a31db Revert "travis: run TEST-13-ENC-RAID-LVM on Fedora 29"
We're on Fedora 31 that should be good enough for this test.

This reverts commit 8238f41b34.
2019-11-11 20:04:58 +01:00
Lubomir Rintel fe54c9b7a9 TEST-13-ENC-RAID-LVM: increase memory
In Fedora 31 it ooms until it has, uh, twice the memory.
2019-11-11 20:04:58 +01:00
Doan Tran Cong Danh 41a37bc626 dmraid: require kpartx binary
dmraid requires kpartx to activate device mapper.
But kpartx is only a recommend dependency.

Check for kpartx's existent first.

Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>
2019-11-10 01:47:30 +01:00
Doan Tran Cong Danh cf31ed2ae6 multipath: require kpartx binary
multipath requires kpartx to activate device mapper.
But kpartx is only a recommend dependency.

Check for kpartx's existent first.

Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>
2019-11-10 01:47:30 +01:00
Doan Tran Cong Danh 62f27ee6f1 configure: find cflags and libs for fts on musl
Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>
2019-11-10 01:47:30 +01:00
Mikhail Novosyolov 718aefda13 Ensure that udevadm --version reported an integer
If it is not an integer, further script will fail unexepectedly.
2019-11-05 14:26:14 +01:00
Mikhail Novosyolov 6e761674ad Fail if udevadm could not be run
Fixes: #668
2019-11-05 14:26:14 +01:00
Lubomir Rintel 687e17aa7f network-manager: fix getting of ifname from the sysfs path
commit 5e0f8c8a4c ('network-manager: remove useless use of basename')
somewhat carelessly didn't take into account that $_i has a slash at
the end which made the result of the ## substitution be just an empty
string.

The slash was put to the end of /sys/class/net/*/ to make sure we're only
iterating directories, but it's not strictly necessary. In an unlikely case
something else than a directory appears in /sys/class/net/, we'll already deal
with it gracefully. Remove it.

This fixes the TEST-30-ISCSI test.
2019-11-05 14:18:01 +01:00
Thomas Blume 3f4bbca751 keep network device naming scheme on upgrade 2019-11-05 11:37:22 +01:00
Jonathan Lebon cc6792a01e 01fips: trim off GRUB boot device from BOOT_IMAGE
E.g. in RHCOS, the `BOOT_IMAGE` from the cmdline is:

(hd0,gpt1)/ostree/rhcos-e493371e5ee8407889029ec979955a2b86fd7e3cae5a0591b9db1cd248d966e8/vmlinuz-4.18.0-146.el8.x86_64

Which of course is a GRUB thing, not an actual pathname we'll be able to
resolve. In fact, we can simply scrap it off from the variable. Our code
is already able to handle both cases: whether the device refers to a
separate boot partition, or just the root filesystem with a regular
`/boot` directory.
2019-10-31 11:12:36 +01:00
Jonathan Lebon ca4aa84851 01fips: add / in BOOT_IMAGE_HMAC filename for clarity
It's already the case the `BOOT_IMAGE_PATH` today, in the non-empty
case, includes a trailing `/`, but let's add it to the path we build
here too to make it more obvious.
2019-10-31 11:12:36 +01:00
Jonathan Lebon ba813779bf 01fips: run sha512hmac from directory HMAC file directory
That way, the HMAC file can contain a relative path instead of an
absolute one. The issue is that right now the kernel RPM bakes the
`/boot/vmlinuz-${kver}` path into the HMAC file which poses an issue for
rpm-ostree systems (and any other system where the kernel isn't simply
in the top-level `/boot`.

For now, we're hacking around this in rpm-ostree:
https://github.com/coreos/rpm-ostree/pull/1934

Though I'd like to propose the same change in the kernel spec file.
2019-10-31 11:12:36 +01:00
Jonathan Lebon 9e759aa969 01fips: fix HMAC file path resolution
There is a small regression in #343: when handling the 'separate boot
partition' case, we're checking for the kernel image in the wrong
location: `BOOT_IMAGE` is the `/boot`-relative path to the kernel image,
so `/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE}` expands to e.g.
`/boot/mysubdir1/mysubdir2/mysubdir1/mysubdir2/vmlinuz...`.

We should be using `BOOT_IMAGE_NAME` here instead (and in fact, the next
if-statement does this correctly, so it might've just been accidentally
left out of #343).
2019-10-31 11:12:36 +01:00
Harald Hoyer 27f758e12c
iscsi: remove bashisms 2019-10-25 14:29:17 +02:00
Böszörményi Zoltán 4efcd19a4e Add documentation and Yocto examples
Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
2019-10-25 11:58:58 +02:00
Böszörményi Zoltán 0595a79b19 Fix version reported by dracut --help
Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
2019-10-25 11:58:58 +02:00
Böszörményi Zoltán 9d88e89350 Set systemdutildir correctly
Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
2019-10-25 11:58:58 +02:00
Böszörményi Zoltán b552d364a3 Handle -r / --sysroot option in dracut.sh
It was documented but not implemented.

Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
2019-10-25 11:58:58 +02:00
Böszörményi Zoltán a01204202b Allow running on a cross-compiled rootfs
For the shell scripts, new environment variables were introduced.

dracutsysrootdir is the root directory, file existence checks use it.

DRACUT_LDCONFIG can override ldconfig with a different one that works
on the sysroot with foreign binaries.

DRACUT_LDD can override ldd with a different one that works
with foreign binaries.

DRACUT_TESTBIN can override /bin/sh. A cross-compiled sysroot
may use symlinks that are valid only when running on the target
so a real file must be provided that exist in the sysroot.

DRACUT_INSTALL now supports debugging dracut-install in itself
when run by dracut but without debugging the dracut scripts.
E.g. DRACUT_INSTALL="valgrind dracut-install or
DRACUT_INSTALL="dracut-install --debug".

DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_LBZIP2, DRACUT_COMPRESS_LZMA,
DRACUT_COMPRESS_XZ, DRACUT_COMPRESS_GZIP, DRACUT_COMPRESS_PIGZ,
DRACUT_COMPRESS_LZOP, DRACUT_COMPRESS_ZSTD, DRACUT_COMPRESS_LZ4,
DRACUT_COMPRESS_CAT: All of the compression utilities may be
overridden, to support the native binaries in non-standard places.

DRACUT_ARCH overrides "uname -m".

SYSTEMD_VERSION overrides "systemd --version".

The dracut-install utility was overhauled to support sysroot via
a new option -r and fixes for clang-analyze. It supports
cross-compiler-ldd from
https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f

DRACUT_INSTALL_PATH was introduced so dracut-install can work with
a different PATH. In a cross-compiled environment (e.g. Yocto), PATH
points to natively built binaries that are not in the host's /bin,
/usr/bin, etc. dracut-install still needs plain /bin and /usr/bin
that are relative to the cross-compiled sysroot.

The hashmap pool allocate_tile/deallocate_tile code was removed
because clang-analyze showed errors in it. hashmap_copy was removed
because it wasn't used and clang-analyze showed errors in it.

DRACUT_INSTALL_LOG_TARGET and DRACUT_INSTALL_LOG_LEVEL were
introduced so dracut-install can use different settings from
DRACUT_LOG_TARGET and DRACUT_LOG_LEVEL.

Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
2019-10-25 11:58:58 +02:00
Kairui Song 89bc1aa324 Fine tune mksquashfs options for squash module
Drop some unneeded metadata in the squash image, and print the error
message if something went wrong.

Signed-off-by: Kairui Song <kasong@redhat.com>
2019-10-25 11:52:05 +02:00
Jiri Konecny 0d609ae274 Support only fips=1 not fips
It looks like only the 'fips=1' is really supported and it is working
correctly. So instead of failing on 'fips' not clear way give user
information why we are failing.
2019-10-25 11:47:04 +02:00
Jiri Konecny 7ff0fcb723 Fix boot with `fips` without a value
If you boot system with `fips` and not `fips=1` then you will get unary
operator expected error. This will fix this problem.
2019-10-25 11:47:04 +02:00
Daniel Molkentin feebf17187 ucode: properly include early only ucode
Intel has notified us that some microcode updates are not safe
to be applied during runtime. To accomodate for that, microcode
files shipped by SUSE and openSUSE have an '.early' postfix such
that triggering

/sys/devices/system/cpu/microcode/reload

from a booted system cannot pick up the ucode by accident, while
still allowing the code to be picked up during initrd time.

This change is needed to make this scheme work also in a hostonly
situation.

Currently, this affects only 06-4f-01, which is now 06-4f-01.early.

If a distro does not change the filename, the behavior does not
change.

Reference: osc#1098915
2019-10-25 11:39:16 +02:00
Daniel Molkentin e3edd247ce 95iscsi: handle qedi like bnx2i
The new qedi driver needs to be handled just like
the bnx2i driver, so update 95iscsi scripts to do this.

References: bsc#1113712

Signed-off-by: Lee Duncan <lduncan@suse.com>
2019-10-25 11:38:17 +02:00
Nathan Rini 916ac45cbe swap for loop to POSIX shell compat 2019-10-25 11:37:43 +02:00
Nathan Rini 0bac59ee5e typo bugfix 2019-10-25 11:37:43 +02:00
Nathan Rini fb3d292800 fix off by one 2019-10-25 11:37:43 +02:00
Nathan Rini 1b38fa412c bugfix for initialization
exit with error if all retries fail
2019-10-25 11:37:43 +02:00
Nathan Rini 66bfa66add add sleep and max number of retries 2019-10-25 11:37:43 +02:00
Nathan Rini 678627f349 retry image download forever 2019-10-25 11:37:43 +02:00
Frederick Grose 3c8c807db1 iso-scan: Release resources on iso-scan boots with rd.live.ram
Unmounting the image iso, detaching its loop device, and unmounting
its parent partition can simplify installation to the parent disk.

Note that programs or scripts using the /run/initramfs/live mount
point will fail.
2019-10-25 11:35:15 +02:00
Martin Wilck 78efd6988e iscsi: fix error messages with iSCSI root
Fixes these error messages during intird build:

cat: '/sys/devices/platform/host2/flashnode_sess-*/is_boot_target': No such file or directory
/usr/lib/dracut/modules.d/95iscsi/module-setup.sh: line 91: [: -eq: unary operator expected
cat: '/sys/devices/platform/host3/flashnode_sess-*/is_boot_target': No such file or directory
/usr/lib/dracut/modules.d/95iscsi/module-setup.sh: line 91: [: -eq: unary operator expected
2019-10-25 11:34:24 +02:00
Norbert Lange 1aa2d1eddf fix check whether the rootfs init is usable
this now correctly handles:
-   plain files
-   relative symlinks
-   absolute symlinks
2019-10-25 11:30:43 +02:00
tpgxyz 519186e9e6 add mksh support 2019-10-25 11:29:30 +02:00
Harald Hoyer 64082786b2
dracut.spec: add 90ppcmac 2019-10-25 09:23:30 +02:00
q66 159175d525 modules.d: add a module for early fan control on PowerPC Macs
The goal of this module is to enable automatic loading of the
thermal/fan control modules on PowerPC based Macs, as on some
modular kernel configurations this will not happen automatically
which will result in the fans spinning up to 100% until they are
manually loaded.

This is especially a problem in live systems where it takes some
time to boot up and the spin-up happens before the system even
leaves initramfs.
2019-10-25 09:20:04 +02:00
Martin Wilck 9b9dd9993e 35network-legacy: only skip waiting for interfaces if netroot is set
Commmit 8a33e52e2f94 assumes that dracut's work is done if a root device
is found. This holds usually for booting computers, but it may be wrong
for other environments.

Only short-cut the waiting if $netroot is also set.

Fixes: 8a33e52e2f94 ("network: stop waiting for interfaces if root device is present")
References: bsc#1152006
2019-10-25 09:18:12 +02:00
Martin Wilck c0e5e48aab fixup "Dracut: only login to one target at a time"
On SLE15-SP1 at least, iscsiadm doesn't support combining --op and --login":

> # iscsiadm -m node -T iqn.2018-06.de.suse.zeus:01 --op=update  --name=node.startup --value=onboot --login
> iscsiadm: Invalid parameters. Login/logout and op passed in

This breaks iSCSI login in initrd, and thus, iSCSI boot.

Fix it by not coalescing everything into a single iscsiadm command.
Fixes: a59b776bc215 ("Dracut: only login to one target at a time")
References: bsc#1152650
2019-10-25 09:18:12 +02:00
Martin Wilck 28749d9973 iscsiroot: remove bashisms
According to the dracut README, module code to be run in
the initrd must be POSIX-compliant. Replace remaining
bashisms (as reported by checkbashisms) with POSIX compliant
code.

The use of "type" is not strictly POSIX compliant, but it's
all over the place in dracut code. dash supports it, anyway.
2019-10-25 09:18:12 +02:00
Martin Wilck ac7582af48 iscsiroot: try targets only once
In multipath scenarios, "iscsiadm -m node" may contain
several records with the same target.
There's no point in trying "iscsiadm --login" multiple
time for the same target, through the same portal.

Moreover, warn if the desired target is not on the node
list.
2019-10-25 09:18:12 +02:00
Martin Wilck 0d5597044f iscsiroot: there's never more than one target per call
iscsi_target_name is set by iscsi_root, and thus can't have
more than one member. This allows us to get rid of one bashism
in iscsiroot.sh.
2019-10-25 09:18:12 +02:00
Martin Wilck 5fbe772b44 iscsiroot: parse_iscsi_root overwrites command line args
iscsi_target_name, iscsi_target_ip, iscsi_target_port are
unconditionally overwritten by parse_iscsi_root. Don't set
them here, for code clarity.
2019-10-25 09:18:12 +02:00
Martin Wilck 906896e220 network: stop waiting for interfaces if root device is present 2019-10-25 09:18:12 +02:00
Martin Wilck f551886f5c iscsi: don't continue waiting if the root device is present
dracut waits for every iscsiroot connection to be established
before switching root. This is not necessary in multipath scenarios,
where a single path is usually sufficient to set up the root device,
and where users expect booting to succeed unless all paths are down.

Don't wait for the iscsi portal to start if the root device has
already been found.
2019-10-25 09:18:12 +02:00
Lee Duncan 1ab6778ee4 Dracut: only login to one target at a time
For handling the configuration where there are two
paths to an iscsi root target, each using a different
NIC. In such a case, the initramfs was trying to configure
the first NIC, then call iscsiroot to login to both targets,
which would fail for the 2nd target, since the path to the
2nd target was not yet configured. This would eventually
work after a timeout. But it's better to login to just
one target at a time.
This change makes the initramfs handle multiple paths to an
iscsi target better by logging into only one target at a time,
rather than trying to login to all targets when only one of
several NICs is up.

This can be further optimized by using the initrd parameter
"rd.iscsi.testroute", which would skip iscsiadm login attempts
for targets to which no route exists.

If the script is called again via the timeout initqueue,
we try "iscsiadm -L onboot" again, hoping that some targets
may now have become reachable.
2019-10-25 09:18:12 +02:00
jbash aka John Bashinski 7f0b48627a
Documentation: add systemd warning for rd.luks.key, clean up related text
Harald Hoyer <harald@redhat.com>: Squashed commit of the following:

commit 4b5e5da6061983964a85d1671bd1c97c48ee76f1
Author: jbash aka John Bashinski <jbash@velvet.com>
Date:   Thu Aug 1 13:21:35 2019 -0400

    Documentation: add systemd warning for rd.luks.key, clean up related text
2019-10-23 14:48:04 +02:00
Kairui Song 5d88809319 99squash: Only start the cleaner on switch-root
Currently it starts the cleaner early and do the clean up job if switch
root is called. It's better to just start the service only on switch
root to avoid any risk of service dependency failure and make is
simpler.

Signed-off-by: Kairui Song <kasong@redhat.com>
2019-10-23 14:40:24 +02:00
gaoyi da36b76ab0 dracut: check_vol_slaves_all must return 1 when lvm vgs failed
reason:when filter/global_filter is set in lvm.conf, lvm vgs may be
failed

Signed-off-by: gaoyi <ymuemc@163.com>
2019-10-23 14:38:11 +02:00
Kairui Song a69e6c4eae Only generate hostonly-kernel-modules list in strict mode
Fixes #617.
2019-10-23 14:33:36 +02:00
Lukas Nykryn daa49cc221 net-lib: check if addr exists before checking for dad state
Before we check if dad is done we should first make sure,
that there is a link local address where we do the check.

Due to this issue, on ipv6 only setups sometimes dhclient started
asking for ip address, before the link local address was present
and failed immediately.
2019-10-23 10:44:26 +02:00
Daniel Molkentin 224175d8bc dracut-functions.sh: remove declared unused variables 2019-10-22 13:50:36 +02:00
Daniel Molkentin b4769b332d dracut-init.sh: remove obsolete for_each_kmod_dep() 2019-10-22 13:50:36 +02:00
Colin Walters 72ae1c4fe7 99base: Rework `/etc/initrd-release` to derive from real os-release
I'd like to rework CoreOS Ignition (which runs in the initramfs)
to include some values from the *real* `/etc/os-release` in
HTTP headers.

Looking at this, it turns out dracut eats almost all of the useful
information from it.  I don't think `dracut` should be the `ID`
here...dracut's not an OS itself, it's a way to *build* little
operating systems.  It'd be kind of like if Fedora's Koji
injected itself into `/etc/os-release`.

This code dates back a long time; not sure of all the rationale
behind it.

I changed it so that we keep extending the VERSION/PRETTY_NAME
with the dracut version, but otherwise "pass through" the
rest of the real `/etc/os-release` we were built from unchanged.
2019-10-22 13:49:03 +02:00
Daniel Molkentin 8e9b094b21 99base: Do not hardcode ANSI_COLOR
Take it from /etc/os-release instead, as distributions
usually customize this setting, but keep it as default value.
2019-10-22 13:49:03 +02:00
Daniel Molkentin 8a063c50a3 01systemd-initrd: remove redundant code from 99base 2019-10-22 13:49:03 +02:00
Böszörményi Zoltán c9b3c89f94 Make TEST-16-DMSQUASH Python 3 compatible
This change still supports Python 2.6 and 2.7 but loses support
for Python 2.5.

The reason for this change was that Fedora 30 does not ship
python-imgcreate but ships python3-imgcreate.

Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
2019-10-22 12:42:10 +02:00
Harald Hoyer 1fcc70fe57
Merge branch 'nolange-fix_ipv2_for_busybox' 2019-10-21 14:43:44 +02:00
Harald Hoyer 5e7ef0ab3d
Merge branch 'fix_ipv2_for_busybox' of https://github.com/nolange/dracut into nolange-fix_ipv2_for_busybox 2019-10-21 14:41:12 +02:00
Marko Myllynen 42d93d3482 Use eurlatgr as default console font
Fedora and others have used eurlatgr as the default console font
for some time now, or suggested using it:

https://fedoraproject.org/wiki/Changes/NewDefaultConsoleFont
https://wiki.archlinux.org/index.php/Linux_console#Fonts

The Fedora Change page lists some of the benefits and this file
lists all the characters (glyphs) supported by the font:

http://git.altlinux.org/people/legion/packages/kbd.git?p=kbd.git;a=blob;f=data/consolefonts/README.eurlatgr

The notable downside is that the font does not support Arabic,
Cyrillic or Hebrew as LatArCyrHeb-16 (partially) does, so in cases
where support for languages using them is needed a non-default
console font should be used. Fedora, for instance, uses langtable
to decide the console font to use based on installation language:

https://bugzilla.redhat.com/show_bug.cgi?id=1209460
2019-10-21 13:07:07 +02:00
Harald Hoyer 22c8a5c73f
Do not sort the resulting /run/initramfs/state/etc/resolv.conf
nameserver priorities should be preserved

Resolves: https://github.com/dracutdevs/dracut/issues/652
2019-10-21 11:50:20 +02:00
Colin Walters ce0344d325 Move README to README.md
The `README.md` was nearly empty.  Move the travis bits into
`README`, then rename `README` to `README.md`.

This matches the Github standard.  A major compelling feature
of Github is how prominently it displays a project's `README.md`,
so let's ensure ours has content.
2019-10-19 15:16:50 +02:00
Frantisek Sumsal 920048ff50 travis: switch to Bionic 2019-09-25 12:19:00 +02:00
Lubomir Rintel 31e18286fc test: fix preserving server.log with V=1
This is essentially equivalent to what commit 712f471ebf
('test/test-functions: correctly move server.log') does for V=2.
2019-09-15 17:54:08 +00:00
logan 4a8ad28808 added additional useful filesystem tools 2019-09-15 17:51:06 +00:00
Benjamin Marzinski 9dd9329f7a modules.d: fix udev rules detection of multipath devices
Starting with the 0.7.7 release of the multipath tools, the multipath
udev rules always set a value in ENV{DM_MULTIPATH_DEVICE_PATH} for any
device that multipath scans. A value of 0 means that the device is not
claimed by multipath, and a value of 1 means that it is. Because of
this, udev rules that check ENV{DM_MULTIPATH_DEVICE_PATH}=="?*" will
always return True, and act as if every scanned device is claimed by
multipath. Checking ENV{DM_MULTIPATH_DEVICE_PATH}=="1" will work
correctly for both the old and new versions of the multipath tools.
2019-09-04 13:43:20 +02:00
Jonas Witschel 3436067663 rootfs-block: suppress spurious printing of rootflags
getarg prints the value so it inadvertently shows up in the dracut
output.
2019-09-03 16:49:05 +02:00
Jonas Witschel f39aa529c5 crypt: create locking directory /run/cryptsetup
For LUKS2 partitions cryptsetup needs a locking directory. If it does
not exist, cryptsetup will create it, but produce a warning

WARNING: Locking directory /run/cryptsetup is missing!

in the process that we do not want to see in the dracut output.
2019-09-03 16:49:05 +02:00
Jonas Witschel 0a01086456 dracut.sh: suppress "ignored null byte in input" warning
Since Bash 4.4, command substitutions containing null bytes produce a
warning of the form

/usr/sbin/dracut: line 1958: warning: command substitution: ignored null byte in input

Remove the trailing null byte from the UEFI kernel command line file
before printing it to suppress this warning.
2019-09-03 11:28:56 +00:00
Ondrej Dubaj 707d4e79fe added debug-shell to initrd in systemd version >= 240 2019-08-29 15:06:59 +00:00
Renaud Métrich 7a3d661971 Print an error if included item ('-i' option) doesn't exist or is neither a directory nor a regular file
Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
2019-08-29 13:46:34 +00:00
Tomasz Paweł Gajc 04ff0a1bae Check /usr/sbin for fsck programs 2019-08-29 13:25:57 +00:00
Lubomir Rintel 4d573e3be0 dracut.spec: fix build on openSUSE
When testing the previous commit on openSUSE it turned out that it
didn't really work in the first place, without a few tweaks.
2019-08-29 13:16:00 +00:00
Lubomir Rintel 4e2cc49d75 dracut.spec: fix build with %fedora, %rhel and %suse_version undefined
The RPM build failed on due to missing and unpackaged files on my Fedora
machine that happened to have %fedora set to %nil for reasons long
forgotten.

This is probably not a likely scenario, but some of the conditions in the
SPEC file are still wrong and perhaps worth fixing.
2019-08-29 13:16:00 +00:00
Lukas Nykryn 8084f3f66d net-lib: fix typo $li -> $_li 2019-08-29 12:41:11 +02:00
Petr Vorel cd181d2c4c doc: Fix integrity key name
Default value of EVMKEYDESC (in evm-enable.sh) is "evm-key" and it's
also specified previously in this README file.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
2019-08-29 10:21:22 +00:00
Frantisek Sumsal ead8729b44 man: fix several typos 2019-08-28 10:40:33 +02:00
Zbigniew Jędrzejewski-Szmek b1c5cae63f 50-dracut: synchronize option reading code with 51-dracut.install
initrd= option should also be dropped here. There is not reason
for the code to be different in the two places.
2019-08-27 18:33:13 +02:00
Zbigniew Jędrzejewski-Szmek 38b4f4b21c Do not require non-empty kernel cmdline
When booting with Fedora-Server-dvd-x86_64-30-20190411.n.0.iso,
/proc/cmdline is empty (libvirt, qemu host with bios, not sure if that
matters), after installation to disk, anaconda would "crash" in kernel-core
%posttrans, after calling kernel-install, because dracut would fail
with
> Could not determine the kernel command line parameters.
> Please specify the kernel command line in /etc/kernel/cmdline!

I guess it's legitimate, even if unusual, to have no cmdline parameters.
Two changes are done in this patch:
1. do not fail if the cmdline is empty.
2. if /usr/lib/kernel/cmdline or /etc/kernel/cmdline are present, but
   empty, ignore /proc/cmdline. If there's explicit configuration to
   have empty cmdline, don't ignore it.
2019-08-27 18:33:13 +02:00
Takashi Iwai f4e38c0da8 dracut-init.sh: Nuke unused install_kmod_with_fw function
Kill the no longer used function, so that anyone won't be confused and
try to modify this function in future.

BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1146769
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-08-26 14:57:37 +02:00
Takashi Iwai 999cfa8458 dracut-install: Support the compressed firmware files correctly
The compressed firmware support was supposed to be already
implemented, but it didn't work as expected in the end, because dracut
moved to use dracut-install binary.  This patch adds the support of
XZ-compressed firmware installation to dracut-install for fixing the
missing piece.

At best the firmware files should be uncompressed in initrd, but this
patch simply copies the compressed file as-is, as a quick workaround.

BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1146769
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-08-26 14:57:37 +02:00
Zbigniew Jędrzejewski-Szmek b91d3f15bf shutdown: fix shutdown with console=null
C.f. https://github.com/systemd/systemd/issues/13332.
2019-08-22 16:47:32 +02:00
Frantisek Sumsal 5b2258ea0d travis: fetch only tags
The original `git pull` would try to pull & merge changes from the
master branch, which breaks CI runs on PRs based on non-master branches
2019-08-22 11:15:13 +02:00
Frantisek Sumsal 44fb598605 git2spec: avoid malforming of SHA-1 hashes
When a SHA-1 hash of a specific commit is used as a tag, the regex
shenanigans later in the script can (and will) corrupt it in certain
cases.

e.g.:
$ perl -e '
$tag="6e8cd92261577230daa1098f7e05ec198c3c4281";
$tag=~s/[^0-9]+?([0-9]+)/$1/;
print("$tag\n");
'
68cd92261577230daa1098f7e05ec198c3c4281

(Notice the missing 'e')

Let's fix this by limiting the regex's scope to a non-SHA-1 tags only.
2019-08-22 11:15:13 +02:00
Kairui Song 6a74c03b4a dracut.sh: Adjust squash and strip order
Previously with squash module, some binaries will be reinstalled, but
stripping happens before that so new installed binaries is not stripped.
So adjust the squash and strip order, ensure new installed binaries are
stripped just the same way with the old binaries.

Also split squash into two stage to make the split easier, move the
squash temp dir into initdir so stripping will cover that too,
and print more usefule message.

Signed-off-by: Kairui Song <kasong@redhat.com>
2019-08-09 13:11:47 +02:00
Lukas Nykryn d1afff43ae 90kernel-modules-extra: don't resolve symlinks before instmod
When you install a third-party driver, you will probably end in a
situation, where the module will be in a different directory and
in $depmod_module_dir you will only have symlink. If we resolve the
symlink before we pass the module path to instmod, the dracut-install
will only include the module with its original path, but not the
symlink. Hence the module can't be automatically loaded.

Dracut-install is clever enough to handle symlinks and will include both
the symlink and the module to the initrd.
2019-08-02 14:39:09 +02:00
Harald Hoyer 23acf15227
README.md: comment out travis CI 2019-07-22 14:39:42 +02:00
Harald Hoyer b355c7a532
Makefile: fix VERSION 2019-07-22 14:36:23 +02:00
Harald Hoyer 960d8726db
dracut.spec: add 06rngd 2019-07-22 14:07:26 +02:00
Paul Robins ce4d04bf72 Include systemd volatile root service and binary 2019-07-22 14:05:48 +02:00
Daniel Molkentin b6b1bf9202 Consollidate the qemu virtualization detection
Eventually, we could add a full virt detection routine.
This would be useful e.g. to determine inclusion of
ucode for hostonly setups.
2019-07-19 16:26:42 +02:00
Lukas Nykryn b988934a38 fips: split loading the crypto modules and checking the kernel
In e54ab383 we moved the fips script to a later pahse of boot, since
the /boot might not be available early on.

The problem is that systemd-cryptsetup* services could be run now
started before the do_fips is executed and need the crypto modules
to decrypted the devices.

So let's split the do_fips and load the module before udev does the
trigger.
2019-07-19 16:26:05 +02:00
Lukas Nykryn b2616b5268 net-lib: strstr is not for globs 2019-07-19 16:25:33 +02:00
Jonas Witschel 12f023ab03 Replace $(arch) by $(uname -m) 2019-07-19 16:25:03 +02:00
Arnaud Rebillout c30070c8f5 99base: Don't let vinfo return 1
When DRACUT_SYSTEMD is set and DRACUT_QUIET=yes, vinfo returns 1. This
is a problem for hooks which end with vinfo, as then the hook returns 1.
Especially problematic if this is a shutdown hook, as it will be
restarted again and again.

This commit fixes that.

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2019-07-19 16:24:20 +02:00
Дамјан Георгиевски c8b35bf96a move setting the "systemdutildir" variable before it's used
on line 1086 it's used to check for the uefi_stub:
"${systemdutildir}/boot/efi/linux${EFI_MACHINE_TYPE_NAME}.efi.stub"

so it needs to be defined before that
2019-07-19 16:23:57 +02:00
Jonas Witschel 305c6f91bb dracut.sh: fix EFI directory if ESP is mounted to /efi
The EFI executables produced by dracut --uefi must be placed in the
subdirectory /EFI/Linux of the EFI system partition (ESP) according to
the Boot Loader Specification, see
https://systemd.io/BOOT_LOADER_SPECIFICATION#logic

This is done correctly for the mount points /boot and /boot/efi, but for
the mount point /efi, the files are placed in /efi/Linux instead of the
correct /efi/EFI/Linux. This commit fixes the directory so that the EFI
executables are picked up correctly by conforming boot loaders.

Apart from complying to the specification, the change is also in line
with the commit message of 5c57209ba5
("dracut.sh: add default path for --uefi") which introduced this feature
as well as the documentation in dracut.8.asc.
2019-07-19 16:23:24 +02:00
Lubomir Rintel 393fb1ac05 test/MULTINIC: correctly note activated devices when using network-manager
The .did-setup files are not there. What is there is the NetworkManager
connection files.
2019-07-19 16:21:56 +02:00
Lubomir Rintel 9dfd73bcbd test/BONDBRIDGETEAMVLAN: don't assert against ifcfg files
The network-manager module writes keyfiles instead of ifcfg files. Just
check whether the configuration got actually applied correctly.
2019-07-19 16:21:56 +02:00
Lubomir Rintel 2b1b3bcdcb test/IFCFG: make sure the network-legacy plugin is being used
If the network-manager plugin is used instead, it wouldn't write out
ifcfg files and we wouldn't have anything to check.

While at that, also enable the test.
2019-07-19 16:21:56 +02:00
Lubomir Rintel 70787ab619 test: copy BONDBRIDGETEAMVLAN to IFCFG
The IFCFG test will make sure the network-legacy plugin keeps writing
out correct ifcfg files.

This is a separate commit so that actual changes are visible in the
following one.
2019-07-19 16:21:56 +02:00
Lubomir Rintel 35efada5ec network: parse root=dhcp also with network-manager module
Move the logic from network-legacy to common network code.
2019-07-19 16:21:13 +02:00
Lubomir Rintel 381ab6b7cd network-manager: generate configuration with netroot=
If the root is on network, let nm-initrd-generator create configuration
even if none was explicitly specified on the command line.

Also do the same if /tmp/net.ifaces exists, because the anaconda plugin
creates an empty file in that location in hopes that will make us
configure the network.
2019-07-19 16:21:13 +02:00
Lubomir Rintel 4be95b67a7 network-manager: also read out next-server from NM state 2019-07-19 16:21:13 +02:00
Lubomir Rintel 5e0f8c8a4c network-manager: remove useless use of basename 2019-07-19 16:21:13 +02:00
Lubomir Rintel e318ba30fb test/{10,12,13,14,17,30,31}: increase the disk sizes
On Fedora 30 the paritition sizes turn out to be too small again:

  + mkdir -p /sysroot
  + mount /dev/dracut/root /sysroot
  + cp -a -t /sysroot /source/bin /source/dev /source/etc /source/lib /source/lib64 /source/proc /source/root /source/sbin /source/sys /source/tmp /source/usr /source/var
  cp: error writing '/sysroot/usr/lib64/libkrb5.so.3.3': No space left on device
  cp: error writing '/sysroot/usr/lib64/libkrb5support.so.0.1': No space left on device

It turns out that there has been quite some size increase in some libraries,
notably glibc, though not all -- some even shrunk, ruling out a toolchain
problem. Here's are files over 1M we install on Fedora 30:

   f29    f30
  2.7M => 6.4M /usr/lib64/{libc-2.28.so => libc-2.29.so}
  3.1M => 6.0M /usr/lib64/libcrypto.so.1.1.1c
  2.0M => 3.5M /usr/lib64/{libm-2.28.so => libm-2.29.so}
  2.9M => 2.8M /usr/lib/systemd/{libsystemd-shared-239.so => libsystemd-shared-241.so}
  1.7M => 2.5M /usr/lib64/libunistring.so.2.1.0
  2.3M => 2.4M /usr/lib64/bind9-export/libdns-export.so.1105.0.0
  1.2M => 2.1M /usr/bin/bash
  1.1M => 1.4M /usr/lib64/libkrb5.so.3.3
  1.2M => 1.4M /usr/lib64/libgcrypt.so.20.2.4
  612K => 1.1M /usr/lib64/libssl.so.1.1.1c

This increases the image sizes to accomodate for this. There's probably
little else we can do.
2019-07-19 16:19:44 +02:00
Kairui Song d9721f20d8 95fcoe: load 'libfcoe' module as a fallback
The kernel may only enable 'libfcoe' module. Some modules like bnx2fc
provides FCoE but only depend on 'libfcoe'. Loading 'fcoe' module may
fail but the kernel do support FCoE.

'libfcoe' will be installed as a dependency when installing block device
drivers if it's required. So no need to install it in installkernel.

Signed-off-by: Kairui Song <kasong@redhat.com>
2019-07-19 16:19:07 +02:00
Takashi Iwai 3e53195bce dracut-install: Add support for compressed kernel modules
When a module is compressed, uncompress it before packing into initrd.
Since initrd is already compressed, it makes no sense to put the
compressed module files.

The patch contains a slight refactoring and adds a helper function to
get the command for uncompressing a file per extension.
2019-07-19 16:17:35 +02:00
Frank Deng 11e1f68065 35network-legacy: fix classless static route parsing 2019-07-19 16:16:26 +02:00
Lubomir Rintel c21c1d459e TEST-70-BONDBRIDGETEAMVLAN: get rid of duplicate makefile 2019-07-19 16:13:46 +02:00
Lubomir Rintel 43c8c4ce04 fs-lib: drop a bashism
Bash 5 apparently longer propagates variable assignments to local variables
in front of function calls when in POSIX mode:

  [lkundrak@demiurge ~]$ cat feh.sh
  print_VAR () {
          echo "$VAR";
  }

  testfunc () {
          local VAR="OLD"
          VAR=NEW print_VAR
  }

  testfunc
  [lkundrak@demiurge ~]$ bash4 --posix feh.sh
  NEW
  [lkundrak@demiurge ~]$ bash5 --posix feh.sh
  OLD
  [lkundrak@demiurge ~]$ bash5 feh.sh
  NEW
  [lkundrak@demiurge ~]$

It works the way it did in Bash 4 in non-POSIX mode, for external programs,
or for non-local variables. Don't ask me why -- it's probably some
compatibility thing for some sad old people.

However, this precisely happens when fsck_single() is calling into the
fsck_drv_com(), assigned to _drv by fsck_able(). That ruins the
TEST-70-BONDBRIDGETEAMVLAN test's server and probably more.

Let's pass the fsck driver binary via the function argument instead. It's
less messy anyway.
2019-07-19 16:13:22 +02:00
Kairui Song 7b76fa924d 95iscsi: Fix network setup code for iscsi
- The network script and config could be in
  "/etc/sysconfig/network-scripts", so try look for network config in
  all possible path.

- The regex used for sed is not working, so fix it too.

- Make bootproto a local variable

Signed-off-by: Kairui Song <kasong@redhat.com>
2019-07-19 16:12:47 +02:00
Lubomir Rintel 7934c6f918 test: tell systemd to reboot on fatal errors
Otherwise systemd would freeze execution, causing the test to time out
instead of failing fast.
2019-07-19 16:10:54 +02:00
Lubomir Rintel c27ed38bb2 test/TEST-14-IMSM: detect failure to compose the test setup root
The dracut-root-block-created line should not be created if we fail to copy
in the required files to sysroot. Let's turn on -e to trap failures and
poweroff on them, like some other tests do.

Also remove the &&. Not only it is unnecessary with -e, but defeats it.
From bash(1):

  The shell does not exit if the command that fails is [...] part of any
  command executed in a && or || list except the command following the
  final && or || [...]
2019-07-19 16:10:15 +02:00
Max Resch 5a962b5939 add support for creating secureboot signed UEFI images 2019-07-19 16:09:41 +02:00
Max Resch 705eb4eeb2 ask for a password on readkey failure
continue asking for a password if readkey for cryptsetup input failed,
e.g. wrong password in the password file
2019-07-19 16:09:01 +02:00
Max Resch cbf3200885 lsinitrd handle UEFI created with dracut --uefi 2019-07-19 16:08:28 +02:00
Renaud Métrich adee5b97bc rngd: new module running early during boot to help generating entropy
when system's default entropy sources are poor (e.g. use of SSD disks or
UEFI RNG not available)

On systems with low entropy at boot, the boot can take up to several
hours, specially when NBDE is used (e.g. clevis) which makes use of
the random number generator.

Enabling rngd service at boot early, because dracut-initqueue runs,
enables to initialize the random number generator in a couple of seconds
instead of minutes or hours.

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
2019-07-19 16:05:45 +02:00
Michal Koutný 42e004feb9 debug: Add dd into debug module
When at it also deduplicate the list of installed utilities.
2019-07-19 16:02:47 +02:00
Lubomir Rintel 91c15babdf test/TEST-17-LVM-THIN: fail setup if we run out of space in the thin pool
This condition is rather difficult to detect -- the writes will just remain
queued and get lost on shutdown, resulting in a corrupt filesystem.
2019-07-19 16:02:25 +02:00
Harald Hoyer 4996e53ed3
mkinitrd-suse.sh: remove trailing "|"
caused by commit d10f6f836
2019-07-19 15:57:29 +02:00
Lianbo Jiang 84c862d8f3 99base: enable the initqueue in both 'dracut --add-device' and 'dracut --mount' cases.
The commit 9f3c31cd8d ("99base: enable initqueue if extra devices are added")
only covers 'dracut --add-device' case, but it did not cover 'dracut --mount'
case, which causes the kdump failure in the Amazon virtual machine.

Lets make sure that the initqueue is enabled in both cases in order to wake up
the device in time.

Reported-by: Xiao Liang <xiliang@redhat.com>
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
2019-07-19 15:51:21 +02:00
Harald Hoyer 3e67623ab5
Merge branch 'ryncsn-optimization' 2019-07-19 15:48:37 +02:00
Harald Hoyer 86f4dd0273
Merge branch 'optimization' of https://github.com/ryncsn/dracut into ryncsn-optimization 2019-07-19 15:48:22 +02:00
Kairui Song 19e5758590 squash: also squash systemctl if switch-root is not needed
systemctl need to be accessible on switch-root, but we unmount the
squash image on switch-root, so it will fail. systemctl depends on a lot
of libraries, squash them can save more RAM. So allow modules
(eg. kdump) to tell dracut that switch-root will be intercepted,
then we don't need to take care of that.

Signed-off-by: Kairui Song <kasong@redhat.com>
2019-07-19 15:38:54 +02:00
Kairui Song f6bbd024d9 squash: fix and simplify required_in_root
If required target is a symbol link, create the link then following the
link. If it's a directory, create new directory, else just move it.

Signed-off-by: Kairui Song <kasong@redhat.com>
2019-07-19 15:38:54 +02:00
Kairui Song ab703f44b4 squash: squash systemd binary and udevadm
systemd binary and udevadm are not needed to be outside the squash
image. Some binaries are kept outside because they are required before
mounting the image, or after umounting the image (when switching root),
or they may block umounting the image. But we are using lazy umounting,
so actually nothing will block the umount.

Keep more binaries outside the squash image won't hurt but cost extra
memories, the idea of squash image is to save memory usage.

So, there is no reason to keep udevadm outside, that should be a debug
left over. For systemd binary, it's running when switch root happens,
But we have lazy umounted the image and overlay, once systemd process
exec the new systemd in new root, everything will be cleared by kernel.

Also tidy up the comment make it less confussing.

Signed-off-by: Kairui Song <kasong@redhat.com>
2019-07-19 15:38:54 +02:00
Kairui Song a0d9ad6f70 dracut.sh: record the actual hostonly modules for hostonly mode
Previous in commit 7047294, dracut will include the loaded kernel module
list in initramfs, so other tools could check if the loaded kernel
module is changed and rebuild the host only initramfs in case some
module required to boot the machine is missing due to host only install.

It's better to use modalias list generated by dracut-install, that
list includes the device modalias list combined with current loaded
kernel module list. In this way, if any kernel module is yet to be
loaded when the initramfs is built, or got unloaded by accident the
module list will not change. This make the list more stable over
initramfs builds.

Signed-off-by: Kairui Song <kasong@redhat.com>
2019-07-19 15:38:13 +02:00
Kairui Song 90ac0a2d77 99squash: fail early if can't install require modules in initramfs
insmods will consider all arguments as optional modules by default, but
for squash module, all listed modules are required, if any of them is
missing the initramfs won't boot. So pass the '-c' argument to let instmos
know all those modules are mandatory, it will fail and give an error if
it failed to install any of those modules.
2019-07-19 15:37:25 +02:00
Hongxu Jia dddcb80945 dracut.sh: Fix udevdir detection
In commit [9d1b81c dracut.sh: improve udevdir and systemdutildir
fallback logic] , it checked a common binary `collect' to location
udevdir.

But upstream systemd drop binary `collect' since systemd v240
[a168792c2d]

So check binary `ata_id' to instead.

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
2019-07-19 11:01:32 +02:00
Daniel Molkentin d10f6f8367 mkinitrd-suse.sh: simplify get_kernel_version
This generalizes the naming and provides a workaround for compressed
kernels on s390.

Reference: bsc#1139939
2019-07-19 00:25:51 +02:00
Daniel Molkentin 9f561c54c7 tests: Ignore .testdir 2019-07-19 00:25:29 +02:00
Daniel Molkentin 4f19427641 95fcoe: Fix startup when fcoe module is included
The parse-fcoe.sh hook is sourced, and hence must not contain
exit 0 calls. Otherwise, the cmdline sequence will be interupted,
and no error will be reported to systemd. Use return instead.

Reference: boo#1136977
2019-07-19 00:25:06 +02:00
Thomas Blume 8c6ab479ab call netroot on wicked dhcp setup 2019-07-19 00:24:15 +02:00
Thomas Blume 9cc1b76087 nfsroot follow ifcfg settings for boot protocol 2019-07-19 00:23:34 +02:00
Takashi Iwai dc86c12c45 dracut-install: Add support for compressed firmware files
The upcoming kernel will have a support for loading compressed
firmware files, and this patch corresponds to that kernel change.
When a firmware file with the extra .xz extension is found, dracut
copies to initrd as fallback.  Since initrd itself is compressed, the
file is uncompressed in initrd beforehand.
2019-07-18 18:39:56 +02:00
Lukas Nykryn 9f96bb4c73 01fips: add cfb cipher
Required by FIPS standard
2019-07-16 14:31:32 +02:00
Andreas Schwab 62f939b857 Add support for riscv64 2019-07-15 16:00:59 +02:00
Lubomir Rintel 8238f41b34 travis: run TEST-13-ENC-RAID-LVM on Fedora 29
Systemd in Fedora 30 is broken at the moment.
Fix: https://github.com/systemd/systemd/pull/12897
2019-07-09 14:39:54 +02:00
Lubomir Rintel 7a2503ab8c travis: run TEST-14-IMSM on Fedora 29
Systemd in Fedora 30 is broken at the moment.
Fix: https://github.com/systemd/systemd/pull/12872/
2019-07-09 14:39:54 +02:00
Kairui Song 8365177644 fips: ensure fs module for /boot is installed
When using dracut with  --hostonly and --no-hostonly-default-device,
/boot will be inaccessible as dracut will most fs modules unless
specified. But FIPS require /boot to be accessible, and it will try
to mount it on boot. It will fail if corresponding fs module is missing.

For most case /boot will be a simple partition, include the fs module
will be enough for FIPS to mount it. For other cases users have to pass
extra parameters by themselves.

Suggested-by: Kenneth Dsouza <kdsouza@redhat.com>
Signed-off-by: Kairui Song <kasong@redhat.com>
2019-03-22 12:58:09 +01:00
Renaud Métrich 33cfad0b8f iscsi: always popd, even if there is no iscsi device 2019-03-04 10:43:21 +01:00
Kairui Song 5916d31b24 dracut: let module handling function accept optional path option
Let the caller pass in the module path instead of try to find the module
path everytime. This helps optimize the overall runtime.

Test results (3 rounds) on Fedora 30 in KVM VM with 8 CPUs, 2G memory, HDD:

    $ time ./dracut.sh --local --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode 'strict' -o 'plymouth dash resume ifcfg' --mount '/dev/mapper/fedora-root /sysroot xfs defaults' --no-hostonly-default-device -f initramfs.img
    Before the commit:
    real    0m11.782s  |  real    0m11.505s  |  real    0m11.958s
    user    0m9.169s   |  user    0m9.218s   |  user    0m9.327s
    sys     0m10.839s  |  sys     0m10.829s  |  sys     0m10.925s

    After this commit:
    real    0m9.866s  |  real    0m9.580s  |  real    0m9.638s
    user    0m9.048s  |  user    0m9.142s  |  user    0m9.120s
    sys     0m7.411s  |  sys     0m7.775s  |  sys     0m7.745s

Test result of building a ordinary image:

    $ time ./dracut.sh --local --quiet -f initramfs.img
    Before the commit:
    real    0m34.697s  |  real    0m34.371s  |  real    0m35.122s
    user    0m27.608s  |  user    0m27.524s  |  user    0m27.705s
    sys     0m22.341s  |  sys     0m22.032s  |  sys     0m22.246s

    After the commit:
    real    0m31.914s  |  real    0m31.006  |  real    0m31.289ss
    user    0m27.315s  |  user    0m27.324  |  user    0m27.290ss
    sys     0m19.051s  |  sys     0m18.916  |  sys     0m19.022ss

This will have an ~2s speed up.

Signed-off-by: Kairui Song <kasong@redhat.com>
2019-02-22 15:51:40 +08:00
Lukas Nykryn fc141f2286 install: string_hash_func should not be fed with NULL
If kmod_module_get_path returns NULL, we should skip that entry,
the hash function does not like NULL pointers.
2019-02-15 08:52:58 +01:00
Böszörményi Zoltán 0d08f43d71 Fix 98dracut-systemd/dracut-emergency.sh
/dev/consoles does not exist. It's /proc/consoles.

Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
2019-02-12 14:56:12 +01:00
Lukas Nykryn 94eccd15c5 95iscsi: /sys/devices/platform/*/flashnode_sess-*/is_boot_target sometimes does not exist
cat: '/sys/devices/platform/host2/flashnode_sess-*/is_boot_target': No such file or directory
/usr/lib/dracut/modules.d/95iscsi/module-setup.sh: line 90: [: -eq: unary operator expected
2019-02-07 16:19:00 +01:00
Lukas Nykryn ad906d85ea 95iscsi: fix a typo in a name of iscsiuio 2019-02-07 11:52:07 +01:00
Thomas Abraham 38ccf7c8e5 91zipl: Don't use contents of commented lines
Comment lines should be ignored. They should not be used for determining
the /boot/zipl device
2019-02-07 11:48:34 +01:00
Frantisek Sumsal 53cb081b4c 00systemd: check if systemd version is a number
The recent systemd upstream introduced a slightly modified version
string which included information about a git commit, which however
broke the version check in dracut. Unfortunately, the (( )) bash syntax
went along with it in certain cases and introduced a pretty nasty issue,
when the systemd would boot up but with slightly changed environment.

To prevent this from happening in the future, let's at least check if
the version parsed from the `systemd --version` output is a comparable
number.
2019-01-31 13:52:41 +01:00
Jens Heise 44f2fe5170 10i18n: Fix keymaps not getting included sometimes
Eliminate erroneous substring matches when looking up already processed keymaps to prevent necessary keymaps not getting added to the initramfs sometimes e.g. if there are the files 'compose.latin1' and 'compose.latin1.add' the unfixed version would skip processing 'compose.latin1' if find returned 'compose.latin1.add' first due to the directory listing not being in sorted order.
2019-01-26 16:12:14 +01:00
Daniel Molkentin 58e0d2d5b5 Fix a missing space in example configs
It has

omit_drivers+=" i2o_scsi"

which would break the next omit_drivers+="foo " if it's
missing a space at the beginning.

Reference: boo#1121251
2019-01-21 13:35:04 +01:00
Patrick Talbert 7c6d2ad916 95fcoe: Add the rd.nofcoe option to disable the FCoE module from the command line
Images built with the fcoe module will always run the lldpad
service as part of their pre-trigger scripts if the network
is active. This prevents network installations in
environments where, for security reasons, LLDPDU frames
cause a switchport shutdown.

Add a new rd.nofcoe option to cause dracut to skip the
lldpad.sh script and the entire 95-fcoe module.

Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
2019-01-18 14:10:19 +01:00
Lukas Nykryn fca93eac19 95iscsi: decouple iscsi from sysinit.target 2019-01-15 14:14:27 +01:00
Lukas Nykryn 88820dc781 Revert "95iscsi: drop systemd dracut service dependencies for iscsid"
This reverts commit 765b20333d.
2019-01-15 14:14:27 +01:00
Kairui Song 1ff306a396 lsinitrd: list squash content as well
When the initramfs is built with squash module enabled, the content
inside squash image will be invisible from the lsinitrd tool. This
commit make lsinitrd detect and list the content of the squash image as
well to avoid possible confusion.

Signed-off-by: Kairui Song <kasong@redhat.com>
2019-01-10 10:16:44 +01:00
Daniel Molkentin 32f68c1f9a emergency mode: use sulogin
- allow emergency login on every console
  specified in the kernel cmdline
- require password for hostonly images
- emergency mode: Manually multiplex emergency infos

This will bring all vital information to all ttys specified
as console devices, regardless of wether they hold the C flag.

Reference: FATE#325386
Reference: #449
2019-01-10 10:16:15 +01:00
Lukas Nykryn 61afc70454 95iscsi: rd.iscsi.initiator should have priority over stored configuration 2019-01-10 10:10:02 +01:00
Đoàn Trần Công Danh 09d2a1605b remove bashism in various boot scripts
When using dash as initramfs shell, the boot process is broken.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
2019-01-07 12:01:55 +01:00
Attila Bruncsak 7e944c77c0 the strip command should avoid changing the file modification time 2018-12-20 17:06:26 +01:00
Norbert Lange f9c96cf56f remove superfluous quotes in parameter expansion
as this breaks busybox hush shell.
offending functions can be found with
grep -r '${[^}]*"[^}]*}'
2018-12-13 15:13:03 +01:00
Norbert Lange a3ad33daf9 net-lib: remove calls to ip with -oneline option
busybox seems to not properly support this option,
and it can be be safely ommitted or replaced
with piping the output through head.

Rev 2:
*   rebased on master
*   addressed open points from review
2018-12-12 16:13:50 +01:00
Harald Hoyer ebe1821635
95iscsi/module-setup.sh: do not require 'hostname' anymore 2018-12-04 10:27:17 +01:00
Harald Hoyer b8a8d7a64e
fedora-test.sh: install tcpdump 2018-12-04 10:22:28 +01:00
Harald Hoyer 712f471ebf
test/test-functions: correctly move server.log 2018-12-04 10:06:12 +01:00
Harald Hoyer c38f9e980c
install/dracut-install.c: install module dependencies of dependencies 2018-12-04 10:03:31 +01:00
Harald Hoyer f6e3b59e5e network: skip already enslaved interfaces 2018-12-04 08:50:42 +01:00
Bruno E. O. Meneguele fb280834d7 dracut.modules.7.asc: typo correction
Correct simple typo in .7 manpage for dracut.

Signed-off-by: Bruno E. O. Meneguele <bmeneg@redhat.com>
2018-11-30 16:06:29 +01:00
Thierry Vignaud a6bc200c28 kill bogus comment
should have been killed in commit 4a855e6beb
2018-11-30 16:06:14 +01:00
Lubomir Rintel 79a17b0112 network-manager: call the online hook for connected devices
Look for "connection-uuid" instead of "managed" to determine the devices
that are actually activated with a connection and call the online hook.

This fixes the anaconda-net root mount, which utilizes the online hook.
2018-11-30 15:26:18 +01:00
Lukas Nykryn 76522d58c3 dracut-initramfs-restore: set selinux labels 2018-11-27 16:05:48 +01:00
Renaud Métrich 01ffcf342a fips: removed false-positive 'FATAL: Module xxx not found' error message when kernel provides a generic algo for module
Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
2018-11-15 10:46:24 +01:00
masem 05dc158e3c Delay argument "-d" requires number
Arguments "-f -d -n" fails with "invalid number -n", because -d delay expects number of seconds.
2018-11-15 10:44:37 +01:00
Kairui Song a60af53413 squash: unsquash the root image instead of mounting it on shutdown
When building squash image, squash module forgot to install the new
shutdown.sh, and the shutdown hooks are always skipped on ordinary
shutdown if squash module is enabled.

The new shutdown.sh will remount the squash image and then everything
will just work, but currently re-mounting the squash image on shutdown
may have selinux problem and make the system hang, and there is no
easy way to fix it.

So skip fixing the shutdown.sh not being install problem, instead
just drop the new shutdown.sh, and unsquash the image on ordinary
shutdown, which is safer and should always work.

Signed-off-by: Kairui Song <kasong@redhat.com>
2018-11-12 09:04:14 +01:00
Pedro Monreal f18d069d46 Fixed some SUSE specific typos and outputs 2018-11-08 14:43:08 +01:00
Lukas Nykryn 48c283a296 dracut.install: call dracut with --force
The kernel-install is called even if you run make install.
Since we don't call dracut with -f a second make install will fail
because initrd with same version is already there.
This makes kernel developers feel miserable.

https://bugzilla.redhat.com/show_bug.cgi?id=1642402
2018-10-25 16:14:05 +02:00
Harald Hoyer 0eef73ea43 Makefile: add srpm target 2018-10-24 15:14:03 +02:00
Dusty Mabe 765b20333d 95iscsi: drop systemd dracut service dependencies for iscsid
These dependencies cause an odd issue where swap devices specified
by resume= on the kernel command line will cause systemd device
timeouts to occur on boot. According to @haraldh these lines aren't
needed because the socket activiation will take care of it for us.
Removing these lines now as it fixes the resume= device timeout issue.

Fixes #480
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1641268
2018-10-24 08:57:24 +02:00
Daniel Molkentin b38b7fef36 95dasd_rules: mark dasd rules host_only
Reference: bsc#1090884
2018-10-22 09:36:26 +02:00
Daniel Molkentin 7117bf6270 99base: Allow files with backslashes in hostonly files
Files with blackslashes are routinely by systemd.

Reference: bsc#1090884
2018-10-22 09:36:26 +02:00
Renaud Métrich e54ab383f7 fips: check fips integrity just before mounting local filesystems in /sysroot
Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
2018-10-19 15:08:53 +02:00
Kairui Song b9af0fcdfb 99squash: Don't clean up squahfs on isolate
The only time we need to cleanup squahfs manually is on switch root, to
release resource and memory. We've covered that by setting
"Conflicts=initrd-switch-root.target" for squash cleanup service.
On shutdown systemd will take care of squahfs mounts. But for other
isolate, files in initramfs are most likely still required, so don't
clean up squahfs. For example, kdump's emergency handler will isolate
into its own target, if squahfs is cleaned up it will fail.

Signed-off-by: Kairui Song <kasong@redhat.com>
2018-10-18 11:55:50 +02:00
Kairui Song 83cbc06ab9 40network: Don't include 40network by default
commit 7347391 ('network-legacy: split off from network module')
splitted network function to network-legacy and removed check() function
of 40network. This caused 40network to be included even if network is
not needed.

Signed-off-by: Kairui Song <kasong@redhat.com>
2018-10-12 13:17:58 +02:00
Pedro Monreal db4d6bb42c Added space in Resolving executable dependencies done as in the rest of the messages 2018-10-09 13:41:55 +02:00
Kairui Song f51ab4a81f dracut.spec: Fix error introduced by 70291ed
70291e0 ('dracut.spec: Add dracut-squash package') introduced a new
dracut-squash package, but by accident it overrided some other package
spec and the dependency name is wrong. This patch will fix it.
2018-10-09 13:39:32 +02:00
Mike Gilbert 6d886bb74d dracut-install: simplify ldd parsing logic
The previous logic would not handle absolute paths on the left side of
the "=>" properly. For example, on Gentoo ARM64, ldd outputs this:

	/lib/ld-linux-aarch64.so.1 => /lib64/ld-linux-aarch64.so.1

At runtime, the kernel tries to load the file from /lib, and fails if we
only provide it in /lib64.

Instead of looking for the first slash after the "=>", just look for the
first slash, period. This would fail if we somehow had a relative path
on the left side (foo/libbar.so), but I'm not aware of any binaries that
would contain such an entry in DT_NEEDED.

Bug: https://bugs.gentoo.org/667752
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
2018-10-09 13:38:47 +02:00
Harald Hoyer 225e4b94cb Fix tests with network-legacy 2018-10-08 15:38:33 +02:00
Harald Hoyer 3e676eb12f AUTHORS: update 2018-10-08 15:31:49 +02:00
Harald Hoyer 2257b800ac NEWS: update 2018-10-08 15:31:08 +02:00
Eugene Syromiatnikov 290df2e1de modules.d: Add a module for handling additional depmod kernel module directories
It parses depmod configuration and scans modules.dep for kernel modules
present in directories supplied in "overrides", "external", and "search"
depmod configuration options.  The resulting list of (absolute) kernel
module paths is then supplied to instmods.

* modules.d/90kernel-modules-extra/module-setup.sh: New file.
* dracut.spec (%files): Add
%{dracutlibdir}/modules.d/90kernel-modules-extra.

Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
2018-10-08 10:49:36 +02:00
Harald Hoyer 4be697e5c1 dracut.spec: fixed invalid spec line 2018-09-21 12:41:00 +02:00
Lubomir Rintel 08bdadbf31 network-manager: add module 2018-09-21 11:32:01 +02:00
Lubomir Rintel 734739187b network-legacy: split off from network module 2018-09-21 11:32:01 +02:00
Lubomir Rintel 1c4a51c39c network: fix an error message 2018-09-21 11:32:01 +02:00
Lubomir Rintel 0aa2e5f728 iscsi: start iscsid even w/o systemd 2018-09-21 11:32:01 +02:00
Lubomir Rintel 5e615f4eb4 iscsi: do not install all of /etc/iscsi unless hostonly
/etc/iscsi/initiatorname.iscsi would leak the host initiator name (that
is host configuration) to the initramfs. Perhaps other files too.
2018-09-21 11:32:01 +02:00
Lubomir Rintel 9e82732dd4 iscsi: do not replace the configuration in the host system
ln: failed to create symbolic link '/usr/lib/systemd/system/sockets.target.wants/iscsid.socket': Permission denied
  ln: failed to create symbolic link '/usr/lib/systemd/system/sockets.target.wants/iscsiuio.socket': Permission denied

No way. Just ensure the links are there in the initramfs image. In fact,
that is already the case for iscsiuio.socket. Add iscsid.socket too.
2018-09-21 11:32:01 +02:00
Lubomir Rintel 0454dc247a network: configure NetworkManager to use dhclient
If the network module obtained a lease using dhclient, NetworkManager
must be configured to use it too, otherwise it would obtain a different
lease (and could potentially break a connection to the network volume).
2018-09-21 10:40:55 +02:00
Kairui Song 24f3463bff dracut.spec: Add dracut-squash package
As 99squash module requires extra dependency and it introduces new
files, add a new sub package for this module.
2018-09-21 10:32:04 +02:00
Kairui Song 095e1f37c4 Add support for building a squashed initramfs
With all files stored in ramfs, and most of them are not compressed,
the initramfs will take up a lot of memory. Besides, if the file number
is large, each file will waste some memory due to page fragmetation.
This is due to ramfs' design, at least one page will be allocated for
one file however small the file is. On machine with large page size,
this will become worse and waste too many memory.

One approach to reducing the memory usage is to reduce the number of
files that got directly loaded into the root ramfs, and compress files
by put most files will into a read-only squash image and keep a minimum
set of executable and libraries outside as the loader for the squash
image. After the squash image is mounted, the real 'init' will be
executed and then everything behaves as usual.

This patch will introduce a '99squash' module which will never be
included by default. User can force add it, and if it is included,
dracut will perform some extra steps before creating the final image:

For now, "/etc" and "/usr" will be moved into the squashfs image.
"/init" will be renamed to "/init.stock" and replaced by "/init.squash".
Files and folders need to be accessible before mounting the image will
be still avaliable at their original place. And due to squashfs is
readonly, an overlayfs layer will be created on top of squashfs mount
point, as many dracut module require readwrite access to "/etc" and
"/usr", "init.squash" will ultimately call "/init.stock".

An extra systemd service will be installed. This service will umount all
squashfs related mount points right before switch-root to release
resources properly. This service will not actually do anything if
switch-root is not used.

This is very helpful when mem resource is very limited, like Kdump.
According to my tests, this squash module can help save about 35MB of
memory with 64K page size, or about 15MB with 4K page size on an
ordinary kdump capture routine. This module could also help reduce
memory usage for normal boot up process.

Won't change any behavior if squash module is not enabled.

Signed-off-by: Kairui Song <kasong@redhat.com>
2018-09-21 10:32:04 +02:00
Alexander Tsoy f4334e9bdf base/dracut-lib.sh: use "command -v" in pidof()
"type -P" doesn't work in dash
2018-09-10 09:45:50 +02:00
Alexander Tsoy 838f22259a install: avoid non-portable __WORDSIZE
Lets not unnecessarily rely on __WORDSIZE, which is not clearly specified
by any spec. Use explicit size comparisons if we're not interested in the
WORDSIZE, anyway.

Patch ported from systemd.
(commit 8507eb20b64010b26f23822cbf442bb0bf96511c)

Original-patch-by: Emil Renner Berthing <systemd@esmil.dk>
Bug: https://bugs.gentoo.org/602122
2018-09-10 09:45:22 +02:00
Alexander Tsoy b3480d31b0 Prevent environment leaking into initrd-release
On my system the following initrd-release is generated:
...
VERSION="4 dracut-048 dracut-048"
...

VERSION is not defined in /etc/os-release, so the variable is
concatenated with its previous value:

* "4" comes from the kernel build system since dracut is called from the
  kernel install hook ("4" is a major kernel version);
* first "dracut-048" comes from the "systemd-initrd" module;
* second "dracut-048" comes from the "base" module.
2018-09-10 09:42:36 +02:00
Frederick Grose 8dd7bb48fc dmsquash-live/apply-live-updates: Test proper file link.
Update flag link to /dev/root as required by commit
789668deb3.
2018-09-06 11:46:24 +02:00
Frederick Grose 44d1688164 dmsquash-live-root: Manage absent overlayfs module better.
die when required; systemctl reload otherwise.
2018-09-06 11:46:24 +02:00
Frederick Grose a7d8fc280c dmsquash-live: Avoid grep and sed in this module.
strstr and variable string manipulations suffice.
2018-09-06 11:46:24 +02:00
Daniel Molkentin e9a84e0a21 98dracut-systemd: Start systemd-vconsole-setup before dracut-cmdline-ask
This is what happened before this patch (edited for brevity):

  dracut-cmdline-ask.service in modules.d/98dracut-systemd, which invokes
  dracut-cmdline-ask.sh. This script and systemd-vconsole-setup are
  started in parallel for the same console (tty1).

  Then dracut-cmdline-ask quits immediately without doing anything (unless
  rd.cmdline=ask is given). As this is a bash script and it gets tty as
  stdin as specified in its *.service, this triggers the hangup of tty1 at
  its exit.

  Meanwhile systemd-vconsole-setup continues and tries some ioctls after
  that, but they fail because of the hung up tty1.

The usual culprit for starting systemd-vconsole-setup early on is
plymouth-start.service, even if plymouth.enable=0 is set.

A popular (and annoying) symptom of this as reported by users was
the inability use their configured keyboard layout in plymouth when
unlocking their crypted block devices.

Reference: boo#1055834
2018-09-05 13:20:36 +02:00
Tobias Klauser d09218823c Fix misspellings in man pages and usage
Also remove some trailing whitespaces from the same files.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-08-30 13:12:00 +02:00
Tony Asleson ae9bc0d72f stratis: Add additional binaries
Include all binaries that could be called by the daemon.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2018-08-24 08:46:13 +02:00
Kairui Song 09ba1b289f kernel-modules: add nfit
To support pmem devices, nfit module is required
2018-08-21 13:03:36 +02:00
Kairui Song 9f3c31cd8d 99base: enable initqueue if extra devices are added
When extra devices are added, initqueue should be enabled to make sure
those devices are present, so following services and routines could
use those devices.

See PR #442 for more detail.
2018-08-21 13:03:20 +02:00
Frederick Grose eb18a1fe29 dmsquash-live, livenet: Simplify OverlayFS read-only overlay setup.
Use multiple lower layer directories in a single OverlayFS mount with
  a transient overlay directory.
Tolerate a command line with rd.live.overlay.readonly and NO persistent
  overlay by reconfiguring the OverlayFS mount options.
Use more compatible shell syntax for testing symlinks, and use printf
  instead of echo -e.
2018-08-21 10:52:34 +02:00
Frederick Grose 789668deb3 dmsquash-live: Support a flattened squashfs.img
A simplified root filesystem structure may be provided for OverlayFS
overlays by squashing the root filesystem directly instead of squashing
an embedded image file at /LiveOS/rootfs.img.  Detect and configure
such a squashed root filesystem for live booting.

For OverlayFS boots, avoid the read-only Device-mapper linear device
  at /dev/mapper/live-base.
Create a consistent device link at /dev/live-base for the read-only
  base loop device for all overlayed live root filesystems.
Consistently provide a link at /dev/root for wait_for_dev.

Update documentation.
2018-08-21 10:52:34 +02:00
Frederick Grose e791d753be livenet: Enable OverlayFS overlay in sysroot.mount generator.
Adjust sysroot.mount configuration for rd.live.overlay.overlayfs option.
Use link at /dev/root as a consistent flag for wait_for_dev.
Adjust documentation.
2018-08-20 10:08:43 +02:00
Harald Hoyer e0e6d96d69 travis: re-enable test 14
https://bugzilla.redhat.com/show_bug.cgi?id=1615271
2018-08-20 10:05:41 +02:00
Harald Hoyer ee18dd2b88 ifcfg/write-ifcfg.sh: aggregate resolv.conf
The old code used /tmp/net.$netif.resolv.conf with $netif being randomly
chosen.

As it is not known which nameserver have which priority, just sort them
and deduplicate.
2018-08-17 15:52:36 +02:00
Harald Hoyer 09132c732a test/test-functions: fixed V=1 logic 2018-08-17 15:38:03 +02:00
Harald Hoyer f19063ac71 travis: one last job reshuffle 2018-08-16 15:34:49 +02:00
Harald Hoyer a17440713a travis: reshuffle tests
long running tests first
2018-08-16 14:48:21 +02:00
Harald Hoyer bd03d374b7 travis: modprobe amd nested=1
GREAT!

$ modinfo kvm-intel kvm-amd| fgrep nested
parm:           nested:bool
parm:           nested:int
2018-08-16 14:28:54 +02:00
Harald Hoyer 06e12e4ba8 travis: rebalance tests 2018-08-16 14:25:23 +02:00
Harald Hoyer f059ce7682 travis: reshuffle tests 2018-08-16 13:56:19 +02:00
Harald Hoyer 286685cb72 TEST-99-RPM: use releasever of the host system 2018-08-16 13:20:40 +02:00
Harald Hoyer 7c62555bcf TEST-15-BTRFSRAID: use seperate disk image for boot result 2018-08-16 13:20:35 +02:00
Harald Hoyer 2699d8ff7e TEST-99-RPM: removed --releasever 2018-08-16 12:03:40 +02:00
Harald Hoyer 5a8f1aef55 TEST-15-BTRFSRAID: sync in test-init
strange failure
2018-08-16 12:01:40 +02:00
Harald Hoyer 9c034dc326 travis: no rpm check for all matrix tests 2018-08-16 11:57:30 +02:00
Harald Hoyer f8cad00948 test: for V=2 tail only the last MB of logs 2018-08-16 11:47:21 +02:00
Harald Hoyer c128b969bb travis: combine more tests 2018-08-16 11:18:33 +02:00
Harald Hoyer f59664a01f logtee: reduce output 2018-08-16 11:14:11 +02:00
Harald Hoyer 67f43d2124 test: fixed test.log name 2018-08-16 11:13:55 +02:00
Harald Hoyer 0ae5848245 travis: git pull more depth 2018-08-16 10:46:57 +02:00
Harald Hoyer 9f02b291ac travis: git pull --tags 2018-08-16 10:39:49 +02:00
Harald Hoyer 2b77ba0b75 travis: fight with yaml 2018-08-16 10:36:17 +02:00
Harald Hoyer 6f90be2971 travis: fixup 2018-08-16 10:33:06 +02:00
Harald Hoyer 110063c585 travis: git check 2018-08-16 10:29:16 +02:00
Harald Hoyer 51d0a54555 travis: use own logtee.c to reduce log output 2018-08-16 10:17:48 +02:00
Harald Hoyer c31a80c9ed TEST-01: remove memdebug 2018-08-16 09:50:52 +02:00
Harald Hoyer 79afb279c2 travis: fedora-test.sh send dnf output to dev/null 2018-08-16 09:48:02 +02:00
Harald Hoyer 3c8d3a6565 travis: don't run TEST-40-NBD 2018-08-16 09:35:33 +02:00
Harald Hoyer 01f9d0d9bf travis: combine more tests 2018-08-16 09:26:35 +02:00
Harald Hoyer 3111988680 dracut.sh: remove bogus dir removal for --rebuild 2018-08-16 09:19:52 +02:00
Harald Hoyer 1ebbe2eb7b travis: combine jobs 2018-08-16 09:10:29 +02:00
Harald Hoyer 65d16d1914 travis: extend matrix 2018-08-16 08:50:11 +02:00
Harald Hoyer da5a44cfb7 .travis.yml: add gitter notifications 2018-08-14 17:06:58 +02:00
Harald Hoyer 75b8b144a1 fedora-test.sh: don't parallelize travis tests 2018-08-14 17:02:43 +02:00
Harald Hoyer 1363167d65
Update README.md 2018-08-14 16:58:52 +02:00
Harald Hoyer d15c15c8f5 test/test-functions: be verbose for any $V not empty 2018-08-14 16:54:27 +02:00
Harald Hoyer 9288d21b9f TEST-50-MULTINIC: removed bogus qemu compat server call 2018-08-14 16:37:01 +02:00
Harald Hoyer cafe6675c2 test/run-qemu: move -cpu host to kvm args 2018-08-14 16:31:22 +02:00
Harald Hoyer fba4d28433 TEST-50-MULTINIC: fixed server.log 2018-08-14 16:30:42 +02:00
Harald Hoyer b7774da97c might even run without kvm 2018-08-14 16:18:53 +02:00
Harald Hoyer 3c1a083e5c add travis build job 2018-08-14 16:01:39 +02:00
Harald Hoyer 0f294d90b2 TEST-31-ISCSI-MULTI: increase verbose level 2018-08-14 15:54:42 +02:00
Harald Hoyer a2dbecfcd6 test: add TEST_RUN_ID 2018-08-14 15:54:31 +02:00
Harald Hoyer 604c09b1da TEST-31-ISCSI-MULTI/test.sh: fixed test description 2018-08-14 15:28:56 +02:00
Harald Hoyer f9c8b3112a TEST-50-MULTINIC/test.sh: fixed server startup 2018-08-14 14:12:54 +02:00
Harald Hoyer bb75d16521 kernel-network-modules: add vlan kernel modules 2018-08-14 14:07:12 +02:00
Harald Hoyer ca8f1c1ba3 test: fixed KVERSION and qemu backwards compatiblity 2018-08-14 14:03:55 +02:00
Harald Hoyer 94cc856cb8 TEST-70-BONDBRIDGETEAMVLAN: load vlan kernel modules 2018-08-14 13:57:15 +02:00
Harald Hoyer 827a5b1a80 test: also output server.log on failure 2018-08-14 11:37:57 +02:00
Harald Hoyer 393da0c370 TEST-50-MULTINIC: s/--device/-device 2018-08-14 11:35:26 +02:00
Harald Hoyer 82fe4ea0a5 enable parallel test suite
$ time sudo make -j SKIP=14 V=2 check
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-13-ENC-RAID-LVM'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-40-NBD'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-04-FULL-SYSTEMD'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-12-RAID-DEG'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-15-BTRFSRAID'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-16-DMSQUASH'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-17-LVM-THIN'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-11-LVM'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-31-ISCSI-MULTI'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-20-NFS'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-99-RPM'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-02-SYSTEMD'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-30-ISCSI'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-01-BASIC'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-03-USR-MOUNT'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-70-BONDBRIDGETEAMVLAN'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-50-MULTINIC'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-10-RAID'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-18-LVM-ENC-LV'
TEST: root filesystem on an encrypted LVM PV on a degraded RAID-5 [STARTED]
TEST: root filesystem on NBD [STARTED]
TEST: root filesystem on NBD [SKIPPED]
TEST: Full systemd serialization/deserialization test with /usr mount [STARTED]
TEST: root filesystem on multiple device btrfs [STARTED]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-40-NBD'
TEST: root filesystem on a LiveCD dmsquash filesystem [STARTED]
TEST: root filesystem on a LiveCD dmsquash filesystem [SKIPPED]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-16-DMSQUASH'
TEST: root filesystem on LVM on encrypted partitions of a RAID-5 [STARTED]
TEST: root filesystem on LVM PV [STARTED]
TEST: rpm integrity after dracut and kernel install [STARTED]
TEST: root filesystem on NFS [STARTED]
TEST: root filesystem over iSCSI [STARTED]
TEST: root filesystem on LVM PV with thin pool [STARTED]
TEST: root filesystem over iSCSI [STARTED]
TEST: root filesystem on a ext3 filesystem [STARTED]
TEST: root filesystem on a ext3 filesystem [STARTED]
TEST: root filesystem on a btrfs filesystem with /usr subvolume [STARTED]
TEST: root filesystem on NFS with bridging/bonding/vlan [STARTED]
TEST: root filesystem on NFS with multiple nics [STARTED]
TEST: root filesystem on an encrypted LVM PV on a RAID-5 [STARTED]
TEST: root filesystem on LVM on encrypted partitions of a RAID-5 [STARTED]
TEST: root filesystem on LVM PV [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-11-LVM'
TEST: root filesystem on multiple device btrfs [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-15-BTRFSRAID'
TEST: root filesystem on LVM PV with thin pool [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-17-LVM-THIN'
TEST: root filesystem on a ext3 filesystem [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-02-SYSTEMD'
TEST: root filesystem on a btrfs filesystem with /usr subvolume [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-03-USR-MOUNT'
TEST: root filesystem on LVM on encrypted partitions of a RAID-5 [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-18-LVM-ENC-LV'
TEST: Full systemd serialization/deserialization test with /usr mount [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-04-FULL-SYSTEMD'
TEST: root filesystem on an encrypted LVM PV on a RAID-5 [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-10-RAID'
TEST: root filesystem on LVM on encrypted partitions of a RAID-5 [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-13-ENC-RAID-LVM'
TEST: root filesystem over iSCSI [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-30-ISCSI'
TEST: root filesystem on a ext3 filesystem [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-01-BASIC'
TEST: root filesystem over iSCSI [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-31-ISCSI-MULTI'
TEST: rpm integrity after dracut and kernel install [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-99-RPM'
TEST: root filesystem on NFS [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-20-NFS'
TEST: root filesystem on NFS with bridging/bonding/vlan [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-70-BONDBRIDGETEAMVLAN'
TEST: root filesystem on an encrypted LVM PV on a degraded RAID-5 [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-12-RAID-DEG'
TEST: root filesystem on NFS with multiple nics [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-50-MULTINIC'

real	9m3,969s
user	22m50,323s
sys	5m24,411s
2018-08-14 11:04:50 +02:00
Harald Hoyer ffbd37d784 TEST-31-ISCSI-MULTI: use different port than TEST-30 2018-08-14 11:03:48 +02:00
Harald Hoyer ab94a204e0 load modules earlier for iscsi via dhcp root-path 2018-08-14 11:03:11 +02:00
Harald Hoyer 6058b06b86 test/{TEST-50-MULTINIC,TEST-70-BONDBRIDGETEAMVLAN}: use qemu-3.0 syntax
use qemu-3.0 syntax for network devices
2018-08-13 16:30:25 +02:00
Harald Hoyer 26aea0299a multipath-shutdown: fix shell syntax
seems like a misplaced $()
2018-08-13 16:30:25 +02:00
Harald Hoyer 0a80cda0ea dracut.spec: remove warpclock from z-series, not the other way round 2018-08-13 16:30:25 +02:00
Harald Hoyer 6f0500ed4a iscsi: remove $() where it does not fit
also simplify iscsiadm command to one call
2018-08-13 16:30:25 +02:00
Harald Hoyer 746135dd1e mdraid: better handling of various UUID formats 2018-08-13 16:30:25 +02:00
Lukas Nykryn a762dedb60 dracut-functions: fix the word splitting 2018-08-09 13:13:52 +02:00
Nicolas Chauvet a0c915b1e4 Add gpio and pinctrl drivers for arm*/aarch64
This is needed since few gpio/pinctrl can be built as modules and are
useful on early boot.

One example is jetson-tx1 where sata and external mmc can work only
after loading pinctrl-max77620 and gpio-max77620 modules.

Having theses kind of drivers bundled into the initramfs will also
avoid some deferred probes.

V2: add pinctrl for all arches

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2018-08-06 09:46:08 +02:00
Harald Hoyer 99df3d22be mdraid/parse-md.sh: also accept rd.md.uuid with ":"
convert rd.md.uuid=32ef2172:f056:6fa7:66a8:2f7fc8b1798
to udev rules in the correct UUID format 32ef2172-f056-6fa7-66a8-2f7fcf8b1798
2018-08-02 16:32:41 +02:00
Yu Watanabe be98291caf spec: sort modules
Also drops remaining %defattr.
2018-07-30 10:43:21 +02:00
Yu Watanabe 33782aebbf spec: warpclock is not available on s390 or s390x 2018-07-30 10:43:21 +02:00
Harald Hoyer 55a12055c5 dracut.spec: Remove needless use of %defattr 2018-07-26 13:04:20 +02:00
Harald Hoyer 25111d717e dracut.spec: add 00warpclock dracut module 2018-07-26 13:01:14 +02:00
Harald Hoyer 819ea38651 Bring back 51-dracut-rescue-postinst.sh
can only be obsoleted after F30
2018-07-26 12:58:21 +02:00
Kairui Song 143420bc05 lsinitrd: update help message and man page
Signed-off-by: Kairui Song <kasong@redhat.com>
2018-07-26 09:57:55 +02:00
Kairui Song 986b12d391 lsinitrd: optimize performance when handling multiple files
Currently, when trying to unpack or print the content of multiple
files, lsinitrd will decompress the image and pipe the decompressed
content to cpio to retrive each file if the image is compressed.
Which mean if we want to extract 10 files the image will be decompressed
10 times, which is a waste of time.

This patch will let lsinitrd decompress the image file to a temp file
first if multiple file names are given, then cpio will read from the
decompressed temp file, which will speed up a lot.

Time consumption test for command:
`lsinitrd initramfs-4.16.15-300.fc28.x86_64.img \
    usr/lib/dracut/build-parameter.txt \
    usr/lib/dracut/modules.txt \
    etc/machine-id \
    etc/hostname \
    usr/lib/udev/rules.d/99-systemd.rules`

Before the patch:
2.37user 0.33system 0:02.12elapsed

After the patch:
0.50user 0.42system 0:00.72elapsed

There would be a more significant time difference if we try to
extract more files.
2018-07-26 09:57:55 +02:00
Kairui Song f81c864eed lsinitrd: allow to only unpack certain files
Before this patch, "--unpack" will always unpack the whole image.
Make "--unpack" be able to unpack only certain files, it will be
easier to retrieve files from initramfs image.

Signed-off-by: Kairui Song <kasong@redhat.com>
2018-07-26 09:57:55 +02:00
Harald Hoyer aac3a0652a NEWS: forgot to update the latest version 2018-07-26 09:54:13 +02:00
Hannes Reinecke a0eadcdc64 00warpclock: Set correct timezone
Add module for setting correct timezone.

References: bnc#830060

For now, this module will not be included automatically due to different
expectations (see e.g.  https://bugzilla.redhat.com/show_bug.cgi?id=981617)

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Daniel Molkentin <daniel.molkentin@suse.com>
2018-07-24 07:08:11 +02:00
Harald Hoyer e331e06a39 dracut-install: skip modules with empty path
if kmod_module_get_path(module) returns NULL, skip the module
2018-07-18 12:42:02 +02:00
Kairui Song 7047294617 Record loaded kernel modules when hostonly mode is enabled
A hostonly image will not include every possibly required kernel module,
so if any hardware or configuration changed, the image may fail to boot.

One way to know if there are any hardware change or configuration change
that will require an image rebuild or not is to check the loaded kernel
module list. If the loaded kernel module list differs from last build
time, then the image may require to be rebuilt.

This commit will let dracut record the loaded kernel module list when
the image is being built, so other tools or services can compare this
list with currently loaded kernel modules to decide if dracut should be
called to rebuild the image.

To retrieve the loaded kernel modules list when an image is built, use
lsinitrd command:

lsinitrd $image -f */lib/dracut/loaded-kernel-modules.txt
2018-07-18 11:50:18 +02:00
Harald Hoyer 1caaeaae1e modules.d/95fcoe/cleanup-fcoe.sh: chmod +x 2018-07-12 15:19:17 +02:00
Harald Hoyer d63a4e285e TEST-40-NBD: disable for now
nbd is always broken
2018-07-12 15:18:48 +02:00
Harald Hoyer 9a9c67d61b TEST-30-ISCSI: readd multiple target test 2018-07-06 11:56:23 +02:00
Harald Hoyer bc01f822de NEWS and AUTHORS update 2018-07-06 10:37:51 +02:00
Harald Hoyer f265cb67dc mdraid: fix case if rd.md.uuid is in ID_FS_UUID format
if rd.md.uuid is in ID_FS_UUID format with dashes
e40a0234-7e52-5f10-f267-658d8ec463fa
convert it for the /dev/disk/by-id/md-uuid-${uuid} format
e40a0234:7e525f10:f267658d:8ec463fa
2018-07-06 09:25:03 +02:00
Harald Hoyer f98d3066d9 rdsosreport.sh: best effort to strip out passwords
Modified version of:
https://github.com/dracutdevs/dracut/pull/96

Thanks to Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
2018-07-05 14:49:23 +02:00
Mike Gilbert 9d1b81c0d1 dracut.sh: improve udevdir and systemdutildir fallback logic
Check for a common binary in systemdutildir. This resolves an issue on
split-usr systems, where it is common to have both /lib/systemd[/system]
and /usr/lib/systemd[/user] present.

Check for systemd-udevd specifically, since some distros (Gentoo) allow
udev to be installed without the rest of the systemd stack.

Similar logic is applied to udevdir simply for consistency.
2018-07-05 13:57:43 +02:00
Harald Hoyer e3fb645821 TEST-99-RPM: use Fedora 29 2018-07-05 13:39:46 +02:00
Harald Hoyer 8f77326479 dracut-init.sh: fix instmods with zero input
instmods < /dev/null

should not error
2018-07-05 13:39:46 +02:00
Harald Hoyer ca77afdeb3 dracut.spec: remove 90multipath-hostonly 2018-07-05 13:39:46 +02:00
Kairui Song 35e86ac117 Merge 90-multipath-hostonly and 90-multipath
This commit basically reverts 5ce7cc73

90-multipath-hostonly module was added in 5ce7cc73, because if hostonly
mode is enabled, multipath module will always hardcode wwids which
causes problems when the initramfs is cloned to another system with same
hardware.

Now with tri-state hostonly mode, the two modules could be merged and only
hardcode wwids when "strict" hostonly mode is enabled.
2018-07-05 13:17:19 +02:00
Harald Hoyer 058ff2f06d dracut.spec: add 95qeth_rules 2018-07-05 12:03:34 +02:00
Harald Hoyer efecf0a95e network: iface_has_carrier(): fixed logic 2018-07-05 09:37:10 +02:00
Hiroaki Mizuguchi c574c3f565 ifup.sh: don't wait linkup when set static ip explicitly
iface_has_carrier is skipped when set $dev. Fail curl fetch for root=live:<url>.
2018-07-05 09:37:01 +02:00
Daniel Molkentin 61ac90fefa 95qeth_rules: Add new module to copy qeth rules
Only pick rules for interfaces which have a carrier in the running
system. Those interfaces will be assembled by udev to allow booting
from those devices (i.e. iSCSI).

Reference: FATE#323440
2018-07-05 09:15:08 +02:00
Kairui Song 432647c278 90kernel-modules: Don't install extra modules when hostonly mode is set to strict 2018-07-05 09:14:02 +02:00
Kairui Song a695250ec7 Introduce tri-state hostonly mode
Add a new option --hostonly-mode which accept an <mode> parameter, so we have a tri-state hostonly mode:

    * generic: by passing "--no-hostonly" or not passing anything.
               "--hostonly-mode" has no effect in such case.
    * sloppy: by passing "--hostonly --hostonly-mode sloppy". This
              is also the default mode when only "--hostonly" is given.
    * strict: by passing "--hostonly --hostonly-mode strict".

Sloppy mode is the original hostonly mode, the new introduced strict
mode will allow modules to ignore more drivers or do some extra job to
save memory and disk space, while making the image less portable.

Also introduced a helper function "optional_hostonly" to make it
easier for modules to leverage new hostonly mode.

To force install modules only in sloppy hostonly mode, use the form:

hostonly="$(optional_hostonly)" instmods <modules>

Signed-off-by: Kairui Song <kasong@redhat.com>
2018-07-05 09:14:02 +02:00
Harald Hoyer 6ccb58a5b6 iscsi: s/rd.iscsilogin.retries/rd.iscsi.login_retry_max 2018-07-05 09:02:55 +02:00
Harald Hoyer 7d0848957c iscsi: do discovery for every network change 2018-07-04 13:05:56 +02:00
Daniel Molkentin 6b7ffedf0d Fix syncheck complaints 2018-07-04 13:05:56 +02:00
Daniel Molkentin b31f3fe0d1 95iscsi: Replace iscsistart with iscsid
This allows to setup multiple paths to targets, which is
required for iscsi multipath.
2018-07-04 13:05:56 +02:00
Nicolas Porcel c1688560ad Add timeout option to crypt module 2018-07-04 09:16:50 +02:00
Jeremy Linton 4cdee66c8e dracut-install: Support modules.softdep
Dracut uses the module deps to determine module dependencies
but that only works for modules with hard symbolic dependencies.
Some modules have dependencies created via callback API's or other
methods which aren't reflected in the modules.dep but rather in
modules.softdep through the use of "pre:" and "post:" commands
created in the kernel with MODULE_SOFTDEP().

Since in dracut we are only concerned about early boot, this patch
only looks at the pre: section of modules which are already being
inserted in the initrd under the assumption that the pre: section
lists dependencies required for the functionality of the module being
installed in the initrd.

Signed-off-by: Jeremy Linton <lintonrjeremy@gmail.com>
2018-07-03 13:36:26 +02:00
Sullivan (CTR), Austin e0ec6f10d4 Fixed issue #420 2018-07-02 12:42:32 +02:00
Javier Martinez Canillas f4947f8793 51-dracut-rescue.install: Don't install BLS fragment in /boot/efi on EFI
For EFI systems, the BLS fragments were stored in the EFI System Partition
(ESP) while in non-EFI systems it was stored in /boot.

For consistency, it's better to always store the BLS fragments in the same
path regardless of the firmware interface used.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-07-02 12:28:04 +02:00
Adam Williamson ba26c59523 Include virtio DRM drivers in hostonly initramfs
The code in 50drm which tries to include all DRM drivers for
hardware attached to the system did not look for virtio devices.
So if the system is a VM using the 'virtio' graphics adapter,
the 'virtio-gpu' module which should be included is not. This
extends the code to also look for virtio devices.

https://bugzilla.redhat.com/show_bug.cgi?id=1593028

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2018-07-02 11:56:15 +02:00
Ondrej Mosnacek cec0d04112 fips: only install FIPS-compliant crypto modules
Since the kernel doesn't allow using any non-FIPS-compliant crypto
algorithms, it doesn't make sense to install them. Even if they are
installed, tcrypt will not test them anyway.

Tested on Fedora 28 x86_64 by booting with fips=1 (with hand-patched
module-setup.sh).
2018-07-02 11:42:04 +02:00
Ondrej Mosnacek f4d34357c0 fips: cleanup FIPS crypto module list
This patch cleans up the default list of kernel modules in the 01fips
dracut module. All the algorithms that are tested in tcrypt are listed
by their algorithm name so that all the generic implementations and
drivers are picked up automatically based on the module alias.

This drops several unneeded modules and even a bogus one (rot13 -- this
one was obviously copy-pasted from tcrypt.c where it was listed as an
easter egg :).

The patch adds also some algorithms that weren't included in the
original set. It turns out in FIPS mode we only need those algorithms
that are marked as FIPS-allowed in testmgr.c (failure to find a non-FIPS
algorithm is ignored). The non-FIPS algorithms are further removed in a
subsequent patch.
2018-07-02 11:42:04 +02:00
Ondrej Mosnacek eed91294f8 fips: add crypto_user module for new hmaccalc
In Fedora 28+, hmaccalc (sha512hmac) is provided by libkcapi-hmaccalc,
which needs the crypto_user module for its functionality.
2018-07-02 11:42:04 +02:00
Hui Wang a73ba9a8ef dracut: scan and install external kernel modules
since kmod-25 keyword "external" was implemented in order to avoid
additional actions(like weak-modules) when kernel was updated, which
makes it more simple while kernels' kabi were compatible.

but if move some special modules such as megaraid_sas, mpt3sas and
so on, to a external path like /opt/modules, these modules will not
be install to initramfs by default, which make the initramfs can't
be used to boot for disk detection failure.

according to kmod's document, you must specify a absolute path with
"external" keyword, so scan the lines in modules.dep that begin with
"/" and install them, to make sure necessary modules in external path
can be installed to initramfs too.

Signed-off-by: Hui Wang <john.wanghui@huawei.com>
2018-07-02 11:40:42 +02:00
Javier Martinez Canillas 4f55387829 51-dracut-rescue.install: fix exit status code
After the $COMMAND case statement, the exit status of the last executed
command is added to the $ret variable.

But for the "add" pattern, this last executed command is an arithmetic
expression that also adds the exit status $? to the $ret variable. If
both $? and $ret are 0, then the arithmetic expression evaluates to 0
so is considered false and has an exit status of 1.

This makes the script to wrongly exit with an status code of 1 when it
should had been 0.

  case "$COMMAND" in
      add)
      ...
          ((ret+=$?))
	  # $ret is 0 here
          ;;
  ...
  esac

  ((ret+=$?))
  # $ ret is 1 here

  exit $ret

Since $ret is set in the case statement, just exit with that status code
and remove the last arithmetic expression that wrongly sets $ret to 1.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-07-02 11:33:41 +02:00
Ondrej Mosnacek bca1967c90 fips: Drop obsolete dependencies
Explicitly require libkcapi-hmaccalc and stop installing NSS/prelink
dependencies that are no longer needed.
2018-06-14 13:07:07 +02:00
Daniel Molkentin d00cfc2a7b Remove obsolete prelinking functionality 2018-06-14 12:58:59 +02:00
Ondrej Mosnacek e0758c8168 fips: Drop the 02fips-aesni module
The main 01fips module should always load all optimized/driver modules
of all relevant crypto algorithms (based on their aliases), so we can
drop this useless module.
2018-06-14 12:56:51 +02:00
B. Wilson 1b72c97cc5 crypt: Implement cmdline rd.luks.partuuid
Commit bf5c53a implements support for mounting LUKS devices with
detached headers; however, it assumes that the LUKS device sits on an
unpartitioned disk.

Mirroring the `rd.luks.serial` option, this commit implements the
`rd.luks.partuuid` cmdline option, supporting headless LUKS devices on
drive partitions.
2018-06-13 10:59:28 +02:00
Renaud Métrich c1c78f8a91 Harden dracut against BASH_ENV environment variable
When dracut silently produces a broken initramfs, then the system will
likely not boot and this can be very problematic. Typical use case is
after the kernel has been updated.

It appears that dracut is not protected against the BASH_ENV variable,
causing various scripts called by dracut to possibly fail or provide
wrong output (e.g. "ldd" is one of these).
Having a broken output for "ldd" makes the generated initramfs be not
usable, typically because vital binaries will be missing (e.g.
"awk", "udevadm", ...).

Note: because the shebang line cannot contain more than one argument,
the '--norc' option had to be removed. IMHO, it was useless anyway.

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
2018-06-08 10:48:45 +02:00
Ondrej Mosnacek 935dd5746a fips: add sha3_generic and sm3_generic modules
SHA-3 and SM3 have been added to the tcrypt module recently, so without
them the 'modprobe tcrypt' step causes a kernel panic.
2018-06-07 17:18:29 +02:00
Pingfan Liu 67354eebbc 40network: introduce ip=either6 option
In kdump, if dump-target is ssh on ipv6, we need to sync until ipv6 addr
is ready. Currently ip=auto6/dhcp6 provides such function. But in 1st kernel,
it is hard to know whether the ipv6 addr is got by dhcpv6 or SLAAC.
E.g ifcfg-eth* contains DHCPV6C=yes direction, but there is no dhcpv6
server in the network, and then after the system is up, the user
echo 1 > /proc/sys/net/ipv6/conf/eth0/autoconf && accept_ra by manual
to obtain a ipv6 addr. Or vice.
So this patch suggests to make dhcpv6 as auto6 fallback

Signed-off-by: Pingfan Liu <piliu@redhat.com>
2018-05-29 10:07:19 +02:00
Harald Hoyer f6e777ec4b cleanup empty ldconfig_paths directories
https://bugzilla.redhat.com/show_bug.cgi?id=1324746
2018-05-22 09:51:12 +02:00
Harald Hoyer df6bb5e959 shutdown: sleep a little, if a process was killed
If a process (maybe plymouth) was still pinning /oldroot, then shutdown
would
- kill -9 $pid
- umount_a
- umount_a
in a very short timeframe. A small sleep hopefully lets the scheduler free
up /oldroot in the mean time.
2018-05-15 13:37:53 +02:00
Harald Hoyer 08e11e30e3 dracut.spec: do not recommend grubby 2018-05-07 15:27:22 +02:00
Harald Hoyer 731b37e929 dracut-install.c: untabify 2018-05-07 15:23:04 +02:00
Harald Hoyer 8ad3215590 don't error out, if no modules were installed
dracut-install … -m -s drm_crtc_init =drivers/staging
should not return an error, if no module was found in =drivers/staging

https://bugzilla.redhat.com/show_bug.cgi?id=1575527
2018-05-07 15:21:35 +02:00
Harald Hoyer b2a024991f 80lvmmerge/README.md: remove executable bits 2018-05-07 10:40:32 +02:00
Harald Hoyer bfa4e45fa7 s/find_btrfs_devs/btrfs_devs 2018-05-07 10:26:45 +02:00
Daniel Molkentin c9b5165daa 10i18n: Fix possible infinite recursion 2018-05-03 15:15:16 +02:00
Colin Walters 740e41b843 Suppress sync/fsfreeze if not running on a live system
It's possible for e.g. `kernel` to be installed as an RPM BuildRequires or equivalent,
and there's no reason to sync, and *definitely* no reason to fsfreeze.

Another case where this happens is rpm-ostree, which performs its own sync/fsfreeze
globally.  See e.g. 8642ef5ab3
2018-05-02 17:44:45 +02:00
Michael McCracken 3161dea8e1 Update dracut.modules.7.asc
Update manpage to reflect code behavior for `inst` with >2 args.

Signed-off-by: Michael McCracken <michael.mccracken@gmail.com>
2018-04-30 21:48:34 +02:00
Yu Watanabe cae0004dbe spec: add stratis module
Follow-up for c4f8329cc2.
2018-04-30 21:48:11 +02:00
Hendrik Brueckner 3c8a69677b crypt: correct s390 arch to include arch-specific crypto modules
Convert the s390x into s390 to also include s390-specific crypto
modules, for example, aes_s390 into the initramfs.

Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com>
2018-04-26 13:34:53 +02:00
Tony Asleson c4f8329cc2 Initial Stratis support
Ref. https://github.com/stratis-storage

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2018-04-26 13:28:36 +02:00
tpgxyz 654484b82b fix zstd magic header 2018-04-19 06:31:23 +02:00
Marcos Mello ccaf52901f fs-lib: install crc32 in no-hostonly
It is needed by f2fs.
2018-04-17 12:02:00 +02:00
Marcos Mello 384eeedd2d fs-lib: install crc32c for ext4
EXT4 filesystems created with metadata_csum (enabled by default in mke2fs 1.44+) or ea_inode need crc32c.

https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?id=d0b9e0a6aa7d6805338a43b4e372623352d8df09
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/fs/ext4/super.c?h=v4.15.15#n3491
2018-04-09 08:19:51 +02:00
Marcos Mello 65cfabf7a6 fs-lib: remove redundancy 2018-04-09 08:19:51 +02:00
Enno Boland 2b5192c18d make failing installation of drm modules nonfatal 2018-04-01 16:02:24 +02:00
Alexander Tsoy fe6c7e0f06 plymouth: fix detection of plymouth directory
Some distros have both /usr/lib/plymouth and /usr/libexec/plymouth
directorirs, so we should check the existance of plymouth-populate-initrd
script.

Fixes: 421b46f8ae
2018-03-23 11:31:43 +01:00
Lukas Nykryn 3c3b2cf093 spec: add missing obsoletes and provides for removed fips subpackages 2018-03-22 16:34:16 +01:00
Lukas Nykryn 1f50d5b86d spec: merge fips subpackages to main package 2018-03-22 10:17:52 +01:00
Lukas Nykryn 0bb9a683d4 spec: drop support for legacy distributions
rhel <= 7 has its own branch and there is no point in supporting the old
fedora
2018-03-22 10:17:52 +01:00
Daniel Molkentin d23f32dd4b 90kernel-modules: Include Intel Volume Management Device support
Reference: bsc#1079924
2018-03-16 15:37:25 +01:00
Harald Hoyer ebfd53e1d9 lsinitrd.sh: fixed zstd file signature 2018-03-15 09:56:56 +01:00
Javier Martinez Canillas f8c24964cd 51-dracut-rescue.install: fix initramfs not generated in /boot case
Commit 5e574046e76e ("5?-dracut*.install: Allow scripts to install
the initramfs in /boot dir") added support to generate initramfs
images in the /boot directory and copy the respective BLS files.

Unfortunately, it broke the rescue initramfs generation when it's
not installed on /boot due not checking for the correct condition.

It checks for the 0-rescue sub-dir to exist, but this is created so
instead if the parent sub-dir exists has to be checked. Also, check
if the destination directory is /boot or not, instead if it exists.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-03-12 09:05:40 +01:00
Harald Hoyer f8e0c7cc62 kernel-modules: add mmc/core for arm 2018-03-05 09:56:25 +01:00
Lukas Nykryn 3aa37cafde all: fix issues found by shellcheck
Error: SHELLCHECK_WARNING:
/usr/lib/dracut/dracut-init.sh:939:20: error: Argument to implicit -n is always true due to literal strings. [SC2157]
  937|   dracut_kernel_post() {
  938|       for _f in modules.builtin.bin modules.builtin modules.order; do
  939|->         [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
  940|       done
  941|

Error: SHELLCHECK_WARNING:
/usr/lib/dracut/modules.d/98syslog/parse-syslog-opts.sh:18:12: error: This expression is constant. Did you forget a $ somewhere? [SC2078]
   16|       elif [ -e /sbin/syslogd ]; then
   17|           syslogtype="syslogd"
   18|->     elif [ /sbin/syslog-ng ]; then
   19|           syslogtype="syslog-ng"
   20|       else

Error: SHELLCHECK_WARNING:
/usr/lib/dracut/modules.d/90crypt/crypt-lib.sh:15:29: error: Since you double quoted this, it will not word split, and the loop will only run once. [SC2066]
   13|               strstr "$d" "${luks##luks-}" && return 0
   14|               if [ -n "$dev" ]; then
   15|->                 for _dev in "$(devnames $d)"; do
   16|                       [ "$dev" -ef "$_dev" ] && return 0
   17|                   done
2018-03-02 13:41:43 +01:00
Javier Martinez Canillas b39b8452d2 5?-dracut*.install: Allow scripts to install the initramfs in /boot dir
The GRUB 2 bootloaders expect the initrd to be installed in /boot instead
of /boot/$MACHINE_ID/$KERNEL_VERSION/{linux,initrd}, so if that directory
doesn't exists, install the initramfs images on the /boot directory.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-03-01 14:50:30 +01:00
Daniel Molkentin 48723f28aa 90kernel-modules: Ensure PCI host modules are included
The includes modules like the Intel Volume Management Device driver,
which is required to boot from disk on some systems.

Reference: boo#1079924
2018-03-01 12:51:49 +01:00
Harald Hoyer 3ed33db54a Update %description a bit 2018-02-26 11:22:55 +01:00
Harald Hoyer 0a68b6a518 dracut.spec: remove BuildRoot 2018-02-19 10:17:36 +01:00
Harald Hoyer 7b3f374a82 dracut.spec: remove clean section 2018-02-19 10:16:30 +01:00
Harald Hoyer 8ae8652edd version 047 2018-02-19 10:00:33 +01:00
Harald Hoyer 5283544cc7 dracut.spec: add BuildRequires gcc 2018-02-19 09:10:12 +01:00
Harald Hoyer e64dafd1f2 dracut-function.sh:check_block_and_slaves() check for block devices
Some nvme have char parents, so check if the "slave" is a block dev.

Fixes https://github.com/dracutdevs/dracut/issues/373
2018-02-19 09:05:01 +01:00
Harald Hoyer 1779aee72c dm:dm-shutdown.sh: silence all disassembly until the last try 2018-02-19 09:05:01 +01:00
Ignaz Forster 94f61235d7 Avoid executing emergency hooks twice 2018-02-08 16:30:05 +01:00
Alexander Tsoy 643be55570 crypt: actually put block_uuid.map into initramfs
Also change path to /etc/block_uuid.map.

Fixes: c3b6970394
2018-02-02 11:40:29 +01:00
Pawel Wieczorkiewicz f0094476fd 40network: Fix race condition when wait for networks
If no network related params are specific, but rd.neednet=1 is set,
the default initqueue action is to wait until one of the network
interfaces is marked as setup properly.

This also help with initqueue's race condition when the network interface
shows up late

References: bnc#866771

Signed-off-by: Hannes Reinecke <hare@suse.de>
2018-01-30 10:18:37 +01:00
Daniel Molkentin ed2cc8c9b9 90plymouth: logo file is optional and may not exist 2018-01-30 10:14:22 +01:00
Daniel Molkentin 421b46f8ae 50plymouth: improve distro compatibility
The existence of dpkg-achitecture is not indicative of a debian
installation. It may well be installed on systems of people who
package for both distros. The previous code path did not take
that into account.

We now traverse all known plymouth directories, locking on the first
valid one, and try to work with it.

At the same time, we do not include the module if the plymouth directory
could not be found.
2018-01-30 10:14:22 +01:00
Matthew Thode c88c3215e8 support kernels with built-in modules
Don't fail if modprobe fails to load a module, the kernel could have it
statically compiled in.

Signed-off-by: Matthew Thode <mthode@mthode.org>
2018-01-30 09:19:16 +01:00
Matthias Gerstner f48fb6f4ce 98integrity: support X.509-only EVM configuration
Previously if no symmetric key was configured for EVM, then the
initialization process was aborted. It can be a valid use case, however,
to only use EVM digital signatures. In this case only X.509 certificates
need to be loaded.

With this change EVM initialization will continue if any of the
symmetric or X.509 keys could be loaded.
2018-01-25 12:15:36 +01:00
Matthias Gerstner cb02ff635c 98integrity: support loading x509 into the trusted/builtin .evm keyring
This implements logic analogous to the one already implemented in
ima-keys-load.sh, only for the .evm/_evm keyrings.

If the kernel was built with CONFIG_IMA_TRUSTED_KEYRING then the kernel
initially creates and configures .ima and .evm keyrings. These keyrings
only accept x509 certificates that have been signed by a local CA which
belongs to the kernel builtin trusted keyring.

Thus if such a keyring is already present then additional evm keys
should be loaded into them. If this is not the case then the _evm
keyring needs to be created in userspace and keys will be loaded into
it instead.

Before this change dracut always created the _evm keyring and loaded
keys into it without considering an existing .evm keyring. In case of
CONFIG_IMA_TRUSTED_KEYRING being enabled, the _evm keyring will not be
used by the kernel, however, and EVM digital signatures will not work as
expected.
2018-01-25 12:15:36 +01:00
Matthias Gerstner a1c1be4f3e 98integrity: fix inconsistent whitespace 2018-01-25 12:15:36 +01:00
Harald Hoyer 6c7776e344 dracut-install: strdup() kmod_module_get_name() string
otherwise it can't be used later on after freeing the context.

Should resolve https://bugzilla.redhat.com/show_bug.cgi?id=1536609
2018-01-23 14:09:31 +01:00
Harald Hoyer d7e3bf7abd
Merge pull request #365 from Conan-Kudo/early-microcode-by-default
Enable 'early_microcode' by default
2018-01-18 15:20:51 +01:00
Thomas Backlund b25ef46f93 Enable 'early_microcode' by default
We initially enabled it for Haswell TSX bug (mga#16657)

Now there is also Meltdown and Spectre security issues,
and more microcode issues will most likely show up...

So the sane default for 'early_microcode' to have it enabled,
as theese changes must be done early in boot process to take
effect as intended.

Update documentation accordingly.

Reference: https://bugs.mageia.org/show_bug.cgi?id=16657

Signed-off-by: Thomas Backlund <tmb@mageia.org>
Signed-off-by: Neal Gompa <ngompa13@gmail.com>
2018-01-18 05:30:28 -05:00
Harald Hoyer cbb9a4e955
Merge pull request #362 from danimo/persistance_policy
Give --persistent_policy precedence over /dev/mapper names
2018-01-18 10:35:02 +01:00
Harald Hoyer dfbd8f74fd
Merge pull request #317 from dracut-mailing-devs/20171212142718.11451-1-carlo@caione.org
drm: Look for DRM drivers in the staging directory
2018-01-18 10:24:41 +01:00
Harald Hoyer 8379784a0e lsinitrd.sh: quote filename in extract_files() 2018-01-18 10:17:42 +01:00
Harald Hoyer a54206722d dracut.cmdline.7.asc: document rd.ccw and rd.znet
rd.znet should be used instead of rd.ccw.

Add more info about rd.znet.

Fixes github issue 364
2018-01-18 08:57:00 +01:00
Harald Hoyer 83b19de168
Merge pull request #363 from danimo/dracut_dmraid_use_udev
0202-dracut_dmraid_use_udev
2018-01-17 18:32:52 +01:00
Hannes Reinecke 9d651355a1 Use udev rules to create dmraid /dev/mapper/ devices
https://bugzilla.opensuse.org/show_bug.cgi?id=905746
2018-01-17 17:51:42 +01:00
Martin Wilck b6054b5de6 Give --persistent_policy precedence over /dev/mapper names
There is currently no way to override dracut's preference for
/dev/mapper device names. But using these is problematic in
different scenarios: For example, if a user has a multipath-
enabled system but wants to disable multipath, or if the
names of multipath maps change because of configuration changes
(e.g. toggling user_friendly_names in /etc/multipath.conf).

This patch makes dracut prefer the user-specified
--persistent_policy names over /dev/mapper names.

It might be worthwhile to discuss why dracut prefers /dev/mapper
of /dev/disk/by-uuid at all. This preference was introduced
in 9037b63e with the argument "dm devices maintain /dev/mapper/* as
persistent names", but that's wrong for the scenarios mentioned
above, and is not a compelling reason for preferring /dev/mapper
over /dev/disk/by-uuid.

References: bsc#908143

Signed-off-by: Martin Wilck <mwilck@suse.de>
2018-01-17 12:05:44 +01:00
Harald Hoyer 308c4066fe
Merge pull request #359 from yuwata/kmod-version
configure, kmod: bump kmod version to >= 23
2018-01-17 09:51:54 +01:00
Harald Hoyer bff3ee1936
Merge pull request #361 from danimo/dm_multipath
90multipath: load dm_multipath module during startup
2018-01-17 09:50:54 +01:00
Hannes Reinecke d842d5cf9e 90multipath: load dm_multipath module during startup
As the 'multipath' program will be triggered directly from
udev events it will be called before the multipath service
unit has started up. Which means we cannot rely on the
service unit to load the module for us, but we rather
have to do it early before udev is started.

References: bsc#986734

Signed-off-by: Hannes Reinecke <hare@suse.com>
2018-01-16 16:30:53 +01:00
Yu Watanabe 7bb8083562 configure, kmod: bump kmod version to >= 23
Follow-up for 2a0da60ed1.
2018-01-16 23:10:21 +09:00
Harald Hoyer 2a0da60ed1 configure: bump kmod version to >= 23
for issue #357
2018-01-16 14:17:16 +01:00
Harald Hoyer bce6823a19 lsinitrd: no more cat: write error: Broken pipe
silence the cat
2018-01-16 13:57:34 +01:00
Harald Hoyer 33b560fcc2
Merge pull request #356 from yuwata/spec-s390-2
spec: remove 81cio_ignore module from non-s390 arch
2018-01-16 10:15:38 +01:00
Yu Watanabe 885b4a17d4 update AUTHORS 2018-01-16 01:05:14 +09:00
Yu Watanabe a07b1bb6bb spec: remove 81cio_ignore module from non-s390 arch
Follow-up for b925f7f5d9.
2018-01-16 01:03:31 +09:00
Harald Hoyer 9ed6eb741f dracut-functions.sh:check_vol_slaves() speedup LV -> VG name
Instead of trying all /dev/mapper/* devices to match the maj:min, and
get the VG name with "lvm lvs", use the dm/name from /sys and dmsetup
splitname.

This should speedup execution with lots of LVs.
2018-01-15 15:47:17 +01:00
Harald Hoyer b925f7f5d9
Merge pull request #347 from danimo/81cio_ignore
81cio_ignore: handle cio_ignore commandline
2018-01-15 09:04:12 +01:00
Hannes Reinecke 637fb76291 0056-81cio_ignore-handle-cio_ignore-commandline
81cio_ignore: handle cio_ignore commandline

References: bnc#874902

Incorporates following on-top patches/fixes:
----------------------------
Subject: 81cio_ignore: skip module if cio_ignore is not active

When cio_ignore is not active we should skip the entire module
during boot; otherwise it'll lead to adverse effects.

References: bnc#882685
----------------------------
Subject: 81cio_ignore: rewrite module

Rewrite cio_ignore module to rely on the dracut commandline
parameter 'rd.cio_accept', which takes a comma-separated list
of CCW IDs. Each of those IDs are being removed from the
list of devices from cio_ignore.

The default values for rd.cio_accept are taken from
/boot/zipl/active_devices.txt.

References: bnc#882685
-----------------------------
Subject: More empty cmdline fixes

This fixes up some more modules which might print out empty
commandline files.
-----------------------------
Subject: Mark scripts as executable

All scripts need to be marked as executable, otherwise dracut
won't be running them.

References: bnc#887010

Signed-off-by: Thomas Renninger <trenn@suse.de>
2018-01-12 15:35:24 +01:00
Harald Hoyer 8b4b7dc5b2 iscsi: remove last iscsid code snippet 2018-01-12 13:45:20 +01:00
Harald Hoyer cc3808184c README.md: add test 31 2018-01-12 13:34:57 +01:00
Harald Hoyer d888e21b5d test/ci-matrix.txt: add file specifying which tests to run 2018-01-12 13:04:34 +01:00
Harald Hoyer 5cc17c25c2 TEST-14-IMSM: fail early, if setup failed 2018-01-12 11:34:45 +01:00
Harald Hoyer 2bb4881b82 dracut.spec: fixed typo
introduced with commit 52d19cb161
2018-01-12 11:33:53 +01:00
Harald Hoyer 28a68f1f3c iSCSI: no more iscsid
According to Cathy Zhou <Cathy.Zhou@Oracle.COM>:

"iscsistart is not designed to be working together with iscsid. When an
interface gets the dhcp offer successfully, the iscsiroot script is run
which starts the iscsistart service to establish the iSCSI session. With
the existence of iscsid, the iscsistart service's attempt to setup its
own mgmt ipc fails. Instead, the request to login to the iscsi target
is handled by the mgmt ipc of iscsid. After iscsistart finishes its
login attempt, it eventually sends a stop_event_loop request to stop
the mgmt process. As the result, it terminates iscsid."

So, iscsid is kicked out again.

Additionally iscsistart-flocked is used to make sure iscsistart is not
run in parallel.
2018-01-12 10:38:20 +01:00
Harald Hoyer b7a7ab1943
Merge pull request #354 from yuwata/spec-s390x
spec: do not package s390 specific modules
2018-01-12 10:36:56 +01:00
Yu Watanabe 52d19cb161 spec: sort modules 2018-01-12 18:24:52 +09:00
Yu Watanabe 4c3688d355 spec: do not package s390 specific modules 2018-01-12 18:24:31 +09:00
Harald Hoyer 8e7d0856d0
Merge pull request #351 from danimo/91zipl
Add 91zipl, which adds support for indirect booting on s390.
2018-01-12 09:34:08 +01:00
Harald Hoyer 6ccb77e19a dracut-systemd/dracut-pre-udev.service: also run for /etc/cmdline
Fixes #117
2018-01-12 09:32:45 +01:00
Harald Hoyer 47f83419a7
Merge pull request #353 from lnykryn/ntfs_3
90dmsquash-live: we don't have find_binary inside initramdisk
2018-01-11 15:33:45 +01:00
Lukas Nykryn c42c387cca 90dmsquash-live: we don't have find_binary inside initramdisk 2018-01-11 13:31:43 +01:00
Harald Hoyer b8b341a07f
Merge pull request #352 from lnykryn/ntfs
90dmsquash-live-ntfs: fix depends()
2018-01-11 13:18:14 +01:00
Lukas Nykryn f3e09bf1cb 90dmsquash-live-ntfs: fix depends()
Dependencies should not include module number.
2018-01-11 13:16:17 +01:00
Harald Hoyer 3a6a8d5c83
Merge pull request #346 from danimo/95dcssblk
95dcssblk: Add new module for DCSS block devices
2018-01-11 12:34:40 +01:00
Harald Hoyer cd83391c72
Merge pull request #350 from yuwata/fsfreeze
dracut.sh: do not invoke fsfreeze on EFI System Partition
2018-01-11 12:30:01 +01:00
Harald Hoyer 0f6d93eb9d crypt: escape backslashes for systemd unit names b/c udev/initqueue/bash
otherwise
luks\x2d25e41d19\x2d1580\x2d4e7c\x2d8875\x2d134045008f33
turns to
luksx2d25e41d19x2d1580x2d4e7cx2d8875x2d134045008f33
2018-01-11 11:42:22 +01:00
Thomas Renninger 33260dac6e Add /boot/zipl to host devs if it is a mount point
bnc#892187

Signed-off-by: Thomas Renninger <trenn@suse.de>
2018-01-11 11:40:06 +01:00
Thomas Blume 8bae047a4e 91zipl: Update active_devices.txt from /boot/zipl device
References: bsc#939101

Signed-off-by: Thomas Blume <thomas.blume@suse.com>
2018-01-11 11:12:39 +01:00
Hannes Reinecke d118e9d940 91zipl: Install script as executable
initqueue will only work with executable scripts, so we need to
mark it as such.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2018-01-11 11:12:39 +01:00
Hannes Reinecke 403f2c3e1d 91zipl: Translate 'ext2/3' into ext4
91zipl tries to read the filesystem for the /boot/zipl device.
On SLE12, however, the ext2 and ext3 filesystems are handled
by the ext4 module.
And due to bug#886839 no error is registered and booting fails.
So implement a band-aid to translate it into ext4.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2018-01-11 11:12:39 +01:00
Hannes Reinecke 73f89bbadb 91zipl: Store commandline correctly
The 'rd.zipl' command was only printed and never stored in the
initramfs itself.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2018-01-11 11:12:39 +01:00
Hannes Reinecke ea7ffef13e 91zipl: Add new module to update s390x configuration
Add new module to update the dracut commandline values
during booting with the values found in the file
dracut-cmdline.conf on the device specified by
rd.zipl.

Signed-off-by: Hannes Reinecke <hare@suse.de>

Contrary to the original patch, this one has been modified
to check for /boot/zipl, the location of the first stage kernel
in indirect boot, in order not to install on systems
booting directly via zipl.

Signed-off-by: Daniel Molkentin <daniel.molkentin@suse.com>
2018-01-11 11:12:39 +01:00
Yu Watanabe 7bc681fd88 dracut.sh: do not invoke fsfreeze on EFI System Partition
When the system boots with EFI, then initrd image is stored
on EFI System Partition. Thus dracut always warn about the
failure to invoke fsfreeze on the partition.
This prevents to run fsfreeze on ESP and suppress the warning.
2018-01-11 13:55:14 +09:00
Thomas Renninger d43cccf588 95dcssblk: Add new module for DCSS block devices
Add s390 dcssblk driver and introduce rd.dcssblk= to pass mounts
that should get activated at initrd stage.

References: FATE#308263

Signed-off-by: Hannes Reinecke <hare@suse.de>
2018-01-10 13:18:24 +01:00
Harald Hoyer 5a8efed021 TEST-3[01]-ISCSI*: increase disk size 2018-01-10 09:13:31 +01:00
Harald Hoyer 17414dd01b
Merge pull request #344 from yuwata/spec-cleanup
spec: use if-undefined instead of empty if-defined block
2018-01-09 13:24:46 +01:00
Yu Watanabe 965cacd43a spec: use if-undefined instead of empty if-defined block
Follow-up for 68cbbae33a.
2018-01-09 17:47:03 +09:00
Harald Hoyer ba2cfcab1e
Merge pull request #338 from danimo/fshelp
dracut-emergency: optionally print fs help
2018-01-08 15:05:28 +01:00
Mark Fasheh 1f8a7ae799 dracut-emergency: optionally print fs help
Allow filesystem modules to install a fs-specific text file with
instructions on what to do when mount fails. This is printed when we go into
an emergency shell.

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
2018-01-08 14:14:05 +01:00
Harald Hoyer 577f109243
Merge pull request #339 from danimo/fix_include_parsing
Fix parsing of "-i" and "--include"
2018-01-08 13:31:55 +01:00
Fabian Vogt dcacd2b072 Fix parsing of "-i" and "--include"
- dracut replaced every instance of "-i" in the cmdline,
  even if it was part of a kernel image name, e.g. "vmlinuz-i"
- Fixes boo#908452

Signed-off-by: Fabian Vogt <fvogt@suse.com>

Adjusted to not support "dracut -ifoo bar", as this breaks expected
upstream behavior.
2018-01-08 10:43:46 +01:00
Harald Hoyer d300160e70 Revert "mdraid: call mdadm with "--wait-clean" instead of "-W""
This reverts commit bc4ce61efc.

Read wrong man page section. Got confused by
https://github.com/dracutdevs/dracut/issues/342
2018-01-05 11:02:12 +01:00
Harald Hoyer c9d207467c dracut.spec: add lunmask dracut module 2018-01-05 10:42:22 +01:00
Harald Hoyer 68cbbae33a dracut.spec: remove systemd-bootchart 2018-01-05 10:39:44 +01:00
Harald Hoyer 03214e51ae
Merge pull request #343 from lnykryn/boot_image_once_more
01fips: Properly creating path to .hmac of kernel based on BOOT_IMAGE
2018-01-02 15:01:15 +01:00
Harald Hoyer bc4ce61efc mdraid: call mdadm with "--wait-clean" instead of "-W"
seems like -W changed meanings over the years :-/
2018-01-02 14:58:14 +01:00
Lukas Nykryn d818986db4 01fips: Properly fix creating path to .hmac of kernel based on BOOT_IMAGE
8f5c5 broke the case where BOOT_IMAGE is not set at all.
This code should handle following:
1) BOOT_IMAGE not set
2) BOOT_IMAGE set to something unrelated (s390)
3) BOOT_IMAGE=vmlinuz-4.14.7-300.fc27.x86_64
4) BOOT_IMAGE=/vmlinuz-4.14.7-300.fc27.x86_64
5) BOOT_IMAGE=/boot/vmlinuz-4.14.7-300.fc27.x86_64
6) BOOT_IMAGE=subdir/vmlinuz-4.14.7-300.fc27.x86_64
7) BOOT_IMAGE=/subdir/vmlinuz-4.14.7-300.fc27.x86_64
8) BOOT_IMAGE=/boot/subdir/vmlinuz-4.14.7-300.fc27.x86_64

https://bugzilla.redhat.com/show_bug.cgi?id=1415032
2017-12-28 09:59:48 +01:00
Harald Hoyer 8134db6c33
Merge pull request #321 from danimo/multipath-fixes
SUSE fixes for 90multipath
2017-12-19 15:43:58 +01:00
Harald Hoyer 8c3e65d1ce
Merge pull request #318 from danimo/fcoe-fixes
All FCOE-related SUSE patches, rebased on top of master
2017-12-19 15:43:13 +01:00
Harald Hoyer 51d2436c22
Merge pull request #340 from danimo/mkinitrd_suse_A
mkinitrd-suse.sh: Implement functionality of -A option
2017-12-19 15:41:33 +01:00
Harald Hoyer 29a9e92999
Merge pull request #331 from fcami/master-fsfreeze
call fsfreeze(8) on /boot to flush initramfs data & metadata to media
2017-12-19 15:35:18 +01:00
François Cami de576db3c2 call fsfreeze(8) on /boot to flush initramfs data & metadata to media 2017-12-19 14:47:11 +01:00
Harald Hoyer a187bc3ca5
Merge pull request #337 from danimo/lunmask
95lunmask: Add module to handle LUN masking
2017-12-19 14:39:07 +01:00
Harald Hoyer 598660bbe6
Merge pull request #336 from danimo/add_drivers
Fix possible hang in dracut
2017-12-19 14:36:45 +01:00
Fabian Vogt 39ee4fdfbd mkinitrd-suse.sh: Implement functionality of -A option
- Without this patch, -A sets host_only=0,
    but host_only wasn't used
- Translates into --no-host-only now
2017-12-19 13:23:08 +01:00
Hannes Reinecke 10f06425a5 95lunmask: Add module to handle LUN masking
Using the module option 'scsi_mod.scan=manual'
this implements LUN masking by selectively enable only those
devices required for booting.

References: bsc#954600,FATE#319786

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-12-19 00:34:45 +01:00
Fabian Vogt d53bb5c017 Fix possible hang in dracut
- Caused by add_drivers+=" " in dracut.conf (bsc#923116)

Signed-off-by: Fabian Vogt <fvogt@suse.com>
2017-12-19 00:04:35 +01:00
Hannes Reinecke 164760f4b0 95fcoe: use interface names instead of MAC addresses
Now that we are using persistent network names we can switch
to using the interface names when specifying the fcoe configuration.
With that we can print the fcoe configuration only once.

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-18 21:48:07 +01:00
Hannes Reinecke fd13d5d4d5 95fcoe: add timeout initqueue entries
Occasionally the FCoE connection might be reset after fipvlan was
called, causing the FCoE connection to be dropped and boot to fail.
For these cases we should be adding a timeout entry for the
initqueue to have a failsave mechanism to re-run fipvlan in
these cases.

References: bsc#1052840

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-18 21:48:07 +01:00
Hannes Reinecke 36a8b2e305 95fcoe: Switch back to using fipvlan for bnx2fc
bnx2fc doesn't _actually_ need fcoemon, so fipvlan is sufficient
to start the FCoE connection.
And, in fact, fcoemon is started for every interface, causing
subsequent invocations to fail with

fcoemon[1157]: error 98 address already in use

and fcoemon tearing down the connection.

References: bsc#1052840

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-18 21:48:07 +01:00
Hannes Reinecke 4e3eb1e9d1 95fcoe: fixup fcoe-genrules.sh for VN2VN mode
The 'mode' argument was never referenced in the printf format, causing
invalid rules to be written.

References: bsc#1036323

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-18 21:48:07 +01:00
Hannes Reinecke a3f91db476 95fcoe: Add shutdown script
We should be disabling the FCoE connection (which triggers sending
a LOGO internally) to logout from the target; this resets the target
and will avoid hitting a busy condition during reboots.

References: bsc#994860

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-18 21:48:07 +01:00
Hannes Reinecke 2aac319410 95fcoe: always set AUTO_VLAN for fcoemon
fcoemon is well capable of figuring out whether a vlan should
be used, so there's no need to disable the AUTO_VLAN feature.

References: bsc#995019

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-18 21:48:05 +01:00
Harald Hoyer 43634c2469
Merge pull request #335 from lnykryn/BOOT_IMAGE-to-HMAC
01fips: Fix creating path to .hmac of kernel based on BOOT_IMAGE
2017-12-18 15:26:31 +01:00
Lukas Nykryn 8f5c564cb3 01fips: Fix creating path to .hmac of kernel based on BOOT_IMAGE
Old code did not work for two most common use-cases.
On most machines BOOT_IMAGE is set to something like
/vmlinuz-4.11.3-202.fc25.x86_64. So if we just add prefix "/boot/."
it won't work. Also on machines without /boot on separate partition
BOOT_IMAGE already has the /boot/ prefix (/boot/vmlinuz-3.10.0-799.el7.x86_64).
So let's strip it in such case.

https://bugzilla.redhat.com/show_bug.cgi?id=1415032
2017-12-18 14:48:59 +01:00
Harald Hoyer 07e413bd0f
Merge pull request #334 from FloGa/master
Use pattern matching function
2017-12-18 11:29:17 +01:00
Florian Gamböck 63755f4db8 Use pattern matching function
The needle argument in this specific case is a pattern, which cannot be
matched by the "literal" string matcher strstr.

This can result in fsck calls like:

    e2fsck -a -y /dev/sda1

Which will then exit with an error like:

    e2fsck: Only one of the options -p/-a, -n or -y may be specified.

Hence, it is necessary to use the strglobin function to correctly match
the pattern.
2017-12-18 11:04:05 +01:00
Harald Hoyer 2d3273f96f
Merge pull request #325 from danimo/dasd_cio_free
95dasd_mod: do not set module parameters if dasd_cio_free is not present
2017-12-18 10:01:33 +01:00
Harald Hoyer a45651c193
Merge pull request #328 from danimo/nfs_bonddevices
Do not pass ifname for bonding devices (bsc#995812)
2017-12-18 09:44:24 +01:00
Harald Hoyer 12930f30a1
Merge pull request #324 from danimo/mdraid-no-delete-part
90dmraid: do not delete partitions
2017-12-18 09:43:57 +01:00
Harald Hoyer 1619e731f7
Merge pull request #330 from danimo/task_max_emergency
Set TaskMax=inifinite for the emergency shell
2017-12-18 09:14:21 +01:00
Harald Hoyer 84912dde41
Merge pull request #327 from danimo/nfs_host_robustness
Rebustness fixes for NFS hostnames
2017-12-18 09:13:29 +01:00
Harald Hoyer dfbbb0baf5
Merge pull request #326 from danimo/no_efi_fcoe_default
fcoe-uefi: Add check for usage
2017-12-18 09:11:54 +01:00
Harald Hoyer c0f2b6bebc
Merge pull request #323 from danimo/dm-fixes
Two SUSE fixes for 90dm
2017-12-18 09:06:54 +01:00
Harald Hoyer 8f4f40cb3c
Merge pull request #322 from danimo/font_maps
10i18n: Add correct fontmaps
2017-12-18 09:05:49 +01:00
Harald Hoyer fa54381b4e
Merge pull request #320 from danimo/ifname-bond
Do not pass ifname for bonding devices (bsc#995812)
2017-12-18 09:02:39 +01:00
Harald Hoyer ffbe0373e2
Merge pull request #319 from danimo/modules-load.d-hostonly
Fix loading of modules in modules-load.d
2017-12-18 09:01:21 +01:00
Daniel Molkentin 649619f6a5 Set TaskMax=inifinite for the emergency shell
Certain rescue/recovery operations, e.g. xfs_repair need
that liberty (bsc#1019938).
2017-12-15 22:00:41 +01:00
Daniel Molkentin 72f5a098e9 Do not pass ifname for bonding devices (bsc#995812)
Patch-By: Thomas Renninger <trenn@suse.de>
2017-12-15 21:55:41 +01:00
Fabian Vogt 8602e59867 NFS: Support host being a DNS ALIAS
The "host" command may also print something else than
"asdf.local.lan has address 1.2.3.4", like:
"rootserver.local.net is an alias for rainbow.local.net.".
So "head -n1" is not enough.

Fixes boo#955592
2017-12-15 21:52:59 +01:00
Thomas Renninger f5c10673de 95nfs: Fix mount if IPv4 address is used in /etc/fstab
Signed-off-by: Thomas Renninger <trenn@suse.com>
2017-12-15 21:52:28 +01:00
Fabian Vogt 22836a0921 fcoe-uefi: Add check for usage
References: boo#965477

fcoe-uefi gets included by default on EFI systems,
as it does not do the same check that fcoe does,
therefore needlessly pulling in network modules.
This patch copies the check from fcoe to fcoe-uefi.
2017-12-15 21:19:30 +01:00
Hannes Reinecke 6f1b5c0dab 95dasd_mod: do not set module parameters if dasd_cio_free is not present
We're now parsing the 'rd.dasd' parameter from 95dasd_rules, so
setting the 'dasd_mod' module parameter should be dropped here.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-12-15 21:14:51 +01:00
Hannes Reinecke 871378aad4 90dmraid: do not delete partitions
There is no point trying to delete partitions; dmraid works
happily even with them. On the contrary trying to delete partitions
can even be harmful when eg dmraid should _not_ be started.

References: bsc#998860

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 20:58:41 +01:00
Hannes Reinecke 870591acec 90dm: fixup dependency cycle between MD and DM shutdown
DM devices might be located on top of MD devices, so we need to
call the DM shutdown script before MD shutdown. The exception
here are multipath devices, which are below MD devices.
So skip removing multipath devices here to avoid spurious errors.

References: bsc#994860

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 20:55:37 +01:00
Hannes Reinecke 07e6357483 90dm: Fixup shutdown script
When calling the shutdown script we need to take care of traversing
the device-mapper tables, otherwise we might end up trying to remove
a device-mapper device which still has another one stacked on top
and the removal will fail.

References: bsc#994860

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 20:55:23 +01:00
Fabian Vogt 251afd36b2 10i18n: Add correct fontmaps
References: bsc#943312, bsc#932981

Signed-off-by: Fabian Vogt <fvogt@suse.com>
2017-12-15 20:50:10 +01:00
Martin Wilck 8008d47faf 90multipath: start before local-fs-pre.target
local-fs-pre.target serves as a separator between the code for
detecting block devices and systemd's fsck/mount logic. This
patch ensures that multipathd is started before local-fs-pre.target
in the initrd. By adding a "Wants=" line for local-fs-pre.target,
it makes sure that this target is started at all.

References: bsc#1006118
Signed-off-by: Martin Wilck <mwilck@suse.de>

===================================================================
2017-12-15 20:42:53 +01:00
Hannes Reinecke af99264a36 90multipath: parse kernel commandline option 'multipath=off'
SLES11 provided a kernel commandline option 'multipath=off',
so dracut should be parsing the option, too.

References: bsc#1001691

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 20:42:24 +01:00
Hannes Reinecke 239e8ba2ac 90multipath: add shutdown script
As the device-mapper module is removing all device-mapper tables
during shutdown we need to make sure to disable queuing on the
multipath devices; otherwise there might still be I/O pending
and the removal will fail.

References: bsc#994860

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 20:42:15 +01:00
Hannes Reinecke 8d20322f11 90multipath: Start daemon after udev settle
We need to wait until udev has processed all events, otherwise we'll
risk of misdetecting devices. This might cause a temporary interruption
during which multipath removes a device-mapper device, which then
causes a booting failure.

References: bsc#986734

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 20:41:59 +01:00
Hannes Reinecke d12ce1da85 90multipath: do not fail startup on missing configuration
References: bsc#930019

If rootfs is on multipath, but platform does not have an /etc/multipath.conf
file which is not urgently needed, they system will not boot, due to:

multipathd is not started and rootfs and swap are not found:
systemctl status multipathd.service
* multipathd.service - Device-Mapper Multipath Device Controller
   Loaded: loaded (/usr/lib/systemd/system/multipathd.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
Condition: start condition failed at Thu 2015-05-07 11:49:11 CEST; 7min ago
           ConditionPathExists=/etc/multipath.conf was not met

and exit to dracut shell.
2017-12-15 20:41:36 +01:00
Daniel Molkentin 51f4ab300d Do not pass ifname for bonding devices (bsc#995812)
Patch-By: Thomas Renninger <trenn@suse.de>
2017-12-15 20:35:29 +01:00
Fabian Vogt 9fd3e045d5 Fix loading of modules in modules-load.d
With hostonly enabled, only modules that are currently
loaded are included in the initrd. Modules which are
explicitly listed in modules-load.d do not need to
be filtered that way. Fix for boo#962224.
2017-12-15 20:19:52 +01:00
Hannes Reinecke c75196e11e 95fcoe: Allow to specify the FCoE mode via the fcoe= parameter
FCoE can run in Fabric (ie FCF) or VN2VN mode, so we should allowing
to set this parameter from the commandline, too.

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 18:51:49 +01:00
Daniel Molkentin d71c9ee286 95fcoe: silence lldpad warnings
When lldpad is not running, any calls to 'dcbtool' will be printing
out a warning. As it perfectly legit to have FCoE running without
DCB we should not be printing out the error.

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 18:51:49 +01:00
Hannes Reinecke d066fcc3fb 95fcoe: Do not overwrite FCoE configuration
If the installation already has a FCoE configuration we should
not attempt to overwrite it but rather use the pre-defined
configuration.

References: bsc#993861

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 18:51:49 +01:00
Johannes Thumshirn 6b96b50d2c 95fcoe: Reorder initialisation for bnx2x
Check first if we're running off an bnx2x device and start FCoE on it
via fipvlan, then go the normal/Intel way of starting DCB.

Also the SUSE version of fcoemon needs the yes parameter for the
--syslog option

References: bsc#982588

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.com>
2017-12-15 18:51:42 +01:00
Harald Hoyer 611b8ae0d7
Merge pull request #316 from danimo/btrfs-crc32-accel
Include crc32c-intel module when using btrfs
2017-12-14 15:38:12 +01:00
Harald Hoyer fb9970ba2d
Merge pull request #315 from danimo/emergency-task-limit
Fix task limit in emergency.service (the same change as in dracut-emergency.service) (bsc#1019938)
2017-12-14 15:37:40 +01:00
Harald Hoyer 6b7dca1631
Merge pull request #314 from danimo/simplify-amd-ucode
Simplify microcode lookup for for AMD CPUs
2017-12-14 15:36:54 +01:00
Daniel Molkentin 9f2916cce1 Include crc32c-intel module when using btrfs
Reference: bsc#1011554
2017-12-14 13:41:37 +01:00
Lidong Zhong df96cccc8f Fix task limit in emergency.service (the same change as in dracut-emergency.service) (bsc#1019938) 2017-12-14 13:37:44 +01:00
Daniel Molkentin 19453dc874 Simplify microcode lookup for for AMD CPUs
Suggested by Tom Lendacky <thomas.lendacky@amd.com>
2017-12-14 12:25:50 +01:00
Harald Hoyer 3dbf1f0783
Merge pull request #313 from danimo/amd-family0x17
Support Microcode Updates for AMD CPU Family 0x17
2017-12-13 08:51:12 +01:00
Daniel Molkentin 215fe58324 Support Microcode Updates for AMD CPU Family 0x17
Original-Patch-By: Tom Lendacky <thomas.lendacky@amd.com>
2017-12-13 01:42:52 +01:00
Carlo Caione 94d09135a7 drm: Look for DRM drivers in the staging directory
The recently upstreamed virtualbox video driver (vboxvideo) is shipped
in the staging directory. We need to probe it before Xorg is loaded to
avoid a corrupted X.

In general it is a good practice to look also in the staging directory
for DRM drivers.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
2017-12-12 16:04:24 +01:00
Harald Hoyer cd0305cee0
Merge pull request #312 from jnbr/network
40network: install grep
2017-12-12 10:22:41 +01:00
johannes 69acd20d4e 40network: install grep
since version 046 40network/net-lib.sh uses grep but the module does not install grep
2017-12-11 17:52:03 +01:00
Harald Hoyer 825730780a
Merge pull request #310 from danimo/remove-systemd-bootchart
Remove 00systemd-bootchart
2017-12-06 14:58:36 +01:00
Harald Hoyer 2bdce3d461
Merge pull request #311 from dracut-mailing-devs/1512379451-17727-1-git-send-email-piliu@redhat.com
dracut.sh: for_each_host_xx() function should indicate the empty case
2017-12-06 14:49:42 +01:00
Daniel Molkentin b36d322bd2 Remove 00systemd-bootchart
This was removed from systemd almost two years ago in
c550f7a9b89d017215af084288bc44f736f774fe, so dracut should drop support
as well.

Reference: bsc#1067279
2017-12-04 16:01:46 +01:00
Pingfan Liu e6199960d9 dracut.sh: for_each_host_xx() function should indicate the empty case
The caller of "for_each_host_xx func" needs to tell three cases:
func success/ fail / not be called.
E.g, in kdump case, host_devs can be empty, and we want to know it.

Signed-off-by: Pingfan Liu <piliu@redhat.com>
2017-12-04 11:04:53 +01:00
Robert Scheck 84fe3c1a20 Add fuse/ntfs-3g run-time dependencies for -live subpackage 2017-12-01 14:18:55 +01:00
Harald Hoyer 96d69bbf34
Merge pull request #309 from danimo/multipath_bin_error
Fix warning about multipath if not needed
2017-12-01 09:13:53 +01:00
Fabian Vogt ee6b44342b Fix warning about multipath if not needed
Although no device uses multipath, the module checks
for presence of the multipath binary first, printing a
warning if not present. This patch fixes the wrong ordering.
2017-11-30 16:51:15 +01:00
Harald Hoyer a13e97e511 dracut-install: remove double "//" in path names
makes relative symlinks shorter
2017-11-30 15:07:48 +01:00
Harald Hoyer 1ec2e34adc
Merge pull request #300 from danimo/pick_all_matching_keymaps
10i18n: Load all keymaps for a given locale
2017-11-06 09:56:13 +01:00
Harald Hoyer 11b3d60f5c
Merge pull request #303 from FGrose/bootmsg
dmsquash-live-root: Replace incompatible shell syntax.
2017-11-06 09:55:54 +01:00
Frederick Grose b1e1b6cba3 dmsquash-live-root: Replace incompatible shell syntax.
Fix issue #279  supercede PR #299
Fix bug https://issues.openmandriva.org/show_bug.cgi?id=2219
Replace Bashisms in the boot message for a missing overlay.
Verify presence of plymouth before calling it.
(Rework of commit f1b65e92af5e3f9df79f99e55d5aa936c9bca940.)
2017-11-05 02:19:10 -05:00
Harald Hoyer 18a5011ff2 Revert "lsinitrd.sh: dismiss "cat" error messages"
This reverts commit e190224345.
2017-11-03 09:16:45 +01:00
Harald Hoyer f9042fd839
Merge pull request #302 from keszybz/yet-another-timeout-fix
dmsquash-generator.sh: properly escape backslash in path
2017-11-03 09:15:02 +01:00
Zbigniew Jędrzejewski-Szmek 38ff9dfbe5 dmsquash-generator.sh: properly escape backslash in path
We need an actual bashslash in the filename on disk.

https://bugzilla.redhat.com/show_bug.cgi?id=1508794
2017-11-02 17:07:09 +01:00
Daniel Molkentin 28aea41829 10i18n: Load all keymaps for a given locale
Previously, dracut would only copy the first one found. However,
with legacy maps for some locales around, there is a chance we
pick the wrong one. Pick all matching keymaps instead

Reference: boo#1065058
2017-11-01 11:33:24 +01:00
Harald Hoyer d976e19325 Merge pull request #298 from derekhiggins/master
Skip iscsi attachment if no info
2017-10-27 09:10:22 +02:00
Derek Higgins 9408a2ac33 Skip iscsi attachment if no info
If no iscsi session information can be retrieved from the firmware
then skip the iscsi attachment and allow the boot process to continue.
Ensure the timeout scripts don't hit their timeout waiting for
/tmp/iscsistarted-firmware to be created.
This will allow a common image to be used for servers with both a
local and iscsi root with rd.iscsi.firmware set.
2017-10-26 16:27:45 +01:00
Harald Hoyer ed9281d6d1 dracut.sh: after doing the lazy resolve always install dependencies
Exit the lazy resolving mode after doing the lazy resolve, because there
won't be any lazy resolving anymore after this step.

Fixes https://github.com/dracutdevs/dracut/issues/152
Obsoletes https://github.com/dracutdevs/dracut/pull/225
2017-10-26 09:31:27 +02:00
Harald Hoyer e190224345 lsinitrd.sh: dismiss "cat" error messages
nobody wants to see "cat: broken pipe"
2017-10-26 09:08:28 +02:00
Harald Hoyer 21789cbb0a make qemu and qemu-net a default module in non-hostonly mode 2017-10-25 13:00:39 +02:00
Harald Hoyer 1751bacda1 Merge pull request #296 from dracut-mailing-devs/20170303132146.4968-1-crrodriguez@opensuse.org
systemd 233 requires sha256, hmac and algif_hash modules
2017-10-23 10:23:42 +02:00
Harald Hoyer 4b758ebe22 Merge pull request #294 from nullr0ute/arm-fixes
Add rpmsg, hwspinlock and usb/misc for ARM
2017-10-12 13:32:00 +02:00
Peter Robinson 82651e9ef3 Add rpmsg, hwspinlock and usb/misc for ARM
Some of the more complex devices now need rpmsg and hwspinlock in the early boot
process to start, and these to the initrd, and pull in usb/misc because
apparently non standard usb hubs are a thing.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-10-12 12:17:41 +01:00
Harald Hoyer 6bc8fbda61 Merge pull request #223 from bmr-cymru/bmr-ignore-activation-skip
lvm_scan.sh: use -K when calling lvchange
2017-10-12 11:23:38 +02:00
Harald Hoyer faabcb2360 dracut.sh: quote sync file argument 2017-10-11 15:28:20 +02:00
Harald Hoyer 1df4538662 Merge pull request #293 from dracut-mailing-devs/1502088233-10139-1-git-send-email-ankit@linux.vnet.ibm.com
Sync initramfs after creation
2017-10-11 15:10:26 +02:00
Harald Hoyer 2c9bcac113 dracut-install: char* -> const char* 2017-10-10 13:39:17 +02:00
Harald Hoyer 04fa949877 Merge pull request #284 from sm00th/kmoddir
dracut-install: fix relative paths in --kerneldir
2017-10-10 13:29:41 +02:00
Harald Hoyer 791d801689 dracut.sh: if /boot/vmlinuz-$version exists use /boot/ as output dir
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1475565
2017-10-10 10:30:44 +02:00
Harald Hoyer 8c2aa6161a git2spec.pl: handle empty merge commits 2017-10-09 17:40:04 +02:00
Martin Wilck 4c2d98c75b emergency.service: use Type=idle
Type=oneshot, as currently set in dracut's emergency service file,
causes an awkward situation if emergency mode is entered e.g. because
of a root device timeout, and the root device appears later because it
just has taken longer than the timeout. In that situation, my
expectation (backed by past positive experience) is that the user should
be able to simply exit the emergency shell and resume normal boot.

:/# systemctl status sysroot.mount
● sysroot.mount - /sysroot
   Loaded: loaded (/proc/cmdline; bad; vendor preset: enabled)
   Active: active (mounted) since Mon 2017-10-09 14:32:15 CEST; 16s ago
    Where: /sysroot
     What: /dev/mapper/3600601600a30200024fbbaf3f500e411-part5
     Docs: man:fstab(5)
           man:systemd-fstab-generator(8)
  Process: 1873 ExecMount=/usr/bin/mount /dev/disk/by-uuid/63751805-6abc-46a3-a66f-427920dece4d /sysroot -o ro (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 512)

:/# systemctl list-jobs
JOB UNIT              TYPE  STATE
 56 emergency.target  start waiting
 57 emergency.service start running

2 jobs listed.
:/# exit
logout
Failed to start default.target: Transaction is destructive.

(system keeps idling from this point on, user has no chance to
do anything).

This results from the combination of two effects:
1) initrd-root-fs.target sets "OnFailureJobMode=replace-irreversibly",
2) emergency.service's Type=oneshot causes the start jobs for both
emergency.service and emergency.target to persist while the user is in
the emergency shell.

When the shell is exited, systemd tries to isolate "initrd.target"
again, but this fails with "the transaction is destructive" error
because of the still pending jobs.

This patch fixes this by changing the Type of "emergency.service" from
"oneshot" to "idle".
2017-10-09 14:51:45 +02:00
Harald Hoyer b69ce65bf4 Merge pull request #286 from rldleblanc/bonding_mtu_fix
Fix MTU on bond interface.
2017-10-09 12:59:59 +02:00
Harald Hoyer 4e3833f6a2 Merge pull request #285 from rldleblanc/fix-typos
Fix a couple of typos.
2017-10-09 12:59:29 +02:00
Harald Hoyer 0d947530b2 TEST-70: sort interfaces for validation 2017-10-09 12:53:40 +02:00
Harald Hoyer bf5c53a33f Merge pull request #290 from privb0x23/luks-detached
Add basic LUKS detached header support
2017-10-09 12:51:29 +02:00
Harald Hoyer bada26263c Merge pull request #287 from xlpang/master
fcoe: handle CNAs with DCB firmware support
2017-10-09 11:47:08 +02:00
Harald Hoyer 7c9e64272e Merge pull request #280 from tpgxyz/zstd
add support for Zstandard
2017-10-09 11:39:10 +02:00
Harald Hoyer 32618b456e Merge pull request #277 from imran1008/bond-master-mtu
Set MTU on bond master as opposed to a bond slave
2017-10-09 09:38:37 +02:00
Michal Sekletar 28401778c4 systemd: fix setting of timeouts for device units
JobRunningTimeoutSec now affects how long can start jobs for device
units stay in the "running" state. Disabling default job timeout via
JobTimeoutSec=0 doesn't disable running state timeout. We need to set
running state timeout as well.

Note that doing this the other way around has effect on generic timeout,
i.e. disabling running state timeout disables generic timeout. But doing
it this way we would create implicit dependency on fairly new
systemd-234. However, by setting both options we don't create dependency
on specific systemd version.
2017-10-06 10:05:25 +02:00
privb0x23 b7058d0ce5 Add basic LUKS detached header support
A LUKS root volume with a detached header on a device without partitioning will not have a UUID and will not have an attribute ENV{ID_FS_TYPE}=="crypto_LUKS".
Therefore, several areas need to be addressed: identification of the LUKS device, inclusion of entries within crypttab, and provision of the detached header file.
- Added support for an option (4th column: "force") in /etc/crypttab to force the inclusion of the entry in the initramfs version (avoiding the fs type test).
- Added support for an option (4th column: "header=/path/to/file") in /etc/crypttab to provide a path to a detached header file embedded within the initramfs.
- Added ID and PARTUUID support to the device (2nd column) in /etc/crypttab (complementing the existing UUID functionality).
- Added cmdline support to indicate LUKS device ("rd.luks.serial=") that refers to the attribute ENV{ID_SERIAL_SHORT}.
Tested successfully on Void Linux (x86_64 musl) (no systemd) with a LUKS root volume accessed with a keyfile and using a detached header.
Not tested on systemd, or on a LUKS root volume with a passphrase rather than a keyfile.
2017-10-03 23:37:55 +01:00
Xunlei Pang 795256bbb1 fcoe: handle CNAs with DCB firmware support
Some Combined Network Adapters(CNAs) implement DCB protocol
in firmware, it is recommended that do not run software-based
DCB or LLDP on CNAs that implement DCB, but we have to start
the lldpad service anyway(there might be other software DCB).

If the network interface provides hardware DCB/DCBX capabilities,
the field DCB_REQUIRED in "/etc/fcoe/cfg-xxx" is expected to
be set to "no".

We met an issue on "QLogic BCM57810" with DCB firmware support,
and found dracut still generated "fcoe=<mac>:dcb" which caused
kdump boot failure when using that fcoe dump target.

This patch parses /etc/fcoe/cfg-xxx to detect DCB_REQUIRED="no",
and force "nodcb" if it is the case.

Also improved some coding style in passing.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2017-09-27 10:36:44 +08:00
Robert LeBlanc d0eabcab43 Fix MTU on bond interface.
The MTU is only being set on the slave devices and the MTU of the
bonding master is not being updated. This updates the bonding master and
also changes the MTU on the slaves as expected.

Signed-Off-By: Robert LeBlanc <robert@leblancnet.us>
2017-09-21 14:33:59 -06:00
Robert LeBlanc 4d60324757 Fix a couple of typos.
Signed-Off-By: Robert LeBlanc <robert@leblancnet.us>
2017-09-21 13:39:52 -06:00
Artem Savkov ef84ce2521 dracut-install: fix relative paths in --kerneldir
kerneldirlen is used to modify absolute path returned by
kmod_module_get_path() while it is calculated on user-supplied
--kerneldir argument which can be a relative path.

Use kmod_get_dirname() to convert user-supplied path to the same format
as used by kmod_module_get_path().

This also allows to get rid of now useless strcmp checks that seem to
imply that /lib and /usr/lib are linked which is not always true.
2017-09-21 11:27:23 +02:00
tpgxyz da97807ccc fix typo 2017-09-05 01:26:31 +02:00
tpgxyz 7dbadcc749 add support for Zstandard 2017-09-05 01:23:38 +02:00
Imran Haider 79926486a0 Set MTU on bond master as opposed to a bond slave
Prior to this commit, the MTU setting was applied to a bond slave
interface.  In older versions of the Linux kernel, this setting
propagated to the bond master and the other bond slaves associated with
the master.  In recent versions of the kernel (observed in Linux 4.12),
increasing the MTU of a slave does not automatically increase the MTU of
the master.  This allows for more flexibility but requires the MTU of
the master to be changed manually.

Ideally, the MTU setting should be applied to the bond master and the
setting will propagate to the bond slaves, since the slaves are required
to have a MTU that is greater than or equal to the bond master.
2017-09-03 00:15:37 -04:00
Harald Hoyer 424c065cd9 Merge pull request #276 from danimo/copy_multipath_confd
95multipath: Pickup files in /etc/multipath/conf.d
2017-08-30 11:51:12 +02:00
Harald Hoyer 1499719d25 Merge pull request #274 from danimo/system_allow_coredump
Enable core dumps with systemd from initrd
2017-08-30 11:39:06 +02:00
Daniel Molkentin d000b9a2c7 95multipath: Pickup files in /etc/multipath/conf.d
Reference: boo#1048551
2017-08-30 09:05:19 +02:00
Daniel Molkentin afe4e2844f Enable core dumps with systemd from initrd
systemd sets /proc/sys/kernel/core_pattern to use systemd-coredump.
However, systemd-coredump is missing from initrd, making dumping
the core in initrd impossible by default.

Reference: bsc#1054809
2017-08-29 08:53:35 +02:00
Harald Hoyer 15d00459c3 Merge pull request #272 from yzygitzh/no-lsinitrd-if-quiet
dracut.sh: disable lsinitrd logging when quiet
2017-08-23 09:31:53 +02:00
Ziyue Yang bd93e9287d dracut.sh: disable lsinitrd logging when quiet
Currently in Fedora/RedHat dracut installs its fedora.conf.example
as the default config file, in which sysloglvl is set 5. This leads
to maxloglvl=5 in dracut calls, making unnecessary lsinitrd calls
during initramfs builds by kdump.

This patch disables lsinitrd logging when --quiet option is given,
which is controlled by maxloglvl only before. This will speed up
dracut image building as the following if --quiet is used in kdump:

1) Before this patch
$ kdumpctl stop; touch /etc/kdump.conf; time kdumpctl start
kexec: unloaded kdump kernel
Stopping kdump: [OK]
Detected change(s) in the following file(s):
  /etc/kdump.conf
Rebuilding /boot/initramfs-4.13.0-0.rc1.git4.1.fc27.x86_64kdump.img
kexec: loaded kdump kernel
Starting kdump: [OK]
real    0m26.824s
user    0m9.958s
sys     0m15.106s

2) After this patch
$ kdumpctl stop; touch /etc/kdump.conf; time kdumpctl start
kexec: unloaded kdump kernel
Stopping kdump: [OK]
Detected change(s) in the following file(s):
  /etc/kdump.conf
Rebuilding /boot/initramfs-4.13.0-0.rc1.git4.1.fc27.x86_64kdump.img
kexec: loaded kdump kernel
Starting kdump: [OK]
real    0m20.420s
user    0m8.385s
sys     0m10.468s

Signed-off-by: Ziyue Yang <ziyang@redhat.com>
2017-08-23 11:23:34 +08:00
Harald Hoyer 721bec3f14 Merge pull request #269 from xlpang/master
introduce new "--no-hostonly-default-device"  argument
2017-08-18 09:33:10 +02:00
Xunlei Pang 5634a31156 rootfs-block/module-setup.sh: check root_devs in cmdline_rootfs()
In case of "--no-hostonly-default-device", we do not need
the root device, thus add this check.

Also fixed the stale "root_dev" export.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2017-08-18 14:44:19 +08:00
Xunlei Pang 37f2fe55d1 dracut.sh: introduce "--no-hostonly-default-device" argument
Kdump doesn't need default host devices like root, swap, fstab, etc,
we only care about the dump target which can be added via "--mount"
or "--add-device". We met several issues that kdump kernel failed
due to one of those host devices added by dracut, additionally, the
needless devices(e.g. LVM) consume some appreciable amount of memory
which is more likely to cause OOM under memory-limited kdump.

So this patch introduced "--no-hostonly-default-device" to avoid
adding those default devices as host_devs.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2017-08-18 09:58:08 +08:00
Harald Hoyer e5d6018783 Merge pull request #268 from danimo/ssh_include_nss
ssh-client: Include nss_ libraries
2017-08-16 10:16:55 +02:00
Michal Koutný 348935e3b6 ssh-client: Include nss_ libraries
SSH uses passwd database and thus need various NSS plugin libraries,
depending upon setting in nsswitch.conf.

SSH binary fails within the dracut environment without the libraries:

    #:/ ssh
    No user exist for uid 0
2017-08-15 16:10:50 +02:00
Harald Hoyer 3bd3ef5819 kernel-modules: don't call instmods with empty arguments
otherwise it will try to read from stdin and stall
2017-08-14 14:58:47 +02:00
Harald Hoyer 00f3525a30 lvmmerge: depend on systemd
Fixes https://github.com/dracutdevs/dracut/issues/267
2017-08-14 09:47:22 +02:00
Harald Hoyer 0344c2be13 dracut.spec: add support for builds without dist-tag
In the module-build-service, we have pieces of dracut provided by different
modules ("base-runtime" provides most functionality, but we need
dracut-network in "installer". Since these two modules build with separate
dist-tags, we need to reduce this strict requirement to ignore the dist-tag.
2017-08-11 14:13:02 +02:00
Harald Hoyer a0799ffb55 NEWS: update 2017-08-11 13:44:06 +02:00
Harald Hoyer 65f78f3d74 crypt: handle rd.luks.name
systemd supports renaming of dm devices with rd.luks.name.

Honor the kernel command line parameter.
2017-08-11 13:23:10 +02:00
Harald Hoyer 2b909b9a4b dracut-install: fixed hostonly modules hashmap_put 2017-08-10 09:20:35 +02:00
Harald Hoyer ed25fb0e91 dracut-install: fixed typo 2017-08-10 09:20:35 +02:00
Harald Hoyer c2408eed7f Merge pull request #266 from martinezjavier/master
network: Only bring up wired network interfaces
2017-08-10 08:49:14 +02:00
Javier Martinez Canillas 1792759721 network: Only bring up wired network interfaces
The dracut network module is only supposed to be used for wired interfaces
but if driver modules for wireless devices are wrongly copied, these will
be loaded and the available interfaces brought up.

If the rd.neednet=1 command line parameter is used, dhclient will attempt
to request an IP address for the interfaces and these requests will fail.

But other dracut modules that depend on the network to be settled, will
have to wait for the DHCP requests to timeout. Which can be a lot of time
since the dhclient default timeout value is 60 seconds.

Instead of trying to blacklist all possible kernel modules for wireless
devices, only bring up network interfaces if these are for wired devices.

Suggested-by: Harald Hoyer <harald@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2017-08-09 19:10:42 +02:00
Ankit Kumar e316ae0e43 Sync initramfs after creation
If we trigger crash just after creating initramfs, sometimes it is
observed that initramfs is not written to disk causing the subsequent
boot to fail. A sync should resolve this.

Signed-off-by: Ankit Kumar <ankit@linux.vnet.ibm.com>
2017-08-09 12:04:16 +02:00
Harald Hoyer 5abd692fe4 network/ifup: don't arping for point-to-point connections
https://bugzilla.redhat.com/show_bug.cgi?id=1477339
2017-08-07 15:09:36 +02:00
Harald Hoyer 1279a9e1a0 fcoe: install hba.conf and libhbalinux only if hba.conf exists 2017-08-07 14:45:55 +02:00
Harald Hoyer 0baf5a3e99 Merge pull request #265 from nullr0ute/arm-fixes
A few ARM fixes for a number of newer devices which have some wider deps
2017-08-07 13:10:55 +02:00
Harald Hoyer bdf0f9ce32 Merge pull request #257 from sbrudenell/loop-keys-in-initrd
Support crypto loop keys in initrd.
2017-08-07 11:41:11 +02:00
Harald Hoyer ae989390a1 dracut.sh: --nofscks does not take parameters
fixes: https://github.com/dracutdevs/dracut/issues/264
2017-08-07 11:39:45 +02:00
Ankit Kumar 81269979e6 Sync initramfs after creation
If we trigger crash just after creating initramfs, sometimes it is
observed that initramfs is not written to disk causing the subsequent
boot to fail. A sync should resolve this.

Signed-off-by: Ankit Kumar <ankit@linux.vnet.ibm.com>
2017-08-07 09:03:46 +02:00
Peter Robinson 39018c93c2 arm: add soc/extcon/mfd as they're often needed for USB and core memory/soc drivers
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-08-04 19:51:25 +01:00
Peter Robinson f496af50b7 add options to pickup dw_mmc submodules to blockfuncs
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-08-04 18:43:26 +01:00
Steven Brudenell c427603cd1 Include both and in luks key name. 2017-08-03 21:47:06 -04:00
Steven Brudenell e2b877a18b Change mntp->keydev in loopback key luks name. 2017-08-03 21:47:06 -04:00
Steven Brudenell 690b24f02f Support crypto loop keys in initrd. 2017-08-03 21:47:05 -04:00
Harald Hoyer 98663fcaac Merge pull request #261 from jonathan-teh/amd-family-16h
Add early microcode support for AMD family 16h
2017-08-02 11:31:19 +02:00
Harald Hoyer 8523ec50c2 Merge pull request #260 from haraldh/crypto-cleanup
crypt-loop: cleanup cleanup procedures
2017-08-02 11:28:47 +02:00
jonathan-teh af6eee79e3 Add early microcode support for AMD family 16h 2017-07-29 00:19:19 +01:00
Harald Hoyer 9fd0461b7d nbd: use systemd-run to start nbd-client 2017-07-28 15:15:02 +02:00
Harald Hoyer 66a3d4053b testsuite: increase disk image size 2017-07-28 15:15:02 +02:00
Harald Hoyer b1ae591945 dracut-systemd: add back missing dependencies
otherwise TEST-20-NFS fails
2017-07-28 11:57:07 +02:00
Harald Hoyer 017978f868 network: redirect stderr for arping test 2017-07-28 11:54:27 +02:00
Harald Hoyer 2187b3d097 crypt-loop: cleanup cleanup procedures
Using initqueue --finished to cleanup stuff is not what the
initqueue/finished hook was meant for.

Move stuff to the real cleanup hook.
2017-07-28 10:43:39 +02:00
Harald Hoyer c75ce02775 TEST-02-systemd: add systemd-analyze verify 2017-07-28 10:19:26 +02:00
Harald Hoyer f24d205537 dracut-systemd: fixed dependencies
try to break an ordering cycle.

https://github.com/dracutdevs/dracut/issues/259
2017-07-28 10:19:26 +02:00
Harald Hoyer 85ed04e0cf dracut-systemd/*.service: fix copyright message and comment 2017-07-28 10:17:06 +02:00
Harald Hoyer c0371761fb add systemd-analyze to debug and TEST-02-SYSTEMD 2017-07-28 10:17:06 +02:00
Harald Hoyer 2ceb910a73 git2spec.pl: handle github merges
found a nice strategy to produce patchset from merges
2017-07-27 16:34:25 +02:00
Harald Hoyer 72c084918a Merge pull request #253 from yuwata/spec
spec: add missing modules
2017-07-26 09:28:49 +02:00
Yu Watanabe ad3b209d40 spec: add missing modules 2017-07-25 10:31:55 +09:00
Harald Hoyer 1a95f1f4fc dracut.spec: add 80lvmmerge 2017-07-24 16:11:41 +02:00
Harald Hoyer ef025dcbbe Update README.md 2017-07-24 15:59:12 +02:00
Harald Hoyer d23b0efc1a 80lvmmerge: remove unused file 2017-07-24 15:54:16 +02:00
Harald Hoyer 1bfa75b015 80lvmmerge: README.md update 2017-07-24 15:53:50 +02:00
Harald Hoyer dd75a946db Update README.md 2017-07-24 15:51:54 +02:00
Harald Hoyer e95a3c36ed add lvmmerge dracut module 2017-07-24 15:48:54 +02:00
Harald Hoyer 400a85ffaf install arping V2 as arping2 2017-07-24 10:03:42 +02:00
Harald Hoyer 9388d99361 simplify TEST-30-ISCSI for CI 2017-07-21 16:01:04 +02:00
Harald Hoyer 5a532aa83f Update README.md 2017-07-21 15:47:37 +02:00
Harald Hoyer 9cd4edb445 TEST-12: increase retry and loglevel 2017-07-21 15:04:57 +02:00
Harald Hoyer a1d92d8ace TEST-12: sleep to get log messages 2017-07-21 14:44:20 +02:00
Harald Hoyer fac3e9d975 TEST-12: settle before doing sfdisk 2017-07-21 14:07:30 +02:00
Harald Hoyer 9b8e6e40a9 increased qemu memory 2017-07-21 11:43:08 +02:00
Harald Hoyer a430c3f7a6 Merge pull request #252 from landgraf/dhcp_option_21
dhclient: send client-identifier matching hardware address
2017-07-19 14:32:41 +02:00
Harald Hoyer e7b343138f Merge pull request #233 from yuwata/kernel-install
kernel-install: Skip to create initrd if /etc/machine-id is missing or empty
2017-07-19 09:53:40 +02:00
Pavel Zhukov 4011b48c42 dhclient: send client-identifier matching hardware address
Forcing dhclient to use hardware address instead of DUID to make it
predictable and allows system installation in whitelist based networks.
2017-07-17 17:58:28 +02:00
Harald Hoyer 295194ee42 Merge pull request #251 from danimo/fix_hostonly_cmdline
Do generate error when hostonly_cmdline is set to "no"
2017-07-17 17:08:29 +02:00
Daniel Molkentin 76dd870bfd Do generate error when hostonly_cmdline is set to "no"
Reference: bsc#1048748
2017-07-17 17:01:07 +02:00
Harald Hoyer 3e7498ea03 Merge pull request #250 from lnykryn/classless-static-routes
40network/dhclient.conf: rename classless-routes to classless-static-…
2017-07-14 08:36:16 +02:00
Lukas Nykryn 62b7920ed1 40network/dhclient.conf: rename classless-routes to classless-static-routes
We tell dhclient to name 121 option "classless-routes",
but in dhclient-script we parse classless_static_routes.
So either have to change the configuration or the script.

And since dhclient uses by default classless_static_routes,
let's change the configuration
2017-07-13 16:46:19 +02:00
Harald Hoyer 5ce7cc7337 add 90multipath-hostonly module
hardcoding the wwid of the drives in the initramfs causes problems
when the drives are cloned to a system with the same hardware, but
different disk wwid's

https://bugzilla.redhat.com/show_bug.cgi?id=1457311
2017-07-10 13:28:40 +02:00
Harald Hoyer d84f4687c3 dracut-init.sh: check for file $DRACUT_KERNEL_MODALIASES
and not for the directory
2017-07-07 15:59:31 +02:00
Harald Hoyer db17ef6c4f dracut-init.sh: add the kernel directory to the --modalias generation 2017-07-07 15:58:02 +02:00
Harald Hoyer 3ad12c7be8 Check all modalias files in /sys/devices for modules
and add the corresponding kernel modules to the host module list

https://bugzilla.redhat.com/show_bug.cgi?id=1467427
2017-07-07 15:55:55 +02:00
Harald Hoyer 26264af7f5 Merge pull request #191 from robert-scheck/master
Add NTFS support to 90dmsquash-live module
2017-07-06 09:26:51 +02:00
Robert Scheck 37437cac8a Add NTFS support to 90dmsquash-live module (#191)
Support booting from USB media with NTFS filesystem (optionally),
which removes the FAT32 related 4 GB file size limit for LiveOS/
squashfs.img (and any other file on the same USB media).
2017-06-30 00:15:57 +02:00
Harald Hoyer 106255afd4 bail out if module directory does not exist
this basically reverts commit 05214a0bed

if people want to build the initramfs without kernel modules,
then --no-kernel should be specified
2017-06-29 17:09:50 +02:00
Harald Hoyer c1699b59c6 kernel-modules: add serial line drivers 2017-06-29 12:18:26 +02:00
Harald Hoyer add1ea88d2 mark these as needing bash 2017-06-29 12:18:26 +02:00
Harald Hoyer 3d875f77f3 Try BOOT_IMAGE and fallback to vmlinuz-${KERNEL}
On s390 BOOT_IMAGE only denotes the number of the boot record that
was selected in the bootloader and not the path to the kernel image.

Also only bail out, if the kernel hmac checking relies on that path.
2017-06-29 10:40:29 +02:00
Harald Hoyer 44302d6f28 dracut.spec: use Recommends for rhel > 7 2017-06-29 10:40:29 +02:00
Harald Hoyer 38e9d6249a Merge pull request #246 from lnykryn/authenc
01fips: add authenec module
2017-06-28 18:09:54 +02:00
Lukas Nykryn 0a50111ab3 01fips: add authenec module
Resolves: #1465946
2017-06-28 17:46:04 +02:00
Harald Hoyer 937cc53ecb Merge pull request #241 from danimo/zfcp_rules_dasd_rules_updates
s390 changes that never went upstream
2017-06-28 11:57:33 +02:00
Harald Hoyer 343c74311b Merge pull request #244 from danimo/crypt_with_uuid
90crypt: Fixed crypttab_contains() to also work with device path in /etc/crypttab
2017-06-28 09:26:03 +02:00
Julian Wolf c3b6970394 90crypt: Fixed crypttab_contains() to also work with device path in /etc/crypttab
blkid is not available when this function is called, so block_uuid.map is put into
the initrd, mapping block devices from /etc/crypttab to UUIDs.

This fixes a bug where udev rules were created by mistake as crypttab_contains()
returned false for devices specified by path in /etc/crypttab which resulted in
error messages during boot.

Signed-off-by: Julian Wolf <juwolf@suse.de>
2017-06-27 16:43:47 +02:00
Harald Hoyer 9bf5f989ee Merge pull request #242 from lnykryn/classless
network/dhclient-script: also parse dot separated $new_classless_static_routes
2017-06-27 13:27:41 +02:00
Harald Hoyer 940169e8d8 check for CONFIG_ACPI_TABLE_UPGRADE
additionally as for CONFIG_ACPI_INITRD_TABLE_OVERRIDE
config parameter got renamed
2017-06-27 12:29:07 +02:00
Lukas Nykryn 337a55eb2d network/dhclient-script: also parse dot separated $new_classless_static_routes
Previously our dhclient-script expected that $new_classless_static_routes
will have all values separated by a whitespace. But at least on F25
dhclient will put there the destination descriptor in the same format
as it is used by ISC dhcp-server.
For example:
new_classless_static_routes=32.10.198.122.47 192.168.78.4
while our current code expects
new_classless_static_routes=32 10 198 122 47 192 168 78 4

So let's just accept both of these formats by adding "." to IFS.

For details plesse see https://tools.ietf.org/html/rfc3442
"Classless Route Option Format"
2017-06-26 10:12:46 +02:00
Hannes Reinecke c8aa1d949a 95zfcp_rules: simplified rd.zfcp commandline for NPIV
When NPIV is enabled and the allow_lun_scan parameter is set to 'Y'
the HBA will initiate a LUN scan automatically, so there is no need
to specify the WWPN and LUN number manually.

References: bsc#964456

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-06-23 21:27:48 +02:00
Hannes Reinecke 5f923256e3 95zfcp_rules: fix typo in module_setup
module_setup.sh has a typo preventing it from saving the correct
dracut commandline.

References: bnc#887582

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:27:44 +02:00
Hannes Reinecke 5e7bbe43a3 95zfcp_rules: Enable the device before checking device type
For creating dynamic udev rules parse-dasd.sh look for the device
type in sysfs, which of course does not exist if cio_ignore is
active. So first enable the device before checking.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:27:41 +02:00
Hannes Reinecke 3a8ba44026 95zfcp_rules: Store all devices in commandline
'for_each_host_dev_and_slaves' would stop at the first found
device, so the cmdline() call would never list all required
devices. Use 'for_each_host_dev_and_slaves_all' instead and
filter out duplicates.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:27:38 +02:00
Hannes Reinecke e0c3b0793f Fix DASD with SSID greater than 0
bsc#989313

Signed-off-by: Thomas Renninger <trenn@suse.com>
2017-06-23 21:27:07 +02:00
Hannes Reinecke 8b0791fa01 Reset IFS variable
Setting and unsetting the IFS variable is tricky. To be on the
safe side we should always reset the IFS variable to its original
value after parsing.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:27:02 +02:00
Thomas Renninger e5bf1cecd6 95dasd_rules: Install 'collect' udev helper binary
Install the 'collect' udev helper binary for s390-specific rules.

References: bsc#938867

Signed-off-by: Thomas Renninger <trenn@suse.com>
2017-06-23 21:26:57 +02:00
Hannes Reinecke cf9c8c5fe3 95dasd_rules: Enable the device before checking device type
For creating dynamic udev rules parse-dasd.sh look for the device
type in sysfs, which of course does not exist if cio_ignore is
active. So first enable the device before checking.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:26:53 +02:00
Hannes Reinecke 05bf320972 95dasd_rules: Store all devices in commandline
'for_each_host_dev_and_slaves' would stop at the first found
device, so the cmdline() call would never list all required
devices. Use 'for_each_host_dev_and_slaves_all' instead and
filter out duplicates.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:26:49 +02:00
Hannes Reinecke 2600b54c18 Fixup typo 'firmare' instead of 'firmware'
Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:26:46 +02:00
Hannes Reinecke bd355f8643 95dasd_rules: Auto-generate udev rule for ipl device
We should be generating a udev rule for the ipl device; it'll
be enabled anyway.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:26:42 +02:00
Hannes Reinecke 1362641310 95dasd_rules: print out 'rd.dasd' commandline
When a DASD is found to be required for the rootfs we should
be printing out a 'rd.dasd' commandline parameter. This not
only enables us to correctly enable the device with cio_ignore,
we can also inspect the resulting initrd to figure out which
devices are required to mount the rootfs.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:26:39 +02:00
Hannes Reinecke e5d21b80c0 95dasd_rules: fixup rd.dasd parsing
There were some errors when rd.dasd parsing, resulting in the
device never to be activated. And we should check for
cio_ignore even if a udev rules has been found.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:26:36 +02:00
Hannes Reinecke 5d1ea2d726 Correctly set cio_ignore for dynamic s390 rules
When converting 'rd.zfcp' and 'rd.dasd' into udev rules we
need to make sure the enable those device ids via cio_ignore,
otherwise the rules might never be called.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:26:33 +02:00
Hannes Reinecke 856d039ba4 95dasd_rules: enable parsing of rd.dasd= commandline parameter
Dracut documents the 'rd.dasd=' parameter, so we should be
enabling the usage of this parameter, too.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:26:30 +02:00
Hannes Reinecke 55c763b1ff Add new s390x-specific rule files
With the new s390x configuration tool the naming of the udev
rules files have changed. So add these to the existing ones
to be compatible with existing and new installations.

References: bnc#856585

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:26:27 +02:00
Hannes Reinecke c8e531239b 95zfcp_rules: Auto-generate udev rule for ipl device
We should auto-generate an udev rule for the ipl device; it'll be
enabled anyway.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:06:05 +02:00
Hannes Reinecke 624f173cbd 95zfcp_rules: print out rd.zfcp commandline parameter
When called with '--hostonly-cmdline' the module should print
out the configuration.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:06:02 +02:00
Hannes Reinecke 9be4be7aa7 95zfcp_rules: Fixup rd.zfcp parsing
There were some errors when parsing rd.zfcp, causing the device
never to be activated.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:05:59 +02:00
Hannes Reinecke bbca3891ed Correctly set cio_ignore for dynamic s390 rules
When converting 'rd.zfcp' and 'rd.dasd' into udev rules we
need to make sure the enable those device ids via cio_ignore,
otherwise the rules might never be called.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:05:55 +02:00
Harald Hoyer a0d129e33e Merge pull request #239 from lnykryn/cmdline
dracut-lib: put together CMDLINE even if /proc/cmdline does not exist
2017-06-21 16:34:09 +02:00
Lukas Nykryn 0c4c9792c8 dracut-lib: put together CMDLINE even if /proc/cmdline does not exist 2017-06-21 14:14:06 +02:00
Harald Hoyer 6ed9975c5a Merge pull request #238 from danimo/systemd_fix_force_drivers
98dracut-systemd: Fix module force loading with systemd
2017-06-19 13:43:42 +02:00
Harald Hoyer 73e30ea106 Merge pull request #180 from danimo/tests_find_kvm_on_suse
Tests: find qemu on (open)SUSE systems
2017-06-19 13:42:30 +02:00
Daniel Molkentin e3189ab123 98dracut-systemd: Fix module force loading with systemd
This used to work only when specified via the command line
or if systemd was not being used. However, the exisistence of
20_force_driver.conf also requires dracut-pre-udev.service
to be run.

Reference: bsc#986216
2017-06-16 16:58:12 +02:00
Harald Hoyer cf9a4e0c73 network: fix dhcp classless_static_routes
removed copy&paste artifact "modify_routes add"

there is no modify_routes() function, and we simply want the output
of the parse function.

(cherry picked from commit 33710dfbfc)
2017-06-14 15:22:18 +02:00
Harald Hoyer 08e51654bf Merge pull request #237 from lnykryn/fips-cmac
fips: add cmac kernel module
2017-06-14 14:40:08 +02:00
Lukas Nykryn 63c7b358f5 fips: add cmac kernel module
cmac is now marked as fips_allowed

Resolves: rhbz#1460865
2017-06-13 10:29:54 +02:00
Harald Hoyer 70ce5ea256 Merge pull request #235 from lnykryn/tmpfiles
systemd: include systemd-tmpfiles-setup.service
2017-06-09 14:08:48 +02:00
Lukas Nykryn a0e3794b2a systemd: include systemd-tmpfiles-setup.service
... because otherwise nothing will actually
apply configuration from tmpfiles snippets
2017-06-08 15:06:34 +02:00
Prarit Bhargava fd24c90c36 module-setup.sh: Add ARM specific driver to initramfs image
If a hisi_sas storage device is used as / during system install, the
resulting installation will not boot because the hisi_sas driver is not
included in the initramfs.

The Hisilicon storage driver needs to be added to the initramfs image for
aarch64 kernels.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: dzickus@redhat.com
Cc: dmarlin@redhat.com
Cc: wefu@redhat.com
Cc: harald@redhat.com
2017-06-06 13:39:43 +02:00
Harald Hoyer 1856ae95c8 handle rpcbind /run/rpcbind directory 2017-06-06 13:38:29 +02:00
Yu Watanabe b71d162a7a kernel-install: Skip to create initrd if /etc/machine-id is missing or empty
From systemd-234, kernel-install plugins are called even if /etc/machine-id
is missing or empty, and in that case BOOT_DIR_ABS is a fake directory.
So, let's skip to create initrd in that case.
2017-06-02 18:07:25 +09:00
Harald Hoyer 3cea065819 mdraid: wait for rd.md.uuid specified devices to be assembled
This patch uses wait_for_dev "/dev/disk/by-id/md-uuid-${uuid}" for the
specified uuids.

On timeout only md devices are force started which are specified by
uuid, or all, if rd.auto was specified.

Fixes https://github.com/dracutdevs/dracut/issues/227
2017-05-16 11:37:27 +02:00
Harald Hoyer 87ddd4d9af Merge pull request #213 from danimo/elfutils
Make binutils optional when elfutils are available
2017-05-15 14:53:35 +02:00
Harald Hoyer 1e00295a15 Merge pull request #229 from jwrdegoede/master
drm: Install pwm modules on all architectures
2017-05-15 11:37:45 +02:00
Harald Hoyer b40585e6c7 Merge pull request #226 from AdamWill/curl-nssckbi
Handle curl using libnssckbi for TLS (RHBZ #1447777)
2017-05-15 11:28:10 +02:00
Hans de Goede feaaee4278 drm: Install pwm modules on all architectures
At least on x86 on Bay and Cherry Trail devices the pmw-lpss modules must
be in the initrd too, otherwise the i915 driver will still load, but
it will report the following error:

[drm:pwm_setup_backlight [i915]] *ERROR* Failed to own the pwm chip

And not register /sys/class/backlight/intel_backlight and users will
not be able to control their backlight.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2017-05-14 23:24:46 +02:00
Adam Williamson 892b1fe6b7 Handle curl using libnssckbi for TLS (RHBZ #1447777)
curl in Fedora recently changed its default CA trust store. The
Fedora package no longer specifies an OpenSSL-format bundle file
during build, and curl itself has been patched to use an NSS
plugin called libnssckbi.so when no bundle file or directory is
specified. There are (at present) two possible providers of the
libnssckbi.so module: the original NSS implementation, which
uses a trust bundle built in at build time, and a compatible
implementation from the p11-kit project, which reads a trust
bundle at run time. So if we find a string in libcurl.so that
suggests libnssckbi might be in use, we must both install it and
make an effort to install any trust bundle files it may use.

The p11-kit libnssckbi implementation does include a string that
lists the top-level trust directories it will use, so we try to
find that string, though the best effort I can come up with will
also find many false positives too. To weed out the false
positives, we check whether the matches actually exist as dirs,
and if so, whether they contain some specific subdirectories we
know p11-kit trust dirs must have (thanks, @kaie). For the NSS
libnssckbi implementation, we will likely wind up not finding any
dirs that match the requirements, so we will simply install the
libnssckbi.so file itself, which is the correct action.

This fixes TLS transactions in the initramfs environment when
using a curl that's built this new way; it's significant for
use of kickstarts and update images with the Fedora / RHEL
installer, as these are retrieved in the initramfs environment,
and are frequently retrieved via HTTPS.
2017-05-11 10:13:22 -07:00
Harald Hoyer 2e1861fde2 Merge pull request #224 from jasondana/integrity-fix
Check the proper variable for a custom IMA keys directory
2017-04-27 14:08:47 +02:00
Jason Dana ab66ef2d4a Check the proper variable for a custom IMA keys directory 2017-04-27 07:55:58 -04:00
Bryn M. Reeves cc4e507322 lvm_scan.sh: use -K when calling lvchange
The --ignoreactivationskip/-K switch was added to LVM2 in 2.02.99
(July 2013) and is used to control the activation of volumes with
the activation skip flag set: without -K these volumes will be
ignored when 'lvchange -ay $LV' is issued.

This prevents an LVM2 thin-privisioned snapshot from being used
as the root device when booting with rd.lvm.lv=vg/lv since the
activation skip flag is set for these snapshots by default (the
legacy non-thinp snapshots do not set this flag and can already
be activated and used as a root device by specifying appropriate
values for rd.lvm.lv).

This is only used in the rd.lvm.lv case since in that situation
we are activating one or more named LVs specified by the user:
the flag is not given when calling 'vgchange' since this may
cause many unwanted volumes to be activated during early user
space. Users wishing to use a specific snapshot volume should
specify it with 'rd.lvm.lv'.
2017-04-26 14:15:15 +01:00
Harald Hoyer 29fd71b23d TEST-50-MULTINIC: fix bridge test
Bridge with nics on a different vlan, otherwise we will see:

[  117.750825] bridge0: received packet on ens5 with own address as source address
2017-04-26 09:39:20 +02:00
Harald Hoyer bc6f06a795 Merge pull request #222 from danimo/fix_subnet_calc
mkinitrd-suse.sh: Fix prefix calculation
2017-04-26 09:22:19 +02:00
Daniel Molkentin 7cf2c21798 mkinitrd-suse.sh: Fix prefix calculation
The previous algorithm was incorrect and would return
incorrect results e.g. for a /20 mask. Also gets rid
of an undocumented depencency on bc(1).

Reference: bsc#1035743
2017-04-25 15:30:13 +02:00
Harald Hoyer 11947da13f Merge pull request #219 from tpgxyz/master
fix build with KMOD
2017-04-25 10:51:39 +02:00
Tomasz Paweł Gajc f59548aeab fix build with KMOD 2017-04-24 21:37:56 +02:00
Harald Hoyer fafb4c0182 Merge pull request #210 from Calrama/gpg-smartcard
crypt-gpg: For GnuPG >= 2.1 support gpg keyfile decryption via a OpenPGP smartcard in a CCID reader
2017-04-19 09:09:14 +02:00
Harald Hoyer 0096157e14 Merge pull request #214 from pallotron/master
Look for IPv6 RA in wait_for_ipv6_dad, wait_for_ipv6_dad_link and wait_for_ipv6_auto
2017-04-11 13:40:27 +02:00
Harald Hoyer 9998940493 Merge pull request #217 from FGrose/overlayfs
dmsquash-live-root: Avoid mount source conflict on $BASE_LOOPDEV.
2017-04-11 13:39:27 +02:00
Harald Hoyer 538ff0fd80 add .mailmap 2017-04-10 14:50:21 +02:00
Daniel Molkentin 8b6d136e62 Make binutils optional when elfutils are available
This is intended for minimum host OSes where 36 MB used by binutils
are deemed too expensive. We only need "strip", which exists as eu-strip
in elfutils, which in turn is < 1 MB in size.

Note that the tests (TEST-04-FULL-SYSTEMD/test.sh) still depend on
strip from binutils. It could use sstrip in the future.
2017-04-10 11:28:04 +02:00
Frederick Grose ea765c0ee1 dmsquash-live-root: Avoid mount source conflict on $BASE_LOOPDEV.
The newer mount utilities are more strict about directly shared
devices. For OverlayFS boots, which mount $BASE_LOOPDEV directly,
avoid a mount error by indirectly sharing the read-only base
filesystem through a second, over-attached $BASE_LOOPDEV for
the DM live-base target.
2017-04-09 11:23:12 -04:00
pallotron e190073b21 Merge remote-tracking branch 'upstream/master' 2017-04-05 11:59:36 -07:00
Daniel Molkentin ce999bff98 Tests: find qemu on (open)SUSE systems 2017-04-05 16:42:22 +02:00
pallotron 031e2f7bb8 more ipv6 improvements 2017-04-05 00:23:36 -07:00
pallotron a0545765e8 remove prints 2017-04-05 00:16:16 -07:00
pallotron 96b708e178 more ipv6 improvements 2017-04-05 00:15:16 -07:00
pallotron 4c3d99f966 enabling some ipv6 config before running wait_for_ipv6_dad 2017-04-04 12:59:45 -07:00
pallotron c603419030 wait for IPv6 RA if using none/static IPv6 assignment 2017-04-04 08:31:21 -07:00
Harald Hoyer 39c9b67f86 NEWS and AUTHORS update 2017-04-03 10:26:25 +02:00
Harald Hoyer 685d8619d0 Merge pull request #212 from pallotron/master
remove $$arch() from rpm target in Makefile
2017-03-31 14:22:13 +02:00
pallotron 15d103f911 better fix from @haraldh 2017-03-31 04:43:08 -07:00
Harald Hoyer a63cc421a5 Merge pull request #211 from Calrama/embedded-keyfile
crypt: Support keyfiles embedded in the initramfs
2017-03-31 11:41:19 +02:00
Moritz Maxeiner b4cf58f038 crypt: Fix indentation for embedded keyfile 2017-03-30 15:06:01 +02:00
Moritz Maxeiner 0e1b686b83 crypt-gpg: Include module if CCID smartcard support requested 2017-03-30 14:54:26 +02:00
pallotron a99bbe8fa8 remove $$arch() from rpm target in Makefile 2017-03-30 05:53:36 -07:00
Moritz Maxeiner 0982fcb2e5 crypt-gpg: Rework setup for CCID smartcard support 2017-03-30 14:17:05 +02:00
Harald Hoyer f0bfada399 dracut.sh: strip NUL bytes in stream before push in string
seems like bash-4.4 does not like NUL bytes in variables
2017-03-30 12:52:11 +02:00
Harald Hoyer 041e49ee2a network: enhance team support
Install ifcfg-* files with team configuration in the initramfs.

Improve the slave configuration of the team interface, by looking up
ifcfg files in the initramfs.

Create a default loadbalance team config, if none present in the
initramfs.

forward port of
4c88c2859e
2017-03-30 11:50:35 +02:00
Harald Hoyer 811a070d6c network: differ between ipv6 local and global tentative
For dhcpv6, only a non-tentative scope local address is needed.

(cherry picked from commit 42dd8928a8)
2017-03-30 11:34:51 +02:00
Harald Hoyer 5401d1f86f network:wait_for_ipv6_auto() wait for all tentative addresses
(cherry picked from commit 13264563a9)
2017-03-30 11:34:51 +02:00
Harald Hoyer e8dc8c4d89 network/net-lib.sh: auto6 wait for route ra
Wait for a router advertised route

(cherry picked from commit 6d22a6860e)
2017-03-30 11:34:51 +02:00
Harald Hoyer 65960fda7e dracut.cmdline.7.asc: document bond mtu option 2017-03-30 11:14:46 +02:00
Harald Hoyer 25895a7769 Merge pull request #129 from imran1008/bond-mtu
add 'mtu' parameter for bond options
2017-03-30 11:03:04 +02:00
Harald Hoyer 144a3d85d0 Merge pull request #162 from dracut-mailing-devs/20160607094008.21012-1-colin@mageia.org
systemd: add more groups to deal with tmpfiles handling.
2017-03-30 11:01:55 +02:00
Harald Hoyer e6390b5a70 Merge pull request #163 from dracut-mailing-devs/1711921.0d4JtWs6XN@linux-lm3i.site
Fix wrong keymap inclusion
2017-03-30 11:01:22 +02:00
Harald Hoyer c1cec35469 Merge pull request #164 from dracut-mailing-devs/1467648310-27834-1-git-send-email-pbrobinson@gmail.com
modules: kernel: add phy and power modules to generic initrd
2017-03-30 11:00:36 +02:00
Harald Hoyer 8078a9c8ea Merge pull request #165 from dracut-mailing-devs/1476286367-30606-1-git-send-email-chad.dupuis@cavium.com
fcoe: Allow more time for the bnx2x link negotiation before brining u…
2017-03-30 11:00:00 +02:00
Harald Hoyer 2931eaa800 Merge pull request #176 from danimo/pinctrl-cherryview
Always try to add pinctrl-cherryview
2017-03-30 10:59:18 +02:00
Harald Hoyer 1f1aa43573 Merge branch 'FGrose-overlayfs' 2017-03-30 10:55:17 +02:00
Harald Hoyer 1dd68c2f23 Merge branch 'overlayfs' of https://github.com/FGrose/dracut into FGrose-overlayfs 2017-03-30 10:53:22 +02:00
Harald Hoyer 1d75490767 Merge pull request #177 from danimo/mkinitrd-suse_fixes
mkinitrd-suse.sh: Resolve symbolic links for -i and -k parameters (bsc#902375)
2017-03-30 10:50:41 +02:00
Harald Hoyer ca6be905f0 Merge pull request #178 from danimo/cifs_ntlm_auth
Add md4 and arc4 modules for ntlm
2017-03-30 10:50:16 +02:00
Harald Hoyer 67ae4f20b8 Merge pull request #185 from ldzhong/bsc1012656
man: make the -k option clear using mkinitrd
2017-03-30 10:46:07 +02:00
Harald Hoyer b2f751db04 Merge pull request #198 from danimo/degraded_md_raid
Allow booting from degraded MD RAID arrays
2017-03-30 10:30:19 +02:00
Harald Hoyer 6eb80b3278 Merge branch 'master' of github.com:dracutdevs/dracut 2017-03-30 10:15:22 +02:00
Harald Hoyer a1ba30cf4f Merge branch 'danimo-remove-test-dependencies' 2017-03-30 10:14:08 +02:00
Harald Hoyer 0042f2568d Merge branch 'remove-test-dependencies' of https://github.com/danimo/dracut into danimo-remove-test-dependencies 2017-03-30 09:21:50 +02:00
Harald Hoyer b0d6254dad TEST: redirect server output to server.log if $SERIAL empty 2017-03-30 09:04:02 +02:00
Harald Hoyer f3f37f3cce TEST: new rpcbind needs /run/rpcbind 2017-03-30 09:03:31 +02:00
Harald Hoyer 9ae7ed1a1d Merge pull request #209 from nullr0ute/aarch64-fixes
Aarch64 fixes
2017-03-30 08:56:19 +02:00
Harald Hoyer e1171941c2 TEST-70-BONDBRIDGETEAMVLAN: remove qemu -kernel parameter
'run-qemu' takes care of finding the kernel image
2017-03-30 08:34:57 +02:00
Moritz Maxeiner 98047e08d0 crypt-gpg: Add README describing the procedure of moving from
password-only gpg keyfile to password/smartcard gpg keyfile
2017-03-30 02:18:39 +02:00
Moritz Maxeiner 2a1723ed83 crypt-gpg: For GnuPG >= 2.1 support OpenPGP smartcards 2017-03-30 02:18:39 +02:00
Moritz Maxeiner 1fc68b989d crypt: Support keyfiles embedded in the initrd
For rd.luks.key=keypath:keydev:luksdev, keydev being '/' will
assume the initrd contains the keyfile.
2017-03-30 02:14:31 +02:00
Peter Robinson 917e1b6b5b Add check for aarch64 to the arm kernel module list
This adds the same list of drivers we use for arm platforms for
aarch64 too, also add the DMA drivers there too as they can add
sigficant performance for some storage/usb and often need to be
present when the storage drivers load.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-03-23 14:59:15 +00:00
Peter Robinson eec49634d4 Add aarch64 to drm modules along side ARM
Add aarch64 to modules, also update the drivers checked for latest
kernel changes.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-03-23 14:51:48 +00:00
Harald Hoyer bd4aa25741 Merge pull request #199 from lnykryn/bz1416958
ifup: don't ifup team master indefinitely
2017-03-21 13:33:41 +01:00
Harald Hoyer 7a44fea98c Merge pull request #201 from lnykryn/bz1415004
network/ifup: write override file before dhcp_do
2017-03-21 13:33:20 +01:00
Harald Hoyer 53475faa81 Correct path for UEFI stub
respect any $prefix given to the systemd installation

https://github.com/dracutdevs/dracut/pull/196
2017-03-20 11:43:04 +01:00
Harald Hoyer 6a6c09e33c Merge pull request #204 from lnykryn/mtu
write-ifcfg: do't write MTU twice for regular eth devices
2017-03-15 10:46:35 +01:00
Harald Hoyer 4efe015bfb Merge pull request #206 from mwilck/master
dracut-init.sh: fix typo
2017-03-15 10:45:38 +01:00
Frederick Grose 3c6337f68e dmsquash-live-root: Extend rd.live.overlay.readonly support
Support the rd.live.overlay.readonly option for writable images,
such as rd.live.overlay=none and rd.writable.fsimg.
2017-03-11 19:14:26 -05:00
Frederick Grose f1b65e92af dmsquash-live-root: Provide enhanced feedback on missing overlay.
Provide a more prominent alert to the user if an overlay is
missing or the overlay module is not available and a temporary
overlay will be provided.  This, to avoid losing data intended to
persist.
2017-03-11 00:43:05 -05:00
Frederick Grose ea28824027 Enable the use of the OverlayFS for the LiveOS root filesystem.
Integrate the option to use an OverlayFS as the root filesystem
into the 90dmsquash-live module for testing purposes.

The rd.live.overlay.overlayfs option allows one to request an
OverlayFS overlay.  If a persistent overlay is detected at the
standard LiveOS path, the overlay & type detected will be used.

Tested primarily with transient, in-RAM overlay boots on vfat-
formatted Live USB devices, with persistent overlay directories
on ext4-formatted Live USB devices, and with embedded, persistent
overlay directories on vfat-formatted devices. (Persistent overlay
directories on a vfat-formatted device must be in an embedded
filesystem that supports the creation of trusted.* extended
attributes, and must provide valid d_type in readdir responses.)

The rd.live.overlay.readonly option, which allows a persistent
overlayfs to be mounted read only through a higher level transient
overlay directory, has been implemented through the multiple lower
layers feature of OverlayFS.

The default transient DM overlay size has been adjusted up to 32 GiB.
This change supports comparison of transient Device-mapper vs.
transient OverlayFS overlay performance.  A transient DM overlay
is a sparse file in memory, so this setting does not consume more
RAM for legacy applications.  It does permit a user to use all of
the available root filesystem storage, and fails gently when it is
consumed, as the available free root filesystem storage on a typical
LiveOS build is only a few GiB.  Thus, when booted on other-
than-small RAM systems, the transient DM overlay should not overflow.

OverlayFS offers the potential to use all of the available free RAM
or all of the available free disc storage (on non-vfat-devices)
in its overlay, even beyond the root filesystem available space,
because the OverlayFS root filesystem is a union of directories on
two different partitions.

This patch also cleans up some message spew at shutdown, shortens
the execution path in a couple of places, and uses persistent
DM targets where required.

Documentation is updated for these changes.
2017-03-11 00:42:19 -05:00
Martin Wilck d13071d7a6 dracut-init.sh: fix typo 2017-03-09 21:57:27 +01:00
Cristian Rodriguez ccf948f2ab systemd 233 requires sha256, hmac and algif_hash modules 2017-03-03 15:01:56 +01:00
Lukas Nykryn 196bb03477 write-ifcfg: do't write MTU twice for regular eth devices
If MTU is specified, we write it for every type of device in the
beginning. There is not point writing it again for Type=ethernet
devices.
2017-03-01 14:46:12 +01:00
Daniel Molkentin 285495814b Drop dependency on bridge-utils 2017-02-14 14:10:24 +01:00
Daniel Molkentin fd79054610 net-tools are not required anymore
Also bridge-utils was listed twice in README.testsuite.
2017-02-13 18:32:18 +01:00
Lukas Nykryn 73fb5e769b network/ifup: write override file before dhcp_do
Commit cf376023e6 moved writing .resolv.conf and .override
after dhcp_do, because dhcp_do was overwriting .resolv.conf. But .override does not have
such problem and on the contrary dhcp_do reads .override file if it is present. So let\'s
move it back.

https://bugzilla.redhat.com/show_bug.cgi?id=1415004
2017-02-07 17:09:41 +01:00
Harald Hoyer 37a2343509 Merge pull request #200 from nullr0ute/modules-generic-fixes
Some fixes for ARM hardware generic host initrd generation
2017-02-07 12:20:11 +01:00
Peter Robinson 0c5e5f271b modules: kernel: add more usb controller modules
There's a number of usb controllers that are common yet aren't
contained in the host directory. Include these for generic host.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-02-07 10:06:53 +00:00
Peter Robinson e752d42de9 modules: kernel: add phy and power modules to generic initrd
The phy and power modules are needed by some of the recent ARM
devices that have appeared like CHIP and some exynos devices.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-02-03 10:24:30 +00:00
Lukas Nykryn 6ed73e37f2 ifup: don't ifup team master indefinitely
https://bugzilla.redhat.com/show_bug.cgi?id=1416958
Thanks to martin.moore@hpe.com for the patch
2017-02-02 13:02:10 +01:00
Daniel Molkentin f1c790495b Allow booting from degraded MD RAID arrays
bnc#1017695
2017-01-30 11:29:08 +01:00
Harald Hoyer 4693daa5fa fips: honor $BOOT_IMAGE variable for HMAC check of the kernel
https://bugzilla.redhat.com/show_bug.cgi?id=1415032
2017-01-30 09:25:41 +01:00
Harald Hoyer 7c29d205f4 fips: use /lib/modules/$(uname -r)/modules.fips
if /lib/modules/$(uname -r)/modules.fips exists, use that list instead
of the hardcoded dracut module list.
2017-01-25 16:39:09 +01:00
Harald Hoyer 35bf607087 Merge pull request #197 from danimo/update-gitignore
Ignore more generated files
2017-01-25 14:55:08 +01:00
Daniel Molkentin d8a01fea33 Ignore more generated files
Also fixes ignores after systemd module split
2017-01-25 13:27:05 +01:00
Harald Hoyer a9f04fcc4a NEWS: update for 045 2017-01-19 13:52:33 +01:00
Harald Hoyer 4e669086a3 test: add TEST-70-BONDBRIDGETEAMVLAN 2017-01-18 16:26:58 +01:00
Harald Hoyer bdd626059c test/run-qemu: make "-cpu host" the default 2017-01-18 16:26:30 +01:00
Harald Hoyer 043d8f401b ifcfg/write-ifcfg.sh: write DEVICE=$netif for VLAN
VLAN interface configuration is not bound by HWADDR but by DEVICE
2017-01-18 16:23:45 +01:00
Harald Hoyer 05c2080e51 base/dracut-lib.sh: fixup trim()
no "--"
2017-01-18 16:22:26 +01:00
Harald Hoyer e7838a8312 network: fixup VLAN handling 2017-01-18 15:16:01 +01:00
Harald Hoyer dec4b2cdd4 base/dracut-lib.sh:trim() replace 'echo -n' 2017-01-18 15:15:23 +01:00
Harald Hoyer 2bd8b227de nfs: add chmod 2017-01-18 15:15:06 +01:00
Harald Hoyer 2949dcba29 base/dracut-lib.sh: add trim()
trim() to remove leading and trailing whitespace

(cherry picked from commit ac422d577c)
2017-01-18 13:29:32 +01:00
Harald Hoyer 0cf826a11a network: fix vlan handling 2017-01-18 13:28:47 +01:00
Harald Hoyer a1595cf5f9 network: parse multiple vlan parameters 2017-01-18 13:15:18 +01:00
Harald Hoyer 6aec6a7e2f network/net-genrules.sh: generate rules for all interfaces
previously, if "rd.neednet" and bond was specified, only the bond
interface was configured.

https://bugzilla.redhat.com/show_bug.cgi?id=1282680
(cherry picked from commit e6ae0c6128)
2017-01-18 13:15:18 +01:00
Harald Hoyer 647b521fc7 dracut: check for EUID instead of UID 2017-01-18 11:04:36 +01:00
Harald Hoyer 076fcd1652 dracut: only copy xattr, if root
otherwise cp complains a lot about not being able to copy xattrs
2017-01-18 10:38:00 +01:00
Harald Hoyer 83a6d6f928 dracut.sh: add /dev/random and /dev/urandom to static device nodes
otherwise libgcrypt might complain

https://bugzilla.redhat.com/show_bug.cgi?id=1401444
2017-01-18 10:37:10 +01:00
Harald Hoyer 8a32bf6107 dracut: unset LC_* after setting LANG and LC_ALL
otherwise bash/glibc might complain verbosely about not finding locales
2017-01-18 10:35:41 +01:00
Harald Hoyer 1d832b4bf4 fips: precreate /dev/random /dev/urandom
otherwise libgcrypt might be unhappy, if used before devtmpfs is mounted

https://bugzilla.redhat.com/show_bug.cgi?id=1401444
2017-01-18 10:34:00 +01:00
Harald Hoyer 5ebf48d2ba nfs: dynamically chown /var/lib/rpcbind 2017-01-18 10:33:09 +01:00
Harald Hoyer be5025bf55 dracut-install: install kernel modules to /lib/modules/$kernelversion
Specifying a different kernel module directory with --kmoddir would
result in the same directory being the destination directory.

Strip everything before the "/lib/modules" for the destination dir.

https://github.com/dracutdevs/dracut/issues/194
2017-01-16 14:27:39 +01:00
Harald Hoyer 7e51a94f5b Do not "cp" the selinux context
replace "cp -a" with $DRACUT_CP, so in case the selinux policy disallows
root to set the selinux context in /var/tmp, dracut does not fail.
2017-01-16 14:27:39 +01:00
Harald Hoyer 73b9eaab1d crypt: with systemd cryptsetup is not needed 2017-01-16 14:27:39 +01:00
Harald Hoyer f13278eac2 TEST-99-RPM: fix installation loop 2017-01-16 14:27:39 +01:00
Harald Hoyer 5c57209ba5 dracut.sh: add default path for --uefi
The default output filename for --uefi is
<EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi.
<EFI> might be /efi, /boot or /boot/efi depending on where the ESP partition
is mounted. The <BUILD_ID> is taken from BUILD_ID in /usr/lib/os-release or
if it exists /etc/os-release and is left out, if BUILD_ID is non-existant or
empty.

Also a new option --no-machineid was added, which affects the default output
filename of --uefi and will discard the <MACHINE_ID> part.
2017-01-16 14:27:39 +01:00
Harald Hoyer 2870b7d243 .dir-locals.el: changed to sane style 2017-01-16 14:27:39 +01:00
Harald Hoyer 33a5586cae test/Makefile: proper return code for "make check"
(cherry picked from commit aa40b82145)
2017-01-16 14:27:39 +01:00
Harald Hoyer ffc2ca202b TEST-99-RPM: retry dnf 5 times in case http fails 2017-01-16 14:27:39 +01:00
Harald Hoyer a6229a8f9a Merge pull request #193 from dsilakov/master
Support multiple default gateways from DHCP server (rhbz#1408249)
2017-01-16 14:12:36 +01:00
Denis Silakov 727e2a1d9d Make gateway processing POSIX-compliant 2017-01-13 18:44:40 +03:00
Harald Hoyer 0676c1e0d0 Merge pull request #192 from dkg/doc-fixup
Doc fixup
2017-01-09 11:58:32 +01:00
Denis Silakov b2f6409a22 Support multiple default gateways from DHCP server (rhbz#1408249) 2017-01-09 12:55:10 +03:00
Harald Hoyer 39c725dc4e Merge pull request #157 from ddiss/fix_relative_tmpdir
dracut.sh: support --tmpdir as a relative path
2017-01-09 10:42:40 +01:00
Daniel Kahn Gillmor 85c8217db0 docs: override is not the same as overwrite!
Some docs claimed that values in certain config files would be
overwritten, when they would actually be overridden.

Override: a file is not modified but its contents are superseded by
          something else.  (configurations set in
          /etc/dracut.conf.d/*.conf override configurations set in
          /etc/dracut.conf)

Overwrite: a file is modified or its contents replaced by an action
           (use dracut --force to overwrite the existing initramfs)
2017-01-03 10:08:18 -05:00
Daniel Kahn Gillmor f2c423651b dracut.modules.7.asc: correct filename parse-instmodpost.sh in documentation 2017-01-03 10:06:38 -05:00
Harald Hoyer a35fab2cf1 Merge pull request #186 from xlpang/workspace
Introduce "rd.memdebug=4" to test kernel module memory consumption
2016-12-05 09:29:57 +01:00
Lidong Zhong 4a739be99c man: make the -k option clear using mkinitrd
For example under x86, someone maybe missunderstand that the vmlinuz
is the link /boot/vmlinuz points to a specific kernel image and use
the following command directly.

    mkinitrd -k vmlinuz
2016-12-02 14:32:09 +08:00
Harald Hoyer d4793cdbdb Merge pull request #184 from jesa7955/fix_ssh_issue
95ssh-client: attempt to copy UserKnownHostsFile to kdump's initramfs
2016-11-30 13:28:36 +01:00
Tong Li 32f5af2f5e 95ssh-client: attempt to copy UserKnownHostsFile to kdump's initramfs
Bug related to this issue: https://bugzilla.redhat.com/show_bug.cgi?id=1360131
Now dracut only attempts to copy GlobalKnownHostsFile while generating kdump's
initramfs. This method will cause kdump's failure if users set customized
UserKnownHostsFile in /etc/ssh/ssh_config. This patch simply attempts to copy
those files too while going through /etc/ssh/ssh_config. Note that we need to
make sure ~/foo will be copied as /root/foo in kdump's initramfs.
2016-11-30 17:05:57 +08:00
Xunlei Pang 01030beda2 testsuite: add "rd.memdebug=4" in TEST-01-BASIC to test rd.memdebug
"rd.memdebug=4" includes all the test level, so add it to test
rd.memdebug function.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2016-11-27 12:21:02 +08:00
Xunlei Pang 7a5949ffcd dracut.cmdline.7.asc: update document for rd.memdebug=4
"rd.memdebug=4" is for kernel module memory consumption debugging.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2016-11-27 12:09:10 +08:00
Xunlei Pang 52c295c161 99base: apply kernel module memory debug support
Extend "rd.memdebug" to "4", and "make_trace_mem" to "4+:komem".
Add new "cleanup_trace_mem" to cleanup the trace if active.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2016-11-27 12:09:10 +08:00
Xunlei Pang 34986d538a 99base: add memtrace-ko.sh to debug kernel module large memory consumption
The current method for memory debug is to use "rd.memdebug=[0-3]",
it is not enough for debugging kernel modules. For example, when we
want to find out which kernel module consumes a large amount of memory,
"rd.memdebug=[0-3]" won't help too much.

A better way is needed to achieve this requirement, this is useful for
kdump OOM debugging.

The principle of this patch is to use kernel trace to track slab and
buddy allocation calls during kernel module loading(module_init), thus
we can analyze all the trace data and get the total memory consumption.
As for large slab allocation, it will probably fall into buddy allocation,
thus tracing "mm_page_alloc" alone should be enough for the purpose(this
saves quite some trace buffer memory, also large free is quite unlikey
during module loading, we neglect those memory free events).

The trace events include memory calls under "tracing/events/":
  kmem/mm_page_alloc

We also inpect the following events to detect the module loading:
  module/module_load
  module/module_put

Since we use filters to trace events, the final trace data size won't
be too big. Users can adjust the trace buffer size via "trace_buf_size"
kernel boot command line as needed.

We can get the module name and task pid from "module_load" event which
also mark the beginning of the loading, and module_put called by the
same task pid implies the end of the loading. So the memory events
recorded in between by the same task pid are consumed by this module
during loading(i.e. modprobe or module_init()).

With these information, we can record the rough total memory(the larger,
the more precise the result will be) consumption involved by each kernel
module loading.

Thus we introduce this shell script to find out which kernel module
consumes a large amount of memory during loading. Use "rd.memdebug=4"
as the tigger.

After applying this patch and specifying "rd.memdebug=4", during booting
it will print out something extra like below:
0 pages consumed by "pata_acpi"
0 pages consumed by "ata_generic"
1 pages consumed by "drm"
0 pages consumed by "ttm"
0 pages consumed by "drm_kms_helper"
835 pages consumed by "qxl"
0 pages consumed by "mii"
6 pages consumed by "8139cp"
0 pages consumed by "virtio"
0 pages consumed by "virtio_ring"
9 pages consumed by "virtio_pci"
1 pages consumed by "8139too"
0 pages consumed by "serio_raw"
0 pages consumed by "crc32c_intel"
199 pages consumed by "virtio_console"
0 pages consumed by "libcrc32c"
9 pages consumed by "xfs"

From the print, we see clearly that "qxl" consumed the most memory.

This file will be installed as a separate executable named "tracekomem"
in the following patch.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2016-11-27 12:09:10 +08:00
Daniel Molkentin e69da98de1 Add md4 and arc4 modules for ntlm
Some crashkernel targets still use legacy NTLM auth, which
require those (bsc#869496). This patch enumerates all dependent
hash algorithems, because even though most of them are probably
compiled in, older ones (e.g. md4 and arc4) usually aren't.
2016-11-17 16:56:53 +01:00
Daniel Molkentin 7957bd01b0 Resolve symbolic links for -i and -k parameters (bsc#902375) 2016-11-17 16:34:20 +01:00
Daniel Molkentin 9ffab3f3a5 Always try to add pinctrl-cherryview
Contrary to previous intel pinctrl drivers, the cherryview driver can be
and usually is built as a module. However, it sets up the SDIO pinout
so sdhci can make use of the SD card reader, which may subsequently
hold a root file system on a card  (bsc#998440).
2016-11-15 11:59:05 +01:00
Harald Hoyer cc81672cef Merge pull request #161 from dracut-mailing-devs/1477422589-21327-1-git-send-email-stefanb@linux.vnet.ibm.com
dracut-install: preserve extended attributes when copying files
2016-11-15 10:41:31 +01:00
Harald Hoyer aa6885fbaf Merge pull request #174 from haraldh/master
testsuite: add "-cpu host" to kvm call
2016-11-14 16:35:13 +01:00
Harald Hoyer beaddf6881 Merge pull request #173 from danimo/xennet
network: Try to load xennet
2016-11-14 16:34:30 +01:00
Harald Hoyer dfb3db3dad testsuite: add "-cpu host" to kvm call 2016-11-14 16:21:06 +01:00
Harald Hoyer 43adba3a71 README.md: change centosci badge 2016-11-14 13:51:59 +01:00
Harald Hoyer e63ac4433a test/test-rhel-7.2.rpms: remove file 2016-11-14 12:30:52 +01:00
Harald Hoyer d941f0e015 Revert "TEST-99-RPM: use --best and install all rpms"
This reverts commit f81806db20.
2016-11-14 12:29:12 +01:00
Harald Hoyer f81806db20 TEST-99-RPM: use --best and install all rpms 2016-11-14 12:27:33 +01:00
Harald Hoyer f0c9ae4d36 README.md: add CentOS badge 2016-11-14 12:27:11 +01:00
Harald Hoyer e35d1451f5 test/TEST-99-RPM: dnf does not like any dracut subpackage 2016-11-11 16:34:42 +01:00
Harald Hoyer eac751f1e0 test/TEST-99-RPM: speedup test 2016-11-11 16:04:31 +01:00
Harald Hoyer e80ac43710 dracut.spec: add systemd-udev requirement 2016-11-11 16:04:09 +01:00
Thomas Renninger b1a39dbcc2 network: Try to load xennet
This makes dracut boot from NFS in a xen instance.

bnc#896464, bnc#896259

Signed-off-by: Thomas Renninger <trenn@suse.de>
2016-11-10 16:05:58 +01:00
Harald Hoyer 0eb7a7c479 README.testsuite: add dmraid 2016-11-10 10:56:06 +01:00
Harald Hoyer 924a669a1b TEST-99-RPM: append "/" to DESTDIR 2016-11-07 17:52:52 +01:00
Harald Hoyer 6ee83a0bd1 Makefile: fixed DESTDIR in rpm target 2016-11-07 17:52:09 +01:00
Harald Hoyer 93d7b95ad4 TEST-30-ISCSI: give server more time for the head start 2016-11-07 17:22:08 +01:00
Harald Hoyer caa6d12fd7 README.testsuite: add more requirements 2016-11-07 17:20:43 +01:00
Harald Hoyer ffcbde7fe2 TEST-99-RPM: set release version and disable update-testing repo 2016-11-07 17:20:18 +01:00
Harald Hoyer 44766d1f1f TEST-99-RPM: actually use the generated rpms with dnf 2016-11-07 17:05:28 +01:00
Harald Hoyer 86f0904004 TEST-30-ISCSI: fixed dhcpd.conf and disabled nowait 2016-11-07 13:23:39 +01:00
Harald Hoyer e22e04ae15 TEST-99-RPM: add test_check() for rpm,dnf,yum 2016-11-07 13:20:35 +01:00
Harald Hoyer 2811e4ed22 TEST-99-RPM: create dracut rpms to install first
create rpms in TESTDIR first
2016-11-07 13:15:56 +01:00
Harald Hoyer 5d274f9365 Makefile: create rpms in DESTDIR for target rpm 2016-11-07 13:14:49 +01:00
Zbigniew Jędrzejewski-Szmek 4dbb4dc5bc Use versioned Obsoletes
Also change <= N to < N+1. For example, dracut-029-1 > dracut-029, so would not
get obsoleted properly. This all applies to old versions, so doesn't make much
difference in practice, so just fix it to avoid c&p duplication of the bad
pattern in the future.
2016-11-07 11:10:12 +01:00
Harald Hoyer 597b159248 NEWS: update for 045 2016-11-07 11:01:36 +01:00
Andreas Stieger 0db98910a1 dracut.sh: create the initramfs non-world readable also if early cpio is used
Fixes: 5f2c30d9bc
Previously fixed CVE-2012-4453: e1b48995c2

Signed-off-by: Andreas Stieger <astieger@suse.com>
2016-11-07 10:41:38 +01:00
Harald Hoyer a5b2d8fe74 Merge pull request #169 from floppym/50-dracut.install-bashism
50-dracut.install: use /bin/bash shebang
2016-11-07 10:20:06 +01:00
Mike Gilbert 69395a528a 50-dracut.install: use /bin/bash shebang
This script utilizes several bash-specific constructs.
2016-11-04 13:09:28 -04:00
Harald Hoyer ca31a7e368 TODO: remove some items 2016-11-03 15:05:36 +01:00
Harald Hoyer e7f52635d9 README: update
remove "new" and reword the first paragraphs

remove sourceforge repo links
2016-11-03 14:54:45 +01:00
Harald Hoyer 2afd60baa6 README.md: remove CI badge 2016-11-03 14:48:31 +01:00
Harald Hoyer bd98b88447 dracut.8: document INITRD_COMPRESS environment variable
https://bugzilla.redhat.com/show_bug.cgi?id=1389775
2016-11-02 13:49:17 +01:00
Harald Hoyer ec44ed1d9d README: correct github URLs 2016-10-26 13:41:21 +02:00
Stefan Berger 61c761bc2c dracut-install: preserve extended attributes when copying files
Preserve extended attributes when copying files using dracut-install.

The copying of extended attributes avoids file execution denials when
the Linux Integrity Measurement's Appraisal mode is active. In that mode
executables need their file signatures copied. In particular, this patch
solves the problem that dependent libaries are not included in the
initramfs since the copied programs could not be executed due to missing
signatures. The following audit record shows the type of failure that
is now prevented:

type=INTEGRITY_DATA msg=audit(1477409025.492:30065): pid=922 uid=0
 auid=4294967295 ses=4294967295
 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
 op="appraise_data" cause="IMA-signature-required"
 comm="ld-linux-x86-64"
 name="/var/tmp/dracut.R6ySa4/initramfs/usr/bin/journalctl"
 dev="dm-0" ino=37136 res=0

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-10-25 22:05:55 +02:00
Harald Hoyer b8278a99ab README.md: update 2016-10-20 15:35:08 +02:00
Harald Hoyer 7e8f8ddbf8 README.md: update 2016-10-20 14:53:25 +02:00
Harald Hoyer 4a7b55ee7e add README.md 2016-10-20 14:46:40 +02:00
Harald Hoyer ddfcfdf199 test/test-rhel-7.2.rpms
list of rpms to install to run the testsuite on rhel-7.2
2016-10-20 13:58:53 +02:00
Harald Hoyer fc44fdb5ac integrity/ima-policy-load.sh: s/echo -n/printf 2016-10-20 13:58:25 +02:00
Harald Hoyer b08ad7f7d8 Merge pull request #160 from yuwata/fix-rescue-install
rescue: use proper path for 0-rescue.conf
2016-10-19 09:35:46 +02:00
Yu Watanabe b29901c083 rescue: use proper path for 0-rescue.conf 2016-10-19 12:22:54 +09:00
Harald Hoyer a69d137338 Merge pull request #158 from dracut-mailing-devs/1476391783-27231-1-git-send-email-stefanb@linux.vnet.ibm.com
98integrity: support validating the IMA policy file signature
2016-10-14 11:34:39 +02:00
Stefan Berger 479b5cd94f 98integrity: support validating the IMA policy file signature
IMA validates file signatures based on the security.ima xattr. As of
Linux-4.7, instead of cat'ing the IMA policy into the securityfs policy,
the IMA policy pathname can be written, allowing the IMA policy file
signature to be validated.

This patch first attempts to write the pathname, but on failure falls
back to cat'ing the IMA policy contents .

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
2016-10-13 23:02:40 +02:00
Harald Hoyer de7ab164dd dmsquash-live/dmsquash-live-root: det_img_fs() redirect udevadm output to stderr
Otherwise the output is taken as input for modprobe.
2016-10-13 09:20:33 +02:00
Harald Hoyer bb47ec5499 dracut-install: fallback to non-hostonly mode if lsmod fails
if libkmod fails to get the list of loaded modules, fallback
to non-hostonly mode, to at least try to assemble a working initrd.
2016-10-13 09:19:29 +02:00
Chad Dupuis 3966a1e1ee fcoe: Allow more time for the bnx2x link negotiation before brining up fcoe interfaces.
bnx2x can take no longer than 3 seconds to initialize the link in some setups
which can cause fipvlan to fail and thus the fcoe interface(s) won't be
created.

Add another 10 seconds to give the link enough time to initialize.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
2016-10-12 19:02:39 +02:00
Harald Hoyer d8c75b5f38 Merge pull request #131 from bcg62/syslog-fixes
syslog module fixes
2016-10-11 15:06:31 +02:00
Brendan Germain a1ea214a87 add imjournal.so to read systemd journal 2016-10-11 08:51:13 -04:00
Brendan Germain 1d9d43713d subshell and set -f to prevent expansion 2016-10-11 08:50:37 -04:00
Brendan Germain b37b141ecc fixup No such file or directory errors when module is not configured 2016-10-11 08:43:20 -04:00
Brendan Germain 223547feab move start from udev to initqueue/online 2016-10-11 08:43:20 -04:00
Brendan Germain 3568d947db source dracut-lib for warn() 2016-10-11 08:43:20 -04:00
Brendan Germain ff6077789e correctly install rsyslog.conf template 2016-10-11 08:43:20 -04:00
David Disseldorp bafc82e732 dracut.sh: support --tmpdir as a relative path
Dracut changes working directory before attempting to output files under
$DRACUT_TMPDIR , resulting in an IO failure if $DRACUT_TMPDIR is a path
relative to the working directory when dracut was started.

Fixes: https://github.com/dracutdevs/dracut/issues/156

Signed-off-by: David Disseldorp <ddiss@suse.de>
2016-10-10 16:27:47 +02:00
Harald Hoyer 8205c25ef9 Merge pull request #150 from dm0-/master
qemu: include the qemu_fw_cfg kernel module
2016-10-10 11:28:09 +02:00
Harald Hoyer fea9be7ac1 Merge pull request #154 from honza801/patch-1
Update nfs-lib.sh
2016-09-02 10:07:21 +02:00
Harald Hoyer c85034c91f caps: make it a non default module 2016-09-02 07:51:55 +02:00
Harald Hoyer d7c9ad504e TEST-30-ISCSI: add message, that all tests passed 2016-09-02 07:51:55 +02:00
Harald Hoyer 00ca15abbf network: arping2 use 0.0.0.0 as source address 2016-09-02 07:51:55 +02:00
Harald Hoyer dba974844e test/TEST-30-ISCSI: depend on tgtd and tgtadm
the testsuite now needs tgtd and tgtadm and not iscsi-target
2016-09-02 07:51:55 +02:00
Harald Hoyer a84c391b87 kernel-modules: add nvme kernel module 2016-09-02 07:51:55 +02:00
Harald Hoyer 86eb0b1b83 dracut-systemd/dracut-mount.service: add DefaultDependencies=no 2016-09-02 07:51:55 +02:00
honza801 69c6435acd Update nfs-lib.sh
anaconda_nfsv6_to_var(): fix options parsing. $1 contains  : at the end, this is done by previous functions.
2016-09-01 15:37:58 +02:00
Harald Hoyer b05cd20695 Merge pull request #153 from fuhry/livenet-generator-nfs
livenet: support nfs:// urls in livenet-generator
2016-08-26 08:20:25 +02:00
Dan Fuhry 1090a8826a livenet: support nfs:// urls in livenet-generator
This is a further improvement on PR #105 which re-adds support for nfs:// urls to root=live:nfs://... Symptoms prior to applying this patch are that sysroot.mount times out when following the nfs:// syntax for the path to the live image. An additional case is added to livenet-generator to support the nfs protocol.
2016-08-25 17:13:52 -04:00
Harald Hoyer 1a7b71bb14 network:ibft put IPv6 IP in brackets
ip=2620:0052:0000:2220:0226:b9ff:fe81:cde4::[2620:0052:0000:2220:0000:0000:0000:03fe]:64::ibft0:none

should be

ip=[2620:0052:0000:2220:0226:b9ff:fe81:cde4]::[2620:0052:0000:2220:0000:0000:0000:03fe]:64::ibft0:none

https://bugzilla.redhat.com/show_bug.cgi?id=1322592#c19
(cherry picked from commit b8e6c051c6)
2016-08-19 15:49:33 +02:00
Harald Hoyer 5db79ae414 dracut.cmdline.7.asc: document rd.shell=0 for rd.emergency
(cherry picked from commit 1d267fb82c)
2016-08-19 15:49:33 +02:00
Harald Hoyer f367b73852 dracut.sh: document --hostonly-i18n and --no-hostonly-i18n
show description in --help

https://bugzilla.redhat.com/show_bug.cgi?id=1266448
(cherry picked from commit 91896ab68e)
2016-08-19 15:49:33 +02:00
Harald Hoyer f47090f918 url-lib: ca-bundle.crt changed to a symlink
use inst() instead of inst_simple()

/etc/pki/tls/certs/ca-bundle.crt is a symlink to
../../ca-trust/extracted/pem/tls-ca-bundle.pem

with inst() we install the original file also.

https://bugzilla.redhat.com/show_bug.cgi?id=1341280
(cherry picked from commit 1b23c6c65c)
2016-08-19 15:49:33 +02:00
Harald Hoyer e168eeef67 systemd/dracut-cmdline.sh: unset "UNSET" $root
https://bugzilla.redhat.com/show_bug.cgi?id=1365667
caused by commit 9aa224cc

(cherry picked from commit fc77aca7dd)
2016-08-19 15:49:33 +02:00
Harald Hoyer c7c8c4981a dracut-functions.sh: catch all lvm slaves
add check_vol_slaves_all to be used in check_block_and_slaves_all

otherwise only the first lvm VG member would be processed

(cherry picked from commit 7a7b8c1740)
2016-08-19 15:49:33 +02:00
Harald Hoyer 1de836c763 TEST-20-NFS: remove stale pid file 2016-08-19 15:33:59 +02:00
Xunlei Pang 242c03d6fb network: use require_any_binary instead of require_any_binaries 2016-08-19 13:39:37 +02:00
Harald Hoyer 88f9d6140d nfs: install all nfs modules non-hostonly
If nfs is used, we should include all nfs modules, in the case, where
$host_fs_types contains nfs.

(cherry picked from commit b077d18963)
2016-08-18 12:00:43 +02:00
Harald Hoyer 740c46c022 network: support macaddr in brackets []
ip=ens3:dhcp:1000
ip=ens3:dhcp::54:52:00:ab💿ef
ip=ens3:dhcp::[54:52:00🆎cd:ef]
ip=ens3:dhcp:1000:54:52:00:ab💿ef
ip=ens3:dhcp:1000:[54:52:00🆎cd:ef]

ip=192.168.122.20::192.168.122.1:24:test:ens3:none:1000
ip=192.168.122.20::192.168.122.1:24:test:ens3:none::54:52:00:ab💿ef
ip=192.168.122.20::192.168.122.1:24:test:ens3:none::[54:52:00🆎cd:ef]
ip=192.168.122.20::192.168.122.1:24:test:ens3:none:1000:54:52:00🆎cd:ef
ip=192.168.122.20::192.168.122.1:24:test:ens3:none:1000:[54:52:00🆎cd:ef]

ip=::::test:ens3:dhcp:1000
ip=::::test:ens3:dhcp::54:52:00:ab💿ef
ip=::::test:ens3:dhcp::[54:52:00🆎cd:ef]
ip=::::test:ens3:dhcp:1000:54:52:00:ab💿ef
ip=::::test:ens3:dhcp:1000:[54:52:00🆎cd:ef]

(cherry picked from commit 53e4ab7174)
2016-08-18 11:29:29 +02:00
David Michael 73db316ef2 qemu: include the qemu_fw_cfg kernel module
This adds support for /sys/firmware/qemu_fw_cfg on QEMU guests
started with the -fw_cfg option.
2016-08-16 13:43:18 -07:00
Harald Hoyer 38b9558333 Merge pull request #148 from lnykryn/fips-space
fips-module: add missing space
2016-08-08 14:42:05 +02:00
Lukas Nykryn 1c132d39a6 fips-module: add missing space 2016-07-28 12:33:03 +02:00
Harald Hoyer c45e856a65 add rd.emergency=[reboot|poweroff|halt]
specifies what action to execute in case of a critical failure
2016-07-22 14:51:03 +02:00
Harald Hoyer 9264b0cba6 Merge pull request #145 from yuwata/dracut-conf
dracut.conf.5.asc: remove duplicate i18n_install_all option
2016-07-20 11:45:37 +02:00
Yu Watanabe aaaf035aed dracut.conf.5.asc: remove duplicate i18n_install_all option 2016-07-20 18:24:39 +09:00
Harald Hoyer 9853791d37 network: use arping2, if available
fixes https://github.com/dracutdevs/dracut/issues/135
2016-07-14 14:36:04 +02:00
Harald Hoyer 5a3773dbe6 fcoe: check if needed for hostonly
(cherry picked from commit f45726652f)
2016-07-14 13:57:21 +02:00
Harald Hoyer 24113c3a11 dracut-install.c: really add a "/" inbetween destdir and target
using dracut-install with

find . -print0 | xargs dracut-install -D /tmp/test -a

resulted in /tmp/test./.... files
2016-07-14 13:54:04 +02:00
Harald Hoyer 34a42f9f49 fs-lib: f2fs needs crc32 not crc32c
*sigh*
2016-07-08 10:01:52 +02:00
Harald Hoyer 5d4aaaa2a3 Merge pull request #143 from scop/master
dracut.png: Optimize with zopflipng -m
2016-07-07 14:58:28 +02:00
Ville Skyttä 828257dd82 dracut.png: Optimize with zopflipng -m 2016-07-07 13:54:47 +03:00
Harald Hoyer f8ff380bd5 fs-lib: add crc32c kernel module for f2fs 2016-07-07 09:43:48 +02:00
Harald Hoyer b1ec9d737f Merge pull request #142 from falbrechtskirchinger/master
systemd: install missing drop-in configs
2016-07-06 09:15:20 +02:00
Florian Albrechtskirchinger 5d013e5e3c systemd: install missing drop-in configs
In host-only mode, install missing drop-in configuration files for
/etc/systemd/{journal.conf,system.conf}.
2016-07-06 07:27:37 +02:00
Peter Robinson 88d8ad663f modules: kernel: add phy and power modules to generic initrd
The phy and power modules are needed by some of the recent ARM
devices that have appeared like CHIP and some exynos devices.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2016-07-04 19:05:01 +02:00
Harald Hoyer 4af4fe4a69 Merge pull request #140 from tpgxyz/f2fs
add support to F2FS filesystem (fsck)
2016-07-04 11:51:14 +02:00
tpg 9f521f76a0 add support to F2FS filesystem (fsck) 2016-06-30 21:26:42 +02:00
Harald Hoyer 3889234f71 dracut.sh: make tmp dirs after the trap function is installed
otherwise a good timed ctrl-c will leave the tmp dir around
2016-06-29 17:32:31 +02:00
Hannes Reinecke c98d1756f7 40network: Update iBFT scanning code to handle IPv6
IPv6 addresses should be specified in brackets so that the
ip= scanning code doesn't get confused.

References: bnc#887542

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.com>
2016-06-29 17:31:46 +02:00
Harald Hoyer b039b20ec2 test: correct cmdline reading functions 2016-06-27 12:05:37 +02:00
Harald Hoyer f8242a6a60 fcoe/cleanup-fcoe.sh: don't copy shm files to state
with systemd version 230, this is not necessary anymore
systemd commit cacf980ed44a28e276a6cc7f8fc41f991e2ab354
because /dev/shm is selinux relabled.
2016-06-27 12:03:55 +02:00
Harald Hoyer f6fa9ef101 TEST-20-NFS: skip root=/dev/nfs tests with systemd v230 2016-06-23 16:38:17 +02:00
Harald Hoyer 7e51abc81f network/dhclient.conf: add missing commata
options need to be seperated by ,
2016-06-23 16:38:17 +02:00
Harald Hoyer c000a21c25 dracut-systemd/*.service: conflict with shutdown target
make reboot/poweroff/halt work

also conflict with emergency.target
2016-06-23 16:37:53 +02:00
Harald Hoyer 8261d2367e systemd: add missing -.slice unit 2016-06-22 18:11:28 +02:00
Fabian Vogt 18729719a7 Fix wrong keymap inclusion
For MAP=lt, dracut would choose lt.std.map instead of lt.map.

Signed-off-by: Fabian Vogt <fvogt@suse.com>
2016-06-17 15:03:28 +02:00
Harald Hoyer 36867f1abf test: handle kernel panic in testsuite
- reboot kernel on panic
- qemu don't reboot
2016-06-10 08:53:01 +02:00
Harald Hoyer 0092942531 test/TEST-99-RPM: fixed test suite
- cope with dnf vs yum
- fixed find arguments
- make script fail, if command fails
2016-06-09 18:15:48 +02:00
Harald Hoyer 781f1971c3 cope with "rd.shell=0" in the testsuite
If emergency and shutdown-emergency hooks are called, the systemd should
poweroff the testsuite, therefore "rd.shell=0" is given on the test
suite kernel command lines.

"rd.shell=0" has to be parsed correctly by the test suite real root init
also.
2016-06-08 16:48:07 +02:00
Harald Hoyer 3847bd450d systemd: add udev.hwdb and udev.conf 2016-06-08 16:47:41 +02:00
Harald Hoyer 8fce2c4d5e dracut-systemd/dracut-emergency.sh: call shutdown-emergency hooks
if no rd.shell is given
2016-06-07 14:47:27 +02:00
Harald Hoyer 9e19c0512d Revert "network: remove awk call and replace it with a shell function"
This reverts commit 71867b665c.

network needs posix shell
2016-06-07 14:27:35 +02:00
Harald Hoyer 4e882b8090 use shutdown-emergency hook in testsuite to poweroff the machine 2016-06-07 14:27:03 +02:00
Harald Hoyer 8e01095755 dracut-init.sh: set default firmware path, if not specified 2016-06-07 14:27:03 +02:00
Colin Guthrie 99b70a787c systemd: add more groups to deal with tmpfiles handling.
Both 'utmp' and 'root' groups are mentioned in tmpfiles.d/systemd.conf
and as such should be included.

It's probably better to have something equiv to inst_rule_group_owner()
for udev rules which parses out users and groups and adds them to the
passwd/group db respectively.

Could also rely on sysusers but as the initramfs is static in this
sense, it's more efficient to pre-define the users IMO.
2016-06-07 12:04:13 +02:00
Harald Hoyer 71867b665c network: remove awk call and replace it with a shell function
changes commit 4fa5c235a7
2016-06-07 11:15:07 +02:00
Harald Hoyer f3355208f9 Merge pull request #137 from dracut-mailing-devs/1461665111-7385-2-git-send-email-xlpang@redhat.com
1461665111 7385 2 git send email xlpang@redhat.com
2016-06-07 11:08:12 +02:00
Nicolas Chauvet 2602a74edf dracut: Add drivers/clk by default on arm
This will bundle clock drivers into the initramfs on arm

Tested on ti dm8148-t410 where adpll is needed on 4.6+ kernel
This will avoid to rely on (maybe broken) bootloader clocks.

Theses modules are also usually loaded early. Having them bundled into
the initramfs will avoid lot of deferred probes and others delay.

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2016-06-07 10:48:49 +02:00
Colin Guthrie 55b99a0e4c dracut.sh: fix $tmpfilesdir fallback when systemd-devel is not installed.
Bug introduced in 3a04bddeed in Dec 2014.
2016-06-07 10:48:49 +02:00
Harald Hoyer d4efc0aeee systemd-initrd: add initrd-root-device.target 2016-05-25 15:07:08 +02:00
Harald Hoyer 1901500187 move ln_r() to dracut-init.sh 2016-05-25 15:07:08 +02:00
Imran Haider 292548be6e add 'mtu' parameter for bond options
Signed-off-by: Imran Haider <imran1008@gmail.com>
2016-05-16 00:16:47 -04:00
Harald Hoyer d6145ece6d Merge pull request #128 from AlexanderKurtz/master
dracut-systemd/dracut-cmdline.sh: Don't error out if there is no root…
2016-05-11 09:23:05 +02:00
Alexander Kurtz 016613c774 dracut-systemd/dracut-cmdline.sh: Don't error out if there is no root= argument.
Thanks to systemd's gpt-auto-generator [0] (which implements the Discoverable
Partitions Specification [1]), it is no longer necessary to always specify the
root= argument.

However, dracut would still refuse to boot if there was no root= argument (or
if it was set to the special value "gpt-auto" [2]). This commit stops dracut
from aborting the boot process in these cases and simply lets systemd do its
magic.

[0] https://github.com/systemd/systemd/blob/v229/src/gpt-auto-generator
[1] https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/
[2] https://github.com/systemd/systemd/blob/v229/src/gpt-auto-generator/gpt-auto-generator.c#L928
2016-05-06 17:53:36 +02:00
Harald Hoyer a365b67db0 Merge pull request #127 from Keruspe/master
configure: don't hardcode pkg-config
2016-05-04 11:13:54 +02:00
Marc-Antoine Perennou 699414f5a5 configure: don't hardcode pkg-config
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2016-05-04 10:18:54 +02:00
Harald Hoyer ab4cccf2a7 Merge pull request #126 from AnchorCat/volatile-journal
systemd: ensure journal is volatile
2016-05-04 09:25:37 +02:00
Michael Chapman 5dea430e08 systemd: ensure journal is volatile
If journald.conf already contains Storage=persistent, journald will
write to /var/log/journal/, which ends up at /run/initramfs/log/journal/
after switching root. We want to make sure early boot logs are written
to /run/log/journal/ so they can be flushed to /var/log/journal/ after
switching root.
2016-05-04 10:49:56 +10:00
Harald Hoyer e4749a35e5 Merge pull request #125 from rubenk/patch-1
Fix small typo in dracut.cmdline(7)
2016-04-29 15:52:17 +02:00
Ruben Kerkhof ae753baec0 Fix small typo in dracut.cmdline(7) 2016-04-29 15:34:47 +02:00
Harald Hoyer 7b79d63fa4 Merge pull request #124 from glensc/os-release-dir
ensure parent dir for /usr/lib/initrd-release exists
2016-04-27 13:04:43 +02:00
Elan Ruusamäe bb44294b62 ensure parent dir for /usr/lib/initrd-release exists 2016-04-27 13:08:42 +03:00
Xunlei Pang 4fa5c235a7 network/net-lib.sh: delete duplicated DNS items from "/etc/resolv.conf"
Users can pass the DNS information throught "nameserver=" cmdline,
there maybe duplicated inputs.

"/etc/resolv.conf" have some restrictions on the number of DNS items
effective, so make sure that this file contains no duplicated items.

We achieve this by simply making the file have no duplicated lines.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2016-04-26 13:03:30 +02:00
Xunlei Pang cf376023e6 network: dhcp before parsing specified dns through cmdline
I met a problem when passing kdump dns to dracut via "nameserver=x.x.x.x",
the dns I provided didn't appear in the "/etc/resolv.conf".

After some debugging, found that when setup dhcp DNS, in setup_interface()
and setup_interface6(), it has:
    echo "search $search $domain" > /tmp/net.$netif.resolv.conf

So if "$search $domain" isn't NULL(this is ture in my kdump environment),
the dns contents(that is, dns1, dns2, nameserver) in "ifup" before dhcp
will be discarded.

This patch addresses it by handling dhcp first. In fact this is also the
way the NetworkManager in 1st kernel works.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2016-04-26 13:03:30 +02:00
Guido Trentalancia 5f91ed0b53 dracut: 10i18n: support default loadkeys/setfont data paths using symbolic links
Avoid keymap/font not found error when loadkeys/setfont
are compiled with the default data directory path.

Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
2016-04-21 14:14:31 +02:00
Harald Hoyer bf75218e45 watchdog: start traversing the device tree from the right directory
start with the device subtree, not with the parent of it
2016-04-18 15:50:42 +02:00
Harald Hoyer fe83231e30 watchdog: clean return of installkernel()
return 0, otherwise if _alldrivers is empty, the return code is fail
2016-04-18 15:50:33 +02:00
Harald Hoyer 3f60444ec1 removed obsolete kernel module functions and host_modules variable
module_is_host_only()
find_kernel_modules_by_path()
find_kernel_modules()
2016-04-15 16:48:13 +02:00
Harald Hoyer eab32bda80 dracut-install: make use of _cleanup_ macros and improve hostonly check
If a module is renamed or another module takes care of the old one,
all of the alias strings have to be checked against the current set of
loaded modules.

This is still incomplete, because to be absolutely correct, all the
/sys/*...*/modalias files would have to be checked, if they match the
modules alias strings.
2016-04-15 16:48:13 +02:00
Harald Hoyer fa295f0bcd dracut_install: honor --silent flag 2016-04-15 15:25:27 +02:00
Harald Hoyer 0297fdcb3e Merge pull request #123 from dracut-mailing-devs/40374262.eB5p3XdtTH@linux-lm3i.site
Correctly handle module aliases
2016-04-15 12:05:44 +02:00
Harald Hoyer 9d74747f92 drop to shell on die() if rd.shell=1 is set explicitly 2016-04-15 12:03:03 +02:00
Harald Hoyer 74e2d1e69f watchdog/module-setup.sh: rewrite
- use local variables with _
- use associative array for the kernel modules
- install emergency hook even in the systemd case
- follow device path until /sys is reached
- set kernel version for modprobe checking
2016-04-15 11:47:59 +02:00
Harald Hoyer ad438af207 Merge pull request #121 from dracut-mailing-devs/2751555c29f26f69a63888745513edeceb39d416.1458099200.git.panand@redhat.com
Install kernel module for active watchdog
2016-04-15 10:56:31 +02:00
Guido Trentalancia f3f019d947 95resume: avoid possible symbolic link creation error on bootup
Avoid symbolic link creation error.
2016-04-15 10:38:04 +02:00
Harald Hoyer 2db14045c1 kate config 2016-04-15 10:27:48 +02:00
Harald Hoyer db7d61cff7 base/init.sh: don't mount /run with noexec, if the initramfs lives there
If the initramfs was built with prefix=/run/... /run can't be mounted
with noexec, otherwise no binary can be run.

Guard against it by looking where /bin/sh is really located.
2016-04-14 14:58:34 +02:00
Harald Hoyer b99e72427b Revert "fcoe: no need to copy lldpad state"
This reverts commit e93ff1cf9a.

seems like the file has to be copied back in the real root.

https://bugzilla.redhat.com/show_bug.cgi?id=1246217
2016-04-14 13:38:24 +02:00
Harald Hoyer 6fcd5c8e3b NEWS: update for 045 2016-04-14 11:53:14 +02:00
Harald Hoyer b14b039e90 dracut-install: add --help documentation 2016-04-14 11:51:36 +02:00
Harald Hoyer 7ef36aef28 plymouth/plymouth-pretrigger.sh: also trigger acpi subsystem
Trigger the acpi subsystem. This will ensure hv_vmbus gets loaded before
plymouth is started, which will make the graphics device become
available before plymouth is started too (and the keyboard ! which might
also be important for plymouth in some setups).

https://bugzilla.redhat.com/show_bug.cgi?id=1218130
(cherry picked from commit d2846fdcce9b8de0edecdf0e06a4b86fc8de542c)
2016-04-13 14:11:17 +02:00
Harald Hoyer 9bb030c5d8 dracut-init.sh: beautify instmods() 2016-04-13 14:00:26 +02:00
Harald Hoyer fe6e0c23ad dracut-install: simplify error logic
error out early, if "--optional" is not set
2016-04-13 13:56:52 +02:00
Harald Hoyer 8d9ab2755d Fix regressions with dracut-install with kernel modules
Make sure, the same modules are installed as before.
2016-04-13 11:47:20 +02:00
Harald Hoyer 607fec3e79 Use pkg-config for libkmod CFLAGS and LIBS 2016-04-13 11:13:32 +02:00
Harald Hoyer 794b2d2c75 Use dracut-install to install kernel modules
dracut-install can now install kernel modules and their corresponding
firmware files.
2016-04-11 16:32:10 +02:00
Harald Hoyer ff8f702689 dracut-init.sh: mark error messages with FAILED 2016-04-11 15:25:11 +02:00
Harald Hoyer 98fd06934c lsinitrd.sh: fixed unpack and skipcpio search 2016-04-11 15:24:01 +02:00
Harald Hoyer 374ef3ed2b dracut-init.sh: Add file argument to sed's
fixup for 06a1d07690
2016-04-11 13:37:17 +02:00
Harald Hoyer f7f5b82b43 dracut.sh: call dracut-install with "-f" in FIPS mode
in fips mode, dracut-install was called with "-H" instead of "-f" in
FIPS mode

missed conversion of commit 26cd262a6a
2016-04-11 11:57:30 +02:00
Harald Hoyer c395993eaf Merge pull request #122 from scop/fixes
Various shell script improvements
2016-03-29 11:19:58 +02:00
Ville Skyttä 06a1d07690 dracut-init.sh: Simplify udev rule grepping 2016-03-28 12:09:06 +03:00
Ville Skyttä bcabe0fe25 Clean up some bashisms from /bin/sh scripts 2016-03-28 11:52:14 +03:00
Ville Skyttä dec3dfa4b3 nfs/module-setup.sh: Use colon instead of dot for chown user/group separator 2016-03-28 11:39:36 +03:00
Ville Skyttä 9430ae301e Do not use deprecated egrep/fgrep 2016-03-28 11:38:34 +03:00
Harald Hoyer 97bbba6938 lsinitrd: add "--unpack" to lsinitrd
also "--unpackearly" and "--verbose"
2016-03-17 14:45:24 +01:00
Pratyush Anand e343c85763 watchdog: ensure that module is loaded as early as possible
It is expected that a watchdog module will disable an active watchdog when
its probe is called ie, when it is loaded. So an early load of the module
will help to disable it earlier.
This can be helpful in some corner cases where kdump and watchdog daemon
both are active.

Testing:
    -- When watchdog kernel modules were added
	# dracut --no-hostonly initramfs-test.img -a watchdog
	# lsinitrd initramfs-test.img -f etc/cmdline.d/00-watchdog.conf
 	rd.driver.pre=iTCO_wdt,lpc_ich,

Signed-off-by: Pratyush Anand <panand@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Harald Hoyer <harald@redhat.com>
2016-03-16 05:05:51 +01:00
Pratyush Anand 3aac682744 watchdog: install module for active watchdog
Recently following patches have been added in upstream Linux kernel, which
(1) fixes parent of watchdog_device so that
/sys/class/watchdog/watchdogn/device is populated. (2) adds some sysfs
device attributes so that different watchdog status can be read.

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=6551881c86c791237a3bebf11eb3bd70b60ea782
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=906d7a5cfeda508e7361f021605579a00cd82815
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=33b711269ade3f6bc9d9d15e4343e6fa922d999b

With the above support, now we can find out whether a watchdog is active or
not. We can also find out the driver/module responsible for that watchdog
device.

Proposed patch uses above support and then adds module of active watchdog
in initramfs generated by dracut for hostonly mode. Kernel module for
inactive watchdog will be added as well for none hostonly mode.

When an user does not want to add kernel module, then one should exclude
complete dracut watchdog module with --omit.

Testing:
-- When watchdog is active watchdog modules were added
	# cat /sys/class/watchdog/watchdog0/identity
	iTCO_wdt
	# cat /sys/class/watchdog/watchdog0/state
	active
	# dracut --hostonly initramfs-test.img -a watchdog
	# lsinitrd initramfs-test.img | grep iTCO
	-rw-r--r--   1 root     root         9100 Feb 24 09:19 usr/lib/modules/.../kernel/drivers/watchdog/iTCO_vendor_support.ko
	-rw-r--r--   1 root     root        19252 Feb 24 09:19 usr/lib/modules/.../kernel/drivers/watchdog/iTCO_wdt.ko

-- When watchdog is inactive then watchdog modules were not added
	# cat /sys/class/watchdog/watchdog0/state
	inactive
	# dracut --hostonly initramfs-test.img -a watchdog
	# lsinitrd initramfs-test.img | grep iTCO

-- When watchdog is inactive, but no hostonly mode, watchdog modules were added
	# cat /sys/class/watchdog/watchdog0/state
	inactive
	# dracut --no-hostonly initramfs-test.img -a watchdog
	# lsinitrd initramfs-test.img | grep iTCO
	-rw-r--r--   1 root     root         9100 Feb 24 09:19 usr/lib/modules/.../kernel/drivers/watchdog/iTCO_vendor_support.ko
	-rw-r--r--   1 root     root        19252 Feb 24 09:19 usr/lib/modules/.../kernel/drivers/watchdog/iTCO_wdt.ko

Signed-off-by: Pratyush Anand <panand@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Harald Hoyer <harald@redhat.com>
2016-03-16 05:05:51 +01:00
Pratyush Anand 89da227de9 watchdog: Do not add hooks if systemd module is included
When systemd is present, let it manage watchdog feed.

Signed-off-by: Pratyush Anand <panand@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Harald Hoyer <harald@redhat.com>
2016-03-16 05:05:51 +01:00
Harald Hoyer 472928ec3d dracut.conf.5.asc: fix bold 2016-03-14 14:16:12 +01:00
Harald Hoyer b127294def dracut-install: catch ldd message "cannot execute binary file" 2016-03-14 10:59:29 +01:00
Harald Hoyer 556ff7c76a dracut-systemd/dracut-pre-pivot.sh: Break at switch_root only for bare rd.break
similar to commit ddfea6b54c

Previously, any rd.break=breakpoint would cause a break at the
given breakpoint and also at switch_root.
2016-03-07 12:38:23 +01:00
Harald Hoyer cb6d49bc9d Merge branch 'master' of github.com:haraldh/dracut 2016-02-29 15:07:41 +01:00
Harald Hoyer caf12d6717 network/dhclient-script.sh: add classless-static-routes support
https://bugzilla.redhat.com/show_bug.cgi?id=1260955
(cherry picked from commit a48ea27deb)
2016-02-29 15:01:50 +01:00
Harald Hoyer fe6455a6e8 documentation: "--hostonly-i18n" "--no-hostonly-i18n" "i18n_install_all" 2016-02-29 13:12:02 +01:00
Harald Hoyer 4d3e54e01a Merge pull request #116 from evverx/fix-ask-cmdline-hostonly=0
base/init.sh: don't remove 99-cmdline-ask on 'hostonly' cleanup
2016-02-16 15:16:04 +01:00
Harald Hoyer 6a97d2fc89 Merge pull request #115 from evverx/fix-dracut-cmdline-ask-service
dracut-systemd/dracut-cmdline-ask: fix dracut --kernel-cmdline=rd.cmdline=ask
2016-02-16 09:52:27 +01:00
Evgeny Vereshchagin 4ab6447c2a base/init.sh: don't remove 99-cmdline-ask on 'hostonly' cleanup
How to reproduce:
host# ./dracut.sh -o 'dracut-systemd systemd systemd-initrd' --local -f ./initramfs.img

host# qemu-system-x86_64 -initrd ./initramfs.img \
    -append 'root=/dev/sda1 rd.cmdline=ask rd.hostonly=0' \
    ...

Enter additional kernel command line parameter (end with ctrl-d or .)
> rd.break
> .
...
There is no "Break before switch_root"
...

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2016-02-15 13:57:27 +00:00
Evgeny Vereshchagin eddca3c9c2 dracut-systemd/dracut-cmdline-ask: fix dracut --kernel-cmdline=rd.cmdline=ask
How to reproduce:

host# dracut --kernel-cmdline='rd.cmdline=ask' initramfs.img
host# qemu-system-x86_64 -initrd initramfs.img ... -append root=/dev/sda1 ...
...

qemu-host# journalctl -b | grep dracut-cmdline-ask
...
Feb 15 08:45:36 localhost systemd[1]: dracut-cmdline-ask.service: Installed new job dracut-cmdline-ask.service/start as 42
Feb 15 08:45:36 localhost systemd[1]: dracut-cmdline-ask.service: ConditionKernelCommandLine=rd.cmdline=ask failed.
Feb 15 08:45:36 localhost systemd[1]: dracut-cmdline-ask.service: Starting requested but condition failed. Not starting unit.
Feb 15 08:45:36 localhost systemd[1]: dracut-cmdline-ask.service: Job dracut-cmdline-ask.service/start finished, result=done
...

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2016-02-15 08:47:47 +00:00
Harald Hoyer 6bc2096cf5 kernel-modules: join instmods and install all usb/storage 2016-01-26 14:59:28 +01:00
Harald Hoyer b4dd861a0b kernel-modules: add usb-storage
To save the rdsosreport.txt to a USB stick, the usb-storage module is
needed
2016-01-26 14:56:05 +01:00
Harald Hoyer f4f8fb5c10 network: if rd.neednet=0 we don't need a bootdev
otherwise dracut would wait for the bootdev interface to appear and be
setup
2016-01-26 12:26:03 +01:00
Fabian Vogt 43819af68c Correctly handle module aliases
Handle module aliases correctly to not generate unbootable
initrds with different kernel versions when modules were renamed
or replaced.

Signed-off-by: Fabian Vogt <fvogt@suse.com>
2016-01-21 18:02:40 +01:00
Harald Hoyer 9542f2fee4 network: add mtu to list of variables to store in override 2016-01-19 15:12:39 +01:00
Harald Hoyer bb1b924792 TEST-30-ISCSI: some tests have unknown return code
by design
2016-01-19 14:43:43 +01:00
Harald Hoyer 24a78b2697 Fixed vlan, bonding, bridging, team logic
Call ifup for the slaves and assemble afterwards.
2016-01-19 11:35:23 +01:00
Harald Hoyer 918fbfcf6b Merge pull request #111 from wyrmiyu/multipath_fix
multipath: fix majmin_to_mpath_dev()
2016-01-19 10:16:13 +01:00
Pekka Wallendahl 28058a2e37 multipath: fix majmin_to_mpath_dev()
* Multipath device names only start with the mpath-prefix if the option
  use_userfriendly_names is set true in /etc/multipath.conf and if user
  has not set any aliases in the said file. Thus the for-loop should go
  through all files in /dev/mapper/, not just ones starting with 'mpath'

* Bash is perfectly capable to extend `/dev/mapper/*` notation without a
  need to pass it to an external ls

* Changed the function to use a local variable $_dev instead of the
  global $dev, which seemed to be the original intention as the local
  _dev was defined but not used
2016-01-18 20:28:22 +02:00
Harald Hoyer 2fd8588da5 dracut-functions.sh:fix check_vol_slaves() volume group name stripping
commit 466a59984a removed whitespace
stripping from lvm volume group names.
2016-01-18 17:01:15 +01:00
Harald Hoyer efbc47b8e4 network/net-lib.sh: correctly set mac address for ip=...:<mtu>:<mac>
if ip=...:<mtu>:<mac> was specified, macadress was not set
2016-01-13 13:43:38 +01:00
Harald Hoyer b019952f6d dracut.sh: fail hard, if we find modules and modules.dep is missing
If modules are present in /lib/modules/<kernelversion> and modules.dep
is empty, depmod was not run most likely.
2016-01-13 09:32:24 +01:00
Harald Hoyer 0a7d7f6310 dracut.cmdline: remove extra ":" from ip= doc 2016-01-13 09:17:40 +01:00
Harald Hoyer 60928f36b6 dracut.sh: restorecon final image file
Instead of "mv" use "cp --reflink=auto" and restorecon the final image
2016-01-08 11:37:25 +01:00
Harald Hoyer e93ff1cf9a fcoe: no need to copy lldpad state
/dev/shm should be available later on by the normal switch root bind mount.
2016-01-07 10:44:31 +01:00
Harald Hoyer 3f5e60bfc9 Merge pull request #109 from puleglot/fix_dev_unit_name
base/dracut-lib.sh:dev_unit_name() guard against $dev beginning with "-"
2016-01-07 10:13:45 +01:00
Harald Hoyer 07149fe6be nbd: add missing generator 2016-01-07 09:56:36 +01:00
Alexander Tsoy c41df7e1db base/dracut-lib.sh:dev_unit_name() guard against $dev beginning with "-"
crypt/parse-crypt.sh generate initqueue job which always call
dev_unit_name() with an argument beginning with "-". This results
in the following error:

dracut-initqueue[307]: + systemd-escape -p -cfb4aa43-2f02-4c6b-a313-60ea99288087
dracut-initqueue[307]: systemd-escape: invalid option -- 'c'
2016-01-05 22:59:52 +03:00
Harald Hoyer b8bccd398a test/TEST-04-FULL-SYSTEMD: optionally install machine-info and *-id 2015-12-14 15:19:53 +01:00
Harald Hoyer b830a31331 TEST-16-DMSQUASH: do not use "--" with ldconfig -r 2015-12-14 15:19:53 +01:00
Harald Hoyer b070c1d360 nbd: add systemd generator and use nbd export names instead of port numbers
Add a systemd generator for root=nbd:.. so that systemd has a correct
sysroot.mount unit.

Use export names instead of port numbers, because port number based
exports are deprecated and were removed.
2015-12-14 15:19:53 +01:00
Harald Hoyer df95b1003c network: fix carrier detection
rename iface_has_link() to iface_has_carrier() to clarify usage

Only assign static "wildcard interface" settings, if the interface has a
carrier.

If the interface name was specified with a name, do not do carrier
checking for static configurations.
2015-12-14 15:19:53 +01:00
Harald Hoyer efd3a6db74 livenet/module-setup.sh: only include systemd generator if systemd included 2015-12-14 15:19:53 +01:00
Harald Hoyer 4bcd41389c systemd: include machine-info 2015-12-14 15:19:53 +01:00
Harald Hoyer 8d26b5661e kernel-modules: include all HID driver in hostonly mode
If a kernel is updated in the undocked state and later on docked, some
keyboard modules can be missing.

Thus include all HID drivers.
2015-12-09 14:14:46 +01:00
Harald Hoyer ce9a398771 dmsquash-live/dmsquash-live-root.sh: SQUASHED can be set earlier
8b5ee88ff6 removed the check for SQUASHED,
assuming, that the if clause above was the only place, where SQUASHED is
set.

This patch reverts to the old logic, because SQUASHED can be set
earlier.
2015-12-01 08:52:00 +01:00
Harald Hoyer 54e09dfb72 shutdown: guard against read-only /run
remount the switch rooted /run writeable again.
2015-11-30 11:27:03 +01:00
Harald Hoyer 88ba9372be livenet/livenet-generator.sh: mode 0755 2015-11-27 09:44:24 +01:00
Harald Hoyer 5d8d0ac814 dmraid/61-dmraid-imsm.rules: add nowatch option for udev
udev rereads partitions, if watch is set for disks
2015-11-26 17:46:03 +01:00
Harald Hoyer 6ed1d9fd07 dmsquash-live/dmsquash-live-root.sh: fixed typo 2015-11-26 15:50:39 +01:00
Harald Hoyer 6612ae0d36 NEWS: update for version 044 2015-11-25 14:22:28 +01:00
Harald Hoyer 616fdae3cf AUTHORS: update 2015-11-25 14:22:28 +01:00
Harald Hoyer eb242ada05 dmraid/61-dmraid-imsm.rules: remove double "," 2015-11-25 14:21:33 +01:00
Harald Hoyer 4916bf1a58 lvm: silence errors from "lvm dumpconfig"
if the config option does not exist, we ignore the error anyway
2015-11-25 14:21:33 +01:00
Harald Hoyer 319867faa8 man: clarify add_dracutmodules vs dracutmodules 2015-11-25 14:21:33 +01:00
Harald Hoyer 87e90d7f4a For rd.hostonly=0 remove all initqueue/finished files also
This helps booting systems with changed configuration
2015-11-25 14:21:33 +01:00
Harald Hoyer 2249e7312e Makefile: add efi target
make an UEFI bootable image
2015-11-25 14:21:33 +01:00
Harald Hoyer 62c00a8896 dracut.sh: only create one TMPDIR
use DRACUT_TMPDIR subdirs for everything
2015-11-25 14:21:33 +01:00
Harald Hoyer 1a2290ea79 Revert "systemd: if kdbus is available, include the kernel module"
This reverts commit 90ff5ad67e.

There will be no kdbus anymore :-/
2015-11-23 11:08:06 +01:00
Harald Hoyer 03de49609c Merge pull request #97 from FGrose/dmsquash-live-root
dmsquash-live-root:  Persistence without overlay for uncompressed live installations
2015-11-23 11:07:43 +01:00
Harald Hoyer e330912be5 Merge pull request #106 from FGrose/dracut.cmdline
dracut.cmdline:  Update Booting live images section
2015-11-23 10:05:51 +01:00
Frederick Grose 33a4198e17 dracut.cmdline: Update Booting live images section
Add descriptions for the rd.live.overlay.readonly,
rd.live.overlay.size, rd.live.overlay.reset,
rd.live.squashimg, and rd.live.overlay=none options.
Mention the Invalid mark on exhausted overlays.
Clarify the rd.writable.fsimg option.
Repunctuate the rd.live.overlay.thin option description.
2015-11-22 15:02:55 -05:00
Frederick Grose 8b5ee88ff6 dmsquash-live-root: Avoid an overlay for persistent, uncompressed, read-write live installations.
Persistent, uncompressed live installations can avoid overlays with a new rd.live.overlay=none flag.
Non-persistent rd.live.ram boots can also take advantage of persistent home.img filesystems.
2015-11-20 23:38:12 -05:00
Harald Hoyer 2bcf4ffe5f Merge pull request #105 from antonym/master
livenet: add livenet-generator
2015-11-19 16:35:29 +01:00
Antony Messerli a455ad1c27 livenet: add livenet-generator
Resolves issues where systemd attempts to boot a live URL as an NFS mount.

This patch uses systemd's generator arg[2] to generate an early sysroot.mount
that preempts systemd-fstab-generator.

See https://bugzilla.redhat.com/show_bug.cgi?id=1280103
2015-11-19 08:10:03 -06:00
Harald Hoyer c44d2252bb dracut.sh: for microcode generation, skip gpg files
skip all ".asc" files for the AMD microcode generation
2015-11-18 10:58:54 +01:00
Harald Hoyer 90ac2d2429 TEST-16-DMSQUASH: add code for IO throtteling in qemu
To test the mediacheck feature, I added commented out code with qemu IO
throtteling.
2015-11-18 10:17:04 +01:00
Harald Hoyer 27d7936f0e dracut.sh: save systemdutildir env
even, if no systemd is used, we need that variable for systemd-udevd
2015-11-17 09:45:29 +01:00
Harald Hoyer 2da041d672 Check for systemd before installing systemd specific files
https://bugzilla.redhat.com/show_bug.cgi?id=1282010
2015-11-16 09:41:26 +01:00
Harald Hoyer 63a44c8dc3 dracut.sh: add back host_modules part
host_modules was removed accidently while remove host_modaliases
2015-11-16 09:26:51 +01:00
Harald Hoyer 602dce9ff2 iscsi/parse-iscsiroot.sh: reload udev rules
in the DHCP case udev is already running, so reload the rules before
continuing.
2015-11-13 16:37:48 +01:00
Harald Hoyer 456f299ab8 dracut-init.sh: libdir paths need dracut-function.sh 2015-11-13 14:20:54 +01:00
Zhiguo Deng 7527b90c88 Check rd.zfcp= format in dracut hook:cmdline process stage
When using rd.zfcp= parameter in generic.prm file, wrong format
parameters will prevent the zfcp driver to add the correct SCSI
disk. dracut should die when a wrong rd.zfcp= parameter supplied.

Signed-off-by: Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
2015-11-13 14:02:19 +01:00
Harald Hoyer 07a081f352 dracut.sh: remove the concept of host_modalias
We can never gather enough information about compiled in modules, so
don't pretend to know and do smart decisions.
2015-11-13 13:40:38 +01:00
dyoung@redhat.com 6870007674 Revert "Let user specify the action after fail"
This reverts commit 9d787df196

action_on_fail is useless thus remove the commits for it one by one.

Signed-off-by: Dave Young <dyoung@redhat.com>
2015-11-13 13:22:34 +01:00
dyoung@redhat.com d6dfde7830 Revert "99fs-lib/fs-lib.sh: Let user specify the action after fail for fsck"
This reverts commit 679fa7ed3c.

action_on_fail is useless thus remove the commits for it one by one.

Signed-off-by: Dave Young <dyoung@redhat.com>
2015-11-13 13:22:34 +01:00
dyoung@redhat.com 946722e465 Revert "dracut-emergency.service: do not start for "action_on_fail=continue""
This reverts commit b78e6ac2c3.

action_on_fail is useless thus remove the commits for it one by one.

Signed-off-by: Dave Young <dyoung@redhat.com>
2015-11-13 13:22:34 +01:00
dyoung@redhat.com a95a727fdc Revert "systemd/emergency.service: do not run for action_on_fail=continue"
This reverts commit dcae873414.

action_on_fail is useless thus remove the commits for it one by one.

Signed-off-by: Dave Young <dyoung@redhat.com>
2015-11-13 13:22:34 +01:00
dyoung@redhat.com 927d1e28c9 Revert "rename kernel command line param action_on_fail to rd.action_on_fail"
This reverts commit 391d605790.

action_on_fail is useless thus remove the commits for it one by one.

Signed-off-by: Dave Young <dyoung@redhat.com>
2015-11-13 13:22:34 +01:00
dyoung@redhat.com 74c9fb947b Revert "Change the implementation of action_on_fail"
This reverts commit d2765b5175.

action_on_fail is useless thus remove the commits for it one by one.

Signed-off-by: Dave Young <dyoung@redhat.com>
2015-11-13 13:22:34 +01:00
Fabian edbd9ca058 dracut.sh: Support --mount with just mountpoint as parameter
Right now the --mount parameter of dracut expects a rather long fstab-like
line. This makes it possible to invoke dracut with e.g. --mount /boot.
2015-11-13 13:21:43 +01:00
Mei Liu dcc2a4344b Add awk and getopt as dependencies of znetconf
znetconf command is part of s390utils-base package. It depends on
awk and getopt.

This patch is used to fix the following error:

dracut:/#
znetconf -c

/usr/sbin/znetconf: line 70: awk: command not found
/usr/sbin/znetconf: line 1138: getopt: command not found

Signed-off-by: Mei Liu <liumbj@linux.vnet.ibm.com>
2015-11-13 13:18:11 +01:00
Harald Hoyer ed92ecaa3c iscsi: only systemctl try-restart iscsid, if systemd is used 2015-11-13 13:16:10 +01:00
Harald Hoyer 98e9db2755 iscsi/iscsiroot.sh: put variables in quotes
best practice
2015-11-13 13:15:05 +01:00
Harald Hoyer 4a6c14f987 repro squash 2015-11-13 13:14:05 +01:00
Harald Hoyer 561eb42f39 reduce dracut-functions.sh and add to dracut-init.sh
move all dracut specific functions to dracut-init.sh
2015-11-13 13:06:01 +01:00
Harald Hoyer 10f8df1bdf add --no-reproducible to turn off reproducible mode
Also warn about cpio not supporting it and turn it on by default for
fedora.
2015-11-13 11:53:36 +01:00
Harald Hoyer 35a666d02a dracut-systemd/rootfs-generator.sh: s/RequiresOverridable/Requires
RequiresOverridable will be deprecated
2015-11-13 10:13:08 +01:00
Harald Hoyer 5b43377d74 network/ifup.sh: skip empty nameserver values
(cherry picked from commit e658251173)
2015-11-11 16:49:47 +01:00
Harald Hoyer ecdee70c48 base/dracut-lib.sh:getargs() don't return 1 for empty values
getargs() is only used with real values and not booleans.

So, return the values only.

(cherry picked from commit d1f7f2ac04)
2015-11-11 16:49:09 +01:00
Harald Hoyer b44156c6fc dracut.sh: fixed typo in microcode generation
(cherry picked from commit a594b4e357)
2015-11-11 16:47:48 +01:00
Harald Hoyer a49c1f049b network:wait_for_ifup() handle "NO-CARRIER" output
if "NO-CARRIER" is one of the flags, we surely have no link yet.

(cherry picked from commit f059985b14)
2015-11-11 16:47:09 +01:00
Harald Hoyer efba549a26 dracut.sh: no microcode, if get_ucode_file returns empty file
check, if get_ucode_file() returned an empty string.

(cherry picked from commit 327d765512)
2015-11-11 16:47:03 +01:00
Harald Hoyer 79cb273dc0 iscsi/parse-iscsiroot.sh: correct handling if netroot isn't set
corrects bfe65f913a

(cherry picked from commit 7fd112f20e)
2015-11-11 16:46:54 +01:00
Harald Hoyer 583fb23199 dracut.sh: do not create microcode, if no firmware is available
(cherry picked from commit 13b5c1d09e)
2015-11-11 16:46:16 +01:00
Harald Hoyer b73e00aff7 dracut.sh: add command line option for install_i18_all
--no-hostonly-i18n -> install_i18n_all=yes
--hostonly-i18n -> install_i18n_all=no

(cherry picked from commit 34b551a1c4)
2015-11-11 16:45:48 +01:00
Harald Hoyer b5363e834a iscsi/iscsiroot.sh: handle iscsi_firmware in online and timeout queue
The return code of iscsi_firmware is broken, so set the marker
unconditionally.

(cherry picked from commit fd3eddf069)
2015-11-11 16:44:36 +01:00
Harald Hoyer 19b0065cac network/netroot.sh: better handling of $netroot and dhcp
if $netroot is emtpy, get it from cmdline

check cmdline directly for root=dhcp(6) and netroot=dhcp(6)

(cherry picked from commit 17cee31b11)
2015-11-11 16:44:29 +01:00
Harald Hoyer df087c45d8 iscsi/iscsiroot.sh: use all_ifaces_setup()
we want the route and gateway setup

(cherry picked from commit 7cddfbbadb)
2015-11-11 16:44:20 +01:00
Harald Hoyer 5d90ba4fca network: add all_ifaces_setup()
all_ifaces_up() is true, if all interfaces are up.

all_ifaces_setup() is true, if all interfaces are up and the gateways
and nameserver are setup.

(cherry picked from commit 63e75dc4cd)
2015-11-11 16:44:13 +01:00
Harald Hoyer e847a78bb6 network/dhclient-script.sh: fix RENEW
Remove check, if interface is already up. It is for RENEW.

new_prefix is apparently new_subnet_mask

(cherry picked from commit 52845b168d)
2015-11-11 16:44:01 +01:00
Harald Hoyer 73833796b4 network: move "ip=ibft" handling to network module
(cherry picked from commit b334c83e4a)
2015-11-11 16:38:49 +01:00
Harald Hoyer e803d076f8 iscsi/parse-iscsiroot.sh: only set initiator-name, if not empty
(cherry picked from commit eb87dc91d0)
2015-11-11 16:36:25 +01:00
Harald Hoyer 7d47178e0d livenet/livenetroot.sh: fixed error condition
copy&paste error

(cherry picked from commit b813b1b306)
2015-11-11 16:19:56 +01:00
Harald Hoyer 6cfdb5aa1f network/ifup: do DHCP for BOOTDEV
(cherry picked from commit 7316d68353)
2015-11-11 16:19:43 +01:00
Harald Hoyer 29b885b46e network/net-lib.sh: fix IPv6 route parsing
(cherry picked from commit a4c47ce0dd)
2015-11-11 16:19:36 +01:00
Harald Hoyer 42b4fc90f2 network/net-lib.sh: fix wait_for_if_up()
wait for <*UP*> and not "state UP"

state can be UNKNOWN

(cherry picked from commit d8572e0bf4)
2015-11-11 16:19:25 +01:00
Harald Hoyer b519ae7008 network/ifup: fix warning about not bringing interface up
(cherry picked from commit 70f3c07846)
2015-11-11 16:19:18 +01:00
Harald Hoyer 195b5d0725 cms/cmsifup.sh: do not use ifup -m
we don't want to bring the interface up several times

(cherry picked from commit 0852c38b7a)
2015-11-11 16:19:09 +01:00
Harald Hoyer 686f9675df network/ifup.sh: only use dhcp on unknown interfaces for ip=dhcp
(cherry picked from commit 7c24815034)
2015-11-11 16:18:04 +01:00
Harald Hoyer 26fbe97bbe network: also mark interfaces up with their MAC
(cherry picked from commit 53537f4d23)
2015-11-11 16:17:57 +01:00
Harald Hoyer 744c65939b network/ifup.sh: save return value of ifup
(cherry picked from commit b4006781e8)
2015-11-11 16:17:49 +01:00
Harald Hoyer 3632be079b iscsi/parse-iscsiroot.sh: restart iscsid with try-restart
(cherry picked from commit a6befb52eb)
2015-11-11 16:17:42 +01:00
Harald Hoyer 782e909eef iscsi/parse-iscsiroot.sh: handle firmware in online queue
(cherry picked from commit 7f59cbd318)
2015-11-11 16:17:33 +01:00
Harald Hoyer 27a5aecf56 network/ifup.sh:do_static(): error out, if IP is already assigned
(cherry picked from commit 32770ca79a)
2015-11-11 16:16:09 +01:00
Harald Hoyer 5193198dc9 network/ifup.sh:do_static(): error out, if interface could not be brought up
(cherry picked from commit 77f46adf5e)
2015-11-11 16:15:57 +01:00
Harald Hoyer c606be49d7 TEST-15-BTRFS: load btrfs module
(cherry picked from commit d9b5a98532)
2015-11-11 16:15:50 +01:00
Harald Hoyer f939cffdac test/TEST-04-FULL-SYSTEMD/create-root.sh: modprobe btrfs
why so ever... it used to load automatically

(cherry picked from commit 65977ef1d1)
2015-11-11 16:15:41 +01:00
Harald Hoyer a283636b83 dmraid: only scan once because of one device
(cherry picked from commit 80153acc0f)
2015-11-11 16:15:22 +01:00
Harald Hoyer 4483fff87c network/dhclient: exit arping immediatly, if we get an answer
(cherry picked from commit d6bfa7052a)
2015-11-11 16:15:07 +01:00
Harald Hoyer c04a321b92 network/net-lib.sh:ibft unset gateway or dns, if set to 0.0.0.0
(cherry picked from commit 942d60d8af)
2015-11-11 16:15:00 +01:00
Harald Hoyer 4a88aaff10 fcoe: cleanup lldpad
Resolves: rhbz#1246217
(cherry picked from commit 69c437dd1c)
2015-11-11 16:14:51 +01:00
Harald Hoyer dd8d161afe udev-rules: install 40-redhat.rules
(cherry picked from commit 0c0abf97cc)
2015-11-11 16:08:17 +01:00
Harald Hoyer 0c004c8e64 network/parse-ip-opts.sh: bind enx* interface to the MAC
do it automatically for the persistent naming scheme

(cherry picked from commit 2eb3b00133)
2015-11-11 15:58:12 +01:00
Harald Hoyer 9ab5ddf16a network/ifup.sh: arping for static IPv4 addresses
(cherry picked from commit 38180271c5)
2015-11-11 15:58:04 +01:00
Harald Hoyer 93b9885a65 network/ifup.sh: let dhcp client run in the background
we need to renew the lease

(cherry picked from commit fb2d643a38)
2015-11-11 15:57:53 +01:00
Harald Hoyer db7d739818 systemd/dracut-cmdline.sh: print out cmdline in one line
(cherry picked from commit 93a5a3d3ca)
2015-11-11 15:57:36 +01:00
Harald Hoyer bcbcacb5d6 iscsi: handle timeout case better
(cherry picked from commit bfe65f913a)
2015-11-11 15:56:27 +01:00
Harald Hoyer 0a10d7fc51 TEST-30-ISCSI: fix test to run with new iscsi
(cherry picked from commit 836ca3f47e)
2015-11-11 15:53:48 +01:00
Harald Hoyer f5753e1861 iscsi/module-setup.sh: iscsid need /var/lib/iscsi
(cherry picked from commit f74b0a9f38)
2015-11-11 15:52:44 +01:00
Harald Hoyer 9af753c468 crypt: install drbg unconditionally in hostonly mode
older kernels had the drbg kernel module and didn't need it

(cherry picked from commit 89948e58fd)
2015-11-11 15:51:46 +01:00
Harald Hoyer 20486a16e9 man page: changed grub.conf to grub2.cfg
(cherry picked from commit 77c0b30825)
2015-11-11 15:47:46 +01:00
Harald Hoyer 848edf22f0 multipath: install all multipath path selector kernel modules
By default, dracut only builds in dm-service-time into the initramfs as
that is the default multipath.conf path selector. If the user changes
the path selector to "round robin" on the fly and runs dracut, multipath
does not find any paths on boot and the user will be dropped into a
shell.

Apparently, in RHEL7 dracut defaults to "hostonly" mode, i.e. modules
not currently in use at the time dracut runs do not get built into
initramfs. This is definitely one case where this doesn't work. A change
to reconfigure multipath probably should not render the system
unbootable.

https://bugzilla.redhat.com/show_bug.cgi?id=1195392
(cherry picked from commit f11d7a81e2)
2015-11-11 15:46:39 +01:00
Harald Hoyer 3913d061c4 livenet: don't attempt to download the image for every interface
https://bugzilla.redhat.com/show_bug.cgi?id=1152485
(cherry picked from commit e5f4bbd804)
2015-11-11 15:45:41 +01:00
Harald Hoyer cca313fa75 fcoe/fcoe-edd.sh: cleanup the script
- check if modprobe was successful
- add a timeout for /sys/firmware/edd
- only remove the module, if it was loaded by the script

(cherry picked from commit 34203d03c0)
2015-11-11 15:45:14 +01:00
Chris Leech 9a5bd6804a fcoe: EDD parsing patch for i40e
(cherry picked from commit 4031a2fa64)
2015-11-11 15:45:10 +01:00
Chris Leech 4891d9a2ce fcoe: start with fcoemon instead of fipvlan
(cherry picked from commit d02f522089)
2015-11-11 15:33:13 +01:00
Harald Hoyer 2448fbf17b network: add options to tweak timeouts
rd.net.dhcp.retry=<cnt>
     If this option is set, dracut will try to connect via dhcp
     <cnt> times before failing. Default is 1.

 rd.net.timeout.dhcp=<arg>
     If this option is set, dhclient is called with "-timeout <arg>".

 rd.net.timeout.iflink=<seconds>
     Wait <seconds> until link shows up. Default is 60 seconds.

 rd.net.timeout.ifup=<seconds>
     Wait <seconds> until link has state "UP". Default is 20 seconds.

 rd.net.timeout.route=<seconds>
     Wait <seconds> until route shows up. Default is 20 seconds.

 rd.net.timeout.ipv6dad=<seconds>
     Wait <seconds> until IPv6 DAD is finished. Default is 50 seconds.

 rd.net.timeout.ipv6auto=<seconds>
     Wait <seconds> until IPv6 automatic addresses are assigned.
     Default is 40 seconds.

 rd.net.timeout.carrier=<seconds>
     Wait <seconds> until carrier is recognized. Default is 5 seconds.

(cherry picked from commit d8ad687e1a)
2015-11-11 15:26:29 +01:00
Harald Hoyer 6138a45dd2 iscsi/parse-iscsiroot.sh: do not modify netroot
(cherry picked from commit 197e4c90b9)
2015-11-11 15:21:27 +01:00
Harald Hoyer 7391fef29a iscsi/iscsiroot.sh: handle firmware in online queue
otherwise it does not get called, if no netroot is set

(cherry picked from commit 3bd3bbec31)
2015-11-11 15:21:19 +01:00
Harald Hoyer 01430d27d4 dracut.spec: raise systemd requirement to >= 219
needs systemd-escape

(cherry picked from commit 35f40b75e4)
2015-11-11 15:21:03 +01:00
Harald Hoyer ab57132aa5 initqueue: add online queue
(cherry picked from commit d3f61fb5cd)
2015-11-11 15:20:36 +01:00
Harald Hoyer 6251f82c6f TEST-30-ISCSI: add rd.scsi.firmware
(cherry picked from commit 310574f7ea)
2015-11-11 15:12:05 +01:00
Harald Hoyer 3e1c531b4e Makefile: remove output file before creating it 2015-11-11 12:33:07 +01:00
Harald Hoyer 64c34f3459 dracut-systemd/module-setup.sh: remove duplicate vconsole wants
Adding the dependency on vconsole is already done in the 00systemd
module and the rescue.service has this already in the unit file.
2015-11-11 12:16:13 +01:00
Harald Hoyer 2cc5e92e21 dracut.sh: quote $outfile on error removal 2015-11-11 11:49:34 +01:00
Harald Hoyer 875426f2fc dracut.sh: remove "_EARLY" from CONFIG_MICROCODE_* checks
EARLY is merged in the main driver
2015-11-11 11:48:32 +01:00
Harald Hoyer 53a7384653 lvm: remove all quirk arguments
https://bugzilla.redhat.com/show_bug.cgi?id=742564

Once lvm2 starts using /run (bug 742554), it should be no longer
necessary to disable file-based locking in the vgchange call in
fedora-storage-init.
Removing '--sysinit' will make it safe to call LVM operations
concurrently from other units.

The --sysinit is a compound option consisting of:

  -> --ignorelockingfailure - not needed anymore, the /run/lock/lvm is
available rw soon in boot process

  -> --ignoremonitoring - not needed since /run is available, this would
require the dm-event.service to be run before
fedora-storage-init.service (and new lvm2-activation.service when
deployed). But that's a one line change - I'll have a look whether it
plays well with other services and if yes, I'll commit the change. N.B.:
This has a consequence that all volumes activated on vgchange -ay will
be monitored at the same time they're activated (which is a plus I
think). The lvm2-monitor will just grab all the other volumes not
activated at the time of the boot's vgchange -ay call. But that's not an
issue (for already monitored volumes, calling vgchange --monitor y will
just be a NOOP).

 -> --poll n - not needed, we can run the polldaemon as the /run is
available and rw (in case there's unfinished merge or mirror sync from
previous system run, the poll-daemon will be triggered at boot now).
Actually, the polldaemon should be triggered as a service like dmeventd
is, not forked off from the LVM command itself, like from vgchange in
this case - we still need to change this - there's a bug open for this
request already (bug #814857). However, we don't have this feature ready
yet so I need to check whether this is OK with the early boot process
with the current state.
2015-11-11 11:48:32 +01:00
Harald Hoyer c97209fe69 fips: add authenc and authencesn kernel modules
https://bugzilla.redhat.com/show_bug.cgi?id=1115112#c5
2015-11-11 11:48:32 +01:00
Harald Hoyer 9befacf0c5 dracut.spec: omit pkg-config from dependencies 2015-11-11 11:48:32 +01:00
Harald Hoyer 8019e0eef3 Makefile: fix VERSION and GITVERSION 2015-11-11 11:48:32 +01:00
Harald Hoyer 3177d12d2b Merge pull request #91 from dracut-mailing-devs/1437470322-992-1-git-send-email-cfan@redhat.com
remove the incomplete .img file
2015-11-11 11:48:21 +01:00
Harald Hoyer fac92cfbad Merge pull request #100 from d-hatayama/suppress_broken_pipe
lsinitrd: Suppress "cat: write error: Broken pipe"
2015-11-11 11:43:50 +01:00
Harald Hoyer 5593ee7172 Merge pull request #101 from silvio/sfr/pkgfile
Sfr/pkgfile
2015-11-11 11:42:29 +01:00
Harald Hoyer fc146519f9 Merge pull request #103 from FGrose/metadata
dmsquash-live-root: Use non-persistent metadata snapshots.
2015-11-11 11:36:47 +01:00
Harald Hoyer 87894441c7 Merge pull request #102 from FGrose/Overflow
dmsquash-live-root: Request overflow support for persistent snapshot.
2015-11-11 10:33:33 +01:00
Frederick Grose 49c9d8174f dmsquash-live-root: Use non-persistent metadata snapshots.
Transient snapshots can take advantage of smaller,
   non-persistent metadata structures.
Make the --readonly option explicit rather than inferred
   for the readonly_overlay target.
Assure that the live-base target is on the BASE_LOOPDEV.
2015-11-09 10:46:27 -08:00
Frederick Grose 97be933592 dmsquash-live-root: Request overflow support for persistent snapshot. 2015-11-09 09:45:07 -08:00
Harald Hoyer 8e1c4b354c dracut-logger: prefix stderr output with "dracut: "
dnf updates of the kernel execute dracut in %post.
For the user it is not possible to distinguish the dracut output from
other error messages.
2015-11-09 15:35:53 +01:00
Silvio Fricke 0d5c02d3ab PKGFILE: prevent out of tree builds
With makepkg is it possible to build sources away from the PKGFILE. The
previous behavior was crash on build if this was setup. With this
patch we prevent this possibility.

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
2015-11-08 12:57:33 +01:00
Silvio Fricke 4cca17eeec PKGFILE: version is now completely constructed from git
`pkgver` and `pkgrel` now hard coded to 1. The PKGFILE will getting
changed on a `makepkg`-run.

To prevent some version crashes no commit with changes to `pkgver` and
`pkgrel` should be accepted.

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
2015-11-08 12:56:47 +01:00
Silvio Fricke eb150a4fee PKGFILE: update to latest makepkg
makepkg needs now a package-section.

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
2015-11-08 12:56:36 +01:00
HATAYAMA Daisuke 3ce142861d lsinitrd: Suppress "cat: write error: Broken pipe"
On systemd, SIGPIPE is ignored by default; see man 5 systemd.exec for
IgnoreSIGPIPE=. As a result, lsinitrd.sh under a systemd service
outputs "cat: write error: Broken pipe" in the processing of
determining a compression format of a given initramfs file using cat
command in the write part of a pipeline processing.

For example, this is a log message of kdump.service in RHEL7.1,

    -- Logs begin at Wed 2015-11-04 09:57:33 JST, end at Wed 2015-11-04 09:58:28 JST. --
    Nov 04 09:57:33 localhost systemd[1]: Stopping Crash recovery kernel arming...
    Nov 04 09:57:33 localhost kdumpctl[22545]: kexec: unloaded kdump kernel
    Nov 04 09:57:33 localhost kdumpctl[22545]: Stopping kdump: [OK]
    Nov 04 09:57:33 localhost systemd[1]: Starting Crash recovery kernel arming...
    Nov 04 09:57:36 localhost kdumpctl[22553]: Detected change(s) in the following file(s):
    Nov 04 09:57:36 localhost kdumpctl[22553]: /etc/kdump.conf
    Nov 04 09:57:36 localhost kdumpctl[22553]: Rebuilding /boot/initramfs-3.10.0-229.el7.x86_64kdump.img
    Nov 04 09:57:40 localhost dracut[24914]: Executing: /usr/sbin/dracut --hostonly --hostonly-cmdline -o "plymouth dash resume" -f /boot/initramfs-3.10.0-229.el7.x86_64kdump.img 3.10.0-229.el7.x86_64
    ...<cut>...
    Nov 04 09:58:12 localhost dracut[24914]: *** Creating image file done ***
    Nov 04 09:58:12 localhost dracut[24914]: Image: /boot/initramfs-3.10.0-229.el7.x86_64kdump.img: 18M
    Nov 04 09:58:12 localhost kdumpctl[22553]: cat: write error: Broken pipe
    Nov 04 09:58:12 localhost dracut[24914]: ========================================================================
    Nov 04 09:58:12 localhost dracut[24914]: Version: dracut-033-240.el7
    Nov 04 09:58:12 localhost dracut[24914]:
    Nov 04 09:58:12 localhost dracut[24914]: Arguments: --hostonly --hostonly-cmdline -o 'plymouth dash resume' -f
    Nov 04 09:58:13 localhost dracut[24914]:
    Nov 04 09:58:13 localhost dracut[24914]: dracut modules:
    Nov 04 09:58:13 localhost dracut[24914]: bash

kdump.service builds and loads an initramfs for kdump kernel using
kdumpctl command which uses dracut command and so lsinitrd command,
too.

Although there's no actual harm except for the error message, there
has been several inquiries from customers about this message so
far. We should suppress this message to reduce needless
communications.

To suppress the message, this commit cleans up the processing of
reading the first 6 bytes of a given initramfs file without cat
command.
2015-11-05 09:53:58 +09:00
Frederick Grose 0ea86cb727 dmsquash-live-root: Use non-persistent metadata snapshots for transient overlays.
Temporary snapshots can take advantage of smaller, non-persistent metadata structures.
Make the --readonly option explicit rather than inferred for the readonly_overlay target.
Assure that the live-base target is on the BASE_LOOPDEV.
2015-10-09 16:23:58 -04:00
Harald Hoyer 9d2a3f80cf Merge pull request #95 from cgwalters/emacs-setq
dir-locals: Avoid use of setq which triggers Emacs warning
2015-09-17 17:54:36 +02:00
Colin Walters 10d03bbfbc dir-locals: Avoid use of setq which triggers Emacs warning
Emacs has a whitelist of "safe" variables, using `setq` overrides
that and causes it to warn when opening any file by default.

Dropping the `setq` makes Emacs do the right thing.
2015-09-17 11:33:40 -04:00
Harald Hoyer 820f81016a dracut.8.asc: mention lsinitrd(1) in see also 2015-09-09 11:30:52 +02:00
Harald Hoyer eed08b6988 Merge branch 'master' of github.com:haraldh/dracut 2015-09-07 15:13:04 +02:00
Harald Hoyer a9caf07fb3 Merge pull request #94 from yuwata/master
Fix typos in error module messages and usage of install blob.
2015-09-07 15:12:49 +02:00
yuwata fc212358da install blob: fix typos in usage. 2015-09-07 18:00:16 +09:00
yuwata 0888cf51ab systemd-networkd: fix typo in error message 2015-09-07 17:58:40 +09:00
yuwata 5cb1e0efea systemd-initrd: fix typo in error message. 2015-09-07 17:58:00 +09:00
Harald Hoyer ea877ac6cc dracut-functions.sh: fixed dracutbasedir, when sourced directly 2015-09-03 12:31:34 +02:00
Harald Hoyer 5816375273 Merge pull request #87 from dracut-mailing-devs/E1ZK3hi-0000SN-Lt@puleglot.ru
dracut-initramfs-restore: make mount error nonfatal
2015-09-02 12:54:43 +02:00
Harald Hoyer 419105df27 Merge pull request #90 from ldzhong/fix
dracut.sh: remove duplicate call of push_host_devs
2015-08-25 12:03:16 +02:00
Lidong Zhong aa169b3bd3 dracut.sh: remove duplicate call of push_host_devs
There is no way exit between the two places that call push_host_devs
2015-08-24 18:27:54 +08:00
Harald Hoyer 378ed5ecc1 Merge pull request #89 from ldzhong/fix
dracut-functions.sh: remove duplicate declaratio of local variable
2015-08-24 12:11:39 +02:00
Lidong Zhong 9918afd244 dracut-functions.sh: remove duplicate declaratio of local variable 2015-08-24 18:03:02 +08:00
Harald Hoyer e0a5dec4a4 Merge pull request #88 from shoop/staticroutegw
The default gateway might need a static route
2015-08-24 11:53:01 +02:00
Stijn Hoop 110858025a The default gateway might need a static route
Some hosting providers need a static route set in order to be
able to reach the default gateway. Be sure to retry adding
the default gateway after setting the static routes.
2015-08-23 14:45:53 +02:00
Harald Hoyer 0a66b74b51 TEST-30-ISCSI: test more and set static initiator name 2015-08-13 11:54:24 +02:00
Harald Hoyer 6802cf2349 iscsi/iscsiroot.sh: handle timeout with all interfaces up
restart iscsid, because it may disbehaved
2015-08-13 11:53:21 +02:00
Harald Hoyer feb8dc685d iscsi/parse-iscsiroot.sh: use iBFT initiator name 2015-08-12 15:17:33 +02:00
Harald Hoyer 69171aa8fa dracut.cmdline.7.asc: document rd.iscsi.waitnet and rd.iscsi.testroute 2015-08-12 15:11:17 +02:00
Harald Hoyer c22c43f81a TEST-30-ISCSI: switch to scsi-target-utils
netbsd-iscsi is not available on RHEL

Beef up the testsuite to use the two targets over different
interfaces.

Test the new iSCSI parameters rd.iscsi.waitnet and rd.iscsi.testroute.
2015-08-12 14:48:19 +02:00
Harald Hoyer 52b91b6698 TEST-30-ISCSI/dhcpd.conf: set the LUN
set the LUN, so the udev rule to mount the disk matches
2015-08-12 14:40:42 +02:00
Harald Hoyer d94050ddae iscsi: integrate with systemd and improve robustness
parse-cmdline sets up an initial initiator-name to let iscsid start.

iscsid is started before doing any iscsistart business.

iscsistart is done with systemd-run asynchrone to do things in
paralllel. Also restarted for every new interface which shows up.

If rd.iscsi.waitnet (default) is set, iscsistart is done only
after all interfaces are up.

If not all interfaces are up and rd.iscsi.testroute (default) is set,
the route to a iscsi target IP is checked and skipped, if there is none.

If all things fail, we issue a "dummy" interface iscsiroot to retry
everything in the initqueue/timeout.
2015-08-12 14:33:49 +02:00
Harald Hoyer f41720c311 base/dracut-lib.sh: forget about the idea of output redirection
It's just not working :-/
2015-08-12 14:28:45 +02:00
Harald Hoyer 8ba684be1c dracut-systemd/dracut-initqueue.sh: be verbose about timeout
Issue a warning, if timeout scripts are executed
2015-08-12 14:27:39 +02:00
Harald Hoyer 50e86bf02b nfs/parse-nfsroot.sh: silence useless warning if netroot is not nfs 2015-08-12 14:27:01 +02:00
Harald Hoyer 4e9ba952bf network/parse-ip-opts.sh: assume rd.neednet for multiple ip options
set rd.neednet on the kernel cmdline to disable this behaviour
2015-08-12 14:25:23 +02:00
Harald Hoyer b1b704bd67 systemd: add systemd-run and systemd-escape 2015-08-12 14:24:45 +02:00
Harald Hoyer 01b23b6900 network/net-lib.sh: add is_ip()
add function to test if string is a valid IP
2015-08-12 14:24:05 +02:00
Harald Hoyer 3c00189988 dracut.sh: remove quotes from install_items and install_optional_items
Unfortunately these are lists with whitespaces.
2015-08-10 14:05:15 +02:00
Harald Hoyer e6a2555c7d base/dracut-lib.sh: Dup stdout and stderr
Dup stdout and stderr, so that subshell redirection does not affect
logging.

Also gets rid of systemd printing info() to the console on "quiet".
2015-08-10 13:40:43 +02:00
Mimi Zohar 4f50a9bfb1 Revert securitfs change
Commit 5e60145 use findmnt with "--source" or "--target" broke
mounting securityfs.  This patch reverts only the securityfs
portion of the patch.
2015-08-03 12:36:05 +02:00
Mimi Zohar 41ac16b26f Define new script to load keys on the IMA keyring (update)
This patch supports loading keys either on the _ima keyring or, as of
Linux 3.17, on the trusted .ima keyring.  Only certificates signed by
a key on the system keyring can be loaded onto the trusted .ima keyring.

Changelog:
- Update 98integrity/README
2015-08-03 12:36:05 +02:00
Mimi Zohar 396d3cc7ff Extend evm-enable.sh to load the EVM public key
Create the _evm keyring and load the EVM public key on it.
2015-08-03 12:36:05 +02:00
Mimi Zohar b05ad85b0c Remove 98integrity's dependency on selinux
Loading the EVM key(s) is not dependent on selinux.  Remove
the dependency.
2015-08-03 12:36:05 +02:00
Harald Hoyer 4135eea634 90qemu: fixed systemd-detect-virt output parsing
redirecting systemd-detect-virt to /dev/null doesn't help with parsing
the output :-/

Also, add "Red Hat" as a vendor.
2015-07-31 09:05:51 +02:00
Harald Hoyer 96d694c0b5 dracut.sh: simplify modalias reading 2015-07-30 12:11:42 +02:00
Alexander Tsoy da5304aabc dracut-initramfs-restore: make mount error nonfatal
Script enables errexit option (set -e). So if /boot is not a mount point
or is already mounted, then script dies after unsuccessful mount
command. Fix this by always returning successful result.
2015-07-28 15:04:56 +02:00
Harald Hoyer cce34acace qemu: add spapr-vscsi kernel module 2015-07-28 11:55:04 +02:00
Harald Hoyer 607ff8204b Merge pull request #85 from Quarky9/master
40network/net-lib.sh: get_ip() Add missing echo to output the result
2015-07-27 13:40:53 +02:00
Harald Hoyer 2082cdf230 crypt: s/allow-discards/discard for crypttab
actually the option in crypttab is named "discard" and not
"allow-discards"

https://bugzilla.suse.com/show_bug.cgi?id=932972
2015-07-27 13:30:22 +02:00
Stefan Reimer c1c96f2c47 Add missing echo to output the result.
Only place this function is currently called seems from line 28 in modules.d/95nfs/nfs-lib.sh. Bug fix.
2015-07-25 01:17:04 +00:00
Harald Hoyer 693b7a3283 Cleanup compressor handling
If no compressor is specified, try to find a suitable one.

Check if kernel modules can be uncompressed.
2015-07-22 11:35:28 +02:00
Chao Fan 7eeaa4ab14 remove the incomplete .img file
If the directory where the .img file is saved has no enough space, or in
other wrong conditions, dracut will get an incomplete file xxx.img. But
sometimes this .img file will be loaded when rebooting the system. And then
some bugs will happen because this .img file is wrong.

So I think dracut should remove the incomplete file because this .img file
with problems was made by dracut. And then the wrong file will not be loaded
anymore.

Signed-off-by: Chao Fan <cfan@redhat.com>
2015-07-21 12:05:42 +02:00
Harald Hoyer f4d64d55ea dmsquash-generator.sh: increase timeout for checkisomd5
if the checkisomd5 takes longer than 3 minutes, the device timeout for
/dev/mapper/live-rw cancels the boot process.
2015-07-18 13:02:25 +02:00
Harald Hoyer ff55a8939c Merge pull request #81 from floppym/printf2
Replace echo -n with printf in code with a /bin/sh shebang
2015-07-16 12:02:48 +02:00
Harald Hoyer e50f91e600 use mktemp "-p" instead of "--tmpdir" for busybox 2015-07-15 11:47:43 +02:00
Harald Hoyer 7f2ea02b4a dracut.spec: add dracut-init.sh 2015-07-15 11:47:43 +02:00
Mike Gilbert 24f32511fc syncheck: Look for 'echo -n' usage in modules 2015-07-14 22:24:27 -04:00
Mike Gilbert 5899f2f516 Replace echo -n with printf in code with a /bin/sh shebang
POSIX does not mandate that echo support the -n parameter.
printf has more well-defined behavior.
2015-07-14 22:22:14 -04:00
Harald Hoyer e47907cc6b dracut-systemd/dracut-initqueue: only start service if really needed
Only start the dracut-initqueue.service, if the dracut_need_initqueue
command was issued on creation or later on set.
2015-07-13 10:51:47 +02:00
Harald Hoyer 968280e370 crypt: skip crypttab entries with the same device
It was only checked, if the name of the crypttab entry matched.
This patch adds checking, if the device matches.
2015-07-13 10:44:27 +02:00
Harald Hoyer 8c7dc032f8 TODO: update 2015-07-13 10:38:16 +02:00
Harald Hoyer df0bdd5ae9 network: add rd.peerdns=0 parameter
Add rd.peerdns=0 parameter to disable DHCP nameserver setting
2015-07-13 10:14:15 +02:00
Harald Hoyer ee44f62972 dracut.sh: early check for bash version 2015-07-09 19:44:30 +02:00
Harald Hoyer e8f19bcf26 dracut.sh: remember $0 for --regenerate-all 2015-07-09 18:22:15 +02:00
Harald Hoyer cb0913db0d dracut.sh: reduce code 2015-07-09 18:06:55 +02:00
Harald Hoyer 32de4eb5d3 dracut-functions.sh: simplify some for loops
continue early, if condition is not met
2015-07-09 15:36:25 +02:00
Harald Hoyer 3721635b2c guard ${arrays[@]} with "" 2015-07-09 15:36:25 +02:00
Harald Hoyer 694725abf0 dracut.sh: remove pop() 2015-07-09 15:36:25 +02:00
Harald Hoyer e833e26137 dracut.conf: remove example parameters 2015-07-09 15:36:25 +02:00
Harald Hoyer 5a66d51102 dracut.sh: remove push()
can be done with var+=(val)
2015-07-09 15:36:25 +02:00
Harald Hoyer 1cadc26fd4 Add all btrfs devices
We have to find them with "btrfs usage", which is cumbersome.
2015-07-09 15:36:25 +02:00
Harald Hoyer 78362bc5fe network/dhclient-script.sh: remove bashism 2015-07-08 08:49:02 +02:00
Harald Hoyer 7ecb36aef4 TEST-50-MULTINIC/test.sh: correctly call ldconfig 2015-07-07 15:34:30 +02:00
Harald Hoyer 3fa31c3a47 TEST-14-IMSM: remove "rd.auto"
otherwise rd.auto auto assembles the device
2015-07-07 14:31:16 +02:00
Harald Hoyer 9ee2f1e235 TEST-04-FULL-SYSTEMD: fixup loadkeys keymap loading 2015-07-07 14:31:06 +02:00
Harald Hoyer e860ef0e30 dracut-pre-mount.service should run before systemd-fsck-root.service 2015-07-07 13:45:19 +02:00
Andrei Borzenkov 6c9484f614 ensure pre-mount (and resume) run before root fsck
References:
https://bugzilla.suse.com/show_bug.cgi?id=906592
Signed-off-by: Thomas Renninger <trenn@suse.de>
2015-07-07 13:44:24 +02:00
Thomas Renninger 162daf0c97 Use the uncompressed kernel file on arm and aarch to detect kernel version
This is due to file cannot read out the kernel version on these.

Many thanks to Alexander Graf finding this in old SUSE mkinitrd code.
Converted by Thomas Renninger.

Signed-off-by: Thomas Renninger <trenn@suse.de>

https://bugzilla.suse.com/show_bug.cgi?id=908454
Signed-off-by: Thomas Renninger <trenn@suse.de>
2015-07-07 13:44:24 +02:00
Thomas Renninger 01e60ca4f6 mkinitrd-suse.sh: Bail out with exit 1 if initrd cannot be generated
Signed-off-by: Thomas Renninger <trenn@suse.de>
2015-07-07 13:44:24 +02:00
Hannes Reinecke b8efaa0017 Reset IFS variable
Setting and unsetting the IFS variable is tricky. To be on the
safe side we should always reset the IFS variable to its original
value after parsing.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2015-07-07 13:44:24 +02:00
Harald Hoyer 6318baa45f skipcpio/skipcpio.c: linux kernel only accepts "070701" signature
don't bother with other signatures
2015-07-07 13:44:13 +02:00
Harald Hoyer 3d579309cd dmsquash-live/dmsquash-live-root.sh: fixup checkisomd5 for systemd
systemd does not like a leading "-" for unit template filenames anymore.
2015-07-07 13:44:13 +02:00
Harald Hoyer f621aeba65 Merge pull request #78 from dracut-mailing-devs/20150706073126.GC22559@dhcp-128-51.nay.redhat.com
90multipath: add hostonly multipath.conf in case hostonly mode
2015-07-07 13:16:27 +02:00
Harald Hoyer 59815841e9 Merge pull request #77 from dracut-mailing-devs/1435792513-2222-1-git-send-email-crrodriguez@opensuse.org
systemd: if kdbus is available, include the kernel module
2015-07-07 13:15:34 +02:00
Dave Young 77403e0032 90multipath: add hostonly multipath.conf in case hostonly mode
For large machine, suppose there's a lot of multipath devices, multipath layer
will use a lot of memory. For kdump kernel memory is very limited thus it causes
oom. To avoid oom, we only add necessary multipath devices in kdump kernel
multipath.conf.

This is done by use mpathconf --allow, a new option which is like whitelist.

Signed-off-by: Dave Young <dyoung@redhat.com>
2015-07-06 10:06:04 +02:00
Harald Hoyer 8d09f493a6 network/dhclient-script.sh: fixup lease time 2015-07-02 19:48:25 +02:00
Harald Hoyer 777f2db037 splitup dracut-init.sh from dracut-functions.sh
other tools want to source dracut-functions.sh without any mkdir side
effects.
2015-07-02 16:04:05 +02:00
Harald Hoyer ba665de454 nfs/nfs-lib.sh: add anaconda_nfsv6_to_var()
add "nfs:[[2001:0db8:85a3:08d3:1319:8a2e:0370:7344]]/path" style parsing

https://bugzilla.redhat.com/show_bug.cgi?id=1190098
2015-07-02 15:24:03 +02:00
Harald Hoyer 57fb6e67de dracut-lib.sh:info() output info to stderr
otherwise it might collide with stdout redirection
2015-07-02 15:02:31 +02:00
Harald Hoyer 916559e073 dracut.sh: add devices with x-initrd.mount in /etc/fstab to host_devs
otherwise dracut might not even be able to mount those.
2015-07-02 14:55:31 +02:00
Harald Hoyer 3639fe543c lower the log level for dfatal 2015-07-02 11:36:33 +02:00
Harald Hoyer 7cca5efdce network: don't use "ifup -m"
"ifup -m" was thought to be used by humans in the emergency shell.
Using it programatically shows some other flaw in the execution logic.

Also, "ifup -m" was configuring the interface multiple times on "add"
and "change" uevent, because the "$netif.did-setup" test was not
executed.
2015-07-02 11:36:33 +02:00
Harald Hoyer 0f89ec314b network/dhclient-script.sh: make IPv4 DHCP lease time optionally
If bootp is used, no lease time is provided in the packet from the bootp
server.
2015-07-02 11:36:33 +02:00
Harald Hoyer cf627b20d0 network/dhclient-script.sh: add RENEW/REBIND 2015-07-02 11:36:33 +02:00
Cristian Rodríguez 90ff5ad67e systemd: if kdbus is available, include the kernel module 2015-07-02 02:02:51 +02:00
Harald Hoyer 08eca6756f Merge pull request #76 from fabiand/activationskip
Revert "lvm: Don't activate LVs with activationskip set"
2015-06-25 12:20:13 +02:00
Fabian Deutsch d4b93a092d Revert "lvm: Don't activate LVs with activationskip set"
This reverts commit cfa365a32d.

The logic in commit cfa365a was added to prevent (odl) lvms from
activating snapshots which should not be activated.
Newer lvms however do this automatically (not enabling an LV if the
the 'k' attribute set), thus we can revert the previous commit.
2015-06-25 12:11:15 +02:00
Harald Hoyer c42064a684 dracut.spec: turn requires in recommends 2015-06-23 15:29:44 +02:00
Harald Hoyer 47ff68e78b dracut.spec: Recommends grubby 2015-06-23 15:29:43 +02:00
Harald Hoyer ac13778f60 dracut.spec: move dmsquash and livnet to subpackage
dmsquash and livenet need img-lib, which needs tar, which is normally
not needed.
2015-06-23 15:29:43 +02:00
Harald Hoyer aca93e3364 uefi-lib: remove bogus comment 2015-06-23 15:29:43 +02:00
Harald Hoyer 231b3dd432 rootfs-generator: check for rootok, before doing any action 2015-06-23 15:29:43 +02:00
Harald Hoyer 70de22e63b Merge pull request #74 from xnox/master
Fix default udev & systemd dir detection, in usr-merge configurations.
2015-06-23 14:12:40 +02:00
Dimitri John Ledkov 80dab03a7d Fix default udev & systemd dir detection, in usr-merge configurations.
Test that /lib is not a symlink, before using split-usr paths.
2015-06-22 11:56:28 +01:00
Harald Hoyer eab03540cd NEWS: version 043 2015-06-15 12:27:21 +02:00
Harald Hoyer a97787c7b5 Merge pull request #73 from dracut-mailing-devs/1434358579-11674-1-git-send-email-lzhong@suse.com
dracut-lib.sh: typo fix
2015-06-15 11:31:53 +02:00
Harald Hoyer 2c66c3bccf dmsquash-live: add dmsquash-generator 2015-06-15 11:31:10 +02:00
Harald Hoyer e4e7801d29 Merge pull request #71 from jsynacek/doc-fix
doc: fix formatting
2015-06-15 11:28:33 +02:00
Lidong Zhong e51e7978a8 dracut-lib.sh: typo fix
Signed-off-by: Lidong Zhong <lzhong@suse.com>
2015-06-15 11:05:18 +02:00
Jan Synacek ca96509c97 doc: fix formatting 2015-06-15 09:58:28 +02:00
Harald Hoyer 04bf862d97 NEWS & AUTHORS update - 042 2015-06-11 17:39:47 +02:00
Harald Hoyer 3f979ee495 TODO: update 2015-06-11 17:39:47 +02:00
Harald Hoyer 3944c4b136 TEST-16-DMSQUASH: add more debug parms 2015-06-11 17:39:47 +02:00
Harald Hoyer 97ff396a97 run-qemu: default kernel to "/lib/modules/${KVERSION}/vmlinuz"
newer Fedora kernel install the kernel to /lib/modules
2015-06-11 17:39:47 +02:00
Harald Hoyer 8ff624df9f dmsquash-live: install a sysroot.mount generator for systemd
otherwise systemd uses its own sysroot.mount line
2015-06-11 17:39:31 +02:00
Harald Hoyer 5711f54312 crypt: check for crypttab before reading 2015-06-09 15:05:32 +02:00
Harald Hoyer c3cdd9f6e1 udev-rules: add 60-block.rules 2015-06-09 15:05:32 +02:00
Harald Hoyer 1339095dba dracut-functions.sh: only honor the first [0-9]+<module> dir
If multiple directories with different numbers exist, only honor the
first one.
2015-06-09 15:05:32 +02:00
Harald Hoyer 4358ace43c fixup test suite
- qemu wants to have "format=raw"
- "-kernel" is obsolete, because run-qemu picks the right path
2015-06-09 13:36:46 +02:00
Harald Hoyer 8b52e96f09 dracut.conf.5.asc: document "compress" 2015-06-09 12:30:14 +02:00
Harald Hoyer 0ad2471c3a dracut.conf.5.asc: add missing "=" 2015-06-05 12:59:58 +02:00
Christian Rodrigues b52cfbeaa5 Correct paths for openSUSE
openSUSE has things stored in different places, so fixup the
paths here.

Signed-off-by: Christian Rodrigues <crrodriguez@opensuse.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2015-06-02 12:24:59 +02:00
Hannes Reinecke 6755c20855 95fcoe-uefi: Test for EFI firmware
The fcoe-uefi module should test for EFI firmware when called
in 'hostonly' mode; of no EFI firmware is found then the module
doesn't need to be included.

References: bnc#882412

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2015-06-02 12:24:58 +02:00
Cristian Rodríguez 7c433a0b43 systemd: include systemd-random-seed.service
In current systemd releases there is no random-seed-load service
only systemd-random-seed.service
2015-06-02 12:06:49 +02:00
Jan Synacek d5e5855b74 doc: fix typo 2015-06-02 12:05:21 +02:00
Harald Hoyer 3b1d78880f Merge pull request #58 from dracut-mailing-devs/20150326044148.10121.15286.stgit@notabene.brown
mdraid fixes
2015-06-02 12:04:51 +02:00
NeilBrown 4d9d767da2 crypt/parse-crypt.sh: hide encrypted devices from systemd timeout warnings.
When systemd's crypttab generator parsed crypttab, it tells
systemd about several devices which may not appear until later
in the boot sequence, and which are not needed while dract is running.

This can particularly happen when an md array is encrypted,
and the array is newly degraded so that it doesn't appear until
dracut runs mdraid_start.sh.

This can result in systemd printing warning messages which are
inappropriate.

So tell systemd that the timeout for each of these is zero.

This is involves splitting some functionality out of wait_for_dev()

That function does two things:
 - creates 'finished' hooks so that dracut will wait for the device,
   and
 - sets the systemd timeout for the device to zero, so systemd doesn't
   wait.

We only want the second of these for most encrypted devices.
So split that out into a new function set_systemd_timeout_for_dev(),
and call it from parse-crypt.sh

Signed-off-by: NeilBrown <neilb@suse.de>

--
This version fixes the missing redirect from /etc/crypttab
NeilBrown
2015-06-02 12:03:43 +02:00
Harald Hoyer b562bc55a8 Merge pull request #67 from dracut-mailing-devs/1432116434-18050-1-git-send-email-cfan@redhat.com
Change the fs_passno of nfs to 0
2015-06-02 11:57:58 +02:00
Harald Hoyer dfec3c2d8b Merge pull request #68 from dracut-mailing-devs/1431698021-16626-3-git-send-email-colin@mageia.org
dracut: Make host only mode more resilient to missing swaps.
This patch set allows swap devices to disappear without cocking up a
host-only initramfs boot.
2015-06-02 11:54:07 +02:00
Harald Hoyer 8c5d18c2cb Merge pull request #44 from MrStaticVoid/fix-crypt-loop-info-log-level
crypt-loop: Fix decrypt when running at info log level
2015-06-02 11:49:25 +02:00
Harald Hoyer d6e23c46c2 Merge pull request #45 from MrStaticVoid/fix-crypt-loop-hostonly-kernel-module
crypt-loop: Always include 'loop' kernel module
2015-06-02 11:47:58 +02:00
Harald Hoyer 4f0c7fc917 dracut-initramfs-restore.sh: try to mount /boot
This is very useful when /boot has the "noauto" option.

Thanks to Igor Filakhtov
2015-06-02 11:47:04 +02:00
Nikoli c4184b5cf1 Mount /dev, /dev/shm and /run noexec 2015-06-02 11:46:59 +02:00
Harald Hoyer 1a61d85ef2 Merge pull request #51 from dracut-mailing-devs/13711492.8HAMuGhYIN@thunder
Add support for ethernet point-to-point connections configured via DHCP
2015-06-02 11:44:39 +02:00
Harald Hoyer 514aeec5b4 Merge pull request #53 from dracut-mailing-devs/E1YQLG5-00009v-BS@puleglot.ru
base/dracut-lib.sh: remove bashism
2015-06-02 11:20:10 +02:00
xtraeme 6964169368 Portability fixes:
- Use uid_t not __uid_t.
- Define _GNU_SOURCE for cpu_set_t and others.
- Include string.h for strncmp().
- Detect musl's ldd error message.
2015-06-02 11:17:13 +02:00
Harald Hoyer acf82efd52 Merge pull request #64 from fabiand/lvm-activationskip
Respect LVM activationskip
2015-06-02 11:11:40 +02:00
Harald Hoyer e409c9e8f8 Merge pull request #65 from scop/comment
Fix stale comment about required bash version
2015-06-02 11:10:59 +02:00
Harald Hoyer 0e5c01f8b8 Merge pull request #66 from scop/lbzip2
Use lbzip2 instead of bzip2 if available
2015-06-02 11:10:29 +02:00
Harald Hoyer 311aee1bff dracut.spec: use the autosetup macro to apply the patches 2015-05-28 19:49:08 +02:00
Harald Hoyer 0b7bfacfea network: setup gateway after setting up resolv.conf
If a daemon listens for route changes and wants to use the interface
afterwards, it should be able to resolve DNS
2015-05-28 19:47:37 +02:00
Harald Hoyer 3ac9cdb1c5 dracut.sh: fall back to /usr/lib/os-release, if /etc/os-release missing 2015-05-28 19:47:37 +02:00
Harald Hoyer c071990c2c udev-rules: optionally install /etc/udev/udev.conf
udevd runs even without this config file
2015-05-28 19:47:37 +02:00
Ville Skyttä ee84640963 Use lbzip2 instead of bzip2 if available 2015-05-24 22:29:20 +03:00
Ville Skyttä f8139a8b28 Fix stale comment about required bash version 2015-05-24 22:26:20 +03:00
Fabian Deutsch cfa365a32d lvm: Don't activate LVs with activationskip set
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1186854
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
2015-05-21 12:38:05 +02:00
Fabian Deutsch a1b4efe6a7 doc: Add a minimal rd.live.overlay documentation
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
2015-05-21 12:37:38 +02:00
Chao Fan 3586a7aa77 Change the fs_passno of nfs to 0
There is a bug that kdump-initrd contains entry requesting nfs dump
filesystem to get filesystemchecked. And there is an erro message said
that nfs need be checked. But there's no fsck for nfs utility, e.g
fsck.nfs like other file system. Whatever fs_passno 0 or 2 are passed,
no fsck is executed at all for nfs mount.But in dracut, set it to be 2
always, so the erro message appear and it should be set to 0.

In the fstab,the sixth variable fs_passno stands for that the device need
checked or not,and dracut set it to "2".To fix this issue, it should
be "0" when the device is nfs.The third variable stands for the type of
the filesystem and we can use it to judge whether the device is nfs.
So when the third variable of fstab contains "nfs", the sixth variable
fs_passno should be set to "0".

Signed-off-by: Chao Fan <cfan@redhat.com>
2015-05-20 12:07:57 +02:00
Harald Hoyer 81b67232dc 50drm: add hyperv_fb kernel module
https://bugzilla.redhat.com/show_bug.cgi?id=1192035
2015-05-18 13:43:26 +02:00
Harald Hoyer 27c9d1f20f Merge remote-tracking branch 'github/master' 2015-05-18 13:28:00 +02:00
Harald Hoyer 10e59202c7 51-dracut-rescue.install: fix kernel cmdline parsing
filter out any "initrd=" option
2015-05-18 13:27:16 +02:00
Colin Guthrie 7b56b90582 resume: Ensure we actually wait for the /dev/resume 'device'
Although various bits are in place to cancel waiting for the /dev/resume
device (actually a symlink), we don't actually ever wait for it.

Also as the udev rule may create the symlink, silence any errors from
our manual ln -s call from the settled job.
2015-05-15 16:01:41 +02:00
Colin Guthrie 3e3ed34f03 base: Don't wait for swap devices in host-only mode.
The only reason we add swap devices to host-only mode (added in
dd5875499e) is to allow us to process
resume= arguments passed on the kernel command line when the swap
partition lives on something slightly more complex than a normal
partion (e.g. in an LVM or RAID setup).

By adding the device to host_devs, the necessary LVM and RAID hooks
are added and thus the underlying storage will be initialised OK, and
the 95resume module handles the waiting for the device (via udev rules
creating the /dev/resume symlink).

So ultimately, we do not need to hard-code the waiting for the swap
devices into the initramfs at build time as the waiting part can be
dynamic.

This makes things more resiliant to swap partitions disappearing and
being reformatted etc.

Inspired by a patch by Martin Whitaker on Mageia bug:
https://bugs.mageia.org/show_bug.cgi?id=12305
2015-05-15 16:01:41 +02:00
Harald Hoyer 50f8ae457c dmraid/dmraid.sh: call udevsettle after activating all raids
otherwise a uevent loop will happen and the initqueue main loop counter
will not be incremented
2015-05-13 12:31:07 +02:00
Harald Hoyer a601870064 5?-dracut*.install: better parsing of /proc/cmdline
"read -r -d '' -a" does, what we want.
2015-05-13 12:02:14 +02:00
Harald Hoyer 8cd8820547 use cp --reflink=auto
saves some space, if the destination is on the same filesystem on some
filesystems
2015-05-13 12:02:10 +02:00
Harald Hoyer 471439f564 add dracut.pc pkg-config file 2015-05-13 11:47:23 +02:00
Harald Hoyer e668f3bc36 .dir-locals.el: correct syntax 2015-05-13 11:44:00 +02:00
Harald Hoyer 351de47882 README.testsuite: add bridge-utils to list of rpms 2015-05-07 18:15:57 +02:00
Harald Hoyer 07d9319d54 network/net-lib.sh:iface_has_link() wait 5s for the carrier to appear
https://bugzilla.redhat.com/show_bug.cgi?id=1088808
2015-05-07 14:49:06 +02:00
Harald Hoyer 7c5ec0f5be network:dhcp:wait_for_ipv6_dad() in PREINIT6 2015-05-07 14:43:26 +02:00
Harald Hoyer 79bc77d2f4 Merge pull request #61 from cmorty/pull/plymouth
Add plymouth-set-default-theme to the plymouth dependencies
2015-04-30 11:28:49 +02:00
Moritz 'Morty' Strübe 874b013573 Add plymouth-set-default-theme to the plymouth dependencies
plymouth-set-default-theme is not shipped with ubuntu and therefore
causes errors.
2015-04-30 11:20:27 +02:00
Harald Hoyer ffa0ee5d16 Merge pull request #59 from lnykryn/master
dracut-functions: use [[ ]] with -n and no quotes
2015-04-30 09:29:06 +02:00
Harald Hoyer a742c80778 Merge pull request #60 from rustybird/master
Fix ask_for_password bug breaking bash without plymouth
2015-04-30 09:28:50 +02:00
Rusty Bird 04ba461045
Fix ask_for_password bug breaking bash without plymouth
If crypt-lib.sh is sourced from any #!/bin/sh script, a POSIX shell
quirk is in effect that causes variable assignments to "special
builtins" (such as "shift") to leak to their context. So the buggy
code works even despite the missing semicolons.

But if it is sourced by "bash acting under its own name", i.e. from
any #!/bin/bash script, the quirk is disabled, tty_cmd/tty_prompt are
undefined, and ask_for_password doesn't do anything if plymouth is not
present.
2015-04-30 03:25:14 +00:00
Harald Hoyer 6d58fa27a4 change "while read x" to cope with EOF without newline
while read x || [ -n "$x" ]

should do the trick
2015-04-28 11:39:15 +02:00
Harald Hoyer 822a7ae504 fips: add some s390 kernel modules 2015-04-28 10:46:33 +02:00
Lukas Nykryn b0b60c8e05 dracut-functions: use [[ ]] with -n and no quotes 2015-04-27 11:40:54 +02:00
Harald Hoyer 4851deca54 dmsquash-live/apply-live-updates.sh: needs 'find'
also add /run/initramfs/live/updates as a directory, where to pull
the updates from

https://bugzilla.redhat.com/show_bug.cgi?id=1213736
2015-04-24 12:18:53 +02:00
Harald Hoyer 437dad70e9 Defer modprobe of HW modules, until udev is running
Also honor blacklisting
2015-04-24 11:59:37 +02:00
Harald Hoyer a3e464ca43 drm/module-setup.sh: radeon needs amdkfd
AMD's HSA Linux kernel driver (amdkfd) has been merged into the mainline
kernel since kernel 3.19.

However, for the driver to work, it needs to be included in the default
initramfs image, together with the amd_iommu_v2 driver.

The radeon driver (AMD's kernel graphic driver) calls amdkfd during its
initialization and probing stages. Because radeon is included in the
initramfs image, it tries to initialize amdkfd during the early boot
stages. However, as amdkfd is not present there, it fails.

That doesn't harm radeon operation. However, it disables the HSA
abilities in the machine.

Because of the current design, if you later try to "modprobe amdkfd",
you won't be able to run HSA applications, even though the driver will
be loaded.

https://bugzilla.redhat.com/show_bug.cgi?id=1205222
2015-04-23 16:11:53 +02:00
Harald Hoyer be82884d35 Makefile: turn off hostonly excplicitely for testimage target 2015-04-23 16:11:26 +02:00
Harald Hoyer 180e9d7851 kernel-modules: install all HID drivers
Instead of hardcoding a list of useful drivers, which has to be curated
all the time, just include all HID drivers.
2015-04-23 13:46:52 +02:00
Harald Hoyer d3d52b20e9 dracut-systemd/rootfs-generator.sh: use strstr rather than grep
grep on /proc/cmdline is overkill and would add a requirement for grep
2015-04-21 16:35:34 +02:00
Harald Hoyer 23446ef1e0 ifcfg/write-ifcfg.sh: unset vlan
clear the vlan flag, if a previous interface in the loop
was a vlan interface
2015-04-21 15:10:49 +02:00
Harald Hoyer ec06c5d3b5 Merge pull request #55 from dracut-mailing-devs/1427202794-18834-1-git-send-email-aidecoe@aidecoe.name
Take into account lib64 dirs when detecting version, modules and params
2015-03-26 18:34:49 +01:00
Amadeusz Żołnowski d3be9275c7 Take into account lib64 dirs when detecting version, modules and params 2015-03-26 16:38:42 +01:00
Alexander Tsoy 13efce5d1b base/dracut-lib.sh: remove bashism 2015-03-26 16:38:38 +01:00
NeilBrown f53ede36fb dracut-systemd/rootfs-generator.sh: always create generated files.
When 'systemctl daemon-reload' is run, systemd will clean out
/run/systemd/generator and re-run all the generators.
So it is important that the generators always create the required
files.

rootfs-generator.sh currently does *not* create the desired files
if $hookdir/initqueue/finished/devexists-${_name}.sh
exists.

This is not removed by "systectl daemon-reload" so the first time this
generator is run it will do the right thing.  Subsequent times it
won't.

This results in incorrect timeouts after "daemon-reload" is run.

So let the existence of each file only guard the creation that file.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-03-26 16:38:36 +01:00
NeilBrown 97cb17c792 systemd/dracut-iniqueue - continue waiting if any timeout script makes progress
A number of timeout scripts can be registered.  If any one of them
makes progress - e.g. assembles a degraded md array - then
the main loop should wait a bit longer rather than pressing forward.

This is particularly important is resume-from-hibernate requires a
degraded md array.  Both the script to forcibly assemble the md array
and the script to abort hibernation if the device doesn't appear
are 'timeout' scripts.  There needs to be a reasonable delay between
these running.

So: if any script has indicated that progress was made, break of out
the loop and go back to normal waiting.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-03-26 16:38:36 +01:00
NeilBrown 3b82ac1696 mdraid/mdraid_start.sh: tell mainloop if we make progress.
mdraid_start is a number of scripts which run after a timeout.
If it makes progress, it should tell the main loop so that it
knows that it is worth waiting a bit longer.

So in that case, create the initqueue/work file which the main loop
checks for.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-03-26 16:38:36 +01:00
Gerd von Egidy 99ccbc30df Add support for ethernet point-to-point connections configured via DHCP
When current dracut receives an ip with netmask of 255.255.255.255 via DHCP,
setting the also supplied default gateway fails (because it is obviously not
within the netmask).

The setup with a netmask of /32 is quite common in colocation datacenters
where you don't want the machines of two different customers to directly talk
to each other. At least two of the biggest colocation providers in Germany
(1&1 and Strato) do it that way. NetworkManager supports this kind of setup
and the dhclient-scripts of several distributions too.

In this patch I have implemented a simple approach very similar to what is
found in Debian. The dhclient-script from Fedora uses a more sophisticated
approach, but that relies on the ipcalc utility which would introduce a
dependency on Fedora-initscripts for dracut.

Signed-off-by: Gerd von Egidy <gerd.von.egidy@intra2net.com>
2015-03-26 16:38:33 +01:00
Harald Hoyer e93d0bea38 test: include kernel-network-modules for network tests 2015-03-26 10:57:58 +01:00
James Lee 833e0f9e83 crypt-loop: Always include 'loop' kernel module
When the 'loop' kernel module isn't loaded in a running system, it gets
excluded from the hostonly initrd.  Given that the crypt-loop dracut
module has to be loaded explicitly anyway, it makes sense to always
include the requisite loop kernel module.
2015-03-26 02:17:34 -04:00
James Lee c902aba0d4 crypt-loop: Fix decrypt when running at info log level
When booting with 'rd.info', the 'info' statements in the crypt-loop
module's 'loop_decrypt' function are output to stdout along with the key
that gets piped into the 'cryptsetup' command, which causes the crypt
device unlocking to fail.

There are two possible simple solutions to this problem:

1. Redirect the info messages to stderr (just add '>&2' at the end of
the info statements).

or

2. Remove the info statements altogether.

I have tested both and they both work, but this commit implements #2.
The existing info messages are long (they overflow 80 characters
easily) and redundant (the password prompt clearly indicates what is
happening), and just generally not useful.  Given that no one has
reported or fixed this bug in the three years that this module has
existed, no one will miss these info messages.

The commit also changes an error message in the same function to be more
descriptive.
2015-03-25 23:31:24 -04:00
Harald Hoyer 2bc5054a64 Merge pull request #35 from enovance/fix_include_variables_name
dracut: Ajusting variables name for --include
2015-03-24 20:46:06 +01:00
Harald Hoyer b67d810785 dracut.spec: add new modules 2015-03-24 16:10:45 +01:00
Harald Hoyer bbbdba2ec3 fcoe/lldpad.sh: add executable flags 2015-03-24 16:03:47 +01:00
Harald Hoyer 863e18b4cd crypt-loop/module-setup.sh: make module-setup.sh executable 2015-03-24 16:03:47 +01:00
Harald Hoyer a18d5494eb dracut-systemd/module-setup.sh: make module-setup.sh executable 2015-03-24 16:03:47 +01:00
Harald Hoyer cbb4b50e02 systemd-networkd: add experimental systemd-networkd support 2015-03-24 16:03:47 +01:00
Harald Hoyer ae43adb70d network: split out kernel-network-modules 2015-03-24 16:03:47 +01:00
Harald Hoyer ddfefd05fc debug: add more tools to the dracut debug module 2015-03-24 16:03:47 +01:00
Harald Hoyer 25e08a0973 systemd-initrd: add /etc/initrd-release 2015-03-24 16:03:22 +01:00
Harald Hoyer 6f92423c89 dracut.sh: create /var/tmp 2015-03-24 16:03:11 +01:00
Harald Hoyer 5641b0974b systemd: add more targets and tools
also set the multi-user.target as the default target
2015-03-24 16:02:09 +01:00
Harald Hoyer 5c44f43e69 dracut.spec: removed compat /sbin symlink to dracut binary 2015-03-23 12:19:41 +01:00
Harald Hoyer 3c20ac5377 TEST-30-ISCSI/test.sh: add all dracut modules
add all dracut modules to catch netroot conflicts and side effects like

afcc697cb8
2015-03-20 16:13:30 +01:00
Harald Hoyer afcc697cb8 nfs/parse-nfsroot.sh: don't unset netroot, if not nfs 2015-03-20 15:48:15 +01:00
Harald Hoyer 636d2d46a5 dracut.sh: add support for creating a UEFI boot executable
With an EFI stub, the kernel, the initramfs and a kernel cmdline can be
glued together to a single UEFI executable, which can be booted by a
UEFI BIOS.
2015-03-20 14:31:23 +01:00
Harald Hoyer 21a209735a dracut.sh: only print cmdline from modules, which would be included 2015-03-20 14:31:22 +01:00
Harald Hoyer bee086532f dracut.sh: simplify module install loop 2015-03-20 14:31:22 +01:00
Harald Hoyer df1e8127da rootfs-block/module-setup.sh: find root btrfs subvolumes
If root is a btrfs subvolume, find it, if fstab is not used
2015-03-20 14:31:22 +01:00
Harald Hoyer 481ee9e6fc test: ping watchdog in dhcp servers 2015-03-20 14:28:42 +01:00
Harald Hoyer 9f0878540b base/dracut-lib.sh: read /proc/cmdline with multiple lines
also parse cmdline files without an ending newline
2015-03-19 16:40:38 +01:00
Harald Hoyer 9119059723 dracut.sh: factor out do_print_cmdline() 2015-03-19 11:04:02 +01:00
Harald Hoyer 28eae10b70 Split the systemd dracut module up
Basic systemd functionality is in 00systemd now.
Switching root and the initrd.target is in 00systemd-initrd.
Dracut additions to the systemd initrd are in 98dracut-systemd.
2015-03-19 10:07:37 +01:00
Harald Hoyer 363469d757 base/module-setup.sh: merge systemd conditional 2015-03-19 10:00:48 +01:00
Harald Hoyer dea0634544 lvm: add files needed for LVM system id support
The LVM system id support is recent addition to LVM. See
https://git.fedorahosted.org/cgit/lvm2.git/tree/man/lvmsystemid.7.in for
more information (since lvm v2.02.117, currently the configuration is
ignored, but we will enable it soon in next release).

https://bugzilla.redhat.com/show_bug.cgi?id=1199918
2015-03-16 11:55:13 +01:00
Harald Hoyer 1bcb63f97c systemd: add "adm" and "wheel" to passwd and group 2015-02-26 09:39:32 +01:00
Fabian Deutsch b0472eac11 dmsquash: Add squashfs support to rd.live.fsimg
Previously rd.live.fsimg only supported filesystems residing in
(compressed) archives.
Now rd.live.fsimg can also be used when a squashfs image is used.
This is achieved by extracting the rootfs image from the squashfs and
then continue with the default routines for rd.live.fsimg.
In addition some code duplication got removed and some documentation
got added.

Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
2015-02-19 10:59:54 +01:00
Fabian Deutsch d6e34d362a dmsquash: Add rd.live.overlay.thin
This option changes the underlying mechanism for the overlay in the
dmsquash module.
Instead of a plain dm snapshot a dm thin snapshot is used. The advantage
of the thin snapshot is, that the TRIM command is recognized, which
means that at runtime, only the occupied blocks will be claimed from
memory, and freed blocks will really be freed in ram.

Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
2015-02-19 10:59:54 +01:00
Jonas Jonsson 7075a402d7 99base: Properly remove files with rd.hostonly=0
Dracut will generate systemd units for additional devices that should be
brought up during boot, e.g. swap devices. These unit files are broken
symlinks with \ in the filename, e.g.
/etc/systemd/system/initrd.target.wants/dev-disk-by\x2duuid-e6a54f99\x2da4fd\x2d4931\x2da956\x2d1c642bcfee5e.device.

Both the backslash and the broken symlink causes problems for shell
scripts, [ -e "$file" ] isn't enough and read requires the additional -r
argument to not react on the \.
2015-02-19 10:58:18 +01:00
Lukas Wunner 5729ae8029 90dm/dm-shutdown.sh: dmsetup remove_all -> dmsetup remove
The function 99shutdown/shutdown.sh:_check_shutdown() assumes that
shutdown scripts report success or failure via their return value.
However, "dmsetup remove_all" always reports success, even if some
of the device mappings could not be removed.

I submitted a patch for dmsetup but the lvm2 folks rejected it,
asserting that its behaviour is correct, that "remove_all" should
only be used by developers and that the proper solution would be
to invoke "dmsetup remove" on each device. This does report success
or failure via the return value.

Apart from fixing that issue, this commit also adds the dmsetup
option "--noudevsync". Without it, dmsetup would hang after removal
of a device while trying to communicate with systemd-udevd, which
is no longer running at this shutdown stage.

[harald: replaces backticks with $() ]
2015-02-19 10:57:08 +01:00
Dimitri John Ledkov a7d3ad67c7 Support /usr/lib/kernel/cmdline fallback path for /etc/kernel/cmdline. 2015-02-19 10:50:58 +01:00
Harald Hoyer 7e9341434f fips: add drbg kernel module 2015-02-19 10:45:35 +01:00
Harald Hoyer 6ac2c83570 dracut.sh: call bash with --norc
We don't want any user aliases or functions to be defined in dracut.
2015-02-19 09:55:12 +01:00
Jan Synacek 05b879ed2a doc: fix typo 2015-02-10 12:22:16 +01:00
Harald Hoyer 38e217704a fedora.conf: do not store cmdline in image by default 2015-02-10 12:22:16 +01:00
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 c9364f6ea2 dracut: Ajusting variables name for --include
When reading the --include part of the script, we had the following
issues to make the code easy to read:
- src & tgt were extract for the original options
- i variable was a file or a directory from src
- s variable was the directory name in case $i was a directory

"s" sounds very close to "src" while "s" is on the "tgt" side. Very
confusing.

"s" was defined before the "if it's a directory" statement while it's
only used inside the "if".

"i" was commit from the "src" but wasn't really explicit.

Having some lines mixing "i" and "s" takes a little time to get read
properly.

This patch offer the following changes:
- "i" is renamed to "objectname" as we don't know if its a file or a
  directory

- "s" is renamed to "object_destdir" as the object name becomes a
  directory on the destdir

- "object_destdir" (former "s") is moved inside the "if" statement as it's
  only used here

- tgt is finally renamed to "target" to be more explicit. We are not all
  native english ;o)

My 2 (semantic) cents,
2014-12-19 14:49:00 +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
Harald Hoyer 246d285561 Makefile: removed dangling space 2014-10-24 09:37:19 +02:00
Harald Hoyer 192990ce85 NEWS: update 2014-10-24 09:37:03 +02:00
Vaughan Cao 7a3e1a0e4a Add hyperv-keyboard kernel module for Hyper-V Gen2 VM
The synthetic keyboard of a Gen2 Linux VM doesn't work before the
hyperv_keyboard module is loaded. Without it, we can't cancel the media check
phase if boot with rd.live.check option.
Gen1 Linux VM doesn't have the same issue because the host emulates the legacy
i8042 keyboard for Gen1 VM.

Signed-off-by: Vaughan Cao <vaughan.cao@oracle.com>
2014-10-24 09:10:14 +02:00
Harald Hoyer 3507635bc6 TODO: update 2014-10-24 09:00:56 +02:00
Harald Hoyer b4692d07ee mdraid: also accept ID_FS_UUID for rd.md.uuid
As blkid also reports MD_UUID as ID_FS_UUID, although in slightly
different format, accept it also.
2014-10-23 14:37:02 +02:00
Harald Hoyer 05065741f0 network/net-lib.sh:is_persistent_ethernet_name() eth* is not
eth* is _not_ a persistent ethernet name... tsk, tsk, tsk
2014-10-23 14:34:33 +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
Will Woods 7e50abfdb8 do 'ip route replace default' instead of 'add'
When you define the gateway for an interface, dracut sets it up with:

  ip route add default via $gw dev $netif

If a default route is already set (e.g. if you have multiple NICs), this
will fail with the message "RTNETLINK answers: File exists".

So, if your first NIC isn't usable as a default route

Using "ip route replace default" instead allows ifup/dhclient-script to
correctly change the default route to the new interface.
2014-09-12 10:22:21 +02:00
Harald Hoyer a49cac2e65 dracut-functions.sh: exit for missing --force-add or --add dracut modules
Better exit with fail early, so there is no surprise on reboot.
2014-09-12 10:19:28 +02:00
Harald Hoyer 5058ae2d29 qemu: install virtio_console kernel module
https://bugzilla.redhat.com/show_bug.cgi?id=1097999
2014-09-12 10:03:59 +02:00
Harald Hoyer 2f954621cc cms/cmssetup.sh: understand DASD="none"
Treat DASD="none" as unset.

https://bugzilla.redhat.com/show_bug.cgi?id=1096979
2014-09-12 09:59:03 +02:00
Harald Hoyer d681635512 cms/cmssetup.sh: fixed indention 2014-09-12 09:58:14 +02:00
Harald Hoyer 80043e21c1 ifcfg/write-ifcfg.sh: bind bond and bridge interfaces to HW
either by s390 SUBCHANNELS or HWADDR, if the interface name is not
persistent.

Previously, this was bound unconditionally with HWADDR.
2014-09-12 09:49:58 +02:00
Harald Hoyer 37383f7123 add "--loginstall <DIR>" and loginstall="<DIR>" options
loginstall specifies a directory, in which dracut-install records all
files, which were installed from the host system to the initramfs.

Use case is e.g. to create a list of packages to watch for updates, to
maybe trigger a recreation of the initramfs.
2014-09-11 16:42:36 +02:00
Brian C. Lane 7e692cfd43 Support spaces in mount_nfs (#1109933)
nfs paths may contain spaces, make sure they are preserved when passed
to nfs_to_var and mount.

Related: rhbz#1109933
2014-09-10 11:07:44 +02:00
Harald Hoyer e3250e2055 replaced ip=auto with ip=dhcp in the documentation
https://bugzilla.redhat.com/show_bug.cgi?id=1086931
2014-09-09 13:35:44 +02:00
Harald Hoyer 29763cb72d network/net-lib.sh: do not enforce iscsi target name policy
also untabified
2014-09-09 13:31:10 +02:00
Harald Hoyer d4ce0e5e09 dracut.cmdline.7: add iso-scan/filename docs 2014-09-08 16:18:06 +02:00
Harald Hoyer 23ad117c49 kernel-modules: added hid-lcpower 2014-09-08 13:25:53 +02:00
Thomas Renninger cea907f6bf dracut: Introduce --force-drivers parameter and force_drivers=+ config option
Which will not only add listed drivers, but also enforce that they are
tried to be loaded at early boot time.

This is needed if drivers which are not autoloaded (e.g. loop and a lot
others) shall get loaded via initramfs.
2014-09-08 12:37:52 +02:00
Harald Hoyer 5f2baf7dc6 dracut.sh: change the PATH we search for our binaries
/sbin /bin versions should be used over /usr/sbin and /usr/bin versions,
because non-usr is meant for early boot.

See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=755271
2014-09-05 16:42:59 +02:00
Harald Hoyer 8a203398ef ssh-client: handle /etc/ssh/ssh_config
- disable ProxyCommand
- install the GlobalKnownHostsFile

https://bugzilla.redhat.com/show_bug.cgi?id=1086778
2014-08-29 15:27:22 +02:00
Harald Hoyer 967cc19ab1 remove all vim and emacs code format comments 2014-08-29 13:38:47 +02:00
Harald Hoyer 6770af96d4 add kate and emacs per directory config files 2014-08-29 13:38:47 +02:00
Harald Hoyer e7ba1392e1 install: add more error handling
also limit local variable scopes
and remove bogus checks to negativity of unsigned vars
2014-08-29 13:37:40 +02:00
Harald Hoyer c23d6ce6ea skipcpio: limit the local var scope 2014-08-29 13:26:32 +02:00
Harald Hoyer e81836f328 Makefile: add more warnings to CFLAGS 2014-08-29 13:25:54 +02:00
Harald Hoyer 4f03054e54 dracut-shutdown now executes the unpacking on ExecStop
To ensure that unpacking happens before any boot.automount is stopped,
let dracut-shutdown start as a sysinit.target service and unpack on
ExecStop.
2014-08-21 18:45:52 +02:00
Harald Hoyer 85752f0f5f dracut-lib.sh:dev_unit_name(): use systemd-escape, if available 2014-08-21 16:45:12 +02:00
Harald Hoyer 7c752ffaef dracut-lib.sh:cancel_wait_for_dev() fixed double escape 2014-08-21 16:38:35 +02:00
Harald Hoyer e27ecc9ae8 dracut.sh: source dracut-version.sh earlier than dracut-functions.sh
Otherwise dracut-logger.sh outputs an empty version on journal testing.

Aug 20 10:15:49 lenovo dracut[11144]: dracut-
Aug 20 10:15:49 lenovo dracut[11148]: Executing: /sbin/dracut
2014-08-20 10:21:43 +02:00
Harald Hoyer 8e3f653749 Check kernel config for early microcode and ACPI override
Disable early microcode and ACPI override, if the kernel does not
support it.
2014-08-20 10:13:55 +02:00
Harald Hoyer e84af01462 url-lib: check for ctorrent binary before adding the url handler 2014-08-15 17:35:11 +02:00
Antony Messerli 338bad6393 Adds bittorrent support for live images
This patch adds bittorrent support to 45url-lib for those that might want
to retrieve the same live image for multiple systems at once without
saturating the network.

This patch requires ctorrent to be installed into initramfs.

Torrent kernel command line format:
root=live:torrent://example.com/liveboot.img.torrent

Start a tracker:
bttrack --bind <tracker_ip> --port 6969 --dfile dstate --reannounce_interval 60

Create the torrent:
ctorrent -t live_image -u http://<tracker_ip>:6969/announce -s live_image.torrent

Seed the initial torrent:
ctorrent live_image.torrent

Boot the live image.
2014-08-15 17:29:33 +02:00
Major Hayden 504c0a8fec Adding support for read/write filesystem images
A user can provide a filesystem image (rootfs.img) inside a compressed
tarball and that filesystem image will be mounted read/write.  This provides
some benefits over a device mapper snapshot overlay, especially when the
live system becomes full.  The boot command line simple needs
"rd.writable.fsimg" added to utilize this feature.

Additional documentation for this option as well as other live boot
options is included.

Signed-off-by: Major Hayden <major@mhtx.net>
2014-08-15 16:05:19 +02:00
Harald Hoyer bc140a0b29 50-dracut.install: install pregenerated initrd
If there is an already pregenerated initrd at the same location as the
kernel install that and do not generate a new one.
2014-08-15 14:58:34 +02:00
Harald Hoyer ccb8ce0403 50-dracut.install: fixed /proc/cmdline reading
and beautified the code a bit
2014-08-15 14:58:02 +02:00
Harald Hoyer 95957248a1 51-dracut-rescue.install: fixed /proc/cmdline read 2014-08-15 14:56:59 +02:00
Harald Hoyer 99128f2b64 Makefile:rpm: wget the lgpl license for Source1 2014-08-15 14:03:39 +02:00
Harald Hoyer 80626ded3e Generate reproducible initramfs images
With the same source of files, it should be possible to generate the
same image file with every dracut run.

To accomplish this, we modify the timestamps of the files we generate at
runtime, call gzip with "-n" and cpio with "--reproducible".

The cpio --reproducible option is not yet upstream though, so if you
feel like it should be then please nag at the cpio mailing list.
http://lists.gnu.org/archive/html/bug-cpio/2014-08/msg00000.html
2014-08-15 13:52:02 +02:00
Harald Hoyer 9efb74a32d dracut-functions.sh:get_persistent_dev(): use printf, instead of echo 2014-08-15 12:36:04 +02:00
Nicolas Chauvet 49fe860b22 Introduce ARM specific modules needed by drm 2014-08-15 12:35:01 +02:00
Nicolas Chauvet b96ea1e196 Categorize needed modules on ARM 2014-08-15 12:35:01 +02:00
Nicolas Chauvet 4a3f3ba68c Test soc path for modalias needed by drm
On ARM, both pci and soc path can be tested for drm.

With this patchset, that was missing in recent kernel,
the tegra_drm case is not needed anymore:
http://patchwork.ozlabs.org/patch/361765/
http://www.spinics.net/lists/linux-tegra/msg17948.html
2014-08-15 12:35:01 +02:00
WANG Chao a628b7caf5 dracut-functions: get_persistent_dev() fall back to the original name
In case of raw disk/partition, ex. /dev/vda1, which doesn't contain any
filesystem on it. get_persistent_dev() would return empty. Now fix it to
return its original name, /dev/vda1 in above case. So that we don't have
to check its return string every time.

Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-08-15 12:35:01 +02:00
Harald Hoyer 11b5db88c2 dracut.usage.asc: also add a link for RHEL-7 storage admin guide 2014-08-15 11:50:31 +02:00
Harald Hoyer e02a29e7a2 dracut.usage.asc: extend parameters for shutdown debug procedure 2014-08-15 11:44:26 +02:00
Harald Hoyer ae488efa5e i18n: check for $i18n_install_all == "yes" rather than being set
i18n_install_all="no" does not have the expected effect without this
patch
2014-08-14 12:56:53 +02:00
Alex Harpin 32125a976b bridging: update the ifcfg files generated for bridge slaves
Update the ifcfg files generated for bridge slaves so they reference
the bridge they are part of.  Related to early patch submitted as a
fix for Bug #1123552.

Bug #1123552 https://bugzilla.redhat.com/show_bug.cgi?id=1123552
2014-08-11 20:16:06 +02:00
Harald Hoyer 068531232b test: make testsuite work with the new systemd minimal root req
systemd needs more directories to switch root
2014-08-08 13:34:04 +02:00
Harald Hoyer 2db6d71118 fixed bridge setup
renamed "ethnames" in bridge.info to "bridgeslaves"

fixed ifcfg generation
2014-08-01 13:16:29 +02:00
Harald Hoyer 4e1f8d0c5f TEST-20-NFS: add more commands and fix client root dirs 2014-08-01 13:15:44 +02:00
Harald Hoyer 28d03673f9 TEST-20-NFS:client-init.sh: add shell on rd.shell 2014-08-01 13:15:05 +02:00
Harald Hoyer ba7dab6dba NEWS: update 2014-07-29 11:04:09 +02:00
Harald Hoyer caa72f8290 dracut.spec: fixed license file packaging 2014-07-24 14:47:14 +02:00
Harald Hoyer eab9b75c8a dracut.sh: add DRACUT_PATH
DRACUT_PATH can now be used to specify the PATH used by dracut
to search for binaries instead of the default
/usr/sbin:/sbin:/usr/bin:/bin

This should be set in the distribution config file
/usr/lib/dracut/dracut.conf.d/01-dist.conf
2014-07-22 15:09:02 +02:00
Harald Hoyer ece72160ce test/TEST-30-ISCSI: add rd.shell to client root 2014-07-22 14:22:21 +02:00
Harald Hoyer 54b68829b6 add "--install-optional" and install_optional_items 2014-07-22 14:09:06 +02:00
Harald Hoyer 7b46244bb9 network: add rd.route parameter 2014-07-22 11:52:52 +02:00
Harald Hoyer ad8638e04e base/dracut-lib:pidof() turn off debugging 2014-07-22 11:51:40 +02:00
Peter Robinson 611c895772 ARM: update modules for ARM host only options 2014-07-22 09:03:33 +02:00
Harald Hoyer 4ef45f13f4 dracut-functions.sh: fix inst*() functions for "-H" handling
because some inst*() functions check the existance of the source files
and do not know about the "-H" option, some failed to install the
hostonly files.
2014-07-21 16:59:49 +02:00
Praveen_Paladugu@Dell.com f4eb0d9804 Installing an OS with VLAN enabled to an ISCSI LUN (from ibft)
When installing OS to a VLAN enabled iscsi LUN (extracted from iBFT), "/tmp/net.{xyz}.has_ibft_config" is not being set properly.

Then anaconda installer requires 'BOOTPROTO="ibft"' populated in ifcfg of the vlan interface (ex: ibft0.20), for it to properly populate the kernel parameters post installation. The setting 'BOOTPROTO="ibft"' is populated by write-ifcfg.sh script only if the corresponding interface has a file /tmp/net.{xyz}.has_inft_config

To get around this issue, in ibft_to_cmdline() function in net-lib.sh file, I made the following changes to populate the has_ibft_config file for the vlan interface(ex: ibft0.20):
2014-07-17 16:36:39 +02:00
Harald Hoyer 5ea0be0a8c dracut-functions.sh: speed up ldconfig_paths() 2014-07-08 12:54:21 +02:00
Harald Hoyer 4adeefc4ab plymouth: also find the pkglibdir on debian 2014-07-08 11:50:51 +02:00
Harald Hoyer 6cd7001b35 dracut.sh: always copy prelink files in FIPS mode
regardless of the the prelink={yes|no} switch
2014-07-08 11:50:04 +02:00
Harald Hoyer fecc1d69e5 lvm:module-setup.sh: check for existance of 69-dm-lvm-metad.rules
fixup for 12819a5799
2014-07-03 15:04:17 +02:00
Alexander Tsoy 8ca5e8c319 modsign: do not hardcode path to keyctl
https://bugs.gentoo.org/show_bug.cgi?id=506094
2014-07-03 09:22:48 +02:00
657 changed files with 35125 additions and 15365 deletions

9
.astylerc Normal file
View File

@ -0,0 +1,9 @@
lineend=linux
style=linux
indent=spaces=8
convert-tabs
min-conditional-indent=0
max-instatement-indent=120
align-pointer=name
max-code-length=120

25
.dir-locals.el Normal file
View File

@ -0,0 +1,25 @@
; Directory Local Variables
; For more information see (info "(emacs) Directory Variables")
; Sets emacs variables based on mode.
; A list of (major-mode . ((var1 . value1) (var2 . value2)))
; Mode can be nil, which gives default values.
; Characters width is set to 109 for .c and XML but for everything else 79.
; If you update this file make sure to update .vimrc and .editorconfig too.

((c-mode . ((fill-column . 109)
(c-basic-offset . 8)
(eval . (c-set-offset 'substatement-open 0))
(eval . (c-set-offset 'statement-case-open 0))
(eval . (c-set-offset 'case-label 0))
(eval . (c-set-offset 'arglist-intro '++))
(eval . (c-set-offset 'arglist-close 0))
(eval . (c-set-offset 'arglist-cont-nonempty '(c-lineup-gcc-asm-reg c-lineup-arglist)))))
(nxml-mode . ((nxml-child-indent . 2)
(fill-column . 109)))
(meson-mode . ((meson-indent-basic . 8)))
(sh-mode . ((sh-basic-offset . 4)
(sh-indentation . 4)))
(awk-mode . ((c-basic-offset . 8)))
(nil . ((indent-tabs-mode . nil)
(tab-width . 4)
(fill-column . 79))) )

39
.editorconfig Normal file
View File

@ -0,0 +1,39 @@
# EditorConfig configuration for dracut
# http://EditorConfig.org

# If you update this file make sure to update .dir-locals.el and .vimrc too.

# Top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file, utf-8 charset
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 4
switch_case_indent = true
function_next_line = false
binary_next_line = true
space_redirects = true

# Match config files, set indent to spaces with width of eight.
[*.{c,h}]
indent_style = space
indent_size = 8

# Match config files, set indent to spaces with width of four.
[*.sh]
indent_style = space
indent_size = 4
switch_case_indent = true
function_next_line = false
binary_next_line = true
space_redirects = true

# Match xml man pages, set indent to spaces with width of two.
[man/*.xml]
indent_style = space
indent_size = 2

9
.github/CODEOWNERS vendored Normal file
View File

@ -0,0 +1,9 @@
# This is a comment.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @haraldh @danimo @johannbg

26
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,26 @@
---
name: "\U0001F41B Bug report"
about: A report of an error in a recent Dracut version
labels: 'bug'
---

**Describe the bug**
A clear and concise description of what the error is.

**Distribution used**
Which distribution was this behaviour seen in?

**Dracut version**
Which dracut version was this behaviour seen in?

**Init system**
Which init system is being used?

**To Reproduce**
Steps or code to reproduce the behavior.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Additional context**
Add any other context you like about the problem here.

View File

@ -0,0 +1,8 @@
---
name: "\U0001F4D6 Documentation"
about: Suggest an improvement for documentation in Dracut
labels: 'documents'
---

**Describe the documentation**
A clear and concise description of what should be better documented.

View File

@ -0,0 +1,8 @@
---
name: "\U00002728 Feature Request"
about: A request for enhancement in Dracut
labels: 'enhancement'
---

**Describe the enhancement**
A clear and concise description of what the enhancement is that you would like to see.

293
.github/labeler.yml vendored Normal file
View File

@ -0,0 +1,293 @@
repository:
- ./*

github:
- .github/*
- .github/**/*

dracut-install:
- install/*
- install/**/*

example:
- examples/*
- examples/**/*
- examples/**/**/*

modules:
- modules.d/*
- modules.d/**/*

bash:
- modules.d/00bash/*

bootchart:
- modules.d/00bootchart/*

dash:
- modules.d/00dash/*

mksh:
- modules.d/00mksh/*

systemd:
- modules.d/00systemd/*

warpclock:
- modules.d/00warpclock/*

fips:
- modules.d/01fips/*

systemd-initrd:
- modules.d/01systemd-initrd/*

caps:
- modules.d/02caps/*

systemd-networkd:
- modules.d/02systemd-networkd/*

modsign:
- modules.d/03modsign/*

rescue:
- modules.d/03rescue/*

watchdog:
- modules.d/04watchdog/*

busybox:
- modules.d/05busybox/*

rngd:
- modules.d/06rngd/*

i18n:
- modules.d/10i18n/*

convertfs:
- modules.d/30convertfs/*

network-legacy:
- modules.d/35network-legacy/*

network-manager:
- modules.d/35network-manager/*

network:
- modules.d/40network/*

ifcfg:
- modules.d/45ifcfg/*

url-lib:
- modules.d/45url-lib/*

drm:
- modules.d/50drm/*

gensplash:
- modules.d/50gensplash/*

plymouth:
- modules.d/50plymouth/*

cms:
- modules.d/80cms/*

lvmmerge:
- modules.d/80lvmmerge/*

cio_ignore:
- modules.d/81cio_ignore/*

btrfs:
- modules.d/90btrfs/*

crypt:
- modules.d/90crypt/*

dm:
- modules.d/90dm/*

dmraid:
- modules.d/90dmraid/*

dmsquash-live:
- modules.d/90dmsquash-live/*

dmsquash-live-ntfs:
- modules.d/90dmsquash-live-ntfs/*

kernel-modules:
- modules.d/90kernel-modules/*

kernel-modules-extra:
- modules.d/90kernel-modules-extra/*

kernel-network-modules:
- modules.d/90kernel-network-modules/*

livenet:
- modules.d/90livenet/*

lvm:
- modules.d/90lvm/*

mdraid:
- modules.d/90mdraid/*

multipath:
- modules.d/90multipath/*

nvdimm:
- modules.d/90nvdimm/*

ppcmac:
- modules.d/90ppcmac/*

qemu:
- modules.d/90qemu/*

qemu-net:
- modules.d/90qemu-net/*

stratis:
- modules.d/90stratis/*

crypt-gpg:
- modules.d/91crypt-gpg/*

crypt-loop:
- modules.d/91crypt-loop/*

zipl:
- modules.d/91zipl/*

cifs:
- modules.d/95cifs/*

dasd:
- modules.d/95dasd/*

dasd_mod:
- modules.d/95dasd_mod/*

dasd_rules:
- modules.d/95dasd_rules/*

dcssblk:
- modules.d/95dcssblk/*

debug:
- modules.d/95debug/*

fcoe:
- modules.d/95fcoe/*

fcoe-uefi:
- modules.d/95fcoe-uefi/*

fstab-sys:
- modules.d/95fstab-sys/*

iscsi:
- modules.d/95iscsi/*

lunmask:
- modules.d/95lunmask/*

nbd:
- modules.d/95nbd/*

nfs:
- modules.d/95nfs/*

nvmf:
- modules.d/95nvmf/*

qeth_rules:
- modules.d/95qeth_rules/*

resume:
- modules.d/95resume/*

rootfs-block:
- modules.d/95rootfs-block/*

ssh-client:
- modules.d/95ssh-client/*

terminfo:
- modules.d/95terminfo/*

udev-rules:
- modules.d/95udev-rules/*

virtfs:
- modules.d/95virtfs/*

zfcp:
- modules.d/95zfcp/*

zfcp_rules:
- modules.d/95zfcp_rules/*

znet:
- modules.d/95znet/*

securityfs:
- modules.d/96securityfs/*

biosdevname:
- modules.d/97biosdevname/*

masterkey:
- modules.d/97masterkey/*

dracut-systemd:
- modules.d/98dracut-systemd/*

ecryptfs:
- modules.d/98ecryptfs/*

integrity:
- modules.d/98integrity/*

pollcdrom:
- modules.d/98pollcdrom/*

selinux:
- modules.d/98selinux/*

syslog:
- modules.d/98syslog/*

usrmount:
- modules.d/98usrmount/*

base:
- modules.d/99base/*

fs-lib:
- modules.d/99fs-lib/*

img-lib:
- modules.d/99img-lib/*

memstrack:
- modules.d/99memstrack/*

shutdown:
- modules.d/99shutdown/*

squash:
- modules.d/99squash/*

uefi-lib:
- modules.d/99uefi-lib/*

test:
- test/*
- test/**/*

10
.github/pull_request_template.md vendored Normal file
View File

@ -0,0 +1,10 @@
This pull request changes...

## Changes

## Checklist
- [ ] I have tested it locally
- [ ] I have reviewed and updated any documentation if relevant
- [ ] I am providing new code and test(s) for it

Fixes #

21
.github/stale.yml vendored Normal file
View File

@ -0,0 +1,21 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- documents
- enhancement
- regression
- wiki
- bug
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue is being marked as stale because it has not had any recent activity.
It will be closed if no further activity occurs.
If this is still an issue in the latest release of Dracut and you would like to keep it open please comment on this issue within the next 7 days.
Thank you for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false

53
.github/workflows/container.yml vendored Normal file
View File

@ -0,0 +1,53 @@
name: Container
on:
schedule:
- cron: '30 11 * * *' # every day at 4:40
push:
branches: [ master ]
paths:
- 'test/container/**'
- '.github/workflows/container.yml'
pull_request:
branches: [ master ]
paths:
- 'test/container/**'
- '.github/workflows/container.yml'

permissions:
packages: write
contents: read

jobs:
push_to_registry:
name: Build and push containers image to GitHub Packages
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.config.dockerfile }}
cancel-in-progress: true
strategy:
fail-fast: false
matrix:
config:
- { dockerfile: 'Dockerfile-Fedora-latest', tag: 'fedora:latest' }
- { dockerfile: 'Dockerfile-Fedora-rawhide', tag: 'fedora:rawhide' }
- { dockerfile: 'Dockerfile-OpenSuse-latest', tag: 'opensuse:latest' }
- { dockerfile: 'Dockerfile-Arch', tag: 'arch:latest' }
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# with:
# buildkitd-flags: --debug
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Container
uses: docker/build-push-action@v2
with:
file: test/container/${{ matrix.config.dockerfile }}
tags: ghcr.io/dracutdevs/${{ matrix.config.tag }}
push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}

81
.github/workflows/integration.yml vendored Normal file
View File

@ -0,0 +1,81 @@
name: Integration Test

on:
pull_request:
branches: [ master ]

jobs:
basic:
runs-on: ubuntu-latest
timeout-minutes: 45
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }}
cancel-in-progress: true
strategy:
matrix:
container: [
"fedora:33",
"fedora:rawhide",
"opensuse:latest",
"arch:latest",
]
test: [
"04",
]
fail-fast: false
container:
image: ghcr.io/dracutdevs/${{ matrix.container }}
options: "--privileged -v /dev:/dev"
steps:
- name: "Checkout Repository"
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: "${{ matrix.container }} TEST-${{ matrix.test }}"
run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}
test:
runs-on: ubuntu-latest
timeout-minutes: 45
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.container }}-${{ matrix.test }}
cancel-in-progress: true
strategy:
matrix:
container: [
"fedora:latest",
]
test: [
"01",
"02",
"03",
"04",
"10",
"11",
"12",
"13",
"14",
"15",
"17",
"20",
"21",
"30",
"31",
"35",
"36",
"40",
"41",
"98",
]
fail-fast: false
container:
image: ghcr.io/dracutdevs/${{ matrix.container }}
options: "--privileged -v /dev:/dev"
steps:
- name: "Checkout Repository"
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: "${{ matrix.container }} TEST-${{ matrix.test }}"
run: ./tools/test-github.sh "TEST-${{ matrix.test }}" ${{ matrix.test }}

11
.github/workflows/labels.yml vendored Normal file
View File

@ -0,0 +1,11 @@
name: "Pull Request Labeler"

on: pull_request_target

jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@main
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"

38
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Lint

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
lint-c:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: install tools
run: sudo apt-get install astyle

- name: indent
run: make indent-c

- name: check formatting
run: git diff --exit-code

lint-shell:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: shfmt
uses: luizm/action-sh-checker@v0.2.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SHFMT_OPTS: -s # arguments to shfmt.
with:
sh_checker_shellcheck_disable: false
sh_checker_comment: true

19
.github/workflows/pr.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: Commisery
on:
pull_request:
types: [edited, opened, synchronize, reopened]

jobs:
commit-message:
name: Conventional Commit Message Checker (Commisery)
runs-on: ubuntu-latest
steps:
- name: Check-out the repo under $GITHUB_WORKSPACE
uses: actions/checkout@v2

- name: Run Commisery
uses: dracutdevs/commisery-action@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
pull_request: ${{ github.event.number }}

25
.gitignore vendored
View File

@ -1,19 +1,30 @@
/Makefile.inc
/dracut.8
/dracut-catimages.8
/dracut.conf.5
/man/dracut.8
/man/dracut-catimages.8
/man/dracut.conf.5
/dracut.conf.d/*.conf
/dracut-gencmdline.8
/man/dracut.cmdline.7
/dracut.html
/dracut.kernel.7
/man/dracut.kernel.7
/man/dracut.bootup.7
/man/dracut.modules.7
/man/lsinitrd.1
/dracut.pc
/dracut-install
/modules.d/99base/switch_root
/test/*/test.log
/test/*/.testdir
test*.img
/.buildpath
/.project
/dracut-version.sh
/install/dracut-install
/src/install/dracut-install
/*.rpm
/*.[0-9]
/modules.d/98systemd/*.service.8
/modules.d/98dracut-systemd/*.service.8
/*.sign
*.o
/src/skipcpio/skipcpio
/src/util/util
/dracut-util
.idea/

1
.kateconfig Normal file
View File

@ -0,0 +1 @@
kate: space-indent on; tab-width 4; indent-width 4; replace-tabs on; eol unix;

9
.kateproject Normal file
View File

@ -0,0 +1,9 @@
{
"name": "Dracut"
, "files": [ { "git": 1 } ]
, "build": {
"directory": "./"
, "build": "make -j $(getconf _NPROCESSORS_ONLN) all"
, "clean": "make clean"
}
}

View File

@ -2,15 +2,37 @@ Philippe Seewer <philippe.seewer@bfh.ch> <philippe.seewer-omB+W0Dpw2o@public.gm
Seewer Philippe <philippe.seewer@bfh.ch> <philippe.seewer@bfh.ch>
Philippe Seewer <philippe.seewer@bfh.ch> <philippe.seewer@bfh.ch>
Victor Lowther <victor.lowther@gmail.com> <victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Harald Hoyer <harald@redhat.com> <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Harald Hoyer <harald@redhat.com> <harald@eeepc.(none)>
Harald Hoyer <harald@profian.com> <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Harald Hoyer <harald@profian.com> <harald@eeepc.(none)>
Harald Hoyer <harald@profian.com> <harald@hoyer.xyz>
Harald Hoyer <harald@profian.com> <harald@redhat.com>
Mike Snitzer <snitzer@redhat.com> <msnitzer@redhat.com>
Amerigo Wang <amwang@redhat.com> <xiyou.wangcong@gmail.com>
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>
Angelo "pallotron" Failla <pallotron@fb.com> <pallotron@fb.com>
Yu Watanabe <watanabe.yu+github@gmail.com>
Martin Wilck <mwilck@suse.de> <mwilck@suse.com>
Thomas Renninger <trenn@suse.com> <trenn@suse.de>
Andrey Borzenkov <arvidjaar@gmail.com>
Cristian Rodríguez <crrodriguez@opensuse.org>
Daniel Drake <drake@endlessm.com> <dsd@laptop.org>
Fabian Vogt <fvogt@suse.com>
Hannes Reinecke <hare@suse.com> <hare@suse.de>
Julian Wolf <juwolf@suse.com> <juwolf@suse.de>
Lidong Zhong <lidong.zhong@suse.com> <lzhong@suse.com>
Nikoli <nikoli@gmx.us> <nikoli@lavabit.com>
Peter Robinson <pbrobinson@fedoraproject.org> <pbrobinson@gmail.com>
Xunlei Pang <xlpang@redhat.com> <xpang@redhat.com>
Daniel Molkentin <daniel.molkentin@suse.com> <dmolkentin@suse.com>
Thomas Blume <thomas.blume@suse.com> <Thomas.Blume@suse.com>
Brian C. Lane <bcl@redhat.com> <bcl@brianlane.com>
Tomasz Paweł Gajc <tpgxyz@gmail.com> <tpgxyz@gmail.com>

55
.packit.yml Normal file
View File

@ -0,0 +1,55 @@
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later

# The name of the upstream package
upstream_package_name: dracut

# The upstream tag versioning scheme
upstream_tag_template: "{version}"

# The URL of the upstream project
upstream_project_url: https://github.com/dracutdevs/dracut

# Relative path to a spec file within the upstream repository
specfile_path: pkgbuild/dracut.spec

# Name of the downstream package
downstream_package_name: dracut

# The URL of the downstream project
dist_git_base_url: https://src.fedoraproject.org/

# Sync file(s) from upstream repo to dist-git
synced_files:
# The dracut spec file is maintained upstream so we sync it downstream.
- dracut.spec
# We sync the packit file downstream be able to optionally use the sync-from-downstream command
- .packit.yaml

# We want new releases to be automatically built on rawhide and have few jobs
# on copr.
create_pr: false
jobs:
- job: propose_downstream
trigger: release
metadata:
dist_git_branches: main

- job: tests
trigger: pull_request
metadata:
targets:
- fedora-rawhide

- job: copr_build
trigger: pull_request
metadata:
targets:
- fedora-development

- job: copr_build
trigger: commit
metadata:
targets:
- fedora-all
- fedora-development

34
.shellcheckrc Normal file
View File

@ -0,0 +1,34 @@
# SC2039: In POSIX sh, 'local' is undefined.
# https://github.com/koalaman/shellcheck/wiki/SC2039
disable=SC2039

# SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
# https://github.com/koalaman/shellcheck/wiki/SC2166
disable=SC2166

# SC2154: Variable is referenced but not assigned
# https://github.com/koalaman/shellcheck/wiki/SC2154
disable=SC2154

# SC1091: Not following <file>
# https://github.com/koalaman/shellcheck/wiki/SC1091
disable=SC1091

# SC2174: When used with -p, -m only applies to the deepest directory.
# https://github.com/koalaman/shellcheck/wiki/SC2174
disable=SC2174

# SC3043: In POSIX sh, 'local' is undefined.
# https://github.com/koalaman/shellcheck/wiki/SC3043
# ... but dash supports it
disable=SC3043

# SC3013: In POSIX sh, -ef is undefined.
# https://github.com/koalaman/shellcheck/wiki/SC3013
# ... but dash supports it
disable=SC3013

# SC3045: In POSIX sh, read -p is undefined.
# https://github.com/koalaman/shellcheck/wiki/SC3045
# ... but dash supports it
disable=SC3045

15
.vimrc Normal file
View File

@ -0,0 +1,15 @@
" Vim can use per directory configuration files like this.
" To enable that feature two lines are needed in your ~/.vimrc
" set exrc " enables per-directory .vimrc files
" set secure " disable unsafe commands in local .vimrc files
" Characters width is set to 109 for .c and XML but for everything else 79.
" If you update this file make sure to update .dir-locals.el & .editorconfig

set tabstop=4
set shiftwidth=4
set expandtab
set makeprg=GCC_COLORS=\ make
set tw=79
au BufRead,BufNewFile *.xml set tw=109 shiftwidth=2 smarttab
au FileType sh set tw=80 shiftwidth=4 smarttab
au FileType c set tw=109 shiftwidth=8 tabstop=8 smarttab expandtab

View File

@ -1,33 +0,0 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

if [[ -f /etc/kernel/cmdline ]]; then
readarray -t BOOT_OPTIONS < /etc/kernel/cmdline
fi

if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
readarray -t BOOT_OPTIONS < /proc/cmdline
fi

unset noimageifnotneeded

for ((i=0; i < "${#BOOT_OPTIONS[@]}"; i++)); do
if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then
noimageifnotneeded="yes"
break
fi
done

ret=0
case "$1" in
add)
dracut ${noimageifnotneeded:+--noimageifnotneeded} "$3"/initrd "$2"
ret=$?
;;
remove)
rm -f -- "$3"/initrd
ret=$?
;;
esac
exit $ret

View File

@ -1,70 +0,0 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

export LANG=C

KERNEL_VERSION="$1"
KERNEL_IMAGE="$2"

[[ -f /etc/os-release ]] && . /etc/os-release

if [[ ! -f /etc/machine-id ]] || [[ ! -s /etc/machine-id ]]; then
systemd-machine-id-setup
fi

[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id

[[ $MACHINE_ID ]] || exit 1
[[ -f $KERNEL_IMAGE ]] || exit 1

INITRDFILE="/boot/initramfs-0-rescue-${MACHINE_ID}.img"
NEW_KERNEL_IMAGE="${KERNEL_IMAGE%/*}/vmlinuz-0-rescue-${MACHINE_ID}"

[[ -f $INITRDFILE ]] && [[ -f $NEW_KERNEL_IMAGE ]] && exit 0

dropindirs_sort()
{
suffix=$1; shift
args=("$@")
files=$(
while (( $# > 0 )); do
for i in ${1}/*${suffix}; do
[[ -f $i ]] && echo ${i##*/}
done
shift
done | sort -Vu
)

for f in $files; do
for d in "${args[@]}"; do
if [[ -f "$d/$f" ]]; then
echo "$d/$f"
continue 2
fi
done
done
}

# source our config dir
for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do
[[ -e $f ]] && . "$f"
done

[[ $dracut_rescue_image != "yes" ]] && exit 0

if [[ ! -f $INITRDFILE ]]; then
dracut --no-hostonly -a "rescue" "$INITRDFILE" "$KERNEL_VERSION"
((ret+=$?))
fi

if [[ ! -f $NEW_KERNEL_IMAGE ]]; then
cp "$KERNEL_IMAGE" "$NEW_KERNEL_IMAGE"
((ret+=$?))
fi

new-kernel-pkg --install "$KERNEL_VERSION" --kernel-image "$NEW_KERNEL_IMAGE" --initrdfile "$INITRDFILE" --banner "$NAME $VERSION_ID Rescue $MACHINE_ID"

((ret+=$?))

exit $ret

View File

@ -1,103 +0,0 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

export LANG=C

COMMAND="$1"
KERNEL_VERSION="$2"
BOOT_DIR_ABS="${3%/*}/0-rescue"
KERNEL_IMAGE="$4"


dropindirs_sort()
{
suffix=$1; shift
args=("$@")
files=$(
while (( $# > 0 )); do
for i in ${1}/*${suffix}; do
[[ -f $i ]] && echo ${i##*/}
done
shift
done | sort -Vu
)

for f in $files; do
for d in "${args[@]}"; do
if [[ -f "$d/$f" ]]; then
echo "$d/$f"
continue 2
fi
done
done
}

[[ -f /etc/os-release ]] && . /etc/os-release

if [[ ! -f /etc/machine-id ]] || [[ ! -s /etc/machine-id ]]; then
systemd-machine-id-setup
fi

[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id

if [[ -f /etc/kernel/cmdline ]]; then
readarray -t BOOT_OPTIONS < /etc/kernel/cmdline
fi
if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
readarray -t BOOT_OPTIONS < /proc/cmdline
fi
if ! [[ $BOOT_OPTIONS ]]; then
exit 1
fi

LOADER_ENTRY="/boot/loader/entries/${MACHINE_ID}-0-rescue.conf"
BOOT_DIR="/${MACHINE_ID}/0-rescue"

ret=0

case "$COMMAND" in
add)
for i in "/boot/loader/entries/${MACHINE_ID}-0-rescue.conf"; do
[[ -f $i ]] && exit 0
done

# source our config dir
for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do
[[ -e $f ]] && . "$f"
done

[[ $dracut_rescue_image != "yes" ]] && exit 0

[[ -d "$BOOT_DIR_ABS" ]] || mkdir -p "$BOOT_DIR_ABS"

if ! cp "$KERNEL_IMAGE" "$BOOT_DIR_ABS"/linux; then
echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/linux'!" >&2
fi

dracut --no-hostonly -a "rescue" "$BOOT_DIR_ABS"/initrd "$2"
((ret+=$?))

{
echo "title $PRETTY_NAME - Rescue Image"
echo "version $KERNEL_VERSION"
echo "machine-id $MACHINE_ID"
echo "options ${BOOT_OPTIONS[@]} rd.auto=1"
echo "linux $BOOT_DIR/linux"
echo "initrd $BOOT_DIR/initrd"
} > $LOADER_ENTRY
((ret+=$?))
;;

remove)
exit 0
;;

*)
usage
ret=1;;
esac

((ret+=$?))

exit $ret

286
AUTHORS
View File

@ -1,118 +1,346 @@
Harald Hoyer <harald@redhat.com>
Harald Hoyer <harald@profian.com>
Victor Lowther <victor.lowther@gmail.com>
Jóhann B. Guðmundsson <johannbg@gmail.com>
Amadeusz Żołnowski <aidecoe@aidecoe.name>
Daniel Molkentin <daniel.molkentin@suse.com>
Hannes Reinecke <hare@suse.com>
Kairui Song <kasong@redhat.com>
Will Woods <wwoods@redhat.com>
Philippe Seewer <philippe.seewer@bfh.ch>
Warren Togami <wtogami@redhat.com>
Jeremy Katz <katzj@redhat.com>
Dave Young <dyoung@redhat.com>
Jeremy Katz <katzj@redhat.com>
Lukas Nykryn <lnykryn@redhat.com>
David Dillow <dave@thedillows.org>
Lubomir Rintel <lkundrak@v3.sk>
Michal Soltys <soltys@ziu.info>
Amerigo Wang <amwang@redhat.com>
Colin Guthrie <colin@mageia.org>
Andrey Borzenkov <arvidjaar@gmail.com>
Peter Jones <pjones@redhat.com>
Martin Wilck <mwilck@suse.de>
Amerigo Wang <amwang@redhat.com>
Thomas Renninger <trenn@suse.com>
Alexander Tsoy <alexander@tsoy.me>
Frederick Grose <fgrose@sugarlabs.org>
Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
WANG Chao <chaowang@redhat.com>
Andreas Thienemann <andreas@bawue.net>
Hannes Reinecke <hare@suse.de>
Beniamino Galvani <bgalvani@redhat.com>
Yu Watanabe <watanabe.yu+github@gmail.com>
Andrey Borzenkov <arvidjaar@gmail.com>
Peter Robinson <pbrobinson@fedoraproject.org>
David Disseldorp <ddiss@suse.de>
Hans de Goede <hdegoede@redhat.com>
Jonathan Lebon <jonathan@jlebon.com>
Frantisek Sumsal <frantisek@sumsal.cz>
Peter Jones <pjones@redhat.com>
Thomas Blume <thomas.blume@suse.com>
Andreas Thienemann <andreas@bawue.net>
Renaud Métrich <rmetrich@redhat.com>
Tomasz Paweł Gajc <tpgxyz@gmail.com>
Fabian Vogt <fvogt@suse.com>
Nicolas Chauvet <kwizart@gmail.com>
Zoltán Böszörményi <zboszor@pr.hu>
Colin Walters <walters@verbum.org>
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>
Xunlei Pang <xlpang@redhat.com>
Brian C. Lane <bcl@redhat.com>
Daniel Drake <drake@endlessm.com>
Dusty Mabe <dusty@dustymabe.com>
Shreenidhi Shedi <sshedi@vmware.com>
Angelo "pallotron" Failla <pallotron@fb.com>
Dan Horák <dhorak@redhat.com>
David Tardon <dtardon@redhat.com>
David Teigland <teigland@redhat.com>
Ville Skyttä <ville.skytta@iki.fi>
Böszörményi Zoltán <zboszor@pr.hu>
Cristian Rodríguez <crrodriguez@opensuse.org>
Javier Martinez Canillas <javierm@redhat.com>
Ondrej Mosnacek <omosnace@redhat.com>
Baoquan He <bhe@redhat.com>
Brendan Germain <brendan.germain@nasdaqomx.com>
Jonas Witschel <diabonas@gmx.de>
Leho Kraav <leho@kraav.com>
Marcos Mello <marcosfrm@gmail.com>
Mike Gilbert <floppym@gentoo.org>
Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
Moritz Maxeiner <moritz@ucworks.org>
Nathan Rini <nate@ucar.edu>
Radek Vykydal <rvykydal@redhat.com>
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Đoàn Trần Công Danh <congdanhqx@gmail.com>
Fabian Deutsch <fabiand@fedoraproject.org>
Kamil Rytarowski <n54@gmx.com>
Laszlo Gombos <laszlo.gombos@gmail.com>
Lidong Zhong <lidong.zhong@suse.com>
Marc Grimme <grimme@atix.de>
NeilBrown <neilb@suse.de>
Peter Rajnoha <prajnoha@redhat.com>
Thorsten Behrens <tbehrens@suse.com>
q66 <daniel@octaforge.org>
Adam Williamson <awilliam@redhat.com>
Chao Wang <chaowang@redhat.com>
Colin Walters <walters@verbum.org>
Frederic Crozat <fcrozat@suse.com>
James Lee <jlee@thestaticvoid.com>
Jesse Keating <jkeating@redhat.com>
Milan Broz <mbroz@redhat.com>
Radek Vykydal <rvykydal@redhat.com>
Mimi Zohar <zohar@linux.vnet.ibm.com>
Norbert Lange <norbert.lange@andritz.com>
Pingfan Liu <piliu@redhat.com>
Roberto Sassu <roberto.sassu@polito.it>
Stefan Reimer <it@startux.de>
Takashi Iwai <tiwai@suse.de>
Tony Asleson <tasleson@redhat.com>
Anton Blanchard <anton@samba.org>
Bill Nottingham <notting@redhat.com>
Chapman Flack <g2@anastigmatix.net>
Chris Leech <cleech@redhat.com>
David Cantrell <dcantrell@redhat.com>
Dennis Gilmore <dennis@ausil.us>
Doan Tran Cong Danh <congdanhqx@gmail.com>
Gaël PORTAY <gael.portay@collabora.com>
Jan Synacek <jsynacek@redhat.com>
Jiri Konecny <jkonecny@redhat.com>
Jon Ander Hernandez <jonan.h@gmail.com>
Juan RP <xtraeme@gmail.com>
Lance Albertson <lance@osuosl.org>
Marian Ganisin <mganisin@redhat.com>
Masahiro Matsuya <mmatsuya@redhat.com>
Matthias Gerstner <matthias.gerstner@suse.de>
Max Resch <resch.max@gmail.com>
Michael Ploujnikov <plouj@somanetworks.com>
Pratyush Anand <panand@redhat.com>
Silvio Fricke <silvio.fricke@gmail.com>
Stefan Berger <stefanb@linux.ibm.com>
Steven Brudenell <steven.brudenell@gmail.com>
Stig Telfer <stelfer@cray.com>
Thomas Backlund <tmb@mageia.org>
Topi Miettinen <toiwoton@gmail.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>
Frederick Grose <fgrose@sugarlabs.org>
Alex Harpin <development@landsofshadow.co.uk>
Alexander Wenzel <alexander.wenzel@qbeyond.de>
Alexey Shabalin <shaba@altlinux.org>
Andre Russ <andre.russ@sap.com>
Andreas Schwab <schwab@suse.de>
Ankit Kumar <ankit@linux.vnet.ibm.com>
Antony Messerli <amesserl@rackspace.com>
Chao Fan <cfan@redhat.com>
Cornelius Hoffmann <coding@hoffmn.de>
Daniel Cordero <dracut@0xdc.io>
Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Daniel Schaal <farbing@web.de>
Denis Silakov <dsilakov@virtuozzo.com>
Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
Erwan Velu <erwan.velu@enovance.com>
Evgeny Vereshchagin <evvers@ya.ru>
Guido Trentalancia <guido@trentalancia.net>
Hari Bathini <hbathini@linux.vnet.ibm.com>
Ian Dall <ian@beware.dropbear.id.au>
Imran Haider <imran1008@gmail.com>
James Buren <ryuo@frugalware.org>
James Lee <jlee@thestaticvoid.com>
Jan Macku <jamacku@redhat.com>
Joey Boggs <jboggs@redhat.com>
José María Fernández <josemariafg@gmail.com>
Julian Wolf <juwolf@suse.com>
Kairui Song <kasong@tencent.com>
Koen Kooi <koen@dominion.thruhere.net>
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Kyle McMartin <kmcmarti@redhat.com>
Luiz Angelo Daros de Luca <luizluca@gmail.com>
Lukas Wunner <lukas@wunner.de>
Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Marko Myllynen <myllynen@redhat.com>
Matthew Thode <mthode@mthode.org>
Michal Koutný <mkoutny@suse.com>
Mike Snitzer <snitzer@redhat.com>
Minfei Huang <mhuang@redhat.com>
Nikoli <nikoli@gmx.us>
Patrick Talbert <ptalbert@redhat.com>
Pedro Monreal <pmgdeb@gmail.com>
Petr Pavlu <petr.pavlu@suse.com>
Przemysław Rudy <prudy1@o2.pl>
Stefan Reimer <it@startux.de>
Robert LeBlanc <robert@leblancnet.us>
Robert Scheck <robert@fedoraproject.org>
Stefan Berger <stefanb@us.ibm.com>
Thomas Lange <lange@informatik.uni-koeln.de>
Till Maas <opensource@till.name>
Vivek Goyal <vgoyal@redhat.com>
Vladislav Bogdanov <bubble@hoster-ok.com>
Adam Williamson <awilliam@redhat.com>
Zoltán Böszörményi <zboszor@gmail.com>
Érico Rolim <erico.erc@gmail.com>
наб <nabijaczleweli@nabijaczleweli.xyz>
A. Wilcox <AWilcox@Wilcox-Tech.com>
Adam Alves <adamoa@gmail.com>
Adrien Thierry <athierry@redhat.com>
Alexander Kurtz <alexander@kurtz.be>
Alexander Miroshnichenko <alex@millerson.name>
Alexander Sosedkin <asosedkin@redhat.com>
Alexander Todorov <atodorov@redhat.com>
Alexey Kodanev <alexey.kodanev@oracle.com>
Andreas Stieger <astieger@suse.com>
Andrew J. Hesford <ajh@sideband.org>
Andrey Sokolov <keremet@altlinux.org>
Andy Lutomirski <luto@mit.edu>
Anjali Kulkarni <anjali.k.kulkarni@oracle.com>
Anssi Hannula <anssi@mageia.org>
Antz <antzz@protonmail.ch>
Arnaud Rebillout <arnaud.rebillout@collabora.com>
Artem Savkov <asavkov@redhat.com>
Attila Bruncsak <bruncsak@users.noreply.github.com>
B. Wilson <x@wilsonb.com>
Ben Howard <ben.howard@redhat.com>
Benjamin Marzinski <bmarzins@redhat.com>
Brandon Philips <brandon@ifup.co>
Brandon Sloane <btsloane@verizon.net>
Bruno E. O. Meneguele <bmeneg@redhat.com>
Bryn M. Reeves <bmr@redhat.com>
Canek Peláez Valdés <caneko@gmail.com>
Chris Leech <cleech@redhat.com>
Carlo Caione <carlo@endlessm.com>
Chad Dupuis <chad.dupuis@cavium.com>
Charles Rose <charles.rose@dell.com>
Christian Heinz <christian.ch.heinz@gmail.com>
Coiby Xu <coxu@redhat.com>
Cong Wang <amwang@redhat.com>
Daniel Schaal <farbing@web.de>
Dan Fuhry <dfuhry@datto.com>
Dave Jones <davej@redhat.com>
Dave Young <dave@redhat.com>
David Hildenbrand <david@redhat.com>
David Michael <david.michael@coreos.com>
Denis Volkov <denis@simpletexting.net>
Dennis Schridde <devurandom@gmx.net>
Derek Hageman <hageman@inthat.cloud>
Derek Higgins <derekh@redhat.com>
Dirk Müller <dirk@dmllr.de>
Donovan Tremura <neurognostic@protonmail.ch>
Duane Griffin <duaneg@dghda.com>
Elan Ruusamäe <glen@delfi.ee>
Enno Boland <g@s01.de>
Enzo Matsumiya <ematsumiya@suse.de>
Eugene S. Sobolev <sobolev@protei.ru>
Eugene Syromiatnikov <esyr@redhat.com>
Evgeni Golov <evgeni@golov.de>
Fabian Vogt <fvogt@suse.de>
Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
Florian Gamböck <mail@floga.de>
Frank Deng <frank.deng@oracle.com>
François Cami <fcami@fedoraproject.org>
Gerd von Egidy <gerd.von.egidy@intra2net.com>
Glen Gray <slaine@slaine.org>
Hari Bathini <hbathini@linux.vnet.ibm.com>
Glenn Morris <rgm@stanford.edu>
GuoChuang <guo.chuang@zte.com.cn>
HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Hari Bathini <hbathini@linux.ibm.com>
Hendrik Brueckner <brueckner@linux.ibm.com>
Henrik Gombos <henrik99999@gmail.com>
Hermann Gausterer <git-dracut-2012@mrq1.org>
Hiroaki Mizuguchi <hiroaki-m@iij.ad.jp>
Hongxu Jia <hongxu.jia@windriver.com>
Hui Wang <john.wanghui@huawei.com>
Ignaz Forster <iforster@suse.com>
Jacob Wen <jian.w.wen@oracle.com>
James Laska <jlaska@redhat.com>
Jan Stodola <jstodola@redhat.com>
Jaroslav Jindrak <dzejrou@gmail.com>
Jason Dana <jasondana@quarksecurity.com>
Jens Heise <46450477+heisej@users.noreply.github.com>
Jeremy Linton <lintonrjeremy@gmail.com>
Jiri Pirko <jiri@resnulli.us>
Joe Lawrence <Joe.Lawrence@stratus.com>
Johannes Thumshirn <jthumshirn@suse.com>
Jonas Jelten <jj@sft.lol>
Jonas Jonsson <jonas@websystem.se>
Jonas Witschel <diabonas@archlinux.org>
Kevin Yung <Kevin.Yung@myob.com>
Kyle McMartin <kmcmarti@redhat.com>
Kyle McMartin <kyle@redhat.com>
Lars R. Damerow <lars@pixar.com>
Lars Wendler <polynomial-c@gentoo.org>
Lee Duncan <lduncan@suse.com>
Lennart Poettering <lennart@poettering.net>
Lennert Buytenhek <buytenh@wantstofly.org>
Lubomir Rintel <lkundrak@v3.sk>
Lev Veyde <lveyde@redhat.com>
Lianbo Jiang <lijiang@redhat.com>
LinkTed <link.ted@mailbox.org>
Luca BRUNO <luca.bruno@coreos.com>
Lucas C. Villa Real <lucasvr@gmail.com>
Major Hayden <major@mhtx.net>
Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Marian Csontos <mcsontos@redhat.com>
Mark Fasheh <mfasheh@suse.de>
Matt <smoothsailing72@hotmail.com>
Matt Smith <shadowfax@gmx.com>
Matthias Berndt <matthias_berndt@gmx.de>
Mei Liu <liumbj@linux.vnet.ibm.com>
Michael Chapman <mike@very.puzzling.org>
Michael McCracken <michael.mccracken@gmail.com>
Michal Schmidt <mschmidt@redhat.com>
Michal Sekletar <msekleta@redhat.com>
Mike Gorse <mgorse@suse.com>
Moritz 'Morty' Strübe <morty@gmx.net>
Munehiro Matsuda <haro@kgt.co.jp>
Nicolas Chauvet <kwizart@gmail.com>
Nikoli <nikoli@lavabit.com>
Nicolas Porcel <nicolasporcel06@gmail.com>
Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Olivier Blin <dev@blino.org>
Ondrej Dubaj <odubaj@redhat.com>
P J P <ppandit@redhat.com>
Paolo Bonzini <pbonzini@redhat.com>
Peter Robinson <pbrobinson@fedoraproject.org>
Paul Robins <exp@users.noreply.github.com>
Pavel Valena <pvalena@redhat.com>
Pavel Zhukov <pzhukov@redhat.com>
Pawel Wieczorkiewicz <pwieczorkiewicz@suse.de>
Pekka Wallendahl <wyrmiyu@gmail.com>
Peter Georg <peter.georg@physik.uni-regensburg.de>
Peter Levine <plevine457@gmail.com>
Petr Tesarik <ptesarik@suse.com>
Petr Vorel <pvorel@suse.cz>
Prarit Bhargava <prarit@redhat.com>
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>
Ruben Kerkhof <ruben@rubenkerkhof.com>
Rumbaut Thomas <Thomas.Rumbaut@digipolis.gent>
Rusty Bird <rustybird@openmailbox.org>
Sebastian Mitterle <smitterl@redhat.com>
Sergei Iudin <tsipa740@gmail.com>
Sergey Fionov <fionov@gmail.com>
Shawn W Dunn <sfalken@opensuse.org>
Srinivasa T N <seenutn@linux.vnet.ibm.com>
Stijn Hoop <stijn@sandcat.nl>
Sullivan (CTR), Austin <austin.sullivan.ctr@progeny.net>
Thierry Vignaud <thierry.vignaud@gmail.com>
Thilo Bangert <thilo.bangert@gmx.net>
Thomas Backlund <tmb@mageia.org>
Thomas Abraham <tabraham@suse.com>
Thomas Haller <thaller@redhat.com>
Tobias Geerinckx <tobias.geerinckx@gmail.com>
Tobias Klauser <tklauser@distanz.ch>
Tom Gundersen <teg@jklm.no>
Tomasz Torcz <tomek@pipebreaker.pl>
Tong Li <tonli@redhat.com>
Vadim Kuznetsov <vadimk@gentoo.org>
Ville Skyttä <ville.skytta@iki.fi>
Vaughan Cao <vaughan.cao@oracle.com>
Vladius25 <vkorol2509@icloud.com>
Vratislav Podzimek <vpodzime@redhat.com>
Yang Liu <50459973+ly4096x@users.noreply.github.com>
Yanko Kaneti <yaneti@declera.com>
Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
Ziyue Yang <ziyang@redhat.com>
foopub <45460217+foopub@users.noreply.github.com>
gaoyi <ymuemc@163.com>
honza801 <honza801@gmail.com>
jbash aka John Bashinski <jbash@velvet.com>
jloeser <jloeser@suse.de>
johannes <johannes.brechtmann@gmail.com>
jonathan-teh <30538043+jonathan-teh@users.noreply.github.com>
joshuacov1 <joshuacov@gmail.com>
lapseofreason <lapseofreason0@gmail.com>
leo-lb <lle-bout@zaclys.net>
logan <logancaldwell23@gmail.com>
masem <matej.semian@gmail.com>
maximilian attems <max@stro.at>
mulhern <amulhern@redhat.com>
mwberry <mwberry@users.noreply.github.com>
nabijaczleweli <nabijaczleweli@gmail.com>
privb0x23 <privb0x23@users.noreply.github.com>
realtime-neil <neil@rtr.ai>
xtraeme <xtraeme@voidlinux.eu>
Дамјан Георгиевски <gdamjan@gmail.com>

23
HACKING
View File

@ -1,23 +0,0 @@
Right now, most of the testing is done using a qemu/kvm guest and
generating the initramfs on another box but the support is all present
to build for the "running" machine. For the former, you can boot the guest
using qemu's -kernel and -initrd options.

dracut exists and will build an image. It is command-line equivalent
to most mkinitrd implementations and should be pretty straight-forward
to use.

To use, just run dracut with an output file name and, optionally, a
kernel version (it defaults to using the current). The appropriate
modules will be copied over and things should be good to go. If you'd
like to customize the list of modules copied in, edit /etc/dracut.conf
and set
dracutmodules="foo bar baz"

Note that dracut calls functional components in modules.d "modules"
while kernel modules are called "drivers".

Requirements:
* udev
* nfs module: nfs daemon and rpc helper
* iscsi: iscsi

302
Makefile
View File

@ -1,10 +1,22 @@
-include dracut-version.sh

VERSION = $(shell [ -d .git ] && git describe --abbrev=0 --tags 2>/dev/null || echo $(DRACUT_VERSION))
GITVERSION = $(shell [ -d .git ] && { v=$$(git describe --tags 2>/dev/null); [ $${v\#*-} != $$v ] && echo -$${v\#*-}; } )
DRACUT_MAIN_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --abbrev=0 --tags --always 2>/dev/null || :)
ifeq ($(DRACUT_MAIN_VERSION),)
DRACUT_MAIN_VERSION = $(DRACUT_VERSION)
endif
DRACUT_FULL_VERSION ?= $(shell env GIT_CEILING_DIRECTORIES=$(CWD)/.. git describe --tags --always 2>/dev/null || :)
ifeq ($(DRACUT_FULL_VERSION),)
DRACUT_FULL_VERSION = $(DRACUT_VERSION)
endif

HAVE_SHELLCHECK ?= $(shell which shellcheck >/dev/null 2>&1 && echo yes)
HAVE_SHFMT ?= $(shell which shfmt >/dev/null 2>&1 && echo yes)
HAVE_RPMBUILD ?= $(shell which rpmbuild >/dev/null 2>&1 && echo yes)

-include Makefile.inc

KVERSION ?= $(shell uname -r)

prefix ?= /usr
libdir ?= ${prefix}/lib
datadir ?= ${prefix}/share
@ -12,67 +24,93 @@ pkglibdir ?= ${libdir}/dracut
sysconfdir ?= ${prefix}/etc
bindir ?= ${prefix}/bin
mandir ?= ${prefix}/share/man
CFLAGS ?= -O2 -g -Wall
CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64
CFLAGS ?= -O2 -g -Wall -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
bashcompletiondir ?= ${datadir}/bash-completion/completions
pkgconfigdatadir ?= $(datadir)/pkgconfig

man1pages = lsinitrd.1
man1pages = man/lsinitrd.1

man5pages = dracut.conf.5
man5pages = man/dracut.conf.5

man7pages = dracut.cmdline.7 \
dracut.bootup.7 \
dracut.modules.7
man7pages = man/dracut.cmdline.7 \
man/dracut.bootup.7 \
man/dracut.modules.7

man8pages = dracut.8 \
dracut-catimages.8 \
mkinitrd.8 \
mkinitrd-suse.8 \
modules.d/98systemd/dracut-cmdline.service.8 \
modules.d/98systemd/dracut-initqueue.service.8 \
modules.d/98systemd/dracut-mount.service.8 \
modules.d/98systemd/dracut-shutdown.service.8 \
modules.d/98systemd/dracut-pre-mount.service.8 \
modules.d/98systemd/dracut-pre-pivot.service.8 \
modules.d/98systemd/dracut-pre-trigger.service.8 \
modules.d/98systemd/dracut-pre-udev.service.8
man8pages = man/dracut.8 \
man/dracut-catimages.8 \
modules.d/98dracut-systemd/dracut-cmdline.service.8 \
modules.d/98dracut-systemd/dracut-initqueue.service.8 \
modules.d/98dracut-systemd/dracut-mount.service.8 \
modules.d/98dracut-systemd/dracut-shutdown.service.8 \
modules.d/98dracut-systemd/dracut-pre-mount.service.8 \
modules.d/98dracut-systemd/dracut-pre-pivot.service.8 \
modules.d/98dracut-systemd/dracut-pre-trigger.service.8 \
modules.d/98dracut-systemd/dracut-pre-udev.service.8

manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages)

.PHONY: install clean archive rpm testimage test all check AUTHORS doc dracut-version.sh
.PHONY: install clean archive rpm srpm testimage test all check AUTHORS CONTRIBUTORS doc dracut-version.sh

all: dracut-version.sh dracut-install skipcpio/skipcpio
all: dracut-version.sh dracut.pc dracut-install src/skipcpio/skipcpio dracut-util

%.o : %.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(KMOD_CFLAGS) $< -o $@

DRACUT_INSTALL_OBJECTS = \
install/dracut-install.o \
install/hashmap.o\
install/log.o \
install/strv.o \
install/util.o
src/install/dracut-install.o \
src/install/hashmap.o\
src/install/log.o \
src/install/strv.o \
src/install/util.o

# deps generated with gcc -MM
install/dracut-install.o: install/dracut-install.c install/log.h install/macro.h \
install/hashmap.h install/util.h
install/hashmap.o: install/hashmap.c install/util.h install/macro.h install/log.h \
install/hashmap.h
install/log.o: install/log.c install/log.h install/macro.h install/util.h
install/util.o: install/util.c install/util.h install/macro.h install/log.h
install/strv.o: install/strv.c install/strv.h install/util.h install/macro.h install/log.h
src/install/dracut-install.o: src/install/dracut-install.c src/install/log.h src/install/macro.h \
src/install/hashmap.h src/install/util.h
src/install/hashmap.o: src/install/hashmap.c src/install/util.h src/install/macro.h src/install/log.h \
src/install/hashmap.h
src/install/log.o: src/install/log.c src/install/log.h src/install/macro.h src/install/util.h
src/install/util.o: src/install/util.c src/install/util.h src/install/macro.h src/install/log.h
src/install/strv.o: src/install/strv.c src/install/strv.h src/install/util.h src/install/macro.h src/install/log.h

install/dracut-install: $(DRACUT_INSTALL_OBJECTS)
src/install/dracut-install: $(DRACUT_INSTALL_OBJECTS)
$(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) $(FTS_LIBS) $(KMOD_LIBS)

dracut-install: install/dracut-install
logtee: src/logtee/logtee.c
$(CC) $(LDFLAGS) -o $@ $<

dracut-install: src/install/dracut-install
ln -fs $< $@

SKIPCPIO_OBJECTS= \
skipcpio/skipcpio.o
SKIPCPIO_OBJECTS = src/skipcpio/skipcpio.o
skipcpio/skipcpio.o: src/skipcpio/skipcpio.c
skipcpio/skipcpio: $(SKIPCPIO_OBJECTS)

skipcpio/skipcpio.o: skipcpio/skipcpio.c
skipcpio/skipcpio: skipcpio/skipcpio.o
UTIL_OBJECTS = src/util/util.o
util/util.o: src/util/util.c
util/util: $(UTIL_OBJECTS)

indent:
indent -i8 -nut -br -linux -l120 install/dracut-install.c
indent -i8 -nut -br -linux -l120 skipcpio/skipcpio.c
dracut-util: src/util/util
cp -a $< $@

.PHONY: indent-c
indent-c:
astyle -n --quiet --options=.astylerc $(wildcard *.[ch] */*.[ch] src/*/*.[ch])

.PHONY: indent
indent: indent-c
ifeq ($(HAVE_SHFMT),yes)
shfmt -w -s .
endif

src/dracut-cpio/target/release/dracut-cpio: src/dracut-cpio/src/main.rs
cargo --offline build --release --manifest-path src/dracut-cpio/Cargo.toml

dracut-cpio: src/dracut-cpio/target/release/dracut-cpio
ln -fs $< $@

ifeq ($(enable_dracut_cpio),yes)
all: dracut-cpio
endif

doc: $(manpages) dracut.html

@ -81,22 +119,38 @@ all: doc
endif

%: %.xml
xsltproc -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
@rm -f -- "$@"
xsltproc -o "$@" -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<

%.xml: %.asc
asciidoc -d manpage -b docbook -o $@ $<
@rm -f -- "$@"
asciidoc -a "version=$(DRACUT_FULL_VERSION)" -d manpage -b docbook -o "$@" $<

dracut.8: dracut.usage.asc dracut.8.asc
dracut.8: man/dracut.8.asc \
man/dracut.usage.asc

dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
asciidoc -a numbered -d book -b docbook -o dracut.xml dracut.asc
dracut.html: man/dracut.asc $(manpages) docs/dracut.css man/dracut.usage.asc
@rm -f -- dracut.xml
asciidoc -a "mainversion=$(DRACUT_MAIN_VERSION)" \
-a "version=$(DRACUT_FULL_VERSION)" \
-a numbered \
-d book -b docbook -o dracut.xml man/dracut.asc
@rm -f -- dracut.html
xsltproc -o dracut.html --xinclude -nonet \
--stringparam custom.css.source dracut.css \
--stringparam custom.css.source docs/dracut.css \
--stringparam generate.css.header 1 \
http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl dracut.xml
rm -f -- dracut.xml
@rm -f -- dracut.xml

install: dracut-version.sh
dracut.pc: Makefile.inc Makefile
@echo "Name: dracut" > dracut.pc
@echo "Description: dracut" >> dracut.pc
@echo "Version: $(DRACUT_FULL_VERSION)" >> dracut.pc
@echo "dracutdir=$(pkglibdir)" >> dracut.pc
@echo "dracutmodulesdir=$(pkglibdir)/modules.d" >> dracut.pc
@echo "dracutconfdir=$(pkglibdir)/dracut.conf.d" >> dracut.pc

install: all
mkdir -p $(DESTDIR)$(pkglibdir)
mkdir -p $(DESTDIR)$(bindir)
mkdir -p $(DESTDIR)$(sysconfdir)
@ -104,11 +158,11 @@ install: dracut-version.sh
mkdir -p $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man7 $(DESTDIR)$(mandir)/man8
install -m 0755 dracut.sh $(DESTDIR)$(bindir)/dracut
install -m 0755 dracut-catimages.sh $(DESTDIR)$(bindir)/dracut-catimages
install -m 0755 mkinitrd-dracut.sh $(DESTDIR)$(bindir)/mkinitrd
install -m 0755 lsinitrd.sh $(DESTDIR)$(bindir)/lsinitrd
install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf
mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d
mkdir -p $(DESTDIR)$(pkglibdir)/dracut.conf.d
install -m 0755 dracut-init.sh $(DESTDIR)$(pkglibdir)/dracut-init.sh
install -m 0755 dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions.sh
install -m 0755 dracut-version.sh $(DESTDIR)$(pkglibdir)/dracut-version.sh
ln -fs dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions
@ -124,10 +178,11 @@ ifneq ($(enable_documentation),no)
endif
if [ -n "$(systemdsystemunitdir)" ]; then \
mkdir -p $(DESTDIR)$(systemdsystemunitdir); \
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98systemd/dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown.service; \
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants; \
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/dracut-shutdown-onfailure.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown-onfailure.service; \
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown.service; \
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants; \
ln -s ../dracut-shutdown.service \
$(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants/dracut-shutdown.service; \
$(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants/dracut-shutdown.service; \
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/initrd.target.wants; \
for i in \
dracut-cmdline.service \
@ -138,26 +193,35 @@ endif
dracut-pre-trigger.service \
dracut-pre-udev.service \
; do \
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98systemd/$$i $(DESTDIR)$(systemdsystemunitdir); \
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/$$i $(DESTDIR)$(systemdsystemunitdir); \
ln -s ../$$i \
$(DESTDIR)$(systemdsystemunitdir)/initrd.target.wants/$$i; \
done \
fi
if [ -f install/dracut-install ]; then \
install -m 0755 install/dracut-install $(DESTDIR)$(pkglibdir)/dracut-install; \
if [ -f src/install/dracut-install ]; then \
install -m 0755 src/install/dracut-install $(DESTDIR)$(pkglibdir)/dracut-install; \
fi
if [ -f skipcpio/skipcpio ]; then \
install -m 0755 skipcpio/skipcpio $(DESTDIR)$(pkglibdir)/skipcpio; \
if [ -f src/skipcpio/skipcpio ]; then \
install -m 0755 src/skipcpio/skipcpio $(DESTDIR)$(pkglibdir)/skipcpio; \
fi
if [ -f dracut-util ]; then \
install -m 0755 dracut-util $(DESTDIR)$(pkglibdir)/dracut-util; \
fi
ifeq ($(enable_dracut_cpio),yes)
install -m 0755 dracut-cpio $(DESTDIR)$(pkglibdir)/dracut-cpio
endif
mkdir -p $(DESTDIR)${prefix}/lib/kernel/install.d
install -m 0755 50-dracut.install $(DESTDIR)${prefix}/lib/kernel/install.d/50-dracut.install
install -m 0755 51-dracut-rescue.install $(DESTDIR)${prefix}/lib/kernel/install.d/51-dracut-rescue.install
install -m 0755 install.d/50-dracut.install $(DESTDIR)${prefix}/lib/kernel/install.d/50-dracut.install
install -m 0755 install.d/51-dracut-rescue.install $(DESTDIR)${prefix}/lib/kernel/install.d/51-dracut-rescue.install
mkdir -p $(DESTDIR)${bashcompletiondir}
install -m 0644 dracut-bash-completion.sh $(DESTDIR)${bashcompletiondir}/dracut
install -m 0644 lsinitrd-bash-completion.sh $(DESTDIR)${bashcompletiondir}/lsinitrd
install -m 0644 shell-completion/bash/dracut $(DESTDIR)${bashcompletiondir}/dracut
install -m 0644 shell-completion/bash/lsinitrd $(DESTDIR)${bashcompletiondir}/lsinitrd
mkdir -p $(DESTDIR)${pkgconfigdatadir}
install -m 0644 dracut.pc $(DESTDIR)${pkgconfigdatadir}/dracut.pc

dracut-version.sh:
@echo "DRACUT_VERSION=$(VERSION)$(GITVERSION)" > dracut-version.sh
@rm -f dracut-version.sh
@printf "#!/bin/sh\n# shellcheck disable=SC2034\nDRACUT_VERSION=%s\n" "$(DRACUT_FULL_VERSION)" > dracut-version.sh

clean:
$(RM) *~
@ -167,76 +231,112 @@ clean:
$(RM) test-*.img
$(RM) dracut-*.rpm dracut-*.tar.bz2 dracut-*.tar.xz
$(RM) dracut-version.sh
$(RM) dracut-install install/dracut-install $(DRACUT_INSTALL_OBJECTS)
$(RM) dracut-install src/install/dracut-install $(DRACUT_INSTALL_OBJECTS)
$(RM) skipcpio/skipcpio $(SKIPCPIO_OBJECTS)
$(RM) dracut-util util/util $(UTIL_OBJECTS)
$(RM) $(manpages) dracut.html
$(RM) dracut.pc
$(RM) dracut-cpio src/dracut-cpio/target/release/dracut-cpio*
$(MAKE) -C test clean

dist: dracut-$(VERSION).tar.xz
dist: dracut-$(DRACUT_MAIN_VERSION).tar.xz

dracut-$(VERSION).tar.xz: doc syncheck
@echo "DRACUT_VERSION=$(VERSION)" > dracut-version.sh
git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ > dracut-$(VERSION).tar
mkdir -p dracut-$(VERSION)
for i in $(manpages) dracut.html dracut-version.sh; do [ "$${i%/*}" != "$$i" ] && mkdir -p "dracut-$(VERSION)/$${i%/*}"; cp "$$i" "dracut-$(VERSION)/$$i"; done
tar --owner=root --group=root -rf dracut-$(VERSION).tar $$(find dracut-$(VERSION) -type f)
rm -fr -- dracut-$(VERSION).tar.xz dracut-$(VERSION)
xz -9 dracut-$(VERSION).tar
rm -f -- dracut-$(VERSION).tar
dracut-$(DRACUT_MAIN_VERSION).tar.xz: doc syncheck
@echo "DRACUT_VERSION=$(DRACUT_MAIN_VERSION)" > dracut-version.sh
git archive --format=tar $(DRACUT_MAIN_VERSION) --prefix=dracut-$(DRACUT_MAIN_VERSION)/ > dracut-$(DRACUT_MAIN_VERSION).tar
mkdir -p dracut-$(DRACUT_MAIN_VERSION)
for i in $(manpages) dracut.html dracut-version.sh; do [ "$${i%/*}" != "$$i" ] && mkdir -p "dracut-$(DRACUT_MAIN_VERSION)/$${i%/*}"; cp "$$i" "dracut-$(DRACUT_MAIN_VERSION)/$$i"; done
tar --owner=root --group=root -rf dracut-$(DRACUT_MAIN_VERSION).tar $$(find dracut-$(DRACUT_MAIN_VERSION) -type f)
rm -fr -- dracut-$(DRACUT_MAIN_VERSION).tar.xz dracut-$(DRACUT_MAIN_VERSION)
xz -9 dracut-$(DRACUT_MAIN_VERSION).tar
rm -f -- dracut-$(DRACUT_MAIN_VERSION).tar

rpm: dracut-$(VERSION).tar.xz syncheck
rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \
cp dracut-$(VERSION).tar.xz "$$rpmbuild"; \
LC_MESSAGES=C $$src/git2spec.pl $(VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \
(cd "$$rpmbuild"; rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
ifeq ($(HAVE_RPMBUILD),yes)
rpm: dracut-$(DRACUT_MAIN_VERSION).tar.xz syncheck
rpmbuild=$$(mktemp -d -p /var/tmp rpmbuild-dracut.XXXXXX); src=$$(pwd); \
cp dracut-$(DRACUT_MAIN_VERSION).tar.xz "$$rpmbuild"; \
LC_MESSAGES=C $$src/tools/git2spec.pl $(DRACUT_MAIN_VERSION) "$$rpmbuild" < pkgbuild/dracut.spec > $$rpmbuild/dracut.spec; \
(cd "$$rpmbuild"; \
wget https://www.gnu.org/licenses/lgpl-2.1.txt; \
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
--define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \
--define "_rpmdir $$PWD" -ba dracut.spec; ) && \
( mv "$$rpmbuild"/$$(arch)/*.rpm .; mv "$$rpmbuild"/*.src.rpm .;rm -fr -- "$$rpmbuild"; ls *.rpm )
( mv "$$rpmbuild"/{,$$(uname -m)/}*.rpm $(DESTDIR).; rm -fr -- "$$rpmbuild"; ls $(DESTDIR)*.rpm )

srpm: dracut-$(DRACUT_MAIN_VERSION).tar.xz syncheck
rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \
cp dracut-$(DRACUT_MAIN_VERSION).tar.xz "$$rpmbuild"; \
LC_MESSAGES=C $$src/tools/git2spec.pl $(DRACUT_MAIN_VERSION) "$$rpmbuild" < pkgbuild/dracut.spec > $$rpmbuild/dracut.spec; \
(cd "$$rpmbuild"; \
[ -f $$src/lgpl-2.1.txt ] && cp $$src/lgpl-2.1.txt . || wget https://www.gnu.org/licenses/lgpl-2.1.txt; \
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
--define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \
--define "_rpmdir $$PWD" -bs dracut.spec; ) && \
( mv "$$rpmbuild"/*.src.rpm $(DESTDIR).; rm -fr -- "$$rpmbuild"; ls $(DESTDIR)*.rpm )
else
.PHONY: rpm srpm
rpm: syncheck
srpm: syncheck
endif

syncheck:
@ret=0;for i in dracut-initramfs-restore.sh modules.d/*/*.sh; do \
[ "$${i##*/}" = "module-setup.sh" ] && continue; \
read line < "$$i"; [ "$${line#*bash*}" != "$$line" ] && continue; \
[ $$V ] && echo "posix syntax check: $$i"; bash --posix -n "$$i" ; ret=$$(($$ret+$$?)); \
[ $$V ] && echo "checking for [[: $$i"; if grep -Fq '[[ ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains [["; fi \
[ $$V ] && echo "checking for [[: $$i"; if grep -Fq '[[ ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains [["; fi; \
[ $$V ] && echo "checking for echo -n: $$i"; if grep -Fq 'echo -n ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains echo -n"; fi \
done;exit $$ret
@ret=0;for i in *.sh mkinitrd-dracut.sh modules.d/*/*.sh \
modules.d/*/module-setup.sh; do \
@ret=0;for i in *.sh modules.d/*/*.sh modules.d/*/module-setup.sh; do \
[ $$V ] && echo "bash syntax check: $$i"; bash -n "$$i" ; ret=$$(($$ret+$$?)); \
done;exit $$ret
ifeq ($(HAVE_SHELLCHECK),yes)
ifeq ($(HAVE_SHFMT),yes)
shellcheck $$(shfmt -f .)
else
find . -name '*.sh' -print0 | xargs -0 shellcheck
endif
endif

check: all syncheck rpm
@[ "$$EUID" == "0" ] || { echo "'check' must be run as root! Please use 'sudo'."; exit 1; }
@$(MAKE) -C test check

testimage: all
./dracut.sh -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
./dracut.sh -N -l -a debug -f test-$(KVERSION).img $(KVERSION)
@echo wrote test-$(KVERSION).img

debugtestimage: all
./dracut.sh --debug -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
./dracut.sh --debug -l -a debug -f test-$(KVERSION).img $(KVERSION)
@echo wrote test-$(KVERSION).img

testimages: all
./dracut.sh -l -a debug --kernel-only -f test-kernel-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
./dracut.sh -l -a debug --no-kernel -f test-dracut.img $(shell uname -r)
./dracut.sh -l -a debug --kernel-only -f test-kernel-$(KVERSION).img $(KVERSION)
@echo wrote test-$(KVERSION).img
./dracut.sh -l -a debug --no-kernel -f test-dracut.img $(KVERSION)
@echo wrote test-dracut.img

debughostimage: all
./dracut.sh --debug -H -l -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
./dracut.sh --debug -H -l -f test-$(KVERSION).img $(KVERSION)
@echo wrote test-$(KVERSION).img

hostimage: all
./dracut.sh -H -l -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
./dracut.sh -H -l -f test-$(KVERSION).img $(KVERSION)
@echo wrote test-$(KVERSION).img

efi: all
./dracut.sh --uefi -H -l -f linux-$(KVERSION).efi $(KVERSION)
@echo wrote linux-$(KVERSION).efi

AUTHORS:
git shortlog --numbered --summary -e |while read a rest; do echo $$rest;done > AUTHORS
git shortlog --numbered --summary -e |while read a rest || [ -n "$$rest" ]; do echo $$rest;done > AUTHORS

dracut.html.sign: dracut-$(VERSION).tar.xz dracut.html
gpg-sign-all dracut-$(VERSION).tar.xz dracut.html
CONTRIBUTORS:
@git shortlog $(DRACUT_MAIN_VERSION).. --numbered --summary -e |while read a rest || [ -n "$$rest" ]; do echo "- $$rest";done

dracut.html.sign: dracut-$(DRACUT_MAIN_VERSION).tar.xz dracut.html
gpg-sign-all dracut-$(DRACUT_MAIN_VERSION).tar.xz dracut.html

upload: dracut.html.sign
kup put dracut-$(VERSION).tar.xz dracut-$(VERSION).tar.sign /pub/linux/utils/boot/dracut/
kup put dracut-$(DRACUT_MAIN_VERSION).tar.xz dracut-$(DRACUT_MAIN_VERSION).tar.sign /pub/linux/utils/boot/dracut/
kup put dracut.html dracut.html.sign /pub/linux/utils/boot/dracut/

969
NEWS
View File

@ -1,969 +0,0 @@
dracut-038
==========
- "rd.cmdline=ask" will ask the user on the console to enter additional
kernel command line parameters
- "rd.hostonly=0" removes all "hostonly" added custom files,
which is useful in combination with "rd.auto" or other specific parameters,
if you want to boot on the same hardware, but the compiled in configuration
does not match your setup anymore
- inst* functions and dracut-install now accept the "-H" flag, which logs all
installed files to /lib/dracut/hostonly-files. This is used to remove those
files, if rd.hostonly is given on the kernel command line
- strstr now only does literal string match,
please use strglob and strglobin for globs
- fixed unpacking of the microcode image on shutdown
- added systemd-gpt-auto-generator
- fcoe: wait for lldpad to be ready
- network: handle "ip=dhcp6"
- network: DCHPv6: set valid_lft and preferred_lft
- dm: support dm-cache
- fstab: do not mount and fsck from fstab if using systemd
- break at switch_root only for bare rd.break and not for any rd.break=...
- nbd: make use of "--systemd-mark", otherwise it gets killed on switch_root
- fcoe-uefi: fixed cmdline parameter generation
- iscsi: deprecate "ip=ibft", use "rd.iscsi.ibft[=1]" from now on
- "lsinitrd -m" now only lists the dracut modules of the image
- a lot of small bugfixes

dracut-037
==========
- dracut: hostonly_cmdline variable and command line switch
Toggle hostonly cmdline storing in the initramfs
--hostonly-cmdline:
Store kernel command line arguments needed in the initramfs
--no-hostonly-cmdline:
Do not store kernel command line arguments needed in the initramfs
- dracut: --mount now understands full fstab lines
- dracut now also includes drivers from the /lib/modules/<version>/updates directory
- dracut: only set the owner of files to 0:0, if generated as non-root
- dracut now directly writes to the initramfs file
- dracut: call lz4 with the legacy flag (linux kernel does not support the new format)
- systemd: rootfs-generator generates JobTimeout=0 units for the root device
- systemd: added the systemd-sysctl service
- systemd: add 80-net-setup-link.rules and .link files for persistent interface renaming
- systemd: make dracut-shutdown.service failure non-fatal
- network: various IPv6 fixes
- network: DCHCP for IPv6
- network: understand ip=.....:<dns1>:<dns2>
- network: parse ibft nameserver settings
- shutdown: if kexec fails, just reboot
- lvm: handle one LV at a time with lvchange
- module-setup.sh:
New functions require_binaries() and require_any_binary() to be used
in the check() section of module-setup.sh.
- a lot of small bugfixes

Contributions from:
Harald Hoyer
Alexander Tsoy
Till Maas
Amadeusz Żołnowski
Brian C. Lane
Colin Guthrie
Dave Young
WANG Chao
Shawn W Dunn

dracut-036
==========
- fixed skipcpio signature checking

dracut-035
==========
- changed dracut tarball compression to xz
- new argument "--rebuild"
- add lzo, lz4 compression
- install: install all binaries with <name> found in PATH
- lsinitrd can now handle initramfs images with an early cpio prepended
(microcode, ACPI tables)
- mkinitrd-suse added as a compat stub for dracut
- lvm: install thin utils for non-hostonly
- resume: fix swap detection in hostonly
- avoid loading unnecessary 32-bit libraries for 64-bit initrds
- crypt: wait for systemd password agents
- crypt: skip crypt swaps with password files
- network: before doing dhcp, dracut now checks, if the link has a carrier
- network: dhclient-script.sh now sets the lease time
- network: include usbnet drivers
- network: include all ethernet drivers
- network: add rd.bootif=0 to ignore BOOTIF
- i18n: introduce i18n_install_all, to install everything i18n related
- support SuSE DASD configurations
- support SuSE zfcp configurations
- support SuSE compressed KEYMAP= setting
- usrmount: always install the module,
so always mount /usr from within the initramfs
- test/TEST-17-LVM-THIN: new test case for lvm thin pools
- "halt" the machine in systemd mode for die()

dracut-034
==========
- do not run dhcp on parts of assembled network interfaces (bond, bridge)
- add option to turn on/off prelinking
--prelink, --noprelink
do_prelink=[yes|no]
- add ACPI table overriding
- do not log to syslog/kmsg/journal for UID != 0
- lvm/mdraid: Fix LVM on MD activation
- bcache module removed (now in bcache-tools upstream)
- mdadm: also install configs from /etc/mdadm.conf.d
- fixes for mdadm-3.2.6+
- mkinitrd: better compat support for SUSE
- fcoe: add FCoE UEFI boot device support
- rootfs-block: add support for the rootfallback= kernel cmdline option

Contributions from:
Thomas Renninger
Alexander Tsoy
Peter Rajnoha
WANG Chao
Harald Hoyer


dracut-033
==========
- improved hostonly device recognition
- improved hostonly module recognition
- add dracut.css for dracut.html
- do not install udev rules from /etc in generic mode
- fixed LABEL= parsing for swap devices
- fixed iBFT network setup
- url-lib.sh: handle 0-size files with curl
- dracut.asc: document debugging dracut on shutdown
- if rd.md=0, use dmraid for imsm and ddf
- skip empty dracut modules
- removed caching of kernel cmdline
- fixed iso-scan, if the loop device driver is a kernel module
- bcache: support new blkid
- fixed ifup udev rules
- ifup with dhcp, if no "ip=" specified for the interface

Contributions from:
WANG Chao
Colin Walters
Harald Hoyer


dracut-032
==========
- add parameter --print-cmdline
This prints the kernel command line parameters for the current disk
layout.
$ dracut --print-cmdline
rd.luks.uuid=luks-e68c8906-6542-4a26-83c4-91b4dd9f0471
rd.lvm.lv=debian/root rd.lvm.lv=debian/usr root=/dev/mapper/debian-root
rootflags=rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered
rootfstype=ext4
- dracut.sh: add --persistent-policy option and persistent_policy conf option
--persistent-policy <policy>:
Use <policy> to address disks and partitions.
<policy> can be any directory name found in /dev/disk.
E.g. "by-uuid", "by-label"
- dracut now creates the initramfs without udevadm
that means the udev database does not have to populated
and the initramfs can be built in a chroot with
/sys /dev /proc mounted
- renamed dracut_install() to inst_multiple() for consistent naming
- if $libdirs is unset, fall back to ld.so.cache paths
- always assemble /usr device in initramfs
- bash module added (disable it, if you really want dash)
- continue to boot, if the main loop times out, in systemd mode
- removed inst*() shell pure versions, dracut-install binary is in charge now
- fixed ifcfg file generation for vlan
- do not include adjtime and localtime anymore
- fixed generation of zfcp.conf of CMS setups
- install vt102 terminfo
dracut_install() is still there for backwards compat
- do not strip files in FIPS mode
- fixed iBFT interface configuration
- fs-lib: install fsck and fsck.ext*
- shutdown: fixed killall_proc_mountpoint()
- network: also wait for ethernet interfaces to setup
- fixed checking for FIPS mode

Contributions from:
Harald Hoyer
WANG Chao
Baoquan He
Daniel Schaal
Dave Young
James Lee
Radek Vykydal


dracut-031
==========
- do not include the resume dracut module in hostonly mode,
if no swap is present
- don't warn twice about omitted modules
- use systemd-cat for logging on systemd systems, if logfile is unset
- fixed PARTUUID parsing
- support kernel module signing keys
- do not install the usrmount dracut module in hostonly mode,
if /sbin/init does not live in /usr
- add debian udev rule files
- add support for bcache
- network: handle bootif style interfaces
e.g. ip=77-77-6f-6f-64-73:dhcp
- add support for kmod static devnodes
- add vlan support for iBFT

Contributions from:
Harald Hoyer
Amadeusz Żołnowski
Brandon Philips
Colin Walters
James Lee
Kyle McMartin
Peter Jones

dracut-030
==========
- support new persistent network interface names
- fix findmnt calls, prevents hang on stale NFS mounts
- add systemd.slice and slice.target units
- major shell cleanup
- support root=PARTLABEL= and root=PARTUUID=
- terminfo: only install l/linux v/vt100 and v/vt220
- unset all LC_* and LANG, 10% faster
- fixed dependency loop for dracut-cmdline.service
- do not wait_for_dev for the root devices
- do not wait_for_dev for devices, if dracut-initqueue is not needed
- support early microcode loading with --early-microcode
- dmraid, let dmraid setup its own partitions
- sosreport renamed to rdsosreport

Contributions from:
Harald Hoyer
Konrad Rzeszutek Wilk
WANG Chao

dracut-029
==========
- wait for IPv6 autoconfiguration
- i18n: make the default font configurable
To set the default font for your distribution, add
i18n_default_font="latarcyrheb-sun16"
to your /lib/dracut/dracut.conf.d/01-dist.conf distribution config.
- proper handle "rd.break" in systemd mode before switch-root
- systemd: make unit files symlinks
- build without dash requirement
- add dracut-shutdown.service.8 manpage
- handle MACs for "ip="
"ip=77-77-6f-6f-64-73:dhcp"
- don't explode when mixing BOOTIF and ip=
- 90lvm/module-setup.sh: redirect error message of lvs to /dev/null

Contributions from:
Harald Hoyer
Will Woods
Baoquan He

dracut-028
==========
- full integration of crypto devs in systemd logic
- support for bridge over team and vlan tagged team
- support multiple bonding interfaces
- new kernel command line param "rd.action_on_fail"
to control the emergency action
- support for bridge over a vlan tagged interface
- support for "iso-scan/filename" kernel parameter
- lsinitrd got some love and does not use "file" anymore
- fixed issue with noexec mounted tmp dirs
- FIPS mode fixed
- dracut_install got some love
- fixed some /usr mounting problems
- ifcfg dracut module got some love and fixes
- default installed font is now latarcyrheb-sun16
- new parameters rd.live.dir and rd.live.squashimg
- lvm: add tools for thin provisioning
- also install non-hwcap libs
- setup correct system time and time zone in initrd
- s390: fixed cms setup
- add systemd-udevd persistent network interface naming

Contributions from:
Harald Hoyer
Kamil Rytarowski
WANG Chao
Baoquan He
Adam Williamson
Colin Guthrie
Dan Horák
Dave Young
Dennis Gilmore
Dennis Schridde

dracut-027
==========
- dracut now has bash-completion
- require bash version 4
- systemd module now requires systemd >= 199
- dracut makes use of native systemd initrd units
- added hooks for new-kernel-pkg and kernel-install
- hostonly is now default for fedora
- comply with the BootLoaderSpec paths
http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec
- added rescue module
- host_fs_types is now a hashmap
- new dracut argument "--regenerate-all"
- new dracut argument "--noimageifnotneeded"
- new man page dracut.bootup
- install all host filesystem drivers
- use -D_FILE_OFFSET_BITS=64 to build dracut-install

dracut-026
==========
- introduce /usr/lib/dracut/dracut.conf.d/ drop-in directory

/usr/lib/dracut/dracut.conf.d/*.conf can be overwritten by the same
filenames in /etc/dracut.conf.d.

Packages should use /usr/lib/dracut/dracut.conf.d rather than
/etc/dracut.conf.d for drop-in configuration files.

/etc/dracut.conf and /etc/dracut.conf.d belong to the system administrator.

- uses systemd-198 native initrd units
- totally rely on the fstab-generator in systemd mode for block devices
- dracut systemd now uses dracut.target rather than basic.target
- dracut systemd services optimize themselves away
- fixed hostonly parameter generation
- turn off curl globbing (fixes IPv6)
- modify the udev rules on install and not runtime time
- enable initramfs building without kernel modules (fixed regression)
- in the initqueue/timeout,
reset the main loop counter, as we see new udev events or initqueue/work
- fixed udev rule installation

dracut-025
==========
- do not strip signed kernel modules
- add sosreport script and generate /run/initramfs/sosreport.txt
- make short uuid specification for allow-discards work
- turn off RateLimit for the systemd journal
- fixed MAC address assignment
- add systemd checkisomd5 service
- splitout drm kernel modules from plymouth module
- add 'swapoff' to initramfs to fix shutdown/reboot
- add team device support
- add pre-shutdown hook
- kill all processes in shutdown and report remaining ones
- "--device" changed to "--add-device" and "add_device=" added for conf files
- add memory usage trace to different hook points
- cope with optional field #7 in /proc/self/mountinfo
- lots of small bugfixes

dracut-024
==========
- new dracut option "--device"
- new dracut kernel command line options "rd.auto"
- new dracut kernel command line options "rd.noverifyssl"
- new dracut option "--kernel-cmdline" and "kernel_cmdline" option for default parameters
- fixes for systemd and crypto
- fix for kexec in shutdown, if not included in initramfs
- create the initramfs non-world readable
- prelink/preunlink in the initramfs
- strip binaries in the initramfs by default now
- various FIPS fixes
- various dracut-install fixes

dracut-023
==========
- resume from hibernate fixes
- -N option for --no-hostonly
- support for systemd crypto handling
- new dracut module "crypt-loop"
- deprecate the old kernel command line options
- more documentation
- honor CFLAGS for dracut-install build
- multipath fixes
- / is mounted according to rootflags parameter but forced ro at first.
Later it is remounted according to /etc/fstab + rootflags parameter
and "ro"/"rw".
- support for xfs / reiserfs separate journal device
- new "ro_mnt" option to force ro mount of / and /usr
- root on cifs support
- dracut-install: fixed issue for /var/tmp containing a symlink
- only lazy resolve with ldd, if the /var/tmp partition is not mounted with "noexec"
- i18n: fixed inclusion of "include" keymaps

dracut-022
==========
- fixed host-only kernel module bug

dracut-021
==========
- fixed systemd in the initramfs (requires systemd >= 187)
- dracut-install: massive speedup with /var on the same filesystem with COW copy
- dracut-install: moved to /usr/lib/dracut until it becomes a general purpose tool
- new options: "rd.usrmount.ro" and "rd.skipfsck"
- less mount/umount
- apply "ro" on the kernel command line also to /usr
- mount according to fstab, if neither "ro" or "rw" is specified
- skip fsck for xfs and btrfs. remount is enough
- give emergency_shell if /usr mount failed
- dracut now uses getopt:
* options can be position independent now!!
* we can now use --option=<arg>
- added option "--kver=<kernel-version>", and the image location can be omitted
# dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64
- dracut.sh: for --include copy also the symbolic links
- man pages: lsinitrd and mkinitrd added
- network: We do not support renaming in the kernel namespace anymore (as udev does
that not anymore). So, if a user wants to use ifname, he has to rename
to a custom namespace. "eth[0-9]+" is not allowed anymore. !!!!!
- resume: moved the resume process to the initqueue.
This should prevent accidently mounting the root file system.
- testsuite: add support for: make V=1 TESTS="01 20 40" check
$ sudo make V=1 clean check
now runs the testsuite in verbose mode

$ sudo make TESTS="01 20 40" clean check
now only runs the 01, 20 and 40 tests.

dracut-020
==========
- changed rd.dasd kernel parameter
- arm kernel modules added to kernel-modules
- make udevdir systemdutildir systemdsystemunitdir global vars
your distribution should ship those settings in
/etc/dracut.conf.d/01-distro.conf
see dracut.conf.d/fedora.conf.example
- kernel modules are now only handled with /sys/modules and modules.dep
- systemd fixups
- mdraid: wait for md devices to be clean, before shutdown
- ifup fixed for ipv6
- add PARTUUID as root=PARTUUID=<partition uuid> parameter
- fixed instmods() return code and set pipefail globally
- add 04watchdog dracut module
- dracut-shutdown.service: fixed ordering to be before shutdown.target
- make use of "ln -r" instead of shell functions, if new coreutils is installed
- network: support vlan tagged bonding
- new dracut module qemu and qemu-net to install all kernel driver
- fs-lib/fs-lib.sh: removed test mounting of btrfs and xfs
- no more "mknod" in the initramfs!!
- replaced all "tr" calls with "sed"
- speedup with lazy kernel module dependency resolving
- lots of speedup optimizations and last but not least
- dracut-install:
- new binary to significanlty speedup the installation process
- dracut-functions.sh makes use of it, if installed


dracut-019
==========
- initqueue/online hook
- fixes for ifcfg write out
- rootfs-block: avoid remount when options don't change
- Debian multiarch support
- virtfs root filesystem support
- cope with systemd-udevd
- mount tmpfs with strictatime
- include all kernel/drivers/net/phy drivers
- add debug_on() and debug_off() functions
- add arguments for source_hook() and source_all()
- cleanup hook
- plymouth: get consoledev from /sys/class/tty/console/active
- experimental systemd dracut module for systemd in the initramfs
- install xhci-hcd kernel module
- dracut: new "--mount" option
- lsinitrd: new option --printsize
- ARM storage kernel modules added
- s390 cms conf file support
- /etc/initrd-release in the initrd
- vlan support
- full bonding and bridge support
- removed scsi_wait_scan kernel module from standard install
- support rd.luks.allow-discards and honor options in crypttab
- lots of bugfixes

dracut-018
==========
- lvm: ignore lvm mirrors
- lsinitrd: handle LZMA images
- iscsi: add rd.iscsi.param
- iscsi: add iscsi interface binding
- new module cms to read and handle z-Series cms config files
- fixed fstab.sys handling
- new dracut option "--tmpdir"
- new dracut option "--no-hostonly"
- nbd: name based nbd connects
- converted manpage and documentation source to asciidoc
- write-ifcfg fixes and cleanups
- ifup is now done in the initqueue
- netroot cleanup
- initqueue/online is now for hooks, which require network
- no more /tmp/root.info
- 98pollcdrom: factored out the ugly cdrom polling in the main loop
- simplified rd.luks.uuid testing
- removed "egrep" and "ls" calls
- speedup kernel module installation
- make bzip2 optional
- lots of bugfixes

dracut-017
==========
- a _lot_ faster than dracut-016 in image creation
- systemd service dracut-shutdown.service
- livenet fixes
- ssh-client module install fix
- root=iscsi:... fixed
- lots of restructuring and optimizing in dracut-functions.sh
- usrmount: honor fs_passno in /etc/fstab
- renamed all shell scripts to .sh
- new option "--omit-drivers" and config option "omit_drivers"
- hostonly mode fixups

dracut-016
==========
- fixed lsinitrd
- honor binaries in sbin first
- fixed usrmount module
- added systemd service for shutdown
- fixed terminfo on distros with /usr/share/terminfo
- reload udev rules after "pre-trigger" hook
- improved test suite
- new parameter "--omit-drivers" and new conf param omit_drivers
- "--offroot" support for mdraid
- new libs: net-lib.sh, nfs-lib.sh, url-lib.sh, img-lib.sh
full of functions to use in your dracut module

dracut-015
==========
- hostonly mode automatically adds command line options for root and /usr
- --add-fstab --mount parameters
- ssh-client module
- --ctty option: add job control
- cleanup /run/initramfs
- convertfs module
- /sbin/ifup can be called directly
- support kernel modules compressed with xz
- s390 iscsi modules added
- terminfo module
- lsinitrd can handle concatened images
- lsinitrd can sort by size

dracut-014
==========
- new dracut arguments:
--lvmconf
--nolvmconf
--fscks [LIST]
--nofscks
- new .conf options:
install_items
fscks
nofscks
- new kernel options:
rd.md.ddf
rd.md.waitclean
plymouth.enable
- dracut move from /sbin to /usr/bin
- dracut modules dir moved from /usr/share/dracut to /usr/lib/dracut
- profiling with "dracut --profile"
- new TEST-16-DMSQUASH, test for Fedora LiveCDs
- speedup of initramfs creation
- ask_for_password fallback to CLI
- mdraid completely switched to incremental assembly
- no more cdrom polling
- "switch_root" breakpoint is now very late
- /dev/live is gone
- /dev/root is gone
- fs-lib dracut module for fscks added
- xen dracut module removed
- usb mass storage kernel drivers now included
- usrmount dracut module added:
mount /usr if found in /sysroot/etc/fstab
- only include fsck helper needed for hostonly
- fcoe: support for bnx2fc
- support iSCSI drivers: qla4xxx, cxgb3i, cxgb4i, bnx2i, be2iscsi
- fips-aesni dracut module added
- add install_items to dracut.conf
install_items+=" <file>[ <file> ...] "
- speedup internal testsuite
- internal testsuite: store temporary data in a temporary dir

dracut-013
==========
- speedup of initramfs creation
- fixed inst_dir for symbolic links
- add unix kernel module

dracut-012
==========
- better fsck handling
- fixed wait condition for LVM volumes
- fix for hardlinks (welcome Debian! :-)
- shutdown bugfixes
- automatic busybox symlink creation
- try to mount /usr, if init points to a path in /usr
- btrfs with multiple devices
- "--force-add" option for dracut, to force-add dracut modules,
without hostonly checks
- lsinitrd also display the initramfs size in human readable form
- livenet module, to mount live-isos over http
- masterkey,ecryptfs,integrity security modules
- initqueue/timeout queue e.g. for starting degraded raids
- "make rpm" creates an rpm with an increasing release number from any
git checkout
- support lvm mirrors
- start degraded lvm mirrors after a timeout
- start degraded md raids after a timeout
- getarg() now returns wildcards without file matching to the current fs
- lots of bugfixes

dracut-011
==========
- use udev-168 features for shutting down udev
- introduce "--prefix" to put all initramfs files in e.g "/run/initramfs"
- new shutdown script (called by systemd >= 030) to disassemble the root device
- lots of bugfixes
- new module for gpg-encrypted keys - 91crypt-gpg

dracut-010
==========
- lots of bugfixes
- plymouth: use /run/plymouth/pid instead of /run/initramfs/plymouth
- add "/lib/firmware/updates" to default firmware path

dracut-009
==========
- dracut generator
- dracut-logger
- xz compression
- better argument handling

- initramfs
- hooks moved to /lib/dracut/hooks in initramfs
- rd.driver.{blacklist|pre|post} accept comma separated driver list
- iSCSI: iSCSI Boot Firmware Table (iBFT) support
- support for /run
- live image: support for generic rootfs.img (instead of ext3fs.img)
- caps module
- FCoE: EDD support

dracut-008
==========
- removed --ignore-kernel-modules option (no longer necessary)
- renamed kernel command line arguments to follow the rd. naming scheme
- merged check, install, installkernel to module-setup.sh
- support for bzip2 and xz compressed initramfs images.
- source code beautification
- lots of documentation
- lsinitrd: "catinitrd" functionality
- dracut: --list-modules
- lvm: support for dynamic LVM SNAPSHOT root volume
- 95fstab-sys: mount all /etc/fstab.sys volumes before switch_root
- 96insmodpost dracut module
- rd.shell=1 per default
- rootfs-block:mount-root.sh add fsck
- busybox shell replacements module
- honor old "real_init="
- 97biosdevname dracut module

dracut-007
==========
- module i18n is no longer fedora/red hat specific (Amadeusz Żołnowski)
- distribution specific conf file
- bootchartd support
- debug module now has fsck
- use "hardlink", if available, to save some space
- /etc/dracut.conf can be overwritten by settings in /etc/dracut.conf.d/*.conf
- gentoo splash module
- --ignore-kernel-modules option
- crypto keys on external devices support
- bugfixes

dracut-006
==========
- fixed mdraid with IMSM
- fixed dracut manpages
- dmraid parse different error messages
- add cdrom polling mechanism for slow cdroms
- add module btrfs
- add btrfsctl scan for btrfs multi-devices (raid)
- teach dmsquash live-root to use rootflags
- trigger udev with action=add
- fixed add_drivers handling
- add sr_mod
- use pigz instead of gzip, if available
- boot from LVM mirrors and snapshots
- iscsi: add support for multiple netroot=iscsi:
- Support old version of module-init-tools
- got rid of rdnetdebug
- fixed "ip=auto6"
- dracut.conf: use "+=" as default for config variables
- bugfixes

dracut-005
==========
- dcb support to dracut's FCoE support
- add readonly overlay support for dmsquash
- add keyboard kernel modules
- dracut.conf: added add_dracutmodules
- add /etc/dracut.conf.d
- add preliminary IPv6 support
- bugfixes

dracut-004
==========
- dracut-lib: read multiple lines from $init/etc/cmdline
- lsinitrd and mkinitrd
- dmsquash: add support for loopmounted *.iso files
- lvm: add rd_LVM_LV and "--poll n"
- user suspend support
- add additional drivers in host-only mode, too
- improved emergency shell
- support for compressed kernel modules
- support for loading Xen modules
- rdloaddriver kernel command line parameter
- man pages for dracut-catimages and dracut-gencmdline
- bugfixes

dracut-003
==========
- add debian package modules
- add dracut.conf manpage
- add module 90multipath
- add module 01fips
- crypt: ignore devices in /etc/crypttab (root is not in there)
unless rd_NO_CRYPTTAB is specified
- kernel-modules: add scsi_dh scsi_dh_rdac scsi_dh_emc
- add multinic support
- add s390 zfcp support
- add s390 dasd support
- add s390 network support
- fixed dracut-gencmdline for root=UUID or LABEL
- do not destroy assembled raid arrays if mdadm.conf present
- mount /dev/shm
- let udevd not resolve group and user names
- moved network from udev to initqueue
- improved debug output: specifying "rdinitdebug" now logs
to dmesg, console and /init.log
- strip kernel modules which have no x bit set
- redirect stdin, stdout, stderr all RW to /dev/console
so the user can use "less" to view /init.log and dmesg
- add new device mapper udev rules and dmeventd
- fixed dracut-gencmdline for root=UUID or LABEL
- do not destroy assembled raid arrays if mdadm.conf present
- mount /dev/shm
- let udevd not resolve group and user names
- preserve timestamps of tools on initramfs generation
- generate symlinks for binaries correctly
- moved network from udev to initqueue
- mount nfs3 with nfsvers=3 option and retry with nfsvers=2
- fixed nbd initqueue-finished
- improved debug output: specifying "rdinitdebug" now logs
to dmesg, console and /init.log
- strip kernel modules which have no x bit set
- redirect stdin, stdout, stderr all RW to /dev/console
so the user can use "less" to view /init.log and dmesg
- make install of new dm/lvm udev rules optionally
- add new device mapper udev rules and dmeventd
- Fix LiveCD boot regression
- bail out if selinux policy could not be loaded and
selinux=0 not specified on kernel command line
- do not cleanup dmraids
- copy over lvm.conf

dracut-002
==========
- add ifname= argument for persistent netdev names
- new /initqueue-finished to check if the main loop can be left
- copy mdadm.conf if --mdadmconf set or mdadmconf in dracut.conf
- plymouth: use plymouth-populate-initrd
- add add_drivers for dracut and dracut.conf
- add modprobe scsi_wait_scan to be sure everything was scanned
- fix for several problems with md raid containers
- fix for selinux policy loading
- fix for mdraid for IMSM
- fix for bug, which prevents installing 61-persistent-storage.rules (bug #520109)
- fix for missing grep for md

dracut-001
==========
- better --hostonly checks
- better lvm/mdraid/dmraid handling
- fcoe booting support
Supported cmdline formats:
fcoe=<networkdevice>:<dcb|nodcb>
fcoe=<macaddress>:<dcb|nodcb>

Note currently only nodcb is supported, the dcb option is reserved for
future use.

Note letters in the macaddress must be lowercase!

Examples:
fcoe=eth0:nodcb
fcoe=4A:3F:4C:04:F8:D7:nodcb

- Syslog support for dracut
This module provides syslog functionality in the initrd.
This is especially interesting when complex configuration being
used to provide access to the device the rootfs resides on.


dracut-0.9
==========
- let plymouth attach to the terminal (nice text output now)
- new kernel command line parameter "rdinfo" show dracut output, even when
"quiet" is specified
- rd_LUKS_UUID is now handled correctly
- dracut-gencmdline: rd_LUKS_UUID and rd_MD_UUID is now correctly generated
- now generates initrd-generic with around 15MB
- smaller bugfixes

dracut-0.8
==========
- iSCSI with username and password
- support for live images (dmsquashed live images)
- iscsi_firmware fixes
- smaller images
- bugfixes

dracut-0.7
==========
- dracut: strip binaries in initramfs

--strip
strip binaries in the initramfs (default)

--nostrip
do not strip binaries in the initramfs
- dracut-catimages

Usage: ./dracut-catimages [OPTION]... <initramfs> <base image>
[<image>...]
Creates initial ramdisk image by concatenating several images from the
command
line and /boot/dracut/

-f, --force Overwrite existing initramfs file.
-i, --imagedir Directory with additional images to add
(default: /boot/dracut/)
-o, --overlaydir Overlay directory, which contains files that
will be used to create an additional image
--nooverlay Do not use the overlay directory
--noimagedir Do not use the additional image directory
-h, --help This message
--debug Output debug information of the build process
-v, --verbose Verbose output during the build process

- s390 dasd support

dracut-0.6
==========
- dracut: add --kernel-only and --no-kernel arguments

--kernel-only
only install kernel drivers and firmware files

--no-kernel
do not install kernel drivers and firmware files

All kernel module related install commands moved from "install"
to "installkernel".

For "--kernel-only" all installkernel scripts of the specified
modules are used, regardless of any checks, so that all modules
which might be needed by any dracut generic image are in.

The basic idea is to create two images. One image with the kernel
modules and one without. So if the kernel changes, you only have
to replace one image.

Grub and the kernel can handle multiple images, so grub entry can
look like this:

title Fedora (2.6.29.5-191.fc11.i586)
root (hd0,0)
kernel /vmlinuz-2.6.29.5-191.fc11.i586 ro rhgb quiet
initrd /initrd-20090722.img /initrd-kernel-2.6.29.5-191.fc11.i586.img /initrd-config.img

initrd-20090722.img
the image provided by the initrd rpm
one old backup version is kept like with the kernel

initrd-kernel-2.6.29.5-191.fc11.i586.img
the image provided by the kernel rpm

initrd-config.img
optional image with local configuration files

- dracut: add --kmoddir directory, where to look for kernel modules

-k, --kmoddir [DIR]
specify the directory, where to look for kernel modules



dracut-0.5
==========
- more generic (all plymouth modules, all keyboards, all console fonts)
- more kernel command line parameters (see also man dracut(8))
- a helper tool, which generates the kernel command line (dracut-gencmdline)
- bridged network boot
- a lot of new command line parameter

dracut-0.4
==========
- bugfixes
- firmware loading support
- new internal queue (initqueue)
initqueue now loops until /dev/root exists or root is mounted

init now has the following points to inject scripts:

/cmdline/*.sh
scripts for command line parsing

/pre-udev/*.sh
scripts to run before udev is started

/pre-trigger/*.sh
scripts to run before the main udev trigger is pulled

/initqueue/*.sh
runs in parallel to the udev trigger
Udev events can add scripts here with /sbin/initqueue.
If /sbin/initqueue is called with the "--onetime" option, the script
will be removed after it was run.
If /initqueue/work is created and udev >= 143 then this loop can
process the jobs in parallel to the udevtrigger.
If the udev queue is empty and no root device is found or no root
filesystem was mounted, the user will be dropped to a shell after
a timeout.
Scripts can remove themselves from the initqueue by "rm $job".

/pre-mount/*.sh
scripts to run before the root filesystem is mounted
NFS is an exception, because it has no device node to be created
and mounts in the udev events

/mount/*.sh
scripts to mount the root filesystem
NFS is an exception, because it has no device node to be created
and mounts in the udev events
If the udev queue is empty and no root device is found or no root
filesystem was mounted, the user will be dropped to a shell after
a timeout.

/pre-pivot/*.sh
scripts to run before the real init is executed and the initramfs
disappears
All processes started before should be killed here.

The behaviour of the dmraid module demonstrates how to use the new
mechanism. If it detects a device which is part of a raidmember from a
udev rule, it installs a job to scan for dmraid devices, if the udev
queue is empty. After a scan, it removes itsself from the queue.



dracut-0.3
==========

- first public version

2533
NEWS.md Normal file

File diff suppressed because it is too large Load Diff

92
README
View File

@ -1,92 +0,0 @@
dracut
------
dracut is a new initramfs infrastructure.

Information about the initial goals and aims can be found at
https://fedoraproject.org/wiki/Initrdrewrite

Unlike existing initramfs's, this is an attempt at having as little as
possible hard-coded into the initramfs as possible. The initramfs has
(basically) one purpose in life -- getting the rootfs mounted so that
we can transition to the real rootfs. This is all driven off of
device availability. Therefore, instead of scripts hard-coded to do
various things, we depend on udev to create device nodes for us and
then when we have the rootfs's device node, we mount and carry on.
This helps to keep the time required in the initramfs as little as
possible so that things like a 5 second boot aren't made impossible as
a result of the very existence of an initramfs. It's likely that
we'll grow some hooks for running arbitrary commands in the flow of
the script, but it's worth trying to resist the urge as much as we can
as hooks are guaranteed to be the path to slow-down.

Most of the initramfs generation functionality in dracut is provided by a bunch
of generator modules that are sourced by the main dracut script to install
specific functionality into the initramfs. They live in the modules.d
subdirectory, and use functionality provided by dracut-functions to do their
work.

Some general rules for writing modules:
* Use one of the inst family of functions to actually install files
on to the initramfs. They handle mangling the pathnames and (for binaries,
scripts, and kernel modules) installing dependencies as appropriate so
you do not have to.
* Scripts that end up on the initramfs should be POSIX compliant. dracut
will try to use /bin/dash as /bin/sh for the initramfs if it is available,
so you should install it on your system -- dash aims for strict POSIX
compliance to the extent possible.
* Hooks MUST be POSIX compliant -- they are sourced by the init script,
and having a bashism break your user's ability to boot really sucks.
* Generator modules should have a two digit numeric prefix -- they run in
ascending sort order. Anything in the 90-99 range is stuff that dracut
relies on, so try not to break those hooks.
* Hooks must have a .sh extension.
* Generator modules are described in more detail in README.modules.
* We have some breakpoints for debugging your hooks. If you pass 'rdbreak'
as a kernel parameter, the initramfs will drop to a shell just before
switching to a new root. You can pass 'rdbreak=hookpoint', and the initramfs
will break just before hooks in that hookpoint run.

Also, there is an attempt to keep things as distribution-agnostic as
possible. Every distribution has their own tool here and it's not
something which is really interesting to have separate across them.
So contributions to help decrease the distro-dependencies are welcome.

Currently dracut lives on kernel.org.

The tarballs can be found here:
http://www.kernel.org/pub/linux/utils/boot/dracut/
ftp://ftp.kernel.org/pub/linux/utils/boot/dracut/

Git:
git://git.kernel.org/pub/scm/boot/dracut/dracut.git
http://git.kernel.org/pub/scm/boot/dracut/dracut.git
https://git.kernel.org/pub/scm/boot/dracut/dracut.git

git://github.com/haraldh/dracut.git

git://dracut.git.sourceforge.net/gitroot/dracut/dracut

Git Web:
http://git.kernel.org/?p=boot/dracut/dracut.git

https://haraldh@github.com/haraldh/dracut.git

http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut

Git Web RSS Feed:
http://git.kernel.org/?p=boot/dracut/dracut.git;a=rss

Project Page:
http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html

Project Wiki:
http://dracut.wiki.kernel.org

See the TODO file for things which still need to be done and HACKING for
some instructions on how to get started. There is also a mailing list
that is being used for the discussion -- initramfs@vger.kernel.org.
It is a typical vger list, send mail to majordomo@vger.kernel.org with body
of 'subscribe initramfs email@host.com'


Licensed under the GPLv2

55
README.md Normal file
View File

@ -0,0 +1,55 @@
dracut
====

dracut is an event driven initramfs infrastructure.

[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](.github/CODE_OF_CONDUCT.md)
[![Fedora-32](https://github.com/dracutdevs/dracut/workflows/Fedora-32/badge.svg?branch=master)](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-32)
[![Fedora-33](https://github.com/dracutdevs/dracut/workflows/Fedora-33/badge.svg?branch=master)](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-33)
[![Fedora-latest](https://github.com/dracutdevs/dracut/workflows/Fedora-latest/badge.svg?branch=master)](https://github.com/dracutdevs/dracut/actions?query=workflow%3AFedora-latest)

dracut (the tool) is used to create an initramfs image by copying tools
and files from an installed system and combining it with the
dracut framework, usually found in /usr/lib/dracut/modules.d.

Unlike other implementations, dracut hard-codes as little
as possible into the initramfs. The initramfs has
(basically) one purpose in life -- getting the rootfs mounted so that
we can transition to the real rootfs. This is all driven off of
device availability. Therefore, instead of scripts hard-coded to do
various things, we depend on udev to create device nodes for us and
then when we have the rootfs's device node, we mount and carry on.
This helps to keep the time required in the initramfs as little as
possible so that things like a 5 second boot aren't made impossible as
a result of the very existence of an initramfs.

Most of the initramfs generation functionality in dracut is provided by a bunch
of generator modules that are sourced by the main dracut script to install
specific functionality into the initramfs. They live in the modules.d
subdirectory, and use functionality provided by dracut-functions to do their
work.

Currently dracut lives on github.com and kernel.org.

The tarballs can be found here:
http://www.kernel.org/pub/linux/utils/boot/dracut/
ftp://ftp.kernel.org/pub/linux/utils/boot/dracut/

Git:
https://github.com/dracutdevs/dracut.git
http://git.kernel.org/?p=boot/dracut/dracut.git

Project Documentation:
http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html

Project Wiki:
http://dracut.wiki.kernel.org

See the github issue tracker for things which still need to be done and HACKING.md
for some instructions on how to get started. There is also a mailing list
that is being used for the discussion -- initramfs@vger.kernel.org.
It is a typical vger list, send mail to majordomo@vger.kernel.org with body
of 'subscribe initramfs email@host.com'


Licensed under the GPLv2

View File

@ -1,112 +0,0 @@
Most of the functionality that dracut implements are actually implemented
by dracut modules. dracut modules live in modules.d, and have the following
structure:

dracut_install_dir/modules.d/
00modname/
module-setup.sh
check
<other files as needed by the hook>

00modname: The name of the module prefixed by a two-digit numeric sort code.
The numeric code must be present and in the range of 00 - 99.
Modules with lower numbers are installed first. This is important
because the dracut install functions (which install files onto
the initrd) refuse to overwrite already installed files. This makes
it easy for an earlier module to override the functionality of a
later module, so that you can have a distro or system specific
module override or modify the functionality of a generic module
without having to patch the more generic module.

module-setup.sh:
dracut sources this script to install the functionality that a
module implements onto the initrd. For the most part, this amounts
to copying files from the host system onto the initrd in a controlled
manner.

install():
This function of module-setup.sh is called to install all
non-kernel files. dracut supplies several install functions that are
specialized for different file types. Browse through dracut-functions
fore more details. dracut also provides a $moddir variable if you
need to install a file from the module directory, such as an initrd
hook, a udev rule, or a specialized executable.

installkernel():
This function of module-setup.sh is called to install all
kernel related files.


check():
dracut calls this function to check and see if a module can be installed
on the initrd.

When called without options, check should check to make sure that
any files it needs to install into the initrd from the host system
are present. It should exit with a 0 if they are, and a 1 if they are
not.

When called with $hostonly set, it should perform the same check
that it would without it set, and it should also check to see if the
functionality the module implements is being used on the host system.
For example, if this module handles installing support for LUKS
encrypted volumes, it should return 0 if all the tools to handle
encrpted volumes are available and the host system has the root
partition on an encrypted volume, 1 otherwise.

depends():
This function should output a list of dracut modules
that it relies upon. An example would be the nfs and iscsi modules,
which rely on the network module to detect and configure network
interfaces.

Any other files in the module will not be touched by dracut directly.

You are encouraged to provide a README that describes what the module is for.


HOOKS
=====

init has the following hook points to inject scripts:

/lib/dracut/hooks/cmdline/*.sh
scripts for command line parsing

/lib/dracut/hooks/pre-udev/*.sh
scripts to run before udev is started

/lib/dracut/hooks/pre-trigger/*.sh
scripts to run before the main udev trigger is pulled

/lib/dracut/hooks/initqueue/*.sh
runs in parallel to the udev trigger
Udev events can add scripts here with /sbin/initqueue.
If /sbin/initqueue is called with the "--onetime" option, the script
will be removed after it was run.
If /lib/dracut/hooks/initqueue/work is created and udev >= 143 then
this loop can process the jobs in parallel to the udevtrigger.
If the udev queue is empty and no root device is found or no root
filesystem was mounted, the user will be dropped to a shell after
a timeout.
Scripts can remove themselves from the initqueue by "rm $job".

/lib/dracut/hooks/pre-mount/*.sh
scripts to run before the root filesystem is mounted
Network filesystems like NFS that do not use device files are an
exception. Root can be mounted already at this point.

/lib/dracut/hooks/mount/*.sh
scripts to mount the root filesystem
If the udev queue is empty and no root device is found or no root
filesystem was mounted, the user will be dropped to a shell after
a timeout.

/lib/dracut/hooks/pre-pivot/*.sh
scripts to run before latter initramfs cleanups

/lib/dracut/hooks/cleanup/*.sh
scripts to run before the real init is executed and the initramfs
disappears
All processes started before should be killed here.

View File

@ -1,30 +0,0 @@
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)
iscsi-initiator-utils
TEST-04-FULL-SYSTEMD: systemd >= 187

How to run the testsuite:

$ sudo make clean check

in verbose mode:
$ sudo make V=1 clean check

only specific test:
$ sudo make TESTS="01 20 40" clean check
only runs the 01, 20 and 40 tests.

debug a specific test case:
$ cd TEST-01-BASIC
$ sudo make clean setup run
... change some kernel parameters ...
$ sudo make run
to run the test without doing the setup

49
TODO
View File

@ -1,49 +0,0 @@
Current TODO list, broken into things which are relevant for the
initramfs itself (/init et al) vs the generator.
A lot of things are/should be marked with "FIXME" in the code.

Items are ordered in priority.

INITRAMFS TODO

- allow dual stack configuration (IPv4, IPv6) for the same interface
- "bind-mount" kernel drivers in real root for the rescue image,
if the real root does not have any kernel modules for this kernel
https://bugzilla.redhat.com/show_bug.cgi?id=1046510
- use info and warn prefix
- generate systemd unit dracut-initramfs-restore in /run/systemd dynamically
- put "root=" parsing hooks in separate hook dir
- call "root=" parsing hooks after getting new rootpath from dhcp
- put mount hook in main initqueue loop / careful about resume!
- the hard-coded list of udev rules that we care about is kind of lame.
- panic fallback
- bridging/bonding without "netroot=" https://bugzilla.redhat.com/show_bug.cgi?id=822750
- progress indication for fsck https://bugzilla.redhat.com/show_bug.cgi?id=827118
- domain, searchdomain https://bugzilla.redhat.com/show_bug.cgi?id=840778
- disable write-ifcfg https://bugzilla.redhat.com/show_bug.cgi?id=840784
- check for /var to be mounted in convertfs https://bugzilla.redhat.com/show_bug.cgi?id=848172
- probably fix "--include" https://bugzilla.redhat.com/show_bug.cgi?id=849338

GENERATOR TODO

- report errors on missing files in check()
- remove wait for swap devs, if no "resume=" is given on the kernel command line
- 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
- pkg-config integration, to make it easy for other packages to use us.
- default module specification could use some work
- udev rule copying, as mentioned above, is a bit too hard-coded

- dracut-install parse LD_SHOW_AUXV="" AT_PLATFORM for lib install

CODE TODO

- document more functions
- make function vars local, and prefix with "_"

Future Enhancement Requests

- run ssh server to enter crypto password or perform debugging (supported by debian)
- https://bugzilla.redhat.com/show_bug.cgi?id=524727 - dracut + encrypted root + networking

113
configure vendored
View File

@ -1,13 +1,15 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

# We don't support srcdir != builddir
echo \#buildapi-variable-no-builddir >/dev/null
echo \#buildapi-variable-no-builddir > /dev/null

prefix=/usr

enable_documentation=yes
enable_dracut_cpio=no

CC="${CC:-cc}"
PKG_CONFIG="${PKG_CONFIG:-pkg-config}"

# Little helper function for reading args from the commandline.
# it automatically handles -a b and -a=b variants, and returns 1 if
@ -18,9 +20,9 @@ read_arg() {
# $3 = arg parameter
local rematch='^[^=]*=(.*)$'
if [[ $2 =~ $rematch ]]; then
read "$1" <<< "${BASH_REMATCH[1]}"
read -r "$1" <<< "${BASH_REMATCH[1]}"
else
read "$1" <<< "$3"
read -r "$1" <<< "$3"
# There is no way to shift our callers args, so
# return 1 to indicate they should do it instead.
return 1
@ -30,29 +32,88 @@ read_arg() {

while (($# > 0)); do
case "${1%%=*}" in
--prefix) read_arg prefix "$@" || shift;;
--libdir) read_arg libdir "$@" || shift;;
--datadir) read_arg datadir "$@" || shift;;
--sysconfdir) read_arg sysconfdir "$@" || shift;;
--sbindir) read_arg sbindir "$@" || shift;;
--mandir) read_arg mandir "$@" || shift;;
--disable-documentation) enable_documentation=no;;
--program-prefix) read_arg programprefix "$@" || shift;;
--exec-prefix) read_arg execprefix "$@" || shift;;
--bindir) read_arg bindir "$@" || shift;;
--includedir) read_arg includedir "$@" || shift;;
--libexecdir) read_arg libexecdir "$@" || shift;;
--localstatedir) read_arg localstatedir "$@" || shift;;
--sharedstatedir) read_arg sharedstatedir "$@" || shift;;
--infodir) read_arg infodir "$@" || shift;;
--systemdsystemunitdir) read_arg systemdsystemunitdir "$@" || shift;;
--bashcompletiondir) read_arg bashcompletiondir "$@" || shift;;
*) echo "Ignoring unknown option '$1'";;
--prefix) read_arg prefix "$@" || shift ;;
--libdir) read_arg libdir "$@" || shift ;;
--datadir) read_arg datadir "$@" || shift ;;
--sysconfdir) read_arg sysconfdir "$@" || shift ;;
--sbindir) read_arg sbindir "$@" || shift ;;
--mandir) read_arg mandir "$@" || shift ;;
--disable-documentation) enable_documentation=no ;;
--program-prefix) read_arg programprefix "$@" || shift ;;
--exec-prefix) read_arg execprefix "$@" || shift ;;
--bindir) read_arg bindir "$@" || shift ;;
--includedir) read_arg includedir "$@" || shift ;;
--libexecdir) read_arg libexecdir "$@" || shift ;;
--localstatedir) read_arg localstatedir "$@" || shift ;;
--sharedstatedir) read_arg sharedstatedir "$@" || shift ;;
--infodir) read_arg infodir "$@" || shift ;;
--systemdsystemunitdir) read_arg systemdsystemunitdir "$@" || shift ;;
--bashcompletiondir) read_arg bashcompletiondir "$@" || shift ;;
--enable-dracut-cpio) enable_dracut_cpio=yes ;;
*) echo "Ignoring unknown option '$1'" ;;
esac
shift
done

cat > Makefile.inc.$$ <<EOF
if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 23 "; then
echo "dracut needs pkg-config and libkmod >= 23." >&2
exit 1
fi

cat << EOF > conftest.c
#include <fts.h>
int main() {
return 0;
}
EOF

# shellcheck disable=SC2086
${CC} $CFLAGS $LDFLAGS conftest.c > /dev/null 2>&1
ret=$?
rm -f conftest.c a.out

# musl doesn't have fts.h included
if test $ret -ne 0; then
echo "dracut needs fts development files." >&2
exit 1
fi

cat << EOF > conftest.c
#include <fts.h>
int main(void) {
fts_open(0, 0, 0);
return 0;
}
EOF

found=no
for lib in "-lc" "-lfts"; do
# shellcheck disable=SC2086
${CC} $CFLAGS $LDFLAGS conftest.c -Wl,$lib > /dev/null 2>&1
ret=$?
if test $ret -eq 0; then
FTS_LIBS="$lib"
found=yes
break
fi
done
rm -f conftest.c a.out

if test $found = no; then
echo "dracut couldn't find usable fts library" >&2
exit 1
fi

if test "$enable_dracut_cpio" = "yes"; then
cargo --version > /dev/null
ret=$?
if test $ret -ne 0; then
echo "dracut couldn't find cargo for dracut-cpio build"
exit 1
fi
fi

cat > Makefile.inc.$$ << EOF
prefix ?= ${prefix}
libdir ?= ${libdir:-${prefix}/lib}
datadir ?= ${datadir:-${prefix}/share}
@ -60,7 +121,11 @@ sysconfdir ?= ${sysconfdir:-${prefix}/etc}
sbindir ?= ${sbindir:-${prefix}/sbin}
mandir ?= ${mandir:-${prefix}/share/man}
enable_documentation ?= ${enable_documentation:-yes}
enable_dracut_cpio ?= ${enable_dracut_cpio}
bindir ?= ${bindir:-${prefix}/bin}
KMOD_CFLAGS ?= $(${PKG_CONFIG} --cflags " libkmod >= 23 ")
KMOD_LIBS ?= $(${PKG_CONFIG} --libs " libkmod >= 23 ")
FTS_LIBS ?= ${FTS_LIBS}
EOF

{

213
docs/BASH.md Normal file
View File

@ -0,0 +1,213 @@
# BASH Notes

## basename
Don't use `basename`, use:
```shell
file=${path##*/}
```

## dirname
Don't use `dirname`, use:
```shell
dir=${path%/*}
```

## shopt
If you set `shopt` in a function, reset to its default state with `trap`:
```shell
func() {
trap "$(shopt -p nullglob globstar)" RETURN
shopt -q -s nullglob globstar
}
```

## find, grep, print0, -0, -z

Don't use `find` in `for` loops, because filenames can contain spaces.
Try to use `globstar` and `nullglob` or null byte terminated strings.

Instead of:
```shell
func() {
for file in $(find /usr/lib* -type f -name 'lib*.a' -print0 ); do
echo $file
done
}
```

use:
```shell
func() {
trap "$(shopt -p nullglob globstar)" RETURN
shopt -q -s nullglob globstar

for file in /usr/lib*/**/lib*.a; do
[[ -f $file ]] || continue
echo "$file"
done
}
```

Or collect the filenames in an array, if you need them more than once:
```shell
func() {
trap "$(shopt -p nullglob globstar)" RETURN
shopt -q -s nullglob globstar

filenames=( /usr/lib*/**/lib*.a )

for file in "${filenames[@]}"; do
[[ -f $file ]] || continue
echo "$file"
done
}
```

Or, if you really want to use `find`, use `-print0` and an array:
```shell
func() {
mapfile -t -d '' filenames < <(find /usr/lib* -type f -name 'lib*.a' -print0)
for file in "${filenames[@]}"; do
echo "$file"
done
}
```

Note: `-d ''` is the same as `-d $'\0'` and sets the null byte as the delimiter.

or:
```shell
func() {
find /usr/lib* -type f -name 'lib*.a' -print0 | while read -r -d '' file; do
echo "$file"
done
}
```

or
```shell
func() {
while read -r -d '' file; do
echo "$file"
done < <(find /usr/lib* -type f -name 'lib*.a' -print0)
}
```

Use the tool options for null terminated strings, like `-print0`, `-0`, `-z`, etc.

## prefix or suffix array elements

Instead of:
```shell
func() {
other-cmd $(for k in "$@"; do echo "prefix-$k"; done)
}
```
do
```shell
func() {
other-cmd "${@/#/prefix-}"
}
```

or suffix:
```shell
func() {
other-cmd "${@/%/-suffix}"
}
```

## Join array elements with a separator char

Here we have an associate array `_drivers`, where we want to print the keys separated by ',':
```shell
if [[ ${!_drivers[*]} ]]; then
echo "rd.driver.pre=$(IFS=, ;echo "${!_drivers[*]}")" > "${initdir}"/etc/cmdline.d/00-watchdog.conf
fi
```

## Optional parameters to commands

If you want to call a command `cmd` with an option, if a variable is set, rather than doing:

```shell
func() {
local param="$1"

if [[ $param ]]; then
param="--this-special-option $param"
fi

cmd $param
}
```

do it like this:

```shell
func() {
local param="$1"

cmd ${param:+--this-special-option "$param"}
}

# cmd --this-special-option 'abc'
func 'abc'

# cmd
func ''

# cmd
func
```

If you want to specify the option even with an empty string do this:

```shell
func() {
local -a special_params

if [[ ${1+_} ]]; then
# only declare `param` if $1 is set (even as null string)
local param="$1"
fi

# check if `param` is set (even as null string)
if [[ ${param+_} ]]; then
special_params=( --this-special-option "${param}" )
fi

cmd ${param+"${special_params[@]}"}
}

# cmd --this-special-option 'abc'
func 'abc'

# cmd --this-special-option ''
func ''

# cmd
func
```

Or more simple, if you only have to set an option:
```shell
func() {
if [[ ${1+_} ]]; then
# only declare `param` if $1 is set (even as null string)
local param="$1"
fi

cmd ${param+--this-special-option}
}

# cmd --this-special-option
func 'abc'

# cmd --this-special-option
func ''

# cmd
func
```

56
docs/CODE_OF_CONDUCT.md Normal file
View File

@ -0,0 +1,56 @@
# Dracut Code of Conduct

This code of conduct outlines our expectations for participants within the Dracut community, as well as steps for reporting unacceptable behavior.
We are committed to providing a welcoming and inspiring community for all and expect our code of conduct to be honored.
Anyone who violates this code of conduct may be banned from the community.

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainer responsible for enforcement Harald Hoyer <harald@profian.com>.
All complaints will be reviewed and investigated promptly and fairly and will result in a response that is deemed necessary and appropriate to the circumstances.
Project maintainers are obligated to respect the privacy and security of the reporter of any incident.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq.
Translations are available at https://www.contributor-covenant.org/translations.

278
docs/HACKING.md Normal file
View File

@ -0,0 +1,278 @@
# Dracut Developer Guidelines

## git

Currently dracut lives on github.com and kernel.org.

* https://github.com/dracutdevs/dracut.git
* https://git.kernel.org/pub/scm/boot/dracut/dracut.git

Pull requests should be filed preferably on github nowadays.

### Code Format

It is recommended, that you install a plugin for your editor, which reads in `.editorconfig`.
Additionally `emacs` and `vim` config files are provided for convenience.

To reformat C files use `astyle`:
```console
$ astyle --options=.astylerc <FILE>
```

For convenience there is also a Makefile `indent-c` target `make indent-c`.

To reformat shell files use `shfmt`:

```console
$ shfmt_version=3.2.4
$ wget "https://github.com/mvdan/sh/releases/download/v${shfmt_version}/shfmt_v${shfmt_version}_linux_amd64" -O shfmt
$ chmod u+x shfmt
$ ./shfmt -w -s .
```

or

```console
$ GO111MODULE=on go get mvdan.cc/sh/v3/cmd/shfmt
$ $GOPATH/bin/shfmt -w -s .
```

or if `shfmt` is already in your `PATH`, use `make indent`.

Some IDEs already have support for shfmt.

For convenience the `make indent` Makefile target also calls shfmt, if it is in `$PATH`.

### Commit Messages

Commit messages should answer these questions:

* What?: a short summary of what you changed in the subject line.
* Why?: what the intended outcome of the change is (arguably the most important piece of information that should go into a message).
* How?: if multiple approaches for achieving your goal were available, you also want to explain why you chose the used implementation strategy.
Note that you should not explain how your change achieves your goal in your commit message.
That should be obvious from the code itself.
If you cannot achieve that clarity with the used programming language, use comments within the code instead.

The commit message is primarily the place for documenting the why.

Commit message titles should follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).

Format is `<type>[optional scope]: <description>`, where `type` is one of:

* fix: A bug fix
* feat: A new feature
* perf: A code change that improves performance
* refactor: A code change that neither fixes a bug nor adds a feature
* style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
* test: Adding missing tests or correcting existing tests
* docs: Documentation only changes
* revert: Reverts a previous commit
* chore: Other changes that don't modify src or test files
* build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
* ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)

`scope` should be the module name (without numbers) or:

* cli: for the dracut command line interface
* rt: for the dracut initramfs runtime logic
* functions: for general purpose dracut functions

Commit messages are checked with [Commisery](https://github.com/tomtom-international/commisery).

## Writing modules

Some general rules for writing modules:

* Use one of the inst family of functions to actually install files
on to the initramfs. They handle mangling the pathnames and (for binaries,
scripts, and kernel modules) installing dependencies as appropriate so
you do not have to.
* Scripts that end up on the initramfs should be POSIX compliant. dracut
will try to use /bin/dash as /bin/sh for the initramfs if it is available,
so you should install it on your system -- dash aims for strict POSIX
compliance to the extent possible.
* Hooks MUST be POSIX compliant -- they are sourced by the init script,
and having a bashism break your user's ability to boot really sucks.
* Generator modules should have a two digit numeric prefix -- they run in
ascending sort order. Anything in the 90-99 range is stuff that dracut
relies on, so try not to break those hooks.
* Hooks must have a .sh extension.
* Generator modules are described in more detail later on.
* We have some breakpoints for debugging your hooks. If you pass 'rdbreak'
as a kernel parameter, the initramfs will drop to a shell just before
switching to a new root. You can pass 'rdbreak=hookpoint', and the initramfs
will break just before hooks in that hookpoint run.

Also, there is an attempt to keep things as distribution-agnostic as
possible. Every distribution has their own tool here and it's not
something which is really interesting to have separate across them.
So contributions to help decrease the distro-dependencies are welcome.

Most of the functionality that dracut implements are actually implemented
by dracut modules. dracut modules live in modules.d, and have the following
structure:

```
dracut_install_dir/modules.d/
00modname/
module-setup.sh
check
<other files as needed by the hook>
```

`00modname`: The name of the module prefixed by a two-digit numeric sort code.
The numeric code must be present and in the range of 00 - 99.
Modules with lower numbers are installed first. This is important
because the dracut install functions (which install files onto
the initrd) refuse to overwrite already installed files. This makes
it easy for an earlier module to override the functionality of a
later module, so that you can have a distro or system specific
module override or modify the functionality of a generic module
without having to patch the more generic module.

`module-setup.sh`:
dracut sources this script to install the functionality that a
module implements onto the initrd. For the most part, this amounts
to copying files from the host system onto the initrd in a controlled
manner.

`install()`:
This function of module-setup.sh is called to install all
non-kernel files. dracut supplies several install functions that are
specialized for different file types. Browse through dracut-functions
fore more details. dracut also provides a $moddir variable if you
need to install a file from the module directory, such as an initrd
hook, a udev rule, or a specialized executable.

`installkernel()`:
This function of module-setup.sh is called to install all
kernel related files.


`check()`:
dracut calls this function to check and see if a module can be installed
on the initrd.

When called without options, check should check to make sure that
any files it needs to install into the initrd from the host system
are present. It should exit with a 0 if they are, and a 1 if they are
not.

When called with $hostonly set, it should perform the same check
that it would without it set, and it should also check to see if the
functionality the module implements is being used on the host system.
For example, if this module handles installing support for LUKS
encrypted volumes, it should return 0 if all the tools to handle
encrpted volumes are available and the host system has the root
partition on an encrypted volume, 1 otherwise.

`depends()`:
This function should output a list of dracut modules
that it relies upon. An example would be the nfs and iscsi modules,
which rely on the network module to detect and configure network
interfaces.

Any other files in the module will not be touched by dracut directly.

You are encouraged to provide a README that describes what the module is for.


### Hooks

init has the following hook points to inject scripts:

`/lib/dracut/hooks/cmdline/*.sh`
scripts for command line parsing

`/lib/dracut/hooks/pre-udev/*.sh`
scripts to run before udev is started

`/lib/dracut/hooks/pre-trigger/*.sh`
scripts to run before the main udev trigger is pulled

`/lib/dracut/hooks/initqueue/*.sh`
runs in parallel to the udev trigger
Udev events can add scripts here with /sbin/initqueue.
If /sbin/initqueue is called with the "--onetime" option, the script
will be removed after it was run.
If /lib/dracut/hooks/initqueue/work is created and udev >= 143 then
this loop can process the jobs in parallel to the udevtrigger.
If the udev queue is empty and no root device is found or no root
filesystem was mounted, the user will be dropped to a shell after
a timeout.
Scripts can remove themselves from the initqueue by "rm $job".

`/lib/dracut/hooks/pre-mount/*.sh`
scripts to run before the root filesystem is mounted
Network filesystems like NFS that do not use device files are an
exception. Root can be mounted already at this point.

`/lib/dracut/hooks/mount/*.sh`
scripts to mount the root filesystem
If the udev queue is empty and no root device is found or no root
filesystem was mounted, the user will be dropped to a shell after
a timeout.

`/lib/dracut/hooks/pre-pivot/*.sh`
scripts to run before latter initramfs cleanups

`/lib/dracut/hooks/cleanup/*.sh`
scripts to run before the real init is executed and the initramfs
disappears
All processes started before should be killed here.


## Testsuite

### Rootless in a container with podman

```console
$ cd <DRACUT_SOURCE>
$ podman pull [CONTAINER]
$ podman run --rm -it \
--cap-add=SYS_PTRACE --user 0 \
-v /dev:/dev -v ./:/dracut:z \
[CONTAINER] \
bash -l
# cd /dracut
# ./configure
# make -j $(getconf _NPROCESSORS_ONLN)
# cd test
# make V=1 SKIP="16 60 61" clean check
```

with `[CONTAINER]` being one of the
[github `dracutdevs` containers](https://github.com/orgs/dracutdevs/packages),
e.g. `ghcr.io/dracutdevs/fedora:latest`.

### On bare metal

For the testsuite to pass, you will have to install at least the software packages
mentioned in the `test/container` Dockerfiles.

```
$ sudo make clean check
```

in verbose mode:
```
$ sudo make V=1 clean check
```

only specific test:
```
$ sudo make TESTS="01 20 40" clean check
```
only runs the 01, 20 and 40 tests.

debug a specific test case:
```
$ cd TEST-01-BASIC
$ sudo make clean setup run
```
... change some kernel parameters in `test.sh` ...
```
$ sudo make run
```
to run the test without doing the setup.

48
docs/README.cross Normal file
View File

@ -0,0 +1,48 @@
Dracut supports running against a sysroot directory that is different
from the actual root (/) directory of the running system. It is most
useful for creating/bootstrapping a new system that may or may not be
using the same CPU architecture as the host system, i.e. building a
whole Linux system with a cross-compiler framework like Yocto.

The user-visible frontend change is the introduction of a new option
called "-r" or "--sysroot". It expects a directory that contains the
complete Linux system that has all the files (kernel drivers, firmware,
executables, libraries and others) necessary to construct the initramfs.

E.g: dracut --sysroot /path/to/sysroot initramfs.img kernelversion

To support this, a new global variable was introduced inside dracut.
This variable is called "dracutsysrootdir" and all the files installed
into the initramfs image is searched relative to the sysroot directory.
This variable can also be set externally to dracut without using option
-r/--sysroot.

There are other details that are necessary to tweak to be able to
run on cross-compiled (a.k.a. foreign) binaries.

dracut uses these crucial utilities during its operation:

ldd
===
It lists dynamic library dependencies for executables or libraries

ldconfig
========
It creates /etc/ld.so.cache, i.e. the cached information about libraries
known to the system.

These utilities the way they exist on the host system only work on
the host system.

To support cross-compiled binaries, a different ldd variant is needed that
works on those binaries. One such ldd script is found at
https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f

ldconfig in GLIBC as is does support a sysroot with its -r option.

Extra environment variables needed to run dracut on the sysroot are
documented in the dracut(8) man page.

For the Plymouth boot splash to be added to the initramfs image,
this gitlab PR is needed for Plymouth:
https://gitlab.freedesktop.org/plymouth/plymouth/merge_requests/72

70
docs/RELEASE.md Normal file
View File

@ -0,0 +1,70 @@
# Conducting A Successful Release

This documents contains the necessary steps to conduct a successful release.

1. Add all items to `NEWS.md`

Get a first template with [`clog`](https://github.com/clog-tool/clog-cli)
```console
$ clog -F -r https://github.com/dracutdevs/dracut
```

2. Update the contributors list in NEWS.md

Produce the list with:
```console
$ make CONTRIBUTORS
```

Append the list to the section in `NEWS.md`

3. Update AUTHORS

```console
$ make AUTHORS
```

4. Check in AUTHORS and NEWS.md

```console
$ git ci -m "docs: update NEWS.md and AUTHORS" NEWS.md AUTHORS
```

5. Tag the release and push

```console
$ VERSION=052
$ git tag -s "$VERSION"
$ git push --tags
```

Add the section from `NEWS.md` to the git tag message.

6. Push git to kernel.org

With:
```console
$ git remote add kernelorg ssh://gitolite@ra.kernel.org/pub/scm/boot/dracut/dracut.git
```

Push to kernel.org git:
```console
$ git push --atomic kernelorg master "$VERSION"
```


7. Sign and upload tarballs to kernel.org

```console
$ make upload
```

This requires `kup` and a kernel.org account.
Wait until the tarballs are synced to http://www.kernel.org/pub/linux/utils/boot/dracut/ .

8. Create a new release on github (https://github.com/dracutdevs/dracut/releases/new)
- Add the section from `NEWS.md` to the release.
- Attach the tarballs and signature file from http://www.kernel.org/pub/linux/utils/boot/dracut/ to the github release.

9. Close the github milestone and open a new one (https://github.com/dracutdevs/dracut/milestones)
10. Ensure that announcement was sent and reached the linux-initramfs mailinglist (https://www.spinics.net/lists/linux-initramfs/)

3
docs/SECURITY.md Normal file
View File

@ -0,0 +1,3 @@
Security is very important to us. If you discover any issue regarding security, we'd appreciate a non-public disclosure of
the information, so please disclose the information responsibly by sending an email to Harald Hoyer <harald@profian.com> and not by creating a GitHub issue.
We will respond swiftly to fix verifiable security issues with the disclosure being coordinated with distributions and relevant security teams.

BIN
docs/dracut.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 68 KiB

View File

@ -1,79 +0,0 @@
#
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
# Copyright 2013 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

__contains_word () {
local word=$1; shift
for w in $*; do [[ $w = $word ]] && return 0; done
return 1
}

_dracut() {
local field_vals= cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local -A OPTS=(
[STANDALONE]='-f -v -q -l -H -h -M -N
--ro-mnt --force --kernel-only --no-kernel --strip --nostrip
--hardlink --nohardlink --noprefix --mdadmconf --nomdadmconf
--lvmconf --nolvmconf --debug --profile --verbose --quiet
--local --hostonly --no-hostonly --fstab --help --bzip2 --lzma
--xz --no-compress --gzip --list-modules --show-modules --keep
--printsize --regenerate-all --noimageifnotneeded --early-microcode
--no-early-microcode --print-cmdline --prelink --noprelink'

[ARG]='-a -m -o -d -I -k -c -L --kver --add --force-add --add-drivers
--omit-drivers --modules --omit --drivers --filesystems --install
--fwdir --libdirs --fscks --add-fstab --mount --device --nofscks
--kmoddir --conf --confdir --tmpdir --stdlog --compress --prefix
--kernel-cmdline --sshkey --persistent-policy'
)

if __contains_word "$prev" ${OPTS[ARG]}; then
case $prev in
--kmoddir|-k|--fwdir|--confdir|--tmpdir)
comps=$(compgen -d -- "$cur")
compopt -o filenames
;;
-c|--conf|--sshkey|--add-fstab|--add-device|-I|--install)
comps=$(compgen -f -- "$cur")
compopt -o filenames
;;
-a|-m|-o|--add|--modules|--omit)
comps=$(dracut --list-modules 2>/dev/null)
;;
--persistent-policy)
comps=$(cd /dev/disk/; echo *)
;;
--kver)
comps=$(cd /lib/modules; echo [0-9]*)
;;
*)
return 0
;;
esac
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
return 0
fi

if [[ $cur = -* ]]; then
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
return 0
fi
}

complete -F _dracut dracut

View File

@ -1,6 +1,4 @@
#!/bin/bash --norc
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
# Copyright 2009 Red Hat, Inc. All rights reserved.
#
@ -18,9 +16,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#


dwarning() {
echo "Warning: $@" >&2
echo "Warning: $*" >&2
}

dinfo() {
@ -28,11 +25,11 @@ dinfo() {
}

derror() {
echo "Error: $@" >&2
echo "Error: $*" >&2
}

usage() {
# 80x25 linebreak here ^
# 80x25 linebreak here ^
cat << EOF
Usage: $0 [OPTION]... <initramfs> <base image> [<image>...]
Creates initial ramdisk image by concatenating several images from the command
@ -51,27 +48,46 @@ line and /boot/dracut/
EOF
}


imagedir=/boot/dracut/
overlay=/var/lib/dracut/overlay

while (($# > 0)); do
case $1 in
-f|--force) force=yes;;
-i|--imagedir) imagedir=$2;shift;;
-o|--overlaydir) overlay=$2;shift;;
--nooverlay) no_overlay=yes;shift;;
--noimagedir) no_imagedir=yes;shift;;
-h|--help) usage; exit 1 ;;
--debug) debug="yes";;
-v|--verbose) beverbose="yes";;
-*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
-f | --force) force=yes ;;
-i | --imagedir)
imagedir=$2
shift
;;
-o | --overlaydir)
overlay=$2
shift
;;
--nooverlay)
no_overlay=yes
shift
;;
--noimagedir)
no_imagedir=yes
shift
;;
-h | --help)
usage
exit 1
;;
--debug) export debug="yes" ;;
-v | --verbose) beverbose="yes" ;;
-*)
printf "\nUnknown option: %s\n\n" "$1" >&2
usage
exit 1
;;
*) break ;;
esac
shift
done

outfile=$1; shift
outfile=$1
shift

if [[ -z $outfile ]]; then
derror "No output file specified."
@ -79,7 +95,8 @@ if [[ -z $outfile ]]; then
exit 1
fi

baseimage=$1; shift
baseimage=$1
shift

if [[ -z $baseimage ]]; then
derror "No base image specified."
@ -105,8 +122,11 @@ fi
if [[ ! $no_overlay ]]; then
ofile="$imagedir/90-overlay.img"
dinfo "Creating image $ofile from directory $overlay"
type pigz &>/dev/null && gzip=pigz || gzip=gzip
( cd "$overlay"; find . |cpio --quiet -H newc -o |$gzip -9 > "$ofile"; )
type pigz &> /dev/null && gzip=pigz || gzip=gzip
(
cd "$overlay" || return 1
find . | cpio --quiet -H newc -o | $gzip -9 > "$ofile"
)
fi

if [[ ! $no_imagedir ]]; then
@ -115,7 +135,7 @@ if [[ ! $no_imagedir ]]; then
done
fi

images+=($@)
images+=("$@")

dinfo "Using base image $baseimage"
cat -- "$baseimage" > "$outfile"

File diff suppressed because it is too large Load Diff

1110
dracut-init.sh Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,30 +1,63 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

set -e

# do some sanity checks first
[ -e /run/initramfs/bin/sh ] && exit 0
[ -e /run/initramfs/.need_shutdown ] || exit 0

# SIGTERM signal is received upon forced shutdown: ignore the signal
# We want to remain alive to be able to trap unpacking errors to avoid
# switching root to an incompletely unpacked initramfs
trap 'echo "Received SIGTERM signal, ignoring!" >&2' TERM

KERNEL_VERSION="$(uname -r)"

[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
SKIP="$dracutbasedir/skipcpio"
[[ -x $SKIP ]] || SKIP=cat
[[ -x $SKIP ]] || SKIP="cat"

[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id

if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
if [[ -d /efi/Default ]] || [[ -d /boot/Default ]] || [[ -d /boot/efi/Default ]]; then
MACHINE_ID="Default"
elif [[ -f /etc/machine-id ]]; then
read -r MACHINE_ID < /etc/machine-id
else
MACHINE_ID="Default"
fi

mount -o ro /boot &> /dev/null || true

if [[ -d /efi/loader/entries ]] || [[ -L /efi/loader/entries ]] \
|| [[ -d /efi/$MACHINE_ID ]] || [[ -L /efi/$MACHINE_ID ]]; then
IMG="/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
elif [[ -d /boot/loader/entries ]] || [[ -L /boot/loader/entries ]] \
|| [[ -d /boot/$MACHINE_ID ]] || [[ -L /boot/$MACHINE_ID ]]; then
IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
elif [[ -d /boot/efi/loader/entries ]] || [[ -L /boot/efi/loader/entries ]] \
|| [[ -d /boot/efi/$MACHINE_ID ]] || [[ -L /boot/efi/$MACHINE_ID ]]; then
IMG="/boot/efi/$MACHINE_ID/$KERNEL_VERSION/initrd"
elif [[ -f /lib/modules/${KERNEL_VERSION}/initrd ]]; then
IMG="/lib/modules/${KERNEL_VERSION}/initrd"
elif [[ -f /boot/initramfs-${KERNEL_VERSION}.img ]]; then
IMG="/boot/initramfs-${KERNEL_VERSION}.img"
elif mountpoint -q /efi; then
IMG="/efi/$MACHINE_ID/$KERNEL_VERSION/initrd"
elif mountpoint -q /boot/efi; then
IMG="/boot/efi/$MACHINE_ID/$KERNEL_VERSION/initrd"
else
echo "No initramfs image found to restore!"
exit 1
fi
[[ -f $IMG ]] || IMG="/boot/initramfs-${KERNEL_VERSION}.img"

cd /run/initramfs

[ -f .need_shutdown -a -f "$IMG" ] || exit 1
if $SKIP "$IMG" | zcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
rm -f -- .need_shutdown
elif $SKIP "$IMG" | xzcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
rm -f -- .need_shutdown
elif $SKIP "$IMG" | lz4 -d -c | cpio -id --no-absolute-filenames --quiet >/dev/null; then
if $SKIP "$IMG" | cpio -id --no-absolute-filenames --quiet > /dev/null \
|| $SKIP "$IMG" | zcat | cpio -id --no-absolute-filenames --quiet > /dev/null \
|| $SKIP "$IMG" | bzcat | cpio -id --no-absolute-filenames --quiet > /dev/null \
|| $SKIP "$IMG" | xzcat | cpio -id --no-absolute-filenames --quiet > /dev/null \
|| $SKIP "$IMG" | lz4 -d -c | cpio -id --no-absolute-filenames --quiet > /dev/null \
|| $SKIP "$IMG" | lzop -d -c | cpio -id --no-absolute-filenames --quiet > /dev/null \
|| $SKIP "$IMG" | zstd -d -c | cpio -id --no-absolute-filenames --quiet > /dev/null; then
rm -f -- .need_shutdown
else
# something failed, so we clean up
@ -33,4 +66,17 @@ else
exit 1
fi

if [[ -d squash ]]; then
if ! unsquashfs -no-xattrs -f -d . squash-root.img > /dev/null; then
echo "Squash module is enabled for this initramfs but failed to unpack squash-root.img" >&2
rm -f -- /run/initramfs/shutdown
exit 1
fi
fi

if [ -e /etc/selinux/config -a -x /usr/sbin/setfiles ]; then
. /etc/selinux/config
/usr/sbin/setfiles -v -r /run/initramfs /etc/selinux/"${SELINUXTYPE}"/contexts/files/file_contexts /run/initramfs > /dev/null
fi

exit 0

View File

@ -1,6 +1,4 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 et filetype=sh
#
# logging faciality module for dracut both at build- and boot-time
#
@ -19,9 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.


__DRACUT_LOGGER__=1

export __DRACUT_LOGGER__=1

## @brief Logging facility module for dracut both at build- and boot-time.
#
@ -88,7 +84,6 @@ __DRACUT_LOGGER__=1
#
# @see dlog_init()


## @brief Initializes dracut Logger.
#
# @retval 1 if something has gone wrong
@ -107,7 +102,8 @@ __DRACUT_LOGGER__=1
# See file doc comment for details.
dlog_init() {
local __oldumask
local ret=0; local errmsg
local ret=0
local errmsg
[ -z "$stdloglvl" ] && stdloglvl=4
[ -z "$sysloglvl" ] && sysloglvl=0
[ -z "$kmsgloglvl" ] && kmsgloglvl=0
@ -116,23 +112,23 @@ dlog_init() {

if [ -z "$fileloglvl" ]; then
[ -w "$logfile" ] && fileloglvl=4 || fileloglvl=0
elif (( $fileloglvl > 0 )); then
elif ((fileloglvl > 0)); then
if [[ $logfile ]]; then
__oldumask=$(umask)
umask 0377
! [ -e "$logfile" ] && >"$logfile"
umask $__oldumask
if [ -w "$logfile" -a -f "$logfile" ]; then
# Mark new run in the log file
echo >>"$logfile"
if command -v date >/dev/null; then
echo "=== $(date) ===" >>"$logfile"
! [ -e "$logfile" ] && : > "$logfile"
umask "$__oldumask"
if [[ -w $logfile ]] && [[ -f $logfile ]]; then
# Mark new run in the log file
echo >> "$logfile"
if command -v date > /dev/null; then
echo "=== $(date) ===" >> "$logfile"
else
echo "===============================================" >>"$logfile"
echo "===============================================" >> "$logfile"
fi
echo >>"$logfile"
echo >> "$logfile"
else
# We cannot log to file, so turn this facility off.
# We cannot log to file, so turn this facility off.
fileloglvl=0
ret=1
errmsg="'$logfile' is not a writable file"
@ -140,23 +136,22 @@ dlog_init() {
fi
fi

if (( $UID != 0 )); then
if ((UID != 0)); then
kmsgloglvl=0
sysloglvl=0
fi

if (( $sysloglvl > 0 )); then
if ((sysloglvl > 0)); then
if [[ -d /run/systemd/journal ]] \
&& type -P systemd-cat &>/dev/null \
&& systemctl --quiet is-active systemd-journald.socket &>/dev/null \
&& { echo "dracut-$DRACUT_VERSION" | systemd-cat -t 'dracut' &>/dev/null; } ; then
readonly _dlogdir="$(mktemp --tmpdir="$TMPDIR/" -d -t dracut-log.XXXXXX)"
readonly _systemdcatfile="$_dlogdir/systemd-cat"
&& type -P systemd-cat &> /dev/null \
&& systemctl --quiet is-active systemd-journald.socket &> /dev/null \
&& { echo "dracut-$DRACUT_VERSION" | systemd-cat -t 'dracut' &> /dev/null; }; then
readonly _systemdcatfile="$DRACUT_TMPDIR/systemd-cat"
mkfifo "$_systemdcatfile"
readonly _dlogfd=15
systemd-cat -t 'dracut' --level-prefix=true <"$_systemdcatfile" &
exec 15>"$_systemdcatfile"
elif ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null; then
systemd-cat -t 'dracut' --level-prefix=true < "$_systemdcatfile" &
exec 15> "$_systemdcatfile"
elif ! [[ -S /dev/log ]] && [[ -w /dev/log ]] || ! command -v logger > /dev/null; then
# We cannot log to syslog, so turn this facility off.
kmsgloglvl=$sysloglvl
sysloglvl=0
@ -165,7 +160,7 @@ dlog_init() {
fi
fi

if (($sysloglvl > 0)) || (($kmsgloglvl > 0 )); then
if ((sysloglvl > 0)) || ((kmsgloglvl > 0)); then
if [ -n "$dracutbasedir" ]; then
readonly syslogfacility=user
else
@ -174,44 +169,44 @@ dlog_init() {
export syslogfacility
fi

local lvl; local maxloglvl_l=0
local lvl
local maxloglvl_l=0
for lvl in $stdloglvl $sysloglvl $fileloglvl $kmsgloglvl; do
(( $lvl > $maxloglvl_l )) && maxloglvl_l=$lvl
((lvl > maxloglvl_l)) && maxloglvl_l=$lvl
done
readonly maxloglvl=$maxloglvl_l
export maxloglvl


if (($stdloglvl < 6)) && (($kmsgloglvl < 6)) && (($fileloglvl < 6)) && (($sysloglvl < 6)); then
if ((stdloglvl < 6)) && ((kmsgloglvl < 6)) && ((fileloglvl < 6)) && ((sysloglvl < 6)); then
unset dtrace
dtrace() { :; };
dtrace() { :; }
fi

if (($stdloglvl < 5)) && (($kmsgloglvl < 5)) && (($fileloglvl < 5)) && (($sysloglvl < 5)); then
if ((stdloglvl < 5)) && ((kmsgloglvl < 5)) && ((fileloglvl < 5)) && ((sysloglvl < 5)); then
unset ddebug
ddebug() { :; };
ddebug() { :; }
fi

if (($stdloglvl < 4)) && (($kmsgloglvl < 4)) && (($fileloglvl < 4)) && (($sysloglvl < 4)); then
if ((stdloglvl < 4)) && ((kmsgloglvl < 4)) && ((fileloglvl < 4)) && ((sysloglvl < 4)); then
unset dinfo
dinfo() { :; };
dinfo() { :; }
fi

if (($stdloglvl < 3)) && (($kmsgloglvl < 3)) && (($fileloglvl < 3)) && (($sysloglvl < 3)); then
if ((stdloglvl < 3)) && ((kmsgloglvl < 3)) && ((fileloglvl < 3)) && ((sysloglvl < 3)); then
unset dwarn
dwarn() { :; };
dwarn() { :; }
unset dwarning
dwarning() { :; };
dwarning() { :; }
fi

if (($stdloglvl < 2)) && (($kmsgloglvl < 2)) && (($fileloglvl < 2)) && (($sysloglvl < 2)); then
if ((stdloglvl < 2)) && ((kmsgloglvl < 2)) && ((fileloglvl < 2)) && ((sysloglvl < 2)); then
unset derror
derror() { :; };
derror() { :; }
fi

if (($stdloglvl < 1)) && (($kmsgloglvl < 1)) && (($fileloglvl < 1)) && (($sysloglvl < 1)); then
if ((stdloglvl < 1)) && ((kmsgloglvl < 1)) && ((fileloglvl < 1)) && ((sysloglvl < 1)); then
unset dfatal
dfatal() { :; };
dfatal() { :; }
fi

[ -n "$errmsg" ] && derror "$errmsg"
@ -227,13 +222,13 @@ dlog_init() {
# @result Echoes first letter of level name.
_lvl2char() {
case "$1" in
1) echo F;;
2) echo E;;
3) echo W;;
4) echo I;;
5) echo D;;
6) echo T;;
*) return 1;;
1) echo F ;;
2) echo E ;;
3) echo W ;;
4) echo I ;;
5) echo D ;;
6) echo T ;;
*) return 1 ;;
esac
}

@ -244,15 +239,15 @@ _lvl2char() {
# @retval 0 if @a lvl is correct.
# @result Echoes logger priority.
_lvl2syspri() {
printf $syslogfacility.
printf -- "%s" "$syslogfacility."
case "$1" in
1) echo crit;;
2) echo error;;
3) echo warning;;
4) echo info;;
5) echo debug;;
6) echo debug;;
*) return 1;;
1) echo crit ;;
2) echo error ;;
3) echo warning ;;
4) echo info ;;
5) echo debug ;;
6) echo debug ;;
*) return 1 ;;
esac
}

@ -266,9 +261,9 @@ _lvl2syspri() {
# Conversion is done as follows:
#
# <tt>
# FATAL(1) -> LOG_EMERG (0)
# none -> LOG_EMERG (0)
# none -> LOG_ALERT (1)
# none -> LOG_CRIT (2)
# FATAL(1) -> LOG_CRIT (2)
# ERROR(2) -> LOG_ERR (3)
# WARN(3) -> LOG_WARNING (4)
# none -> LOG_NOTICE (5)
@ -282,16 +277,16 @@ _dlvl2syslvl() {
local lvl

case "$1" in
1) lvl=0;;
2) lvl=3;;
3) lvl=4;;
4) lvl=6;;
5) lvl=7;;
6) lvl=7;;
*) return 1;;
1) lvl=2 ;;
2) lvl=3 ;;
3) lvl=4 ;;
4) lvl=6 ;;
5) lvl=7 ;;
6) lvl=7 ;;
*) return 1 ;;
esac

[ "$syslogfacility" = user ] && echo $((8+$lvl)) || echo $((24+$lvl))
[ "$syslogfacility" = user ] && echo $((8 + lvl)) || echo $((24 + lvl))
}

## @brief Prints to stderr and/or writes to file, to syslog and/or /dev/kmsg
@ -321,27 +316,29 @@ _dlvl2syslvl() {
# - @c INFO to @c info
# - @c DEBUG and @c TRACE both to @c debug
_do_dlog() {
local lvl="$1"; shift
local lvlc=$(_lvl2char "$lvl") || return 0
local lvlc
local lvl="$1"
shift
lvlc=$(_lvl2char "$lvl") || return 0
local msg="$*"
local lmsg="$lvlc: $*"

(( $lvl <= $stdloglvl )) && echo "$msg" >&2
((lvl <= stdloglvl)) && printf -- 'dracut: %s\n' "$msg" >&2

if (( $lvl <= $sysloglvl )); then
if ((lvl <= sysloglvl)); then
if [[ "$_dlogfd" ]]; then
printf -- "<%s>%s\n" "$(($(_dlvl2syslvl $lvl) & 7))" "$msg" >&$_dlogfd
printf -- "<%s>%s\n" "$(($(_dlvl2syslvl "$lvl") & 7))" "$msg" >&$_dlogfd
else
logger -t "dracut[$$]" -p $(_lvl2syspri $lvl) -- "$msg"
logger -t "dracut[$$]" -p "$(_lvl2syspri "$lvl")" -- "$msg"
fi
fi

if (( $lvl <= $fileloglvl )) && [[ -w "$logfile" ]] && [[ -f "$logfile" ]]; then
echo "$lmsg" >>"$logfile"
if ((lvl <= fileloglvl)) && [[ -w $logfile ]] && [[ -f $logfile ]]; then
echo "$lmsg" >> "$logfile"
fi

(( $lvl <= $kmsgloglvl )) && \
echo "<$(_dlvl2syslvl $lvl)>dracut[$$] $msg" >/dev/kmsg
((lvl <= kmsgloglvl)) \
&& echo "<$(_dlvl2syslvl "$lvl")>dracut[$$] $msg" > /dev/kmsg
}

## @brief Internal helper function for _do_dlog()
@ -362,12 +359,12 @@ _do_dlog() {
# echo "This is a warning" | dwarn
dlog() {
[ -z "$maxloglvl" ] && return 0
(( $1 <= $maxloglvl )) || return 0
(($1 <= maxloglvl)) || return 0

if (( $# > 1 )); then
if (($# > 1)); then
_do_dlog "$@"
else
while read line; do
while read -r line || [ -n "$line" ]; do
_do_dlog "$1" "$line"
done
fi
@ -380,7 +377,9 @@ dlog() {
dtrace() {
set +x
dlog 6 "$@"
[ -n "$debug" ] && set -x || :
if [ -n "$debug" ]; then
set -x
fi
}

## @brief Logs message at DEBUG level (5)
@ -390,7 +389,9 @@ dtrace() {
ddebug() {
set +x
dlog 5 "$@"
[ -n "$debug" ] && set -x || :
if [ -n "$debug" ]; then
set -x
fi
}

## @brief Logs message at INFO level (4)
@ -400,7 +401,9 @@ ddebug() {
dinfo() {
set +x
dlog 4 "$@"
[ -n "$debug" ] && set -x || :
if [ -n "$debug" ]; then
set -x
fi
}

## @brief Logs message at WARN level (3)
@ -410,7 +413,9 @@ dinfo() {
dwarn() {
set +x
dlog 3 "$@"
[ -n "$debug" ] && set -x || :
if [ -n "$debug" ]; then
set -x
fi
}

## @brief It's an alias to dwarn() function.
@ -420,7 +425,9 @@ dwarn() {
dwarning() {
set +x
dwarn "$@"
[ -n "$debug" ] && set -x || :
if [ -n "$debug" ]; then
set -x
fi
}

## @brief Logs message at ERROR level (2)
@ -430,7 +437,9 @@ dwarning() {
derror() {
set +x
dlog 2 "$@"
[ -n "$debug" ] && set -x || :
if [ -n "$debug" ]; then
set -x
fi
}

## @brief Logs message at FATAL level (1)
@ -440,5 +449,7 @@ derror() {
dfatal() {
set +x
dlog 1 "$@"
[ -n "$debug" ] && set -x || :
if [ -n "$debug" ]; then
set -x
fi
}

View File

@ -1,51 +1,3 @@
# PUT YOUR CONFIG HERE OR IN separate files named *.conf
# in /etc/dracut.conf.d
# SEE man dracut.conf(5)

# Sample dracut config file

#logfile=/var/log/dracut.log
#fileloglvl=6

# Exact list of dracut modules to use. Modules not listed here are not going
# to be included. If you only want to add some optional modules use
# add_dracutmodules option instead.
#dracutmodules+=""

# dracut modules to omit
#omit_dracutmodules+=""

# dracut modules to add to the default
#add_dracutmodules+=""

# additional kernel modules to the default
#add_drivers+=""

# list of kernel filesystem modules to be included in the generic initramfs
#filesystems+=""

# build initrd only to boot current hardware
#hostonly="yes"
#

# install local /etc/mdadm.conf
#mdadmconf="no"

# install local /etc/lvm/lvm.conf
#lvmconf="no"

# A list of fsck tools to install. If it's not specified, module's hardcoded
# default is used, currently: "umount mount /sbin/fsck* xfs_db xfs_check
# xfs_repair e2fsck jfs_fsck reiserfsck btrfsck". The installation is
# opportunistic, so non-existing tools are just ignored.
#fscks=""

# inhibit installation of any fsck tools
#nofscks="yes"

# mount / and /usr read-only by default
#ro_mnt="no"

# set the directory for temporary files
# default: /var/tmp
#tmpdir=/tmp
# PUT YOUR CONFIG IN separate files
# in /etc/dracut.conf.d named "<name>.conf"
# SEE man dracut.conf(5) for options

View File

@ -2,14 +2,45 @@

# 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_items+=" vi /etc/virc ps grep cat rm "
install_optional_items+=" vi /etc/virc ps grep cat rm "
prefix="/"
environment=/usr/lib/environment.d
environmentconfdir=/etc/environment.d
dbus=/usr/share/dbus-1
dbusinterfaces=/usr/share/dbus-1/interfaces
dbusservices=/usr/share/dbus-1/services
dbussession=/usr/share/dbus-1/session.d
dbussystem=/usr/share/dbus-1/system.d
dbussystemservices=/usr/share/dbus-1/system-services
dbusconfdir=/etc/dbus-1
dbusinterfacesconfdir=/etc/dbus-1/interfaces
dbusservicesconfdir=/etc/dbus-1/services
dbussessionconfdir=/etc/dbus-1/session.d
dbussystemconfdir=/etc/dbus-1/system.d
dbussystemservicesconfdir=/etc/dbus-1/system-services
sysctld=/usr/lib/sysctl.d
sysctlconfdir=/etc/sysctl.d
systemdutildir=/usr/lib/systemd
systemdutilconfdir=/etc/systemd
systemdcatalog=/usr/lib/systemd/catalog
systemdntpunits=/usr/lib/systemd/ntp-units.d
systemdntpunitsconfdir=/etc/systemd/ntp-units.d
systemdportable=/usr/lib/systemd/portable
systemdportableconfdir=/etc/systemd/portable
systemdsystemunitdir=/usr/lib/systemd/system
systemdsystemconfdir=/etc/systemd/system
systemduser=/usr/lib/systemd/user
systemduserconfdir=/etc/systemd/user
sysusers=/usr/lib/sysusers.d
sysusersconfdir=/etc/sysusers.d
udevdir=/usr/lib/udev
hostonly="yes"
hostonly_cmdline="no"
early_microcode="yes"
reproducible="yes"

View File

@ -12,4 +12,4 @@ ro_mnt=yes
i18n_vars="/etc/conf.d/keymaps:keymap-KEYMAP,extended_keymaps-EXT_KEYMAPS /etc/conf.d/consolefont:consolefont-FONT,consoletranslation-FONT_MAP /etc/rc.conf:unicode-UNICODE"
i18n_default_font="LatArCyrHeb-16"

omit_drivers+=" i2o_scsi"
omit_drivers+=" i2o_scsi "

View File

@ -1,3 +1,24 @@
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"
# SUSE specific dracut settings
#
# SUSE by default always builds 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="zstd"

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

View File

@ -1,6 +0,0 @@
/var/log/dracut.log {
missingok
notifempty
size 30k
create 0600 root root
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

2538
dracut.sh

File diff suppressed because it is too large Load Diff

View File

@ -1,46 +0,0 @@
#!/usr/bin/perl

sub create_patches {
my $tag=shift;
my $pdir=shift;
my $num=0;
open( GIT, 'git format-patch -M -N --no-signature -o "'.$pdir.'" '.$tag.' |');
@lines=<GIT>;
close GIT; # be done
return @lines;
};

use POSIX qw(strftime);
my $datestr = strftime "%Y%m%d", gmtime;

my $tag=shift;
my $pdir=shift;
$tag=`git describe --abbrev=0 --tags` if not defined $tag;
chomp($tag);
my @patches=&create_patches($tag, $pdir);
my $num=$#patches + 2;
$tag=~s/[^0-9]+?([0-9]+)/$1/;
my $release="$num.git$datestr";
$release="1" if $num == 1;

while(<>) {
if (/^Version:/) {
print "Version: $tag\n";
}
elsif (/^Release:/) {
print "Release: $release%{?dist}\n";
}
elsif ((/^Source0:/) || (/^Source:/)) {
print $_;
$num=1;
for(@patches) {
s/.*\///g;
print "Patch$num: $_";
$num++;
}
print "\n";
}
else {
print $_;
}
}

65
install.d/50-dracut.install Executable file
View File

@ -0,0 +1,65 @@
#!/bin/bash

COMMAND="$1"
KERNEL_VERSION="$2"
BOOT_DIR_ABS="$3"
KERNEL_IMAGE="$4"

# If KERNEL_INSTALL_MACHINE_ID is defined but empty, BOOT_DIR_ABS is a fake directory.
# So, let's skip to create initrd.
if ! [[ ${KERNEL_INSTALL_MACHINE_ID-x} ]]; then
exit 0
fi

if [[ -d "$BOOT_DIR_ABS" ]]; then
INITRD="initrd"
else
BOOT_DIR_ABS="/boot"
INITRD="initramfs-${KERNEL_VERSION}.img"
fi

ret=0
case "$COMMAND" in
add)
INITRD_IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/initrd
if [[ -f ${INITRD_IMAGE_PREGENERATED} ]]; then
# we found an initrd at the same place as the kernel
# use this and don't generate a new one
cp --reflink=auto "$INITRD_IMAGE_PREGENERATED" "$BOOT_DIR_ABS/$INITRD" \
&& chown root:root "$BOOT_DIR_ABS/$INITRD" \
&& chmod 0600 "$BOOT_DIR_ABS/$INITRD" \
&& exit 0
fi

if [[ -f /etc/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
elif [[ -f /usr/lib/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
else
declare -a BOOT_OPTIONS

read -r -d '' -a line < /proc/cmdline
for i in "${line[@]}"; do
[[ "${i#initrd=*}" != "$i" ]] && continue
BOOT_OPTIONS+=("$i")
done
fi

unset noimageifnotneeded

for ((i=0; i < "${#BOOT_OPTIONS[@]}"; i++)); do
# shellcheck disable=SC1001
if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then
noimageifnotneeded="yes"
break
fi
done
dracut -f ${noimageifnotneeded:+--noimageifnotneeded} "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION"
ret=$?
;;
remove)
rm -f -- "$BOOT_DIR_ABS/$INITRD"
ret=$?
;;
esac
exit $ret

View File

@ -0,0 +1,133 @@
#!/bin/bash

export LANG=C

COMMAND="$1"
KERNEL_VERSION="$2"
BOOT_DIR_ABS="${3%/*}/0-rescue"
KERNEL_IMAGE="$4"


dropindirs_sort()
{
suffix=$1; shift
args=("$@")
files=$(
while (( $# > 0 )); do
for i in "${1}"/*"${suffix}"; do
[[ -f $i ]] && echo "${i##*/}"
done
shift
done | sort -Vu
)

for f in $files; do
for d in "${args[@]}"; do
if [[ -f "$d/$f" ]]; then
echo "$d/$f"
continue 2
fi
done
done
}

[[ -f /etc/os-release ]] && . /etc/os-release

if [[ ${KERNEL_INSTALL_MACHINE_ID+x} ]]; then
MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
elif [[ -f /etc/machine-id ]] ; then
read -r MACHINE_ID < /etc/machine-id
fi

if ! [[ $MACHINE_ID ]]; then
exit 0
fi

if [[ -f /etc/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
elif [[ -f /usr/lib/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
else
declare -a BOOT_OPTIONS

read -r -d '' -a line < /proc/cmdline
for i in "${line[@]}"; do
[[ "${i#initrd=*}" != "$i" ]] && continue
BOOT_OPTIONS+=("$i")
done
fi

if [[ -d "${BOOT_DIR_ABS%/*}" ]]; then
BOOT_DIR="/${MACHINE_ID}/0-rescue"
BOOT_ROOT=${BOOT_DIR_ABS%$BOOT_DIR}
LOADER_ENTRY="$BOOT_ROOT/loader/entries/${MACHINE_ID}-0-rescue.conf"
KERNEL="linux"
INITRD="initrd"
else
BLS_DIR="/boot/loader/entries"
BOOT_DIR_ABS="/boot"
LOADER_ENTRY="$BLS_DIR/${MACHINE_ID}-0-rescue.conf"
KERNEL="vmlinuz-0-rescue-${MACHINE_ID}"
INITRD="initramfs-0-rescue-${MACHINE_ID}.img"
fi

ret=0

case "$COMMAND" in
add)
[[ -f "$LOADER_ENTRY" ]] && [[ -f "$BOOT_DIR_ABS/$KERNEL" ]] \
&& [[ -f "$BOOT_DIR_ABS/$INITRD" ]] && exit 0

# source our config dir
for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do
if [[ -e $f ]]; then
# shellcheck disable=SC1090
. "$f"
fi
done

# shellcheck disable=SC2154
[[ $dracut_rescue_image != "yes" ]] && exit 0

[[ -d "$BOOT_DIR_ABS" ]] || mkdir -p "$BOOT_DIR_ABS"

if ! cp --reflink=auto "$KERNEL_IMAGE" "$BOOT_DIR_ABS/$KERNEL"; then
echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/$KERNEL'!" >&2
fi

if [[ ! -f "$BOOT_DIR_ABS/$INITRD" ]]; then
dracut -f --no-hostonly -a "rescue" "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION"
((ret+=$?))
fi

if [[ "${BOOT_DIR_ABS}" != "/boot" ]]; then
{
echo "title $PRETTY_NAME - Rescue Image"
echo "version $KERNEL_VERSION"
echo "machine-id $MACHINE_ID"
echo "options ${BOOT_OPTIONS[*]} rd.auto=1"
echo "linux $BOOT_DIR/linux"
echo "initrd $BOOT_DIR/initrd"
} > "$LOADER_ENTRY"
else
if [[ -e "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" ]]; then
cp -aT "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" "$LOADER_ENTRY"
else
cp -aT "${KERNEL_IMAGE%/*}/bls.conf" "$LOADER_ENTRY"
fi
sed -i "s/${KERNEL_VERSION}/0-rescue-${MACHINE_ID}/" "$LOADER_ENTRY"
fi

((ret+=$?))
;;

remove)
exit 0
;;

*)
usage
ret=1;;
esac

exit $ret

File diff suppressed because it is too large Load Diff

View File

@ -1,63 +0,0 @@
#
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
# Copyright 2013 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

__contains_word () {
local word=$1; shift
for w in $*; do [[ $w = $word ]] && return 0; done
return 1
}

_lsinitrd() {
local field_vals= cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local -A OPTS=(
[STANDALONE]='-s --size -h --help'

[ARG]='-f --file -k --kver'
)

if __contains_word "$prev" ${OPTS[ARG]}; then
case $prev in
--file|-f)
comps=$(compgen -f -- "$cur")
compopt -o filenames
;;
--kver|-k)
comps=$(cd /lib/modules; echo [0-9]*)
;;
*)
return 0
;;
esac
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
return 0
fi

if [[ $cur = -* ]]; then
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
return 0
fi

comps=$(compgen -f -- "$cur")
compopt -o filenames
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
return 0
}

complete -F _lsinitrd lsinitrd

View File

@ -1,6 +1,4 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
# Copyright 2005-2010 Harald Hoyer <harald@redhat.com>
# Copyright 2005-2010 Red Hat, Inc. All rights reserved.
@ -19,8 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

usage()
{
usage() {
{
echo "Usage: ${0##*/} [options] [<initramfs file> [<filename> [<filename> [...] ]]]"
echo "Usage: ${0##*/} [options] -k <kernel version>"
@ -29,29 +26,39 @@ usage()
echo "-s, --size sort the contents of the initramfs by size."
echo "-m, --mod list modules."
echo "-f, --file <filename> print the contents of <filename>."
echo "--unpack unpack the initramfs, instead of displaying the contents."
echo " If optional filenames are given, will only unpack specified files,"
echo " else the whole image will be unpacked. Won't unpack anything from early cpio part."
echo "--unpackearly unpack the early microcode part of the initramfs."
echo " Same as --unpack, but only unpack files from early cpio part."
echo "-v, --verbose unpack verbosely."
echo "-k, --kver <kernel version> inspect the initramfs of <kernel version>."
echo
} >&2
}


[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut

sorted=0
modules=0
unset verbose
declare -A filenames

unset POSIXLY_CORRECT
TEMP=$(getopt \
-o "shmf:k:" \
-o "vshmf:k:" \
--long kver: \
--long file: \
--long mod \
--long help \
--long size \
--long unpack \
--long unpackearly \
--long verbose \
-- "$@")

if (( $? != 0 )); then
# shellcheck disable=SC2181
if (($? != 0)); then
usage
exit 1
fi
@ -60,13 +67,31 @@ eval set -- "$TEMP"

while (($# > 0)); do
case $1 in
-k|--kver) KERNEL_VERSION="$2"; shift;;
-f|--file) filenames[${2#/}]=1; shift;;
-s|--size) sorted=1;;
-h|--help) usage; exit 0;;
-m|--mod) modules=1;;
--) shift;break;;
*) usage; exit 1;;
-k | --kver)
KERNEL_VERSION="$2"
shift
;;
-f | --file)
filenames[${2#/}]=1
shift
;;
-s | --size) sorted=1 ;;
-h | --help)
usage
exit 0
;;
-m | --mod) modules=1 ;;
-v | --verbose) verbose="--verbose" ;;
--unpack) unpack=1 ;;
--unpackearly) unpackearly=1 ;;
--)
shift
break
;;
*)
usage
exit 1
;;
esac
shift
done
@ -75,7 +100,7 @@ done

if [[ $1 ]]; then
image="$1"
if ! [[ -f "$image" ]]; then
if ! [[ -f $image ]]; then
{
echo "$image does not exist"
echo
@ -84,11 +109,15 @@ if [[ $1 ]]; then
exit 1
fi
else
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
[[ -f /etc/machine-id ]] && read -r MACHINE_ID < /etc/machine-id

if [[ -d /boot/loader/entries || -L /boot/loader/entries ]] \
if [[ -d /efi/loader/entries || -L /efi/loader/entries ]] \
&& [[ $MACHINE_ID ]] \
&& [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
&& [[ -d /efi/${MACHINE_ID} || -L /efi/${MACHINE_ID} ]]; then
image="/efi/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
elif [[ -d /boot/loader/entries || -L /boot/loader/entries ]] \
&& [[ $MACHINE_ID ]] \
&& [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]]; then
image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
else
image="/boot/initramfs-${KERNEL_VERSION}.img"
@ -97,11 +126,11 @@ fi

shift
while (($# > 0)); do
filenames[${1#/}]=1;
filenames[${1#/}]=1
shift
done

if ! [[ -f "$image" ]]; then
if ! [[ -f $image ]]; then
{
echo "No <initramfs file> specified and the default image '$image' cannot be accessed!"
echo
@ -110,57 +139,140 @@ if ! [[ -f "$image" ]]; then
exit 1
fi

extract_files()
{
(( ${#filenames[@]} == 1 )) && nofileinfo=1
for f in ${!filenames[@]}; do
TMPDIR="$(mktemp -d -t lsinitrd.XXXXXX)"
# shellcheck disable=SC2064
trap "rm -rf '$TMPDIR'" EXIT

dracutlibdirs() {
for d in lib64/dracut lib/dracut usr/lib64/dracut usr/lib/dracut; do
echo "$d/$1"
done
}

extract_files() {
((${#filenames[@]} == 1)) && nofileinfo=1
for f in "${!filenames[@]}"; do
[[ $nofileinfo ]] || echo "initramfs:/$f"
[[ $nofileinfo ]] || echo "========================================================================"
$CAT $image | cpio --extract --verbose --quiet --to-stdout $f 2>/dev/null
((ret+=$?))
$CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --to-stdout "$f" 2> /dev/null
((ret += $?))
[[ $nofileinfo ]] || echo "========================================================================"
[[ $nofileinfo ]] || echo
done
}

list_modules()
{
list_modules() {
echo "dracut modules:"
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/modules.txt' 'usr/lib/dracut/modules.txt' 2>/dev/null
((ret+=$?))
# shellcheck disable=SC2046
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
$(dracutlibdirs modules.txt) 2> /dev/null
((ret += $?))
}

list_files()
{
list_files() {
echo "========================================================================"
if [ "$sorted" -eq 1 ]; then
$CAT "$image" | cpio --extract --verbose --quiet --list | sort -n -k5
$CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --list | sort -n -k5
else
$CAT "$image" | cpio --extract --verbose --quiet --list | sort -k9
$CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --list | sort -k9
fi
((ret+=$?))
((ret += $?))
echo "========================================================================"
}

list_squash_content() {
SQUASH_IMG="squash-root.img"
SQUASH_TMPFILE="$TMPDIR/initrd.root.sqsh"

$CAT "$image" 2> /dev/null | cpio --extract --verbose --quiet --to-stdout -- \
$SQUASH_IMG > "$SQUASH_TMPFILE" 2> /dev/null
if [[ -s $SQUASH_TMPFILE ]]; then
echo "Squashed content ($SQUASH_IMG):"
echo "========================================================================"
unsquashfs -ll "$SQUASH_TMPFILE" | tail -n +4
echo "========================================================================"
fi
}

unpack_files() {
if ((${#filenames[@]} > 0)); then
for f in "${!filenames[@]}"; do
$CAT "$image" 2> /dev/null | cpio -id --quiet $verbose $f
((ret += $?))
done
else
$CAT "$image" 2> /dev/null | cpio -id --quiet $verbose
((ret += $?))
fi
}

read -r -N 2 bin < "$image"
if [ "$bin" = "MZ" ]; then
command -v objcopy > /dev/null || {
echo "Need 'objcopy' to unpack an UEFI executable."
exit 1
}
objcopy \
--dump-section .linux="$TMPDIR/vmlinuz" \
--dump-section .initrd="$TMPDIR/initrd.img" \
--dump-section .cmdline="$TMPDIR/cmdline.txt" \
--dump-section .osrel="$TMPDIR/osrel.txt" \
"$image" /dev/null
uefi="$image"
image="$TMPDIR/initrd.img"
[ -f "$image" ] || exit 1
fi

if ((${#filenames[@]} <= 0)) && [[ -z $unpack ]] && [[ -z $unpackearly ]]; then
if [ -n "$uefi" ]; then
echo -n "initrd in UEFI: $uefi: "
du -h "$image" | while read -r a _ || [ -n "$a" ]; do echo "$a"; done
if [ -f "$TMPDIR/osrel.txt" ]; then
name=$(sed -En '/^PRETTY_NAME/ s/^\w+=["'"'"']?([^"'"'"'$]*)["'"'"']?/\1/p' "$TMPDIR/osrel.txt")
id=$(sed -En '/^ID/ s/^\w+=["'"'"']?([^"'"'"'$]*)["'"'"']?/\1/p' "$TMPDIR/osrel.txt")
build=$(sed -En '/^BUILD_ID/ s/^\w+=["'"'"']?([^"'"'"'$]*)["'"'"']?/\1/p' "$TMPDIR/osrel.txt")
echo "OS Release: $name (${id}-${build})"
fi
if [ -f "$TMPDIR/vmlinuz" ]; then
version=$(strings -n 20 "$TMPDIR/vmlinuz" | sed -En '/[0-9]+\.[0-9]+\.[0-9]+/ { p; q 0 }')
echo "Kernel Version: $version"
fi
if [ -f "$TMPDIR/cmdline.txt" ]; then
echo "Command line:"
sed -En 's/\s+/\n/g; s/\x00/\n/; p' "$TMPDIR/cmdline.txt"
fi
else
echo -n "Image: $image: "
du -h "$image" | while read -r a _ || [ -n "$a" ]; do echo "$a"; done
fi

if (( ${#filenames[@]} <= 0 )); then
echo "Image: $image: $(du -h $image | while read a b; do echo $a;done)"
echo "========================================================================"
fi

read -N 6 bin < "$image"
read -r -N 6 bin < "$image"
case $bin in
$'\x71\xc7'*|070701)
$'\x71\xc7'* | 070701)
CAT="cat --"
is_early=$(cpio --extract --verbose --quiet --to-stdout -- 'early_cpio' < "$image" 2>/dev/null)
is_early=$(cpio --extract --verbose --quiet --to-stdout -- 'early_cpio' < "$image" 2> /dev/null)
# Debian mkinitramfs does not create the file 'early_cpio', so let's check if firmware files exist
[[ "$is_early" ]] || is_early=$(cpio --list --verbose --quiet --to-stdout -- 'kernel/*/microcode/*.bin' < "$image" 2> /dev/null)
if [[ "$is_early" ]]; then
if (( ${#filenames[@]} > 0 )); then
if [[ -n $unpack ]]; then
# should use --unpackearly for early CPIO
:
elif [[ -n $unpackearly ]]; then
unpack_files
elif ((${#filenames[@]} > 0)); then
extract_files
else
echo "Early CPIO image"
list_files
fi
SKIP="$dracutbasedir/skipcpio"
if [[ -d "$dracutbasedir/skipcpio" ]]; then
SKIP="$dracutbasedir/skipcpio/skipcpio"
else
SKIP="$dracutbasedir/skipcpio"
fi
if ! [[ -x $SKIP ]]; then
echo
echo "'$SKIP' not found, cannot display remaining contents!" >&2
@ -171,41 +283,40 @@ case $bin in
;;
esac

CAT=$({
if [[ $SKIP ]]; then
$SKIP "$image"
if [[ $SKIP ]]; then
bin="$($SKIP "$image" | { read -r -N 6 bin && echo "$bin"; })"
else
read -r -N 6 bin < "$image"
fi
case $bin in
$'\x1f\x8b'*)
CAT="zcat --"
;;
BZh*)
CAT="bzcat --"
;;
$'\x71\xc7'* | 070701)
CAT="cat --"
;;
$'\x02\x21'*)
CAT="lz4 -d -c"
;;
$'\x89'LZO$'\0'*)
CAT="lzop -d -c"
;;
$'\x28\xB5\x2F\xFD'*)
CAT="zstd -d -c"
;;
*)
if echo "test" | xz | xzcat --single-stream > /dev/null 2>&1; then
CAT="xzcat --single-stream --"
else
cat "$image"
fi } | {
read -N 6 bin
case $bin in
$'\x1f\x8b'*)
echo "zcat --"
;;
BZh*)
echo "bzcat --"
;;
$'\x71\xc7'*|070701)
echo "cat --"
;;
$'\x02\x21'*)
echo "lz4 -d -c"
;;
$'\x89'LZO$'\0'*)
echo "lzop -d -c"
;;
*)
if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
echo "xzcat --single-stream --"
else
echo "xzcat --"
fi
;;
esac
})
CAT="xzcat --"
fi
;;
esac

skipcpio()
{
skipcpio() {
$SKIP "$@" | $ORIG_CAT
}

@ -214,13 +325,26 @@ if [[ $SKIP ]]; then
CAT=skipcpio
fi

if ((${#filenames[@]} > 1)); then
TMPFILE="$TMPDIR/initrd.cpio"
$CAT "$image" 2> /dev/null > "$TMPFILE"
pre_decompress() {
cat "$TMPFILE"
}
CAT=pre_decompress
fi

ret=0

if (( ${#filenames[@]} > 0 )); then
if [[ -n $unpack ]]; then
unpack_files
elif ((${#filenames[@]} > 0)); then
extract_files
else
version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/dracut-*' 'usr/lib/dracut/dracut-*' 2>/dev/null)
((ret+=$?))
# shellcheck disable=SC2046
version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
$(dracutlibdirs 'dracut-*') 2> /dev/null)
((ret += $?))
echo "Version: $version"
echo
if [ "$modules" -eq 1 ]; then
@ -228,11 +352,14 @@ else
echo "========================================================================"
else
echo -n "Arguments: "
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/build-parameter.txt' 'usr/lib/dracut/build-parameter.txt' 2>/dev/null
# shellcheck disable=SC2046
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
$(dracutlibdirs build-parameter.txt) 2> /dev/null
echo
list_modules
list_files
list_squash_content
fi
fi

exit $ret
exit "$ret"

View File

@ -3,10 +3,11 @@ DRACUT(8)
:doctype: manpage
:man source: dracut
:man manual: dracut
:man version: {version}

NAME
----
dracut - low-level tool for generating an initramfs image
dracut - low-level tool for generating an initramfs/initrd image

SYNOPSIS
--------
@ -28,10 +29,12 @@ At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it
as initial root file system. All finding of the root device happens in this
early userspace.

Initramfs images are also called "initrd".

For a complete list of kernel command line options see *dracut.cmdline*(7).

If you are dropped to an emergency shell, while booting your initramfs,
the file _/run/initramfs/rdsosreport.txt_ is created, which can be safed to a
the file _/run/initramfs/rdsosreport.txt_ is created, which can be saved to a
(to be mounted by hand) partition (usually /boot) or a USB stick.
Additional debugging info can be produced by adding **rd.debug** to the kernel
command line. _/run/initramfs/rdsosreport.txt_ contains all logs and the output
@ -54,33 +57,6 @@ OPTIONS
**-f, --force**::
overwrite existing initramfs file.

**-m, --modules** _<list of dracut modules>_::
specify a space-separated list of dracut modules to call when building the
initramfs. Modules are located in _/usr/lib/dracut/modules.d_. This
parameter can be specified multiple times.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --modules "module1 module2" ...
----
===============================

**-o, --omit** _<list of dracut modules>_::
omit a space-separated list of dracut modules. This parameter can be
specified multiple times.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --omit "module1 module2" ...
----
===============================

**-a, --add** _<list of dracut modules>_::
add a space-separated list of dracut modules to the default set of modules.
This parameter can be specified multiple times.
@ -108,6 +84,35 @@ example:
----
===============================

**-o, --omit** _<list of dracut modules>_::
omit a space-separated list of dracut modules. This parameter can be
specified multiple times.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --omit "module1 module2" ...
----
===============================

**-m, --modules** _<list of dracut modules>_::
specify a space-separated list of dracut modules to call when building the
initramfs. Modules are located in _/usr/lib/dracut/modules.d_. This
parameter can be specified multiple times.
This option forces dracut to only include the specified dracut modules.
In most cases the "--add" option is what you want to use.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --modules "module1 module2" ...
----
===============================

**-d, --drivers** _<list of kernel modules>_::
specify a space-separated list of kernel modules to exclusively include
in the initramfs. The kernel modules have to be specified without the ".ko"
@ -136,6 +141,19 @@ example:
----
===============================

**--force-drivers** _<list of kernel modules>_::
See add-drivers above. But in this case it is ensured that the drivers
are tried to be loaded early via modprobe.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --force-drivers "kmodule1 kmodule2" ...
----
===============================

**--omit-drivers** _<list of kernel modules>_::
specify a space-separated list of kernel modules not to add to the
initramfs.
@ -226,12 +244,6 @@ example:
**--nostrip**::
do not strip binaries in the initramfs

**--prelink**::
prelink binaries in the initramfs (default)

**--noprelink**::
do not prelink binaries in the initramfs

**--hardlink**::
hardlink files in the initramfs (default)

@ -253,6 +265,9 @@ example:
**-v, --verbose**::
increase verbosity level (default is info(4))

**--version**::
display version and exit

**-q, --quiet**:: decrease verbosity level (default is info(4))

**-c, --conf** _<dracut configuration file>_::
@ -273,6 +288,15 @@ Default:
Default:
_/var/tmp_

**-r, --sysroot** _<sysroot directory>_::
specify the sysroot directory to collect files from.
This is useful to create the initramfs image from
a cross-compiled sysroot directory. For the extra helper
variables, see *ENVIRONMENT* below.
+
Default:
_empty_

**--sshkey** _<sshkey file>_:: ssh key file used with ssh-client module.

**--logfile** _<logfile>_:: logfile to use; overrides any setting from
@ -306,6 +330,16 @@ provide a valid _/etc/fstab_.
**--no-hostonly-cmdline**:
Do not store kernel command line arguments needed in the initramfs

**--no-hostonly-default-device**:
Do not generate implicit host devices like root, swap, fstab, etc.
Use "--mount" or "--add-device" to explicitly add devices as needed.

**--hostonly-i18n**:
Install only needed keyboard and font files according to the host configuration (default).

**--no-hostonly-i18n**:
Install all keyboard and font files available.

**--persistent-policy** _<policy>_::
Use _<policy>_ to address disks and partitions.
_<policy>_ can be any directory name found in /dev/disk.
@ -325,6 +359,10 @@ provide a valid _/etc/fstab_.
The default _<dump frequency>_ is "0".
the default _<fsck order>_ is "2".

**--mount** "_<mountpoint>_"::
Like above, but _<device>_, _<filesystem type>_ and _<filesystem options>_
are determined by looking at the current mounts.

**--add-device** _<device>_ ::
Bring up _<device>_ in initramfs, _<device>_ should be the device name.
This can be useful in hostonly mode for resume support when your swap is on
@ -349,6 +387,9 @@ example:
----
===============================

**--install-optional** _<file list>_::
install the space separated list of files into the initramfs, if they exist.

**--gzip**::
Compress the generated initramfs using gzip. This will be done by default,
unless another compression option or --no-compress is passed. Equivalent to
@ -398,17 +439,32 @@ Make sure your kernel has lz4 decompression support compiled in, otherwise you
will not be able to boot.
====

**--zstd**::
Compress the generated initramfs using Zstandard.
[WARNING]
====
Make sure your kernel has zstd decompression support compiled in, otherwise you
will not be able to boot.
====

**--compress** _<compressor>_::
Compress the generated initramfs using the passed compression program. If
you pass it just the name of a compression program, it will call that
program with known-working arguments. If you pass a quoted string with
arguments, it will be called with exactly those arguments. Depending on what
you pass, this may result in an initramfs that the kernel cannot decompress.
The default value can also be set via the _INITRD_COMPRESS_ environment variable.

**--no-compress**::
Do not compress the generated initramfs. This will override any other
compression options.

**--reproducible**::
Create reproducible images.

**--no-reproducible**::
Do not create reproducible images.

**--list-modules**::
List all available dracut modules.

@ -443,6 +499,143 @@ will not be able to boot.
Regenerate all initramfs images at the default location with the kernel
versions found on the system. Additional parameters are passed through.

**--loginstall _<DIR>_**::
Log all files installed from the host to _<DIR>_.

**--uefi**::
Instead of creating an initramfs image, dracut will create an UEFI executable,
which can be executed by an UEFI BIOS. The default output filename is
_<EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi_. <EFI> might be
_/efi_, _/boot_ or _/boot/efi_ depending on where the ESP partition is mounted.
The <BUILD_ID> is taken from BUILD_ID in _/usr/lib/os-release_ or if it exists
_/etc/os-release_ and is left out, if BUILD_ID is non-existant or empty.

**--no-uefi**::
Disables UEFI mode.

**--no-machineid**::
affects the default output filename of **--uefi** and will discard the <MACHINE_ID>
part.

**--uefi-stub _<FILE>_**::
Specifies the UEFI stub loader, which will load the attached kernel, initramfs and
kernel command line and boots the kernel. The default is
_$prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_

**--uefi-splash-image _<FILE>_**::
Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**) image
format.

**--kernel-image _<FILE>_**::
Specifies the kernel image, which to include in the UEFI executable. The default is
_/lib/modules/<KERNEL-VERSION>/vmlinuz_ or _/boot/vmlinuz-<KERNEL-VERSION>_

**--enhanced-cpio**::
Attempt to use the dracut-cpio binary, which optimizes archive creation for
copy-on-write filesystems by using the copy_file_range(2) syscall via Rust's
io::copy(). When specified, initramfs archives are also padded to ensure
optimal data alignment for extent sharing. To retain reflink data
deduplication benefits, this should be used alongside the **--no-compress**
and **--no-strip** parameters, with initramfs source files, **--tmpdir**
staging area and destination all on the same copy-on-write capable filesystem.

ENVIRONMENT
-----------

_INITRD_COMPRESS_::
sets the default compression program. See **--compress**.

_DRACUT_LDCONFIG_::
sets the _ldconfig_ program path and options. Optional.
Used for **--sysroot**.
+
Default:
_ldconfig_

_DRACUT_LDD_::
sets the _ldd_ program path and options. Optional.
Used for **--sysroot**.
+
Default:
_ldd_

_DRACUT_TESTBIN_::
sets the initially tested binary for detecting library paths.
Optional. Used for **--sysroot**. In the cross-compiled sysroot,
the default value (_/bin/sh_) is unusable, as it is an absolute
symlink and points outside the sysroot directory.
+
Default:
_/bin/sh_

_DRACUT_INSTALL_::
overrides path and options for executing _dracut-install_ internally.
Optional. Can be used to debug _dracut-install_ while running the
main dracut script.
+
Default:
_dracut-install_
+
Example:
DRACUT_INSTALL="valgrind dracut-install"

_DRACUT_COMPRESS_BZIP2_::
_DRACUT_COMPRESS_BZIP2_::
_DRACUT_COMPRESS_LBZIP2_::
_DRACUT_COMPRESS_LZMA_::
_DRACUT_COMPRESS_XZ_::
_DRACUT_COMPRESS_GZIP_::
_DRACUT_COMPRESS_PIGZ_::
_DRACUT_COMPRESS_LZOP_::
_DRACUT_COMPRESS_ZSTD_::
_DRACUT_COMPRESS_LZ4_::
_DRACUT_COMPRESS_CAT_::
overrides for compression utilities to support using them from
non-standard paths.
+
Default values are the default compression utility names to be found in **PATH**.

_DRACUT_ARCH_::
overrides the value of **uname -m**. Used for **--sysroot**.
+
Default:
_empty_ (the value of **uname -m** on the host system)

_SYSTEMD_VERSION_::
overrides systemd version. Used for **--sysroot**.

_SYSTEMCTL_::
overrides the systemctl binary. Used for **--sysroot**.

_NM_VERSION_::
overrides the NetworkManager version. Used for **--sysroot**.

_DRACUT_INSTALL_PATH_::
overrides **PATH** environment for **dracut-install** to look for
binaries relative to **--sysroot**. In a cross-compiled environment
(e.g. Yocto), PATH points to natively built binaries that are not
in the host's /bin, /usr/bin, etc. **dracut-install** still needs plain
/bin and /usr/bin that are relative to the cross-compiled sysroot.
+
Default:
_PATH_

_DRACUT_INSTALL_LOG_TARGET_::
overrides **DRACUT_LOG_TARGET** for **dracut-install**. It allows
running **dracut-install* to run with different log target that
**dracut** runs with.
+
Default:
_DRACUT_LOG_TARGET_

_DRACUT_INSTALL_LOG_LEVEL_::
overrides **DRACUT_LOG_LEVEL** for **dracut-install**. It allows
running **dracut-install* to run with different log level that
**dracut** runs with.
+
Default:
_DRACUT_LOG_LEVEL_

FILES
-----
_/var/log/dracut.log_::
@ -486,18 +679,18 @@ Harald Hoyer

Victor Lowther

Amadeusz Żołnowski

Hannes Reinecke

Daniel Molkentin

Will Woods

Philippe Seewer

Warren Togami

Amadeusz Żołnowski

Jeremy Katz

David Dillow

Will Woods

SEE ALSO
--------
*dracut.cmdline*(7) *dracut.conf*(5)
*dracut.cmdline*(7) *dracut.conf*(5) *lsinitrd*(1)

View File

@ -1,8 +1,8 @@
dracut
======
Harald Hoyer <harald@redhat.com>
v3.0, October 2013

dracut {mainversion}
====================
:author: Harald Hoyer
:email: harald@profian.com
:revnumber: {version}
:language: bash

= Introduction
@ -61,7 +61,7 @@ Depending on which algorithms were compiled statically into it, the kernel can
currently unpack initrd/initramfs images compressed with gzip, bzip2 and LZMA.

== Mount preparations
dracut can generate a customized initrams image which contains only whatever is
dracut can generate a customized initramfs image which contains only whatever is
necessary to boot some particular computer, such as ATA, SCSI and filesystem
kernel modules (host-only mode).

@ -132,7 +132,7 @@ The following steps are executed during a shutdown:

* systemd switches to the shutdown.target
* systemd starts
/lib/systemd/system/shutdown.target.wants/dracut-shutdown.service
$prefix/lib/systemd/system/shutdown.target.wants/dracut-shutdown.service
* dracut-shutdown.service executes /usr/lib/dracut/dracut-initramfs-restore
which unpacks the initramfs to /run/initramfs
* systemd finishes shutdown.target
@ -142,7 +142,7 @@ The following steps are executed during a shutdown:
* if yes, it does a pivot_root to /run/initramfs and executes ./shutdown.
The old root is then mounted on /oldroot.
/usr/lib/dracut/modules.d/99shutdown/shutdown.sh is the shutdown executable.
* shutdown will try to umount every /oldroot mount and calls the various
* shutdown will try to unmount every /oldroot mount and calls the various
shutdown hooks from the dracut modules

This ensures, that all devices are disassembled and unmounted cleanly.
@ -162,9 +162,6 @@ include::dracut.cmdline.7.asc[]
[[lsinitrd1]]
include::lsinitrd.1.asc[]

[[mkinitrd8]]
include::mkinitrd.8.asc[]

= Developer Manual

:leveloffset: 1

View File

@ -3,6 +3,7 @@ DRACUT.BOOTUP(7)
:doctype: manpage
:man source: dracut
:man manual: dracut
:man version: {version}

NAME
----

View File

@ -3,6 +3,7 @@ DRACUT.CMDLINE(7)
:doctype: manpage
:man source: dracut
:man manual: dracut
:man version: {version}

NAME
----
@ -32,7 +33,7 @@ line is the value, which is honored.
Standard
~~~~~~~~
**init=**__<path to real init>__::
specify the path to the init programm to be started after the initramfs has
specify the path to the init program to be started after the initramfs has
finished

**root=**__<path to blockdevice>__::
@ -109,9 +110,33 @@ resume=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7
the init system performs fsck before remount, you might want to use this
option to avoid duplication.

iso-scan/filename
~~~~~~~~~~~~~~~~~

Mount all mountable devices and search for ISO pointed by the argument. When
the ISO is found set it up as a loop device. Device containing this ISO
image will stay mounted at /run/initramfs/isoscandev.
Using iso-scan/filename with a Fedora/Red Hat/CentOS Live iso should just work
by copying the original kernel cmdline parameters.

[listing]
.Example
--
menuentry 'Live Fedora 20' --class fedora --class gnu-linux --class gnu --class os {
set isolabel=Fedora-Live-LXDE-x86_64-20-1
set isofile="/boot/iso/Fedora-Live-LXDE-x86_64-20-1.iso"
loopback loop $isofile
linux (loop)/isolinux/vmlinuz0 boot=isolinux iso-scan/filename=$isofile root=live:LABEL=$isolabel ro rd.live.image quiet rhgb
initrd (loop)/isolinux/initrd0.img
}
--

Misc
~~~~
**rd.emergency=**__[reboot|poweroff|halt]__::
specify, what action to execute in case of a critical failure. rd.shell=0 also
be specified.

**rd.driver.blacklist=**__<drivername>__[,__<drivername>__,...]::
do not load kernel module <drivername>. This parameter can be specified
multiple times.
@ -125,11 +150,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.
The default is 30 seconds. After 2/3 of the time, degraded raids are force
specify how long dracut should retry the initqueue to configure devices.
The default is 180 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.

@ -137,11 +167,17 @@ Misc
specify the controlling terminal for the console.
This is useful, if you have multiple "console=" arguments.

**rd.shutdown.timeout.umount=**__<seconds>__::
specify how long dracut should wait for an individual umount to finish
during shutdown. This avoids the system from blocking when unmounting a file
system cannot complete and waits indefinitely. Value '0' means to wait
'forever'. The default is 90 seconds.

[[dracutkerneldebug]]
Debug
~~~~~
If you are dropped to an emergency shell, the file
_/run/initramfs/rdsosreport.txt_ is created, which can be safed to a (to be
If you are dropped to an emergency shell, the file
_/run/initramfs/rdsosreport.txt_ is created, which can be saved to a (to be
mounted by hand) partition (usually /boot) or a USB stick. Additional debugging
info can be produced by adding **rd.debug** to the kernel command line.
_/run/initramfs/rdsosreport.txt_ contains all logs and the output of some tools.
@ -161,9 +197,9 @@ It should be attached to any report about dracut problems.
_/run/initramfs/init.log_.
If "quiet" is set, it also logs to the console.

**rd.memdebug=[0-3]**::
Print memory usage info at various points, set the verbose level from 0 to 3.
+
**rd.memdebug=[0-5]**::
Print memory usage info at various points, set the verbose level from 0 to 5.
+
Higher level means more debugging output:
+
----
@ -171,6 +207,14 @@ It should be attached to any report about dracut problems.
1 - partial /proc/meminfo
2 - /proc/meminfo
3 - /proc/meminfo + /proc/slabinfo
4 - /proc/meminfo + /proc/slabinfo + memstrack summary
NOTE: memstrack is a memory tracing tool that tracks the total memory
consumption, and peak memory consumption of each kernel modules
and userspace progress during the whole initramfs runtime, report
is genereted and the end of initramsfs run.
5 - /proc/meminfo + /proc/slabinfo + memstrack (with top memory stacktrace)
NOTE: memstrack (with top memory stacktrace) will print top memory
allocation stack traces during the whole initramfs runtime.
----

**rd.break**::
@ -212,7 +256,7 @@ rd.vconsole.keymap=de-latin1-nodeadkeys
[listing]
.Example
--
rd.vconsole.font=LatArCyrHeb-16
rd.vconsole.font=eurlatgr
--

**rd.vconsole.font.map=**__<console map base file name>__::
@ -246,12 +290,12 @@ LVM
disable LVM detection

**rd.lvm.vg=**__<volume group name>__::
only activate the volume groups with the given name. rd.lvm.vg can be
specified multiple times on the kernel command line.
only activate all logical volumes in the the volume groups with the given name.
rd.lvm.vg can be specified multiple times on the kernel command line.

**rd.lvm.lv=**__<logical volume name>__::
only activate the logical volumes with the given name. rd.lvm.lv can be
specified multiple times on the kernel command line.
**rd.lvm.lv=**__<volume group name>/<logical volume name>__::
only activate the logical volumes with the given name.
rd.lvm.lv can be specified multiple times on the kernel command line.

**rd.lvm.conf=0**::
remove any _/etc/lvm/lvm.conf_, which may exist in the initramfs
@ -267,6 +311,8 @@ crypto LUKS
The comparisons also matches, if _<luks uuid>_ is only the beginning of the
LUKS UUID, so you don't have to specify the full UUID.
This parameter can be specified multiple times.
_<luks uuid>_ may be prefixed by the keyword `keysource:`, see
_rd.luks.key_ below.

**rd.luks.allow-discards=**__<luks uuid>__::
Allow using of discards (TRIM) requests for LUKS partitions with the given
@ -281,24 +327,44 @@ crypto LUKS
**rd.luks.crypttab=0**::
do not check, if LUKS partition is in _/etc/crypttab_

**rd.luks.timeout=**__<seconds>__::
specify how long dracut should wait when waiting for the user to enter the
password. This avoid blocking the boot if no password is entered. It does
not apply to luks key. The default is '0', which means 'forever'.

crypto LUKS - key on removable device support
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
**rd.luks.key=**__<keypath>__:__<keydev>__:__<luksdev>__::
_keypath_ is a path to key file to look for. It's REQUIRED. When _keypath_
ends with '.gpg' it's considered to be key encrypted symmetrically with GPG.
You will be prompted for password on boot. GPG support comes with
'crypt-gpg' module which needs to be added explicitly.

NB: If systemd is included in the dracut initrd, dracut's built in
removable device keying support won't work. systemd will prompt for
a password from the console even if you've supplied **rd.luks.key**.
You may be able to use standard systemd *fstab*(5) syntax to
get the same effect. If you do need **rd.luks.key** to work,
you will have to exclude the "systemd" dracut module and any modules
that depend on it. See *dracut.conf*(5) and
https://bugzilla.redhat.com/show_bug.cgi?id=905683 for more
information.

**rd.luks.key=**_<keypath>[:<keydev>[:<luksdev>]]_::
_<keypath>_ is the pathname of a key file, relative to the root
of the filesystem on some device. It's REQUIRED. When
_<keypath>_ ends with '.gpg' it's considered to be key encrypted
symmetrically with GPG. You will be prompted for the GPG password on
boot. GPG support comes with the 'crypt-gpg' module, which needs to be
added explicitly.
+
_keydev_ is a device on which key file resides. It might be kernel name of
devices (should start with "/dev/"), UUID (prefixed with "UUID=") or label
(prefix with "LABEL="). You don't have to specify full UUID. Just its beginning
will suffice, even if its ambiguous. All matching devices will be probed.
This parameter is recommended, but not required. If not present, all block
devices will be probed, which may significantly increase boot time.
_<keydev>_ identifies the device on which the key file resides. It may
be the kernel name of the device (should start with "/dev/"), a UUID
(prefixed with "UUID=") or a label (prefix with "LABEL="). You don't
have to specify a full UUID. Just its beginning will suffice, even if
its ambiguous. All matching devices will be probed. This parameter is
recommended, but not required. If it's not present, all block devices will
be probed, which may significantly increase boot time.
+
If _luksdev_ is given, the specified key will only be applied for that LUKS
device. Possible values are the same as for _keydev_. Unless you have several
LUKS devices, you don't have to specify this parameter. The simplest usage is:
If _<luksdev>_ is given, the specified key will only be used for
the specified LUKS device. Possible values are the same as for
_<keydev>_. Unless you have several LUKS devices, you don't have to
specify this parameter. The simplest usage is:
+
[listing]
.Example
@ -307,28 +373,84 @@ rd.luks.key=/foo/bar.key
--
+
As you see, you can skip colons in such a case.
+

[NOTE]
===============================
dracut pipes key to cryptsetup with _-d -_ argument, therefore you need to pipe
to crypsetup luksFormat with _-d -_, too!
Your LUKS partition must match your key file.

Here follows example for key encrypted with GPG:
dracut provides keys to cryptsetup with _-d_ (an older alias for
_--key-file_). This uses the entire binary
content of the key file as part of the secret. If
you pipe a password into cryptsetup *without* _-d_ or _--key-file_,
it will be treated as text user input, and only characters before
the first newline will be used. Therefore, when you're creating
an encrypted partition for dracut to mount, and you pipe a key into
_cryptsetup luksFormat_,you must use _-d -_.

Here is an example for a key encrypted with GPG (warning:
_--batch-mode_ will overwrite the device without asking for
confirmation):

[listing]
--
gpg --quiet --decrypt rootkey.gpg | \
cryptsetup -d - -v --cipher serpent-cbc-essiv:sha256 \
--key-size 256 luksFormat /dev/sda3
cryptsetup --batch-mode --key-file - \
luksFormat /dev/sda47
--

If you use plain keys, just add path to _-d_ option:
If you use unencrypted key files, just use the key file pathname
instead of the standard input. For a random key with 256 bits of
entropy, you might use:

[listing]
--
cryptsetup -d rootkey.key -v --cipher serpent-cbc-essiv:sha256 \
--key-size 256 luksFormat /dev/sda3
head -32c /dev/urandom > rootkey.key
cryptsetup --batch-mode --key-file rootkey.key \
luksFormat /dev/sda47
--

You can also use regular key files on an encrypted _keydev_.

Compared to using GPG encrypted keyfiles on an unencrypted
device this provides the following advantages:

- you can unlock your disk(s) using multiple passphrases
- better security by not loosing the key stretching mechanism

To use an encrypted _keydev_ you *must* ensure that it becomes
available by using the keyword `keysource`, e.g.
`rd.luks.uuid=keysource:aaaa`
_aaaa_ being the uuid of the encrypted _keydev_.

Example:

Lets assume you have three disks _A_, _B_ and _C_ with the uuids
_aaaa_, _bbbb_ and _cccc_. +
You want to unlock _A_ and _B_ using keyfile _keyfile_. +
The unlocked volumes be _A'_, _B'_ and _C'_ with the uuids
_AAAA_, _BBBB_ and _CCCC_. +
_keyfile_ is saved on _C'_ as _/keyfile_.

One luks keyslot of each _A_, _B_ and _C_ is setup with a
passphrase. +
Another luks keyslot of each _A_ and _B_ is setup with _keyfile_.

To boot this configuration you could use:
[listing]
--
rd.luks.uuid=aaaa
rd.luks.uuid=bbbb
rd.luks.uuid=keysource:cccc
rd.luks.key=/keyfile:UUID=CCCC
--
Dracut asks for the passphrase for _C_ and uses the
keyfile to unlock _A_ and _B_. +
If getting the passphrase for _C_ fails it falls back to
asking for the passphrases for _A_ and _B_.

If you want _C'_ to stay unlocked, specify a luks name for
it, e.g. `rd.luks.name=cccc=mykeys`, otherwise it gets closed
when not needed anymore.
===============================

MD RAID
@ -362,6 +484,14 @@ 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

**rd.multipath=default**::
use default multipath settings

FIPS
~~~~
**rd.fips**::
@ -445,27 +575,43 @@ USB Android phone::
* enp0s29u1u2
=====================

**ip=**__{dhcp|on|any|dhcp6|auto6}__::
dhcp|on|any::: get ip from dhcp server from all interfaces. If root=dhcp,
The following options are supported by the 'network-legacy' dracut
module. Other network modules might support a slightly different set of
options; refer to the documentation of the specific network module in use. For
NetworkManager, see *nm-initrd-generator*(8).

**ip=**__{dhcp|on|any|dhcp6|auto6|either6|link6|single-dhcp}__::
dhcp|on|any::: get ip from dhcp server from all interfaces. If netroot=dhcp,
loop sequentially through all interfaces (eth0, eth1, ...) and use the first
with a valid DHCP root-path.

single-dhcp::: Send DHCP on all available interfaces in parallel, as
opposed to one after another. After the first DHCP response is received,
stop DHCP on all other interfaces. This gives the fastest boot time by
using the IP on interface for which DHCP succeeded first during early boot.
Caveat: Does not apply to Network Manager and to SUSE using wicked.

auto6::: IPv6 autoconfiguration

dhcp6::: IPv6 DHCP

**ip=**__<interface>__:__{dhcp|on|any|dhcp6|auto6}__[:[__<mtu>__][:__<macaddr>__]]::
either6::: if auto6 fails, then dhcp6

link6::: bring up interface for IPv6 link-local addressing

**ip=**__<interface>__:__{dhcp|on|any|dhcp6|auto6|link6}__[:[__<mtu>__][:__<macaddr>__]]::
This parameter can be specified multiple times.
+
=====================
dhcp|on|any|dhcp6::: get ip from dhcp server on a specific interface
auto6::: do IPv6 autoconfiguration
link6::: bring up interface for IPv6 link local address
<macaddr>::: optionally **set** <macaddr> on the <interface>. This
cannot be used in conjunction with the **ifname** argument for the
same <interface>.
=====================

**ip=**__<client-IP>__:[__<peer>__]:__<gateway-IP>__:__<netmask>__:__<client_hostname>__:__<interface>__:__{none|off|dhcp|on|any|dhcp6|auto6|ibft}__:[:[__<mtu>__][:__<macaddr>__]]::
**ip=**__<client-IP>__:[__<peer>__]:__<gateway-IP>__:__<netmask>__:__<client_hostname>__:__<interface>__:__{none|off|dhcp|on|any|dhcp6|auto6|ibft}__[:[__<mtu>__][:__<macaddr>__]]::
explicit network configuration. If you want do define a IPv6 address, put it
in brackets (e.g. [2001:DB8::1]). This parameter can be specified multiple
times. __<peer>__ is optional and is the address of the remote endpoint
@ -486,13 +632,26 @@ same <interface>.
number, encoding the network prefix length.

**ifname=**__<interface>__:__<MAC>__::
Assign network device name <interface> (ie "bootnet") to the NIC with
Assign network device name <interface> (i.e. "bootnet") to the NIC with
MAC <MAC>.
+
WARNING: Do **not** use the default kernel naming scheme for the interface name,
as it can conflict with the kernel names. So, don't use "eth[0-9]+" for the
interface name. Better name it "bootnet" or "bluesocket".

**rd.route=**__<net>__/__<netmask>__:__<gateway>__[:__<interface>__]::
Add a static route with route options, which are separated by a colon.
IPv6 addresses have to be put in brackets.
+
[listing]
.Example
--
rd.route=192.168.200.0/24:192.168.100.222:ens10
rd.route=192.168.200.0/24:192.168.100.222
rd.route=192.168.200.0/24::ens10
rd.route=[2001:DB8:3::/8]:[2001:DB8:2::1]:ens10
--

**bootdev=**__<interface>__::
specify network interface to use routing and netroot information from.
Required if multiple ip= lines are used.
@ -506,6 +665,9 @@ interface name. Better name it "bootnet" or "bluesocket".
**nameserver=**__<IP>__ [**nameserver=**__<IP>__ ...]::
specify nameserver(s) to use

**rd.peerdns=0**::
Disable DNS setting of DHCP parameters.

**biosdevname=0**::
boolean, turn off biosdevname network interface renaming

@ -513,23 +675,28 @@ interface name. Better name it "bootnet" or "bluesocket".
boolean, bring up network even without netroot set

**vlan=**__<vlanname>__:__<phydevice>__::
Setup vlan device named <vlanname> on <phydeivce>.
Setup vlan device named <vlanname> on <phydevice>.
We support the four styles of vlan names: VLAN_PLUS_VID (vlan0005),
VLAN_PLUS_VID_NO_PAD (vlan5), DEV_PLUS_VID (eth0.0005),
DEV_PLUS_VID_NO_PAD (eth0.5)

**bond=**__<bondname>__[:__<bondslaves>__:[:__<options>__]]::
**bond=**__<bondname>__[:__<bondslaves>__:[:__<options>__[:<mtu>]]]::
Setup bonding device <bondname> on top of <bondslaves>.
<bondslaves> is a comma-separated list of physical (ethernet) interfaces.
<options> is a comma-separated list on bonding options (modinfo bonding for
details) in format compatible with initscripts. If <options> includes
multi-valued arp_ip_target option, then its values should be separated by
semicolon. Bond without parameters assumes
semicolon. if the mtu is specified, it will be set on the bond master.
Bond without parameters assumes
bond=bond0:eth0,eth1:mode=balance-rr

**team=**__<teammaster>__:__<teamslaves>__::
**team=**__<teammaster>__:__<teamslaves>__[:__<teamrunner>__]::
Setup team device <teammaster> on top of <teamslaves>.
<teamslaves> is a comma-separated list of physical (ethernet) interfaces.
<teamrunner> is the runner type to be used (see *teamd.conf*(5)); defaults to
activebackup.
Team without parameters assumes
team=team0:eth0,eth1:activebackup

**bridge=**__<bridgename>__:__<ethnames>__::
Setup bridge <bridgename> with <ethnames>. <ethnames> is a comma-separated
@ -540,12 +707,12 @@ NFS
~~~
**root=**\[_<server-ip>_:]__<root-dir>__[:__<nfs-options>__]::
mount nfs share from <server-ip>:/<root-dir>, if no server-ip is given, use
dhcp next_server. if server-ip is an IPv6 address it has to be put in
dhcp next_server. If server-ip is an IPv6 address it has to be put in
brackets, e.g. [2001:DB8::1]. NFS options can be appended with the prefix
":" or "," and are seperated by ",".
":" or "," and are separated by ",".

**root=**nfs:\[_<server-ip>_:]__<root-dir>__[:__<nfs-options>__], **root=**nfs4:\[_<server-ip>_:]__<root-dir>__[:__<nfs-options>__], **root=**__{dhcp|dhcp6}__::
root=dhcp alone directs initrd to look at the DHCP root-path where NFS
netroot=dhcp alone directs initrd to look at the DHCP root-path where NFS
options can be specified.
+
[listing]
@ -561,7 +728,32 @@ NFS
method. This is supported by dracut, but not recommended.

**rd.nfs.domain=**__<NFSv4 domain name>__::
Set the NFSv4 domain name. Will overwrite the settings in _/etc/idmap.conf_.
Set the NFSv4 domain name. Will override the settings in _/etc/idmap.conf_.

**rd.net.dhcp.retry=**__<cnt>__::
If this option is set, dracut will try to connect via dhcp <cnt> times before failing.
Default is 1.

**rd.net.timeout.dhcp=**__<arg>__::
If this option is set, dhclient is called with "-timeout <arg>".

**rd.net.timeout.iflink=**__<seconds>__::
Wait <seconds> until link shows up. Default is 60 seconds.

**rd.net.timeout.ifup=**__<seconds>__::
Wait <seconds> until link has state "UP". Default is 20 seconds.

**rd.net.timeout.route=**__<seconds>__::
Wait <seconds> until route shows up. Default is 20 seconds.

**rd.net.timeout.ipv6dad=**__<seconds>__::
Wait <seconds> until IPv6 DAD is finished. Default is 50 seconds.

**rd.net.timeout.ipv6auto=**__<seconds>__::
Wait <seconds> until IPv6 automatic addresses are assigned. Default is 40 seconds.

**rd.net.timeout.carrier=**__<seconds>__::
Wait <seconds> until carrier is recognized. Default is 10 seconds.

CIFS
~~~
@ -650,6 +842,9 @@ You may want to use rd.iscsi.firmware.
**root=**_???_ **netroot=**iscsi **rd.iscsi.firmware=1**::
will read the iscsi parameter from the BIOS firmware

**rd.iscsi.login_retry_max=**__<num>__::
maximum number of login retries

**rd.iscsi.param=**__<param>__::
<param> will be passed as "--param <param>" to iscsistart.
This parameter can be specified multiple times.
@ -670,24 +865,63 @@ iscsistart -b --param node.session.timeo.replacement_timeout=30
**rd.iscsi.ibft** **rd.iscsi.ibft=1**:
Turn on iBFT autoconfiguration for the interfaces

**rd.iscsi.mp** **rd.iscsi.mp=1**:
Configure all iBFT interfaces, not only used for booting (multipath)

**rd.iscsi.waitnet=0**:
Turn off waiting for all interfaces to be up before trying to login to the iSCSI targets.

**rd.iscsi.testroute=0**:
Turn off checking, if the route to the iSCSI target IP is possible before trying to login.

FCoE
~~~~
**fcoe=**__<edd|interface|MAC>__:__{dcb|nodcb}__::
**rd.fcoe=0**::
disable FCoE and lldpad

**fcoe=**__<edd|interface|MAC>__:__{dcb|nodcb}__:__{fabric|vn2vn}__::
Try to connect to a FCoE SAN through the NIC specified by _<interface>_ or
_<MAC>_ or EDD settings. For the second argument, currently only nodcb is
supported. This parameter can be specified multiple times.
_<MAC>_ or EDD settings. The second argument specifies if DCB
should be used. The optional third argument specifies whether
fabric or VN2VN mode should be used.
This parameter can be specified multiple times.
+
NOTE: letters in the MAC-address must be lowercase!

NVMf
~~~~
**rd.nvmf.hostnqn=**__<hostNQN>__::
NVMe host NQN to use

**rd.nvmf.hostid=**__<hostID>__::
NVMe host id to use

**rd.nvmf.discover=**__{rdma|fc|tcp}__,__<traddr>__,[__<host_traddr>__],[__<trsvcid>__]::
Discover and connect to a NVMe-over-Fabric controller specified by
_<traddr>_ and the optionally _<host_traddr>_ or _<trsvcid>_.
The first argument specifies the transport to use; currently only
'rdma', 'fc', or 'tcp' are supported.
The _<traddr>_ parameter can be set to 'auto' to select
autodiscovery; in that case all other parameters are ignored.
This parameter can be specified multiple times.

NBD
~~~
**root=**??? **netroot=**nbd:__<server>__:__<port>__[:__<fstype>__[:__<mountopts>__[:__<nbdopts>__]]]::
mount nbd share from <server>
**root=**??? **netroot=**nbd:__<server>__:__<port/exportname>__[:__<fstype>__[:__<mountopts>__[:__<nbdopts>__]]]::
mount nbd share from <server>.
+
NOTE:
If "exportname" instead of "port" is given the standard port is used.
Newer versions of nbd are only supported with "exportname".

**root=dhcp** with **dhcp** **root-path=**nbd:__<server>__:__<port>__[:__<fstype>__[:__<mountopts>__[:__<nbdopts>__]]]::
root=dhcp alone directs initrd to look at the DHCP root-path where NBD
**root=/dev/root netroot=dhcp** with **dhcp** **root-path=**nbd:__<server>__:__<port/exportname>__[:__<fstype>__[:__<mountopts>__[:__<nbdopts>__]]]::
netroot=dhcp alone directs initrd to look at the DHCP root-path where NBD
options can be specified. This syntax is only usable in cases where you are
directly mounting the volume as the rootfs.
+
NOTE:
If "exportname" instead of "port" is given the standard port is used.
Newer versions of nbd are only supported with "exportname".

DASD
~~~~
@ -697,12 +931,19 @@ DASD
ZFCP
~~~~
**rd.zfcp=**__<zfcp adaptor device bus ID>__,__<WWPN>__,__<FCPLUN>__::
rd.zfcp can be specified multiple times on the kernel command line.
rd.zfcp can be specified multiple times on the kernel command
line.

**rd.zfcp=**__<zfcp adaptor device bus ID>__::
If NPIV is enabled and the 'allow_lun_scan' parameter to the zfcp
module is set to 'Y' then the zfcp adaptor will be initiating a
scan internally and the <WWPN> and <FCPLUN> parameters can be omitted.
+
[listing]
.Example
--
rd.zfcp=0.0.4000,0x5005076300C213e9,0x5022000000000000
rd.zfcp=0.0.4000
--

**rd.zfcp.conf=0**::
@ -711,7 +952,15 @@ rd.zfcp=0.0.4000,0x5005076300C213e9,0x5022000000000000
ZNET
~~~~
**rd.znet=**__<nettype>__,__<subchannels>__,__<options>__::
The whole parameter is appended to /etc/ccw.conf, which is used on
RHEL/Fedora with ccw_init, which is called from udev for certain
devices on z-series.
rd.znet can be specified multiple times on the kernel command line.

**rd.znet_ifname=**__<ifname>__:__<subchannels>__::
Assign network device name <interface> (i.e. "bootnet") to the NIC
corresponds to the subchannels. This is useful when dracut's default
"ifname=" doesn't work due to device having a changing MAC address.
+
[listing]
.Example
@ -720,10 +969,253 @@ rd.znet=qeth,0.0.0600,0.0.0601,0.0.0602,layer2=1,portname=foo
rd.znet=ctc,0.0.0600,0.0.0601,protocol=bar
--

Booting live images
~~~~~~~~~~~~~~~~~~~
Dracut offers multiple options for live booted images:

=====================
SquashFS with read-only filesystem image::: The system will boot with a
read-only filesystem from the SquashFS and apply a writable Device-mapper
snapshot or an OverlayFS overlay mount for the read-only base filesystem. This
method ensures a relatively fast boot and lower RAM usage. Users **must be
careful** to avoid writing too many blocks to a snapshot volume. Once the
blocks of the snapshot overlay are exhausted, the root filesystem becomes
read-only and may cause application failures. The snapshot overlay file is
marked 'Overflow', and a difficult recovery is required to repair and enlarge
the overlay offline. Non-persistent overlays are sparse files in RAM that only
consume content space as required blocks are allocated. They default to an
apparent size of 32 GiB in RAM. The size can be adjusted with the
**rd.live.overlay.size=** kernel command line option.
+
The filesystem structure is traditionally expected to be:
+
[listing]
--
squashfs.img | SquashFS from LiveCD .iso
!(mount)
/LiveOS
|- rootfs.img | Filesystem image to mount read-only
!(mount)
/bin | Live filesystem
/boot |
/dev |
... |
--
+
For OverlayFS mount overlays, the filesystem structure may also be a direct
compression of the root filesystem:
+
[listing]
--
squashfs.img | SquashFS from LiveCD .iso
!(mount)
/bin | Live filesystem
/boot |
/dev |
... |
--
+
Dracut uses one of the overlay methods of live booting by default. No
additional command line options are required other than **root=live:<URL>** to
specify the location of your squashed filesystem.
+
- The compressed SquashFS image can be copied during boot to RAM at
`/run/initramfs/squashed.img` by using the **rd.live.ram=1** option.
- A device with a persistent overlay can be booted read-only by using the
**rd.live.overlay.readonly** option on the kernel command line. This will
either cause a temporary, writable overlay to be stacked over a read-only
snapshot of the root filesystem or the OverlayFS mount will use an additional
lower layer with the root filesystem.
+
Uncompressed live filesystem image:::
When the live system was installed with the '--skipcompress' option of the
__livecd-iso-to-disk__ installation script for Live USB devices, the root
filesystem image, __rootfs.img__, is expanded on installation and no SquashFS
is involved during boot.
+
- If **rd.live.ram=1** is used in this situation, the full, uncompressed
root filesystem is copied during boot to `/run/initramfs/rootfs.img` in the
`/run` tmpfs.
+
- If **rd.live.overlay=none** is provided as a kernel command line option,
a writable, linear Device-mapper target is created on boot with no overlay.

Writable filesystem image:::
The system will retrieve a compressed filesystem image, extract it to
`/run/initramfs/fsimg/rootfs.img`, connect it to a loop device, create a
writable, linear Device-mapper target at `/dev/mapper/live-rw`, and mount that
as a writable volume at `/`. More RAM is required during boot but the live
filesystem is easier to manage if it becomes full. Users can make a filesystem
image of any size and that size will be maintained when the system boots. There
is no persistence of root filesystem changes between boots with this option.
+
The filesystem structure is expected to be:
+
[listing]
--
rootfs.tgz | Compressed tarball containing filesystem image
!(unpack)
/rootfs.img | Filesystem image at /run/initramfs/fsimg/
!(mount)
/bin | Live filesystem
/boot |
/dev |
... |
--
+
To use this boot option, ensure that **rd.writable.fsimg=1** is in your kernel
command line and add the **root=live:<URL>** to specify the location
of your compressed filesystem image tarball or SquashFS image.
=====================

**rd.writable.fsimg=**1::
Enables writable filesystem support. The system will boot with a fully
writable (but non-persistent) filesystem without snapshots __(see notes above
about available live boot options)__. You can use the **rootflags** option to
set mount options for the live filesystem as well __(see documentation about
rootflags in the **Standard** section above)__.
This implies that the whole image is copied to RAM before the boot continues.
+
NOTE: There must be enough free RAM available to hold the complete image.
+
This method is very suitable for diskless boots.

**root=**live:__<url>__::
Boots a live image retrieved from __<url>__. Requires the dracut 'livenet'
module. Valid handlers: __http, https, ftp, torrent, tftp__.
+
[listing]
.Examples
--
root=live:http://example.com/liveboot.img
root=live:ftp://ftp.example.com/liveboot.img
root=live:torrent://example.com/liveboot.img.torrent
--

**rd.live.debug=**1::
Enables debug output from the live boot process.

**rd.live.dir=**__<path>__::
Specifies the directory within the boot device where the squashfs.img or
rootfs.img can be found. By default, this is `/LiveOS`.

**rd.live.squashimg=**__<filename of SquashFS image>__::
Specifies the filename for a SquashFS image of the root filesystem.
By default, this is __squashfs.img__.

**rd.live.ram=**1::
Copy the complete image to RAM and use this for booting. This is useful
when the image resides on, e.g., a DVD which needs to be ejected later on.

**rd.live.overlay={**__<devspec>__[:__{<pathspec>|auto}__]|__none__}::
Manage the usage of a permanent overlay.
+
--
* _<devspec>_ specifies the path to a device with a mountable filesystem.
* _<pathspec>_ is the path to a file within that filesystem, which shall be
used to persist the changes made to the device specified by the
**root=live:__<url>__** option.
+
The default _pathspec_, when _auto_ or no _:<pathspec>_ is given, is
`/<rd.live.dir>/overlay-<label>-<uuid>`, where _<label>_ is the
device LABEL, and _<uuid>_ is the device UUID.
* _none_ (the word itself) specifies that no overlay will be used, such as when
an uncompressed, writable live root filesystem is available.
+
If a persistent overlay __is detected__ at the standard LiveOS path, the
overlay & overlay type detected, whether Device-mapper or OverlayFS, will be
used.
--
+
[listing]
.Examples
--
rd.live.overlay=/dev/sdb1:persistent-overlay.img
rd.live.overlay=UUID=99440c1f-8daa-41bf-b965-b7240a8996f4
--

**rd.live.overlay.size=**__<size_MiB>__::
Specifies a non-persistent Device-mapper overlay size in MiB. The default is
_32768_.

**rd.live.overlay.readonly=**1::
This is used to boot with a normally read-write persistent overlay in a
read-only mode. With this option, either an additional, non-persistent,
writable snapshot overlay will be stacked over a read-only snapshot,
`/dev/mapper/livero`, of the base filesystem with the persistent overlay, or a
read-only loop device, in the case of a writable __rootfs.img__, or an OverlayFS
mount will use the persistent overlay directory linked at `/run/overlayfsr` as
an additional lower layer along with the base root filesystem and apply a
transient, writable upper directory overlay, in order to complete the booted
root filesystem.

**rd.live.overlay.reset=**1::
Specifies that a persistent overlay should be reset on boot. All previous root
filesystem changes are vacated by this action.

**rd.live.overlay.thin=**1::
Enables the usage of thin snapshots instead of classic dm snapshots.
The advantage of thin snapshots is that they support discards, and will free
blocks that are not claimed by the filesystem. In this use case, this means
that memory is given back to the kernel when the filesystem does not claim it
anymore.

**rd.live.overlay.overlayfs=**1::
Enables the use of the *OverlayFS* kernel module, if available, to provide a
copy-on-write union directory for the root filesystem. OverlayFS overlays are
directories of the files that have changed on the read-only base (lower)
filesystem. The root filesystem is provided through a special overlay type
mount that merges the lower and upper directories. If an OverlayFS upper
directory is not present on the boot device, a tmpfs directory will be created
at `/run/overlayfs` to provide temporary storage. Persistent storage can be
provided on vfat or msdos formatted devices by supplying the OverlayFS upper
directory within an embedded filesystem that supports the creation of trusted.*
extended attributes and provides a valid d_type in readdir responses, such as
with ext4 and xfs. On non-vfat-formatted devices, a persistent OverlayFS
overlay can extend the available root filesystem storage up to the capacity of
the LiveOS disk device.
+
If a persistent overlay is detected at the standard LiveOS path, the overlay &
overlay type detected, whether OverlayFS or Device-mapper, will be used.
+
The **rd.live.overlay.readonly** option, which allows a persistent overlayfs to
be mounted read-only through a higher level transient overlay directory, has
been implemented through the multiple lower layers feature of OverlayFS.


ZIPL
~~~~
**rd.zipl=**__<path to blockdevice>__::
Update the dracut commandline with the values found in the
_dracut-cmdline.conf_ file on the given device.
The values are merged into the existing commandline values
and the udev events are regenerated.
+
[listing]
.Example
--
rd.zipl=UUID=0fb28157-99e3-4395-adef-da3f7d44835a
--

CIO_IGNORE
~~~~~~~~~~
**rd.cio_accept=**__<device-ids>__::
Remove the devices listed in <device-ids> from the default
cio_ignore kernel command-line settings.
<device-ids> is a list of comma-separated CCW device ids.
The default for this value is taken from the
_/boot/zipl/active_devices.txt_ file.
+
[listing]
.Example
--
rd.cio_accept=0.0.0180,0.0.0800,0.0.0801,0.0.0802
--

Plymouth Boot Splash
~~~~~~~~~~~~~~~~~~~~
**plymouth.enable=0**::
disable the plymouth bootsplash completly.
disable the plymouth bootsplash completely.

**rd.plymouth=0**::
disable the plymouth bootsplash only for the initramfs.
@ -773,7 +1265,8 @@ their new replacement.

rdbreak:: rd.break

rd_CCW:: rd.ccw
rd.ccw:: rd.znet
rd_CCW:: rd.znet

rd_DASD_MOD:: rd.dasd

@ -841,6 +1334,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

@ -3,6 +3,7 @@ DRACUT.CONF(5)
:doctype: manpage
:man source: dracut
:man manual: dracut
:man version: {version}

NAME
----
@ -10,35 +11,40 @@ dracut.conf - configuration file(s) for dracut

SYNOPSIS
--------
_/etc/dracut.conf_ _/etc/dracut.conf.d/*.conf_
_/etc/dracut.conf_
_/etc/dracut.conf.d/\*.conf_
_/usr/lib/dracut/dracut.conf.d/*.conf_

Description
-----------
_dracut.conf_ is loaded during the initialisation phase of dracut. Command line
parameter will overwrite any values set here.
parameter will override any values set here.

_*.conf_ files are read from /usr/lib/dracut/dracut.conf.d and
/etc/dracut.conf.d. Files with the same name in /etc/dracut.conf.d will replace
files in /usr/lib/dracut/dracut.conf.d.
The files are then read in alphanumerical order and will overwrite parameters
The files are then read in alphanumerical order and will override parameters
set in _/etc/dracut.conf_. Each line specifies an attribute and a value. A '#'
indicates the beginning of a comment; following characters, up to the end of the
line are not interpreted.

dracut command line options will overwrite any values set here.
dracut command line options will override any values set here.

Configuration files must have the extension .conf; other extensions are ignored.

*add_dracutmodules+=*" __<dracut modules>__ "::
Add a space-separated list of dracut modules to call when building the
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.

*dracutmodules+=*" __<dracut modules>__ "::
Specify a space-separated list of dracut modules to call when building the
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.
This option forces dracut to only include the specified dracut modules.
In most cases the "add_dracutmodules" option is what you want to use.

*omit_dracutmodules+=*" __<dracut modules>__ "::
Omit a space-separated list of dracut modules.

*add_dracutmodules+=*" __<dracut modules>__ "::
Add a space-separated list of dracut modules.
Omit a space-separated list of dracut modules to call when building the
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.

*drivers+=*" __<kernel modules>__ "::
Specify a space-separated list of kernel modules to exclusively include in
@ -49,6 +55,10 @@ Configuration files must have the extension .conf; other extensions are ignored.
Specify a space-separated list of kernel modules to add to the initramfs.
The kernel modules have to be specified without the ".ko" suffix.

*force_drivers+=*" __<list of kernel modules>__ "::
See add_drivers above. But in this case it is ensured that the drivers
are tried to be loaded early via modprobe.

*omit_drivers+=*" __<kernel modules>__ "::
Specify a space-separated list of kernel modules not to add to the
initramfs. The kernel modules have to be specified without the ".ko" suffix.
@ -66,18 +76,27 @@ Configuration files must have the extension .conf; other extensions are ignored.
*install_items+=*" __<file>__[ __<file>__ ...] "::
Specify additional files to include in the initramfs, separated by spaces.

*install_optional_items+=*" __<file>__[ __<file>__ ...] "::
Specify additional files to include in the initramfs, separated by spaces,
if they exist.

*compress=*"__{cat|bzip2|lzma|xz|gzip|lzo|lz4|zstd|<compressor [args ...]>}__"::
Compress the generated initramfs using the passed compression program. If
you pass it just the name of a compression program, it will call that
program with known-working arguments. If you pass arguments, it will be called
with exactly those arguments. Depending on what you pass, this may result in
an initramfs that the kernel cannot decompress.
To disable compression, use "cat".

*do_strip=*"__{yes|no}__"::
Strip binaries in the initramfs (default=yes)

*do_prelink=*"__{yes|no}__"::
Prelink binaries in the initramfs (default=yes)

*hostonly=*"__{yes|no}__"::
Host-Only mode: Install only what is needed for booting the local host
instead of a generic host and generate host-specific configuration.

*hostonly_cmdline*"__{yes|no}__"::
If set, store the kernel command line arguments needed in the initramfs
*hostonly_cmdline=*"__{yes|no}__"::
If set to "yes", store the kernel command line arguments needed in the initramfs

*persistent_policy=*"__<policy>__"::
Use _<policy>_ to address disks and partitions.
@ -140,14 +159,14 @@ provide a valid _/etc/fstab_.
archive. This cpio archive gets glued (concatenated, uncompressed one
must be the first one) to the compressed cpio archive. The first,
uncompressed cpio archive is for data which the kernel must be able
to access very early (and cannot make use of uncompress alogrithms yet)
to access very early (and cannot make use of uncompress algorithms yet)
like microcode or ACPI tables (default=no).

*acpi_table_dir=*"__<dir>__"::
Directory to search for ACPI tables if acpi_override= is set to yes.

*early_microcode=*"{yes|no}"::
Combine early microcode with ramdisk (default=no)
Combine early microcode with ramdisk (default=yes)

*stdloglvl*="__\{0-6\}__"::
Set logging to standard error level.
@ -164,17 +183,39 @@ provide a valid _/etc/fstab_.
*show_modules=*"__{yes|no}__"::
Print the name of the included modules to standard output during build.

*i18n_vars="__<variable mapping>__"::
*i18n_vars=*"__<variable mapping>__"::
Distribution specific variable mapping.
See dracut/modules.d/10i18n/README for a detailed description.

*i18n_default_font=*"__<fontname>__"::
The font <fontname> to install, if not specified otherwise.
Default is "LatArCyrHeb-16".
Default is "eurlatgr".

*i18n_install_all=*"__{yes|no}__"::
Install everything regardless of generic or hostonly mode.

*reproducible=*"__{yes|no}__"::
Create reproducible images.

*loginstall=*"__<DIR>__"::
Log all files installed from the host to _<DIR>_.

*uefi_stub=*"_<FILE>_"::
Specifies the UEFI stub loader, which will load the attached kernel, initramfs and
kernel command line and boots the kernel. The default is
_/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_

*uefi_splash_image=*"_<FILE>_"::
Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**) image format.

*uefi_secureboot_cert=*"_<FILE>_", *uefi_secureboot_key=*"_<FILE>_"::
Specifies a certificate and corresponding key, which are used to sign the created UEFI executable.
Requires both certificate and key need to be specified and _sbsign_ to be installed.

*kernel_image=*"_<FILE>_"::
Specifies the kernel image, which to include in the UEFI executable. The default is
_/lib/modules/<KERNEL-VERSION>/vmlinuz_ or _/boot/vmlinuz-<KERNEL-VERSION>_

Files
-----
_/etc/dracut.conf_::
@ -182,7 +223,7 @@ _/etc/dracut.conf_::
_/etc/dracut.conf.d/_.

_/etc/dracut.conf.d/_::
Any _/etc/dracut.conf.d/*.conf_ file can overwrite the values in
Any _/etc/dracut.conf.d/*.conf_ file can override the values in
_/etc/dracut.conf_. The configuration files are read in alphanumerical
order.

View File

@ -3,6 +3,7 @@ DRACUT.MODULES(7)
:doctype: manpage
:man source: dracut
:man manual: dracut
:man version: {version}

NAME
----
@ -19,7 +20,7 @@ you can replace init with your own version of _99base_, this is not encouraged.
Instead you should use, if possible, the hooks of dracut. All hooks, and the
point of time in which they are executed, are described in <<stages>>.

The main script, which creates the initramfs is dracut itsself. It parses all
The main script, which creates the initramfs is dracut itself. It parses all
arguments and sets up the directory, in which everything is installed. It then
executes all check, install, installkernel scripts found in the modules, which
are to be processed. After everything is installed, the install directory is
@ -92,18 +93,23 @@ udev state.

==== Initqueue settled

This hooks (initqueue/settled) gets executed every time udev has settled.
This hook (initqueue/settled) gets executed every time udev has settled.

==== Initqueue timeout

This hooks (initqueue/timeout) gets executed, when the main loop counter becomes
This hook (initqueue/timeout) gets executed, when the main loop counter becomes
half of the rd.retry counter.

==== Initqueue online

This hook (initqueue/online) gets executed whenever a network interface comes online
(that is, once it is up and configured by the configured network module).

==== Initqueue finished

This hook (initqueue/finished) is called after udev has settled and
if all scripts herein return 0 the main loop will be ended.
Abritary scripts can be added here, to loop in the
Arbitrary scripts can be added here, to loop in the
initqueue until something happens, which a dracut module wants to wait for.

=== Hook: pre-mount
@ -145,8 +151,8 @@ FIXME

== Writing a Module

A simple example module is _96insmodpost_, which modprobes a kernel module after
udev has settled and the basic device drivers have been loaded.
A simple example module is _90kernel-modules_, which modprobes a kernel module
after udev has settled and the basic device drivers have been loaded.

All module installation information is in the file module-setup.sh.

@ -158,7 +164,7 @@ check():
return 0
----

The we create the install() function, which installs a cmdline hook with
Then we create the install() function, which installs a cmdline hook with
priority number 20 called _parse-insmodpost.sh_. It also installs the
_insmodpost.sh_ script in _/sbin_.

@ -168,7 +174,7 @@ inst_hook cmdline 20 "$moddir/parse-insmodpost.sh"
inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh
----

The _pase-instmodpost.sh_ parses the kernel command line for a argument
The _parse-instmodpost.sh_ parses the kernel command line for a argument
rd.driver.post, blacklists the module from being autoloaded and installs the
hook _insmodpost.sh_ in the _initqueue/settled_.

@ -212,7 +218,7 @@ check() should return with:

0:: Include the dracut module in the initramfs.

1:: Do not include the dracut module. The requirements are not fullfilled
1:: Do not include the dracut module. The requirements are not fulfilled
(missing tools, etc.)

255:: Only include the dracut module, if another module requires it or if
@ -255,7 +261,9 @@ not lead to an error.
==== inst <src> [<dst>]

installs _one_ file <src> either to the same place in the initramfs or to an
optional <dst>.
optional <dst>. inst with more than two arguments is treated the same as
inst_multiple, all arguments are treated as files to install and none as
install destinations.

==== inst_hook <hookdir> <prio> <src>

@ -264,7 +272,7 @@ installs an executable/script <src> in the dracut hook <hookdir> with priority

==== inst_rules <udevrule> [ <udevrule> ...]

installs one ore more udev rules. Non-existant udev rules are reported, but do
installs one or more udev rules. Non-existant udev rules are reported, but do
not let dracut fail.

==== instmods <kernelmodule> [ <kernelmodule> ... ]

View File

@ -62,7 +62,7 @@ _/etc/dracut.conf_ or _/etc/dracut.conf.d/myconf.conf_. See *dracut.conf*(5).
You can also add dracut modules on the command line
by using the -a or --add option:
----
# dracut --add bootchart initramfs-bootchart.img
# dracut --add module initramfs-module.img
----

To see a list of available dracut modules, use the --list-modules option:
@ -83,7 +83,7 @@ on the command line:
=== Adding Kernel Modules
If you need a special kernel module in the initramfs, which is not
automatically picked up by dracut, you have the use the --add-drivers option
on the command line or the drivers vaiable in the _/etc/dracut.conf_
on the command line or the drivers variable in the _/etc/dracut.conf_
or _/etc/dracut.conf.d/myconf.conf_ configuration file (see *dracut.conf*(5)):
----
# dracut --add-drivers mymod initramfs-with-mymod.img
@ -94,15 +94,11 @@ An initramfs generated without the "hostonly" mode, does not contain any system
configuration files (except for some special exceptions), so the configuration
has to be done on the kernel command line. With this flexibility, you can easily
boot from a changed root partition, without the need to recompile the initramfs
image. So, you could completly change your root partition (move it inside a md
image. So, you could completely change your root partition (move it inside a md
raid with encryption and LVM on top), as long as you specify the correct
filesystem LABEL or UUID on the kernel command line for your root device, dracut
will find it and boot from it.

The kernel command line usually can be configured in _/boot/grub/grub.conf_ or
_/boot/grub2/grub.cfg_, if grub is your bootloader and it also can be edited in
the real boot process in the grub menu.

The kernel command line can also be provided by the dhcp server with the
root-path option. See <<NetworkBoot>>.

@ -155,9 +151,9 @@ If your root partition is on the network see <<NetworkBoot>>.
If you have to input passwords for encrypted disk volumes, you might want to set
the keyboard layout and specify a display font.

A typical german kernel command would contain:
A typical german kernel command line would contain:
----
rd.vconsole.font=latarcyrheb-sun16 rd.vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8
rd.vconsole.font=eurlatgr rd.vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8
----

Setting these options can override the setting stored on your system, if you use
@ -189,7 +185,7 @@ This turns off every automatic assembly of LVM, MD raids, DM raids and
crypto LUKS.

Of course, you could also omit the dracut modules in the initramfs creation
process, but then you would lose the posibility to turn it on on demand.
process, but then you would lose the possibility to turn it on on demand.


[[Injecting]]
@ -209,7 +205,7 @@ be specified once.
----
# mkdir -p rd.live.overlay/etc/cmdline.d
# mkdir -p rd.live.overlay/etc/conf.d
# echo "ip=auto" >> rd.live.overlay/etc/cmdline.d/mycmdline.conf
# echo "ip=dhcp" >> rd.live.overlay/etc/cmdline.d/mycmdline.conf
# echo export FOO=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
# echo export BAR=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
# tree rd.live.overlay/
@ -246,23 +242,8 @@ 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 Storage Administration Guide].

If you specify ip=auto 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
If you specify ip=dhcp on the kernel command line, then dracut asks a dhcp
server about the ip address for the machine. The dhcp server can also serve an
additional root-path, which will set the root device for dracut. With this
mechanism, you have static configuration on your client machine and a
centralized boot configuration on your TFTP/DHCP server. If you can't pass a
@ -271,7 +252,7 @@ method described in <<Injecting>>.

==== Reducing the Image Size

To reduce the size of the initramfs, you should create it with by ommitting all
To reduce the size of the initramfs, you should create it with by omitting all
dracut modules, which you know, you don't need to boot the machine.

You can also specify the exact dracut and kernel modules to produce a very tiny
@ -281,7 +262,7 @@ For example for a NFS image, you would do:


----
# dracut -m "nfs network base" initramfs-nfs-only.img
# dracut -m "nfs network base" initramfs-nfs-only.img
----

Then you would boot from this image with your target machine and reduce the size
@ -300,7 +281,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]]
@ -325,7 +306,7 @@ stick and mount that. Then you can store the output for later inspection.
In all cases, the following should be mentioned and attached to your bug report:

* The exact kernel command-line used. Typically from the bootloader
configuration file (e.g. _/etc/grub.conf_) or from _/proc/cmdline_.
configuration file (e.g. _/boot/grub2/grub.cfg_) or from _/proc/cmdline_.
* A copy of your disk partition information from _/etc/fstab_, which might be
obtained booting an old working initramfs or a rescue medium.
* Turn on dracut debugging (see _the 'debugging dracut' section_), and attach
@ -360,7 +341,7 @@ logging during the system boot. This section documents configuring a
serial console connection to record boot messages.

. First, enable serial console output for both the kernel and the bootloader.
. Open the file _/etc/grub.conf_ for editing. Below the line ''timeout=5'', add
. Open the file _/boot/grub2/grub.cfg_ for editing. Below the line ''timeout=5'', add
the following:
+
----
@ -368,14 +349,14 @@ serial --unit=0 --speed=9600
terminal --timeout=5 serial console
----
+
. Also in _/etc/grub.conf_, add the following boot arguemnts to the ''kernel''
. Also in _/boot/grub2/grub.cfg_, add the following boot arguments to the ''kernel''
line:
+
----
console=tty0 console=ttyS0,9600
----
+
. When finished, the _/etc/grub.conf_ file should look similar to the example
. When finished, the _/boot/grub2/grub.cfg_ file should look similar to the example
below.
+
----
@ -410,10 +391,10 @@ dracut offers a shell for interactive debugging in the event dracut fails to
locate your root filesystem. To enable the shell:

. Add the boot parameter ''rd.shell'' to your bootloader configuration file
(e.g. _/etc/grub.conf_)
(e.g. _/boot/grub2/grub.cfg_)
. Remove the boot arguments ''rhgb'' and ''quiet''
+
A sample _/etc/grub.conf_ bootloader configuration file is listed below.
A sample _/boot/grub2/grub.cfg_ bootloader configuration file is listed below.
+
----
default=0
@ -528,7 +509,7 @@ on _pre-shutdown_ or _shutdown_.
To do this from an already booted system:
----
# mkdir -p /run/initramfs/etc/cmdline.d
# echo "rd.break=pre-shutdown" > /run/initramfs/etc/cmdline.d/debug.conf
# echo "rd.debug rd.break=pre-shutdown rd.break=shutdown" > /run/initramfs/etc/cmdline.d/debug.conf
# touch /run/initramfs/.need_shutdown
----

View File

@ -3,6 +3,7 @@ LSINITRD(1)
:doctype: manpage
:man source: dracut
:man manual: dracut
:man version: {version}

NAME
----
@ -34,6 +35,21 @@ OPTIONS
**-k, --kver** _<kernel version>_::
inspect the initramfs of <kernel version>.

**-m, --mod**::
list dracut modules included of the initramfs image.

**--unpack**::
unpack the initramfs to the current directory, instead of displaying the contents.
If optional filenames are given, will only unpack specified files, else the whole image will be unpacked.
Won't unpack anything from early cpio part.

**--unpackearly**::
unpack the early microcode initramfs to the current directory, instead of displaying the contents.
Same as --unpack, but only unpack files from early cpio part.

**-v, --verbose**::
unpack verbosely

AVAILABILITY
------------
The lsinitrd command is part of the dracut package and is available from

View File

@ -1,226 +0,0 @@
#!/bin/bash --norc
kver=$(uname -r)

boot_dir="/boot"
quiet=0
host_only=0
force=0

error() { echo "$@" >&2; }

usage () {
[[ $1 = '-n' ]] && cmd=echo || cmd=error

$cmd "usage: ${0##*/} [--version] [--help] [-v] [-f] [--preload <module>]"
$cmd " [--image-version] [--with=<module>]"
$cmd " [--nocompress]"
$cmd " <initrd-image> <kernel-version>"
$cmd ""
$cmd " (ex: ${0##*/} /boot/initramfs-$kver.img $kver)"

[[ $1 = '-n' ]] && exit 0
exit 1
}

# Little helper function for reading args from the commandline.
# it automatically handles -a b and -a=b variants, and returns 1 if
# we need to shift $3.
read_arg() {
# $1 = arg name
# $2 = arg value
# $3 = arg parameter
param="$1"
local rematch='^[^=]*=(.*)$' result
if [[ $2 =~ $rematch ]]; then
read "$param" <<< "${BASH_REMATCH[1]}"
else
for ((i=3; $i <= $#; i++)); do
# Only read next arg if it not an arg itself.
if [[ ${@:$i:1} = -* ]];then
break
fi
result="$result ${@:$i:1}"
# There is no way to shift our callers args, so
# return "no of args" to indicate they should do it instead.
done
read "$1" <<< "$result"
return $(($i - 3))
fi
}

# Taken over from SUSE mkinitrd
default_kernel_images() {
local regex kernel_image kernel_version version_version initrd_image
local qf='%{NAME}-%{VERSION}-%{RELEASE}\n'

case "$(uname -m)" in
s390|s390x)
regex='image'
;;
ppc|ppc64)
regex='vmlinux'
;;
i386|x86_64)
regex='vmlinuz'
;;
arm*)
regex='[uz]Image'
;;
aarch64)
regex='Image'
;;
*) regex='vmlinu.'
;;
esac

# user mode linux
if grep -q UML /proc/cpuinfo; then
regex='linux'
fi

kernel_images=""
initrd_images=""
for kernel_image in $(ls $boot_dir \
| sed -ne "\|^$regex\(-[0-9.]\+-[0-9]\+-[a-z0-9]\+$\)\?|p" \
| grep -v kdump$ ) ; do

# Note that we cannot check the RPM database here -- this
# script is itself called from within the binary kernel
# packages, and rpm does not allow recursive calls.

[ -L "$boot_dir/$kernel_image" ] && continue
[ "${kernel_image%%.gz}" != "$kernel_image" ] && continue
kernel_version=$(/usr/bin/get_kernel_version \
$boot_dir/$kernel_image 2> /dev/null)
initrd_image=$(echo $kernel_image | sed -e "s|${regex}|initrd|")
if [ "$kernel_image" != "$initrd_image" -a \
-n "$kernel_version" -a \
-d "/lib/modules/$kernel_version" ]; then
kernel_images="$kernel_images $boot_dir/$kernel_image"
initrd_images="$initrd_images $boot_dir/$initrd_image"
fi
done
for kernel_image in $kernel_images;do
kernels="$kernels ${kernel_image#*-}"
done
for initrd_image in $initrd_images;do
targets="$targets $initrd_image"
done
host_only=1
force=1
}

while (($# > 0)); do
case ${1%%=*} in
--with-usb) read_arg usbmodule "$@" || shift $?
basicmodules="$basicmodules ${usbmodule:-usb-storage}"
unset usbmodule;;
--with-avail) read_arg modname "$@" || shift $?
basicmodules="$basicmodules $modname";;
--with) read_arg modname "$@" || shift $?
basicmodules="$basicmodules $modname";;
--version)
echo "mkinitrd: dracut compatibility wrapper"
exit 0;;
-v|--verbose) dracut_args="${dracut_args} -v";;
-f|--force) force=1;;
--preload) read_arg modname "$@" || shift $?
basicmodules="$basicmodules $modname";;
--image-version) img_vers=yes;;
--rootfs|-d) read_arg rootfs "$@" || shift $?
dracut_args="${dracut_args} --filesystems $rootfs";;
--nocompress) dracut_args="$dracut_args --no-compress";;
--help) usage -n;;
--builtin) ;;
--without*) ;;
--without-usb) ;;
--fstab*) ;;
--ifneeded) ;;
--omit-scsi-modules) ;;
--omit-ide-modules) ;;
--omit-raid-modules) ;;
--omit-lvm-modules) ;;
--omit-dmraid) ;;
--allow-missing) ;;
--net-dev*) ;;
--noresume) ;;
--rootdev*) ;;
--thawdev*) ;;
--rootopts*) ;;
--root*) ;;
--loopdev*) ;;
--loopfs*) ;;
--loopopts*) ;;
--looppath*) ;;
--dsdt*) ;;
--bootchart) ;;
-s) ;;
--quiet|-q) quiet=1;;
-b) read_arg boot_dir "$@" || shift $?
if [ ! -d $boot_dir ];then
error "Boot directory $boot_dir does not exist"
exit 1
fi
;;
-k) # Would be nice to get a list of images here
read_arg kernel_images "$@" || shift $?
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
targets="$targets $boot_dir/$initrd_image"
done
;;
*) if [[ ! $targets ]]; then
targets=$1
elif [[ ! $kernels ]]; then
kernels=$1
else
usage
fi;;
esac
shift
done

[[ $targets && $kernels ]] || default_kernel_images
[[ $targets && $kernels ]] || (error "No kernel found in $boot_dir" && usage)

# We can have several targets/kernels, transform the list to an array
targets=( $targets )
[[ $kernels ]] && kernels=( $kernels )

[[ $host_only == 1 ]] && dracut_args="${dracut_args} -H"
[[ $force == 1 ]] && dracut_args="${dracut_args} -f"

echo "Creating: target|kernel|dracut args|basicmodules "
for ((i=0 ; $i<${#targets[@]} ; i++)); do

if [[ $img_vers ]];then
target="${targets[$i]}-${kernels[$i]}"
else
target="${targets[$i]}"
fi
kernel="${kernels[$i]}"

# Duplicate code: No way found how to redirect output based on $quiet
if [[ $quiet == 1 ]];then
echo "$target|$kernel|$dracut_args|$basicmodules"
if [[ $basicmodules ]]; then
dracut $dracut_args --add-drivers "$basicmodules" "$target" \
"$kernel" &>/dev/null
else
dracut $dracut_args "$target" "$kernel" &>/dev/null
fi
else
if [[ $basicmodules ]]; then
dracut $dracut_args --add-drivers "$basicmodules" "$target" \
"$kernel"
else
dracut $dracut_args "$target" "$kernel"
fi
fi
done

View File

@ -1,106 +0,0 @@
MKINITRD(8)
===========
:doctype: manpage
:man source: dracut
:man manual: dracut

NAME
----
mkinitrd-suse - is a compat wrapper, which calls dracut to generate an initramfs

SYNOPSIS
--------
*mkinitrd* ['OPTION...']

DESCRIPTION
-----------
*mkinitrd* creates an initramfs image <initrd-image> for the kernel with
version <kernel-version> by calling *dracut*.

[IMPORTANT]
This version of mkinitrd is provided for compability with older
versions of mkinitrd. If a more fine grained control over the
resulting image is needed, *dracut* should be called directly.

OPTIONS
-------
**-R, --version**::
print info about the version

**-k** _<kernel_list>_::
List of kernel images for which initrd files are created (relative
to _boot_dir_), defaults to _vmlinux_ on ppc/ppc64, _image_ on s390/s390x
and _vmlinuz_ for everything else.

**-i** _<initrd_list>_::
List of file names (relative to _boot_dir_) for the initrd; positions
have to match the _kernel_list_. Defaults to _initrd_.

**-m** _<module_list>_::
Modules to include in initrd, defaults to _INITRD_MODULES_ variable
in */etc/sysconfig/kernel*.

**-f** _<feature_list>_::
Features to be enabled for the initrd. In general mkinitrd
configures the initrd for the root device it is started from. With
this option additional feature can be enabled.

**-b** _<bootdir>_::
Boot directory, defaults to */boot*, where the initrd is created.

**-d** _<root_device>_::
Root device, defaults to the device from which the root_dir is
mounted; overwrites the rootdev enviroment variable if set

**-s** _<size>_::
Add splash animation and bootscreen to initrd.

**-D** _<interface>::
Run dhcp on the specified interface (for example "eth0").

**-I** _<interface>::
Configure the specified interface statically.

**-a** _<acpi_dsdt>::
Attach compiled ACPI DSDT (Differentiated System Description Table)
to initrd. This replaces the DSDT of the BIOS. Defaults to the
_ACPI_DSDT_ variable in */etc/sysconfig/kernel*.

**-M** _<map>::
System.map file to use.

**-B**::
Dont run the *update-bootloader(8)* script after the initrd(s) have
been created. This is useful if you call mkinitrd(8) for anything
else than the running system.

**-A**::
Create a so called "monster initrd" which includes all available
features and modules.

**-v, --verbose**::
increase verbosity level

**-L**::
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.

AVAILABILITY
------------
The mkinitrd command is part of the dracut package and is available from
link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]

AUTHORS
-------
Harald Hoyer, Hannes Reinecke

SEE ALSO
--------
*dracut*(8)
*update-bootloader*(8)

View File

@ -1,354 +0,0 @@
#!/bin/bash --norc
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
# mkinitrd compability wrapper for SUSE.
#
# Copyright (c) 2013 SUSE Linux Products GmbH. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

boot_dir="/boot"
quiet=0
host_only=1
force=0
logfile=/var/log/YaST2/mkinitrd.log
dracut_cmd=dracut

error() { echo "$@" >&2; }

usage () {
[[ $1 = '-n' ]] && cmd=echo || cmd=error

$cmd "usage: ${0##*/} [options]"
$cmd ""
$cmd " Create initial ramdisk images that contain all kernel modules needed"
$cmd " in the early boot process, before the root file system becomes"
$cmd " available."
$cmd " This usually includes SCSI and/or RAID modules, a file system module"
$cmd " for the root file system, or a network interface driver module for dhcp."
$cmd ""
$cmd " options:"
$cmd " -f \"feature list\" Features to be enabled when generating initrd."
$cmd " Available features are:"
$cmd " iscsi, md, multipath, lvm, lvm2,"
$cmd " ifup, fcoe, dcbd"
$cmd " -k \"kernel list\" List of kernel images for which initrd files are"
$cmd " created. Defaults to all kernels found in /boot."
$cmd " -i \"initrd list\" List of file names for the initrd; position have"
$cmd " match to \"kernel list\". Defaults to all kernels"
$cmd " found in /boot."
$cmd " -b boot_dir Boot directory. Defaults to /boot."
$cmd " -t tmp_dir Temporary directory. Defaults to /var/tmp."
$cmd " -M map System.map file to use."
$cmd " -A Create a so called \"monster initrd\" which"
$cmd " includes all features and modules possible."
$cmd " -B Do not update bootloader configuration."
$cmd " -v Verbose mode."
$cmd " -L Disable logging."
$cmd " -h This help screen."
$cmd " -m \"module list\" Modules to include in initrd. Defaults to the"
$cmd " INITRD_MODULES variable in /etc/sysconfig/kernel"
$cmd " -u \"DomU module list\" Modules to include in initrd. Defaults to the"
$cmd " DOMU_INITRD_MODULES variable in"
$cmd " /etc/sysconfig/kernel."
$cmd " -d root_device Root device. Defaults to the device from"
$cmd " which / is mounted. Overrides the rootdev"
$cmd " enviroment variable if set."
$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 " -s size Add splash animation and bootscreen to initrd."

[[ $1 = '-n' ]] && exit 0
exit 1
}

# Little helper function for reading args from the commandline.
# it automatically handles -a b and -a=b variants, and returns 1 if
# we need to shift $3.
read_arg() {
# $1 = arg name
# $2 = arg value
# $3 = arg parameter
param="$1"
local rematch='^[^=]*=(.*)$' result
if [[ $2 =~ $rematch ]]; then
read "$param" <<< "${BASH_REMATCH[1]}"
else
for ((i=3; $i <= $#; i++)); do
# Only read next arg if it not an arg itself.
if [[ ${@:$i:1} = -* ]];then
break
fi
result="$result ${@:$i:1}"
# There is no way to shift our callers args, so
# return "no of args" to indicate they should do it instead.
done
read "$1" <<< "$result"
return $(($i - 3))
fi
}

# Helper functions to calculate ipconfig command line
calc_netmask() {
local prefix=$1

[ -z "$prefix" ] && return
mask=$(echo "(2 ^ 32) - (2 ^ $prefix)" | bc -l)
byte1=$(( mask >> 24 ))
byte2=$(( mask >> 16 ))
byte3=$(( mask >> 8 ))
byte4=$(( mask & 0xff ))
netmask=$(printf "%d.%d.%d.%d" $(( byte1 & 0xff )) $(( byte2 & 0xff )) $(( byte3 & 0xff )) $byte4);

echo $netmask
}

ipconfig() {
local interface=$1
local iplink macaddr broadcast gateway ipaddr prefix netmask

iplink=$(ip addr show dev $interface | sed -n 's/ *inet \(.*\) brd.*/\1/p')
macaddr=$(ip addr show dev $interface | sed -n 's/.*ether \(.*\) brd.*/\1/p')
broadcast=$(ip addr show dev $interface | sed -n 's/.*brd \(.*\) scope.*/\1/p')
gateway=$(ip route show dev $interface | sed -n 's/default via \([0-9\.]*\).*/\1/p')

ipaddr=${iplink%%/*}
prefix=${iplink##*/}
netmask=$(calc_netmask $prefix)

echo "${ipaddr}:${serveraddr}:${gateway}:${netmask}:${hostname}:${interface}:none::${macaddr}"
}

is_xen_kernel() {
local kversion=$1
local root_dir=$2
local cfg

for cfg in ${root_dir}/boot/config-$kversion $root_dir/lib/modules/$kversion/build/.config
do
test -r $cfg || continue
grep -q "^CONFIG_XEN=y\$" $cfg
return
done
test $kversion != "${kversion%-xen*}"
return
}


# Taken over from SUSE mkinitrd
default_kernel_images() {
local regex kernel_image kernel_version version_version initrd_image
local qf='%{NAME}-%{VERSION}-%{RELEASE}\n'

case "$(uname -m)" in
s390|s390x)
regex='image'
;;
ppc|ppc64)
regex='vmlinux'
;;
i386|x86_64)
regex='vmlinuz'
;;
arm*)
regex='[uz]Image'
;;
aarch64)
regex='Image'
;;
*) regex='vmlinu.'
;;
esac

kernel_images=""
initrd_images=""
for kernel_image in $(ls $boot_dir \
| sed -ne "\|^$regex\(-[0-9.]\+-[0-9]\+-[a-z0-9]\+$\)\?|p" \
| grep -v kdump$ ) ; do

# Note that we cannot check the RPM database here -- this
# script is itself called from within the binary kernel
# packages, and rpm does not allow recursive calls.

[ -L "$boot_dir/$kernel_image" ] && continue
[ "${kernel_image%%.gz}" != "$kernel_image" ] && continue
kernel_version=$(/usr/bin/get_kernel_version \
$boot_dir/$kernel_image 2> /dev/null)
initrd_image=$(echo $kernel_image | sed -e "s|${regex}|initrd|")
if [ "$kernel_image" != "$initrd_image" -a \
-n "$kernel_version" -a \
-d "/lib/modules/$kernel_version" ]; then
kernel_images="$kernel_images $boot_dir/$kernel_image"
initrd_images="$initrd_images $boot_dir/$initrd_image"
fi
done
for kernel_image in $kernel_images;do
kernels="$kernels ${kernel_image#*-}"
done
for initrd_image in $initrd_images;do
targets="$targets $initrd_image"
done
host_only=1
force=1
}

while (($# > 0)); do
case ${1%%=*} in
-f) read_arg feature_list "$@" || shift $?
# Could be several features
;;
-k) # Would be nice to get a list of images here
read_arg kernel_images "$@" || shift $?
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
# Check if the initrd_image contains a path.
# if not, then add the default boot_dir
dname=`dirname $initrd_image`
if [ "$dname" == "." ]; then
targets="$targets $boot_dir/$initrd_image";
else
targets="$targets $initrd_image";
fi
done
;;
-b) read_arg boot_dir "$@" || shift $?
if [ ! -d $boot_dir ];then
error "Boot directory $boot_dir does not exist"
exit 1
fi
;;
-t) read_arg tmp_dir "$@" || shift $?
dracut_args="${dracut_args} --tmpdir $tmp_dir"
;;
-M) read_arg map_file "$@" || shift $?
;;
-A) host_only=0;;
-B) skip_update_bootloader=1;;
-v|--verbose) dracut_args="${dracut_args} -v";;
-L) logfile=;;
-h|--help) usage -n;;
-m) read_arg module_list "$@" || shift $? ;;
-u) read_arg domu_module_list "$@" || shift $?
echo "mkinitrd: DomU modules not yet supported" ;;
-d) read_arg rootfs "$@" || shift $?
dracut_args="${dracut_args} --filesystems $rootfs" ;;
-D) read_arg dhcp_if "$@" || shift $?
dracut_cmdline="${dracut_cmdline} ip=${dhcp_if}:dhcp"
;;
-I) read_arg static_if "$@" || shift $?
dracut_cmdline="${dracut_cmdline} ip=$(ipconfig $static_if)":
;;
-a) read_arg acpi_dsdt "$@" || shift $?
echo "mkinitrd: custom DSDT not yet supported"
exit 1
;;
-s) read_arg boot_splash "$@" || shift $?
echo "mkinitrd: boot splash not yet supported"
exit 1
;;
-V) echo "mkinitrd: vendor scipts are no longer supported"
exit 1;;
--dracut)
read_arg dracut_cmd "$@" || shift $? ;;
--version|-R)
echo "mkinitrd: dracut compatibility wrapper"
exit 0;;
--force) force=1;;
--quiet|-q) quiet=1;;
*) if [[ ! $targets ]]; then
targets=$1
elif [[ ! $kernels ]]; then
kernels=$1
else
usage
fi;;
esac
shift
done

[[ $targets && $kernels ]] || default_kernel_images
[[ $targets && $kernels ]] || (error "No kernel found in $boot_dir" && usage)

# 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_cmdline ]] && dracut_args="${dracut_args} --kernel-cmdline ${dracut_cmdline}"
[ -z "$(type -p update-bootloader)" ] && skip_update_bootloader=1

# Update defaults from /etc/sysconfig/kernel
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}"

echo "Creating: target|kernel|dracut args|basicmodules "
for ((i=0 ; $i<${#targets[@]} ; i++)); do

if [[ $img_vers ]];then
target="${targets[$i]}-${kernels[$i]}"
else
target="${targets[$i]}"
fi
kernel="${kernels[$i]}"

# 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
$dracut_cmd $dracut_args "$target" "$kernel" &>/dev/null
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
$dracut_cmd $dracut_args "$target" "$kernel"
fi
fi
done

if [ "$skip_update_bootloader" ] ; then
echo 2>&1 "Did not refresh the bootloader. You might need to refresh it manually."
else
update-bootloader --refresh
fi

View File

@ -1,65 +0,0 @@
MKINITRD(8)
=========
:doctype: manpage
:man source: dracut
:man manual: dracut

NAME
----
mkinitrd - is a compat wrapper, which calls dracut to generate an initramfs

SYNOPSIS
--------
*mkinitrd* ['OPTION...'] [<initrd-image>] <kernel-version>

DESCRIPTION
-----------
mkinitrd creates an initramfs image <initrd-image> for the kernel with
version <kernel-version> by calling "dracut".

[IMPORTANT]
If a more fine grained control over the resulting image is needed,
"dracut" should be called directly.

OPTIONS
-------
**--version**::
print info about the version

**-v, --verbose**::
increase verbosity level

**-f, --force**::
overwrite existing initramfs file.

**--image-version*::
append the kernel version to the target image
<initrd-image>-<kernel-version>.

**--with=<module>**::
add the kernel module <module> to the initramfs.

**--preload=<module>**::
preload the kernel module <module> in the initramfs before any other kernel
modules are loaded. This can be used to ensure a certain device naming,
which should in theory be avoided and the use of symbolic links in /dev is
encouraged.

**--nocompress**::
do not compress the resulting image.

**--help**::
print a help message and exit.

AVAILABILITY
------------
The mkinitrd command is part of the dracut package and is available from
link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]

AUTHORS
-------
Harald Hoyer

SEE ALSO
--------
*dracut*(8)

View File

@ -1,23 +1,32 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later

# called by dracut
# Prerequisite check(s) for module.
check() {
require_binaries /bin/bash

# If the binary(s) requirements are not fulfilled the module can't be installed.
require_binaries bash || return 1

# Return 255 to only include the module, if another module requires it.
return 255

}

# called by dracut
# Module dependency requirements.
depends() {

# Return 0 to include the dependent module(s) in the initramfs.
return 0

}

# called by dracut
# Install the required file(s) and directories for the module in the initramfs.
install() {
# If another shell is already installed, do not use bash
[[ -x $initdir/bin/sh ]] && return

# Prefer bash as /bin/sh if it is available.
inst /bin/bash && ln -sf bash "${initdir}/bin/sh"
inst /bin/bash

# Prefer bash as default shell if no other shell is preferred.
[[ -L $initdir/bin/sh ]] || ln -sf bash "${initdir}/bin/sh"

}


View File

@ -1,32 +0,0 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

# called by dracut
check() {
[[ "$mount_needs" ]] && return 1
require_binaries /sbin/bootchartd || return 1
return 255
}

# called by dracut
depends() {
return 0
}

# called by dracut
install() {
inst_symlink /init /sbin/init
inst_dir /lib/bootchart/tmpfs

inst_multiple bootchartd bash \
/lib/bootchart/bootchart-collector /etc/bootchartd.conf \
accton \
echo \
grep \
usleep

inst /usr/bin/pkill /bin/pkill
inst /usr/bin/[ /bin/[
}

View File

@ -1,23 +1,32 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later

# called by dracut
# Prerequisite check(s) for module.
check() {
require_binaries /bin/dash

# If the binary(s) requirements are not fulfilled the module can't be installed.
require_binaries dash || return 1

# Return 255 to only include the module, if another module requires it.
return 255

}

# called by dracut
# Module dependency requirements.
depends() {

# Return 0 to include the dependent module(s) in the initramfs.
return 0

}

# called by dracut
# Install the required file(s) and directories for the module in the initramfs.
install() {
# If another shell is already installed, do not use dash
[[ -x $initdir/bin/sh ]] && return

# Prefer dash as /bin/sh if it is available.
inst /bin/dash && ln -sf dash "${initdir}/bin/sh"
inst /bin/dash

# Prefer dash as default shell if no other shell is preferred.
[[ -L $initdir/bin/sh ]] || ln -sf dash "${initdir}/bin/sh"

}


View File

@ -0,0 +1,34 @@
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later

# Prerequisite check(s) for module.
check() {

# If the binary(s) requirements are not fulfilled the module can't be installed.
require_binaries mksh || return 1
require_binaries printf || return 1

# Return 255 to only include the module, if another module requires it.
return 255

}

# Module dependency requirements.
depends() {

# Return 0 to include the dependent module(s) in the initramfs.
return 0

}

# Install the required file(s) and directories for the module in the initramfs.
install() {

inst /bin/mksh
inst printf

# Prefer mksh as default shell if no other shell is preferred.
[[ -L $initdir/bin/sh ]] || ln -sf mksh "${initdir}/bin/sh"

}

View File

@ -1,21 +0,0 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

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

# called by dracut
depends() {
return 0
}

# called by dracut
install() {
inst_symlink /init /sbin/init
inst_multiple $systemdutildir/systemd-bootchart
}

View File

@ -0,0 +1,21 @@
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later

# Prerequisite check(s) for module.
check() {

# Return 255 to only include the module, if another module requires it.
return 255

}

# Module dependency requirements.
depends() {

# This module has external dependency on other module(s).
echo systemd systemd-hostnamed systemd-networkd systemd-resolved systemd-timedated systemd-timesyncd
# Return 0 to include the dependent module(s) in the initramfs.
return 0

}

View File

@ -0,0 +1,269 @@
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later

# Prerequisite check(s) for module.
check() {
[[ $mount_needs ]] && return 1
# If the binary(s) requirements are not fulfilled the module can't be installed
require_binaries "$systemdutildir"/systemd || return 1
# Return 255 to only include the module, if another module requires it.
return 255
}

# called by dracut
depends() {
return 0
}

installkernel() {
hostonly='' instmods autofs4 ipv6 algif_hash hmac sha256
instmods -s efivarfs
}

# called by dracut
install() {
local _mods

if [[ $prefix == /run/* ]]; then
dfatal 'systemd does not work with a prefix, which contains "/run"!!'
exit 1
fi

inst_multiple -o \
"$systemdutildir"/systemd \
"$systemdutildir"/systemd-coredump \
"$systemdutildir"/systemd-cgroups-agent \
"$systemdutildir"/systemd-shutdown \
"$systemdutildir"/systemd-reply-password \
"$systemdutildir"/systemd-fsck \
"$systemdutildir"/systemd-udevd \
"$systemdutildir"/systemd-journald \
"$systemdutildir"/systemd-sysctl \
"$systemdutildir"/systemd-modules-load \
"$systemdutildir"/systemd-vconsole-setup \
"$systemdutildir"/systemd-volatile-root \
"$systemdutildir"/system-generators/systemd-debug-generator \
"$systemdutildir"/system-generators/systemd-fstab-generator \
"$systemdutildir"/system-generators/systemd-gpt-auto-generator \
\
"$systemdsystemunitdir"/debug-shell.service \
"$systemdsystemunitdir"/cryptsetup.target \
"$systemdsystemunitdir"/cryptsetup-pre.target \
"$systemdsystemunitdir"/remote-cryptsetup.target \
"$systemdsystemunitdir"/emergency.target \
"$systemdsystemunitdir"/sysinit.target \
"$systemdsystemunitdir"/basic.target \
"$systemdsystemunitdir"/halt.target \
"$systemdsystemunitdir"/kexec.target \
"$systemdsystemunitdir"/local-fs.target \
"$systemdsystemunitdir"/local-fs-pre.target \
"$systemdsystemunitdir"/remote-fs.target \
"$systemdsystemunitdir"/remote-fs-pre.target \
"$systemdsystemunitdir"/multi-user.target \
"$systemdsystemunitdir"/network.target \
"$systemdsystemunitdir"/network-pre.target \
"$systemdsystemunitdir"/network-online.target \
"$systemdsystemunitdir"/nss-lookup.target \
"$systemdsystemunitdir"/nss-user-lookup.target \
"$systemdsystemunitdir"/poweroff.target \
"$systemdsystemunitdir"/reboot.target \
"$systemdsystemunitdir"/rescue.target \
"$systemdsystemunitdir"/rpcbind.target \
"$systemdsystemunitdir"/shutdown.target \
"$systemdsystemunitdir"/final.target \
"$systemdsystemunitdir"/sigpwr.target \
"$systemdsystemunitdir"/sockets.target \
"$systemdsystemunitdir"/swap.target \
"$systemdsystemunitdir"/timers.target \
"$systemdsystemunitdir"/paths.target \
"$systemdsystemunitdir"/umount.target \
\
"$systemdsystemunitdir"/sys-kernel-config.mount \
\
"$systemdsystemunitdir"/kmod-static-nodes.service \
"$systemdsystemunitdir"/systemd-tmpfiles-setup.service \
"$systemdsystemunitdir"/systemd-tmpfiles-setup-dev.service \
"$systemdsystemunitdir"/systemd-ask-password-console.path \
"$systemdsystemunitdir"/systemd-udevd-control.socket \
"$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 \
"$systemdsystemunitdir"/systemd-poweroff.service \
"$systemdsystemunitdir"/systemd-reboot.service \
"$systemdsystemunitdir"/systemd-kexec.service \
"$systemdsystemunitdir"/systemd-fsck@.service \
"$systemdsystemunitdir"/systemd-udevd.service \
"$systemdsystemunitdir"/systemd-udev-trigger.service \
"$systemdsystemunitdir"/systemd-udev-settle.service \
"$systemdsystemunitdir"/systemd-ask-password-plymouth.service \
"$systemdsystemunitdir"/systemd-journald.service \
"$systemdsystemunitdir"/systemd-vconsole-setup.service \
"$systemdsystemunitdir"/systemd-volatile-root.service \
"$systemdsystemunitdir"/systemd-random-seed-load.service \
"$systemdsystemunitdir"/systemd-random-seed.service \
"$systemdsystemunitdir"/systemd-sysctl.service \
\
"$systemdsystemunitdir"/sysinit.target.wants/systemd-modules-load.service \
"$systemdsystemunitdir"/sysinit.target.wants/systemd-ask-password-console.path \
"$systemdsystemunitdir"/sysinit.target.wants/systemd-journald.service \
"$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 \
"$systemdsystemunitdir"/sysinit.target.wants/kmod-static-nodes.service \
"$systemdsystemunitdir"/sysinit.target.wants/systemd-tmpfiles-setup.service \
"$systemdsystemunitdir"/sysinit.target.wants/systemd-tmpfiles-setup-dev.service \
"$systemdsystemunitdir"/sysinit.target.wants/systemd-sysctl.service \
\
"$systemdsystemunitdir"/ctrl-alt-del.target \
"$systemdsystemunitdir"/reboot.target \
"$systemdsystemunitdir"/systemd-reboot.service \
"$systemdsystemunitdir"/syslog.socket \
\
"$systemdsystemunitdir"/slices.target \
"$systemdsystemunitdir"/system.slice \
"$systemdsystemunitdir"/-.slice \
\
"$tmpfilesdir"/systemd.conf \
\
journalctl systemctl \
echo swapoff \
kmod insmod rmmod modprobe modinfo depmod lsmod \
mount umount reboot poweroff \
systemd-run systemd-escape \
systemd-cgls systemd-tmpfiles \
systemd-ask-password systemd-tty-ask-password-agent \
/etc/udev/udev.hwdb

inst_multiple -o \
/usr/lib/modules-load.d/*.conf \
/usr/lib/sysctl.d/*.conf

modules_load_get() {
local _line i
for i in "$dracutsysrootdir$1"/*.conf; do
[[ -f $i ]] || continue
while read -r _line || [ -n "$_line" ]; do
case $_line in
\#*) ;;

\;*) ;;

*)
echo "$_line"
;;
esac
done < "$i"
done
}

mapfile -t _mods < <(modules_load_get /usr/lib/modules-load.d)
[[ ${#_mods[@]} -gt 0 ]] && hostonly='' instmods "${_mods[@]}"

if [[ $hostonly ]]; then
inst_multiple -H -o \
/etc/systemd/journald.conf \
/etc/systemd/journald.conf.d/*.conf \
/etc/systemd/system.conf \
/etc/systemd/system.conf.d/*.conf \
/etc/hosts \
/etc/hostname \
/etc/nsswitch.conf \
/etc/machine-id \
/etc/machine-info \
/etc/vconsole.conf \
/etc/locale.conf \
/etc/modules-load.d/*.conf \
/etc/sysctl.d/*.conf \
/etc/sysctl.conf \
/etc/udev/udev.conf

mapfile -t _mods < <(modules_load_get /etc/modules-load.d)
[[ ${#_mods[@]} -gt 0 ]] && hostonly='' instmods "${_mods[@]}"
fi

if ! [[ -e "$initdir/etc/machine-id" ]]; then
: > "$initdir/etc/machine-id"
fi

# install adm user/group for journald
inst_multiple nologin
{
grep '^systemd-journal:' "$dracutsysrootdir"/etc/passwd 2> /dev/null
grep '^adm:' "$dracutsysrootdir"/etc/passwd 2> /dev/null
# we don't use systemd-networkd, but the user is in systemd.conf tmpfiles snippet
grep '^systemd-network:' "$dracutsysrootdir"/etc/passwd 2> /dev/null
} >> "$initdir/etc/passwd"

{
grep '^systemd-journal:' "$dracutsysrootdir"/etc/group 2> /dev/null
grep '^wheel:' "$dracutsysrootdir"/etc/group 2> /dev/null
grep '^adm:' "$dracutsysrootdir"/etc/group 2> /dev/null
grep '^utmp:' "$dracutsysrootdir"/etc/group 2> /dev/null
grep '^root:' "$dracutsysrootdir"/etc/group 2> /dev/null
# we don't use systemd-networkd, but the user is in systemd.conf tmpfiles snippet
grep '^systemd-network:' "$dracutsysrootdir"/etc/group 2> /dev/null
} >> "$initdir/etc/group"

local _systemdbinary="$systemdutildir"/systemd

if ldd "$_systemdbinary" | grep -qw libasan; then
local _wrapper="$systemdutildir"/systemd-asan-wrapper
cat > "$initdir"/"$_wrapper" << EOF
#!/bin/sh
mount -t proc -o nosuid,nodev,noexec proc /proc
exec $_systemdbinary
EOF
chmod 755 "$initdir"/"$_wrapper"
_systemdbinary="$_wrapper"
unset _wrapper
fi
ln_r "$_systemdbinary" "/init"
ln_r "$_systemdbinary" "/sbin/init"

unset _systemdbinary

inst_binary true
ln_r "$(find_binary true)" "/usr/bin/loginctl"
ln_r "$(find_binary true)" "/bin/loginctl"
inst_rules \
70-uaccess.rules \
71-seat.rules \
73-seat-late.rules \
90-vconsole.rules \
99-systemd.rules

for i in \
emergency.target \
rescue.target \
systemd-ask-password-console.service \
systemd-ask-password-plymouth.service; do
[[ -f "$systemdsystemunitdir"/$i ]] || continue
$SYSTEMCTL -q --root "$initdir" add-wants "$i" systemd-vconsole-setup.service
done

mkdir -p "$initdir/etc/systemd"
# We must use a volatile journal, and we don't want rate-limiting
{
echo "[Journal]"
echo "Storage=volatile"
echo "RateLimitInterval=0"
echo "RateLimitBurst=0"
} >> "$initdir/etc/systemd/journald.conf"

$SYSTEMCTL -q --root "$initdir" set-default multi-user.target

# Install library file(s)
_arch=${DRACUT_ARCH:-$(uname -m)}
inst_libdir_file \
{"tls/$_arch/",tls/,"$_arch/",}"libnss_*"

}

View File

@ -0,0 +1,39 @@
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later

# Prerequisite check(s) for module.
check() {

# hwclock does not exist on S390(x), bail out silently then
local _arch=${DRACUT_ARCH:-$(uname -m)}
[ "$_arch" = "s390" -o "$_arch" = "s390x" ] && return 1

# If the binary(s) requirements are not fulfilled the module can't be installed.
require_binaries hwclock || return 1

# Return 255 to only include the module, if another module requires it.
return 255

}

# Module dependency requirements.
depends() {

# Return 0 to include the dependent module(s) in the initramfs.
return 0

}

# Install the required file(s) and directories for the module in the initramfs.
install() {

inst_hook pre-trigger 00 "$moddir/warpclock.sh"

inst_multiple -o \
/usr/share/zoneinfo/UTC \
/etc/localtime \
/etc/adjtime \
hwclock

}

View File

@ -0,0 +1,14 @@
#!/bin/sh
# This file is part of dracut warpclock module.
# SPDX-License-Identifier: GPL-2.0-or-later

# Set the kernel's timezone and reset the system time
# if adjtime is set to LOCAL.

if test -e /etc/adjtime; then
while read -r line; do
if test "$line" = LOCAL; then
hwclock --systz
fi
done < /etc/adjtime
fi

View File

@ -1,10 +1,12 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1
elif getarg boot= >/dev/null; then
type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh

if ! fipsmode=$(getarg fips) || [ "$fipsmode" = "0" ]; then
rm -f -- /etc/modprobe.d/fips.conf > /dev/null 2>&1
elif [ -z "$fipsmode" ]; then
die "FIPS mode have to be enabled by 'fips=1' not just 'fips'"
elif getarg boot= > /dev/null; then
. /sbin/fips.sh
if mount_boot; then
do_fips || die "FIPS integrity test failed"

View File

@ -0,0 +1,12 @@
#!/bin/sh

type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh

if ! fipsmode=$(getarg fips) || [ "$fipsmode" = "0" ]; then
rm -f -- /etc/modprobe.d/fips.conf > /dev/null 2>&1
elif [ -z "$fipsmode" ]; then
die "FIPS mode have to be enabled by 'fips=1' not just 'fips'"
else
. /sbin/fips.sh
fips_load_crypto || die "FIPS integrity test failed"
fi

View File

@ -1,9 +1,11 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1
type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh

if ! fipsmode=$(getarg fips) || [ "$fipsmode" = "0" ]; then
rm -f -- /etc/modprobe.d/fips.conf > /dev/null 2>&1
elif [ -z "$fipsmode" ]; then
die "FIPS mode have to be enabled by 'fips=1' not just 'fips'"
elif ! [ -f /tmp/fipsdone ]; then
. /sbin/fips.sh
mount_boot

View File

@ -1,129 +1,178 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

mount_boot()
{
type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh

# systemd lets stdout go to journal only, but the system
# has to halt when the integrity check fails to satisfy FIPS.
if [ -z "$DRACUT_SYSTEMD" ]; then
fips_info() {
info "$*"
}
else
fips_info() {
echo "$*" >&2
}
fi

mount_boot() {
boot=$(getarg boot=)

if [ -n "$boot" ]; then
case "$boot" in
LABEL=*)
boot="$(echo $boot | sed 's,/,\\x2f,g')"
boot="/dev/disk/by-label/${boot#LABEL=}"
;;
UUID=*)
boot="/dev/disk/by-uuid/${boot#UUID=}"
;;
PARTUUID=*)
boot="/dev/disk/by-partuuid/${boot#PARTUUID=}"
;;
PARTLABEL=*)
boot="/dev/disk/by-partlabel/${boot#PARTLABEL=}"
;;
/dev/*)
;;
*)
die "You have to specify boot=<boot device> as a boot option for fips=1" ;;
LABEL=* | UUID=* | PARTUUID=* | PARTLABEL=*)
boot="$(label_uuid_to_dev "$boot")"
;;
/dev/*) ;;

*)
die "You have to specify boot=<boot device> as a boot option for fips=1"
;;
esac

if ! [ -e "$boot" ]; then
udevadm trigger --action=add >/dev/null 2>&1
[ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version)
udevadm trigger --action=add > /dev/null 2>&1

i=0
while ! [ -e $boot ]; do
if [ $UDEVVERSION -ge 143 ]; then
udevadm settle --exit-if-exists=$boot
else
udevadm settle --timeout=30
fi
[ -e $boot ] && break
while ! [ -e "$boot" ]; do
udevadm settle --exit-if-exists="$boot"
[ -e "$boot" ] && break
sleep 0.5
i=$(($i+1))
i=$((i + 1))
[ $i -gt 40 ] && break
done
fi

[ -e "$boot" ] || return 1

mkdir /boot
info "Mounting $boot as /boot"
mkdir -p /boot
fips_info "Mounting $boot as /boot"
mount -oro "$boot" /boot || return 1
elif [ -d "$NEWROOT/boot" ]; then
# shellcheck disable=SC2114
rm -fr -- /boot
ln -sf "$NEWROOT/boot" /boot
fi
}

do_rhevh_check()
{
do_rhevh_check() {
KERNEL=$(uname -r)
kpath=${1}

# If we're on RHEV-H, the kernel is in /run/initramfs/live/vmlinuz0
HMAC_SUM_ORIG=$(cat $NEWROOT/boot/.vmlinuz-${KERNEL}.hmac | while read a b; do printf "%s\n" $a; done)
HMAC_SUM_CALC=$(sha512hmac $kpath | while read a b; do printf "%s\n" $a; done || return 1)
HMAC_SUM_ORIG=$(while read -r a _ || [ -n "$a" ]; do printf "%s\n" "$a"; done < "$NEWROOT/boot/.vmlinuz-${KERNEL}.hmac")
HMAC_SUM_CALC=$(sha512hmac "$kpath" | while read -r a _ || [ -n "$a" ]; do printf "%s\n" "$a"; done || return 1)
if [ -z "$HMAC_SUM_ORIG" ] || [ -z "$HMAC_SUM_CALC" ] || [ "${HMAC_SUM_ORIG}" != "${HMAC_SUM_CALC}" ]; then
warn "HMAC sum mismatch"
return 1
fi
info "rhevh_check OK"
fips_info "rhevh_check OK"
return 0
}

do_fips()
{
local _v
local _s
nonfatal_modprobe() {
modprobe "$1" 2>&1 > /dev/stdout \
| while read -r line || [ -n "$line" ]; do
echo "${line#modprobe: FATAL: }" >&2
done
}

fips_load_crypto() {
local _k
local _v
local _module

KERNEL=$(uname -r)

if ! [ -e "/boot/.vmlinuz-${KERNEL}.hmac" ]; then
warn "/boot/.vmlinuz-${KERNEL}.hmac does not exist"
return 1
fi
local _found

FIPSMODULES=$(cat /etc/fipsmodules)

info "Loading and integrity checking all crypto modules"
fips_info "Loading and integrity checking all crypto modules"
mv /etc/modprobe.d/fips.conf /etc/modprobe.d/fips.conf.bak
for _module in $FIPSMODULES; do
if [ "$_module" != "tcrypt" ]; then
if ! modprobe "${_module}"; then
if ! nonfatal_modprobe "${_module}" 2> /tmp/fips.modprobe_err; then
# check if kernel provides generic algo
_found=0
while read _k _s _v; do
while read -r _k _ _v || [ -n "$_k" ]; do
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
[ "$_v" != "$_module" ] && continue
_found=1
break
done </proc/crypto
[ "$_found" = "0" ] && return 1
done < /proc/crypto
[ "$_found" = "0" ] && cat /tmp/fips.modprobe_err >&2 && return 1
fi
fi
done
mv /etc/modprobe.d/fips.conf.bak /etc/modprobe.d/fips.conf

info "Self testing crypto algorithms"
fips_info "Self testing crypto algorithms"
modprobe tcrypt || return 1
rmmod tcrypt
}

info "Checking integrity of kernel"
if [ -e "/run/initramfs/live/vmlinuz0" ]; then
do_rhevh_check /run/initramfs/live/vmlinuz0 || return 1
elif [ -e "/run/initramfs/live/isolinux/vmlinuz0" ]; then
do_rhevh_check /run/initramfs/live/isolinux/vmlinuz0 || return 1
else
sha512hmac -c "/boot/.vmlinuz-${KERNEL}.hmac" || return 1
do_fips() {
KERNEL=$(uname -r)

if ! getarg rd.fips.skipkernel > /dev/null; then

fips_info "Checking integrity of kernel"
if [ -e "/run/initramfs/live/vmlinuz0" ]; then
do_rhevh_check /run/initramfs/live/vmlinuz0 || return 1
elif [ -e "/run/initramfs/live/isolinux/vmlinuz0" ]; then
do_rhevh_check /run/initramfs/live/isolinux/vmlinuz0 || return 1
elif [ -e "/run/install/repo/images/pxeboot/vmlinuz" ]; then
# This is a boot.iso with the .hmac inside the install.img
do_rhevh_check /run/install/repo/images/pxeboot/vmlinuz || return 1
else
BOOT_IMAGE="$(getarg BOOT_IMAGE)"

# On s390x, BOOT_IMAGE isn't a path but an integer representing the
# entry number selected. Let's try the root of /boot first, and
# otherwise fallback to trying to parse the BLS entries if it's a
# BLS-based system.
if [ "$(uname -m)" = s390x ]; then
if [ -e "/boot/vmlinuz-${KERNEL}" ]; then
BOOT_IMAGE="vmlinuz-${KERNEL}"
elif [ -d /boot/loader/entries ]; then
bls=$(find /boot/loader/entries -name '*.conf' | sort -rV | sed -n "$((BOOT_IMAGE + 1))p")
if [ -e "${bls}" ]; then
BOOT_IMAGE=$(grep ^linux "${bls}" | cut -d' ' -f2)
fi
fi
fi

# Trim off any leading GRUB boot device (e.g. ($root) )
BOOT_IMAGE="$(echo "${BOOT_IMAGE}" | sed 's/^(.*)//')"

BOOT_IMAGE_NAME="${BOOT_IMAGE##*/}"
BOOT_IMAGE_PATH="${BOOT_IMAGE%${BOOT_IMAGE_NAME}}"

if [ -z "$BOOT_IMAGE_NAME" ]; then
BOOT_IMAGE_NAME="vmlinuz-${KERNEL}"
elif ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE_NAME}" ]; then
#if /boot is not a separate partition BOOT_IMAGE might start with /boot
BOOT_IMAGE_PATH=${BOOT_IMAGE_PATH#"/boot"}
#on some achitectures BOOT_IMAGE does not contain path to kernel
#so if we can't find anything, let's treat it in the same way as if it was empty
if ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE_NAME}" ]; then
BOOT_IMAGE_NAME="vmlinuz-${KERNEL}"
BOOT_IMAGE_PATH=""
fi
fi

BOOT_IMAGE_HMAC="/boot/${BOOT_IMAGE_PATH}/.${BOOT_IMAGE_NAME}.hmac"
if ! [ -e "${BOOT_IMAGE_HMAC}" ]; then
warn "${BOOT_IMAGE_HMAC} does not exist"
return 1
fi

(cd "${BOOT_IMAGE_HMAC%/*}" && sha512hmac -c "${BOOT_IMAGE_HMAC}") || return 1
fi
fi

info "All initrd crypto checks done"
fips_info "All initrd crypto checks done"

> /tmp/fipsdone
: > /tmp/fipsdone

umount /boot >/dev/null 2>&1
umount /boot > /dev/null 2>&1

return 0
}

View File

@ -1,6 +1,4 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh

# called by dracut
check() {
@ -14,37 +12,74 @@ depends() {

# called by dracut
installkernel() {
local _fipsmodules _mod
_fipsmodules="aead aes_generic aes-x86_64 ansi_cprng arc4 blowfish camellia cast6 cbc ccm "
_fipsmodules+="chainiv crc32c crct10dif_generic cryptomgr crypto_null ctr cts deflate des des3_ede dm-crypt dm-mod "
_fipsmodules+="ecb eseqiv fcrypt gcm ghash_generic hmac khazad lzo md4 md5 michael_mic rmd128 "
_fipsmodules+="rmd160 rmd256 rmd320 rot13 salsa20 seed seqiv serpent sha1 sha224 sha256 sha256_generic "
_fipsmodules+="sha384 sha512 sha512_generic tcrypt tea tnepres twofish wp256 wp384 wp512 xeta xtea xts zlib"
local _fipsmodules _mod _bootfstype
if [[ -f "${srcmods}/modules.fips" ]]; then
_fipsmodules="$(cat "${srcmods}/modules.fips")"
else
_fipsmodules=""

# Hashes:
_fipsmodules+="sha1 sha224 sha256 sha384 sha512 "
_fipsmodules+="sha3-224 sha3-256 sha3-384 sha3-512 "
_fipsmodules+="crc32c crct10dif ghash "

# Ciphers:
_fipsmodules+="cipher_null des3_ede aes cfb dh ecdh "

# Modes/templates:
_fipsmodules+="ecb cbc ctr xts gcm ccm authenc hmac cmac ofb cts "

# Compression algs:
_fipsmodules+="deflate lzo zlib "

# PRNG algs:
_fipsmodules+="ansi_cprng "

# Misc:
_fipsmodules+="aead cryptomgr tcrypt crypto_user "
fi

# shellcheck disable=SC2174
mkdir -m 0755 -p "${initdir}/etc/modprobe.d"

for _mod in $_fipsmodules; do
if hostonly='' instmods -c -s $_mod; then
echo $_mod >> "${initdir}/etc/fipsmodules"
if hostonly='' instmods -c -s "$_mod"; then
echo "$_mod" >> "${initdir}/etc/fipsmodules"
echo "blacklist $_mod" >> "${initdir}/etc/modprobe.d/fips.conf"
fi
done

# with hostonly_default_device fs module for /boot is not installed by default
if [[ $hostonly ]] && [[ $hostonly_default_device == "no" ]]; then
_bootfstype=$(find_mp_fstype /boot)
if [[ -n $_bootfstype ]]; then
hostonly='' instmods "$_bootfstype"
else
dwarning "Can't determine fs type for /boot, FIPS check may fail."
fi
fi
}

# called by dracut
install() {
local _dir
inst_hook pre-trigger 01 "$moddir/fips-boot.sh"
inst_hook pre-mount 01 "$moddir/fips-boot.sh"
inst_hook pre-pivot 01 "$moddir/fips-noboot.sh"
inst_hook pre-udev 01 "$moddir/fips-load-crypto.sh"
inst_script "$moddir/fips.sh" /sbin/fips.sh

inst_multiple sha512hmac rmmod insmod mount uname umount fipscheck
inst_multiple sha512hmac rmmod insmod mount uname umount grep sed cut find sort

inst_libdir_file libsoftokn3.so libsoftokn3.so \
libsoftokn3.chk libfreebl3.so libfreebl3.chk \
libssl.so 'hmaccalc/sha512hmac.hmac' libssl.so.10

inst_multiple -o prelink
inst_simple /etc/system-fips
[ -c "${initdir}"/dev/random ] || mknod "${initdir}"/dev/random c 1 8 \
|| {
dfatal "Cannot create /dev/random"
dfatal "To create an initramfs with fips support, dracut has to run as root"
return 1
}
[ -c "${initdir}"/dev/urandom ] || mknod "${initdir}"/dev/urandom c 1 9 \
|| {
dfatal "Cannot create /dev/urandom"
dfatal "To create an initramfs with fips support, dracut has to run as root"
return 1
}
}


View File

@ -0,0 +1,3 @@
# This file is part of dracut systemd ac power module
SUBSYSTEM=="power_supply", KERNEL=="AC", ATTR{online}=="0", RUN+="/usr/sbin/systemctl start initrd-on-battery-power.target"
SUBSYSTEM=="power_supply", KERNEL=="AC", ATTR{online}=="1", RUN+="/usr/sbin/systemctl start initrd-on-ac-power.target"

View File

@ -0,0 +1,8 @@
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later

[Unit]
Description=Initial RAM Disk On AC Power
ConditionPathExists=/usr/lib/initrd-release
DefaultDependencies=no
StopWhenUnneeded=yes

View File

@ -0,0 +1,8 @@
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later

[Unit]
Description=Initial RAM Disk On Battery Power
ConditionPathExists=/usr/lib/initrd-release
DefaultDependencies=no
StopWhenUnneeded=yes

View File

@ -0,0 +1,29 @@
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later

# Prerequisite check(s) for module.
check() {

# Return 255 to only include the module, if another module requires it.
return 255

}

# Module dependency requirements.
depends() {

# Return 0 to include the dependent module(s) in the initramfs.
return 0

}

# Install the required file(s) and directories for the module in the initramfs.
install() {

inst_rules "$moddir/99-initrd-power-targets.rules"
inst_simple "$systemdutildir"/systemd-ac-power
inst_simple "$moddir/initrd-on-ac-power.target" "$systemdsystemunitdir/initrd-on-ac-power.target"
inst_simple "$moddir/initrd-on-battery-power.target" "$systemdsystemunitdir/initrd-on-battery-power.target"

}

View File

@ -0,0 +1,60 @@
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later

# Prerequisite check(s) for module.
check() {

# If the binary(s) requirements are not fulfilled the module can't be installed
require_binaries \
systemd-ask-password \
systemd-tty-ask-password-agent \
|| return 1

# Return 255 to only include the module, if another module requires it.
return 255

}

# Module dependency requirements.
depends() {

# Return 0 to include the dependent module(s) in the initramfs.
return 0

}

# Install the required file(s) for the module in the initramfs.
install() {

inst_multiple -o \
"$systemdsystemunitdir"/systemd-ask-password-console.path \
"$systemdsystemunitdir"/systemd-ask-password-console.service \
"$systemdsystemunitdir"/multi-user.target.wants/systemd-ask-password-wall.path \
"$systemdsystemunitdir"/sysinit.target.wants/systemd-ask-password-console.path \
systemd-ask-password \
systemd-tty-ask-password-agent

# Enable the systemd type service unit for systemd-ask-password.
$SYSTEMCTL -q --root "$initdir" enable systemd-ask-password-console.service

# Install systemd-ask-password plymouth units if plymouth is enabled.
if dracut_module_included "plymouth"; then
inst_multiple -o \
"$systemdsystemunitdir"/systemd-ask-password-plymouth.path \
"$systemdsystemunitdir"/systemd-ask-password-plymouth.service

$SYSTEMCTL -q --root "$initdir" enable systemd-ask-password-plymouth.service
fi

# Uncomment this section if the usecase for wall module in the initramfs arises.
# Install systemd-ask-password wall units if <wall module> is enabled.
#if dracut_module_included "<wall module>"; then
# inst_multiple -o \
# $systemdsystemunitdir/systemd-ask-password-wall.path \
# $systemdsystemunitdir/systemd-ask-password-wall.service \
# $systemdsystemunitdir/multi-user.target.wants/systemd-ask-password-wall.path \
#
# $SYSTEMCTL -q --root "$initdir" enable systemd-ask-password-wall.service
#fi
}

View File

@ -0,0 +1,55 @@
#!/bin/bash
# This file is part of dracut.
# SPDX-License-Identifier: GPL-2.0-or-later

# Prerequisite check(s) for module.
check() {

# If the binary(s) requirements are not fulfilled the module can't be installed
require_binaries \
coredumpctl \
"$systemdutildir"/systemd-coredump \
|| return 1

# Return 255 to only include the module, if another module requires it.
return 255

}

# Module dependency requirements.
depends() {

# This module has external dependency on the systemd module.
echo systemd-journald systemd-sysctl
# Return 0 to include the dependent module(s) in the initramfs.
return 0

}

# Install the required file(s) and directories for the module in the initramfs.
install() {

inst_dir /var/lib/systemd/coredump
inst_multiple -o \
"$sysctld"/50-coredump.conf \
"$systemdutildir"/coredump.conf \
"$systemdsystemunitdir"/systemd-coredump \
"$systemdsystemunitdir"/systemd-coredump.socket \
"$systemdsystemunitdir"/systemd-coredump@.service \
"$systemdsystemunitdir"/sockets.target.wants/systemd-coredump.socket \
"$sysusers"/systemd-coredump.conf \
coredumpctl

# Install the hosts local user configurations if enabled.
if [[ $hostonly ]]; then
inst_multiple -H -o \
"$systemdutilconfdir"/coredump.conf \
"$systemdsystemconfdir/coredump.conf.d/*.conf" \
"$systemdsystemconfdir"/systemd-coredump.socket \
"$systemdsystemconfdir/systemd-coredump.socket.d/*.conf" \
"$systemdsystemconfdir"/systemd-coredump@.service \
"$systemdsystemconfdir/systemd-coredump@.service.d/*.conf" \
"$systemdsystemconfdir"/sockets.target.wants/systemd-coredump.socket \
"$sysusersconfdir"/systemd-coredump.conf
fi
}

View File

@ -0,0 +1,6 @@
# This file is part of dracut systemd-hostnamed module.

[Service]
User=systemd-network
Group=systemd-hostname
AmbientCapabilities=CAP_SYS_ADMIN

Some files were not shown because too many files have changed in this diff Show More