blob: 728c1eb15d19c5590b3d5e2c431ef0b05eba1446 [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",
Pierre-Clément Tosi1bf532b2023-11-13 11:06:20 +000016 "libcstr",
Alice Wang474c0ee2023-09-14 12:52:33 +000017 "libdiced_open_dice_nostd",
Alice Wang77639bf2023-09-21 06:57:12 +000018 "libdiced_sample_inputs_nostd",
Alice Wang9a8b39f2023-04-12 15:31:48 +000019 "libhyp",
Alice Wangdda3ba92023-05-25 15:15:30 +000020 "libfdtpci",
21 "liblibfdt",
David Brazdil05a72fd2022-07-09 17:33:08 +010022 "liblog_rust_nostd",
Alice Wang748b0322023-07-24 12:51:18 +000023 "libservice_vm_comm_nostd",
Alice Wang7b4b6132023-10-05 08:00:16 +000024 "libservice_vm_requests_nostd",
Alice Wang953a6572023-08-24 13:40:10 +000025 "libtinyvec_nostd",
Alice Wangd36c7112023-07-04 09:50:45 +000026 "libvirtio_drivers",
David Brazdil66fc1202022-07-04 21:48:45 +010027 "libvmbase",
Alice Wang7b2ab942023-09-12 13:04:42 +000028 ],
David Brazdil66fc1202022-07-04 21:48:45 +010029}
30
31cc_binary {
32 name: "rialto_elf",
33 stem: "rialto",
34 defaults: ["vmbase_elf_defaults"],
35 srcs: [
36 "idmap.S",
37 ],
38 static_libs: [
39 "librialto",
David Brazdil66fc1202022-07-04 21:48:45 +010040 ],
41 linker_scripts: [
42 "image.ld",
43 ":vmbase_sections",
44 ],
David Brazdil66fc1202022-07-04 21:48:45 +010045}
46
47raw_binary {
Alice Wang9a8b39f2023-04-12 15:31:48 +000048 name: "rialto_unsigned",
David Brazdil66fc1202022-07-04 21:48:45 +010049 src: ":rialto_elf",
50 enabled: false,
51 target: {
52 android_arm64: {
53 enabled: true,
54 },
55 },
56}
57
Alice Wang9a8b39f2023-04-12 15:31:48 +000058// python -c "import hashlib; print(hashlib.sha256(b'rialto_salt').hexdigest())"
59rialto_salt = "ea9d8c3ae1785396884d0c16c7652921874e2b8703f336ff23760f2049ee9e29"
60
61filegroup {
62 name: "rialto_sign_key",
63 srcs: [":avb_testkey_rsa4096"],
64}
65
66avb_add_hash_footer {
67 name: "rialto_signed",
68 src: ":empty_file",
69 filename: "rialto",
70 partition_name: "boot",
71 private_key: ":rialto_sign_key",
72 salt: rialto_salt,
Alice Wangab0d0202023-05-17 08:07:41 +000073 props: [
74 {
75 name: "com.android.virt.cap",
76 value: "remote_attest",
77 },
78 ],
Alice Wang9a8b39f2023-04-12 15:31:48 +000079 enabled: false,
80 arch: {
81 arm64: {
82 src: ":rialto_unsigned",
83 enabled: true,
84 },
85 },
86}
87
88prebuilt_etc {
Alan Stokes1294f942023-08-21 14:34:12 +010089 // rialto_bin is a prebuilt target wrapping the signed bare-metal service VM.
Alice Wang9a8b39f2023-04-12 15:31:48 +000090 name: "rialto_bin",
91 filename: "rialto.bin",
92 target: {
93 android_arm64: {
94 src: ":rialto_signed",
95 },
96 },
97 src: ":empty_file",
98 installable: false,
99}
100
David Brazdil66fc1202022-07-04 21:48:45 +0100101rust_test {
102 name: "rialto_test",
103 crate_name: "rialto_test",
Nikita Ioffeda1b2732023-09-04 13:46:56 +0100104 defaults: ["avf_build_flags_rust"],
David Brazdil66fc1202022-07-04 21:48:45 +0100105 srcs: ["tests/test.rs"],
106 prefer_rlib: true,
107 edition: "2021",
108 rustlibs: [
109 "android.system.virtualizationservice-rust",
110 "libandroid_logger",
111 "libanyhow",
Alice Wangf7c0f942023-09-14 09:33:04 +0000112 "libciborium",
Alice Wangde6bee52023-11-10 09:58:40 +0000113 "libclient_vm_csr",
114 "libdiced_sample_inputs",
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}