build_package.sh: track_expect: Set lava_timeout in run env, if any

track_expect is called from specific test config definitions like:

uart="0" timeout="60" file="timeout_test.exp" track_expect

Where "timeout" setting is for legacy CI expect scripts. This adds separate
setting lava_timeout= specifically for LAVA jobs.

(Original legacy timeout is fairly fine-grained, per-UART. LAVA is generally
less flexible, and this quick implementation effectively allows to control
just main UART's interactive test timeout. So, it's up to test configs to
use this setting where appropriate, there's no special validation).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: I2ab55580f3d8947dc97e0e2ed08ec84151149f00
diff --git a/script/build_package.sh b/script/build_package.sh
index 88af3e8..dcbd9e5 100755
--- a/script/build_package.sh
+++ b/script/build_package.sh
@@ -256,8 +256,11 @@
 
 	echo "$file" > "$uart_dir/expect"
 	echo "$timeout" > "$uart_dir/timeout"
+	if [ -n "$lava_timeout" ]; then
+		set_run_env "lava_timeout" "$lava_timeout"
+	fi
 
-	echo "UART$uart to be tracked with $file; timeout ${timeout}s"
+	echo "UART$uart to be tracked with $file; timeout ${timeout}s; lava_timeout ${lava_timeout:-N/A}s"
 
 	if [ ! -z "${port}" ]; then
 		echo "${port}" > "$uart_dir/port"