[Transformer TF300T Q&A, Help & Troubleshooting] Geometry:
rootfs for xubuntu 14.04 - PART 1

Here I describe in more detail the first part of the installation of the root file system (rootfs) for xubuntu 14.04 on the Asus TF300T. I will assume that the installation is to the root of an empty partition.

I. PREPARE ROOTFS:

1. CORE ROOTFS: Download the file

"ubuntu-core-14.04.1-core-armhf.tar.gz"

from the Ubuntu repositories. (Search for "ubuntu core" to find the site, I cannot post the link.) Extract this to the xubuntu partition. This is the initial rootfs.

This rootfs already works in a chroot, either from an existing linux installation or from Android. However, for this to be more useful we need to set up internet access and repositories.

2. INTERNET SETUP: Extract the attached file "inet-setup-trusty.tar.gz" into the rootfs. This sets up the relevant ubuntu repositories and fixes DNS lookup and gives the machine a name. Here I chose "tf300t-linux". To change the name, edit the files "/etc/hostname" and "/etc/hosts".

Before entering the rootfs via chroot, we set up more infrastructure for the ability to later run the rootfs stand alone. This requires a kernel.

3. KERNEL SETUP 1: Extract the kernel modules into "/lib/modules/..." and the kernel firmware into "/lib/firmware/...". If you compiled the kernel youself, these files will have been generated in the process. If you take the kernel from elsewhere these files have to be provided with the kernel.

4. KERNEL SETUP 2: To ensure relevant modules are loaded at boot, a file "/etc/modules" might be needed. This depends on the kernel. Assuming you compilde the kernel following my instructions in a previous post, just extract the attached file "initmodules.tar.gz" into the rootfs.

We shall later use "update-initramfs" to generate the initial ram file system, a file named "initrd.img". For this to work we need the following:

4. KERNEL SETUP 3: Put the kernel image into "/boot/". It should be called "vmlinuz-3.1.10" or similar. Also put "config-3.1.10" and "System.map-3.1.10" into this directory. These are also generated when compiling the kernel. I am not sure if "System.map-3.1.10" is required. "config-3.1.10" can be extracted from the kernel image if not provided. (See instructions elsewhere.)

5. INITRD CONFIG: For "update-initramfs" to work correctly a configuration file is needed indicating the root partition. This goes into "/etc/initramfs-tools/conf.d/". You might just extract the attached file "initramfs-mmcblk1p1.tar.gz". This assumes that xubuntu uses the partition "mmcblk1p1" with "ext4", i.e. the first partition on the external micro sd card and fomatted with the "ext4" file system. If you use a differnt partition and/or file system, edit the included file "/etc/initramfs-tools/conf.d/specify_root_device" accordingly.

6. WIFI: For wifi to work you need a file "nvram.txt". This is located under Android in "/data/misc/wifi/nvram.txt". Copy this to the rootfs at "/lib/firmware/nvram.txt" if you use the kernel I describe in a previous post. Otherwise the required location might be different. You can read it off in the kernel config file "config-3.1.10". (Search for "*NVRAM_PATH*".) Also you need firmware files. Under Android these should be under "/system/vendor/firmware/". Copy them to "/lib/firmware/" or see the location in the config file (search for "*FW_DIR*"). Note that these files include subdirectories, copy with subdirectories.

7. BLUETOOTH: You need a firmware file. This should be in Android under "/system/etc/firmware/". Its name should start with "BCM4329...". In the rootfs name this "/lib/firmware/BCM4329.2.hcd". You need an executable called "brcm_patchram_plus" which loads the firmware dynamically. This goes in the rootfs into "/usr/sbin/brcm_patchram_plus". Go to the site of the Linux for Tegra R16 project of Nvidia. Download "Tegra30_Linux_R16.4.0_armhf.tbz2". Inside look for "Linux_for_Tegra/nv_tegra/nvidia_drivers.tbz2". Inside this you find the executable "/usr/sbin/brcm_patchram_plus". You need a process that automatically calls this executable. It is convenient to integrate this with ubuntu's upstart. To this end just extract the attached file "nvbt.tar.gz". It yields a file "/etc/init/patchram.conf". I have adapted this file from previous work on xda on bluetooth for linux on the tf300t or tf700t (but can't find the post now). Modify this if you want to change the name or location of the firmware file.

8. GENERAL CONFIG: To fix some general configuration parameters for the tf300t extract the attached file "nvinit.tar.gz". This yields a file "/etc/init/nv.conf". Again, this is from prvious work on xda for the tf300t or tf700t (but I can't find the relevant post now).

II. ENTER ROOTFS:

I suppose you have mounted the partition for xubuntu at "/mnt/linux", either under an existing linux or under Android.

> LC_ALL=C sudo chroot /mnt/linux

update repositories:

> apt-get update

this is useful for a smooth installation of packages:

> apt-get install dialog

now install upgrades:

> apt-get dist-upgrade

create your user:

> adduser username

> addgroup username adm

> addgroup username sudo

generate initramfs and leave chroot:

> update-initramfs -c -k 3.1.10

> exit

This generates a file "/boot/initrd.img-3.1.10". This file together with the kernel image are needed to boot into the newly set up system.

III. BOOT ROOTFS:

You should now be able to boot into the system. How this is done depends on your set up. There are lots of threads on xda devoted to this subject. You should now have a functional minimal linux system based on ubuntu 14.04.

If you want to install packages it is convenient to download these from the chroot (where wifi is available) and before booting into the system as follows:

> apt-get -d install package1 package2 ...

Then after booting, install them via,

> sudo apt-get install package1 package2 ...

The details of the further set up of the GUI and of the full xubuntu 14.04 will be described in a subsequent post.