2023-08-28 06:44:38 +02:00
|
|
|
#!/bin/bash
|
|
|
|
# Copyright (C) 2019 Intel Corporation
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
set -xe
|
|
|
|
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
|
|
|
|
source "$SCRIPT_DIR"/globals.sh
|
|
|
|
source "$SCRIPT_DIR"/parameters.sh
|
|
|
|
|
2023-08-31 07:08:05 +02:00
|
|
|
# Install nfs-utils
|
|
|
|
dnf install -y nfs-utils
|
|
|
|
|
2023-08-31 04:28:25 +02:00
|
|
|
KOJI_MOUNT_SERVICE="${KOJI_DIR:1}"
|
2023-08-28 06:44:38 +02:00
|
|
|
KOJI_MOUNT_SERVICE="${KOJI_MOUNT_SERVICE/\//-}".mount
|
|
|
|
mkdir -p /etc/systemd/system
|
|
|
|
cat > /etc/systemd/system/"$KOJI_MOUNT_SERVICE" <<- EOF
|
|
|
|
[Unit]
|
|
|
|
Description=Koji NFS Mount
|
|
|
|
After=network.target
|
|
|
|
|
|
|
|
[Mount]
|
2023-09-01 00:53:11 +02:00
|
|
|
What=$KOJI_HUB_FQDN:$KOJI_DIR
|
2023-08-31 04:28:25 +02:00
|
|
|
Where=$KOJI_DIR
|
2023-08-28 06:44:38 +02:00
|
|
|
Type=nfs
|
|
|
|
Options=defaults,ro
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
EOF
|
|
|
|
systemctl daemon-reload
|
|
|
|
systemctl enable --now "$KOJI_MOUNT_SERVICE"
|