Initial configuration for FAI (work in progress)
[grml-live.git] / etc / grml / fai / config / files / boot / grub / menu.lst / postinst
1 #! /bin/bash
2
3 error=0 ; trap "error=$((error|1))" ERR
4
5 set -a
6
7 # during softupdate use this file
8 [ -r $target/var/log/fai/disk_var.sh ] && . $target/var/log/fai/disk_var.sh
9
10 # if class NOMBR is defined, write boot loader into root partition, not into mbr
11 ifclass NOMBR && BOOT_DEVICE=$BOOT_PARTITION
12
13 grub-install --no-floppy --root-directory=$target $BOOT_DEVICE
14 GROOT=$(device2grub $BOOT_PARTITION)
15 perl -pi -e 's/#(\w+)#/$ENV{$1}/' $2
16 $ROOTCMD /usr/sbin/update-grub
17 echo "Grub installed on $BOOT_DEVICE on $GROOT"
18
19 exit $error
20