[Buildroot] Growing rootfs.cpio after each make

Andreas Ziegler br015 at umbiko.net
Fri Apr 26 06:27:19 UTC 2024


Hi Andrey,

On 2024-04-25 17:22, Andrey Nechypurenko wrote:
> Hi Folks,
> Am I the only one with the problem mentioned below? :-)

Probably you are unique in that respect. The rootfs.cpio is deleted 
before re-creating it. Things that change with each call to make are:

   Target directory finalization
   The rootfs overlay files are rsynced into the target directory
   Post-build scripts are executed
   User and device tables are generated
   The cpio is created by cloning the target directory

> On Fri, 19 Apr 2024 at 13:34, Andrey Nechypurenko 
> <andreynech at gmail.com> wrote:
>> 
>> Hi Buildrooters,
>> 
>> I have BR2_TARGET_ROOTFS_CPIO enabled and just realized that every
>> time I run make in the build directory, the images/rootfs.cpio file is
>> growing. Even deleting the file before make still results in an ever
>> growing file.

You will have a size increase whenever you change package software 
versions and the resulting binary uses the full version string in its 
name. E.g. changing the kernel version will result in an additional 
directory in target/lib/modules.

If your image changes size by itself, maybe there is some process which 
leaves files behind in the target directory, for example a post-build 
script? In that case, check if file permissions allow unrestricted 
creation /deletion of files for your user id.

>> So I am wondering why it is happening and if there is any way to
>> prevent this without running make clean all or similar? Maybe some
>> kind of pre- or post-build scripts?
>> 
>> Thank you,
>> Andrey.

Kind regards,
Andreas



More information about the buildroot mailing list