diff --git a/meson.build b/meson.build index dbba108ad1a..e2cf0007bba 100644 --- a/meson.build +++ b/meson.build @@ -299,6 +299,8 @@ conf.set10('MEMORY_ACCOUNTING_DEFAULT', memory_accounting_ conf.set('STATUS_UNIT_FORMAT_DEFAULT', 'STATUS_UNIT_FORMAT_' + status_unit_format_default.to_upper()) conf.set_quoted('STATUS_UNIT_FORMAT_DEFAULT_STR', status_unit_format_default) +conf.set10('FIRST_BOOT_FULL_PRESET', get_option('first-boot-full-preset')) + ##################################################################### cc = meson.get_compiler('c') @@ -4287,6 +4289,7 @@ foreach tuple : [ ['link-networkd-shared', get_option('link-networkd-shared')], ['link-timesyncd-shared', get_option('link-timesyncd-shared')], ['link-boot-shared', get_option('link-boot-shared')], + ['first-boot-full-preset'], ['fexecve'], ['standalone-binaries', get_option('standalone-binaries')], ['coverage', get_option('b_coverage')], diff --git a/meson_options.txt b/meson_options.txt index 26d1170c504..3b059e16b2f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -27,6 +27,8 @@ option('link-timesyncd-shared', type: 'boolean', description : 'link systemd-timesyncd and its helpers to libsystemd-shared.so') option('link-boot-shared', type: 'boolean', description : 'link bootctl and systemd-bless-boot against libsystemd-shared.so') +option('first-boot-full-preset', type: 'boolean', value: false, + description : 'during first boot, do full preset-all (default will be changed to true later)') option('static-libsystemd', type : 'combo', choices : ['false', 'true', 'pic', 'no-pic'], diff --git a/src/core/manager.c b/src/core/manager.c index 296b7599598..bab766af31a 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -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");