blob: 55423eaabed63d6f88e4db11a9d53e1f6e36590d [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",
98 srcs: ["tests/test.rs"],
99 prefer_rlib: true,
100 edition: "2021",
101 rustlibs: [
102 "android.system.virtualizationservice-rust",
103 "libandroid_logger",
104 "libanyhow",
Alice Wang748b0322023-07-24 12:51:18 +0000105 "libciborium",
David Brazdil66fc1202022-07-04 21:48:45 +0100106 "liblibc",
107 "liblog_rust",
108 "libnix",
Alice Wang748b0322023-07-24 12:51:18 +0000109 "libservice_vm_comm",
David Brazdil66fc1202022-07-04 21:48:45 +0100110 "libvmclient",
Alice Wang4e082c32023-07-11 07:41:50 +0000111 "libvsock",
David Brazdil66fc1202022-07-04 21:48:45 +0100112 ],
113 data: [
Alice Wang9a8b39f2023-04-12 15:31:48 +0000114 ":rialto_bin",
115 ":rialto_unsigned",
David Brazdil66fc1202022-07-04 21:48:45 +0100116 ],
117 test_suites: ["general-tests"],
118 enabled: false,
119 target: {
120 android_arm64: {
121 enabled: true,
122 },
123 },
124}