Building linux kernel

Да се разработи Linux/OSGi базирана разпределена сензорна система за събиране на метеорологични данни, състояща се от сензорна, сервизна и приложна части. Съставните части на системата да са гъвкаво конфигурируеми и с възможност да работят върху различни платформи. Функционалността, свързана с всеки отделен сензор да е йерархично разпределена и да може да се преконфигурира по време на работа на системата. Всеки отделен сензор или група, както и поддържаните от тях услуги да се регистрират в системата автоматично след инсталирането и пускането им в действие. Интерфейса към потребителя и персонала по поддръжката да е унифициран и достъпен чрез специализирано приложение или Интернет. Да се дефинират критерии за оценка на системата и съставните и части. Да се извърши анализ на възможни решения съобразно дефинираните критерии.

Building linux kernel

Postby mladen » Wed Aug 17, 2011 4:36 pm

We are going to build the latest version of linux kernel (2.6.37 in this case) for cs-e9302 target platform. However our machine configuration couldn't be found at OpenEmbedded linux recipes for latest kernel version
Code: Select all
user@ubuntu:~$ ls -al /angstrom/sources/openembedded/recipes/linux/linux-2.6.37/
total 1648
drwxr-xr-x  16 user user    4096 2011-03-27 20:07 .
drwxr-xr-x 205 user user   20480 2011-08-12 07:31 ..
drwxr-xr-x   2 user user    4096 2011-03-20 10:35 om-gta01
drwxr-xr-x   2 user user    4096 2011-03-20 10:35 om-gta02
-rw-r--r--   1 user user 1564402 2011-03-20 10:35 openmoko.patch
drwxr-xr-x   2 user user    4096 2011-03-20 10:35 openrd-base
drwxr-xr-x   2 user user    4096 2011-03-20 10:35 openrd-client
drwxr-xr-x   2 user user    4096 2011-03-20 10:35 qemuarm
drwxr-xr-x   2 user user    4096 2011-03-20 10:35 qemumips
drwxr-xr-x   2 user user    4096 2011-03-20 10:35 qemumips64
drwxr-xr-x   2 user user    4096 2011-03-20 10:35 qemumipsel
drwxr-xr-x   2 user user    4096 2011-03-20 10:35 qemuppc
drwxr-xr-x   2 user user    4096 2011-03-20 10:35 qemush4
drwxr-xr-x   2 user user    4096 2011-03-20 10:35 qemux86
drwxr-xr-x   2 user user    4096 2011-03-20 10:35 sheevaplug
-rw-r--r--   1 user user   34985 2011-03-20 10:35 shr.patch
drwxr-xr-x   2 user user    4096 2011-03-20 10:36 spitz
drwxr-xr-x   2 user user    4096 2011-03-20 10:35 visstrim_m10

Next few steps demonstrate process of configuring and building latest linux kernel in Angstrom distribution. First build the kernel normally with bitbake by running this command:
Code: Select all
bitbake virtual/kernel

This will create a source directory in /angstrom/build/tmp-angstrom_2008_1/work/cs-e9302-angstrom-linux-gnueabi/. In this case it will be /angstrom/build/tmp-angstrom_2008_1/work/cs-e9302-angstrom-linux-gnueabi/linux-2.6.24-r46/
Add the following file in your build configuration directory
Code: Select all
nano /angstrom/build/conf/site.conf

and add preferred version of linux kernel
Code: Select all
PREFERRED_VERSION_linux ?= "2.6.37"

Now we have to configure linux kernel. Run the following command
Code: Select all
bitbake -c configure virtual/kernel

This will create a source directory in
Code: Select all
/angstrom/build/tmp-angstrom_2008_1/work/cs-e9302-angstrom-linux-gnueabi/
.
In this case it will be
Code: Select all
/angstrom/build/tmp-angstrom_2008_1/work/cs-e9302-angstrom-linux-gnueabi/linux-2.6.37-r4/


Next step is to modify the kernel configuration based on the existing configuration. Please ensure you have ncurses development package installed
Code: Select all
apt-get install libncurses5-dev

Copy default configuration file from linux kernel sources.
Code: Select all
cp /angstrom/build/tmp-angstrom_2008_1/work/cs-e9302-angstrom-linux-gnueabi/linux-2.6.37-r4/linux-2.6.37/arch/arm/configs/ep93xx_defconfig /angstrom/build/tmp-angstrom_2008_1/work/cs-e9302-angstrom-linux-gnueabi/linux-2.6.37-r4/linux-2.6.37/.config

Let’s modify linux kernel configuration. Do this by passing a command argument to bitbake.
Code: Select all
bitbake –c menuconfig virtual/kernel

This invokes one of the standard kernel configuration tools menuconfig which provides a minimalist GUI based on the ncurses library.
NOTE: If this command does not launch an ncurses window, you are likely missing some tools on your workstation. For Ubuntu users, I have a check-installed.py script you can use to check your system. You can find it here - oe-build-essentials-project.
We are going to change some options in kernel configuration:
Code: Select all
System type:
[Enter] Cirrus EP93XX Implementation Options
   [Disable] Support ADC Sphere
   [Disable] Support Cirrus Logic EDB9301
   [Disable] Support Cirrus Logic EDB9307
   [Disable] Support Cirrus Logic EDB9312
   [Disable] Support Cirrus Logic EDB9315
   [Disable] Support Glomation GESBC-9312-sx
   [Disable] Support Contec Micro9-High
   [Disable] Support Contec Micro9-Lite
   [Disable] Support Technologic Systems TS-72xx SBC

Device drivers:
[Enter] Memory Technology Device:
[Disable] NAND Device Support
   [Enter] Block Devices:
      [Module] Loopback device support
      [Module] Network block device support
   [Enter] Network device support:
      [Disable] Ethernet (1000 Mbit)
      [Disable] Ethernet (10000 Mbit)
[Disable] Wireless LAN
[Enter] USB Network Adapters
   [Module] USB KLSI KL5USB101-based ethernet device support
   [Module] USB Pegasus/Pegasus-II based ethernet device support
   [Module] USB RTL8150 based ethernet device support
   [Module] Multi-purpose USB Networking Framework
   [Module] Davicom DM9601 based 1.1 10/100 ethernet devices
   [Module] SMSC LAN75XX based USB 2.0 gigabit ethernet devices
   [Module] SMSC LAN75XX based USB 2.0 10/100 ethernet devices
   [Module] GeneSys GL620USB-A based cables
   [Module] Profilic PL-2301/2302 based cables
   [Module] MosChip MCS7830 based Ethernet adapters
   [Module] Host for RNDIS and ActiveSync devices
   [Disable] eTEK based host-to-host cables (Advance, Belkin, …)
   [Disable] Embedded Arm Linux links (iPaq, …)
   [Disable] Sharp Zaurus (stock ROMs) and compatible
   [Enter] I2C support:
      [Disable] I2C Core Debugging Messages
      [Disable] I2C Algorithm Debugging Messages
      [Disable] I2C Bus Debugging Messages
   [Enable] SPI support
   [Enter] SPI support:
      [Enable] Cirrus Logic EP93XX SPI controller
      [Enable] User mode SPI device driver support
   [Enter] GPIO support:
      [Enable] /sys/class/gpio…(sysfs interface)
[Disable] Multifunction Device Drivers
[Enter] USB support:
   [Enable] USB Modem (CDC ACM) support
   [Enable] USB Atached SCSI
   [Enter] USB Serial Converter Support
      [Enable] USB Generic Serial Driver
      [Module] USB AIRCable Bluetooth Dongle Driver
      [Module] USB ARK Micro 3116 USB Serial Driver
      [Module] USB Belkin and Peracom Single Port Serial Driver
      [Module] USB Winchiphead CH341 Single Port Serial Driver
      [Module] USB Digi International AccelePort USB Serial Driver
      [Module] USB CP210x family of UART Bridge Controllers
      [Module] USB Cypress M8 USB Serial Driver
      [Module] USB Empeg empeg-car MARK I/II Driver
      [Module] USB FTDI Single Port Serial Driver
      [Module] USB Fundamental Software Dongle Driver
      [Module] USB Handspring Visor / Palm m50x / Sony Clie Driver
      [Module] USB IR Dongle Serial Driver
      [Module] USB Garmin GPS Driver
      [Module] USB IPWirelless (3G UMTS TDD) Driver
      [Module] USB Infinity USB Unlimited Phoenix Driver
      [Module] USB Moschip 7720 Serial Driver
      [Module] USB Moschip 7840/7820 USB Serial Driver
      [Module] USB Prolific 2303 Single Port Serial Driver
      [Module] USB Ours Technology Inc. OTi-6858 USB To RS232 Bridge Controller
      [Module] USB Qualcomm Auxiliary Serial Port Driver
      [Module] USB Qualcomm Serial Modem
      [Module] USB SPCP8x5 USB To Serial Driver
   [Enable] USB Gadget support
   [Enter] USB Gadget support
      [Module] Gadget Zero (DEVELOPMENT)
      [Module] Ethernet Gadget (with CDC Ethernet support)
      [Module] Mass Storage Gadget
      [Module] Serial Gadget (with CDC ACM and CDC OBEX support)
      [Module] CDC Composite Device (Ethernet and ACM)
      [Module] HID Gadget
   [Enter] Real time clock:
      [Disable] Dallas/Maxim DS1307/37/38/39/40, ST M4T00, EPSON RX-8025
      [Disable] ST M48T86/Dallas DS12887
   [Enable] MMC/SD/SDIO card support
File systems
[Enter] Miscellaneous filesystems
   [Enable] JFFS2 summary support
   [Enable] Advanced compression options for JFFS2
[Enter] DOS/FAT/NT Filesystems
   [Module] MSDOS fs support
   [Module] VFAT (Windows-95) fs support
   [Module] NTFS file system support
Kernel hacking:
[Disable] Kernel debugging

When you are done, the new kernel configuration file can be found here
Code: Select all
/angstrom/build/tmp-angstrom_2008_1/work/cs-e9302-angstrom-linux-gnueabi/linux-2.6.37-r4/linux-2.6.37/.config

We have to add linux recipe in our repository. Create directory
Code: Select all
mkdir -p /angstrom/sources/local/recipes/linux

First let's copy the bbfile recipe of linux kernel from OpenEmbedded repository:
Code: Select all
cp /angstrom/sources/openembedded/recipes/linux/linux_2.6.37.bb /angstrom/sources/local/recipes/linux/linux_2.6.37.bb

Now edit file
Code: Select all
nano /angstrom/sources/local/recipes/linux/linux_2.6.37.bb

and change line
Code: Select all
require linux.inc

to
Code: Select all
require ${BBFILE_PATTERN_oe}/recipes/linux/linux.inc

Then we have to create linux configuration file directory
Code: Select all
mkdir -p /angstrom/sources/local/recipes/linux/linux-2.6.37/cs-e9302/

Copy configuration file to local repository
Code: Select all
cp /angstrom/build/tmp-angstrom_2008_1/work/cs-e9302-angstrom-linux-gnueabi/linux-2.6.37-r4/linux-2.6.37/.config /angstrom/sources/local/recipes/linux/linux-2.6.37/cs-e9302/defconfig

Finally build the kernel
Code: Select all
bitbake virtual/kernel

After building the image file could be found at
Code: Select all
/angstrom/build/tmp-angstrom_2008_1/deploy/glibc/images/cs-e9302/
mladen
 
Posts: 10
Joined: Tue Feb 22, 2011 5:16 pm

Return to OSGi based sensor network

Who is online

Users browsing this forum: No registered users and 1 guest

cron