Oleg always post-include nmap binary in its firmwares.
So you can never expect the same binary. Even if nmap would not be included, binaries would not be the same becaus of possible difference in direcory tree traversing during LZMA compression.
Hi,
Tried to build a Cross-Compiling platform to compile the firmware:
-rw-r--r-- 1 root root 273177367 May 29 2005 GPL_1927.zip
-rw-r--r-- 1 root root 2015762 Jun 24 2005 hndtools-mipsel-uclibc-3.2.3-full.tar.bz2
-rw-r--r-- 1 root root 16200754 Jun 11 18:51 wl500g-1.9.2.7-7e.tar.bz2
Files that I got from from oleg's Page http://wl500g.dyndns.org/
Using
No error but the result files are different from OLEG'sCode:#!/bin/sh OLEG=wl500g-1.9.2.7-7e if [ -d broadcom ]; then echo "Removing old broadcom tree..." rm -rf broadcom fi echo "Unpacking Asus GPL source..." tar xzf GPL_1927.zip echo "Unpacking OLEG source..." tar -C broadcom/src/ -xjf ${OLEG}.tar.bz2 if [ ! -G /opt ]; then echo "You should create /opt as root:" echo "mkdir /opt && chgrp users /opt && chmod g+w /opt" echo "Then continue as regular user!" exit 1 fi if [ -d /opt/brcm ]; then echo "Removing old toolchain..." rm -rf /opt/brcm fi echo "Installing broadcom toolchain..." mv broadcom/opt/brcm /opt BRCM="/opt/brcm/hndtools-mipsel" PATH=${BRCM}-linux/bin:${BRCM}-uclibc/bin:${PATH} export PATH cd broadcom/src/${OLEG} echo "Creating uClibc..." make uClibc echo "Creating kernel..." make kernel echo "Creating gateway..." make echo "Compiling gateway..." cd ../gateway make echo "Creating firmware..." make image-WL500g
11/22/2006 04:06a 3,489,792 WL500g-1.9.2.7-7e.trx mine
06/11/2006 09:25p 3,751,936 WL500g-1.9.2.7-7e.trx Oleg’s
I also tried to compile the http://code.ximeta.com/trac-ndas/wiki/OpenWRT
ndas-1.0.1-23.tar.gz that compile without problems but them...
The modules load OK but
-r-xr-xr-x 1 root 46687 Nov 22 00:04 ndasadmin
[@wl500g tmp]$ ./ndasadmin
-sh: ./ndasadmin: not found
Can someone help me on these 2 problems?
Oleg always post-include nmap binary in its firmwares.
So you can never expect the same binary. Even if nmap would not be included, binaries would not be the same becaus of possible difference in direcory tree traversing during LZMA compression.
tcpdump. not nmap.
OOps. Correct. My wheels. Out of the inner circle.
Regarding kernel module and problem with admin I must say that you must export paths in a proper way. The best way is to start with Optware packaging for Oleg firmware ant then prepare make/ndas.mk to reflect this.
See http://www.nslu2-linux.org/wiki/FAQ/Optware-uClibcBuild
and http://www.nslu2-linux.org/wiki/FAQ/OptwareWl500gBuild
Thanks for your help.
I Installed the Toolchain and produced this ndas.mk file.
I'm able to download the package but then the package is waiting for this :
How do I include these in the ndas.mk file?Code:export NDAS_KERNEL_PATH={kernel path} export NDAS_KERNEL_VERSION=2.4.20 export NDAS_KERNEL_ARCH=mips export NDAS_CROSS_COMPILE=mipsel-linux- export NDAS_CROSS_UM_COMPILE=mipsel-linux-uclibc-gnu- export NDAS_EXTRA_CFLAGS="-mlong-calls -DNDAS_SIGPENDING_OLD" make ndas_version=1.0.1 ndas_build=23 all ndas-admin
Can you please help? This will be my first pakage .... is I get some support.
built target should look like
Code:# This builds the actual binary. # $(NDAS_BUILD_DIR)/.built: $(NDAS_BUILD_DIR)/.configured rm -f $(NDAS_BUILD_DIR)/.built $(TARGET_CONFIGURE_OPTS) \ CPPFLAGS="$(STAGING_CPPFLAGS) $(NDAS_CPPFLAGS)" \ LDFLAGS="$(STAGING_LDFLAGS) $(NDAS_LDFLAGS)" \ NDAS_KERNEL_PATH=/path/to/your/full/kernel/sources \ NDAS_KERNEL_VERSION=2.4.20 \ NDAS_KERNEL_ARCH=mips \ NDAS_CROSS_COMPILE=$(TARGET_CROSS) \ NDAS_EXTRA_CFLAGS="-mlong-calls -DNDAS_SIGPENDING_OLD" \ $(MAKE) -C $(NDAS_BUILD_DIR) touch $(NDAS_BUILD_DIR)/.built
Ok once more thanks for your support.
I made the changes in the ndas.mk file that looks like this:
Code:# # ndas # ########################################################### # You must replace "ndas" and "NDAS" with the lower case name and # upper case name of your new package. Some places below will say # "Do not change this" - that does not include this global change, # which must always be done to ensure we have unique names. # # NDAS_VERSION, NDAS_SITE and NDAS_SOURCE define # the upstream location of the source code for the package. # NDAS_DIR is the directory which is created when the source # archive is unpacked. # NDAS_UNZIP is the command used to unzip the source. # It is usually "zcat" (for .gz) or "bzcat" (for .bz2) # # You should change all these variables to suit your package. # Please make sure that you add a description, and that you # list all your packages' dependencies, seperated by commas. # # If you list yourself as MAINTAINER, please give a valid email # address, and indicate your irc nick if it cannot be easily deduced # from your name or email address. If you leave MAINTAINER set to # "NSLU2 Linux" other developers will feel free to edit. # NDAS_SITE=http://code.ximeta.com/download/1.0.1/23/openwrt NDAS_VERSION=1.0.1-23 NDAS_SOURCE=ndas-$(NDAS_VERSION).tar.gz NDAS_DIR=ndas-$(NDAS_VERSION) NDAS_UNZIP=zcat NDAS_MAINTAINER=PB_LIST NDAS_DESCRIPTION=Describe ndas here. NDAS_SECTION= NDAS_PRIORITY=optional NDAS_DEPENDS= NDAS_SUGGESTS= NDAS_CONFLICTS= # # NDAS_IPK_VERSION should be incremented when the ipk changes. # NDAS_IPK_VERSION=1 # # NDAS_CONFFILES should be a list of user-editable files NDAS_CONFFILES=/opt/etc/init.d/S60ndas # # NDAS_PATCHES should list any patches, in the the order in # which they should be applied to the source code. # NDAS_PATCHES= # # If the compilation of the package requires additional # compilation or linking flags, then list them here. # NDAS_CPPFLAGS= -mlong-calls -DNDAS_SIGPENDING_OLD NDAS_LDFLAGS= # # NDAS_BUILD_DIR is the directory in which the build is done. # NDAS_SOURCE_DIR is the directory which holds all the # patches and ipkg control files. # NDAS_IPK_DIR is the directory in which the ipk is built. # NDAS_IPK is the name of the resulting ipk files. # # You should not change any of these variables. # NDAS_BUILD_DIR=$(BUILD_DIR)/ndas NDAS_SOURCE_DIR=$(SOURCE_DIR)/ndas NDAS_IPK_DIR=$(BUILD_DIR)/ndas-$(NDAS_VERSION)-ipk NDAS_IPK=$(BUILD_DIR)/ndas_$(NDAS_VERSION)-$(NDAS_IPK_VERSION)_$(TARGET_ARCH).ipk .PHONY: ndas-source ndas-unpack ndas ndas-stage ndas-ipk ndas-clean ndas-dirclean ndas-check # # This is the dependency on the source code. If the source is missing, # then it will be fetched from the site using wget. # $(DL_DIR)/$(NDAS_SOURCE): $(WGET) -P $(DL_DIR) $(NDAS_SITE)/$(NDAS_SOURCE) # # The source code depends on it existing within the download directory. # This target will be called by the top level Makefile to download the # source code's archive (.tar.gz, .bz2, etc.) # ndas-source: $(DL_DIR)/$(NDAS_SOURCE) $(NDAS_PATCHES) # # This target unpacks the source code in the build directory. # If the source archive is not .tar.gz or .tar.bz2, then you will need # to change the commands here. Patches to the source code are also # applied in this target as required. # # This target also configures the build within the build directory. # Flags such as LDFLAGS and CPPFLAGS should be passed into configure # and NOT $(MAKE) below. Passing it to configure causes configure to # correctly BUILD the Makefile with the right paths, where passing it # to Make causes it to override the default search paths of the compiler. # # If the compilation of the package requires other packages to be staged # first, then do that first (e.g. "$(MAKE) <bar>-stage <baz>-stage"). # # If the package uses GNU libtool, you should invoke $(PATCH_LIBTOOL) as # shown below to make various patches to it. # $(NDAS_BUILD_DIR)/.configured: $(DL_DIR)/$(NDAS_SOURCE) $(NDAS_PATCHES) make/ndas.mk # $(MAKE) <bar>-stage <baz>-stage rm -rf $(BUILD_DIR)/$(NDAS_DIR) $(NDAS_BUILD_DIR) $(NDAS_UNZIP) $(DL_DIR)/$(NDAS_SOURCE) | tar -C $(BUILD_DIR) -xvf - if test -n "$(NDAS_PATCHES)" ; \ then cat $(NDAS_PATCHES) | \ patch -d $(BUILD_DIR)/$(NDAS_DIR) -p0 ; \ fi if test "$(BUILD_DIR)/$(NDAS_DIR)" != "$(NDAS_BUILD_DIR)" ; \ then mv $(BUILD_DIR)/$(NDAS_DIR) $(NDAS_BUILD_DIR) ; \ fi #(cd $(NDAS_BUILD_DIR); \ # $(TARGET_CONFIGURE_OPTS) \ # CPPFLAGS="$(STAGING_CPPFLAGS) $(NDAS_CPPFLAGS)" \ # LDFLAGS="$(STAGING_LDFLAGS) $(NDAS_LDFLAGS)" \ # ./configure \ # --build=$(GNU_HOST_NAME) \ # --host=$(GNU_TARGET_NAME) \ # --target=$(GNU_TARGET_NAME) \ # --prefix=/opt \ # --disable-nls \ # --disable-static \ #) #$(PATCH_LIBTOOL) $(NDAS_BUILD_DIR)/libtool touch $(NDAS_BUILD_DIR)/.configured ndas-unpack: $(NDAS_BUILD_DIR)/.configured # This builds the actual binary. # $(NDAS_BUILD_DIR)/.built: $(NDAS_BUILD_DIR)/.configured rm -f $(NDAS_BUILD_DIR)/.built $(TARGET_CONFIGURE_OPTS) \ CPPFLAGS="$(STAGING_CPPFLAGS) $(NDAS_CPPFLAGS)" \ LDFLAGS="$(STAGING_LDFLAGS) $(NDAS_LDFLAGS)" \ NDAS_KERNEL_PATH=/root/broadcom/src/linux/linux \ NDAS_KERNEL_VERSION=2.4.20 \ NDAS_KERNEL_ARCH=mips \ NDAS_CROSS_COMPILE=$(TARGET_CROSS) \ NDAS_BUILD=23 \ NDAS_EXTRA_CFLAGS="-mlong-calls -DNDAS_SIGPENDING_OLD" \ $(MAKE) -C $(NDAS_BUILD_DIR) touch $(NDAS_BUILD_DIR)/.built # # This builds the actual binary. # # $(NDAS_BUILD_DIR)/.built: $(NDAS_BUILD_DIR)/.configured # # This is the build convenience target. # ndas: $(NDAS_BUILD_DIR)/.built
export OPTWARE_TARGET=oleg
make make/ndas.mk
make ndas
Seam that is very close but ...Code:make[1]: Entering directory `/opt/slug/optware/builds/ndas' /opt/slug/optware/toolchain/mipsel-linux-uclibc/gcc-3.4.6-uclibc-0.9.28/bin/mips el-linux-uclibc-gcc -include /root/broadcom/src/linux/linux/include/linux/modver sions.h -DMODVERSIONS -DKBUILD_BASENAME=debug -DEXPORT_SYMTAB -DMODULE -DLINUX - I/opt/slug/optware/builds/ndas/inc -DNDAS_WRITE=1 -D__KERNEL__ -I/root/broadco m/src/linux/linux/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-stri ct-aliasing -fno-common -fomit-frame-pointer -I/root/broadcom/src/linux/linux/.. /../include -DBCMDRIVER -I /root/broadcom/src/linux/linux/include/asm/gcc -G 0 - mno-abicalls -fno-pic -pipe -mcpu=r4600 -mips2 -Wa,--trap -D_mips -mlong-calls -DNDAS_SIGPENDING_OLD -DNDAS_VERSION=1.0.0 -DNDAS_BUILD=0 -c -o sal/debug.o sal /debug.c cc1: error: invalid option `cpu=r4600' make[1]: *** [sal/debug.o] Error 1 make[1]: Leaving directory `/opt/slug/optware/builds/ndas' make: *** [/opt/slug/optware/builds/ndas/.built] Error 2
Help
If you are going to build kernel module for firmware on wl500g.dyndns.org then "oleg" is not the right target. You should use "wl500g" as target. This will use correct tolchain.
And the path should be /root/broadcom/src/linux/linux according to your log.
Here is a portion which builds for me:
If you are going to submit the whole ndas.mk and building ipk then please bear in mind that there should be no absolute paths.Code:# # This builds the actual binary. # $(NDAS_BUILD_DIR)/.built: $(NDAS_BUILD_DIR)/.configured rm -f $(NDAS_BUILD_DIR)/.built $(TARGET_CONFIGURE_OPTS) \ CPPFLAGS="$(STAGING_CPPFLAGS) $(NDAS_CPPFLAGS)" \ LDFLAGS="$(NDAS_LDFLAGS)" \ NDAS_KERNEL_PATH=/local/leon/p/wl/wl500gx/broadcom/src/linux/linux \ NDAS_KERNEL_VERSION=2.4 \ NDAS_KERNEL_ARCH=mips \ NDAS_CROSS_COMPILE=$(TARGET_CROSS) \ NDAS_EXTRA_CFLAGS="-mlong-calls -DNDAS_SIGPENDING_OLD" \ $(MAKE) -C $(NDAS_BUILD_DIR) all ndas-admin touch $(NDAS_BUILD_DIR)/.built
Last edited by oleo; 28-11-2006 at 18:14.
Almost there...
ndas.mk file
Code:# You must replace "ndas" and "NDAS" with the lower case name and # upper case name of your new package. Some places below will say # "Do not change this" - that does not include this global change, # which must always be done to ensure we have unique names. # # NDAS_VERSION, NDAS_SITE and NDAS_SOURCE define # the upstream location of the source code for the package. # NDAS_DIR is the directory which is created when the source # archive is unpacked. # NDAS_UNZIP is the command used to unzip the source. # It is usually "zcat" (for .gz) or "bzcat" (for .bz2) # # You should change all these variables to suit your package. # Please make sure that you add a description, and that you # list all your packages' dependencies, seperated by commas. # # If you list yourself as MAINTAINER, please give a valid email # address, and indicate your irc nick if it cannot be easily deduced # from your name or email address. If you leave MAINTAINER set to # "NSLU2 Linux" other developers will feel free to edit. # NDAS_SITE=http://code.ximeta.com/download/1.0.1/23/openwrt NDAS_VERSION=1.0.1-23 NDAS_SOURCE=ndas-$(NDAS_VERSION).tar.gz NDAS_DIR=ndas-$(NDAS_VERSION) NDAS_UNZIP=zcat NDAS_MAINTAINER=PB_LIST NDAS_DESCRIPTION=Describe ndas here. NDAS_SECTION= NDAS_PRIORITY=optional NDAS_DEPENDS= NDAS_SUGGESTS= NDAS_CONFLICTS= # # NDAS_IPK_VERSION should be incremented when the ipk changes. # NDAS_IPK_VERSION=1 # # NDAS_CONFFILES should be a list of user-editable files NDAS_CONFFILES=/opt/etc/init.d/S60ndas # # NDAS_PATCHES should list any patches, in the the order in # which they should be applied to the source code. # NDAS_PATCHES= # # If the compilation of the package requires additional # compilation or linking flags, then list them here. # NDAS_CPPFLAGS= -mlong-calls -DNDAS_SIGPENDING_OLD NDAS_LDFLAGS= # # NDAS_BUILD_DIR is the directory in which the build is done. # NDAS_SOURCE_DIR is the directory which holds all the # patches and ipkg control files. # NDAS_IPK_DIR is the directory in which the ipk is built. # NDAS_IPK is the name of the resulting ipk files. # # You should not change any of these variables. # NDAS_BUILD_DIR=$(BUILD_DIR)/ndas NDAS_SOURCE_DIR=$(SOURCE_DIR)/ndas NDAS_IPK_DIR=$(BUILD_DIR)/ndas-$(NDAS_VERSION)-ipk NDAS_IPK=$(BUILD_DIR)/ndas_$(NDAS_VERSION)-$(NDAS_IPK_VERSION)_$(TARGET_ARCH).ipk #.PHONY: ndas-source ndas-unpack ndas ndas-stage ndas-ipk ndas-clean ndas-dirclean ndas-check .PHONY: ndas-source ndas-unpack ndas ndas-ipk ndas-clean ndas-dirclean ndas-check # # This is the dependency on the source code. If the source is missing, # then it will be fetched from the site using wget. # $(DL_DIR)/$(NDAS_SOURCE): $(WGET) -P $(DL_DIR) $(NDAS_SITE)/$(NDAS_SOURCE) # # The source code depends on it existing within the download directory. # This target will be called by the top level Makefile to download the # source code's archive (.tar.gz, .bz2, etc.) # ndas-source: $(DL_DIR)/$(NDAS_SOURCE) $(NDAS_PATCHES) # # This target unpacks the source code in the build directory. # If the source archive is not .tar.gz or .tar.bz2, then you will need # to change the commands here. Patches to the source code are also # applied in this target as required. # # This target also configures the build within the build directory. # Flags such as LDFLAGS and CPPFLAGS should be passed into configure # and NOT $(MAKE) below. Passing it to configure causes configure to # correctly BUILD the Makefile with the right paths, where passing it # to Make causes it to override the default search paths of the compiler. # # If the compilation of the package requires other packages to be staged # first, then do that first (e.g. "$(MAKE) <bar>-stage <baz>-stage"). # # If the package uses GNU libtool, you should invoke $(PATCH_LIBTOOL) as # shown below to make various patches to it. # #$(NDAS_BUILD_DIR)/.configured: $(DL_DIR)/$(NDAS_SOURCE) $(NDAS_PATCHES) make/ndas.mk # $(MAKE) <bar>-stage <baz>-stage # rm -rf $(BUILD_DIR)/$(NDAS_DIR) $(NDAS_BUILD_DIR) # $(NDAS_UNZIP) $(DL_DIR)/$(NDAS_SOURCE) | tar -C $(BUILD_DIR) -xvf - # if test -n "$(NDAS_PATCHES)" ; \ # then cat $(NDAS_PATCHES) | \ # patch -d $(BUILD_DIR)/$(NDAS_DIR) -p0 ; \ # fi # if test "$(BUILD_DIR)/$(NDAS_DIR)" != "$(NDAS_BUILD_DIR)" ; \ # then mv $(BUILD_DIR)/$(NDAS_DIR) $(NDAS_BUILD_DIR) ; \ # fi # #(cd $(NDAS_BUILD_DIR); \ # $(TARGET_CONFIGURE_OPTS) \ # CPPFLAGS="$(STAGING_CPPFLAGS) $(NDAS_CPPFLAGS)" \ # LDFLAGS="$(STAGING_LDFLAGS) $(NDAS_LDFLAGS)" \ # ./configure \ # --build=$(GNU_HOST_NAME) \ # --host=$(GNU_TARGET_NAME) \ # --target=$(GNU_TARGET_NAME) \ # --prefix=/opt \ # --disable-nls \ # --disable-static \ #) #$(PATCH_LIBTOOL) $(NDAS_BUILD_DIR)/libtool touch $(NDAS_BUILD_DIR)/.configured ndas-unpack: $(NDAS_BUILD_DIR)/.configured # This builds the actual binary. # $(NDAS_BUILD_DIR)/.built: $(NDAS_BUILD_DIR)/.configured rm -f $(NDAS_BUILD_DIR)/.built $(TARGET_CONFIGURE_OPTS) \ CPPFLAGS="$(STAGING_CPPFLAGS) $(NDAS_CPPFLAGS)" \ LDFLAGS="$(STAGING_LDFLAGS) $(NDAS_LDFLAGS)" \ NDAS_KERNEL_PATH=/root/broadcom/src/linux/linux \ NDAS_KERNEL_VERSION=2.4.20 \ NDAS_KERNEL_ARCH=mipsel \ NDAS_CROSS_COMPILE=$(TARGET_CROSS) \ NDAS_BUILD=23 \ NDAS_EXTRA_CFLAGS="-mlong-calls -DNDAS_SIGPENDING_OLD" \ $(MAKE) -C $(NDAS_BUILD_DIR) touch $(NDAS_BUILD_DIR)/.built # # This builds the actual binary. # # $(NDAS_BUILD_DIR)/.built: $(NDAS_BUILD_DIR)/.configured # # This is the build convenience target. # ndas: $(NDAS_BUILD_DIR)/.built # # If you are building a library, then you need to stage it too. # #$(NDAS_BUILD_DIR)/.staged: $(NDAS_BUILD_DIR)/.built # rm -f $(NDAS_BUILD_DIR)/.staged # $(MAKE) -C $(NDAS_BUILD_DIR) DESTDIR=$(STAGING_DIR) install # touch $(NDAS_BUILD_DIR)/.staged #ndas-stage: $(NDAS_BUILD_DIR)/.staged # # This rule creates a control file for ipkg. It is no longer # necessary to create a seperate control file under sources/ndas #
How do I get rid of theCode:make[1]: Entering directory `/opt/slug/optware/builds/ndas' /opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-ld -r -x -L/opt/slug/optware/staging/opt/lib -Wl,-rpath,/opt/lib -Wl,-rpath-link,/opt/slug/optware/staging/opt/lib -o /opt/slug/optware/builds/ndas/ndas_sal.o sal/debug.o sal/libc.o sal/mem.o sal/net.o sal/sal.o sal/sync.o sal/thread.o sal/time.o ndas_sal_main.o /opt/brcm/hndtools-mipsel-linux/bin/mipsel-linux-ld: unrecognized option '-Wl,-rpath,/opt/lib' /opt/brcm/hndtools-mipsel-linux/bin/mipsel-linux-ld: use the --help option for usage information make[1]: *** [/opt/slug/optware/builds/ndas/ndas_sal.o] Error 1 make[1]: Leaving directory `/opt/slug/optware/builds/ndas' make: *** [/opt/slug/optware/builds/ndas/.built] Error 2
"-L/opt/slug/optware/staging/opt/lib -Wl,-rpath,/opt/lib -Wl,-rpath-link,/opt/slug/optware/staging/opt/lib"
please please
carefuly inspect my prevoius post and you will be there. Prepare packaging as instructed in ipkg directory. Remove absolute paths from building and post it here if it works. Overcome somehow confirmation for the copyright and include it in ipkg.
It compiled. But it does not work.
modules load OK
ndasadmin works ok
./ndasadmin start OK
./ndasadmin register OK
./ndasadmin enable router just stops.
They have other rev. in the site I will try to see if the other works
I will keep you posted.
Regarding other IPK packages that use the kernal do you know any that I can look to learn? To see how is done "Remove absolute paths from building"
I could just put a variable at the begining of the mk file would this be OK?
You have been great
Thank you
allright, I have:
asus toolchain for mips
puppy linux
an open source source package that needs to be compiled
so, my question is: how do I use the toolchain to compile a source?
I''ve looked all over the internet but I can only find things like "hey its not working".
Does anyone knows something about this?
even if you answer "look at this file"
it''ll be helpfull
I also still wonder why ppl write a readme without any [enters], so you get one big line
don't know exactly, but there is a howto in german:
http://translate.google.at/translate...hl=de&ie=UTF-8
hope it helps....
thanks, I''ll take a look at it
I''m not really planning to do any IPKG packages, but I think it''s just the extra parameter that change it into an ipkg...
I''m first going to test some simple packages, then i''ll write a full detailed how-to, hopefully for ubuntu and puppy-linux, because I believe those are a bit more open for the public
I do want to try to get wine to work, maybe some windows programs will work with it
probably some pocket pc applications... because "wine is not an emulater"