add check for submodules in release builds
diff --git a/release/build_release2.sh b/release/build_release2.sh
index ee3c3f4656c94c..c607aa820636bc 100755
--- a/release/build_release2.sh
+++ b/release/build_release2.sh
@@ -55,6 +55,14 @@ scons -j3
 python selfdrive/manager/test/test_manager.py
 selfdrive/car/tests/test_car_interfaces.py
 
+# Ensure no submodules in release
+if test "$(git submodule--helper list | wc -l)" -gt "0"; then
+  echo "submodules found:"
+  git submodule--helper list
+  exit 1
+fi
+git submodule status
+
 # Cleanup
 find . -name '*.a' -delete
 find . -name '*.o' -delete
