Files
openwrt-mirror/target/linux/ath79/image/common-nec.mk
Eric Fahlgren f6e0f57be0 targetwide: imagebuilder: add explicit guards around initramfs rules
The imagebuilder is not intended to build initramfs images.  Some
profiles attempt to do this and succeed, due to buildroot leaking
the initramfs-kernel into staging_dir; others attempt it, but fail
due to not having initramfs binaries present in the imagebuilder.

Fix this by adding an explict guard around the unsupported generation
of the initramfs images.  This saves space and time during imagebuilder
runs, fixes those that are currently broken and protects against future
breakage for profiles that inadvertently work now.

Fixes: https://github.com/openwrt/openwrt/issues/20151
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20347
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-10-17 10:51:37 +02:00

29 lines
976 B
Makefile

DEVICE_VARS += NEC_FW_TYPE
define Build/nec-usbaterm-fw
$(STAGING_DIR_HOST)/bin/nec-usbatermfw $@.new -t $(NEC_FW_TYPE) $(1)
mv $@.new $@
endef
define Device/nec-netbsd-aterm
DEVICE_VENDOR := NEC
LOADER_TYPE := bin
LZMA_TEXT_START := 0x82800000
KERNEL := kernel-bin | append-dtb | lzma | loader-kernel | uImage none
KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | loader-kernel | uImage none
ARTIFACTS := uboot.bin
ifeq ($(IB),)
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
COMPILE := loader-$(1).bin
COMPILE/loader-$(1).bin := loader-okli-compile
ARTIFACTS += initramfs-factory.bin
ARTIFACT/initramfs-factory.bin := append-image-stage initramfs-kernel.bin | \
pad-to 4 skip=16 | \
nec-usbaterm-fw -f 0x0003 -d $$(KDIR)/loader-$(1).bin -d $$$$@ | check-size
endif
endif
UBOOT_PATH := $$(STAGING_DIR_IMAGE)/$$(SOC)_nec_aterm-u-boot.bin
ARTIFACT/uboot.bin := append-uboot | check-size 128k
DEVICE_PACKAGES := kmod-usb2 -uboot-envtools
endef