👷 utils: add helper function to get available bootloaders for system

This commit is contained in:
Vladislav Nepogodin 2023-12-08 11:12:02 +04:00
parent e91e48f811
commit 87575c1daa
No known key found for this signature in database
GPG Key ID: B62C3D10C54D5DA9

View File

@ -125,6 +125,16 @@ constexpr inline auto bootloader_default_mount(std::string_view bootloader, std:
return "unknown bootloader"sv;
}
// Get available bootloaders
constexpr inline auto available_bootloaders(std::string_view bios_mode) noexcept -> std::vector<std::string_view> {
using namespace std::string_view_literals;
if (bios_mode == "BIOS"sv) {
return {"grub"sv, "grub + os-prober"sv};
}
return {"systemd-boot"sv, "refind"sv, "grub"sv};
}
} // namespace utils
#endif // UTILS_HPP