• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root What is BusyBox?

Zoandroid

Android Expert
I can't find any reference to BusyBox in this Ally thread, just in the threads for other phones. Is it used for the Ally, and if so for what?

Z4Root said it would install BusyBox when I rooted, but since then I have seen no sign of BusyBox, and there is no icon for it.

Zoandroid
 
^ I know where to get it (actually you get the installer from the market), but what does it do? :|
 
I did get the installer from the market and installed it after I did Z4Root because I thought something was 'wrong' when it never appeared after Z4Root had supposedly installed it. Once I got it installed it reported there being 2 instances found. A 1.17.1 and a 1.18.1git(unofficial). BusyBox chose to leave the 1.17.1 as active so I didn't argue. But I still have no idea what it does or how to access it. Is there a user guide somewhere?

Zoandroid
 
I did get the installer from the market and installed it after I did Z4Root because I thought something was 'wrong' when it never appeared after Z4Root had supposedly installed it. Once I got it installed it reported there being 2 instances found. A 1.17.1 and a 1.18.1git(unofficial). BusyBox chose to leave the 1.17.1 as active so I didn't argue. But I still have no idea what it does or how to access it. Is there a user guide somewhere?

Zoandroid


One post above you asking for more info.
 
busy box is a wonderful collection of script programs for use in the terminal. for example the newest busybox rqueen beelease contains git which is a program for downloading fresh kernels and the like.
others include
wget which allows you to programs from the web through the terminal
bzip2 for compression.

In fact here's a list

[, [[, acpid, addgroup, adduser, adjtimex, ar, arp, arping, ash,
awk, basename, beep, blkid, brctl, bunzip2, bzcat, bzip2, cal, cat,
catv, chat, chattr, chgrp, chmod, chown, chpasswd, chpst, chroot,
chrt, chvt, cksum, clear, cmp, comm, cp, cpio, crond, crontab,
cryptpw, cut, date, dc, dd, deallocvt, delgroup, deluser, depmod,
devmem, df, dhcprelay, diff, dirname, dmesg, dnsd, dnsdomainname,
dos2unix, dpkg, du, dumpkmap, dumpleases, echo, ed, egrep, eject,
env, envdir, envuidgid, expand, expr, fakeidentd, false, fbset,
fbsplash, fdflush, fdformat, fdisk, fgrep, find, findfs, flash_lock,
flash_unlock, fold, free, freeramdisk, fsck, fsck.minix, fsync,
ftpd, ftpget, ftpput, fuser, getopt, getty, grep, gunzip, gzip, hd,
hdparm, head, hexdump, hostid, hostname, httpd, hush, hwclock, id,
ifconfig, ifdown, ifenslave, ifplugd, ifup, inetd, init, inotifyd,
insmod, install, ionice, ip, ipaddr, ipcalc, ipcrm, ipcs, iplink,
iproute, iprule, iptunnel, kbd_mode, kill, killall, killall5, klogd,
last, length, less, linux32, linux64, linuxrc, ln, loadfont,
loadkmap, logger, login, logname, logread, losetup, lpd, lpq, lpr,
ls, lsattr, lsmod, lzmacat, lzop, lzopcat, makemime, man, md5sum,
mdev, mesg, microcom, mkdir, mkdosfs, mkfifo, mkfs.minix, mkfs.vfat,
mknod, mkpasswd, mkswap, mktemp, modprobe, more, mount, mountpoint,
mt, mv, nameif, nc, netstat, nice, nmeter, nohup, nslookup, od,
openvt, passwd, patch, pgrep, pidof, ping, ping6, pipe_progress,
pivot_root, pkill, popmaildir, printenv, printf, ps, pscan, pwd,
raidautorun, rdate, rdev, readlink, readprofile, realpath,
reformime, renice, reset, resize, rm, rmdir, rmmod, route, rpm,
rpm2cpio, rtcwake, run-parts, runlevel, runsv, runsvdir, rx, script,
scriptreplay, sed, sendmail, seq, setarch, setconsole, setfont,
setkeycodes, setlogcons, setsid, setuidgid, sh, sha1sum, sha256sum,
sha512sum, showkey, slattach, sleep, softlimit, sort, split,
start-stop-daemon, stat, strings, stty, su, sulogin, sum, sv,
svlogd, swapoff, swapon, switch_root, sync, sysctl, syslogd, tac,
tail, tar, taskset, tcpsvd, tee, telnet, telnetd, test, tftp, tftpd,
time, timeout, top, touch, tr, traceroute, true, tty, ttysize,
udhcpc, udhcpd, udpsvd, umount, uname, uncompress, unexpand, uniq,
unix2dos, unlzma, unlzop, unzip, uptime, usleep, uudecode, uuencode,
vconfig, vi, vlock, volname, watch, watchdog, wc, wget, which, who,
whoami, xargs, yes, zcat, zcip
 
Thanks to KuroTsubasa and his suggestion to check BusyBox in Wiki I now understand what it actually is. It is NOT a program (which I mistakenly assumed when Z4root said it would "install BusyBox").

In addition to KuroTsubasa's explanation, the wiki I read also mentions that BusyBox adds several commands for "embedded Linux" devices. In the list I recognized some I have used already in Android Terminal, such as ls, mv, and cat.

So my next question is - had, for some reason, BusyBox NOT been installed when I rooted with Z4root, would I not have had those commands workable in Terminal (in other words, were they ONLY available to me because of BusyBox?)

Just like to round out my understanding of what BusyBox brings to the rooting experience.

Edit - Theblueletters and I were both posting simultaneously. That is an incredible number of additions!!

Thanks for the info guys!

Zoandroid
 
No problem. I was wondering all this myself awhile back (about when Velocity 0.2 came out... so not *that* long ago). No one really *explains* what Busybox is... they just say you need it, so it had me curious too.

Also, basic commands like ls, mv, and cat would be available by default in android, but as you can see, Busybox includes them too, and a whole lot more.
 
just like $bash or any other terminal program it has scripts like a library of scripts like ls or man and each shell programs library is just a little different depending on the dev. thats one of the reasons some people prefer one shell program to another.

busy box adds a library of scripts to make your terminal more verbose that would otherwise not be accessible. so now your terminal can uncompress files using bzip2 whereas before typing that would give
no command 'bzip2' found

so z4root calls for certain scripts on its way to rooting your phone. if it were not there the program would get hung up calling for scripts not in the library.
 
I have a copy of bash on my phone. There's an android compiled version floating out there somewhere online. When typing with a mobile keyboard, it's really handy to have a command history to recall with the "up" key (in case of typos and such). I only wish I could figure out how to use "tab" to auto-complete file paths when the Ally lacks a physical tab key. Using the alt key combo doesn't seem to register in the terminal emulator app. =/
 
I have a copy of bash on my phone. There's an android compiled version floating out there somewhere online. When typing with a mobile keyboard, it's really handy to have a command history to recall with the "up" key (in case of typos and such). I only wish I could figure out how to use "tab" to auto-complete file paths when the Ally lacks a physical tab key. Using the alt key combo doesn't seem to register in the terminal emulator app. =/

Reminds me of typing in the command line in Windows years ago. Wasn't it "F3" that repeated what you had just typed? Really handy when trying to debug the syntax of a long string. I miss that in Android Terminal. Is there a way to do it in a terminal app for the Ally?

Zoandroid
 
Wow, I completely forgot about that. Yeah, I think it was F3. That was so long ago now.

shell bash for android - xda-developers

Download bash from there and follow the instructions (at least until chmod). From there, you have two choices. You can continue following the instructions, which will replace the default shell program "sh" with a symlink to use bash instead. Or you can leave it as is and change the default shell in the Terminal Emulator app (somewhere in settings). Either way, you can always start it by running "bash" at the command line.

For a little background, "bash" is the default command line program for most Linux distros, and is very powerful in what it can do. It also features a lot of conveniences, like pressing up to access previously typed commands and using the tab key to auto complete commands and paths (although I can't get this to work on our keyboard =/ ).

For some reason though (might be the fault of the Terminal Emulator app, but idk), it will only show you previous commands in your history from your *current* session. Usually bash will show you your history across multiple sessions, i.e. On my computer (Ubuntu Linux) I could close a command prompt, and even restart my computer, and my history would still be there next time.
 
Thanks for the info. I'll give Bash a try.

Do you use this forum much from your Ally? I have an annoyance I'd like to work around somehow. After tapping thanks for you Opera Mini reloads the page, stops at the top of this page, and the "view first unread" button disappears. So I have to manually scroll back down here to do a reply. If the Dpad scrolled faster it wouldn't be an issue but it is pretty slow going, and finger scrolling reminds me of why I use only trackballs instead of mice on PCs.
 
I have run into a problem trying to get bash up and running. I downloaded it with the Ally, to the SD card. The steps they give, which you said to follow, are:

copy bash to /system/bin/bash

then run :

cd /system/bin

I got stopped in my tracks trying to copy bash to system/bin.

I ran

su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system

then tried to mkdir system/bin/bash

it says it is already there. But it won't let me cd to it or ls it so I can verify it is really there. So I tried to

cp system/sd/bash system/bin/bash and I get "no such file or directory.

Reworded to
cp / system/sd bash system/bin/bash and get "can't start 'system/sd' : No such file or directory.

This isn't making sense to me, but this is also all new ground. It seems like bash is "already there" or something, and I have no idea why I am not allowed into those folders using su and mounting them as rw.

- afterthought -- It came to me that if bash really IS there, I should be able to run it! So I reopened terminal, and typed in su followed by bash

I get this :bash - 3.2#

I presume that is the bash su prompt, right? If so something I did in the z4root + Rom Manager + Clockwork recovery installation process must have installed bash for me, or else could it have installed itself somehow when I downloaded it from xda?

Now the up key works just like you said. In Android terminal it doesn't. So I guess I have bash running already. :)

Zoandroid
 
I have run into a problem trying to get bash up and running. I downloaded it with the Ally, to the SD card. The steps they give, which you said to follow, are:

copy bash to /system/bin/bash

then run :

cd /system/bin

I got stopped in my tracks trying to copy bash to system/bin.

I ran

su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system

then tried to mkdir system/bin/bash

it says it is already there. But it won't let me cd to it or ls it so I can verify it is really there. So I tried to

cp system/sd/bash system/bin/bash and I get "no such file or directory.

Reworded to
cp / system/sd bash system/bin/bash and get "can't start 'system/sd' : No such file or directory.

This isn't making sense to me, but this is also all new ground. It seems like bash is "already there" or something, and I have no idea why I am not allowed into those folders using su and mounting them as rw.

- afterthought -- It came to me that if bash really IS there, I should be able to run it! So I reopened terminal, and typed in su followed by bash

I get this :bash - 3.2#

I presume that is the bash su prompt, right? If so something I did in the z4root + Rom Manager + Clockwork recovery installation process must have installed bash for me, or else could it have installed itself somehow when I downloaded it from xda?

Now the up key works just like you said. In Android terminal it doesn't. So I guess I have bash running already. :)

Zoandroid


Well, the first problem I see is with the mkdir command. Mkdir is "Make Directory" or in modern terms, make a new folder. You wouldn't want to be making a folder called bash. When you tried to run the command, it told you "I can't do that, there's already *something* named bash".

To verify it, you would cd to /system/bin and then run ls. If you tried to cd to /system/bin/bash, it should have told you that that location "is not a directory".

Anyway, moving on, it appears that your phone does have bash already installed on it for one reason or another (heck, maybe it's part of busybox... I really don't know). Though I can tell you for sure that it didn't install itself there from your download.

You can set android terminal to use whatever shell (command line program) that you want it to. It's somewhere in settings, and by default it's set to use "/system/bin/sh". If you change it to "/system/bin/bash", bash will be used by default instead. The only issue i've noticed with that setting is that when you "su", it goes back to the regular "sh" and then you have to run bash again.

Anyway, glad you got it working. =)
 
Thanks for the info. I'll give Bash a try.

Do you use this forum much from your Ally? I have an annoyance I'd like to work around somehow. After tapping thanks for you Opera Mini reloads the page, stops at the top of this page, and the "view first unread" button disappears. So I have to manually scroll back down here to do a reply. If the Dpad scrolled faster it wouldn't be an issue but it is pretty slow going, and finger scrolling reminds me of why I use only trackballs instead of mice on PCs.


Idk what to say about that. Opera Mini and Mobile have some quarks due to it's preprocessing of web pages on opera's server. Despite being its best feature, it also causes a lot of issues. Personally, I use Miren Browser (it's been around awhile, and was also known as the MIUI Browser, but it's only recently been added to the Market).

Also, as of yesterday, Phandroid updated it's app to also access the android forums. I'm using it right now. It should be updated in the market sometime today, but if not, it's also in a post here if you search for or google it.

UPDATE: It has been uploaded to the Market. Just search for "Phandroid".
 
I guess I am still thinking in terms of files and folders from using DOS and Windows. Somehow I got the idea that I needed to make a folder called bash to put bash into. But bash seems to be something that is neither file nor folder, so trying to deal with it that way doesn't work.

I am guessing it either got installed with Rom Mgr or Clockwork Recovery. Or maybe even A2SD.

For now I will probably keep accessing it through Android Terminal.

I did find a list of bash commands on the xda site, but it is "just a list" (hundreds of commands jammed together into a paragraph). What I would like to find is a "user guide" for either Android Terminal or Bash, which lists the definition of each command and shows examples of how to use them. I am sure it could fill a book. Maybe even a book would be a better idea. Any suggestions? Are most of the common commands in Linux available in Android, so a guide to Linux would be valuable?

I learn best by the 'hands on' approach, so I do much better in a lab than in a library, if you get my drift. I would play with each command I am trying to learn and actually see it working on the phone. Then I can remember it and what it does. Otherwise it never seems to stick in my mind.

Anyway thanks for helping me understand what was going on getting bash working.

Zoandroid
 
Idk what to say about that. Opera Mini and Mobile have some quarks due to it's preprocessing of web pages on opera's server. Despite being its best feature, it also causes a lot of issues. Personally, I use Miren Browser (it's been around awhile, and was also known as the MIUI Browser, but it's only recently been added to the Market).

Also, as of yesterday, Phandroid updated it's app to also access the android forums. I'm using it right now. It should be updated in the market sometime today, but if not, it's also in a post here if you search for or google it.

UPDATE: It has been uploaded to the Market. Just search for "Phandroid".

I'm installing Phandroid from the market right now. Maybe it will be a bit less hassle than the way Opera-Mini accesses the Android Forum. I like it because it is light years faster than the stock browser, but what I don't care for is that Opera refreshes the page every time I do things like zoom out from a reply box or tap the submit reply button, and for some 'stupid' reason it moves back to the TOP. I hate when email or word processors do that to me to. Very annoying.

OK, I just did a reply to a post on here using Phandroid's app and its forum access. It seems really nice! And it is very quick and responsive. It doesn't have all the features we have on PC access, like smileys and stuff, but otherwise seems quite useful.

Edit - I just realized it doesn't have the "view first unread" option either. :-( But at least it does scroll pretty fast.

Thanks!

Zoanroid
 
I guess I am still thinking in terms of files and folders from using DOS and Windows. Somehow I got the idea that I needed to make a folder called bash to put bash into. But bash seems to be something that is neither file nor folder, so trying to deal with it that way doesn't work.

I am guessing it either got installed with Rom Mgr or Clockwork Recovery. Or maybe even A2SD.

For now I will probably keep accessing it through Android Terminal.

I did find a list of bash commands on the xda site, but it is "just a list" (hundreds of commands jammed together into a paragraph). What I would like to find is a "user guide" for either Android Terminal or Bash, which lists the definition of each command and shows examples of how to use them. I am sure it could fill a book. Maybe even a book would be a better idea. Any suggestions? Are most of the common commands in Linux available in Android, so a guide to Linux would be valuable?

I learn best by the 'hands on' approach, so I do much better in a lab than in a library, if you get my drift. I would play with each command I am trying to learn and actually see it working on the phone. Then I can remember it and what it does. Otherwise it never seems to stick in my mind.

Anyway thanks for helping me understand what was going on getting bash working.

Zoandroid


Bash is an executable file, like a Windows exe file, except in Linux it doesn't need to be named ".exe". It's still a file though. Any information on Linux would be handy on the android command line. Android *is* Linux, just a modified version, with a layer of apps running on top of it instead of a standard desktop environment.

As far as learning goes, you could try learning some Linux cli skills on your desktop computer. I've been running Ubuntu as my OS for about a year and a half now, so I was already ahead of the game when I got my Ally and started experimenting with Android.

Also, on most Linux distros there is a command called "man" that pulls up manual pages about different commands i.e. "man ls" would tell you all you need to know (and then some) about the ls command. Android lacks this built-in documentation though... probably due to size constraints or something. You can also pull up simple help by adding -? or --help to most commands (like /? in Windows/DOS).
 
Actually, it does, just long press on a forum topic. It's pretty impressive so far, expecially for a beta. I can't wait to see where it's headed. They're saying they've got *a lot* planned for it.
 
OK, thanks for the tips! I really did want to build a Linux PC and totally abandon Micro$oft some day. But unfortunately for me, I chose a notebook as my experimenting platform, and ran into endless problems trying to get the right drivers for all its hardware. Never could get the wifi to work, which I consider crucial on any notebook. The mfgr it turns out also used proprietary hardware and special Windows drivers for the video display, which caused additional problems. I ran into a wall every direction I tried to go, and in general it was just a totally un-enjoyable project.

The people on the Linux forums who will spend the time to help someone (just as you are doing in this thread) are very few and far between. Most of them are, to put it bluntly, arrogant and unhelpful. They expect you to know everything before you "dare" ask them a question. No place for a rookie to learn, for sure.

Actually I encountered that exact same scenario the day I was trying to root, while on the ally IRC channel. But fortunately for me, it was not the person I was speaking with who came across with something like "why don't you newbies research this stuff before you come here asking questions". He didn't get that researching is what I was trying to DO in the IRC. Once I got a few questions answered I was successful. I can tell you had I tried to do it by digging online it would have taken weeks, if EVER.

I try never to 'fend off' newbie questions in these forums. I remember my humble beginnings on any topic, and how I was the one asking questions. What good are forums like this if not to help people? So if you ask a question today and every day after someone new asks the same question, I am OK with that. I may point you to the previous post so I don't have to re-type the answer, but I won't tell you to get lost. :)

I still have some "live" Linux distro CDs I made during that project. I actually had tried 3 or 4 different ones. I suppose Ubuntu was the friendliest. There was one called PC Linux that I really liked because it had cool graphics. So I should be able to set up one of those again and it would give me access to that "man" option for each command I want to try to learn.

Thanks for the suggestions! :)

Zoandroid
 
As far as drivers and compatibility go, there are sometimes some issues. Keep in mind though that Linux distros usually follow a 6 month release schedule (that is, a new version comes out every 6 months). This means that compaired to the Windows world, a lot can change in very little time.

When I first tried Linux, I had some major video driver issues. No matter what, I could *not* get my video acceleration working right. Due to this issue, I didn't actually get into Linux until a few years later. I'm currently using that old video card in an older machine, and it works flawlessly now (due to advances in the open-source drivers for that card).

Another thing to keep in mind is that "Ubuntu" makes an excellent keyword in google searches. That's probably 50% or more of the reason I chose to use it. It makes it much easier to find solutions to Ubuntu problems than other distros.

Anyway, the biggest point that I can make is that if you try Linux now, and it doesn't work for you, check back in 6 months or a year. Everything will have come a long way, so don't write it off after just one bad experience.
 
Back
Top Bottom