Merge lp:~le-chi-thu/lava-dispatcher/snowball_android_fix into lp:lava-dispatcher

Proposed by Paul Larson
Status: Merged
Merged at revision: 188
Proposed branch: lp:~le-chi-thu/lava-dispatcher/snowball_android_fix
Merge into: lp:lava-dispatcher
Diff against target: 120 lines (+40/-5)
5 files modified
lava_dispatcher/client/base.py (+15/-1)
lava_dispatcher/client/lmc_utils.py (+4/-2)
lava_dispatcher/client/master.py (+5/-0)
lava_dispatcher/connection.py (+5/-1)
lava_dispatcher/default-config/lava-dispatcher/device-types/snowball.conf (+11/-1)
To merge this branch: bzr merge lp:~le-chi-thu/lava-dispatcher/snowball_android_fix
Reviewer Review Type Date Requested Status
Paul Larson (community) Approve
Review via email: mp+88427@code.launchpad.net

Description of the change

ChiThu and I discussed this in irc, I'm testing it right now locally

To post a comment you must log in.
Revision history for this message
Paul Larson (pwlars) wrote :

This is working well for me. One ***IMPORTANT**** think we need to make sure to do, is change the snowball01-0n.conf files to make their type snowball instead of snowball_sd whenever we update this on v.l.o.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava_dispatcher/client/base.py'
2--- lava_dispatcher/client/base.py 2012-01-03 18:25:33 +0000
3+++ lava_dispatcher/client/base.py 2012-01-12 21:33:28 +0000
4@@ -103,6 +103,7 @@
5 return rc
6
7
8+
9 class NetworkCommandRunner(CommandRunner):
10 """A CommandRunner with some networking utility methods."""
11
12@@ -229,7 +230,7 @@
13 def wait_home_screen(self):
14 cmd = 'getprop init.svc.bootanim'
15 for count in range(100):
16- self.run(cmd, response='stopped')
17+ self.run(cmd, response='stopped', timeout=5)
18 if self.match_id == 0:
19 return True
20 time.sleep(1)
21@@ -399,8 +400,21 @@
22 self.in_test_shell(timeout=900)
23 self.proc.sendline("export PS1=\"root@linaro: \"")
24
25+ if self.config.get("enable_network_after_boot_android"):
26+ time.sleep(1)
27+ self._enable_network()
28+
29 self._enable_adb_over_tcpip()
30
31+ def _enable_network(self):
32+ network_interface = self.default_network_interface
33+ session = TesterCommandRunner(self, wait_for_rc=False)
34+ session.run("netcfg", timeout=20)
35+ session.run("netcfg %s up"%self.default_network_interface, timeout=20)
36+ session.run("netcfg %s dhcp"%self.default_network_interface, timeout=300)
37+ session.run("ifconfig " + self.default_network_interface, timeout=20)
38+
39+
40 def _enable_adb_over_tcpip(self):
41 logging.info("Enable adb over TCPIP")
42 session = TesterCommandRunner(self, wait_for_rc=False)
43
44=== modified file 'lava_dispatcher/client/lmc_utils.py'
45--- lava_dispatcher/client/lmc_utils.py 2011-12-19 01:44:12 +0000
46+++ lava_dispatcher/client/lmc_utils.py 2012-01-12 21:33:28 +0000
47@@ -99,8 +99,10 @@
48
49 image_file = os.path.join(tarball_dir, "lava.img")
50 #XXX Hack for removing startupfiles from snowball hwpacks
51- if client.device_type == "snowball_sd":
52- cmd = "sudo linaro-hwpack-replace -r startupfiles-v3 -t %s -i" % hwpack_path
53+ logging.info("client.device_type = %s" %client.device_type)
54+ if client.device_type == "snowball":
55+ logging.info("Remove startupfiles from snowball")
56+ cmd = "sudo linaro-hwpack-replace -r startupfiles-v3 -t %s -i" % hwpack_path
57 rc, output = getstatusoutput(cmd)
58 if rc:
59 raise RuntimeError("linaro-hwpack-replace failed: %s" % output)
60
61=== modified file 'lava_dispatcher/client/master.py'
62--- lava_dispatcher/client/master.py 2012-01-04 21:16:34 +0000
63+++ lava_dispatcher/client/master.py 2012-01-12 21:33:28 +0000
64@@ -145,9 +145,14 @@
65 % data_part_org)
66 session.run('sed -i "s/mmcblk0p%s/mmcblk0p%s/g" init.rc'
67 % (sys_part_org, sys_part_lava))
68+ # for snowball the mcvblk1 is used instead of mmcblk0.
69+ session.run('sed -i "s/mmcblk1p%s/mmcblk1p%s/g" init.rc'
70+ % (sys_part_org, sys_part_lava))
71 session.run(
72 'sed -i "/export PATH/a \ \ \ \ export PS1 root@linaro: " init.rc')
73
74+ session.run("cat init.rc")
75+
76 session.run(
77 'cpio -i -t -F ramdisk.cpio | cpio -o -H newc | \
78 gzip > ramdisk_new.cpio.gz')
79
80=== modified file 'lava_dispatcher/connection.py'
81--- lava_dispatcher/connection.py 2011-12-11 17:12:43 +0000
82+++ lava_dispatcher/connection.py 2012-01-12 21:33:28 +0000
83@@ -82,7 +82,11 @@
84 self.sendline("")
85
86 def soft_reboot(self):
87- self.sendline("reboot")
88+ cmd = self.device_option("soft_boot_cmd")
89+ if cmd != "":
90+ self.sendline(cmd)
91+ else:
92+ self.sendline("reboot")
93 # set soft reboot timeout 120s, or do a hard reset
94 logging.info("Rebooting the system")
95 id = self.expect(
96
97=== modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/snowball.conf'
98--- lava_dispatcher/default-config/lava-dispatcher/device-types/snowball.conf 2011-12-15 18:31:53 +0000
99+++ lava_dispatcher/default-config/lava-dispatcher/device-types/snowball.conf 2012-01-12 21:33:28 +0000
100@@ -10,9 +10,19 @@
101 boot_cmds_android = mmc init,
102 mmc rescan 1,
103 setenv bootcmd "'fat load mmc 1:3 0x00100000 /uImage; fat load mmc 1:3 0x05000000 /uInitrd; bootm 0x00100000 0x05000000'",
104+ setenv bootargs "'console=ttyAMA2,115200n8 rootwait ro earlyprintk mem=128M@0 mali.mali_mem=32M@128M hwmem=168M@160M mem=48M@328M mem_issw=1M@383M mem=640M@384M vmalloc=256M init=/init androidboot.console=ttyAMA2 omapdss.def_disp=hdmi consoleblank=0'",
105 boot
106-
107+
108 bootloader_prompt = $
109
110 lmc_dev_arg = snowball_sd
111
112+soft_boot_cmd = echo "Restarting system."
113+ echo 0x02 > /sys/kernel/debug/ab8500/register-bank
114+ echo 0x02 > /sys/kernel/debug/ab8500/register-address
115+ echo 0x01 > /sys/kernel/debug/ab8500/register-value
116+ echo 0x01 > /sys/kernel/debug/ab8500/register-address
117+ echo 0x11 > /sys/kernel/debug/ab8500/register-value
118+
119+enable_network_after_boot_android = 1
120+

Subscribers

People subscribed via source and target branches