ramips: replace backticks by $(...)
[openwrt/openwrt.git] / target / linux / ramips / base-files / lib / preinit / 07_set_preinit_iface_ramips
1 #!/bin/sh
2 #
3 # Copyright (C) 2013 OpenWrt.org
4 #
5
6 ramips_set_preinit_iface() {
7 RT3X5X=$(grep -E "(RT3.5|RT5350|MT7628|MT7688|MT7620|MT7621)" /proc/cpuinfo)
8
9 if [ -n "${RT3X5X}" ]; then
10 # The ethernet switch driver enables VLAN by default, but
11 # failsafe uses eth0, making the device unreachable:
12 # https://dev.openwrt.org/ticket/18768
13 case "${RT3X5X}" in
14 *MT7620*)
15 ralink_switchdev=mt7620
16 ;;
17 *MT7621*)
18 ralink_switchdev=mt7530
19 ;;
20 *)
21 ralink_switchdev=rt305x
22 ;;
23 esac
24 swconfig dev $ralink_switchdev set reset 1
25 swconfig dev $ralink_switchdev set enable_vlan 0
26 swconfig dev $ralink_switchdev set apply 1
27 fi
28
29 ifname=eth0
30 }
31
32 boot_hook_add preinit_main ramips_set_preinit_iface