InfoDepot Wiki

READ MORE

InfoDepot Wiki
Advertisement
Busybox

Your here: .../.../DD-WRT Tutorials/OTRW/OTRW Package Tutorial/Busybox


Intro

http://www.busybox.net/
http://www.busybox.net/about.html
http://www.nslu2-linux.org/wiki/Optware/BusyBox
http://en.wikipedia.org/wiki/BusyBox

The Swiss Army Knife of Embedded Linux

BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete environment for any small or embedded system.

BusyBox has been written with size-optimization and limited resources in mind. It is also extremely modular so you can easily include or exclude commands (or features) at compile time. This makes it easy to customize your embedded systems. To create a working system, just add some device nodes in /dev, a few configuration files in /etc, and a Linux kernel.

BusyBox is maintained by Denys Vlasenko, and licensed under the GNU GENERAL PUBLIC LICENSE version 2.

  • busybox-base
  • busybox-links

Howto

By default you already have a working busybox 0.6, which is the default Linksys one. There is a newer version (1.0) available - however, there is no need to jump on the band wagon. In short: 1.0 brings some new utils. But clashes with other, better packages.

The reason is not that 1.0 is not great, but that there are better versions of the same utilities in packages like procps and coreutils, so unless you're really pressed for space, I suggest you go with them (e.g. top is way better in procps).

Take a look below, which lists all applets, and if there is a util or two in 1.0 you want, you have a second option: ipkg install busybox-base, which only installs busybox 1.0 without the conflicting links. Then you can manually add the link(s) you want. Note that the default busybox installation(0.60) is located in /bin/busybox and the new one is in /opt/bin/busybox.

You can test the available commands like this: "/opt/bin/busybox the_command_you_want" If your command is available, then you only have to make a symbolic link like this: "ln -s /opt/bin/busybox /opt/sbin/the_command_you_want" choosing /opt/bin or /opt/sbin in the second argument depending on the command.

Version history

Standard Linksys: BusyBox v0.60.4 (2004.05.28-07:40+0000) multi-call binary slingbox version (needed for unslung install): BusyBox v1.00 (2005.09.04-09:26+0000) multi-call binary IPKG package: BusyBox v1.1.3 (2006.06.21-00:00+0000) multi-call binary

Todo: how does 1.00 differ from the original 0.60.4 ? Answer:

"...BusyBox 1.00 represents a tremendous improvement over the old 0.60.x stable series. Now featuring a Linux KernelConf? based configuration system (as used by the Linux kernel), Linux 2.6 kernel support, many many new applets, and the development work and testing of thousands of people from around the world." http://www.busybox.net/downloads/Changelog

"This is a list of the all the available commands in BusyBox (v1.00) with complete usage information and examples of how to use each app." http://www.busybox.net/downloads/BusyBox.html

To get the "better" v1.00 utils without stepping on the preferred utils:

1. install the latest BusyBox with no links using ipkg install busybox-base

2. dump all the v1.00 BusyBox commands into a single line text file; I did /opt/bin/busybox > bb.txt and edited the file.

3. run this bash line to make symlinks for only those unused BusyBox commands:

for com in `cat bb.txt`; do if ! which $com > /dev/null; then ln -s /opt/bin/busybox /opt/sbin/$com; fi; done

Files

The following 'files' are part of the busybox installation. They are spread across the folders /opt/bin and /opt/sbin. Actually, you'll find that those are all sym links. The file busybox is the only executable.

[
 ash
 basename
 bunzip2
 busybox
 bzcat
 cat
 chgrp
 chmod
 chown
 chroot
 chvt
 clear
 cmp
 cp
 cut
 date
 dd
 deallocvt
 df
 dirname
 dmesg
 du
 echo
 egrep
 env
 expr
 false
 fgrep
 find
 free
 grep
 gunzip
 gzip
 head
 hexdump
 hostname
 id
 ifconfig
 insmod
 install
 kill
 killall
 klogd
 ln
 logger
 ls
 lsmod
 md5sum
 mkdir
 mknod
 mktemp
 modprobe
 more
 mount
 mv
 nc
 netstat
 openvt
 pidof
 ping
 pivot_root
 ps
 pwd
 readlink
 reboot
 reset
 rm
 rmdir
 rmmod
 route
 sed
 sh
 sleep
 sort
 strings
 swapoff
 swapon
 sync
 syslogd
 tail
 tar
 tee
 test
 time
 top
 touch
 tr
 true
 tty
 umount
 uname
 uniq
 unzip
 uptime
 usleep
 vi
 wc
 wget
 which
 whoami
 xargs
 yes
 zcat

Slingbox

The only reason for slingbox is the installation of unslung. It shouldn't be used for anything else.

Advertisement