diff --git a/src/helper.cpp b/src/helper.cpp --- a/src/helper.cpp +++ b/src/helper.cpp @@ -146,6 +146,34 @@ } } + /*Special case for Arch Linux*/ + if (QFile::exists(QStringLiteral("/usr/bin/mkinitcpio"))) { + int ret = 0; + QProcess process; + qDebug() << "Running mkinitcpio -p linux now"; + process.start(QStringLiteral("/usr/bin/mkinitcpio"), QStringList() << QStringLiteral("-p") << QStringLiteral("linux")); + if (!process.waitForStarted()) { + reply = ActionReply::BackendError; + reply.setErrorDescription(i18n("Cannot start mkinitcpio.")); + return reply; + } + if (!process.waitForFinished(60000)) { + reply = ActionReply::BackendError; + reply.setErrorDescription(i18n("mkinitcpio failed to run.")); + return reply; + } + ret = process.exitCode(); + + if (ret == 0) { + return ActionReply::SuccessReply(); + } else { + reply = ActionReply(ActionReply::HelperErrorReply()); + reply.setErrorCode(static_cast(ret)); + reply.setErrorDescription(i18n("mkinitcpio returned with error condition %1.", ret)); + return reply; + } + } + int ret = 0; QProcess process;