From 937ee26f3725f9459944470d6fb7db23d6d42440 Mon Sep 17 00:00:00 2001 From: Wadim Egorov Date: Fri, 16 Oct 2020 13:17:49 +0200 Subject: scripts: init: Add container usage message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Provide information for container based builds and work environments. Additional container information is only printed if 'build_container' attribute is set in the manifest file. Signed-off-by: Wadim Egorov Signed-off-by: Stefan Müller-Klieser --- scripts/init | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/init b/scripts/init index 29c23ba..3bde6f2 100755 --- a/scripts/init +++ b/scripts/init @@ -69,6 +69,20 @@ ${PHYTEC_DIR}/scripts/init_bblayers.py ${PHYTEC_DIR}/scripts/copy_site_conf.py ${PHYTEC_DIR}/scripts/init_machine.py +container_usage() { + CONTAINER=$(sed -n 's:.*build_container="\([^"]*\).*:\1:p' ${ROOTDIR}/.repo/manifest.xml) + if [ ! -z "${CONTAINER}" ]; then + echo "A docker image can also be used as your build environment.\n" + echo "Set up your shell environment with:\n" + echo " $ docker run --rm -it -v \${PWD}:/\${PWD} ${CONTAINER} --workdir=\${PWD} bash\n" + echo "Or start a build with:\n" + echo " $ docker run --rm -it -v \${PWD}:/\${PWD} ${CONTAINER} --workdir=\${PWD} \\" + echo " bash -c '. sources/poky/oe-init-build-env && bitbake phytec-headless-image'" + echo "" + echo "" + fi +} + echo "" echo "Before you start your work, please check your build/conf/local.conf for" echo "host specific configuration. Check the documentation especially for:" @@ -82,3 +96,4 @@ echo "" echo " $ . sources/poky/oe-init-build-env" echo "" echo "" +container_usage -- cgit v1.2.3