treewide: rename IMAGE_PREFIX/IMAGE_NAME to DEVICE_IMG_*
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Mon, 22 Feb 2021 14:55:43 +0000 (15:55 +0100)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Thu, 25 Feb 2021 17:11:06 +0000 (18:11 +0100)
We so far had two variables IMG_PREFIX and IMAGE_PREFIX with
different content. Since these names are obviously quite
confusing, this patch renames the latter to DEVICE_IMG_PREFIX,
as it's a device-dependent variable, while IMG_PREFIX is only
(sub)target-dependent.

For consistency, also rename IMAGE_NAME to DEVICE_IMG_NAME, as
that's a device-dependent variable as well.

Cc: Paul Spooren <mail@aparcar.org>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
include/image.mk
scripts/json_add_image_info.py
target/linux/ath25/image/Makefile
target/linux/bcm47xx/image/Makefile
target/linux/bcm4908/image/Makefile
target/linux/bcm53xx/image/Makefile
target/linux/bcm63xx/image/bcm63xx.mk
target/linux/imx6/image/Makefile
target/linux/mvebu/image/Makefile
target/linux/mvebu/image/cortexa53.mk
target/linux/mvebu/image/cortexa9.mk

index 8cfd2155f3b01fb1ed1cad5033aecaa7cc9b9260..48911e4057b7f6e6aa729cc7608eec3b6c35d5ad 100644 (file)
@@ -363,14 +363,14 @@ define Device/Init
 
   IMAGES :=
   ARTIFACTS :=
-  IMAGE_PREFIX := $(IMG_PREFIX)-$(1)
-  IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2)
+  DEVICE_IMG_PREFIX := $(IMG_PREFIX)-$(1)
+  DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1)-$$(2)
   IMAGE_SIZE :=
-  KERNEL_PREFIX = $$(IMAGE_PREFIX)
+  KERNEL_PREFIX = $$(DEVICE_IMG_PREFIX)
   KERNEL_SUFFIX := -kernel.bin
   KERNEL_INITRAMFS_SUFFIX = $$(KERNEL_SUFFIX)
   KERNEL_IMAGE = $$(KERNEL_PREFIX)$$(KERNEL_SUFFIX)
-  KERNEL_INITRAMFS_PREFIX = $$(IMAGE_PREFIX)-initramfs
+  KERNEL_INITRAMFS_PREFIX = $$(DEVICE_IMG_PREFIX)-initramfs
   KERNEL_INITRAMFS_IMAGE = $$(KERNEL_INITRAMFS_PREFIX)$$(KERNEL_INITRAMFS_SUFFIX)
   KERNEL_INITRAMFS_NAME = $$(KERNEL_NAME)-initramfs
   KERNEL_INSTALL :=
@@ -490,10 +490,10 @@ define Device/Build/initramfs
        DEVICE_ID="$(1)" \
        BIN_DIR="$(BIN_DIR)" \
        SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \
-       IMAGE_NAME="$$(notdir $$^)" \
+       DEVICE_IMG_NAME="$$(notdir $$^)" \
        IMAGE_TYPE="kernel" \
        IMAGE_FILESYSTEM="initramfs" \
-       IMAGE_PREFIX="$$(IMAGE_PREFIX)" \
+       DEVICE_IMG_PREFIX="$$(DEVICE_IMG_PREFIX)" \
        DEVICE_VENDOR="$$(DEVICE_VENDOR)" \
        DEVICE_MODEL="$$(DEVICE_MODEL)" \
        DEVICE_VARIANT="$$(DEVICE_VARIANT)" \
@@ -565,9 +565,9 @@ endef
 define Device/Build/image
   GZ_SUFFIX := $(if $(filter %dtb %gz,$(2)),,$(if $(and $(findstring ext4,$(1)),$(CONFIG_TARGET_IMAGES_GZIP)),.gz))
   $$(_TARGET): $(if $(CONFIG_JSON_OVERVIEW_IMAGE_INFO), \
-         $(BUILD_DIR)/json_info_files/$(call IMAGE_NAME,$(1),$(2)).json, \
-         $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2))$$(GZ_SUFFIX))
-  $(eval $(call Device/Export,$(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)),$(1)))
+         $(BUILD_DIR)/json_info_files/$(call DEVICE_IMG_NAME,$(1),$(2)).json, \
+         $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))$$(GZ_SUFFIX))
+  $(eval $(call Device/Export,$(KDIR)/tmp/$(call DEVICE_IMG_NAME,$(1),$(2)),$(1)))
 
   ROOTFS/$(1)/$(3) := \
        $(KDIR)/root.$(1)$$(strip \
@@ -578,28 +578,28 @@ define Device/Build/image
   ifndef IB
     $$(ROOTFS/$(1)/$(3)): $(if $(TARGET_PER_DEVICE_ROOTFS),target-dir-$$(ROOTFS_ID/$(3)))
   endif
-  $(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2)): $$(KDIR_KERNEL_IMAGE) $$(ROOTFS/$(1)/$(3))
+  $(KDIR)/tmp/$(call DEVICE_IMG_NAME,$(1),$(2)): $$(KDIR_KERNEL_IMAGE) $$(ROOTFS/$(1)/$(3))
        @rm -f $$@
        [ -f $$(word 1,$$^) -a -f $$(word 2,$$^) ]
        $$(call concat_cmd,$(if $(IMAGE/$(2)/$(1)),$(IMAGE/$(2)/$(1)),$(IMAGE/$(2))))
 
-  .IGNORE: $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2))
+  .IGNORE: $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))
 
-  $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2)).gz: $(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2))
+  $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2)).gz: $(KDIR)/tmp/$(call DEVICE_IMG_NAME,$(1),$(2))
        gzip -c -9n $$^ > $$@
 
-  $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2)): $(KDIR)/tmp/$(call IMAGE_NAME,$(1),$(2))
+  $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2)): $(KDIR)/tmp/$(call DEVICE_IMG_NAME,$(1),$(2))
        cp $$^ $$@
 
-  $(BUILD_DIR)/json_info_files/$(call IMAGE_NAME,$(1),$(2)).json: $(BIN_DIR)/$(call IMAGE_NAME,$(1),$(2))$$(GZ_SUFFIX)
+  $(BUILD_DIR)/json_info_files/$(call DEVICE_IMG_NAME,$(1),$(2)).json: $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))$$(GZ_SUFFIX)
        @mkdir -p $$(shell dirname $$@)
        DEVICE_ID="$(DEVICE_NAME)" \
        BIN_DIR="$(BIN_DIR)" \
        SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \
-       IMAGE_NAME="$(IMAGE_NAME)" \
+       DEVICE_IMG_NAME="$(DEVICE_IMG_NAME)" \
        IMAGE_TYPE=$(word 1,$(subst ., ,$(2))) \
        IMAGE_FILESYSTEM="$(1)" \
-       IMAGE_PREFIX="$(IMAGE_PREFIX)" \
+       DEVICE_IMG_PREFIX="$(DEVICE_IMG_PREFIX)" \
        DEVICE_VENDOR="$(DEVICE_VENDOR)" \
        DEVICE_MODEL="$(DEVICE_MODEL)" \
        DEVICE_VARIANT="$(DEVICE_VARIANT)" \
@@ -624,15 +624,15 @@ define Device/Build/image
 endef
 
 define Device/Build/artifact
-  $$(_TARGET): $(BIN_DIR)/$(IMAGE_PREFIX)-$(1)
-  $(eval $(call Device/Export,$(KDIR)/tmp/$(IMAGE_PREFIX)-$(1)))
-  $(KDIR)/tmp/$(IMAGE_PREFIX)-$(1): $$(KDIR_KERNEL_IMAGE)
+  $$(_TARGET): $(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1)
+  $(eval $(call Device/Export,$(KDIR)/tmp/$(DEVICE_IMG_PREFIX)-$(1)))
+  $(KDIR)/tmp/$(DEVICE_IMG_PREFIX)-$(1): $$(KDIR_KERNEL_IMAGE)
        @rm -f $$@
        $$(call concat_cmd,$(ARTIFACT/$(1)))
 
-  .IGNORE: $(BIN_DIR)/$(IMAGE_PREFIX)-$(1)
+  .IGNORE: $(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1)
 
-  $(BIN_DIR)/$(IMAGE_PREFIX)-$(1): $(KDIR)/tmp/$(IMAGE_PREFIX)-$(1)
+  $(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1): $(KDIR)/tmp/$(DEVICE_IMG_PREFIX)-$(1)
        cp $$^ $$@
 
 endef
index d394cf4d1fe433488ce57c061ef56476a5f691c1..38cd3c487d00a8809d0a7df4ecc4cbc12cfe52b8 100755 (executable)
@@ -12,7 +12,7 @@ if len(argv) != 2:
 
 json_path = Path(argv[1])
 bin_dir = Path(getenv("BIN_DIR"))
-image_file = bin_dir / getenv("IMAGE_NAME")
+image_file = bin_dir / getenv("DEVICE_IMG_NAME")
 
 if not image_file.is_file():
     print("Skip JSON creation for non existing image ", image_file)
@@ -47,12 +47,12 @@ image_info = {
     "source_date_epoch": getenv("SOURCE_DATE_EPOCH"),
     "profiles": {
         device_id: {
-            "image_prefix": getenv("IMAGE_PREFIX"),
+            "image_prefix": getenv("DEVICE_IMG_PREFIX"),
             "images": [
                 {
                     "type": getenv("IMAGE_TYPE"),
                     "filesystem": getenv("IMAGE_FILESYSTEM"),
-                    "name": getenv("IMAGE_NAME"),
+                    "name": getenv("DEVICE_IMG_NAME"),
                     "sha256": image_hash,
                 }
             ],
index a072f2408ac679012d5853fdabca860ab58ab5b0..2b22d54105a3d2d47bbe9f94f5f54bf940815137 100644 (file)
@@ -67,7 +67,7 @@ define Device/generic
   IMAGE/kernel.lzma := elf-kernel | lzma-kernel
   IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k
   IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | combined-image
-  IMAGE_NAME = $$(IMAGE_PREFIX)-$$(if $$(findstring kernel,$$(2)),,$$(1)-)$$(2)
+  DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(if $$(findstring kernel,$$(2)),,$$(1)-)$$(2)
 endef
 TARGET_DEVICES += generic
 
index 2aeef178a44b15bee7dc565b6ea3beb51b068761..30a1b2f4769da7325a8cbcf443b96e2ee52e57c6 100644 (file)
@@ -137,7 +137,7 @@ DEVICE_VARS += BIN_TAIL
 
 define Device/Default
        KERNEL := kernel-bin
-       IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2)
+       DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1).$$(2)
        KERNEL_NAME = vmlinux.lzma
        KERNEL_INITRAMFS_NAME = vmlinux-initramfs.lzma
        FILESYSTEMS := $(FS_64K)
index 8a40a1e6a971b81f4fb1b31193e65cb507ee998f..0775f42254ca4abe87060f2262c14cb1d5d7ad34 100644 (file)
@@ -44,7 +44,7 @@ define Device/Default
   KERNEL_INITRAMFS := kernel-bin | bcm4908lzma | bcm4908kernel
   FILESYSTEMS := squashfs
   KERNEL_NAME := Image
-  IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2)
+  DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1).$$(2)
   BLOCKSIZE := 128k
   PAGESIZE := 2048
 endef
index 0ba067d36482157abbc3e87ce775c67bfe770638..86d241f57f291d88428f8896f65995b300a2ea0f 100644 (file)
@@ -130,7 +130,7 @@ define Device/Default
   KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma-d16 | trx
   FILESYSTEMS := squashfs
   KERNEL_NAME := zImage
-  IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2)
+  DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1).$$(2)
   IMAGES := trx
   BLOCKSIZE := 128k
   PAGESIZE := 2048
index 24b150c063c778f53c15fdf1089100bff8642bcb..54eaffc5bd3130c920d2863c9e7248f63d5bfa02 100644 (file)
@@ -56,7 +56,7 @@ define Device/bcm63xx_redboot
   KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-lzma elf
   IMAGES := redboot.bin
   IMAGE/redboot.bin := redboot-bin
-  REDBOOT_PREFIX := $$(IMAGE_PREFIX)
+  REDBOOT_PREFIX := $$(DEVICE_IMG_PREFIX)
 endef
 
 ### Generic ###
index afc75d6df14488ff77c918aab0b661bb4edf1862..9ce620655a220a323d6043baeffe999d92127737 100644 (file)
@@ -227,7 +227,7 @@ define Device/apalis
   UBOOT := apalis_imx6
   FILESYSTEMS := squashfs
   IMAGES := combined.bin sysupgrade.bin
-  IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2)
+  DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1).$$(2)
   IMAGE/combined.bin := append-rootfs | pad-extra 128k | apalis-emmc
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
   ARTIFACTS := recovery.scr
index 871b622ae25174eb16875a6453f99049a9dc6c35..9220c6c9f1410bef11716364db71ce98e650f454 100644 (file)
@@ -80,7 +80,7 @@ endef
 
 define Build/uDPU-firmware
        (rm -fR $@-fw; mkdir -p $@-fw)
-       $(CP) $(BIN_DIR)/$(IMAGE_PREFIX)-initramfs.itb $@-fw/recovery.itb
+       $(CP) $(BIN_DIR)/$(DEVICE_IMG_PREFIX)-initramfs.itb $@-fw/recovery.itb
        $(CP) $@-boot.scr $@-fw/boot.scr
        $(TAR) -cvzp --numeric-owner --owner=0 --group=0 --sort=name \
                $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
@@ -90,7 +90,7 @@ define Build/uDPU-firmware
                -f $@-fw/boot.tgz -C $@.boot .
        $(TAR) -cvzp --numeric-owner --owner=0 --group=0 --sort=name \
                $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
-               -f $(KDIR_TMP)/$(IMAGE_PREFIX)-firmware.tgz -C $@-fw .
+               -f $(KDIR_TMP)/$(DEVICE_IMG_PREFIX)-firmware.tgz -C $@-fw .
 endef
 
 define Device/Default
index 6a3a5686553c3be1c678bbb5fce33b0c0f1f9c45..ca3a53f992c052e265799a4e75b097b90da96ffd 100644 (file)
@@ -86,7 +86,7 @@ define Device/methode_udpu
   KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb
   KERNEL_INITRAMFS_SUFFIX := .itb
   DEVICE_PACKAGES += f2fs-tools fdisk kmod-i2c-pxa
-  IMAGE_NAME = $$(IMAGE_PREFIX)-$$(2)
+  DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(2)
   IMAGES := firmware.tgz
   IMAGE/firmware.tgz := boot-scr | boot-img-ext4 | uDPU-firmware | append-metadata
   BOOT_SCRIPT := udpu
index 61f4d17813273944ab7a162c0f2d7c873c5e9a28..a7ebc30a715f071a238d9e0940377e6421fad1c8 100644 (file)
@@ -36,10 +36,10 @@ define Device/cznic_turris-omnia
     mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \
     wpad-basic-wolfssl kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct \
     partx-utils kmod-i2c-mux-pca954x
-  IMAGES := $$(IMAGE_PREFIX)-sysupgrade.img.gz omnia-medkit-$$(IMAGE_PREFIX)-initramfs.tar.gz
-  IMAGE/$$(IMAGE_PREFIX)-sysupgrade.img.gz := boot-scr | boot-img | sdcard-img | gzip | append-metadata
-  IMAGE/omnia-medkit-$$(IMAGE_PREFIX)-initramfs.tar.gz := omnia-medkit-initramfs | gzip
-  IMAGE_NAME = $$(2)
+  IMAGES := $$(DEVICE_IMG_PREFIX)-sysupgrade.img.gz omnia-medkit-$$(DEVICE_IMG_PREFIX)-initramfs.tar.gz
+  IMAGE/$$(DEVICE_IMG_PREFIX)-sysupgrade.img.gz := boot-scr | boot-img | sdcard-img | gzip | append-metadata
+  IMAGE/omnia-medkit-$$(DEVICE_IMG_PREFIX)-initramfs.tar.gz := omnia-medkit-initramfs | gzip
+  DEVICE_IMG_NAME = $$(2)
   SUPPORTED_DEVICES += armada-385-turris-omnia
   BOOT_SCRIPT := turris-omnia
 endef