aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorINAGAKI Hiroshi <musashino.open@gmail.com>2022-08-01 13:40:10 +0900
committerHauke Mehrtens <hauke@hauke-m.de>2022-10-19 22:58:12 +0200
commit2e1ffc341276ed31e69af14a3d7f5c6d8e5f069c (patch)
tree2d39b27a4ced38fb0f0697ebfb402af38f46e6e9
parent00ddd29b650b45cd89f6423dca3eafcc134b7319 (diff)
downloadupstream-2e1ffc341276ed31e69af14a3d7f5c6d8e5f069c.tar.gz
upstream-2e1ffc341276ed31e69af14a3d7f5c6d8e5f069c.tar.bz2
upstream-2e1ffc341276ed31e69af14a3d7f5c6d8e5f069c.zip
ath79: use ARTIFACTS for initramfs-factory of ELECOM devices
Use ARTIFACTS to generate factory image of the following ELECOM devices instead of redundant recipe which generate on KERNEL_INITRAMFS. - ELECOM WRC-300GHBK2-I - ELECOM WRC-1750GHBK2-I/C Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
-rw-r--r--target/linux/ath79/image/generic.mk34
1 files changed, 12 insertions, 22 deletions
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 9d8b70712d..7b760abc3e 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -11,24 +11,6 @@ DEVICE_VARS += KERNEL_INITRAMFS_PREFIX DAP_SIGNATURE
DEVICE_VARS += EDIMAX_HEADER_MAGIC EDIMAX_HEADER_MODEL
DEVICE_VARS += OPENMESH_CE_TYPE ZYXEL_MODEL_STRING
-define Build/add-elecom-factory-initramfs
- $(eval edimax_model=$(word 1,$(1)))
- $(eval product=$(word 2,$(1)))
-
- $(STAGING_DIR_HOST)/bin/mkedimaximg \
- -b -s CSYS -m $(edimax_model) \
- -f 0x70000 -S 0x01100000 \
- -i $@ -o $@.factory
-
- $(call Build/elecom-product-header,$(product) $@.factory)
-
- if [ "$$(stat -c%s $@.factory)" -le $$(($(subst k,* 1024,$(subst m, * 1024k,$(IMAGE_SIZE))))) ]; then \
- mv $@.factory $(BIN_DIR)/$(KERNEL_INITRAMFS_PREFIX)-factory.bin; \
- else \
- echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \
- fi
-endef
-
define Build/addpattern
-$(STAGING_DIR_HOST)/bin/addpattern -B $(ADDPATTERN_ID) \
-v v$(ADDPATTERN_VERSION) -i $@ -o $@.new
@@ -1106,8 +1088,12 @@ define Device/elecom_wrc-1750ghbk2-i
DEVICE_VENDOR := ELECOM
DEVICE_MODEL := WRC-1750GHBK2-I/C
IMAGE_SIZE := 15808k
- KERNEL_INITRAMFS := $$(KERNEL) | pad-to 2 | \
- add-elecom-factory-initramfs RN68 WRC-1750GHBK2
+ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
+ ARTIFACTS := initramfs-factory.bin
+ ARTIFACT/initramfs-factory.bin := append-image initramfs-kernel.bin | \
+ pad-to 2 | edimax-header -b -s CSYS -m RN68 -f 0x70000 -S 0x01100000 | \
+ elecom-product-header WRC-1750GHBK2 | check-size
+endif
DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
endef
TARGET_DEVICES += elecom_wrc-1750ghbk2-i
@@ -1117,8 +1103,12 @@ define Device/elecom_wrc-300ghbk2-i
DEVICE_VENDOR := ELECOM
DEVICE_MODEL := WRC-300GHBK2-I
IMAGE_SIZE := 7616k
- KERNEL_INITRAMFS := $$(KERNEL) | pad-to 2 | \
- add-elecom-factory-initramfs RN51 WRC-300GHBK2-I
+ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
+ ARTIFACTS := initramfs-factory.bin
+ ARTIFACT/initramfs-factory.bin := append-image initramfs-kernel.bin | \
+ pad-to 2 | edimax-header -b -s CSYS -m RN51 -f 0x70000 -S 0x01100000 | \
+ elecom-product-header WRC-300GHBK2-I | check-size
+endif
endef
TARGET_DEVICES += elecom_wrc-300ghbk2-i