aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant-0.7.2/wpa-supplicant.sh
blob: 5c9e5d33a7d9a3305e1b3574bc40272a53a05e55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/sh


WPA_SUP_BIN="/usr/sbin/wpa_supplicant"
WPA_SUP_PNAME="wpa_supplicant"
WPA_SUP_PIDFILE="/var/run/wpa_supplicant.$IFACE.pid"
WPA_SUP_OPTIONS="-B -P $WPA_SUP_PIDFILE -i $IFACE"

VERBOSITY=0


if [ -s "$IF_WPA_CONF" ]; then
	WPA_SUP_CONF="-c $IF_WPA_CONF"
else
	exit 0
fi

if [ ! -x "$WPA_SUP_BIN" ]; then
	
	if [ "$VERBOSITY" = "1" ]; then
		echo "$WPA_SUP_PNAME: binaries not executable or missing from $WPA_SUP_BIN"
	fi
	
	exit 1
fi

if [ "$MODE" = "start" ] ; then
	# driver type of interface, defaults to wext when undefined
	if [ -s "/etc/wpa_supplicant/driver.$IFACE" ]; then
		IF_WPA_DRIVER=$(cat "/etc/wpa_supplicant/driver.$IFACE")
	elif [ -z "$IF_WPA_DRIVER" ]; then
		
		if [ "$VERBOSITY" = "1" ]; then
			echo "$WPA_SUP_PNAME: wpa-driver not provided, using \"wext\""
		fi
		
		IF_WPA_DRIVER="wext"
	fi
	
	# if we have passed the criteria, start wpa_supplicant
	if [ -n "$WPA_SUP_CONF" ]; then
		
		if [ "$VERBOSITY" = "1" ]; then
			echo "$WPA_SUP_PNAME: $WPA_SUP_BIN $WPA_SUP_OPTIONS $WPA_SUP_CONF -D $IF_WPA_DRIVER"
		fi
		
		start-stop-daemon --start --quiet \
			--name $WPA_SUP_PNAME --startas $WPA_SUP_BIN --pidfile $WPA_SUP_PIDFILE \
			--  $WPA_SUP_OPTIONS $WPA_SUP_CONF -D $IF_WPA_DRIVER
	fi

	# if the interface socket exists, then wpa_supplicant was invoked successfully
	if [ -S "$WPA_COMMON_CTRL_IFACE/$IFACE" ]; then
	
		if [ "$VERBOSITY" = "1" ]; then
			echo "$WPA_SUP_PNAME: ctrl_interface socket located at $WPA_COMMON_CTRL_IFACE/$IFACE"
		fi

		exit 0
		
	fi
	
elif [ "$MODE" = "stop" ]; then

	if [ -f "$WPA_SUP_PIDFILE" ]; then
		
		if [ "$VERBOSITY" = "1" ]; then
			echo "$WPA_SUP_PNAME: terminating $WPA_SUP_PNAME daemon"
		fi
		
		start-stop-daemon --stop --quiet \
			--name $WPA_SUP_PNAME --pidfile	$WPA_SUP_PIDFILE
			
		if [ -S "$WPA_COMMON_CTRL_IFACE/$IFACE" ]; then
			rm -f $WPA_COMMON_CTRL_IFACE/$IFACE
		fi
			
		if [ -f "$WPA_SUP_PIDFILE" ]; then
			rm -f $WPA_SUP_PIDFILE
		fi
	fi

fi

exit 0
class="nv">muslx32 = 'null' # Disable for some MIPS variants COMPATIBLE_HOST_mipsarchr6 = 'null' COMPATIBLE_HOST_linux-gnun32 = 'null' inherit autotools ptest multilib_header EXTRA_OECONF = "--enable-tls --without-mpicc" EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS') != '32']}" # valgrind checks host_cpu "armv7*)", so we need to over-ride the autotools.bbclass default --host option EXTRA_OECONF_append_arm = " --host=armv7${HOST_VENDOR}-${HOST_OS}" TARGET_CC_ARCH_remove_arm = "${@get_mcpu(d)}" EXTRA_OEMAKE = "-w" CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'" # valgrind likes to control its own optimisation flags. It generally defaults # to -O2 but uses -O0 for some specific test apps etc. Passing our own flags # (via CFLAGS) means we interfere with that. Only pass DEBUG_FLAGS to it # which fixes build path issue in DWARF. SELECTED_OPTIMIZATION = "${DEBUG_FLAGS}" def get_mcpu(d): for arg in (d.getVar('TUNE_CCARGS') or '').split(): if arg.startswith('-mcpu='): return arg else: continue return "" do_configure_prepend () { rm -rf ${S}/config.h sed -i -e 's:$(abs_top_builddir):$(pkglibdir)/ptest:g' ${S}/none/tests/Makefile.am sed -i -e 's:$(top_builddir):$(pkglibdir)/ptest:g' ${S}/memcheck/tests/Makefile.am } do_install_append () { install -m 644 ${B}/default.supp ${D}/${libdir}/valgrind/ oe_multilib_header valgrind/config.h } TUNE = "${@strip_mcpu(d)}" VALGRINDARCH ?= "${TARGET_ARCH}" VALGRINDARCH_aarch64 = "arm64" VALGRINDARCH_x86-64 = "amd64" VALGRINDARCH_x86 = "x86" VALGRINDARCH_mips = "mips32" VALGRINDARCH_mipsel = "mips32" VALGRINDARCH_mips64el = "mips64" VALGRINDARCH_powerpc = "ppc" VALGRINDARCH_powerpc64 = "ppc64" VALGRINDARCH_powerpc64el = "ppc64le" INHIBIT_PACKAGE_STRIP_FILES = "${PKGD}${libdir}/valgrind/vgpreload_memcheck-${VALGRINDARCH}-linux.so" RDEPENDS_${PN} += "perl" # valgrind needs debug information for ld.so at runtime in order to # redirect functions like strlen. RRECOMMENDS_${PN} += "${TCLIBC}-dbg" RDEPENDS_${PN}-ptest += " sed perl perl-module-file-glob" RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils" # One of the tests contains a bogus interpreter path on purpose. # Skip file dependency check SKIP_FILEDEPS_${PN}-ptest = '1' do_compile_ptest() { oe_runmake check } do_install_ptest() { chmod +x ${B}/tests/vg_regtest # The test application binaries are not automatically installed. # Grab them from the build directory. # # The regression tests require scripts and data files that are not # copied to the build directory. They must be copied from the # source directory. saved_dir=$PWD for parent_dir in ${S} ${B} ; do cd $parent_dir # exclude shell or the package won't install rm -rf none/tests/shell* 2>/dev/null subdirs="tests cachegrind/tests callgrind/tests drd/tests helgrind/tests massif/tests memcheck/tests none/tests" # Get the vg test scripts, filters, and expected files for dir in $subdirs ; do find $dir | cpio -pvdu ${D}${PTEST_PATH} done cd $saved_dir done # clean out build artifacts before building the rpm find ${D}${PTEST_PATH} \ \( -name "Makefile*" \ -o -name "*.o" \ -o -name "*.c" \ -o -name "*.S" \ -o -name "*.h" \) \ -exec rm {} \; # needed by massif tests cp ${B}/massif/ms_print ${D}${PTEST_PATH}/massif/ms_print # handle multilib sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest }