Hei hei, On Fri, Oct 15, 2021 at 04:11:11PM +0200, Michael Olbrich wrote: > 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? I can share some experience from the fli4l [1] project, but from a different viewing angle. Most firmware is not free in a FOSS licensed way, so it's hard to find a generic solution, especially when getting the license stuff right. That's why we opted for free (as in under FOSS license) firmware only, which means: user is responsible for handling non-free firmware. Same thing basically applies for proprietary firmware you develop yourself. So I think the approach Michael suggested in this case is a useful one: just put the few blobs and license stuff you need into your BSP. This obviously would not work if the user can plug arbitrary hardware like WiFi cards, but if hardware is restricted, and most embededded projects are (?), then this is no problem. However if you don't have control which additional hardware your users plug, and you still want to support it, you would need a more generic approach. Greets Alex [1] https://www.fli4l.de/ > > 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 -- /"\ ASCII RIBBON | »With the first link, the chain is forged. The first \ / CAMPAIGN | speech censured, the first thought forbidden, the X AGAINST | first freedom denied, chains us all irrevocably.« / \ HTML MAIL | (Jean-Luc Picard, quoting Judge Aaron Satie)