yocto系统Image优化
使用yocto编译出来的Image文件(比如ext4格式)有时候根据业务需求,是要进行剪裁以缩小Image的Size。
比如系统有OTA需求,系统预留的OTA分析大小是500M。但是Image(ext4格式)是1G大小。即使使用压缩文件,也未达到500M。这种情况下,可能就需要进行剪裁了。
strip
对于编译系统来说,strip操作可理解为对编译生成的成果物(so、bin之类的)剔除其用于Debug的symbol等。strip后成果物的size会变下。
Yocto系统默认对Image的成果物进行Strip操作,但可以通过设置下述变量让Yocto对成果物不进行strip。
# If set to “1”, causes the build to not strip binaries in resulting packages and prevents the -dbg package from containing the source files
INHIBIT_PACKAGE_STRIP
#Prevents the OpenEmbedded build system from splitting out debug information during packaging.
#By default, the build system splits out debugging information during the do_package task.
INHIBIT_PACKAGE_DEBUG_SPLIT
<