[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <d2574378-9143-9819-dc1f-c5e10e789fee@igalia.com>
Date: Fri, 24 Jan 2025 09:31:07 -0300
From: "Guilherme G. Piccoli" <gpiccoli@...lia.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-kernel@...r.kernel.org, mcgrof@...nel.org, russ.weight@...ux.dev,
dakr@...nel.org, gregkh@...uxfoundation.org, rafael@...nel.org,
masahiroy@...nel.org, nathan@...nel.org, nicolas@...sle.eu,
kernel-dev@...lia.com, kernel@...ccoli.net,
Thadeu Lima de Souza Cascardo <cascardo@...lia.com>
Subject: Re: [PATCH] scripts: Add script to extract built-in firmware blobs
On 24/01/2025 03:38, Andrew Morton wrote:
> On Mon, 20 Jan 2025 16:04:26 -0300 "Guilherme G. Piccoli" <gpiccoli@...lia.com> wrote:
>
>> Through the options CONFIG_EXTRA_FIRMWARE{_DIR} one is able to build
>> a kernel including firmware blobs in a built-in fashion. This is
>> usually the case of built-in drivers that require some blobs in
>> order to work properly, for example, like in non-initrd based systems.
>>
>> Add hereby a script to extract these blobs from a non-stripped vmlinux,
>> similar to the idea of "extract-ikconfig". The firmware loader interface
>> saves such built-in blobs as rodata entries, having a field for the FW
>> name as "_fw_<module_name>_<firmware_name>_bin"; the tool extracts files
>> named "<module_name>_<firmware_name>" for each rodata firmware entry
>> detected. It makes use of awk, bash, dd and readelf, pretty standard
>> tooling for Linux development.
>
> Please describe the use case(s) for this. ie, why are you suggesting
> this be added to Linux?
>
Hi Andrew, there is currently no tool to extract a firmware blob that is
built-in on vmlinux to the best of my knowledge. So if we have a kernel
image containing the blobs, and we want to rebuild the kernel with some
debug patches for example (and given that the image also has
IKCONFIG=y), we currently can't do that for the same versions for all
the firmware blobs, _unless_ we have exact commits of linux-firmware for
the specific versions for each firmware included.
With this tool, we can blindly extract the FWs and easily re-add them in
the new debug kernel build, allowing a more deterministic testing
without the burden of "hunting down" the proper version of each firmware
binary.
Makes sense to you?
Cheers,
Guilherme
Powered by blists - more mailing lists