diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 139: move the selection of which character the boot loader uses on a board into the device config

Message ID 20111020041213.20107.79038.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Michael-Doyle Hudson Oct. 20, 2011, 4:12 a.m. UTC
Merge authors:
  Michael Hudson-Doyle (mwhudson)
Related merge proposals:
  https://code.launchpad.net/~mwhudson/lava-dispatcher/uboot-prompt-config/+merge/79904
  proposed by: Michael Hudson-Doyle (mwhudson)
  review: Approve - Paul Larson (pwlars)
------------------------------------------------------------
revno: 139 [merge]
committer: Michael Hudson-Doyle <michael.hudson@linaro.org>
branch nick: trunk
timestamp: Thu 2011-10-20 17:10:50 +1300
message:
  move the selection of which character the boot loader uses on a board into the device config
modified:
  lava_dispatcher/android_client.py
  lava_dispatcher/client.py
  lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf
  lava_dispatcher/default-config/lava-dispatcher/device-types/mx51evk.conf
  lava_dispatcher/default-config/lava-dispatcher/device-types/mx53loco.conf
  lava_dispatcher/default-config/lava-dispatcher/device-types/snowball.conf


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_dispatcher/android_client.py'
--- lava_dispatcher/android_client.py	2011-10-18 02:38:34 +0000
+++ lava_dispatcher/android_client.py	2011-10-20 04:09:15 +0000
@@ -17,15 +17,18 @@ 
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, see <http://www.gnu.org/licenses>.
 
+import logging
+import os
 import pexpect
+import re
 import sys
-import os
 import time
+
+from tempfile import mkdtemp
+
 from lava_dispatcher.client import LavaClient, OperationFailed, NetworkError, GeneralError
-import logging
+from lava_dispatcher.utils import string_to_list
 
-from utils import string_to_list
-from tempfile import mkdtemp
 
 class LavaAndroidClient(LavaClient):
     def __init__(self, context, config):
@@ -64,10 +67,11 @@ 
             logging.exception('enter_uboot failed')
             self.hard_reboot()
             self.enter_uboot()
+        bootloader_prompt = re.escape(self.device_option('bootloader_prompt'))
         boot_cmds = string_to_list(self.config.get('boot_cmds_android'))
         self.proc.sendline(boot_cmds[0])
         for line in range(1, len(boot_cmds)):
-            self.proc.expect("#")
+            self.proc.expect(bootloader_prompt)
             self.proc.sendline(boot_cmds[line])
         self.in_test_shell()
         self.proc.sendline("export PS1=\"root@linaro: \"")

=== modified file 'lava_dispatcher/client.py'
--- lava_dispatcher/client.py	2011-10-18 02:38:34 +0000
+++ lava_dispatcher/client.py	2011-10-20 04:09:15 +0000
@@ -19,6 +19,7 @@ 
 # with this program; if not, see <http://www.gnu.org/licenses>.
 
 import pexpect
+import re
 import sys
 import time
 from cStringIO import StringIO
@@ -117,13 +118,9 @@ 
             self.enter_uboot()
         boot_cmds = self.boot_cmds
         self.proc.sendline(boot_cmds[0])
+        bootloader_prompt = re.escape(self.device_option('bootloader_prompt'))
         for line in range(1, len(boot_cmds)):
-            if self.device_type in ["mx51evk", "mx53loco"]:
-                self.proc.expect(">", timeout=300)
-            elif self.device_type == "snowball_sd":
-                self.proc.expect("\$", timeout=300)
-            else:
-                self.proc.expect("#", timeout=300)
+            self.proc.expect(bootloader_prompt, timeout=300)
             self.proc.sendline(boot_cmds[line])
         self.in_test_shell()
         # set PS1 to include return value of last command

=== modified file 'lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf'
--- lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf	2011-09-09 04:34:34 +0000
+++ lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf	2011-10-20 04:09:15 +0000
@@ -48,3 +48,6 @@ 
 
 # Test image recognization string
 TESTER_STR = root@linaro:
+
+# The character the boot loader uses as a prompt on this board.
+bootloader_prompt = #

=== modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/mx51evk.conf'
--- lava_dispatcher/default-config/lava-dispatcher/device-types/mx51evk.conf	2011-09-07 03:46:15 +0000
+++ lava_dispatcher/default-config/lava-dispatcher/device-types/mx51evk.conf	2011-10-20 04:09:15 +0000
@@ -8,3 +8,4 @@ 
     setenv bootargs "' console=tty0 console=ttymxc0,115200n8 
     root=LABEL=testrootfs rootwait ro'",
     boot
+bootloader_prompt = >

=== modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/mx53loco.conf'
--- lava_dispatcher/default-config/lava-dispatcher/device-types/mx53loco.conf	2011-09-07 03:46:15 +0000
+++ lava_dispatcher/default-config/lava-dispatcher/device-types/mx53loco.conf	2011-10-20 04:09:15 +0000
@@ -7,3 +7,4 @@ 
     setenv bootargs "' console=tty0 console=ttymxc0,115200n8 
     root=LABEL=testrootfs rootwait ro'",
     boot
+bootloader_prompt = >

=== modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/snowball.conf'
--- lava_dispatcher/default-config/lava-dispatcher/device-types/snowball.conf	2011-09-07 03:46:15 +0000
+++ lava_dispatcher/default-config/lava-dispatcher/device-types/snowball.conf	2011-10-20 04:09:15 +0000
@@ -9,4 +9,5 @@ 
     hwmem=48M@302M mem=152M@360M'",
     boot
 
-#boot_cmds_android = TBD
\ No newline at end of file
+#boot_cmds_android = TBD
+bootloader_prompt = $