Skip to content

Instantly share code, notes, and snippets.

@bittorf
Forked from anonymous/gist:4274968
Created December 13, 2012 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bittorf/4274979 to your computer and use it in GitHub Desktop.
Save bittorf/4274979 to your computer and use it in GitHub Desktop.
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