install.sh: support install on Flatcar with no args (#2551)

* install.sh: test if BIN_DIR is readonly, else use /opt

On flatcar /usr is a readonly partition, while /opt is allowed for
writing.

Signed-off-by: Vincent Batts <vbatts@kinvolk.io>

* install.sh: only warn on Flatcar about selinux

This check is a bit more explicit, but only warn about finding the rpm
installed policy when on Flatcar Container Linux

Signed-off-by: Vincent Batts <vbatts@kinvolk.io>

* Update install.sh

Co-authored-by: Brad Davidson <brad@oatmail.org>
Signed-off-by: Vincent Batts <vbatts@kinvolk.io>

Co-authored-by: Brad Davidson <brad@oatmail.org>
pull/2638/head
Vincent Batts 4 years ago committed by GitHub
parent e43a9096b8
commit eb3e4c154c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -224,7 +224,9 @@ setup_env() {
if [ -n "${INSTALL_K3S_BIN_DIR}" ]; then if [ -n "${INSTALL_K3S_BIN_DIR}" ]; then
BIN_DIR=${INSTALL_K3S_BIN_DIR} BIN_DIR=${INSTALL_K3S_BIN_DIR}
else else
# --- use /usr/local/bin if we can write to it, otherwise try /opt
BIN_DIR=/usr/local/bin BIN_DIR=/usr/local/bin
touch ${BIN_DIR}/k3s-ro-test 2>/dev/null && rm -rf ${BIN_DIR}/k3s-ro-test || BIN_DIR=/opt/bin
fi fi
# --- use systemd directory if defined or create default --- # --- use systemd directory if defined or create default ---
@ -454,7 +456,7 @@ setup_selinux() {
yum install -y https://${rpm_site}/k3s/${rpm_channel}/common/centos/7/noarch/k3s-selinux-0.2-1.el7_8.noarch.rpm yum install -y https://${rpm_site}/k3s/${rpm_channel}/common/centos/7/noarch/k3s-selinux-0.2-1.el7_8.noarch.rpm
" "
policy_error=fatal policy_error=fatal
if [ "$INSTALL_K3S_SELINUX_WARN" = true ]; then if [ "$INSTALL_K3S_SELINUX_WARN" = true ] || grep -q 'ID=flatcar' /etc/os-release; then
policy_error=warn policy_error=warn
fi fi

Loading…
Cancel
Save