lvm2: add hotplug script to scan and enable PVs on hotplug
Automatically scan and activate physical volumes when added at runtime.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit f32236e542
)
This commit is contained in:
parent
633e6a3032
commit
3bbdaa49e0
2 changed files with 8 additions and 0 deletions
|
@ -144,6 +144,8 @@ define Package/lvm2/install
|
||||||
$(INSTALL_DATA) ./files/lvm2.preinit $(1)/lib/preinit/80_lvm2
|
$(INSTALL_DATA) ./files/lvm2.preinit $(1)/lib/preinit/80_lvm2
|
||||||
$(INSTALL_DIR) $(1)/etc/init.d
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
$(INSTALL_BIN) ./files/lvm2.init $(1)/etc/init.d/lvm2
|
$(INSTALL_BIN) ./files/lvm2.init $(1)/etc/init.d/lvm2
|
||||||
|
$(INSTALL_DIR) $(1)/etc/hotplug.d/block
|
||||||
|
$(INSTALL_DATA) ./files/lvm2.hotplug $(1)/etc/hotplug.d/block/20-lvm2
|
||||||
$(FIND) $(PKG_INSTALL_DIR)/usr/sbin/ -type l -exec $(CP) -a {} $(1)/sbin/ \;
|
$(FIND) $(PKG_INSTALL_DIR)/usr/sbin/ -type l -exec $(CP) -a {} $(1)/sbin/ \;
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
6
utils/lvm2/files/lvm2.hotplug
Normal file
6
utils/lvm2/files/lvm2.hotplug
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
[ "$ACTION" = "add" ] || return 0
|
||||||
|
[ -e "/dev/$DEVNAME" ] || return 0
|
||||||
|
|
||||||
|
/sbin/lvm vgscan --mknodes --devices /dev/$DEVNAME || :
|
||||||
|
/sbin/lvm vgchange -aly --devices /dev/$DEVNAME || :
|
Loading…
Reference in a new issue