2 # Copyright (C) 2006-2010 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
10 define Build/mkfwimage
11 $(STAGING_DIR_HOST)/bin/mkfwimage \
12 -B $(1).OpenWrt.$(REVISION) \
19 define Build/combined-image
20 -sh $(TOPDIR)/scripts/combined-image.sh \
28 $(STAGING_DIR_HOST)/bin/mkmylofw -B $(1) \
29 -p0x020000:0x130000:ah:0x80041000:linux:$(IMAGE_KERNEL) \
30 -p0x150000:0x2a0000:::rootfs:$(IMAGE_ROOTFS) \
35 define Build/gzip-kernel
36 gzip -9n -c $@ > $@.gz
37 dd if=$@.gz of=$@ bs=65536 conv=sync
40 define Build/lzma-kernel
41 $(STAGING_DIR_HOST)/bin/lzma e $@ $@.l7
42 dd if=$@.l7 of=$@ bs=65536 conv=sync
47 PROFILES = Default $$(DEVICE_NAME)
48 KERNEL := kernel-bin | lzma-kernel
49 IMAGES := sysupgrade.bin
50 FILESYSTEMS := squashfs
54 DEVICE_TITLE := Generic Images
55 IMAGES := kernel.lzma kernel.gz rootfs.bin sysupgrade.bin
56 IMAGE/kernel.gz := append-kernel | gzip-kernel
57 IMAGE/kernel.lzma := append-kernel | lzma-kernel
58 IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k
59 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | combined-image
60 IMAGE_NAME = $$(IMAGE_PREFIX)-$$(if $$(findstring kernel,$$(2)),,$$(1)-)$$(2)
62 TARGET_DEVICES += generic
64 define Device/ubnt2-pico2
65 DEVICE_TITLE := Ubiquiti XS2-8
66 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkfwimage XS2-8 -v XS2.ar2316
68 TARGET_DEVICES += ubnt2-pico2
71 DEVICE_TITLE := Ubiquiti XS2
72 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkfwimage XS2 -v XS2.ar2316
74 TARGET_DEVICES += ubnt2
77 DEVICE_TITLE := Ubiquiti XS5
78 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkfwimage XS5 -v XS5.ar2313
80 TARGET_DEVICES += ubnt5
84 KERNEL := kernel-bin | gzip-kernel
85 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkmylofw np25g
87 #TARGET_DEVICES += np25g
90 DEVICE_TITLE := wpe53g
91 KERNEL := kernel-bin | gzip-kernel
92 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to 128k | mkmylofw wpe53g
94 #TARGET_DEVICES += wpe53g
96 $(eval $(call BuildImage))