diff options
author | mbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2004-08-12 05:47:00 +0000 |
---|---|---|
committer | mbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2004-08-12 05:47:00 +0000 |
commit | 512afda668386575e4d146d22161ca3afa3af728 (patch) | |
tree | 705b07b306a36c583e1d7e3f62dc6701bfd04118 /obsolete-buildroot/sources/openwrt/root/etc | |
parent | 58baf5ad434854d7d3326fa31bf2978b3cede26d (diff) |
moved.
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@134 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'obsolete-buildroot/sources/openwrt/root/etc')
15 files changed, 244 insertions, 0 deletions
diff --git a/obsolete-buildroot/sources/openwrt/root/etc/banner b/obsolete-buildroot/sources/openwrt/root/etc/banner new file mode 100644 index 000000000..2b2b2c015 --- /dev/null +++ b/obsolete-buildroot/sources/openwrt/root/etc/banner @@ -0,0 +1,6 @@ + _______ ________ __ + | |.-----.-----.-----.| | | |.----.| |_ + | - || _ | -__| || | | || _|| _| + |_______|| __|_____|__|__||________||__| |____| + |__| W I R E L E S S F R E E D O M + diff --git a/obsolete-buildroot/sources/openwrt/root/etc/dnsmasq.conf b/obsolete-buildroot/sources/openwrt/root/etc/dnsmasq.conf new file mode 100644 index 000000000..2c6c40452 --- /dev/null +++ b/obsolete-buildroot/sources/openwrt/root/etc/dnsmasq.conf @@ -0,0 +1,22 @@ +# filter what we send upstream +domain-needed +bogus-priv +filterwin2k + +# allow /etc/hosts and dhcp lookups via *.lan +local=/lan/ +domain=lan + +# no dhcp / dns queries from the wan +except-interface=vlan1 + +# enable dhcp (start,end,netmask,leasetime) +dhcp-range=192.168.1.100,192.168.1.250,255.255.255.0,12h +dhcp-leasefile=/tmp/dhcp.leases + +# allow a /etc/ethers for static hosts +read-ethers + +# other useful options: +# default route(s): dhcp-option=3,192.168.1.1,192.168.1.2 +# dns server(s): dhcp-option=6,192.168.1.1,192.168.1.2 diff --git a/obsolete-buildroot/sources/openwrt/root/etc/functions.sh b/obsolete-buildroot/sources/openwrt/root/etc/functions.sh new file mode 100755 index 000000000..79db1dad3 --- /dev/null +++ b/obsolete-buildroot/sources/openwrt/root/etc/functions.sh @@ -0,0 +1,26 @@ +#!/bin/ash + +alias debug=${DEBUG:-:} + +# allow env to override nvram +nvram_get () { + eval "echo \${$1:-\$(nvram get $1)}" +} +. /etc/nvram.overrides + +# valid interface? +if_valid () ( + [ "${1%%[0-9]}" = "vlan" ] && { + i=${1#vlan} + hwname=$(nvram_get vlan${i}hwname) + hwaddr=$(nvram_get ${hwname}macaddr) + [ -z "$hwaddr" ] && return 1 + + vif=$(ifconfig -a | awk '/^eth.*'$hwaddr'/ {print $1; exit}' IGNORECASE=1) + debug "# vlan$i: $hwname $hwaddr => $vif" + + $DEBUG ifconfig $vif up + $DEBUG vconfig add $vif $i 2>/dev/null + } + ifconfig "$1" >/dev/null 2>&1 || [ "${1%%[0-9]}" = "br" ] +) diff --git a/obsolete-buildroot/sources/openwrt/root/etc/init.d/S10boot b/obsolete-buildroot/sources/openwrt/root/etc/init.d/S10boot new file mode 100755 index 000000000..11bc31b1b --- /dev/null +++ b/obsolete-buildroot/sources/openwrt/root/etc/init.d/S10boot @@ -0,0 +1,27 @@ +#!/bin/sh +sysctl -p +echo "S" > /proc/jffs2_bbc + +mkdir -p /var/run + +# networking stub +[ "$(nvram get il0macaddr)" = "00:90:4c:5f:00:2a" ] && { + # force unique wireless mac + nvram set il0macaddr=$(nvram get et0macaddr| + awk '{OFS=FS=":";for(x=6,y=2;x;x--){$x=sprintf("%02x",(y+="0x"$x)%256);y/=256}print}') +} + +insmod et +insmod wl + +ifconfig lo 127.0.0.1 up +ifconfig eth0 promisc + +HOSTNAME=$(nvram get wan_hostname) +DOMAINNAME=${HOSTNAME##*.} +HOSTNAME=${HOSTNAME%%.*} + +echo ${HOSTNAME:=OpenWrt} > /proc/sys/kernel/hostname +echo ${DOMAINNAME:=lan} > /proc/sys/kernel/domainname + +vconfig set_name_type VLAN_PLUS_VID_NO_PAD diff --git a/obsolete-buildroot/sources/openwrt/root/etc/init.d/S40network b/obsolete-buildroot/sources/openwrt/root/etc/init.d/S40network new file mode 100755 index 000000000..5a6ca725b --- /dev/null +++ b/obsolete-buildroot/sources/openwrt/root/etc/init.d/S40network @@ -0,0 +1,15 @@ +#!/bin/sh +. /etc/functions.sh +case "$1" in + start|restart) + ifup lan + ifup wan + ifup wifi + wifi up + + for route in $(nvram_get static_route); do { + eval "set $(echo $route | sed 's/:/ /g')" + route add -net $1 netmask $2 gw $3 metric $4 dev $5 + } done + ;; +esac diff --git a/obsolete-buildroot/sources/openwrt/root/etc/init.d/S45firewall b/obsolete-buildroot/sources/openwrt/root/etc/init.d/S45firewall new file mode 100755 index 000000000..4885c7c08 --- /dev/null +++ b/obsolete-buildroot/sources/openwrt/root/etc/init.d/S45firewall @@ -0,0 +1,23 @@ +#!/bin/sh +. /etc/functions.sh + +WAN=$(nvram_get wan_ifname) + +IPT=/usr/sbin/iptables + +for T in filter nat mangle ; do + $IPT -t $T -F + $IPT -t $T -X +done + +$IPT -t filter -A INPUT -m state --state INVALID -j DROP +$IPT -t filter -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT +$IPT -t filter -A INPUT -p icmp -j ACCEPT +$IPT -t filter -A INPUT -i $WAN -p tcp -j REJECT --reject-with tcp-reset +$IPT -t filter -A INPUT -i $WAN -j REJECT --reject-with icmp-port-unreachable +$IPT -t filter -A FORWARD -m state --state INVALID -j DROP +$IPT -t filter -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT +$IPT -t filter -A FORWARD -i $WAN -m state --state NEW,INVALID -j DROP +$IPT -t filter -A FORWARD -o $WAN -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu + +$IPT -t nat -A POSTROUTING -o $WAN -j MASQUERADE diff --git a/obsolete-buildroot/sources/openwrt/root/etc/init.d/S50services b/obsolete-buildroot/sources/openwrt/root/etc/init.d/S50services new file mode 100755 index 000000000..bdd1102f9 --- /dev/null +++ b/obsolete-buildroot/sources/openwrt/root/etc/init.d/S50services @@ -0,0 +1,4 @@ +#!/bin/sh +/usr/sbin/telnetd -l /bin/login +/usr/sbin/httpd -p 80 -h /www -r WRT54G Router +/usr/sbin/dnsmasq diff --git a/obsolete-buildroot/sources/openwrt/root/etc/init.d/S99done b/obsolete-buildroot/sources/openwrt/root/etc/init.d/S99done new file mode 100755 index 000000000..73a4da468 --- /dev/null +++ b/obsolete-buildroot/sources/openwrt/root/etc/init.d/S99done @@ -0,0 +1,6 @@ +#!/bin/sh +[ -z "$FAILSAFE" ] && { + { mount | grep jffs2 1>&-; } || firstboot +} +# turn off DMZ led +echo "0x00" > /proc/sys/diag diff --git a/obsolete-buildroot/sources/openwrt/root/etc/init.d/rcS b/obsolete-buildroot/sources/openwrt/root/etc/init.d/rcS new file mode 100755 index 000000000..9510e941a --- /dev/null +++ b/obsolete-buildroot/sources/openwrt/root/etc/init.d/rcS @@ -0,0 +1,25 @@ +#!/bin/sh + +# Start all init scripts in /etc/init.d +# executing them in numerical order. +# +for i in /etc/init.d/S??* ;do + + # Ignore dangling symlinks (if any). + [ ! -f "$i" ] && continue + + case "$i" in + *.sh) + # Source shell script for speed. + ( + trap - INT QUIT TSTP + set start + . $i + ) + ;; + *) + # No sh extension, so fork subprocess. + $i start + ;; + esac +done diff --git a/obsolete-buildroot/sources/openwrt/root/etc/inittab b/obsolete-buildroot/sources/openwrt/root/etc/inittab new file mode 100644 index 000000000..9943a9002 --- /dev/null +++ b/obsolete-buildroot/sources/openwrt/root/etc/inittab @@ -0,0 +1,3 @@ +::sysinit:/etc/init.d/rcS +::shutdown:/sbin/halt +::respawn:/bin/login diff --git a/obsolete-buildroot/sources/openwrt/root/etc/ipkg.conf b/obsolete-buildroot/sources/openwrt/root/etc/ipkg.conf new file mode 100644 index 000000000..c3581d790 --- /dev/null +++ b/obsolete-buildroot/sources/openwrt/root/etc/ipkg.conf @@ -0,0 +1,3 @@ +src openwrt http://openwrt.ksilebo.net/ipkg +dest root / +dest ram /tmp diff --git a/obsolete-buildroot/sources/openwrt/root/etc/nvram.overrides b/obsolete-buildroot/sources/openwrt/root/etc/nvram.overrides new file mode 100644 index 000000000..e334d7519 --- /dev/null +++ b/obsolete-buildroot/sources/openwrt/root/etc/nvram.overrides @@ -0,0 +1,52 @@ +# NVRAM overrides +# This file handles the NVRAM quirks of various hardware +# this is not a replacement for nvram. + +# linksys bug has lan doing dhcp; force static +lan_proto="static" + +# failsafe if reset is held +[ "$FAILSAFE" = "true" ] && { + echo "### FAILSAFE MODE ####" + lan_ifname="br0" + lan_ifnames="vlan0 vlan2 eth1 eth2 eth3" + lan_ipaddr="192.168.1.1" + lan_netmask="255.255.255.0" + lan_hwaddr="00:0B:AD:0A:DD:00" + wan_ifname="none" + wifi_ifname="none" +} + +# hacks for 1.x hardware +[ "$(nvram get boardnum)" = "42" ] && \ +[ "$(nvram get boardtype)" = "bcm94710dev" ] && { + debug "### 1.x hardware hack ###" + vlan1hwname="et0" + vlan2hwname="et0" + + # we remap old device names to new + # it's recommended that you continue to + # use the old names to preserve backwards + # compatibility + remap () { + eval $1=\"$(nvram_get $1 | awk 'gsub("eth0","vlan2") gsub("eth1","vlan1")')\" + } + + remap lan_ifname + remap lan_ifnames + remap wifi_ifname + remap wifi_ifnames + remap wan_ifname + remap wan_ifnames + remap pppoe_ifname +} + +[ -z "$(nvram_get lan_ifname)" ] && { + lan_ifname="br0" + lan_ifnames="vlan0 vlan2 eth1 eth2 eth3" +} + +[ -z "$(nvram_get wan_ifname)" ] && { + wan_ifname="vlan1" + wan_proto="dhcp" +} diff --git a/obsolete-buildroot/sources/openwrt/root/etc/preinit b/obsolete-buildroot/sources/openwrt/root/etc/preinit new file mode 100755 index 000000000..1054282e8 --- /dev/null +++ b/obsolete-buildroot/sources/openwrt/root/etc/preinit @@ -0,0 +1,17 @@ +#!/bin/sh +mount none /proc -t proc +insmod diag +echo 0x01 > /proc/sys/diag +sleep 1 +if /sbin/resetmon ; then + mtd unlock mtd4 + mount -t jffs2 /dev/mtdblock/4 /jffs + pivot_root /jffs /jffs/rom + mount none /dev -t devfs + mount none /proc -t proc + umount rom/proc rom/dev +else + export FAILSAFE=true +fi +mount none /tmp -t ramfs +exec /sbin/init diff --git a/obsolete-buildroot/sources/openwrt/root/etc/profile b/obsolete-buildroot/sources/openwrt/root/etc/profile new file mode 100644 index 000000000..68adf5471 --- /dev/null +++ b/obsolete-buildroot/sources/openwrt/root/etc/profile @@ -0,0 +1,8 @@ +#!/bin/sh +[ -f /etc/banner ] && cat /etc/banner + +export PATH=/bin:/sbin:/usr/bin:/usr/sbin +export PS1='\u@\h:\w\$ ' + +alias less='more' +alias vim='vi' diff --git a/obsolete-buildroot/sources/openwrt/root/etc/sysctl.conf b/obsolete-buildroot/sources/openwrt/root/etc/sysctl.conf new file mode 100644 index 000000000..8552a4ba3 --- /dev/null +++ b/obsolete-buildroot/sources/openwrt/root/etc/sysctl.conf @@ -0,0 +1,7 @@ +kernel.panic = 3 +net.ipv4.ip_forward = 1 +net.ipv4.icmp_echo_ignore_broadcasts = 1 +net.ipv4.icmp_ignore_bogus_error_responses = 1 +net.ipv4.tcp_fin_timeout = 30 +net.ipv4.tcp_keepalive_time = 120 +net.ipv4.tcp_timestamps = 0 |