In Yocto with KAS how to use $(BSPDIR}

265 views Asked by At

I'm using KAS for build Yocto. In some recipes the sources are configured to fetch from ${BSPDIR } like

KERNEL_SRC = "git://${BSPDIR}/local_repos/linux-5.4.142;protocol=file"

Without KAS if I source poky/oe-init-build-env build

Yocto creates bblayers.conf with {SBSPDIR} like below

BBPATH = "${TOPDIR}"
BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}"

Wheras in KAS only $TOPDIR is created in bblayers.conf

${TOPDIR}/../work/poky/meta \
${TOPDIR}/../work/poky/meta-poky"
BBPATH ?= "${TOPDIR}"
BBFILES ??= ""

Due to this build is failing need to change the recipe manually replacing BSPDIR with TOPDIR like below

-KERNEL_SRC = "git://${BSPDIR}/local_repos/linux-5.4.142;protocol=file"
+KERNEL_SRC = "git://${TOPDIR}/../local_repos/linux-5.4.142;protocol=file"

Is there a way in KAS to add ${BSPDIR} by default in bblayers.conf ?

1

There are 1 answers

1
skandigraun On

You can use the bblayers_conf_header in your kas yaml to add extra items to bblayers.conf (or convert to json, if you are using json config):

bblayers_conf_header:
  my-extra-conf: |
    BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}"
    ANOTHER_VARIABLE = "ANOTHER_VALUE"