Yocto 配方更新/etc/fstab [英] Yocto recipe to update /etc/fstab

查看:75
本文介绍了Yocto 配方更新/etc/fstab的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 Yocto 构建 Linux 发行版时,我在更新 /etc/fstab 时遇到问题.我对 Yocto 还很陌生,所以我可能不太喜欢.

I'm having trouble updating the /etc/fstab of my Linux distribution, when building it with Yocto. I'm pretty new to Yocto, so maybe I'm off my rocker.

我最近的尝试是添加一个名为 base-files_%.bbappend 的配方.

My latest attempt is to add a recipe named base-files_%.bbappend.

mount_smackfs () {
    cat >> ${IMAGE_ROOTFS}/etc/fstab <<EOF

# Generated from smack-userspace
smackfs /smack smackfs smackfsdefault=* 0 0 

EOF
} 

ROOTFS_POSTPROCESS_COMMAND += "mount_smackfs; "

但是,发行版上的输出/etc/fstab 没有改变.所以问题是:

But, the output /etc/fstab on the distribution hasn't changed. So the questions are:

  1. 有没有更好的方法来做到这一点?
  2. 如何判断我的 .bbappend 文件是否真的被执行了?

推荐答案

ROOTFS_POSTPROCESS_COMMAND 在图像配方中处理,不在包配方中处理.你有两种可能性.

ROOTFS_POSTPROCESS_COMMAND is handled in image recipes and not in package recipes. You have 2 possibilities.

  • 更新 base-files_%.bbappend 中的 fstab:

do_install_append () {
    cat >> ${D}${sysconfdir}/fstab <<EOF

# Generated from smack-userspace
smackfs /smack smackfs smackfsdefault=* 0 0 

EOF
}

  • 更新图像配方中的 fstab:在这种情况下,您只需附加您上面(在您的帖子中)在图片食谱中写的内容.

  • Update the fstab in your image's recipe: In this case, you just append what you wrote above (in your post) in the image's recipe.

    这篇关于Yocto 配方更新/etc/fstab的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆