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

gadget: support for writing symlinks #7137

Conversation

bboozzoo
Copy link
Collaborator

Add support for writing symlinks in mounted filesystem writer. Since mounted filesystem writer is used for 'populating the staging directory while preparing a structure image in snap-image, this enables us to correctly preserve optimizations made by snap prepare-image.

At the same time, symlinks are awkward during update, thus updated will loudly complain about symlinks.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
The pc and pi snaps do not use symlinks for its data. Since symlink handling
during update would be awkward enough, error out rather than silently fail.

We will add support when such need arises.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
gadget/mountedfilesystem.go Outdated Show resolved Hide resolved
gadget/mountedfilesystem.go Outdated Show resolved Hide resolved
@@ -520,6 +541,11 @@ func (f *MountedFilesystemUpdater) checkpointPrefix(dstRoot, target string, back
for prefix := filepath.Dir(target); prefix != "." && prefix != "/"; prefix = filepath.Dir(prefix) {
prefixDst, prefixBackupBase := f.entryDestPaths(dstRoot, "", prefix, backupDir)

// TODO: enable support for symlnks when needed
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// TODO: enable support for symlnks when needed
// TODO: enable support for symlinks when needed

gadget/mountedfilesystem.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@zyga zyga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Silly typo :)

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Copy link
Collaborator

@zyga zyga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

@stolowski stolowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bboozzoo bboozzoo merged commit 9f8dbf7 into snapcore:master Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants