2021-02-04 02:36:27 +00:00
|
|
|
package {
|
|
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
|
|
|
}
|
|
|
|
|
2020-11-05 19:08:10 +00:00
|
|
|
rust_defaults {
|
|
|
|
name: "authfs_defaults",
|
|
|
|
crate_name: "authfs",
|
|
|
|
srcs: [
|
2020-11-13 23:20:24 +00:00
|
|
|
"src/main.rs",
|
2020-11-05 19:08:10 +00:00
|
|
|
],
|
2022-08-31 12:41:28 +00:00
|
|
|
edition: "2021",
|
2020-11-05 19:08:10 +00:00
|
|
|
rustlibs: [
|
2020-12-11 21:31:31 +00:00
|
|
|
"authfs_aidl_interface-rust",
|
2021-04-27 00:07:02 +00:00
|
|
|
"libandroid_logger",
|
2020-11-06 21:50:31 +00:00
|
|
|
"libanyhow",
|
2021-12-13 08:41:24 +00:00
|
|
|
"libauthfs_fsverity_metadata",
|
2021-06-04 23:44:53 +00:00
|
|
|
"libbinder_rs",
|
2020-11-13 23:20:24 +00:00
|
|
|
"libcfg_if",
|
2022-09-12 20:06:26 +00:00
|
|
|
"libclap",
|
2022-01-05 23:38:33 +00:00
|
|
|
"libfsverity_digests_proto_rust",
|
2020-11-13 23:20:24 +00:00
|
|
|
"libfuse_rust",
|
2020-11-05 19:08:10 +00:00
|
|
|
"liblibc",
|
2021-04-27 00:07:02 +00:00
|
|
|
"liblog_rust",
|
2021-12-08 21:04:27 +00:00
|
|
|
"libnix",
|
2022-05-23 18:31:35 +00:00
|
|
|
"libopenssl",
|
2023-03-23 00:27:21 +00:00
|
|
|
"libprotobuf_deprecated",
|
2022-08-08 15:33:34 +00:00
|
|
|
"librpcbinder_rs",
|
2020-11-06 21:49:55 +00:00
|
|
|
"libthiserror",
|
2020-11-05 19:08:10 +00:00
|
|
|
],
|
2021-06-04 22:09:57 +00:00
|
|
|
prefer_rlib: true,
|
2021-01-12 11:02:37 +00:00
|
|
|
target: {
|
|
|
|
darwin: {
|
|
|
|
enabled: false,
|
|
|
|
},
|
|
|
|
},
|
2021-01-11 23:00:10 +00:00
|
|
|
defaults: ["crosvm_defaults"],
|
2020-11-05 19:08:10 +00:00
|
|
|
}
|
|
|
|
|
2020-11-13 23:20:24 +00:00
|
|
|
rust_binary {
|
|
|
|
name: "authfs",
|
2020-11-05 19:08:10 +00:00
|
|
|
defaults: ["authfs_defaults"],
|
2021-03-11 22:19:18 +00:00
|
|
|
apex_available: ["com.android.virt"],
|
2020-11-05 19:08:10 +00:00
|
|
|
}
|
|
|
|
|
2021-01-26 00:07:38 +00:00
|
|
|
rust_test {
|
|
|
|
name: "authfs_device_test_src_lib",
|
|
|
|
defaults: ["authfs_defaults"],
|
2022-02-04 02:49:31 +00:00
|
|
|
test_suites: ["general-tests"],
|
2021-03-10 00:02:14 +00:00
|
|
|
data: [":authfs_test_files"],
|
|
|
|
}
|
|
|
|
|
|
|
|
filegroup {
|
|
|
|
name: "authfs_test_files",
|
|
|
|
srcs: [
|
|
|
|
"testdata/cert.der",
|
2021-02-08 18:51:50 +00:00
|
|
|
"testdata/input.4k",
|
2021-12-13 08:41:24 +00:00
|
|
|
"testdata/input.4k.fsv_meta",
|
2021-02-08 18:51:50 +00:00
|
|
|
"testdata/input.4k1",
|
2021-12-13 08:41:24 +00:00
|
|
|
"testdata/input.4k1.fsv_meta",
|
2021-02-08 18:51:50 +00:00
|
|
|
"testdata/input.4m",
|
2021-12-13 08:41:24 +00:00
|
|
|
"testdata/input.4m.fsv_meta",
|
|
|
|
"testdata/input.4m.fsv_meta.bad_merkle",
|
2021-02-08 18:51:50 +00:00
|
|
|
],
|
2021-01-26 00:07:38 +00:00
|
|
|
}
|
2022-07-04 13:12:53 +00:00
|
|
|
|
|
|
|
java_genrule {
|
|
|
|
name: "authfs_test_apk_assets",
|
|
|
|
out: ["authfs_test_apk_assets.jar"],
|
|
|
|
tools: [
|
|
|
|
"fsverity_manifest_generator",
|
|
|
|
"fsverity",
|
|
|
|
],
|
|
|
|
srcs: [
|
|
|
|
"testdata/input.4k",
|
|
|
|
"testdata/input.4k1",
|
|
|
|
"testdata/input.4m",
|
|
|
|
],
|
|
|
|
/*
|
|
|
|
* Create a JAR file with an assets directory that can merge into the
|
|
|
|
* assets of an APK that depends on it in static_libs. Use this mechanism
|
|
|
|
* to load a generated fsverity manifest for the test input files into the
|
|
|
|
* test VM.
|
|
|
|
*/
|
|
|
|
cmd: "out_dir=$$(dirname $(out))" +
|
|
|
|
"&& assets_dir=\"assets\" " +
|
|
|
|
"&& mkdir -p $$out_dir/$$assets_dir" +
|
|
|
|
"&& $(location fsverity_manifest_generator) " +
|
|
|
|
" --fsverity-path $(location fsverity) " +
|
|
|
|
" --base-dir $$(dirname $(in) | head -1) " +
|
|
|
|
" --output $$out_dir/$$assets_dir/input_manifest.pb " +
|
|
|
|
" $(in) " +
|
|
|
|
"&& jar cf $(out) -C $$out_dir $$assets_dir",
|
|
|
|
}
|