X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=examples%2Fdepmod.pl;h=b2bf5471319daba82cbbcc484452eb91477ce271;hb=3983bd5593ae3a18dd69072e549e3860820cb8ff;hp=0e66ee3ebce918a93a3b5472a76068e879377f3a;hpb=fa6c4844b2fef07def6b739c8f28ec50c2612208;p=oweals%2Fbusybox.git diff --git a/examples/depmod.pl b/examples/depmod.pl index 0e66ee3eb..b2bf54713 100755 --- a/examples/depmod.pl +++ b/examples/depmod.pl @@ -1,5 +1,5 @@ #!/usr/bin/perl -w -# vi: set ts=4: +# vi: set sw=4 ts=4: # Copyright (c) 2001 David Schleef # Copyright (c) 2001 Erik Andersen # Copyright (c) 2001 Stuart Hughes @@ -25,6 +25,7 @@ my $kernelsyms=""; my $stdout=0; my $verbose=0; my $help=0; +my $nm = $ENV{'NM'} || "nm"; # more globals my (@liblist) = (); @@ -33,7 +34,7 @@ my $dep = {}; my $mod = {}; my $usage = < | -F } [options]... +$0 -b basedir { -k | -F } [options]... Where: -h --help : Show this help screen -b --basedir : Modules base directory (e.g /lib/modules/<2.x.y>) @@ -104,7 +105,7 @@ foreach my $obj ( @liblist ){ warn "\nMODULE = $tgtname\n" if $verbose; # get a list of symbols - my @output=`nm $obj`; + my @output=`$nm $obj`; build_ref_tables($tgtname, \@output, $exp, $dep); } @@ -112,7 +113,7 @@ foreach my $obj ( @liblist ){ # vmlinux is a special name that is only used to resolve symbols my $tgtname = 'vmlinux'; -my @output = $kernelsyms ? `cat $kernelsyms` : `nm $kernel`; +my @output = $kernelsyms ? `cat $kernelsyms` : `$nm $kernel`; warn "\nMODULE = $tgtname\n" if $verbose; build_ref_tables($tgtname, \@output, $exp, $dep); @@ -210,7 +211,7 @@ __END__ depmod.pl - a cross platform script to generate kernel module dependency lists (modules.conf) which can then be used by modprobe -on the target platform. +on the target platform. It supports Linux 2.4 and 2.6 styles of modules.conf (auto-detected) @@ -244,7 +245,7 @@ This displays the help message. =item B<-b --basedir> The base directory uner which the target's modules will be found. This -defaults to the /lib/modules directory. +defaults to the /lib/modules directory. If you don't specify the kernel version, this script will search for one under the specified based directory and use the first thing that @@ -286,6 +287,3 @@ under the same terms as Perl itself. David Schleef =cut - -# $Id: depmod.pl,v 1.4 2004/03/15 08:28:33 andersen Exp $ -