locale,firstboot: add headers to vconsole.conf

Closes #29717.
Replaces #29760.

Co-authored-by: cunshunxia <cunshunxia@tencent.com>
This commit is contained in:
Yu Watanabe
2023-10-30 20:30:12 +09:00
parent f155cb6d75
commit 0e7a7cd4e9
6 changed files with 28 additions and 2 deletions

View File

@@ -637,3 +637,11 @@ int write_env_file(int dir_fd, const char *fname, char **headers, char **l) {
(void) unlinkat(dir_fd, p, 0);
return r;
}
int write_vconsole_conf(int dir_fd, const char *fname, char **l) {
char **headers = STRV_MAKE(
"# Written by systemd-localed(8) or systemd-firstboot(1), read by systemd-localed",
"# and systemd-vconsole-setup(8). Use localectl(1) to update this file.");
return write_env_file(dir_fd, fname, headers, l);
}

View File

@@ -20,3 +20,5 @@ int load_env_file_pairs_fd(int fd, const char *fname, char ***ret);
int merge_env_file(char ***env, FILE *f, const char *fname);
int write_env_file(int dir_fd, const char *fname, char **headers, char **l);
int write_vconsole_conf(int dir_fd, const char *fname, char **l);