X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=fai%2Fconfig%2Fscripts%2FGRUB_EFI%2F10-setup;h=7dd92d4f000ebc8a44569cc4b7be5c11d66fb98a;hb=490334746631a6c956eee47947f3ab8f8a451666;hp=2e39e2f42b14659b29fbc6d528e9b678d2891953;hpb=056eb4e90e13b2d8f7cbb8c3b875f35bf0fa207e;p=automated-distro-installer diff --git a/fai/config/scripts/GRUB_EFI/10-setup b/fai/config/scripts/GRUB_EFI/10-setup index 2e39e2f..7dd92d4 100755 --- a/fai/config/scripts/GRUB_EFI/10-setup +++ b/fai/config/scripts/GRUB_EFI/10-setup @@ -24,7 +24,7 @@ if [ -z "$BOOT_DEVICE" ]; then exit 189 fi -# disable os-prober because of #788062 +# disable os-prober because of #802717 ainsl /etc/default/grub 'GRUB_DISABLE_OS_PROBER=true' # skip the rest, if not an initial installation @@ -33,28 +33,29 @@ if [ $FAI_ACTION != "install" ]; then exit $error fi -$ROOTCMD grub-mkdevicemap --no-floppy GROOT=$($ROOTCMD grub-probe -tdrive -d $BOOT_DEVICE) +# handle /boot in lvm-on-md +_bdev=$(readlink -f $BOOT_DEVICE) +if [ "${_bdev%%-*}" = "/dev/dm" ]; then + BOOT_DEVICE=$( lvs --noheadings -o devices $BOOT_DEVICE | sed -e 's/^*\([^(]*\)(.*$/\1/' ) +fi # Check if RAID is used for the boot device if [[ $BOOT_DEVICE =~ '/dev/md' ]]; then 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 + for device in $(LC_ALL=C perl -ne 'if(/^'$raiddev'\s.+raid\d+\s(.+)/){ $_=$1; s/\d+\[\d+\]//g; print }' /proc/mdstat); do echo Install grub on /dev/$device $ROOTCMD grub-install --no-floppy --force-extra-removable "/dev/$device" done -elif [[ $GROOT =~ 'hostdisk' ]]; then - cat > $target/boot/grub/device.map <