From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7054083982638448640 X-Received: by 2002:a17:907:d20:: with SMTP id gn32mr10014136ejc.55.1643435846913; Fri, 28 Jan 2022 21:57:26 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:906:5d05:: with SMTP id g5ls4800151ejt.1.gmail; Fri, 28 Jan 2022 21:57:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJzeVXBMZEfqjSxbSgfZ6WBLQhRbj6aw75igp52Oe90DkgdjbiDdZUH4T+8jNqLr6hRSMMgL X-Received: by 2002:a17:907:7da8:: with SMTP id oz40mr3428500ejc.328.1643435845903; Fri, 28 Jan 2022 21:57:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643435845; cv=none; d=google.com; s=arc-20160816; b=WhjwGapXDVaT21baDH4H9RSAObqDgpDoVtEGRyRn7Kz4M0mC+NcQmtmJYZtvzVtCAw cAhhLeQ6Gx1oa9qcbO2goWhyGpu1ZvdL29JXDDer6vg9LEDvtBi4Xy7YH7Myy+bTia3v ES4OVV46CLEpNgVLPV2STGP6hL703h2QUY46+d5LJLKp2z5KujXSRDJH8hKorqlqLWNo uhoE7CACRvhi/nJ8/OPCNyfBzU1h3kK77K0VSS8UowyJqibmfLtPLXT2Wwmupaeo/TpK CAz186msdoQ8lHnQmDmm0kqi5rWYrum/5gMGnezCtZbDrXXTd5OaMqepAqFo5jSfvFRi Q9wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=wdzqU0rbEp/w2wVCVMib/5qbiVMjLYYEqefP1z9/W9g=; b=Rii1zA0xgPDD1dN2LGrKbZkqHVD574xdN0YTG/WBf96Zy4yBTXuayBfl7SX12SfHGg psXV7S1ovnEwPyId5Uhv5FT/L4gNtMgjKm2YV6DdbOqnf5uEtimcH/TYXvhJfoWFRRMq LsUk5u1NWIKKDruqSIsexPTi7sSw+XigD++E0CfetmHtzjqXaLTMVtWNzTzg8zPdJ+yi XigplNkAUUCdfayvI7PnLowFcSn57QNCBJ+mY84ptX8SM+FB4Pib4TtYXt9yztewSQXz kVLRJRwJiaPSVUqP/wUpzOQgJPMsXOuSS8nLgdIlgybUsXfj/EkxgWHeV8LYeiI4ElLx gyiw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id by9si289824ejb.0.2022.01.28.21.57.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Jan 2022 21:57:25 -0800 (PST) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from home.localnet (44-208-124-178-static.mgts.by [178.124.208.44] (may be forged)) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPSA id 20T5vOeR003963 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 29 Jan 2022 06:57:25 +0100 From: Uladzimir Bely To: Henning Schild Cc: isar-users@googlegroups.com Subject: Re: [PATCH v3 4/6] raspios: resize rootfs on first boot Date: Sat, 29 Jan 2022 08:57:22 +0300 Message-ID: <5979202.eO5KgaWL5Y@home> In-Reply-To: <20220128221343.2fabfdce@md1za8fc.ad001.siemens.net> References: <20220119065902.13514-1-ubely@ilbers.de> <20220119065902.13514-5-ubely@ilbers.de> <20220128221343.2fabfdce@md1za8fc.ad001.siemens.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: bs9tBuXIK7Rw In the email from =D1=81=D1=83=D0=B1=D0=B1=D0=BE=D1=82=D0=B0, 29 =D1=8F=D0= =BD=D0=B2=D0=B0=D1=80=D1=8F 2022 =D0=B3. 00:13:43 +03 user Henning Schild=20 wrote: > Hi, >=20 > why did you not use or extend recipes-support/expand-on-first-boot ? >=20 > Henning >=20 Hello. I tried to follow the approach raspios uses. First boot expansion is done t= his=20 way in official distribution, so I just ported this part. But you are right, while we have our own implementation (I just forgot abou= t=20 it), it is worth using it. I've just tried to revert this commit and enable `expand-on-first-boot` rec= ipe=20 in local.conf - and it seems to be working. After first boot `df` shows tha= t=20 2nd partition is expanded ant all free space is available. Also, 'raspi-config' utility (that allows to expand partition manually)=20 remains working. So, even if user doesn't enable this recipe, they still ca= n=20 do it via this utility. So, it seems, we can remove this commit in favour of the existing recipe an= d=20 it doesn't bring any problems. By the way, `expand-on-first-boot` recipe looks like something that is not= =20 tested at all. None of machine uses it by default, and it's not included to= =20 local.conf. Probably, that's why I didn't recall it while porting RPi. Why not enable it at least for RPi targets? > Am Wed, 19 Jan 2022 07:59:00 +0100 >=20 > schrieb Uladzimir Bely : > > Initially, after rpi-sdimg is created, a quite small rootfs partition > > is created. After boot, there is almost no free space. > >=20 > > This patch uses scripts (idea is taken from official raspbian distro) > > that make rootfs partition expanded at first boot. > >=20 > > Signed-off-by: Uladzimir Bely > > --- > >=20 > > meta-isar/conf/distro/raspios-configscript.sh | 23 > >=20 > > ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) > >=20 > > 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 > >=20 > > cat > /boot/cmdline.txt << EOF > > console=3D${MACHINE_SERIAL},${BAUDRATE_TTY} console=3Dtty1 \ > > root=3D/dev/mmcblk0p2 rootfstype=3Dext4 fsck.repair=3Dyes \ > >=20 > > -rootwait quiet > > +rootwait quiet init=3D/usr/lib/raspi-config/init_resize.sh > >=20 > > EOF > > =20 > > cat > /etc/fstab << EOF > >=20 > > @@ -27,3 +27,24 @@ proc /proc proc defaults > >=20 > > 0 0 /dev/mmcblk0p1 /boot vfat defaults > > =20 > > 0 2 /dev/mmcblk0p2 / ext4 > >=20 > > 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=3D\$(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