Integrate LessOS into build process#119
Merged
Merged
Conversation
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
There was a problem hiding this comment.
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.shscript to download LessOS images, inject LessUI via debugfs, and recompress them - Integrates LessOS building into Makefile with new
lessostarget 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.
- 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
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
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.
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.