1263 lines
33 KiB
Bash
1263 lines
33 KiB
Bash
#!/bin/sh
|
|
|
|
PROFILE_CFG=/userfs/profile.cfg
|
|
if [ -f $PROFILE_CFG ] ; then
|
|
chmod 777 $PROFILE_CFG
|
|
. $PROFILE_CFG
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_AUTOBENCH" != "" ] ;then
|
|
echo "execute rcS_AutoBench"
|
|
chmod 777 /usr/etc/init.d/rcS_AutoBench
|
|
/usr/etc/init.d/rcS_AutoBench
|
|
exit 0
|
|
fi
|
|
if [ "$TCSUPPORT_3_18_21_KERNEL" != "" ] ;then
|
|
KERNEL_DIR=/lib/modules/3.18.21
|
|
else
|
|
if [ "$TCSUPPORT_2_6_36_KERNEL" != "" ] ;then
|
|
KERNEL_DIR=/lib/modules/2.6.36
|
|
else
|
|
KERNEL_DIR=/lib/modules/2.6.22.15
|
|
fi
|
|
fi
|
|
mount -a
|
|
|
|
# frank added 20110128
|
|
if [ "$TCSUPPORT_SDRAM_16M" != "" ] ;then
|
|
/userfs/bin/skbmgr 1280 400 &
|
|
fi
|
|
|
|
#/bin/busybox cp -a /usr/etc /tmp
|
|
|
|
#/bin/mkdir -m 0777 -p /tmp/var
|
|
/bin/mkdir -m 0777 -p /var/lock
|
|
/bin/mkdir -m 0777 -p /var/log
|
|
/bin/mkdir -m 0777 -p /var/run
|
|
/bin/mkdir -m 0777 -p /var/tmp
|
|
/bin/mkdir -m 0777 -p /tmp/var/home
|
|
/bin/mkdir -m 0777 -p /var/usb
|
|
/bin/mkdir -m 0777 -p /var/mount
|
|
/bin/mkdir -m 0777 -p /var/wwan
|
|
/bin/mkdir -m 0777 -p /var/zebra
|
|
|
|
/bin/ln -sf /tmp/etc/passwd /tmp/var/passwd
|
|
|
|
if [ "$TCSUPPORT_DUAL_WLAN_MT7615E" != "" ] ;then
|
|
echo "not need set skbmgr_driver_max_skb for MT7615"
|
|
else
|
|
echo 1280 > /proc/net/skbmgr_driver_max_skb
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_DUAL_WLAN_MT7615E" != "" ] ;then
|
|
echo "not need set skbmgr_driver_max_skb for MT7615"
|
|
else
|
|
if [ "$TCSUPPORT_SDRAM_32M" != "" ] ;then
|
|
echo 4096 > /proc/net/skbmgr_driver_max_skb
|
|
if [ "$TCSUPPORT_2_6_36_KERNEL" != "" ] ;then
|
|
echo 4096 > /proc/net/skbmgr_limit
|
|
fi
|
|
fi
|
|
if [ "$TCSUPPORT_SDRAM_64M" != "" ] ;then
|
|
echo 4096 > /proc/net/skbmgr_driver_max_skb
|
|
echo 4096 > /proc/net/skbmgr_limit
|
|
fi
|
|
fi
|
|
|
|
#add for 7570
|
|
if [ "$TCSUPPORT_MT7570" != "" ] ;then
|
|
if [ "$TCSUPPORT_RESERVEAREA_BLOCK" = "4" ] ;then
|
|
if [ "$ZYXEL" != "" ] ;then
|
|
/sbin/mtd readflash /tmp/7570_bob.conf 160 198144 reservearea
|
|
else
|
|
/userfs/bin/mtd readflash /tmp/7570_bob.conf 160 198144 reservearea
|
|
fi
|
|
else
|
|
if [ "$ZYXEL" != "" ] ;then
|
|
/sbin/mtd readflash /tmp/7570_bob.conf 160 1536 reservearea
|
|
else
|
|
/userfs/bin/mtd readflash /tmp/7570_bob.conf 160 1536 reservearea
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_XPON_HAL_API_EXT" != "" ] ;then
|
|
insmod $KERNEL_DIR/kernel/net/llc/llc.ko
|
|
insmod $KERNEL_DIR/kernel/net/802/p8022.ko
|
|
insmod $KERNEL_DIR/kernel/net/802/stp.ko
|
|
insmod $KERNEL_DIR/kernel/net/bridge/bridge.ko
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_CPU_RT63365" != "" ] && [ "$TCSUPPORT_POWERSAVE_ENABLE" != "" ] ;then
|
|
insmod $KERNEL_DIR/pwm.ko
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_RESTORE_LINOS_INFO" != "" ] ;then
|
|
echo "do restore linos info"
|
|
/userfs/bin/restore_linos_info
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_2_6_36_KERNEL" = "" ] ;then
|
|
insmod $KERNEL_DIR/tcfullcone.ko
|
|
fi
|
|
insmod $KERNEL_DIR/module_sel.ko
|
|
if [ "$TCSUPPORT_CPU_RT65168" != "" ] ;then
|
|
insmod $KERNEL_DIR/pwm.ko
|
|
fi
|
|
if [ "$TCSUPPORT_SMUX" != "" ] ;then
|
|
insmod $KERNEL_DIR/tcsmux.ko
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_FTP_THROUGHPUT" != "" ] ;then
|
|
echo "Not insmod portbind and(or) vlantag modules!"
|
|
else
|
|
if [ "$TCSUPPORT_PORTBIND" != "" ] ;then
|
|
insmod $KERNEL_DIR/tcportbind.ko
|
|
fi
|
|
if [ "$TCSUPPORT_VLAN_TAG" != "" ] ;then
|
|
insmod $KERNEL_DIR/tcvlantag.ko
|
|
fi
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_BRIDGE_FASTPATH" != "" ] ;then
|
|
insmod $KERNEL_DIR/brg_shortcut.ko
|
|
fi
|
|
|
|
echo 1 > /proc/sys/net/ipv4/ip_forward
|
|
echo 1 > /proc/sys/net/ipv4/tcp_syncookies
|
|
if [ "$TCSUPPORT_CWMP_FAST_GET" != "" ] ;then
|
|
echo 4096 > /proc/sys/net/nf_conntrack_max
|
|
else
|
|
echo 2048 > /proc/sys/net/nf_conntrack_max
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_NAT_SESSION_RESERVE" != "" ] ;then
|
|
if [ "$TCSUPPORT_CWMP_FAST_GET" != "" ] ;then
|
|
echo 2048 > /proc/sys/net/netfilter/nf_conntrack_reserve
|
|
else
|
|
echo 500 > /proc/sys/net/netfilter/nf_conntrack_reserve
|
|
fi
|
|
# 6: TCP 17:UDP
|
|
echo 6 > /proc/sys/net/netfilter/nf_conntrack_reserve_proto
|
|
echo 80 > /proc/sys/net/netfilter/nf_conntrack_reserve_port
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_IPV6" != "" ] ;then
|
|
echo "TCSUPPORT_IPV6"
|
|
#Modify gc_stale_time for IPv6 self test
|
|
echo 6000 > /proc/sys/net/ipv6/neigh/default/gc_stale_time
|
|
|
|
echo 1 >/proc/sys/net/ipv6/conf/all/forwarding
|
|
#set default accept_ra when IPv6 is enable, ChihYuan
|
|
echo 0 > /proc/sys/net/ipv6/conf/default/accept_ra
|
|
|
|
#Zyxel, EN75xx project enable autoconf. Autoconfigure addresses using Prefix Information in Router Advertisements.
|
|
echo 1 >/proc/sys/net/ipv6/conf/all/autoconf
|
|
fi
|
|
|
|
#krammer add for LAN can't continuous ping to WAN when exchenging the routing mode
|
|
#bug1126
|
|
echo 3 > /proc/sys/net/netfilter/nf_conntrack_icmp_timeout
|
|
|
|
echo 0 > /proc/sys/net/ipv4/conf/default/accept_source_route
|
|
echo 0 > /proc/sys/net/ipv4/conf/all/accept_source_route
|
|
|
|
insmod $KERNEL_DIR/tcledctrl.ko
|
|
insmod $KERNEL_DIR/tccicmd.ko
|
|
|
|
if [ "$TCSUPPORT_I2C" != "" ] ;then
|
|
insmod $KERNEL_DIR/sif.ko
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_SIMCARD_GENERAL" != "" ] ;then
|
|
insmod $KERNEL_DIR/mt7510sim.ko
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_FON" != "" ] ;then
|
|
insmod $KERNEL_DIR/tun.ko
|
|
if [ "$TCSUPPORT_FON_MODEL_B" != "" ] || [ "TCSUPPORT_FON_MODEL_A" != "" ] ;then
|
|
insmod $KERNEL_DIR/sch_tbf.ko
|
|
fi
|
|
elif [ "$TCSUPPORT_FON_V2" != "" ] ;then
|
|
insmod $KERNEL_DIR/sch_hfsc.ko
|
|
insmod $KERNEL_DIR/act_connmark.ko
|
|
insmod $KERNEL_DIR/sch_ingress.ko
|
|
insmod $KERNEL_DIR/cls_basic.ko
|
|
if [ "$TCSUPPORT_QOS" = "" ] ;then
|
|
insmod $KERNEL_DIR/cls_fw.ko
|
|
fi
|
|
insmod $KERNEL_DIR/xt_connbytes.ko
|
|
insmod $KERNEL_DIR/xt_length.ko
|
|
#insmod $KERNEL_DIR/xt_mark.ko
|
|
if [ "$TCSUPPORT_2_6_36_KERNEL" != "" ] ;then
|
|
#No test for kernel_2_6_36, just for reference
|
|
insmod $KERNEL_DIR/xt_connmark.ko
|
|
insmod $KERNEL_DIR/xt_recent.ko
|
|
insmod $KERNEL_DIR/nf_tproxy_core.ko
|
|
insmod $KERNEL_DIR/xt_TPROXY.ko
|
|
else
|
|
#insmod $KERNEL_DIR/xt_CONNMARK.ko
|
|
insmod $KERNEL_DIR/xt_CONNMARK_target.ko
|
|
insmod $KERNEL_DIR/ipt_recent.ko
|
|
insmod $KERNEL_DIR/ipt_REDIRECT.ko
|
|
fi
|
|
insmod $KERNEL_DIR/ipt_REJECT.ko
|
|
#Can use imq instead
|
|
insmod $KERNEL_DIR/ifb.ko
|
|
ifconfig ifb0 up
|
|
ifconfig ifb1 up
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_SQUASHFS_ADD_YAFFS" != "" ] ;then
|
|
mkdir /tmp/yaffs
|
|
YAFFS_MTDBLOCK="/dev/mtdblock6"
|
|
if [ "$TCSUPPORT_DUAL_IMAGE" != "" ] ;then
|
|
if [ "$TCSUPPORT_MULTI_BOOT" != "" ] ;then
|
|
YAFFS_MTDBLOCK="/dev/mtdblock10"
|
|
else
|
|
YAFFS_MTDBLOCK="/dev/mtdblock9"
|
|
fi
|
|
else
|
|
if [ "$TCSUPPORT_MULTI_BOOT" != "" ] ;then
|
|
YAFFS_MTDBLOCK="/dev/mtdblock7"
|
|
fi
|
|
fi
|
|
mount -t yaffs2 $YAFFS_MTDBLOCK /tmp/yaffs/ -o tags-ecc-off
|
|
if [ "$?" != "0" ] ;then
|
|
echo "erase yaffs2 and mount again!"
|
|
mtd erase yaffs
|
|
mount -t yaffs2 $YAFFS_MTDBLOCK /tmp/yaffs/ -o tags-ecc-off
|
|
else
|
|
echo "mount yaffs2 success!"
|
|
fi
|
|
fi
|
|
|
|
#echo "**************cfg_manager init*****************"
|
|
#/userfs/bin/cfg_manager &
|
|
|
|
EEPROM_RA_OFFSET=-1
|
|
EEPROM_RA_AC_OFFSET=-1
|
|
MAX_EEPROM_BIN_FILE_SIZE=0
|
|
|
|
if [ "$TCSUPPORT_RESERVEAREA_BLOCK" = "4" ] ;then
|
|
EEPROM_RA_OFFSET=393216
|
|
EEPROM_RA_AC_OFFSET=393728
|
|
MAX_EEPROM_BIN_FILE_SIZE=512
|
|
fi
|
|
|
|
if [ $MAX_EEPROM_BIN_FILE_SIZE != 0 ] ;then
|
|
if [ "$TCSUPPORT_WLAN_MT7592" != "" ] ;then
|
|
if [ $EEPROM_RA_OFFSET != -1 ] ;then
|
|
rm /etc/RT30xxEEPROM.bin
|
|
echo "Reading MT7592 EEPROM from flash reservearea"
|
|
mtd readflash /etc/RT30xxEEPROM.bin $MAX_EEPROM_BIN_FILE_SIZE $EEPROM_RA_OFFSET reservearea
|
|
fi
|
|
fi
|
|
if [ "$TCSUPPORT_DUAL_WLAN_MT7612E" != "" ] ;then
|
|
if [ $EEPROM_RA_AC_OFFSET != -1 ] ;then
|
|
rm /etc/Wireless/RT2860AP_AC/RT30xxEEPROM.bin
|
|
echo "Reading MT7612E EEPROM from flash reservearea"
|
|
mtd readflash /etc/Wireless/RT2860AP_AC/RT30xxEEPROM.bin $MAX_EEPROM_BIN_FILE_SIZE $EEPROM_RA_AC_OFFSET reservearea
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
sleep 2
|
|
|
|
#LED GPIO Settings
|
|
CONFFILE=/etc/led.conf
|
|
if [ -f $CONFFILE ]; then
|
|
chmod 777 $CONFFILE
|
|
. $CONFFILE
|
|
fi
|
|
if [ "$LAN" != "" ]; then
|
|
echo $LAN > /proc/tc3162/led_def
|
|
fi
|
|
|
|
|
|
|
|
if [ "$TCSUPPORT_HW_CRYPTO" != "" ] ;then
|
|
# insmod crypto_k.ko before any wan interface modules are loaded,
|
|
# otherise, pcaket may go into kernel ipsec before crypto_k
|
|
# registers ipsec function pointers to Kernel which will
|
|
# cause system crash!
|
|
insmod $KERNEL_DIR/crypto_k.ko
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_CPU_TC3162" != "" ] ;then
|
|
echo "insmod tc3162 mac driver"
|
|
insmod $KERNEL_DIR/tc3162l2mac.ko
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_CPU_TC3162U" != "" -o "$TCSUPPORT_CPU_RT63260" != "" ] ;then
|
|
echo "insmod tc3162u mac driver"
|
|
insmod $KERNEL_DIR/tc3162l2mac.ko
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_CPU_TC3262" != "" ] ;then
|
|
echo "insmod tc3262 gmac driver"
|
|
insmod $KERNEL_DIR/tc3262gmac.ko
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_CPU_TC3182" != "" -o "$TCSUPPORT_CPU_RT63165" != "" -o "$TCSUPPORT_CPU_RT65168" != "" ] ;then
|
|
echo "insmod tc3262 gmac driver"
|
|
insmod $KERNEL_DIR/tc3262gmac.ko
|
|
if [ "$TCSUPPORT_CPU_RT65168" != "" ] && [ "$TCSUPPORT_VOIP" = "" ];then
|
|
echo 8 >/proc/irq/22/smp_affinity
|
|
fi
|
|
if [ -f "/proc/tc3162/sys_has_2gmac" ] ;then
|
|
if [ "$TCSUPPORT_WAN_ETHER" != "" ] ;then
|
|
insmod $KERNEL_DIR/tc3262gmac1.ko
|
|
echo 2 > /proc/irq/16/smp_affinity
|
|
fi
|
|
fi
|
|
if [ -f "/proc/tc3162/sys_has_ptm" ] ;then
|
|
if [ "$TCSUPPORT_WAN_PTM" != "" ] ;then
|
|
insmod $KERNEL_DIR/tc3262ptm.ko
|
|
fi
|
|
fi
|
|
if [ -f "/proc/tc3162/sys_has_hwnat" ] ;then
|
|
if [ "$TCSUPPORT_HWNAT" != "" ] ;then
|
|
insmod $KERNEL_DIR/hwnat.ko
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_CPU_RT63365" != "" ] || [ "$TCSUPPORT_CPU_RT63368" != "" ] || [ "$TCSUPPORT_CPU_MT7510" != "" ] || [ "$TCSUPPORT_CPU_MT7520" != "" ] || [ "$TCSUPPORT_CPU_MT7505" != "" ] || [ "$TCSUPPORT_CPU_EN7512" != "" ] || [ "$TCSUPPORT_CPU_EN7521" != "" ] ;then
|
|
if [ "$TCSUPPORT_CPU_EN7512" != "" ] || [ "$TCSUPPORT_CPU_EN7521" != "" ] ;then
|
|
echo "insmod ETH_LAN driver"
|
|
insmod $KERNEL_DIR/fe_core.ko
|
|
insmod $KERNEL_DIR/qdma_lan.ko
|
|
insmod $KERNEL_DIR/eth.ko
|
|
insmod $KERNEL_DIR/eth_ephy.ko
|
|
/userfs/bin/qdmamgr_lan set rxratelimit config Enable packet
|
|
/userfs/bin/qdmamgr_lan set rxratelimit value 0 6000
|
|
/userfs/bin/qdmamgr_lan set rxratelimit value 1 1000000
|
|
else
|
|
echo "insmod raeth driver"
|
|
insmod $KERNEL_DIR/raeth.ko
|
|
fi
|
|
if [ "$TCSUPPORT_VOIP" = "" ];then
|
|
echo 8 >/proc/irq/22/smp_affinity
|
|
fi
|
|
fi
|
|
|
|
ifconfig eth0 0.0.0.0
|
|
|
|
if [ "$TCSUPPORT_QDMA_BUFMGR" != "" ] ;then
|
|
if [ "$TCSUPPORT_CPU_EN7512" != "" ] || [ "$TCSUPPORT_CPU_EN7521" != "" ] ;then
|
|
insmod $KERNEL_DIR/qdma_wan.ko
|
|
/userfs/bin/qdmamgr_wan set rxratelimit config Enable packet
|
|
/userfs/bin/qdmamgr_wan set rxratelimit value 0 6000
|
|
/userfs/bin/qdmamgr_wan set rxratelimit value 1 1000000
|
|
else
|
|
insmod $KERNEL_DIR/qdma.ko
|
|
fi
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_SLM_VERIFY" != "" ] ;then
|
|
insmod $KERNEL_DIR/slm_verify.ko
|
|
fi
|
|
|
|
### for MT7520 modules install
|
|
if [ "$TCSUPPORT_CPU_MT7520" != "" ] || [ "$TCSUPPORT_CPU_EN7521" != "" ] ;then
|
|
insmod $KERNEL_DIR/phy.ko
|
|
insmod $KERNEL_DIR/xpon.ko
|
|
ifconfig pon up
|
|
if [ "$TCSUPPORT_WAN_GPON" != "" ] ;then
|
|
ifconfig omci up
|
|
fi
|
|
if [ "$TCSUPPORT_WAN_EPON" != "" ] ;then
|
|
ifconfig oam up
|
|
fi
|
|
if [ "$TCSUPPORT_GPON_MAPPING" != "" ] || [ "$TCSUPPORT_EPON_MAPPING" != "" ] ;then
|
|
insmod $KERNEL_DIR/xponmap.ko
|
|
fi
|
|
if [ "$TCSUPPORT_FTTDP_V2" != "" ] ;then
|
|
insmod $KERNEL_DIR/tc3162_dmt.ko
|
|
insmod $KERNEL_DIR/mt7510ptm.ko
|
|
ifconfig nas8 up
|
|
fi
|
|
### for MT7510 modules install
|
|
elif [ "$TCSUPPORT_CPU_MT7510" != "" ] || [ "$TCSUPPORT_CPU_EN7512" != "" ] ;then
|
|
echo install dmt for mt7510
|
|
if [ "$TCSUPPORT_BONDING" != "" ] ;then
|
|
echo "TCSUPPORT_BONDING"
|
|
insmod $KERNEL_DIR/bonding_pcie_dev.ko
|
|
if [ "$TCSUPPORT_CPU_EN7512" = "" ] ;then
|
|
insmod $KERNEL_DIR/tc3162_dmt_slave.ko
|
|
fi
|
|
fi
|
|
if [ -f "/proc/tc3162/sys_is_fpag" ] ;then
|
|
echo "!!! Not Load dmt.ko in FPGA stage !!!"
|
|
else
|
|
insmod $KERNEL_DIR/tc3162_dmt.ko
|
|
fi
|
|
elif [ "$TCSUPPORT_CPU_MT7505" != "" ] ;then
|
|
echo install dmt for mt7505
|
|
insmod $KERNEL_DIR/mt7510sar.ko
|
|
insmod $KERNEL_DIR/tc3162_dmt.ko
|
|
### for others
|
|
else
|
|
if [ "$TCSUPPORT_CPU_RT65168" != "" ] && [ "$TCSUPPORT_MT7530_EXTERNAL" != "" ] ;then
|
|
if [ "$TCSUPPORT_WAN_ATM" != "" ] ;then
|
|
insmod $KERNEL_DIR/tc3162l2sar.ko
|
|
if [ "$TCSUPPORT_CPU_TC3182" != "" -o "$TCSUPPORT_CPU_RT63365" != "" -o "$TCSUPPORT_CPU_RT63368" != "" -o "$TCSUPPORT_CPU_RT65168" != "" ] ;then
|
|
#Binding sar to VPE 2. shnwind add.
|
|
echo 4 >/proc/irq/23/smp_affinity
|
|
fi
|
|
elif [ ! "$TCSUPPORT_WAN_PTM" != "" -a ! "$TCSUPPORT_WAN_ETHER" != "" ] ;then
|
|
insmod $KERNEL_DIR/tc3162l2sar.ko
|
|
fi
|
|
insmod $KERNEL_DIR/tc3162_dmt.ko
|
|
fi
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_CPU_TC3182" != "" -o "$TCSUPPORT_CPU_RT63365" != "" -o "$TCSUPPORT_CPU_RT63368" != "" -o "$TCSUPPORT_CPU_RT65168" != "" ] ;then
|
|
if [ "$TCSUPPORT_WAN_ATM" != "" ] ;then
|
|
insmod $KERNEL_DIR/tc3162l2sar.ko
|
|
echo 4 >/proc/irq/23/smp_affinity
|
|
fi
|
|
insmod $KERNEL_DIR/tc3162_dmt.ko
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_WLAN" != "" ] && [ -f "/proc/tc3162/sys_has_wifi" ] ;then
|
|
echo "TCSUPPORT_WLAN"
|
|
if [ "$TCSUPPORT_WLAN_RT2561" != "" ] ;then
|
|
echo "TCSUPPORT_WLAN_RT2561"
|
|
insmod $KERNEL_DIR/rt61ap.ko
|
|
fi
|
|
if [ "$TCSUPPORT_WLAN_RT3390" != "" ] ;then
|
|
echo "TCSUPPORT_WLAN_RT3390"
|
|
insmod $KERNEL_DIR/rt3390ap.ko
|
|
fi
|
|
if [ "$TCSUPPORT_WLAN_RT5392" != "" ] ;then
|
|
echo "TCSUPPORT_WLAN_RT5392"
|
|
insmod $KERNEL_DIR/rt5390ap.ko
|
|
fi
|
|
if [ "$TCSUPPORT_WLAN_RT5390" != "" ] ;then
|
|
echo "TCSUPPORT_WLAN_RT5390"
|
|
insmod $KERNEL_DIR/rt5390ap.ko
|
|
fi
|
|
if [ "$TCSUPPORT_WLAN_RT5390HL" != "" ] ;then
|
|
echo "TCSUPPORT_WLAN_RT5390HL"
|
|
insmod $KERNEL_DIR/rt5390ap.ko
|
|
fi
|
|
if [ "$TCSUPPORT_WLAN_MT7601E" != "" ] ;then
|
|
echo "TCSUPPORT_WLAN_MT7601E"
|
|
insmod $KERNEL_DIR/mt7601Eap.ko
|
|
fi
|
|
if [ "$TCSUPPORT_WLAN_RT3090" != "" ] ;then
|
|
echo "TCSUPPORT_WLAN_RT3090"
|
|
insmod $KERNEL_DIR/rt3090ap.ko
|
|
fi
|
|
if [ "$TCSUPPORT_DUAL_WLAN_RT5592" != "" ] ;then
|
|
echo "TCSUPPORT_DUAL_WLAN_RT5592"
|
|
insmod $KERNEL_DIR/rt5592ap.ko
|
|
fi
|
|
if [ "$TCSUPPORT_DUAL_WLAN_RT3593" != "" ] ;then
|
|
echo "TCSUPPORT_DUAL_WLAN_RT3593"
|
|
insmod $KERNEL_DIR/rt3593ap.ko
|
|
fi
|
|
if [ "$TCSUPPORT_WLAN_MULTIDRIVER" != "" ] ;then
|
|
echo "TCSUPPORT_WLAN_MULTIDRIVER"
|
|
insmod $KERNEL_DIR/rt3593ap.ko
|
|
fi
|
|
if [ "$TCSUPPORT_DUAL_WLAN_MT7610E" != "" ] ;then
|
|
echo "TCSUPPORT_DUAL_WLAN_MT7610E"
|
|
insmod $KERNEL_DIR/mt7610e_ap.ko
|
|
fi
|
|
if [ "$TCSUPPORT_DUAL_WLAN_MT7612E" != "" ] ;then
|
|
echo "TCSUPPORT_DUAL_WLAN_MT7612E"
|
|
insmod $KERNEL_DIR/mt7662e_ap.ko
|
|
fi
|
|
if [ "$TCSUPPORT_DUAL_WLAN_MT7615E" != "" ] ;then
|
|
echo "TCSUPPORT_DUAL_WLAN_MT7615E"
|
|
insmod $KERNEL_DIR/mt7615_ap.ko
|
|
fi
|
|
if [ "$TCSUPPORT_WLAN_MT7592" != "" ] ;then
|
|
echo "TCSUPPORT_WLAN_MT7592"
|
|
insmod $KERNEL_DIR/mt7603eap.ko
|
|
fi
|
|
fi
|
|
|
|
|
|
#if [ "$TCSUPPORT_CPU_RT63368" != "" -o "$TCSUPPORT_CPU_RT63365" != "" ] && [ "$TCSUPPORT_ENDURANCE_WDOG" != "" -o "$TCSUPPORT_CZ_GENERAL" != "" ] ;then
|
|
if [ "$TCSUPPORT_CPU_TC3182" != "" -o "$TCSUPPORT_CPU_RT63365" != "" -o "$TCSUPPORT_CPU_RT65168" != "" -o "$TCSUPPORT_CPU_RT63368" != "" ] ;then
|
|
echo 4 > /proc/irq/25/smp_affinity
|
|
fi
|
|
|
|
# support QoS
|
|
if [ "$TCSUPPORT_FTP_THROUGHPUT" != "" ] ;then
|
|
echo "Not insmod qos modules!"
|
|
else
|
|
if [ "$TCSUPPORT_QOS" != "" ] ;then
|
|
insmod $KERNEL_DIR/act_mirred.ko
|
|
insmod $KERNEL_DIR/cls_fw.ko
|
|
insmod $KERNEL_DIR/sch_htb.ko
|
|
insmod $KERNEL_DIR/sch_prio.ko
|
|
ifconfig imq0 up
|
|
fi
|
|
fi
|
|
# load ebtable filter module
|
|
insmod $KERNEL_DIR/ebtables.ko
|
|
insmod $KERNEL_DIR/ebtable_filter.ko
|
|
insmod $KERNEL_DIR/ebt_ip.ko
|
|
if [ "$TCSUPPORT_BRIDGEARP_NOFWD_LAN" != "" -o "$TCSUPPORT_CZ_GENERAL" != "" ] ;then
|
|
insmod $KERNEL_DIR/ebt_arp.ko
|
|
fi
|
|
if [ "$TCSUPPORT_IPV6" != "" ] ;then
|
|
insmod $KERNEL_DIR/ebt_ip6.ko
|
|
fi
|
|
insmod $KERNEL_DIR/ebt_policer.ko
|
|
|
|
if [ "$TCSUPPORT_ROUTEPOLICY_PRIOR_PORTBIND" != "" ] ;then
|
|
insmod $KERNEL_DIR/ebt_mark.ko
|
|
insmod $KERNEL_DIR/ebtable_nat.ko
|
|
insmod $KERNEL_DIR/ebt_dnat.ko
|
|
insmod $KERNEL_DIR/ebt_snat.ko
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_IGMP_SNOOPING" != "" ] ;then
|
|
insmod $KERNEL_DIR/igmpsnoop.ko
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_CT_LOOPDETECT" != "" ] ;then
|
|
if [ "$TCSUPPORT_CT_C5_HEN_SFU" == "" ] ;then
|
|
insmod $KERNEL_DIR/loopdetect.ko
|
|
fi
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_EPON_DUMMY" != "" ] ;then
|
|
insmod $KERNEL_DIR/bridgedetect.ko
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_2_6_36_KERNEL" = "" ] ;then
|
|
if [ "$TCSUPPORT_MLD_SNOOPING" != "" ] ;then
|
|
insmod $KERNEL_DIR/mldsnooping.ko
|
|
fi
|
|
fi
|
|
|
|
ifconfig lo 127.0.0.1
|
|
route add -net 127.0.0.0 netmask 255.255.0.0 lo
|
|
|
|
# new sdk changed the timing of it
|
|
#ifconfig eth0 0.0.0.0
|
|
|
|
if [ "$TCSUPPORT_CPU_RT63365" != "" ] || [ "$TCSUPPORT_CPU_RT63368" != "" ] || [ "$TCSUPPORT_CPU_MT7510" != "" ] || [ "$TCSUPPORT_CPU_MT7520" != "" ] || [ "$TCSUPPORT_CPU_MT7505" != "" ] || [ "$TCSUPPORT_CPU_EN7512" != "" ] || [ "$TCSUPPORT_CPU_EN7521" != "" ] ;then
|
|
if [ -f "/proc/tc3162/sys_has_hwnat" ] ;then
|
|
if [ "$TCSUPPORT_RA_HWNAT" != "" ] ;then
|
|
insmod $KERNEL_DIR/hw_nat.ko FOE_NUM=16
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
brctl addbr br0
|
|
#brctl addif br0 eth0
|
|
if [ "$TCSUPPORT_FTTDP_V2" != "" ] ;then
|
|
brctl addif br0 nas8
|
|
fi
|
|
#brctl setfd br0 0
|
|
#brctl stp br0 off
|
|
if [ "$TCSUPPORT_CPU_MT7520" != "" ] ;then
|
|
/userfs/bin/hw_nat -V 1
|
|
fi
|
|
ifconfig eth0 | sed -n '1p' | sed 's/^.*HWaddr /WAN_MAC=/g' >> /etc/mac.conf
|
|
ifconfig eth0 | sed -n '1p' | sed 's/^.*HWaddr /LAN_MAC=/g' >> /etc/mac.conf
|
|
|
|
#if [ "$TCSUPPORT_WLAN" != "" ] ;then
|
|
#echo "TCSUPPORT_WLAN: ifconfig"
|
|
#i=0
|
|
#CONFFILE=/etc/Wireless/WLAN_APOn
|
|
|
|
#if [ -f $CONFFILE ] ;then
|
|
# chmod 777 $CONFFILE
|
|
# . $CONFFILE
|
|
# if [ "$TCSUPPORT_WLAN_PERSSID_SWITCH" != "" ] ;then
|
|
# case "$APOn" in
|
|
# "1" )
|
|
# ifconfig ra0 0.0.0.0 up
|
|
# ifconfig ra0 0.0.0.0 down
|
|
# while [ "$i" -lt "$Bssid_num" ];do
|
|
# case "$i" in
|
|
# "0" )
|
|
# if [ "$ssid0" = "1" ] ;then
|
|
# ifconfig ra$i 0.0.0.0 up
|
|
# brctl addif br0 ra$i
|
|
# fi
|
|
# ;;
|
|
# "1" )
|
|
# if [ "$ssid1" = "1" ] ;then
|
|
# ifconfig ra$i 0.0.0.0 up
|
|
# brctl addif br0 ra$i
|
|
# fi
|
|
# ;;
|
|
# "2" )
|
|
# if [ "$ssid2" = "1" ] ;then
|
|
# ifconfig ra$i 0.0.0.0 up
|
|
# brctl addif br0 ra$i
|
|
# fi
|
|
# ;;
|
|
# "3" )
|
|
# if [ "$ssid3" = "1" ] ;then
|
|
# ifconfig ra$i 0.0.0.0 up
|
|
# brctl addif br0 ra$i
|
|
# fi
|
|
# ;;
|
|
# esac
|
|
# i=`expr $i + 1`
|
|
# done
|
|
# ;;
|
|
# "0" )
|
|
# while [ "$i" -lt "$Bssid_num" ];do
|
|
# ifconfig ra$i 0.0.0.0 up
|
|
# brctl addif br0 ra$i
|
|
# ifconfig ra$i 0.0.0.0 down
|
|
# i=`expr $i + 1`
|
|
# done
|
|
# ;;
|
|
# esac
|
|
# else
|
|
# while [ "$i" -lt "$Bssid_num" ];do
|
|
# case "$APOn" in
|
|
# "1" )
|
|
# ifconfig ra$i 0.0.0.0 up
|
|
# brctl addif br0 ra$i
|
|
# ;;
|
|
# "0" )
|
|
# ifconfig ra$i 0.0.0.0 up
|
|
# brctl addif br0 ra$i
|
|
# ifconfig ra$i 0.0.0.0 down
|
|
# ;;
|
|
# esac
|
|
# i=`expr $i + 1`
|
|
# done
|
|
# fi
|
|
#
|
|
# if [ "$TCSUPPORT_WLAN_WDS" != "" ] ;then
|
|
# echo "TCSUPPORT_WLAN_WDS"
|
|
# if [ "$TCSUPPORT_C1_OBM" != "" ] ;then
|
|
# if [ "$APOn" = "1" ] ;then
|
|
# case "$WdsEnable" in
|
|
# "1"|"2"|"3"|"4" )
|
|
# if [ "$Wds0ON" = "1" ] ;then
|
|
# ifconfig wds0 0.0.0.0 up
|
|
# brctl addif br0 wds0
|
|
# fi
|
|
# if [ "$Wds1ON" = "1" ] ;then
|
|
# ifconfig wds1 0.0.0.0 up
|
|
# brctl addif br0 wds1
|
|
# fi
|
|
# if [ "$Wds2ON" = "1" ] ;then
|
|
# ifconfig wds2 0.0.0.0 up
|
|
# brctl addif br0 wds2
|
|
# fi
|
|
# if [ "$Wds3ON" = "1" ] ;then
|
|
# ifconfig wds3 0.0.0.0 up
|
|
# brctl addif br0 wds3
|
|
# fi
|
|
# ;;
|
|
# "0" )
|
|
# ;;
|
|
# esac
|
|
# fi
|
|
# else
|
|
# if [ "$APOn" = "1" ] ;then
|
|
# case "$WdsEnable" in
|
|
# "1"|"2"|"3"|"4" )
|
|
# ifconfig wds0 0.0.0.0 up
|
|
# brctl addif br0 wds0
|
|
# ifconfig wds1 0.0.0.0 up
|
|
# brctl addif br0 wds1
|
|
# ifconfig wds2 0.0.0.0 up
|
|
# brctl addif br0 wds2
|
|
# ifconfig wds3 0.0.0.0 up
|
|
# brctl addif br0 wds3
|
|
# ;;
|
|
# "0" )
|
|
# ;;
|
|
# esac
|
|
# fi
|
|
# fi
|
|
# fi
|
|
# if [ "$TCSUPPORT_FON" != "" ] || [ "$TCSUPPORT_FON_V2" != "" ] ;then
|
|
# if [ "$Bssid_num" -ge "2" ] ;then
|
|
# brctl delif br0 ra1
|
|
# ifconfig ra1 down
|
|
# fi
|
|
# fi
|
|
# if [ "$TCSUPPORT_WLAN_LED_BY_SW" != "" ] ;then
|
|
# if [ "$APOn" = "1" ] ;then
|
|
# echo 1 > /proc/tc3162/led_wlan
|
|
# else
|
|
# echo 0 > /proc/tc3162/led_wlan
|
|
# fi
|
|
# fi
|
|
#fi
|
|
#i=0
|
|
#CONFFILE=/etc/Wireless/WLAN_APOn_AC
|
|
|
|
#if [ -f $CONFFILE ] ;then
|
|
# chmod 777 $CONFFILE
|
|
# . $CONFFILE
|
|
# if [ "$TCSUPPORT_WLAN_PERSSID_SWITCH" != "" ] ;then
|
|
# case "$APOn" in
|
|
# "1" )
|
|
# ifconfig rai0 0.0.0.0 up
|
|
# ifconfig rai0 0.0.0.0 down
|
|
# while [ "$i" -lt "$Bssid_num" ];do
|
|
# case "$i" in
|
|
# "0" )
|
|
# if [ "$ssid0" = "1" ] ;then
|
|
# ifconfig rai$i 0.0.0.0 up
|
|
# brctl addif br0 rai$i
|
|
# fi
|
|
# ;;
|
|
# "1" )
|
|
# if [ "$ssid1" = "1" ] ;then
|
|
# ifconfig rai$i 0.0.0.0 up
|
|
# brctl addif br0 rai$i
|
|
# fi
|
|
# ;;
|
|
# "2" )
|
|
# if [ "$ssid2" = "1" ] ;then
|
|
# ifconfig rai$i 0.0.0.0 up
|
|
# brctl addif br0 rai$i
|
|
# fi
|
|
# ;;
|
|
# "3" )
|
|
# if [ "$ssid3" = "1" ] ;then
|
|
# ifconfig rai$i 0.0.0.0 up
|
|
# brctl addif br0 rai$i
|
|
# fi
|
|
# ;;
|
|
# esac
|
|
# i=`expr $i + 1`
|
|
# done
|
|
# ;;
|
|
# "0" )
|
|
# while [ "$i" -lt "$Bssid_num" ];do
|
|
# ifconfig rai$i 0.0.0.0 up
|
|
# brctl addif br0 rai$i
|
|
# ifconfig rai$i 0.0.0.0 down
|
|
# i=`expr $i + 1`
|
|
# done
|
|
# ;;
|
|
# esac
|
|
# else
|
|
# while [ "$i" -lt "$Bssid_num" ];do
|
|
# case "$APOn" in
|
|
# "1" )
|
|
# ifconfig rai$i 0.0.0.0 up
|
|
# brctl addif br0 rai$i
|
|
# ;;
|
|
# "0" )
|
|
# ifconfig rai$i 0.0.0.0 up
|
|
# brctl addif br0 rai$i
|
|
# ifconfig rai$i 0.0.0.0 down
|
|
# ;;
|
|
# esac
|
|
# i=`expr $i + 1`
|
|
# done
|
|
# fi
|
|
#
|
|
# if [ "$TCSUPPORT_WLAN_WDS" != "" ] ;then
|
|
# echo "TCSUPPORT_WLAN_WDS"
|
|
# if [ "$APOn" = "1" ] ;then
|
|
# case "$WdsEnable" in
|
|
# "1"|"2"|"3"|"4" )
|
|
# ifconfig wdsi0 0.0.0.0 up
|
|
# brctl addif br0 wdsi0
|
|
# ifconfig wdsi1 0.0.0.0 up
|
|
# brctl addif br0 wdsi1
|
|
# ifconfig wdsi2 0.0.0.0 up
|
|
# brctl addif br0 wdsi2
|
|
# ifconfig wdsi3 0.0.0.0 up
|
|
# brctl addif br0 wdsi3
|
|
# ;;
|
|
# "0" )
|
|
# ;;
|
|
# esac
|
|
# fi
|
|
#fi
|
|
#fi
|
|
#fi
|
|
#
|
|
#if [ "$TCSUPPORT_DUAL_WLAN_RT5592" != "" ] ;then
|
|
#ifconfig ra1 0.0.0.0 up
|
|
#brctl addif br0 ra1
|
|
#fi
|
|
#if [ "$TCSUPPORT_DUAL_WLAN_RT3593" != "" ] ;then
|
|
#ifconfig ra1 0.0.0.0 up
|
|
#brctl addif br0 ra1
|
|
#fi
|
|
#if [ "$TCSUPPORT_DUAL_WLAN_RT5592_RT3593" != "" ] ;then
|
|
#ifconfig rai0 0.0.0.0 up
|
|
#brctl addif br0 rai0
|
|
#fi
|
|
|
|
#Disable MAC interrupt, avoid lan port receive packets.
|
|
#Interrupt Mask Register bit 21 set to 0
|
|
#/usr/bin/sys memwl bfb40004 61460b09
|
|
#/usr/bin/sys memrl bfb40004
|
|
|
|
#lan_init
|
|
echo "**************lan port init*****************"
|
|
ifconfig br0 192.168.1.1
|
|
|
|
#HOSTNAME=`/userfs/bin/tcapi get Snmpd_Entry sysName`
|
|
# Set the hostname.
|
|
#echo $HOSTNAME > /etc/hostname
|
|
#hostname -F /etc/hostname
|
|
#rm -rf /etc/hostname
|
|
|
|
if [ "$TCSUPPORT_CPU_TC3182" != "" -o "$TCSUPPORT_CPU_RT63165" != "" ] ;then
|
|
wan ghs set annex a
|
|
wan adsl reset
|
|
fi
|
|
|
|
tcwdog -t 1 /dev/watchdog &
|
|
#if [ "$TCSUPPORT_DYING_GASP_OPTIMIZATION" != "" ] ;then
|
|
#insmod $KERNEL_DIR/dying_gasp.ko
|
|
#fi
|
|
|
|
#if [ "$TCSUPPORT_RA_MENU" != "" ] ;then
|
|
# utelnetd -l /userfs/bin/ra_menu -d
|
|
#else
|
|
# if [ "$TCSUPPORT_CY_PON" = "" ] ;then
|
|
# utelnetd -l /bin/login -d
|
|
# fi
|
|
#fi
|
|
|
|
#if [ "$TCSUPPORT_SSH" != "" ] ;then
|
|
#echo "SSH"
|
|
#/userfs/bin/tcapi set ACL_Common sshOption support
|
|
#else
|
|
#/userfs/bin/tcapi set ACL_Common sshOption none
|
|
#fi
|
|
|
|
#if [ "$RA_ETHERMEDIATYPE" != "" ] ;then
|
|
#echo "Ethernet Media-Type Support"
|
|
#/userfs/bin/tcapi set Lan_EtherMedia enable support
|
|
#else
|
|
#/userfs/bin/tcapi set Lan_EtherMedia enable none
|
|
#fi
|
|
|
|
#Web server
|
|
#/userfs/bin/boa -c /boaroot -d &
|
|
|
|
if [ "$TCSUPPORT_TC2031" != "" ] ;then
|
|
echo "single port"
|
|
else
|
|
echo "four ports"
|
|
if [ "$MT7505_PQA_SWITCH_TEST" != "" ] ;then
|
|
#/userfs/bin/ethphxcmd eth0 vlanpt disable
|
|
if [ "$TCSUPPORT_MT7530_EXTERNAL" != "" -o "$TCSUPPORT_CPU_RT63368" != "" ] ;then
|
|
/bin/echo 0 > /proc/tc3162/stag_to_vtag
|
|
else
|
|
/bin/echo 1 > /proc/tc3162/stag_to_vtag
|
|
fi
|
|
#/userfs/bin/ethphxcmd eth0 vlanpt enable
|
|
else
|
|
#/userfs/bin/ethphxcmd eth0 vlanpt disable
|
|
if [ "$TCSUPPORT_FTTDP_V2" != "" ] ;then
|
|
echo "FTTdp no need eth0 vlanpt"
|
|
else
|
|
if [ "$TCSUPPORT_MT7530_EXTERNAL" != "" -a "$TCSUPPORT_CPU_RT63368" != "" ] ;then
|
|
/bin/echo 0 > /proc/tc3162/stag_to_vtag
|
|
else
|
|
/bin/echo 1 > /proc/tc3162/stag_to_vtag
|
|
fi
|
|
/userfs/bin/ethphxcmd eth0 vlanpt enable
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_XPON_HAL_API_EXT" != "" ] ;then
|
|
/userfs/bin/ethphxcmd eth0 vlanpt disable
|
|
ifconfig eth1 up
|
|
ifconfig eth2 up
|
|
ifconfig eth3 up
|
|
brctl addif br0 eth1
|
|
brctl addif br0 eth2
|
|
brctl addif br0 eth3
|
|
fi
|
|
|
|
# drop caches
|
|
if [ "$TCSUPPORT_MULTISERVICE_ON_WAN" != "" ] ;then
|
|
echo 3 > /proc/sys/vm/drop_caches
|
|
fi
|
|
if [ "$TCSUPPORT_CPU_MT7520" != "" ] || [ "$TCSUPPORT_CPU_EN7521" != "" ] ;then
|
|
#pon vlan
|
|
if [ "$TCSUPPORT_PON_VLAN" != "" ] ;then
|
|
insmod $KERNEL_DIR/ponvlan.ko
|
|
fi
|
|
#pon igmp snooping
|
|
if [ "$TCSUPPORT_XPON_IGMP" != "" ] ;then
|
|
insmod $KERNEL_DIR/xpon_igmp.ko
|
|
fi
|
|
if [ "$TCSUPPORT_PON_MAC_FILTER" != "" ] ;then
|
|
insmod $KERNEL_DIR/ponmacfilter.ko
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_ETHER_DOWNVLAN" != "" ] ;then
|
|
insmod $KERNEL_DIR/ether_downvlan.ko
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_MAX_PACKET_2000" != "" ] ;then
|
|
ifconfig eth0 mtu 2000
|
|
ifconfig eth0.1 mtu 2000
|
|
ifconfig eth0.2 mtu 2000
|
|
ifconfig eth0.3 mtu 2000
|
|
ifconfig eth0.4 mtu 2000
|
|
ifconfig ra0 mtu 2000
|
|
ifconfig br0 mtu 2000
|
|
fi
|
|
/userfs/bin/ethphxcmd gsww2 0 1640 0
|
|
fi
|
|
|
|
#epon_dummy_detect
|
|
if [ "$TCSUPPORT_EPON_DUMMY" != "" ] ;then
|
|
/userfs/bin/epon_dummy_detect &
|
|
fi
|
|
|
|
#. /userfs/startup.sh
|
|
#/userfs/bin/tcapi set System_Entry start_up 1
|
|
#/userfs/bin/tcapi commit System_Entry
|
|
#/userfs/bin/tcapi set System_Entry start_up 0
|
|
|
|
if [ "$TCSUPPORT_CPU_TC3262" != "" -o "$TCSUPPORT_CPU_TC3182" != "" -o "$TCSUPPORT_CPU_RT63165" != "" -o "$TCSUPPORT_CPU_RT65168" != "" -o "$TCSUPPORT_CPU_MT7510" != "" -o "$TCSUPPORT_CPU_MT7505" != "" ] ;then
|
|
w rts dbg off
|
|
fi
|
|
|
|
w dmt2 set largeD 2
|
|
if [ "$TCSUPPORT_VOIP" != "" ] ;then
|
|
echo 8 > /proc/irq/12/smp_affinity
|
|
taskset -p 0x8 `pidof vtspr`
|
|
fi
|
|
|
|
#if [ "$TCSUPPORT_VLAN_TAG" != "" ] ;then
|
|
#if [ "$TCSUPPORT_VTAG_ALLDEV" != "" ] ;then
|
|
#/userfs/bin/tcapi set VlanTag_Entry portsNum 4
|
|
#else
|
|
#/userfs/bin/tcapi set Info_dot1q wan_8021q 1
|
|
#fi
|
|
#fi
|
|
|
|
# echo 1280 > /proc/net/skbmgr_driver_max_skb
|
|
|
|
# if [ "$TCSUPPORT_SDRAM_32M" != "" ] ;then
|
|
# echo 4096 > /proc/net/skbmgr_driver_max_skb
|
|
# if [ "$TCSUPPORT_2_6_36_KERNEL" != "" ] ;then
|
|
# echo 4096 > /proc/net/skbmgr_limit
|
|
# fi
|
|
# fi
|
|
# if [ "$TCSUPPORT_SDRAM_64M" != "" ] ;then
|
|
# echo 4096 > /proc/net/skbmgr_driver_max_skb
|
|
# echo 4096 > /proc/net/skbmgr_limit
|
|
# fi
|
|
|
|
if [ "$TCSUPPORT_MEMORY_CONTROL" != "" ] ;then
|
|
/bin/echo 1 > /proc/net/auto_clear_cache
|
|
/bin/echo 1 > /proc/net/auto_kill_process
|
|
/bin/echo 5 > /proc/sys/kernel/panic
|
|
/bin/echo 500 > /proc/sys/net/core/netdev_max_backlog
|
|
fi
|
|
if [ "$TCSUPPORT_TTNET" != "" ] ;then
|
|
/bin/echo 600 > /proc/sys/net/netfilter/nf_conntrack_udp_timeout
|
|
/bin/echo 600 > /proc/sys/net/netfilter/nf_conntrack_udp_timeout_stream
|
|
fi
|
|
|
|
#network function
|
|
#if [ -f /etc/inetd.conf ]; then
|
|
# /userfs/bin/inetd &
|
|
#fi
|
|
|
|
#tftp server
|
|
#/userfs/bin/tftpd &
|
|
|
|
if [ "$TCSUPPORT_WPA_SUPPLICANT" != "" ] ;then
|
|
#seting future date
|
|
date 010100002012
|
|
#start supplicant control interface
|
|
/userfs/bin/wpa_supplicant -g /var/run/wpa_supplicant &
|
|
fi
|
|
#
|
|
|
|
# drop caches
|
|
echo 3 > /proc/sys/vm/drop_caches
|
|
|
|
if [ "$TCSUPPORT_CHT_ARP" != "" ] ;then
|
|
/bin/echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_C1_OBM" != "" ]||[ "$TCSUPPORT_PON_FH" != "" ] ;then
|
|
/bin/echo 1 > /proc/tc3162/port_reverse
|
|
if [ "$WIZARD_OI_GUI" != "" ] ;then
|
|
/bin/echo "Set WiFi client limit for C1!"
|
|
/userfs/bin/iwpriv ra0 set MaxStaNum=16
|
|
/userfs/bin/iwpriv ra1 set MaxStaNum=6
|
|
fi
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_DUAL_WLAN_RT5592" != "" ] ;then
|
|
/userfs/bin/iwpriv ra1 set WirelessMode=10
|
|
/userfs/bin/iwpriv ra1 set Channel=52
|
|
/userfs/bin/iwpriv ra1 set SSID="RT5592AP"
|
|
fi
|
|
if [ "$TCSUPPORT_DUAL_WLAN_RT3593" != "" ] ;then
|
|
/userfs/bin/iwpriv ra1 set WirelessMode=10
|
|
/userfs/bin/iwpriv ra1 set Channel=52
|
|
/userfs/bin/iwpriv ra1 set SSID="RT3593AP"
|
|
fi
|
|
if [ "$TCSUPPORT_DUAL_WLAN_RT5592_RT3593" != "" ] ;then
|
|
/userfs/bin/iwpriv rai0 set WirelessMode=10
|
|
/userfs/bin/iwpriv rai0 set Channel=157
|
|
/userfs/bin/iwpriv rai0 set SSID="Aband_AP"
|
|
echo 8 >/proc/irq/24/smp_affinity
|
|
if [ "$TCSUPPORT_BONDING" != "" ] ;then
|
|
echo 8 >/proc/irq/25/smp_affinity
|
|
else
|
|
echo 4 >/proc/irq/25/smp_affinity
|
|
fi
|
|
fi
|
|
|
|
|
|
#if [ "$TCSUPPORT_CPU_RT63365" != "" ] ;then
|
|
#if [ "$TCSUPPORT_CZ_GENERAL" != "" ] ;then
|
|
#echo "RT63365 cz turn off ether wan webpage!!!"
|
|
#/userfs/bin/tcapi set WebCustom_Entry haveWan0 No
|
|
#fi
|
|
#fi
|
|
|
|
if [ "$TCSUPPORT_VOIP" != "" ] ;then
|
|
echo "MTK DSP support"
|
|
#COUNTRY=`/userfs/bin/tcapi get VoIPAdvanced_Common VoIPRegion`
|
|
echo 3 > /proc/sys/vm/drop_caches
|
|
if [ -f /userfs/bin/voip_loader ] ;then
|
|
/userfs/bin/voip_loader
|
|
#if [ $? = 0 ];then
|
|
VOIP_LOADER_SUCCESS=yes
|
|
#fi
|
|
fi
|
|
if [ "$VOIP_LOADER_SUCCESS" != "yes" ] ;then
|
|
insmod $KERNEL_DIR/sys_mod.ko
|
|
insmod $KERNEL_DIR/DSPCore.ko
|
|
insmod $KERNEL_DIR/pcm1.ko
|
|
insmod $KERNEL_DIR/lec.ko
|
|
insmod $KERNEL_DIR/spi.ko
|
|
insmod $KERNEL_DIR/slic3.ko
|
|
insmod $KERNEL_DIR/fxs3.ko slic1="zl88601" slic2="zl88601"
|
|
|
|
# insmod $KERNEL_DIR/sys_mod.ko
|
|
# if [ "$TCSUPPORT_SILICON" != "" ] ;then
|
|
# insmod $KERNEL_DIR/pcm_silicon.ko
|
|
# else
|
|
# insmod $KERNEL_DIR/pcm.ko
|
|
# fi
|
|
# insmod $KERNEL_DIR/lec.ko
|
|
# #insmod $KERNEL_DIR/slic3_sep.ko
|
|
# if [ "$TCSUPPORT_SILICON" != "" ] ;then
|
|
# insmod $KERNEL_DIR/slic3_silicon.ko
|
|
# else
|
|
# insmod $KERNEL_DIR/slic3.ko
|
|
# fi
|
|
# if [ "$TCSUPPORT_SILICON" != "" ] ;then
|
|
# insmod $KERNEL_DIR/fxs3_silicon.ko slic1="si32260" slic2="si32260"
|
|
# else
|
|
# if [ "$TCSUPPORT_CPU_RT63368" != "" ]||[ "$TCSUPPORT_PON_FH" != "" ] ;then
|
|
# insmod $KERNEL_DIR/fxs3.ko slic1="le89156"
|
|
# else
|
|
# if [ "$TCSUPPORT_CPU_MT7510" != "" -o "$TCSUPPORT_CPU_MT7520" != "" ] ;then
|
|
# insmod $KERNEL_DIR/fxs3.ko slic1="zl88601" slic2="zl88601"
|
|
# else
|
|
# insmod $KERNEL_DIR/fxs3.ko slic1="le89116" slic2="le89316" slic3="le89316"
|
|
# fi
|
|
# fi
|
|
# fi
|
|
insmod $KERNEL_DIR/ksocket.ko
|
|
insmod $KERNEL_DIR/ortp.ko
|
|
insmod $KERNEL_DIR/acodec_x.ko
|
|
insmod $KERNEL_DIR/foip.ko
|
|
insmod $KERNEL_DIR/ovdsp.ko
|
|
insmod $KERNEL_DIR/pcmDump.ko
|
|
fi
|
|
sleep 1
|
|
taskset -p 0x8 `pidof ORTP_TASK`
|
|
taskset -p 0x8 `pidof fxs_task`
|
|
taskset -p 0x8 `pidof DSPProc`
|
|
taskset -p 0x8 `pidof DspDlTask`
|
|
taskset -p 0x8 `pidof DspUlTask`
|
|
|
|
echo "1" >/proc/pcm1/pcmreset
|
|
|
|
#FXSNUM=`cat /proc/fxs/fxsNum`
|
|
#FXONUM=`cat /proc/fxs/fxoNum`
|
|
#sleep 2
|
|
#INFCNUM=`expr $FXSNUM + $FXONUM`
|
|
#/userfs/bin/tcapi set VoIPSysParam_Common SC_SYS_CFG_MAX_LINE $INFCNUM
|
|
#/userfs/bin/tcapi set VoIPSysParam_Common SC_SYS_CFG_MAX_ACCT $INFCNUM
|
|
#STRMNUM=`expr $INFCNUM \* 2`
|
|
#/userfs/bin/tcapi set VoIPSysParam_Common SC_SYS_CFG_MAX_CALL $STRMNUM
|
|
#echo "[VOIP] Usage: $INFCNUM acct $STRMNUM"
|
|
#/userfs/bin/tcapi set VoIPSysParam_Common SlicFXSNum "$FXSNUM"
|
|
#/userfs/bin/tcapi set VoIPSysParam_Common SlicFXONum "$FXONUM"
|
|
#if [ "$FXSNUM" = "2" ] ;then
|
|
#/userfs/bin/tcapi set VoIPBasic_Common VoIPLine2Enable Yes
|
|
#else
|
|
#/userfs/bin/tcapi set VoIPBasic_Common VoIPLine2Enable No
|
|
#fi
|
|
#/userfs/bin/tcapi set System_Entry start_up 2
|
|
#/userfs/bin/tcapi commit System_Entry
|
|
#/userfs/bin/tcapi set System_Entry start_up 0
|
|
|
|
CURRPROTOCOL=`/userfs/bin/tcapi get VoIPBasic_Common SIPProtocol`
|
|
if [ "$CURRPROTOCOL" = "H.248" ] ;then
|
|
/userfs/bin/tcVoIPApiServer &
|
|
/userfs/bin/mgapp -id 0 &
|
|
else
|
|
/userfs/bin/sipclient &
|
|
fi
|
|
|
|
#set default value to auto gain control,default disable
|
|
/bin/echo "0 15 -12 0" > /proc/fxs/autogain
|
|
fi
|
|
|
|
#this must at the end of RCS ----start
|
|
if [ "$TCSUPPORT_POWERSAVE_ENABLE" != "" ] ;then
|
|
if [ "$TCSUPPORT_CPU_MT7510" != "" -o "$TCSUPPORT_CPU_MT7520" != "" -o "$TCSUPPORT_CPU_MT7505" != "" -o "$TCSUPPORT_CPU_EN7512" != "" -o "$TCSUPPORT_CPU_EN7521" != "" ] ;then
|
|
insmod $KERNEL_DIR/pwm.ko
|
|
echo 1 > /proc/tc3162/pwm_start
|
|
fi
|
|
if [ "$TCSUPPORT_WAN_ETHER" != "" ] ;then
|
|
echo "wan ether support"
|
|
else
|
|
if [ "$TCSUPPORT_CPU_EN7512" == "" ] && [ "$TCSUPPORT_CPU_EN7521" == "" ] ;then
|
|
/userfs/bin/etherd miiw 4 0 1800
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_CZ_GENERAL" != "" ] ;then
|
|
echo "killall -9 klogd!!!"
|
|
killall -9 klogd
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_CZ_OTE" != "" ] ;then
|
|
echo "killall -9 utelnetd!!!"
|
|
killall -9 utelnetd
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_CPU_RT65168" != "" ] && [ "$TCSUPPORT_MT7530_EXTERNAL" != "" ] ;then
|
|
# for PHY can ping
|
|
echo "Set switch/phy registers settings to avoid SoC interference for UNH certification!"
|
|
echo "GGG"
|
|
/userfs/bin/ethphxcmd gsww 30E0 3F25
|
|
/userfs/bin/ethphxcmd gsww C 71819
|
|
/userfs/bin/ethphxcmd gsww 10 FFFFFF00
|
|
echo "HHH"
|
|
/userfs/bin/ethphxcmd gsww 3000 16330
|
|
/userfs/bin/ethphxcmd gsww 3100 16330
|
|
/userfs/bin/ethphxcmd gsww 3200 16330
|
|
/userfs/bin/ethphxcmd gsww 3300 16330
|
|
/userfs/bin/ethphxcmd gsww 3400 16330
|
|
echo "III"
|
|
/userfs/bin/ethphxcmd gsww 1FE0 A0087864
|
|
echo "JJJ"
|
|
/userfs/bin/ethphxcmd gsww 80 8002
|
|
/userfs/bin/ethphxcmd gsww 2004 ff0000
|
|
/userfs/bin/ethphxcmd gsww 2104 ff0000
|
|
/userfs/bin/ethphxcmd gsww 2204 ff0000
|
|
/userfs/bin/ethphxcmd gsww 2304 ff0000
|
|
/userfs/bin/ethphxcmd gsww 2404 ff0000
|
|
/userfs/bin/ethphxcmd gsww 2010 810000c0
|
|
/userfs/bin/ethphxcmd gsww 2110 810000c0
|
|
/userfs/bin/ethphxcmd gsww 2210 810000c0
|
|
/userfs/bin/ethphxcmd gsww 2310 810000c0
|
|
/userfs/bin/ethphxcmd gsww 2410 810000c0
|
|
echo "KKK"
|
|
ifconfig nas10 up
|
|
brctl addif br0 nas10
|
|
/userfs/bin/ethphxcmd gsww 2610 81000000
|
|
/userfs/bin/ethphxcmd gsww 3600 5e337
|
|
/userfs/bin/ethphxcmd gsww 10 ffffffe0
|
|
ifconfig br0 10.0.0.1
|
|
echo "LLL"
|
|
|
|
echo "for PC ping others PC at V1.11"
|
|
/userfs/bin/ethphxcmd gsww 10 FFFFFFE0
|
|
/userfs/bin/ethphxcmd gsww 2004 00FF0000
|
|
/userfs/bin/ethphxcmd gsww 2104 00FF0000
|
|
/userfs/bin/ethphxcmd gsww 2204 00FF0000
|
|
/userfs/bin/ethphxcmd gsww 2304 00FF0000
|
|
/userfs/bin/ethphxcmd gsww 2404 00FF0000
|
|
/userfs/bin/ethphxcmd gsww 20 08160810
|
|
fi
|
|
|
|
echo "MMM"
|
|
/userfs/bin/ethphxcmd gsww2 1 7d08 77777
|
|
tce emiiw 1 1f 26 C002
|
|
tce emiiw 1 1f 27 c
|
|
echo "MMM_end"
|
|
|
|
# close internal buck for T&W DASAN BOARD
|
|
if [ "$TCSUPPORT_TW_BOARD_DASAN" != "" ] ;then
|
|
sys memwl bfb0039c 00750025
|
|
sys memwl bfb00374 0000c000
|
|
fi
|
|
|
|
# modify the hw_nat timeout
|
|
if [ "$TCSUPPORT_C1_MS" != "" ] ;then
|
|
echo "hw_nat -U 30 30 30 30"
|
|
/userfs/bin/hw_nat -U 30 30 30 30
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_GPON_ATTACK_ENHANCE" != "" ] ;then
|
|
echo 1 64 128 100 > /proc/qdma/protect_mode
|
|
echo 1 128 100 > /proc/tc3162/protect_mode
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_CHS" != "" ] ;then
|
|
ponvlancmd enablemacvlan 11
|
|
fi
|
|
|
|
if [ "$TCSUPPORT_CPU_EN7521" = "" ] ;then
|
|
if [ "$TCSUPPORT_DYING_GASP_OPTIMIZATION" != "" ] ;then
|
|
insmod $KERNEL_DIR/dying_gasp.ko
|
|
fi
|
|
fi
|
|
|
|
# for zcfg_msg sock
|
|
mkdir -p /var/lib/.sock
|
|
chmod 713 /var/lib/.sock
|
|
#chmod 711 /var/lib/
|
|
|
|
#logrotate
|
|
#mkdir -m 755 -p /var/lib
|
|
|
|
#Zyxel, set and update module.dep before zcmd and zcfg_be
|
|
depmod
|
|
|
|
#Zyxel, in USB upload/download stress, it will cause system has low free-memory
|
|
#Prevent the low free-memory to cause system unstable
|
|
echo 7168 > /proc/sys/vm/min_free_kbytes
|
|
echo 4096 > /proc/net/skbmgr_4k_limit
|
|
echo 9216 > /proc/net/skbmgr_driver_max_skb
|
|
|
|
#ZyXEL, Chi-Hsiang enable ipv6 in zcmd
|
|
for i in /etc/rc3.d/S*; do
|
|
if [ -z ${i##*zcmd*} ]; then
|
|
echo 0 > /proc/sys/net/ipv6/conf/default/disable_ipv6
|
|
fi
|
|
$i start
|
|
done
|
|
|
|
# admin use ping
|
|
#test -e /bin/ping && chmod 4777 /bin/ping
|
|
|
|
#Enable zhttpd
|
|
#export LD_LIBRARY_PATH=/lib/public:/lib/private:/usr/lib:/lib:/usr/lib/ebtables:/usr/lib/iptables
|
|
#/bin/zhttpd &
|
|
|
|
#this must at the end of RCS----end
|