From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 14 Aug 2023 18:36:56 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qVaYq-003z5o-O6 for lore@lore.pengutronix.de; Mon, 14 Aug 2023 18:36:56 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1qVaYo-0007OZ-Ts; Mon, 14 Aug 2023 18:36:54 +0200 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qVaYm-0007OL-KC; Mon, 14 Aug 2023 18:36:52 +0200 Received: from rsc by pty.hi.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1qVaYm-00CQko-5t; Mon, 14 Aug 2023 18:36:52 +0200 Date: Mon, 14 Aug 2023 18:36:52 +0200 From: Robert Schwebel To: Roland Hieber Message-ID: References: <20230623124755.2292833-1-rhi@pengutronix.de> <20230623124755.2292833-6-rhi@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230623124755.2292833-6-rhi@pengutronix.de> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain Subject: Re: [DistroKit] [PATCH 05/14] v7a: add RAUC support for qemu-vexpress X-BeenThere: distrokit@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: DistroKit Mailinglist List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: distrokit@pengutronix.de Sender: "DistroKit" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: distrokit-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false Applied to next. On Fri, Jun 23, 2023 at 02:47:46PM +0200, Roland Hieber wrote: > * Enable barebox bootchooser framework > * Add a redundant root partition to the genimage config. The current > size of the rootfs is below 98 MiB, so we can add a second root > partition to the image while keeping the overall image size the same. > * Add appropriate variables to the barebox defaultenv so the bootchooser > can decide into which partition to boot > * Use the already existing bootstate in the upstream barebox Device Tree > * Map partitions in rauc-udev compatibility layer > > Signed-off-by: Roland Hieber > --- > .../barebox-vexpress-defaultenv/init/bootsource | 2 +- > .../barebox-vexpress-defaultenv/nv/boot.default | 1 + > .../nv/bootchooser.state_prefix | 1 + > .../nv/bootchooser.system0.boot | 1 + > .../nv/bootchooser.system1.boot | 1 + > .../barebox-vexpress-defaultenv/nv/bootchooser.targets | 1 + > configs/platform-v7a/barebox-vexpress.config | 3 ++- > configs/platform-v7a/barebox-vexpress.config.diff | 2 ++ > configs/platform-v7a/config/images/vexpress.config | 7 ++++++- > projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules | 6 ++++++ > 10 files changed, 22 insertions(+), 3 deletions(-) > create mode 100644 configs/platform-v7a/barebox-vexpress-defaultenv/nv/boot.default > create mode 100644 configs/platform-v7a/barebox-vexpress-defaultenv/nv/bootchooser.state_prefix > create mode 100644 configs/platform-v7a/barebox-vexpress-defaultenv/nv/bootchooser.system0.boot > create mode 100644 configs/platform-v7a/barebox-vexpress-defaultenv/nv/bootchooser.system1.boot > create mode 100644 configs/platform-v7a/barebox-vexpress-defaultenv/nv/bootchooser.targets > > diff --git a/configs/platform-v7a/barebox-vexpress-defaultenv/init/bootsource b/configs/platform-v7a/barebox-vexpress-defaultenv/init/bootsource > index b42659c5e78b..4432e021fb0f 100644 > --- a/configs/platform-v7a/barebox-vexpress-defaultenv/init/bootsource > +++ b/configs/platform-v7a/barebox-vexpress-defaultenv/init/bootsource > @@ -4,4 +4,4 @@ if [ -n "$nv.boot.default" ]; then > exit > fi > > -global.boot.default="disk0.0 net" > +global.boot.default="bootchooser net" > diff --git a/configs/platform-v7a/barebox-vexpress-defaultenv/nv/boot.default b/configs/platform-v7a/barebox-vexpress-defaultenv/nv/boot.default > new file mode 100644 > index 000000000000..d7d9a373c50b > --- /dev/null > +++ b/configs/platform-v7a/barebox-vexpress-defaultenv/nv/boot.default > @@ -0,0 +1 @@ > +bootchooser net > diff --git a/configs/platform-v7a/barebox-vexpress-defaultenv/nv/bootchooser.state_prefix b/configs/platform-v7a/barebox-vexpress-defaultenv/nv/bootchooser.state_prefix > new file mode 100644 > index 000000000000..6246412a5c27 > --- /dev/null > +++ b/configs/platform-v7a/barebox-vexpress-defaultenv/nv/bootchooser.state_prefix > @@ -0,0 +1 @@ > +state.bootstate > diff --git a/configs/platform-v7a/barebox-vexpress-defaultenv/nv/bootchooser.system0.boot b/configs/platform-v7a/barebox-vexpress-defaultenv/nv/bootchooser.system0.boot > new file mode 100644 > index 000000000000..961e29fe981b > --- /dev/null > +++ b/configs/platform-v7a/barebox-vexpress-defaultenv/nv/bootchooser.system0.boot > @@ -0,0 +1 @@ > +disk0.0 > diff --git a/configs/platform-v7a/barebox-vexpress-defaultenv/nv/bootchooser.system1.boot b/configs/platform-v7a/barebox-vexpress-defaultenv/nv/bootchooser.system1.boot > new file mode 100644 > index 000000000000..5676f868b380 > --- /dev/null > +++ b/configs/platform-v7a/barebox-vexpress-defaultenv/nv/bootchooser.system1.boot > @@ -0,0 +1 @@ > +disk0.1 > diff --git a/configs/platform-v7a/barebox-vexpress-defaultenv/nv/bootchooser.targets b/configs/platform-v7a/barebox-vexpress-defaultenv/nv/bootchooser.targets > new file mode 100644 > index 000000000000..f0fb14eeaad2 > --- /dev/null > +++ b/configs/platform-v7a/barebox-vexpress-defaultenv/nv/bootchooser.targets > @@ -0,0 +1 @@ > +system0 system1 > diff --git a/configs/platform-v7a/barebox-vexpress.config b/configs/platform-v7a/barebox-vexpress.config > index de35478f9a91..433c73be691c 100644 > --- a/configs/platform-v7a/barebox-vexpress.config > +++ b/configs/platform-v7a/barebox-vexpress.config > @@ -188,7 +188,7 @@ CONFIG_BTHREAD=y > CONFIG_STATE=y > # CONFIG_STATE_CRYPTO is not set > # CONFIG_STATE_BACKWARD_COMPATIBLE is not set > -# CONFIG_BOOTCHOOSER is not set > +CONFIG_BOOTCHOOSER=y > CONFIG_RESET_SOURCE=y > # CONFIG_MACHINE_ID is not set > # CONFIG_SYSTEMD_OF_WATCHDOG is not set > @@ -278,6 +278,7 @@ CONFIG_CMD_GO=y > # CONFIG_CMD_LOADY is not set > CONFIG_CMD_RESET=y > CONFIG_CMD_UIMAGE=y > +CONFIG_CMD_BOOTCHOOSER=y > # end of Boot > > # > diff --git a/configs/platform-v7a/barebox-vexpress.config.diff b/configs/platform-v7a/barebox-vexpress.config.diff > index f50d7f0f1195..ff170d222b86 100644 > --- a/configs/platform-v7a/barebox-vexpress.config.diff > +++ b/configs/platform-v7a/barebox-vexpress.config.diff > @@ -8,8 +8,10 @@ CONFIG_ARCH_VEXPRESS=y > # CONFIG_ARM_SECURE_MONITOR is undefined > # CONFIG_ARM_SMCCC is undefined > # CONFIG_ARM_USE_COMPRESSED_DTB is undefined > +CONFIG_BOOTCHOOSER=y > # CONFIG_CFI_BUFFER_WRITE is not set > # CONFIG_CLOCKSOURCE_BCM283X is undefined > +CONFIG_CMD_BOOTCHOOSER=y > # CONFIG_CMD_GPIO is undefined > # CONFIG_CMD_SMC is undefined > CONFIG_CONSOLE_ACTIVATE_ALL=y > diff --git a/configs/platform-v7a/config/images/vexpress.config b/configs/platform-v7a/config/images/vexpress.config > index d51a58be2893..3aa64a4299ce 100644 > --- a/configs/platform-v7a/config/images/vexpress.config > +++ b/configs/platform-v7a/config/images/vexpress.config > @@ -6,7 +6,12 @@ image @IMAGE@ { > partition root-A { > image = root.ext2 > partition-type = 0x83 > - size = 192M > + size = 96M > + } > + partition root-B { > + image = root.ext2 > + partition-type = 0x83 > + size = 96M > } > partition data { > partition-type = 0x83 > diff --git a/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules b/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules > index c08f9b5633dc..64d30fb96c27 100644 > --- a/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules > +++ b/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules > @@ -8,6 +8,12 @@ IMPORT{program}="of_base_compatible" > > # Add symlinks named /dev/disk/by-usage/{data,rootfs0,rootfs1} pointing > # to the correct partitions based on the device tree compatible > +ENV{OF_BASE_COMPATIBLE}!="*arm,vexpress,v2p-ca9*", GOTO="qemu_vexpress_end" > +KERNEL=="mmcblk0p1", SYMLINK+="disk/by-usage/rootfs0" > +KERNEL=="mmcblk0p2", SYMLINK+="disk/by-usage/rootfs1" > +KERNEL=="mmcblk0p3", SYMLINK+="disk/by-usage/data" > +GOTO="rauc_partitions_end" > +LABEL="qemu_vexpress_end" > > # fallback for boards not yet supported by RAUC > KERNEL=="mmcblk0p3", SYMLINK+="disk/by-usage/data" > -- > 2.39.2 > > > -- Pengutronix e.K. | Dipl.-Ing. Robert Schwebel | Steuerwalder Str. 21 | https://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |