2020-08-05 17:00:52 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2021-01-08 03:26:32 +00:00
|
|
|
case $(./config.guess) in
|
|
|
|
*-darwin*)
|
2021-01-12 08:22:47 +00:00
|
|
|
brew install automake
|
2021-01-08 03:26:32 +00:00
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2020-08-05 17:00:52 +00:00
|
|
|
TARGETS=$@
|
|
|
|
|
|
|
|
PACKAGES=""
|
|
|
|
INSTALL_FIDO_PPA="no"
|
|
|
|
|
|
|
|
#echo "Setting up for '$TARGETS'"
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
lsb_release -a
|
|
|
|
|
|
|
|
for TARGET in $TARGETS; do
|
|
|
|
case $TARGET in
|
Add self-hosted runners for VMs of other platforms.
Github only hosts a limited number of platforms, and the runner code
is only supported on slightly wider range of platforms. To increase
our test coverage beyond that, we run the runner natively on a VM host,
where it runs a jobs that boot VMs of other platforms, waits for them
to come up then runs the build and test by ssh'ing into the guest.
This means that the minimum dependencies for the guests are quite low
(basically just sshd, a compiler and make).
The interface to the VM host is fairly simple (basically 3 scripts:
vmstartup, vmrun and vmshutdown), but those are specific to the VM host
so are not in the public repo. We also mount the working directory on the
host via sshfs, so things like artifact upload by the runner also work.
As part of this we are moving the per-test-target configs into a single
place (.github/configs) where there will be referenced by a single short
"config" key. I plan to make the github-hosted runners use this too.
The self-hosted runners are run off a private repo on github since that
prevents third parties from accessing them[0], and since runner quota is
limited on private repos, we avoid running the tests we run on the public
repo.
[0] https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners#self-hosted-runner-security-with-public-repositories
2021-01-15 03:11:43 +00:00
|
|
|
""|--without-openssl|--without-zlib|--with-Werror|--with-rpath*|--with-ssl-dir=*|--with-zlib=*)
|
2020-08-05 17:00:52 +00:00
|
|
|
# nothing to do
|
|
|
|
;;
|
|
|
|
"--with-kerberos5")
|
|
|
|
PACKAGES="$PACKAGES heimdal-dev"
|
|
|
|
#PACKAGES="$PACKAGES libkrb5-dev"
|
|
|
|
;;
|
|
|
|
"--with-libedit")
|
|
|
|
PACKAGES="$PACKAGES libedit-dev"
|
|
|
|
;;
|
|
|
|
"--with-pam")
|
|
|
|
PACKAGES="$PACKAGES libpam0g-dev"
|
|
|
|
;;
|
|
|
|
"--with-security-key-builtin")
|
|
|
|
INSTALL_FIDO_PPA="yes"
|
|
|
|
PACKAGES="$PACKAGES libfido2-dev libu2f-host-dev"
|
|
|
|
;;
|
|
|
|
"--with-selinux")
|
|
|
|
PACKAGES="$PACKAGES libselinux1-dev selinux-policy-dev"
|
|
|
|
;;
|
2021-01-08 13:36:05 +00:00
|
|
|
"--with-ldflags=-lhardened_malloc")
|
|
|
|
INSTALL_HARDENED_MALLOC=yes
|
|
|
|
;;
|
2021-01-28 03:31:01 +00:00
|
|
|
"--with-ssl-dir=/opt/openssl/head")
|
|
|
|
INSTALL_OPENSSL_HEAD=yes
|
|
|
|
;;
|
|
|
|
"--with-ssl-dir=/opt/libressl/head")
|
|
|
|
INSTALL_LIBRESSL_HEAD=yes
|
|
|
|
;;
|
2021-01-08 13:36:05 +00:00
|
|
|
*) echo "Invalid option '${TARGET}'"
|
2020-08-05 17:00:52 +00:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "yes" == "$INSTALL_FIDO_PPA" ]; then
|
|
|
|
sudo apt update -qq
|
|
|
|
sudo apt install software-properties-common
|
|
|
|
sudo apt-add-repository ppa:yubico/stable
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "x" != "x$PACKAGES" ]; then
|
|
|
|
sudo apt update -qq
|
|
|
|
sudo apt install -qy $PACKAGES
|
|
|
|
fi
|
2021-01-08 13:36:05 +00:00
|
|
|
|
|
|
|
if [ "${INSTALL_HARDENED_MALLOC}" = "yes" ]; then
|
|
|
|
(cd ${HOME} &&
|
|
|
|
git clone https://github.com/GrapheneOS/hardened_malloc.git &&
|
|
|
|
cd ${HOME}/hardened_malloc &&
|
2021-01-28 09:55:16 +00:00
|
|
|
make -j2 && sudo cp libhardened_malloc.so /usr/lib/)
|
2021-01-08 13:36:05 +00:00
|
|
|
fi
|
2021-01-28 03:31:01 +00:00
|
|
|
|
|
|
|
if [ "${INSTALL_OPENSSL_HEAD}" = "yes" ];then
|
|
|
|
(cd ${HOME} &&
|
|
|
|
git clone https://github.com/openssl/openssl.git &&
|
|
|
|
cd ${HOME}/openssl &&
|
|
|
|
./config no-threads no-engine no-fips no-shared --prefix=/opt/openssl/head &&
|
2021-01-28 09:55:16 +00:00
|
|
|
make -j2 && sudo make install_sw)
|
2021-01-28 03:31:01 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${INSTALL_LIBRESSL_HEAD}" = "yes" ];then
|
|
|
|
(mkdir -p ${HOME}/libressl && cd ${HOME}/libressl &&
|
|
|
|
git clone https://github.com/libressl-portable/portable.git &&
|
|
|
|
cd ${HOME}/libressl/portable && sh update.sh && sh autogen.sh &&
|
|
|
|
./configure --prefix=/opt/libressl/head &&
|
2021-01-28 09:55:16 +00:00
|
|
|
make -j2 && sudo make install_sw)
|
2021-01-28 03:31:01 +00:00
|
|
|
fi
|