ANDROID: Add protected modules list

Note: These are not yet plugged into the kernels, hence not enforced.

Bug: 287199267
Change-Id: I3d7a3716dfb36222bb0a47546c6107468ed2f559
Signed-off-by: Ulises Mendez Martinez <umendez@google.com>
This commit is contained in:
Ulises Mendez Martinez authored and Treehugger Robot committed 2024-11-26 11:29:06 +00:00
1 parent 037a98242b
commit 315ff48202
2 files changed
+33 -1

No files matched your search

+24 -1
View File
@@ -28,7 +28,12 @@ load(
"merged_kernel_uapi_headers",
)
load(":abi.bzl", "cc_binary_with_abi")
load(":modules.bzl", "get_gki_modules_list", "get_kunit_modules_list")
load(
":modules.bzl",
"get_gki_modules_list",
"get_gki_protected_modules_list",
"get_kunit_modules_list",
)
package(
default_visibility = [
@@ -92,6 +97,15 @@ write_file(
],
)
# Not enforced in android-mainline.
write_file(
name = "gki_aarch64_protected_modules",
out = "gki/aarch64/protected_modules",
content = get_gki_protected_modules_list("arm64") + [
"", # Ensure new line at the end.
],
)
write_file(
name = "gki_system_dlkm_modules_x86_64",
out = "gki/x86_64/system_dlkm_modules",
@@ -102,6 +116,15 @@ write_file(
],
)
# Not enforced in android-mainline.
write_file(
name = "gki_x86_64_protected_modules",
out = "gki/x86_64/protected_modules",
content = get_gki_protected_modules_list("x86_64") + [
"", # Ensure new line at the end.
],
)
_SET_KERNEL_DIR_CMD = "KERNEL_DIR=\"{kernel_dir}\"".format(
kernel_dir = paths.join(
package_relative_label(":x").workspace_root,
+9
View File
@@ -197,3 +197,12 @@ def get_kunit_modules_list(arch = None):
))
return kunit_modules_list
_COMMON_UNPROTECTED_MODULES_LIST = []
# buildifier: disable=unnamed-macro
def get_gki_protected_modules_list(arch = None):
all_gki_modules = get_gki_modules_list(arch) + get_kunit_modules_list(arch)
unprotected_modules = _COMMON_UNPROTECTED_MODULES_LIST
protected_modules = [mod for mod in all_gki_modules if mod not in unprotected_modules]
return protected_modules