brcm47xx: build b44 as a module
[librecmc/librecmc.git] / target / linux / brcm47xx / base-files / lib / preinit / 05_init_interfaces_brcm
1 #!/bin/sh
2
3 set_preinit_iface() {
4         ifname=eth0
5
6         insmod diag
7         insmod hwmon
8         insmod tg3
9         insmod b44
10
11         # hardware specific overrides
12         case "$(cat /proc/diag/model)" in
13                 "Linksys WAP54G V1") ifname=eth1;;
14                 "ASUS WL-HDD") ifname=eth1;;
15                 "ASUS WL-300g") ifname=eth1;;
16                 "ASUS (unknown, BCM4702)") ifname=eth1;;
17                 "Sitecom WL-105b") ifname=eth1;;
18         esac
19         ifconfig $ifname 0.0.0.0 up
20 }
21
22 check_module () {
23   module="$1"; shift; params="$*"
24
25   insmod "$module" "$params"
26   sleep 1
27   grep -q ^"$module " /proc/modules
28   return $?
29 }
30
31 init_iface() {
32         insmod switch-core
33         check_module switch-robo || check_module switch-adm  || {
34           check_module bcm57xx activate_gpio=0x4 && cpu_port="8u*"
35         } || rmmod switch-core
36 }
37
38 boot_hook_add preinit_main set_preinit_iface
39 boot_hook_add preinit_main init_iface