Skip to content

OS (FreeBSD): fall back to the base os-release - #2760

Closed
djberg96 wants to merge 1 commit into
fastfetch-cli:devfrom
djberg96:fix-freebsd-os-release
Closed

djberg96 wants to merge 1 commit into
fastfetch-cli:devfrom
djberg96:fix-freebsd-os-release

Conversation

@djberg96

Copy link
Copy Markdown

Summary

The FreeBSD port sets TARGET_DIR_ETC to /usr/local/etc, so the OS module misses FreeBSD's /etc/os-release and returns Could not detect OS. Fall back to the base system's release file on FreeBSD when the configured file did not provide an OS identity.

Related issue

Closes #2759

Changes

  • Preserve the configured TARGET_DIR_ETC file's precedence and the explicit custom release path behavior.
  • Resolve the fallback under TARGET_DIR_ROOT, so alternate target roots remain supported.
  • Document the fix in the changelog.

Validation

  • Reproduced the failure on FreeBSD 15.1 with a fresh dev build configured with TARGET_DIR_ETC=/usr/local/etc; the patched build reports FreeBSD 15.1-RELEASE-p7 in the OS JSON result.
  • Built with a separate fixture target root and verified that a configured local release file takes precedence, and that removing it selects the target root's /etc/os-release.
  • Ran ctest --test-dir /tmp/bsdrunner-fastfetch-build --output-on-failure: 21/21 tests passed.

Checklist

  • I have tested my changes locally.

@djberg96

Copy link
Copy Markdown
Author

Closing since it looks like 73c1ba0 was applied instead.

@djberg96 djberg96 closed this Nov 28, 2026
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.

[BUG] FreeBSD OS detection misses base /etc/os-release

1 participant