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:
13
target/linux/realtek/base-files/etc/board.d/01_leds
Normal file
13
target/linux/realtek/base-files/etc/board.d/01_leds
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
board_config_update
|
||||
|
||||
case $board in
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
119
target/linux/realtek/base-files/etc/board.d/02_network
Normal file
119
target/linux/realtek/base-files/etc/board.d/02_network
Normal file
@@ -0,0 +1,119 @@
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/uci-defaults.sh
|
||||
. /lib/functions/system.sh
|
||||
|
||||
_filter_port_list_ordered() {
|
||||
local ports="$1"
|
||||
local excluded="$2"
|
||||
local sort_opts="$3"
|
||||
echo $ports $excluded | xargs -n1 basename | sort -V $sort_opts | uniq -u | xargs
|
||||
}
|
||||
|
||||
filter_port_list() {
|
||||
_filter_port_list_ordered "$1" "$2"
|
||||
}
|
||||
|
||||
filter_port_list_reverse() {
|
||||
_filter_port_list_ordered "$1" "$2" "-r"
|
||||
}
|
||||
|
||||
board=$(board_name)
|
||||
board_config_update
|
||||
|
||||
lan_list=$(ls -1 -v -d /sys/class/net/lan* | xargs -n1 basename | xargs)
|
||||
|
||||
ucidef_set_bridge_device switch
|
||||
ucidef_set_interface_lan "$lan_list"
|
||||
|
||||
lan_mac=""
|
||||
lan_mac_start=""
|
||||
lan_mac_end=""
|
||||
label_mac=""
|
||||
case $board in
|
||||
hpe,1920-8g|\
|
||||
hpe,1920-8g-poe-65w|\
|
||||
hpe,1920-8g-poe-180w|\
|
||||
hpe,1920-16g|\
|
||||
hpe,1920-24g)
|
||||
label_mac=$(mtd_get_mac_binary factory 0x68)
|
||||
lan_mac=$label_mac
|
||||
mac_count1=$(hexdump -v -n 4 -s 0x110 -e '4 "%d"' $(find_mtd_part factory) 2>/dev/null)
|
||||
mac_count2=$(hexdump -v -n 4 -s 0x114 -e '4 "%d"' $(find_mtd_part factory) 2>/dev/null)
|
||||
lan_mac_start=$(macaddr_add $lan_mac 2)
|
||||
lan_mac_end=$(macaddr_add $lan_mac $((mac_count2-mac_count1)))
|
||||
;;
|
||||
tplink,sg2008p-v1|\
|
||||
tplink,sg2210p-v3|\
|
||||
tplink,sg2452p-v4|\
|
||||
tplink,t1600g-28ts-v3)
|
||||
label_mac=$(get_mac_label)
|
||||
lan_mac="$label_mac"
|
||||
;;
|
||||
*)
|
||||
lan_mac=$(mtd_get_mac_ascii u-boot-env2 mac_start)
|
||||
lan_mac_end=$(mtd_get_mac_ascii u-boot-env2 mac_end)
|
||||
label_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
||||
[ -z "$lan_mac" ] && lan_mac=$label_mac
|
||||
;;
|
||||
esac
|
||||
|
||||
ucidef_set_interface_macaddr "lan" $lan_mac
|
||||
ucidef_set_bridge_mac "$lan_mac"
|
||||
ucidef_set_network_device_mac eth0 $lan_mac
|
||||
[ -z "$lan_mac_start" ] && lan_mac_start=$lan_mac
|
||||
for lan in $lan_list; do
|
||||
ucidef_set_network_device_mac $lan $lan_mac_start
|
||||
[ -z "$lan_mac_end" ] || [ "$lan_mac_start" == "$lan_mac_end" ] && lan_mac_start=$(macaddr_setbit_la $lan_mac_start)
|
||||
lan_mac_start=$(macaddr_add $lan_mac_start 1)
|
||||
done
|
||||
[ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
|
||||
|
||||
case $board in
|
||||
d-link,dgs-1210-10mp-f)
|
||||
ucidef_set_poe 130 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
d-link,dgs-1210-10p)
|
||||
ucidef_set_poe 65 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
d-link,dgs-1210-28mp-f)
|
||||
ucidef_set_poe 370 "lan8 lan7 lan6 lan5 lan4 lan3 lan2 lan1 lan16 lan15 lan14 lan13 lan12 lan11 lan10 lan9 lan24 lan23
|
||||
lan22 lan21 lan20 lan19 lan18 lan17"
|
||||
;;
|
||||
engenius,ews2910p)
|
||||
ucidef_set_poe 60 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
hpe,1920-8g-poe-65w)
|
||||
ucidef_set_poe 65 "$(filter_port_list_reverse "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
hpe,1920-8g-poe-180w)
|
||||
ucidef_set_poe 180 "$(filter_port_list_reverse "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
netgear,gs110tpp-v1)
|
||||
ucidef_set_poe 130 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
netgear,gs110tup-v1)
|
||||
ucidef_set_poe 240 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
netgear,gs310tp-v1)
|
||||
ucidef_set_poe 55 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
zyxel,gs1900-10hp)
|
||||
ucidef_set_poe 77 "$(filter_port_list "$lan_list" "lan9 lan10")"
|
||||
;;
|
||||
zyxel,gs1900-8hp-v1|\
|
||||
zyxel,gs1900-8hp-v2)
|
||||
ucidef_set_poe 70 "$lan_list"
|
||||
;;
|
||||
zyxel,gs1900-24ep)
|
||||
ucidef_set_poe 130 "lan1 lan2 lan3 lan4 lan5 lan6 lan7 lan8 lan9 lan10 lan11 lan12"
|
||||
;;
|
||||
zyxel,gs1900-24hp-v1|\
|
||||
zyxel,gs1900-24hp-v2)
|
||||
ucidef_set_poe 170 "$(filter_port_list "$lan_list" "lan25 lan26")"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
16
target/linux/realtek/base-files/etc/board.d/03_gpio_switches
Normal file
16
target/linux/realtek/base-files/etc/board.d/03_gpio_switches
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
hpe,1920-8g-poe-180w)
|
||||
ucidef_add_gpio_switch "fan_ctrl" "Fan control" "456" "0"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
3
target/linux/realtek/base-files/etc/inittab
Normal file
3
target/linux/realtek/base-files/etc/inittab
Normal file
@@ -0,0 +1,3 @@
|
||||
::sysinit:/etc/init.d/rcS S boot
|
||||
::shutdown:/etc/init.d/rcS K shutdown
|
||||
::askconsole:/usr/libexec/login.sh
|
||||
39
target/linux/realtek/base-files/lib/upgrade/platform.sh
Normal file
39
target/linux/realtek/base-files/lib/upgrade/platform.sh
Normal file
@@ -0,0 +1,39 @@
|
||||
PART_NAME=firmware
|
||||
REQUIRE_IMAGE_METADATA=1
|
||||
|
||||
RAMFS_COPY_BIN='fw_printenv fw_setenv'
|
||||
RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
|
||||
|
||||
# The TP-Link bootloader gets its flash layout from "bootargs".
|
||||
# Use this to our advantage, and:
|
||||
# 1. Disable the second rootfs (usrimg2)
|
||||
# 2. Extend the first rootfs (usrimg1) to include more space
|
||||
# 3. Increase the baudrate to the expected 115200
|
||||
tplink_sg2xxx_fix_mtdparts() {
|
||||
local args
|
||||
args="bootargs mtdparts=spi_flash:896K(boot),128K(env),6144K(sys)"
|
||||
args="$args,20480K(usrimg1@main),0K(usrimg2)"
|
||||
args="$args,4096K(usrappfs),1024K(para)\n"
|
||||
args="$args baudrate 115200"
|
||||
|
||||
echo -e "$args" | fw_setenv --script -
|
||||
}
|
||||
|
||||
platform_check_image() {
|
||||
return 0
|
||||
}
|
||||
|
||||
platform_do_upgrade() {
|
||||
local board=$(board_name)
|
||||
|
||||
case "$board" in
|
||||
tplink,sg2008p-v1|\
|
||||
tplink,sg2210p-v3)
|
||||
tplink_sg2xxx_fix_mtdparts
|
||||
default_do_upgrade "$1"
|
||||
;;
|
||||
*)
|
||||
default_do_upgrade "$1"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
Reference in New Issue
Block a user