All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Is there a way to automatically detect the minimum required BR2_TARGET_ROOTFS_EXT2_SIZE?
@ 2018-03-10 16:14 Ciro Santilli
  2018-03-10 20:58 ` Yann E. MORIN
  0 siblings, 1 reply; 4+ messages in thread
From: Ciro Santilli @ 2018-03-10 16:14 UTC (permalink / raw)
  To: buildroot

https://stackoverflow.com/questions/49211241/is-there-a-way-to-automatically-detect-the-minimum-required-br2-target-rootfs-ex

I'm when making a big non-embedded image, 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:

* put the big stuff under 9p:
https://superuser.com/questions/628169/how-to-share-a-directory-with-the-host-without-networking-in-qemu
* use CPIO and `-initrd`

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] Is there a way to automatically detect the minimum required BR2_TARGET_ROOTFS_EXT2_SIZE?
  2018-03-10 16:14 [Buildroot] Is there a way to automatically detect the minimum required BR2_TARGET_ROOTFS_EXT2_SIZE? Ciro Santilli
@ 2018-03-10 20:58 ` Yann E. MORIN
  2018-03-11  9:57   ` Ciro Santilli
  0 siblings, 1 reply; 4+ messages in thread
From: Yann E. MORIN @ 2018-03-10 20:58 UTC (permalink / raw)
  To: buildroot

Ciro, All,

On 2018-03-10 16:14 +0000, Ciro Santilli spake thusly:
> https://stackoverflow.com/questions/49211241/is-there-a-way-to-automatically-detect-the-minimum-required-br2-target-rootfs-ex
> 
> I'm when making a big non-embedded image, 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?

No, becaaue it is not reliable, see commit:

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

In the end, it does nto 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.

Regards,
Yann E. MORIN.

> Some workarounds I'm considering:
> 
> * put the big stuff under 9p:
> https://superuser.com/questions/628169/how-to-share-a-directory-with-the-host-without-networking-in-qemu
> * use CPIO and `-initrd`
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] Is there a way to automatically detect the minimum required BR2_TARGET_ROOTFS_EXT2_SIZE?
  2018-03-10 20:58 ` Yann E. MORIN
@ 2018-03-11  9:57   ` Ciro Santilli
  2018-03-12 17:24     ` Trent Piepho
  0 siblings, 1 reply; 4+ messages in thread
From: Ciro Santilli @ 2018-03-11  9:57 UTC (permalink / raw)
  To: buildroot

On Sat, Mar 10, 2018 at 8:58 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> Ciro, All,
>
> On 2018-03-10 16:14 +0000, Ciro Santilli spake thusly:
>> https://stackoverflow.com/questions/49211241/is-there-a-way-to-automatically-detect-the-minimum-required-br2-target-rootfs-ex
>>
>> I'm when making a big non-embedded image, 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?
>
> No, becaaue it is not reliable, see commit:
>
>     c6bca8cef fs/ext2: Remove support for auto-calculation of rootfs size
>
> In the end, it does nto 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.
>

Thanks for the info.

I'm considering using Buildroot to get clean neat images for emulation
applications (like learn Linux kernel, benchmark some stuff on gem5),
but since it is not possible to do it reliably, I will use another
method instead of ext2 images.

> Regards,
> Yann E. MORIN.
>
>> Some workarounds I'm considering:
>>
>> * put the big stuff under 9p:
>> https://superuser.com/questions/628169/how-to-share-a-directory-with-the-host-without-networking-in-qemu
>> * use CPIO and `-initrd`
>> _______________________________________________
>> buildroot mailing list
>> buildroot at busybox.net
>> http://lists.busybox.net/mailman/listinfo/buildroot
>
> --
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
> | +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
> '------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] Is there a way to automatically detect the minimum required BR2_TARGET_ROOTFS_EXT2_SIZE?
  2018-03-11  9:57   ` Ciro Santilli
@ 2018-03-12 17:24     ` Trent Piepho
  0 siblings, 0 replies; 4+ messages in thread
From: Trent Piepho @ 2018-03-12 17:24 UTC (permalink / raw)
  To: buildroot

On Sun, 2018-03-11 at 09:57 +0000, Ciro Santilli wrote:
> On Sat, Mar 10, 2018 at 8:58 PM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> > Ciro, All,
> > 
> > On 2018-03-10 16:14 +0000, Ciro Santilli spake thusly:
> > > https://stackoverflow.com/questions/49211241/is-there-a-way-to-automatically-detect-the-minimum-required-br2-target-rootfs-ex
> > > 
> > > I'm when making a big non-embedded image, 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?
> > 
> > No, becaaue it is not reliable, see commit:
> > 
> >     c6bca8cef fs/ext2: Remove support for auto-calculation of rootfs size
> > 
> > In the end, it does nto 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.

The code that buildroot was using the guess the size was pretty simple.
 If you are willing to attempt more complex designs, it is possible to
be a lot more reliable. At least ext2 based filesystems.  Something
like reiserfs that merged tails would be pretty hard.

Another way to get a minimal ext2 image is to converge on the necessary
size by repeatedly generating the fs.  Since you can get the number of
free blocks, it's possible to arrive at the exact minimum after 2 or 3
iterations.

Since the advent of initramfs and it replacing ext2 ramdisk images,
this isn't as useful.  If you need to make the fs as small as possible,
use initramfs or squashfs.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-12 17:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-10 16:14 [Buildroot] Is there a way to automatically detect the minimum required BR2_TARGET_ROOTFS_EXT2_SIZE? Ciro Santilli
2018-03-10 20:58 ` Yann E. MORIN
2018-03-11  9:57   ` Ciro Santilli
2018-03-12 17:24     ` Trent Piepho

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.