[libcalamares] Add unmount helper function
This commit is contained in:
parent
6ba8ac8526
commit
e59b3e8bf5
@ -69,10 +69,19 @@ mount( const QString& devicePath, const QString& mountPoint, const QString& file
|
|||||||
args << "-o" << options;
|
args << "-o" << options;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto r = CalamaresUtils::System::instance()->runCommand( args, 10 );
|
auto r = CalamaresUtils::System::runCommand( args, 10 );
|
||||||
sync();
|
sync();
|
||||||
return r.getExitCode();
|
return r.getExitCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
unmount( const QString& path, const QStringList& options )
|
||||||
|
{
|
||||||
|
auto r = CalamaresUtils::System::runCommand( QStringList { "umount" } << options << path, 10 );
|
||||||
|
sync();
|
||||||
|
return r.getExitCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace Partition
|
} // namespace Partition
|
||||||
} // namespace CalamaresUtils
|
} // namespace CalamaresUtils
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "DllMacro.h"
|
#include "DllMacro.h"
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QStringList>
|
||||||
|
|
||||||
namespace CalamaresUtils
|
namespace CalamaresUtils
|
||||||
{
|
{
|
||||||
@ -44,6 +45,14 @@ DLLEXPORT int mount( const QString& devicePath,
|
|||||||
const QString& mountPoint,
|
const QString& mountPoint,
|
||||||
const QString& filesystemName = QString(),
|
const QString& filesystemName = QString(),
|
||||||
const QString& options = QString() );
|
const QString& options = QString() );
|
||||||
|
|
||||||
|
/** @brief Unmount the given @p path (device or mount point).
|
||||||
|
*
|
||||||
|
* Runs umount(8) in the host system.
|
||||||
|
*
|
||||||
|
* @returns the program's exit codeor special codes like mount().
|
||||||
|
*/
|
||||||
|
DLLEXPORT int unmount( const QString& path, const QStringList& options = QStringList() );
|
||||||
} // namespace Partition
|
} // namespace Partition
|
||||||
} // namespace CalamaresUtils
|
} // namespace CalamaresUtils
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user