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>
[ -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"
}
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"
}