From e7dae57a98e4ce3fa86a3dfdfe1f0c21a463d638 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Fri, 1 Aug 2014 12:06:37 +0300 Subject: ref-manual: Added two new FAQ entries. One has to do with the weird names the build system creates based on DESTDIR and other variables. The other has to do with -native recipes not buiding correctly. (From yocto-docs rev: 32a444a258e3c7c87fdc015475f54e5b34628246) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- documentation/ref-manual/faq.xml | 106 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) (limited to 'documentation') diff --git a/documentation/ref-manual/faq.xml b/documentation/ref-manual/faq.xml index bc147ce70a..72ff0d6fda 100644 --- a/documentation/ref-manual/faq.xml +++ b/documentation/ref-manual/faq.xml @@ -682,6 +682,112 @@ + + + + Why do ${bindir} and ${libdir} have strange values for -native recipes? + + + + + Executables and libraries might need to be used from a + directory other than the directory into which they were + initially installed. + Complicating this situation is the fact that sometimes these + executables and libraries are compiled with the expectation + of being run from that initial installation target directory. + If this is the case, moving them causes problems. + + + + This scenario is a fundamental problem for package maintainers + of mainstream Linux distributions as well as for the + OpenEmbedded build system. + As such, a well-established solution exists. + Makefiles, Autotools configuration scripts, and other build + systems are expected to respect environment variables such as + bindir, libdir, + and sysconfdir that indicate where + executables, libraries, and data reside when a program is + actually run. + And, they are also expected to respect a + DESTDIR environment variable, which is + prepended to all the other variables when the build system + actually installs the files. + It is understood that the program does not actually run from + within DESTDIR. + + + + When the OpenEmbedded build system uses a recipe to build a + target-architecture program (i.e. one that is intended for + inclusion on the image being built), that program eventually + runs from the root file system of that image. + Thus, the build system provides a value of "/usr/bin" for + bindir, a value of "/usr/lib" for + libdir, and so forth. + + + + Meanwhile, DESTDIR is a path within the + Build Directory. + However, when the recipe builds a native program (i.e. one + that is intended to run on the build machine), that program + is never installed directly to the build machine's root + file system. + Consequently, the build system uses paths within the Build + Directory for DESTDIR, + bindir and related variables. + To better understand this, consider the following two paths + where the first is relatively normal and the second is not: + + Due to these lengthy examples, the paths are artificially + broke across lines for readability. + + + /home/maxtothemax/poky-bootchart2/build/tmp/work/i586-poky-linux/zlib/ + 1.2.8-r0/sysroot-destdir/usr/bin + + /home/maxtothemax/poky-bootchart2/build/tmp/work/x86_64-linux/ + zlib-native/1.2.8-r0/sysroot-destdir/home/maxtothemax/poky-bootchart2/ + build/tmp/sysroots/x86_64-linux/usr/bin + + The standard DESTDIR mechanism leaves no + other choice. + + + + + + + + The files provided by my -native recipe do + not appear to be available to other recipes. + Files are missing from the native sysroot, my recipe is + installing to the wrong place, or I am getting permissions + errors during the do_install task in my recipe! What is wrong? + + + + + This situation results when the OpenEmbedded build system does + not recognize the environment variables supplied to it by + BitBake. + The incident that prompted this FAQ entry involved a Makefile + that used an environment variable named + BINDIR instead of the more standard + variable bindir. + The makefile's hardcoded default value of "/usr/bin" worked + most of the time, but not for the recipe's + -native variant. + Consequently, permissions errors might be caused by a Makefile + that ignores DESTDIR or uses a different + name for that environment variable. + Check the OpenEmbedded build system to see if these kinds of + issues exist. + + + -- cgit v1.2.3-54-g00ecf