public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
* [PATCH 1/5] lvm2: Ship with core system
@ 2020-01-15 15:20 Michael Tremer
  2020-01-15 15:20 ` [PATCH 2/5] lvm2: Build with support for udev Michael Tremer
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Michael Tremer @ 2020-01-15 15:20 UTC (permalink / raw)
  To: development

[-- Attachment #1: Type: text/plain, Size: 2690 bytes --]

This was requested by some users to mount devices
with LVM.

Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
---
 config/rootfiles/common/lvm2 | 102 +++++++++++++++++------------------
 1 file changed, 51 insertions(+), 51 deletions(-)

diff --git a/config/rootfiles/common/lvm2 b/config/rootfiles/common/lvm2
index db7f304e5..3c8187d00 100644
--- a/config/rootfiles/common/lvm2
+++ b/config/rootfiles/common/lvm2
@@ -1,5 +1,5 @@
 #etc/lvm
-#etc/lvm/lvm.conf
+etc/lvm/lvm.conf
 #etc/lvm/lvmlocal.conf
 #etc/lvm/profile
 #etc/lvm/profile/cache-mq.profile
@@ -13,56 +13,56 @@
 #usr/lib/libdevmapper.so
 usr/lib/libdevmapper.so.1.02
 #usr/lib/pkgconfig/devmapper.pc
-#usr/sbin/blkdeactivate
-#usr/sbin/dmsetup
-#usr/sbin/dmstats
-#usr/sbin/fsadm
-#usr/sbin/lvchange
-#usr/sbin/lvconvert
-#usr/sbin/lvcreate
-#usr/sbin/lvdisplay
-#usr/sbin/lvextend
-#usr/sbin/lvm
-#usr/sbin/lvmconf
-#usr/sbin/lvmconfig
-#usr/sbin/lvmdiskscan
-#usr/sbin/lvmdump
-#usr/sbin/lvmsadc
-#usr/sbin/lvmsar
-#usr/sbin/lvreduce
-#usr/sbin/lvremove
-#usr/sbin/lvrename
-#usr/sbin/lvresize
-#usr/sbin/lvs
-#usr/sbin/lvscan
-#usr/sbin/pvchange
-#usr/sbin/pvck
-#usr/sbin/pvcreate
-#usr/sbin/pvdisplay
-#usr/sbin/pvmove
-#usr/sbin/pvremove
-#usr/sbin/pvresize
-#usr/sbin/pvs
-#usr/sbin/pvscan
-#usr/sbin/vgcfgbackup
-#usr/sbin/vgcfgrestore
-#usr/sbin/vgchange
-#usr/sbin/vgck
-#usr/sbin/vgconvert
-#usr/sbin/vgcreate
-#usr/sbin/vgdisplay
-#usr/sbin/vgexport
-#usr/sbin/vgextend
-#usr/sbin/vgimport
-#usr/sbin/vgimportclone
-#usr/sbin/vgmerge
-#usr/sbin/vgmknodes
-#usr/sbin/vgreduce
-#usr/sbin/vgremove
-#usr/sbin/vgrename
-#usr/sbin/vgs
-#usr/sbin/vgscan
-#usr/sbin/vgsplit
+usr/sbin/blkdeactivate
+usr/sbin/dmsetup
+usr/sbin/dmstats
+usr/sbin/fsadm
+usr/sbin/lvchange
+usr/sbin/lvconvert
+usr/sbin/lvcreate
+usr/sbin/lvdisplay
+usr/sbin/lvextend
+usr/sbin/lvm
+usr/sbin/lvmconf
+usr/sbin/lvmconfig
+usr/sbin/lvmdiskscan
+usr/sbin/lvmdump
+usr/sbin/lvmsadc
+usr/sbin/lvmsar
+usr/sbin/lvreduce
+usr/sbin/lvremove
+usr/sbin/lvrename
+usr/sbin/lvresize
+usr/sbin/lvs
+usr/sbin/lvscan
+usr/sbin/pvchange
+usr/sbin/pvck
+usr/sbin/pvcreate
+usr/sbin/pvdisplay
+usr/sbin/pvmove
+usr/sbin/pvremove
+usr/sbin/pvresize
+usr/sbin/pvs
+usr/sbin/pvscan
+usr/sbin/vgcfgbackup
+usr/sbin/vgcfgrestore
+usr/sbin/vgchange
+usr/sbin/vgck
+usr/sbin/vgconvert
+usr/sbin/vgcreate
+usr/sbin/vgdisplay
+usr/sbin/vgexport
+usr/sbin/vgextend
+usr/sbin/vgimport
+usr/sbin/vgimportclone
+usr/sbin/vgmerge
+usr/sbin/vgmknodes
+usr/sbin/vgreduce
+usr/sbin/vgremove
+usr/sbin/vgrename
+usr/sbin/vgs
+usr/sbin/vgscan
+usr/sbin/vgsplit
 #usr/share/man/man5/lvm.conf.5
 #usr/share/man/man7/lvmcache.7
 #usr/share/man/man7/lvmraid.7
-- 
2.20.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/5] lvm2: Build with support for udev
  2020-01-15 15:20 [PATCH 1/5] lvm2: Ship with core system Michael Tremer
@ 2020-01-15 15:20 ` Michael Tremer
  2020-01-15 15:20 ` [PATCH 3/5] lvm2: Enable lvmetad Michael Tremer
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Tremer @ 2020-01-15 15:20 UTC (permalink / raw)
  To: development

[-- Attachment #1: Type: text/plain, Size: 1232 bytes --]

Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
---
 config/rootfiles/common/lvm2 | 4 ++++
 lfs/lvm2                     | 5 ++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/config/rootfiles/common/lvm2 b/config/rootfiles/common/lvm2
index 3c8187d00..5d2810450 100644
--- a/config/rootfiles/common/lvm2
+++ b/config/rootfiles/common/lvm2
@@ -9,6 +9,10 @@ etc/lvm/lvm.conf
 #etc/lvm/profile/metadata_profile_template.profile
 #etc/lvm/profile/thin-generic.profile
 #etc/lvm/profile/thin-performance.profile
+lib/udev/rules.d/10-dm.rules
+lib/udev/rules.d/11-dm-lvm.rules
+lib/udev/rules.d/13-dm-disk.rules
+lib/udev/rules.d/95-dm-notify.rules
 #usr/include/libdevmapper.h
 #usr/lib/libdevmapper.so
 usr/lib/libdevmapper.so.1.02
diff --git a/lfs/lvm2 b/lfs/lvm2
index fe6974279..63c338f3f 100644
--- a/lfs/lvm2
+++ b/lfs/lvm2
@@ -78,7 +78,10 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 		./configure \
 			--prefix=/usr \
 			--with-usrlibdir=/usr/lib \
-			--enable-pkgconfig
+			--enable-pkgconfig \
+			--with-udevdir=/lib/udev/rules.d \
+			--enable-udev_rules \
+			--enable-udev_sync
 	cd $(DIR_APP) && make $(MAKETUNING)
 	cd $(DIR_APP) && make install
 	@rm -rf $(DIR_APP)
-- 
2.20.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 3/5] lvm2: Enable lvmetad
  2020-01-15 15:20 [PATCH 1/5] lvm2: Ship with core system Michael Tremer
  2020-01-15 15:20 ` [PATCH 2/5] lvm2: Build with support for udev Michael Tremer
@ 2020-01-15 15:20 ` Michael Tremer
  2020-01-15 15:20 ` [PATCH 4/5] lvm2: Create lock files in /run/lvm Michael Tremer
  2020-01-15 15:20 ` [PATCH 5/5] lvm2: Add initscript for lvmetad Michael Tremer
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Tremer @ 2020-01-15 15:20 UTC (permalink / raw)
  To: development

[-- Attachment #1: Type: text/plain, Size: 1423 bytes --]

Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
---
 config/rootfiles/common/lvm2 | 3 +++
 lfs/lvm2                     | 1 +
 2 files changed, 4 insertions(+)

diff --git a/config/rootfiles/common/lvm2 b/config/rootfiles/common/lvm2
index 5d2810450..258f3201f 100644
--- a/config/rootfiles/common/lvm2
+++ b/config/rootfiles/common/lvm2
@@ -12,6 +12,7 @@ etc/lvm/lvm.conf
 lib/udev/rules.d/10-dm.rules
 lib/udev/rules.d/11-dm-lvm.rules
 lib/udev/rules.d/13-dm-disk.rules
+lib/udev/rules.d/69-dm-lvm-metad.rules
 lib/udev/rules.d/95-dm-notify.rules
 #usr/include/libdevmapper.h
 #usr/lib/libdevmapper.so
@@ -31,6 +32,7 @@ usr/sbin/lvmconf
 usr/sbin/lvmconfig
 usr/sbin/lvmdiskscan
 usr/sbin/lvmdump
+usr/sbin/lvmetad
 usr/sbin/lvmsadc
 usr/sbin/lvmsar
 usr/sbin/lvreduce
@@ -91,6 +93,7 @@ usr/sbin/vgsplit
 #usr/share/man/man8/lvmconfig.8
 #usr/share/man/man8/lvmdiskscan.8
 #usr/share/man/man8/lvmdump.8
+#usr/share/man/man8/lvmetad.8
 #usr/share/man/man8/lvmsadc.8
 #usr/share/man/man8/lvmsar.8
 #usr/share/man/man8/lvreduce.8
diff --git a/lfs/lvm2 b/lfs/lvm2
index 63c338f3f..b95c47517 100644
--- a/lfs/lvm2
+++ b/lfs/lvm2
@@ -80,6 +80,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 			--with-usrlibdir=/usr/lib \
 			--enable-pkgconfig \
 			--with-udevdir=/lib/udev/rules.d \
+			--enable-lvmetad \
 			--enable-udev_rules \
 			--enable-udev_sync
 	cd $(DIR_APP) && make $(MAKETUNING)
-- 
2.20.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 4/5] lvm2: Create lock files in /run/lvm
  2020-01-15 15:20 [PATCH 1/5] lvm2: Ship with core system Michael Tremer
  2020-01-15 15:20 ` [PATCH 2/5] lvm2: Build with support for udev Michael Tremer
  2020-01-15 15:20 ` [PATCH 3/5] lvm2: Enable lvmetad Michael Tremer
@ 2020-01-15 15:20 ` Michael Tremer
  2020-01-15 15:20 ` [PATCH 5/5] lvm2: Add initscript for lvmetad Michael Tremer
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Tremer @ 2020-01-15 15:20 UTC (permalink / raw)
  To: development

[-- Attachment #1: Type: text/plain, Size: 685 bytes --]

The default is /var/lock which is not mounted at the time
when udev is initialising the volumes. Therefore after a
reboot, LVM devices won't show up unless pvscan is executed
manually.

Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
---
 lfs/lvm2 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lfs/lvm2 b/lfs/lvm2
index b95c47517..a9e02b692 100644
--- a/lfs/lvm2
+++ b/lfs/lvm2
@@ -80,6 +80,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 			--with-usrlibdir=/usr/lib \
 			--enable-pkgconfig \
 			--with-udevdir=/lib/udev/rules.d \
+			--with-default-locking-dir=/run/lvm \
 			--enable-lvmetad \
 			--enable-udev_rules \
 			--enable-udev_sync
-- 
2.20.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 5/5] lvm2: Add initscript for lvmetad
  2020-01-15 15:20 [PATCH 1/5] lvm2: Ship with core system Michael Tremer
                   ` (2 preceding siblings ...)
  2020-01-15 15:20 ` [PATCH 4/5] lvm2: Create lock files in /run/lvm Michael Tremer
@ 2020-01-15 15:20 ` Michael Tremer
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Tremer @ 2020-01-15 15:20 UTC (permalink / raw)
  To: development

[-- Attachment #1: Type: text/plain, Size: 5285 bytes --]

This daemon needs to be launched in order to use LVM
devices in IPFire.

It will run on all installations after this patch has been
merged but only consumes very little memory.

Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
---
 config/rootfiles/common/aarch64/initscripts  |  2 +
 config/rootfiles/common/armv5tel/initscripts |  2 +
 config/rootfiles/common/i586/initscripts     |  2 +
 config/rootfiles/common/x86_64/initscripts   |  2 +
 lfs/initscripts                              |  1 +
 src/initscripts/system/lvmetad               | 41 ++++++++++++++++++++
 6 files changed, 50 insertions(+)
 create mode 100755 src/initscripts/system/lvmetad

diff --git a/config/rootfiles/common/aarch64/initscripts b/config/rootfiles/common/aarch64/initscripts
index 202da7372..ddf098ed4 100644
--- a/config/rootfiles/common/aarch64/initscripts
+++ b/config/rootfiles/common/aarch64/initscripts
@@ -26,6 +26,7 @@ etc/rc.d/init.d/functions
 etc/rc.d/init.d/halt
 etc/rc.d/init.d/ipsec
 etc/rc.d/init.d/leds
+etc/rc.d/init.d/lvmetad
 etc/rc.d/init.d/localnet
 etc/rc.d/init.d/modules
 etc/rc.d/init.d/mountfs
@@ -180,6 +181,7 @@ etc/rc.d/rc6.d/S99reboot
 etc/rc.d/rcsysinit.d/S00mountkernfs
 etc/rc.d/rcsysinit.d/S01sysctl
 etc/rc.d/rcsysinit.d/S05modules
+etc/rc.d/rcsysinit.d/S09lvmetad
 etc/rc.d/rcsysinit.d/S10udev
 etc/rc.d/rcsysinit.d/S19waitdrives
 etc/rc.d/rcsysinit.d/S20swap
diff --git a/config/rootfiles/common/armv5tel/initscripts b/config/rootfiles/common/armv5tel/initscripts
index 202da7372..ddf098ed4 100644
--- a/config/rootfiles/common/armv5tel/initscripts
+++ b/config/rootfiles/common/armv5tel/initscripts
@@ -26,6 +26,7 @@ etc/rc.d/init.d/functions
 etc/rc.d/init.d/halt
 etc/rc.d/init.d/ipsec
 etc/rc.d/init.d/leds
+etc/rc.d/init.d/lvmetad
 etc/rc.d/init.d/localnet
 etc/rc.d/init.d/modules
 etc/rc.d/init.d/mountfs
@@ -180,6 +181,7 @@ etc/rc.d/rc6.d/S99reboot
 etc/rc.d/rcsysinit.d/S00mountkernfs
 etc/rc.d/rcsysinit.d/S01sysctl
 etc/rc.d/rcsysinit.d/S05modules
+etc/rc.d/rcsysinit.d/S09lvmetad
 etc/rc.d/rcsysinit.d/S10udev
 etc/rc.d/rcsysinit.d/S19waitdrives
 etc/rc.d/rcsysinit.d/S20swap
diff --git a/config/rootfiles/common/i586/initscripts b/config/rootfiles/common/i586/initscripts
index 9d4f7e5f3..e666ed84e 100644
--- a/config/rootfiles/common/i586/initscripts
+++ b/config/rootfiles/common/i586/initscripts
@@ -26,6 +26,7 @@ etc/rc.d/init.d/functions
 etc/rc.d/init.d/halt
 etc/rc.d/init.d/ipsec
 etc/rc.d/init.d/leds
+etc/rc.d/init.d/lvmetad
 etc/rc.d/init.d/localnet
 etc/rc.d/init.d/modules
 etc/rc.d/init.d/mountfs
@@ -179,6 +180,7 @@ etc/rc.d/rc6.d/S99reboot
 etc/rc.d/rcsysinit.d/S00mountkernfs
 etc/rc.d/rcsysinit.d/S01sysctl
 etc/rc.d/rcsysinit.d/S05modules
+etc/rc.d/rcsysinit.d/S09lvmetad
 etc/rc.d/rcsysinit.d/S10udev
 etc/rc.d/rcsysinit.d/S19waitdrives
 etc/rc.d/rcsysinit.d/S20swap
diff --git a/config/rootfiles/common/x86_64/initscripts b/config/rootfiles/common/x86_64/initscripts
index 9d4f7e5f3..e666ed84e 100644
--- a/config/rootfiles/common/x86_64/initscripts
+++ b/config/rootfiles/common/x86_64/initscripts
@@ -26,6 +26,7 @@ etc/rc.d/init.d/functions
 etc/rc.d/init.d/halt
 etc/rc.d/init.d/ipsec
 etc/rc.d/init.d/leds
+etc/rc.d/init.d/lvmetad
 etc/rc.d/init.d/localnet
 etc/rc.d/init.d/modules
 etc/rc.d/init.d/mountfs
@@ -179,6 +180,7 @@ etc/rc.d/rc6.d/S99reboot
 etc/rc.d/rcsysinit.d/S00mountkernfs
 etc/rc.d/rcsysinit.d/S01sysctl
 etc/rc.d/rcsysinit.d/S05modules
+etc/rc.d/rcsysinit.d/S09lvmetad
 etc/rc.d/rcsysinit.d/S10udev
 etc/rc.d/rcsysinit.d/S19waitdrives
 etc/rc.d/rcsysinit.d/S20swap
diff --git a/lfs/initscripts b/lfs/initscripts
index d74e0c650..3a769bd99 100644
--- a/lfs/initscripts
+++ b/lfs/initscripts
@@ -161,6 +161,7 @@ $(TARGET) :
 	ln -sf ../init.d/mountkernfs /etc/rc.d/rcsysinit.d/S00mountkernfs
 	ln -sf ../init.d/sysctl      /etc/rc.d/rcsysinit.d/S01sysctl
 	ln -sf ../init.d/modules     /etc/rc.d/rcsysinit.d/S05modules
+	ln -sf ../init.d/lvmetad     /etc/rc.d/rcsysinit.d/S09lvmetad
 	ln -sf ../init.d/udev        /etc/rc.d/rcsysinit.d/S10udev
 	ln -sf ../init.d/waitdrives  /etc/rc.d/rcsysinit.d/S19waitdrives
 	ln -sf ../init.d/swap        /etc/rc.d/rcsysinit.d/S20swap
diff --git a/src/initscripts/system/lvmetad b/src/initscripts/system/lvmetad
new file mode 100755
index 000000000..fdae39fd9
--- /dev/null
+++ b/src/initscripts/system/lvmetad
@@ -0,0 +1,41 @@
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/lvmeta2
+#
+# Description : LVM2 Metadata Daemon
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+case "${1}" in
+	start)
+		# Create diretory for control socket
+		mkdir -p /run/lvm
+
+		boot_mesg "Starting LVM2 Metadata Daemon..."
+		loadproc /usr/sbin/lvmetad
+		;;
+
+	stop)
+		boot_mesg "Stopping LVM2 Metadata Daemon..."
+		killproc /usr/sbin/lvmetad
+		;;
+
+	restart)
+		${0} stop
+		sleep 1
+		${0} start
+		;;
+
+	status)
+		statusproc /usr/sbin/lvmetad
+		;;
+
+	*)
+		echo "Usage: ${0} {start|stop|restart|status}"
+		exit 1
+		;;
+esac
+
+# End $rc_base/init.d/lvmetad
-- 
2.20.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-01-15 15:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-15 15:20 [PATCH 1/5] lvm2: Ship with core system Michael Tremer
2020-01-15 15:20 ` [PATCH 2/5] lvm2: Build with support for udev Michael Tremer
2020-01-15 15:20 ` [PATCH 3/5] lvm2: Enable lvmetad Michael Tremer
2020-01-15 15:20 ` [PATCH 4/5] lvm2: Create lock files in /run/lvm Michael Tremer
2020-01-15 15:20 ` [PATCH 5/5] lvm2: Add initscript for lvmetad Michael Tremer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox