]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
lvm: add tools for thin provisioning
authorHarald Hoyer <harald@redhat.com>
Thu, 30 May 2013 10:02:59 +0000 (12:02 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 30 May 2013 10:02:59 +0000 (12:02 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=921235

modules.d/90lvm/module-setup.sh

index 22186f4431e5d00828545f6a029101c485b617ca..e8416ca85f8eba5b954db90aaa49242ded0c2911 100755 (executable)
@@ -3,7 +3,6 @@
 # ex: ts=8 sw=4 sts=4 et filetype=sh
 
 check() {
-    local _rootdev _activated
     # No point trying to support lvm if the binaries are missing
     type -P lvm >/dev/null || return 1
 
@@ -25,6 +24,8 @@ depends() {
 
 install() {
     local _i
+    local _needthin
+    local _activated
     inst lvm
 
     check_lvm() {
@@ -39,6 +40,10 @@ install() {
             fi
             push _activated "${DM_VG_NAME}/${DM_LV_NAME}"
         fi
+        if ! [[ $_needthin ]]; then
+            [[ $(lvs --noheadings -o segtype $1) == *thin* ]] && _needthin=1
+        fi
+
         return 0
     }
 
@@ -65,5 +70,10 @@ install() {
     inst_hook cmdline 30 "$moddir/parse-lvm.sh"
 
     inst_libdir_file "libdevmapper-event-lvm*.so"
+
+    if [[ $_needthin ]]; then
+        dracut_install -o thin_dump thin_restore thin_check
+    fi
+
 }