Yocto(Bitbake) 调整rootfs的可用空间(剩余空间)

How do I create images with more free space?

在使用yocto编译时,生成的rootfs容量一直保持一定比例,如果想向系统中多导入一些文件,就会提示容量不足。

cp: write error: No space left on device

使用df指令查看,如下:

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mmcblk3          608616    478472     130144 84% /
 

查看了yocto官方网站,对于rootfs可用容量是有限制的,默认生成rootfs的1.3倍,相关的调整说明如下:

IMAGE_OVERHEAD_FACTOR

Defines a multiplier that the build system applies to the initial image size for cases when the multiplier times the returned disk usage value for the image is greater than the sum of IMAGE_ROOTFS_SIZE and IMAGE_ROOTFS_EXTRA_SPACE. The result of the multiplier applied to the initial image size creates free disk space in the image as overhead. By default, the build process uses a multiplier of 1.3 for this variable. This default value results in 30% free disk space added to the image when this method is used to determine the final generated image size. You should be aware that post install scripts and the package management system uses disk space inside this overhead area. Consequently, the multiplier does not produce an image with all the theoretical free disk space. See IMAGE_ROOTFS_SIZE for information on how the build system determines the overall image size.

The default 30% free disk space typically gives the image enough room to boot and allows for basic post installs while still leaving a small amount of free disk space. If 30% free space is inadequate, you can increase the default value. For example, the following setting gives you 50% free space added to the image:

     IMAGE_OVERHEAD_FACTOR = "1.5"
                    

Alternatively, you can ensure a specific amount of free disk space is added to the image by using the IMAGE_ROOTFS_EXTRA_SPACE variable.

 

以上,备忘。

你可能感兴趣的:(Yocto笔记,linux)