diff options
Diffstat (limited to 'coin/provisioning/common/linux')
63 files changed, 1553 insertions, 673 deletions
diff --git a/coin/provisioning/common/linux/android/gradle_project/.gitignore b/coin/provisioning/common/linux/android/gradle_project/.gitignore new file mode 100644 index 00000000..aa724b77 --- /dev/null +++ b/coin/provisioning/common/linux/android/gradle_project/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/coin/provisioning/common/linux/android/gradle_project/README.md b/coin/provisioning/common/linux/android/gradle_project/README.md new file mode 100644 index 00000000..439cd362 --- /dev/null +++ b/coin/provisioning/common/linux/android/gradle_project/README.md @@ -0,0 +1,20 @@ +# Android Gradle Project for COIN + +This project is used to at provisioning time to do an Android Gradle build that +will download Gradle binaries and AGP dependencies, then they will be cached +allowing consecutive builds, i.e. at test runs to not redownload the Gradle +binaries which tend to run into network issues and thus improving the +reliability of the Android integrations on COIN. + +The project is a basic empty views Android project that can be created by +Android Studio, it's Java based. Below is some extra details on relevant files +that might need updates in the future: + +- settings.gradle: mainly sets the the project name +- under app/src/main/ res/layout/activity_main.xml and src/*/*.java: sets the + layout and logic of the app, this shouldn't need to be touched. +- AndroidManifest.xml / app/build.gradle: Sets project settings like target version. +- gradle/libs.versions.toml: This sets the version numbers of various dependencies. + +Other files required for the project build are gradle wrapper and scripts which +are fetched by android_linux.sh from qtbase. diff --git a/coin/provisioning/common/linux/android/gradle_project/app/.gitignore b/coin/provisioning/common/linux/android/gradle_project/app/.gitignore new file mode 100644 index 00000000..796b96d1 --- /dev/null +++ b/coin/provisioning/common/linux/android/gradle_project/app/.gitignore @@ -0,0 +1 @@ +/build diff --git a/coin/provisioning/common/linux/android/gradle_project/app/build.gradle b/coin/provisioning/common/linux/android/gradle_project/app/build.gradle new file mode 100644 index 00000000..745c08f8 --- /dev/null +++ b/coin/provisioning/common/linux/android/gradle_project/app/build.gradle @@ -0,0 +1,26 @@ +plugins { + alias(libs.plugins.androidApplication) +} + +android { + namespace 'com.example.gradle_project' + compileSdk 34 + + defaultConfig { + applicationId "com.example.gradle_project" + minSdk 23 + targetSdk 34 + versionCode 1 + versionName "1.0" + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + implementation libs.appcompat + implementation libs.material +} diff --git a/coin/provisioning/common/linux/android/gradle_project/app/src/main/AndroidManifest.xml b/coin/provisioning/common/linux/android/gradle_project/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..492c2115 --- /dev/null +++ b/coin/provisioning/common/linux/android/gradle_project/app/src/main/AndroidManifest.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools"> + + <application + android:allowBackup="true" + android:label="gradle_project" + android:supportsRtl="true" + tools:targetApi="34"> + <activity + android:name=".MainActivity" + android:exported="true"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + </application> + +</manifest> diff --git a/coin/provisioning/common/linux/android/gradle_project/app/src/main/java/com/example/gradle_project/MainActivity.java b/coin/provisioning/common/linux/android/gradle_project/app/src/main/java/com/example/gradle_project/MainActivity.java new file mode 100644 index 00000000..d3575ef9 --- /dev/null +++ b/coin/provisioning/common/linux/android/gradle_project/app/src/main/java/com/example/gradle_project/MainActivity.java @@ -0,0 +1,16 @@ +// 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 + +package com.example.gradle_project; + +import androidx.appcompat.app.AppCompatActivity; + +import android.os.Bundle; + +public class MainActivity extends AppCompatActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + } +} diff --git a/coin/provisioning/common/linux/android/gradle_project/app/src/main/res/layout/activity_main.xml b/coin/provisioning/common/linux/android/gradle_project/app/src/main/res/layout/activity_main.xml new file mode 100644 index 00000000..c75d0576 --- /dev/null +++ b/coin/provisioning/common/linux/android/gradle_project/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".MainActivity"> + + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Hello World!" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/coin/provisioning/common/linux/android/gradle_project/build.gradle b/coin/provisioning/common/linux/android/gradle_project/build.gradle new file mode 100644 index 00000000..602be027 --- /dev/null +++ b/coin/provisioning/common/linux/android/gradle_project/build.gradle @@ -0,0 +1,4 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +plugins { +alias(libs.plugins.androidApplication) apply false +} diff --git a/coin/provisioning/common/linux/android/gradle_project/gradle/libs.versions.toml b/coin/provisioning/common/linux/android/gradle_project/gradle/libs.versions.toml new file mode 100644 index 00000000..65bc49af --- /dev/null +++ b/coin/provisioning/common/linux/android/gradle_project/gradle/libs.versions.toml @@ -0,0 +1,16 @@ +[versions] +agp = "7.4.1" +appcompat = "1.6.1" +material = "1.11.0" +constraintlayout = "2.1.4" + +[libraries] +appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } +material = { group = "com.google.android.material", name = "material", version.ref = "material" } +constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" } + +[plugins] +androidApplication = { id = "com.android.application", version.ref = "agp" } + +[bundles] + diff --git a/coin/provisioning/common/linux/android/gradle_project/settings.gradle b/coin/provisioning/common/linux/android/gradle_project/settings.gradle new file mode 100644 index 00000000..ca34c7e7 --- /dev/null +++ b/coin/provisioning/common/linux/android/gradle_project/settings.gradle @@ -0,0 +1,17 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +rootProject.name = "gradle_project" +include ':app' diff --git a/coin/provisioning/common/linux/android_emulator_launcher.sh b/coin/provisioning/common/linux/android_emulator_launcher.sh new file mode 100755 index 00000000..fad20148 --- /dev/null +++ b/coin/provisioning/common/linux/android_emulator_launcher.sh @@ -0,0 +1,120 @@ +#!/bin/bash +# Copyright (C) 2023 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 + +# This util launches the Android emulator and ensures it doesn't stuck/freeze +# by detecting that and restarting it + +set -e + +EMULATOR_MAX_RETRIES=5 +ADB_MAX_TIMEOUT=300 +EMULATOR_EXEC="$ANDROID_SDK_ROOT/emulator/emulator" +ADB_EXEC="$ANDROID_SDK_ROOT/platform-tools/adb" +LOGCAT_PATH="$COIN_CTEST_RESULTSDIR/emulator_logcat_%iter.txt" +EMULATOR_RUN_LOG_PATH="$COIN_CTEST_RESULTSDIR/emulator_run_log_%iter.txt" + +if [ -z "${ANDROID_EMULATOR}" ]; then + echo "No AVD name provided via ANDROID_EMULATOR env variable. Aborting!" + exit 1 +fi + +function check_for_android_device +{ + $ADB_EXEC devices | awk 'NR==2{print $2}' | grep -qE '^(online|device)$' +} + +# WARNING: On the very first boot of the emulator it happens that the device +# "finishes" booting and getprop shows bootanim=stopped and +# boot_completed=1. But sometimes not all packages have been installed (`pm +# list packages` shows only 16 packages installed), and after around half a +# minute the boot animation starts spinning (bootanim=running) again despite +# boot_completed=1 all the time. After some minutes the boot animation stops +# again and the list of packages contains 80 packages. Only then the device is +# fully booted, and only then is dev.bootcomplete=1. +# +# To reproduce the emulator booting as the first time, you have to delete the +# cached images found inside $HOME/.android/avd/{avd_name}.avd/ especially the +# "userdata-qemu.img.qcow2" file. +function check_if_fully_booted +{ + # The "getprop" command separates lines with \r\n so we trim them + bootanim=$( timeout 1 "$ADB_EXEC" shell getprop init.svc.bootanim | tr -d '\r\n') + boot_completed=$(timeout 1 "$ADB_EXEC" shell getprop sys.boot_completed | tr -d '\r\n') + bootcomplete=$( timeout 1 "$ADB_EXEC" shell getprop dev.bootcomplete | tr -d '\r\n') + echo "bootanim=$bootanim boot_completed=$boot_completed bootcomplete=$bootcomplete" + [ "$bootanim" = stopped ] && [ "$boot_completed" = 1 ] && [ "$bootcomplete" = 1 ] +} + +for counter in $(seq ${EMULATOR_MAX_RETRIES}) +do + $ADB_EXEC kill-server + $ADB_EXEC start-server + + if check_for_android_device + then + echo "Emulator is already running but it shouldn't be. Terminating it now..." + pkill '^qemu-system-' || true + sleep 5 + fi + + LOGCAT_PATH=${LOGCAT_PATH//%iter/${counter}} + EMULATOR_RUN_LOG_PATH=${EMULATOR_RUN_LOG_PATH//%iter/${counter}} + + echo "Starting emulator ${ANDROID_EMULATOR}, try ${counter}/${EMULATOR_MAX_RETRIES}" \ + | tee "${EMULATOR_RUN_LOG_PATH}" + $EMULATOR_EXEC -avd "$ANDROID_EMULATOR" \ + -gpu swiftshader_indirect -no-audio -no-window -no-boot-anim \ + -cores 4 -memory 16000 -partition-size 4096 \ + -detect-image-hang -restart-when-stalled -no-snapshot-save \ + -no-nested-warnings -logcat '*:v' -logcat-output "${LOGCAT_PATH}" \ + </dev/null >"${EMULATOR_RUN_LOG_PATH}" 2>&1 & + emulator_pid=$! + disown $emulator_pid + + echo "Waiting ${ADB_MAX_TIMEOUT} seconds for emulated device to appear..." + timeout ${ADB_MAX_TIMEOUT} "$ADB_EXEC" wait-for-device + + # Due to some bug in Coin/Go, we can't have the emulator command stream + # the output to the console while in the background, as Coin will continue + # waiting for it. So, rely on re-directing all output to a log file and + # then printing it out after the emulator is started. + echo "######## Printing out the emulator command logs ########" + cat "${EMULATOR_RUN_LOG_PATH}" + echo "########################################################" + + echo "Waiting a few minutes for the emulator to fully boot..." + emulator_status=down + for _ in $(seq ${ADB_MAX_TIMEOUT}) + do + sleep 1 + + if check_for_android_device && check_if_fully_booted + then + emulator_status=up + break + fi + done + + # If emulator status is still offline after timeout period, + # we can assume it's stuck, and we must restart it + if [ $emulator_status = up ] + then + echo "Emulator started successfully" + break + else + if [ "$counter" -lt "$EMULATOR_MAX_RETRIES" ] + then + echo "Emulator failed to start," \ + "forcefully killing current instance and re-starting emulator" + kill $emulator_pid || true + sleep 5 + elif [ "$counter" -eq "$EMULATOR_MAX_RETRIES" ] + then + echo "Emulator failed to start, reached maximum number of retries. Aborting\!" + exit 2 + fi + fi +done + +exit 0 diff --git a/coin/provisioning/common/linux/android_linux.sh b/coin/provisioning/common/linux/android_linux.sh index 72555500..98961077 100755 --- a/coin/provisioning/common/linux/android_linux.sh +++ b/coin/provisioning/common/linux/android_linux.sh @@ -1,37 +1,6 @@ #!/usr/bin/env bash - -############################################################################# -## -## Copyright (C) 2020 The Qt Company Ltd. -## Contact: http://www.qt.io/licensing/ -## -## This file is part of the provisioning scripts of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL21$ -## 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 http://www.qt.io/terms-conditions. For further -## information use the contact form at http://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 2.1 or version 3 as published by the Free -## Software Foundation and appearing in the file LICENSE.LGPLv21 and -## LICENSE.LGPLv3 included in the packaging of this file. Please review the -## following information to ensure the GNU Lesser General Public License -## requirements will be met: https://www.gnu.org/licenses/lgpl.html and -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## As a special exception, The Qt Company gives you certain additional -## rights. These rights are described in The Qt Company LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2022 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 install Android sdk and ndk. @@ -49,32 +18,74 @@ source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" targetFolder="/opt/android" sdkTargetFolder="$targetFolder/sdk" -basePath="http://ci-files01-hki.intra.qt.io/input/android" +sudo mkdir -p "$sdkTargetFolder" + +basePath="http://ci-files01-hki.ci.qt.io/input/android" toolsVersion="2.1" toolsFile="commandlinetools-linux-6609375_latest.zip" -ndkVersion="r22b" -ndkFile="android-ndk-$ndkVersion-linux-x86_64.zip" -sdkBuildToolsVersion="30.0.3" -sdkApiLevel="android-30" +ndkVersionLatest="r26b" +ndkVersionDefault=$ndkVersionLatest +sdkBuildToolsVersion="34.0.0" +sdkApiLevel="android-34" toolsSha1="9172381ff070ee2a416723c1989770cf4b0d1076" -ndkSha1="9ece64c7f19763dd67320d512794969930fce9dc" +ndkSha1Latest="fdf33d9f6c1b3f16e5459d53a82c7d2201edbcc4" +ndkSha1Default=$ndkSha1Latest + +# Android 14 avd zip +android14SystemZipName="android14system_UE1A_230829_036.tar.gz" +android14SystemZipSha="ede80c6901e8fad1895c97a86542b8e072bb1ee5" +android14SystemPath="$basePath/$android14SystemZipName" + +# Android Automotive max SDK level image +sdkApiLevelAutomotiveMax="android-33" +androidAutomotiveMaxUrl="$basePath/${sdkApiLevelAutomotiveMax}_automotive.tar.gz" +androidAutomotiveMaxSha="b020a938ec46af2510047284406e9bed608cad03" +# Android Automotive min SDK level image +sdkApiLevelAutomotiveMin="android-29" +androidAutomotiveMinUrl="$basePath/${sdkApiLevelAutomotiveMin}_automotive.tar.gz" +androidAutomotiveMinSha="e6092585c00f87eb3b20a2eb7fdf6add42342d2f" toolsTargetFile="/tmp/$toolsFile" toolsSourceFile="$basePath/$toolsFile" -ndkTargetFile="/tmp/$ndkFile" -ndkSourceFile="$basePath/$ndkFile" +echo "Download and unzip Android SDK" DownloadURL "$toolsSourceFile" "$toolsSourceFile" "$toolsSha1" "$toolsTargetFile" -DownloadURL "$ndkSourceFile" "$ndkSourceFile" "$ndkSha1" "$ndkTargetFile" -echo "Unzipping Android NDK to '$targetFolder'" -sudo unzip -q "$ndkTargetFile" -d "$targetFolder" echo "Unzipping Android Tools to '$sdkTargetFolder'" sudo unzip -q "$toolsTargetFile" -d "$sdkTargetFolder" -rm "$ndkTargetFile" rm "$toolsTargetFile" +function InstallNdk() { + + ndkVersion=$1 + ndkSha1=$2 + + ndkFile="android-ndk-$ndkVersion-linux.zip" + ndkTargetFile="/tmp/$ndkFile" + ndkSourceFile="$basePath/$ndkFile" + + DownloadURL "$ndkSourceFile" "$ndkSourceFile" "$ndkSha1" "$ndkTargetFile" + echo "Unzipping Android NDK to '$targetFolder'" + # Get the package base directory name as string + zipBase=$(sudo zipinfo -1 "$ndkTargetFile" 2>/dev/null | awk '!seen {sub("/.*",""); print; seen=1}') + sudo unzip -q "$ndkTargetFile" -d "$targetFolder" + rm "$ndkTargetFile" + androidNdkRoot="${targetFolder}/${zipBase}" +} + +InstallNdk $ndkVersionDefault $ndkSha1Default +SetEnvVar "ANDROID_NDK_ROOT_DEFAULT" "$androidNdkRoot" + +if [ "$ndkVersionDefault" != "$ndkVersionLatest" ]; then + InstallNdk $ndkVersionLatest $ndkSha1Latest +fi +SetEnvVar "ANDROID_NDK_ROOT_LATEST" "$androidNdkRoot" + +# To be used by vcpkg +SetEnvVar "ANDROID_NDK_HOME" "$targetFolder/android-ndk-$ndkVersionDefault" +export ANDROID_NDK_HOME="$targetFolder/android-ndk-$ndkVersionDefault" + echo "Changing ownership of Android files." if uname -a |grep -q "el7"; then sudo chown -R qt:wheel "$targetFolder" @@ -99,37 +110,96 @@ if [ "$http_proxy" != "" ]; then echo "y" | "$sdkTargetFolder/cmdline-tools/tools/bin/sdkmanager" --sdk_root=$sdkTargetFolder \ --no_https --proxy=http --proxy_host="$proxy_host" --proxy_port="$proxy_port" \ "platforms;$sdkApiLevel" "platform-tools" "build-tools;$sdkBuildToolsVersion" \ - | eval $sdkmanager_no_progress_bar_cmd + | eval "$sdkmanager_no_progress_bar_cmd" else echo "y" | "$sdkTargetFolder/cmdline-tools/tools/bin/sdkmanager" --sdk_root=$sdkTargetFolder \ "platforms;$sdkApiLevel" "platform-tools" "build-tools;$sdkBuildToolsVersion" \ - | eval $sdkmanager_no_progress_bar_cmd + | eval "$sdkmanager_no_progress_bar_cmd" fi echo "Checking the contents of Android SDK..." ls -l "$sdkTargetFolder" SetEnvVar "ANDROID_SDK_ROOT" "$sdkTargetFolder" -SetEnvVar "ANDROID_NDK_ROOT" "$targetFolder/android-ndk-$ndkVersion" SetEnvVar "ANDROID_NDK_HOST" "linux-x86_64" SetEnvVar "ANDROID_API_VERSION" "$sdkApiLevel" # shellcheck disable=SC2129 -echo "Android SDK tools = $toolsVersion" >> ~/versions.txt -echo "Android SDK Build Tools = $sdkBuildToolsVersion" >> ~/versions.txt -echo "Android SDK API level = $sdkApiLevel" >> ~/versions.txt -echo "Android NDK = $ndkVersion" >> ~/versions.txt +cat <<EOB >>~/versions.txt +Android SDK tools = $toolsVersion +Android SDK Build Tools = $sdkBuildToolsVersion +Android SDK API level = $sdkApiLevel +Android NDK = $ndkVersion +EOB cd "$sdkTargetFolder/cmdline-tools/tools/bin" -./sdkmanager --install "emulator" --sdk_root=$sdkTargetFolder \ - | eval $sdkmanager_no_progress_bar_cmd -echo "y" | ./sdkmanager --install "system-images;android-23;google_apis;x86" \ - | eval $sdkmanager_no_progress_bar_cmd - +./sdkmanager --install "emulator" --sdk_root="$sdkTargetFolder" \ + | eval "$sdkmanager_no_progress_bar_cmd" + +echo "Download and unzip Android Emulator version 34.1.19" +emulatorFileName="emulator-linux_x64-11525734.zip" +emulatorCiUrl="https://ci-files01-hki.ci.qt.io/input/android/$emulatorFileName" +emulatorUrl="http://dl.google.com/android/repository/$emulatorFileName" +emulatorTargetFile="$sdkTargetFolder/$emulatorFileName" +emulatorSha1="d6cc94109b081c5f6042dcb71a453144f7e62ce7" +DownloadURL "$emulatorCiUrl" "$emulatorUrl" "$emulatorSha1" "$emulatorTargetFile" +echo "Unzipping the Android Emulator to '$sdkTargetFolder'" +sudo unzip -o -q "$emulatorTargetFile" -d "$sdkTargetFolder" +rm "$emulatorTargetFile" + +echo "y" | ./sdkmanager --install "system-images;android-28;google_apis;x86" \ + | eval "$sdkmanager_no_progress_bar_cmd" + +echo "Extract stored Android 14 Beta $android14SystemZipName" +DownloadURL "$android14SystemPath" "$android14SystemPath" "$android14SystemZipSha" \ + "/tmp/$android14SystemZipName" +sudo tar -xzf "/tmp/$android14SystemZipName" -C "$sdkTargetFolder/system-images" echo "Checking the contents of Android SDK again..." ls -l "$sdkTargetFolder" -echo "no" | ./avdmanager create avd -n x86emulator -k "system-images;android-23;google_apis;x86" -c 2048M -f +echo "no" | ./avdmanager create avd -n emulator_x86_api_28 -c 2048M -f \ + -k "system-images;android-28;google_apis;x86" + +echo "no" | ./avdmanager create avd -n emulator_x86_64_api_34 -c 2048M -f \ + -k "system-images;android-34;google_apis;x86_64" + +echo "Install maximum supported SDK level image for Android Automotive $sdkApiLevelAutomotiveMax" +DownloadURL "$androidAutomotiveMaxUrl" "$androidAutomotiveMaxUrl" "$androidAutomotiveMaxSha" \ + "/tmp/${sdkApiLevelAutomotiveMax}_automotive.tar.gz" +sudo tar -xzf "/tmp/${sdkApiLevelAutomotiveMax}_automotive.tar.gz" -C "$sdkTargetFolder/system-images" +echo "no" | ./avdmanager create avd -n automotive_emulator_x86_64_api_33 -c 2048M -f \ + -k "system-images;${sdkApiLevelAutomotiveMax};android-automotive;x86_64" + +echo "Install minimum supported SDK level image for Android Automotive $sdkApiLevelAutomotiveMin" +DownloadURL "$androidAutomotiveMinUrl" "$androidAutomotiveMinUrl" "$androidAutomotiveMinSha" \ + "/tmp/${sdkApiLevelAutomotiveMin}_automotive.tar.gz" +sudo tar -xzf "/tmp/${sdkApiLevelAutomotiveMin}_automotive.tar.gz" -C $sdkTargetFolder/system-images +echo "no" | ./avdmanager create avd -n automotive_emulator_x86_64_api_29 -c 2048M -f \ + -k "system-images;${sdkApiLevelAutomotiveMin};android-automotive;x86_64" + # Purely informative, show the list of avd devices ./avdmanager list avd + +# To be used by the VMs to start the emulator for tests +emulator_script_filename="android_emulator_launcher.sh" +scripts_dir_name="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" +cp "${scripts_dir_name}/${emulator_script_filename}" "${HOME}" +ANDROID_EMULATOR_RUNNER="${HOME}/${emulator_script_filename}" +SetEnvVar "ANDROID_EMULATOR_RUNNER" "$ANDROID_EMULATOR_RUNNER" + +# Gradle Caching +cp -r "${scripts_dir_name}/android/gradle_project" /tmp/gradle_project +cd /tmp/gradle_project +# Get Gradle files from qtbase +qtbaseGradleUrl="https://code.qt.io/cgit/qt/qtbase.git/plain/src/3rdparty/gradle" +commit_sha="0d91cc866f2799d56911bcdadabebb137eafcea8" +curl "$qtbaseGradleUrl/gradle.properties?h=$commit_sha" > gradle.properties +curl "$qtbaseGradleUrl/gradlew?h=$commit_sha" > gradlew +curl "$qtbaseGradleUrl/gradlew.bat?h=$commit_sha" > gradlew.bat +mkdir -p gradle/wrapper +curl "$qtbaseGradleUrl/gradle/wrapper/gradle-wrapper.jar?h=$commit_sha" > gradle/wrapper/gradle-wrapper.jar +curl "$qtbaseGradleUrl/gradle/wrapper/gradle-wrapper.properties?h=$commit_sha" > gradle/wrapper/gradle-wrapper.properties +# Run Gradle +chmod +x gradlew +ANDROID_SDK_ROOT="$sdkTargetFolder" sh gradlew build diff --git a/coin/provisioning/common/linux/apt_wait_loop.sh b/coin/provisioning/common/linux/apt_wait_loop.sh index b34e1ebc..60d5d5ed 100755 --- a/coin/provisioning/common/linux/apt_wait_loop.sh +++ b/coin/provisioning/common/linux/apt_wait_loop.sh @@ -1,37 +1,6 @@ #!/usr/bin/env bash - -############################################################################# -## -## Copyright (C) 2018 The Qt Company Ltd. -## Contact: http://www.qt.io/licensing/ -## -## This file is part of the provisioning scripts of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL21$ -## 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 http://www.qt.io/terms-conditions. For further -## information use the contact form at http://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 2.1 or version 3 as published by the Free -## Software Foundation and appearing in the file LICENSE.LGPLv21 and -## LICENSE.LGPLv3 included in the packaging of this file. Please review the -## following information to ensure the GNU Lesser General Public License -## requirements will be met: https://www.gnu.org/licenses/lgpl.html and -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## As a special exception, The Qt Company gives you certain additional -## rights. These rights are described in The Qt Company LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2018 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 diff --git a/coin/provisioning/common/linux/axivion-bauhaus-suite.sh b/coin/provisioning/common/linux/axivion-bauhaus-suite.sh new file mode 100755 index 00000000..ab4ce5ef --- /dev/null +++ b/coin/provisioning/common/linux/axivion-bauhaus-suite.sh @@ -0,0 +1,44 @@ +#!/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 Axivion Bauhaus Suite tool. + +set -ex + +# shellcheck source=../unix/DownloadURL.sh +source "${BASH_SOURCE%/*}/../unix/DownloadURL.sh" +# shellcheck source=../unix/SetEnvVar.sh +# source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" + +DownloadAndExtract () { + url=$1 + sha=$2 + file=$3 + + DownloadURL "$url" "$url" "$sha" "$file" + tar -xzvf "$file" + + rm -rf "$file" +} + + +# Axivion Bauhaus Suite +sourceFile="http://ci-files01-hki.ci.qt.io/input/axivion/bauhaus-suite-7_7_4-x86_64-gnu_linux.tar.gz" +targetFile="bauhaus-suite-7_7_4-x86_64-gnu_linux.tar.gz" +sha1="df17ac0521864a7f1c0b5b3bfded1817cbf47bae" +cd "$HOME" +DownloadAndExtract "$sourceFile" "$sha1" "$targetFile" "$HOME" + +mkdir "$HOME/.bauhaus" +cd "$HOME/.bauhaus" +wget http://ci-files01-hki.ci.qt.io/input/axivion/Qt_Evaluation_QSR_INTERN_20250118.key +cd "$HOME" + +#Axivion configuration +configurationFile="http://ci-files01-hki.ci.qt.io/input/axivion/axivion_config_771_new.tar.gz" +configurationTargetFile="axivion_config.tar.gz" +configSha1="db77f376e0b3ee0f7a74701790d1c8abe792bebe" +DownloadAndExtract "$configurationFile" "$configSha1" "$configurationTargetFile" "$HOME" + +echo "Axivion Bauhaus Suite = 7.7.4" >> ~/versions.txt diff --git a/coin/provisioning/common/linux/bootstrap-autostart.sh b/coin/provisioning/common/linux/bootstrap-autostart.sh new file mode 100755 index 00000000..d590069e --- /dev/null +++ b/coin/provisioning/common/linux/bootstrap-autostart.sh @@ -0,0 +1,89 @@ +#!/usr/bin/env bash +# Copyright (C) 2022 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 + +# Make bootstap agent run in background without terminal view +# Terminal view can cause issues with Autotests + +# Create shell wrapper to pass environment variables +wrapper="${HOME}/bootstrap-agent.sh" +autostart_folder="${HOME}/.config/autostart" +# This directory should exist. Created in base image (tier 1) +mkdir -p "${autostart_folder}" + +# Create autostart desktop file and shell wrapper +sudo tee "${autostart_folder}/coin-bootstrap-agent.desktop" <<"EOF" +[Desktop Entry] +Type=Application +Exec=/home/qt/bootstrap-agent.sh +Hidden=false +X-GNOME-Autostart-enabled=true +Name=Coin +EOF + +sudo tee "$wrapper" <<"EOF" +#!/bin/sh +# Wait for network to come up +x=0 +while ! cat "/etc/resolv.conf" | grep -v "#" | grep "nameserver" > /dev/null ; do + echo "(WW) wating for network ($x/20)..." >> /home/qt/bootstrap-agent.txt + x=$((x+1)) + sleep 1 + if [ "$x" -gt 20 ]; then + echo "(EE) netowrk down. Exiting bootstrap." >> /home/qt/bootstrap-agent.txt + exit 1 + fi +done +echo "(**) network found." >> /home/qt/bootstrap-agent.txt + +# Wait for context to be mounted +x=0 +while ! ([ -f "/media/qt/CONTEXT/context.sh" ] || [ -f "/media/CONTEXT/context.sh" ] || [ -f "/run/media/qt/CONTEXT/context.sh" ]); do + echo "(WW) waiting for context file to be mounted ($x/20)..." >> /home/qt/bootstrap-agent.txt + x=$((x+1)) + sleep 1 + if [ "$x" -gt 20 ]; then + echo "(WW) no context file found. Mounting manually." >> /home/qt/bootstrap-agent.txt + break + fi +done + +# establish mount path (differs per distro) +if ! ([ -f "/media/qt/CONTEXT/context.sh" ] || [ -f "/media/CONTEXT/context.sh" ] || [ -f "/run/media/qt/CONTEXT/context.sh" ]); then + MOUNTPATH="invalid" + if [ -d "/run/media/qt/CONTEXT" ]; then + MOUNTPATH="/run/media/qt/CONTEXT" + fi + if [ -d "/media/qt/CONTEXT" ]; then + MOUNTPATH="/media/qt/CONTEXT" + fi + if [ -d "/media/CONTEXT" ]; then + MOUNTPATH="/media/CONTEXT" + fi + + # try mounting if unmounted + if [ -d "$MOUNTPATH" ]; then + if ! mount | grep "$MOUNTPATH" > /dev/null ; then + echo "(WW) context file not mounted..." >> /home/qt/bootstrap-agent.txt + echo "(WW) waiting 1 minute" >> /home/qt/bootstrap-agent.txt + sleep 60 + echo "(**) mount /dev/sr0 $MOUNTPATH" >> /home/qt/bootstrap-agent.txt + sudo mount -r /dev/sr0 $MOUNTPATH + fi + fi +fi + +if ([ -f "/media/qt/CONTEXT/context.sh" ] || [ -f "/media/CONTEXT/context.sh" ] || [ -f "/run/media/qt/CONTEXT/context.sh" ]); then + echo "(**) context found." >> /home/qt/bootstrap-agent.txt +else + echo "(EE) context not found. Starting bootstrap anyway." >> /home/qt/bootstrap-agent.txt +fi + +/home/qt/bootstrap-agent /dev/ttyS0 +EOF + +# set owner and permissions +sudo chown qt:users "$wrapper" +sudo chmod 755 "$wrapper" diff --git a/coin/provisioning/common/linux/cleanup_cache.sh b/coin/provisioning/common/linux/cleanup_cache.sh new file mode 100755 index 00000000..acb85965 --- /dev/null +++ b/coin/provisioning/common/linux/cleanup_cache.sh @@ -0,0 +1,58 @@ +#!/usr/bin/env bash +# Copyright (C) 2022 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 needs to be called at the end of provisioning, to clean the cache directory + +set -e +set -f +QT_USER="qt" +CACHE=".cache" + +echo "---- starting cache cleanup." + +# skip if user qt does not exist +echo "---- checking user $QT_USER" +if grep -q "^$QT_USER:" /etc/passwd; then + echo "(**) found user $QT_USER" +else + echo "(WW) user $QT_USER not found." + echo "---- skipping cache cleanup." + exit 0 +fi + +# assume /home/qt as ~ won't expand into sudo +CACHEDIR="/home/$QT_USER/$CACHE" + +# delete files from a directory if it exists +echo "---- checking cache directory $CACHEDIR" +if sudo [ -d "$CACHEDIR" ]; then + if [ "$(sudo ls -A $CACHEDIR)" ]; then + echo "(WW) cache in $CACHEDIR is not empty." + echo "---- removing content:" + + # List files and delete in a loop as wildcard won't expand into sudo + sudo ls -A1 "$CACHEDIR" | while read -r FILE + do + echo "--- rm -rf $FILE" + sudo rm -rf "$CACHEDIR/$FILE" + done + else + echo "(**) cache in $CACHEDIR is empty." + fi +else + if sudo [ -f "$CACHEDIR" ]; then + # replace a cache file with a directory + echo "(WW) $CACHEDIR is a file." + echo "---- removing $CACHEDIR." + sudo rm -r "$CACHEDIR" + else + echo "(WW) cache directory $CACHEDIR not found." + fi + + # create new cache directory and assign rights + echo "---- creating cache director $CACHEDIR." + sudo mkdir "$CACHEDIR" + sudo chown $QT_USER:users $CACHEDIR + sudo chmod 700 $CACHEDIR +fi diff --git a/coin/provisioning/common/linux/cmake_linux.sh b/coin/provisioning/common/linux/cmake_linux.sh index 922ed1e6..5fadad24 100755 --- a/coin/provisioning/common/linux/cmake_linux.sh +++ b/coin/provisioning/common/linux/cmake_linux.sh @@ -1,37 +1,6 @@ #!/usr/bin/env bash - -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: http://www.qt.io/licensing/ -## -## This file is part of the provisioning scripts of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL21$ -## 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 http://www.qt.io/terms-conditions. For further -## information use the contact form at http://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 2.1 or version 3 as published by the Free -## Software Foundation and appearing in the file LICENSE.LGPLv21 and -## LICENSE.LGPLv3 included in the packaging of this file. Please review the -## following information to ensure the GNU Lesser General Public License -## requirements will be met: https://www.gnu.org/licenses/lgpl.html and -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## As a special exception, The Qt Company gives you certain additional -## rights. These rights are described in The Qt Company LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2016 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 CMake @@ -42,11 +11,11 @@ source "${BASH_SOURCE%/*}/../unix/InstallFromCompressedFileFromURL.sh" # shellcheck source=../unix/SetEnvVar.sh source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" -majorminorversion="3.21" -version="3.21.1" -PrimaryUrl="http://ci-files01-hki.intra.qt.io/input/cmake/cmake-$version-linux-x86_64.tar.gz" +majorminorversion="3.27" +version="3.27.7" +PrimaryUrl="http://ci-files01-hki.ci.qt.io/input/cmake/cmake-$version-linux-x86_64.tar.gz" AltUrl="https://cmake.org/files/v$majorminorversion/cmake-$version-linux-x86_64.tar.gz" -SHA1="591e3b0729ae07c37c1fa3c6adde7cc21387059d" +SHA1="83ab00c8432a71cfc81e933ee7b3c3e14d50ad6f" targetFolder="/opt/cmake-$version" appPrefix="cmake-$version-linux-x86_64" diff --git a/coin/provisioning/common/linux/cmake_min_supported.sh b/coin/provisioning/common/linux/cmake_min_supported.sh new file mode 100755 index 00000000..4c64299b --- /dev/null +++ b/coin/provisioning/common/linux/cmake_min_supported.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# Copyright (C) 2016 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 the minimum supported CMake to build Qt + +# shellcheck source=../unix/InstallFromCompressedFileFromURL.sh +source "${BASH_SOURCE%/*}/../unix/InstallFromCompressedFileFromURL.sh" +# shellcheck source=../unix/SetEnvVar.sh +source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" + +majorminorversion="3.16" +version="3.16.8" +PrimaryUrl="http://ci-files01-hki.ci.qt.io/input/cmake/cmake-$version-Linux-x86_64.tar.gz" +AltUrl="https://cmake.org/files/v$majorminorversion/cmake-$version-Linux-x86_64.tar.gz" +SHA1="a4d2f96f475ccc8e1ae1d97cf6c8ce39abaa9d7c" +targetFolder="/opt/cmake-$version" +appPrefix="cmake-$version-Linux-x86_64" + +InstallFromCompressedFileFromURL "$PrimaryUrl" "$AltUrl" "$SHA1" "$targetFolder" "$appPrefix" + +SetEnvVar "CMAKE_MIN_SUPPORTED_BIN_PATH" "$targetFolder/bin" + +echo "CMake Min Supported = $version" >> ~/versions.txt + diff --git a/coin/provisioning/common/linux/cmake_toolchain_files/integrity_toolchain.cmake b/coin/provisioning/common/linux/cmake_toolchain_files/integrity_toolchain.cmake index def72e20..63cbc985 100644 --- a/coin/provisioning/common/linux/cmake_toolchain_files/integrity_toolchain.cmake +++ b/coin/provisioning/common/linux/cmake_toolchain_files/integrity_toolchain.cmake @@ -13,7 +13,7 @@ set(CMAKE_ASM_COMPILER cxintarm64) set(EGL_FOUND True) set(UNIX True) -set (CMAKE_C_COMPILE_FEATURES c_std_99) +set (CMAKE_C_COMPILE_FEATURES c_std_11) set (CMAKE_CXX_COMPILE_FEATURES cxx_alias_templates cxx_alignas @@ -59,38 +59,58 @@ endif() set(CMAKE_FIND_ROOT_PATH ${TARGET_ROOT_PATH}) +#graphical lib paths +set(EGL_LIBRARY_GRAPHIC_PATH ${TARGET_ROOT_PATH}/apps/ghs_apps_proc/qc_bsp/out/rel/libs/multimedia/graphics) +set(EGL_LIBRARY_CHK_PATH ${TARGET_ROOT_PATH}/apps/ghs_apps_proc/integrity/libs/arm64/chk) +set(EGL_LIBRARY_PREBUILD_PATH ${TARGET_ROOT_PATH}/apps/ghs_apps_proc/qc_bsp/AMSS/multimedia/graphics/opengl/esx/build/integrity/prebuilt) + #base -set(CMAKE_C_FLAGS "-bsp $ENV{INTEGRITY_BSP} -os_dir $ENV{INTEGRITY_DIR} -non_shared -startfile_dir=$ENV{INTEGRITY_DIR}/libs/$ENV{INTEGRITY_BSP}/$ENV{INTEGRITY_BUILD_TARGET} --rtos_library_directory=libs/$ENV{INTEGRITY_BSP}/$ENV{INTEGRITY_BUILD_TARGET} --rtos_library_directory=libs/arm64/$ENV{INTEGRITY_BUILD_TARGET} -bigswitch -DINTEGRITY -llibivfs.a -llibposix.a -llibpaged_alloc.a -llibnet.a -llibsocket.a") +set(CMAKE_C_FLAGS "-bsp $ENV{INTEGRITY_BSP} -os_dir $ENV{INTEGRITY_DIR} -non_shared -startfile_dir=$ENV{INTEGRITY_DIR}/libs/$ENV{INTEGRITY_BSP}/$ENV{INTEGRITY_BUILD_TARGET} --rtos_library_directory=libs/$ENV{INTEGRITY_BSP}/$ENV{INTEGRITY_BUILD_TARGET} --rtos_library_directory=libs/arm64/$ENV{INTEGRITY_BUILD_TARGET} -bigswitch -DINTEGRITY -llibposix.a") set(CMAKE_C_FLAGS_DEBUG "-g -Omaxdebug") -set(CMAKE_C_FLAGS_RELEASE "-Ospeed -Olink -Omax") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --signed_fields --diag_suppress=1,82,228,236,381,611,961,997,1795,1931,1974,3148 --c++17 --thread_local_storage --exceptions --defer_parse_function_templates") +set(CMAKE_C_FLAGS_RELEASE "-Ospeed -Olink -Omax -no_uvfd") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --signed_fields --diag_suppress=1,82,228,236,381,611,961,997,1795,1931,1974,3148,1721,1424,193,940,620,111,128,185,826,186,68,830,177,554,550,175,1441,546 -std=c11 --c++17 --thread_local_storage --exceptions --defer_parse_function_templates") -set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} --signed_fields --no_implicit_include --link_once_templates -non_shared --new_outside_of_constructor -I $ENV{QC_MULTIMEDIA_INC_DIR}") +set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -frigor=accurate --signed_fields --no_implicit_include --link_once_templates -non_shared --new_outside_of_constructor --commons -I $ENV{QC_MULTIMEDIA_INC_DIR}") set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${TARGET_ROOT_PATH} -L${TARGET_ROOT_PATH}/apps/ghs_apps_proc/qc_bsp/out/rel/libs/multimedia/graphics -L${TARGET_ROOT_PATH}/apps/ghs_apps_proc/qc_bsp/out/rel/libs/base -L${TARGET_ROOT_PATH}/apps/ghs_apps_proc/qc_bsp/AMSS/multimedia/graphics/opengl/esx/build/integrity/prebuilt -L${TARGET_ROOT_PATH}/apps/ghs_apps_proc/qc_bsp/out/rel/libs/platform -L${TARGET_ROOT_PATH}/apps/ghs_apps_proc/qc_bsp/out/rel/libs/multimedia/display/ --commons") - set(CMAKE_FIND_LIBRARY_PREFIXES "lib") set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") set(BUILD_SHARED_LIBS OFF) -set(CMAKE_EXE_LINKER_FLAGS "") - -set(QT_CFLAGS_OPTIMIZE_FULL "-Ospeed -olink -Omax") +set(QT_CFLAGS_OPTIMIZE_FULL "-Ospeed -Olink -Omax") set(GLSLANG_OSDEP_PATH ../3rdparty/glslang/glslang/OSDependent/Unix) - -#set(QT_DEBUG_OPTIMIZATION_FLAGS "1") -#set (QT_CMAKE_DEBUG_EXTEND_TARGET "1") - -set(EGL_INCLUDE_DIR $ENV{GL_INC_DIR}) +set(GL_INC_DIR ${TARGET_ROOT_PATH}/apps/ghs_apps_proc/qc_bsp/AMSS/multimedia/graphics/include/public) set(PKG_EGL_LIBRARY_DIRS ${TARGET_ROOT_PATH}) -set(EGL_LIBRARY ${TARGET_ROOT_PATH}/../libeglmegapack.a) - -#set(EGL_LIBRARY libESXEGL_Adreno.a libadreno_utils.a libESXGLESv2_Adreno.a libadreno_utils.a libGSLUser.a libOSUser.a libpanel.a libivfs.a libposix.a libpmem.a libtzbsp.a libpaged_alloc.a libglnext-llvm.a libopenwfd.a libplanedef.a liblogger.a libnet.a libsocket.a librfs_client.a libshm_client.a libmmosalrfs.a libmmosalfile.a libOSAbstraction.a) - -set(GLESv2_LIBRARY ${EGL_LIBRARY}) -set(GLESv2_INCLUDE_DIR $ENV{GL_INC_DIR}) -set(OPENGL_INCLUDE_DIR $ENV{GL_INC_DIR}) +set(EGL_INCLUDE_DIR ${GL_INC_DIR}) + +set(EGL_LIBRARY "${EGL_LIBRARY_GRAPHIC_PATH}/libESXEGL_Adreno.a") + +set(GLESv2_INCLUDE_DIR ${GL_INC_DIR}) +set(GLESv2_LIBRARY "${EGL_LIBRARY_GRAPHIC_PATH}/libESXGLESv2_Adreno.a") + +set(IntegrityPlatformGraphics_INCLUDE_DIR ${GL_INC_DIR}) +set(IntegrityPlatformGraphics_LIBRARY "${EGL_LIBRARY_GRAPHIC_PATH}/libadreno_utils.a") +set(IntegrityPlatformGraphics_LIBRARIES_PACK + "${EGL_LIBRARY_GRAPHIC_PATH}/libplanedef.a" + "${EGL_LIBRARY_GRAPHIC_PATH}/libmmosalfile.a" + "${EGL_LIBRARY_GRAPHIC_PATH}/libOSAbstraction.a" + "${EGL_LIBRARY_GRAPHIC_PATH}/libopenwfd.a" + "${EGL_LIBRARY_GRAPHIC_PATH}/libOSUser.a" + "${EGL_LIBRARY_GRAPHIC_PATH}/libpanel.a" + "${EGL_LIBRARY_GRAPHIC_PATH}/libGSLUser.a" + "${EGL_LIBRARY_PREBUILD_PATH}/libglnext-llvm.a" + "${EGL_LIBRARY_GRAPHIC_PATH}/libpmem.a" + "${EGL_LIBRARY_CHK_PATH}/libposix.a" + "${EGL_LIBRARY_CHK_PATH}/libivfs.a" +) + +list(APPEND _qt_igy_gui_libs + "${GLESv2_LIBRARY}" + "${IntegrityPlatformGraphics_LIBRARY}" + "${IntegrityPlatformGraphics_LIBRARIES_PACK}") + +set(OPENGL_INCLUDE_DIR ${GL_INC_DIR}) +set(OPENGL_opengl_LIBRARY ${EGL_LIBRARY}) diff --git a/coin/provisioning/common/linux/cmake_toolchain_files/qnx-toolchain-aarch64le.cmake b/coin/provisioning/common/linux/cmake_toolchain_files/qnx-toolchain-aarch64le.cmake deleted file mode 100644 index 3e3ee6e8..00000000 --- a/coin/provisioning/common/linux/cmake_toolchain_files/qnx-toolchain-aarch64le.cmake +++ /dev/null @@ -1,25 +0,0 @@ -set(CMAKE_SYSTEM_NAME QNX) - -if (NOT DEFINED CMAKE_FIND_ROOT_PATH_MODE_PROGRAM) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -endif() -if (NOT DEFINED CMAKE_FIND_ROOT_PATH_MODE_LIBRARY) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -endif() -if (NOT DEFINED CMAKE_FIND_ROOT_PATH_MODE_PACKAGE) - set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) -endif() -if (NOT DEFINED CMAKE_FIND_ROOT_PATH_MODE_INCLUDE) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -endif() - -set(CMAKE_FIND_ROOT_PATH $ENV{QNX_TARGET}/target/qnx7/) - -set(_qnx_toolchain_arch gcc_ntoaarch64le) - -set(CMAKE_C_COMPILER qcc) -set(CMAKE_C_COMPILER_TARGET ${_qnx_toolchain_arch}) -set(CMAKE_CXX_COMPILER q++) -set(CMAKE_CXX_COMPILER_TARGET ${_qnx_toolchain_arch}) - -set(CMAKE_SYSROOT $ENV{QNX_TARGET}) diff --git a/coin/provisioning/common/linux/cmake_toolchain_files/qnx-toolchain-armv7le.cmake b/coin/provisioning/common/linux/cmake_toolchain_files/qnx-toolchain-armv7le.cmake deleted file mode 100644 index b441859a..00000000 --- a/coin/provisioning/common/linux/cmake_toolchain_files/qnx-toolchain-armv7le.cmake +++ /dev/null @@ -1,25 +0,0 @@ -set(CMAKE_SYSTEM_NAME QNX) - -if (NOT DEFINED CMAKE_FIND_ROOT_PATH_MODE_PROGRAM) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -endif() -if (NOT DEFINED CMAKE_FIND_ROOT_PATH_MODE_LIBRARY) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -endif() -if (NOT DEFINED CMAKE_FIND_ROOT_PATH_MODE_PACKAGE) - set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) -endif() -if (NOT DEFINED CMAKE_FIND_ROOT_PATH_MODE_INCLUDE) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -endif() - -set(CMAKE_FIND_ROOT_PATH $ENV{QNX_TARGET}/target/qnx7/) - -set(_qnx_toolchain_arch gcc_ntoarmv7le) - -set(CMAKE_C_COMPILER qcc) -set(CMAKE_C_COMPILER_TARGET ${_qnx_toolchain_arch}) -set(CMAKE_CXX_COMPILER q++) -set(CMAKE_CXX_COMPILER_TARGET ${_qnx_toolchain_arch}) - -set(CMAKE_SYSROOT $ENV{QNX_TARGET}) diff --git a/coin/provisioning/common/linux/cmake_toolchain_files/qnx-toolchain-x8664.cmake b/coin/provisioning/common/linux/cmake_toolchain_files/qnx-toolchain-x8664.cmake deleted file mode 100644 index bec28b06..00000000 --- a/coin/provisioning/common/linux/cmake_toolchain_files/qnx-toolchain-x8664.cmake +++ /dev/null @@ -1,25 +0,0 @@ -set(CMAKE_SYSTEM_NAME QNX) - -if (NOT DEFINED CMAKE_FIND_ROOT_PATH_MODE_PROGRAM) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -endif() -if (NOT DEFINED CMAKE_FIND_ROOT_PATH_MODE_LIBRARY) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -endif() -if (NOT DEFINED CMAKE_FIND_ROOT_PATH_MODE_PACKAGE) - set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) -endif() -if (NOT DEFINED CMAKE_FIND_ROOT_PATH_MODE_INCLUDE) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -endif() - -set(CMAKE_FIND_ROOT_PATH $ENV{QNX_TARGET}/target/qnx7/) - -set(_qnx_toolchain_arch gcc_ntox86_64) - -set(CMAKE_C_COMPILER qcc) -set(CMAKE_C_COMPILER_TARGET ${_qnx_toolchain_arch}) -set(CMAKE_CXX_COMPILER q++) -set(CMAKE_CXX_COMPILER_TARGET ${_qnx_toolchain_arch}) - -set(CMAKE_SYSROOT $ENV{QNX_TARGET}) diff --git a/coin/provisioning/common/linux/disable-cracklib.sh b/coin/provisioning/common/linux/disable-cracklib.sh index e6cfc7a5..c4a5f9ba 100755 --- a/coin/provisioning/common/linux/disable-cracklib.sh +++ b/coin/provisioning/common/linux/disable-cracklib.sh @@ -1,4 +1,6 @@ #!/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 sudo chmod -x /etc/cron.daily/cracklib-runtime diff --git a/coin/provisioning/common/linux/disable-notifications.sh b/coin/provisioning/common/linux/disable-notifications.sh index 28d21656..802f986c 100755 --- a/coin/provisioning/common/linux/disable-notifications.sh +++ b/coin/provisioning/common/linux/disable-notifications.sh @@ -1,4 +1,6 @@ #!/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 gsettings set org.gnome.desktop.notifications.application:/update-manager/ enable false gsettings set org.gnome.desktop.notifications show-banners false diff --git a/coin/provisioning/common/linux/disable-ntp_linux.sh b/coin/provisioning/common/linux/disable-ntp_linux.sh index dc592553..f0712f48 100755 --- a/coin/provisioning/common/linux/disable-ntp_linux.sh +++ b/coin/provisioning/common/linux/disable-ntp_linux.sh @@ -1,47 +1,16 @@ #!/usr/bin/env bash - -############################################################################# -## -## Copyright (C) 2018 The Qt Company Ltd. -## Contact: http://www.qt.io/licensing/ -## -## This file is part of the provisioning scripts of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL21$ -## 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 http://www.qt.io/terms-conditions. For further -## information use the contact form at http://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 2.1 or version 3 as published by the Free -## Software Foundation and appearing in the file LICENSE.LGPLv21 and -## LICENSE.LGPLv3 included in the packaging of this file. Please review the -## following information to ensure the GNU Lesser General Public License -## requirements will be met: https://www.gnu.org/licenses/lgpl.html and -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## As a special exception, The Qt Company gives you certain additional -## rights. These rights are described in The Qt Company LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2018 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 echo "Disable Network Time Protocol (NTP)" -if uname -a |grep -q "Ubuntu"; then +if uname -a |grep -q "Ubuntu\|Debian" ; then sudo timedatectl set-ntp false -elif cat /etc/os-release | grep "PRETTY_NAME" | grep -q "Leap 15"; then +elif grep "PRETTY_NAME" /etc/os-release | grep -q "Leap 15"; then (sudo systemctl stop chronyd && sudo systemctl disable chronyd) -elif cat /etc/os-release |grep "SUSE Linux Enterprise Server 15"; then +elif grep -q "SUSE Linux Enterprise Server 15" /etc/os-release; then sudo timedatectl set-ntp false else sudo systemctl disable ntpd || sudo /sbin/chkconfig ntpd off diff --git a/coin/provisioning/common/linux/disable_kwin_overview.sh b/coin/provisioning/common/linux/disable_kwin_overview.sh new file mode 100755 index 00000000..988c64c5 --- /dev/null +++ b/coin/provisioning/common/linux/disable_kwin_overview.sh @@ -0,0 +1,43 @@ +#!/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 + +set -e +set -f +QT_USER="qt" +CONFDIR=".config" +KWINRC="kwinrc" +KWC5=$(which kwriteconfig5) + +if [ -z "$KWC5" ]; then + echo "(WW) kwriteconfig5 script not found." + echo "---- skipping overview disabling." + exit 0; +fi + +echo "---- ensuring window overview is disabled in kwin." + +# skip if user qt does not exist +echo "---- checking user $QT_USER" +if grep -q "^$QT_USER:" /etc/passwd; then + echo "(**) found user $QT_USER" +else + echo "(WW) user $QT_USER not found." + echo "---- skipping overview disabling." + exit 0; +fi + +CONFIGFILE="/home/$QT_USER/$CONFDIR/$KWINRC" + +# Check kwinrc existence +echo "---- checking for kwinrc." +if [ -f "$CONFIGFILE" ]; then + echo "(**) found kwinrc at $CONFIGFILE. Disabling overview." + + $KWC5 --file "$CONFIGFILE" --group Effect-windowview --key BorderActivateAll "9" + $KWC5 --file "$CONFIGFILE" --group Plugins --key windowOverview "false" + +else + echo "(WW) no kwinrc found at $CONFIGFILE." + echo "(WW) exiting." +fi diff --git a/coin/provisioning/common/linux/disable_selinux.sh b/coin/provisioning/common/linux/disable_selinux.sh index 64852e79..a788818e 100755 --- a/coin/provisioning/common/linux/disable_selinux.sh +++ b/coin/provisioning/common/linux/disable_selinux.sh @@ -1,4 +1,6 @@ #!/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 # We need to disable selinux while we are overwriting some binaries # required by it. If this is not done, ICU provisioning will create diff --git a/coin/provisioning/common/linux/docker.sh b/coin/provisioning/common/linux/docker.sh index cf2ff717..27673698 100755 --- a/coin/provisioning/common/linux/docker.sh +++ b/coin/provisioning/common/linux/docker.sh @@ -1,71 +1,42 @@ #!/usr/bin/env bash - -############################################################################# -## -## Copyright (C) 2019 The Qt Company Ltd. -## Contact: http://www.qt.io/licensing/ -## -## This file is part of the provisioning scripts of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL21$ -## 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 http://www.qt.io/terms-conditions. For further -## information use the contact form at http://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 2.1 or version 3 as published by the Free -## Software Foundation and appearing in the file LICENSE.LGPLv21 and -## LICENSE.LGPLv3 included in the packaging of this file. Please review the -## following information to ensure the GNU Lesser General Public License -## requirements will be met: https://www.gnu.org/licenses/lgpl.html and -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## As a special exception, The Qt Company gives you certain additional -## rights. These rights are described in The Qt Company LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## $QT_END_LICENSE$ -## -############################################################################# +# 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 set -e - PROVISIONING_DIR="$(dirname "$0")/../../" -. "$PROVISIONING_DIR"/common/unix/common.sourced.sh -. "$PROVISIONING_DIR"/common/unix/DownloadURL.sh - - -localRepo=http://ci-files01-hki.intra.qt.io/input/docker -upstreamRepo=https://download.docker.com/linux/ubuntu/dists/bionic/pool/stable/amd64 - -echo ' - f4c941807310e3fa470dddfb068d599174a3daec containerd.io_1.2.10-3_amd64.deb - ee640d9258fd4d3f4c7017ab2a71da63cbbead55 docker-ce_19.03.4~3-0~ubuntu-bionic_amd64.deb - 09402bf5dac40f0c50f1071b17f38f6584a42ad1 docker-ce-cli_19.03.4~3-0~ubuntu-bionic_amd64.deb -' \ - | xargs -n2 | while read sha f -do - DownloadURL $localRepo/$f $upstreamRepo/$f $sha -done +# shellcheck source=../unix/common.sourced.sh +source "$PROVISIONING_DIR"/common/unix/common.sourced.sh +# shellcheck source=../unix/DownloadURL.sh +source "$PROVISIONING_DIR"/common/unix/DownloadURL.sh + +localRepo=http://ci-files01-hki.ci.qt.io/input/docker +upstreamRepo=https://download.docker.com/linux/ubuntu/dists/focal/pool/stable/amd64/ + +function getEachUpstream () { + while read -r sha f + do DownloadURL "$localRepo/$f" "$upstreamRepo/$f" "$sha" + done +} +cat <<EOF | getEachUpstream +2666840157bab3b77a850236fbf323c423fb564a containerd.io_1.6.9-1_amd64.deb +ec6a1ad99b19b6a674349fb13bcc10d62c54c404 docker-ce_23.0.0-1~ubuntu.20.04~focal_amd64.deb +130774916fa7e2c9997b8fcb4e7696a343f12fb0 docker-ce-cli_23.0.0-1~ubuntu.20.04~focal_amd64.deb +EOF sudo apt-get -y install ./containerd.io_*.deb ./docker-ce_*.deb ./docker-ce-cli_*.deb rm -f ./containerd.io_*.deb ./docker-ce_*.deb ./docker-ce-cli_*.deb -sudo usermod -a -G docker $USER +sudo usermod -a -G docker "$USER" sudo docker --version # Download and install the docker-compose extension from https://github.com/docker/compose/releases f=docker-compose-$(uname -s)-$(uname -m) +dockerComposeVersion="v2.15.1" DownloadURL \ - $localRepo/$f-1.24.1 \ - https://github.com/docker/compose/releases/download/1.24.1/$f \ - cfb3439956216b1248308141f7193776fcf4b9c9b49cbbe2fb07885678e2bb8a + "$localRepo/$f-${dockerComposeVersion}" \ + "https://github.com/docker/compose/releases/download/${dockerComposeVersion}/$f" \ + bcfd9ea51dee4c19dccdfaeef0e7956ef68bf14f3d175933742061a7271ef0f5 sudo install -m 755 ./docker-compose* /usr/local/bin/docker-compose sudo docker-compose --version rm ./docker-compose* @@ -74,4 +45,4 @@ rm ./docker-compose* sudo apt-get install avahi-daemon -y # Start testserver provisioning -sudo "$(readlink -f $(dirname ${BASH_SOURCE[0]}))/../shared/testserver/docker_testserver.sh" +sudo "$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")/../shared/testserver/docker_testserver.sh" diff --git a/coin/provisioning/common/linux/enable_test_stacktraces.sh b/coin/provisioning/common/linux/enable_test_stacktraces.sh new file mode 100755 index 00000000..7b5871db --- /dev/null +++ b/coin/provisioning/common/linux/enable_test_stacktraces.sh @@ -0,0 +1,35 @@ +#!/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 + +### Enable automatic stacktraces in case of fatal errors in QTest. +# This requires that gdb can be found in PATH, and that no +# kernel security settings like yama.ptrace_scope prevent it. + + +PROVISIONING_DIR="$(dirname "$0")/../.." +# shellcheck source=../unix/common.sourced.sh +source "$PROVISIONING_DIR/common/unix/common.sourced.sh" + + +f="/etc/sysctl.d/10-ptrace.conf" +if [ -f $f ] +then + echo "Modifying $f ..." + sudo sed -i '/^kernel\.yama\.ptrace_scope *= *[1-9]$/s/[1-9]$/0/' $f + # Reload the modified setting, so that we can verify it right afterwards. + sudo sysctl -p $f +fi + +# Verify that yama.ptrace_scope = 0, if it's supported by the kernel. +ptrace_scope_value=$(sudo sysctl kernel.yama.ptrace_scope 2>/dev/null | sed -E 's/.*([0-9])$/\1/') +if [ -n "$ptrace_scope_value" ] && [ "$ptrace_scope_value" != 0 ] +then + fatal "kernel.yama.ptrace_scope = $ptrace_scope_value \ + which means that QTest automatic stacktraces will not work" +else + echo kernel.yama.ptrace_scope = "$ptrace_scope_value" +fi + + +$CMD_PKG_INSTALL gdb diff --git a/coin/provisioning/common/linux/fbx_linux.sh b/coin/provisioning/common/linux/fbx_linux.sh index f04eb89f..0c1176d1 100755 --- a/coin/provisioning/common/linux/fbx_linux.sh +++ b/coin/provisioning/common/linux/fbx_linux.sh @@ -1,37 +1,6 @@ #!/usr/bin/env bash - -############################################################################# -## -## Copyright (C) 2017 The Qt Company Ltd. -## Contact: http://www.qt.io/licensing/ -## -## This file is part of the provisioning scripts of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL21$ -## 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 http://www.qt.io/terms-conditions. For further -## information use the contact form at http://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 2.1 or version 3 as published by the Free -## Software Foundation and appearing in the file LICENSE.LGPLv21 and -## LICENSE.LGPLv3 included in the packaging of this file. Please review the -## following information to ensure the GNU Lesser General Public License -## requirements will be met: https://www.gnu.org/licenses/lgpl.html and -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## As a special exception, The Qt Company gives you certain additional -## rights. These rights are described in The Qt Company LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2017 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 FBX SDK @@ -43,7 +12,7 @@ source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" set -e tarballName="fbx20161_2_fbxsdk_linux.tar.gz" targetFolder="/opt/fbx" -cachedUrl="http://ci-files01-hki.intra.qt.io/input/fbx/$tarballName" +cachedUrl="http://ci-files01-hki.ci.qt.io/input/fbx/$tarballName" officialUrl="http://download.autodesk.com/us/fbx_release_older/2016.1.2/$tarballName" sha1="b0a08778de025e2c6e90d6fbdb6531f74a3da605" tmpFolder="/tmp" diff --git a/coin/provisioning/common/linux/gcc.sh b/coin/provisioning/common/linux/gcc.sh index 08920669..243b9ff6 100755 --- a/coin/provisioning/common/linux/gcc.sh +++ b/coin/provisioning/common/linux/gcc.sh @@ -1,37 +1,6 @@ #!/usr/bin/env bash - -############################################################################# -## -## Copyright (C) 2021 The Qt Company Ltd. -## Contact: http://www.qt.io/licensing/ -## -## This file is part of the provisioning scripts of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL21$ -## 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 http://www.qt.io/terms-conditions. For further -## information use the contact form at http://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 2.1 or version 3 as published by the Free -## Software Foundation and appearing in the file LICENSE.LGPLv21 and -## LICENSE.LGPLv3 included in the packaging of this file. Please review the -## following information to ensure the GNU Lesser General Public License -## requirements will be met: https://www.gnu.org/licenses/lgpl.html and -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## As a special exception, The Qt Company gives you certain additional -## rights. These rights are described in The Qt Company LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## $QT_END_LICENSE$ -## -############################################################################# +# 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 # This script builds GCC from sources @@ -50,20 +19,20 @@ function InstallGCC() { tmpFolder="/tmp" - prebuiltGCC="http://ci-files01-hki.intra.qt.io/input/gcc/gcc-$version-prebuilt.tar.gz" + prebuiltGCC="http://ci-files01-hki.ci.qt.io/input/gcc/gcc-$version-prebuilt.tar.gz" prebuiltTarget="$tmpFolder/gcc-$version-prebuilt.tar.gz" installPrefix="/usr/local" suffixVersion=$(echo "$version" | cut -d "." -f1,2) sourceFile="gcc-$version.tar.xz" - cachedUrl="http://ci-files01-hki.intra.qt.io/input/gcc/$sourceFile" + cachedUrl="http://ci-files01-hki.ci.qt.io/input/gcc/$sourceFile" officialUrl="https://gcc.gnu.org/pub/gcc/releases/gcc-$version/gcc-$version.tar.xz" targetFile="$tmpFolder/$sourceFile" buildFolder="$HOME/gcc_build" echo "Fetching prebuilt GCC." - curl --fail -L --retry 5 --retry-delay 5 -o "$prebuiltTarget" "$prebuiltGCC" || ( + DownloadURL "$prebuiltGCC" "" "$prebuiltSHA1" "$prebuiltTarget" || ( echo "Fetching prebuilt GCC failed. Building from sources." DownloadURL "$cachedUrl" "$officialUrl" "$sourcesSHA1" "$targetFile" ) diff --git a/coin/provisioning/common/linux/install-cpdb.sh b/coin/provisioning/common/linux/install-cpdb.sh new file mode 100755 index 00000000..3a7ae3b9 --- /dev/null +++ b/coin/provisioning/common/linux/install-cpdb.sh @@ -0,0 +1,26 @@ +#!/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 cpdb from sources. +# Requires GCC and Perl to be in PATH. +# The following dependencies should be pre-installed: +# make, autoconf, autopoint, libglib2.0-dev, libdbus-1-dev, libtool +set -ex + +repName="cpdb-libs" +gitUrl="https://github.com/openprinting/$repName.git" +tmpdir="/tmp" +repDir="$tmpdir/$repName" +prefix="/usr" +rm -rf "$repDir" +cd "$tmpdir" +git clone -q "$gitUrl" +cd "$repDir" +# cpdb-libs v2.0b4 with build bug fixed +git checkout -q ce848f1571a82ec03881fce127ff28bec8da239e +./autogen.sh > /dev/null +./configure --prefix="$prefix" > /dev/null +make "-j$(nproc)" > /dev/null && sudo make install > /dev/null +sudo ldconfig +rm -rf "$repDir" diff --git a/coin/provisioning/common/linux/install-flite.sh b/coin/provisioning/common/linux/install-flite.sh new file mode 100755 index 00000000..2f89e94e --- /dev/null +++ b/coin/provisioning/common/linux/install-flite.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# Copyright (C) 2022 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 flite from sources. +# Requires make, GCC and git to be in PATH. +set -ex + +# shellcheck source=../unix/DownloadURL.sh +source "${BASH_SOURCE%/*}/../unix/DownloadURL.sh" +# shellcheck source=../unix/SetEnvVar.sh +source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" + +repName="flite" +gitUrl="https://github.com/festvox/$repName.git" +tmpdir="/tmp" +repDir="$tmpdir/$repName" +prefix="/usr" +rm -rf "$repDir" +cd "$tmpdir" +git clone -q "$gitUrl" +cd "$repDir" +git checkout -q v2.2 +./configure --with-pic --enable-shared --prefix="$prefix" > /dev/null +make "-j$(nproc)" > /dev/null && sudo make install > /dev/null +rm -rf "$repDir" diff --git a/coin/provisioning/common/linux/install-git.sh b/coin/provisioning/common/linux/install-git.sh new file mode 100755 index 00000000..9e2804db --- /dev/null +++ b/coin/provisioning/common/linux/install-git.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Copyright (C) 2022 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 install git from sources. +# Requires GCC and Perl to be in PATH. +set -ex + +# shellcheck source=../unix/DownloadURL.sh +source "${BASH_SOURCE%/*}/../unix/DownloadURL.sh" +# shellcheck source=../unix/SetEnvVar.sh +source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" + +version="2.36.1" +officialUrl="https://github.com/git/git/archive/refs/tags/v$version.tar.gz" +cachedUrl="http://ci-files01-hki.ci.qt.io/input/git/git-$version.tar.gz" +targetFile="/tmp/git-$version.tar.gz" +sha="a17c11da2968f280a13832d97f48e9039edac354" +DownloadURL "$cachedUrl" "$officialUrl" "$sha" "$targetFile" +sourceDir="/tmp/git-$version-source" +mkdir "$sourceDir" +tar -xzf "$targetFile" -C "$sourceDir" + +cd "$sourceDir/git-$version" +installDir="$HOME/git" +make configure +./configure --prefix="$installDir" +make all +sudo make install + +SetEnvVar "PATH" "\"$installDir/bin:\$PATH\"" + +"$installDir/bin/git" --version diff --git a/coin/provisioning/common/linux/install-nodejs.sh b/coin/provisioning/common/linux/install-nodejs.sh new file mode 100755 index 00000000..95a8a0e5 --- /dev/null +++ b/coin/provisioning/common/linux/install-nodejs.sh @@ -0,0 +1,42 @@ +#!/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 + +# shellcheck source=../unix/DownloadURL.sh +source "${BASH_SOURCE%/*}/../unix/DownloadURL.sh" +# shellcheck source=../unix/SetEnvVar.sh +source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" + +# This script will install node.js 18.16.0 +version="18.16.0" + +uname_m="$(uname -m)" +case "$uname_m" in + x86_64|amd64) + sha256="44d93d9b4627fe5ae343012d855491d62c7381b236c347f7666a7ad070f26548" + pkgname="node-v$version-linux-x64.tar.xz" + dirname="node-v$version-linux-x64" + ;; + arm64|aarch64) + sha256="c81dfa0bada232cb4583c44d171ea207934f7356f85f9184b32d0dde69e2e0ea" + pkgname="node-v$version-linux-arm64.tar.xz" + dirname="node-v$version-linux-arm64" + ;; + *) fatal "Unknown architecture in uname: $uname_m" 43 ;; +esac + +internalUrl="http://ci-files01-hki.ci.qt.io/input/nodejs/$pkgname" +externalUrl="https://nodejs.org/dist/v$version/$pkgname" + +targetFile="$HOME/$pkgname" +DownloadURL "$internalUrl" "$externalUrl" "$sha256" "$targetFile" +echo "Installing nodejs" +tar -xJf "$targetFile" -C "$HOME" +rm "$targetFile" + +installPrefix="/opt/$dirname" +sudo mv "$HOME/$dirname" "$installPrefix" + +SetEnvVar "PATH" "$installPrefix/bin:\$PATH" + +echo "nodejs = $version" >> ~/versions.txt diff --git a/coin/provisioning/common/linux/install-vcpkg-ports-android.sh b/coin/provisioning/common/linux/install-vcpkg-ports-android.sh new file mode 100755 index 00000000..4733e9aa --- /dev/null +++ b/coin/provisioning/common/linux/install-vcpkg-ports-android.sh @@ -0,0 +1,24 @@ +#!/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 + +echo "Installing vcpkg android ports" + +pushd "${BASH_SOURCE%/*}/vcpkg" || exit +cp "${BASH_SOURCE%/*}/../shared/vcpkg-configuration.json" . + +"$VCPKG_ROOT/vcpkg" install --triplet x86-android-qt --x-install-root x86-android-qt-tmp --debug +"$VCPKG_ROOT/vcpkg" install --triplet x86_64-android-qt --x-install-root x86_64-android-qt-tmp --debug + +mkdir -p "$VCPKG_ROOT/installed" +cp -R x86-android-qt-tmp/* "$VCPKG_ROOT/installed/" +cp -R x86_64-android-qt-tmp/* "$VCPKG_ROOT/installed/" + +versions=$(jq -r '.overrides[] | "vcpkg \(.name) for android = \(.version)"' vcpkg.json) +versions="${versions//vcpkg/\\nvcpkg}" +echo "$versions" >> ~/versions.txt + +rm -rf x86-android-qt-tmp +rm -rf x86_64-android-qt-tmp + +popd || exit diff --git a/coin/provisioning/common/linux/install-vcpkg-ports.sh b/coin/provisioning/common/linux/install-vcpkg-ports.sh new file mode 100755 index 00000000..90257841 --- /dev/null +++ b/coin/provisioning/common/linux/install-vcpkg-ports.sh @@ -0,0 +1,21 @@ +#!/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 + +echo "Installing vcpkg ports" + +pushd "${BASH_SOURCE%/*}/vcpkg" || exit +cp "${BASH_SOURCE%/*}/../shared/vcpkg-configuration.json" . + +"$VCPKG_ROOT/vcpkg" install --triplet x64-linux-qt --x-install-root x64-linux-qt-tmp --debug + +mkdir -p "$VCPKG_ROOT/installed" +cp -R x64-linux-qt-tmp/* "$VCPKG_ROOT/installed/" + +versions=$(jq -r '.overrides[] | "vcpkg \(.name) = \(.version)"' vcpkg.json) +versions="${versions//vcpkg/\\nvcpkg}" +echo "$versions" >> ~/versions.txt + +rm -rf x64-linux-qt-tmp + +popd || exit diff --git a/coin/provisioning/common/linux/install-vcpkg.sh b/coin/provisioning/common/linux/install-vcpkg.sh new file mode 100755 index 00000000..80917beb --- /dev/null +++ b/coin/provisioning/common/linux/install-vcpkg.sh @@ -0,0 +1,59 @@ +#!/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 + +# shellcheck source=../unix/SetEnvVar.sh +source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" +# shellcheck source=../unix/DownloadURL.sh +source "${BASH_SOURCE%/*}/../unix/DownloadURL.sh" +# shellcheck source=../unix/InstallFromCompressedFileFromURL.sh +source "${BASH_SOURCE%/*}/../unix/InstallFromCompressedFileFromURL.sh" + +vcpkgVersion=$(grep 'vcpkg_version=' "${BASH_SOURCE%/*}/../shared/vcpkg_version.txt" | cut -d '=' -f 2) + +vcpkgRoot="$HOME/vcpkg-$vcpkgVersion" +vcpkgRepo=$(head -n 1 "${BASH_SOURCE%/*}/../shared/vcpkg_registry_mirror.txt") + +echo "Cloning the vcpkg repo" +git clone "$vcpkgRepo" "$vcpkgRoot" +git -C "$vcpkgRoot" checkout "tags/$vcpkgVersion" + +vcpkgToolReleaseTag=$(grep 'vcpkg_tool_release_tag=' "${BASH_SOURCE%/*}/../shared/vcpkg_tool_release_tag.txt" | cut -d '=' -f 2) +nonDottedReleaseTag=${vcpkgVersion//-/} + +vcpkgToolOfficialUrl="https://github.com/microsoft/vcpkg-tool/archive/refs/tags/$vcpkgToolReleaseTag.tar.gz" +vcpkgToolCacheUrl="http://ci-files01-hki.ci.qt.io/input/vcpkg/vcpkg-tool-$nonDottedReleaseTag.tar.gz" +vcpkgToolSHA1="c6029714fca0304779f10c9c1cbe4b061a2fd945" +vcpkgToolSourceFolder="$HOME/vcpkg-tool-$vcpkgToolReleaseTag" +vcpkgToolBuildFolder="$HOME/vcpkg-tool-$vcpkgToolReleaseTag/build" + +InstallFromCompressedFileFromURL "$vcpkgToolCacheUrl" "$vcpkgToolOfficialUrl" "$vcpkgToolSHA1" "$HOME" "" +cmake -S "$vcpkgToolSourceFolder" -B "$vcpkgToolBuildFolder" -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DVCPKG_DEVELOPMENT_WARNINGS=OFF +cmake --build "$vcpkgToolBuildFolder" --parallel + +cp "$vcpkgToolBuildFolder/vcpkg" "$vcpkgRoot/" +rm -rf "$vcpkgToolSourceFolder" + +if [ ! -f "$vcpkgRoot/vcpkg" ] +then + echo "Can't find $vcpkgRoot/vcpkg." + exit 1 +fi + +chmod 755 "$vcpkgRoot/vcpkg" +touch "$vcpkgRoot/vcpkg.disable-metrics" + +# Setting VCPKG_ROOT using Set-EnvVar makes the variable only +# available during build time. In order to make it available during the +# provisioning, we need to directly set it via $env:VCPKG_ROOT as well. +SetEnvVar "VCPKG_ROOT" "$vcpkgRoot" +export VCPKG_ROOT="$vcpkgRoot" + +# Set a source for vcpkg Binary and Asset Cache +# The `coin/provisioning/common/linux/mount-vcpkg-cache-drive.sh` script is +# mounting the SMB share located in `vcpkg-server.ci.qt.io/vcpkg` to +# $HOME/vcpkg-cache/ +export VCPKG_BINARY_SOURCES="files,$HOME/vcpkg-cache/binaries,readwrite" +export X_VCPKG_ASSET_SOURCES="x-azurl,file:///$HOME/vcpkg-cache/assets,,readwrite" + +echo "vcpkg = $vcpkgVersion" >> ~/versions.txt diff --git a/coin/provisioning/common/linux/install_dwz.sh b/coin/provisioning/common/linux/install_dwz.sh index 610f67bc..2d8af4ff 100755 --- a/coin/provisioning/common/linux/install_dwz.sh +++ b/coin/provisioning/common/linux/install_dwz.sh @@ -1,38 +1,7 @@ #!/usr/bin/env bash - -############################################################################# -## -## Copyright (C) 2018 The Qt Company Ltd. -## Copyright (C) 2020 Konstantin Tokarev <annulen@yandex.ru> -## Contact: http://www.qt.io/licensing/ -## -## This file is part of the provisioning scripts of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL21$ -## 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 http://www.qt.io/terms-conditions. For further -## information use the contact form at http://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 2.1 or version 3 as published by the Free -## Software Foundation and appearing in the file LICENSE.LGPLv21 and -## LICENSE.LGPLv3 included in the packaging of this file. Please review the -## following information to ensure the GNU Lesser General Public License -## requirements will be met: https://www.gnu.org/licenses/lgpl.html and -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## As a special exception, The Qt Company gives you certain additional -## rights. These rights are described in The Qt Company LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2018 The Qt Company Ltd. +# Copyright (C) 2020 Konstantin Tokarev <annulen@yandex.ru> +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only # shellcheck source=../unix/DownloadURL.sh source "${BASH_SOURCE%/*}/../unix/DownloadURL.sh" @@ -43,7 +12,7 @@ source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" version="0.13" sha1="21e6d5878bb84ac6c9ad07b00ed248d8c547bc7d" -internalUrl="http://ci-files01-hki.intra.qt.io/input/centos/dwz-$version.tar.xz" +internalUrl="http://ci-files01-hki.ci.qt.io/input/centos/dwz-$version.tar.xz" externalUrl="https://www.sourceware.org/ftp/dwz/releases/dwz-$version.tar.xz" targetDir="$HOME/dwz" diff --git a/coin/provisioning/common/linux/integrity.sh b/coin/provisioning/common/linux/integrity.sh index a90145ff..e0d95681 100755 --- a/coin/provisioning/common/linux/integrity.sh +++ b/coin/provisioning/common/linux/integrity.sh @@ -1,37 +1,6 @@ #!/usr/bin/env bash - -############################################################################# -## -## Copyright (C) 2021 The Qt Company Ltd. -## Contact: http://www.qt.io/licensing/ -## -## This file is part of the provisioning scripts of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL21$ -## 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 http://www.qt.io/terms-conditions. For further -## information use the contact form at http://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 2.1 or version 3 as published by the Free -## Software Foundation and appearing in the file LICENSE.LGPLv21 and -## LICENSE.LGPLv3 included in the packaging of this file. Please review the -## following information to ensure the GNU Lesser General Public License -## requirements will be met: https://www.gnu.org/licenses/lgpl.html and -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## As a special exception, The Qt Company gives you certain additional -## rights. These rights are described in The Qt Company LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## $QT_END_LICENSE$ -## -############################################################################# +# 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 # This script installs needed toolchains for INTEGRITY @@ -42,9 +11,9 @@ source "${BASH_SOURCE%/*}/../unix/DownloadURL.sh" # shellcheck source=../unix/SetEnvVar.sh source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" -urlToolchainEs7="http://ci-files01-hki.ci.local/input/integrity/integrity_toolchain_es7_patched.zip" -urlLibeglmegapack="http://ci-files01-hki.ci.local/input/integrity/integrity_libeglmegapack.zip" -SHA1_toolchainEs7="e890fe332a81f8345fed3dff89b30019d9989765" +urlToolchainEs7="http://ci-files01-hki.ci.qt.io/input/integrity/integrity_toolchain_es7_05102022.zip" +urlLibeglmegapack="http://ci-files01-hki.ci.qt.io/input/integrity/integrity_libeglmegapack.zip" +SHA1_toolchainEs7="a95e11996d89218ac93493484e483d169976f565" SHA1_Libeglmegapack="7f8ca64132eaea66202ea8db7f71f3300aab0777" targetFolder="$HOME" appPrefix="" @@ -57,7 +26,7 @@ InstallFromCompressedFileFromURL "$urlToolchainEs7" "$urlToolchainEs7" "$SHA1_to echo "Install Integrity toolchain addons" DownloadURL "$urlLibeglmegapack" "$urlLibeglmegapack" "$SHA1_Libeglmegapack" "/tmp/integrity_libeglmegapack.zip" unzip "/tmp/integrity_libeglmegapack.zip" -d "/tmp" -mv /tmp/toolchain/* $targetFolder/toolchain -mv $targetFolder/toolchain $targetFolder/integrity_toolchain -cp $toolchain_file "$targetFolder/integrity_toolchain/toolchain.cmake" +mv /tmp/toolchain/* "$targetFolder/toolchain" +mv "$targetFolder/toolchain" "$targetFolder/integrity_toolchain" +cp "$toolchain_file" "$targetFolder/integrity_toolchain/toolchain.cmake" sudo rm -fr /tmp/toolchain diff --git a/coin/provisioning/common/linux/mimersql.sh b/coin/provisioning/common/linux/mimersql.sh new file mode 100755 index 00000000..957ad492 --- /dev/null +++ b/coin/provisioning/common/linux/mimersql.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# Copyright (C) 2022 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 -e + +SSL_VER=$1 +PACK_TYPE=$2 +PROVISIONING_DIR="$(dirname "$0")/../../" +# shellcheck source=../unix/common.sourced.sh +source "${BASH_SOURCE%/*}/../unix/common.sourced.sh" +# shellcheck source=../unix/DownloadURL.sh +source "${BASH_SOURCE%/*}/../unix/DownloadURL.sh" + + +localRepo=http://ci-files01-hki.ci.qt.io/input/docker +upstreamRepo=http://install.mimer.com/qt +if [ "$SSL_VER" = "openssl-3" ]; then + if [ "$PACK_TYPE" = "rpm" ]; then + packageFile=mimersqlsrv-11.0.x86_64-openssl3.rpm + sha=5f21d440a12cddcc786ddff3a136bef821f1bf64 + else + packageFile=mimersqlsrv_11.0_amd64-openssl3.deb + sha=3239b593724c564862d3bbfb70fed16909a93959 + fi +else + if [ "$PACK_TYPE" = "rpm" ]; then + packageFile=mimersqlsrv-11.0.x86_64-openssl1.rpm + sha=34533347424ba540b36d0a6ae2f416b901d8bafb + else + packageFile=mimersqlsrv_11.0_amd64-openssl1.deb + sha=f4ac939a190ef048150b06cecc7a392386b6e132 + fi +fi +DownloadURL $localRepo/$packageFile $upstreamRepo/$packageFile $sha /tmp/$packageFile + +if [ "$PACK_TYPE" = "rpm" ]; then + sudo rpm -U /tmp/$packageFile +else + sudo apt-get -y install /tmp/$packageFile +fi +rm -f /tmp/$packageFile diff --git a/coin/provisioning/common/linux/mount-vcpkg-cache-drive.sh b/coin/provisioning/common/linux/mount-vcpkg-cache-drive.sh new file mode 100755 index 00000000..6a3a5211 --- /dev/null +++ b/coin/provisioning/common/linux/mount-vcpkg-cache-drive.sh @@ -0,0 +1,21 @@ +#!/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 + +set -e + +targetDir="$HOME/vcpkg-cache" + +# Specify the path to the credential file +credentialsFile="$HOME/samba_credentials" + +sudo mkdir -p "$targetDir" + +# Mount the SMB share +# Check if the mount was successful +if sudo mount -t cifs //vcpkg-server.ci.qt.io/vcpkg "$targetDir" -o credentials="$credentialsFile",uid="$(id -u)",gid="$(id -g)" +then + echo "SMB share mounted successfully!" +else + echo "Failed to mount SMB share." +fi diff --git a/coin/provisioning/common/linux/qnx_710.sh b/coin/provisioning/common/linux/qnx_710.sh index 6b164d58..7afefb42 100755 --- a/coin/provisioning/common/linux/qnx_710.sh +++ b/coin/provisioning/common/linux/qnx_710.sh @@ -1,37 +1,6 @@ #!/usr/bin/env bash - -############################################################################# -## -## Copyright (C) 2021 The Qt Company Ltd. -## Contact: http://www.qt.io/licensing/ -## -## This file is part of the provisioning scripts of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL21$ -## 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 http://www.qt.io/terms-conditions. For further -## information use the contact form at http://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 2.1 or version 3 as published by the Free -## Software Foundation and appearing in the file LICENSE.LGPLv21 and -## LICENSE.LGPLv3 included in the packaging of this file. Please review the -## following information to ensure the GNU Lesser General Public License -## requirements will be met: https://www.gnu.org/licenses/lgpl.html and -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## As a special exception, The Qt Company gives you certain additional -## rights. These rights are described in The Qt Company LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## $QT_END_LICENSE$ -## -############################################################################# +# 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 # This script installs QNX 7. @@ -49,43 +18,72 @@ DownloadAndExtract () { folder=$4 DownloadURL "$url" "$url" "$sha" "$file" - sudo tar -C $folder -Jxf $file + sudo tar -C "$folder" -Jxf "$file" - rm -rf $file + rm -rf "$file" } -aarch64le_toolchain="${BASH_SOURCE%/*}/cmake_toolchain_files/qnx-toolchain-aarch64le.cmake" -armv7le_toolchain="${BASH_SOURCE%/*}/cmake_toolchain_files/qnx-toolchain-armv7le.cmake" -x8664_toolchain="${BASH_SOURCE%/*}/cmake_toolchain_files/qnx-toolchain-x8664.cmake" +aarch64le_toolchain="${BASH_SOURCE%/*}/../shared/cmake_toolchain_files/qnx-toolchain-aarch64le.cmake" +armv7le_toolchain="${BASH_SOURCE%/*}/../shared/cmake_toolchain_files/qnx-toolchain-armv7le.cmake" +x8664_toolchain="${BASH_SOURCE%/*}/../shared/cmake_toolchain_files/qnx-toolchain-x8664.cmake" +QNX_qemu_bld_files_dir="${BASH_SOURCE%/*}/qnx_qemu_build_files/" targetFolder="/opt/" folderName="qnx710" targetPath="$targetFolder$folderName" +qemuTargetPath="$HOME/QNX" +qemuIpAddress="172.31.1.10" +export qemuNetwork="172.31.1.1" +qemuSSHuser="root" +qemuSSHurl="$qemuSSHuser@$qemuIpAddress" +qemuLDpath="/proc/boot:/system/lib:/system/lib/dll:/home/qt/work/install/target/lib" if [ ! -d "$targetFolder" ]; then - mkdir -p $targetFolder + mkdir -p "$targetFolder" fi # QNX SDP -sourceFile="http://ci-files01-hki.intra.qt.io/input/qnx/qnx710-20210929-linux.tar.xz" +sourceFile="http://ci-files01-hki.ci.qt.io/input/qnx/qnx710-windows-linux-20220405.tar.xz" targetFile="qnx710.tar.xz" -sha1="60f4a681f31fa7f10792db4c889c8f0b43aa1ad4" +sha1="134af2e0f75d7b7c516f824fafee265b89e51d48" +DownloadAndExtract "$sourceFile" "$sha1" "$targetFile" "$targetFolder" + +sudo cp "$aarch64le_toolchain" "$targetPath" +sudo cp "$armv7le_toolchain" "$targetPath" +sudo cp "$x8664_toolchain" "$targetPath" +cp -R "$QNX_qemu_bld_files_dir" "$qemuTargetPath" +# fc-match tool is missing from QNX SDP and tst_qfont requires it to work corretly +# Download code-only package from https://www.iana.org/time-zones and follow README +# to build tools for QNX x86_64. If need to build new tool create new qnx_qemu_utils +# package which contains it and update required info below +sourceFile="http://ci-files01-hki.ci.qt.io/input/qnx/qnx_qemu_utils_20211208.tar.xz" +targetFile="qnx_qemu_utils.tar.xz" +targetFolder="$qemuTargetPath/local/misc_files" +sha1="7653f5d50f61f1591d7785c3ec261228ecc9dd22" + +mkdir -p "$targetFolder" + DownloadAndExtract "$sourceFile" "$sha1" "$targetFile" "$targetFolder" -sudo cp $aarch64le_toolchain $targetPath -sudo cp $armv7le_toolchain $targetPath -sudo cp $x8664_toolchain $targetPath +# Add ssl certificates. Expects Ubuntu 20.04 LTS with ca-certificates package installed +cp -R /usr/share/ca-certificates "$targetFolder" +mkdir -p "$targetFolder/etc/ssl/certs" +cp -PR /etc/ssl/certs/* "$targetFolder/etc/ssl/certs" sudo chown -R qt:users "$targetPath" # Verify that we have last files in tars -if [ ! -f $targetPath/qnxsdp-env.sh ] || [ ! -f $targetPath/qnx-toolchain-x8664.cmake ] +if [ ! -f "$targetPath/qnxsdp-env.sh" ] || [ ! -f "$targetPath/qnx-toolchain-x8664.cmake" ] then echo "QNX toolchain installation failed!" - exit -1 + exit 1 fi # Set env variables SetEnvVar "QNX_710" "$targetPath" +SetEnvVar "QNX_QEMU" "$qemuTargetPath" +SetEnvVar "QNX_QEMU_IPADDR" "$qemuIpAddress" +SetEnvVar "QNX_QEMU_SSH" "$qemuSSHurl" +SetEnvVar "QNX_QEMU_LD_LIBRARY_PATH" "$qemuLDpath" echo "QNX SDP = 7.1.0" >> ~/versions.txt diff --git a/coin/provisioning/common/linux/qnx_qemu_build_files/local/misc_files/etc/hosts b/coin/provisioning/common/linux/qnx_qemu_build_files/local/misc_files/etc/hosts new file mode 100644 index 00000000..58b8d5a1 --- /dev/null +++ b/coin/provisioning/common/linux/qnx_qemu_build_files/local/misc_files/etc/hosts @@ -0,0 +1,19 @@ +# Need to add all testserver names statically +# as current Docker uses Multicast DNS (mDNS) (avahi) +# Which does not work with QNX qemu +172.31.1.1 apache2 apache2.test-net.qt.local +172.31.1.1 squid squid.test-net.qt.local +172.31.1.1 vsftpd vsftpd.test-net.qt.local +172.31.1.1 ftp-proxy ftp-proxy.test-net.qt.local +172.31.1.1 danted danted.test-net.qt.local +172.31.1.1 cyrus cyrus.test-net.qt.local +172.31.1.1 echo echo.test-net.qt.local +172.31.1.1 iptables iptables.test-net.qt.local + +# For network test server which is still used on some test +# like networkselftest for local dns resolution +172.31.1.1 qt-test-server + +# QtCoap testservers +172.31.1.1 californium californium.test-net.qt.local +172.31.1.1 freecoap freecoap.test-net.qt.local diff --git a/coin/provisioning/common/linux/qnx_qemu_build_files/local/misc_files/etc/resolv.conf b/coin/provisioning/common/linux/qnx_qemu_build_files/local/misc_files/etc/resolv.conf new file mode 100644 index 00000000..6765c11f --- /dev/null +++ b/coin/provisioning/common/linux/qnx_qemu_build_files/local/misc_files/etc/resolv.conf @@ -0,0 +1,2 @@ +search test-net.qt.local +nameserver 172.31.1.1 diff --git a/coin/provisioning/common/linux/qnx_qemu_build_files/local/opt_scripts/opt_nfs_qt b/coin/provisioning/common/linux/qnx_qemu_build_files/local/opt_scripts/opt_nfs_qt new file mode 100755 index 00000000..13db322b --- /dev/null +++ b/coin/provisioning/common/linux/qnx_qemu_build_files/local/opt_scripts/opt_nfs_qt @@ -0,0 +1,46 @@ +#!/bin/bash + +function brief() +{ + echo "--nfs=[<mount>|no]" +} + +function help() +{ + brief + cat <<EOF + If yes, the given nfs share "<mount>" will be mounted at <mount> + + The default is no. +EOF +} + +function validate() { + exit 0 +} + +function configure() +{ + if [ "$OPT_NFS_QT" != no ]; then + cat >output/option_files/post_start.opt_nfs <<EOF + +echo "---> Starting NFS" +STARTU_P(fs_nfs3_t,__FS_NFS3_ID__) fs-nfs3 -t 172.31.1.1:$OPT_NFS_QT $OPT_NFS_QT +EOF + fi + + exit 0 +} + +case "$1" in + brief) + brief;; + help) + help;; + validate) + validate;; + configure) + configure;; + default) + echo no;; +esac diff --git a/coin/provisioning/common/linux/qnx_qemu_build_files/local/options b/coin/provisioning/common/linux/qnx_qemu_build_files/local/options new file mode 100644 index 00000000..bf1a413e --- /dev/null +++ b/coin/provisioning/common/linux/qnx_qemu_build_files/local/options @@ -0,0 +1,88 @@ +OPT_ABLELOCK='no' +DEF_OPT_ABLELOCK='no' +OPT_ARCH='x86_64' +DEF_OPT_ARCH='x86_64' +OPT_ASLR='yes' +DEF_OPT_ASLR='yes' +OPT_CERTICOM='no' +DEF_OPT_CERTICOM='no' +OPT_CRYPTODEV='no' +DEF_OPT_CRYPTODEV='no' +OPT_DATA_INODES='3000' +DEF_OPT_DATA_INODES='3000' +OPT_DATA_SIZE='512' +DEF_OPT_DATA_SIZE='60' +OPT_EXTRA_DIRS='none' +DEF_OPT_EXTRA_DIRS='none' +OPT_GRAPHICS='no' +DEF_OPT_GRAPHICS='no' +OPT_GUEST='none' +DEF_OPT_GUEST='none' +OPT_HOSTNAME='qnx_QEMU_CI' +DEF_OPT_HOSTNAME='noname' +OPT_IP='172.31.1.69' +DEF_OPT_IP='dhcp' +OPT_MACADDR='52:54:00:f1:c4:92' +DEF_OPT_MACADDR='generate' +OPT_NFS='no' +DEF_OPT_NFS='no' +OPT_NFS_QT='/home/qt/work' +DEF_OPT_NFS_QT='/home/qt/work' +OPT_PATHTRUST='no' +DEF_OPT_PATHTRUST='no' +OPT_PERL='no' +DEF_OPT_PERL='no' +OPT_POLICY='none' +DEF_OPT_POLICY='none' +OPT_PYTHON='no' +DEF_OPT_PYTHON='no' +OPT_QAUDIT='no' +DEF_OPT_QAUDIT='no' +OPT_QFIM='no' +DEF_OPT_QFIM='no' +OPT_QTD='no' +DEF_OPT_QTD='no' +OPT_QVM='no' +DEF_OPT_QVM='no' +OPT_REPOS='$QNX_STAGE_nto:$QNX_TARGET' +DEF_OPT_REPOS='$QNX_STAGE_nto:$QNX_TARGET' +OPT_ROOT='no' +DEF_OPT_ROOT='no' +OPT_SAFE='no' +DEF_OPT_SAFE='no' +OPT_SECPOL='no' +DEF_OPT_SECPOL='no' +OPT_SECURE_DATA='no' +DEF_OPT_SECURE_DATA='no' +OPT_SECURE_PROCFS='yes' +DEF_OPT_SECURE_PROCFS='yes' +OPT_SLM='no' +DEF_OPT_SLM='no' +OPT_SSHD_PREGEN='yes' +DEF_OPT_SSHD_PREGEN='yes' +OPT_SSH_IDENT='prompt' +DEF_OPT_SSH_IDENT='prompt' +OPT_SYS_INODES='1000' +DEF_OPT_SYS_INODES='1000' +OPT_SYS_SIZE='20' +DEF_OPT_SYS_SIZE='20' +OPT_TCG='no' +DEF_OPT_TCG='no' +OPT_TELNET='no' +DEF_OPT_TELNET='no' +OPT_TOMCRYPT='no' +DEF_OPT_TOMCRYPT='no' +OPT_TOYBOX='no' +DEF_OPT_TOYBOX='no' +OPT_TYPE='qemu' +DEF_OPT_TYPE='qemu' +OPT_TZ='UTC0' +DEF_OPT_TZ='UTC0' +OPT_UNION='yes' +DEF_OPT_UNION='yes' +OPT_USB='no' +DEF_OPT_USB='no' +OPT_VALGRIND='no' +DEF_OPT_VALGRIND='no' +OPT_ZONEINFO='no' +DEF_OPT_ZONEINFO='no' diff --git a/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/data_files.custom b/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/data_files.custom new file mode 100644 index 00000000..cba74f1f --- /dev/null +++ b/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/data_files.custom @@ -0,0 +1,25 @@ +# local/snippets/data_files.custom +# Placeholder for local list of files to add to data partition + +home/root/.ssh/environment = { +TERM=qansi +PATH=__IFS_PATH__:/system/xbin:. +#LD_LIBRARY_PATH=__PROC_LIB__:/home/qt/work/install/target/lib +#QSG_RHI_BACKEND=software +#QT_QPA_PLATFORM=offscreen +} + +[uid=0 gid=0 dperms=755 type=dir] var/share +var/share/zoneinfo=usr/share/zoneinfo + +[uid=0 gid=0 dperms=755 type=dir] var/share/fonts +var/etc/fontconfig/fonts.conf=etc/fontconfig/fonts.conf +var/share/fonts=usr/share/fonts + +var/etc/hosts=local/misc_files/etc/hosts +var/etc/resolv.conf=local/misc_files/etc/resolv.conf +var/etc/nsswitch.conf=etc/nsswitch.conf + +[uid=0 gid=0 dperms=755 type=dir] var/etc/ssl/certs +var/share/ca-certificates=local/misc_files/ca-certificates +var/etc/ssl/certs=local/misc_files/etc/ssl/certs diff --git a/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/ifs_env.custom b/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/ifs_env.custom new file mode 100644 index 00000000..253e61c6 --- /dev/null +++ b/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/ifs_env.custom @@ -0,0 +1,12 @@ +# Add root HOME env variable +procmgr_symlink /data/home/root/ /home/root +HOME=/home/root + +# Needed for timezone related tests +TZ=Europe/Oslo +procmgr_symlink /data/var/share /usr/share +procmgr_symlink /data/var/share/zoneinfo/Europe/Oslo /data/var/etc/localtime + +# fontconfig +procmgr_symlink /data/var/etc/fontconfig/fonts.conf /etc/fontconfig/fonts.conf +procmgr_symlink /data/var/share/fonts /usr/share/fonts diff --git a/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/passwd_file.builtin b/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/passwd_file.builtin new file mode 100644 index 00000000..142fd04e --- /dev/null +++ b/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/passwd_file.builtin @@ -0,0 +1,3 @@ +root:x:0:0:Superuser:/data/home/root:/bin/sh +sshd:x:15:6:sshd:/data/var/chroot/sshd:/bin/false +qnxuser:x:__QNXUSER_UID__:__QNXUSER_GID__:User9:/data/home/qnxuser:/bin/sh diff --git a/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/post_start.custom b/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/post_start.custom new file mode 100644 index 00000000..5a260488 --- /dev/null +++ b/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/post_start.custom @@ -0,0 +1,25 @@ +# local/snippets/post_start.custom +# Commands executed from post_startup.sh. Executed at the end of system startup whether slm is in use +# or not +# +# To allow resource managers to be run properly with and without security policies, command lines +# should be written in one of the following forms: +# +# START(resmgr_t) resmgr DROPROOT(resmgr_uid) +# STARTU(resmgr_t, resmgr_uid) resmgr +# Where resmgr_t is the security type name (arbitrary but usually the name of the resmgr with _t appended), +# and resmgr_uid is the id to use for both uid and gid. DROPROOT is used only in cases where the +# resource manager supports a -U option for switching to non-root. +echo "---> Starting Filesystem event manager (fsevmgr)" +STARTU_P(fsevmg_t,__FSEVMG_ID__) fsevmgr -d -F __DEVB_ID__ -N __DEVB_ID__ + +echo "---> Remove large fonts" +rm -rf /data/var/share/fonts/NotoSansCJK* +rm -rf /data/var/share/fonts/NotoSansMonoCJK* +echo "---> Create fontconfig cache" +fc-cache & + +# Add default route so QNX knows where to send +# requests for unknown network +echo "---> Add default route" +route add default 172.31.1.1 diff --git a/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/shadow_file.builtin b/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/shadow_file.builtin new file mode 100644 index 00000000..e362b971 --- /dev/null +++ b/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/shadow_file.builtin @@ -0,0 +1,2 @@ +root::1475759054:0:0 +qnxuser:@S@f0J4xZibUbKllVqPMzetauCHLRi+9C8wTsxYXE5r7Pfhda5FI7zkObEmKogy01pAX5f/1niG2S2eLXbLs3xoww==@YjBmOTQwNzZiNzYwMzY3N2RkMGQ1NTZmNzA5MDFhMWY=:1476890273:0:0 diff --git a/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/system_files.custom b/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/system_files.custom new file mode 100644 index 00000000..da00c4e9 --- /dev/null +++ b/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/system_files.custom @@ -0,0 +1,64 @@ +# local/snippets/system_files.custom +# Placeholder for local list of files to add to system partition + +[perms=444] etc/ssh/sshd_config={ +HostKey /data/var/ssh/ssh_host_rsa_key +HostKey /data/var/ssh/ssh_host_ed25519_key +AuthorizedKeysFile .ssh/authorized_keys +PermitUserEnvironment yes +AuthenticationMethods none +PermitEmptyPasswords yes +PermitRootLogin yes +PidFile none +Subsystem sftp /system/xbin/sftp-server +} + +# libraries Qt requires +lib/libicuuc.so.67=usr/lib/libicuuc.so.67 +lib/libicudata.so.67=usr/lib/libicudata.so.67 +lib/libicui18n.so.67=usr/lib/libicui18n.so.67 +lib/libGLESv2.so.1=usr/lib/libGLESv2.so.1 +lib/libEGL.so.1=usr/lib/libEGL.so.1 +lib/libz.so.2=usr/lib/libz.so.2 +lib/libxml2.so.2=usr/lib/libxml2.so.2 +lib/libfreetype.so.23=usr/lib/libfreetype.so.23 +lib/libbz2.so.1=usr/lib/libbz2.so.1 +lib/liblzma.so.5=usr/lib/liblzma.so.5 +lib/libbacktrace.so.1=usr/lib/libbacktrace.so.1 +lib/libm.so.3=lib/libm.so.3 + +############################################# +### Image support +############################################# +etc/system/config/img.conf=etc/system/config/img.conf +lib/libpng16.so.16=usr/lib/libpng16.so.16 +lib/libjpeg.so.9=lib/libjpeg.so.9 +lib/libimg.so.1=lib/libimg.so.1 +lib/dll/img_codec_bmp.so=lib/dll/img_codec_bmp.so +lib/dll/img_codec_gif.so=lib/dll/img_codec_gif.so +lib/dll/img_codec_jpg.so=lib/dll/img_codec_jpg.so +lib/dll/img_codec_png.so=lib/dll/img_codec_png.so +lib/dll/img_codec_sgi.so=lib/dll/img_codec_sgi.so +lib/dll/img_codec_tga.so=lib/dll/img_codec_tga.so +lib/dll/img_codec_tif.so=lib/dll/img_codec_tif.so + +# for inotify +xbin/fsevmgr=sbin/fsevmgr + +############################################## +### MM support +############################################## +lib/libstrm.so.1=usr/lib/libstrm.so.1 +lib/libcamapi.so.1=usr/lib/libcamapi.so.1 +lib/libmmrndclient.so.1=usr/lib/libmmrndclient.so.1 +lib/libscreen.so.1=usr/lib/libscreen.so.1 + +# for fontconfig +lib/libfontconfig.so.1=usr/lib/libfontconfig.so.1 +xbin/fc-cache=bin/fc-cache +xbin/fc-match=local/misc_files/fc-match + +# network +lib/libssl.so=usr/lib/libssl.so +xbin/nslookup=usr/bin/nslookup +xbin/curl=usr/bin/curl diff --git a/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/uids.custom b/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/uids.custom new file mode 100644 index 00000000..9787971c --- /dev/null +++ b/coin/provisioning/common/linux/qnx_qemu_build_files/local/snippets/uids.custom @@ -0,0 +1 @@ +#define __FSEVMG_ID__ 50 diff --git a/coin/provisioning/common/linux/remove-update_notifier.sh b/coin/provisioning/common/linux/remove-update_notifier.sh index 4ee32d61..383f242d 100755 --- a/coin/provisioning/common/linux/remove-update_notifier.sh +++ b/coin/provisioning/common/linux/remove-update_notifier.sh @@ -1,3 +1,15 @@ #!/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 -sudo apt -q -y remove update-notifier update-manager python3-distupgrade python3-update-manager ubuntu-release-upgrader-core update-manager-core +installPackages+=(update-notifier) + +if uname -a |grep -q "Ubuntu" ; then +installPackages+=(update-manager-core) +installPackages+=(update-manager) +installPackages+=(python3-distupgrade) +installPackages+=(python3-update-manager) +installPackages+=(ubuntu-release-upgrader-core) +fi + +sudo apt -q -y remove "${installPackages[@]}" diff --git a/coin/provisioning/common/linux/sccache.sh b/coin/provisioning/common/linux/sccache.sh index 3a13bea4..5e4969b3 100755 --- a/coin/provisioning/common/linux/sccache.sh +++ b/coin/provisioning/common/linux/sccache.sh @@ -1,37 +1,6 @@ #!/usr/bin/env bash - -############################################################################# -## -## Copyright (C) 2018 The Qt Company Ltd. -## Contact: http://www.qt.io/licensing/ -## -## This file is part of the provisioning scripts of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL21$ -## 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 http://www.qt.io/terms-conditions. For further -## information use the contact form at http://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 2.1 or version 3 as published by the Free -## Software Foundation and appearing in the file LICENSE.LGPLv21 and -## LICENSE.LGPLv3 included in the packaging of this file. Please review the -## following information to ensure the GNU Lesser General Public License -## requirements will be met: https://www.gnu.org/licenses/lgpl.html and -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## As a special exception, The Qt Company gives you certain additional -## rights. These rights are described in The Qt Company LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2018 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 diff --git a/coin/provisioning/common/linux/set_ulimit.sh b/coin/provisioning/common/linux/set_ulimit.sh index 55414893..e384fe32 100755 --- a/coin/provisioning/common/linux/set_ulimit.sh +++ b/coin/provisioning/common/linux/set_ulimit.sh @@ -1,37 +1,6 @@ #!/usr/bin/env bash - -############################################################################# -## -## Copyright (C) 2021 The Qt Company Ltd. -## Contact: http://www.qt.io/licensing/ -## -## This file is part of the provisioning scripts of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL21$ -## 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 http://www.qt.io/terms-conditions. For further -## information use the contact form at http://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 2.1 or version 3 as published by the Free -## Software Foundation and appearing in the file LICENSE.LGPLv21 and -## LICENSE.LGPLv3 included in the packaging of this file. Please review the -## following information to ensure the GNU Lesser General Public License -## requirements will be met: https://www.gnu.org/licenses/lgpl.html and -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## As a special exception, The Qt Company gives you certain additional -## rights. These rights are described in The Qt Company LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## $QT_END_LICENSE$ -## -############################################################################# +# 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 # This script will set ulimit size for open files # Linker for Qt Webengine builds needs to open a multiple files. Without this it will hit the limit. diff --git a/coin/provisioning/common/linux/squish-coco.sh b/coin/provisioning/common/linux/squish-coco.sh index 4f8627d3..eda200d8 100755 --- a/coin/provisioning/common/linux/squish-coco.sh +++ b/coin/provisioning/common/linux/squish-coco.sh @@ -1,37 +1,6 @@ #!/usr/bin/env bash - -############################################################################# -## -## Copyright (C) 2018 The Qt Company Ltd. -## Contact: http://www.qt.io/licensing/ -## -## This file is part of the provisioning scripts of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL21$ -## 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 http://www.qt.io/terms-conditions. For further -## information use the contact form at http://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 2.1 or version 3 as published by the Free -## Software Foundation and appearing in the file LICENSE.LGPLv21 and -## LICENSE.LGPLv3 included in the packaging of this file. Please review the -## following information to ensure the GNU Lesser General Public License -## requirements will be met: https://www.gnu.org/licenses/lgpl.html and -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## As a special exception, The Qt Company gives you certain additional -## rights. These rights are described in The Qt Company LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2018 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 Squish Coco @@ -46,7 +15,7 @@ source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh" version="4.2.2" sha1="a44f0f039f3712c715eea63c4021d08bf17a44c6" package="SquishCocoSetup_${version}_Linux_x86_64.run" -url="http://ci-files01-hki.intra.qt.io/input/coco//$package" +url="http://ci-files01-hki.ci.qt.io/input/coco//$package" echo "Enable license for Coco" diff --git a/coin/provisioning/common/linux/ubuntu-version.sh b/coin/provisioning/common/linux/ubuntu-version.sh index d403df13..2d02bb22 100755 --- a/coin/provisioning/common/linux/ubuntu-version.sh +++ b/coin/provisioning/common/linux/ubuntu-version.sh @@ -1,37 +1,6 @@ #!/usr/bin/env bash - -############################################################################# -## -## Copyright (C) 2018 The Qt Company Ltd. -## Contact: http://www.qt.io/licensing/ -## -## This file is part of the provisioning scripts of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL21$ -## 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 http://www.qt.io/terms-conditions. For further -## information use the contact form at http://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 2.1 or version 3 as published by the Free -## Software Foundation and appearing in the file LICENSE.LGPLv21 and -## LICENSE.LGPLv3 included in the packaging of this file. Please review the -## following information to ensure the GNU Lesser General Public License -## requirements will be met: https://www.gnu.org/licenses/lgpl.html and -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## As a special exception, The Qt Company gives you certain additional -## rights. These rights are described in The Qt Company LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2018 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 needs to be called last during provisioning so that the software information will show up last in provision log. diff --git a/coin/provisioning/common/linux/vcpkg/vcpkg.json b/coin/provisioning/common/linux/vcpkg/vcpkg.json new file mode 100644 index 00000000..70cb16fb --- /dev/null +++ b/coin/provisioning/common/linux/vcpkg/vcpkg.json @@ -0,0 +1,12 @@ +{ + "overrides": [ + { + "name": "openssl", + "version": "3.0.7", + "port-version": 2 + } + ], + "dependencies": [ + "openssl" + ] +} diff --git a/coin/provisioning/common/linux/version.sh b/coin/provisioning/common/linux/version.sh index 9e23a77e..4e0443fe 100755 --- a/coin/provisioning/common/linux/version.sh +++ b/coin/provisioning/common/linux/version.sh @@ -1,37 +1,6 @@ #!/usr/bin/env bash - -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: http://www.qt.io/licensing/ -## -## This file is part of the provisioning scripts of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:LGPL21$ -## 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 http://www.qt.io/terms-conditions. For further -## information use the contact form at http://www.qt.io/contact-us. -## -## GNU Lesser General Public License Usage -## Alternatively, this file may be used under the terms of the GNU Lesser -## General Public License version 2.1 or version 3 as published by the Free -## Software Foundation and appearing in the file LICENSE.LGPLv21 and -## LICENSE.LGPLv3 included in the packaging of this file. Please review the -## following information to ensure the GNU Lesser General Public License -## requirements will be met: https://www.gnu.org/licenses/lgpl.html and -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## As a special exception, The Qt Company gives you certain additional -## rights. These rights are described in The Qt Company LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2016 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 will print all installed software to provision log. # Script needs to be named so that it will be ran at last during provisioning diff --git a/coin/provisioning/common/linux/vx_works.sh b/coin/provisioning/common/linux/vx_works.sh new file mode 100755 index 00000000..ed0bef0c --- /dev/null +++ b/coin/provisioning/common/linux/vx_works.sh @@ -0,0 +1,51 @@ +#!/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" "" +SetEnvVar "VXWORKS_HOME" "/opt/vxworks" + +VXWORKS_BUILD_VER="20240326" +######### 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_BUILD_VER}_2.tar.gz" +AltUrl="" +sha1="415359ac124e11198a3911c9c4b923269d8da83a" +targetFolder="/opt/" +InstallFromCompressedFileFromURL "$PrimaryUrl" "$AltUrl" "$sha1" "$targetFolder" "" +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_${VXWORKS_BUILD_VER}.tar.gz" +AltUrl="" +sha1="a6019012a8c7af760469959e2df89875f5ff4e9a" +targetFolder="/opt/" +InstallFromCompressedFileFromURL "$PrimaryUrl" "$AltUrl" "$sha1" "$targetFolder" "" + +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..39a68676 --- /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 _ 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 |