[Fuego] First steps with fuego

Bird, Timothy Tim.Bird at sony.com
Mon May 15 22:37:23 UTC 2017


> -----Original Message-----
> From: Rafael Gago Castano on  Monday, May 15, 2017 6:57 AM
> 
> > Here's an example (I haven't tested):
> > You put this in your <board>.board file for the DUT.
> >
> > function my_custom_board_bringup {
> >   echo "do a bunch of interesting stuff here"
> > }
> > TARGET_SETUP_LINK="my_custom_board_bringup"
> 
> This doesn't work as-is.
> 
> /fuego-core/engine/scripts/functions.sh: line 264: BOARD_SETUP: command
> not found
> 
> If I try to write "echo" from the board file it doesn't echo nothing.  If I add an
> eval to the line 264 of functions.sh it still fails. Grepping the repository for
> TARGET_SETUP_LINK only gives a result (functions.sh:264).
> 
> I had no time to look at the "ftc" source but is it possible that ftc is filtering
> out the functions?
It is indeed.  Sorry for that.  I should have tested it here before sending it.
I was able to get it to work with a little more effort. 

Here is what is happening:
The board file, although it looks like a shell script, is actually not. It is being
processed by a progam call ovgen.py (overlay generator).  This reads the
board file, and fuego's "class" files and the test spec, and produces a 
file called prolog.sh.  This is stored in the log directory for the test run.
This is indeed a shell script file, and it is sourced into the running shell.
In this process, regular functions are stripped from the board file.
I'm not sure the reason for this, and plan to look into whether it is
necessary.

In any event, you *can* define something called an override function
in the board file, and that *will* appear in prolog.sh, and thus in the
running shell environment of the base script.  However, you currently
can only override an existing base class function.  So, to make a short
story long, here's what you can do:

Add a stub function to fuego-core/engine/overlays/base/base-board.fuegoclass,
like so:
function ov_board_setup() {
	return
}
By convention, functions in the base class start with "ov_"
which is short for "overlay".  I'm not sure that's required, but
it won't hurt for now.

Now, define an override function in your board file, like so:

override-func ov_board_setup() {
	echo "do your setup operations here"
}
TARGET_SETUP_LINK="ov_board_setup"

This would go in fuego/fuego-ro/boards/<your_board_name>.board

Please let me know if this works for you.  If not, can you please
post the console log for the test?  Make sure you define FUEGO_DEBUG=1
in the job configuration for the test.

Thanks.
 -- Tim



More information about the Fuego mailing list