All of lore.kernel.org
 help / color / mirror / Atom feed
* Removing busybox completely from the generated image
@ 2018-02-16 15:56 Iván Castell
  2018-02-19  8:35 ` Iván Castell
  0 siblings, 1 reply; 11+ messages in thread
From: Iván Castell @ 2018-02-16 15:56 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 930 bytes --]

Hello forum!

I'm trying to build a yocto image without busybox and without any busybox
applet deployed.

I have tried that configuring my distro.conf file in this way:

    DISTRO_FEATURES_remove = " busybox"
    VIRTUAL-RUNTIME_base-utils = ""
    PREFERRED_PROVIDER_virtual/base-utils = ""

Nonetheless, busybox binary and two related applets (syslog and udhcpc) are
installed in the generated image:

    $ rpm -qa | grep busybox
    busybox-syslog-1.24.1-r0.corei7_64
    busybox-1.24.1-r0.corei7_64
    busybox-udhcpc-1.24.1-r0.corei7_64

I have tried disabling syslog applet appending to my distro.conf file:

    VIRTUAL-RUNTIME_syslog ?= ""

But syslogd applet is still installed:

    # ls -l /sbin/syslogd
    lrwxrwxrwx 1 root root 19 Feb 15 14:03 /sbin/syslogd ->
/bin/busybox.nosuid

Is there some way to remove busybox completely from the generated image?

Thank you in advance! :-)

[-- Attachment #2: Type: text/html, Size: 1802 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Removing busybox completely from the generated image
  2018-02-16 15:56 Removing busybox completely from the generated image Iván Castell
@ 2018-02-19  8:35 ` Iván Castell
  2018-02-19 10:17   ` Khem Raj
  2018-02-19 10:21   ` Alexander Kanavin
  0 siblings, 2 replies; 11+ messages in thread
From: Iván Castell @ 2018-02-19  8:35 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1792 bytes --]

I have tried breaking apart packagegroup-core-boot, making a copy in my
custom layer, removing the line referencing busybox:

    ## VIRTUAL-RUNTIME_login_manager ?= "busybox"

But now bitbake complains with an error message:

    ERROR: Nothing RPROVIDES '${VIRTUAL-RUNTIME_login_manager}'

It seems "VIRTUAL-RUNTIME_login_manager" needs to be defined with a valid
option. I have tested with the option "tinylogin" but that options seems
not implemented in "rocko" branch, because I'm getting this error:

    ERROR: Nothing RPROVIDES 'tinylogin'

Is there some valid alternative available? Where are these alternatives
defined?

In general, is it posible to build yocto images without using busybox at
all?


2018-02-16 16:56 GMT+01:00 Iván Castell <icastell@nayarsystems.com>:

> Hello forum!
>
> I'm trying to build a yocto image without busybox and without any busybox
> applet deployed.
>
> I have tried that configuring my distro.conf file in this way:
>
>     DISTRO_FEATURES_remove = " busybox"
>     VIRTUAL-RUNTIME_base-utils = ""
>     PREFERRED_PROVIDER_virtual/base-utils = ""
>
> Nonetheless, busybox binary and two related applets (syslog and udhcpc)
> are installed in the generated image:
>
>     $ rpm -qa | grep busybox
>     busybox-syslog-1.24.1-r0.corei7_64
>     busybox-1.24.1-r0.corei7_64
>     busybox-udhcpc-1.24.1-r0.corei7_64
>
> I have tried disabling syslog applet appending to my distro.conf file:
>
>     VIRTUAL-RUNTIME_syslog ?= ""
>
> But syslogd applet is still installed:
>
>     # ls -l /sbin/syslogd
>     lrwxrwxrwx 1 root root 19 Feb 15 14:03 /sbin/syslogd ->
> /bin/busybox.nosuid
>
> Is there some way to remove busybox completely from the generated image?
>
> Thank you in advance! :-)
>

[-- Attachment #2: Type: text/html, Size: 15843 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Removing busybox completely from the generated image
  2018-02-19  8:35 ` Iván Castell
@ 2018-02-19 10:17   ` Khem Raj
  2018-02-19 15:18     ` Maxin B. John
  2018-02-19 10:21   ` Alexander Kanavin
  1 sibling, 1 reply; 11+ messages in thread
From: Khem Raj @ 2018-02-19 10:17 UTC (permalink / raw)
  To: Iván Castell; +Cc: Yocto Project

On Mon, Feb 19, 2018 at 12:35 AM, Iván Castell
<icastell@nayarsystems.com> wrote:
> I have tried breaking apart packagegroup-core-boot, making a copy in my
> custom layer, removing the line referencing busybox:
>
>     ## VIRTUAL-RUNTIME_login_manager ?= "busybox"
>
> But now bitbake complains with an error message:
>
>     ERROR: Nothing RPROVIDES '${VIRTUAL-RUNTIME_login_manager}'
>
> It seems "VIRTUAL-RUNTIME_login_manager" needs to be defined with a valid
> option. I have tested with the option "tinylogin" but that options seems not
> implemented in "rocko" branch, because I'm getting this error:
>
>     ERROR: Nothing RPROVIDES 'tinylogin'
>
> Is there some valid alternative available? Where are these alternatives
> defined?
>

tinylogin has been removed few releases ago. So it wont work out of box.

> In general, is it posible to build yocto images without using busybox at
> all?
>



>
> 2018-02-16 16:56 GMT+01:00 Iván Castell <icastell@nayarsystems.com>:
>>
>> Hello forum!
>>
>> I'm trying to build a yocto image without busybox and without any busybox
>> applet deployed.
>>
>> I have tried that configuring my distro.conf file in this way:
>>
>>     DISTRO_FEATURES_remove = " busybox"
>>     VIRTUAL-RUNTIME_base-utils = ""
>>     PREFERRED_PROVIDER_virtual/base-utils = ""
>>
>> Nonetheless, busybox binary and two related applets (syslog and udhcpc)
>> are installed in the generated image:
>>
>>     $ rpm -qa | grep busybox
>>     busybox-syslog-1.24.1-r0.corei7_64
>>     busybox-1.24.1-r0.corei7_64
>>     busybox-udhcpc-1.24.1-r0.corei7_64
>>
>> I have tried disabling syslog applet appending to my distro.conf file:
>>
>>     VIRTUAL-RUNTIME_syslog ?= ""
>>
>> But syslogd applet is still installed:
>>
>>     # ls -l /sbin/syslogd
>>     lrwxrwxrwx 1 root root 19 Feb 15 14:03 /sbin/syslogd ->
>> /bin/busybox.nosuid
>>
>> Is there some way to remove busybox completely from the generated image?
>>
>> Thank you in advance! :-)
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Removing busybox completely from the generated image
  2018-02-19  8:35 ` Iván Castell
  2018-02-19 10:17   ` Khem Raj
@ 2018-02-19 10:21   ` Alexander Kanavin
  2018-02-19 20:59     ` Paul Eggleton
  1 sibling, 1 reply; 11+ messages in thread
From: Alexander Kanavin @ 2018-02-19 10:21 UTC (permalink / raw)
  To: Iván Castell, yocto

On 02/19/2018 10:35 AM, Iván Castell wrote:
> I have tried breaking apart packagegroup-core-boot, making a copy in my 
> custom layer, removing the line referencing busybox:
> 
>      ## VIRTUAL-RUNTIME_login_manager ?= "busybox"
> 
> But now bitbake complains with an error message:
> 
>      ERROR: Nothing RPROVIDES '${VIRTUAL-RUNTIME_login_manager}'

You need to remove the reference to VIRTUAL-RUNTIME_login_manager from 
the list of packages to be installed, not the definition that points to 
busybox. If the resulting image breaks, you get to keep the pieces. I'm 
not sure what function busyybox performs here, but oe-core does not have 
an alternative now - you are welcome to provide one.

Alex


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Removing busybox completely from the generated image
  2018-02-19 10:17   ` Khem Raj
@ 2018-02-19 15:18     ` Maxin B. John
  2018-02-19 16:13       ` Iván Castell
  0 siblings, 1 reply; 11+ messages in thread
From: Maxin B. John @ 2018-02-19 15:18 UTC (permalink / raw)
  To: Khem Raj; +Cc: Yocto Project

Hi,

On Mon, Feb 19, 2018 at 02:17:38AM -0800, Khem Raj wrote:
> On Mon, Feb 19, 2018 at 12:35 AM, Iván Castell
> <icastell@nayarsystems.com> wrote:
> > I have tried breaking apart packagegroup-core-boot, making a copy in my
> > custom layer, removing the line referencing busybox:
> >
> >     ## VIRTUAL-RUNTIME_login_manager ?= "busybox"

Have you considered "toybox" ? It probably wouldn't work right-away. Still,
toybox was designed to provide a replacement for busybox. It is available
in "meta-oe"

http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-core/toybox/toybox_0.7.5.bb

> > But now bitbake complains with an error message:
> >
<snip>

Hope this helps,
Maxin


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Removing busybox completely from the generated image
  2018-02-19 15:18     ` Maxin B. John
@ 2018-02-19 16:13       ` Iván Castell
  2018-02-20  6:45         ` Martin Hundebøll
  0 siblings, 1 reply; 11+ messages in thread
From: Iván Castell @ 2018-02-19 16:13 UTC (permalink / raw)
  To: Maxin B. John; +Cc: Yocto Project

[-- Attachment #1: Type: text/plain, Size: 1346 bytes --]

2018-02-19 16:18 GMT+01:00 Maxin B. John <maxin.john@intel.com>:

> Hi,
>
> On Mon, Feb 19, 2018 at 02:17:38AM -0800, Khem Raj wrote:
> > On Mon, Feb 19, 2018 at 12:35 AM, Iván Castell
> > <icastell@nayarsystems.com> wrote:
> > > I have tried breaking apart packagegroup-core-boot, making a copy in my
> > > custom layer, removing the line referencing busybox:
> > >
> > >     ## VIRTUAL-RUNTIME_login_manager ?= "busybox"
>
> Have you considered "toybox" ? It probably wouldn't work right-away. Still,
> toybox was designed to provide a replacement for busybox. It is available
> in "meta-oe"
>
> http://cgit.openembedded.org/meta-openembedded/tree/meta-
> oe/recipes-core/toybox/toybox_0.7.5.bb
>
>

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...

[-- Attachment #2: Type: text/html, Size: 6628 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Removing busybox completely from the generated image
  2018-02-19 10:21   ` Alexander Kanavin
@ 2018-02-19 20:59     ` Paul Eggleton
  0 siblings, 0 replies; 11+ messages in thread
From: Paul Eggleton @ 2018-02-19 20:59 UTC (permalink / raw)
  To: Iván Castell; +Cc: yocto

On Monday, 19 February 2018 11:21:20 PM NZDT Alexander Kanavin wrote:
> On 02/19/2018 10:35 AM, Iván Castell wrote:
> > I have tried breaking apart packagegroup-core-boot, making a copy in my 
> > custom layer, removing the line referencing busybox:
> > 
> >      ## VIRTUAL-RUNTIME_login_manager ?= "busybox"
> > 
> > But now bitbake complains with an error message:
> > 
> >      ERROR: Nothing RPROVIDES '${VIRTUAL-RUNTIME_login_manager}'
> 
> You need to remove the reference to VIRTUAL-RUNTIME_login_manager from 
> the list of packages to be installed, not the definition that points to 
> busybox. If the resulting image breaks, you get to keep the pieces. I'm 
> not sure what function busyybox performs here, but oe-core does not have 
> an alternative now - you are welcome to provide one.

I think the more full-featured alternative would be the "login" implementation 
provided by shadow, so you would set:

VIRTUAL-RUNTIME_login_manager = "shadow"

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Removing busybox completely from the generated image
  2018-02-19 16:13       ` Iván Castell
@ 2018-02-20  6:45         ` Martin Hundebøll
  2018-02-20  8:26           ` Iván Castell
  0 siblings, 1 reply; 11+ messages in thread
From: Martin Hundebøll @ 2018-02-20  6:45 UTC (permalink / raw)
  To: Iván Castell, Maxin B. John; +Cc: Yocto Project

Hi Ivan,

On 2018-02-19 17:13, Iván Castell wrote:
> 
> 
> 2018-02-19 16:18 GMT+01:00 Maxin B. John <maxin.john@intel.com 
> <mailto:maxin.john@intel.com>>:
> 
>     Hi,
> 
>     On Mon, Feb 19, 2018 at 02:17:38AM -0800, Khem Raj wrote:
>     > On Mon, Feb 19, 2018 at 12:35 AM, Iván Castell
>     > <icastell@nayarsystems.com <mailto:icastell@nayarsystems.com>> wrote:
>     > > I have tried breaking apart packagegroup-core-boot, making a copy in my
>     > > custom layer, removing the line referencing busybox:
>     > >
>     > >     ## VIRTUAL-RUNTIME_login_manager ?= "busybox"
> 
>     Have you considered "toybox" ? It probably wouldn't work right-away.
>     Still,
>     toybox was designed to provide a replacement for busybox. It is
>     available
>     in "meta-oe"
> 
>     http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-core/toybox/toybox_0.7.5.bb
>     <http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-core/toybox/toybox_0.7.5.bb>
> 
> 
> 
> 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.

// Martin


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Removing busybox completely from the generated image
  2018-02-20  6:45         ` Martin Hundebøll
@ 2018-02-20  8:26           ` Iván Castell
  2018-02-21  3:01             ` Paul Eggleton
  0 siblings, 1 reply; 11+ messages in thread
From: Iván Castell @ 2018-02-20  8:26 UTC (permalink / raw)
  To: Martin Hundebøll; +Cc: Yocto Project

[-- Attachment #1: Type: text/plain, Size: 1140 bytes --]

2018-02-20 7:45 GMT+01:00 Martin Hundebøll <mnhu@prevas.dk>:

> Hi Ivan,
>
>>
>> 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.
>
> // Martin
>


Yes!! That was the trick. It works like a charm!! Thank you so much Mr.
Martin!! :-)

[-- Attachment #2: Type: text/html, Size: 2276 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Removing busybox completely from the generated image
  2018-02-20  8:26           ` Iván Castell
@ 2018-02-21  3:01             ` Paul Eggleton
  2018-02-21  8:14               ` Iván Castell
  0 siblings, 1 reply; 11+ messages in thread
From: Paul Eggleton @ 2018-02-21  3:01 UTC (permalink / raw)
  To: Iván Castell; +Cc: yocto

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@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

-- 

Paul Eggleton
Intel Open Source Technology Centre




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Removing busybox completely from the generated image
  2018-02-21  3:01             ` Paul Eggleton
@ 2018-02-21  8:14               ` Iván Castell
  0 siblings, 0 replies; 11+ messages in thread
From: Iván Castell @ 2018-02-21  8:14 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: Yocto Project

[-- Attachment #1: Type: text/plain, Size: 2780 bytes --]

2018-02-21 4:01 GMT+01:00 Paul Eggleton <paul.eggleton@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@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! :-)

[-- Attachment #2: Type: text/html, Size: 13010 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-02-21  8:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-16 15:56 Removing busybox completely from the generated image Iván Castell
2018-02-19  8:35 ` Iván Castell
2018-02-19 10:17   ` Khem Raj
2018-02-19 15:18     ` Maxin B. John
2018-02-19 16:13       ` Iván Castell
2018-02-20  6:45         ` Martin Hundebøll
2018-02-20  8:26           ` Iván Castell
2018-02-21  3:01             ` Paul Eggleton
2018-02-21  8:14               ` Iván Castell
2018-02-19 10:21   ` Alexander Kanavin
2018-02-19 20:59     ` Paul Eggleton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.