[PATCH] kconfig: If lsmod is not in the /sbin, check the path

From: John Kacur
Date: Tue Jan 19 2010 - 11:10:48 EST

Mike Frysinger reported that lsmod is installed in /bin on newer kernels
which causes a problem when we hardcode the path to /sbin

However, Américo Wang reports that some distros don't have /sbin in PATH,
so you can't just let lsmod be found via PATH.

So, first check if lsmod is at /sbin/lsmod, and then check PATH if that fails.

Signed-off-by: John Kacur <jkacur@xxxxxxxxxx>
scripts/kconfig/streamline_config.pl | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index 0d80082..1803d2e 100644
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -238,7 +238,8 @@ foreach my $makefile (@makefiles) {
my %modules;

# see what modules are loaded on this system
-open(LIN,"/sbin/lsmod|") || die "Cant lsmod";
+# If lsmod isn't in the sbin dir, check if it is in the path
+open(LIN,"/sbin/lsmod|") || open(LIN,"lsmod|") || die "Cant lsmod";
while (<LIN>) {
next if (/^Module/); # Skip the first line.
if (/^(\S+)/) {

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/