busybox: add initrd variant

Add a busybox variant that inherits almost all of its support from
the core busybox recipe, but adds configuration values that are
appropriate to be used in an initrd.

In particular:

  - we build busybox statically
  - we enable runlevel and init functionality
  - mdev is always enabled
  - applet install support is enabled

Signed-off-by: Bruce Ashfield <bruce.ashfield@xilinx.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Bruce Ashfield 2020-09-21 17:29:23 -07:00
parent baf30af86f
commit d0ef2f0bf7
3 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,14 @@
CONFIG_INIT=y
CNOFIG_FEATURE_UTMP=y
CONFIG_RUNLEVEL=y
CONFIG_FEATURE_USE_INITTAB=y
CONFIG_HALT=y
CONFIG_POWEROFF=y
CONFIG_FEATURE_KILL_DELAY=0
CONFIG_TELINIT_PATH=""
CONFIG_INIT_TERMINAL_TYPE=""
# CONFIG_FEATURE_SHADOWPASSWDS is not set
CONFIG_USE_BB_PWD_GRP=y
CONFIG_STATIC=y

View File

@ -0,0 +1 @@
CONFIG_FEATURE_INSTALLER=y

View File

@ -0,0 +1,20 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/busybox-initrd:${COREBASE}/meta/recipes-core/busybox/busybox:${COREBASE}/meta/recipes-core/busybox/files:"
require recipes-core/busybox/busybox_${PV}.bb
SRC_URI += "file://init.cfg \
file://mdev.cfg \
file://runx.cfg \
file://initrd.cfg"
S = "${WORKDIR}/busybox-${PV}"
# override security-flags settings, we have some warnings to ignore
SECURITY_STRINGFORMAT = ""
# we do this to get the target binary available to recipes that
# depend on busybox
SYSROOT_DIRS += "/bin"
BUSYBOX_SPLIT_SUID = "0"
FILES_${PN} += "${sysconfdir}/init.d/*"