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-5.15.175-Grat-OS-515 boot/$LK 2>/dev/null
    ln -sf $LK boot/kernel-5.15.175-Grat-OS-515
  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 5.15.175-Grat-OS-515 2>&1 > /dev/null
      ln -sf initramfs-5.15.175-Grat-OS-515 boot/initrd
    else
      mkinitramfs 5.15.175-Grat-OS-515
      ln -sf initrd-5.15.175-Grat-OS-515 boot/initrd
    fi
  fi
  ln -sf kernel-5.15.175-Grat-OS-515 boot/kernel-515

fi
