【问题标题】:Replace sshd_config file with the custom one in Yocto将 sshd_config 文件替换为 Yocto 中的自定义文件
【发布时间】:2021-04-08 15:20:30
【问题描述】:

我使用 Yocto Zeus 为我的开发板构建嵌入式 Linux。到目前为止,我需要将 /etc/ssh/sshd_config 替换为我的自定义配置。

很遗憾,我找不到任何有用的信息。刚刚在网上找到了一些帮助。 我创建了一个自定义层并添加了如下配方:

sources
  mylayer
    mylayer-recipes
      recipes-connectivity
        openssh
          openssh_%.bbappend
          openssh
            sshd_config

openssh_%.bbappend

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://sshd_config"

在此之后我尝试重建图像

bitbake core-image-minimal

但是什么也没发生。镜像中的sshd_config文件没有报错,也没有变化。

我做错了什么?其实我只想把系统/etc/ssh/sshd_config换成自定义的,没有别的。

【问题讨论】:

  • bitbake-layers show-appends | grep openssh 显示什么?
  • 什么都不显示。但是这是什么意思?我的 bbappend 对于 bitbake 不可见?我怎样才能把它喂给bitbake?我也从来没有真正做过这件事,而且我和 Yocto 的合作也不多。
  • 没错。我可以看到您发现文件夹结构不匹配。
  • 是的,我只是尝试了不同的选项,突然就奏效了。感谢@OleksandrKravchuk 的参与和帮助。

标签: yocto


【解决方案1】:

好的,我终于解决了这个问题。事实证明,我没有遵循 *.bb 的完整路径,但只遵循顶级路径,尽管文档说 "...这意味着您必须设置包含任何文件的支持目录结构或您将从图层中包含的补丁。”5.1.5. Using .bbappend Files 部分。所以最终的文件夹结构如下所示:

sources
  mylayer
    mylayer-recipes          
        openssh
          openssh_%.bbappend
          openssh
            sshd_config <----- the file that replaces the original one

  poky
    recipes-connectivity
      openssh
        openssh_8.0p1.bb
        openssh
          sshd_config   <----- the original file
          ....

即我刚刚将文件夹 openssh 添加到 mylayer-recipes 文件夹,现在按预期工作

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-06-14
    • 2012-03-29
    • 2022-07-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-25
    相关资源
    最近更新 更多