diff options
author | Felix Fietkau <nbd@openwrt.org> | 2006-11-22 23:30:57 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2006-11-22 23:30:57 +0000 |
commit | fbef19a70d0471c30c8535c17c88d8618cd3a6b9 (patch) | |
tree | b34e972b2aa8e22dc921b0b9967d811e7525e3bc /package/base-files/default/sbin | |
parent | 0cbe723631eed7e541483592d16b6d125c846674 (diff) | |
download | upstream-fbef19a70d0471c30c8535c17c88d8618cd3a6b9.tar.gz upstream-fbef19a70d0471c30c8535c17c88d8618cd3a6b9.tar.bz2 upstream-fbef19a70d0471c30c8535c17c88d8618cd3a6b9.zip |
rename default/ to files/
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5622 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/default/sbin')
-rwxr-xr-x | package/base-files/default/sbin/hotplug | 26 | ||||
-rwxr-xr-x | package/base-files/default/sbin/ifdown | 55 | ||||
-rwxr-xr-x | package/base-files/default/sbin/ifup | 11 | ||||
-rwxr-xr-x | package/base-files/default/sbin/mount_root | 10 | ||||
-rwxr-xr-x | package/base-files/default/sbin/wifi | 116 |
5 files changed, 0 insertions, 218 deletions
diff --git a/package/base-files/default/sbin/hotplug b/package/base-files/default/sbin/hotplug deleted file mode 100755 index b1b6f97b23..0000000000 --- a/package/base-files/default/sbin/hotplug +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# Copyright (C) 2006 OpenWrt.org - -# bypass the normal hotplug path for firmware loading -# would otherwise cause problems with drivers like bcm43xx -[ "$1" = "firmware" -a "$ACTION" = "add" ] && { - [ -f "/lib/firmware/$FIRMWARE" ] && { - echo 1 > "/sys$DEVPATH/loading" - cp "/lib/firmware/$FIRMWARE" "/sys$DEVPATH/data" - echo 0 > "/sys$DEVPATH/loading" - } - exit 0 -} - -. /etc/functions.sh - -PATH=/bin:/sbin:/usr/bin:/usr/sbin -LOGNAME=root -USER=root -export PATH LOGNAME USER - -[ \! -z "$1" -a -d /etc/hotplug.d/$1 ] && { - for script in $(ls /etc/hotplug.d/$1/* 2>&-); do ( - [ -f $script ] && . $script - ); done -} diff --git a/package/base-files/default/sbin/ifdown b/package/base-files/default/sbin/ifdown deleted file mode 100755 index 26d0e626d2..0000000000 --- a/package/base-files/default/sbin/ifdown +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# Copyright (C) 2006 OpenWrt.org - -[ $# = 0 ] && { echo " $0 <group>"; exit; } -. /etc/functions.sh -include /lib/network -scan_interfaces - -cfg=$1 -debug "### ifdown $cfg ###" - -config_get proto "$cfg" proto -[ -z "$proto" ] && { echo "interface not found."; exit; } - -config_get iface "$cfg" device -[ "$proto" = "static" ] && { - env -i ACTION="ifdown" INTERFACE="$config" DEVICE="$iface" PROTO=static /sbin/hotplug "iface" & -} - -# call interface stop handler -( type "stop_interface_$proto" ) >/dev/null 2>/dev/null && eval "stop_interface_$proto '$cfg'" - -# make sure all locks are removed -for lock in "/var/lock/dhcp-$iface" "/var/lock/ppp-$iface"; do - [ -f "$lock" ] && { - lock -u "$lock" - sleep 1 - } -done - -# kill active ppp daemon and other processes -config_get ifname "$cfg" ifname -pids="$(head -n1 -q /var/run/${ifname}.pid /var/run/ppp-${cfg}.pid 2>/dev/null)" -for pid in $pids; do - [ -d "/proc/$pid" ] && { - kill $pid - [ -d "/proc/$pid" ] && { - sleep 1 - kill -9 $pid 2>/dev/null >/dev/null - } - } -done -rm -f /var/run/${ifname}.pid /var/run/ppp-${cfg}.pid - -config_get ifname "$cfg" ifname -config_get device "$cfg" ifname - -[ ."$device" != ."$ifname" ] || device= -for dev in $ifname $device; do - ifconfig "$ifname" 0.0.0.0 down >/dev/null 2>/dev/null -done - -config_get iftype "$cfg" type -[ "$iftype" = "bridge" ] && brctl delbr "$ifname" >/dev/null 2>/dev/null - diff --git a/package/base-files/default/sbin/ifup b/package/base-files/default/sbin/ifup deleted file mode 100755 index 81ec2c0890..0000000000 --- a/package/base-files/default/sbin/ifup +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -# Copyright (C) 2006 OpenWrt.org - -. /sbin/ifdown "$@" - -config_get iftype "$1" type -config_get ifname "$1" device - -for dev in $ifname; do - setup_interface "$dev" "$1" -done diff --git a/package/base-files/default/sbin/mount_root b/package/base-files/default/sbin/mount_root deleted file mode 100755 index 81660f0067..0000000000 --- a/package/base-files/default/sbin/mount_root +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# Copyright (C) 2006 OpenWrt.org - -mount none /proc -t proc -size=$(awk '/Mem:/ {l=5242880;print((s=$2/2)<l)?$2-l:s}' /proc/meminfo) -mount none /tmp -t tmpfs -o size=$size,nosuid,nodev,mode=1777 -mkdir -p /dev/pts -mount none /dev/pts -t devpts -mount -t sysfs none /sys 2>&- -mount -o remount,rw /dev/root / diff --git a/package/base-files/default/sbin/wifi b/package/base-files/default/sbin/wifi deleted file mode 100755 index d877c73980..0000000000 --- a/package/base-files/default/sbin/wifi +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh -# Copyright (C) 2006 OpenWrt.org - -. /etc/functions.sh - -find_net_config() {( - local vif="$1" - local cfg - local ifname - - config_get cfg "$vif" network - - [ -z "$cfg" ] && { - include /lib/network - scan_interfaces - - config_get ifname "$vif" ifnamea - - cfg="$(find_config "$ifname")" - } - [ -z "$cfg" ] && return 0 - echo "$cfg" -)} - - -bridge_interface() {( - local cfg="$1" - [ -z "$cfg" ] && return 0 - - include /lib/network - scan_interfaces - - config_get iftype "$cfg" type - [ "$iftype" = bridge ] && config_get "$cfg" ifname -)} - - -wifi_up() { - for device in ${2:-$DEVICES}; do ( - config_get iftype "$device" type - if eval "type enable_$iftype" 2>/dev/null >/dev/null; then - eval "scan_$iftype '$device'" - eval "enable_$iftype '$device'" || echo "$device($iftype): Setup failed" - else - echo "$device($iftype): Interface type not supported" - fi - ); done -} - -wifi_down() { - for device in ${2:-$DEVICES}; do ( - config_get iftype "$device" type - if eval "type disable_$iftype" 2>/dev/null >/dev/null; then - eval "scan_$iftype '$device'" - eval "disable_$iftype '$device'" || echo "$device($iftype): Disable failed" - else - echo "$device($iftype): Interface type not supported" - fi - ); done -} - -wifi_detect() { - for driver in ${2:-$DRIVERS}; do ( - if eval "type detect_$driver" 2>/dev/null >/dev/null; then - eval "detect_$driver" || echo "$driver: Detect failed" >&2 - else - echo "$driver: Hardware detection not supported" >&2 - fi - ); done -} - -start_net() {( - local iface="$1" - local config="$2" - - include /lib/network - scan_interfaces - setup_interface "$1" "$2" -)} - -config_get_bool() { - local _tmp - config_get "$1" "$2" "$3" - eval "_tmp=\$$1" - case "$_tmp" in - 1|on|enabled) eval "$1=1";; - 0|off|disabled) eval "$1=0";; - *) eval "$1=${4:-0}";; - esac -} - -config_cb() { - config_get TYPE "$CONFIG_SECTION" TYPE - case "$TYPE" in - wifi-device) - append DEVICES "$CONFIG_SECTION" - ;; - wifi-iface) - config_get device "$CONFIG_SECTION" device - config_get vifs "$device" vifs - append vifs "$CONFIG_SECTION" - config_set "$device" vifs "$vifs" - ;; - esac -} - -DEVICES= -DRIVERS= -config_load wireless -include /lib/wifi - -case "$1" in - down) wifi_down "$2";; - detect) wifi_detect "$2";; - *) wifi_up "$2";; -esac |