aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorTomasz Maciej Nowak <tmn505@gmail.com>2020-11-25 17:33:40 +0100
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-11-25 18:42:59 +0100
commit30c95c4d265c449b8c0280305255a548b2ef879c (patch)
tree3c9ba6c086ac6c0e83f89fe3f5e434279633b63c /target
parentfa9e8a008a1e207137f8cddb3fe0f877465e93d9 (diff)
downloadupstream-30c95c4d265c449b8c0280305255a548b2ef879c.tar.gz
upstream-30c95c4d265c449b8c0280305255a548b2ef879c.tar.bz2
upstream-30c95c4d265c449b8c0280305255a548b2ef879c.zip
tegra: sysupgrade: use get_image_dd wrapper
This function eliminates false-positive errors emitted by dd. Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com> [drop argument check changes] Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target')
-rw-r--r--target/linux/tegra/base-files/lib/upgrade/platform.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/target/linux/tegra/base-files/lib/upgrade/platform.sh b/target/linux/tegra/base-files/lib/upgrade/platform.sh
index 05b48cd50a..4dd049519c 100644
--- a/target/linux/tegra/base-files/lib/upgrade/platform.sh
+++ b/target/linux/tegra/base-files/lib/upgrade/platform.sh
@@ -13,7 +13,7 @@ platform_check_image() {
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
@@ -53,7 +53,7 @@ platform_do_upgrade() {
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
@@ -64,7 +64,7 @@ platform_do_upgrade() {
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
@@ -75,12 +75,12 @@ platform_do_upgrade() {
fi
#write uboot image
- get_image "$@" | dd of="$diskdev" bs=512 skip=1 seek=1 count=4097 conv=fsync,notrunc
+ get_image_dd "$1" of="$diskdev" bs=512 skip=1 seek=1 count=4097 conv=fsync,notrunc
#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
@@ -88,5 +88,5 @@ platform_do_upgrade() {
#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
}