1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

homectl: optionally force interactive firstboot query

This commit is contained in:
Lennart Poettering 2025-02-06 11:59:40 +01:00
parent 9e6fbb5a51
commit cfe16540c8
2 changed files with 20 additions and 5 deletions

View File

@ -596,6 +596,13 @@ SYSTEMD_HOME_DEBUG_SUFFIX=foo \
parts of the session continue running. Thus, we highly recommend that this variable
isn't used unless necessary. Defaults to true.
`homectl`:
* `$SYSTEMD_HOME_FIRSTBOOT_OVERRIDE` if set to "1" will make `homectl
firstboot --prompt-new-user` interactively ask for user creation, even if
there already exists at least one regular user on the system. If set to "0"
will make the tool skip any such query.
`kernel-install`:
* `$KERNEL_INSTALL_BYPASS` If set to "1", execution of kernel-install is skipped

View File

@ -2697,12 +2697,20 @@ static int verb_firstboot(int argc, char *argv[], void *userdata) {
if (r > 0) /* Already created users from credentials */
return 0;
r = has_regular_user();
if (r < 0)
return r;
if (r > 0) {
log_info("Regular user already present in user database, skipping user creation.");
r = getenv_bool("SYSTEMD_HOME_FIRSTBOOT_OVERRIDE");
if (r == 0)
return 0;
if (r < 0) {
if (r != -ENXIO)
log_warning_errno(r, "Failed to parse $SYSTEMD_HOME_FIRSTBOOT_OVERRIDE, ignoring: %m");
r = has_regular_user();
if (r < 0)
return r;
if (r > 0) {
log_info("Regular user already present in user database, skipping user creation.");
return 0;
}
}
return create_interactively();