diff options
| author | tranch <tranch.xiao@gmail.com> | 2026-07-12 23:33:44 +0800 |
|---|---|---|
| committer | tranch <tranch.xiao@gmail.com> | 2026-07-12 23:33:44 +0800 |
| commit | 42a6ff3286804854c1c21a7e62158f09e19a9b09 (patch) | |
| tree | 1276369ae98f138054878e04dac49b8a9c3ca4d1 /just_scripts | |
| parent | 7280cc006eefe14a71ee19a66bc8b2c6d55c4887 (diff) | |
| download | AeroCore-OS-42a6ff3286804854c1c21a7e62158f09e19a9b09.tar.gz AeroCore-OS-42a6ff3286804854c1c21a7e62158f09e19a9b09.zip | |
Add live installer build workflow
Add a Bazzite-style installer payload, CI workflow, and local\nPodman commands for building and testing the live ISO.\n\nFix stale disk image configuration references and installer targets.
Diffstat (limited to 'just_scripts')
| -rwxr-xr-x | just_scripts/build-live-installer.sh | 58 | ||||
| -rwxr-xr-x | just_scripts/run-live-installer.sh | 23 |
2 files changed, 81 insertions, 0 deletions
diff --git a/just_scripts/build-live-installer.sh b/just_scripts/build-live-installer.sh new file mode 100755 index 0000000..16b371e --- /dev/null +++ b/just_scripts/build-live-installer.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash + +set -euo pipefail + +project_root="$(git rev-parse --show-toplevel)" +cd "${project_root}" + +image_name="${IMAGE_NAME:-$(just image_name)}" +image_tag="${IMAGE_TAG:-$(just generate-default-tag)}" +base_image="${BASE_IMAGE:-ghcr.io/ublue-os/bazzite:stable}" +payload="localhost/${image_name}:live-payload" +output_dir="${project_root}/output" +api_socket="${PODMAN_SOCKET:-/run/podman/podman.sock}" +if [[ "${EUID}" -eq 0 ]]; then + podman_cmd=(podman) +else + podman_cmd=(sudo podman) +fi + +if [[ ! -S "${api_socket}" ]]; then + echo "Podman API socket not found: ${api_socket}" >&2 + echo "Set PODMAN_SOCKET to the rootful Podman socket and retry." >&2 + exit 1 +fi + +mkdir -p "${output_dir}" +"${podman_cmd[@]}" tag "${image_name}:${image_tag}" "${payload}" + +"${podman_cmd[@]}" build \ + --cap-add sys_admin \ + --security-opt label=disable \ + --build-arg "BASE_IMAGE=${base_image}" \ + --build-arg "INSTALL_IMAGE_PAYLOAD=${payload}" \ + --tag localhost/aerocore-live-payload:latest \ + --file installer/Containerfile \ + . + +"${podman_cmd[@]}" run --rm --privileged \ + --volume "${api_socket}:/var/run/docker.sock" \ + --volume "${project_root}/output:/build-container-installer/build" \ + --volume "${project_root}/installer/lorax_templates:/additional_lorax_templates:ro" \ + docker.io/jasonn3/build-container-installer:latest \ + ADDITIONAL_TEMPLATES="/additional_lorax_templates/remove_root_password_prompt.tmpl /additional_lorax_templates/set_default_user.tmpl" \ + ARCH="x86_64" \ + ENABLE_CACHE_DNF="false" \ + ENABLE_CACHE_SKOPEO="false" \ + ENABLE_FLATPAK_DEPENDENCIES="false" \ + IMAGE_NAME="aerocore-live-payload" \ + IMAGE_REPO="localhost" \ + IMAGE_TAG="latest" \ + ISO_NAME="build/aerocore-os-${image_tag}-amd64.iso" \ + VARIANT="Kinoite" \ + VERSION="${FEDORA_VERSION:-44}" + +iso="${output_dir}/aerocore-os-${image_tag}-amd64.iso" +if [[ -f "${iso}" ]]; then + sha256sum "${iso}" | tee "${iso}-CHECKSUM" +fi diff --git a/just_scripts/run-live-installer.sh b/just_scripts/run-live-installer.sh new file mode 100755 index 0000000..2723aae --- /dev/null +++ b/just_scripts/run-live-installer.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -euo pipefail + +project_root="$(git rev-parse --show-toplevel)" +cd "${project_root}" + +image_tag="${IMAGE_TAG:-$(just generate-default-tag)}" +iso="${project_root}/output/aerocore-os-${image_tag}-amd64.iso" + +if [[ ! -f "${iso}" ]]; then + just build-live-installer +fi + +podman run --rm --cap-add NET_ADMIN \ + --publish 127.0.0.1:8006:8006 \ + --env CPU_CORES=2 \ + --env RAM_SIZE=4G \ + --env DISK_SIZE=64G \ + --env BOOT_MODE=uefi \ + --device /dev/kvm \ + --volume "${iso}:/boot.iso:ro" \ + docker.io/qemux/qemu-docker |
