@@ -76,6 +76,13 @@ config BR2_PACKAGE_RPI_FIRMWARE_CMDLINE_FILE
Path to a file stored as cmdline.txt in the boot partition
of the generated SD card image.
+config BR2_PACKAGE_RPI_FIRMWARE_AUTOBOOT_FILES
+ string "List of path(s) to file(s) containing autoboot configuration."
+ help
+ Space-separated path(s) to file(s) that should be stored
+ in the boot partition. They will be stored under their own
+ name in rpi-firmware.
+
config BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTBS
bool "Install Device Tree Blobs (DTBs)"
default y
@@ -62,6 +62,15 @@ define RPI_FIRMWARE_INSTALL_DTB_OVERLAYS
endef
endif
+RPI_FIRMWARE_AUTOBOOT_FILES = $(call qstrip,$(BR2_PACKAGE_RPI_FIRMWARE_AUTOBOOT_FILES))
+ifneq ($(RPI_FIRMWARE_AUTOBOOT_FILES),)
+define RPI_FIRMWARE_INSTALL_AUTOBOOTS
+ $(foreach f,$(RPI_FIRMWARE_AUTOBOOT_FILES), \
+ $(INSTALL) -D -m 0644 $(f) $(BINARIES_DIR)/rpi-firmware/$(notdir $(f))
+ )
+endef
+endif
+
# Install prebuilt libraries if RPI_USERLAND not enabled
ifneq ($(BR2_PACKAGE_RPI_USERLAND),y)
define RPI_FIRMWARE_INSTALL_TARGET_LIB
@@ -86,6 +95,7 @@ define RPI_FIRMWARE_INSTALL_IMAGES_CMDS
$(RPI_FIRMWARE_INSTALL_BIN)
$(RPI_FIRMWARE_INSTALL_CONFIG)
$(RPI_FIRMWARE_INSTALL_CMDLINE)
+ $(RPI_FIRMWARE_INSTALL_AUTOBOOTS)
$(RPI_FIRMWARE_INSTALL_DTB)
$(RPI_FIRMWARE_INSTALL_DTB_OVERLAYS)
endef
autoboot.txt is an optional configuration file for the RPi firmware: https://www.raspberrypi.com/documentation/computers/config_txt.html#autoboot-txt Supporting several autoboot files will enable A/B setups, as using the renameat2() system call with the RENAME_EXCHANGE flag will let users atomically replace one autoboot configuratin file with the other. This improves reliability in the case of an update which could potentially be interrupted. Signed-off-by: Olivier Benjamin <olivier.benjamin@bootlin.com> --- package/rpi-firmware/Config.in | 7 +++++++ package/rpi-firmware/rpi-firmware.mk | 10 ++++++++++ 2 files changed, 17 insertions(+)