[vc_row][vc_column][vc_column_text]Ubuntu is a Debian-based Linux operating system, with Unity as its default desktop environment. It is based on free software and named after the Southern African philosophy of ubuntu (literally, “human-ness”), which often is translated as “humanity towards others” or “the belief in a universal bond of sharing that connects all humanity”.
In this article, we will look how to build Ubuntu Unity image for pcDuino.
[/vc_column_text][vc_tour][vc_tab title=”Notes” tab_id=”1388885671-1-21″][vc_column_text]Many people have asked to check if there are source files of ubuntu, so that they can build ubuntu system by themselves. Here we would like to make clear that it doesn’t require compilation work to build ubuntu system.
Ubuntu system consists of many deb software packages. We just need to install these deb packages to the same one directory one by one. But Ubuntu consists of many hundreds of deb packages, it’s impracticable to install them one by one. People normally use a tool like debootstap to download and install.
But it is highly likely that the system is unstable if you build your own Ubuntu system that way. We recommend to download core rootfs from Ubuntu or linaro website. We can install packages using ‘$sudo apt-get xxx” on the base of the core file system.
Please note that when we custom build the ubuntu system, please pay attention to the version of kernel. For example, the version of kernel is 3.2.0 for Ubuntu 12.04 LTS, and we should use kernel is newer than this version. Our pcDuino has a kernel of version 3.4.29+, so we cannot use ubuntu 12.10 as the kernel it targets is of version 3.5.0.
the probability of your own to make the system unstable ubuntu relatively large, it is recommended you go to ubuntu or linaro official website to download the core rootfs. You can use the file system on the core apt-get command, and then you go to customize your ubuntu system. Also note that when you customize the system kernel version, does not make sense for a different kernel version ubuntu, ubuntu 12.04 LTS example, corresponds to the minimum kernel version is 3.2.0, you can also use more than the kernel version of the kernel. Our board is 3.4.29 + kernel, install ubuntu 12.10 on not installed because its kernel is 3.5.0.[/vc_column_text][/vc_tab][vc_tab title=”Build Basic Firmware Image” tab_id=”1388885671-2-27″][vc_column_text]Before we start, we should read Build Archlinux Image for pcDuino first.
We can go to linaro website to download the last development version 12.11 after version 12.04.
We download the software from: http://releases.linaro.org/12.11/ubuntu/precise-images/developer
On the X86-64 machine, we can do the following:
Build Basic Image:
Create a blank img image:
#dd if=/dev/zero of=ubuntu.img bs=1M count=3800
For the image to ext3 format:
#mke2fs -t ext3 ubuntu.img
Mount the newly created image:
#sudo mount -t ext3 -o loop ubuntu.img /mnt
#sudo tar xvf linaro-precise-developer-20121124-513.tar.gz -C /mnt
Next, we should replace kernel.
Firstly, we will unpack pcduino_a10_hwpack_XXXXXXXX.tar.xz under directory: kernel/output/.
#tar xvf pcduino_a10_hwpack_XXXXXX.tar.xz
#sudo rm /mnt/lib/modules/* -rf
#sudo cp rootfs/lib/modules/3.4.29+/ /mnt/lib/modules/ -rf
The extracted directory rootfs is used to replace the corresponding location under /mnt.
#sudo umount /mnt
As the desktop of ubuntu is large, here we recommend to use TF card to install.
Insert a SD larger than 8GB into the PC, and burn 20130906 SD bootable version of pcDuino to it. We copy uImage and script.bin of pcduino_a10_hwpack_xxxxxxx.tar.xz to it.
Now on Virtual X86-64 PC, mount the USB drive, and do:
#dd of= ubuntu.img if=the second partition of your TF bs=1M
After this, we insert the finished TF card to pcDuino, and boot from the SD card. After the reboot, it is ubuntu 12.11
Next, we move on the work on pcDuino:
$passwd linaro #set password
$sudo apt-get update
$sudo apt-get upgrade
[/vc_column_text][/vc_tab][vc_tab title=”Install desktop” tab_id=”1388888444750-2-0″][vc_column_text]
Here we have many choices.
$sudo apt-get install kubuntu-desktop
Install Lubuntu, this is we are using on official release of pcDuino:
$sudo apt-get install lubuntu-desktop
#sudo apt-get install gnome
$sudo apt-get install xfce4
Install ubuntu unity, we will use this one here:
$sudo apt-get install ubuntu-desktop
[/vc_column_text][/vc_tab][vc_tab title=”Install display card driver” tab_id=”1388888618211-3-10″][vc_column_text]
We continue to build the ubuntu system on pcDuino.
1. Add privilege to mali driver:
Add the following content to it:
KERNEL==”mali”, MODE=”0660″, GROUP=”video”
KERNEL==”ump”, MODE=”0660″, GROUP=”video”
2. Install dependency software:
$sudo apt-get install git build-essential libdri2-dev xorg-dev xutils-dev automake libtool
3. Install sunxi-mali:
$sudo git clone https://github.com/linux-sunxi/sunxi-mali.git
$git submodule init
$git submodule update
$sudo make install
4. Install X window driver
$git clone https://github.com/Pillar1989/xf86-video-mali
[/vc_column_text][/vc_tab][vc_tab title=”Configure Desktop” tab_id=”1388889035588-4-6″][vc_column_text]
1. Setup the script used to configure screen:
$sudo cp set_window.sh /usr/bin/
$sudo cp setwindow /usr/bin/
2. If the position of screen is not right, too small, too large, we can run:
$setwindow 100 1 0 0
We remove the SD card from pcDuino and put to the virtual X86-64 machine, do the following to obtain the image:
#sudo dd if=/dev/’your sd card’ of=ubuntu.img bs=1M
[/vc_column_text][/vc_tab][vc_tab title=”Finish up” tab_id=”1388889135702-5-1″][vc_column_text]The login screen: