This commit is contained in:
Vladislav Nepogodin 2023-02-09 09:27:32 +04:00
parent 51439b45c7
commit 8315a7969f
No known key found for this signature in database
GPG Key ID: B62C3D10C54D5DA9
2 changed files with 6 additions and 5 deletions

View File

@ -139,14 +139,15 @@ void generate_fstab() noexcept {
fstab_cmd = menu_entries[static_cast<std::size_t>(selected)]; fstab_cmd = menu_entries[static_cast<std::size_t>(selected)];
screen.ExitLoopClosure()(); 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";
detail::menu_widget(menu_entries, ok_callback, &selected, &screen, fstab_body);
/* clang-format off */ /* clang-format off */
if (fstab_cmd.empty()) { return; } if (fstab_cmd.empty()) { return; }
/* clang-format on */ /* clang-format on */
utils::generate_fstab(fstab_cmd); utils::generate_fstab(fstab_cmd);
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";
detail::menu_widget(menu_entries, ok_callback, &selected, &screen, fstab_body);
} }
// Set system hostname // Set system hostname

View File

@ -2003,7 +2003,7 @@ void setup_luks_keyfile() noexcept {
// Add keyfile to luks // Add keyfile to luks
const auto& root_name = utils::exec("mount | awk '/\\/mnt / {print $1}' | sed s~/dev/mapper/~~g | sed s~/dev/~~g"); const auto& root_name = utils::exec("mount | awk '/\\/mnt / {print $1}' | sed s~/dev/mapper/~~g | sed s~/dev/~~g");
const auto& root_part = utils::exec(fmt::format(FMT_COMPILE("lsblk -i | tac | sed -r 's/^[^[:alnum:]]+//' | sed -n -e \"/{}/,/part/p\" | {} | tr -cd '[:alnum:]'"), root_name, "awk '/part/ {print $1}'")); const auto& root_part = utils::exec(fmt::format(FMT_COMPILE("lsblk -i | tac | sed -r 's/^[^[:alnum:]]+//' | sed -n -e \"/{}/,/part/p\" | {} | tr -cd '[:alnum:]'"), root_name, "awk '/part/ {print $1}'"));
const auto& number_of_lukskeys = to_int(utils::exec(fmt::format(FMT_COMPILE("cryptsetup luksDump /dev/\"{}\" | grep \"ENABLED\" | wc -l"), root_part))); const auto& number_of_lukskeys = utils::to_int(utils::exec(fmt::format(FMT_COMPILE("cryptsetup luksDump /dev/\"{}\" | grep \"ENABLED\" | wc -l"), root_part)));
if (number_of_lukskeys < 4) { if (number_of_lukskeys < 4) {
// Create a keyfile // Create a keyfile
#ifdef NDEVENV #ifdef NDEVENV
@ -2137,7 +2137,7 @@ void final_check() noexcept {
//[[ ! -e /mnt/.video_installed ]] && echo "- $_GCCheck" >> ${CHECKLIST} //[[ ! -e /mnt/.video_installed ]] && echo "- $_GCCheck" >> ${CHECKLIST}
// Check if locales have been generated // Check if locales have been generated
if (to_int(utils::exec(fmt::format(FMT_COMPILE("arch-chroot {} locale -a | wc -l"), mountpoint), true)) < 3) { if (utils::to_int(utils::exec(fmt::format(FMT_COMPILE("arch-chroot {} locale -a | wc -l"), mountpoint), true)) < 3) {
checklist += "- Locales have not been generated\n"; checklist += "- Locales have not been generated\n";
} }