Asus Transformer Prime

Installing Gentoo on the Asus Transformer Prime (TF201)

This is an initial introduction to installing gentoo on the Asus Transformer Prime (TF201). At the moment, we can get it to boot and launch X, but there are quite a few problems. Hopefully, this site will invite others to share their own experiences, and maybe even generate some solutions to these problems.

INSTRUCTIONS
The basic steps are as follows:

PRELIMINARIES
This guide assumes that you have installed the Jelly Bean update from ASUS.

CREATE A CHROOT
(Alternatively, you can do a cross-compile installation on some other box and use rsync to copy the resultant files over to the TFP. You will still need to extract our root_patch.tar.gz.)

The first step is to install gentoo on the TFP inside a chroot environment. You can follow the standard Gentoo Installation Guide here, with the following exceptions. In what follows we assume you will be placing your gentoo installation in the TFP directory /sdcard/gentoo. I found it easiest to install gentoo on the microSD card (mmcblk1p1) and mount that card in /sdcard/gentoo.

If you don't trust us, then run: # emerge linux-firmware (or just mkdir /lib/firmware) # mkdir /system && ln -s /lib /system/vendor && ln -s /lib/firmware /system/etc # (outside chroot) cp -R /system/vendor/firmware/* /system/etc/*.txt /sdcard/gentoo/lib/firmware # Also add to /etc/conf.d/modules: modules="bcm4329" module_bcm4329_args="iface_name=wlan0" # Compile your own kernel (see below) to populate /lib/modules. FEATURES="-sandbox" emerge -1 packagename
 * 1) You should use the armv7a-hardfp stage3.
 * 2) Download and extract root_patch.tar.gz inside your chroot.  This will install some configuration files and the kernel modules and the (binary) firmware.
 * NB: I found that mounting /dev/pts to /sdcard/gentoo/dev/pts before you chroot allows tmux to work.
 * NB: I also found that adding -userfetch to make.conf FEATURES fixes an emerge error about being unable to fetch packages.
 * NB: You will also need to establish /etc/resolv.conf by hand, by adding "nameserver x.x.x.x" to it inside the chroot. You can get the nameserver in Android by running getprop.
 * NB: You must install wpa_supplicant, dhcpcd, and sshd and add them to the default run-level.
 * NB: It would be easiest to disable qt4 USE flag with respect to wpa_supplicant (for now).
 * NB: If you get a "sandbox violation" error while emerging, you have to emerge the single package that cause you this as follows:

FLASHING THE BOOT IMAGE
Download test.blob onto your computer (not the TFP), and flash it onto the TFP using the 'fastboot' utility. (For instructions on how to re-generate a test.blob, see below.) In order to do this, do the following:


 * 1) WARNING: AS USUAL, FASTBOOT AND THE TFP ARE CRANKY AND SO WHAT FOLLOWS MIGHT "BRICK" YOUR DEVICE.  PLEASE RESEARCH THE FASTBOOT UTILITY BEFOREHAND.
 * 2) Put the TFP in 'fastboot' mode: connect it to the computer via a usb cable, install ClockworkModRecovery app on the TFP, reboot the TFP and hold down VOLUMEDOWN upon reboot; once in fastboot mode, select the USB ICON (VOLUMEDOWN to move, VOLUMEUP to select).
 * 3) Flash the blob to your TFP: fastboot -i 0x0b05 flash boot test.blob.
 * NB: 'flashboot devices' will claim there is no device. But it is there.
 * NB: Proof that it all worked: a blue bar will show up on the tablet once you run the 'fastboot flash' command.

Once you have finished flashing the blob, you should be able to reboot the TFP and it will boot into Android (not Linux). In order to have it boot into Linux, head to the next section.

CONFIGURE BOOT_CHOOSER2
The blob we provided (the source of which will be linked below) executes a program called init which in turn calls a program called boot_chooser2. Boot_chooser2 will mount the 8th partition of your eMMC, and read the first line of the root-level file '.blob'. The first line of the file will be parsed as "device:directory:init" where: 'device' is the block device where you put your gentoo system. [ e.g. /dev/mmcblk0p8 or /dev/sda1 ] 'directory' is the directory inside the previous device where your gentoo lives. [ e.g. gentoo ] 'init' is the init script location in your gentoo root, usually /sbin/init. If anything goes wrong the boot_chooser2 program will just boot into Android.
 * 1) TODO: check for init existence before chrooting

So, if you have your chroot under /data/gentoo your /data/.boot file will look like: /dev/mmcblk0p8:/gentoo:/sbin/init If you bootup from a USB stick: /dev/sda1:/:/sbin/init If you bootup from microSD: /dev/mmcblk1p1:/:/sbin/init

GENERATE A TEST.BLOB / COMPILE THE KERNEL

 * 1) Unpack the blob to generate a .LNX file: blobunpack test.blob
 * 2) Extract the zImage and initrd from the .LNX file: abootimg -x test.LNX
 * 3) Extract the initrd: mkdir tmp && cd tmp && gunzip < ../initrd.img | cpio -i --make-directories
 * 4) Regenerate the initrd (from tmp): find . | cpio --create --format='newc' > ../initrd.img && gzip ../initrd.img
 * 5) Regenerate the zImage (kernel): AS NORMAL (TODO: LINK TO THE SOURCE AND CONFIG FILE)
 * 6) Regenerate the .LNX file: abootimg --create test.LNX -r initrd.img -k zImage

KNOWN BUGS
Solution: There is none. Make sure you have sshd installed.
 * Problem: After I launch X and I kill X, the screen is blank.


 * Problem: The touchpad don't works


 * Problem: The Sound don't works


 * Problem: Composing don't works due to unavailable graphics shared memory.

Please contact peter period hartman at utoronto period ca a.k.a. wart_ in #gentoo-embedded (and elsewhere)

Or contact massimo period dragano at gmail period com a.k.a tux_mind all over the internet