Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(769)

Unified Diff: src/platform/dev/autoupdate.py

Issue 1604014: Fix devserver to unpack rootfs and serve it. (Closed)
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/dev/autoupdate.py
diff --git a/src/platform/dev/autoupdate.py b/src/platform/dev/autoupdate.py
index 240e3a2fe795e9249b9831bf14194229ddce1f69..2c2a39ac968115eefd22c7759d270d70bd618dd7 100644
--- a/src/platform/dev/autoupdate.py
+++ b/src/platform/dev/autoupdate.py
@@ -73,11 +73,29 @@ class Autoupdate(BuildObject):
return int(latest_tokens[i]) > int(client_tokens[i])
return False
+ def UnpackRootfs(self, image_path, rootfs_file):
+ if os.path.exists(rootfs_file):
+ return True
+ if self.test_image:
+ image_file = 'chromiumos_test_image.bin'
+ else:
+ image_file = 'chromiumos_image.bin'
+ os.system('rm -f %s/part_*' % image_path)
+ os.system('cd %s && ./unpack_partitions.sh %s' % (image_path, image_file))
+ shutil.move(os.path.join(image_path, 'part_3'), rootfs_file)
+ os.system('rm -f %s/part_*' % image_path)
+ return True
+
def BuildUpdateImage(self, image_path):
if self.test_image:
image_file = '%s/rootfs_test.image' % image_path
else:
image_file = '%s/rootfs.image' % image_path
+
+ if not self.UnpackRootfs(image_path, image_file):
+ web.debug('failed to unpack rootfs.')
+ return False
+
update_file = '%s/update.gz' % image_path
if (os.path.exists(update_file) and
os.path.getmtime(update_file) >= os.path.getmtime(image_file)):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698