difos/target/linux/octeon/base-files/lib/preinit/01_sysinfo
Fabian Groffen 26d43b039d octeon/generic: ubnt,erlite: define profile
Currently the erlite install shows Model as EBNT_E100, uses eth0 as lan,
eth1 as wan, and doesn't use eth2.

- define dts for this device, such that we get a cleaner naming here
- fix handing of this device to inlude eth2
- change eth0 to wan, like er-4/usg/etc as it once was intended

Fixes: https://github.com/openwrt/openwrt/issues/14946
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
Link: https://github.com/openwrt/openwrt/pull/17758
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-02-16 16:06:10 +01:00

47 lines
964 B
Text

do_sysinfo_octeon() {
local machine
local name
machine=$(grep "^system type" /proc/cpuinfo | sed "s/system type.*: \(.*\)/\1/g")
of_machine=$(head -n1 /sys/firmware/devicetree/base/compatible)
# Sadly for whatever reason the N821 (Cisco Viptela vEdge 1000) uses the
# same supposedly unique board ID as the EdgeRouter. This is bad, so
# we override what cpuinfo gives us using the device tree as a hint.
case "$of_machine" in
"cisco,vedge1000"*)
return 0
esac
case "$machine" in
"UBNT_E100"*|\
"UBNT_E300"*|\
"UBNT_USG"*)
# let generic 02_sysinfo handle it since device has its own device tree
return 0
;;
"UBNT_E200"*)
name="er"
;;
"UBNT_E220"*)
name="erpro"
;;
"ITUS_SHIELD"*)
name="itus,shield-router"
;;
*)
name="generic"
;;
esac
[ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
echo "$name" > /tmp/sysinfo/board_name
echo "$machine" > /tmp/sysinfo/model
}
boot_hook_add preinit_main do_sysinfo_octeon