94d38e8d69176108fa1af22093c3f083e4431687
[openwrt/staging/wigyori.git] / target / linux / ath25 / image / Makefile
1 #
2 # Copyright (C) 2006-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 DEVICE_VARS += KERNEL_PREFIX FILESYSTEMS
11
12 define Image/BuildKernel
13 cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf
14 gzip -9n -c $(KDIR)/vmlinux > $(KDIR)/vmlinux.bin.gz
15 $(STAGING_DIR_HOST)/bin/lzma e $(KDIR)/vmlinux $(KDIR)/vmlinux.bin.lzma
16 dd if=$(KDIR)/vmlinux.bin.gz of=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux.gz bs=65536 conv=sync
17 dd if=$(KDIR)/vmlinux.bin.lzma of=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux.lzma bs=65536 conv=sync
18 endef
19
20 define Image/Build/squashfs
21 $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
22 endef
23
24 define Image/Build
25 $(call Image/Build/$(1))
26 dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
27 endef
28
29 define Device/Default
30 PROFILES = Default $$(DEVICE_NAME)
31 KERNEL := lzma-kernel
32 IMAGES := sysupgrade.bin
33 FILESYSTEMS := squashfs
34 endef
35
36 define Build/mkfwimage
37 $(STAGING_DIR_HOST)/bin/mkfwimage \
38 -B $(1).OpenWrt.$(REVISION) \
39 -k $(KDIR)/$(KERNEL_IMAGE) \
40 -r $@ \
41 -o $@.new && \
42 mv $@.new $@
43 endef
44
45 define Build/combined-image
46 -sh $(TOPDIR)/scripts/combined-image.sh \
47 "$(KDIR)/$(KERNEL_IMAGE)" \
48 "$@" \
49 "$@.new" && \
50 mv $@.new $@
51 endef
52
53 define Build/mkmylofw
54 $(STAGING_DIR_HOST)/bin/mkmylofw -B $(1) \
55 -p0x020000:0x130000:ah:0x80041000:linux:$(KDIR)/$(KERNEL_IMAGE) \
56 -p0x150000:0x2a0000:::rootfs:$@ \
57 $@.new && \
58 mv $@.new $@
59 endef
60
61 define Build/gzip-kernel
62 gzip -9n -c $(KDIR)/vmlinux > $@
63 dd if=$@ of=$@.new bs=65536 conv=sync
64 mv $@.new $@
65 endef
66
67 define Build/lzma-kernel
68 $(STAGING_DIR_HOST)/bin/lzma e $(KDIR)/vmlinux $@.l7
69 dd if=$@.l7 of=$@ bs=65536 conv=sync
70 endef
71
72 define Device/combined
73 DEVICE_TITLE := Combined Image
74 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | combined-image
75 endef
76 TARGET_DEVICES += combined
77
78 define Device/ubnt2-pico2
79 DEVICE_TITLE := Ubiquiti XS2-8
80 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkfwimage XS2-8 -v XS2.ar2316
81 endef
82 TARGET_DEVICES += ubnt2-pico2
83
84 define Device/ubnt2
85 DEVICE_TITLE := Ubiquiti XS2
86 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkfwimage XS2 -v XS2.ar2316
87 endef
88 TARGET_DEVICES += ubnt2
89
90 define Device/ubnt5
91 DEVICE_TITLE := Ubiquiti XS5
92 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkfwimage XS5 -v XS5.ar2313
93 endef
94 TARGET_DEVICES += ubnt5
95
96 define Device/np25g
97 DEVICE_TITLE := np25g
98 KERNEL := gzip-kernel
99 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkmylofw np25g
100 endef
101 #TARGET_DEVICES += np25g
102
103 define Device/wpe53g
104 DEVICE_TITLE := wpe53g
105 KERNEL := gzip-kernel
106 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkmylofw wpe53g
107 endef
108 #TARGET_DEVICES += wpe53g
109
110 $(eval $(call BuildImage))