diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-09-02 04:46:11 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-09-02 04:48:13 +0300 |
commit | 577e95fce5470b855c6e46540fe041b2de80aa1e (patch) | |
tree | 50fb63f38cd5e1b0666ccf9b8954bb92816bc7df | |
parent | 72e5cfbc347fa31ba6f435aebe31e29e3c4860a0 (diff) |
kflash: Add argument to select which partitions to flash
The --partitions argument can be used to select which partitions to
flash. By default kflash will flash all partitions defined in the
platform file.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rwxr-xr-x | kflash.sh | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -18,6 +18,7 @@ fi # dry_run=0 +partitions= silent=0 sudo=sudo @@ -30,6 +31,10 @@ while [[ $# != 0 ]] ; do dry_run=1 sudo=echo ;; + --partitions) + partitions=($1) + shift + ;; --silent) silent=1 ;; @@ -112,7 +117,11 @@ fi # Validate the partition names and paths # -for part_name in ${!flash_parts[@]} ; do +if [[ ! $partitions ]] ; then + partitions=(${!flash_parts[@]}) +fi + +for part_name in ${partitions[@]} ; do case $part_name in dt|kernel|modules) ;; @@ -228,7 +237,7 @@ fi # Flash # -for part_name in ${!flash_parts[@]} ; do +for part_name in ${partitions[@]} ; do IFS=";" read -ra flash_part <<< "${flash_parts[$part_name]}" part_idx=${flash_part[0]} @@ -278,7 +287,7 @@ flash_fs() { ${sudo} umount "$flash_mount_point" } -for part_name in ${!flash_parts[@]} ; do +for part_name in ${partitions[@]} ; do IFS=";" read -ra flash_part <<< "${flash_parts[$part_name]}" part_idx=${flash_part[0]} part_path=${flash_part[2]} |