-
-
Notifications
You must be signed in to change notification settings - Fork 743
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
xattr support for NetBSD #1332
Comments
Can't get it to work, neither do the command line utilities (listextattr(1) etc). Everything's a EOPNOTSUP, independent of file system (FFS, UDF, ext2fs). Looking at the kernel code and config it should work with at least FFS and UDF (after initattr etc) If someone uses NetBSD and Borg, feel free to test it whether it actually works (db6ce48) src/borg/xattr.py: elif sys.platform.startswith(('freebsd', 'netbsd')): |
"whether it actually works" <-- (if you run the tests and the one test in src/borg/testsuite/xattr passes and is not skipped - then it works) |
https://mail-index.netbsd.org/tech-kern/2022/05/24/msg028105.html Looks like we have to wait for netbsd 10. Hmm, guess like the xattr stuff is already in the pre-release netbsd 10 code (and also the fs corruption issues seem to be solved), so if someone has time, that could be worked on. After getting that to work on netbsd 10 pre, behaviour of the new code should be also tested on netbsd < 10 again, so it works there as expected (== without supporting xattrs, but not crashing or malfunctioning). |
NetBSD 10 is released: Vagrant machine - is netbsd 10 already available?: https://app.vagrantup.com/boxes/search?architecture=amd64&provider=virtualbox&q=netbsd&sort=created |
Still no vagrant box, no netbsd user caring for this. Guess I'll remove it from milestone. |
Thinking of trying to test this, on NetBSD 10, and only just noticed, that extended attributes aren't enabled, out-of-the-box, according to https://wiki.netbsd.org/tutorials/acls_and_extended_attributes_on_ffs/, on FFS volumes. It might also be interesting, to see how the latest version of the ZFS implementation behaves. |
Yeah, please try it! If you want to work on the borg code and have questions, either ask here or on #borgbackup on liberachat IRC. |
Seems that the official public/final release of NetBSD 10, for x86-64 is a total trainwreck, in terms of actually being able to reliably install it, on a VMware Workstation, or QEMU VM, without configuration files being missing, the root file system being corrupted, random number generator seeds not being created, or some other weird, and wonderful issue arising. However, if I install a Daily build (
Obviously, the Linux ABI compatibility later is not a faithful, 100%-compatible clone of the "real" Linux ABI, and doesn't represent the behaviour of the native NetBSD ABI surface, but until I get around to actually building a native version of Borg, it could be useful, for some testing... |
Seems that I can at least create a repository, using the NetBSD compatibility layer, and add a file to it, after adding an extended attribute, in the "user" namespace:
Doesn't look like the extended attribute is actually accessed, when I look at the contents of BSDTest/data/0/, with "strings":
|
Briefly trying to install PIP, and a native version of BorgBackup, from it:
Looks like I probably need more things adding, to a virgin installation of NetBSD, to get further, but I'm not going to have time, to dig into this, tonight. |
Looks like I can cleanly install the dependencies, and Borg itself, at least, using - which seems promising...
I haven't tried to use the Vagrant stuff, but I didn't seem to need anything additional, for this release. |
Seems that the new, native Borg binary will run, and I can create an archive with it - but, it says there's no new unique chunks, when I try to use it to archive the
For what it's worth, the version of TAR shipped with NetBSD 10 stores the attributes in a seemingly Linux-compatible way, when called with
The pax implementation defaults to ustar, and it doesn't seem to be possible, to have it include ACLs/xattrs in an archive. Attaching a GZip'd copy of the TAR archive, for testing TAR imports, in the future - NetBSD-Attributes.tar.gz |
I don't claim massive amounts of expertise with the internals of NetBSD, or Borg itself, but from comparing system call traces, from
Unsure if it's down to a compilation-time issue, missing headers/libraries, or something else, right now... |
@vmlemon IIRC we have install docs for NetBSD and there is also the Can you please compare the steps you needed with our install docs / Vagrantfile? If there is "nothing new", then please remove all the console logs about your unsuccessful first tries from this issue. If you found differences, please file a separate documentation issue and then also remove the console log from this issue. This issue is NOT about installing borg on NetBSD, but about xattr support for NetBSD. borg needs a code change to do xattrs on NetBSD, see the first few comments in this issue. After doing that code change:
Also, guess we don't want to test NetBSDs Linux ABI, but rather run borg natively and check whether it works correctly on NetBSD. |
Annoyingly, |
Thanks, @ThomasWaldmann. I wasn't sure if the change was already in one of the latest releases of Borg, but I'll go through, and tidy things up. |
As you use borg 1.4.0, this is the relevant code: https://github.com/borgbackup/borg/blob/1.4-maint/src/borg/platform/__init__.py Guess there could be some https://github.com/borgbackup/borg/blob/1.4-maint/setup.py#L195 This is then needed on netbsd also. We have automated tests for xattrs. Have a look so they get run on netbsd also. |
NetBSD has a compatibility layer to Linux' xattr API: https://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/sys/sys/xattr.h (w/ no access to the system namespace, whatever that's used for)
The native mechanism is sys/extattr.h - this then also allows access to the system namespace.
Edit: In fact, it seems that NetBSD's extattr API is identical to FreeBSD's. So this might just be a matter of adding "netbsd" in xattr to the platform check.
Note: OpenBSD has neither ACLs nor xattrs.
The text was updated successfully, but these errors were encountered: