From 6fdf426f6e782752cbf9b495d3af510898ea0c61 Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Wed, 2 Mar 2022 15:29:58 +0100 Subject: [PATCH] install_rootfs(): add sudoers.d/wheel --- image.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/image.py b/image.py index 4a9fe35..28688f5 100644 --- a/image.py +++ b/image.py @@ -309,13 +309,17 @@ def install_rootfs(rootfs_device: str, bootfs_device: str, device, flavour, arch user=user, password=profile['password'], ) - copy_ssh_keys( chroot.path, user=user, ) - with open(os.path.join(chroot.path, 'etc', 'pacman.conf'), 'w') as file: - file.write(get_base_distro(arch).get_pacman_conf(check_space=True, extra_repos=get_kupfer_https(arch).repos)) + files = { + 'etc/pacman.conf': get_base_distro(arch).get_pacman_conf(check_space=True, extra_repos=get_kupfer_https(arch).repos), + 'etc/sudoers.d/wheel': "# allow members of group wheel to execute any command\n%wheel ALL=(ALL:ALL) ALL\n", + } + for target, content in files.items(): + with open(os.path.join(chroot.path, target.lstrip('/')), 'w') as file: + file.write(content) if post_cmds: result = chroot.run_cmd(' && '.join(post_cmds)) assert isinstance(result, subprocess.CompletedProcess)