[Windows 8 Development and Hacking] ViralThread:
Windows 8.1/Ubuntu 15.04/Android all on SSD and booting.

Greetings, I lurk here an inordinate amount of time, usually spending hours reading threads relevant to projects I'm working on, I like to tinker. My latest success, converting my Asus T100, so I thought I would give something back.

With the help of this thread and every member who participated in it, along with the work of the team at x86 and Ubuntu, I have successfully converted my Asus T100TA into a useful device rather than a dead-weight in my go bag (where it's been since shortly after purchase relegated to managing my growing iTunes collection).

For my setup I wanted to do a Windows/Ubuntu/Android configuration. This post outlines what I did for others interested in repeating the process. Currently I have all three operating systems installed and functional on the internal SSD with the few exceptions noted in this thread, mainly no mic and camera in anything but Windows. Apologies if this information is redundant, if it saves you stress and hassles, worth it.

Enough pomp and circumstance, let's move forward... where applicable, I tried to include the code I used to execute the steps.

To complete this project you will need to have Safeboot disabled on your Asus T100. I only own the Asus T100TA-C1-GR (Craigslist impulse purchase), and do not know if this process will be exact on your machine, mine is the 64GB Windows 8.1 model with the KB dock (no internal HDD on KB). The factory loadout left 49GB for Windows and an 8GB recovery partition to work with. In this project we nuke the recovery data and convert that partition to an Android installation, shrink the Windows partition and drop Ubuntu alongside it.

You will need to have downloaded the T100TA Magicstick v1.6 and have prepped it for use in booting your machine. I'm using an 8GB SanDisk low profile stick for this purpose. This post assumes that you have made a bootable USB Magicstick and verified that it boots and functions as required for Ubuntu and Android. I removed my SDCard before doing anything to the T100 just to ensure there was no funny busines with the Ubuntu installer or confusion when moving files around (turns out Ubuntu 15.04 will not read exfat by default anyhow).

Notable points: The Magicstick mounts the USB device you are loading the system from under "/media/cdrom/". All of the Magicstick files you will need to make this work can be found at this mountpoint. Your ext4 partition should mount itself under the "/media/t100/" tree allowing you to manipulate the files for your Android system using Ubuntu. It will use the UUiD as a mountpoint label.

Step 1: Backup recovery partition and move it to USB stick for safe keeping (just in case we want to go back). For this I used the built in Windows 8.1 tool for creating recovery media on a 32GB SanDisk USB Stick. I will not cover that here, but a quick Google will fill you in.

Step 2: Format the recovery partition as ext4. Once I backed up the recovery data, I rebooted the T100 with Magicstick and using Ubuntu simply formatted the now useless 8GB recovery partition as ext4 using gparted. I will not cover this here but a quick Google will fill you in.

Step 3: Put Android on the newly formatted partition. This was fairly straightforward. Below I have outlined the code which should do the following....

.

create a mount place for the system.img file

mount the system.img file to the mount point

copy the contents of system.img to our Android partition

create a boot directory on our Android partition

copy the boot stuff to our Android boot folder

copy the initrd.img, kernel, and ramdisk.img to their relevant locations on the Android partition

create a folder for your system data

Symlink the initrd.img file for the grub configuration to come later

In the following example, substitute "8fbeb35c" with the UUiD of your android partition. On my system this was "/dev/mmblk0p5" or "/media/t100/8fbeb35c....."

#sudo mkdir /media/android
#sudo mount -t ext4 -o loop <path to system.img> /media/android
#sudo mkdir /media/t100/8fbeb35c/system
#sudo cp -a /media/android/. /media/t100/8fbeb35c/system/
#sudo mkdir /media/t100/8fbeb35c/boot
#sudo cp -a /media/cdrom/boot/. /media/t100/8fbeb35c/boot/
#sudo cp -a /media/cdrom/x86/initrd.img /media/t100/8fbeb35c/boot/
#sudo cp -a /media/cdrom/x86/install.img /media/t100/8fbeb35c/
#sudo cp -a /media/cdrom/x86/kernel /media/t100/8fbeb35c/
#sudo cp -a /media/ramdisk.img /media/t100/8fbeb35c/
#sudo mkdir /media/t100/8fbeb35c/data
#sudo ln -s /media/t100/8fbeb35c/boot/initrd.img /media/t100/8fbeb35c/initrd.img

You can, if you so choose, remove items from the "/media/t100/8fbeb35c/system/app" folder to lean down the install as much as you like and remove items you might not want (I removed the Chinese apps and the Google items I wont be using). You can only do this before booting the system, otherwise if you have initialized the Android system you can use Titanium Backup or ES File Explorer (or similar) to bend it to your liking.

Step 4: Install Ubuntu alongside Windows 8.1

At this point Android should be functional but not bootable, so we install Ubuntu. Following the usual Ubuntu installer procedures, I shrunk my Windows partition by 10GB and gave it to Ubuntu. Let Ubuntu do it's thing, it will find Windows and add it to grub, rebooting will provide you with a grub selection menu listing GNULinux and Windows along with a few others, boot to Linux and give it a test.

Step 5: Add Android to grub

Initially I was making this much harder than it had to be, and kept getting errors finding the Android installation. After soft-linking the initrd.img file to the root of the partition (done in the above codebox).

Then add the following to the "/etc/grub.d/40_custom" file....

[I]#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.[/I]

[B]menuentry 'T100 Android 4.4' --class android-x86 {
insmod part_gpt
search --no-floppy --fs-uuid --set=root 8fbeb35c #<-REPLACE WITH ANDROID UUID
linux /kernel CMDLINE quiet
initrd /initrd.img[/B]
}

Then execute a grub update and reboot, Android should be listed at the bottom of the stack.

#sudo update-grub && reboot

If you are here, you should have a working installation of Windows, Ubuntu, and Android on your T100. All of which have menu entries in your Grub bootloader, and you can proceed as normal. I set my Android install to default so if the machine is off the dock it will boot into Android without needing to manipulate the grub menu. I rarely use Windows without the dock (because it's bad for touchscreen devices, let's be honest), and haven't done much with Ubuntu on touchscreens, but it's my daily driver on my laptops.

To do this, use the following code

#sudo gedit /etc/default/grub

Then add this line to grub (or change it if it's there mine was absent)

GRUB_DEFAULT="T100 Android 4.4"

Save, and execute a grub update

#sudo update-grub

Tweaks: Android looked, well not right. I opened the build.prop file (/system/build.prop) and added a "#Display" segment, under which I added a line for screen density. A quick Google seems to indicate the default PPI for the Asus is 155, so I started with 155 and settled on 165 after several random incremental and decremental changes. Caution, only move the DPI a few points at a time (less than 20), or you might end up starting over (which is easier than it sounds).

#Display <- build properties for display
ro.sf.lcd_density=165 #<- Sets LCD Density, less is smaller, more is bigger

Android is now on an 8GB partition with breathable space for installations. We have decompressed the system.img, so there's a gig five or so in use, but if you need more space you can always use a bigger partition, just adjust your partition table figures when the time comes.

If you end up in a bad situation and you have killed your Android install, you can use Ubuntu to manipulate the Android system and make changes. Like reverting your build.prop, for example, should you get the number too small (hint 75dpi is pushing the boundaries of readbility for sure). If you delete the contents of the "data" folder, it will leave you with a freshly reset "tablet", and upon next boot will reinitialize the Android system from scratch. You can back up this data folder to secure your Android installation when making changes to or testing new images. If all else fails, you can always rebuild the Android partition from the ground up using the Magicstick as we did here, simply copying the system files over and booting it up.

Things of note: As stated, neither the camera nor Microphone work for Linux or Android. I have read reports of them working under random circumstances but have never been able to replicate the results, model specific? I cannot read my SDCard in Android, but it works fine in Windows and Ubuntu. You have to install the exfat tools for Ubuntu "#sudo apt-get install exfat" for Ubuntu to pick up the SDCard (assuming yours is also exfat), and Windows created the stupid thing so it reads exfat. I simply have too much data on it and am too lazy to move it off and format the card as something else so I can move the data back. I'm searching for a solution to get Android to read the card as is.

Audio works in Ubuntu, but only through the right speaker. Both speakers seem to work properly in Android, as usual everything works in Windows (except Windows haha, moving on...).

Cannot seem to get the Camera light to go out, so I slapped a bit of black tape over the camera/light.

Large USB Hard Drives did not seem to initialize properly in Android. My stack of USB sticks, ranging from 2GB to 32GB seem to work just fine, and when I plug in my Toshiba mobile 1.8TB, it picks up the device but never initalizes properly or displays a list of files to work with in any of the file managers I tried (the blue light just flashes at me). USB sticks show up as SDCard in the "Settings->Storage" applet, make sure to unmount them before removal for the usual reasons.

Sleep seems to work properly in Ubuntu, haven't really tested it, but it clearly does not work properly in Android as the screen stays barely lit when it's 'sleeping', Screen lock seems to work as it should, haven't had any wifi issues.

Battery life: seems to drag the battery down faster in the *nix based installations. Not drastically, this might be subjective I haven't done any testing, and to be honest don't use Windows for more than it takes to load mp3s into iTunes and sync my phone.

When I get time later I plan to back up my current Android partition and then attempt an update to Lollipop or Marshmallow. Mostly to see if I can.

Android is blazing fast, much faster than booting from the USB slot on the KB. Ubuntu is nice and smooth, I'm using it to prep this post.

I hope this helps anyone who might be struggling with making this work for your T100.

Good Luck and happy hacking.