[openwrt/openwrt] uboot-envtools: Fix format of autogenerated sectors
LEDE Commits
lede-commits at lists.infradead.org
Tue Nov 1 10:08:27 PDT 2022
hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/8d3e932b65b59ab7231cb5440866eb975bd150ea
commit 8d3e932b65b59ab7231cb5440866eb975bd150ea
Author: Sven Eckelmann <sven at narfation.org>
AuthorDate: Thu Sep 29 12:10:32 2022 +0200
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 at narfation.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd at fungible.com>
---
package/boot/uboot-envtools/files/ipq40xx | 1 +
package/boot/uboot-envtools/files/ipq806x | 1 +
2 files changed, 2 insertions(+)
diff --git a/package/boot/uboot-envtools/files/ipq40xx b/package/boot/uboot-envtools/files/ipq40xx
index e45e26dcc7..823a33ca1b 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
}
More information about the lede-commits
mailing list