diff --git a/helpers/envkernel.sh b/helpers/envkernel.sh index e8816fb3..0eab4716 100644 --- a/helpers/envkernel.sh +++ b/helpers/envkernel.sh @@ -68,7 +68,7 @@ set_alias_pmbootstrap() { pmbootstrap="$pmbootstrap_dir"/pmbootstrap.py # shellcheck disable=SC2139 alias pmbootstrap="\"$pmbootstrap\"" - if [ -e ~/.config/pmbootstrap.cfg ]; then + if [ -e "${XDG_CONFIG_HOME:-$HOME/.config}"/pmbootstrap.cfg ]; then "$pmbootstrap" work_migrate else echo "NOTE: First run of pmbootstrap, running 'pmbootstrap init'" diff --git a/pmb/config/__init__.py b/pmb/config/__init__.py index cd4f369b..52c3bfe2 100644 --- a/pmb/config/__init__.py +++ b/pmb/config/__init__.py @@ -68,7 +68,7 @@ defaults = { "ccache_size": "5G", "is_default_channel": True, "cipher": "aes-xts-plain64", - "config": os.path.expanduser("~") + "/.config/pmbootstrap.cfg", + "config": (os.environ.get('XDG_CONFIG_HOME') or os.path.expanduser("~/.config")) + "/pmbootstrap.cfg", "device": "qemu-amd64", "extra_packages": "none", "fork_alpine": False, diff --git a/test/test_qemu_running_processes.py b/test/test_qemu_running_processes.py index 6e2697e6..f0a91962 100644 --- a/test/test_qemu_running_processes.py +++ b/test/test_qemu_running_processes.py @@ -7,7 +7,6 @@ via SSH if expected processes are running. We use an extra config file (based on ~/.config/pmbootstrap.cfg), because we need to change it a lot (e.g. UI, username, ...). """ -import os import pytest import sys import shutil @@ -78,8 +77,7 @@ class QEMU(object): def run(self, args, tmpdir, ui="none"): # Copy and adjust user's pmbootstrap.cfg config = str(tmpdir) + "/pmbootstrap.cfg" - shutil.copyfile(os.path.expanduser("~") + "/.config/pmbootstrap.cfg", - config) + shutil.copyfile(args.config, config) pmbootstrap_run(args, config, ["config", "device", "qemu-amd64"]) pmbootstrap_run(args, config, ["config", "kernel", "virt"]) pmbootstrap_run(args, config, ["config", "extra_packages", "none"])