modularize gsc dump

Bug: 242479757
Test: do bugreport that has the same content as before
Change-Id: I4098775fb4b3f40167920354b2c361d801b11594
This commit is contained in:
Adam Shih 2022-08-22 13:50:54 +08:00
parent 64da5e55c1
commit d7aa396078
5 changed files with 27 additions and 0 deletions

6
dauntless/Android.bp Normal file
View File

@ -0,0 +1,6 @@
sh_binary {
name: "dump_gsc.sh",
src: "dump_gsc.sh",
vendor: true,
sub_dir: "dump",
}

7
dauntless/dump_gsc.sh Normal file
View File

@ -0,0 +1,7 @@
#!/vendor/bin/sh
echo "Citadel VERSION\n"
vendor/bin/hw/citadel_updater -lv
echo "Citadel STATS\n"
vendor/bin/hw/citadel_updater --stats
echo "GSC DEBUG DUMP\n"
vendor/bin/hw/citadel_updater -D

2
dauntless/gsc.mk Normal file
View File

@ -0,0 +1,2 @@
PRODUCT_PACKAGES += dump_gsc.sh
BOARD_VENDOR_SEPOLICY_DIRS += device/google/gs-common/dauntless/sepolicy

View File

@ -0,0 +1,11 @@
type dump_gsc, domain;
type dump_gsc_exec, exec_type, vendor_file_type, file_type;
domain_auto_trans(hal_dumpstate_default, dump_gsc_exec, dump_gsc)
hal_client_domain(dump_gsc, hal_dumpstate)
allow dump_gsc dumpstate:fd use;
allow dump_gsc shell_data_file:file { write getattr };
allow dump_gsc citadel_updater:file execute_no_trans;
allow dump_gsc citadeld_service:service_manager find;
binder_call(dump_gsc, citadeld)
vndbinder_use(dump_gsc)

View File

@ -0,0 +1 @@
/vendor/bin/dump/dump_gsc\.sh u:object_r:dump_gsc_exec:s0