about summary refs log tree commit diff
path: root/installer.sh.in
diff options
context:
space:
mode:
authorJuan RP <xtraeme@gmail.com>2014-08-29 13:30:38 +0200
committerJuan RP <xtraeme@gmail.com>2014-08-29 13:30:38 +0200
commit945dc94fe8b7f577b2ce1fed10fe11c564b90c13 (patch)
treea201f97b48bcde2886facf7aa28cc6ce75922c6f /installer.sh.in
parent70f268cc29c3c0f04afcb8243c2180a0da722fbd (diff)
downloadhrmpf-945dc94fe8b7f577b2ce1fed10fe11c564b90c13.tar.gz
hrmpf-945dc94fe8b7f577b2ce1fed10fe11c564b90c13.tar.xz
hrmpf-945dc94fe8b7f577b2ce1fed10fe11c564b90c13.zip
installer: detect LUKS and LVM LVs correctly.
Diffstat (limited to 'installer.sh.in')
-rw-r--r--installer.sh.in22
1 files changed, 11 insertions, 11 deletions
diff --git a/installer.sh.in b/installer.sh.in
index 5aa5ce9..c7c690e 100644
--- a/installer.sh.in
+++ b/installer.sh.in
@@ -153,22 +153,14 @@ show_partitions() {
         for p in /sys/block/$disk/$disk*; do
             if [ -d $p ]; then
                 part=$(basename $p)
-                fstype=$(lsblk -nfr /dev/$part|awk '{print $2}')
+                fstype=$(lsblk -nfr /dev/$part|awk '{print $2}'|head -1)
                 [ "$fstype" = "iso9660" ] && continue
-                fssize=$(lsblk -nr /dev/$part|awk '{print $4}')
+                [ "$fstype" = "crypto_LUKS" ] && continue
+                fssize=$(lsblk -nr /dev/$part|awk '{print $4}'|head -1)
                 echo "/dev/$part"
                 echo "size:${fssize:-unknown};fstype:${fstype:-none}"
             fi
         done
-        # LVM
-        for p in $(ls /dev/mapper 2>/dev/null|grep -v control); do
-            [ "$p" = "live-rw" ] && continue
-            [ "$p" = "live-base" ] && continue
-            fstype=$(lsblk -nfr /dev/$part|awk '{print $2}')
-            fssize=$(lsblk -nr /dev/mapper/$p|awk '{print $4}')
-            echo "/dev/mapper/$p"
-            echo "size:${fssize:-unknown};fstype:${fstype:-none}"
-        done
         # Software raid (md)
         for p in $(ls -d /dev/md* 2>/dev/null|grep '[0-9]'); do
             if cat /proc/mdstat|grep -qw $(echo $p|sed -e 's|/dev/||g'); then
@@ -178,6 +170,14 @@ show_partitions() {
                 echo "size:${fssize:-unknown};fstype:${fstype:-none}"
             fi
         done
+        if [ ! -e /sbin/lvs ]; then
+            continue
+        fi
+        # LVM
+        lvs --noheadings|while read lvname vgname perms size; do
+            echo "/dev/mapper/${vgname}-${lvname}"
+            echo "size:${size};fstype:lvm"
+        done
     done
 }