From 472f014063870726835124d3c7e9924f5ff780b1 Mon Sep 17 00:00:00 2001 From: hopsayer <84712356+hopsayer@users.noreply.github.com> Date: Sun, 27 Sep 2026 20:43:01 +0300 Subject: [PATCH 1/3] dkms: show missing path in broken module messages When a module is broken, print the path DKMS tried to check ($dkms_tree///source) instead of leaving the user to guess. Related: #606, #357, #94 --- dkms.in | 12 ++++++++---- run_test.sh | 30 ++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/dkms.in b/dkms.in index 628b3cb1..aef9f26e 100644 --- a/dkms.in +++ b/dkms.in @@ -2214,7 +2214,8 @@ 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."\ + "Missing the source directory or the symbolic link pointing to it:"\ + "$dkms_tree/$module/$module_version/source"\ "Manual intervention is required!" } @@ -2561,7 +2562,8 @@ 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."\ + error "$m/$v: Missing the module source directory or the symbolic link pointing to it:"\ + "$dkms_tree/$m/$v/source"\ "Manual intervention is required!" ;; added) @@ -2855,7 +2857,8 @@ 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."\ + "Missing the source directory or the symbolic link pointing to it:"\ + "$dkms_tree/$template_module/$template_version/source"\ "Manual intervention is required!" continue fi @@ -3006,7 +3009,8 @@ 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."\ + 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!" continue fi diff --git a/run_test.sh b/run_test.sh index 48e27557..e1c1063c 100755 --- a/run_test.sh +++ b/run_test.sh @@ -4418,7 +4418,8 @@ 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! EOF @@ -4434,7 +4435,8 @@ 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! EOF @@ -4442,7 +4444,8 @@ 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! EOF @@ -4450,7 +4453,8 @@ 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! EOF @@ -4458,7 +4462,8 @@ 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! EOF @@ -4473,7 +4478,8 @@ 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! EOF @@ -4481,7 +4487,8 @@ 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! EOF @@ -4497,7 +4504,8 @@ 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! EOF @@ -4540,7 +4548,8 @@ 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! 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} @@ -4551,7 +4560,8 @@ 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! dkms_multiver_test/2.0, ${KERNEL_VER}, ${KERNEL_ARCH}: built dkms_test/1.0, ${KERNEL_VER}, ${KERNEL_ARCH}: installed From 46c44c47891d74dd7e5fcb30ae0f56e05f89d147 Mon Sep 17 00:00:00 2001 From: hopsayer <84712356+hopsayer@users.noreply.github.com> Date: Sun, 27 Sep 2026 20:44:08 +0300 Subject: [PATCH 2/3] run_test.sh: support endeavouros in distro detection EndeavourOS uses the same Arch-style module layout, so it can share the existing 'arch' case. --- run_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_test.sh b/run_test.sh index e1c1063c..9940fb5e 100755 --- a/run_test.sh +++ b/run_test.sh @@ -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) From 688179f54f77f5b309a3115c97b753d47eeb58ae Mon Sep 17 00:00:00 2001 From: hopsayer <84712356+hopsayer@users.noreply.github.com> Date: Sun, 27 Sep 2026 20:47:17 +0300 Subject: [PATCH 3/3] dkms: add hint about next step in broken module messages After printing the missing path, suggest the two real options: remove the stale entry, or reinstall the source. The phrasing avoids 'clear this folder' to not encourage blind rm -rf on a system dir. Happy to drop this hint if maintainers prefer a terser message. --- dkms.in | 16 ++++++++++++---- run_test.sh | 20 ++++++++++++++++++++ 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/dkms.in b/dkms.in index aef9f26e..ae24fe25 100644 --- a/dkms.in +++ b/dkms.in @@ -2216,7 +2216,9 @@ 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:"\ "$dkms_tree/$module/$module_version/source"\ - "Manual intervention is required!" + "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() @@ -2564,7 +2566,9 @@ do_status() { echo "$m/$v: $status" error "$m/$v: Missing the module source directory or the symbolic link pointing to it:"\ "$dkms_tree/$m/$v/source"\ - "Manual intervention is required!" + "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" @@ -2859,7 +2863,9 @@ run_match() error "$template_module/$template_version is broken!"\ "Missing the source directory or the symbolic link pointing to it:"\ "$dkms_tree/$template_module/$template_version/source"\ - "Manual intervention is required!" + "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" @@ -3011,7 +3017,9 @@ autoinstall() { if [[ $status = broken ]]; then 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!" + "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 diff --git a/run_test.sh b/run_test.sh index 9940fb5e..1f5a357b 100755 --- a/run_test.sh +++ b/run_test.sh @@ -4421,6 +4421,8 @@ dkms_test/1.0: broken 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' @@ -4438,6 +4440,8 @@ Error! dkms_test/1.0 is broken! 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)' @@ -4447,6 +4451,8 @@ Error! dkms_test/1.0 is broken! 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)' @@ -4456,6 +4462,8 @@ Error! dkms_test/1.0 is broken! 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)' @@ -4465,6 +4473,8 @@ Error! dkms_test/1.0 is broken! 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' @@ -4481,6 +4491,8 @@ dkms_test/1.0: broken 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)' @@ -4490,6 +4502,8 @@ Error! dkms_test/1.0 is broken! 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' @@ -4507,6 +4521,8 @@ dkms_test/1.0: broken 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' @@ -4551,6 +4567,8 @@ 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: /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. @@ -4563,6 +4581,8 @@ dkms_multiver_test/1.0: broken 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