diff --git a/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-transposefs.sh b/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-transposefs.sh index cd563e9897..1b68fc14b1 100755 --- a/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-transposefs.sh +++ b/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-transposefs.sh @@ -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}" {} + }