David Brazdil | 66fc120 | 2022-07-04 21:48:45 +0100 | [diff] [blame] | 1 | package { |
| 2 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 3 | } |
| 4 | |
| 5 | rust_ffi_static { |
| 6 | name: "librialto", |
| 7 | crate_name: "rialto", |
| 8 | srcs: ["src/main.rs"], |
| 9 | edition: "2021", |
| 10 | defaults: ["vmbase_ffi_defaults"], |
| 11 | rustlibs: [ |
| 12 | "libaarch64_paging", |
| 13 | "libbuddy_system_allocator", |
Alice Wang | 9a8b39f | 2023-04-12 15:31:48 +0000 | [diff] [blame^] | 14 | "libhyp", |
David Brazdil | 05a72fd | 2022-07-09 17:33:08 +0100 | [diff] [blame] | 15 | "liblog_rust_nostd", |
Alice Wang | 9a8b39f | 2023-04-12 15:31:48 +0000 | [diff] [blame^] | 16 | "libsmccc", |
David Brazdil | 66fc120 | 2022-07-04 21:48:45 +0100 | [diff] [blame] | 17 | "libvmbase", |
| 18 | ], |
| 19 | apex_available: ["com.android.virt"], |
| 20 | } |
| 21 | |
| 22 | cc_binary { |
| 23 | name: "rialto_elf", |
| 24 | stem: "rialto", |
| 25 | defaults: ["vmbase_elf_defaults"], |
| 26 | srcs: [ |
| 27 | "idmap.S", |
| 28 | ], |
| 29 | static_libs: [ |
| 30 | "librialto", |
| 31 | "libvmbase_entry", |
| 32 | ], |
| 33 | linker_scripts: [ |
| 34 | "image.ld", |
| 35 | ":vmbase_sections", |
| 36 | ], |
| 37 | apex_available: ["com.android.virt"], |
| 38 | } |
| 39 | |
| 40 | raw_binary { |
Alice Wang | 9a8b39f | 2023-04-12 15:31:48 +0000 | [diff] [blame^] | 41 | name: "rialto_unsigned", |
David Brazdil | 66fc120 | 2022-07-04 21:48:45 +0100 | [diff] [blame] | 42 | src: ":rialto_elf", |
| 43 | enabled: false, |
| 44 | target: { |
| 45 | android_arm64: { |
| 46 | enabled: true, |
| 47 | }, |
| 48 | }, |
| 49 | } |
| 50 | |
Alice Wang | 9a8b39f | 2023-04-12 15:31:48 +0000 | [diff] [blame^] | 51 | // python -c "import hashlib; print(hashlib.sha256(b'rialto_salt').hexdigest())" |
| 52 | rialto_salt = "ea9d8c3ae1785396884d0c16c7652921874e2b8703f336ff23760f2049ee9e29" |
| 53 | |
| 54 | filegroup { |
| 55 | name: "rialto_sign_key", |
| 56 | srcs: [":avb_testkey_rsa4096"], |
| 57 | } |
| 58 | |
| 59 | avb_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, |
| 66 | enabled: false, |
| 67 | arch: { |
| 68 | arm64: { |
| 69 | src: ":rialto_unsigned", |
| 70 | enabled: true, |
| 71 | }, |
| 72 | }, |
| 73 | } |
| 74 | |
| 75 | prebuilt_etc { |
| 76 | name: "rialto_bin", |
| 77 | filename: "rialto.bin", |
| 78 | target: { |
| 79 | android_arm64: { |
| 80 | src: ":rialto_signed", |
| 81 | }, |
| 82 | }, |
| 83 | src: ":empty_file", |
| 84 | installable: false, |
| 85 | } |
| 86 | |
David Brazdil | 66fc120 | 2022-07-04 21:48:45 +0100 | [diff] [blame] | 87 | rust_test { |
| 88 | name: "rialto_test", |
| 89 | crate_name: "rialto_test", |
| 90 | srcs: ["tests/test.rs"], |
| 91 | prefer_rlib: true, |
| 92 | edition: "2021", |
| 93 | rustlibs: [ |
| 94 | "android.system.virtualizationservice-rust", |
| 95 | "libandroid_logger", |
| 96 | "libanyhow", |
| 97 | "liblibc", |
| 98 | "liblog_rust", |
| 99 | "libnix", |
| 100 | "libvmclient", |
| 101 | ], |
| 102 | data: [ |
Alice Wang | 9a8b39f | 2023-04-12 15:31:48 +0000 | [diff] [blame^] | 103 | ":rialto_bin", |
| 104 | ":rialto_unsigned", |
David Brazdil | 66fc120 | 2022-07-04 21:48:45 +0100 | [diff] [blame] | 105 | ], |
| 106 | test_suites: ["general-tests"], |
| 107 | enabled: false, |
| 108 | target: { |
| 109 | android_arm64: { |
| 110 | enabled: true, |
| 111 | }, |
| 112 | }, |
| 113 | } |