[Acer Iconia A500] p-ille:
I'm posting this in a new thread as requested...

There is a simple way to preapare a custom Ubuntu image file compiled for ARMEL with only the packages and functionalities you need.

For this procedure you will need

- a linux machine with working ADB (I tried it on a x64 ubuntu machine)

- a rooted Iconia A500 with busybox installed

- a little knowledge about what you're doing, but just a little.

1. Install Rootstock

on your linux machine, open up the terminal and type

sudo apt-get install rootstock

If you use at least Ubuntu Karmic, it should automatically pull all the dependencies, otherwise you'll have to manually install Qemu and a newer debootstrap.

2. Create the tarball

you're ready to download the packages and prepare the tarball.

Remember: rootstock doesn't automatically include a kernel, so you'll have to manually include it in the package list

Here's the syntax for a basic run (run "man rootstock" for all the parameters):

sudo rootstock \
--fqdn [COLOR="Red"]<YOUR_CHOSEN_HOSTNAME>[/COLOR] \
--login [COLOR="Red"]<YOUR_CHOSEN_USERNAME>[/COLOR] \
--password [COLOR="Red"]<YOUR_CHOSEN_PASSWORD>[/COLOR] \
--imagesize [COLOR="Red"]<IMAGE_SIZE_IN_GB>[/COLOR]G \
--seed [COLOR="Red"]<LIST_OF_PACKAGES_SEPARATED_BY_COMMAS>[/COLOR]

Here's an example for a 2GB image with OMAP kernel and a complete Kubuntu-desktop distribution:

sudo rootstock \
--fqdn ubuntu \
--login ubuntu \
--password ubuntu \
--imagesize 2G \
--seed linux-image-omap,kubuntu-desktop

In --seed you can specify whatever package you want. You could start with just the kernel and build-essential, then add whatever you need. A good start could be like this:

--seed linux-image-omap,build-essential,lxde,tightvncserver,openssh-server

This will give you a running ubuntu with a very light, performance-oriented desktop environment (lxde) with ssh and vnc.

Remember: It's still possible to add new packages with apt-get from chroot whenever you want.

Once you have chosen the packages you want, you just have to press enter and rootstock will automatic download the packages and prepare the tarball.

You'll end up with a file named "armel-rootfs-<TIMESTAMP>.tgz"

3. Prepare the img file

This is very easy and quick:

dd if=/dev/zero of=arm_ubuntu.img bs=1MB count=0 seek=[COLOR="Red"]<SIZE_IN_MB>[/COLOR]

The seek parameter defines the size in MB of your image. make it as large as you want, it should at least be as big as the size you selected for the tarball (2G in my example).

Remember: 1 GB = 1024 MB

Now we format the image. Since the Iconia supports ext4 file system, we can use it!

mkfs.ext4 -F arm_ubuntu.img

You may want to pass other flags to define advanced options, labels and reserved blocks, but this is the least you need to make it work.

4. Decompress

Now we have to mount the img file in a loop:

sudo mount -o loop arm_ubuntu.img /mnt

and decompress the tarball into it.

sudo tar -C /mnt -zxf armel-rootfs-<TIMESTAMP>.tgz

It's done!

[OPTIONAL]

This is the right time to put custom scripts in /mnt/usr/bin like this one to start the vnc server with the correct geometry for the A500:

#!/bin/bash
rm -fr /tmp/.X1*
vncserver -geometry 1280x752

NB: the A500 screen is 1280x800, but the honeycomb statusbar (1280x48px) is always on top. To avoid panning to show the ubuntu menu bar, we just subtract those 48 pixels from the ubuntu vertical resolution.

Now we just umount it.

sudo umount /mnt

5. Load on the tablet and get it running

The script to mount and boot is derived from the one in the Backtrack 5 Thread.

Load the img file on the tablet with

adb push arm_ubuntu.img /sdcard/ubuntu/arm_ubuntu.img

It will take a loooong time and there's no progress bar, so just have faith.

Next, we prepare the boot script. The only thing you need to do is to put your username in (the one you chose in rootstock).

perm=$(id|cut -b 5)

if [ "$perm" != "0" ];then echo "This Script Needs Root! Type : su";exit;fi

mount -o remount,rw /dev/block/mmcblk0p5 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
export mnt=/data/local/mnt
mkdir -p $mnt
export PATH=$bin:/usr/bin:/usr/local/bin:/usr/sbin:/bin:/usr/local/sbin:/usr/games:$PATH
export TERM=linux
export USER=[B][COLOR="Red"]<THE_USERNAME_YOU_CHOSE_BEFORE>[/COLOR][/B]
export HOME=/home/$USER
export stor=$mnt/home/$USER/storage
export sdcard=$stor/sdcard
export extsd=$stor/external_sd
export usb=$stor/USB_storage
if [ -b /dev/loop2 ]; then
echo "Loop device exists"
else
busybox mknod /dev/loop2 b 7 0
fi
mount -o loop,rw,noatime -t ext4 $kit/arm_ubuntu.img $mnt
echo "mounting storage devices in $stor..."
mkdir -p $sdcard
mkdir -p $extsd
mkdir -p $usb
busybox mount --bind /mnt/sdcard $sdcard
busybox mount --bind /mnt/external_sd $extsd
busybox mount --bind /mnt/usb_storage $usb
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
busybox sysctl -w net.ipv4.ip_forward=1
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "127.0.0.1 localhost ubuntu" > $mnt/etc/hosts
busybox chroot $mnt /bin/bash

echo "Shutting down Ubuntu ARM for Iconia A500"
umount $sdcard
umount $extsd
umount $usb
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt

Once done, we can save the file as startubuntu and adb push it to the tab. (the same folder as the img is fine)

Done! We run it by invoking the startubuntu script from the android terminal emulator (must be in superuser mode)

I hope you found this how-to useful.