分享

Buildroot Add one Package

 charlie_linux 2021-11-29

怎么在build root添加一个package 遇到的问题以及解决方法:

一、Config.in 添加

config BR2_PACKAGE_DEMO_NAME

    bool "demo name"

    help

demo name 

二、demo_name.mk 添加

DEMO_NAME_VERSION = 20211126

DEMO_NAME_SITE = $(TOPDIR)/../xxx_path

DEMO_NAME_SITE_METHOD = local

define DEMO_NAME_BUILD_CMDS

    $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) all armhf=1

endef

define DEMAO_NAME_INSTALL_TARGET_CMDS

      $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) install

endef

$(eval $(generic-package))

三、主要配置修改步骤:

1. buildroot/configs/xxx_defconfig 添加配置选项 BR2_PACKAGE_DEMO_NAME=y 

2. 目录中buildroot/package/demo_name

3. demo_name 添加demo_name.mk 和 Config.in 

4. package/COnfig.in添加source "package/demo_name/Config.in"

5. buildroot 根目录编译 make demo_name-rebuild

四、编译过程中报错如下:

五、解决办法:

配置文件中(DEMO_NAME_SITE_METHOD = local)已经说明这个包存在本地,编译的时候怎么还去网上下载,而且官方文档已经说明

 local for a local source code directory. One should use this when

 LIBFOO_SITE specifies a local directory path containing the package

 source code. Buildroot copies the contents of the source directory

 into the package’s build directory. Note that for local packages, no

 patches are applied. If you need to still patch the source code, use

 LIBFOO_POST_RSYNC_HOOKS, see Section 17.21.1, “Using the POST_RSYNC

 hook”.

本地的包只需要调用rsync实现拷贝的过程,判断肯定是demo_name.mk配置文件写错了,DEMO_NAME_SITE_METHOD = local后不能有空格。

buildroot没有识别DEMO_NAME_SITE_METHOD字段,原因本地的包去网上下载,网上下载下来,也会报错的,因为没有实现rsync拷贝的过程,

output/build/demo_name 目录是空的目录,编译就会报错。

    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多