aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common/macos
diff options
context:
space:
mode:
Diffstat (limited to 'coin/provisioning/common/macos')
-rwxr-xr-xcoin/provisioning/common/macos/InstallPKGFromURL.sh14
-rwxr-xr-xcoin/provisioning/common/macos/disable-notifications_and_warnings.sh7
-rwxr-xr-xcoin/provisioning/common/macos/homebrew.sh17
-rwxr-xr-xcoin/provisioning/common/macos/install-commandlinetools.sh2
-rwxr-xr-xcoin/provisioning/common/macos/install_openssl_111a.sh78
-rwxr-xr-xcoin/provisioning/common/macos/libusb.sh43
-rwxr-xr-xcoin/provisioning/common/macos/macos-version.sh2
-rwxr-xr-xcoin/provisioning/common/macos/pkgconfig.sh43
-rw-r--r--coin/provisioning/common/macos/telegraf-coin.conf8
-rwxr-xr-xcoin/provisioning/common/macos/version.sh6
10 files changed, 129 insertions, 91 deletions
diff --git a/coin/provisioning/common/macos/InstallPKGFromURL.sh b/coin/provisioning/common/macos/InstallPKGFromURL.sh
index 77ef128a..d9b55d3b 100755
--- a/coin/provisioning/common/macos/InstallPKGFromURL.sh
+++ b/coin/provisioning/common/macos/InstallPKGFromURL.sh
@@ -42,7 +42,9 @@ function InstallPKGFromURL {
targetDirectory=$4
echo "Creating temporary file"
- targetFile=$(mktemp "$TMPDIR$(uuidgen).pkg")
+ package_basename=$(echo "$url" | sed 's|^.*/||')
+ tmpdir=$(mktemp -d)
+ targetFile="$tmpdir/$package_basename"
echo "Downloading PKG from primary URL '$url'"
curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url" || (
echo "Failed to download '$url' multiple times"
@@ -50,10 +52,12 @@ function InstallPKGFromURL {
curl --fail -L --retry 5 --retry-delay 5 -o "$targetFile" "$url_alt"
)
echo "Checking SHA1 on PKG '$targetFile'"
- echo "$expectedSha1 *$targetFile" > "$targetFile.sha1"
- /usr/bin/shasum --check "$targetFile.sha1"
+ echo "$expectedSha1 *$targetFile" > "$targetFile".sha1
+ /usr/bin/shasum --check "$targetFile".sha1
echo "Run installer on PKG"
sudo installer -package "$targetFile" -target "$targetDirectory"
- echo "Removing file '$targetFile'"
- rm "$targetFile"
+
+ rm -f "$targetFile".sha1
+ rm -f "$targetFile"
+ rmdir "$tmpdir"
}
diff --git a/coin/provisioning/common/macos/disable-notifications_and_warnings.sh b/coin/provisioning/common/macos/disable-notifications_and_warnings.sh
new file mode 100755
index 00000000..c40a4f65
--- /dev/null
+++ b/coin/provisioning/common/macos/disable-notifications_and_warnings.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+echo "Unload notificationcenterui.plist"
+launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
+
+echo "Remove 32-bit warnings"
+rm ~/Library/Preferences/com.apple.coreservices.uiagent.plist
diff --git a/coin/provisioning/common/macos/homebrew.sh b/coin/provisioning/common/macos/homebrew.sh
index 715477c0..66463c44 100755
--- a/coin/provisioning/common/macos/homebrew.sh
+++ b/coin/provisioning/common/macos/homebrew.sh
@@ -1,12 +1,21 @@
-#!/usr/bin/env bash
+#!/bin/sh
# Will install homebrew package manager for macOS.
# WARNING: Requires commandlinetools
-# TODO audit and cache this file locally, see QTQAINFRA-3134
-curl -L -o /tmp/homebrew_install https://raw.githubusercontent.com/Homebrew/install/master/install
+set -e
+
+. "$(dirname "$0")"/../../common/unix/DownloadURL.sh
+
+
+DownloadURL \
+ http://ci-files01-hki.intra.qt.io/input/mac/homebrew-install.c744a716f9845988d01e6e238eee7117b8c366c9.rb \
+ https://raw.githubusercontent.com/Homebrew/install/c744a716f9845988d01e6e238eee7117b8c366c9/install \
+ b9782cc0b550229de77b429b56ffce04157e60486ab9df00461ccf3dad565b0a \
+ /tmp/homebrew_install
/usr/bin/ruby /tmp/homebrew_install </dev/null
-brew update
+# No need to manually do `brew update`, the homebrew installer script does it.
+### brew update
diff --git a/coin/provisioning/common/macos/install-commandlinetools.sh b/coin/provisioning/common/macos/install-commandlinetools.sh
index b9f81534..cd7838b6 100755
--- a/coin/provisioning/common/macos/install-commandlinetools.sh
+++ b/coin/provisioning/common/macos/install-commandlinetools.sh
@@ -50,7 +50,7 @@ function InstallCommandLineTools {
hdiutil attach "/tmp/$packageName"
cd "/Volumes/Command Line Developer Tools"
echo "Installing"
- sudo installer -pkg ./*.pkg -target /
+ sudo installer -pkg ./*.pkg -target / -allowUntrusted
cd /
# Let's fait for 5 second before unmounting. Sometimes resource is busy and cant be unmounted
sleep 3
diff --git a/coin/provisioning/common/macos/install_openssl_111a.sh b/coin/provisioning/common/macos/install_openssl_111a.sh
deleted file mode 100755
index cd6cd9e8..00000000
--- a/coin/provisioning/common/macos/install_openssl_111a.sh
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/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$
-##
-#############################################################################
-
-# This script install OpenSSL
-
-set -ex
-
-# shellcheck source=../unix/InstallFromCompressedFileFromURL.sh
-source "${BASH_SOURCE%/*}/../unix/InstallFromCompressedFileFromURL.sh"
-# shellcheck source=../unix/SetEnvVar.sh
-source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh"
-
-opensslVersion="1.1.1a"
-opensslFile="openssl-$opensslVersion.tar.gz"
-opensslDlUrl="http://ci-files01-hki.intra.qt.io/input/openssl/$opensslFile"
-opensslAltDlUrl="https://www.openssl.org/source/$opensslFile"
-opensslSha1="8fae27b4f34445a5500c9dc50ae66b4d6472ce29"
-
-# Below target location has been hard coded into Coin.
-# QTQAINFRA-1195
-openssl_install_dir=/usr/local/openssl-$opensslVersion
-opensslTargetLocation="/usr/local/opt/openssl"
-
-InstallFromCompressedFileFromURL "$opensslDlUrl" "$opensslAltDlUrl" "$opensslSha1" "/tmp/openssl-$opensslVersion" "openssl-$opensslVersion"
-cd "/tmp/openssl-$opensslVersion"
-sudo ./Configure --prefix=$openssl_install_dir shared no-ssl3-method enable-ec_nistp_64_gcc_128 darwin64-x86_64-cc "-Wa,--noexecstack"
-
-sudo make install_sw install_ssldirs
-
-path=$(echo "$opensslTargetLocation" | sed -E 's/(.*)\/.*$/\1/')
-sudo mkdir -p "$path"
-sudo ln -s $openssl_install_dir $opensslTargetLocation
-
-SetEnvVar "PATH" "\"$opensslTargetLocation/bin:\$PATH\""
-SetEnvVar "MANPATH" "\"$opensslTargetLocation/share/man:\$MANPATH\""
-
-SetEnvVar "OPENSSL_DIR" "\"$openssl_install_dir\""
-SetEnvVar "OPENSSL_INCLUDE" "\"$openssl_install_dir/include\""
-SetEnvVar "OPENSSL_LIB" "\"$openssl_install_dir/lib\""
-
-security find-certificate -a -p /Library/Keychains/System.keychain | sudo tee -a $opensslTargetLocation/ssl/cert.pem > /dev/null
-security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain | sudo tee -a $opensslTargetLocation/ssl/cert.pem > /dev/null
-
-sudo rm -rf /tmp/openssl-$opensslVersion
-
-echo "OpenSSL = $opensslVersion" >> ~/versions.txt
diff --git a/coin/provisioning/common/macos/libusb.sh b/coin/provisioning/common/macos/libusb.sh
new file mode 100755
index 00000000..0022d209
--- /dev/null
+++ b/coin/provisioning/common/macos/libusb.sh
@@ -0,0 +1,43 @@
+#!/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$
+##
+#############################################################################
+
+# Install libusb
+set -ex
+
+source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh"
+brew install --build-from-source libusb
+read -r -a arr <<< $(brew list --versions libusb)
+version=${arr[1]}
+echo "libusb = $version" >> ~/versions.txt
diff --git a/coin/provisioning/common/macos/macos-version.sh b/coin/provisioning/common/macos/macos-version.sh
index 9f357b8c..c88cd9b8 100755
--- a/coin/provisioning/common/macos/macos-version.sh
+++ b/coin/provisioning/common/macos/macos-version.sh
@@ -44,8 +44,6 @@ sw_vers >> ~/versions.txt
echo "***** All installed packages *****" >> ~/versions.txt
echo "***** HomeBrew *****" >> ~/versions.txt
brew list --versions >> ~/versions.txt
-echo "***** HomeBrew Casks*****" >> ~/versions.txt
-brew cask list --versions >> ~/versions.txt
echo "***** Apple's installer *****" >> ~/versions.txt
pkgutil --pkgs >> ~/versions.txt
echo "*********************************************" >> ~/versions.txt
diff --git a/coin/provisioning/common/macos/pkgconfig.sh b/coin/provisioning/common/macos/pkgconfig.sh
new file mode 100755
index 00000000..9fad4912
--- /dev/null
+++ b/coin/provisioning/common/macos/pkgconfig.sh
@@ -0,0 +1,43 @@
+#!/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$
+##
+#############################################################################
+
+# Install pkgconfig
+set -ex
+
+source "${BASH_SOURCE%/*}/../unix/SetEnvVar.sh"
+brew install pkgconfig
+read -r -a arr <<< $(brew list --versions pkgconfig)
+version=${arr[1]}
+echo "pkgconfig = $version" >> ~/versions.txt
diff --git a/coin/provisioning/common/macos/telegraf-coin.conf b/coin/provisioning/common/macos/telegraf-coin.conf
index 24440a05..006de88c 100644
--- a/coin/provisioning/common/macos/telegraf-coin.conf
+++ b/coin/provisioning/common/macos/telegraf-coin.conf
@@ -24,7 +24,13 @@
# collect_cpu_time = false
# report_active = false
[[inputs.disk]]
- ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]
+ # macOS needs two extra filesystem exceptions:
+ # + cd9660: This is a read-only filesystem, and always 100% full
+ # + msdos: Sometimes at boot a short-lived unique mount of type "msdos"
+ # is performed, at the random directory
+ # /Volumes/firmwaresyncd.XXXXXX.
+ # The uniqueness of the path bloats the cardinality of InfluxDB.
+ ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs", "cd9660", "msdos"]
#[[inputs.diskio]] # linux-only
[[inputs.kernel]]
[[inputs.mem]]
diff --git a/coin/provisioning/common/macos/version.sh b/coin/provisioning/common/macos/version.sh
index 3e2a7f19..e57fb60b 100755
--- a/coin/provisioning/common/macos/version.sh
+++ b/coin/provisioning/common/macos/version.sh
@@ -41,3 +41,9 @@ echo "*********************************************"
echo "***** SW VERSIONS *****"
cat ~/versions.txt
echo "*********************************************"
+echo "*************** mount ***********************"
+mount
+echo "*********************************************"
+echo "*************** df **************************"
+df -h
+echo "*********************************************"