#!/bin/bash

echo "-- $0 --"

echo 'ACCEPT_LICENSE="*"' >>/etc/portage/make.conf

if [ -n "${INSTALL_KERNEL}" ]; then
  echo "sys-kernel/installkernel $INSTALL_KERNEL" >/etc/portage/package.use/installkernel
fi

emerge sys-kernel/gentoo-kernel-bin

# apply the grub
export GRUB_DISABLE_OS_PROBER=1
[ -d /boot/grub ] || mkdir /boot/grub
grub-mkconfig -o /boot/grub/grub.cfg
