qemu: chown para que funcione

This commit is contained in:
Cat /dev/Nulo 2023-02-21 13:19:57 -03:00
parent b9ee26ef81
commit 3f9b11c76f

View file

@ -2,6 +2,7 @@ import { mkdtemp, rm } from "node:fs/promises";
import { tmpdir } from "node:os"; import { tmpdir } from "node:os";
import path from "node:path"; import path from "node:path";
import { execFile } from "./helpers/better-api.js"; import { execFile } from "./helpers/better-api.js";
import { sudoChownToRunningUser } from "./helpers/sudo.js";
export async function runQemu( export async function runQemu(
squashfs: string, squashfs: string,
@ -11,6 +12,9 @@ export async function runQemu(
noShutdown: false, noShutdown: false,
} }
) { ) {
await sudoChownToRunningUser(kernel.initramfs);
await sudoChownToRunningUser(kernel.vmlinuz);
await sudoChownToRunningUser(squashfs);
const tmp = await mkdtemp(path.join(tmpdir(), "define-alpine-qemu-")); const tmp = await mkdtemp(path.join(tmpdir(), "define-alpine-qemu-"));
try { try {
const disk = path.join(tmp, "tmp.ext4"); const disk = path.join(tmp, "tmp.ext4");