Initial commit: Alpine Zero-OS initramfs build system with cleaned Docker configuration

This commit is contained in:
2025-08-15 22:11:44 +02:00
commit 9b14d94bbe
34 changed files with 12864 additions and 0 deletions

67
README.md Normal file
View File

@@ -0,0 +1,67 @@
# Alpine-based Zero-OS Initramfs
Modern Alpine Linux based approach to building Zero-OS initramfs, replacing the complex build-from-source system with Alpine packages.
## Architecture Overview
This system uses:
- **Alpine Linux LTS** as base system (latest packages, no building from source)
- **Alpine kernel** with embedded essential storage/ethernet modules
- **GitHub components**: zinit, core-x, seektime, rfs (only custom builds needed)
- **Same init flow**: tmpfs copy approach for compatibility
- **Alpine packages**: All standard tools (busybox, openssh, btrfs-progs, etc.)
## Directory Structure
```
alpine-initramfs/
├── build/ # Build orchestration
│ ├── Dockerfile.alpine # Alpine build environment
│ ├── docker-compose.yml # Build orchestration
│ └── build-initramfs.sh # Main build script
├── configs/ # Configuration files
│ ├── packages.txt # Alpine packages to install
│ ├── kernel-modules.txt # Essential modules to embed
│ ├── init # Custom init script (Alpine → zinit)
│ └── zinit/ # Zinit service configs (from ../config/etc/zinit/)
├── scripts/ # Build helper scripts
│ ├── fetch-github.sh # Download zinit, core-x, seektime, rfs
│ ├── install-packages.sh # Install Alpine packages to initramfs
│ ├── setup-initramfs.sh # Create initramfs structure
│ └── build-kernel.sh # Build kernel with embedded initramfs
├── output/ # Build artifacts
│ ├── initramfs.cpio.xz # Generated initramfs
│ ├── vmlinuz.efi # Final bootable kernel
│ └── modules/ # Kernel modules
└── docs/ # Documentation
├── PACKAGES.md # Package mapping (old build → Alpine)
├── MODULES.md # Kernel modules reference
└── BUILD.md # Build process guide
```
## Build Flow
1. **Alpine Environment**: Setup Alpine LTS build container
2. **Package Installation**: Install all required Alpine packages
3. **GitHub Components**: Fetch zinit, core-x, seektime, rfs from releases
4. **Initramfs Assembly**: Create filesystem structure with same tmpfs approach
5. **Kernel Build**: Compile Alpine kernel with embedded essential modules
6. **Output**: Generate bootable vmlinuz.efi with embedded initramfs
## Quick Start
```bash
cd alpine-initramfs/build
docker compose build
docker compose run --rm builder
# Output: ../output/vmlinuz.efi
```
## Key Advantages
-**No source compilation** - Use Alpine's maintained packages
-**Latest versions** - Always current with Alpine package updates
-**Faster builds** - Minutes vs hours
-**Smaller footprint** - Alpine's minimal design
-**Same functionality** - Identical init flow and service management
- ✅ **Better maintenance** - Package updates handled by Alpine team