-
Notifications
You must be signed in to change notification settings - Fork 23
Home
Aakash is a low cost computing device/tablet for students, the project is initiated and funded by MHRD, Govt. of India. Aakash already runs Android 4.0 with many educational apps made by IIT Bombay. Please refer github for some of the apps.
This is the landing page for the Linux on Aakash documentation. To report any bugs please raise issues
-
Steps to set up on software side
-
Get an ubuntu 12.04 machine (any other distro will do, but we have tested on this version of ubuntu)
-
Download and install Codesourcery cross-compiler from this page, find Download the GNU/Linux Release in ARM processor section, click on link and fill up the form. From link in your email choose the most recent version of toolchain, download the IA32 GNU/Linux Installer version
-
Download .bin file, make it executable and run it from terminal. Follow the instructions given on the prompt(dash related) and allow GUI installer to copy toolchain to your preferred location. Update the Codesourcery bin directory in your
$PATH
so that bash can find the binaries -
You can alternatively install gcc-arm-linux-gnueabihf instead of Codesourcery cross-compiler, we will use Codesourcery toolchain in rest of this documentation
sudo apt-get install gcc-arm-linux-gnueabihf cpp-arm-linux-gnueabihf
-
Install dependencies for kernel compilation
apt-get install build-essential dpkg-dev kernel-wedge make automake checkinstall git u-boot-tools
-
You may also need
adb
to extractscript.bin
from Android's nanda partition and qemu-user-static to install packages in chrooted linux. We will get back to this later. To install adb you can either install entire android-sdk or can you may download binary directly from this link Please make the adb binary executable. And to install qemu-user-static just issue the commandsudo apt-get install qemu-user-static
-
If you are using x86_64 bit ubuntu then to run adb you must install
sudo apt-get install ia32-libs-multiarch
-
If you have serial console (Rx, Tx) lines from the board/tablet, then to view console output install minicom (optional)
sudo apt-get install minicom
-
To setup minicom, connect Aakash's serial port(one which you have soldered out from the board) to your linux machine using suitable level shifter
sudo minicom -s
and
- Set the correct serial device(eg. /dev/ttyUSBx)
- Set BPS to 115200 8N1
- Hardware flow control to NO
- Software flow control to NO
Save the setting as default and exit. From next time when you connect serial console device from Aakash to your ubuntu machine and run
sudo minicom
N.B: The above serial port setup and minicom are totally optional and will not be discussed later. Please search on web for more details.
-
-
Steps to build uboot
-
Clone the repository by
git clone -b sunxi https://github.com/androportal/uboot-allwinner.git
-
cd
intouboot-allwinner
cd uboot-allwinner
-
To compile uboot download and install
Sourcery CodeBench Lite Edition
, then issue:make a13_olinuxino CROSS_COMPILE=arm-none-linux-gnueabi-
-
After successful compilation
u-boot.bin
will be available at root of the directory andsunxi-spl.bin
will be inspl
directory
-
-
Installing uboot on SDcard
-
Insert
sdcard
in card reader or MMC reader available in laptops/netbooks -
Backup all your sdcard data, and issue the following commands carefully, replace X in /dev/sdX with suitable letter(a lower case alphabet) alloted for your sdcard, remember X will never be a if you have a hard disk installed, so keep in mind it must be something like
/dev/sdb
or /dev/sdc
etc. Please check twice and if you are still unsure leave this README right now otherwise you may end up with non bootable machinesudo fdisk -u=sectors /dev/sdX
-
Now from same
uboot-allwinner
directory issue these commands, again replace X with suitable value, now to burnsunxi-spl.bin
to sdcard issuesudo dd if=spl/sunxi-spl.bin of=/dev/sdX bs=1024 seek=8
Similarly to burn
u-boot.in
issuesudo dd if=u-boot.bin of=/dev/sdX bs=1024 seek=32
At this point we have a bootable sdcard readly. Get kernel and rootfs to make a usuable Linux for your tablet.
-
-
Steps to build kernel
-
Clone the repository by
git clone https://github.com/androportal/linux-sunxi.git
-
cd
intolinux-sunxi
cd linux-sunxi
-
Checkout to desired branch, it this case
sunxi-3.0
:git checkout sunxi-3.0
-
Compile the a13_configuration
make ARCH=arm a13_defconfig
-
Download the latest .config file from here and keep it in the root of the kernel source code directory (change the downloaded config file back to .config)
-
A13-OLinuXino customization can be done using(optional)
make ARCH=arm menuconfig
-
To compile kernel download and install
Sourcery CodeBench Lite Edition
, then issuemake ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage
-
To make kernel modules
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- INSTALL_MOD_PATH=out modules
-
To install modules in right path
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- INSTALL_MOD_PATH=out modules_install
-
After successful compilation
uImage
will be available atarch/arm/boot/uImage
and also findscript.bin
in the root of the directory(This section is subject to change), the kernel modules are available atout/lib/modules/3.0.42+/
-
-
Kernel on SDcard
-
Insert
sdcard
in card reader or MMC reader available in laptops/netbooks -
Backup all your sdcard data, and issue the following commands carefully, replace X in /dev/sdX with suitable letter(a lower case alphabet) alloted for your sdcard, remember X will never be a if you have a hard disk installed, so keep in mind it must be something like
/dev/sdb
or /dev/sdc
etc. Please check twice and if you are still unsure leave this README right now otherwise you may end up with non bootable machinesudo fdisk -u=sectors /dev/sdX
-
Then create partition for kernel and filesystem in your sdcard, from inside
fdisk
prompt typep
to list all partitionsCommand (m for help): p
-
Now press
d
to delete your partition. If you have multiple partitions use partition number to delete each partition as shown by fdisk utilityCommand (m for help): d
-
Type
n
for new partion(hit enter) and then mentionp
for primary partition, hit enter to continue with default starting sector(2048), enter again for last sector and mention+16M
, this partition will be later formatted with vfat for kernelCommand (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): p Partition number (1-4, default 1): Using default value 1 First sector (2048-7744511, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-7744511, default 7744511): +16M
-
The sdcard is assumed to be 4gb size, similarly create 2nd primary partition using remaining disk space which will serve as filesystem
Command (m for help): n Partition type: p primary (1 primary, 0 extended, 3 free) e extended Select (default p): p Partition number (1-4, default 2): Using default value 2 First sector (34816-7744511, default 34816): Using default value 34816 Last sector, +sectors or +size{K,M,G} (34816-7744511, default 7744511): Using default value 7744511
-
Now as we have created 2 primary partitions now let's write(w) the changes to disk. For that issue
Command (m for help): w
-
As partition is completed, we need to format them respectively, the first partition must be vfat so that uboot can read kernel
sudo mkfs.vfat /dev/sdX1
For rootfs, create ext4 partition
sudo mkfs.ext4 /dev/sdX2
-
Now mount vfat partition to some mount point(directory)
sudo mount -t vfat /dev/sdX1 /mnt/boot
copy kernel to
/mnt/boot
, assuming that you are still inlinux-sunxi
directorysudo cp arch/arm/boot/uImage /mnt/boot
Also copy
script.bin
to same directorysudo cp script.bin /mnt/boot
Now, umount /mnt/boot, before that you may want to
sync
so that any remaining buffers are written to diskssudo sync
Finally unmount:
sudo umount /mnt/boot
At this point we have a sdcard read with kernel. Burn
uboot
and copyrootfs
to make a usuable Linux for your tablet.
-
-
Step to make file system
As of now we have uboot and kernel ready for Aakash, the next step is to run few apps, to do so we need Linux file system. One can use any distribuition from here after. We will use ubuntu 12.04 LTS. Just for the record we have also tried Debian wheezy which also works well.
The main war is between different desktop enviroments. With lot of testing and real world examples we finally decided to go with LXDE. There is lot of scope for customization with LXDE and moreover its almost 50% lighter & twice as faster than any other desktop enviroment.
-
Insert sdcard again, download the core ubuntu 12.04.1 image from this link and save it in say /tmp directory. Extract the tar file in your sdcard's ext4 partition
cd /media/<ext4 partition of sdcard>
Now extract core ubuntu file system
sudo tar -xvpzhf /tmp/ubuntu-core-12.04.1-core-armhf.tar.gz
-
Copy the static qemu binary to mount arm fs in x86 architecture without invoking actual qemu emulator
sudo cp /usr/bin/qemu-arm-static /media/<ext4 partion of sdcard>/usr/bin/
-
Open
/media/<ext4 partition of sdcard>/etc/apt/sources.list
in text editor and adduniverse
&multiverse
. A sample content is showndeb http://ports.ubuntu.com/ubuntu-ports/ precise main universe multiverse restricted deb-src http://ports.ubuntu.com/ubuntu-ports/ precise main universe multiverse restricted
-
Now set up chroot environment
sudo mount -t proc /proc /media/<ext4 partion of sdcard>/proc sudo mount -t sysfs /sys /media/<ext4 partion of sdcard>/sys sudo mount -o bind /dev /media/<ext4 partion of sdcard>/dev sudo mount -o bind /dev/pts /media/<ext4 partion of sdcard>/dev/pts
-
chroot into the file system
sudo chroot /media/<ext4 partition of sdcard>/
-
The above two steps can be combined together as a script say, ch-mount.sh. From here after we will call this script to mount and un-mount fs. Please read this script to get any further help
sudo ch-mount.sh -m /media/<ext4 partition of sdcard>/
-
Now we have a chroot environment with all
proc, dev, sys, dev/pts
mounted, so run update to fetch repository informations (as chroot has root prompt so no need to write sudo anymore)apt-get update
-
Now install english language pack to avoid locale related errors
apt-get install language-pack-en-base
-
Now install minimal X environment to test our setup
apt-get install vim.tiny sudo ssh net-tools ethtool \ wireless-tools lxde lxappearence lxsession lxdm xinit xorg\ python-gi-cairo onboard utouch rsyslog alsa-utils gnome-mplayer\
-
Add user and set permissions
# adduser aakash # addgroup aakash adm # addgroup aakash sudo # addgroup aakash audio
-
Open
/etc/hostname
file in vim.tiny editor and give a hostname, for example writeaakash-arm
-
Similarly open
/etc/hosts
and remove its content and add these two lines127.0.0.1 localhost.localdomain localhost 127.0.1.1 aakash-arm
-
Open
/etc/modules
file and addgt818_ts
in a new line -
Open
/etc/lxdm/lxdm.conf
and modify it for autologin. Change the autologin section in the top of the file to this## uncomment and set autologin username to enable autologin autologin=aakash
-
Now open a new tab in your host Linux machine's terminal and copy
/<path to linux kernel>/linux-sunxi/out/lib/modules/3.0.42+/
to your arm ubuntu setupsudo cp -r /<path to linux kernel>/linux-sunxi/out/lib/modules/3.0.42+/ /media/<ext4 partition of sdcard>/lib/modules/
-
Download
rtl8192cufw.bin
from this page, and create a directory as/lib/firmware/rtlwifi
in ubuntu chroot, copyrtl8192cufw.bin
insidertlwifi
directory -
By now we have basic elements set to give a trial run to our OS. Type
exit
in chroot environment to get back to Ubuntu x86 host prompt, now run un-mount scriptsudo ch-mount.sh -u /media/<ext4 partition of sdcard>/
unmount both the partitions (fat32 and ext4) from your machine, confirm with
mount
command to check nothing from sdcard is mounted -
Remove the sdcard and insert it in your tablet, power on to get ubuntu 12.04 lxde desktop
-