Tf700t

= Installing Gentoo Linux on Asus Transformer Infinity (TF700T) =

Since i bought the amazing Infinity (Asus TF700T) with the keyboard dock, i started wondering how to put a real OS on it, which is my beloved Gentoo.

Finally i managed to get to the point and achieve something usable.

In this wiki page i will be describing what i did and provide both instructions AND the final product.

Preliminary notes
A few preliminary notes.

You MUST have the keyboard dock, otherwise you must try to plugin some kind of USB keyboard, which i guess would be a pain to use. I have not tried bluetooth at the moment on Gentoo and the TF700T (it should work), but i guess getting to the point of pairing the keyboard would require the shitty on-screen keyboard, and X working, which still requires you to type a lot of stuff from command line before you can actually make it start automatically at boot.

I strongly recomand to install Gentoo on the microSD. The SD slot on the dock might work as well but do you trust yourself to never detach the dock itself? Or are you sure it will never happen by accident? If it does, well, at least a reboot + fsck is mandatory! Installing on the internal memory is also al option, but consider the wear and tear due to compilation! In this case you might want to move your portage build dir to the microSD.

The tables has only 1gb of ram. While it might seems a lot, and it surely was up to a few years ago, it's surprsingly small by today standards. Don't ask my wy Asus choose such a limited amount on a top-level device, just live with it. Couple it with the basic useless of swap space on this device: on the internal memory i strongly recomend to avoid, and on the microSD it's really a serial device, so putting swap on it causes the entire device to crawl as soon as it's being used. Given this considerations, i suggest a lightweight desktop like LXDE and memory saves wherever possible like don't run background services or memory-hogs.

Before the first linux boot
The Asus Infinity (TF700T) comes out of the box as an Android tablet, it'd provided with android 4.2.1 or something similar but it is not so important because we want to install Linux on it, so these steps will provide infos on how to enable dual boot on this device, and they need to be performed with your current android installation.

Unlock and root
You must unlock your bootloader first, follow these instructions:

Go to this link: support page on Asus website, select OS Android and from utilities download the "Unlock Device App: Unlock boot loader". Now install, follow directions and enjoy your boot-unlocked tablet (yes, this will void your warranty, you have been warned).

For more directions, check this XDA thread: XDA on unlock TF700T

At this point you need root. My recomandation is to install a custom ROM which will do everything for you. Which one is on you, check this link on XDA how to root and custom ROMS for detailed instructions and a list of ROMS. For the multi-boot to work you MUST install either CROMi-X, CROMBi-KK or ZOMBi-X latest versions, on insternal SD only.

Making your tablet unbrickable
While there is basically no threat of briking your tablet, it's strongly advised to follow these steps here on how to make your tablet "safe" from any messing up you might do.

In short: - download this: flatline - install google's ADB and fastboot (from SDK) on oyur linux pc - flash the downloaded custom recovery: fastboot flash recovery flatline_device.im - reboot device to recovery, select "advanced" and "wheelie", select "Step 1: Flash AndroidRoot BL" - it will poweroff. Reboot to asndroid, let it boot, use a bit, then reboot to recovery again - select "Step 2: Generate wheelie blobs" from the same menu as before - when finished, reboot and save from the device the files it has created (check under /data or /tmp for AndroidRoot or similar)

Keep these files safe, they are your lifeline. (NOTE: these instructions are given with no warranty, use at your risk!)

Prepare the storage
I don't advise to install Gentoo on the internal memory, due to the tear-and-wear that might kill it ahead of time. Gentoo, compared to Android, required a lot more writes to disk, so maybe if you want to use internal memory make sure all your portage builds and logs are stored somewhere else. I suggest to plug in a very fast microSD (class 6/10 if supported, mine supports only up to class6 but some get to class10, YMMV). From a linux pc on this mSD prepare two partirions: one, the first, format as EXT4, the second keep as VFAT, for data exchange. Get at least 16gb for Gentoo, the more the better. Of course you can have only one EXT4 and not VFAT if you like.

You could also use a loopback image on the internal memory alongside Android, or you could wipe out android and install Gentoo instead of it... I do not recomand any of these two solutions because both requires you to use the internal memory which cannot be fixed when it breaks down nor recovered if your tablet starts pushing daisies for any reason. You can still access the internal memory anyway fron Gentoo if you need the extra storage or whatever.

Repartitioning the internal memory is STRONGLY NOT ADVISED. I was thinking about it but was discouraged by the fact it does not use any common partition scheme and no linux tools are able to mess with it. Plus the fact that it can really brick your tablet requiring you to grab the lifeline from last paragraph.

Setting up dual-boot
Dual-booting the tablet is done using a kexec method which is just brilliant. The full thread on XDA is here.

In short, with the changed we need for Gentoo: - Check you have a supported ROM and recovery (CROMBi-KK and TRWP for me worked well) - boot into your ROM and make sure you have terminal emulator, root and busybox installed - download this: scripts - extract where you like, usually under /data is the best place (for permissions and ease of access) - don't download any rootfs, you will be making your own with Gentoo on it soon enough - XXXX run script XXX

As Workdowg himself explains on XDA:

"What happens here is by flashing the kexecboot kernel blob (to mmcblk0p4) you are given a menu to choose a rootfs to boot from, ie Android, Linux image file, Linux on a partition... So in order for the kexecboot kernel to be of any use to you, you need to install Android and Linux kernels in your rootfs. It then reboots using the kernel you chose. The config file, boot.cfg, is installed to a small 5MB vfat partition (mmcblk0p5)

''ANDROID: Android mounts root (mmcblk0p1) "/" as /system. So we install a kernel (without modules, you did that when you installed your ROM) to a directory we make called /boot which needs to be in the mount /system directory. This kernel (zImage and initrc.img) is just extracted from _that's cm112 or _that9oc+ kernel blobs and a copied to the /boot directory.''

''LINUX: This kernel was especially compiled by JoinTheRealms from _that5 source using configs moreD_cn came up with. It needs to be installed in /boot of a Linux rootfs."''

At this point you have a working dual-boot on your tablet, we need to build gentoo so you also have something to dual-boot!

Build Gentoo
This is basically the standard Gentoo Handbook, so i will not bore you on the basics, but a few important things must be noted, so please keep reading.

Setting up the storage
One option is to install on a loopback image, i prefer to avoid this, instead we will be installing on a dedicated partition of the microSD. So, plug in your newly formatted microSD with the first partition as EXT4 (format and partition on a PC, android is a mess for these things. It could be done, but it's a real pain!

We need to mount the EXT4 partition, so: - boot Android - fire up your Android Terminal Emulator - become root (type su) - create a temporary folder: mkdir tmpGentoo - mount the microSD: mount -t ext4 /dev/mmcblk1p0 tmpGentoo

Based on your busybox, these instruction might require some tweaking, do your homeworks.

Download stage3 for ARM-hf
The tablet is an ARMv7 with hard floating point. The binary NVIDIA packages which we are forced to install do require you to install this architecture, so go to the gentoo ARM download page and download on your tablet the latest Stage3.

Extracting it into the mounted partition can be hard depending on your busybox, decompressing the stage3 is left to your exercize. If you are desperate, just decompress it on a linux pc then mount the microSD on the tablet.

do the usual gentoo initial stuff
chroot into the uncompressed stage3 and follow the gentoo handbook to install it. Just bear in mind your only network interface is wlan0, you do want to specify the "xxx,noatime" mount option to ensure maximum life and speed from your solid state memories (either mSD or internal). Also, remember you must NOT install any bootloader (lilo, grub, etc) and you CANNOT install a linux kernel, you must use the same kernel you are using in the dual boot we have set up. Since some stuff will need the kernel sources to compile, just emerge git and download there sources to /usr/src and make a symlink called /usr/src/linux to them. You can now reboot android and try out the dual boot, if all goes well, you will get to a grentoo login and you can login as root.

Mask and unmask packages
The provided tegra drivers works only with X up to 1.14 (which is not very stable) and since 1.13 has been masked due to security flaws, you must mask any xorg-server above or equal to 1.13. I recomend the following accept_keywords and mask: 

Install Tegra packages
Download the NVIDIA binary package for Tegra3 DEcompress.... copy the following files: <....>

Install touchscreen and touchpad drivers
from here <> and here <>

Suggested configuration from here
You have only 1gb of ram and swap file is strongly discouraged. So i suggest you install lxde-meta and the nice XDM replacement °slim°. I usually configure it for auto-login due to some strange long delays in the login.

Fine tuning some things
Video standby simply hangs 75% of the times, so forget it. Disable any screen blanking from your screensaver. Instead, use this script: <>

install xbindkeys and the following scripts: <->

In this way you can lock the screen and put the brightness to 0 by pressing the power button. If you don'y do this, well, simply the metal dock will keep pressing randomly your touchscreen all the time... and this is NOT what you want!