🚧 gucc: handle btrfs subvol mount status

This commit is contained in:
Vladislav Nepogodin 2024-07-24 00:12:18 +04:00
parent a31d1fc52b
commit b2e15e3f06
No known key found for this signature in database
GPG Key ID: B62C3D10C54D5DA9

View File

@ -78,8 +78,15 @@ auto btrfs_mount_subvols(const std::vector<BtrfsSubvolume>& subvols, std::string
spdlog::error("Failed to create directories for btrfs subvols mountpoint {}: {}", subvolume_mountpoint, err.message());
return false;
}
// TODO(vnepogodin): handle exit code
utils::exec(fmt::format(FMT_COMPILE("mount -o {} \"{}\" {}"), mount_option, device, subvolume_mountpoint));
// now mount subvolume
const auto& mount_cmd = fmt::format(FMT_COMPILE("mount -o {} \"{}\" {}"), mount_option, device, subvolume_mountpoint);
spdlog::debug("mounting..: {}", mount_cmd);
if (!utils::exec_checked(mount_cmd)) {
spdlog::error("Failed to mount subvolume {} mountpoint {} with: {}", subvol.subvolume, subvolume_mountpoint, mount_cmd);
return false;
}
}
return true;
}