Standalone SolidGroundUX product setup, installation, update, rollback, and removal.
Source: target-root/var/lib/solidgroundux/sgnd-setup.sh
Standalone SolidGroundUX product setup, installation, update, rollback, and removal.
Public functions
- Display standalone setup command-line help
- Parse sgnd-setup command-line arguments
- Resolve canonical setup paths from the selected target and state roots
- Run standalone sgnd-setup initialization and dispatch
Internal functions
| Function | Purpose | Arguments | Output |
|---|---|---|---|
_release_framework_root_for_target | Resolve the framework root for the selected target. | — | — |
_release_try_framework_ui | Opportunistically load the normal framework UI after the target root is known. | — | — |
_release_print | Print a line through the active UI implementation. | — | — |
_release_section_header | Render a section header through the active UI. | — | — |
_release_ask | Ask for a scalar value using framework ask() or the fallback UI. | — | — |
_release_ask_yesno | Ask a yes/no question with a default. | — | — |
_release_terminal_width | Return the usable terminal width. | — | — |
_release_clear | Clear the active terminal reliably. | — | — |
_release_line | Print a repeated border character. | — | — |
_release_metadata_field | Read one value from the canonical script Metadata block without depending on | $1 Metadata field name, for example Version or Build. | — |
_release_title | Display the sgnd-setup identity and current hostname without using framework UI libraries. | — | — |
_release_labeled_value | Print one aligned label/value pair. | — | — |
_release_info | Write verbose informational output. | — | — |
_release_ok | Write a successful-operation message. | — | — |
_release_warn | Write a warning message. | — | — |
_release_fail | Write a failure message. | — | — |
_release_run | Execute a command or report it in dry-run mode. | — | — |
_ensure_root | Re-execute sgnd-setup with elevated privileges when required. | — | — |
_set_action | Set and validate the requested setup action. | — | — |
_normalize_root | Normalize an absolute filesystem root. | — | — |
_release_locate_framework_root | Resolve the filesystem root containing the currently executing sgnd-setup copy | — | — |
_nuke_root_path | Resolve one absolute path beneath the located framework root. | — | — |
_nuke_remove_path | Remove one SolidGroundUX-owned path when present | — | — |
_nuke_remove_code | Remove installed SolidGroundUX code beneath the located root | — | — |
_nuke_remove_state_and_logs | Remove generated SolidGroundUX state and logs | — | — |
_nuke_remove_config | Remove SolidGroundUX system and per-user configuration | — | — |
_nuke_confirm | Require deliberate confirmation for a nuclear removal yield | — | — |
_action_nuke | Execute a scoped destructive SolidGroundUX cleanup | — | — |
_release_default_target_root | Derive target root only from canonical manager location. | — | — |
_release_state_persistence_enabled | Keep host-specific setup state out of development target-root workspaces. | — | — |
_release_load_state | Load standalone parameter defaults. | — | — |
_release_save_state | Persist accepted parameter values. | — | — |
_release_definition_value | Read product release metadata without sourcing project-controlled shell code. | — | — |
_release_normalize_github_url | Normalize a GitHub repository/release URL. | — | — |
_release_load_project_repo | Use the one editable Setup catalog for every project. Legacy repository.url | — | — |
_release_save_project_repo | Preserve compatibility with interactive product selection while persisting | — | — |
_setup_write_catalog_repo_urls | Change only the URL column, preserving existing product metadata, ordering, | — | — |
_release_repo_from_url | Convert a GitHub release URL to OWNER/REPO. | — | — |
_setup_catalog_source | Resolve an operator-provided catalog, a persisted setup catalog, or the | — | — |
_ensure_setup_catalog | Do not materialize the packaged defaults as local configuration just by | — | — |
_release_package_catalog | Read project\ | product\ | release-url\ |
_setup_catalog_framework_defaults | Keep legacy standalone release settings without embedding a GitHub owner/repo | — | — |
_release_select_package_interactive | Make package selection the normal entry point. Project, product, channel, version, | — | — |
_release_prompt_manual_settings | Collect explicit product/repository/channel overrides. | — | — |
_release_prompt_settings | Resolve only the installation target. Product/package selection belongs to each action. | — | — |
_package_info_value | Parse a simple KEY=value field without sourcing package-controlled shell code. | — | — |
_project_slug_safe | Validate a project slug used beneath the manager state root. | — | — |
_load_project_info | Load persisted display identity for one project. | — | — |
_set_project_context | Make all existing installation-engine functions operate on the selected project. | — | — |
_persist_project_info | Persist display identity for an admitted project package. | — | — |
_list_known_projects | List locally known project slugs. | — | — |
_select_project_interactive | Select a locally known project. | — | — |
_require_command | Verify that a required system command is available. | — | — |
_load_release_manager_config | Restore the old release line/variant when present. Any GitHub repository | — | — |
_ensure_release_manager_config | Retain legacy release line/variant state; GitHub repositories live only in | — | — |
_ensure_manager_directories | Create the state, pending-release, and archive directories required by the | — | — |
_install_setup_wrappers | Install sgnd-setup and retain sgnd-release-manager as a compatibility alias. | — | — |
_install_setup_self | Copy Setup to its canonical location, creating the directory when needed. | $1 - Optional mode: automatic (default) or prompt. | — |
_install_release_manager | Copy the currently running setup tool to the machine-local state root so | — | — |
_cleanup_bootstrap_files | Clean only known first-install files when sgnd-setup was run | — | — |
_release_choose_post_install_action | Let an interactive first-install session continue into Setup, open the | — | — |
_release_product_artifact_name | Convert a display product name to its canonical release-file identity. | — | — |
_release_base_from_archive | Derive a release base name from a tar.gz archive path. | — | — |
_release_variant_matches | Check whether an archive matches the product individual-release naming scheme. | $1 Release archive base name. | — |
_release_matches | Match an archive base to the optional requested release. | $1 Archive base name. | — |
_release_sort | Sort release identifiers by version. | — | — |
_current_release | Return the highest archived release as the current version. | — | — |
_previous_release | Return the archived release immediately preceding current. | — | — |
_list_archived_releases | List archived releases in ascending version order. | — | — |
_find_pending_archives | List pending release tarballs under the releases directory. | — | — |
_newest_pending_archive | Find the newest pending archive matching an optional release selector. | — | — |
_find_archived_archive | Find the tarball belonging to an archived release. | — | — |
_release_location | Resolve a release tarball from pending or archived storage. | — | — |
_pending_release_base_exists | Test whether a release is available in releases/. | — | — |
_archived_release_base_exists | Test whether a release is present in archive/. | — | — |
_verify_sha256_sidecar | Verify one release artifact against its SHA256 sidecar. | — | — |
_safe_relative_path | Validate and normalize a release-relative path. | — | — |
_validate_tar_paths | Reject unsafe paths contained in a release tarball. | — | — |
_validate_manifest_paths | Reject unsafe paths contained in a release manifest. | — | — |
_verify_release_set | Verify checksums and path safety for a complete release set. | — | — |
_manifest_paths | Emit normalized paths from a release manifest. | — | — |
_target_path | Map a release-relative path beneath the configured target root. | — | — |
_remove_paths_from_stream | Remove streamed release paths conservatively from the target. | — | — |
_apply_removed_manifest | Apply the incoming release removal manifest. | — | — |
_remove_release_difference | Remove paths present in one release manifest but absent from another. | — | — |
_archive_release_set | Move an installed pending release set into versioned archive history. | — | — |
_move_archive_dir_to_releases | Return one archived release directory to releases/. | — | — |
_move_newer_archives_to_releases | Return archived versions newer than a rollback target to releases/. | — | — |
_move_all_archives_to_releases | Return all archived releases to releases/. | — | — |
_remember_release_channel | Persist the channel of the successfully installed release. | — | — |
_extract_release | Extract a complete SolidGroundUX release beneath the target root. | — | — |
_install_pending_archive | Install, update, or roll back to a pending release archive. | — | — |
_rollback_to_archived_release | Make the installed framework match a selected archived release. | — | — |
_remove_by_manifest | Remove exactly the files/symlinks owned by a selected release manifest. | — | — |
_file_belongs_to_product | Recognize the canonical title header '# <Product> - ...' and an explicit | — | — |
_scan_product_owned_paths | Recover product ownership without a release manifest by inspecting file headers. | — | — |
_remove_by_product_scan | Provide a recovery cleanup independent of release manifests by scanning canonical | — | — |
_remove_bundle_products_by_scan | Apply ownership cleanup to each product recorded in RELEASE-PRODUCTS. | — | — |
_download_to | Download or copy a release source to a destination file. | — | — |
_github_release_json | Read latest-release metadata by default, or the 100 most recent published | — | — |
_github_release_asset_rows | Extract downloadable individual product ZIPs from one release or a list | $1 GitHub Releases API JSON. | — |
_github_latest_asset | Inspect the latest GitHub Release's assets, selecting the highest | — | — |
_github_published_assets | Inspect up to 100 most recent published GitHub releases, collect matching | — | — |
_latest_online_release | Resolve the highest build asset attached to the configured GitHub Release. | — | — |
_github_release_asset_url | Return the browser download URL selected by _github_latest_asset. | — | — |
_release_is_local_or_installed | Test whether a release is already downloaded or archived. | — | — |
_admit_extracted_release | Validate an extracted release ZIP and admit its artifacts to releases/. | — | — |
_acquire_release | Acquire, stage, validate, and admit a release ZIP. | — | — |
_package_zip_info_value | Read one package metadata value directly from a ZIP. | — | — |
_package_zip_record | Describe one valid product package ZIP. | — | — |
_package_store_dir | Return the canonical pending product-package directory. | — | — |
_package_archive_dir | Return the canonical installed package archive directory. | — | — |
_scan_product_packages | Scan one directory for valid product release ZIPs. | — | — |
_local_package_catalog | List canonical pending and archived product ZIPs | — | — |
_newest_local_package_for_project | Resolve newest local product ZIP for one project. | — | — |
_admit_product_package_zip | Copy one valid product ZIP into canonical releases. | — | — |
_archive_product_package_zip | Archive the original ZIP after successful installation. | — | — |
_install_product_package_zip | Install one product ZIP through the canonical tar engine | — | — |
_select_package_records | Select one, several, or all package records. | — | — |
_product_catalog | List known products without requiring package preselection. | — | — |
_select_product_records | Select one, several, or all known products. | — | — |
_install_explicit_package_source | Install a directly supplied product ZIP source. | — | — |
_action_install_latest_local_packages | Select/install newest local package per product. | — | — |
_action_install_other_packages | Select/install product ZIPs from another directory. | — | — |
_action_install_latest_github_products | Select products, download/install newest GitHub ZIPs. | — | — |
_select_github_release_asset | Show up to 12 builds per page, newest first, with installed/downloaded | $1 Product display name. | — |
_action_install_selected_github_release | Select a product, list its published GitHub release ZIPs across GitHub | — | — |
_release_display_identity | Reduce a release basename to Version.Build for display. | — | — |
_installed_product_release | Report the actually installed version/build; archived releases and defaults | $1 Product project slug; $2 product display name. | — |
_dashboard_product_rows | Read installed definitions, canonical local ZIPs and latest GitHub releases. | — | — |
_bootstrap_first_install_packages | First install from adjacent product ZIPs | — | — |
_confirm | Request a standalone yes/no confirmation. | — | — |
_bundle_products_file | Locate RELEASE-PRODUCTS metadata retained beside the installed or pending bundle. | — | — |
_bundle_product_names | Read the first field of RELEASE-PRODUCTS records without hard-coding products. | — | — |
_select_bundle_removal_scope | Present products from RELEASE-PRODUCTS dynamically so future bundle members require | — | — |
_select_archived_release | Select an archived release from the available release history. | — | — |
_print_status | Display the product setup dashboard | — | — |
_setup_default_repo_url | Resolve a product URL from the packaged default, never the editable catalog. | — | — |
_setup_configure_github_repositories | Show each currently effective GitHub URL and read one response: | — | — |
_setup_select_product_zip | List a directory's product release ZIPs, newest first, with a simple | $1 Project slug. | — |
_setup_choose_install_package | Resolve one of five package sources to a concrete ZIP path or GitHub URL. | — | — |
_setup_release_action | Name Install, Update, Reinstall, or Downgrade for the confirmation screen. | — | — |
_setup_install_selected_products | Select one or several products and a package source for each, confirm | — | — |
_setup_remove_selected_products | Select installed products, confirm once, and remove MCM/SDK before Framework. | — | — |
_interactive_menu | Offer Install / Update, multi-product Remove and GitHub URL configuration. | — | — |
_pause | Wait for Enter after an interactive operation. | — | — |
_action_check | Report the latest GitHub release and its local state. | — | — |
_action_download | Acquire the latest or explicitly sourced release without installing it. | — | — |
_action_update | In interactive mode, select the configured GitHub source or a package ZIP/URL, | — | — |
_action_install | Install the newest matching pending local release. | — | — |
_action_rollback | Install the previous or explicitly selected archived release. | — | — |
_action_remove | Remove the active SolidGroundUX installation after confirmation. | — | — |
Description
Provides self-sufficient first-install and lifecycle setup for SolidGroundUX products.
The script:
- Keeps SolidGroundUX release state in the legacy releases/archive locations
- Keeps other project release state under /var/lib/solidgroundux/projects/<project>/
- Reads release-package.info from incoming ZIPs to select the owning project
- Installs a first release by verifying and extracting its complete tar archive
- Updates an existing installation and applies the incoming .removed manifest
- Rolls back by making the installed filesystem match a selected archived release
- Removes selected products using active release manifests, with ownership-scan recovery
- Provides root-scoped nuclear cleanup yields for state/log cleanup, code removal, or complete SolidGroundUX eradication without requiring a working framework
- Queries GitHub for the latest published release or lets users select a published build
- Bootstraps a clean machine from sgnd-setup.sh plus adjacent product release ZIPs
- Installs a canonical setup copy under /var/lib/solidgroundux for future recovery
- Uses a small self-contained UI before SolidGroundUX is available
- Reuses the normal SolidGroundUX UI primitives/theme when a healthy framework is available
- Persists setup parameter values as standalone state
- Offers Setup, Management Console, or shell exit after first install
Design principles
- Standalone operation even when SolidGroundUX is absent or damaged
- Product ZIPs are the release unit; acquisition varies, installation does not
- Complete release archives; no incremental binary patching
- Conservative removal: files/symlinks are removed, directories only when empty
- Product ZIP acquisition is transactional; successful installs archive the original ZIP
- Bootstrap cleanup is limited to known setup/package files under /tmp
- Nuclear cleanup derives its deletion root from the canonical framework-locator algorithm
Standalone UI
Default-theme-compatible standalone palette. Kept local so the setup tool remains self-sufficient. Bootstrap palette: design-time snapshot of the SolidGroundUX default theme. It deliberately mirrors the normal default palette/style closely, but has no runtime dependency on SolidGroundUX.
