Skip to content
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

Increase portability of tmpfs implementation to support BSDs #348

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

morgant
Copy link
Contributor

@morgant morgant commented Jan 1, 2023

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.

@graysky2
Copy link
Owner

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?

@morgant
Copy link
Contributor Author

morgant commented Mar 25, 2023

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.)

@graysky2
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants