LK="."
[ -L boot/kernel-49 ] && LK="$(readlink boot/kernel-49)"
if [ "$(dirname $LK)" != "." ]; then
  echo "This is an efi installation"
  ln -sf $LK boot/kernel-49
  if [ -f boot/$LK ]; then
    mv boot/kernel-4.9.235-NuTyX-49 boot/$LK 2>/dev/null
    ln -sf $LK boot/kernel-4.9.235-NuTyX-49
  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-49 ]; then
    mkinitramfs 4.9.235-NuTyX-49
    ln -sf initrd-4.9.235-NuTyX-49 boot/initrd-49
  fi
  ln -sf kernel-4.9.235-NuTyX-49 boot/kernel-49
fi
