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
diff --git a/debuggerd/Android.bp b/debuggerd/Android.bp
index c8df3e3..e3ce531 100644
--- a/debuggerd/Android.bp
+++ b/debuggerd/Android.bp
@@ -355,3 +355,49 @@
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",
+ },
+ },
+}
diff --git a/debuggerd/Android.mk b/debuggerd/Android.mk
deleted file mode 100644
index c03b41d..0000000
--- a/debuggerd/Android.mk
+++ /dev/null
@@ -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)