1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

openwrt root filesystem

git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@211 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
mbm
2005-02-06 00:52:16 +00:00
parent 4aba84e6f0
commit c31ac521e4
21 changed files with 1516 additions and 165 deletions

View File

@@ -0,0 +1,25 @@
#!/bin/sh
klogd
syslogd -C 16
sysctl -p
echo "S" > /proc/jffs2_bbc
mkdir -p /var/run
[ "$(nvram get il0macaddr)" = "00:90:4c:5f:00:2a" ] && {
# if default wifi mac, set two higher than the lan mac
nvram set il0macaddr=$(nvram get et0macaddr|
awk '{OFS=FS=":";for(x=7,y=2;--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)
HOSTNAME=${HOSTNAME%%.*}
echo ${HOSTNAME:=OpenWrt} > /proc/sys/kernel/hostname
vconfig set_name_type VLAN_PLUS_VID_NO_PAD

View File

@@ -1,35 +1,15 @@
#!/bin/sh
#
# Start the network....
#
start() {
echo "Starting network..."
/sbin/ifup -a
}
stop() {
echo -n "Stopping network..."
/sbin/ifdown -a
}
restart() {
stop
start
}
. /etc/functions.sh
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
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')"
$DEBUG route add -net $1 netmask $2 gw $3 metric $4 dev $5
} done
;;
esac
exit $?

View File

@@ -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

View File

@@ -0,0 +1,2 @@
#!/bin/sh
/usr/sbin/dnsmasq

View File

@@ -0,0 +1,2 @@
#!/bin/sh
/usr/sbin/httpd -p 80 -h /www -r WRT54G Router

View File

@@ -0,0 +1,2 @@
#!/bin/sh
/usr/sbin/telnetd -l /bin/login

View File

@@ -0,0 +1,7 @@
#!/bin/sh
# automagically run firstboot
[ -z "$FAILSAFE" ] && {
{ mount | grep jffs2 1>&-; } || firstboot
}
# set leds to normal state
echo "0x00" > /proc/sys/diag

View File

@@ -1,6 +1,5 @@
#!/bin/sh
# Start all init scripts in /etc/init.d
# executing them in numerical order.
#
@@ -10,18 +9,17 @@ for i in /etc/init.d/S??* ;do
[ ! -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
;;
*.sh)
# Source shell script for speed.
(
trap - INT QUIT TSTP
set start
. $i
)
;;
*)
# No sh extension, so fork subprocess.
$i start
;;
esac
done