Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 848853 Details for
Bug 830655
sys-boot/os-prober-1.79-r2 detects boot partition twice
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
os-prober patch to handle non-initrd systems
0001-Read-mounted-partitions-from-proc-self-mountinfo.patch (text/plain), 2.34 KB, created by
Petr Vandrovec
on 2023-01-20 02:30:47 UTC
(
hide
)
Description:
os-prober patch to handle non-initrd systems
Filename:
MIME Type:
Creator:
Petr Vandrovec
Created:
2023-01-20 02:30:47 UTC
Size:
2.34 KB
patch
obsolete
>From 309d7bfa3661a0967afd10e6dc323625a799f62d Mon Sep 17 00:00:00 2001 >From: Petr Vandrovec <petr@vandrovec.name> >Date: Thu, 19 Jan 2023 17:31:07 -0800 >Subject: [PATCH] Read mounted partitions from /proc/self/mountinfo > >When system is booted without initrd, /proc/mounts root filesystem >contains /dev/root, rather than specific device name (like /dev/sda1). >That confuses os-prober logic for filesystem detection. > >On newer systems there is /proc/self/mountinfo, which contains >major:minor device entry, which can be then looked up in sysfs >to find device identifier. > >This does not affect systems that are using initrd, as initrd >will provide correct device name when mounting the root filesystem. > >Signed-off-by: Petr Vandrovec <petr@vandrovec.name> >--- > common.sh | 16 ++++++++++++++++ > linux-boot-prober | 2 +- > os-prober | 2 +- > 3 files changed, 18 insertions(+), 2 deletions(-) > >diff --git a/common.sh b/common.sh >index e1646d4..ed5ff8d 100644 >--- a/common.sh >+++ b/common.sh >@@ -296,3 +296,19 @@ linux_mount_boot () { > > mountboot="$bootpart $mounted" > } >+ >+list_mounts() { >+ if [ -f /proc/self/mountinfo ]; then >+ local x dev mount devs found >+ found=: >+ while read -r x x dev x mount x x fs x; do >+ if [ -L "/sys/dev/block/$dev" ]; then >+ devs="/dev/`readlink \"/sys/dev/block/$dev\" | rev | cut -d/ -f1 | rev`" >+ printf '%s %s %s\n' "$(mapdevfs "$devs")" "$mount" "$fs" >+ found="return 0" >+ fi >+ done < /proc/self/mountinfo >+ $found >+ fi >+ grep "^/dev/" /proc/mounts | parse_proc_mounts >+} >diff --git a/linux-boot-prober b/linux-boot-prober >index e32dc84..7c85c2f 100755 >--- a/linux-boot-prober >+++ b/linux-boot-prober >@@ -6,7 +6,7 @@ set -e > newns "$@" > require_tmpdir > >-grep "^/dev/" /proc/mounts | parse_proc_mounts >"$OS_PROBER_TMP/mounted-map" || true >+list_mounts >"$OS_PROBER_TMP/mounted-map" || true > > partition="$1" > >diff --git a/os-prober b/os-prober >index 0d73ade..844d737 100755 >--- a/os-prober >+++ b/os-prober >@@ -120,7 +120,7 @@ done > > # We need to properly canonicalize partitions with mount points and partitions > # used in RAID >-grep "^/dev/" /proc/mounts | parse_proc_mounts >"$OS_PROBER_TMP/mounted-map" || true >+list_mounts >"$OS_PROBER_TMP/mounted-map" || true > : >"$OS_PROBER_TMP/swaps-map" > if [ -f /proc/swaps ]; then > grep "^/dev/" /proc/swaps | parse_proc_swaps >"$OS_PROBER_TMP/swaps-map" || true >-- >2.39.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 830655
:
761381
|
762515
|
763081
|
767077
|
813811
|
848851
| 848853 |
849063
|
859591
|
860462
|
867387
|
867537