Merge lp:~doanac/lava-dispatcher/uefi-from-prak into lp:lava-dispatcher
- uefi-from-prak
- Merge into trunk
Proposed by
Andy Doan
| Status: | Rejected |
|---|---|
| Rejected by: | Neil Williams |
| Proposed branch: | lp:~doanac/lava-dispatcher/uefi-from-prak |
| Merge into: | lp:lava-dispatcher |
| Diff against target: |
366 lines (+199/-4) 10 files modified
lava_dispatcher/actions/boot_control.py (+22/-0) lava_dispatcher/actions/deploy.py (+14/-0) lava_dispatcher/client/base.py (+14/-0) lava_dispatcher/client/targetdevice.py (+9/-0) lava_dispatcher/config.py (+1/-0) lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf (+5/-0) lava_dispatcher/default-config/lava-dispatcher/device-types/origen.conf (+5/-0) lava_dispatcher/device/fastmodel.py (+8/-0) lava_dispatcher/device/master.py (+118/-4) lava_dispatcher/device/target.py (+3/-0) |
| To merge this branch: | bzr merge lp:~doanac/lava-dispatcher/uefi-from-prak |
| Related bugs: | |
| Related blueprints: |
Lava validation of UEFI on Origen
(Medium)
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Linaro Validation Team | Pending | ||
|
Review via email:
|
|||
Commit message
Description of the change
These are the changes from Prakash for UEFI booting in Origen. I've made them into a proper branch so we can discuss the changes.
To post a comment you must log in.
Revision history for this message
| Andy Doan (doanac) wrote : | # |
Unmerged revisions
- 474. By Andy Doan
-
uefi support changes from prakash
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
| 1 | === modified file 'lava_dispatcher/actions/boot_control.py' | |||
| 2 | --- lava_dispatcher/actions/boot_control.py 2012-11-20 21:22:17 +0000 | |||
| 3 | +++ lava_dispatcher/actions/boot_control.py 2012-11-30 15:53:29 +0000 | |||
| 4 | @@ -70,6 +70,28 @@ | |||
| 5 | 70 | finally: | 70 | finally: |
| 6 | 71 | self.context.test_data.add_result("boot_image", status) | 71 | self.context.test_data.add_result("boot_image", status) |
| 7 | 72 | 72 | ||
| 8 | 73 | ### UEFI | ||
| 9 | 74 | |||
| 10 | 75 | class cmd_boot_linaro_uefi_image(BaseAction): | ||
| 11 | 76 | """ Call client code to boot to the master image | ||
| 12 | 77 | """ | ||
| 13 | 78 | |||
| 14 | 79 | parameters_schema = _boot_schema | ||
| 15 | 80 | |||
| 16 | 81 | def run(self,options=[]): | ||
| 17 | 82 | client = self.client | ||
| 18 | 83 | client.target_device.boot_options = options | ||
| 19 | 84 | status = 'pass' | ||
| 20 | 85 | try: | ||
| 21 | 86 | client.boot_linaro_uefi_image() | ||
| 22 | 87 | except: | ||
| 23 | 88 | logging.exception("boot_linaro_image failed") | ||
| 24 | 89 | status = 'fail' | ||
| 25 | 90 | raise CriticalError("Failed to boot uefi test image.") | ||
| 26 | 91 | finally: | ||
| 27 | 92 | self.context.test_data.add_result("boot_uefi_image",status) | ||
| 28 | 93 | |||
| 29 | 94 | ### UEFI | ||
| 30 | 73 | 95 | ||
| 31 | 74 | class cmd_boot_master_image(BaseAction): | 96 | class cmd_boot_master_image(BaseAction): |
| 32 | 75 | """ Call client code to boot to the master image | 97 | """ Call client code to boot to the master image |
| 33 | 76 | 98 | ||
| 34 | === modified file 'lava_dispatcher/actions/deploy.py' | |||
| 35 | --- lava_dispatcher/actions/deploy.py 2012-11-20 13:34:19 +0000 | |||
| 36 | +++ lava_dispatcher/actions/deploy.py 2012-11-30 15:53:29 +0000 | |||
| 37 | @@ -91,6 +91,20 @@ | |||
| 38 | 91 | def run(self, boot, system, data, rootfstype='ext4'): | 91 | def run(self, boot, system, data, rootfstype='ext4'): |
| 39 | 92 | self.client.deploy_linaro_android(boot, system, data, rootfstype) | 92 | self.client.deploy_linaro_android(boot, system, data, rootfstype) |
| 40 | 93 | 93 | ||
| 41 | 94 | ## UEFI ## | ||
| 42 | 95 | class cmd_deploy_linaro_uefi_image(BaseAction): | ||
| 43 | 96 | parameters_schema = { | ||
| 44 | 97 | 'type': 'object', | ||
| 45 | 98 | 'properties' : { | ||
| 46 | 99 | 'hwpack': {'type':'string','optional': True}, | ||
| 47 | 100 | 'rootfs' : {'type':'string','optional': True}, | ||
| 48 | 101 | }, | ||
| 49 | 102 | 'additionalProperties': False, | ||
| 50 | 103 | } | ||
| 51 | 104 | |||
| 52 | 105 | def run(self, hwpack, rootfs): | ||
| 53 | 106 | self.client.deploy_linaro_uefi(hwpack,rootfs) | ||
| 54 | 107 | ## UEFI ## | ||
| 55 | 94 | 108 | ||
| 56 | 95 | class cmd_dummy_deploy(BaseAction): | 109 | class cmd_dummy_deploy(BaseAction): |
| 57 | 96 | 110 | ||
| 58 | 97 | 111 | ||
| 59 | === modified file 'lava_dispatcher/client/base.py' | |||
| 60 | --- lava_dispatcher/client/base.py 2012-11-29 08:54:47 +0000 | |||
| 61 | +++ lava_dispatcher/client/base.py 2012-11-30 15:53:29 +0000 | |||
| 62 | @@ -402,6 +402,20 @@ | |||
| 63 | 402 | self.setup_proxy(TESTER_PS1_PATTERN) | 402 | self.setup_proxy(TESTER_PS1_PATTERN) |
| 64 | 403 | logging.info("System is in test image now") | 403 | logging.info("System is in test image now") |
| 65 | 404 | 404 | ||
| 66 | 405 | ### UEFI | ||
| 67 | 406 | def boot_linaro_uefi_image(self): | ||
| 68 | 407 | """ | ||
| 69 | 408 | Reboot the system to the uefi test image | ||
| 70 | 409 | """ | ||
| 71 | 410 | logging.info("Boot the uefi test image") | ||
| 72 | 411 | |||
| 73 | 412 | self._boot_linaro_uefi_image() | ||
| 74 | 413 | |||
| 75 | 414 | wait_for_prompt(self.proc,'/bin/sh', timeout=300) | ||
| 76 | 415 | logging.info("System is in test image now") | ||
| 77 | 416 | |||
| 78 | 417 | ### UEFI | ||
| 79 | 418 | |||
| 80 | 405 | def get_www_scratch_dir(self): | 419 | def get_www_scratch_dir(self): |
| 81 | 406 | """ returns a temporary directory available for downloads that gets | 420 | """ returns a temporary directory available for downloads that gets |
| 82 | 407 | deleted when the process exits """ | 421 | deleted when the process exits """ |
| 83 | 408 | 422 | ||
| 84 | === modified file 'lava_dispatcher/client/targetdevice.py' | |||
| 85 | --- lava_dispatcher/client/targetdevice.py 2012-11-21 22:07:45 +0000 | |||
| 86 | +++ lava_dispatcher/client/targetdevice.py 2012-11-30 15:53:29 +0000 | |||
| 87 | @@ -50,6 +50,10 @@ | |||
| 88 | 50 | def deploy_linaro_android(self, boot, system, data, rootfstype='ext4'): | 50 | def deploy_linaro_android(self, boot, system, data, rootfstype='ext4'): |
| 89 | 51 | self.target_device.deploy_android(boot, system, data) | 51 | self.target_device.deploy_android(boot, system, data) |
| 90 | 52 | 52 | ||
| 91 | 53 | ## UEFI ## | ||
| 92 | 54 | def deploy_linaro_uefi(self,hwpack,rootfs): | ||
| 93 | 55 | self.target_device.deploy_uefi(hwpack,rootfs) | ||
| 94 | 56 | ## UEFI ## | ||
| 95 | 53 | def deploy_linaro(self, hwpack=None, rootfs=None, image=None, | 57 | def deploy_linaro(self, hwpack=None, rootfs=None, image=None, |
| 96 | 54 | rootfstype='ext3', bootloader='u_boot'): | 58 | rootfstype='ext3', bootloader='u_boot'): |
| 97 | 55 | if image is None: | 59 | if image is None: |
| 98 | @@ -68,6 +72,11 @@ | |||
| 99 | 68 | def _boot_linaro_image(self): | 72 | def _boot_linaro_image(self): |
| 100 | 69 | self.proc = self.target_device.power_on() | 73 | self.proc = self.target_device.power_on() |
| 101 | 70 | 74 | ||
| 102 | 75 | ### UEFI | ||
| 103 | 76 | def _boot_linaro_uefi_image(self): | ||
| 104 | 77 | self.proc = self.target_device.uefi_power_on() | ||
| 105 | 78 | |||
| 106 | 79 | ### UEFI | ||
| 107 | 71 | def _boot_linaro_android_image(self): | 80 | def _boot_linaro_android_image(self): |
| 108 | 72 | """Booting android or ubuntu style images don't differ much""" | 81 | """Booting android or ubuntu style images don't differ much""" |
| 109 | 73 | 82 | ||
| 110 | 74 | 83 | ||
| 111 | === modified file 'lava_dispatcher/config.py' | |||
| 112 | --- lava_dispatcher/config.py 2012-11-30 01:54:29 +0000 | |||
| 113 | +++ lava_dispatcher/config.py 2012-11-30 15:53:29 +0000 | |||
| 114 | @@ -73,6 +73,7 @@ | |||
| 115 | 73 | simulator_version_command = schema.StringOption() | 73 | simulator_version_command = schema.StringOption() |
| 116 | 74 | simulator_command = schema.StringOption() | 74 | simulator_command = schema.StringOption() |
| 117 | 75 | simulator_axf_files = schema.ListOption() | 75 | simulator_axf_files = schema.ListOption() |
| 118 | 76 | boot_cmds_uefi = schema.StringOption(fatal=True) ### UEFI | ||
| 119 | 76 | 77 | ||
| 120 | 77 | class OptionDescriptor(object): | 78 | class OptionDescriptor(object): |
| 121 | 78 | def __init__(self, name): | 79 | def __init__(self, name): |
| 122 | 79 | 80 | ||
| 123 | === modified file 'lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf' | |||
| 124 | --- lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf 2012-11-30 01:54:29 +0000 | |||
| 125 | +++ lava_dispatcher/default-config/lava-dispatcher/device-defaults.conf 2012-11-30 15:53:29 +0000 | |||
| 126 | @@ -34,6 +34,11 @@ | |||
| 127 | 34 | # XXX should be called # boot_oe_test_image_commands ? | 34 | # XXX should be called # boot_oe_test_image_commands ? |
| 128 | 35 | boot_cmds_oe = | 35 | boot_cmds_oe = |
| 129 | 36 | 36 | ||
| 130 | 37 | |||
| 131 | 38 | ### UEFI | ||
| 132 | 39 | boot_cmds_uefi = | ||
| 133 | 40 | ### UEFI | ||
| 134 | 41 | |||
| 135 | 37 | # The device type. Settings in device-types/${DEVICE_TYPE}.conf | 42 | # The device type. Settings in device-types/${DEVICE_TYPE}.conf |
| 136 | 38 | # override settings in this file, but are overridden by the | 43 | # override settings in this file, but are overridden by the |
| 137 | 39 | # devices/${DEVICE}.conf file. | 44 | # devices/${DEVICE}.conf file. |
| 138 | 40 | 45 | ||
| 139 | === modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/origen.conf' | |||
| 140 | --- lava_dispatcher/default-config/lava-dispatcher/device-types/origen.conf 2012-06-29 08:42:13 +0000 | |||
| 141 | +++ lava_dispatcher/default-config/lava-dispatcher/device-types/origen.conf 2012-11-30 15:53:29 +0000 | |||
| 142 | @@ -24,6 +24,11 @@ | |||
| 143 | 24 | setenv bootargs "'console=ttySAC2,115200n8 rootwait ro init=/init androidboot.console=ttySAC2'", | 24 | setenv bootargs "'console=ttySAC2,115200n8 rootwait ro init=/init androidboot.console=ttySAC2'", |
| 144 | 25 | boot | 25 | boot |
| 145 | 26 | 26 | ||
| 146 | 27 | |||
| 147 | 28 | boot_cmds_uefi = mmc init, | ||
| 148 | 29 | fatload mmc 0:5 0x43e00000 ORIGENBOARD_EFI.fd, | ||
| 149 | 30 | go 0x43e00000 | ||
| 150 | 31 | |||
| 151 | 27 | bootloader_prompt = # | 32 | bootloader_prompt = # |
| 152 | 28 | 33 | ||
| 153 | 29 | lmc_dev_arg = origen | 34 | lmc_dev_arg = origen |
| 154 | 30 | 35 | ||
| 155 | === modified file 'lava_dispatcher/device/fastmodel.py' | |||
| 156 | --- lava_dispatcher/device/fastmodel.py 2012-11-22 02:14:51 +0000 | |||
| 157 | +++ lava_dispatcher/device/fastmodel.py 2012-11-30 15:53:29 +0000 | |||
| 158 | @@ -97,6 +97,7 @@ | |||
| 159 | 97 | if not self._axf: | 97 | if not self._axf: |
| 160 | 98 | raise RuntimeError('No AXF found, %r' % os.listdir(subdir)) | 98 | raise RuntimeError('No AXF found, %r' % os.listdir(subdir)) |
| 161 | 99 | 99 | ||
| 162 | 100 | |||
| 163 | 100 | def deploy_android(self, boot, system, data): | 101 | def deploy_android(self, boot, system, data): |
| 164 | 101 | logging.info("Deploying Android on %s" % self.config.hostname) | 102 | logging.info("Deploying Android on %s" % self.config.hostname) |
| 165 | 102 | 103 | ||
| 166 | @@ -114,6 +115,13 @@ | |||
| 167 | 114 | 115 | ||
| 168 | 115 | self._customize_android() | 116 | self._customize_android() |
| 169 | 116 | 117 | ||
| 170 | 118 | ## UEFI ## | ||
| 171 | 119 | def deploy_uefi(self,bootfs,rootfs): | ||
| 172 | 120 | logging.info("[UEFI fast_model.py: deploy_uefi]: %s" % self.bootfs) | ||
| 173 | 121 | logging.info("[UEFI fast_model.py: deploy_uefi]: %s" % self.rootfs) | ||
| 174 | 122 | |||
| 175 | 123 | ## UEFI ## | ||
| 176 | 124 | |||
| 177 | 117 | def deploy_linaro(self, hwpack=None, rootfs=None, bootloader='u_boot'): | 125 | def deploy_linaro(self, hwpack=None, rootfs=None, bootloader='u_boot'): |
| 178 | 118 | hwpack = download_image(hwpack, self.context, decompress=False) | 126 | hwpack = download_image(hwpack, self.context, decompress=False) |
| 179 | 119 | rootfs = download_image(rootfs, self.context, decompress=False) | 127 | rootfs = download_image(rootfs, self.context, decompress=False) |
| 180 | 120 | 128 | ||
| 181 | === modified file 'lava_dispatcher/device/master.py' | |||
| 182 | --- lava_dispatcher/device/master.py 2012-11-30 01:57:34 +0000 | |||
| 183 | +++ lava_dispatcher/device/master.py 2012-11-30 15:53:29 +0000 | |||
| 184 | @@ -70,6 +70,7 @@ | |||
| 185 | 70 | Target.android_deployment_data['boot_cmds'] = 'boot_cmds_android' | 70 | Target.android_deployment_data['boot_cmds'] = 'boot_cmds_android' |
| 186 | 71 | Target.ubuntu_deployment_data['boot_cmds'] = 'boot_cmds' | 71 | Target.ubuntu_deployment_data['boot_cmds'] = 'boot_cmds' |
| 187 | 72 | Target.oe_deployment_data['boot_cmds'] = 'boot_cmds_oe' | 72 | Target.oe_deployment_data['boot_cmds'] = 'boot_cmds_oe' |
| 188 | 73 | Target.uefi_deployment_data['boot_cmds'] = 'boot_cmds_uefi' | ||
| 189 | 73 | 74 | ||
| 190 | 74 | # used for tarballcache logic to get proper boot_cmds | 75 | # used for tarballcache logic to get proper boot_cmds |
| 191 | 75 | Target.ubuntu_deployment_data['data_type'] = 'ubuntu' | 76 | Target.ubuntu_deployment_data['data_type'] = 'ubuntu' |
| 192 | @@ -78,6 +79,7 @@ | |||
| 193 | 78 | 'android': Target.android_deployment_data, | 79 | 'android': Target.android_deployment_data, |
| 194 | 79 | 'oe': Target.oe_deployment_data, | 80 | 'oe': Target.oe_deployment_data, |
| 195 | 80 | 'ubuntu': Target.ubuntu_deployment_data, | 81 | 'ubuntu': Target.ubuntu_deployment_data, |
| 196 | 82 | 'uefi': Target.uefi_deployment_data, | ||
| 197 | 81 | } | 83 | } |
| 198 | 82 | 84 | ||
| 199 | 83 | self.master_ip = None | 85 | self.master_ip = None |
| 200 | @@ -92,6 +94,12 @@ | |||
| 201 | 92 | self._boot_linaro_image() | 94 | self._boot_linaro_image() |
| 202 | 93 | return self.proc | 95 | return self.proc |
| 203 | 94 | 96 | ||
| 204 | 97 | ### UEFI | ||
| 205 | 98 | def uefi_power_on(self): | ||
| 206 | 99 | self._boot_linaro_uefi_image() | ||
| 207 | 100 | return self.proc | ||
| 208 | 101 | ### UEFI | ||
| 209 | 102 | |||
| 210 | 95 | def power_off(self, proc): | 103 | def power_off(self, proc): |
| 211 | 96 | # we always leave master image devices powered on | 104 | # we always leave master image devices powered on |
| 212 | 97 | pass | 105 | pass |
| 213 | @@ -104,6 +112,97 @@ | |||
| 214 | 104 | 112 | ||
| 215 | 105 | self._deploy_tarballs(boot_tgz, root_tgz) | 113 | self._deploy_tarballs(boot_tgz, root_tgz) |
| 216 | 106 | 114 | ||
| 217 | 115 | ## UEFI ## | ||
| 218 | 116 | def deploy_uefi(self,hwpack,rootfs): | ||
| 219 | 117 | logging.info("[UEFI master.py: deploy_uefi]: %s" % hwpack) | ||
| 220 | 118 | logging.info("[UEFI master.py: deploy_uefi]: %s" % rootfs) | ||
| 221 | 119 | self.boot_master_image() | ||
| 222 | 120 | |||
| 223 | 121 | self._deploy_uefi_tarballs(hwpack,rootfs) | ||
| 224 | 122 | |||
| 225 | 123 | |||
| 226 | 124 | |||
| 227 | 125 | def _deploy_uefi_bootfs(self,session, hwpack, timeout = 1,num_retry = 5): | ||
| 228 | 126 | logging.info("[UEFI master.py: deploy_uefi_bootfs") | ||
| 229 | 127 | session.run('udevadm trigger') | ||
| 230 | 128 | session.run('mkdir -p /mnt/boot') | ||
| 231 | 129 | session.run('mount /dev/disk/by-label/testboot /mnt/boot') | ||
| 232 | 130 | num_retry = 5 | ||
| 233 | 131 | while num_retry > 0: | ||
| 234 | 132 | try: | ||
| 235 | 133 | logging.info('Hwpack %s'% hwpack) | ||
| 236 | 134 | session.run('wget --no-check-certificate --no-proxy --connect-timeout=30 -S --progress=dot -e dotbytes=2M %s' | ||
| 237 | 135 | % (hwpack),timeout=-1) | ||
| 238 | 136 | session.run('tar --no-same-owner -xvf boot.tgz -C /mnt/boot/') | ||
| 239 | 137 | session.run('sudo rm -rf boot.tgz') | ||
| 240 | 138 | session.run('sudo umount /mnt/boot/') | ||
| 241 | 139 | return | ||
| 242 | 140 | except (OperationFailed, pexpect.TIMEOUT): | ||
| 243 | 141 | logging.warning(("transfering %s failed. %d retry left." | ||
| 244 | 142 | % (hwpack, num_retry - 1))) | ||
| 245 | 143 | |||
| 246 | 144 | if num_retry > 1: | ||
| 247 | 145 | # send CTRL C in case wget still hasn't exited. | ||
| 248 | 146 | self.proc.sendcontrol("c") | ||
| 249 | 147 | self.proc.sendline( | ||
| 250 | 148 | "echo 'retry left %s time(s)'" % (num_retry - 1)) | ||
| 251 | 149 | # And wait a little while. | ||
| 252 | 150 | sleep_time = 60 | ||
| 253 | 151 | logging.info("Wait %d second before retry" % sleep_time) | ||
| 254 | 152 | time.sleep(sleep_time) | ||
| 255 | 153 | num_retry = num_retry - 1 | ||
| 256 | 154 | |||
| 257 | 155 | raise RuntimeError('Deploying bootfs %s on target failed' % hwpack) | ||
| 258 | 156 | |||
| 259 | 157 | def _deploy_uefi_rootfs(self,session, rootfs, timeout = 1,num_retry = 5): | ||
| 260 | 158 | logging.info("[UEFI master.py: deploy_uefi_rootfs") | ||
| 261 | 159 | session.run('udevadm trigger') | ||
| 262 | 160 | session.run('mkdir -p /mnt/root') | ||
| 263 | 161 | session.run('mount /dev/disk/by-label/testrootfs /mnt/root') | ||
| 264 | 162 | num_retry = 5 | ||
| 265 | 163 | while num_retry > 0: | ||
| 266 | 164 | try: | ||
| 267 | 165 | logging.info('Hwpack %s' % rootfs) | ||
| 268 | 166 | session.run('wget --no-check-certificate --no-proxy --connect-timeout=30 -S --progress=dot -e dotbytes=2M %s' | ||
| 269 | 167 | % (rootfs),timeout=-1) | ||
| 270 | 168 | session.run('tar --no-same-owner -xvf root.tgz -C /mnt/root/') | ||
| 271 | 169 | session.run('sudo rm -rf root.tgz') | ||
| 272 | 170 | session.run('sudo umount /mnt/root/') | ||
| 273 | 171 | |||
| 274 | 172 | return | ||
| 275 | 173 | except (OperationFailed, pexpect.TIMEOUT): | ||
| 276 | 174 | logging.warning(("transfering %s failed. %d retry left." | ||
| 277 | 175 | % (rootfs, num_retry - 1))) | ||
| 278 | 176 | |||
| 279 | 177 | if num_retry > 1: | ||
| 280 | 178 | # send CTRL C in case wget still hasn't exited. | ||
| 281 | 179 | self.proc.sendcontrol("c") | ||
| 282 | 180 | self.proc.sendline( | ||
| 283 | 181 | "echo 'retry left %s time(s)'" % (num_retry - 1)) | ||
| 284 | 182 | # And wait a little while. | ||
| 285 | 183 | sleep_time = 60 | ||
| 286 | 184 | logging.info("Wait %d second before retry" % sleep_time) | ||
| 287 | 185 | time.sleep(sleep_time) | ||
| 288 | 186 | num_retry = num_retry - 1 | ||
| 289 | 187 | |||
| 290 | 188 | raise RuntimeError('Deploying bootfs %s on target failed' % rootfs) | ||
| 291 | 189 | |||
| 292 | 190 | def _deploy_uefi_tarballs(self,hwpack,rootfs): | ||
| 293 | 191 | logging.info("[UEFI master.py: _deploy_uefi_tarball]:") | ||
| 294 | 192 | with self._as_master() as master: | ||
| 295 | 193 | self._format_testpartition(master, 'ext3') | ||
| 296 | 194 | try: | ||
| 297 | 195 | self._deploy_uefi_rootfs(master, rootfs) | ||
| 298 | 196 | self._deploy_uefi_bootfs(master, hwpack) | ||
| 299 | 197 | except: | ||
| 300 | 198 | logging.error("Deployment failed") | ||
| 301 | 199 | tb = traceback.format_exc() | ||
| 302 | 200 | self.sio.write(tb) | ||
| 303 | 201 | raise CriticalError("Deployment failed") | ||
| 304 | 202 | |||
| 305 | 203 | self.deployment_data = Target.uefi_deployment_data | ||
| 306 | 204 | |||
| 307 | 205 | ## UEFI ## | ||
| 308 | 107 | def deploy_android(self, boot, system, userdata): | 206 | def deploy_android(self, boot, system, userdata): |
| 309 | 108 | self.boot_master_image() | 207 | self.boot_master_image() |
| 310 | 109 | 208 | ||
| 311 | @@ -459,14 +558,30 @@ | |||
| 312 | 459 | raise Exception("Faile to enter uboot") | 558 | raise Exception("Faile to enter uboot") |
| 313 | 460 | self.proc.sendline(self.config.interrupt_boot_command) | 559 | self.proc.sendline(self.config.interrupt_boot_command) |
| 314 | 461 | 560 | ||
| 315 | 561 | |||
| 316 | 462 | def _boot_linaro_image(self): | 562 | def _boot_linaro_image(self): |
| 317 | 463 | boot_cmds = self.deployment_data['boot_cmds'] | 563 | boot_cmds = self.deployment_data['boot_cmds'] |
| 318 | 464 | options = boot_options.as_dict(self) | 564 | options = boot_options.as_dict(self) |
| 319 | 465 | if 'boot_cmds' in options: | 565 | if 'boot_cmds' in options: |
| 320 | 466 | boot_cmds = options['boot_cmds'].value | 566 | boot_cmds = options['boot_cmds'].value |
| 324 | 467 | 567 | loggin.info (self.config) | |
| 325 | 468 | boot_cmds = getattr(self.config, boot_cmds) | 568 | boot_cmds = getattr(self.config, boot_cmds) |
| 326 | 469 | self._boot(string_to_list(boot_cmds.encode('ascii'))) | 569 | self._boot(string_to_list(boot_cmds.encode('ascii'))) |
| 327 | 570 | |||
| 328 | 571 | ### UEFI | ||
| 329 | 572 | def _boot_linaro_uefi_image(self): | ||
| 330 | 573 | self.deployment_data = Target.uefi_deployment_data | ||
| 331 | 574 | boot_cmds = self.deployment_data['boot_cmds'] | ||
| 332 | 575 | options = boot_options.as_dict(self) | ||
| 333 | 576 | if 'boot_cmds' in options: | ||
| 334 | 577 | boot_cmds = options['boot_cmds'].value | ||
| 335 | 578 | |||
| 336 | 579 | boot_cmds = getattr(self.config, boot_cmds) | ||
| 337 | 580 | self._boot(string_to_list(boot_cmds.encode('ascii'))) | ||
| 338 | 581 | |||
| 339 | 582 | |||
| 340 | 583 | ### UEFI | ||
| 341 | 584 | |||
| 342 | 470 | 585 | ||
| 343 | 471 | def _boot(self, boot_cmds): | 586 | def _boot(self, boot_cmds): |
| 344 | 472 | try: | 587 | try: |
| 345 | @@ -481,7 +596,6 @@ | |||
| 346 | 481 | self.proc.expect(self.config.bootloader_prompt, timeout=300) | 596 | self.proc.expect(self.config.bootloader_prompt, timeout=300) |
| 347 | 482 | self.proc.sendline(boot_cmds[line]) | 597 | self.proc.sendline(boot_cmds[line]) |
| 348 | 483 | 598 | ||
| 349 | 484 | |||
| 350 | 485 | target_class = MasterImageTarget | 599 | target_class = MasterImageTarget |
| 351 | 486 | 600 | ||
| 352 | 487 | 601 | ||
| 353 | 488 | 602 | ||
| 354 | === modified file 'lava_dispatcher/device/target.py' | |||
| 355 | --- lava_dispatcher/device/target.py 2012-11-15 21:23:20 +0000 | |||
| 356 | +++ lava_dispatcher/device/target.py 2012-11-30 15:53:29 +0000 | |||
| 357 | @@ -62,6 +62,9 @@ | |||
| 358 | 62 | 'TESTER_PS1_PATTERN': "linaro-test \[rc=(\d+)\]# ", | 62 | 'TESTER_PS1_PATTERN': "linaro-test \[rc=(\d+)\]# ", |
| 359 | 63 | 'TESTER_PS1_INCLUDES_RC': True, | 63 | 'TESTER_PS1_INCLUDES_RC': True, |
| 360 | 64 | } | 64 | } |
| 361 | 65 | uefi_deployment_data = { | ||
| 362 | 66 | 'TESTER_PS1_INCLUDES_RC': True, | ||
| 363 | 67 | } | ||
| 364 | 65 | 68 | ||
| 365 | 66 | def __init__(self, context, device_config): | 69 | def __init__(self, context, device_config): |
| 366 | 67 | self.context = context | 70 | self.context = context |
Hey Guys,
I turned this into a proper merge proposal on LP so we have a way to
discuss the changes. My comments are below, basically - I'm pretty sure
we can dramatically simplify this to be a very small change (my guess
<15 lines of code).
On 11/30/2012 09:54 AM, Andy Doan wrote: r/actions/ boot_control. py' /actions/ boot_control. py 2012-11-20 21:22:17 +0000 /actions/ boot_control. py 2012-11-30 15:53:29 +0000 test_data. add_result( "boot_image" , status) linaro_ uefi_image( BaseAction) : options= []): target_ device. boot_options = options boot_linaro_ uefi_image( ) exception( "boot_linaro_ image failed") "Failed to boot uefi test image.") test_data. add_result( "boot_uefi_ image", status)
> === modified file 'lava_dispatche
> --- lava_dispatcher
> +++ lava_dispatcher
> @@ -70,6 +70,28 @@
> finally:
> self.context.
>
> +### UEFI
> +
> +class cmd_boot_
> + """ Call client code to boot to the master image
> + """
> +
> + parameters_schema = _boot_schema
> +
> + def run(self,
> + client = self.client
> + client.
> + status = 'pass'
> + try:
> + client.
> + except:
> + logging.
> + status = 'fail'
> + raise CriticalError(
> + finally:
> + self.context.
> +
> +### UEFI
I don't think this is needed. See my comments for the deploy logic in
master.py below.
> === modified file 'lava_dispatche r/actions/ deploy. py' /actions/ deploy. py 2012-11-20 13:34:19 +0000 /actions/ deploy. py 2012-11-30 15:53:29 +0000 deploy_ linaro_ android( boot, system, data, rootfstype) linaro_ uefi_image( BaseAction) : :'string' ,'optional' : True}, :'string' ,'optional' : True}, erties' : False, deploy_ linaro_ uefi(hwpack, rootfs)
> --- lava_dispatcher
> +++ lava_dispatcher
> @@ -91,6 +91,20 @@
> def run(self, boot, system, data, rootfstype='ext4'):
> self.client.
>
> +## UEFI ##
> +class cmd_deploy_
> + parameters_schema = {
> + 'type': 'object',
> + 'properties' : {
> + 'hwpack': {'type'
> + 'rootfs' : {'type'
> + },
> + 'additionalProp
> + }
> +
> + def run(self, hwpack, rootfs):
> + self.client.
> +## UEFI ##
I don't think this is needed. See my comments for the deploy logic in
master.py below.
> === modified file 'lava_dispatche r/client/ base.py' /client/ base.py 2012-11-29 08:54:47 +0000 /client/ base.py 2012-11-30 15:53:29 +0000 proxy(TESTER_ PS1_PATTERN) info("System is in test image now") uefi_image( self): linaro_ uefi_image( ) prompt( self.proc, '/bin/sh' , timeout=300) info("System is in test image now")
> --- lava_dispatcher
> +++ lava_dispatcher
> @@ -402,6 +402,20 @@
> self.setup_
> logging.
>
> +### UEFI
> + def boot_linaro_
> + """
> + Reboot the system to the uefi test image
> + """
> + logging.info("Boot the uefi test image")
> +
> + self._boot_
> +
> + wait_for_
> + logging.
> +
> +### UEFI
> +
I don't think this is needed. See my comments for the deploy logic in
master.py below.
> === modified file 'lava_dispatche r/client/ targetdevice. py' /client/ targetdevice. py 2012-11-21 22:07:45 +0000
> --- lava_dispatcher
> +++ lava_dis...