Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snap: use snapctl model to determine if Classic #156

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions snap/hooks/install
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ snapctl stop --disable "$SNAP_INSTANCE_NAME.daemon"
daemon=$(snapctl get daemon)
if [ "$daemon" = "" ]
then
if grep -q -e snap_core= -e snapd_recovery_mode= /proc/cmdline
then snapctl set daemon=true
else snapctl set daemon=false
# if no model at all, it's either classic or something is wrong
if ! snapctl model > /dev/null || [ "$( snapctl model | awk '/^classic:/ { print $2 }' )" == "true" ]
then snapctl set daemon=false
else snapctl set daemon=true
fi
fi
Loading