mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-01-23 05:52:23 +08:00
👷 properly detect uuid of partitions during init
This commit is contained in:
parent
45ade9ed50
commit
1673f81d37
@ -1757,6 +1757,9 @@ void mount_partitions() noexcept {
|
||||
const auto& part_fs = gucc::fs::utils::get_mountpoint_fs(mountpoint_info);
|
||||
auto root_part_struct = gucc::fs::Partition{.fstype = part_fs, .mountpoint = "/"s, .device = root_part, .mount_opts = mount_opts_info};
|
||||
|
||||
const auto& root_part_uuid = gucc::fs::utils::get_device_uuid(root_part_struct.device);
|
||||
root_part_struct.uuid_str = root_part_uuid;
|
||||
|
||||
// insert root partition
|
||||
partitions.emplace_back(std::move(root_part_struct));
|
||||
|
||||
@ -1879,6 +1882,9 @@ void mount_partitions() noexcept {
|
||||
const auto& part_fs = gucc::fs::utils::get_mountpoint_fs(mountpoint_info);
|
||||
auto part_struct = gucc::fs::Partition{.fstype = part_fs, .mountpoint = mount_dev, .device = partition, .mount_opts = mount_opts_info};
|
||||
|
||||
const auto& part_uuid = gucc::fs::utils::get_device_uuid(part_struct.device);
|
||||
part_struct.uuid_str = part_uuid;
|
||||
|
||||
// insert root partition
|
||||
partitions.emplace_back(std::move(part_struct));
|
||||
|
||||
|
@ -1083,7 +1083,7 @@ void install_refind() noexcept {
|
||||
const auto& part_fs = gucc::fs::utils::get_mountpoint_fs(mountpoint);
|
||||
auto root_part_struct = gucc::fs::Partition{.fstype = part_fs, .mountpoint = "/", .device = fmt::format(FMT_COMPILE("/dev/{}"), root_name)};
|
||||
|
||||
const auto& root_part_uuid = gucc::utils::exec(fmt::format(FMT_COMPILE("lsblk -o UUID '{}' | awk 'NR==2'"), root_part_struct.device));
|
||||
const auto& root_part_uuid = gucc::fs::utils::get_device_uuid(root_part_struct.device);
|
||||
root_part_struct.uuid_str = root_part_uuid;
|
||||
|
||||
const bool is_removable = (gucc::utils::exec(fmt::format(FMT_COMPILE("cat /sys/block/{}/removable"), root_device)) == "1"sv);
|
||||
|
Loading…
Reference in New Issue
Block a user