base-files: add mtd_get_part_size helper
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> SVN-Revision: 37475
This commit is contained in:
parent
7ee96847cf
commit
8d55ea10ad
2 changed files with 13 additions and 1 deletions
|
@ -275,6 +275,18 @@ mtd_get_mac_binary() {
|
|||
dd bs=1 skip=$offset count=6 if=$part 2>/dev/null | hexdump -v -n 6 -e '5/1 "%02x:" 1/1 "%02x"'
|
||||
}
|
||||
|
||||
mtd_get_part_size() {
|
||||
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$size))
|
||||
break
|
||||
fi
|
||||
done < /proc/mtd
|
||||
}
|
||||
|
||||
macaddr_add() {
|
||||
local mac=$1
|
||||
local val=$2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue