Initial commit
This commit is contained in:
18
target/linux/archs38/base-files/etc/board.d/02_network
Executable file
18
target/linux/archs38/base-files/etc/board.d/02_network
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2016 OpenWrt.org
|
||||
#
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
case "$(board_name)" in
|
||||
"arc-sdp"*|"arc-hsdk"*)
|
||||
ucidef_set_interface_lan "eth0" "dhcp"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
43
target/linux/archs38/base-files/lib/arc.sh
Normal file
43
target/linux/archs38/base-files/lib/arc.sh
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2016 OpenWrt.org
|
||||
#
|
||||
|
||||
# defaults
|
||||
ARC_BOARD_NAME="generic"
|
||||
ARC_BOARD_MODEL="Generic ARC board"
|
||||
|
||||
arc_board_detect() {
|
||||
local board
|
||||
local model
|
||||
local compatible
|
||||
|
||||
[ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
|
||||
|
||||
model="$( cat /proc/device-tree/model )"
|
||||
compatible="$( cat /proc/device-tree/compatible )"
|
||||
|
||||
case "$compatible" in
|
||||
"snps,axs103""snps,arc-sdp")
|
||||
board="arc-sdp";
|
||||
;;
|
||||
"snps,hsdk")
|
||||
board="arc-hsdk";
|
||||
;;
|
||||
"snps,nsim_hs")
|
||||
board="arc-nsim";
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$board" != "" ]; then
|
||||
ARC_BOARD_NAME="$board"
|
||||
fi
|
||||
|
||||
if [ "$model" != "" ]; then
|
||||
ARC_BOARD_MODEL="$model"
|
||||
fi
|
||||
|
||||
echo "$ARC_BOARD_NAME" > /tmp/sysinfo/board_name
|
||||
echo "$ARC_BOARD_MODEL" > /tmp/sysinfo/model
|
||||
echo "Detected $ARC_BOARD_NAME // $ARC_BOARD_MODEL"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
do_arc() {
|
||||
. /lib/arc.sh
|
||||
|
||||
arc_board_detect
|
||||
}
|
||||
|
||||
boot_hook_add preinit_main do_arc
|
||||
Reference in New Issue
Block a user