[OE-core] a few questions on the proper use of TEMPLATECONF

Robert P. J. Day rpjday at crashcourse.ca
Mon Aug 4 10:54:15 UTC 2014


  first time perusing all that templateconf stuff, so some admittedly
simple questions.

  i'm looking at oe-setup-builddir, which is where the initialization
of the new build dir is done, so let's start at the top:

  if [ -z "$BUILDDIR" ]; then
    echo >&2 "Error: The build directory (BUILDDIR) must be set!"
    exit 1
  fi

  mkdir -p $BUILDDIR/conf

  if [ ! -d "$BUILDDIR" ]; then
    echo >&2 "Error: The builddir ($BUILDDIR) does not exist!"
    exit 1
  fi

  if [ ! -w "$BUILDDIR" ]; then
    echo >&2 "Error: Cannot write to $BUILDDIR, perhaps try sourcing with a writable path? i.e. . oe-init-build-env ~/my-build"
    exit 1
  fi

  cd "$BUILDDIR"

so, at that point, i have either a new project, or i've simply reset
my working environment into an existing project. so far, so good. the
next few lines are just a bit puzzling:

  if [ -f "$BUILDDIR/conf/templateconf.cfg" ]; then
    TEMPLATECONF=$(cat $BUILDDIR/conf/templateconf.cfg)
  fi

  . $OEROOT/.templateconf

could that not have been written with an "else" clause?

  if [ -f "$BUILDDIR/conf/templateconf.cfg" ]; then
    TEMPLATECONF=$(cat $BUILDDIR/conf/templateconf.cfg)
  else
    . $OEROOT/.templateconf
  fi

after all, if you have an existing templateconf.cfg and use that to
set TEMPLATECONF, what is the point of subsequently sourcing the
OEROOT .templateconf file, which will simply realize it's been set and
do nothing? (yes, i realize it doesn't hurt, but i firmly believe in
not invoking code that clearly has no value -- it's just confusing for
people who want to RTFS. :-)

  next, i assume that while it's natural to put overriding conf files
in a layer/conf file, they can be placed anywhere, correct?

  also, there appear to be a few typos in that script. here:

echo >&2 "Error: '$TEMPLATECONF' must be a directory containing local.conf & bblayers.conf"

  i assume those names should be local.conf.sample and
bblayers.conf.sample, yes? and a couple other minor typos in comments.

  thoughts?

rday

p.s. oh, one more observation. at the end of oe-setup-builddir:

  if [ -z "$OECORENOTESCONF" ]; then
    OECORENOTESCONF="$OEROOT/meta/conf/conf-notes.txt"
  fi

given that poky uses "meta-yocto/conf" as the default basis for the
sample files, why is this code explicitly using "meta/conf"? i notice
that there are two files with that name under the poky checkout:

[poky]$ find . -name conf-notes.txt
./meta-yocto/conf/conf-notes.txt
./meta/conf/conf-notes.txt
$

  do you really want to mixing those references? yes, the files appear
to be identical, but it's still potentially confusing.

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================




More information about the Openembedded-core mailing list