diff --git a/README.md b/README.md index fa2f176..e62299c 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@ Observer-only file access notifications for [ScoutFS](https://github.com/versity/scoutfs), distributed as a rebasable `git format-patch` series plus a small Go -userspace relay daemon. Layers onto each upstream release with minimal -maintenance. +userspace relay daemon. Maintained as one long-lived branch per +currently-supported upstream scoutfs version. ## What the series adds -Three patches against the scoutfs source tree: +Three patches against each supported scoutfs release: 1. **Kmod core** — a per-mount 64 KiB ring of 64-byte notification records and a single-reader drain ioctl (`SCOUTFS_IOC_READ_NOTIFY`, nr 25). Emit is @@ -25,58 +25,67 @@ Three patches against the scoutfs source tree: clients. Pure-stdlib Go; no external module dependencies. Shipped with a systemd template unit `scoutfs-notifyd@.service`. -## Base +The notify ABI (`SCOUTFS_IOC_READ_NOTIFY` nr 25, 64-byte event record) is +identical across all three supported scoutfs versions, so consumers and +the daemon do not need per-version branching in their own code. -Currently rebased against: +## Repository layout - scoutfs v1.30 +Each supported scoutfs version lives on its own long-lived branch. The +patches in each branch are tuned for that specific scoutfs tree; they do +NOT apply cross-version without rebasing. -See [base.txt](./base.txt). +| Branch | Targets scoutfs | Tag | +|----------------|-----------------|------------------| +| `v1.28` | `v1.28` | `v1.28-notify-1` | +| `v1.29` | `v1.29` | `v1.29-notify-1` | +| `main` / `v1.30` | `v1.30` | `v1.30-notify-1` | -## Build dependencies added - -On top of the stock scoutfs build requirements, patch 3 adds: - -* `golang >= 1.26` on the build host (fetched from go.dev by the CI; no distro currently packages 1.26). - - -The Go build is offline (`GOPROXY=off`) — no network access required at -build time. `CGO_ENABLED=0` so the produced binary is a pure-Go static -ELF. +`main` tracks the newest supported scoutfs version. When a new scoutfs +release ships, a new branch is created and the patches are rebased onto +it; when a scoutfs version ages out of support, its branch stays in the +repo for historical builds but is no longer maintained. ## Applying +Against a scoutfs git working tree at the matching upstream tag: + ```sh -./apply.sh /path/to/scoutfs +git clone -b v1.29 https://git.anomalous.dev/alphacentri/scoutfs-notify.git /tmp/notify +/tmp/notify/apply.sh /path/to/scoutfs-v1.29-checkout ``` -Runs `git am --3way` on each patch. For a tarball instead of a git tree, -loop `patch -p1 < patches/*.patch`. +The script runs `git am --3way` on each patch in order. ## Rebasing onto a new upstream release ```sh -git fetch --tags -git checkout -B notify v1.30 -git am --3way patches/*.patch -# resolve any conflicts, git am --continue -git format-patch v1.30..notify -o patches/ -# update base.txt and commit +# In a fresh scoutfs checkout: +git checkout v1.31 +git checkout -b notify-v1.31 + +# Apply the previous branch's patches (usually clean; resolve any +# conflicts, git am --continue). +git am --3way /path/to/scoutfs-notify-v1.30/patches/*.patch +git format-patch v1.31..notify-v1.31 -o /tmp/new-patches/ + +# Push a new branch + tag in this repo: +cd /path/to/scoutfs-notify +git checkout -b v1.31 main +rm patches/*.patch +cp /tmp/new-patches/*.patch patches/ +echo v1.31 > base.txt +git commit -am 'v1.31-notify-1: rebase onto scoutfs v1.31' +git push -u origin v1.31 +git tag v1.31-notify-1 && git push origin v1.31-notify-1 +# Fast-forward main to the new tip once you're ready to promote it. ``` -## Tag history - - v1.30-notify-1 (current — rebased onto scoutfs v1.30, no code changes) -v1.29-notify-4 (retired — last v1.29-base release) -v1.29-notify-3 (retired — Go 1.21 toolchain) - v1.29-notify-2 (retired — C daemon; had latent ring-size compile bug) - v1.29-notify-1 (retired — shipped mount options) - ## Quick smoke test after installation ```sh systemctl enable --now scoutfs-notifyd@mnt-scoutfs.service -FSID=$(stat -f -c %i /mnt/scoutfs) # or use your scoutfs cli +FSID=$(scoutfs stat /mnt/scoutfs | awk '/fsid/ { print $2 }') socat - UNIX-CONNECT:/run/scoutfs/${FSID}/notify.sock | xxd | head # touch some files in /mnt/scoutfs in another terminal ```