Quoting the globbing `*` will prevent Bash from use globbing. So only
quote the kernel version variable that could potentially contain spaces.
Fixes: 28820e205328 ("feat(dracut.sh): make initramfs-${kernel}.img filename configurable")
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
elif mountpoint -q /boot/efi; then
IMG="/boot/efi/$MACHINE_ID/$KERNEL_VERSION/initrd"
else
- files=("/boot/initr*${KERNEL_VERSION}*")
+ files=(/boot/initr*"${KERNEL_VERSION}"*)
if [ "${#files[@]}" -ge 1 ] && [ -e "${files[0]}" ]; then
IMG="${files[0]}"
elif [[ -f /boot/initramfs-linux.img ]]; then