2020-08-25 16:05:56 +02:00
|
|
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
2019-10-03 12:32:47 +02:00
|
|
|
*
|
2020-08-22 01:19:58 +02:00
|
|
|
* SPDX-FileCopyrightText: 2019 Adriaan de Groot <groot@kde.org>
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2019-10-03 12:32:47 +02:00
|
|
|
*
|
2020-08-25 16:05:56 +02:00
|
|
|
* Calamares is Free Software: see the License-Identifier above.
|
2019-10-03 12:32:47 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef WORKERS_H
|
|
|
|
#define WORKERS_H
|
|
|
|
|
|
|
|
#include "Job.h"
|
|
|
|
|
|
|
|
/// @brief Utility functions for doing the random-data stuff for MachineId
|
|
|
|
namespace MachineId
|
|
|
|
{
|
|
|
|
/** @brief Utility functions
|
|
|
|
*
|
|
|
|
* These probably belong in libcalamares, since they're general utilities
|
|
|
|
* for moving files around in the target system.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/// @brief Copy @p fileName from host into target system at @p rootMountPoint
|
|
|
|
Calamares::JobResult copyFile( const QString& rootMountPoint, const QString& fileName );
|
|
|
|
|
|
|
|
|
|
|
|
/** @brief Entropy functions
|
|
|
|
*
|
|
|
|
* The target system may want to pre-seed the entropy pool with a suitable
|
|
|
|
* chunk of entropy data. During installation we have lots of disk access
|
|
|
|
* so plenty of entropy -- this is used mostly be Debian.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/// @brief How to generate entropy (bool-like)
|
|
|
|
enum class EntropyGeneration
|
|
|
|
{
|
|
|
|
New,
|
|
|
|
CopyFromHost
|
|
|
|
};
|
|
|
|
|
|
|
|
/// @brief Creates a new entropy file @p fileName in the target system at @p rootMountPoint
|
|
|
|
Calamares::JobResult createNewEntropy( int poolSize, const QString& rootMountPoint, const QString& fileName );
|
|
|
|
|
|
|
|
/// @brief Create an entropy file @p fileName in the target system at @p rootMountPoint
|
2019-10-03 13:32:48 +02:00
|
|
|
Calamares::JobResult
|
|
|
|
createEntropy( const EntropyGeneration kind, const QString& rootMountPoint, const QString& fileName );
|
2019-10-03 12:32:47 +02:00
|
|
|
|
|
|
|
|
|
|
|
/** @brief MachineID functions
|
|
|
|
*
|
|
|
|
* Creating UUIDs for DBUS and SystemD.
|
|
|
|
*/
|
|
|
|
|
2019-10-04 14:57:05 +02:00
|
|
|
/// @brief Create a new DBus UUID file
|
|
|
|
Calamares::JobResult createDBusMachineId( const QString& rootMountPoint, const QString& fileName );
|
2019-10-03 12:32:47 +02:00
|
|
|
|
2019-10-04 14:57:05 +02:00
|
|
|
/// @brief Symlink DBus UUID file to the one from systemd (which must exist already)
|
|
|
|
Calamares::JobResult
|
|
|
|
createDBusLink( const QString& rootMountPoint, const QString& fileName, const QString& systemdFileName );
|
2019-10-03 12:32:47 +02:00
|
|
|
|
|
|
|
Calamares::JobResult createSystemdMachineId( const QString& rootMountPoint, const QString& fileName );
|
|
|
|
|
|
|
|
|
2019-10-03 13:32:48 +02:00
|
|
|
} // namespace MachineId
|
2019-10-03 12:32:47 +02:00
|
|
|
|
|
|
|
#endif // WORKERS_H
|