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 5, 2023
1 parent e6c7db6 commit 48466d4
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ 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}")
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 48466d4

Please sign in to comment.