From 729c9d0e23ab6f3a5138d54c5d0a85ec56f0ca3a Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Thu, 20 Aug 2015 00:17:45 +0200 Subject: [PATCH] Add --reset-send option --- README.pod | 7 ++++++- novaboot | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/README.pod b/README.pod index bf6d035..4bd3d2e 100644 --- a/README.pod +++ b/README.pod @@ -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 + +Reset the target by sending the given I to the remote serial +line. "\n" sequences are replaced with newline character. + =item --no-reset, --reset Disable/enable resetting of the target. diff --git a/novaboot b/novaboot index ca53e0e..66ec981 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, $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 + +Reset the target by sending the given I to the remote serial +line. "\n" sequences are replaced with newline character. + =item --no-reset, --reset Disable/enable resetting of the target. -- 2.39.2