termina_build_image: switch to 4096 block size
This will allow the rootfs image to be placed on block devices with
4096-byte block size (the previous filesystem block size was 1024, which
limits the possible block device block size to <= 1024, 512 in practice).
The initial image size needs to be increased slightly so the test image
will fit - it was already barely fitting into 400 MB, and switching to
4096-byte blocks slightly increases the overhead for small files.
BUG=chromium:942700
TEST=Deploy termina image generated with new script and boot Crostini
Change-Id: Ic821d5657a44e228b7275fb45177a42ab977c31c
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1526258
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
diff --git a/termina_build_image b/termina_build_image
index 067e124..e34f348 100755
--- a/termina_build_image
+++ b/termina_build_image
@@ -160,10 +160,10 @@
sudo mksquashfs "${rootfs}" "${rootfs_img}" -comp lzo
;;
ext4)
- # Start with 400MB, then shrink.
- local image_size=400
+ # Start with 410MB, then shrink.
+ local image_size=410
truncate --size "${image_size}M" "${rootfs_img}"
- /sbin/mkfs.ext4 -F -m 0 -i 16384 -b 1024 -O "^has_journal" "${rootfs_img}"
+ /sbin/mkfs.ext4 -F -m 0 -i 16384 -b 4096 -O "^has_journal" "${rootfs_img}"
local rootfs_mnt="$(mktemp -d)"
fs_mount "${rootfs_img}" "${rootfs_mnt}" ext4 rw
sudo cp -aT "${rootfs}" "${rootfs_mnt}"