2 # Copyright (C) 2013-2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
9 include $(INCLUDE_DIR
)/image.mk
16 FAT32_BLOCKS
=$(shell echo
$$(($(CONFIG_TARGET_BOOTFS_PARTSIZE
)*1024*1024/$(FAT32_BLOCK_SIZE
))))
18 define Image
/BuildKernel
19 mkimage
-A arm
-O linux
-T kernel
-C none \
20 -a
0x40008000 -e
0x40008000 \
21 -n
'ARM OpenWrt Linux-$(LINUX_VERSION)' \
22 -d
$(KDIR
)/zImage
$(KDIR
)/uImage
23 cp
$(KDIR
)/uImage
$(BIN_DIR
)/$(IMG_PREFIX
)-uImage
26 define Image
/InstallKernel
28 ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_ZIMAGE
),)
29 mkdir
-p
$(TARGET_DIR
)/boot
30 cp
$(KDIR
)/zImage
$(TARGET_DIR
)/boot
/
33 ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_UIMAGE
),)
34 mkdir
-p
$(TARGET_DIR
)/boot
35 cp
$(KDIR
)/uImage
$(TARGET_DIR
)/boot
/
38 ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_DTB
),)
39 mkdir
-p
$(TARGET_DIR
)/boot
40 $(foreach board
,$(BOARDS
),
41 $(CP
) $(DTS_DIR
)/$(board
).dtb
$(TARGET_DIR
)/boot
/
47 define Image
/Build
/SDCard-vfat-ext4
48 rm -f
$(KDIR
)/boot.img
49 mkdosfs
$(KDIR
)/boot.img
-C
$(FAT32_BLOCKS
)
51 mcopy
-i
$(KDIR
)/boot.img
$(DTS_DIR
)/$(3).dtb
::$(3).dtb
52 mcopy
-i
$(KDIR
)/boot.img
$(BIN_DIR
)/$(IMG_PREFIX
)-uImage
::uImage
54 .
/gen_sdcard_vfat_ext4.sh \
56 $(BIN_DIR
)/uboot-mxs-
$(4)/uboot-mxs-
$(4).sb \
59 $(CONFIG_TARGET_BOOTFS_PARTSIZE
) \
60 $(CONFIG_TARGET_ROOTFS_PARTSIZE
)
63 define Image
/Build
/SDCard-ext4-ext4
64 .
/gen_sdcard_ext4_ext4.sh \
66 $(BIN_DIR
)/uboot-mxs-
$(4)/uboot-mxs-
$(4).sb \
68 $(CONFIG_TARGET_ROOTFS_PARTSIZE
)
71 define Image
/Build
/Profile
/olinuxino-maxi
72 $(call Image
/Build
/SDCard-vfat-ext4
,$(1),$(2),imx23-olinuxino
,mx23_olinuxino
)
75 define Image
/Build
/Profile
/olinuxino-micro
76 $(call Image
/Build
/SDCard-vfat-ext4
,$(1),$(2),imx23-olinuxino
,mx23_olinuxino
)
79 define Image
/Build
/Profile
/duckbill
80 $(call Image
/Build
/SDCard-ext4-ext4
,$(1),$(2),imx28-duckbill
,duckbill
)
84 $(call Image
/Build
/$(1),$(1))
85 $(call Image
/Build
/Profile
/$(PROFILE
),$(1),$(IMG_PREFIX
)-$(PROFILE
)-sdcard.img
)
86 dd if
=$(KDIR
)/root.
$(1) of
=$(BIN_DIR
)/$(IMG_PREFIX
)-root.
$(1) bs
=128k conv
=sync
89 $(eval
$(call BuildImage
))