qemu: shutdown
This commit is contained in:
parent
a826cfa41a
commit
a74af935ac
1 changed files with 5 additions and 2 deletions
7
qemu.ts
7
qemu.ts
|
@ -7,7 +7,10 @@ import { Kernel } from "./kernel.js";
|
||||||
export async function runQemu(
|
export async function runQemu(
|
||||||
squashfs: string,
|
squashfs: string,
|
||||||
kernel: Kernel,
|
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-"));
|
const tmp = await mkdtemp(path.join(tmpdir(), "define-alpine-qemu-"));
|
||||||
try {
|
try {
|
||||||
|
@ -28,6 +31,7 @@ export async function runQemu(
|
||||||
kernelAppend.push("console=ttyS0");
|
kernelAppend.push("console=ttyS0");
|
||||||
qemuAppend.push("-nographic");
|
qemuAppend.push("-nographic");
|
||||||
}
|
}
|
||||||
|
if (noShutdown) qemuAppend.push("-no-shutdown");
|
||||||
|
|
||||||
// sudo chown root:$(id -u) -R boot/ && sudo chmod g+rw -R boot/
|
// sudo chown root:$(id -u) -R boot/ && sudo chmod g+rw -R boot/
|
||||||
await execFile("qemu-system-x86_64", [
|
await execFile("qemu-system-x86_64", [
|
||||||
|
@ -49,7 +53,6 @@ export async function runQemu(
|
||||||
"-append",
|
"-append",
|
||||||
kernelAppend.join(" "),
|
kernelAppend.join(" "),
|
||||||
...qemuAppend,
|
...qemuAppend,
|
||||||
"-no-shutdown",
|
|
||||||
]);
|
]);
|
||||||
// -append "root=/dev/sda rootfstype=squashfs modules=ext4 quiet init=/sbin/runit-init $append" $qemuappend
|
// -append "root=/dev/sda rootfstype=squashfs modules=ext4 quiet init=/sbin/runit-init $append" $qemuappend
|
||||||
} finally {
|
} finally {
|
||||||
|
|
Loading…
Reference in a new issue