diff options
author | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2019-03-18 00:07:31 +0100 |
---|---|---|
committer | Christian Lamparter <chunkeey@gmail.com> | 2019-03-21 00:57:54 +0100 |
commit | 426991418796c28f2a212676c7d46c8ec59530a6 (patch) | |
tree | f05899bf93b47f64807f3aa60fa8c776ab8fe153 /target/linux/ramips | |
parent | 201d3d1a82e62bd139950571fc30f6b49d395378 (diff) | |
download | upstream-426991418796c28f2a212676c7d46c8ec59530a6.tar.gz upstream-426991418796c28f2a212676c7d46c8ec59530a6.tar.bz2 upstream-426991418796c28f2a212676c7d46c8ec59530a6.zip |
ramips: Speed up eeprom read/write
Reading and writing to and from flash storage is slowed down
enormously by some functions which use a block size of 1.
This patch reworks the extraction scripts to be much faster and
efficient by reading and writing in possibly one big block.
This is based on the initial commit a69e101 for ipq40xx by
Christian Lamparter <chunkeey@gmail.com>.
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'target/linux/ramips')
-rw-r--r-- | target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom index 13a4687251..96a2397191 100644 --- a/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom +++ b/target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom @@ -15,7 +15,7 @@ rt2x00_eeprom_extract() { [ -n "$mtd" ] || \ rt2x00_eeprom_die "no mtd device found for partition $part" - dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \ + dd if=$mtd of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ rt2x00_eeprom_die "failed to extract from $mtd" } @@ -39,7 +39,7 @@ rt2x00_eeprom_set_macaddr() { rt2x00_eeprom_die "invalid wlan mac address" macaddr_2bin $macaddr | dd of=/lib/firmware/$FIRMWARE \ - conv=notrunc bs=1 seek=4 count=6 2>/dev/null || \ + conv=notrunc oflag=seek_bytes bs=6 seek=4 count=1 2>/dev/null || \ rt2x00_eeprom_die "failed to write mac address to eeprom file" } |