=== modified file 'lava_dispatcher/android_client.py'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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 = $