Created
December 13, 2012 08:18
-
-
Save anonymous/4274968 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find_mtd_index() | |
{ | |
local partition_name="$1" # e.g. u-boot | |
local line mtd_dev number | |
line="$( grep "\"$partition_name\""$ /proc/mtd )" | |
mtd_dev="${line%%:*} | |
number="${mtd_dev##mtd}" | |
echo "$number" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment