Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions dkms.in
Original file line number Diff line number Diff line change
Expand Up @@ -2214,8 +2214,11 @@ do_uninstall()

module_is_broken_and_die() {
is_module_broken "$module" "$module_version" && die 4 "$module/$module_version is broken!"\
"Missing the source directory or the symbolic link pointing to it."\
"Manual intervention is required!"
"Missing the source directory or the symbolic link pointing to it:"\
"$dkms_tree/$module/$module_version/source"\
"Manual intervention is required!"\
"If this module version is no longer needed, you can remove the stale directory."\
"Otherwise, reinstall the package that provides its source."
}

module_is_added_or_die()
Expand Down Expand Up @@ -2561,8 +2564,11 @@ do_status() {
case $status in
broken)
echo "$m/$v: $status"
error "$m/$v: Missing the module source directory or the symbolic link pointing to it."\
"Manual intervention is required!"
error "$m/$v: Missing the module source directory or the symbolic link pointing to it:"\
"$dkms_tree/$m/$v/source"\
"Manual intervention is required!"\
"If this module version is no longer needed, you can remove the stale directory."\
"Otherwise, reinstall the package that provides its source."
;;
added)
echo "$m/$v: $status"
Expand Down Expand Up @@ -2855,8 +2861,11 @@ run_match()
# Continue if the status is broken, as there is nothing we can do
if is_module_broken "$template_module" "$template_version"; then
error "$template_module/$template_version is broken!"\
"Missing the source directory or the symbolic link pointing to it."\
"Manual intervention is required!"
"Missing the source directory or the symbolic link pointing to it:"\
"$dkms_tree/$template_module/$template_version/source"\
"Manual intervention is required!"\
"If this module version is no longer needed, you can remove the stale directory."\
"Otherwise, reinstall the package that provides its source."
continue
fi
maybe_build_module "$template_module" "$template_version" "$kernelver" "$arch"
Expand Down Expand Up @@ -3006,8 +3015,11 @@ autoinstall() {
IFS='/' read -r m v k a <<< "$mvka"
# If the module status is broken there is nothing that can be done
if [[ $status = broken ]]; then
error "$m/$v is broken! Missing the source directory or the symbolic link pointing to it."\
"Manual intervention is required!"
error "$m/$v is broken! Missing the source directory or the symbolic link pointing to it:"\
"$dkms_tree/$m/$v/source"\
"Manual intervention is required!"\
"If this module version is no longer needed, you can remove the stale directory."\
"Otherwise, reinstall the package that provides its source."
continue
fi
if [[ ! ${latest[$m]} ]]; then
Expand Down
52 changes: 41 additions & 11 deletions run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ case "${os_id}" in
expected_dest_loc=updates
mod_compression_ext=.zst
;;
arch)
arch | endeavouros)
expected_dest_loc=updates/dkms
;;
debian* | linuxmint)
Expand Down Expand Up @@ -4418,8 +4418,11 @@ echo 'Checking broken status'
run_with_expected_output dkms status dkms_test/1.0 << EOF
dkms_test/1.0: broken

Error! dkms_test/1.0: Missing the module source directory or the symbolic link pointing to it.
Error! dkms_test/1.0: Missing the module source directory or the symbolic link pointing to it:
/var/lib/dkms/dkms_test/1.0/source
Manual intervention is required!
If this module version is no longer needed, you can remove the stale directory.
Otherwise, reinstall the package that provides its source.
EOF

echo 'Re-adding the test module'
Expand All @@ -4434,32 +4437,44 @@ echo 'Building broken test module (expected error)'
run_with_expected_error 4 dkms build dkms_test/1.0 << EOF

Error! dkms_test/1.0 is broken!
Missing the source directory or the symbolic link pointing to it.
Missing the source directory or the symbolic link pointing to it:
/var/lib/dkms/dkms_test/1.0/source
Manual intervention is required!
If this module version is no longer needed, you can remove the stale directory.
Otherwise, reinstall the package that provides its source.
EOF

echo 'Installing broken test module (expected error)'
run_with_expected_error 4 dkms install dkms_test/1.0 << EOF

Error! dkms_test/1.0 is broken!
Missing the source directory or the symbolic link pointing to it.
Missing the source directory or the symbolic link pointing to it:
/var/lib/dkms/dkms_test/1.0/source
Manual intervention is required!
If this module version is no longer needed, you can remove the stale directory.
Otherwise, reinstall the package that provides its source.
EOF

echo 'Unbuild broken test module (expected error)'
run_with_expected_error 4 dkms unbuild dkms_test/1.0 << EOF

Error! dkms_test/1.0 is broken!
Missing the source directory or the symbolic link pointing to it.
Missing the source directory or the symbolic link pointing to it:
/var/lib/dkms/dkms_test/1.0/source
Manual intervention is required!
If this module version is no longer needed, you can remove the stale directory.
Otherwise, reinstall the package that provides its source.
EOF

echo 'Uninstall broken test module (expected error)'
run_with_expected_error 4 dkms uninstall dkms_test/1.0 << EOF

Error! dkms_test/1.0 is broken!
Missing the source directory or the symbolic link pointing to it.
Missing the source directory or the symbolic link pointing to it:
/var/lib/dkms/dkms_test/1.0/source
Manual intervention is required!
If this module version is no longer needed, you can remove the stale directory.
Otherwise, reinstall the package that provides its source.
EOF

echo 'Adding the multiver test module 1.0 by directory'
Expand All @@ -4473,16 +4488,22 @@ run_with_expected_output dkms status << EOF
dkms_multiver_test/1.0: added
dkms_test/1.0: broken

Error! dkms_test/1.0: Missing the module source directory or the symbolic link pointing to it.
Error! dkms_test/1.0: Missing the module source directory or the symbolic link pointing to it:
/var/lib/dkms/dkms_test/1.0/source
Manual intervention is required!
If this module version is no longer needed, you can remove the stale directory.
Otherwise, reinstall the package that provides its source.
EOF

echo 'Remove broken test module (expected error)'
run_with_expected_error 4 dkms remove dkms_test/1.0 << EOF

Error! dkms_test/1.0 is broken!
Missing the source directory or the symbolic link pointing to it.
Missing the source directory or the symbolic link pointing to it:
/var/lib/dkms/dkms_test/1.0/source
Manual intervention is required!
If this module version is no longer needed, you can remove the stale directory.
Otherwise, reinstall the package that provides its source.
EOF

echo 'Re-adding the test module'
Expand All @@ -4497,8 +4518,11 @@ run_with_expected_output dkms status << EOF
dkms_multiver_test/1.0: added
dkms_test/1.0: broken

Error! dkms_test/1.0: Missing the module source directory or the symbolic link pointing to it.
Error! dkms_test/1.0: Missing the module source directory or the symbolic link pointing to it:
/var/lib/dkms/dkms_test/1.0/source
Manual intervention is required!
If this module version is no longer needed, you can remove the stale directory.
Otherwise, reinstall the package that provides its source.
EOF

echo 'Removing dkms_multiver_test'
Expand Down Expand Up @@ -4540,8 +4564,11 @@ EOF
echo 'Running dkms autoinstall'
run_with_expected_output dkms autoinstall -k "${KERNEL_VER}" << EOF

Error! dkms_multiver_test/1.0 is broken! Missing the source directory or the symbolic link pointing to it.
Error! dkms_multiver_test/1.0 is broken! Missing the source directory or the symbolic link pointing to it:
/var/lib/dkms/dkms_multiver_test/1.0/source
Manual intervention is required!
If this module version is no longer needed, you can remove the stale directory.
Otherwise, reinstall the package that provides its source.
Autoinstall of module dkms_test/1.0 for kernel ${KERNEL_VER} (${KERNEL_ARCH})
Installing /lib/modules/${KERNEL_VER}/${expected_dest_loc}/dkms_test.ko${mod_compression_ext}
Running depmod... done.
Expand All @@ -4551,8 +4578,11 @@ EOF
run_with_expected_output dkms status << EOF
dkms_multiver_test/1.0: broken

Error! dkms_multiver_test/1.0: Missing the module source directory or the symbolic link pointing to it.
Error! dkms_multiver_test/1.0: Missing the module source directory or the symbolic link pointing to it:
/var/lib/dkms/dkms_multiver_test/1.0/source
Manual intervention is required!
If this module version is no longer needed, you can remove the stale directory.
Otherwise, reinstall the package that provides its source.
dkms_multiver_test/2.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built
dkms_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed
EOF
Expand Down
Loading