From Fedora Project Wiki

< Changes

Revision as of 12:48, 28 June 2021 by Aruiz (talk | contribs) (Created page with "= Deprecate os-prober use in grub2 = == Summary == Deprecate os-prober and replace it with a new osprobe grub command that performs a less intrusive method to discoverer oth...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Deprecate os-prober use in grub2

Summary

Deprecate os-prober and replace it with a new osprobe grub command that performs a less intrusive method to discoverer other OSes in the system dynamically at boot time to add them to the grub menu.

Owner

  • Email: aruiz at gnome dot org

Current status

  • Targeted release: Fedora Linux 35
  • Last updated: 2021-06-28
  • FESCo issue: <will be assigned by the Wrangler>
  • Tracker bug: <will be assigned by the Wrangler>
  • Release notes tracker: <will be assigned by the Wrangler>

Detailed Description

os-prober is a script that is run (unless it is disabled) every time we execute grub2-mkconfig to add a list of entries that you can use to chainload from grub2 to another operating system that os-prober detected and added to your grub.cfg.

However os-prober is extremely intrusive, it tries to mount every single volume it can detect and possibly mount, it tends to be extremely accurate but there are instances of installation sessions or grub2-mkconfing runs where the process or even the whole machine hangs by mounting/accessing corrupted filesystems or buggy FUSE fs implementations. grub2 upstream has even removed support for this as it considers it an attack vector, many downstreams have kept it because many users still rely on this functionality to have a convenient dual boot setup.

More over, this is mostly useful on legacy BIOS systems and on EFI systems we ship it and use it while the grub entries do not work at all most of the time. At the same time most EFI implementations have a hotkey to show a boot menu people can use to switch between operating systems.

Getting rid of os-prober is a desirable thing for the most part as it would increase the robustness of new installations, it would make the boot process more secure and it would remove currently non working chainloads grub.cfg menu entries on EFI systems.

The grub community and the Fedora maintainers are trying to approach a situation where grub is basically zeroconfig and this would be one of multiple steps to get there.

The downside would be that we leave legacy BIOS systems without the ability to dual boot into other OSes which would be a regression and hurts the very peolpe that are making inroads into using Linux natively but still need to run Windows to some capacity.

To overcome this shortcoming we have written a grub2 module that implements a command that can be added to grub.cfg (we intend to propose it upstream). It performs the same functionality at startup time on each boot inside grub if the command is called at grub.cfg. You can find the patch here: https://gitlab.com/aruiz/grub/-/compare/3ffd708d...mainline?from_project_id=21317546

Feedback

Benefit to Fedora

This method is a lot less intrusive and more reliable as it just tries to identify each unecrypted boot partition or directory to assess which OS family is there instead of the most aggressive approach by os-prober that tries to mount root and parse files to detect os version and kernels available.

This also aligns to other efforts like the move to BootLoaderSpec in the past and others we intend to promote to have grub.cfg be a completely static file, improving reliability, reducing complexity and enhancing the usability of the boot path in Fedora.

Scope

  • Proposal owners: Alberto Ruiz, Javier Martinez
  • Other developers:
  • Policies and guidelines: N/A (not needed for this Change)
  • Trademark approval: N/A (not needed for this Change)
  • Alignment with Objectives: (We should probably add an objective for zero config boot)

Upgrade/compatibility impact

We need to decide whether upgraded systems should stick to os-prober for the time being and we only keep the old os-prober's /etc/grub.d/ scriptlet or whether we move everyone to use the new grub.cfg command.

TBD


How To Test

User Experience

This is a change that will be transparent to most users as grub2-mkconfig will just place the new command in grub.cfg instead of going through os-prober to generate static entries.

Dependencies

Contingency Plan

  • Contingency mechanism: (What to do? Who will do it?) N/A (not a System Wide Change)
  • Contingency deadline: N/A (not a System Wide Change)
  • Blocks release? N/A (not a System Wide Change), Yes/No


Documentation

TBA

N/A (not a System Wide Change)

Release Notes