From 6a4cd64dc52e28c89d9216a2b88210a106bf67fe Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Thu, 5 Dec 2019 10:04:54 -0500 Subject: [PATCH] coreos-boot-mount-generator: key off of /etc/fstab Just look at `/etc/fstab` for `/boot` mounts to determine whether to generate them ourselves or let the `systemd-fstab-generator` do it. The `grep` stuff here is a bit gory but it should work for our purposes. The next step up would be actually parsing it using the appropriate APIs in a compiled language. See also: https://github.com/coreos/fedora-coreos-tracker/issues/322 --- .../system-generators/coreos-boot-mount-generator | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/overlay.d/05core/usr/lib/systemd/system-generators/coreos-boot-mount-generator b/overlay.d/05core/usr/lib/systemd/system-generators/coreos-boot-mount-generator index 46c14a39d4..a5a85aa2d9 100755 --- a/overlay.d/05core/usr/lib/systemd/system-generators/coreos-boot-mount-generator +++ b/overlay.d/05core/usr/lib/systemd/system-generators/coreos-boot-mount-generator @@ -11,11 +11,10 @@ add_wants() { ln -sf "../${name}" "${wants_dir}/${name}" } -# 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. In -# that case, we don't want to overwrite what the systemd-fstab-generator -# will do. -if ! [ -f /sysroot/.coreos-aleph-version.json ]; then +# If there's already an /etc/fstab entries for /boot, then this is is a non-FCOS +# system, likely RHCOS pre-4.3 (which still used Anaconda). In that case, we +# don't want to overwrite what the systemd-fstab-generator will do. +if grep '^#' -v /etc/fstab | cut -d' ' -f2 | grep -q /boot; then exit 0 fi