graysky2 / profile-sync-daemon

Symlinks and syncs browser profile dirs to RAM thus reducing HDD/SDD calls and speeding-up browsers.
https://wiki.archlinux.org/index.php/Profile-sync-daemon
Other
898 stars 84 forks source link

Add support for BSDs (tmpfs only) #344

Open morgant opened 1 year ago

morgant commented 1 year ago

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:

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 (especially rsync -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.

morgant commented 1 year ago

Oh, and we don't need to check for kmod on non-Linux OSes since they won't be using OFS.

I'll be trying to put together PRs for this and Issue #343 sometime this week.