From: Christian Lamparter Date: Tue, 19 Feb 2019 17:52:35 +0000 (+0100) Subject: apm821xx: speed up ath9k-caldata extraction X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ffd8ca18cc292c8dd7b7d7df2d4c605f281bede1;p=openwrt%2Fstaging%2F981213.git apm821xx: speed up ath9k-caldata extraction Reading and writing to and from flash storage is slow and currently, the ath10kcal_extract() scripts are even more at an disadvantage because they use a block size of 1 to be able skip. This patch reworks the extraction scripts to be much faster and efficient by reading and writing the calibration data in possibly one big block. Signed-off-by: Christian Lamparter --- diff --git a/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 7a13a0afa8..6d2d18658d 100644 --- a/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -20,7 +20,7 @@ ath9k_eeprom_extract() { [ -n "$mtd" ] || \ ath9k_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 || \ ath9k_eeprom_die "failed to extract from $mtd" } @@ -35,7 +35,7 @@ ath9k_ubi_eeprom_extract() { [ -n "$ubi" ] || \ ath9k_eeprom_die "no UBI volume found for $part" - dd if=/dev/$ubi of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count 2>/dev/null || \ + dd if=/dev/$ubi of=/lib/firmware/$FIRMWARE iflag=skip_bytes bs=$count skip=$offset count=1 2>/dev/null || \ ath9k_eeprom_die "failed to extract from $ubi" }