Add support for fatresize program.
This commit is contained in:
parent
d3cde41df0
commit
fcfd78cdc4
|
@ -60,6 +60,8 @@ void fat16::init()
|
||||||
m_Copy = cmdSupportCore;
|
m_Copy = cmdSupportCore;
|
||||||
m_Backup = cmdSupportCore;
|
m_Backup = cmdSupportCore;
|
||||||
m_UpdateUUID = findExternal(QStringLiteral("dd")) ? cmdSupportFileSystem : cmdSupportNone;
|
m_UpdateUUID = findExternal(QStringLiteral("dd")) ? cmdSupportFileSystem : cmdSupportNone;
|
||||||
|
m_Grow = findExternal(QStringLiteral("fatresize")) ? cmdSupportFileSystem : cmdSupportNone;
|
||||||
|
m_Shrink = findExternal(QStringLiteral("fatresize")) ? cmdSupportFileSystem : cmdSupportNone;
|
||||||
m_GetUUID = cmdSupportCore;
|
m_GetUUID = cmdSupportCore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,6 +159,12 @@ bool fat16::create(Report& report, const QString& deviceNode)
|
||||||
return cmd.run(-1) && cmd.exitCode() == 0;
|
return cmd.run(-1) && cmd.exitCode() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool fat16::resize(Report& report, const QString& deviceNode, qint64 length) const
|
||||||
|
{
|
||||||
|
ExternalCommand cmd(report, QStringLiteral("fatresize"), { QStringLiteral("--verbose"), QStringLiteral("--size"), QString::number(length), deviceNode });
|
||||||
|
return cmd.run(-1) && cmd.exitCode() == 0;
|
||||||
|
}
|
||||||
|
|
||||||
bool fat16::updateUUID(Report& report, const QString& deviceNode) const
|
bool fat16::updateUUID(Report& report, const QString& deviceNode) const
|
||||||
{
|
{
|
||||||
qint64 t = time(nullptr);
|
qint64 t = time(nullptr);
|
||||||
|
|
|
@ -47,6 +47,7 @@ public:
|
||||||
bool create(Report& report, const QString& deviceNode) override;
|
bool create(Report& report, const QString& deviceNode) override;
|
||||||
bool updateUUID(Report& report, const QString& deviceNode) const override;
|
bool updateUUID(Report& report, const QString& deviceNode) const override;
|
||||||
bool writeLabel(Report& report, const QString& deviceNode, const QString& newLabel) override;
|
bool writeLabel(Report& report, const QString& deviceNode, const QString& newLabel) override;
|
||||||
|
bool resize(Report& report, const QString& deviceNode, qint64 length) const override;
|
||||||
|
|
||||||
CommandSupportType supportGetUsed() const override {
|
CommandSupportType supportGetUsed() const override {
|
||||||
return m_GetUsed;
|
return m_GetUsed;
|
||||||
|
|
Loading…
Reference in New Issue