Thursday, October 11, 2012

Transformer Prime and Linux Installer

Android is a great platform for consuming. I means, using it for internet, email, read books, keep your notes, etc. One may go as future as write a book, create art work, edit photos, compose musics, etc. There is an app for every thing you want, even for a linux enthusiastic like me. What I mean is I can use linux side by side with android.

First of all, you can find instruction to install Ubuntu on prime here on the xda-developers site, if you are interested. It's risky, but you will get full ubuntu running on the prime. I won't go into this approach thou. It's not what I aim for.

For me, I prefer another method, chroot to a linux image file. This method allow me to run linux along side with android. I can do things that android does great, like reading email, facebook, websurfing, view pictures, read books, etc. I also can do things that normally android won't allow you. Actually, I can do pretty much every thing that linux provide you.

The idea is to create a linux image file on your android device, mount the image file to android system, and chroot to it.

Guess what, there is an app for that too. It's call "linux installer". Unfortunately, it's some what doesn't work perfectly on transformer prime.

The app work only with rooted device, which mean you need to unlock you prime. After installed linux installer 4.1 (the version at the time this blog is written) from the market to your prime, you have to setup before you can go ahead with installation by select menu and setup. By default, there are couple options are disable. I choose to enable all of them, specially
  • Bind Android
  • Allow write to /system
  • Allow remount with dev/exec
should be turn on. It's make the chroot integrate better with android.

By default, the debian/squeeze is chosen for distribution/version. Don't forget to choose your hostname, and domain name. I leave the chroot launcher script and other options untouched. 

For the loop file location, I leave it at the default location. You should take note where it is. My is "/storage/sdcard0/Linux.loop". It's important that you need to know about this.

For the loop file size, it's need to be above 300MB. However, we are not going to use this loop file anyway, so choose some thing small, say 300.


After exist the menu, you now can process with installation. If this is your first time, you need to create a target loop, which will create loop file at the location you specify. Then format the target loop. It's take time, specially if the loop file is big.

If all go well, you should be able to mount the target loop. Then try to "install in loop", which basically install linux distribution you choose to the loop file. 

Here the installation stop! I get an installation dialog which keep running, no sign of error or success. You can see the progress in the message box next to the linux symbol. I get an error in here. No matter what I try, it's seem I can not finish "install in loop" process.

Fortunately, I successfully install in loop on my phone. That mean, I have create a working Linux.loop image file on my phone. More importantly, my phone, the Atrix 4G, has the same CPU architecture as prime, armel (Tiger 3). All I have to do is copy the Linux.loop from the phone to the prime. And continue the installation on the prime. After mount the new loop file, you have to install linuxchroot, this menu become available only if your Linux.loop file is create successfully. In this case, on other device.

In short, I create the Linux.loop file on other device, copy over and use it on my prime device. The most important thing is, it's have to be the same cpu architecture. Otherwise, it's won't work.

My Linux.loop file is 3000MB, which big enough to install all software I want, and still have some space to spare. I am fortunate that my phone has enough space to create this big loop file. If you don't, you can create a smaller file, then use any linux box to create a bigger loop file, format it, mount it using loop device (that why they call it's loop file), and copy the content over. It's will work with no problem. 

I contact the developer, and learn that the problem is in the busybox embedded in the version 4.1. It's will be fixed in 4.2. Until then ...