From 860aeb26f5b6e014904bc072374556957cdc7676 Mon Sep 17 00:00:00 2001 From: Nulo Date: Fri, 17 Jun 2022 21:15:31 -0300 Subject: [PATCH] Usar sudo en vez de doas MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Para que sea más compatible --- alpine.lua | 16 ++++++++-------- qemu.sh | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/alpine.lua b/alpine.lua index 7bdc11c..685795a 100644 --- a/alpine.lua +++ b/alpine.lua @@ -5,7 +5,7 @@ local t = require("utils/templater") -- Returns nil when no failure, otherwise apk's status code function alpine.init_rootfs(path, alpine_base_version, alpine_version) - local status = os.execute(t("doas rm -rf {{path}} && mkdir -p {{path}}", {path = path})) + local status = os.execute(t("sudo rm -rf {{path}} && mkdir -p {{path}}", {path = path})) if not (status == 0) then return status end local url = t("https://dl-cdn.alpinelinux.org/alpine/v{{base_version}}/releases/x86_64/alpine-minirootfs-{{version}}-x86_64.tar.gz", { base_version = alpine_base_version, @@ -16,14 +16,14 @@ function alpine.init_rootfs(path, alpine_base_version, alpine_version) end function alpine.move_boot(path) - local status = os.execute(t("doas rm -rf {{path}}/../boot && doas mv {{path}}/boot {{path}}/../ && doas mkdir {{path}}/boot", { + local status = os.execute(t("sudo rm -rf {{path}}/../boot && sudo mv {{path}}/boot {{path}}/../ && sudo mkdir {{path}}/boot", { path = path, })) if not (status == 0) then return status end end function alpine.make_squashfs(path, output_path) - local status = os.execute(t("doas mksquashfs {{path}} {{output_path}} -comp zstd -noappend -quiet && doas chown $(id -u):$(id -g) {{output_path}}", { + local status = os.execute(t("sudo mksquashfs {{path}} {{output_path}} -comp zstd -noappend -quiet && sudo chown $(id -u):$(id -g) {{output_path}}", { path = path, output_path = output_path, })) @@ -49,7 +49,7 @@ end function alpine.write_file(rootfs_path, path, content) local real_path = rootfs_path..path - local cmd = t("mkdir -p {{real_dirname}} && test -f {{real_path}} || exit 0 && doas chown $(id -u) {{real_path}}", { + local cmd = t("mkdir -p {{real_dirname}} && test -f {{real_path}} || exit 0 && sudo chown $(id -u) {{real_path}}", { real_path = real_path, real_dirname = utils.dirname(real_path), }) @@ -99,17 +99,17 @@ function alpine.make_world(rootfs_path, packages) utils.join_table(packages, "\n")) if err then return err end - local status = os.execute("doas apk update --no-cache --root "..rootfs_path) + local status = os.execute("sudo apk update --no-cache --root "..rootfs_path) if not (status == 0) then return status end - local status = os.execute("doas apk upgrade --clean-protected --no-cache --root "..rootfs_path) + local status = os.execute("sudo apk upgrade --clean-protected --no-cache --root "..rootfs_path) if not (status == 0) then return status end - local status = os.execute("doas apk add --clean-protected --no-cache --root "..rootfs_path) + local status = os.execute("sudo apk add --clean-protected --no-cache --root "..rootfs_path) if not (status == 0) then return status end end -- Returns nil when no failure, otherwise status code function alpine.set_password(rootfs_path, user, password) - local status = os.execute(t("echo '{{password}}\n{{password}}' | doas chroot {{rootfs_path}} passwd {{user}}", { + local status = os.execute(t("echo '{{password}}\n{{password}}' | sudo chroot {{rootfs_path}} passwd {{user}}", { password = password, rootfs_path = rootfs_path, user = user, diff --git a/qemu.sh b/qemu.sh index c27b25f..c3dbe06 100755 --- a/qemu.sh +++ b/qemu.sh @@ -5,7 +5,7 @@ if test "$NOGRAPHIC" = true; then qemuappend="-nographic" fi -doas chown root:$(id -u) -R boot/ && doas chmod g+rw -R boot/ +sudo chown root:$(id -u) -R boot/ && sudo chmod g+rw -R boot/ qemu-system-x86_64 -enable-kvm -m 2048 \ -drive file=image.squashfs,media=disk \ -kernel boot/vmlinuz-virt -initrd boot/initramfs-virt \