diff options
author | Todd Malsbary <todd.malsbary@intel.com> | 2021-03-12 13:48:25 -0800 |
---|---|---|
committer | Todd Malsbary <todd.malsbary@intel.com> | 2021-05-04 13:02:48 -0700 |
commit | 61fda160a7ba656f73a0a89cca4d3f5fd8e575d4 (patch) | |
tree | 40fb6d319ece6a68d46427966401d98fadeee80e /kud/deployment_infra/installers/_common.sh | |
parent | c7cc63c3e76d5739c67314008b01f6fe70289641 (diff) |
Add sriov-network-operator addon helm chart
This chart contains the upstream sriov-network-operator from
k8snetworkplumbingwg together with an iavf driver installer.
Issue-ID: MULTICLOUD-1324
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: Ic925c66f8e2b28b7604240c3ed35b1a56883b60b
Diffstat (limited to 'kud/deployment_infra/installers/_common.sh')
-rw-r--r-- | kud/deployment_infra/installers/_common.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/kud/deployment_infra/installers/_common.sh b/kud/deployment_infra/installers/_common.sh new file mode 100644 index 00000000..87badfc9 --- /dev/null +++ b/kud/deployment_infra/installers/_common.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +set -o errexit +set -o pipefail +set -u + +ROOT_MOUNT_DIR="${ROOT_MOUNT_DIR:-/root}" +ROOT_OS_RELEASE="${ROOT_OS_RELEASE:-$ROOT_MOUNT_DIR/etc/os-release}" +KERNEL_SRC_DIR=$(readlink -f "${ROOT_MOUNT_DIR}/lib/modules/$(uname -r)/build") +[[ "${KERNEL_SRC_DIR}" == "${ROOT_MOUNT_DIR}/*" ]] || KERNEL_SRC_DIR="${ROOT_MOUNT_DIR}${KERNEL_SRC_DIR}" +KERNEL_MOD_SIGN_CMD="${KERNEL_MOD_SIGN_CMD:-}" + +RETCODE_SUCCESS=0 +RETCODE_ERROR=1 + +_log() { + local -r prefix="$1" + shift + echo "[${prefix}$(date -u "+%Y-%m-%d %H:%M:%S %Z")] ""$*" >&2 +} + +info() { + _log "INFO " "$*" +} + +warn() { + _log "WARNING " "$*" +} + +error() { + _log "ERROR " "$*" +} + +load_etc_os_release() { + if [[ ! -f "${ROOT_OS_RELEASE}" ]]; then + error "File ${ROOT_OS_RELEASE} not found, /etc/os-release from host must be mounted" + exit ${RETCODE_ERROR} + fi + . "${ROOT_OS_RELEASE}" + info "Running on ${NAME} kernel version $(uname -r)" +} |