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 <dgarrett@chromium.org>
Commit-Ready: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/34135
diff --git a/build_library/base_image_util.sh b/build_library/base_image_util.sh
index 2704810..aa0b4fe 100755
--- a/build_library/base_image_util.sh
+++ b/build_library/base_image_util.sh
@@ -43,7 +43,7 @@
 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 021b2c7..a8280e3 100755
--- a/build_library/cgpt.py
+++ b/build_library/cgpt.py
@@ -170,6 +170,10 @@
           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 766b0de..6ae68d6 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": [
@@ -103,6 +119,12 @@
         "fs_blocks":"102400"
       },
       {
+        "num": 5,
+        "label":"ROOT-B",
+        "type":"rootfs",
+        "blocks":"1"
+      },
+      {
         "num": 12,
         "label":"EFI-SYSTEM",
         "type":"efi",
@@ -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": [