2013-06-27 10:12:03 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2013 OpenWrt.org
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
2013-07-04 22:25:26 +00:00
|
|
|
|
2013-06-27 10:12:03 +00:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/image.mk
|
|
|
|
|
2013-10-14 21:00:01 +00:00
|
|
|
BOARDS:= \
|
2013-10-14 21:22:40 +00:00
|
|
|
imx23-olinuxino \
|
|
|
|
imx28-duckbill
|
2013-10-14 21:00:01 +00:00
|
|
|
|
2013-07-04 22:25:26 +00:00
|
|
|
define Image/BuildKernel/olinuxino-bootlet
|
2013-06-27 10:12:03 +00:00
|
|
|
cat $(LINUX_DIR)/arch/arm/boot/zImage $(LINUX_DIR)/arch/arm/boot/dts/imx23-olinuxino.dtb > $(STAGING_DIR)/zImage_dtb
|
|
|
|
(cd $(STAGING_DIR); \
|
2013-07-04 22:25:26 +00:00
|
|
|
$(STAGING_DIR)/../host/bin/elftosb -z -c ./linux_prebuilt.db -o linux.sb; \
|
|
|
|
dd if=/dev/zero of=sd_mmc_bootstream.raw bs=512 count=4; \
|
|
|
|
dd if=linux.sb of=$(BIN_DIR)/openwrt-imx23-sbImage ibs=512 seek=4; \
|
2013-06-27 10:12:03 +00:00
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
2013-08-22 19:29:07 +00:00
|
|
|
define Image/BuildKernel/olinuxino-uboot
|
|
|
|
mkimage -A arm -O linux -T kernel -C none \
|
2013-11-12 01:25:53 +00:00
|
|
|
-a 0x40008000 -e 0x40008000 \
|
2013-08-22 19:29:07 +00:00
|
|
|
-n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
|
|
|
|
-d $(KDIR)/vmlinux $(KDIR)/uImage
|
|
|
|
cp $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
|
|
|
|
endef
|
|
|
|
|
2013-07-04 22:25:26 +00:00
|
|
|
define Image/BuildKernel
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_PACKAGE_imx-bootlets),y)
|
|
|
|
$(call Image/BuildKernel/olinuxino-bootlet)
|
|
|
|
endif
|
|
|
|
|
2013-08-22 19:29:07 +00:00
|
|
|
ifeq ($(CONFIG_PACKAGE_uboot-imx23-mx23_olinuxino),y)
|
|
|
|
$(call Image/BuildKernel/olinuxino-uboot)
|
|
|
|
endif
|
2013-10-14 21:00:01 +00:00
|
|
|
|
|
|
|
$(CP) $(LINUX_DIR)/arch/arm/boot/zImage $(BIN_DIR)/openwrt-$(BOARD)-zImage
|
|
|
|
$(foreach board,$(BOARDS),
|
|
|
|
$(CP) $(LINUX_DIR)/arch/arm/boot/dts/$(board).dtb $(BIN_DIR)/
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/InstallKernel
|
|
|
|
|
|
|
|
ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_KERNEL),)
|
|
|
|
mkdir -p $(TARGET_DIR)/boot
|
|
|
|
$(CP) $(LINUX_DIR)/arch/arm/boot/zImage $(TARGET_DIR)/boot/
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_DTB),)
|
|
|
|
mkdir -p $(TARGET_DIR)/boot
|
|
|
|
$(foreach board,$(BOARDS),
|
|
|
|
$(CP) $(LINUX_DIR)/arch/arm/boot/dts/$(board).dtb $(TARGET_DIR)/boot/
|
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2013-07-04 22:25:26 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Build
|
|
|
|
$(call Image/Build/$(1))
|
|
|
|
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
|
|
|
|
endef
|
|
|
|
|
2013-06-27 10:12:03 +00:00
|
|
|
$(eval $(call BuildImage))
|