From 209708a33ef1d56be963c498619e671c7e42ca85 Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Thu, 27 Jan 2022 04:23:39 +0100 Subject: [PATCH] chroot.create_user(): default username to 'kupfer' --- chroot.py | 1 + image.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/chroot.py b/chroot.py index 692a56c..6487a84 100644 --- a/chroot.py +++ b/chroot.py @@ -384,6 +384,7 @@ class Chroot: password='123456', groups=['network', 'video', 'audio', 'optical', 'storage', 'input', 'scanner', 'games', 'lp', 'rfkill', 'wheel'], ): + user = user or 'kupfer' install_script = f''' set -e if ! id -u "{user}" >/dev/null 2>&1; then diff --git a/image.py b/image.py index 7fce098..46e22f2 100644 --- a/image.py +++ b/image.py @@ -228,6 +228,7 @@ def cmd_build(profile_name: str = None, build_pkgs: bool = True): device, flavour = get_device_and_flavour(profile_name) post_cmds = FLAVOURS[flavour].get('post_cmds', []) + user = profile['username'] or 'kupfer' # TODO: PARSE DEVICE ARCH AND SECTOR SIZE arch = 'aarch64' sector_size = 4096 @@ -304,13 +305,13 @@ def cmd_build(profile_name: str = None, build_pkgs: bool = True): chroot.initialize() chroot.activate() chroot.create_user( - user=profile['username'], + user=user, password=profile['password'], ) copy_ssh_keys( chroot.path, - user=profile['username'], + user=user, ) with open(os.path.join(chroot.path, 'etc', 'pacman.conf'), 'w') as file: file.write(get_base_distro(arch).get_pacman_conf(check_space=True, extra_repos=get_kupfer_https(arch).repos))