• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 //! A tool to start a standalone compsvc server that serves over RPC binder.
18 
19 mod artifact_signer;
20 mod compilation;
21 mod compos_key;
22 mod compsvc;
23 mod fsverity;
24 
25 use anyhow::Result;
26 use compos_common::COMPOS_VSOCK_PORT;
27 use log::{debug, error};
28 
main()29 fn main() {
30     if let Err(e) = try_main() {
31         error!("failed with {:?}", e);
32         std::process::exit(1);
33     }
34 }
35 
try_main() -> Result<()>36 fn try_main() -> Result<()> {
37     android_logger::init_once(
38         android_logger::Config::default()
39             .with_tag("compsvc")
40             .with_max_level(log::LevelFilter::Debug),
41     );
42 
43     debug!("compsvc is starting as a rpc service.");
44     vm_payload::run_single_vsock_service(compsvc::new_binder()?, COMPOS_VSOCK_PORT)
45 }
46