#!/bin/sh
# $Id: sbc_grub_auto,v 1.1 2005/01/31 14:25:27 sesam Exp $
# Script to run grub to recreate the MBR
#
# Find boot partition if any
bootp=`grep "^/dev/.*\ /boot" $1/etc/fstab | cut -d ' ' -f 1`
# find boot device
a="ja"
if [ x$bootp != x ] ; then
   bootdev=`echo $bootp | cut -c1-8`
else
   bootdev=`grep "^/dev/.*\ /\ " $1/etc/fstab | cut -c1-8`
fi

if [ x$a == xja ] ; then
chroot /mnt/disk grub-install $bootdev
sync
fi
