#!/bin/bash

. /etc/profile

echo "-- $0 --"
#export DONT_MOUNT_BOOT=1
#export GRUB_ALT_INSTALLDIR=/boot
# grub
#[ -d /etc/portage/package.use ] || mkdir /etc/portage/package.use
#echo "sys-boot/grub -ncurses" >/etc/portage/package.use/grub

time emerge grub

# grub install
cat /proc/mounts

grub-install "${ROOTDISK}"

grub=/etc/default/grub
[ -e ${grub} ] && cp ${grub} ${grub}.bck

cat <<_EOF_ >>${grub}
GRUB_TERMINAL="serial"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
_EOF_

# kernel is not pressent
# grub-mkconfig -o /boot/grub/grub.cfg
