[partition] Simplify and document ClearMounts
- note that the job indiscriminately closes all LUKS and LV - don't hang on to lists we don't need
This commit is contained in:
parent
0253977778
commit
1410157356
@ -367,23 +367,17 @@ ClearMountsJob::prettyStatusMessage() const
|
||||
Calamares::JobResult
|
||||
ClearMountsJob::exec()
|
||||
{
|
||||
CalamaresUtils::Partition::Syncer s;
|
||||
|
||||
const QString deviceName = m_deviceNode.split( '/' ).last();
|
||||
|
||||
CalamaresUtils::Partition::Syncer s;
|
||||
QList< MessageAndPath > goodNews;
|
||||
QProcess process;
|
||||
|
||||
const QStringList partitionsList = getPartitionsForDevice( deviceName );
|
||||
const QStringList swapPartitions = getSwapsForDevice( m_deviceNode );
|
||||
|
||||
apply( getCryptoDevices(), tryCryptoClose, goodNews );
|
||||
apply( getLVMVolumes(), tryUmount, goodNews );
|
||||
apply( getPVGroups( deviceName ), tryVGDisable, goodNews );
|
||||
|
||||
apply( getCryptoDevices(), tryCryptoClose, goodNews );
|
||||
apply( partitionsList, tryUmount, goodNews );
|
||||
apply( swapPartitions, tryClearSwap, goodNews );
|
||||
apply( getPartitionsForDevice( deviceName ), tryUmount, goodNews );
|
||||
apply( getSwapsForDevice( m_deviceNode ), tryClearSwap, goodNews );
|
||||
|
||||
Calamares::JobResult ok = Calamares::JobResult::ok();
|
||||
ok.setMessage( tr( "Cleared all mounts for %1" ).arg( m_deviceNode ) );
|
||||
|
@ -17,14 +17,21 @@ class Device;
|
||||
/**
|
||||
* This job tries to free all mounts for the given device, so partitioning
|
||||
* operations can proceed.
|
||||
*
|
||||
* - partitions on the device are unmounted
|
||||
* - swap on the device is disabled and cleared
|
||||
* - physical volumes for LVM on the device are disabled
|
||||
*
|
||||
* In addition, regardless of device:
|
||||
* - all /dev/mapper entries (crypto / LUKS) are closed
|
||||
* - all logical volumes for LVM are unmounted
|
||||
*
|
||||
*/
|
||||
class ClearMountsJob : public Calamares::Job
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/** @brief Creates a job freeing mounts on @p device
|
||||
*
|
||||
* All /dev/mapper entries are closed, regardless of device.
|
||||
*
|
||||
* No ownership is transferred; the @p device is used only to access
|
||||
* the device node (name).
|
||||
|
Loading…
Reference in New Issue
Block a user