Showing posts with label Dual boot. Show all posts
Showing posts with label Dual boot. Show all posts

Tuesday, August 16, 2011

Dual booting Android-x86 and Ubuntu

During this long weekend I finally tried out Android-x86 (v2.3.5 and "generic_x86" Target) on my Dell-XPSM1210 laptop. Most of the things (Touchpad, Audio-Out, Keyboard, WiFi, Ethernet) worked right out of the box. Others (e.g. Bluetooth, Audio-In, Mouse etc) are yet to be tested.

Clone, Build and Image-Creation.

I cloned (~3GB) and built the sources from Android-x86 Git repository as mentioned on their wiki-page. This complete process took close to 12GB of my hard-disk space. I chose to build the USB bootable image (make usb_img TARGET_PRODUCT=generic_x86 -j3).

Note:
At first attempt gingerbread-x86 manifest either did an incomplete clone or cloned a wrong branch/commit of "platform/external/elfutils" and "platform/external/elfcopy" projects. You know you need to checkout the correct one (or do a "repo sync" again) if you get errors like "libelf.h or libebl.h not found" during compilation.

After successful compilation I followed the instructions on their installation page to copy the resulting USB image (out/target/product/generic_x86/generic_x86_usb.img) to a USB drive.

First Run and Installation on hard-disk.

Once the image is ready, I restarted my machine and boot from USB disk. Grub is pre-installed on USB disk but the Root is wrongly set (at least in my case it was not correct). It was set to "hd0,1" while mine was/is "hd0,0". You may want to take care of this if you don't see Android-x86 grub menu.

I first did a Live image booting and within few seconds I reached home-screen. Everything worked perfectly. Within next few moments I knew, I was going to install it on my hard-disk which I eventually did :) but without installing Android-x86 Grub bootloader.

Dual Booting Android-x86 and Ubuntu.

I modified Ubuntu Grub2 to add Android-x86 menu entry. It was a bit tricky and took quiet a while to understand that root=(hd0,X) is not a valid root-point and you should use root='(hd0,msdosX)' instead, at-least on Ubuntu Grub2 bootloader. Here is what you need to do:

Create/Modify "/etc/grub.d/40_custom" script:

#!/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.

menuentry "Android-x86 2.3.5" {
    set root='(hd0,msdos2)'
    linux /android-2011-08-15/kernel quiet root=/dev/ram0 \
    androidboot_hardware=generic_x86 \
    acpi_sleep=s3_bios,s3_mode \
    video=-16 DPI=160 SRC=/android-2011-08-15
    initrd /android-2011-08-15/initrd.img
}
       
menuentry "Android-x86 2.3.5 (Debug mode)" {
    set root='(hd0,msdos2)'
    linux /android-2011-08-15/kernel root=/dev/ram0 \
    androidboot_hardware=generic_x86 \
    acpi_sleep=s3_bios,s3_mode \
    video=-16 vga=788 SRC=/android-2011-08-15 DEBUG=1
    initrd /android-2011-08-15/initrd.img
}

Once this menu-entry is created, update Grub2 by running "update-grub2" command as sudo/root user. Now you should see the corresponding entries in Grub2 menu (/boot/grub/grub.cfg) and your machine should boot into Android-x86.

Next task is to explore how to use Android Market if it is at all possible.