chroot.create_user(): default username to 'kupfer'

This commit is contained in:
InsanePrawn 2022-01-27 04:23:39 +01:00
parent b454781592
commit 209708a33e
2 changed files with 4 additions and 2 deletions

View file

@ -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

View file

@ -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))