Dell Streak Forum for discussion on Dells 5'' android tablet, the Dell Streak

Thread Tools Display Modes
  (#1) Old
topdog topdog is offline
Senior Member
Posts: 301
Join Date: Jan 2009
Default Terminal goodies - 09-29-2010, 04:40 PM

If you've ever played with the Android terminal (via ConnectBot or another app, or from your PC over USB cable using 'adb shell' commands) you might have found many traditional unix commands are missing/lacking, like 'du' for example to see how much space a given set of files or folders is consuming.

I'm used to unix environments where each command like 'ls' and 'du' tend to be executables so when I type at the shell prompts 'du' and get a 'permission denied' response I assumed I either truly didn't have permissions or that it doesn't exist.

What I didn't know before today is that there are some super-utility commands that combine a whole bunch of commands into one, and that's how it's working on our Streaks. There's also different flavours of them. By default, most of our commands come from one called 'toolbox' which is functional but brief (a quick ls -l on /system/bin will show that many commands, including ls, are in fact symbolic links to toolbox).

A bigger set of commands is available in something called 'busybox', and it's already on my Streak but under a slightly different name: /system/bin/busybox_1P8P1

Running this (you can alias it etc. too) shows we have the following toys available:

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
May be old hat for the unix/android pros, but a new and useful find for me so thought I'd share it. This is on my "O2" released 2.1, so not sure if it'll have exactly the same name or presence on other builds.

Yay for *grep, sort, vi, and many others.

---------- Post added at 05:40 PM ---------- Previous post was at 05:30 PM ----------

Ugg.. and either I've been half-asleep, or I have root access using the O2 build of 2.1 without installing any software / flashing / etc.

I could swear it wouldn't previously work?

$ fm_hcitool 1
fm_hcitool 1
Running test 1
Send failed: Operation not permitted
$ su -root
su -root
# fm_hcitool 1
fm_hcitool 1
Running test 1
Turn on FM power Done
Turn on audio path Done
switching to FM
Sleeping for 1 sec...
rx device = 34137363
rx device = 34137363, done
tx device = 0
Reply With Quote
  (#2) Old
Dunhamzzz Dunhamzzz is offline
Dunhamzzz's Avatar
Posts: 1,855
Join Date: Sep 2008
Location: Norwich, UK
Send a message via Skype™ to Dunhamzzz
Default 09-29-2010, 04:41 PM

The O2 2.1 update came rooted! By accident obviously! Probably why it was pulled.

Please do not send me support requests via PM.
Reply With Quote
  (#3) Old
topdog topdog is offline
Senior Member
Posts: 301
Join Date: Jan 2009
Default 09-29-2010, 05:07 PM

I'd never gotten it to work before. Actually in ConnectBot it still doesn't work, I get a response like this:

su: uid 10094 not allowed to su

If my knowledge was better I could probably overcome that but I do most of my tinkering via ADB anyway so that'll do for now

---------- Post added at 06:07 PM ---------- Previous post was at 05:54 PM ----------

Ah, and here's the explanation why it (currently for me) only works that way:

... you will notice that it is not possible to gain a root from an application running on the phone. The only way to get root access is through the ADB shell. In order to be able to gain root access using su with a Terminal Emulator application the su utility in /system/xbin/su needs to be replaced. In Android 1.5, the su utility was updated to allow only the shell and root users to gain root access.
Magic Root Access - Android Wiki
Reply With Quote

« Could there still be some Hope for 2.1??? | Webkit Browser - annoying mobile views? »
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Copyright © 2008-2016