diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 593: Improvements on reading boot commands from image + vexpress fix

Message ID 20130502220024.4538.91580.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Antonio Terceiro May 2, 2013, 10 p.m. UTC
Merge authors:
  Antonio Terceiro (terceiro)
Related merge proposals:
  https://code.launchpad.net/~terceiro/lava-dispatcher/optional-boot-commands-from-image/+merge/162257
  proposed by: Antonio Terceiro (terceiro)
  review: Approve - Tyler Baker (tyler-baker)
------------------------------------------------------------
revno: 593 [merge]
committer: Antonio Terceiro <antonio.terceiro@linaro.org>
branch nick: trunk
timestamp: Thu 2013-05-02 18:59:11 -0300
message:
  Improvements on reading boot commands from image + vexpress fix
modified:
  lava_dispatcher/config.py
  lava_dispatcher/default-config/lava-dispatcher/device-types/vexpress-tc2.conf
  lava_dispatcher/device/master.py


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_dispatcher/config.py'
--- lava_dispatcher/config.py	2013-04-29 10:31:06 +0000
+++ lava_dispatcher/config.py	2013-05-02 21:43:14 +0000
@@ -32,6 +32,7 @@ 
     boot_cmds = schema.StringOption(fatal=True)  # Can do better here
     boot_cmds_android = schema.StringOption(fatal=True)  # And here
     boot_cmds_oe = schema.StringOption(fatal=True)  # And here?
+    read_boot_cmds_from_image = schema.BoolOption(default=True)
     boot_options = schema.ListOption()
     boot_linaro_timeout = schema.IntOption(default=300)
     boot_part = schema.IntOption(fatal=True)

=== modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/vexpress-tc2.conf'
--- lava_dispatcher/default-config/lava-dispatcher/device-types/vexpress-tc2.conf	2013-02-27 21:10:47 +0000
+++ lava_dispatcher/default-config/lava-dispatcher/device-types/vexpress-tc2.conf	2013-05-02 21:43:14 +0000
@@ -25,3 +25,5 @@ 
 vexpress_uefi_backup_path = SOFTWARE/TC2/backup-uefi.bin
 
 vexpress_usb_mass_storage_device = /dev/disk/by-label/VEMSD
+
+read_boot_cmds_from_image = 0

=== modified file 'lava_dispatcher/device/master.py'
--- lava_dispatcher/device/master.py	2013-04-30 11:45:15 +0000
+++ lava_dispatcher/device/master.py	2013-05-02 21:43:14 +0000
@@ -204,6 +204,9 @@ 
     def _read_boot_cmds(self, image=None, boot_tgz=None):
         boot_file_path = None
 
+        if not self.config.read_boot_cmds_from_image:
+            return
+
         # If we have already obtained boot commands dynamically, then return.
         if self.deployment_data.get('boot_cmds_dynamic', False):
             logging.debug("We already have boot commands in place.")
@@ -480,17 +483,22 @@ 
 
     def _boot_linaro_image(self):
         boot_cmds = self.deployment_data['boot_cmds']
+        boot_cmds_override = False
 
         options = boot_options.as_dict(self, defaults={'boot_cmds': boot_cmds})
         if 'boot_cmds' in options:
+            boot_cmds_override = True
             boot_cmds = options['boot_cmds'].value
 
         logging.info('boot_cmds attribute: %s', boot_cmds)
 
         # Check if we have already got some values from image's boot file.
-        if self.deployment_data.get('boot_cmds_dynamic'):
+        if self.deployment_data.get('boot_cmds_dynamic') \
+           and not boot_cmds_override:
+            logging.info('Loading boot_cmds from image')
             boot_cmds = self.deployment_data['boot_cmds_dynamic']
         else:
+            logging.info('Loading boot_cmds from device configuration')
             boot_cmds = self.config.cp.get('__main__', boot_cmds)
             boot_cmds = string_to_list(boot_cmds.encode('ascii'))