Skip to contentSkip to conversation

main - new udev autoactivation

PATCH David Teigland 1 participant 1 message Oct 7, 2021 Kbuild

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=67722b312390cdab29c076c912e14bd739c5c0f6
Commit:        67722b312390cdab29c076c912e14bd739c5c0f6
Parent:        bbf8e7db74d744c1462a63ae2bc64f4d46e8db9f
Author:        David Teigland <[email protected]>
AuthorDate:    Fri Mar 26 11:39:05 2021 -0500
Committer:     David Teigland <[email protected]>
CommitterDate: Thu Oct 7 12:42:31 2021 -0500

new udev autoactivation

new udev rule 69-dm-lvm.rules replaces
69-dm-lvm-meta.rules and lvm2-pvscan.service

udev rule calls pvscan directly on the added device

pvscan output indicates if a complete VG can be activated

udev env var LVM_VG_NAME_COMPLETE is used to pass complete VG name from pvscan to the udev rule

udev rule uses systemd-run to run vgchange -aay <vgname>

---
 scripts/Makefile.in                |   1 -
 spec/packages.inc                  |   3 +-
 test/shell/udev-pvscan-vgchange.sh | 403 +++++++++++++++++++++++++++++++++++++
 udev/69-dm-lvm.rules.in            |  87 ++++++++
 udev/Makefile.in                   |   2 +-
 5 files changed, 492 insertions(+), 4 deletions(-)
scripts/Makefile.in +0 -1
index ee0acb6f6..0d7f45680 100644
@@ -92,7 +92,6 @@ install_systemd_generators:
 install_systemd_units:	install_dbus_service
 	@echo "    [INSTALL] systemd_units"
 	$(Q) $(INSTALL_DIR) $(systemd_unit_dir)
-	$(Q) $(INSTALL_DATA) lvm2-pvscan.service $(systemd_unit_dir)/lvm2-pvscan at .service
 ifeq ("@BUILD_DMEVENTD@", "yes")
 	$(Q) $(INSTALL_DATA) dm_event_systemd_red_hat.socket $(systemd_unit_dir)/dm-event.socket
 	$(Q) $(INSTALL_DATA) dm_event_systemd_red_hat.service $(systemd_unit_dir)/dm-event.service
spec/packages.inc +1 -2
index 3f6e26d11..74d795520 100644
@@ -163,7 +163,7 @@ fi
 %endif
 %if %{enable_udev}
  %{_udevdir}/11-dm-lvm.rules
- %{_udevdir}/69-dm-lvm-metad.rules
+ %{_udevdir}/69-dm-lvm.rules
 %endif
 %dir %{_sysconfdir}/lvm
 %ghost %{_sysconfdir}/lvm/cache/.cache
@@ -189,7 +189,6 @@ fi
  %{_tmpfilesdir}/%{name}.conf
  %{_unitdir}/blk-availability.service
  %{_unitdir}/lvm2-monitor.service
- %{_unitdir}/lvm2-pvscan at .service
  %attr(555, -, -) %{_prefix}/lib/systemd/system-generators/lvm2-activation-generator
  %if %{have_service lvmpolld}
   %{_unitdir}/lvm2-lvmpolld.service
test/shell/udev-pvscan-vgchange.sh new file +403 -0

403 lines not on this page · raw message

udev/69-dm-lvm.rules.in new file +87 -0

87 lines not on this page · raw message

udev/Makefile.in +1 -1
index e32cba921..e777dda16 100644
@@ -18,7 +18,7 @@ top_builddir = @top_builddir@
 include $(top_builddir)/make.tmpl
 
 DM_RULES=10-dm.rules 13-dm-disk.rules 95-dm-notify.rules
-LVM_RULES=11-dm-lvm.rules 69-dm-lvm-metad.rules
+LVM_RULES=11-dm-lvm.rules 69-dm-lvm.rules
 
 DM_DIR=$(shell $(GREP) "\#define DM_DIR" $(top_srcdir)/libdm/misc/dm-ioctl.h | $(AWK) '{print $$3}')