【问题标题】:how to provide executable permission to adb binary using bb file如何使用 bb 文件为 adb 二进制文件提供可执行权限
【发布时间】:2021-02-21 19:30:43
【问题描述】:
  1. 编译这个 bb 文件后,我没有使用 chmod,而是 not get executable binary

  2. 请建议我进行更改,以便我可以在/usr/bin 中获得可执行二进制文件

     FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
     SRC_URI = "file://adb-binary"
    
     do_install () {
       install -d ${D}/usr/bin/
       cp -r ${WORKDIR}/adb-binary/ ${D}/usr/bin/
       chmod +x ${D}/usr/bin/adb-binary/
     }
     FILES_${PN} += "/usr/bin/"
    

    源文件在哪里

     ls -l adb/files/adb-binary/
     total 1124
     -rw-rw-r-- 1 Vksingh Vksingh 1150696 Nov 10 01:06 adb
    

【问题讨论】:

    标签: linux raspberry-pi adb yocto


    【解决方案1】:

    在 yocto mega 手册中你可以看到这个很好的例子 - https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#new-recipe-single-c-file-package-hello-world

    基本上你想要以下(来自大型手册):

     do_install() {
        install -d ${D}${bindir}
        install -m 0755 helloworld ${D}${bindir}
     }
    

    您不想手动使用 chmod,因为它不会转移到目标。如果 adb-binary 包含在 SRC_URI 中,您可以使用 $(WORKDIR)/adb-binary instad of helloworld。

    如果你想安装一些其他的包,你也可以使用 do_install_append(),只需为 adb-binary 添加这个小 sn-p。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-30
      • 1970-01-01
      • 2018-09-02
      • 2013-12-02
      相关资源
      最近更新 更多