Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59dde385 authored by Hui Zhu's avatar Hui Zhu Committed by Michal Marek
Browse files

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: default avatarHui Zhu <teawater@gmail.com>
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent 52e13e21
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -25,8 +25,8 @@ Getopt::Long::GetOptions(
	'cross-compile|c=s'	=> \$cross_compile,
	'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;