Do not attempt to set empty partition type.
This commit is contained in:
parent
cd33592501
commit
e3d01cf25f
|
@ -202,8 +202,11 @@ static QLatin1String getPartitionType(FileSystem::Type t, PartitionTable::TableT
|
||||||
|
|
||||||
bool SfdiskPartitionTable::setPartitionSystemType(Report& report, const Partition& partition)
|
bool SfdiskPartitionTable::setPartitionSystemType(Report& report, const Partition& partition)
|
||||||
{
|
{
|
||||||
|
QString partitionType = getPartitionType(partition.fileSystem().type(), m_device->partitionTable()->type());
|
||||||
|
if (partitionType.isEmpty())
|
||||||
|
return true;
|
||||||
ExternalCommand sfdiskCommand(report, QStringLiteral("sfdisk"), { QStringLiteral("--part-type"), m_device->deviceNode(), QString::number(partition.number()),
|
ExternalCommand sfdiskCommand(report, QStringLiteral("sfdisk"), { QStringLiteral("--part-type"), m_device->deviceNode(), QString::number(partition.number()),
|
||||||
getPartitionType(partition.fileSystem().type(), m_device->partitionTable()->type()) } );
|
partitionType } );
|
||||||
return sfdiskCommand.run(-1) && sfdiskCommand.exitCode() == 0;
|
return sfdiskCommand.run(-1) && sfdiskCommand.exitCode() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue