diff options
author | Michal Marek <mmarek@suse.cz> | 2011-07-12 05:54:48 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2011-07-12 07:36:30 -0400 |
commit | 8fc62e59425389a6d48429b9d146223122743435 (patch) | |
tree | da043df805a3b35984b8b2a10e202f6ee37ab268 /scripts | |
parent | 569658dddf276ceb0780776e7f5d61d9f8d8cb88 (diff) |
kbuild: Do not write to builddir in modules_install
Let depmod.sh 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/gen_initramfs_list.sh
relying on it).
Reported-by: Christian Kujau <lists@nerdbynature.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/depmod.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/depmod.sh b/scripts/depmod.sh index 3b029cba2baf..a27235685949 100755 --- a/scripts/depmod.sh +++ b/scripts/depmod.sh | |||
@@ -21,13 +21,15 @@ fi | |||
21 | # older versions of depmod require the version string to start with three | 21 | # older versions of depmod require the version string to start with three |
22 | # numbers, so we cheat with a symlink here | 22 | # numbers, so we cheat with a symlink here |
23 | depmod_hack_needed=true | 23 | depmod_hack_needed=true |
24 | mkdir -p .tmp_depmod/lib/modules/$KERNELRELEASE | 24 | tmp_dir=$(mktemp -d ${TMPDIR:-/tmp}/depmod.XXXXXX) |
25 | if "$DEPMOD" -b .tmp_depmod $KERNELRELEASE 2>/dev/null; then | 25 | mkdir -p "$tmp_dir/lib/modules/$KERNELRELEASE" |
26 | if test -e .tmp_depmod/lib/modules/$KERNELRELEASE/modules.dep -o \ | 26 | if "$DEPMOD" -b "$tmp_dir" $KERNELRELEASE 2>/dev/null; then |
27 | -e .tmp_depmod/lib/modules/$KERNELRELEASE/modules.dep.bin; then | 27 | if test -e "$tmp_dir/lib/modules/$KERNELRELEASE/modules.dep" -o \ |
28 | -e "$tmp_dir/lib/modules/$KERNELRELEASE/modules.dep.bin"; then | ||
28 | depmod_hack_needed=false | 29 | depmod_hack_needed=false |
29 | fi | 30 | fi |
30 | fi | 31 | fi |
32 | rm -rf "$tmp_dir" | ||
31 | if $depmod_hack_needed; then | 33 | if $depmod_hack_needed; then |
32 | symlink="$INSTALL_MOD_PATH/lib/modules/99.98.$KERNELRELEASE" | 34 | symlink="$INSTALL_MOD_PATH/lib/modules/99.98.$KERNELRELEASE" |
33 | ln -s "$KERNELRELEASE" "$symlink" | 35 | ln -s "$KERNELRELEASE" "$symlink" |