diff options
author | Chuanhong Guo <gch981213@gmail.com> | 2020-04-04 16:30:16 +0800 |
---|---|---|
committer | Chuanhong Guo <gch981213@gmail.com> | 2020-04-04 16:30:16 +0800 |
commit | 4d979a4d1969b59e462ea4633eeb8c69111261c5 (patch) | |
tree | c9a747fa2e3332bda2511eb884b8f17ceee36489 /target/linux/ramips | |
parent | 838f1fbb50e91ebaf1d34f9666ae6b65eb49df5c (diff) | |
download | upstream-4d979a4d1969b59e462ea4633eeb8c69111261c5.tar.gz upstream-4d979a4d1969b59e462ea4633eeb8c69111261c5.tar.bz2 upstream-4d979a4d1969b59e462ea4633eeb8c69111261c5.zip |
ramips: mt7621: bringup dsa master on preinit
DSA requires master netdev to be up before any of its slave ports.
Bring it up during preinit so that the first lan port can be used
on failsafe.
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
Diffstat (limited to 'target/linux/ramips')
-rw-r--r-- | target/linux/ramips/mt7621/base-files/lib/preinit/07_mt7621_bringup_dsa_master | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/target/linux/ramips/mt7621/base-files/lib/preinit/07_mt7621_bringup_dsa_master b/target/linux/ramips/mt7621/base-files/lib/preinit/07_mt7621_bringup_dsa_master new file mode 100644 index 0000000000..7a11252168 --- /dev/null +++ b/target/linux/ramips/mt7621/base-files/lib/preinit/07_mt7621_bringup_dsa_master @@ -0,0 +1,22 @@ +#!/bin/sh + +. /lib/functions.sh + +mt7621_bringup_dsa_master() { + local board=$(board_name) + local masterif + + case "$board" in + ubiquiti,edgerouterx|\ + ubiquiti,edgerouterx-sfp) + masterif="dsa" + ;; + *) + masterif="eth0" + ;; + esac + + ifconfig $masterif up +} + +boot_hook_add preinit_main mt7621_bringup_dsa_master
\ No newline at end of file |