mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-02-02 22:07:13 +08:00
👷 utils: add helper function to get available bootloaders for system
This commit is contained in:
parent
e91e48f811
commit
87575c1daa
@ -125,6 +125,16 @@ constexpr inline auto bootloader_default_mount(std::string_view bootloader, std:
|
|||||||
return "unknown bootloader"sv;
|
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
|
} // namespace utils
|
||||||
|
|
||||||
#endif // UTILS_HPP
|
#endif // UTILS_HPP
|
||||||
|
Loading…
Reference in New Issue
Block a user