blob: 1ae781705f505e7316efc3fb25e5af8861eb5558 [file] [log] [blame]
David Andersonee84d742019-01-07 18:10:29 -08001//
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
Howard Chenee5c2b12019-11-08 11:57:47 +080019#include <filesystem>
20
David Andersonee84d742019-01-07 18:10:29 -080021namespace android {
22namespace gsi {
23
David Anderson9bdf8632019-07-01 14:49:11 -070024static constexpr char kDefaultDsuImageFolder[] = "/data/gsi/dsu/";
David Andersonb2988ab2019-04-16 17:14:09 -070025static constexpr char kUserdataDevice[] = "/dev/block/by-name/userdata";
26
Howard Chenee5c2b12019-11-08 11:57:47 +080027static inline std::string MetadataDir(const std::string& dsu_slot) {
28 return std::filesystem::path(DSU_METADATA_PREFIX) / dsu_slot;
29}
30
31static constexpr char kDsuOneShotBootFile[] = DSU_METADATA_PREFIX "one_shot_boot";
David Andersonee84d742019-01-07 18:10:29 -080032
David Andersonb3aff182019-01-11 14:37:51 -080033// 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
David Andersona141ba82019-01-14 19:09:27 -080037// "wipe" - boot into GSI not allowed; next reboot will delete gsi
Howard Chenee5c2b12019-11-08 11:57:47 +080038static constexpr char kDsuInstallStatusFile[] = DSU_METADATA_PREFIX "install_status";
David Andersonb3aff182019-01-11 14:37:51 -080039
David Andersonee84d742019-01-07 18:10:29 -080040} // namespace gsi
41} // namespace android