Bug 30270

Summary: Kernel (dracut) error in dracut does not fail install
Product: Mageia Reporter: Marc Krämer <mageia>
Component: RPM PackagesAssignee: Kernel and Drivers maintainers <kernel>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: Normal CC: davidwhodgins
Version: Cauldron   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: kernel-5.15.32-1.mga8.src.rpm CVE:
Status comment:

Description Marc Krämer 2022-04-11 11:02:42 CEST
If dracut stops with an error like e.g.

dracut: *** Creating image file '/boot/initrd-5.15.32-desktop-1.mga8.img' ***
cp: error writing '/boot/initrd-5.15.32-desktop-1.mga8.img': No space left on device
dracut: dracut: creation of /boot/initrd-5.15.32-desktop-1.mga8.img failed


The kernel and the bootloader are still updated, which will (for a normal user) result in an "unbootable" system.

If we have an error here, we should not update the bootloader with the latest kernel.
Comment 1 Dave Hodgins 2022-04-11 19:23:55 CEST
Assigning to kernel team as an enhancement request.

Assignee: bugsquad => kernel
Version: 8 => Cauldron
CC: (none) => davidwhodgins
Severity: normal => enhancement

Comment 2 Dave Hodgins 2022-04-11 20:41:56 CEST
One issue with this request, installing the kernel packages and generating the
initrd are two separate steps, though the initrd generation is triggered by the
packages being installed.

Even if the initrd fails to be generated, the currently running kernel does not
get uninstalled, so it does not lead to an "unbootable" system. Unbootable with
the newest kernel, yes, but not unbootable.

Removing the just installed kernel packages would later require re-downloading
and installing those same packages once space had been made available, a
needless waste of resources.

The proper way to fix it is to make the space available (increasing /boot size
or removing older kernels and their initrd files), and then running
"dracut /boot/initrd-5.15.33-server-1.mga8.img 5.15.33-server-1.mga8"
with the appropriate kernel flavor and version.

I'll leave it to the kernel team to close this as wont fix, if they agree with
me.
Comment 3 Dave Hodgins 2022-04-11 20:53:45 CEST
Thinking about it more, what about rpm refusing to install the kernel if
/boot doesn't have the amount of free space used by the currently running
kernel's initrd?
Comment 4 Marc Krämer 2022-04-12 10:38:23 CEST
I know what the "right way", but unless https://bugs.mageia.org/show_bug.cgi?id=24403 is fixed, it happens sometimes, that kernels get installed and /boot does not have enough space.
I see the main problem that grub-config is updated and initrd is not present. If you reboot, the system hangs. The user has to manually select a prior kernel to be able to boot the system.

I prefer just not to update grub config in case initrd fails to build.
Comment 5 Marc Krämer 2022-07-04 20:55:03 CEST
I've run into this issue again - it is annoying....
And no error is produced. Just install of initrd fails, so "regular boot" is not possible.