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

cmd/snap-confine: call sc_should_use_normal_mode once #6573

Merged
merged 5 commits into from
Mar 9, 2019

Conversation

zyga
Copy link
Collaborator

@zyga zyga commented Mar 6, 2019

Historically snap-confine used two modes of operation. Initially on core
systems snap-confine would unshare the mount namespace and preform some
alterations but would otherwise run with the contents of the initial
mount namesapce. On classic systems snap-confine would pivot into the
base snap (core) and perform some more alterations.

With the introduction of multiple boot bases, per-snap bases some of
that logic seems rusty. To make it less confusing what is going on
reduce the number of places that determine if legacy (sans-pivot) or
normal mode (with pivot) to exactly one.

There is more cleanup that can be done but it will require making the
invocation structure something we can pass around to more functions.
This will be attempted in subsequent patches.

Signed-off-by: Zygmunt Krynicki zygmunt.krynicki@canonical.com

Historically snap-confine used two modes of operation. Initially on core
systems snap-confine would unshare the mount namespace and preform some
alterations but would otherwise run with the contents of the initial
mount namesapce. On classic systems snap-confine would pivot into the
base snap (core) and perform some more alterations.

With the introduction of multiple boot bases, per-snap bases some of
that logic seems rusty. To make it less confusing what is going on
reduce the number of places that determine if legacy (sans-pivot) or
normal mode (with pivot) to exactly one.

There is more cleanup that can be done but it will require making the
invocation structure something we can pass around to more functions.
This will be attempted in subsequent patches.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
@zyga
Copy link
Collaborator Author

zyga commented Mar 6, 2019

This is based on #6572 and #6571

zyga and others added 2 commits March 6, 2019 19:32
This allows us to almost start passing sc_invocation instead of a
plethora of arguments to various functions inside ns-support and
mount-support modules.

This also makes it a tiny bit problematic because is_normal_mode is a
boolean that is only set inside the non-classic code path. This is
correct for now but should be carefully changed later.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
@pedronis pedronis merged commit 5a569f1 into snapcore:master Mar 9, 2019
@zyga zyga deleted the tweak/refactor-sc-main-3 branch March 11, 2019 08:10
@zyga zyga added this to In progress in Core16 using pivoting mount namespace via automation Mar 18, 2019
@zyga zyga moved this from In progress to Done in Core16 using pivoting mount namespace Mar 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants