[Bug 1182318] New: Superfluous mkinitrd / dracut calls at kernel post scriptlet

https://bugzilla.suse.com/show_bug.cgi?id=1182318 Bug ID: 1182318 Summary: Superfluous mkinitrd / dracut calls at kernel post scriptlet Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Kernel Assignee: kernel-bugs@opensuse.org Reporter: tiwai@suse.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- The current kernel rpm scriptlets have some room for optimization. Most notably, the initrd creation and boot loader setup are called at %post, and those can be postponed to %posttrans instead. The problem of multiple initrd creations and boot loader setups becomes more significant when another package touching initrd (e.g. coreutils) is installed together, or when the split kernel (kernel-default-extra) is installed together. As the initrd and the bootloeader setup are triggered in %post from both kernel-default and kernel-default-extra while the re-creation of the all initrd is triggered by another package update, this will end up two more extra calls that are superfluous. In addition to the above, the pre.sh script contains a few almost superfluous checks no one really cares. We may clean them up, too. -- You are receiving this mail because: You are the assignee for the bug.

https://bugzilla.suse.com/show_bug.cgi?id=1182318 https://bugzilla.suse.com/show_bug.cgi?id=1182318#c1 --- Comment #1 from Michal Suchanek <msuchanek@suse.com> --- The posttrans scripts are not executed when zypper fails or crashes, and rpm does not track script execution status so the scripts are never retried. Possible mitigations: - tell grub scripts that initrd is needed for packaged kernels (eg place a file together with the kernel) and make grub not list kernels that lack initd in menu - instead of creating initrd synchronously set a flag that initrd is to be created and start initrd creation in the background. If the flag is set again the initrd is re-created once finished. In posttrans wait for background creation to finish. background initrd creation with restart already used by kdump service. -- You are receiving this mail because: You are the assignee for the bug.

https://bugzilla.suse.com/show_bug.cgi?id=1182318 https://bugzilla.suse.com/show_bug.cgi?id=1182318#c2 --- Comment #2 from Takashi Iwai <tiwai@suse.com> --- The installation integrity is a general problem of rpm, but for the kernel installation, it's more serious because this is the most bast part of the installation. The second proposal sounds promising, it also relaxes the blockage by the package installation. So this means that we'll have a system service that (re-)creates the initrds. It can be set to finish before shutdown / hibernation, too. Actually we can do both proposals; those are not exclusive. The worst case is to boot a broken kernel installation. I guess an alternative to the first proposal is something like: at package installation time, put the kernel as some invalid file name like /boot/xxxvmlinuz-*, then rename it to a proper name /boot/vmlinuz-* once after the initrd is created, and run grub2-mkconfig. -- You are receiving this mail because: You are the assignee for the bug.

https://bugzilla.suse.com/show_bug.cgi?id=1182318 https://bugzilla.suse.com/show_bug.cgi?id=1182318#c3 --- Comment #3 from Michal Suchanek <msuchanek@suse.com> --- The problem with renaming the kernel is that this is dynamic - how will this work with packaging all the files? On the other hand placing an extra file alongside the kernel is static, and easy to check by the grub scripts. -- You are receiving this mail because: You are the assignee for the bug.

https://bugzilla.suse.com/show_bug.cgi?id=1182318 https://bugzilla.suse.com/show_bug.cgi?id=1182318#c4 --- Comment #4 from Takashi Iwai <tiwai@suse.com> --- Basically we just need to care /boot/vmlinuz-* file, which is the only files grub scans over and handles. We may list both /boot/xxxvmlinuz-* and /boot/vmlinuz-* in the rpm file list, so that they can be cleaned up properly, too. -- You are receiving this mail because: You are the assignee for the bug.

https://bugzilla.suse.com/show_bug.cgi?id=1182318 https://bugzilla.suse.com/show_bug.cgi?id=1182318#c5 --- Comment #5 from Ludwig Nussel <lnussel@suse.com> --- Fedora installs the kernel also into (/usr)/lib/modules/$kver. The actual bootloader installation scripts are responsible to get the kernel into the boot partition from there. That nicely fits the usrmerge idea to have all OS in /usr. I think we need to sit down in a broader group to design how we want to handle this in the longer run. -- You are receiving this mail because: You are the assignee for the bug.

https://bugzilla.suse.com/show_bug.cgi?id=1182318 Ludwig Nussel <lnussel@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |1165830 -- You are receiving this mail because: You are the assignee for the bug.
participants (1)
-
bugzilla_noreply@suse.com