LK="."
[ -L boot/kernel-61 ] && LK="$(readlink boot/kernel-61)"
if [ "$(dirname $LK)" != "." ]; then
  echo "This is a efi installation"
  ln -sf $LK boot/kernel-61
  if [ -f boot/$LK ]; then
    mv boot/kernel-6.1.121-Grat-OS-61 boot/$LK 2>/dev/null
    ln -sf $LK boot/kernel-6.1.121-Grat-OS-61
  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.1.121-Grat-OS-61 2>&1 > /dev/null
      ln -sf initramfs-6.1.121-Grat-OS-61 boot/initrd-61
    else
      mkinitramfs 6.1.121-Grat-OS-61
      ln -sf initrd-6.1.121-Grat-OS-61 boot/initrd-61
    fi
  fi
  ln -sf kernel-6.1.121-Grat-OS-61 boot/kernel-61

fi
