aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorR. Andrew Ohana <andrew.ohana@gmail.com>2012-08-03 01:00:16 -0700
committerPawit Pornkitprasan <p.pawit@gmail.com>2012-08-14 17:24:35 +0700
commit32a15fd4d6988639f0d72ff4647395f02027f93b (patch)
tree113cb11b6b39c160a21274fbfb9e4a13a71db7cb /scripts
parent28b49fa369267f54527b69f8fb635d6fa34ce766 (diff)
downloadkernel_samsung_aries-32a15fd4d6988639f0d72ff4647395f02027f93b.zip
kernel_samsung_aries-32a15fd4d6988639f0d72ff4647395f02027f93b.tar.gz
kernel_samsung_aries-32a15fd4d6988639f0d72ff4647395f02027f93b.tar.bz2
hack to work around Arch Linux's mv lib usr/lib
Change-Id: I8eb0c1d4540e4c5ef17221023fd9dadc83e9a18b
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/depmod.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/depmod.sh b/scripts/depmod.sh
index a272356..9f92a79 100755
--- a/scripts/depmod.sh
+++ b/scripts/depmod.sh
@@ -21,9 +21,19 @@ 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
+# arch decided to move everything to usr/lib instead of lib
+# we can test for this and handle things with symlinks, if needed
+depmod_arch_hack_needed=false
tmp_dir=$(mktemp -d ${TMPDIR:-/tmp}/depmod.XXXXXX)
mkdir -p "$tmp_dir/lib/modules/$KERNELRELEASE"
+mkdir -p "$tmp_dir/usr/lib/modules/$KERNELRELEASE"
if "$DEPMOD" -b "$tmp_dir" $KERNELRELEASE 2>/dev/null; then
+ if test -e "$tmp_dir/usr/lib/modules/$KERNELRELEASE/modules.dep" -o \
+ -e "$tmp_dir/usr/lib/modules/$KERNELRELEASE/modules.dep.bin"; then
+ depmod_arch_hack_needed=true
+ rm -rf "$tmp_dir/lib"
+ mv "$tmp_dir/usr/lib" "$tmp_dir/lib"
+ fi
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
@@ -35,6 +45,11 @@ if $depmod_hack_needed; then
ln -s "$KERNELRELEASE" "$symlink"
KERNELRELEASE=99.98.$KERNELRELEASE
fi
+if $depmod_arch_hack_needed; then
+ mkdir -p "$INSTALL_MOD_PATH/usr/lib/modules"
+ ln -s ../../../lib/modules/$KERNELRELEASE \
+ "$INSTALL_MOD_PATH/usr/lib/modules/$KERNELRELEASE"
+fi
set -- -ae -F System.map
if test -n "$INSTALL_MOD_PATH"; then
@@ -47,4 +62,17 @@ if $depmod_hack_needed; then
rm -f "$symlink"
fi
+if $depmod_arch_hack_needed; then
+ rm -f "$INSTALL_MOD_PATH/usr/lib/modules/$KERNELRELEASE"
+ if [ -z "$(ls "$INSTALL_MOD_PATH/usr/lib/modules")" ]; then
+ rm -rf "$INSTALL_MOD_PATH/usr/lib/modules"
+ fi
+ if [ -z "$(ls "$INSTALL_MOD_PATH/usr/lib")" ]; then
+ rm -rf "$INSTALL_MOD_PATH/usr/lib"
+ fi
+ if [ -z "$(ls "$INSTALL_MOD_PATH/usr")" ]; then
+ rm -rf "$INSTALL_MOD_PATH/usr"
+ fi
+fi
+
exit $ret