David Anderson | ee84d74 | 2019-01-07 18:10:29 -0800 | [diff] [blame] | 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 | |
Howard Chen | ee5c2b1 | 2019-11-08 11:57:47 +0800 | [diff] [blame] | 19 | #include <filesystem> |
| 20 | |
David Anderson | ee84d74 | 2019-01-07 18:10:29 -0800 | [diff] [blame] | 21 | namespace android { |
| 22 | namespace gsi { |
| 23 | |
David Anderson | 9bdf863 | 2019-07-01 14:49:11 -0700 | [diff] [blame] | 24 | static constexpr char kDefaultDsuImageFolder[] = "/data/gsi/dsu/"; |
David Anderson | b2988ab | 2019-04-16 17:14:09 -0700 | [diff] [blame] | 25 | static constexpr char kUserdataDevice[] = "/dev/block/by-name/userdata"; |
| 26 | |
Howard Chen | ee5c2b1 | 2019-11-08 11:57:47 +0800 | [diff] [blame] | 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"; |
David Anderson | ee84d74 | 2019-01-07 18:10:29 -0800 | [diff] [blame] | 32 | |
David Anderson | b3aff18 | 2019-01-11 14:37:51 -0800 | [diff] [blame] | 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 |
David Anderson | a141ba8 | 2019-01-14 19:09:27 -0800 | [diff] [blame] | 37 | // "wipe" - boot into GSI not allowed; next reboot will delete gsi |
Howard Chen | ee5c2b1 | 2019-11-08 11:57:47 +0800 | [diff] [blame] | 38 | static constexpr char kDsuInstallStatusFile[] = DSU_METADATA_PREFIX "install_status"; |
David Anderson | b3aff18 | 2019-01-11 14:37:51 -0800 | [diff] [blame] | 39 | |
David Anderson | ee84d74 | 2019-01-07 18:10:29 -0800 | [diff] [blame] | 40 | } // namespace gsi |
| 41 | } // namespace android |