Skip to content

Commit

Permalink
🚧 gucc: handle btrfs subvol mount status
Browse files Browse the repository at this point in the history
  • Loading branch information
vnepogodin committed Jul 23, 2024
1 parent a31d1fc commit b2e15e3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions gucc/src/btrfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b2e15e3

Please sign in to comment.