summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2011-01-12 01:10:35 +0100
committerThomas Bächler <thomas@archlinux.org>2011-01-12 01:10:35 +0100
commit05e0bc5987166573412f196ff932d76787d31957 (patch)
tree4c59389720bd6888aff69a4e8c28b2822425407f
parent73c274c27a7dd28599df1f3112de084e58b3aebf (diff)
downloadmkinitcpio-05e0bc5987166573412f196ff932d76787d31957.tar.gz
mkinitcpio-05e0bc5987166573412f196ff932d76787d31957.tar.xz
autodetect: only probe the root device
-rw-r--r--install/autodetect11
1 files changed, 7 insertions, 4 deletions
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