Skip to content

Integrate LessOS into build process#119

Merged
nchapman merged 7 commits into
developfrom
feature/lessos-builds
Jan 25, 2026
Merged

Integrate LessOS into build process#119
nchapman merged 7 commits into
developfrom
feature/lessos-builds

Conversation

@nchapman
Copy link
Copy Markdown
Collaborator

@nchapman nchapman commented Jan 25, 2026

This pull request integrates LessOS image building into the LessUI build process. It adds infrastructure to fetch LessOS release images from GitHub, inject a LessOS-specific LessUI.zip into their storage partitions, and publish the resulting images alongside regular LessUI releases.

Adds tooling to fetch LessOS release images from GitHub and inject
LessUI.zip directly into the storage partition using debugfs. This
enables building complete OS images without manual SD card setup.

Key features:
- Downloads LessOS releases via GitHub API (curl-based)
- Injects LessUI.zip into ext4 partition 2 using debugfs (no mounting)
- Supports multiple devices (RK3566, SM8250) and variants
- Validates downloads and provides detailed error messages
- Outputs compressed images with SHA256 checksums

Usage:
  make lessos DEVICE=RK3566       # Build specific device
  make lessos DEVICE=all          # Build all devices
  make lessos TAG=20260124        # Use specific release

Implementation uses Docker (Ubuntu 24.04) to ensure consistent tooling
across development environments. Adds curl, e2fsprogs, fdisk, and pigz
to the dev container.
Adds LessOS image building to the CI release process. After building
LessUI, the workflow now downloads LessOS base images, injects the
LessUI.zip, and includes the resulting images in the GitHub release.

Changes:
- Add Build LessOS images step after LessUI build
- Split verification into separate LessUI and LessOS checks
- Include LessOS images in attestation, artifacts, and release
- Add curl timeouts for CI reliability (30s connect, 30min download)
LessOS images only need the core LessUI content, not the platform-specific
boot folders (miyoo*, rg35xx*, trimui, magicx) that are used for stock OS
installations. This reduces the injected zip size by ~3MB.

Changes:
- Create zip from build/BASE with explicit include list
- Remove --zip option (always build from build/BASE)
- Add zip tool to Dockerfile and tool check
- Remove stale zip before creating to avoid leftover content
- Use jq for JSON parsing instead of fragile grep/sed
- Simplify logging to plain echo (matches project conventions)
- Add error handling for critical disk operations (dd, debugfs, zip)
- Make Docker pull conditional (only when image missing)
- Remove unnecessary tool checks (Docker provides environment)
- Add jq to Dockerfile dependencies
Copilot AI review requested due to automatic review settings January 25, 2026 04:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request integrates LessOS image building into the LessUI build process. It adds infrastructure to fetch LessOS release images from GitHub, inject a LessOS-specific LessUI.zip into their storage partitions, and publish the resulting images alongside regular LessUI releases.

Changes:

  • Adds fetch-and-inject-lessos.sh script to download LessOS images, inject LessUI via debugfs, and recompress them
  • Integrates LessOS building into Makefile with new lessos target that runs in Docker
  • Updates Dockerfile to install required tools (curl, jq, e2fsprogs, fdisk, pigz, zip)
  • Extends GitHub Actions release workflow to build and publish LessOS images

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 24 comments.

File Description
scripts/fetch-and-inject-lessos.sh New 306-line script that fetches LessOS images, creates LessOS-specific zip from build/BASE, and injects it into partition 2 of images
Makefile Adds lessos target with Docker integration and variable passing for DEVICE, TAG, VARIANT options
Dockerfile Adds image manipulation tools (curl, jq, e2fsprogs, fdisk, pigz, zip) with documentation
.github/workflows/release.yml Adds LessOS build step, verification, checksum generation, and artifact publishing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/fetch-and-inject-lessos.sh
Comment thread .github/workflows/release.yml
Comment thread scripts/fetch-and-inject-lessos.sh
Comment thread scripts/fetch-and-inject-lessos.sh
Comment thread .github/workflows/release.yml
Comment thread scripts/fetch-and-inject-lessos.sh
Comment thread scripts/fetch-and-inject-lessos.sh
Comment thread scripts/fetch-and-inject-lessos.sh
Comment thread scripts/fetch-and-inject-lessos.sh
Comment thread Makefile Outdated
- Remove README.md from LESSOS_INCLUDE (only README.txt exists)
- Add TAG validation after resolving latest release
- Skip prepare_lessui_zip in dry-run mode for consistency
- Add 'all' dependency to lessos target (requires build/BASE)
- Simplify Makefile argument passing with proper quoting
Output images now include the LessUI version for clarity:
  LessUI-v0.4.1-LessOS-RK3566-Generic.img.gz
  LessUI-dev-20260125-LessOS-SM8250.img.gz

- Add required --version argument to script
- Pass RELEASE_VERSION from Makefile
- Use consistent bash regex for device extraction
- Direct all error messages to stderr
@nchapman nchapman merged commit 4a77c71 into develop Jan 25, 2026
6 checks passed
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.

2 participants