all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH kernel-helper] proxmox-boot: unconditionally mask systemd-gpt-auto-generator
Date: Thu, 14 Aug 2025 14:40:59 +0200	[thread overview]
Message-ID: <20250814124059.2793662-1-s.ivanov@proxmox.com> (raw)

The efi.mount and efi.automount units created by this generator if:
* the ESP has the partition-type-uuid set to the ESP one
* the system uses a boot-loader that sets the LoaderUUID efivar
  (systemd-boot and grub without secure-boot enabled)
* does not have the ESP mounted by default
cause the ESP to be mounted at /efi, which in turn
cause issues when systemd-boot (metapackage) is installed/updated - as
it autoinstalls itself at /efi, but does not create the loader-entries
for the kernel, since we disabled
/etc/kernel/postinst.d/zz-systemd-boot

Simply mask the generator, as its functionality is not needed on any
regular Proxmox system.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
Tested on a VM where I reproduced the setup above. This is also why I used
the all-caps: MASKING in the output - as it's easy to overlook in the
large number of lines that are printed.
 src/proxmox-boot/zz-proxmox-boot | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/proxmox-boot/zz-proxmox-boot b/src/proxmox-boot/zz-proxmox-boot
index ad6620a..7847777 100755
--- a/src/proxmox-boot/zz-proxmox-boot
+++ b/src/proxmox-boot/zz-proxmox-boot
@@ -271,6 +271,18 @@ check_grub_efi_removable_status() {
 	echo ""
 }
 
+mask_sd_gpt_generator() {
+	generator="systemd-gpt-auto-generator"
+	mask_dir="/etc/systemd/system-generators"
+	# already masked (or re-enabled manually) - nothing to do:
+	if [ -e "$mask_dir/$generator" ]; then
+		return
+	fi
+	warn "$generator causes problems in certain configurations - MASKING it!"
+	mkdir -p "$mask_dir"
+	ln -s /dev/null "$mask_dir/$generator"
+}
+
 set -- $DEB_MAINT_PARAMS
 mode="${1#\'}"
 mode="${mode%\'}"
@@ -286,6 +298,7 @@ case $0:$mode in
 		disable_systemd_boot_hook
 		check_grub_efi_package
 		check_grub_efi_removable_status
+		mask_sd_gpt_generator
 	;;
 	 */postrm.d/*:|*/postrm.d/*:remove)
 		reexec_in_mountns "$@"
@@ -295,6 +308,7 @@ case $0:$mode in
 		disable_systemd_boot_hook
 		check_grub_efi_package
 		check_grub_efi_removable_status
+		mask_sd_gpt_generator
 	;;
 esac
 
-- 
2.39.5



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


             reply	other threads:[~2025-08-14 12:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14 12:40 Stoiko Ivanov [this message]
2025-08-14 15:19 ` [pve-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250814124059.2793662-1-s.ivanov@proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal