From 1a9ad4899efb2f3054ec0d676e41a85e01d8f806 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Thu, 10 Nov 2016 10:06:11 +0200 Subject: Add support for creating QBSP package QBSP is a Qt specific Board Support Package that can be installed with the Qt SDK or MaintenanceTool and contains a system image and a toolchain. The toolchain is automatically registered to the QtCreator. The recipes used for creating the system image and the toolchain can be configured with QBSP_IMAGE_TASK and QBSP_SDK_TASK. The files wanted for the system image can be further configured with QBSP_IMAGE_CONTENT, with a list of files located in DEPLOY_DIR_IMAGE folder. By default, .img and .conf files are used from the selected image recipe. QBSP_INSTALLER_COMPONENT defines the location in the Qt installer tree where the QBSP is shown and QBSP_VERSION defines the version for the components. The QBSP is installed to path defined by QBSP_INSTALL_PATH. The regular SDK creation can now reuse the same image package .7z, so update upload script to use it instead of creating new package. Task-number: QTBUG-57018 Change-Id: Id1e7cc4ab3998a7d450f23ed603b8e676b314d63 Reviewed-by: Iikka Eklund Reviewed-by: Teemu Holappa --- files/qbsp/base_package.xml | 8 +++ files/qbsp/image_package.xml | 8 +++ files/qbsp/toolchain_installscript.qs | 107 ++++++++++++++++++++++++++++++++++ files/qbsp/toolchain_package.xml | 10 ++++ 4 files changed, 133 insertions(+) create mode 100644 files/qbsp/base_package.xml create mode 100644 files/qbsp/image_package.xml create mode 100644 files/qbsp/toolchain_installscript.qs create mode 100644 files/qbsp/toolchain_package.xml (limited to 'files/qbsp') diff --git a/files/qbsp/base_package.xml b/files/qbsp/base_package.xml new file mode 100644 index 0000000..28261d5 --- /dev/null +++ b/files/qbsp/base_package.xml @@ -0,0 +1,8 @@ + + + @VERSION@ + @RELEASEDATE@ + @NAME@ + Boot to Qt for @NAME@ with Embedded Linux baselayer + @LICENSEDEPENDENCY@ + diff --git a/files/qbsp/image_package.xml b/files/qbsp/image_package.xml new file mode 100644 index 0000000..1eaf69c --- /dev/null +++ b/files/qbsp/image_package.xml @@ -0,0 +1,8 @@ + + + @VERSION@ + @RELEASEDATE@ + @NAME@ Linux System + SD-Card image for @NAME@ hardware with Embedded Linux baselayer + image.7z + diff --git a/files/qbsp/toolchain_installscript.qs b/files/qbsp/toolchain_installscript.qs new file mode 100644 index 0000000..bcf9cd1 --- /dev/null +++ b/files/qbsp/toolchain_installscript.qs @@ -0,0 +1,107 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Boot to Qt meta layer. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +function Component() +{ +} + +Component.prototype.createOperations = function() +{ + component.createOperations(); + + var device = "@MACHINE@" + var platform = "@NAME@" + var sysroot = "@SYSROOT@" + var target = "@TARGET@" + var abi = "@ABI@" + var installPath = "@INSTALLPATH@/toolchain" + var sdkPath = "@SDKPATH@" + var sdkFile = "@SDKFILE@" + + var path = installer.value("TargetDir") + installPath; + if (systemInfo.kernelType !== "winnt") { + var script = path + "/" + sdkFile; + component.addOperation("Execute", "{0}", "chmod", "+x", script); + component.addOperation("Execute", "{0}", script, "-y", "-d", path, "UNDOEXECUTE", "rm", "-rf", path); + component.addOperation("Execute", "{0}", "/bin/rm", script); + } else { + var search = sdkPath; + path = path.replace(/\\/g,"/"); + component.addOperation("Replace", + path + "/sysroots/i686-pokysdk-mingw32/usr/bin/qt.conf", + search, path); + } + // qt.embedded.b2qt.xx + var baseid = component.name.substring(17,19); + var basecomponent = component.name.substring(0, component.name.lastIndexOf(".")); + var toolchainId = "ProjectExplorer.ToolChain.Gcc:" + component.name; + var qtId = basecomponent + ".qt"; + var icon = installer.value("B2QtDeviceIcon"); + var executableExt = ""; + var hostSysroot = "x86_64-pokysdk-linux"; + if (systemInfo.kernelType === "winnt") { + executableExt = ".exe"; + hostSysroot = "i686-pokysdk-mingw32"; + } + var deviceType = "Boot2Qt.HwDevice" + + component.addOperation("Execute", + ["@SDKToolBinary@", "addTC", + "--id", toolchainId, + "--name", "GCC (Boot2Qt " + platform + ")", + "--path", path + "/sysroots/" + hostSysroot + "/usr/bin/" + target + "/" + target + "-g++" + executableExt, + "--abi", abi, + "UNDOEXECUTE", + "@SDKToolBinary@", "rmTC", "--id", toolchainId]); + + component.addOperation("Execute", + ["@SDKToolBinary@", "addQt", + "--id", qtId, + "--name", "Boot2Qt %{Qt:Version} " + platform, + "--type", "Boot2Qt.QtVersionType", + "--qmake", path + "/sysroots/" + hostSysroot + "/usr/bin/qmake" + executableExt, + "UNDOEXECUTE", + "@SDKToolBinary@", "rmQt", "--id", qtId]); + + var addKitOperations = ["@SDKToolBinary@", "addKit", + "--id", basecomponent, + "--name", "Boot2Qt %{Qt:Version} " + platform, + "--mkspec", "devices/linux-oe-generic-g++", + "--qt", qtId, + "--debuggerengine", "1", + "--debugger", path + "/sysroots/" + hostSysroot + "/usr/bin/" + target + "/" + target + "-gdb" + executableExt, + "--sysroot", path + "/sysroots/" + sysroot, + "--devicetype", deviceType, + "--toolchain", toolchainId, + "--icon", icon]; + + addKitOperations.push("UNDOEXECUTE", "@SDKToolBinary@", "rmKit", "--id", basecomponent); + + component.addOperation("Execute", addKitOperations); +} diff --git a/files/qbsp/toolchain_package.xml b/files/qbsp/toolchain_package.xml new file mode 100644 index 0000000..85a2c67 --- /dev/null +++ b/files/qbsp/toolchain_package.xml @@ -0,0 +1,10 @@ + + + @VERSION@ + @RELEASEDATE@ + @NAME@ Linux Toolchain + Toolchain and system root for @NAME@ with Embedded Linux baselayer + toolchain.7z + qt.tools.qtcreator + + -- cgit v1.2.3-54-g00ecf