install_rootfs(): add sudoers.d/wheel
This commit is contained in:
parent
539be06e8e
commit
6fdf426f6e
1 changed files with 7 additions and 3 deletions
10
image.py
10
image.py
|
@ -309,13 +309,17 @@ def install_rootfs(rootfs_device: str, bootfs_device: str, device, flavour, arch
|
||||||
user=user,
|
user=user,
|
||||||
password=profile['password'],
|
password=profile['password'],
|
||||||
)
|
)
|
||||||
|
|
||||||
copy_ssh_keys(
|
copy_ssh_keys(
|
||||||
chroot.path,
|
chroot.path,
|
||||||
user=user,
|
user=user,
|
||||||
)
|
)
|
||||||
with open(os.path.join(chroot.path, 'etc', 'pacman.conf'), 'w') as file:
|
files = {
|
||||||
file.write(get_base_distro(arch).get_pacman_conf(check_space=True, extra_repos=get_kupfer_https(arch).repos))
|
'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:
|
if post_cmds:
|
||||||
result = chroot.run_cmd(' && '.join(post_cmds))
|
result = chroot.run_cmd(' && '.join(post_cmds))
|
||||||
assert isinstance(result, subprocess.CompletedProcess)
|
assert isinstance(result, subprocess.CompletedProcess)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue