[partition] Mount fs read-only when searching for fstab
Submitted by aliveafter1000 FIXES: #1044 CLOSES: #1050
This commit is contained in:
parent
9459ef7d93
commit
c522004575
@ -165,7 +165,7 @@ lookForFstabEntries( const QString& partitionPath )
|
|||||||
QTemporaryDir mountsDir;
|
QTemporaryDir mountsDir;
|
||||||
mountsDir.setAutoRemove( false );
|
mountsDir.setAutoRemove( false );
|
||||||
|
|
||||||
int exit = QProcess::execute( "mount", { partitionPath, mountsDir.path() } );
|
int exit = QProcess::execute( "mount", { "-o", "ro,noload", partitionPath, mountsDir.path() } );
|
||||||
if ( !exit ) // if all is well
|
if ( !exit ) // if all is well
|
||||||
{
|
{
|
||||||
QFile fstabFile( mountsDir.path() + "/etc/fstab" );
|
QFile fstabFile( mountsDir.path() + "/etc/fstab" );
|
||||||
@ -181,11 +181,7 @@ lookForFstabEntries( const QString& partitionPath )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( QProcess::execute( "umount", { "-R", mountsDir.path() } ) )
|
if ( QProcess::execute( "umount", { "-R", mountsDir.path() } ) )
|
||||||
{
|
|
||||||
cWarning() << "Could not unmount" << mountsDir.path();
|
cWarning() << "Could not unmount" << mountsDir.path();
|
||||||
// There is stuff left in there, really don't remove
|
|
||||||
mountsDir.setAutoRemove( false );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return fstabEntries;
|
return fstabEntries;
|
||||||
|
Loading…
Reference in New Issue
Block a user