blob: 8a56ebefa619f32e74aa2b8350bd9e6b5a82d3d3 [file] [log] [blame]
David Brazdil66fc1202022-07-04 21:48:45 +01001package {
2 default_applicable_licenses: ["Android-Apache-2.0"],
3}
4
5rust_ffi_static {
6 name: "librialto",
7 crate_name: "rialto",
8 srcs: ["src/main.rs"],
David Brazdil66fc1202022-07-04 21:48:45 +01009 defaults: ["vmbase_ffi_defaults"],
10 rustlibs: [
11 "libaarch64_paging",
Alice Wang7b2ab942023-09-12 13:04:42 +000012 "libbssl_ffi_nostd",
Alice Wang748b0322023-07-24 12:51:18 +000013 "libciborium_io_nostd",
14 "libciborium_nostd",
Alice Wanga78d3f02023-09-13 12:39:16 +000015 "libcoset_nostd",
Alice Wang474c0ee2023-09-14 12:52:33 +000016 "libdiced_open_dice_nostd",
Alice Wang77639bf2023-09-21 06:57:12 +000017 "libdiced_sample_inputs_nostd",
Alice Wang9a8b39f2023-04-12 15:31:48 +000018 "libhyp",
Alice Wangdda3ba92023-05-25 15:15:30 +000019 "libfdtpci",
20 "liblibfdt",
David Brazdil05a72fd2022-07-09 17:33:08 +010021 "liblog_rust_nostd",
Alice Wang748b0322023-07-24 12:51:18 +000022 "libservice_vm_comm_nostd",
Alice Wang953a6572023-08-24 13:40:10 +000023 "libtinyvec_nostd",
Alice Wangd36c7112023-07-04 09:50:45 +000024 "libvirtio_drivers",
David Brazdil66fc1202022-07-04 21:48:45 +010025 "libvmbase",
Alice Wang7b2ab942023-09-12 13:04:42 +000026 "libzeroize_nostd",
27 ],
28 static_libs: [
29 "libcrypto_baremetal",
David Brazdil66fc1202022-07-04 21:48:45 +010030 ],
David Brazdil66fc1202022-07-04 21:48:45 +010031}
32
33cc_binary {
34 name: "rialto_elf",
35 stem: "rialto",
36 defaults: ["vmbase_elf_defaults"],
37 srcs: [
38 "idmap.S",
39 ],
40 static_libs: [
41 "librialto",
David Brazdil66fc1202022-07-04 21:48:45 +010042 ],
43 linker_scripts: [
44 "image.ld",
45 ":vmbase_sections",
46 ],
David Brazdil66fc1202022-07-04 21:48:45 +010047}
48
49raw_binary {
Alice Wang9a8b39f2023-04-12 15:31:48 +000050 name: "rialto_unsigned",
David Brazdil66fc1202022-07-04 21:48:45 +010051 src: ":rialto_elf",
52 enabled: false,
53 target: {
54 android_arm64: {
55 enabled: true,
56 },
57 },
58}
59
Alice Wang9a8b39f2023-04-12 15:31:48 +000060// python -c "import hashlib; print(hashlib.sha256(b'rialto_salt').hexdigest())"
61rialto_salt = "ea9d8c3ae1785396884d0c16c7652921874e2b8703f336ff23760f2049ee9e29"
62
63filegroup {
64 name: "rialto_sign_key",
65 srcs: [":avb_testkey_rsa4096"],
66}
67
68avb_add_hash_footer {
69 name: "rialto_signed",
70 src: ":empty_file",
71 filename: "rialto",
72 partition_name: "boot",
73 private_key: ":rialto_sign_key",
74 salt: rialto_salt,
Alice Wangab0d0202023-05-17 08:07:41 +000075 props: [
76 {
77 name: "com.android.virt.cap",
78 value: "remote_attest",
79 },
80 ],
Alice Wang9a8b39f2023-04-12 15:31:48 +000081 enabled: false,
82 arch: {
83 arm64: {
84 src: ":rialto_unsigned",
85 enabled: true,
86 },
87 },
88}
89
90prebuilt_etc {
Alan Stokes1294f942023-08-21 14:34:12 +010091 // rialto_bin is a prebuilt target wrapping the signed bare-metal service VM.
Alice Wang9a8b39f2023-04-12 15:31:48 +000092 name: "rialto_bin",
93 filename: "rialto.bin",
94 target: {
95 android_arm64: {
96 src: ":rialto_signed",
97 },
98 },
99 src: ":empty_file",
100 installable: false,
101}
102
David Brazdil66fc1202022-07-04 21:48:45 +0100103rust_test {
104 name: "rialto_test",
105 crate_name: "rialto_test",
Nikita Ioffeda1b2732023-09-04 13:46:56 +0100106 defaults: ["avf_build_flags_rust"],
David Brazdil66fc1202022-07-04 21:48:45 +0100107 srcs: ["tests/test.rs"],
108 prefer_rlib: true,
109 edition: "2021",
110 rustlibs: [
111 "android.system.virtualizationservice-rust",
112 "libandroid_logger",
113 "libanyhow",
Alice Wangf7c0f942023-09-14 09:33:04 +0000114 "libciborium",
David Brazdil66fc1202022-07-04 21:48:45 +0100115 "liblibc",
116 "liblog_rust",
Alice Wang748b0322023-07-24 12:51:18 +0000117 "libservice_vm_comm",
Alice Wang17dc76e2023-09-06 09:43:52 +0000118 "libservice_vm_manager",
David Brazdil66fc1202022-07-04 21:48:45 +0100119 "libvmclient",
120 ],
121 data: [
Alice Wang9a8b39f2023-04-12 15:31:48 +0000122 ":rialto_unsigned",
David Brazdil66fc1202022-07-04 21:48:45 +0100123 ],
124 test_suites: ["general-tests"],
125 enabled: false,
126 target: {
127 android_arm64: {
128 enabled: true,
129 },
130 },
131}