source: src/router/Makefile.ipq806x @ 31667

Last change on this file since 31667 was 31667, checked in by brainslayer, 2 months ago

new squashfs

  • Property svn:executable set to *
File size: 24.3 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
20#
21# Paths
22#
23OPENSER_MODULES := sl tm rr maxfwd usrloc registrar dbtext textops exec auth auth_db nathelper
24OPENSER_MODULE_FILES := $(foreach module,$(OPENSER_MODULES),openser/modules/$(module)/$(module).so)
25OPENSSL_NO_CIPHERS:= no-idea no-md2 no-mdc2 no-rc5 no-sha0 no-rmd160 no-aes192
26OPENSSL_OPTIONS:= shared no-ec no-err no-fips no-hw no-krb5 no-threads zlib-dynamic
27
28# Source bases
29
30export PLATFORM LINUXDIR LIBDIR USRLIBDIR
31export TOP := $(shell pwd)
32export SRCBASE := $(shell (cd $(TOP)/.. && pwd -P))
33
34
35# Set the HAL directory if you have the HAL sources
36
37# Set the Atheros Rate Control directory if you have the proprietary rate control
38export ATH_RATE=ath_rate/sample
39
40#
41# Cross-compile environment variables
42#
43
44# Build platform
45export BUILD := i386-pc-linux-gnu
46export HOSTCC := gcc
47
48# uClibc wrapper
49export ARCH:=$(PLATFORM)
50ifeq ($(CONFIG_UCLIBC),y)
51export PLATFORM := $(PLATFORM)-uclibc
52endif
53
54
55export KERNELRELEASE = $(shell cat $(LINUXDIR)/include/config/kernel.release 2> /dev/null)
56
57
58#ifeq ($(PLATFORM),mipsel-uclibc)
59export CROSS_COMPILE := $(ARCH)-linux-uclibc-
60export CONFIGURE := ./configure $(ARCH)-linux --build=$(BUILD)
61export TOOLCHAIN := $(shell cd $(dir $(shell which $(CROSS_COMPILE)gcc))/.. && pwd -P)
62#endif
63
64
65export BASEOPT:=-Os
66
67
68#ifeq ($(ARCH),arm)
69#export COPTS:=$(BASEOPT) -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -fhonour-copts -msoft-float
70#export COPTS:=$(BASEOPT) -pipe -march=armv7-a -mtune=cortex-a9  -mfloat-abi=soft -fpic -fno-caller-saves
71export COPTS:=$(BASEOPT) -pipe -mcpu=cortex-a15 -mtune=cortex-a15 -mfpu=neon-vfpv4 -mfloat-abi=hard -fno-caller-saves
72#endif
73
74
75export CC := ccache $(CROSS_COMPILE)gcc
76export CXX := ccache $(CROSS_COMPILE)g++
77export AR := $(CROSS_COMPILE)ar
78export AS := $(CROSS_COMPILE)as
79export LD := $(CROSS_COMPILE)ld
80export NM := $(CROSS_COMPILE)nm
81export RANLIB := $(CROSS_COMPILE)ranlib
82export STRIP := $(CROSS_COMPILE)strip
83export SIZE := $(CROSS_COMPILE)size
84
85export CFLAGS := $(COPTS)
86
87#
88# Install and target directories
89#
90
91export PLATFORMDIR := $(TOP)/$(PLATFORM)
92export INSTALLDIR := $(PLATFORMDIR)/install
93export TARGETDIR := $(PLATFORMDIR)/target
94
95#
96# Configuration
97#
98CONFIG_IPTABLES=y
99CONFIG_MUSL=y
100CONFIG_NOOPT=y
101
102include rules/configs.mk
103
104obj-clean := $(foreach obj,$(obj-y) $(obj-n),$(obj)-clean)
105obj-install := $(foreach obj,$(obj-y),$(obj)-install)
106obj-distclean := $(foreach obj,$(obj-y) $(obj-n),$(obj)-distclean)
107
108all: install_headers build_date clean_target $(obj-y) $(LINUXDIR)/.config kernel
109
110build_date:
111        echo "#define BUILD_DATE \"$(shell date +%D)\"" > ../../opt/build.h
112        echo "CONFIG_MUSL=y" >> .config
113
114include kernel-features.mk
115
116kernel:
117        cp $(LINUXDIR)/.config_ipq806x $(LINUXDIR)/.config
118ifeq ($(CONFIG_R7500),y)
119        sed -i 's/\CONFIG_ARM_ATAG_DTB_COMPAT=y/# CONFIG_ARM_ATAG_DTB_COMPAT is not set/g' $(LINUXDIR)/.config
120endif
121ifeq ($(CONFIG_R7500v2),y)
122        sed -i 's/\CONFIG_ARM_ATAG_DTB_COMPAT=y/# CONFIG_ARM_ATAG_DTB_COMPAT is not set/g' $(LINUXDIR)/.config
123endif
124ifeq ($(CONFIG_R7800),y)
125        sed -i 's/\CONFIG_ARM_ATAG_DTB_COMPAT=y/# CONFIG_ARM_ATAG_DTB_COMPAT is not set/g' $(LINUXDIR)/.config
126endif
127ifeq ($(CONFIG_EA8500),y)
128        sed -i 's/\# CONFIG_ARM_ATAG_DTB_COMPAT is not set/CONFIG_ARM_ATAG_DTB_COMPAT=y/g' $(LINUXDIR)/.config
129        echo "CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND=y" >> $(LINUXDIR)/.config
130endif
131
132        $(kernelfeatures)
133        $(MAKE) -C $(LINUXDIR) oldconfig
134       
135        if ! grep -q "CONFIG_EMBEDDED_RAMDISK=y" $(LINUXDIR)/.config ; then \
136            $(MAKE) -j 4 -C $(LINUXDIR) zImage dtbs CROSS_COMPILE="ccache $(ARCH)-openwrt-linux-" ; \
137        fi
138        if grep -q "CONFIG_MODULES=y" $(LINUXDIR)/.config ; then \
139            $(MAKE) -j 4 -C $(LINUXDIR) modules CROSS_COMPILE="ccache $(ARCH)-openwrt-linux-" ; \
140        fi
141       
142
143       
144       
145        rm -rf $(TARGETDIR)/lib/modules
146        $(MAKE) -C $(LINUXDIR) modules_install DEPMOD=/bin/true INSTALL_MOD_PATH=$(TARGETDIR)
147        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/build
148        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/source
149
150        -$(MAKE) -f Makefile.ipq806x ath9k
151        -$(MAKE) -f Makefile.ipq806x ath9k-install
152        -$(MAKE) -f Makefile.ipq806x libutils
153        -$(MAKE) -f Makefile.ipq806x madwifi
154        -$(MAKE) -f Makefile.ipq806x madwifi-install
155        -$(MAKE) -f Makefile.ipq806x batman-adv
156        -$(MAKE) -f Makefile.ipq806x batman-adv-install
157        -$(MAKE) -f Makefile.ipq806x opendpi
158        -$(MAKE) -f Makefile.ipq806x opendpi-install
159#       -$(MAKE) -f Makefile.ipq806x uniwip-gpio
160#       -$(MAKE) -f Makefile.ipq806x uniwip-gpio-install
161
162
163        mkdir -p $(ARCH)-uclibc/target/usr/sbin/
164
165        mkdir -p $(ARCH)-uclibc/target/lib/crda
166
167#       cp $(TOP)/qtnhost/host/arm/qdpc-host.ko $(ARCH)-uclibc/target/lib/modules/$(KERNELRELEASE)/
168
169       
170        find $(ARCH)-uclibc/install $(ARCH)-uclibc/target  -name \*.ko | \
171                xargs $(ARCH)-linux-nm | \
172                awk '$$1 == "U" { print $$2 } ' | \
173                sort -u > $(LINUXDIR)/mod_symtab.txt
174        $(ARCH)-linux-nm -n $(LINUXDIR)/vmlinux.o | grep ' r __ksymtab' | sed -e 's,........ r __ksymtab_,,' > $(LINUXDIR)/kernel_symtab.txt
175        $(ARCH)-linux-nm -n $(LINUXDIR)/vmlinux.o | grep ' R __ksymtab' | sed -e 's,........ R __ksymtab_,,' >> $(LINUXDIR)/kernel_symtab.txt
176        grep -f $(LINUXDIR)/mod_symtab.txt $(LINUXDIR)/kernel_symtab.txt -F > $(LINUXDIR)/sym_include.txt
177        grep -vf $(LINUXDIR)/mod_symtab.txt $(LINUXDIR)/kernel_symtab.txt -F > $(LINUXDIR)/sym_exclude.txt
178        ( \
179                echo '#define SYMTAB_KEEP \'; \
180                cat $(LINUXDIR)/sym_include.txt | \
181                        awk '{print "KEEP(*(___ksymtab+" $$$$1 ")) \\" }'; \
182                echo; \
183                echo '#define SYMTAB_KEEP_GPL \'; \
184                cat $(LINUXDIR)/sym_include.txt | \
185                        awk '{print "KEEP(*(___ksymtab_gpl+" $$$$1 ")) \\" }'; \
186                echo; \
187                echo '#define SYMTAB_DISCARD \'; \
188                cat $(LINUXDIR)/sym_exclude.txt | \
189                        awk '{print "*(___ksymtab+" $$$$1 ") \\" }'; \
190                echo; \
191                echo '#define SYMTAB_DISCARD_GPL \'; \
192                cat $(LINUXDIR)/sym_exclude.txt | \
193                        awk '{print "*(___ksymtab_gpl+" $$$$1 ") \\" }'; \
194                echo; \
195        ) > $(LINUXDIR)/symtab.h
196        #rm -f $(LINUXDIR)/vmlinux
197        #$(MAKE) -j 4 -C $(LINUXDIR) zImage dtbs EXTRA_LDSFLAGS="-I$(LINUXDIR) -include symtab.h" CROSS_COMPILE="ccache $(ARCH)-openwrt-linux-"
198       
199
200
201
202
203install_headers:
204# important step, required for new kernels
205        -mkdir -p $(TOP)/kernel_headers/$(KERNELRELEASE)
206        $(MAKE) -C $(LINUXDIR) headers_install ARCH=arm INSTALL_HDR_PATH=$(TOP)/kernel_headers/$(KERNELRELEASE)
207
208       
209realclean: $(obj-clean)
210        rm -f .config.old .config.cmd
211        #umount $(TARGETDIR)
212        rm -rf $(INSTALLDIR)
213        rm -rf $(TARGETDIR)
214        rm -rf $(TARGETDIR)/*
215        -rm -rf $(ARCH)-uclibc/*
216
217       
218clean: rc-clean httpd-clean services-clean shared-clean libutils-clean nvram-clean madwifi-clean busybox-clean dnsmasq-clean iptables-clean pppd-clean iproute2-clean
219        rm -f .config.old .config.cmd
220        #umount $(TARGETDIR)
221        rm -rf $(INSTALLDIR)
222        rm -rf $(TARGETDIR)
223        rm -f $(TARGETDIR)/*
224        -rm -f $(ARCH)-uclibc/*
225
226clean_target:
227        rm -rf $(TARGETDIR)
228        rm -rf $(INSTALLDIR)
229
230distclean mrproper: $(obj-distclean) clean_target
231        rm -rf $(INSTALLDIR)
232        $(MAKE) -C $(LINUXDIR) distclean
233        $(MAKE) -C $(LINUXDIR)/arch/mips/bcm947xx/compressed clean
234        #rm -f $(PLATFORMDIR)/zImage $(PLATFORMDIR)/linux.bin
235        $(MAKE) -C config clean
236        rm -f .config $(LINUXDIR)/.config
237        rm -f .config.old .config.cmd
238
239optimize-lib:
240ifneq ($(CONFIG_MUSL),y)
241        cp ${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libc.so.0} $(ARCH)-uclibc/target/lib/libc.so.0
242else
243        cp ${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libc.so} $(ARCH)-uclibc/target/lib/libc.so
244endif
245ifneq ($(CONFIG_MUSL),y)
246        cp ${shell $(ARCH)-openwrt-linux-gcc -print-file-name=ld-uClibc.so.0} $(ARCH)-uclibc/target/lib/ld-uClibc.so.0
247else
248        cd $(ARCH)-uclibc/target/lib && ln -sf libc.so ld-musl-armhf.so.1
249endif
250        cp ${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libgcc_s.so.1} $(ARCH)-uclibc/target/lib/libgcc_s.so.1
251ifeq ($(CONFIG_LIBDL),y)
252        -cp ${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libdl.so.0} $(ARCH)-uclibc/target/lib/libdl.so.0
253endif
254ifeq ($(CONFIG_LIBRT),y)
255        -cp ${shell $(ARCH)-openwrt-linux-gcc -print-file-name=librt.so.0} $(ARCH)-uclibc/target/lib/librt.so.0
256endif
257ifeq ($(CONFIG_LIBNSL),y)
258        -cp ${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libnsl.so.0} $(ARCH)-uclibc/target/lib/libnsl.so.0
259endif
260ifeq ($(CONFIG_LIBUTIL),y)
261        -cp ${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libutil.so.0} $(ARCH)-uclibc/target/lib/libutil.so.0
262endif
263ifeq ($(CONFIG_LIBCPP),y)
264        -cp ${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libstdc++.so.6} $(ARCH)-uclibc/target/lib/libstdc++.so.6
265endif
266ifeq ($(CONFIG_LIBCRYPT),y)
267        -cp ${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libcrypt.so.0} $(ARCH)-uclibc/target/lib/libcrypt.so.0
268endif
269ifeq ($(CONFIG_LIBM),y)
270        -cp ${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libm.so.0} $(ARCH)-uclibc/target/lib/libm.so.0
271endif
272ifeq ($(CONFIG_LIBRESOLV),y)
273        -cp ${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libresolv.so.0} $(ARCH)-uclibc/target/lib/libresolv.so.0
274endif
275ifeq ($(CONFIG_LIBPTHREAD),y)
276        -cp ${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libpthread.so.0} $(ARCH)-uclibc/target/lib/libpthread.so.0
277endif
278ifeq ($(CONFIG_RELINK),y)
279ifneq ($(CONFIG_MUSL),y)
280        relink-lib.sh \
281                "$(ARCH)-linux-" \
282                "${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libc_so.a}" \
283                "${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libc_so.a}" \
284                "$(ARCH)-uclibc/target/lib/libc.so.0" \
285                -Wl,-init,__uClibc_init -Wl,-soname=libc.so.0 \
286                ${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libgcc_s.so.1}
287else
288        relink-lib.sh \
289                "$(ARCH)-linux-" \
290                "${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libc.a}" \
291                "${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libc.a}" \
292                "$(ARCH)-uclibc/target/lib/libc.so" \
293                -Wl,-init,__uClibc_init -Wl,-soname=libc.so \
294                ${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libgcc_s.so.1}
295endif
296
297        -relink-lib.sh \
298                "$(ARCH)-linux-" \
299                "${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libcrypt.so}" \
300                "${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libcrypt_pic.a}" \
301                "$(ARCH)-uclibc/target/lib/libcrypt.so.0" \
302                ${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libgcc_s.so.1} \
303                -Wl,-soname=libcrypt.so.0
304
305        -relink-lib.sh \
306                "$(ARCH)-linux-" \
307                "${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libm.so}" \
308                "${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libm_pic.a}" \
309                "$(ARCH)-uclibc/target/lib/libm.so.0" \
310                ${shell $(ARCH)-linux-gcc -print-file-name=libgcc_s.so.1} \
311                -Wl,-soname=libm.so.0
312
313        -relink-lib.sh \
314                "$(ARCH)-linux-" \
315                "${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libpthread.so.0}" \
316                "${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libpthread_so.a}" \
317                "$(ARCH)-uclibc/target/lib/libpthread.so.0" \
318                -Wl,-z,nodelete,-z,initfirst,-init=__pthread_initialize_minimal_internal \
319                ${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libgcc_s.so.1} \
320                -Wl,-soname=libpthread.so.0
321endif
322        cp ${shell $(ARCH)-openwrt-linux-gcc -print-file-name=libgcc_s.so.1} $(ARCH)-uclibc/target/lib/libgcc_s.so.1
323#       relink-lib.sh \
324#               "$(ARCH)-linux-" \
325#               "${shell $(ARCH)-linux-gcc -print-file-name=libgcc_s.so.1}" \
326#               "${shell $(ARCH)-linux-gcc -print-file-name=libgcc_pic.a}" \
327#               "$(ARCH)-uclibc/target/lib/libgcc_s.so.1" \
328#               -Wl,--version-script=${shell $(ARCH)-linux-gcc -print-file-name=libgcc.map} -Wl,-soname=libgcc_s.so.1
329
330
331
332ifneq ($(CONFIG_NOOPT),y)
333        rm -rf /tmp/$(ARCHITECTURE)/mklibs-out
334        rm -f /tmp/$(ARCHITECTURE)/mklibs-progs
335        -mkdir -p /tmp/$(ARCHITECTURE)/
336        find $(TARGETDIR) -type f -perm /100 -exec \
337                file -r -N -F '' {} + | \
338                awk ' /executable.*dynamically/ { print $$1 }' > /tmp/$(ARCHITECTURE)/mklibs-progs
339
340        find $(TARGETDIR) -type f -name \*.so\* -exec \
341                file -r -N -F '' {} + | \
342                awk ' /shared object/ { print $$1 }' >> /tmp/$(ARCHITECTURE)/mklibs-progs
343
344        mkdir -p /tmp/$(ARCHITECTURE)/mklibs-out
345ifneq ($(CONFIG_MUSL),y)
346        mklibs.py -D \
347                -d /tmp/$(ARCHITECTURE)/mklibs-out \
348                --sysroot $(TARGETDIR) \
349                -L /lib \
350                -L /usr/lib \
351                --ldlib /lib/ld-uClibc.so.0 \
352                --target $(ARCH)-linux-uclibc \
353                `cat /tmp/$(ARCHITECTURE)/mklibs-progs` 2>&1
354else
355        mklibs.py -D \
356                -d /tmp/$(ARCHITECTURE)/mklibs-out \
357                --sysroot $(TARGETDIR) \
358                -L /lib \
359                -L /usr/lib \
360                --ldlib /lib/ld-musl-armhf.so.1 \
361                --target $(ARCH)-linux-uclibc \
362                `cat /tmp/$(ARCHITECTURE)/mklibs-progs` 2>&1
363
364endif
365        cp /tmp/$(ARCHITECTURE)/mklibs-out/* $(TARGETDIR)/lib
366endif
367#       rm -f $(TARGETDIR)/lib/*.a
368#       rm -f $(TARGETDIR)/lib/*.map
369#       cp lib.$(ARCH)/libresolv.so.0 $(TARGETDIR)/lib
370#       cp lib.$(ARCH)/libgcc_s.so.1 $(TARGETDIR)/lib
371
372
373install package: clean_target $(filter-out lib.$(ARCH)-install,$(obj-install)) $(LINUXDIR)/.config
374        # Install binaries into target directory
375        install -d $(TARGETDIR)
376        for dir in $(wildcard $(patsubst %,$(INSTALLDIR)/%,$(obj-y))) ; do \
377            (cd $${dir} && tar cpf - .) | (cd $(TARGETDIR) && tar xpf -) \
378        done
379        mkdir -p $(ARCH)-uclibc/target/etc/config
380        mkdir -p $(ARCH)-uclibc/target/etc/kaid
381        mkdir -p $(ARCH)-uclibc/target/etc/langpack
382        cd  $(ARCH)-uclibc/target/lib
383        cp ./opt/etc/preinit $(ARCH)-uclibc/target/etc
384        cp ./opt/etc/postinit $(ARCH)-uclibc/target/etc
385        cp ./opt/etc/ipkg.conf $(ARCH)-uclibc/target/etc
386        cp ./opt/etc/config/* $(ARCH)-uclibc/target/etc/config
387        cp ./opt/usr/lib/smb.conf $(ARCH)-uclibc/target/usr/lib
388        # optimize the others library by removing unneeded symbols
389        $(MAKE) -f Makefile.ipq806x optimize-lib
390        # Install modules into filesystem
391        if grep -q "CONFIG_MODULES=y" $(LINUXDIR)/.config ; then \
392            $(MAKE) -C $(LINUXDIR) modules_install DEPMOD=/bin/true INSTALL_MOD_PATH=$(TARGETDIR) ; \
393        fi
394ifeq ($(CONFIG_MADWIFI),y)
395        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/drivers/net/wl
396endif
397
398
399ifneq ($(CONFIG_SAMBA),y)
400        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel/fs/cifs
401endif
402        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/build
403        rm -f $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/source
404        # Prepare filesystem
405        # Make sure mksquashfs-2.0 is used
406        cd $(TARGETDIR)  &&  find . -iname "CVS" | xargs rm -rf
407        cd $(TARGETDIR)  &&  find . -iname ".svn" | xargs rm -rf
408
409        find $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel -name *.ko -exec mv {} $(TARGETDIR)/lib/modules/$(KERNELRELEASE) \;
410        -find $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/net -name *.ko -exec mv {} $(TARGETDIR)/lib/modules/$(KERNELRELEASE) \;
411        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/kernel
412        rm -rf $(TARGETDIR)/lib/modules/$(KERNELRELEASE)/net
413        #e2fsck -y -f $(ARCH)-uclibc/root.fs
414        ./busybox/examples/depmod.pl -F $(LINUXDIR)/System.map -b $(ARCH)-uclibc/target/lib/modules
415#       tar --directory=$(TARGETDIR) --remove-files -cvvjf $(TARGETDIR)/etc/local.tar.bz2 usr/local
416        rm -rf $(TARGETDIR)/usr/local
417        mkdir $(TARGETDIR)/usr/local
418       
419       
420ifeq ($(CONFIG_KAID),y)
421        cp kaid/kaid $(TARGETDIR)/usr/sbin
422endif
423        mv $(TARGETDIR)/usr/lib/services.so $(TARGETDIR)/lib
424
425        export STRIP_KMOD="$(LINUXDIR)/scripts/strip-kmod.sh" && \
426        export STRIP="sstrip" && \
427        $(LINUXDIR)/scripts/rstrip.sh $(TARGETDIR)
428        cd $(TARGETDIR) && $(TOP)/misc/rootprep.sh
429        #mkdir $(TARGETDIR)/boot
430       
431       
432       
433        cp -fpR $(LINUXDIR)/arch/arm/boot/zImage $(ARCH)-uclibc/uImage;
434        -rm -rf $(ARCH)-uclibc/ipq806x;
435        -mkdir -p $(ARCH)-uclibc/ipq806x;
436        cp $(ARCH)-uclibc/uImage $(ARCH)-uclibc/ipq806x-R7500-uImage;
437        cp $(ARCH)-uclibc/uImage $(ARCH)-uclibc/ipq806x-R7500v2-uImage;
438        cp $(ARCH)-uclibc/uImage $(ARCH)-uclibc/ipq806x-R7800-uImage;
439        cp $(ARCH)-uclibc/uImage $(ARCH)-uclibc/ipq806x-TEW827-uImage;
440        cp $(ARCH)-uclibc/uImage $(ARCH)-uclibc/ipq806x-G10-uImage;
441        cp $(ARCH)-uclibc/uImage $(ARCH)-uclibc/ipq806x-EA8500-uImage;
442        cat $(LINUXDIR)/arch/arm/boot/dts/qcom-ipq8064-r7500.dtb >> $(ARCH)-uclibc/ipq806x-R7500-uImage;
443        cat $(LINUXDIR)/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dtb >> $(ARCH)-uclibc/ipq806x-R7500v2-uImage;
444        cat $(LINUXDIR)/arch/arm/boot/dts/qcom-ipq8065-r7800.dtb >> $(ARCH)-uclibc/ipq806x-R7800-uImage;
445        cat $(LINUXDIR)/arch/arm/boot/dts/qcom-ipq8064-tew827.dtb >> $(ARCH)-uclibc/ipq806x-TEW827-uImage;
446        cat $(LINUXDIR)/arch/arm/boot/dts/qcom-ipq8064-ea8500.dtb >> $(ARCH)-uclibc/ipq806x-EA8500-uImage;
447        cat $(LINUXDIR)/arch/arm/boot/dts/qcom-ipq8064-asrockg10.dtb >> $(ARCH)-uclibc/ipq806x-G10-uImage;
448       
449
450        $(LINUXDIR)/scripts/squashfs/mksquashfs4 $(ARCH)-uclibc/target $(ARCH)-uclibc/root.squashfs -comp xz -nopad  -root-owned -noappend -Xbcj arm
451#       $(LINUXDIR)/scripts/squashfs/mksquashfs-lzma $(ARCH)-uclibc/target $(ARCH)-uclibc/root.squashfs -noappend -root-owned -le
452       
453        ( dd if=$(ARCH)-uclibc/root.squashfs of=$(ARCH)-uclibc/root.squashfs.new bs=2k conv=sync; )
454
455        ./tools/r7500/mkimage -A arm -O linux -T filesystem -C none -a 0x42208000 -e 0x42208000 -n 'DD-WRT - Fakeroot' -s $(ARCH)-uclibc/rootfs.dummy
456       
457        ( dd if=$(ARCH)-uclibc/ipq806x-R7500-uImage of=$(ARCH)-uclibc/vmlinux-r7500.uImage.normal bs=2048k conv=sync; )
458       
459        ( dd if=$(ARCH)-uclibc/vmlinux-r7500.uImage.normal bs=2097023 count=1 conv=sync of=$(ARCH)-uclibc/vmlinux-r7500.uImage.new; )
460       
461        ( dd if=$(ARCH)-uclibc/ipq806x-R7500v2-uImage of=$(ARCH)-uclibc/vmlinux-r7500v2.uImage.normal bs=2176k conv=sync; )
462       
463        ( dd if=$(ARCH)-uclibc/vmlinux-r7500v2.uImage.normal bs=2228095 count=1 conv=sync of=$(ARCH)-uclibc/vmlinux-r7500v2.uImage.new; )
464       
465        ( dd if=$(ARCH)-uclibc/ipq806x-R7800-uImage of=$(ARCH)-uclibc/vmlinux-r7800.uImage.normal bs=2176k conv=sync; )
466       
467        ( dd if=$(ARCH)-uclibc/vmlinux-r7800.uImage.normal bs=2228095 count=1 conv=sync of=$(ARCH)-uclibc/vmlinux-r7800.uImage.new; )
468
469        ( dd if=$(ARCH)-uclibc/ipq806x-TEW827-uImage of=$(ARCH)-uclibc/vmlinux-TEW827.uImage.normal bs=2048k conv=sync; )
470       
471        ( dd if=$(ARCH)-uclibc/vmlinux-TEW827.uImage.normal bs=2097023 count=1 conv=sync of=$(ARCH)-uclibc/vmlinux-TEW827.uImage.new; )
472
473        ( dd if=$(ARCH)-uclibc/ipq806x-G10-uImage of=$(ARCH)-uclibc/vmlinux-G10.uImage.normal bs=2048k conv=sync; )
474       
475        ( dd if=$(ARCH)-uclibc/vmlinux-G10.uImage.normal bs=2097023 count=1 conv=sync of=$(ARCH)-uclibc/vmlinux-G10.uImage.new; )
476       
477
478        ( dd if=$(ARCH)-uclibc/ipq806x-EA8500-uImage of=$(ARCH)-uclibc/vmlinux-EA8500.uImage.normal bs=2048k conv=sync; )
479       
480        ( dd if=$(ARCH)-uclibc/vmlinux-EA8500.uImage.normal bs=2097023 count=1 conv=sync of=$(ARCH)-uclibc/vmlinux-EA8500.uImage.new; )
481
482        ./tools/r7500/mkimage -A arm -O linux -C none -T kernel -a 0x42208000 -e 0x42208000 -n 'Linux-3.18' -d $(ARCH)-uclibc/vmlinux-r7500.uImage.new $(ARCH)-uclibc/vmlinux-r7500.uImage.final
483       
484        ./tools/r7500/mkimage -A arm -O linux -C none -T kernel -a 0x42208000 -e 0x42208000 -n 'Linux-3.18' -d $(ARCH)-uclibc/vmlinux-r7500v2.uImage.new $(ARCH)-uclibc/vmlinux-r7500v2.uImage.final
485       
486        ./tools/r7500/mkimage -A arm -O linux -C none -T kernel -a 0x42208000 -e 0x42208000 -n 'Linux-3.18' -d $(ARCH)-uclibc/vmlinux-r7800.uImage.new $(ARCH)-uclibc/vmlinux-r7800.uImage.final
487
488        ./tools/r7500/mkimage -A arm -O linux -C none -T kernel -a 0x42208000 -e 0x42208000 -n 'Linux-3.18' -d $(ARCH)-uclibc/vmlinux-TEW827.uImage.new $(ARCH)-uclibc/vmlinux-TEW827.uImage.final
489
490        ./tools/r7500/mkimage -A arm -O linux -C none -T kernel -a 0x42208000 -e 0x42208000 -n 'Linux-3.18' -d $(ARCH)-uclibc/vmlinux-G10.uImage.new $(ARCH)-uclibc/vmlinux-G10.uImage.final
491       
492        ./tools/r7500/mkimage -A arm -O linux -C none -T kernel -a 0x42208000 -e 0x42208000 -n 'Linux-3.18' -d $(ARCH)-uclibc/vmlinux-EA8500.uImage.new $(ARCH)-uclibc/vmlinux-EA8500.uImage.final
493       
494        echo -ne '\xff' >> $(ARCH)-uclibc/vmlinux-r7500.uImage.final;
495        cat $(ARCH)-uclibc/rootfs.dummy >> $(ARCH)-uclibc/vmlinux-r7500.uImage.final;
496       
497        echo -ne '\xff' >> $(ARCH)-uclibc/vmlinux-r7500v2.uImage.final;
498        cat $(ARCH)-uclibc/rootfs.dummy >> $(ARCH)-uclibc/vmlinux-r7500v2.uImage.final;
499       
500        echo -ne '\xff' >> $(ARCH)-uclibc/vmlinux-r7800.uImage.final;
501        cat $(ARCH)-uclibc/rootfs.dummy >> $(ARCH)-uclibc/vmlinux-r7800.uImage.final;
502
503        echo -ne '\xff' >> $(ARCH)-uclibc/vmlinux-TEW827.uImage.final;
504        cat $(ARCH)-uclibc/rootfs.dummy >> $(ARCH)-uclibc/vmlinux-TEW827.uImage.final;
505
506        echo -ne '\xff' >> $(ARCH)-uclibc/vmlinux-G10.uImage.final;
507        cat $(ARCH)-uclibc/rootfs.dummy >> $(ARCH)-uclibc/vmlinux-G10.uImage.final;
508       
509        echo -ne '\xff' >> $(ARCH)-uclibc/vmlinux-EA8500.uImage.final;
510        cat $(ARCH)-uclibc/rootfs.dummy >> $(ARCH)-uclibc/vmlinux-EA8500.uImage.final;
511       
512       
513        ( dd if=$(ARCH)-uclibc/vmlinux-r7500.uImage.final bs=2048k conv=sync count=1; dd if=$(ARCH)-uclibc/root.squashfs.new bs=64k; ) > $(ARCH)-uclibc/ddwrt-R7500v1.bin
514       
515        ( dd if=$(ARCH)-uclibc/vmlinux-r7500v2.uImage.final bs=2176k conv=sync count=1; dd if=$(ARCH)-uclibc/root.squashfs.new bs=64k; ) > $(ARCH)-uclibc/ddwrt-R7500v2.bin
516       
517        ( dd if=$(ARCH)-uclibc/vmlinux-r7800.uImage.final bs=2176k conv=sync count=1; dd if=$(ARCH)-uclibc/root.squashfs.new bs=64k; ) > $(ARCH)-uclibc/ddwrt-R7800.bin
518
519        ( dd if=$(ARCH)-uclibc/vmlinux-TEW827.uImage.final bs=2048k conv=sync count=1; dd if=$(ARCH)-uclibc/root.squashfs.new bs=64k; ) > $(ARCH)-uclibc/ddwrt-TEW827.bin
520
521        ( dd if=$(ARCH)-uclibc/vmlinux-G10.uImage.final bs=2048k conv=sync count=1; dd if=$(ARCH)-uclibc/root.squashfs.new bs=64k; ) > $(ARCH)-uclibc/ddwrt-G10.bin
522       
523        ( dd if=$(ARCH)-uclibc/vmlinux-EA8500.uImage.final bs=3145728 conv=sync count=1; dd if=$(ARCH)-uclibc/root.squashfs.new bs=64k; ) > $(ARCH)-uclibc/ddwrt-EA8500.bin
524       
525        cp $(ARCH)-uclibc/ddwrt-EA8500.bin $(ARCH)-uclibc/ddwrt-EA8500-WW.bin
526        cat tools/ea8500/ea8500.tag >> $(ARCH)-uclibc/ddwrt-EA8500.bin
527        cp $(ARCH)-uclibc/ddwrt-EA8500.bin $(ARCH)-uclibc/EA8500-factory-to-ddwrt.img
528        cat tools/ea8500/ea8500WW.tag >> $(ARCH)-uclibc/ddwrt-EA8500-WW.bin
529        cp $(ARCH)-uclibc/ddwrt-EA8500-WW.bin $(ARCH)-uclibc/EA8500WW-factory-to-ddwrt.img
530       
531        #beware max image size is 24MB
532        ./tools/r7500/mkdniimg -B R7500 -v 1.0.0.94 -r "" -H "29764841+0+128+256+3x3+4x4" -i $(ARCH)-uclibc/ddwrt-R7500v1.bin -o $(ARCH)-uclibc/R7500v1-factory-to-ddwrt.img
533        #beware max image size is 24MB
534        ./tools/r7500/mkdniimg -B R7500v2 -v V1.0.2.4 -r "" -H "29764958+0+128+512+3x3+4x4" -i $(ARCH)-uclibc/ddwrt-R7500v2.bin -o $(ARCH)-uclibc/R7500v2-factory-to-ddwrt.img
535        #beware max image size is 29MB
536        ./tools/r7500/mkdniimg -B R7800 -v 1.0.2.05 -r "" -H "29764958+0+128+512+4x4+4x4+cascade" -i $(ARCH)-uclibc/ddwrt-R7800.bin -o $(ARCH)-uclibc/R7800-factory-to-ddwrt.img
537
538        ./tools/ubi/ubinize-image.sh --kernel $(ARCH)-uclibc/vmlinux-TEW827.uImage.final \
539                $(ARCH)-uclibc/root.squashfs.new \
540                $(ARCH)-uclibc/ddwrt-ipq806x-TEW827-squashfs-nand-factory.ubi \
541                -v -p 128KiB -m 2048 -s 512 -O 2048
542
543        ./tools/ubi/ubinize-image.sh --kernel $(ARCH)-uclibc/vmlinux-G10.uImage.final \
544                $(ARCH)-uclibc/root.squashfs.new \
545                $(ARCH)-uclibc/ddwrt-ipq806x-G10-squashfs-nand-factory.ubi \
546                -v -p 128KiB -m 2048 -s 512 -O 2048
547       
548        ./tools/ubi/ubinize-image.sh --kernel $(ARCH)-uclibc/vmlinux-EA8500.uImage.final \
549                $(ARCH)-uclibc/root.squashfs.new \
550                $(ARCH)-uclibc/ddwrt-ipq806x-EA8500-squashfs-nand-factory.ubi \
551                -v -p 128KiB -m 2048
552
553#       cd $(ARCH)-uclibc && ../tools/wrt1900ac/ubinize -v -m 2048 -p 128KiB -s 512 -O 2048 -o root.squashfs.ubi ubinize.cfg && cd ..
554
555#       dd if=$(ARCH)-uclibc/ddwrt-ipq806x-AP148-squashfs-nand-factory.ubi of=$(ARCH)-uclibc/ddwrt-ipq806x-AP148-squashfs-nand-factory-final.ubi bs=2M conv=sync
556        cp $(ARCH)-uclibc/ddwrt-ipq806x-TEW827-squashfs-nand-factory.ubi $(ARCH)-uclibc/ddwrt-tew827-squashfs-nand-factory.ubi
557
558        cp $(ARCH)-uclibc/ddwrt-ipq806x-G10-squashfs-nand-factory.ubi $(ARCH)-uclibc/ddwrt-g10-squashfs-nand-factory.ubi
559       
560        cp $(ARCH)-uclibc/ddwrt-ipq806x-EA8500-squashfs-nand-factory.ubi $(ARCH)-uclibc/ddwrt-ea8500-squashfs-nand-factory.ubi
561       
562
563        -./tools/trx_n -m 55000000 -o $(ARCH)-uclibc/ddwrt-netgear-R7500v1.bin $(ARCH)-uclibc/ddwrt-R7500v1.bin
564        -./tools/trx_n -m 55000000 -o $(ARCH)-uclibc/ddwrt-netgear-R7500v2.bin $(ARCH)-uclibc/ddwrt-R7500v2.bin
565        -./tools/trx_n -m 55000000 -o $(ARCH)-uclibc/ddwrt-netgear-R7800.bin $(ARCH)-uclibc/ddwrt-R7800.bin
566        -./tools/trx_n -m 55000000 -o $(ARCH)-uclibc/ddwrt-trendnet-tew827.bin $(ARCH)-uclibc/ddwrt-ipq806x-TEW827-squashfs-nand-factory.ubi
567        -./tools/trx_n -m 55000000 -o $(ARCH)-uclibc/ddwrt-asrock-g10.bin $(ARCH)-uclibc/ddwrt-ipq806x-G10-squashfs-nand-factory.ubi
568        -./tools/trx_n -m 40000000 -o $(ARCH)-uclibc/ddwrt-Linksys-EA8500.bin $(ARCH)-uclibc/ddwrt-EA8500.bin
569       
570        cd tools && ./r7500/mkimage -f sysupgrade-ubi.its $(TOP)/$(ARCH)-uclibc/tew827-upgrade.bin
571        cat tools/tew827.tag >> $(ARCH)-uclibc/tew827-upgrade.bin
572
573        tools/cvimg/cvimg csys $(ARCH)-uclibc/ddwrt-ipq806x-G10-squashfs-nand-factory.ubi $(ARCH)-uclibc/ddwrt-g10.img 0x1200000 0x70000 RN67
574
575
576
577
578include rules/all.mk
579
580.PHONY: all clean distclean mrproper install package
581.PHONY: conf mconf oldconf kconf kmconf config menuconfig oldconfig
582.PHONY: dummy fixkc libnet libpcap
583
584
585
Note: See TracBrowser for help on using the repository browser.