From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B6A61E98F0 for ; Fri, 24 Jan 2025 23:07:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737760078; cv=none; b=BVoKlJmSASa5gtIlCmr8MnBuw1cjpsFzAfahNnwCAJoJnxJRTJXNaaY+nxbdz0A/YCD3zBLac4mNWZ20QBisNJ9OwdqTuuq66aHDrFjvcti0lRJMTMDsmMG6Q/Lw/Uxe2YIx0+PogDB0LYe9pHQerssAhyr948GpsrGv43fXeLw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737760078; c=relaxed/simple; bh=2AEavlAZAX36h7GPN9ZQNV+f5nJBSPMgeDUJVyuGwyI=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=SAptzeml9ASSom6QXZJZ6L6/Zfxm3X3vu7ufNQUv3mh1QOvmQrUthnxTQIphjAPI96kVx5aFI3L/yhymGjPrqm+mE1vsn2QzgiFaIvx3+RfD65ow92rDTJ3YjSLTJYR2oLhkL3aXBYhlTEPYNXMRgBuQJ2C9AAkSD/cszjSMx8s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=w2KOAjwC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="w2KOAjwC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 457CBC4CED2; Fri, 24 Jan 2025 23:07:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1737760077; bh=2AEavlAZAX36h7GPN9ZQNV+f5nJBSPMgeDUJVyuGwyI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=w2KOAjwCIftaGQKNMiAgdAuxowVaUI5TLUavtUtWDse9USuvDDZxfGQfjB/gFwk1I Vrlevyc3n9/HyD+ASV4yPeqqziu1Kevl1tQIryEUX+e3M2DJv+nVVGyXf8bXdjLwSq FcfQoXPe353eancaQjX2wXa5hruMWW9Wr57cw7vg= Date: Fri, 24 Jan 2025 15:07:56 -0800 From: Andrew Morton To: "Guilherme G. Piccoli" Cc: linux-kernel@vger.kernel.org, mcgrof@kernel.org, russ.weight@linux.dev, dakr@kernel.org, gregkh@linuxfoundation.org, rafael@kernel.org, masahiroy@kernel.org, nathan@kernel.org, nicolas@fjasle.eu, kernel-dev@igalia.com, kernel@gpiccoli.net, Thadeu Lima de Souza Cascardo Subject: Re: [PATCH] scripts: Add script to extract built-in firmware blobs Message-Id: <20250124150756.b8b9b9ac9aaff778a9edcbf0@linux-foundation.org> In-Reply-To: References: <20250120190436.127578-1-gpiccoli@igalia.com> <20250123223816.c695a6b85f568a2eb8719508@linux-foundation.org> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 24 Jan 2025 09:31:07 -0300 "Guilherme G. Piccoli" wrote: > On 24/01/2025 03:38, Andrew Morton wrote: > > On Mon, 20 Jan 2025 16:04:26 -0300 "Guilherme G. Piccoli" 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___bin"; the tool extracts files > >> named "_" 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? OK, thanks. I (badly) pasted the above into the changelog.