build-setup: reduce cpu usage by bitbake

It turns out the --cpus option to the docker command line does not make
it appear like there are less CPU's in the docker container, it simply
reduces the time slice docker gets on each CPU. Reducing the num_cpu
value actually can cause more issues because it makes each bitbake
operation take longer to run, thus prolonging how much memory each
operation is taking.

Move the num_cpu parameter to the bitbake conf file so it reduces the
number or bitbake operations and amount of cpu's each operation gets.

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: Ib242ed3bc88ac55b31bc8ff6c05d4eab8fe84d08
diff --git a/build-setup.sh b/build-setup.sh
index 4508c55..8f21910 100755
--- a/build-setup.sh
+++ b/build-setup.sh
@@ -356,8 +356,8 @@
 
 # Custom BitBake config settings
 cat >> conf/local.conf << EOF_CONF
-BB_NUMBER_THREADS = "$(nproc)"
-PARALLEL_MAKE = "-j$(nproc)"
+BB_NUMBER_THREADS = "$num_cpu"
+PARALLEL_MAKE = "-j$num_cpu"
 INHERIT += "rm_work"
 BB_GENERATE_MIRROR_TARBALLS = "1"
 DL_DIR="${ssc_dir}/bitbake_downloads"
@@ -425,7 +425,6 @@
     ${mount_obmc_dir} \
     ${mount_ssc_dir} \
     ${mount_workspace_dir} \
-    --cpus="$num_cpu" \
     "${img_name}" \
     "${WORKSPACE}/build.sh"