initial commit
[fai-configs.git] / files / boot / grub / menu.lst / postinst
CommitLineData
2d1f8014 1#! /bin/bash
2
3error=0 ; trap "error=$((error|1))" ERR
4
5set -a
6
7if [ -r $LOGDIR/disk_var.sh ] ; then
8 . $LOGDIR/disk_var.sh
9else
10 echo "disk_var.sh not found!"
11 exit 0
12fi
13
14# if class NOMBR is defined, write boot loader into root partition, not into mbr
15ifclass NOMBR && BOOT_DEVICE=$BOOT_PARTITION
16
17[ -z "$BOOT_DEVICE" ] && exit 701
18[ -z "$BOOT_PARTITION" ] && exit 702
19
20$ROOTCMD grub-install --no-floppy $(device2grub $BOOT_DEVICE)
21GROOT=$(device2grub $BOOT_PARTITION)
22perl -pi -e 's/#(\w+)#/$ENV{$1}/g' $2
23$ROOTCMD /usr/sbin/update-grub
24echo "Grub installed on $BOOT_DEVICE on $GROOT"
25
26exit $error
27