blob: cbec2358a6eb73c24b924afcc9cdee927f741129 [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",
Alice Wang6b486f12023-01-06 13:12:16 +000035 ":microdroid_initrd_normal",
36 ":test_image_with_one_hashdesc",
Alice Wanga78279c2022-12-16 12:41:19 +000037 ":unsigned_test_image",
38 ],
39 rustlibs: [
40 "libanyhow",
41 ],
42 enabled: false,
43 arch: {
44 // Microdroid kernel is only available in these architectures.
45 arm64: {
46 enabled: true,
47 },
48 x86_64: {
49 enabled: true,
50 },
51 },
52}
53
54// Generates a 16KB unsigned image for testing.
55genrule {
56 name: "unsigned_test_image",
57 tools: ["avbtool"],
58 out: ["unsigned_test.img"],
59 cmd: "$(location avbtool) generate_test_image --image_size 16384 --output $(out)",
Alice Wangf3d96b12022-12-15 13:10:47 +000060}
Alice Wang6b486f12023-01-06 13:12:16 +000061
62avb_add_hash_footer {
63 name: "test_image_with_one_hashdesc",
64 src: ":unsigned_test_image",
65 partition_name: "bootloader",
66 private_key: ":pvmfw_sign_key",
67 salt: "1111",
68}