From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Angelo Compagnucci <angelo@amarulasolutions.com>
Cc: jagan@amarulasolutions.com, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 2/4] package/wpa_supplicant: adding ifupdown support
Date: Wed, 1 Jun 2022 21:25:52 +0200 [thread overview]
Message-ID: <20220601212552.479542be@windsurf> (raw)
In-Reply-To: <20220527103335.1968203-3-angelo@amarulasolutions.com>
Hello,
On Fri, 27 May 2022 12:33:33 +0200
Angelo Compagnucci <angelo@amarulasolutions.com> wrote:
> Actually, configuring a wifi interface as per "interfaces" man:
>
> auto wlan0
> iface wlan0 inet dhcp
> wpa-conf /etc/wpa_supplicant.conf
Do you have a link to an interfaces manpage that documents wpa-conf?
Is this supported by the Busybox ifupdown?
> diff --git a/package/wpa_supplicant/ifupdown.sh b/package/wpa_supplicant/ifupdown.sh
> new file mode 100755
> index 0000000000..8eecf73436
> --- /dev/null
> +++ b/package/wpa_supplicant/ifupdown.sh
> @@ -0,0 +1,71 @@
> +#!/bin/sh
> +
> +# This file is executed by ifupdown in pre-up, post-up, pre-down and
> +# post-down phases of network interface configuration.
> +
> +WPA_SUP_BIN="/usr/sbin/wpa_supplicant"
> +
> +if [ -n "$IF_WPA_MAINT_DEBUG" ]; then
> + set -x
> +fi
Where is IF_WPA_MAINT_DEBUG supposed to be defined?
> +# allow wpa_supplicant interface to be specified via wpa-iface
> +# useful for starting wpa_supplicant on one interface of a bridge
> +if [ -n "$IF_WPA_IFACE" ]; then
> + WPA_IFACE="$IF_WPA_IFACE"
> +else
> + WPA_IFACE="$IFACE"
> +fi
I'm curious to understand how wpa-iface ends up in IP_WPA_IFACE. I
guess I'm missing a piece of the puzzla.
> +WPA_SUP_PIDFILE="/run/wpa_supplicant.${WPA_IFACE}.pid"
> +
> +# quit if executables are not installed
> +if [ ! -x "$WPA_SUP_BIN" ]; then
> + exit 0
> +fi
This can be removed in the context of Buildroot. We tend to not check
for the installation of executables from the same package, as it's
quite useless.
> +
> +do_start () {
> + if [ -n "$IF_WPA_CONF" ] && [ "$IF_WPA_CONF" != "managed" ]; then
> + if [ ! -s "$IF_WPA_CONF" ]; then
> + echo "cannot read contents of $IF_WPA_CONF"
> + exit 1
> + fi
> + WPA_SUP_CONF_CTRL_DIR=$(sed -n -e 's/[[:space:]]*#.*//g' -e 's/[[:space:]]\+.*$//g' \
> + -e 's/^ctrl_interface=\(DIR=\)\?\(.*\)/\2/p' "$IF_WPA_CONF")
> + if [ -n "$WPA_SUP_CONF_CTRL_DIR" ]; then
> + WPA_SUP_CONF="-c $IF_WPA_CONF -C $WPA_SUP_CONF_CTRL_DIR"
The manpage of wpa_supplicant says:
-C ctrl_interface
Path to ctrl_interface socket (Per interface. Only used if -c is not).
so passing -C when -c is passed does not make sense. Or am I missing
something?
> + else
> + WPA_SUP_CONF="-c $IF_WPA_CONF"
> + fi
> + else
> + # specify the default ctrl_interface
> + WPA_SUP_CONF="-C $WPA_CTRL_DIR"
How is WPA_CTRL_DIR defined?
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2022-06-01 19:26 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-27 10:33 [Buildroot] [PATCH 0/4] Better wifi handling Angelo Compagnucci
2022-05-27 10:33 ` [Buildroot] [PATCH 1/4] package/wpa_supplicant: fixing "Invalid configuration line" Angelo Compagnucci
2022-06-01 19:21 ` Thomas Petazzoni via buildroot
2022-06-01 21:55 ` Angelo Compagnucci
2022-06-06 12:42 ` Arnout Vandecappelle
2022-06-07 10:21 ` Angelo Compagnucci
2022-06-07 11:48 ` Thomas Petazzoni via buildroot
2022-06-07 12:16 ` Angelo Compagnucci
2022-06-07 13:12 ` Thomas Petazzoni via buildroot
2022-06-07 13:22 ` Angelo Compagnucci
2022-05-27 10:33 ` [Buildroot] [PATCH 2/4] package/wpa_supplicant: adding ifupdown support Angelo Compagnucci
2022-06-01 19:25 ` Thomas Petazzoni via buildroot [this message]
2022-06-01 22:06 ` Angelo Compagnucci
2022-06-06 15:09 ` Nicolas Cavallari
2022-06-07 15:00 ` Angelo Compagnucci
2022-05-27 10:33 ` [Buildroot] [PATCH 3/4] package/busybox: make udhcp discover faster Angelo Compagnucci
2022-06-01 19:26 ` Thomas Petazzoni via buildroot
2022-05-27 10:33 ` [Buildroot] [PATCH 4/4] package/rtl8723ds: new package Angelo Compagnucci
2022-06-01 19:55 ` Thomas Petazzoni via buildroot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220601212552.479542be@windsurf \
--to=buildroot@buildroot.org \
--cc=angelo@amarulasolutions.com \
--cc=jagan@amarulasolutions.com \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox