constants: add kupfer-config --user

This commit is contained in:
InsanePrawn 2023-03-14 19:44:15 +01:00
parent e758e3c343
commit 4603902ba4
2 changed files with 10 additions and 6 deletions

View file

@ -24,7 +24,10 @@ BASE_PACKAGES: list[str] = BASE_LOCAL_PACKAGES + [
'vim', 'vim',
] ]
POST_CMDS = ['kupfer-config apply'] POST_INSTALL_CMDS = [
'kupfer-config apply',
'kupfer-config --user apply',
]
REPOSITORIES = [ REPOSITORIES = [
'boot', 'boot',

View file

@ -11,7 +11,7 @@ from typing import Optional, Union
from config.state import config, Profile from config.state import config, Profile
from chroot.device import DeviceChroot, get_device_chroot from chroot.device import DeviceChroot, get_device_chroot
from constants import Arch, BASE_LOCAL_PACKAGES, BASE_PACKAGES, POST_CMDS from constants import Arch, BASE_LOCAL_PACKAGES, BASE_PACKAGES, POST_INSTALL_CMDS
from distro.distro import get_base_distro, get_kupfer_https from distro.distro import get_base_distro, get_kupfer_https
from devices.device import Device, get_profile_device from devices.device import Device, get_profile_device
from exec.cmd import run_root_cmd, generate_cmd_su from exec.cmd import run_root_cmd, generate_cmd_su
@ -318,12 +318,13 @@ def install_rootfs(
} }
for target, content in files.items(): for target, content in files.items():
root_write_file(os.path.join(chroot.path, target.lstrip('/')), content) root_write_file(os.path.join(chroot.path, target.lstrip('/')), content)
if POST_CMDS:
logging.info("Running post-install CMDs") logging.info("Running post-install CMDs")
result = chroot.run_cmd(' && '.join(POST_CMDS)) for cmd in POST_INSTALL_CMDS:
result = chroot.run_cmd(cmd)
assert isinstance(result, subprocess.CompletedProcess) assert isinstance(result, subprocess.CompletedProcess)
if result.returncode != 0: if result.returncode != 0:
raise Exception('Error running post_cmds') raise Exception(f'Error running post-install cmd: {cmd}')
logging.info('Preparing to unmount chroot') logging.info('Preparing to unmount chroot')
res = chroot.run_cmd('sync && umount /boot', attach_tty=True) res = chroot.run_cmd('sync && umount /boot', attach_tty=True)