Skip to content

Commit

Permalink
Revert "kbuild: Hack for depmod not handling X.Y versions"
Browse files Browse the repository at this point in the history
Remove hack for ancient version of module-init-tools that was added in
Linux 3.0.

Since then module-init-tools was replaced with kmod.

This hack adds an additional indirection, and causes confusing errors
to be printed when depmod fails.

Reverts commit 8fc62e5 ("kbuild: Do not write to builddir in modules_install")
Reverts commit bfe5424 ("kbuild: Hack for depmod not handling X.Y versions")

Link: https://lore.kernel.org/linux-modules/CAK7LNAQMs3QBYfWcLkmOQdbbq7cj=7wWbK=AWhdTC2rAsKHXzQ@mail.gmail.com/

Signed-off-by: Michal Suchanek <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
hramrach authored and masahir0y committed Jul 24, 2023
1 parent 356f0cb commit 4d15c9f
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions scripts/depmod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,8 @@ if [ -z $(command -v $DEPMOD) ]; then
exit 0
fi

# older versions of depmod require the version string to start with three
# numbers, so we cheat with a symlink here
depmod_hack_needed=true
tmp_dir=$(mktemp -d ${TMPDIR:-/tmp}/depmod.XXXXXX)
mkdir -p "$tmp_dir/lib/modules/$KERNELRELEASE"
if "$DEPMOD" -b "$tmp_dir" $KERNELRELEASE 2>/dev/null; then
if test -e "$tmp_dir/lib/modules/$KERNELRELEASE/modules.dep" -o \
-e "$tmp_dir/lib/modules/$KERNELRELEASE/modules.dep.bin"; then
depmod_hack_needed=false
fi
fi
rm -rf "$tmp_dir"
if $depmod_hack_needed; then
symlink="$INSTALL_MOD_PATH/lib/modules/99.98.$KERNELRELEASE"
ln -s "$KERNELRELEASE" "$symlink"
KERNELRELEASE=99.98.$KERNELRELEASE
fi

set -- -ae -F System.map
if test -n "$INSTALL_MOD_PATH"; then
set -- "$@" -b "$INSTALL_MOD_PATH"
fi
"$DEPMOD" "$@" "$KERNELRELEASE"
ret=$?

if $depmod_hack_needed; then
rm -f "$symlink"
fi

exit $ret
exec "$DEPMOD" "$@" "$KERNELRELEASE"

0 comments on commit 4d15c9f

Please sign in to comment.