2013-06-27 18:12:03 +08: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-05 06:25:26 +08:00
|
|
|
|
2013-06-27 18:12:03 +08:00
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/image.mk
|
|
|
|
|
2013-10-15 05:00:01 +08:00
|
|
|
BOARDS:= \
|
2013-10-15 05:22:40 +08:00
|
|
|
imx23-olinuxino \
|
|
|
|
imx28-duckbill
|
2013-10-15 05:00:01 +08:00
|
|
|
|
2013-07-05 06:25:26 +08:00
|
|
|
define Image/BuildKernel/olinuxino-bootlet
|
2014-07-22 02:42:06 +08:00
|
|
|
cat $(LINUX_DIR)/arch/arm/boot/zImage $(DTS_DIR)/imx23-olinuxino.dtb > $(STAGING_DIR)/zImage_dtb
|
2013-06-27 18:12:03 +08:00
|
|
|
(cd $(STAGING_DIR); \
|
2013-07-05 06:25:26 +08: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 18:12:03 +08:00
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
2013-11-20 18:23:49 +08:00
|
|
|
define Image/BuildKernel/mxs-uboot
|
2013-08-23 03:29:07 +08:00
|
|
|
mkimage -A arm -O linux -T kernel -C none \
|
2013-11-12 09:25:53 +08:00
|
|
|
-a 0x40008000 -e 0x40008000 \
|
2013-08-23 03:29:07 +08:00
|
|
|
-n 'ARM OpenWrt Linux-$(LINUX_VERSION)' \
|
2013-11-20 18:23:49 +08:00
|
|
|
-d $(KDIR)/zImage $(KDIR)/uImage
|
2013-08-23 03:29:07 +08:00
|
|
|
cp $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
|
|
|
|
endef
|
|
|
|
|
2013-07-05 06:25:26 +08:00
|
|
|
define Image/BuildKernel
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_PACKAGE_imx-bootlets),y)
|
|
|
|
$(call Image/BuildKernel/olinuxino-bootlet)
|
|
|
|
endif
|
|
|
|
|
2013-11-12 09:34:30 +08:00
|
|
|
ifeq ($(CONFIG_PACKAGE_uboot-mxs-mx23_olinuxino),y)
|
2013-11-20 18:23:49 +08:00
|
|
|
$(call Image/BuildKernel/mxs-uboot)
|
2013-08-23 03:29:07 +08:00
|
|
|
endif
|
2013-10-15 05:00:01 +08:00
|
|
|
|
|
|
|
$(CP) $(LINUX_DIR)/arch/arm/boot/zImage $(BIN_DIR)/openwrt-$(BOARD)-zImage
|
|
|
|
$(foreach board,$(BOARDS),
|
2014-07-22 02:42:06 +08:00
|
|
|
$(CP) $(DTS_DIR)/$(board).dtb $(BIN_DIR)/
|
2013-10-15 05:00:01 +08:00
|
|
|
)
|
|
|
|
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),
|
2014-07-22 02:42:06 +08:00
|
|
|
$(CP) $(DTS_DIR)/$(board).dtb $(TARGET_DIR)/boot/
|
2013-10-15 05:00:01 +08:00
|
|
|
)
|
|
|
|
endif
|
|
|
|
|
2013-07-05 06:25:26 +08: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 18:12:03 +08:00
|
|
|
$(eval $(call BuildImage))
|