-
Notifications
You must be signed in to change notification settings - Fork 80
Freebsd: First script working in bare jail...and what it took to get that working #517
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
Draft
sgharms
wants to merge
14
commits into
trunkmaster:freebsd
Choose a base branch
from
sgharms:freebsd
base: freebsd
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Replace hardcoded sudo references with PRIV_CMD variable in: - INSTALL_CMD: handles FreeBSD (no -E flag) vs Linux (with -E flag) - RM_CMD, LN_CMD, MV_CMD, CP_CMD, MKDIR_CMD: use PRIV_CMD prefix This allows these commands to adapt to the detected privilege escalation method (root, doas, or sudo).
Add print_WARN() helper function for displaying warning messages with yellow/red formatting, consistent with other print helpers.
…handling Refactor prepare_freebsd_environment() to intelligently handle privilege escalation: - Detect if running as root and skip privilege escalation - Try doas first (with config validation) if not root - Fall back to sudo if doas unavailable or unconfigured - Provide clear error if neither is available This replaces the previous approach that only checked for sudo and failed if it wasn't installed.
Add *.sw? pattern to ignore vim swap files (.swp, .swo, etc).
Introduce PRIV_CMD variable that detects the appropriate privilege escalation command based on the environment: - Running as root: no escalation needed (empty string) - FreeBSD: prefer doas (if configured), fall back to sudo - Linux: use sudo This provides a single point of configuration for all privilege escalation needs across the build scripts.
Add cmake to CORE_SYSTEM_DEPS for FreeBSD 15. This package is required for building CoreFoundation and should be installed alongside the other build dependencies.
Replace hardcoded sudo calls with PRIV_CMD variable: - pkg install command for FreeBSD dependencies - ldconfig command after installation This allows the script to work when running as root or with doas.
On FreeBSD, create a dedicated ldconfig drop-in file at /usr/local/libdata/ldconfig/nextspace containing the NextSpace library path, then run 'ldconfig -R' to rebuild hints from all configured paths. This follows FreeBSD conventions for package-specific library paths and ensures the libraries are properly registered in the system.
Introduce NEXTSPACE_ROOT variable to define the installation root: - FreeBSD: /usr/local/NextSpace (third-party software convention) - Linux: /usr/NextSpace (existing convention) This allows the NextSpace project to follow FreeBSD filesystem hierarchy standards while maintaining compatibility with existing Linux installations.
Replace hardcoded /usr/NextSpace paths with NEXTSPACE_ROOT variable throughout the CoreFoundation build script: - CMake configuration flags (install prefix, library paths, include paths) - CFNetwork configuration (Linux only) - Install directory paths - ldconfig configuration path This allows the script to adapt to the correct installation location for each OS (FreeBSD: /usr/local/NextSpace, Linux: /usr/NextSpace).
Move PRIV_CMD definition earlier and remove duplicated privilege escalation logic from prepare_freebsd_environment().
Reduce three-way branch to two-way: sudo needs -E flag, everything else (doas or root) doesn't.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@trunkmaster
Per our other conversations, here's the first script running in a way that's consistent with FreeBSD design and practice. Let's iron out any design conflicts on one script and then use those conventions to carry through the rest of the installer.