Hi guys, I want to share my success story:
It happened after I've updated to CUDA repo's nvidia drivers :) my
`initrd.img-5.15.0-58-generic` (`ls -lah /boot`) was about 192M and using
tuning option of the `/etc/initramfs-tools/initramfs.conf` file I've decreased
it (`sudo update-initramfs -c -k 5.15.0-58-generic`) to 116M and now it works =)
my `/etc/initramfs-tools/initramfs.conf`
```
#
# initramfs.conf
# Configuration file for mkinitramfs(8). See initramfs.conf(5).
#
# Note that configuration options from this file can be overridden
# by config files in the /etc/initramfs-tools/conf.d directory.
#
# MODULES: [ most | netboot | dep | list ]
#
# most - Add most filesystem and all harddrive drivers.
#
# dep - Try and guess which modules to load.
#
# netboot - Add the base modules, network modules, but skip block devices.
#
# list - Only include modules from the 'additional modules' list
#
# original
#MODULES=most
# patch
MODULES=dep
#
# BUSYBOX: [ y | n | auto ]
#
# Use busybox shell and utilities. If set to n, klibc utilities will be used.
# If set to auto (or unset), busybox will be used if installed and klibc will
# be used otherwise.
#
BUSYBOX=auto
#
# COMPRESS: [ gzip | bzip2 | lz4 | lzma | lzop | xz | zstd ]
#
# original
# COMPRESS=zstd
COMPRESS=xz
#
# DEVICE: ...
#
# Specify a specific network interface, like eth0
# Overridden by optional ip= or BOOTIF= bootarg
#
DEVICE=
#
# NFSROOT: [ auto | HOST:MOUNT ]
#
NFSROOT=auto
#
# RUNSIZE: ...
#
# The size of the /run tmpfs mount point, like 256M or 10%
# Overridden by optional initramfs.runsize= bootarg
#
RUNSIZE=10%
#
# FSTYPE: ...
#
# The filesystem type(s) to support, or "auto" to use the current root
# filesystem type
#
FSTYPE=auto
# patch
export XZ_OPT='--lzma2=preset=0,dict=8M'
```
Hope it will help you (and don't forget about `sudo update-initramfs -c
-k YOUR_VERSION-generic`). Keep yourself safe (from kernel panics too)
and Glory to Ukraine!
--
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1842320
Title:
Can't boot: "error: out of memory." immediately after the grub menu
Status in grub:
Unknown
Status in OEM Priority Project:
Triaged
Status in grub2-signed package in Ubuntu:
Fix Committed
Status in grub2-unsigned package in Ubuntu:
Fix Released
Status in initramfs-tools package in Ubuntu:
Won't Fix
Status in linux package in Ubuntu:
Confirmed
Bug description:
[Workaround]
Some workarounds have been suggested in
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1842320/comments/125
[Impact]
* In some cases, if the users’ initramfs grow bigger, then it’ll
likely not be able to be loaded by grub2.
* Some real cases from OEM projects:
In many built-in 4k monitor laptops with nvidia drivers, the u-d-c
puts the nvidia*.ko to initramfs which grows the initramfs to ~120M.
Also the gfxpayload=auto will remain to use 4K resolution since it’s
what EFI POST passed.
In this case, the grub isn't able to load initramfs because the
grub_memalign() won't be able to get suitable memory for the larger
file:
```
#0 grub_memalign (align=1, size=592214020) at ../../../grub-core/kern/mm.c:376
#1 0x7dd7b074 in grub_malloc (size=592214020) at
../../../grub-core/kern/mm.c:408
#2 0x7dd7a2c8 in grub_verifiers_open (io=0x7bc02d80, type=131076)
at ../../../grub-core/kern/verifiers.c:150
#3 0x7dd801d4 in grub_file_open (name=0x7bc02f00
"/boot/initrd.img-5.17.0-1011-oem",
type=131076) at ../../../grub-core/kern/file.c:121
#4 0x7bcd5a30 in ?? ()
#5 0x7fe21247 in ?? ()
#6 0x7bc030c8 in ?? ()
#7 0x00017fe21238 in ?? ()
#8 0x7bcd5320 in ?? ()
#9 0x7fe21250 in ?? ()
#10 0x in ?? ()
```
Based on grub_mm_dump, we can see the memory region starvation in <1G
addresses:
Type StartEnd # Pages Attributes
Available -00086FFF 0087 000F
BS_Data00087000-00087FFF 0001 000F
Available 00088000-0009EFFF 0017 000F
Reserved 0009F000-0009 0001 000F
Available 0010-00FF 0F00 000F
LoaderCode 0100-01021FFF 0022 000F
Available 01022000-238A7FFF 00022886 000F
BS_Data238A8000-23927FFF 0080 000F
Available 23928000-28860FFF 4F39 000F
BS_Data28861000-2AB09FFF 22A9 000F
LoaderCode 2AB0A000-2ACF8FFF 01EF 000F
BS_Data2ACF9000-2B2FAFFF