From 4392d1a92b747d3c39701eb6eac5e457f7fa0848 Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Mon, 8 Apr 2024 15:25:15 +0900 Subject: [PATCH] build: add dtb support for sysupgrade-tar Add dtb support for Build/sysupgrade-tar definition and sysupgrade-tar.sh script. This changes are required for updating dtb separately. Signed-off-by: INAGAKI Hiroshi Link: https://github.com/openwrt/openwrt/pull/16904 Signed-off-by: Hauke Mehrtens --- include/image-commands.mk | 2 ++ scripts/sysupgrade-tar.sh | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/image-commands.mk b/include/image-commands.mk index ac3f305362..ea21ca2bf0 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -679,10 +679,12 @@ define Build/senao-header endef define Build/sysupgrade-tar + $(eval dtb=$(call param_get,dtb,$(1))) sh $(TOPDIR)/scripts/sysupgrade-tar.sh \ --board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \ --kernel $(call param_get_default,kernel,$(1),$(IMAGE_KERNEL)) \ --rootfs $(call param_get_default,rootfs,$(1),$(IMAGE_ROOTFS)) \ + $(if $(dtb),--dtb $(dtb)) \ $@ endef diff --git a/scripts/sysupgrade-tar.sh b/scripts/sysupgrade-tar.sh index b93b2584bb..c101dbf00b 100755 --- a/scripts/sysupgrade-tar.sh +++ b/scripts/sysupgrade-tar.sh @@ -5,6 +5,7 @@ board="" kernel="" rootfs="" +dtb="" outfile="" err="" @@ -28,6 +29,12 @@ while [ "$1" ]; do shift continue ;; + "--dtb") + dtb="$2" + shift + shift + continue + ;; *) if [ ! "$outfile" ]; then outfile=$1 @@ -38,8 +45,8 @@ while [ "$1" ]; do esac done -if [ ! -n "$board" -o ! -r "$kernel" -a ! -r "$rootfs" -o ! "$outfile" ]; then - echo "syntax: $0 [--board boardname] [--kernel kernelimage] [--rootfs rootfs] out" +if [ ! -n "$board" -o ! -r "$kernel" -a ! -r "$rootfs" -o ! "$outfile" -o -n "$dtb" -a ! -r "$dtb" ]; then + echo "syntax: $0 [--board boardname] [--kernel kernelimage] [--rootfs rootfs] [--dtb dtb] out" exit 1 fi @@ -66,6 +73,7 @@ if [ -n "${rootfs}" ]; then esac fi [ -z "${kernel}" ] || cp "${kernel}" "${tmpdir}/sysupgrade-${board}/kernel" +[ -z "${dtb}" ] || cp "${dtb}" "${tmpdir}/sysupgrade-${board}/dtb" mtime="" if [ -n "$SOURCE_DATE_EPOCH" ]; then