Skip to content

Commit

Permalink
👷 properly detect uuid of partitions during init
Browse files Browse the repository at this point in the history
  • Loading branch information
vnepogodin committed Jul 28, 2024
1 parent 45ade9e commit 1673f81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/tui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down Expand Up @@ -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));

Expand Down
2 changes: 1 addition & 1 deletion src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1673f81

Please sign in to comment.