How to Strip Down My Yocto Linux

How can I strip down core-image-sato and remove selected apps/packages?

core-image-sato is an example, just write your own image recipe. The x11-sato image feature is what pulls in all of Sato. Remove that and add packagegroup-core-x11-sato-base to IMAGE_INSTALL to install just the desktop.

Debug symbols not stripped from resulting binaries in Yocto

Explicitly specifying package types and inheriting pkgconfig solved my issue. Updated recipe:

SRCBRANCH = "master"
SRCREV = "master"

MY_SRC = "OMITTED"

SRC_URI = "${MY_SRC};branch=${SRCBRANCH}"

DEPENDS += "boost"

S = "${WORKDIR}/git"

PARALLEL_MAKE ?= "-j 1"

inherit pkgconfig cmake

EXTRA_OECMAKE+=" -DSOME_OPTION"
OECMAKE_GENERATOR="Unix Makefiles"

# Specify package types
PACKAGES = "${PN}-dbg ${PN}"

FILES_${PN}-dbg += "\
<INSTALL_PATH>/.debug \
"

FILES_${PN} += "\
<INSTALL_PATH>/* \
"

yocto: rebuild part of project

Certainly, this is easy to do. Just specify the recipe you want to build instead of the image name, for example if it was the main gstreamer recipe you had changed (which at least in current versions is called gstreamer1.0):

MACHINE=some-machine bitbake gstreamer1.0

Note that the name expected on the command line is always a recipe name or something from PROVIDES in a recipe, and not a runtime package name.

Regarding devtool, it can certainly put you into an environment where you can more easily make changes to the source for a recipe and generate patches from them, but the actual building part we are discussing here doesn't really change. You can find more information on how to use devtool in the Yocto Project Development Manual

Why is my app a different size on my yocto build server compared to what is installed on target?

You are not comparing the deployable artifacts, the deployable binaries are in packages-split/ directory. Once do_compile is finished, the binary contains debug info and symbols, usually needed for debugging not for running. So there are additional steps that are exectuted, one of them is to install it into staging area which will be image/ dir inside the recipe workdir. Then do_package task will divide the files in image/ into output packages ( ipks/rpms ) in packages-split
folder, after running strip operations to ensure debug info and symbols are packages into debug packages, the final binary is then inside packages-split/<PN>
and it will be under same path as it is on target like /usr/bin it will be in packages-split/<name>/usr/bin and this is the binary you should be checksumming

How do I turn off the console on an embedded system built with Yocto?

For kernel versions 5.11 and newer:

In the submenu "Character devices" under "Device Drivers" from make menuconfig, there is an option called "Null TTY driver" (CONFIG_NULL_TTY) that you can enable and add console=ttynull to the kernel boot cmdline so that all console output will be simply discarded.

You can also disable CONFIG_VT and CONFIG_UNIX98_PTYS, since you don't need to interact with your program via console at all.

For older kernels (like my 4.14):
You can add this support with the diffs at: https://lore.kernel.org/lkml/20190403131213.GA4246@kroah.com/T/ and then follow the instructions above.



Related Topics



Leave a reply



Submit