linux – 如何在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的root下运行make时,构建失败并出现错误无法打开’buildroot-2013.05 / output / images / rootfs.cpio’.因为(如果我理解正确的话)构建序列是工具链–pakages – rootfs – linux内核 – rootfs的图像.当它尝试构建linux内核时,不会创建rootfs.cpio映像.

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

可能是比buildroot更有效的替代品?

提前致谢.

解决方法

The make command build all targets

您不希望这样做(直到配置buildroot).
首先需要通过指定目标板来配置buildroot.
根据manual,您可以从头开始,或者为您的AT91SAM9X25板创建一个buildroot配置文件,该板来自类似的板,例如configs/at91sam9g20dfc_defconfig

除了buildroot配置文件,您还需要一个Linux内核配置文件(除非您想尝试从头开始配置内核).
带有AT91SAM9x5的Atmel评估板的内核配置文件at91sam9x5ek_defconfig

您还应阅读第3.4.2节.创建自己的板支持

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

答案取决于您如何定义“重制rootfs”.
如果删除目录output / images /,则会重写rootfs的文件.
如果删除output / build /中的目录,则会从源代码重新编译这些包或子系统.

如果将buildroot配置为使用自己的工具链或外部工具链,则make clean不会删除它们.如果您将buildroot配置为安装它在其目录之外构建的工具链,那么它可能会在make clean期间不管它.

当然,buildroot make足够聪明,可以知道自上次构建以来发生了哪些变化以及必须重新编译的内容.
在极少数情况下,您需要删除output / build /中的目录以强制重新编译.

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

您需要正确配置buildroot和Linux内核.

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

有关使用buildroot for AT91SAM9x5的更简明信息是this Linx4SAM page

Possibly are there more efficient alternatives than buildroot?

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

附录

how to rebuild rootfs in buildroot

要强制重建rootfs(在本例中为initramfs),请删除output / build / linux-x.xx.xx目录中的三个隐藏文件

.stamp_images_installed
    .stamp_initramfs_rebuilt
    .stamp_target_installed

相关文章

Linux中的ARP防火墙主要用于防御ARP欺骗攻击,其效果取决于多...
insmod和modprobe加-f参数导致Invalid module format错误 这...
将ArchLinux安装到U盘 几个月前入门Arch的时候上网搜了不少安...
1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...