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:
19
target/linux/sunxi/base-files/etc/board.d/01_leds
Normal file
19
target/linux/sunxi/base-files/etc/board.d/01_leds
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board=$(board_name)
|
||||
boardname="${board##*,}"
|
||||
|
||||
board_config_update
|
||||
|
||||
case $board in
|
||||
friendlyarm,nanopi-r1|\
|
||||
friendlyarm,nanopi-r1s-h5)
|
||||
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
|
||||
ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth1"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
81
target/linux/sunxi/base-files/etc/board.d/02_network
Normal file
81
target/linux/sunxi/base-files/etc/board.d/02_network
Normal file
@@ -0,0 +1,81 @@
|
||||
#
|
||||
# Copyright (C) 2013-2015 OpenWrt.org
|
||||
#
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
. /lib/functions/system.sh
|
||||
|
||||
sunxi_setup_interfaces()
|
||||
{
|
||||
local board="$1"
|
||||
|
||||
case "$board" in
|
||||
friendlyarm,nanopi-r1|\
|
||||
friendlyarm,nanopi-r1s-h5)
|
||||
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
||||
;;
|
||||
lamobo,lamobo-r1)
|
||||
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan
|
||||
;;
|
||||
olimex,a13-olinuxino-micro)
|
||||
ucidef_set_interface_lan "wlan0"
|
||||
;;
|
||||
xunlong,orangepi-r1)
|
||||
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
||||
;;
|
||||
*)
|
||||
ucidef_set_interface_lan "eth0"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
nanopi_r1_get_mac()
|
||||
{
|
||||
local interface=$1
|
||||
local eeprom_path="/sys/bus/i2c/devices/2-0051/eeprom"
|
||||
local address
|
||||
|
||||
if [ -f "$eeprom_path" ]; then
|
||||
address=$(get_mac_binary "$eeprom_path" 0xfa)
|
||||
if [ "$interface" = "lan" ]; then
|
||||
address=$(macaddr_setbit_la "$address")
|
||||
fi
|
||||
else
|
||||
address=$(macaddr_generate_from_mmc_cid mmcblk1)
|
||||
if [ "$interface" = "lan" ]; then
|
||||
address=$(macaddr_add "$address" 1)
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$address"
|
||||
}
|
||||
|
||||
sunxi_setup_macs()
|
||||
{
|
||||
local board="$1"
|
||||
local lan_mac=""
|
||||
local wan_mac=""
|
||||
local label_mac=""
|
||||
|
||||
case "$board" in
|
||||
friendlyarm,nanopi-r1)
|
||||
wan_mac=$(nanopi_r1_get_mac wan)
|
||||
lan_mac=$(nanopi_r1_get_mac lan)
|
||||
;;
|
||||
friendlyarm,nanopi-r1s-h5)
|
||||
lan_mac=$(get_mac_binary "/sys/bus/i2c/devices/0-0051/eeprom" 0xfa)
|
||||
;;
|
||||
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)
|
||||
sunxi_setup_interfaces $board
|
||||
sunxi_setup_macs $board
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
15
target/linux/sunxi/base-files/etc/board.d/05_compat-version
Normal file
15
target/linux/sunxi/base-files/etc/board.d/05_compat-version
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
case "$(board_name)" in
|
||||
lamobo,lamobo-r1)
|
||||
ucidef_set_compat_version "1.1"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user