Recently, I needed to enable the eject command in BusyBox for an OpenEmbedded (Yocto) based project. Below is a way to do this in a fairly painless way:
- bitbake -c menuconfig busybox (enable the eject command in the config and save)
- bitbake -c diffconfig busybox (this generates a config fragment, note the fragment file location)
- recipetool appendsrcfile -w [path to layer] busybox [path to fragment generated in step #2]
Now, in my project layer, I have the following files:
recipes-core/busybox/busybox_%.bbappend:
SRC_URI += "file://fragment.cfg" FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
recipes-core/busybox/busybox/fragment.cfg:
# Wed Sep 30 15:23:49 2015 CONFIG_EJECT=y CONFIG_FEATURE_EJECT_SCSI=y
Wow, that is pretty neat! The same procedure should work on kernel recipes as well.
Notes:
- If you have trouble running bitbake -c menuconfig in a remote ssh shell, trying installing screen on the build machine.
- recipetool is located in openembedded-core/scripts/recipetool
- Chris L. noted the -w option in recipetool would have simplified the append slightly (would avoid the subdir= on the SRC_URI, since it’d install it to workdir instead of the source tree) Great idea — example above modified to include -w.