Fix dracut service install

Signed-off-by: Itxaka <itxaka@spectrocloud.com>
This commit is contained in:
Itxaka 2023-02-06 21:45:01 +01:00
parent 66aa6627f7
commit 14e0faacee
3 changed files with 3 additions and 26 deletions

View File

@ -78,7 +78,7 @@ build-dracut:
RUN rm /etc/dracut.conf.d/02-cos-immutable-rootfs.conf
END
RUN kernel=$(ls /lib/modules | head -n1) && \
dracut -f "/boot/initrd-${kernel}" "${kernel}" && \
dracut -v -f "/boot/initrd-${kernel}" "${kernel}" && \
ln -sf "initrd-${kernel}" /boot/initrd
ARG INITRD=$(readlink -f /boot/initrd)
SAVE ARTIFACT $INITRD Initrd AS LOCAL build/initrd-$VERSION

View File

@ -7,8 +7,6 @@ GENERATOR_DIR="$2"
[ -z "$GENERATOR_DIR" ] && exit 1
[ -d "$GENERATOR_DIR" ] || mkdir "$GENERATOR_DIR"
oem_label=$(getarg rd.cos.oemlabel=)
# See https://github.com/kairos-io/packages/blob/d12b12b043a71d8471454f7b4fc84c3181d2bf60/packages/system/dracut/immutable-rootfs/30cos-immutable-rootfs/cos-generator.sh#L29
{
echo "[Unit]"
@ -16,18 +14,6 @@ oem_label=$(getarg rd.cos.oemlabel=)
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"
echo "Description=immucore online mount"
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=initrd-root-fs.target cos-setup-rootfs.service"
echo "[Service]"
echo "Type=oneshot"

View File

@ -23,18 +23,9 @@ 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 \
immucore elemental
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"
inst_multiple immucore elemental
inst_script "${moddir}/generator.sh" "${systemdutildir}/system-generators/immucore-generator"
dracut_need_initqueue
}