Advanced OpenEmbedded
Contents
Setting up opkg feeds
- Install Apache
- sudo apt-get install apache2
- Add a symlink to the openembedded deploy/ipk directory:
- sudo ln -s /home/user/chumby-oe/output-angstrom-.9/deploy/eglibc/ipk /var/www/oe-repo
- Determine your IP address, and then add the following line to meta-chumby/conf/local.conf - you will need to rebuild the -image and re-write it to an SD card:
- FEED_DEPLOYDIR_BASE_URI = "http://ip-address/oe-repo"
- After you finish building packages, refresh the package index
- bitbake package-index
- On the device, re-fetch the package list
- opkg update
- On the device, search for packages or install them
- opkg list '*strace*'
- opkg install strace
Tuning the build
- Edit meta-chumby/conf/local.conf
- nano -w meta-chumby/conf/local.conf
- Change "BB_NUMBER_THREADS" to be something reasonable such as one greater than the number of cores present on your system.
- Change PARALLEL_MAKE to be 1 or 2, depending on how much memory you have.
- If you're running builds under X11, remove the "TERMCMD" and "TERMCMDRUN" commands. If you ever need to use the devshell under X11, it will open up a new xterm. The default is to open up a new "screen" session, which is best for interacting with OpenEmbedded via SSH.
- Save and quit
- Press Ctrl-X, type "Y", and press Enter to save and quit.
Tuning the resulting image
- Edit meta-chumby/conf/machine/chumby-falconwing.conf
- nano -w meta-chumby/conf/machine/chumby-falconwing.conf
- Change the size of the rootfs. Value is in kilobytes. The resulting image will always be about 16 megabytes larger, due to the overhead of the bootloader
- IMAGE_ROOTFS_SIZE = "450000"
- Set the width and height of the display. Note you may need to make kernel patches in order to force it to PAL mode, or to add additional LCDs
- MACHINE_DISPLAY_WIDTH_PIXELS = "720"
- MACHINE_DISPLAY_HEIGHT_PIXELS = "480"
Patching the kernel (using devshell and screen)
- Start up a devshell
- bitbake virtual/kernel -c devshell &
- Wait until the log says "task do_devshell: Started"
- Enter the devshell
- screen -r
- Add everything to git
- git init
- git add *
- Git might throw an error saying "patches" won't be added, so remove that directory and try again (rm -rf patches; git add *)
- git commit -m "Commit"
- Set up for building the kernel
- unset LDFLAGS
- Make changes (for example):
- nano -w arch/arm/mach-stmp3xxx/lcd_lms350.c
- make
- Test changes
- Copy arch/arm/boot/zImage to device
- Write kernel e.g. by running "config_util --cmd=putblock --dev=/dev/mmcblk0p1 --block=krnA < /media/usb/zImage"
- Commit changes (for example):
- git add arch/arm/mach-stmp3xxx/lcd_lms350.c
- git commit -m "Changed timing on LCD"
- Create a patch
- git format-patch HEAD~1
- Copy the resulting .patch file to ~/chumby-oe/meta-chumby/recipes/linux/linux-falconwing/
- cp 0001-lcd-timings.patch ~/chumby-oe/meta-chumby-recipes/linux/linux-falconwing/
- Exit the devshell
- exit
- Edit the kernel recipe and add the new patch, adding the patch to the SRC_URI
- nano -w ~/chumby-oe/meta-chumby/recipes/linux/linux-falconwing_2.6.28.1.0.3454.bb
- file://0001-lcd-timings.patch \
- Rebuild the kernel and bootloader
- bitbake virtual/kernel virtual/bootloader -c clean
- bitbake virtual/kernel
- bitbake virtual/bootloader
Make your own custom image
These instructions are based on http://bec-systems.com/site/456/capture-oe-source-changes
- Copy meta-chumby/recipes/images/chumby-starter-image.bb to your own image file
- cp meta-chumby/recipes/images/chumby-starter-image.bb meta-chumby/recipes/images/my-local-image.bb
- Edit the image and add any packages to DEPENDS and IMAGE_INSTALL
- nano -w meta-chumby/recipes/images/my-local-image.bb
- Build the image
- bitbake my-local-image
- Write the image out to disk
- sudo dd if=output-angstrom-.9/deploy/eglibc/images/chumby-falconwing/rom-chumby-falconwing-my-local-image.img of=/dev/sdb bs=8M # Write the resulting my-local-image to the SD card plugged into sdb