blob: cb3e477703af759d6dbfdcf5f38315680606a6f2 [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 Wang474c0ee2023-09-14 12:52:33 +000015 "libdiced_open_dice_nostd",
Alice Wang77639bf2023-09-21 06:57:12 +000016 "libdiced_sample_inputs_nostd",
Alice Wang9a8b39f2023-04-12 15:31:48 +000017 "libhyp",
Alice Wangdda3ba92023-05-25 15:15:30 +000018 "libfdtpci",
19 "liblibfdt",
David Brazdil05a72fd2022-07-09 17:33:08 +010020 "liblog_rust_nostd",
Alice Wang748b0322023-07-24 12:51:18 +000021 "libservice_vm_comm_nostd",
Alice Wang953a6572023-08-24 13:40:10 +000022 "libtinyvec_nostd",
Alice Wangd36c7112023-07-04 09:50:45 +000023 "libvirtio_drivers",
David Brazdil66fc1202022-07-04 21:48:45 +010024 "libvmbase",
Alice Wang7b2ab942023-09-12 13:04:42 +000025 "libzeroize_nostd",
26 ],
27 static_libs: [
28 "libcrypto_baremetal",
David Brazdil66fc1202022-07-04 21:48:45 +010029 ],
David Brazdil66fc1202022-07-04 21:48:45 +010030}
31
32cc_binary {
33 name: "rialto_elf",
34 stem: "rialto",
35 defaults: ["vmbase_elf_defaults"],
36 srcs: [
37 "idmap.S",
38 ],
39 static_libs: [
40 "librialto",
David Brazdil66fc1202022-07-04 21:48:45 +010041 ],
42 linker_scripts: [
43 "image.ld",
44 ":vmbase_sections",
45 ],
David Brazdil66fc1202022-07-04 21:48:45 +010046}
47
48raw_binary {
Alice Wang9a8b39f2023-04-12 15:31:48 +000049 name: "rialto_unsigned",
David Brazdil66fc1202022-07-04 21:48:45 +010050 src: ":rialto_elf",
51 enabled: false,
52 target: {
53 android_arm64: {
54 enabled: true,
55 },
56 },
57}
58
Alice Wang9a8b39f2023-04-12 15:31:48 +000059// python -c "import hashlib; print(hashlib.sha256(b'rialto_salt').hexdigest())"
60rialto_salt = "ea9d8c3ae1785396884d0c16c7652921874e2b8703f336ff23760f2049ee9e29"
61
62filegroup {
63 name: "rialto_sign_key",
64 srcs: [":avb_testkey_rsa4096"],
65}
66
67avb_add_hash_footer {
68 name: "rialto_signed",
69 src: ":empty_file",
70 filename: "rialto",
71 partition_name: "boot",
72 private_key: ":rialto_sign_key",
73 salt: rialto_salt,
Alice Wangab0d0202023-05-17 08:07:41 +000074 props: [
75 {
76 name: "com.android.virt.cap",
77 value: "remote_attest",
78 },
79 ],
Alice Wang9a8b39f2023-04-12 15:31:48 +000080 enabled: false,
81 arch: {
82 arm64: {
83 src: ":rialto_unsigned",
84 enabled: true,
85 },
86 },
87}
88
89prebuilt_etc {
Alan Stokes1294f942023-08-21 14:34:12 +010090 // rialto_bin is a prebuilt target wrapping the signed bare-metal service VM.
Alice Wang9a8b39f2023-04-12 15:31:48 +000091 name: "rialto_bin",
92 filename: "rialto.bin",
93 target: {
94 android_arm64: {
95 src: ":rialto_signed",
96 },
97 },
98 src: ":empty_file",
99 installable: false,
100}
101
David Brazdil66fc1202022-07-04 21:48:45 +0100102rust_test {
103 name: "rialto_test",
104 crate_name: "rialto_test",
Nikita Ioffeda1b2732023-09-04 13:46:56 +0100105 defaults: ["avf_build_flags_rust"],
David Brazdil66fc1202022-07-04 21:48:45 +0100106 srcs: ["tests/test.rs"],
107 prefer_rlib: true,
108 edition: "2021",
109 rustlibs: [
110 "android.system.virtualizationservice-rust",
111 "libandroid_logger",
112 "libanyhow",
113 "liblibc",
114 "liblog_rust",
Alice Wang748b0322023-07-24 12:51:18 +0000115 "libservice_vm_comm",
Alice Wang17dc76e2023-09-06 09:43:52 +0000116 "libservice_vm_manager",
David Brazdil66fc1202022-07-04 21:48:45 +0100117 "libvmclient",
118 ],
119 data: [
Alice Wang9a8b39f2023-04-12 15:31:48 +0000120 ":rialto_unsigned",
David Brazdil66fc1202022-07-04 21:48:45 +0100121 ],
122 test_suites: ["general-tests"],
123 enabled: false,
124 target: {
125 android_arm64: {
126 enabled: true,
127 },
128 },
129}