debian: Centrally manage pre-start services

Based on personality trait decided by the user
when kickstart is run pre-set the services that
are started at boot time.

On CentOS we installed personality based packages
on specific personality type nodes.
On Debian selecting what is needed for personality
based packages is done at runtime.

Test Plan
PASS Build platform-kickstarts package
PASS Boot ISO
PASS Check for /etc/systemd/system-preset/10-aio.preset
PASS Bootstrap node
PASS Unlock node

Story: 2009968
Task: 46406

Signed-off-by: Charles Short <charles.short@windriver.com>
Change-Id: Icbd9285a4d2ae33c9f0e4fadef7771b7697f871d
This commit is contained in:
Charles Short 2022-08-25 13:46:28 -04:00 committed by Bob Church
parent 5ead1baa2a
commit 82b94b15c9
1 changed files with 20 additions and 0 deletions

View File

@ -1594,15 +1594,31 @@ if [ "${aio}" = true ] ; then
ilog "${SYSTEM_TYPE__AIO} System"
system_type="${SYSTEM_TYPE__AIO}"
subfunction="${SUBFUNCTION__AIO}"
if [ "${lowlatency}" = true ] ; then
ilog "Setting aio lowlatency"
ln -s /usr/share/systemd-presets/lowlatency.preset /etc/systemd/system-preset/10-aio.preset
else
ln -s /usr/share/systemd-presets/aio.preset /etc/systemd/system-preset/10-aio.preset
fi
else
ilog "${SYSTEM_TYPE__STANDARD} System"
system_type="${SYSTEM_TYPE__STANDARD}"
if [ "${worker}" = true ] ; then
subfunction=${SUBFUNCTION__WORKER}
if [ "${lowlatency}" = true ] ; then
ilog "Setting ${SUBFUNCTION__WORKER} lowlatency"
ln -s /usr/share/systemd-presets/worker-lowlatency.preset /etc/systemd/system-preset/10-${SUBFUNCTION__WORKER}.preset
else
ln -s /usr/share/systemd-presets/worker.preset /etc/systemd/system-preset/10-${SUBFUNCTION__WORKER}.preset
fi
elif [ "${storage}" = true ] ; then
subfunction=${SUBFUNCTION__STORAGE}
ilog "Setting ${SUBFUNCTION__STORAGE} preset"
ln -s /usr/share/systemd-presets/storage.preset /etc/systemd/system-preset/10-${SUBFUNCTION__STORAGE}.preset
else
subfunction=${SUBFUNCTION__CONTROLLER}
ilog "Setting ${SUBFUNCTION__CONTROLLER} preset"
ln -s /usr/share/systemd-presets/controller.preset /etc/systemd/system-preset/10-${SUBFUNCTION__CONTROLLER}.preset
fi
fi
@ -1627,6 +1643,10 @@ subfunction=${subfunction}
system_type=${system_type}
EOF
ilog "Create systemd presets and set personality traits"
systemctl daemon-reload
systemctl --preset-mode=full preset-all
##############################################################
# From post_pxeboot_controller
# From post_net_common.cfg