aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2022-09-29 12:10:32 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2022-11-05 22:45:46 +0100
commit7a77aacb316deefe300c30e4352dea096e45a924 (patch)
treea0e4f26b628ce5b9283b001935e7aedce6e0e6c3 /package/boot
parentb3b3428a0e5d50eaddabd80100eb23ab04899293 (diff)
downloadupstream-7a77aacb316deefe300c30e4352dea096e45a924.tar.gz
upstream-7a77aacb316deefe300c30e4352dea096e45a924.tar.bz2
upstream-7a77aacb316deefe300c30e4352dea096e45a924.zip
uboot-envtools: Fix format of autogenerated sectors
The sector number must be stored in hex. Otherwise, the number (like 16) will be parsed as hex and any write to the partition will end up with an error like: MTD erase error on /dev/mtd5: Invalid argument Fixes: 9adfeccd8415 ("uboot-envtools: Add support for IPQ806x AP148 and DB149") Fixes: 54b275c8ed3a ("ipq40xx: add target") Signed-off-by: Sven Eckelmann <sven@narfation.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@fungible.com> (cherry picked from commit 8d3e932b65b59ab7231cb5440866eb975bd150ea)
Diffstat (limited to 'package/boot')
-rw-r--r--package/boot/uboot-envtools/files/ipq40xx1
-rw-r--r--package/boot/uboot-envtools/files/ipq806x1
2 files changed, 2 insertions, 0 deletions
diff --git a/package/boot/uboot-envtools/files/ipq40xx b/package/boot/uboot-envtools/files/ipq40xx
index 9a71a622f7..59ad963168 100644
--- a/package/boot/uboot-envtools/files/ipq40xx
+++ b/package/boot/uboot-envtools/files/ipq40xx
@@ -26,6 +26,7 @@ ubootenv_mtdinfo () {
fi
sectors=$(( $ubootenv_size / $mtd_erase ))
+ sectors=$(printf "0x%x" $sectors )
echo /dev/$mtd_dev 0x0 $ubootenv_size $mtd_erase $sectors
}
diff --git a/package/boot/uboot-envtools/files/ipq806x b/package/boot/uboot-envtools/files/ipq806x
index a8285d1452..77dfefbcd8 100644
--- a/package/boot/uboot-envtools/files/ipq806x
+++ b/package/boot/uboot-envtools/files/ipq806x
@@ -26,6 +26,7 @@ ubootenv_mtdinfo () {
fi
sectors=$(( $ubootenv_size / $mtd_erase ))
+ sectors=$(printf "0x%x" $sectors )
echo /dev/$mtd_dev 0x0 $ubootenv_size $mtd_erase $sectors
}