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