Bug 3158

Summary: xserver-xorg-config_0.1.bbappend bsp FILESPATH not set in a robust manner
Product: [Build System, Metadata & Runtime] BSPs Reporter: Blloyd <blloyd>
Component: bsps-meta-intelAssignee: Darren Hart <dvhart>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: bluelightning, tom.zanussi
Version: unspecified   
Target Milestone: 1.3   
Hardware: x86   
OS: Multiple   
Whiteboard: patch submitted to yocto/meta-intel mailing lists for review
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Blloyd 2012-09-24 02:37:18 UTC
This issue is known to affect the following items:

yocto-bsp
via the file
poky/scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/{{ if xserver == "y": }} xserver-xf86-config_0.1.bbappend

As well as all 
xserver_xf86-config_0.1.bbappend files from meta-intel

A 
cat */recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend
from the meta-intel directory shows all bbappend files followed this format.

The issue has been noted against both denzil and master branches.

The problem can be noted when you have more than one bsp configured to be searched, as the last one searched will be the one searched for files, even if the machine is from a previous bsp.
While kernel configuration effectively does not have an affect when machine is not selected, this bbappend does have an unexpected side effect.

FILESPATH =. "${@base_set_filespath(["${THISDIR}/${PN}"], d)}:"
uses delayed expansion.

Adding the line
FILESPATH := "${FILESPATH}"
immediately after the previous line seems to cause the immediate expansion of THISDIR needed to ensure THISDIR references the correct location, as that is commonly used in bbappend files to point the the directory that bbappend is in.

Alternately, a less likely to collide variable name should be selected.
Comment 1 Paul Eggleton 2012-09-24 08:39:54 UTC
Does FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" as I suggested on IRC not work?
Comment 2 Blloyd 2012-09-24 15:23:08 UTC
When I tried Paul Eggleton's suggestion, it did not appear to work for me.  It's possible I did something wrong, but when check FILESPATH and for which xorg.conf was included showed an intel video driver xorg.conf.
Comment 3 Tom Zanussi 2012-09-29 23:52:26 UTC
I was able to reproduce this and have sent patches that fixes the problem for me to both the poky list for yocto-bsp and the yocto list for the meta-intel problems. i.e. with multiple BSP layers for qemux86, arm and crownbay, the correct xorg.conf was picked up where before it wasn't.

The problem was that though the other .bbappends were fixed up to use the FILESEXTRAPATHS_prepend method, the xserver-xf86-config bbappends for some reason weren't.
Comment 4 Tom Zanussi 2012-10-02 16:37:18 UTC
Fixed in master:

poky/master: 50ac6e8785c167ea4aa4601fd690ef783151853d
meta-intel/master: 50ac6e8785c167ea4aa4601fd690ef783151853d