Bug 13213

Summary: kernel.bbclass creates softlink in do_install which breaks kernel upgrades
Product: [Runtime] Package Management Issues Reporter: Jaewon Lee <jaewon>
Component: RPMAssignee: Jaewon Lee <jaewon>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: mark.hatle, randy.macleod
Version: 2.6.1   
Target Milestone: 2.8 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Jaewon Lee 2019-03-01 00:25:45 UTC
kernel.bbclass has the following lines which creates a softlink for the image being deployed. (For example it's creating a softlink /boot/Image)

Because this is now part of the rpm, this fails during dnf upgrade as both the new and old kernel packages will try to install /boot/Image


steps to reproduce: 
boot board then upgrade kernel version, build, do a dnf upgrade by pointing to newly generated rpms.  dnf upgrade will fail with error complaining about two packages providing the same file.
Comment 1 Mark Hatle 2019-03-07 17:37:09 UTC
Why should it matter if there is a link present.  Typically when you upgrade you REPLACE the old kernel with a new one.  If this is not happening with a specific upgrade situation -- then we may want to investigate why it is so.

The key here is that either we need to support multiple kernels being loaded at the same time, or the package manager usage should be updating them like any other package on the system.

Understanding the way you are calling the tools and the results you are getting will better explain if what we are seeing is correct or not.

I do know, a common misunderstanding is when someone runs:

rpm -i <package>

-i says -INSTALL- a new version of the package (not upgrade), this will result in two versions being installed at once, and usually fails in a way like you described.

-U is supposed to be used for all upgrades and will remove the older version(s) as part of installing the new one.
Comment 2 Jaewon Lee 2019-03-25 16:50:54 UTC
The issue is because the link is created at build time and so each kernel package has /boot/Image and theres is a conflict error when running 'dnf upgrade'

Fix would be to put the soft link in a postinstall script, will send a rfc patch soon
Comment 3 Jaewon Lee 2019-04-05 22:24:53 UTC
Working with Bruce on this