From 7cc528ac6dbb3c38c7e6dc668af7a2f886d2d412 Mon Sep 17 00:00:00 2001 From: Ian Johnson Date: Tue, 27 Oct 2020 15:09:17 -0500 Subject: [PATCH 1/2] bin/console-conf-wrapper: start snapd console-conf routine after user interacts After the user has pressed enter to being using console-conf, we should invoke the snapd routine for console-conf, which currently does the following: * Unconditionally delays refreshes for 20 minutes from when first invoked. * Blocks waiting for all pending refreshes to complete, including if those involve a reboot. This is the first step towards a more integrated user story where console-conf is a part of the first-boot process, and at least will minimize user confusion where console-conf proceeds asking about network configuration and then just hangs when snapd starts a refresh as soon as network is available. The snap routine console-conf-start command was merged to snapd with https://github.com/snapcore/snapd/pull/9418 and will be first available in snapd 2.48. Signed-off-by: Ian Johnson --- bin/console-conf-wrapper | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/console-conf-wrapper b/bin/console-conf-wrapper index 6c5a6231..a6f1a8db 100755 --- a/bin/console-conf-wrapper +++ b/bin/console-conf-wrapper @@ -79,4 +79,8 @@ fi cat /usr/share/subiquity/console-conf-wait read REPLY +# start the console-conf routine in snapd to delay any new refreshes, and wait +# for current refreshes to complete, this will print off messages if there are +# on-going refreshes +snap routine console-conf-start exec console-conf "$@" From ab27c235b06063a0d805ca8556bcdd177afd5ace Mon Sep 17 00:00:00 2001 From: Ian Johnson Date: Mon, 2 Nov 2020 09:40:22 -0600 Subject: [PATCH 2/2] bin/console-conf-wrapper: only run if available Otherwise on a system without support for `snap routine console-conf-start`, console-conf will never actually run. Thanks to @xnox for the suggestion. Co-authored-by: Dimitri John Ledkov <19779+xnox@users.noreply.github.com> --- bin/console-conf-wrapper | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/console-conf-wrapper b/bin/console-conf-wrapper index a6f1a8db..b5326665 100755 --- a/bin/console-conf-wrapper +++ b/bin/console-conf-wrapper @@ -82,5 +82,7 @@ read REPLY # start the console-conf routine in snapd to delay any new refreshes, and wait # for current refreshes to complete, this will print off messages if there are # on-going refreshes -snap routine console-conf-start +if snap routine console-conf-start --help >/dev/null 2>/dev/null; then + snap routine console-conf-start +fi exec console-conf "$@"