make smartflash ignore bridge r0kets.

Also allow flashing different firmwares via commandline
This commit is contained in:
Stefan `Sec` Zehl 2012-04-21 14:59:08 +02:00
parent 66717f7c35
commit e97a5ffafc
3 changed files with 25 additions and 3 deletions

View File

@ -27,6 +27,11 @@ setup:
@echo
@echo "Now run ./smartflash (as root)"
bridge:
cd ../../firmware && make APP=bridge TABLE=NO USBSERIAL=YES clean all
cp ../../firmware/bridge.bin .
sudo ./smartflash bridge.bin
run:
sudo ./smartflash

View File

@ -1,3 +1,11 @@
#!/bin/sh
dd if=firmware.bin seek=4 of=/dev/$1 2>/dev/null
echo "FLASH done: $1 @ $2"
bin=frimware.bin
if [ ! -z "$3" ] ; then
bin=$3
fi
dd if=$3 seek=4 of=/dev/$1 2>/dev/null
if [ -z "$3" ] ; then
echo "FLASH done: $1 @ $2"
else
echo "=== FLASH of $3 done: $1 @ $2"
fi

View File

@ -5,6 +5,8 @@ $|=1;
my $DEV="/sys/bus/usb/devices";
my $arg=$ARGV[0];
sub getline{
my($path)=@_;
open(my $f,"<",$DEV."/".$path) || do {
@ -110,9 +112,16 @@ sub dwim{
return 1;
};
print "flash $dev -> $sdev\n";
system("./flash $sdev $dev");
system("./flash $sdev $dev $arg");
$done{$dev}=2;
return 1;
};
if("$ve:$pr" eq "239a:1002") {
return 1 if $done{$dev}==3;
my $sdev=getdev($dev);
$done{$dev}=3;
print "BRIDGE r0ket $dev, ignoring\n";
return 0;
};
print "$ve:$pr [$mf] @ ";
return -1;