English | 中文
This repository contains build scripts, patches, and helper tools for generating TGOS-related images. It covers:
- Platform-specific Linux and ArceOS builds
- Common OS builders under
scripts/os/ - Rootfs generation under
scripts/rootfs/ - Packaging and release helpers
- Local image distribution with
http_server.py
The repository is now organized by responsibility instead of placing every script directly under scripts/.
| Path | Purpose |
|---|---|
build.sh |
Top-level entry point for OS, rootfs, and release tasks |
run.sh |
Quick QEMU boot helper for generated QEMU Linux images |
scripts/platform/ |
Platform entry scripts such as Phytium Pi, QEMU, Orange Pi, etc. |
scripts/os/ |
Common OS builders such as ArceOS, Zephyr, FreeRTOS, and RT-Thread |
scripts/rootfs/ |
Rootfs builders for BusyBox, Alpine, and Debian |
scripts/tools/ |
Packaging / release helpers and other utilities |
scripts/lib/ |
Shared shell helpers |
patches/ |
Patches applied to upstream projects during builds |
IMAGES/ |
Final build artifacts |
build/ |
Download caches, source trees, and temporary build output |
release/ |
Packaged archives generated by release scripts |
These scripts are the main entry points for platform-oriented builds. They usually clone upstream sources, apply patches, invoke vendor or upstream build systems, and copy results into IMAGES/.
| Script | Main responsibility |
|---|---|
scripts/platform/phytiumpi.sh |
Build Phytium Pi guest images |
scripts/platform/roc-rk3568-pc.sh |
Build ROC-RK3568-PC guest images |
scripts/platform/evm3588.sh |
Build EVM3588 guest images |
scripts/platform/tac-e400-plc.sh |
Build TAC-E400-PLC guest images |
scripts/platform/orangepi-5-plus.sh |
Build Orange Pi 5 Plus guest images |
scripts/platform/rdk-s100p.sh |
Build RDK-S100P guest images |
scripts/platform/bst-a1000.sh |
Build BST-A1000 guest images |
scripts/platform/qemu.sh |
Build QEMU guest images and invoke rootfs generation when needed |
These scripts provide reusable build flows and are called either directly or by platform scripts.
| Script | Main responsibility |
|---|---|
scripts/os/arceos.sh |
Common ArceOS builder |
scripts/os/zephyr.sh |
Common Zephyr builder |
scripts/os/freertos.sh |
Common FreeRTOS builder |
scripts/os/rtthread.sh |
Common RT-Thread builder |
These scripts generate filesystem contents or filesystem images.
| Script | Main responsibility | Typical output |
|---|---|---|
scripts/rootfs/busybox.sh |
Build a minimal BusyBox-based rootfs | busybox-initramfs-<arch>.cpio.gz, busybox-rootfs-<arch>.img |
scripts/rootfs/alpine.sh |
Download Alpine minirootfs and pack an ext4 image | alpine-rootfs-<arch>.img |
scripts/rootfs/debian.sh |
Use Docker + debootstrap to build a Debian rootfs image | debian-rootfs-<arch>.img |
build.sh os <target> supports the following platform targets:
phytiumpiroc-rk3568-pcevm3588tac-e400-plcorangepi-5-plusrdk-s100pbst-a1000qemuqemu-aarch64qemu-riscv64qemu-x86_64qemu-loongarch64
For QEMU:
qemurunsqemu-aarch64,qemu-x86_64,qemu-riscv64, andqemu-loongarch64sequentiallyqemu-aarch64,qemu-riscv64,qemu-x86_64, andqemu-loongarch64are thin wrappers overscripts/platform/qemu.sh
scripts/platform/qemu.sh currently supports:
aarch64riscv64x86_64loongarch64
build.sh rootfs <target> currently supports:
busyboxalpine
scripts/rootfs/debian.sh is available directly and currently supports:
aarch64riscv64x86_64loongarch64
scripts/rootfs/alpine.sh currently supports:
aarch64loongarch64riscv64x86_64
Note:
loongarch64 is a valid Debian target in the script, but Debian trixie does not currently provide loong64 packages in the main archive. Use an appropriate suite such as sid / unstable when building that variant.
Before building, make sure the host has enough disk space, network access to the required upstream repositories or intranet SDK services, and the needed toolchains.
On Ubuntu 24.04 or a similar distribution, a practical baseline is:
sudo apt update
sudo apt install \
flex bison libelf-dev libssl-dev \
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
gcc-riscv64-linux-gnu g++-riscv64-linux-gnu \
bc fakeroot coreutils cpio gzip rsync file \
debootstrap binfmt-support debian-archive-keyring eatmydata \
e2fsprogs docker.io \
python3 python3-venv curl git openssh-client libmpc-dev libgmp-dev \
lz4 chrpath gawk texinfo diffstat expect cmakeSome platform builds require:
- Access to private repositories
- Access to the intranet SDK host
10.3.10.194 - Additional vendor SDK dependencies
- Administrator privileges or passwordless sudo
build.sh is the main entry point.
./build.sh help
# Platform-oriented OS builds
./build.sh platform phytiumpi
./build.sh platform qemu all
./build.sh platform qemu-aarch64 linux
./build.sh platform qemu all --rootfs busybox,alpine,debian
# Rootfs builds
./build.sh rootfs busybox aarch64 --out_dir IMAGES/rootfs
./build.sh rootfs alpine riscv64 --out_dir IMAGES/rootfs/alpine-riscv64.img
# Release packaging
./build.sh release packUse platform scripts for fine-grained control:
scripts/platform/phytiumpi.sh all
scripts/platform/qemu.sh aarch64 linux
scripts/platform/qemu.sh riscv64 all
scripts/platform/evm3588.sh arceosUse rootfs scripts directly when you only need filesystem images:
scripts/rootfs/busybox.sh aarch64 --out_dir IMAGES/rootfs
scripts/rootfs/alpine.sh x86_64 --img-size 2G
scripts/rootfs/debian.sh riscv64 --debian trixie --out_dir IMAGES/rootfs
scripts/rootfs/debian.sh loongarch64 --debian unstable --out_dir IMAGES/rootfs- Generates both initramfs and ext4 rootfs images
- Used by
scripts/platform/qemu.shfor QEMU Linux and ArceOS flows - Currently supports
aarch64,loongarch64,riscv64, andx86_64
- Downloads official Alpine
minirootfs - Verifies the downloaded archive with SHA256
- Generates an ext4 rootfs image
- Currently supports
aarch64,loongarch64,riscv64, andx86_64
- Uses Docker plus
debootstrap - Generates an ext4 rootfs image
- Defaults to Debian
trixie - Supports
aarch64,riscv64,x86_64, andloongarch64
Artifacts are collected under IMAGES/. Common locations include:
| Path | Contents |
|---|---|
IMAGES/qemu-<arch>/linux |
QEMU Linux kernel artifacts for the given architecture |
IMAGES/qemu-<arch>/arceos |
QEMU ArceOS binaries for the given architecture |
IMAGES/rootfs |
Standalone rootfs images generated directly by rootfs scripts |
IMAGES/<platform>/linux |
Linux artifacts for a hardware platform |
IMAGES/<platform>/arceos |
ArceOS artifacts for a hardware platform |
Typical QEMU Linux files:
Imageforaarch64/riscv64bzImageforx86_64vmlinuz.efiandvmlinux.elfforloongarch64linux-qemuas the generic QEMU Linux entry name; forloongarch64, this is the ELF image copied fromvmlinux.elf- BusyBox rootfs artifacts such as
busybox-initramfs-<arch>.cpio.gzandbusybox-rootfs-<arch>.img
Use run.sh for quick local QEMU validation:
./run.sh aarch64 ramfs
./run.sh riscv64 rootfs
./run.sh x86_64 rootfsQEMU platform build outputs now live under IMAGES/qemu-<arch>/.
For LoongArch64, the platform archive qemu-loongarch64.tar.xz contains both
linux/vmlinuz.efi and linux/vmlinux.elf; linux/linux-qemu is the generic
entry name used by the QEMU platform flow and points at vmlinux.elf. Rootfs
images are published separately, including
initramfs-loongarch64-busybox.cpio.gz.tar.xz,
rootfs-loongarch64-busybox.img.tar.xz, and
rootfs-loongarch64-alpine.img.tar.xz by default.
./build.sh release pack
# Or call the script directly
scripts/tools/pack.sh --in_dir IMAGES --out_dir release--pack IMAGES,release means packaging artifacts from IMAGES/ first, then publishing the files generated under release/.
./build.sh release github \
--pack IMAGES,release \
--token <GITHUB_TOKEN> \
--repo rcore-os/tgosimages \
--tag v0.0.10
# Or call the script directly
scripts/tools/github.sh \
--pack IMAGES,release \
--token <GITHUB_TOKEN> \
--repo rcore-os/tgosimages \
--tag v0.0.10http_server.py serves files from IMAGES/ using Python's standard library.
python3 http_server.py start
python3 http_server.py status
python3 http_server.py restart -p 9000 -b 127.0.0.1
python3 http_server.py stopWhen exposing the server on a shared network, restrict access with firewalls or a reverse proxy.
Contributions are welcome for:
- New platform scripts
- Improvements to build flows
- Rootfs generation updates
- Documentation fixes
Before sending a pull request, please keep script style consistent and document how to reproduce your result.
This project is licensed under the MIT License. See LICENSE for details.