mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-27 09:25:36 -04:00
[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
1 changed files with 1 additions and 5 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue