Add config option for grub to enable os-prober

This commit is contained in:
natemaia 2021-09-04 14:11:13 -07:00
parent 4be1ccae29
commit 55a944f078

View File

@ -2345,10 +2345,16 @@ prerun_grub()
if [[ $SYS == 'BIOS' && $LVM && -z $SEP_BOOT ]]; then
sed -i "s/GRUB_PRELOAD_MODULES=.*/GRUB_PRELOAD_MODULES=\"lvm\"/g" "$MNT/etc/default/grub"
fi
# setup for os-prober module
mkdir -p /run/{lvm,udev} "$MNT/hostrun/"{lvm,udev}
mount --bind /run/lvm "$MNT/hostrun/lvm"
mount --bind /run/udev "$MNT/hostrun/udev"
if grep -q "GRUB_DISABLE_OS_PROBER" "$MNT/etc/default/grub"; then
sed -i "s/.*GRUB_DISABLE_OS_PROBER=.*/GRUB_DISABLE_OS_PROBER=false/g" "$MNT/etc/default/grub"
else
echo "GRUB_DISABLE_OS_PROBER=false" >> "$MNT/etc/default/grub"
fi
return 0
}