mirror of
https://github.com/openwrt/openwrt.git
synced 2026-11-28 03:40:52 +04:00
base-files: system.sh: add mtd_get_part_erasesize()
Similar to mtd_get_part_size() but for the erase sector size. Signed-off-by: Michael Pratt <mcpratt@pm.me> Link: https://github.com/openwrt/openwrt/pull/24866 Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
1 parent
bd742322ea
commit
932b3dc517
1 file changed
+12
@@ -228,6 +228,18 @@ mtd_get_part_size() {
|
||||
done < /proc/mtd
|
||||
}
|
||||
|
||||
mtd_get_part_erasesize() {
|
||||
local part_name=$1
|
||||
local first dev size erasesize name
|
||||
while read dev size erasesize name; do
|
||||
name=${name#'"'}; name=${name%'"'}
|
||||
if [ "$name" = "$part_name" ]; then
|
||||
echo $((0x$erasesize))
|
||||
break
|
||||
fi
|
||||
done < /proc/mtd
|
||||
}
|
||||
|
||||
mmc_get_mac_ascii() {
|
||||
local part_name="$1"
|
||||
local key="$2"
|
||||
|
||||
Reference in new issue
Block a user