1 # SPDX-License-Identifier: GPL-2.0-only
3 # Copyright (C) 2013-2015 OpenWrt.org
5 include $(TOPDIR
)/rules.mk
6 include $(INCLUDE_DIR
)/image.mk
13 FAT32_BLOCKS
=$(shell echo
$$(($(CONFIG_TARGET_BOOTFS_PARTSIZE
)*1024*1024/$(FAT32_BLOCK_SIZE
))))
15 define Image
/BuildKernel
16 mkimage
-A arm
-O linux
-T kernel
-C none \
17 -a
0x40008000 -e
0x40008000 \
18 -n
'ARM OpenWrt Linux-$(LINUX_VERSION)' \
19 -d
$(KDIR
)/zImage
$(KDIR
)/uImage
20 cp
$(KDIR
)/uImage
$(BIN_DIR
)/$(IMG_PREFIX
)-uImage
23 define Image
/InstallKernel
24 mkdir
-p
$(TARGET_DIR
)/boot
26 $(KDIR
)/zImage
$(KDIR
)/uImage \
27 $(foreach board
,$(BOARDS
),$(DTS_DIR
)/$(board
).dtb
) \
31 define Image
/Build
/SDCard-vfat-ext4
32 rm -f
$(KDIR
)/boot.img
33 mkfs.fat
$(KDIR
)/boot.img
-C
$(FAT32_BLOCKS
)
35 mcopy
-i
$(KDIR
)/boot.img
$(DTS_DIR
)/$(3).dtb
::$(3).dtb
36 mcopy
-i
$(KDIR
)/boot.img
$(BIN_DIR
)/$(IMG_PREFIX
)-uImage
::uImage
38 .
/gen_sdcard_vfat_ext4.sh \
40 $(STAGING_DIR_IMAGE
)/$(4)-u-boot.sb \
43 $(CONFIG_TARGET_BOOTFS_PARTSIZE
) \
44 $(CONFIG_TARGET_ROOTFS_PARTSIZE
)
45 $(call Image
/Gzip
,$(BIN_DIR
)/$(2))
48 define Image
/Build
/SDCard-ext4-ext4
49 .
/gen_sdcard_ext4_ext4.sh \
51 $(STAGING_DIR_IMAGE
)/$(4)-u-boot.sb \
53 $(CONFIG_TARGET_ROOTFS_PARTSIZE
)
54 $(call Image
/Gzip
,$(BIN_DIR
)/$(2))
57 define Image
/Build
/Profile
/olinuxino-maxi
58 $(call Image
/Build
/SDCard-vfat-ext4
,$(1),$(2),imx23-olinuxino
,mx23_olinuxino
)
61 define Image
/Build
/Profile
/olinuxino-micro
62 $(call Image
/Build
/SDCard-vfat-ext4
,$(1),$(2),imx23-olinuxino
,mx23_olinuxino
)
65 define Image
/Build
/Profile
/duckbill
66 $(call Image
/Build
/SDCard-ext4-ext4
,$(1),$(2),imx28-duckbill
,duckbill
)
70 $(call Image
/Build
/$(1),$(1))
71 $(call Image
/Build
/Profile
/$(PROFILE
),$(1),$(IMG_PREFIX
)-$(PROFILE
)-sdcard.img
)
72 dd if
=$(KDIR
)/root.
$(1) of
=$(BIN_DIR
)/$(IMG_PREFIX
)-root.
$(1) bs
=128k conv
=sync
73 $(call Image
/Gzip
,$(BIN_DIR
)/$(IMG_PREFIX
)-root.
$(1))
76 $(eval
$(call BuildImage
))