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:
38
target/linux/x86/base-files/etc/board.d/01_leds
Normal file
38
target/linux/x86/base-files/etc/board.d/01_leds
Normal file
@@ -0,0 +1,38 @@
|
||||
#
|
||||
# Copyright © 2017 OpenWrt.org
|
||||
#
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
case "$(board_name)" in
|
||||
cisco-mx100-hw)
|
||||
ucidef_set_led_usbport "usb" "USB" "mx100:green:usb" "1-1-port2"
|
||||
ucidef_set_led_default "diag" "DIAG" "mx100:green:tricolor" "1"
|
||||
;;
|
||||
pc-engines-apu1|pc-engines-apu2|pc-engines-apu3|pc-engines-apu4|pc-engines-apu5|pc-engines-apu6)
|
||||
ucidef_set_led_netdev "wan" "WAN" "apu:green:3" "eth0"
|
||||
ucidef_set_led_netdev "lan" "LAN" "apu:green:2" "br-lan"
|
||||
ucidef_set_led_default "diag" "DIAG" "apu:green:1" "1"
|
||||
;;
|
||||
sophos-sg-105wr1|sophos-sg-125wr1|sophos-sg-135wr1|sophos-xg-105wr1|sophos-xg-125wr1|sophos-xg-135wr1)
|
||||
ucidef_set_led_netdev "wlan" "WiFi" "ath9k-phy0" "phy0tpt"
|
||||
;;
|
||||
sophos-sg-105wr2|sophos-sg-125wr2|sophos-sg-135wr2|sophos-xg-105wr2|sophos-xg-125wr2|sophos-xg-135wr2|\
|
||||
sophos-sg-105wr3|sophos-sg-125wr3|sophos-sg-135wr3|sophos-xg-105wr3|sophos-xg-125wr3|sophos-xg-135wr3)
|
||||
ucidef_set_led_netdev "wlan" "WiFi" "ath10k-phy0" "phy0tpt"
|
||||
;;
|
||||
traverse-technologies-geos)
|
||||
ucidef_set_led_netdev "lan" "LAN" "geos:1" "br-lan" "tx rx"
|
||||
ucidef_set_led_netdev "wlan" "WiFi" "geos:2" "phy0tpt"
|
||||
ucidef_set_led_default "diag" "DIAG" "geos:3" "1"
|
||||
;;
|
||||
silicom-80500-0214-*)
|
||||
ucidef_set_led_netdev "wan" "WAN" "multicolor:fp_center" "wan0"
|
||||
ucidef_set_led_netdev "lan" "LAN" "multicolor:fp_right" "br-lan"
|
||||
;;
|
||||
esac
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
121
target/linux/x86/base-files/etc/board.d/02_network
Normal file
121
target/linux/x86/base-files/etc/board.d/02_network
Normal file
@@ -0,0 +1,121 @@
|
||||
#
|
||||
# Copyright © 2017 OpenWrt.org
|
||||
#
|
||||
|
||||
. /lib/functions/system.sh
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
case "$(board_name)" in
|
||||
barracuda-networks-inc-barracuda-ng-firewall-f12)
|
||||
ucidef_set_network_device_path "eth1" "pci0000:00/0000:00:14.0/0000:01:00.0"
|
||||
ucidef_set_network_device_path "eth2" "pci0000:00/0000:00:14.1/0000:02:00.0"
|
||||
ucidef_set_network_device_path "eth3" "pci0000:00/0000:00:13.0/0000:03:00.0"
|
||||
ucidef_set_network_device_path "eth4" "pci0000:00/0000:00:13.1/0000:04:00.0"
|
||||
ucidef_set_network_device_path "eth5" "pci0000:00/0000:00:13.2/0000:05:00.0"
|
||||
ucidef_set_interfaces_lan_wan "eth2 eth3 eth4 eth5" "eth1"
|
||||
;;
|
||||
cisco-mx100-hw)
|
||||
ucidef_set_network_device_path "mgmt" "pci0000:00/0000:00:01.2/0000:03:00.3"
|
||||
ucidef_set_network_device_path "wan" "pci0000:00/0000:00:01.2/0000:03:00.2"
|
||||
ucidef_set_network_device_path "eth2" "pci0000:00/0000:00:01.2/0000:03:00.1"
|
||||
ucidef_set_network_device_path "eth3" "pci0000:00/0000:00:01.2/0000:03:00.0"
|
||||
ucidef_set_network_device_path "eth4" "pci0000:00/0000:00:01.0/0000:01:00.2"
|
||||
ucidef_set_network_device_path "eth5" "pci0000:00/0000:00:01.0/0000:01:00.1"
|
||||
ucidef_set_network_device_path "eth6" "pci0000:00/0000:00:01.0/0000:01:00.4"
|
||||
ucidef_set_network_device_path "eth7" "pci0000:00/0000:00:01.0/0000:01:00.3"
|
||||
ucidef_set_network_device_path "eth8" "pci0000:00/0000:00:01.1/0000:02:00.1"
|
||||
ucidef_set_network_device_path "eth9" "pci0000:00/0000:00:01.1/0000:02:00.0"
|
||||
ucidef_set_network_device_path "eth10" "pci0000:00/0000:00:01.1/0000:02:00.3"
|
||||
ucidef_set_network_device_path "eth11" "pci0000:00/0000:00:01.1/0000:02:00.2"
|
||||
ucidef_set_interfaces_lan_wan "mgmt eth2 eth3 eth4 eth5 eth6 eth7 eth8 eth9 eth10 eth11" "wan"
|
||||
;;
|
||||
dell-emc-edge620)
|
||||
ucidef_set_interfaces_lan_wan "eth0 eth1 eth2 eth3 eth7" "eth6"
|
||||
;;
|
||||
gowin-solution-co-ltd-gw-mb-u01)
|
||||
ucidef_set_network_device_path "eth1" "pci0000:00/0000:00:1c.0/0000:01:00.0/0000:02:02.0/0000:04:00.0"
|
||||
ucidef_set_network_device_path "eth2" "pci0000:00/0000:00:1c.0/0000:01:00.0/0000:02:00.0/0000:03:00.0"
|
||||
ucidef_set_network_device_path "eth3" "pci0000:00/0000:00:1c.2/0000:07:00.0/0000:08:02.0/0000:0a:00.0"
|
||||
ucidef_set_network_device_path "eth4" "pci0000:00/0000:00:1c.2/0000:07:00.0/0000:08:00.0/0000:09:00.0"
|
||||
ucidef_set_network_device_path "poe" "pci0000:00/0000:00:1c.2/0000:07:00.0/0000:08:06.0/0000:0b:00.0"
|
||||
|
||||
sfp_device="pci0000:00/0000:00:1d.0"
|
||||
sfp_device_path="/sys/devices/$sfp_device"
|
||||
|
||||
pci_count="$(ls -d $sfp_device_path/0000:*:00.* 2>/dev/null | wc -l)"
|
||||
if [ "$pci_count" -eq 2 ]; then
|
||||
sfp_port1="$(basename $sfp_device_path/0000:*:00.1)"
|
||||
sfp_port2="$(basename $sfp_device_path/0000:*:00.0)"
|
||||
|
||||
ucidef_set_network_device_path "sfp1" "$sfp_device/$sfp_port1"
|
||||
ucidef_set_network_device_path "sfp2" "$sfp_device/$sfp_port2"
|
||||
elif [ "$pci_count" -eq 1 ]; then
|
||||
sfp_port="$(basename $sfp_device_path/0000:*:00.0)"
|
||||
|
||||
ucidef_set_network_device_path_port "sfp1" "$sfp_device/$sfp_port" "1"
|
||||
ucidef_set_network_device_path_port "sfp2" "$sfp_device/$sfp_port" "0"
|
||||
fi
|
||||
|
||||
ucidef_set_interfaces_lan_wan "eth1 eth2 eth3 eth4 poe" "sfp1 sfp2"
|
||||
;;
|
||||
pc-engines-apu1|pc-engines-apu2|pc-engines-apu3)
|
||||
ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0"
|
||||
;;
|
||||
pc-engines-apu5)
|
||||
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
||||
;;
|
||||
pc-engines-apu4|pc-engines-apu6)
|
||||
ucidef_set_interfaces_lan_wan "eth1 eth2 eth3" "eth0"
|
||||
;;
|
||||
roqos-roqos-core-rc10)
|
||||
ucidef_set_interfaces_lan_wan "eth1" "eth0"
|
||||
;;
|
||||
sophos-sg-105r1|sophos-xg-105r1| \
|
||||
sophos-sg-105wr1|sophos-xg-105wr1| \
|
||||
sophos-sg-105r2|sophos-xg-105r2| \
|
||||
sophos-sg-105wr2|sophos-xg-105wr2| \
|
||||
sophos-sg-115r1|sophos-xg-115r1| \
|
||||
sophos-sg-115wr1|sophos-xg-115wr1| \
|
||||
sophos-sg-115r2|sophos-xg-115r2| \
|
||||
sophos-sg-115wr2|sophos-xg-115wr2| \
|
||||
sophos-xg-85*|sophos-xg-86*)
|
||||
ucidef_set_interfaces_lan_wan "eth0 eth2 eth3" "eth1"
|
||||
;;
|
||||
sophos-sg-125r1|sophos-xg-125r1| \
|
||||
sophos-sg-125wr1|sophos-xg-125wr1| \
|
||||
sophos-sg-125r2|sophos-xg-125r2| \
|
||||
sophos-sg-125wr2|sophos-xg-125wr2| \
|
||||
sophos-sg-135r1|sophos-xg-135r1| \
|
||||
sophos-sg-135wr1|sophos-xg-135wr1| \
|
||||
sophos-sg-135r2|sophos-xg-135r2| \
|
||||
sophos-sg-135wr2|sophos-xg-135wr2)
|
||||
ucidef_set_interfaces_lan_wan "eth0 eth2 eth3 eth4 eth5 eth6 eth7" "eth1"
|
||||
;;
|
||||
sophos-sg-135r3|sophos-xg-135r3| \
|
||||
sophos-sg-135wr3|sophos-xg-135wr3)
|
||||
ucidef_set_interfaces_lan_wan "eth0 eth1 eth2 eth3 eth5 eth7 eth8" "eth6"
|
||||
;;
|
||||
traverse-technologies-geos)
|
||||
ucidef_set_interface_lan "eth0 eth1"
|
||||
ucidef_add_atm_bridge "0" "35" "llc" "bridged"
|
||||
ucidef_set_interface_wan "nas0" "dhcp"
|
||||
macaddr="$(cat /sys/class/net/eth0/address)" 2>/dev/null
|
||||
[ -n "$macaddr" ] && ucidef_set_interface_macaddr "wan" "$macaddr"
|
||||
;;
|
||||
silicom-80500-0214-*)
|
||||
ucidef_set_network_device_path "wan0" "pci0000:00/0000:00:16.0/0000:03:00.0"
|
||||
ucidef_set_network_device_path "wan1" "pci0000:00/0000:00:16.0/0000:03:00.1"
|
||||
ucidef_set_network_device_path "media0" "pci0000:00/0000:00:17.0/0000:02:00.1"
|
||||
ucidef_set_network_device_path "media1" "pci0000:00/0000:00:17.0/0000:02:00.0"
|
||||
ucidef_set_network_device_path "eth0" "pci0000:00/0000:00:0c.0/0000:04:00.0"
|
||||
ucidef_set_network_device_path "eth1" "pci0000:00/0000:00:0e.0/0000:05:00.0"
|
||||
ucidef_set_network_device_path "eth2" "pci0000:00/0000:00:0f.0/0000:06:00.0"
|
||||
ucidef_set_network_device_path "eth3" "pci0000:00/0000:00:10.0/0000:07:00.0"
|
||||
ucidef_set_interfaces_lan_wan "eth0 eth1 eth2 eth3" "wan0"
|
||||
;;
|
||||
esac
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
84
target/linux/x86/base-files/etc/diag.sh
Normal file
84
target/linux/x86/base-files/etc/diag.sh
Normal file
@@ -0,0 +1,84 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright © 2017 OpenWrt.org
|
||||
#
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/leds.sh
|
||||
. /usr/share/libubox/jshn.sh
|
||||
|
||||
preinit_match_diag_led() {
|
||||
local CFG keys key cfg name sysfs default
|
||||
|
||||
CFG=/etc/board.json
|
||||
if [ ! -s $CFG ]; then
|
||||
CFG=/tmp/board.json
|
||||
[ -s /tmp/sysinfo/model ] || return
|
||||
/bin/board_detect $CFG || return
|
||||
fi
|
||||
|
||||
json_init
|
||||
json_load "$(cat $CFG)"
|
||||
json_get_keys keys led
|
||||
json_is_a led object || return
|
||||
|
||||
json_select led
|
||||
for key in $keys; do
|
||||
json_select "$key"
|
||||
json_get_vars name sysfs default
|
||||
|
||||
if [ "$name" = "DIAG" -a "$default" = "1" ]; then
|
||||
status_led="$sysfs"
|
||||
return
|
||||
fi
|
||||
json_select ..
|
||||
done
|
||||
}
|
||||
|
||||
match_diag_led() {
|
||||
local name
|
||||
local default
|
||||
local sysfs
|
||||
config_get name "$1" name
|
||||
config_get default "$1" default
|
||||
config_get sysfs "$1" sysfs
|
||||
|
||||
if [ "$name" = "DIAG" -a "$default" = "1" ]; then
|
||||
status_led="$sysfs"
|
||||
fi
|
||||
}
|
||||
|
||||
get_status_led() {
|
||||
if [ -s /etc/config/system ]; then
|
||||
config_load system
|
||||
config_foreach match_diag_led led
|
||||
else
|
||||
preinit_match_diag_led
|
||||
fi
|
||||
}
|
||||
|
||||
set_state() {
|
||||
get_status_led
|
||||
|
||||
case "$1" in
|
||||
preinit)
|
||||
status_led_blink_preinit
|
||||
;;
|
||||
|
||||
failsafe)
|
||||
status_led_blink_failsafe
|
||||
;;
|
||||
|
||||
preinit_regular)
|
||||
status_led_blink_preinit_regular
|
||||
;;
|
||||
|
||||
upgrade)
|
||||
status_led_blink_preinit_regular
|
||||
;;
|
||||
|
||||
done)
|
||||
status_led_on
|
||||
;;
|
||||
esac
|
||||
}
|
||||
5
target/linux/x86/base-files/etc/inittab
Normal file
5
target/linux/x86/base-files/etc/inittab
Normal file
@@ -0,0 +1,5 @@
|
||||
::sysinit:/etc/init.d/rcS S boot
|
||||
::shutdown:/etc/init.d/rcS K shutdown
|
||||
@GRUB_SERIAL@::askfirst:/usr/libexec/login.sh
|
||||
hvc0::askfirst:/usr/libexec/login.sh
|
||||
tty1::askfirst:/usr/libexec/login.sh
|
||||
Reference in New Issue
Block a user