build: rename sysupgrade-nand to sysupgrade-tar
authorJo-Philipp Wich <jo@mein.io>
Fri, 29 Jul 2016 13:05:51 +0000 (15:05 +0200)
committerJo-Philipp Wich <jo@mein.io>
Fri, 29 Jul 2016 14:53:03 +0000 (16:53 +0200)
Now that the "sysupgrade-nand" step is used by non-NAND targets as well,
rename it to "sysupgrade-tar" to make it more generic.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
12 files changed:
include/image-commands.mk
scripts/sysupgrade-nand.sh [deleted file]
scripts/sysupgrade-tar.sh [new file with mode: 0755]
target/linux/apm821xx/image/Makefile
target/linux/ar71xx/image/nand.mk
target/linux/ipq806x/image/Makefile
target/linux/kirkwood/image/Makefile
target/linux/lantiq/image/Makefile
target/linux/mvebu/image/Makefile
target/linux/octeon/image/Makefile
target/linux/oxnas/image/Makefile
target/linux/ramips/image/mt7621.mk

index fc36509efd604f9f1ffebb9f45fc4a53eedc2d07..8cf54bbaa16795e389863c7001d207a5ae53968f 100644 (file)
@@ -148,8 +148,8 @@ define Build/combined-image
        @mv $@.new $@
 endef
 
-define Build/sysupgrade-nand
-       sh $(TOPDIR)/scripts/sysupgrade-nand.sh \
+define Build/sysupgrade-tar
+       sh $(TOPDIR)/scripts/sysupgrade-tar.sh \
                --board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \
                --kernel $(word 1,$^) \
                --rootfs $(word 2,$^) \
diff --git a/scripts/sysupgrade-nand.sh b/scripts/sysupgrade-nand.sh
deleted file mode 100755 (executable)
index 45b17da..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/sh
-
-board=""
-kernel=""
-rootfs=""
-outfile=""
-err=""
-
-while [ "$1" ]; do
-       case "$1" in
-       "--board")
-               board="$2"
-               shift
-               shift
-               continue
-               ;;
-       "--kernel")
-               kernel="$2"
-               shift
-               shift
-               continue
-               ;;
-       "--rootfs")
-               rootfs="$2"
-               shift
-               shift
-               continue
-               ;;
-       *)
-               if [ ! "$outfile" ]; then
-                       outfile=$1
-                       shift
-                       continue
-               fi
-               ;;
-       esac
-done
-
-if [ ! -n "$board" -o ! -r "$kernel" -a  ! -r "$rootfs" -o ! "$outfile" ]; then
-       echo "syntax: $0 [--board boardname] [--kernel kernelimage] [--rootfs rootfs] out"
-       exit 1
-fi
-
-tmpdir="$( mktemp -d 2> /dev/null )"
-if [ -z "$tmpdir" ]; then
-       # try OSX signature
-       tmpdir="$( mktemp -t 'ubitmp' -d )"
-fi
-
-if [ -z "$tmpdir" ]; then
-       exit 1
-fi
-
-mkdir -p "${tmpdir}/sysupgrade-${board}"
-echo "BOARD=${board}" > "${tmpdir}/sysupgrade-${board}/CONTROL"
-[ -z "${rootfs}" ] || cp "${rootfs}" "${tmpdir}/sysupgrade-${board}/root"
-[ -z "${kernel}" ] || cp "${kernel}" "${tmpdir}/sysupgrade-${board}/kernel"
-
-mtime=""
-if [ -n "$SOURCE_DATE_EPOCH" ]; then
-       mtime="--mtime=@${SOURCE_DATE_EPOCH}"
-fi
-
-(cd "$tmpdir"; tar cvf sysupgrade.tar sysupgrade-${board} ${mtime})
-err="$?"
-if [ -e "$tmpdir/sysupgrade.tar" ]; then
-       cp "$tmpdir/sysupgrade.tar" "$outfile"
-else
-       err=2
-fi
-rm -rf "$tmpdir"
-
-exit $err
diff --git a/scripts/sysupgrade-tar.sh b/scripts/sysupgrade-tar.sh
new file mode 100755 (executable)
index 0000000..45b17da
--- /dev/null
@@ -0,0 +1,73 @@
+#!/bin/sh
+
+board=""
+kernel=""
+rootfs=""
+outfile=""
+err=""
+
+while [ "$1" ]; do
+       case "$1" in
+       "--board")
+               board="$2"
+               shift
+               shift
+               continue
+               ;;
+       "--kernel")
+               kernel="$2"
+               shift
+               shift
+               continue
+               ;;
+       "--rootfs")
+               rootfs="$2"
+               shift
+               shift
+               continue
+               ;;
+       *)
+               if [ ! "$outfile" ]; then
+                       outfile=$1
+                       shift
+                       continue
+               fi
+               ;;
+       esac
+done
+
+if [ ! -n "$board" -o ! -r "$kernel" -a  ! -r "$rootfs" -o ! "$outfile" ]; then
+       echo "syntax: $0 [--board boardname] [--kernel kernelimage] [--rootfs rootfs] out"
+       exit 1
+fi
+
+tmpdir="$( mktemp -d 2> /dev/null )"
+if [ -z "$tmpdir" ]; then
+       # try OSX signature
+       tmpdir="$( mktemp -t 'ubitmp' -d )"
+fi
+
+if [ -z "$tmpdir" ]; then
+       exit 1
+fi
+
+mkdir -p "${tmpdir}/sysupgrade-${board}"
+echo "BOARD=${board}" > "${tmpdir}/sysupgrade-${board}/CONTROL"
+[ -z "${rootfs}" ] || cp "${rootfs}" "${tmpdir}/sysupgrade-${board}/root"
+[ -z "${kernel}" ] || cp "${kernel}" "${tmpdir}/sysupgrade-${board}/kernel"
+
+mtime=""
+if [ -n "$SOURCE_DATE_EPOCH" ]; then
+       mtime="--mtime=@${SOURCE_DATE_EPOCH}"
+fi
+
+(cd "$tmpdir"; tar cvf sysupgrade.tar sysupgrade-${board} ${mtime})
+err="$?"
+if [ -e "$tmpdir/sysupgrade.tar" ]; then
+       cp "$tmpdir/sysupgrade.tar" "$outfile"
+else
+       err=2
+fi
+rm -rf "$tmpdir"
+
+exit $err
index 6ad4d99c11c27f7f42e55dd2931001c03fc5ee27..c49e57abc4dde136b5f7c7d95674cae882db43cf 100644 (file)
@@ -76,7 +76,7 @@ define Device/mr24
   IMAGE_SIZE := 8191k
   KERNEL := kernel-bin | lzma | uImage lzma | MerakiAdd-dtb | MerakiNAND
   KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux | gzip | uImage gzip | MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | MerakiNAND
-  IMAGE/sysupgrade.tar := sysupgrade-nand
+  IMAGE/sysupgrade.tar := sysupgrade-tar
 endef
 TARGET_DEVICES += mr24
 
@@ -156,7 +156,7 @@ define Device/WNDR4700
   KERNEL_INITRAMFS := kernel-bin | gzip | dtb | wndr4700-specialImage gzip
   IMAGE/factory.img := dtb | create-uImage-dtb | append-kernel | pad-to 2M | append-ubi | \
                       netgear-dni | check-size $$$$(IMAGE_SIZE)
-  IMAGE/sysupgrade.tar := sysupgrade-nand
+  IMAGE/sysupgrade.tar := sysupgrade-tar
   NETGEAR_BOARD_ID := WNDR4700
   NETGEAR_HW_ID := 29763875+128+256
 endef
index 1aa8541587c8224636586ded2ee068956968fd5c..c6a8d7e41010822455fdbfd625049221e02be927 100644 (file)
@@ -16,7 +16,7 @@ define Device/mr18
   IMAGES := sysupgrade.tar
   KERNEL := kernel-bin | patch-cmdline | MerakiNAND
   KERNEL_INITRAMFS := kernel-bin | patch-cmdline | MerakiNAND
-  IMAGE/sysupgrade.tar := sysupgrade-nand
+  IMAGE/sysupgrade.tar := sysupgrade-tar
 endef
 TARGET_DEVICES += mr18
 
index 9bf072e17116e67c555c7a907ac466f9bee1aef0..fc73ec25717b75f2cdd8e4c01d78afb9ed90ecf7 100644 (file)
@@ -59,7 +59,7 @@ define Device/UbiFit
        KERNEL_IN_UBI := 1
        IMAGES := nand-factory.ubi nand-sysupgrade.tar
        IMAGE/nand-factory.ubi := append-ubi
-       IMAGE/nand-sysupgrade.tar := sysupgrade-nand
+       IMAGE/nand-sysupgrade.tar := sysupgrade-tar
 endef
 
 define Device/DniImage
@@ -157,7 +157,7 @@ define Device/EA8500
        BOARD_NAME := ea8500
        IMAGES := factory.bin sysupgrade.tar
        IMAGE/factory.bin := append-kernel 3145728 | append-ubi
-       IMAGE/sysupgrade.tar := sysupgrade-nand
+       IMAGE/sysupgrade.tar := sysupgrade-tar
        DEVICE_TITLE := Linksys EA8500
        DEVICE_PACKAGES := ath10k-firmware-qca99x0
 endef
index 217ec234b41cdc213c7f110283f2fec6ce3d0a96..91b0495a436c7e2152acc5460115b172743e82d2 100644 (file)
@@ -28,7 +28,7 @@ define Device/Default
   SUBPAGESIZE := 512
   BLOCKSIZE := 128KiB
   IMAGES := sysupgrade.tar
-  IMAGE/sysupgrade.tar := sysupgrade-nand
+  IMAGE/sysupgrade.tar := sysupgrade-tar
 endef
 
 define Device/dockstar
index 52a568dac0fc31d0e6c4827edcafbbd4d37cbcb4..0718e9daeaadff305a8aaefb3d01c6086b184978 100644 (file)
@@ -202,7 +202,7 @@ endef
 
 define Device/NAND
   $(Device/NAND/$(SUBTARGET))
-  IMAGE/sysupgrade.bin := sysupgrade-nand
+  IMAGE/sysupgrade.bin := sysupgrade-tar
 endef
 
 define Device/lantiqBrnImage
index f8712291ec8f6e979605eb31707fe7efb75677f8..0e863478d8d0a2f3ca6166aad9f9536c6e3fb51d 100644 (file)
@@ -24,7 +24,7 @@ endef
 
 define Device/UBI
   IMAGES := sysupgrade.bin
-  IMAGE/sysupgrade.bin := sysupgrade-nand
+  IMAGE/sysupgrade.bin := sysupgrade-tar
 endef
 
 define Device/UBI-factory
index 3d1bdf7b17ed6a34e2898849a406707a1517d2b8..a0bbc0e52901fdf56af87a4e38d81472532fe3fb 100644 (file)
@@ -14,7 +14,7 @@ define Device/Default
   KERNEL_INITRAMFS_NAME := vmlinux-initramfs.elf
   KERNEL := kernel-bin | strip-kernel | patch-cmdline
   IMAGES := sysupgrade.tar
-  IMAGE/sysupgrade.tar := sysupgrade-nand
+  IMAGE/sysupgrade.tar := sysupgrade-tar
 endef
 
 define Build/strip-kernel
index 3eb1212a741b01a3a04fd1505817c4339f1926b2..097d894d50c6a70fb9d9da98edca747dd11ad62f 100644 (file)
@@ -36,7 +36,7 @@ define Device/Default
   PROFILES = Default $$(DTS)
   IMAGES := ubinized.bin sysupgrade.tar
   IMAGE/ubinized.bin := append-ubi
-  IMAGE/sysupgrade.tar := sysupgrade-nand
+  IMAGE/sysupgrade.tar := sysupgrade-tar
   KERNEL_IN_UBI := 1
   UBOOTENV_IN_UBI := 1
 endef
index 2795eb13f65bd42136229a5b9b043fb396e52f37..59a9332294099e166fbe68444c84c3136c96bc41 100644 (file)
@@ -158,7 +158,7 @@ define Device/ubnt-erx
   KERNEL := $(KERNEL_DTB) | uImage lzma
   IMAGES := sysupgrade.tar
   KERNEL_INITRAMFS := $$(KERNEL) | ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
-  IMAGE/sysupgrade.tar := sysupgrade-nand
+  IMAGE/sysupgrade.tar := sysupgrade-tar
   DEVICE_TITLE := Ubiquiti EdgeRouter X
   DEVICE_PACKAGES := -kmod-mt76 -kmod-rt2800-pci -kmod-cfg80211 -wpad-mini -iwinfo
 endef