2020-12-22 16:05:20 +01:00
|
|
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
|
|
|
*
|
|
|
|
* SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*
|
|
|
|
* Calamares is Free Software: see the License-Identifier above.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PARTITION_AUTOMOUNT_H
|
|
|
|
#define PARTITION_AUTOMOUNT_H
|
|
|
|
|
|
|
|
#include "DllMacro.h"
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace CalamaresUtils
|
|
|
|
{
|
|
|
|
namespace Partition
|
|
|
|
{
|
|
|
|
|
|
|
|
struct AutoMountInfo;
|
|
|
|
|
|
|
|
/** @brief Disable automount
|
|
|
|
*
|
|
|
|
* Various subsystems can do "agressive automount", which can get in the
|
|
|
|
* way of partitioning actions. In particular, Solid can be configured
|
|
|
|
* to automount every device it sees, and partitioning happens in multiple
|
|
|
|
* steps (create table, create partition, set partition flags) which are
|
|
|
|
* blocked if the partition gets mounted partway through the operation.
|
|
|
|
*
|
2020-12-22 21:23:50 +01:00
|
|
|
* @param disable set this to false to reverse the sense of the function
|
|
|
|
* call and force *enabling* automount, instead.
|
|
|
|
*
|
2020-12-22 16:05:20 +01:00
|
|
|
* Returns an opaque structure which can be passed to automountRestore()
|
|
|
|
* to return the system to the previously-configured automount settings.
|
|
|
|
*/
|
2020-12-22 21:23:50 +01:00
|
|
|
DLLEXPORT std::unique_ptr< AutoMountInfo > automountDisable( bool disable = true );
|
2020-12-22 16:05:20 +01:00
|
|
|
|
|
|
|
/** @brief Restore automount settings
|
|
|
|
*
|
|
|
|
* Pass the value returned from automountDisable() to restore the
|
|
|
|
* previous settings.
|
|
|
|
*/
|
|
|
|
DLLEXPORT void automountRestore( std::unique_ptr< AutoMountInfo >&& t );
|
|
|
|
|
|
|
|
} // namespace Partition
|
|
|
|
} // namespace CalamaresUtils
|
|
|
|
|
|
|
|
#endif
|