make smartflash ignore bridge r0kets.
Also allow flashing different firmwares via commandline
This commit is contained in:
parent
66717f7c35
commit
e97a5ffafc
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue