-
Notifications
You must be signed in to change notification settings - Fork 88
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
Add support for BSDs (tmpfs only) #344
Comments
Oh, and we don't need to check for I'll be trying to put together PRs for this and Issue #343 sometime this week. |
morgant
added a commit
to morgant/profile-sync-daemon
that referenced
this issue
Jan 1, 2023
morgant
added a commit
to morgant/profile-sync-daemon
that referenced
this issue
Jan 1, 2023
…th '-exec basename' since we just want the filename. Issue graysky2#344
morgant
added a commit
to morgant/profile-sync-daemon
that referenced
this issue
Jan 1, 2023
morgant
added a commit
to morgant/profile-sync-daemon
that referenced
this issue
Jan 1, 2023
morgant
added a commit
to morgant/profile-sync-daemon
that referenced
this issue
Jan 1, 2023
morgant
added a commit
to morgant/profile-sync-daemon
that referenced
this issue
Jan 1, 2023
…d use of non-portable --no-target-directory. Issue graysky2#344
morgant
added a commit
to morgant/profile-sync-daemon
that referenced
this issue
Jan 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm well aware that
profile-sync-daemon
was developed specifically for Linux and that's obviously the only way to use the Overlay Filesystem support. That said, the basic tmpfs support can be made to support BSDs with little effort.I have been working on an OpenBSD port (https://github.com/morgant/my-openbsd-ports/blob/main/www/profile-sync-daemon/patches/patch-common_profile-sync-daemon_in) and the biggest issues I ran into are:
mv
doesn't support the--no-target-directory
option in OpenBSD. All the uses ofmv --no-target-directory
already verify that the source is a directory anyway, so the--no-target-directory
can be omitted under OpenBSD because the "source operand is skipped with an error message when the respective destination path is a non-empty directory" (per OpenBSD's mv(1)).cp
doesn't support the--reflink=auto
option in OpenBSD. Use ofcp --reflink=auto
under Linux just forces it to perform a standard copy anyway (see Linux's cp(1)), so it can be omitted under OpenBSD.du
doesn't have a--max-depth
option in OpenBSD, butdu --max-depth=0
can be substituted withdu -d 0
under OpenBSD.stat -c %a
can be replaced withstat -f %OLp
under OpenBSD, so pretty minor.unlink
doesn't exist under OpenBSD, so can just userm
for better compatibility on all platforms.pgrep
doesn't have a-c
(count) option under OpenBSD, so can just usepgrep -f "psd-suspend-sync" | wc -l | tr -d ' '
for better compatibility on all platforms.-X
option needs to be stripped fromrsync
calls. That can easily be left as an patch in the OpenBSD port as other BSDs (esp. FreeBSD) file systems do support extended attributes, but I figured I'd mention it anyway.Some of these are Linux-specific options that are unnecessary under most BSDs (e.g.
mv
&cp
issues), or GNU-style options that differ on BSDs (e.g.du
&stat
), both of which can probably just be handled as Linux vs BSD cases or be left as patches in the OS-specific ports (especiallyrsync -X
). The others are pretty minor tweaks to just use more portable calls (e.g.unlink
&pgrep
).I'll extract a patch from my WIP OpenBSD port and submit a PR in the hopes that others can test under other BSDs (or I can when I have more time). If we can merge in something that handles all BSDs with little extra logic, I'd love that, but if I have to keep maintaining OpenBSD-specific patches in my port, that's totally fine.
The text was updated successfully, but these errors were encountered: