在 yocto 中配置默认​​挂载选项

发布于 2025-01-16 19:11:23 字数 907 浏览 3 评论 0原文

我有一个 yocto 元层,它为嵌入式系统构建完整的 Linux 发行版。 它基于 yocto 的 'dunfell' (3.1.11) 分支并使用 linux 主线内核 5.10.57。

我使用的文件系统是 ext4,/etc/fstab 文件包含以下几行(已删减):

/dev/root            /                    auto       defaults              1  1
/dev/mmcblk0p4  /data ext4    defaults,x-systemd.before=network-pre        0       1

用于安装的 defaults 选项会产生以下安装配置 (cat /proc/mounts):

/dev/root / ext4 rw,relatime 0 0
/dev/mmcblk0p4 /data ext4 rw,relatime 0 0

我会将默认安装选项更改为 rw,sync,noatime,nodelalloc,barrier=1,commit=1,data=journal

我可以手动操作 /etc/fstab 文件。但是我如何更改 yocto 食谱中的默认选项呢?我不知道在哪里可以找到配方中的默认安装选项定义。

感谢您的任何提示

编辑: 澄清问题:

  1. 在 fstab 中配置默认​​值时使用的挂载选项在哪里定义?
  2. 这个选项可以在 yocto 配方中的哪里配置?
  3. 如何更改 yocto 配方中的文件系统日志(启用/禁用 ext4 文件系统的日志)?我认为它必须在创建SD卡映像时在WIC步骤中完成?

I have a yocto meta layer which build a complete Linux distribution for an embedded system.
It is based on 'dunfell' (3.1.11) branch of yocto and using the linux mainline kernel 5.10.57.

The file system which I use is ext4 and the /etc/fstab file contains the following lines (snipped):

/dev/root            /                    auto       defaults              1  1
/dev/mmcblk0p4  /data ext4    defaults,x-systemd.before=network-pre        0       1

The defaults option for mounting results in the following mount configuration (cat /proc/mounts):

/dev/root / ext4 rw,relatime 0 0
/dev/mmcblk0p4 /data ext4 rw,relatime 0 0

I will change the default mounting option to rw,sync,noatime,nodelalloc,barrier=1,commit=1,data=journal.

I'm able to manipulate the /etc/fstab file manually. But how could I change the defaults options in my yocto recipe? I have no idea where to find the default mount options definition in the recipe.

Thanks for any Hint

Edit:
Clarify the question:

  1. Where are the mount options defined which are used when defaults is configured in the fstab?
  2. Where could this options configured in a yocto recipe?
  3. How to change the filesystem journaling (enable/disable journal of ext4 filesystem) in the yocto recipe? I think it must be done in the WIC step when the SD Card image is created?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

屋檐 2025-01-23 19:11:23

fstab 文件由位于以下位置的 base-files 配方处理:

poky/meta/recipes-core/base-files

要实现您自己的 fstab 文件:

  • meta-custom/recipes-core /base-files/files/myfstab
  • meta-custom/recipes-core/base-files/base-files_%.bbappend
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI_append = " file://myfstab"

do_install_append(){
    install -m 0644 ${WORKDIR}/myfstab ${D}${sysconfdir}/fstab
}

fstab file is handled by base-files recipe located in:

poky/meta/recipes-core/base-files

To implement your own fstab file:

  • meta-custom/recipes-core/base-files/files/myfstab
  • meta-custom/recipes-core/base-files/base-files_%.bbappend :
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI_append = " file://myfstab"

do_install_append(){
    install -m 0644 ${WORKDIR}/myfstab ${D}${sysconfdir}/fstab
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文