Skip to content

Instantly share code, notes, and snippets.

Created Dec 13, 2012
Embed
What would you like to do?
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