summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hemp <christian.hemp@posteo.de>2018-07-03 10:12:52 +0200
committerStefan Müller-Klieser <s.mueller-klieser@phytec.de>2018-09-05 15:54:51 +0200
commitbecde4f87972060fdde598fe47ed09aa9b387013 (patch)
tree407279e36f8ef854fffcb1a656821ac10f2e1191
parentf72b68855e4c27b38a3051a247a9cb32e8d25cf2 (diff)
downloadmeta-phytec-becde4f87972060fdde598fe47ed09aa9b387013.tar.bz2
meta-phytec-becde4f87972060fdde598fe47ed09aa9b387013.zip
scripts: update fsl-setup and init-imx script
Possibility to copy site.conf added. Signed-off-by: Christian Hemp <christian.hemp@posteo.de> Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
-rw-r--r--scripts/fsl-setup-release.sh34
-rwxr-xr-xscripts/init-imx84
2 files changed, 35 insertions, 3 deletions
diff --git a/scripts/fsl-setup-release.sh b/scripts/fsl-setup-release.sh
index 73d6c34..39ef059 100644
--- a/scripts/fsl-setup-release.sh
+++ b/scripts/fsl-setup-release.sh
@@ -128,7 +128,7 @@ if test $fsl_setup_error || test $fsl_setup_help; then
usage && clean_up && return 1
fi
-if [ -z "$BUILD_DIR" ]; then
+if [ -z "$BUILD_DIR" -o "$BUILD_DIR" == "." ]; then
BUILD_DIR='build'
fi
@@ -210,6 +210,38 @@ if [ -d ../sources/meta-freescale ]; then
sed -e "s,\$.BSPDIR./sources/meta-fsl-arm-extra\s,,g" -i conf/bblayers.conf
fi
+# Try to find ROOTDIR from arg0 of shell process.
+DIR="`dirname $(readlink -f .)`"
+
+# Try to find ROOTDIR of the Yocto BSP. Walk up the directory tree until we
+# find the sources/meta-phytec or .repo directory. Returns the empty string as
+# an error code.
+find_root_dir() {
+ dir=$(readlink -f "$1") # should return an absoulte path
+ while [ ! "$dir" = "/" ]; do
+ if [ -d "$dir/.repo" ]; then
+ # or [ -d "$dir/sources/meta-phytec" ];
+ echo $dir;
+ return;
+ fi
+ dir=$(dirname "$dir")
+ done
+ # If anchor directory isn't found, function returns the empty strings
+ # as an error code.
+}
+
+ROOTDIR=$(find_root_dir "$DIR")
+if [ "$ROOTDIR" = "" ]; then
+ echo >&2 "ERROR: Cannot find root directory of the Yocto BSP."
+ echo >&2 "Is '$DIR' in a checkout of a BSP? Aborting..."
+ exit 1;
+fi
+
+# Folders and Readme
+PHYTEC_DIR="${ROOTDIR}/sources/meta-phytec"
+
+${PHYTEC_DIR}/scripts/copy_site_conf.py
+
cd $BUILD_DIR
clean_up
unset FSLDISTRO
diff --git a/scripts/init-imx8 b/scripts/init-imx8
index 3050c60..dcfbb78 100755
--- a/scripts/init-imx8
+++ b/scripts/init-imx8
@@ -10,8 +10,8 @@ echo " - DL_DIR"
echo " - SSTATE_DIR"
echo ""
echo "To create a new Yocto build directory:"
-echo "MACHINE=phycore-imx8-1 DISTRO=fsl-imx-fb source fsl-setup-release.sh -b imx8-fb"
+echo "MACHINE=phycore-imx8-1 DISTRO=fsl-imx-wayland source fsl-setup-release.sh"
echo ""
echo "To use an existing Yocto build directory:"
-echo "source setup-environment imx8-fb"
+echo "source setup-environment build"