Add debug output to the ClearMountsJob code path.
This commit is contained in:
parent
1495e6604d
commit
1eff260637
@ -293,6 +293,16 @@ PartitionCoreModule::jobs() const
|
|||||||
}
|
}
|
||||||
lst << Calamares::job_ptr( new FillGlobalStorageJob( devices, m_bootLoaderInstallPath ) );
|
lst << Calamares::job_ptr( new FillGlobalStorageJob( devices, m_bootLoaderInstallPath ) );
|
||||||
|
|
||||||
|
|
||||||
|
QStringList jobsDebug;
|
||||||
|
foreach ( auto job, lst )
|
||||||
|
{
|
||||||
|
jobsDebug.append( job->prettyName() );
|
||||||
|
}
|
||||||
|
|
||||||
|
cDebug() << "PartitionCodeModule has been asked for jobs. About to return:"
|
||||||
|
<< jobsDebug.join( "\n" );
|
||||||
|
|
||||||
return lst;
|
return lst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include <core/PartitionInfo.h>
|
#include <core/PartitionInfo.h>
|
||||||
#include <core/PartitionIterator.h>
|
#include <core/PartitionIterator.h>
|
||||||
#include <util/report.h>
|
#include <util/report.h>
|
||||||
|
#include <utils/Logger.h>
|
||||||
|
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
@ -45,30 +46,40 @@ ClearMountsJob::prettyName() const
|
|||||||
Calamares::JobResult
|
Calamares::JobResult
|
||||||
ClearMountsJob::exec()
|
ClearMountsJob::exec()
|
||||||
{
|
{
|
||||||
|
cDebug() << "Executing ClearMounts job for device" << m_device->deviceNode();
|
||||||
QStringList goodNews;
|
QStringList goodNews;
|
||||||
for ( auto it = PartitionIterator::begin( m_device );
|
for ( auto it = PartitionIterator::begin( m_device );
|
||||||
it != PartitionIterator::end( m_device ); ++it )
|
it != PartitionIterator::end( m_device ); ++it )
|
||||||
{
|
{
|
||||||
|
cDebug() << "Now examining device" << (*it)->partitionPath();
|
||||||
if ( (*it)->isMounted() )
|
if ( (*it)->isMounted() )
|
||||||
{
|
{
|
||||||
|
cDebug() << "\tIt's mounted!";
|
||||||
if ( (*it)->canUnmount() )
|
if ( (*it)->canUnmount() )
|
||||||
{
|
{
|
||||||
|
cDebug() << "\tTrying to umount...";
|
||||||
Report report( 0, QString() );
|
Report report( 0, QString() );
|
||||||
(*it)->unmount( report );
|
(*it)->unmount( report );
|
||||||
goodNews.append( report.toText() );
|
goodNews.append( report.toText() );
|
||||||
|
cDebug() << "\tUmounted" << (*it)->partitionPath();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
cDebug() << "\tCannot umount. This is very bad.";
|
||||||
return Calamares::JobResult::error( tr( "Cannot umount partition %1" )
|
return Calamares::JobResult::error( tr( "Cannot umount partition %1" )
|
||||||
.arg( (*it)->deviceNode() ),
|
.arg( (*it)->deviceNode() ),
|
||||||
tr( "Cannot proceed with partitioning operations "
|
tr( "Cannot proceed with partitioning operations "
|
||||||
"because some partitions are still mounted." ) );
|
"because some partitions are still mounted." ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
cDebug() << "\tIt's not mounted.";
|
||||||
}
|
}
|
||||||
Calamares::JobResult ok = Calamares::JobResult::ok();
|
Calamares::JobResult ok = Calamares::JobResult::ok();
|
||||||
ok.setMessage( tr( "Cleared all mounts for %1" )
|
ok.setMessage( tr( "Cleared all mounts for %1" )
|
||||||
.arg( m_device->deviceNode() ) );
|
.arg( m_device->deviceNode() ) );
|
||||||
ok.setDetails( goodNews.join( "\n" ) );
|
ok.setDetails( goodNews.join( "\n" ) );
|
||||||
|
|
||||||
|
cDebug() << "Finished ClearMounts job.";
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user