Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 897700 - sys-boot/os-prober-1.81-r1 fails to detect Windows
Summary: sys-boot/os-prober-1.81-r1 fails to detect Windows
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Peter Levine
URL:
Whiteboard:
Keywords:
Depends on: 830655
Blocks:
  Show dependency tree
 
Reported: 2023-02-25 15:44 UTC by Victor Mataré
Modified: 2023-08-03 20:40 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Mataré 2023-02-25 15:44:12 UTC
os-prober-1.81 works normally, but -r1 just outputs nothing on my system. Don't know if it's able to detect other Linux installs because I don't have any. But the UEFI Windows setup is definitely missing.

Seems to be caused by the os-prober-1.81-boot-detected-twice.patch, which appears to be the only change between 1.81 and 1.81-r1.

Reproducible: Always
Comment 1 Peter Levine 2023-02-26 01:11:44 UTC
If you run `os-prober` on the command-line as root, nothing gets emitted?
Comment 2 Victor Mataré 2023-02-26 15:14:45 UTC
(In reply to Peter Levine from comment #1)
> If you run `os-prober` on the command-line as root, nothing gets emitted?

Precisely, with 1.81-r1 that is. With 1.81 everything works.
Comment 3 Gabriel Marcano 2023-03-04 08:31:35 UTC
I think I found the problem. I'm also seeing the same issue on my laptop. It seems to be a problem while parsing mountinfo. Specifically:

    while read -r x x dev x mount x x fs x; do

When compared to a line from my mountinfo:

    62 1 0:31 / / rw,noatime shared:1 - btrfs /dev/nvme0n1p2 rw,ssd,discard,space_cache,subvolid=5,subvol=/


There's one too few "x" between mount and fs. Specifically, I don't know what that dash after the "shared:1" means or what it's for, but currently that's what's being picked up on my computer. If I source /usr/share/os-prober/common.sh from a shell and call list_mounts, I get the following:

    /dev/nvme0n1p5 /mnt/Gaia -
    /dev/nvme0n1p8 /mnt/Luna -
    /dev/nvme0n1p1 /boot/efi -

If I add an extra x between mount and fs:

    /dev/nvme0n1p5 /mnt/Gaia fuseblk
    /dev/nvme0n1p8 /mnt/Luna fuseblk
    /dev/nvme0n1p1 /boot/efi vfat

With the extra x, os-prober also successfully shows something, and finds my Windows partition. Without it, I also get no output whatsoever.
Comment 4 Ben Kohler gentoo-dev 2023-04-05 12:38:39 UTC
I'm seeing this breakage as well.  Seems our attempted fix in bug 830655 has caused this regression.
Comment 5 Peter Levine 2023-04-05 22:03:56 UTC
(In reply to Gabriel Marcano from comment #3)
> I think I found the problem. I'm also seeing the same issue on my laptop. It
> seems to be a problem while parsing mountinfo. Specifically:
> 
>     while read -r x x dev x mount x x fs x; do
> 
> When compared to a line from my mountinfo:
> 
>     62 1 0:31 / / rw,noatime shared:1 - btrfs /dev/nvme0n1p2
> rw,ssd,discard,space_cache,subvolid=5,subvol=/
> 
> 
> There's one too few "x" between mount and fs. Specifically, I don't know
> what that dash after the "shared:1" means or what it's for, but currently
> that's what's being picked up on my computer. If I source
> /usr/share/os-prober/common.sh from a shell and call list_mounts, I get the
> following:
> 
>     /dev/nvme0n1p5 /mnt/Gaia -
>     /dev/nvme0n1p8 /mnt/Luna -
>     /dev/nvme0n1p1 /boot/efi -
> 
> If I add an extra x between mount and fs:
> 
>     /dev/nvme0n1p5 /mnt/Gaia fuseblk
>     /dev/nvme0n1p8 /mnt/Luna fuseblk
>     /dev/nvme0n1p1 /boot/efi vfat
> 
> With the extra x, os-prober also successfully shows something, and finds my
> Windows partition. Without it, I also get no output whatsoever.

'x' is being used as a placeholder variable while parsing, to hold the unused fields of lines in /proc/self/mountinfo.  The dash is a delimiter representing the end of optional  mount_namespaces fields (see the "/proc/pid/mountinfo" section of `man proc`).

It does appear that there should be an extra `x`.  $fs should contain the filesystem type (field 9) but instead contains the delimiter symbol (field 8).