--- a/dkms_common.postinst +++ b/dkms_common.postinst @@ -127,7 +127,7 @@ if [ -r /etc/dkms/framework.conf ]; then . /etc/dkms/framework.conf fi -KERNELS=$(ls /lib/modules/ 2>/dev/null || true) +KERNELS=$(ls -v /lib/modules/ 2>/dev/null || true) CURRENT_KERNEL=$(uname -r) #We never want to keep an older version side by side to prevent conflicts --- a/dkms.in +++ b/dkms.in @@ -269,7 +269,7 @@ setup_kernels_arches() kernelver[$i]=${line%/*} arch[$i]=${line#*/} i=$(($i + 1)) - done < <(module_status_built "$module" "$module_version") + done < <(module_status_built "$module" "$module_version" | sort -V) fi # Set default kernel version and arch, if none set (but only --all isn't set)