From e61da0dff1f465244ed465e6b571f370d570915d Mon Sep 17 00:00:00 2001 From: Liam McLoughlin Date: Wed, 26 Sep 2012 01:17:07 +0000 Subject: [PATCH] Fixes the ability to AU after running chromeos-install Make it possible to run chromeos-install without root BUG=none TEST=Build image, chromeos-install, verify ROOT-B is full size Change-Id: Id506f1e5a6f8b8ee03ea1bdd621aaab1239bca2c Reviewed-on: https://gerrit.chromium.org/gerrit/34081 Reviewed-by: Don Garrett Commit-Ready: Chris Masone Tested-by: Chris Masone --- build_library/base_image_util.sh | 2 +- build_library/cgpt.py | 4 +++ build_library/legacy_disk_layout.json | 37 ++++++++++++++++++++++++++- 3 files changed, 41 insertions(+), 2 deletions(-) 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": [