Summary: | sys-boot/os-prober-1.81-r1 fails to detect Windows | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Victor Mataré <vmatare+gbug> |
Component: | Current packages | Assignee: | Peter Levine <plevine457> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bkohler, gabemarcano, iivanich, jstein, plevine457 |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 830655 | ||
Bug Blocks: |
Description
Victor Mataré
2023-02-25 15:44:12 UTC
If you run `os-prober` on the command-line as root, nothing gets emitted? (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. 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. I'm seeing this breakage as well. Seems our attempted fix in bug 830655 has caused this regression. (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). If field 7 is optional, how can our current parsing deal with that? Count the total fields first and have a different "while read" case for each count? The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dd2aa3aeb97da6052c2645e12313cd7eec389715 commit dd2aa3aeb97da6052c2645e12313cd7eec389715 Author: Ben Kohler <bkohler@gentoo.org> AuthorDate: 2024-05-08 16:40:29 +0000 Commit: Ben Kohler <bkohler@gentoo.org> CommitDate: 2024-05-08 16:43:39 +0000 sys-boot/os-prober: new boot-detected-twice patch This version adds a slightly adjusted patch which accounts for the fact that mountinfo may have an extra optional field. This does not account for *more than one* optional field, but we can revisit this if such a setup is found in the wild. Bug: https://bugs.gentoo.org/897700 Signed-off-by: Ben Kohler <bkohler@gentoo.org> .../os-prober-1.81-boot-detected-twice-v2.patch | 57 ++++++++++++ sys-boot/os-prober/os-prober-1.81-r2.ebuild | 103 +++++++++++++++++++++ 2 files changed, 160 insertions(+) Please test with this new patch in 1.81-r2-- it should work for 10-field cases and 11-field cases, hopefully we don't run into any 12+ field cases. If this works for everyone, I'd like to stabilize -r2 soon. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=18bcae8fc56848056979dbbe0af85af7d27b3928 commit 18bcae8fc56848056979dbbe0af85af7d27b3928 Author: Ben Kohler <bkohler@gentoo.org> AuthorDate: 2024-05-09 14:19:48 +0000 Commit: Ben Kohler <bkohler@gentoo.org> CommitDate: 2024-05-09 14:21:42 +0000 sys-boot/os-prober: stabilize 1.81-r2 for amd64, x86 Closes: https://bugs.gentoo.org/830655 Closes: https://bugs.gentoo.org/897700 Signed-off-by: Ben Kohler <bkohler@gentoo.org> sys-boot/os-prober/os-prober-1.81-r2.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) |