Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Benoît Thébaudeau" <benoit@wsystem.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 4/4] board/raspberrypi: auto-expand rootfs on first boot
Date: Mon, 31 Aug 2015 11:11:01 +0200	[thread overview]
Message-ID: <55E41A25.9020303@wsystem.com> (raw)
In-Reply-To: <4057940.fE2DsQZqLb@sagittea>

Hello J?r?me,

On 31/08/2015 10:51, J?r?me Pouiller wrote:
> On Saturday 22 August 2015 22:01:28 Beno?t Th?baudeau wrote:
>> Add init scripts to auto-expand the persistent rootfs on the first boot
>> to fill the medium.
>>
>> These scripts follow the same procedure as raspi-config. The root
>> partition is first expanded, then a reboot is required, then the rootfs
>> is expanded. Each script removes itself once run.
> [..]
>> diff --git a/board/raspberrypi/readme.txt b/board/raspberrypi/readme.txt
>> index d63e71e..7ee783b 100644
>> --- a/board/raspberrypi/readme.txt
>> +++ b/board/raspberrypi/readme.txt
>> @@ -34,10 +34,13 @@ And for model 2 B:
>>    $ make raspberrypi2_defconfig
>>
>>  If you want to use a persistent rootfs, the generated ext4 rootfs image
>> fits its -contents with only a small (but sensible) margin of free space by
>> default, so -you might want to adjust "Filesystem images"/"ext2/3/4 root
>> filesystem"/ -"size in blocks (leave at 0 for auto calculation)" depending
>> on your needs, then -skip to "Build the rootfs", below.
>> +contents with only a small (but sensible) margin of free space by default,
>> but +it is auto-expanded on the first boot to fill the medium. You can
>> however adjust +"Filesystem images"/"ext2/3/4 root filesystem"/
>> +"size in blocks (leave at 0 for auto calculation)" to fit your needs. The
>> +auto-expansion is controlled by
>> +board/raspberrypi/rootfs-overlay/etc/init.d/S*expand-root*. Skip to
>> +"Build the rootfs", below.
> Isn't safer to auto-expand partition while flashing SD Card instead of doing 
> it online?
> 
> Maybe you can explain how to resize partition in README or provide a script 
> like the one I sent you a few days ago (named sdflash.sh), no?

It would be safer if users pull the power plug during the few seconds that the
expansion lasts, without looking at their console output, which is not a big
risk. Doing it while flashing the SD card would have a major limitation: it
prevents the publication of an autonomous image file that you can program by any
means to get the same result.

Resizing a partition on a PC is trivial if the image is programmed first. There
are plenty of tools like gparted and tutorials for that on the web, so I don't
think adding such information to the readme.txt would be worth it.

Regarding a script writing the SD card and auto-expanding the rootfs, it might
be useful. Since it would require superuser rights, it should not be added to
the post-image scripts, but launched manually. That would give users a choice.
This script would just write the generated image file, auto-expand the rootfs
and remove the auto-expansion scripts from the rootfs. I'll look into it.

Best regards,
Beno?t

  parent reply	other threads:[~2015-08-31  9:11 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-19 22:23 [Buildroot] rpi: image generation Benoît Thébaudeau
2015-08-20  7:59 ` Thomas Petazzoni
2015-08-20 14:30   ` Vivien Didelot
2015-08-22 20:01     ` [Buildroot] [PATCH 1/4] configs/raspberrypi: use EABIhf Benoît Thébaudeau
2015-08-22 20:01       ` [Buildroot] [PATCH 2/4] board/raspberrypi: prepare the image files for the target Benoît Thébaudeau
2015-10-17 11:45         ` Yann E. MORIN
2015-10-17 13:52           ` Benoît Thébaudeau
2015-08-22 20:01       ` [Buildroot] [PATCH 3/4] board/raspberrypi: generate a medium image Benoît Thébaudeau
2015-08-22 20:01       ` [Buildroot] [PATCH 4/4] board/raspberrypi: auto-expand rootfs on first boot Benoît Thébaudeau
2015-08-27  9:02         ` Benoît Thébaudeau
2015-08-27 21:22           ` Jérôme Pouiller
2015-08-28 10:36             ` Benoît Thébaudeau
2015-08-28 11:15               ` Benoît Thébaudeau
     [not found]         ` <4057940.fE2DsQZqLb@sagittea>
2015-08-31  9:11           ` Benoît Thébaudeau [this message]
2015-08-31 12:17         ` Floris Bos
2015-08-31 18:53           ` Benoît Thébaudeau
2015-08-31 13:25         ` Floris Bos
2015-08-31 19:05           ` Benoît Thébaudeau
2015-10-12 21:59       ` [Buildroot] [PATCH 1/4] configs/raspberrypi: use EABIhf Thomas Petazzoni
2015-10-12 23:17         ` Benoît Thébaudeau
2015-10-13  7:06           ` Arnout Vandecappelle
2015-10-15 20:11         ` Peter Korsgaard
2015-10-15 21:12           ` Peter Korsgaard
2015-10-25 15:19           ` [Buildroot] [PATCH] arch/arm: use EABIhf by default with VFP Benoît Thébaudeau
2015-10-25 18:53             ` Peter Korsgaard
2015-10-26  0:32               ` Thomas Petazzoni
2015-10-26  7:47                 ` Peter Korsgaard
2015-10-26  8:25                   ` Thomas Petazzoni
2015-10-26  8:51                     ` Peter Korsgaard
2015-10-25 18:55             ` Peter Korsgaard
2015-10-25 20:27               ` Benoît Thébaudeau
2015-10-25 20:40                 ` Peter Korsgaard
2015-10-25 20:52                   ` Benoît Thébaudeau
2015-10-25 21:30                     ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55E41A25.9020303@wsystem.com \
    --to=benoit@wsystem.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox