public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: Uladzimir Bely <ubely@ilbers.de>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH v3 4/6] raspios: resize rootfs on first boot
Date: Mon, 31 Jan 2022 08:43:47 +0100	[thread overview]
Message-ID: <20220131084347.469b5159@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <5979202.eO5KgaWL5Y@home>

Am Sat, 29 Jan 2022 08:57:22 +0300
schrieb Uladzimir Bely <ubely@ilbers.de>:

> In the email from суббота, 29 января 2022 г. 00:13:43 +03 user
> Henning Schild wrote:
> > Hi,
> > 
> > why did you not use or extend recipes-support/expand-on-first-boot ?
> > 
> > Henning
> >   
> Hello.
> 
> I tried to follow the approach raspios uses. First boot expansion is
> done this way in official distribution, so I just ported this part.

In fact the recipe is heavily inspired by raspi, IIRC.

> But you are right, while we have our own implementation (I just
> forgot about it), it is worth using it.
> 
> I've just tried to revert this commit and enable
> `expand-on-first-boot` recipe in local.conf - and it seems to be
> working. After first boot `df` shows that 2nd partition is expanded
> ant all free space is available.
> 
> Also, 'raspi-config' utility (that allows to expand partition
> manually) remains working. So, even if user doesn't enable this
> recipe, they still can do it via this utility.
> 
> So, it seems, we can remove this commit in favour of the existing
> recipe and it doesn't bring any problems.

I guess that would be the way to go. Unless we can find the original in
any real package. But smuggling things in not using a package is not
the best style ... might also be the style that raspi uses to build
their images.

> By the way, `expand-on-first-boot` recipe looks like something that
> is not tested at all. None of machine uses it by default, and it's
> not included to local.conf. Probably, that's why I didn't recall it
> while porting RPi.

It is tested/used in many layers, some i know even extend it for other
filesystems. But yes it should be tested in isar, given it has been
upstreamed into isar by someone.

> Why not enable it at least for RPi targets?

Sounds like a very good idea. Maybe even with a testcase to check "df"
and that "raspi-config" remains working.

regards,
Henning

> > Am Wed, 19 Jan 2022 07:59:00 +0100
> > 
> > schrieb Uladzimir Bely <ubely@ilbers.de>:  
> > > Initially, after rpi-sdimg is created, a quite small rootfs
> > > partition is created. After boot, there is almost no free space.
> > > 
> > > This patch uses scripts (idea is taken from official raspbian
> > > distro) that make rootfs partition expanded at first boot.
> > > 
> > > Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> > > ---
> > > 
> > >  meta-isar/conf/distro/raspios-configscript.sh | 23
> > > 
> > > ++++++++++++++++++- 1 file changed, 22 insertions(+), 1
> > > deletion(-)
> > > 
> > > diff --git a/meta-isar/conf/distro/raspios-configscript.sh
> > > b/meta-isar/conf/distro/raspios-configscript.sh index
> > > 6120a379..9a7c43e6 100644 ---
> > > a/meta-isar/conf/distro/raspios-configscript.sh +++
> > > b/meta-isar/conf/distro/raspios-configscript.sh @@ -19,7 +19,7 @@
> > > EOF
> > > 
> > >  cat > /boot/cmdline.txt << EOF
> > >  console=${MACHINE_SERIAL},${BAUDRATE_TTY} console=tty1 \
> > >  root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes \
> > > 
> > > -rootwait quiet
> > > +rootwait quiet init=/usr/lib/raspi-config/init_resize.sh
> > > 
> > >  EOF
> > >  
> > >  cat > /etc/fstab << EOF
> > > 
> > > @@ -27,3 +27,24 @@ proc            /proc           proc
> > > defaults
> > > 
> > >        0       0 /dev/mmcblk0p1  /boot           vfat    defaults
> > >      
> > >      0       2 /dev/mmcblk0p2  /               ext4
> > > 
> > > defaults,noatime  0       1 EOF
> > > +
> > > +cat > /etc/init.d/resize2fs_once << EOF
> > > +#!/bin/sh
> > > +. /lib/lsb/init-functions
> > > +case "\$1" in
> > > +  start)
> > > +    log_daemon_msg "Starting resize2fs_once"
> > > +    ROOT_DEV=\$(findmnt / -o source -n) &&
> > > +    resize2fs \$ROOT_DEV &&
> > > +    update-rc.d resize2fs_once remove &&
> > > +    rm /etc/init.d/resize2fs_once &&
> > > +    log_end_msg \$?
> > > +    ;;
> > > +  *)
> > > +    echo "Usage: \$0 start" >&2
> > > +    exit 3
> > > +    ;;
> > > +esac
> > > +EOF
> > > +chmod +x /etc/init.d/resize2fs_once
> > > +ln -s ../init.d/resize2fs_once /etc/rc3.d/S01resize2fs_once  
> 
> 
> 
> 


  reply	other threads:[~2022-01-31  7:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19  6:58 [PATCH v3 0/6] Update rpi targets to bullseye Uladzimir Bely
2022-01-19  6:58 ` [PATCH v3 1/6] linux: Allow to use custom packages for linux headers and image Uladzimir Bely
2022-01-19  6:58 ` [PATCH v3 2/6] rpi-sdimage: Change deployed image name Uladzimir Bely
2022-01-19  6:58 ` [PATCH v3 3/6] rpi: Added raspios-bullseye configs Uladzimir Bely
2022-01-19  6:59 ` [PATCH v3 4/6] raspios: resize rootfs on first boot Uladzimir Bely
2022-01-28 21:13   ` Henning Schild
2022-01-29  5:57     ` Uladzimir Bely
2022-01-31  7:43       ` Henning Schild [this message]
2022-01-19  6:59 ` [PATCH v3 5/6] CI: Switch rpi targets to bullseye Uladzimir Bely
2022-01-19  6:59 ` [PATCH v3 6/6] doc: Add notes about raspios-bullseye Uladzimir Bely
2022-01-27 15:01 ` [PATCH v3 0/6] Update rpi targets to bullseye Anton Mikanovich

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=20220131084347.469b5159@md1za8fc.ad001.siemens.net \
    --to=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=ubely@ilbers.de \
    /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