Skip to content

Instantly share code, notes, and snippets.

@mickey-happygolucky
Last active January 20, 2022 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mickey-happygolucky/2b9671f062de558f3312f7378ed3c240 to your computer and use it in GitHub Desktop.
Save mickey-happygolucky/2b9671f062de558f3312f7378ed3c240 to your computer and use it in GitHub Desktop.
The helper script to run the bitbake with using CROPS.
#!/bin/sh
BUILD_DIR=build
usage_exit() {
echo "run_crops.sh [-b build] [commands]"
echo " -b: a build directory of poky"
exit 0
}
while getopts b:h OPT
do
case ${OPT} in
b) BUILD_DIR=${OPTARG}
;;
h) usage_exit
;;
\?) usage_exit
;;
esac
done
shift $((OPTIND - 1))
echo "BUILD_DIR =" "${BUILD_DIR}"
cmd="source $(pwd)/poky/oe-init-build-env ${BUILD_DIR}"
if [ $# -gt 0 ] ; then
cmd="${cmd} && $*"
fi
docker run --rm -it -v "$(pwd)":"$(pwd)" crops/poky --workdir="$(pwd)" bash -c "${cmd}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment