#!/bin/bash

echo "-- $0 --"

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

emerge app-arch/cpio

USE=symlink emerge gentoo-sources
# emerge sys-kernel/genkernel
# 
# echo 'BOOTLOADER="grub2"' >>/etc/genkernel.conf
# export ROOT=${ROOTDISK#/dev/}
# 
# #genkernel --splash --install --no-clean --no-lvm --no-mdadm --no-dmraid --no-luks --menuconfig all
# genkernel --install --clean --no-menuconfig --no-lvm --no-mdadm --no-dmraid --no-luks \
#   --kernel-config=/proc/config.gz all
# 
# 
# emerge @module-rebuild

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
