Skip to content

Commit

Permalink
overlay: 40ignition-ostree: make ignition-ostree-transposefs tolerant…
Browse files Browse the repository at this point in the history
… to debug kernels

It appears that on debug kernels the "/dev/disk/by-label/$label" device *can* not
appear at all (some sort of race condition) and thus calling `realpath` on it will
fail. Let's just make the call to `realpath` not be fatal so we can workaround this
issue that has been around in the kernel for some time.

Closes coreos/fedora-coreos-tracker#1092
  • Loading branch information
dustymabe committed Mar 21, 2022
1 parent ec96e60 commit f67dec6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ udev_trigger_on_label_mismatch() {
local expected_dev=$1; shift
local actual_dev
expected_dev=$(realpath "${expected_dev}")
actual_dev=$(realpath "/dev/disk/by-label/$label")
# We `|| :` here because sometimes /dev/disk/by-label/$label is missing.
# We've seen this on Fedora kernels with debug enabled (common in `rawhide`).
# See https://github.com/coreos/fedora-coreos-tracker/issues/1092
actual_dev=$(realpath "/dev/disk/by-label/$label" || :)
if [ "$actual_dev" != "$expected_dev" ]; then
echo "Expected /dev/disk/by-label/$label to point to $expected_dev, but points to $actual_dev; triggering udev"
udevadm trigger --settle "$expected_dev"
Expand Down

0 comments on commit f67dec6

Please sign in to comment.