Difference between revisions of "Category talk:FAQ"

From Openembedded.org
Jump to: navigation, search
(finance personal software: new section)
Line 238: Line 238:
 
== 6. How do I unpack ipk files? ==
 
== 6. How do I unpack ipk files? ==
 
ipk package files can be unpackaged with the `ar` command.  Ex: `ar x <path to ipk file>`  You can also inspect the files inside an ipk and get other information with the dpkg command if your distribution has it.
 
ipk package files can be unpackaged with the `ar` command.  Ex: `ar x <path to ipk file>`  You can also inspect the files inside an ipk and get other information with the dpkg command if your distribution has it.
 
== personal finance software ==
 
 
One again, your article is very nice
 
 
== finance personal software ==
 
 
Good
 

Revision as of 22:16, 10 August 2010

Contents

Old Wiki Faq

The old wiki installation seems to have eaten the FAQ page. Let's try to restore some of the information from web.archive.org, this will need to be compared with the last known-good version from google (mark all text on that page to make it visible). Content still to be moved follows

--Laibsch 23:08, 4 June 2008 (UTC)

Development

1. what does OpenEmbedded keyword X do?

Check out the documentation in the following file: http://www.openembedded.org/repo/org.openembedded.dev/conf/documentation.conf

2. How can I make bitbake to use a specific version of <tool>?

See PREFERRED_VERSION

3. How can I make bitbake use proxychains when doing cvs operations?

See FETCH_COMMAND and UPDATE_COMMAND

4. What is the easiest way to convert Debian ARM packages to ipkg's (if size doesn't matter)?

mv foo.deb foo.ipk

5. How do I add a package to OE?

Most of the time adding a package to OE will not be as easy as 1-2-3. Many software developers do not cross-compile their packages and are generally unaware of good design decisions that facilitate or break cross-compilation.

6. How can I do a recursive make?

Implement a structure along the following lines.

do_compile {
    for i in dir; oe_runmake ...; done
}

7. How do I set a variable according to the kernel version of the package being built?

Use base_conditional in the following manner:

CFLAGS_append = '${@base_conditional("KERNEL_MAJOR_VERSION", "2.6", " -D__Linux26__ ", " -D__Linux24__ ",d)}'

In the example above -D__Linux26__ will be added to the existing CFLAGS if the kernel is 2.6 and -D__Linux24__ if the kernel is 2.4


8. What is ARM EABI and how do I use it?

ARM EABI is the informal name for the ABI for the ARM Architecture standard developed by ARM Ltd and others. This standard explains how tools should generate object and excecutable files.

To instruct OE to build EABI parts, you typically need the following in your distro conf file:

 TARGET_OS=-gnueabi

See the Angstrom distro for an example: http://www.openembedded.org/repo/org.openembedded.dev/conf/distro/angstrom.conf http://www.openembedded.org/repo/org.openembedded.dev/conf/distro/angstrom-2006.9.conf

You also need to make sure your kernel has the needed support. From the codesourcery faq, you need the following:

  • CONFIG_EABI must be enabled
  • Kernel must include support for NPTL
  • kernel versions earlier than 2.6.17 should be avoided

9. What is NPTL and how do I use it in OE?

NPTL is the Native POSIX Thread Library which is a software feature that enables the Linux kernel to run programs written to use POSIX Threads very efficiently. It is meant to replace an older implementation named Linuxthreads.

  • [1]
  • [2]
  • to check what threading library you have, run the following command: getconf GNU_LIBPTHREAD_VERSION. You can also type:

/lib/libc.so.6 to get information on what threading lib is used.

There are two options for threading (from pb email):

  • With linuxthreads, you need glibc-initial, then gcc-cross-initial,

then glibc, then gcc-cross.

  • With nptl, you need glibc-initial, then gcc-cross-initial, then

glibc-intermediate, then gcc-cross, then glibc.

To use linuxthreads, you need something like the following:

PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-for-gcc = glibc

For NPTL, this becomes:

PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-for-gcc = glibc-intermediate


10. How do I apply for read-write status to the OpenEmbedded monotone repo?

Hang around IRC in #oe, use the dev mailing list or some other way to get in contact with the OE devs. Explain to them why you think you should be given rw access. If your request is granted, create your key and send it to the maintainers.

11. How do I add additional packages to a bootstrap-image generated image?

You can add packages to your build by setting the MACHINE_EXTRA_RDEPENDS or DISTRO_EXTRA_RDEPENDS in a conf file. Note, you must rebuild task-base after changing these variables (bitbake task-base -crebuild) as bitbake has no way of knowing task-base has changed. See [3] for a more detailed explanation.

12. What order are conf files parsed for variable assignment?

See oe/conf/bitbake.conf. There should be a section that looks something like:

include conf/site.conf
include conf/auto.conf
include conf/local.conf
include conf/build/${BUILD_SYS}.conf
include conf/target/${TARGET_SYS}.conf
include conf/machine/${MACHINE}.conf
include conf/distro/${DISTRO}.conf
include conf/documentation.conf
require conf/sanity.conf

A straight "=" assignment in a machine or distro conf file will overwrite a local.conf setting. Therefore, machine and distro conf files should use the "+=" assignment if it is useful for local.conf to be able to append to a variable.

Build Errors

1. chown error during do_install process

As the OE build process runs a normal using, any install process that changes file ownership or groups must be run using fakeroot. This typically involves the following change in the recipe bb file:

fakeroot do_install () {
	oe_runmake "DSTROOT=${D}" install
}

2. Error: autoreconf2.50: unrecognized option --exclude=libtoolize

For some reason the base system's autoreconf is being used instead of the OE version (from autoconf-native)

For me personally this was a problem with my BBPATH having the paths to two branches in it org.openembedded.oz354x and org.openembedded.dev. Removing the one i wasn't trying to build, remove the tmp dir and start bitbake over fixed it.

3. Error: Building libtool-native dies with "configure: error: source directory already configured; run "make distclean" there first"

Your build dir path has one or more symlinks in it. Don't do that!

4. Error: run.do_patchcleancmd.4326: line 442: syntax error near unexpected token `'INHIBIT_PACKAGE_STRIP','`

known bug -- see: http://bugs.openembedded.org/Ticket/Display.html?id=257 There are several workarounds:

    • inherit package in the offending bb files
    • set INHERIT += "package_ipk debian" in your distro or local.conf file

5. I updated OE.db and now my builds are failing during the glibc compile, complaining about bad symbol definitions. What's wrong?

As of this writing, the version of glibc in the .dev branch of OE calls for a version of binutils it really shouldn't use. A patch has been applied to some DISTRO .confs which forces the "correct" version of binutils (<2.17) for the moment. But if the DISTRO .conf file you're building with isn't patched, a workaround is to add the following line to your local.conf file:

PREFERRED_VERSION_binutils-cross = "2.16"

then reset the glibc build with

bitbake glibc -c clean

and start from where you left off.

6. My build dies during the qemu-native section. What gives?

If the error is:

| ERROR: QEMU requires SDL or Cocoa for graphical output
| To build QEMU without graphical output configure with --disable-gfx-check 
| Note that this will disable all output from the virtual graphics card.
| FATAL: oe_runconf failed

Then install SDL headers (apt-get install libsdl1.2-dev under Ubuntu/Debian).

Else another workaround: Install qemu from the distribution for your development computer, and include

ASSUME_PROVIDED +="qemu-native"

in your local.conf file.

7. Bitbake tells me to "Please set TARGET_OS directly, or choose a MACHINE or DISTRO that does so.", but my local.conf file already does.

Be sure you are not running bitbake as root. Doing so breaks Bitbake's use of chroot.

8. qemu crashes during generation of binary locales

Set ENABLE_BINARY_LOCALE_GENERATION = "0" in your local.conf. This is probably a x86_64 issue.

9. sanity checker complains "/proc/sys/vm/mmap_min_addr is not 0" on Ubuntu

Ubuntu Hardy Heron has this value set to 65536 by default. see /etc/sysctl.conf content below

 # protect bottom 64k of memory from mmap to prevent NULL-dereference
 # attacks against potential future kernel security vulnerabilities.
 # (Added in kernel 2.6.23.)
 vm.mmap_min_addr = 65536

Since Wine suffers from the same feature, a temporary and permenant fix is already known. See this link (duh!) : http://wiki.winehq.org/PreloaderPageZeroProblem

Q: Why is this necessary? I'm using debian, and mmap_min_addr is 4096, but I run qemu all the time, and it seems to work fine.

Debugging OE Builds

OE is not perfect. Due to the size, complexity, rapid pace of development, and lack of maintainers, you will often be presented with an opportunity to debug OE builds :). Fortunately, OE is easy to debug once you know a few tricks:

1. Debugging tips

  • learn to use interactive bitbake (`bitbake -i`)
  • The BitBake `--verbose` option will print package dependencies. This is very useful when trying to determine why a package is being built.
  • The BitBake `-D` option will increase debugging level. Note `-D -D` is also a valid option and can be used to determine what conf files are being used -- look for lines begining with conf.

2. How do I re-build a failing package?

There are several options:

  • `bitbake -b <path to bb file>`
  • `bitbake <package name>`
  • start bitbake interactive mode (`bitbake -i`) and then run `build <package name>`

3. How do I clean a package?

There are several options:

  • `bitbake -b <path to bb file> -c clean`
  • `bitbake <package name> -c clean`
  • start bitbake interactive mode (`bitbake -i`) and then run `clean <package name>`

You may also put several package names after the command e.g.

  • `bitbake -c clean pack1 pack2 ...`

Sometimes you want to clean a particular package version from your build/tmp/work directory. In this case use

  • for example `bitbake -c clean gcc-cross-initial-4.1.1`

Note: You have to use the package directory name here from your work directory without the trailing `-rx`. That means there is not an underscore before the package version but a simple dash. The above is quite useful if you want to clean up a work directory from unwanted versions of the same package.

The ipk file in the directory deploy/ipk is not deleted when you perform a clean on a certain package. So make sure you manually rebuild the cleaned package in order to get an updated ipk or delete the ipk prior to a build.

4. What tasks are available for a package/recipe?

Building an OE package consists of a number of tasks. These tasks can be listed with the OE listtasks task. Each task can be run individually.

Example:

bitbake -b <path to bb file> -c listtasks
NOTE: package matchbox-0.9.1: started
NOTE: package matchbox-0.9.1-r0: task do_listtasks: started
do_listtasks
do_compile
do_stage
do_build
do_mrproper
do_fetch
do_configure
do_clean
do_emit_manifest
do_populate_staging
do_package
do_unpack
do_install
do_showdata
do_patch
NOTE: package matchbox-0.9.1-r0: task do_listtasks: completed
NOTE: package matchbox-0.9.1: completed
Build statistics:
  Attempted builds: 1

5. How do I view the value of OE variables for a package?

  • Use the BitBake command.
    • `bitbake -e -b ../openembedded/recipes/meta/bootstrap-image.bb`
    • `bitbake -e <package name>`
  • Use the OpenEmbedded showdata command. Ex: `bitbake -b ../openembedded/recipes/meta/bootstrap-image.bb -c showdata`

6. How do I unpack ipk files?

ipk package files can be unpackaged with the `ar` command. Ex: `ar x <path to ipk file>` You can also inspect the files inside an ipk and get other information with the dpkg command if your distribution has it.