From 05e0bc5987166573412f196ff932d76787d31957 Mon Sep 17 00:00:00 2001 From: Thomas Bächler Date: Wed, 12 Jan 2011 01:10:35 +0100 Subject: autodetect: only probe the root device --- install/autodetect | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'install') diff --git a/install/autodetect b/install/autodetect index 914a96b..1275232 100644 --- a/install/autodetect +++ b/install/autodetect @@ -8,12 +8,15 @@ install () sed -e 's/ata_generic//g' -e 's/ide_generic//g')" - #Filesystem detection, use sysfs instead of /proc + #Filesystem detection, only probe the device for / findfs () { - for blkdev in $(find /dev -type b | grep -v -e /dev/loop -e /dev/ram -e /dev/fd); do - /sbin/blkid -u filesystem -o value -s TYPE -p "${blkdev}" 2> /dev/null - done + local rootdev + + if [ -f /proc/self/mountinfo -a -x /bin/findmnt ]; then + rootdev=$(/bin/findmnt -n -u -o source /) + /sbin/blkid -u filesystem -o value -s TYPE -p "${rootdev}" 2>/dev/null + fi } if [ ${UID} -eq 0 -o "$(groups | grep disk)" != "" ]; then -- cgit v1.2.3-24-g4f1b