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 "[Unit]"
echo "DefaultDependencies=no" echo "DefaultDependencies=no"
echo "Before=cos-immutable-rootfs.service" echo "Before=initrd-fs.target"
echo "Conflicts=initrd-switch-root.target" echo "Conflicts=initrd-switch-root.target"
echo "Requires=initrd-root-fs.target"
if getargbool 0 rd.neednet; then if getargbool 0 rd.neednet; then
echo "Wants=network-online.target" echo "Wants=network-online.target"
echo "After=network-online.target" echo "After=network-online.target"
@ -22,15 +23,16 @@ oem_label=$(getarg rd.cos.oemlabel=)
else else
echo "Description=immucore mount" echo "Description=immucore mount"
fi 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 # 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 #if [ -n "${oem_label}" ]; then
echo "After=oem.mount" # echo "After=oem.mount"
fi #fi
echo "After=sysroot.mount" echo "After=initrd-root-fs.target cos-setup-rootfs.service"
echo "[Service]" echo "[Service]"
echo "Type=oneshot" echo "Type=oneshot"
echo "RemainAfterExit=yes" echo "RemainAfterExit=yes"
echo "ExecStart=/usr/bin/immucore start --dry-run" echo "ExecStart=/usr/bin/immucore start"
} > "$GENERATOR_DIR"/immucore.service } > "$GENERATOR_DIR"/immucore.service

View File

@ -23,6 +23,7 @@ install() {
declare moddir=${moddir} declare moddir=${moddir}
declare systemdutildir=${systemdutildir} declare systemdutildir=${systemdutildir}
declare systemdsystemunitdir=${systemdsystemunitdir} 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 # Add missing elemental binary, drop once we get yip lib inside immucore as its only needed to run the stages
inst_multiple \ inst_multiple \
@ -31,5 +32,9 @@ install() {
inst_script "${moddir}/generator.sh" \ inst_script "${moddir}/generator.sh" \
"${systemdutildir}/system-generators/immucore-generator" "${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 dracut_need_initqueue
} }