Closed Cornelicorn closed 8 months ago
Yes this is a known issue. Unfortunately cp
just can't handle this. And rsync
doesn't support reflinks, so whatever we use will be bad in some form.
Ideally someone would implement --keep-directory-symlink
for cp
.
Ideally someone would implement --keep-directory-symlink for cp.
Just submitted a patch, will link it here once it appears in the archives. This won't fix your issue but it will at least provide a future solution if accepted.
Just to confirm: This works for me, when using an extra search path for cp
and
diff --git a/mkosi/tree.py b/mkosi/tree.py
index 014f130..27d3ef1 100644
--- a/mkosi/tree.py
+++ b/mkosi/tree.py
@@ -68,6 +68,8 @@ def copy_tree(
"--no-dereference",
f"--preserve=mode,timestamps,links,xattr{',ownership' if preserve_owner else ''}",
"--reflink=auto",
+ "--copy-contents",
+ "--keep-directory-symlink",
src, dst,
]
This is the same issue as https://github.com/systemd/mkosi/issues/166 but as it reappeared, I thought I'd open a new bug report.
I'm trying to build
sbctl
in an mkosi container. The output provides/usr/local/share/man/man8/sbctl.8
, which is outputted intoDESTDIR
inmkosi.build.chroot
in my case.mkosi
then tries to install that file to the regular tree, which fails: