### Setup Build Environment Source: https://github.com/ublue-os/aurora/blob/main/AGENTS.md Installs the Just command runner, verifies container runtime availability, and sets up pre-commit hooks. These tools are mandatory for managing the build lifecycle and ensuring code quality. ```bash curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/.local/bin export PATH="$HOME/.local/bin:$PATH" podman --version || docker --version pip install pre-commit ``` -------------------------------- ### Third-Party Repository Installation (Bash) Source: https://context7.com/ublue-os/aurora/llms.txt Installs packages from third-party repositories like Tailscale and Docker. It uses isolated enablement by adding the repository, disabling it, and then enabling it only for the installation command. ```bash #!/usr/bin/bash source /ctx/build_files/shared/copr-helpers.sh # Install tailscale from official repo dnf config-manager addrepo --from-repofile=https://pkgs.tailscale.com/stable/fedora/tailscale.repo dnf config-manager setopt tailscale-stable.enabled=0 dnf -y install --enablerepo='tailscale-stable' tailscale # Install Docker from official repo dnf config-manager addrepo --from-repofile=https://download.docker.com/linux/fedora/docker-ce.repo sed -i "s/enabled=.*/enabled=0/g" /etc/yum.repos.d/docker-ce.repo dnf -y install --enablerepo=docker-ce-stable \ docker-ce \ docker-ce-cli \ docker-compose-plugin ``` -------------------------------- ### Kernel and AKMODS Installation (Bash) Source: https://context7.com/ublue-os/aurora/llms.txt Installs the kernel and out-of-tree kernel modules from pre-built AKMODS packages. It removes existing kernel packages, installs new ones, locks the kernel version, and installs hardware support modules. ```bash #!/usr/bin/bash set -eoux pipefail # Remove existing kernel packages for pkg in kernel kernel{-core,-modules,-modules-core,-modules-extra,-tools-libs,-tools}; do rpm --erase "${pkg}" --nodeps done rm -rf /usr/lib/modules # Install new kernel from AKMODS dnf5 -y install \ /tmp/kernel-rpms/kernel-[0-9]*.rpm \ /tmp/kernel-rpms/kernel-core-*.rpm \ /tmp/kernel-rpms/kernel-modules-*.rpm # Lock kernel version dnf5 versionlock add kernel kernel-devel kernel-devel-matched kernel-core \ kernel-modules kernel-modules-core kernel-modules-extra # Install hardware support modules dnf -y install /tmp/rpms/{common,kmods}/*xone*.rpm \ /tmp/rpms/{common,kmods}/*openrazer*.rpm || true dnf -y install /tmp/rpms/{kmods,common}/*v4l2loopback*.rpm || true # Add AKMODS signing certificate mkdir -p /etc/pki/akmods/certs ghcurl "https://github.com/ublue-os/akmods/raw/refs/heads/main/certs/public_key.der" \ --retry 3 -Lo /etc/pki/akmods/certs/akmods-ublue.der ``` -------------------------------- ### NVIDIA Driver Installation (Bash) Source: https://context7.com/ublue-os/aurora/llms.txt Installs NVIDIA open-source drivers and configures kernel arguments for proper GPU initialization. It excludes incompatible packages to ensure a smooth installation process. ```bash #!/usr/bin/bash set -eoux pipefail # Exclude incompatible package dnf config-manager setopt excludepkgs=golang-github-nvidia-container-toolkit ``` -------------------------------- ### Install NVIDIA Drivers and Configure System Source: https://context7.com/ublue-os/aurora/llms.txt Installs NVIDIA drivers from AKMODS, removes nouveau ICD files, creates a symlink for the NVML library, and configures kernel boot arguments to blacklist nouveau and enable NVIDIA DRM modesetting. ```bash IMAGE_NAME="${BASE_IMAGE_NAME}" AKMODNV_PATH="/tmp/rpms/nvidia" MULTILIB=0 \ /tmp/rpms/nvidia/ublue-os/nvidia-install.sh # Remove nouveau ICD files rm -f /usr/share/vulkan/icd.d/nouveau_icd.*.json # Create symlink for NVML library ln -sf libnvidia-ml.so.1 /usr/lib64/libnvidia-ml.so # Configure kernel boot arguments tee /usr/lib/bootc/kargs.d/00-nvidia.toml < /usr/lib/modules-load.d/zfs.conf ``` -------------------------------- ### COPR Package Installation Helper (Bash) Source: https://context7.com/ublue-os/aurora/llms.txt The `copr_install_isolated` function securely installs packages from Fedora COPR repositories by enabling the repository only during the installation process. This helps prevent supply chain attacks. ```bash #!/usr/bin/bash source /ctx/build_files/shared/copr-helpers.sh # Install single package from COPR copr_install_isolated "ublue-os/staging" "fw-fanctrl" # Install multiple packages from same COPR copr_install_isolated "ublue-os/packages" \ "kcm_ublue" \ "krunner-bazaar" \ "oversteer-udev" \ "uupd" # Install from third-party COPR copr_install_isolated "lizardbyte/beta" "sunshine" ``` -------------------------------- ### GitHub Actions Reusable Build Workflow Source: https://context7.com/ublue-os/aurora/llms.txt A reusable GitHub Actions workflow designed to handle the complete CI/CD pipeline, including building, signing, and publishing container images. The example shows how to call this workflow with specific parameters. ```yaml # Example workflow call name: Build Images on: schedule: - cron: "0 1 * * TUE" # Weekly on Tuesday workflow_dispatch: jobs: build: uses: ./.github/workflows/reusable-build.yml secrets: inherit with: brand_name: aurora stream_name: stable # kernel_pin: "6.10.10-200.fc42.x86_64" # Optional kernel pin ``` -------------------------------- ### Run Built Container (Bash) Source: https://context7.com/ublue-os/aurora/llms.txt Starts an interactive bash shell within a locally built Aurora container. This allows for testing and inspection of the containerized environment. ```bash # Run the default Aurora image just run aurora latest main # Run the DX variant just run aurora-dx stable nvidia-open # Container starts with bash shell for interactive exploration ``` -------------------------------- ### Install COPR Packages with Isolation Source: https://github.com/ublue-os/aurora/blob/main/AGENTS.md Uses the copr_install_isolated helper function to install packages from COPR repositories while preventing long-term repository conflicts. ```bash # Install packages from COPR with isolated repo enablement copr_install_isolated "ublue-os/staging" package1 package2 ``` -------------------------------- ### Base Build Entry Point (Bash) Source: https://context7.com/ublue-os/aurora/llms.txt The main build script initializes the build environment, copies system files, and sets up the build context. It includes DNF caching configuration, package swapping for custom branding, and conditional execution of DX variant builds. ```bash #!/usr/bin/bash set -eoux pipefail # Configure DNF caching for faster builds dnf config-manager setopt keepcache=1 # Replace fedora-logos to allow custom branding dnf -y swap fedora-logos generic-logos rpm --erase --nodeps --nodb generic-logos # Copy all system files to container rsync -rvKl /ctx/system_files/shared/ / # Build DX variant if specified if [[ "${IMAGE_FLAVOR}" == "dx" ]]; then /ctx/build_files/shared/build-dx.sh fi # Setup helper utilities mkdir -p /tmp/scripts/helpers install -Dm0755 /ctx/build_files/shared/utils/ghcurl /tmp/scripts/helpers/ghcurl ``` -------------------------------- ### Justfile Configuration Definitions Source: https://github.com/ublue-os/aurora/blob/main/AGENTS.md Defines the available images, flavors, and tags used by the Just build orchestration system. ```bash images: aurora, aurora-dx flavors: main, nvidia-open tags: stable, latest, beta ``` -------------------------------- ### Run Validation and Formatting Commands Source: https://github.com/ublue-os/aurora/blob/main/AGENTS.md Commands to execute pre-commit hooks for linting and Just recipes for syntax validation and auto-formatting. ```bash # Run all pre-commit hooks pre-commit run --all-files # Auto-fix formatting using Just just fix # Manual validation using Just just check ``` -------------------------------- ### Manual Build Management Source: https://github.com/ublue-os/aurora/blob/main/AGENTS.md Alternative commands for cleaning artifacts and inspecting build recipes when the Just command runner is unavailable or restricted. ```bash find . -name "*.just" -exec echo "Checking {}" \; -exec head -5 {} \; rm -rf *_build* previous.manifest.json changelog.md output.env grep -n "^[a-zA-Z].*:" Justfile | head -20 ``` -------------------------------- ### Rechunk Built Image for Optimization Source: https://context7.com/ublue-os/aurora/llms.txt Optimizes container image layers using the Universal Blue rechunker for improved download efficiency and deduplication. This process involves pruning files, creating an OSTree repository, chunking layers, and generating metadata. Requires sudo privileges. ```bash # Rechunk a built image (requires sudo) sudo just rechunk aurora latest main # Rechunk for GHCR deployment sudo just rechunk aurora stable main 1 # The rechunker performs: # 1. Prune unnecessary files # 2. Create OSTree repository # 3. Chunk into optimized layers # 4. Generate version metadata ``` -------------------------------- ### Generate Build Tags (Bash) Source: https://context7.com/ublue-os/aurora/llms.txt Creates container registry tags for a build, considering the stream, version, and event type. It supports generating tags for stable, latest, and pull request builds. ```bash # Generate tags for stable build just generate-build-tags aurora stable main "" 1 # Example output for stable Tuesday build: # stable stable-daily 43.20250115 stable-43.20250115 # Generate tags for latest build just generate-build-tags aurora latest main "" 0 # Output: latest latest-43.20250115 # Generate tags for pull request just generate-build-tags aurora stable main "" 1 "" pull_request 123 # Output: pr-123-stable-43.20250115 abc1234-stable-43.20250115 ``` -------------------------------- ### Manage GitHub Container Registry Images Source: https://context7.com/ublue-os/aurora/llms.txt Provides administrative commands for managing images in the GitHub Container Registry. This includes setting credentials and retagging NVIDIA images, with options for dry runs and execution. ```bash # Set credentials export GITHUB_USERNAME="your-username" export GITHUB_PAT="ghp_your_token" # Retag NVIDIA images (dry run) just retag-nvidia-on-ghcr stable-daily-43.20250126.3 stable-daily 1 # Retag NVIDIA images (execute) just retag-nvidia-on-ghcr stable-daily-43.20250126.3 stable-daily 0 # Copies aurora-nvidia-open and aurora-dx-nvidia-open images to new tags ``` -------------------------------- ### Load Rechunked Image into Podman Source: https://context7.com/ublue-os/aurora/llms.txt Loads a rechunked OCI image back into the local Podman store, making it available for testing or deployment. The command verifies the image is loaded by listing local Podman images. ```bash # Load rechunked image just load-rechunk aurora latest main # Image becomes available as localhost/aurora:latest podman images | grep aurora ``` -------------------------------- ### Execute System Builds Source: https://github.com/ublue-os/aurora/blob/main/AGENTS.md Commands for triggering container builds for different Aurora variants. These operations are resource-intensive and require significant disk space and time. ```bash just build aurora latest main just build aurora-dx latest main just build aurora latest main "" "" "" "6.10.10-200.fc40.x86_64" ``` -------------------------------- ### Validate and Format Code Source: https://github.com/ublue-os/aurora/blob/main/AGENTS.md Commands to ensure repository health by running pre-commit hooks and Just recipes. These should be executed before submitting changes to prevent build failures. ```bash pre-commit run --all-files just check just fix ``` -------------------------------- ### Generate Release Changelogs Source: https://context7.com/ublue-os/aurora/llms.txt Generates release changelogs by comparing package versions between image versions. It supports generating changelogs for a specific branch and including handwritten notes. ```bash # Generate changelog for stable branch just changelogs stable # Generate changelog with handwritten notes just changelogs stable "Added new feature X, Fixed bug Y" # Output files: # - output.env: Environment variables for CI # - changelog.md: Markdown formatted changelog ``` -------------------------------- ### Generate Image Name (Bash) Source: https://context7.com/ublue-os/aurora/llms.txt Constructs the full image name for Ublue OS Aurora based on the provided base name, stream, and flavor. This is useful for creating consistent and predictable image naming conventions. ```bash # Standard image name just image_name aurora latest main # Output: aurora # NVIDIA variant name just image_name aurora stable nvidia-open # Output: aurora-nvidia-open # Developer experience name just image_name aurora-dx latest main # Output: aurora-dx ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.