[partition] Use automount control

FIXES #1604

(Admittedly, this fixes the problem only when there's Plasma Solid automount
present, and not any of the other kinds; but none of those have been reported
yet, and adding them into AutoMount.cpp is opaque to the rest of the
system)
This commit is contained in:
Adriaan de Groot 2021-02-03 01:31:37 +01:00
parent 17f73b1294
commit 144b51f00e

View File

@ -21,6 +21,7 @@
#include "core/PartUtils.h"
#include "core/PartitionInfo.h"
#include "core/PartitionModel.h"
#include "jobs/AutoMountManagementJob.h"
#include "jobs/ClearMountsJob.h"
#include "jobs/ClearTempMountsJob.h"
#include "jobs/CreatePartitionJob.h"
@ -576,6 +577,11 @@ PartitionCoreModule::jobs( const Config* config ) const
#endif
#endif
// The automountControl job goes in the list twice: the first
// time it runs, it disables automount and remembers the old setting
// for automount; the second time it restores that old setting.
Calamares::job_ptr automountControl( new AutoMountManagementJob( true /* disable automount */ ) );
lst << automountControl;
lst << Calamares::job_ptr( new ClearTempMountsJob() );
for ( auto info : m_deviceInfos )
@ -592,6 +598,7 @@ PartitionCoreModule::jobs( const Config* config ) const
devices << info->device.data();
}
lst << Calamares::job_ptr( new FillGlobalStorageJob( config, devices, m_bootLoaderInstallPath ) );
lst << automountControl;
return lst;
}