* [PATCH qemu-server] debian: add maintscript to remove unused file
@ 2026-03-20 13:51 Maximiliano Sandoval
2026-07-16 12:23 ` Fiona Ebner
0 siblings, 1 reply; 3+ messages in thread
From: Maximiliano Sandoval @ 2026-03-20 13:51 UTC (permalink / raw)
To: pve-devel
The conffile was moved to LIDBIR in in 4093c3f4a but there was no
associated cleanup.
If one starts from a version of Proxmox VE older than 9, then the the
configuration would be at /etc. If the machine is then updated to
version 9, then both versions will be present, with the version at /etc
having a higher priority as per modules-load.d(5). In such a case, any
changes made in the packaged configuration will be ignored.
The rm_config (see dpkg-maintscript-helper(1)) is used to remove the
trailing config if it was not touched by the user. If the file was
touched by the user then it is automatically moved and we move it back
manually so that it continues to have higher preference.
Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
Notes:
Tested:
1. Created pve 8 VM using the 8.4 iso
2. Checked the version at /etc is present
3. Updated to pve 9
4. Checked that both versions are present
5. Updated the qemu-server package using this patch
6. Verified the file at /etc is not there
During step 5. the following message can be seen:
Removing obsolete conffile /etc/modules-load.d/qemu-server.conf ...
If we edit the file before 5. then one would see
Obsolete conffile /etc/modules-load.d/qemu-server.conf has been modified by you.
Saving as /etc/modules-load.d/qemu-server.conf.dpkg-bak ...
Moving qemu-server.conf.dpkg-bak back to qemu-server.conf
and systemd-delta would still consider this as an override of the
version at /usr/lib.
Further reinstalls of the qemu-server package will leave alone this
version of /etc/modules-load.d/qemu-server.conf.
Note that the version at /etc will only have a higher preference over
the one at /usr/lib if it is named exactly the same, thus we move it
back rather than renaming it to, e.g. qemu-server-old.conf, as this
would result in the union of both modules being loaded by
systemd-modules-load.service at boot.
debian/postinst | 18 ++++++++++++++++++
debian/qemu-server.maintscript | 1 +
2 files changed, 19 insertions(+)
create mode 100644 debian/postinst
create mode 100644 debian/qemu-server.maintscript
diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 00000000..aff4a27e
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+
+#DEBHELPER#
+
+case "$1" in
+ configure)
+
+ if test -n "$2" && dpkg --compare-versions "$2" 'lt' '9.1.6'; then
+ if test -f /etc/modules-load.d/qemu-server.conf.dpkg-bak; then
+ printf "Moving qemu-server.conf.dpkg-bak back to qemu-server.conf\n"
+ mv /etc/modules-load.d/qemu-server.conf.dpkg-bak /etc/modules-load.d/qemu-server.conf
+ fi
+ fi
+esac
+
+exit 0
diff --git a/debian/qemu-server.maintscript b/debian/qemu-server.maintscript
new file mode 100644
index 00000000..c48d470f
--- /dev/null
+++ b/debian/qemu-server.maintscript
@@ -0,0 +1 @@
+rm_conffile /etc/modules-load.d/qemu-server.conf 9.1.6~ qemu-server
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH qemu-server] debian: add maintscript to remove unused file
2026-03-20 13:51 [PATCH qemu-server] debian: add maintscript to remove unused file Maximiliano Sandoval
@ 2026-07-16 12:23 ` Fiona Ebner
2026-07-16 13:02 ` superseded: " Maximiliano Sandoval
0 siblings, 1 reply; 3+ messages in thread
From: Fiona Ebner @ 2026-07-16 12:23 UTC (permalink / raw)
To: Maximiliano Sandoval, pve-devel
Am 20.03.26 um 2:51 PM schrieb Maximiliano Sandoval:
> The conffile was moved to LIDBIR in in 4093c3f4a but there was no
> associated cleanup.
>
> If one starts from a version of Proxmox VE older than 9, then the the
> configuration would be at /etc. If the machine is then updated to
> version 9, then both versions will be present, with the version at /etc
> having a higher priority as per modules-load.d(5). In such a case, any
> changes made in the packaged configuration will be ignored.
>
> The rm_config (see dpkg-maintscript-helper(1)) is used to remove the
> trailing config if it was not touched by the user. If the file was
> touched by the user then it is automatically moved and we move it back
> manually so that it continues to have higher preference.
>
> Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
> Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
The versions need to be adapted to match the next qemu-server version
bump. With that:
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
One more comment inline:
> ---
>
> Notes:
> Tested:
>
> 1. Created pve 8 VM using the 8.4 iso
> 2. Checked the version at /etc is present
> 3. Updated to pve 9
> 4. Checked that both versions are present
> 5. Updated the qemu-server package using this patch
> 6. Verified the file at /etc is not there
>
> During step 5. the following message can be seen:
>
> Removing obsolete conffile /etc/modules-load.d/qemu-server.conf ...
>
> If we edit the file before 5. then one would see
>
> Obsolete conffile /etc/modules-load.d/qemu-server.conf has been modified by you.
> Saving as /etc/modules-load.d/qemu-server.conf.dpkg-bak ...
> Moving qemu-server.conf.dpkg-bak back to qemu-server.conf
>
> and systemd-delta would still consider this as an override of the
> version at /usr/lib.
>
> Further reinstalls of the qemu-server package will leave alone this
> version of /etc/modules-load.d/qemu-server.conf.
>
> Note that the version at /etc will only have a higher preference over
> the one at /usr/lib if it is named exactly the same, thus we move it
> back rather than renaming it to, e.g. qemu-server-old.conf, as this
> would result in the union of both modules being loaded by
> systemd-modules-load.service at boot.
>
> debian/postinst | 18 ++++++++++++++++++
> debian/qemu-server.maintscript | 1 +
For consistency with all the other scripts, it could also be just called
'maintscript' instead of 'qemu-server.maintscript'.
> 2 files changed, 19 insertions(+)
> create mode 100644 debian/postinst
> create mode 100644 debian/qemu-server.maintscript
>
> diff --git a/debian/postinst b/debian/postinst
> new file mode 100644
> index 00000000..aff4a27e
> --- /dev/null
> +++ b/debian/postinst
> @@ -0,0 +1,18 @@
> +#!/bin/sh
> +
> +set -e
> +
> +#DEBHELPER#
> +
> +case "$1" in
> + configure)
> +
> + if test -n "$2" && dpkg --compare-versions "$2" 'lt' '9.1.6'; then
> + if test -f /etc/modules-load.d/qemu-server.conf.dpkg-bak; then
> + printf "Moving qemu-server.conf.dpkg-bak back to qemu-server.conf\n"
> + mv /etc/modules-load.d/qemu-server.conf.dpkg-bak /etc/modules-load.d/qemu-server.conf
> + fi
> + fi
> +esac
> +
> +exit 0
> diff --git a/debian/qemu-server.maintscript b/debian/qemu-server.maintscript
> new file mode 100644
> index 00000000..c48d470f
> --- /dev/null
> +++ b/debian/qemu-server.maintscript
> @@ -0,0 +1 @@
> +rm_conffile /etc/modules-load.d/qemu-server.conf 9.1.6~ qemu-server
^ permalink raw reply [flat|nested] 3+ messages in thread
* superseded: [PATCH qemu-server] debian: add maintscript to remove unused file
2026-07-16 12:23 ` Fiona Ebner
@ 2026-07-16 13:02 ` Maximiliano Sandoval
0 siblings, 0 replies; 3+ messages in thread
From: Maximiliano Sandoval @ 2026-07-16 13:02 UTC (permalink / raw)
To: Fiona Ebner; +Cc: pve-devel
Fiona Ebner <f.ebner@proxmox.com> writes:
> Am 20.03.26 um 2:51 PM schrieb Maximiliano Sandoval:
>> The conffile was moved to LIDBIR in in 4093c3f4a but there was no
>> associated cleanup.
>>
>> If one starts from a version of Proxmox VE older than 9, then the the
>> configuration would be at /etc. If the machine is then updated to
>> version 9, then both versions will be present, with the version at /etc
>> having a higher priority as per modules-load.d(5). In such a case, any
>> changes made in the packaged configuration will be ignored.
>>
>> The rm_config (see dpkg-maintscript-helper(1)) is used to remove the
>> trailing config if it was not touched by the user. If the file was
>> touched by the user then it is automatically moved and we move it back
>> manually so that it continues to have higher preference.
>>
>> Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
>> Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
>
> The versions need to be adapted to match the next qemu-server version
> bump. With that:
>
> Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
>
> One more comment inline:
>
> [..]
Superseded-by: https://lore.proxmox.com/all/20260716130103.406573-1-m.sandoval@proxmox.com/T/#u
--
Maximiliano
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-16 13:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-20 13:51 [PATCH qemu-server] debian: add maintscript to remove unused file Maximiliano Sandoval
2026-07-16 12:23 ` Fiona Ebner
2026-07-16 13:02 ` superseded: " Maximiliano Sandoval
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox