@@ -18,8 +18,7 @@ case "$host" in
1818 ;;
1919* -darwin* )
2020 PACKAGER=brew
21- brew install automake
22- exit 0
21+ PACKAGES=" automake"
2322 ;;
2423* )
2524 PACKAGER=apt
@@ -31,20 +30,30 @@ INSTALL_FIDO_PPA="no"
3130# COPY_PAM_MODULE="no"
3231export DEBIAN_FRONTEND=noninteractive
3332
34- # echo "Setting up for '$TARGETS'"
35-
36- set -ex
33+ set -e
3734
3835if [ -x " ` which lsb_release 2>&1 ` " ]; then
3936 lsb_release -a
4037fi
4138
42- # Ubuntu 22.04 defaults to private home dirs which prevent the
43- # agent-getpeerid test from running ssh-add as nobody. See
44- # https://github.com/actions/runner-images/issues/6106
45- if [ ! -z " $SUDO " ] && ! " $SUDO " -u nobody test -x ~ ; then
46- echo ~ is not executable by nobody, adding perms.
47- chmod go+x ~
39+ if [ ! -z " $SUDO " ]; then
40+ # Ubuntu 22.04 defaults to private home dirs which prevent the
41+ # agent-getpeerid test from running ssh-add as nobody. See
42+ # https://github.com/actions/runner-images/issues/6106
43+ if ! " $SUDO " -u nobody test -x ~ ; then
44+ echo ~ is not executable by nobody, adding perms.
45+ chmod go+x ~
46+ fi
47+ # Some of the Mac OS X runners don't have a nopasswd sudo rule. Regular
48+ # sudo still works, but sudo -u doesn't. Restore the sudo rule.
49+ if ! " $SUDO " grep -E ' runner.*NOPASSWD' /etc/passwd > /dev/null; then
50+ echo " Restoring runner nopasswd rule to sudoers."
51+ echo ' runner ALL=(ALL) NOPASSWD: ALL' | $SUDO tee -a /etc/sudoers
52+ fi
53+ if ! " $SUDO " -u nobody -S test -x ~ < /dev/null; then
54+ echo " Still can't sudo to nobody."
55+ exit 1
56+ fi
4857fi
4958
5059if [ " ${TARGETS} " = " kitchensink" ]; then
@@ -58,6 +67,7 @@ for flag in $CONFIGFLAGS; do
5867 esac
5968done
6069
70+ echo " Setting up for '$TARGETS '"
6171for TARGET in $TARGETS ; do
6272 case $TARGET in
6373 default|without-openssl|without-zlib|c89)
@@ -88,8 +98,9 @@ for TARGET in $TARGETS; do
8898 esac
8999 ;;
90100 * pam)
91- # COPY_PAM_MODULE="yes"
92- PACKAGES=" $PACKAGES libpam0g-dev"
101+ case " $PACKAGER " in
102+ apt) PACKAGES=" $PACKAGES libpam0g-dev" ;;
103+ esac
93104 ;;
94105 sk)
95106 INSTALL_FIDO_PPA=" yes"
@@ -118,15 +129,15 @@ for TARGET in $TARGETS; do
118129 1.* ) INSTALL_OPENSSL=" OpenSSL_$( echo ${INSTALL_OPENSSL} | tr . _) " ;;
119130 3.* ) INSTALL_OPENSSL=" openssl-${INSTALL_OPENSSL} " ;;
120131 esac
121- PACKAGES=" ${PACKAGES} putty-tools"
132+ PACKAGES=" ${PACKAGES} putty-tools dropbear-bin "
122133 ;;
123134 libressl-* )
124135 INSTALL_LIBRESSL=$( echo ${TARGET} | cut -f2 -d-)
125136 case ${INSTALL_LIBRESSL} in
126137 master) ;;
127138 * ) INSTALL_LIBRESSL=" $( echo ${TARGET} | cut -f2 -d-) " ;;
128139 esac
129- PACKAGES=" ${PACKAGES} putty-tools"
140+ PACKAGES=" ${PACKAGES} putty-tools dropbear-bin "
130141 ;;
131142 boringssl)
132143 INSTALL_BORINGSSL=1
@@ -166,6 +177,13 @@ while [ ! -z "$PACKAGES" ] && [ "$tries" -gt "0" ]; do
166177 PACKAGES=" "
167178 fi
168179 ;;
180+ brew)
181+ if [ ! -z " PACKAGES" ]; then
182+ if brew install $PACKAGES ; then
183+ PACKAGES=" "
184+ fi
185+ fi
186+ ;;
169187 setup)
170188 if /cygdrive/c/setup.exe -q -P ` echo " $PACKAGES " | tr ' ' ,` ; then
171189 PACKAGES=" "
@@ -186,7 +204,7 @@ if [ "${INSTALL_HARDENED_MALLOC}" = "yes" ]; then
186204 (cd ${HOME} &&
187205 git clone https://github.com/GrapheneOS/hardened_malloc.git &&
188206 cd ${HOME} /hardened_malloc &&
189- make -j2 && sudo cp out/libhardened_malloc.so /usr/lib/)
207+ make && sudo cp out/libhardened_malloc.so /usr/lib/)
190208fi
191209
192210if [ ! -z " ${INSTALL_OPENSSL} " ]; then
@@ -207,14 +225,14 @@ if [ ! -z "${INSTALL_LIBRESSL}" ]; then
207225 git checkout ${INSTALL_LIBRESSL} &&
208226 sh update.sh && sh autogen.sh &&
209227 ./configure --prefix=/opt/libressl &&
210- make -j2 && sudo make install)
228+ make && sudo make install)
211229 else
212230 LIBRESSL_URLBASE=https://cdn.openbsd.org/pub/OpenBSD/LibreSSL
213231 (cd ${HOME} &&
214232 wget ${LIBRESSL_URLBASE} /libressl-${INSTALL_LIBRESSL} .tar.gz &&
215233 tar xfz libressl-${INSTALL_LIBRESSL} .tar.gz &&
216234 cd libressl-${INSTALL_LIBRESSL} &&
217- ./configure --prefix=/opt/libressl && make -j2 && sudo make install)
235+ ./configure --prefix=/opt/libressl && make && sudo make install)
218236 fi
219237fi
220238
0 commit comments