iankelling.org
/
git
/
automated-distro-installer
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
various fixes, improve flidas
[automated-distro-installer]
/
fai
/
config
/
scripts
/
GRUB_PC
/
10-setup
diff --git
a/fai/config/scripts/GRUB_PC/10-setup
b/fai/config/scripts/GRUB_PC/10-setup
index 88b557ea694876147a48fdfceef7ec3f4f743b40..00829e110a7ecc3acff8ab60f789c4a9c3e9481c 100755
(executable)
--- a/
fai/config/scripts/GRUB_PC/10-setup
+++ b/
fai/config/scripts/GRUB_PC/10-setup
@@
-3,7
+3,13
@@
error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
+set -x
set -a
set -a
+
+# do not set up grub during dirinstall
+if [ "$FAI_ACTION" = "dirinstall" ] ; then
+ exit 0
+fi
# during softupdate use this file
[ -r $LOGDIR/disk_var.sh ] && . $LOGDIR/disk_var.sh
# during softupdate use this file
[ -r $LOGDIR/disk_var.sh ] && . $LOGDIR/disk_var.sh
@@
-20,7
+26,8
@@
if [ $FAI_ACTION != "install" ]; then
exit $error
fi
exit $error
fi
-$ROOTCMD grub-mkdevicemap --no-floppy
+GROOT=$($ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE)
+
# Check if RAID is used for the boot device
if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then
# Check if RAID is used for the boot device
if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then
@@
-31,6
+38,14
@@
if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then
echo Install grub on /dev/$device
$ROOTCMD grub-install --no-floppy "/dev/$device"
done
echo Install grub on /dev/$device
$ROOTCMD grub-install --no-floppy "/dev/$device"
done
+
+elif [[ $GROOT =~ 'hostdisk' ]]; then
+ for dev in $BOOT_DEVICE; do
+ $ROOTCMD grub-install --no-floppy --modules=part_msdos $dev
+ if [ $? -eq 0 ]; then
+ echo "Grub installed on hostdisk $BOOT_DEVICE"
+ fi
+ done
else
for dev in $BOOT_DEVICE; do
GROOT=$($ROOTCMD grub-probe -tdrive -d $dev)
else
for dev in $BOOT_DEVICE; do
GROOT=$($ROOTCMD grub-probe -tdrive -d $dev)