2 # support for GRUB version 2
4 error
=0; trap 'error=$(($?>$error?$?:$error))' ERR
# save maximum error code
7 # during softupdate use this file
8 [ -r $LOGDIR/disk_var.sh
] && .
$LOGDIR/disk_var.sh
10 if [ -z "$BOOT_DEVICE" ]; then
14 # disable os-prober because of #788062
15 ainsl
/etc
/default
/grub
'GRUB_DISABLE_OS_PROBER=true'
17 # skip the rest, if not an initial installation
18 if [ $FAI_ACTION != "install" ]; then
23 $ROOTCMD grub-mkdevicemap
--no-floppy
25 # Check if RAID is used for the boot device
26 if [[ $BOOT_DEVICE =~
'/dev/md' ]]; then
27 GROOT
=$
($ROOTCMD grub-probe
-tdrive -d $BOOT_DEVICE)
28 raiddev
=${BOOT_DEVICE#/dev/}
29 # install grub on all members of RAID
30 for device
in `LC_ALL=C perl -ne 'if(/^'$raiddev'\s.+raid\d+\s(.+)/){ $_=$1; s/\d+\[\d+\]//g; print }' /proc/mdstat`; do
31 echo Install grub on
/dev
/$device
32 $ROOTCMD grub-install
--no-floppy "/dev/$device"
35 for dev
in $BOOT_DEVICE; do
36 GROOT
=$
($ROOTCMD grub-probe
-tdrive -d $dev)
37 $ROOTCMD grub-install
--no-floppy "$GROOT"
39 echo "Grub installed on $dev = $GROOT"