]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
Add options for remote reset target connection and reset
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 5 Nov 2013 23:38:12 +0000 (00:38 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 5 Nov 2013 23:38:12 +0000 (00:38 +0100)
README.md
novaboot

index 53828897e9f79ad1bf42c7772dd25a16e9a520ac..46c9de24a541afb3024623c5dc74dca589d8dff6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -339,6 +339,15 @@ See __\--serial__. There will be new options soon.
     specified with __\--serial__. If this option is not given, `stty` is
     called with `raw -crtscts -onlcr 115200` settings.
 
+- \--remote-cmd=<cmd>
+
+    Command that mediates connection to the target's serial line. For
+    example `ssh server 'cu -l /dev/ttyS0'`.
+
+- \--reset-cmd=<cmd>
+
+    Command that resets the target.
+
 See also __\--iprelay__.
 
 ## Termination phase
index f8f46e382e411159b182b36a93d188d622daa216..ce6a9d739f3d2c7a20b1834a0a26519855fd00a0 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -88,7 +88,7 @@ read_config($_) foreach $cfg or reverse @cfgs;
 
 ## Command line handling
 
-my ($append, $bender, @chainloaders, $concat, $config_name_opt, $dhcp_tftp, $dump_opt, $dump_config, $gen_only, $grub_config, $grub_prefix, $grub_preamble, $grub2_prolog, $grub2_config, $help, $iprelay, $iso_image, $man, $no_file_gen, $off_opt, $on_opt, $pulsar, $pulsar_root, $qemu, $qemu_append, $qemu_flags_cmd, $rom_prefix, $rsync_flags, @scriptmod, $scons, $serial, $server, $stty, $uboot);
+my ($append, $bender, @chainloaders, $concat, $config_name_opt, $dhcp_tftp, $dump_opt, $dump_config, $gen_only, $grub_config, $grub_prefix, $grub_preamble, $grub2_prolog, $grub2_config, $help, $iprelay, $iso_image, $man, $no_file_gen, $off_opt, $on_opt, $pulsar, $pulsar_root, $qemu, $qemu_append, $qemu_flags_cmd, $remote_cmd, $reset_cmd, $rom_prefix, $rsync_flags, @scriptmod, $scons, $serial, $server, $stty, $uboot, $uboot_init);
 
 $rsync_flags = '';
 $rom_prefix = 'rom://';
@@ -122,6 +122,8 @@ my %opt_spec;
     "qemu|Q=s"              => \$qemu,
     "qemu-append=s"  => \$qemu_append,
     "qemu-flags|q=s" => \$qemu_flags_cmd,
+    "remote-cmd=s"   => \$remote_cmd,
+    "reset-cmd=s"    => \$reset_cmd,
     "rsync-flags=s"  => \$rsync_flags,
     "scons:s"       => \$scons,
     "scriptmod=s"    => \@scriptmod,
@@ -450,9 +452,19 @@ elsif ($serial) {
     system_verbose("stty -F $serial $stty");
     open($CONN, "+<", $serial) || die "open $serial: $!";
     $exp = Expect->init(\*$CONN);
-}
-else {
+} else {
     $exp = new Expect(); # Make $exp ready for calling $exp->spawn() later
+
+    if ($remote_cmd) {
+       print "novaboot: Running: $remote_cmd\n";
+       $exp->spawn($remote_cmd);
+    }
+}
+
+if (defined $reset_cmd) {
+    $target_reset = sub {
+       system_verbose($reset_cmd);
+    };
 }
 
 if (defined $on_opt && defined $target_power_on) {
@@ -1130,6 +1142,15 @@ Specifies settings passed to C<stty> invoked on the serial line
 specified with B<--serial>. If this option is not given, C<stty> is
 called with C<raw -crtscts -onlcr 115200> settings.
 
+=item --remote-cmd=<cmd>
+
+Command that mediates connection to the target's serial line. For
+example C<ssh server 'cu -l /dev/ttyS0'>.
+
+=item --reset-cmd=<cmd>
+
+Command that resets the target.
+
 =back
 
 See also B<--iprelay>.