04cddd8464df262b2500966007c520d351121a08
[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-cubieboard \
12 sun4i-a10-olinuxino-lime \
13 sun4i-a10-pcduino \
14 sun5i-a13-olinuxino \
15 sun7i-a20-cubieboard2 \
16 sun7i-a20-cubietruck \
17 sun7i-a20-olinuxino-micro
18
19 define Image/BuildKernel
20 mkimage -A arm -O linux -T kernel -C none \
21 -a 0x40008000 -e 0x40008000 \
22 -n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
23 -d $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
24
25 ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
26 $(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
27 echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
28 $(call Image/BuildKernel/MkuImage, \
29 none, 0x40008000, 0x40008000, \
30 $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs, \
31 $(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
32 )
33 endif
34
35 $(foreach board,$(BOARDS),
36 $(CP) $(LINUX_DIR)/arch/arm/boot/dts/$(board).dtb $(BIN_DIR)/
37 )
38 endef
39
40 define Image/Build
41 $(call Image/Build/$(1),$(1))
42 dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-root.$(1) bs=128k conv=sync
43 endef
44
45 $(eval $(call BuildImage))