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
))))
14 define Image
/BuildKernel
15 mkimage
-A arm
-O linux
-T kernel
-C none \
16 -a
0x40008000 -e
0x40008000 \
17 -n
'ARM OpenWrt Linux-$(LINUX_VERSION)' \
18 -d
$(KDIR
)/zImage
$(BIN_DIR
)/$(IMG_PREFIX
)-uImage
20 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS
),)
21 $(CP
) $(KDIR
)/zImage-initramfs
$(BIN_DIR
)/$(IMG_PREFIX
)-zImage-initramfs
22 echo
-ne
'\x00\x00\x00\x00' >> $(BIN_DIR
)/$(IMG_PREFIX
)-zImage-initramfs
23 $(call Image
/BuildKernel
/MkuImage
, \
24 none
, 0x40008000, 0x40008000, \
25 $(BIN_DIR
)/$(IMG_PREFIX
)-zImage-initramfs
, \
26 $(BIN_DIR
)/$(IMG_PREFIX
)-uImage-initramfs \
31 define Image
/Build
/SDCard
32 rm -f
$(KDIR
)/boot.img
33 mkdosfs
$(KDIR
)/boot.img
-C
$(FAT32_BLOCKS
)
35 mcopy
-i
$(KDIR
)/boot.img
$(BIN_DIR
)/uboot-sunxi-
$(PROFILE
)/$(IMG_PREFIX
)-$(PROFILE
)-boot.scr
::boot.scr
36 mcopy
-i
$(KDIR
)/boot.img
$(DTS_DIR
)/$(2).dtb
::dtb
37 mcopy
-i
$(KDIR
)/boot.img
$(BIN_DIR
)/$(IMG_PREFIX
)-uImage
::uImage
39 .
/gen_sunxi_sdcard_img.sh \
40 $(BIN_DIR
)/$(IMG_PREFIX
)-$(PROFILE
)-sdcard-vfat-
$(1).img \
43 $(CONFIG_SUNXI_SD_BOOT_PARTSIZE
) \
44 $(CONFIG_TARGET_ROOTFS_PARTSIZE
) \
45 $(BIN_DIR
)/uboot-sunxi-
$(PROFILE
)/$(IMG_PREFIX
)-$(PROFILE
)-u-boot-with-spl.bin
48 define Image
/Build
/Profile
/A10-OLinuXino-Lime
49 $(call Image
/Build
/SDCard
,$(1),sun4i-a10-olinuxino-lime
)
52 define Image
/Build
/Profile
/A13-OLinuXino
53 $(call Image
/Build
/SDCard
,$(1),sun5i-a13-olinuxino
)
56 define Image
/Build
/Profile
/A20-OLinuXino-Lime
57 $(call Image
/Build
/SDCard
,$(1),sun7i-a20-olinuxino-lime
)
60 define Image
/Build
/Profile
/A20-OLinuXino_MICRO
61 $(call Image
/Build
/SDCard
,$(1),sun7i-a20-olinuxino-micro
)
64 define Image
/Build
/Profile
/Bananapi
65 $(call Image
/Build
/SDCard
,$(1),sun7i-a20-bananapi
)
68 define Image
/Build
/Profile
/Bananapro
69 $(call Image
/Build
/SDCard
,$(1),sun7i-a20-bananapro
)
72 define Image
/Build
/Profile
/Lamobo_R1
73 $(call Image
/Build
/SDCard
,$(1),sun7i-a20-lamobo-r1
)
76 define Image
/Build
/Profile
/Cubieboard
77 $(call Image
/Build
/SDCard
,$(1),sun4i-a10-cubieboard
)
80 define Image
/Build
/Profile
/Cubieboard2
81 $(call Image
/Build
/SDCard
,$(1),sun7i-a20-cubieboard2
)
84 define Image
/Build
/Profile
/Cubietruck
85 $(call Image
/Build
/SDCard
,$(1),sun7i-a20-cubietruck
)
88 define Image
/Build
/Profile
/OLIMEX_A13_SOM
89 $(call Image
/Build
/SDCard
,$(1),sun5i-a13-olinuxino
)
92 define Image
/Build
/Profile
/Mele_M9
93 $(call Image
/Build
/SDCard
,$(1),sun6i-a31-hummingbird
)
96 define Image
/Build
/Profile
/Linksprite_pcDuino
97 $(call Image
/Build
/SDCard
,$(1),sun4i-a10-pcduino
)
100 define Image
/Build
/Profile
/Linksprite_pcDuino3
101 $(call Image
/Build
/SDCard
,$(1),sun7i-a20-pcduino3
)
105 $(call Image
/Build
/$(1),$(1))
106 $(call Image
/Build
/Profile
/$(PROFILE
),$(1))
108 dd if
=$(KDIR
)/root.
$(1) of
=$(BIN_DIR
)/$(IMG_PREFIX
)-root.
$(1) bs
=128k conv
=sync
111 $(eval
$(call BuildImage
))