d77aff059b77ef00acbff7844b438846c7399d21
[openwrt/openwrt.git] / target / linux / sunxi / image / Makefile
1 #
2 # Copyright (C) 2013 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
9
10 BOARDS:= \
11 sun4i-a10-pcduino \
12 sun4i-a10-cubieboard \
13 sun5i-a13-olinuxino \
14 sun7i-a20-olinuxino-micro \
15 sun7i-a20-cubieboard2
16
17 define Image/BuildKernel
18 mkimage -A arm -O linux -T kernel -C none \
19 -a 0x40008000 -e 0x40008000 \
20 -n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
21 -d $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
22
23 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
24 $(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
25 echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
26 $(call Image/BuildKernel/MkuImage, \
27 none, 0x40008000, 0x40008000, \
28 $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs, \
29 $(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
30 )
31 endif
32
33 $(foreach board,$(BOARDS),
34 $(CP) $(LINUX_DIR)/arch/arm/boot/dts/$(board).dtb $(BIN_DIR)/
35 )
36 endef
37
38 define Image/Build
39 $(call Image/Build/$(1),$(1))
40 endef
41
42 $(eval $(call BuildImage))