aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Reynolds <chadreynolds@google.com>2024-04-19 23:36:48 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-04-19 23:36:48 +0000
commitff01864a14dc8fa7a8a8cd723cb6b1f6b8162e2e (patch)
tree53747bbecb0b4370de08f1e9e6a6a7dc024f32d7
parentddab63b25b58fc57012b4a569dd0dea3b0b58c11 (diff)
parent74304d79edc6f049ffcae49ed2f80873e037dd91 (diff)
downloadcuttlefish-ff01864a14dc8fa7a8a8cd723cb6b1f6b8162e2e.tar.gz
Merge changes I0287744f,Ifc2883fe,Id505402d into main
* changes: Expand the list of vendor images Add a new_vbmeta_image path for regeneration Add `make_vbmeta_image` to `Avb`
-rw-r--r--host/commands/assemble_cvd/assemble_cvd.cc3
-rw-r--r--host/commands/assemble_cvd/boot_image_utils.h4
-rw-r--r--host/commands/assemble_cvd/disk/generate_persistent_vbmeta.cpp51
-rw-r--r--host/commands/assemble_cvd/disk_flags.cc36
-rw-r--r--host/commands/assemble_cvd/super_image_mixer.cc24
-rw-r--r--host/commands/assemble_cvd/vendor_dlkm_utils.cc37
-rw-r--r--host/libs/avb/avb.cpp68
-rw-r--r--host/libs/avb/avb.h19
-rw-r--r--host/libs/config/cuttlefish_config.h3
-rw-r--r--host/libs/config/cuttlefish_config_instance.cpp10
10 files changed, 157 insertions, 98 deletions
diff --git a/host/commands/assemble_cvd/assemble_cvd.cc b/host/commands/assemble_cvd/assemble_cvd.cc
index 5ad253b71..37d931af0 100644
--- a/host/commands/assemble_cvd/assemble_cvd.cc
+++ b/host/commands/assemble_cvd/assemble_cvd.cc
@@ -223,6 +223,7 @@ Result<std::set<std::string>> PreservingOnResume(
preserving.insert("os_composite_gpt_header.img");
preserving.insert("os_composite_gpt_footer.img");
preserving.insert("os_composite.img");
+ preserving.insert("os_vbmeta.img");
preserving.insert("sdcard.img");
preserving.insert("sdcard_overlay.img");
preserving.insert("boot_repacked.img");
@@ -245,7 +246,7 @@ Result<std::set<std::string>> PreservingOnResume(
preserving.insert("factory_reset_protected.img");
preserving.insert("misc.img");
preserving.insert("metadata.img");
- preserving.insert("vbmeta.img");
+ preserving.insert("persistent_vbmeta.img");
preserving.insert("oemlock_secure");
preserving.insert("oemlock_insecure");
// Preserve logs if restoring from a snapshot.
diff --git a/host/commands/assemble_cvd/boot_image_utils.h b/host/commands/assemble_cvd/boot_image_utils.h
index 657e6f75d..26a3dc38c 100644
--- a/host/commands/assemble_cvd/boot_image_utils.h
+++ b/host/commands/assemble_cvd/boot_image_utils.h
@@ -23,10 +23,6 @@
namespace cuttlefish {
-// Taken from external/avb/libavb/avb_slot_verify.c; this define is not in the
-// headers
-static constexpr size_t VBMETA_MAX_SIZE = 65536ul;
-
Result<void> RepackBootImage(const Avb& avb,
const std::string& new_kernel_path,
const std::string& boot_image_path,
diff --git a/host/commands/assemble_cvd/disk/generate_persistent_vbmeta.cpp b/host/commands/assemble_cvd/disk/generate_persistent_vbmeta.cpp
index 4d91d7472..add41dc07 100644
--- a/host/commands/assemble_cvd/disk/generate_persistent_vbmeta.cpp
+++ b/host/commands/assemble_cvd/disk/generate_persistent_vbmeta.cpp
@@ -31,46 +31,25 @@ namespace cuttlefish {
using APBootFlow = CuttlefishConfig::InstanceSpecific::APBootFlow;
static bool PrepareVBMetaImage(const std::string& path, bool has_boot_config) {
- auto avbtool_path = HostBinaryPath("avbtool");
- Command vbmeta_cmd(avbtool_path);
- vbmeta_cmd.AddParameter("make_vbmeta_image");
- vbmeta_cmd.AddParameter("--output");
- vbmeta_cmd.AddParameter(path);
- vbmeta_cmd.AddParameter("--algorithm");
- vbmeta_cmd.AddParameter("SHA256_RSA4096");
- vbmeta_cmd.AddParameter("--key");
- vbmeta_cmd.AddParameter(TestKeyRsa4096());
-
- vbmeta_cmd.AddParameter("--chain_partition");
- vbmeta_cmd.AddParameter("uboot_env:1:" + TestPubKeyRsa4096());
-
+ std::unique_ptr<Avb> avbtool = GetDefaultAvb();
+ std::vector<ChainPartition> chained_partitions = {ChainPartition{
+ .name = "uboot_env",
+ .rollback_index = "1",
+ .key_path = TestPubKeyRsa4096(),
+ }};
if (has_boot_config) {
- vbmeta_cmd.AddParameter("--chain_partition");
- vbmeta_cmd.AddParameter("bootconfig:2:" + TestPubKeyRsa4096());
+ chained_partitions.emplace_back(ChainPartition{
+ .name = "bootconfig",
+ .rollback_index = "2",
+ .key_path = TestPubKeyRsa4096(),
+ });
}
-
- bool success = vbmeta_cmd.Start().Wait();
- if (success != 0) {
- LOG(ERROR) << "Unable to create persistent vbmeta. Exited with status "
- << success;
+ Result<void> result =
+ avbtool->MakeVbMetaImage(path, chained_partitions, {}, {});
+ if (!result.ok()) {
+ LOG(ERROR) << result.error().Trace();
return false;
}
-
- const auto vbmeta_size = FileSize(path);
- if (vbmeta_size > VBMETA_MAX_SIZE) {
- LOG(ERROR) << "Generated vbmeta - " << path
- << " is larger than the expected " << VBMETA_MAX_SIZE
- << ". Stopping.";
- return false;
- }
- if (vbmeta_size != VBMETA_MAX_SIZE) {
- auto fd = SharedFD::Open(path, O_RDWR);
- if (!fd->IsOpen() || fd->Truncate(VBMETA_MAX_SIZE) != 0) {
- LOG(ERROR) << "`truncate --size=" << VBMETA_MAX_SIZE << " " << path
- << "` failed: " << fd->StrError();
- return false;
- }
- }
return true;
}
diff --git a/host/commands/assemble_cvd/disk_flags.cc b/host/commands/assemble_cvd/disk_flags.cc
index 7bc0c436e..00dc76842 100644
--- a/host/commands/assemble_cvd/disk_flags.cc
+++ b/host/commands/assemble_cvd/disk_flags.cc
@@ -16,15 +16,18 @@
#include "host/commands/assemble_cvd/disk_flags.h"
+#include <sys/statvfs.h>
+
+#include <fstream>
+#include <string>
+#include <vector>
+
#include <android-base/logging.h>
#include <android-base/parsebool.h>
#include <android-base/parseint.h>
#include <android-base/strings.h>
#include <fruit/fruit.h>
#include <gflags/gflags.h>
-#include <sys/statvfs.h>
-
-#include <fstream>
#include "common/libs/fs/shared_buf.h"
#include "common/libs/utils/files.h"
@@ -40,6 +43,7 @@
#include "host/commands/assemble_cvd/flags_defaults.h"
#include "host/commands/assemble_cvd/super_image_mixer.h"
#include "host/commands/assemble_cvd/vendor_dlkm_utils.h"
+#include "host/libs/avb/avb.h"
#include "host/libs/config/cuttlefish_config.h"
#include "host/libs/config/data_image.h"
#include "host/libs/config/inject.h"
@@ -356,14 +360,18 @@ std::vector<ImagePartition> android_composite_disk_config(
.image_file_path = AbsolutePath(instance.new_vendor_boot_image()),
.read_only = FLAGS_use_overlay,
});
+ auto vbmeta_image = instance.new_vbmeta_image();
+ if (!FileExists(vbmeta_image)) {
+ vbmeta_image = instance.vbmeta_image();
+ }
partitions.push_back(ImagePartition{
.label = "vbmeta_a",
- .image_file_path = AbsolutePath(instance.vbmeta_image()),
+ .image_file_path = AbsolutePath(vbmeta_image),
.read_only = FLAGS_use_overlay,
});
partitions.push_back(ImagePartition{
.label = "vbmeta_b",
- .image_file_path = AbsolutePath(instance.vbmeta_image()),
+ .image_file_path = AbsolutePath(vbmeta_image),
.read_only = FLAGS_use_overlay,
});
partitions.push_back(ImagePartition{
@@ -630,20 +638,13 @@ Result<void> VbmetaEnforceMinimumSize(
// libavb expects to be able to read the maximum vbmeta size, so we must
// provide a partition which matches this or the read will fail
for (const auto& vbmeta_image :
- {instance.vbmeta_image(), instance.vbmeta_system_image(),
- instance.vbmeta_vendor_dlkm_image(),
+ {instance.vbmeta_image(), instance.new_vbmeta_image(),
+ instance.vbmeta_system_image(), instance.vbmeta_vendor_dlkm_image(),
instance.vbmeta_system_dlkm_image()}) {
// In some configurations of cuttlefish, the vendor dlkm vbmeta image does
// not exist
- if (FileExists(vbmeta_image) && FileSize(vbmeta_image) != VBMETA_MAX_SIZE) {
- auto fd = SharedFD::Open(vbmeta_image, O_RDWR);
- CF_EXPECTF(fd->IsOpen(), "Could not open \"{}\": {}", vbmeta_image,
- fd->StrError());
- CF_EXPECTF(fd->Truncate(VBMETA_MAX_SIZE) == 0,
- "`truncate --size={} {}` failed: {}", VBMETA_MAX_SIZE,
- vbmeta_image, fd->StrError());
- CF_EXPECTF(fd->Fsync() == 0, "fsync on `{}` failed: {}", vbmeta_image,
- fd->StrError());
+ if (FileExists(vbmeta_image)) {
+ CF_EXPECT(EnforceVbMetaSize(vbmeta_image));
}
}
return {};
@@ -971,6 +972,9 @@ Result<void> DiskImageFlagsVectorization(CuttlefishConfig& config, const Fetcher
const std::string new_super_image_path =
const_instance.PerInstancePath("super.img");
instance.set_new_super_image(new_super_image_path);
+ const std::string new_vbmeta_image_path =
+ const_instance.PerInstancePath("os_vbmeta.img");
+ instance.set_new_super_image(new_vbmeta_image_path);
}
instance.set_new_vbmeta_vendor_dlkm_image(
diff --git a/host/commands/assemble_cvd/super_image_mixer.cc b/host/commands/assemble_cvd/super_image_mixer.cc
index f8ebf7f38..8f445310a 100644
--- a/host/commands/assemble_cvd/super_image_mixer.cc
+++ b/host/commands/assemble_cvd/super_image_mixer.cc
@@ -20,6 +20,8 @@
#include <algorithm>
#include <array>
#include <memory>
+#include <string>
+#include <unordered_set>
#include <android-base/strings.h>
#include <android-base/logging.h>
@@ -30,6 +32,7 @@
#include "common/libs/utils/files.h"
#include "common/libs/utils/subprocess.h"
#include "host/commands/assemble_cvd/misc_info.h"
+#include "host/libs/config/config_utils.h"
#include "host/libs/config/cuttlefish_config.h"
#include "host/libs/config/fetcher_config.h"
@@ -88,19 +91,24 @@ std::string TargetFilesZip(const FetcherConfig& fetcher_config,
}
constexpr char kMiscInfoPath[] = "META/misc_info.txt";
-constexpr std::array kDefaultTargetImages = {
+constexpr std::array kVendorTargetImages = {
"IMAGES/boot.img",
+ "IMAGES/dtbo.img",
+ "IMAGES/init_boot.img",
"IMAGES/odm.img",
"IMAGES/odm_dlkm.img",
"IMAGES/recovery.img",
+ "IMAGES/system_dlkm.img",
"IMAGES/userdata.img",
"IMAGES/vbmeta.img",
+ "IMAGES/vbmeta_system_dlkm.img",
+ "IMAGES/vbmeta_vendor.img",
+ "IMAGES/vbmeta_vendor_dlkm.img",
"IMAGES/vendor.img",
"IMAGES/vendor_dlkm.img",
- "IMAGES/vbmeta_vendor_dlkm.img",
- "IMAGES/system_dlkm.img",
+ "IMAGES/vendor_kernel_boot.img",
};
-constexpr std::array kDefaultTargetBuildProp = {
+constexpr std::array kVendorTargetBuildProps = {
"ODM/build.prop",
"ODM/etc/build.prop",
"VENDOR/build.prop",
@@ -188,7 +196,7 @@ Result<void> CombineTargetZipFiles(const std::string& default_target_zip,
continue;
} else if (!android::base::EndsWith(name, ".img")) {
continue;
- } else if (!Contains(kDefaultTargetImages, name)) {
+ } else if (!Contains(kVendorTargetImages, name)) {
continue;
}
LOG(INFO) << "Writing " << name;
@@ -198,7 +206,7 @@ Result<void> CombineTargetZipFiles(const std::string& default_target_zip,
for (const auto& name : default_target_contents) {
if (!android::base::EndsWith(name, "build.prop")) {
continue;
- } else if (!Contains(kDefaultTargetBuildProp, name)) {
+ } else if (!Contains(kVendorTargetBuildProps, name)) {
continue;
}
FindImports(&default_target_archive, name);
@@ -212,7 +220,7 @@ Result<void> CombineTargetZipFiles(const std::string& default_target_zip,
continue;
} else if (!android::base::EndsWith(name, ".img")) {
continue;
- } else if (Contains(kDefaultTargetImages, name)) {
+ } else if (Contains(kVendorTargetImages, name)) {
continue;
}
LOG(INFO) << "Writing " << name;
@@ -222,7 +230,7 @@ Result<void> CombineTargetZipFiles(const std::string& default_target_zip,
for (const auto& name : system_target_contents) {
if (!android::base::EndsWith(name, "build.prop")) {
continue;
- } else if (Contains(kDefaultTargetBuildProp, name)) {
+ } else if (Contains(kVendorTargetBuildProps, name)) {
continue;
}
FindImports(&system_target_archive, name);
diff --git a/host/commands/assemble_cvd/vendor_dlkm_utils.cc b/host/commands/assemble_cvd/vendor_dlkm_utils.cc
index ac08b76e4..57890e4a7 100644
--- a/host/commands/assemble_cvd/vendor_dlkm_utils.cc
+++ b/host/commands/assemble_cvd/vendor_dlkm_utils.cc
@@ -409,41 +409,14 @@ bool BuildVbmetaImage(const std::string& image_path,
const std::string& vbmeta_path) {
CHECK(!image_path.empty());
CHECK(FileExists(image_path));
- auto avbtool_path = HostBinaryPath("avbtool");
- Command vbmeta_cmd(avbtool_path);
- vbmeta_cmd.AddParameter("make_vbmeta_image");
- vbmeta_cmd.AddParameter("--output");
- vbmeta_cmd.AddParameter(vbmeta_path);
- vbmeta_cmd.AddParameter("--algorithm");
- vbmeta_cmd.AddParameter("SHA256_RSA4096");
- vbmeta_cmd.AddParameter("--key");
- vbmeta_cmd.AddParameter(TestKeyRsa4096());
- vbmeta_cmd.AddParameter("--include_descriptors_from_image");
- vbmeta_cmd.AddParameter(image_path);
- vbmeta_cmd.AddParameter("--padding_size");
- vbmeta_cmd.AddParameter("4096");
-
- bool success = vbmeta_cmd.Start().Wait();
- if (success != 0) {
- LOG(ERROR) << "Unable to create vbmeta. Exited with status " << success;
- return false;
- }
- const auto vbmeta_size = FileSize(vbmeta_path);
- if (vbmeta_size > VBMETA_MAX_SIZE) {
- LOG(ERROR) << "Generated vbmeta - " << vbmeta_path
- << " is larger than the expected " << VBMETA_MAX_SIZE
- << ". Stopping.";
+ std::unique_ptr<Avb> avbtool = GetDefaultAvb();
+ Result<void> result = avbtool->MakeVbMetaImage(vbmeta_path, {}, {image_path},
+ {"--padding_size", "4096"});
+ if (!result.ok()) {
+ LOG(ERROR) << result.error().Trace();
return false;
}
- if (vbmeta_size != VBMETA_MAX_SIZE) {
- auto fd = SharedFD::Open(vbmeta_path, O_RDWR | O_CLOEXEC);
- if (!fd->IsOpen() || fd->Truncate(VBMETA_MAX_SIZE) != 0) {
- LOG(ERROR) << "`truncate --size=" << VBMETA_MAX_SIZE << " " << vbmeta_path
- << "` failed: " << fd->StrError();
- return false;
- }
- }
return true;
}
diff --git a/host/libs/avb/avb.cpp b/host/libs/avb/avb.cpp
index 76c96d131..6ffa0aba6 100644
--- a/host/libs/avb/avb.cpp
+++ b/host/libs/avb/avb.cpp
@@ -17,12 +17,15 @@
#include "host/libs/avb/avb.h"
+#include <fcntl.h>
+
#include <memory>
#include <string>
#include <fruit/fruit.h>
#include "common/libs/fs/shared_fd.h"
+#include "common/libs/utils/files.h"
#include "common/libs/utils/result.h"
#include "common/libs/utils/subprocess.h"
#include "host/libs/config/cuttlefish_config.h"
@@ -34,6 +37,10 @@ namespace {
constexpr char kAddHashFooter[] = "add_hash_footer";
constexpr char kDefaultAlgorithm[] = "SHA256_RSA4096";
constexpr char kInfoImage[] = "info_image";
+constexpr char kMakeVbmetaImage[] = "make_vbmeta_image";
+// Taken from external/avb/libavb/avb_slot_verify.c; this define is not in the
+// headers
+constexpr size_t kVbMetaMaxSize = 65536ul;
} // namespace
@@ -99,6 +106,67 @@ Result<void> Avb::WriteInfoImage(const std::string& image_path,
return {};
}
+Command Avb::GenerateMakeVbMetaImage(
+ const std::string& output_path,
+ const std::vector<ChainPartition>& chained_partitions,
+ const std::vector<std::string>& included_partitions,
+ const std::vector<std::string>& extra_arguments) {
+ Command command(avbtool_path_);
+ command.AddParameter(kMakeVbmetaImage);
+ command.AddParameter("--algorithm");
+ command.AddParameter(algorithm_);
+ command.AddParameter("--key");
+ command.AddParameter(key_);
+ command.AddParameter("--output");
+ command.AddParameter(output_path);
+
+ for (const auto& partition : chained_partitions) {
+ const std::string argument = partition.name + ":" +
+ partition.rollback_index + ":" +
+ partition.key_path;
+ command.AddParameter("--chain_partition");
+ command.AddParameter(argument);
+ }
+ for (const auto& partition : included_partitions) {
+ command.AddParameter("--include_descriptors_from_image");
+ command.AddParameter(partition);
+ }
+ for (const auto& extra_arg : extra_arguments) {
+ command.AddParameter(extra_arg);
+ }
+ return command;
+}
+
+Result<void> Avb::MakeVbMetaImage(
+ const std::string& output_path,
+ const std::vector<ChainPartition>& chained_partitions,
+ const std::vector<std::string>& included_partitions,
+ const std::vector<std::string>& extra_arguments) {
+ auto command = GenerateMakeVbMetaImage(output_path, chained_partitions,
+ included_partitions, extra_arguments);
+ int exit_code = command.Start().Wait();
+ CF_EXPECTF(exit_code == 0, "Failure running {} {}. Exited with status {}",
+ command.Executable(), kMakeVbmetaImage, exit_code);
+ CF_EXPECT(EnforceVbMetaSize(output_path));
+ return {};
+}
+
+Result<void> EnforceVbMetaSize(const std::string& path) {
+ const auto vbmeta_size = FileSize(path);
+ CF_EXPECT_LE(vbmeta_size, kVbMetaMaxSize);
+ if (vbmeta_size != kVbMetaMaxSize) {
+ auto vbmeta_fd = SharedFD::Open(path, O_RDWR);
+ CF_EXPECTF(vbmeta_fd->IsOpen(), "Unable to open {} with error {}", path,
+ vbmeta_fd->StrError());
+ CF_EXPECTF(vbmeta_fd->Truncate(kVbMetaMaxSize) == 0,
+ "Truncating {} failed with error {}", path,
+ vbmeta_fd->StrError());
+ CF_EXPECTF(vbmeta_fd->Fsync() == 0, "fsync on {} failed with error {}",
+ path, vbmeta_fd->StrError());
+ }
+ return {};
+}
+
std::unique_ptr<Avb> GetDefaultAvb() {
return std::unique_ptr<Avb>(
new Avb(AvbToolBinary(), kDefaultAlgorithm, TestKeyRsa4096()));
diff --git a/host/libs/avb/avb.h b/host/libs/avb/avb.h
index 6a1a257a7..ac4a61b89 100644
--- a/host/libs/avb/avb.h
+++ b/host/libs/avb/avb.h
@@ -22,6 +22,7 @@
#include <cstdint>
#include <memory>
#include <string>
+#include <vector>
#include <fruit/fruit.h>
@@ -33,6 +34,12 @@ namespace cuttlefish {
// Taken from external/avb/avbtool.py; this define is not in the headers
inline constexpr uint64_t kMaxAvbMetadataSize = 69632ul;
+struct ChainPartition {
+ std::string name;
+ std::string rollback_index;
+ std::string key_path;
+};
+
class Avb {
public:
Avb(std::string avbtool_path);
@@ -51,6 +58,11 @@ class Avb {
const off_t partition_size_bytes) const;
Result<void> WriteInfoImage(const std::string& image_path,
const std::string& output_path) const;
+ Result<void> MakeVbMetaImage(
+ const std::string& output_path,
+ const std::vector<ChainPartition>& chained_partitions,
+ const std::vector<std::string>& included_partitions,
+ const std::vector<std::string>& extra_arguments);
private:
Command GenerateAddHashFooter(const std::string& image_path,
@@ -58,12 +70,19 @@ class Avb {
const off_t partition_size_bytes) const;
Command GenerateInfoImage(const std::string& image_path,
const SharedFD& output_path) const;
+ Command GenerateMakeVbMetaImage(
+ const std::string& output_path,
+ const std::vector<ChainPartition>& chained_partitions,
+ const std::vector<std::string>& included_partitions,
+ const std::vector<std::string>& extra_arguments);
std::string avbtool_path_;
std::string algorithm_;
std::string key_;
};
+Result<void> EnforceVbMetaSize(const std::string& path);
+
std::unique_ptr<Avb> GetDefaultAvb();
fruit::Component<Avb> CuttlefishKeyAvbComponent();
diff --git a/host/libs/config/cuttlefish_config.h b/host/libs/config/cuttlefish_config.h
index e4a924806..5881b2c91 100644
--- a/host/libs/config/cuttlefish_config.h
+++ b/host/libs/config/cuttlefish_config.h
@@ -509,6 +509,7 @@ class CuttlefishConfig {
std::string persistent_bootconfig_path() const;
+ // used for the persistent_composite_disk vbmeta
std::string vbmeta_path() const;
std::string ap_vbmeta_path() const;
@@ -627,6 +628,7 @@ class CuttlefishConfig {
std::string vendor_boot_image() const;
std::string new_vendor_boot_image() const;
std::string vbmeta_image() const;
+ std::string new_vbmeta_image() const;
std::string vbmeta_system_image() const;
std::string vbmeta_vendor_dlkm_image() const;
std::string new_vbmeta_vendor_dlkm_image() const;
@@ -828,6 +830,7 @@ class CuttlefishConfig {
void set_vendor_boot_image(const std::string& vendor_boot_image);
void set_new_vendor_boot_image(const std::string& new_vendor_boot_image);
void set_vbmeta_image(const std::string& vbmeta_image);
+ void set_new_vbmeta_image(const std::string& new_vbmeta_image);
void set_vbmeta_system_image(const std::string& vbmeta_system_image);
void set_vbmeta_vendor_dlkm_image(
const std::string& vbmeta_vendor_dlkm_image);
diff --git a/host/libs/config/cuttlefish_config_instance.cpp b/host/libs/config/cuttlefish_config_instance.cpp
index 335c0621a..1cc3c1f00 100644
--- a/host/libs/config/cuttlefish_config_instance.cpp
+++ b/host/libs/config/cuttlefish_config_instance.cpp
@@ -192,6 +192,14 @@ void CuttlefishConfig::MutableInstanceSpecific::set_vbmeta_image(
const std::string& vbmeta_image) {
(*Dictionary())[kVbmetaImage] = vbmeta_image;
}
+static constexpr char kNewVbmetaImage[] = "new_vbmeta_image";
+std::string CuttlefishConfig::InstanceSpecific::new_vbmeta_image() const {
+ return (*Dictionary())[kNewVbmetaImage].asString();
+}
+void CuttlefishConfig::MutableInstanceSpecific::set_new_vbmeta_image(
+ const std::string& new_vbmeta_image) {
+ (*Dictionary())[kNewVbmetaImage] = new_vbmeta_image;
+}
static constexpr char kVbmetaSystemImage[] = "vbmeta_system_image";
std::string CuttlefishConfig::InstanceSpecific::vbmeta_system_image() const {
return (*Dictionary())[kVbmetaSystemImage].asString();
@@ -1247,7 +1255,7 @@ std::string CuttlefishConfig::InstanceSpecific::ap_composite_disk_path()
}
std::string CuttlefishConfig::InstanceSpecific::vbmeta_path() const {
- return AbsolutePath(PerInstancePath("vbmeta.img"));
+ return AbsolutePath(PerInstancePath("persistent_vbmeta.img"));
}
std::string CuttlefishConfig::InstanceSpecific::ap_vbmeta_path() const {