#!/bin/bash
cd /usr/src/grub-*/ ||exit

# This package is known to behave badly when you have changed its
# default optimization flags (including the -march and -mcpu options).
unset CFLAGS



./configure --prefix=/usr && #--disable-reiserfs &&
make &&
#make check &&
make install &&
mkdir -p /boot/grub &&
cp /usr/lib/grub/i386-pc/{stage{1,2},e2fs_stage1_5} /boot/grub


cat >/boot/grub/menu.lst <<"EOF"
# /boot/grub/menu.lst

default 2
timeout 5
 
#color green/black light-green/black
 
#German keyboard
setkey y z
setkey z y
setkey Y Z
setkey Z Y
setkey equal parenright
setkey parenright parenleft
setkey parenleft asterisk 
setkey doublequote at
setkey plus bracketright
setkey minus slash
setkey slash ampersand
setkey ampersand percent
setkey percent caret
setkey underscore question
setkey question underscore
setkey semicolon less
setkey less numbersign
setkey numbersign backslash
setkey colon greater
setkey greater bar
setkey asterisk braceright  

title lfs
#root = (hd0,7)
kernel (hd0,7)/boot/vmlinuz root=/dev/hda8
 
title lfs_lit
kernel (hd0,5)/boot/vmlinuz root=/dev/hda6
 
title wxp
chainloader (hd0,1)+1

title disc
chainloader (fd0)+1

title (Re)Install grub
root (hd0,5)
#embed /boot/grub/reiserfs_stage1_5
install /boot/grub/stage1 (hd0) (hd0)1+19 p /boot/grub/stage2 /boot/grub/menu.lst
EOF
