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.18.2-GOS-618 boot/$LK 2>/dev/null
    ln -sf $LK boot/kernel-6.18.2-GOS-618
  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-618 ]; then
    if [ -x usr/bin/dracut ]; then
      dracut --kver 6.18.2-GOS-618 2>&1 > /dev/null
      ln -sf initramfs-6.18.2-GOS-618 boot/initrd-618
    else
      mkinitramfs -a -k 6.18.2-GOS-618
      ln -sf initrd-6.18.2-GOS-618 boot/initrd-618
    fi
  fi
  ln -sf kernel-6.18.2-GOS-618 boot/kernel-618

fi
