mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-09-25 18:59:02 +00:00
Firmware installer: Early protection against disk space shortage complications
This commit is contained in:
parent
312b35051d
commit
c509226bab
1 changed files with 18 additions and 1 deletions
|
@ -1388,13 +1388,30 @@ void main_window::HandlePupInstallation(const QString& file_path, const QString&
|
||||||
|
|
||||||
fs::file update_files_f = pup.get_file(0x300);
|
fs::file update_files_f = pup.get_file(0x300);
|
||||||
|
|
||||||
if (!update_files_f)
|
const usz update_files_size = update_files_f ? update_files_f.size() : 0;
|
||||||
|
|
||||||
|
if (!update_files_size)
|
||||||
{
|
{
|
||||||
gui_log.error("Error while installing firmware: Couldn't find installation packages database.");
|
gui_log.error("Error while installing firmware: Couldn't find installation packages database.");
|
||||||
critical(tr("Firmware installation failed: The provided file's contents are corrupted."));
|
critical(tr("Firmware installation failed: The provided file's contents are corrupted."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fs::device_stat dev_stat{};
|
||||||
|
if (!fs::statfs(g_cfg_vfs.get_dev_flash(), dev_stat))
|
||||||
|
{
|
||||||
|
gui_log.error("Error while installing firmware: Couldn't retrieve available disk space. ('%s')", g_cfg_vfs.get_dev_flash());
|
||||||
|
critical(tr("Firmware installation failed: Couldn't retrieve available disk space."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dev_stat.avail_free < update_files_size)
|
||||||
|
{
|
||||||
|
gui_log.error("Error while installing firmware: Out of disk space. ('%s', needed: %d bytes)", g_cfg_vfs.get_dev_flash(), update_files_size - dev_stat.avail_free);
|
||||||
|
critical(tr("Firmware installation failed: Out of disk space."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
tar_object update_files(update_files_f);
|
tar_object update_files(update_files_f);
|
||||||
|
|
||||||
if (!dir_path.isEmpty())
|
if (!dir_path.isEmpty())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue