0

I'm making a "big" non-embedded image intended for simulation instead of real devices, and I keep hitting the error:

*** Maybe you need to increase the filesystem size (BR2_TARGET_ROOTFS_EXT2_SIZE)                         

and then I have to do a du on output/target to find out how big I have to make BR2_TARGET_ROOTFS_EXT2_SIZE.

Is there a way to automate this, or a decent workaround?

Some workarounds I'm considering:

http://lists.busybox.net/pipermail/buildroot/2018-March/215622.html

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985

1 Answers1

2

http://lists.busybox.net/pipermail/buildroot/2018-March/215636.html says that:

No, becaaue it is not reliable, see commit:

c6bca8cef fs/ext2: Remove support for auto-calculation of rootfs size

In the end, it does not make sense to do auto-calculation, because on an embedded device, you have to now the layout and size of your storage. So, you know what size you want your ext filesystem to be.

So it is fundamentally not possible / worth for Buildroot to do it reliably.

https://github.com/buildroot/buildroot/commit/c6bca8cef0310bc649240b451989457ce94a8358

I have then searched a bit further, and came across: https://unix.stackexchange.com/questions/353156/how-to-calculate-the-correct-size-of-a-loopback-device-filesystem-image-for-debo which suggests resize2fs -M + sparse files might be a possibility.

libguestfs can also minimize image sizes automatically as demonstrated at https://serverfault.com/questions/246835/convert-directory-to-qemu-kvm-virtual-disk-image/916697#916697 and is exposes a vfs-minimum-size function: http://libguestfs.org/guestfish.1.html#vfs-minimum-size

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985