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
Merge branch 'upstream'
[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 cbff2d84b606f876be230e092bcdeaac8d91aa2a..85e90d2d08b4f2822d41f42149c34ad16593e154 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; s/(nvme.+?)p/$1/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; s/(nvme.+?)p/$1/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