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@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16904
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
INAGAKI Hiroshi 2024-04-08 15:25:15 +09:00 committed by Hauke Mehrtens
parent f9743c5190
commit 4392d1a92b
2 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -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