mirror of
https://github.com/parchlinux/calamares.git
synced 2025-03-01 05:15:44 -05:00
[partition] Refactor getting partitions from device
- Split out into own function - Prepare for implementation that doesn't use external processes
This commit is contained in:
parent
61f46e77e0
commit
ecdd09edcd
1 changed files with 17 additions and 7 deletions
|
@ -60,14 +60,9 @@ ClearMountsJob::prettyStatusMessage() const
|
|||
}
|
||||
|
||||
|
||||
Calamares::JobResult
|
||||
ClearMountsJob::exec()
|
||||
QStringList
|
||||
getPartitionsForDevice( const QString& deviceName )
|
||||
{
|
||||
CalamaresUtils::Partition::Syncer s;
|
||||
QStringList goodNews;
|
||||
|
||||
QString deviceName = m_device->deviceNode().split( '/' ).last();
|
||||
|
||||
QProcess process;
|
||||
process.setProgram( "sh" );
|
||||
process.setArguments( {
|
||||
|
@ -81,6 +76,21 @@ ClearMountsJob::exec()
|
|||
const QString partitions = process.readAllStandardOutput();
|
||||
const QStringList partitionsList = partitions.simplified().split( ' ' );
|
||||
|
||||
return partitionsList;
|
||||
}
|
||||
|
||||
Calamares::JobResult
|
||||
ClearMountsJob::exec()
|
||||
{
|
||||
CalamaresUtils::Partition::Syncer s;
|
||||
|
||||
QString deviceName = m_device->deviceNode().split( '/' ).last();
|
||||
|
||||
QStringList goodNews;
|
||||
QProcess process;
|
||||
|
||||
QStringList partitionsList = getPartitionsForDevice( deviceName );
|
||||
|
||||
// Build a list of partitions of type 82 (Linux swap / Solaris).
|
||||
// We then need to clear them just in case they contain something resumable from a
|
||||
// previous suspend-to-disk.
|
||||
|
|
Loading…
Add table
Reference in a new issue