Android Community
Results 1 to 4 of 4

Thread: Busybox on the G1

  1. #1
    Join Date
    Oct 2008
    Posts
    1

    Default Busybox on the G1


    Busybox is a command that provides many of the common linux commands, some of which are noticeably missing from the linux system that's running on the G1. See the session listing below for a list of all the commands it provides.

    You can get a busybox binary that works on the G1 here:

    http://benno.id.au/blog/2007/11/14/android-busybox (Note: this is not my server or binary build.. use at your own risk)

    At first I thought all you would have to do would be to copy the binary to the SD card and run it. But the SD card is mounted in such a way that nothing can be run from it.

    The trick is to find a folder on the flash storage that is writable by the shell user - the user you run as when you connect to the G1 via "adb shell". It took some searching, but I eventually found that /data/local is writable. So you can use adb push to copy the busybox binary onto the device, and then chmod it so that it's executable.


    Code:
    D:\Android\misc>adb -d push busybox /data/local/busybox
    1172 KB/s (0 bytes in 1745016.001s)
    
    D:\Android\misc>adb -d shell
    $ cd /data/local
    cd /data/local
    $ pwd
    pwd
    /data/local
    $ ls -l
    ls -l
    -rw-rw-rw- shell    shell     1745016 2008-10-23 19:50 busybox
    drwxrwx--x shell    shell             2008-10-21 00:15 tmp
    $ chmod 777 busybox
    chmod 777 busybox
    $ ls -l
    ls -l
    -rwxrwxrwx shell    shell     1745016 2008-10-23 19:50 busybox
    drwxrwx--x shell    shell             2008-10-21 00:15 tmp
    $ ./busybox
    ./busybox
    BusyBox v1.8.1 (2007-11-14 10:11:37 EST) multi-call binary
    Copyright (C) 1998-2006 Erik Andersen, Rob Landley, and others.
    Licensed under GPLv2. See source distribution for full notice.
    
    Usage: busybox [function] [arguments]...
       or: [function] [arguments]...
    
            BusyBox is a multi-call binary that combines many common Unix
            utilities into a single executable.  Most people will create a
            link to busybox for each function they wish to use and BusyBox
            will act like whatever it was invoked as!
    
    Currently defined functions:
            [, [[, addgroup, adduser, adjtimex, ar, arp, arping, ash,
            awk, basename, bunzip2, bzcat, bzip2, cal, cat, catv,
            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, df, dhcprelay, diff, dirname, dmesg, dnsd, dos2unix,
            du, dumpkmap, dumpleases, echo, ed, egrep, eject, env,
            envdir, envuidgid, ether-wake, expand, expr, fakeidentd,
            false, fbset, fdflush, fdformat, fdisk, fgrep, find, fold,
            free, freeramdisk, fsck, fsck.minix, ftpget, ftpput, fuser,
            getopt, getty, grep, gunzip, gzip, halt, hdparm, head,
            hexdump, hostid, hostname, httpd, hwclock, id, ifconfig,
            ifdown, ifup, inetd, init, insmod, install, 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, ls, lsattr,
            lsmod, lzmacat, makedevs, md5sum, mdev, mesg, microcom,
            mkdir, mkfifo, mkfs.minix, mknod, 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, poweroff, printenv, printf, ps, pscan, pwd, raidautorun,
            rdate, readlink, readprofile, realpath, reboot, renice,
            reset, resize, rm, rmdir, rmmod, route, rpm, rpm2cpio,
            run-parts, runlevel, runsv, runsvdir, rx, sed, seq, setarch,
            setconsole, setkeycodes, setlogcons, setsid, setuidgid,
            sh, sha1sum, slattach, sleep, softlimit, sort, split,
            start-stop-daemon, stat, strings, stty, su, sulogin, sum,
            sv, svlogd, swapoff, swapon, switch_root, sync, sysctl,
            syslogd, tail, tar, taskset, tcpsvd, tee, telnet, telnetd,
            test, tftp, time, top, touch, tr, traceroute, true, tty,
            ttysize, udhcpc, udhcpd, udpsvd, umount, uname, uncompress,
            unexpand, uniq, unix2dos, unlzma, unzip, uptime, usleep,
            uudecode, uuencode, vconfig, vi, vlock, watch, watchdog,
            wc, wget, which, who, whoami, xargs, yes, zcat, zcip
    
    $ ./busybox whoami
    ./busybox whoami
    whoami: unknown uid 2000
    $

  2. #2
    Join Date
    Nov 2008
    Posts
    67

    Default Re: Busybox on the G1

    good tip, thanks.

  3. #3
    Join Date
    Nov 2008
    Posts
    53

    Default Re: Busybox on the G1

    There doesn't seem to be any fsck.ext2 available for android. Can anyone point me to a source for such a thing?

  4. #4
    Join Date
    Nov 2009
    Location
    Austin, TX
    Posts
    4

    Default Re: Busybox on the G1


    I had the same problem, fsck.ext2 is nowhere to be found for ARM.. so I ended up building it myself using Scratchbox! I just posted them on M3, statically-linked e2fstools compiled for armel. You can download it here: http://www.mediafire.com/?0vv1a2hg143d32v. Hope this helps!

    Please note that they are also UPX packed, to save space. I have a cross-compiled native UPX executable for armel if you want that too

    --W5i2

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •