-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbootstrap-sudo-linux-arch
executable file
·46 lines (38 loc) · 1.18 KB
/
bootstrap-sudo-linux-arch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
set -euo pipefail
YP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." >/dev/null && pwd)"
source ${YP_DIR}/sh/common.inc.sh
source ${YP_DIR}/sh/package-managers/pacman.inc.sh
if [[ "${EUID}" != "0" ]]; then
echo_info "EUID=${EUID}"
[[ -n "${YP_SUDO}" ]] || {
echo_info "YP_SUDO=${YP_SUDO}"
echo_err "Restarting this shell script as root is impossible."
exit 1
}
echo_warn "Restarting this shell script as root."
exe ${YP_SUDO} --preserve-env --set-home ${BASH_SOURCE[0]}
exit 0
fi
# keep in sync with dockerfiles/yp-arch/Dockerfile.build.sh
echo_do "Setup pacman..."
pacman_update
pacman_install_one ca-certificates
pacman_install_one gnupg
pacman_install_one git
pacman_install_one openssh
pacman_install_one openssl
pacman_install_one sudo
pacman_install_one which
echo_done
# Basic
echo_do "pacman: Installing basic packages..."
pacman_install_one base-devel # as per homebrew-install
pacman_install_one coreutils
pacman_install_one inetutils
# see https://github.com/Homebrew/homebrew-portable-ruby/issues/147
pacman_install_one libxcrypt-compat
pacman_install_one util-linux
pacman_install_one python3
echo_done
pacman_list_installed