[yocto] Removing busybox

Jean-Christian de Rivaz jean-christian.derivaz at innodelec.ch
Wed Feb 27 12:06:38 PST 2019


Thank you very much Tom for help. Here is my complete method:

git clone git://git.yoctoproject.org/poky -b thud
cd poky
cat << EOF > meta-poky/conf/distro/poky-ng.conf
require conf/distro/poky.conf
DISTRO = "poky-ng"

# Switch to systemd
DISTRO_FEATURES += "systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
VIRTUAL-RUNTIME_initscripts = ""
VIRTUAL-RUNTIME_syslog = ""
VIRTUAL-RUNTIME_login_manager = "shadow-base"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"

# Replace busybox
PREFERRED_PROVIDER_virtual/base-utils = "coreutils"
VIRTUAL-RUNTIME_base-utils = "coreutils"
VIRTUAL-RUNTIME_base-utils-hwclock = "util-linux-hwclock"
VIRTUAL-RUNTIME_base-utils-syslog = ""
EOF
source oe-init-build-env
sed -i 's/^DISTRO.*/DISTRO = "poky-ng"/' conf/local.conf
bitbake core-image-minimal
runqemu core-image-minimal kvm

So as expected systemd is there and busybox is not. But there is a lot of
useful commands missing on the resulting QEMU image:

root at qemux86:~# ps
~sh: ps: command not found
root at qemux86:~# w
~sh: w: command not found
root at qemux86:~# find
~sh: find: command not found
root at qemux86:~# grep
~sh: grep: command not found
root at qemux86:~# ip addr
~sh: ip: command not found

I expected that all the limited busybox commands would be replaced by
the full
featured commands. How to fix that ?

Best Regards.
Jean-Christian de Rivaz

Le 27.02.19 à 18:06, Tom Rini a écrit :
> On Wed, Feb 27, 2019 at 01:16:56PM +0100, Jean-Christian de Rivaz wrote:
>
>> Hi all,
>>
>> After reading the thread "Removing busybox completely from the generated
>> image" I tested to reproduce the method but this doesn't work as expected.
>>
>> git clone git://git.yoctoproject.org/poky -b thud
>> cd poky
>> echo 'require conf/distro/poky.conf' > meta-poky/conf/distro/poky-ng.conf
>> echo 'DISTRO = "poky-ng"' >> meta-poky/conf/distro/poky-ng.conf
>> echo 'VIRTUAL-RUNTIME_base-utils = ""' >> meta-poky/conf/distro/poky-ng.conf
>> sed -i 's/^DISTRO.*/DISTRO = "poky-ng"/' conf/local.conf
>> bitbake core-image-minimal
>> runqemu core-image-minimal kvm
>>
>> After login as root there still a lot of links to busybox inside /sbin/
>> /bin/ /usr/sbin/ and /usr/bin/ .
>>
>> Can someone provides a working method ?
> You're missing a few more things, yes.  What I have is:
> # Switch to systemd
> DISTRO_FEATURES += "systemd"
> VIRTUAL-RUNTIME_init_manager = "systemd"
> VIRTUAL-RUNTIME_initscripts = ""
> VIRTUAL-RUNTIME_syslog = ""
> VIRTUAL-RUNTIME_login_manager = "shadow-base"
> DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
>
> # Replace busybox
> PREFERRED_PROVIDER_virtual/base-utils = "coreutils"
> VIRTUAL-RUNTIME_base-utils = "coreutils"
> VIRTUAL-RUNTIME_base-utils-hwclock = "util-linux-hwclock"
> VIRTUAL-RUNTIME_base-utils-syslog = ""
>
> If you aren't using systemd you'll need to move the login_manager
> example over as well, otherwise busybox gets pulled for that.
>
> I'm using the above on thud, today.  And that's not a 1:1 replacement as
> my image pulls in a number of other packages for various things I
> want/need.
>


More information about the yocto mailing list