Gentoo Linux on the ASUS TF700

This page holds resources useful in installing and using Gentoo Linux on the ASUS TF700, also known as the Transformer Pad Infinity.

Warning: If you make a mistake trying to install Gentoo, your tablet may become unusable! These resources are provided in the hope that they will be useful, but with no warranty; use them at your own risk. (If you don't completely understand the instructions below, this page is not for you.)


Overview

The procedure and files below allow installation of Gentoo Linux on the ASUS TF700 tablet. This install is performed directly onto the Android /data filesystem, allowing Gentoo and Android to coexist on the same device without repartitioning the internal storage. (On the Gentoo side, this is accomplished through the hack of doing a chroot() to the Linux install directory before running /sbin/init.)

Overall, the state of (this image of) Gentoo on the TF700 could be described as "minimally functional"; it works at a basic level, but doesn't come close to replacing an ordinary laptop PC. (Which is a shame; even if not up to Linus Torvalds standards, the high-resolution display still far outstrips current laptop offerings, and it has multitouch support as well.)

These instructions worked for my Japanese-model device, starting with firmware 9.4.5.26 installed; I have no idea how well they work on other models or firmware versions.

What works

What doesn't work

Other pain points


Installation procedure

  1. Unlock the TF700 bootloader using the Android app provided by ASUS. Warning: This will void your warranty! To download:
    1. Go to the ASUS download site.
    2. From the "OS:" dropdown, select "Android".
    3. Expand the "Utilities" category.
    4. Download "Unlock Device App".
    Note that you need to be connected to the Internet for the unlock tool to work. Also, as of this writing the app is described as only working with Android 4.0 (Ice Cream Sandwich), so you may not be able to use it if you upgrade to Android 4.1 (Jellybean).
  2. Install a custom recovery tool, such as TWRP, which allows you to connect with adb shell to get a root shell. (For the initial installation, it is also possible to exploit a bug in the Android boot sequence to get a root-enabled shell; in that case, you can use an Android terminal emulator app and perform the initial installation in Android itself. However, having an adb-enabled recovery tool is strongly recommended as a way to recover from a bad kernel install or other errors.)
  3. Boot into the recovery tool (hold the power and volume-down buttons until the screen displays "Checking for RCK..." in the upper-left corner, then release both buttons and press the volume-up button).
  4. Connect the TF700 to a PC with the USB cable, and verify that you can get a shell with adb shell.
  5. Download the Linux image (linux-root.tar.gz) and the tar binary, and copy them to /data/local on the device:
    adb push linux-root.tar.gz /data/local
    adb push tar /data/local
  6. In adb shell, expand the Linux image in the /data directory:
    /data/local/tar Cxzvfp /data /data/local/linux-root.tar.gz
  7. Check that the Linux image was successfully unpacked on the device:
    ls /data/linux-root
    You should see typical top-level directories for a Linux install (bin, dev, etc, and so forth).
  8. Verify the location of the boot partition:
    dd bs=512 skip=23552 count=1 </dev/block/mmcblk0 2>/dev/null | dd bs=8 count=1 2>/dev/null; echo
    This should output the string "ANDROID!". If it does not, stop here; you need to find the sector offset of the boot partition on your device and use that in place of "23552" in these instructions.
  9. Make a backup copy of your Android boot image:
    dd bs=512 skip=23552 count=16384 </dev/block/mmcblk0 >/data/linux-root/boot/boot-android.img
  10. Install the Gentoo boot image:
    dd bs=512 seek=23552 count=16384 </data/linux-root/boot/boot-gentoo.img >/dev/block/mmcblk0
    (You can also use this command to restore the original Android boot image, allowing you to boot into Android again; just change "boot-gentoo" to "boot-android".)
  11. In adb shell, run the sync command to ensure that all changes have been written to disk.
  12. Reboot the tablet, either using the recovery interface or by running the command adb reboot from your PC. Gentoo Linux should now boot up.

Default configuration

The Linux image installed through the instructions above includes a single user account, "tf700". The password for both this user account and the root (superuser) account is also "tf700". Naturally, you should change these if you intend to make any significant use of your Gentoo install.

The Linux image includes only basic system packages, plus a few packages specific to the TF700. Those packages are:

The packages above are available from a Portage overlay at http://achurch.org/hg/portage-tf700, which is preinstalled via the layman tool (the overlay description file can be found at http://achurch.org/portage-tf700-layman.xml).

The image also includes a custom keymap, located at /usr/local/share/keymaps/tf700.map and loaded by /etc/conf.d/keymaps. This keymap:


Updating and restoring the kernel

If you build a new kernel, you need to install it to the boot partition before it will be recognized. The tf700-simpleboot script takes care of this; run tf700-simpleboot install path-to-kernel to install the new kernel (located at path-to-kernel) to the boot partition.

tf700-simpleboot does not provide any facility for a backup kernel, so if the kernel you install fails to boot, you will need to use the tablet's recovery mode to reinstall a known-good kernel.


Andrew Church - achurch@achurch.org
Last modified: 2012/11/7