profile-sync-daemon icon indicating copy to clipboard operation
profile-sync-daemon copied to clipboard

Increase portability of tmpfs implementation to support BSDs

Open morgant opened this issue 2 years ago • 3 comments

Per Issue #344, this increases portability to BSDs (tmpfs implementation only, of course). Specifically, the following are addressed:

  • Doesn't hard-code path to bash
  • Use rm instead of non-portable unlink
  • Avoid use of non-portable options:
    • find's -printf
    • cp's --reflink=auto
    • mv's --no-target-directory
    • pgrep's -c
  • Only require modinfo if using OverlayFS

These changes have been extracted from my own patches for an OpenBSD port (https://github.com/morgant/my-openbsd-ports/blob/main/www/profile-sync-daemon/patches/patch-common_profile-sync-daemon_in). As noted in Issue #344, there are some additional options that differ across implementations of du & stat, but I have left those changes out as there may still be some differences between BSDs that would be best applied as OS-specific patches. Similarly, OpenBSD's rsync port doesn't support the -X option since the file system doesn't support metadata, so that should remain as an OpenBSD-specific patch.

morgant avatar Jan 01 '23 14:01 morgant

Not sure how I feel about this since I do not have any BSD boxes/VMs for testing... have you been running the modified code on BSD?

graysky2 avatar Mar 17 '23 07:03 graysky2

I have been running the modified code, but only under OpenBSD. I'd certainly prefer others running different BSDs and Linux distros confirm that this work there too.

To be honest, I wasn't sure what you'd think either and am not in a rush to have these changes merged. I mainly wanted to put the idea out there, with some suggested changes, as food for thought.

Edit: I'm happy to try to keep this PR updated as I maintain my OpenBSD port (though it hasn't been accepted into ports tree yet as there wasn't enough initial interest.)

morgant avatar Mar 25 '23 20:03 morgant

OK, let's keep this open as you said. Thank for your work to bring it to other users.

graysky2 avatar Mar 26 '23 10:03 graysky2