Fix resizing of fat partitions.

Workaround a bug in fatresize (or libparted) where resizing to
partition length failed. Instead try to resize to length - 1.

BUG: 407834
This commit is contained in:
Andrius Štikonas 2020-10-04 22:21:58 +01:00
parent 4819eec59b
commit 7ecdaf3ac8
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ bool fat16::create(Report& report, const QString& deviceNode)
bool fat16::resize(Report& report, const QString& deviceNode, qint64 length) const
{
ExternalCommand cmd(report, QStringLiteral("fatresize"), { QStringLiteral("--verbose"), QStringLiteral("--size"), QString::number(length), deviceNode });
ExternalCommand cmd(report, QStringLiteral("fatresize"), { QStringLiteral("--verbose"), QStringLiteral("--size"), QString::number(length - 1), deviceNode });
return cmd.run(-1) && cmd.exitCode() == 0;
}