]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
lvm: add files needed for LVM system id support
authorHarald Hoyer <harald@redhat.com>
Mon, 16 Mar 2015 10:55:13 +0000 (11:55 +0100)
committerHarald Hoyer <harald@redhat.com>
Mon, 16 Mar 2015 10:55:13 +0000 (11:55 +0100)
The LVM system id support is recent addition to LVM. See
https://git.fedorahosted.org/cgit/lvm2.git/tree/man/lvmsystemid.7.in for
more information (since lvm v2.02.117, currently the configuration is
ignored, but we will enable it soon in next release).

https://bugzilla.redhat.com/show_bug.cgi?id=1199918

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

index c799a1cfb7b846dd0ead73619603d677bd84f1ac..82690781b994ca749f2ea5a8f5868e076e96c7c0 100755 (executable)
@@ -67,6 +67,20 @@ install() {
             sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 4/' ${initdir}/etc/lvm/lvm.conf
             sed -i -e 's/\(^[[:space:]]*\)use_lvmetad[[:space:]]*=[[:space:]]*[[:digit:]]/\1use_lvmetad = 0/' ${initdir}/etc/lvm/lvm.conf
         fi
+
+        export LVM_SUPPRESS_FD_WARNINGS=1
+        # Also install any files needed for LVM system id support.
+        if [ -f /etc/lvm/lvmlocal.conf ]; then
+            inst_simple -H /etc/lvm/lvmlocal.conf
+        fi
+        eval $(lvm dumpconfig global/system_id_source)
+        if [ "$system_id_source" == "file" ]; then
+            eval $(lvm dumpconfig global/system_id_file)
+            if [ -f "$system_id_file" ]; then
+                inst_simple -H $system_id_file
+            fi
+        fi
+        unset LVM_SUPPRESS_FD_WARNINGS
     fi
 
     if ! [[ -e ${initdir}/etc/lvm/lvm.conf ]]; then