[arch-releng] [PATCH 1/2] find_usable_blockdevices(): prevent duplicate entries
Fix a regression introduced in a8f3fa4329 which causes duplicate entries to be returned for a block device in certain cases and prevents manual mountpoint configuration (FS#29859). Signed-off-by: Thomas Hebb <tommyhebb@gmail.com> --- src/core/libs/lib-blockdevices-filesystems.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index bd38da9..5ceb3e5 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -280,14 +280,18 @@ find_usable_blockdevices() { # /dev/sda -> /dev/sda1 # /dev/cciss/c0d1 -> /dev/cciss/c0d1p1 for dev in ${devpath}*[[:digit:]]*; do + dev_used_by_environment $dev && continue has_parts=1 + usable=0 if ((include_ext)) || ! dev_is_extended_partition $dev; then - dev_used_by_environment $dev && continue - echo -ne "$dev $1" + usable=1 fi if ((include_dm)) || ! dev_is_in_softraid_or_lvmpv $dev; then - dev_used_by_environment $dev && continue + usable=1 + fi + + if ((usable)); then echo -ne "$dev $1" fi done -- 1.7.10.2
participants (1)
-
Thomas Hebb