mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-01-23 22:42:31 +08:00
👷 utils: add helper function to get default mountpoint for bootloader
This commit is contained in:
parent
b8dbc4418b
commit
e91e48f811
@ -113,6 +113,18 @@ constexpr inline double convert_unit(const double number, const std::string_view
|
||||
return number;
|
||||
}
|
||||
|
||||
// Get appropriate default mountpoint for bootloader
|
||||
constexpr inline auto bootloader_default_mount(std::string_view bootloader, std::string_view bios_mode) noexcept -> std::string_view {
|
||||
using namespace std::string_view_literals;
|
||||
|
||||
if (bootloader == "systemd-boot"sv || bios_mode == "BIOS"sv) {
|
||||
return "/boot"sv;
|
||||
} else if (bootloader == "grub"sv || bootloader == "refind"sv) {
|
||||
return "/boot/efi"sv;
|
||||
}
|
||||
return "unknown bootloader"sv;
|
||||
}
|
||||
|
||||
} // namespace utils
|
||||
|
||||
#endif // UTILS_HPP
|
||||
|
Loading…
Reference in New Issue
Block a user