From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 34D9C1FF0BC for ; Wed, 02 Dec 2026 16:33:28 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id CB892217DD; Wed, 02 Dec 2026 16:33:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796225595; x=1796830395; darn=lists.proxmox.com; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=/Obm77uHOv9dywyxK/APVJs+oI7N1ci038hiOdj7wVw=; b=qi4BwJKUjwTjUYTDJNqs05tA1QzbNEdLr06Is7Jk5S/gMMU3HRbA9/h9Gfyz4S9OEB jfqCr31h0ZMv0W9V9gbz89ULLt3qb2Hc/I2NsWfH8Kmkln0yx0jnl/mc6LBsma1ZLPX+ bfnhWinciPiVlizG3ELNKmhyIYzkECSzN0TwJy0g3vNZ/bO7RV35KNqRMIUO2DHa9ran 0g//CKVTyDORartYdH0V/d77+2/DuVn9QtSL/8UyuLC4YoASw8fgkd2SkDrdSef+9wRH PFQekzL6t0bWjSNBadtDi5rm99PVEPWY+x5ogR//5nWcvNp3wNLEL2wxKqw2P3pfB7y3 cAMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796225595; x=1796830395; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/Obm77uHOv9dywyxK/APVJs+oI7N1ci038hiOdj7wVw=; b=LPqaOpjT8BCKkzatpnn1ClA9P0yNC7ZoCdLDLpgG7SdLfbPAnIODYaCe+UhFToDCnK KZSr+ek8BESBR9faABAFVmv+yWBpT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6XOwgBUUSkFhPMeQJQej X-Received: by 2002:a05:622a:2b49:b0:55c:c1ee:416e with SMTP id d75a77b69052e-55d76ac1965mr776475111cf.63.1796225595361; Wed, 02 Dec 2026 07:33:15 -0800 (PST) From: Arran Cudbard-Bell To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox-kernel-helper v2] fix #8395: proxmox-boot: select the GRUB EFI target by architecture Date: Wed, 2 Dec 2026 10:33:04 -0500 Message-ID: <20261202153304.65224-1-a.cudbardb@gmail.com> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust 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: HLSJIGJRJD4K4ZAXCULS3KYBAQLJ7SCU X-Message-ID-Hash: HLSJIGJRJD4K4ZAXCULS3KYBAQLJ7SCU X-MailFrom: a.cudbardb@gmail.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 CC: Arran Cudbard-Bell X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Select the GRUB EFI target, binary suffix, removable loader name and meta-package by dpkg architecture, because the hardcoded x86_64 values made proxmox-boot-tool init fail on arm64 with Secure Boot and a ZFS root. Signed-off-by: Arran Cudbard-Bell --- src/bin/proxmox-boot-tool | 10 +++++----- src/proxmox-boot/functions | 16 ++++++++++++++++ src/proxmox-boot/zz-proxmox-boot | 18 +++++++++--------- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/bin/proxmox-boot-tool b/src/bin/proxmox-boot-tool index 2632f64..474d1ed 100755 --- a/src/bin/proxmox-boot-tool +++ b/src/bin/proxmox-boot-tool @@ -162,7 +162,7 @@ init_bootloader() { mount -t vfat -o umask=0077 "$part" "$esp_mp" if [ -z "$mode" ]; then - if [ -e "$esp_mp/EFI/proxmox/grubx64.efi" ]; then + if [ -e "$esp_mp/EFI/proxmox/grub${EFI_ARCH_SUFFIX}.efi" ]; then # for reinit support mode=grub fi @@ -176,18 +176,18 @@ init_bootloader() { cp "/boot/$memtest" "$esp_mp/" fi if [ -n "$mode" ] && [ "$mode" = "grub" ]; then - echo "Installing grub x86_64 target.." + echo "Installing grub ${GRUB_EFI_TARGET} target.." grub-install.real \ --boot-directory "${esp_mp}" \ - --target x86_64-efi \ + --target "${GRUB_EFI_TARGET}" \ --no-floppy \ --efi-directory "${esp_mp}" \ --bootloader-id 'proxmox' \ "/dev/$PKNAME" - echo "Installing grub x86_64 target (removable).." + echo "Installing grub ${GRUB_EFI_TARGET} target (removable).." grub-install.real \ --boot-directory "${esp_mp}" \ - --target x86_64-efi \ + --target "${GRUB_EFI_TARGET}" \ --no-floppy \ --efi-directory "${esp_mp}" \ --removable \ diff --git a/src/proxmox-boot/functions b/src/proxmox-boot/functions index bd9f735..b0e4636 100755 --- a/src/proxmox-boot/functions +++ b/src/proxmox-boot/functions @@ -14,6 +14,22 @@ PMX_ESP_DIR="EFI/proxmox" PMX_LOADER_CONF="loader/loader.conf" GRUB_PIN_SNIPPET="/etc/default/grub.d/proxmox-kernel-pin.cfg" +# The GRUB EFI target and file names depend on the architecture. +case "$(dpkg --print-architecture)" in + arm64) + GRUB_EFI_TARGET='arm64-efi' + EFI_ARCH_SUFFIX='aa64' + EFI_REMOVABLE_LOADER='BOOTAA64.EFI' + GRUB_EFI_PACKAGE='grub-efi-arm64' + ;; + *) + GRUB_EFI_TARGET='x86_64-efi' + EFI_ARCH_SUFFIX='x64' + EFI_REMOVABLE_LOADER='BOOTX64.efi' + GRUB_EFI_PACKAGE='grub-efi-amd64' + ;; +esac + # adapted from /etc/kernel/postinst.d/apt-auto-removal as present in # debian's apt package: # diff --git a/src/proxmox-boot/zz-proxmox-boot b/src/proxmox-boot/zz-proxmox-boot index f1d51fa..dd20a18 100755 --- a/src/proxmox-boot/zz-proxmox-boot +++ b/src/proxmox-boot/zz-proxmox-boot @@ -80,7 +80,7 @@ update_esp_func() { # reset per ESP, an earlier GRUB ESP must not decide the mode of this one grub= - if [ -e "${mountpoint}/EFI/proxmox/grubx64.efi" ]; then + if [ -e "${mountpoint}/EFI/proxmox/grub${EFI_ARCH_SUFFIX}.efi" ]; then grub=1 fi if [ -d /sys/firmware/efi ] && [ "$grub" != 1 ]; then @@ -237,12 +237,12 @@ check_grub_efi_package() { return fi - if [ -f /usr/share/doc/grub-efi-amd64/changelog.Debian.gz ]; then + if [ -f "/usr/share/doc/${GRUB_EFI_PACKAGE}/changelog.Debian.gz" ]; then return fi - warn "System booted in EFI-mode but 'grub-efi-amd64' meta-package not installed!" - warn "Install 'grub-efi-amd64' to get updates." + warn "System booted in EFI-mode but '${GRUB_EFI_PACKAGE}' meta-package not installed!" + warn "Install '${GRUB_EFI_PACKAGE}' to get updates." } check_grub_efi_removable_status() { @@ -252,11 +252,11 @@ check_grub_efi_removable_status() { fi # no removable bootloader - if [ ! -f "/boot/efi/EFI/BOOT/BOOTX64.efi" ]; then + if [ ! -f "/boot/efi/EFI/BOOT/${EFI_REMOVABLE_LOADER}" ]; then return fi - debconf_value="$(debconf-show --db configdb grub-efi-amd64 grub-pc | grep 'force_efi_extra_removable')" + debconf_value="$(debconf-show --db configdb "${GRUB_EFI_PACKAGE}" grub-pc | grep 'force_efi_extra_removable')" # packages already set up to install a removable copy, let's trust that it works if echo "${debconf_value}" | grep -qE ': true$'; then @@ -264,12 +264,12 @@ check_grub_efi_removable_status() { fi echo "" - echo "Removable bootloader found at '/boot/efi/EFI/BOOT/BOOTX64.efi', but GRUB packages not set up to update it!" + echo "Removable bootloader found at '/boot/efi/EFI/BOOT/${EFI_REMOVABLE_LOADER}', but GRUB packages not set up to update it!" echo "Run the following command:" echo "" - echo "echo 'grub-efi-amd64 grub2/force_efi_extra_removable boolean true' | debconf-set-selections -v -u" + echo "echo '${GRUB_EFI_PACKAGE} grub2/force_efi_extra_removable boolean true' | debconf-set-selections -v -u" echo "" - echo "Then reinstall GRUB with 'apt install --reinstall grub-efi-amd64'" + echo "Then reinstall GRUB with 'apt install --reinstall ${GRUB_EFI_PACKAGE}'" echo "" } -- 2.53.0