3 [ -e /lib/firmware/$FIRMWARE ] && exit 0
5 . /lib/functions/caldata.sh
7 jboot_eeprom_extract() {
12 mtd=$(find_mtd_part $part)
14 caldata_die "no mtd device found for partition $part"
16 jboot_config_read -i $mtd -o $offset -e /lib/firmware/$FIRMWARE 2>/dev/null || \
17 caldata_die "failed to extract from $mtd"
32 wan_mac=$(jboot_config_read -m -i $(find_mtd_part "config") -o 0xE000)
33 wifi_mac=$(macaddr_add "$wan_mac" 1)
34 jboot_eeprom_extract "config" 0xE000
35 caldata_patch_mac $wifi_mac 0x4
38 wifi_mac=$(mtd_get_mac_ascii u-boot-env INIC_MAC_ADDR)
39 caldata_extract "factory" 0x0 0x200
40 caldata_patch_mac $wifi_mac 0x4
43 caldata_die "Please define mtd-eeprom in $board DTS file!"