-
Notifications
You must be signed in to change notification settings - Fork 366
Add /etc/xattr.conf in the sandbox to workaround cross-FS copy issue #3754
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
base: main
Are you sure you want to change the base?
Changes from all commits
6189dfa
a206b3b
4fbeea1
5166894
30a481d
a1f5d08
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -148,7 +148,34 @@ def copy() -> None: | |
if src.is_dir(): | ||
cmdline += ["--no-target-directory"] | ||
|
||
run(cmdline, sandbox=sandbox(options=options)) | ||
# A valid /etc/xattr.conf is necessary to work around cross-filesystem copy failures: | ||
# https://github.com/systemd/mkosi/issues/3732. | ||
# A bug is opened with coreutils: | ||
# https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78623 | ||
# When the bug closes, this can collapse to the following with appropriate adjustments: | ||
# | ||
# run(cmdline, sandbox=sandbox(options=options)) | ||
# | ||
with tempfile.TemporaryDirectory() as tmp: | ||
import textwrap | ||
|
||
p = Path(tmp) / "xattr.conf" | ||
p.write_text( | ||
textwrap.dedent( | ||
""" | ||
* skip # Default: ignore all xattr but | ||
system.* permissions # allow well-known 'system' | ||
trusted.* permissions # allow well-known 'trusted' | ||
user.* permissions # allow well-known 'user' | ||
security.* permissions # allow well-known 'security' | ||
# but | ||
trusted.SGI_* skip # skip XFS-specific namespace (not portable) | ||
user.Beagle.* skip # skip Beagle index data (not portable) | ||
security.evm skip # skip evm (may only be written by kernel) | ||
""" | ||
) | ||
) | ||
Comment on lines
+163
to
+177
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we make this a bit smarter and also copy the btrfs attrs if we detect the destination filesystem is also btrfs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The only Normal file attributes ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have we established that? I don't remember agreeing to that. If a file is compressed on one btrfs filesystem, why shouldn't it be compressed after copying? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Because the one who "chose" to compress it was myself from 7 years ago, not the package manager. On my system, I, myself, chose to Do we want to persist local arbitrary choices or do we want that choice to be explicit made in If you want There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can make it smarter, but if we do, we might as well make a few checks on a single canary file before copying the tree and use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see the problem... Debug shows the same:
Not a bug in |
||
run(cmdline, sandbox=sandbox(options=options + ["--ro-bind", p, "/etc/xattr.conf"])) | ||
|
||
# Subvolumes always have inode 256 so we can use that to check if a directory is a subvolume. | ||
if ( | ||
|
Uh oh!
There was an error while loading. Please reload this page.