updates from whiterussian

SVN-Revision: 1504
This commit is contained in:
Mike Baker 2005-07-20 19:58:40 +00:00
parent 5ea9dc5f57
commit 6a4f0e2b54
7 changed files with 26 additions and 18 deletions

View File

@ -14,7 +14,7 @@ iptables -t nat -F postrouting_rule
### The "-i $WAN" literally means packets that came in over the $WAN interface; ### The "-i $WAN" literally means packets that came in over the $WAN interface;
### this WILL NOT MATCH packets sent from the LAN to the WAN address. ### this WILL NOT MATCH packets sent from the LAN to the WAN address.
### Allow SSH from WAN ### Allow SSH on the WAN interface
# iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 22 -j ACCEPT # iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport 22 -j ACCEPT
# iptables -A input_rule -i $WAN -p tcp --dport 22 -j ACCEPT # iptables -A input_rule -i $WAN -p tcp --dport 22 -j ACCEPT

View File

@ -16,7 +16,8 @@ touch /var/log/lastlog
# if they don't already exist # if they don't already exist
[ "$(nvram get boardtype)" = "bcm95365r" \ [ "$(nvram get boardtype)" = "bcm95365r" \
-a "$(nvram get boardnum)" = "45" \ -a "$(nvram get boardnum)" = "45" \
-a -z "$(nvram get vlan0ports)$(nvram get vlan1ports)" ] && { -a -z "$(nvram get vlan0ports)"
-a -z "$(nvram get vlan1ports)" ] && {
nvram set vlan0ports="1 2 3 4 5*" nvram set vlan0ports="1 2 3 4 5*"
nvram set vlan1ports="0 5" nvram set vlan1ports="0 5"
} }
@ -33,6 +34,6 @@ echo ${HOSTNAME:=OpenWrt}>/proc/sys/kernel/hostname
vconfig set_name_type VLAN_PLUS_VID_NO_PAD vconfig set_name_type VLAN_PLUS_VID_NO_PAD
# automagically run firstboot # automagically run firstboot
[ -z "$FAILSAFE" ] && { [ -z "$FAILSAFE" -a -z "$(nvram get no_root_swap)" ] && {
{ mount|grep "on / type jffs2" 1>&-; } || firstboot { mount|grep "on / type jffs2" 1>&-; } || firstboot
} }

View File

@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
## Please make changes in /etc/firewall.user ## Please make changes in /etc/firewall.user
${FAILSAFE:+exit}
. /etc/functions.sh . /etc/functions.sh
WAN=$(nvram get wan_ifname) WAN=$(nvram get wan_ifname)

View File

@ -1,8 +1,9 @@
#!/bin/sh #!/bin/sh
syslogd -C 16 syslog_ip=$(nvram get log_ipaddr)
ipcalc -s "$syslog_ip" || syslog_ip=""
syslogd -C 16 ${syslog_ip:+-L -R $syslog_ip}
klogd klogd
${FAILSAFE:+telnetd -l /bin/login; ifup lan; exit} #${FAILSAFE:+telnetd -l /bin/login; ifup lan; exit}
for i in /etc/init.d/S*; do for i in /etc/init.d/S*; do
$i start 2>&1 $i start 2>&1
done | logger -s -p 6 -t '' & done | logger -s -p 6 -t '' &

View File

@ -1,17 +1,18 @@
#!/bin/sh #!/bin/sh
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
mount none /proc -t proc mount none /proc -t proc
insmod diag insmod diag
echo 0x01 > /proc/sys/diag echo 0x01 > /proc/sys/diag
sleep 1 sleep 1
if [ $(cat /proc/sys/reset) = 1 ] || [ "$(/usr/sbin/nvram get failsafe)" = 1 ]; then if [ $(cat /proc/sys/reset) = 1 -o "$(nvram get failsafe)" = 1 ]; then
export FAILSAFE=true export FAILSAFE=true
[ "$(/usr/sbin/nvram get boot_wait)" != "on" ] && { [ "$(nvram get boot_wait)" != "on" ] && {
/usr/sbin/nvram set boot_wait=on nvram set boot_wait=on
/usr/sbin/nvram commit nvram commit
} }
while :; do { echo $(((X=(X+1)%8)%2)) > /proc/sys/diag; sleep $((X==0)); } done & while :; do { echo $(((X=(X+1)%8)%2)) > /proc/sys/diag; sleep $((X==0)); } done &
fi fi
/sbin/mount_root ${FAILSAFE:+failsafe} mount_root ${FAILSAFE:+failsafe}
exec /sbin/init exec /sbin/init

View File

@ -12,6 +12,9 @@ if_valid $if || exit
mac=$(nvram get ${type}_hwaddr) mac=$(nvram get ${type}_hwaddr)
$DEBUG ifconfig $if down 2>&- $DEBUG ifconfig $if down 2>&-
pidfile=/var/run/${if}.pid
[ -f $pidfile ] && $DEBUG kill $(cat $pidfile)
if [ "${if%%[0-9]}" = "br" ]; then if [ "${if%%[0-9]}" = "br" ]; then
stp=$(nvram get ${type}_stp) stp=$(nvram get ${type}_stp)
$DEBUG brctl delbr $if 2>&- $DEBUG brctl delbr $if 2>&-
@ -47,7 +50,6 @@ case "$if_proto" in
;; ;;
dhcp) dhcp)
ip=$(nvram get ${type}_ipaddr) ip=$(nvram get ${type}_ipaddr)
[ -f $pidfile ] && $DEBUG kill $(cat $pidfile)
${DEBUG:-eval} "udhcpc -R -i $if ${ip:+-r $ip} -b -p $pidfile &" ${DEBUG:-eval} "udhcpc -R -i $if ${ip:+-r $ip} -b -p $pidfile &"
;; ;;
none|"") none|"")

View File

@ -12,12 +12,14 @@ if [ "$1" != "failsafe" ]; then
mount -o remount,rw /dev/root / mount -o remount,rw /dev/root /
fi fi
else else
mtd unlock OpenWrt if [ -z "$(nvram get no_root_swap)" ]; then
mount -t jffs2 /dev/mtdblock/4 /jffs mtd unlock OpenWrt
pivot_root /jffs /jffs/rom mount -t jffs2 /dev/mtdblock/4 /jffs
mount none /proc -t proc pivot_root /jffs /jffs/rom
mount none /dev -t devfs mount none /proc -t proc
umount /rom/proc rom/dev >&- mount none /dev -t devfs
umount /rom/proc rom/dev >&-
fi
fi fi
fi fi
mount none /tmp -t tmpfs -o nosuid,nodev,mode=1777,size=50% mount none /tmp -t tmpfs -o nosuid,nodev,mode=1777,size=50%