From fc09279772d14fb73ad9ec3aa3d8d79bad9be14c Mon Sep 17 00:00:00 2001 From: Maciek Borzecki Date: Fri, 21 Feb 2020 17:30:39 +0100 Subject: [PATCH] bin/console-conf-wrapper: detect whether snapd recovery chooser should run Look for the marker file left by snapd recovery chooser user request detection and attempt to run the chooser. Signed-off-by: Maciek Borzecki --- bin/console-conf-wrapper | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/console-conf-wrapper b/bin/console-conf-wrapper index 58538a8a..106b50df 100755 --- a/bin/console-conf-wrapper +++ b/bin/console-conf-wrapper @@ -10,6 +10,15 @@ trap echo_on EXIT # happened and need to force it on. Yay UNIX! stty icrnl -echo +if [ -e /run/snapd-recovery-chooser-triggered ]; then + # make sure the chooser binary is there to avoid getting into an awkward + # state and locking out the user + if [ -x /usr/lib/snapd/snap-recovery-chooser ]; then + # when recovery chooser is invoked it takes over the terminal + exec /usr/lib/snapd/snap-recovery-chooser + fi +fi + if [ "$(snap managed)" = "true" ]; then # check if we have extrausers that have no password set if grep -qE '^[-a-z0-9+.-_]+:x:' /var/lib/extrausers/passwd && ! grep -qE '^[-a-z0-9+.-_]+:\$[0-9]+\$.*:' /var/lib/extrausers/shadow; then