A modular, Nushell-based build system for creating custom Linux distributions and bootloaders for Mecha Comet devices.
Mechanix OS provides a flexible and automated build system that enables developers to build complete Linux distributions, custom kernels, and bootloaders for Mecha Comet hardware. The entire build system is written in Nushell (nu), providing a modern scripting approach with strong typing and error handling.
- Debian-based Linux Distribution — Custom Debian builds optimized for Mecha Comet
- Fedora-based Linux Distribution — Custom Fedora builds optimized for Mecha Comet
- Linux Kernel — Custom kernel builds with device-specific configurations
- U-Boot Bootloader — Customized U-Boot with ARM Trusted Firmware support
- Nushell (nu shell)
- Docker
- qemu-user-static
- Git
- ARM cross-compilation toolchain (
aarch64-linux-gnu-) - Build essentials (
gcc,make, etc.) - Kernel build dependencies
- ARM cross-compilation toolchain (
aarch64-linux-gnu-) - Device Tree Compiler (
dtc) - Build essentials
Each build system (Debian, Kernel, U-Boot) is organized as a separate project directory, and each contains:
-
A dedicated Dockerfile: This Dockerfile sets up a container with all the essential tools and dependencies required for building that component. For example:
- The Debian build system's Dockerfile includes everything needed to build a custom root filesystem.
- The Kernel build system's Dockerfile provides the necessary cross-compilers and kernel build tools.
- The U-Boot build system's Dockerfile contains tools for bootloader compilation and device tree generation.
-
A Nushell build script: Each project directory has its own Nushell script (
build.nuor similar) that automates the build process inside the prepared Docker environment.
- Prepare the Environment: The Dockerfile in each directory is used to build a container image with all required tools.
- Run the Build Script: The Nushell script is executed (typically via
nu build ...), which orchestrates the build steps inside the container. - Generate Artifacts: The build script produces the final output (rootfs, kernel image, U-Boot binary) in the designated build directory.
This modular approach ensures that each component is built in a clean, reproducible environment tailored to its specific requirements.
.
├── debian/ # Debian distribution build system
├── kernel/ # Linux kernel build system
├── uboot/ # U-Boot bootloader build system
└── LICENSE # Project license
Build artifacts (ISO images, kernel images, bootloader binaries) will be located in the specified build directory after successful builds. The structure is as follows:
<build-directory>/
├── work/ # Temporary build files
└── deploy/ # Final build artifacts
├── rootfs/ # Root filesystem (for distro builds)
├── Image # Kernel image (for kernel builds)
├── *.dtb # Device tree blobs (for kernel builds)
└── flash.bin # U-Boot image (for U-Boot builds)
Each component has its own detailed README:
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request