build crash_dump.policy files using Android.bp

use Android.bp instead of Android.mk to build and install the
crash_dump.policy files. This also allows mainline modules to pull
the files into their apex (dependency wasn't handled for Android.mk)

Bug: 147914640
Test: build, examine generated filesystem
Change-Id: Iae92d4f9d683ccfddf1716e7eb2877b7bff0c737
This commit is contained in:
Ray Essick 2020-01-21 15:21:08 -08:00
parent 60a55d91dc
commit bd3ba782f2
2 changed files with 46 additions and 24 deletions

View file

@ -355,3 +355,49 @@ cc_binary {
init_rc: ["tombstoned/tombstoned.rc"],
}
prebuilt_etc {
name: "crash_dump.policy",
sub_dir: "seccomp_policy",
filename_from_src: true,
arch: {
arm: {
src: "seccomp_policy/crash_dump.arm.policy",
},
arm64: {
src: "seccomp_policy/crash_dump.arm64.policy",
},
x86: {
src: "seccomp_policy/crash_dump.x86.policy",
},
x86_64: {
src: "seccomp_policy/crash_dump.x86_64.policy",
},
},
required: [
"crash_dump.policy_other",
],
}
// NB -- this installs "the other" architecture. (puts 32 bit config in on 64 bit device)
// or at least that is the intention so that we get both of them populated
prebuilt_etc {
name: "crash_dump.policy_other",
sub_dir: "seccomp_policy",
filename_from_src: true,
arch: {
arm: {
src: "seccomp_policy/crash_dump.arm64.policy",
},
arm64: {
src: "seccomp_policy/crash_dump.arm.policy",
},
x86: {
src: "seccomp_policy/crash_dump.x86_64.policy",
},
x86_64: {
src: "seccomp_policy/crash_dump.x86.policy",
},
},
}

View file

@ -1,24 +0,0 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := crash_dump.policy
LOCAL_MODULE_CLASS := ETC
LOCAL_MULTILIB := both
ifeq ($(TARGET_ARCH), $(filter $(TARGET_ARCH), arm arm64))
LOCAL_MODULE_STEM_32 := crash_dump.arm.policy
LOCAL_MODULE_STEM_64 := crash_dump.arm64.policy
endif
ifeq ($(TARGET_ARCH), $(filter $(TARGET_ARCH), x86 x86_64))
LOCAL_MODULE_STEM_32 := crash_dump.x86.policy
LOCAL_MODULE_STEM_64 := crash_dump.x86_64.policy
endif
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/seccomp_policy
LOCAL_SRC_FILES_arm := seccomp_policy/crash_dump.arm.policy
LOCAL_SRC_FILES_arm64 := seccomp_policy/crash_dump.arm64.policy
LOCAL_SRC_FILES_x86 := seccomp_policy/crash_dump.x86.policy
LOCAL_SRC_FILES_x86_64 := seccomp_policy/crash_dump.x86_64.policy
LOCAL_MODULE_TARGET_ARCH := arm arm64 x86 x86_64
include $(BUILD_PREBUILT)