From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 15 Oct 2021 16:11:35 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mbNvr-0000TP-FT for lore@lore.pengutronix.de; Fri, 15 Oct 2021 16:11:35 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mbNvr-0004Mu-47; Fri, 15 Oct 2021 16:11:35 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mbNvU-0004Kb-Ed; Fri, 15 Oct 2021 16:11:12 +0200 Received: from [2a0a:edc0:0:1101:1d::39] (helo=dude03.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mbNvT-00019Y-NA; Fri, 15 Oct 2021 16:11:11 +0200 Received: from mol by dude03.red.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1mbNvT-009jka-M7; Fri, 15 Oct 2021 16:11:11 +0200 Date: Fri, 15 Oct 2021 16:11:11 +0200 From: Michael Olbrich To: Christian Melki Message-ID: <20211015141111.GJ2239952@pengutronix.de> Mail-Followup-To: Christian Melki , ptxdist@pengutronix.de References: <20211013183631.3989851-1-christian.melki@t2data.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211013183631.3989851-1-christian.melki@t2data.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [ptxdist] [PATCH] linux-firmware: Add new package. Version 20210818 X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false On Wed, Oct 13, 2021 at 08:36:31PM +0200, Christian Melki wrote: > Firmware is needed by a lot of modern devices. > Includes various radio interfaces, GPU and CPU stuff. > > Due to the large space required by some firmwares as a whole, > compression can optionally be enabled. Hmmm, I'm not sure about this. I've always dumped selected firmware files and their license into projectroot/ and created a local package. Mostly for two reasons: 1. I wanted the fine control to explicitly update individual firmware files. 2. I never found a good way to split the package options. For example, installing all iwlwifi* files seems excessive but so does adding an option for each on. Any other opinions on this? Michael > Signed-off-by: Christian Melki > --- > rules/linux-firmware.in | 55 ++++++++++++++++++++++ > rules/linux-firmware.make | 99 +++++++++++++++++++++++++++++++++++++++ > 2 files changed, 154 insertions(+) > create mode 100644 rules/linux-firmware.in > create mode 100644 rules/linux-firmware.make > > diff --git a/rules/linux-firmware.in b/rules/linux-firmware.in > new file mode 100644 > index 000000000..1abbec6bd > --- /dev/null > +++ b/rules/linux-firmware.in > @@ -0,0 +1,55 @@ > +## SECTION=system_libraries > + > +menuconfig LINUX_FIRMWARE > + tristate > + prompt "linux-firmware " > + help > + Linux firmware is a collection of firmwares that are used for various hardwares. > + > +if LINUX_FIRMWARE > + > +config LINUX_FIRMWARE_COMPRESSION > + tristate > + prompt "xz compression support" > + select HOST_XZ > + help > + Linux firmware files can be compressed with xz. Needs a linux kernel >= 5.3 > + > +menu "CPU Microcode" > + > +config LINUX_FIRMWARE_AMDCPU > + bool "AMD CPU u-code" > + help > + Firmware files for AMD CPUs. > + > +endmenu > + > +menu "Video firmware" > + > +config LINUX_FIRMWARE_AMDGPU > + bool "AMD GPU video card firmware" > + help > + Firmware files for AMD GPU video cards. > + Indexed according to https://wiki.gentoo.org/wiki/AMDGPU > + > +if LINUX_FIRMWARE_AMDGPU > + > +menu "AMDGPU video firmware" > + > +config LINUX_FIRMWARE_AMDGPU_RAVEN_RIDGE_APU > + bool "RAVEN RIDGE APU AMD GPU video card firmware" > + help > + Firmware files for RAVEN RIDGE APU AMD GPU video cards. > + > +config LINUX_FIRMWARE_AMDGPU_RAVEN2_VEGA_MOBILE > + bool "RAVEN2 VEGA MOBILE AMD GPU video card firmware" > + help > + Firmware files for RAVEN2 VEGA MOBILE AMD GPU video cards. > + > +endmenu > + > +endif > + > +endmenu > + > +endif > diff --git a/rules/linux-firmware.make b/rules/linux-firmware.make > new file mode 100644 > index 000000000..3a3a300e6 > --- /dev/null > +++ b/rules/linux-firmware.make > @@ -0,0 +1,99 @@ > +# -*-makefile-*- > +# > +# Copyright (C) 2021 by Christian Melki > +# > +# For further information about the PTXdist project and license conditions > +# see the README file. > +# > + > +# > +# We provide this package > +# > +PACKAGES-$(PTXCONF_LINUX_FIRMWARE) += linux-firmware > + > +# > +# Paths and names > +# > +LINUX_FIRMWARE_VERSION := 20210818 > +LINUX_FIRMWARE_MD5 := 736a3bbba3391d962d3c321ae04572d7 > +LINUX_FIRMWARE := linux-firmware-$(LINUX_FIRMWARE_VERSION) > +LINUX_FIRMWARE_SUFFIX := tar.gz > +LINUX_FIRMWARE_URL := $(call ptx/mirror, KERNEL, kernel/firmware/$(LINUX_FIRMWARE).$(LINUX_FIRMWARE_SUFFIX)) > +LINUX_FIRMWARE_SOURCE := $(SRCDIR)/$(LINUX_FIRMWARE).$(LINUX_FIRMWARE_SUFFIX) > +LINUX_FIRMWARE_DIR := $(BUILDDIR)/$(LINUX_FIRMWARE) > +LINUX_FIRMWARE_LICENSE := proprietary > +LINUX_FIRMWARE_LICENSE_FILES := \ > + file://LICENSE.amdgpu;md5=d357524f5099e2a3db3c1838921c593f \ > + file://LICENSE.amd-ucode;md5=3c5399dc9148d7f0e1f41e34b69cf14f > + > +# ---------------------------------------------------------------------------- > +# Extract > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/linux-firmware.extract: > + @$(call targetinfo) > + @$(call clean, $(LINUX_FIRMWARE_DIR)) > + @$(call extract, LINUX_FIRMWARE) > + @$(call patchin, LINUX_FIRMWARE) > + @$(call touch) > + > +# ---------------------------------------------------------------------------- > +# Prepare > +# ---------------------------------------------------------------------------- > + > +LINUX_FIRMWARE_CONF_TOOL := NO > + > +# ---------------------------------------------------------------------------- > +# Compile > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/linux-firmware.compile: > + @$(call targetinfo) > + @$(call touch) > + > +# ---------------------------------------------------------------------------- > +# Install > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/linux-firmware.install: > + @$(call targetinfo) > + @$(call world/install, LINUX_FIRMWARE) > +ifdef PTXCONF_LINUX_FIRMWARE_COMPRESSION > + @find $(LINUX_FIRMWARE_PKGDIR) -type f \ > + -not -name "*.xz" \ > + -not -name "*.ucode" \ > + -exec echo "Compressing " "{}" "..." \; \ > + -exec xz -C crc32 "{}" \; > +endif > + @$(call touch) > + > +# ---------------------------------------------------------------------------- > +# Target-Install > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/linux-firmware.targetinstall: > + @$(call targetinfo) > + > + @$(call install_init, linux-firmware) > + @$(call install_fixup, linux-firmware,PRIORITY,optional) > + @$(call install_fixup, linux-firmware,SECTION,base) > + @$(call install_fixup, linux-firmware,AUTHOR,"Christian Melki ") > + @$(call install_fixup, linux-firmware,DESCRIPTION,missing) > +ifdef PTXCONF_LINUX_FIRMWARE_AMDCPU > + @$(call install_copy, linux-firmware, 0, 0, 0755, /lib/firmware/amd-ucode) > + @$(call install_glob, linux-firmware, 0, 0, -, /lib/firmware/amd-ucode, *) > +endif > +ifdef PTXCONF_LINUX_FIRMWARE_AMDGPU > + @$(call install_copy, linux-firmware, 0, 0, 0755, /lib/firmware/amdgpu) > +ifdef PTXCONF_LINUX_FIRMWARE_AMDGPU_RAVEN_RIDGE_APU > + @$(call install_glob, linux-firmware, 0, 0, -, /lib/firmware/amdgpu, *raven_*) > +endif > +ifdef PTXCONF_LINUX_FIRMWARE_AMDGPU_RAVEN2_VEGA_MOBILE > + @$(call install_glob, linux-firmware, 0, 0, -, /lib/firmware/amdgpu, *raven2*) > +endif > +endif > + @$(call install_finish, linux-firmware) > + > + @$(call touch) > + > +# vim: syntax=make > -- > 2.30.2 > > > _______________________________________________ > ptxdist mailing list > ptxdist@pengutronix.de > To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de