OpenWrt/LEDE Project

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Critical
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by howl - 21.08.2020

FS#3299 - busybox: Alternatives gets overwrited when busybox updates

This is device independent and I think it affects all versions but I have seen this over 19.07. If you have binary programs that conflicts with busybox ones, opkg sets them to be used instead when they are installed.

I discovered this because mwan3 got broke and investigating the error it dropped the problems seems to be that the ip binary from busybox doesn’t support some features mwan3 needs. I could find that I had ip installed as is a dependency of mwan3 so I just remembered that busybox was updated recently.

Just by reinstalling ip the issue was solved.

I don’t know how this could be managed, perhaps just when a package that has alternatives is installed update them and when the package is being upgraded ignore updating the alternatives.

I set this critical just because it could be very difficult to see where the problem is for many people (I surprised myself how it could take so many time to advert the real issue when I found it, it’s simple, but if you don’t notice busybox upgrading could be cumbersome to see), and, this could break things, like for example mwan3 or any other program that rely using alternative binaries and not the busybox ones. Of course fell free to set the severity you think could be more accurate.

Admin
Jo-Philipp Wich commented on 21.08.2020 21:53

Well either a package is an alternative for another or it is not. If mwan3 really needs functionality not provided by busybox IP, it should not depend on the abstract `ip` but on something like `ip-full` instead.

Hannu Nyman commented on 23.08.2020 10:46
If mwan3 really needs functionality not provided by busybox IP, it should not depend on the abstract `ip` but on something like `ip-full` instead.

Note that that argument about "ip" may partially be a fallout of the (three years old) change, where busybox started to provide "ip". Earlier "ip" provide was just for ip-tiny, ip-full, but not busybox.

In the forum discussion also "sort" and adblock has been mentioned as problematic. So the problem is not related just to "ip" app.

As far as I understand, the "alternatives" provides a precedence definition mechanism, which should lead to the more preferred app getting precendence.

Possibly there is bad handling of "alternatives" precedence with "opkg upgrade" (which command I dislike in any case...).

I feel that trying to provide full "upgrade anything" capability is contrdictory to the aim of keeping OpenWrt and opkg simple, but sadly there seems to be more and more people who try to upgrade anything. (Busybox is roughly the most dangerous item to be upgraded, as it is so core.)

One possible generic solution might be the busybox build config option "always install to /sbin, /bin and avoid /usr". That should keep the busybox stuff late on the path, preventing their usage if there is a better app typically in /usr, earlier in the path.

https://github.com/openwrt/openwrt/blob/master/package/utils/busybox/config/Config.in#L194

config BUSYBOX_CONFIG_INSTALL_NO_USR
	bool "Don't use /usr"
	default BUSYBOX_DEFAULT_INSTALL_NO_USR
	help
	Disable use of /usr. "busybox --install" and "make install"
	will install applets only to /bin and /sbin,
	never to /usr/bin or /usr/sbin.

I wonder if that has ever been evaluated by OpenWrt?

Brian J. Murrell commented on 24.08.2020 14:20

I don't think $PATH location for alternatives is a good solution. People might have perfectly valid reasons for preferring one */bin* directory over another.

What I am failing to understand is why this problem is even happening with ALTERNATIVES:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/utils/busybox/Makefile;h=62af99d3ae15f4b2aca76111124fc114fdee2b7b;hb=HEAD#l51 https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/network/utils/iproute2/Makefile;h=1c8e3e66d6174d1da78d82dc19aa6ec72acbb073;hb=HEAD#l40 https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/network/utils/iproute2/Makefile;h=1c8e3e66d6174d1da78d82dc19aa6ec72acbb073;hb=HEAD#l49

[links from #1895 where this was explained to me previously]

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing