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
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.
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...
christian, would you mind telling us your dnf and rpm version installed, please?
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.
Does it work with plain rpm (rpm --reinstall kernel*.rpm)? I seem to recall actually testing this but no way to be sure...
No. Reinstalling kernel does not regenerate initramfs. rpm+dnf --reinstall does not regenerate initramfs either.
reassigning to kernel as DNF can't do much about %post scriplets. Try it with regular rpm, if it works, please.
As I already said, this isn't a kernel problem.
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.
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.