From: Ben Hutchings Date: Tue, 8 Jul 2025 11:30:55 +0000 (+0200) Subject: android: Enable building binder as module X-Git-Tag: archive/raspbian/6.17.13-1+rpi1~2^2~56 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ed9879220f7215653f31526cb5e29a979205a28e;p=linux.git android: Enable building binder as module Bug-Debian: https://bugs.debian.org/901492 We want to enable use of the Android binder driver to support Waydroid, but it should not be built-in as that would waste resources and increase security attack surface on systems that don't need it. - Change the Makefiles to build the driver as an object with the "_linux" suffix (which is what Waydroid expects) - Change config symbol types to tristate - Add a module description, because modpost warns about missing descriptions Gbp-Pq: Topic debian Gbp-Pq: Name android-enable-building-binder-as-module.patch --- diff --git a/drivers/android/Kconfig b/drivers/android/Kconfig index 5b3b8041f82..42f40843c32 100644 --- a/drivers/android/Kconfig +++ b/drivers/android/Kconfig @@ -2,7 +2,7 @@ menu "Android" config ANDROID_BINDER_IPC - bool "Android Binder IPC Driver" + tristate "Android Binder IPC Driver" depends on MMU default n help diff --git a/drivers/android/Makefile b/drivers/android/Makefile index c5d47be0276..ca882c1fd5a 100644 --- a/drivers/android/Makefile +++ b/drivers/android/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only ccflags-y += -I$(src) # needed for trace events -obj-$(CONFIG_ANDROID_BINDERFS) += binderfs.o -obj-$(CONFIG_ANDROID_BINDER_IPC) += binder.o binder_alloc.o -obj-$(CONFIG_ANDROID_BINDER_ALLOC_KUNIT_TEST) += tests/ +obj-$(CONFIG_ANDROID_BINDER_IPC) += binder_linux.o +binder_linux-y := binder.o binder_alloc.o +binder_linux-$(CONFIG_ANDROID_BINDERFS) += binderfs.o +binder_linux-$(CONFIG_ANDROID_BINDER_ALLOC_KUNIT_TEST) += tests/ diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 5702804b92e..375b056aab0 100644 --- a/drivers/android/binder.c +++ b/drivers/android/binder.c @@ -7081,3 +7081,4 @@ device_initcall(binder_init); #include "binder_trace.h" MODULE_LICENSE("GPL v2"); +MODULE_DESCRIPTION("Android Binder IPC Driver"); diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index 979c96b74ca..19dc1a17c36 100644 --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c @@ -39,7 +39,7 @@ enum { }; static uint32_t binder_alloc_debug_mask = BINDER_DEBUG_USER_ERROR; -module_param_named(debug_mask, binder_alloc_debug_mask, +module_param_named(alloc_debug_mask, binder_alloc_debug_mask, uint, 0644); #define binder_alloc_debug(mask, x...) \