Merge pull request #15205 from jlebon/pr/preset-all-firstboot
manager: optionally, do a full preset on first boot
This commit is contained in:
+3
-1
@@ -1728,7 +1728,9 @@ static void manager_preset_all(Manager *m) {
|
||||
return;
|
||||
|
||||
/* If this is the first boot, and we are in the host system, then preset everything */
|
||||
r = unit_file_preset_all(LOOKUP_SCOPE_SYSTEM, 0, NULL, UNIT_FILE_PRESET_ENABLE_ONLY, NULL, 0);
|
||||
UnitFilePresetMode mode = FIRST_BOOT_FULL_PRESET ? UNIT_FILE_PRESET_FULL : UNIT_FILE_PRESET_ENABLE_ONLY;
|
||||
|
||||
r = unit_file_preset_all(LOOKUP_SCOPE_SYSTEM, 0, NULL, mode, NULL, 0);
|
||||
if (r < 0)
|
||||
log_full_errno(r == -EEXIST ? LOG_NOTICE : LOG_WARNING, r,
|
||||
"Failed to populate /etc with preset unit settings, ignoring: %m");
|
||||
|
||||
@@ -54,7 +54,7 @@ static int output_unit_file_list(const UnitFileList *units, unsigned c) {
|
||||
_cleanup_(unit_file_presets_freep) UnitFilePresets presets = {};
|
||||
int r;
|
||||
|
||||
table = table_new("unit file", "state", "vendor preset");
|
||||
table = table_new("unit file", "state", "preset");
|
||||
if (!table)
|
||||
return log_oom();
|
||||
|
||||
|
||||
@@ -318,7 +318,7 @@ static void print_status_info(
|
||||
bool *ellipsized) {
|
||||
|
||||
const char *active_on, *active_off, *on, *off, *ss, *fs;
|
||||
const char *enable_on, *enable_off, *enable_vendor_on, *enable_vendor_off;
|
||||
const char *enable_on, *enable_off, *preset_on, *preset_off;
|
||||
_cleanup_free_ char *formatted_path = NULL;
|
||||
usec_t timestamp;
|
||||
const char *path;
|
||||
@@ -331,7 +331,7 @@ static void print_status_info(
|
||||
|
||||
format_active_state(i->active_state, &active_on, &active_off);
|
||||
format_enable_state(i->unit_file_state, &enable_on, &enable_off);
|
||||
format_enable_state(i->unit_file_preset, &enable_vendor_on, &enable_vendor_off);
|
||||
format_enable_state(i->unit_file_preset, &preset_on, &preset_off);
|
||||
|
||||
const SpecialGlyph glyph = unit_active_state_to_glyph(unit_active_state_from_string(i->active_state));
|
||||
|
||||
@@ -366,8 +366,8 @@ static void print_status_info(
|
||||
on, strna(i->load_state), off,
|
||||
path,
|
||||
enable_on, i->unit_file_state, enable_off,
|
||||
show_preset ? "; vendor preset: " : "",
|
||||
enable_vendor_on, show_preset ? i->unit_file_preset : "", enable_vendor_off);
|
||||
show_preset ? "; preset: " : "",
|
||||
preset_on, show_preset ? i->unit_file_preset : "", preset_off);
|
||||
|
||||
} else if (path)
|
||||
printf(" Loaded: %s%s%s (%s)\n",
|
||||
|
||||
Reference in New Issue
Block a user