Skip to contentSkip to conversation

Replace Bash with Busybox

DISCUSSION sateesh m 4 participants 7 messages Apr 2, 2025 – Apr 3, 2025

lore
Share & tools
lore

sateesh m

author
#0 lore raw

Hi Team,

I want to upgrade my BusyBox version from 1.31 to 1.35 and replace Bash with BusyBox. How can I accomplish this task? Can anyone provide guidance? This would be helpful for me.

I am managing this as described below, but I am still unsure whether this change will work or not

PREFERRED_VERSION_busybox = "1.35.0"
IMAGE_INSTALL += "busybox"
VIRTUAL-RUNTIME_shell = "busybox"
IMAGE_INSTALL_remove = "bash"

Regards,
Sateesh

#1 lore raw
Quoted 12 lines · sateesh m via lists.yoctoproject.org

Hi Team,

I want to upgrade my BusyBox version from 1.31 to 1.35 and replace Bash with BusyBox. How can I accomplish this task? Can anyone provide guidance? This would be helpful for me.

I am managing this as described below, but I am still unsure whether this change will work or not

PREFERRED_VERSION_busybox = "1.35.0"
IMAGE_INSTALL += "busybox"
VIRTUAL-RUNTIME_shell = "busybox"
IMAGE_INSTALL_remove = "bash"

you can try

bitbake -g my-image && cat pn-buildlist | grep bash

and see if its still in.

Try adding following to local.conf

BAD_RECOMMENDATIONS += "bash"

Quoted 12 lines

Regards,
Sateesh

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
You automatically follow any topics you start or reply to. View/Reply Online (#65053): https://lists.yoctoproject.org/g/yocto/message/65053
Mute This Topic: https://lists.yoctoproject.org/mt/112040928/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

author
#2 lore raw

If I keep these lines in *layer.conf* instead of *local.conf* , will it work? I added the following lines to the *layer.conf* file:

IMAGE_INSTALL += "busybox"
VIRTUAL-RUNTIME_shell = "busybox"
IMAGE_INSTALL_remove = "bash"
BAD_RECOMMENDATIONS += "bash"

However, when I run the command *bitbake -g my-image && cat pn-buildlist | grep bash ,*

Bash is still present.

My actual requirement I need to upgrade busybox replace bash with busybox and remove bash.

Regards,
Sateesh

#3 lore raw
Quoted 8 lines · sateesh m via lists.yoctoproject.org

If I keep these lines in layer.conf instead of local.conf, will it work? I added the following lines to the layer.conf file:

IMAGE_INSTALL += "busybox"
VIRTUAL-RUNTIME_shell = "busybox"
IMAGE_INSTALL_remove = "bash"
BAD_RECOMMENDATIONS += "bash"

Quoted 6 lines

However, when I run the command bitbake -g my-image && cat pn-buildlist | grep bash,

Bash is still present.

My actual requirement I need to upgrade busybox replace bash with busybox and remove bash.

Add

PACKAGE_EXCLUDE = "bash"

to your local.conf. Your image build will fail, from where you can start working out who is pulling bash in.

Signature · 1 line
Alex Kiernan
#4 lore raw
In reply to sateesh m
Quoted 8 lines · sateesh m via lists.yoctoproject.org

Hi Team,
I want to upgrade my BusyBox version from 1.31 to 1.35 and replace Bash with BusyBox. How can I accomplish this task? Can anyone provide guidance? This would be helpful for me. I am managing this as described below, but I am still unsure whether this change will work or not
PREFERRED_VERSION_busybox = "1.35.0"
IMAGE_INSTALL += "busybox"
VIRTUAL-RUNTIME_shell = "busybox"
IMAGE_INSTALL_remove = "bash"

busybox doesn’t provide bash, it provides sh. Recipes will only be pulling in bash if they need bash, and images will have to pull in bash explicitly.

If you want to remove bash then identify what packages in your image need bash, and identify how to remove that dependency: either don’t install the thing that needs bash, or rewrite the script to not use bashisms and then change the #! to /bin/sh.

Ross

author
#5 lore raw

Which script I need to write.

Quoted 24 lines · Ross Burton,
Quoted 3 lines · sateesh m via lists.yoctoproject.org

Hi Team,
I want to upgrade my BusyBox version from 1.31 to 1.35 and replace

Bash with BusyBox. How can I accomplish this task? Can anyone provide guidance? This would be helpful for me.

Quoted 1 line

I am managing this as described below, but I am still unsure whether

this change will work or not

Quoted 4 lines

PREFERRED_VERSION_busybox = "1.35.0"
IMAGE_INSTALL += "busybox"
VIRTUAL-RUNTIME_shell = "busybox"
IMAGE_INSTALL_remove = "bash"

busybox doesn’t provide bash, it provides sh. Recipes will only be pulling in bash if they need bash, and images will have to pull in bash explicitly.

If you want to remove bash then identify what packages in your image need bash, and identify how to remove that dependency: either don’t install the thing that needs bash, or rewrite the script to not use bashisms and then change the #! to /bin/sh.

Ross

#6 lore raw
Quoted 2 lines · sateesh m

Which script I need to write.

I have no idea why your image has bash in it, so I can’t tell you that.

Your image, presumably, has bash in. You need to find out why that is, and then do something to stop that happening.

Ross