2021-07-07
The initramfs for old kernels can hide old versions of things
In a recent entry, I more or less blamed a new minor Linux kernel version for changing the naming of my network interface. I had reasonable reasons to say this beyond just rebooting into 5.12.12 and having the problem appear; I also rebooted back into 5.12.11 and the problem disappeared again (I ended up going back and forth repeatedly and this was consistent). When the only changing thing is the kernel version, you can reasonably suspect it, instead of (say) an upgrade to udev that you also installed between the two kernels. However, I'm not so sure of that any more.
I'm running Fedora on this desktop, and Fedora normally doesn't rebuild the initramfs for existing kernels when you upgrade packages and install new kernels. This means that when I boot my Fedora 5.12.11, I'm not merely running that kernel, I'm running an initramfs with programs and configuration files that were frozen when that kernel was installed. If there was a udev update that changed its early boot behavior, that update isn't in the 5.12.11 initramfs. Although I thought I only changed the kernel version by booting back and forth between 5.12.11 and 5.12.12, I was also changing the versions of what ran during early boot, possibly as well as configuration files they used. This may well have fooled me about what the cause of my problem was.
(I know, I once said Fedora rebuilt the initramfs for all of your kernels when you installed new DKMS modules. Apparently I was wrong about that, and was seeing something else.)
In short, what looks like an issue in the new kernel may actually be a change in the new initramfs that you get along with the new kernel. It's hard to tell for sure, although you can try rebuilding the initramfs for an older kernel if you can work out how to do this correctly. Of course, if you do rebuild an initramfs for an old kernel to see if it's really the kernel that's at fault, you definitely want to save a copy of your working old initramfs.
(I've seen this before for configuration files, for example when Fedora embedded my current sysctl settings in the initramfs.)
Despite potentially causing issues, not rebuilding is quite sensible. Generally you want to preserve old working initramfses the way they are just as you want to preserve old kernels (certainly I did in this case, since my 5.12.11 environment kept working). People also want to do less work on package upgrades, and not rebuilding four or five initramfses is much less work than doing so.