[RAZR i Android Development] Robbilie:
Right before the Introduction, I am not responsible for anything you do to you Phone, you are free to do or not to do what I am explaining to you so its on your own risk...

Introduction:

Ok guys so here we are, trying to install a Linux Distro on our awesome x86 Phone...

Damn this doesnt work because our Android is compiled in a different way than ARM Android so we have to wait for better Docs or someone who can get the bootloader to laod a different OS...

But you dont want to wait right?

So here we go, the only alternative:

Chroot into Linux

Description:

Chrooting lets you run annother Linux on top of the currently running Linux (what Android actually is...more or less).

So you mount an existing Linux and simply run it.

What I want to do:

I want to guide you through chrooting and setting up an Arch Linux on your RAZR i.

Requirements:

You need:

A micro SD card (I used a 8GB sized one but 4GB/more than 8 should also work, you just have to adjust some Steps)

An Arch Linux Image (I will give you a link)

(Not required but I will focus on this Platform because I use it myself and it works best, I guess)

A Linux PC running Virtual Box

Tutorial:

First you need an Arch Linux Image. Any other Linux Distro should work fine, but others also take up a lot more Space and Ubuntu for Example has many Problems running in Chroot (because Canonical did some S***).

I used this one:

Arch Linux 2012.10.06

Again, any Version should work fine, just took the latest one ;)

So lets set up our System...

Start Virtual Box and create a new System.

Create a new Hard Drive and size it so it fits onto your micro SD.

I used 5 GB-7.5GB on a 8GB micro SD.

Insert the downloaded ISO FIle into the Virtual Box CD Drive and start your Virtual Machine.

Select the i686 mode (because or CPU is 32bit not 64bit)

If you have the wrong Keyboard Layout Follow this Keyboard Setup Keyboard Config

Next you need to partition the HDD: Partitioning the HDD

Now Install the Base System: Install the Base System

After this follow the next Steps on the Arch WIki (Generate an fstab, Chroot and configure the base system, Set the root password and add a regular user)

DO not reboot because you didnt create a Bootloader (not required for chrooting), instead go to the "Extra" Section and follow all Steps till troubleshooting (DO NOT REBOOT AND DO NOT STARTX this didnt work for, might for you, might not and then you have to cold reboot the VM)

Now you can reboot :D Again enter the Live System, load your keymap and chroot into the system

You might already install some Packages like a VNC server (pacman -S tightvnc) which will be required for a Graphical User Interface later...

To create the Image you need later, the easiest way for me to pull the Image out of the VM (which has no space for this Image) because the Virtual Box Plugin didnt work for me is sshfs.

I highly recommend to install an ssh server ond the sshfs system into you arch.

If you have done so, mount your PC from inside the VM so you can put the Image on your PC's HDD.

now to create an Image of your Arch theres one command and two ways:

You create an Image of the whole HDD (what I did)

You create an Image of the one Partition

I chose the first because i didnt want to put anything else on my micro SD, I cant confirm that the second way works but it is suppoes to so lets create the Image:

We make use of the Linux command dd, really, REALLY mke sure that you are executing from inside the VM since you can harm your HDD and dont forget the file extension....

First method:

dd if=/dev/sda of=/location/to/your/PC/HDD/imagefilename.img

The Second method (not confirmed):

dd if=/dev/sda1 of=/location/to/your/PC/HDD/imagefilename.img

where sda1 should be the partition you want to image...

This might take a loooooooong time :D

Now you have this Image, put your micro SD into an Adapter and put it into your PC.

Now find out the name of the SD, I used gparted and I found out that the name is sdc (could be sd + letter of alphabet)

Here the Ways split again:

The first Method completly overwrites anything that is on your microSD so make a backup, the second Way is just putting the created .img file onto the micro SD:

Method One:

dd if=/path/of/the/img/file of=/dev/sdc

Replace sdc with your micro SD letter, if you put in a wrong letter, you might overwrite your HDD so be careful, I am not responsible for what you do...

For me my Phone said, the micro SD is empty or has a wrong FIlesystem (its ext4) but you shouldnt care, we can mount it anyway...

Now copy the FIle mountscript.sh to the internal SD (the FIle is in this Posts Attachements)

Next open up a Terminal and type in:

cat /proc/partitions

You should get a list of all your Partitions, if you followed my Way, the last one should be your micro SD (look at the size) and called like mmcblk1p1

If you followed the Second Way, you dont need this Step...

Now type in the Terminal:

busybox sh /mnt/sdcard/mountscript.sh

the busybox in the beginning seemed required for me because our busybox is kinda strange...:D

You will be guide through a little setup, I hope it is selfexplaining...

When the script ran through successfully your terminal should look like [root@localhost /]#

In the next Post I will guide you through the Setup of the VNC Server :)

Any questions or something doesnt work? Just tell me :D

//Robert ;)