20-p54spi-eeprom 876 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. p54spi_eeprom_clean() {
  3. rm -f /tmp/wlan-iq-align /tmp/wlan-tx-gen2
  4. }
  5. p54spi_eeprom_die() {
  6. echo "$*"
  7. p54spi_eeprom_clean
  8. exit 1
  9. }
  10. p54spi_eeprom_extract() {
  11. [ -x /usr/bin/calvaria -a -x /usr/bin/cal2p54 ] && {
  12. /usr/bin/calvaria -p -n wlan-iq-align -i last /dev/mtdblock1 >/tmp/wlan-iq-align ||\
  13. p54spi_eeprom_die "p54spi EEPROM: Failed to extract wlan-iq-align"
  14. /usr/bin/calvaria -p -n wlan-tx-gen2 -i last /dev/mtdblock1 >/tmp/wlan-tx-gen2 ||\
  15. p54spi_eeprom_die "p54spi EEPROM: Failed to extract wlan-tx-gen2"
  16. /usr/bin/cal2p54 /tmp/wlan-tx-gen2 /tmp/wlan-iq-align >/lib/firmware/3826.eeprom ||\
  17. p54spi_eeprom_die "p54spi EEPROM: Failed to generate EEPROM"
  18. p54spi_eeprom_clean
  19. }
  20. }
  21. [ "$FIRMWARE" = "3826.eeprom" ] && {
  22. [ -z "$(grep -e 'Nokia N810' /proc/cpuinfo)" ] || {
  23. [ -e /lib/firmware/3826.eeprom ] ||\
  24. p54spi_eeprom_extract
  25. }
  26. }