From 97ccd3d9628cd9e1614e8e0d0d1bd5d659e53fd8 Mon Sep 17 00:00:00 2001 From: emacdona Date: Thu, 15 Dec 2022 11:56:55 -0500 Subject: [PATCH] Fix bug in recent worker_reserved.conf handling The new TEMPLATE_FILE and TARGET_FILE is out of scope for work installs. Test Plan: PASS: Verify worker only install Closes-Bug: 1999561 Signed-off-by: emacdona Change-Id: Id6ce9e773a208637a32d355e6a0bfb3745437eaa --- kickstart/files/kickstart.cfg | 10 ++++++++-- kickstart/files/miniboot.cfg | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/kickstart/files/kickstart.cfg b/kickstart/files/kickstart.cfg index 22515fd5..8e1e5510 100644 --- a/kickstart/files/kickstart.cfg +++ b/kickstart/files/kickstart.cfg @@ -2352,6 +2352,8 @@ fi ###################################################################### # From post_system_aio ###################################################################### +TEMPLATE_FILE="/usr/share/worker-utils/config/worker_reserved.conf" +TARGET_FILE="/etc/platform/worker_reserved.conf" if [ "${aio}" = true ] ; then ## Reserve more memory for base processes since the controller has higher @@ -2377,8 +2379,6 @@ if [ "${aio}" = true ] ; then # Normally we would set personality based files later # But we need to copy worker_reserved.conf now since it needs to be modified for AIO ilog "${SYSTEM_TYPE__AIO} Reserved Memory: ${RESERVEDMEM}" - TEMPLATE_FILE="/usr/share/worker-utils/config/worker_reserved.conf" - TARGET_FILE="/etc/platform/worker_reserved.conf" if [ ! -e "${TEMPLATE_FILE}" ] ; then report_failure_with_msg "Cannot configure worker cpu/memory ; missing ${TEMPLATE_FILE}" fi @@ -2403,7 +2403,13 @@ elif [ "${worker}" = true ] ; then # Keep logic contained and copy worker_reserved.conf now since we need # to do the copy for AIO above ilog "Enable ${TARGET_FILE} for ${TRAIT__WORKER}" + if [ ! -e "${TEMPLATE_FILE}" ] ; then + report_failure_with_msg "Cannot configure worker cpu/memory ; missing ${TEMPLATE_FILE}" + fi cp "${TEMPLATE_FILE}" "${TARGET_FILE}" + if [ ! -e "${TARGET_FILE}" ] ; then + report_failure_with_msg "Cannot configure worker cpu/memory ; missing ${TARGET_FILE}" + fi fi true diff --git a/kickstart/files/miniboot.cfg b/kickstart/files/miniboot.cfg index bfea210e..1e172f61 100644 --- a/kickstart/files/miniboot.cfg +++ b/kickstart/files/miniboot.cfg @@ -2516,6 +2516,8 @@ fi ###################################################################### # From post_system_aio ###################################################################### +TEMPLATE_FILE="/usr/share/worker-utils/config/worker_reserved.conf" +TARGET_FILE="/etc/platform/worker_reserved.conf" if [ "${aio}" = true ] ; then ## Reserve more memory for base processes since the controller has higher @@ -2541,8 +2543,6 @@ if [ "${aio}" = true ] ; then # Normally we would set personality based files later # But we need to copy worker_reserved.conf now since it needs to be modified for AIO ilog "${SYSTEM_TYPE__AIO} Reserved Memory: ${RESERVEDMEM}" - TEMPLATE_FILE="/usr/share/worker-utils/config/worker_reserved.conf" - TARGET_FILE="/etc/platform/worker_reserved.conf" if [ ! -e "${TEMPLATE_FILE}" ] ; then report_failure_with_msg "Cannot configure worker cpu/memory ; missing ${TEMPLATE_FILE}" fi @@ -2567,7 +2567,13 @@ elif [ "${worker}" = true ] ; then # Keep logic contained and copy worker_reserved.conf now since we need # to do the copy for AIO above ilog "Enable ${TARGET_FILE} for ${TRAIT__WORKER}" + if [ ! -e "${TEMPLATE_FILE}" ] ; then + report_failure_with_msg "Cannot configure worker cpu/memory ; missing ${TEMPLATE_FILE}" + fi cp "${TEMPLATE_FILE}" "${TARGET_FILE}" + if [ ! -e "${TARGET_FILE}" ] ; then + report_failure_with_msg "Cannot configure worker cpu/memory ; missing ${TARGET_FILE}" + fi fi true