Expand description
Generate ready-to-flash raw images with AOSC OS for various devices
§Requirements
The following dependencies are required to build and run this tool:
§Library Dependencies (Linked Libraries)
libblkid
: for gathering information for block devices, primarily their unique identifiers.liblzma
: for compressing the image file with LZMA2 (xz).libzstd
: for compressing the image file with ZStandard.
§Runtime Dependencies (External commands)
The following executables must be available in the system at runtime:
rsync
: For copying the system distribution.mkfs.ext4
,mkfs.xfs
,mkfs.btrfs
,mkfs.vfat
: For making filesystems on partitions.chroot
: For entering the chroot environment of the target container to perform post-installation steps.useradd
from shadow: For adding user to the target container.chpasswd
from shadow: For changing user passwords.partprobe
: For updating the in-kernel partition table cache.
§binfmt_misc
support and respective binary interpreters
If you intend to build images for devices with a different architecture than your host machine, you must check if your host system supports binfmt_misc
:
$ cat /proc/sys/fs/binfmt_misc/status
enabled
Enabling binfmt_misc
support is beyond the scope of this documentation.
With binfmt_misc
support enabled, you will have to install qemu-user-static
(or equivalent packages for your distribution) to allow your system to execute binary executables for the target device’s architecture.
§Building
Simply run:
cargo build --release
§Usage
§List Available Devices
$ ./target/release/mkrawimg list --format FORMAT
While FORMAT
can be one of the following:
pretty
: table format which contains basic information.simple
: simple column-based format splitted by tab character ('\t'
).
§Build images for one specific device
# ./target/release/mkrawimg build --variants VARIANTS -- DEVICE
VARIANTS
: distribution variants, can be one or more of thebase
,desktop
,server
. If not specified, all variants will be built.DEVICE
: A string identifying the target device, can be one of the following:- Device ID (defined in
device.toml
). - Device alias (defined in
device.toml
). - The path to the
device.toml
file.
- Device ID (defined in
For example:
sudo ./target/releases/mkrawimg build -V desktop -- rpi-5b
§Build Images for All Devices (in the registry)
# ./target/release/mkrawimg build-all --variants VARIANTS
For the advanced usage, please refer to Cmdline
.
§Adding a new device
To add support for a new device, please refer to DeviceSpec
.
§Contributing
§Device addition
While CI performs automated checks on submitted device specification files, these checks are not exhaustive. Therefore, we require you to build an image using your specification file to ensure its validity.
§License
This repository is licensed under the GNU GPL v3 license.
Modules§
- Module handling the application of the bootloader images.
- cli 🔒Module defining the command line usage.
- device 🔒Module handling various procedures for a specific device, and the device specification itself.
- Module handling the partitions.
- registry 🔒Module handling the registry of the device specifications.
Structs§
- Command line usage
- Device Specification
Functions§
- main 🔒