All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] How do I create a compressed buildroot system image that expands to fill the available storage of the media it is flashed to?
@ 2020-09-06  3:38 Noah Cain
  0 siblings, 0 replies; 2+ messages in thread
From: Noah Cain @ 2020-09-06  3:38 UTC (permalink / raw)
  To: buildroot

Hi!  I need to make a Buildroot system for various x86_64 EFI systems with
varying storage sizes, but unfortunately, the pc_x86_64_efi_defconfig
config creates an IMG file with a fixed partition size, not one that
expands to the full size of the media it is flashed to. If I want it to
fill the various drives, I need to manually specify the size of each drive
in the filesystem config, and then recompile, which is a major pain and
ends up making a massive 128GB+ image file. I tried causing it to resize
from within the running system using resize2fs, but that did not work.
Ideally, I would like it to either expand to the full size of the drive
when it is flashed or to have it resize when it first boots. Is this
possible, or is it outside the limits of Buildroot?

Thanks for your help, Noah Cain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20200905/3e8e7252/attachment.html>

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

* [Buildroot] How do I create a compressed buildroot system image that expands to fill the available storage of the media it is flashed to?
       [not found] <mailman.2604.1599383993.89434.buildroot@busybox.net>
@ 2020-09-12  4:58 ` Andreas Ziegler
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Ziegler @ 2020-09-12  4:58 UTC (permalink / raw)
  To: buildroot

Hi Noah,

> Hi!  I need to make a Buildroot system for various x86_64 EFI systems 
> with
> varying storage sizes, but unfortunately, the pc_x86_64_efi_defconfig
> config creates an IMG file with a fixed partition size, not one that
> expands to the full size of the media it is flashed to. If I want it to
> fill the various drives, I need to manually specify the size of each 
> drive
> in the filesystem config, and then recompile, which is a major pain and
> ends up making a massive 128GB+ image file. I tried causing it to 
> resize
> from within the running system using resize2fs, but that did not work.
> Ideally, I would like it to either expand to the full size of the drive
> when it is flashed or to have it resize when it first boots. Is this
> possible, or is it outside the limits of Buildroot?

You could use parted to increase the partition size, afterwards 
resize2fs to extend the file system. The partition must not be in use.

The "self-expansion" mechanism observed in some distributions uses a 
script early during boot.

This is how Raspian handles the resize: 
https://salsa.debian.org/raspi-team/image-specs/-/blob/master/rootfs/usr/sbin/rpi-resizerootfs

Before systemd, this used to be wrapped in a link in init.d which was 
deleted after successful execution; now the logic is contained in the 
systemd configuration.

Regards,
Andreas

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

end of thread, other threads:[~2020-09-12  4:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-06  3:38 [Buildroot] How do I create a compressed buildroot system image that expands to fill the available storage of the media it is flashed to? Noah Cain
     [not found] <mailman.2604.1599383993.89434.buildroot@busybox.net>
2020-09-12  4:58 ` Andreas Ziegler

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.