Commit 8fc62e59 authored by Michal Marek's avatar Michal Marek

kbuild: Do not write to builddir in modules_install

Let create a temporary directory in /tmp instead of writing to
the build directory as root. The mktemp utility should be available on
any recent system (and there is already scripts/
relying on it).
Reported-by: default avatarChristian Kujau <>
Signed-off-by: default avatarMichal Marek <>
parent 569658dd
......@@ -21,13 +21,15 @@ fi
# older versions of depmod require the version string to start with three
# numbers, so we cheat with a symlink here
mkdir -p .tmp_depmod/lib/modules/$KERNELRELEASE
if "$DEPMOD" -b .tmp_depmod $KERNELRELEASE 2>/dev/null; then
if test -e .tmp_depmod/lib/modules/$KERNELRELEASE/modules.dep -o \
-e .tmp_depmod/lib/modules/$KERNELRELEASE/modules.dep.bin; then
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
rm -rf "$tmp_dir"
if $depmod_hack_needed; then
ln -s "$KERNELRELEASE" "$symlink"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment