On 3/17/20 9:00 PM, John Covici wrote:
> On Tue, 17 Mar 2020 19:23:53 -0400,
> Dutch Ingraham wrote:
>>
>> On 3/17/20 4:16 AM, Neil Bothwick wrote:
>>> On Tue, 17 Mar 2020 03:00:59 -0500, Dutch Ingraham wrote:
>>>
>>>> Also from [1], with emphasis added "30_os-prober this script uses
>>>> **os-prober to search for Linux** and other operating systems and places
>>>> the results in the GRUB 2 menu.
>>>>
>>>> A review of the scripts 10_linux and 30_os-prober supplied by Gentoo
>>>> with the grub and os-prober packages seems to confirm the Ubuntu
>>>> documentation's accuracy.
>>>>
>>>> Regardless of which script is responsible, the problem remains that
>>>> running 'grub-mkconfig -o /boot/grub/grub.cfg' under the circumstances
>>>> outlined in my original post should find the other Linux operating
>>>> systems, but doesn't.
>>>
>>> You're right, either things have changed since the days I used GRUB
>>> extensively or I am losing it. No, that's not a multiple choice question!
>>
>> Well, you wouldn't be the first to begin losing it!  I sent the original
>> question before running things through strace, so....  (It wasn't
>> particularly helpful.)
>>>
>>> Have you tried running the script with "sh -x" to see just what it is
>>> doing?
>>
>> It calls a helper script and exits successfully.
>>
>> I wonder if it could be this part
>>>
>>> if ! command -v os-prober > /dev/null || ! command -v linux-boot-prober 
>>> >/dev/null ; then
>>>    # missing os-prober and/or linux-boot-prober
>>>    exit 0
>>> fi
>>
>> Running `command -v os-prober' returns '/usr/bin/os-prober'
>>>
>>> If the os-prober command is missing the script will fail successfully, as
>>> you experience. Is sys-boot/os-prober installed?
>>>
>>>
>> Yes, it is installed as noted above, and, if I mount the partitions
>> manually, os-prober will find them.
>>
>>
>> I'm fairly certain I am missing one open and obvious thing, but can't
>> see it.  Here is a list of things I have tried, mainly for
>> thread-completeness purposes:
>>
>> 1. Removed grub and op-prober packages then wiped all residual config files.
>>
>> 2. Reinstalled both, enabling the 'mount' use flag on grub.
>>
>> 3. Confirmed /usr/bin/os-prober and all /etc/grub.d/{scripts} are in
>> place and executable.
>>
>> 4. Even though it is the default, added GRUB_DISABLE_OS_PROBER=false to
>> /etc/default/grub.
>>
>> 5. Even though it is the default, set GRUB_PLATFORMS="pc" in make.conf.
>>
>>
>> On a fairly routine set-up (MBR/BIOS with four ext4 primary partitions)
>> I should be able to just set the mount use flag on grub, install grub
>> and os-prober, run 'grub-mkconfig -o /boot/grub/grub.cfg' and it should
>> just detect all operating systems and write the config, right? RIGHT?
>>
>>
>
> Are you sure its supposed to detect them even if they are not mounted?
> How would they be able to look at the files?  Where are the image
> files on these partitions?
>

Those are good questions.  As far as I have seen, distributions act in
one of three different ways:

    1.  Patch grub/os-prober in such a way that all operating systems
are detected rapidly, but not necessarily accurately.  OpenSuSE works
this way, and can find 8 operating systems spread across two SSDs in
less than 10 seconds, albeit sometimes older kernels are listed as the
default for any given OS.  No manual mounting of OSs is necessary.

    2.  Patch grub/os-prober in such a way that all operating systems
are detected very slowly but accurately.  The Debians/Ubuntus and Fedora
work this way, but take up to five minutes to complete on a two-SSD
system.  No manual mounting of OSs is necessary.

    3.  Vanilla grub/os-prober.  Manual mounting of all OSs is required.
 Arch Linux works this way.  See
https://wiki.archlinux.org/index.php/GRUB#Detecting_other_operating_systems
.

I'm assuming 1 & 2 above are patched only anecdotally. There could be
something totally distinct happening.

The os-prober code itself, at least Gentoo's version, seems to indicate
it should find other OSs without manual mounting, as the code comments
and commands like lsblk, blkid, and mount would serve no other obvious
purpose.

Unfortunately I don't have the time right now to do a proper analysis of
the code from 1, 2, and 3 above against Gentoo's, so I suppose manually
mounting will have to suffice.

Reply via email to