If you want to convert your Adam into a functioning Linux computer, with all the usual linux software, while retaining your Android ROM, dive in. This is an update of my previous Ubuntu in a chroot, now abandoned.
What you need upfront:
- Some basic familiarity with Linux
- An external USB keyboard or a keyboard case (like this one)
- An external SD card with several GB free (the chroot is 4GB), formatted in ext4 or other Linux-friendly filesystem
- Honeycomb ROM (with earlier ROMs, the CTRL key and other special keys aren't recognised)
- Preferably, a Linux computer to do some of the following steps on.
I recommend mounting the external SD card on the computer (with a USB cardreader). Now, download the chroot environment, which I have split into three parts: 1, 2, 3. Save them to the same directory, and on linux, as root (thanks James), from that directory, do
(where you replace the path to the sdcard, and the path to the tar.bz2 file, with whatever is appropriate). The file size of the gentoo.tar.bz2 file is 864563147 bytes. If you get less, one subpart didn't download fully. The individual subpart file sizes should be 314572800, 314572800, 235417547 bytes respectively (if I remember right). You need to be root for the permissions to come out right.
cat gentoo.tar.bz2_* >> gentoo.tar.bz2
tar jxvf /path/to/gentoo.tar.bz2
Now download this script. You will want to save it somewhere, either on the external sdcard (I put it in the "bin" subdirectory on the external card) or internally on the Adam. But first read the comments and change what you need to -- in particular, the mount point of the external SD card. After saving it, do
to make it executable.
chmod +x chroot_gentoo
Finally, you need a VNC viewer. The "Android VNC viewer" (version 0.5.0) on the market is the best of the lot and is free, but it still doesn't seem to handle control keys correctly, even on HC. So use this patched APK instead, which works for me. (The patch is from here -- thanks for the reminder, androq.)
Final caveat: the external SD card must be mounted with executable permission. I find that, with AdamComb 0.3, sometimes it does not get mounted at all, and sometimes it gets mounted without execute permission. So, depending on whether it is mounted already or not, do one of the following from the terminal (after becoming root with "su"):
mount -t ext4 /dev/block/vold/179\:17 /mnt/external_sd
Now, from the terminal, as root, simply do
mount -o remount,rw -t ext4 /dev/block/vold/179\:17 /mnt/external_sd
(change the path to where you saved the script). If all went well, you should get a root shell inside the chroot. Finally, type
and from the VNC viewer, connect to localhost on port 5901 with password 12312312. You should get an XFCE desktop. Have fun.
vncserver -localhost -geometry 1024x560
(*) About swap space: James expresses the concern that using flash memory for swap space may wear it out, since flash memory supports only a limited number of rewrites. I think in practice this shouldn't be much of a concern, since (a) flash for many years now supports well over 100,000 writes, and (b) it has write-levelling characteristics so that your writes will in practice be distributed all over the disk. Still, if you are nervous, or if you habitually drive your device to swap furiously, you may want to put the swap file on the external SD card, so that you can easily replace it if it wears out...
- The VNC viewer has various options for mouse/touchscreen behaviour, via menu->input mode (since the touchscreen is not a mouse, and needs to emulate one). I find the "mouse pointer control mode" option the best, as far as the touchscreen is concerned (I haven't tried an external mouse).
- The geometry above (1024x560) is to make space for the HC menubar at the bottom. If you have disabled that menubar, use 1024x600. If you use anything larger, you will need to scroll around, but it will still work.
- Already installed are gcc 4.4.6 and 4.5.3 (including g++, gfortran, and gcj-4.5.3); python 2.7; vim; emacs; firefox 6; midori (lightweight browser); inkscape (vector graphics); abiword (word processor); gnumeric (spreadsheet); octave (Matlab-like scientific package); and much else. All of these were compiled from portage. Also installed is libreoffice 220.127.116.11, compiled manually and installed in /usr/local/lib (programs are in /usr/local/lib/libreoffice/program). There are menu entries for everything except libreoffice, which you will need to start from a terminal (but it works).
- The portage tree is installed; do "emerge --sync" once in a while to keep it up-to-date. You will find that many portage programs are "masked" for arm. Simply unmask them and the majority will install fine. The "autounmask" program (already installed) should help with this.
- Some programs (notably firefox 6) exhaust memory when compiling from source. If you run into that situation, you will need to enable swap space (which I think is a good idea anyway(*)). For that, you need a kernel that supports swap space. The ROM I currently use is here; it is Adamcomb 0.3 with my custom kernel. The kernel is built from the NI tree with an additional fix for touchscreen freezes, and enables swap, but otherwise uses the same config as the kernel that comes with Beast 2.2.1. It was built on my Adam, with gcc 4.5.3. Make a swapfile on one of your internal or external filesystems (using, eg, "dd"), of 512MB or 1GB size; set it up with "mkswap /path/to/swapfile" (needs to be done only once) and use "swapon /path/to/swapfile" to activate it (needs to be done after every reboot -- you can put it in the boot scripts). I have one swapfile in /data and one in /mnt/sdcard, and activating both seems to improve memory-crunch situations without any bad effects.
- The compiler defaults to 4.4.6 right now, but I think it should be harmless to change it to 4.5.3.
- To modify vnc settings, dig into /root/.vnc
- I could not get regular user accounts to access the internet. I have a workaround where I have an account with my regular user name (rsidd) but uid 0, so I have root permissions.
- Probably other things that I have forgotten...