From: Yu Watanabe Date: Sat, 13 Apr 2019 17:58:10 +0000 (+0900) Subject: bootspec: fix build when EFI support is disabled X-Git-Tag: v243-rc1~543 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=528fcf8d1d06f18aed6fd8c90a1ab0530b4f4ba3;p=thirdparty%2Fsystemd.git bootspec: fix build when EFI support is disabled Follow-up for ce4c4f810876b2d6e50041c8bbe089e8a9e2576e. --- diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index b2f8936038b..5c823a3d84f 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -725,8 +725,8 @@ int boot_entries_load_config_auto( return boot_entries_load_config(esp_where, xbootldr_where, config); } +#if ENABLE_EFI int boot_entries_augment_from_loader(BootConfig *config, bool only_auto) { - static const char * const title_table[] = { /* Pretty names for a few well-known automatically discovered entries. */ "auto-osx", "macOS", @@ -793,6 +793,7 @@ int boot_entries_augment_from_loader(BootConfig *config, bool only_auto) { return 0; } +#endif /********************************************************************************/ diff --git a/src/shared/bootspec.h b/src/shared/bootspec.h index b35eaf1110c..c18d89494a5 100644 --- a/src/shared/bootspec.h +++ b/src/shared/bootspec.h @@ -71,7 +71,13 @@ static inline BootEntry* boot_config_default_entry(BootConfig *config) { void boot_config_free(BootConfig *config); int boot_entries_load_config(const char *esp_path, const char *xbootldr_path, BootConfig *config); int boot_entries_load_config_auto(const char *override_esp_path, const char *override_xbootldr_path, BootConfig *config); +#if ENABLE_EFI int boot_entries_augment_from_loader(BootConfig *config, bool only_auto); +#else +static inline int boot_entries_augment_from_loader(BootConfig *config, bool only_auto) { + return -EOPNOTSUPP; +} +#endif static inline const char* boot_entry_title(const BootEntry *entry) { return entry->show_title ?: entry->title ?: entry->id; diff --git a/src/shared/efivars.h b/src/shared/efivars.h index 49d1b338fbd..1346da9323d 100644 --- a/src/shared/efivars.h +++ b/src/shared/efivars.h @@ -79,6 +79,10 @@ static inline int efi_set_reboot_to_firmware(bool value) { return -EOPNOTSUPP; } +static inline char* efi_variable_path(sd_id128_t vendor, const char *name) { + return NULL; +} + static inline int efi_get_variable(sd_id128_t vendor, const char *name, uint32_t *attribute, void **value, size_t *size) { return -EOPNOTSUPP; }