Академический Документы
Профессиональный Документы
Культура Документы
Alexander Granizo
Contents
1 Introduction
1.1 1.2 1.3 1.4 1.5 1.6 BeagleBoard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Why Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . OpenEmbedded Project
3
3 4 5 5 5 6 6
Poky Platform Builder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Used Hardware and Software Versions Summary 1.6.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 The basics
2.1 2.2 2.3 2.4 2.5 Required Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Required Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Testing the BeagleBoard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . SD card partitioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Summary 2.5.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Suggestions for Additional Reading . . . . . . . . . . . . . . . . . . . . . .
7
7 7 8 9 18 18
19
19 19 19 19 19
20
20 20 20 20 21 21 23 23 23 24 24 24
NFS server on Host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using a remote kernel image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Using a remote lesystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Conguring an OPKG Repository on Host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.10 Single workstation vs. Network setup . . . . . . . . . . . . . . . . . . . . . . . . . 4.11 Summary 4.11.1 Suggestions for Additional Reading . . . . . . . . . . . . . . . . . . . . . .
CONTENTS
25
25 25 25 25 25 25 25 25 25 25
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
26
26 26 26 26
Chapter 1
Introduction
1.1 BeagleBoard
Beagleboard is a low-power, low-cost single-board computer. The BeagleBoard was designed with open source development in mind, and as a way of demonstrating the Texas Instrument's OMAP system-on-a-chip solutions. The board was developed by a team of TI engineers as an educational board that could be used in colleges around the world to teach open source hardware and open source software capabilities. The BeagleBoard has a large community following that can be found at beagleboard.org.[ ] The board used during the writing this test is the BeagleBoard-xM model, which has the following specications:
Processor TI DM3730 Processor - 1 GHz ARM Cortex-A8 core 'HD capable' TMS320C64x+ core (800 MHz up to 720p @30 fps) Imagination Technologies PowerVR SGX 2D/3D graphics processor supporting dual independent displays 512 MB LPDDR RAM memory 4 GB microSD card is supplied with the BeagleBoard-xM loaded with Angstrom.
Peripheral connections
DVI-D (HDMI connector chosen for size - maximum resolution is 1280x1024) S-Video USB OTG (mini AB) 4 USB ports Ethernet Port MicroSD/MMC card slot Stereo in and out jacks RS232 port JTAG connector
CHAPTER 1.
INTRODUCTION
Other characteristics
Boot code stored on the uSD card Boot from uSD/MMC only Alternative Boot source button. Able to run Android, Angstrom Linux, Fedora, Ubuntu, Gentoo and Maemo Linux distributions, and the Windows CE operating system.
For further information about the Beagleboard and its components, please refer to the System Reference Manual.[ ]
Open Source
The sourcecode of a program can be checked and edited when necessary. This
possibility accelerates the debugging and customizing of an Embedded System and alliviates procedures regarding to licensing and NDAs. However, there are some not to say disadvantages but inconveniences originated from Linux use:
Documentation
and/or incomplete. For this cases, the debugging of a problem requires not only a glance into the manual, but a thorough searching and reading of the forums, mail lists, and even the source code itself. The main objective of this work is to introduce the reader to the exciting word of Embedded Systems and to ease the rst steps with the setup and conguration of a development workstation. The text will provide the means to quick start the development, and to concentrate on the embedded application, instead of conguration troubleshooting.
Highly congurable to support various hardware platforms, Linux distributions, and processor architectures.
CHAPTER 1.
INTRODUCTION
Handle package inter-dependencies. Handle kernel and user-space software cross-compilation. Is able to create package suitable for a chosen Linux distribution. (tar, rpm, deb, ipk) Is able to create complete Linux images from packages. Is able to create cross-compiler toolchain- and SDK- packages able to be used within a an IDE such as Eclipse.
Based on focused, stable, subset of OpenEmbedded that can be easily and reliably built and developed upon. Includes a pre-congured QEMU device emulator, which provides a virtual target for development and debugging. Provides Yocto SDK Plug-in, which eases the setup of a toolchain, emulator and debugging utilities within Eclipse.
During the development of this work, both OpenEmbedded and Poky were tested.
As both
projects are Open-Source, and they're both based on Bitbake compiler, it is possible to port the existing Recipes from one platform to another. However, it was discovered, that OpenEmbedded resulted to be more exible than Poky, and most of the required software recipes (OpenCV within others) were already supported in OpenEmbedded. For all of these reasons, the OpenEmbedded platform was chosen.
The build framework used in the developments was OpenEmbedded (Release 2011.03) with some recipes ported from Poky platform builder (version Laverne-4.0). The kernel version used on the Beagleboard was linux-omap-psp version 2.6.32. The chosen Linux distribution was ngstrm
CHAPTER 1.
INTRODUCTION
1.6 Summary
1.6.1 Suggestions for Additional Reading
Chapter 2
The basics
To start the developing with the board, we need to following additional hardware accessories:
A RS-232 (Serial) port on the development computer or a USB-Serial adapter A MicroSD card reader capable to read SDHC cards A 5V DC power source
To ease the development and to have a direct input to the Beagleboard, some additional accessories are suggested:
Monitor with HDMI or DVI-D connection HDMI video cable (with an optional HDMI to DVI-D adapter) USB keyboard USB Mouse
? ?].
CHAPTER 2.
THE BASICS
Make sure that the BeagleBoard is powered o Connect a serial cable to a serial port of Window/Linux/Mac machine. In case an USB adapter is used, the name of the port that it uses can be found listing the last device messages.
$ dmesg | tail ... [ ...] usb 5-1: FTDI USB Serial Device converter now attached to ttyUSB0 ...
Have a terminal program, such as TeraTerm, HyperTerminal, or Minicom, running on the host machine Congure the terminal program for BAUD RATE - 115200, DATA - 8 bit, PARITY- none, STOP - 1bit, FLOW CONTROL - none. In case of Minicom, once the program is running, press Ctrl+A, Z for help, and then O for conguration.
Insert the provided originally MMC/SD card into MMC/SD slot on Beagle Board. Connect it to the power and press the reset button on the board. The following output should appear on the terminal:
Texas Instruments X-Loader 1.4.4ss (Aug 19 2010 - 02:49:27) Beagle xM Rev A Reading boot sector Loading u-boot.bin from mmc U-Boot 2010.03-dirty (Aug 20 2010 - 20:50:46) OMAP3630/3730-GP ES2.0, CPU-OPP2, L3-165MHz, OMAP3 Beagle board + LPDDR/NAND I2C: ready DRAM: 512 MB NAND: 0 MiB .... Starting Dropbear SSH server: dropbear. Starting syslogd/klogd: done .-------. | | .-. | | |-----.-----.-----.| | .----..-----.-----. | | | __ | ---| --.| .-| | | | | | | | |--- || --| | | | | | | ------------. |----------- -------- - | ---
CHAPTER 2.
THE BASICS
The Angstrom Distribution beagleboard ttyS2 Angstrom 2010.7-test-20100820 beagleboard ttyS2 beagleboard login:
If you see these messages, it means that the BeagleBoard is alive and running. You can log in into the system as a root user. The initial root password is not set.
CHAPTER 2.
THE BASICS
10
X-Loader (MLO) U-Boot (u-boot.bin) U-Boot script (boot.scr) Linux kernel (uImage)
Linux lesystem
It uses the OpenEmbedded (OE from now on) platform, a toolchain that makes cross-compiling and deploying packages easy for embedded platforms. There are other Linux distribuitions available, however, this manual will bases itself on ngstrm. Once that the Beagleboard is checked and running, we will install OpenEmbedded and compile a new Linux lesystem for it.
$ sudo apt-get install python3-all-dev patch m4 perl diff $ sudo apt-get install wget curl ftp cvs subversion git-core $ sudo apt-get install tar bzip2 gzip unzip $ sudo apt-get install jade docbook docbook-dsssl \ docbook-utils sgmltools-lite texinfo texi2html $ sudo apt-get install bison libsdl1.2-dev $ sudo apt-get install sed coreutils gawk python-pysqlite2 \ diffstat help2man make gcc build-essential g++ \ desktop-file-utils chrpath
CHAPTER 2.
THE BASICS
11
$OEBASE variable to denote the base directory of the OpenEmbedded environment. For the sake of example, $OEBASE will be /home/<user>/oe. The base directory of your OpenEmbedded environment ($OEBASE) is the location where
sources will be checked out (or unpacked). You must choose a location with no symbolic links above it. As next step the OE metadata (information, recipes, tools, etc) will be downloaded from their GIT repository. The used version of OE will be the 2011.03 release.
$ export OEBASE="/home/<user>/oe" $ mkdir -p ${OEBASE} && cd ${OEBASE} $ git clone git://git.openembedded.org/openembedded.git openembedded $ cd openembedded $ git checkout -b release-2011.03 origin/release-2011.03 $ cd ${OEBASE}/openembedded $ git pull
Congure OpenEmbedded
When you have downloaded all metadata les, you need to set up OE indicating your target board, directory of OE recipes, and other les. directory tree. To do this, inside of
$OEBASE
create a new
/conf
BBFILES ?= "/home/<user>/oe/openembedded/recipes/*/*.bb" DISTRO = "angstrom-2008.1" MACHINE = "beagleboard" IMAGE_FSTYPES = "tar" INHERIT += "rm_work" GLIBC_GENERATE_LOCALES = "en_US.UTF-8 en_GB.UTF-8 de_DE.UTF -8" PARALLEL_MAKE = "-j 8" BB_NUMBER_THREADS = "8"
CHAPTER 2.
THE BASICS
12
The value of the last two variables should be set in accordance to the number of processors on the host machine. For the sake of example, the Intel Core i7 processor used in the development on this work, has 4 physical processors which support Hyper Threading, so a total of 8 processors will be available to the OS. In this case in particular, the values of
BB_NUMBER_THREADS
and
PARALLEL_MAKE
were set equal to the number of processor. In case when no user interaction
will occur during the compilation, the value could be even higher than the number of processors. As a last step of the conguration, we create a le named config_oe.sh in the OE root folder. The le is responsible to set-up all the environment variables in order to run Bitbake. The le will look like this:
# !/bin/bash # openembedded configure script # Configure Paths export OEBASE=/home/agranizo/oe export BBPATH=${OEBASE}/build:${OEBASE}/openembedded export PATH=${OEBASE}/bitbake/bin:$PATH # Make shell look better.. if [ "$BASH" ]; then export PS1="\[\033[01;32m\]BB:\[\033[00m\] ${PS1}" fi
nano text editor). The process should take long time the rst times, but as the packages are
created and saved on each consecutive build, the process will be faster each time.
~/oe$ source config_oe.sh ~/oe$ cd build/ ~/oe/build$ bitbake nano NOTE: Handling BitBake files: | (6779/6779) 100 % NOTE: Parsing finished. 6491 cached, 0 parsed, 288 skipped, 0 masked. NOTE: Cache is clean, not saving. NOTE: Resolving any missing task queue dependencies NOTE: Preparing runqueue NOTE: Executing runqueue ... NOTE: Running task 669 of 669 (ID: 0, /home/agranizo/oe/ openembedded/recipes/nano/nano_2.0.7.bb, do_rm_work_all)
CHAPTER 2.
THE BASICS
13
NOTE: Tasks Summary: Attempted 669 tasks of which 637 didnt need to be rerun and 0 failed.
If the compilation ended successfully, the output should show 0 failed tasks. If the compilation ended unexpectedly, the compilation could be started once again, with the same bitbake command (the intermediate resuts are stored although).
base-image:
The smallest possible image which allows for ssh access and the ability to
console-image:
networking)
Build an image without the X11, but including some extra tools (e.g.
x11-image:
them.
Build process takes a lot of time, as it need to download many packages from the net an build The resulting les will be contained in two archives: one containing the Linux kernel and its modules and the other with the complete lesystem structure compressed. To compile, proceed as following:
~/oe$ source config_oe.sh ~/oe$ cd build/ ~/oe/build$ bitbake x11-image ... NOTE: Running task 5899 of 5899 (ID: 9, /home/agranizo/oe/ openembedded/recipes/images/x11-image.bb, do_build) NOTE: package x11-image-1.0-r0: task do_build: Started NOTE: package x11-image-1.0-r0: task do_build: Succeeded NOTE: Tasks Summary: Attempted 5899 tasks of which 0 didnt need to be rerun and 0 failed.
At the end, all the les used on the compilation, as well as results of the compilation will be contained in the be located in the
${OEBASE}/build/tmp directory. The individual software packages will ${OEBASE}/build/tmp/deploy/glibc/ipk and the complete Linux images will be available in ${OEBASE}/build/tmp/deploy/glibc/images/beagleboard.
For more information about the OE directory structure, please refer to the OpenEmbedded User Manual [ ].
The les which represent interest for us are: - The rst stage bootloader. - The U-Boot bootloader for the Beagleboard. - A compressed Linux kernel. - A complete compressed Linux lesystem.
MLO-beagleboard
u-boot-beagleboard.bin uImage-beagleboard.bin
x11-image-beagleboard.tar.bz2
CHAPTER 2.
THE BASICS
14
modules-beagleboard.tgz
needed.
In order to use these les on the target board, a specically partitioned micro SD card will be
into the SD Card Reader and then plug the SD Card Reader into your system. After doing that,
$ dmesg | tail ... [...] sd 19:0:0:0: [...] sd 19:0:0:0: [...] sd 19:0:0:0: [...] sdb: sdb1 [...] sd 19:0:0:0: [...] sd 19:0:0:0: ...
[sdb] Mode Sense: 03 00 00 00 [sdb] Assuming drive cache: write through [sdb] Assuming drive cache: write through [sdb] Assuming drive cache: write through [sdb] Attached SCSI removable disk
In this case, it shows up as /dev/sdb (note sdb inside the square brackets above).
more than one partition (only one shown in the example below). Note the "Mounted on" eld in the above and use that name in the umount commands below. If the card is mounted, we will
$ df -h Filesystem Size ... /dev/sdb1 70M /dev/sdb2 3.6G $ umount /media/boot $ umount /media/ROOTFS
Used Avail Use% Mounted on 2.6M 240M 67M 3.2G 4% /media/boot 7% /media/ROOTFS
Start fdisk
v/sdb1).
Be sure to choose the whole device (/dev/sdb), not a single partition (/de-
CHAPTER 2.
THE BASICS
15
Print the partition record This will be the starting point for the partitioning proMake sure to write down the number of bytes on the card (in this example, 3951034368).
cess.
Command (m for help): p Disk /dev/sdb: 3951 MB, 3951034368 bytes 122 heads, 62 sectors/track, 1020 cylinders Units = cylinders of 7564 * 512 = 3872768 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000eb984 Device Boot Start End Blocks Id System /dev/sdb1 1 20 72261 c W95 FAT32 (LBA) * Partition 1 has different physical/logical beginnings (non-Linux?): phys=(0, 1, 1) logical=(0, 1, 2) Partition 1 has different physical/logical endings: phys=(8, 254, 63) logical=(19, 14, 1) Partition 1 does not end on cylinder boundary. /dev/sdb2 20 1021 3786139+ 83 Linux Partition 2 has different physical/logical beginnings (non-Linux?): phys=(9, 0, 1) logical=(19, 14, 2) Partition 2 has different physical/logical endings: phys=(480, 89, 57) logical=(1020, 25, 34) Partition 2 does not end on cylinder boundary.
CHAPTER 2.
THE BASICS
16
sectors/track, then do the following expert mode steps to redo the SD Card.
Expert command (m for help): h Number of heads (1-256, default 122): 255
Set the number of sectors to 63.
Expert command (m for help): s Number of sectors (1-63, default 62): 63 Warning: setting sector offset for DOS compatiblity
Now calculate the number of Cylinders for your SD Card.
#cyl = f loor
For this example don't round).
#BytesOnCard 25563512
We will use 480 (i.e. truncate,
Expert command (m for help): c Number of cylinders (1-1048576, default 1020): 480
Return to Normal mode.
CHAPTER 2.
THE BASICS
17
Create the FAT32 partition for booting and transferring les from Windows
Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-480, default 1): <enter> Using default value 1 Last cylinder, +cylinders or +size{K,M,G} (1-480, default 480): +50 Command (m for help): t Selected partition 1 Hex code (type L to list codes): c Changed system type of partition 1 to c (W95 FAT32 (LBA))
Mark it as bootable
Command (m for help): a Partition number (1-4): 1
CHAPTER 2.
THE BASICS
18
Start 1 52
End 51 480
Id c 83
temporary. At this step the new partition table will be written on the card.
The two partitions are given the volume names boot and rootfs If the card was previously
$ sudo mkfs.msdos -F 32 /dev/sdb1 -n boot mkfs.msdos 3.0.9 (31 Jan 2010) $ sudo mkfs.ext3 -L rootfs /dev/sdb2 mke2fs 1.41.12 (17-May-2010) Filesystem label=ROOTFS OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 215568 inodes, 861485 blocks 43074 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=884998144 27 block groups 32768 blocks per group, 32768 fragments per group 7984 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200 Writing inode tables: done Creating journal (16384 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 33 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
CHAPTER 2.
THE BASICS
19
Used Avail Use% Mounted on 3.3M 165M 396M 3.0G 1% /media/boot 6% /media/rootfs
cd oe/build/tmp/deploy/glibc/images/beagleboard/ ls cp MLO-beagleboard /media/boot/MLO cp u-boot-beagleboard.bin /media/boot/u-boot.bin cp uImage-beagleboard.bin /media/boot/uImage sudo tar xvfj x11-image-beagleboard.tar.bz2 -C /media/rootfs/ sudo tar xvfz modules-beagleboard.tgz -C /media/rootfs/ sync
Location of the kernel le. Location and mounting instructions for the root lesystem. Video options such as: video driver name, used video memory, default display, resolution and color depth.
In order to use the available screen the available video resolution will be changed.
CHAPTER 2.
THE BASICS
20
mkimage will be needed. To compile the script use the following command:
Listing 2.2: Plain text boot script (boot.cmd)
$ $
sudo apt-get install uboot-mkimage mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n " BeagleBoard-xM Boot script" -d boot.cmd boot.scr
Now just copy the newly created boot.scr le on your SD card, and insert the card into the BeagleBoard. Proceed with the proceedure decribed in the Section 2.3 in order to boot up and test the new Linux installation.
$ whereis dhcpd
If it is not available on the system install it and the related packages.
/etc/dhcp3/dhcpd.conf
#authoritative; # Warning: this overrides other DHCP servers ddns-update-style none; option domain-name-servers 141.19.69.34, 141.19.1.75; default-lease-time 3600; max-lease-time 360000; subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.2 192.168.0.2; option subnet-mask 255.255.255.0; option broadcast-address 192.168.0.255; option routers 192.168.0.1; }
CHAPTER 2.
THE BASICS
21
In le
/etc/default/dhcp3-server
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests? # Separate multiple interfaces with spaces, e.g. "eth0 eth1". INTERFACES="eth2"
Congure the startup settings of the dhcp3-server daemon. A group change of dhcp.conf le will be needed.
$ sudo update-rc.d -f dhcp3-server remove sudo password for agranizo: Removing any system startup links for /etc/init.d/dhcp3server ... /etc/rc1.d/K40dhcp3-server /etc/rc2.d/S40dhcp3-server ... $ sudo update-rc.d dhcp3-server defaults update-rc.d: warning: dhcp3-server stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (1) Adding system startup for /etc/init.d/dhcp3-server ... /etc/rc0.d/K20dhcp3-server -> ../init.d/dhcp3-server /etc/rc1.d/K20dhcp3-server -> ../init.d/dhcp3-server ... $ sudo chgrp dhcpd /etc/dhcp3/dhcpd.conf
As last step of the conguration, the daemon will be added to the end with
This way, th daemon starts along with every user session. Please remember that the le should
exit 0
line.
CHAPTER 2.
THE BASICS
22
$ sudo service dhcp3-server status Status of DHCP server: dhcpd3 is running. $ netstat -au | grep bootp udp 0 0 *:bootps *:* $ tail /var/log/messages
To test the dhcp client on the target, please reboot and wait until the board obtains the congured IP address (192.168.0.2). The network interface on Beagleboard is usb0, as the network is managed by a USB-OTG chip.
beagleboard:~$ ifconfig ... usb0 Link encap:Ethernet HWaddr E2:86:55:40:EC:06 inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1492 Metric:1 RX packets:7 errors:0 dropped:0 overruns:0 frame:0 TX packets:25 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1330 (1.2 KiB) TX bytes:3544 (3.4 KiB) ...
root@beagleboard:~# cd /etc/dropbear root@beagleboard:/etc/dropbear# ls dropbear_rsa_host_key root@beagleboard:/etc/dropbear# rm -rf dropbear_rsa_host_key #Generate a new key root@beagleboard:/etc/dropbear# dropbearkey -t rsa -f dropbear_rsa_host_key Will output 1024 bit rsa secret key to dropbear_rsa_host_key Generating key, this may take a while... Public key portion is: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgwC4KEUi9HU1SAPoL+0lTDgi7 ... Fingerprint: md5 a1:8e:90:77:b7:91:f7:33:db:98:7f:01:35:8c:f0 :45
CHAPTER 2.
THE BASICS
23
# View the generated key root@beagleboard:/etc/dropbear# dropbearkey -y -f dropbear_rsa_host_key Public key portion is: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgwC4KEUi9HU1SAPoL+0lTD... root@beagleboard Fingerprint: md5 a1:8e:90:77:b7:91:f7:33:db:98:7f:01:35:8c:f0 :45
$ cd ~/.ssh agranizo@EMB-158:~/.ssh$ ll total 12 drwx------ 2 agranizo agranizo 4096 2010-12-16 16:52 ./ drwxr-xr-x 91 agranizo agranizo 4096 2011-06-20 23:31 ../ -rw-r--r-- 1 agranizo agranizo 499 2011-03-03 19:50 known_host # Add the SSH key according to the SSH server ~/.ssh$ gedit known_hosts $ ssh 192.168.0.2 -l root The authenticity of host 192.168.0.2 (192.168.0.2) cant be established. RSA key fingerprint is 56:c3:65:e8:14:79:5d:bc:21:aa:2a:d3 :63:43:b4:45. Are you sure you want to continue connecting (yes/no)? y Please type yes or no: yes Warning: Permanently added 192.168.0.2 (RSA) to the list of known hosts. root@192.168.0.2s password: root@beagleboard:~#
CHAPTER 2.
THE BASICS
24
Possibility to reinstall OE without loosing the the development progress. Ease in the organization of the OE recipes and les. Conguration of the recipe priorities during the compilation.
The conguration of the layer structure may be made in two les: The le
${OEBASE}/build/conf/bblayers.conf
# LAYER_CONF_VERSION is increased each time build/conf/ bblayers.conf # changes incompatibly LCONF_VERSION = "3" BBFILES = "" TOPDIR = "${@os.path.dirname(os.path.dirname(os.path.dirname( d.getVar(FILE, True))))}" BBLAYERS = "${TOPDIR}/openembedded ${TOPDIR}/meta-custom"
The le
layer, as well as the location of the layer's recipe les. In this example we will create a new layer directory called meta-custom, assign a higher priority to it, copy a new recipe to it and compile it.
# We have a conf and classes directory, prepend to BBPATH to prefer our versions BBPATH .= ":${LAYERDIR}" # We have a recipes directory, add to BBFILES BBFILES := "${BBFILES} ${LAYERDIR}/recipes/*/*.bb \ ${LAYERDIR}/recipes/*/*.bbappend" BBFILE_COLLECTIONS += "custom" BBFILE_PRIORITY_custom = "1" BBFILE_PATTERN_custom = "^${LAYERDIR}/"
The /openembedded directory, thath contains the original les should have now its own layer.conf le. The meta-custom directory will have precedence over the original les, so it's relatively easy to test modied recipes but to keep the original les. The precedence is set with variable.
BBFILE_PRIORITY_oe
# We have a conf and classes directory, prepend to BBPATH to prefer our versions
CHAPTER 2.
THE BASICS
25
BBPATH .= ":${LAYERDIR}" # We have a recipes directory, add to BBFILES BBFILES := "${BBFILES} ${LAYERDIR}/recipes/*/*.bb \ ${LAYERDIR}/recipes/*/*.bbappend" BBFILE_COLLECTIONS += "oe" BBFILE_PRIORITY_oe = "0" BBFILE_PATTERN_oe = "^${LAYERDIR}/"
2.9 Summary
2.9.1 Suggestions for Additional Reading
Chapter 3
Toolchain and Cross-Compiling
${OEBASE}/openembedded/recipes/meta and is called meta-toolchain.bb. The target architecture for cross-compiling is the already congured in le ${OEBASE}/build/conf/local.conf at the denition of the the variable MACHINE. In our case the cross compiler will be deestined
${OEBASE}/build/tmp/deploy/glibc/sdk
direc-
~/oe/build$ cd tmp/deploy/glibc/sdk/ ~/oe/build/tmp/deploy/glibc/sdk$ ls angstrom-2010.7-test-20110617-x86_64-linux-armv7a-linuxgnueabi-toolchain-extras.tar.bz2 angstrom-2010.7-test-20110617-x86_64-linux-armv7a-linuxgnueabi-toolchain.tar.bz2 ~/oe/build/tmp/deploy/glibc/sdk$ sudo tar -C / -xjf ./ angstrom-2010.7-test-20110617-x86_64-linux-armv7a-linuxgnueabi-toolchain.tar.bz2 ~/oe/build/tmp/deploy/glibc/sdk$ sudo tar -C / -xjvf ./ angstrom-2010.7-test-20110617-x86_64-linux-armv7a-linuxgnueabi-toolchain-extras.tar.bz2
26
CHAPTER 3.
27
3.3 Cross-compiling a test program 3.4 Add libraries to the toolchain 3.5 Summary
3.5.1 Suggestions for Additional Reading
Chapter 4
Setting up a development workstation
Edit the /etc/exports le to include the directories which will be visible in the network. The le should contain these lines (please check the location of the lesystem directory):
$ $
$ rpcinfo -p 127.0.0.1
The rpcinfo utility should show the following ports and services:
28
CHAPTER 4.
29
program vers 100003 2 tcp 100003 3 tcp 100003 4 tcp 100227 2 tcp 100227 3 tcp 100003 2 udp 100003 3 udp 100003 4 udp 100227 2 udp 100227 3 udp
Test the NFS Server:
proto port 2049 nfs 2049 nfs 2049 nfs 2049 2049 2049 nfs 2049 nfs 2049 nfs 2049 2049
$ sudo mkdir /mnt/remote $ sudo chmod -R 774 /mnt/remote/ $ sudo mount -t nfs localhost:/home/agranizo/images/ fs_initial /mnt/remote $ exportfs -a http://tldp.org/HOWTO/NFS-HOWTO/server.html /etc/hosts.allow and /etc/hosts.deny
These two les specify which computers on the network can use services on your machine. Each line of the le contains a single entry listing a service and a set of machines. When the server gets a request from a machine, it does the following:
It rst checks hosts.allow to see if the machine matches a description listed in there. If it does, then the machine is allowed access. If the machine does not match an entry in hosts.allow, the server then checks hosts.deny to see if the client matches a listing in there. If it does then the machine is denied access. If the client matches no listings in either le, then it is allowed access.
4.2 Local vs. Remote Booting 4.3 Setting up some network cables 4.4 What is Remote Booting 4.5 TFTP server on Host
Check the tftp package.
$ whereis tftp
CHAPTER 4.
30
service tftp { socket_type = dgram protocol = udp wait = yes port = 69 user = nobody server = /usr/sbin/in.tftpd server_args = -s /tftpboot disable = no per_source = 11 cps = 100 2 }
3. Make /tftpboot directory
$ $ $ $ $ $
sudo mkdir /tftpboot mkdir debug_beagleboard_kernel sudo chmod -R 777 /tftpboot sudo chmod -R 777 debug_beagleboard_kernel/ sudo chown -R nobody /tftpboot sudo chown -R nobody debug_beagleboard_kernel/
$
5.
Testing.
$ touch /tftpboot/hda.txt $ chmod 777 /tftpboot/hda.txt $ ls -l /tftpboot/ total 0 -rwxrwxrwx 1 davids davids 0 2006-03-27 23:04 hda.txt $ tftp 192.168.1.100 tftp> put hda.txt Sent 722 bytes in 0.0 seconds tftp> quit $ ls -l /tftpboot/ total 4 -rwxrwxrwx 1 davids davids 707 2006-03-27 23:07 hda.txt
CHAPTER 4.
31
4.6 DHCP server on Host 4.7 Using a remote kernel image 4.8 Using a remote lesystem 4.9 Conguring an OPKG Repository on Host 4.10 Single workstation vs. Network setup 4.11 Summary
4.11.1 Suggestions for Additional Reading
Chapter 5
Working with Eclipse
5.1 Getting and Installing Eclipse 5.2 Installing Eclipse CDT 5.3 Installing the plugins 5.4 Conguring to work with a cross-toolchain 5.5 Cross compiling with Eclipse 5.6 Remote Debugging 5.7 Remote File Browse 5.8 Poky Linux 5.9 Summary
5.9.1 Suggestions for Additional Reading
32
Chapter 6
Emulation on the host
33