Skip to content

Commit

Permalink
spacemit: shellfmt again after quoting fixes
Browse files Browse the repository at this point in the history
- problematic `if $(...)` remains; just indent changed
  • Loading branch information
rpardini committed Nov 30, 2024
1 parent 3016a66 commit 934c66a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions config/sources/families/spacemit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ write_uboot_platform() {

declare -A d
d=(
["${1}/bootinfo_emmc.bin"]="0:$(du -b "${1}/bootinfo_emmc.bin" | awk '{print $1}')"
["${1}/FSBL.bin"]="512:$(du -b "${1}/FSBL.bin" | awk '{print $1}')"
["${1}/bootinfo_emmc.bin"]="0:$(du -b "${1}/bootinfo_emmc.bin" | awk '{print $1}')"
["${1}/FSBL.bin"]="512:$(du -b "${1}/FSBL.bin" | awk '{print $1}')"
)

if [ -b ${2}boot0 ]; then
Expand All @@ -86,12 +86,10 @@ write_uboot_platform() {
sync
fi

for f in "${!d[@]}"
do
for f in "${!d[@]}"; do
# @TODO: "if $(...)" works by accident, should be "if ..." instead
if $(dd if=${device} bs=1 skip="${d[$f]%:*}" count="${d[$f]#*:}" \
conv=notrunc status=noxfer 2>/dev/null | cmp --quiet "${f}")
then
conv=notrunc status=noxfer 2> /dev/null | cmp --quiet "${f}"); then
echo "Skip $(basename $f), it is equal to the existing one"
else
echo "# Write =: $(basename $f) to ${device}"
Expand Down

0 comments on commit 934c66a

Please sign in to comment.