return r;
_cleanup_(boot_config_free) BootConfig config = BOOT_CONFIG_NULL;
- r = boot_config_load_and_select(&config, arg_esp_path, esp_devid, arg_xbootldr_path, xbootldr_devid);
+ r = boot_config_load_and_select(&config, arg_root, arg_esp_path, esp_devid, arg_xbootldr_path, xbootldr_devid);
if (r < 0)
return r;
if (arg_esp_path || arg_xbootldr_path) {
_cleanup_(boot_config_free) BootConfig config = BOOT_CONFIG_NULL;
- k = boot_config_load_and_select(&config,
- arg_esp_path, esp_devid,
- arg_xbootldr_path, xbootldr_devid);
+ k = boot_config_load_and_select(
+ &config,
+ arg_root,
+ arg_esp_path, esp_devid,
+ arg_xbootldr_path, xbootldr_devid);
RET_GATHER(r, k);
if (k >= 0)
if (r < 0)
return r;
- r = boot_config_load_and_select(&config, arg_esp_path, esp_devid, arg_xbootldr_path, xbootldr_devid);
+ r = boot_config_load_and_select(&config, arg_root, arg_esp_path, esp_devid, arg_xbootldr_path, xbootldr_devid);
if (r < 0)
return r;
if (r < 0)
return r;
- r = boot_config_load_and_select(&config, arg_esp_path, esp_devid, arg_xbootldr_path, xbootldr_devid);
+ r = boot_config_load_and_select(&config, arg_root, arg_esp_path, esp_devid, arg_xbootldr_path, xbootldr_devid);
if (r < 0)
return r;
_cleanup_(boot_config_free) BootConfig config = BOOT_CONFIG_NULL;
r = boot_config_load_and_select(
&config,
+ arg_root,
arg_esp_path,
esp_devid,
arg_xbootldr_path,
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include "bootctl.h"
#include "bootspec-util.h"
#include "devnum-util.h"
#include "efi-loader.h"
int boot_config_load_and_select(
BootConfig *config,
+ const char *root,
const char *esp_path,
dev_t esp_devid,
const char *xbootldr_path,
if (r < 0)
return r;
- if (!arg_root) {
+ if (!root) {
_cleanup_strv_free_ char **efi_entries = NULL;
r = efi_loader_get_entries(&efi_entries);
(void) boot_config_augment_from_loader(config, efi_entries, /* auto_only= */ false);
}
- return boot_config_select_special_entries(config, /* skip_efivars= */ !!arg_root);
+ return boot_config_select_special_entries(config, /* skip_efivars= */ !!root);
}
#include "bootspec.h"
-int boot_config_load_and_select(BootConfig *config, const char *esp_path, dev_t esp_devid, const char *xbootldr_path, dev_t xbootldr_devid);
+int boot_config_load_and_select(BootConfig *config, const char *root, const char *esp_path, dev_t esp_devid, const char *xbootldr_path, dev_t xbootldr_devid);