Bug 818569 - Stop B2G before updating gecko, r=ahal
authorJonathan Griffin <jgriffin@mozilla.com>
Fri, 07 Dec 2012 14:44:55 -0800
changeset 126438 21c0b3fbad22599be180251dfdc767be7dcfaf4d
parent 126437 067e0c9943e327b8927d5f1f5b9c99ebeddb01d1
child 126439 a6a26c14f5e45d61662ea8f29d04b24506546798
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs818569
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 818569 - Stop B2G before updating gecko, r=ahal
testing/marionette/client/marionette/emulator.py
--- a/testing/marionette/client/marionette/emulator.py
+++ b/testing/marionette/client/marionette/emulator.py
@@ -384,29 +384,47 @@ waitFor(
         push_attempts = 10
 
         print 'installing gecko binaries...'
 
         # see bug 809437 for the path that lead to this madness
         try:
             # need to remount so we can write to /system/b2g
             self._run_adb(['remount'])
+            self.dm.removeDir('/data/local/b2g')
+            self.dm.mkDir('/data/local/b2g')
             for root, dirs, files in os.walk(gecko_path):
                 for filename in files:
                     rel_path = os.path.relpath(os.path.join(root, filename), gecko_path)
-                    system_b2g_file = os.path.join('/system/b2g', rel_path)
+                    data_local_file = os.path.join('/data/local/b2g', rel_path)
                     for retry in range(1, push_attempts + 1):
-                        print 'pushing', system_b2g_file, '(attempt %s of %s)' % (retry, push_attempts)
+                        print 'pushing', data_local_file, '(attempt %s of %s)' % (retry, push_attempts)
                         try:
-                            self.dm.pushFile(os.path.join(root, filename), system_b2g_file)
+                            self.dm.pushFile(os.path.join(root, filename), data_local_file)
                             break
                         except DMError:
                             if retry == push_attempts:
                                 raise
 
+            self.dm.shellCheckOutput(['stop', 'b2g'])
+
+            for root, dirs, files in os.walk(gecko_path):
+                for filename in files:
+                    rel_path = os.path.relpath(os.path.join(root, filename), gecko_path)
+                    data_local_file = os.path.join('/data/local/b2g', rel_path)
+                    system_b2g_file = os.path.join('/system/b2g', rel_path)
+                    print 'copying', data_local_file, 'to', system_b2g_file
+                    try:
+                        self.dm.shellCheckOutput(['dd',
+                                                  'if=%s' % data_local_file,
+                                                  'of=%s' % system_b2g_file])
+                    except DMError:
+                        if retry == push_attempts:
+                            raise
+
             self.restart_b2g()
 
         except (DMError, MarionetteException):
             # Bug 812395 - raise a single exception type for these so we can
             # explicitly catch them elsewhere.
 
             # print exception, but hide from mozharness error detection
             exc = traceback.format_exc()