From bd3ba782f25dbc357cf8ac75be340043a7fc03d6 Mon Sep 17 00:00:00 2001 From: Ray Essick Date: Tue, 21 Jan 2020 15:21:08 -0800 Subject: [PATCH] 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 --- debuggerd/Android.bp | 46 ++++++++++++++++++++++++++++++++++++++++++++ debuggerd/Android.mk | 24 ----------------------- 2 files changed, 46 insertions(+), 24 deletions(-) delete mode 100644 debuggerd/Android.mk diff --git a/debuggerd/Android.bp b/debuggerd/Android.bp index c8df3e3c1..e3ce5315f 100644 --- a/debuggerd/Android.bp +++ b/debuggerd/Android.bp @@ -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", + }, + }, +} diff --git a/debuggerd/Android.mk b/debuggerd/Android.mk deleted file mode 100644 index c03b41d2e..000000000 --- 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)