EDIT:- I'm having problems loading screenshots. I'll investigate this later. In the meantime you can download the complete document from Dropbox:- http://db.tt/qyU6nJAJ
UPDATE 1 (15:10 GMT 9/3/12) How to remove the need to use Drive mount - See page 12, post #68
Cass found an old thread that showed a way of running Ubuntu linux natively (not a chrooted version) on the Vega without affecting your android rom; the Ubuntu system is installed on your SD card. I tried it and it works. Without a suitable bootloader it is not possible to have a multi-boot startup option, so moving from android to linux and back again is a little clunky, but it works. There is an open-source bootloader called "U-Boot" that has been ported to Tegra2 devices so multi-boot may be possible in the future.
The Ubuntu system monitor
Ubuntu system monitor.JPG
The Ubuntu Unity 2D desktop
Ubuntu Unity desktop.JPG
The history of this project
The thread at MoDaCo (Ubuntu Linux 11.04 (natty) on Vega (update 13/4) - Android @ MoDaCo) that started this project was short-lived. It was started on 22 February 2011 and effectively finished on 14 July 2011. The final updated image that we are using was posted on 13 April 2011. There have been no significant posts since July; merely some expressions of interest that have received no replies. Having read all the posts it seemed to me that for the few people who were actively involved in the project, it simply worked well enough for their needs, and they moved on to other things. I visited hybr1d's personal website and saw that he now has an Asus Transformer, and has therefore probably lost all interest in Vegas. There was no mention of this project that I could find in any of his archives. I also found a post by Zebrahead, another active contributor, saying that he also no longer had a Vega.
Overview of procedure
What I have done is to reduce the information in the MoDaCo thread down to a few simple steps. First you must create an ext3 partition on your SD card. Then download or locate the four files you will need. Once everything has been installed you need to enter a simple set of commands in the android Terminal Emulator that will flash the linux kernel to the Vega's boot partition, and then reboot. You will eventually find yourself looking at the Ubuntu Unity 2D desktop. To return to VegaICS you must enter a similar set of commands in the linux terminal that will flash the VegaICS boot image to the boot partition. When you reboot you will find yourself back in VegaICS. As I said, without a bootloader that can multi-boot, switching between android and linux is clunky.
The nightmare scenario
There is a nightmare scenario that you should be aware of. The first time I tried this I forgot to put the Vega boot image into the ext3 partition. This meant I had no way to flash the Vega's boot partition with the ICS boot.img. No worries, I thought. I'll just connect the Vega to my PC with the USB cable, go into recovery and reinstall Beta1. Wrong! One second after you press the power button the linux boot sequence starts up. I solved that problem by putting my SD card into my linux box and copying the missing file to it.
However, it raised the possibility that if something goes wrong with the boot sequence and you can't get to a linux prompt to flash the VegaICS boot image, then your Vega is effectively bricked. There may be another way of getting into recovery mode, but if there is I don't know it. As we all know by now, our Vegas can behave differently and just because everything worked for me doesn't mean that it will work for you. You have been warned.
NOTE: Having said that I've now been round the android->linux->android loop dozens of times with no problem. Just make sure that your battery is charged.
A possible safer method for the future
One of the posts in the MoDaCo thread suggested a possible alternative procedure that doesn't have the nightmare scenario, but nobody reported trying this. It involves flashing the linux-kern.img to the recovery partition used by clockworkmod, instead of the Vega's boot partition. There may be problems with this approach that I am unaware of. We shall have to ask Cass about this.
In principle this means that when you use the recovery.apk, instead of booting into cwm you boot into linux. When you exit linux and reboot you will boot into ICS because the original boot partition was not changed. So even if you have a problem with linux not booting, the Vega will start normally if you power down and restart. I don't use cwm every day so I would be happy to use this method. There is bound to be a way of easily re-installing cwm for those occasions that you need it to flash updates. I've also seen scripts to make and restore nandroid backups from your PC using adb, but I haven't tried them yet.
Partitioning your SD card
The Ubuntu image is 1.8GB in size and you will need space for the vega_root.tgz file as well, so the minimum size for the new partition is about 2.5GB, and it must be formatted as ext3. I would recommend 4GB to give yourself some space. The usability of this installation is dependent on the speed of your SD Card. I have a 32GB Class10 card and I made a 6GB partition; this gives me 4GB free disk space when running Ubuntu.
The pre-built Ubuntu image expects to find it's ext3 partition as the second partition on the card (mmcblk0p2); there can be other partitions after it if you need them. Use whatever is your favourite partition manager to create a new partition; clockworkmod should be able to do this, but I haven't tried it. At this point test the card on your Vega. You will need Drive Mount to do this (https://market.android.com/details?i...ach.drivemount - if you don't already have it). In Drive Mount turn off device filtering and then use the re-scan icon. The partitions on the SD card should appear on the left. Select mmcblk0p2 and tap the mount icon. If it mounts it will show up on the right (see screenshot). I find that sometimes I have to hit mount twice before it shows up. Now check this by going to File Manager and tap the mnt icon. You should see mmcblk0p2 listed.
It would be nice to have this partition auto-mount at boot, but that would require adding an entry to vold (Volume Daemon for GNU/Linux) in the r/o system, so again we are going to have to ask someone to do it for us.
Drive Mount showing mmcblk0p2 mounted
3) mmcblk0p2 mounted in Drive Mount.JPG
File Manager also showing mmcblk0p2 mounted
4) mmcblk0p2 listed in File Manager.JPG
Gather the images and software you will need
Download the two Ubuntu files you are going to need. They are linux-kern.img and vega_root.tgz, available here:- Index of /vega. Some people seem to have corruption problems downloading large files on the Vega so I would suggest doing it on your PC.
Download flash_image.zip from here:- [GUIDE] Flash any recovery easily on the phone using flash_image - xda-developers. It's at the bottom of the first post.
Find the VegaICS-Beta1 boot image. Go to the file VegaICS-Beta1.exe you used to install ICS. In Windows right-click on the exe and extract the files within. You should see an image file for each of the Vega's partitions.
The files inside VegaICS-Beta1.exe
Unzip flash_image.zip. There is only one file in it - the binary, flash_image (26KB).
Place this, the vega_root.tgz file, the linux-kern.img file and the VegaICS boot image into a directory on your SD card first partition.
Preparing the Ubuntu filesystem
Copy all four files to the empty ext3 partition you created. The default File Manager can't do this. I use Root Explorer to go to /mnt/mmcblk0p2 and set it to r/w and then files can be copied into it, other file managers may also work. This is also a simple way to copy files to/from your linux once it's working.
If you don't already have it, download and install Terminal Emulator (https://market.android.com/details?i...roidterm&hl=en). Mount your new partition (see above). Start Terminal Emulator and issue the command "su" to gain root privileges. Then move to the new partition with "cd /mnt/mmcblk0p2". Enter the command "ls" to list the contents to make sure that all four files are there. If they are not all there do not proceed.
I tried extracting vega_root.tgz on one of my linux boxes, but it failed with errors that seemed to me to indicate that this must be done on the hardware it expects to run on, so we are going to do it in the terminal session that's still running. Enter the command "tar xvf vega_root.tgz". A load of file names will fly past as they are extracted. Go and make a cup of your favourite beverage. If there are no errors you will eventually find yourself back at the prompt. Try "ls" again and you should see the linux filesystem directories appear. If there are any error messages do not proceed; delete all the files and try again.
The linux filesystem showing in Terminal Emulator
Booting into Ubuntu
Now we are ready to start to use Ubuntu (please read the Disclaimer before you start).
Make sure that mmcblk0p2 is mounted and start the Terminal Emulator (it may still be running) and enter the command "./flash_image boot linux-kern.img && reboot". This flashes the Vega's boot sector with the linux-kern.img and reboots the tablet.
The command to flash linux-kern.img to boot partition
What happened to me when I first did this is that the backlight came on and nothing happened! I allowed a few minutes in case it had to a lot of housework on the first boot, but still nothing happened! So I held down the power button until the backlight went off, counted to ten, and held down the power button until the backlight came on again. This time (after a short while) a couple of linux penguins (tux) appeared and then a lot of scrolling text as it went through its boot sequence. Then there was another period of blank screen before the Ubuntu Unity 2D desktop finally showed up (Unity just takes a long time to load). So if you have a problem with booting, just power down and try again. This may be a quirk in the system; it happens to me every time.
Booting back into VegaICS
I'd advise you to test this before you do anything else; certainly before making any changes to the installation. The virtual keyboard (Florence Virtual Keyboard) drove me crazy after about 30 seconds, so I tried a USB keyboard. This works fine, and if you are going to use this Ubuntu at all you are going to need one. Mine is a £10 chiclet keyboard that I bought when I got my Vega. To toggle florence on/off tap the keyboard icon on the status bar at the top right.
Drag the pointer with your finger to the Ubuntu control button at the top left and tap it (only single touch is implemented in this image). When the large icons appear select "More Apps". When more apps appear select "Terminal".
Now enter "su" and enter the password "root". Then enter the command "flash_image boot boot.img && reboot". This flashes the boot partition with the VegaICS boot.img, and when you reboot you will be back in ICS. It seems to take a long time to boot into ICS, but it does happen eventually. If you find that the tablet doesn't reboot, hold the power button down for 10 secs to fully power down. Wait a few seconds then try powering on again.
Command to flash boot.img to boot partition
Using this Ubuntu image
In this howto I've concentrated on installing Ubuntu and moving between android and linux. This has left me with little time to try out the image itself. Ideally I'd rather use the Gnome desktop, which I'm familiar with, or a lightweight desktop like LXDE. If they are all installed you normally select which you want to use for your session at the login screen. Unfortunately the image was created so that you auto-login and don't see this screen. The way to get back to a login screen is to use the power option icon at the top right. But in this image, although the icon reacts to the pointer, no menu drops down. So for the moment you have to learn to use Unity; there are many online tutorials (e.g. Introduction To The Ubuntu Unity Desktop | HowtoForge - Linux Howtos and Tutorials and How To Bring App Icons Back Into Unity’s System Tray - How-To Geek). From a terminal it is possible to uninstall Unity and install Gnome or LXDE instead, but I haven't had time to try this.
The default user's name (you) is "ubuntu" and the password is "ubuntu". The root password (for when you use "su" in the terminal) is "root".
The posters on the MoDaCo thread say that a USB mouse works and so do a wireless keyboard and mouse, but I haven't got any of these to test with. All I can vouch for is that a USB keyboard works, and you can "drag and click" the onscreen pointer. The only other essential to get things started is wifi.
Wireless does not work out of the box! The GUI tools I am used to using in Gnome are either not installed or not working. So I've had to learn how to set up wireless from a command line. My network is WPA secured, so I had to find a method that works for me. For WEP secured and unsecured networks the procedure will be different. My starting point was a post in the MoDaCo thread (page4/post67). I entered these two lines in the terminal (su, password, commands); ESSID is the name of the network (mine is linksys_SES_54124 ) and PASS is your password (mine is bessiebrown):-
wpa_passphrase ESSID PASS >> mywireless.conf
wpa_supplicant -i wlan0 -c mywireless.conf
Once it showed "CTRL-EVENT-CONNECTED", I opened another tab in the terminal in order to get back to a prompt (tap title bar to bring up "File" and other menu options). I logged in as root again, and then issued this command to get an IP from my router:-
Now I started Firefox and it connected.
For other than WPA secured networks, to set up a wireless connection from the command line, start a terminal session as root. First enter the command "iwconfig"; this will confirm that the ar6000 module is loaded.
Once it's been set up your wireless interface will be wlan0. I'm afraid that now you're largely on your own. Help each other out. Eventually I found this page (How to connect to a wireless network from the Ubuntu command line – t+1), which helped enormously. To test whether or not you have successfully created a connection you will have to try running Firefox (or any other application that needs network access). Note that even when connected no network icon appears in the status bar. You can probably change this behaviour (How To Bring App Icons Back Into Unity’s System Tray - How-To Geek).
Break the task down into two parts. First test that wlan0 is working by issuing this command; it will show networks within range:-
iwlist wlan0 scan
Once you can see networks, any networks, it means that your tablet is talking to your router. The second part of the task is to make a connection. When you have connected for the first time stay connected and install a graphical network manager to make life easier. "wcid" might be a good choice. You can install new programs by using the Ubuntu Software Centre (on the launcher), the Synaptic Package Manager (also installed), or by issuing this command in a terminal as root:- apt-get install [PACKAGE NAME]. For wicd the command would be:-
apt-get install wicd
apt is a very useful and powerful command (https://help.ubuntu.com/8.04/serverguide/C/apt-get.html). This page is a good place to see how to install some popular programs using apt:- To Do List After installing Ubuntu 11.04 aka Natty Narwhal « The Indexer. There are some packages that are not in the official repositories, and apt comes in handy in these situations.
Where do we go from here?
To progress with this project we are going to need some skilled help. The open-source bootloader U-Boot (WebHome < U-Boot < DENX and http://free-electrons.com/doc/u-boot.pdf and Das U-Boot - Wikipedia, the free encyclopedia) does work on Tegra2 devices, so a multi-boot option is a realistic possibility. To upgrade the Ubuntu image to version 12 (12.10 is available now and 12.04 LTS will be released in April) is going to need someone with some real linux skills; e.g. finding/writing/patching drivers, and creating new images. We also need to implement the missing features in this image (notably sound and bluetooth according to one post; I've not tested these) and add new ones, such as multi-touch. I have no skills whatsoever in any of these areas. Cass and Eduardo have their hands full at the moment, but if we ask them nicely they might know of someone who can help. If nothing more than a working multi-boot bootloader comes out of this project it will have been worthwhile.
The credits go to hybr1d for starting the MoDaCo thread, the others who helped him, especially Zebrahead, and to Cass for pointing it out to me.
This project should be regarded as an experiment. I shall not feel responsible if you brick your Vega (see the Nightmare Scenario, explained above). As we all know by now, our Vegas can behave differently, and just because everything worked for me doesn't mean that it will work for you. You have been warned.
If you have read this far, and have read all of the MoDaCo thread, then you now know as much as I do. This is my first howto, so please excuse any errors or omissions.
EDIT:- I'm having problems loading screenshots. I'll investigate this later. In the meantime you can download the complete document from Dropbox:- http://db.tt/qyU6nJAJ
Last edited by xathras; 03-09-2012 at 08:01 AM.
I'm game for sure. XBMC on my Viewpad 10s, proper native Firefox and Flash? YES PLEASE.
Definitely up for this
Count me in...
very good thread
looking forward to this!!