Commit 88f66ea9 authored by Steven Rostedt's avatar Steven Rostedt Committed by Steven Rostedt

kconfig: Look in both /bin and /sbin for lsmod in streamline_config.pl

Distributions now have lsmod in /bin instead of /sbin. But to handle
both cases, we look for it in /sbin /bin /usr/bin and /usr/sbin.
If lsmod is not found in any of those paths, it defaults to use
just lsmod and hopes that it lies in the path of the user.
Tested-by: default avatarXavier Chantry <shiningxc@gmail.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 13d7e938
......@@ -264,7 +264,20 @@ foreach my $makefile (@makefiles) {
my %modules;
# see what modules are loaded on this system
open(LIN,"/sbin/lsmod|") || die "Cant lsmod";
my $lsmod;
foreach $dir ( ("/sbin", "/bin", "/usr/sbin", "/usr/bin") ) {
if ( -x "$dir/lsmod" ) {
$lsmod = "$dir/lsmod";
last;
}
}
if (!defined($lsmod)) {
# try just the path
$lsmod = "lsmod";
}
open(LIN,"$lsmod|") || die "Can not call lsmod with $lsmod";
while (<LIN>) {
next if (/^Module/); # Skip the first line.
if (/^(\S+)/) {
......
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