[Announce] Busybox v1.14.3 for NAS200 running jacX

Discussion in 'Cisco/Linksys Network Storage Devices' started by jackito, Aug 20, 2009.

  1. jackito

    jackito LI Guru Member


    I compiled a new version of Busybox (v1.14.3) for NAS200 running jacX (tested with jac2b, jac3 and jac4).
    It adds bugfixes, more options to the applets (also in comparision to my previous busybox 1.13.3 release), and this functionalities in comparision to the default busybox:

    1) arp
    2) arping
    3) bunzip2
    4) bzcat
    5) bzip2
    6) catv
    7) depmod
    8) diff
    9) dos2unix
    10) fuser
    11) gunzip
    12) ipcalc
    13) nice
    14) nmeter
    15) nohup
    16) pgrep
    17) pkill
    18) printenv
    19) printf
    20) pscan
    21) renice
    22) split
    23) stat
    24) sysctl
    25) tftp
    26) tftpd
    27) top
    28) traceroute
    29) unix2dos
    30) unzip
    31) watch
    32) zcat

    And of course:

    * ls with color!
    * tar with bzip2 support
    * shell with fancy prompt support like root@NAS200 /harddisk/volume_3/conf#

    You can get it here.
    Hope you enjoy it!
  2. Jeangouytch

    Jeangouytch Addicted to LI Member

    Hi all

    Firs thing, a BIG thanks to the guy who made the NAS200 something much more interesting than it is when it just come out of it's box.

    Tonight, i was playing with the busybox stuff. I've read the previous busybox thread in the forum and done that :
    I've made startup script to build /etc/shells file, and edited my passwd file in order to use the updated busybox as default shell. Things seems to be OK at logon, i'm runing the new shell as expected.

    I hoped this would override all command in /bin, but it doesn't. Do I really have to simlink all /bin commands to another directory ? If so, i don't understand what's the point to make those complicated stuffs in order to have the new busybox as my default shells ??? using old shell and simply linking commands should suffice ? does't it ?

    Jac, what about an updated vim in order to being some more colors to the NAS :biggrin:

  3. jackito

    jackito LI Guru Member

    No it doesn´t. ASH, the shell included in busybox, has improved from the 1.00-rc2 version. Also it has more features like for example "fancy prompts" that let you customize your prompt to get a more informative one like "root@NAS200 /harddisk/volume_3/conf#" instead of just a "$".
    If you are writing scripts or using a lot the command line you will want to have busybox-1.14.3 as your default shell.
    About the symlinks, maybe you don´t need to symlink everything but just the applets you need/are interested in like top, tar, etc. :wink:
  4. Jeangouytch

    Jeangouytch Addicted to LI Member

    Ok, thank for your answer.

    I'm glad to hear I did'nt lost my time configuring the new shell
  5. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I think a number of commands such as "cd" are handled internally, i.e. Busybox doesn't read /bin/cd if you type a cd command on the command line. (I have to say I don't really know how Busybox's ash shell handles commands but somehow I know that if some symlinks are missing, the commands that they represent will stil work).

    Either way, you don't have to symlink everything in /bin. You can create a directory with symlinks and put that at the front of your $PATH, before /bin. I think recent versions of Busybox are even capable of creating their own symlinks.

    The best way to run an updated Busybox is to copy the original root filesystem to one of the config partitions or to a loop filesystem (the latter is safer and easier to clean up but is also slower), and replace /bin/busybox by your updated version. Then all the symlinks will still be present and will keep your system working; all you need to do is create new symlinks for the apps that are in your new busybox but weren't in the old one.

    Example (not tested):
    $ dd if=/dev/zero of=/harddisk/volume_1/conf/nas200.ext2.rootfs \
    bs=1024k count=200
    $ mke2fs /harddisk/volume_1/conf/nas200.ext.rootfs
    $ losetup /dev/loop7 /harddisk/volume_1/conf/nas200.ext2.rootfs
    $ mkdir -p /mnt/new /mnt/old
    $ mount /dev/loop7 /mnt/new
    $ mount -t squashfs -o ro /dev/rom1 /mnt/old
    $ cp -ax /mnt/old/. /mnt/new
    $ cp /path/to/your/new/busybox /mnt/new/bin
    $ umount /mnt/old /mnt/new
    $ /etc/rc.d/rc.reboot
    The above commands create a loop filesystem on the first config partition, mounts it, copies the original root filesystem and replaces the busybox. After it restarts, it should work as usual except now you're running your brand spankin' new busybox.

    Welllll.... This may surprise you but I'm one of the "few" people who are not very fond of vi or vim. When I'm in a masochistic mood or when there's no other way, I know how to use vim (classic vi would be a problem but would also be doable if in a pinch) but I'd rather use a good editor like joe. At least it knows Wordstar key combinations :biggrin:.

  6. jackito

    jackito LI Guru Member

    Jac, this is not a good advice. In fact PEOPLE PLEASE DON´T DO IT!!!!
    Let me quote part of the message by jotabe (btw he posted a message in the jac4 thread also):

    I´m working in a root_fs (loop mounted) with some extra features included the new busybox, but with the other aproach (changing the PATH env var) since that way I will keep every original feature safe and sound. :)
  7. DJ Soulfly

    DJ Soulfly Addicted to LI Member

    No problems with upgrading it from v1.13.3 I only had to go back to the original busybox to replace it with v1.14.3.

    If you want to accomplish that just edit your /etc/passwd for the user root en temporary replace your new busybox to the orginal one /bin/sh
  8. jackito

    jackito LI Guru Member

    Sorry, but what do you mean? Can you explain a little bit more? :redface:
  9. DJ Soulfly

    DJ Soulfly Addicted to LI Member

    Ok I will try to explain a little more of this :

    What I did was extracting the content of your tar.gz file with the new busybox file at first.

    Second I logged on on my NAS200 to edit my /etc/passwd and changed the default shell for my busybox temporary onto the busybox which came with the jac4 firmware. So if i replaced the version of v1.13.3 to the new one the file was not in use by the root user when I connect with WinSCP to replace the file.

    I did it like this to my /etc/passwd :

    Changed it back to :
    Third I disconnected with WinSCP to ensure the old v1.13.3 busybox was not in use any more and logged on with WinSCP again to the NAS200 which also looks for my default shell and used now the original jac4 busybox so i can now easily replace my busybox to the new one without a problem.

    Fourth I edited my /etc/passwd again to change the shell back to the brandnew upgraded busybox and finaly disconnect with WinSCP and tested with Putty to see if the new busybox was loading and worked.

    Hopefully is this the info that you was looking for :wink:
  10. DJ Soulfly

    DJ Soulfly Addicted to LI Member

    Bump for this thread. I want to compile a newer version for the nas200 because version v1.16 is out. But I am not experienced enough to do that on my own. I need some examples to get on. Can you please provide me with some information
  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