Skip to content
This repository was archived by the owner on Feb 27, 2023. It is now read-only.

Commit 42daeb0

Browse files
maxnetXECDesign
authored andcommitted
Do not cache volume id in variable
The PARTUUID code was originally written for the boot-from-USB scenario in which only one disk is used. In that situation it made sense to retrieve the volume id of the disk once, and cache it in a variable. However in the boot from SD card, root on USB drive scenario different drives are used, so this doesn't work.
1 parent 71cb0d3 commit 42daeb0

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

recovery/multiimagewritethread.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,14 +1007,16 @@ QByteArray MultiImageWriteThread::getDiskId(const QString &device)
10071007

10081008
QByteArray MultiImageWriteThread::getPartUUID(const QString &devpart)
10091009
{
1010-
if (_diskId.isEmpty())
1011-
_diskId = getDiskId(_drive);
1012-
1013-
QByteArray r = "PARTUUID="+_diskId;
1010+
QByteArray r;
10141011

10151012
QRegExp partnrRx("([0-9]+)$");
10161013
if (partnrRx.indexIn(devpart) != -1)
10171014
{
1015+
QString drive = devpart.left(partnrRx.pos());
1016+
if (drive.endsWith("p"))
1017+
drive.chop(1);
1018+
1019+
r = "PARTUUID="+getDiskId(drive);
10181020
int partnr = partnrRx.cap(1).toInt();
10191021
QByteArray partnrstr = QByteArray::number(partnr, 16).rightJustified(2, '0');
10201022
r += '-'+partnrstr;

recovery/multiimagewritethread.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class MultiImageWriteThread : public QThread
4141
QString _drive, _bootdrive;
4242
int _extraSpacePerPartition, _sectorOffset, _part;
4343
QVariantList installed_os;
44-
QByteArray _diskId;
4544
bool _multiDrives;
4645

4746
signals:

0 commit comments

Comments
 (0)