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
focal sources
[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 55632754b2eab15de9759def493baa7c2d38ae80..a78df0cb408dfa5b8b6b18773bfa7fbc80c7bb4e 100755
(executable)
--- a/
fai/config/scripts/GRUB_PC/10-setup
+++ b/
fai/config/scripts/GRUB_PC/10-setup
@@
-3,6
+3,7
@@
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
# do not set up grub during dirinstall
set -a
# do not set up grub during dirinstall
@@
-35,6
+36,7
@@
fi
# 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
+ GROOT=$($ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE)
raiddev=${BOOT_DEVICE#/dev/}
# install grub on all members of RAID
for device in `LC_ALL=C perl -ne 'if(/^'$raiddev'\s.+raid\d+\s(.+)/){ $_=$1; s/\d+\[\d+\]//g; print }' /proc/mdstat`; do
raiddev=${BOOT_DEVICE#/dev/}
# install grub on all members of RAID
for device in `LC_ALL=C perl -ne 'if(/^'$raiddev'\s.+raid\d+\s(.+)/){ $_=$1; s/\d+\[\d+\]//g; print }' /proc/mdstat`; do
@@
-42,10
+44,13
@@
if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then
$ROOTCMD grub-install --no-floppy "/dev/$device"
done
else
$ROOTCMD grub-install --no-floppy "/dev/$device"
done
else
- $ROOTCMD grub-install --no-floppy "$GROOT"
- if [ $? -eq 0 ]; then
- echo "Grub installed on $BOOT_DEVICE = $GROOT"
- fi
+ for dev in $BOOT_DEVICE; do
+ GROOT=$($ROOTCMD grub-probe -tdrive -d $dev)
+ $ROOTCMD grub-install --no-floppy "$GROOT"
+ if [ $? -eq 0 ]; then
+ echo "Grub installed on $dev = $GROOT"
+ fi
+ done
fi
$ROOTCMD update-grub
fi
$ROOTCMD update-grub