Merge ~bluca/ubuntu/+source/lvm2:errno_backport into ubuntu/+source/lvm2:ubuntu/noble

Proposed by Luca Boccassi
Status: Superseded
Proposed branch: ~bluca/ubuntu/+source/lvm2:errno_backport
Merge into: ubuntu/+source/lvm2:ubuntu/noble
Diff against target: 829 lines (+405/-144) (has conflicts)
23 files modified
debian/changelog (+37/-0)
debian/control (+4/-1)
debian/dmeventd.install (+4/-4)
debian/dmsetup-udeb.install (+1/-1)
debian/dmsetup.install (+4/-4)
debian/libdevmapper-event1.02.1.install (+1/-1)
debian/libdevmapper1.02.1-udeb.install (+1/-1)
debian/libdevmapper1.02.1.install (+1/-1)
debian/liblvm2cmd2.03.install (+1/-1)
debian/lvm2-dbusd.install (+2/-2)
debian/lvm2-lockd.install (+4/-4)
debian/lvm2-udeb.install (+44/-44)
debian/lvm2.install (+51/-51)
debian/patches/debian-changes (+26/-14)
debian/patches/libdm-propagate-ioctl-errors-back-to-caller.patch (+67/-0)
debian/patches/series (+4/-0)
debian/pipeline/build.yml (+42/-0)
debian/pipeline/source.yml (+34/-0)
debian/pipeline/test.yml (+30/-0)
debian/pipeline/variables.yml (+5/-0)
debian/pipeline/workflow.yml (+40/-0)
debian/rules (+2/-7)
dev/null (+0/-8)
Conflict in debian/changelog
Conflict in debian/control
Conflict in debian/patches/series
Reviewer Review Type Date Requested Status
Ubuntu Sponsors Pending
git-ubuntu import Pending
Review via email: mp+460984@code.launchpad.net

This proposal has been superseded by a proposal from 2024-02-27.

Commit message

libdm: backport patch to fix return code from device-mapper

Description of the change

When libcryptsetup tries to activate a signed dm-verity volume, and the key is not in the kernel keyring, libdevicemapper does not return the appropriate ENOKEY, so the failure cannot be distinguished from other generic issues.

This is fixed in the lvm2 version 2.03.23 upstream release.

Please consider backporting this patch for Noble.

Upstream PR: https://gitlab.com/lvmteam/lvm2/-/merge_requests/3
Upstream commit: 25ef7a7b1a876f491bd361369423d7309358f6c1

To post a comment you must log in.
45e76ca... by Dave Jones

2.03.16-3ubuntu1 (patches unapplied)

Imported using git-ubuntu import.

Unmerged commits

d4580c5... by Luca Boccassi

libdm: backport patch to fix return code from device-mapper

Backport patch from latest upstream lvm2 version. Fixes returning an
accurate error code to libcryptsetup when opening a dm-verity device
fails due to a missing key. Needed for cryptsetup 2.7.0 and systemd
256.

45e76ca... by Dave Jones

2.03.16-3ubuntu1 (patches unapplied)

Imported using git-ubuntu import.

f261e93... by Bastian Blank

2.03.16-3 (patches unapplied)

Imported using git-ubuntu import.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/.gitignore b/debian/.gitignore
2deleted file mode 100644
3index a6c60b7..0000000
4--- a/debian/.gitignore
5+++ /dev/null
6@@ -1,8 +0,0 @@
7-/autoreconf.*
8-/debhelper*
9-/files
10-/*.debhelper
11-/*.log
12-/*.substvars
13-/*/
14-!/bin/
15diff --git a/debian/changelog b/debian/changelog
16index b89e409..6547980 100644
17--- a/debian/changelog
18+++ b/debian/changelog
19@@ -1,3 +1,40 @@
20+<<<<<<< debian/changelog
21+=======
22+lvm2 (2.03.16-3ubuntu1) noble; urgency=medium
23+
24+ * Merge from Debian unstable (LP: #2054683). Remaining changes:
25+ - Lower libdevmapper1.02.1's Depends: dmsetup to a Recommends:. This
26+ breaks the circular dependency that causes upgrade failures. As dmsetup
27+ is "Priority: required", this has no other practical consequences.
28+ (Debian #586424)
29+ - Add debian/initramfs-tools/lvm2/scripts/init-bottom/lvm2: We cannot
30+ properly synthesize LVM LV change events with udevadm trigger, so if we
31+ use LVM, we need to let it finish; otherwise we get missing LV symlinks.
32+ - Add enable-issue-discards.patch: Enable "issue_discards" option by
33+ default to trim SSDs when changing PVs. This option has no effect if the
34+ kernel or the drive does not support trimming, so it's safe to enable by
35+ default. (Debian #717313)
36+ - debian/rules:
37+ - Copy .po file to .pot file for Rosetta (Ubuntu specific).
38+ - debian/initramfs-tools/lvm2/hooks/lvm2: depend on udev since we ship
39+ udev rules.
40+ - Do not start lvm2-monitor in containers (LP #1576341)
41+ - Fix patch of systemd-run in 69-lvm-metad.rules
42+ - d/control: add thin-provisioning-tools build-dep as configure wants it
43+ around for some checks at build time.
44+ - Don't build udeb targets.
45+
46+ -- Dave Jones <dave.jones@canonical.com> Thu, 22 Feb 2024 10:28:18 +0000
47+
48+lvm2 (2.03.16-3) unstable; urgency=medium
49+
50+ * Remove obsolete dependency on lsb-base.
51+ * Expect systemd relates files in /usr. (closes: #1052666)
52+ * Move all remaining files to /usr.
53+
54+ -- Bastian Blank <waldi@debian.org> Sat, 06 Jan 2024 18:47:24 +0100
55+
56+>>>>>>> debian/changelog
57 lvm2 (2.03.16-2ubuntu1) mantic; urgency=medium
58
59 * Merge from Debian unstable (LP: #2020464). Remaining changes:
60diff --git a/debian/control b/debian/control
61index fff01ca..a43599e 100644
62--- a/debian/control
63+++ b/debian/control
64@@ -11,7 +11,11 @@ Build-Depends:
65 libaio-dev,
66 libblkid-dev,
67 pkg-config,
68+<<<<<<< debian/control
69 systemd,
70+=======
71+ systemd-dev (>= 255~rc1-1),
72+>>>>>>> debian/control
73 thin-provisioning-tools
74 Build-Depends-Arch:
75 libcmap-dev,
76@@ -43,7 +47,6 @@ Pre-Depends:
77 Depends:
78 ${shlibs:Depends},
79 ${misc:Depends},
80- lsb-base,
81 dmsetup (>= ${devmapper:Version}~),
82 dmeventd (>= ${devmapper:Version}~),
83 Recommends:
84diff --git a/debian/dmeventd.install b/debian/dmeventd.install
85index b2575e4..a7e600a 100644
86--- a/debian/dmeventd.install
87+++ b/debian/dmeventd.install
88@@ -1,5 +1,5 @@
89-lib/*/libdevmapper-event-*
90-lib/*/device-mapper/libdevmapper-event-*
91-lib/systemd/system/dm-event*
92-sbin/dmeventd
93+usr/lib/*/libdevmapper-event-*
94+usr/lib/*/device-mapper/libdevmapper-event-*
95+usr/lib/systemd/system/dm-event*
96+usr/sbin/dmeventd
97 usr/share/man/man8/dmeventd.8
98diff --git a/debian/dmsetup-udeb.install b/debian/dmsetup-udeb.install
99index 365b8c4..65a81e6 100644
100--- a/debian/dmsetup-udeb.install
101+++ b/debian/dmsetup-udeb.install
102@@ -1 +1 @@
103-sbin/dmsetup
104+usr/sbin/dmsetup
105diff --git a/debian/dmsetup.install b/debian/dmsetup.install
106index 3c99dd4..92b6302 100644
107--- a/debian/dmsetup.install
108+++ b/debian/dmsetup.install
109@@ -1,8 +1,8 @@
110 ../../initramfs-tools/dmsetup/* usr/share/initramfs-tools
111-lib/udev/rules.d/*-dm*.rules
112-sbin/blkdeactivate
113-sbin/dmsetup
114-sbin/dmstats
115+usr/lib/udev/rules.d/*-dm*.rules
116+usr/sbin/blkdeactivate
117+usr/sbin/dmsetup
118+usr/sbin/dmstats
119 usr/share/man/man8/blkdeactivate.8
120 usr/share/man/man8/dmsetup.8
121 usr/share/man/man8/dmstats.8
122diff --git a/debian/libdevmapper-event1.02.1.install b/debian/libdevmapper-event1.02.1.install
123index 95205d0..f8a341b 100644
124--- a/debian/libdevmapper-event1.02.1.install
125+++ b/debian/libdevmapper-event1.02.1.install
126@@ -1 +1 @@
127-lib/*/libdevmapper-event.so.*
128+usr/lib/*/libdevmapper-event.so.*
129diff --git a/debian/libdevmapper1.02.1-udeb.install b/debian/libdevmapper1.02.1-udeb.install
130index b52a762..824d82a 100644
131--- a/debian/libdevmapper1.02.1-udeb.install
132+++ b/debian/libdevmapper1.02.1-udeb.install
133@@ -1 +1 @@
134-lib/libdevmapper.so.*
135+usr/lib/*/libdevmapper.so.*
136diff --git a/debian/libdevmapper1.02.1.install b/debian/libdevmapper1.02.1.install
137index 3bb9eb5..824d82a 100644
138--- a/debian/libdevmapper1.02.1.install
139+++ b/debian/libdevmapper1.02.1.install
140@@ -1 +1 @@
141-lib/*/libdevmapper.so.*
142+usr/lib/*/libdevmapper.so.*
143diff --git a/debian/liblvm2cmd2.03.install b/debian/liblvm2cmd2.03.install
144index 62dd951..d257beb 100644
145--- a/debian/liblvm2cmd2.03.install
146+++ b/debian/liblvm2cmd2.03.install
147@@ -1 +1 @@
148-lib/*/liblvm2cmd.so.2.03
149+usr/lib/*/liblvm2cmd.so.2.03
150diff --git a/debian/lvm2-dbusd.install b/debian/lvm2-dbusd.install
151index f1fec56..7369c67 100644
152--- a/debian/lvm2-dbusd.install
153+++ b/debian/lvm2-dbusd.install
154@@ -1,6 +1,6 @@
155 etc/dbus-1/system.d/com.redhat.lvmdbus1.conf
156-lib/systemd/system/lvm2-lvmdbusd.service
157-sbin/lvmdbusd
158+usr/lib/systemd/system/lvm2-lvmdbusd.service
159+usr/sbin/lvmdbusd
160 usr/lib/python*/*-packages/lvmdbusd/
161 usr/share/dbus-1/system-services/com.redhat.lvmdbus1.service
162 usr/share/man/man8/lvmdbusd.8
163diff --git a/debian/lvm2-lockd.install b/debian/lvm2-lockd.install
164index 47bb346..c0cba36 100644
165--- a/debian/lvm2-lockd.install
166+++ b/debian/lvm2-lockd.install
167@@ -1,6 +1,6 @@
168-lib/systemd/system/lvmlockd.service
169-lib/systemd/system/lvmlocks.service
170-sbin/lvmlockctl
171-sbin/lvmlockd
172+usr/lib/systemd/system/lvmlockd.service
173+usr/lib/systemd/system/lvmlocks.service
174+usr/sbin/lvmlockctl
175+usr/sbin/lvmlockd
176 usr/share/man/man8/lvmlockctl.8
177 usr/share/man/man8/lvmlockd.8
178diff --git a/debian/lvm2-udeb.install b/debian/lvm2-udeb.install
179index e89e9be..2a4f950 100644
180--- a/debian/lvm2-udeb.install
181+++ b/debian/lvm2-udeb.install
182@@ -1,45 +1,45 @@
183 etc/lvm/lvm.conf
184-sbin/lvchange
185-sbin/lvconvert
186-sbin/lvcreate
187-sbin/lvdisplay
188-sbin/lvextend
189-sbin/lvm
190-sbin/lvmconfig
191-sbin/lvmdiskscan
192-sbin/lvmsadc
193-sbin/lvmsar
194-sbin/lvreduce
195-sbin/lvremove
196-sbin/lvrename
197-sbin/lvresize
198-sbin/lvs
199-sbin/lvscan
200-sbin/pvchange
201-sbin/pvck
202-sbin/pvcreate
203-sbin/pvdisplay
204-sbin/pvmove
205-sbin/pvremove
206-sbin/pvresize
207-sbin/pvs
208-sbin/pvscan
209-sbin/vgcfgbackup
210-sbin/vgcfgrestore
211-sbin/vgchange
212-sbin/vgck
213-sbin/vgconvert
214-sbin/vgcreate
215-sbin/vgdisplay
216-sbin/vgexport
217-sbin/vgextend
218-sbin/vgimport
219-sbin/vgimportclone
220-sbin/vgmerge
221-sbin/vgmknodes
222-sbin/vgreduce
223-sbin/vgremove
224-sbin/vgrename
225-sbin/vgs
226-sbin/vgscan
227-sbin/vgsplit
228+usr/sbin/lvchange
229+usr/sbin/lvconvert
230+usr/sbin/lvcreate
231+usr/sbin/lvdisplay
232+usr/sbin/lvextend
233+usr/sbin/lvm
234+usr/sbin/lvmconfig
235+usr/sbin/lvmdiskscan
236+usr/sbin/lvmsadc
237+usr/sbin/lvmsar
238+usr/sbin/lvreduce
239+usr/sbin/lvremove
240+usr/sbin/lvrename
241+usr/sbin/lvresize
242+usr/sbin/lvs
243+usr/sbin/lvscan
244+usr/sbin/pvchange
245+usr/sbin/pvck
246+usr/sbin/pvcreate
247+usr/sbin/pvdisplay
248+usr/sbin/pvmove
249+usr/sbin/pvremove
250+usr/sbin/pvresize
251+usr/sbin/pvs
252+usr/sbin/pvscan
253+usr/sbin/vgcfgbackup
254+usr/sbin/vgcfgrestore
255+usr/sbin/vgchange
256+usr/sbin/vgck
257+usr/sbin/vgconvert
258+usr/sbin/vgcreate
259+usr/sbin/vgdisplay
260+usr/sbin/vgexport
261+usr/sbin/vgextend
262+usr/sbin/vgimport
263+usr/sbin/vgimportclone
264+usr/sbin/vgmerge
265+usr/sbin/vgmknodes
266+usr/sbin/vgreduce
267+usr/sbin/vgremove
268+usr/sbin/vgrename
269+usr/sbin/vgs
270+usr/sbin/vgscan
271+usr/sbin/vgsplit
272diff --git a/debian/lvm2.install b/debian/lvm2.install
273index 7cee14f..f5f5ee4 100644
274--- a/debian/lvm2.install
275+++ b/debian/lvm2.install
276@@ -1,56 +1,56 @@
277 ../../initramfs-tools/lvm2/* usr/share/initramfs-tools
278 etc/lvm
279-lib/systemd/system/blk-availability*
280-lib/systemd/system/lvm2-lvmpolld*
281-lib/systemd/system/lvm2-monitor*
282-lib/udev/rules.d/*-lvm*.rules
283-sbin/fsadm
284-sbin/lvchange
285-sbin/lvconvert
286-sbin/lvcreate
287-sbin/lvdisplay
288-sbin/lvextend
289-sbin/lvm
290-sbin/lvmconfig
291-sbin/lvmdiskscan
292-sbin/lvmdump
293-sbin/lvmpolld
294-sbin/lvmsadc
295-sbin/lvmsar
296-sbin/lvreduce
297-sbin/lvremove
298-sbin/lvrename
299-sbin/lvresize
300-sbin/lvs
301-sbin/lvscan
302-sbin/pvchange
303-sbin/pvck
304-sbin/pvcreate
305-sbin/pvdisplay
306-sbin/pvmove
307-sbin/pvremove
308-sbin/pvresize
309-sbin/pvs
310-sbin/pvscan
311-sbin/vgcfgbackup
312-sbin/vgcfgrestore
313-sbin/vgchange
314-sbin/vgck
315-sbin/vgconvert
316-sbin/vgcreate
317-sbin/vgdisplay
318-sbin/vgexport
319-sbin/vgextend
320-sbin/vgimport
321-sbin/vgimportclone
322-sbin/vgmerge
323-sbin/vgmknodes
324-sbin/vgreduce
325-sbin/vgremove
326-sbin/vgrename
327-sbin/vgs
328-sbin/vgscan
329-sbin/vgsplit
330+usr/lib/systemd/system/blk-availability*
331+usr/lib/systemd/system/lvm2-lvmpolld*
332+usr/lib/systemd/system/lvm2-monitor*
333+usr/lib/udev/rules.d/*-lvm*.rules
334+usr/sbin/fsadm
335+usr/sbin/lvchange
336+usr/sbin/lvconvert
337+usr/sbin/lvcreate
338+usr/sbin/lvdisplay
339+usr/sbin/lvextend
340+usr/sbin/lvm
341+usr/sbin/lvmconfig
342+usr/sbin/lvmdiskscan
343+usr/sbin/lvmdump
344+usr/sbin/lvmpolld
345+usr/sbin/lvmsadc
346+usr/sbin/lvmsar
347+usr/sbin/lvreduce
348+usr/sbin/lvremove
349+usr/sbin/lvrename
350+usr/sbin/lvresize
351+usr/sbin/lvs
352+usr/sbin/lvscan
353+usr/sbin/pvchange
354+usr/sbin/pvck
355+usr/sbin/pvcreate
356+usr/sbin/pvdisplay
357+usr/sbin/pvmove
358+usr/sbin/pvremove
359+usr/sbin/pvresize
360+usr/sbin/pvs
361+usr/sbin/pvscan
362+usr/sbin/vgcfgbackup
363+usr/sbin/vgcfgrestore
364+usr/sbin/vgchange
365+usr/sbin/vgck
366+usr/sbin/vgconvert
367+usr/sbin/vgcreate
368+usr/sbin/vgdisplay
369+usr/sbin/vgexport
370+usr/sbin/vgextend
371+usr/sbin/vgimport
372+usr/sbin/vgimportclone
373+usr/sbin/vgmerge
374+usr/sbin/vgmknodes
375+usr/sbin/vgreduce
376+usr/sbin/vgremove
377+usr/sbin/vgrename
378+usr/sbin/vgs
379+usr/sbin/vgscan
380+usr/sbin/vgsplit
381 usr/lib/tmpfiles.d/lvm2.conf
382 usr/share/man/man5/lvm.conf.5
383 usr/share/man/man7/lvmcache.7
384diff --git a/debian/patches/debian-changes b/debian/patches/debian-changes
385index 62551a4..f870cae 100644
386--- a/debian/patches/debian-changes
387+++ b/debian/patches/debian-changes
388@@ -1,5 +1,17 @@
389+diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
390+new file mode 100644
391+index 0000000000000000000000000000000000000000..a3240a084f5f4374c38470467d51462e4d6bf905
392+--- /dev/null
393++++ b/.gitlab-ci.yml
394+@@ -0,0 +1,6 @@
395++include:
396++- local: debian/pipeline/workflow.yml
397++- local: debian/pipeline/variables.yml
398++- local: debian/pipeline/source.yml
399++- local: debian/pipeline/build.yml
400++- local: debian/pipeline/test.yml
401 diff --git a/configure.ac b/configure.ac
402-index 6cdf1a7e6..181a62be8 100644
403+index 6cdf1a7e652a982cd648e8b194d774ebfeb9aa41..181a62be87e66be444f3f3af3928c61be828567d 100644
404 --- a/configure.ac
405 +++ b/configure.ac
406 @@ -708,8 +708,8 @@ AC_ARG_VAR([AIO_LIBS], [linker flags for AIO])
407@@ -123,7 +135,7 @@ index 6cdf1a7e6..181a62be8 100644
408 AC_SUBST(UDEV_HAS_BUILTIN_BLKID)
409 AC_SUBST(USE_TRACKING)
410 diff --git a/daemons/dmeventd/.exported_symbols b/daemons/dmeventd/.exported_symbols
411-index fab74dc1d..46c14fb5a 100644
412+index fab74dc1d6f3dd8e740a3806d8424855bb399df6..46c14fb5ae4935104891f41e2cd626078baf22f9 100644
413 --- a/daemons/dmeventd/.exported_symbols
414 +++ b/daemons/dmeventd/.exported_symbols
415 @@ -1,4 +1,4 @@
416@@ -135,7 +147,7 @@ index fab74dc1d..46c14fb5a 100644
417 +dm_event_daemon_talk
418 dm_event_get_version
419 diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
420-index d89ab4af8..d31a5d558 100644
421+index d89ab4af8aeb3ffbaa7744fb26100063e035b0ec..d31a5d558ba989d0078a7941df67be8a68171de4 100644
422 --- a/daemons/dmeventd/dmeventd.c
423 +++ b/daemons/dmeventd/dmeventd.c
424 @@ -1986,7 +1986,7 @@ static int _reinstate_registrations(struct dm_event_fifos *fifos)
425@@ -223,7 +235,7 @@ index d89ab4af8..d31a5d558 100644
426 }
427
428 diff --git a/daemons/dmeventd/dmeventd.h b/daemons/dmeventd/dmeventd.h
429-index afe0b0c4b..a3dad10a0 100644
430+index afe0b0c4b66740bb021719bb54c5c426080ba7cf..a3dad10a0c5a14005a5ef095ff8698ccb1cdccd2 100644
431 --- a/daemons/dmeventd/dmeventd.h
432 +++ b/daemons/dmeventd/dmeventd.h
433 @@ -65,12 +65,12 @@ struct dm_event_fifos {
434@@ -243,7 +255,7 @@ index afe0b0c4b..a3dad10a0 100644
435
436 #endif /* __DMEVENTD_DOT_H__ */
437 diff --git a/daemons/dmeventd/libdevmapper-event.c b/daemons/dmeventd/libdevmapper-event.c
438-index 30df1da21..282293463 100644
439+index 30df1da216dbe75c8140fd989e8e16989f6de86b..2822934636a7bd0d74aa9df484efa9c371e58d66 100644
440 --- a/daemons/dmeventd/libdevmapper-event.c
441 +++ b/daemons/dmeventd/libdevmapper-event.c
442 @@ -349,7 +349,7 @@ static int _daemon_write(struct dm_event_fifos *fifos,
443@@ -307,7 +319,7 @@ index 30df1da21..282293463 100644
444 p = msg.data;
445 *version = 0;
446 diff --git a/daemons/lvmdbusd/Makefile.in b/daemons/lvmdbusd/Makefile.in
447-index d9cf5d886..2fa80c465 100644
448+index d9cf5d8863110e4fe185083ac0ec68ab137bd002..2fa80c465ad99db28ce393783675da90e7d3e261 100644
449 --- a/daemons/lvmdbusd/Makefile.in
450 +++ b/daemons/lvmdbusd/Makefile.in
451 @@ -16,7 +16,7 @@ top_srcdir = @top_srcdir@
452@@ -330,7 +342,7 @@ index d9cf5d886..2fa80c465 100644
453 install_lvm2: install_lvmdbusd
454
455 diff --git a/daemons/lvmlockd/Makefile.in b/daemons/lvmlockd/Makefile.in
456-index 91beb1ad8..44378b01b 100644
457+index 91beb1ad8ef3a8741887347a4cee981e74d4a8f9..44378b01b506bdce827693ad811849263f725c6f 100644
458 --- a/daemons/lvmlockd/Makefile.in
459 +++ b/daemons/lvmlockd/Makefile.in
460 @@ -15,8 +15,6 @@ srcdir = @srcdir@
461@@ -361,7 +373,7 @@ index 91beb1ad8..44378b01b 100644
462 lvmlockd: $(OBJECTS) $(top_builddir)/libdaemon/server/libdaemonserver.a $(INTERNAL_LIBS)
463 @echo " [CC] $@"
464 diff --git a/make.tmpl.in b/make.tmpl.in
465-index cccda10d6..01f149cc9 100644
466+index cccda10d6f1045ee828ed41bf389334d63c160da..01f149cc9447ec112e84c045daa8d72db255f972 100644
467 --- a/make.tmpl.in
468 +++ b/make.tmpl.in
469 @@ -27,20 +27,10 @@ SHELL = @SHELL@
470@@ -464,7 +476,7 @@ index cccda10d6..01f149cc9 100644
471 %.so: %.o
472 @echo " [CC] $(<F)"
473 diff --git a/scripts/blk_availability_systemd_red_hat.service.in b/scripts/blk_availability_systemd_red_hat.service.in
474-index 4102566be..17414ac37 100644
475+index 4102566be0cfa174609aceebabe25cd5415c50ff..17414ac3756da59d307b2433fcf9c10a7db73df9 100644
476 --- a/scripts/blk_availability_systemd_red_hat.service.in
477 +++ b/scripts/blk_availability_systemd_red_hat.service.in
478 @@ -7,7 +7,6 @@ Conflicts=shutdown.target
479@@ -476,7 +488,7 @@ index 4102566be..17414ac37 100644
480 RemainAfterExit=yes
481
482 diff --git a/udev/10-dm.rules.in b/udev/10-dm.rules.in
483-index b4fa52ab7..69d2c47ec 100644
484+index b4fa52ab766effb04fc198fd52e6181ad5758eef..69d2c47ecce84c03f06abc61fe4f9e12f58231cb 100644
485 --- a/udev/10-dm.rules.in
486 +++ b/udev/10-dm.rules.in
487 @@ -32,7 +32,6 @@ KERNEL=="device-mapper", NAME="(DM_DIR)/control"
488@@ -522,7 +534,7 @@ index b4fa52ab7..69d2c47ec 100644
489
490 ENV{DM_UDEV_DISABLE_DM_RULES_FLAG}!="1", ENV{DM_NAME}=="?*", SYMLINK+="(DM_DIR)/$env{DM_NAME}"
491 diff --git a/udev/69-dm-lvm-metad.rules.in b/udev/69-dm-lvm-metad.rules.in
492-index a2384f2af..264c40e4a 100644
493+index a2384f2afe904ced407393b549b19387c230da32..264c40e4a27743b9626eb1889360a2b945b60485 100644
494 --- a/udev/69-dm-lvm-metad.rules.in
495 +++ b/udev/69-dm-lvm-metad.rules.in
496 @@ -46,7 +46,7 @@ LABEL="next"
497@@ -574,7 +586,7 @@ index a2384f2af..264c40e4a 100644
498
499 LABEL="lvm_end"
500 diff --git a/udev/69-dm-lvm.rules.in b/udev/69-dm-lvm.rules.in
501-index 14e7dd26d..b32b94ac7 100644
502+index 14e7dd26d6c3eb3f32394e12a3daaa0250fe2725..b32b94ac7cdc37896f7c0ef874b0a42521e0a77c 100644
503 --- a/udev/69-dm-lvm.rules.in
504 +++ b/udev/69-dm-lvm.rules.in
505 @@ -80,8 +80,14 @@ ENV{SYSTEMD_READY}="1"
506@@ -593,7 +605,7 @@ index 14e7dd26d..b32b94ac7 100644
507 LABEL="lvm_end"
508
509 diff --git a/udev/95-dm-notify.rules.in b/udev/95-dm-notify.rules.in
510-index 80d59d37d..d22abba1a 100644
511+index 80d59d37d3f27373efaf385b15664478c3f647fc..d22abba1a69b568deb9c4c4752d5130bc06e553b 100644
512 --- a/udev/95-dm-notify.rules.in
513 +++ b/udev/95-dm-notify.rules.in
514 @@ -9,4 +9,4 @@
515@@ -603,7 +615,7 @@ index 80d59d37d..d22abba1a 100644
516 -ENV{DM_COOKIE}=="?*", RUN+="(DM_EXEC)/dmsetup udevcomplete $env{DM_COOKIE}"
517 +ENV{DM_COOKIE}=="?*", RUN+="/sbin/dmsetup udevcomplete $env{DM_COOKIE}"
518 diff --git a/udev/Makefile.in b/udev/Makefile.in
519-index e777dda16..0e237dd13 100644
520+index e777dda16d6b5155f4a701364b60d0f1e49752cd..0e237dd13b30e9900074307359d496cd7e6c5d8d 100644
521 --- a/udev/Makefile.in
522 +++ b/udev/Makefile.in
523 @@ -17,8 +17,8 @@ top_builddir = @top_builddir@
524diff --git a/debian/patches/libdm-propagate-ioctl-errors-back-to-caller.patch b/debian/patches/libdm-propagate-ioctl-errors-back-to-caller.patch
525new file mode 100644
526index 0000000..f0f49f0
527--- /dev/null
528+++ b/debian/patches/libdm-propagate-ioctl-errors-back-to-caller.patch
529@@ -0,0 +1,67 @@
530+Author: Lennart Poettering <lennart@poettering.net>
531+Origin: upstream, commit:25ef7a7b1a876f491bd361369423d7309358f6c1
532+Forwarded: https://gitlab.com/lvmteam/lvm2/-/merge_requests/3
533+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lvm2/+bug/2054620
534+Description: libdm: propagate ioctl errors back to caller
535+ When setting up dm-verity devices with signed root hashes it is very
536+ useful to have a recognizable error code when a key is not present in
537+ the kernel keyring. Turns out the kernel actually returns ENOKEY in that
538+ case, but this gets lost in libdevmapper.
539+ .
540+ This fixes this: in _create_and_load_v4() it copies the error code from
541+ the ioctl from the sub-tasks back to the main task field on failure.
542+ .
543+ This is not enough to make libcryptsetup actually propagate the ENOKEY
544+ correctly, that also needs a patch to libcryptsetup, but this is part of
545+ the puzzle.
546+--- a/libdm/ioctl/libdm-iface.c
547++++ b/libdm/ioctl/libdm-iface.c
548+@@ -1471,7 +1471,7 @@ static int _create_and_load_v4(struct dm_task *dmt)
549+ {
550+ struct dm_info info;
551+ struct dm_task *task;
552+- int r;
553++ int r, ioctl_errno = 0;
554+ uint32_t cookie;
555+
556+ /* Use new task struct to create the device */
557+@@ -1497,8 +1497,10 @@ static int _create_and_load_v4(struct dm_task *dmt)
558+ task->cookie_set = dmt->cookie_set;
559+ task->add_node = dmt->add_node;
560+
561+- if (!dm_task_run(task))
562++ if (!dm_task_run(task)) {
563++ ioctl_errno = task->ioctl_errno;
564+ goto_bad;
565++ }
566+
567+ if (!dm_task_get_info(task, &info) || !info.exists)
568+ goto_bad;
569+@@ -1529,6 +1531,8 @@ static int _create_and_load_v4(struct dm_task *dmt)
570+ task->ima_measurement = dmt->ima_measurement;
571+
572+ r = dm_task_run(task);
573++ if (!r)
574++ ioctl_errno = task->ioctl_errno;
575+
576+ task->head = NULL;
577+ task->tail = NULL;
578+@@ -1575,12 +1579,18 @@ static int _create_and_load_v4(struct dm_task *dmt)
579+ if (!dm_task_run(dmt))
580+ log_error("Failed to revert device creation.");
581+
582++ if (ioctl_errno != 0)
583++ dmt->ioctl_errno = ioctl_errno;
584++
585+ return 0;
586+
587+ bad:
588+ dm_task_destroy(task);
589+ _udev_complete(dmt);
590+
591++ if (ioctl_errno != 0)
592++ dmt->ioctl_errno = ioctl_errno;
593++
594+ return 0;
595+ }
596+
597diff --git a/debian/patches/series b/debian/patches/series
598index a4eda8e..b41545c 100644
599--- a/debian/patches/series
600+++ b/debian/patches/series
601@@ -2,3 +2,7 @@ debian-changes
602 enable-issue-discards.patch
603 0014-no-lvm2-monitor-in-containers.patch
604 fix-systemd-run-location.patch
605+<<<<<<< debian/patches/series
606+=======
607+libdm-propagate-ioctl-errors-back-to-caller.patch
608+>>>>>>> debian/patches/series
609diff --git a/debian/pipeline/build.yml b/debian/pipeline/build.yml
610new file mode 100644
611index 0000000..d386108
612--- /dev/null
613+++ b/debian/pipeline/build.yml
614@@ -0,0 +1,42 @@
615+build:
616+ stage: build
617+ image: debian:sid-slim
618+
619+ parallel:
620+ matrix:
621+ - JOB_HOST_ARCH:
622+ - all
623+ - amd64
624+ - arm64
625+ - i386
626+ - s390x
627+
628+ variables:
629+ GIT_STRATEGY: none
630+ GIT_SUBMODULE_STRATEGY: none
631+
632+ script:
633+ - apt upgrade
634+ - |
635+ # Install build-deps
636+ if [[ $JOB_HOST_ARCH = all ]]; then
637+ BUILDPACKAGE_ARGS="--build=all"
638+ apt build-dep --indep-only ./debian/_build/*.dsc
639+ else
640+ BUILDPACKAGE_ARGS="--build=any --host-arch=$JOB_HOST_ARCH"
641+ apt build-dep --arch-only --host-architecture $JOB_HOST_ARCH ./debian/_build/*.dsc
642+ JOB_HOST_GNU_TYPE_PACKAGE=$(dpkg-architecture --host-arch $JOB_HOST_ARCH --query DEB_HOST_GNU_TYPE | tr _ -)
643+ # Workaround for non-multiarch build-essential. See https://bugs.debian.org/666743
644+ apt install binutils-$JOB_HOST_GNU_TYPE_PACKAGE gcc-$JOB_HOST_GNU_TYPE_PACKAGE g++-$JOB_HOST_GNU_TYPE_PACKAGE libc6-dev:$JOB_HOST_ARCH
645+ fi
646+ - dpkg-source -x debian/_build/*.dsc debian/_build/src
647+ - chown nobody -R debian/_build
648+ - ( cd debian/_build/src; runuser -u nobody -- dpkg-buildpackage --jobs=auto $BUILDPACKAGE_ARGS )
649+
650+ interruptible: true
651+ needs:
652+ - source
653+ artifacts:
654+ paths:
655+ - debian/_build/*_${JOB_HOST_ARCH}.*
656+ expire_in: 2 days
657diff --git a/debian/pipeline/source.yml b/debian/pipeline/source.yml
658new file mode 100644
659index 0000000..28aed3e
660--- /dev/null
661+++ b/debian/pipeline/source.yml
662@@ -0,0 +1,34 @@
663+source:
664+ stage: source
665+ image: debian:trixie-slim
666+
667+ variables:
668+ GIT_DEPTH: 1
669+
670+ script:
671+ - apt install devscripts git
672+ - git clone -c advice.detachedHead=false . debian/_build/src
673+ - cd debian/_build/src
674+ - |
675+ # Set version
676+ if [[ ${CI_MERGE_REQUEST_IID:-} ]]; then
677+ VERSION="$(dpkg-parsechangelog -SVersion)+ci.${CI_MERGE_REQUEST_IID}.${CI_PIPELINE_ID}.${CI_COMMIT_SHORT_SHA}"
678+ dch --newversion $VERSION --distribution UNRELEASED --force-distribution -- \
679+ "Snapshot from merge request ${CI_MERGE_REQUEST_IID}."
680+ else
681+ VERSION="$(dpkg-parsechangelog -SVersion)+ci.0.${CI_PIPELINE_ID}.${CI_COMMIT_SHORT_SHA}"
682+ dch --newversion $VERSION --distribution UNRELEASED --force-distribution -- \
683+ "Snapshot from branch ${CI_COMMIT_REF_NAME}."
684+ fi
685+ - echo '1.0' > debian/source/format
686+ - dpkg-buildpackage -us -uc -S -I -nc -d
687+
688+ interruptible: true
689+ needs: []
690+ artifacts:
691+ paths:
692+ - debian/_build/*.buildinfo
693+ - debian/_build/*.changes
694+ - debian/_build/*.dsc
695+ - debian/_build/*.tar.*
696+ expire_in: 2 days
697diff --git a/debian/pipeline/test.yml b/debian/pipeline/test.yml
698new file mode 100644
699index 0000000..196be23
700--- /dev/null
701+++ b/debian/pipeline/test.yml
702@@ -0,0 +1,30 @@
703+test lintian:
704+ stage: test
705+ image: debian:sid-slim
706+
707+ variables:
708+ GIT_STRATEGY: none
709+ GIT_SUBMODULE_STRATEGY: none
710+
711+ script:
712+ - apt install lintian
713+ - lintian --version
714+ - >
715+ lintian
716+ --fail-on error
717+ --color always
718+ --display-info
719+ --pedantic
720+ --allow-root
721+ --suppress-tags malformed-debian-changelog-version,debian-revision-not-well-formed
722+ debian/_build/*.changes
723+
724+ needs:
725+ - job: source
726+ - job: build
727+# Requires GitLab 16.3
728+# parallel:
729+# matrix:
730+# - JOB_HOST_ARCH:
731+# - all
732+# - s390x
733diff --git a/debian/pipeline/variables.yml b/debian/pipeline/variables.yml
734new file mode 100644
735index 0000000..8386814
736--- /dev/null
737+++ b/debian/pipeline/variables.yml
738@@ -0,0 +1,5 @@
739+variables:
740+ DEB_BUILD_OPTIONS: terse
741+ DEBIAN_FRONTEND: noninteractive
742+ DEBFULLNAME: $CI_SERVER_NAME $CI_SERVER_HOST
743+ DEBEMAIL: nobody@debian.org
744diff --git a/debian/pipeline/workflow.yml b/debian/pipeline/workflow.yml
745new file mode 100644
746index 0000000..55a239e
747--- /dev/null
748+++ b/debian/pipeline/workflow.yml
749@@ -0,0 +1,40 @@
750+stages:
751+- source
752+- build
753+- test
754+
755+workflow:
756+ rules:
757+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
758+ - if: $CI_COMMIT_BRANCH =~ /^debian\//
759+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
760+ - if: $CI_PIPELINE_SOURCE == "schedule"
761+ - if: $CI_PIPELINE_SOURCE == "web"
762+
763+default:
764+ before_script:
765+ - |
766+ # Setup apt
767+ : ${JOB_BUILD_ARCH:=$(dpkg --print-architecture)}
768+ : ${JOB_HOST_ARCH:=$(dpkg --print-architecture)}
769+ if [[ $JOB_HOST_ARCH != $JOB_BUILD_ARCH ]] && [[ $JOB_HOST_ARCH != all ]]; then
770+ export DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS:-} nocheck"
771+ export DEB_BUILD_PROFILES="${DEB_BUILD_PROFILES:-} cross"
772+ fi
773+ if [[ $JOB_HOST_ARCH != all ]]; then
774+ dpkg --add-architecture $JOB_HOST_ARCH
775+ fi
776+ function apt() {
777+ local e tmp
778+ tmp=$(mktemp)
779+ apt-get -o APT::Install-Recommends=false -o DPkg::Options::=--force-unsafe-io -qy "$@" >$tmp 2>&1 || e=$?
780+ if [[ $e -gt 0 ]]; then
781+ cat $tmp
782+ rm $tmp
783+ false
784+ else
785+ rm $tmp
786+ true
787+ fi
788+ }
789+ - apt update
790diff --git a/debian/rules b/debian/rules
791index b6153d0..3fa9486 100755
792--- a/debian/rules
793+++ b/debian/rules
794@@ -24,8 +24,8 @@ CFLAGS_OPT_UDEB = -Os
795 endif
796
797 define CONFARGS.deb
798- --libdir=/lib/$(DEB_HOST_MULTIARCH)
799- --sbindir=/sbin
800+ --prefix=/usr
801+ --exec-prefix=/usr
802 --with-usrlibdir=/usr/lib/$(DEB_HOST_MULTIARCH)
803 --with-optimisation="$(CFLAGS_OPT_DEB)"
804 --with-cache=internal
805@@ -39,7 +39,6 @@ define CONFARGS.deb
806 --with-thin-check=/usr/sbin/thin_check
807 --with-thin-dump=/usr/sbin/thin_dump
808 --with-thin-repair=/usr/sbin/thin_repair
809- --with-udev-prefix=/
810 --enable-applib
811 --enable-blkid_wiping
812 --enable-cmdlib
813@@ -56,16 +55,12 @@ define CONFARGS.deb
814 endef
815
816 define CONFARGS.deb_all
817- --sbindir=/sbin
818 --enable-dbus-service
819 --disable-readline
820 --disable-selinux
821 endef
822
823 define CONFARGS.udeb
824- --libdir=/lib
825- --sbindir=/sbin
826- --with-usrlibdir=/usr/lib
827 --with-optimisation="$(CFLAGS_OPT_UDEB)"
828 --with-lvm1=none
829 --with-pool=none

Subscribers

People subscribed via source and target branches