diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 496: clean up master's _update_uInitrd_partitions logic

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

Commit Message

Andy Doan Dec. 13, 2012, 10:22 p.m. UTC
------------------------------------------------------------
revno: 496
committer: Andy Doan <andy.doan@linaro.org>
branch nick: android-fixes
timestamp: Thu 2012-12-13 15:23:55 -0600
message:
  clean up master's _update_uInitrd_partitions logic
  
  There's code that tried one mmc block and let errors pass, and
  then tried another block. Instead, let's change to allow the proper
  block to be specified in config
modified:
  lava_dispatcher/config.py
  lava_dispatcher/default-config/lava-dispatcher/device-types/snowball.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	2012-12-13 20:02:55 +0000
+++ lava_dispatcher/config.py	2012-12-13 21:23:55 +0000
@@ -79,6 +79,8 @@ 
     android_adb_over_tcp = schema.BoolOption(default=True)
     android_wait_for_home_screen = schema.BoolOption(default=True)
     android_home_screen_tries = schema.IntOption(default=100)
+    android_orig_block_device = schema.StringOption(default="mmcblk0")
+    android_lava_block_device = schema.StringOption(default="mmcblk0")
 
 
 class OptionDescriptor(object):

=== modified file 'lava_dispatcher/default-config/lava-dispatcher/device-types/snowball.conf'
--- lava_dispatcher/default-config/lava-dispatcher/device-types/snowball.conf	2012-07-05 06:23:27 +0000
+++ lava_dispatcher/default-config/lava-dispatcher/device-types/snowball.conf	2012-12-13 21:23:55 +0000
@@ -24,3 +24,5 @@ 
     echo 0x01 > /sys/kernel/debug/ab8500/register-address 
     echo 0x11 > /sys/kernel/debug/ab8500/register-value
 
+android_orig_block_device = mmcblk1
+android_lava_block_device = mmcblk1

=== modified file 'lava_dispatcher/device/master.py'
--- lava_dispatcher/device/master.py	2012-12-06 14:14:14 +0000
+++ lava_dispatcher/device/master.py	2012-12-13 21:23:55 +0000
@@ -618,19 +618,16 @@ 
     sys_part_lava = session._client.config.sys_part_android
     data_part_lava = session._client.config.data_part_android
 
-    session.run(
-        'sed -i "/\/dev\/block\/mmcblk0p%s/d" %s'
-        % (cache_part_org, rc_filename), failok=True)
+    # delete use of cache partition
+    session.run('sed -i "/\/dev\/block\/mmcblk0p%s/d" %s'
+                % (cache_part_org, rc_filename))
 
-    session.run('sed -i "s/mmcblk0p%s/mmcblk0p%s/g" %s'
-        % (data_part_org, data_part_lava, rc_filename), failok=True)
-    session.run('sed -i "s/mmcblk0p%s/mmcblk0p%s/g" %s'
-        % (sys_part_org, sys_part_lava, rc_filename), failok=True)
-    # for snowball the mcvblk1 is used instead of mmcblk0.
-    session.run('sed -i "s/mmcblk1p%s/mmcblk1p%s/g" %s'
-        % (data_part_org, data_part_lava, rc_filename), failok=True)
-    session.run('sed -i "s/mmcblk1p%s/mmcblk1p%s/g" %s'
-        % (sys_part_org, sys_part_lava, rc_filename), failok=True)
+    blkorg = session._client.config.android_orig_block_device
+    blklava = session._client.config.android_lava_block_device
+    session.run('sed -i "s/%sp%s/%sp%s/g" %s'
+                % (blkorg, data_part_org, blklava, data_part_lava, rc_filename))
+    session.run('sed -i "s/%sp%s/%sp%s/g" %s'
+                % (blkorg, sys_part_org, blklava, sys_part_lava, rc_filename))
 
 
 def _recreate_uInitrd(session, target):