]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
Implement --remote-expect-timeout
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 23 Apr 2017 10:15:01 +0000 (12:15 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 23 Apr 2017 10:15:01 +0000 (12:15 +0200)
README.pod
novaboot

index 6f49f02e4cbae400ae6613cf90944f97f5af3612..73464dcf306b15b3a4d86f2243da2d181969ede3 100644 (file)
@@ -412,6 +412,12 @@ echoed to stdout while waiting for the I<string>. Everything after the
 matched string is printed to stdout, so you may want to include line
 end characters in the I<string> as well.
 
+=item --remote-expect-timeout=I<seconds>
+
+Timeout in seconds for B<--remote-expect> or
+B<--remote-expect-seconds>. When negative, waits forever. The default
+is 180 seconds.
+
 =back
 
 =head2 File deployment phase
index d0f178ae9f743205a5f689d8989aa32ba851ffe8..d60378c04a8bec21d93818ed1cc2aefaf59c20af 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -120,7 +120,7 @@ read_config($_) foreach $cfg or @cfgs;
 my $explicit_target = $ENV{'NOVABOOT_TARGET'};
 GetOptions ("target|t=s" => \$explicit_target);
 
-my ($amt, @append, $bender, @chainloaders, $concat, $config_name_opt, $dhcp_tftp, $dump_opt, $dump_config, @exiton, $exiton_timeout, @expect_raw, $final_eol, $gen_only, $grub_config, $grub_prefix, $grub_preamble, $grub2_prolog, $grub2_config, $help, $ider, $interaction, $iprelay, $iso_image, $interactive, $kernel_opt, $make, $man, $netif, $no_file_gen, $off_opt, $on_opt, $pulsar, $pulsar_root, $qemu, $qemu_append, $qemu_flags_cmd, $remote_cmd, $remote_expect, $remote_expect_silent, $reset, $reset_cmd, $reset_send, $rom_prefix, $rsync_flags, @scriptmod, $scons, $serial, $server, $stty, $tftp, $tftp_port, $uboot, %uboot_addr, $uboot_cmd, @uboot_init);
+my ($amt, @append, $bender, @chainloaders, $concat, $config_name_opt, $dhcp_tftp, $dump_opt, $dump_config, @exiton, $exiton_timeout, @expect_raw, $final_eol, $gen_only, $grub_config, $grub_prefix, $grub_preamble, $grub2_prolog, $grub2_config, $help, $ider, $interaction, $iprelay, $iso_image, $interactive, $kernel_opt, $make, $man, $netif, $no_file_gen, $off_opt, $on_opt, $pulsar, $pulsar_root, $qemu, $qemu_append, $qemu_flags_cmd, $remote_cmd, $remote_expect, $remote_expect_silent, $remote_expect_timeout, $reset, $reset_cmd, $reset_send, $rom_prefix, $rsync_flags, @scriptmod, $scons, $serial, $server, $stty, $tftp, $tftp_port, $uboot, %uboot_addr, $uboot_cmd, @uboot_init);
 
 # Default values of certain command line options
 %uboot_addr = (
@@ -135,6 +135,7 @@ $reset = 1;                 # Reset target by default
 $interaction = 1;              # Perform target interaction by default
 $final_eol = 1;
 $netif = 'eth0';
+$remote_expect_timeout = 180;
 
 my @expect_seen = ();
 sub handle_expect
@@ -198,6 +199,7 @@ my %opt_spec;
     "remote-cmd=s"   => \$remote_cmd,
     "remote-expect=s"=> \$remote_expect,
     "remote-expect-silent=s"=> sub { $remote_expect=$_[1]; $remote_expect_silent=1; },
+    "remote-expect-timeout=i"=> \$remote_expect_timeout,
     "reset!"         => \$reset,
     "reset-cmd=s"    => \$reset_cmd,
     "reset-send=s"   => \$reset_send,
@@ -808,7 +810,8 @@ if ($remote_expect) {
     if (defined $remote_expect_silent) {
        $exp->log_stdout(0);
     }
-    $exp->expect(180, $remote_expect) || die "Expect for '$remote_expect' timed out";
+    $exp->expect($remote_expect_timeout >= 0 ? $remote_expect_timeout : undef,
+                $remote_expect) || die "Expect for '$remote_expect' timed out";
     if (defined $remote_expect_silent) {
        $exp->log_stdout($log);
        print $exp->after() if $log;
@@ -1653,6 +1656,12 @@ echoed to stdout while waiting for the I<string>. Everything after the
 matched string is printed to stdout, so you may want to include line
 end characters in the I<string> as well.
 
+=item --remote-expect-timeout=I<seconds>
+
+Timeout in seconds for B<--remote-expect> or
+B<--remote-expect-seconds>. When negative, waits forever. The default
+is 180 seconds.
+
 =back
 
 =head2 File deployment phase