Fix location of local etc and bin files

This commit is contained in:
jld3103 2021-08-08 13:15:48 +02:00
parent 66e9927dd4
commit 158bdad40b
9 changed files with 32 additions and 32 deletions

View file

@ -3,8 +3,9 @@ import subprocess
import os
import shutil
def create_chroot(chroot_path, packages=['base'], pacman_conf='/app/src/pacman.conf', chroot_base_path='/chroot', extra_repos={}):
pacman_conf_target=chroot_path+'/etc/pacman.conf'
def create_chroot(chroot_path, packages=['base'], pacman_conf='/app/local/etc/pacman.conf', chroot_base_path='/chroot', extra_repos={}):
pacman_conf_target = chroot_path+'/etc/pacman.conf'
os.makedirs(chroot_path+'/etc', exist_ok=True)
shutil.copyfile(pacman_conf, pacman_conf_target)
@ -12,11 +13,11 @@ def create_chroot(chroot_path, packages=['base'], pacman_conf='/app/src/pacman.c
extra_conf = ''
for repo_name, repo_options in extra_repos.items():
extra_conf += f'\n\n[{repo_name}]\n'
extra_conf += '\n'.join(['%s = %s' % (name,value) for name,value in repo_options.items()])
extra_conf += '\n'.join(['%s = %s' % (name, value)
for name, value in repo_options.items()])
with open(pacman_conf_target, 'a') as file:
file.write(extra_conf)
result = subprocess.run(['pacstrap',
'-C', pacman_conf_target,
'-c',
@ -48,4 +49,3 @@ def create_chroot(chroot_path, packages=['base'], pacman_conf='/app/src/pacman.c
if result.returncode != 0:
logging.fatal('Failed to setup user')
exit(1)