From 6f693f04c27c047b49b283a9f3b0760814b4905f Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 29 Nov 2018 13:22:15 -0800 Subject: [PATCH] releasetools: Specify a minimum size for right-sized images. On aosp_blueline, system_other gets right-sized to 61,440 bytes. This messes up the AVB footer calculation, and is too small to store an ext4 image. Bug: 116608795 Test: build aosp_blueline w/ dynamic partitions Change-Id: If0138a9d858765ff82cb957532504a066fd113ff --- tools/releasetools/build_image.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py index d32090a98e..9612499bde 100755 --- a/tools/releasetools/build_image.py +++ b/tools/releasetools/build_image.py @@ -431,6 +431,9 @@ def BuildImage(in_dir, prop_dict, out_file, target_out=None): size = common.RoundUpTo4K(size) else: size = ((size + block_size - 1) // block_size) * block_size + # Use a minimum size, otherwise we will fail to calculate an AVB footer + # or fail to construct an ext4 image. + size = max(size, 256 * 1024) extfs_inode_count = prop_dict["extfs_inode_count"] inodes = int(fs_dict.get("Inode count", extfs_inode_count)) inodes -= int(fs_dict.get("Free inodes", "0"))