Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions hack/dev/boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ if [ "${QEMU_GDB_WAIT}" = "1" ]; then
set -- "${@}" "-S"
fi

set -- "${@}" -smp 2 -m 4096
set -- "${@}" -nodefaults -smp 2 -m 4096

if [ "${NO_GRAPHICAL_BOOT}" = "1" ]; then
if [ "${NO_GRAPHICAL}" = "1" ]; then
set -- "${@}" -nographic
else
if [ "${GRAPHICAL_ONLY}" != "1" ]; then
Expand All @@ -41,7 +41,7 @@ else
else
set -- "${@}" \
-device virtio-serial-pci,id=vs0 \
-chardev stdio,id=stdio0 \
-chardev stdio,id=stdio0,signal=off \
-device virtconsole,chardev=stdio0,id=console0
fi
fi
Expand All @@ -62,6 +62,12 @@ if [ "${NO_INPUT}" != "1" ]; then
-device usb-mouse
fi

if [ "${NO_NETWORK}" != "1" ]; then
set -- "${@}" \
-netdev user,id=network0 \
-device virtio-net-pci,netdev=network0
fi

rm -f "${FINAL_DIR}/ovmf-boot.fd"
cp "${FINAL_DIR}/ovmf.fd" "${FINAL_DIR}/ovmf-boot.fd"
if [ "${TARGET_ARCH}" = "aarch64" ]; then
Expand Down
4 changes: 2 additions & 2 deletions hack/dev/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ copy_from_image_polyfill() {
SOURCE="${2}"
TARGET="${3}"

docker build -t "${IMAGE}-copy-polyfill:${DOCKER_TAG}" --build-arg "TARGET_IMAGE=${IMAGE}:${DOCKER_TAG}" \
docker build --platform="${DOCKER_TARGET}" -t "${IMAGE}-copy-polyfill:${DOCKER_TAG}" --build-arg "TARGET_IMAGE=${IMAGE}:${DOCKER_TAG}" \
-f hack/dev/utils/Dockerfile.copy-polyfill hack
# note: the -w '//' is a workaround for Git Bash where / is magically rewritten.
docker run --rm -i -w '//' "${IMAGE}-copy-polyfill:${DOCKER_TAG}" cat "image/${SOURCE}" >"${TARGET}"
Expand Down Expand Up @@ -81,7 +81,7 @@ if [ "${SKIP_VM_BUILD}" != "1" ]; then
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 hack/dev/vm/Dockerfile.initramfs "${FINAL_DIR}"
-f hack/dev/vm/Dockerfile.initramfs "hack/dev/vm"
copy_from_image "${DOCKER_PREFIX}/sprout-initramfs-${TARGET_ARCH}" "initramfs" "${FINAL_DIR}/initramfs"

if [ -n "${SPROUT_XEN_EFI_OVERRIDE}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion hack/dev/configs/all.sprout.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ has-item = "\\vmlinuz"

[actions.chainload-kernel]
chainload.path = "$boot\\vmlinuz"
chainload.options = ["console=hvc0"]
chainload.options = ["console=hvc0", "overlaytmpfs=yes"]
chainload.linux-initrd = "$boot\\initramfs"

[entries.kernel]
Expand Down
2 changes: 1 addition & 1 deletion hack/dev/configs/kernel.sprout.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ has-item = "\\vmlinuz"

[actions.chainload-kernel]
chainload.path = "$boot\\vmlinuz"
chainload.options = ["console=hvc0"]
chainload.options = ["console=hvc0", "overlaytmpfs=yes"]
chainload.linux-initrd = "$boot\\initramfs"

[entries.kernel]
Expand Down
5 changes: 5 additions & 0 deletions hack/dev/kernel/docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,14 @@ if [ "${TARGET_KARCH}" = "x86_64" ]; then
fi
make CROSS_COMPILE="${MAYBE_CROSS_COMPILE}" ARCH="${TARGET_KARCH}" mod2yesconfig

./scripts/config -e UEVENT_HELPER
./scripts/config --set-str UEVENT_HELPER_PATH "/sbin/hotplug"

./scripts/config -e DRM_VIRTIO_GPU
./scripts/config -e FRAMEBUFFER_CONSOLE
./scripts/config -e FRAMEBUFFER_CONSOLE_DETECT_PRIMARY
./scripts/config -e LOGO

./scripts/config -e XEN_DOM0

make "-j$(nproc)" CROSS_COMPILE="${MAYBE_CROSS_COMPILE}" ARCH="${TARGET_KARCH}"
Expand Down
8 changes: 5 additions & 3 deletions hack/dev/vm/Dockerfile.initramfs
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
FROM alpine:3.22@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412 AS rootfs
RUN apk --no-cache add alpine-base tzdata
RUN apk --no-cache add alpine-base tzdata ifupdown-ng agetty
RUN rc-update add devfs sysinit && \
rc-update add dmesg sysinit && \
rc-update add mdev sysinit && \
rc-update add cgroups sysinit && \
rc-update add sysctl boot && \
rc-update add hostname boot && \
rc-update add bootmisc boot && \
rc-update add networking boot && \
rc-update add syslog boot && \
rc-update add mount-ro shutdown && \
rc-update add killprocs shutdown && \
rc-update add savecache shutdown && \
ln -s /sbin/init /init && \
echo 'root:root' | chpasswd && \
echo 'sprout' > /etc/hostname && \
echo '' > /etc/motd && \
rm /etc/motd && \
ln -s /usr/share/zoneinfo/UTC /etc/localtime && \
echo 'hvc0::respawn:/sbin/getty -L hvc0 115200 vt100' >> /etc/inittab
echo 'hvc0::respawn:/sbin/agetty --autologin root -L hvc0 115200 vt100' >> /etc/inittab
COPY files/interfaces /etc/network/interfaces

FROM alpine:3.22@sha256:4b7ce07002c69e8f3d704a9c5d6fd3053be500b7f1c69fc0d80990c2ad8dd412 AS build
COPY --from=rootfs / /rootfs
Expand Down
3 changes: 3 additions & 0 deletions hack/dev/vm/files/interfaces
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
auto eth0
iface eth0
use dhcp
Loading