How to check if busybox applet is included by defaut?

I wish to use a busybox applet in an init script. I need to know if it's included by default in OpenWrt. It doesn't matter which applet - I'm looking for a generic answer.

How do I find this information, except by booting a snapshot and trying the command?

Thank you.

Open up nconfig/menuconfig and see.

You will find little to no distinction between a Current Release and a Snapshot image based on your target. You will get Core utilities for embedded Linux regardless. Anything else and you will have to install a full version of the utility or customize BusyBox yourself.

Where? This is the default:

Select [*] Customize busybox options to expand:

Archival Utilities  --->
Coreutils  --->
Console Utilities  --->
Debian Utilities  --->
klibc-utils  --->
Editors  --->
Finding Utilities  --->
Init Utilities  --->
Login/Password Management Utilities  --->
Linux Ext2 FS Progs  --->
Linux Module Utilities  --->
Linux System Utilities  --->
Miscellaneous Utilities  --->
Networking Utilities  --->
Print Utilities  --->
Mail Utilities  --->
Process Utilities  --->
Runit Utilities  --->
Shells  --->
System Logging Utilities  --->

Check/select your Utility.

Just check the busybox defaults in the OpenWrt git:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob_plain;f=package/utils/busybox/Config-defaults.in

3 Likes

That's what I was looking for!

Or just use feeds/base/utils/busybox/Config-defaults.in in your BuildRoot that reflects the true state of your BusyBox defaults.

1 Like

When writing init scripts, I'm interested in everybody else's defaults.

1 Like

Tangential, but closely related so recorded here for posterity.

I was just researching this same topic, but from the perspective of the client device (https://github.com/openwrt/openwrt/issues/16991#issuecomment-2962787179).

My best results thus far are looking at the list of files installed by the package manager and then grep/awking out the ones of interest.

For opkg releases:

$ opkg files busybox
Package busybox (1.36.1-r2) is installed on root and has the following files:
/bin/dmesg
/usr/bin/id
/bin/login
/bin/rm
/sbin/ip
/bin/sh
/usr/bin/test
/bin/zcat
/bin/fgrep
/bin/ash
...

And on apk builds

$ apk info --contents busybox
busybox-1.37.0-r4 contains:
bin/ash
bin/busybox
bin/cat
bin/chgrp
bin/chmod
bin/chown
bin/cp
bin/date
bin/dd
bin/df
bin/dmesg
bin/echo
...