blob: 5c2837930d0878644decee84aa4bfe6e0b984341 [file] [log] [blame]
Alan Stokes17fd36a2021-09-06 17:22:37 +01001/*
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
19pub mod compos_client;
Alan Stokes46a1dff2021-12-14 10:56:05 +000020pub mod odrefresh;
Alan Stokes17aed5c2021-10-20 14:25:57 +010021pub mod timeouts;
Alan Stokes17fd36a2021-09-06 17:22:37 +010022
Alan Stokesa2869d22021-09-22 09:06:41 +010023/// Special CID indicating "any".
24pub const VMADDR_CID_ANY: u32 = -1i32 as u32;
25
Alan Stokes17fd36a2021-09-06 17:22:37 +010026/// VSock port that the CompOS server listens on for RPC binder connections. This should be out of
27/// future port range (if happens) that microdroid may reserve for system components.
28pub const COMPOS_VSOCK_PORT: u32 = 6432;
29
30/// The root directory where the CompOS APEX is mounted (read only).
31pub const COMPOS_APEX_ROOT: &str = "/apex/com.android.compos";
32
33/// The root of the data directory available for private use by the CompOS APEX.
34pub const COMPOS_DATA_ROOT: &str = "/data/misc/apexdata/com.android.compos";
Alan Stokesb2cc79e2021-09-14 14:08:46 +010035
36/// The sub-directory where we store information relating to the pending instance
37/// of CompOS (based on staged APEXes).
Alan Stokes388b88a2021-10-13 16:03:17 +010038pub const PENDING_INSTANCE_DIR: &str = "pending";
Alan Stokesb2cc79e2021-09-14 14:08:46 +010039
40/// The sub-directory where we store information relating to the current instance
41/// of CompOS (based on active APEXes).
Alan Stokes388b88a2021-10-13 16:03:17 +010042pub const CURRENT_INSTANCE_DIR: &str = "current";
43
44/// The sub-directory where we store information relating to the instance of CompOS used for
45/// tests.
46pub const TEST_INSTANCE_DIR: &str = "test";
Alan Stokesb2cc79e2021-09-14 14:08:46 +010047
48/// The file that holds the encrypted private key for a CompOS instance.
49pub const PRIVATE_KEY_BLOB_FILE: &str = "key.blob";
50
51/// The file that holds the public key for a CompOS instance.
52pub const PUBLIC_KEY_FILE: &str = "key.pubkey";
53
54/// The file that holds the instance image for a CompOS instance.
55pub const INSTANCE_IMAGE_FILE: &str = "instance.img";
Alan Stokesb4a0e912021-12-01 11:43:59 +000056
57/// The path within our config APK of our default VM configuration file, used at boot time.
58pub const DEFAULT_VM_CONFIG_PATH: &str = "assets/vm_config.json";
59
60/// The path within our config APK of the VM configuration file we use when compiling staged
61/// APEXes before reboot.
62pub const PREFER_STAGED_VM_CONFIG_PATH: &str = "assets/vm_config_staged.json";