[Bug 2095518] Re: dracut-install does not install compressed wildcard blobs
Launchpad Bug Tracker
2095518 at bugs.launchpad.net
Thu Feb 13 19:36:20 UTC 2025
This bug was fixed in the package dracut - 106-2ubuntu1
---------------
dracut (106-2ubuntu1) plucky; urgency=medium
* Merge from Debian unstable. Remaining changes:
- drop udevsettle patch (these kind of patches should be applied upstream)
- drop 90overlay-root in favor of 90overlayfs (Closes: #1017039)
- dracut-core:
- demote cryptsetup, systemd-cryptsetup, dmraid, dmsetup, kpartx, lvm2,
and mdadm to suggests
- demote binutils to suggests. its only needed when using UEFI executables
- Include all packages with dracut modules in Apport bug reports
- autopkgtest: add TEST-70-ISCSI and TEST-71-ISCSI-MULTI
- Plymouth hook: Use alternatives instead of plymouth-set-default-theme
- Set -H --hostonly-mode=sloppy as default arguments via a config file.
* run upstream-dracut-live autopkgtest on armhf and ppc64el
* move 99-ubuntu.conf to 10-ubuntu.conf (to ease overwriting it)
dracut (106-2) unstable; urgency=medium
* new patches (all accepted upstream):
- test(ISCSI): skip root=ibft if qemu -acpitable is not supported
- test(FULL-SYSTEMD): skip encrypted root if qemu -smbios is not supported
- test: use persistent names for network devices
- fix(dracut-install): install compressed blobs that match wildcard fwpath
(LP: #2095518)
* autopkgtest: explicitly depend on ipxe-qemu
* dracut-core: install upstream dracut.conf.d subdirectories
(to be used with --confdir)
* Enable autopkgtest for s390x
dracut (106-1) unstable; urgency=medium
* New upstream release.
* Update debian/watch to point to dracut-ng upstream
* dracut-live: suggest isomd5sum (for checkisomd5 command) (Closes: #1095162)
* dracut-core: install /usr/lib/kernel/install.d (Closes: #1082811)
* Drop patches included upstream and refresh remaining patches
* Move modules:
- reserve range 50-59 to out of tree dracut modules
- fix(shell-interpreter): move later in the module ordering
- move 01systemd-sysusers to 60systemd-sysusers
* dracut-core: remove moved upstream docs
* dracut-core: drop dracut.html (please use man pages instead)
* dracut-core: add new modules 01systemd-battery-check and 97systemd-emergency
* test: reorganize tests (new numbering schema)
* Run upstream autopkgtest as root
* test: depend on dbus and systemd-container for TEST-41-FULL-SYSTEMD
* new patches:
- test: log error when constructing sysroot
- test(FULL-SYSTEMD): skip systemd-network-management if missing
* dracut-core: drop gawk dependency
dracut (105-3) unstable; urgency=medium
* Add patches to improve test cases in error case
* autopkgtest: add TEST-20-NFS test
-- Benjamin Drung <bdrung at ubuntu.com> Thu, 13 Feb 2025 12:29:40 +0100
** Changed in: dracut (Ubuntu Plucky)
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to dracut in Ubuntu.
Matching subscriptions: dracut
https://bugs.launchpad.net/bugs/2095518
Title:
dracut-install does not install compressed wildcard blobs
Status in dracut package in Ubuntu:
Fix Released
Status in dracut source package in Jammy:
Triaged
Status in dracut source package in Noble:
In Progress
Status in dracut source package in Oracular:
In Progress
Status in dracut source package in Plucky:
Fix Released
Bug description:
[SRU Justificaiton]
[ Impact ]
Linux kernel modules may declare firmware blobs to be installed along
with the module itself to ensure driver functions, and the paths may
contains wildcards to be expanded by other tools.
```
$ find /lib/modules/$(uname -r) -name \*.ko.zst -exec bash -c "m=\$(basename "{}"); m=\${m%%.*}; modinfo \$m|grep '^firmware:.*\*'" \;
firmware: brcm/brcmbt4388*.ptb
firmware: brcm/brcmbt4388*.bin
firmware: brcm/brcmbt4387*.ptb
firmware: brcm/brcmbt4387*.bin
firmware: brcm/brcmbt4378*.ptb
firmware: brcm/brcmbt4378*.bin
firmware: brcm/brcmbt4377*.ptb
firmware: brcm/brcmbt4377*.bin
firmware: intel/ish/ish_*.bin
firmware: ath11k/WCN6855/hw2.1/*
firmware: ath11k/WCN6855/hw2.0/*
firmware: ath11k/QCN9074/hw1.0/*
firmware: ath11k/QCA6390/hw2.0/*
firmware: brcm/brcmfmac*-sdio.*.bin
firmware: brcm/brcmfmac*-sdio.*.txt
firmware: brcm/brcmfmac*-pcie.*.txcap_blob
firmware: brcm/brcmfmac*-pcie.*.clm_blob
firmware: brcm/brcmfmac*-pcie.*.bin
firmware: brcm/brcmfmac*-pcie.*.txt
firmware: brcm/brcmfmac*-pcie.txt
```
dracut is the tool that helps building initramfs at this moment, and
it's implementation for resolving compressed firmware blobs (and
therefore a different filename suffix) doesn't really handle it
(wildcard in the middle) correctly. This causes wildcard firmwares,
even needed by the system, may not be packed into initramfs as
expected.
Usually this is not a big deal, and we have been switching to xz/zst
for a while. However, in Intel ISH driver, it declares:
```
firmware: intel/ish/ish_*.bin
firmware: intel/ish/ish_lnlm.bin
```
It tries to resolve the best match of a vendor/model specific
configuration by DMI info, and since the ones matched with that
wildcard filename will never be installed into initramfs, leaving only
the generic blob available and always available at driver loading, it
will use the generic firmware unconditionally and break sensor
functions for a few platforms.
The fix tries to rewrite the resolution in dracut a bit, so that it
will match and copy compressed blobs as well.
[ Test Plan ]
1. touch `/lib/firmware/intel/ish/ish_foo.bin.zst`
2. `update-initramefs -v -u -k $(uname -r)`, and check if above file was added.
[ Where problems could occur ]
* This fix will then add brcm, ish firmware blobs into initramfs if
necessary for the running platform as they should have been. Would
slightly increase initramfs size if affected.
[ Other Info ]
* First found for dracut >= 060, used by Ubuntu Noble, and extent to
Jammy/Oracular/Plucky as well.
* Upstream bug and pull request in review: https://github.com/dracut-
ng/dracut-ng/issues/1150
========== original bug report ==========
[Describe the bug]
Take kernel module intel-ish-ipc for example, it has two firmware
declarations:
```
$ modinfo intel-ish-ipc | grep ^firmware
firmware: intel/ish/ish_*.bin
firmware: intel/ish/ish_lnlm.bin
```
And with additional custom ISH firmware installed from [bug
2094768](https://bugs.launchpad.net/bugs/2094768), update-initramefs
gives:
```
$ update-initramefs -v -u -k $(uname -r)
...
dracut-install: Missing firmware intel/ish/ish_*.bin for kernel module intel_ish_ipc
dracut-install: mkdir '/var/tmp/mkinitramfs_9uk7FI/lib/firmware/intel/ish'
dracut-install: cp '/lib/firmware/intel/ish/ish_lnlm_39ceeaf8_58.7724.2.bin.zst' '/var/tmp/mkinitramfs_9uk7FI/lib/firmware/intel/ish/ish_lnlm_39ceeaf8_58.7724.2.bin.zst'
dracut-install: ln -s 'ish_lnlm_39ceeaf8_58.7724.2.bin.zst' '/var/tmp/mkinitramfs_9uk7FI/lib/firmware/intel/ish/ish_lnlm.bin.zst'
...
```
In source code for `/usr/lib/dracut/dracut-install`, that is, source
package dracut, file `src/install/dracut-install.c`, function
`install_firmware`, it tries to invoke `glob()` with full path
expanded from "intel/ish/ish_*.bin", but while all the binaries were
compressed, this matches no file and none of the custom ISH firmware
blobs will be installed.
[Distribution used]
Ubuntu
[Dracut version]
This was first found in Ubuntu/Noble, which has 060, but from the git
history and the differences, this should be reproducible with all
versions of dracut.
[Init system]
Systemd.
[To Reproduce]
1. touch `/lib/firmware/intel/ish/ish_foo.bin.zst`
2. `update-initramefs -v -u -k $(uname -r)`, and check if above file was added.
[Expected behavior]
Any file under `/lib/firmware/intel/ish` matches
`intel/ish/ish_*.bin`, compressed (.zst, .xz) or uncompressed (.bin),
should be added into the newly created initramefs.
[Additional context]
Upstream bug: https://github.com/dracut-ng/dracut-ng/issues/1150
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dracut/+bug/2095518/+subscriptions
More information about the foundations-bugs
mailing list