Commit 7e7d4f5a authored by Robert Ricci's avatar Robert Ricci

Fix stargate support - I had the wrong programming board, and you

have to set $UID=$EUID for sshtb as root to work right.

Temporarily treat garcia 'hosts' like stargates.

Add support for mica1 motes.
parent 1edfbe3d
...@@ -169,13 +169,15 @@ MOTE: foreach my $mote (@motes) { ...@@ -169,13 +169,15 @@ MOTE: foreach my $mote (@motes) {
last TSWITCH; last TSWITCH;
}; };
/^sg/ && do { # XXX - garcia is temporary - hopefully, at some point, we will
# distinguish the garcia from the stargate that rides on it
(/^sg/ || /^garcia/) && do {
# Stargate # Stargate
# We have to ssh in to the stargate to do the programming # We have to ssh in to the stargate to do the programming
# The type of programming board on a stargate # The type of programming board on a stargate
push @uisp_args, "-dprog=stargate"; push @uisp_args, "-dprog=sggpio";
# We do the upload by sshing to the toe stargate and running # We do the upload by sshing to the toe stargate and running
# uisp # uisp
...@@ -195,8 +197,12 @@ MOTE: foreach my $mote (@motes) { ...@@ -195,8 +197,12 @@ MOTE: foreach my $mote (@motes) {
# #
my ($proc, $speed) = TBNodeTypeProcInfo($motetype); my ($proc, $speed) = TBNodeTypeProcInfo($motetype);
PSWITCH: for ($proc) { PSWITCH: for ($proc) {
/^ATmega128/i && do { /^ATmega128/i && do { # mica2
push @uisp_args, "-dpart=ATmega128"; push @uisp_args, "-dpart=ATmega128","--wr_fuse_e=ff";
last PSWITCH;
};
/^ATmega103/i && do { # mica1
push @uisp_args, "-dpart=ATmega103","--wr_fuse_e=fd";
last PSWITCH; last PSWITCH;
}; };
# Default # Default
...@@ -211,7 +217,8 @@ MOTE: foreach my $mote (@motes) { ...@@ -211,7 +217,8 @@ MOTE: foreach my $mote (@motes) {
my $opstring; my $opstring;
OSWITCH: for ($operation) { OSWITCH: for ($operation) {
/^upload$/ && do { /^upload$/ && do {
$opstring = "--wr_fuse_e=ff --erase --upload "; #$opstring = "--wr_fuse_e=ff --erase --upload ";
$opstring = "--erase --upload ";
if ($upload_method eq "direct") { if ($upload_method eq "direct") {
$opstring .= "if=$filename"; $opstring .= "if=$filename";
} elsif ($upload_method eq "ssh") { } elsif ($upload_method eq "ssh") {
...@@ -236,7 +243,7 @@ MOTE: foreach my $mote (@motes) { ...@@ -236,7 +243,7 @@ MOTE: foreach my $mote (@motes) {
# #
$commandstr = "$UISP " . join(" ",@uisp_args,$opstring); $commandstr = "$UISP " . join(" ",@uisp_args,$opstring);
# Drop root permission, no need ro it # Drop root permission, no need for it
$EUID = $UID; $EUID = $UID;
} elsif ($upload_method eq "ssh") { } elsif ($upload_method eq "ssh") {
# #
...@@ -244,6 +251,11 @@ MOTE: foreach my $mote (@motes) { ...@@ -244,6 +251,11 @@ MOTE: foreach my $mote (@motes) {
# #
$commandstr = "$SSHTB -host $host $SGUISP " . $commandstr = "$SSHTB -host $host $SGUISP " .
join(" ",@uisp_args,$opstring) . " < $filename"; join(" ",@uisp_args,$opstring) . " < $filename";
#
# SSH gets ticked if UID != EUID, so set that now
#
$UID = $EUID;
} else { } else {
warn "Unsupported upload method for $mote - skipping"; warn "Unsupported upload method for $mote - skipping";
$errors++; $errors++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment