Skip to content

Commit aa1d883

Browse files
committed
Update tuned profile path for EL10
1 parent e890efe commit aa1d883

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

el_configurator.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -678,10 +678,15 @@ EOF
678678
if [ "${CONFIGURE_TUNED}" != false ]; then
679679
log "Setting up tuned profiles"
680680

681-
[ ! -d /etc/tuned/el-eco ] && mkdir /etc/tuned/el-eco
682-
[ ! -d /etc/tuned/el-perf ]&& mkdir /etc/tuned/el-perf
681+
if [ "${RELEASE}" -eq 10 ]; then
682+
TUNED_DIR=/etc/tuned/profiles
683+
else
684+
TUNED_DIR=/etc/tuned
685+
fi
686+
[ ! -d "${TUNED_DIR}/el-eco" ] && mkdir -p "${TUNED_DIR}/el-eco"
687+
[ ! -d "${TUNED_DIR}/el-eco" ]&& mkdir -p "${TUNED_DIR}/el-perf"
683688

684-
cat << 'EOF' > /etc/tuned/el-eco/tuned.conf
689+
cat << 'EOF' > "${TUNED_DIR}/el-eco/tuned.conf"
685690
[main]
686691
summary=EL NetPerfect Powersaver
687692
include=powersave
@@ -721,9 +726,9 @@ vm.dirty_writeback_centisecs = 100
721726
#script=\${i:PROFILE_DIR}/script.sh
722727
script=script.sh
723728
EOF
724-
[ $? -ne 0 ] && log "Failed to create /etc/tuned/el-eco/tuned.conf" "ERROR"
729+
[ $? -ne 0 ] && log "Failed to create ${TUNED_DIR}/el-eco/tuned.conf" "ERROR"
725730

726-
cat << 'EOF' > /etc/tuned/el-perf/tuned.conf
731+
cat << 'EOF' > "${TUNED_DIR}/el-perf/tuned.conf"
727732
[main]
728733
summary=EL NetPerfect Performance
729734
include=network-latency
@@ -763,9 +768,9 @@ vm.dirty_writeback_centisecs = 100
763768
#script=\${i:PROFILE_DIR}/script.sh
764769
script=script.sh
765770
EOF
766-
[ $? -ne 0 ] && log "Failed to create /etc/tuned/el-perf/tuned.conf" "ERROR"
771+
[ $? -ne 0 ] && log "Failed to create ${TUNED_DIR}/el-perf/tuned.conf" "ERROR"
767772

768-
cat << 'EOF' > /etc/tuned/el-eco/script.sh
773+
cat << 'EOF' > "${TUNED_DIR}/el-eco/script.sh"
769774
#!/usr/bin/env bash
770775
771776
SCRIPT_VER=2024040701
@@ -801,9 +806,9 @@ cpupower idle-set -E
801806
# Disable any higher than 50ns latency idle states
802807
cpupower idle-set -D 50
803808
EOF
804-
[ $? -ne 0 ] && log "Failed to create /etc/tuned/el-eco/script.sh" "ERROR"
809+
[ $? -ne 0 ] && log "Failed to create ${TUNED_DIR}/el-eco/script.sh" "ERROR"
805810

806-
cat << 'EOF' > /etc/tuned/el-perf/script.sh
811+
cat << 'EOF' > "${TUNED_DIR}/el-perf/script.sh"
807812
#!/usr/bin/env bash
808813
809814
SCRIPT_VER=2024040701
@@ -835,7 +840,7 @@ cpupower idle-set -E
835840
# Disable any higher than 50ns latency idle states
836841
cpupower idle-set -D 50
837842
EOF
838-
[ $? -ne 0 ] && log "Failed to create /etc/tuned/el-perf/script.sh" "ERROR"
843+
[ $? -ne 0 ] && log "Failed to create ${TUNED_DIR}/el-perf/script.sh" "ERROR"
839844

840845
chmod +x /etc/tuned/{el-eco,el-perf}/script.sh 2>> "${LOG_FILE}" || log "Failed to chmod on tuned scripts" "ERROR"
841846
fi
@@ -1100,6 +1105,7 @@ if [ "${ALLOW_SUDO}" = true ] && [ "${SCAP_PROFILE}" != false ]; then
11001105
sed -i 's/^Defaults noexec/#Defaults noexec/g' /etc/sudoers 2>> "${LOG_FILE}" || log "Failed to sed /etc/sudoers" "ERROR"
11011106
if [ "${FLAVOR}" = "rhel" ]; then
11021107
dnf install -y sudo 2>> "${LOG_FILE}" || log "Failed to install sudo" "ERROR"
1108+
# chmod 4111 /usr/bin/sudo is not needed on RHEL normally
11031109
elif [ "${FLAVOR}" = "debian" ]; then
11041110
apt install -y sudo 2>> "${LOG_FILE}" || log "Failed to install sudo" "ERROR"
11051111
chmod 4755 /usr/bin/sudo 2>> "${LOG_FILE}" || log "Failed to chmod /usr/bin/sudo" "ERROR"

0 commit comments

Comments
 (0)