Tuesday, October 4, 2011

The importance of base_prefix

Recently I started into converting our -native recipes from oe-classic into oe-core. First try I got a strange error from tar about the path not existing. The path it wanted looked crazy, something like /home/user/Angstrom/build/tmp-angstrom_2010_x-uclibc/work/armv7a-vfp-angstrom-linux-uclibceabi/mypackage-1.0-r0/image///home/user/Angstrom/build/tmp-angstrom_2010_x-uclibc/sysroots/mymachine. Debugging the scripts lead me into a maddening maze. The problem seemed to be emanating from the sstate creation tasks.

It turns out that we were not respecting the ${base_prefix} variable when doing our install. The recipe we were using installs into a non-standard location, so we were installing into something like ${D}/opt/custom-place/ but native recipes actually set the base_prefix to a really strange value like /home/user/Angstrom/build/tmp-angstrom_2010_x-uclibc/sysroots/mymachine. For reference, in normal embedded builds, ${base_prefix} is an empty string.

The fix was simple. Install instead to ${D}${base_prefix}/opt/custom-place/ which installs to the same place it always had during embedded builds, and the long path that tar was looking for during -native builds of the recipe.

Happy building!

No comments:

Post a Comment