NOTE: THIS POST HAS BEEN SUPERSEDED BY http://olimex.wordpress.com/2013/10/28/building-debian-sd-card-for-linux-with-kernel-3-4-from-scratch-for-a10s-olinuxino-micro/.

1] Create a VirtualBox VM for Debian 7.1.0 i386. I allocated 1024MB of RAM to it. As for the virtual hard drive space, I allocated 8GB. I also recommend that you disable audio support for the VM.
2] Download the Net Install ISO image for Debian 7.1.0 i386. Boot the mentioned ISO in the VirtualBox VM you've created. I used the "Install" option in the installer boot menu.
3] This set of instructions will work with everything deselected under "Software selection." You may select software to your taste during installation.
4] After the installation, the guest OS will automatically get an IP Address via DHCP.
5] You need to download a dependency and install it manually. Do these as root in your guest OS:
cd ~
wget http://www.malaya-digital.org/libgmp3c2_4.3.2+dfsg-1_i386.deb
dpkg --install libgmp3c2_4.3.2+dfsg-1_i386.deb
6] As root, append the following line to /etc/apt/sources.list in your guest OS:
deb http://www.emdebian.org/debian squeeze main
7] As root in your guest OS:
apt-get install emdebian-archive-keyring
apt-get update
apt-get install gcc-4.4-arm-linux-gnueabi ncurses-dev uboot-mkimage build-essential git
8] Now, get the kernel source code as root in your guest OS:
cd ~
git clone https://github.com/linux-sunxi/linux-sunxi.git
9] Download a10s_olinuxino_defconfig from https://docs.google.com/file/d/0B-bAEPML8fwldzdkQjJrdW5EU00/edit?usp=sharing . Move that file to linux-sunxi/arch/arm/configs/ . These are to be done in your guest OS as root:
mv a10s_olinuxino_defconfig ~/linux-sunxi/arch/arm/configs/
10] Execute the following under the linux-sunxi directory in your guest OS as root:
cd ~/linux-sunxi/
make ARCH=arm a10s_olinuxino_defconfig
11] Configure the kernel in your guest OS as root:
make ARCH=arm menuconfig

HINT: To enable OTG (for Linux 3.4.61):
Under Kernel Configuration, build this in the kernel:
Device Drivers->USB support->[*] SUNXI USB2.0 Dual Role Controller Support
Then build this in the kernel, too:
Device Drivers->USB support->SUNXI USB2.0 Dual Role Controller Support->[*] SUNXI USB2.0 Manager
And make sure of the following:
Device Drivers->USB support->SUNXI USB2.0 Dual Role Controller Support->SUNXI USB2.0 Manager->USB0 Controller support (otg support)->(X) otg support

HINT: To enable Ethernet (for Linux 3.4.61):
Under Kernel Configuration, build this in the kernel:
Device Drivers->Network device support->Ethernet driver support-><*> Allwinner Ethernet MAC support

12] There is a patch provided for the linux-sunxi kernel. However, I find that this patch does not currently work with the current kernel. You may omit this step which shows how to use the patch and just follow the next step for patching. I've just included this step for documentation.
Download A10S_100kHz_I2C.patch from https://docs.google.com/file/d/0B-bAEPML8fwlRVRjWE1wdlhxeTQ/edit?usp=sharing . This is for supporting Olimex UEXT modules. Put that file under linux-sunxi/arch/arm/plat-sunxi/include/plat/ . These are to be done in your guest OS as root.
mv A10S_100kHz_I2C.patch ~/linux-sunxi/arch/arm/plat-sunxi/include/plat/
cd ~/linux-sunxi/arch/arm/plat-sunxi/include/plat/
patch -p0 < A10S_100kHz_I2C.patch 13] Edit ~/linux-sunxi/arch/arm/plat-sunxi/include/plat/i2c.h. Find "I2C0_TRANSFER_SPEED". Define "100000" for I2C1_TRANSFER_SPEED and up. These are to be done in your guest OS as root. For example, the desired edit is: #define I2C0_TRANSFER_SPEED (400000) #define I2C1_TRANSFER_SPEED (100000) #define I2C2_TRANSFER_SPEED (100000) #define I2C3_TRANSFER_SPEED (100000) #define I2C4_TRANSFER_SPEED (100000) 14] You can now compile the kernel and its modules in your guest OS as root. cd ~/linux-sunxi/ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=out modules make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=out modules_install 15] In your guest OS, your kernel will be "~/linux-sunxi/arch/arm/boot/uImage". And your modules will be found at "~/linux-sunxi/out/lib/modules/3.x.xx" where 3.x.xx is kernel version (eg: "3.4.61+"). 16] I used the SD card image found here: https://docs.google.com/file/d/0B-bAEPML8fwlZ2g0V0JSRGxHc0U/edit?usp=sharing . In your host OS, download it, unrar it, and then use the dd command to put the image on the SD card. After this, we can copy the kernel and modules to the SD card.
To use the dd command(NOTE: Appropriately substitute the correct device for "/dev/sdX". This depends from system to system.):
dd if=A10S_debian_GPIO_LAN_USB_SDs_HDMI_LCD_I2C_100KHz_4G_release_3.img of=/dev/sdX
17] Copy the "~/linux-sunxi/arch/arm/boot/uImage" kernel you've compiled in the guest OS into the first filesystem of the SD card.
# Mount the first partition:
mkdir /mnt/olinuxino0
mount /dev/sdX1 /mnt/olinuxino0 # Substitute the appropriate value for X in /dev/sdX1

# Then copy the kernel uImage to the first filesystem of the SD card.
cp uImage /mnt/olinuxino0 # Get the uImage file from the environment you've compiled the kernel.
umount /mnt/olinuxino0
18] Copy the generated kernel modules ("~/linux-sunxi/out/lib/modules/3.x.xx" in the guest OS where you've compiled the kernel) in the second filesystem of the SD card.
# Mount the second partition:
mkdir /mnt/olinuxino1
mount /dev/sdX2 /mnt/olinuxino1 # Substitute the appropriate value for X in /dev/sdX1

# Then copy the kernel modules to the /mnt/olinuxino1/lib/modules directory in the second filesystem of the SD card
cp -rf 3.x.xx+ /mnt/olinuxino1/lib/modules # Get the modules directory from the environment you've compiled the kernel.
umount /mnt/olinuxino1
19] HINT: Edit your the /etc/network/interfaces file in your SD card to assign a static IP address:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo eth0
iface lo inet loopback

#auto eth0
iface eth0 inet static
address 10.42.0.2
netmask 255.255.255.0
gateway 10.42.0.1

#auto wlan1
iface wlan1 inet dhcp

wpa-ssid YourSSID
wpa-psk YourPassword
20] HINT: Also, you may want to configure in some DNS servers into the SD card. Edit the /etc/resolv.conf file in your SD card(the servers provided here are from opendns.com):
nameserver 208.67.222.222
nameserver 208.67.220.220
21] When you boot OLinuXino using the SD card, the "root" user has the password "olimex" by default.