aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Klyubin2017-03-10 11:36:07 -0600
committerAlex Klyubin2017-03-10 12:06:26 -0600
commit84aa74218421f8d2dbad1408ba114f680331ace0 (patch)
tree97670a915d3395b5ead94f21e275375ddab285e8 /Android.mk
parentde41e81fa99ef8f6060d72544e1c76802419627b (diff)
downloadsystem-sepolicy-84aa74218421f8d2dbad1408ba114f680331ace0.tar.gz
system-sepolicy-84aa74218421f8d2dbad1408ba114f680331ace0.tar.xz
system-sepolicy-84aa74218421f8d2dbad1408ba114f680331ace0.zip
Remove unnecessary recovery-related targets
Recovery should always use monolithic policy. Thus, we don't need split policy files *.recovery.cil. This commit removes these targets and rolls up the relevant parts of the targets into "sepolicy.recovery" which is the target which produces monolithic policy for recovery. Test: make clean && make sepolicy.recovery, then confirm that repolicy.recovery is identical to the one produced prior to this change. Test: Clean build, flash, device boots up fine, no new denials. Device also boots into recovery just fine, no denials. Bug: 31363362 Change-Id: I7f698abe1f17308f2f03f5ed1b727a8b071e94c7
Diffstat (limited to 'Android.mk')
-rw-r--r--Android.mk97
1 files changed, 16 insertions, 81 deletions
diff --git a/Android.mk b/Android.mk
index 3975f769..39b97157 100644
--- a/Android.mk
+++ b/Android.mk
@@ -433,7 +433,18 @@ $(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/secilc $(HOST_OUT_EXECUTABLES)/se
433built_sepolicy := $(LOCAL_BUILT_MODULE) 433built_sepolicy := $(LOCAL_BUILT_MODULE)
434all_cil_files := 434all_cil_files :=
435 435
436################################## 436#################################
437include $(CLEAR_VARS)
438
439# keep concrete sepolicy for neverallow checks
440
441LOCAL_MODULE := sepolicy.recovery
442LOCAL_MODULE_CLASS := ETC
443LOCAL_MODULE_TAGS := optional
444LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
445
446include $(BUILD_SYSTEM)/base_rules.mk
447
437plat_pub_policy.recovery.conf := $(intermediates)/plat_pub_policy.recovery.conf 448plat_pub_policy.recovery.conf := $(intermediates)/plat_pub_policy.recovery.conf
438$(plat_pub_policy.recovery.conf): PRIVATE_MLS_SENS := $(MLS_SENS) 449$(plat_pub_policy.recovery.conf): PRIVATE_MLS_SENS := $(MLS_SENS)
439$(plat_pub_policy.recovery.conf): PRIVATE_MLS_CATS := $(MLS_CATS) 450$(plat_pub_policy.recovery.conf): PRIVATE_MLS_CATS := $(MLS_CATS)
@@ -461,16 +472,6 @@ $(plat_pub_policy.recovery.conf) $(reqd_policy_mask.cil)
461 472
462plat_pub_policy.recovery.conf := 473plat_pub_policy.recovery.conf :=
463 474
464#################################
465include $(CLEAR_VARS)
466
467LOCAL_MODULE := plat_sepolicy.recovery.cil
468LOCAL_MODULE_CLASS := ETC
469LOCAL_MODULE_TAGS := optional
470LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
471
472include $(BUILD_SYSTEM)/base_rules.mk
473
474plat_policy.recovery.conf := $(intermediates)/plat_policy.recovery.conf 475plat_policy.recovery.conf := $(intermediates)/plat_policy.recovery.conf
475$(plat_policy.recovery.conf): PRIVATE_MLS_SENS := $(MLS_SENS) 476$(plat_policy.recovery.conf): PRIVATE_MLS_SENS := $(MLS_SENS)
476$(plat_policy.recovery.conf): PRIVATE_MLS_CATS := $(MLS_CATS) 477$(plat_policy.recovery.conf): PRIVATE_MLS_CATS := $(MLS_CATS)
@@ -493,29 +494,8 @@ $(plat_policy_nvr.recovery): $(plat_policy.recovery.conf) $(HOST_OUT_EXECUTABLES
493 @mkdir -p $(dir $@) 494 @mkdir -p $(dir $@)
494 $(hide) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -C -c $(POLICYVERS) -o $@ $< 495 $(hide) $(HOST_OUT_EXECUTABLES)/checkpolicy -M -C -c $(POLICYVERS) -o $@ $<
495 496
496$(LOCAL_BUILT_MODULE): PRIVATE_CIL_FILES := $(plat_policy_nvr.recovery)
497$(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/secilc $(plat_policy_nvr.recovery)
498 @mkdir -p $(dir $@)
499 # Strip out neverallow statements. They aren't needed on-device and their presence
500 # significantly slows down on-device compilation (e.g., from 400 ms to 6,400 ms on
501 # sailfish-eng).
502 grep -v '^(neverallow' $(PRIVATE_CIL_FILES) > $@
503 # Confirm that the resulting policy compiles
504 $(hide) $(HOST_OUT_EXECUTABLES)/secilc -M true -c $(POLICYVERS) $@ -o /dev/null -f /dev/null
505
506built_plat_cil.recovery := $(LOCAL_BUILT_MODULE)
507plat_policy.recovery.conf := 497plat_policy.recovery.conf :=
508 498
509#################################
510include $(CLEAR_VARS)
511
512LOCAL_MODULE := mapping_sepolicy.recovery.cil
513LOCAL_MODULE_CLASS := ETC
514LOCAL_MODULE_TAGS := optional
515LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
516
517include $(BUILD_SYSTEM)/base_rules.mk
518
519# auto-generate the mapping file for current platform policy, since it needs to 499# auto-generate the mapping file for current platform policy, since it needs to
520# track platform policy development 500# track platform policy development
521current_mapping.recovery.cil := $(intermediates)/mapping/current.recovery.cil 501current_mapping.recovery.cil := $(intermediates)/mapping/current.recovery.cil
@@ -531,25 +511,8 @@ mapping_policy_nvr.recovery := $(addsuffix /$(BOARD_SEPOLICY_VERS).recovery.cil,
531$(PLAT_PRIVATE_POLICY)/mapping) 511$(PLAT_PRIVATE_POLICY)/mapping)
532endif 512endif
533 513
534$(LOCAL_BUILT_MODULE): $(mapping_policy_nvr.recovery)
535 # Strip out neverallow statements. They aren't needed on-device and their presence
536 # significantly slows down on-device compilation (e.g., from 400 ms to 6,400 ms on
537 # sailfish-eng).
538 grep -v '^(neverallow' $< > $@
539
540built_mapping_cil.recovery := $(LOCAL_BUILT_MODULE)
541current_mapping.recovery.cil := 514current_mapping.recovery.cil :=
542 515
543#################################
544include $(CLEAR_VARS)
545
546LOCAL_MODULE := nonplat_sepolicy.recovery.cil
547LOCAL_MODULE_CLASS := ETC
548LOCAL_MODULE_TAGS := optional
549LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
550
551include $(BUILD_SYSTEM)/base_rules.mk
552
553# nonplat_policy.recovery.conf - A combination of the non-platform private, 516# nonplat_policy.recovery.conf - A combination of the non-platform private,
554# vendor and the exported platform policy associated with the version the 517# vendor and the exported platform policy associated with the version the
555# non-platform policy targets. This needs attributization and to be combined 518# non-platform policy targets. This needs attributization and to be combined
@@ -590,35 +553,9 @@ $(HOST_OUT_EXECUTABLES)/version_policy
590 @mkdir -p $(dir $@) 553 @mkdir -p $(dir $@)
591 $(HOST_OUT_EXECUTABLES)/version_policy -b $< -t $(PRIVATE_TGT_POL) -n $(PRIVATE_VERS) -o $@ 554 $(HOST_OUT_EXECUTABLES)/version_policy -b $< -t $(PRIVATE_TGT_POL) -n $(PRIVATE_VERS) -o $@
592 555
593$(LOCAL_BUILT_MODULE): PRIVATE_NONPLAT_CIL_FILES := $(nonplat_policy_nvr.recovery)
594$(LOCAL_BUILT_MODULE): PRIVATE_DEP_CIL_FILES := $(built_plat_cil.recovery) \
595$(built_mapping_cil.recovery)
596$(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/secilc $(nonplat_policy_nvr.recovery) \
597$(built_plat_cil.recovery) $(built_mapping_cil.recovery)
598 @mkdir -p $(dir $@)
599 # Strip out neverallow statements. They aren't needed on-device and their presence
600 # significantly slows down on-device compilation (e.g., from 400 ms to 6,400 ms on
601 # sailfish-eng).
602 grep -v '^(neverallow' $(PRIVATE_NONPLAT_CIL_FILES) > $@
603 # Confirm that the resulting policy compiles combined with platform and mapping policies
604 $(hide) $(HOST_OUT_EXECUTABLES)/secilc -M true -c $(POLICYVERS) \
605 $(PRIVATE_DEP_CIL_FILES) $@ -o /dev/null -f /dev/null
606
607nonplat_policy.recovery.conf := 556nonplat_policy.recovery.conf :=
608nonplat_policy_raw.recovery := 557nonplat_policy_raw.recovery :=
609 558
610##################################
611include $(CLEAR_VARS)
612
613# keep concrete sepolicy for neverallow checks
614
615LOCAL_MODULE := sepolicy.recovery
616LOCAL_MODULE_CLASS := ETC
617LOCAL_MODULE_TAGS := optional
618LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
619
620include $(BUILD_SYSTEM)/base_rules.mk
621
622all_cil_files.recovery := \ 559all_cil_files.recovery := \
623 $(plat_policy_nvr.recovery) \ 560 $(plat_policy_nvr.recovery) \
624 $(mapping_policy_nvr.recovery) \ 561 $(mapping_policy_nvr.recovery) \
@@ -639,6 +576,10 @@ $(LOCAL_BUILT_MODULE): $(HOST_OUT_EXECUTABLES)/secilc $(HOST_OUT_EXECUTABLES)/se
639 $(hide) mv $@.tmp $@ 576 $(hide) mv $@.tmp $@
640 577
641all_cil_files.recovery := 578all_cil_files.recovery :=
579plat_pub_policy.recovery.cil :=
580plat_policy_nvr.recovery :=
581mapping_policy_nvr.recovery :=
582nonplat_policy_nvr.recovery :=
642 583
643################################## 584##################################
644include $(CLEAR_VARS) 585include $(CLEAR_VARS)
@@ -1093,9 +1034,7 @@ built_general_sepolicy :=
1093built_general_sepolicy.conf := 1034built_general_sepolicy.conf :=
1094built_nl := 1035built_nl :=
1095built_plat_cil := 1036built_plat_cil :=
1096built_plat_cil.recovery :=
1097built_mapping_cil := 1037built_mapping_cil :=
1098built_mapping_cil.recovery :=
1099built_plat_pc := 1038built_plat_pc :=
1100built_nonplat_cil := 1039built_nonplat_cil :=
1101built_nonplat_pc := 1040built_nonplat_pc :=
@@ -1106,14 +1045,10 @@ built_sepolicy :=
1106built_plat_svc := 1045built_plat_svc :=
1107built_nonplat_svc := 1046built_nonplat_svc :=
1108mapping_policy_nvr := 1047mapping_policy_nvr :=
1109mapping_policy_nvr.recovery :=
1110my_target_arch := 1048my_target_arch :=
1111nonplat_policy_nvr := 1049nonplat_policy_nvr :=
1112nonplat_policy_nvr.recovery :=
1113plat_policy_nvr := 1050plat_policy_nvr :=
1114plat_policy_nvr.recovery :=
1115plat_pub_policy.cil := 1051plat_pub_policy.cil :=
1116plat_pub_policy.recovery.cil :=
1117reqd_policy_mask.cil := 1052reqd_policy_mask.cil :=
1118sepolicy_build_files := 1053sepolicy_build_files :=
1119 1054