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
gadget: support for writing symlinks #7137
Conversation
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
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TODO: enable support for symlnks when needed | |
// TODO: enable support for symlinks when needed |
There was a problem hiding this 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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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 bysnap prepare-image
.At the same time, symlinks are awkward during update, thus updated will loudly complain about symlinks.