Files
openwrt/target/linux/imx/image/common.mk
T
Mario Andrés Pérez 0d21956ecd imx: cortexa9: ventana, fix profiles names in profiles.json
These two image profiles overwrite DEVICE_NAME making the two image
profiles appear with the same name "ventana" in the "profiles.json"
mixing ramdomly the two profiles.

Use BOARD_NAME instead to keep the two profiles names unique (orginal
DEVICE_NAME) hence generating a coherent "profiles.json".

Since there are image recipes hardconding DEVICE_NAME, change them to use
BOARD_NAME if defined, in order to preserve the previous names used in
those recipes.

Fixes: cbc8bcfbaa ("imx6: image: use vendor_model scheme")

Reported-by: Eric Fahlgren <ericfahlgren@gmail.com>
Signed-off-by: Mario Andrés Pérez <mapb_@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/22994
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-04-23 01:13:36 +02:00

62 lines
1.4 KiB
Makefile

define Build/imx-combined-image-prepare
rm -rf $@.boot
mkdir -p $@.boot
endef
define Build/imx-combined-image-clean
rm -rf $@.boot $@.fs
endef
define Build/imx-combined-image
$(CP) $(IMAGE_KERNEL) $@.boot/uImage
$(foreach dts,$(DEVICE_DTS), \
$(CP) \
$(DTS_DIR)/$(dts).dtb \
$@.boot/;
)
mkimage -A arm -O linux -T script -C none -a 0 -e 0 \
-n '$(DEVICE_ID) OpenWrt bootscript' \
-d bootscript-$(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \
$@.boot/boot.scr
cp $@ $@.fs
$(SCRIPT_DIR)/gen_image_generic.sh $@ \
$(CONFIG_TARGET_KERNEL_PARTSIZE) \
$@.boot \
$(CONFIG_TARGET_ROOTFS_PARTSIZE) \
$@.fs \
1024
endef
define Build/imx-sdcard
$(Build/imx-combined-image-prepare)
if [ -f $(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.img ]; then \
$(CP) $(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.img \
$@.boot/u-boot.img; \
fi
if [ -f $(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot-dtb.img ]; then \
$(CP) $(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot-dtb.img \
$@.boot/u-boot-dtb.img; \
fi
$(Build/imx-combined-image)
dd if=$(STAGING_DIR_IMAGE)/$(UBOOT)-SPL of=$@ bs=1024 seek=1 conv=notrunc
$(Build/imx-combined-image-clean)
endef
define Build/imx-sdcard-raw-uboot
$(Build/imx-combined-image-prepare)
$(Build/imx-combined-image)
dd if=$(STAGING_DIR_IMAGE)/$(UBOOT)-SPL of=$@ bs=1024 seek=1 conv=notrunc
dd if=$(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot-dtb.img of=$@ bs=1024 seek=69 conv=notrunc
$(Build/imx-combined-image-clean)
endef