1 //
2 // Copyright (C) 2019 The Android Open Source Project
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 
17 #pragma once
18 
19 #include <filesystem>
20 
21 namespace android {
22 namespace gsi {
23 
24 static constexpr char kDefaultDsuImageFolder[] = "/data/gsi/dsu/";
25 static constexpr char kUserdataDevice[] = "/dev/block/by-name/userdata";
26 
MetadataDir(const std::string & dsu_slot)27 static inline std::string MetadataDir(const std::string& dsu_slot) {
28     return std::filesystem::path(DSU_METADATA_PREFIX) / dsu_slot;
29 }
30 
31 static constexpr char kDsuOneShotBootFile[] = DSU_METADATA_PREFIX "one_shot_boot";
32 
33 // This file can contain the following values:
34 //   [int]      - boot attempt counter, starting from 0
35 //   "ok"       - boot was marked successful
36 //   "disabled" - boot into GSI no longer allowed
37 //   "wipe"     - boot into GSI not allowed; next reboot will delete gsi
38 static constexpr char kDsuInstallStatusFile[] = DSU_METADATA_PREFIX "install_status";
39 
40 }  // namespace gsi
41 }  // namespace android
42