diff options
author | Łukasz Stelmach <l.stelmach@samsung.com> | 2022-03-09 13:53:37 +0100 |
---|---|---|
committer | Łukasz Stelmach <l.stelmach@samsung.com> | 2022-03-09 23:55:40 +0100 |
commit | 9f0ada4bedb278a275180dd769d8ec8ce0c1d4b9 (patch) | |
tree | 88dfb25132f74f96b90fa1e9e923dc105ce9d16d | |
parent | 27d8ef00db790336cf17cf8e63fd0a1b3a0986b5 (diff) | |
download | u-boot-submit/tizen/20220311.014813.tar.gz u-boot-submit/tizen/20220311.014813.tar.bz2 u-boot-submit/tizen/20220311.014813.zip |
scripts: sd_fusing_rpi3: remove unnecessary grep callssubmit/tizen/20220311.014813accepted/tizen/unified/20220311.111953
Handle pattern matching with awk instead of grep.
Change-Id: I7377e578987dc77f0f22d0083630acd5888eff66
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
-rwxr-xr-x | scripts/tizen/sd_fusing_rpi3.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/tizen/sd_fusing_rpi3.sh b/scripts/tizen/sd_fusing_rpi3.sh index 62efa1352e..f102f63dcc 100755 --- a/scripts/tizen/sd_fusing_rpi3.sh +++ b/scripts/tizen/sd_fusing_rpi3.sh @@ -81,7 +81,7 @@ function fusing_image () { else local -r blktype=part fi - local -r device=/dev/`lsblk ${DEVICE} -o TYPE,KNAME | grep ${blktype} | awk '{ print $2 }' | grep -G "[a-z]${num}\$"` + local -r device=/dev/`lsblk ${DEVICE} -o TYPE,KNAME | awk "/^${blktype}.*[a-z]${num}\$/ { print \\\$2 }"` local -r bs=${PART_TABLE[${part_idx} * ${PART_TABLE_COL} + 2]} else echo "Not supported binary: $fusing_img" @@ -288,7 +288,7 @@ function mkpart_3 () { fi for ((idx=0;idx<$PART_TABLE_ROW;idx++)); do - local PART=/dev/`lsblk ${DISK} -o TYPE,KNAME | grep part | awk '{ print $2 }' | grep -G "[a-z]${PART_TABLE[$idx * ${PART_TABLE_COL} + 1]}\$"` + local PART=/dev/`lsblk ${DISK} -o TYPE,KNAME | awk "/^part.*[a-z]${PART_TABLE[$idx * ${PART_TABLE_COL} + 1]}\$/ { print \\\$2 }"` if [ "${PART_TABLE[$idx * ${PART_TABLE_COL} + 4]}" == "vfat" ]; then mkfs.vfat -F 16 ${PART} -n ${PART_TABLE[$idx * ${PART_TABLE_COL} + 3]} if [ $? -eq 1 ]; then |