]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
Add --reset-send option
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 19 Aug 2015 22:17:45 +0000 (00:17 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 19 Aug 2015 22:17:45 +0000 (00:17 +0200)
README.pod
novaboot

index bf6d03544470f52a724fc56503654194c9f6612c..4bd3d2e0a38226d969aeee085b0bab89e9ee5761 100644 (file)
@@ -497,7 +497,7 @@ obtained from https://github.com/wentasah/amtterm.
 At this point, the target is reset (or switched on/off). There is
 several ways how this can be accomplished. Resetting a physical target
 can currently be accomplished by the following options: B<--amt>,
-B<--iprelay>, B<--reset-cmd>.
+B<--iprelay>, B<--reset-cmd> and B<--reset-send>.
 
 =over 8
 
@@ -526,6 +526,11 @@ Replace the default qemu flags (QEMU_FLAGS variable or C<-cpu coreduo
 
 Command that resets the target.
 
+=item --reset-send=I<string>
+
+Reset the target by sending the given I<string> to the remote serial
+line. "\n" sequences are replaced with newline character.
+
 =item --no-reset, --reset
 
 Disable/enable resetting of the target.
index ca53e0e33684084a3013c0fd08ea2b65484fb990..66ec9815e6d49d669613046470a82fcef5cd7015 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, $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, $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 = (
@@ -200,6 +200,7 @@ my %opt_spec;
     "remote-expect-silent=s"=> sub { $remote_expect=$_[1]; $remote_expect_silent=1; },
     "reset!"         => \$reset,
     "reset-cmd=s"    => \$reset_cmd,
+    "reset-send=s"   => \$reset_send,
     "rsync-flags=s"  => \$rsync_flags,
     "scons:s"       => \$scons,
     "scriptmod=s"    => \@scriptmod,
@@ -795,6 +796,13 @@ if (defined $reset_cmd) {
     };
 }
 
+if (defined $reset_send) {
+    $target_reset = sub {
+       $reset_send =~ s/\\n/\n/g;
+       $exp->send($reset_send);
+    };
+}
+
 if (defined $on_opt && defined $target_power_on) {
     &$target_power_on();
     exit;
@@ -1682,7 +1690,7 @@ obtained from https://github.com/wentasah/amtterm.
 At this point, the target is reset (or switched on/off). There is
 several ways how this can be accomplished. Resetting a physical target
 can currently be accomplished by the following options: B<--amt>,
-B<--iprelay>, B<--reset-cmd>.
+B<--iprelay>, B<--reset-cmd> and B<--reset-send>.
 
 =over 8
 
@@ -1711,6 +1719,11 @@ Replace the default qemu flags (QEMU_FLAGS variable or C<-cpu coreduo
 
 Command that resets the target.
 
+=item --reset-send=I<string>
+
+Reset the target by sending the given I<string> to the remote serial
+line. "\n" sequences are replaced with newline character.
+
 =item --no-reset, --reset
 
 Disable/enable resetting of the target.