[Bug 2095518] Re: dracut-install does not install compressed wildcard blobs
Timo Aaltonen
2095518 at bugs.launchpad.net
Fri Feb 14 12:11:23 UTC 2025
Hello You-Sheng, or anyone else affected,
Accepted dracut into oracular-proposed. The package will build now and
be available at
https://launchpad.net/ubuntu/+source/dracut/103-1ubuntu3.1 in a few
hours, and then in the -proposed repository.
Please help us by testing this new package. See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed. Your feedback will aid us getting this
update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested, what testing has been
performed on the package and change the tag from verification-needed-
oracular to verification-done-oracular. If it does not fix the bug for
you, please add a comment stating that, and change the tag to
verification-failed-oracular. In either case, without details of your
testing we will not be able to proceed.
Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in
advance for helping!
N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.
** Changed in: dracut (Ubuntu Oracular)
Status: In Progress => Fix Committed
** Tags added: verification-needed verification-needed-oracular
** Changed in: dracut (Ubuntu Noble)
Status: In Progress => Fix Committed
** Tags added: verification-needed-noble
--
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:
Fix Committed
Status in dracut source package in Oracular:
Fix Committed
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