[meta-intel] [meta-intel-galileo] [PATCH 2/3] launcher.sh: start clloader only on galileo

rebecca.swee.fun.chang at intel.com rebecca.swee.fun.chang at intel.com
Thu Apr 30 04:32:10 PDT 2015


From: Josef Ahmad <josef.ahmad at intel.com>

Add the dmidecode logic that comes from galileod.sh to launcher.sh.
At the moment this is pure duplication.

Signed-off-by: Josef Ahmad <josef.ahmad at intel.com>
Reviewed-by: Ong Boon Leong <boon.leong.ong at intel.com>
Tested-by: Ong Boon Leong <boon.leong.ong at intel.com>
Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang at intel.com>
---
 recipes-galileo/galileo-target/files/launcher.sh | 32 ++++++++++++++++++------
 1 file changed, 25 insertions(+), 7 deletions(-)

diff --git a/recipes-galileo/galileo-target/files/launcher.sh b/recipes-galileo/galileo-target/files/launcher.sh
index 50fa378..a166345 100755
--- a/recipes-galileo/galileo-target/files/launcher.sh
+++ b/recipes-galileo/galileo-target/files/launcher.sh
@@ -11,11 +11,29 @@ mytrap()
 
 trap 'mytrap' USR1
 
-keepgoing=true
-while $keepgoing
-do
-  $CLLOADER $CLLOADER_OPTS < /dev/ttyGS0 > /dev/ttyGS0 & clPID=$!
-  wait $clPID
-  usleep 200000
-done
+arduino_services()
+{
+  keepgoing=true
+  while $keepgoing
+  do
+      $CLLOADER $CLLOADER_OPTS < /dev/ttyGS0 > /dev/ttyGS0 & clPID=$!
+      wait $clPID
+      usleep 200000
+  done
+}
+
+galileo_board=false
+type dmidecode > /dev/null 2>&1 || die "dmidecode not installed"
+board=$(dmidecode -s baseboard-product-name)
+case "$board" in
+    *"Galileo" )
+               galileo_board=true
+               ;;
+    *"GalileoGen2" )
+               galileo_board=true
+               ;;
+esac
 
+if [ $galileo_board == "true" ]; then
+    arduino_services
+fi
-- 
1.9.1



More information about the meta-intel mailing list