All of lore.kernel.org
 help / color / mirror / Atom feed
* a few questions on the proper use of TEMPLATECONF
@ 2014-08-04 10:54 Robert P. J. Day
  2014-08-04 11:19 ` Robert P. J. Day
  0 siblings, 1 reply; 2+ messages in thread
From: Robert P. J. Day @ 2014-08-04 10:54 UTC (permalink / raw)
  To: OE Core mailing list


  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
========================================================================



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: a few questions on the proper use of TEMPLATECONF
  2014-08-04 10:54 a few questions on the proper use of TEMPLATECONF Robert P. J. Day
@ 2014-08-04 11:19 ` Robert P. J. Day
  0 siblings, 0 replies; 2+ messages in thread
From: Robert P. J. Day @ 2014-08-04 11:19 UTC (permalink / raw)
  To: OE Core mailing list

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1532 bytes --]


  short followup to my earlier post ... it seems like
oe-setup-builddir doesn't do a whole lot of input validation. for fun,
i tried to define a new project using /tmp for TEMPLATECONF, knowing
there was nothing valid there to be used as sample files, and here's
what i got (in part):

cp: cannot stat ‘/tmp/local.conf.sample’: No such file or directory
You had no conf/bblayers.conf file. The configuration file has been
created for
you with some default values. To add additional metadata layers into
your
configuration please add entries to this file.

The Yocto Project has extensive documentation about OE including a
reference manual
which can be found at:
    http://yoctoproject.org/documentation

For more information about OpenEmbedded see their website:
    http://www.openembedded.org/

sed: can't read /tmp/bblayers.conf.sample: No such file or directory

  in the end, despite the obviously fatal errors, i got a new build
directory with no local.conf, and an empty bblayers.conf. that doesn't
really match what the error messages were telling me above.

rday

-- 

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

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-04 11:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-04 10:54 a few questions on the proper use of TEMPLATECONF Robert P. J. Day
2014-08-04 11:19 ` Robert P. J. Day

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.