Fix no-bootconfig bootcase on cuttlefish

With the recent addition of the vbmeta for the bootconfig on the
instance specific disk, the vbmeta was getting used regardless of
whether or not it was being created.

Fix this by guarding it's creation with the bootconfig_supported flag.

Bug: 215722327
Test: boot without bootconfig support
Change-Id: I3663df83ea50206f52b3379b89b8d7563392ff0e
diff --git a/host/commands/assemble_cvd/disk_flags.cc b/host/commands/assemble_cvd/disk_flags.cc
index e01929e..a9ef66a 100644
--- a/host/commands/assemble_cvd/disk_flags.cc
+++ b/host/commands/assemble_cvd/disk_flags.cc
@@ -248,6 +248,7 @@
 }
 
 std::vector<ImagePartition> persistent_composite_disk_config(
+    const CuttlefishConfig& config,
     const CuttlefishConfig::InstanceSpecific& instance) {
   std::vector<ImagePartition> partitions;
 
@@ -264,14 +265,16 @@
         .image_file_path = instance.factory_reset_protected_path(),
     });
   }
-  partitions.push_back(ImagePartition{
-      .label = "bootconfig",
-      .image_file_path = instance.persistent_bootconfig_path(),
-  });
-  partitions.push_back(ImagePartition{
-      .label = "vbmeta",
-      .image_file_path = instance.vbmeta_path(),
-  });
+  if (config.bootconfig_supported()) {
+    partitions.push_back(ImagePartition{
+        .label = "bootconfig",
+        .image_file_path = instance.persistent_bootconfig_path(),
+    });
+    partitions.push_back(ImagePartition{
+        .label = "vbmeta",
+        .image_file_path = instance.vbmeta_path(),
+    });
+  }
   return partitions;
 }
 
@@ -406,10 +409,11 @@
         instance.PerInstancePath("persistent_composite_gpt_header.img");
     std::string footer_path =
         instance.PerInstancePath("persistent_composite_gpt_footer.img");
-    CreateCompositeDisk(persistent_composite_disk_config(instance), header_path,
-                        footer_path, instance.persistent_composite_disk_path());
+    CreateCompositeDisk(persistent_composite_disk_config(config, instance),
+                        header_path, footer_path,
+                        instance.persistent_composite_disk_path());
   } else {
-    AggregateImage(persistent_composite_disk_config(instance),
+    AggregateImage(persistent_composite_disk_config(config, instance),
                    instance.persistent_composite_disk_path());
   }
   return true;
@@ -508,7 +512,14 @@
   std::string Name() const override {
     return "GeneratePersistentBootconfigAndVbmeta";
   }
-  bool Enabled() const override { return !config_.protected_vm(); }
+  //  Cuttlefish for the time being won't be able to support OTA from a
+  //  non-bootconfig kernel to a bootconfig-kernel (or vice versa) IF the
+  //  device is stopped (via stop_cvd). This is rarely an issue since OTA
+  //  testing run on cuttlefish is done within one launch cycle of the device.
+  //  If this ever becomes an issue, this code will have to be rewritten.
+  bool Enabled() const override {
+    return (!config_.protected_vm() && config_.bootconfig_supported());
+  }
 
  private:
   std::unordered_set<Feature*> Dependencies() const override { return {}; }
@@ -528,15 +539,6 @@
       return false;
     }
 
-    //  Cuttlefish for the time being won't be able to support OTA from a
-    //  non-bootconfig kernel to a bootconfig-kernel (or vice versa) IF the
-    //  device is stopped (via stop_cvd). This is rarely an issue since OTA
-    //  testing run on cuttlefish is done within one launch cycle of the device.
-    //  If this ever becomes an issue, this code will have to be rewritten.
-    if (!config_.bootconfig_supported()) {
-      return true;
-    }
-
     const std::string bootconfig =
         android::base::Join(BootconfigArgsFromConfig(config_, instance_),
                             "\n") +
@@ -825,10 +827,10 @@
   for (const auto& instance : config.Instances()) {
     bool compositeMatchesDiskConfig = DoesCompositeMatchCurrentDiskConfig(
         instance.PerInstancePath("persistent_composite_disk_config.txt"),
-        persistent_composite_disk_config(instance));
-    bool oldCompositeDisk =
-        ShouldCreateCompositeDisk(instance.persistent_composite_disk_path(),
-                                  persistent_composite_disk_config(instance));
+        persistent_composite_disk_config(config, instance));
+    bool oldCompositeDisk = ShouldCreateCompositeDisk(
+        instance.persistent_composite_disk_path(),
+        persistent_composite_disk_config(config, instance));
 
     if (!compositeMatchesDiskConfig || oldCompositeDisk) {
       CHECK(CreatePersistentCompositeDisk(config, instance))