Initial commit: Alpine Zero-OS initramfs build system with cleaned Docker configuration
This commit is contained in:
103
configs/init
Executable file
103
configs/init
Executable file
@@ -0,0 +1,103 @@
|
||||
#!/bin/sh
|
||||
# Alpine-based Zero-OS Init Script
|
||||
# Maintains identical flow to original busybox version
|
||||
|
||||
echo ""
|
||||
echo "============================================"
|
||||
echo "== ZERO-OS ALPINE INITRAMFS =="
|
||||
echo "============================================"
|
||||
|
||||
echo "[+] creating ram filesystem"
|
||||
mount -t proc proc /proc
|
||||
mount -t sysfs sysfs /sys
|
||||
mount -t tmpfs tmpfs /mnt/root -o size=1536M
|
||||
mount -t devtmpfs devtmpfs /dev
|
||||
|
||||
echo "[+] building ram filesystem"
|
||||
target="/mnt/root"
|
||||
|
||||
# Copy Alpine filesystem to tmpfs (same as original)
|
||||
echo " copying /bin..."
|
||||
cp -ar /bin $target
|
||||
echo " copying /etc..."
|
||||
cp -ar /etc $target
|
||||
echo " copying /lib..."
|
||||
cp -ar /lib* $target
|
||||
echo " copying /usr..."
|
||||
cp -ar /usr $target
|
||||
echo " copying /root..."
|
||||
cp -ar /root $target
|
||||
echo " copying /sbin..."
|
||||
cp -ar /sbin $target
|
||||
echo " copying /tmp..."
|
||||
cp -ar /tmp $target
|
||||
echo " copying /var..."
|
||||
cp -ar /var $target
|
||||
echo " copying /run..."
|
||||
cp -ar /run $target
|
||||
|
||||
# Create essential directories
|
||||
mkdir -p $target/dev
|
||||
mkdir -p $target/sys
|
||||
mkdir -p $target/proc
|
||||
mkdir -p $target/mnt
|
||||
|
||||
# Mount filesystems in tmpfs
|
||||
mount -t proc proc $target/proc
|
||||
mount -t sysfs sysfs $target/sys
|
||||
mount -t devtmpfs devtmpfs $target/dev
|
||||
|
||||
# Mount devpts for terminals
|
||||
mkdir -p $target/dev/pts
|
||||
mount -t devpts devpts $target/dev/pts
|
||||
|
||||
echo "[+] setting environment"
|
||||
export PATH
|
||||
|
||||
echo "[+] probing drivers"
|
||||
# Use Alpine's udev instead of busybox udevadm
|
||||
if [ -x /sbin/udevd ]; then
|
||||
echo " starting udevd..."
|
||||
udevd --daemon
|
||||
|
||||
echo " triggering device discovery..."
|
||||
udevadm trigger --action=add --type=subsystems
|
||||
udevadm trigger --action=add --type=devices
|
||||
udevadm settle
|
||||
|
||||
echo " stopping udevd..."
|
||||
kill $(pidof udevd) || true
|
||||
else
|
||||
echo " warning: udevd not found, skipping hardware detection"
|
||||
fi
|
||||
|
||||
echo "[+] loading essential drivers"
|
||||
# Load core drivers for storage and network
|
||||
modprobe btrfs 2>/dev/null || true
|
||||
modprobe fuse 2>/dev/null || true
|
||||
modprobe overlay 2>/dev/null || true
|
||||
|
||||
# Load storage drivers
|
||||
modprobe ahci 2>/dev/null || true
|
||||
modprobe nvme 2>/dev/null || true
|
||||
modprobe virtio_blk 2>/dev/null || true
|
||||
modprobe virtio_scsi 2>/dev/null || true
|
||||
|
||||
# Load network drivers
|
||||
modprobe virtio_net 2>/dev/null || true
|
||||
modprobe e1000 2>/dev/null || true
|
||||
modprobe e1000e 2>/dev/null || true
|
||||
|
||||
# Unmount init filesystems
|
||||
umount /proc 2>/dev/null || true
|
||||
umount /sys 2>/dev/null || true
|
||||
|
||||
echo "[+] checking for debug files"
|
||||
if [ -e /init-debug ]; then
|
||||
echo " executing debug script..."
|
||||
sh /init-debug
|
||||
fi
|
||||
|
||||
echo "[+] switching root"
|
||||
echo " exec switch_root /mnt/root /sbin/zinit init"
|
||||
exec switch_root /mnt/root /sbin/zinit init
|
||||
8177
configs/kernel-config-generic
Normal file
8177
configs/kernel-config-generic
Normal file
File diff suppressed because it is too large
Load Diff
1
configs/kernel-version
Normal file
1
configs/kernel-version
Normal file
@@ -0,0 +1 @@
|
||||
6.12.41
|
||||
86
configs/packages-alpine.txt
Normal file
86
configs/packages-alpine.txt
Normal file
@@ -0,0 +1,86 @@
|
||||
# ALPINE RUNTIME PACKAGES FOR ZERO-OS
|
||||
# Standard Alpine Linux + Zero-OS runtime dependencies
|
||||
# Purpose: Complete Alpine system with Zero-OS binaries (mountable)
|
||||
|
||||
# Core Alpine system (standard installation)
|
||||
alpine-baselayout
|
||||
busybox
|
||||
busybox-suid
|
||||
musl
|
||||
apk-tools
|
||||
|
||||
# System utilities (standard Alpine)
|
||||
util-linux
|
||||
findutils
|
||||
grep
|
||||
sed
|
||||
coreutils
|
||||
|
||||
# Crypto and certificates
|
||||
openssl
|
||||
ca-certificates
|
||||
|
||||
# Filesystem tools
|
||||
e2fsprogs
|
||||
btrfs-progs
|
||||
xfsprogs
|
||||
parted
|
||||
dosfstools
|
||||
|
||||
# Network tools (for Zero-OS operation)
|
||||
iproute2
|
||||
openssh
|
||||
openssh-server
|
||||
curl
|
||||
wget
|
||||
dhcpcd
|
||||
dnsmasq
|
||||
nftables
|
||||
iptables
|
||||
netcat-openbsd
|
||||
ethtool
|
||||
wireguard-tools
|
||||
|
||||
# Storage and hardware
|
||||
smartmontools
|
||||
dmidecode
|
||||
hdparm
|
||||
nvme-cli
|
||||
|
||||
# Compression and archives
|
||||
zlib
|
||||
zstd
|
||||
xz
|
||||
gzip
|
||||
tar
|
||||
|
||||
# System services
|
||||
redis
|
||||
haveged
|
||||
|
||||
# Filesystem support
|
||||
fuse
|
||||
fuse3
|
||||
|
||||
# Hardware detection and drivers
|
||||
eudev
|
||||
kmod
|
||||
pciutils
|
||||
usbutils
|
||||
|
||||
# Container and virtualization support
|
||||
# runc (if available in Alpine)
|
||||
|
||||
# Essential libraries for Zero-OS binaries
|
||||
libaio
|
||||
keyutils
|
||||
|
||||
# Text processing (for Zero-OS operation)
|
||||
jq
|
||||
|
||||
# Runtime dependencies for Zero-OS components
|
||||
# (will be determined based on compiled binaries)
|
||||
|
||||
# NO development tools (gcc, make, go, rust, etc.)
|
||||
# NO debugging tools (gdb, strace, etc.)
|
||||
# Those stay in build environment only
|
||||
27
configs/packages-boot.txt
Normal file
27
configs/packages-boot.txt
Normal file
@@ -0,0 +1,27 @@
|
||||
# MINIMAL BOOT PACKAGES FOR EMBEDDED INITRAMFS
|
||||
# Target: ~10-20MB embedded in kernel
|
||||
# Purpose: Boot, establish network, mount runtime Alpine system
|
||||
|
||||
# Absolute minimum Alpine base
|
||||
alpine-baselayout
|
||||
busybox
|
||||
musl
|
||||
|
||||
# Hardware detection and drivers
|
||||
eudev
|
||||
kmod
|
||||
|
||||
# Network connectivity (essential for mounting runtime system)
|
||||
iproute2
|
||||
dhcpcd
|
||||
ethtool
|
||||
|
||||
# Mount utilities for runtime system
|
||||
util-linux
|
||||
|
||||
# Essential libraries only
|
||||
zlib
|
||||
|
||||
# NO debugging, NO development tools, NO SSH server
|
||||
# NO extra packages - keep this list minimal!
|
||||
# Runtime tools will be available in mounted Alpine system
|
||||
29
configs/packages-minimal.txt
Normal file
29
configs/packages-minimal.txt
Normal file
@@ -0,0 +1,29 @@
|
||||
# MINIMAL Alpine packages for Zero-OS embedded initramfs
|
||||
# Target: ~50MB total (not 700MB!)
|
||||
|
||||
# Core system (essential only)
|
||||
alpine-baselayout
|
||||
busybox
|
||||
musl
|
||||
|
||||
# Module loading & hardware detection
|
||||
eudev
|
||||
kmod
|
||||
|
||||
# Essential networking (for Zero-OS connectivity)
|
||||
iproute2
|
||||
ethtool
|
||||
|
||||
# Filesystem support (minimal)
|
||||
btrfs-progs
|
||||
dosfstools
|
||||
|
||||
# Essential libraries only
|
||||
zlib
|
||||
|
||||
# Network utilities (minimal)
|
||||
dhcpcd
|
||||
|
||||
# NO debugging tools, NO development tools, NO SSH, NO curl/wget
|
||||
# NO python, NO redis, NO massive linux-firmware package
|
||||
# These will be loaded from RFS after network connectivity
|
||||
92
configs/packages.txt
Normal file
92
configs/packages.txt
Normal file
@@ -0,0 +1,92 @@
|
||||
# Core Alpine packages for Zero-OS initramfs
|
||||
# Based on package mapping from current build-from-source system
|
||||
|
||||
# Base system
|
||||
alpine-baselayout
|
||||
busybox
|
||||
busybox-suid
|
||||
musl
|
||||
apk-tools
|
||||
|
||||
# System utilities
|
||||
util-linux
|
||||
findutils
|
||||
grep
|
||||
sed
|
||||
|
||||
# Crypto and certificates
|
||||
openssl
|
||||
ca-certificates
|
||||
|
||||
# Filesystem tools
|
||||
e2fsprogs
|
||||
btrfs-progs
|
||||
xfsprogs
|
||||
parted
|
||||
dosfstools
|
||||
|
||||
# Network tools
|
||||
iproute2
|
||||
openssh
|
||||
openssh-server
|
||||
curl
|
||||
wget
|
||||
dhcpcd
|
||||
dnsmasq
|
||||
nftables
|
||||
iptables
|
||||
netcat-openbsd
|
||||
ethtool
|
||||
wireguard-tools
|
||||
|
||||
# Storage and hardware
|
||||
smartmontools
|
||||
dmidecode
|
||||
hdparm
|
||||
nvme-cli
|
||||
|
||||
# Compression and archives
|
||||
zlib
|
||||
zstd
|
||||
xz
|
||||
gzip
|
||||
tar
|
||||
|
||||
# Development and system
|
||||
redis
|
||||
haveged
|
||||
tcpdump
|
||||
strace
|
||||
|
||||
# Filesystem support
|
||||
fuse
|
||||
fuse3
|
||||
|
||||
# Virtualization filesystem support (for local development)
|
||||
# VirtioFS userspace tools
|
||||
virtiofsd
|
||||
|
||||
# Hardware detection and drivers
|
||||
eudev
|
||||
kmod
|
||||
pciutils
|
||||
usbutils
|
||||
|
||||
# Linux firmware
|
||||
linux-firmware
|
||||
|
||||
# Container and virtualization
|
||||
# runc (may be in testing, skip for now)
|
||||
|
||||
# Additional libraries
|
||||
libaio
|
||||
keyutils
|
||||
|
||||
# Debugging tools (for debug builds)
|
||||
gdb
|
||||
strace
|
||||
lsof
|
||||
htop
|
||||
|
||||
# Text processing
|
||||
jq
|
||||
30
configs/zinit/zinit.yaml
Normal file
30
configs/zinit/zinit.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
# Zero-OS Zinit Configuration
|
||||
exec:
|
||||
# Core Zero-OS Services
|
||||
rfs:
|
||||
exec: /usr/bin/rfs
|
||||
after:
|
||||
- mycelium
|
||||
|
||||
seektime:
|
||||
exec: /usr/bin/seektime
|
||||
|
||||
core-x:
|
||||
exec: /usr/bin/core-x
|
||||
after:
|
||||
- rfs
|
||||
- mycelium
|
||||
|
||||
mycelium:
|
||||
exec: /usr/bin/mycelium
|
||||
|
||||
# System Services
|
||||
sshd:
|
||||
exec: /usr/sbin/sshd -D
|
||||
after:
|
||||
- mycelium
|
||||
|
||||
# Network configuration
|
||||
networking:
|
||||
exec: /bin/sh -c "ip link set lo up"
|
||||
oneshot: true
|
||||
Reference in New Issue
Block a user