From a2734f6793edf0d7623f9678b2855c72397f94c0 Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Sun, 20 Jun 2021 11:49:54 +0700 Subject: [PATCH] Workaround ostree remount bug https://github.com/coreos/fedora-coreos-tracker/issues/870 https://github.com/coreos/fedora-coreos-tracker/issues/746#issuecomment-779015192 --- .../templates/http/ignition/ignition.yaml.j2 | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/metal/roles/pxe-server/templates/http/ignition/ignition.yaml.j2 b/metal/roles/pxe-server/templates/http/ignition/ignition.yaml.j2 index 5754499e..fa22a7f9 100644 --- a/metal/roles/pxe-server/templates/http/ignition/ignition.yaml.j2 +++ b/metal/roles/pxe-server/templates/http/ignition/ignition.yaml.j2 @@ -44,6 +44,36 @@ systemd: # iSCSI for Longhorn distributed block storage - name: iscsid.service enabled: true + # TODO (bug) ostree-remount bug workaround + - name: ostree-remount.service + enabled: true + contents: | + [Unit] + Description=OSTree Remount OS/ Bind Mounts + Documentation=man:ostree(1) + DefaultDependencies=no + ConditionKernelCommandLine=ostree + OnFailure=emergency.target + Conflicts=umount.target + # Run after core mounts + After=-.mount var.mount + After=systemd-remount-fs.service + # But we run *before* most other core bootup services that need write access to /etc and /var + Before=local-fs.target umount.target + Before=systemd-random-seed.service plymouth-read-write.service systemd-journal-flush.service + Before=systemd-tmpfiles-setup.service + + [Service] + Type=oneshot + RemainAfterExit=yes + ExecStartPre=/usr/bin/sleep 10 + ExecStart=/usr/lib/ostree/ostree-remount + StandardInput=null + StandardOutput=journal + StandardError=journal+console + + [Install] + WantedBy=local-fs.target {% if item == "metal0" %} # Terraform state backend - name: tfstate.service