From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 2589D1FF145 for ; Sun, 07 Jun 2026 08:51:34 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id F12A28E40; Sun, 7 Jun 2026 08:51:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780815084; x=1781419884; 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; bh=fe8ptOfvi6REPHFdvBlMJ8UrBJr5IRaunsVV+2GEFcA=; b=KANdq2UOhNCArKz0GLV5qySK6HeO2otvy2opmPkUrmKoASgypzmb8jxnnfVneAhqNZ 55NLe/66TAvgrweqh83A7tpbNxJu2eh70aaHBJ3Jh5CtEXpcaeYueWoEGO629+jjrzlA lMZ/RS7uGsfFYK+81ZoKKsYmizmF9J/BfVOQUzpQkyE/XuvilsV/x4g20D1Gr24gzy7u hrswmNtk5jLVJzBDMJ0FzEEiGIBuujEYDbrH/daOPtjWfJswODnyRcsuAtQVsClm7BAF MkIECQLhB3qqpTEubKXmD2IAtsUFX90nxc99TLaoua+tBM1AQjvPtXzv8NFpGVdAElEd Hx1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780815084; x=1781419884; 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; bh=fe8ptOfvi6REPHFdvBlMJ8UrBJr5IRaunsVV+2GEFcA=; b=iBP8tkvNVI2d9oNJVVwBZr+5nLHePIY6oCHqA8D9CC9nrHvVGtt1KNH0tFdhTvEFrN gJ2AbH0DYveFymWAyJyyiMe6k5IYvXF4jgTHPSo+UunO7PmLhJF+OsGW0NJfjgTBcQMN 5LuiGQ12Wzw2vFxQyZswC7KhjkVUo0nacpCiT6atR2tiI3Xc42ktP5H6gFIUTGqF+veN /NeJoBoD280VaiAR5+fQVoi5BXZE0qdaIwzDwML+hz0OHAocPgZVT8UdJQyVBu6AHD/M f2cHr0jp4W4FZBPmPUNtkNHWxLw4OIevOBjVeCKWDgttsQqowQkuOXfAom8pS8zibZKA BvZw== X-Gm-Message-State: AOJu0YzncaBKjbMA4zFi2OHBhkg7xHjfegyeQyT+HQEXPU76aGReJR/9 lSflfllPpi5cQ+TD4vuM0TiVq/9nQJ0yTftSs5PGNf5WjcBXJy5YG2pRO11FHNup9L6e4w== X-Gm-Gg: Acq92OFNXKBsD95zW2oj69td8lBpZq3xU9XhAZD/onAnKIp2Gjd7z2sUioTwy1dirPR 8HROaqi/TN8Wv1IAoGdxSTezkijrefkCzvxJbpWHnnawEgKno3MQMgHP18gFfmBsRbXSK0oy9TJ Ut9vFWTNdoyppeHfLNWtRkKfavnDO2KVwTVJqglodnRoq6npf44Sy3xqD4i8+1iXhzRV5sduPlN R9zDmTXXYUYsiklM44e/E9V2wXGaXjfJ6SgaJRJAkZLX5SmRlchJCKaBJ/1i2pvHD82/2jQbla/ efo6yX8XLgxNJ3rUdNpNjK/Z1gJosJ6u8oBrxKqfcjWFSz03wicTl7z/j4Zm8mIUUpUQCRDrS4t fJmeJcdYMd7IJCiunDL3r8qo9dH5ddwq+fIuUi3l3JquKHsFFtMDnnbIALJmniCSo7bXpfZOZjD siFQZnTz5lrKmXZVD3H+L2gEbZeV/zkdUNfLVlQVj43TDXXxCD0rwmKcqKgtzM X-Received: by 2002:a05:6a20:6a20:b0:398:837a:7af0 with SMTP id adf61e73a8af0-3b4ccf82d99mr12726330637.30.1780815083716; Sat, 06 Jun 2026 23:51:23 -0700 (PDT) From: Kaiyang Wu X-Google-Original-From: Kaiyang Wu To: pve-devel@lists.proxmox.com Subject: [PATCH kernel-helper] zz-proxmox-boot: make grub EFI architecture aware Date: Sun, 7 Jun 2026 14:51:09 +0800 Message-ID: <20260607065119.120120-1-wukaiyang@loongfans.cn> X-Mailer: git-send-email 2.52.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 BAYES_00 -1.9 Bayes spam probability is 0 to 1% 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_ENVFROM_END_DIGIT 1 Envelope-from freemail username ends in digit 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: QG6C7CNEZSK7LCURSXKHBALKUH4PX4UV X-Message-ID-Hash: QG6C7CNEZSK7LCURSXKHBALKUH4PX4UV X-MailFrom: wukaiyang2003@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: Kaiyang Wu X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Add architecture based Grub EFI bootloader detection and processing. Signed-off-by: Kaiyang Wu --- src/proxmox-boot/zz-proxmox-boot | 38 ++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/src/proxmox-boot/zz-proxmox-boot b/src/proxmox-boot/zz-proxmox-boot index 541a982..e80e2f3 100755 --- a/src/proxmox-boot/zz-proxmox-boot +++ b/src/proxmox-boot/zz-proxmox-boot @@ -41,6 +41,8 @@ elif [ -d /usr/share/doc/proxmox-backup/ ]; then LOADER_TITLE="Proxmox Backup Server" fi +ARCH="$(dpkg --print-architecture)" + update_esps() { if [ ! -f "${ESP_LIST}" ]; then warn "No ${ESP_LIST} found, skipping ESP sync." @@ -78,7 +80,16 @@ update_esp_func() { mount -t vfat -o umask=0077 "${path}" "${mountpoint}" || \ { warn "mount of ${path} failed - skipping"; return; } - if [ -e "${mountpoint}/EFI/proxmox/grubx64.efi" ]; then + grub_efi_binary="" + if [ "$ARCH" = "amd64" ]; then + grub_efi_binary="grubx64.efi" + elif [ "$ARCH" = "arm64" ]; then + grub_efi_binary="grubaa64.efi" + else + warn "Unsupported architecture ${ARCH}" + fi + + if [ -e "${mountpoint}/EFI/proxmox/${grub_efi_binary}" ]; then grub=1 fi if [ -d /sys/firmware/efi ] && [ "$grub" != 1 ]; then @@ -235,12 +246,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-${ARCH}/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-${ARCH}' meta-package not installed!" + warn "Install 'grub-efi-${ARCH}' to get updates." } check_grub_efi_removable_status() { @@ -249,12 +260,21 @@ check_grub_efi_removable_status() { return fi + removable_efi_binary="" + if [ "$ARCH" = "amd64" ]; then + removable_efi_binary="BOOTX64.efi" + elif [ "$ARCH" = "arm64" ]; then + removable_efi_binary="BOOTAA64.efi" + else + warn "Unsupported architecture ${ARCH}" + fi + # no removable bootloader - if [ ! -f "/boot/efi/EFI/BOOT/BOOTX64.efi" ]; then + if [ ! -f "/boot/efi/EFI/BOOT/${removable_efi_binary}" ]; 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-${ARCH} 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 @@ -262,12 +282,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/${removable_efi_binary}', 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-${ARCH} 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-${ARCH}'" echo "" } -- 2.52.0