Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
This commit is contained in:
143
target/linux/ath79/tiny/base-files/etc/board.d/01_leds
Normal file
143
target/linux/ath79/tiny/base-files/etc/board.d/01_leds
Normal file
@@ -0,0 +1,143 @@
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
buffalo,whr-g301n|\
|
||||
dlink,dir-615-e4|\
|
||||
tplink,tl-wr740n-v1|\
|
||||
tplink,tl-wr740n-v3|\
|
||||
tplink,tl-wr741-v1|\
|
||||
tplink,tl-wr743nd-v1|\
|
||||
tplink,tl-wr841-v5|\
|
||||
tplink,tl-wr941-v4)
|
||||
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
|
||||
ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x02"
|
||||
ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x04"
|
||||
ucidef_set_led_switch "lan3" "LAN3" "green:lan3" "switch0" "0x08"
|
||||
ucidef_set_led_switch "lan4" "LAN4" "green:lan4" "switch0" "0x10"
|
||||
;;
|
||||
dlink,dap-1720-a1)
|
||||
ucidef_set_rssimon "wlan0" "200000" "1"
|
||||
ucidef_set_led_rssi "rssilow" "RSSI LOW" "red:signal-1" "wlan0" "1" "40"
|
||||
ucidef_set_led_rssi "rssimediumlow" "RSSI MEDIUM-LOW" "green:signal-1" "wlan0" "21" "100"
|
||||
ucidef_set_led_rssi "rssimediumhigh" "RSSI MEDIUM-HIGH" "green:signal-2" "wlan0" "61" "100"
|
||||
ucidef_set_led_rssi "rssihigh" "RSSI HIGH" "green:signal-3" "wlan0" "81" "100"
|
||||
;;
|
||||
dlink,dir-859-a1)
|
||||
ucidef_set_led_switch "internet" "INTERNET" "green:internet" "switch0" "0x20"
|
||||
;;
|
||||
dlink,dir-859-a3)
|
||||
ucidef_set_led_switch "wan" "WAN" "green:wan" "switch0" "0x20"
|
||||
;;
|
||||
engenius,enh202-v1)
|
||||
ucidef_set_led_switch "lan" "LAN" "amber:lan" "switch0" "0x10"
|
||||
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
|
||||
ucidef_set_rssimon "wlan0" "200000" "1"
|
||||
ucidef_set_led_rssi "rssilow" "RSSILOW" "red:rssilow" "wlan0" "1" "100"
|
||||
ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "amber:rssimedium" "wlan0" "33" "100"
|
||||
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "green:rssihigh" "wlan0" "67" "100"
|
||||
;;
|
||||
netgear,wnr1000-v2|\
|
||||
netgear,wnr2000-v3)
|
||||
ucidef_set_led_netdev "wan-amber" "WAN (amber)" "amber:wan" "eth0"
|
||||
ucidef_set_led_switch "lan1green" "LAN1 (green)" "green:lan1" "switch0" "0x02" "0x04"
|
||||
ucidef_set_led_switch "lan2green" "LAN2 (green)" "green:lan2" "switch0" "0x04" "0x04"
|
||||
ucidef_set_led_switch "lan3green" "LAN3 (green)" "green:lan3" "switch0" "0x08" "0x04"
|
||||
ucidef_set_led_switch "lan4green" "LAN4 (green)" "green:lan4" "switch0" "0x10" "0x04"
|
||||
ucidef_set_led_switch "lan1amber" "LAN1 (amber)" "amber:lan1" "switch0" "0x02" "0x02"
|
||||
ucidef_set_led_switch "lan2amber" "LAN2 (amber)" "amber:lan2" "switch0" "0x04" "0x02"
|
||||
ucidef_set_led_switch "lan3amber" "LAN3 (amber)" "amber:lan3" "switch0" "0x08" "0x02"
|
||||
ucidef_set_led_switch "lan4amber" "LAN4 (amber)" "amber:lan4" "switch0" "0x10" "0x02"
|
||||
;;
|
||||
netgear,wnr612-v2|\
|
||||
on,n150r)
|
||||
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
|
||||
ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x02" "0x0f"
|
||||
ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x04" "0x0f"
|
||||
;;
|
||||
tplink,tl-mr3020-v1|\
|
||||
tplink,tl-mr3040-v2|\
|
||||
tplink,tl-wa701nd-v1|\
|
||||
tplink,tl-wa730re-v1|\
|
||||
tplink,tl-wa801nd-v1|\
|
||||
tplink,tl-wa801nd-v3|\
|
||||
tplink,tl-wa801nd-v4|\
|
||||
tplink,tl-wa830re-v1|\
|
||||
tplink,tl-wa860re-v1|\
|
||||
tplink,tl-wa901nd-v1|\
|
||||
tplink,tl-wa901nd-v3|\
|
||||
tplink,tl-wa901nd-v4|\
|
||||
tplink,tl-wa901nd-v5)
|
||||
ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0"
|
||||
;;
|
||||
tplink,tl-mr3420-v2|\
|
||||
tplink,tl-wr740n-v4|\
|
||||
tplink,tl-wr740n-v5|\
|
||||
tplink,tl-wr741nd-v4|\
|
||||
tplink,tl-wr841-v8|\
|
||||
tplink,tl-wr941nd-v5)
|
||||
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
|
||||
ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x04"
|
||||
ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x08"
|
||||
ucidef_set_led_switch "lan3" "LAN3" "green:lan3" "switch0" "0x10"
|
||||
ucidef_set_led_switch "lan4" "LAN4" "green:lan4" "switch0" "0x02"
|
||||
;;
|
||||
tplink,tl-mr3420-v3|\
|
||||
tplink,tl-wr841-v9|\
|
||||
tplink,tl-wr841-v10|\
|
||||
tplink,tl-wr841-v11|\
|
||||
tplink,tl-wr841-v12)
|
||||
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
|
||||
ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x10"
|
||||
ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x08"
|
||||
ucidef_set_led_switch "lan3" "LAN3" "green:lan3" "switch0" "0x04"
|
||||
ucidef_set_led_switch "lan4" "LAN4" "green:lan4" "switch0" "0x02"
|
||||
;;
|
||||
tplink,tl-wa850re-v1|\
|
||||
tplink,tl-wa850re-v2)
|
||||
ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0"
|
||||
ucidef_set_rssimon "wlan0" "200000" "1"
|
||||
ucidef_set_led_rssi "rssilow" "RSSILOW" "blue:signal1" "wlan0" "1" "100"
|
||||
ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "blue:signal2" "wlan0" "20" "100"
|
||||
ucidef_set_led_rssi "rssimedium" "RSSIMEDIUM" "blue:signal3" "wlan0" "40" "100"
|
||||
ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "blue:signal4" "wlan0" "60" "100"
|
||||
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "blue:signal5" "wlan0" "80" "100"
|
||||
;;
|
||||
tplink,tl-wpa8630p-v2-int|\
|
||||
tplink,tl-wpa8630p-v2.0-eu|\
|
||||
tplink,tl-wpa8630p-v2.1-eu)
|
||||
ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x3c"
|
||||
;;
|
||||
tplink,tl-wr940n-v3|\
|
||||
tplink,tl-wr940n-v4|\
|
||||
tplink,tl-wr941nd-v6)
|
||||
ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1"
|
||||
ucidef_set_led_switch "lan1" "LAN1" "blue:lan1" "switch0" "0x10"
|
||||
ucidef_set_led_switch "lan2" "LAN2" "blue:lan2" "switch0" "0x08"
|
||||
ucidef_set_led_switch "lan3" "LAN3" "blue:lan3" "switch0" "0x04"
|
||||
ucidef_set_led_switch "lan4" "LAN4" "blue:lan4" "switch0" "0x02"
|
||||
;;
|
||||
tplink,tl-wr940n-v6)
|
||||
ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1"
|
||||
;;
|
||||
ubnt,bullet-m-ar7240|\
|
||||
ubnt,bullet-m-ar7241|\
|
||||
ubnt,nanobridge-m|\
|
||||
ubnt,nanostation-loco-m|\
|
||||
ubnt,nanostation-m|\
|
||||
ubnt,picostation-m)
|
||||
ucidef_set_rssimon "wlan0" "200000" "1"
|
||||
ucidef_set_led_rssi "rssilow" "RSSILOW" "red:link1" "wlan0" "1" "100"
|
||||
ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "orange:link2" "wlan0" "26" "100"
|
||||
ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "green:link3" "wlan0" "51" "100"
|
||||
ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "green:link4" "wlan0" "76" "100"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
173
target/linux/ath79/tiny/base-files/etc/board.d/02_network
Normal file
173
target/linux/ath79/tiny/base-files/etc/board.d/02_network
Normal file
@@ -0,0 +1,173 @@
|
||||
|
||||
. /lib/functions/system.sh
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
ath79_setup_interfaces()
|
||||
{
|
||||
local board="$1"
|
||||
|
||||
case "$board" in
|
||||
buffalo,whr-g301n)
|
||||
ucidef_set_interface_wan "eth0"
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
|
||||
;;
|
||||
dlink,dap-1720-a1|\
|
||||
engenius,eap350-v1|\
|
||||
engenius,ecb350-v1|\
|
||||
pqi,air-pen|\
|
||||
tplink,tl-mr10u|\
|
||||
tplink,tl-mr3020-v1|\
|
||||
tplink,tl-mr3040-v2|\
|
||||
tplink,tl-wa701nd-v1|\
|
||||
tplink,tl-wa730re-v1|\
|
||||
tplink,tl-wa801nd-v1|\
|
||||
tplink,tl-wa801nd-v3|\
|
||||
tplink,tl-wa801nd-v4|\
|
||||
tplink,tl-wa830re-v1|\
|
||||
tplink,tl-wa850re-v1|\
|
||||
tplink,tl-wa850re-v2|\
|
||||
tplink,tl-wa860re-v1|\
|
||||
tplink,tl-wa901nd-v1|\
|
||||
tplink,tl-wa901nd-v2|\
|
||||
tplink,tl-wa901nd-v3|\
|
||||
tplink,tl-wa901nd-v4|\
|
||||
tplink,tl-wa901nd-v5|\
|
||||
tplink,tl-wr703n|\
|
||||
tplink,tl-wr802n-v1|\
|
||||
tplink,tl-wr802n-v2|\
|
||||
ubnt,bullet-m-ar7240|\
|
||||
ubnt,bullet-m-ar7241|\
|
||||
ubnt,nanobridge-m|\
|
||||
ubnt,picostation-m|\
|
||||
ubnt,nanostation-loco-m)
|
||||
ucidef_set_interface_lan "eth0"
|
||||
;;
|
||||
dlink,dir-615-e4|\
|
||||
netgear,wnr1000-v2|\
|
||||
netgear,wnr2000-v3|\
|
||||
netgear,wnr612-v2|\
|
||||
on,n150r|\
|
||||
tplink,tl-wr740n-v1|\
|
||||
tplink,tl-wr740n-v3|\
|
||||
tplink,tl-wr741-v1|\
|
||||
tplink,tl-wr743nd-v1|\
|
||||
tplink,tl-wr841-v5|\
|
||||
tplink,tl-wr941-v4)
|
||||
ucidef_set_interface_wan "eth0"
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
|
||||
;;
|
||||
dlink,dir-859-a1|\
|
||||
dlink,dir-859-a3|\
|
||||
dlink,dir-869-a1)
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
|
||||
;;
|
||||
engenius,enh202-v1)
|
||||
ucidef_set_interface_lan "eth0"
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth1" "4:lan:1"
|
||||
;;
|
||||
tplink,tl-mr3220-v1|\
|
||||
tplink,tl-mr3420-v1|\
|
||||
tplink,tl-mr3420-v3|\
|
||||
tplink,tl-wr841-v7|\
|
||||
tplink,tl-wr841-v9|\
|
||||
tplink,tl-wr841-v10|\
|
||||
tplink,tl-wr841-v11|\
|
||||
tplink,tl-wr841-v12|\
|
||||
tplink,tl-wr940n-v3|\
|
||||
tplink,tl-wr940n-v4|\
|
||||
tplink,tl-wr940n-v6|\
|
||||
tplink,tl-wr941nd-v6)
|
||||
ucidef_set_interface_wan "eth1"
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
|
||||
;;
|
||||
tplink,tl-mr3420-v2|\
|
||||
tplink,tl-wr740n-v4|\
|
||||
tplink,tl-wr740n-v5|\
|
||||
tplink,tl-wr741nd-v4|\
|
||||
tplink,tl-wr841-v8|\
|
||||
tplink,tl-wr941nd-v5)
|
||||
ucidef_set_interface_wan "eth1"
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
|
||||
;;
|
||||
tplink,tl-wpa8630p-v2-int|\
|
||||
tplink,tl-wpa8630p-v2.0-eu|\
|
||||
tplink,tl-wpa8630p-v2.1-eu)
|
||||
# port 5 (internal) is the power-line port
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "5:lan:4"
|
||||
;;
|
||||
tplink,tl-wr941-v2)
|
||||
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
|
||||
;;
|
||||
tplink,tl-wr941n-v7-cn)
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
|
||||
;;
|
||||
ubnt,airrouter)
|
||||
ucidef_set_interface_wan "eth1"
|
||||
ucidef_add_switch "switch0" \
|
||||
"0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
|
||||
;;
|
||||
ubnt,nanostation-m)
|
||||
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
||||
;;
|
||||
*)
|
||||
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
ath79_setup_macs()
|
||||
{
|
||||
local board="$1"
|
||||
|
||||
case "$board" in
|
||||
dlink,dir-615-e4)
|
||||
lan_mac=$(mtd_get_mac_ascii "nvram" "lan_mac")
|
||||
wan_mac=$(mtd_get_mac_ascii "nvram" "wan_mac")
|
||||
label_mac=$wan_mac
|
||||
;;
|
||||
dlink,dir-859-a1|\
|
||||
dlink,dir-869-a1)
|
||||
lan_mac=$(mtd_get_mac_text "devdata" 0xc9)
|
||||
wan_mac=$(mtd_get_mac_text "devdata" 0x79)
|
||||
;;
|
||||
dlink,dir-859-a3)
|
||||
lan_mac=$(get_mac_label)
|
||||
wan_mac=$(macaddr_add "$lan_mac" 3)
|
||||
;;
|
||||
engenius,enh202-v1|\
|
||||
ubnt,airrouter|\
|
||||
ubnt,bullet-m-ar7240|\
|
||||
ubnt,bullet-m-ar7241|\
|
||||
ubnt,nanobridge-m|\
|
||||
ubnt,nanostation-loco-m|\
|
||||
ubnt,nanostation-m|\
|
||||
ubnt,picostation-m)
|
||||
label_mac=$(cat /sys/class/ieee80211/phy0/macaddress)
|
||||
;;
|
||||
tplink,tl-wr941-v2|\
|
||||
tplink,tl-wr941n-v7-cn)
|
||||
base_mac=$(mtd_get_mac_binary u-boot 0x1fc00)
|
||||
wan_mac=$(macaddr_add "$base_mac" 1)
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
|
||||
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
|
||||
[ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
|
||||
}
|
||||
|
||||
board_config_update
|
||||
board=$(board_name)
|
||||
ath79_setup_interfaces $board
|
||||
ath79_setup_macs $board
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,20 @@
|
||||
#
|
||||
# Copyright (C) 2020 OpenWrt.org
|
||||
#
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
case "$(board_name)" in
|
||||
tplink,tl-wpa8630p-v2-int|\
|
||||
tplink,tl-wpa8630p-v2.0-eu|\
|
||||
tplink,tl-wpa8630p-v2.1-eu)
|
||||
ucidef_set_compat_version "2.0"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -e /lib/firmware/$FIRMWARE ] && exit 0
|
||||
|
||||
. /lib/functions/caldata.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$FIRMWARE" in
|
||||
"ath9k-eeprom-pci-0000:00:00.0.bin")
|
||||
case $board in
|
||||
buffalo,whr-g301n|\
|
||||
engenius,eap350-v1|\
|
||||
engenius,ecb350-v1|\
|
||||
engenius,enh202-v1|\
|
||||
tplink,tl-wa701nd-v1|\
|
||||
tplink,tl-wa730re-v1|\
|
||||
tplink,tl-wa801nd-v1|\
|
||||
tplink,tl-wa830re-v1|\
|
||||
tplink,tl-wa901nd-v1|\
|
||||
tplink,tl-wr841-v5|\
|
||||
tplink,tl-wr941-v4)
|
||||
caldata_extract "art" 0x1000 0xeb8
|
||||
;;
|
||||
dlink,dir-615-e4)
|
||||
caldata_extract "art" 0x1000 0x1000
|
||||
ath9k_patch_mac_crc $(mtd_get_mac_ascii "nvram" "lan_mac") 0x10c
|
||||
;;
|
||||
netgear,wnr1000-v2|\
|
||||
netgear,wnr2000-v3|\
|
||||
netgear,wnr612-v2|\
|
||||
on,n150r|\
|
||||
tplink,tl-mr3220-v1|\
|
||||
tplink,tl-mr3420-v1|\
|
||||
tplink,tl-wr740n-v1|\
|
||||
tplink,tl-wr740n-v3|\
|
||||
tplink,tl-wr741-v1|\
|
||||
tplink,tl-wr743nd-v1|\
|
||||
tplink,tl-wr841-v7|\
|
||||
ubnt,airrouter|\
|
||||
ubnt,bullet-m-ar7240|\
|
||||
ubnt,bullet-m-ar7241|\
|
||||
ubnt,nanobridge-m|\
|
||||
ubnt,nanostation-loco-m|\
|
||||
ubnt,nanostation-m|\
|
||||
ubnt,picostation-m)
|
||||
caldata_extract "art" 0x1000 0x1000
|
||||
;;
|
||||
pqi,air-pen)
|
||||
caldata_extract "art" 0x1000 0x7d2
|
||||
;;
|
||||
*)
|
||||
caldata_die "board $board is not supported yet"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,16 @@
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/migrations.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
tplink,tl-wr802n-v1)
|
||||
migrate_leds "blue:=green:"
|
||||
;;
|
||||
esac
|
||||
|
||||
remove_devicename_leds
|
||||
|
||||
migrations_apply system
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,17 @@
|
||||
. /lib/functions.sh
|
||||
|
||||
fix_seama_header() {
|
||||
local kernel_size=$(sed -n 's/mtd[0-9]*: \([0-9a-f]*\).*"kernel".*/\1/p' /proc/mtd)
|
||||
[ "$kernel_size" ] && mtd -c 0x$kernel_size fixseama firmware
|
||||
}
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
dlink,dap-1720-a1|\
|
||||
dlink,dir-859-a1|\
|
||||
dlink,dir-859-a3|\
|
||||
dlink,dir-869-a1)
|
||||
fix_seama_header
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,64 @@
|
||||
# U-Boot with the datachk patchset requires image sizes, offsets,
|
||||
# and checksums to be provided in the U-Boot environment.
|
||||
# This script is based on the dualboot version for devices that come with 2 OS partitions.
|
||||
# For Senao boards with a "failsafe" partition image, the process is almost the same.
|
||||
# Instead of booting a secondary instalation on checksum failure,
|
||||
# the failsafe image is booted instead.
|
||||
# These boards also use the OKLI lzma kernel loader and mtd-concat
|
||||
# So the kernel check is for the loader, the rootfs check is for kernel + rootfs
|
||||
|
||||
platform_do_upgrade_failsafe_datachk() {
|
||||
local flash_base=0x9f000000
|
||||
|
||||
local kernel_mtd=$(find_mtd_index ${KERNEL_PART:-kernel})
|
||||
local rootfs_mtd=$(find_mtd_index ${ROOTFS_PART:-rootfs})
|
||||
|
||||
local kernel_offset=$(cat /sys/class/mtd/mtd${kernel_mtd}/offset)
|
||||
local rootfs_offset=$(cat /sys/class/mtd/mtd${rootfs_mtd}/offset)
|
||||
|
||||
if [ -n "$IMAGE_LIST" ]; then
|
||||
KERNEL_FILE=$($IMAGE_LIST | grep $KERNEL_FILE)
|
||||
ROOTFS_FILE=$($IMAGE_LIST | grep $ROOTFS_FILE)
|
||||
fi
|
||||
|
||||
local kernel_size=$($IMAGE_CMD $KERNEL_FILE | wc -c)
|
||||
local rootfs_size=$($IMAGE_CMD $ROOTFS_FILE | wc -c)
|
||||
|
||||
# rootfs without JFFS2
|
||||
local rootfs_blocks=$((rootfs_size / 4096))
|
||||
rootfs_size=$((rootfs_blocks * 4096))
|
||||
|
||||
local kernel_md5=$($IMAGE_CMD $KERNEL_FILE | md5sum | cut -d ' ' -f1)
|
||||
local rootfs_md5=$($IMAGE_CMD $ROOTFS_FILE | dd bs=4k count=$rootfs_blocks iflag=fullblock | md5sum | cut -d ' ' -f1)
|
||||
|
||||
# prepare new u-boot-env vars
|
||||
printf "vmlinux_start_addr 0x%08x\n" $((flash_base + kernel_offset)) >> $ENV_SCRIPT
|
||||
printf "vmlinux_size 0x%08x\n" ${kernel_size} >> $ENV_SCRIPT
|
||||
printf "vmlinux_checksum %s\n" ${kernel_md5} >> $ENV_SCRIPT
|
||||
|
||||
printf "rootfs_start_addr 0x%08x\n" $((flash_base + rootfs_offset)) >> $ENV_SCRIPT
|
||||
printf "rootfs_size 0x%08x\n" ${rootfs_size} >> $ENV_SCRIPT
|
||||
printf "rootfs_checksum %s\n" ${rootfs_md5} >> $ENV_SCRIPT
|
||||
|
||||
# store u-boot-env
|
||||
mkdir -p /var/lock
|
||||
[ -n "$SKIP_HASH" ] || fw_setenv -s $ENV_SCRIPT || {
|
||||
echo 'failed to update U-Boot environment'
|
||||
exit 1
|
||||
}
|
||||
|
||||
# sysupgrade
|
||||
sleep 2 && sync && echo 3 > /proc/sys/vm/drop_caches
|
||||
|
||||
$IMAGE_CMD $KERNEL_FILE | mtd $MTD_ARGS write - ${KERNEL_PART:-kernel}
|
||||
|
||||
sleep 2 && sync && echo 3 > /proc/sys/vm/drop_caches
|
||||
|
||||
if [ -n "$UPGRADE_BACKUP" ]; then
|
||||
$IMAGE_CMD $ROOTFS_FILE | mtd $MTD_ARGS $MTD_CONFIG_ARGS -j $UPGRADE_BACKUP write - ${ROOTFS_PART:-rootfs}
|
||||
else
|
||||
$IMAGE_CMD $ROOTFS_FILE | mtd $MTD_ARGS write - ${ROOTFS_PART:-rootfs}
|
||||
fi
|
||||
|
||||
sync
|
||||
}
|
||||
35
target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh
Normal file
35
target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#
|
||||
# Copyright (C) 2011 OpenWrt.org
|
||||
#
|
||||
|
||||
PART_NAME=firmware
|
||||
REQUIRE_IMAGE_METADATA=1
|
||||
|
||||
RAMFS_COPY_BIN='fw_setenv'
|
||||
RAMFS_COPY_DATA='/etc/fw_env.config'
|
||||
|
||||
platform_check_image() {
|
||||
return 0
|
||||
}
|
||||
|
||||
platform_do_upgrade() {
|
||||
local board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
engenius,eap350-v1|\
|
||||
engenius,ecb350-v1|\
|
||||
engenius,enh202-v1)
|
||||
ENV_SCRIPT="/tmp/fw_env"
|
||||
IMAGE_LIST="tar tzf $1"
|
||||
IMAGE_CMD="tar xzOf $1"
|
||||
KERNEL_PART="loader"
|
||||
ROOTFS_PART="fwconcat0"
|
||||
KERNEL_FILE="uImage-lzma.bin"
|
||||
ROOTFS_FILE="root.squashfs"
|
||||
platform_do_upgrade_failsafe_datachk "$1"
|
||||
;;
|
||||
*)
|
||||
default_do_upgrade "$1"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
13
target/linux/ath79/tiny/config-default
Normal file
13
target/linux/ath79/tiny/config-default
Normal file
@@ -0,0 +1,13 @@
|
||||
CONFIG_GRO_CELLS=y
|
||||
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
|
||||
CONFIG_NET_DEVLINK=y
|
||||
CONFIG_NET_DSA=y
|
||||
CONFIG_NET_DSA_MV88E6060=y
|
||||
CONFIG_NET_DSA_TAG_TRAILER=y
|
||||
CONFIG_NET_SWITCHDEV=y
|
||||
CONFIG_NVMEM_SYSFS=y
|
||||
CONFIG_NVMEM_U_BOOT_ENV=y
|
||||
CONFIG_PHYLINK=y
|
||||
CONFIG_PHY_AR7100_USB=y
|
||||
CONFIG_PHY_AR7200_USB=y
|
||||
CONFIG_REGULATOR_FIXED_VOLTAGE=y
|
||||
8
target/linux/ath79/tiny/target.mk
Normal file
8
target/linux/ath79/tiny/target.mk
Normal file
@@ -0,0 +1,8 @@
|
||||
BOARDNAME:=Devices with small flash
|
||||
FEATURES += low_mem small_flash
|
||||
|
||||
DEFAULT_PACKAGES += wpad-basic-mbedtls
|
||||
|
||||
define Target/Description
|
||||
Build firmware images for Atheros AR71xx/AR913x/AR934x based boards with small flash
|
||||
endef
|
||||
Reference in New Issue
Block a user