]> git.ipfire.org Git - thirdparty/dracut.git/log
thirdparty/dracut.git
5 years agomkinitrd-dracut.sh: use vmlinux regex for ppc*, vmlinuz for i686
q66 [Sat, 25 Jul 2020 15:29:23 +0000 (17:29 +0200)] 
mkinitrd-dracut.sh: use vmlinux regex for ppc*, vmlinuz for i686

Previously this would not catch ppc64le, now it does; same with
i686.

5 years ago90ppcmac: respect DRACUT_ARCH, don't exclude ppcle
q66 [Sat, 25 Jul 2020 15:47:00 +0000 (17:47 +0200)] 
90ppcmac: respect DRACUT_ARCH, don't exclude ppcle

5 years ago90kernel-modules: add pci_hyperv
Kairui Song [Mon, 3 Aug 2020 08:51:54 +0000 (16:51 +0800)] 
90kernel-modules: add pci_hyperv

Install pci_hyperv for SR-IOV devices on hyperv machines.

5 years agoAs of v246 of systemd "syslog" and "syslog-console" switches have been deprecated
Jóhann B. Guðmundsson [Wed, 15 Jul 2020 14:36:20 +0000 (14:36 +0000)] 
As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated

5 years agoAs of v246 of systemd "syslog" and "syslog-console" switches have been deprecated
Jóhann B. Guðmundsson [Wed, 15 Jul 2020 14:35:38 +0000 (14:35 +0000)] 
As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated

5 years agoAs of v246 of systemd "syslog" and "syslog-console" switches have been deprecated
Jóhann B. Guðmundsson [Wed, 15 Jul 2020 14:35:02 +0000 (14:35 +0000)] 
As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated

5 years agoAs of v246 of systemd "syslog" and "syslog-console" switches have been deprecated
Jóhann B. Guðmundsson [Wed, 15 Jul 2020 14:34:17 +0000 (14:34 +0000)] 
As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated

5 years agoAs of v246 of systemd "syslog" and "syslog-console" switches have been deprecated
Jóhann B. Guðmundsson [Wed, 15 Jul 2020 14:33:33 +0000 (14:33 +0000)] 
As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated

5 years agoAs of v246 of systemd "syslog" and "syslog-console" switches have been deprecated
Jóhann B. Guðmundsson [Wed, 15 Jul 2020 14:32:44 +0000 (14:32 +0000)] 
As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated

5 years agoAs of v246 of systemd "syslog" and "syslog-console" switches have been deprecated
Jóhann B. Guðmundsson [Wed, 15 Jul 2020 14:31:59 +0000 (14:31 +0000)] 
As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated

5 years agoAs of v246 of systemd "syslog" and "syslog-console" switches have been deprecated
Jóhann B. Guðmundsson [Wed, 15 Jul 2020 14:31:17 +0000 (14:31 +0000)] 
As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated

5 years agoAs of v246 of systemd "syslog" and "syslog-console" switches have been deprecated
Jóhann B. Guðmundsson [Wed, 15 Jul 2020 14:29:34 +0000 (14:29 +0000)] 
As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated

5 years agoAs of v246 of systemd "syslog" and "syslog-console" switches have been deprecated
Jóhann B. Guðmundsson [Wed, 15 Jul 2020 14:26:00 +0000 (14:26 +0000)] 
As of v246 of systemd "syslog" and "syslog-console" switches have been deprecated

5 years agodracut.sh: fix early microcode detection logic
q66 [Sat, 25 Jul 2020 15:28:16 +0000 (17:28 +0200)] 
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

5 years ago95iscsi: fix ipv6 target discovery
Thomas Blume [Mon, 6 Jul 2020 13:16:35 +0000 (15:16 +0200)] 
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.

5 years ago91zipl: parse-zipl.sh: honor SYSTEMD_READY
Martin Wilck [Fri, 26 Jun 2020 16:50:47 +0000 (18:50 +0200)] 
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.

5 years agodracut.sh: FIPS workaround for openssl-libs on Fedora/RHEL
Kairui Song [Wed, 10 Jun 2020 07:57:20 +0000 (15:57 +0800)] 
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>
5 years agodracut.sh: Move the library workaround after squash
Kairui Song [Mon, 8 Jun 2020 19:03:18 +0000 (03:03 +0800)] 
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>
5 years agoinstall: also install post weak dependencies of kernel modules
Lukas Nykryn [Thu, 2 Jul 2020 07:08:03 +0000 (09:08 +0200)] 
install: also install post weak dependencies of kernel modules

5 years agocms: regenerate NetworkManager connections
Beniamino Galvani [Wed, 24 Jun 2020 11:09:04 +0000 (13:09 +0200)] 
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.

5 years agonetwork-manager: move connection generation to a lib file
Beniamino Galvani [Wed, 24 Jun 2020 11:06:05 +0000 (13:06 +0200)] 
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.

5 years ago95iscsi: fix missing space when compiling cmdline args
Daniel Molkentin [Wed, 10 Jun 2020 20:36:56 +0000 (22:36 +0200)] 
95iscsi: fix missing space when compiling cmdline args

Reference: bsc#1172816

5 years ago95nvmf: add module for NVMe-oF
Hannes Reinecke [Mon, 25 Nov 2019 10:33:42 +0000 (11:33 +0100)] 
95nvmf: add module for NVMe-oF

Add a module for booting from NVMe-oF devices.

Signed-off-by: Hannes Reinecke <hare@suse.de>
5 years ago95nfs: only install rpc services for NFS < 4 when hostonly is strict
Kairui Song [Fri, 10 Apr 2020 12:50:49 +0000 (20:50 +0800)] 
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.

5 years agoFix CI badges in README.md and fix dracut description
Harald Hoyer [Fri, 29 May 2020 12:43:57 +0000 (14:43 +0200)] 
Fix CI badges in README.md and fix dracut description

While fixing the CI badges, I removed some old crufty README text.

5 years agonetwork-manager: set kernel hostname from the command line
Beniamino Galvani [Thu, 7 May 2020 05:48:12 +0000 (07:48 +0200)] 
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.

5 years agodracut.conf.5.asc: document how to config --no-compress in the config
Harald Hoyer [Fri, 29 May 2020 09:03:19 +0000 (11:03 +0200)] 
dracut.conf.5.asc: document how to config --no-compress in the config

Fixes: https://github.com/dracutdevs/dracut/issues/824
5 years agodracut.cmdline.7.asc: clarify usage of `rd.lvm.vg` and `rd.lvm.lv`
Harald Hoyer [Fri, 29 May 2020 08:49:47 +0000 (10:49 +0200)] 
dracut.cmdline.7.asc: clarify usage of `rd.lvm.vg` and `rd.lvm.lv`

Fixes: https://github.com/dracutdevs/dracut/issues/816
5 years agoCI: remove Fedora 30, add Fedora 32
Harald Hoyer [Fri, 29 May 2020 08:30:26 +0000 (10:30 +0200)] 
CI: remove Fedora 30, add Fedora 32

5 years agobusybox: simplify listing of supported utilities
Alexander Tsoy [Mon, 25 May 2020 14:49:20 +0000 (17:49 +0300)] 
busybox: simplify listing of supported utilities

'--list' option is supported since busybox-1.20.0, which was released
in 2010.

5 years agodracut-functions: fix find_binary() to return full path
Alexander Tsoy [Mon, 25 May 2020 16:02:05 +0000 (19:02 +0300)] 
dracut-functions: fix find_binary() to return full path

Fixes: a01204202b30 (Allow running on a cross-compiled rootfs)
5 years agoRemove cleanup_trace_mem calls
Kairui Song [Wed, 27 May 2020 13:59:55 +0000 (21:59 +0800)] 
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>
5 years ago99memstrack: hook script should not call exit
Kairui Song [Wed, 27 May 2020 14:07:37 +0000 (22:07 +0800)] 
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>
5 years agoinstall dependant libs too
Tomasz Paweł Gajc [Mon, 11 May 2020 12:49:06 +0000 (14:49 +0200)] 
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

5 years ago51-dracut-rescue.install: Don't use BLS fragment shipped by kernel package
Javier Martinez Canillas [Tue, 5 May 2020 17:11:18 +0000 (19:11 +0200)] 
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>
5 years agoFix test in lsinitrd
Fabian Vogt [Mon, 4 May 2020 08:09:07 +0000 (10:09 +0200)] 
Fix test in lsinitrd

If $uefi is empty, this evaluated to true previously,
resulting in "initrd in UEFI: : 13M".

5 years ago90crypt/module-setup.sh: fix force on multiple lines
Derek Hageman [Fri, 1 May 2020 00:40:13 +0000 (18:40 -0600)] 
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.

5 years ago90kernel-modules/module-setup.sh: add sg kernel module
Harald Hoyer [Thu, 30 Apr 2020 18:42:27 +0000 (20:42 +0200)] 
90kernel-modules/module-setup.sh: add sg kernel module

Fixes udevd messages about failure of `modprobe -bv sg`.

5 years ago90crypt/module-setup.sh: try to catch kernel config changes
Harald Hoyer [Tue, 7 Apr 2020 20:26:25 +0000 (22:26 +0200)] 
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

5 years agoInstall crypto modules in 90kernel-modules
Harald Hoyer [Fri, 24 Apr 2020 09:05:49 +0000 (11:05 +0200)] 
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

5 years agoAlways pull in machinery to read ifcfg files
Peter Georg [Tue, 21 Apr 2020 19:34:38 +0000 (21:34 +0200)] 
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.

5 years agoAdd 99memstrack module
Kairui Song [Wed, 8 Apr 2020 12:09:38 +0000 (20:09 +0800)] 
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.

5 years agoRemove memtrace-ko and rd.memdebug=4 support in dracut
Kairui Song [Wed, 8 Apr 2020 08:39:52 +0000 (16:39 +0800)] 
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.

5 years agonetwork-manager: install libnss DNS and mDNS plugins
Beniamino Galvani [Mon, 23 Mar 2020 21:57:35 +0000 (22:57 +0100)] 
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
5 years agosystemd: skip dependency add for non-existent units
Harald Hoyer [Mon, 20 Apr 2020 13:07:02 +0000 (15:07 +0200)] 
systemd: skip dependency add for non-existent units

Fixes: https://github.com/dracutdevs/dracut/issues/795
5 years agoi18n: Always install /etc/vconsole.conf
Mikhail Novosyolov [Sun, 19 Apr 2020 13:32:41 +0000 (16:32 +0300)] 
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>
5 years agodracut-lib.sh: quote variables in parameter expansion patterns
Jonas Witschel [Sat, 18 Apr 2020 12:55:41 +0000 (14:55 +0200)] 
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
f9c96cf56fed390841eac05c43826e62014c9188, 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 0f6d93eb9d63695a64002ec8b0421fbc9fc8a7a3), leading to
failures in starting the unit.

This partially reverts commit f9c96cf56fed390841eac05c43826e62014c9188.

5 years ago90nvdimm: include nvdimm keys in initrd
Martin Wilck [Wed, 25 Mar 2020 11:23:11 +0000 (12:23 +0100)] 
90nvdimm: include nvdimm keys in initrd

This is necessary to actually unlock NVDIMM keys during boot.

5 years ago95znet: Add a rd.znet_ifname= option
Kairui Song [Thu, 5 Mar 2020 10:44:45 +0000 (18:44 +0800)] 
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>
5 years agoTEST-99: exclude /etc/dnf/* from check
Harald Hoyer [Thu, 9 Apr 2020 20:05:41 +0000 (22:05 +0200)] 
TEST-99: exclude /etc/dnf/* from check

file /etc/dnf/modules.d/eclipse.module.rpmmoved is not owned by any package

5 years agomkinitrd-suse.sh: Fix i586 platform detection
Daniel Molkentin [Tue, 7 Apr 2020 10:27:30 +0000 (12:27 +0200)] 
mkinitrd-suse.sh: Fix i586 platform detection

Reference: boo#1168341

5 years agomultipath: add automatic configuration for multipath
Ben Howard [Fri, 3 Apr 2020 19:32:44 +0000 (13:32 -0600)] 
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).

5 years agourl-lib: drop NSS if it's not in curl --version
Alexander Sosedkin [Thu, 26 Mar 2020 14:11:15 +0000 (15:11 +0100)] 
url-lib: drop NSS if it's not in curl --version

5 years agodhclient-script: Fix typo in output of BOUND & BOUND6 cases
Patrick Talbert [Wed, 18 Mar 2020 14:58:48 +0000 (15:58 +0100)] 
dhclient-script: Fix typo in output of  BOUND & BOUND6 cases

No bonding going on here.

Signed-off-by: Patrick Talbert <ptalbert@redhat.com>
5 years agodasd: only install /etc/dasd.conf if present
Sebastian Mitterle [Thu, 19 Mar 2020 11:12:50 +0000 (12:12 +0100)] 
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
```

5 years agoMakefile: really make externally defined CFLAGS work
Daniel Molkentin [Fri, 13 Mar 2020 10:39:46 +0000 (11:39 +0100)] 
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.

5 years agoMake externally defined CFLAGS work
Daniel Molkentin [Fri, 20 Apr 2018 22:11:17 +0000 (00:11 +0200)] 
Make externally defined CFLAGS work

5 years agodracut.sh: add check for invalid configuration files
Harald Hoyer [Wed, 23 Oct 2019 12:16:56 +0000 (14:16 +0200)] 
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.

5 years agocryptroot-ask: no warn if /run/cryptsetup exist
Đoàn Trần Công Danh [Sat, 14 Mar 2020 04:44:47 +0000 (11:44 +0700)] 
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.

5 years agodon't prefer $TMPDIR over --tmpdir
Dusty Mabe [Fri, 13 Mar 2020 19:40:11 +0000 (15:40 -0400)] 
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.

5 years agoTEST-03-USR-MOUNT/test.sh: increase loglevel
Harald Hoyer [Thu, 12 Mar 2020 12:44:08 +0000 (13:44 +0100)] 
TEST-03-USR-MOUNT/test.sh: increase loglevel

to debug the spurious fails

5 years ago.travis.yml: reformat
Harald Hoyer [Thu, 12 Mar 2020 12:01:46 +0000 (13:01 +0100)] 
.travis.yml: reformat

5 years agonetwork: fix glob matching ipv6 addresses
Lukas Nykryn [Tue, 10 Mar 2020 14:18:37 +0000 (15:18 +0100)] 
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.

5 years agoTEST-41-NBD-NM/Makefile: should be based on TEST-40-NBD not TEST-20-NFS
Harald Hoyer [Thu, 12 Mar 2020 12:22:10 +0000 (13:22 +0100)] 
TEST-41-NBD-NM/Makefile: should be based on TEST-40-NBD not TEST-20-NFS

5 years agogithub actions: use test container directly
Harald Hoyer [Thu, 12 Mar 2020 11:50:08 +0000 (12:50 +0100)] 
github actions: use test container directly

5 years agotest: use dd from /dev/zero, instead of creating files with a hole
Harald Hoyer [Thu, 12 Mar 2020 10:55:37 +0000 (11:55 +0100)] 
test: use dd from /dev/zero, instead of creating files with a hole

5 years agonetwork-manager: ensure that nm-run.sh is executed when needed
Beniamino Galvani [Wed, 11 Mar 2020 08:40:50 +0000 (09:40 +0100)] 
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
5 years agoTEST-12-RAID-DEG/create-root.sh: more udevadm settle
Harald Hoyer [Wed, 11 Mar 2020 12:14:26 +0000 (13:14 +0100)] 
TEST-12-RAID-DEG/create-root.sh: more udevadm settle

5 years agobtrfs: force preload btrfs module
Harald Hoyer [Wed, 11 Mar 2020 11:56:52 +0000 (12:56 +0100)] 
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?

5 years agoREADME.md: fix github action badge links
Harald Hoyer [Wed, 11 Mar 2020 11:38:01 +0000 (12:38 +0100)] 
README.md: fix github action badge links

5 years ago95fcoe: default rd.nofcoe to false
Thomas Blume [Mon, 24 Feb 2020 11:11:25 +0000 (12:11 +0100)] 
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.

5 years agoFix pre-trigger stage by replacing exit with return in lldpad.sh
Radek Vykydal [Tue, 10 Mar 2020 09:48:21 +0000 (10:48 +0100)] 
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.

5 years agoMakefile: fix VERSION again
Alexander Tsoy [Sun, 8 Mar 2020 02:47:50 +0000 (05:47 +0300)] 
Makefile: fix VERSION again

The variable is not undefined anymore after the first assignment, so
we should check if variable is empty instead.

5 years ago95dcssblk: fix script permissions
Daniel Molkentin [Tue, 24 Jul 2018 17:38:30 +0000 (19:38 +0200)] 
95dcssblk: fix script permissions

5 years agoUse TMPDIR if available
Topi Miettinen [Sun, 1 Mar 2020 08:45:16 +0000 (10:45 +0200)] 
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>
5 years agodracut.sh: don't call fsfreeze on subvol of root file system
Martin Wilck [Wed, 29 Jan 2020 22:53:29 +0000 (23:53 +0100)] 
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: de576db3c225 ("call fsfreeze(8) on /boot to flush initramfs data & metadata to media")
5 years ago95zfcp_rules/parse-zfcp.sh: remove rule existence check
Daniel Molkentin [Mon, 21 Jan 2019 13:40:06 +0000 (14:40 +0100)] 
95zfcp_rules/parse-zfcp.sh: remove rule existence check

Reference: bsc#1008352

Original-Patch-By: Michal Suchanek <msuchanek@suse.com>
5 years ago99base: Remove duplicate nfsroot_to_var from dracut-lib.sh
Daniel Molkentin [Wed, 30 Oct 2019 08:30:32 +0000 (09:30 +0100)] 
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

5 years agodracut.spec: add 90nvdimm
Martin Wilck [Fri, 6 Mar 2020 09:26:43 +0000 (10:26 +0100)] 
dracut.spec: add 90nvdimm

5 years ago90kernel-modules: remove nfit from static module list
Martin Wilck [Thu, 30 Jan 2020 14:44:28 +0000 (15:44 +0100)] 
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.

5 years agoAdd module "90nvdimm" for NVDIMM support
Martin Wilck [Thu, 30 Jan 2020 12:48:11 +0000 (13:48 +0100)] 
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.

5 years agoMakefile: merge main-version and git-version earlier
Đoàn Trần Công Danh [Fri, 6 Mar 2020 01:46:36 +0000 (08:46 +0700)] 
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)

5 years agodracut.spec: add version check for deprecated files
Harald Hoyer [Wed, 4 Mar 2020 13:39:39 +0000 (14:39 +0100)] 
dracut.spec: add version check for deprecated files

5 years agotest/TEST-35-ISCSI-MULTI: bump disk space
Harald Hoyer [Wed, 4 Mar 2020 13:39:22 +0000 (14:39 +0100)] 
test/TEST-35-ISCSI-MULTI: bump disk space

5 years agoNEWS, AUTHORS: update 050
Harald Hoyer [Wed, 4 Mar 2020 10:43:22 +0000 (11:43 +0100)] 
NEWS, AUTHORS: update

5 years agoTEST-14-IMSM: clear marker disk
Harald Hoyer [Wed, 4 Mar 2020 10:02:33 +0000 (11:02 +0100)] 
TEST-14-IMSM: clear marker disk

5 years agofedora-test-github.sh: only fetch tags, if building rpm
Harald Hoyer [Wed, 4 Mar 2020 10:01:52 +0000 (11:01 +0100)] 
fedora-test-github.sh: only fetch tags, if building rpm

5 years agoConsider also drm_dev_register when looking for gpu driver
Marek Marczykowski-Górecki [Tue, 3 Mar 2020 20:20:34 +0000 (21:20 +0100)] 
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

5 years ago.github/workflows: bump timeout to 45min
Harald Hoyer [Wed, 4 Mar 2020 08:23:46 +0000 (09:23 +0100)] 
.github/workflows: bump timeout to 45min

5 years ago90kernel-modules: Add PCI host controller modules
Daniel Molkentin [Tue, 4 Feb 2020 14:51:57 +0000 (15:51 +0100)] 
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

5 years ago90crypt: install crypt-run-generator in non-systemd environments
Daniel Molkentin [Thu, 6 Feb 2020 09:00:23 +0000 (10:00 +0100)] 
90crypt: install crypt-run-generator in non-systemd environments

5 years ago90crypt: Do not call cryptsetup in a systemd environment
Daniel Molkentin [Tue, 29 Oct 2019 13:29:34 +0000 (14:29 +0100)] 
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

5 years agoMerge branch 'regenerate_all'
Daniel Molkentin [Tue, 3 Mar 2020 19:09:45 +0000 (20:09 +0100)] 
Merge branch 'regenerate_all'

5 years agoEnable resume module if hibernation's enabled on the host
nabijaczleweli [Fri, 13 Dec 2019 06:59:59 +0000 (07:59 +0100)] 
Enable resume module if hibernation's enabled on the host

Ref: https://github.com/dracutdevs/dracut/commit/34b56de12aad622d602d6e3bd434e02c840f1cd0
Fixes https://github.com/dracutdevs/dracut/issues/496

5 years agoMerge branch 'master' into regenerate_all 722/head
Daniel Molkentin [Tue, 3 Mar 2020 18:25:16 +0000 (19:25 +0100)] 
Merge branch 'master' into regenerate_all

5 years agoTEST-04-FULL-SYSTEMD: use seperate marker disk for root creation
Harald Hoyer [Tue, 3 Mar 2020 15:56:16 +0000 (16:56 +0100)] 
TEST-04-FULL-SYSTEMD: use seperate marker disk for root creation

5 years agoMake lsinitrd usable for images made with Debian mkinitramfs
Topi Miettinen [Sun, 1 Mar 2020 10:22:30 +0000 (12:22 +0200)] 
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>
5 years agoTEST-04-FULL-SYSTEMD: change error reporting
Harald Hoyer [Mon, 2 Mar 2020 13:55:23 +0000 (14:55 +0100)] 
TEST-04-FULL-SYSTEMD: change error reporting

5 years agodracut_mkdir(): create parent directories as needed.
Lucas C. Villa Real [Thu, 20 Feb 2020 19:37:32 +0000 (16:37 -0300)] 
dracut_mkdir(): create parent directories as needed.

5 years agotest/TEST-0[34] remove qemu return check
Harald Hoyer [Mon, 2 Mar 2020 13:40:16 +0000 (14:40 +0100)] 
test/TEST-0[34] remove qemu return check

remove check of qemu return code $?

seems like it randomly returns with != 0