* [PATCH kernel-helper v2] fix #7223: proxmox-boot: add memtest86 as entry to all boot-loaders
@ 2026-02-27 14:43 Stoiko Ivanov
2026-03-05 11:07 ` Daniel Herzig
0 siblings, 1 reply; 2+ messages in thread
From: Stoiko Ivanov @ 2026-02-27 14:43 UTC (permalink / raw)
To: pve-devel
memtest86+ ships a config-snippet for grub configuration, and is thus
present on installations using grub (although currently not functional
when secure-boot is enabled), without proxmox-boot-tool.
adding an equivalent entry for memtest86+ on systems, where
proxmox-boot-tool manages the boot-loader seems like an improvement
and a step to having similar functionality in our different
boot-loader setups.
Tested by installing proxmox-kernel-helper with this patch and running
proxmox-boot-tool reinit, followed by rebooting into memtest86+ on a
systemd-booted system. Additionally tested the addition of the entry
in grub, by both installing on a system booted in legacy bios mode and
one where I ran `proxmox-boot-tool init /dev/sdX2 grub` (after
formatting). To get the entry in grub a `proxmox-boot-tool refresh`
call is needed (so that `update-grub` generates the entries). As this
will get called anyways upon installation from ISO, and on each
kernel-upgrade I decided against calling it in `proxmox-boot-tool
init|reinit` additionally.
Suggested-by: Daniel Herzig <d.herzig@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
this patch supersedes:
https://lore.proxmox.com/all/20260225183621.201783-1-s.ivanov@proxmox.com/
v1->v2
* added a reference to #7223 - thanks @Laurentiu for the hint!
* additionally add memtest to grub-booted systems - thanks @Daniel Herzig for
the feedback and additional tests!
src/bin/proxmox-boot-tool | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/bin/proxmox-boot-tool b/src/bin/proxmox-boot-tool
index 95d699d..ee04193 100755
--- a/src/bin/proxmox-boot-tool
+++ b/src/bin/proxmox-boot-tool
@@ -158,7 +158,13 @@ init_bootloader() {
fi
fi
+
if [ -d /sys/firmware/efi ]; then
+ memtest=memtest86+x64.efi
+ if [ -f "/boot/$memtest" ]; then
+ echo "Adding $memtest .."
+ cp "/boot/$memtest" "$esp_mp/"
+ fi
if [ -n "$mode" ] && [ "$mode" = "grub" ]; then
echo "Installing grub x86_64 target.."
grub-install.real \
@@ -196,8 +202,23 @@ init_bootloader() {
echo "timeout 3" > "$esp_mp/$PMX_LOADER_CONF.tmp"
echo "default proxmox-*" >> "$esp_mp/$PMX_LOADER_CONF.tmp"
mv "$esp_mp/$PMX_LOADER_CONF.tmp" "$esp_mp/$PMX_LOADER_CONF"
+ memtest_conf="$esp_mp/loader/entries/$memtest.conf"
+ if [ -f "/boot/$memtest" ]; then
+ echo "Adding $memtest .."
+ cp "/boot/$memtest" "$esp_mp/EFI/"
+ cat > "$memtest_conf.tmp" <<- EOF
+ title Memory test ($memtest)
+ efi /EFI/$memtest
+ EOF
+ mv "$memtest_conf.tmp" "$memtest_conf"
+ fi
fi
else
+ memtest=memtest86+x64.bin
+ if [ -f "/boot/$memtest" ]; then
+ echo "Adding $memtest .."
+ cp "/boot/$memtest" "$esp_mp/"
+ fi
echo "Installing grub i386-pc target.."
grub-install.real \
--boot-directory "$esp_mp" \
--
2.47.3
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH kernel-helper v2] fix #7223: proxmox-boot: add memtest86 as entry to all boot-loaders
2026-02-27 14:43 [PATCH kernel-helper v2] fix #7223: proxmox-boot: add memtest86 as entry to all boot-loaders Stoiko Ivanov
@ 2026-03-05 11:07 ` Daniel Herzig
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Herzig @ 2026-03-05 11:07 UTC (permalink / raw)
To: Stoiko Ivanov, pve-devel
Thanks for this! I just tested it against a ZFS-RAID1 2 disk mirror root
installation booting with GRUB. Here the memtest86+ entry becomes
available upon reboot, just by apt-installing the patched package.
Tested-by: Daniel Herzig<d.herzig@proxmox.com>
On 2/27/26 3:44 PM, Stoiko Ivanov wrote:
> memtest86+ ships a config-snippet for grub configuration, and is thus
> present on installations using grub (although currently not functional
> when secure-boot is enabled), without proxmox-boot-tool.
>
> adding an equivalent entry for memtest86+ on systems, where
> proxmox-boot-tool manages the boot-loader seems like an improvement
> and a step to having similar functionality in our different
> boot-loader setups.
>
> Tested by installing proxmox-kernel-helper with this patch and running
> proxmox-boot-tool reinit, followed by rebooting into memtest86+ on a
> systemd-booted system. Additionally tested the addition of the entry
> in grub, by both installing on a system booted in legacy bios mode and
> one where I ran `proxmox-boot-tool init /dev/sdX2 grub` (after
> formatting). To get the entry in grub a `proxmox-boot-tool refresh`
> call is needed (so that `update-grub` generates the entries). As this
> will get called anyways upon installation from ISO, and on each
> kernel-upgrade I decided against calling it in `proxmox-boot-tool
> init|reinit` additionally.
>
> Suggested-by: Daniel Herzig <d.herzig@proxmox.com>
> Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
> ---
> this patch supersedes:
> https://lore.proxmox.com/all/20260225183621.201783-1-s.ivanov@proxmox.com/
>
> v1->v2
> * added a reference to #7223 - thanks @Laurentiu for the hint!
> * additionally add memtest to grub-booted systems - thanks @Daniel Herzig for
> the feedback and additional tests!
>
> src/bin/proxmox-boot-tool | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/src/bin/proxmox-boot-tool b/src/bin/proxmox-boot-tool
> index 95d699d..ee04193 100755
> --- a/src/bin/proxmox-boot-tool
> +++ b/src/bin/proxmox-boot-tool
> @@ -158,7 +158,13 @@ init_bootloader() {
> fi
> fi
>
> +
> if [ -d /sys/firmware/efi ]; then
> + memtest=memtest86+x64.efi
> + if [ -f "/boot/$memtest" ]; then
> + echo "Adding $memtest .."
> + cp "/boot/$memtest" "$esp_mp/"
> + fi
> if [ -n "$mode" ] && [ "$mode" = "grub" ]; then
> echo "Installing grub x86_64 target.."
> grub-install.real \
> @@ -196,8 +202,23 @@ init_bootloader() {
> echo "timeout 3" > "$esp_mp/$PMX_LOADER_CONF.tmp"
> echo "default proxmox-*" >> "$esp_mp/$PMX_LOADER_CONF.tmp"
> mv "$esp_mp/$PMX_LOADER_CONF.tmp" "$esp_mp/$PMX_LOADER_CONF"
> + memtest_conf="$esp_mp/loader/entries/$memtest.conf"
> + if [ -f "/boot/$memtest" ]; then
> + echo "Adding $memtest .."
> + cp "/boot/$memtest" "$esp_mp/EFI/"
> + cat > "$memtest_conf.tmp" <<- EOF
> + title Memory test ($memtest)
> + efi /EFI/$memtest
> + EOF
> + mv "$memtest_conf.tmp" "$memtest_conf"
> + fi
> fi
> else
> + memtest=memtest86+x64.bin
> + if [ -f "/boot/$memtest" ]; then
> + echo "Adding $memtest .."
> + cp "/boot/$memtest" "$esp_mp/"
> + fi
> echo "Installing grub i386-pc target.."
> grub-install.real \
> --boot-directory "$esp_mp" \
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-03-05 11:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-27 14:43 [PATCH kernel-helper v2] fix #7223: proxmox-boot: add memtest86 as entry to all boot-loaders Stoiko Ivanov
2026-03-05 11:07 ` Daniel Herzig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox