Building a Lubuntu rootfs for gen8 A101IT
Some general info:
This guide is about how to build a lubuntu rootfs with rootstock that works with nicktime's kernel see Gen8Linux2.6.37.
We will explain:
- The build of the kernel from source.
- Building kboot which we will use to boot.
- Build SGX with xorg support from TI-sources.
- Build your rootfs with rootstock.
- Adding the needed patches to the rootfs and explain what they are for.
With some minor adjustments you can of course also use this guide to build a xubuntu rootfs or a bare minimum ubuntu etc.
Note that rootstock is put to rest, however I still found it the cleanest/easiest way to build the rootfs.
1) Getting Started
We need a place on or host PC where we can get our work done. I am using /usr/src/ubuntu, so that is what we will use in our examples please adjust the path in the commands if you are using a different one.
If it isn't stated otherwise in this guide I assume you run the commands that are mentioned in this directory.
Also note that I am using ubuntu 11.10 64bit.
First we will clone my git which will contain all changes to the rootfs and a helpfull Makefile to automate some stuff.
$cd /usr/src $ git clone git://gitorious.org/lubuntu_image_archos101it_gen8/lubuntu_image_archos101it_gen8.git ubuntu $ cd ubuntu
Now we will clone the kernel we want to use. The git will be cloned in directory /usr/src/ubuntu/kernel
$ git clone git://gitorious.org/~divx118/archos-linux/divx118s-archos-linux-2-6-37-gen8.git kernel
2) Building the kernel
If you don't have it already, install "gcc-arm-linux-gnueabi".
On ubuntu 11.10:
$ sudo apt-get install gcc-arm-linux-gnueabi
Package version I am using:
maurice@maurice-N73SM:/usr/src/ubuntu$ dpkg -s gcc-arm-linux-gnueabi Package: gcc-arm-linux-gnueabi Status: install ok installed Priority: optional Section: devel Installed-Size: 32 Maintainer: Ubuntu Developers <> Architecture: amd64 Source: gcc-defaults-armel-cross (1.6) Version: 4:4.6.0-8 Depends: cpp-arm-linux-gnueabi (>= 4:4.6.0-8), gcc-4.6-arm-linux-gnueabi (>= 4.6.0-8) Recommends: libc6-dev-armel-cross | libc-dev-armel-cross Suggests: make, manpages-dev, autoconf, automake1.9, libtool, flex, bison, gdb-arm-linux-gnueabi, gcc-doc Conflicts: gcc-4.4-arm-linux-gnueabi (<= 4.4.5-15~), gcc-4.5-arm-linux-gnueabi (<= 4.5.2-8~) Description: The GNU C compiler for armel architecture This is the GNU C compiler, a fairly portable optimizing compiler for C. . This is a dependency package providing the default GNU C cross-compiler for armel architecture. Original-Maintainer: Marcin Juszkiewicz <>
Then we need to update our .config, we will do that by copy linux.config to .config. Of course you can also use "make menuconfig" and set things the way you want.
Note linux.config contains the config settings that works for A43IT and A101IT Other gen8 devices need there board files added.
$ cd /usr/src/ubuntu $ cp ./kernel/linux.config ./kernel/.config
Just issue the following make command in dir ubuntu.
$ cd /usr/src/ubuntu $ make dist
"make dist" will build your zImage, modules tarball and an empty initramfs.cpio.gz. They all will show up in the dir openaos/target (at least when there are no errors while building :) )
3) Build rootfs tarball with rootstock
If you don't already have it install rootstock.
$ sudo apt-get install rootstock
The rootstock command I used to make the rootfs tarball. It will take about 45 minutes to an hour for this to finish.
$ sudo rootstock --fqdn Archos \ --login ubuntu \ --password ubuntu \ --imagesize 3G \ --seed lubuntu-desktop,openssh-server,wicd,e17,cellwriter \ --dist oneiric
- "--seed" is the parameter where you can define which packages to install.
I installed lubuntu desktop, openssh-server for remote ssh, wicd for handling wlan connections, e17 enlightenment desktop manager so I can switch between lxde desktop manager in lubuntu and enlightenment and cellwriter for onscreen keyboard.
- "--login" is the username in this case ubuntu.
- "--password" is the password in this case ubuntu.
- "--imagesize" defines the total size which can be used for the rootfs in this case 3 Gigabyte which is actually too much, however better too much then not enough.
After the command has succesfully finished you should end up with a file named armel-rootfs*.tgz. Something like armel-rootfs-201302251120.tgz.
We need to unpack this to add some stuff. We do this in a new directory "image" in our work directory.
$ mkdir /usr/src/ubuntu/image $ sudo tar -C /usr/src/ubuntu/image -zxf armel-rootfs-201302251120.tgz
First problem with this rootfs is that "libgdk-pixbuf2.0-0" isn't correctly installed. This will result in GTK errors when starting desktop manager LXDE, XFCE4, Enlightenment.
For example icons, desktop background is missing. I did solve that by manually downloading the package and let it install on first start of the image. I included the package in the git. The link from where I got it is https://launchpad.net/ubuntu/+source/gdk-pixbuf/2.24.0-1ubuntu1/+build/2810634/+files/libgdk-pixbuf2.0-0_2.24.0-1ubuntu1_armel.deb
Now we will install our modules from the kernel build and copy over some adjusted files. This can all be done by a simple make image_install.
$ cd /usr/src/ubuntu $ sudo make image_install
Note: To list all the files which are in rootfs_changes run the following command. This is not a needed step, just an easy way to list all the files I changed in the rootfs.
find ./rootfs_changes -type f -follow -print|xargs ls -l
The only thing we need to add is SGX libs and modules. See LubuntuGen8#BuildingSGXreleasefromTIwithX-support complete it through step 5 and then come back here.
$ cd$ sudo make BUILD=release OMAPES=5.x SUPPORT_XORG=1 FBDEV=yes install
Now prepare a SD-card with an ext4 partition and copy all the files from your image dir to your partition. Be sure to safely umount your sd-card
$ cd /usr/src/ubuntu $ sudo cp -rp ./image/*
If you didn't already do so. Set up your device with kboot see LubuntuGen8#Buildingkboot
Copy your builded initramfs.cpio.gz and zImage to your kboot os dir. Replace /media/A101IT with the path your gen8 device is mounted on.
$ cd /usr/src/ubuntu $ cp openaos/target/zImage /media/A101IT/kboot/os/Lubuntu $ cp openaos/target/initramfs.cpio.gz /media/A101IT/kboot/os/Lubuntu
Create a textfile named cmdline in that dir.
$ gedit /media/A101IT/kboot/os/Lubuntu/cmdline
Put in the following content in that file.
Note: /dev/mmcblk0p2 means that it will boot from the second partition of your SD-card (I have 2 partitions and my lubuntu is on the second partition). Change it to /dev/mmcblk0p1 if you only have one partition.
Note: omapfb.vrfb=y omapfb.rotate=2 will enable vrfb rotation and rotation is set to 180. If you have an A43IT you could set it to omapfb.vrfb=y omapfb.rotate=1
ordinit=/usr/sbin/tftpboot root=/dev/mmcblk0p2 console=tty0 console=ttyS2,1000000n8 earlyprintk debug vram=15M musb_hdrc.debug=0 omapdss.debug=0 nosplash omapfb.vrfb=y omapfb.rotate=2
Safely umount your device and reboot.
Building kboot
Kboot is a bootmenu with kexec support. It's original release is from alephzain.
I cloned his repo to make some minor changes like support for booting an image file with openaos multiroot without showing the menu.
First clone the git
$ git clone git://gitorious.org/~divx118/kboot/divx118s-kboot.git kboot
We first need to edit custom/kboot-minimize to define the path to abcbox (proprietary file from Archos) you can point it to the one in the gen8 source. It was there included with permission from Archos.
Mine is in /usr/src/gen8/initramfs/bin/abcbox So I added ABCBOX_LOCATION=/usr/src/gen8/initramfs/bin/abcbox to kboot-minimize.
Also take a look at the README file in the root of your git clone.
$ cd kboot $ gedit custom/kboot-minimize
Then to build just type make. This will take some time. On my I7 with 12Gb and a fast internet connection about an hour.
$ make
Possible errors:
You must install 'hg' on your build machine
This can be solved on ubuntu 11.10 by installing mercurial.
$ sudo apt-get install mercurial
After a succesfull finish of the build your zImage and rootfs.cpio.gz will be in ./output/images
Rename rootfs.cpio.gz to initramfs.cpio.gz and flash it together with the zImage on your archos gen8.
Short manual for kboot
First make a directory structure as follows in the root of your archos device:
- Root Archos
- kboot
- os
- conf
- images
- kboot
Directory conf:
You create here a text file named config.ini with the following content. Of course you can change it to your needs.
[init] telnet = 1 usbip = 192.168.10.1 [kboot] # boot last selection if no key pressed after 30 seconds last_selection = 1 last_selection_timeout = 30 # enable soft boot menu (bootloader dev only) softboot = 1 # some tuning title_font_size = 36 menu_font_size = 32 # change the color, R,G,B format title_color = 255,255,255 menu_item_color = 92,97,98 menu_item_selected_color = 0,0,255 [softboot] # put a list of items to display in Soft boot menu # item= sequence item1 = uart,usb,mmc1,mmc2 item2 = uart,usb item3 = mmc1,mmc2
Directory images:
You can place here your background image for the bootmenu. You must name it bkg.png
Directory os:
In this directory you can create sub directories which contain zImage and initramfs.cpio.gz in which you want to boot.
The name of the sub directory will be used as a display name in the boot menu.
If you are using openaos multirootmenu, you can also create a text file named menu.lst in that folder, with the line of the image you want to chroot in. It will then directly boot into your image instead of showing you the multiroot menu of openaos.
Example menu.lst:
Gingerbread||/openaos-gingerbread.img|/init|0
There is also support for a kernel command line. Just create a text file named cmdline and put in your command line.
Example cmdline:
ordinit=/usr/sbin/tftpboot root=/dev/mmcblk0p2 console=tty0 console=ttyS2,1000000n8 earlyprintk debug vram=15M musb_hdrc.debug=0 omapdss.debug=0 nosplash omapfb.vrfb=y omapfb.rotate=2
BTW \r\n are stripped and replaced with a blank space. So you can also split it in more lines.
Building SGX release from TI with X-support
1) Download the latest version from TI. I got it from here and install it by running the binary file.
At the time of writing this wiki it was Graphics_SDK_setuplinux_4_09_00_01.bin.
2) After we installed the package, we also need an arm crosscompiler. I first tried the one included with archos GPL sources, however that will fail on some missing libs.
So I followed the guide from TI here and used the LITE version of the CodeSourcery toolchain (IA32 GNU/Linux TAR).
See Installing the Toolchain on the page on how to download and set it up.
3) Setup your Rules.make located in the dir where you installed the graphics SDK by changing the path variables to your setup. See mine below.
#Rules.make ################# FIELDS MODIFIABLE BY THE USER ############################### ############### All the fields below are MANDATORY ############################ #By default all below variables have been initialized with equivalent AMSDK variables # Change them to appropriate paths as per your machine/build environment paths. # Set home area (ex /home/user/) HOME=/home/maurice # Set Toolchain path (ex /home/user/toolchain/arago-2011.09/armv7a) CSTOOL_DIR=/home/maurice/toolchain/arm-2009q1 # Set Tool chain prefix (ex arm-arago-linux-gnueabi- ) CSTOOL_PREFIX=arm-none-linux-gnueabi- # Set kernel installation path ( ex /home/user/linux-04.00.01.13 ) KERNEL_INSTALL_DIR=/usr/src/lub/kernel # Set Target filesystem path ( ex /home/user/targetfs ) TARGETFS_INSTALL_DIR=/usr/src/ubuntu/image ############### All the fields below are OPTIONAL ############################ ############### BEST SUGGESTED TO LEAVE THE BELOW AS IS ############################ # Below is just an optional define given only to enable users who want to pass additional compiler/link flags. # Only update the below options if you exactly know about the additional flag to be added & also are sure that its supported with your toolchain. # Otherwise its best suggested to leave the below as is ie empty # Add additional Compiler flags below only if required (Please read above comments) EXTRA_CFLAGS?= # Add additional Linker flags below only if required (Please read above comments) EXTRA_LFLAGS?= export EXTRA_CFLAGS export EXTRA_LFLAGS ######################### PRE-DEFINED VARIABLES ############################### ######################## NOT MODIFIABLE BY USER ############################### # Set installation folder GRAPHICS_INSTALL_DIR=$(HOME)/Graphics_SDK_4_08_00_02 # Location of demo executables and install information GFX_DEMOS_EXECPATH=$(GRAPHICS_INSTALL_DIR)/gfxsdkdemos CSTOOL_PATH=$(CSTOOL_DIR)/bin CSTOOL_LIBSTDC++_PATH=$(CSTOOL_DIR)/$(subst gnueabi-,gnueabi,$(CSTOOL_PREFIX))/lib export CSTOOL_PATH export CSTOOL_PREFIX PLATFORM=LinuxARMV7 GFX_OGLES_SDKPATH=$(GRAPHICS_INSTALL_DIR)/GFX_Linux_SDK/OGLES/SDKPackage GFX_OGLES2_SDKPATH=$(GRAPHICS_INSTALL_DIR)/GFX_Linux_SDK/OGLES2/SDKPackage GFX_OVG_SDKPATH=$(GRAPHICS_INSTALL_DIR)/GFX_Linux_SDK/OVG/SDKPackage GFX_REL_ES3_LIB_SRCPATH=$(GRAPHICS_INSTALL_DIR)/gfx_rel_es3.x GFX_DBG_ES3_LIB_SRCPATH=$(GRAPHICS_INSTALL_DIR)/gfx_dbg_es3.x GFX_REL_ES5_LIB_SRCPATH=$(GRAPHICS_INSTALL_DIR)/gfx_rel_es5.x GFX_DBG_ES5_LIB_SRCPATH=$(GRAPHICS_INSTALL_DIR)/gfx_dbg_es5.x GFX_REL_ES6_LIB_SRCPATH=$(GRAPHICS_INSTALL_DIR)/gfx_rel_es6.x GFX_DBG_ES6_LIB_SRCPATH=$(GRAPHICS_INSTALL_DIR)/gfx_dbg_es6.x GFX_REL_ES8_LIB_SRCPATH=$(GRAPHICS_INSTALL_DIR)/gfx_rel_es8.x GFX_DBG_ES8_LIB_SRCPATH=$(GRAPHICS_INSTALL_DIR)/gfx_dbg_es8.x GFX_OGLES_REL_LIB_DESTPATH=$(GFX_OGLES_SDKPATH)/Builds/OGLES/LinuxARMV7 GFX_OGLES2_REL_LIB_DESTPATH=$(GFX_OGLES2_SDKPATH)/Builds/OGLES2/LinuxARMV7 GFX_OVG_REL_LIB_DESTPATH=$(GFX_OVG_SDKPATH)/Builds/OVG/LinuxARMV7 GFX_KERNMOD_SRCPATH=$(GRAPHICS_INSTALL_DIR)/GFX_Linux_KM GFX_PKG_TARGETFS_PATH = $(GRAPHICS_INSTALL_DIR)/targetfs GFX_LIBRARY_TARGET_PATH = $(TARGETFS_INSTALL_DIR)/opt/gfxlibraries GFX_DEVMEM2_SRCPATH = $(GRAPHICS_INSTALL_DIR)/tools/devmem2 # Where to copy the resulting executables and data to (when executing 'make # install') in a proper file structure. This EXEC_DIR should either be visible # from the target, or you will have to copy this (whole) directory onto the # target filesystem. EXEC_DIR=$(TARGETFS_INSTALL_DIR)/opt/gfxsdkdemos ################################################################################
4) Before compiling I did change XPROC_WORKAROUND_NUM_SHAREABLES from 200 to 4095, else you will get some errors when for example starting a browser.
For more info see this ti forum post. You can find it in
5) Compile it with the following.
$ make BUILD=release OMAPES=5.x SUPPORT_XORG=1 FBDEV=yes all(all_km without demo files)
Then install it in your image (rootfs) dir
sudo make BUILD=release OMAPES=5.x SUPPORT_XORG=1 FBDEV=yes install(install_km without demo files)
6) For OMAP35x/37x when you first boot your image you will need to run omap-demo script. This will install the graphic drivers and libs. Followed by depmod -a.
For more info see Graphics SDK Quick installation and user guide
$ sudo /etc/init.d/omap-demo $ sudo depmod -a
7) After that you reboot. When booted again start X by running the script rc.pvr.
NOTE: xorg.conf is located /usr/local/XSGX/etc/xorg.conf. We will need to adjust that for making the touchscreen to work on A101IT gen8. More info on that will be in adjusting the rootfs.
NOTE: If you are using remote access to your device then first set your display see example below.
$ export DISPLAY=:0 $ sudo /etc/init.d/rc.pvr start
8) Now you can test the demos.
$ cd /opt/gfxsdkdemos/ogles2 $ ./OGLES2Coverflow
Customizing E17 enlightenment desktop
For now I will put this info here, later we can make a separate wiki for it.
An important folder is "/usr/share/enlightenment/data"
"./themes" in that dir contains the theme files ending with edj. "./config" in that dir contains the profiles. Each dir is a separate profile.
For unpacking edj you need to have the "libedje-bin" which contains two executables edje_decc and edje_cc.
To unpack an edj theme just run the following after you have installed the package.
$ sudo apt-get install libedje-bin $ edje_decc illume.edj
It will then create a directory illume with inside the graphics and the "config" file illume.edc
For the config files in the profile dir you need package "libeet-bin"
$ sudo apt-get install libeet-bin
To get the key do:
$ eet -l e.cfg
This should give you "config" as output. Now to convert the file to plain text do:
$ eet -d e.cfg config e.txt config
This should have created your plain text file e.text. Make your changes in it and convert it back with:
$ eet -e e.cfg config e.txt 1
Usefull links
- Info about xorg.conf
- TI graphic SDK and user guide
- Release notes for version 4.09.00.01 (the one we are using in this guide) TI graphic SDK
- SGX debug info
- Software setup for building TI graphic SDK
much more to come :)