op-build-env: warn when user forgets buildroot submodule
If you don't have the buildroot submodule present, the build fails in a
confusing way:
op-build witherspoon_defconfig
make: Entering directory '/home/benh/op-build/buildroot'
make: *** No rule to make target 'witherspoon_defconfig'. Stop.
make: Leaving directory '/home/benh/op-build/buildroot
This change gives the user a better chance:
$ . op-build-env
Please make sure you've checked out the buildroot submodule
git submodule init && git submodule update
Signed-off-by: Joel Stanley <joel@jms.id.au>
diff --git a/op-build-env b/op-build-env
index 9cd5cb5..e6ca40e 100755
--- a/op-build-env
+++ b/op-build-env
@@ -5,6 +5,12 @@
source ./customrc
fi
+if [ ! -e buildroot/Makefile ]; then
+ echo "Please make sure you've checked out the buildroot submodule"
+ echo " git submodule init && git submodule update"
+ return -1
+fi
+
export BR2_EXTERNAL=${__PWD}/openpower
export BR2_DL_DIR=${__PWD}/dl