Merge lp:~stylesen/lava-dispatcher/multinode into lp:lava-dispatcher/multinode
- multinode
- Merge into multinode
Status: | Merged |
---|---|
Approved by: | Neil Williams |
Approved revision: | no longer in the source branch. |
Merged at revision: | 645 |
Proposed branch: | lp:~stylesen/lava-dispatcher/multinode |
Merge into: | lp:lava-dispatcher/multinode |
Diff against target: |
1207 lines (+741/-249) 18 files modified
lava_dispatcher/actions/boot_control.py (+8/-2) lava_dispatcher/actions/lava_test_shell.py (+3/-0) lava_dispatcher/client/lmc_utils.py (+1/-1) lava_dispatcher/config.py (+1/-0) lava_dispatcher/default-config/lava-dispatcher/device-types/capri.conf (+46/-0) lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_A15x4-A7x4.conf (+0/-74) lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_v8.conf (+0/-91) lava_dispatcher/default-config/lava-dispatcher/device-types/foundationsmodel.conf (+0/-20) lava_dispatcher/default-config/lava-dispatcher/device-types/nexus10.conf (+46/-0) lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_foundation-armv8.conf (+20/-0) lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x1-a7x1.conf (+111/-0) lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x4-a7x4.conf (+111/-0) lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-armv8.conf (+128/-0) lava_dispatcher/device/capri.py (+84/-0) lava_dispatcher/device/fastboot.py (+1/-1) lava_dispatcher/device/fastmodel.py (+74/-59) lava_dispatcher/device/nexus10.py (+65/-0) lava_dispatcher/device/target.py (+42/-1) |
To merge this branch: | bzr merge lp:~stylesen/lava-dispatcher/multinode |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Linaro Automation & Validation | Pending | ||
Review via email: mp+171731@code.launchpad.net |
Commit message
Description of the change
Bring up-to-date with trunk.
- 645. By Neil Williams
-
Senthil Kumaran 2013-06-27 [merge] Bring up-to-date with trunk.
Yongqin Liu 2013-06-26 [merge] merge the modification of network support for fast models
Yongqin Liu 2013-06-25 change enable_network_ after_boot_ android to true
Yongqin Liu 2013-06-25 [merge] merge with trunk
Yongqin Liu 2013-06-25 update the default interface name for fast models to armv8_01
Yongqin Liu 2013-06-18 add network support for fast models
Tyler Baker 2013-06-21 Hot Fix for networking issues in the lab
Tyler Baker 2013-06-20 [merge] Add Nexus 10 support
Tyler Baker 2013-06-19 Move fastboot flash boot
Tyler Baker 2013-06-19 Fix soft reboot
Tyler Baker 2013-06-19 Fix client_type
Tyler Baker 2013-06-19 Support for Nexus 10
Tyler Baker 2013-06-20 [merge] UEFI support for Fastmodels. Add interactive bootloader support.
Tyler Baker 2013-06-19 Remove for loop to send character by character as send() already does this
Tyler Baker 2013-06-19 Add interactive commands to be given via JSON
Tyler Baker 2013-06-19 Update device-types to reflect the differences in models.
Tyler Baker 2013-06-18 Fixes for UEFI
Tyler Baker 2013-06-18 Fixes for UEFI
Tyler Baker 2013-06-14 UEFI support and interactive bootloader support
Tyler Baker 2013-06-20 [merge] Add Broadcom Capri support
Tyler Baker 2013-06-18 Remove connect_to_serial as MasterImageTarget takes care of this for us.
Tyler Baker 2013-06-18 Inherit from MasterImageTarget to reuse code
Tyler Baker 2013-06-17 Working Capri implementation
Tyler Baker 2013-06-17 Initial support for Capri
Preview Diff
1 | === modified file 'lava_dispatcher/actions/boot_control.py' |
2 | --- lava_dispatcher/actions/boot_control.py 2013-05-22 16:09:09 +0000 |
3 | +++ lava_dispatcher/actions/boot_control.py 2013-06-27 08:02:26 +0000 |
4 | @@ -71,10 +71,16 @@ |
5 | """ |
6 | |
7 | parameters_schema = _boot_schema |
8 | + parameters_schema['properties']['interactive_boot_cmds'] = { |
9 | + 'default': False, 'optional': True |
10 | + } |
11 | |
12 | - def run(self, options=[]): |
13 | + def run(self, options=[], interactive_boot_cmds=False): |
14 | client = self.client |
15 | - client.target_device.boot_options = options |
16 | + if interactive_boot_cmds: |
17 | + client.config.boot_cmds = options |
18 | + else: |
19 | + client.target_device.boot_options = options |
20 | status = 'pass' |
21 | try: |
22 | client.boot_linaro_image() |
23 | |
24 | === modified file 'lava_dispatcher/actions/lava_test_shell.py' |
25 | --- lava_dispatcher/actions/lava_test_shell.py 2013-06-26 14:05:39 +0000 |
26 | +++ lava_dispatcher/actions/lava_test_shell.py 2013-06-27 08:02:26 +0000 |
27 | @@ -492,6 +492,9 @@ |
28 | |
29 | with target.runner() as runner: |
30 | runner.wait_for_prompt(timeout) |
31 | + if self.context.config.lava_proxy: |
32 | + runner._connection.sendline( |
33 | + "export http_proxy=%s" % self.context.config.lava_proxy) |
34 | runner._connection.sendline( |
35 | "%s/bin/lava-test-runner" % target.deployment_data['lava_test_dir']) |
36 | start = time.time() |
37 | |
38 | === modified file 'lava_dispatcher/client/lmc_utils.py' |
39 | --- lava_dispatcher/client/lmc_utils.py 2013-04-11 13:05:31 +0000 |
40 | +++ lava_dispatcher/client/lmc_utils.py 2013-06-27 08:02:26 +0000 |
41 | @@ -60,7 +60,7 @@ |
42 | |
43 | def generate_fastmodel_image(context, hwpack, rootfs, odir, bootloader='u_boot', size="2000M"): |
44 | cmd = ("flock /var/lock/lava-lmc.lck sudo linaro-media-create " |
45 | - "--dev fastmodel --output-directory %s --image-size %s " |
46 | + "--dev vexpress --output-directory %s --image-size %s " |
47 | "--hwpack %s --binary %s --hwpack-force-yes --bootloader %s" % |
48 | (odir, size, hwpack, rootfs, bootloader) ) |
49 | logging.info("Generating fastmodel image with: %s" % cmd) |
50 | |
51 | === modified file 'lava_dispatcher/config.py' |
52 | --- lava_dispatcher/config.py 2013-06-13 14:33:49 +0000 |
53 | +++ lava_dispatcher/config.py 2013-06-27 08:02:26 +0000 |
54 | @@ -89,6 +89,7 @@ |
55 | simulator_initrd = schema.StringOption(default=None) |
56 | simulator_dtb = schema.StringOption(default=None) |
57 | simulator_uefi = schema.StringOption(default=None) |
58 | + simulator_boot_wrapper = schema.StringOption(default=None) |
59 | |
60 | android_disable_suspend = schema.BoolOption(default=True) |
61 | android_adb_over_usb = schema.BoolOption(default=False) |
62 | |
63 | === added file 'lava_dispatcher/default-config/lava-dispatcher/device-types/capri.conf' |
64 | --- lava_dispatcher/default-config/lava-dispatcher/device-types/capri.conf 1970-01-01 00:00:00 +0000 |
65 | +++ lava_dispatcher/default-config/lava-dispatcher/device-types/capri.conf 2013-06-27 08:02:26 +0000 |
66 | @@ -0,0 +1,46 @@ |
67 | +client_type = capri |
68 | + |
69 | +# The ADB command line. |
70 | +# |
71 | +# In the case where there are multiple android devices plugged into a |
72 | +# single host, this connection command must be overriden on each device to |
73 | +# include the serial number of the device, e.g. |
74 | +# |
75 | +# serial_number = XXXXXXXXXXXXXXXX |
76 | +# adb_command = adb -s %(serial_number)s |
77 | +adb_command = adb |
78 | + |
79 | +# The fastboot command. |
80 | +# |
81 | +# The same as above: if you have more than one device, you will want to |
82 | +# override this in your device config to add a serial number, e.g. |
83 | +# |
84 | +# serial_number = XXXXXXXXXXXXXXXX |
85 | +# fastboot_command = fastboot -s %(serial_number)s |
86 | +# |
87 | +# Of course, in the case you override both adb_command *and* fastboot_command, |
88 | +# you don't need to specify `serial_number` twice. |
89 | +fastboot_command = fastboot |
90 | + |
91 | +# Working directory for temporary files. By default, the usual place for LAVA |
92 | +# images will be used. |
93 | +# |
94 | +# This is useful when the lava dispatcher is controlling the device under test which is |
95 | +# physically plugged to other machines by setting adb_command to something like |
96 | +# "ssh <phone-host> adb" and fastboot_command to something like "ssh |
97 | +# <phone-host> fastboot". adb and fastboot always operate on local files, so |
98 | +# you need your local files to also be seen as local files on the host where |
99 | +# adb/fastboot are executed. |
100 | +# |
101 | +# In this case, you should set shared_working_directory to a shared directory |
102 | +# between the machine running the dispatcher and the machine where the phone is |
103 | +# plugged. This shared directory must have the same path in both machines. |
104 | +# For example, you can have your /var/tmp/lava mounted at /var/tmp/lava at |
105 | +# <phone-host> (or the other way around). |
106 | +shared_working_directory = |
107 | + |
108 | +connection_command = %(adb_command)s shell |
109 | + |
110 | +enable_network_after_boot_android = false |
111 | +android_adb_over_usb = true |
112 | +android_adb_over_tcp = false |
113 | |
114 | === removed file 'lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_A15x4-A7x4.conf' |
115 | --- lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_A15x4-A7x4.conf 2013-06-04 16:00:29 +0000 |
116 | +++ lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_A15x4-A7x4.conf 1970-01-01 00:00:00 +0000 |
117 | @@ -1,74 +0,0 @@ |
118 | -client_type=fastmodel |
119 | - |
120 | -# how long the disablesuspend script should take to complete |
121 | -# fm takes longer than other android images do |
122 | -disablesuspend_timeout = 500 |
123 | - |
124 | -# how long ubuntu takes to boot to prompt |
125 | -boot_linaro_timeout = 500 |
126 | - |
127 | -# if you do dhcp on boot, adb will not work (asac) on fastmodels |
128 | -enable_network_after_boot_android = 0 |
129 | - |
130 | -# we do usermode networking over the loopback |
131 | -default_network_interface = lo |
132 | - |
133 | -simulator_axf_files = |
134 | - img.axf |
135 | - linux-system-ISW.axf |
136 | - rtsm/linux-system-semi.axf |
137 | - |
138 | -simulator_kernel = vmlinuz.* |
139 | -simulator_initrd = initrd.* |
140 | -simulator_dtb = rtsm_ve-ca15x4-ca7x4.dtb |
141 | -simulator_uefi = uefi_rtsm_ve-ca15.bin |
142 | - |
143 | -license_file = 8224@localhost |
144 | -sim_bin = /opt/arm/RTSM_A15-A7x14_VE/Linux64_RTSM_VE_Cortex-A15x4-A7x4/RTSM_VE_Cortex-A15x4-A7x4 |
145 | -android_adb_port = 6555 |
146 | - |
147 | -simulator_version_command = %(sim_bin)s --version | grep "Fast Models" | sed 's/Fast Models \[//' | sed 's/\]//' |
148 | - |
149 | -simulator_command = sudo -u www-data ARMLMD_LICENSE_FILE="%(license_file)s" %(sim_bin)s -a coretile.cluster0.*={AXF} -C motherboard.mmc.p_mmc_file={IMG} |
150 | - |
151 | -boot_options = |
152 | - motherboard.hostbridge.userNetPorts |
153 | - motherboard.smsc_91c111.enabled |
154 | - motherboard.hostbridge.userNetworking |
155 | - motherboard.flashloader0.fname |
156 | - motherboard.flashloader1.fname |
157 | - motherboard.flashloader1.fnameWrite |
158 | - coretile.cache_state_modelled |
159 | - coretile.cluster0.cpu0.semihosting-enable |
160 | - coretile.cluster0.cpu0.semihosting-cmd_line |
161 | - |
162 | -[motherboard.hostbridge.userNetPorts] |
163 | -default="%(android_adb_port)s=%(android_adb_port)s" |
164 | - |
165 | -[motherboard.smsc_91c111.enabled] |
166 | -default = 1 |
167 | -allowed = 0,1 |
168 | - |
169 | -[motherboard.hostbridge.userNetworking] |
170 | -default = 1 |
171 | -allowed = 0,1 |
172 | - |
173 | -[motherboard.flashloader0.fname] |
174 | -default = {UEFI} |
175 | - |
176 | -[motherboard.flashloader1.fname] |
177 | -default = "uefi-vars.fd" |
178 | - |
179 | -[motherboard.flashloader1.fnameWrite] |
180 | -default = uefi-vars.fd |
181 | - |
182 | -[coretile.cache_state_modelled] |
183 | -default = 0 |
184 | -allowed = 0,1 |
185 | - |
186 | -[coretile.cluster0.cpu0.semihosting-enable] |
187 | -default = 1 |
188 | -allowed = 0,1 |
189 | - |
190 | -[coretile.cluster0.cpu0.semihosting-cmd_line] |
191 | -default = "--kernel {KERNEL} --dtb {DTB} --initrd {INITRD} -- console=ttyAMA0,38400n8 root=/dev/mmcblk0p2 rootwait ro mem=1024M" |
192 | |
193 | === removed file 'lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_v8.conf' |
194 | --- lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_v8.conf 2013-04-23 10:30:27 +0000 |
195 | +++ lava_dispatcher/default-config/lava-dispatcher/device-types/fastmodel_v8.conf 1970-01-01 00:00:00 +0000 |
196 | @@ -1,91 +0,0 @@ |
197 | -client_type=fastmodel |
198 | - |
199 | -# how long the disablesuspend script should take to complete |
200 | -# fm takes longer than other android images do |
201 | -disablesuspend_timeout = 500 |
202 | - |
203 | -# how long ubuntu takes to boot to prompt |
204 | -boot_linaro_timeout = 500 |
205 | - |
206 | -# if you do dhcp on boot, adb will not work (asac) on fastmodels |
207 | -enable_network_after_boot_android = 0 |
208 | - |
209 | -# we do usermode networking over the loopback |
210 | -default_network_interface = lo |
211 | - |
212 | -simulator_axf_files = linux-system.axf |
213 | - |
214 | -license_file = 8224@localhost |
215 | -sim_bin = /opt/arm/RTSMv8_VE/bin/model_shell64 |
216 | -sim_model = /opt/arm/RTSMv8_VE/models/Linux64_GCC-4.1/RTSM_VE_AEMv8A.so |
217 | -android_adb_port = 5555 |
218 | - |
219 | -simulator_version_command = %(sim_bin)s --version | grep "Model Shell" | sed 's/Model Shell //' |
220 | - |
221 | -simulator_command = sudo -u www-data ARMLMD_LICENSE_FILE="%(license_file)s" %(sim_bin)s -a {AXF} %(sim_model)s -C motherboard.mmc.p_mmc_file={IMG} |
222 | - |
223 | -boot_options = |
224 | - motherboard.hostbridge.userNetPorts |
225 | - motherboard.hostbridge.userNetworking |
226 | - motherboard.smsc_91c111.enabled |
227 | - cluster.NUM_CORES |
228 | - cluster.cpu0.unpredictable_WPMASKANDBAS |
229 | - cluster.cpu0.unpredictable_non-contigous_BAS |
230 | - cluster.cpu1.unpredictable_WPMASKANDBAS |
231 | - cluster.cpu1.unpredictable_non-contigous_BAS |
232 | - cluster.cpu2.unpredictable_WPMASKANDBAS |
233 | - cluster.cpu2.unpredictable_non-contigous_BAS |
234 | - cluster.cpu3.unpredictable_WPMASKANDBAS |
235 | - cluster.cpu3.unpredictable_non-contigous_BAS |
236 | - cluster.take_ccfail_undef |
237 | - |
238 | -[motherboard.hostbridge.userNetPorts] |
239 | -default="%(android_adb_port)s=%(android_adb_port)s" |
240 | - |
241 | -[motherboard.hostbridge.userNetworking] |
242 | -default = 1 |
243 | -allowed = 0,1 |
244 | - |
245 | -[motherboard.smsc_91c111.enabled] |
246 | -default = 1 |
247 | -allowed = 0,1 |
248 | - |
249 | -[cluster.NUM_CORES] |
250 | -default = 1 |
251 | -allowed = 0,1 |
252 | - |
253 | -[cluster.cpu0.unpredictable_WPMASKANDBAS] |
254 | -default = 0 |
255 | -allowed = 0,1 |
256 | - |
257 | -[cluster.cpu0.unpredictable_non-contigous_BAS] |
258 | -default = 0 |
259 | -allowed = 0,1 |
260 | - |
261 | -[cluster.cpu1.unpredictable_WPMASKANDBAS] |
262 | -default = 0 |
263 | -allowed = 0,1 |
264 | - |
265 | -[cluster.cpu1.unpredictable_non-contigous_BAS] |
266 | -default = 0 |
267 | -allowed = 0,1 |
268 | - |
269 | -[cluster.cpu2.unpredictable_WPMASKANDBAS] |
270 | -default = 0 |
271 | -allowed = 0,1 |
272 | - |
273 | -[cluster.cpu2.unpredictable_non-contigous_BAS] |
274 | -default = 0 |
275 | -allowed = 0,1 |
276 | - |
277 | -[cluster.cpu3.unpredictable_WPMASKANDBAS] |
278 | -default = 0 |
279 | -allowed = 0,1 |
280 | - |
281 | -[cluster.cpu3.unpredictable_non-contigous_BAS] |
282 | -default = 0 |
283 | -allowed = 0,1 |
284 | - |
285 | -[cluster.take_ccfail_undef] |
286 | -default = 0 |
287 | -allowed = 0,1 |
288 | |
289 | === removed file 'lava_dispatcher/default-config/lava-dispatcher/device-types/foundationsmodel.conf' |
290 | --- lava_dispatcher/default-config/lava-dispatcher/device-types/foundationsmodel.conf 2012-11-16 00:47:20 +0000 |
291 | +++ lava_dispatcher/default-config/lava-dispatcher/device-types/foundationsmodel.conf 1970-01-01 00:00:00 +0000 |
292 | @@ -1,20 +0,0 @@ |
293 | -client_type=fastmodel |
294 | - |
295 | -# how long the disablesuspend script should take to complete |
296 | -# fm takes longer than other android images do |
297 | -disablesuspend_timeout = 500 |
298 | - |
299 | -# how long ubuntu takes to boot to prompt |
300 | -boot_linaro_timeout = 500 |
301 | - |
302 | -# if you do dhcp on boot, adb will not work (asac) on fastmodels |
303 | -enable_network_after_boot_android = 0 |
304 | - |
305 | -# we do usermode networking over the loopback |
306 | -default_network_interface = lo |
307 | - |
308 | -simulator_axf_files = img-foundation.axf |
309 | - |
310 | -simulator_version_command = /opt/arm/Foundation_v8pkg/Foundation_v8 --version | grep "ARM V8 Foundation Model" | sed 's/ARM V8 Foundation Model //' |
311 | - |
312 | -simulator_command = sudo -u www-data /opt/arm/Foundation_v8pkg/Foundation_v8 --image={AXF} --block-device={IMG} --network=nat |
313 | |
314 | === added file 'lava_dispatcher/default-config/lava-dispatcher/device-types/nexus10.conf' |
315 | --- lava_dispatcher/default-config/lava-dispatcher/device-types/nexus10.conf 1970-01-01 00:00:00 +0000 |
316 | +++ lava_dispatcher/default-config/lava-dispatcher/device-types/nexus10.conf 2013-06-27 08:02:26 +0000 |
317 | @@ -0,0 +1,46 @@ |
318 | +client_type = nexus10 |
319 | + |
320 | +# The ADB command line. |
321 | +# |
322 | +# In the case where there are multiple android devices plugged into a |
323 | +# single host, this connection command must be overriden on each device to |
324 | +# include the serial number of the device, e.g. |
325 | +# |
326 | +# serial_number = XXXXXXXXXXXXXXXX |
327 | +# adb_command = adb -s %(serial_number)s |
328 | +adb_command = adb |
329 | + |
330 | +# The fastboot command. |
331 | +# |
332 | +# The same as above: if you have more than one device, you will want to |
333 | +# override this in your device config to add a serial number, e.g. |
334 | +# |
335 | +# serial_number = XXXXXXXXXXXXXXXX |
336 | +# fastboot_command = fastboot -s %(serial_number)s |
337 | +# |
338 | +# Of course, in the case you override both adb_command *and* fastboot_command, |
339 | +# you don't need to specify `serial_number` twice. |
340 | +fastboot_command = fastboot |
341 | + |
342 | +# Working directory for temporary files. By default, the usual place for LAVA |
343 | +# images will be used. |
344 | +# |
345 | +# This is useful when the lava dispatcher is controlling the device under test which is |
346 | +# physically plugged to other machines by setting adb_command to something like |
347 | +# "ssh <phone-host> adb" and fastboot_command to something like "ssh |
348 | +# <phone-host> fastboot". adb and fastboot always operate on local files, so |
349 | +# you need your local files to also be seen as local files on the host where |
350 | +# adb/fastboot are executed. |
351 | +# |
352 | +# In this case, you should set shared_working_directory to a shared directory |
353 | +# between the machine running the dispatcher and the machine where the phone is |
354 | +# plugged. This shared directory must have the same path in both machines. |
355 | +# For example, you can have your /var/tmp/lava mounted at /var/tmp/lava at |
356 | +# <phone-host> (or the other way around). |
357 | +shared_working_directory = |
358 | + |
359 | +connection_command = %(adb_command)s shell |
360 | + |
361 | +enable_network_after_boot_android = false |
362 | +android_adb_over_usb = true |
363 | +android_adb_over_tcp = false |
364 | |
365 | === added file 'lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_foundation-armv8.conf' |
366 | --- lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_foundation-armv8.conf 1970-01-01 00:00:00 +0000 |
367 | +++ lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_foundation-armv8.conf 2013-06-27 08:02:26 +0000 |
368 | @@ -0,0 +1,20 @@ |
369 | +client_type=fastmodel |
370 | + |
371 | +# how long the disablesuspend script should take to complete |
372 | +# fm takes longer than other android images do |
373 | +disablesuspend_timeout = 500 |
374 | + |
375 | +# how long ubuntu takes to boot to prompt |
376 | +boot_linaro_timeout = 500 |
377 | + |
378 | +# if you do dhcp on boot, adb will not work (asac) on fastmodels |
379 | +enable_network_after_boot_android = 0 |
380 | + |
381 | +# we do usermode networking over the loopback |
382 | +default_network_interface = lo |
383 | + |
384 | +simulator_axf_files = img-foundation.axf |
385 | + |
386 | +simulator_version_command = /opt/arm/Foundation_v8pkg/Foundation_v8 --version | grep "ARM V8 Foundation Model" | sed 's/ARM V8 Foundation Model //' |
387 | + |
388 | +simulator_command = sudo -u www-data /opt/arm/Foundation_v8pkg/Foundation_v8 --image={AXF} --block-device={IMG} --network=nat |
389 | |
390 | === added file 'lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x1-a7x1.conf' |
391 | --- lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x1-a7x1.conf 1970-01-01 00:00:00 +0000 |
392 | +++ lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x1-a7x1.conf 2013-06-27 08:02:26 +0000 |
393 | @@ -0,0 +1,111 @@ |
394 | +client_type=fastmodel |
395 | + |
396 | +# how long the disablesuspend script should take to complete |
397 | +# fm takes longer than other android images do |
398 | +disablesuspend_timeout = 500 |
399 | + |
400 | +# how long ubuntu takes to boot to prompt |
401 | +boot_linaro_timeout = 800 |
402 | + |
403 | +# if you do dhcp on boot, adb will not work (asac) on fastmodels |
404 | +enable_network_after_boot_android = 0 |
405 | + |
406 | +# we do usermode networking over the loopback |
407 | +default_network_interface = lo |
408 | + |
409 | +bootloader_prompt = Start: |
410 | + |
411 | +interrupt_boot_prompt = The default boot selection will start in |
412 | + |
413 | +interrupt_boot_command = break |
414 | + |
415 | +# UEFI boot commands |
416 | +boot_cmds = sendline a, |
417 | + expect Choice:, |
418 | + sendline 1, |
419 | + expect Select the Boot Device:, |
420 | + sendline 2, |
421 | + expect File path of the EFI Application or the kernel:, |
422 | + sendline uImage, |
423 | + expect [a/g/l], |
424 | + sendline l, |
425 | + expect Add an initrd: [y/n], |
426 | + sendline y, |
427 | + expect File path of the initrd:, |
428 | + sendline uInitrd, |
429 | + expect Arguments to pass to the binary:, |
430 | + sendline 'console=ttyAMA0,38400n8 root=/dev/mmcblk0p2 rootwait ro mem=1024M', |
431 | + expect File path of the local FDT:, |
432 | + sendline rtsm\\rtsm_ve-ca15x1-ca7x1.dtb, |
433 | + expect Description for this new Entry:, |
434 | + sendline Test Image, |
435 | + expect Choice:, |
436 | + sendline 5, |
437 | + expect Start:, |
438 | + sendline 2 |
439 | + |
440 | +simulator_axf_files = |
441 | + img.axf |
442 | + linux-system-ISW.axf |
443 | + rtsm/linux-system-semi.axf |
444 | + |
445 | +simulator_kernel = vmlinuz.* |
446 | +simulator_initrd = initrd.* |
447 | +simulator_dtb = rtsm_ve-ca15x1-ca7x1.dtb |
448 | +simulator_uefi = uefi_rtsm_ve-ca15.bin |
449 | + |
450 | +license_file = 8224@localhost |
451 | +sim_bin = /opt/arm/RTSM_A15-A7x14_VE/Linux64_RTSM_VE_Cortex-A15x4-A7x4/RTSM_VE_Cortex-A15x4-A7x4 |
452 | +android_adb_port = 6555 |
453 | + |
454 | +simulator_version_command = %(sim_bin)s --version | grep "Fast Models" | sed 's/Fast Models \[//' | sed 's/\]//' |
455 | + |
456 | +simulator_boot_wrapper = -a coretile.cluster0.*={AXF} |
457 | + |
458 | +simulator_command = sudo -u www-data ARMLMD_LICENSE_FILE="%(license_file)s" %(sim_bin)s |
459 | + |
460 | +boot_options = |
461 | + motherboard.mmc.p_mmc_file |
462 | + motherboard.hostbridge.userNetPorts |
463 | + motherboard.smsc_91c111.enabled |
464 | + motherboard.hostbridge.userNetworking |
465 | + motherboard.flashloader0.fname |
466 | + motherboard.flashloader1.fname |
467 | + motherboard.flashloader1.fnameWrite |
468 | + coretile.cache_state_modelled |
469 | + coretile.cluster0.cpu0.semihosting-enable |
470 | + coretile.cluster0.cpu0.semihosting-cmd_line |
471 | + |
472 | +[motherboard.mmc.p_mmc_file] |
473 | +default = {IMG} |
474 | + |
475 | +[motherboard.hostbridge.userNetPorts] |
476 | +default="%(android_adb_port)s=%(android_adb_port)s" |
477 | + |
478 | +[motherboard.smsc_91c111.enabled] |
479 | +default = 1 |
480 | +allowed = 0,1 |
481 | + |
482 | +[motherboard.hostbridge.userNetworking] |
483 | +default = 1 |
484 | +allowed = 0,1 |
485 | + |
486 | +[motherboard.flashloader0.fname] |
487 | +default = {UEFI} |
488 | + |
489 | +[motherboard.flashloader1.fname] |
490 | +default = uefi-vars.fd |
491 | + |
492 | +[motherboard.flashloader1.fnameWrite] |
493 | +default = uefi-vars.fd |
494 | + |
495 | +[coretile.cache_state_modelled] |
496 | +default = 0 |
497 | +allowed = 0,1 |
498 | + |
499 | +[coretile.cluster0.cpu0.semihosting-enable] |
500 | +default = 1 |
501 | +allowed = 0,1 |
502 | + |
503 | +[coretile.cluster0.cpu0.semihosting-cmd_line] |
504 | +default = "--kernel {KERNEL} --dtb {DTB} --initrd {INITRD} -- console=ttyAMA0,38400n8 root=/dev/mmcblk0p2 rootwait ro mem=1024M" |
505 | |
506 | === added file 'lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x4-a7x4.conf' |
507 | --- lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x4-a7x4.conf 1970-01-01 00:00:00 +0000 |
508 | +++ lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-a15x4-a7x4.conf 2013-06-27 08:02:26 +0000 |
509 | @@ -0,0 +1,111 @@ |
510 | +client_type=fastmodel |
511 | + |
512 | +# how long the disablesuspend script should take to complete |
513 | +# fm takes longer than other android images do |
514 | +disablesuspend_timeout = 500 |
515 | + |
516 | +# how long ubuntu takes to boot to prompt |
517 | +boot_linaro_timeout = 800 |
518 | + |
519 | +# if you do dhcp on boot, adb will not work (asac) on fastmodels |
520 | +enable_network_after_boot_android = 0 |
521 | + |
522 | +# we do usermode networking over the loopback |
523 | +default_network_interface = lo |
524 | + |
525 | +bootloader_prompt = Start: |
526 | + |
527 | +interrupt_boot_prompt = The default boot selection will start in |
528 | + |
529 | +interrupt_boot_command = break |
530 | + |
531 | +# UEFI boot commands |
532 | +boot_cmds = sendline a, |
533 | + expect Choice:, |
534 | + sendline 1, |
535 | + expect Select the Boot Device:, |
536 | + sendline 2, |
537 | + expect File path of the EFI Application or the kernel:, |
538 | + sendline uImage, |
539 | + expect [a/g/l], |
540 | + sendline l, |
541 | + expect Add an initrd: [y/n], |
542 | + sendline y, |
543 | + expect File path of the initrd:, |
544 | + sendline uInitrd, |
545 | + expect Arguments to pass to the binary:, |
546 | + sendline 'console=ttyAMA0,38400n8 root=/dev/mmcblk0p2 rootwait ro mem=1024M', |
547 | + expect File path of the local FDT:, |
548 | + sendline rtsm\\rtsm_ve-ca15x4-ca7x4.dtb, |
549 | + expect Description for this new Entry:, |
550 | + sendline Test Image, |
551 | + expect Choice:, |
552 | + sendline 5, |
553 | + expect Start:, |
554 | + sendline 2 |
555 | + |
556 | +simulator_axf_files = |
557 | + img.axf |
558 | + linux-system-ISW.axf |
559 | + rtsm/linux-system-semi.axf |
560 | + |
561 | +simulator_kernel = vmlinuz.* |
562 | +simulator_initrd = initrd.* |
563 | +simulator_dtb = rtsm_ve-ca15x4-ca7x4.dtb |
564 | +simulator_uefi = uefi_rtsm_ve-ca15.bin |
565 | + |
566 | +license_file = 8224@localhost |
567 | +sim_bin = /opt/arm/RTSM_A15-A7x14_VE/Linux64_RTSM_VE_Cortex-A15x4-A7x4/RTSM_VE_Cortex-A15x4-A7x4 |
568 | +android_adb_port = 6555 |
569 | + |
570 | +simulator_version_command = %(sim_bin)s --version | grep "Fast Models" | sed 's/Fast Models \[//' | sed 's/\]//' |
571 | + |
572 | +simulator_boot_wrapper = -a coretile.cluster0.*={AXF} |
573 | + |
574 | +simulator_command = sudo -u www-data ARMLMD_LICENSE_FILE="%(license_file)s" %(sim_bin)s |
575 | + |
576 | +boot_options = |
577 | + motherboard.mmc.p_mmc_file |
578 | + motherboard.hostbridge.userNetPorts |
579 | + motherboard.smsc_91c111.enabled |
580 | + motherboard.hostbridge.userNetworking |
581 | + motherboard.flashloader0.fname |
582 | + motherboard.flashloader1.fname |
583 | + motherboard.flashloader1.fnameWrite |
584 | + coretile.cache_state_modelled |
585 | + coretile.cluster0.cpu0.semihosting-enable |
586 | + coretile.cluster0.cpu0.semihosting-cmd_line |
587 | + |
588 | +[motherboard.mmc.p_mmc_file] |
589 | +default = {IMG} |
590 | + |
591 | +[motherboard.hostbridge.userNetPorts] |
592 | +default="%(android_adb_port)s=%(android_adb_port)s" |
593 | + |
594 | +[motherboard.smsc_91c111.enabled] |
595 | +default = 1 |
596 | +allowed = 0,1 |
597 | + |
598 | +[motherboard.hostbridge.userNetworking] |
599 | +default = 1 |
600 | +allowed = 0,1 |
601 | + |
602 | +[motherboard.flashloader0.fname] |
603 | +default = {UEFI} |
604 | + |
605 | +[motherboard.flashloader1.fname] |
606 | +default = uefi-vars.fd |
607 | + |
608 | +[motherboard.flashloader1.fnameWrite] |
609 | +default = uefi-vars.fd |
610 | + |
611 | +[coretile.cache_state_modelled] |
612 | +default = 0 |
613 | +allowed = 0,1 |
614 | + |
615 | +[coretile.cluster0.cpu0.semihosting-enable] |
616 | +default = 1 |
617 | +allowed = 0,1 |
618 | + |
619 | +[coretile.cluster0.cpu0.semihosting-cmd_line] |
620 | +default = "--kernel {KERNEL} --dtb {DTB} --initrd {INITRD} -- console=ttyAMA0,38400n8 root=/dev/mmcblk0p2 rootwait ro mem=1024M" |
621 | |
622 | === added file 'lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-armv8.conf' |
623 | --- lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-armv8.conf 1970-01-01 00:00:00 +0000 |
624 | +++ lava_dispatcher/default-config/lava-dispatcher/device-types/rtsm_ve-armv8.conf 2013-06-27 08:02:26 +0000 |
625 | @@ -0,0 +1,128 @@ |
626 | +client_type=fastmodel |
627 | + |
628 | +# how long the disablesuspend script should take to complete |
629 | +# fm takes longer than other android images do |
630 | +disablesuspend_timeout = 500 |
631 | + |
632 | +# how long ubuntu takes to boot to prompt |
633 | +boot_linaro_timeout = 500 |
634 | + |
635 | +#after enabled the network, we can set it to true |
636 | +enable_network_after_boot_android = 1 |
637 | + |
638 | +# change to use eth0 after we enabled the network |
639 | +default_network_interface = eth0 |
640 | + |
641 | +bootloader_prompt = Start: |
642 | + |
643 | +interrupt_boot_prompt = The default boot selection will start in |
644 | + |
645 | +interrupt_boot_command = break |
646 | + |
647 | +# UEFI boot commands |
648 | +boot_cmds = sendline a, |
649 | + expect Choice:, |
650 | + sendline 1, |
651 | + expect Select the Boot Device:, |
652 | + sendline 2, |
653 | + expect File path of the EFI Application or the kernel:, |
654 | + sendline uImage, |
655 | + expect [a/g/l], |
656 | + sendline l, |
657 | + expect Add an initrd: [y/n], |
658 | + sendline y, |
659 | + expect File path of the initrd:, |
660 | + sendline uInitrd, |
661 | + expect Arguments to pass to the binary:, |
662 | + sendline 'console=ttyAMA0,38400n8 root=/dev/mmcblk0p2 rootwait ro mem=1024M', |
663 | + expect File path of the local FDT:, |
664 | + sendline rtsm\\rtsm_ve-ca15x1-ca7x1.dtb, |
665 | + expect Description for this new Entry:, |
666 | + sendline Test Image, |
667 | + expect Choice:, |
668 | + sendline 5, |
669 | + expect Start:, |
670 | + sendline 2 |
671 | + |
672 | +simulator_axf_files = linux-system.axf |
673 | + |
674 | +license_file = 8224@localhost |
675 | +sim_bin = /opt/arm/RTSMv8_VE/bin/model_shell64 |
676 | +sim_model = /opt/arm/RTSMv8_VE/models/Linux64_GCC-4.1/RTSM_VE_AEMv8A.so |
677 | +android_adb_port = 5555 |
678 | +interfaceName = armv8_01 |
679 | + |
680 | +simulator_version_command = %(sim_bin)s --version | grep "Model Shell" | sed 's/Model Shell //' |
681 | + |
682 | +simulator_boot_wrapper = -a {AXF} |
683 | + |
684 | +simulator_command = sudo -u www-data ARMLMD_LICENSE_FILE="%(license_file)s" %(sim_bin)s %(sim_model)s |
685 | + |
686 | +boot_options = |
687 | + motherboard.mmc.p_mmc_file |
688 | + motherboard.smsc_91c111.enabled |
689 | + cluster.NUM_CORES |
690 | + cluster.cpu0.unpredictable_WPMASKANDBAS |
691 | + cluster.cpu0.unpredictable_non-contigous_BAS |
692 | + cluster.cpu1.unpredictable_WPMASKANDBAS |
693 | + cluster.cpu1.unpredictable_non-contigous_BAS |
694 | + cluster.cpu2.unpredictable_WPMASKANDBAS |
695 | + cluster.cpu2.unpredictable_non-contigous_BAS |
696 | + cluster.cpu3.unpredictable_WPMASKANDBAS |
697 | + cluster.cpu3.unpredictable_non-contigous_BAS |
698 | + cluster.take_ccfail_undef |
699 | + motherboard.hostbridge.interfaceName |
700 | + motherboard.smsc_91c111.mac_address |
701 | + |
702 | +[motherboard.smsc_91c111.mac_address] |
703 | +default="auto" |
704 | + |
705 | +[motherboard.hostbridge.interfaceName] |
706 | +default="%(interfaceName)s" |
707 | + |
708 | +[motherboard.mmc.p_mmc_file] |
709 | +default = {IMG} |
710 | + |
711 | +[motherboard.smsc_91c111.enabled] |
712 | +default = 1 |
713 | +allowed = 0,1 |
714 | + |
715 | +[cluster.NUM_CORES] |
716 | +default = 1 |
717 | +allowed = 0,1 |
718 | + |
719 | +[cluster.cpu0.unpredictable_WPMASKANDBAS] |
720 | +default = 0 |
721 | +allowed = 0,1 |
722 | + |
723 | +[cluster.cpu0.unpredictable_non-contigous_BAS] |
724 | +default = 0 |
725 | +allowed = 0,1 |
726 | + |
727 | +[cluster.cpu1.unpredictable_WPMASKANDBAS] |
728 | +default = 0 |
729 | +allowed = 0,1 |
730 | + |
731 | +[cluster.cpu1.unpredictable_non-contigous_BAS] |
732 | +default = 0 |
733 | +allowed = 0,1 |
734 | + |
735 | +[cluster.cpu2.unpredictable_WPMASKANDBAS] |
736 | +default = 0 |
737 | +allowed = 0,1 |
738 | + |
739 | +[cluster.cpu2.unpredictable_non-contigous_BAS] |
740 | +default = 0 |
741 | +allowed = 0,1 |
742 | + |
743 | +[cluster.cpu3.unpredictable_WPMASKANDBAS] |
744 | +default = 0 |
745 | +allowed = 0,1 |
746 | + |
747 | +[cluster.cpu3.unpredictable_non-contigous_BAS] |
748 | +default = 0 |
749 | +allowed = 0,1 |
750 | + |
751 | +[cluster.take_ccfail_undef] |
752 | +default = 0 |
753 | +allowed = 0,1 |
754 | |
755 | === added file 'lava_dispatcher/device/capri.py' |
756 | --- lava_dispatcher/device/capri.py 1970-01-01 00:00:00 +0000 |
757 | +++ lava_dispatcher/device/capri.py 2013-06-27 08:02:26 +0000 |
758 | @@ -0,0 +1,84 @@ |
759 | +# Copyright (C) 2013 Linaro Limited |
760 | +# |
761 | +# Author: Tyler Baker <Tyler.Baker@linaro.org> |
762 | +# |
763 | +# This file is part of LAVA Dispatcher. |
764 | +# |
765 | +# LAVA Dispatcher is free software; you can redistribute it and/or modify |
766 | +# it under the terms of the GNU General Public License as published by |
767 | +# the Free Software Foundation; either version 2 of the License, or |
768 | +# (at your option) any later version. |
769 | +# |
770 | +# LAVA Dispatcher is distributed in the hope that it will be useful, |
771 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
772 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
773 | +# GNU General Public License for more details. |
774 | +# |
775 | +# You should have received a copy of the GNU General Public License |
776 | +# along |
777 | +# with this program; if not, see <http://www.gnu.org/licenses>. |
778 | + |
779 | +import logging |
780 | +from lava_dispatcher.device.target import ( |
781 | + Target |
782 | +) |
783 | +from lava_dispatcher.device.fastboot import ( |
784 | + FastbootTarget |
785 | +) |
786 | +from lava_dispatcher.device.master import ( |
787 | + MasterImageTarget |
788 | +) |
789 | + |
790 | +class CapriTarget(FastbootTarget, MasterImageTarget): |
791 | + |
792 | + def __init__(self, context, config): |
793 | + super(CapriTarget, self).__init__(context, config) |
794 | + |
795 | + def _enter_fastboot(self): |
796 | + if self.fastboot.on(): |
797 | + logging.debug("Device is on fastboot - no need to hard reset") |
798 | + return |
799 | + try: |
800 | + self._soft_reboot() |
801 | + self._enter_bootloader() |
802 | + except: |
803 | + logging.exception("_enter_bootloader failed") |
804 | + self._hard_reboot() |
805 | + self._enter_bootloader() |
806 | + self.proc.sendline("fastboot") |
807 | + |
808 | + |
809 | + def deploy_android(self, boot, system, userdata): |
810 | + |
811 | + boot = self._get_image(boot) |
812 | + system = self._get_image(system) |
813 | + userdata = self._get_image(userdata) |
814 | + |
815 | + self._enter_fastboot() |
816 | + self.fastboot.flash('boot', boot) |
817 | + self.fastboot.flash('system', system) |
818 | + self.fastboot.flash('userdata', userdata) |
819 | + |
820 | + self.deployment_data = Target.android_deployment_data |
821 | + self.deployment_data['boot_image'] = boot |
822 | + |
823 | + def power_on(self): |
824 | + if not self.deployment_data.get('boot_image', False): |
825 | + raise CriticalError('Deploy action must be run first') |
826 | + |
827 | + self._enter_fastboot() |
828 | + self.fastboot('reboot') |
829 | + self.proc.expect(self.context.device_config.master_str, |
830 | + timeout=300) |
831 | + |
832 | + # The capri does not yet have adb support, so we do not wait for adb. |
833 | + #self._adb('wait-for-device') |
834 | + |
835 | + self._booted = True |
836 | + self.proc.sendline("") # required to put the adb shell in a reasonable state |
837 | + self.proc.sendline("export PS1='%s'" % self.deployment_data['TESTER_PS1']) |
838 | + self._runner = self._get_runner(self.proc) |
839 | + |
840 | + return self.proc |
841 | + |
842 | +target_class = CapriTarget |
843 | |
844 | === modified file 'lava_dispatcher/device/fastboot.py' |
845 | --- lava_dispatcher/device/fastboot.py 2013-03-29 18:21:28 +0000 |
846 | +++ lava_dispatcher/device/fastboot.py 2013-06-27 08:02:26 +0000 |
847 | @@ -59,7 +59,7 @@ |
848 | return |
849 | try: |
850 | # First we try a gentle reset |
851 | - self.device._adb('reboot') |
852 | + self.device._adb(self.device.config.soft_boot_cmd) |
853 | except subprocess.CalledProcessError: |
854 | # Now a more brute force attempt. In this case the device is |
855 | # probably hung. |
856 | |
857 | === modified file 'lava_dispatcher/device/fastmodel.py' |
858 | --- lava_dispatcher/device/fastmodel.py 2013-06-04 16:40:25 +0000 |
859 | +++ lava_dispatcher/device/fastmodel.py 2013-06-27 08:02:26 +0000 |
860 | @@ -48,6 +48,7 @@ |
861 | ensure_directory, |
862 | extract_targz, |
863 | DrainConsoleOutput, |
864 | + string_to_list, |
865 | ) |
866 | |
867 | |
868 | @@ -68,6 +69,7 @@ |
869 | self._dtb = None |
870 | self._initrd = None |
871 | self._uefi = None |
872 | + self._bootloader = 'u_boot' |
873 | |
874 | def _customize_android(self): |
875 | with image_partition_mounted(self._sd_image, self.DATA_PARTITION) as d: |
876 | @@ -80,8 +82,9 @@ |
877 | f.write('\n# LAVA CUSTOMIZATIONS\n') |
878 | #make sure PS1 is what we expect it to be |
879 | f.write('PS1="%s"\n' % self.ANDROID_TESTER_PS1) |
880 | - # fast model usermode networking does not support ping |
881 | - f.write('alias ping="echo LAVA-ping override 1 received"\n') |
882 | + if not self.config.enable_network_after_boot_android: |
883 | + # fast model usermode networking does not support ping |
884 | + f.write('alias ping="echo LAVA-ping override 1 received"\n') |
885 | |
886 | self.deployment_data = Target.android_deployment_data |
887 | |
888 | @@ -92,61 +95,55 @@ |
889 | |
890 | def _copy_needed_files_from_directory(self, subdir): |
891 | odir = os.path.dirname(self._sd_image) |
892 | - |
893 | - if self._axf is None: |
894 | + if self._bootloader == 'u_boot': |
895 | + # Extract the bootwrapper from the image |
896 | for fname in self.config.simulator_axf_files: |
897 | - src = os.path.join(subdir, fname) |
898 | - if os.path.exists(src): |
899 | - self._axf = '%s/%s' % (odir, os.path.split(src)[1]) |
900 | - if src != self._axf: |
901 | - shutil.copyfile(src, self._axf) |
902 | + if self._axf is None: |
903 | + self._axf = self._find_and_copy( |
904 | + subdir, odir, fname) |
905 | + else: |
906 | break |
907 | - |
908 | - if self.config.simulator_kernel: |
909 | - self._copy_boot_files_from_directory(odir, subdir) |
910 | - |
911 | - def _copy_boot_files_from_directory(self, odir, subdir): |
912 | - # TODO: Optimize this loop |
913 | - for root, dirs, files in os.walk(subdir): |
914 | - for file in files: |
915 | - if re.match(self.config.simulator_kernel, file) and self._kernel is None: |
916 | - self._kernel = os.path.join(odir, file) |
917 | - if odir != subdir: |
918 | - kernel = os.path.join(subdir, file) |
919 | - shutil.copyfile(kernel, self._kernel) |
920 | - elif re.match(self.config.simulator_initrd, file) and self._initrd is None: |
921 | - self._initrd = os.path.join(odir, file) |
922 | - if odir != subdir: |
923 | - initrd = os.path.join(subdir, file) |
924 | - shutil.copyfile(initrd, self._initrd) |
925 | - elif re.match(self.config.simulator_dtb, file) and self._dtb is None: |
926 | - self._dtb = os.path.join(odir, file) |
927 | - if odir != subdir: |
928 | - dtb = os.path.join(subdir, file) |
929 | - shutil.copyfile(dtb, self._dtb) |
930 | - elif re.match(self.config.simulator_uefi, file) and self._uefi is None: |
931 | - self._uefi = os.path.join(odir, file) |
932 | - if odir != subdir: |
933 | - uefi = os.path.join(subdir, file) |
934 | - shutil.copyfile(uefi, self._uefi) |
935 | + # Extract the kernel from the image |
936 | + if self.config.simulator_kernel and self._kernel is None: |
937 | + self._kernel = self._find_and_copy( |
938 | + subdir, odir, self.config.simulator_kernel) |
939 | + # Extract the initrd from the image |
940 | + if self.config.simulator_initrd and self._initrd is None: |
941 | + self._initrd = self._find_and_copy( |
942 | + subdir, odir, self.config.simulator_initrd) |
943 | + # Extract the dtb from the image |
944 | + if self.config.simulator_dtb and self._dtb is None: |
945 | + self._dtb = self._find_and_copy( |
946 | + subdir, odir, self.config.simulator_dtb) |
947 | + elif self._bootloader == 'uefi': |
948 | + # Extract the uefi binary from the image |
949 | + if self.config.simulator_uefi and self._uefi is None: |
950 | + self._uefi = self._find_and_copy( |
951 | + subdir, odir, self.config.simulator_uefi) |
952 | |
953 | def _check_needed_files(self): |
954 | - # AXF is needed in all cases |
955 | - if not self._axf: |
956 | - raise RuntimeError('No AXF found, %r' % |
957 | - self.config.simulator_axf_files) |
958 | - # Kernel is needed only for b.L models |
959 | - if self._kernel is None and self.config.simulator_kernel: |
960 | - raise RuntimeError('No kernel found, %r' % |
961 | - self.config.simulator_kernel) |
962 | - # Initrd is needed only for b.L models |
963 | - if self._initrd is None and self.config.simulator_initrd: |
964 | - raise RuntimeError('No initrd found, %r' % |
965 | - self.config.simulator_initrd) |
966 | - # DTB is needed only for b.L models |
967 | - if self._dtb is None and self.config.simulator_dtb: |
968 | - raise RuntimeError('No initrd found, %r' % |
969 | - self.config.simulator_dtb) |
970 | + if self._bootloader == 'u_boot': |
971 | + # AXF is needed when we are not using UEFI |
972 | + if self._axf is None and self.config.simulator_axf_files: |
973 | + raise RuntimeError('No AXF found, %r' % |
974 | + self.config.simulator_axf_files) |
975 | + # Kernel is needed only for b.L models |
976 | + if self._kernel is None and self.config.simulator_kernel: |
977 | + raise RuntimeError('No KERNEL found, %r' % |
978 | + self.config.simulator_kernel) |
979 | + # Initrd is needed only for b.L models |
980 | + if self._initrd is None and self.config.simulator_initrd: |
981 | + raise RuntimeError('No INITRD found, %r' % |
982 | + self.config.simulator_initrd) |
983 | + # DTB is needed only for b.L models |
984 | + if self._dtb is None and self.config.simulator_dtb: |
985 | + raise RuntimeError('No DTB found, %r' % |
986 | + self.config.simulator_dtb) |
987 | + elif self._bootloader == 'uefi': |
988 | + # UEFI binary is needed when specified |
989 | + if self._uefi is None and self.config.simulator_uefi: |
990 | + raise RuntimeError('No UEFI binary found, %r' % |
991 | + self.config.simulator_uefi) |
992 | |
993 | def deploy_android(self, boot, system, data): |
994 | logging.info("Deploying Android on %s" % self.config.hostname) |
995 | @@ -170,6 +167,8 @@ |
996 | rootfs = download_image(rootfs, self.context, decompress=False) |
997 | odir = os.path.dirname(rootfs) |
998 | |
999 | + self._bootloader = bootloader |
1000 | + |
1001 | generate_fastmodel_image(self.context, hwpack, rootfs, odir, bootloader) |
1002 | self._sd_image = '%s/sd.img' % odir |
1003 | |
1004 | @@ -210,29 +209,36 @@ |
1005 | d = os.path.dirname(self._sd_image) |
1006 | os.chmod(d, stat.S_IRWXG | stat.S_IRWXU) |
1007 | os.chmod(self._sd_image, stat.S_IRWXG | stat.S_IRWXU) |
1008 | - os.chmod(self._axf, stat.S_IRWXG | stat.S_IRWXU) |
1009 | + if self._axf: |
1010 | + os.chmod(self._axf, stat.S_IRWXG | stat.S_IRWXU) |
1011 | if self._kernel: |
1012 | os.chmod(self._kernel, stat.S_IRWXG | stat.S_IRWXU) |
1013 | + if self._initrd: |
1014 | + os.chmod(self._initrd, stat.S_IRWXG | stat.S_IRWXU) |
1015 | if self._dtb: |
1016 | os.chmod(self._dtb, stat.S_IRWXG | stat.S_IRWXU) |
1017 | - if self._initrd: |
1018 | - os.chmod(self._initrd, stat.S_IRWXG | stat.S_IRWXU) |
1019 | if self._uefi: |
1020 | os.chmod(self._uefi, stat.S_IRWXG | stat.S_IRWXU) |
1021 | |
1022 | #lmc ignores the parent directories group owner |
1023 | st = os.stat(d) |
1024 | - os.chown(self._axf, st.st_uid, st.st_gid) |
1025 | os.chown(self._sd_image, st.st_uid, st.st_gid) |
1026 | + if self._axf: |
1027 | + os.chown(self._axf, st.st_uid, st.st_gid) |
1028 | if self._kernel: |
1029 | os.chown(self._kernel, st.st_uid, st.st_gid) |
1030 | + if self._initrd: |
1031 | + os.chown(self._initrd, st.st_uid, st.st_gid) |
1032 | if self._dtb: |
1033 | os.chown(self._dtb, st.st_uid, st.st_gid) |
1034 | - if self._initrd: |
1035 | - os.chown(self._initrd, st.st_uid, st.st_gid) |
1036 | if self._uefi: |
1037 | os.chown(self._uefi, st.st_uid, st.st_gid) |
1038 | |
1039 | + def _enter_bootloader(self): |
1040 | + if self.proc.expect(self.config.interrupt_boot_prompt) != 0: |
1041 | + raise Exception("Failed to enter bootloader") |
1042 | + self.proc.sendline(self.config.interrupt_boot_command) |
1043 | + |
1044 | def power_off(self, proc): |
1045 | super(FastModelTarget, self).power_off(proc) |
1046 | if self._sim_proc is not None: |
1047 | @@ -263,6 +269,10 @@ |
1048 | self._fix_perms() |
1049 | |
1050 | options = boot_options.as_string(self, join_pattern=' -C %s=%s') |
1051 | + |
1052 | + if self.config.simulator_boot_wrapper and self._uefi is None: |
1053 | + options = '%s %s' % (self.config.simulator_boot_wrapper, options) |
1054 | + |
1055 | sim_cmd = '%s %s' % (self.config.simulator_command, options) |
1056 | sim_cmd = sim_cmd.format( |
1057 | AXF=self._axf, IMG=self._sd_image, KERNEL=self._kernel, |
1058 | @@ -289,6 +299,11 @@ |
1059 | timeout=1200) |
1060 | self.proc.logfile_read = self._create_rtsm_ostream( |
1061 | self.proc.logfile_read) |
1062 | + |
1063 | + if self._uefi: |
1064 | + self._enter_bootloader() |
1065 | + self._customize_bootloader() |
1066 | + |
1067 | return self.proc |
1068 | |
1069 | def get_test_data_attachments(self): |
1070 | |
1071 | === added file 'lava_dispatcher/device/nexus10.py' |
1072 | --- lava_dispatcher/device/nexus10.py 1970-01-01 00:00:00 +0000 |
1073 | +++ lava_dispatcher/device/nexus10.py 2013-06-27 08:02:26 +0000 |
1074 | @@ -0,0 +1,65 @@ |
1075 | +# Copyright (C) 2013 Linaro Limited |
1076 | +# |
1077 | +# Author: Tyler Baker <Tyler.Baker@linaro.org> |
1078 | +# |
1079 | +# This file is part of LAVA Dispatcher. |
1080 | +# |
1081 | +# LAVA Dispatcher is free software; you can redistribute it and/or modify |
1082 | +# it under the terms of the GNU General Public License as published by |
1083 | +# the Free Software Foundation; either version 2 of the License, or |
1084 | +# (at your option) any later version. |
1085 | +# |
1086 | +# LAVA Dispatcher is distributed in the hope that it will be useful, |
1087 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1088 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1089 | +# GNU General Public License for more details. |
1090 | +# |
1091 | +# You should have received a copy of the GNU General Public License |
1092 | +# along |
1093 | +# with this program; if not, see <http://www.gnu.org/licenses>. |
1094 | + |
1095 | +from time import sleep |
1096 | +from lava_dispatcher.device.target import ( |
1097 | + Target |
1098 | +) |
1099 | +from lava_dispatcher.device.fastboot import ( |
1100 | + FastbootTarget |
1101 | +) |
1102 | + |
1103 | +class Nexus10Target(FastbootTarget): |
1104 | + |
1105 | + def __init__(self, context, config): |
1106 | + super(Nexus10Target, self).__init__(context, config) |
1107 | + |
1108 | + def deploy_android(self, boot, system, userdata): |
1109 | + |
1110 | + boot = self._get_image(boot) |
1111 | + system = self._get_image(system) |
1112 | + userdata = self._get_image(userdata) |
1113 | + |
1114 | + self.fastboot.enter() |
1115 | + self.fastboot.flash('boot', boot) |
1116 | + self.fastboot.flash('system', system) |
1117 | + self.fastboot.flash('userdata', userdata) |
1118 | + |
1119 | + self.deployment_data = Target.android_deployment_data |
1120 | + self.deployment_data['boot_image'] = boot |
1121 | + |
1122 | + def power_on(self): |
1123 | + if not self.deployment_data.get('boot_image', False): |
1124 | + raise CriticalError('Deploy action must be run first') |
1125 | + |
1126 | + self.fastboot.enter() |
1127 | + self.fastboot('reboot') |
1128 | + |
1129 | + self._adb('wait-for-device') |
1130 | + |
1131 | + self._booted = True |
1132 | + proc = self._adb('shell', spawn=True) |
1133 | + proc.sendline("") # required to put the adb shell in a reasonable state |
1134 | + proc.sendline("export PS1='%s'" % self.deployment_data['TESTER_PS1']) |
1135 | + self._runner = self._get_runner(proc) |
1136 | + |
1137 | + return proc |
1138 | + |
1139 | +target_class = Nexus10Target |
1140 | |
1141 | === modified file 'lava_dispatcher/device/target.py' |
1142 | --- lava_dispatcher/device/target.py 2013-04-19 08:40:29 +0000 |
1143 | +++ lava_dispatcher/device/target.py 2013-06-27 08:02:26 +0000 |
1144 | @@ -20,6 +20,8 @@ |
1145 | |
1146 | import contextlib |
1147 | import os |
1148 | +import shutil |
1149 | +import re |
1150 | |
1151 | from lava_dispatcher.client.lmc_utils import ( |
1152 | image_partition_mounted, |
1153 | @@ -67,7 +69,6 @@ |
1154 | def __init__(self, context, device_config): |
1155 | self.context = context |
1156 | self.config = device_config |
1157 | - |
1158 | self.boot_options = [] |
1159 | self._scratch_dir = None |
1160 | self.deployment_data = {} |
1161 | @@ -154,6 +155,46 @@ |
1162 | """ |
1163 | return 'unknown' |
1164 | |
1165 | + def _find_and_copy(self, rootdir, odir, pattern, name=None): |
1166 | + dest = None |
1167 | + for root, dirs, files in os.walk(rootdir): |
1168 | + for file in files: |
1169 | + if re.match(pattern, file): |
1170 | + if name: |
1171 | + dest = os.path.join(odir, name) |
1172 | + else: |
1173 | + dest = os.path.join(odir, file) |
1174 | + if rootdir != odir: |
1175 | + src = os.path.join(rootdir, file) |
1176 | + shutil.copyfile(src, dest) |
1177 | + return dest |
1178 | + else: |
1179 | + return dest |
1180 | + return dest |
1181 | + |
1182 | + def _customize_bootloader(self): |
1183 | + self.proc.expect(self.config.bootloader_prompt, timeout=300) |
1184 | + if isinstance(self.config.boot_cmds, basestring): |
1185 | + boot_cmds = utils.string_to_list(self.config.boot_cmds.encode('ascii')) |
1186 | + else: |
1187 | + boot_cmds = self.config.boot_cmds |
1188 | + for line in boot_cmds: |
1189 | + parts = re.match('^(?P<action>sendline|expect)\s*(?P<command>.*)', line) |
1190 | + if parts: |
1191 | + try: |
1192 | + action = parts.group('action') |
1193 | + command = parts.group('command') |
1194 | + except AttributeError as e: |
1195 | + raise Exception("Badly formatted command in boot_cmds %s" % e) |
1196 | + if action == "sendline": |
1197 | + self.proc.send(command) |
1198 | + self.proc.sendline('') |
1199 | + elif action == "expect": |
1200 | + command = re.escape(command) |
1201 | + self.proc.expect(command, timeout=300) |
1202 | + else: |
1203 | + self.proc.sendline(line) |
1204 | + |
1205 | def _customize_ubuntu(self, rootdir): |
1206 | self.deployment_data = Target.ubuntu_deployment_data |
1207 | with open('%s/root/.bashrc' % rootdir, 'a') as f: |