Skip to content

Commit

Permalink
overlay: Tweak coreos-boot-mount-generator to deal with older RHCOS
Browse files Browse the repository at this point in the history
I was debugging a customer's test system that was installed as
OpenShift 4.2 and then upgraded, and noticed rpm-ostreed wasn't
starting on reboot, which was because `/boot` wasn't mounted,
which was because the `systemd-fstab-generator` and this code
had actually raced and generated a corrupted `/run/systemd/boot.mount`.

Tweak this code so it cleanly exits and defers to systemd-fstab-generator
for RHCOS-4.2 or older systems.
  • Loading branch information
cgwalters committed Nov 6, 2019
1 parent 22fc6e4 commit 53d83f8
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ add_wants() {
ln -sf "../${name}" "${wants_dir}/${name}"
}

# We shouldn't overwrite what the systemd-fstab-generator
# does for Anaconda-installed RHEL CoreOS systems.
if [ -f /etc/fstab ]; then
if grep -q 'Created by anaconda' /etc/fstab; then
exit 0
fi
fi
# A similar redundant check - if there's no aleph version
# from https://github.com/coreos/coreos-assembler/pull/768
# then this is a non-FCOS system, likely RHCOS pre-4.3.
if ! [ -f /sysroot/.coreos-aleph-version.json ]; then
exit 0
fi

# Don't create mount units for /boot or /boot/efi on live systems.
# ConditionPathExists won't work here because conditions don't affect
# the dependency on the underlying device unit.
Expand Down

0 comments on commit 53d83f8

Please sign in to comment.