Merge ~alfonsosanchezbeato/snappy-hwe-snaps/+git/wifi-ap:fix-wifi-ap-restart into ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-ap:master

Proposed by Alfonso Sanchez-Beato
Status: Merged
Approved by: Alfonso Sanchez-Beato
Approved revision: b619722a038c20a74191c3071a57cfd236b3b256
Merged at revision: 06b22bcbb7cf0aa96fb80a26b4c3fa18cedd91de
Proposed branch: ~alfonsosanchezbeato/snappy-hwe-snaps/+git/wifi-ap:fix-wifi-ap-restart
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-ap:master
Diff against target: 396 lines (+87/-76)
6 files modified
bin/ap.sh (+57/-52)
bin/automatic-setup.sh (+3/-3)
bin/config-internal.sh (+3/-3)
bin/helper.sh (+5/-5)
snapcraft.yaml (+19/-10)
tests/lib/prepare.sh (+0/-3)
Reviewer Review Type Date Requested Status
System Enablement Bot continuous-integration Approve
Oliver Grawert Approve
Review via email: mp+355136@code.launchpad.net

Description of the change

Some clean-ups and fix for lp: #1792923

To post a comment you must log in.
Revision history for this message
Oliver Grawert (ogra) wrote :

looks good (unrelated, i'm not sure if core18 will still ship the ifconfig binary, it might be good to move the ifconfig calls to become "ip" calls in a future commit)

review: Approve
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :

PASSED: Successfully build documentation, rev: b619722a038c20a74191c3071a57cfd236b3b256

Generated documentation is available at https://jenkins.canonical.com/system-enablement/job/snappy-hwe-snaps-snap-docs/1117/

Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :

PASSED: Successfully build documentation, rev: b619722a038c20a74191c3071a57cfd236b3b256

Generated documentation is available at https://jenkins.canonical.com/system-enablement/job/snappy-hwe-snaps-snap-docs/1118/

Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :

PASSED: Successfully build documentation, rev: b619722a038c20a74191c3071a57cfd236b3b256

Generated documentation is available at https://jenkins.canonical.com/system-enablement/job/snappy-hwe-snaps-snap-docs/1119/

Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :

PASSED: Successfully build documentation, rev: 2d5eda248ff006740f11d3ae612b787389ba7a92

Generated documentation is available at https://jenkins.canonical.com/system-enablement/job/snappy-hwe-snaps-snap-docs/1120/

Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :

PASSED: Successfully build documentation, rev: 684c97d1238dbde1071f6c99d03c2bdc03039faa

Generated documentation is available at https://jenkins.canonical.com/system-enablement/job/snappy-hwe-snaps-snap-docs/1121/

Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/bin/ap.sh b/bin/ap.sh
index be1f440..add2212 100755
--- a/bin/ap.sh
+++ b/bin/ap.sh
@@ -14,22 +14,22 @@
14# You should have received a copy of the GNU General Public License14# You should have received a copy of the GNU General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17if [ $(id -u) -ne 0 ] ; then17if [ "$(id -u)" -ne 0 ] ; then
18 echo "ERROR: $0 needs to be executed as root!"18 echo "ERROR: $0 needs to be executed as root!"
19 exit 119 exit 1
20fi20fi
2121
22. $SNAP/bin/config-internal.sh22. "$SNAP"/bin/config-internal.sh
2323
24if [ $DEBUG = "true" ]; then24if [ "$DEBUG" = "true" ]; then
25 set -x25 set -x
26fi26fi
2727
28# Now after we have enabled debugging or not we can safely load28# Now after we have enabled debugging or not we can safely load
29# all others necessary bits.29# all others necessary bits.
30. $SNAP/bin/helper.sh30. "$SNAP"/bin/helper.sh
3131
32if [ $DISABLED = "true" ] ; then32if [ "$DISABLED" = "true" ] ; then
33 echo "Not starting as WiFi AP is disabled"33 echo "Not starting as WiFi AP is disabled"
34 exit 034 exit 0
35fi35fi
@@ -38,23 +38,24 @@ DEFAULT_ACCESS_POINT_INTERFACE="ap0"
3838
39# Make sure the configured WiFi interface is really available before39# Make sure the configured WiFi interface is really available before
40# doing anything.40# doing anything.
41if ! ifconfig $WIFI_INTERFACE ; then41if ! ifconfig "$WIFI_INTERFACE" ; then
42 echo "ERROR: WiFi interface $WIFI_INTERFACE is not available!"42 echo "ERROR: WiFi interface $WIFI_INTERFACE is not available!"
43 exit 143 exit 1
44fi44fi
4545
46cleanup_on_exit() {46do_cleanup() {
47 read HOSTAPD_PID <$SNAP_DATA/hostapd.pid47 if [ -f "$SNAP_DATA"/hostapd.pid ] ; then
48 if [ -n "$HOSTAPD_PID" ] ; then48 read -r HOSTAPD_PID <"$SNAP_DATA"/hostapd.pid
49 kill -TERM $HOSTAPD_PID || true49 kill -TERM "$HOSTAPD_PID" || true
50 wait $HOSTAPD_PID50 wait "$HOSTAPD_PID"
51 rm "$SNAP_DATA"/hostapd.pid
51 fi52 fi
5253
53 read DNSMASQ_PID <$SNAP_DATA/dnsmasq.pid54 if [ -f "$SNAP_DATA"/dnsmasq.pid ] ; then
54 if [ -n "$DNSMASQ_PID" ] ; then55 read -r DNSMASQ_PID <"$SNAP_DATA"/dnsmasq.pid
55 # If dnsmasq is already gone don't error out here56 # If dnsmasq is already gone don't error out here
56 kill -TERM $DNSMASQ_PID || true57 kill -TERM "$DNSMASQ_PID" || true
57 wait $DNSMASQ_PID58 wait "$DNSMASQ_PID"
58 fi59 fi
5960
60 iface=$WIFI_INTERFACE61 iface=$WIFI_INTERFACE
@@ -62,28 +63,30 @@ cleanup_on_exit() {
62 iface=$DEFAULT_ACCESS_POINT_INTERFACE63 iface=$DEFAULT_ACCESS_POINT_INTERFACE
63 fi64 fi
6465
65 if [ $SHARE_DISABLED = "false" ] ; then66 if [ "$SHARE_DISABLED" = "false" ] ; then
66 # flush forwarding rules out67 # flush forwarding rules out
67 iptables --table nat --delete POSTROUTING --out-interface $SHARE_NETWORK_INTERFACE -j MASQUERADE68 iptables --table nat --delete POSTROUTING --out-interface "$SHARE_NETWORK_INTERFACE" -j MASQUERADE
68 iptables --delete FORWARD --in-interface $iface -j ACCEPT69 iptables --delete FORWARD --in-interface $iface -j ACCEPT
69 sysctl -w net.ipv4.ip_forward=070 sysctl -w net.ipv4.ip_forward=0
70 fi71 fi
7172
72 if is_nm_running ; then73 if [ "$WIFI_INTERFACE_MODE" = "virtual" ] ; then
74 "$SNAP"/bin/iw dev $iface del
75 elif is_nm_running ; then
73 # Hand interface back to network-manager. This will also trigger the76 # Hand interface back to network-manager. This will also trigger the
74 # auto connection process inside network-manager to get connected77 # auto connection process inside network-manager to get connected
75 # with the previous network.78 # with the previous network.
76 $SNAP/bin/nmcli d set $iface managed yes79 "$SNAP"/bin/nmcli d set $iface managed yes
77 fi
78
79 if [ "$WIFI_INTERFACE_MODE" = "virtual" ] ; then
80 $SNAP/bin/iw dev $iface del
81 fi80 fi
82}81}
8382
84# We need to install this right before we do anything to83# We need to install this right before we do anything to
85# ensure that we cleanup everything again when we termiante.84# ensure that we cleanup everything again when we termiante.
86trap cleanup_on_exit TERM85trap do_cleanup TERM
86
87# Make initial clean-up for the case of the script being killed without
88# a chance of finishing cleanly.
89do_cleanup
8790
88iface=$WIFI_INTERFACE91iface=$WIFI_INTERFACE
89if [ "$WIFI_INTERFACE_MODE" = "virtual" ] ; then92if [ "$WIFI_INTERFACE_MODE" = "virtual" ] ; then
@@ -92,7 +95,7 @@ if [ "$WIFI_INTERFACE_MODE" = "virtual" ] ; then
92 # Make sure if the real wifi interface is connected we use95 # Make sure if the real wifi interface is connected we use
93 # the same channel for our AP as otherwise the created AP96 # the same channel for our AP as otherwise the created AP
94 # will not work.97 # will not work.
95 channel_in_use=$($SNAP/bin/iw dev $WIFI_INTERFACE info |awk '/channel/{print$2}')98 channel_in_use=$("$SNAP"/bin/iw dev "$WIFI_INTERFACE" info |awk '/channel/{print$2}')
96 if [ -z "$channel_in_use" ]; then99 if [ -z "$channel_in_use" ]; then
97 echo "WARNING: WiFi is currently not connected so we can't determine"100 echo "WARNING: WiFi is currently not connected so we can't determine"
98 echo " which channel we can use for the AP. This will most"101 echo " which channel we can use for the AP. This will most"
@@ -109,10 +112,9 @@ fi
109# Create our AP interface if required112# Create our AP interface if required
110if [ "$WIFI_INTERFACE_MODE" = "virtual" ] ; then113if [ "$WIFI_INTERFACE_MODE" = "virtual" ] ; then
111 iface=$DEFAULT_ACCESS_POINT_INTERFACE114 iface=$DEFAULT_ACCESS_POINT_INTERFACE
112 $SNAP/bin/iw dev $WIFI_INTERFACE interface add $iface type __ap115 if ! "$SNAP"/bin/iw dev "$WIFI_INTERFACE" interface add $iface type __ap ; then
113 if [ $? -ne 0 ] ; then
114 echo "ERROR: Failed to create virtual WiFi network interface"116 echo "ERROR: Failed to create virtual WiFi network interface"
115 cleanup_on_exit117 do_cleanup
116 fi118 fi
117 wait_until_interface_is_available $iface119 wait_until_interface_is_available $iface
118fi120fi
@@ -126,53 +128,52 @@ if is_nm_running ; then
126 # Prevent network-manager from touching the interface we want to use. If128 # Prevent network-manager from touching the interface we want to use. If
127 # network-manager was configured to use the interface its nothing we want129 # network-manager was configured to use the interface its nothing we want
128 # to prevent here as this is how the user configured the system.130 # to prevent here as this is how the user configured the system.
129 $SNAP/bin/nmcli d set $iface managed no131 "$SNAP"/bin/nmcli d set $iface managed no
130fi132fi
131133
132# Initial wifi interface configuration134# Initial wifi interface configuration
133ifconfig $iface up135if ! ifconfig "$iface" up ; then
134if [ $? -ne 0 ] ; then
135 echo "ERROR: Failed to enable WiFi network interface '$iface'"136 echo "ERROR: Failed to enable WiFi network interface '$iface'"
136137
137 # Remove virtual interface again if we created one138 # Remove virtual interface again if we created one
138 if [ "$WIFI_INTERFACE_MODE" = "virtual" ] ; then139 if [ "$WIFI_INTERFACE_MODE" = "virtual" ] ; then
139 $SNAP/bin/iw dev $iface del140 "$SNAP"/bin/iw dev $iface del
140 fi141 fi
141142
142 if is_nm_running ; then143 if is_nm_running ; then
143 # Hand interface back to network-manager. This will also trigger the144 # Hand interface back to network-manager. This will also trigger the
144 # auto connection process inside network-manager to get connected145 # auto connection process inside network-manager to get connected
145 # with the previous network.146 # with the previous network.
146 $SNAP/bin/nmcli d set $iface managed yes147 "$SNAP"/bin/nmcli d set $iface managed yes
147 fi148 fi
148149
149 exit 1150 exit 1
150fi151fi
151152
152# Configure interface and give it a moment to settle153# Configure interface and give it a moment to settle
153ifconfig $iface $WIFI_ADDRESS netmask $WIFI_NETMASK154ifconfig "$iface" "$WIFI_ADDRESS" netmask "$WIFI_NETMASK"
154sleep 2155sleep 2
155156
156if [ $SHARE_DISABLED = "false" ] ; then157if [ "$SHARE_DISABLED" = "false" ] ; then
157 # Enable NAT to forward our network connection158 # Enable NAT to forward our network connection
158 iptables --table nat --append POSTROUTING --out-interface $SHARE_NETWORK_INTERFACE -j MASQUERADE159 iptables --table nat --append POSTROUTING --out-interface "$SHARE_NETWORK_INTERFACE" -j MASQUERADE
159 iptables --append FORWARD --in-interface $iface -j ACCEPT160 iptables --append FORWARD --in-interface $iface -j ACCEPT
160 sysctl -w net.ipv4.ip_forward=1161 sysctl -w net.ipv4.ip_forward=1
161fi162fi
162163
163generate_dnsmasq_config $SNAP_DATA/dnsmasq.conf164generate_dnsmasq_config "$SNAP_DATA"/dnsmasq.conf
164$SNAP/bin/dnsmasq \165"$SNAP"/bin/dnsmasq \
165 -k \166 -k \
166 -C $SNAP_DATA/dnsmasq.conf \167 -C "$SNAP_DATA"/dnsmasq.conf \
167 -l $SNAP_DATA/dnsmasq.leases \168 -l "$SNAP_DATA"/dnsmasq.leases \
168 -x $SNAP_DATA/dnsmasq.pid \169 -x "$SNAP_DATA"/dnsmasq.pid \
169 -u root -g root \170 -u root -g root \
170 &171 &
171172
172driver=$WIFI_HOSTAPD_DRIVER173driver=$WIFI_HOSTAPD_DRIVER
173174
174# Generate our hostapd configuration file175# Generate our hostapd configuration file
175cat <<EOF > $SNAP_DATA/hostapd.conf176cat <<EOF > "$SNAP_DATA"/hostapd.conf
176interface=$iface177interface=$iface
177driver=$driver178driver=$driver
178channel=$WIFI_CHANNEL179channel=$WIFI_CHANNEL
@@ -214,7 +215,7 @@ wmm_ac_vo_acm=0
214EOF215EOF
215216
216if [ -n "$WIFI_COUNTRY_CODE" ] ; then217if [ -n "$WIFI_COUNTRY_CODE" ] ; then
217 cat <<-EOF >> $SNAP_DATA/hostapd.conf218 cat <<-EOF >> "$SNAP_DATA"/hostapd.conf
218 # Regulatory domain options219 # Regulatory domain options
219 country_code=$WIFI_COUNTRY_CODE220 country_code=$WIFI_COUNTRY_CODE
220 # Send country code in beacon frames221 # Send country code in beacon frames
@@ -226,7 +227,7 @@ if [ -n "$WIFI_COUNTRY_CODE" ] ; then
226 # End reg domain options227 # End reg domain options
227 EOF228 EOF
228else229else
229 cat <<-EOF >> $SNAP_DATA/hostapd.conf230 cat <<-EOF >> "$SNAP_DATA"/hostapd.conf
230 # Regulatory domain options231 # Regulatory domain options
231 # Country code set to global232 # Country code set to global
232 country_code=XX233 country_code=XX
@@ -236,11 +237,11 @@ fi
236237
237case "$WIFI_SECURITY" in238case "$WIFI_SECURITY" in
238 open)239 open)
239 cat <<-EOF >> $SNAP_DATA/hostapd.conf240 cat <<-EOF >> "$SNAP_DATA"/hostapd.conf
240 EOF241 EOF
241 ;;242 ;;
242 wpa2)243 wpa2)
243 cat <<-EOF >> $SNAP_DATA/hostapd.conf244 cat <<-EOF >> "$SNAP_DATA"/hostapd.conf
244 wpa=2245 wpa=2
245 wpa_key_mgmt=WPA-PSK246 wpa_key_mgmt=WPA-PSK
246 wpa_passphrase=$WIFI_SECURITY_PASSPHRASE247 wpa_passphrase=$WIFI_SECURITY_PASSPHRASE
@@ -255,16 +256,20 @@ esac
255256
256EXTRA_ARGS=257EXTRA_ARGS=
257if [ "$DEBUG" = "true" ] ; then258if [ "$DEBUG" = "true" ] ; then
258 EXTRA_ARGS="$EXTRA_ARGS -ddd -t"259 EXTRA_ARGS="-ddd -t"
259fi260fi
260261
261hostapd=$SNAP/bin/hostapd262hostapd="$SNAP"/bin/hostapd
262263
263# Startup hostapd with the configuration we've put in place264# Startup hostapd with the configuration we've put in place
264$hostapd $EXTRA_ARGS $SNAP_DATA/hostapd.conf &265# We need to tolerate no double quotes for EXTRA_ARGS, as it can be
266# empty - this is safe as the definition of the variable is internal.
267# shellcheck disable=SC2086
268$hostapd $EXTRA_ARGS "$SNAP_DATA"/hostapd.conf &
265hostapd_pid=$!269hostapd_pid=$!
266echo $hostapd_pid > $SNAP_DATA/hostapd.pid270echo $hostapd_pid > "$SNAP_DATA"/hostapd.pid
267wait $hostapd_pid271# When TERM is received, wait will return and immediately after that
272# do_cleanup will be called.
273wait
268274
269cleanup_on_exit
270exit 0275exit 0
diff --git a/bin/automatic-setup.sh b/bin/automatic-setup.sh
index 871429b..1b8f79f 100755
--- a/bin/automatic-setup.sh
+++ b/bin/automatic-setup.sh
@@ -19,7 +19,7 @@ set -x
19# Wait for the snap to be successfully setup. This will only be true19# Wait for the snap to be successfully setup. This will only be true
20# when the snap is started the first time and the configure hook was20# when the snap is started the first time and the configure hook was
21# never called before.21# never called before.
22while [ ! -e $SNAP_COMMON/.setup_done ]; do22while [ ! -e "$SNAP_COMMON"/.setup_done ]; do
23 sleep 0.523 sleep 0.5
24done24done
2525
@@ -27,8 +27,8 @@ done
2727
28[ -f "$SNAP_DATA/config" ] && exit 028[ -f "$SNAP_DATA/config" ] && exit 0
2929
30while ! $SNAP/bin/client status; do30while ! "$SNAP"/bin/client status; do
31 sleep .531 sleep .5
32done32done
3333
34exec $SNAP/bin/client wizard --auto34exec "$SNAP"/bin/client wizard --auto
diff --git a/bin/config-internal.sh b/bin/config-internal.sh
index aa48897..c2768ac 100755
--- a/bin/config-internal.sh
+++ b/bin/config-internal.sh
@@ -14,14 +14,14 @@
14# You should have received a copy of the GNU General Public License14# You should have received a copy of the GNU General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17. $SNAP/conf/default-config17. "$SNAP"/conf/default-config
1818
19# We allow the user to place two configuration files. One which19# We allow the user to place two configuration files. One which
20# he can provide on its own in $SNAP_USER_DATA/config and one20# he can provide on its own in $SNAP_USER_DATA/config and one
21# which only our scripts will modify in $SNAP_DATA/config21# which only our scripts will modify in $SNAP_DATA/config
22if [ -e "$SNAP_DATA/config" ] ; then22if [ -e "$SNAP_DATA/config" ] ; then
23 . $SNAP_DATA/config23 . "$SNAP_DATA"/config
24fi24fi
25if [ -e "$SNAP_USER_DATA/config" ] ; then25if [ -e "$SNAP_USER_DATA/config" ] ; then
26 . $SNAP_USER_DATA/config26 . "$SNAP_USER_DATA"/config
27fi27fi
diff --git a/bin/helper.sh b/bin/helper.sh
index 147fe89..f3426a3 100644
--- a/bin/helper.sh
+++ b/bin/helper.sh
@@ -15,18 +15,18 @@
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17does_interface_exist() {17does_interface_exist() {
18 [ -d /sys/class/net/$1 ]18 [ -d /sys/class/net/"$1" ]
19}19}
2020
21wait_until_interface_is_available() {21wait_until_interface_is_available() {
22 while ! does_interface_exist $1; do22 while ! does_interface_exist "$1"; do
23 # Wait for 200ms23 # Wait for 200ms
24 sleep 0.224 sleep 0.2
25 done25 done
26}26}
2727
28assert_not_managed_by_ifupdown() {28assert_not_managed_by_ifupdown() {
29 if [ -e /etc/network/interfaces.d/$1 ]; then29 if [ -e /etc/network/interfaces.d/"$1" ]; then
30 echo "ERROR: Interface $1 is managed by ifupdown and can't be used"30 echo "ERROR: Interface $1 is managed by ifupdown and can't be used"
31 exit 131 exit 1
32 fi32 fi
@@ -49,10 +49,10 @@ generate_dnsmasq_config() {
49 dhcp-range=$DHCP_RANGE_START,$DHCP_RANGE_STOP,$DHCP_LEASE_TIME49 dhcp-range=$DHCP_RANGE_START,$DHCP_RANGE_STOP,$DHCP_LEASE_TIME
50 dhcp-option=6, $WIFI_ADDRESS50 dhcp-option=6, $WIFI_ADDRESS
51 EOF51 EOF
52 } > $152 } > "$1"
53}53}
5454
55is_nm_running() {55is_nm_running() {
56 nm_status=`$SNAP/bin/nmcli -t -f RUNNING general`56 nm_status=$("$SNAP"/bin/nmcli -t -f RUNNING general)
57 [ "$nm_status" = "running" ]57 [ "$nm_status" = "running" ]
58}58}
diff --git a/snapcraft.yaml b/snapcraft.yaml
index fbbdb2d..a1d3190 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -70,18 +70,27 @@ parts:
70 prime:70 prime:
71 - $binaries71 - $binaries
7272
73 go:
74 source-tag: go1.9.2
75
73 service:76 service:
74 plugin: go77 after: [go]
75 source: .78 plugin: make
76 go-importpath: launchpad.net/wifi-ap79 build: |
77 prime:80 set -ex
78 - bin81 export GOPATH=$(mktemp -d)
79 install: |82 (src_path="$GOPATH"/src/launchpad.net/wifi-ap
80 export GOPATH=$PWD/../go83 mkdir -p "$src_path"
84 cp -a cmd "$src_path"
85 cd "$src_path"
86 go get -t -d ...
87 mkdir -p $SNAPCRAFT_PART_INSTALL/bin/
81 for d in client service ; do88 for d in client service ; do
82 cd $GOPATH/src/launchpad.net/wifi-ap/cmd/$d89 cd $GOPATH/src/launchpad.net/wifi-ap/cmd/"$d"
83 go test -v90 go build
84 done91 cp -f "$d" $SNAPCRAFT_PART_INSTALL/bin/
92 done)
93 rm -rf "$GOPATH"
8594
86 dnsmasq:95 dnsmasq:
87 plugin: make96 plugin: make
diff --git a/tests/lib/prepare.sh b/tests/lib/prepare.sh
index 7e27528..be54593 100644
--- a/tests/lib/prepare.sh
+++ b/tests/lib/prepare.sh
@@ -20,9 +20,6 @@ for name in $gadget_name $kernel_name $core_name; do
20 fi20 fi
21done21done
2222
23echo "Kernel has a store revision"
24snap list | grep ^${kernel_name} | grep -E " [0-9]+\s+canonical"
25
26# Snapshot of the current snapd state for a later restore23# Snapshot of the current snapd state for a later restore
27if [ ! -f $SPREAD_PATH/snapd-state.tar.gz ] ; then24if [ ! -f $SPREAD_PATH/snapd-state.tar.gz ] ; then
28 systemctl stop snapd.service snapd.socket25 systemctl stop snapd.service snapd.socket

Subscribers

People subscribed via source and target branches