Files
openwrt-master/target/linux/octeon/base-files/lib/preinit/01_sysinfo
domenico c06fb25d1f
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
Initial commit
2025-06-24 14:35:53 +02:00

51 lines
985 B
Plaintext

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"*)
name="erlite"
;;
"UBNT_E200"*)
name="er"
;;
"UBNT_E220"*)
name="erpro"
;;
"UBNT_E300"*|\
"UBNT_USG"*)
# let generic 02_sysinfo handle it since device has its own device tree
return 0
;;
"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