From a74af935acb2e489a89d032d1f71707cfae84d69 Mon Sep 17 00:00:00 2001 From: Nulo Date: Thu, 2 Feb 2023 18:55:18 -0300 Subject: [PATCH] qemu: shutdown --- qemu.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qemu.ts b/qemu.ts index c95deb1..1ecdbd9 100644 --- a/qemu.ts +++ b/qemu.ts @@ -7,7 +7,10 @@ import { Kernel } from "./kernel.js"; export async function runQemu( squashfs: string, kernel: Kernel, - { graphic }: { graphic: boolean } = { graphic: true } + { graphic, noShutdown }: { graphic: boolean; noShutdown: boolean } = { + graphic: true, + noShutdown: false, + } ) { const tmp = await mkdtemp(path.join(tmpdir(), "define-alpine-qemu-")); try { @@ -28,6 +31,7 @@ export async function runQemu( kernelAppend.push("console=ttyS0"); qemuAppend.push("-nographic"); } + if (noShutdown) qemuAppend.push("-no-shutdown"); // sudo chown root:$(id -u) -R boot/ && sudo chmod g+rw -R boot/ await execFile("qemu-system-x86_64", [ @@ -49,7 +53,6 @@ export async function runQemu( "-append", kernelAppend.join(" "), ...qemuAppend, - "-no-shutdown", ]); // -append "root=/dev/sda rootfstype=squashfs modules=ext4 quiet init=/sbin/runit-init $append" $qemuappend } finally {