dracutdevs / dracut

dracut the event driven initramfs infrastructure
https://github.com/dracutdevs/dracut/wiki
GNU General Public License v2.0
597 stars 396 forks source link

AuthenticAMD.bin includes README, breaking early loading #2541

Open champtar opened 10 months ago

champtar commented 10 months ago

Describe the bug Dracut builds AuthenticAMD.bin by doing more or less cat /usr/lib/firmware/amd-ucode/* > AuthenticAMD.bin Since https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/amd-ucode/README?id=89ec6198f13d1007563ff87aae5de209e993be07 the folder contains a README file.

Distribution used Alma 8 / Alma 9 / Fedora 38

Dracut version dracut-049-223.git20230119.el8.x86_64 dracut-057-21.git20230214.el9.x86_64 dracut-059-4.fc38.x86_64

Init system systemd

To Reproduce

# LANG=C LC_ALL=C bash -c 'for i in/usr/lib/firmware/amd-ucode/*; do echo $i; done'
# dracut -N initramfs-test.img 6.5.6-200.fc38.x86_64
# lsinitrd --unpackearly initramfs-test.img
# binwalk kernel/x86/microcode/AuthenticAMD.bin 

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
0             0x0             xz compressed data <-------- should not be there
1316          0x524           Intel x86 or x64 microcode, sig 0x01000083, pf_mask 0x00, 2008-04-30, rev 0x03c0, size 4130
...

Expected behavior README (or README.xz or ...) is not part of AuthenticAMD.bin

Additional context GenuineIntel.bin seems ok when looking at it with binwalk I only validated that this is a problem with Alma 8 kernel, maybe newer version have some extra patches to ignore extra data, but we should still remove README*

aafeijoo-suse commented 10 months ago

In SUSE this issue was fixed via packaging:

# rpm -ql ucode-amd
/usr/lib/firmware
/usr/lib/firmware/amd-ucode
/usr/lib/firmware/amd-ucode/microcode_amd.bin
/usr/lib/firmware/amd-ucode/microcode_amd_fam15h.bin
/usr/lib/firmware/amd-ucode/microcode_amd_fam16h.bin
/usr/lib/firmware/amd-ucode/microcode_amd_fam17h.bin
/usr/lib/firmware/amd-ucode/microcode_amd_fam19h.bin
/usr/share/doc/packages/ucode-amd
/usr/share/doc/packages/ucode-amd/README
/usr/share/licenses/ucode-amd
/usr/share/licenses/ucode-amd/LICENSE.amd-ucode

But I see this was not done in other distros, a patch is waiting in #2544