Service files fixes

Signed-off-by: Itxaka <itxaka@spectrocloud.com>
This commit is contained in:
Itxaka 2023-02-06 18:10:48 +01:00
parent 41b1baf17b
commit e8750e527b
2 changed files with 13 additions and 6 deletions

View File

@ -13,8 +13,9 @@ oem_label=$(getarg rd.cos.oemlabel=)
{
echo "[Unit]"
echo "DefaultDependencies=no"
echo "Before=cos-immutable-rootfs.service"
echo "Before=initrd-fs.target"
echo "Conflicts=initrd-switch-root.target"
echo "Requires=initrd-root-fs.target"
if getargbool 0 rd.neednet; then
echo "Wants=network-online.target"
echo "After=network-online.target"
@ -22,15 +23,16 @@ oem_label=$(getarg rd.cos.oemlabel=)
else
echo "Description=immucore mount"
fi
# Itxaka: oem is mounted by immucore?
# OEM is special as immucore plugins might need that in order to unlock other partitions and plugins can reside in /oem as well and immucore needs to find them
if [ -n "${oem_label}" ]; then
echo "After=oem.mount"
fi
echo "After=sysroot.mount"
#if [ -n "${oem_label}" ]; then
# echo "After=oem.mount"
#fi
echo "After=initrd-root-fs.target cos-setup-rootfs.service"
echo "[Service]"
echo "Type=oneshot"
echo "RemainAfterExit=yes"
echo "ExecStart=/usr/bin/immucore start --dry-run"
echo "ExecStart=/usr/bin/immucore start"
} > "$GENERATOR_DIR"/immucore.service

View File

@ -23,6 +23,7 @@ install() {
declare moddir=${moddir}
declare systemdutildir=${systemdutildir}
declare systemdsystemunitdir=${systemdsystemunitdir}
declare initdir="${initdir}"
# Add missing elemental binary, drop once we get yip lib inside immucore as its only needed to run the stages
inst_multiple \
@ -31,5 +32,9 @@ install() {
inst_script "${moddir}/generator.sh" \
"${systemdutildir}/system-generators/immucore-generator"
mkdir -p "${initdir}/${systemdsystemunitdir}/initrd-fs.target.requires"
ln_r "../immucore.service" \
"${systemdsystemunitdir}/initrd-fs.target.requires/immucore.service"
dracut_need_initqueue
}