Skip to contentSkip to conversation

source an environment file in bitbake recipe.

DISCUSSION Pandey, Kamal 2 participants 2 messages Sep 11, 2019 – Sep 12, 2019

lore
Share & tools
lore
#0 lore raw

Hi,
Is there any way by which I can use the source command inside a bitbake recipe for example if I need to source some environment file before compiling. source <filename> doesn't seem to work
Will the command . <filename> work

What exactly I need to inherit for source command to work Thanks
Kamal Pandey

#1 lore raw
Quoted 6 lines · Kamal

Hi,
Is there any way by which I can use the source command inside a bitbake recipe for example if I need to source some environment file before compiling. source <filename> doesn't seem to work
Will the command . <filename> work

What exactly I need to inherit for source command to work

I ran into something similar in a Makefile. There the problem was that the default sub shell used is /bin/sh and does not support the "source" command. Solution for the Makefile I used is like:

SHELL=/bin/bash

MY_VAR = $(shell source func_defs.sh && call_func 1 2)

So maybe do something like (untested):

bash -c 'source source func_defs.sh && call_func 1 2'

in the bitbake recipe. You obviously depend on bash-native for that recipe.

Hope this helps,

-- Bas.