mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-26 12:30:23 +09:00
ANDROID: Add arch specific gki module list targets
* This is a no-op change preparing for the split of target and files based on the architecture used. Bug: 293529933 Signed-off-by: Ulises Mendez Martinez <umendez@google.com> (cherry picked from commit 49f32a8f1e8b67f7080f53fd03a4edb3ea82723a) (cherry picked from https://android-review.googlesource.com/q/commit:c7c756c61b9f6067a32252c20f0ed08cfd4a02a4) Merged-In: I7783b60e591aaad23b5446af5cb04af5765f4b3f Change-Id: I7783b60e591aaad23b5446af5cb04af5765f4b3f
This commit is contained in:
46
BUILD.bazel
46
BUILD.bazel
@@ -15,7 +15,7 @@ load(
|
||||
"kernel_unstripped_modules_archive",
|
||||
"merged_kernel_uapi_headers",
|
||||
)
|
||||
load(":modules.bzl", "COMMON_GKI_MODULES_LIST")
|
||||
load(":modules.bzl", "get_gki_modules_list")
|
||||
|
||||
package(
|
||||
default_visibility = [
|
||||
@@ -40,10 +40,38 @@ checkpatch(
|
||||
checkpatch_pl = "scripts/checkpatch.pl",
|
||||
)
|
||||
|
||||
# Deprecated - Use arch specific files from below.
|
||||
write_file(
|
||||
name = "gki_system_dlkm_modules",
|
||||
out = "android/gki_system_dlkm_modules",
|
||||
content = COMMON_GKI_MODULES_LIST + [
|
||||
content = get_gki_modules_list("arm64") + [
|
||||
# Ensure new line at the end.
|
||||
"",
|
||||
],
|
||||
)
|
||||
|
||||
write_file(
|
||||
name = "gki_system_dlkm_modules_arm64",
|
||||
out = "android/gki_system_dlkm_modules_arm64",
|
||||
content = get_gki_modules_list("arm64") + [
|
||||
# Ensure new line at the end.
|
||||
"",
|
||||
],
|
||||
)
|
||||
|
||||
write_file(
|
||||
name = "gki_system_dlkm_modules_x86_64",
|
||||
out = "android/gki_system_dlkm_modules_x86_64",
|
||||
content = get_gki_modules_list("x86_64") + [
|
||||
# Ensure new line at the end.
|
||||
"",
|
||||
],
|
||||
)
|
||||
|
||||
write_file(
|
||||
name = "gki_system_dlkm_modules_risc64",
|
||||
out = "android/gki_system_dlkm_modules_riscv64",
|
||||
content = get_gki_modules_list("riscv64") + [
|
||||
# Ensure new line at the end.
|
||||
"",
|
||||
],
|
||||
@@ -73,41 +101,41 @@ filegroup(
|
||||
define_common_kernels(target_configs = {
|
||||
"kernel_aarch64": {
|
||||
"kmi_symbol_list_strict_mode": True,
|
||||
"module_implicit_outs": COMMON_GKI_MODULES_LIST,
|
||||
"kmi_symbol_list": "android/abi_gki_aarch64",
|
||||
"kmi_symbol_list_add_only": True,
|
||||
"additional_kmi_symbol_lists": [":aarch64_additional_kmi_symbol_lists"],
|
||||
"protected_exports_list": "android/abi_gki_protected_exports_aarch64",
|
||||
"protected_modules_list": "android/gki_aarch64_protected_modules",
|
||||
"module_implicit_outs": get_gki_modules_list("arm64"),
|
||||
"make_goals": _GKI_AARCH64_MAKE_GOALS,
|
||||
},
|
||||
"kernel_aarch64_16k": {
|
||||
"kmi_symbol_list_strict_mode": False,
|
||||
"module_implicit_outs": COMMON_GKI_MODULES_LIST,
|
||||
"module_implicit_outs": get_gki_modules_list("arm64"),
|
||||
"make_goals": _GKI_AARCH64_MAKE_GOALS,
|
||||
},
|
||||
"kernel_aarch64_debug": {
|
||||
"kmi_symbol_list_strict_mode": False,
|
||||
"module_implicit_outs": COMMON_GKI_MODULES_LIST,
|
||||
"kmi_symbol_list": "android/abi_gki_aarch64",
|
||||
"kmi_symbol_list_add_only": True,
|
||||
"additional_kmi_symbol_lists": [":aarch64_additional_kmi_symbol_lists"],
|
||||
"protected_exports_list": "android/abi_gki_protected_exports_aarch64",
|
||||
"protected_modules_list": "android/gki_aarch64_protected_modules",
|
||||
"module_implicit_outs": get_gki_modules_list("arm64"),
|
||||
"make_goals": _GKI_AARCH64_MAKE_GOALS,
|
||||
},
|
||||
"kernel_x86_64": {
|
||||
"kmi_symbol_list_strict_mode": False,
|
||||
"module_implicit_outs": COMMON_GKI_MODULES_LIST,
|
||||
"protected_exports_list": "android/abi_gki_protected_exports_x86_64",
|
||||
"protected_modules_list": "android/gki_x86_64_protected_modules",
|
||||
"module_implicit_outs": get_gki_modules_list("x86_64"),
|
||||
"make_goals": _GKI_X86_64_MAKE_GOALS,
|
||||
},
|
||||
"kernel_x86_64_debug": {
|
||||
"kmi_symbol_list_strict_mode": False,
|
||||
"module_implicit_outs": COMMON_GKI_MODULES_LIST,
|
||||
"protected_exports_list": "android/abi_gki_protected_exports_x86_64",
|
||||
"protected_modules_list": "android/gki_x86_64_protected_modules",
|
||||
"module_implicit_outs": get_gki_modules_list("x86_64"),
|
||||
"make_goals": _GKI_X86_64_MAKE_GOALS,
|
||||
},
|
||||
})
|
||||
@@ -439,7 +467,7 @@ kernel_build(
|
||||
"modules",
|
||||
"rockchip/rk3399-rock-pi-4b.dtb",
|
||||
],
|
||||
module_outs = COMMON_GKI_MODULES_LIST + _ROCKPI4_MODULE_OUTS + _ROCKPI4_WATCHDOG_MODULE_OUTS,
|
||||
module_outs = get_gki_modules_list("arm64") + _ROCKPI4_MODULE_OUTS + _ROCKPI4_WATCHDOG_MODULE_OUTS,
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
@@ -463,7 +491,7 @@ kernel_build(
|
||||
"modules",
|
||||
"rockchip/rk3399-rock-pi-4b.dtb",
|
||||
],
|
||||
module_outs = COMMON_GKI_MODULES_LIST + _ROCKPI4_MODULE_OUTS,
|
||||
module_outs = get_gki_modules_list("arm64") + _ROCKPI4_MODULE_OUTS,
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
|
||||
42
modules.bzl
42
modules.bzl
@@ -6,7 +6,7 @@ This module contains a full list of kernel modules
|
||||
compiled by GKI.
|
||||
"""
|
||||
|
||||
COMMON_GKI_MODULES_LIST = [
|
||||
_COMMON_GKI_MODULES_LIST = [
|
||||
# keep sorted
|
||||
"drivers/block/zram/zram.ko",
|
||||
"drivers/bluetooth/btbcm.ko",
|
||||
@@ -67,3 +67,43 @@ COMMON_GKI_MODULES_LIST = [
|
||||
"net/tipc/diag.ko",
|
||||
"net/tipc/tipc.ko",
|
||||
]
|
||||
|
||||
# Deprecated - Use `get_gki_modules_list` function instead.
|
||||
COMMON_GKI_MODULES_LIST = _COMMON_GKI_MODULES_LIST
|
||||
|
||||
_ARM64_GKI_MODULES_LIST = [
|
||||
# keep sorted
|
||||
]
|
||||
|
||||
_RISCV64_GKI_MODULES_LIST = [
|
||||
# keep sorted
|
||||
]
|
||||
|
||||
_X86_64_GKI_MODULES_LIST = [
|
||||
# keep sorted
|
||||
]
|
||||
|
||||
# buildifier: disable=unnamed-macro
|
||||
def get_gki_modules_list(arch = None):
|
||||
""" Provides the list of GKI modules.
|
||||
|
||||
Args:
|
||||
arch: One of [arm64, x86_64, riscv64].
|
||||
|
||||
Returns:
|
||||
The list of GKI modules for the given |arch|.
|
||||
"""
|
||||
gki_modules_list = [] + _COMMON_GKI_MODULES_LIST
|
||||
if arch == "arm64":
|
||||
gki_modules_list += _ARM64_GKI_MODULES_LIST
|
||||
elif arch == "x86_64":
|
||||
gki_modules_list += _X86_64_GKI_MODULES_LIST
|
||||
elif arch == "riscv64":
|
||||
gki_modules_list += _RISCV64_GKI_MODULES_LIST
|
||||
else:
|
||||
fail("{}: arch {} not supported. Use one of [arm64, x86_64, riscv64]".format(
|
||||
str(native.package_relative_label(":x")).removesuffix(":x"),
|
||||
arch,
|
||||
))
|
||||
|
||||
return gki_modules_list
|
||||
|
||||
Reference in New Issue
Block a user