Merge ~morphis/snappy-hwe-snaps/+git/wifi-ap:small-improvements into ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-ap:master

Proposed by Simon Fels
Status: Merged
Approved by: Simon Fels
Approved revision: 2028a66d94e88afa7a3a1b76fc24bfcb65a69e7a
Merged at revision: a34c99149e1abd6ae333b48013157c280b01f44a
Proposed branch: ~morphis/snappy-hwe-snaps/+git/wifi-ap:small-improvements
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-ap:master
Prerequisite: ~morphis/snappy-hwe-snaps/+git/wifi-ap:no-external-go-deps
Diff against target: 61 lines (+16/-10)
2 files modified
bin/ap.sh (+14/-8)
conf/default-config (+2/-2)
Reviewer Review Type Date Requested Status
Alfonso Sanchez-Beato Approve
Konrad Zapałowicz (community) Approve
Matteo Croce (community) Approve
System Enablement Bot continuous-integration Approve
Review via email: mp+306836@code.launchpad.net

Description of the change

Small improvements for default configuration and log output

* Use direct interface mode by default; this is the modem supported by most WiFi devices so lets make it the default rather than the not common virtual one.
* Always check if network-manager is available before trying to use to avoid unnecessary error messages

To post a comment you must log in.
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Matteo Croce (teknoraver) :
review: Approve
Revision history for this message
Konrad Zapałowicz (kzapalowicz) wrote :

LGTM

review: Approve
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

See comment below.

review: Needs Information
Revision history for this message
Simon Fels (morphis) :
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/ap.sh b/bin/ap.sh
2index f017554..a7fba62 100755
3--- a/bin/ap.sh
4+++ b/bin/ap.sh
5@@ -87,10 +87,14 @@ if [ "$WIFI_INTERFACE_MODE" = "direct" ] ; then
6 assert_not_managed_by_ifupdown $iface
7 fi
8
9-# Prevent network-manager from touching the interface we want to use. If
10-# network-manager was configured to use the interface its nothing we want
11-# to prevent here as this is how the user configured the system.
12-$SNAP/bin/nmcli d set $iface managed no
13+
14+nm_status=`$SNAP/bin/nmcli -t -f RUNNING general`
15+if [ "$nm_status" = "running" ] ; then
16+ # Prevent network-manager from touching the interface we want to use. If
17+ # network-manager was configured to use the interface its nothing we want
18+ # to prevent here as this is how the user configured the system.
19+ $SNAP/bin/nmcli d set $iface managed none
20+fi
21
22 # Initial wifi interface configuration
23 ifconfig $iface up
24@@ -102,10 +106,12 @@ if [ $? -ne 0 ] ; then
25 $SNAP/bin/iw dev $iface del
26 fi
27
28- # Hand interface back to network-manager. This will also trigger the
29- # auto connection process inside network-manager to get connected
30- # with the previous network.
31- $SNAP/bin/nmcli d set $iface managed yes
32+ if [ "$nm_status" = "running" ] ; then
33+ # Hand interface back to network-manager. This will also trigger the
34+ # auto connection process inside network-manager to get connected
35+ # with the previous network.
36+ $SNAP/bin/nmcli d set $iface managed yes
37+ fi
38
39 exit 1
40 fi
41diff --git a/conf/default-config b/conf/default-config
42index 1fa5c4f..2bbf816 100644
43--- a/conf/default-config
44+++ b/conf/default-config
45@@ -24,14 +24,14 @@ WIFI_INTERFACE=wlan0
46 WIFI_ADDRESS=192.168.7.1
47 WIFI_NETMASK=255.255.255.0
48
49-# Possible options are: uap, direct
50+# Possible options are: virtual, direct
51 # virtual:
52 # Creates a virtual network interface for the AP with
53 # the interface configured in $WIFI_INTERFACE as parent.
54 # direct:
55 # Will use the interface configured with $WIFI_INTERFACE
56 # directly.
57-WIFI_INTERFACE_MODE=virtual
58+WIFI_INTERFACE_MODE=direct
59
60 # Possible options are: nl80211, rtl8188
61 WIFI_HOSTAPD_DRIVER="nl80211"

Subscribers

People subscribed via source and target branches

to all changes: