2 # Copyright (C) 2013 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
10 include $(INCLUDE_DIR
)/host.mk
13 FAT32_BLOCKS
=$(shell echo
$$(($(CONFIG_MXS_SD_BOOT_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
25 ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_ZIMAGE
),)
26 mkdir
-p
$(TARGET_DIR
)/boot
27 $(CP
) $(LINUX_DIR
)/arch
/arm
/boot
/zImage
$(TARGET_DIR
)/boot
/
30 ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_UIMAGE
),)
31 mkdir
-p
$(TARGET_DIR
)/boot
32 cp
$(KDIR
)/uImage
$(TARGET_DIR
)/boot
/
35 ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_DTB
),)
36 mkdir
-p
$(TARGET_DIR
)/boot
37 $(foreach board
,$(BOARDS
),
38 $(CP
) $(DTS_DIR
)/$(board
).dtb
$(TARGET_DIR
)/boot
/
44 define Image
/Build
/SDCard
45 rm -f
$(KDIR
)/boot.img
46 mkdosfs
$(KDIR
)/boot.img
-C
$(FAT32_BLOCKS
)
48 mcopy
-i
$(KDIR
)/boot.img
$(DTS_DIR
)/$(2).dtb
::$(2).dtb
49 mcopy
-i
$(KDIR
)/boot.img
$(BIN_DIR
)/$(IMG_PREFIX
)-uImage
::uImage
51 .
/gen_mxs_sdcard_img.sh \
52 $(BIN_DIR
)/$(IMG_PREFIX
)-$(PROFILE
)-sdcard-vfat-
$(1).img \
55 $(CONFIG_MXS_SD_BOOT_PARTSIZE
) \
56 $(CONFIG_TARGET_ROOTFS_PARTSIZE
) \
57 $(BIN_DIR
)/uboot-mxs-
$(3).sb
60 define Image
/Build
/Profile
/olinuxino-maxi
61 $(call Image
/Build
/SDCard
,$(1),imx23-olinuxino
,mx23_olinuxino
)
64 define Image
/Build
/Profile
/olinuxino-micro
65 $(call Image
/Build
/SDCard
,$(1),imx23-olinuxino
,mx23_olinuxino
)
68 define Image
/Build
/Profile
/duckbill
69 $(call Image
/Build
/SDCard
,$(1),imx28-duckbill
,duckbill
)
73 $(call Image
/Build
/$(1),$(1))
74 $(call Image
/Build
/Profile
/$(PROFILE
),$(1))
77 $(eval
$(call BuildImage
))