Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 695666 - sys-kernel/linux-firmware add xz USE flag to compress firmware files
Summary: sys-kernel/linux-firmware add xz USE flag to compress firmware files
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement with 2 votes (vote)
Assignee: Chí-Thanh Christopher Nguyễn
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-26 10:25 UTC by Chí-Thanh Christopher Nguyễn
Modified: 2020-05-31 13:20 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
linux-firmware-20191215.ebuild.patch (linux-firmware-20191215.ebuild.patch,1.56 KB, text/plain)
2020-01-07 04:05 UTC, Alexander Tsoy
Details
linux-firmware-20191215.ebuild.patch (linux-firmware-20191215.ebuild.patch,1.58 KB, text/plain)
2020-01-07 17:07 UTC, Alexander Tsoy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chí-Thanh Christopher Nguyễn gentoo-dev 2019-09-26 10:25:18 UTC
Since kernel 5.3 the firmware loader supports xz compressed firmware files.

Compressing the linux-firmware tree would reduce its size considerably, for linux-firmware-20190923 from 470 MB to 145 MB.

What would need to be done:

* call xz on every firmware file
* Introduce check for CONFIG_FW_LOADER_COMPRESS
* Determine whether CONFIG_INITRAMFS_SOURCE works with compressed firmware files, and if not warn users
* Deal with symlinks in the linux-firmware tree
Comment 1 Alexander Tsoy 2020-01-07 04:05:15 UTC
Created attachment 602702 [details]
linux-firmware-20191215.ebuild.patch

My attempt to implement it.

* No check for CONFIG_FW_LOADER_COMPRESS yet.
* Since we are compressing files installed by the package, I thinks using "xz" is not quite appropriate. I've chosen "compress" for now.

(In reply to Chí-Thanh Christopher Nguyễn from comment #0)
> * Determine whether CONFIG_INITRAMFS_SOURCE works with compressed firmware
> files, and if not warn users
I don't understand this part.
Comment 2 Alexander Tsoy 2020-01-07 04:08:50 UTC
"-C none" can be used as well. The default is "crc64" which is not supported by the kernel.
Comment 3 Alexander Tsoy 2020-01-07 04:57:51 UTC
(In reply to Alexander Tsoy from comment #1)
> (In reply to Chí-Thanh Christopher Nguyễn from comment #0)
> > * Determine whether CONFIG_INITRAMFS_SOURCE works with compressed firmware
> > files, and if not warn users
> I don't understand this part.
Ah, got it. CONFIG_INITRAMFS_SOURCE may contain paths to firmware files.
Comment 4 Alexander Tsoy 2020-01-07 17:07:49 UTC
Created attachment 602760 [details]
linux-firmware-20191215.ebuild.patch

* skip compression of the amd-ucode directory. genkernel and dracut cannot read compressed AMD microcode.