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

Unified Diff: build_image

Issue 5704004: Zero free space on rootfs so it's more compressible for auto-update (Closed) Base URL: http://git.chromium.org/git/crosutils.git@master
Patch Set: Created 10 years 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: build_image
diff --git a/build_image b/build_image
index 722d704f96f5ad70ccc30b8af16b78afa1dad360..1616d5dd349708506646b50f92473b85c1dee2da 100755
--- a/build_image
+++ b/build_image
@@ -503,6 +503,13 @@ update_base_packages() {
-s "${STATEFUL_FS_DIR}" -e "${ESP_FS_DIR}"
}
+zero_freespace() {
petkov 2010/12/11 00:25:44 zero_free_space?
thieule 2010/12/11 00:54:35 Done.
+ local fs_mount_point=$1
+ info "Zeroing freespace in ${fs_mount_point}"
+ sudo dd if=/dev/zero of="${fs_mount_point}/filler" oflag=sync || \
petkov 2010/12/11 00:25:44 this seems strange, especially with || instead of
thieule 2010/12/11 00:54:35 Done. The oflag is required to force the writes t
+ sudo rm "${fs_mount_point}/filler" || sudo sync
+}
+
create_base_image() {
local image_name=$1
@@ -683,6 +690,10 @@ create_base_image() {
# Create an empty esp image to be updated in by update_bootloaders.sh.
${SCRIPTS_DIR}/create_esp.sh --to="${ESP_FS_IMG}"
+ # Zero rootfs free space to make it more compressible so auto-update
+ # packages become smaller
petkov 2010/12/11 00:25:44 s/packages/payloads/
thieule 2010/12/11 00:54:35 Done.
+ zero_freespace "${ROOT_FS_DIR}"
+
cleanup
trap delete_prompt EXIT
« 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