Yocto如何产生这些的/ etc /限制文件 [英] How Yocto generating these /etc/limits files

查看:571
本文介绍了Yocto如何产生这些的/ etc /限制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在努力使用Yocto建立system.Now我想改变一个文件/ etc /极限/在我开始我的体型,但是当我试图找到这个文件的极限,找不到任何构建定制化的内核映像文件名限制和来认识构建后生成此文件。

I have been working on building customized kernel image using Yocto build system.Now I wanted to change a file /etc/limits/ before I start my build but when I try to find this file "limits",could not find any file name limits and come to know this file is generated after build.

我期待找到这个文件(编译前)在某处元目录就像一个名为个人资料的文件中存在目录狭小

I was expecting to find this file(before build) somewhere in meta directory just like file named "profile" is there in poky directory.

现在我的问题是如何建立yocto系统生成此文件/ etc / limits文件,我在哪里可以找到构建之前该文件

Now my question is how yocto build system generates this file /etc/limits file ,where can I find this file before build

推荐答案

我checke无论是丹尼分支(Yocto 1.3)和Dylan分支(Yocto 1.4),并在这两个版本,生成文件/ etc /限制由影子包。所以我不知道为什么你说该文件编译后生成。一般情况下,当我需要找出一个文件的来源,我搜索生成的二进制软件包。在你的情况,构建核心形象的基础之后,我进行这个快速搜索:

I have checke both the Danny branch (Yocto 1.3) and Dylan branch (Yocto 1.4) and in both of those versions, the file /etc/limits is generated by the shadow package. So I'm not sure why you say that the file is generated after the build. In general, when I need to find out where a file comes from, I search the generated binary packages. In your case, after building core-image-base, I performed this quick search:

$ cd tmp/deploy/rpm
$ find . -name '*.rpm' | while read A; do $RPM -qpl $A | grep etc/limits; \
if [ $? -eq 0 ]; then echo $A; fi; done
/etc/limits
./armv7a_vfp_neon/shadow-4.1.4.3-r13.armv7a_vfp_neon.rpm

这告诉我,限制文件来自影子包。当bitbake的执行用于该包的do_install()任务,包自身生成文件将安装文件从包含在阴影包的模板。

This tells me that the limits file comes from the shadow package. When bitbake executes the do_install() task for that package, the package's own Makefile installs that file from a template contained in the shadow package.

有两个简单的方法来改变你的文件的根文件系统上的文件的内容。正确的方法是与您的自定义更改添加图层:创建阴影包bbappend,使用SRC_URI =文件://限制加入自己的极限文件,并添加do_install_append()方法后安装自定义文件包的安装自己的方法。有大量的在狭小使用这种技术的例子。

There are two easy ways to change the contents of this file on your file root file system. The correct way is to add a layer with your custom changes: create a bbappend for the shadow package, add your own limits file using SRC_URI = "file://limits", and add a do_install_append() method to install your customized file after the package's own install method. There are plenty of examples of using this technique in poky.

另一种方法是使用一个后处理命令。

The other method is to use a post process command.

ROOTFS_POSTPROCESS_COMMAND += "use_my_limits_file; "

其中use_my_limits_file是一个简单的安装您的自定义限制文件的bash shell的功能。见狭小的insserv.bbclass用于结构用于使用ROOTFS_POSTPROCESS_COMMAND的一个例子。

where use_my_limits_file is simply a bash shell function that installs your custom limits file. See poky's insserv.bbclass for an example of the structure for using ROOTFS_POSTPROCESS_COMMAND.

希望这有助于。黑客快乐!

Hope this helps. Happy hacking!

这篇关于Yocto如何产生这些的/ etc /限制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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