Merge pull request #1656 from kubiko/main

bin/console-conf-wrapper: prefer use of snapd/modeenv
This commit is contained in:
Dan Bungert 2023-06-12 14:08:13 -06:00 committed by GitHub
commit a26df84032
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -22,7 +22,14 @@ if [ -e /run/snapd-recovery-chooser-triggered ]; then
fi
fi
if grep -q 'snapd_recovery_mode=install' /proc/cmdline ; then
# always prefer to use modeevn if it is available
if [ -e "/var/lib/snapd/modeenv" ]; then
mode="$(sed -n 's/mode=\([^[:space:]]*\)/\1/p' /var/lib/snapd/modeenv)"
else
mode="$(sed 's/.*snapd_recovery_mode=\([^[:space:]]*\)[[:space:]].*/\1/' /proc/cmdline))"
fi
if [ "${mode}" = "install" ]; then
echo "Installing the system, please wait for reboot"
# XXX: replace with something more user friendly after the beta?
journalctl -u snapd.service -f