1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 01:55:22 +03:00

Merge pull request #34235 from yuwata/firstboot-systemctl-trivial-cleanups

firstboot,systemctl: trivial cleanups
This commit is contained in:
Lennart Poettering 2024-09-05 09:22:54 +02:00 committed by GitHub
commit 548b744b7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 11 deletions

View File

@ -97,8 +97,7 @@ static bool press_any_key(void) {
char k = 0;
bool need_nl = true;
printf("-- Press any key to proceed --");
fflush(stdout);
puts("-- Press any key to proceed --");
(void) read_one_char(stdin, &k, USEC_INFINITY, &need_nl);
@ -210,7 +209,7 @@ static int prompt_loop(const char *text, char **l, unsigned percentage, bool (*i
return log_error_errno(r, "Failed to query user: %m");
if (isempty(p)) {
log_warning("No data entered, skipping.");
log_info("No data entered, skipping.");
return 0;
}
@ -560,8 +559,8 @@ static int process_keymap(int rfd) {
return 1;
}
static bool timezone_is_valid_log_error(const char *name) {
return timezone_is_valid(name, LOG_ERR);
static bool timezone_is_valid_log_debug(const char *name) {
return timezone_is_valid(name, LOG_DEBUG);
}
static int prompt_timezone(int rfd) {
@ -593,7 +592,7 @@ static int prompt_timezone(int rfd) {
print_welcome(rfd);
r = prompt_loop("Please enter timezone name or number",
zones, 30, timezone_is_valid_log_error, &arg_timezone);
zones, 30, timezone_is_valid_log_debug, &arg_timezone);
if (r < 0)
return r;
@ -682,7 +681,7 @@ static int prompt_hostname(int rfd) {
return log_error_errno(r, "Failed to query hostname: %m");
if (isempty(h)) {
log_warning("No hostname entered, skipping.");
log_info("No hostname entered, skipping.");
break;
}
@ -809,7 +808,7 @@ static int prompt_root_password(int rfd) {
"Received multiple passwords, where we expected one.");
if (isempty(*a)) {
log_warning("No password entered, skipping.");
log_info("No password entered, skipping.");
break;
}
@ -889,7 +888,7 @@ static int prompt_root_shell(int rfd) {
return log_error_errno(r, "Failed to query root shell: %m");
if (isempty(s)) {
log_warning("No shell entered, skipping.");
log_info("No shell entered, skipping.");
break;
}

View File

@ -69,8 +69,9 @@ int verb_cat(int argc, char *argv[], void *userdata) {
return r;
if (r == 0) {
/* Skip units which have no on-disk counterpart, but propagate the error to the
* user */
rc = -ENOENT;
* user (if --force is set, eat the error, just like unit_find_paths()) */
if (!arg_force)
rc = -ENOENT;
continue;
}

View File

@ -340,6 +340,8 @@ done
systemctl is-active "*-journald.service"
systemctl cat "*udevd*"
systemctl cat "$UNIT_NAME"
(! systemctl cat hopefully-nonexistent-unit.service)
systemctl cat --force hopefully-nonexistent-unit.service
systemctl help "$UNIT_NAME"
systemctl service-watchdogs
systemctl service-watchdogs "$(systemctl service-watchdogs)"