@@ -, +, @@ --- common.sh | 16 ++++++++++++++++ linux-boot-prober | 2 +- os-prober | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) --- a/common.sh +++ a/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; do + if [ -L "/sys/dev/block/$dev" ]; then + devs="/dev/`readlink \"/sys/dev/block/$dev\" | rev | cut -d/ -f1 | rev`" + printf '%s %s\n' "$(mapdevfs "$devs")" "$mount" + found="return 0" + fi + done < /proc/self/mountinfo + $found + fi + grep "^/dev/" /proc/mounts | parse_proc_mounts +} --- a/linux-boot-prober +++ a/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" --- a/os-prober +++ a/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 --