Search code examples
bashdockeryoctobitbake

How to write text with double quotes into Yocto local.conf


I'm trying to run bitbake build in Docker. But I also want to add some changes to conf/local.conf:

docker exec -u jenkins -i yocto /bin/bash -c """...
                                             echo 'DL_DIR = "/home/jenkins/dependencies"' >> /home/jenkins/build/conf/local.conf
                                             echo 'BB_GENERATE_MIRROR_TARBALLS = "1"' >> /home/jenkins/build/conf/local.conf &&
                                             bitbake image"""

Build fails with error:

ERROR: ParseError at /home/jenkins/build/conf/local.conf:7: unparsed line: 'DL_DIR = /home/jenkins/dependencies'

The passed folder path appears without double-quotes. The same if to execute cat /home/jenkins/build/conf/local.conf:

MACHINE = "qemux86-64"

require conf/variant/common/local.conf
require conf/machine/qemux86-64-extra.conf

VARIANT = "qemux86-64"
DL_DIR = /home/jenkins/dependencies
BB_GENERATE_MIRROR_TARBALLS = 1

I also tried like this

echo DL_DIR = "\"/home/jenkins/dependencies"\"

with the same result.


Solution

  • Finally, seem to work with this syntax

    echo 'DL_DIR = \"/home/jenkins/dependencies\"'