diff options
author | Tomasz Maciej Nowak <tmn505@gmail.com> | 2020-11-25 17:33:36 +0100 |
---|---|---|
committer | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2020-11-25 18:18:54 +0100 |
commit | 456f5680db29d0354be7dcb6d22a760abd4209c0 (patch) | |
tree | 477706ee9eeab1767f56182c960ff403a402e903 /target/linux/mvebu/base-files/lib | |
parent | f06adb64bfb1650f16bbd9c894ca47c250df5976 (diff) | |
download | upstream-456f5680db29d0354be7dcb6d22a760abd4209c0.tar.gz upstream-456f5680db29d0354be7dcb6d22a760abd4209c0.tar.bz2 upstream-456f5680db29d0354be7dcb6d22a760abd4209c0.zip |
mvebu: sysupgrade: use get_image_dd wrapper
This function eliminates false-positive errors emitted by dd.
Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Diffstat (limited to 'target/linux/mvebu/base-files/lib')
-rw-r--r-- | target/linux/mvebu/base-files/lib/upgrade/sdcard.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh index 3dbd1e2578..7507df8cbc 100644 --- a/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh +++ b/target/linux/mvebu/base-files/lib/upgrade/sdcard.sh @@ -10,7 +10,7 @@ platform_check_image_sdcard() { get_partitions "/dev/$diskdev" bootdisk #extract the boot sector from the image - get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b 2>/dev/null + get_image_dd "$1" of=/tmp/image.bs count=1 bs=512b get_partitions /tmp/image.bs image @@ -41,7 +41,7 @@ platform_do_upgrade_sdcard() { get_partitions "/dev/$diskdev" bootdisk #extract the boot sector from the image - get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b + get_image_dd "$1" of=/tmp/image.bs count=1 bs=512b get_partitions /tmp/image.bs image @@ -52,7 +52,7 @@ platform_do_upgrade_sdcard() { fi if [ -n "$diff" ]; then - get_image "$@" | dd of="/dev/$diskdev" bs=4096 conv=fsync + get_image_dd "$1" of="/dev/$diskdev" bs=4096 conv=fsync # Separate removal and addtion is necessary; otherwise, partition 1 # will be missing if it overlaps with the old partition 2 @@ -60,12 +60,12 @@ platform_do_upgrade_sdcard() { partx -a - "/dev/$diskdev" else #write uboot image - get_image "$@" | dd of="$diskdev" bs=512 skip=1 seek=1 count=2048 conv=fsync + get_image_dd "$1" of="$diskdev" bs=512 skip=1 seek=1 count=2048 conv=fsync #iterate over each partition from the image and write it to the boot disk while read part start size; do if export_partdevice partdev $part; then echo "Writing image to /dev/$partdev..." - get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync + get_image_dd "$1" of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync else echo "Unable to find partition $part device, skipped." fi @@ -73,7 +73,7 @@ platform_do_upgrade_sdcard() { #copy partition uuid echo "Writing new UUID to /dev/$diskdev..." - get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync + get_image_dd "$1" of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync fi case "$board" in |