blob: d8e45361feb23ef332cb7a528163a83db91ee95f [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 Wang748b0322023-07-24 12:51:18 +000012 "libciborium_io_nostd",
13 "libciborium_nostd",
Alice Wang9a8b39f2023-04-12 15:31:48 +000014 "libhyp",
Alice Wangdda3ba92023-05-25 15:15:30 +000015 "libfdtpci",
16 "liblibfdt",
David Brazdil05a72fd2022-07-09 17:33:08 +010017 "liblog_rust_nostd",
Alice Wang748b0322023-07-24 12:51:18 +000018 "libservice_vm_comm_nostd",
Alice Wang953a6572023-08-24 13:40:10 +000019 "libtinyvec_nostd",
Alice Wangd36c7112023-07-04 09:50:45 +000020 "libvirtio_drivers",
David Brazdil66fc1202022-07-04 21:48:45 +010021 "libvmbase",
22 ],
David Brazdil66fc1202022-07-04 21:48:45 +010023}
24
25cc_binary {
26 name: "rialto_elf",
27 stem: "rialto",
28 defaults: ["vmbase_elf_defaults"],
29 srcs: [
30 "idmap.S",
31 ],
32 static_libs: [
33 "librialto",
David Brazdil66fc1202022-07-04 21:48:45 +010034 ],
35 linker_scripts: [
36 "image.ld",
37 ":vmbase_sections",
38 ],
David Brazdil66fc1202022-07-04 21:48:45 +010039}
40
41raw_binary {
Alice Wang9a8b39f2023-04-12 15:31:48 +000042 name: "rialto_unsigned",
David Brazdil66fc1202022-07-04 21:48:45 +010043 src: ":rialto_elf",
44 enabled: false,
45 target: {
46 android_arm64: {
47 enabled: true,
48 },
49 },
50}
51
Alice Wang9a8b39f2023-04-12 15:31:48 +000052// python -c "import hashlib; print(hashlib.sha256(b'rialto_salt').hexdigest())"
53rialto_salt = "ea9d8c3ae1785396884d0c16c7652921874e2b8703f336ff23760f2049ee9e29"
54
55filegroup {
56 name: "rialto_sign_key",
57 srcs: [":avb_testkey_rsa4096"],
58}
59
60avb_add_hash_footer {
61 name: "rialto_signed",
62 src: ":empty_file",
63 filename: "rialto",
64 partition_name: "boot",
65 private_key: ":rialto_sign_key",
66 salt: rialto_salt,
Alice Wangab0d0202023-05-17 08:07:41 +000067 props: [
68 {
69 name: "com.android.virt.cap",
70 value: "remote_attest",
71 },
72 ],
Alice Wang9a8b39f2023-04-12 15:31:48 +000073 enabled: false,
74 arch: {
75 arm64: {
76 src: ":rialto_unsigned",
77 enabled: true,
78 },
79 },
80}
81
82prebuilt_etc {
Alan Stokes1294f942023-08-21 14:34:12 +010083 // rialto_bin is a prebuilt target wrapping the signed bare-metal service VM.
Alice Wang9a8b39f2023-04-12 15:31:48 +000084 name: "rialto_bin",
85 filename: "rialto.bin",
86 target: {
87 android_arm64: {
88 src: ":rialto_signed",
89 },
90 },
91 src: ":empty_file",
92 installable: false,
93}
94
David Brazdil66fc1202022-07-04 21:48:45 +010095rust_test {
96 name: "rialto_test",
97 crate_name: "rialto_test",
Nikita Ioffeda1b2732023-09-04 13:46:56 +010098 defaults: ["avf_build_flags_rust"],
David Brazdil66fc1202022-07-04 21:48:45 +010099 srcs: ["tests/test.rs"],
100 prefer_rlib: true,
101 edition: "2021",
102 rustlibs: [
103 "android.system.virtualizationservice-rust",
104 "libandroid_logger",
105 "libanyhow",
106 "liblibc",
107 "liblog_rust",
Alice Wang748b0322023-07-24 12:51:18 +0000108 "libservice_vm_comm",
Alice Wang17dc76e2023-09-06 09:43:52 +0000109 "libservice_vm_manager",
David Brazdil66fc1202022-07-04 21:48:45 +0100110 "libvmclient",
111 ],
112 data: [
Alice Wang9a8b39f2023-04-12 15:31:48 +0000113 ":rialto_unsigned",
David Brazdil66fc1202022-07-04 21:48:45 +0100114 ],
115 test_suites: ["general-tests"],
116 enabled: false,
117 target: {
118 android_arm64: {
119 enabled: true,
120 },
121 },
122}