From: Dobrica Pavlinusic Date: Thu, 27 Dec 2012 08:42:24 +0000 (+0100) Subject: flash just some files from update X-Git-Url: http://git.rot13.org/?p=android-command-line.git;a=commitdiff_plain;h=e7632806520da89424583e4745fc29e10a870f9c flash just some files from update --- diff --git a/rockchip-flash-helper.pl b/rockchip-flash-helper.pl index df9744d..e91f0b3 100755 --- a/rockchip-flash-helper.pl +++ b/rockchip-flash-helper.pl @@ -4,7 +4,8 @@ use strict; 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 = ; my $rkflashtool = '/virtual/android/android-command-line/rkflashtool/rkflashtool'; @@ -43,6 +44,21 @@ foreach ( split(/,/,$cmdline) ) { 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";