Skip to content

Make primary username dynamic instead of hardcoded elgentos - #58

Merged
peterjaap merged 3 commits into
mainfrom
dynamic-username
Jul 2, 2026
Merged

Make primary username dynamic instead of hardcoded elgentos#58
peterjaap merged 3 commits into
mainfrom
dynamic-username

Conversation

@wahidnory

Copy link
Copy Markdown
Contributor

The identity section is interactive, so the user may pick any username during installation. Previously all late-commands hardcoded elgentos.

Changes

  • Detect the user created by the interactive identity step (first UID 1000 user) in the first late-command, persist it to /etc/primary-user in the target, and reference it in all later commands and the first-boot script. Falls back to creating elgentos if no user exists.
  • Drop the forced elgentos123 password: chpasswd now only runs when the account has no usable password (passwd -S status not P), i.e. only for the useradd fallback. A password chosen interactively is kept.
  • Fix a pre-existing bug in the first-boot script: the single-printf version over-escaped the nested su -c quoting and generated a script with a bash syntax error, so mkcert -install never ran on first boot. Split into a root script and a user-level script so no nested escaping is needed.

Validated with autoinstall-validate.py (Valid!) and both generated first-boot scripts pass bash -n.

wahidnory added 3 commits July 2, 2026 16:34
The identity section is interactive, so the user may pick any username.
Detect the created user (UID 1000) in the first late-command, persist it
to /etc/primary-user in the target, and reference it everywhere else.
Falls back to creating 'elgentos' if no user exists.

Also split the first-boot script into a root and a user part: the old
single-printf version over-escaped the nested su -c quoting (bash printf
also interprets \") and produced a script with a syntax error, so
mkcert -install never ran on first boot.
The interactive identity step already sets the chosen password;
forcing elgentos123 via chpasswd overwrote it. Now chpasswd only
runs when the account has no usable password (passwd -S status
not P), i.e. when the user was created by the useradd fallback.
@peterjaap
peterjaap merged commit a3d4a55 into main Jul 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants