aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2019-03-07 09:40:09 +0100
committerChristian Lamparter <chunkeey@gmail.com>2019-03-13 16:27:41 +0100
commit26f7cf8ac3dbd8f525c3e5593a37a6b1fab3f132 (patch)
tree4fcf583ea402895705c3ab49ec1c8e16febf52d5
parent51fb186cb3d238bcc73ca14a5240ec091e30d413 (diff)
downloadupstream-26f7cf8ac3dbd8f525c3e5593a37a6b1fab3f132.tar.gz
upstream-26f7cf8ac3dbd8f525c3e5593a37a6b1fab3f132.tar.bz2
upstream-26f7cf8ac3dbd8f525c3e5593a37a6b1fab3f132.zip
ar71xx: Speed up mtd extraction in ar71xx.sh
Although the amount of data read here is smaller than for the caldata, there still might be some speed gain compared to reading bytewise. And there is no harm ... Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
-rwxr-xr-xtarget/linux/ar71xx/base-files/lib/ar71xx.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 95fa247f4b..f0f6f0398b 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -16,7 +16,7 @@ ar71xx_get_mtd_offset_size_format() {
dev=$(find_mtd_part $mtd)
[ -z "$dev" ] && return
- dd if=$dev bs=1 skip=$offset count=$size 2>/dev/null | hexdump -v -e "1/1 \"$format\""
+ dd if=$dev iflag=skip_bytes bs=$size skip=$offset count=1 2>/dev/null | hexdump -v -e "1/1 \"$format\""
}
ar71xx_get_mtd_part_magic() {
@@ -390,7 +390,7 @@ tplink_pharos_v2_get_model_string() {
part=$(find_mtd_part 'product-info')
[ -z "$part" ] && return 1
- dd if=$part bs=1 skip=4360 count=64 2>/dev/null | tr -d '\r\0' | head -n 1
+ dd if=$part iflag=skip_bytes bs=64 skip=4360 count=1 2>/dev/null | tr -d '\r\0' | head -n 1
}
ar71xx_board_detect() {