Loading ...
Sorry, an error occurred while loading the content.

Busybox-1.0-rc2 for the NSLU2 -- Preliminary build instructions

Expand Messages
  • Tommy B
    First of all thanks to the great guys at uClibc.org (Manuel and Erik) and Dan Kegel, they are great help to the open-source community and an inspiration.
    Message 1 of 3 , Aug 15, 2004
    View Source
    • 0 Attachment
      First of all thanks to the great guys at uClibc.org (Manuel and Erik)
      and Dan Kegel, they are great help to the open-source community and an
      inspiration.

      Second, I posted a statically compiled busybox 1.0-rc2 up in the files
      section. I'm going to write up more detailed instruction on how I've
      built it(and test to make sure I've not missed anything). To use it,
      just untar it onto an external disk/flash that the NSLU2 can read then
      attach that disk to the NSLU2. You'll need to telnet in or get command
      access someway.

      You can run individual commands by running

      # whatever_directory_it_is_untarred/busybox_be/bin/busybox cmd
      cmd_parameters ...

      # ..../busybox_be/bin/busybox busybox
      will show all the commands compiled in.

      chroot was added and there's a pivot_root in there too.


      For the impatient or curious, here's the quick build instructions from
      memory:

      I'm using crosstool to build the toolchain version crosstool-0.28-rc28.

      I ran the demo-armv5b-softfloat.sh and just changed
      RESULT_TOP=$HOME/opt/crosstool
      to put the toolchain in the opt directory off my user home directory
      instead of /opt.
      Be sure to add the directory when the tools are to your path. :)
      This builds binutils 2.15, gcc 3.4.0, and glibc 2.3.2.
      Note: it takes several hours to build the full toolchain.

      Then I downloaded the busybox source, untarred it and edited the .config
      file to build statically and I added the chroot command.

      I unset CC because that can cause some issues on gentoo systems and I'm
      a gentoo user.

      make CROSS=armv5b-softfloat-linux- 2>&1 | tee bb.log
      make PREFIX=~tom/dev/crosstool/busybox-1.00-rc2/test install

      I blew the PREFIX= on my command so it wound up in the ./_install
      directory. :)

      Cheers,

      Tommy B.
      irc: [g2]
      yahoo: trb
    • joule360
      Tommy: Thanks for your effort. I am also posting a build of busybox 1.0-rc2 on the files section. This is NOT an attempt to complete with Tommy s work, far
      Message 2 of 3 , Aug 15, 2004
      View Source
      • 0 Attachment
        Tommy:

        Thanks for your effort.

        I am also posting a build of busybox 1.0-rc2 on the files section. This is NOT an attempt
        to "complete" with Tommy's work, far from it. Rather, I have built my version slightly
        differently, and I'm hoping people will help by trying both out so that we can get feedback
        on what works and what does not.

        I built my version using the technique for compiling described by Jim Buzbee in his
        excellent articles on tomsnetworking.com. In brief, I d/l'd the gpl'd snapgear code from
        linksys's GPL code center, and the latest NSLU2 binary. Following Jim's instructions I have
        them all untarred and installed in my /home/nl/projects tree, with the d/l'd source for
        busybox in /home/nl/projects/nslu2. I have also, per Jim's instructions, added /home/nl/
        projects/gpl_code_2.03/<yadda yadda> to my PATH for ease in accessing the arm-
        binaries.

        I used busybox's make menuconfig to configure, and added in the appropriate prefixes for
        the compiler and the include file location in the build options menu item, and edited to
        select which utilities I wanted.

        I found the following issues with compiling:
        1) No matter what I did, I could not get it to stop trying to compile fs/loop.c (presumably
        for loopback mounting support) even when I disabled mount/umount. Unfortunately, this
        file required the include file <linux/version.h> which snapgear did not have.
        2) Another file, I think sys_syscall.c, required <linux/autoconf.h> which the make
        menuconfig process did not generate (at least, no so that I could find it).

        I finally just copied these over from my regular linux 2.4.26 source tree (/usr/src/linux/
        include/linux/{version,autoconf}.h into the snapgear source tree, and then everything
        compiled hunky dory.

        I have tried this on the nslu2 by just copying it over and running ./busybox, which gives
        you the list of included commands, and that worked. ./busybox ls -l also worked, so I
        know the binary runs.

        Interestingly, stripping the binary did not change its size, but running file showed that the
        busybox build sequence had already stripped it for me.

        My version is >1MB, perhaps I have included more functions than Tommy did.

        I have included pivot_root in my build, in case anyone is interested (someone with a serial
        hookup!).

        If anyone wants to supply a list of which busybox functions "should" be included in our
        replacement version, let me know and I'll be happy to recompile. I sort of randomly
        included stuff here just to test - awk is in there, as is grep, strings, du, diff - things I find
        myself wanting while playing on a telnet session to the box.

        nl


        --- In nslu2-linux@yahoogroups.com, Tommy B <gentoo@n...> wrote:
        > First of all thanks to the great guys at uClibc.org (Manuel and Erik)
        > and Dan Kegel, they are great help to the open-source community and an
        > inspiration.
        >
        > Second, I posted a statically compiled busybox 1.0-rc2 up in the files
        > section. I'm going to write up more detailed instruction on how I've
        > built it(and test to make sure I've not missed anything). To use it,
        > just untar it onto an external disk/flash that the NSLU2 can read then
        > attach that disk to the NSLU2. You'll need to telnet in or get command
        > access someway.
        >
        > You can run individual commands by running
        >
        > # whatever_directory_it_is_untarred/busybox_be/bin/busybox cmd
        > cmd_parameters ...
        >
        > # ..../busybox_be/bin/busybox busybox
        > will show all the commands compiled in.
        >
        > chroot was added and there's a pivot_root in there too.
        >
        >
        > For the impatient or curious, here's the quick build instructions from
        > memory:
        >
        > I'm using crosstool to build the toolchain version crosstool-0.28-rc28.
        >
        > I ran the demo-armv5b-softfloat.sh and just changed
        > RESULT_TOP=$HOME/opt/crosstool
        > to put the toolchain in the opt directory off my user home directory
        > instead of /opt.
        > Be sure to add the directory when the tools are to your path. :)
        > This builds binutils 2.15, gcc 3.4.0, and glibc 2.3.2.
        > Note: it takes several hours to build the full toolchain.
        >
        > Then I downloaded the busybox source, untarred it and edited the .config
        > file to build statically and I added the chroot command.
        >
        > I unset CC because that can cause some issues on gentoo systems and I'm
        > a gentoo user.
        >
        > make CROSS=armv5b-softfloat-linux- 2>&1 | tee bb.log
        > make PREFIX=~tom/dev/crosstool/busybox-1.00-rc2/test install
        >
        > I blew the PREFIX= on my command so it wound up in the ./_install
        > directory. :)
        >
        > Cheers,
        >
        > Tommy B.
        > irc: [g2]
        > yahoo: trb
      • joule360
        I have also built this version dynamically linked, which cuts the (uncompressed) size by 2/ 3, and that also seems to work - although again I have not yet
        Message 3 of 3 , Aug 15, 2004
        View Source
        • 0 Attachment
          I have also built this version dynamically linked, which cuts the (uncompressed) size by 2/
          3, and that also seems to work - although again I have not yet tested all of the functions
          in it.

          I'm assuming that a smaller executable is a good thing and that dynamic linking is a good
          thing, given small amounts of system memory, but I'm not sure that dynamic linking and
          shared libraries are the same thing, so this may not be the case. "file busybox" does
          indicate the use of shared libs, however.

          nl


          --- In nslu2-linux@yahoogroups.com, "joule360" <joule360@y...> wrote:
          > Tommy:
          >
          > Thanks for your effort.
          >
          > I am also posting a build of busybox 1.0-rc2 on the files section. This is NOT an
          attempt
          > to "complete" with Tommy's work, far from it. Rather, I have built my version slightly
          > differently, and I'm hoping people will help by trying both out so that we can get
          feedback
          > on what works and what does not.
          >
          > I built my version using the technique for compiling described by Jim Buzbee in his
          > excellent articles on tomsnetworking.com. In brief, I d/l'd the gpl'd snapgear code from
          > linksys's GPL code center, and the latest NSLU2 binary. Following Jim's instructions I
          have
          > them all untarred and installed in my /home/nl/projects tree, with the d/l'd source for
          > busybox in /home/nl/projects/nslu2. I have also, per Jim's instructions, added /home/
          nl/
          > projects/gpl_code_2.03/<yadda yadda> to my PATH for ease in accessing the arm-
          > binaries.
          >
          > I used busybox's make menuconfig to configure, and added in the appropriate prefixes
          for
          > the compiler and the include file location in the build options menu item, and edited to
          > select which utilities I wanted.
          >
          > I found the following issues with compiling:
          > 1) No matter what I did, I could not get it to stop trying to compile fs/loop.c
          (presumably
          > for loopback mounting support) even when I disabled mount/umount. Unfortunately,
          this
          > file required the include file <linux/version.h> which snapgear did not have.
          > 2) Another file, I think sys_syscall.c, required <linux/autoconf.h> which the make
          > menuconfig process did not generate (at least, no so that I could find it).
          >
          > I finally just copied these over from my regular linux 2.4.26 source tree (/usr/src/linux/
          > include/linux/{version,autoconf}.h into the snapgear source tree, and then everything
          > compiled hunky dory.
          >
          > I have tried this on the nslu2 by just copying it over and running ./busybox, which gives
          > you the list of included commands, and that worked. ./busybox ls -l also worked, so I
          > know the binary runs.
          >
          > Interestingly, stripping the binary did not change its size, but running file showed that
          the
          > busybox build sequence had already stripped it for me.
          >
          > My version is >1MB, perhaps I have included more functions than Tommy did.
          >
          > I have included pivot_root in my build, in case anyone is interested (someone with a
          serial
          > hookup!).
          >
          > If anyone wants to supply a list of which busybox functions "should" be included in our
          > replacement version, let me know and I'll be happy to recompile. I sort of randomly
          > included stuff here just to test - awk is in there, as is grep, strings, du, diff - things I
          find
          > myself wanting while playing on a telnet session to the box.
          >
          > nl
          >
          >
          > --- In nslu2-linux@yahoogroups.com, Tommy B <gentoo@n...> wrote:
          > > First of all thanks to the great guys at uClibc.org (Manuel and Erik)
          > > and Dan Kegel, they are great help to the open-source community and an
          > > inspiration.
          > >
          > > Second, I posted a statically compiled busybox 1.0-rc2 up in the files
          > > section. I'm going to write up more detailed instruction on how I've
          > > built it(and test to make sure I've not missed anything). To use it,
          > > just untar it onto an external disk/flash that the NSLU2 can read then
          > > attach that disk to the NSLU2. You'll need to telnet in or get command
          > > access someway.
          > >
          > > You can run individual commands by running
          > >
          > > # whatever_directory_it_is_untarred/busybox_be/bin/busybox cmd
          > > cmd_parameters ...
          > >
          > > # ..../busybox_be/bin/busybox busybox
          > > will show all the commands compiled in.
          > >
          > > chroot was added and there's a pivot_root in there too.
          > >
          > >
          > > For the impatient or curious, here's the quick build instructions from
          > > memory:
          > >
          > > I'm using crosstool to build the toolchain version crosstool-0.28-rc28.
          > >
          > > I ran the demo-armv5b-softfloat.sh and just changed
          > > RESULT_TOP=$HOME/opt/crosstool
          > > to put the toolchain in the opt directory off my user home directory
          > > instead of /opt.
          > > Be sure to add the directory when the tools are to your path. :)
          > > This builds binutils 2.15, gcc 3.4.0, and glibc 2.3.2.
          > > Note: it takes several hours to build the full toolchain.
          > >
          > > Then I downloaded the busybox source, untarred it and edited the .config
          > > file to build statically and I added the chroot command.
          > >
          > > I unset CC because that can cause some issues on gentoo systems and I'm
          > > a gentoo user.
          > >
          > > make CROSS=armv5b-softfloat-linux- 2>&1 | tee bb.log
          > > make PREFIX=~tom/dev/crosstool/busybox-1.00-rc2/test install
          > >
          > > I blew the PREFIX= on my command so it wound up in the ./_install
          > > directory. :)
          > >
          > > Cheers,
          > >
          > > Tommy B.
          > > irc: [g2]
          > > yahoo: trb
        Your message has been successfully submitted and would be delivered to recipients shortly.