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.
7 include $(TOPDIR
)/rules.mk
8 include $(INCLUDE_DIR
)/image.mk
9 include $(INCLUDE_DIR
)/host.mk
12 FAT32_BLOCKS
=$(shell echo
$$(($(CONFIG_SUNXI_SD_BOOT_PARTSIZE
)*1024*1024/$(FAT32_BLOCK_SIZE
))))
15 sun4i-a10-cubieboard \
16 sun4i-a10-olinuxino-lime \
23 sun7i-a20-cubieboard2 \
24 sun7i-a20-cubietruck \
25 sun7i-a20-olinuxino-lime \
26 sun7i-a20-olinuxino-micro \
29 define Image
/BuildKernel
30 mkimage
-A arm
-O linux
-T kernel
-C none \
31 -a
0x40008000 -e
0x40008000 \
32 -n
'ARM OpenWrt Linux-$(LINUX_VERSION)' \
33 -d
$(KDIR
)/zImage
$(BIN_DIR
)/$(IMG_PREFIX
)-uImage
35 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS
),)
36 $(CP
) $(KDIR
)/zImage-initramfs
$(BIN_DIR
)/$(IMG_PREFIX
)-zImage-initramfs
37 echo
-ne
'\x00\x00\x00\x00' >> $(BIN_DIR
)/$(IMG_PREFIX
)-zImage-initramfs
38 $(call Image
/BuildKernel
/MkuImage
, \
39 none
, 0x40008000, 0x40008000, \
40 $(BIN_DIR
)/$(IMG_PREFIX
)-zImage-initramfs
, \
41 $(BIN_DIR
)/$(IMG_PREFIX
)-uImage-initramfs \
45 $(foreach board
,$(BOARDS
),
46 $(CP
) $(DTS_DIR
)/$(board
).dtb
$(BIN_DIR
)/
50 define Image
/Build
/SDCard
51 rm -f
$(KDIR
)/boot.img
52 mkdosfs
$(KDIR
)/boot.img
-C
$(FAT32_BLOCKS
)
54 mcopy
-i
$(KDIR
)/boot.img
$(BIN_DIR
)/uboot-sunxi-
$(PROFILE
)/openwrt-sunxi-
$(PROFILE
)-boot.scr
::boot.scr
55 mcopy
-i
$(KDIR
)/boot.img
$(BIN_DIR
)/$(2).dtb
::dtb
56 mcopy
-i
$(KDIR
)/boot.img
$(BIN_DIR
)/$(IMG_PREFIX
)-uImage
::uImage
58 .
/gen_sunxi_sdcard_img.sh \
59 $(BIN_DIR
)/$(IMG_PREFIX
)-$(PROFILE
)-sdcard-vfat-
$(1).img \
62 $(CONFIG_SUNXI_SD_BOOT_PARTSIZE
) \
63 $(CONFIG_TARGET_ROOTFS_PARTSIZE
) \
64 $(BIN_DIR
)/uboot-sunxi-
$(PROFILE
)/openwrt-sunxi-
$(PROFILE
)-u-boot-with-spl.bin
67 define Image
/Build
/Profile
/A10-OLinuXino-Lime
68 $(call Image
/Build
/SDCard
,$(1),sun4i-a10-olinuxino-lime
)
71 define Image
/Build
/Profile
/A13-OLinuXino
72 $(call Image
/Build
/SDCard
,$(1),sun5i-a13-olinuxino
)
75 define Image
/Build
/Profile
/A20-OLinuXino_Lime
76 $(call Image
/Build
/SDCard
,$(1),sun7i-a20-olinuxino-lime
)
79 define Image
/Build
/Profile
/A20-OLinuXino_MICRO
80 $(call Image
/Build
/SDCard
,$(1),sun7i-a20-olinuxino-micro
)
83 define Image
/Build
/Profile
/Bananapi
84 $(call Image
/Build
/SDCard
,$(1),sun7i-a20-bananapi
)
87 define Image
/Build
/Profile
/Bananapro
88 $(call Image
/Build
/SDCard
,$(1),sun7i-a20-bananapro
)
91 define Image
/Build
/Profile
/Cubieboard
92 $(call Image
/Build
/SDCard
,$(1),sun4i-a10-cubieboard
)
95 define Image
/Build
/Profile
/Cubieboard2
96 $(call Image
/Build
/SDCard
,$(1),sun7i-a20-cubieboard2
)
99 define Image
/Build
/Profile
/Cubietruck
100 $(call Image
/Build
/SDCard
,$(1),sun7i-a20-cubietruck
)
103 define Image
/Build
/Profile
/OLIMEX-A13-SOM
104 $(call Image
/Build
/SDCard
,$(1),sun5i-a13-olinuxino
)
107 define Image
/Build
/Profile
/Mele_M9
108 $(call Image
/Build
/SDCard
,$(1),sun6i-a31-hummingbird
)
111 define Image
/Build
/Profile
/Linksprite_pcDuino
112 $(call Image
/Build
/SDCard
,$(1),sun4i-a10-pcduino
)
115 define Image
/Build
/Profile
/Linksprite_pcDuino3
116 $(call Image
/Build
/SDCard
,$(1),sun7i-a20-pcduino3
)
120 $(call Image
/Build
/$(1),$(1))
121 $(call Image
/Build
/Profile
/$(PROFILE
),$(1))
123 dd if
=$(KDIR
)/root.
$(1) of
=$(BIN_DIR
)/openwrt-
$(BOARD
)-root.
$(1) bs
=128k conv
=sync
126 $(eval
$(call BuildImage
))