From 442fa4e2689f35c2504c0a9d6b6afb797838d421 Mon Sep 17 00:00:00 2001 From: Frank Hunleth Date: Mon, 8 Jul 2019 10:44:12 -0400 Subject: [PATCH] rpi-firmware: support custom version selection Since the rpi-firmware supplies firmware binaries that have the potential to depend on kernel drivers, we've matched kernel versions to rpi-firmware versions. In order to simplify using different Linux kernel versions, this adds an option to set the tag or hash to use. For example, if you're using the Raspberry Pi Linux kernel tagged `1.20200902`, you can now use the rpi-firmware version that was tagged `1.20200902`. --- package/rpi-firmware/Config.in | 5 +++++ package/rpi-firmware/rpi-firmware.mk | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/package/rpi-firmware/Config.in b/package/rpi-firmware/Config.in index f5a25c5680..550acda3ad 100644 --- a/package/rpi-firmware/Config.in +++ b/package/rpi-firmware/Config.in @@ -29,6 +29,11 @@ config BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4 The Raspberry Pi 4 files endchoice +config BR2_PACKAGE_RPI_FIRMWARE_CUSTOM_VERSION + string "custom version" + help + If specified, use this tag or git hash instead of the default + choice bool "Firmware to boot" default BR2_PACKAGE_RPI_FIRMWARE_DEFAULT diff --git a/package/rpi-firmware/rpi-firmware.mk b/package/rpi-firmware/rpi-firmware.mk index 8aa855d0ef..235b13b905 100644 --- a/package/rpi-firmware/rpi-firmware.mk +++ b/package/rpi-firmware/rpi-firmware.mk @@ -4,7 +4,19 @@ # ################################################################################ -RPI_FIRMWARE_VERSION = 542aceb30364db3ce87d532ea90451f46bbb84e9 +ifeq ($(call qstrip,$(BR2_PACKAGE_RPI_FIRMWARE_CUSTOM_VERSION)),) +ifeq ($(BR2_PACKAGE_RPI_FIRMWARE),y) +$(error The Raspberry Pi firmware version is no longer derived automatically.\ + Please set BR2_PACKAGE_RPI_FIRMWARE_CUSTOM_VERSION in your nerves_defconfig\ + to a version that is compatible with the Linux kernel that you are using.\ + For example, if using a tagged Raspberry Pi kernel, there usually is a \ + corresponding tag at https://github.com/raspberrypi/firmware) +endif +else +RPI_FIRMWARE_VERSION = $(call qstrip,$(BR2_PACKAGE_RPI_FIRMWARE_CUSTOM_VERSION)) +BR_NO_CHECK_HASH_FOR += $(RPI_FIRMWARE_SOURCE) +endif + RPI_FIRMWARE_SITE = $(call github,raspberrypi,firmware,$(RPI_FIRMWARE_VERSION)) RPI_FIRMWARE_LICENSE = BSD-3-Clause RPI_FIRMWARE_LICENSE_FILES = boot/LICENCE.broadcom -- 2.25.1