[rhcos-4.9] buildextend-live: fix /run/media/iso
mount flake booting from disk
#2460
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When booting the RHCOS live ISO image from a USB stick or other disk device, boot sometimes fails with the following error:
35coreos-live/live-generator
createsrun-media-iso.mount
, which mounts the ISO from/dev/disk/by-label/rhcos-<version>
. The latter should point to/dev/sda1
, but in this case it's pointing to/dev/sda2
, which isefiboot.img
./dev/sda2
does not have a filesystem label, but because of systemd/systemd#14408,60-persistent-storage.rules
falls back to using the filesystem label from/dev/sda
(the whole-disk device) when evaluating symlinks for/dev/sda2
. As a result,/dev/sda1
and/dev/sda2
race to own the/dev/disk/by-label
symlink, and ifsda2
wins, the mount fails.CD and virtual CD boot are not affected because CD-ROM devices are not partitionable. FCOS is not affected because the udev rules on FCOS include systemd/systemd#14485.
Fix the race by giving
efiboot.img
its own filesystem label, preventing the buggy udev rules from reusing the label from the ISO 9660 filesystem. This seems like a reasonable thing to do anyway (the non-live images label the ESP asEFI-SYSTEM
) and it's free.Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2007089. Backports #2458.