From aa7a98b002f8c558930ecc2747d5e6534b9e12cd Mon Sep 17 00:00:00 2001 From: Saalim Quadri Date: Wed, 25 Oct 2023 10:03:45 +0530 Subject: [PATCH] build: Load modules into dist Signed-off-by: Saalim Quadri --- src/build.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/build.sh b/src/build.sh index de6ed6d..2e8f90a 100755 --- a/src/build.sh +++ b/src/build.sh @@ -195,7 +195,16 @@ kernel_build() dist_path="out/dist" log_info "sworkflow: Copying the contents into dist" kernel_image_path="out/arch/$device_arch/boot/$kernel_image_name" - cp "$kernel_image_path" $dist_path + cp "$kernel_image_path" $ + if [[ -n "$do_modules" ]]; then + log_info "sworkflow: Copying modules" + mkdir out/dist/modules + cp $(find out/modules/lib/modules/* -name '*.ko') $dist_path/modules/ + cp out/modules/lib/modules/*/modules.{alias,dep,softdep} $dist_path/modules + cp out/modules/lib/modules/*/modules.order $dist_path/modules/modules.load + sed -i 's/\(kernel\/[^: ]*\/\)\([^: ]*\.ko\)/\/vendor\/lib\/modules\/\2/g' $dist_path/modules/modules.dep + sed -i 's/.*\///g' $dist_path/modules/modules.load + fi fi else log_error "error: Define $kernel_image_name to create dist"