Bug 1151650 - reinstalling kernel does not regenerate initramfs
Summary: reinstalling kernel does not regenerate initramfs
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-10 23:11 UTC by Christian Stadelmann
Modified: 2016-01-25 15:32 UTC (History)
18 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-01-25 15:32:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1200302 0 urgent CLOSED dnf reinstall breaks alternatives 2021-11-25 08:51:44 UTC
Red Hat Bugzilla 1211896 0 unspecified CLOSED Today after system upgrade broken boot menu on all upgraded machines 2021-02-22 00:41:40 UTC

Internal Links: 1200302 1211896

Description Christian Stadelmann 2014-10-10 23:11:11 UTC
Description of problem:
running
# yum reinstall kernel
or
# dnf reinstall kernel
does not regenerate initramfs.

Version-Release number of selected component (if applicable):
all on F20 and F21

How reproducible:
always. on F20 and F21

Steps to Reproduce:
1. reinstall kernel

Actual results:
Initramfs is not regenerated

Expected results:
Initramfs should be regenerated

Comment 1 Josh Boyer 2014-10-14 16:55:52 UTC
I have no idea what yum or dnf do internally here.  The initramfs is generated in a %post scriptlet by calling kernel-install and it's removed by a %preun script by calling the same.  If a reinstall transaction doesn't result in those scriptlets being called then it won't get regenerated.

Looking at the man page for yum, it says this explicitly doesn't work for kernels anyway:

reinstall
              Will reinstall the identically versioned package as is currently
              installed.   This does not work for "installonly" packages, like
              Kernels. reinstall  operates  on  groups,  files,  provides  and
              filelists just like the "install" command.


The dnf manpage doesn't say either way.  Maybe the dnf maintainers will know what happens under the covers here.  Either way, I'm not sure there's anything else the kernel package can do in this case.

Comment 2 Panu Matilainen 2014-10-15 08:05:10 UTC
This is one foot in rpm and the other in dnf/yum land:

If kernel %post(trans) does not force overwrite of pre-existing initramfs then it depends on execution of %preun, and that depends on the combination of rpm and yum/dnf used.

With rpm < 4.12 the "reinstall" offered by yum and dnf with older rpm versions is largely just "lay all files on disk again" operation", there's no erasure element involved and so %preun will not run.

Rpm >= 4.12 (in F21) supports an actual reinstall operation where erasure also takes place. AFAIK yum doesn't support that in any version, but dnf in F21 does.

So to summarize where it works and where it doesn't:
F20, rpm + yum : no
F20, rpm + dnf : no
F21, rpm + yum : no
F21, rpm + dnf : yes

There are no plans to backport the reinstall mode to older rpm versions so F20 will remain this way. I dont know if there are plans to add support for rpm's reinstall to yum at this point, but then since it explicitly says reinstall doesn't work for installonly packages...

Comment 3 Honza Silhan 2014-10-16 11:54:28 UTC
christian, would you mind telling us your dnf and rpm version installed, please?

Comment 4 Christian Stadelmann 2014-10-16 18:30:57 UTC
Sorry, I forgot.
dnf 0.6.2-1.fc21
rpm 4.12.0.1-2.fc21
both from F21 Alpha, obviously. So it doesn't work as Panu Matilainen expected.

Comment 5 Panu Matilainen 2014-11-26 14:01:40 UTC
Does it work with plain rpm (rpm --reinstall kernel*.rpm)? I seem to recall actually testing this but no way to be sure...

Comment 6 Christian Stadelmann 2015-02-11 14:58:33 UTC
No. Reinstalling kernel does not regenerate initramfs. rpm+dnf --reinstall does not regenerate initramfs either.

Comment 7 Honza Silhan 2015-07-20 11:26:30 UTC
reassigning to kernel as DNF can't do much about %post scriplets. Try it with regular rpm, if it works, please.

Comment 8 Josh Boyer 2015-07-20 12:15:56 UTC
As I already said, this isn't a kernel problem.

Comment 9 Fedora End Of Life 2015-11-04 10:19:48 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 10 Ľuboš Kardoš 2016-01-25 15:32:02 UTC
Package kernel doesn't own initramfs:

# rpm -qf /boot/initramfs-4.3.3-301.fc23.x86_64.img 
kernel-core-4.3.3-301.fc23.x86_64

Reinstallation of package kernel-core regenerates ramdisk (modify time changed):

[root@localhost ~]# ls -l /boot/initramfs-4.3.3-301.fc23.x86_64.img 
-rw-------. 1 root root 18848784 Jan 25 16:27 /boot/initramfs-4.3.3-301.fc23.x86_64.img
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# rpm --reinstall -vh  kernel-core-4.3.3-301.fc23.x86_64.rpm 
Preparing...                          ################################# [100%]
Updating / installing...
   1:kernel-core-4.3.3-301.fc23       ################################# [ 50%]
Cleaning up / removing...
   2:kernel-core-4.3.3-301.fc23       ################################# [100%]
[root@localhost ~]# 
[root@localhost ~]# 
[root@localhost ~]# ls -l /boot/initramfs-4.3.3-301.fc23.x86_64.img 
-rw-------. 1 root root 18847863 Jan 25 16:29 /boot/initramfs-4.3.3-301.fc23.x86_64.img


So closing as not a bug.


Note You need to log in before you can comment on or make changes to this bug.