From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1EE38C3A5A9 for ; Mon, 4 May 2020 13:17:29 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D459E2073B for ; Mon, 4 May 2020 13:17:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="O+3HgbiD"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="NMinXoiI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D459E2073B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kroah.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.3) (envelope-from ) id 1jVaxY-00005Q-MW; Mon, 04 May 2020 09:16:36 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1jVaxR-00004v-Jg for kernelnewbies@kernelnewbies.org; Mon, 04 May 2020 09:16:32 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 7D4516D9 for ; Mon, 4 May 2020 09:06:16 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 04 May 2020 09:06:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=x8ZLbA7xhQS4KKe1UgVU5Lfj1AE 9rbvyt5wzbDmepOo=; b=O+3HgbiDJacISL/Pr3hopgXMmhsM8PAsYb2P/GkgxnD JK3O6L3+wk8N6vT+1C1rQ3m+wbTUYZ/rQbm7Vmj07BxjYJU3/4KcH2EbMb3/ga+t XdAdiNwMXnhgRdzpjd+fkSpMTXpcSlNQ9d5FMdcqIj+ZakjjTEkR4h8YrcSs7c9p ixyjks39JHCvSYCfBb9fSZpRa43HnxmdLhy3C0R+zpx74QIJbrmCQhrBCgz2RfUY X+2yt0Du3VozZUsKbWrBUkZ1QmO/4qBC1toi9fOkUISMB8PoQpiI0QwbCooOf9R0 0nPaqVdxIP/IirsCQkExrImTNRMmrQvpSV9k7BAYuSA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=x8ZLbA 7xhQS4KKe1UgVU5Lfj1AE9rbvyt5wzbDmepOo=; b=NMinXoiIqOFzwaS7S0ZfQJ dZkLKx+kFnXBpYQlLhg0mL94c6389aKskdvSMQsv1BIOTmqcvyJOwWjV4cMNk1Qz hyRt9eIGPH4mGhJtWs1nSiKmdv5iQbEq8TG+2LoZwAdup7poFcmB9ofhFofqx4BX FiDTyWbIZ05UuoQgGXECnFr+3qikmuyWSkKJKj7Qbzq+q/jbXqYTKIcvHSWA30JW C8+dPnxAZOKNMp17xzgX3/ziQbExthl8ACKvO9g4rKjG2OrWRCGTBd842WB7Pgzw TH6Nw+9khQ3sj4wYWF7rTY9qlObs58aoXUWyT2Z/W9/A5SfHHBpSDvi8WjdeNzqg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrjeeggdehfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehttdertd dttddvnecuhfhrohhmpefirhgvghcumffjuceoghhrvghgsehkrhhorghhrdgtohhmqeen ucggtffrrghtthgvrhhnpeeuueelkeevhffgjedulefhfeetgfdvjefgkeelfeduuefgie evvdevtefhgfehueenucffohhmrghinhepkhgvrhhnvghlrdhorhhgpdhlihhnuhigfhhr ohhmshgtrhgrthgthhdrohhrghenucfkphepkeefrdekiedrkeelrddutdejnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsehkrhho rghhrdgtohhm X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 54B0D3066016; Mon, 4 May 2020 09:06:14 -0400 (EDT) Date: Mon, 4 May 2020 15:06:10 +0200 From: Greg KH To: kernelnewbies@kernelnewbies.org Subject: Re: What is the minimal set of firmware files I need for my hardware? Message-ID: <20200504130610.GA2079958@kroah.com> References: <20200504102635.psgndj4j7qk46g2b@NUX> <20200504104555.GA1571331@kroah.com> <20200504125640.zfwp72h4j3pqthul@NUX> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200504125640.zfwp72h4j3pqthul@NUX> X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Mon, May 04, 2020 at 03:56:40PM +0300, Doron Behar wrote: > On Mon, May 04, 2020 at 12:45:55PM +0200, Greg KH wrote: > > On Mon, May 04, 2020 at 01:26:35PM +0300, Doron Behar wrote: > > > I hope this question fits to this List. > > > > > > Today I learned that my distro's `linux-unfree-firmware` package is 491 > > > Mb in size. I'm pretty sure my hardware doesn't need all of these files. > > > Maybe different Linux distros call this package differently, but I'm talking > > > about the firmware files that come from: > > > https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/ > > > > > > I think I can reduce this disk usage if I'll only know what files > > > I can exclude from there. > > > > > > Is there any official documentation, that states exactly what files from > > > That git repo are needed per device / computer model? Perhaps the official > > > documentation of my Computer's hardware will state that? There's a Linux > > > from scratch webpage[1] that gives some info for popular hardware, but I'm > > > wondering if there's a bit more "official" information available > > > somewhere. > > > > > > [1]: http://linuxfromscratch.org/blfs/view/svn/postlfs/firmware.html > > > > The kernel macro MODULE_FIRMWARE() will show the firmware file that a > > specific kernel module needs. So if you look a the output of modinfo > > for all of the modules that your system needs, you will see a "firmware" > > line that shows the name that your hardware needs for that specific > > driver/module. > > Thanks for replying greg, > > So I have the command `modinfo` available, should I just iterate _all_ > the files in /usr/lib/modules/5.6.7/kernel ? For example: No, don't iterate all kernel modules, unless you only built the modules that you know you need for your hardware (like you can get by running 'make localmodconfig'). > > ``` > $ modinfo /usr/lib/modules/5.6.7/kernel/net/ieee802154/ieee802154.ko.xz > filename: /usr/lib/modules/5.6.7/kernel/net/ieee802154/ieee802154.ko.xz > author: Dmitry Eremin-Solenikov > description: IEEE 802.15.4 configuration interface > license: GPL v2 > depends: > retpoline: Y > intree: Y > name: ieee802154 > vermagic: 5.6.7 SMP mod_unload > sig_id: PKCS#7 > signer: > sig_key: > sig_hashalgo: unknown > signature: > ``` > > Doesn't seem informative regarding firmware files. Should I expect other > .ko.xz files to give a line with `firmware: `? Yes, try looking at btrtl.ko for an example. The module you picked above does not need any firmware to control the hardware it manages (hint, it's not a driver for any specific hardware, just a protocol that other drivers use.) > Plus, how do I know what modules does my system need and which it > doesn't? That's up to you to figure out if you are building your own kernel image. As I mentioned above, the 'make localmodconfig' is a nice quick shortcut to get that done, I recommend using it by doing: - boot a distro kernel - plug in all devices you want to support - run 'make localmodconfig' to create a .config file based only on the modules you have loaded in the system at that point in time. - build the kernel with that .config file hope this helps, greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies