Linux (as root): FAT32 format: wait for FAT partition after sfdisk

The FAT partition /dev node is supposed to be already available
after running partprobe, but since there is a user report that
is not always the case, double check and delay if necessary.

Closes #237
This commit is contained in:
Floris Bos 2021-11-18 12:21:24 +01:00
parent 08b7398e6b
commit 2e5cc7508a

View file

@ -187,6 +187,18 @@ void DriveFormatThread::run()
} }
proc.execute("partprobe", QStringList() ); proc.execute("partprobe", QStringList() );
for (int tries = 0; tries < 30; tries++)
{
if (QFile::exists(fatpartition))
break;
QThread::msleep(100);
}
if (!QFile::exists(fatpartition))
{
emit error(tr("Partitioning did not create expected FAT partition %1").arg(QString(fatpartition)));
return;
}
args.clear(); args.clear();
args << fatpartition; args << fatpartition;