From: Michal Sojka Date: Sun, 23 Apr 2017 10:15:01 +0000 (+0200) Subject: Implement --remote-expect-timeout X-Git-Tag: 20170423~2 X-Git-Url: https://rtime.felk.cvut.cz/gitweb/novaboot.git/commitdiff_plain/1a96753d5bd1a77809ff90f58d96e588762b288e Implement --remote-expect-timeout --- diff --git a/README.pod b/README.pod index 6f49f02..73464dc 100644 --- a/README.pod +++ b/README.pod @@ -412,6 +412,12 @@ echoed to stdout while waiting for the I. Everything after the matched string is printed to stdout, so you may want to include line end characters in the I as well. +=item --remote-expect-timeout=I + +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 diff --git a/novaboot b/novaboot index d0f178a..d60378c 100755 --- 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. Everything after the matched string is printed to stdout, so you may want to include line end characters in the I as well. +=item --remote-expect-timeout=I + +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