Generate ready-to-flash raw images with AOSC OS for various devices.
The following dependencies are required to build and run this tool:
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.
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.
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
Note
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.
Simply run:
cargo build --release
./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'
).
Warning
Building images requires the root privileges.
sudo ./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
sudo ./target/release/mkrawimg build-all --variants VARIANTS
For the advanced usage, please refer to Command line usage.
To add support for a new device, please refer to Adding support for a new device.
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.
This repository is licensed under the GNU GPL v3 license.