8-feb: Major update in the way these additional toys are handled (now with ipkg feed).
I will now publish the linux tools packaged as ipk files and one will have to use the opkg tool to install / uninstall / udate these ipk packages.
For reference, opkg is a lightweight package management system based on Ipkg. Ok, but what is ipkg ? Easy: ipkg re-implements for embedded systems the functionality of Debian tools dpkg, apt, and apt-get. For example, it uses much less disk space for the package metadata.
Believe me, this will make your life as end-user quiet easier and as a side effect it will make my life as developer & packager quite easier as well
So, having said that; the first action is to have opkg installed on your phone. To achieve this, download this specific opkg bootstrap opkg_bootstrap_v2.tar.bz2.zip 262.9KB 1287 downloads.
Unzip it to your SD card, open a shell with adb and run:
cd / tar xjf /sdcard/opkg-bootstrap-v2.tar.bz2 /data/xbin/opkg install /sdcard/opkg_0.1.7+svn519-2_arm.ipkYou now have installed opkg as an ipk package. This means:
1) you are now able to easily install other ipk
2) opkg can now also be easily updated if required !
One of the benefitis of opkg is the ability to set-up an internet feed so as to be able to update or install packages while being online. Edit opkg configuration file /data/local/opkg.conf in this way:
src/gz common http://freeasabeer.byethost33.com/android/feed/common src/gz mcr http://freeasabeer.byethost33.com/android/feed/mcr #src/gz cyanogen http://freeasabeer.byethost33.com/android/feed/cyanogen dest root / #option verbose-wget # # Proxy support: # #option http_proxy http://localhost:5865 #option ftp_proxy http://proxy.tld:3128 #option proxy_username <username> #option proxy_password <password>
If you're using Paul's MCR, then those settings are OK.
If you're using one of the 2.1 cyanogen based ROM, then comment out the second line and uncomment the third one.
You are now ready to update the package list and to install from the feed:
If you already had opkg installed from the previous bootstrap, then you will have to do the following (as there is a bug in former opkg package that prevent it to actually find the configuration file):
opkg -f /data/local/opkg.conf update opkg install opkg
Some quick instructions on how to use opkg:
Always run "opkg update" before to be sure to get the latest updates
Install the rsync package:
opkg install rsync
Want to remove the package, easy:
opkg remove rsync
Want to list installed packages:
Want to list files belonging to a given package (e.g. rsync):
opkg files rsync
You don't need to reboot your phone in recovery mode, neither to just reboot it. Just install things live.
PS: you don't need to uninstall or remove any of the previously installed tools: they will (should) be nicely overwritten.
these linux tools are mainly intended for geeks that like top play with the internals of their Hero from a shell (either adb shell, ssh connection, or a terminal application). Regular users won't find any benefit by installing these tools: they won't make their hero faster or work better, they will just increase the ROM memory consumption.
1. mc (Midnight Commander)
If you don't know what mc is then you most probably don't need it. But you may be interested to discover what it is.
For the geeks that do want it to easily browse the phone file system from a ssh or adb shell connection, I've done a uclibc statically linked binary of mc that you can install with opkg.
From what I've seen, it mostly works ok from a linux xterm connected with adb shell: browsing files is ok and I've not tested any advanced features of mc. I have no idea if it is usable from a windows cmd terminal or a cygwin one.
Once installed, open a shell on your phone and start mc this way: mc
2. GNU screen
As a midnight commander companion, we can now enjoy screen !
Don't know what screen is ? Check Wikipedia.
Basically screen allow to open several shell connections in parallel from one physical connection to the phone (either adb shell or ssh) and to switch from one to the other one at will. It also allow to close the physical connection without losing the ongoing shell connections so that you can resume them once you have restarted the physical connection.
An interesting side effect I've noticed is that vi works great within a screen shell where as is was unusable from a direct shell !
I have however to raise a warning here: in order to get screen to work I had to setup a system/etc/passwd file with the solely purpose to declare the root user and I've done it with an empty password. So I'm not sure yet of the security implication that this could have on the phone... On a regular unix system the security breach is obvious but here on an anyway rooted phone I'm not so sure. So, you've been warned.
Once installed, you can start screen with: screen and resume an ongoing session with screen -r
Tree is a recursive directory listing program that produces a depth indented listing of files, which is colorized ala dircolors if the LS_COLORS environment variable is set and output is to tty.
Due to popular demand, here is also rsync...
Note: installing rsync will also install a new version of dropbear.
Some hints on how to use rsync with the Hero:
1) From the Hero to a remote host
In this scenario, you run rsync on the hero itself and connect to a remote host.
There are no oddities here, just use rsync as you normally would.
2) From a linux/mac host to a remote Hero
In this scenario, you rsync on linux/mac host and connect to a remote hero.
In this case, the rsync invocation is a bit tricky, for example:
rsync -av -e 'ssh -p 2222' --rsync-path=/data/xbin/rsync <some local files/dir> root@<YOU_HERO_IP>:/data/tmp
This is an updated busybox as compared to what Paul currently ships with MCR (even current betas). This one do include my ip resolv tweak !
Don't ask for wget, it is already provided by busybox
First release for htop... However I don't really see how to use the Fx keys... So pretty useless ?
The famous zip binary is now available !
Edited by freeasabeer, 11 March 2010 - 09:09 AM.