[[labs.beatcraft.com]]~
[[bc9/Software/OpenEmbedded/kernel2.6.29(2/2)]]~

*kernel update [#ke5bcff7]
On gumstix-oe, currently we can choose kernel version 2.6.21, 2.6.22 and 2.6.24.~
But even 2.6.24 is almost 2 years older than current kernel.~
So we upgrade kernel to version 2.6.29.~
Followings are the procedures.

*Setting up microSD boot environment [#teb7ccfb]
When upgrade kernel, prepare new userland for upgrade kernel.~
For convenience of kernel upgrade operation, we don't choose the way to write new kernel into Flash ROM but~
we choose the way to make up new bootable environment on microSD.  

**Setting up gumstix build environment [#qdddd844]
This section describes setting up procedure of build environment for bc9 (gumstix).~
We use gumstix-oe, modified and adjusted version of [[OpenEmbedded:http://wiki.openembedded.net/index.php/Main_Page]] build environment (bitbake) by [[Gumstix,Inc.:http://www.gumstix.com/]] .~
Please refer to setting up procedure of gumstix build environment in advance.
-[[gumstix developer site - Getting started:http://www.gumstix.net/Software/cat/Getting-started/111.html]]
-[[gumstix developer site - Setting up a build environment:http://www.gumstix.net/Software/view/Getting-started/Setting-up-a-build-environment/111.html]]
-[[gumstix developer site - Replacing the file system image:http://www.gumstix.net/Software/view/Getting-started/Replacing-the-file-system-image/111.html]]

However, we build microSD boot image instead of built-in Frash ROM boot image.~
So build procedure is rather different to site above.

We suppose that following operation executes by "beat" account on Ubuntu 8.04LTS.~
(When you want to use Ubuntu8.10, refer to [[Build Environment Ubuntu 8.10:http://www.gumstix.net/wiki/index.php?title=Build_Environment_Ubuntu_8.10]]~
When you want to use Ubuntu9.04, refer to [[Build Environment Ubuntu 9.04:http://www.gumstix.net/wiki/index.php?title=Build_Environment_Ubuntu_9.04]]~
and adjust procedure.)

**Adjusting sh [#z410340b]
On Ubuntu, /bin/sh is symlink to dash, not to bash and sometime this cause problem.~
So in order to avoid build time failure of bitbake, reconfigure /bin/sh as follows:
 $ sudo dpkg-reconfigure dash
Choose "no" when you asked that setting up /bin/sh to symlink of dash.

**Instlation of required applications [#p9922790]
Install bitbake required applications as follows:
 $ sudo apt-get install build-essential help2man diffstat texi2html texinfo libncurses5-dev cvs gawk ¥
   python-dev python-pysqlite2 python-psyco ckermit lrzsz subversion

**Checking out gumstix-oe [#qf2bae2d]
 $ mkdir ~/gumstix 
 $ cd ~/gumstix 
 $ svn co https://gumstix.svn.sourceforge.net/svnroot/gumstix/trunk gumstix-oe

**Setting shell environment variables [#b3f6a0c3]
If you prefer to setting up permanently, do as follows.
 $ cat gumstix-oe/extras/profile >> ~/.bashrc
or if you prefer to setting up temporally, do as follows,
 $ . ~/gumstix/gumstix-oe/extras/profile
or 
 $ source  ~/gumstix/gumstix-oe/extras/profile

**Setting source code caching directories [#hebcab0e]
Gumstix-oe is designed to download source codes during build procedures.~
Default setting store downloaded source codes into /usr/share/sources. ~
But for easy handling, we change to store source codes into gumstix/sources.
 $ svn diff build/conf/site.conf 
 Index: build/conf/site.conf
 ===================================================================
 --- build/conf/site.conf	(revision 318)
 +++ build/conf/site.conf	(working copy)
 @@ -1,5 +1,6 @@
  # specifies where BitBake should place the downloaded sources
 -DL_DIR = "/usr/share/sources"
 +DL_DIR = "/home/beat/gumstix/sources"
  
  # specifies where BitBake should create its temporary files
  TMPDIR = ${GUMSTIXTOP}/tmp

**Adjusting build setting [#w4ce1bb7]
To utilize PXA270 effectively, edit as follows:~
 $ svn diff com.gumstix.collection/conf/machine/include/tune-iwmmxt.inc 
 Index: com.gumstix.collection/conf/machine/include/tune-iwmmxt.inc
 ===================================================================
 --- com.gumstix.collection/conf/machine/include/tune-iwmmxt.inc	(revision 318)
 +++ com.gumstix.collection/conf/machine/include/tune-iwmmxt.inc	(working copy)
 @@ -1,6 +1,9 @@
  # Configurations for the Intel PXA27x Appications Processor Family. 
  # Please use tune-xscale for PXA255/PXA26x based processors.
 -TARGET_CC_ARCH = "-march=iwmmxt -mcpu=iwmmxt -mtune=iwmmxt"
 +FEED_ARCH = "iwmmxt"
 +TARGET_CC_ARCH = "-march=iwmmxt -mtune=iwmmxt"
 +TARGET_CC_KERNEL_ARCH = "-march=iwmmxt -mtune=iwmmxt"
  PACKAGE_ARCH = "iwmmxt"
  PACKAGE_EXTRA_ARCHS += "iwmmxt"
Kernel maximum size limitation doesn't need for microSD bootable image. So increase kernel size. 
 $ svn diff com.gumstix.collection/conf/machine/include/gumstix.inc 
 Index: com.gumstix.collection/conf/machine/include/gumstix.inc
 ===================================================================
 --- com.gumstix.collection/conf/machine/include/gumstix.inc	(revision 318)
 +++ com.gumstix.collection/conf/machine/include/gumstix.inc	(working copy)
 @@ -10,6 +10,7 @@
  KERNEL_IMAGETYPE = "uImage"
  RDEPENDS_kernel-base = ""
 -KERNEL_IMAGE_MAXSIZE = "1048577"
 +KERNEL_IMAGE_MAXSIZE = "2197154" // incleased for mmcboot 
  
  UBOOT_ENTRYPOINT = "a0008000"
  
 @@ -35,7 +35,7 @@
  PREFERRED_PROVIDER_bluez-utils-dbus = "bluez-utils"
  PREFERRED_PROVIDER_gsmd="libgsmd"
  
 -PREFERRED_VERSION_gumstix-kernel = "2.6.21"
 +PREFERRED_VERSION_gumstix-kernel = "2.6.24"
  PREFERRED_VERSION_udev = "118"
  PREFERRED_VERSION_gnuplot = "4.0.0"
  PREFERRED_VERSION_dropbear = "0.47"
To generate microSD bootable image, acivate mmcboot setting.~
And few adjustments for bc9 are added.
 $ svn diff com.gumstix.collection/conf/machine/gumstix-custom-verdex.conf 
 Index: com.gumstix.collection/conf/machine/gumstix-custom-verdex.conf
 ===================================================================
 --- com.gumstix.collection/conf/machine/gumstix-custom-verdex.conf	(revision 318)
 +++ com.gumstix.collection/conf/machine/gumstix-custom-verdex.conf	(working copy)
 @@ -5,12 +5,12 @@
  MACHINE_FEATURES += "verdex"
  MACHINE_FEATURES += "iwmmxt"
  require conf/machine/include/gumstix.inc
 -require conf/machine/include/tune-xscale.inc
 +require conf/machine/include/tune-iwmmxt.inc
  
  #
  # Your flash size = Total flash (in MB) - 1 (for linux kernel partition)
 -ROOT_FLASH_SIZE = "15"
 -#ROOT_FLASH_SIZE = "31"
 +#ROOT_FLASH_SIZE = "15"
 +ROOT_FLASH_SIZE = "31"
  
  #
  # Enable use of virtual terminal for LCD on tty1 if USE_VT = "1"
 @@ -28,7 +28,7 @@
  #MACHINE_FEATURES  += "spi"
  
  MACHINE_FEATURES  += "serial"
 -MACHINE_FEATURES  += "bluetooth"
 +#MACHINE_FEATURES  += "bluetooth"
  MACHINE_FEATURES  += "sound"
  
  # if you enable robostix you will need to disable both "lcd" and "touchscreen" features
 @@ -51,7 +51,7 @@
  MACHINE_FEATURES  += "fat"
  
  # enable one of the following if you want to target build for uimage/rootfs on mmc/microSD or CF
 -#MACHINE_FEATURES  += "mmcroot"
 +MACHINE_FEATURES  += "mmcroot"
  #MACHINE_FEATURES  += "cfroot"
  
  #
Module for gumstix expansion board wifistix is known to become build error.~
So we remove this module's build setting.(bc9 originally doesn't use this module.)
 $ svn diff com.gumstix.collection/packages/tasks/task-base-gumstix.bb
 Index: com.gumstix.collection/packages/tasks/task-base-gumstix.bb
 ===================================================================
 --- com.gumstix.collection/packages/tasks/task-base-gumstix.bb	(revision 318)
 +++ com.gumstix.collection/packages/tasks/task-base-gumstix.bb	(working copy)
 @@ -201,7 +201,6 @@
  
  RDEPENDS_task-base-gumstix-wifi = "¥
      task-base-gumstix-pcmcia ¥
 -    wifistix-modules ¥
      wireless-tools ¥
      wpa-supplicant ¥
      "

In above modification we change FEED_ARCH from armv5te to iwmmxt.~
So if you want to install applications with ipkg command, you can only install self build ipks built with iwmmxt optimized.~
If you want to use prebuild ipks prepared by gumstix,inc., please don't require tune-iwmmxt.inc in gumstix-custom-verdex.conf~
but require tune-xscale.inc and build armv5te optimized ipks.

**Build [#d7af3fe0]
Build kernel, kernel modules, userland by following command.~ 
Build is starting from arm cross-toolchain and it takes few hours or almost a half day to finish.
 $ bitbake gumstix-directfb-image
When build was successfully finished, following files should be generated. 
 $ ls -al tmp/deploy/glibc/images/gumstix-custom-verdex/
 Total 21780
 drwxr-xr-x 2 beat beat     4096 2009-06-23 00:01 .
 drwxr-xr-x 3 beat beat     4096 2009-06-22 22:58 ..
 -rw-r--r-- 1 beat beat 10402796 2009-06-23 00:01 Angstrom-gumstix-directfb-image-glibc-ipk-2007.9-test-20090622-gumstix-custom-verdex.rootfs.jffs2
 -rw-rw-r-- 1 beat beat  8713428 2009-06-23 00:01 Angstrom-gumstix-directfb-image-glibc-ipk-2007.9-test-20090622-gumstix-custom-verdex.rootfs.tar.gz
 lrwxrwxrwx 1 beat beat       97 2009-06-23 00:01 gumstix-directfb-image-gumstix-custom-verdex.jffs2 -> Angstrom-gumstix-directfb-image-glibc-ipk-2007.9-test-20090622-gumstix-custom-verdex.rootfs.jffs2
 lrwxrwxrwx 1 beat beat       98 2009-06-23 00:01 gumstix-directfb-image-gumstix-custom-verdex.tar.gz -> Angstrom-gumstix-directfb-image-glibc-ipk-2007.9-test-20090622-gumstix-custom-verdex.rootfs.tar.gz
 -rw-rw-r-- 1 beat beat  1929321 2009-06-22 22:58 modules-2.6.24-r1-gumstix-custom-verdex.tgz
 -rw-r--r-- 1 beat beat  1191276 2009-06-22 22:58 uImage-2.6.24-r1-gumstix-custom-verdex.bin

**Formatting microSD [#ldd29d26]
In order to make microSD bootable and layout kernel and userland on it, make two partitions and format it.~
At least 128M bytes are required.~
1. Format first 40M bytes of microSD as FAT16~
2. Format remains as ext2~
(Use fdisk、mkvfat、mkext2 or gparted etc.)~
On the condition that vfat partition is mounted to /media/disk and ext2 partition to /media/disk-1,~
copy required files to appropriate directory as follows:
 $ sudo cp ~/gumstix/gumstix-oe/extras/mmc-root/gumstix-factory.script /media/disk/
 $ sudo cp ~/gumstix/gumstix-oe/tmp/deploy/glibc/images/gumstix-custom-verdex/uImage-2.6.24-r1-gumstix-custom-verdex.bin /media/disk/uimage
 $ sudo tar -C /media/disk-1/ -xvfz ~/gumstix/gumstix-oe/tmp/deploy/glibc/images/gumstix-custom-verdex/gumstix-directfb-image-gumstix-custom-verdex.tar.gz
 $ sudo tar -C /media/disk-1/ -xvfz ~/gumstix/gumstix-oe/tmp/deploy/glibc/images/gumstix-custom-verdex/modules-2.6.24-r1-gumstix-custom-verdex.tgz

**microSD boot [#od92c2fb]
**Booting from microSD[#od92c2fb]
Insert ready microSD into bc9's microSD slot, connect serial cable to PC and power on.~
Boot message appear on serial console and bc9 boot from microSD.~
(But beware: nothing appear on LCD when first boot time.)~
During first time boot locale setting and ssh_key generation are executed. ~
So first time boot take slightly longer time.~ 
When boot completed, login from serial console and set kernel modules as follows: 
 $ depmod
 $ vi /etc/modules/pxafb
 write only pxafb and save.
 $ vi /etc/modules/fbcon
 write only fbcon and save. 
 $ update-modules
Then prompt appear on LCD and pxa frame buffer activated after second time boot.
-----------------
RIGHT:by Satoshi OTSUKA

Front page   Edit Diff Backup Upload Copy Rename Reload   New List of pages Search Recent changes   RSS of recent changes