2010-07-21 19:20:53 +08:00
|
|
|
#
|
|
|
|
# Copyright (C) 2010 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
|
|
|
|
|
2012-09-20 07:50:09 +08:00
|
|
|
define mkimage
|
|
|
|
mkimage -A arm -O linux -T kernel -C none -a $(2) -e $(2) -n 'OpenWrt Linux-$(LINUX_VERSION)' -d $(LINUX_DIR)/arch/arm/boot/zImage $(KDIR)/uImage-$(1)
|
|
|
|
endef
|
|
|
|
|
2010-07-21 19:20:53 +08:00
|
|
|
define Image/Prepare
|
2012-09-20 07:50:09 +08:00
|
|
|
$(call mkimage,old,0x00008000)
|
|
|
|
$(call mkimage,new,0x20008000)
|
2010-07-21 19:20:53 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/BuildKernel
|
2012-09-20 07:50:09 +08:00
|
|
|
cp $(KDIR)/uImage-old $(BIN_DIR)/openwrt-$(BOARD)-old-uboot-uImage
|
|
|
|
cp $(KDIR)/uImage-new $(BIN_DIR)/openwrt-$(BOARD)-uImage
|
2010-07-21 19:20:53 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Build
|
|
|
|
$(call Image/Build/$(1),$(1))
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Build/jffs2-64k
|
|
|
|
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-$(1).img bs=65536 conv=sync
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Build/jffs2-128k
|
|
|
|
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-$(1).img bs=131072 conv=sync
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Build/squashfs
|
|
|
|
$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
|
|
|
|
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-$(1).img bs=131072 conv=sync
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildImage))
|