Merge ~ahasenack/ubuntu/+source/qemu:noble-qemu-gluster-universe into ubuntu/+source/qemu:ubuntu/devel
- Git
- lp:~ahasenack/ubuntu/+source/qemu
- noble-qemu-gluster-universe
- Merge into ubuntu/devel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | git-ubuntu bot | ||||
Approved revision: | not available | ||||
Merged at revision: | da9b553a24a78c213b08659518a477af684d86b3 | ||||
Proposed branch: | ~ahasenack/ubuntu/+source/qemu:noble-qemu-gluster-universe | ||||
Merge into: | ubuntu/+source/qemu:ubuntu/devel | ||||
Diff against target: |
145 lines (+84/-2) 4 files modified
debian/changelog (+12/-0) debian/control (+25/-0) debian/control-in (+25/-0) debian/rules (+22/-2) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
git-ubuntu bot | Approve | ||
Sergio Durigan Junior (community) | Approve | ||
Canonical Server Reporter | Pending | ||
Review via email: mp+459962@code.launchpad.net |
This proposal supersedes a proposal from 2024-01-16.
Commit message
Description of the change
This branch moves the glusterfs block module from bin:qemu-
The reason for this move is the glusterfs demotion[2] to universe. We want to keep shipping the glusterfs block module, but it must be in universe from now on.
This change also requires a change in the ubuntu release upgrader, which is being tracked in the glusterfs demotion bug[2]. Without it, systems who upgrade to noble and rely on the glusterfs block module will not have it installed anymore after the upgrade.
The extra Depends on bin:qemu-
I didn't add any specific new documentation to bin:qemu-
Note that glusterfs is not available in 32bit platforms, so currently the bin:qemu-
PPA: https:/
1. https:/
2. https:/
Sergio Durigan Junior (sergiodj) wrote : Posted in a previous version of this proposal | # |
Sergio Durigan Junior (sergiodj) wrote : Posted in a previous version of this proposal | # |
Thanks, Andreas.
This looks good. I'm leaving a few minor comments below, but otherwise it LGTM.
Let me know when you update the MP and I'll review it again.
Andreas Hasenack (ahasenack) : Posted in a previous version of this proposal | # |
Andreas Hasenack (ahasenack) : Posted in a previous version of this proposal | # |
Andreas Hasenack (ahasenack) : Posted in a previous version of this proposal | # |
Andreas Hasenack (ahasenack) : Posted in a previous version of this proposal | # |
Andreas Hasenack (ahasenack) wrote : Posted in a previous version of this proposal | # |
Thanks for the review, I pushed the updates on top, and can squash before upload.
There is one more change I'm investigating, and that's the qemu-block-
Sergio Durigan Junior (sergiodj) wrote : Posted in a previous version of this proposal | # |
ACK, thanks for the heads up.
Andreas Hasenack (ahasenack) wrote : Posted in a previous version of this proposal | # |
I think I won't need anything else, but just to be sure I prepared another ppa where I uploaded a dummy rebuild of qemu at a higher version just to test an upgrade scenario.
Andreas Hasenack (ahasenack) wrote : Posted in a previous version of this proposal | # |
Reopening this MP after some larger changes to d/rules because of the maintainer scripts that are generated dynamically at build time from d/rules for qemu-block-extra. I had to do something similar for the new qemu-block-
My testing consisted of installing qemu-block-extra and iterating over upgrades, to see what ended up in /run/qemu. I did it for armhf and amd64. I'll post my results in separate follow-up comments.
As to the method I chose to implement this, I wanted to avoid a hardcoded list of modules that go into -extra and into -supplemental, but this was hard to generate dynamically because when the maintainer script is created, the build isn't separated yet into packages, everything is still in debian/tmp/* (instead of debian/<pkg>/). So I resorted to only hardcoding what goes into -supplemental, and used grep to separate it from what goes into -extra.
Another option would be to run "dpkg -L <pkg>" in the maintainer script, to see what files this package owns, but I feared running into issues like "which package is installed now", "is it fully installed, or just unpacked", etc. But let me know if you know of a cleaner way to know at maintainer-script execution time which modules should be copied over to /run/qemu.
Andreas Hasenack (ahasenack) wrote (last edit ): Posted in a previous version of this proposal | # |
For all these tests, I used two ppas:
https:/
https:/
Note these builds no longer have the set -x debugging in them.
Andreas Hasenack (ahasenack) wrote : Posted in a previous version of this proposal | # |
qemu-armhf:
Installing qemu-block-extra 1:8.1.3+ds-1ubuntu2 (from noble)
$ find /usr/lib/
ad4108b6463fadb
d1440a2853b8abe
28b501db5fab82a
118a68317ad6db3
a9f794a1924f12b
$ find /run/qemu -type f -exec md5sum {} \;
$
Upgrading to qemu-block-extra 1:8.2.0+ds-4ubuntu1 from noble-proposed
$ find /usr/lib/
ae307dbd7751317
e31c70d020d4574
4a7e0839dcc4856
d903bbf2ad84878
3a01cf0904d7233
$ find /run/qemu -type f -exec md5sum {} \;
ad4108b6463fadb
118a68317ad6db3
a9f794a1924f12b
28b501db5fab82a
d1440a2853b8abe
Upgrading qemu-block-extra to 1:8.2.0+
Note there is no qemu-block-
$ find /usr/lib/
e5e15e9bb1fac63
b444b18859ea1b8
22719c368a9873a
982d0426f653e97
7008feee4d0a247
$ find /run/qemu -type f -exec md5sum {} \;
ae307dbd7751317
d903bbf2ad84878
3a01cf0904d7233
4a7e0839dcc4856
e31c70d020d4574
ad4108b6463fadb
118a68317ad6db3
a9f794a1924f12b
28b501db5fab82a
d1440a2853b8abe
Upgradin...
Andreas Hasenack (ahasenack) wrote : Posted in a previous version of this proposal | # |
qemu-upgrade-
Fresh install qemu-block-extra 1:8.1.3+ds-1ubuntu2
- /run/qemu mounted, but empty
# find /usr/lib/
ea85112425d8067
b02200dc12983d8
65fd58cb9b7fd8f
f7b96879e0552ed
90adce8c351799d
0d8772bd35d5e94
fe4a3b0fb69409a
Upgade to qemu-block-extra 1:8.2.0+
# find /run/qemu/ -type f -exec md5sum {} \;
fe4a3b0fb69409a
0d8772bd35d5e94
90adce8c351799d
f7b96879e0552ed
65fd58cb9b7fd8f
b02200dc12983d8
ea85112425d8067
# find /usr/lib/
85c89d0929b49c1
84e80259582bd66
acdc8b828598b24
f2097835d6e56f8
bd63ae325c4f1b7
9855847010ba141
only set -x output:
Setting up qemu-block-extra (1:8.2.
+ set -e
+ [ configure = configure ]
+ [ -d /run/systemd/system ]
+ dpkg --compare-versions 1:8.1.3+ds-1ubuntu2 lt 1:6.0+dfsg-
+ [ -d /run/systemd/system ]
+ systemctl --system daemon-reload
+ deb-systemd-invoke start run-qemu.mount
+ exit 0
Upgrade to qemu-block-extra 1:8.2.0+
set -x outputs:
Preparing to unpack .../3-qemu-
+ [ -d /run/qemu ]
+ findmnt --noheadings --target /run/qemu/
+ grep -q noexec
+ mkdir -p /run/qemu/
+ echo block-gluster.so
+ basename /usr/lib/
+ grep -qF block-curl.so
+ cp -p /usr/lib/
+ echo block-gluster.so
+ basename /usr/lib/
+ grep -qF block-dmg-bz2.so
+ cp -p /usr/lib/
+ echo block-gluster.so
+ basename /usr/lib/
+ grep -qF block-iscsi.so
+ cp -p /usr/lib/
Andreas Hasenack (ahasenack) wrote : Posted in a previous version of this proposal | # |
qemu-upgrade-
Fresh install of qemu-block-extra 1:8.2.0+ds-4ubuntu1
# find /usr/lib/
0803f89eccacddc
a8378e4dc52e331
0dcb383eecf5f75
f7fa07b9951df26
97745997a602cff
801719053ad0f1b
527c297bc4be684
/run/mount empty
Install qemu-block-
(pulls in qemu-block-extra same version)
maintainer script output:
Selecting previously unselected package qemu-block-
Preparing to unpack .../8-qemu-
Unpacking qemu-block-
Setting up qemu-system-common (1:8.2.
Setting up qemu-system-data (1:8.2.
Setting up qemu-utils (1:8.2.
Setting up qemu-system-s390x (1:8.2.
Setting up qemu-block-extra (1:8.2.
+ set -e
+ [ configure = configure ]
+ [ -d /run/systemd/system ]
+ dpkg --compare-versions 1:8.2.0+ds-4ubuntu1 lt 1:6.0+dfsg-
+ [ -d /run/systemd/system ]
+ systemctl --system daemon-reload
+ deb-systemd-invoke start run-qemu.mount
+ exit 0
Setting up qemu-system-
Setting up qemu-block-
Setting up qemu-system-gui (1:8.2.
Setting up qemu-system-
# find /usr/lib/
85c89d0929b49c1
84e80259582bd66
acdc8b828598b24
f2097835d6e56f8
bd63ae325c4f1b7
9855847010ba141
b48098a3dc21443
# find /run/qemu/ -type f -exec md5sum {} \;
527c297bc4be684
801719053ad0f1b
97745997a602cff
f7fa07b9951df26
0dcb383eecf5f75
a8378e4dc52e331
0803f89eccacddc
...
Andreas Hasenack (ahasenack) wrote : Posted in a previous version of this proposal | # |
This is what the rendered maintainer scripts looks like:
$ cat qemu-block-
#!/bin/sh
set -e
case $1 in (upgrade|
$ cat qemu-block-
#!/bin/sh
set -e
case $1 in (remove) for m in /usr/lib/
case $1 in (purge) if systemctl is-active -q run-qemu.mount; then systemctl stop run-qemu.mount || true; fi; rm -rf "/run/qemu";; esac
$ cat qemu-block-
#!/bin/sh
set -e
case $1 in (upgrade|
$ cat qemu-block-
#!/bin/sh
set -e
case $1 in (remove) for m in block-gluster.so; do rm -f /run/qemu/
Andreas Hasenack (ahasenack) wrote : | # |
I pushed a new change that adds an explicit Depends from qemu-block-
dh_installdocs -p qemu-block-
in the qemu-block-
I ran the manual checks again, from the previous comments, and didn't see any difference (as expected). I'll paste them again, with some comments.
Andreas Hasenack (ahasenack) wrote : | # |
qemu-amd64-
Installing fresh qemu-block-extra 1:8.2.0+ds-4ubuntu1
$ find /usr/lib/
0803f89eccacddc
a8378e4dc52e331
0dcb383eecf5f75
f7fa07b9951df26
97745997a602cff
801719053ad0f1b
527c297bc4be684
$ find /run/qemu/ -type f -name 'block-*.so' -exec md5sum {} \;
$
Upgrading to qemu-block-extra 1:8.2.0+
$ find /usr/lib/
aa6fafc7e2c1685
e105e7859f9cb0f
f745fa1959b51f9
008e00f454a668e
5c0d605aa07aa3f
71bdbbeecb3fd5b
$ find /run/qemu/ -type f -name 'block-*.so' -exec md5sum {} \;
527c297bc4be684
801719053ad0f1b
97745997a602cff
f7fa07b9951df26
0dcb383eecf5f75
a8378e4dc52e331
0803f89eccacddc
Upgrading to qemu-block-extra 1:8.2.0+
$ find /usr/lib/
9220b566485b429
3dd4d675fa5e138
ee5d2eb37176908
aaa653ddfe204e5
cfa95525f005f86
5c3297af66f8237
$ find /run/qemu/ -type f -name 'block-*.so' -exec md5sum {} \;
71bdbbeecb3fd5b
5c0d605aa07aa3f
008e00f454a668e
f745fa1959b51f9
e105e7859f9cb0f
aa6fafc7e2c168...
Andreas Hasenack (ahasenack) wrote : | # |
qemu-amd64-
Fresh install of qemu-block-extra 1:8.2.0+ds-4ubuntu1
$ find /usr/lib/
0803f89eccacddc
a8378e4dc52e331
0dcb383eecf5f75
f7fa07b9951df26
97745997a602cff
801719053ad0f1b
527c297bc4be684
Mount dir mounted, but empty:
$ find /run/qemu/ -type f -name 'block-*.so' -exec md5sum {} \;
$
Installing qemu-block-
$ find /usr/lib/
aa6fafc7e2c1685
e105e7859f9cb0f
f745fa1959b51f9
008e00f454a668e
5c0d605aa07aa3f
71bdbbeecb3fd5b
fae53b01d85c97b
mount dir contains backup of previous modules, including gluster (which was in -extra back then):
$ find /run/qemu/ -type f -name 'block-*.so' -exec md5sum {} \;
527c297bc4be684
801719053ad0f1b
97745997a602cff
f7fa07b9951df26
0dcb383eecf5f75
a8378e4dc52e331
0803f89eccacddc
Upgrading to qemu-block-
$ find /usr/lib/
a603df1ea6af2dd
9220b566485b429
3dd4d675fa5e138
ee5d2eb37176908
aaa653ddfe204e5
cfa95525f005f86
5c3297af66f8237
mount dir now has new backup of the 4ubuntu2 modules:
$ find /run/qemu/ -type f -name 'block-*.so' -exec md5sum {} \;
71bdbbeecb3fd5b
5c0d...
Andreas Hasenack (ahasenack) wrote : | # |
qemu-amd64-
Fresh install of qemu-block-extra 1:8.2.0+ds-4ubuntu1
$ find /usr/lib/
0803f89eccacddc
a8378e4dc52e331
0dcb383eecf5f75
f7fa07b9951df26
97745997a602cff
801719053ad0f1b
527c297bc4be684
No backups yet:
$ find /run/qemu/ -type f -name 'block-*.so' -exec md5sum {} \;
$
Upgrade to qemu-block-extra 1:8.2.0+
$ find /usr/lib/
aa6fafc7e2c1685
e105e7859f9cb0f
f745fa1959b51f9
008e00f454a668e
5c0d605aa07aa3f
71bdbbeecb3fd5b
We now have backup for 1:8.2.0+
$ find /run/qemu/ -type f -name 'block-*.so' -exec md5sum {} \;
527c297bc4be684
801719053ad0f1b
97745997a602cff
f7fa07b9951df26
0dcb383eecf5f75
a8378e4dc52e331
0803f89eccacddc
Let's now install qemu-block-
We get a new block-gluster.so in /usr/lib:
$ find /usr/lib/
aa6fafc7e2c1685
e105e7859f9cb0f
f745fa1959b51f9
008e00f454a668e
5c0d605aa07aa3f
71bdbbeecb3fd5b
fae53b01d85c97b
And mount didn't change:
$ find /run/qemu/ -type f -name 'block-*.so' -exec md5sum {} \;
527c297bc4be684
801719053ad0f1b
97745997a602cff
Andreas Hasenack (ahasenack) wrote : | # |
I guess the only final question/point I have is:
should we backup block-gluster.so (from bin:qemu-
The scenario is:
- you have qemu-block-
- you have a running VM using block-gluster.so
- you remove qemu-block-
- if you restart that vm, it won't find the module and fail
This is different from an upgrade scenario, because you could just reinstall qemu-block-
This scenario never showed up before because all block modules were in qemu-block-extra, and you can't just remove that package, it will remove most of your qemu installation with it.
Sergio Durigan Junior (sergiodj) wrote : | # |
I'm taking another look.
Sergio Durigan Junior (sergiodj) wrote : | # |
Thanks, Andreas.
I think the way you solved the problem of listing the supplemental modules in the {post,pre}rm scripts is the best one. I wouldn't worry too much about having to manually list the modules on d/rules; there are worse problems than that (for example, dynamically generating maintscripts... ugh).
As for your question about whether we should backup block-gluster.so. I tend to believe that if the user removes qemu-block-
Other than that, I really don't have much else to say. Your investigative work is amazing and I think you covered every corner case I could think of.
LGTM, +1.
Sergio Durigan Junior (sergiodj) wrote : | # |
Sorry if it wasn't clear: my answer to your question is "I don't think we need to backup the block-gluster.so module".
Andreas Hasenack (ahasenack) : | # |
Sergio Durigan Junior (sergiodj) wrote : | # |
Thanks, Andreas. +1
git-ubuntu bot (git-ubuntu-bot) wrote : | # |
Approvers: ahasenack, sergiodj
Uploaders: ahasenack, sergiodj
MP auto-approved
Preview Diff
1 | diff --git a/debian/changelog b/debian/changelog |
2 | index dbafc80..d4215fa 100644 |
3 | --- a/debian/changelog |
4 | +++ b/debian/changelog |
5 | @@ -1,3 +1,15 @@ |
6 | +qemu (1:8.2.0+ds-4ubuntu2) noble; urgency=medium |
7 | + |
8 | + * Move glusterfs storage driver to Universe in a new package |
9 | + (LP: #2045063): |
10 | + - d/control{,-in}: new package qemu-block-supplemental for drivers |
11 | + we want in Universe |
12 | + - d/rules: we only want block-gluster.so in the new |
13 | + qemu-block-supplemental package. Adjust dynamically-created |
14 | + maintainer scripts for qemu-block-extra and -supplemental. |
15 | + |
16 | + -- Andreas Hasenack <andreas@canonical.com> Fri, 02 Feb 2024 14:07:00 -0300 |
17 | + |
18 | qemu (1:8.2.0+ds-4ubuntu1) noble; urgency=medium |
19 | |
20 | * Merge with Debian unstable (LP: #2048802, #2048776). Remaining changes: |
21 | diff --git a/debian/control b/debian/control |
22 | index 9b9fd93..8383fe5 100644 |
23 | --- a/debian/control |
24 | +++ b/debian/control |
25 | @@ -197,6 +197,31 @@ Description: extra block backend modules for qemu-system and qemu-utils |
26 | emulation and qemu-img from qemu-utils package, which are rarely used and |
27 | has extra dependencies. |
28 | |
29 | +Package: qemu-block-supplemental |
30 | +# For now, this package only ships glusterfs, which does not build in 32bit architectures |
31 | +Architecture: amd64 arm64 ppc64el riscv64 s390x |
32 | +Multi-Arch: no |
33 | +Depends: ${misc:Depends}, ${shlibs:Depends}, |
34 | +# qemu-block-extra has the run-qemu.mount unit which we need |
35 | + qemu-block-extra (= ${binary:Version}), |
36 | +# we need to ensure qemu-block-supplemental is upgraded with qemu-system-* or qemu-utils |
37 | + qemu-system-any (= ${binary:Version}) [amd64 arm64 armhf ppc64el riscv64 s390x] | qemu-utils (= ${binary:Version}), |
38 | +Enhances: qemu-utils, qemu-system-misc, |
39 | + qemu-system-arm, qemu-system-mips, qemu-system-sparc, qemu-system-x86, |
40 | +Breaks: qemu-block-extra (<< 1:8.2.0+ds-4ubuntu2~) |
41 | +Replaces: qemu-block-extra (<< 1:8.2.0+ds-4ubuntu2) |
42 | +Description: supplemental block backend modules for qemu-system and qemu-utils |
43 | + QEMU is a fast processor emulator: currently the package supports Alpha, ARM, |
44 | + CRIS, i386, LoongArch, M68k (ColdFire), MicroBlaze, MIPS, PowerPC, RISC-V, |
45 | + S390x, SH4, SPARC, x86-64, Xtensa and other emulations. By using dynamic |
46 | + translation it achieves reasonable speed while being easy to port on new host |
47 | + CPUs. |
48 | + . |
49 | + This package provides supplemental block device backend modules for qemu-system |
50 | + emulation and qemu-img from qemu-utils package. |
51 | + . |
52 | + Currently, the following module is shipped in this package: block-glusterfs |
53 | + |
54 | Package: qemu-system-data |
55 | Architecture: all |
56 | Multi-Arch: foreign |
57 | diff --git a/debian/control-in b/debian/control-in |
58 | index 201f4bf..f24a39a 100644 |
59 | --- a/debian/control-in |
60 | +++ b/debian/control-in |
61 | @@ -202,6 +202,31 @@ Description: extra block backend modules for qemu-system and qemu-utils |
62 | This package provides extra block device backend modules for qemu-system |
63 | emulation and qemu-img from qemu-utils package, which are rarely used and |
64 | has extra dependencies. |
65 | +:ubuntu: |
66 | +:ubuntu:Package: qemu-block-supplemental |
67 | +:ubuntu:# For now, this package only ships glusterfs, which does not build in 32bit architectures |
68 | +:ubuntu:Architecture: amd64 arm64 ppc64el riscv64 s390x |
69 | +:ubuntu:Multi-Arch: no |
70 | +:ubuntu:Depends: ${misc:Depends}, ${shlibs:Depends}, |
71 | +:ubuntu:# qemu-block-extra has the run-qemu.mount unit which we need |
72 | +:ubuntu: qemu-block-extra (= ${binary:Version}), |
73 | +:ubuntu:# we need to ensure qemu-block-supplemental is upgraded with qemu-system-* or qemu-utils |
74 | +:ubuntu: qemu-system-any (= ${binary:Version}) [amd64 arm64 armhf ppc64el riscv64 s390x] | qemu-utils (= ${binary:Version}), |
75 | +:ubuntu:Enhances: qemu-utils, qemu-system-misc, |
76 | +:ubuntu: qemu-system-arm, qemu-system-mips, qemu-system-sparc, qemu-system-x86, |
77 | +:ubuntu:Breaks: qemu-block-extra (<< 1:8.2.0+ds-4ubuntu2~) |
78 | +:ubuntu:Replaces: qemu-block-extra (<< 1:8.2.0+ds-4ubuntu2) |
79 | +:ubuntu:Description: supplemental block backend modules for qemu-system and qemu-utils |
80 | +:ubuntu: QEMU is a fast processor emulator: currently the package supports Alpha, ARM, |
81 | +:ubuntu: CRIS, i386, LoongArch, M68k (ColdFire), MicroBlaze, MIPS, PowerPC, RISC-V, |
82 | +:ubuntu: S390x, SH4, SPARC, x86-64, Xtensa and other emulations. By using dynamic |
83 | +:ubuntu: translation it achieves reasonable speed while being easy to port on new host |
84 | +:ubuntu: CPUs. |
85 | +:ubuntu: . |
86 | +:ubuntu: This package provides supplemental block device backend modules for qemu-system |
87 | +:ubuntu: emulation and qemu-img from qemu-utils package. |
88 | +:ubuntu: . |
89 | +:ubuntu: Currently, the following module is shipped in this package: block-glusterfs |
90 | |
91 | Package: qemu-system-data |
92 | Architecture: all |
93 | diff --git a/debian/rules b/debian/rules |
94 | index 38e6b72..485e01f 100755 |
95 | --- a/debian/rules |
96 | +++ b/debian/rules |
97 | @@ -69,6 +69,11 @@ enable-user-static = $(if $(filter qemu-user-static,${BUILD_PACKAGES}),y) |
98 | QEMU_XEN = /usr/libexec/xen-qemu-system-i386 |
99 | PKGVERSION = Debian ${DEB_VERSION} |
100 | SAVEMODDIR = /run/qemu/$(shell echo -n "${PKGVERSION}" | tr --complement '[:alnum:]+-.~' '_') |
101 | +# New Ubuntu package qemu-block-supplemental to hold modules we want in Universe |
102 | +# glusterfs is in universe, see LP: #2045063 |
103 | +# This variable specifies a space-separated list of module filenames |
104 | +# If altering this list, please also update the package description in d/control* |
105 | +BLOCK_SUPPLEMENTAL_MODULES = block-gluster.so |
106 | sysdataidir = debian/qemu-system-data/usr/share/qemu |
107 | libdir = /usr/lib/${DEB_HOST_MULTIARCH} |
108 | FIRMWAREPATH = /usr/share/qemu:/usr/share/seabios:/usr/lib/ipxe/qemu |
109 | @@ -281,12 +286,19 @@ endif # ubuntu |
110 | # save block-extra loadable modules on upgrades |
111 | # other module types for now (5.0) can't be loaded at runtime, only at startup |
112 | # the maintscript fragments include version string so we have to generate them |
113 | - echo 'case $$1 in (upgrade|deconfigure) [ -d /run/qemu ] || exit 0; ! findmnt --noheadings --target /run/qemu/ | grep -q noexec || exit 0; mkdir -p ${SAVEMODDIR}; cp -p ${libdir}/qemu/block-*.so ${SAVEMODDIR}/;; esac' \ |
114 | + echo 'case $$1 in (upgrade|deconfigure) [ -d /run/qemu ] || exit 0; ! findmnt --noheadings --target /run/qemu/ | grep -q noexec || exit 0; mkdir -p ${SAVEMODDIR}; for m in ${libdir}/qemu/block-*.so; do if echo "${BLOCK_SUPPLEMENTAL_MODULES}" | grep -qF `basename "$$m"`; then continue; else cp -p $$m ${SAVEMODDIR}/; fi; done;; esac' \ |
115 | >> debian/qemu-block-extra.prerm.debhelper |
116 | - echo 'case $$1 in (remove) rm -f ${SAVEMODDIR}/block-*.so;; esac' \ |
117 | + echo 'case $$1 in (remove) for m in ${libdir}/qemu/block-*.so; do if echo "${BLOCK_SUPPLEMENTAL_MODULES}" | grep -qF `basename "$$m"`; then continue; else rm -f ${SAVEMODDIR}/`basename $$m`; fi; done;; esac' \ |
118 | >> debian/qemu-block-extra.postrm.debhelper |
119 | echo 'case $$1 in (purge) if systemctl is-active -q run-qemu.mount; then systemctl stop run-qemu.mount || true; fi; rm -rf "/run/qemu";; esac' \ |
120 | >> debian/qemu-block-extra.postrm.debhelper |
121 | +# do mostly the same for qemu-block-supplemental |
122 | +ifneq (,$(filter qemu-block-supplemental,${BUILD_PACKAGES})) |
123 | + echo 'case $$1 in (upgrade|deconfigure) [ -d /run/qemu ] || exit 0; ! findmnt --noheadings --target /run/qemu/ | grep -q noexec || exit 0; mkdir -p ${SAVEMODDIR}; for m in ${BLOCK_SUPPLEMENTAL_MODULES}; do cp -p ${libdir}/qemu/$$m ${SAVEMODDIR}/; done;; esac' \ |
124 | + >> debian/qemu-block-supplemental.prerm.debhelper |
125 | + echo 'case $$1 in (remove) for m in ${BLOCK_SUPPLEMENTAL_MODULES}; do rm -f ${SAVEMODDIR}/$$m; done;; esac' \ |
126 | + >> debian/qemu-block-supplemental.postrm.debhelper |
127 | +endif |
128 | |
129 | endif # linux |
130 | |
131 | @@ -494,6 +506,14 @@ pre-install-arch: |
132 | dh_installdirs -a |
133 | install-arch: pre-install-arch $(addprefix install-, ${qemu-builds}) |
134 | dh_install -a |
135 | +ifneq (,$(filter qemu-block-supplemental,${BUILD_PACKAGES})) |
136 | + # block-gluster.so should only be in qemu-block-supplemental, if it's built (it doesn't build on 32bit architectures) |
137 | + dh_installdirs -p qemu-block-supplemental usr/lib/${DEB_HOST_MULTIARCH}/qemu |
138 | + for m in ${BLOCK_SUPPLEMENTAL_MODULES}; do mv debian/qemu-block-extra/usr/lib/${DEB_HOST_MULTIARCH}/qemu/$$m debian/qemu-block-supplemental/usr/lib/${DEB_HOST_MULTIARCH}/qemu/; done |
139 | + # This also introduces a "Depends: qemu-block-extra" to qemu-block-supplemental, which |
140 | + # we want also because of the run-qemu.mount unit shipped there. |
141 | + dh_installdocs -p qemu-block-supplemental --link-doc=qemu-block-extra |
142 | +endif |
143 | dh_missing -a |
144 | dh_installdocs -a |
145 | dh_installchangelogs -a |
I'll take a look at this one.