diff --git a/config/functions b/config/functions index 6bec74fc11..c449af22c0 100644 --- a/config/functions +++ b/config/functions @@ -186,6 +186,20 @@ fix_module_depends() { rm new.modinfo* } +check_path() { +dashes="===========================" + if [ "${PWD##/usr}" != "${PWD}" ]; then + check_pathmessage="$check_pathmessage\n $dashes$dashes$dashes" + check_pathmessage="$check_pathmessage\n ERROR: You try to build inside /usr" + check_pathmessage="$check_pathmessage\n $dashes$dashes$dashes" + check_pathmessage="$check_pathmessage\n This is not supported with our buildsystem." + check_pathmessage="$check_pathmessage\n Please use another dir (for example your \$HOME) to build $DISTRONAME" + + echo -e $check_pathmessage + exit 1 + fi +} + check_config() { dashes="===========================" if [ ! -d $PROJECT_DIR/$PROJECT ]; then diff --git a/config/path b/config/path index 37d1eb4fe7..52c5fe8eb3 100644 --- a/config/path +++ b/config/path @@ -123,6 +123,7 @@ fi VERSION_SUFFIX=$TARGET_ARCH . config/functions +check_path check_config setup_toolchain target