lkml.org 
[lkml]   [2010]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] markup_oops.pl: add options to improve cross-sompilation environments
On 26.1.2010 10:13, Hui Zhu wrote:
> +# Get options
> +Getopt::Long::GetOptions(
> + 'cross-compile|c=s' => \$cross_compile,
> + 'module|m=s' => \$modulefile,
> + 'help|h' => \&usage,
> +);

You should check the return code of GetOptions() and abort on invalid
options.


> +my $vmlinux_name = $ARGV[$#ARGV];

GetOptions() deletes the recognized options from @ARGV, so you can say
$ARGV[0] as before (and maybe check if there aren't any superfluous
arguments).


> # if it's a module, we need to find the .ko file and calculate a load
> offset
> if ($module ne "") {
> - my $modulefile = `modinfo $module | grep '^filename:' | awk '{
> print \$2 }'`;
> - chomp($modulefile);
> + if ($modulefile eq "") {
> + my $modulefile = `modinfo $module | grep '^filename:' | awk '{
> print \$2 }'`;

I know you didn't add this, but while at it, could you replace the
pipeline with just `modinfo -F filename $module`?


> +sub usage {
> + print <<EOT;
> +Usage:
> + dmesg | perl $0 [OPTION] [VMLINUX]
> +
> +OPTION:
> + -c, --cross-compile CROSS_COMPILE Specify the prefix used for
> toolchain.
> + -m, --module MODULE_DIRNAME Specify the module directory name.

Here and in the changelog you talk about "module directory name", but in
fact this is the module filename.

Thanks,
Michal


\
 
 \ /
  Last update: 2010-01-29 21:31    [W:1.110 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site