Skip to content

Commit

Permalink
40ignition-ostree: skip udev hack if Ignition did not reprovision rootfs
Browse files Browse the repository at this point in the history
Currently, this code only executes via Ignition reprovisioning the
rootfs, but we're about to add code to reprovision the rootfs outside of
that path. In that case, we don't need to query the Ignition config.
  • Loading branch information
jlebon committed Apr 6, 2023
1 parent 9b70797 commit 39f64dc
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,12 @@ mount_and_restore_filesystem_by_label() {
local mountpoint=$1; shift
local saved_fs=$1; shift
local new_dev
new_dev=$(jq -r "$(query_fslabel "${label}") | .[0].device" "${ignition_cfg}")
udev_trigger_on_label_mismatch "${label}" "${new_dev}"
new_dev=$(jq -r "$(query_fslabel "${label}") | .[0].device // \"\"" "${ignition_cfg}")
# in the autosave-xfs path, it's not driven by the Ignition config so we
# don't expect a new device there
if [ -n "${new_dev}" ]; then
udev_trigger_on_label_mismatch "${label}" "${new_dev}"
fi
mount_verbose "/dev/disk/by-label/${label}" "${mountpoint}" rw
find "${saved_fs}" -mindepth 1 -maxdepth 1 -exec mv -t "${mountpoint}" {} +
}
Expand Down

0 comments on commit 39f64dc

Please sign in to comment.