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).
This seems bad, why not just do
+ boot_cmds_uefi = schema.StringOption(default='')
Then you don't have to make a change to device-defaults.conf below.
Also - drop the "#UEFI" comments - we have revision control for a reason.
I don't think you need this function or the ones it calls. These deploy
functions, they look identical to the current, _deploy_linaro_bootfs and
_deploy_linaro_rootfs functions we already have in the module. On top of
that, I don't think you even need your own deploy function. You should
be able to use the current deploy_linaro and not even need a new action
defined for UEFI. All you are really doing differently is setting:
I think you could patch this function to look at boot directory - if it
has UEFI, you could then set deployment_data to use your UEFI boot commands.
I could see a case where you might have an image with both and want to
be able to specify which bootloader to use. In that case we already have
a mechanism for you:
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 /client/ targetdevice. py 2012-11-30 15:53:29 +0000 linaro_ android( self, boot, system, data, rootfstype='ext4'): device. deploy_ android( boot, system, data) linaro_ uefi(self, hwpack, rootfs) : device. deploy_ uefi(hwpack, rootfs)
> --- lava_dispatcher
> +++ lava_dispatcher
> @@ -50,6 +50,10 @@
> def deploy_
> self.target_
>
> +## UEFI ##
> + def deploy_
> + self.target_
> +## UEFI ##
I don't think this is needed. See my comments for the deploy logic in
master.py below.
> def deploy_linaro(self, hwpack=None, rootfs=None, image=None, 'u_boot' ): image(self) : device. power_on( ) uefi_image( self): device. uefi_power_ on()
> rootfstype='ext3', bootloader=
> if image is None:
> @@ -68,6 +72,11 @@
> def _boot_linaro_
> self.proc = self.target_
>
> +### UEFI
> + def _boot_linaro_
> + self.proc = self.target_
> +
> +### UEFI
I don't think this is needed. See my comments for the deploy logic in
master.py below.
> === modified file 'lava_dispatche r/config. py' /config. py 2012-11-30 01:54:29 +0000 /config. py 2012-11-30 15:53:29 +0000 version_ command = schema. StringOption( ) StringOption( ) StringOption( fatal=True) ### UEFI
> --- lava_dispatcher
> +++ lava_dispatcher
> @@ -73,6 +73,7 @@
> simulator_
> simulator_command = schema.
> simulator_axf_files = schema.ListOption()
> + boot_cmds_uefi = schema.
This seems bad, why not just do StringOption( default= '') defaults. conf below.
+ boot_cmds_uefi = schema.
Then you don't have to make a change to device-
Also - drop the "#UEFI" comments - we have revision control for a reason.
> === modified file 'lava_dispatche r/default- config/ lava-dispatcher /device- defaults. conf' /default- config/ lava-dispatcher /device- defaults. conf 2012-11-30 01:54:29 +0000 /default- config/ lava-dispatcher /device- defaults. conf 2012-11-30 15:53:29 +0000 test_image_ commands ?
> --- lava_dispatcher
> +++ lava_dispatcher
> @@ -34,6 +34,11 @@
> # XXX should be called # boot_oe_
> boot_cmds_oe =
>
> +
> +### UEFI
> +boot_cmds_uefi =
> +### UEFI
> +
Not needed as described above in config.py
> === modified file 'lava_dispatche r/device/ fastmodel. py'
Not sure why you made changes here? This looks like a no-op. I think
they should be dropped.
> === modified file 'lava_dispatche r/device/ master. py'
Now for the fun part :)
> --- lava_dispatcher /device/ master. py 2012-11-30 01:57:34 +0000 /device/ master. py 2012-11-30 15:53:29 +0000 android_ deployment_ data['boot_ cmds'] = 'boot_cmds_android' ubuntu_ deployment_ data['boot_ cmds'] = 'boot_cmds' oe_deployment_ data['boot_ cmds'] = 'boot_cmds_oe' uefi_deployment _data[' boot_cmds' ] = 'boot_cmds_uefi'
> +++ lava_dispatcher
> @@ -70,6 +70,7 @@
> Target.
> Target.
> Target.
> + Target.
>
might not be needed, see below
> # used for tarballcache logic to get proper boot_cmds ubuntu_ deployment_ data['data_ type'] = 'ubuntu' android_ deployment_ data, oe_deployment_ data, ubuntu_ deployment_ data, uefi_deployment _data,
> Target.
> @@ -78,6 +79,7 @@
> 'android': Target.
> 'oe': Target.
> 'ubuntu': Target.
> + 'uefi': Target.
> }
might not be needed, see below
> @@ -92,6 +94,12 @@ linaro_ image() on(self) : linaro_ uefi_image( )
> self._boot_
> return self.proc
>
> +### UEFI
> + def uefi_power_
> + self._boot_
> + return self.proc
> +### UEFI
> +
Not needed see below
> @@ -104,6 +112,97 @@ tarballs( boot_tgz, root_tgz) uefi(self, hwpack, rootfs) : master_ image() uefi_tarballs( hwpack, rootfs)
>
> self._deploy_
>
> +## UEFI ##
> + def deploy_
> + logging.info("[UEFI master.py: deploy_uefi]: %s" % hwpack)
> + logging.info("[UEFI master.py: deploy_uefi]: %s" % rootfs)
> + self.boot_
> +
> + self._deploy_
I don't think you need this function or the ones it calls. These deploy linaro_ bootfs and linaro_ rootfs functions we already have in the module. On top of
functions, they look identical to the current, _deploy_
_deploy_
that, I don't think you even need your own deploy function. You should
be able to use the current deploy_linaro and not even need a new action
defined for UEFI. All you are really doing differently is setting:
self. deployment_ data = Target. uefi_deployment _data
This gets set by our currently deployment logic in:
lava_ dispatcher. device. target: Target. _customize_ linux
I think you could patch this function to look at boot directory - if it
has UEFI, you could then set deployment_data to use your UEFI boot commands.
I could see a case where you might have an image with both and want to
be able to specify which bootloader to use. In that case we already have
a mechanism for you:
#for your job's json file:
"command" : "boot_linaro_ image", cmds=boot_ cmds_uefi" ]
{
"parameters": {
"options": ["boot_
}
},