aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/markup_oops.pl
diff options
context:
space:
mode:
authorHui Zhu <hui.zhu@windriver.com>2010-02-01 00:41:22 -0500
committerMichal Marek <mmarek@suse.cz>2010-02-05 16:33:43 -0500
commit59dde3853e07aaadc2b63abd16c954d5b0606cf1 (patch)
tree100bca308ab56e77b632a45401b0a915982bd290 /scripts/markup_oops.pl
parent52e13e219d5930fb8fb774050e6ecffa244a60a9 (diff)
markup_oops.pl: minor fixes
1. Fix a little format issue. 2. Check the return of "Getopt::Long::GetOptions". Output usage and exit if it get error. 3. Change $ARGV[$#ARGV] to $ARGV[0]. 4. Change the code which get $modulefile from modinfo. Replace the pipeline with `modinfo -F filename $module`. 4. Change usage from "Specify the module directory name" to "Specify the module filename". Signed-off-by: Hui Zhu <teawater@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/markup_oops.pl')
-rw-r--r--scripts/markup_oops.pl10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/markup_oops.pl b/scripts/markup_oops.pl
index a7e8e019e03d..90e1d9aa35b5 100644
--- a/scripts/markup_oops.pl
+++ b/scripts/markup_oops.pl
@@ -23,10 +23,10 @@ my $modulefile = "";
23# Get options 23# Get options
24Getopt::Long::GetOptions( 24Getopt::Long::GetOptions(
25 'cross-compile|c=s' => \$cross_compile, 25 'cross-compile|c=s' => \$cross_compile,
26 'module|m=s' => \$modulefile, 26 'module|m=s' => \$modulefile,
27 'help|h' => \&usage, 27 'help|h' => \&usage,
28); 28) || usage ();
29my $vmlinux_name = $ARGV[$#ARGV]; 29my $vmlinux_name = $ARGV[0];
30if (!defined($vmlinux_name)) { 30if (!defined($vmlinux_name)) {
31 my $kerver = `uname -r`; 31 my $kerver = `uname -r`;
32 chomp($kerver); 32 chomp($kerver);
@@ -193,7 +193,7 @@ if ($target eq "0") {
193# if it's a module, we need to find the .ko file and calculate a load offset 193# if it's a module, we need to find the .ko file and calculate a load offset
194if ($module ne "") { 194if ($module ne "") {
195 if ($modulefile eq "") { 195 if ($modulefile eq "") {
196 my $modulefile = `modinfo $module | grep '^filename:' | awk '{ print \$2 }'`; 196 $modulefile = `modinfo -F filename $module`;
197 chomp($modulefile); 197 chomp($modulefile);
198 } 198 }
199 $filename = $modulefile; 199 $filename = $modulefile;
@@ -362,7 +362,7 @@ Usage:
362 362
363OPTION: 363OPTION:
364 -c, --cross-compile CROSS_COMPILE Specify the prefix used for toolchain. 364 -c, --cross-compile CROSS_COMPILE Specify the prefix used for toolchain.
365 -m, --module MODULE_DIRNAME Specify the module directory name. 365 -m, --module MODULE_DIRNAME Specify the module filename.
366 -h, --help Help. 366 -h, --help Help.
367EOT 367EOT
368 exit; 368 exit;