299 lines
8.5 KiB
Bash
299 lines
8.5 KiB
Bash
#!/bin/sh
|
|
|
|
mount -a
|
|
mount -t sysfs /sys /sys
|
|
#mount -t proc /proc /proc
|
|
mount -t ramfs /tmp /tmp
|
|
mount -t ramfs /var /var
|
|
cp -a /usr/etc /tmp
|
|
|
|
/bin/mkdir -m 0777 -p /tmp/var/log
|
|
|
|
/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 /var/Wireless/RT2860AP
|
|
|
|
#for tpapp dropbear
|
|
/bin/mkdir -m 0777 -p /var/tmp/dropbear
|
|
|
|
#for the dirs of samba and ntfs-3g, zjj, 20111129
|
|
/bin/mkdir -m 0777 -p /var/usbdisk
|
|
/bin/mkdir -m 0777 -p /var/dev
|
|
/bin/mkdir -m 0777 -p /var/samba/lib
|
|
/bin/mkdir -m 0777 -p /var/samba/private
|
|
/bin/mkdir -m 0777 -p /var/samba/var/locks
|
|
cp -p /etc/passwd.bak /var/passwd
|
|
/bin/mkdir -m 0777 -p /var/3G
|
|
#end by zjj
|
|
|
|
|
|
#for the dirs of vdsl in 9980, wzy, 20130315
|
|
/bin/mkdir -m 0777 -p /var/xdsl_changeover
|
|
#end by wzy
|
|
|
|
#added by CCy for Vpn, 07Jul2015
|
|
/bin/mkdir -m 0777 -p /var/easy-rsa
|
|
/bin/mkdir -m 0777 -p /var/easy-rsa/keys
|
|
/bin/mkdir -m 0777 -p /var/openvpn
|
|
|
|
/bin/mkdir -m 0777 -p /var/pptpd
|
|
#add ended
|
|
|
|
#for https certificate
|
|
/bin/mkdir -m 0777 -p /var/https
|
|
|
|
echo 2 > /proc/sys/vm/overcommit_memory
|
|
echo 95 > /proc/sys/vm/overcommit_ratio
|
|
echo 250 > /proc/sys/vm/lowmem_reserve_ratio
|
|
echo 2 > /proc/sys/vm/dirty_background_ratio
|
|
echo 250 > /proc/sys/vm/dirty_writeback_centisecs
|
|
echo 10 > /proc/sys/vm/dirty_ratio
|
|
echo 16384 > /proc/sys/vm/max_map_count
|
|
echo 2 > /proc/sys/vm/page-cluster
|
|
echo 70 > /proc/sys/vm/swappiness
|
|
|
|
ulimit -s 2048
|
|
|
|
#for flash0
|
|
insmod /lib/modules/tp_board.ko
|
|
insmod /lib/modules/tp_gpio.ko
|
|
|
|
#read mac from flash to proc
|
|
flash0 -r 0x138f100 0x6 /proc/flash0_mac
|
|
|
|
echo "---- 7570_bob.conf ----"
|
|
cp -f /etc/7570_bob.conf /tmp/
|
|
/usr/bin/tppontool readflashtobobwithcheck
|
|
|
|
echo 30 > /proc/sys/net/unix/max_dgram_qlen
|
|
|
|
echo 1 > /proc/sys/net/ipv4/ip_forward
|
|
#echo 1 > /proc/sys/net/ipv4/tcp_syncookies
|
|
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
|
|
|
|
#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
|
|
|
|
echo 4096 > /proc/sys/net/netfilter/nf_conntrack_expect_max
|
|
#echo 5120 > /proc/sys/net/netfilter/nf_conntrack_max
|
|
|
|
echo 5120 > /proc/sys/vm/min_free_kbytes
|
|
#for lantiq dsl firmware, wzy, 20120331
|
|
#insmod /lib/modules/drv_ifxos.ko
|
|
#insmod /lib/modules/drv_dsl_cpe_api.ko debug_level=3
|
|
#end by wzy
|
|
|
|
insmod /lib/modules/module_sel.ko
|
|
|
|
# open TCSUPPORT_CT_VLAN_TAG
|
|
echo "---- modules: vlan tag ----"
|
|
insmod /lib/modules/vlantag_ct.ko
|
|
|
|
insmod /lib/modules/tcsmux.ko
|
|
|
|
# open TCSUPPORT_PORTBIND
|
|
echo "---- modules: port bind ----"
|
|
insmod /lib/modules/tcportbind.ko
|
|
|
|
insmod /lib/modules/tcledctrl.ko
|
|
|
|
insmod /lib/modules/tccicmd.ko
|
|
|
|
insmod /lib/modules/sif.ko
|
|
|
|
|
|
echo 1 > /proc/sys/kernel/core_uses_pid
|
|
echo "/var/core-%e-%p-%t" > /proc/sys/kernel/core_pattern
|
|
|
|
ulimit -c unlimited
|
|
|
|
insmod /lib/modules/kmdir/kernel/drivers/scsi/scsi_mod.ko
|
|
insmod /lib/modules/kmdir/kernel/drivers/scsi/sd_mod.ko
|
|
|
|
insmod /lib/modules/kmdir/kernel/drivers/usb/core/usbcore.ko
|
|
|
|
echo "---- modules: USB ----"
|
|
#for 3g-dongle, add by zjj, 20120521
|
|
mount -t usbfs usbfs /proc/bus/usb/
|
|
|
|
insmod /lib/modules/kmdir/kernel/drivers/usb/host/ehci-hcd.ko
|
|
insmod /lib/modules/kmdir/kernel/drivers/usb/host/ohci-hcd.ko
|
|
insmod /lib/modules/kmdir/kernel/drivers/usb/storage/usb-storage.ko
|
|
|
|
insmod /lib/modules/kmdir/kernel/drivers/scsi/scsi_wait_scan.ko
|
|
|
|
insmod /lib/modules/kmdir/kernel/drivers/usb/host/ifxusb_host.ko
|
|
|
|
|
|
#netfilter modules load
|
|
insmod /lib/modules/kmdir/kernel/net/netfilter/nf_conntrack_proto_gre.ko
|
|
insmod /lib/modules/kmdir/kernel/net/netfilter/nf_conntrack_pptp.ko
|
|
insmod /lib/modules/ipt_STAT.ko
|
|
insmod /lib/modules/tp_domain.ko
|
|
|
|
insmod /lib/modules/kmdir/kernel/net/ipv4/netfilter/ipt_REJECT.ko
|
|
insmod /lib/modules/kmdir/kernel/net/ipv4/netfilter/iptable_filter.ko
|
|
insmod /lib/modules/kmdir/kernel/net/ipv6/netfilter/ip6table_filter.ko
|
|
insmod /lib/modules/kmdir/kernel/net/ipv6/netfilter/ip6table_mangle.ko
|
|
|
|
insmod /lib/modules/kmdir/kernel/net/bridge/netfilter/ebtables.ko
|
|
insmod /lib/modules/kmdir/kernel/net/bridge/netfilter/ebtable_filter.ko
|
|
insmod /lib/modules/kmdir/kernel/net/bridge/netfilter/ebt_ip.ko
|
|
insmod /lib/modules/kmdir/kernel/net/bridge/netfilter/ebt_ip6.ko
|
|
insmod /lib/modules/kmdir/kernel/net/bridge/netfilter/ebtable_broute.ko
|
|
insmod /lib/modules/kmdir/kernel/net/bridge/netfilter/ebt_mark.ko
|
|
insmod /lib/modules/kmdir/kernel/net/bridge/netfilter/ebt_vlan.ko
|
|
insmod /lib/modules/kmdir/kernel/net/bridge/netfilter/ebt_ftos.ko
|
|
insmod /lib/modules/kmdir/kernel/net/bridge/netfilter/ebt_tpmark.ko
|
|
|
|
ln -s /lib/firmware/ap_upper_wave300.bin /tmp/ap_upper_wave300.bin
|
|
ln -s /lib/firmware/sta_upper_wave300.bin /tmp/sta_upper_wave300.bin
|
|
ln -s /lib/firmware/contr_lm.bin /tmp/contr_lm.bin
|
|
ln -s /lib/firmware/ProgModel_A_CB_38_RevA_wave300.bin /tmp/ProgModel_A_CB_38_RevA_wave300.bin
|
|
ln -s /lib/firmware/ProgModel_A_CB_wave300.bin /tmp/ProgModel_A_CB_wave300.bin
|
|
ln -s /lib/firmware/ProgModel_A_nCB_38_RevA_wave300.bin /tmp/ProgModel_A_nCB_38_RevA_wave300.bin
|
|
ln -s /lib/firmware/ProgModel_A_nCB_wave300.bin /tmp/ProgModel_A_nCB_wave300.bin
|
|
ln -s /lib/firmware/ProgModel_BG_CB_38_RevB_wave300.bin /tmp/ProgModel_BG_CB_38_RevB_wave300.bin
|
|
ln -s /lib/firmware/ProgModel_BG_CB_wave300.bin /tmp/ProgModel_BG_CB_wave300.bin
|
|
ln -s /lib/firmware/ProgModel_BG_nCB_38_RevB_wave300.bin /tmp/ProgModel_BG_nCB_38_RevB_wave300.bin
|
|
ln -s /lib/firmware/ProgModel_BG_nCB_wave300.bin /tmp/ProgModel_BG_nCB_wave300.bin
|
|
|
|
echo "---- start MTK config manager ----"
|
|
/userfs/bin/cfg_manager &
|
|
|
|
sleep 2
|
|
|
|
#for lan by renjun
|
|
echo "---- Initialize Lan ----"
|
|
insmod /lib/modules/fe_core.ko
|
|
insmod /lib/modules/qdma_lan.ko
|
|
|
|
insmod /lib/modules/eth.ko
|
|
insmod /lib/modules/eth_ephy.ko
|
|
|
|
# switch pon ralink
|
|
echo "---- insmod switch pon ----"
|
|
insmod /lib/modules/qdma_wan.ko
|
|
|
|
insmod /lib/modules/phy.ko
|
|
insmod /lib/modules/xpon.ko
|
|
|
|
# open TCSUPPORT_GPON_MAPPING
|
|
insmod /lib/modules/xponmap.ko
|
|
|
|
# for qos
|
|
insmod /lib/modules/swqos.ko
|
|
|
|
# for tr143
|
|
insmod /lib/modules/speedtest.ko
|
|
|
|
brctl addbr br0
|
|
ifconfig br0 192.168.1.1 up
|
|
|
|
brctl addif br0 eth0
|
|
|
|
ifconfig eth0 0.0.0.0 up
|
|
|
|
# network
|
|
echo "---- config network ----"
|
|
ifconfig lo 127.0.0.1 netmask 255.0.0.0
|
|
route add -net 127.0.0.0 netmask 255.0.0.0 lo
|
|
|
|
ifconfig pon up
|
|
ifconfig oam up
|
|
ifconfig omci up
|
|
|
|
# Should put below command before insmod ponvlan.ko
|
|
/userfs/bin/ethphxcmd eth0 vlanpt disable
|
|
echo 1 > /proc/tc3162/stag_to_vtag
|
|
/userfs/bin/ethphxcmd eth0 vlanpt enable
|
|
|
|
echo 8192 > /proc/self/net/skbmgr_driver_max_skb
|
|
echo 8192 > /proc/self/net/skbmgr_limit
|
|
echo 6144 > /proc/self/net/skbmgr_4k_limit
|
|
|
|
# open TCSUPPORT_RA_HWNAT
|
|
echo "---- insmod HW NAT ----"
|
|
insmod /lib/modules/hw_nat.ko
|
|
/userfs/bin/hw_nat -V 1
|
|
|
|
# open TCSUPPORT_PON_VLAN
|
|
echo "---- insmod pon vlan ----"
|
|
insmod /lib/modules/ponvlan.ko
|
|
|
|
# open TCSUPPORT_XPON_IGMP
|
|
echo "---- insmod pon igmp snooping ----"
|
|
insmod /lib/modules/xpon_igmp.ko
|
|
|
|
#open TCSUPPORT_PON_MAC_FILTER
|
|
echo "---- insmod pon mac filter ----"
|
|
insmod /lib/modules/ponmacfilter.ko
|
|
|
|
telnetd
|
|
cmmsyslogd &
|
|
#for download gphy_firmware, added by wzy
|
|
cat /firmware/gphy_image > /proc/driver/ifx_gphy/phyfirmware
|
|
#end added by wzy
|
|
# voip
|
|
echo "Insert VoIP Modules"
|
|
insmod /lib/modules/sys_mod.ko
|
|
insmod /lib/modules/DSPCore.ko
|
|
insmod /lib/modules/pcm1.ko
|
|
insmod /lib/modules/lec.ko
|
|
insmod /lib/modules/spi.ko
|
|
insmod /lib/modules/slic3.ko type=ZSI
|
|
insmod /lib/modules/fxs3.ko slic1=le9642 slic2=le9642
|
|
insmod /lib/modules/ksocket.ko
|
|
insmod /lib/modules/ortp.ko
|
|
insmod /lib/modules/acodec_x.ko
|
|
insmod /lib/modules/foip.ko
|
|
insmod /lib/modules/ovdsp.ko
|
|
insmod /lib/modules/pcmDump.ko
|
|
|
|
sleep 1
|
|
#keep voip on cpu 0,and change wifi,qdma to cpu 1 to solve cpu0 full problem
|
|
#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 8 > /proc/irq/12/smp_affinity
|
|
echo 8 > /proc/irq/22/smp_affinity
|
|
echo 1 > /proc/irq/23/smp_affinity
|
|
echo 8 > /proc/irq/24/smp_affinity
|
|
echo 8 > /proc/irq/25/smp_affinity
|
|
|
|
voip_server &
|
|
|
|
|
|
/userfs/bin/tcapi set System_Entry start_up 1
|
|
/userfs/bin/tcapi commit System_Entry &
|
|
|
|
echo "---- start our config center ----"
|
|
cos &
|
|
|
|
# disable GPIO 7 & 9 multiplex use
|
|
/bin/echo 7 0 > /proc/tc3162/gpio_iomux_ctrl
|
|
/bin/echo 9 0 > /proc/tc3162/gpio_iomux_ctrl
|
|
|
|
#limit wan rx rate for cpu0 protecting,no affect to the accelerated entries's throughput.
|
|
/userfs/bin/qdmamgr_wan set rxratelimit config enable packet
|
|
/userfs/bin/qdmamgr_wan set rxratelimit value 0 4000
|
|
|
|
#while true;do
|
|
#echo 3 > /proc/sys/vm/drop_caches
|
|
#sleep 1
|
|
#done &
|
|
|
|
#sleep 5
|
|
#echo "Klog Module Starting..."
|
|
#klogd &
|
|
|