mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-01-23 22:42:31 +08:00
👷 fstab: don't provide options for fstab gen
This commit is contained in:
parent
ec7b6f47c6
commit
2b708b3888
@ -402,7 +402,7 @@ void menu_simple() noexcept {
|
||||
}*/
|
||||
|
||||
// at this point we should have everything already mounted
|
||||
utils::generate_fstab("genfstab -U");
|
||||
utils::generate_fstab();
|
||||
|
||||
if (hostname.empty()) {
|
||||
tui::set_hostname();
|
||||
|
33
src/tui.cpp
33
src/tui.cpp
@ -128,38 +128,13 @@ void btrfs_subvolumes() noexcept {
|
||||
|
||||
// Function will not allow incorrect UUID type for installed system.
|
||||
void generate_fstab() noexcept {
|
||||
const std::vector<std::string> menu_entries = {
|
||||
"genfstab -U -p",
|
||||
"genfstab -p",
|
||||
"genfstab -L -p",
|
||||
"genfstab -t PARTUUID -p",
|
||||
};
|
||||
|
||||
auto* config_instance = Config::instance();
|
||||
auto& config_data = config_instance->data();
|
||||
const auto& system_info = std::get<std::string>(config_data["SYSTEM"]);
|
||||
|
||||
auto screen = ScreenInteractive::Fullscreen();
|
||||
std::string fstab_cmd{};
|
||||
std::int32_t selected{};
|
||||
auto ok_callback = [&] {
|
||||
if (system_info == "BIOS"sv && selected == 3) {
|
||||
static constexpr auto FstabErr = "\nThe Part UUID option is only for UEFI/GPT installations.\n"sv;
|
||||
detail::msgbox_widget(FstabErr);
|
||||
return;
|
||||
}
|
||||
fstab_cmd = menu_entries[static_cast<std::size_t>(selected)];
|
||||
screen.ExitLoopClosure()();
|
||||
};
|
||||
|
||||
static constexpr auto fstab_body = "\nThe FSTAB file (File System TABle) sets what storage devices\nand partitions are to be mounted, and how they are to be used.\n\nUUID (Universally Unique IDentifier) is recommended.\n\nIf no labels were set for the partitions earlier,\ndevice names will be used for the label option.\n"sv;
|
||||
detail::menu_widget(menu_entries, ok_callback, &selected, &screen, fstab_body);
|
||||
|
||||
static constexpr auto fstab_body = "\nThe FSTAB file (File System TABle) sets what storage devices\nand partitions are to be mounted, and how they are to be used.\n\nUUID (Universally Unique IDentifier) used.\n"sv;
|
||||
const auto& do_set_fstab = detail::yesno_widget(fstab_body, size(HEIGHT, LESS_THAN, 15) | size(WIDTH, LESS_THAN, 75));
|
||||
/* clang-format off */
|
||||
if (fstab_cmd.empty()) { return; }
|
||||
if (!do_set_fstab) { return; }
|
||||
/* clang-format on */
|
||||
|
||||
utils::generate_fstab(fstab_cmd);
|
||||
utils::generate_fstab();
|
||||
}
|
||||
|
||||
// Set system hostname
|
||||
|
@ -344,7 +344,8 @@ void secure_wipe() noexcept {
|
||||
#endif
|
||||
}
|
||||
|
||||
void generate_fstab(const std::string_view& fstab_cmd) noexcept {
|
||||
void generate_fstab() noexcept {
|
||||
static constexpr auto fstab_cmd = "genfstab -U -p"sv;
|
||||
spdlog::info("Generating with fstab '{}'", fstab_cmd);
|
||||
|
||||
#ifdef NDEVENV
|
||||
@ -916,7 +917,7 @@ void install_base(const std::string_view& packages) noexcept {
|
||||
spdlog::info("re-run mkinitcpio");
|
||||
}
|
||||
|
||||
utils::generate_fstab("genfstab -U -p");
|
||||
utils::generate_fstab();
|
||||
|
||||
/* clang-format off */
|
||||
if (zfs == 0) { return; }
|
||||
|
@ -19,7 +19,7 @@ void clear_screen() noexcept;
|
||||
void inst_needed(const std::string_view& pkg) noexcept;
|
||||
void secure_wipe() noexcept;
|
||||
void auto_partition() noexcept;
|
||||
void generate_fstab(const std::string_view& fstab_cmd) noexcept;
|
||||
void generate_fstab() noexcept;
|
||||
void set_hostname(const std::string_view& hostname) noexcept;
|
||||
void set_locale(const std::string_view& locale) noexcept;
|
||||
void set_xkbmap(const std::string_view& xkbmap) noexcept;
|
||||
|
Loading…
Reference in New Issue
Block a user