diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 473: update the source for mount partitions of android and make it a little flexible

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

Commit Message

Yongqin Liu Nov. 30, 2012, 8:53 a.m. UTC
Merge authors:
  Yongqin Liu (liuyq0307)
Related merge proposals:
  https://code.launchpad.net/~liuyq0307/lava-dispatcher/update-mount-partitions/+merge/137106
  proposed by: Yongqin Liu (liuyq0307)
  review: Approve - Andy Doan (doanac)
  https://code.launchpad.net/~liuyq0307/lava-dispatcher/test-bootloader/+merge/123225
  proposed by: Yongqin Liu (liuyq0307)
  https://code.launchpad.net/~liuyq0307/lava-dispatcher/deployment-for-omapzoom-aosp/+merge/114553
  proposed by: Yongqin Liu (liuyq0307)
  review: Approve - Michael Hudson-Doyle (mwhudson)
------------------------------------------------------------
revno: 473 [merge]
committer: Yongqin Liu <yongqin.liu@linaro.org>
branch nick: lava-dispatcher
timestamp: Fri 2012-11-30 16:51:45 +0800
message:
  update the source for mount partitions of android and make it a little flexible
modified:
  lava_dispatcher/config.py
  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-11-16 00:47:20 +0000
+++ lava_dispatcher/config.py	2012-11-30 01:54:29 +0000
@@ -66,6 +66,9 @@ 
     sys_part_android_org = schema.IntOption()
     val = schema.StringOption()
     sdcard_mountpoint_path = schema.StringOption(default="/storage/sdcard0")
+    possible_partitions_files = schema.ListOption(default=["init.partitions.rc",
+                                                           "fstab.partitions",
+                                                           "init.rc"])
 
     simulator_version_command = schema.StringOption()
     simulator_command = schema.StringOption()

=== modified file 'lava_dispatcher/device/master.py'
--- lava_dispatcher/device/master.py	2012-11-21 22:07:45 +0000
+++ lava_dispatcher/device/master.py	2012-11-30 01:57:34 +0000
@@ -592,7 +592,7 @@ 
     data_part_lava = session._client.config.data_part_android
 
     session.run(
-        'sed -i "/mount ext4 \/dev\/block\/mmcblk0p%s/d" %s'
+        'sed -i "/\/dev\/block\/mmcblk0p%s/d" %s'
         % (cache_part_org, rc_filename), failok=True)
 
     session.run('sed -i "s/mmcblk0p%s/mmcblk0p%s/g" %s'
@@ -617,17 +617,20 @@ 
     session.run('mv uInitrd.data ramdisk.cpio.gz')
     session.run('gzip -d -f ramdisk.cpio.gz; cpio -i -F ramdisk.cpio')
 
+    session.run(
+        'sed -i "/export PATH/a \ \ \ \ export PS1 \'%s\'" init.rc' %
+        target.ANDROID_TESTER_PS1)
+
     # The mount partitions have moved from init.rc to init.partitions.rc
     # For backward compatible with early android build, we update both rc files
-    _update_uInitrd_partitions(session, 'init.rc')
-    _update_uInitrd_partitions(session, 'init.partitions.rc')
-
-    session.run(
-        'sed -i "/export PATH/a \ \ \ \ export PS1 \'%s\'" init.rc' %
-        target.ANDROID_TESTER_PS1)
-
-    session.run("cat init.rc")
-    session.run("cat init.partitions.rc", failok=True)
+    # For omapzoom and aosp and JB4.2 the operation for mounting partitions are
+    # in init.omap4pandaboard.rc and fstab.* files
+    possible_partitions_files = session._client.config.possible_partitions_files
+
+    for f in possible_partitions_files:
+        if session.is_file_exist(f):
+            _update_uInitrd_partitions(session, f)
+            session.run("cat %s" % f, failok=True)
 
     session.run('cpio -i -t -F ramdisk.cpio | cpio -o -H newc | \
             gzip > ramdisk_new.cpio.gz')