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

Unified Diff: build_image

Issue 3048009: build_image: avoid losetup -c because older kernels seem to balk (Closed) Base URL: http://src.chromium.org/git/crosutils.git
Patch Set: fix extra line Created 10 years, 5 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: build_image
diff --git a/build_image b/build_image
index 0f8324bd006d2bcad268e79b491e87bd81409db1..c1505c76d29eee819790ee13af6d80daaf3b2454 100755
--- a/build_image
+++ b/build_image
@@ -532,18 +532,15 @@ create_base_image() {
ROOT_SIZE_BYTES=$((1024 * 1024 * ${FLAGS_rootfs_size}))
fi
- dd if=/dev/zero of="${ROOT_FS_IMG}" bs=1 count=1 seek=$((ROOT_SIZE_BYTES - 1))
- sudo losetup "${LOOP_DEV}" "${ROOT_FS_IMG}"
- sudo mkfs.ext3 "${LOOP_DEV}"
-
- # Pad out 10% for the hash tree. This currently _exact_ for
- # default configuration. More space may be needed for different options.
+ # Pad out for the hash tree.
ROOT_HASH_PAD=$((FLAGS_rootfs_hash_pad * 1024 * 1024))
info "Padding the rootfs image by ${ROOT_HASH_PAD} bytes for hash data"
+
dd if=/dev/zero of="${ROOT_FS_IMG}" bs=1 count=1 \
seek=$((ROOT_SIZE_BYTES + ROOT_HASH_PAD - 1))
- # Update to reflect the new capacity in the loop device.
- sudo losetup -c "${LOOP_DEV}"
+ sudo losetup "${LOOP_DEV}" "${ROOT_FS_IMG}"
+ # Specify a block size and block count to avoid using the hash pad.
+ sudo mkfs.ext3 -b 4096 "${LOOP_DEV}" "$((ROOT_SIZE_BYTES / 4096))"
# Tune and mount rootfs.
# TODO(wad) rename the disk label to match the GPT since we
« 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