Bug 11826

Summary: [internalsolv] OPKG doesn't install new dependent packages of a package upgrade
Product: [Yocto Project Subprojects] opkg Reporter: Damien Gotfroi <dgotfroi>
Component: opkgAssignee: Alejandro del Castillo <alejandro.delcastillo>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Undecided    
Version: 0.3.5   
Target Milestone: 0.3.6   
Hardware: BeagleBone   
OS: arm   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Damien Gotfroi 2017-07-24 12:13:33 UTC
I have a bug during kernel upgrade with opkg 0.3.5 (I don't have this problem with opkg 0.3.4).

I want to upgrade kernel from kernel 4.1.30 to kernel 4.4.36.

So, in my opkg repository, kernel depends on kernel-4.4.36 and kernel-4.4.36 depends on kernel-image-4.4.36.

opkg info of kernel : 
Package: kernel
 Version: 4.4.36-r1
 Description: linux-beagleboard version 4.4.36-r1
  Linux kernel
 Section: kernel
 Priority: optional
 Maintainer: Angstrom Developers <angstrom-distro-devel@linuxtogo.org>
 License: GPLv2
 Architecture: beaglebone
 OE: linux-beagleboard
 Depends: kernel-4.4.36, kernel-image-4.4.36
 Source: linux-beagleboard_4.4.bb


opkg info of kernel-4.4.36 :
Package: kernel-4.4.36
 Version: 4.4.36-r1
 Description: linux-beagleboard version 4.4.36-r1
  Linux kernel
 Section: kernel
 Priority: optional
 Maintainer: Angstrom Developers <angstrom-distro-devel@linuxtogo.org>
 License: GPLv2
 Architecture: beaglebone
 OE: linux-beagleboard
 Depends: kernel-image-4.4.36
 Provides: kernel-4.4.36, kernel-base
 Source: linux-beagleboard_4.4.bb


opkg info of kernel-image-4.4.36 :
Package: kernel-image-4.4.36
 Version: 4.4.36-r1
 Description: linux-beagleboard version 4.4.36-r1
  Linux kernel
 Section: kernel
 Priority: optional
 Maintainer: Angstrom Developers <angstrom-distro-devel@linuxtogo.org>
 License: GPLv2
 Architecture: beaglebone
 OE: linux-beagleboard
 Depends: kernel-devicetree
 Provides: kernel-image
 Source: linux-beagleboard_4.4.bb

Kernel-devicetree is well upgraded from v4.1.30 to v4.4.36 whitout any error.

when I run upgrade, Opkg well upgrade kernel_4.1.30 to kernel_4.4.36.
It well upgrade kernel-4.1.30_4.1.30 to kernel-4.4.36_4.4.36.

But when It must upgrade kernel-image-4.4.36, it does nothing.

If I set verbose to level 3, I can see the following :

pkg_hash_fetch_best_installation_candidate: Best installation candidate for kernel-image-4.4.36:
pkg_hash_fetch_best_installation_candidate: Adding kernel-image-4.4.36 to providers.
pkg_hash_fetch_best_installation_candidate: Not selecting kernel-image-4.4.36 4.4.36 due to unmatched constraint.
pkg_hash_fetch_unsatisfied_dependencies: satisfying_pkg=(nil)
pkg_hash_fetch_best_installation_candidate: Best installation candidate for kernel-image-4.4.36:
pkg_hash_fetch_best_installation_candidate: Adding kernel-image-4.4.36 to providers.
pkg_hash_fetch_best_installation_candidate: kernel-image-4.4.36 arch=beaglebone arch_priority=66 version=4.4.36.
pkg_hash_fetch_best_installation_candidate: Candidate: kernel-image-4.4.36 4.4.36.
pkg_hash_fetch_unsatisfied_dependencies: satisfying_pkg=0x1958658
pkg_hash_fetch_best_installation_candidate: Best installation candidate for kernel-devicetree:
pkg_hash_fetch_best_installation_candidate: Adding kernel-devicetree to providers.
pkg_hash_fetch_best_installation_candidate: kernel-devicetree arch=beaglebone arch_priority=66 version=4.4.36.
pkg_hash_fetch_best_installation_candidate: Candidate: kernel-devicetree 4.4.36.
pkg_hash_fetch_unsatisfied_dependencies: satisfying_pkg=0x1ab3a70
pkg_hash_fetch_best_installation_candidate: Best installation candidate for kernel-image-4.4.36:
pkg_hash_fetch_best_installation_candidate: Adding kernel-image-4.4.36 to providers.
pkg_hash_fetch_best_installation_candidate: Not selecting kernel-image-4.4.36 4.4.36 due to unmatched constraint.
pkg_hash_fetch_unsatisfied_dependencies: satisfying_pkg=(nil)
pkg_hash_fetch_best_installation_candidate: Best installation candidate for kernel-image-4.4.36:
pkg_hash_fetch_best_installation_candidate: Adding kernel-image-4.4.36 to providers.
pkg_hash_fetch_best_installation_candidate: kernel-image-4.4.36 arch=beaglebone arch_priority=66 version=4.4.36.
pkg_hash_fetch_best_installation_candidate: Candidate: kernel-image-4.4.36 4.4.36.
pkg_hash_fetch_unsatisfied_dependencies: satisfying_pkg=0x1958658
pkg_hash_fetch_best_installation_candidate: Best installation candidate for kernel-image-4.4.36:
pkg_hash_fetch_best_installation_candidate: Adding kernel-image-4.4.36 to providers.
pkg_hash_fetch_best_installation_candidate: kernel-image-4.4.36 arch=beaglebone arch_priority=66 version=4.4.36.
pkg_hash_fetch_best_installation_candidate: Candidate: kernel-image-4.4.36 4.4.36.
...
opkg_recurse_pkgs_in_order: Descending on pkg kernel-image-4.4.36.
opkg_recurse_pkgs_in_order: pkg kernel-image-4.1.30.
opkg_recurse_pkgs_in_order: Descending on pkg kernel-image-4.1.30.
opkg_recurse_pkgs_in_order: pkg kernel-image-4.1.30 already visited, skipping.


Kernel-image-4.1.30 info is :
Package: kernel-image-4.1.30
 Version: 4.1.30-r8
 Description: linux-beagleboard version 4.1.30-r8
  Linux kernel
 Section: kernel
 Priority: optional
 Maintainer: Angstrom Developers <angstrom-distro-devel@linuxtogo.org>
 License: GPLv2
 Architecture: beaglebone
 OE: linux-beagleboard
 Depends: kernel-devicetree
 Recommends: kernel-devicetree-overlays
 Provides: kernel-image
 Source: linux-beagleboard_4.1.bb


Expected output :
Kernel v4.4.36, kernel-4.4.36 v4.4.36 and kernel-image-4.4.36 v4.4.36 installed.
Kernel v4.1.30, kernel-4.1.30 v4.1.30 and kernel-image-4.1.30 v4.1.30 removed.

Actual output :
Kernel v4.4.36 and kernel-4.4.36 v4.4.36 installed and kernel-image-4.4.36 v4.4.36 NOT installed.
Kernel v4.1.30, kernel-4.1.30 v4.1.30 and kernel-image-4.1.30 v4.1.30 still installed because of kernel-image-4.1.30 dependencies.
Comment 1 Alejandro del Castillo 2017-07-25 20:47:13 UTC
Just tried it using the libsolv backend, where it worked:

adelcast@delcastillo2 ~/git/opkg/tests $ opkg -o /tmp/opkg list-installed
kernel - 4.4.10
kernel-4.4.10 - 4.4.10
kernel-image-4.4.10 - 4.4.10

adelcast@delcastillo2 ~/git/opkg/tests $ opkg -o /tmp/opkg upgrade
Installing kernel-image-4.4.36 (4.4.36) on root
Downloading file:/tmp/opk/kernel-image-4.4.36_4.4.36_all.opk.
Installing kernel-4.4.36 (4.4.36) on root
Downloading file:/tmp/opk/kernel-4.4.36_4.4.36_all.opk.
Upgrading kernel from 4.4.10 to 4.4.36 on root
Downloading file:/tmp/opk/kernel_4.4.36_all.opk.

adelcast@delcastillo2 ~/git/opkg/tests $ opkg -o /tmp/opkg list-installed
kernel - 4.4.36
kernel-4.4.10 - 4.4.10
kernel-4.4.36 - 4.4.36
kernel-image-4.4.10 - 4.4.10
kernel-image-4.4.36 - 4.4.36

since there is no replace/conflicts/provides relationship between kernel-4.4.10 & kernel-4.4.36 and between kernel-image-4.4.10 & kernel-image-4.4.36, the end result keeps both version on the system at the same time (which from the solver perspective is the correct result). I tried 0.3.4 with the internal solver and got the same result, so this is a regression from 0.3.4 for the internal solver.
Comment 2 Alejandro del Castillo 2017-07-31 15:33:21 UTC
fixed on 5a6075566a7035c210a85c5b360a54538790caf6
Comment 3 Alejandro del Castillo 2017-09-16 20:01:19 UTC
Already fixed