[yocto] Removing busybox completely from the generated image

Iván Castell icastell at nayarsystems.com
Wed Feb 21 00:14:15 PST 2018


2018-02-21 4:01 GMT+01:00 Paul Eggleton <paul.eggleton at linux.intel.com>:

> On Tuesday, 20 February 2018 9:26:49 PM NZDT Iván Castell wrote:
> > 2018-02-20 7:45 GMT+01:00 Martin Hundebøll <mnhu at prevas.dk>:
> > >> Thank you for the information, I will take into account that tool for
> > >> future embedded projects. However, the focus of this issue was to
> remove
> > >> completely busybox from the image, not replacing it by another
> > >> application box.
> > >>
> > >> I have created a bbappend with a fragment of the busybox configuration
> > >> disabling syslog and udhcpc applets. It works. However the busybox
> binary
> > >> and a lot of applets are still there (adduser, unzip, fbset,
> traceroute,
> > >> and more).
> > >>
> > >> Disabling all different applets and installing native tools instead
> could
> > >> be the right way to procede. Not a nice solution, but at least it
> should
> > >> work...
> > >>
> > >
> > > Here's what we have in our distro config to disable busybox:
> > >
> > > > # Disable busybox
> > > > VIRTUAL-RUNTIME_base-utils = ""
> > > > ALTERNATIVE_PRIORITY_pn-busybox = "1"
> > >
> > > The priority setting make bitbake pull in alternatives from util-linux
> /
> > > coreutils when appropriate.
> >
> > Yes!! That was the trick. It works like a charm!! Thank you so much Mr.
> > Martin!! :-)
>
> I will note that the priority currently set in busybox.inc is 50, which is
> lower than coreutils 100 (or 90 for hostname), so that part shouldn't be
> needed for coreutils. There are one or two other recipes that set a
> priority
> lower than 50 for reasons that are not immediately clear to me.
>
> Additionally, ALTERNATIVE_PRIORITY won't do anything to control what goes
> into
> the image - it only controls which binary is selected at runtime when more
> than one providing the same binary is installed. Thus I can only assume
> that
> it was the VIRTUAL-RUNTIME_base-utils = "" that finally removed the
> packages
> you wished removed.
>
> Cheers,
> Paul
>


I have tested your suggestion, disabling the ALTERNATIVE_PRIORITY
declaration:

    VIRTUAL-RUNTIME_base-utils = ""
    # ALTERNATIVE_PRIORITY =

And effectively the generated image contains any reference to busybox
toolbox at all. Thank you very much for the clarification, Mr Paul!! :-)

I want to add that, if your custom image installs packagegroup-core-boot,
then you also need to set VIRTUAL-RUNTIME_login_manager variable with a
valid value different from "busybox". My custom image includes that
packagegroup, so to achieve my goal, I define in my distro.conf this
variable:

    VIRTUAL-RUNTIME_login_manager = "shadow"

Hope this helps to somebody else.

Thank you for all your support! :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20180221/acfe9b9d/attachment.html>


More information about the yocto mailing list