Merge lp:~sergiusens/phablet-tools/1175806 into lp:phablet-tools

Proposed by Sergio Schvezov
Status: Merged
Approved by: Alan Pope 🍺🐧🐱 πŸ¦„
Approved revision: 92
Merged at revision: 90
Proposed branch: lp:~sergiusens/phablet-tools/1175806
Merge into: lp:phablet-tools
Diff against target: 61 lines (+26/-10)
2 files modified
debian/changelog (+6/-0)
phablet-network-setup (+20/-10)
To merge this branch: bzr merge lp:~sergiusens/phablet-tools/1175806
Reviewer Review Type Date Requested Status
Alan Pope 🍺🐧🐱 πŸ¦„ (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+163212@code.launchpad.net

Commit message

Waiting for an IP to be available before continuing with package install

Description of the change

We are now waiting for an IP before trying to update the package cache.

To test, make sure you have no connection on your device and run
./phablet-network-setup -i

Ideally you'd either get a timeout or no errors when updating.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

I don't think it waits long enough. I ran it and the loop finished _just_ before the wifi finished connecting.

alan@deep-thought:/tmp/1175806$ ./phablet-network-setup -i
[sudo] password for alan:
Network file is /etc/NetworkManager/system-connections/popey
Provisioning network file to device
restarting adbd as root
6 KB/s (284 bytes in 0.043s)

Network setup complete
Installing ssh
Network not ready, sleeping
Network not ready, sleeping
Network not ready, sleeping
alan@deep-thought:/tmp/1175806$

lp:~sergiusens/phablet-tools/1175806 updated
91. By Sergio Schvezov

Adding packaging information

92. By Sergio Schvezov

Removing set -e and making the timeout longer

Revision history for this message
Paul Larson (pwlars) wrote :

Works on my mako, +1

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Works nicely on a freshly flashed nexus 7

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2013-05-07 00:01:02 +0000
+++ debian/changelog 2013-05-09 20:54:26 +0000
@@ -1,3 +1,9 @@
1phablet-tools (0.13-0ubuntu1) UNRELEASED; urgency=low
2
3 * phablet-network-setup: adding wait before refreshing packagnig cache.
4
5 -- Sergio Schvezov <sergio.schvezov@canonical.com> Thu, 09 May 2013 17:48:07 -0300
6
1phablet-tools (0.12daily13.05.07ubuntu.unity.next-0ubuntu1) raring; urgency=low7phablet-tools (0.12daily13.05.07ubuntu.unity.next-0ubuntu1) raring; urgency=low
28
3 * Automatic snapshot from revision 88 (ubuntu-unity/next)9 * Automatic snapshot from revision 88 (ubuntu-unity/next)
410
=== modified file 'phablet-network-setup'
--- phablet-network-setup 2013-04-15 18:24:25 +0000
+++ phablet-network-setup 2013-05-09 20:54:26 +0000
@@ -14,8 +14,6 @@
14#14#
15# Copyright (C) 2012 Canonical, Ltd.15# Copyright (C) 2012 Canonical, Ltd.
1616
17set -e
18
19export LC_ALL=C17export LC_ALL=C
2018
21usage() {19usage() {
@@ -131,14 +129,26 @@
131EOF129EOF
132130
133 echo Installing ssh131 echo Installing ssh
134 wait=0132 nmcli_cmd="adb $ADBOPTS shell chroot /data/ubuntu /usr/bin/nmcli"
135 command=$(adb $ADBOPTS shell chroot /data/ubuntu /usr/bin/nmcli -t -f name,devices,vpn con status)133 wait=0
136 until [ -n "$command" ] || [ $wait -eq 4 ]; do134 iface=$($nmcli_cmd -t -f devices con status | tr -d '\r')
137 echo "Network not ready, sleeping"135 until [ -n "$iface" ] || [ $wait -eq 10 ]; do
138 command=$(adb $ADBOPTS shell chroot /data/ubuntu /usr/bin/nmcli -t -f name,devices,vpn con status)136 echo "Network not ready, sleeping"
139 sleep $(( wait++ ))137 iface=$($nmcli_cmd -t -f devices con status | tr -d '\r')
140 done138 sleep $(( wait++ ))
141 if [ -z "$command" ]; then139 done
140 if [ -z "$iface" ]; then
141 echo "Network setup timed out"
142 exit 1
143 fi
144 wait=0
145 ip_data=$($nmcli_cmd -t dev list iface $iface | grep ADDRESS)
146 until [ -n "$ip_data" ] || [ $wait -eq 10 ]; do
147 echo "Network not ready, sleeping"
148 ip_data=$($nmcli_cmd -t dev list iface $iface | grep ADDRESS)
149 sleep $(( wait++ ))
150 done
151 if [ -z "$ip_data" ]; then
142 echo "Network setup timed out"152 echo "Network setup timed out"
143 exit 1153 exit 1
144 fi154 fi

Subscribers

People subscribed via source and target branches