如何在buildroot中重建rootfs [英] how to rebuild rootfs in buildroot

查看:2368
本文介绍了如何在buildroot中重建rootfs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将为AT91SAM9X25板设置自己的linux嵌入式系统的构建环境。我正在使用buildroot来做到这一点。 make命令构建所有目标,第一个它构建工具链然后包,然后rootfs和rootfs(tar,cpio ...)的映像。
要重建rootfs我通常使用make clean然后make。 make clean命令删除所有和包括工具链。



所以第一个我的问题是:有没有办法在没有构建工具链的情况下重构rootfs?它需要很多时间。



另外我正在buildroot中构建linux内核。我在buildroot中打开了BR2_LINUX_KERNEL [= y]。 linux配置为使用初始RAM文件系统,因此构建内核需要rootfs的图像(应该由buildroot创建)。当我在buildroot的根目录下运行make时,该错误无法打开buildroot-2013.05 / output / images / rootfs.cpio。因为(如果我理解正确)构建序列是工具链 - pakages - rootfs - linux内核 - rootfs的映像。当它尝试构建linux内核时,不会创建rootfs.cpio映像。所以第二个问题是:如果我想使用初始RAM文件系统,如何在buildroot内构建linux?



可能有比buildroot更有效的替代方案?



提前感谢

解决方案


make命令构建所有目标


您不想这样做(直到Buildroot配置)

您首先需要通过指定目标板来配置Buildroot。

根据手册,您可以从头开始,或为您的AT91SAM9X25板创建一个Buildroot配置文件,该文件来源于类似的板,例如 configs / at91sam9g20dfc_defconfig



除了Buildroot配置文件,您将还需要一个Linux ker nel配置文件(除非您想从头开始尝试配置内核)。

Atmel的具有AT91SAM9x5的评估板的内核配置文件是 at91sam9x5ek_defconfig



您还应该阅读3.4.2节。


所以我的第一个问题是:有没有办法重建rootfs而不建设工具链?需要很多时间。


答案取决于您如何定义emake rootfs 。
如果您删除目录 output / images / ,则rootfs的文件将被重写。

如果删除 output / build / ,那么这些包或子系统将从源代码重新编译。



如果您将Buildroot配置为使用您自己的或一个外部工具链,然后 make clean 不会删除它们。如果您配置Buildroot来安装工具链,它将在其目录外建立,那么可能会在 make clean 中留下它。



当然,Buildroot 使得非常聪明,可以知道自上次构建以来发生的变化以及需要重新编译的内容。

应该是您需要删除 output / build / 中的目录以强制重新编译的罕见情况。


所以第二个问题是:如果我想使用初始RAM文件系统,如何在buildroot内构建linux?


你需要正确配置Buildroot和Linux内核。

  make menuconfig 
文件系统映像--->
make linux-menuconfig
一般设置--->
make

使用Buildroot for AT91SAM9x5的更简洁的信息是这个Linx4SAM页面


可能有比buildroot更有效的替代方法吗?


还有其他工具,如 Open Embedded ,但将其描述为更有效率是主观的。






ADDENDUM


如何在buildroot中重建rootfs


强制重新生成rootfs(在这种情况下为initramfs),删除 output / build / linux-x.xx.xx 目录

  .stamp_images_installed 
.stamp_initramfs_rebuilt
.stamp_target_installed


I am going to setup build environment to make my own linux embedded system for AT91SAM9X25 Board. I am using buildroot to do this. The make command build all targets, the first it build toolchain then packages and then rootfs and images of rootfs (tar, cpio ...). To rebuild rootfs I usually use make clean and then make. The make clean command removes all and including toolchain.

So the first my question is: Is there some way to remake rootfs without building toolchain? It takes a lot of time.

Also I am building linux kernel within buildroot. I have turned on BR2_LINUX_KERNEL [=y] in buildroot. The linux configured to use Initial RAM filesystem, so to build kernel it required image of rootfs (which should be created by buildroot). When I run make under root of buildroot the building fails with error Cannot open 'buildroot-2013.05/output/images/rootfs.cpio'. Because (if I understand correctly) the building sequence is toolchain - pakages - rootfs - linux kernel - images of rootfs. When it tries to build linux kernel the rootfs.cpio image is not created.

So the second question is: How to build linux within buildroot if I want to use Initial RAM filesystem?

Possibly are there more efficient alternatives than buildroot?

Thanks in advance.

解决方案

The make command build all targets

You do not want to do that (until Buildroot is configured).
You first need to configure Buildroot by specifying the target board.
Per the manual you can start from scratch, or create a Buildroot config file for your AT91SAM9X25 board derived from a similar board such as configs/at91sam9g20dfc_defconfig

Besides the Buildroot config file, you will also need a Linux kernel config file (unless you want to try configuring the kernel from scratch).
The kernel config file for Atmel's eval board with a AT91SAM9x5 is at91sam9x5ek_defconfig

You should also read section 3.4.2. Creating your own board support

So the first my question is: Is there some way to remake rootfs without building toolchain? It takes a lot of time.

The answer depends on how you define "remake rootfs". If you delete the directory output/images/, then the files of the rootfs are rewritten.
If you delete directories in output/build/, then those packages or subsystems are recompiled from source.

If you configure Buildroot to use your own or an external tool chain, then make clean would not remove them. If you configure Buildroot to install the toolchain it builds outside of its directory, then it may leave it alone during a make clean.

Of course the Buildroot make is smart enough to know what has changed since the last build and what has to be recompiled.
It should be the rare case that you need to delete directories in output/build/ to force recompilation.

So the second question is: How to build linux within buildroot if I want to use Initial RAM filesystem?

You need to properly configure both Buildroot and the Linux kernel.

make menuconfig
    Filesystem images --->
make linux-menuconfig
    General setup --->
make

More concise information on using Buildroot for AT91SAM9x5 is this Linx4SAM page

Possibly are there more efficient alternatives than buildroot?

There are other tools such as Open Embedded, but describing them as "more efficient" is subjective.


ADDENDUM

how to rebuild rootfs in buildroot

To force the rootfs to be rebuilt (in this case an initramfs) delete three hidden files in the output/build/linux-x.xx.xx directory

    .stamp_images_installed
    .stamp_initramfs_rebuilt
    .stamp_target_installed

这篇关于如何在buildroot中重建rootfs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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