Hello everyone,

I submit a simple patch to fix an issue when the "flashall.bat" script is run inside a non-interactive shell (like for example if I spawn the bash script from another program).

Indeed, the timeout command on Windows can only be used inside an interactive shell. As a result, the flashall.bat batch script would fail without flashing the edison from a non-interactive cmd.

The fix is very simple: replace timeout by waitfor. waitfor works even in non-interactive shell and has the same behaviour as timeout in the current use case.

You can see the patch applied on my github: https://github.com/malikolivier/meta-intel-edison

Thanks for your time.

Best,


Malik
From 611bd81956732d09455f25264679f8020f0a81c1 Mon Sep 17 00:00:00 2001
From: Malik Olivier Boussejra <[email protected]>
Date: Mon, 31 Oct 2016 17:41:42 +0900
Subject: [PATCH] utils: Fix wait in windows non-interactive shell

When launching a background batch script, the timeout command cannot be
used. As specified here:
http://www.ca.com/us/services-support/ca-support/ca-support-online/knowledge-base-articles.tec1473545.html

As a workaround, we decided to use the waitfor command.

Signed-off-by: Malik Olivier Boussejra <[email protected]>
---
 utils/flash/flashall.bat | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/utils/flash/flashall.bat b/utils/flash/flashall.bat
index 6fe871b..124b061 100644
--- a/utils/flash/flashall.bat
+++ b/utils/flash/flashall.bat
@@ -210,7 +210,8 @@ exit /b 0
 			exit /b 0
 		) else (
 			set /a currtime-= 1
-			timeout /t 1 /nobreak > nul
+			:: wait 1 second before proceeding to next command
+			waitfor foo /t 1 2> nul
 			if %currtime% gtr 0 goto:start_wait
 		)
 	) else (
-- 
2.7.4

-- 
_______________________________________________
meta-intel mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-intel

Reply via email to