]> git.ipfire.org Git - thirdparty/dracut-ng.git/log
thirdparty/dracut-ng.git
2 years agotest(NFS): enable NFSv4 tests
Laszlo Gombos [Wed, 3 Apr 2024 03:23:12 +0000 (23:23 -0400)] 
test(NFS): enable NFSv4 tests

In addition make sure that exportfs is available before attempting
to run the tests.

2 years agotest(LVM): make test 11 use the test dracut modules
Laszlo Gombos [Sat, 4 Mar 2023 12:33:34 +0000 (12:33 +0000)] 
test(LVM): make test 11 use the test dracut modules

2 years agodocs(README.md): remove reference to old kernel mailing list
Antonio Alvarez Feijoo [Thu, 8 Jun 2023 13:49:44 +0000 (15:49 +0200)] 
docs(README.md): remove reference to old kernel mailing list

Fixes issue #2135

2 years agorevert(dracut-install): file created without restricting permissions
Laszlo [Tue, 2 Apr 2024 15:47:28 +0000 (11:47 -0400)] 
revert(dracut-install): file created without restricting permissions

This reverts commit 3439d139616196f0cd0af2e6244acf6c5f85621f.

2 years agoci: drop which package from CI containers
Laszlo Gombos [Tue, 2 Apr 2024 23:39:46 +0000 (19:39 -0400)] 
ci: drop which package from CI containers

Prefer command over which and keep it that way.

2 years agoci: don't validate the pull request title
Laszlo Gombos [Wed, 3 Apr 2024 00:58:05 +0000 (20:58 -0400)] 
ci: don't validate the pull request title

2 years agofix(dracut.sh): recognize kernel file in /boot named vmlinux too
Icenowy Zheng [Sun, 18 Feb 2024 15:20:06 +0000 (23:20 +0800)] 
fix(dracut.sh): recognize kernel file in /boot named vmlinux too

The kernel file, at least in AOSC OS, is named vmlinux instead of
vmlinuz if uncompressed.

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
2 years agochore(deps): bump actions/upload-artifact from 3 to 4
dependabot[bot] [Tue, 2 Apr 2024 20:43:39 +0000 (20:43 +0000)] 
chore(deps): bump actions/upload-artifact from 3 to 4

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agochore(deps): bump github/codeql-action from 2 to 3
dependabot[bot] [Tue, 2 Apr 2024 20:43:48 +0000 (20:43 +0000)] 
chore(deps): bump github/codeql-action from 2 to 3

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoci: switch ommisery to upstream version
Laszlo Gombos [Tue, 2 Apr 2024 16:05:09 +0000 (12:05 -0400)] 
ci: switch ommisery to upstream version

2 years agoci: disable running flaky tests on openSUSE
Laszlo Gombos [Tue, 2 Apr 2024 15:53:26 +0000 (11:53 -0400)] 
ci: disable running flaky tests on openSUSE

2 years agochore(deps): bump luizm/action-sh-checker from 0.6.0 to 0.8.0
dependabot[bot] [Tue, 31 Oct 2023 18:43:28 +0000 (18:43 +0000)] 
chore(deps): bump luizm/action-sh-checker from 0.6.0 to 0.8.0

Bumps [luizm/action-sh-checker](https://github.com/luizm/action-sh-checker) from 0.6.0 to 0.8.0.
- [Release notes](https://github.com/luizm/action-sh-checker/releases)
- [Commits](https://github.com/luizm/action-sh-checker/compare/v0.6.0...v0.8.0)

---
updated-dependencies:
- dependency-name: luizm/action-sh-checker
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoci: if container is 'all' run tests on all containers
Laszlo Gombos [Sun, 26 Feb 2023 18:22:49 +0000 (18:22 +0000)] 
ci: if container is 'all' run tests on all containers

Test container names are discovered using "find" command.
Add an option to specify container registry.

2 years agoci: if list of tests is empty, run all tests
Laszlo Gombos [Sun, 26 Feb 2023 13:51:57 +0000 (13:51 +0000)] 
ci: if list of tests is empty, run all tests

Test matrix for all tests is computed using "find" to.

2 years agoci: allow manual test workflow to set environment
Laszlo Gombos [Wed, 22 Feb 2023 17:41:22 +0000 (17:41 +0000)] 
ci: allow manual test workflow to set environment

Enable rd.debug for manual builds by default and allow changing it.

2 years agoci(lint): disable `sh-checker` ShellCheck
Jan Macku [Tue, 3 Oct 2023 08:33:26 +0000 (10:33 +0200)] 
ci(lint): disable `sh-checker` ShellCheck

ShellCheck linting is performed by `differential-shellcheck`.

2 years agoci(lint): remove broken parameter of sh-checker
Jan Macku [Tue, 3 Oct 2023 08:30:06 +0000 (10:30 +0200)] 
ci(lint): remove broken parameter of sh-checker

The `sh_checker_comment: true` requires special permissions (`pull-requests: write`).
This permission level could be achieved only on PR from the `dracut` repository. When PR is opened from the fork, it automatically drops to `read` only.

error message:
```
Commenting on the pull request
{
  "message": "Resource not accessible by integration",
  "documentation_url": "https://docs.github.com/rest/issues/comments#create-an-issue-comment"
}
```

2 years agoci(lint): add differential-shellcheck action
Jan Macku [Tue, 3 Oct 2023 08:17:22 +0000 (10:17 +0200)] 
ci(lint): add differential-shellcheck action

It performs differential ShellCheck scans and reports results directly on GitHub.

documentation: https://github.com/redhat-plumbers-in-action/differential-shellcheck

Signed-off-by: Jan Macku <jamacku@redhat.com>
2 years agofix(dracut-systemd): use `DRACUT_VERSION` instead of `VERSION`
Antonio Alvarez Feijoo [Tue, 10 Oct 2023 12:38:38 +0000 (14:38 +0200)] 
fix(dracut-systemd): use `DRACUT_VERSION` instead of `VERSION`

`VERSION` can contain other values unrelated to the dracut version, which
garbles the output.

2 years agoci: add support for releasing with signed tags
Henrik Gombos [Sat, 5 Aug 2023 13:07:10 +0000 (09:07 -0400)] 
ci: add support for releasing with signed tags

Now that tools/release.sh supports all steps described in RELEASE.md,
update RELEASE.md and point it to release.sh as the canonical
manual way to make a release.

2 years agofix(release): dracutdevs/dracut --> dracut-ng/dracut-ng
Laszlo Gombos [Sun, 31 Mar 2024 23:35:13 +0000 (19:35 -0400)] 
fix(release): dracutdevs/dracut --> dracut-ng/dracut-ng

2 years agofix(dmsquash-live): use the overlay size with thin provisioning
gregory-lee-bartholomew [Tue, 9 Jan 2024 18:16:53 +0000 (18:16 +0000)] 
fix(dmsquash-live): use the overlay size with thin provisioning

Using the overlay size in the device mapper table allows the filesystem
in the base image to be extended if the overlay is larger than the
base image (e.g. `resize2fs /dev/mapper/live-rw`).

2 years agofix(Makefile): release is now just made out of a git sha
Henrik Gombos [Fri, 25 Aug 2023 15:05:17 +0000 (11:05 -0400)] 
fix(Makefile): release is now just made out of a git sha

2 years agochore(gitignore): remove modules.d/99base/switch_root from
Henrik Gombos [Sun, 27 Aug 2023 00:45:05 +0000 (20:45 -0400)] 
chore(gitignore): remove modules.d/99base/switch_root from

switch_root use to be a native binary that was built, but not anymore.

2 years agoci: only run C code scan if src/ directory changed
Laszlo Gombos [Sun, 31 Mar 2024 23:55:57 +0000 (19:55 -0400)] 
ci: only run C code scan if src/ directory changed

2 years agotest(FULL SYSTEMD): no need to include dbus to the target rootfs 59/head
Laszlo Gombos [Sat, 4 Nov 2023 06:25:18 +0000 (02:25 -0400)] 
test(FULL SYSTEMD): no need to include dbus to the target rootfs

systemd does not depend on dbus.

2 years agofix(check_live_ram): increase /run tmpfs size, if needed
Frederick Grose [Wed, 8 Nov 2023 18:08:19 +0000 (13:08 -0500)] 
fix(check_live_ram): increase /run tmpfs size, if needed

Check the size and available space in /run to enlarge it,
  if needed.
Introduce the check_meminfo() function to dracut-lib.sh
  to replace a less versatile sed call.
Also, use local variables,
  use parameter expansion to assign a default value,
  use test exit logic directly, where possible,
  tweak comments,
  and move the check_live_ram() function to img-lib.sh.

2 years agofeat(dracut.sh): protect `push_host_devs` function
Antonio Alvarez Feijoo [Tue, 19 Dec 2023 14:26:17 +0000 (15:26 +0100)] 
feat(dracut.sh): protect `push_host_devs` function

Check at least that the arguments are not an empty string.

2 years agofix(dracut.sh): do not add device if `find_block_device` returns an error
Antonio Alvarez Feijoo [Tue, 19 Dec 2023 14:09:00 +0000 (15:09 +0100)] 
fix(dracut.sh): do not add device if `find_block_device` returns an error

If `find_block_device` returns an error, the device must not be added to the
list of host devices. E.g., a system with /etc mounted as overlay is pushing
the empty string '' as host device.

```
//usr/bin/dracut@1658(): readlink -f /etc
/usr/bin/dracut@1658(): mp=/etc
/usr/bin/dracut@1659(): mountpoint /etc
//usr/bin/dracut@1660(): find_block_device /etc
//usr/lib/dracut/dracut-functions.sh@366(find_block_device): local _dev _majmin _find_mpt
//usr/lib/dracut/dracut-functions.sh@367(find_block_device): _find_mpt=/etc
//usr/lib/dracut/dracut-functions.sh@369(find_block_device): [[ '' != yes ]]
//usr/lib/dracut/dracut-functions.sh@370(find_block_device): [[ -d /etc/. ]]
//usr/lib/dracut/dracut-functions.sh@371(find_block_device): findmnt -e -v -n -o MAJ:MIN,SOURCE --target /etc
//usr/lib/dracut/dracut-functions.sh@372(find_block_device): read -r _majmin _dev
//usr/lib/dracut/dracut-functions.sh@373(find_block_device): [[ -b overlay ]]
//usr/lib/dracut/dracut-functions.sh@384(find_block_device): [[ overlay == *:* ]]
//usr/lib/dracut/dracut-functions.sh@372(find_block_device): read -r _majmin _dev
//usr/lib/dracut/dracut-functions.sh@372(find_block_device): '[' -n '' ']'
//usr/lib/dracut/dracut-functions.sh@389(find_block_device): return 1
//usr/lib/dracut/dracut-functions.sh@393(find_block_device): [[ ! -f /etc/fstab ]]
//usr/lib/dracut/dracut-functions.sh@395(find_block_device): findmnt -e --fstab -v -n -o MAJ:MIN,SOURCE --target /etc
//usr/lib/dracut/dracut-functions.sh@396(find_block_device): read -r _majmin _dev
//usr/lib/dracut/dracut-functions.sh@397(find_block_device): [[ -n '' ]]
//usr/lib/dracut/dracut-functions.sh@398(find_block_device): _dev=overlay
//usr/lib/dracut/dracut-functions.sh@399(find_block_device): unset _majmin
//usr/lib/dracut/dracut-functions.sh@401(find_block_device): [[ -b overlay ]]
//usr/lib/dracut/dracut-functions.sh@410(find_block_device): [[ overlay == *:* ]]
//usr/lib/dracut/dracut-functions.sh@396(find_block_device): read -r _majmin _dev
//usr/lib/dracut/dracut-functions.sh@396(find_block_device): '[' -n '' ']'
//usr/lib/dracut/dracut-functions.sh@415(find_block_device): return 1
//usr/lib/dracut/dracut-functions.sh@418(find_block_device): return 1
/usr/bin/dracut@1660(): _dev=
//usr/bin/dracut@1661(): readlink -f /dev/block/
/usr/bin/dracut@1661(): _bdev=/dev/block
/usr/bin/dracut@1662(): [[ -b /dev/block ]]
/usr/bin/dracut@1663(): [[ /etc == \/ ]]
/usr/bin/dracut@1664(): push_host_devs ''
```

Fixes #2592

2 years agofix(dracut-install): file created without restricting permissions
Laszlo Gombos [Thu, 23 Feb 2023 05:58:06 +0000 (05:58 +0000)] 
fix(dracut-install): file created without restricting permissions

Resolve: https://github.com/dracutdevs/dracut/security/code-scanning/10

2 years agofix(rootfs-block): remove support for [no]readonlyroot and fastboot
Laszlo Gombos [Sun, 5 Mar 2023 02:05:14 +0000 (02:05 +0000)] 
fix(rootfs-block): remove support for [no]readonlyroot and fastboot

This PR removes some obsolete and undocumented functionality from a
core dracut module.

"readonlyroot" and "noreadonlyroot" command line option are no longer
supported. Use "ro" or "rw" instead.

2 years agofix: do not use modprobe --all
Laszlo Gombos [Sun, 10 Dec 2023 14:13:46 +0000 (09:13 -0500)] 
fix: do not use modprobe --all

busybox modprobe does not support the --all flag

2 years agofix(i18n): silence spurious setfont stderr warning
Laszlo Gombos [Sat, 10 Feb 2024 03:35:04 +0000 (22:35 -0500)] 
fix(i18n): silence spurious setfont stderr warning

Co-authored-by: Zach Dykstra <dykstra.zachary@gmail.com>
2 years agofix(udev-rules): remove legacy persistent network device name rule
Laszlo Gombos [Tue, 28 Feb 2023 17:31:19 +0000 (17:31 +0000)] 
fix(udev-rules): remove legacy persistent network device name rule

2 years agofeat(network): include 98-default-mac-none.link if it exists
Dusty Mabe [Wed, 22 Feb 2023 03:21:35 +0000 (22:21 -0500)] 
feat(network): include 98-default-mac-none.link if it exists

In Fedora Linux there was a new 98-default-mac-none.link file added
to set the MACAddressPolicy=none for bond/bridge/team devices. We'd
like for this policy to apply in the initramfs as well. See

- https://fedoraproject.org/wiki/Changes/MAC_Address_Policy_none
- https://src.fedoraproject.org/rpms/systemd/pull-request/100#

2 years agofix(dmsquash-live): handle relative pathspec
Laszlo Gombos [Mon, 6 Mar 2023 20:26:08 +0000 (20:26 +0000)] 
fix(dmsquash-live): handle relative pathspec

This change is required to make the earlier canonical
example work that is mentioned in the documentation:

At the same time, improve the documentation with a more
specific example.

2 years agotest(RAID): make test 10 use the test dracut modules
Laszlo Gombos [Sat, 25 Feb 2023 01:46:34 +0000 (01:46 +0000)] 
test(RAID): make test 10 use the test dracut modules

2 years agofix(overlayfs): to allow overlay on top of network device (nfs)
Laszlo Gombos [Thu, 30 Mar 2023 14:08:47 +0000 (14:08 +0000)] 
fix(overlayfs): to allow overlay on top of network device (nfs)

Execute mount-overlayfs later in the boot process as a pre-pivot
hook. The existing mount hook is skipped for network boot.

Without this change
`dracut  -a "overlayfs nfs"`
would not work as expected.

Improved the existing test case to test for this scenario.

2 years agofix(overlayfs): allow hostonly
Laszlo Gombos [Tue, 7 Mar 2023 03:26:15 +0000 (03:26 +0000)] 
fix(overlayfs): allow hostonly

Check for overlay kernel module support.

2 years agochore(github): update CODEOWNERS file
Laszlo Gombos [Sun, 31 Mar 2024 17:35:43 +0000 (13:35 -0400)] 
chore(github): update CODEOWNERS file

All CODEOWNERS are automatically added as reviewers.
This should help new contributors to discover from whom to get reviews.

2 years agofix(man): rd.break parameter can be specified multiple times
Laszlo Gombos [Sun, 31 Mar 2024 11:12:38 +0000 (07:12 -0400)] 
fix(man): rd.break parameter can be specified multiple times

2 years agofix(dracut): correct regression with multiple `rd.break=` options
Antonio Alvarez Feijoo [Mon, 12 Feb 2024 12:56:19 +0000 (13:56 +0100)] 
fix(dracut): correct regression with multiple `rd.break=` options

Since the introduction of the `dracut-util` binary to parse kernel command line
arguments, if the user inputs multiple `rd.break=` options, dracut only stops
the boot process at the last one.

```
[    0.985362] localhost dracut-cmdline[245]: /bin/dracut-cmdline@18(): info 'Using kernel command line parameters:' ' ... rd.debug rd.break=cmdline rd.break=pre-pivot'
...
[    1.044979] localhost dracut-cmdline[245]: /bin/dracut-cmdline@48(): getarg rd.break=cmdline -d rdbreak=cmdline
[    1.044979] localhost dracut-cmdline[245]: /lib/dracut-lib.sh@155(getarg): debug_off
[    1.044979] localhost dracut-cmdline[245]: /lib/dracut-lib.sh@23(debug_off): set +x
[    1.044979] localhost dracut-cmdline[245]: /lib/dracut-lib.sh@218(getarg): return 1
```

For options that can be specified multiple times, `getargs` should be used
instead.

```
master> export CMDLINE="rd.break=cmdline rd.break=pre-udev rd.break=pre-pivot"
master> ./dracut-getarg rd.break=cmdline
master> echo $?
1
master> ./dracut-getarg rd.break=pre-udev
master> echo $?
1
master> ./dracut-getarg rd.break=pre-pivot
master> echo $?
0
master> ./dracut-getargs rd.break=cmdline
cmdline
master> echo $?
0
master> ./dracut-getargs rd.break=pre-udev
pre-udev
master> echo $?
0
master> ./dracut-getargs rd.break=pre-pivot
pre-pivot
master> echo $?
0
```

Fixes 501d82f79675a6bf9b37e8250152515863a80236

2 years agofix(dracut-util): do not call `strcmp` if the `value` argument is NULL
Antonio Alvarez Feijoo [Mon, 12 Feb 2024 12:55:20 +0000 (13:55 +0100)] 
fix(dracut-util): do not call `strcmp` if the `value` argument is NULL

The behavior of `strcmp` is undefined if any of its arguments is NULL, which
can lead to a segfault depending on the implementation. So, this check is
required to be able to use `getargs` with options where the value is optional,
e.g., with `rd.break`.

2 years agotest: remove dead code regarding building rpm
Laszlo Gombos [Sat, 18 Feb 2023 07:11:26 +0000 (07:11 +0000)] 
test: remove dead code regarding building rpm

2 years agoci: run legacy network tests on openSUSE instead of Fedora
Laszlo Gombos [Sun, 31 Mar 2024 17:49:43 +0000 (13:49 -0400)] 
ci: run legacy network tests on openSUSE instead of Fedora

openSUSE has been actively maintaining network-legacy dracut module.

Fedora is no longer packaging network-legacy dracut module,
so it is not a good container to test the network-legacy dracut module.

2 years agofix(net-lib): add a new dracut module called net-lib
Laszlo Gombos [Tue, 28 Feb 2023 19:59:13 +0000 (19:59 +0000)] 
fix(net-lib): add a new dracut module called net-lib

2 years agoci: drop maintainer entry from container descriptor files
Laszlo Gombos [Sun, 31 Mar 2024 16:18:06 +0000 (12:18 -0400)] 
ci: drop maintainer entry from container descriptor files

These Dockerfiles are only used in the context of this repo,
no need to point back to the github url.

2 years agofix(45ifcfg): mark as deprecated and strictly opt-in
Jonathan Lebon [Fri, 29 Sep 2023 13:39:15 +0000 (09:39 -0400)] 
fix(45ifcfg): mark as deprecated and strictly opt-in

The `45ifcfg` module should be considered deprecated now since
ifcfg files themselves are deprecated. They've been replaced by e.g.
NetworkManager keyfiles or systemd-networkd files.

Currently, the `45ifcfg` module checks if the `/etc/sysconfig/network-
scripts` directory exists to know if to automatically get pulled in.
However, on systems with NetworkManager, this directory always exists
even if the functionality to read ifcfg files is disabled by default (NM
kindly ships a README in there to ease migrating to keyfiles).

Since almost everyone should've already migrated to a more modern
alternative, let's make this module purely opt-in now.

2 years agotest: skip test 50,60 if ifcfg dracut module can not be installed
Henrik Gombos [Sun, 29 Oct 2023 11:42:20 +0000 (07:42 -0400)] 
test: skip test 50,60 if ifcfg dracut module can not be installed

Test 50 and 60 have a dependency on the ifcfg dracut module.
If ifcfg dracut module is not available, than the preconditions
for these tests are not met.

Since ifcfg dracut module is not available in many Linux enviroments
(such as Arch or Debian), it make sense to explicitelly skip these
tests instead of failing them as they are simply not applicable
to many Linux distributions in their current form.

Instead of disabling the tests, they should be reimplement
so that they do not require ifcfg dracut module in the future.

2 years agochore(deps): bump softprops/action-gh-release from 0.1.15 to 2.0.4
dependabot[bot] [Sat, 30 Mar 2024 00:49:32 +0000 (00:49 +0000)] 
chore(deps): bump softprops/action-gh-release from 0.1.15 to 2.0.4

Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 0.1.15 to 2.0.4.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v0.1.15...v2.0.4)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agofix(90kernel-modules): add surface_aggregator_registry for Surface Laptop 4
Benjamin Drung [Tue, 14 Nov 2023 16:53:31 +0000 (17:53 +0100)] 
fix(90kernel-modules): add surface_aggregator_registry for Surface Laptop 4

The help text for the kernel module `surface_aggregator_registry` says:
"Device-registry for Surface System Aggregator Module (SSAM) devices.
Provides a module and driver which act as a device-registry for SSAM
client devices that cannot be detected automatically, e.g. via ACPI.
Such devices are instead provided and managed via this registry. Devices
provided via this registry are:
 - Platform profile (performance-/cooling-mode) device (5th- and later
   generations).
 - Battery/AC devices (7th-generation).
 - HID input devices (7th-generation)."

This kernel module is needed on the Surface Laptop 4 for the keyboard.

Bug-Ubuntu: https://launchpad.net/bugs/2007050
Bug-linux-surface: https://github.com/linux-surface/linux-surface/issues/839
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2 years agofix(install): handle new -Walloc-size for GCC 14
Sam James [Sun, 12 Nov 2023 03:56:41 +0000 (03:56 +0000)] 
fix(install): handle new -Walloc-size for GCC 14

GCC 14 introduces a new -Walloc-size included in -Wextra which gives:
```
src/install/hashmap.c: In function ‘hashmap_new’:
src/install/hashmap.c:83:11: warning: allocation of insufficient size ‘1’ for type ‘Hashmap’ with size ‘40’ [-Walloc-size]
   83 |         h = malloc0(size);
      |           ^
```

malloc0 is a macro deifned by Dracut (and systemd, see below):
```
malloc0(n) (calloc((n), 1))
```

The calloc prototype is:
```
void *calloc(size_t nmemb, size_t size);
```

So, just swap the number of members and size arguments to match the prototype, as
we're initialising 1 struct of size `sizeof(...)`. GCC then sees we're not
doing anything wrong.

This was fixed upstream in systemd in commit f80bb1f7eaf31476a44c2093d3ee02aba817a0b0 [0].

[0] https://github.com/systemd/systemd/commit/f80bb1f7eaf31476a44c2093d3ee02aba817a0b0

Signed-off-by: Sam James <sam@gentoo.org>
2 years agorefactor(nfs): remove leftover code
Antonio Alvarez Feijoo [Fri, 1 Dec 2023 10:58:45 +0000 (11:58 +0100)] 
refactor(nfs): remove leftover code

- Leftover `grep`s used when `chown` was perfomed after them.
- `$initdir/var/lib/rpcbind` already created with `mkdir -m 0770`, it is not
necessary to `chmod 770` again.

Follow-up to 5ebf48d2baa7d7cbad7cfc663319f8ca80f76398

2 years agoci: improve the readability of job names
Henrik Gombos [Mon, 20 Feb 2023 17:36:30 +0000 (17:36 +0000)] 
ci: improve the readability of job names

Changes the job name from
"Integration Test / test (arch:latest, 10)" to
"Test / 10 on arch".

This change makes the job names shorter and more readable.

Co-authored-by: Laszlo Gombos <laszlo.gombos@gmail.com>
2 years agoci: replace qemu-system-x86 by qemu-kvm in Debian Docker image
Benjamin Drung [Sat, 19 Aug 2023 12:39:17 +0000 (14:39 +0200)] 
ci: replace qemu-system-x86 by qemu-kvm in Debian Docker image

To make the list of required packages more architecture independent,
replace `qemu-system-x86` by `qemu-kvm` in the Debian Docker image.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2 years agoci: drop debhelper and quilt from Debian Docker image
Benjamin Drung [Sat, 19 Aug 2023 12:38:22 +0000 (14:38 +0200)] 
ci: drop debhelper and quilt from Debian Docker image

The debhelper and quilt packages are only needed for packaging dracut.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2 years agoci: drop dash from Debian Docker image
Benjamin Drung [Sat, 19 Aug 2023 12:32:12 +0000 (14:32 +0200)] 
ci: drop dash from Debian Docker image

The dash package is a required that must be present on all Debian
systems.

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2 years agochore(deps): bump docker/login-action from 2 to 3
dependabot[bot] [Tue, 12 Sep 2023 18:54:13 +0000 (18:54 +0000)] 
chore(deps): bump docker/login-action from 2 to 3

Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agofix(base): correct handling of quiet in loginit
Bernhard M. Wiedemann [Mon, 20 Mar 2023 07:42:26 +0000 (08:42 +0100)] 
fix(base): correct handling of quiet in loginit

dracut-lib.sh sets DRACUT_QUIET=no
and passes this to loginit

2 years agorevert(ci): install multipath-tools into openSUSE container
Antonio Alvarez Feijoo [Tue, 22 Aug 2023 12:59:02 +0000 (14:59 +0200)] 
revert(ci): install multipath-tools into openSUSE container

The way multipath works in SUSE distros differs from upstream,
causing some tests to fail.

This reverts commit c08ae406bc7c7d815b0911d9429f400719afc2ae.

Fixes https://github.com/dracutdevs/dracut/commit/c08ae406

2 years agofix(plymouth): return 1 if binary requirements are not met
Antonio Alvarez Feijoo [Tue, 18 Jul 2023 08:34:59 +0000 (10:34 +0200)] 
fix(plymouth): return 1 if binary requirements are not met

2 years agofix(caps): return 1 if binary requirements are not met
Antonio Alvarez Feijoo [Tue, 18 Jul 2023 08:34:43 +0000 (10:34 +0200)] 
fix(caps): return 1 if binary requirements are not met

2 years agorefactor(systemd): remove duplicate entries in inst_multiple
Antonio Alvarez Feijoo [Thu, 4 Jan 2024 15:39:31 +0000 (16:39 +0100)] 
refactor(systemd): remove duplicate entries in inst_multiple

Fixes 28eae10b7007c6a2b64876244e976eb4788e95b1

2 years agochore(deps): bump docker/build-push-action from 4 to 5
dependabot[bot] [Tue, 12 Sep 2023 18:54:09 +0000 (18:54 +0000)] 
chore(deps): bump docker/build-push-action from 4 to 5

Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4 to 5.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agofix(test): running tests no longer requires to be root
Laszlo Gombos [Tue, 21 Feb 2023 00:20:29 +0000 (00:20 +0000)] 
fix(test): running tests no longer requires to be root

Remove sudo from test containers.

2 years agotest(UEFI): make test determinsitic
Laszlo Gombos [Sat, 25 Nov 2023 03:42:20 +0000 (22:42 -0500)] 
test(UEFI): make test determinsitic

identify the boot drive by id

2 years agofix(TEST-62-SKIPCPIO): test always skipped due to buggy `test_check`
Antonio Alvarez Feijoo [Tue, 22 Aug 2023 07:50:06 +0000 (09:50 +0200)] 
fix(TEST-62-SKIPCPIO): test always skipped due to buggy `test_check`

Fixes https://github.com/dracutdevs/dracut/commit/4235c03

2 years agofix(i18n): handle symlinked keymap
Thomas Blume [Mon, 22 Jan 2024 09:28:00 +0000 (10:28 +0100)] 
fix(i18n): handle symlinked keymap

handle keymaps that are symlinks to others, for example:

KEYMAP=de-nodeadkeys in vconsole.conf is:

lrwxrwxrwx 1 root root 20 17. Mai 2023  /usr/share/kbd/keymaps/xkb/de-nodeadkeys.map.gz -> at-nodeadkeys.map.gz

2 years agofix(systemd-255): handle systemd-pcr{phase -> extend} rename
Brian Harring [Tue, 12 Dec 2023 01:10:20 +0000 (17:10 -0800)] 
fix(systemd-255): handle systemd-pcr{phase -> extend} rename

The binary systemd-pcrphase was renamed to systemd-pcrextend
in systemd 255, but the backing units were all left named
systemd-pcrphase.

Fixes: #2583
Signed-off-by: Brian Harring <ferringb@gmail.com>
2 years agofix(90multipath): drop unneeded dependencies from configure service
Benjamin Marzinski [Wed, 17 Jan 2024 01:37:41 +0000 (20:37 -0500)] 
fix(90multipath): drop unneeded dependencies from configure service

multipathd-configure.service previously had the same "After"
dependencies as the multipathd.service, with the idea of running
immediately before it. Multipathd now supports being started much
earlier, but the dependencies in multipathd-configure.service stop it
from being able to.

Since all multipathd-configure.service does is write out a configuration
file, it doesn't need any of its "After" udev dependencies. Remove them,
and clean up some other unneeded dependencies.

2 years agofix(dracut.sh): skip README for AMD microcode generation
Antonio Alvarez Feijoo [Mon, 30 Oct 2023 13:56:39 +0000 (14:56 +0100)] 
fix(dracut.sh): skip README for AMD microcode generation

This file was added in https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/amd-ucode/README?id=89ec6198f13d1007563ff87aae5de209e993be07
and it should be skipped.

Fixes #2541

2 years agoci: remove mkfs.ntfs from openSUSE test containers
Laszlo Gombos [Sat, 30 Mar 2024 19:11:04 +0000 (15:11 -0400)] 
ci: remove mkfs.ntfs from openSUSE test containers

openSUSE blacklisted ntfs3

2 years agochore(deps): bump docker/setup-buildx-action from 2 to 3
dependabot[bot] [Tue, 12 Sep 2023 18:54:16 +0000 (18:54 +0000)] 
chore(deps): bump docker/setup-buildx-action from 2 to 3

Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: docker/setup-buildx-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoci: disable test 20
Laszlo Gombos [Sat, 30 Mar 2024 13:15:22 +0000 (09:15 -0400)] 
ci: disable test 20

20 seems to be unstable and running a very long time.
Once the CI is green, we will revisit this test.

2 years agofix(resume): include in hostonly mode if resume= on cmdline
Andrew Ammerlaan [Sun, 20 Aug 2023 09:47:22 +0000 (11:47 +0200)] 
fix(resume): include in hostonly mode if resume= on cmdline

The grep introduced in commit e3a7112bef794e2f2dd741ec2c74fa9cb9117651
does not work as intended. The resume module is always excluded in hostonly
mode.

Made this a bit more explicit with if/else so it is more clear what is going
on. The in-line ||/&& makes the line really long and makes it more difficult
to understand what is going on.

Bug: https://github.com/dracutdevs/dracut/issues/924
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
2 years agofix(pcsc): add --disable-polkit to pcscd.service
Manuel Fombuena [Fri, 3 Nov 2023 11:53:38 +0000 (11:53 +0000)] 
fix(pcsc): add --disable-polkit to pcscd.service

Needs pcsc >= 2.0.0

polkit is not included in dracut and without this option, pcscd simply fails

2 years agofix(pcsc): add opensc load module file
Manuel Fombuena [Fri, 3 Nov 2023 09:04:53 +0000 (09:04 +0000)] 
fix(pcsc): add opensc load module file

On Fedora, and possibly others, this file loads opensc-pkcs11.so which you need to interact with the smart card to unlock a LUKS encrypted volume.

2 years agofeat(kernel-modules): Install SPMI modules on ARM/RISC-V
Benjamin Drung [Tue, 14 Nov 2023 16:14:17 +0000 (17:14 +0100)] 
feat(kernel-modules): Install SPMI modules on ARM/RISC-V

MediaTek's PCIe (pcie-mediatek-gen3) and the PHY driver depends on
`spmi-mtk-pmif` which is related to power domain. Power domain relate
driver `spmi-mtk-pmif` must be included in the initramfs for supporting
PCIe if user want to access peripherals during boot, for example, NVMe
disks.

So install all System Power Management Interface (SPMI) modules on
ARM/RISC-V.

Bug-openSUSE: https://bugzilla.suse.com/show_bug.cgi?id=1216767
Bug-Ubuntu: https://launchpad.net/bugs/2038512
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2 years agofix(livenet): split `imgsize` calculation to avoid misleading error message
Antonio Alvarez Feijoo [Fri, 19 Jan 2024 17:03:03 +0000 (18:03 +0100)] 
fix(livenet): split `imgsize` calculation to avoid misleading error message

If `curl` fails to reach the URL of the live image, or if the header received
does not provide `Content-Length`, the error message displayed is misleading.

```
[    8.118432] dracut-initqueue[800]: /usr/sbin/livenetroot: line 21: / (1024 * 1024): syntax error: operand expected (error token is "/ (1024 * 1024)")
```

Therefore, split the calculation and provide proper error messages.

Reported-by: Knut Anderssen <kanderssen@suse.com>
2 years agofix(livenet): check also `content-length` from live image header
Antonio Alvarez Feijoo [Fri, 19 Jan 2024 17:02:07 +0000 (18:02 +0100)] 
fix(livenet): check also `content-length` from live image header

Some servers send `content-length` instead of `Content-Length`, so ignore the
case. E.g.:

```
> curl -sIL https://pkg.adfinis.com/opensuse/tumbleweed/iso/openSUSE-Tumbleweed-DVD-x86_64-Snapshot20240118-Media.iso
HTTP/2 200
server: nginx
date: Fri, 19 Jan 2024 16:29:54 GMT
content-type: application/octet-stream
content-length: 4643094528
last-modified: Fri, 19 Jan 2024 03:34:00 GMT
etag: "65a9eda8-114c00000"
accept-ranges: bytes
```

2 years agofix(livenet): propagate error code
Antonio Alvarez Feijoo [Fri, 19 Jan 2024 17:01:16 +0000 (18:01 +0100)] 
fix(livenet): propagate error code

2 years agofeat(kernel-modules): add Qualcomm IPC router to enable USB
Jeremy Linton [Fri, 6 Oct 2023 15:33:22 +0000 (10:33 -0500)] 
feat(kernel-modules): add Qualcomm IPC router to enable USB

The x13s, and possibly other Qualcomm based devices need the QC
IPC router driver in order to enable USB. Without it, its not
possible to boot from USB-C attached disks.

IPC in this case is Inter _Processor_ Communication and forms
the message bus used to communicate between differing processing
elements in a given system/SoC running and managing various
hardware devices. This means that while it appears this driver
should be in the dracut network modules that is incorrect
because its not for enabling host networking in the initrd,
but rather for communicating with other hardware blocks.

Those other blocks aren't limited to modems, but any SMD (shared
memory device), which on QC based machines includes the audio DSPs,
RPM (resource power manager) and of course the application
processor cores linux is running on.

References:
https://osmocom.org/projects/quectel-modems/wiki/Qualcomm_Linux_SMD
https://android.googlesource.com/kernel/msm/+/android-7.1.0_r0.2/Documentation/arm/msm/msm_ipc_router.txt
https://github.com/dracutdevs/dracut/pull/2531

Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
2 years agofix(90kernel-modules): add intel_lpss_pci for MacBook Pro 2017
Benjamin Drung [Tue, 14 Nov 2023 14:27:34 +0000 (15:27 +0100)] 
fix(90kernel-modules): add intel_lpss_pci for MacBook Pro 2017

The MacBook Pro 2017 (MacBookPro14,1) connects the keyboard via SPI:

```
$ dmesg
input: Apple SPI Keyboard as /devices/pci0000:00/0000:00:1e.3/pxa2xx-spi.3/spi_master/spi2/spi-APP000D:00/input/input4
```

The SPI controller requires the `intel_lpss_pci` kernel module:

```
$ lspci -vv
00:1e.3 Signal processing controller: Intel Corporation Sunrise Point-LP Serial IO SPI Controller #1 (rev 21)
Subsystem: Intel Corporation Sunrise Point-LP Serial IO SPI Controller
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 256 bytes
Interrupt: pin D routed to IRQ 23
Region 0: Memory at 9282c000 (64-bit, non-prefetchable) [size=4K]
Capabilities: [80] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D3 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [90] Vendor Specific Information: Len=14 <?>
Kernel driver in use: intel-lpss
Kernel modules: intel_lpss_pci
```

Fedora builds `intel_lpss_pci` into the kernel:

```
$ grep INTEL_LPSS_PCI /lib/modules/6.5.11-300.fc39.x86_64/config
CONFIG_MFD_INTEL_LPSS_PCI=y
```

But Ubuntu builds `intel_lpss_pci` only as module:

```
$ grep INTEL_LPSS_PCI /boot/config-6.5.0-10-generic
CONFIG_MFD_INTEL_LPSS_PCI=m
```

So explicitly include `intel_lpss_pci` to support the keyboard.

Bug-Ubuntu: https://launchpad.net/bugs/2042710
fixes: df381b7e0cd95f78e40ac70f0f3c96a2fa8dd189 ("feat(kernel-modules): driver support for macbook keyboards")
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
2 years agofix(resume): add new systemd-hibernate-resume.service
Antonio Alvarez Feijoo [Tue, 26 Sep 2023 07:43:37 +0000 (09:43 +0200)] 
fix(resume): add new systemd-hibernate-resume.service

Since https://github.com/systemd/systemd/commit/a628d933, the generator only
does the initial validation of the system info and then enables the new
`systemd-hibernate-resume.service`.

Fixes #2513

2 years agoci: adapt Dockerfile-Gentoo for recent systemd-utils change
Sam James [Fri, 17 Nov 2023 12:46:52 +0000 (12:46 +0000)] 
ci: adapt Dockerfile-Gentoo for recent systemd-utils change

systemd-utils can now install kernel-install independently of systemd-boot,
but systemd-boot requires that option to be enabled.

Fixes: https://github.com/dracutdevs/dracut/issues/2554
Signed-off-by: Sam James <sam@gentoo.org>
2 years agochore: switch to new Matrix chat room
Neal Gompa [Sat, 30 Mar 2024 03:26:24 +0000 (23:26 -0400)] 
chore: switch to new Matrix chat room

2 years agochore: rename master to main
Laszlo Gombos [Sat, 30 Mar 2024 02:31:49 +0000 (22:31 -0400)] 
chore: rename master to main

Changed the default branch name from master to main.

2 years agochore: rename dracutdevs/dracut to dracut-ng/dracut-ng
Laszlo Gombos [Sat, 30 Mar 2024 01:31:42 +0000 (21:31 -0400)] 
chore: rename dracutdevs/dracut to dracut-ng/dracut-ng

This change is required to initialize CI for dracut-ng.

2 years agofix(zfcp_rules): correct shellcheck regression when parsing ccw args
Ihno Krumreich [Wed, 28 Feb 2024 07:24:35 +0000 (08:24 +0100)] 
fix(zfcp_rules): correct shellcheck regression when parsing ccw args

Fixes 032ecd95c94b77f3f08237e0f765b355dacb9573

2 years agofix(configure): misleading error if C compiler is not installed
Antonio Alvarez Feijoo [Thu, 7 Dec 2023 11:08:17 +0000 (12:08 +0100)] 
fix(configure): misleading error if C compiler is not installed

While preparing a new system for development, `./configure` reaches a point
where it fails with:

```
$ ./configure
dracut needs fts development files.
```

After installing the fts library, `./configure` keeps throwing the same error:

```
$ rpm -qf /usr/include/fts.h
glibc-devel-2.38-6.1.x86_64
$ ./configure
dracut needs fts development files.
```

The problem is `${CC} $CFLAGS $LDFLAGS conftest.c` can also fail if the compiler
referenced by `$CC` is not installed.

2 years agofix(github): update format of labeler
Antonio Alvarez Feijoo [Tue, 2 Jan 2024 16:10:11 +0000 (17:10 +0100)] 
fix(github): update format of labeler

Since we are using `actions/labeler@main`, its format changed, displaying the
following error with every new PR:

```
Run actions/labeler@main
The configuration file (path: .github/labeler.yml) was not found locally, fetching via the api
Error: Error: found unexpected type for label 'repository' (should be array of config options)
Error: found unexpected type for label 'repository' (should be array of config options)
```

2 years agofix(systemd-journald): add systemd-sysusers dependency
Antonio Alvarez Feijoo [Thu, 27 Jul 2023 09:08:49 +0000 (11:08 +0200)] 
fix(systemd-journald): add systemd-sysusers dependency

2 years agofix(dracut-initramfs-restore.sh): do not set selinux labels if disabled
Antonio Alvarez Feijoo [Tue, 12 Sep 2023 13:07:16 +0000 (15:07 +0200)] 
fix(dracut-initramfs-restore.sh): do not set selinux labels if disabled

Also, it's not enough to check if `SELINUX=disabled` in /etc/selinux/config,
because it can be disabled via kernel command line options.

2 years agofix(systemd-repart): correct undefined $libdir
Daniel P. Berrangé [Tue, 17 Oct 2023 16:42:13 +0000 (17:42 +0100)] 
fix(systemd-repart): correct undefined $libdir

Nothing in dracut appears to define the '$libdir' environment
variable when module scripts are being run. As a result when
the 01-systemd-repart module script runs, it fails to copy any
of the config files into the initrd. Replace it with '/usr/lib'
which reflects where systemd-repart expects its global config
files.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agofix(overlayfs): split overlayfs mount in two steps
David Cassany [Fri, 22 Sep 2023 14:28:48 +0000 (16:28 +0200)] 
fix(overlayfs): split overlayfs mount in two steps

This commit splits the creation of required overlayfs underlaying
directories and the actual overlayfs mount. This way it is still
possible to mount the overlayfs with the generated sysroot.mount that
dmsquash-live creates.

The overlayfs tree is created in a pre-mount hook so it is executed
before sysroot.mount is started. Otherwise sysroot.mount starts and
fails before mount hooks are executed.

Signed-off-by: David Cassany <dcassany@suse.com>
2 years agofix(pkcs11): delete trailing dot on libcryptsetup-token-systemd-pkcs11.so
innovara [Fri, 27 Oct 2023 10:53:49 +0000 (11:53 +0100)] 
fix(pkcs11): delete trailing dot on libcryptsetup-token-systemd-pkcs11.so

libcryptsetup-token-systemd-pkcs11.so.* doesn't match the file libcryptsetup-token-systemd-pkcs11.so

2 years agodocs: update NEWS.md and AUTHORS 060
Henrik Gombos [Sat, 28 Oct 2023 23:11:39 +0000 (19:11 -0400)] 
docs: update NEWS.md and AUTHORS

2 years agofix(install.d): do not create initramfs if the supplied image is UKI
Vitaly Kuznetsov [Tue, 19 Sep 2023 15:36:37 +0000 (17:36 +0200)] 
fix(install.d): do not create initramfs if the supplied image is UKI

When the supplied kernel image is a UKI, there's no point in creating
initramfs as the UKI has it built-in already. This is the situation when
dracut.install is called for a distro shipped UKI.

Note, KERNEL_INSTALL_IMAGE_TYPE == "uki" is different from
KERNEL_INSTALL_LAYOUT == "uki", the later can be used to create UKI upon
installing a standard kernel image.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
2 years agofeat(systemd): install systemd-executor
Frantisek Sumsal [Sat, 14 Oct 2023 21:45:57 +0000 (23:45 +0200)] 
feat(systemd): install systemd-executor

In [0] systemd gained a new binary - systemd-executor - that's used to
spawn processes forked off systemd. Let's copy it into the initrd if
it's available.

[0] https://github.com/systemd/systemd/pull/27890

2 years agochore: remove unnecessary shellcheck disable for SC1087
Laszlo Gombos [Fri, 24 Feb 2023 22:16:21 +0000 (22:16 +0000)] 
chore: remove unnecessary shellcheck disable for SC1087