diff options
author | John Crispin <blogic@openwrt.org> | 2013-11-25 08:34:55 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2013-11-25 08:34:55 +0000 |
commit | 3b4cd0a50e56e34fb380ed91beebd7a8a4842a91 (patch) | |
tree | ec6a098e2b094644a815a3bf360653e07ad3faab /package/base-files/files/lib/functions.sh | |
parent | 944e1ee1684ca46d7bef0e5c1ac544ac1b70dfaf (diff) | |
download | upstream-3b4cd0a50e56e34fb380ed91beebd7a8a4842a91.tar.gz upstream-3b4cd0a50e56e34fb380ed91beebd7a8a4842a91.tar.bz2 upstream-3b4cd0a50e56e34fb380ed91beebd7a8a4842a91.zip |
base-files: allow users to delect debug level during boot
Signed-off-by: John Crispin <blogic@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38909 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/lib/functions.sh')
-rwxr-xr-x | package/base-files/files/lib/functions.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 85ebc2aeb1..6f23e0b8b2 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -260,6 +260,26 @@ mtd_get_mac_ascii() [ -n "$mac_dirty" ] && macaddr_canonicalize "$mac_dirty" } +mtd_get_blob() +{ + local mtdname="$1" + local offset="$2" + local count="$3" + local firmware="$4" + local part + + part=$(find_mtd_part "$mtdname") + if [ -z "$part" ]; then + echo "mtd_get_blob: partition $mtdname not found!" >&2 + return 1 + fi + + dd if=$part of=$firmware bs=1 skip=$offset count=$count 2>/dev/null || { + echo "mtd_get_blob: failed to extract $firmware from $part" >&2 + return 1 + } +} + mtd_get_mac_binary() { local mtdname="$1" local offset="$2" |