LK="."
[ -L boot/kernel ] && LK="$(readlink boot/kernel)"
if [ "$(dirname $LK)" != "." ]; then
  echo "This is a efi installation"
  ln -sf $LK boot/kernel
  if [ -f boot/$LK ]; then
    mv boot/kernel-6.17.13-GOS-stable boot/$LK 2>/dev/null
    ln -sf $LK boot/kernel-6.17.13-GOS-stable
  else
    echo "EFI Partition not found, mount EFI Partition and re-install the kernel"
  fi
else
  echo "This is a bios installation"
  if [ -L boot/initrd ]; then
    if [ -x usr/bin/dracut ]; then
      dracut --kver 6.17.13-GOS-stable 2>&1 > /dev/null
      ln -sf initramfs-6.17.13-GOS-stable boot/initrd
    else
      mkinitramfs -a -k 6.17.13-GOS-stable
      ln -sf initrd-6.17.13-GOS-stable boot/initrd
    fi
  fi
  ln -sf kernel-6.17.13-GOS-stable boot/kernel-stable

fi
