Skip to content

Commit

Permalink
do not run depmod if modules.dep does not yet exist
Browse files Browse the repository at this point in the history
i.e. only linux headers but no corresponding linux image is installed
  • Loading branch information
anbe42 committed Feb 7, 2024
1 parent 8bd0062 commit d624fe2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dkms.in
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,12 @@ do_depmod()
if [[ ${current_os} != Linux ]] ; then
return
fi
if [[ ! -f $install_tree/$1/modules.dep ]]; then
# if the corresponding linux image $1 is not installed
# do not create modules.dep
echo "Skipping depmod because '$install_tree/$1/modules.dep' is missing."
return
fi
if [[ -f /boot/System.map-$1 ]]; then
depmod -a "$1" -F "/boot/System.map-$1"
else
Expand All @@ -347,7 +353,7 @@ do_depmod()
# no longer installed kernel $1, so do not leave stale depmod files around
rm -fv $install_tree/$1/modules.{alias,dep,devname,softdep,symbols,*.bin}
rmdir --ignore-fail-on-non-empty $install_tree/$1
[[ -d $install_tree/$1 ]] || echo $"Removed $install_tree/$1"
[[ -d $install_tree/$1 ]] || echo $"removed directory $install_tree/$1"
fi
}

Expand Down

0 comments on commit d624fe2

Please sign in to comment.