2013-11-05 16:00:34 +08:00
|
|
|
#
|
|
|
|
# Copyright (C) 2013 OpenWrt.org
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/image.mk
|
|
|
|
|
2013-11-15 07:12:52 +08:00
|
|
|
BOARDS:= \
|
|
|
|
sun4i-a10-cubieboard \
|
2014-01-12 01:19:04 +08:00
|
|
|
sun4i-a10-olinuxino-lime \
|
2014-01-13 03:23:29 +08:00
|
|
|
sun4i-a10-pcduino \
|
2013-11-15 07:12:52 +08:00
|
|
|
sun5i-a13-olinuxino \
|
2014-02-06 05:11:59 +08:00
|
|
|
sun6i-a31-colombus \
|
2014-06-02 02:44:10 +08:00
|
|
|
sun7i-a20-bananapi \
|
2014-01-13 03:23:29 +08:00
|
|
|
sun7i-a20-cubieboard2 \
|
|
|
|
sun7i-a20-cubietruck \
|
2014-05-01 03:50:15 +08:00
|
|
|
sun7i-a20-olinuxino-micro \
|
|
|
|
sun7i-a20-pcduino3
|
2013-11-05 16:00:34 +08:00
|
|
|
|
2013-11-15 07:12:52 +08:00
|
|
|
define Image/BuildKernel
|
|
|
|
mkimage -A arm -O linux -T kernel -C none \
|
|
|
|
-a 0x40008000 -e 0x40008000 \
|
|
|
|
-n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
|
|
|
|
-d $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
|
|
|
|
|
|
|
|
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
2013-11-05 16:00:34 +08:00
|
|
|
$(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
|
|
|
|
echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
|
|
|
|
$(call Image/BuildKernel/MkuImage, \
|
|
|
|
none, 0x40008000, 0x40008000, \
|
|
|
|
$(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs, \
|
|
|
|
$(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
|
|
|
|
)
|
2013-11-15 07:12:52 +08:00
|
|
|
endif
|
2013-11-05 16:00:34 +08:00
|
|
|
|
2013-11-15 07:12:52 +08:00
|
|
|
$(foreach board,$(BOARDS),
|
|
|
|
$(CP) $(LINUX_DIR)/arch/arm/boot/dts/$(board).dtb $(BIN_DIR)/
|
2013-11-05 16:00:34 +08:00
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Build
|
2013-11-15 07:12:52 +08:00
|
|
|
$(call Image/Build/$(1),$(1))
|
2014-01-14 00:18:02 +08:00
|
|
|
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-root.$(1) bs=128k conv=sync
|
2013-11-05 16:00:34 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildImage))
|