Changeset 7669240 in freewrt
- Timestamp:
- Sep 23, 2006, 10:30:38 PM (19 years ago)
- Branches:
- freewrt_1_0, freewrt_2_0
- Children:
- 0543ddc
- Parents:
- a3f04e0
- Files:
-
- 5 added
- 8 edited
- 3 moved
-
package/base-files/default/etc/functions.sh (modified) (1 diff)
-
package/base-files/default/etc/version (added)
-
package/busybox/Makefile (modified) (2 diffs)
-
package/busybox/files/network.init (added)
-
package/busybox/ipkg/busybox.postinst (modified) (1 diff)
-
package/webif/Config.in (modified) (1 diff)
-
package/webif/Makefile (modified) (1 diff)
-
package/webif/files/dnsmasq.conf (added)
-
package/webif/files/dnsmasq.init (added)
-
package/webif/files/ifdown (moved) (moved from package/base-files/default/sbin/ifdown ) (1 diff)
-
package/webif/files/ifup (moved) (moved from package/base-files/default/sbin/ifup ) (1 diff)
-
package/webif/files/network-nvram.sh (added)
-
package/webif/files/network.init (moved) (moved from package/base-files/default/etc/init.d/S40network ) (1 diff)
-
package/webif/files/usr/lib/webif/apply.sh (modified) (2 diffs)
-
package/webif/files/usr/lib/webif/webif.sh (modified) (1 diff)
-
target/Config.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
package/base-files/default/etc/functions.sh
ra3f04e0 r7669240 1 alias debug=${DEBUG:-:}2 3 # valid interface?4 if_valid() (5 ifconfig "$1" >&- 2>&- ||6 [ "${1%%[0-9]}" = br ] || {7 [ "${1%%[0-9]}" = vlan ] && (8 i=${1#vlan}9 hwname=$(nvram get vlan${i}hwname)10 hwaddr=$(nvram get ${hwname}macaddr)11 [ -z "$hwaddr" ] && return 112 13 vif=$(ifconfig -a | awk \14 '/^eth.*'$hwaddr'/ {print $1; exit}' IGNORECASE=1)15 debug "# vlan$i => $vif"16 17 $DEBUG ifconfig $vif up18 $DEBUG vconfig add $vif $i 2>&-19 )20 } || { debug "# missing interface '$1' ignored"; false; }21 )22 23 do_ifup() {24 if_proto=$(nvram get ${2}_proto)25 if=$(nvram get ${2}_ifname)26 [ "${if%%[0-9]}" = ppp ] && if=$(nvram get ${2}_device)27 28 pidfile=/var/run/${if}.pid29 [ -f $pidfile ] && $DEBUG kill $(<$pidfile)30 31 case $1 in32 static)33 ip=$(nvram get ${2}_ipaddr)34 netmask=$(nvram get ${2}_netmask)35 gateway=$(nvram get ${2}_gateway)36 mtu=$(nvram get ${2}_mtu)37 static_route=$(nvram get ${2}_static_route)38 39 $DEBUG ifconfig $if $ip ${netmask:+netmask $netmask} ${mtu:+mtu $(($mtu))} broadcast + up40 ${gateway:+$DEBUG route add default gw $gateway}41 42 [ -n "$static_route" ] && for route in $static_route; do43 eval "set $(echo $route | sed 's/:/ /g')"44 [ "$2" = "255.255.255.255" ] && opt=-host45 $DEBUG route add ${opt:-"-net"} $1 netmask $2 gw $3 metric $446 done47 48 [ -f /etc/resolv.conf ] || {49 debug "# --- creating /etc/resolv.conf ---"50 for dns in $(nvram get ${2}_dns); do51 echo "nameserver $dns" >>/etc/resolv.conf52 done53 }54 55 env -i ACTION=ifup INTERFACE="${2}" PROTO=static /sbin/hotplug iface &56 ;;57 dhcp)58 DHCP_IP=$(nvram get ${2}_ipaddr)59 DHCP_NETMASK=$(nvram get ${2}_netmask)60 mtu=$(nvram get ${2}_mtu)61 $DEBUG ifconfig $if $ip ${netmask:+netmask $netmask} ${mtu:+mtu $(($mtu))} broadcast + up62 63 DHCP_ARGS="-i $if ${DHCP_IP:+-r $DHCP_IP} -b -p $pidfile"64 DHCP_HOSTNAME=$(nvram get ${2}_hostname)65 DHCP_HOSTNAME=${DHCP_HOSTNAME%%.*}66 [ -z $DHCP_HOSTNAME ] || DHCP_ARGS="$DHCP_ARGS -H $DHCP_HOSTNAME"67 [ "$if_proto" = pptp ] && DHCP_ARGS="$DHCP_ARGS -n -q" || DHCP_ARGS="$DHCP_ARGS -R &"68 [ -r $pidfile ] && oldpid=$(<$pidfile)69 ${DEBUG:-eval} "udhcpc $DHCP_ARGS"70 [ -n "$oldpid" ] && pidof udhcpc | grep "$oldpid" >&- 2>&- && {71 sleep 172 kill -9 $oldpid73 }74 # hotplug events are handled by /usr/share/udhcpc/default.script75 ;;76 none|"")77 ;;78 *)79 [ -x "/sbin/ifup.$1" ] && { $DEBUG /sbin/ifup.$1 ${2}; exit; }80 echo "### ifup ${2}: ignored ${2}_proto=\"$1\" (not supported)"81 ;;82 esac83 }84 85 1 load_modules() { 86 2 sed 's/^[^#]/insmod &/' $* | ash 2>&- || : -
package/busybox/Makefile
ra3f04e0 r7669240 8 8 9 9 PKG_NAME:= busybox 10 PKG_RELEASE:= 310 PKG_RELEASE:= 4 11 11 PKG_VERSION:= 1.1.3 12 12 PKG_MD5SUM:= 19a0b475169335f17e421cf644616fe7 … … 34 34 EXTRA_CFLAGS="$(TARGET_CFLAGS)" -C $(WRKBUILD) install 35 35 $(INSTALL_DIR) $(IDIR_BUSYBOX)/etc/init.d/ 36 $(INSTALL_BIN) ./files/network.init \ 37 $(IDIR_BUSYBOX)/etc/init.d/S40network 36 38 $(INSTALL_BIN) ./files/crond.init \ 37 39 $(IDIR_BUSYBOX)/etc/init.d/S$(PKG_INIT)crond 40 $(INSTALL_DIR) $(IDIR_BUSYBOX)/etc/network 41 $(INSTALL_DIR) $(IDIR_BUSYBOX)/etc/network/if-pre-up.d 42 $(INSTALL_DIR) $(IDIR_BUSYBOX)/etc/network/if-pre-down.d 43 $(INSTALL_DIR) $(IDIR_BUSYBOX)/etc/network/if-post-up.d 44 $(INSTALL_DIR) $(IDIR_BUSYBOX)/etc/network/if-post-down.d 38 45 $(RSTRIP) $(IDIR_BUSYBOX) 39 46 $(IPKG_BUILD) $(IDIR_BUSYBOX) $(PACKAGE_DIR) -
package/busybox/ipkg/busybox.postinst
ra3f04e0 r7669240 1 1 #!/bin/sh 2 2 . $IPKG_INSTROOT/etc/functions.sh 3 add_rcconf network network YES 3 4 add_rcconf crond crond NO 4 5 -
package/webif/Config.in
ra3f04e0 r7669240 3 3 tristate 4 4 select FWRT_PACKAGE_HASERL 5 select FWRT_PACKAGE_BRIDGE_UTILS 6 select FWRT_PACKAGE_IPTABLES 7 select FWRT_PACKAGE_DNSMASQ 5 8 default n 6 9 help 7 A web interface for configuring FreeWRT 10 A web interface for configuring FreeWRT as wireless router. 8 11 -
package/webif/Makefile
ra3f04e0 r7669240 30 30 $(IPKG_WEBIF): 31 31 cd files; pax -rw www usr $(IDIR_WEBIF)/ 32 install -d $(IDIR_WEBIF)/usr/bin 33 install -m0755 $(WRKBUILD)/webif-page $(IDIR_WEBIF)/usr/bin/webif-page 34 install -m0755 $(WRKBUILD)/bstrip $(IDIR_WEBIF)/usr/bin/bstrip 32 $(INSTALL_DIR) $(IDIR_WEBIF)/usr/bin 33 $(INSTALL_DIR) $(IDIR_WEBIF)/sbin 34 $(INSTALL_BIN) $(WRKBUILD)/webif-page $(IDIR_WEBIF)/usr/bin/webif-page 35 $(INSTALL_BIN) $(WRKBUILD)/bstrip $(IDIR_WEBIF)/usr/bin/bstrip 36 $(INSTALL_BIN) ./files/ifup $(IDIR_WEBIF)/sbin/ifup.nvram 37 $(INSTALL_BIN) ./files/ifdown $(IDIR_WEBIF)/sbin/ifdown.nvram 35 38 ln -sf /www/index.html $(IDIR_WEBIF)/www/index.asp 36 install -d $(IDIR_WEBIF)/etc/init.d 37 install -m0755 ./files/httpd.init $(IDIR_WEBIF)/etc/init.d/S50httpd 39 $(INSTALL_DIR) $(IDIR_WEBIF)/etc/init.d 40 $(INSTALL_BIN) ./files/httpd.init $(IDIR_WEBIF)/etc/init.d/S50httpd-webif 41 $(INSTALL_BIN) ./files/network.init $(IDIR_WEBIF)/etc/init.d/S40net-webif 42 $(INSTALL_BIN) ./files/dnsmasq.init $(IDIR_WEBIF)/etc/init.d/S50dns-webif 43 $(INSTALL_DATA) ./files/dnsmasq.conf $(IDIR_WEBIF)/etc/dnsmasq.conf-webif 44 $(INSTALL_DATA) ./files/network-nvram.sh $(IDIR_WEBIF)/etc/ 38 45 find $(IDIR_WEBIF) -name CVS -o -name .svn | xargs rm -rf 39 46 $(IPKG_BUILD) $(IDIR_WEBIF) $(PACKAGE_DIR) -
package/webif/files/ifdown
ra3f04e0 r7669240 1 1 #!/bin/sh 2 2 [ $# = 0 ] && { echo " $0 <group>"; exit; } 3 . /etc/ functions.sh3 . /etc/network-nvram.sh 4 4 5 5 type=$1 -
package/webif/files/ifup
ra3f04e0 r7669240 1 1 #!/bin/ash 2 2 [ $# = 0 ] && { echo " $0 <group>"; exit; } 3 . /etc/ functions.sh3 . /etc/network-nvram.sh 4 4 type=$1 5 5 debug "### ifup $type ###" -
package/webif/files/network.init
ra3f04e0 r7669240 5 5 ifup_interfaces=${ifup_interfaces:-"lan wan wifi"} 6 6 for iface in $ifup_interfaces; do 7 ifup $iface7 ifup.nvram $iface 8 8 [ "$iface" = wifi ] && wifi up 9 9 done -
package/webif/files/usr/lib/webif/apply.sh
ra3f04e0 r7669240 20 20 echo '@TR<<Reloading>> @TR<<networking settings>> ...' 21 21 egrep '^w?wan_' config-network >&- 2>&- && { 22 ifdown wan23 ifup wan22 ifdown.nvram wan 23 ifup.nvram wan 24 24 killall -HUP dnsmasq 25 25 } 26 26 27 27 grep '^lan_' config-network >&- 2>&- && { 28 ifdown lan29 ifup lan28 ifdown.nvram lan 29 ifup.nvram lan 30 30 killall dnsmasq 31 /etc/init.d/S??dnsmasq 31 /etc/init.d/S??dnsmasq-webif 32 32 } 33 33 } … … 38 38 ( 39 39 /sbin/wifi 40 [ -f /etc/init.d/S4 1wpa ] && /etc/init.d/S41wpa40 [ -f /etc/init.d/S49nas ] && /etc/init.d/S49nas 41 41 ) >&- 2>&- <&- 42 42 } -
package/webif/files/usr/lib/webif/webif.sh
ra3f04e0 r7669240 65 65 _uptime="${_uptime%%,*}" 66 66 _hostname=$(cat /proc/sys/kernel/hostname) 67 _version=$( grep "(" /etc/banner ) 68 _version="${_version%% ---*}" 67 _version=$(cat /etc/version) 69 68 _head="${3:+<div class=\"settings-block-title\"><h2>$3$_saved_title</h2></div>}" 70 69 _form="${5:+<form enctype=\"multipart/form-data\" action=\"$5\" method=\"post\"><input type=\"hidden\" name=\"submit\" value=\"1\" />}" -
target/Config.in
ra3f04e0 r7669240 20 20 Build firmware images with a writable jffs2 root filesystem. 21 21 22 config FWRT_TARGET_ROOTFS_SQUASHFS_SYMLINKS 23 bool "Firmware image with read-only root filesystem and symlinks" 24 select FWRT_PACKAGE_JFFS2ROOT 25 help 26 Build firmware images with a read-only and highly compressed 27 (squashfs with lzma compression) root filesystem. 28 Startup scripts will create symlinks to the writable jffs2 portion. 29 If you want to change anything, first remove the symlink then edit 30 the file. 31 22 32 config FWRT_TARGET_ROOTFS_SQUASHFS_OVERLAY 23 33 bool "Firmware image with read-only root filesystem and overlay fs"
Note:
See TracChangeset
for help on using the changeset viewer.
