From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 6593A1FF13E for ; Fri, 20 Mar 2026 14:51:43 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 432AF18788; Fri, 20 Mar 2026 14:51:57 +0100 (CET) From: Maximiliano Sandoval To: pve-devel@lists.proxmox.com Subject: [PATCH qemu-server] debian: add maintscript to remove unused file Date: Fri, 20 Mar 2026 14:51:10 +0100 Message-ID: <20260320135120.372074-1-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1774014637501 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.939 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.408 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.819 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.903 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: VX4MK6WFNP4ZQFKTPWGU46WGP3GEKGSJ X-Message-ID-Hash: VX4MK6WFNP4ZQFKTPWGU46WGP3GEKGSJ X-MailFrom: m.sandoval@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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 Signed-off-by: Maximiliano Sandoval --- 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