Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180872
b: refs/heads/master
c: 615f083
h: refs/heads/master
v: v3
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Feb 3, 2010
1 parent 2e88073 commit 960850b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 88f66ea98d7ae6a8b6a34e38b1b4fa51abc1c9ca
refs/heads/master: 615f0833aa4c4aa944ceb78895bbffa8bd1884df
13 changes: 11 additions & 2 deletions trunk/scripts/kconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,18 @@ silentoldconfig: $(obj)/conf
$(Q)mkdir -p include/generated
$< -s $(Kconfig)

# if no path is given, then use src directory to find file
ifdef LSMOD
LSMOD_F = $(shell if [ `basename $(LSMOD)` == $(LSMOD) ]; then \
echo $(objtree)/$(LSMOD); \
else \
echo $(LSMOD); \
fi)
endif

localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
$(Q)mkdir -p include/generated
$(Q)perl $< $(srctree) $(Kconfig) > .tmp.config
$(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config
$(Q)if [ -f .config ]; then \
cmp -s .tmp.config .config || \
(mv -f .config .config.old.1; \
Expand All @@ -47,7 +56,7 @@ localmodconfig: $(obj)/streamline_config.pl $(obj)/conf

localyesconfig: $(obj)/streamline_config.pl $(obj)/conf
$(Q)mkdir -p include/generated
$(Q)perl $< $(srctree) $(Kconfig) > .tmp.config
$(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config
$(Q)sed -i s/=m/=y/ .tmp.config
$(Q)if [ -f .config ]; then \
cmp -s .tmp.config .config || \
Expand Down
38 changes: 27 additions & 11 deletions trunk/scripts/kconfig/streamline_config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ sub find_config {
# Get the build source and top level Kconfig file (passed in)
my $ksource = $ARGV[0];
my $kconfig = $ARGV[1];
my $lsmod_file = $ARGV[2];

my @makefiles = `find $ksource -name Makefile`;
my %depends;
Expand Down Expand Up @@ -263,21 +264,36 @@ sub read_kconfig {

my %modules;

# see what modules are loaded on this system
my $lsmod;

foreach $dir ( ("/sbin", "/bin", "/usr/sbin", "/usr/bin") ) {
if ( -x "$dir/lsmod" ) {
$lsmod = "$dir/lsmod";
last;
if (defined($lsmod_file)) {
if ( ! -f $lsmod_file) {
die "$lsmod_file not found";
}
if ( -x $lsmod_file) {
# the file is executable, run it
open(LIN, "$lsmod_file|");
} else {
# Just read the contents
open(LIN, "$lsmod_file");
}
} else {

# see what modules are loaded on this system
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";
if (!defined($lsmod)) {
# try just the path
$lsmod = "lsmod";
}

open(LIN,"$lsmod|") || die "Can not call lsmod with $lsmod";
}

open(LIN,"$lsmod|") || die "Can not call lsmod with $lsmod";
while (<LIN>) {
next if (/^Module/); # Skip the first line.
if (/^(\S+)/) {
Expand Down

0 comments on commit 960850b

Please sign in to comment.