summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Alcantara <paulo@paulo.ac>2018-05-25 18:41:26 -0300
committerPaulo Alcantara <paulo@paulo.ac>2018-05-25 18:41:26 -0300
commit84a17878d3799970c231e12ed92862a78e64ebe8 (patch)
tree438c9de8aabf0f2bf5bace6a30084b6f2be3bd91
parent1a3e1bc29592daffcd4a17be434d1b9258a8932a (diff)
downloadvmhtool-84a17878d3799970c231e12ed92862a78e64ebe8.tar.gz
vmhtool-84a17878d3799970c231e12ed92862a78e64ebe8.tar.xz
vmhtool-84a17878d3799970c231e12ed92862a78e64ebe8.zip
Introduce --cmdline cmd option.
Allow the user to pass extra parameters to the linux kernel cmdline. Signed-off-by: Paulo Alcantara <paulo@paulo.ac>
-rwxr-xr-xvmhelper4
1 files changed, 4 insertions, 0 deletions
diff --git a/vmhelper b/vmhelper
index eb0e377..bad9a23 100755
--- a/vmhelper
+++ b/vmhelper
@@ -47,6 +47,8 @@ Linux options:
--gdb wait for gdb conn on a random TCP port
--serial enable kernel output on serial
(requires: --kernel,--rootfs)
+ --cmdline=\"foo...\" append extra cmdline params
+ (requires: --kernel,--rootfs)
";
exit 1;
}
@@ -71,6 +73,7 @@ GetOptions("install=s" => \$cmd_opts{install_iso_path},
"bridge" => \$cmd_opts{create_bridge},
"gdb" => \$cmd_opts{gdb_conn},
"serial" => \$cmd_opts{kernel_serial},
+ "cmdline=s" => \$cmd_opts{kernel_cmdline},
"nographic" => \$cmd_opts{nographic}) or usage();
usage() if $cmd_opts{print_help};
@@ -676,6 +679,7 @@ if ($cmd_opts{kernel_path}) {
$qemu_cmd .= " " . sprintf $qemu_linux_opts{'kernel'}, $linux_img;
$qemu_cmd .= " -append \"root=$cmd_opts{rootfs_path} rw";
+ $qemu_cmd .= " $cmd_opts{kernel_cmdline}" if $cmd_opts{kernel_cmdline};
unless ($cmd_opts{kernel_serial}) {
$qemu_cmd .= "\" -display none $qemu_linux_opts{'mon'}";
} else {