blob: 05775c278833e0f31e61233825e8c2a89dccf330 [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 Wang77639bf2023-09-21 06:57:12 +000015 "libdiced_sample_inputs_nostd",
Alice Wang9a8b39f2023-04-12 15:31:48 +000016 "libhyp",
Alice Wangdda3ba92023-05-25 15:15:30 +000017 "libfdtpci",
18 "liblibfdt",
David Brazdil05a72fd2022-07-09 17:33:08 +010019 "liblog_rust_nostd",
Alice Wang748b0322023-07-24 12:51:18 +000020 "libservice_vm_comm_nostd",
Alice Wang953a6572023-08-24 13:40:10 +000021 "libtinyvec_nostd",
Alice Wangd36c7112023-07-04 09:50:45 +000022 "libvirtio_drivers",
David Brazdil66fc1202022-07-04 21:48:45 +010023 "libvmbase",
24 ],
David Brazdil66fc1202022-07-04 21:48:45 +010025}
26
27cc_binary {
28 name: "rialto_elf",
29 stem: "rialto",
30 defaults: ["vmbase_elf_defaults"],
31 srcs: [
32 "idmap.S",
33 ],
34 static_libs: [
35 "librialto",
David Brazdil66fc1202022-07-04 21:48:45 +010036 ],
37 linker_scripts: [
38 "image.ld",
39 ":vmbase_sections",
40 ],
David Brazdil66fc1202022-07-04 21:48:45 +010041}
42
43raw_binary {
Alice Wang9a8b39f2023-04-12 15:31:48 +000044 name: "rialto_unsigned",
David Brazdil66fc1202022-07-04 21:48:45 +010045 src: ":rialto_elf",
46 enabled: false,
47 target: {
48 android_arm64: {
49 enabled: true,
50 },
51 },
52}
53
Alice Wang9a8b39f2023-04-12 15:31:48 +000054// python -c "import hashlib; print(hashlib.sha256(b'rialto_salt').hexdigest())"
55rialto_salt = "ea9d8c3ae1785396884d0c16c7652921874e2b8703f336ff23760f2049ee9e29"
56
57filegroup {
58 name: "rialto_sign_key",
59 srcs: [":avb_testkey_rsa4096"],
60}
61
62avb_add_hash_footer {
63 name: "rialto_signed",
64 src: ":empty_file",
65 filename: "rialto",
66 partition_name: "boot",
67 private_key: ":rialto_sign_key",
68 salt: rialto_salt,
Alice Wangab0d0202023-05-17 08:07:41 +000069 props: [
70 {
71 name: "com.android.virt.cap",
72 value: "remote_attest",
73 },
74 ],
Alice Wang9a8b39f2023-04-12 15:31:48 +000075 enabled: false,
76 arch: {
77 arm64: {
78 src: ":rialto_unsigned",
79 enabled: true,
80 },
81 },
82}
83
84prebuilt_etc {
Alan Stokes1294f942023-08-21 14:34:12 +010085 // rialto_bin is a prebuilt target wrapping the signed bare-metal service VM.
Alice Wang9a8b39f2023-04-12 15:31:48 +000086 name: "rialto_bin",
87 filename: "rialto.bin",
88 target: {
89 android_arm64: {
90 src: ":rialto_signed",
91 },
92 },
93 src: ":empty_file",
94 installable: false,
95}
96
David Brazdil66fc1202022-07-04 21:48:45 +010097rust_test {
98 name: "rialto_test",
99 crate_name: "rialto_test",
Nikita Ioffeda1b2732023-09-04 13:46:56 +0100100 defaults: ["avf_build_flags_rust"],
David Brazdil66fc1202022-07-04 21:48:45 +0100101 srcs: ["tests/test.rs"],
102 prefer_rlib: true,
103 edition: "2021",
104 rustlibs: [
105 "android.system.virtualizationservice-rust",
106 "libandroid_logger",
107 "libanyhow",
108 "liblibc",
109 "liblog_rust",
Alice Wang748b0322023-07-24 12:51:18 +0000110 "libservice_vm_comm",
Alice Wang17dc76e2023-09-06 09:43:52 +0000111 "libservice_vm_manager",
David Brazdil66fc1202022-07-04 21:48:45 +0100112 "libvmclient",
113 ],
114 data: [
Alice Wang9a8b39f2023-04-12 15:31:48 +0000115 ":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}