mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-01-23 14:32:22 +08:00
🧹 cleanup
This commit is contained in:
parent
6f088ea460
commit
e452bdce71
@ -1026,7 +1026,7 @@ pacman -S --noconfirm --needed grub efibootmgr dosfstools
|
||||
sed -e '/GRUB_SAVEDEFAULT/ s/^#*/#/' -i /etc/default/grub
|
||||
# we need to tell grub where the zfs root is)";
|
||||
|
||||
const auto& mountpoint_source = utils::exec(fmt::format(FMT_COMPILE("findmnt -ln -o SOURCE {}"), mountpoint));
|
||||
const auto& mountpoint_source = utils::get_mountpoint_source(mountpoint);
|
||||
const auto& zroot_var = fmt::format(FMT_COMPILE("zroot=\"zfs={} rw\""), mountpoint_source);
|
||||
|
||||
constexpr auto bash_codepart2 = R"(
|
||||
@ -1299,7 +1299,7 @@ pacman -S --noconfirm --needed grub os-prober
|
||||
sed -e '/GRUB_SAVEDEFAULT/ s/^#*/#/' -i /etc/default/grub
|
||||
# we need to tell grub where the zfs root is)";
|
||||
|
||||
const auto& mountpoint_source = utils::exec(fmt::format(FMT_COMPILE("findmnt -ln -o SOURCE {}"), mountpoint));
|
||||
const auto& mountpoint_source = utils::get_mountpoint_source(mountpoint);
|
||||
const auto& zroot_var = fmt::format(FMT_COMPILE("zroot=\"zfs={} rw\""), mountpoint_source);
|
||||
|
||||
constexpr auto bash_codepart2 = R"(
|
||||
@ -1399,6 +1399,10 @@ std::string get_mountpoint_fs(const std::string_view& mountpoint) noexcept {
|
||||
return utils::exec(fmt::format(FMT_COMPILE("findmnt -ln -o FSTYPE \"{}\""), mountpoint));
|
||||
}
|
||||
|
||||
std::string get_mountpoint_source(const std::string_view& mountpoint) noexcept {
|
||||
return utils::exec(fmt::format(FMT_COMPILE("findmnt -ln -o SOURCE \"{}\""), mountpoint));
|
||||
}
|
||||
|
||||
std::string list_containing_crypt() noexcept {
|
||||
return utils::exec("blkid | awk '/TYPE=\"crypto_LUKS\"/{print $1}' | sed 's/.$//'");
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ void set_root_password(const std::string_view& password) noexcept;
|
||||
[[nodiscard]] bool check_base() noexcept;
|
||||
[[nodiscard]] auto list_mounted() noexcept -> std::string;
|
||||
[[nodiscard]] auto get_mountpoint_fs(const std::string_view& mountpoint) noexcept -> std::string;
|
||||
[[nodiscard]] auto get_mountpoint_source(const std::string_view& mountpoint) noexcept -> std::string;
|
||||
[[nodiscard]] auto list_containing_crypt() noexcept -> std::string;
|
||||
[[nodiscard]] auto list_non_crypt() noexcept -> std::string;
|
||||
void lvm_detect(std::optional<std::function<void()>> func_callback = std::nullopt) noexcept;
|
||||
|
Loading…
Reference in New Issue
Block a user