blob: 33c24eb331c4ca9967df12488212bf1471b48f6d [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 Wangd36c7112023-07-04 09:50:45 +000019 "libvirtio_drivers",
David Brazdil66fc1202022-07-04 21:48:45 +010020 "libvmbase",
21 ],
David Brazdil66fc1202022-07-04 21:48:45 +010022}
23
24cc_binary {
25 name: "rialto_elf",
26 stem: "rialto",
27 defaults: ["vmbase_elf_defaults"],
28 srcs: [
29 "idmap.S",
30 ],
31 static_libs: [
32 "librialto",
David Brazdil66fc1202022-07-04 21:48:45 +010033 ],
34 linker_scripts: [
35 "image.ld",
36 ":vmbase_sections",
37 ],
David Brazdil66fc1202022-07-04 21:48:45 +010038}
39
40raw_binary {
Alice Wang9a8b39f2023-04-12 15:31:48 +000041 name: "rialto_unsigned",
David Brazdil66fc1202022-07-04 21:48:45 +010042 src: ":rialto_elf",
43 enabled: false,
44 target: {
45 android_arm64: {
46 enabled: true,
47 },
48 },
49}
50
Alice Wang9a8b39f2023-04-12 15:31:48 +000051// python -c "import hashlib; print(hashlib.sha256(b'rialto_salt').hexdigest())"
52rialto_salt = "ea9d8c3ae1785396884d0c16c7652921874e2b8703f336ff23760f2049ee9e29"
53
54filegroup {
55 name: "rialto_sign_key",
56 srcs: [":avb_testkey_rsa4096"],
57}
58
59avb_add_hash_footer {
60 name: "rialto_signed",
61 src: ":empty_file",
62 filename: "rialto",
63 partition_name: "boot",
64 private_key: ":rialto_sign_key",
65 salt: rialto_salt,
Alice Wangab0d0202023-05-17 08:07:41 +000066 props: [
67 {
68 name: "com.android.virt.cap",
69 value: "remote_attest",
70 },
71 ],
Alice Wang9a8b39f2023-04-12 15:31:48 +000072 enabled: false,
73 arch: {
74 arm64: {
75 src: ":rialto_unsigned",
76 enabled: true,
77 },
78 },
79}
80
81prebuilt_etc {
Alan Stokes1294f942023-08-21 14:34:12 +010082 // rialto_bin is a prebuilt target wrapping the signed bare-metal service VM.
Alice Wang9a8b39f2023-04-12 15:31:48 +000083 name: "rialto_bin",
84 filename: "rialto.bin",
85 target: {
86 android_arm64: {
87 src: ":rialto_signed",
88 },
89 },
90 src: ":empty_file",
91 installable: false,
92}
93
David Brazdil66fc1202022-07-04 21:48:45 +010094rust_test {
95 name: "rialto_test",
96 crate_name: "rialto_test",
97 srcs: ["tests/test.rs"],
98 prefer_rlib: true,
99 edition: "2021",
100 rustlibs: [
101 "android.system.virtualizationservice-rust",
102 "libandroid_logger",
103 "libanyhow",
Alice Wang748b0322023-07-24 12:51:18 +0000104 "libciborium",
David Brazdil66fc1202022-07-04 21:48:45 +0100105 "liblibc",
106 "liblog_rust",
107 "libnix",
Alice Wang748b0322023-07-24 12:51:18 +0000108 "libservice_vm_comm",
David Brazdil66fc1202022-07-04 21:48:45 +0100109 "libvmclient",
Alice Wang4e082c32023-07-11 07:41:50 +0000110 "libvsock",
David Brazdil66fc1202022-07-04 21:48:45 +0100111 ],
112 data: [
Alice Wang9a8b39f2023-04-12 15:31:48 +0000113 ":rialto_bin",
114 ":rialto_unsigned",
David Brazdil66fc1202022-07-04 21:48:45 +0100115 ],
116 test_suites: ["general-tests"],
117 enabled: false,
118 target: {
119 android_arm64: {
120 enabled: true,
121 },
122 },
123}