diff --git a/build_library/base_image_util.sh b/build_library/base_image_util.sh index 2704810dec..aa0b4fedd7 100755 --- a/build_library/base_image_util.sh +++ b/build_library/base_image_util.sh @@ -43,7 +43,7 @@ zero_free_space() { create_base_image() { local image_name=$1 local rootfs_verification_enabled=$2 - local image_type="base" + local image_type="usb" if [[ "${FLAGS_disk_layout}" != "default" ]]; then image_type="${FLAGS_disk_layout}" diff --git a/build_library/cgpt.py b/build_library/cgpt.py index 021b2c7b42..a8280e3e54 100755 --- a/build_library/cgpt.py +++ b/build_library/cgpt.py @@ -170,6 +170,10 @@ def WriteLayoutFunction(sfile, func_name, image_type, config): sfile.write("fi\n") partition["var"] = "$STATEFUL_SIZE" + + sfile.write("STATEFUL_SIZE=$((STATEFUL_SIZE-(STATEFUL_SIZE %% %d)))\n" % + config["metadata"]["fs_block_size"]) + # Pass 2: Write out all the cgpt add commands. for partition in partitions: if partition["type"] != "blank": diff --git a/build_library/legacy_disk_layout.json b/build_library/legacy_disk_layout.json index 766b0de64b..6ae68d6d2a 100644 --- a/build_library/legacy_disk_layout.json +++ b/build_library/legacy_disk_layout.json @@ -78,14 +78,30 @@ "num": 5, "label":"ROOT-B", "type":"rootfs", - "blocks":"1" + "blocks":"4194304", + "fs_blocks":"217600" }, + { + "num": 3, + "label":"ROOT-A", + "type":"rootfs", + "blocks":"4194304", + "fs_blocks":"217600" + } + ], + "usb": [ { "num": 3, "label":"ROOT-A", "type":"rootfs", "blocks":"1757184", "fs_blocks":"217600" + }, + { + "num": 5, + "label":"ROOT-B", + "type":"rootfs", + "blocks":"1" } ], "factory_install": [ @@ -102,6 +118,12 @@ "blocks":"860160", "fs_blocks":"102400" }, + { + "num": 5, + "label":"ROOT-B", + "type":"rootfs", + "blocks":"1" + }, { "num": 12, "label":"EFI-SYSTEM", @@ -137,6 +159,19 @@ "label":"STATE", "type":"data", "blocks":"4096" + }, + { + "num": 3, + "label":"ROOT-A", + "type":"rootfs", + "blocks":"1757184", + "fs_blocks":"217600" + }, + { + "num": 5, + "label":"ROOT-B", + "type":"rootfs", + "blocks":"1" } ], "pgo": [