Remove remaining cases of call to dd binary.

BUG: 398154
This commit is contained in:
Andrius Štikonas 2018-11-29 22:32:07 +00:00
parent 09e4d47e07
commit 80f5a32dc0
5 changed files with 5 additions and 8 deletions

View File

@ -59,7 +59,7 @@ void fat12::init()
m_Move = cmdSupportCore;
m_Copy = cmdSupportCore;
m_Backup = cmdSupportCore;
m_UpdateUUID = findExternal(QStringLiteral("dd")) ? cmdSupportFileSystem : cmdSupportNone;
m_UpdateUUID = cmdSupportCore;
m_GetUUID = cmdSupportCore;
}

View File

@ -50,7 +50,7 @@ void fat16::init()
m_Move = cmdSupportCore;
m_Copy = cmdSupportCore;
m_Backup = cmdSupportCore;
m_UpdateUUID = findExternal(QStringLiteral("dd")) ? cmdSupportFileSystem : cmdSupportNone;
m_UpdateUUID = cmdSupportCore;
m_Grow = findExternal(QStringLiteral("fatresize")) ? cmdSupportFileSystem : cmdSupportNone;
m_Shrink = findExternal(QStringLiteral("fatresize")) ? cmdSupportFileSystem : cmdSupportNone;
m_GetUUID = cmdSupportCore;

View File

@ -196,10 +196,7 @@ bool ntfs::updateBootSector(Report& report, const QString& deviceNode) const
// Also update backup NTFS boot sector located at the end of the partition
// NOTE: this should fail if filesystem does not span the whole partition
qint64 pos = (lastSector() - firstSector()) * sectorSize() + 28;
ExternalCommand cmd2(report, QStringLiteral("dd"), { QStringLiteral("of=") + deviceNode , QStringLiteral("bs=1"), QStringLiteral("count=4"), QStringLiteral("seek=") + QString::number(pos) });
cmd2.write(QByteArray(s, sizeof(s)));
if (!cmd2.start()) {
if (!cmd.writeData(report, QByteArray(s, sizeof(s)), deviceNode, pos)) {
Log() << xi18nc("@info:progress", "Could not write new start sector to partition <filename>%1</filename> when trying to update the NTFS boot sector.", deviceNode);
return false;
}

View File

@ -266,7 +266,7 @@ QVariantMap ExternalCommandHelper::copyblocks(const QByteArray& signature, const
return reply;
}
bool ExternalCommandHelper::writeData(const QByteArray& signature, const quint64 nonce, const QByteArray buffer, const QString& targetDevice, const qint64 targetFirstByte)
bool ExternalCommandHelper::writeData(const QByteArray& signature, const quint64 nonce, const QByteArray& buffer, const QString& targetDevice, const qint64 targetFirstByte)
{
if (m_Nonces.find(nonce) != m_Nonces.end())
m_Nonces.erase( nonce );

View File

@ -50,7 +50,7 @@ public Q_SLOTS:
Q_SCRIPTABLE quint64 getNonce();
Q_SCRIPTABLE QVariantMap start(const QByteArray& signature, const quint64 nonce, const QString& command, const QStringList& arguments, const QByteArray& input, const int processChannelMode);
Q_SCRIPTABLE QVariantMap copyblocks(const QByteArray& signature, const quint64 nonce, const QString& sourceDevice, const qint64 sourceFirstByte, const qint64 sourceLength, const QString& targetDevice, const qint64 targetFirstByte, const qint64 blockSize);
Q_SCRIPTABLE bool writeData(const QByteArray& signature, const quint64 nonce, const QByteArray buffer, const QString& targetDevice, const qint64 targetFirstByte);
Q_SCRIPTABLE bool writeData(const QByteArray& signature, const quint64 nonce, const QByteArray& buffer, const QString& targetDevice, const qint64 targetFirstByte);
Q_SCRIPTABLE void exit(const QByteArray& signature, const quint64 nonce);
private: