]> git.ipfire.org Git - thirdparty/dracut.git/log
thirdparty/dracut.git
4 years agonetwork-manager: remove useless use of basename
Lubomir Rintel [Mon, 17 Jun 2019 08:07:38 +0000 (10:07 +0200)] 
network-manager: remove useless use of basename

4 years agotest/{10,12,13,14,17,30,31}: increase the disk sizes
Lubomir Rintel [Tue, 11 Jun 2019 07:56:13 +0000 (09:56 +0200)] 
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.

4 years ago95fcoe: load 'libfcoe' module as a fallback
Kairui Song [Wed, 12 Jun 2019 06:27:44 +0000 (14:27 +0800)] 
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>
4 years agodracut-install: Add support for compressed kernel modules
Takashi Iwai [Wed, 22 May 2019 12:47:14 +0000 (14:47 +0200)] 
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.

4 years ago35network-legacy: fix classless static route parsing
Frank Deng [Sat, 15 Jun 2019 20:35:42 +0000 (13:35 -0700)] 
35network-legacy: fix classless static route parsing

4 years agoTEST-70-BONDBRIDGETEAMVLAN: get rid of duplicate makefile
Lubomir Rintel [Fri, 21 Jun 2019 11:41:51 +0000 (13:41 +0200)] 
TEST-70-BONDBRIDGETEAMVLAN: get rid of duplicate makefile

4 years agofs-lib: drop a bashism
Lubomir Rintel [Fri, 21 Jun 2019 16:39:48 +0000 (18:39 +0200)] 
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.

4 years ago95iscsi: Fix network setup code for iscsi
Kairui Song [Sun, 23 Jun 2019 12:22:34 +0000 (20:22 +0800)] 
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>
4 years agotest: tell systemd to reboot on fatal errors
Lubomir Rintel [Wed, 26 Jun 2019 09:47:21 +0000 (11:47 +0200)] 
test: tell systemd to reboot on fatal errors

Otherwise systemd would freeze execution, causing the test to time out
instead of failing fast.

4 years agotest/TEST-14-IMSM: detect failure to compose the test setup root
Lubomir Rintel [Tue, 25 Jun 2019 15:39:57 +0000 (17:39 +0200)] 
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 || [...]

4 years agoadd support for creating secureboot signed UEFI images
Max Resch [Sun, 30 Jun 2019 10:16:22 +0000 (12:16 +0200)] 
add support for creating secureboot signed UEFI images

4 years agoask for a password on readkey failure
Max Resch [Tue, 2 Jul 2019 23:22:24 +0000 (01:22 +0200)] 
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

4 years agolsinitrd handle UEFI created with dracut --uefi
Max Resch [Wed, 3 Jul 2019 18:53:41 +0000 (20:53 +0200)] 
lsinitrd handle UEFI created with dracut --uefi

4 years agorngd: new module running early during boot to help generating entropy
Renaud Métrich [Thu, 11 Jul 2019 08:50:40 +0000 (10:50 +0200)] 
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>
4 years agodebug: Add dd into debug module
Michal Koutný [Fri, 12 Jul 2019 13:46:15 +0000 (15:46 +0200)] 
debug: Add dd into debug module

When at it also deduplicate the list of installed utilities.

4 years agotest/TEST-17-LVM-THIN: fail setup if we run out of space in the thin pool
Lubomir Rintel [Wed, 26 Jun 2019 14:42:04 +0000 (16:42 +0200)] 
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.

4 years agomkinitrd-suse.sh: remove trailing "|"
Harald Hoyer [Fri, 19 Jul 2019 13:56:42 +0000 (15:56 +0200)] 
mkinitrd-suse.sh: remove trailing "|"

caused by commit d10f6f836

4 years ago99base: enable the initqueue in both 'dracut --add-device' and 'dracut --mount' cases.
Lianbo Jiang [Mon, 13 May 2019 08:09:25 +0000 (16:09 +0800)] 
99base: enable the initqueue in both 'dracut --add-device' and 'dracut --mount' cases.

The commit 9f3c31cd8d68 ("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>
4 years agoMerge branch 'ryncsn-optimization'
Harald Hoyer [Fri, 19 Jul 2019 13:48:37 +0000 (15:48 +0200)] 
Merge branch 'ryncsn-optimization'

4 years agoMerge branch 'optimization' of https://github.com/ryncsn/dracut into ryncsn-optimization
Harald Hoyer [Fri, 19 Jul 2019 13:48:22 +0000 (15:48 +0200)] 
Merge branch 'optimization' of https://github.com/ryncsn/dracut into ryncsn-optimization

4 years agosquash: also squash systemctl if switch-root is not needed
Kairui Song [Wed, 13 Mar 2019 09:36:53 +0000 (17:36 +0800)] 
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>
4 years agosquash: fix and simplify required_in_root
Kairui Song [Mon, 11 Mar 2019 11:46:19 +0000 (19:46 +0800)] 
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>
4 years agosquash: squash systemd binary and udevadm
Kairui Song [Mon, 11 Mar 2019 10:44:02 +0000 (18:44 +0800)] 
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>
4 years agodracut.sh: record the actual hostonly modules for hostonly mode
Kairui Song [Tue, 7 May 2019 11:15:42 +0000 (19:15 +0800)] 
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>
4 years ago99squash: fail early if can't install require modules in initramfs
Kairui Song [Tue, 25 Dec 2018 09:53:24 +0000 (17:53 +0800)] 
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.

4 years agodracut.sh: Fix udevdir detection
Hongxu Jia [Wed, 3 Apr 2019 07:24:47 +0000 (15:24 +0800)] 
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
[https://github.com/systemd/systemd/commit/a168792c2d95695fd30c0371d4b3890a9df1eafb]

So check binary `ata_id' to instead.

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
4 years agomkinitrd-suse.sh: simplify get_kernel_version
Daniel Molkentin [Thu, 18 Jul 2019 08:14:37 +0000 (10:14 +0200)] 
mkinitrd-suse.sh: simplify get_kernel_version

This generalizes the naming and provides a workaround for compressed
kernels on s390.

Reference: bsc#1139939

4 years agotests: Ignore .testdir
Daniel Molkentin [Thu, 18 Jul 2019 09:16:18 +0000 (11:16 +0200)] 
tests: Ignore .testdir

4 years ago95fcoe: Fix startup when fcoe module is included
Daniel Molkentin [Thu, 18 Jul 2019 09:29:29 +0000 (11:29 +0200)] 
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

4 years agocall netroot on wicked dhcp setup
Thomas Blume [Thu, 4 Jul 2019 07:10:30 +0000 (09:10 +0200)] 
call netroot on wicked dhcp setup

4 years agonfsroot follow ifcfg settings for boot protocol
Thomas Blume [Wed, 19 Jun 2019 13:15:57 +0000 (15:15 +0200)] 
nfsroot follow ifcfg settings for boot protocol

4 years agodracut-install: Add support for compressed firmware files
Takashi Iwai [Wed, 8 May 2019 05:12:06 +0000 (07:12 +0200)] 
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.

4 years ago01fips: add cfb cipher
Lukas Nykryn [Tue, 16 Jul 2019 07:27:01 +0000 (08:27 +0100)] 
01fips: add cfb cipher

Required by FIPS standard

4 years agoAdd support for riscv64
Andreas Schwab [Mon, 8 Jul 2019 08:24:58 +0000 (10:24 +0200)] 
Add support for riscv64

4 years agotravis: run TEST-13-ENC-RAID-LVM on Fedora 29
Lubomir Rintel [Thu, 27 Jun 2019 14:22:04 +0000 (16:22 +0200)] 
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

4 years agotravis: run TEST-14-IMSM on Fedora 29
Lubomir Rintel [Thu, 27 Jun 2019 14:20:32 +0000 (16:20 +0200)] 
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/

5 years agofips: ensure fs module for /boot is installed
Kairui Song [Thu, 14 Mar 2019 10:54:10 +0000 (18:54 +0800)] 
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>
5 years agoiscsi: always popd, even if there is no iscsi device
Renaud Métrich [Fri, 1 Mar 2019 10:46:43 +0000 (11:46 +0100)] 
iscsi: always popd, even if there is no iscsi device

5 years agodracut: let module handling function accept optional path option 545/head
Kairui Song [Thu, 21 Feb 2019 05:18:37 +0000 (13:18 +0800)] 
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>
5 years agoinstall: string_hash_func should not be fed with NULL
Lukas Nykryn [Thu, 14 Feb 2019 19:18:04 +0000 (20:18 +0100)] 
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.

5 years agoFix 98dracut-systemd/dracut-emergency.sh
Böszörményi Zoltán [Tue, 12 Feb 2019 11:55:32 +0000 (12:55 +0100)] 
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>
5 years ago95iscsi: /sys/devices/platform/*/flashnode_sess-*/is_boot_target sometimes does not...
Lukas Nykryn [Thu, 7 Feb 2019 15:09:43 +0000 (16:09 +0100)] 
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

5 years ago95iscsi: fix a typo in a name of iscsiuio
Lukas Nykryn [Tue, 15 Jan 2019 15:42:38 +0000 (16:42 +0100)] 
95iscsi: fix a typo in a name of iscsiuio

5 years ago91zipl: Don't use contents of commented lines
Thomas Abraham [Wed, 19 Dec 2018 23:24:41 +0000 (18:24 -0500)] 
91zipl: Don't use contents of commented lines

Comment lines should be ignored. They should not be used for determining
the /boot/zipl device

5 years ago00systemd: check if systemd version is a number
Frantisek Sumsal [Fri, 4 Jan 2019 15:51:15 +0000 (16:51 +0100)] 
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.

5 years ago10i18n: Fix keymaps not getting included sometimes
Jens Heise [Mon, 7 Jan 2019 15:47:23 +0000 (16:47 +0100)] 
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.

5 years agoFix a missing space in example configs
Daniel Molkentin [Sun, 20 Jan 2019 20:56:05 +0000 (21:56 +0100)] 
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

5 years ago95fcoe: Add the rd.nofcoe option to disable the FCoE module from the command line
Patrick Talbert [Fri, 30 Nov 2018 08:28:09 +0000 (09:28 +0100)] 
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>
5 years ago95iscsi: decouple iscsi from sysinit.target
Lukas Nykryn [Thu, 10 Jan 2019 17:08:32 +0000 (18:08 +0100)] 
95iscsi: decouple iscsi from sysinit.target

5 years agoRevert "95iscsi: drop systemd dracut service dependencies for iscsid"
Lukas Nykryn [Thu, 10 Jan 2019 16:44:54 +0000 (17:44 +0100)] 
Revert "95iscsi: drop systemd dracut service dependencies for iscsid"

This reverts commit 765b20333d9589e09b29dbe0d8304a56745623c6.

5 years agolsinitrd: list squash content as well
Kairui Song [Wed, 26 Dec 2018 09:38:02 +0000 (17:38 +0800)] 
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>
5 years agoemergency mode: use sulogin
Daniel Molkentin [Wed, 5 Dec 2018 15:52:45 +0000 (16:52 +0100)] 
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

5 years ago95iscsi: rd.iscsi.initiator should have priority over stored configuration
Lukas Nykryn [Tue, 8 Jan 2019 16:16:07 +0000 (17:16 +0100)] 
95iscsi: rd.iscsi.initiator should have priority over stored configuration

5 years agoremove bashism in various boot scripts
Đoàn Trần Công Danh [Sun, 6 Jan 2019 04:48:02 +0000 (11:48 +0700)] 
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>
5 years agothe strip command should avoid changing the file modification time
Attila Bruncsak [Fri, 14 Dec 2018 14:57:33 +0000 (15:57 +0100)] 
the strip command should avoid changing the file modification time

5 years agoremove superfluous quotes in parameter expansion
Norbert Lange [Wed, 12 Dec 2018 16:21:12 +0000 (17:21 +0100)] 
remove superfluous quotes in parameter expansion

as this breaks busybox hush shell.
offending functions can be found with
grep -r '${[^}]*"[^}]*}'

5 years ago95iscsi/module-setup.sh: do not require 'hostname' anymore
Harald Hoyer [Tue, 4 Dec 2018 09:27:17 +0000 (10:27 +0100)] 
95iscsi/module-setup.sh: do not require 'hostname' anymore

5 years agofedora-test.sh: install tcpdump
Harald Hoyer [Tue, 4 Dec 2018 09:22:28 +0000 (10:22 +0100)] 
fedora-test.sh: install tcpdump

5 years agotest/test-functions: correctly move server.log
Harald Hoyer [Tue, 4 Dec 2018 09:06:12 +0000 (10:06 +0100)] 
test/test-functions: correctly move server.log

5 years agoinstall/dracut-install.c: install module dependencies of dependencies
Harald Hoyer [Tue, 4 Dec 2018 09:02:45 +0000 (10:02 +0100)] 
install/dracut-install.c: install module dependencies of dependencies

5 years agonetwork: skip already enslaved interfaces
Harald Hoyer [Tue, 21 Aug 2018 11:14:44 +0000 (13:14 +0200)] 
network: skip already enslaved interfaces

5 years agodracut.modules.7.asc: typo correction
Bruno E. O. Meneguele [Fri, 30 Nov 2018 15:01:21 +0000 (13:01 -0200)] 
dracut.modules.7.asc: typo correction

Correct simple typo in .7 manpage for dracut.

Signed-off-by: Bruno E. O. Meneguele <bmeneg@redhat.com>
5 years agokill bogus comment
Thierry Vignaud [Fri, 30 Nov 2018 14:41:05 +0000 (15:41 +0100)] 
kill bogus comment

should have been killed in commit 4a855e6bebed956c108865823bcc131ebea2841a

5 years agonetwork-manager: call the online hook for connected devices
Lubomir Rintel [Tue, 27 Nov 2018 14:30:48 +0000 (15:30 +0100)] 
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.

5 years agodracut-initramfs-restore: set selinux labels
Lukas Nykryn [Tue, 27 Nov 2018 14:27:53 +0000 (15:27 +0100)] 
dracut-initramfs-restore: set selinux labels

5 years agofips: removed false-positive 'FATAL: Module xxx not found' error message when kernel...
Renaud Métrich [Wed, 14 Nov 2018 12:19:27 +0000 (13:19 +0100)] 
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>
5 years agoDelay argument "-d" requires number
masem [Tue, 13 Nov 2018 23:48:39 +0000 (00:48 +0100)] 
Delay argument "-d" requires number

Arguments "-f -d -n" fails with "invalid number -n", because -d delay expects number of seconds.

5 years agosquash: unsquash the root image instead of mounting it on shutdown
Kairui Song [Fri, 9 Nov 2018 02:48:28 +0000 (10:48 +0800)] 
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>
5 years agoFixed some SUSE specific typos and outputs
Pedro Monreal [Thu, 8 Nov 2018 13:15:38 +0000 (14:15 +0100)] 
Fixed some SUSE specific typos and outputs

5 years agodracut.install: call dracut with --force
Lukas Nykryn [Thu, 25 Oct 2018 13:30:36 +0000 (15:30 +0200)] 
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

5 years agoMakefile: add srpm target
Harald Hoyer [Wed, 24 Oct 2018 13:14:03 +0000 (15:14 +0200)] 
Makefile: add srpm target

5 years ago95iscsi: drop systemd dracut service dependencies for iscsid
Dusty Mabe [Mon, 22 Oct 2018 17:25:29 +0000 (13:25 -0400)] 
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

5 years ago95dasd_rules: mark dasd rules host_only
Daniel Molkentin [Fri, 19 Oct 2018 12:39:30 +0000 (14:39 +0200)] 
95dasd_rules: mark dasd rules host_only

Reference: bsc#1090884

5 years ago99base: Allow files with backslashes in hostonly files
Daniel Molkentin [Fri, 19 Oct 2018 12:30:36 +0000 (14:30 +0200)] 
99base: Allow files with backslashes in hostonly files

Files with blackslashes are routinely by systemd.

Reference: bsc#1090884

5 years agofips: check fips integrity just before mounting local filesystems in /sysroot
Renaud Métrich [Fri, 19 Oct 2018 11:21:37 +0000 (13:21 +0200)] 
fips: check fips integrity just before mounting local filesystems in /sysroot

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
5 years ago99squash: Don't clean up squahfs on isolate
Kairui Song [Thu, 18 Oct 2018 09:05:22 +0000 (17:05 +0800)] 
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>
5 years ago40network: Don't include 40network by default
Kairui Song [Fri, 12 Oct 2018 05:07:13 +0000 (13:07 +0800)] 
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>
5 years agoAdded space in Resolving executable dependencies done as in the rest of the messages
Pedro Monreal [Mon, 8 Oct 2018 09:09:11 +0000 (11:09 +0200)] 
Added space in Resolving executable dependencies done as in the rest of the messages

5 years agodracut.spec: Fix error introduced by 70291ed
Kairui Song [Sat, 29 Sep 2018 09:14:31 +0000 (17:14 +0800)] 
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.

5 years agodracut-install: simplify ldd parsing logic
Mike Gilbert [Thu, 4 Oct 2018 20:45:47 +0000 (16:45 -0400)] 
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>
5 years agoFix tests with network-legacy 049
Harald Hoyer [Mon, 8 Oct 2018 13:38:33 +0000 (15:38 +0200)] 
Fix tests with network-legacy

5 years agoAUTHORS: update
Harald Hoyer [Mon, 8 Oct 2018 13:31:49 +0000 (15:31 +0200)] 
AUTHORS: update

5 years agoNEWS: update
Harald Hoyer [Mon, 8 Oct 2018 13:31:08 +0000 (15:31 +0200)] 
NEWS: update

5 years agomodules.d: Add a module for handling additional depmod kernel module directories
Eugene Syromiatnikov [Sat, 1 Sep 2018 12:02:32 +0000 (14:02 +0200)] 
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>
5 years agodracut.spec: fixed invalid spec line
Harald Hoyer [Fri, 21 Sep 2018 10:41:00 +0000 (12:41 +0200)] 
dracut.spec: fixed invalid spec line

5 years agonetwork-manager: add module
Lubomir Rintel [Thu, 30 Aug 2018 14:44:22 +0000 (16:44 +0200)] 
network-manager: add module

5 years agonetwork-legacy: split off from network module
Lubomir Rintel [Thu, 30 Aug 2018 14:44:22 +0000 (16:44 +0200)] 
network-legacy: split off from network module

5 years agonetwork: fix an error message
Lubomir Rintel [Fri, 31 Aug 2018 14:51:38 +0000 (16:51 +0200)] 
network: fix an error message

5 years agoiscsi: start iscsid even w/o systemd
Lubomir Rintel [Thu, 30 Aug 2018 16:41:37 +0000 (18:41 +0200)] 
iscsi: start iscsid even w/o systemd

5 years agoiscsi: do not install all of /etc/iscsi unless hostonly
Lubomir Rintel [Thu, 30 Aug 2018 16:38:34 +0000 (18:38 +0200)] 
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.

5 years agoiscsi: do not replace the configuration in the host system
Lubomir Rintel [Thu, 30 Aug 2018 14:21:17 +0000 (16:21 +0200)] 
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.

5 years agonetwork: configure NetworkManager to use dhclient
Lubomir Rintel [Tue, 18 Sep 2018 09:17:54 +0000 (11:17 +0200)] 
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).

5 years agodracut.spec: Add dracut-squash package
Kairui Song [Thu, 20 Sep 2018 09:23:19 +0000 (17:23 +0800)] 
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.

5 years agoAdd support for building a squashed initramfs
Kairui Song [Tue, 11 Sep 2018 11:32:24 +0000 (19:32 +0800)] 
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>
5 years agobase/dracut-lib.sh: use "command -v" in pidof()
Alexander Tsoy [Sun, 9 Sep 2018 10:57:33 +0000 (13:57 +0300)] 
base/dracut-lib.sh: use "command -v" in pidof()

"type -P" doesn't work in dash

5 years agoinstall: avoid non-portable __WORDSIZE
Alexander Tsoy [Sat, 8 Sep 2018 23:47:09 +0000 (02:47 +0300)] 
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

5 years agoPrevent environment leaking into initrd-release
Alexander Tsoy [Sat, 8 Sep 2018 14:02:03 +0000 (17:02 +0300)] 
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.

5 years agodmsquash-live/apply-live-updates: Test proper file link.
Frederick Grose [Mon, 3 Sep 2018 23:41:58 +0000 (19:41 -0400)] 
dmsquash-live/apply-live-updates: Test proper file link.

Update flag link to /dev/root as required by commit
789668deb3e6f8584ffab964d2204ddcb75f0a06.

5 years agodmsquash-live-root: Manage absent overlayfs module better.
Frederick Grose [Mon, 3 Sep 2018 23:02:23 +0000 (19:02 -0400)] 
dmsquash-live-root: Manage absent overlayfs module better.

die when required; systemctl reload otherwise.

5 years agodmsquash-live: Avoid grep and sed in this module.
Frederick Grose [Mon, 3 Sep 2018 21:01:53 +0000 (17:01 -0400)] 
dmsquash-live: Avoid grep and sed in this module.

strstr and variable string manipulations suffice.