Modify

Opened 2 years ago

Last modified 20 months ago

#21344 new defect

PROVIDES doesn't work for opkg for ImageBuilder

Reported by: openwrt@… Owned by: developers
Priority: normal Milestone:
Component: packages Version: Chaos Calmer 15.05
Keywords: Cc:

Description

E.g. Despite PROVIDES:=avahi-daemon on both avahi-dbus-daemon and avahi-nodbus-daemon, if you use ImageBuilder with

PACKAGES="avahi-nodbus-daemon avahi-daemon-service-ssh",

the ImageBuilder will still install

avahi-dbus-daemon and dbus in addition to avahi-nodbus-daemon.

It appears that at least when use with ImageBuilder, opkg picks the first package that matches a PROVIDES and doesn't pay attention to that fact that another package providing the the PROVIDES has already been installed.

Attachments (0)

Change History (4)

comment:1 Changed 22 months ago by openwrt@…

Ok debugged further, the exact scenario in which it occurs is a package when depends on an abstract package from a PROVIDES and also depends another package which also depends on the same abstract package from a PROVIDES.

Attempting to decipher the awful opkg code to fix this (friendly-ish names is insufficient to make friendly/maintainable code).

comment:2 Changed 22 months ago by openwrt@…

Ok, the problem is not actually with opkg per se (whose code is not so bad once you buckle down and read it), but with the ImageBuilder makefile destroying the order of install.

That is, for a PROVIDES to not install the last found provider, another provider must already be installed (e.g. be earlier in the opkg command line). The recent changes created for the purpose of reproducible builds broke that. Specifically on line 111 of target/imagebuild/files/Makefile, there is:
BUILD_PACKAGES:=$(sort $(DEFAULT_PACKAGES) $(USER_PACKAGES) $($(USER_PROFILE)_PACKAGES) kernel)

In order to allow the user to specify a different provider than the one that opkg will select by default, it is necessary to preserve the order of user supplied packages, for example by doing:

BUILD_PACKAGES:=$(USER_PACKAGES) $(sort $(DEFAULT_PACKAGES) $(foreach profile,$(PROFILES_BUILD),$($(profile)_PACKAGES)) kernel)

Since it is quite easy for the user to ensure they always supply the packages in the same order, if the user cares about reproducible builds they can still make sure that they get them.

Also, it seems that creating a package that DEPENDS on a non-default provider first (and it can't be select because that will produce a recursive dependency warning) does NOT work, I suspect because in that case the non-default provider is not already installed before the package that depends on a PROVIDES and opkg only detects already installed providers as satistfying the provides, not to be installed packages.

comment:3 Changed 22 months ago by anonymous

Note, this ticket was created before DD tag was available, issues occurs in DD, not actually sure about CC.

comment:4 Changed 20 months ago by openwrt@…

A workaround for IB has been pushed in the LEDE tree, not sure about OpenWrt. (the above-mentioned solution), however this doesn't solve the problem for images built straight from buildroot.

It has been proposed that updating opkg what solve the issue, however, Jow points out in https://lists.openwrt.org/pipermail/openwrt-devel/2016-April/040899.html that new upstream (Yocto) has made unmodified opkg too large for OpenWrt use.

Add Comment

Modify Ticket

Action
as new .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.