diff options
author | Hui Zhu <hui.zhu@windriver.com> | 2010-02-01 13:41:22 +0800 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2010-02-05 22:33:43 +0100 |
commit | 59dde3853e07aaadc2b63abd16c954d5b0606cf1 (patch) | |
tree | 100bca308ab56e77b632a45401b0a915982bd290 | |
parent | 52e13e219d5930fb8fb774050e6ecffa244a60a9 (diff) | |
download | kernel_samsung_crespo-59dde3853e07aaadc2b63abd16c954d5b0606cf1.zip kernel_samsung_crespo-59dde3853e07aaadc2b63abd16c954d5b0606cf1.tar.gz kernel_samsung_crespo-59dde3853e07aaadc2b63abd16c954d5b0606cf1.tar.bz2 |
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>
-rw-r--r-- | scripts/markup_oops.pl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/markup_oops.pl b/scripts/markup_oops.pl index a7e8e01..90e1d9a 100644 --- a/scripts/markup_oops.pl +++ b/scripts/markup_oops.pl @@ -23,10 +23,10 @@ my $modulefile = ""; # Get options Getopt::Long::GetOptions( 'cross-compile|c=s' => \$cross_compile, - 'module|m=s' => \$modulefile, + 'module|m=s' => \$modulefile, 'help|h' => \&usage, -); -my $vmlinux_name = $ARGV[$#ARGV]; +) || usage (); +my $vmlinux_name = $ARGV[0]; if (!defined($vmlinux_name)) { my $kerver = `uname -r`; chomp($kerver); @@ -193,7 +193,7 @@ if ($target eq "0") { # if it's a module, we need to find the .ko file and calculate a load offset if ($module ne "") { if ($modulefile eq "") { - my $modulefile = `modinfo $module | grep '^filename:' | awk '{ print \$2 }'`; + $modulefile = `modinfo -F filename $module`; chomp($modulefile); } $filename = $modulefile; @@ -362,7 +362,7 @@ Usage: OPTION: -c, --cross-compile CROSS_COMPILE Specify the prefix used for toolchain. - -m, --module MODULE_DIRNAME Specify the module directory name. + -m, --module MODULE_DIRNAME Specify the module filename. -h, --help Help. EOT exit; |