Browse files

flash just some files from update

  • Loading branch information...
1 parent 476feb6 commit e7632806520da89424583e4745fc29e10a870f9c @dpavlin committed Dec 27, 2012
Showing with 17 additions and 1 deletion.
  1. +17 −1 rockchip-flash-helper.pl
View
18 rockchip-flash-helper.pl
@@ -4,7 +4,8 @@
use Getopt::Long;
-my $mode = lc($ARGV[0]) || die "usage: $0 (backup|restore|update)\n";
+my @files = @ARGV;
+my $mode = lc(shift @files) || die "usage: $0 (backup|restore|update|flash /path/to/file.img)\n";
my $cmdline = <DATA>;
my $rkflashtool = '/virtual/android/android-command-line/rkflashtool/rkflashtool';
@@ -43,6 +44,21 @@
warn "SKIP $start $size $name - not found in update\n";
next;
}
+
+ } elsif ( $mode eq 'flash' ) {
+
+ foreach my $file ( @files ) {
+ if ( $file =~ m/$name/ && -e $file ) {
+ $cmd = "$rkflashtool w $start $size < $file";
+ } else {
+ next;
+ }
+ }
+
+ next if ! $cmd;
+
+ } else {
+ die "unknown mode $mode\n";
}
warn "# $cmd\n";

0 comments on commit e763280

Please sign in to comment.