#1035327 installation-reports: Cannot boot installer with grub2: out of memory

#1035327#5
Date:
2023-04-30 22:46:41 UTC
From:
To:
(Please provide enough information to help the Debian
maintainers evaluate the report efficiently - e.g., by filling
in the sections below.)

Boot method: USB
Image version: https://cdimage.debian.org/cdimage/bookworm_di_rc2/amd64/iso-cd/debian-bookworm-DI-rc2-amd64-netinst.iso, then eventually https://cdimage.debian.org/cdimage/archive/10.0.0-live/amd64/iso-hybrid/debian-live-10.0.0-amd64-standard.iso
Date: 2023 April 27 to 30

Machine: Lenovo Slim 9 14IAP7
Partitions: <df -Tl will do; the raw partition table is preferred>
Filesystem     Type     1K-blocks     Used Available Use% Mounted on
udev           devtmpfs  16272540        0  16272540   0% /dev
tmpfs          tmpfs      3257784     2428   3255356   1% /run
/dev/nvme0n1p2 ext4     950110932 12509196 889264996   2% /
tmpfs          tmpfs     16288920   195320  16093600   2% /dev/shm
tmpfs          tmpfs         5120       12      5108   1% /run/lock
/dev/nvme0n1p1 vfat        523248    14164    509084   3% /boot/efi
tmpfs          tmpfs      3257784       20   3257764   1% /run/user/1000


Base System Installation Checklist:
[O] = OK, [E] = Error (please elaborate below), [ ] = didn't try it

Initial boot:           [E]
Detect network card:    [ ]
Configure network:      [ ]
Detect media:           [ ]
Load installer modules: [ ]
Clock/timezone setup:   [ ]
User/password setup:    [ ]
Detect hard drives:     [ ]
Partition hard drives:  [ ]
Install base system:    [ ]
Install tasks:          [ ]
Install boot loader:    [E]
Overall install:        [ ]

Comments/Problems:

During attempt to install Bookworm RC2 on a new laptop, the bootloader
would not boot with "error: Out of memory." after the initial Grub
screen.

This seems to be related to the size of the initrd and the video being
4K.  It has been present for at least all of Debian 11 as well, as I
moved back in the live USBs and installers to try and find a version
which would boot.  Eventually 10.0 liveusb would work to install
(the second URL above), and then by changing the GRUB_GFXMODE to
'640x480' it would boot after install.

I then upgraded through stable, testing, and finally unstable.

When upgrading, I encountered the bug again, and ended up fixing it
by chaning `MODULES=most` to `MODULES=dep` in
/etc/initramfs-tools/initramfs.conf

From what I can gather, this is a grub2 bug, and detailed here:
 - https://bugs.launchpad.net/oem-priority/+bug/1842320

The issue seems to be fixed in upstream grub2 later in 2.12 from memory
management, or there are some patches referenced in:
 - https://bugs.launchpad.net/oem-priority/+bug/1842320/comments/96

It was quite frustrating so I am dropping a note here as if it can be
fixed for bookworm it would be wonderful.