Skip to content
Snippets Groups Projects
Select Git revision
  • 182e2cc70888e3b8096a19d2d320a68569bea88c
  • master default protected
  • android-7.1.2_r28_klist
  • pie-cts-release
  • pie-vts-release
  • pie-cts-dev
  • oreo-mr1-iot-release
  • sdk-release
  • oreo-m6-s4-release
  • oreo-m4-s12-release
  • pie-release
  • pie-r2-release
  • pie-r2-s1-release
  • oreo-vts-release
  • oreo-cts-release
  • oreo-dev
  • oreo-mr1-dev
  • pie-gsi
  • pie-platform-release
  • pie-dev
  • oreo-cts-dev
  • android-o-mr1-iot-release-1.0.4
  • android-9.0.0_r8
  • android-9.0.0_r7
  • android-9.0.0_r6
  • android-9.0.0_r5
  • android-8.1.0_r46
  • android-8.1.0_r45
  • android-n-iot-release-smart-display-r2
  • android-vts-8.1_r5
  • android-cts-8.1_r8
  • android-cts-8.0_r12
  • android-cts-7.1_r20
  • android-cts-7.0_r24
  • android-o-mr1-iot-release-1.0.3
  • android-cts-9.0_r1
  • android-8.1.0_r43
  • android-8.1.0_r42
  • android-n-iot-release-smart-display
  • android-p-preview-5
  • android-9.0.0_r3
41 results

Android.mk

Blame
  • Android.mk 7.12 KiB
    LOCAL_PATH:= $(call my-dir)
    
    include $(CLEAR_VARS)
    
    # Force permissive domains to be unconfined+enforcing?
    #
    # During development, this should be set to false.
    # Permissive means permissive.
    #
    # When we're close to a release and SELinux new policy development
    # is frozen, we should flip this to true. This forces any currently
    # permissive domains into unconfined+enforcing.
    #
    FORCE_PERMISSIVE_TO_UNCONFINED:=false
    
    ifeq ($(TARGET_BUILD_VARIANT),user)
      # User builds are always forced unconfined+enforcing
      FORCE_PERMISSIVE_TO_UNCONFINED:=true
    endif
    
    # SELinux policy version.
    # Must be <= /selinux/policyvers reported by the Android kernel.
    # Must be within the compatibility range reported by checkpolicy -V.
    POLICYVERS ?= 26
    
    MLS_SENS=1
    MLS_CATS=1024
    
    # Quick edge case error detection for BOARD_SEPOLICY_REPLACE.
    # Builds the singular path for each replace file.
    sepolicy_replace_paths :=
    $(foreach pf, $(BOARD_SEPOLICY_REPLACE), \
      $(if $(filter $(pf), $(BOARD_SEPOLICY_UNION)), \
        $(error Ambiguous request for sepolicy $(pf). Appears in both \
          BOARD_SEPOLICY_REPLACE and BOARD_SEPOLICY_UNION), \
      ) \
      $(eval _paths := $(filter-out $(BOARD_SEPOLICY_IGNORE), \
      $(wildcard $(addsuffix /$(pf), $(BOARD_SEPOLICY_DIRS))))) \
      $(eval _occurrences := $(words $(_paths))) \
      $(if $(filter 0,$(_occurrences)), \
        $(error No sepolicy file found for $(pf) in $(BOARD_SEPOLICY_DIRS)), \
      ) \
      $(if $(filter 1, $(_occurrences)), \
        $(eval sepolicy_replace_paths += $(_paths)), \
        $(error Multiple occurrences of replace file $(pf) in $(_paths)) \
      ) \
      $(if $(filter 0, $(words $(wildcard $(addsuffix /$(pf), $(LOCAL_PATH))))), \
        $(error Specified the sepolicy file $(pf) in BOARD_SEPOLICY_REPLACE, \
          but none found in $(LOCAL_PATH)), \
      ) \
    )
    
    # Quick edge case error detection for BOARD_SEPOLICY_UNION.
    # This ensures that a requested union file exists somewhere
    # in one of the listed BOARD_SEPOLICY_DIRS.
    $(foreach pf, $(BOARD_SEPOLICY_UNION), \
      $(if $(filter 0, $(words $(wildcard $(addsuffix /$(pf), $(BOARD_SEPOLICY_DIRS))))), \
        $(error No sepolicy file found for $(pf) in $(BOARD_SEPOLICY_DIRS)), \
      ) \
    )
    
    # Builds paths for all requested policy files w.r.t
    # both BOARD_SEPOLICY_REPLACE and BOARD_SEPOLICY_UNION
    # product variables.
    # $(1): the set of policy name paths to build
    build_policy = $(foreach type, $(1), \
      $(filter-out $(BOARD_SEPOLICY_IGNORE), \
        $(foreach expanded_type, $(notdir $(wildcard $(addsuffix /$(type), $(LOCAL_PATH)))), \
          $(if $(filter $(expanded_type), $(BOARD_SEPOLICY_REPLACE)), \
            $(wildcard $(addsuffix $(expanded_type), $(sort $(dir $(sepolicy_replace_paths))))), \