diff --git a/coin/platform_configs/cmake_platforms.yaml b/coin/platform_configs/cmake_platforms.yaml index 8ae6802f..56b92f6b 100644 --- a/coin/platform_configs/cmake_platforms.yaml +++ b/coin/platform_configs/cmake_platforms.yaml @@ -2,6 +2,7 @@ Version: 2 Include: [ cmake_platforms_qemu.yaml, cmake_platforms_qemu_qnx710.yaml, + cmake_platforms_qemu_vxworks.yaml, cmake_platforms_target_android.yaml, cmake_platforms_wasm.yaml, macos.yaml diff --git a/coin/platform_configs/cmake_platforms_qemu_vxworks.yaml b/coin/platform_configs/cmake_platforms_qemu_vxworks.yaml new file mode 100644 index 00000000..db3177d1 --- /dev/null +++ b/coin/platform_configs/cmake_platforms_qemu_vxworks.yaml @@ -0,0 +1,15 @@ +Version: 2 +Configurations: +- + Id: 'vxworks-imx6' + Template: 'qtci-linux-Ubuntu-22.04-x86_64-51' + Target os: 'VxWorks' + Target arch: 'ARMv7' + Compiler: 'Clang' + Target compiler: 'Clang' + Platform dependency: 'ubuntu-22.04' + Features: ['Packaging', 'VMSize8', 'UseConfigure', 'Insignificant', 'DisableTests'] + Environment variables: [ + 'TARGET_CONFIGURE_ARGS=-release -developer-build -force-debug-info -qpa eglfs -nomake examples', + 'TARGET_CMAKE_ARGS=-DBUILD_SHARED_LIBS=OFF -DWARNINGS_ARE_ERRORS=OFF -DCMAKE_TOOLCHAIN_FILE="{{.Env.WIND_CC_SYSROOT}}/mk/rtp.toolchain.cmake" -DFEATURE_vulkan=OFF -DQT_QMAKE_TARGET_MKSPEC=vxworks-clang -DQT_HOST_PATH=/home/qt/work/install -DCMAKE_AUTOGEN_VERBOSE=ON -DCMAKE_STAGING_PREFIX:PATH=/home/qt/work/install/target' + ] diff --git a/coin/platform_configs/nightly_vxworks.yaml b/coin/platform_configs/nightly_vxworks.yaml new file mode 100644 index 00000000..afbf9dbb --- /dev/null +++ b/coin/platform_configs/nightly_vxworks.yaml @@ -0,0 +1,11 @@ +Version: 2 +Module only: True +Include: [ + cmake_platforms.yaml: [ + "ubuntu-22.04" + ], + cmake_platforms_qemu_vxworks.yaml: [ + "vxworks-imx6" + ] +] +Configurations: [] diff --git a/coin/provisioning/common/linux/vx_works.sh b/coin/provisioning/common/linux/vx_works.sh new file mode 100755 index 00000000..e5f99499 --- /dev/null +++ b/coin/provisioning/common/linux/vx_works.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +# Copyright (C) 2023 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +# This script installs vxworks libs and toolchain. + +set -ex + +# shellcheck source=../unix/InstallFromCompressedFileFromURL.sh +source "${BASH_SOURCE%/*}/../unix/InstallFromCompressedFileFromURL.sh" +# shellcheck source=../unix/SetEnvVar.sh +source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" + +VXWORKS_VER="23_09" +######### VXworks libs ######### +# Installs to /opt/vxworks +PrimaryUrl="http://ci-files01-hki.ci.qt.io/input/vxworks/vxworks_no_source_patched_$VXWORKS_VER.tar.gz" +AltUrl="" +sha1="35a457999b310a6128e3bd7de3103c2235063071" +targetFolder="/opt/" +InstallFromCompressedFileFromURL "$PrimaryUrl" "$AltUrl" "$SHA1" "$targetFolder" "$appPrefix" +SetEnvVar "VXWORKS_HOME" "/opt/vxworks" + +######### VXworks toolchain ######### +# Installs to /opt/fsl_imx6_2_0_6_2_VSB +PrimaryUrl="http://ci-files01-hki.ci.qt.io/input/vxworks/vxworks_vsb_$VXWORKS_VER.tar.gz" +AltUrl="" +sha1="cd32d35e67fd6128fbfbb23207bb4d1d2d09b7d2" +targetFolder="/opt/" +InstallFromCompressedFileFromURL "$PrimaryUrl" "$AltUrl" "$SHA1" "$targetFolder" "$appPrefix" +SetEnvVar "WIND_CC_SYSROOT" "/opt/fsl_imx6_2_0_6_2_VSB" + +######### VXworks VIP kernel ######### +# Installs to /opt/fsl_imx6_2_0_6_2_VIP_QEMU +PrimaryUrl="http://ci-files01-hki.ci.qt.io/input/vxworks/vxworks_vip_kernel_$VXWORKS_VER.tar.gz" +AltUrl="" +sha1="d72bb635a00a5b1b82185e3c200078cbe5c39561" +targetFolder="/opt/" +InstallFromCompressedFileFromURL "$PrimaryUrl" "$AltUrl" "$SHA1" "$targetFolder" "$appPrefix" + +SetEnvVar "VXWORKS_SSH" "WindRiver@10.0.2.4" + +# Setup NFS exports that are needed by VxWorks qemu +sudo bash -c "echo '/home/qt/work 10.0.2.4/24(rw,sync,root_squash,no_subtree_check,anonuid=1000,anongid=1000)' >> /etc/exports" +sudo bash -c "echo '/opt/fsl_imx6_2_0_6_2_VSB 10.0.2.4/24(rw,sync,root_squash,no_subtree_check,anonuid=1000,anongid=1000)' >> /etc/exports" +sudo exportfs -a + +# Copy start script in place +cp "${BASH_SOURCE%/*}/../linux/vxworks_qemu_launcher.sh" "${HOME}" +SetEnvVar "VXWORKS_EMULATOR" "${HOME}/vxworks_qemu_launcher.sh" diff --git a/coin/provisioning/common/linux/vxworks_qemu_launcher.sh b/coin/provisioning/common/linux/vxworks_qemu_launcher.sh new file mode 100755 index 00000000..e64e1ec5 --- /dev/null +++ b/coin/provisioning/common/linux/vxworks_qemu_launcher.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# Copyright (C) 2023 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +# Setup bridge if not exist for VxWorks QEMU +if ! ip link show br0 >/dev/null 2>&1; then + sudo brctl addbr br0 + sudo brctl stp br0 off + sudo ifconfig br0 10.0.2.1 netmask 255.255.255.0 promisc up + sudo tunctl -u qt -t tap0 + sudo ifconfig tap0 promisc up + sudo brctl addif br0 tap0 +fi + +QEMU_LOG_PATH="/home/qt/work/vxworks_qemu_log.txt" +qemu-system-arm \ + -machine sabrelite \ + -smp 4 \ + -m 1G \ + -nographic \ + -monitor none \ + -serial null \ + -serial stdio \ + -kernel /opt/fsl_imx6_2_0_6_2_VIP_QEMU/default/uVxWorks \ + -dtb /opt/fsl_imx6_2_0_6_2_VIP_QEMU/default/imx6q-sabrelite.dtb \ + -append "enet(0,0)host:vxWorks h=10.0.2.1 g=10.0.2.1 e=10.0.2.4 u=target pw=vxTarget s=/romfs/startup_script_arm.txt" \ + -nic "tap,ifname=tap0,script=no" >"${QEMU_LOG_PATH}" 2>&1 & + +for counter in $(seq 30) +do + status=$(ssh -o BatchMode=yes -o HostKeyAlgorithms=+ssh-rsa -o ConnectTimeout=1 ${VXWORKS_SSH} echo emulator up) + if [[ $status == *"emulator up"* ]] ; then + echo "VXWORKS QEMU SSH server up" + break + else + echo "Waiting VXWORKS QEMU SSH server" + sleep 1 + fi +done diff --git a/coin/provisioning/qtci-linux-Ubuntu-22.04-x86_64/02-apt.sh b/coin/provisioning/qtci-linux-Ubuntu-22.04-x86_64/02-apt.sh index badd3ae3..a121b664 100755 --- a/coin/provisioning/qtci-linux-Ubuntu-22.04-x86_64/02-apt.sh +++ b/coin/provisioning/qtci-linux-Ubuntu-22.04-x86_64/02-apt.sh @@ -221,6 +221,8 @@ installPackages+=(ubuntu-dev-tools) # cifs-utils, for mounting smb drive installPackages+=(keyutils) installPackages+=(cifs-utils) +# VxWorks QEMU network setup (tunctl) +installPackages+=(uml-utilities) echo "Running update for apt" waitLoop diff --git a/coin/provisioning/qtci-linux-Ubuntu-22.04-x86_64/70-vxworks.sh b/coin/provisioning/qtci-linux-Ubuntu-22.04-x86_64/70-vxworks.sh new file mode 100755 index 00000000..3bb48d11 --- /dev/null +++ b/coin/provisioning/qtci-linux-Ubuntu-22.04-x86_64/70-vxworks.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# Copyright (C) 2021 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +set -ex + +# shellcheck source=../common/linux/vx_works.sh +source "${BASH_SOURCE%/*}/../common/linux/vx_works.sh"