Skip to content

Commit

Permalink
coreos-boot-mount-generator: key off of /etc/fstab
Browse files Browse the repository at this point in the history
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: coreos/fedora-coreos-tracker#322
  • Loading branch information
jlebon committed Dec 5, 2019
1 parent b06633e commit 6a4cd64
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6a4cd64

Please sign in to comment.