Kleaf: add kernel modules in nvidia-oot

1. Add BUILD.bazel file.
2. Add build target of kernel module and required include folder
   srctree.* in Makefile to fix the build issue
3. The tr (a build tool defined by kleaf in the sandbox) which
   supported by toybox will cause the conversion of header files
   to file_define to fail. Fixed it by separating with two tr
   commands.

Bug 4344670

Change-Id: I56dcc148960f3b7703335943281589f42caa9af7
Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3066225
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jian-Min Liu
2024-01-30 09:34:13 -08:00
committed by mobile promotions
parent 6025535763
commit 1dc806cb91
6 changed files with 226 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
# SPDX-License-Identifier: GPL-2.0-only
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
package(
default_visibility = [
"//visibility:public",
],
)
filegroup(
name = "conftest_headers",
srcs = glob(["**"],
allow_empty = False,
),
)

View File

@@ -66,7 +66,7 @@ test_header_presence() {
TEST_CFLAGS="-E -M $CFLAGS"
file="$1"
file_define=NV_`echo $file | tr '/.\-a-z' '___A-Z'`_PRESENT
file_define=NV_`echo $file | tr '/.-' '___' | tr 'a-z' 'A-Z'`_PRESENT
CODE="#include <$file>"