diff mbox series

[bug#66586] gnu: lvm2: Remove systemd rule.

Message ID 716e42d582706ad11107e1b48bdd252966bd4133.1697532777.git.zimon.toutoune@gmail.com
State New
Headers show
Series [bug#66586] gnu: lvm2: Remove systemd rule. | expand

Commit Message

Simon Tournier Oct. 17, 2023, 8:57 a.m. UTC
From: Yann Dupont <Yann.Dupont@univ-nantes.fr>

Fixes <https://issues.guix.gnu.org/65177>.
Reported by Adrien 'neox' Bourmault <neox@gnu.org>.

* gnu/packages/patches/lvm2-no-systemd.patch: New file.
* gnu/packages/linux.scm (lvm2)[source]: Apply patch.
* gnu/local.mk: Register new patch.
---
 gnu/local.mk                               |  1 +
 gnu/packages/linux.scm                     |  1 +
 gnu/packages/patches/lvm2-no-systemd.patch | 22 ++++++++++++++++++++++
 3 files changed, 24 insertions(+)
 create mode 100644 gnu/packages/patches/lvm2-no-systemd.patch

Hi,

Here is the patch from Yann sent in patch 65177 [1].  I have just reformatted
it and preprare it for merging if it is correct.  I know nothing about udev.

1: https://issues.guix.gnu.org/65177#3

Cheers,
simon



base-commit: b437896e87a51cc610388d4c462893652dd773e6

Comments

Ludovic Courtès Oct. 23, 2023, 9:52 p.m. UTC | #1
Hi!

Simon Tournier <zimon.toutoune@gmail.com> skribis:

> From: Yann Dupont <Yann.Dupont@univ-nantes.fr>
>
> Fixes <https://issues.guix.gnu.org/65177>.
> Reported by Adrien 'neox' Bourmault <neox@gnu.org>.
>
> * gnu/packages/patches/lvm2-no-systemd.patch: New file.
> * gnu/packages/linux.scm (lvm2)[source]: Apply patch.
> * gnu/local.mk: Register new patch.

One minor nit:

> +++ b/gnu/packages/patches/lvm2-no-systemd.patch
> @@ -0,0 +1,22 @@
> +Fixes <https://issues.guix.gnu.org/65177>.
> +
> +Since lvm2 2.03.14, the included udev rules use systemd-run to run vgchange
> +and activate the volume group.  lvm2 was updated recently from 2.03.11 to
> +2.03.21, then 2.03.22, and probably started exhibiting this behavior then.  It
> +removes the indirection through systemd-run and directly run vgchange.

I propose to change this paragraph so that it is self-contained, like:

  Run ‘vgchange’ directly instead of attempting to run it via
  ‘systemd-run’ as the udev rules included in lvm2 >= 2.03.14 do.

LGTM with a change along these lines!

Ludo’.
Simon Tournier Oct. 24, 2023, 4:48 p.m. UTC | #2
Hi Ludo,

On Mon, 23 Oct 2023 at 23:52, Ludovic Courtès <ludo@gnu.org> wrote:

> I propose to change this paragraph so that it is self-contained, like:
>
>   Run ‘vgchange’ directly instead of attempting to run it via
>   ‘systemd-run’ as the udev rules included in lvm2 >= 2.03.14 do.

I copy/pasted these lines in v2.

Cheers,
simon
Yann Dupont March 5, 2024, 3:51 p.m. UTC | #3
Hi, this bug is still open, and, as far as I can tell, generating a VM 
using lvm2 is still currently broken.

Is there still a problem preventing this path from being integrated?
Adrien 'neox' Bourmault April 2, 2024, 5:26 p.m. UTC | #4
Hi there, I just tested it but it did not work while not showing the error I
reported earlier. I just obtain "Device ... not found or access denied".

However, it might be linked to 70051 too, so I'll try to test with that too (or
wait it's merged).
Yann Dupont April 10, 2024, 1:19 p.m. UTC | #5
Hi there,

I'd looked at the patch Simon reformatted and it seemed fine, but I just 
tested *this* thread's patch, and it doesn't seem to work.

I suspect there's an extra "-" in the 1st line of the 3rd patch (it 
wasn't in my original patch https://issues.guix.gnu.org/65177#3) 
<https://issues.guix.gnu.org/65177#3>.

the « - » in the line '-IMPORT{program}="(LVM_EXEC)/lvm pvscan --cache 
--listvg --checkcomplete --vgonline --autoactivation event --udevoutput 
--journal=output $env{DEVNAME}' is too much in the patch.

I've just tested the generation of a VM generated with the patch 
amputated from the excess line and it's ok.

Unless someone does it before me, I'll try again to post the correct 
version.
diff mbox series

Patch

diff --git a/gnu/local.mk b/gnu/local.mk
index daacd786a7..3d74c3e228 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1625,6 +1625,7 @@  dist_patch_DATA =						\
   %D%/packages/patches/mcrypt-CVE-2012-4527.patch			\
   %D%/packages/patches/libmemcached-build-with-gcc7.patch	\
   %D%/packages/patches/libmhash-hmac-fix-uaf.patch		\
+  %D%/packages/patches/lvm2-no-systemd.patch    		\
   %D%/packages/patches/maturin-no-cross-compile.patch		\
   %D%/packages/patches/mecab-variable-param.patch		\
   %D%/packages/patches/memtest86+-build-reproducibly.patch	\
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 6bb6d62182..6882244e92 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4527,6 +4527,7 @@  (define-public lvm2
               (sha256
                (base32
                 "0z6w6bknhwh1n3qfkb5ij6x57q3wjf28lq3l8kh7rkhsplinjnjc"))
+              (patches (search-patches "lvm2-no-systemd.patch"))
               (modules '((guix build utils)))
               (snippet
                '(begin
diff --git a/gnu/packages/patches/lvm2-no-systemd.patch b/gnu/packages/patches/lvm2-no-systemd.patch
new file mode 100644
index 0000000000..46b4dcffbb
--- /dev/null
+++ b/gnu/packages/patches/lvm2-no-systemd.patch
@@ -0,0 +1,22 @@ 
+Fixes <https://issues.guix.gnu.org/65177>.
+
+Since lvm2 2.03.14, the included udev rules use systemd-run to run vgchange
+and activate the volume group.  lvm2 was updated recently from 2.03.11 to
+2.03.21, then 2.03.22, and probably started exhibiting this behavior then.  It
+removes the indirection through systemd-run and directly run vgchange.
+
+diff --git a/udev/69-dm-lvm.rules.in b/udev/69-dm-lvm.rules.in
+index ff15681..f9e5b70 100644
+--- a/udev/69-dm-lvm.rules.in
++++ b/udev/69-dm-lvm.rules.in
+@@ -75,8 +75,8 @@ LABEL="lvm_scan"
+ # TODO: adjust the output of vgchange -aay so that
+ # it's better suited to appearing in the journal.
+ 
+-IMPORT{program}="(LVM_EXEC)/lvm pvscan --cache --listvg --checkcomplete --vgonline --autoactivation event --udevoutput --journal=output $env{DEVNAME}"
+-ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="(SYSTEMDRUN) --no-block --property DefaultDependencies=no --unit lvm-activate-$env{LVM_VG_NAME_COMPLETE} (LVM_EXEC)/lvm vgchange -aay --autoactivation event $env{LVM_VG_NAME_COMPLETE}"
++IMPORT{program}="(LVM_EXEC)/lvm pvscan --cache --listvg
++ENV{LVM_VG_NAME_COMPLETE}=="?*", RUN+="(SYSTEMDRUN) --no-block lvm-activate-$env{LVM_VG_NAME_COMPLETE} (LVM_EXEC)/lvm vgchange -aay
+ GOTO="lvm_end"
+ 
+ LABEL="lvm_end"