View | Details | Raw Unified | Return to bug 11647
Collapse All | Expand All

(-)a/etc/net/scripts/config-wireless (-3 / +5 lines)
Lines 29-38 if [ -x "${IWCONFIG:=$DEFAULT_IWCONFIG}" ]; then Link Here
29
fi
29
fi
30
30
31
# configure WPA
31
# configure WPA
32
if [ -x "${WPA_SUPPLICANT:=$DEFAULT_WPA_SUPPLICANT}" ]; then
32
if [ -x "${WPA_SUPPLICANT:=$DEFAULT_WPA_SUPPLICANT}" -a \
33
	-x "${WPA_CLI:=$DEFAULT_WPA_CLI}" ]; then
33
	prof_conf=`profiled_filename $MYIFACEDIR/wpa_supplicant.conf`
34
	prof_conf=`profiled_filename $MYIFACEDIR/wpa_supplicant.conf`
34
	if [ -s "$prof_conf" ]; then
35
	if [ -s "$prof_conf" ]; then
35
		$WPA_SUPPLICANT -i$NAME${WPA_DRIVER:+ -D$WPA_DRIVER} -c $prof_conf 2>&1>/dev/null &
36
		$WPA_SUPPLICANT -i$NAME${WPA_DRIVER:+ -D$WPA_DRIVER} \
36
		echo $! >/var/run/wpa_supplicant-$NAME.pid
37
			-B -P/var/run/wpa_supplicant-$NAME.pid -c $prof_conf
38
		$WPA_CLI -i$NAME -B -P/var/run/wpa_cli-$NAME.pid -a $SCRIPTDIR/wpa_cli.action
37
	fi
39
	fi
38
fi
40
fi
(-)a/etc/net/scripts/functions (-1 / +2 lines)
Lines 18-23 DEFAULT_IFPLUGD=/usr/sbin/ifplugd Link Here
18
DEFAULT_IWPRIV=/sbin/iwpriv
18
DEFAULT_IWPRIV=/sbin/iwpriv
19
DEFAULT_IWCONFIG=/sbin/iwconfig
19
DEFAULT_IWCONFIG=/sbin/iwconfig
20
DEFAULT_WPA_SUPPLICANT=/usr/sbin/wpa_supplicant
20
DEFAULT_WPA_SUPPLICANT=/usr/sbin/wpa_supplicant
21
DEFAULT_WPA_CLI=/usr/sbin/wpa_cli
21
DEFAULT_PLIPCONFIG=/sbin/plipconfig
22
DEFAULT_PLIPCONFIG=/sbin/plipconfig
22
DEFAULT_VCONFIG=/usr/bin/vconfig
23
DEFAULT_VCONFIG=/usr/bin/vconfig
23
DEFAULT_IPSECADM=/usr/sbin/ipsecadm
24
DEFAULT_IPSECADM=/usr/sbin/ipsecadm
Lines 501-507 declare -frx modprobe_with_rename Link Here
501
declare -frx eval_string
502
declare -frx eval_string
502
declare -rx DENOISE DEFAULT_BONDMODE IFACEDIR LOCALSCRIPTDIR VARLIBDIR
503
declare -rx DENOISE DEFAULT_BONDMODE IFACEDIR LOCALSCRIPTDIR VARLIBDIR
503
declare -rx VLANTAB HOSTTAB IFTAB PROFILE_FILE PROC_CMDLINE DEFAULT_IFPLUGSTATUS
504
declare -rx VLANTAB HOSTTAB IFTAB PROFILE_FILE PROC_CMDLINE DEFAULT_IFPLUGSTATUS
504
declare -rx DEFAULT_IFPLUGD DEFAULT_IWCONFIG DEFAULT_WPA_SUPPLICANT DEFAULT_PLIPCONFIG
505
declare -rx DEFAULT_IFPLUGD DEFAULT_IWCONFIG DEFAULT_WPA_SUPPLICANT DEFAULT_WPA_CLI DEFAULT_PLIPCONFIG
505
declare -rx DEFAULT_VCONFIG DEFAULT_PENTANETT DEFAULT_PENTAVALT DEFAULT_PENTANET_CONF
506
declare -rx DEFAULT_VCONFIG DEFAULT_PENTANETT DEFAULT_PENTAVALT DEFAULT_PENTANET_CONF
506
declare -rx DEFAULT_PENTAVAL_CONF DEFAULT_IPSECADM DEFAULT_IFENSLAVE DEFAULT_BRCTL
507
declare -rx DEFAULT_PENTAVAL_CONF DEFAULT_IPSECADM DEFAULT_IFENSLAVE DEFAULT_BRCTL
507
declare -rx DEFAULT_ETHTOOL DEFAULT_PPPD DEFAULT_CHAT DEFAULT_PPPOPTIONSFILE
508
declare -rx DEFAULT_ETHTOOL DEFAULT_PPPD DEFAULT_CHAT DEFAULT_PPPOPTIONSFILE
(-)a/etc/net/scripts/functions-eth (+7 lines)
Lines 15-20 check_eth_link () Link Here
15
	return 0
15
	return 0
16
}
16
}
17
17
18
# checks, if given iface is wireless one
19
is_wireless ()
20
{
21
    # FIXME better way ?
22
    [ -d "/sys/class/net/$1/wireless" ]
23
}
24
18
# see ifaces/default/options-eth
25
# see ifaces/default/options-eth
19
wait_for_macaddr()
26
wait_for_macaddr()
20
{
27
{
(-)a/etc/net/scripts/ifdown-ifplugd (-6 / +8 lines)
Lines 51-65 case "$BOOTPROTO" in Link Here
51
	;;
51
	;;
52
esac
52
esac
53
53
54
case "$USE_IFPLUGD" in
54
if [ "${0##/*}" = "ifdown-ifplugd" ]; then
55
	[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|[Yy]|1|[Aa][Uu][Tt][Oo])
55
	case "$USE_IFPLUGD" in
56
		[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|[Yy]|1|[Aa][Uu][Tt][Oo])
56
		# It's Ok, just do the job.
57
		# It's Ok, just do the job.
57
	;;
58
		;;
58
	*)
59
		*)
59
		print_error "ERROR: USE_IFPLUGD is not enabled for $NAME"
60
		print_error "ERROR: USE_IFPLUGD is not enabled for $NAME"
60
		exit 1
61
		exit 1
61
	;;
62
		;;
62
esac
63
	esac
64
fi
63
65
64
ExecIfExecutable $LOCALSCRIPTDIR/ifdown-pre-local $NAME && print_progress
66
ExecIfExecutable $LOCALSCRIPTDIR/ifdown-pre-local $NAME && print_progress
65
ExecIfExecutable $MYIFACEDIR/ifdown-pre $NAME && print_progress
67
ExecIfExecutable $MYIFACEDIR/ifdown-pre $NAME && print_progress
(-)a/etc/net/scripts/ifup-common (-6 / +13 lines)
Lines 184-201 process_sysctl_conf() Link Here
184
	return 0
184
	return 0
185
}
185
}
186
186
187
if ! is_yes $IN_WPA_CLI; then	# non-wifi or first pass for wifi
187
# setup link-level params
188
# setup link-level params
188
xargise_file $IFACEDIR/default/iplink "$IP link set dev $NAME"
189
    xargise_file $IFACEDIR/default/iplink "$IP link set dev $NAME"
189
xargise_file $IFACEDIR/default/iplink-$TYPE "$IP link set dev $NAME"
190
    xargise_file $IFACEDIR/default/iplink-$TYPE "$IP link set dev $NAME"
190
xargise_file $MYIFACEDIR/iplink "$IP link set dev $NAME"
191
    xargise_file $MYIFACEDIR/iplink "$IP link set dev $NAME"
191
192
192
# bring iface up
193
# bring iface up
193
if ! is_yes $KEEP_DOWN; then
194
    if ! is_yes $KEEP_DOWN; then
194
	$IP link set dev $NAME up && print_progress
195
	$IP link set dev $NAME up && print_progress
196
    fi
195
fi
197
fi
196
198
197
# handle wireless extensions
199
# handle wireless extensions, if any
198
is_yes "$CONFIG_WIRELESS" && $SCRIPTDIR/config-wireless $NAME && print_progress
200
if is_yes "$CONFIG_WIRELESS" && is_wireless $NAME; then
201
    if ! is_yes $IN_WPA_CLI; then
202
	$SCRIPTDIR/config-wireless $NAME && print_progress 
203
	exit 0
204
    fi
205
fi
199
206
200
# process ip neighbours
207
# process ip neighbours
201
xargise_file $MYIFACEDIR/ipneigh "$IP neigh replace dev $NAME"
208
xargise_file $MYIFACEDIR/ipneigh "$IP neigh replace dev $NAME"
(-)a/etc/net/scripts/ifup-ifplugd (-2 / +13 lines)
Lines 13-19 usage() Link Here
13
[ -z "$1" ] && usage
13
[ -z "$1" ] && usage
14
export NAME=$1
14
export NAME=$1
15
15
16
# forget everything we have inherited from ifplugd
16
# forget everything we have inherited from ifplugd/wpa_cli
17
export SCRIPTDIR=/etc/net/scripts
17
export SCRIPTDIR=/etc/net/scripts
18
. $SCRIPTDIR/functions
18
. $SCRIPTDIR/functions
19
pickup_defaults
19
pickup_defaults
Lines 37-40 is_yes "$DISABLED" && { Link Here
37
seen_iface $NAME && exit 0
37
seen_iface $NAME && exit 0
38
add_seen_iface $NAME
38
add_seen_iface $NAME
39
export SEEN_IFACES
39
export SEEN_IFACES
40
IN_IFPLUGD=yes $SCRIPTDIR/ifup-common $NAME
40
41
case "${0##*/}" in
42
    ifup-ifplugd)
43
    IN_WPA_CLI=no IN_IFPLUGD=yes $SCRIPTDIR/ifup-common $NAME
44
    ;;
45
    ifup-wireless)
46
    USE_IFPLUGD=no IN_IFPLUGD=no IN_WPA_CLI=yes $SCRIPTDIR/ifup-common $NAME
47
    ;;
48
    *)
49
    $SCRIPTDIR/ifup-common $NAME
50
    ;;
51
esac
(-)a/etc/net/scripts/wpa_cli.action (+17 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
# This file is /etc/net helper for use with wpa_cli action mode
4
# and called from wpa_cli with two parameters:
5
# $1 interface name
6
# $2 event, CONNECTED|DISCONNECTED
7
8
if [ -z "$1" -o -z "$2" ] ; then
9
    logger -d "Wrong arguments to $0: '$@'"
10
    exit 1
11
fi
12
13
unset SEEN_IFACES
14
[ "$2" = "CONNECTED" ] && exec /etc/net/scripts/ifup-wireless $1
15
[ "$2" = "DISCONNECTED" ] && exec /etc/net/scripts/ifdown-wireless $1
16
17
exit 0

Return to bug 11647