image: add KERNEL_SIZE to the default device vars
[librecmc/librecmc.git] / target / linux / ramips / image / rt3883.mk
1 #
2 # RT3662/RT3883 Profiles
3 #
4
5 define Device/cy-swr1100
6   DTS := CY-SWR1100
7   BLOCKSIZE := 64k
8   KERNEL := $(KERNEL_DTB)
9   IMAGES += factory.bin
10   IMAGE/sysupgrade.bin := \
11         append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
12         seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
13         pad-rootfs | check-size $$$$(IMAGE_SIZE)
14   IMAGE/factory.bin := \
15         append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
16         append-rootfs | pad-rootfs -x 64 | \
17         seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
18         seama-seal -m "signature=wrgnd10_samsung_ss815" | \
19         check-size $$$$(IMAGE_SIZE)
20   DEVICE_TITLE := Samsung CY-SWR1100
21   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig
22 endef
23 TARGET_DEVICES += cy-swr1100
24
25
26 define Device/dir-645
27   DTS := DIR-645
28   BLOCKSIZE := 4k
29   KERNEL := $(KERNEL_DTB)
30   IMAGES += factory.bin
31   IMAGE/sysupgrade.bin := \
32         append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs | \
33         seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
34         pad-rootfs | check-size $$$$(IMAGE_SIZE)
35   IMAGE/factory.bin := \
36         append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | \
37         append-rootfs | pad-rootfs -x 64 | \
38         seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
39         seama-seal -m "signature=wrgn39_dlob.hans_dir645" | \
40         check-size $$$$(IMAGE_SIZE)
41   DEVICE_TITLE := D-Link DIR-645
42   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig
43 endef
44 TARGET_DEVICES += dir-645
45
46
47 define Device/hpm
48   DTS := HPM
49   BLOCKSIZE := 64k
50   IMAGE_SIZE := 16064k
51   DEVICE_TITLE := Omnima HPM
52   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2
53 endef
54 TARGET_DEVICES += hpm
55
56
57 define Device/tew-691gr
58   DTS := TEW-691GR
59   BLOCKSIZE := 64k
60   IMAGES += factory.bin
61   IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | umedia-header 0x026910
62   DEVICE_TITLE := TRENDnet TEW-691GR
63   DEVICE_PACKAGES := swconfig
64 endef
65 TARGET_DEVICES += tew-691gr
66
67
68 define Device/tew-692gr
69   DTS := TEW-692GR
70   BLOCKSIZE := 64k
71   IMAGES += factory.bin
72   IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | umedia-header 0x026920
73   DEVICE_TITLE := TRENDnet TEW-692GR
74   DEVICE_PACKAGES := swconfig
75 endef
76 TARGET_DEVICES += tew-692gr
77
78
79 # $(1) = squashfs/initramfs
80 # $(2) = lowercase board name
81 # $(3) = dts file
82 # $(4) = kernel size
83 # $(5) = rootfs size
84 # $(6) = signature
85 # $(7) = model
86 # $(8) = flash address
87 # $(9) = start address
88 define BuildFirmware/EdimaxCombined/squashfs
89         $(call PatchKernelLzmaDtb,$(2),$(3))
90         $(call MkImage,lzma,$(KDIR)/vmlinux-$(2).bin.lzma,$(KDIR)/vmlinux-$(2).bin.uImage)
91         if [ `stat -c%s "$(KDIR)/vmlinux-$(2).bin.uImage"` -gt `expr $(4) - 20` ]; then \
92                 echo "Warning: $(KDIR)/vmlinux-$(2).bin.uImage is too big" >&2; \
93                 exit 1; \
94         else if [ `stat -c%s "$(KDIR)/root.$(1)"` -gt $(5) ]; then \
95                 echo "Warning: $(KDIR)/root.$(1) is too big" >&2; \
96                 exit 1; \
97         else \
98                 ( dd if=$(KDIR)/vmlinux-$(2).bin.uImage bs=`expr $(4) - 20` conv=sync ; dd if=$(KDIR)/root.$(1) ) > $(KDIR)/vmlinux-$(2).bin.uImage.combined ; \
99         fi ; fi
100         mkedimaximg -i "$(KDIR)/vmlinux-$(2).bin.uImage.combined" \
101                 -o $(call imgname,$(1),$(2)).bin \
102                 -s $(6) -m $(7) -f $(8) -S $(9)
103 endef
104
105 define BuildFirmware/RTN56U/squashfs
106         $(call BuildFirmware/Default8M/$(1),$(1),rt-n56u,RT-N56U)
107         -mkrtn56uimg -s $(call sysupname,$(1),rt-n56u)
108         -cp $(call sysupname,$(1),rt-n56u) $(call imgname,$(1),rt-n56u)-factory.bin
109         -mkrtn56uimg -f $(call imgname,$(1),rt-n56u)-factory.bin
110 endef
111
112
113 Image/Build/Profile/RTN56U=$(call BuildFirmware/RTN56U/$(1),$(1),rt-n56u,RT-N56U)
114 kernel_size_BR6475ND:=2097152
115 rootfs_size_BR6475ND:=5832704
116 Image/Build/Profile/BR6475ND=$(call BuildFirmware/EdimaxCombined/$(1),$(1),br-6475nd,BR-6475ND,$(kernel_size_BR6475ND),$(rootfs_size_BR6475ND),CSYS,RN54,0x70000,0x01100000)
117
118
119 define LegacyDevice/RTN56U
120   BLOCKSIZE := 64k
121   DEVICE_TITLE := Asus RT-N56U
122   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig
123 endef
124 LEGACY_DEVICES += RTN56U
125
126
127 define LegacyDevice/BR6475ND
128   BLOCKSIZE := 64k
129   DEVICE_TITLE := Edimax BR-6475nD
130   DEVICE_PACKAGES := swconfig
131 endef
132 LEGACY_DEVICES += BR6475ND