From 4603902ba4aa0e7a0c8edee560f9acdde04fc0e7 Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Tue, 14 Mar 2023 19:44:15 +0100 Subject: [PATCH] constants: add kupfer-config --user --- constants.py | 5 ++++- image/image.py | 11 ++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/constants.py b/constants.py index b24ea30..fa85388 100644 --- a/constants.py +++ b/constants.py @@ -24,7 +24,10 @@ BASE_PACKAGES: list[str] = BASE_LOCAL_PACKAGES + [ 'vim', ] -POST_CMDS = ['kupfer-config apply'] +POST_INSTALL_CMDS = [ + 'kupfer-config apply', + 'kupfer-config --user apply', +] REPOSITORIES = [ 'boot', diff --git a/image/image.py b/image/image.py index 1cf1887..1b62f03 100644 --- a/image/image.py +++ b/image/image.py @@ -11,7 +11,7 @@ from typing import Optional, Union from config.state import config, Profile 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 devices.device import Device, get_profile_device from exec.cmd import run_root_cmd, generate_cmd_su @@ -318,12 +318,13 @@ def install_rootfs( } for target, content in files.items(): root_write_file(os.path.join(chroot.path, target.lstrip('/')), content) - if POST_CMDS: - logging.info("Running post-install CMDs") - result = chroot.run_cmd(' && '.join(POST_CMDS)) + + logging.info("Running post-install CMDs") + for cmd in POST_INSTALL_CMDS: + result = chroot.run_cmd(cmd) assert isinstance(result, subprocess.CompletedProcess) 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') res = chroot.run_cmd('sync && umount /boot', attach_tty=True)