Add an experimental Alpine image flow

Stage a complete Alpine x86_64 image stack so \	--image alpineworks like the existing manual Void path instead of relying on Debian-oriented image builds.\n\nAdd make targets plus kernel/rootfs/register helpers that download pinned Alpine artifacts, extract a Firecracker-compatible vmlinux, build a matching mkinitfs initramfs, seed OpenRC services, and register/promote a managed image named alpine.\n\nFold in the bring-up fixes discovered during boot validation: use rootfstype=ext4 in shared boot args, install libgcc/libstdc++ for the opencode binary, and give opencode more time to become ready on cold boots.\n\nValidate with go test ./..., the Alpine helper builds, image promotion, and banger vm create --image alpine --name alp --nat plus guest service and port checks.
This commit is contained in:
Thales Maciel 2026-03-21 20:25:55 -03:00
parent 572bf32424
commit a166068fab
No known key found for this signature in database
GPG key ID: 33112E6833C34679
14 changed files with 1307 additions and 9 deletions

View file

@ -17,10 +17,13 @@ BINARIES := $(BANGER_BIN) $(BANGERD_BIN) $(VSOCK_AGENT_BIN)
GO_SOURCES := $(shell find cmd internal -type f -name '*.go' | sort)
VOID_IMAGE_NAME ?= void-exp
VOID_VM_NAME ?= void-dev
ALPINE_RELEASE ?= 3.23.3
ALPINE_IMAGE_NAME ?= alpine
ALPINE_VM_NAME ?= alpine-dev
.DEFAULT_GOAL := help
.PHONY: help build banger bangerd test fmt tidy clean rootfs rootfs-void void-kernel void-register void-vm verify-void install bench-create
.PHONY: help build banger bangerd test fmt tidy clean rootfs rootfs-void void-kernel void-register void-vm verify-void alpine-kernel rootfs-alpine alpine-register alpine-vm verify-alpine install bench-create
help:
@printf '%s\n' \
@ -37,7 +40,12 @@ help:
' make rootfs-void Build an experimental Void Linux rootfs and work-seed in ./build/manual' \
' make void-register Register or update the experimental Void image as $(VOID_IMAGE_NAME)' \
' make void-vm Register the experimental Void image and create a VM named $(VOID_VM_NAME)' \
' make verify-void Register the experimental Void image and run scripts/verify.sh against it'
' make verify-void Register the experimental Void image and run scripts/verify.sh against it' \
' make alpine-kernel Download and stage an Alpine virt kernel, initramfs, and modules under ./build/manual/alpine-kernel' \
' make rootfs-alpine Build an experimental Alpine Linux rootfs and work-seed in ./build/manual' \
' make alpine-register Register or update the experimental Alpine image as $(ALPINE_IMAGE_NAME)' \
' make alpine-vm Register the experimental Alpine image and create a VM named $(ALPINE_VM_NAME)' \
' make verify-alpine Register the experimental Alpine image and run scripts/verify.sh against it'
build: $(BINARIES)
@ -92,3 +100,18 @@ void-vm: void-register
verify-void: void-register
BANGER_BIN="$(abspath $(BANGER_BIN))" ./scripts/verify.sh --image "$(VOID_IMAGE_NAME)"
alpine-kernel:
BANGER_MANUAL_DIR="$(abspath $(BUILD_MANUAL_DIR))" ALPINE_RELEASE="$(ALPINE_RELEASE)" ./scripts/make-alpine-kernel.sh $(ARGS)
rootfs-alpine:
BANGER_MANUAL_DIR="$(abspath $(BUILD_MANUAL_DIR))" ALPINE_RELEASE="$(ALPINE_RELEASE)" BANGER_BIN="$(abspath $(BANGER_BIN))" ./scripts/make-rootfs-alpine.sh $(ARGS)
alpine-register: build
BANGER_MANUAL_DIR="$(abspath $(BUILD_MANUAL_DIR))" ALPINE_IMAGE_NAME="$(ALPINE_IMAGE_NAME)" BANGER_BIN="$(abspath $(BANGER_BIN))" ./scripts/register-alpine-image.sh
alpine-vm: alpine-register
"$(abspath $(BANGER_BIN))" vm create --image "$(ALPINE_IMAGE_NAME)" --name "$(ALPINE_VM_NAME)"
verify-alpine: alpine-register
BANGER_BIN="$(abspath $(BANGER_BIN))" ./scripts/verify.sh --image "$(ALPINE_IMAGE_NAME)"