271d5ea1988938cf7e22bcda8071d0d5e08fc331
[openwrt.git] / target / linux / cns3xxx / image / Makefile
1
2 # Copyright (C) 2010 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 define mkimage
11         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)
12 endef
13
14 define Image/Prepare
15         $(call mkimage,old,0x00008000)
16         $(call mkimage,new,0x20008000)
17 endef
18
19 define Image/BuildKernel
20         cp $(KDIR)/uImage-old $(BIN_DIR)/openwrt-$(BOARD)-old-uboot-uImage
21         cp $(KDIR)/uImage-new $(BIN_DIR)/openwrt-$(BOARD)-uImage
22 endef
23
24 define Image/Build
25         $(call Image/Build/$(1),$(1))
26 endef
27
28 define Image/Build/jffs2-64k
29         dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-$(1).img bs=65536 conv=sync
30 endef
31
32 define Image/Build/jffs2-128k
33         dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-$(1).img bs=131072 conv=sync
34 endef
35
36 define Image/Build/squashfs
37         $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
38         dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-$(1).img bs=131072 conv=sync
39 endef
40
41 $(eval $(call BuildImage))