[OpenWrt-Devel] [PATCH v2 2/2] ath79: introduce KERNEL_DTB_LZMA variable for common build sequence
Adrian Schmutzler
freifunk at adrianschmutzler.de
Mon Feb 3 05:19:16 EST 2020
This introduces a variable KERNEL_DTB_LZMA to replace the frequently
used sequence "kernel-bin | append-dtb | lzma", similar to the
same variable in ramips target.
Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
target/linux/ath79/image/Makefile | 5 +++--
target/linux/ath79/image/common-mikrotik.mk | 4 ++--
target/linux/ath79/image/common-tp-link.mk | 18 ++++++++----------
target/linux/ath79/image/generic-tp-link.mk | 3 +--
target/linux/ath79/image/generic-ubnt.mk | 2 +-
target/linux/ath79/image/generic.mk | 10 +++++-----
6 files changed, 20 insertions(+), 22 deletions(-)
diff --git a/target/linux/ath79/image/Makefile b/target/linux/ath79/image/Makefile
index a28658ec0b..1795f3d558 100644
--- a/target/linux/ath79/image/Makefile
+++ b/target/linux/ath79/image/Makefile
@@ -52,6 +52,7 @@ define Build/relocate-kernel
rm -rf $@.relocate
endef
+KERNEL_DTB_LZMA := kernel-bin | append-dtb | lzma
define Device/Default
DEVICE_DTS_DIR := ../dts
@@ -59,8 +60,8 @@ define Device/Default
PROFILES = Default
MTDPARTS :=
BLOCKSIZE := 64k
- KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
- KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
+ KERNEL := $(KERNEL_DTB_LZMA) | uImage lzma
+ KERNEL_INITRAMFS := $(KERNEL_DTB_LZMA) | uImage lzma
COMPILE :=
SUPPORTED_DEVICES := $(subst _,$(comma),$(1))
IMAGES := sysupgrade.bin
diff --git a/target/linux/ath79/image/common-mikrotik.mk b/target/linux/ath79/image/common-mikrotik.mk
index 292237c76a..de7db6aa36 100644
--- a/target/linux/ath79/image/common-mikrotik.mk
+++ b/target/linux/ath79/image/common-mikrotik.mk
@@ -2,6 +2,6 @@ define Device/mikrotik
DEVICE_VENDOR := MikroTik
DEVICE_PACKAGES := rbextract rbcfg
LOADER_TYPE := elf
- KERNEL := kernel-bin | append-dtb | lzma | loader-kernel
- KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-kernel
+ KERNEL := $(KERNEL_DTB_LZMA) | loader-kernel
+ KERNEL_INITRAMFS := $(KERNEL_DTB_LZMA) | loader-kernel
endef
diff --git a/target/linux/ath79/image/common-tp-link.mk b/target/linux/ath79/image/common-tp-link.mk
index cfc574e4fb..5df99f0eb9 100644
--- a/target/linux/ath79/image/common-tp-link.mk
+++ b/target/linux/ath79/image/common-tp-link.mk
@@ -14,8 +14,8 @@ define Device/tplink-v1
TPLINK_HWREV := 0x1
TPLINK_HEADER_VERSION := 1
LOADER_TYPE := gz
- KERNEL := kernel-bin | append-dtb | lzma
- KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | tplink-v1-header
+ KERNEL := $(KERNEL_DTB_LZMA)
+ KERNEL_INITRAMFS := $(KERNEL_DTB_LZMA) | tplink-v1-header
IMAGES += factory.bin
IMAGE/sysupgrade.bin := tplink-v1-image sysupgrade | append-metadata
IMAGE/factory.bin := tplink-v1-image factory
@@ -26,8 +26,8 @@ define Device/tplink-v2
TPLINK_HWREV := 0x1
TPLINK_HWREVADD := 0x0
TPLINK_HVERSION := 3
- KERNEL := kernel-bin | append-dtb | lzma
- KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | tplink-v2-header
+ KERNEL := $(KERNEL_DTB_LZMA)
+ KERNEL_INITRAMFS := $(KERNEL_DTB_LZMA) | tplink-v2-header
IMAGE/sysupgrade.bin := tplink-v2-image -s | append-metadata | \
check-size $$$$(IMAGE_SIZE)
endef
@@ -37,8 +37,7 @@ define Device/tplink-nolzma
LOADER_FLASH_OFFS := 0x22000
COMPILE := loader-$(1).gz
COMPILE/loader-$(1).gz := loader-okli-compile
- KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | \
- loader-okli $(1) 7680
+ KERNEL := $(KERNEL_DTB_LZMA) | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 7680
KERNEL_INITRAMFS := kernel-bin | append-dtb | gzip | tplink-v1-header
endef
@@ -74,7 +73,7 @@ endef
define Device/tplink-safeloader
$(Device/tplink-v1)
- KERNEL := kernel-bin | append-dtb | lzma | tplink-v1-header -O
+ KERNEL := $(KERNEL_DTB_LZMA) | tplink-v1-header -O
IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \
append-metadata | check-size $$$$(IMAGE_SIZE)
IMAGE/factory.bin := append-rootfs | tplink-safeloader factory
@@ -82,7 +81,7 @@ endef
define Device/tplink-safeloader-uimage
$(Device/tplink-safeloader)
- KERNEL := kernel-bin | append-dtb | lzma | uImageArcher lzma
+ KERNEL := $(KERNEL_DTB_LZMA) | uImageArcher lzma
endef
define Device/tplink-safeloader-okli
@@ -91,6 +90,5 @@ define Device/tplink-safeloader-okli
LOADER_FLASH_OFFS := 0x43000
COMPILE := loader-$(1).elf
COMPILE/loader-$(1).elf := loader-okli-compile
- KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49 | \
- loader-okli $(1) 12288
+ KERNEL := $(KERNEL_DTB_LZMA) | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) 12288
endef
diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk
index 2a2384762b..458917547f 100644
--- a/target/linux/ath79/image/generic-tp-link.mk
+++ b/target/linux/ath79/image/generic-tp-link.mk
@@ -201,8 +201,7 @@ define Device/tplink_archer-d50-v1
TPLINK_HWID := 0xC1200001
TPLINK_HWREV := 0x00000046
TPLINK_FLASHLAYOUT := 8Mqca
- KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | \
- tplink-v2-header -s -V "ver. 1.0"
+ KERNEL_INITRAMFS := $(KERNEL_DTB_LZMA) | tplink-v2-header -s -V "ver. 1.0"
endef
TARGET_DEVICES += tplink_archer-d50-v1
diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk
index ffae83eda5..9fb3b9a179 100644
--- a/target/linux/ath79/image/generic-ubnt.mk
+++ b/target/linux/ath79/image/generic-ubnt.mk
@@ -220,7 +220,7 @@ define Device/ubnt_routerstation_common
IMAGES := factory.bin
IMAGE/factory.bin := append-rootfs | pad-rootfs | mkubntimage | \
check-size $$$$(IMAGE_SIZE)
- KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
+ KERNEL := $(KERNEL_DTB_LZMA) | pad-to $$(BLOCKSIZE)
KERNEL_INITRAMFS := kernel-bin | append-dtb
endef
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 1bc7b2d68e..10c5a07739 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -105,7 +105,7 @@ define Device/adtran_bsap1880
SOC := ar7161
DEVICE_VENDOR := Adtran/Bluesocket
DEVICE_PACKAGES += -swconfig -uboot-envtools fconfig
- KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
+ KERNEL := $(KERNEL_DTB_LZMA) | pad-to $$(BLOCKSIZE)
KERNEL_INITRAMFS := kernel-bin | append-dtb
IMAGE_SIZE := 11200k
IMAGES += kernel.bin rootfs.bin
@@ -151,7 +151,7 @@ define Device/avm_fritz300e
SOC := ar7242
DEVICE_VENDOR := AVM
DEVICE_MODEL := FRITZ!WLAN Repeater 300E
- KERNEL := kernel-bin | append-dtb | lzma | eva-image
+ KERNEL := $(KERNEL_DTB_LZMA) | eva-image
KERNEL_INITRAMFS := $$(KERNEL)
IMAGE_SIZE := 15232k
IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | \
@@ -166,7 +166,7 @@ define Device/avm_fritz4020
DEVICE_VENDOR := AVM
DEVICE_MODEL := FRITZ!Box 4020
IMAGE_SIZE := 15232k
- KERNEL := kernel-bin | append-dtb | lzma | eva-image
+ KERNEL := $(KERNEL_DTB_LZMA) | eva-image
KERNEL_INITRAMFS := $$(KERNEL)
IMAGE/sysupgrade.bin := append-kernel | pad-to 64k | \
append-squashfs-fakeroot-be | pad-to 256 | append-rootfs | pad-rootfs | \
@@ -712,7 +712,7 @@ define Device/jjplus_ja76pf2
IMAGES := kernel.bin rootfs.bin
IMAGE/kernel.bin := append-kernel
IMAGE/rootfs.bin := append-rootfs | pad-rootfs
- KERNEL := kernel-bin | append-dtb | lzma | pad-to $$(BLOCKSIZE)
+ KERNEL := $(KERNEL_DTB_LZMA) | pad-to $$(BLOCKSIZE)
KERNEL_INITRAMFS := kernel-bin | append-dtb
IMAGE_SIZE := 16000k
SUPPORTED_DEVICES += ja76pf2
@@ -992,7 +992,7 @@ define Device/pisen_wmb001n
COMPILE/loader-$(1).bin := loader-okli-compile
COMPILE/loader-$(1).uImage := append-loader-okli $(1) | pad-to 64k | lzma | \
uImage lzma
- KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49
+ KERNEL := $(KERNEL_DTB_LZMA) | uImage lzma -M 0x4f4b4c49
IMAGES += factory.bin
IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | pisen_wmb001n-factory $(1)
endef
--
2.20.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list