A little help with firmware compilation...

Discussion in 'Cisco/Linksys Network Storage Devices' started by psychowood, Jun 14, 2009.

  1. psychowood

    psychowood Network Guru Member

    I'm trying to set up a compilation environment for the NAS200 firmware, I'd like to have a well-formed build tree that I can use to compile third party apps.
    The problem is, I really don't know how to configure/use a cross compiler... :redface:

    I have a working gentoo install, and I have a decompressed the 34R75 sources in the /NAS200 dir.

    What are the parameters I need to pass to a configure script to choose the correct build tree and target.

    I don't want necessarily to build the whole firmware, my main goal is to be able to enter a third party source dir, run configure with the right parameters (which I don't know) and make it. I know I'll probably have to edit the Makefile, but that's a secondary problem, right now :)

  2. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    The good news is that you don't really need a cross-compiler for the NAS200... a GCC configured for the i386 architecture will produce executable code for the NAS200. With a little common sense and the Tiny Gentoo page on the Gentoo wiki you can create a chroot environment in which you can use Portage to build pretty much anything. Of course that still leaves you a long way off from rebuilding the Linksys firmware using a different toolchain.

    Alternatively, you can build a cross-toolchain under Gentoo by emerging crossdev and using it the right way, but I've tried this several times unsuccessfully.

    The most success I've had in building a cross-toolchain is by using OpenWRT which may go a little further than you want to go. I don't have time to give you all the details to tell you what parameters to give ./configure (and I have to admit, I don't know exactly what they are either :biggrin:) but somewhere in the OpenWRT makefiles there's a macro that calls a configure script with all the needed parameters based on the OpenWRT directory tree. I'm working on full NAS200 support for OpenWRT, I'm just so busy that it's going to take some time.

    BE CAREFUL The R75 source tree from the Linksys website will compile just fine but will NOT work because they didn't update the binary (closed-source) files. Read this or you will brick your NAS (like I did).

    Hope this helps!

  3. psychowood

    psychowood Network Guru Member

    That's more than enough, thanks :)

    Don't worry, I'd already applied your patch, I justo forgot to mention it.
    Anyway, I'm not that irresponsible to deploy a firmware built without knowing what I'm doing :biggrin:
    I just thought it was needed for the cross toolchain, but since I can use Tiny Gentoo...

    Thanks again!
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice