blob: 1df18f6a2b6014a57d203289bef2586c03c87ae6 [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 Wang474c0ee2023-09-14 12:52:33 +000014 "libdiced_open_dice_nostd",
Alice Wang9a8b39f2023-04-12 15:31:48 +000015 "libhyp",
Alice Wangdda3ba92023-05-25 15:15:30 +000016 "libfdtpci",
17 "liblibfdt",
David Brazdil05a72fd2022-07-09 17:33:08 +010018 "liblog_rust_nostd",
Alice Wang748b0322023-07-24 12:51:18 +000019 "libservice_vm_comm_nostd",
Alice Wang953a6572023-08-24 13:40:10 +000020 "libtinyvec_nostd",
Alice Wangd36c7112023-07-04 09:50:45 +000021 "libvirtio_drivers",
David Brazdil66fc1202022-07-04 21:48:45 +010022 "libvmbase",
23 ],
David Brazdil66fc1202022-07-04 21:48:45 +010024}
25
26cc_binary {
27 name: "rialto_elf",
28 stem: "rialto",
29 defaults: ["vmbase_elf_defaults"],
30 srcs: [
31 "idmap.S",
32 ],
33 static_libs: [
34 "librialto",
David Brazdil66fc1202022-07-04 21:48:45 +010035 ],
36 linker_scripts: [
37 "image.ld",
38 ":vmbase_sections",
39 ],
David Brazdil66fc1202022-07-04 21:48:45 +010040}
41
42raw_binary {
Alice Wang9a8b39f2023-04-12 15:31:48 +000043 name: "rialto_unsigned",
David Brazdil66fc1202022-07-04 21:48:45 +010044 src: ":rialto_elf",
45 enabled: false,
46 target: {
47 android_arm64: {
48 enabled: true,
49 },
50 },
51}
52
Alice Wang9a8b39f2023-04-12 15:31:48 +000053// python -c "import hashlib; print(hashlib.sha256(b'rialto_salt').hexdigest())"
54rialto_salt = "ea9d8c3ae1785396884d0c16c7652921874e2b8703f336ff23760f2049ee9e29"
55
56filegroup {
57 name: "rialto_sign_key",
58 srcs: [":avb_testkey_rsa4096"],
59}
60
61avb_add_hash_footer {
62 name: "rialto_signed",
63 src: ":empty_file",
64 filename: "rialto",
65 partition_name: "boot",
66 private_key: ":rialto_sign_key",
67 salt: rialto_salt,
Alice Wangab0d0202023-05-17 08:07:41 +000068 props: [
69 {
70 name: "com.android.virt.cap",
71 value: "remote_attest",
72 },
73 ],
Alice Wang9a8b39f2023-04-12 15:31:48 +000074 enabled: false,
75 arch: {
76 arm64: {
77 src: ":rialto_unsigned",
78 enabled: true,
79 },
80 },
81}
82
83prebuilt_etc {
Alan Stokes1294f942023-08-21 14:34:12 +010084 // rialto_bin is a prebuilt target wrapping the signed bare-metal service VM.
Alice Wang9a8b39f2023-04-12 15:31:48 +000085 name: "rialto_bin",
86 filename: "rialto.bin",
87 target: {
88 android_arm64: {
89 src: ":rialto_signed",
90 },
91 },
92 src: ":empty_file",
93 installable: false,
94}
95
David Brazdil66fc1202022-07-04 21:48:45 +010096rust_test {
97 name: "rialto_test",
98 crate_name: "rialto_test",
Nikita Ioffeda1b2732023-09-04 13:46:56 +010099 defaults: ["avf_build_flags_rust"],
David Brazdil66fc1202022-07-04 21:48:45 +0100100 srcs: ["tests/test.rs"],
101 prefer_rlib: true,
102 edition: "2021",
103 rustlibs: [
104 "android.system.virtualizationservice-rust",
105 "libandroid_logger",
106 "libanyhow",
107 "liblibc",
108 "liblog_rust",
Alice Wang748b0322023-07-24 12:51:18 +0000109 "libservice_vm_comm",
Alice Wang17dc76e2023-09-06 09:43:52 +0000110 "libservice_vm_manager",
David Brazdil66fc1202022-07-04 21:48:45 +0100111 "libvmclient",
112 ],
113 data: [
Alice Wang9a8b39f2023-04-12 15:31:48 +0000114 ":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}