blob: 3026d209bdff3d8837b219d9e757f05c71abacb6 [file] [log] [blame]
Alice Wangf3d96b12022-12-15 13:10:47 +00001package {
2 default_applicable_licenses: ["Android-Apache-2.0"],
3}
4
5rust_defaults {
6 name: "libpvmfw_avb_nostd_defaults",
7 crate_name: "pvmfw_avb",
8 srcs: ["src/lib.rs"],
9 prefer_rlib: true,
10 rustlibs: [
11 "libavb_bindgen",
12 ],
Alice Wanga78279c2022-12-16 12:41:19 +000013 whole_static_libs: [
14 "libavb",
15 ],
Alice Wangf3d96b12022-12-15 13:10:47 +000016}
17
18rust_library_rlib {
19 name: "libpvmfw_avb_nostd",
20 defaults: ["libpvmfw_avb_nostd_defaults"],
21 no_stdlibs: true,
22 stdlibs: [
23 "libcore.rust_sysroot",
24 ],
25}
26
27rust_test {
28 name: "libpvmfw_avb.test",
29 defaults: ["libpvmfw_avb_nostd_defaults"],
30 test_suites: ["general-tests"],
Alice Wanga78279c2022-12-16 12:41:19 +000031 data: [
32 ":avb_testkey_rsa2048_pub_bin",
33 ":avb_testkey_rsa4096_pub_bin",
34 ":microdroid_kernel_signed",
35 ":unsigned_test_image",
36 ],
37 rustlibs: [
38 "libanyhow",
39 ],
40 enabled: false,
41 arch: {
42 // Microdroid kernel is only available in these architectures.
43 arm64: {
44 enabled: true,
45 },
46 x86_64: {
47 enabled: true,
48 },
49 },
50}
51
52// Generates a 16KB unsigned image for testing.
53genrule {
54 name: "unsigned_test_image",
55 tools: ["avbtool"],
56 out: ["unsigned_test.img"],
57 cmd: "$(location avbtool) generate_test_image --image_size 16384 --output $(out)",
Alice Wangf3d96b12022-12-15 13:10:47 +000058}