HOW TO TRIPLE BOOT ANDROID, MAEMO AND UBUNTU - FULL UBSTRUCTIONS

HOW TO TRIPLE BOOT ANDROID, MAEMO AND UBUNTU - FULL UBSTRUCTIONS

skyler lehmkuhl
Karma: 215
2010-10-02 03:58 UTC
I have set up my n900 in a triple-boot configuration, with Maemo, Android and Ubuntu. Since there seems to be little or no documentation on the web, I have decided to share how I got there. Most of the instructions come from http://talk.maemo.org/showpost.php?p=752676&postcount=51 or http://wiki.nitdroid.com/index.php?title=N900-install.

-----DISCLAIMER-----
These instructions include enabling r&d mode, which can cause your n900 to become unstable or even (potentially) brick it. Neither of these should happen if you follow these instructions, but I take no responsibility if it does.

Okay, let's get started. You will need three things: an n900 running Maemo, a computer running linux (liveCD will NOT work) and a microSD card of at least 4GB. We will install Android first.

Plug in your microSD card and boot up your n900. Open App. Manager on your N900 and search for NITDroid. The NITDroid installer should come up. Install it. Then install rootsh, which will be needed for much of the terminal work. I also reccommend you install nano, which I will use to create the boot menu entry.

Now comes the first partitioning. Much typing on a tiny keyboard follows!
1. Open up the xTerm and become root with this command:

sudo gainroot

2. First unmount the microsd card.

umount /dev/mmcblk1p1

3. For this step you need to know the capacity of your memory card. The Android partition can only be 2GB, so you need to create a FAT partition that is so large there will only be 2GB left. The number must be in MB, example some recommended sizes are 2100, 6100, 14100, 30100. If its 8GB you can choose a number like 6100MB, if its 4GB you can choose a number like 2100MB. If you do not do this correctly you will not be able to use Android Market!

sfdisk -uM /dev/mmcblk1 << EOF
,<YOUR NUMBER IN MB>,C
,,L
,,
,,
EOF

4. Unmount microsd again as maemo sometimes tried to mount it again. If it gives an error, ignore it.

umount /dev/mmcblk1p1

5. The actual formating!

mkdosfs /dev/mmcblk1p1
mke2fs -L NITDroid -j -m0 /dev/mmcblk1p2


Okay, now you will be able to run the installer. Open NITDroid Installer. It will give you a lot of disclaimers and ask you to type "YES" to continue. Type YES. It will run for about five minutes, possibly longer depending on your internet connection. When it is finished, it will close. Shut down your N900.

Now to test Android! Turn your N900 on with the keyboard OPEN. You will get a boot menu with two options, one being Maemo and the other being NITDroid. Press the 2 key to boot Android. It will take a few minutes as this is the first boot. It will then take you to the startup wizard which runs rather slowly. If it seems to freeze, wait thirty seconds or so. I reccommend skipping the Google Account step.

STEP 2: Installing Ubuntu
On your computer, go to http://mohammadag.xceleo.org/public/NITUbuntu/ and download NITUbuntu.tar.bz2. If it is not already installed, install GParted. Boot up your N900 into Maemo by restarting with the keyboard closed. Connect it to your computer and select "Mass Storage Mode". On the computer, fire up GParted and find the microSD card (it will have the second partition labeled "NITDroid"). Unmount both partitions. Shrink the FAT partition to 210 MB. Shrink the NITDroid partition to 1GB and move it all the way to the left. Create a new ext3 partition and name it "ubuntu".

Open the .tar.bz2 you downloaded. Click the "Extract" button and browse to "ubuntu", which should either be empty or contain a folder called lost+found. Extract. The extract will be rather weird because the progress bar fills up and then it keeps going for five minutes, or at least it does in File-roller. Now disconnect the N900. If it doesn't have much battery, plug it into a wall socket.

Now it is time for some more terminal work on your n900! Open up the terminal and type:

mkdir -p /mnt/ubuntu
mount /dev/mmcblk1p3 /mnt/ubuntu
cp -r /lib/modules/* /mnt/ubuntu/lib/modules/
cp /lib/firmware/* /mnt/ubuntu/lib/firmware/
chroot /mnt/ubuntu /bin/bash
useradd -m <REPLACE WITH YOUR USERNAME HERE> (e.g useradd -m skykooler)
visudo
# Edit the file and add your username to sudoers using visudo
# Replace mohammad with your username
# Then press ctrl+x to close, and enter twice to save.
cp /usr/share/applications/gnome-terminal.desktop /home/<YOUR USERNAME>/Desktop/
passwd root
#Type the new root password. Without this you won't be able to enable sudo.
passwd <YOUR USERNAME>
#Type your desired password.
exit
nano /etc/multiboot.d/ubuntu.ext.item
ITEM_NAME="Ubuntu 9.10 Karmic (external SD, partition 3)"
ITEM_ID="ubuntu"
ITEM_DEVICE="${EXT_CARD}p3"
ITEM_MODULES="mbcache jbd ext3"
ITEM_FSTYPE="ext3"
ITEM_FSOPTIONS="noatime,rw"

Press ctrl+x to exit, hit Enter to save the buffer.
Phew! Terminal work done. On N900 at least.
Go back to your computer and go to http://tablets-dev.nokia.com/maemo-dev-env-downloads.php and download maemo_flasher-3.5_2.5.2.2_i386.deb. Open a terminal (on the computer still) and cd to the download location. Install it by typing:

dpkg -i maemo_flasher-3.5_2.5.2.2_i386.deb

Now shutdown the N900. Holding the U key, connect it to the computer. When you see the little usb icon in the top right hand corner, you can release the key. In the terminal, type:

flasher-3.5 --enable-rd-mode --set-rd-flags=no-omap-wd,no-lifeguard-reset,no-ext-wd

IMPORTANT: This will put your N900 into R&D mode. You can seriously mess it up if you aren't careful. Be careful.
Unplug the N900 and restart it. Press 3 to boot Ubuntu. It should boot, and try to automatically log in as "user". Quickly press "Cancel". "user" has no priveleges. Log into your account. After a little while the desktop should load. Go to system>preferences>Login Screen and either uncheck "Log in automatically" or change the user to you.

You should now have a working triple boot!
Please feel free to post suggestions or corrections.
  •  Reply

Re: HOW TO TRIPLE BOOT ANDROID, MAEMO AND UBUNTU - FULL UBSTRUCTIONS

skyler lehmkuhl
Karma: 215
2010-10-04 15:25 UTC
UPDATE: Add a swap partition to speed things up!
With the N900 running Maemo, connect it to your Linux pc. Start gparted, unmount the partitions on the microsd card as before. Then shrink the "ubuntu" partition by 256 mb (more if you have a bigger card than 4GB) and fill the remaining space with a swap partition. Ubuntu should run a good deal faster on bootup now.
  •  Reply