blob: 326f6fc906492e47b2111e8f60da42d1863039b6 [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 Wangc8f88f52023-09-25 14:02:17 +000012 "libbssl_avf_nostd",
Alice Wang7b2ab942023-09-12 13:04:42 +000013 "libbssl_ffi_nostd",
Alice Wang748b0322023-07-24 12:51:18 +000014 "libciborium_io_nostd",
15 "libciborium_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 Wang7b4b6132023-10-05 08:00:16 +000023 "libservice_vm_requests_nostd",
Alice Wang953a6572023-08-24 13:40:10 +000024 "libtinyvec_nostd",
Alice Wangd36c7112023-07-04 09:50:45 +000025 "libvirtio_drivers",
David Brazdil66fc1202022-07-04 21:48:45 +010026 "libvmbase",
Alice Wang7b2ab942023-09-12 13:04:42 +000027 ],
David Brazdil66fc1202022-07-04 21:48:45 +010028}
29
30cc_binary {
31 name: "rialto_elf",
32 stem: "rialto",
33 defaults: ["vmbase_elf_defaults"],
34 srcs: [
35 "idmap.S",
36 ],
37 static_libs: [
38 "librialto",
David Brazdil66fc1202022-07-04 21:48:45 +010039 ],
40 linker_scripts: [
41 "image.ld",
42 ":vmbase_sections",
43 ],
David Brazdil66fc1202022-07-04 21:48:45 +010044}
45
46raw_binary {
Alice Wang9a8b39f2023-04-12 15:31:48 +000047 name: "rialto_unsigned",
David Brazdil66fc1202022-07-04 21:48:45 +010048 src: ":rialto_elf",
49 enabled: false,
50 target: {
51 android_arm64: {
52 enabled: true,
53 },
54 },
55}
56
Alice Wang9a8b39f2023-04-12 15:31:48 +000057// python -c "import hashlib; print(hashlib.sha256(b'rialto_salt').hexdigest())"
58rialto_salt = "ea9d8c3ae1785396884d0c16c7652921874e2b8703f336ff23760f2049ee9e29"
59
60filegroup {
61 name: "rialto_sign_key",
62 srcs: [":avb_testkey_rsa4096"],
63}
64
65avb_add_hash_footer {
66 name: "rialto_signed",
67 src: ":empty_file",
68 filename: "rialto",
69 partition_name: "boot",
70 private_key: ":rialto_sign_key",
71 salt: rialto_salt,
Alice Wangab0d0202023-05-17 08:07:41 +000072 props: [
73 {
74 name: "com.android.virt.cap",
75 value: "remote_attest",
76 },
77 ],
Alice Wang9a8b39f2023-04-12 15:31:48 +000078 enabled: false,
79 arch: {
80 arm64: {
81 src: ":rialto_unsigned",
82 enabled: true,
83 },
84 },
85}
86
87prebuilt_etc {
Alan Stokes1294f942023-08-21 14:34:12 +010088 // rialto_bin is a prebuilt target wrapping the signed bare-metal service VM.
Alice Wang9a8b39f2023-04-12 15:31:48 +000089 name: "rialto_bin",
90 filename: "rialto.bin",
91 target: {
92 android_arm64: {
93 src: ":rialto_signed",
94 },
95 },
96 src: ":empty_file",
97 installable: false,
98}
99
David Brazdil66fc1202022-07-04 21:48:45 +0100100rust_test {
101 name: "rialto_test",
102 crate_name: "rialto_test",
Nikita Ioffeda1b2732023-09-04 13:46:56 +0100103 defaults: ["avf_build_flags_rust"],
David Brazdil66fc1202022-07-04 21:48:45 +0100104 srcs: ["tests/test.rs"],
105 prefer_rlib: true,
106 edition: "2021",
107 rustlibs: [
108 "android.system.virtualizationservice-rust",
109 "libandroid_logger",
110 "libanyhow",
Alice Wangf7c0f942023-09-14 09:33:04 +0000111 "libciborium",
David Brazdil66fc1202022-07-04 21:48:45 +0100112 "liblibc",
113 "liblog_rust",
Alice Wang748b0322023-07-24 12:51:18 +0000114 "libservice_vm_comm",
Alice Wang17dc76e2023-09-06 09:43:52 +0000115 "libservice_vm_manager",
David Brazdil66fc1202022-07-04 21:48:45 +0100116 "libvmclient",
117 ],
118 data: [
Alice Wang9a8b39f2023-04-12 15:31:48 +0000119 ":rialto_unsigned",
David Brazdil66fc1202022-07-04 21:48:45 +0100120 ],
121 test_suites: ["general-tests"],
122 enabled: false,
123 target: {
124 android_arm64: {
125 enabled: true,
126 },
127 },
128}