Bug 13850 - opkg upgrade of busybox fails
Summary: opkg upgrade of busybox fails
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 2.6.4
Hardware: All Multiple
: Medium major
Target Milestone: 3.2
Assignee: Jeremy A. Puhlman
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2020-04-02 10:24 UTC by Mikael Pahmp
Modified: 2020-11-26 15:49 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikael Pahmp 2020-04-02 10:24:05 UTC
Preconditions/Environment
-------------------------
busybox installed on target and no other provider of /bin/sh.
Package management enabled using ipk/opkg.

Triggering Action/Cause
-----------------------
Install new version of busybox using "opkg install" or reinstall same version using "opkg install --force-reinstall".

Expectation
-----------
Succeeds.

Actual Result
-------------
The busybox prerm script right after:
    update-alternatives: removing /bin/sh as no more alternatives exist for fails with error:
    ///var/lib/opkg/info/busybox.prerm: line 62: update-alternatives: not found


Reproducibility
---------------
Every time


Observations
-----------
The prerm script first sets up links for a number of commands (e.g. sh, sed, ln) in a temporary directory and adds that directory to PATH. Hence, the update-alternatives can still function when those commands are removed. But when /bin/sh is removed, update-alternatives can't be invoked because it has the she-bang "#!/bin/sh", i.e. the loader will look for /bin/sh, it won't look on PATH.
Comment 1 Jeremy A. Puhlman 2020-04-03 04:28:07 UTC
Initial fix for master.

https://patchwork.openembedded.org/patch/171546/
Comment 3 Randy MacLeod 2020-04-15 18:52:37 UTC
Fixed in master and dunfell in:
https://git.openembedded.org/openembedded-core/commit/a9d2af8f5b3da8239cf00a52883ca596a19ea23a

so a 3.2 milestone makes sense I guess.
Comment 4 Randy MacLeod 2020-04-15 19:01:21 UTC
This is odd, the link I just added is the right commit ID but when I open a tab to follow the link, I see a commit with the short log:
   build-appliance-image: Update to master head revision
Jeremy, Did I provide the wrong link or do you know what's wrong here?
I guess I should stop trying to 'help'! ;-)
Comment 5 Jeremy A. Puhlman 2020-04-15 19:04:44 UTC
(In reply to comment #4)
> This is odd, the link I just added is the right commit ID but when I open a
> tab to follow the link, I see a commit with the short log:
>    build-appliance-image: Update to master head revision
> Jeremy, Did I provide the wrong link or do you know what's wrong here?
> I guess I should stop trying to 'help'! ;-)

Yeah I didn't know what the right move here was. The specific bug was for 2.6, and there was a fix submitted for master/dunfell, zeus, warrior and thud, but it was accepted for master/dunfell, it is/was in the queue or zeus, but I haven't seen any responce on warrior and thud. Its fixed in master, but waiting on the one it was filed against.
Comment 6 Richard Purdie 2020-11-26 15:49:00 UTC
Fixed in master and dunfell and zeus/thud/warrior are out of maintenance at this point.