Add support for checking innerFS.
This commit is contained in:
parent
d5438ba007
commit
d87ac7dc20
|
@ -73,6 +73,7 @@ void luks::init()
|
|||
m_GetLabel = cmdSupportFileSystem;
|
||||
m_UpdateUUID = findExternal(QStringLiteral("cryptsetup")) ? cmdSupportFileSystem : cmdSupportNone;
|
||||
m_Grow = findExternal(QStringLiteral("cryptsetup")) ? cmdSupportFileSystem : cmdSupportNone;
|
||||
m_Check = cmdSupportCore;
|
||||
m_Copy = cmdSupportCore;
|
||||
m_Move = cmdSupportCore;
|
||||
m_Backup = cmdSupportCore;
|
||||
|
@ -131,7 +132,7 @@ bool luks::supportToolFound() const
|
|||
m_GetLabel != cmdSupportNone &&
|
||||
m_SetLabel != cmdSupportNone &&
|
||||
m_Create != cmdSupportNone &&
|
||||
// m_Check != cmdSupportNone &&
|
||||
m_Check != cmdSupportNone &&
|
||||
m_UpdateUUID != cmdSupportNone &&
|
||||
m_Grow != cmdSupportNone &&
|
||||
// m_Shrink != cmdSupportNone &&
|
||||
|
@ -336,6 +337,17 @@ void luks::createInnerFileSystem(FileSystem::Type type)
|
|||
m_innerFs = FileSystemFactory::cloneWithNewType(type, *this);
|
||||
}
|
||||
|
||||
bool luks::check(Report& report, const QString& deviceNode) const
|
||||
{
|
||||
Q_ASSERT(m_innerFs);
|
||||
|
||||
QString mapperNode = mapperName(deviceNode);
|
||||
if (mapperNode.isEmpty())
|
||||
return false;
|
||||
|
||||
return m_innerFs->check(report, mapperNode);
|
||||
}
|
||||
|
||||
bool luks::mount(const QString& deviceNode, const QString& mountPoint)
|
||||
{
|
||||
if (!m_isCryptOpen)
|
||||
|
|
|
@ -73,7 +73,11 @@ public:
|
|||
return m_Move;
|
||||
}
|
||||
virtual CommandSupportType supportCheck() const {
|
||||
return m_Check;
|
||||
if (!m_isCryptOpen)
|
||||
return cmdSupportNone;
|
||||
if (m_Check && m_innerFs)
|
||||
return m_innerFs->supportShrink();
|
||||
return cmdSupportNone;
|
||||
}
|
||||
virtual CommandSupportType supportCopy() const {
|
||||
return m_Copy;
|
||||
|
@ -91,6 +95,7 @@ public:
|
|||
return m_GetUUID;
|
||||
}
|
||||
|
||||
virtual bool check(Report& report, const QString& deviceNode) const override;
|
||||
virtual bool create(Report &report, const QString &deviceNode) const override;
|
||||
virtual qint64 minCapacity() const;
|
||||
virtual SupportTool supportToolName() const;
|
||||
|
|
Loading…
Reference in New Issue