简体   繁体   English

在 yocto 中配置默认挂载选项

[英]configure default mount options in yocto

I have a yocto meta layer which build a complete Linux distribution for an embedded system.我有一个 yocto 元层,它为嵌入式系统构建了一个完整的 Linux 分布。 It is based on 'dunfell' (3.1.11) branch of yocto and using the linux mainline kernel 5.10.57.它基于 yocto 的 'dunfell' (3.1.11) 分支并使用 linux 主线 kernel 5.10.57。

The file system which I use is ext4 and the /etc/fstab file contains the following lines (snipped):我使用的文件系统是 ext4,/etc/fstab 文件包含以下几行(已截取):

/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 ):挂载的默认选项导致以下挂载配置 ( 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 .我会将默认挂载选项更改为rw,sync,noatime,nodelalloc,barrier=1,commit=1,data=journal

I'm able to manipulate the /etc/fstab file manually.我能够手动操作 /etc/fstab 文件。 But how could I change the defaults options in my yocto recipe?但是我怎样才能更改我的 yocto 配方中的默认选项呢? 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?在 fstab 中配置默认值时使用的挂载选项在哪里定义?
  2. Where could this options configured in a yocto recipe?在 yocto 配方中可以在哪里配置这些选项?
  3. How to change the filesystem journaling (enable/disable journal of ext4 filesystem) in the yocto recipe?如何在 yocto 配方中更改文件系统日志(启用/禁用 ext4 文件系统的日志)? I think it must be done in the WIC step when the SD Card image is created?我认为必须在创建 SD 卡映像时在 WIC 步骤中完成?

fstab file is handled by base-files recipe located in: fstab文件由位于以下位置的base-files配方处理:

poky/meta/recipes-core/base-files

To implement your own fstab file:要实现您自己的fstab文件:

  • meta-custom/recipes-core/base-files/files/myfstab元自定义/食谱核心/基础文件/文件/myfstab
  • meta-custom/recipes-core/base-files/base-files_%.bbappend :元自定义/食谱核心/基础文件/基础文件_%.bbappend
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI_append = " file://myfstab"

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM