/lib/modules should always exists, which is consistent with the
assumptions made in the rest of the dracut mode.
else
# shellcheck disable=SC2012
kernel="$(cd /lib/modules && ls -1v | tail -1)"
- # shellcheck disable=SC2012
- [[ $kernel ]] || kernel="$(cd /usr/lib/modules && ls -1v | tail -1)"
fi
fi
else
# shellcheck disable=SC2012
KERNEL_VERSION="$(cd /lib/modules && ls -1v | tail -1)"
- # shellcheck disable=SC2012
- [[ $KERNEL_VERSION ]] || KERNEL_VERSION="$(cd /usr/lib/modules && ls -1v | tail -1)"
fi
fi