[openwrt/openwrt] build: add dtb support for sysupgrade-tar

LEDE Commits lede-commits at lists.infradead.org
Sun Jun 22 13:32:55 PDT 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/4392d1a92b747d3c39701eb6eac5e457f7fa0848

commit 4392d1a92b747d3c39701eb6eac5e457f7fa0848
Author: INAGAKI Hiroshi <musashino.open at gmail.com>
AuthorDate: Mon Apr 8 15:25:15 2024 +0900

    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 <musashino.open at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/16904
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 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




More information about the lede-commits mailing list