Skip to content

Commit

Permalink
do_depmod: use $install_tree instead of hardcoding /lib/modules
Browse files Browse the repository at this point in the history
  • Loading branch information
anbe42 committed Jan 11, 2024
1 parent c6b67a4 commit a88a329
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dkms.in
Original file line number Diff line number Diff line change
Expand Up @@ -348,12 +348,12 @@ do_depmod()
else
depmod -a "$1"
fi
if [ -f /lib/modules/$1/modules.dep ] && [ ! -s /lib/modules/$1/modules.dep ]; then
if [ -f $install_tree/$1/modules.dep ] && [ ! -s $install_tree/$1/modules.dep ]; then
# if modules.dep is empty, we just removed the last kernel module from
# no longer installed kernel $1, so do not leave stale depmod files around
rm -fv /lib/modules/$1/modules.{alias,dep,devname,softdep,symbols,*.bin}
rmdir --ignore-fail-on-non-empty /lib/modules/$1
test -d /lib/modules/$1 || echo $"Removed /lib/modules/$1"
rm -fv $install_tree/$1/modules.{alias,dep,devname,softdep,symbols,*.bin}
rmdir --ignore-fail-on-non-empty $install_tree/$1
test -d $install_tree/$1 || echo $"removed directory $install_tree/$1"
fi
}

Expand Down

0 comments on commit a88a329

Please sign in to comment.