【问题标题】:Customize a default configuration file of an embedded yocto-base Linux distribution如何更改 Yocto 映像中的文件 /etc/hosts?
【发布时间】:2022-09-23 16:23:27
【问题描述】:

我需要用新的 hosts 文件替换 Yocto 图像的默认文件 /etc/hosts
允许这样做的 Yocto 食谱是什么?
谢谢

    标签: yocto-recipe


    【解决方案1】:

    我找到了食谱,那就是:
    meta/recipes-core/base-fles/base-files_<recipe_version>.bb

    所以我可以添加一个base_files_%.bbappend 文件(在mylayer/recipes-core/base-files 中)并用我的新hosts 文件替换默认的hosts 文件。

    文件base_files_%.bbappend 的内容是:

    FILESEXTRAPATHS_prepend := "${THISDIR}/base-files:"
    SRC_URI = "file://rotation \
           file://nsswitch.conf \
           file://motd \
           file://hosts \
           file://host.conf \
           file://profile \
           file://shells \
           file://fstab \
           file://issue.net \
           file://issue \
           file://share/dot.bashrc \
           file://share/dot.profile \
           file://licenses/GPL-2 \
    "
    

    此外,我在文件夹中插入了新的 hosts 文件:
    meta/recipes-core/base-fles/base-files

    【讨论】:

      猜你喜欢
      • 2021-11-18
      • 1970-01-01
      • 1970-01-01
      • 2016-08-22
      • 2019-05-30
      • 1970-01-01
      • 1970-01-01
      • 2017-04-17
      相关资源
      最近更新 更多