openwrtv3/target/linux/omap24xx/base-files/etc/hotplug.d/firmware/20-p54spi-eeprom
Mathias Kresin e4e984f2a0 treewide: use only board_name function to get name
Do not parse /tmp/sysinfo/board_name, /proc/cpuinfo or the device tree
compatible string directly. Always use the board_name function to get
the board name.

The admswconfig package still reads /proc/cpuinfo directly. The code
looks somehow broken and the whole adm5120 which uses this package
looks unmaintained. Leave it as it is for now.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2017-07-15 23:13:34 +02:00

32 lines
886 B
Bash

#!/bin/sh
p54spi_eeprom_clean() {
rm -f /tmp/wlan-iq-align /tmp/wlan-tx-gen2
}
p54spi_eeprom_die() {
echo "$*"
p54spi_eeprom_clean
exit 1
}
p54spi_eeprom_extract() {
[ -x /usr/bin/calvaria -a -x /usr/bin/cal2p54 ] && {
/usr/bin/calvaria -p -n wlan-iq-align -i last /dev/mtdblock1 >/tmp/wlan-iq-align ||\
p54spi_eeprom_die "p54spi EEPROM: Failed to extract wlan-iq-align"
/usr/bin/calvaria -p -n wlan-tx-gen2 -i last /dev/mtdblock1 >/tmp/wlan-tx-gen2 ||\
p54spi_eeprom_die "p54spi EEPROM: Failed to extract wlan-tx-gen2"
/usr/bin/cal2p54 /tmp/wlan-tx-gen2 /tmp/wlan-iq-align >/lib/firmware/3826.eeprom ||\
p54spi_eeprom_die "p54spi EEPROM: Failed to generate EEPROM"
p54spi_eeprom_clean
}
}
. /lib/functions.sh
[ "$FIRMWARE" = "3826.eeprom" ] && {
[ "$(board_name)" != "nokia,n810" ] || {
[ -e /lib/firmware/3826.eeprom ] ||\
p54spi_eeprom_extract
}
}