From 195eba806279ebfe643e076704e02aa54bff99a8 Mon Sep 17 00:00:00 2001 From: Christian Heim Date: Tue, 2 May 2006 14:37:46 +0000 Subject: Merging baselayout r2022 for branches/rc-scripts_1_6, branches/baselayout-1_12 and trunk svn path=/baselayout-vserver/trunk/; revision=350 --- ChangeLog | 24 ++++++++++++++++++++++++ etc/conf.d/rc | 11 +++++------ net-scripts/conf.d/net.example | 2 +- net-scripts/net/iwconfig.sh | 4 ++-- net-scripts/net/wpa_supplicant.sh | 34 ++++++++++++++++++---------------- sbin/functions.sh | 4 ++-- sbin/runscript.sh | 5 +++-- 7 files changed, 55 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 62c405e..660f318 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,30 @@ Give a better error message when no valid DHCP client is installed. + 02 May 2006; Roy Marples : + + RC_COLDPLUG is now a pure pattern list which defaults to "*" + +* baselayout-1.12.0_pre19 (02 May 2006) + + 01 May 2006; Roy Marples : + + /proc/net/wireless may not have whitespace after $iface: + wpa_supplicant no longer requires ctrl_interface set. + Thanks to kelmo for those ideas. + + 28 Apr 2006; Mike Frysinger : + + Tweak is_older_than than so it skips checking the timestamps on directories, + just the files in the directory. + + Rewrite modules-update to make it readable and usuable without old modutils. + + 24 Apr 2006; Roy Marples : + + revert the -k2 addition to sort in halt.sh as we only echo the second + key to sort, #131001. + * baselayout-1.12.0_pre18 (22 Apr 2006) 22 Apr 2006; Mike Frysinger : diff --git a/etc/conf.d/rc b/etc/conf.d/rc index 875fd11..49b5b19 100644 --- a/etc/conf.d/rc +++ b/etc/conf.d/rc @@ -12,14 +12,13 @@ RC_PARALLEL_STARTUP="no" # Dynamic /dev managers can trigger coldplug events which cause services to # start before we are ready for them. If this happens, we can defer these -# services to start in the boot runlevel. If you don't want this then set -# RC_COLDPLUG to no. -# For more fine grained control you can list full service names to allow -# them to coldplug and prefix them with ! so they don't coldplug. -# Example - RC_COLDPLUG="net.wlan !net.*" +# services to start in the boot runlevel. RC_COLDPLUG is a list of services we +# allow to be coldplugged in this way. Globbing is allowed as is prefixing +# with ! which means don't coldplug. +# Example - RC_COLDPLUG="net.wlan !net.* *" # This allows net.wlan and any service not matching net.* to coldplug. -RC_COLDPLUG="yes" +RC_COLDPLUG="*" # RC_NET_STRICT_CHECKING allows some flexibility with the 'net' service. # The following values are allowed: diff --git a/net-scripts/conf.d/net.example b/net-scripts/conf.d/net.example index f103905..2d62a18 100644 --- a/net-scripts/conf.d/net.example +++ b/net-scripts/conf.d/net.example @@ -156,7 +156,7 @@ # To choose wpa_supplicant over iwconfig #modules=( "wpa_supplicant" ) # To configure wpa_supplicant -#wpa_supplicant_eth0="-Dprism54" # For Prism54 based cards +#wpa_supplicant_eth0="-Dwext" # For generic wireless #wpa_supplicant_ath0="-Dmadwifi" # For Atheros based cards # Consult wpa_supplicant for more drivers # By default don't wait for wpa_suppliant to associate and authenticate. diff --git a/net-scripts/net/iwconfig.sh b/net-scripts/net/iwconfig.sh index 6cca973..f3b1206 100644 --- a/net-scripts/net/iwconfig.sh +++ b/net-scripts/net/iwconfig.sh @@ -60,7 +60,7 @@ iwconfig_check_installed() { # Checks to see if wireless extensions are enabled on the interface iwconfig_exists() { [[ ! -e /proc/net/wireless ]] && return 1 - grep -q "^[ \t]*$1:[ \t]" /proc/net/wireless + grep -q "^[ \t]*$1:" /proc/net/wireless } # char* iwconfig_get_wep_status(char *interface) @@ -349,7 +349,7 @@ iwconfig_associate() { ESSIDVAR="$( bash_variable "${ESSID}" )" key="$( iwconfig_get_wep_key "${mac}" )" if [[ ${wep_required} == "on" && ${key} == "off" ]]; then - eerror "WEP key is not set for \"${dessid}\" - not connecting" + ewarn "WEP key is not set for \"${dessid}\" - not connecting" return 1 fi if [[ ${wep_required} == "off" && ${key} != "off" ]]; then diff --git a/net-scripts/net/wpa_supplicant.sh b/net-scripts/net/wpa_supplicant.sh index 1f54548..4ecff2d 100644 --- a/net-scripts/net/wpa_supplicant.sh +++ b/net-scripts/net/wpa_supplicant.sh @@ -9,7 +9,11 @@ wpa_supplicant() { } wpa_cli() { - LC_ALL=C /bin/wpa_cli "$@" + if [[ -n ${ctrl_dir} ]] ; then + LC_ALL=C /bin/wpa_cli -p "${ctrl_dir}" "$@" + else + LC_ALL=C /bin/wpa_cli "$@" + fi } # void wpa_supplicant_depend(void) @@ -53,7 +57,7 @@ wpa_supplicant_check_installed() { # Checks to see if wireless extensions are enabled on the interface wpa_supplicant_exists() { [[ ! -e /proc/net/wireless ]] && return 1 - grep -q "^[ \t]*$1:[ \t]" /proc/net/wireless + grep -q "^[ \t]*$1:" /proc/net/wireless } # char* wpa_supplicant_get_essid(char *interface) @@ -131,14 +135,6 @@ wpa_supplicant_kill() { start-stop-daemon --stop --exec /sbin/wpa_supplicant \ --pidfile "${pidfile}" ${report} && eend "$?" - else - # Support wpa_supplicant-0.3.x - local pid="$( pgrep -f "^/sbin/wpa_supplicant .* -i${iface}[ ]*$" )" - if [[ -n ${pid} ]] ; then - ${report} && ebegin "Stopping wpa_supplicant on ${iface}" - kill -s TERM "${pid}" - ${report} && eend 0 - fi fi # If wpa_supplicant exits uncleanly, we need to remove the stale dir @@ -278,13 +274,19 @@ wpa_supplicant_pre_start() { return 1 fi + # Work out where the ctrl_interface dir is if it's not specified local ctrl_dir="$( sed -n -e 's/[ \t]*#.*//g;s/[ \t]*$//g;s/^ctrl_interface=//p' "${cfgfile}" )" - if [[ ${ctrl_dir} != "/var/run/wpa_supplicant" ]] ; then - eerror "${cfgfile} must set" - eerror " ctrl_interface=/var/run/wpa_supplicant" - eend 1 - return 1 + if [[ -z ${ctrl_dir} ]] ; then + ctrl_dir="${opts##* -C}" + if [[ -n ${ctrl_dir} && ${ctrl_dir} != "${opts}" ]] ; then + [[ ${ctrl_dir:0:1} == " " ]] && ctrl_dir="${ctrl_dir# *}" + ctrl_dir="${ctrl_dir%% *}" + else + ctrl_dir="/var/run/wpa_supplicant" + opts="${opts} -C${ctrl_dir}" + fi fi + save_options ctrl_dir "${ctrl_dir}" # Some drivers require the interface to be up interface_up "${iface}" @@ -314,7 +316,7 @@ wpa_supplicant_pre_start() { ebegin "Starting wpa_cli on ${iface}" start-stop-daemon --start --exec /bin/wpa_cli \ --pidfile "/var/run/wpa_cli-${iface}.pid" \ - -- -a"${actfile}" -i"${iface}" \ + -- -a"${actfile}" -p"${ctrl_dir}" -i"${iface}" \ -P"/var/run/wpa_cli-${iface}.pid" -B eend "$?" || return 1 fi diff --git a/sbin/functions.sh b/sbin/functions.sh index e8d2d4e..423ada6 100755 --- a/sbin/functions.sh +++ b/sbin/functions.sh @@ -610,10 +610,10 @@ is_older_than() { shift for x in "$@" ; do - [[ ${x} -nt "${ref}" ]] && return 0 - if [[ -d ${x} ]] ; then is_older_than "${ref}" "${x}"/* && return 0 + elif [[ ${x} -nt ${ref} ]] ; then + return 0 fi done diff --git a/sbin/runscript.sh b/sbin/runscript.sh index 9614529..a54ff67 100755 --- a/sbin/runscript.sh +++ b/sbin/runscript.sh @@ -27,13 +27,14 @@ myservice="${SVCNAME}" # until after rc sysinit has completed so we punt them to the boot runlevel if [[ -e /dev/.rcsysinit ]] ; then eerror "ERROR: cannot run ${SVCNAME} until sysinit completes" - [[ ${RC_COLDPLUG} == "no" ]] && exit 1 - if [[ ${RC_COLDPLUG} != "yes" ]] ; then + [[ "${RC_COLDPLUG} " == "!* "* ]] && exit 1 + if [[ "${RC_COLDPLUG} " != "* "* ]] ; then for x in ${RC_COLDPLUG} ; do # We don't quote ${x} so we can do globbing [[ ${SVCNAME} == ${x} ]] && break [[ "!${SVCNAME}" == ${x} ]] && exit 1 done + [[ ${SVCNAME} == ${x} ]] || exit 1 fi eerror "${SVCNAME} will be started in the ${BOOTLEVEL} runlevel" if [[ ! -L /dev/.rcboot/"${SVCNAME}" ]] ; then -- cgit v1.2.3-65-gdbad