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 on the CC list for the bug.