[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPNxggbrC7cKXYTKk=ivDL2ZT2w+5G4PACH1YT7iK-ZNk7twRQ@mail.gmail.com>
Date: Fri, 10 Aug 2012 23:50:07 +0200
From: "Arokux B." <arokux@...il.com>
To: mmarek@...e.cz
Cc: linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Failure while make modules_install if kmod was compiled with
--with-rootprefix set
Dear Mr. Marek, dear all,
I have detected a hidden failure while building the kernel. If
--with-rootprefix is set for kmod, then depmod will look for modules
installed at the location $ROOTPREFIX/lib/modules/<version>. The
kernel build system does not know anything about $ROOTPREFIX, and so
the wrong directory is created for the test if the hack is needed for
an older versin of depmod at scripts/depmod.sh:19 mkdir -p
"$tmp_dir/lib/modules/$KERNELRELEASE". That is why "$DEPMOD" -b
"$tmp_dir" $KERNELRELEASE will always fail and kernel build system
will think that the hack is always needed and depmod_hack_needed will
always be true. After that the created symlink is wrong since it also
does not contain $ROOTPREFIX, which depmod will preprend. That is why
depmod will fail.
To cure the problem an additional variable $MOD_ROOT_PREFIX can be
introduced. With the help of this variable the paths in the
scripts/depmod.sh are parametrized. This variable should be set to the
same value which was passed to --with-rootprefix while compilation of
kmod. Example: if --with-rootprefix is set to /usr and the modules
should be installed at the location /home/john, then the the following
make call should be issued: make INSTALL_MOD_PATH=/home/john
$MOD_ROOT_PREFIX=/usr. After that the modules will be installed at
/home/john/usr. However should be also added to other places where the
actuall installing takes place, and so I do not this this solution is
optimal, nevertheless, please find the patch for depmod.sh at the end
of this e-mail.
A more superior solution could be probably a new option for depmod
which would allow an overwriting of the $ROOTPREFIX. This option can
be used in depmod.sh then to overwrite $ROOTPREFIX with an empty
string.
I was unsure as of which solution is better if any at all and so such
a lengthy e-mail...
With kind regards,
Arokux
diff --git a/scripts/depmod.sh b/scripts/depmod.sh
index 2ae4817..87a6e42 100755
--- a/scripts/depmod.sh
+++ b/scripts/depmod.sh
@@ -16,16 +16,18 @@ fi
# 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"
+mkdir -p "$tmp_dir/$MOD_ROOT_PREFIX/lib/modules/$KERNELRELEASE"
+"$DEPMOD" -b "$tmp_dir" $KERNELRELEASE
+echo hello
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
+ if test -e
"$tmp_dir/$MOD_ROOT_PREFIX/lib/modules/$KERNELRELEASE/modules.dep" -o
\
+ -e
"$tmp_dir/$MOD_ROOT_PREFIX/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"
+ symlink="$INSTALL_MOD_PATH/$MOD_ROOT_PREFIX/lib/modules/99.98.$KERNELRELEASE"
ln -s "$KERNELRELEASE" "$symlink"
KERNELRELEASE=99.98.$KERNELRELEASE
fi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists