diff --git a/install.sh b/install.sh index 36d565e5..b7a5ea59 100755 --- a/install.sh +++ b/install.sh @@ -33,6 +33,8 @@ fi #check if /etc/rpi-issue exists, if not set the install Args to be false if [ -f /etc/rpi-issue ] then + rpiModel=$(cat /sys/firmware/devicetree/base/model | awk '{print $3}') + echo "Detected Raspberry Pi Model $rpiModel" installArgs="-DRPI_BUILD=true" isRpi=true else @@ -313,7 +315,12 @@ else fi #beginning make - make -j2 + if [[ $rpiModel -lt 4 ]]; then + #limit jobs on RPi 3 and below to prevent OOM freeze + make -j1 + else + make -j4 + fi if [[ $? -eq 0 ]]; then echo -e Aasdk Make completed successfully '\n'