diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 268: Fix boot android image problem caused by changing of init.rc file (ChiThu)

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

Commit Message

Michael-Doyle Hudson April 1, 2012, 8:39 p.m. UTC
Merge authors:
  Le Chi Thu le.chi.thu@linaro.org <le.chi.thu@linaro.org>
Related merge proposals:
  https://code.launchpad.net/~le-chi-thu/lava-dispatcher/fix-android-boot-problem/+merge/100275
  proposed by: Le Chi Thu (le-chi-thu)
  review: Approve - Zygmunt Krynicki (zkrynicki)
------------------------------------------------------------
revno: 268 [merge]
committer: Michael Hudson-Doyle <michael.hudson@linaro.org>
branch nick: trunk
timestamp: Mon 2012-04-02 08:36:53 +1200
message:
  Fix boot android image problem caused by changing of init.rc file (ChiThu)
modified:
  doc/changes.rst
  lava_dispatcher/client/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 'doc/changes.rst'
--- doc/changes.rst	2012-03-27 01:33:15 +0000
+++ doc/changes.rst	2012-04-01 20:36:53 +0000
@@ -5,6 +5,7 @@ 
 
 Version 0.5.11
 ==============
+* Fixed boot android image problem caused by changing of init.rc file.
 * Add qemu_drive_interface configuration option for the LAVA QEMU client.
 
 .. _version_0_5_10:

=== modified file 'lava_dispatcher/client/master.py'
--- lava_dispatcher/client/master.py	2012-03-20 06:59:13 +0000
+++ lava_dispatcher/client/master.py	2012-03-31 09:42:26 +0000
@@ -116,10 +116,7 @@ 
 
     _recreate_uInitrd(session)
 
-    session.run('umount /mnt/lava/boot')
-
-def _recreate_uInitrd(session):
-    logging.debug("Recreate uInitrd")
+def _update_uInitrd_partitions(session, rc_filename):
     # Original android sdcard partition layout by l-a-m-c
     sys_part_org = session._client.device_option("sys_part_android_org")
     cache_part_org = session._client.device_option("cache_part_android_org")
@@ -128,6 +125,23 @@ 
     sys_part_lava = session._client.device_option("sys_part_android")
     data_part_lava = session._client.device_option("data_part_android")
 
+    session.run(
+        'sed -i "/mount ext4 \/dev\/block\/mmcblk0p%s/d" %s'
+        % (cache_part_org, rc_filename), failok=True)
+
+    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)
+
+def _recreate_uInitrd(session):
+    logging.debug("Recreate uInitrd")
+
     session.run('mkdir -p ~/tmp/')
     session.run('mv /mnt/lava/boot/uInitrd ~/tmp')
     session.run('cd ~/tmp/')
@@ -136,26 +150,17 @@ 
     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 "/mount ext4 \/dev\/block\/mmcblk0p%s/d" init.rc'
-        % cache_part_org)
-#    session.run(
-#        'sed -i "/mount ext4 \/dev\/block\/mmcblk0p%s/d" init.rc'
-#        % data_part_org)
-    session.run('sed -i "s/mmcblk0p%s/mmcblk0p%s/g" init.rc'
-        % (data_part_org, data_part_lava))
-    session.run('sed -i "s/mmcblk0p%s/mmcblk0p%s/g" init.rc'
-        % (sys_part_org, sys_part_lava))
-    # for snowball the mcvblk1 is used instead of mmcblk0.
-    session.run('sed -i "s/mmcblk1p%s/mmcblk1p%s/g" init.rc'
-        % (data_part_org, data_part_lava))
-    session.run('sed -i "s/mmcblk1p%s/mmcblk1p%s/g" init.rc'
-        % (sys_part_org, sys_part_lava))
-    # failok true for this?:
+
+    # The mount partitions have moved from init.rc to init.partitions.rc
+    # For backward compatible with early android build, we updatep 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 root@linaro: " init.rc')
 
     session.run("cat init.rc")
+    session.run("cat init.partitions.rc", failok=True)
 
     session.run(
         'cpio -i -t -F ramdisk.cpio | cpio -o -H newc | \