Browse Source

Add copy_to_dist_dir() rule

Add copy_to_dist_dir to Bazel build to output kernel build outputs
to dist dir.

Change-Id: Ic6ae4a1b98e9672aa1beba11aeff3707b0d78667
Signed-off-by: John Moon <[email protected]>
John Moon 2 years ago
parent
commit
134766dab7
1 changed files with 14 additions and 0 deletions
  1. 14 0
      define_modules.bzl

+ 14 - 0
define_modules.bzl

@@ -1,5 +1,6 @@
 # TODO
 # Add ddk module definition for frpc-trusted driver
+load("//build/bazel_common_rules/dist:dist.bzl", "copy_to_dist_dir")
 
 load(
     "//build/kernel/kleaf:kernel.bzl",
@@ -40,3 +41,16 @@ def define_modules(target, variant):
         srcs = ["dsp/cdsp-loader.c"],
         out = "cdsp-loader.ko",
     )
+
+    copy_to_dist_dir(
+        name = "{}_dsp-kernel_dist".format(kernel_build_variant),
+        data = [
+            ":{}_frpc-adsprpc".format(kernel_build_variant),
+            ":{}_cdsp-loader".format(kernel_build_variant),
+        ],
+        dist_dir = "out/target/product/{}/dlkm/lib/modules/".format(target),
+        flat = True,
+        wipe_dist_dir = False,
+        allow_duplicate_filenames = False,
+        mode_overrides = {"**/*": "644"},
+    )