A custom Linux distribution built from scratch using Linux From Scratch (LFS) methodology with full automation and USB persistence.
- ✅ Built from source following LFS methodology
- ✅ Fully automated build system with modular stages
- ✅ Bootable USB with full persistence (data saved between reboots)
- ✅ UEFI and BIOS support
- ✅ GitHub Actions cloud compilation
- ✅ Minimal, optimized system (~2GB)
- ✅ Linux kernel 6.7.4 with USB storage support
- Linux host (Ubuntu 20.04+, Debian 11+, Fedora 35+)
- Root/sudo access
- 20GB+ free disk space
- 4GB+ RAM
- Internet connection
- USB drive (8GB+ for installation)
sudo apt-get install build-essential bison flex texinfo gawk \
libncurses-dev bc libssl-dev libelf-dev parted rsync wget# Clone repository
git clone <repo-url> BlazeNeuroLinux
cd BlazeNeuroLinux
# Download missing sources (if needed)
bash scripts/download-sources.sh
# Build entire system (2-4 hours)
sudo ./build.sh all# Replace /dev/sdX with your USB device
sudo ./build.sh usb /dev/sdX- Insert USB drive
- Reboot and select USB from boot menu
- All changes persist automatically
| Stage | Description | Time |
|---|---|---|
| Stage 1 | Environment preparation | 5 min |
| Stage 2 | Cross-toolchain (Binutils, GCC, Glibc) | 60-90 min |
| Stage 3 | Temporary system (Bash, Coreutils, etc.) | 20-30 min |
| Stage 4 | Final system (util-linux, e2fsprogs) | 15-20 min |
| Stage 5 | Kernel compilation & system config | 30-45 min |
| Stage 6 | GUI components (optional) | - |
BlazeNeuroLinux/
├── build.sh # Main build orchestrator
├── config/
│ ├── blazeneuro.conf # System configuration
│ └── packages.list # Package definitions & URLs
├── scripts/
│ ├── stages/ # Build stage scripts (01-06)
│ ├── utils/ # Common functions
│ └── download-sources.sh # Source downloader
├── usb-installer/
│ └── create-usb.sh # USB creation script
├── .github/
│ └── workflows/
│ └── build.yml # GitHub Actions workflow
├── sources/ # Source tarballs
├── build/ # Build workspace (created)
└── logs/ # Build logs (created)
sudo ./build.sh stage1 # Prepare environment
sudo ./build.sh stage2 # Build toolchain
sudo ./build.sh stage3 # Build temp system
sudo ./build.sh stage4 # Build final system
sudo ./build.sh stage5 # Configure & kernel
sudo ./build.sh stage6 # GUI (optional)# List available devices
lsblk
# Create bootable USB (WARNING: destroys data on device)
sudo ./build.sh usb /dev/sdbsudo ./build.sh cleanTwo build methods available:
Builds directly on Ubuntu runner:
- Push to
mainordevelopbranch - GitHub Actions compiles the entire system
- Download artifacts from Actions tab
More reliable, uses containerized build:
- Uses multi-stage Dockerfile
- Better isolation and reproducibility
- Easier to debug locally
# Build with Docker
docker build -t blazeneuro-builder .
# Extract artifact
docker create --name blazeneuro blazeneuro-builder
docker cp blazeneuro:/blazeneuro-rootfs.tar.gz .
docker rm blazeneuro# Via GitHub UI: Actions → Build BlazeNeuro → Run workflowEdit config/blazeneuro.conf:
BLAZENEURO_VERSION="1.0.0" # Version
LFS="/mnt/lfs" # Build location
MAKEFLAGS="-j$(nproc)" # Parallel builds
USB_BOOT_SIZE="512MiB" # Boot partition size- Partition 1: 512MB FAT32 (Boot/EFI)
- Partition 2: Remaining space EXT4 (Root with RW)
- All changes saved directly to ext4 filesystem
- No overlay - full native persistence
/dev/sdX1 → 512MB FAT32 → /boot (GRUB + Kernel)
/dev/sdX2 → ~7.5GB EXT4 → / (Root filesystem, RW)
See TROUBLESHOOTING.md for detailed solutions.
Coreutils build fails: Fixed with config cache workarounds MB_LEN_MAX errors: Fixed in glibc stage Parallel build failures: Auto-fallback to single-threaded make
# Check logs
tail -f logs/build.log
# Verify sources
bash scripts/verify-sources.sh
# Retry specific stage
sudo ./build.sh stage2- Verify BIOS/UEFI boot order
- Check USB device with
lsblk - Recreate USB:
sudo ./build.sh usb /dev/sdX
# Check available space
df -h /mnt/lfs
# Clean build
sudo ./build.sh clean- Linux Kernel: 6.7.4
- GCC: 13.2.0
- Glibc: 2.39
- Binutils: 2.42
- GRUB: 2.12
To add packages:
- Add entry to
config/packages.list - Update appropriate stage script
- Test build
GPL v3