Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#3363 - opkg kmod selection failure #8293

Closed
openwrt-bot opened this issue Sep 26, 2020 · 4 comments
Closed

FS#3363 - opkg kmod selection failure #8293

openwrt-bot opened this issue Sep 26, 2020 · 4 comments
Labels

Comments

@openwrt-bot
Copy link

aparcar0:

The snapshot builds frequently change Kernel versions which breaks compatibility with kmods from /target/subtarget/packages. For this reason the /target/subtarget/kmods archive was introduced, allowing running machines to select not only the latest, but also a compatible kmod.

Currently the builbot adds the kmod archive [[https://git.openwrt.org/?p=buildbot.git;a=blob;f=phase1/master.cfg;h=792f9b3a55a2d8ebae1917c56716cc0d699f9172;hb=HEAD#l903|here]], later on like directly in the buildsystem via [[https://github.com//pull/3425|this commit]].

The PR above brought up the issue that OPKG selects wrong Kernel versions, even if the kmod feeds contains a compatible version. Looking at the OPKG code it seems that [[https://git.openwrt.org/?p=project/opkg-lede.git;a=blob;f=libopkg/pkg_hash.c;h=52c64ff137ba49f38d7bc31d0601f3037ad8a10d;hb=HEAD#l410|this function]] simply compares package names and considers them as matching. The responded package is [[https://git.openwrt.org/?p=project/opkg-lede.git;a=blob;f=libopkg/opkg.c;h=3583488780221b6fc566aa3b39ce378950a0503b;hb=HEAD#l225|returned to opkg.c]] just then checked for [[https://git.openwrt.org/?p=project/opkg-lede.git;a=blob;f=libopkg/opkg.c;h=3583488780221b6fc566aa3b39ce378950a0503b;hb=HEAD#l241|unsatisfied_dependencies]]. As the function only receives a single package it can't evaluate any alternatives.

A possible solution could be to kick out problematic packages (aka unfitting kmods) earlier, e.g. by not adding them to the list of matching packages after all. This happens [[https://git.openwrt.org/?p=project/opkg-lede.git;a=blob;f=libopkg/pkg_hash.c;h=52c64ff137ba49f38d7bc31d0601f3037ad8a10d;hb=HEAD#l366|here]]. We could run pkg_hash_fetch_unsatisfied_dependencies on each match skip adding it to matching_pkgs.

I tried for a while to implement that, but failed. By adding the extra check it effectively skipped dependency checks allowing to install completely incompatible packages. I'd therefore be very happy if someone with more C experience could look into that.

@openwrt-bot
Copy link
Author

aparcar0:

The related OPKG log when using --verbosity=4

pkg_hash_fetch_best_installation_candidate: Best installation candidate for kmod-tun: pkg_hash_fetch_best_installation_candidate: Adding kmod-tun to providers. pkg_hash_fetch_best_installation_candidate: kmod-tun arch=x86_64 arch_priority=10 version=5.4.67. pkg_hash_fetch_best_installation_candidate: kmod-tun arch=x86_64 arch_priority=10 version=5.4.63. pkg_hash_fetch_best_installation_candidate: Candidate: kmod-tun 5.4.63. pkg_hash_fetch_best_installation_candidate: Candidate: kmod-tun 5.4.67. pkg_hash_fetch_best_installation_candidate: 2 matching pkgs for apkg=kmod-tun: pkg_hash_fetch_best_installation_candidate: kmod-tun 5.4.63 x86_64 pkg_hash_fetch_best_installation_candidate: kmod-tun 5.4.67 x86_64 pkg_arch_supported: Arch x86_64 (priority 10) supported for pkg kmod-tun. Installing kmod-tun (5.4.67-1) to root... Downloading https://downloads.openwrt.org/snapshots/targets/x86/64/packages/kmod-tun_5.4.67-1_x86_64.ipk pkg_hash_fetch_best_installation_candidate: Best installation candidate for kernel: pkg_hash_fetch_best_installation_candidate: Adding kernel to providers. pkg_hash_fetch_best_installation_candidate: kernel arch=x86_64 arch_priority=10 version=5.4.63-1. pkg_hash_fetch_best_installation_candidate: Using latest version of installed package kernel. pkg_hash_fetch_unsatisfied_dependencies: satisfying_pkg=0 pkg_hash_fetch_best_installation_candidate: Best installation candidate for kernel: pkg_hash_fetch_best_installation_candidate: Adding kernel to providers. pkg_hash_fetch_best_installation_candidate: kernel arch=x86_64 arch_priority=10 version=5.4.63-1. pkg_hash_fetch_best_installation_candidate: Using latest version of installed package kernel. pkg_hash_fetch_unsatisfied_dependencies: satisfying_pkg=0 satisfy_dependencies_for: This could mean that your package list is out of date or that the packages mentioned above do not yet exist (try 'opkg update'). To proceed in spite of this problem try again with the '-force-depends' option.

@openwrt-bot
Copy link
Author

aparcar0:

A possible fix is suggest here #3425

@openwrt-bot
Copy link
Author

dangowrt:

I guess this should be closed now...?

@openwrt-bot
Copy link
Author

aparcar0:

Please close it. I can only request to close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant