diff options
author | Howard Chen <howardsoc@google.com> | 2019-11-08 11:57:47 +0800 |
---|---|---|
committer | Howard Chen <howardsoc@google.com> | 2020-01-14 03:56:41 +0000 |
commit | ee5c2b14b2f7c1ffbbcc7c6261aa3b5f79362959 (patch) | |
tree | 3a6a46fa5a3e6353feabdf15de005586748e2d12 /file_paths.h | |
parent | af1a6ad869b508c28768c15ac3abb15580b7a03e (diff) | |
download | gsid-ee5c2b14b2f7c1ffbbcc7c6261aa3b5f79362959.tar.gz |
Support multiple DSU installations
Bug: 144247097
Test: adb shell gsi_tool install --gsi-size $(du -b system.raw|cut -f1) < system.raw
Change-Id: I17f4292fc3038040cc5848ce00081e96c79ae769
Diffstat (limited to 'file_paths.h')
-rw-r--r-- | file_paths.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/file_paths.h b/file_paths.h index b596704..1ae7817 100644 --- a/file_paths.h +++ b/file_paths.h @@ -16,22 +16,26 @@ #pragma once +#include <filesystem> + namespace android { namespace gsi { static constexpr char kDefaultDsuImageFolder[] = "/data/gsi/dsu/"; static constexpr char kUserdataDevice[] = "/dev/block/by-name/userdata"; -static constexpr char kDsuMetadataDir[] = "/metadata/gsi/dsu"; -static constexpr char kDsuOneShotBootFile[] = "/metadata/gsi/dsu/one_shot_boot"; -static constexpr char kDsuInstallDirFile[] = "/metadata/gsi/dsu/install_dir"; +static inline std::string MetadataDir(const std::string& dsu_slot) { + return std::filesystem::path(DSU_METADATA_PREFIX) / dsu_slot; +} + +static constexpr char kDsuOneShotBootFile[] = DSU_METADATA_PREFIX "one_shot_boot"; // This file can contain the following values: // [int] - boot attempt counter, starting from 0 // "ok" - boot was marked successful // "disabled" - boot into GSI no longer allowed // "wipe" - boot into GSI not allowed; next reboot will delete gsi -static constexpr char kDsuInstallStatusFile[] = "/metadata/gsi/dsu/install_status"; +static constexpr char kDsuInstallStatusFile[] = DSU_METADATA_PREFIX "install_status"; } // namespace gsi } // namespace android |