chroot.create_user(): default username to 'kupfer'
This commit is contained in:
parent
b454781592
commit
209708a33e
2 changed files with 4 additions and 2 deletions
|
@ -384,6 +384,7 @@ class Chroot:
|
||||||
password='123456',
|
password='123456',
|
||||||
groups=['network', 'video', 'audio', 'optical', 'storage', 'input', 'scanner', 'games', 'lp', 'rfkill', 'wheel'],
|
groups=['network', 'video', 'audio', 'optical', 'storage', 'input', 'scanner', 'games', 'lp', 'rfkill', 'wheel'],
|
||||||
):
|
):
|
||||||
|
user = user or 'kupfer'
|
||||||
install_script = f'''
|
install_script = f'''
|
||||||
set -e
|
set -e
|
||||||
if ! id -u "{user}" >/dev/null 2>&1; then
|
if ! id -u "{user}" >/dev/null 2>&1; then
|
||||||
|
|
5
image.py
5
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)
|
device, flavour = get_device_and_flavour(profile_name)
|
||||||
post_cmds = FLAVOURS[flavour].get('post_cmds', [])
|
post_cmds = FLAVOURS[flavour].get('post_cmds', [])
|
||||||
|
|
||||||
|
user = profile['username'] or 'kupfer'
|
||||||
# TODO: PARSE DEVICE ARCH AND SECTOR SIZE
|
# TODO: PARSE DEVICE ARCH AND SECTOR SIZE
|
||||||
arch = 'aarch64'
|
arch = 'aarch64'
|
||||||
sector_size = 4096
|
sector_size = 4096
|
||||||
|
@ -304,13 +305,13 @@ def cmd_build(profile_name: str = None, build_pkgs: bool = True):
|
||||||
chroot.initialize()
|
chroot.initialize()
|
||||||
chroot.activate()
|
chroot.activate()
|
||||||
chroot.create_user(
|
chroot.create_user(
|
||||||
user=profile['username'],
|
user=user,
|
||||||
password=profile['password'],
|
password=profile['password'],
|
||||||
)
|
)
|
||||||
|
|
||||||
copy_ssh_keys(
|
copy_ssh_keys(
|
||||||
chroot.path,
|
chroot.path,
|
||||||
user=profile['username'],
|
user=user,
|
||||||
)
|
)
|
||||||
with open(os.path.join(chroot.path, 'etc', 'pacman.conf'), 'w') as file:
|
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))
|
file.write(get_base_distro(arch).get_pacman_conf(check_space=True, extra_repos=get_kupfer_https(arch).repos))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue