summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-09-02 04:46:11 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-09-02 04:48:13 +0300
commit577e95fce5470b855c6e46540fe041b2de80aa1e (patch)
tree50fb63f38cd5e1b0666ccf9b8954bb92816bc7df
parent72e5cfbc347fa31ba6f435aebe31e29e3c4860a0 (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-xkflash.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/kflash.sh b/kflash.sh
index 92ca9dd..448006f 100755
--- a/kflash.sh
+++ b/kflash.sh
@@ -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]}