diff options
Diffstat (limited to 'package/base-files/default/etc')
24 files changed, 509 insertions, 0 deletions
diff --git a/package/base-files/default/etc/banner b/package/base-files/default/etc/banner new file mode 100644 index 0000000..c2fbc12 --- /dev/null +++ b/package/base-files/default/etc/banner @@ -0,0 +1,10 @@ + _______ ________ __ + | |.-----.-----.-----.| | | |.----.| |_ + | - || _ | -__| || | | || _|| _| + |_______|| __|_____|__|__||________||__| |____| + |__| W I R E L E S S F R E E D O M + KAMIKAZE (bleeding edge, $R) ------------------- + * 10 oz Vodka Shake well with ice and strain + * 10 oz Triple sec mixture into 10 shot glasses. + * 10 oz lime juice Salute! + --------------------------------------------------- diff --git a/package/base-files/default/etc/config/network b/package/base-files/default/etc/config/network new file mode 100644 index 0000000..1d5ded3 --- /dev/null +++ b/package/base-files/default/etc/config/network @@ -0,0 +1,13 @@ +# Copyright (C) 2006 OpenWrt.org + +config interface loopback + option ifname lo + option proto static + option ipaddr 127.0.0.1 + option netmask 255.0.0.0 + +config interface lan + option ifname eth0 + option proto static + option ipaddr 192.168.1.1 + option netmask 255.255.255.0 diff --git a/package/base-files/default/etc/functions.sh b/package/base-files/default/etc/functions.sh new file mode 100755 index 0000000..9c3057e --- /dev/null +++ b/package/base-files/default/etc/functions.sh @@ -0,0 +1,119 @@ +#!/bin/sh +# Copyright (C) 2006 OpenWrt.org +# Copyright (C) 2006 Fokus Fraunhofer <carsten.tittel@fokus.fraunhofer.de> + +alias debug=${DEBUG:-:} + +# newline +N=" +" + +_C=0 + +# valid interface? +if_valid () ( + ifconfig "$1" >&- 2>&- || + [ "${1%%[0-9]}" = "br" ] || + { debug "# missing interface '$1' ignored"; false; } +) + +hotplug_dev() { + env -i ACTION=$1 INTERFACE=$2 /sbin/hotplug net +} + +append() { + local var="$1" + local value="$2" + local sep="${3:- }" + eval "export ${var}=\"\${${var}:+\${${var}}${value:+$sep}}\$value\"" +} + +reset_cb() { + config_cb() { + return 0 + } + option_cb() { + return 0 + } +} +reset_cb + +config () { + local cfgtype="$1" + local name="$2" + _C=$(($_C + 1)) + name="${name:-cfg${_C}}" + config_cb "$cfgtype" "$name" + export CONFIG_SECTION="$name" + export CONFIG_${CONFIG_SECTION}_TYPE="$cfgtype" +} + +option () { + local varname="$1"; shift + export CONFIG_${CONFIG_SECTION}_${varname}="$*" + option_cb "$varname" "$*" +} + +config_rename() { + local OLD="$1" + local NEW="$2" + local oldsetting + local newvar + + [ -z "$OLD" -o -z "$NEW" ] && return + for oldsetting in `set | grep ^CONFIG_${OLD}_ | \ + sed -e 's/\(.*\)=.*$/\1/'` ; do + newvar="CONFIG_${NEW}_${oldsetting##CONFIG_${OLD}_}" + eval "${newvar}=\${$oldsetting}" + unset "$oldsetting" + done + [ "$CONFIG_SECTION" = "$OLD" ] && CONFIG_SECTION="$NEW" +} + +config_unset() { + config_set "$1" "$2" "" +} + +config_clear() { + [ -z "$CONFIG_SECTION" ] && return + for oldsetting in `set | grep ^CONFIG_${CONFIG_SECTION}_ | \ + sed -e 's/\(.*\)=.*$/\1/'` ; do + unset $oldsetting + done + unset CONFIG_SECTION +} + +config_load() { + local DIR="./" + _C=0 + [ \! -e "$1" -a -e "/etc/config/$1" ] && { + DIR="/etc/config/" + } + [ -e "$DIR$1" ] && { + CONFIG_FILENAME="$DIR$1" + . ${CONFIG_FILENAME} + } || return 1 + ${CD:+cd -} >/dev/null + ${CONFIG_SECTION:+config_cb} +} + +config_get() { + case "$3" in + "") eval "echo \"\${CONFIG_${1}_${2}}\"";; + *) eval "$1=\"\${CONFIG_${2}_${3}}\"";; + esac +} + +config_set() { + export CONFIG_${1}_${2}="${3}" +} + +load_modules() { + sed 's/^[^#]/insmod &/' $* | ash 2>&- || : +} + +include() { + for file in $(ls $1/*.sh 2>/dev/null); do + . $file + done +} diff --git a/package/base-files/default/etc/group b/package/base-files/default/etc/group new file mode 100644 index 0000000..c4e77f3 --- /dev/null +++ b/package/base-files/default/etc/group @@ -0,0 +1,2 @@ +root:x:0: +nogroup:x:65534: diff --git a/package/base-files/default/etc/hosts b/package/base-files/default/etc/hosts new file mode 100644 index 0000000..ce138ec --- /dev/null +++ b/package/base-files/default/etc/hosts @@ -0,0 +1 @@ +127.0.0.1 localhost OpenWrt diff --git a/package/base-files/default/etc/hotplug.d/block/01-mount b/package/base-files/default/etc/hotplug.d/block/01-mount new file mode 100755 index 0000000..b6275e5 --- /dev/null +++ b/package/base-files/default/etc/hotplug.d/block/01-mount @@ -0,0 +1,26 @@ +#!/bin/sh +# Copyright (C) 2006 OpenWrt.org + +DEV=${DEVPATH##*/} +{ +echo "ACTION=$ACTION DEVPATH=$DEVPATH $0 $*" +case "$ACTION" in +add) + echo -ne "waiting for $DEV" + while [ ! -b /dev/$DEV ]; do { + echo -ne "." + sleep 1 + time=$((time+1)); [ $time -gt 10 ] && break + }; done + + [ ${DEV%%[0-9]} != ${DEV} ] && { + mkdir -p /tmp/$DEV + mount /dev/$DEV /tmp/$DEV -t auto -o sync + } + ;; +remove) + umount /tmp/$DEV + rm -rf /dev/$DEV /tmp/$DEV + ;; +esac +} 2>&1 | logger diff --git a/package/base-files/default/etc/hotplug.d/net/10-net b/package/base-files/default/etc/hotplug.d/net/10-net new file mode 100644 index 0000000..4e5c304 --- /dev/null +++ b/package/base-files/default/etc/hotplug.d/net/10-net @@ -0,0 +1,28 @@ +# Copyright (C) 2006 OpenWrt.org + +include /lib/network + +addif() { + scan_interfaces + setup_interface "$INTERFACE" + + # find all vlan configurations for this interface and set them up as well + for ifc in $interfaces; do + config_get iftype "$ifc" type + config_get ifs "$ifc" device + for dev in $ifs; do + [ "${dev%%\.*}" = "$INTERFACE" -a "$dev" != "$INTERFACE" ] && { + add_vlan "$dev" + } + done + done +} + +case "$ACTION" in + add|register) + case "$PHYSDEVDRIVER" in + natsemi) sleep 1;; + esac + addif + ;; +esac diff --git a/package/base-files/default/etc/hotplug.d/usb/01-ln b/package/base-files/default/etc/hotplug.d/usb/01-ln new file mode 100755 index 0000000..f9eda02 --- /dev/null +++ b/package/base-files/default/etc/hotplug.d/usb/01-ln @@ -0,0 +1,33 @@ +#!/bin/sh +# Copyright (C) 2006 OpenWrt.org + +case "$ACTION" in +add) + [ -f /sys/${DEVPATH}/idVendor -a "$(cat /sys/${DEVPATH}/idVendor)" -ne "0000" ] && { + cd /sys/${DEVPATH} + + NUM=${DEVPATH##*/} + HOST=$(find ${NUM}:*/host* -type d) + HOST=${HOST##*/host} + + echo -ne "waiting for disk" + + while [ ! -d "/dev/scsi/host${HOST}/bus0/target0/lun0" ]; do { + echo -ne "." + sleep 1; + time=$((time+1)); [ $time -gt 10 ] && break + }; done + echo + + cd /sys/bus/scsi/devices/${HOST}\:0\:0\:0 + for BLOCK in block:* ; do { + cd ${BLOCK} + BLOCK=${BLOCK##block\:} + ln -sf /dev/scsi/host${HOST}/bus0/target0/lun0/disc /dev/${BLOCK} + for DEV in ${BLOCK}*; do { + ln -sf /dev/scsi/host${HOST}/bus0/target0/lun0/part${DEV##$BLOCK} /dev/$DEV + }; done + }; done + } 2>&1 | logger + ;; +esac diff --git a/package/base-files/default/etc/init.d/S10boot b/package/base-files/default/etc/init.d/S10boot new file mode 100755 index 0000000..77b5ca7 --- /dev/null +++ b/package/base-files/default/etc/init.d/S10boot @@ -0,0 +1,25 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org + +start() { + [ -f /proc/mounts ] || /sbin/mount_root + [ -f /proc/jffs2_bbc ] && echo "S" > /proc/jffs2_bbc + vconfig set_name_type DEV_PLUS_VID_NO_PAD + + HOSTNAME=${wan_hostname%%.*} + echo ${HOSTNAME:=OpenWrt}>/proc/sys/kernel/hostname + + mkdir -p /var/run + mkdir -p /var/log + mkdir -p /var/lock + touch /var/log/wtmp + touch /var/log/lastlog + [ "$FAILSAFE" = "true" ] && touch /tmp/.failsafe + + # manually trigger hotplug before loading modules + for iface in $(awk -F: '/:/ {print $1}' /proc/net/dev); do + /usr/bin/env -i ACTION=add INTERFACE="$iface" /sbin/hotplug net + done + + load_modules /etc/modules /etc/modules.d/* +} diff --git a/package/base-files/default/etc/init.d/S40network b/package/base-files/default/etc/init.d/S40network new file mode 100755 index 0000000..be04504 --- /dev/null +++ b/package/base-files/default/etc/init.d/S40network @@ -0,0 +1,11 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org + +start() { + setup_switch() { return 0; } + + include /lib/network + setup_switch + /sbin/wifi +} + diff --git a/package/base-files/default/etc/init.d/S50httpd b/package/base-files/default/etc/init.d/S50httpd new file mode 100755 index 0000000..a05b10c --- /dev/null +++ b/package/base-files/default/etc/init.d/S50httpd @@ -0,0 +1,10 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org + +start() { + [ -d /www ] && httpd -p 80 -h /www -r OpenWrt +} + +stop() { + killall httpd +} diff --git a/package/base-files/default/etc/init.d/S50telnet b/package/base-files/default/etc/init.d/S50telnet new file mode 100755 index 0000000..228eac2 --- /dev/null +++ b/package/base-files/default/etc/init.d/S50telnet @@ -0,0 +1,10 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org + +start() { + if awk -F: '/^root:/ && $2 !~ /\!/ {exit 1}' /etc/passwd 2>/dev/null; then telnetd -l /bin/login; fi +} + +stop() { + killall telnetd +} diff --git a/package/base-files/default/etc/init.d/S60cron b/package/base-files/default/etc/init.d/S60cron new file mode 100755 index 0000000..a450c36 --- /dev/null +++ b/package/base-files/default/etc/init.d/S60cron @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org + +start () { + mkdir -p /var/spool/cron + ln -s /etc/crontabs /var/spool/cron/crontabs + crond -c /etc/crontabs +} + +stop() { + killall crond +} diff --git a/package/base-files/default/etc/init.d/rcS b/package/base-files/default/etc/init.d/rcS new file mode 100755 index 0000000..7fae7f5 --- /dev/null +++ b/package/base-files/default/etc/init.d/rcS @@ -0,0 +1,26 @@ +#!/bin/sh +# Copyright (C) 2006 OpenWrt.org + +${FAILSAFE:+exit} + +# FIXME: add logging configuration +#[ -f /etc/config/network ] && . /etc/config/network +#eval $(ipcalc "$log_ipaddr") +#[ "$log_ipaddr" = "$IP" ] || log_ipaddr="" +syslogd -C 16 #${log_ipaddr:+-L -R $log_ipaddr} +klogd + +( + for i in /etc/init.d/S*; do + $i start 2>&1 + done + + sysctl -p >&- + + # automagically run firstboot + { mount|grep "on / type tmpfs" 1>&-; } && { + lock /tmp/.switch2jffs + firstboot switch2jffs + lock -u /tmp/.switch2jffs + } +) | logger -s -p 6 -t '' & diff --git a/package/base-files/default/etc/inittab b/package/base-files/default/etc/inittab new file mode 100644 index 0000000..39e134c --- /dev/null +++ b/package/base-files/default/etc/inittab @@ -0,0 +1,3 @@ +::sysinit:/etc/init.d/rcS +tts/0::askfirst:/bin/ash --login +#tts/1::askfirst:/bin/ash --login diff --git a/package/base-files/default/etc/ipkg.conf b/package/base-files/default/etc/ipkg.conf new file mode 100644 index 0000000..2931d2c --- /dev/null +++ b/package/base-files/default/etc/ipkg.conf @@ -0,0 +1,3 @@ +src snapshots http://openwrt.org/downloads/snapshots/$S/packages +dest root / +dest ram /tmp diff --git a/package/base-files/default/etc/nvram.sh b/package/base-files/default/etc/nvram.sh new file mode 100644 index 0000000..ddbd88b --- /dev/null +++ b/package/base-files/default/etc/nvram.sh @@ -0,0 +1,19 @@ +#!/bin/ash +# Copyright (C) 2006 OpenWrt.org + + +# allow env to override nvram +nvram () { + if [ -x /usr/sbin/nvram ]; then + case $1 in + get) eval "echo \${$2:-\$(/usr/sbin/nvram get $2)}";; + *) /usr/sbin/nvram $*;; + esac + else + case $1 in + get) eval "echo \${$2:-\${DEFAULT_$2}}";; + *);; + esac + fi +} + diff --git a/package/base-files/default/etc/passwd b/package/base-files/default/etc/passwd new file mode 100644 index 0000000..3b660a0 --- /dev/null +++ b/package/base-files/default/etc/passwd @@ -0,0 +1,2 @@ +root:!:0:0:root:/tmp:/bin/ash +nobody:*:65534:65534:nobody:/var:/bin/false diff --git a/package/base-files/default/etc/profile b/package/base-files/default/etc/profile new file mode 100644 index 0000000..ae514b0 --- /dev/null +++ b/package/base-files/default/etc/profile @@ -0,0 +1,12 @@ +#!/bin/sh +[ -f /etc/banner ] && cat /etc/banner + +export PATH=/bin:/sbin:/usr/bin:/usr/sbin +export PS1='\u@\h:\w\$ ' + +alias more=less +[ -x /usr/bin/vim ] || alias vim=vi + +arp() { cat /proc/net/arp; } +ldd() { LD_TRACE_LOADED_OBJECTS=1 $*; } +reboot() { ifdown wan 2>&1 >/dev/null ; /sbin/reboot; } diff --git a/package/base-files/default/etc/protocols b/package/base-files/default/etc/protocols new file mode 100644 index 0000000..53fecb6 --- /dev/null +++ b/package/base-files/default/etc/protocols @@ -0,0 +1,56 @@ +# Internet (IP) protocols +# +# Updated from http://www.iana.org/assignments/protocol-numbers and other +# sources. +# New protocols will be added on request if they have been officially +# assigned by IANA and are not historical. +# If you need a huge list of used numbers please install the nmap package. + +ip 0 IP # internet protocol, pseudo protocol number +#hopopt 0 HOPOPT # IPv6 Hop-by-Hop Option [RFC1883] +icmp 1 ICMP # internet control message protocol +igmp 2 IGMP # Internet Group Management +ggp 3 GGP # gateway-gateway protocol +ipencap 4 IP-ENCAP # IP encapsulated in IP (officially ``IP'') +st 5 ST # ST datagram mode +tcp 6 TCP # transmission control protocol +egp 8 EGP # exterior gateway protocol +igp 9 IGP # any private interior gateway (Cisco) +pup 12 PUP # PARC universal packet protocol +udp 17 UDP # user datagram protocol +hmp 20 HMP # host monitoring protocol +xns-idp 22 XNS-IDP # Xerox NS IDP +rdp 27 RDP # "reliable datagram" protocol +iso-tp4 29 ISO-TP4 # ISO Transport Protocol class 4 [RFC905] +xtp 36 XTP # Xpress Transfer Protocol +ddp 37 DDP # Datagram Delivery Protocol +idpr-cmtp 38 IDPR-CMTP # IDPR Control Message Transport +ipv6 41 IPv6 # Internet Protocol, version 6 +ipv6-route 43 IPv6-Route # Routing Header for IPv6 +ipv6-frag 44 IPv6-Frag # Fragment Header for IPv6 +idrp 45 IDRP # Inter-Domain Routing Protocol +rsvp 46 RSVP # Reservation Protocol +gre 47 GRE # General Routing Encapsulation +esp 50 IPSEC-ESP # Encap Security Payload [RFC2046] +ah 51 IPSEC-AH # Authentication Header [RFC2402] +skip 57 SKIP # SKIP +ipv6-icmp 58 IPv6-ICMP # ICMP for IPv6 +ipv6-nonxt 59 IPv6-NoNxt # No Next Header for IPv6 +ipv6-opts 60 IPv6-Opts # Destination Options for IPv6 +rspf 73 RSPF CPHB # Radio Shortest Path First (officially CPHB) +vmtp 81 VMTP # Versatile Message Transport +eigrp 88 EIGRP # Enhanced Interior Routing Protocol (Cisco) +ospf 89 OSPFIGP # Open Shortest Path First IGP +ax.25 93 AX.25 # AX.25 frames +ipip 94 IPIP # IP-within-IP Encapsulation Protocol +etherip 97 ETHERIP # Ethernet-within-IP Encapsulation [RFC3378] +encap 98 ENCAP # Yet Another IP encapsulation [RFC1241] +# 99 # any private encryption scheme +pim 103 PIM # Protocol Independent Multicast +ipcomp 108 IPCOMP # IP Payload Compression Protocol +vrrp 112 VRRP # Virtual Router Redundancy Protocol +l2tp 115 L2TP # Layer Two Tunneling Protocol [RFC2661] +isis 124 ISIS # IS-IS over IPv4 +sctp 132 SCTP # Stream Control Transmission Protocol +fc 133 FC # Fibre Channel + diff --git a/package/base-files/default/etc/rc.common b/package/base-files/default/etc/rc.common new file mode 100755 index 0000000..20d1efa --- /dev/null +++ b/package/base-files/default/etc/rc.common @@ -0,0 +1,73 @@ +#!/bin/sh +. /etc/functions.sh + +start() { + return 0 +} + +stop() { + return 0 +} + +reload() { + return 1 +} + +restart() { + stop + start +} + +boot() { + start +} + +shutdown() { + return 0 +} + +disable() { + rm -f /etc/rc.d/${initscript##*/} +} + +enable() { + disable + ln -s /etc/init.d/${initscript##*/} /etc/rc.d/${initscript##*/} +} + +depends() { + return 0 +} + +help() { + cat <<EOF +Syntax: $initscript [command] + +Available commands: + start Start the service + stop Stop the service + restart Restart the service + reload Reload configuration files (or restart if that fails) +$EXTRA_HELP +EOF +} + +initscript="$1" +action="$2" + +. "$initscript" + +cmds= +for cmd in $EXTRA_COMMANDS; do + cmds="$cmd) $cmd;;" +done +eval "case \"\$action\" in + start) start;; + stop) stop;; + reload) reload || restart;; + restart) restart;; + boot) boot;; + shutdown) shutdown;; + $cmds + *) help;; +esac" diff --git a/package/base-files/default/etc/resolv.conf b/package/base-files/default/etc/resolv.conf new file mode 100644 index 0000000..9617eac --- /dev/null +++ b/package/base-files/default/etc/resolv.conf @@ -0,0 +1,2 @@ +nameserver 127.0.0.1 +search lan diff --git a/package/base-files/default/etc/shells b/package/base-files/default/etc/shells new file mode 100644 index 0000000..006aa38 --- /dev/null +++ b/package/base-files/default/etc/shells @@ -0,0 +1 @@ +/bin/ash diff --git a/package/base-files/default/etc/sysctl.conf b/package/base-files/default/etc/sysctl.conf new file mode 100644 index 0000000..e60038c --- /dev/null +++ b/package/base-files/default/etc/sysctl.conf @@ -0,0 +1,12 @@ +kernel.panic=3 +net.ipv4.conf.default.arp_ignore=1 +net.ipv4.conf.all.arp_ignore=1 +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_syncookies=1 +net.ipv4.tcp_timestamps=0 +net.ipv4.ip_conntrack_tcp_timeouts="300 43200 120 60 120 120 10 60 30 120" +net.ipv4.ip_conntrack_udp_timeouts="60 180" |