bootctl: move arg_touch_variables checkers to bootctl-util.c

No functional change, just refactoring.
This commit is contained in:
Yu Watanabe
2026-02-13 16:11:30 +09:00
parent 3c5ed73030
commit 28fa318b16
6 changed files with 75 additions and 58 deletions
-23
View File
@@ -229,29 +229,6 @@ static int print_loader_or_stub_path(void) {
return 0;
}
bool touch_variables(void) {
/* If we run in a container or on a non-EFI system, automatically turn off EFI file system access,
* unless explicitly overridden. */
if (arg_touch_variables >= 0)
return arg_touch_variables;
if (arg_root) {
log_once(LOG_NOTICE,
"Operating on %s, skipping EFI variable modifications.",
arg_image ? "image" : "root directory");
return false;
}
if (!is_efi_boot()) { /* NB: this internally checks if we run in a container */
log_once(LOG_NOTICE,
"Not booted with EFI or running in a container, skipping EFI variable modifications.");
return false;
}
return true;
}
GracefulMode arg_graceful(void) {
static bool chroot_checked = false;