[yocto] Query configuration
Paul Eggleton
paul.eggleton at linux.intel.com
Thu Nov 19 09:22:04 PST 2015
Hi Gary,
On Thursday 19 November 2015 10:01:36 Gary Thomas wrote:
> On 2015-11-19 09:42, Gary Thomas wrote:
> > I have a recipe that needs to make sure a global setting is
> > in place (used by a different recipe). How can I test for
> > this variable/setting in my recipe and issue a warning/error
> > if it is not?
> >
> > Thanks for any ideas
>
> Never mind - it occurred to me to see if some other recipe had
> such checks and I found some and was able to add this to my recipe:
>
> # Make sure SPI will is enabled
> python do_check_variables() {
> ENABLE_SPI_BUS = d.getVar('ENABLE_SPI_BUS', True)
> if ENABLE_SPI_BUS != '1':
> bb.fatal("PiFace module can't work without SPI support - Add
> ENABLE_SPI_BUS='1' to local.conf") }
> addtask check_variables before do_fetch
>
> Not sure if this is the best way but it suffices.
Another thing you could do would be to do a similar thing except use anonymous
python and raise SkipRecipe instead of bb.fatal().
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
More information about the yocto
mailing list