add initial initramfs support, not quite working yet

This commit is contained in:
2025-10-12 00:46:05 -07:00
parent fc239ea54d
commit 5f5ef1ddd3
6 changed files with 26 additions and 41 deletions

View File

@@ -27,14 +27,9 @@ else
-chardev stdio,id=stdio0 \
-device virtconsole,chardev=stdio0,id=console0
if [ "${TARGET_ARCH}" = "x86_64" ]; then
set -- "${@}" \
-vga std
else
set -- "${@}" \
-vga none \
-device "virtio-gpu,edid=on,xres=1024,yres=768"
fi
set -- "${@}" \
-vga none \
-device "virtio-gpu,edid=on,xres=1024,yres=768"
fi
rm -f "${FINAL_DIR}/ovmf-boot.fd"

View File

@@ -79,6 +79,8 @@ if [ "${SKIP_VM_BUILD}" != "1" ]; then
docker build --platform="${DOCKER_TARGET}" -t "${DOCKER_PREFIX}/sprout-ovmf-${TARGET_ARCH}:${DOCKER_TAG}" -f vm/Dockerfile.ovmf "${FINAL_DIR}"
copy_from_image "${DOCKER_PREFIX}/sprout-ovmf-${TARGET_ARCH}" "ovmf.fd" "${FINAL_DIR}/ovmf.fd"
copy_from_image "${DOCKER_PREFIX}/sprout-ovmf-${TARGET_ARCH}" "shell.efi" "${FINAL_DIR}/shell.efi"
docker build --platform="${DOCKER_TARGET}" -t "${DOCKER_PREFIX}/sprout-initramfs-${TARGET_ARCH}:${DOCKER_TAG}" -f vm/Dockerfile.initramfs "${FINAL_DIR}"
copy_from_image "${DOCKER_PREFIX}/sprout-initramfs-${TARGET_ARCH}" "initramfs" "${FINAL_DIR}/initramfs"
fi
if [ "${SKIP_SPROUT_BUILD}" != "1" ]; then
@@ -102,6 +104,7 @@ if [ "${SKIP_SPROUT_BUILD}" != "1" ]; then
fi
cp "${FINAL_DIR}/sprout.toml" "${FINAL_DIR}/efi/SPROUT.TOML"
cp "${FINAL_DIR}/edera-splash.png" "${FINAL_DIR}/efi/EDERA-SPLASH.PNG"
cp "${FINAL_DIR}/initramfs" "${FINAL_DIR}/efi/INITRAMFS"
fi
if [ "${SKIP_BOOT_BUILD}" != "1" ]; then

View File

@@ -1,19 +1,22 @@
version = 1
[values]
default-options = "console=hvc0"
default-options = "initrd=\\initramfs init=/bin/sh console=hvc0"
[actions.welcome]
print.text = "Welcome to Sprout!"
[actions.splash]
splash.image = "edera-splash.png"
splash.time = 5
splash.time = 1
[actions.chainload-kernel]
chainload.path = "$path"
chainload.options = ["$default-options"]
[actions.chainload-shell]
chainload.path = "\\EFI\\BOOT\\shell.efi"
[generators.kernels.matrix]
entry.title = "Boot Kernel $name"
entry.values.path = "\\EFI\\BOOT\\$name"
@@ -21,4 +24,4 @@ entry.actions = ["chainload-kernel"]
values.name = ["kernel.efi"]
[[phases.startup]]
actions = ["splash", "welcome"]
actions = ["welcome", "splash"]

View File

@@ -1,29 +0,0 @@
version: 1
values:
default-options: "console=hvc0"
phases:
startup:
- actions: ["welcome"]
actions:
welcome:
print:
text: "Welcome to Sprout!"
chainload-kernel:
chainload:
path: "$path"
options:
- "$default-options"
generators:
kernels:
matrix:
entry:
title: "Boot Kernel $name"
values:
path: "\\EFI\\BOOT\\$name"
actions: ["chainload-kernel"]
values:
name: ["kernel.efi"]