Alan Stokes | 17fd36a | 2021-09-06 17:22:37 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2021 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 | //! Common items used by CompOS server and/or clients |
| 18 | |
Alan Stokes | 126fd51 | 2021-12-16 15:00:01 +0000 | [diff] [blame] | 19 | pub mod binder; |
Alan Stokes | 17fd36a | 2021-09-06 17:22:37 +0100 | [diff] [blame] | 20 | pub mod compos_client; |
Alan Stokes | 46a1dff | 2021-12-14 10:56:05 +0000 | [diff] [blame] | 21 | pub mod odrefresh; |
Alan Stokes | 17aed5c | 2021-10-20 14:25:57 +0100 | [diff] [blame] | 22 | pub mod timeouts; |
Alan Stokes | 17fd36a | 2021-09-06 17:22:37 +0100 | [diff] [blame] | 23 | |
Alan Stokes | a2869d2 | 2021-09-22 09:06:41 +0100 | [diff] [blame] | 24 | /// Special CID indicating "any". |
| 25 | pub const VMADDR_CID_ANY: u32 = -1i32 as u32; |
| 26 | |
Alan Stokes | 17fd36a | 2021-09-06 17:22:37 +0100 | [diff] [blame] | 27 | /// VSock port that the CompOS server listens on for RPC binder connections. This should be out of |
| 28 | /// future port range (if happens) that microdroid may reserve for system components. |
| 29 | pub const COMPOS_VSOCK_PORT: u32 = 6432; |
| 30 | |
| 31 | /// The root directory where the CompOS APEX is mounted (read only). |
| 32 | pub const COMPOS_APEX_ROOT: &str = "/apex/com.android.compos"; |
| 33 | |
| 34 | /// The root of the data directory available for private use by the CompOS APEX. |
| 35 | pub const COMPOS_DATA_ROOT: &str = "/data/misc/apexdata/com.android.compos"; |
Alan Stokes | b2cc79e | 2021-09-14 14:08:46 +0100 | [diff] [blame] | 36 | |
| 37 | /// The sub-directory where we store information relating to the pending instance |
| 38 | /// of CompOS (based on staged APEXes). |
Alan Stokes | 388b88a | 2021-10-13 16:03:17 +0100 | [diff] [blame] | 39 | pub const PENDING_INSTANCE_DIR: &str = "pending"; |
Alan Stokes | b2cc79e | 2021-09-14 14:08:46 +0100 | [diff] [blame] | 40 | |
| 41 | /// The sub-directory where we store information relating to the current instance |
| 42 | /// of CompOS (based on active APEXes). |
Alan Stokes | 388b88a | 2021-10-13 16:03:17 +0100 | [diff] [blame] | 43 | pub const CURRENT_INSTANCE_DIR: &str = "current"; |
| 44 | |
| 45 | /// The sub-directory where we store information relating to the instance of CompOS used for |
| 46 | /// tests. |
| 47 | pub const TEST_INSTANCE_DIR: &str = "test"; |
Alan Stokes | b2cc79e | 2021-09-14 14:08:46 +0100 | [diff] [blame] | 48 | |
| 49 | /// The file that holds the encrypted private key for a CompOS instance. |
| 50 | pub const PRIVATE_KEY_BLOB_FILE: &str = "key.blob"; |
| 51 | |
| 52 | /// The file that holds the public key for a CompOS instance. |
| 53 | pub const PUBLIC_KEY_FILE: &str = "key.pubkey"; |
| 54 | |
| 55 | /// The file that holds the instance image for a CompOS instance. |
| 56 | pub const INSTANCE_IMAGE_FILE: &str = "instance.img"; |
Alan Stokes | b4a0e91 | 2021-12-01 11:43:59 +0000 | [diff] [blame] | 57 | |
Jooyung Han | ccae66d | 2021-12-20 11:54:36 +0900 | [diff] [blame] | 58 | /// The file that holds the idsig for the CompOS Payload APK. |
| 59 | pub const IDSIG_FILE: &str = "idsig"; |
| 60 | |
Alan Stokes | b4a0e91 | 2021-12-01 11:43:59 +0000 | [diff] [blame] | 61 | /// The path within our config APK of our default VM configuration file, used at boot time. |
| 62 | pub const DEFAULT_VM_CONFIG_PATH: &str = "assets/vm_config.json"; |
| 63 | |
| 64 | /// The path within our config APK of the VM configuration file we use when compiling staged |
| 65 | /// APEXes before reboot. |
| 66 | pub const PREFER_STAGED_VM_CONFIG_PATH: &str = "assets/vm_config_staged.json"; |