diff options
Diffstat (limited to '.github/setup_ci.sh')
-rwxr-xr-x | .github/setup_ci.sh | 53 |
1 files changed, 36 insertions, 17 deletions
diff --git a/.github/setup_ci.sh b/.github/setup_ci.sh index 010a333a6..d0ba7b472 100755 --- a/.github/setup_ci.sh +++ b/.github/setup_ci.sh @@ -18,8 +18,7 @@ case "$host" in ;; *-darwin*) PACKAGER=brew - brew install automake - exit 0 + PACKAGES="automake" ;; *) PACKAGER=apt @@ -30,20 +29,30 @@ TARGETS=$@ INSTALL_FIDO_PPA="no" export DEBIAN_FRONTEND=noninteractive -#echo "Setting up for '$TARGETS'" - -set -ex +set -e if [ -x "`which lsb_release 2>&1`" ]; then lsb_release -a fi -# Ubuntu 22.04 defaults to private home dirs which prevent the -# agent-getpeerid test from running ssh-add as nobody. See -# https://github.com/actions/runner-images/issues/6106 -if [ ! -z "$SUDO" ] && ! "$SUDO" -u nobody test -x ~; then - echo ~ is not executable by nobody, adding perms. - chmod go+x ~ +if [ ! -z "$SUDO" ]; then + # Ubuntu 22.04 defaults to private home dirs which prevent the + # agent-getpeerid test from running ssh-add as nobody. See + # https://github.com/actions/runner-images/issues/6106 + if ! "$SUDO" -u nobody test -x ~; then + echo ~ is not executable by nobody, adding perms. + chmod go+x ~ + fi + # Some of the Mac OS X runners don't have a nopasswd sudo rule. Regular + # sudo still works, but sudo -u doesn't. Restore the sudo rule. + if ! "$SUDO" grep -E 'runner.*NOPASSWD' /etc/passwd >/dev/null; then + echo "Restoring runner nopasswd rule to sudoers." + echo 'runner ALL=(ALL) NOPASSWD: ALL' |$SUDO tee -a /etc/sudoers + fi + if ! "$SUDO" -u nobody -S test -x ~ </dev/null; then + echo "Still can't sudo to nobody." + exit 1 + fi fi if [ "${TARGETS}" = "kitchensink" ]; then @@ -57,6 +66,7 @@ for flag in $CONFIGFLAGS; do esac done +echo "Setting up for '$TARGETS'" for TARGET in $TARGETS; do case $TARGET in default|without-openssl|without-zlib|c89) @@ -87,7 +97,9 @@ for TARGET in $TARGETS; do esac ;; *pam) - PACKAGES="$PACKAGES libpam0g-dev" + case "$PACKAGER" in + apt) PACKAGES="$PACKAGES libpam0g-dev" ;; + esac ;; sk) INSTALL_FIDO_PPA="yes" @@ -116,7 +128,7 @@ for TARGET in $TARGETS; do 1.*) INSTALL_OPENSSL="OpenSSL_$(echo ${INSTALL_OPENSSL} | tr . _)" ;; 3.*) INSTALL_OPENSSL="openssl-${INSTALL_OPENSSL}" ;; esac - PACKAGES="${PACKAGES} putty-tools" + PACKAGES="${PACKAGES} putty-tools dropbear-bin" ;; libressl-*) INSTALL_LIBRESSL=$(echo ${TARGET} | cut -f2 -d-) @@ -124,7 +136,7 @@ for TARGET in $TARGETS; do master) ;; *) INSTALL_LIBRESSL="$(echo ${TARGET} | cut -f2 -d-)" ;; esac - PACKAGES="${PACKAGES} putty-tools" + PACKAGES="${PACKAGES} putty-tools dropbear-bin" ;; boringssl) INSTALL_BORINGSSL=1 @@ -156,6 +168,13 @@ while [ ! -z "$PACKAGES" ] && [ "$tries" -gt "0" ]; do PACKAGES="" fi ;; + brew) + if [ ! -z "PACKAGES" ]; then + if brew install $PACKAGES; then + PACKAGES="" + fi + fi + ;; setup) if /cygdrive/c/setup.exe -q -P `echo "$PACKAGES" | tr ' ' ,`; then PACKAGES="" @@ -176,7 +195,7 @@ if [ "${INSTALL_HARDENED_MALLOC}" = "yes" ]; then (cd ${HOME} && git clone https://github.com/GrapheneOS/hardened_malloc.git && cd ${HOME}/hardened_malloc && - make -j2 && sudo cp out/libhardened_malloc.so /usr/lib/) + make && sudo cp out/libhardened_malloc.so /usr/lib/) fi if [ ! -z "${INSTALL_OPENSSL}" ]; then @@ -197,14 +216,14 @@ if [ ! -z "${INSTALL_LIBRESSL}" ]; then git checkout ${INSTALL_LIBRESSL} && sh update.sh && sh autogen.sh && ./configure --prefix=/opt/libressl && - make -j2 && sudo make install) + make && sudo make install) else LIBRESSL_URLBASE=https://cdn.openbsd.org/pub/OpenBSD/LibreSSL (cd ${HOME} && wget ${LIBRESSL_URLBASE}/libressl-${INSTALL_LIBRESSL}.tar.gz && tar xfz libressl-${INSTALL_LIBRESSL}.tar.gz && cd libressl-${INSTALL_LIBRESSL} && - ./configure --prefix=/opt/libressl && make -j2 && sudo make install) + ./configure --prefix=/opt/libressl && make && sudo make install) fi fi |