Skip to content

Commit c390d35

Browse files
committed
dkms: warn if some.ko disappears in the strip/sign/compress/copy loop
We have already checked that the module had been built successfully. If it disappears during the strip/sign/compress/copy loop, there must be a duplicate entry in dkms.conf. Skip further operations on the missing file to avoid excessive error message noise.
1 parent 82e93b5 commit c390d35

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

dkms.in

+5
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,11 @@ prepare_and_actual_build()
13671367
built_module="$the_module$module_uncompressed_suffix"
13681368
compressed_module="$the_module$module_suffix"
13691369

1370+
if [[ ! -f $built_module ]]; then
1371+
warn "$built_module has disappeared"
1372+
continue
1373+
fi
1374+
13701375
if [[ ${strip[$count]} != no ]] && [[ ${CC} == "clang" ]]; then
13711376
llvm-strip -g "$built_module"
13721377
elif [[ ${strip[$count]} != no ]]; then

run_test.sh

+1-10
Original file line numberDiff line numberDiff line change
@@ -374,13 +374,6 @@ case "${os_id}" in
374374
;;
375375
esac
376376

377-
mod_compressor=
378-
case "${mod_compression_ext}" in
379-
.gz) mod_compressor=gzip ;;
380-
.xz) mod_compressor=xz ;;
381-
.zst) mod_compressor=zst ;;
382-
esac
383-
384377
echo "Checking module compression ..."
385378
echo "config: $(grep "^CONFIG_MODULE_COMPRESS" "${kernel_config}" || true)"
386379
echo "files: $(find "/lib/modules/${KERNEL_VER}" -name \*.ko\* 2>/dev/null | head -n1)"
@@ -2762,9 +2755,7 @@ EOF
27622755
echo ' Building and installing the test module'
27632756
set_signing_message "dkms_duplicate_test" "1.0"
27642757
if [[ ${mod_compression_ext} ]]; then
2765-
BUILD_MESSAGES="${SIGNING_MESSAGE}strip: '/var/lib/dkms/dkms_duplicate_test/1.0/build/dkms_duplicate_test.ko': No such file
2766-
${SIGNING_MESSAGE}${mod_compressor}: /var/lib/dkms/dkms_duplicate_test/1.0/build/dkms_duplicate_test.ko: No such file or directory
2767-
cp: cannot stat '/var/lib/dkms/dkms_duplicate_test/1.0/build/dkms_duplicate_test.ko': No such file or directory
2758+
BUILD_MESSAGES="${SIGNING_MESSAGE}Warning: /var/lib/dkms/dkms_duplicate_test/1.0/build/dkms_duplicate_test.ko has disappeared
27682759
"
27692760
else
27702761
BUILD_MESSAGES="${SIGNING_MESSAGE}${SIGNING_MESSAGE}"

0 commit comments

Comments
 (0)