| 1 | // SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. |
| 2 | // |
| 3 | // SPDX-License-Identifier: GPL-3.0-only |
| 4 | |
| 5 | #include "qtX86Installer.h" |
| 6 | |
| 7 | #include <XSys> |
| 8 | #include <QDebug> |
| 9 | |
| 10 | QtX86Installer::QtX86Installer(QObject *parent) : QtBaseInstaller (parent) |
| 11 | { |
| 12 | |
| 13 | } |
| 14 | |
| 15 | bool QtX86Installer::installBootload() |
| 16 | { |
| 17 | qDebug() << "begin install bootloader on" << m_strPartionName; |
| 18 | m_progressStatus = INSTALLBOOTLOADER; |
| 19 | |
| 20 | QString strDisk = XSys::DiskUtil::GetPartitionDisk(m_strPartionName); |
| 21 | |
| 22 | if (strDisk.isEmpty()) { |
| 23 | return false; |
| 24 | } |
| 25 | |
| 26 | XSys::Result result = XSys::Syslinux::InstallBootloader(m_strPartionName); |
| 27 | |
| 28 | if (!result.isSuccess()) { |
| 29 | return false; |
| 30 | } |
| 31 | |
| 32 | result = XSys::Syslinux::InstallMbr(strDisk); |
| 33 | |
| 34 | if (!result.isSuccess()) { |
| 35 | return false; |
| 36 | } |
| 37 | |
| 38 | if (!XSys::DiskUtil::SetActivePartion(strDisk, m_strPartionName)) { |
| 39 | return false; |
| 40 | } |
| 41 | |
| 42 | XSys::DiskUtil::SetPartionLabel(m_strPartionName, m_strImage); |
| 43 | return true; |
| 44 | } |