]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
Add --exiton-timeout option
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 21 Oct 2014 22:06:15 +0000 (00:06 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 21 Oct 2014 22:06:15 +0000 (00:06 +0200)
README.md
novaboot

index 904c8d6d17a940e315166baf5b55b1a5daa65239..b118efc76446d7106b9f398e249b7eeeef9dd509 100644 (file)
--- a/README.md
+++ b/README.md
@@ -478,6 +478,12 @@ interactive work with the target.
 
     The same as --exiton -re --exiton _regex_.
 
+- --exiton-timeout=_seconds_
+
+    By default **--exiton** waits for the string match forever. When this
+    option is specified, "exiton" timeouts after the specifies number of
+    seconds and novaboot returns non-zero exit code.
+
 - -i, --interactive
 
     Setup things for interactive use of target. Your terminal will be
index 63bc0e0c4b45ae337de2d4e735c71cf5343cd6c0..eab0fec1f463039b02b04481787db739362e399d 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -107,7 +107,7 @@ read_config($_) foreach $cfg or @cfgs;
 my $explicit_target;
 GetOptions ("target|t=s" => \$explicit_target);
 
-my ($amt, @append, $bender, @chainloaders, $concat, $config_name_opt, $dhcp_tftp, $dump_opt, $dump_config, @exiton, @expect_raw, $gen_only, $grub_config, $grub_prefix, $grub_preamble, $grub2_prolog, $grub2_config, $help, $ider, $iprelay, $iso_image, $interactive, $kernel_opt, $make, $man, $no_file_gen, $off_opt, $on_opt, $pulsar, $pulsar_root, $qemu, $qemu_append, $qemu_flags_cmd, $remote_cmd, $remote_expect, $reset, $reset_cmd, $rom_prefix, $rsync_flags, @scriptmod, $scons, $serial, $server, $stty, $tftp, $tftp_port, $uboot, %uboot_addr, @uboot_init);
+my ($amt, @append, $bender, @chainloaders, $concat, $config_name_opt, $dhcp_tftp, $dump_opt, $dump_config, @exiton, $exiton_timeout, @expect_raw, $gen_only, $grub_config, $grub_prefix, $grub_preamble, $grub2_prolog, $grub2_config, $help, $ider, $iprelay, $iso_image, $interactive, $kernel_opt, $make, $man, $no_file_gen, $off_opt, $on_opt, $pulsar, $pulsar_root, $qemu, $qemu_append, $qemu_flags_cmd, $remote_cmd, $remote_expect, $reset, $reset_cmd, $rom_prefix, $rsync_flags, @scriptmod, $scons, $serial, $server, $stty, $tftp, $tftp_port, $uboot, %uboot_addr, @uboot_init);
 
 $rsync_flags = '';
 $rom_prefix = 'rom://';
@@ -144,6 +144,7 @@ my %opt_spec;
     "dump"          => \$dump_opt,
     "dump-config"    => \$dump_config,
     "exiton=s"       => \@exiton,
+    "exiton-timeout=i"=> \$exiton_timeout,
     "exiton-re=s"    => sub { my ($n, $v) = @_; push(@exiton, '-re', $v); },
     "expect=s"      => \&handle_expect,
     "expect-re=s"    => \&handle_expect,
@@ -1086,7 +1087,7 @@ if (defined $exp) {
     print "novaboot: Serial line interaction $note(press $interrupt to interrupt)...\n";
     $exp->log_stdout(1);
     if (@exiton) {
-       $exp->expect(undef, @expect_raw, @exiton);
+       $exp->expect($exiton_timeout, @expect_raw, @exiton) || die("exiton timeout");
     } else {
        my @inputs = ($exp);
        if (-t STDIN) { # Set up bi-directional communication if we run on terminal
@@ -1645,6 +1646,12 @@ treated as regular expression. For example:
 
 The same as --exiton -re --exiton I<regex>.
 
+=item --exiton-timeout=I<seconds>
+
+By default B<--exiton> waits for the string match forever. When this
+option is specified, "exiton" timeouts after the specifies number of
+seconds and novaboot returns non-zero exit code.
+
 =item -i, --interactive
 
 Setup things for interactive use of target. Your terminal will be