Simplified Android Kernel Driver Development With DDK v2
Simplified Android Kernel Driver Development With DDK v2
EXPORT_SYMBOL_GPL(print_from_my_mod); ddk_module(
name = "my_other_mod",
srcs = ["my_other_mod.c",],
out = "my_other_mod.ko",
kernel_build = "//common:kernel",
deps = [
":my_mod",
"//common:all_headers",
],
)
DDK - Overview
Android 14
Documentation: https://android.googlesource.com/kernel/build/+/refs/heads/main/kleaf/docs/ddk/main.md
Android 15 - NEW! - "From empty directory to flashable kernel module in less than 5 minutes" *
kleaf_repository(
name = "kleaf",
// mainline linux + Android patches
branch = "android-mainline",
)
Android 15 - NEW! - Upgrading kernels could be as simple as a one-line change
● Upgrade within same LTS version ● Upgrade to more recent release branch
kleaf_repository( kleaf_repository(
name = "kleaf", name = "kleaf",
- branch = "android14-6.1", - branch = "android15-6.1-2023-03",
+ branch = "android15-6.1", + branch = "android15-6.1-2023-10",
) )
#include <linux/module.h>
void print_from_my_mod(void) {
#ifdef DDK_ANDROID_14
printk(KERN_INFO "Hello from Android 14");
#elif DDK_ANDROID_15
printk(KERN_INFO "Hello from Android 15");
#else
printk(KERN_INFO "Hello");
#endif
};
Android 15 - NEW! - What about upstreaming DDK modules?
YES, please!