Add config option for grub to enable os-prober
This commit is contained in:
parent
4be1ccae29
commit
55a944f078
@ -2345,10 +2345,16 @@ prerun_grub()
|
|||||||
if [[ $SYS == 'BIOS' && $LVM && -z $SEP_BOOT ]]; then
|
if [[ $SYS == 'BIOS' && $LVM && -z $SEP_BOOT ]]; then
|
||||||
sed -i "s/GRUB_PRELOAD_MODULES=.*/GRUB_PRELOAD_MODULES=\"lvm\"/g" "$MNT/etc/default/grub"
|
sed -i "s/GRUB_PRELOAD_MODULES=.*/GRUB_PRELOAD_MODULES=\"lvm\"/g" "$MNT/etc/default/grub"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# setup for os-prober module
|
# setup for os-prober module
|
||||||
mkdir -p /run/{lvm,udev} "$MNT/hostrun/"{lvm,udev}
|
mkdir -p /run/{lvm,udev} "$MNT/hostrun/"{lvm,udev}
|
||||||
mount --bind /run/lvm "$MNT/hostrun/lvm"
|
mount --bind /run/lvm "$MNT/hostrun/lvm"
|
||||||
mount --bind /run/udev "$MNT/hostrun/udev"
|
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
|
return 0
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user