source: src/router/Makefile.pb42 @ 31854

Last change on this file since 31854 was 31854, checked in by brainslayer, 3 months ago

fix header to prevent overwrite of calibration data

File size: 104.8 KB
Line 
1#
2# Broadcom Linux Router Makefile
3#
4# Copyright 2001-2003, Broadcom Corporation
5# All Rights Reserved.
6#
7# THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY
8# KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM
9# SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
10# FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.
11#
12# $Id: Makefile,v 1.2 2005/09/26 11:06:58 seg Exp $
13#
14
15include .config
16ifneq ($(wildcard ../cy_conf.mak),)
17  include ../cy_conf.mak
18endif
19
20CONFIG_WPE72_SIZE?=0x3d0000
21CONFIG_MUSL=y
22CONFIG_NOOPT=y
23
24#
25# Paths
26#
27OPENSER_MODULES := sl tm rr maxfwd usrloc registrar dbtext textops exec auth auth_db nathelper
28OPENSER_MODULE_FILES := $(foreach module,$(OPENSER_MODULES),openser/modules/$(module)/$(module).so)
29OPENSSL_NO_CIPHERS:= no-idea no-md2 no-mdc2 no-rc5 no-sha0 no-rmd160 no-aes192
30OPENSSL_OPTIONS:= shared no-ec no-err no-fips no-hw no-krb5 no-threads zlib-dynamic no-engines
31
32# Source bases
33
34export PLATFORM LINUXDIR LIBDIR USRLIBDIR
35export TOP := $(shell pwd)
36export SRCBASE := $(shell (cd $(TOP)/.. && pwd -P))
37
38
39# Set the HAL directory if you have the HAL sources
40
41# Set the Atheros Rate Control directory if you have the proprietary rate control
42export ATH_RATE=ath_rate/sample
43
44#
45# Cross-compile environment variables
46#
47
48# Build platform
49export BUILD := i386-pc-linux-gnu
50export HOSTCC := gcc
51
52# uClibc wrapper
53export ARCH:=$(PLATFORM)
54ifeq ($(CONFIG_UCLIBC),y)
55export PLATFORM := $(PLATFORM)-uclibc
56endif
57
58#export LINUXDIR := $(SRCBASE)/linux/linux.v24
59#ifeq ($(ARCH),mips)
60#export LINUXDIR := $(SRCBASE)/linux/ar531x/linux-2.6.22
61#endif
62ifeq ($(ARCH),armeb)
63export LINUXDIR := $(SRCBASE)/linux/xscale/linux-2.6.17
64endif
65ifeq ($(ARCH),powerpc)
66export LINUXDIR := $(SRCBASE)/linux/magicbox/linux-2.6.19
67endif
68ifeq ($(ARCH),mipsel)
69export LINUXDIR := $(SRCBASE)/kernel/rb500/linux-2.6.17-rc5
70endif
71ifeq ($(ARCH),i386)
72export LINUXDIR := $(SRCBASE)/kernel/wrap/linux-2.6.16.7
73endif
74
75export KERNELRELEASE = $(shell cat $(LINUXDIR)/include/config/kernel.release 2> /dev/null)
76
77#ifeq ($(KERNELRELEASE),"")
78#export KERNELRELEASE = $(shell cat $(LINUXDIR)/include/config/kernel.release 2> /dev/null)
79#endif
80#ifeq ($(PLATFORM),mipsel)
81#export CROSS_COMPILE := mipsel-linux-
82#export CONFIGURE := ./configure mipsel-linux --build=$(BUILD)
83#export TOOLCHAIN := $(shell cd $(dir $(shell which $(CROSS_COMPILE)gcc))/../mipsel-linux && pwd -P)
84#endif
85
86#ifeq ($(PLATFORM),mipsel-uclibc)
87export CROSS_COMPILE := $(ARCH)-linux-uclibc-
88export CONFIGURE := ./configure $(ARCH)-linux --build=$(BUILD)
89export TOOLCHAIN := $(shell cd $(dir $(shell which $(CROSS_COMPILE)gcc))/.. && pwd -P)
90#endif
91
92#ifeq ($(CONFIG_BCMWPA2),y)
93#export CFLAGS += -DBCMWPA2
94#endif
95
96export BASEOPT:=-Os
97#export ARCH:= mipsel
98
99
100
101ifeq ($(ARCH),mipsel)
102export COPTS:=$(BASEOPT) -pipe -mips32 -mtune=mips32 -funit-at-a-time
103endif
104ifeq ($(ARCH),armeb)
105export COPTS:=$(BASEOPT) -pipe -mtune=xscale -march=armv5te -Wa,-mcpu=xscale -mno-thumb-interwork -mno-thumb -funit-at-a-time
106endif
107ifeq ($(ARCH),mips)
108export COPTS:=$(BASEOPT) -pipe -mips32r2 -mtune=34kc -msoft-float  -fno-caller-saves  -mno-branch-likely
109endif
110ifeq ($(ARCH),powerpc)
111export COPTS:=$(BASEOPT) -pipe -funit-at-a-time -mcpu=405fp -mtune=405fp -mmultiple -mstring -mno-bit-align
112endif
113ifeq ($(ARCH),i386)
114export COPTS:=$(BASEOPT) -pipe -march=i486 -funit-at-a-time
115endif
116
117export CC := ccache $(CROSS_COMPILE)gcc
118export CXX := ccache $(CROSS_COMPILE)g++
119export AR := $(CROSS_COMPILE)ar
120export AS := $(CROSS_COMPILE)as
121export LD := $(CROSS_COMPILE)ld
122export NM := $(CROSS_COMPILE)nm
123export RANLIB := $(CROSS_COMPILE)ranlib
124export STRIP := $(CROSS_COMPILE)strip
125export SIZE := $(CROSS_COMPILE)size
126export LTO :=
127export CFLAGS := $(COPTS)
128export MIPS16_OPT:= -minterlink-mips16 -mips16
129
130#
131# Install and target directories
132#
133
134export PLATFORMDIR := $(TOP)/$(PLATFORM)
135export INSTALLDIR := $(PLATFORMDIR)/install
136export TARGETDIR := $(PLATFORMDIR)/target
137
138ifeq ($(PLATFORM),mipsel)
139obj-y += libcrypto
140endif
141#
142# Configuration
143#
144CONFIG_IPTABLES=y
145include rules/configs.mk
146
147obj-clean := $(foreach obj,$(obj-y) $(obj-n) $(obj-m),$(obj)-clean)
148obj-install := $(foreach obj,$(obj-y) $(obj-m),$(obj)-install)
149obj-distclean := $(foreach obj,$(obj-y) $(obj-n),$(obj)-distclean)
150
151#
152# Basic rules
153#
154
155
156all: kernel install_headers build_date clean_target $(obj-y) $(obj-m) $(LINUXDIR)/.config
157
158
159build_date:
160        echo "#define BUILD_DATE \"$(shell date +%D)\"" > ../../opt/build.h
161        echo "CONFIG_MUSL=y" >> .config
162
163drop-sections   = .comment
164strip-flags     = $(addprefix --remove-section=,$(drop-sections))
165
166kernelsource:
167        mkdir -p $(LINUXDIR)
168        wget http://www.de.kernel.org/pub/linux/kernel/v2.6/linux-$(KERNELVERSION).tar.bz2 -O $(LINUXDIR)/../linux-$(KERNELVERSION).tar.bz2
169        cd $(LINUXDIR)/../ && tar -xvjf $(LINUXDIR)/../linux-$(KERNELVERSION).tar.bz2
170        cd $(LINUXDIR)/../ && ./patch $(KERNELVERSION)
171
172include kernel-features.mk
173
174kernel:
175        # Also build kernel
176        # Also build kernel
177ifeq ($(CONFIG_LSX),y)
178        cp $(LINUXDIR)/.config_lsx $(LINUXDIR)/.config
179endif
180ifeq ($(CONFIG_LSX_PROTO),y)
181        cp $(LINUXDIR)/.config_lsx_4m $(LINUXDIR)/.config
182endif
183ifeq ($(CONFIG_RS),y)
184        cp $(LINUXDIR)/.config_rs $(LINUXDIR)/.config
185endif
186
187ifeq ($(CONFIG_RSPRO),y)
188        cp $(LINUXDIR)/.config_rspro $(LINUXDIR)/.config
189endif
190ifeq ($(CONFIG_PB44),y)
191        cp $(LINUXDIR)/.config_pb44 $(LINUXDIR)/.config
192endif
193ifeq ($(CONFIG_AP83),y)
194        cp $(LINUXDIR)/.config_ap83 $(LINUXDIR)/.config
195endif
196ifeq ($(CONFIG_WR1043),y)
197        cp $(LINUXDIR)/.config_wr1043 $(LINUXDIR)/.config
198endif
199ifeq ($(CONFIG_WR941),y)
200        cp $(LINUXDIR)/.config_wr941 $(LINUXDIR)/.config
201endif
202ifeq ($(CONFIG_WA901),y)
203        cp $(LINUXDIR)/.config_wa901 $(LINUXDIR)/.config
204endif
205ifeq ($(CONFIG_WR741),y)
206        cp $(LINUXDIR)/.config_wr741 $(LINUXDIR)/.config
207endif
208ifeq ($(CONFIG_MR3420),y)
209        cp $(LINUXDIR)/.config_mr3240 $(LINUXDIR)/.config
210endif
211ifeq ($(CONFIG_WR842),y)
212        cp $(LINUXDIR)/.config_wr842 $(LINUXDIR)/.config
213endif
214ifeq ($(CONFIG_WR741V4),y)
215        cp $(LINUXDIR)/.config_wr741v4 $(LINUXDIR)/.config
216endif
217ifeq ($(CONFIG_WR703),y)
218        cp $(LINUXDIR)/.config_wr703 $(LINUXDIR)/.config
219endif
220ifeq ($(CONFIG_WRT400),y)
221        cp $(LINUXDIR)/.config_wrt400 $(LINUXDIR)/.config
222endif
223ifeq ($(CONFIG_DIR825),y)
224        cp $(LINUXDIR)/.config_dir825 $(LINUXDIR)/.config
225endif
226ifeq ($(CONFIG_WNDR3700),y)
227        cp $(LINUXDIR)/.config_wndr3700 $(LINUXDIR)/.config
228endif
229ifeq ($(CONFIG_WNDR3700V2),y)
230        cp $(LINUXDIR)/.config_wndr3700v2 $(LINUXDIR)/.config
231endif
232ifeq ($(CONFIG_WP543),y)
233        cp $(LINUXDIR)/.config_wp543 $(LINUXDIR)/.config
234endif
235ifeq ($(CONFIG_WP546),y)
236        cp $(LINUXDIR)/.config_wp546 $(LINUXDIR)/.config
237endif
238ifeq ($(CONFIG_UBNTM),y)
239        cp $(LINUXDIR)/.config_ar724x $(LINUXDIR)/.config
240endif
241ifeq ($(CONFIG_WRT160NL),y)
242        cp $(LINUXDIR)/.config_wrt160nl $(LINUXDIR)/.config
243endif
244ifeq ($(CONFIG_TEW632BRP),y)
245        cp $(LINUXDIR)/.config_tew632brp $(LINUXDIR)/.config
246endif
247ifeq ($(CONFIG_WHRHPGN),y)
248        cp $(LINUXDIR)/.config_ar7240_nousb $(LINUXDIR)/.config
249endif
250ifeq ($(CONFIG_WNR2000),y)
251        cp $(LINUXDIR)/.config_ar7240_nousb $(LINUXDIR)/.config
252endif
253ifeq ($(CONFIG_WNR2200),y)
254        cp $(LINUXDIR)/.config_wnr2200 $(LINUXDIR)/.config
255endif
256ifeq ($(CONFIG_DIR615E),y)
257        cp $(LINUXDIR)/.config_dir615e $(LINUXDIR)/.config
258endif
259ifeq ($(CONFIG_DIR615I),y)
260        cp $(LINUXDIR)/.config_dir615i $(LINUXDIR)/.config
261endif
262ifeq ($(CONFIG_UBNTTI),y)
263        cp $(LINUXDIR)/.config_dir615i $(LINUXDIR)/.config
264endif
265ifeq ($(CONFIG_WR842V2),y)
266        cp $(LINUXDIR)/.config_wr842v2 $(LINUXDIR)/.config
267endif
268ifeq ($(CONFIG_TG2521),y)
269        cp $(LINUXDIR)/.config_tg2521 $(LINUXDIR)/.config
270endif
271ifeq ($(CONFIG_JA76PF),y)
272        cp $(LINUXDIR)/.config_jjplus $(LINUXDIR)/.config
273endif
274ifeq ($(CONFIG_JWAP003),y)
275        cp $(LINUXDIR)/.config_jjplus_jwap003 $(LINUXDIR)/.config
276endif
277ifeq ($(CONFIG_ALFAAP94),y)
278        cp $(LINUXDIR)/.config_alfaap94 $(LINUXDIR)/.config
279endif
280ifeq ($(CONFIG_WZRHPAG300NH),y)
281        cp $(LINUXDIR)/.config_wzrhpag300nh $(LINUXDIR)/.config
282endif
283ifeq ($(CONFIG_WZRG450),y)
284        cp $(LINUXDIR)/.config_wzrg450 $(LINUXDIR)/.config
285endif
286ifeq ($(CONFIG_WZRG300NH2),y)
287        cp $(LINUXDIR)/.config_wzrg300nh2 $(LINUXDIR)/.config
288endif
289ifeq ($(CONFIG_DIR632),y)
290        cp $(LINUXDIR)/.config_dir632 $(LINUXDIR)/.config
291endif
292ifeq ($(CONFIG_HORNET),y)
293        cp $(LINUXDIR)/.config_hornet $(LINUXDIR)/.config
294endif
295ifeq ($(CONFIG_CARAMBOLA),y)
296        cp $(LINUXDIR)/.config_carambola $(LINUXDIR)/.config
297endif
298ifeq ($(CONFIG_WASP),y)
299        cp $(LINUXDIR)/.config_wasp $(LINUXDIR)/.config
300endif
301ifeq ($(CONFIG_DIR825C1),y)
302        cp $(LINUXDIR)/.config_dir825c1 $(LINUXDIR)/.config
303endif
304ifeq ($(CONFIG_MMS344),y)
305        cp $(LINUXDIR)/.config_dir825c1 $(LINUXDIR)/.config
306endif
307ifeq ($(CONFIG_RB2011),y)
308        cp $(LINUXDIR)/.config_rb2011 $(LINUXDIR)/.config
309endif
310ifeq ($(CONFIG_WDR2543),y)
311        cp $(LINUXDIR)/.config_wdr2543 $(LINUXDIR)/.config
312endif
313ifeq ($(CONFIG_UBNTXW),y)
314        cp $(LINUXDIR)/.config_ubntxw $(LINUXDIR)/.config
315endif
316ifeq ($(CONFIG_JJAP93),y)
317        cp $(LINUXDIR)/.config_ar7240_nousb $(LINUXDIR)/.config
318endif
319ifeq ($(CONFIG_JJAP005),y)
320        cp $(LINUXDIR)/.config_ar7240_nousb $(LINUXDIR)/.config
321endif
322ifeq ($(CONFIG_JJAP501),y)
323        cp $(LINUXDIR)/.config_ar7240_nousb $(LINUXDIR)/.config
324endif
325ifeq ($(CONFIG_AC722),y)
326        cp $(LINUXDIR)/.config_ar7240_nousb $(LINUXDIR)/.config
327endif
328ifeq ($(CONFIG_AC622),y)
329        cp $(LINUXDIR)/.config_ar7240_nousb $(LINUXDIR)/.config
330endif
331ifeq ($(CONFIG_WNDR3700V4),y)
332        cp $(LINUXDIR)/.config_wndr3700v4 $(LINUXDIR)/.config
333endif
334ifeq ($(CONFIG_DAP2230),y)
335        cp $(LINUXDIR)/.config_dap2230 $(LINUXDIR)/.config
336endif
337ifeq ($(CONFIG_WR710),y)
338ifeq ($(CONFIG_WR710V1),y)
339        cp $(LINUXDIR)/.config_carambola $(LINUXDIR)/.config
340endif
341        sed -i 's/\# CONFIG_AG7240_GE0_IS_CONNECTED is not set/CONFIG_AG7240_GE0_IS_CONNECTED=y/g' $(LINUXDIR)/.config
342        sed -i 's/\# CONFIG_WR741 is not set/CONFIG_WR741=y/g' $(LINUXDIR)/.config
343        echo "# CONFIG_WZRG450 is not set" >> $(LINUXDIR)/.config
344        echo "# CONFIG_AR7242_RTL8309G_PHY is not set" >> $(LINUXDIR)/.config
345        echo "# CONFIG_AR7242_VIR_PHY is not set" >> $(LINUXDIR)/.config
346        echo "# CONFIG_AR7242_RGMII_PHY is not set" >> $(LINUXDIR)/.config
347        echo "CONFIG_AR7242_S16_PHY=y" >> $(LINUXDIR)/.config
348        echo "CONFIG_WR710=y" >> $(LINUXDIR)/.config
349        echo "CONFIG_GL150=y" >> $(LINUXDIR)/.config
350else
351        echo "# CONFIG_WR710 is not set" >> $(LINUXDIR)/.config
352        echo "# CONFIG_GL150 is not set" >> $(LINUXDIR)/.config
353endif
354ifeq ($(CONFIG_ALFANX),y)
355        echo CONFIG_ALFANX=y >> $(LINUXDIR)/.config
356else
357        echo "# CONFIG_ALFANX is not set" >> $(LINUXDIR)/.config
358endif
359ifeq ($(CONFIG_LOCOXW),y)
360        echo CONFIG_XWLOCO=y >> $(LINUXDIR)/.config
361else
362        echo "# CONFIG_XWLOCO is not set" >> $(LINUXDIR)/.config
363endif
364ifeq ($(CONFIG_UAPAC),y)
365        echo CONFIG_UAPAC=y >> $(LINUXDIR)/.config
366else
367        echo "# CONFIG_UAPAC is not set" >> $(LINUXDIR)/.config
368endif
369ifeq ($(CONFIG_DIR859),y)
370        echo CONFIG_DIR859=y >> $(LINUXDIR)/.config
371else
372        echo "# CONFIG_DIR859 is not set" >> $(LINUXDIR)/.config
373endif
374ifeq ($(CONFIG_WR650AC),y)
375        echo CONFIG_WR650AC=y >> $(LINUXDIR)/.config
376else
377        echo "# CONFIG_WR650AC is not set" >> $(LINUXDIR)/.config
378endif
379ifeq ($(CONFIG_E355AC),y)
380        echo CONFIG_E355AC=y >> $(LINUXDIR)/.config
381else
382        echo "# CONFIG_E355AC is not set" >> $(LINUXDIR)/.config
383endif
384ifeq ($(CONFIG_AP120C),y)
385        sed -i 's/\# CONFIG_AT803X_PHY is not set/CONFIG_AT803X_PHY=y/g' $(LINUXDIR)/.config
386        echo CONFIG_AP120C=y >> $(LINUXDIR)/.config
387else
388        echo "# CONFIG_AP120C is not set" >> $(LINUXDIR)/.config
389endif
390ifeq ($(CONFIG_E325N),y)
391        echo CONFIG_E325N=y >> $(LINUXDIR)/.config
392else
393        echo "# CONFIG_E325N is not set" >> $(LINUXDIR)/.config
394endif
395ifeq ($(CONFIG_WR615N),y)
396        echo CONFIG_WR615N=y >> $(LINUXDIR)/.config
397else
398        echo "# CONFIG_WR615N is not set" >> $(LINUXDIR)/.config
399endif
400ifeq ($(CONFIG_E380AC),y)
401        sed -i 's/\# CONFIG_AT803X_PHY is not set/CONFIG_AT803X_PHY=y/g' $(LINUXDIR)/.config
402        echo CONFIG_E380AC=y >> $(LINUXDIR)/.config
403else
404        echo "# CONFIG_E380AC is not set" >> $(LINUXDIR)/.config
405endif
406ifeq ($(CONFIG_XD3200),y)
407        echo CONFIG_XD3200=y >> $(LINUXDIR)/.config
408else
409        echo "# CONFIG_XD3200 is not set" >> $(LINUXDIR)/.config
410endif
411ifeq ($(CONFIG_WZR450HP2),y)
412        echo CONFIG_WZR450HP2=y >> $(LINUXDIR)/.config
413else
414        echo "# CONFIG_WZR450HP2 is not set" >> $(LINUXDIR)/.config
415endif
416
417ifeq ($(CONFIG_AP135),y)
418        echo CONFIG_AP135=y >> $(LINUXDIR)/.config
419ifneq ($(CONFIG_MMS344),y)
420        sed -i 's/\CONFIG_USB_EHCI_AR9130=y/# CONFIG_USB_EHCI_AR9130 is not set/g' $(LINUXDIR)/.config
421endif
422else
423        echo "# CONFIG_AP135 is not set" >> $(LINUXDIR)/.config
424endif
425ifeq ($(CONFIG_DAP3310),y)
426        sed -i 's/\# CONFIG_LEDS_TRIGGER_NETDEV is not set/CONFIG_LEDS_TRIGGER_NETDEV=y/g' $(LINUXDIR)/.config
427        echo CONFIG_DAP3310=y >> $(LINUXDIR)/.config
428else
429        echo "# CONFIG_DAP3310 is not set" >> $(LINUXDIR)/.config
430endif
431ifeq ($(CONFIG_WR1043V2),y)
432        echo CONFIG_WR1043V2=y >> $(LINUXDIR)/.config
433else
434        echo "# CONFIG_WR1043V2 is not set" >> $(LINUXDIR)/.config
435endif
436ifeq ($(CONFIG_ARCHERC7),y)
437        echo CONFIG_ARCHERC7=y >> $(LINUXDIR)/.config
438else
439        echo "# CONFIG_ARCHERC7 is not set" >> $(LINUXDIR)/.config
440endif
441ifeq ($(CONFIG_DAP3662),y)
442        echo CONFIG_DAP3662=y >> $(LINUXDIR)/.config
443else
444        echo "# CONFIG_DAP3662 is not set" >> $(LINUXDIR)/.config
445endif
446ifeq ($(CONFIG_DAP2330),y)
447        sed -i 's/\# CONFIG_AT803X_PHY is not set/CONFIG_AT803X_PHY=y/g' $(LINUXDIR)/.config
448        echo CONFIG_DAP2330=y >> $(LINUXDIR)/.config
449else
450        echo "# CONFIG_DAP2330 is not set" >> $(LINUXDIR)/.config
451
452endif
453ifeq ($(CONFIG_DAP2230),y)
454        echo CONFIG_DAP2230=y >> $(LINUXDIR)/.config
455else
456        echo "# CONFIG_DAP2230 is not set" >> $(LINUXDIR)/.config
457endif
458ifeq ($(CONFIG_KERNEL_ELF_CORE),y)
459        sed -i 's/\# CONFIG_ELF_CORE is not set/CONFIG_ELF_CORE=y/g' $(LINUXDIR)/.config
460endif
461        $(kernelfeatures)
462ifeq ($(CONFIG_E2100),y)
463        sed -i 's/\# CONFIG_E2100L is not set/CONFIG_E2100L=y/g' $(LINUXDIR)/.config
464else
465ifeq ($(CONFIG_WRT160NL),y)
466        sed -i 's/\# CONFIG_WRT160NL is not set/CONFIG_WRT160NL=y/g' $(LINUXDIR)/.config
467endif
468endif
469ifeq ($(CONFIG_WR841V8),y)
470        echo CONFIG_WR841V8=y >> $(LINUXDIR)/.config
471        echo "# CONFIG_DIR615I is not set" >> $(LINUXDIR)/.config
472ifeq ($(CONFIG_WR841V9),y)
473        echo CONFIG_WR841V9=y >> $(LINUXDIR)/.config
474else
475        echo "# CONFIG_WR841V9 is not set" >> $(LINUXDIR)/.config
476endif
477ifeq ($(CONFIG_WR941V6),y)
478        echo CONFIG_WR941V6=y >> $(LINUXDIR)/.config
479else
480        echo "# CONFIG_WR941V6 is not set" >> $(LINUXDIR)/.config
481endif
482else
483ifeq ($(CONFIG_DIR615I),y)
484        echo CONFIG_DIR615I=y >> $(LINUXDIR)/.config
485else
486        echo "# CONFIG_DIR615I is not set" >> $(LINUXDIR)/.config
487endif
488        echo "# CONFIG_WR841V8 is not set" >> $(LINUXDIR)/.config
489endif
490ifeq ($(CONFIG_WA901),y)
491        echo CONFIG_WA901=y >> $(LINUXDIR)/.config
492else
493        echo "# CONFIG_WA901 is not set" >> $(LINUXDIR)/.config
494endif
495ifeq ($(CONFIG_WDR4300),y)
496        echo CONFIG_WDR4300=y >> $(LINUXDIR)/.config
497else
498        echo "# CONFIG_WDR4300 is not set" >> $(LINUXDIR)/.config
499endif
500ifeq ($(CONFIG_WDR3500),y)
501        echo CONFIG_WDR3500=y >> $(LINUXDIR)/.config
502else
503        echo "# CONFIG_WDR3500 is not set" >> $(LINUXDIR)/.config
504endif
505ifeq ($(CONFIG_WDR2543),y)
506        echo CONFIG_WDR2543=y >> $(LINUXDIR)/.config
507else
508        echo "# CONFIG_WDR2543 is not set" >> $(LINUXDIR)/.config
509endif
510ifeq ($(CONFIG_MMS344),y)
511        echo CONFIG_MMS344=y >> $(LINUXDIR)/.config
512        sed -i 's/\# CONFIG_USB_SERIAL_QUALCOMM is not set/CONFIG_USB_SERIAL_QUALCOMM=m/g' $(LINUXDIR)/.config
513else
514        echo "# CONFIG_MMS344 is not set" >> $(LINUXDIR)/.config
515endif
516ifeq ($(CONFIG_JWAP606),y)
517        echo CONFIG_JWAP606=y >> $(LINUXDIR)/.config
518        sed -i 's/\# CONFIG_AT803X_PHY is not set/CONFIG_AT803X_PHY=y/g' $(LINUXDIR)/.config
519else
520        echo "# CONFIG_JWAP606 is not set" >> $(LINUXDIR)/.config
521endif
522ifeq ($(CONFIG_DIR862),y)
523        echo CONFIG_DIR862=y >> $(LINUXDIR)/.config
524else
525        echo "# CONFIG_DIR862 is not set" >> $(LINUXDIR)/.config
526endif
527ifeq ($(CONFIG_ERC),y)
528        sed -i 's/\# CONFIG_ERC is not set/CONFIG_ERC=y/g' $(LINUXDIR)/.config
529        echo CONFIG_ERC=y >> $(LINUXDIR)/.config
530else
531        echo "# CONFIG_ERC is not set" >> $(LINUXDIR)/.config
532endif
533ifeq ($(CONFIG_WILLY),y)
534        sed -i 's/\# CONFIG_WILLY is not set/CONFIG_WILLY=y/g' $(LINUXDIR)/.config
535        echo CONFIG_WILLY=y >> $(LINUXDIR)/.config
536        sed -i 's/\# CONFIG_AT803X_PHY is not set/CONFIG_AT803X_PHY=y/g' $(LINUXDIR)/.config
537else
538        echo "# CONFIG_WILLY is not set" >> $(LINUXDIR)/.config
539endif
540ifeq ($(CONFIG_EHCI),y)
541        sed -i 's/\# CONFIG_USB_EHCI_HCD is not set/CONFIG_USB_EHCI_HCD=m/g' $(LINUXDIR)/.config
542        echo "CONFIG_USB_EHCI_ROOT_HUB_TT=y" >> $(LINUXDIR)/.config
543        echo "CONFIG_USB_EHCI_TT_NEWSCHED=y" >> $(LINUXDIR)/.config
544        echo "CONFIG_USB_EHCI_HCD_PLATFORM=m" >> $(LINUXDIR)/.config
545        echo "# CONFIG_USB_SISUSBVGA is not set" >> $(LINUXDIR)/.config
546        echo "CONFIG_USB_EHCI_AR9130=y" >> $(LINUXDIR)/.config
547        echo "# CONFIG_USB_CHIPIDEA is not set" >> $(LINUXDIR)/.config
548        echo "# CONFIG_USB_SIERRA_NET is not set" >> $(LINUXDIR)/.config
549        echo "# CONFIG_USB_NET_INT51X1 is not set" >> $(LINUXDIR)/.config
550endif
551ifeq ($(CONFIG_WPE72),y)
552        sed -i 's/\# CONFIG_LEDS_TRIGGER_NETDEV is not set/CONFIG_LEDS_TRIGGER_NETDEV=y/g' $(LINUXDIR)/.config
553        echo "CONFIG_WPE72=y" >> $(LINUXDIR)/.config
554else
555        echo "# CONFIG_WPE72 is not set" >> $(LINUXDIR)/.config
556endif
557ifneq ($(CONFIG_ATH10K),y)
558        sed -i 's/\CONFIG_THERMAL=y/# CONFIG_THERMAL is not set/g' $(LINUXDIR)/.config
559        sed -i 's/\CONFIG_THERMAL=m/# CONFIG_THERMAL is not set/g' $(LINUXDIR)/.config
560        sed -i 's/\CONFIG_HWMON=y/# CONFIG_HWMON is not set/g' $(LINUXDIR)/.config
561        sed -i 's/\CONFIG_HWMON=m/# CONFIG_HWMON is not set/g' $(LINUXDIR)/.config
562endif
563
564
565        rm -f $(LINUXDIR)/symtab.h
566        touch $(LINUXDIR)/symtab.h
567
568        $(MAKE) -C $(LINUXDIR) oldconfig       
569        if ! grep -q "CONFIG_EMBEDDED_RAMDISK=y" $(LINUXDIR)/.config ; then \
570            $(MAKE) -j 4 -C $(LINUXDIR) vmlinux CROSS_COMPILE="ccache $(ARCH)-linux-uclibc-" ; \
571        fi
572        if grep -q "CONFIG_MODULES=y" $(LINUXDIR)/.config ; then \
573            $(MAKE) -j 4 -C $(LINUXDIR) modules CROSS_COMPILE="ccache $(ARCH)-linux-uclibc-" ; \
574        fi
575        $(ARCH)-linux-objcopy -O binary $(LINUXDIR)/vmlinux $(ARCH)-uclibc/vmlinus_old
576
577        rm -rf $(TARGETDIR)/lib/modules
578        $(MAKE) -C $(LINUXDIR) modules_install DEPMOD=/bin/true INSTALL_MOD_PATH=$(TARGETDIR)
579        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/build
580        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/source
581
582        -$(MAKE) -f Makefile.pb42 ath9k
583        -$(MAKE) -f Makefile.pb42 ath9k-install
584        -$(MAKE) -f Makefile.pb42 libutils
585        -$(MAKE) -f Makefile.pb42 madwifi
586        -$(MAKE) -f Makefile.pb42 madwifi-install
587ifeq ($(CONFIG_BATMANADV),y)
588        -$(MAKE) -f Makefile.pb42 batman-adv
589        -$(MAKE) -f Makefile.pb42 batman-adv-install
590endif
591ifeq ($(CONFIG_OPENDPI),y)
592        -$(MAKE) -f Makefile.pb42 opendpi
593        -$(MAKE) -f Makefile.pb42 opendpi-install
594endif
595ifeq ($(CONFIG_SERVICEGATE),y)
596        -$(MAKE) -f Makefile.pb42 servicegate
597        -$(MAKE) -f Makefile.pb42 servicegate-install
598endif
599
600ifneq ($(CONFIG_SAMBA),y)
601        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/cifs
602endif
603ifneq ($(CONFIG_JFFS2),y)
604        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/jffs2
605        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/lib/lzma
606endif
607ifneq ($(CONFIG_IPV6),y)
608        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/net/ipv6
609endif
610ifneq ($(CONFIG_BONDING),y)
611        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/net/bonding
612endif
613ifneq ($(CONFIG_USBIP),y)
614        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/staging/usbip
615endif
616ifneq ($(CONFIG_USB),y)
617        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/usb
618        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/net/usb
619        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/scsi
620        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/cdrom
621        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/ext2
622        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/ext3
623        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/isofs
624        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/udf
625        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/exportfs
626        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/xfs
627        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/jbd
628        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/fat
629        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/vfat
630        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/msdos
631        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/nls
632        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/mbcache.ko
633endif
634ifneq ($(CONFIG_UQMI),y)
635        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/net/usb/qmi_wwan.ko
636endif
637ifeq ($(CONFIG_3G_ONLY),y)
638        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/nls
639endif
640ifneq ($(CONFIG_USB_ADVANCED),y)
641        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/ext3
642        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/ext4
643        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/xfs
644        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/btrfs
645        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/jbd 
646        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/jbd2
647endif
648
649        find $(ARCH)-uclibc/install $(ARCH)-uclibc/target  -name \*.ko | \
650                xargs $(ARCH)-linux-nm | \
651                awk '$$1 == "U" { print $$2 } ' | \
652                sort -u > $(LINUXDIR)/mod_symtab.txt
653        $(ARCH)-linux-nm -n $(LINUXDIR)/vmlinux.o | grep ' r __ksymtab' | sed -e 's,........ r __ksymtab_,,' > $(LINUXDIR)/kernel_symtab.txt
654        $(ARCH)-linux-nm -n $(LINUXDIR)/vmlinux.o | grep ' R __ksymtab' | sed -e 's,........ R __ksymtab_,,' >> $(LINUXDIR)/kernel_symtab.txt
655        grep -f $(LINUXDIR)/mod_symtab.txt $(LINUXDIR)/kernel_symtab.txt -F > $(LINUXDIR)/sym_include.txt
656        grep -vf $(LINUXDIR)/mod_symtab.txt $(LINUXDIR)/kernel_symtab.txt -F > $(LINUXDIR)/sym_exclude.txt
657        ( \
658                echo '#define SYMTAB_KEEP \'; \
659                cat $(LINUXDIR)/sym_include.txt | \
660                        awk '{print "KEEP(*(___ksymtab+" $$$$1 ")) \\" }'; \
661                echo; \
662                echo '#define SYMTAB_KEEP_GPL \'; \
663                cat $(LINUXDIR)/sym_include.txt | \
664                        awk '{print "KEEP(*(___ksymtab_gpl+" $$$$1 ")) \\" }'; \
665                echo; \
666                echo '#define SYMTAB_DISCARD \'; \
667                cat $(LINUXDIR)/sym_exclude.txt | \
668                        awk '{print "*(___ksymtab+" $$$$1 ") \\" }'; \
669                echo; \
670                echo '#define SYMTAB_DISCARD_GPL \'; \
671                cat $(LINUXDIR)/sym_exclude.txt | \
672                        awk '{print "*(___ksymtab_gpl+" $$$$1 ") \\" }'; \
673                echo; \
674        ) > $(LINUXDIR)/symtab.h
675        rm -f $(LINUXDIR)/vmlinux
676        if ! grep -q "CONFIG_EMBEDDED_RAMDISK=y" $(LINUXDIR)/.config ; then \
677            $(MAKE) -j 4 -C $(LINUXDIR) vmlinux EXTRA_LDSFLAGS="-I$(LINUXDIR) -include symtab.h" CROSS_COMPILE="ccache $(ARCH)-linux-uclibc-" ; \
678        fi
679
680
681
682        $(ARCH)-linux-objcopy -O binary $(LINUXDIR)/vmlinux $(ARCH)-uclibc/vmlinus
683
684
685validate: $(eval FILE_SIZE = $(shell stat -c %s $(EX_PATH)))
686        @if [ ${FILE_SIZE} -gt ${MAXIMUM_SIZE} ] ; then \
687                echo "Image is to large. Maximum size ${MAXIMUM_SIZE} current size  ${FILE_SIZE}." ; \
688                rm -f $(EX_PATH) ; \
689        fi
690
691
692install_headers:
693# important step, required for new kernels
694        -mkdir -p $(TOP)/kernel_headers/$(KERNELRELEASE)
695        $(MAKE) -C $(LINUXDIR) headers_install ARCH=mips INSTALL_HDR_PATH=$(TOP)/kernel_headers/$(KERNELRELEASE)
696
697wndr:
698        ./tools/wndr3700/wndr3700v4 \
699                $(ARCH)-uclibc/root.uimage \
700                $(ARCH)-uclibc/root.wndr3700v4
701
702
703        mkimage -A mips -O linux -T filesystem -C none \
704                -a 0xbf070000 -e 0xbf070000 \
705                -n 'wndr3700v4-V1.1.4.68' \
706                -d $(ARCH)-uclibc/root.fs \
707                $(ARCH)-uclibc/rootfs.uimage
708
709        ./tools/wndr3700/wndr3700v4 \
710                $(ARCH)-uclibc/rootfs.uimage \
711                $(ARCH)-uclibc/rootfs.wndr3700v4
712        sync   
713        -fsync $(ARCH)-uclibc/rootfs.wndr3700v4
714        -fsync $(ARCH)-uclibc/root.wndr3700v4
715        dd if=$(TOP)/$(ARCH)-uclibc/root.wndr3700v4 bs=$(shell expr $(shell expr $(shell expr $(shell expr $(shell expr 128 + $(shell du -b $(TOP)/$(ARCH)-uclibc/root.wndr3700v4 | awk {'print $$1'})) / 131072) + 1) \* 131072) - 64) conv=sync of=$(TOP)/$(ARCH)-uclibc/root.wndr3700v4.final
716        sync
717        -fsync $(TOP)/$(ARCH)-uclibc/root.wndr3700v4.final
718        dd if=$(ARCH)-uclibc/rootfs.wndr3700v4 bs=64 count=1 conv=fsync >> $(ARCH)-uclibc/root.wndr3700v4.final
719        ( \
720            dd if=$(ARCH)-uclibc/root.wndr3700v4.final bs=$(shell du -b $(ARCH)-uclibc/root.wndr3700v4.final | awk {'print $$1'}) conv=sync; \
721            dd if=$(ARCH)-uclibc/root.fs bs=64k; \
722        ) > $(ARCH)-uclibc/aligned.wndr3700v4
723        ./tools/wndr3700/mkdniimg -B WNDR3700v4 -v 1.1.4.68 -r "" -i $(ARCH)-uclibc/aligned.wndr3700v4 -o $(ARCH)-uclibc/wndr3700v4-factory.img -H "29763948+128+128"
724        ./tools/wndr3700/mkdniimg -B WNDR4300 -v 1.1.4.68 -r "" -i $(ARCH)-uclibc/aligned.wndr3700v4 -o $(ARCH)-uclibc/wndr4300-factory.img -H "29763948+0+128+128+2x2+3x3"
725        ./tools/trx_n  -m 40000000 -o$(ARCH)-uclibc/wndr3700v4-webflash.bin  $(ARCH)-uclibc/aligned.wndr3700v4
726
727
728realclean: $(obj-clean)
729        rm -f .config.old .config.cmd
730        #umount $(TARGETDIR)
731        rm -rf $(INSTALLDIR)
732        rm -rf $(TARGETDIR)
733        -rm -f $(TARGETDIR)/*
734        -rm -f $(ARCH)-uclibc/*
735
736               
737clean: rc-clean httpd-clean services-clean shared-clean libutils-clean madwifi-clean madwifi_mimo-clean busybox-clean dnsmasq-clean iptables-clean pppd-clean nvram-clean utils-clean radauth-clean upnp-clean iproute2-clean
738        rm -f .config.old .config.cmd
739        #umount $(TARGETDIR)
740        rm -rf $(INSTALLDIR)
741        rm -rf $(TARGETDIR)
742        rm -f $(TARGETDIR)/*
743        -rm -f $(ARCH)-uclibc/*
744
745#test:
746#       dd if=$(ARCH)-uclibc/root.wndr3700v4 bs=$(shell expr $(shell expr $(shell expr $(shell expr $(shell expr 128 + $(shell du -b $(ARCH)-uclibc/root.wndr3700v4 | awk {'print $$1'})) / 131072) + 1) \* 131072) - 64) conv=sync of=$(ARCH)-uclibc/root.wndr3700v4.final
747#
748#       export KERNEL_SIZE=$(shell du -b $(ARCH)-uclibc/root.wndr3700v4.final | awk {'print $$1'})
749#       dd if=$(ARCH)-uclibc/rootfs.wndr3700v4 bs=64 count=1 >> $(ARCH)-uclibc/root.wndr3700v4.final
750#       ( \
751#           dd if=$(ARCH)-uclibc/root.wndr3700v4.final bs=$(shell du -b $(ARCH)-uclibc/root.wndr3700v4.final | awk {'print $$1'}) conv=sync; \
752#           dd if=$(ARCH)-uclibc/root.fs bs=64k; \
753#       ) > $(ARCH)-uclibc/aligned.wndr3700v4
754#       ./tools/wndr3700/mkdniimg -B WNDR3700v4 -v 1.1.4.68 -r "" -i $(ARCH)-uclibc/aligned.wndr3700v4 -o $(ARCH)-uclibc/wndr3700v4-factory.img -H "29763948+128+128"
755
756
757distclean mrproper: $(obj-distclean) clean_target
758        rm -rf $(INSTALLDIR)
759        $(MAKE) -C $(LINUXDIR) distclean
760        $(MAKE) -C $(LINUXDIR)/arch/mips/bcm947xx/compressed clean
761        #rm -f $(PLATFORMDIR)/zImage $(PLATFORMDIR)/linux.bin
762        $(MAKE) -C config clean
763        rm -f .config $(LINUXDIR)/.config
764        rm -f .config.old .config.cmd
765
766optimize-lib:
767ifneq ($(CONFIG_MUSL),y)
768        cp ${shell $(ARCH)-linux-gcc -print-file-name=libc.so.0} $(ARCH)-uclibc/target/lib/libc.so.0
769else
770        cp ${shell $(ARCH)-linux-gcc -print-file-name=libc.so} $(ARCH)-uclibc/target/lib/libc.so
771#       cp ${shell $(ARCH)-linux-gcc -print-file-name=libc.a} $(ARCH)-uclibc/target/lib/libc_pic.a
772endif
773ifneq ($(CONFIG_MUSL),y)
774        cp ${shell $(ARCH)-linux-gcc -print-file-name=ld-uClibc.so.0} $(ARCH)-uclibc/target/lib/ld-uClibc.so.0
775else
776        cd $(ARCH)-uclibc/target/lib && ln -sf libc.so ld-musl-mips-sf.so.1
777endif
778ifeq ($(CONFIG_LIBDL),y)
779        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libdl.so.0} $(ARCH)-uclibc/target/lib/libdl.so.0
780endif
781ifeq ($(CONFIG_LIBRT),y)
782        -cp ${shell $(ARCH)-linux-gcc -print-file-name=librt.so.0} $(ARCH)-uclibc/target/lib/librt.so.0
783endif
784ifeq ($(CONFIG_LIBATOMIC),y)
785        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libatomic.so.1} $(ARCH)-uclibc/target/lib/libatomic.so.1
786endif
787ifeq ($(CONFIG_SQUID),y)
788        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libatomic.so.1} $(ARCH)-uclibc/target/lib/libatomic.so.1
789endif
790ifeq ($(CONFIG_LIBNSL),y)
791        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libnsl.so.0} $(ARCH)-uclibc/target/lib/libnsl.so.0
792endif
793ifeq ($(CONFIG_LIBUTIL),y)
794        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libutil.so.0} $(ARCH)-uclibc/target/lib/libutil.so.0
795endif
796ifeq ($(CONFIG_LIBCPP),y)
797        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libstdc++.so.6} $(ARCH)-uclibc/target/lib/libstdc++.so.6
798endif
799ifeq ($(CONFIG_LIBCRYPT),y)
800        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libcrypt.so.0} $(ARCH)-uclibc/target/lib/libcrypt.so.0
801endif
802ifeq ($(CONFIG_LIBM),y)
803        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libm.so.0} $(ARCH)-uclibc/target/lib/libm.so.0
804endif
805ifeq ($(CONFIG_LIBRESOLV),y)
806        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libresolv.so.0} $(ARCH)-uclibc/target/lib/libresolv.so.0
807endif
808ifeq ($(CONFIG_LIBPTHREAD),y)
809        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libpthread.so.0} $(ARCH)-uclibc/target/lib/libpthread.so.0
810endif
811#       cp ${shell $(ARCH)-linux-gcc -print-file-name=libc.so.0} $(ARCH)-uclibc/target/lib/libc.so.0
812        -cp ${shell $(ARCH)-linux-gcc -print-file-name=libgcc_s.so.1} $(ARCH)-uclibc/target/lib/libgcc_s.so.1
813
814ifneq ($(CONFIG_NOOPT),y)
815        rm -rf /tmp/$(ARCHITECTURE)/mklibs-out
816        rm -f /tmp/$(ARCHITECTURE)/mklibs-progs
817        -mkdir -p /tmp/$(ARCHITECTURE)/
818        find $(TARGETDIR) -type f -perm /100 -exec \
819                file -r -N -F '' {} + | \
820                awk ' /executable.*dynamically/ { print $$1 }' > /tmp/$(ARCHITECTURE)/mklibs-progs
821
822        find $(TARGETDIR) -type f -name \*.so\* -exec \
823                file -r -N -F '' {} + | \
824                awk ' /shared object/ { print $$1 }' >> /tmp/$(ARCHITECTURE)/mklibs-progs
825
826        mkdir -p /tmp/$(ARCHITECTURE)/mklibs-out
827ifneq ($(CONFIG_MUSL),y)
828        mklibs -D \
829                -d /tmp/$(ARCHITECTURE)/mklibs-out \
830                --sysroot $(TARGETDIR) \
831                -L /lib \
832                -L /usr/lib \
833                --ldlib /lib/ld-uClibc.so.0 \
834                --target $(ARCH)-linux-uclibc \
835                `cat /tmp/$(ARCHITECTURE)/mklibs-progs` 2>&1
836else
837        mklibs -D \
838                -d /tmp/$(ARCHITECTURE)/mklibs-out \
839                --sysroot $(TARGETDIR) \
840                -L /lib \
841                -L /usr/lib \
842                --ldlib /lib/ld-musl-mips-sf.so.1 \
843                --target $(ARCH)-linux-uclibc \
844                `cat /tmp/$(ARCHITECTURE)/mklibs-progs` 2>&1
845
846endif
847
848        cp /tmp/$(ARCHITECTURE)/mklibs-out/* $(TARGETDIR)/lib
849else
850#       cp ${shell $(ARCH)-linux-gcc -print-file-name=libc.so.0} $(ARCH)-uclibc/target/lib/libc.so.0
851#       cp ${shell $(ARCH)-linux-gcc -print-file-name=libuClibc-0.99.33.2.so}  $(ARCH)-uclibc/target/lib/libc.so.0
852#       relink-lib.sh \
853#               "$(ARCH)-linux-" \
854#               "${shell $(ARCH)-linux-gcc -print-file-name=libc_so.a}" \
855#               "${shell $(ARCH)-linux-gcc -print-file-name=libc_so.a}" \
856#               "$(ARCH)-uclibc/target/lib/libc.so.0" \
857#               -Wl,-init,__uClibc_init -Wl,-soname=libc.so.0 \
858#               ${shell $(ARCH)-linux-gcc -print-file-name=libgcc_s.so.1}
859
860ifneq ($(CONFIG_MUSL),y)
861
862        relink-lib.sh \
863                "$(ARCH)-linux-" \
864                "${shell $(ARCH)-linux-gcc -print-file-name=libcrypt.so}" \
865                "${shell $(ARCH)-linux-gcc -print-file-name=libcrypt_pic.a}" \
866                "$(ARCH)-uclibc/target/lib/libcrypt.so.0" \
867                ${shell $(ARCH)-linux-gcc -print-file-name=libgcc_s.so.1} \
868                -Wl,-soname=libcrypt.so.0
869
870        relink-lib.sh \
871                "$(ARCH)-linux-" \
872                "${shell $(ARCH)-linux-gcc -print-file-name=libm.so}" \
873                "${shell $(ARCH)-linux-gcc -print-file-name=libm_pic.a}" \
874                "$(ARCH)-uclibc/target/lib/libm.so.0" \
875                ${shell $(ARCH)-linux-gcc -print-file-name=libgcc_s.so.1} \
876                -Wl,-soname=libm.so.0
877
878        relink-lib.sh \
879                "$(ARCH)-linux-" \
880                "${shell $(ARCH)-linux-gcc -print-file-name=libpthread.so.0}" \
881                "${shell $(ARCH)-linux-gcc -print-file-name=libpthread_so.a}" \
882                "$(ARCH)-uclibc/target/lib/libpthread.so.0" \
883                -Wl,-z,nodelete,-z,initfirst,-init=__pthread_initialize_minimal_internal \
884                ${shell $(ARCH)-linux-gcc -print-file-name=libgcc_s.so.1} \
885                -Wl,-soname=libpthread.so.0
886endif
887endif
888
889        rm -f $(TARGETDIR)/lib/*.a
890        rm -f $(TARGETDIR)/lib/*.map
891#       cp lib.$(ARCH)/libresolv.so.0 $(TARGETDIR)/lib
892#       cp lib.$(ARCH)/libgcc_s.so.1 $(TARGETDIR)/lib
893
894install package: clean_target $(filter-out lib.$(ARCH)-install,$(obj-install)) $(LINUXDIR)/.config
895        install -d $(TARGETDIR)
896        install -d $(ARCH)-uclibc/modules
897        for dir in $(wildcard $(patsubst %,$(INSTALLDIR)/%,$(obj-y))) ; do \
898            (cd $${dir} && tar cpf - .) | (cd $(TARGETDIR) && tar xpf -) \
899        done
900        for dir in $(wildcard $(patsubst %,%,$(obj-m))) ; do \
901            (cd $(INSTALLDIR)/$${dir} && tar -cvvzf $(TOP)/$(ARCH)-uclibc/modules/$${dir}.tar.gz .) \
902        done
903        mkdir -p $(ARCH)-uclibc/target/etc/config
904        mkdir -p $(ARCH)-uclibc/target/etc/kaid
905        mkdir -p $(ARCH)-uclibc/target/etc/langpack
906        cp ./opt/bin/ipkg $(ARCH)-uclibc/target/bin
907        cd  $(ARCH)-uclibc/target/lib
908        cp ./opt/etc/preinit $(ARCH)-uclibc/target/etc
909        cp ./opt/etc/postinit $(ARCH)-uclibc/target/etc
910        cp ./opt/etc/ipkg.conf $(ARCH)-uclibc/target/etc
911        cp ./opt/etc/config/* $(ARCH)-uclibc/target/etc/config
912ifeq ($(CONFIG_HTTPD),y)
913        cp ./opt/usr/lib/smb.conf $(ARCH)-uclibc/target/usr/lib
914        ln -sf ../tmp/smbshare $(ARCH)-uclibc/target/www/smb
915endif
916ifeq ($(CONFIG_KAID),y)
917        cp kaid/kaid $(TARGETDIR)/usr/sbin
918endif
919ifeq ($(CONFIG_RC),y)
920        mv $(TARGETDIR)/usr/lib/services.so $(TARGETDIR)/lib
921endif
922
923        # optimize the crypto library by removing unneeded symbols
924        #[ ! -d libcrypto ] || $(MAKE) -C libcrypto optimize
925        #[ ! -d libcrypto ] || $(MAKE) -C libcrypto optimize
926        # Install (and possibly optimize) C library
927
928        # optimize the others library by removing unneeded symbols
929        $(MAKE) -f Makefile.pb42 optimize-lib
930        # Install modules into filesystem
931        if grep -q "CONFIG_MODULES=y" $(LINUXDIR)/.config ; then \
932            $(MAKE) -C $(LINUXDIR) modules_install DEPMOD=/bin/true INSTALL_MOD_PATH=$(TARGETDIR) ; \
933        fi
934ifeq ($(CONFIG_MADWIFI),y)
935        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/net/wl
936endif
937#       mkdir -p $(TARGETDIR)/lib/modules/2.4.32/kernel/drivers/net/ctmisc
938#       cp ../wl/ctmisc/ctmisc.o $(TARGETDIR)/lib/modules/2.4.32/kernel/drivers/net/ctmisc
939        ##not used yet
940        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
941        #cp ./switch/switch-core.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
942        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
943#       cp ./viarhine/via-rhine.o $(TARGETDIR)/lib/modules/2.4.32/kernel/drivers/net
944
945        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
946        #cp ./switch/switch-adm.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
947        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
948        #cp ./switch/switch-robo.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/switch
949       
950        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc1/kernel/drivers/net/et
951        #cp ../et/linux/et.o $(TARGETDIR)/lib/modules/2.4.32-rc1/kernel/drivers/net/et
952       
953        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/et.4702
954        #cp ../et.4702/linux/4702et.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/et.4702
955        # robo switch
956        #mkdir -p $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/robo
957        #cp ../robo/linux/robo.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/robo
958
959        find $(TARGETDIR) -name "wl_*.o"  | xargs rm -rf
960        # quick n dirty - stuff Nikki's module where it belongs
961        #mkdir $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/adm6996
962#       if [ "$(CONFIG_MMC)" = "y" ] ; then \
963#       mkdir $(TARGETDIR)/lib/modules/2.4.32/kernel/fs/mmc ; \
964#       cp mmc/mmc.o $(TARGETDIR)/lib/modules/2.4.32/kernel/fs/mmc ; \
965#       fi ;
966ifneq ($(CONFIG_SAMBA),y)
967        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/cifs
968endif
969ifneq ($(CONFIG_JFFS2),y)
970        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/jffs2
971        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/lib/lzma
972endif
973ifneq ($(CONFIG_IPV6),y)
974        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/net/ipv6
975endif
976ifneq ($(CONFIG_BONDING),y)
977        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/net/bonding
978endif
979ifneq ($(CONFIG_USBIP),y)
980        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/staging/usbip
981endif
982ifneq ($(CONFIG_USB),y)
983        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/usb
984        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/net/usb
985        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/scsi
986        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/cdrom
987        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/ext2
988        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/ext3
989        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/isofs
990        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/udf
991        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/exportfs
992        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/xfs
993        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/jbd
994        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/fat
995        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/vfat
996        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/msdos
997        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/nls
998        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/mbcache.ko
999endif
1000ifneq ($(CONFIG_UQMI),y)
1001        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/net/usb/qmi_wwan.ko
1002endif
1003ifeq ($(CONFIG_3G_ONLY),y)
1004        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/nls
1005endif
1006ifneq ($(CONFIG_USB_ADVANCED),y)
1007        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/ext3
1008        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/ext4
1009        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/xfs
1010        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/btrfs
1011        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/jbd 
1012        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/jbd2
1013endif
1014
1015
1016#ifeq ($(CONFIG_MSSID),y)
1017#       cp adm6996.v24/adm6996.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/adm6996/adm6996.o
1018#else   
1019#       cp adm6996/adm6996.o $(TARGETDIR)/lib/modules/2.4.32-rc3/kernel/drivers/net/adm6996/adm6996.o
1020#endif
1021
1022        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/build
1023        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/source
1024       
1025        # Prepare filesystem
1026        cd $(TARGETDIR) && $(TOP)/misc/rootprep.sh
1027        # Make sure mksquashfs-2.0 is used
1028#       $(MAKE) -C $(LINUXDIR)/scripts/squashfs mksquashfs
1029        cd $(TARGETDIR)  &&  find . -iname "CVS" | xargs rm -rf
1030        cd $(TARGETDIR)  &&  find . -iname ".svn" | xargs rm -rf
1031#       cp viarhine/pci-scan.o $(TARGETDIR)/lib/modules/2.4.32/kernel/drivers/net/pci-scan.o
1032#       cp -f test/* $(TARGETDIR)/lib/modules/2.4.33-pre1/kernel/drivers/net
1033       
1034#       mknod $(TARGETDIR)/dev/cfa b 13 0
1035#       mknod $(TARGETDIR)/dev/cfa1 b 13 1
1036#       mknod $(TARGETDIR)/dev/cfa2 b 13 2
1037#       mknod $(TARGETDIR)/dev/cfa3 b 13 3
1038#       mknod $(TARGETDIR)/dev/cfa4 b 13 4
1039#       umount $(TARGETDIR)
1040        find $(TARGETDIR)/lib -name *.ko -exec mips-linux-strip --strip-unneeded --remove-section=.comment {} +         
1041        #e2fsck -y -f $(ARCH)-uclibc/root.fs
1042        -find $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel -name *.ko -exec mv {} $(TARGETDIR)/lib/modules/$(KERNELRELEASE) \;
1043        -find $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/net -name *.ko -exec mv {} $(TARGETDIR)/lib/modules/$(KERNELRELEASE) \;
1044        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel
1045        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/net
1046        #e2fsck -y -f $(ARCH)-uclibc/root.fs
1047        ./busybox/examples/depmod.pl -F $(LINUXDIR)/System.map -b $(ARCH)-uclibc/target/lib/modules
1048       
1049        #cd $(TARGETDIR)
1050#       tar --directory=$(TARGETDIR) --remove-files -cvvjf $(TARGETDIR)/etc/local.tar.bz2 usr/local
1051        rm -rf $(TARGETDIR)/usr/local
1052        mkdir $(TARGETDIR)/usr/local
1053#ifneq ($(CONFIG_NOOPT),y)
1054        export STRIP_KMOD="$(LINUXDIR)/scripts/strip-kmod.sh" && \
1055        export STRIP="sstrip" && \
1056        $(LINUXDIR)/scripts/rstrip.sh $(TARGETDIR)
1057#endif
1058ifeq ($(CONFIG_WRK54G),y)
1059        misc/makeDevs $(ARCH)-uclibc/target     
1060endif
1061        @true
1062#ifeq ($(CONFIG_LIBOPT),y)
1063#       cp -f lib.$(ARCH)/libpthread.so.0 $(TARGETDIR)/lib
1064#       sstrip/sstrip $(TARGETDIR)/lib/libpthread.so.0
1065#endif
1066
1067
1068        $(TOP)/../../tools/removewhitespace.sh $(TOP)/../../tools $(TARGETDIR)/etc/config
1069#ifeq ($(CONFIG_DLNA),y)
1070#       $(LINUXDIR)/scripts/squashfs/mksquashfs-lzma $(ARCH)-uclibc/target $(ARCH)-uclibc/root.fs -noappend -be -b 262144
1071#else
1072        $(LINUXDIR)/scripts/squashfs/mksquashfs4 $(ARCH)-uclibc/target $(ARCH)-uclibc/root.fs -comp xz -nopad  -root-owned -noappend
1073
1074#       $(LINUXDIR)/scripts/squashfs/mksquashfs-lzma $(ARCH)-uclibc/target $(ARCH)-uclibc/root.fs -noappend -be
1075#endif
1076        mkfs.jffs2 --pad --big-endian --squash -e 0x10000 -o $(ARCH)-uclibc/dd-wrt.jffs2 -d $(ARCH)-uclibc/target
1077       
1078        cp $(LINUXDIR)/vmlinux $(ARCH)-uclibc/vmlinux
1079
1080        cp $(ARCH)-uclibc/vmlinux $(ARCH)-uclibc/vmlinux.bak
1081        mips-linux-uclibc-objcopy -O binary $(strip-flags) -g $(ARCH)-uclibc/vmlinux $(ARCH)-uclibc/vmlinux.bin
1082        lzma e -lc1 -lp2 -pb2 -d25 $(ARCH)-uclibc/vmlinux.bin $(ARCH)-uclibc/vmlinux.lzma
1083        lzma e $(ARCH)-uclibc/vmlinux.bin $(ARCH)-uclibc/vmlinux.tpl
1084#       gzip -9 $(ARCH)-uclibc/vmlinux.bin $(ARCH)-uclibc/vmlinux.gz
1085        dd if=$(ARCH)-uclibc/vmlinux.lzma of=$(ARCH)-uclibc/vmlinux.bin.l7 bs=65536 conv=sync
1086
1087#       dd if=$(ARCH)-uclibc/vmlinux.gz of=$(ARCH)-uclibc/vmlinux.bin.gz bs=65536 conv=sync
1088ifeq ($(CONFIG_LSX),y)
1089        dd if=$(ARCH)-uclibc/vmlinux.lzma of=$(ARCH)-uclibc/vmlinux.lsx bs=65536 conv=sync
1090        cat $(ARCH)-uclibc/root.fs>>$(ARCH)-uclibc/vmlinux.lsx
1091endif
1092
1093ifeq ($(CONFIG_AP83),y)
1094        dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=4096 conv=sync
1095        cat $(ARCH)-uclibc/root.fs  >> $(ARCH)-uclibc/aligned.uimage
1096        ./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/ap83-firmware.bin $(ARCH)-uclibc/aligned.uimage
1097endif
1098ifeq ($(CONFIG_GL150),y)
1099        dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=4096 conv=sync
1100        cat $(ARCH)-uclibc/root.fs  >> $(ARCH)-uclibc/aligned.uimage
1101        ./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/ap96-firmware.bin $(ARCH)-uclibc/aligned.uimage
1102endif
1103ifeq ($(CONFIG_AP96),y)
1104ifeq ($(CONFIG_DIR825C1),y)
1105        dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=65536 conv=sync
1106else
1107        dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=4096 conv=sync
1108endif
1109        cat $(ARCH)-uclibc/root.fs  >> $(ARCH)-uclibc/aligned.uimage
1110        ./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/ap96-firmware.bin $(ARCH)-uclibc/aligned.uimage
1111endif
1112ifeq ($(CONFIG_AP94),y)
1113        dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=4096 conv=sync
1114        cat $(ARCH)-uclibc/root.fs  >> $(ARCH)-uclibc/aligned.uimage
1115ifeq ($(CONFIG_DIR825),y)
1116ifneq ($(CONFIG_TEW673GRU),y)
1117        -$(MAKE) -f Makefile.pb42 validate MAXIMUM_SIZE=6356992 EX_PATH=$(ARCH)-uclibc/aligned.uimage
1118endif
1119endif
1120        ./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/ap94-firmware.bin $(ARCH)-uclibc/aligned.uimage
1121endif
1122ifeq ($(CONFIG_ALFAAP94),y)
1123        dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=4096 conv=sync
1124        cat $(ARCH)-uclibc/root.fs  >> $(ARCH)-uclibc/aligned.uimage
1125        ./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/ap94-firmware.bin $(ARCH)-uclibc/aligned.uimage
1126endif
1127ifeq ($(CONFIG_WZRG300NH),y)
1128        tools/wzrg300nh/tftpfw $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg300nh-firmware.tftp
1129ifeq ($(CONFIG_DEFAULT_COUNTRYCODE),MULTI)
1130
1131        tools/bufenc/encryptRC4 WZR-HP-G300NH 1.74 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg300nh-firmware.enc
1132        tools/bufenc/encryptRC4 WZR-HP-G300NH 1.74 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg301nh-firmware.enc
1133ifeq ($(CONFIG_BUFFALO),y)
1134        tools/bufenc/mkfw -hw_ver=2 -hcrypt="Buffalo" "WZR-HP-G300NH" "WZR-HP-G300NH" "1.74" "1.01" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg300nh-firmware.enc $(ARCH)-uclibc/wzrg300nh-firmware_MULTI.enc
1135        tools/bufenc/mkfw -hw_ver=3 -hcrypt="Buffalo" "WZR-HP-G300NH" "WZR-HP-G300NH" "1.74" "3.01" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg301nh-firmware.enc $(ARCH)-uclibc/wzrg301nh-firmware_MULTI.enc
1136else
1137        tools/bufenc/mkfw-multi -hw_ver=2 -hcrypt="Buffalo" "WZR-HP-G300NH" "WZR-HP-G300NH" "1.74" "1.01" "US" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg300nh-firmware.enc $(ARCH)-uclibc/wzrg300nh-firmware_MULTI.enc
1138        tools/bufenc/mkfw-multi -hw_ver=3 -hcrypt="Buffalo" "WZR-HP-G300NH" "WZR-HP-G300NH" "1.74" "3.01" "US" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg301nh-firmware.enc $(ARCH)-uclibc/wzrg301nh-firmware_MULTI.enc
1139endif
1140else
1141ifeq ($(CONFIG_DEFAULT_COUNTRYCODE),EU-US)
1142#eu-us region
1143        tools/bufenc/encryptRC4 WZR-HP-G300NH 1.74 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg300nh-firmware.enc
1144        tools/bufenc/mkfw-eu-us -hw_ver=2 -hcrypt="Buffalo" "WZR-HP-G300NH" "WZR-HP-G300NH" "1.74" "1.01" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg300nh-firmware.enc $(ARCH)-uclibc/wzrg300nh-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1145        tools/bufenc/encryptRC4 WZR-HP-G300NH 1.74 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg301nh-firmware.enc
1146        tools/bufenc/mkfw-eu-us -hw_ver=3 -hcrypt="Buffalo" "WZR-HP-G300NH" "WZR-HP-G300NH" "1.74" "3.01" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg301nh-firmware.enc $(ARCH)-uclibc/wzrg301nh-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1147else
1148        tools/bufenc/encryptRC4 WZR-HP-G300NH 1.74 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg300nh-firmware.enc
1149        tools/bufenc/mkfw -hw_ver=2 -hcrypt="Buffalo" "WZR-HP-G300NH" "WZR-HP-G300NH" "1.74" "1.01" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg300nh-firmware.enc $(ARCH)-uclibc/wzrg300nh-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1150        tools/bufenc/encryptRC4 WZR-HP-G300NH 1.74 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg301nh-firmware.enc
1151        tools/bufenc/mkfw -hw_ver=3 -hcrypt="Buffalo" "WZR-HP-G300NH" "WZR-HP-G300NH" "1.74" "3.01" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg301nh-firmware.enc $(ARCH)-uclibc/wzrg301nh-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1152endif
1153endif
1154endif
1155
1156
1157
1158
1159ifeq ($(CONFIG_WZR450HP2),y)
1160        tools/wzrg300nh/tftpfw $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzr450hp2-firmware.tftp
1161ifeq ($(CONFIG_DEFAULT_COUNTRYCODE),MULTI)
1162ifeq ($(CONFIG_BUFFALO),y)
1163ifeq ($(CONFIG_BUFFALO_SA),y)
1164        tools/bufenc/encryptRC4 WZR-450HP2 1.86 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzr450hp2-firmware.enc
1165        tools/bufenc/mkfw -hw_ver=0 -productid=00000003  -hcrypt="Buffalo" "WZR-450HP2" "WZR-450HP2" "1.86" "2.08" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzr450hp2-firmware.enc $(ARCH)-uclibc/wzr450hp2-firmware_MULTI.enc
1166else
1167        tools/bufenc/encryptRC4 WZR-450HP2 1.86 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzr450hp2-firmware.enc
1168        tools/bufenc/mkfw -hw_ver=0 -productid=00000003  -hcrypt="Buffalo" "WZR-450HP2" "WZR-450HP2" "1.86" "2.08" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzr450hp2-firmware.enc $(ARCH)-uclibc/wzr450hp2-firmware_MULTI.enc
1169endif
1170else
1171        tools/bufenc/encryptRC4 WZR-450HP2 1.86 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzr450hp2-firmware.enc
1172        tools/bufenc/mkfw -hw_ver=0 -productid=00000003 -hcrypt="Buffalo" "WZR-450HP2" "WZR-450HP2" "1.86" "2.08" "US-EU-AP-TW-KR-CH-JP-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzr450hp2-firmware.enc $(ARCH)-uclibc/wzr450hp2-firmware_MULTI.enc
1173endif
1174else
1175ifeq ($(CONFIG_DEFAULT_COUNTRYCODE),EU-US)
1176#eu-us region
1177        tools/bufenc/encryptRC4 WZR-450HP2 1.74 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzr450hp2-firmware.enc
1178        tools/bufenc/mkfw-new -hw_ver=0 -productid=00000003 -hcrypt="Buffalo" "WZR-450HP2" "WZR-450HP2" "1.75" "1.01" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzr450hp2-firmware.enc $(ARCH)-uclibc/wzr450hp2-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1179else
1180        tools/bufenc/encryptRC4 WZR-450HP2 1.74 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzr450hp2-firmware.enc
1181        tools/bufenc/mkfw-new -hw_ver=0 -productid=00000003 -hcrypt="Buffalo" "WZR-450HP2" "WZR-450HP2" "1.75" "1.01" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzr450hp2-firmware.enc $(ARCH)-uclibc/wzr450hp2-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1182endif
1183endif
1184endif
1185
1186
1187
1188
1189ifeq ($(CONFIG_WZRG450),y)
1190        tools/wzrg300nh/tftpfw $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg450-firmware.tftp
1191ifeq ($(CONFIG_DEFAULT_COUNTRYCODE),MULTI)
1192ifeq ($(CONFIG_BUFFALO),y)
1193ifeq ($(CONFIG_BUFFALO_SA),y)
1194        tools/bufenc/encryptRC4 WZR-HP-G450H 1.86 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg450-firmware.enc
1195        tools/bufenc/mkfw -hw_ver=0 -productid=00000003  -hcrypt="Buffalo" "WZR-HP-G450H" "WZR-HP-G450H" "1.86" "2.08" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg450-firmware.enc $(ARCH)-uclibc/wzrg450-firmware_MULTI.enc
1196        #test
1197        #tools/bufenc/encryptRC4 WZR-HP-G450H 1.99 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg450-firmware.enc
1198        #tools/bufenc/mkfw -hw_ver=0 -productid=00000003  -hcrypt="Buffalo" "WZR-HP-G450H" "WZR-HP-G450H" "1.99" "2.08" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg450-firmware.enc $(ARCH)-uclibc/wzrg450-firmware_MULTI.enc
1199
1200        tools/bufenc/encryptRC4 BHR-4GRV 1.93 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/bhr4grv-firmware.enc
1201        tools/bufenc/mkfw -hw_ver=0 -productid=00000003 -hcrypt="Buffalo" "BHR-4GRV" "BHR-4GRV" "1.93" "2.08" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/bhr4grv-firmware.enc $(ARCH)-uclibc/bhr4grv-firmware_MULTI.enc
1202
1203else
1204        tools/bufenc/encryptRC4 WZR-HP-G450H 1.86 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg450-firmware.enc
1205        tools/bufenc/mkfw -hw_ver=0 -productid=00000003  -hcrypt="Buffalo" "WZR-HP-G450H" "WZR-HP-G450H" "1.86" "2.08" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg450-firmware.enc $(ARCH)-uclibc/wzrg450-firmware_MULTI.enc
1206
1207        tools/bufenc/encryptRC4 BHR-4GRV 1.93 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/bhr4grv-firmware.enc
1208        tools/bufenc/mkfw -hw_ver=0 -productid=00000003 -hcrypt="Buffalo" "BHR-4GRV" "BHR-4GRV" "1.93" "2.08" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/bhr4grv-firmware.enc $(ARCH)-uclibc/bhr4grv-firmware_MULTI.enc
1209
1210endif
1211else
1212        tools/bufenc/encryptRC4 WZR-HP-G450H 1.86 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg450-firmware.enc
1213        tools/bufenc/mkfw -hw_ver=0 -productid=00000003 -hcrypt="Buffalo" "WZR-HP-G450H" "WZR-HP-G450H" "1.86" "2.08" "US-EU-AP-TW-KR-CH-JP-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg450-firmware.enc $(ARCH)-uclibc/wzrg450-firmware_MULTI.enc
1214
1215        tools/bufenc/encryptRC4 BHR-4GRV 1.93 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/bhr4grv-firmware.enc
1216#       tools/bufenc/mkfw -hw_ver=0 -productid=00000003 -hcrypt="Buffalo" "BHR-4GRV" "BHR-4GRV" "1.93" "1.04" "JP" "jp" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/bhr4grv-firmware.enc $(ARCH)-uclibc/bhr4grv-firmware_MULTI.enc
1217        tools/bufenc/mkfw -hw_ver=0 -productid=00000003 -hcrypt="Buffalo" "BHR-4GRV" "BHR-4GRV" "1.93" "1.04" "US-EU-AP-TW-KR-CH-JP-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/bhr4grv-firmware.enc $(ARCH)-uclibc/bhr4grv-firmware_MULTI.enc
1218
1219endif
1220else
1221ifeq ($(CONFIG_DEFAULT_COUNTRYCODE),EU-US)
1222#eu-us region
1223        tools/bufenc/encryptRC4 WZR-HP-G450H 1.74 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg450-firmware.enc
1224        tools/bufenc/mkfw-new -hw_ver=0 -productid=00000003 -hcrypt="Buffalo" "WZR-HP-G450H" "WZR-HP-G450H" "1.75" "1.01" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg450-firmware.enc $(ARCH)-uclibc/wzrg450-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1225else
1226        tools/bufenc/encryptRC4 WZR-HP-G450H 1.74 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg450-firmware.enc
1227        tools/bufenc/mkfw-new -hw_ver=0 -productid=00000003 -hcrypt="Buffalo" "WZR-HP-G450H" "WZR-HP-G450H" "1.75" "1.01" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg450-firmware.enc $(ARCH)-uclibc/wzrg450-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1228        tools/bufenc/mkfw -hw_ver=0 -productid=00000003 -hcrypt="Buffalo" "BHR-4GRV" "BHR-4GRV" "1.93" "1.04" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/bhr4grv-firmware.enc $(ARCH)-uclibc/bhr4grv-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1229endif
1230endif
1231endif
1232
1233
1234
1235ifeq ($(CONFIG_WZRG300NH2),y)
1236ifeq ($(CONFIG_WZR300HP),y)
1237        tools/wzrg300nh/tftpfw $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzr300hp-firmware.tftp
1238ifeq ($(CONFIG_DEFAULT_COUNTRYCODE),MULTI)
1239        tools/bufenc/encryptRC4 WZR-300HP 1.82 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzr_300hp-firmware.enc
1240        tools/bufenc/mkfw -hw_ver=4 -hcrypt="Buffalo" "WZR-300HP" "WZR-300HP" "1.82" "1.06" "US-EU-AP-TW-KR-CH-RU-JP" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzr_300hp-firmware.enc $(ARCH)-uclibc/wzr_300hp-firmware_MULTI.enc
1241        tools/bufenc/encryptRC4 WZR-HP-G302H 1.81 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzr_g300nh2-firmware.enc
1242        tools/bufenc/mkfw -hw_ver=4 -hcrypt="Buffalo" "WZR-HP-G300NH2" "WZR-HP-G302H" "1.81" "1.06" "US-EU-AP-TW-KR-CH-RU-JP" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzr_g300nh2-firmware.enc $(ARCH)-uclibc/wzr_hp_g300nh2_to_wzr_300hp-firmware_MULTI.enc
1243endif
1244else
1245        tools/wzrg300nh/tftpfw $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg300nh2-firmware.tftp
1246ifeq ($(CONFIG_DEFAULT_COUNTRYCODE),MULTI)
1247ifeq ($(CONFIG_BUFFALO),y)
1248ifeq ($(CONFIG_BUFFALO_SA),y)
1249        tools/bufenc/encryptRC4 WZR-HP-G302H 1.81 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg300nh2-firmware.enc
1250        tools/bufenc/mkfw -hw_ver=4 -hcrypt="Buffalo" "WZR-HP-G300NH2" "WZR-HP-G302H" "1.81" "1.06" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg300nh2-firmware.enc $(ARCH)-uclibc/wzrg300nh2-firmware_MULTI.enc
1251        #wzr-300hp downgrade
1252        tools/bufenc/encryptRC4 WZR-300HP 1.82 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg300nh2-firmware.enc
1253        tools/bufenc/mkfw -hw_ver=4 -hcrypt="Buffalo" "WZR-300HP" "WZR-G300HP" "1.82" "2.08" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg300nh2-firmware.enc $(ARCH)-uclibc/wzr_300hp_to_wzr_hp_g300nh2-firmware_MULTI.enc
1254else
1255        tools/bufenc/encryptRC4 WZR-HP-G302H 1.80 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg300nh2-firmware.enc
1256        tools/bufenc/mkfw -hw_ver=4 -hcrypt="Buffalo" "WZR-HP-G300NH2" "WZR-HP-G302H" "1.81" "2.08" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg300nh2-firmware.enc $(ARCH)-uclibc/wzrg300nh2-firmware_MULTI.enc
1257endif
1258else
1259        tools/bufenc/encryptRC4 WZR-HP-G302H 1.80 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg300nh2-firmware.enc
1260        tools/bufenc/mkfw-multi -hw_ver=4 -hcrypt="Buffalo" "WZR-HP-G300NH2" "WZR-HP-G302H" "1.80" "2.08" "US" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg300nh2-firmware.enc $(ARCH)-uclibc/wzrg300nh2-firmware_MULTI.enc
1261        tools/bufenc/encryptRC4 WZR-300HP 1.82 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzr_300hp-firmware.enc
1262        tools/bufenc/mkfw-multi -hw_ver=4 -hcrypt="Buffalo" "WZR-300HP" "WZR-300HP" "1.82" "1.06" "US" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzr_300hp-firmware.enc $(ARCH)-uclibc/wzr_300hp-firmware_MULTI.enc
1263endif
1264else
1265ifeq ($(CONFIG_DEFAULT_COUNTRYCODE),EU-US)
1266#eu-us region
1267        tools/bufenc/encryptRC4 WZR-HP-G302H 1.80 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg300nh2-firmware.enc
1268        tools/bufenc/mkfw-eu-us -hw_ver=4 -hcrypt="Buffalo" "WZR-HP-G300NH2" "WZR-HP-G302H" "1.80" "2.08" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg300nh2-firmware.enc $(ARCH)-uclibc/wzrg300nh2-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1269        tools/bufenc/encryptRC4 WZR-300HP 1.82 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzr_300hp-firmware.enc
1270        tools/bufenc/mkfw-eu-us -hw_ver=4 -hcrypt="Buffalo" "WZR-300HP" "WZR-300HP" "1.82" "1.06" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzr_300hp-firmware.enc $(ARCH)-uclibc/wzr_300hp-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1271else
1272        tools/bufenc/encryptRC4 WZR-HP-G302H 1.80 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrg300nh2-firmware.enc
1273        tools/bufenc/mkfw -hw_ver=4 -hcrypt="Buffalo" "WZR-HP-G300NH2" "WZR-HP-G302H" "1.80" "2.08" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrg300nh2-firmware.enc $(ARCH)-uclibc/wzrg300nh2-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1274        tools/bufenc/encryptRC4 WZR-300HP 1.82 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzr_300hp-firmware.enc
1275        tools/bufenc/mkfw -hw_ver=4 -hcrypt="Buffalo" "WZR-300HP" "WZR-300HP" "1.82" "1.06" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzr_300hp-firmware.enc $(ARCH)-uclibc/wzr_300hp-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1276endif
1277endif
1278endif
1279endif
1280
1281ifeq ($(CONFIG_WZRHPAG300NH),y)
1282ifeq ($(CONFIG_WZR600DHP),y)
1283        tools/wzrg300nh/tftpfw $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzr_600dhp-firmware.tftp
1284ifeq ($(CONFIG_DEFAULT_COUNTRYCODE),MULTI)
1285        tools/bufenc/encryptRC4 WZR-600DHP 1.78 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzr_600dhp-firmware.enc
1286        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WZR-600DHP" "WZR-600DHP" "1.78" "3.01" "US-EU-AP-TW-KR-CH-RU-JP" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzr_600dhp-firmware.enc $(ARCH)-uclibc/wzr_600dhp-firmware_MULTI.enc
1287        #tools/bufenc/encryptRC4 WZR-600DHP 1.99 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzr_600dhp-firmware_1.99.enc
1288        #tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WZR-600DHP" "WZR-600DHP" "1.99" "3.01" "US-EU-AP-TW-KR-CH-RU-JP" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzr_600dhp-firmware_1.99.enc $(ARCH)-uclibc/wzr_600dhp-firmware_MULTI_1.99.enc
1289        tools/bufenc/encryptRC4 WZR-HP-AG300H 1.77 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrag300h-firmware.enc
1290        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WZR-HP-AG300H" "WZR-HP-AG300H" "1.77" "3.01" "US-EU-AP-TW-KR-CH-RU-JP" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrag300h-firmware.enc $(ARCH)-uclibc/wzr_ag300h_to_wzr_600dhp-firmware_MULTI.enc
1291endif
1292else
1293        tools/wzrg300nh/tftpfw $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrag300nh-firmware.tftp
1294ifeq ($(CONFIG_DEFAULT_COUNTRYCODE),MULTI)
1295ifeq ($(CONFIG_BUFFALO),y)
1296ifeq ($(CONFIG_BUFFALO_SA),y)
1297        #tools/bufenc/encryptRC4 WZR-HP-AG300H 1.99 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrag300h-firmware.enc
1298        #tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WZR-HP-AG300H" "WZR-HP-AG300H" "1.99" "3.01" "US-EU-AP-TW-KR-CH-RU-JP" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrag300h-firmware.enc $(ARCH)-uclibc/wzrag300h-firmware_MULTI.enc
1299        tools/bufenc/encryptRC4 WZR-HP-AG300H 1.77 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrag300h-firmware.enc
1300        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WZR-HP-AG300H" "WZR-HP-AG300H" "1.77" "3.01" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrag300h-firmware.enc $(ARCH)-uclibc/wzrag300h-firmware_MULTI.enc
1301        #wzr-600dhp downgrade
1302        tools/bufenc/encryptRC4 WZR-600DHP 1.77 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrag300h-firmware.enc
1303        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WZR-600DHP" "WZR-600DHP" "1.77" "3.01" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrag300h-firmware.enc $(ARCH)-uclibc/wzr_600dhp_to_wzr_hp_ag300h-firmware_MULTI.enc
1304else
1305        tools/bufenc/encryptRC4 WZR-HP-AG300H 1.74 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrag300h-firmware.enc
1306        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WZR-HP-AG300H" "WZR-HP-AG300H" "1.74" "3.01" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrag300h-firmware.enc $(ARCH)-uclibc/wzrag300h-firmware_MULTI.enc
1307endif
1308else
1309        tools/bufenc/encryptRC4 WZR-HP-AG300H 1.74 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrag300h-firmware.enc
1310        tools/bufenc/mkfw-multi -hw_ver=0 -hcrypt="Buffalo" "WZR-HP-AG300H" "WZR-HP-AG300H" "1.74" "3.01" "US" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrag300h-firmware.enc $(ARCH)-uclibc/wzrag300h-firmware_MULTI.enc
1311        tools/bufenc/encryptRC4 WZR-600DHP 1.99 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrag300h-firmware.enc
1312        tools/bufenc/mkfw-multi -hw_ver=0 -hcrypt="Buffalo" "WZR-600DHP" "WZR-600DHP" "1.99" "3.01" "US" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrag300h-firmware.enc $(ARCH)-uclibc/wzr_600dhp-firmware_MULTI.enc
1313endif
1314else
1315ifeq ($(CONFIG_DEFAULT_COUNTRYCODE),EU-US)
1316#eu-us region
1317        tools/bufenc/encryptRC4 WZR-HP-AG300H 1.71 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrag300h-firmware.enc
1318        tools/bufenc/mkfw-eu-us -hw_ver=0 -hcrypt="Buffalo" "WZR-HP-AG300H" "WZR-HP-AG300H" "1.74" "3.01" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrag300h-firmware.enc $(ARCH)-uclibc/wzrag300h-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1319else
1320        tools/bufenc/encryptRC4 WZR-HP-AG300H 1.71 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/wzrag300h-firmware.enc
1321        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WZR-HP-AG300H" "WZR-HP-AG300H" "1.74" "3.01" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/wzrag300h-firmware.enc $(ARCH)-uclibc/wzrag300h-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1322endif
1323endif
1324endif
1325endif
1326
1327ifeq ($(CONFIG_RSPRO),y)
1328        -./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/rspro-firmware.bin $(ARCH)-uclibc/vmlinux.lsx
1329        -tools/ubnt/src/mkfwimage -v RSPRO.ar7100pro.DD-WRT -o mips-uclibc/RSPRO.dd-wrt.bin -i tools/ubnt/rs-ddwrt.txt
1330else
1331
1332ifeq ($(CONFIG_RS),y)
1333        -./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/rs-firmware.bin $(ARCH)-uclibc/vmlinux.lsx
1334        -tools/ubnt/src/mkfwimage -v RSx.ar7100.DD-WRT -o mips-uclibc/RS.dd-wrt.bin -i tools/ubnt/rs-ddwrt.txt
1335
1336else
1337ifeq ($(CONFIG_LSX),y)
1338        -./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/lsx-firmware.bin $(ARCH)-uclibc/vmlinux.lsx
1339        -tools/ubnt/src/mkfwimage -v LS-SR71.ar7100.DD-WRT -o mips-uclibc/LSX.dd-wrt.bin -i tools/ubnt/lsx-ddwrt.txt
1340endif
1341ifeq ($(CONFIG_WP543),y)
1342        -./tools/compex/mkmylofw -B WP543 \
1343                -p0x30000:0x7d0000:alp:0x80060000 \
1344                -b0x30000:0x7d0000::$(ARCH)-uclibc/vmlinux.lsx  \
1345                mips-uclibc/wp543.img
1346endif
1347ifeq ($(CONFIG_WP546),y)
1348        -./tools/compex/mkmylofw -B WP546 \
1349                -p0x30000:0x7d0000:alp:0x80060000 \
1350                -b0x30000:0x7d0000::$(ARCH)-uclibc/vmlinux.lsx  \
1351                mips-uclibc/wp546.img
1352
1353endif
1354endif
1355endif
1356ifeq ($(CONFIG_WPE72),y)
1357        dd if=$(ARCH)-uclibc/vmlinux.lzma of=$(ARCH)-uclibc/vmlinux.lsx bs=65536 conv=sync
1358        cat $(ARCH)-uclibc/root.fs>>$(ARCH)-uclibc/vmlinux.lsx
1359        -./tools/compex/mkmylofw -B WP72E \
1360                -p0x30000:$(strip $(CONFIG_WPE72_SIZE)):alp:0x80060000 \
1361                -b0x30000:$(strip $(CONFIG_WPE72_SIZE))::$(ARCH)-uclibc/vmlinux.lsx     \
1362                mips-uclibc/wpe72.img
1363endif
1364ifeq ($(CONFIG_MMS344),y)
1365#       dd if=$(ARCH)-uclibc/vmlinux.lzma of=$(ARCH)-uclibc/vmlinux.lsx bs=65536 conv=sync
1366#       cat $(ARCH)-uclibc/root.fs>>$(ARCH)-uclibc/vmlinux.lsx
1367        -./tools/compex/mkmylofw -B MMS344HV \
1368                -p0x30000:0x7d0000:al:0x80060000 \
1369                -b0x30000:0x7d0000::$(ARCH)-uclibc/aligned.uimage       \
1370                mips-uclibc/mms344.img
1371
1372        -./tools/compex/mkmylofw -B DR342 \
1373                -p0x50000:0xfa0000:alp:0x80060000 \
1374                -b0x50000:0xfa0000::$(ARCH)-uclibc/vmlinux.lsx  \
1375                mips-uclibc/willy.img
1376endif
1377ifeq ($(CONFIG_UBNTM),y)
1378        dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=4096 conv=sync
1379        cat $(ARCH)-uclibc/root.fs  >> $(ARCH)-uclibc/aligned.uimage
1380        ./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/ar7420-firmware.bin $(ARCH)-uclibc/aligned.uimage
1381        -tools/ubnt/src/mkfwimage -v XM.ar7240.v6.0.0.133900.2000 -o $(ARCH)-uclibc/ubntm-dd-wrt.bin -i tools/ubnt/m-dd-wrt.txt
1382        -tools/ubnt/src/mkfwimage -v BZ.ar7240.v6.0.0.133900.2000 -o $(ARCH)-uclibc/ubntbz-dd-wrt.bin -i tools/ubnt/m-dd-wrt.txt
1383endif
1384
1385ifeq ($(CONFIG_UBNTXW),y)
1386        -tools/ubnt/src/mkfwimage -v XW.ar934x.v6.0.0.133900.2000 -o $(ARCH)-uclibc/ubntxw-dd-wrt.bin -i tools/ubnt/m-dd-wrt.txt
1387#       $(STAGING_DIR_HOST)/bin/mkfwimage2 -f 0x9f000000 \
1388#               -v $(UBNT_TYPE).$(UBNT_CHIP).v6.0.0-OpenWrt-$(REVISION) \
1389#               -p jffs2:0x50000:0xf60000:0:0:$@ \
1390#               -o $@.new
1391        -tools/ubnt/src/mkfwimage2 -f 0x9f000000 -v BZ.qca956x.v3.4.8.3291.150925.1315 -p kernel:0x60000:0xf60000:0:0:mips-uclibc/aligned.uimage -o $(ARCH)-uclibc/ubntbz2-dd-wrt.bin
1392endif
1393ifeq ($(CONFIG_DAP3410),y)
1394        tools/dap3410/makedap $(ARCH)-uclibc/root.uimage $(ARCH)-uclibc/root.fs $(ARCH)-uclibc/dap3410.bin DAP3410
1395        tools/dap3410/makedap $(ARCH)-uclibc/root.uimage $(ARCH)-uclibc/root.fs $(ARCH)-uclibc/dap3310.bin DAP3310
1396endif
1397ifeq ($(CONFIG_UBNTTI),y)
1398        dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=4096 conv=sync
1399        cat $(ARCH)-uclibc/root.fs  >> $(ARCH)-uclibc/aligned.uimage
1400        ./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/ar9344-firmware.bin $(ARCH)-uclibc/aligned.uimage
1401        tools/ubnt/src/mkfwimage -v TI.ar934x.v6.0.0.133900.2000 -o $(ARCH)-uclibc/ubntti-dd-wrt.bin -i tools/ubnt/m-dd-wrt.txt
1402endif
1403ifeq ($(CONFIG_JJAP93),y)
1404        dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=4096 conv=sync
1405        cat $(ARCH)-uclibc/root.fs  >> $(ARCH)-uclibc/aligned.uimage
1406        ./tools/trx_n  -m 30000000 -o $(ARCH)-uclibc/ap93-firmware.bin $(ARCH)-uclibc/aligned.uimage
1407endif
1408ifeq ($(CONFIG_JJAP005),y)
1409        dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=4096 conv=sync
1410        cat $(ARCH)-uclibc/root.fs  >> $(ARCH)-uclibc/aligned.uimage
1411        ./tools/trx_n  -m 30000000 -o $(ARCH)-uclibc/ap93-firmware.bin $(ARCH)-uclibc/aligned.uimage
1412endif
1413ifeq ($(CONFIG_JJAP501),y)
1414        dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=4096 conv=sync
1415        cat $(ARCH)-uclibc/root.fs  >> $(ARCH)-uclibc/aligned.uimage
1416        ./tools/trx_n  -m 30000000 -o $(ARCH)-uclibc/ap93-firmware.bin $(ARCH)-uclibc/aligned.uimage
1417endif
1418ifeq ($(CONFIG_AC722),y)
1419        dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=4096 conv=sync
1420        cat $(ARCH)-uclibc/root.fs  >> $(ARCH)-uclibc/aligned.uimage
1421        ./tools/trx_n  -m 30000000 -o $(ARCH)-uclibc/ap93-firmware.bin $(ARCH)-uclibc/aligned.uimage
1422endif
1423ifeq ($(CONFIG_AC622),y)
1424        dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=4096 conv=sync
1425        cat $(ARCH)-uclibc/root.fs  >> $(ARCH)-uclibc/aligned.uimage
1426        ./tools/trx_n  -m 30000000 -o $(ARCH)-uclibc/ap93-firmware.bin $(ARCH)-uclibc/aligned.uimage
1427endif
1428ifeq ($(CONFIG_WHRHPGN),y)
1429        dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=4096 conv=sync
1430        cat $(ARCH)-uclibc/root.fs  >> $(ARCH)-uclibc/aligned.uimage
1431        -./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/ap93-firmware.bin $(ARCH)-uclibc/aligned.uimage
1432        -tools/wzrg300nh/tftpfw $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-hp-gn-firmware.tftp
1433
1434ifeq ($(CONFIG_DEFAULT_COUNTRYCODE),MULTI)
1435#multi region
1436ifeq ($(CONFIG_BUFFALO_SA),y)
1437ifeq ($(CONFIG_WHR300HP),y)
1438        tools/bufenc/encryptRC4 WHR-300HP 1.85 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1439        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WHR-300HP" "WHR-300HP" "1.85" "1.01" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/whr_300hp-firmware_MULTI.enc
1440        tools/bufenc/encryptRC4 WHR-HP-G300N 1.84 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1441        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WHR-HP-G300N" "WHR-HP-G300N" "1.84" "1.01" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/whr_hp_g300n_to_whr_300hp-firmware_MULTI.enc
1442else
1443        tools/bufenc/encryptRC4 WHR-HP-G300N 1.84 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1444        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WHR-HP-G300N" "WHR-HP-G300N" "1.84" "1.01" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/whr-hp-g300n-firmware_MULTI.enc
1445        tools/bufenc/encryptRC4 WHR-HP-GN 1.84 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1446        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WHR-HP-GN" "WHR-HP-GN" "1.84" "1.01" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/whr-hp-gn-firmware_MULTI.enc
1447        tools/bufenc/encryptRC4 WHR-G301N 1.84 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1448        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WHR-G301N" "WHR-G301N" "1.84" "1.01" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/whr-g300n-firmware_MULTI.enc
1449        tools/bufenc/encryptRC4 WLAE-AG300N 1.84 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1450        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WLAE-AG300N" "WLAE-AG300N" "1.84" "1.01" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/wlae-ag300n-firmware_MULTI.enc
1451        #WHR-300HP downgrade
1452        tools/bufenc/encryptRC4 WHR-300HP 1.85 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1453        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WHR-300HP" "WHR-300HP" "1.85" "1.01" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/whr_300hp_to_whr_hp_g300n-firmware_MULTI.enc
1454endif
1455else
1456        tools/bufenc/encryptRC4 WHR-HP-G300N 1.82 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1457        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WHR-HP-G300N" "WHR-HP-G300N" "1.82" "1.01" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/whr-hp-g300n-firmware_MULTI.enc
1458        tools/bufenc/encryptRC4 WHR-HP-GN 1.82 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1459        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WHR-HP-GN" "WHR-HP-GN" "1.82" "1.01" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/whr-hp-gn-firmware_MULTI.enc
1460        tools/bufenc/encryptRC4 WHR-G301N 1.82 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1461        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WHR-G301N" "WHR-G301N" "1.82" "1.01" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/whr-g300n-firmware_MULTI.enc
1462        tools/bufenc/encryptRC4 WLAE-AG300N 1.82 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1463        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WLAE-AG300N" "WLAE-AG300N" "1.82" "1.01" "US-EU-AP-TW-KR-CH-RU" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/wlae-ag300n-firmware_MULTI.enc
1464endif
1465else
1466ifeq ($(CONFIG_DEFAULT_COUNTRYCODE),EU-US)
1467#eu-us region
1468        tools/bufenc/encryptRC4 WHR-HP-G300N 1.82 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1469        tools/bufenc/mkfw-eu-us -hw_ver=0 -hcrypt="Buffalo" "WHR-HP-G300N" "WHR-HP-G300N" "1.82" "1.01" "US" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/whr-hp-g300n-firmware_EU-US.enc
1470        tools/bufenc/encryptRC4 WHR-HP-GN 1.82 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1471        tools/bufenc/mkfw-eu-us -hw_ver=0 -hcrypt="Buffalo" "WHR-HP-GN" "WHR-HP-GN" "1.82" "1.01" "US" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/whr-hp-gn-firmware_EU-US.enc
1472        tools/bufenc/encryptRC4 WHR-G301N 1.82 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1473        tools/bufenc/mkfw-eu-us -hw_ver=0 -hcrypt="Buffalo" "WHR-G301N" "WHR-G301N" "1.82" "1.01" "US" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/whr-g300n-firmware_EU-US.enc
1474        tools/bufenc/encryptRC4 WLAE-AG300N 1.82 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1475        tools/bufenc/mkfw-eu-us -hw_ver=0 -hcrypt="Buffalo" "WLAE-AG300N" "WLAE-AG300N" "1.82" "1.01" "US" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/wlae-ag300n-firmware_EU-US.enc
1476else
1477        tools/bufenc/encryptRC4 WHR-HP-G300N 1.82 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1478        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WHR-HP-G300N" "WHR-HP-G300N" "1.82" "1.01" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/whr-hp-g300n-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1479        tools/bufenc/encryptRC4 WHR-HP-GN 1.82 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1480        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WHR-HP-GN" "WHR-HP-GN" "1.82" "1.01" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/whr-hp-gn-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1481        tools/bufenc/encryptRC4 WHR-G301N 1.82 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1482        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WHR-G301N" "WHR-G301N" "1.82" "1.01" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/whr-g300n-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1483        tools/bufenc/encryptRC4 WLAE-AG300N 1.82 Buffalo $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/whr-firmware.enc
1484        tools/bufenc/mkfw -hw_ver=0 -hcrypt="Buffalo" "WLAE-AG300N" "WLAE-AG300N" "1.82" "1.01" "$(CONFIG_DEFAULT_COUNTRYCODE)" "mlang8" "ath" "" 80041000 80200000 1 $(ARCH)-uclibc/whr-firmware.enc $(ARCH)-uclibc/wlae-ag300n-firmware_$(CONFIG_DEFAULT_COUNTRYCODE).enc
1485endif
1486endif
1487
1488endif
1489ifeq ($(CONFIG_DIR825),y)
1490        cp $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/dir825-uimage.bin
1491        cat tools/dir825.tag >> $(ARCH)-uclibc/dir825-uimage.bin
1492        cp $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/dir825ww-uimage.bin
1493        cat tools/dir825ww.tag >> $(ARCH)-uclibc/dir825ww-uimage.bin
1494        cp $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/dir825tw-uimage.bin
1495        cat tools/dir825tw.tag >> $(ARCH)-uclibc/dir825tw-uimage.bin
1496       
1497endif
1498ifeq ($(CONFIG_DIR866),y)
1499        cp $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/dir866-uimage.bin
1500        cat tools/dir866a1.tag >> $(ARCH)-uclibc/dir866-uimage.bin
1501endif
1502ifeq ($(CONFIG_DIR862),y)
1503        cp $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/dir862-uimage.bin
1504        cat tools/dir862a1.tag >> $(ARCH)-uclibc/dir862-uimage.bin
1505endif
1506ifeq ($(CONFIG_DIR825C1),y)
1507        cp $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/dir825c1-uimage.bin
1508        cat tools/dir825c1.tag >> $(ARCH)-uclibc/dir825c1-uimage.bin   
1509endif
1510ifeq ($(CONFIG_TEW673GRU),y)
1511        cp $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/tew673gru-uimage.bin
1512        cat tools/tew673gru.tag >> $(ARCH)-uclibc/tew673gru-uimage.bin
1513endif
1514ifeq ($(CONFIG_WNDR3700V4),y)
1515        ./tools/wndr3700/wndr3700v4 \
1516                $(ARCH)-uclibc/root.uimage \
1517                $(ARCH)-uclibc/root.wndr3700v4
1518
1519
1520        mkimage -A mips -O linux -T filesystem -C none \
1521                -a 0xbf070000 -e 0xbf070000 \
1522                -n 'wndr3700v4-V1.1.4.68' \
1523                -d $(ARCH)-uclibc/root.fs \
1524                $(ARCH)-uclibc/rootfs.uimage
1525
1526        ./tools/wndr3700/wndr3700v4 \
1527                $(ARCH)-uclibc/rootfs.uimage \
1528                $(ARCH)-uclibc/rootfs.wndr3700v4
1529       
1530        dd if=$(TOP)/$(ARCH)-uclibc/root.wndr3700v4 bs=$(shell expr $(shell expr $(shell expr $(shell expr $(shell expr 128 + $(shell du -b $(TOP)/$(ARCH)-uclibc/root.wndr3700v4 | awk {'print $$1'})) / 131072) + 1) \* 131072) - 64) conv=sync of=$(TOP)/$(ARCH)-uclibc/root.wndr3700v4.final
1531        export KERNEL_SIZE=$(shell du -b $(TOP)/$(ARCH)-uclibc/root.wndr3700v4.final | awk {'print $$1'})
1532        dd if=$(ARCH)-uclibc/rootfs.wndr3700v4 bs=64 count=1 >> $(ARCH)-uclibc/root.wndr3700v4.final
1533        ( \
1534            dd if=$(ARCH)-uclibc/root.wndr3700v4.final bs=$(shell du -b $(ARCH)-uclibc/root.wndr3700v4.final | awk {'print $$1'}) conv=sync; \
1535            dd if=$(ARCH)-uclibc/root.fs bs=64k; \
1536        ) > $(ARCH)-uclibc/aligned.wndr3700v4
1537        ./tools/wndr3700/mkdniimg -B WNDR3700v4 -v 1.1.4.68 -r "" -i $(ARCH)-uclibc/aligned.wndr3700v4 -o $(ARCH)-uclibc/wndr3700v4-factory.img -H "29763948+128+128"
1538        ./tools/trx_n  -m 40000000 -o$(ARCH)-uclibc/wndr3700v4-webflash.bin  $(ARCH)-uclibc/aligned.wndr3700v4
1539endif
1540
1541ifeq ($(CONFIG_WNR2000),y)
1542        mkdir -p $(ARCH)-uclibc/wnr2000v3/image
1543        ./tools/wndr3700/wnr2000v3 \
1544                $(ARCH)-uclibc/root.uimage \
1545                $(ARCH)-uclibc/wnr2000v3/image/uImage
1546
1547        ./tools/wndr3700/mksquashfs-lzma \
1548                $(ARCH)-uclibc/wnr2000v3 $(ARCH)-uclibc/kernel2000v3.squashfs \
1549                -nopad -noappend -root-owned -be
1550        -rm -rf $(ARCH)-uclibc/wnr2000v3
1551
1552        mkimage -A mips -O linux -T filesystem -C none \
1553                -a 0xbf070000 -e 0xbf070000 \
1554                -n 'wnr2000v3-V1.1.4.68' \
1555                -d $(ARCH)-uclibc/kernel2000v3.squashfs \
1556                $(ARCH)-uclibc/kernel2000v3.uimage
1557
1558        ./tools/wndr3700/wnr2000v3 \
1559                $(ARCH)-uclibc/kernel2000v3.uimage \
1560                $(ARCH)-uclibc/kernel2000v3.image       
1561
1562        ( \
1563                dd if=$(ARCH)-uclibc/kernel2000v3.image bs=1024k conv=sync; \
1564                dd if=$(ARCH)-uclibc/root.fs bs=64k; \
1565        ) > $(ARCH)-uclibc/wnr2000v3-uimage.bin
1566
1567        ./tools/wndr3700/mkdniimg -B wnr2000v3 -v 1.1.4.68 -r NA -i $(ARCH)-uclibc/wnr2000v3-uimage.bin -o $(ARCH)-uclibc/wnr2000v3-factory_NA.img
1568        ./tools/wndr3700/mkdniimg -B wnr2000v3 -v 1.1.4.68 -r "" -i $(ARCH)-uclibc/wnr2000v3-uimage.bin -o $(ARCH)-uclibc/wnr2000v3-factory_WW.img
1569        ./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/wnr2000v3-webflash.bin $(ARCH)-uclibc/wnr2000v3-uimage.bin
1570
1571endif
1572ifeq ($(CONFIG_WNR2200),y)
1573        mkdir -p $(ARCH)-uclibc/wnr2200/image
1574        ./tools/wndr3700/wnr2200 \
1575                $(ARCH)-uclibc/root.uimage \
1576                $(ARCH)-uclibc/wnr2200/image/uImage
1577
1578        ./tools/wndr3700/mksquashfs-lzma \
1579                $(ARCH)-uclibc/wnr2200 $(ARCH)-uclibc/kernel2200.squashfs \
1580                -nopad -noappend -root-owned -be
1581        -rm -rf $(ARCH)-uclibc/wnr2200
1582
1583        mkimage -A mips -O linux -T filesystem -C none \
1584                -a 0xbf070000 -e 0xbf070000 \
1585                -n 'wnr2200-V1.1.4.68' \
1586                -d $(ARCH)-uclibc/kernel2200.squashfs \
1587                $(ARCH)-uclibc/kernel2200.uimage
1588
1589        ./tools/wndr3700/wnr2200 \
1590                $(ARCH)-uclibc/kernel2200.uimage \
1591                $(ARCH)-uclibc/kernel2200.image
1592
1593        ( \
1594                dd if=$(ARCH)-uclibc/kernel2200.image bs=1024k conv=sync; \
1595                dd if=$(ARCH)-uclibc/root.fs bs=64k; \
1596        ) > $(ARCH)-uclibc/wnr2200-uimage.bin
1597
1598        ./tools/wndr3700/mkdniimg -B wnr2200 -v 1.1.4.68 -r NA -i $(ARCH)-uclibc/wnr2200-uimage.bin -o $(ARCH)-uclibc/wnr2200-factory_NA.img
1599        ./tools/wndr3700/mkdniimg -B wnr2200 -v 1.1.4.68 -r "" -i $(ARCH)-uclibc/wnr2200-uimage.bin -o $(ARCH)-uclibc/wnr2200-factory_WW.img
1600        ./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/wnr2200-webflash.bin $(ARCH)-uclibc/wnr2200-uimage.bin     
1601
1602endif
1603ifeq ($(CONFIG_WNDR3700),y)
1604        mkdir -p $(ARCH)-uclibc/wndr3700/image
1605        mkdir -p $(ARCH)-uclibc/wndr3700v2/image
1606        mkdir -p $(ARCH)-uclibc/wndr3800/image
1607        ./tools/wndr3700/wndr3700 \
1608                $(ARCH)-uclibc/root.uimage \
1609                $(ARCH)-uclibc/wndr3700/image/uImage
1610
1611        ./tools/wndr3700/wndr3700v2 \
1612                $(ARCH)-uclibc/root.uimage \
1613                $(ARCH)-uclibc/wndr3700v2/image/uImage
1614
1615        ./tools/wndr3700/wndr3700v2 \
1616                $(ARCH)-uclibc/root.uimage \
1617                $(ARCH)-uclibc/wndr3800/image/uImage
1618
1619        ./tools/wndr3700/mksquashfs-lzma \
1620                $(ARCH)-uclibc/wndr3700 $(ARCH)-uclibc/kernel.squashfs \
1621                -nopad -noappend -root-owned -be
1622
1623        ./tools/wndr3700/mksquashfs-lzma \
1624                $(ARCH)-uclibc/wndr3700v2 $(ARCH)-uclibc/kernelv2.squashfs \
1625                -nopad -noappend -root-owned -be
1626
1627        ./tools/wndr3700/mksquashfs-lzma \
1628                $(ARCH)-uclibc/wndr3800 $(ARCH)-uclibc/kernel3800.squashfs \
1629                -nopad -noappend -root-owned -be
1630
1631        -rm -rf $(ARCH)-uclibc/wndr3700
1632        -rm -rf $(ARCH)-uclibc/wndr3700v2
1633        -rm -rf $(ARCH)-uclibc/wndr3800
1634
1635        mkimage -A mips -O linux -T filesystem -C none \
1636                -a 0xbf070000 -e 0xbf070000 \
1637                -n 'WNDR3700-V1.0.4.68' \
1638                -d $(ARCH)-uclibc/kernel.squashfs \
1639                $(ARCH)-uclibc/kernel.uimage
1640
1641        mkimage -A mips -O linux -T filesystem -C none \
1642                -a 0xbf070000 -e 0xbf070000 \
1643                -n 'WNDR3700v2-V1.0.4.68' \
1644                -d $(ARCH)-uclibc/kernelv2.squashfs \
1645                $(ARCH)-uclibc/kernelv2.uimage
1646
1647        mkimage -A mips -O linux -T filesystem -C none \
1648                -a 0xbf070000 -e 0xbf070000 \
1649                -n 'WNDR3800-V1.0.4.68' \
1650                -d $(ARCH)-uclibc/kernel3800.squashfs \
1651                $(ARCH)-uclibc/kernel3800.uimage
1652
1653        ./tools/wndr3700/wndr3700v2 \
1654                $(ARCH)-uclibc/kernelv2.uimage \
1655                $(ARCH)-uclibc/kernelv2.image   
1656
1657        ./tools/wndr3700/wndr3700 \
1658                $(ARCH)-uclibc/kernel.uimage \
1659                $(ARCH)-uclibc/kernel.image     
1660
1661        ./tools/wndr3700/wndr3700v2 \
1662                $(ARCH)-uclibc/kernel3800.uimage \
1663                $(ARCH)-uclibc/kernel3800.image
1664        ( \
1665                dd if=$(ARCH)-uclibc/kernel.image bs=1024k conv=sync; \
1666                dd if=$(ARCH)-uclibc/root.fs bs=64k; \
1667        ) > $(ARCH)-uclibc/wndr3700-uimage.bin
1668
1669        ( \
1670                dd if=$(ARCH)-uclibc/kernelv2.image bs=1024k conv=sync; \
1671                dd if=$(ARCH)-uclibc/root.fs bs=64k; \
1672        ) > $(ARCH)-uclibc/wndr3700v2-uimage.bin
1673
1674        ( \
1675                dd if=$(ARCH)-uclibc/kernel3800.image bs=1024k conv=sync; \
1676                dd if=$(ARCH)-uclibc/root.fs bs=64k; \
1677        ) > $(ARCH)-uclibc/wndr3800-uimage.bin
1678
1679        ./tools/wndr3700/mkdniimg -B WNDR3700 -v 1.0.4.68 -r NA -i $(ARCH)-uclibc/wndr3700-uimage.bin -o $(ARCH)-uclibc/wndr3700-factory_NA.img
1680        ./tools/wndr3700/mkdniimg -B WNDR3700 -v 1.0.4.68 -r "" -i $(ARCH)-uclibc/wndr3700-uimage.bin -o $(ARCH)-uclibc/wndr3700-factory_WW.img
1681        ./tools/wndr3700/mkdniimg -B WNDR3700v2 -v 1.0.4.68 -r NA -i $(ARCH)-uclibc/wndr3700v2-uimage.bin -o $(ARCH)-uclibc/wndr3700v2-factory_NA.img
1682        ./tools/wndr3700/mkdniimg -B WNDR3700v2 -v 1.0.4.68 -r "" -i $(ARCH)-uclibc/wndr3700v2-uimage.bin -o $(ARCH)-uclibc/wndr3700v2-factory_WW.img
1683        ./tools/wndr3700/mkdniimg -B WNDR3800 -v 1.0.4.68 -r NA -i $(ARCH)-uclibc/wndr3800-uimage.bin -o $(ARCH)-uclibc/wndr3800-factory_NA.img
1684        ./tools/wndr3700/mkdniimg -B WNDR3800 -v 1.0.4.68 -r "" -i $(ARCH)-uclibc/wndr3800-uimage.bin -o $(ARCH)-uclibc/wndr3800-factory_WW.img
1685        ./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/wndr3700-webflash.bin $(ARCH)-uclibc/wndr3700-uimage.bin   
1686        ./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/wndr3700v2-webflash.bin $(ARCH)-uclibc/wndr3700v2-uimage.bin       
1687        ./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/wndr3800-webflash.bin $(ARCH)-uclibc/wndr3800-uimage.bin   
1688endif
1689ifeq ($(CONFIG_TEW632BRP),y)
1690        cp $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/tew632brp-uimage.bin
1691        cat tools/tew632brp.tag >> $(ARCH)-uclibc/tew632brp-uimage.bin
1692       
1693endif
1694ifeq ($(CONFIG_TEW652BRP),y)
1695        cp $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/tew652brp-uimage.bin
1696        cat tools/tew652brp.tag >> $(ARCH)-uclibc/tew652brp-uimage.bin
1697       
1698endif
1699ifeq ($(CONFIG_DIR615C1),y)
1700        cp $(ARCH)-uclibc/aligned.uimage $(ARCH)-uclibc/dir615c1-uimage.bin
1701        cat tools/dir615c2.tag >> $(ARCH)-uclibc/dir615c1-uimage.bin
1702       
1703endif
1704ifeq ($(CONFIG_DIR632),y)
1705        dd if=$(ARCH)-uclibc/aligned.uimage of=$(ARCH)-uclibc/dir632-uimage.bin bs=7667712 conv=sync
1706        cat tools/dir632na.tag >> $(ARCH)-uclibc/dir632-uimage.bin
1707        ./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/dir632-firmware.bin $(ARCH)-uclibc/dir632-uimage.bin       
1708endif
1709ifeq ($(CONFIG_DIR615E),y)
1710        dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=4096 conv=sync
1711        cat $(ARCH)-uclibc/root.fs  >> $(ARCH)-uclibc/aligned.uimage
1712        dd if=$(ARCH)-uclibc/aligned.uimage of=$(ARCH)-uclibc/dir615e1-uimage.bin bs=3538944 conv=sync
1713        cat tools/dir615e1.tag >> $(ARCH)-uclibc/dir615e1-uimage.bin
1714        dd if=$(ARCH)-uclibc/aligned.uimage of=$(ARCH)-uclibc/dir615e3-uimage.bin bs=3538944 conv=sync
1715        cat tools/dir615e3.tag >> $(ARCH)-uclibc/dir615e3-uimage.bin
1716        dd if=$(ARCH)-uclibc/aligned.uimage of=$(ARCH)-uclibc/dir615e4-uimage.bin bs=3538944 conv=sync
1717        cat tools/dir615e4.tag >> $(ARCH)-uclibc/dir615e4-uimage.bin
1718        dd if=$(ARCH)-uclibc/aligned.uimage of=$(ARCH)-uclibc/dir601-uimage.bin bs=3735552 conv=sync
1719        cat tools/dir601.tag >> $(ARCH)-uclibc/dir601-uimage.bin
1720        ./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/ap93-firmware.bin $(ARCH)-uclibc/aligned.uimage   
1721endif
1722ifeq ($(CONFIG_DIR615I),y)
1723        dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/aligned.uimage bs=4096 conv=sync
1724        cat $(ARCH)-uclibc/root.fs  >> $(ARCH)-uclibc/aligned.uimage
1725        dd if=$(ARCH)-uclibc/aligned.uimage of=$(ARCH)-uclibc/dir615i1-uimage.bin bs=3801062 conv=sync
1726        dd if=$(ARCH)-uclibc/aligned.uimage of=$(ARCH)-uclibc/dir615i3-uimage.bin bs=3801062 conv=sync
1727        cat tools/dir615i1.tag >> $(ARCH)-uclibc/dir615i1-uimage.bin
1728        cat tools/dir615i3.tag >> $(ARCH)-uclibc/dir615i3-uimage.bin
1729endif
1730ifeq ($(CONFIG_WRT160NL),y)
1731        ./tools/wrt160nl/pad $(ARCH)-uclibc/root.uimage $(ARCH)-uclibc/aligned.uimage
1732        cat $(ARCH)-uclibc/root.fs  >> $(ARCH)-uclibc/aligned.uimage
1733        ./tools/wrt160nl/trx -m 40000000 -o $(ARCH)-uclibc/wrt160nl-firmware.trx -f $(ARCH)-uclibc/aligned.uimage
1734        ./tools/wrt160nl/trx -m 40000000 -o $(ARCH)-uclibc/e2100l-firmware.trx -f $(ARCH)-uclibc/aligned.uimage
1735        ./tools/wrt160nl/addpattern -B WRT160NL -v v1.00.20 -i $(ARCH)-uclibc/wrt160nl-firmware.trx -o $(ARCH)-uclibc/wrt160nl-firmware.bin -g
1736        ./tools/wrt160nl/addpattern -B E2100L -v v1.00.20 -i $(ARCH)-uclibc/e2100l-firmware.trx -o $(ARCH)-uclibc/e2100l-firmware.bin -g
1737endif
1738ifeq ($(CONFIG_TG2521),y)
1739        ./tools/zcom/makefirmware $(ARCH)-uclibc/zcom-firmware.img $(ARCH)-uclibc/root.uimage $(ARCH)-uclibc/root.fs TG2521
1740        dd if=$(ARCH)-uclibc/root.fs of=$(ARCH)-uclibc/root.zcom bs=6356992 conv=sync
1741        cat $(ARCH)-uclibc/root.uimage >> $(ARCH)-uclibc/root.zcom
1742        ./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/zcom-firmware.bin $(ARCH)-uclibc/root.zcom
1743endif
1744
1745ifeq ($(CONFIG_TEW824),y)
1746        dd if=$(ARCH)-uclibc/root.fs of=$(ARCH)-uclibc/root.tew824 bs=14876672 conv=sync
1747        cat $(ARCH)-uclibc/root.uimage >> $(ARCH)-uclibc/root.tew824
1748        cat tools/tew824.tag >> $(ARCH)-uclibc/root.tew824
1749        ./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/tew824-firmware.bin $(ARCH)-uclibc/root.tew824
1750endif
1751
1752ifeq ($(CONFIG_WR1043),y)
1753        make -C lzma-loader/pb42 clean
1754        make -C lzma-loader/pb42
1755        cp lzma-loader/pb42/loader.bin.gz $(ARCH)-uclibc/vmlinus.gzip
1756        ./tools/tplink/mktplinkfw -B TL-WR1043NDv1 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-firmware.bin
1757        ./tools/trx_n  -m 40000000 -o $(ARCH)-uclibc/ap83-firmware.bin mips-uclibc/tplink-firmware.bin
1758endif
1759
1760
1761ifeq ($(CONFIG_WR941),y)
1762        make -C lzma-loader/pb42 clean
1763        make -C lzma-loader/pb42
1764        cp lzma-loader/pb42/loader.bin.gz $(ARCH)-uclibc/vmlinus.gzip
1765        -./tools/tplink/mktplinkfw -B TL-WR941NDv2 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR941NDv2-firmware.bin
1766        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR941NDv2-firmware.bin mips-uclibc/tplink-WR941NDv2-firmware.bin
1767
1768        -./tools/tplink/mktplinkfw -B TL-WR841NDv3 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR841NDv3-firmware.bin
1769        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR841NDv3-firmware.bin mips-uclibc/tplink-WR841NDv3-firmware.bin
1770
1771        -./tools/tplink/mktplinkfw -B TL-WA901NDv2 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WA901NDv2-firmware.bin
1772        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WA901NDv2-firmware.bin mips-uclibc/tplink-WA901NDv2-firmware.bin
1773
1774endif
1775ifeq ($(CONFIG_WR741),y)
1776        make -C lzma-loader/pb42 clean
1777        make -C lzma-loader/pb42
1778        cp lzma-loader/pb42/loader.bin.gz $(ARCH)-uclibc/vmlinus.gzip
1779        -./tools/tplink/mktplinkfw -B TL-WR741NDv1 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR741NDv1-firmware.bin
1780        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR741NDv1-firmware.bin mips-uclibc/tplink-WR741NDv1-firmware.bin
1781
1782        -./tools/tplink/mktplinkfw -B AIP-W411 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/alfa-AIP-W411-firmware.bin
1783        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/AIP-W411-firmware.bin mips-uclibc/alfa-AIP-W411-firmware.bin
1784
1785        -./tools/tplink/mktplinkfw -B TL-WR741NDv4 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR741NDv4-firmware.bin
1786        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR741NDv4-firmware.bin mips-uclibc/tplink-WR741NDv4-firmware.bin
1787
1788        -./tools/tplink/mktplinkfw -B TL-MR3220v2 DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-MR3220v2-firmware.bin
1789        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/MR3220v2-firmware.bin mips-uclibc/tplink-MR3220v2-firmware.bin
1790
1791        -./tools/tplink/mktplinkfw -B TL-WR743NDv2 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR743NDv2-firmware.bin
1792        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR743NDv2-firmware.bin mips-uclibc/tplink-WR743NDv2-firmware.bin
1793
1794        -./tools/tplink/mktplinkfw -B TL-WR740NDv1 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR740NDv1-firmware.bin
1795        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR740NDv1-firmware.bin mips-uclibc/tplink-WR740NDv1-firmware.bin
1796
1797        -./tools/tplink/mktplinkfw -B TL-WR740NDv4 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR740NDv4-firmware.bin
1798        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR740NDv4-firmware.bin mips-uclibc/tplink-WR740NDv4-firmware.bin
1799
1800        -./tools/tplink/mktplinkfw -B TL-WR740NDv5 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR740NDv5-firmware.bin
1801        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR740NDv5-firmware.bin mips-uclibc/tplink-WR740NDv5-firmware.bin
1802
1803        -./tools/tplink/mktplinkfw -B TL-WR842NDv1 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR842NDv1-firmware.bin
1804        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR842NDv1-firmware.bin mips-uclibc/tplink-WR842NDv1-firmware.bin
1805
1806        -./tools/tplink/mktplinkfw -B TL-WR703Nv1 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR703Nv1-firmware.bin
1807        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR703Nv1-firmware.bin mips-uclibc/tplink-WR703Nv1-firmware.bin
1808
1809        -./tools/tplink/mktplinkfw -B TL-WA701NDv2 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WA701NDv2-firmware.bin
1810        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WA701NDv2-firmware.bin mips-uclibc/tplink-WA701NDv2-firmware.bin
1811
1812        -./tools/tplink/mktplinkfw -B TL-WR710Nv1 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR710Nv1-firmware.bin
1813        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR710Nv1-firmware.bin mips-uclibc/tplink-WR710Nv1-firmware.bin
1814
1815        -./tools/tplink/mktplinkfw -B TL-WR710Nv1 -u -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR710Nv1US-firmware.bin
1816        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR710Nv1US-firmware.bin mips-uclibc/tplink-WR710Nv1US-firmware.bin
1817
1818        -./tools/tplink/mktplinkfw -B TL-WR710Nv2 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR710Nv2-firmware.bin
1819        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR710Nv2-firmware.bin mips-uclibc/tplink-WR710Nv2-firmware.bin
1820
1821        -./tools/tplink/mktplinkfw -B TL-WR710Nv2.1 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR710Nv2.1-firmware.bin
1822        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR710Nv2.1-firmware.bin mips-uclibc/tplink-WR710Nv2.1-firmware.bin
1823
1824        -./tools/tplink/mktplinkfw -B TL-MR3020 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-MR3020-firmware.bin
1825        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/MR3020-firmware.bin mips-uclibc/tplink-MR3020-firmware.bin
1826
1827        -./tools/tplink/mktplinkfw -B TL-WR740NDv3 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR740NDv3-firmware.bin
1828        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR740NDv3-firmware.bin mips-uclibc/tplink-WR740NDv3-firmware.bin
1829
1830        -./tools/tplink/mktplinkfw -B TL-WR740NDv3WW -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR740NDv3ww-firmware.bin
1831        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR740NDv3ww-firmware.bin mips-uclibc/tplink-WR740NDv3ww-firmware.bin
1832
1833        -./tools/tplink/mktplinkfw -B TL-WR743NDv1 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR743NDv1-firmware.bin
1834        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR743NDv1-firmware.bin mips-uclibc/tplink-WR743NDv1-firmware.bin
1835
1836        -./tools/tplink/mktplinkfw -B TL-WR841NDv5 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR841NDv5-firmware.bin
1837        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR841NDv5-firmware.bin mips-uclibc/tplink-WR841NDv5-firmware.bin
1838
1839        -./tools/tplink/mktplinkfw -B TL-WR841NDv7 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR841NDv7-firmware.bin
1840        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR841NDv7-firmware.bin mips-uclibc/tplink-WR841NDv7-firmware.bin
1841
1842        -./tools/tplink/mktplinkfw -B WNRT627V1 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/planex-WNRT627V1-firmware.bin
1843        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WNRT627V1-firmware.bin mips-uclibc/planex-WNRT627V1-firmware.bin
1844
1845        -./tools/tplink/mktplinkfw -B TL-MR3420 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-MR3420-firmware.bin
1846        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/MR3420-firmware.bin mips-uclibc/tplink-MR3420-firmware.bin
1847
1848        -./tools/tplink/mktplinkfw -B TL-MR3220 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-MR3220-firmware.bin
1849        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/MR3220-firmware.bin mips-uclibc/tplink-MR3220-firmware.bin
1850
1851        -./tools/tplink/mktplinkfw -B RNX-N300RT -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/rosewill-RNX-N300RT-firmware.bin
1852        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/RNX-N300RT-firmware.bin mips-uclibc/rosewill-RNX-N300RT-firmware.bin
1853
1854        -./tools/tplink/mktplinkfw -B RNX-N150RT -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/rosewill-RNX-N150RT-firmware.bin
1855        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/RNX-N150RT-firmware.bin mips-uclibc/rosewill-RNX-N150RT-firmware.bin
1856
1857        -./tools/tplink/mktplinkfw -B TL-WR840Nv1 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR840Nv1-firmware.bin
1858        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR840Nv1-firmware.bin mips-uclibc/tplink-WR840Nv1-firmware.bin
1859
1860        -./tools/tplink/mktplinkfw -B TL-WR941NDv4 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR941NDv4-firmware.bin
1861        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR941NDv4-firmware.bin mips-uclibc/tplink-WR941NDv4-firmware.bin
1862
1863        -./tools/tplink/mktplinkfw -B TL-WA901NDv1 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WA901NDv1-firmware.bin
1864        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WA901NDv1-firmware.bin mips-uclibc/tplink-WA901NDv1-firmware.bin
1865
1866        -./tools/tplink/mktplinkfw -B TL-WA801NDv1 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WA801NDv1-firmware.bin
1867        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WA801NDv1-firmware.bin mips-uclibc/tplink-WA801NDv1-firmware.bin
1868
1869        -./tools/tplink/mktplinkfw -B TL-WA7510N -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinus.gzip -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WA7510N-firmware.bin
1870        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WA7510N-firmware.bin mips-uclibc/tplink-WA7510N-firmware.bin
1871endif
1872ifeq ($(CONFIG_WR841V8),y)
1873        -./tools/tplink/mktplinkfw -B TL-WR841NDv8 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR841NDv8-firmware.bin
1874        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR841NDv8-firmware.bin mips-uclibc/tplink-WR841NDv8-firmware.bin
1875
1876        -./tools/tplink/mktplinkfw -B TL-WA901NDv3 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WA901NDv3-firmware.bin
1877        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WA901NDv3-firmware.bin mips-uclibc/tplink-WA901NDv3-firmware.bin
1878endif
1879ifeq ($(CONFIG_WR841V9),y)
1880        -./tools/tplink/mktplinkfw -B TL-WR841NDv9 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR841NDv9-firmware.bin
1881        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR841NDv9-firmware.bin mips-uclibc/tplink-WR841NDv9-firmware.bin
1882
1883        -./tools/tplink/mktplinkfw -B TL-WR841NDv10 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR841NDv10-firmware.bin
1884        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR841NDv10-firmware.bin mips-uclibc/tplink-WR841NDv10-firmware.bin
1885
1886        -./tools/tplink/mktplinkfw -B TL-WR841NDv11 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR841NDv11-firmware.bin
1887        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR841NDv11-firmware.bin mips-uclibc/tplink-WR841NDv11-firmware.bin
1888
1889        -./tools/tplink/mktplinkfw -B TL-WR841NDv11 -u -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR841NDv11-firmwareUS.bin
1890        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR841NDv11-firmwareUS.bin mips-uclibc/tplink-WR841NDv11-firmwareUS.bin
1891       
1892        -./tools/tplink/mktplinkfw -B TL-WR841NDv12 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR841NDv12-firmware.bin
1893        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR841NDv12-firmware.bin mips-uclibc/tplink-WR841NDv12-firmware.bin
1894
1895        -./tools/tplink/mktplinkfw -B TL-WR841NDv12 -u -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR841NDv12-firmwareUS.bin
1896        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR841NDv12-firmwareUS.bin mips-uclibc/tplink-WR841NDv12-firmwareUS.bin
1897
1898endif
1899ifeq ($(CONFIG_WR941V6),y)
1900        -./tools/tplink/mktplinkfw -B TL-WR941NDv6 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR941NDv6-firmware.bin
1901        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR941NDv6-firmware.bin mips-uclibc/tplink-WR941NDv6-firmware.bin
1902endif
1903ifeq ($(CONFIG_WR842V2),y)
1904        -./tools/tplink/mktplinkfw -B TL-WR842NDv2 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-WR842NDv2-firmware.bin
1905        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/WR842NDv2-firmware.bin mips-uclibc/tplink-WR842NDv2-firmware.bin
1906endif
1907ifeq ($(CONFIG_WDR2543),y)
1908        -./tools/tplink/mktplinkfw -B TL-WDR2543 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-TL-WDR2543-firmware.bin -v 3.13.99
1909        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/TL-WDR2543-firmware.bin mips-uclibc/tplink-TL-WDR2543-firmware.bin
1910endif
1911ifeq ($(CONFIG_WDR4300),y)
1912        -./tools/tplink/mktplinkfw -B TL-WDR4300 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-TL-WDR4300-firmware.bin
1913        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/TL-WDR4300-firmware.bin mips-uclibc/tplink-TL-WDR4300-firmware.bin
1914
1915        -./tools/tplink/mktplinkfw -B TL-WDR4300 -u -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-TL-WDR4300_US-firmware.bin
1916        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/TL-WDR4300_US-firmware.bin mips-uclibc/tplink-TL-WDR4300_US-firmware.bin
1917
1918        -./tools/tplink/mktplinkfw -B TL-WDR4310 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-TL-WDR4310-firmware.bin
1919        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/TL-WDR4310-firmware.bin mips-uclibc/tplink-TL-WDR4310-firmware.bin
1920        -./tools/tplink/mktplinkfw -B TL-WDR3600 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-TL-WDR3600-firmware.bin
1921        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/TL-WDR3600-firmware.bin mips-uclibc/tplink-TL-WDR3600-firmware.bin
1922
1923        -./tools/tplink/mktplinkfw -B TL-WDR3600 -u -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-TL-WDR3600_US-firmware.bin
1924        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/TL-WDR3600_US-firmware.bin mips-uclibc/tplink-TL-WDR3600_US-firmware.bin
1925
1926        -./tools/tplink/mktplinkfw -B TL-WDR3500 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-TL-WDR3500-firmware.bin
1927        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/TL-WDR3500-firmware.bin mips-uclibc/tplink-TL-WDR3500-firmware.bin
1928
1929        -./tools/tplink/mktplinkfw -B TL-WDR3500 -u -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-TL-WDR3500_US-firmware.bin
1930        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/TL-WDR3500_US-firmware.bin mips-uclibc/tplink-TL-WDR3500_US-firmware.bin
1931endif
1932ifeq ($(CONFIG_WR1043V2),y)
1933        -./tools/tplink/mktplinkfw -B TL-WR1043NDv2 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-TL-WR1043V2-firmware.bin
1934        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/TL-WR1043V2-firmware.bin mips-uclibc/tplink-TL-WR1043V2-firmware.bin
1935
1936        -./tools/tplink/mktplinkfw -B TL-WR1043NDv3 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-TL-WR1043V3-firmware.bin
1937        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/TL-WR1043V3-firmware.bin mips-uclibc/tplink-TL-WR1043V3-firmware.bin
1938
1939        -./tools/tplink/mktplinkfw -B TL-WR1043NDv3 -u -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-TL-WR1043V3-firmwareUS.bin
1940        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/TL-WR1043V3-firmwareUS.bin mips-uclibc/tplink-TL-WR1043V3-firmwareUS.bin
1941
1942        -./tools/tplink/mktplinkfw -B ARCHER-C7v1 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-ARCHER-C7v1-firmware.bin
1943        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/ARCHER-C7v1-firmware.bin mips-uclibc/tplink-ARCHER-C7v1-firmware.bin
1944
1945        -./tools/tplink/mktplinkfw -B ARCHER-C7v2 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-ARCHER-C7v2-firmware.bin
1946        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/ARCHER-C7v2-firmware.bin mips-uclibc/tplink-ARCHER-C7v2-firmware.bin
1947
1948        -./tools/tplink/mktplinkfw -B ARCHER-C7v2Israel -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-ARCHER-C7v2-firmwareIL.bin
1949        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/ARCHER-C7v2-firmwareIL.bin mips-uclibc/tplink-ARCHER-C7v2-firmwareIL.bin
1950
1951        -./tools/tplink/mktplinkfw -B ARCHER-C7v1 -u -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-ARCHER-C7v1-firmwareUS.bin
1952        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/ARCHER-C7v1-firmwareUS.bin mips-uclibc/tplink-ARCHER-C7v1-firmwareUS.bin
1953
1954        -./tools/tplink/mktplinkfw -B ARCHER-C7v2 -u -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-ARCHER-C7v2-firmwareUS.bin
1955        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/ARCHER-C7v2-firmwareUS.bin mips-uclibc/tplink-ARCHER-C7v2-firmwareUS.bin
1956
1957        -./tools/tplink/mktplinkfw -B ARCHER-C5v1 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-ARCHER-C5v1-firmware.bin
1958        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/ARCHER-C5v1-firmware.bin mips-uclibc/tplink-ARCHER-C5v1-firmware.bin
1959
1960        -./tools/tplink/mktplinkfw -B ARCHER-C5v1 -u -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-ARCHER-C5v1-firmwareUS.bin
1961        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/ARCHER-C5v1-firmwareUS.bin mips-uclibc/tplink-ARCHER-C5v1-firmwareUS.bin
1962
1963        -./tools/tplink/mktplinkfw -B ARCHER-C5v1Israel -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-ARCHER-C5v1-firmwareIL.bin
1964        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/ARCHER-C5v1-firmwareIL.bin mips-uclibc/tplink-ARCHER-C5v1-firmwareIL.bin
1965
1966        -./tools/tplink/mktplinkfw -B TL-WDR4900v2 -N DD-WRT -V 24 -k $(ARCH)-uclibc/vmlinux.tpl -r $(ARCH)-uclibc/root.fs -o mips-uclibc/tplink-TL-WDR4900v2-firmware.bin
1967        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/TL-WDR4900v2-firmware.bin mips-uclibc/tplink-TL-WDR4900v2-firmware.bin
1968endif
1969ifeq ($(CONFIG_WRT400),y)
1970        dd if=$(ARCH)-uclibc/root.uimage of=$(ARCH)-uclibc/root.wrt400 bs=1048576 conv=sync
1971        ./tools/wrt400/wrt400 $(ARCH)-uclibc/root.wrt400 $(ARCH)-uclibc/root.fs $(ARCH)-uclibc/wrt400-firmware.bin
1972endif
1973ifeq ($(CONFIG_RB2011),y)
1974        rm -f $(LINUXDIR)/usr/initramfs_data.cpio.lzma
1975        rm -f $(LINUXDIR)/vmlinux
1976        rm -f $(LINUXDIR)/vmlinux.o
1977        make -f Makefile.pb42 kernel
1978endif
1979        make -C lzma-loader/relocate
1980        cp $(ARCH)-uclibc/vmlinus lzma-loader/relocate/vmlinus.bin.new
1981        rm -f lzma-loader/relocate/vmlinus.bin
1982        make -C lzma-loader/relocate vmlinus.bin
1983
1984        lzma e -lc1 -lp2 -pb2 -d25 lzma-loader/relocate/vmlinus.bin $(ARCH)-uclibc/vmlinux.seama
1985       
1986        ./tools/seama/packimgs -b 64 -o $(ARCH)-uclibc/raw-dir859.img -i $(ARCH)-uclibc/vmlinux.seama -i $(ARCH)-uclibc/root.fs 
1987        ./tools/seama/seama -i $(ARCH)-uclibc/raw-dir859.img -m dev=/dev/mtdblock/1 -m type=firmware
1988        ./tools/seama/seama -s $(ARCH)-uclibc/web-dir859.img -i $(ARCH)-uclibc/raw-dir859.img.seama -m signature=wrgac37_dlink.2013gui_dir859
1989        ./tools/seama/seama -d $(ARCH)-uclibc/web-dir859.img
1990        dd if=$(ARCH)-uclibc/web-dir859.img of=$(ARCH)-uclibc/webflash-dir859.img skip=52 iflag=skip_bytes
1991        ./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/webflash-dir859.trx $(ARCH)-uclibc/webflash-dir859.img
1992
1993
1994        ./tools/seama/packimgs -b 64 -o $(ARCH)-uclibc/raw-dir869.img -i $(ARCH)-uclibc/vmlinux.seama -i $(ARCH)-uclibc/root.fs 
1995        ./tools/seama/seama -i $(ARCH)-uclibc/raw-dir869.img -m dev=/dev/mtdblock/1 -m type=firmware
1996        ./tools/seama/seama -s $(ARCH)-uclibc/web-dir869.img -i $(ARCH)-uclibc/raw-dir869.img.seama -m signature=wrgac54_dlink.2015_dir869
1997        ./tools/seama/seama -d $(ARCH)-uclibc/web-dir869.img
1998        dd if=$(ARCH)-uclibc/web-dir869.img of=$(ARCH)-uclibc/webflash-dir869.img skip=48 iflag=skip_bytes
1999        ./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/webflash-dir869.trx $(ARCH)-uclibc/webflash-dir869.img
2000
2001
2002
2003
2004ifeq ($(CONFIG_DAP3662),y)
2005        cd tools/alpha_pack && ./packimgs -v -o $(TOP)/$(ARCH)-uclibc/raw.img -i $(TOP)/$(ARCH)-uclibc/vmlinux.lzma -i $(TOP)/$(ARCH)-uclibc/root.fs
2006        cd tools/alpha_pack && ./v2image -v -i $(TOP)/$(ARCH)-uclibc/raw.img -o $(TOP)/$(ARCH)-uclibc/web-dap3662.img -d /dev/mtdblock/1 -s wapac11_dkbs_dap3662 -c -b
2007        ./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/webflash-dap3662.trx $(ARCH)-uclibc/web-dap3662.img
2008endif
2009ifeq ($(CONFIG_DAP2660),y)
2010        cd tools/alpha_pack && ./packimgs -v -o $(TOP)/$(ARCH)-uclibc/raw.img -i $(TOP)/$(ARCH)-uclibc/vmlinux.lzma -i $(TOP)/$(ARCH)-uclibc/root.fs
2011        cd tools/alpha_pack && ./v2image -v -i $(TOP)/$(ARCH)-uclibc/raw.img -o $(TOP)/$(ARCH)-uclibc/web-dap2660.img -d /dev/mtdblock/1 -s wapac09_dkbs_dap2660 -c -b
2012        ./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/webflash-dap2660.trx $(ARCH)-uclibc/web-dap2660.img
2013endif
2014ifeq ($(CONFIG_DAP2230),y)
2015        cd tools/alpha_pack && ./packimgs -v -o $(TOP)/$(ARCH)-uclibc/raw.img -i $(TOP)/$(ARCH)-uclibc/vmlinux.lzma -i $(TOP)/$(ARCH)-uclibc/root.fs
2016        cd tools/alpha_pack && ./v2image -v -i $(TOP)/$(ARCH)-uclibc/raw.img -o $(TOP)/$(ARCH)-uclibc/web-dap2230.img -d /dev/mtdblock/1 -s wapn31_dkbs_dap2230 -c -b
2017        ./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/webflash-dap2230.trx $(ARCH)-uclibc/web-dap2230.img
2018endif
2019ifeq ($(CONFIG_DAP3320),y)
2020        cd tools/alpha_pack && ./packimgs -v -o $(TOP)/$(ARCH)-uclibc/raw.img -i $(TOP)/$(ARCH)-uclibc/vmlinux.lzma -i $(TOP)/$(ARCH)-uclibc/root.fs
2021        cd tools/alpha_pack && ./v2image -v -i $(TOP)/$(ARCH)-uclibc/raw.img -o $(TOP)/$(ARCH)-uclibc/web-dap3320.img -d /dev/mtdblock/1 -s wapn29_dkbs_dap3320 -c -b
2022        ./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/webflash-dap3320.trx $(ARCH)-uclibc/web-dap3320.img
2023endif
2024ifeq ($(CONFIG_DAP2330),y)
2025        cd tools/alpha_pack && ./packimgs -v -o $(TOP)/$(ARCH)-uclibc/raw.img -i $(TOP)/$(ARCH)-uclibc/vmlinux.lzma -i $(TOP)/$(ARCH)-uclibc/root.fs
2026        cd tools/alpha_pack && ./v2image -v -i $(TOP)/$(ARCH)-uclibc/raw.img -o $(TOP)/$(ARCH)-uclibc/web-dap2330.img -d /dev/mtdblock/1 -s wapn24_dkbs_dap2330 -c -b
2027        ./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/webflash-dap2330.trx $(ARCH)-uclibc/web-dap2330.img
2028endif
2029
2030include rules/all.mk
2031
2032.PHONY: all clean distclean mrproper install package
2033.PHONY: conf mconf oldconf kconf kmconf config menuconfig oldconfig
2034.PHONY: dummy fixkc libnet libpcap
2035
2036
2037
Note: See TracBrowser for help on using the repository browser.