[Bug 1195291] New: initrd is being rebuilt when kernel is being removed after kernel update
http://bugzilla.opensuse.org/show_bug.cgi?id=1195291 Bug ID: 1195291 Summary: initrd is being rebuilt when kernel is being removed after kernel update Classification: openSUSE Product: openSUSE Distribution Version: Leap 15.3 Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Kernel Assignee: kernel-bugs@opensuse.org Reporter: Ulrich.Windl@rz.uni-regensburg.de QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- Despite of the problem that initrds are needlessy rebuilt when installing kernel modules (bug 1100885, bug 1191322), there are also needless rebuilds when removing obsolete kernels: Still on the next boot when older kernels are removed, their initrds are being rebuilt before the kernels are removed (it seems at least). Example (combining extracts from journal and /var/log/zypp/history): Jan 27 21:36:03 i7.site [RPM][7347]: install kernel-default-5.3.18-150300.59.43.1.x86_64: success Jan 27 21:36:04 i7.site [RPM][17173]: erase kernel-macros-5.3.18-59.40.1.noarch: success Jan 27 21:36:05 i7.site [RPM][17173]: install kernel-macros-5.3.18-150300.59.43.1.noarch: success Jan 27 21:36:06 i7.site [RPM][17173]: erase kernel-macros-5.3.18-59.40.1.noarch: success Jan 27 21:36:06 i7.site [RPM][17173]: install kernel-macros-5.3.18-150300.59.43.1.noarch: success Jan 27 21:37:32 i7.site [RPM][17175]: install kernel-preempt-5.3.18-150300.59.43.1.x86_64: success Jan 27 21:37:47 i7.site [RPM][27390]: install kernel-default-extra-5.3.18-150300.59.43.1.x86_64: success Jan 27 21:37:55 i7.site [RPM][27492]: install kernel-devel-5.3.18-150300.59.43.1.noarch: success Jan 27 21:37:55 i7.site [RPM][27492]: install kernel-devel-5.3.18-150300.59.43.1.noarch: success Jan 27 21:38:03 i7.site [RPM][27497]: install kernel-preempt-extra-5.3.18-150300.59.43.1.x86_64: success Jan 27 21:38:25 i7.site [RPM][27675]: install kernel-default-optional-5.3.18-150300.59.43.1.x86_64: success Jan 27 21:38:28 i7.site [RPM][27776]: install kernel-preempt-devel-5.3.18-150300.59.43.1.x86_64: success Jan 27 21:38:28 i7.site [RPM][27776]: install kernel-preempt-devel-5.3.18-150300.59.43.1.x86_64: success Jan 27 21:38:31 i7.site [RPM][27782]: install kernel-default-devel-5.3.18-150300.59.43.1.x86_64: success Jan 27 21:38:31 i7.site [RPM][27782]: install kernel-default-devel-5.3.18-150300.59.43.1.x86_64: success Jan 27 21:38:37 i7.site [RPM][27788]: install kernel-preempt-optional-5.3.18-150300.59.43.1.x86_64: success # 2022-01-27 21:43:41 Output of kernel-default-extra-5.3.18-150300.59.43.1.x86_64.rpm %posttrans script: # Creating initrd: /boot/initrd-5.3.18-150300.59.43-default # Creating initrd: /boot/initrd-5.3.18-150300.59.43-preempt # Creating initrd: /boot/initrd-5.3.18-59.40-default # Creating initrd: /boot/initrd-5.3.18-59.40-preempt ### Reboot ### Jan 28 20:24:49 i7 zypper[1916]: The following 9 packages are going to be REMOVED: Jan 28 20:24:49 i7 zypper[1916]: kernel-default-5.3.18-59.37.2 kernel-default-devel-5.3.18-59.37.2 kernel-default-extra-5.3.18-59.37.2 kernel-default-optional-5.3.18-59.37.2 kernel-devel-5.3.18-59.37.2 kernel-preempt-5.3.18-59.37.2 kernel-preempt-devel-5.3.18-59.37.2 kernel-preempt-extra-5.3.18-59.37.2 kernel-preempt-optional-5.3.18-59.37.2 Jan 28 20:24:49 i7 zypper[1916]: 9 packages to remove. Jan 28 20:27:04 i7.site [RPM][2887]: erase kernel-default-devel-5.3.18-59.37.2.x86_64: success Jan 28 20:27:07 i7.site [RPM][2887]: erase kernel-default-devel-5.3.18-59.37.2.x86_64: success Jan 28 20:27:07 i7.site zypper[1916]: (1/9) Removing kernel-default-devel-5.3.18-59.37.2.x86_64 [.....done] Jan 28 20:27:08 i7.site [RPM][4137]: erase kernel-default-optional-5.3.18-59.37.2.x86_64: success Jan 28 20:31:10 i7.site [RPM][4137]: erase kernel-default-optional-5.3.18-59.37.2.x86_64: success Jan 28 20:31:10 i7.site zypper[1916]: (2/9) Removing kernel-default-optional-5.3.18-59.37.2.x86_64 [.....done] Jan 28 20:31:11 i7.site [RPM][11952]: erase kernel-preempt-devel-5.3.18-59.37.2.x86_64: success Jan 28 20:31:20 i7.site [RPM][11952]: erase kernel-preempt-devel-5.3.18-59.37.2.x86_64: success Jan 28 20:31:20 i7.site zypper[1916]: (3/9) Removing kernel-preempt-devel-5.3.18-59.37.2.x86_64 [.....done] Jan 28 20:31:20 i7.site [RPM][11958]: erase kernel-preempt-optional-5.3.18-59.37.2.x86_64: success Jan 28 20:32:24 i7.site [RPM][11958]: erase kernel-preempt-optional-5.3.18-59.37.2.x86_64: success Jan 28 20:32:24 i7.site zypper[1916]: (4/9) Removing kernel-preempt-optional-5.3.18-59.37.2.x86_64 [.....done] Jan 28 20:32:25 i7.site [RPM][19401]: erase kernel-default-extra-5.3.18-59.37.2.x86_64: success Jan 28 20:33:13 i7.site [RPM][19401]: erase kernel-default-extra-5.3.18-59.37.2.x86_64: success Jan 28 20:33:13 i7.site zypper[1916]: (5/9) Removing kernel-default-extra-5.3.18-59.37.2.x86_64 [.....done] Jan 28 20:33:13 i7.site zypper[1916]: Creating initrd: /boot/initrd-5.3.18-59.37-default # Creating initrd: /boot/initrd-5.3.18-59.37-default Jan 28 20:33:17 i7.site [RPM][26818]: erase kernel-devel-5.3.18-59.37.2.noarch: success Jan 28 20:33:24 i7.site [RPM][26818]: erase kernel-devel-5.3.18-59.37.2.noarch: success Jan 28 20:33:24 i7.site zypper[1916]: (6/9) Removing kernel-devel-5.3.18-59.37.2.noarch [.....done] Jan 28 20:33:24 i7.site [RPM][26819]: erase kernel-preempt-extra-5.3.18-59.37.2.x86_64: success Jan 28 20:34:11 i7.site [RPM][26819]: erase kernel-preempt-extra-5.3.18-59.37.2.x86_64: success Jan 28 20:34:11 i7.site zypper[1916]: (7/9) Removing kernel-preempt-extra-5.3.18-59.37.2.x86_64 [.....done] Jan 28 20:34:11 i7.site zypper[1916]: Creating initrd: /boot/initrd-5.3.18-59.37-preempt # Creating initrd: /boot/initrd-5.3.18-59.37-preempt Jan 28 20:34:12 i7.site [RPM][1784]: erase kernel-default-5.3.18-59.37.2.x86_64: success Jan 28 20:34:43 i7.site [RPM][1784]: erase kernel-default-5.3.18-59.37.2.x86_64: success Jan 28 20:34:43 i7.site zypper[1916]: (8/9) Removing kernel-default-5.3.18-59.37.2.x86_64 [.....done] Jan 28 20:34:44 i7.site [RPM][4725]: erase kernel-preempt-5.3.18-59.37.2.x86_64: success Jan 28 20:35:15 i7.site [RPM][4725]: erase kernel-preempt-5.3.18-59.37.2.x86_64: success Jan 28 20:35:15 i7.site zypper[1916]: (9/9) Removing kernel-preempt-5.3.18-59.37.2.x86_64 [.....done] Jan 28 20:35:15 i7.site systemd[1]: purge-kernels.service: Succeeded. In addition to rebuiling the initrds, the bootloader was reinstalled (including the os-prober), so the removal of the old kernels took 10 minutes alltogether! # grep run_command.*grub2 /var/log/pbl.log 2022-01-27 21:35:35 <1> update-bootloader-7882 run_command.294: '/usr/lib/bootloader/grub2/config' = 0, output: 2022-01-27 21:36:03 <1> bootloader_entry-1449 run_command.294: '/usr/lib/bootloader/grub2/config' = 0, output: 2022-01-27 21:37:03 <1> update-bootloader-9958 run_command.294: '/usr/lib/bootloader/grub2/config' = 0, output: 2022-01-27 21:37:32 <1> bootloader_entry-8996 run_command.294: '/usr/lib/bootloader/grub2/config' = 0, output: 2022-01-27 21:41:39 <1> update-bootloader-8968 run_command.294: '/usr/lib/bootloader/grub2/config' = 0, output: 2022-01-27 21:42:20 <1> update-bootloader-0547 run_command.294: '/usr/lib/bootloader/grub2/config' = 0, output: 2022-01-27 21:43:00 <1> update-bootloader-6949 run_command.294: '/usr/lib/bootloader/grub2/config' = 0, output: 2022-01-27 21:43:41 <1> update-bootloader-7629 run_command.294: '/usr/lib/bootloader/grub2/config' = 0, output: 2022-01-28 20:31:09 <1> update-bootloader-0043 run_command.294: '/usr/lib/bootloader/grub2/config' = 0, output: 2022-01-28 20:32:23 <1> update-bootloader-4882 run_command.294: '/usr/lib/bootloader/grub2/config' = 0, output: 2022-01-28 20:33:12 <1> update-bootloader-4790 run_command.294: '/usr/lib/bootloader/grub2/config' = 0, output: 2022-01-28 20:34:11 <1> update-bootloader-4190 run_command.294: '/usr/lib/bootloader/grub2/config' = 0, output: 2022-01-28 20:34:43 <1> bootloader_entry-0829 run_command.294: '/usr/lib/bootloader/grub2/config' = 0, output: 2022-01-28 20:35:14 <1> bootloader_entry-7074 run_command.294: '/usr/lib/bootloader/grub2/config' = 0, output: Reinstalling the boot loader 15 times when updating two kernels!? -- You are receiving this mail because: You are the assignee for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1195291 http://bugzilla.opensuse.org/show_bug.cgi?id=1195291#c7 --- Comment #7 from Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de> --- Created attachment 856130 --> http://bugzilla.opensuse.org/attachment.cgi?id=856130&action=edit Output when removing an older kernel I had removed an older kernel in one RPM transaction, but still the initrd of the kernel to remove was rebuilt twice. -- You are receiving this mail because: You are the assignee for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1195291 http://bugzilla.opensuse.org/show_bug.cgi?id=1195291#c8 --- Comment #8 from Martin Wilck <martin.wilck@suse.com> --- I'm repeating myself here: you can't expect anything else. We (myself, at least) won't work on this before 15.4 is released. I simply have no time for it. If you want to provide and test patches, feel very welcome. -- You are receiving this mail because: You are the assignee for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1195291 http://bugzilla.opensuse.org/show_bug.cgi?id=1195291#c9 Felix Miata <mrmazda@earthlink.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|Leap 15.3 |Leap 15.5 Summary|initrd is being rebuilt |initrd is being rebuilt |when kernel is being |when kernel is being |removed after kernel update |removed --- Comment #9 from Felix Miata <mrmazda@earthlink.net> --- To reproduce: 1-(e.g.) # zypper rm kernel-default-5.14.19-150400.1 Actual behavior: 1-(from /var/log/history): 2022-08-20 16:44:01|command|root@gb970|'zypper' 'rm' 'kernel-default-5.14.19-150400.1'| # 2022-08-20 16:44:40 kernel-default-extra-5.14.19-150400.1.1.x86_64 removed ok # Additional rpm output: # dracut: Executing: /usr/bin/dracut -f /boot/initrd-5.14.19-150400.1-default 5.14.19-150400.1-default ... # dracut: *** Stripping files done *** # dracut: *** Creating image file '/boot/initrd-5.14.19-150400.1-default' *** # dracut: *** Creating initramfs image file '/boot/initrd-5.14.19-150400.1-default' done *** # 2022-08-20 16:44:40|remove |kernel-default-extra|5.14.19-150400.1.1|x86_64|root@gb970| 2022-08-20 16:44:47|remove |kernel-default|5.14.19-150400.1.1|x86_64|root@gb970| Expected behavior: 1-2022-08-20 16:44:01|command|root@gb970|'zypper' 'rm' 'kernel-default-5.14.19-150400.1'| # 2022-08-20 16:44:40 kernel-default-extra-5.14.19-150400.1.1.x86_64 removed ok 2022-08-20 16:44:40|remove |kernel-default-extra|5.14.19-150400.1.1|x86_64|root@gb970| 2022-08-20 16:44:47|remove |kernel-default|5.14.19-150400.1.1|x86_64|root@gb970| 2-no resources wasted rebuilding initrd that is to be immediately removed Additional comments: 1-kernel-default-extra on this and several other hosts here gets installed for the exclusive reason that the required nouveau kernel module is omitted from the kernel-default package. 2-purge-kernels service is not used here. Kernels are removed completely independently of any kernel update processes, so adjusting summary accordingly, and updating version from 15.3 to 15.5 per comment #8. -- You are receiving this mail because: You are the assignee for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1195291 http://bugzilla.opensuse.org/show_bug.cgi?id=1195291#c10 Michal Suchanek <msuchanek@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Ulrich.Windl@rz.uni-regensb | |urg.de Version|Leap 15.5 |Leap 15.4 Assignee|kernel-bugs@opensuse.org |martin.wilck@suse.com Flags| |needinfo?(Ulrich.Windl@rz.u | |ni-regensburg.de), | |needinfo?(mrmazda@earthlink | |.net) --- Comment #10 from Michal Suchanek <msuchanek@suse.com> --- This is with suse-module-tools now. Given that upgrade and remove run the same scripts (per rpm API) this is not trivial to fix. Patches accepted. -- You are receiving this mail because: You are the assignee for the bug.
participants (1)
-
bugzilla_noreply@suse.com