DistroKit Mailinglist
 help / color / mirror / Atom feed
* [DistroKit] [PATCH v2 00/14] v7a: add redundant update support via RAUC
@ 2023-04-26 20:14 Roland Hieber
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 01/14] platforms: revert to default systemd loglevel Roland Hieber
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: Roland Hieber @ 2023-04-26 20:14 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

With this patch series, the first v7a platforms (beaglebone black,
riotboard, rpi3, qemu-vexpress) gain support for redundant boot on two
root partitions which can be updated with RAUC.

Changelog:

v1 -> v2:
* rebase to current master (PTXdist 2023.04.0)
* new patch: "platforms: revert to default systemd loglevel"
* new patch: "ptxconfig: enable more tools for debugging" (which also
  enables curl, which was previously in the patch enabling RAUC)
* make use of barebox's CONFIG_EXTERNAL_DTS_FRAGMENTS to include a DTS
  fragment for the state variables and the board-specific backends
  instead of patching them into the barebox device trees
  (feedback by Ahmad Fatoum)
* udev: use tr instead of xargs/printf in of_base_compatible
  (feedback by Michael Olbrich)
* udev: add a fallback /dev/disk/by-usage/data symlink for boards not
  targeted by this series
* udev: add missing 'GOTO="rauc_partitions_end"' at the end of each
  block so that the symlink settings are not overwritten by the
  following blocks
* udev: fix partition mapping for RIoTBoard; for some reason the SD card
  is now /dev/mmcblk2 instead of /dev/mmcblk0
* kernel:
  * enable network block device support (BLK_DEV_NBD), needed for RAUC
    HTTPS streaming
  * enable SQUASHFS_FILE_DIRECT and SQUASHFS_DECOMP_MULTI for better
    performance (feedback by Jan Lübbe)
  * enable SQUASHFS_LZ4, SQUASHFS_XZ and SQUASHFS_ZSTD which makes it
    easy to change the bundle compression later. Currently, genimage
    generates zlib-compressed bundles. (feedback by Jan Lübbe)
* rauc: only allow installing verity bundles (feedback by Jan Lübbe)
* new patch: "image-rauc: fork config from PTXdist 2023.04.0"
* new patch: "image-rauc: use ext4 rootfs instead of tar.gz"
  (I discussed with Enrico and Jan offline whether it is useful to have
  this change in upstream PTXdist, but the RAUC image config will be
  rather specific to the BSP anyway, and will be forked to the BSP by
  most users.)
* new patch: "v7a: run: start with barebox by default"

The datapartition clean-up didn't make it yet in this series. RAUC works
without it, and I'll send a separate series once I've figured it out.

Also I disregarded Marco's comment about moving the projectroot stuff
to config/platform-v7a/, since it's not really v7a-specific and can be
re-used on other platforms too when those want to gain RAUC support.

Roland Hieber (14):
  platforms: revert to default systemd loglevel
  ptxconfig: enable more tools for debugging
  rauc-udev: add a compatibility layer for mapping partitions
  v7a: barebox: include generic bootstate node in device tree
  v7a: add RAUC support for qemu-vexpress
  v7a: add RAUC support for beaglebone black
  v7a: add RAUC support for rpi3
  v7a: add RAUC support for riotboard
  v7a: kernel: enable features necessary for RAUC
  rauc: add initial support
  v7a: enable RAUC bundle creation
  image-rauc: fork config from PTXdist 2023.04.0
  image-rauc: use ext4 rootfs instead of tar.gz
  v7a: run: start with barebox by default

 config/images/rauc.config                     |  22 +++
 configs/platform-mips/platformconfig          |  20 ++-
 configs/platform-mips/run                     |   2 +-
 configs/platform-mipsel/platformconfig        |  20 ++-
 configs/platform-rpi1/platformconfig          |  18 ++-
 .../barebox-am335x-defaultenv/init/bootsource |   4 +-
 .../barebox-am335x-defaultenv/nv/boot.default |   1 +
 .../nv/bootchooser.state_prefix               |   1 +
 .../nv/bootchooser.system0.boot               |   1 +
 .../nv/bootchooser.system1.boot               |   1 +
 .../nv/bootchooser.targets                    |   1 +
 .../nv/linux.bootargs.loglevel                |   2 +-
 configs/platform-v7a/barebox-am335x.config    |   5 +-
 .../platform-v7a/barebox-am335x.config.diff   |   4 +-
 configs/platform-v7a/barebox-at91.config      |   2 +-
 configs/platform-v7a/barebox-at91.config.diff |   2 +-
 .../barebox-mx6-defaultenv/init/bootsource    |   6 +-
 .../barebox-mx6-defaultenv/nv/boot.default    |   1 +
 .../nv/bootchooser.state_prefix               |   1 +
 .../nv/bootchooser.system0.boot               |   1 +
 .../nv/bootchooser.system1.boot               |   1 +
 .../nv/bootchooser.targets                    |   1 +
 .../nv/linux.bootargs.loglevel                |   2 +-
 configs/platform-v7a/barebox-mx6.config       |   5 +-
 configs/platform-v7a/barebox-mx6.config.diff  |   4 +-
 .../barebox-rpi2-defaultenv/init/bootsource   |   5 +-
 .../barebox-rpi2-defaultenv/nv/boot.default   |   1 +
 .../nv/bootchooser.state_prefix               |   1 +
 .../nv/bootchooser.system0.boot               |   1 +
 .../nv/bootchooser.system1.boot               |   1 +
 .../nv/bootchooser.targets                    |   1 +
 .../nv/linux.bootargs.loglevel                |   2 +-
 configs/platform-v7a/barebox-rpi2.config      |   5 +-
 configs/platform-v7a/barebox-rpi2.config.diff |   4 +-
 .../nv/linux.bootargs.loglevel                |   2 +-
 configs/platform-v7a/barebox-stm32mp.config   |   2 +-
 .../platform-v7a/barebox-stm32mp.config.diff  |   2 +-
 .../init/bootsource                           |   2 +-
 .../nv/boot.default                           |   1 +
 .../nv/bootchooser.state_prefix               |   1 +
 .../nv/bootchooser.system0.boot               |   1 +
 .../nv/bootchooser.system1.boot               |   1 +
 .../nv/bootchooser.targets                    |   1 +
 .../nv/linux.bootargs.loglevel                |   2 +-
 configs/platform-v7a/barebox-vexpress.config  |   5 +-
 .../platform-v7a/barebox-vexpress.config.diff |   4 +-
 configs/platform-v7a/barebox.config           |   2 +-
 .../config/images/beaglebone.config           |   4 +
 .../config/images/riotboard.config            |   6 +
 .../platform-v7a/config/images/rpi2.config    |   5 +
 .../config/images/vexpress.config             |   7 +-
 configs/platform-v7a/dts/bootstate.dtsi       | 153 ++++++++++++++++++
 configs/platform-v7a/kernelconfig             |  70 +++++++-
 configs/platform-v7a/platformconfig           |  30 +++-
 configs/platform-v7a/run                      |   4 +-
 configs/platform-v7a/run-nfs                  |   2 +-
 .../nv/linux.bootargs.loglevel                |   2 +-
 configs/platform-v7a_noneon/platformconfig    |  20 ++-
 configs/platform-v7a_noneon/run               |   2 +-
 configs/platform-v7a_noneon/run-nfs           |   2 +-
 .../nv/linux.bootargs.loglevel                |   2 +-
 .../nv/linux.bootargs.loglevel                |   2 +-
 configs/platform-v8a/platformconfig           |  19 ++-
 configs/platform-x86_64/platformconfig        |  20 ++-
 configs/platform-x86_64/run                   |   2 +-
 configs/ptxconfig                             | 131 ++++++++++++---
 platforms/image-rauc.in                       |   6 +
 projectroot/etc/rauc/system.conf              |  17 ++
 .../lib/systemd/system/rauc-mark-good.service |  14 ++
 projectroot/usr/lib/udev/of_base_compatible   |   4 +
 .../lib/udev/rules.d/90-rauc-partitions.rules |  42 +++++
 rules/rauc-udev.in                            |  10 ++
 rules/rauc-udev.make                          |  37 +++++
 73 files changed, 714 insertions(+), 74 deletions(-)
 create mode 100644 config/images/rauc.config
 create mode 100644 configs/platform-v7a/barebox-am335x-defaultenv/nv/boot.default
 create mode 100644 configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.state_prefix
 create mode 100644 configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.system0.boot
 create mode 100644 configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.system1.boot
 create mode 100644 configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.targets
 create mode 100644 configs/platform-v7a/barebox-mx6-defaultenv/nv/boot.default
 create mode 100644 configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.state_prefix
 create mode 100644 configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.system0.boot
 create mode 100644 configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.system1.boot
 create mode 100644 configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.targets
 create mode 100644 configs/platform-v7a/barebox-rpi2-defaultenv/nv/boot.default
 create mode 100644 configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.state_prefix
 create mode 100644 configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.system0.boot
 create mode 100644 configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.system1.boot
 create mode 100644 configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.targets
 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
 create mode 100644 configs/platform-v7a/dts/bootstate.dtsi
 create mode 100644 platforms/image-rauc.in
 create mode 100644 projectroot/etc/rauc/system.conf
 create mode 100644 projectroot/usr/lib/systemd/system/rauc-mark-good.service
 create mode 100755 projectroot/usr/lib/udev/of_base_compatible
 create mode 100644 projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules
 create mode 100644 rules/rauc-udev.in
 create mode 100644 rules/rauc-udev.make

-- 
2.39.2




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

* [DistroKit] [PATCH v2 01/14] platforms: revert to default systemd loglevel
  2023-04-26 20:14 [DistroKit] [PATCH v2 00/14] v7a: add redundant update support via RAUC Roland Hieber
@ 2023-04-26 20:14 ` Roland Hieber
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 02/14] ptxconfig: enable more tools for debugging Roland Hieber
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Roland Hieber @ 2023-04-26 20:14 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

By decreasing the systemd loglevel to "warning", the journal no longer
contains useful lines like which units were started and stopped and
when, which is quite sparse information for debugging. Remove the
systemd.log_level from the kernel command line so systemd defaults to
loglevel "info" (same level as loglevel=5 for the kernel).

Keep the systemd.show_status setting on "auto" so that systemd only
produces actual console output when the boot takes a significant amount
of time, or produces error messages; so this change only changes the
verbosity of the journal, not the console, on normal boots.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 configs/platform-mips/run                                       | 2 +-
 .../barebox-am335x-defaultenv/nv/linux.bootargs.loglevel        | 2 +-
 .../barebox-mx6-defaultenv/nv/linux.bootargs.loglevel           | 2 +-
 .../barebox-rpi2-defaultenv/nv/linux.bootargs.loglevel          | 2 +-
 .../barebox-stm32mp-defaultenv/nv/linux.bootargs.loglevel       | 2 +-
 .../barebox-vexpress-defaultenv/nv/linux.bootargs.loglevel      | 2 +-
 configs/platform-v7a/run                                        | 2 +-
 configs/platform-v7a/run-nfs                                    | 2 +-
 .../barebox-vexpress-defaultenv/nv/linux.bootargs.loglevel      | 2 +-
 configs/platform-v7a_noneon/run                                 | 2 +-
 configs/platform-v7a_noneon/run-nfs                             | 2 +-
 .../barebox-common-defaultenv/nv/linux.bootargs.loglevel        | 2 +-
 .../barebox-rock3a-defaultenv/nv/linux.bootargs.loglevel        | 2 +-
 configs/platform-x86_64/run                                     | 2 +-
 14 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/configs/platform-mips/run b/configs/platform-mips/run
index edfce51a96b5..cf8a535167e3 100755
--- a/configs/platform-mips/run
+++ b/configs/platform-mips/run
@@ -65,7 +65,7 @@ if [ -z "${QEMU_NET}" ]; then
 	QEMU_NET=(-netdev user,id=net1,hostfwd=tcp:127.0.0.1:${TELNET_EXTERNAL_PORT}-:${TELNET_INTERNAL_PORT},hostfwd=tcp:127.0.0.1:${SSH_EXTERNAL_PORT}-:${SSH_INTERNAL_PORT} )
 fi
 
-BASE_CMDLINE="console=ttyS0,115200 loglevel=5 systemd.log_level=warning systemd.show_status=auto"
+BASE_CMDLINE="console=ttyS0,115200 loglevel=5 systemd.show_status=auto"
 
 # Machine to emulate
 QEMU_ARGS=( -M malta -m 256 -serial stdio -monitor null -device qemu-xhci,id=xhci)
diff --git a/configs/platform-v7a/barebox-am335x-defaultenv/nv/linux.bootargs.loglevel b/configs/platform-v7a/barebox-am335x-defaultenv/nv/linux.bootargs.loglevel
index 705752ca416d..d45c34464422 100644
--- a/configs/platform-v7a/barebox-am335x-defaultenv/nv/linux.bootargs.loglevel
+++ b/configs/platform-v7a/barebox-am335x-defaultenv/nv/linux.bootargs.loglevel
@@ -1 +1 @@
-loglevel=5 systemd.log_level=warning systemd.show_status=auto
+loglevel=5 systemd.show_status=auto
diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/linux.bootargs.loglevel b/configs/platform-v7a/barebox-mx6-defaultenv/nv/linux.bootargs.loglevel
index 705752ca416d..d45c34464422 100644
--- a/configs/platform-v7a/barebox-mx6-defaultenv/nv/linux.bootargs.loglevel
+++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/linux.bootargs.loglevel
@@ -1 +1 @@
-loglevel=5 systemd.log_level=warning systemd.show_status=auto
+loglevel=5 systemd.show_status=auto
diff --git a/configs/platform-v7a/barebox-rpi2-defaultenv/nv/linux.bootargs.loglevel b/configs/platform-v7a/barebox-rpi2-defaultenv/nv/linux.bootargs.loglevel
index 705752ca416d..d45c34464422 100644
--- a/configs/platform-v7a/barebox-rpi2-defaultenv/nv/linux.bootargs.loglevel
+++ b/configs/platform-v7a/barebox-rpi2-defaultenv/nv/linux.bootargs.loglevel
@@ -1 +1 @@
-loglevel=5 systemd.log_level=warning systemd.show_status=auto
+loglevel=5 systemd.show_status=auto
diff --git a/configs/platform-v7a/barebox-stm32mp-defaultenv/nv/linux.bootargs.loglevel b/configs/platform-v7a/barebox-stm32mp-defaultenv/nv/linux.bootargs.loglevel
index 705752ca416d..d45c34464422 100644
--- a/configs/platform-v7a/barebox-stm32mp-defaultenv/nv/linux.bootargs.loglevel
+++ b/configs/platform-v7a/barebox-stm32mp-defaultenv/nv/linux.bootargs.loglevel
@@ -1 +1 @@
-loglevel=5 systemd.log_level=warning systemd.show_status=auto
+loglevel=5 systemd.show_status=auto
diff --git a/configs/platform-v7a/barebox-vexpress-defaultenv/nv/linux.bootargs.loglevel b/configs/platform-v7a/barebox-vexpress-defaultenv/nv/linux.bootargs.loglevel
index 705752ca416d..d45c34464422 100644
--- a/configs/platform-v7a/barebox-vexpress-defaultenv/nv/linux.bootargs.loglevel
+++ b/configs/platform-v7a/barebox-vexpress-defaultenv/nv/linux.bootargs.loglevel
@@ -1 +1 @@
-loglevel=5 systemd.log_level=warning systemd.show_status=auto
+loglevel=5 systemd.show_status=auto
diff --git a/configs/platform-v7a/run b/configs/platform-v7a/run
index 3f62b237ac12..004706ddaf59 100755
--- a/configs/platform-v7a/run
+++ b/configs/platform-v7a/run
@@ -62,7 +62,7 @@ if [ -z "${QEMU_NET}" ]; then
 	echo "Forwarding SSH port 127.0.0.1:${SSH_EXTERNAL_PORT} -> qemu:${SSH_INTERNAL_PORT}"
 fi
 
-BASE_CMDLINE="console=ttyAMA0,115200 loglevel=5 systemd.log_level=warning systemd.show_status=auto"
+BASE_CMDLINE="console=ttyAMA0,115200 loglevel=5 systemd.show_status=auto"
 
 if [ -d "${PTXDIST_PLATFORMDIR}/root/.virtfs_metadata" ]; then
 	security_model="mapped-file"
diff --git a/configs/platform-v7a/run-nfs b/configs/platform-v7a/run-nfs
index d1675fb47bfd..c78e36ca1ea0 100755
--- a/configs/platform-v7a/run-nfs
+++ b/configs/platform-v7a/run-nfs
@@ -16,5 +16,5 @@ ${QEMU_EXEC} ${QEMU_NOGRAPHIC} \
 	-kernel ${PTXDIST_PLATFORMDIR}/images/linuximage \
 	-dtb ${PTXDIST_PLATFORMDIR}/images/vexpress-v2p-ca9.dtb \
 	-smp 1 \
-	-append "console=ttyAMA0 root=/dev/nfs nfsroot=10.0.2.2:/root,v3,tcp,port=2049,mountport=2049 rw mem=1024M rootwait loglevel=5 systemd.log_level=warning systemd.show_status=auto ip=dhcp"
+	-append "console=ttyAMA0 root=/dev/nfs nfsroot=10.0.2.2:/root,v3,tcp,port=2049,mountport=2049 rw mem=1024M rootwait loglevel=5 systemd.show_status=auto ip=dhcp"
 
diff --git a/configs/platform-v7a_noneon/barebox-vexpress-defaultenv/nv/linux.bootargs.loglevel b/configs/platform-v7a_noneon/barebox-vexpress-defaultenv/nv/linux.bootargs.loglevel
index 705752ca416d..d45c34464422 100644
--- a/configs/platform-v7a_noneon/barebox-vexpress-defaultenv/nv/linux.bootargs.loglevel
+++ b/configs/platform-v7a_noneon/barebox-vexpress-defaultenv/nv/linux.bootargs.loglevel
@@ -1 +1 @@
-loglevel=5 systemd.log_level=warning systemd.show_status=auto
+loglevel=5 systemd.show_status=auto
diff --git a/configs/platform-v7a_noneon/run b/configs/platform-v7a_noneon/run
index 8af190f11eb4..0bb06bc60868 100755
--- a/configs/platform-v7a_noneon/run
+++ b/configs/platform-v7a_noneon/run
@@ -62,7 +62,7 @@ if [ -z "${QEMU_NET}" ]; then
 	echo "Forwarding SSH port 127.0.0.1:${SSH_EXTERNAL_PORT} -> qemu:${SSH_INTERNAL_PORT}"
 fi
 
-BASE_CMDLINE="console=ttyAMA0,115200 loglevel=5 systemd.log_level=warning systemd.show_status=auto"
+BASE_CMDLINE="console=ttyAMA0,115200 loglevel=5 systemd.show_status=auto"
 
 if [ -d "${PTXDIST_PLATFORMDIR}/root/.virtfs_metadata" ]; then
 	security_model="mapped-file"
diff --git a/configs/platform-v7a_noneon/run-nfs b/configs/platform-v7a_noneon/run-nfs
index d1675fb47bfd..c78e36ca1ea0 100755
--- a/configs/platform-v7a_noneon/run-nfs
+++ b/configs/platform-v7a_noneon/run-nfs
@@ -16,5 +16,5 @@ ${QEMU_EXEC} ${QEMU_NOGRAPHIC} \
 	-kernel ${PTXDIST_PLATFORMDIR}/images/linuximage \
 	-dtb ${PTXDIST_PLATFORMDIR}/images/vexpress-v2p-ca9.dtb \
 	-smp 1 \
-	-append "console=ttyAMA0 root=/dev/nfs nfsroot=10.0.2.2:/root,v3,tcp,port=2049,mountport=2049 rw mem=1024M rootwait loglevel=5 systemd.log_level=warning systemd.show_status=auto ip=dhcp"
+	-append "console=ttyAMA0 root=/dev/nfs nfsroot=10.0.2.2:/root,v3,tcp,port=2049,mountport=2049 rw mem=1024M rootwait loglevel=5 systemd.show_status=auto ip=dhcp"
 
diff --git a/configs/platform-v8a/barebox-common-defaultenv/nv/linux.bootargs.loglevel b/configs/platform-v8a/barebox-common-defaultenv/nv/linux.bootargs.loglevel
index 705752ca416d..d45c34464422 100644
--- a/configs/platform-v8a/barebox-common-defaultenv/nv/linux.bootargs.loglevel
+++ b/configs/platform-v8a/barebox-common-defaultenv/nv/linux.bootargs.loglevel
@@ -1 +1 @@
-loglevel=5 systemd.log_level=warning systemd.show_status=auto
+loglevel=5 systemd.show_status=auto
diff --git a/configs/platform-v8a/barebox-rock3a-defaultenv/nv/linux.bootargs.loglevel b/configs/platform-v8a/barebox-rock3a-defaultenv/nv/linux.bootargs.loglevel
index 705752ca416d..d45c34464422 100644
--- a/configs/platform-v8a/barebox-rock3a-defaultenv/nv/linux.bootargs.loglevel
+++ b/configs/platform-v8a/barebox-rock3a-defaultenv/nv/linux.bootargs.loglevel
@@ -1 +1 @@
-loglevel=5 systemd.log_level=warning systemd.show_status=auto
+loglevel=5 systemd.show_status=auto
diff --git a/configs/platform-x86_64/run b/configs/platform-x86_64/run
index f3f4c34653a8..e7f30fdd3048 100755
--- a/configs/platform-x86_64/run
+++ b/configs/platform-x86_64/run
@@ -65,7 +65,7 @@ if [ -z "${QEMU_NET}" ]; then
 	QEMU_NET=(-netdev user,id=net1,hostfwd=tcp:127.0.0.1:${TELNET_EXTERNAL_PORT}-:${TELNET_INTERNAL_PORT},hostfwd=tcp:127.0.0.1:${SSH_EXTERNAL_PORT}-:${SSH_INTERNAL_PORT} )
 fi
 
-BASE_CMDLINE="console=ttyS0,115200 loglevel=5 systemd.log_level=warning systemd.show_status=auto"
+BASE_CMDLINE="console=ttyS0,115200 loglevel=5 systemd.show_status=auto"
 
 if [ -d "${PTXDIST_PLATFORMDIR}/root/.virtfs_metadata" ]; then
 	security_model="mapped-file"
-- 
2.39.2




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

* [DistroKit] [PATCH v2 02/14] ptxconfig: enable more tools for debugging
  2023-04-26 20:14 [DistroKit] [PATCH v2 00/14] v7a: add redundant update support via RAUC Roland Hieber
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 01/14] platforms: revert to default systemd loglevel Roland Hieber
@ 2023-04-26 20:14 ` Roland Hieber
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 03/14] rauc-udev: add a compatibility layer for mapping partitions Roland Hieber
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Roland Hieber @ 2023-04-26 20:14 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

Enable lsblk, file, sha*sum, time, strings, and curl to access the
internet.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 configs/ptxconfig | 46 +++++++++++++++++++++++++++++++++++++---------
 1 file changed, 37 insertions(+), 9 deletions(-)

diff --git a/configs/ptxconfig b/configs/ptxconfig
index f059ad9198a9..08ce50601436 100644
--- a/configs/ptxconfig
+++ b/configs/ptxconfig
@@ -95,6 +95,7 @@ PTXCONF_HOST_QEMU_USR=y
 PTXCONF_HOST_ACL=y
 PTXCONF_HOST_CMAKE=y
 PTXCONF_HOST_FIGLET=y
+PTXCONF_HOST_FILE=y
 PTXCONF_HOST_FLEX=y
 PTXCONF_HOST_GLIB=y
 PTXCONF_HOST_GPERF=y
@@ -635,9 +636,9 @@ PTXCONF_BUSYBOX_FEATURE_LS_USERNAME=y
 PTXCONF_BUSYBOX_FEATURE_LS_COLOR=y
 PTXCONF_BUSYBOX_FEATURE_LS_COLOR_IS_DEFAULT=y
 PTXCONF_BUSYBOX_MD5SUM=y
-# PTXCONF_BUSYBOX_SHA1SUM is not set
-# PTXCONF_BUSYBOX_SHA256SUM is not set
-# PTXCONF_BUSYBOX_SHA512SUM is not set
+PTXCONF_BUSYBOX_SHA1SUM=y
+PTXCONF_BUSYBOX_SHA256SUM=y
+PTXCONF_BUSYBOX_SHA512SUM=y
 PTXCONF_BUSYBOX_SHA3SUM=y
 
 #
@@ -1050,8 +1051,8 @@ PTXCONF_BUSYBOX_READAHEAD=y
 # PTXCONF_BUSYBOX_SEEDRNG is not set
 # PTXCONF_BUSYBOX_SETFATTR is not set
 PTXCONF_BUSYBOX_SETSERIAL=y
-# PTXCONF_BUSYBOX_STRINGS is not set
-# PTXCONF_BUSYBOX_TIME is not set
+PTXCONF_BUSYBOX_STRINGS=y
+PTXCONF_BUSYBOX_TIME=y
 # PTXCONF_BUSYBOX_TREE is not set
 # PTXCONF_BUSYBOX_TS is not set
 # PTXCONF_BUSYBOX_TTYSIZE is not set
@@ -1307,7 +1308,8 @@ PTXCONF_BUSYBOX_LOGGER=y
 # PTXCONF_EFIBOOTMGR is not set
 # PTXCONF_EFIVAR is not set
 # PTXCONF_FIGLET is not set
-# PTXCONF_FILE is not set
+PTXCONF_FILE=y
+PTXCONF_FILE_SECCOMP=y
 # PTXCONF_FINDUTILS is not set
 
 #
@@ -1550,7 +1552,7 @@ PTXCONF_UTIL_LINUX_SFDISK=y
 # PTXCONF_UTIL_LINUX_BLKID is not set
 # PTXCONF_UTIL_LINUX_FINDFS is not set
 # PTXCONF_UTIL_LINUX_GETOPT is not set
-# PTXCONF_UTIL_LINUX_LSBLK is not set
+PTXCONF_UTIL_LINUX_LSBLK=y
 # PTXCONF_UTIL_LINUX_MCOOKIE is not set
 # PTXCONF_UTIL_LINUX_UUIDD is not set
 # PTXCONF_UTIL_LINUX_UUIDGEN is not set
@@ -1753,7 +1755,11 @@ PTXCONF_ZSTD=y
 # PTXCONF_BOA is not set
 # PTXCONF_BRIDGE_UTILS is not set
 # PTXCONF_C_ARES is not set
-# PTXCONF_CA_CERTIFICATES is not set
+PTXCONF_CA_CERTIFICATES=y
+PTXCONF_CA_CERTIFICATES_SELECT_BUNDLE=y
+# PTXCONF_CA_CERTIFICATES_SELECT_CERTS is not set
+# PTXCONF_CA_CERTIFICATES_SELECT_BOTH is not set
+PTXCONF_CA_CERTIFICATES_BUNDLE=y
 # PTXCONF_CANFESTIVAL is not set
 # PTXCONF_CHRONY is not set
 # PTXCONF_COMGT is not set
@@ -1810,7 +1816,29 @@ PTXCONF_IPROUTE2_IP=y
 # PTXCONF_LIBCGICC is not set
 # PTXCONF_LIBCOAP is not set
 # PTXCONF_LIBCOAP2 is not set
-# PTXCONF_LIBCURL is not set
+PTXCONF_LIBCURL=y
+PTXCONF_LIBCURL_CURL=y
+# PTXCONF_LIBCURL_C_ARES is not set
+PTXCONF_LIBCURL_HTTP=y
+# PTXCONF_LIBCURL_COOKIES is not set
+PTXCONF_LIBCURL_FTP=y
+# PTXCONF_LIBCURL_TFTP is not set
+# PTXCONF_LIBCURL_FILE is not set
+# PTXCONF_LIBCURL_SMTP is not set
+# PTXCONF_LIBCURL_VERBOSE is not set
+PTXCONF_LIBCURL_SSL=y
+PTXCONF_LIBCURL_SSL_OPENSSL=y
+# PTXCONF_LIBCURL_SSL_GNUTLS is not set
+# PTXCONF_LIBCURL_SSL_NOCA is not set
+# PTXCONF_LIBCURL_SSL_CAPATH is not set
+# PTXCONF_LIBCURL_SSL_CABUNDLE is not set
+PTXCONF_LIBCURL_SSL_CA_CERTIFICATES=y
+PTXCONF_LIBCURL_SSL_DEFAULT_BACKEND="openssl"
+PTXCONF_LIBCURL_SSL_CAPATH_PATH="no"
+PTXCONF_LIBCURL_SSL_CABUNDLE_PATH="/etc/ssl/certs/ca-certificates.crt"
+# PTXCONF_LIBCURL_CRYPTO_AUTH is not set
+# PTXCONF_LIBCURL_LIBSSH2 is not set
+# PTXCONF_LIBCURL_MIME is not set
 # PTXCONF_LIBMBIM is not set
 # PTXCONF_LIBMICROHTTPD is not set
 # PTXCONF_LIBMMS is not set
-- 
2.39.2




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

* [DistroKit] [PATCH v2 03/14] rauc-udev: add a compatibility layer for mapping partitions
  2023-04-26 20:14 [DistroKit] [PATCH v2 00/14] v7a: add redundant update support via RAUC Roland Hieber
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 01/14] platforms: revert to default systemd loglevel Roland Hieber
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 02/14] ptxconfig: enable more tools for debugging Roland Hieber
@ 2023-04-26 20:14 ` Roland Hieber
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 04/14] v7a: barebox: include generic bootstate node in device tree Roland Hieber
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Roland Hieber @ 2023-04-26 20:14 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

When we add RAUC support for different platforms later, we need a way to
specify their respective root partitions in RAUC's system.conf; however,
the names of the actual partitions can differ on different hardware
platforms. Add a short udev rule that can add symlinks to the actual
partitions based on the device tree compatible. This way we can refer to
the partitions in system.conf using the symlinks on all boards that we
want to support.

This commit only adds a stub for now; we will add the code that creates
the actual symlinks for each hardware in later commits.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 configs/ptxconfig                             |  5 ++-
 projectroot/usr/lib/udev/of_base_compatible   |  4 ++
 .../lib/udev/rules.d/90-rauc-partitions.rules | 15 ++++++++
 rules/rauc-udev.in                            | 10 +++++
 rules/rauc-udev.make                          | 37 +++++++++++++++++++
 5 files changed, 70 insertions(+), 1 deletion(-)
 create mode 100755 projectroot/usr/lib/udev/of_base_compatible
 create mode 100644 projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules
 create mode 100644 rules/rauc-udev.in
 create mode 100644 rules/rauc-udev.make

diff --git a/configs/ptxconfig b/configs/ptxconfig
index 08ce50601436..e123c5b9097a 100644
--- a/configs/ptxconfig
+++ b/configs/ptxconfig
@@ -3,6 +3,7 @@
 # PTXdist 2023.04.0
 #
 PTXCONF_DATAPARTITION=y
+PTXCONF_RAUC_UDEV=y
 
 #
 # ------------------------------------
@@ -693,7 +694,9 @@ PTXCONF_BUSYBOX_TEST=y
 # PTXCONF_BUSYBOX_TIMEOUT is not set
 PTXCONF_BUSYBOX_TOUCH=y
 PTXCONF_BUSYBOX_FEATURE_TOUCH_SUSV3=y
-# PTXCONF_BUSYBOX_TR is not set
+PTXCONF_BUSYBOX_TR=y
+PTXCONF_BUSYBOX_FEATURE_TR_CLASSES=y
+PTXCONF_BUSYBOX_FEATURE_TR_EQUIV=y
 PTXCONF_BUSYBOX_TRUE=y
 # PTXCONF_BUSYBOX_TRUNCATE is not set
 # PTXCONF_BUSYBOX_TSORT is not set
diff --git a/projectroot/usr/lib/udev/of_base_compatible b/projectroot/usr/lib/udev/of_base_compatible
new file mode 100755
index 000000000000..07c7f767ad90
--- /dev/null
+++ b/projectroot/usr/lib/udev/of_base_compatible
@@ -0,0 +1,4 @@
+#!/bin/sh
+# SPDX-License-Identifier: 0-BSD
+# SPDX-FileCopyrightText: 2021 Roland Hieber, Pengutronix <rhi@pengutronix.de>
+printf 'OF_BASE_COMPATIBLE="%s"\n' "$(tr '\0' ' ' < /sys/firmware/devicetree/base/compatible)"
diff --git a/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules b/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules
new file mode 100644
index 000000000000..c08f9b5633dc
--- /dev/null
+++ b/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: 0-BSD
+# SPDX-FileCopyrightText: 2021 Roland Hieber, Pengutronix <rhi@pengutronix.de>
+
+ACTION=="remove", GOTO="rauc_partitions_end"
+SUBSYSTEM!="block", GOTO="rauc_partitions_end"
+
+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
+
+# fallback for boards not yet supported by RAUC
+KERNEL=="mmcblk0p3", SYMLINK+="disk/by-usage/data"
+
+LABEL="rauc_partitions_end"
diff --git a/rules/rauc-udev.in b/rules/rauc-udev.in
new file mode 100644
index 000000000000..f960c537f58f
--- /dev/null
+++ b/rules/rauc-udev.in
@@ -0,0 +1,10 @@
+## SECTION=project_specific
+
+config RAUC_UDEV
+	tristate
+	prompt "rauc udev rules"
+	select BUSYBOX		if RUNTIME
+	select BUSYBOX_TR	if RUNTIME
+	select UDEV		if RUNTIME
+	help
+	  udev rules for cross-hardware-compatible partition symlinks
diff --git a/rules/rauc-udev.make b/rules/rauc-udev.make
new file mode 100644
index 000000000000..6a806fc43e34
--- /dev/null
+++ b/rules/rauc-udev.make
@@ -0,0 +1,37 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2021 by Roland Hieber, Pengutronix <rhi@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_RAUC_UDEV) += rauc-udev
+
+RAUC_UDEV_VERSION	:= 1
+RAUC_UDEV_LICENSE	:= 0-BSD
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/rauc-udev.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, rauc-udev)
+	@$(call install_fixup,rauc-udev,PRIORITY,optional)
+	@$(call install_fixup,rauc-udev,SECTION,base)
+	@$(call install_fixup,rauc-udev,AUTHOR,"Roland Hieber, Pengutronix <rhi@pengutronix.de>")
+	@$(call install_fixup,rauc-udev,DESCRIPTION,missing)
+
+	@$(call install_alternative, rauc-udev, 0, 0, 0755, /usr/lib/udev/of_base_compatible)
+	@$(call install_alternative, rauc-udev, 0, 0, 0644, /usr/lib/udev/rules.d/90-rauc-partitions.rules)
+
+	@$(call install_finish,rauc-udev)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.39.2




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

* [DistroKit] [PATCH v2 04/14] v7a: barebox: include generic bootstate node in device tree
  2023-04-26 20:14 [DistroKit] [PATCH v2 00/14] v7a: add redundant update support via RAUC Roland Hieber
                   ` (2 preceding siblings ...)
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 03/14] rauc-udev: add a compatibility layer for mapping partitions Roland Hieber
@ 2023-04-26 20:14 ` Roland Hieber
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 05/14] v7a: add RAUC support for qemu-vexpress Roland Hieber
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Roland Hieber @ 2023-04-26 20:14 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

Add a device tree fragment via CONFIG_EXTERNAL_DTS_FRAGMENTS in the
barebox config, which is appended to each device tree built by barebox.
Then add definitions for the state variables, which are the same on all
boards; board-specific state backends will be added in the next patches.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 configs/platform-v7a/barebox-am335x.config    |  2 +-
 .../platform-v7a/barebox-am335x.config.diff   |  2 +-
 configs/platform-v7a/barebox-at91.config      |  2 +-
 configs/platform-v7a/barebox-at91.config.diff |  2 +-
 configs/platform-v7a/barebox-mx6.config       |  2 +-
 configs/platform-v7a/barebox-mx6.config.diff  |  2 +-
 configs/platform-v7a/barebox-rpi2.config      |  2 +-
 configs/platform-v7a/barebox-rpi2.config.diff |  2 +-
 configs/platform-v7a/barebox-stm32mp.config   |  2 +-
 .../platform-v7a/barebox-stm32mp.config.diff  |  2 +-
 configs/platform-v7a/barebox-vexpress.config  |  2 +-
 .../platform-v7a/barebox-vexpress.config.diff |  2 +-
 configs/platform-v7a/barebox.config           |  2 +-
 configs/platform-v7a/dts/bootstate.dtsi       | 50 +++++++++++++++++++
 14 files changed, 63 insertions(+), 13 deletions(-)
 create mode 100644 configs/platform-v7a/dts/bootstate.dtsi

diff --git a/configs/platform-v7a/barebox-am335x.config b/configs/platform-v7a/barebox-am335x.config
index 647d7162297c..2c4a6af1804b 100644
--- a/configs/platform-v7a/barebox-am335x.config
+++ b/configs/platform-v7a/barebox-am335x.config
@@ -215,7 +215,7 @@ CONFIG_STATE=y
 CONFIG_RESET_SOURCE=y
 # CONFIG_MACHINE_ID is not set
 # CONFIG_SYSTEMD_OF_WATCHDOG is not set
-CONFIG_EXTERNAL_DTS_FRAGMENTS=""
+CONFIG_EXTERNAL_DTS_FRAGMENTS="${PTXDIST_PLATFORMCONFIGDIR}/dts/bootstate.dtsi"
 
 #
 # OP-TEE loading
diff --git a/configs/platform-v7a/barebox-am335x.config.diff b/configs/platform-v7a/barebox-am335x.config.diff
index 20ab6803c846..f82d8531bf97 100644
--- a/configs/platform-v7a/barebox-am335x.config.diff
+++ b/configs/platform-v7a/barebox-am335x.config.diff
@@ -1,4 +1,4 @@
-68457081af06bd8377bc38ef02c7d415
+b377506ccc60db21f1050002e1af6f17
 # CONFIG_32BIT is undefined
 # CONFIG_64BIT is undefined
 # CONFIG_AM33XX_NET_BOOT is not set
diff --git a/configs/platform-v7a/barebox-at91.config b/configs/platform-v7a/barebox-at91.config
index b9f129a0ef5f..bc4af1c26039 100644
--- a/configs/platform-v7a/barebox-at91.config
+++ b/configs/platform-v7a/barebox-at91.config
@@ -224,7 +224,7 @@ CONFIG_STATE=y
 CONFIG_RESET_SOURCE=y
 # CONFIG_MACHINE_ID is not set
 # CONFIG_SYSTEMD_OF_WATCHDOG is not set
-CONFIG_EXTERNAL_DTS_FRAGMENTS=""
+CONFIG_EXTERNAL_DTS_FRAGMENTS="${PTXDIST_PLATFORMCONFIGDIR}/dts/bootstate.dtsi"
 
 #
 # OP-TEE loading
diff --git a/configs/platform-v7a/barebox-at91.config.diff b/configs/platform-v7a/barebox-at91.config.diff
index 2b7b71b6879b..fb7cd0860375 100644
--- a/configs/platform-v7a/barebox-at91.config.diff
+++ b/configs/platform-v7a/barebox-at91.config.diff
@@ -1,4 +1,4 @@
-68457081af06bd8377bc38ef02c7d415
+b377506ccc60db21f1050002e1af6f17
 # CONFIG_32BIT is undefined
 # CONFIG_64BIT is undefined
 CONFIG_ARCH_AT91=y
diff --git a/configs/platform-v7a/barebox-mx6.config b/configs/platform-v7a/barebox-mx6.config
index f6a1003d1570..c0a8faa33292 100644
--- a/configs/platform-v7a/barebox-mx6.config
+++ b/configs/platform-v7a/barebox-mx6.config
@@ -289,7 +289,7 @@ CONFIG_STATE=y
 CONFIG_RESET_SOURCE=y
 # CONFIG_MACHINE_ID is not set
 # CONFIG_SYSTEMD_OF_WATCHDOG is not set
-CONFIG_EXTERNAL_DTS_FRAGMENTS=""
+CONFIG_EXTERNAL_DTS_FRAGMENTS="${PTXDIST_PLATFORMCONFIGDIR}/dts/bootstate.dtsi"
 
 #
 # OP-TEE loading
diff --git a/configs/platform-v7a/barebox-mx6.config.diff b/configs/platform-v7a/barebox-mx6.config.diff
index 0ff150f6ebbc..f51daa42375e 100644
--- a/configs/platform-v7a/barebox-mx6.config.diff
+++ b/configs/platform-v7a/barebox-mx6.config.diff
@@ -1,4 +1,4 @@
-68457081af06bd8377bc38ef02c7d415
+b377506ccc60db21f1050002e1af6f17
 # CONFIG_32BIT is undefined
 # CONFIG_64BIT is undefined
 # CONFIG_ARCH_BCM283X is not set
diff --git a/configs/platform-v7a/barebox-rpi2.config b/configs/platform-v7a/barebox-rpi2.config
index 96b416fe414a..54b89f74525d 100644
--- a/configs/platform-v7a/barebox-rpi2.config
+++ b/configs/platform-v7a/barebox-rpi2.config
@@ -212,7 +212,7 @@ CONFIG_STATE=y
 CONFIG_RESET_SOURCE=y
 # CONFIG_MACHINE_ID is not set
 # CONFIG_SYSTEMD_OF_WATCHDOG is not set
-CONFIG_EXTERNAL_DTS_FRAGMENTS=""
+CONFIG_EXTERNAL_DTS_FRAGMENTS="${PTXDIST_PLATFORMCONFIGDIR}/dts/bootstate.dtsi"
 
 #
 # OP-TEE loading
diff --git a/configs/platform-v7a/barebox-rpi2.config.diff b/configs/platform-v7a/barebox-rpi2.config.diff
index 852c2717059c..b53c429a3e9b 100644
--- a/configs/platform-v7a/barebox-rpi2.config.diff
+++ b/configs/platform-v7a/barebox-rpi2.config.diff
@@ -1,4 +1,4 @@
-68457081af06bd8377bc38ef02c7d415
+b377506ccc60db21f1050002e1af6f17
 CONFIG_ARM_ASM_UNIFIED=y
 # CONFIG_CMD_NVMEM is not set
 # CONFIG_CMD_USBGADGET is undefined
diff --git a/configs/platform-v7a/barebox-stm32mp.config b/configs/platform-v7a/barebox-stm32mp.config
index 8a6f6d9474d2..aee11c5ecd8d 100644
--- a/configs/platform-v7a/barebox-stm32mp.config
+++ b/configs/platform-v7a/barebox-stm32mp.config
@@ -207,7 +207,7 @@ CONFIG_STATE=y
 CONFIG_RESET_SOURCE=y
 # CONFIG_MACHINE_ID is not set
 # CONFIG_SYSTEMD_OF_WATCHDOG is not set
-CONFIG_EXTERNAL_DTS_FRAGMENTS=""
+CONFIG_EXTERNAL_DTS_FRAGMENTS="${PTXDIST_PLATFORMCONFIGDIR}/dts/bootstate.dtsi"
 
 #
 # OP-TEE loading
diff --git a/configs/platform-v7a/barebox-stm32mp.config.diff b/configs/platform-v7a/barebox-stm32mp.config.diff
index 42950765f911..4db2f15f9f75 100644
--- a/configs/platform-v7a/barebox-stm32mp.config.diff
+++ b/configs/platform-v7a/barebox-stm32mp.config.diff
@@ -1,4 +1,4 @@
-68457081af06bd8377bc38ef02c7d415
+b377506ccc60db21f1050002e1af6f17
 # CONFIG_32BIT is undefined
 # CONFIG_64BIT is undefined
 # CONFIG_ARCH_BCM283X is not set
diff --git a/configs/platform-v7a/barebox-vexpress.config b/configs/platform-v7a/barebox-vexpress.config
index 80d446ceccd1..ed7dcad99d4b 100644
--- a/configs/platform-v7a/barebox-vexpress.config
+++ b/configs/platform-v7a/barebox-vexpress.config
@@ -192,7 +192,7 @@ CONFIG_STATE=y
 CONFIG_RESET_SOURCE=y
 # CONFIG_MACHINE_ID is not set
 # CONFIG_SYSTEMD_OF_WATCHDOG is not set
-CONFIG_EXTERNAL_DTS_FRAGMENTS=""
+CONFIG_EXTERNAL_DTS_FRAGMENTS="${PTXDIST_PLATFORMCONFIGDIR}/dts/bootstate.dtsi"
 
 #
 # OP-TEE loading
diff --git a/configs/platform-v7a/barebox-vexpress.config.diff b/configs/platform-v7a/barebox-vexpress.config.diff
index abbea1a621ce..2ad6a7fd0229 100644
--- a/configs/platform-v7a/barebox-vexpress.config.diff
+++ b/configs/platform-v7a/barebox-vexpress.config.diff
@@ -1,4 +1,4 @@
-68457081af06bd8377bc38ef02c7d415
+b377506ccc60db21f1050002e1af6f17
 # CONFIG_32BIT is undefined
 # CONFIG_64BIT is undefined
 CONFIG_AMBA_SP804=y
diff --git a/configs/platform-v7a/barebox.config b/configs/platform-v7a/barebox.config
index 2e1d844e9512..594bd83c7003 100644
--- a/configs/platform-v7a/barebox.config
+++ b/configs/platform-v7a/barebox.config
@@ -213,7 +213,7 @@ CONFIG_STATE=y
 CONFIG_RESET_SOURCE=y
 # CONFIG_MACHINE_ID is not set
 # CONFIG_SYSTEMD_OF_WATCHDOG is not set
-CONFIG_EXTERNAL_DTS_FRAGMENTS=""
+CONFIG_EXTERNAL_DTS_FRAGMENTS="${PTXDIST_PLATFORMCONFIGDIR}/dts/bootstate.dtsi"
 
 #
 # OP-TEE loading
diff --git a/configs/platform-v7a/dts/bootstate.dtsi b/configs/platform-v7a/dts/bootstate.dtsi
new file mode 100644
index 000000000000..d41c888dbd43
--- /dev/null
+++ b/configs/platform-v7a/dts/bootstate.dtsi
@@ -0,0 +1,50 @@
+/** Generic bootstate node for all platforms **********************************/
+/ {
+	state: state {
+		bootstate: bootstate {};
+	};
+};
+
+&bootstate {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	system0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		remaining_attempts@0 {
+			reg = <0x0 0x4>;
+			type = "uint32";
+			default = <3>;
+		};
+
+		priority@4 {
+			reg = <0x4 0x4>;
+			type = "uint32";
+			default = <20>;
+		};
+	};
+
+	system1 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		remaining_attempts@8 {
+			reg = <0x8 0x4>;
+			type = "uint32";
+			default = <3>;
+		};
+
+		priority@c {
+			reg = <0xc 0x4>;
+			type = "uint32";
+			default = <10>;
+		};
+	};
+
+	last_chosen@10 {
+		reg = <0x10 0x4>;
+		type = "uint32";
+	};
+};
-- 
2.39.2




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

* [DistroKit] [PATCH v2 05/14] v7a: add RAUC support for qemu-vexpress
  2023-04-26 20:14 [DistroKit] [PATCH v2 00/14] v7a: add redundant update support via RAUC Roland Hieber
                   ` (3 preceding siblings ...)
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 04/14] v7a: barebox: include generic bootstate node in device tree Roland Hieber
@ 2023-04-26 20:14 ` Roland Hieber
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 06/14] v7a: add RAUC support for beaglebone black Roland Hieber
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Roland Hieber @ 2023-04-26 20:14 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

* 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 <rhi@pengutronix.de>
---
 .../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 ed7dcad99d4b..2edd85b74e74 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 2ad6a7fd0229..13359189d263 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




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

* [DistroKit] [PATCH v2 06/14] v7a: add RAUC support for beaglebone black
  2023-04-26 20:14 [DistroKit] [PATCH v2 00/14] v7a: add redundant update support via RAUC Roland Hieber
                   ` (4 preceding siblings ...)
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 05/14] v7a: add RAUC support for qemu-vexpress Roland Hieber
@ 2023-04-26 20:14 ` Roland Hieber
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 07/14] v7a: add RAUC support for rpi3 Roland Hieber
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Roland Hieber @ 2023-04-26 20:14 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

* Enable barebox bootchooser framework
* Add a redundant root partition to the genimage config
* Add appropriate variables to the barebox defaultenv so the bootchooser
  can decide into which partition to boot
* Add a state backend to the device tree fragment
* Map partitions in rauc-udev compatibility layer

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 .../barebox-am335x-defaultenv/init/bootsource |  4 +-
 .../barebox-am335x-defaultenv/nv/boot.default |  1 +
 .../nv/bootchooser.state_prefix               |  1 +
 .../nv/bootchooser.system0.boot               |  1 +
 .../nv/bootchooser.system1.boot               |  1 +
 .../nv/bootchooser.targets                    |  1 +
 configs/platform-v7a/barebox-am335x.config    |  3 +-
 .../platform-v7a/barebox-am335x.config.diff   |  2 +
 .../config/images/beaglebone.config           |  4 ++
 configs/platform-v7a/dts/bootstate.dtsi       | 41 +++++++++++++++++++
 .../lib/udev/rules.d/90-rauc-partitions.rules |  7 ++++
 11 files changed, 63 insertions(+), 3 deletions(-)
 create mode 100644 configs/platform-v7a/barebox-am335x-defaultenv/nv/boot.default
 create mode 100644 configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.state_prefix
 create mode 100644 configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.system0.boot
 create mode 100644 configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.system1.boot
 create mode 100644 configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.targets

diff --git a/configs/platform-v7a/barebox-am335x-defaultenv/init/bootsource b/configs/platform-v7a/barebox-am335x-defaultenv/init/bootsource
index 72e71e08c857..b3b73e790334 100644
--- a/configs/platform-v7a/barebox-am335x-defaultenv/init/bootsource
+++ b/configs/platform-v7a/barebox-am335x-defaultenv/init/bootsource
@@ -5,7 +5,7 @@ if [ -n "$nv.boot.default" ]; then
 fi
 
 if [ $bootsource = mmc ]; then
-	global.boot.default="mmc$bootsource_instance net"
+	global.boot.default="bootchooser net"
 else
-	global.boot.default="net mmc0 mmc1"
+	global.boot.default="net bootchooser"
 fi
diff --git a/configs/platform-v7a/barebox-am335x-defaultenv/nv/boot.default b/configs/platform-v7a/barebox-am335x-defaultenv/nv/boot.default
new file mode 100644
index 000000000000..d7d9a373c50b
--- /dev/null
+++ b/configs/platform-v7a/barebox-am335x-defaultenv/nv/boot.default
@@ -0,0 +1 @@
+bootchooser net
diff --git a/configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.state_prefix b/configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.state_prefix
new file mode 100644
index 000000000000..6246412a5c27
--- /dev/null
+++ b/configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.state_prefix
@@ -0,0 +1 @@
+state.bootstate
diff --git a/configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.system0.boot b/configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.system0.boot
new file mode 100644
index 000000000000..a6746c31d982
--- /dev/null
+++ b/configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.system0.boot
@@ -0,0 +1 @@
+mmc0.1
diff --git a/configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.system1.boot b/configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.system1.boot
new file mode 100644
index 000000000000..ecdf1ba55ad6
--- /dev/null
+++ b/configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.system1.boot
@@ -0,0 +1 @@
+mmc0.2
diff --git a/configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.targets b/configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.targets
new file mode 100644
index 000000000000..f0fb14eeaad2
--- /dev/null
+++ b/configs/platform-v7a/barebox-am335x-defaultenv/nv/bootchooser.targets
@@ -0,0 +1 @@
+system0 system1
diff --git a/configs/platform-v7a/barebox-am335x.config b/configs/platform-v7a/barebox-am335x.config
index 2c4a6af1804b..d2ef78c0fc0a 100644
--- a/configs/platform-v7a/barebox-am335x.config
+++ b/configs/platform-v7a/barebox-am335x.config
@@ -211,7 +211,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
@@ -301,6 +301,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-am335x.config.diff b/configs/platform-v7a/barebox-am335x.config.diff
index f82d8531bf97..eed3aa1fbf0a 100644
--- a/configs/platform-v7a/barebox-am335x.config.diff
+++ b/configs/platform-v7a/barebox-am335x.config.diff
@@ -15,11 +15,13 @@ CONFIG_ARM_BOARD_APPEND_ATAG=y
 # CONFIG_BAREBOX_UPDATE_AM33XX_EMMC is not set
 # CONFIG_BAREBOX_UPDATE_AM33XX_NAND is not set
 CONFIG_BAREBOX_UPDATE_AM33XX_SPI_NOR_MLO=y
+CONFIG_BOOTCHOOSER=y
 CONFIG_BOOTM_OFTREE_UIMAGE=y
 CONFIG_BUS_OMAP_GPMC=y
 # CONFIG_CLKDEV_LOOKUP is undefined
 # CONFIG_CLOCKSOURCE_BCM283X is undefined
 CONFIG_CLOCKSOURCE_TI_DM=y
+CONFIG_CMD_BOOTCHOOSER=y
 # CONFIG_CMD_CLK is undefined
 # CONFIG_CMD_KEYSTORE is not set
 CONFIG_CMD_NAND=y
diff --git a/configs/platform-v7a/config/images/beaglebone.config b/configs/platform-v7a/config/images/beaglebone.config
index 7b1c41dfc320..07d251bfbe69 100644
--- a/configs/platform-v7a/config/images/beaglebone.config
+++ b/configs/platform-v7a/config/images/beaglebone.config
@@ -20,6 +20,10 @@ image @IMAGE@ {
 		image = root.ext2
 		partition-type = 0x83
 	}
+	partition root-B {
+		image = root.ext2
+		partition-type = 0x83
+	}
 	partition data {
 		partition-type = 0x83
 		size = 512M
diff --git a/configs/platform-v7a/dts/bootstate.dtsi b/configs/platform-v7a/dts/bootstate.dtsi
index d41c888dbd43..de39f4c4cd93 100644
--- a/configs/platform-v7a/dts/bootstate.dtsi
+++ b/configs/platform-v7a/dts/bootstate.dtsi
@@ -1,3 +1,44 @@
+/** TI AM335x BeagleBone black ************************************************/
+#ifdef am335x_boneblack_dts
+/ {
+	aliases {
+		state = &state_mmc1;
+	};
+
+	state_mmc1: state {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "barebox,state";
+		magic = <0xa9cc3f17>;
+		backend-type = "raw";
+		backend = <&backend_state_mmc1>;
+		backend-storage-type = "circular";
+		backend-stridesize = <0x40>;
+	};
+};
+
+&mmc1 {
+       partitions {
+               compatible = "fixed-partitions";
+               #address-cells = <2>;
+               #size-cells = <2>;
+
+               barebox: partition@0 {
+                       label = "barebox";
+                       reg = <0x0 0x0 0x0 0xc000>;
+               };
+               environment: partition@c0000 {
+                       label = "barebox-environment";
+                       reg = <0x0 0xc0000 0x0 0x20000>;
+               };
+               backend_state_mmc1: partition@e0000 {
+                       label = "state";
+                       reg = <0x0 0xe0000 0x0 0x20000>;
+               };
+       };
+};
+#endif
+
 /** Generic bootstate node for all platforms **********************************/
 / {
 	state: state {
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 64d30fb96c27..b5c75d1ece7d 100644
--- a/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules
+++ b/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules
@@ -15,6 +15,13 @@ KERNEL=="mmcblk0p3", SYMLINK+="disk/by-usage/data"
 GOTO="rauc_partitions_end"
 LABEL="qemu_vexpress_end"
 
+ENV{OF_BASE_COMPATIBLE}!="*ti,am335x-bone-black*", GOTO="beaglebone_black_end"
+KERNEL=="mmcblk0p2", SYMLINK+="disk/by-usage/rootfs0"
+KERNEL=="mmcblk0p3", SYMLINK+="disk/by-usage/rootfs1"
+KERNEL=="mmcblk0p4", SYMLINK+="disk/by-usage/data"
+GOTO="rauc_partitions_end"
+LABEL="beaglebone_black_end"
+
 # fallback for boards not yet supported by RAUC
 KERNEL=="mmcblk0p3", SYMLINK+="disk/by-usage/data"
 
-- 
2.39.2




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

* [DistroKit] [PATCH v2 07/14] v7a: add RAUC support for rpi3
  2023-04-26 20:14 [DistroKit] [PATCH v2 00/14] v7a: add redundant update support via RAUC Roland Hieber
                   ` (5 preceding siblings ...)
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 06/14] v7a: add RAUC support for beaglebone black Roland Hieber
@ 2023-04-26 20:14 ` Roland Hieber
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 08/14] v7a: add RAUC support for riotboard Roland Hieber
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Roland Hieber @ 2023-04-26 20:14 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

* Enable barebox bootchooser framework
* Add a redundant root partition to the genimage config. The state and
  environment partitions can live in the first 4 MiB of the SD card, so
  move the the boot partition by the same amount.
* Add appropriate variables to the barebox defaultenv so the bootchooser
  can decide into which partition to boot
* Add a state backend to the device tree fragment
* Map partitions in rauc-udev compatibility layer

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 .../barebox-rpi2-defaultenv/init/bootsource   |  5 ++-
 .../barebox-rpi2-defaultenv/nv/boot.default   |  1 +
 .../nv/bootchooser.state_prefix               |  1 +
 .../nv/bootchooser.system0.boot               |  1 +
 .../nv/bootchooser.system1.boot               |  1 +
 .../nv/bootchooser.targets                    |  1 +
 configs/platform-v7a/barebox-rpi2.config      |  3 +-
 configs/platform-v7a/barebox-rpi2.config.diff |  2 ++
 .../platform-v7a/config/images/rpi2.config    |  5 +++
 configs/platform-v7a/dts/bootstate.dtsi       | 35 +++++++++++++++++++
 .../lib/udev/rules.d/90-rauc-partitions.rules |  7 ++++
 11 files changed, 58 insertions(+), 4 deletions(-)
 create mode 100644 configs/platform-v7a/barebox-rpi2-defaultenv/nv/boot.default
 create mode 100644 configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.state_prefix
 create mode 100644 configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.system0.boot
 create mode 100644 configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.system1.boot
 create mode 100644 configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.targets

diff --git a/configs/platform-v7a/barebox-rpi2-defaultenv/init/bootsource b/configs/platform-v7a/barebox-rpi2-defaultenv/init/bootsource
index 4de71635720a..50f505f6266b 100644
--- a/configs/platform-v7a/barebox-rpi2-defaultenv/init/bootsource
+++ b/configs/platform-v7a/barebox-rpi2-defaultenv/init/bootsource
@@ -6,8 +6,7 @@ fi
 
 if [ $bootsource = mmc ]; then
 	global.boot.default="bootchooser net"
-elif [ $bootsource = net ]; then
-	global.boot.default="net bootchooser"
 else
-	global.boot.default="disk0.1 net"
+	global.boot.default="net bootchooser"
 fi
+
diff --git a/configs/platform-v7a/barebox-rpi2-defaultenv/nv/boot.default b/configs/platform-v7a/barebox-rpi2-defaultenv/nv/boot.default
new file mode 100644
index 000000000000..d7d9a373c50b
--- /dev/null
+++ b/configs/platform-v7a/barebox-rpi2-defaultenv/nv/boot.default
@@ -0,0 +1 @@
+bootchooser net
diff --git a/configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.state_prefix b/configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.state_prefix
new file mode 100644
index 000000000000..6246412a5c27
--- /dev/null
+++ b/configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.state_prefix
@@ -0,0 +1 @@
+state.bootstate
diff --git a/configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.system0.boot b/configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.system0.boot
new file mode 100644
index 000000000000..5676f868b380
--- /dev/null
+++ b/configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.system0.boot
@@ -0,0 +1 @@
+disk0.1
diff --git a/configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.system1.boot b/configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.system1.boot
new file mode 100644
index 000000000000..1851d291c58c
--- /dev/null
+++ b/configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.system1.boot
@@ -0,0 +1 @@
+disk0.2
diff --git a/configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.targets b/configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.targets
new file mode 100644
index 000000000000..f0fb14eeaad2
--- /dev/null
+++ b/configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootchooser.targets
@@ -0,0 +1 @@
+system0 system1
diff --git a/configs/platform-v7a/barebox-rpi2.config b/configs/platform-v7a/barebox-rpi2.config
index 54b89f74525d..2dcad140bad0 100644
--- a/configs/platform-v7a/barebox-rpi2.config
+++ b/configs/platform-v7a/barebox-rpi2.config
@@ -208,7 +208,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
@@ -290,6 +290,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-rpi2.config.diff b/configs/platform-v7a/barebox-rpi2.config.diff
index b53c429a3e9b..5c6d3b865521 100644
--- a/configs/platform-v7a/barebox-rpi2.config.diff
+++ b/configs/platform-v7a/barebox-rpi2.config.diff
@@ -1,5 +1,7 @@
 b377506ccc60db21f1050002e1af6f17
 CONFIG_ARM_ASM_UNIFIED=y
+CONFIG_BOOTCHOOSER=y
+CONFIG_CMD_BOOTCHOOSER=y
 # CONFIG_CMD_NVMEM is not set
 # CONFIG_CMD_USBGADGET is undefined
 CONFIG_DRIVER_NET_BCMGENET=y
diff --git a/configs/platform-v7a/config/images/rpi2.config b/configs/platform-v7a/config/images/rpi2.config
index 3dc404d36379..80f004e03bde 100644
--- a/configs/platform-v7a/config/images/rpi2.config
+++ b/configs/platform-v7a/config/images/rpi2.config
@@ -13,6 +13,7 @@ image @IMAGE@ {
 		disk-signature = 0xbedf7893
 	}
 	partition boot {
+		offset = 4M
 		image = rpi2-boot.vfat
 		partition-type = 0xc
 		bootable = true
@@ -21,6 +22,10 @@ image @IMAGE@ {
 		image = root.ext2
 		partition-type = 0x83
 	}
+	partition root-B {
+		image = root.ext2
+		partition-type = 0x83
+	}
 	partition data {
 		partition-type = 0x83
 		size = 512M
diff --git a/configs/platform-v7a/dts/bootstate.dtsi b/configs/platform-v7a/dts/bootstate.dtsi
index de39f4c4cd93..fc75edd94e89 100644
--- a/configs/platform-v7a/dts/bootstate.dtsi
+++ b/configs/platform-v7a/dts/bootstate.dtsi
@@ -39,6 +39,41 @@
 };
 #endif
 
+/** Raspberry Pi 3 Model B ****************************************************/
+#ifdef bcm2837_rpi_3_dts
+/ {
+	aliases {
+		state = &state;
+	};
+
+	state: state {
+		magic = <0x11fb08ef>;
+		compatible = "barebox,state";
+		backend-type = "raw";
+		backend = <&statepart>;
+		backend-stridesize = <0x80>;
+		backend-storage-type = "direct";
+		#address-cells = <1>;
+		#size-cells = <1>;
+	};
+};
+
+&sdhost {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	statepart: partition@100000 {
+		label = "barebox-state";
+		reg = <0x100000 0x100000>;
+	};
+
+	partition@200000 {
+		label = "barebox-environment";
+		reg = <0x200000 0x100000>;
+	};
+};
+#endif
+
 /** Generic bootstate node for all platforms **********************************/
 / {
 	state: state {
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 b5c75d1ece7d..fde6c84b0c05 100644
--- a/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules
+++ b/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules
@@ -22,6 +22,13 @@ KERNEL=="mmcblk0p4", SYMLINK+="disk/by-usage/data"
 GOTO="rauc_partitions_end"
 LABEL="beaglebone_black_end"
 
+ENV{OF_BASE_COMPATIBLE}!="*raspberrypi,3-model-b*", GOTO="rpi3_end"
+KERNEL=="mmcblk0p2", SYMLINK+="disk/by-usage/rootfs0"
+KERNEL=="mmcblk0p3", SYMLINK+="disk/by-usage/rootfs1"
+KERNEL=="mmcblk0p4", SYMLINK+="disk/by-usage/data"
+GOTO="rauc_partitions_end"
+LABEL="rpi3_end"
+
 # fallback for boards not yet supported by RAUC
 KERNEL=="mmcblk0p3", SYMLINK+="disk/by-usage/data"
 
-- 
2.39.2




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

* [DistroKit] [PATCH v2 08/14] v7a: add RAUC support for riotboard
  2023-04-26 20:14 [DistroKit] [PATCH v2 00/14] v7a: add redundant update support via RAUC Roland Hieber
                   ` (6 preceding siblings ...)
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 07/14] v7a: add RAUC support for rpi3 Roland Hieber
@ 2023-04-26 20:14 ` Roland Hieber
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 09/14] v7a: kernel: enable features necessary for RAUC Roland Hieber
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Roland Hieber @ 2023-04-26 20:14 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

* Enable barebox bootchooser framework
* Add a redundant root partition to the genimage config
* Add appropriate variables to the barebox defaultenv so the bootchooser
  can decide into which partition to boot
* Add a state backend to the device tree fragment
* Map partitions in rauc-udev compatibility layer

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 .../barebox-mx6-defaultenv/init/bootsource    |  6 ++---
 .../barebox-mx6-defaultenv/nv/boot.default    |  1 +
 .../nv/bootchooser.state_prefix               |  1 +
 .../nv/bootchooser.system0.boot               |  1 +
 .../nv/bootchooser.system1.boot               |  1 +
 .../nv/bootchooser.targets                    |  1 +
 configs/platform-v7a/barebox-mx6.config       |  3 ++-
 configs/platform-v7a/barebox-mx6.config.diff  |  2 ++
 .../config/images/riotboard.config            |  6 +++++
 configs/platform-v7a/dts/bootstate.dtsi       | 27 +++++++++++++++++++
 .../lib/udev/rules.d/90-rauc-partitions.rules |  7 +++++
 11 files changed, 52 insertions(+), 4 deletions(-)
 create mode 100644 configs/platform-v7a/barebox-mx6-defaultenv/nv/boot.default
 create mode 100644 configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.state_prefix
 create mode 100644 configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.system0.boot
 create mode 100644 configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.system1.boot
 create mode 100644 configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.targets

diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/init/bootsource b/configs/platform-v7a/barebox-mx6-defaultenv/init/bootsource
index ba0480949ec8..852cfd7d9611 100644
--- a/configs/platform-v7a/barebox-mx6-defaultenv/init/bootsource
+++ b/configs/platform-v7a/barebox-mx6-defaultenv/init/bootsource
@@ -4,10 +4,10 @@ if [ -n "$nv.boot.default" ]; then
 	exit
 fi
 
-
 if [ $bootsource = mmc ]; then
 	detect mmc$bootsource_instance
-	global.boot.default="mmc$bootsource_instance net"
+	global.boot.default="bootchooser net"
 else
-	global.boot.default="net mmc1 mmc2 mmc3"
+	global.boot.default="net bootchooser"
 fi
+
diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/boot.default b/configs/platform-v7a/barebox-mx6-defaultenv/nv/boot.default
new file mode 100644
index 000000000000..d7d9a373c50b
--- /dev/null
+++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/boot.default
@@ -0,0 +1 @@
+bootchooser net
diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.state_prefix b/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.state_prefix
new file mode 100644
index 000000000000..6246412a5c27
--- /dev/null
+++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.state_prefix
@@ -0,0 +1 @@
+state.bootstate
diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.system0.boot b/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.system0.boot
new file mode 100644
index 000000000000..597dd55b4974
--- /dev/null
+++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.system0.boot
@@ -0,0 +1 @@
+mmc2.0
diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.system1.boot b/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.system1.boot
new file mode 100644
index 000000000000..069ba3685643
--- /dev/null
+++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.system1.boot
@@ -0,0 +1 @@
+mmc2.1
diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.targets b/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.targets
new file mode 100644
index 000000000000..f0fb14eeaad2
--- /dev/null
+++ b/configs/platform-v7a/barebox-mx6-defaultenv/nv/bootchooser.targets
@@ -0,0 +1 @@
+system0 system1
diff --git a/configs/platform-v7a/barebox-mx6.config b/configs/platform-v7a/barebox-mx6.config
index c0a8faa33292..fb8e3b2f5a86 100644
--- a/configs/platform-v7a/barebox-mx6.config
+++ b/configs/platform-v7a/barebox-mx6.config
@@ -285,7 +285,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
@@ -376,6 +376,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-mx6.config.diff b/configs/platform-v7a/barebox-mx6.config.diff
index f51daa42375e..30f6114088f7 100644
--- a/configs/platform-v7a/barebox-mx6.config.diff
+++ b/configs/platform-v7a/barebox-mx6.config.diff
@@ -21,10 +21,12 @@ CONFIG_AT803X_PHY=y
 CONFIG_BAREBOX_UPDATE_IMX_NAND_FCB=y
 CONFIG_BCH=y
 # CONFIG_BMP is not set
+CONFIG_BOOTCHOOSER=y
 CONFIG_BOOTM_OFTREE_UIMAGE=y
 # CONFIG_CACHE_L2X0 is not set
 # CONFIG_CLOCKSOURCE_BCM283X is undefined
 CONFIG_CLOCKSOURCE_IMX_GPT=y
+CONFIG_CMD_BOOTCHOOSER=y
 # CONFIG_CMD_FBTEST is not set
 CONFIG_CMD_FCB=y
 # CONFIG_CMD_KEYSTORE is not set
diff --git a/configs/platform-v7a/config/images/riotboard.config b/configs/platform-v7a/config/images/riotboard.config
index 32ca817e7362..f311fd5e41b0 100644
--- a/configs/platform-v7a/config/images/riotboard.config
+++ b/configs/platform-v7a/config/images/riotboard.config
@@ -15,6 +15,12 @@ image @IMAGE@ {
 		image = root.ext2
 		partition-type = 0x83
 	}
+
+	partition root-B {
+		image = root.ext2
+		partition-type = 0x83
+	}
+
 	partition data {
 		partition-type = 0x83
 		size = 512M
diff --git a/configs/platform-v7a/dts/bootstate.dtsi b/configs/platform-v7a/dts/bootstate.dtsi
index fc75edd94e89..21a3d53d8fbf 100644
--- a/configs/platform-v7a/dts/bootstate.dtsi
+++ b/configs/platform-v7a/dts/bootstate.dtsi
@@ -74,6 +74,33 @@
 };
 #endif
 
+/** RIoTboard i.MX6S **********************************************************/
+#ifdef imx6s_riotboard_dts
+/ {
+	aliases {
+		state = &state_usdhc4;
+	};
+
+	state_usdhc4: state {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "barebox,state";
+		magic = <0x95ab2de7>;
+		backend-type = "raw";
+		backend = <&backend_state_usdhc4>;
+		backend-storage-type = "circular";
+		backend-stridesize = <0x40>;
+	};
+};
+
+&usdhc4 {
+	backend_state_usdhc4: partition@100000 {
+		label = "barebox-state";
+		reg = <0x100000 0x40000>;
+	};
+};
+#endif
+
 /** Generic bootstate node for all platforms **********************************/
 / {
 	state: state {
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 fde6c84b0c05..456aa24b095f 100644
--- a/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules
+++ b/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules
@@ -29,6 +29,13 @@ KERNEL=="mmcblk0p4", SYMLINK+="disk/by-usage/data"
 GOTO="rauc_partitions_end"
 LABEL="rpi3_end"
 
+ENV{OF_BASE_COMPATIBLE}!="*riot,imx6s-riotboard*", GOTO="riotboard_end"
+KERNEL=="mmcblk2p1", SYMLINK+="disk/by-usage/rootfs0"
+KERNEL=="mmcblk2p2", SYMLINK+="disk/by-usage/rootfs1"
+KERNEL=="mmcblk2p3", SYMLINK+="disk/by-usage/data"
+GOTO="rauc_partitions_end"
+LABEL="riotboard_end"
+
 # fallback for boards not yet supported by RAUC
 KERNEL=="mmcblk0p3", SYMLINK+="disk/by-usage/data"
 
-- 
2.39.2




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

* [DistroKit] [PATCH v2 09/14] v7a: kernel: enable features necessary for RAUC
  2023-04-26 20:14 [DistroKit] [PATCH v2 00/14] v7a: add redundant update support via RAUC Roland Hieber
                   ` (7 preceding siblings ...)
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 08/14] v7a: add RAUC support for riotboard Roland Hieber
@ 2023-04-26 20:14 ` Roland Hieber
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 10/14] rauc: add initial support Roland Hieber
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Roland Hieber @ 2023-04-26 20:14 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

Enable the following kernel features:

* ARM SHA256 acceleration (CRYPTO_SHA256_ARM)
* Device mapper support (MD, BLK_DEV_DM)
* Verity target support (DM_VERITY), needed for the verity bundle format
* squashfs file system (MISC_FILESYSTEMS, SQUASHFS*, XZ_DEC_*, LZ4_*),
  also having multiple compression algorithms enabled for squashfs makes
  it easy to change the compression of the RAUC bundle in the future
* Network block device support (BLK_DEV_NBD), needed for HTTPS streaming

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 configs/platform-v7a/kernelconfig | 70 ++++++++++++++++++++++++++++---
 1 file changed, 65 insertions(+), 5 deletions(-)

diff --git a/configs/platform-v7a/kernelconfig b/configs/platform-v7a/kernelconfig
index 1141b92d0346..5ff83d77fffe 100644
--- a/configs/platform-v7a/kernelconfig
+++ b/configs/platform-v7a/kernelconfig
@@ -794,6 +794,8 @@ CONFIG_EFI_PARTITION=y
 
 CONFIG_BLK_MQ_VIRTIO=y
 CONFIG_BLK_PM=y
+CONFIG_BLOCK_HOLDER_DEPRECATED=y
+CONFIG_BLK_MQ_STACKING=y
 
 #
 # IO Schedulers
@@ -1401,7 +1403,7 @@ CONFIG_BLK_DEV=y
 CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
 # CONFIG_BLK_DEV_DRBD is not set
-# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_NBD=y
 # CONFIG_BLK_DEV_RAM is not set
 # CONFIG_ATA_OVER_ETH is not set
 # CONFIG_VIRTIO_BLK is not set
@@ -1477,7 +1479,37 @@ CONFIG_SCSI_MOD=y
 # end of SCSI device support
 
 # CONFIG_ATA is not set
-# CONFIG_MD is not set
+CONFIG_MD=y
+# CONFIG_BLK_DEV_MD is not set
+# CONFIG_BCACHE is not set
+CONFIG_BLK_DEV_DM_BUILTIN=y
+CONFIG_BLK_DEV_DM=y
+# CONFIG_DM_DEBUG is not set
+CONFIG_DM_BUFIO=y
+# CONFIG_DM_DEBUG_BLOCK_MANAGER_LOCKING is not set
+# CONFIG_DM_UNSTRIPED is not set
+# CONFIG_DM_CRYPT is not set
+# CONFIG_DM_SNAPSHOT is not set
+# CONFIG_DM_THIN_PROVISIONING is not set
+# CONFIG_DM_CACHE is not set
+# CONFIG_DM_WRITECACHE is not set
+# CONFIG_DM_ERA is not set
+# CONFIG_DM_CLONE is not set
+# CONFIG_DM_MIRROR is not set
+# CONFIG_DM_RAID is not set
+# CONFIG_DM_ZERO is not set
+# CONFIG_DM_MULTIPATH is not set
+# CONFIG_DM_DELAY is not set
+# CONFIG_DM_DUST is not set
+# CONFIG_DM_INIT is not set
+# CONFIG_DM_UEVENT is not set
+# CONFIG_DM_FLAKEY is not set
+CONFIG_DM_VERITY=y
+# CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG is not set
+# CONFIG_DM_VERITY_FEC is not set
+# CONFIG_DM_SWITCH is not set
+# CONFIG_DM_LOG_WRITES is not set
+# CONFIG_DM_INTEGRITY is not set
 # CONFIG_TARGET_CORE is not set
 CONFIG_NETDEVICES=y
 CONFIG_MII=y
@@ -3595,7 +3627,24 @@ CONFIG_UBIFS_FS_XATTR=y
 # CONFIG_UBIFS_FS_SECURITY is not set
 # CONFIG_UBIFS_FS_AUTHENTICATION is not set
 # CONFIG_CRAMFS is not set
-# CONFIG_SQUASHFS is not set
+CONFIG_SQUASHFS=y
+# CONFIG_SQUASHFS_FILE_CACHE is not set
+CONFIG_SQUASHFS_FILE_DIRECT=y
+CONFIG_SQUASHFS_DECOMP_MULTI=y
+# CONFIG_SQUASHFS_CHOICE_DECOMP_BY_MOUNT is not set
+# CONFIG_SQUASHFS_COMPILE_DECOMP_SINGLE is not set
+CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI=y
+# CONFIG_SQUASHFS_COMPILE_DECOMP_MULTI_PERCPU is not set
+# CONFIG_SQUASHFS_MOUNT_DECOMP_THREADS is not set
+# CONFIG_SQUASHFS_XATTR is not set
+CONFIG_SQUASHFS_ZLIB=y
+CONFIG_SQUASHFS_LZ4=y
+# CONFIG_SQUASHFS_LZO is not set
+CONFIG_SQUASHFS_XZ=y
+CONFIG_SQUASHFS_ZSTD=y
+CONFIG_SQUASHFS_4K_DEVBLK_SIZE=y
+# CONFIG_SQUASHFS_EMBEDDED is not set
+CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3
 # CONFIG_VXFS_FS is not set
 # CONFIG_MINIX_FS is not set
 # CONFIG_OMFS_FS is not set
@@ -3904,7 +3953,7 @@ CONFIG_CRYPTO_BLAKE2S_ARM=y
 # CONFIG_CRYPTO_SHA1_ARM_NEON is not set
 # CONFIG_CRYPTO_SHA1_ARM_CE is not set
 # CONFIG_CRYPTO_SHA2_ARM_CE is not set
-# CONFIG_CRYPTO_SHA256_ARM is not set
+CONFIG_CRYPTO_SHA256_ARM=y
 # CONFIG_CRYPTO_SHA512_ARM is not set
 CONFIG_CRYPTO_AES_ARM=y
 CONFIG_CRYPTO_AES_ARM_BS=y
@@ -4006,10 +4055,21 @@ CONFIG_CRC32_SLICEBY8=y
 # CONFIG_CRC8 is not set
 CONFIG_XXHASH=y
 # CONFIG_RANDOM32_SELFTEST is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_LZ4_DECOMPRESS=y
 CONFIG_ZSTD_COMMON=y
 CONFIG_ZSTD_COMPRESS=y
 CONFIG_ZSTD_DECOMPRESS=y
-# CONFIG_XZ_DEC is not set
+CONFIG_XZ_DEC=y
+# CONFIG_XZ_DEC_X86 is not set
+# CONFIG_XZ_DEC_POWERPC is not set
+# CONFIG_XZ_DEC_IA64 is not set
+CONFIG_XZ_DEC_ARM=y
+# CONFIG_XZ_DEC_ARMTHUMB is not set
+# CONFIG_XZ_DEC_SPARC is not set
+# CONFIG_XZ_DEC_MICROLZMA is not set
+CONFIG_XZ_DEC_BCJ=y
+# CONFIG_XZ_DEC_TEST is not set
 CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_ASSOCIATIVE_ARRAY=y
 CONFIG_HAS_IOMEM=y
-- 
2.39.2




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

* [DistroKit] [PATCH v2 10/14] rauc: add initial support
  2023-04-26 20:14 [DistroKit] [PATCH v2 00/14] v7a: add redundant update support via RAUC Roland Hieber
                   ` (8 preceding siblings ...)
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 09/14] v7a: kernel: enable features necessary for RAUC Roland Hieber
@ 2023-04-26 20:14 ` Roland Hieber
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 11/14] v7a: enable RAUC bundle creation Roland Hieber
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Roland Hieber @ 2023-04-26 20:14 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

Set up RAUC with a shared system.conf that uses the /dev symlinks which
the rauc-udev package creates based on the Device Tree compatible. Also
add a unit file that marks the booted partition as good after systemd
startup has finished successfully.

The key material for signing the RAUC bundles is provided by the
ptx-code-signing provider used for development, which we need to enable
in all platformconfigs since the ptxconfig is shared between all
platforms.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 configs/platform-mips/platformconfig          | 20 ++++-
 configs/platform-mipsel/platformconfig        | 20 ++++-
 configs/platform-rpi1/platformconfig          | 18 ++++-
 configs/platform-v7a/platformconfig           | 18 ++++-
 configs/platform-v7a_noneon/platformconfig    | 20 ++++-
 configs/platform-v8a/platformconfig           | 19 ++++-
 configs/platform-x86_64/platformconfig        | 20 ++++-
 configs/ptxconfig                             | 80 ++++++++++++++++---
 projectroot/etc/rauc/system.conf              | 17 ++++
 .../lib/systemd/system/rauc-mark-good.service | 14 ++++
 10 files changed, 230 insertions(+), 16 deletions(-)
 create mode 100644 projectroot/etc/rauc/system.conf
 create mode 100644 projectroot/usr/lib/systemd/system/rauc-mark-good.service

diff --git a/configs/platform-mips/platformconfig b/configs/platform-mips/platformconfig
index 085b9c4da94a..f52fb9075dd6 100644
--- a/configs/platform-mips/platformconfig
+++ b/configs/platform-mips/platformconfig
@@ -19,6 +19,7 @@ PTXCONF_PLATFORM="mips"
 PTXCONF_PLATFORM_VERSION="-${PTXDIST_BSP_AUTOVERSION}"
 PTXCONF_RUNTIME=y
 PTXCONF_BUILDTIME=y
+PTXCONF_VIRTUAL=y
 PTXCONF_PLATFORMCONFIG_VERSION="2023.04.0"
 
 #
@@ -202,16 +203,33 @@ PTXCONF_IMAGE_XPKG_EXTRA_ARGS=""
 # PTXCONF_KERNEL_FIT is not set
 # end of image creation options        
 
-# PTXCONF_CODE_SIGNING is not set
+PTXCONF_CODE_SIGNING=y
+PTXCONF_CODE_SIGNING_PROVIDER="devel"
+PTXCONF_CODE_SIGNING_PROVIDER_DEVEL=y
+PTXCONF_HOST_PTX_CODE_SIGNING_DEV=y
+PTXCONF_HOST_CMAKE=y
 PTXCONF_HOST_E2FSPROGS=y
+PTXCONF_HOST_EXTRACT_CERT=y
 PTXCONF_HOST_FLEX=y
 PTXCONF_HOST_GENEXT2FS=y
 PTXCONF_HOST_GENIMAGE=y
 PTXCONF_HOST_LIBCONFUSE=y
+PTXCONF_HOST_LIBFFI=y
 PTXCONF_HOST_LIBKMOD=y
 PTXCONF_HOST_LIBLZO=y
+PTXCONF_HOST_LIBP11=y
+PTXCONF_HOST_LIBTASN1=y
 PTXCONF_HOST_LZOP=y
 PTXCONF_HOST_M4=y
+PTXCONF_HOST_MESON=y
+PTXCONF_HOST_NINJA=y
+PTXCONF_HOST_OPENSC=y
+PTXCONF_HOST_OPENSSL=y
+PTXCONF_HOST_P11_KIT=y
+PTXCONF_HOST_SOFTHSM=y
+PTXCONF_HOST_SQLITE=y
+PTXCONF_HOST_SYSTEM_PYTHON3=y
+PTXCONF_HOST_SYSTEM_PYTHON3_SETUPTOOLS=y
 PTXCONF_HOST_UTIL_LINUX=y
 
 #
diff --git a/configs/platform-mipsel/platformconfig b/configs/platform-mipsel/platformconfig
index 8ffc452fa7bc..25507a0f3ecb 100644
--- a/configs/platform-mipsel/platformconfig
+++ b/configs/platform-mipsel/platformconfig
@@ -19,6 +19,7 @@ PTXCONF_PLATFORM="mipsel"
 PTXCONF_PLATFORM_VERSION="-${PTXDIST_BSP_AUTOVERSION}"
 PTXCONF_RUNTIME=y
 PTXCONF_BUILDTIME=y
+PTXCONF_VIRTUAL=y
 PTXCONF_PLATFORMCONFIG_VERSION="2023.04.0"
 
 #
@@ -198,16 +199,33 @@ PTXCONF_IMAGE_XPKG_EXTRA_ARGS=""
 # PTXCONF_KERNEL_FIT is not set
 # end of image creation options        
 
-# PTXCONF_CODE_SIGNING is not set
+PTXCONF_CODE_SIGNING=y
+PTXCONF_CODE_SIGNING_PROVIDER="devel"
+PTXCONF_CODE_SIGNING_PROVIDER_DEVEL=y
+PTXCONF_HOST_PTX_CODE_SIGNING_DEV=y
+PTXCONF_HOST_CMAKE=y
 PTXCONF_HOST_E2FSPROGS=y
+PTXCONF_HOST_EXTRACT_CERT=y
 PTXCONF_HOST_FLEX=y
 PTXCONF_HOST_GENEXT2FS=y
 PTXCONF_HOST_GENIMAGE=y
 PTXCONF_HOST_LIBCONFUSE=y
+PTXCONF_HOST_LIBFFI=y
 PTXCONF_HOST_LIBKMOD=y
 PTXCONF_HOST_LIBLZO=y
+PTXCONF_HOST_LIBP11=y
+PTXCONF_HOST_LIBTASN1=y
 PTXCONF_HOST_LZOP=y
 PTXCONF_HOST_M4=y
+PTXCONF_HOST_MESON=y
+PTXCONF_HOST_NINJA=y
+PTXCONF_HOST_OPENSC=y
+PTXCONF_HOST_OPENSSL=y
+PTXCONF_HOST_P11_KIT=y
+PTXCONF_HOST_SOFTHSM=y
+PTXCONF_HOST_SQLITE=y
+PTXCONF_HOST_SYSTEM_PYTHON3=y
+PTXCONF_HOST_SYSTEM_PYTHON3_SETUPTOOLS=y
 PTXCONF_HOST_UTIL_LINUX=y
 
 #
diff --git a/configs/platform-rpi1/platformconfig b/configs/platform-rpi1/platformconfig
index d10c1851f1fa..ce765b7aa299 100644
--- a/configs/platform-rpi1/platformconfig
+++ b/configs/platform-rpi1/platformconfig
@@ -270,20 +270,36 @@ PTXCONF_IMAGE_XPKG_EXTRA_ARGS=""
 # PTXCONF_KERNEL_FIT is not set
 # end of image creation options        
 
-# PTXCONF_CODE_SIGNING is not set
+PTXCONF_CODE_SIGNING=y
+PTXCONF_CODE_SIGNING_PROVIDER="devel"
+PTXCONF_CODE_SIGNING_PROVIDER_DEVEL=y
+PTXCONF_HOST_PTX_CODE_SIGNING_DEV=y
+PTXCONF_HOST_CMAKE=y
 PTXCONF_HOST_DOSFSTOOLS=y
 PTXCONF_HOST_E2FSPROGS=y
+PTXCONF_HOST_EXTRACT_CERT=y
 PTXCONF_HOST_FLEX=y
 PTXCONF_HOST_GENEXT2FS=y
 PTXCONF_HOST_GENIMAGE=y
 PTXCONF_HOST_LIBCONFUSE=y
+PTXCONF_HOST_LIBFFI=y
 PTXCONF_HOST_LIBKMOD=y
 PTXCONF_HOST_LIBLZO=y
+PTXCONF_HOST_LIBP11=y
+PTXCONF_HOST_LIBTASN1=y
 PTXCONF_HOST_LZOP=y
 PTXCONF_HOST_M4=y
+PTXCONF_HOST_MESON=y
 PTXCONF_HOST_MTOOLS=y
+PTXCONF_HOST_NINJA=y
+PTXCONF_HOST_OPENSC=y
 PTXCONF_HOST_OPENSSL=y
+PTXCONF_HOST_P11_KIT=y
+PTXCONF_HOST_SOFTHSM=y
+PTXCONF_HOST_SQLITE=y
 PTXCONF_HOST_SYSTEM_BC=y
+PTXCONF_HOST_SYSTEM_PYTHON3=y
+PTXCONF_HOST_SYSTEM_PYTHON3_SETUPTOOLS=y
 PTXCONF_HOST_UTIL_LINUX=y
 
 #
diff --git a/configs/platform-v7a/platformconfig b/configs/platform-v7a/platformconfig
index a5fd92ee8fa2..562b8bd3a620 100644
--- a/configs/platform-v7a/platformconfig
+++ b/configs/platform-v7a/platformconfig
@@ -19,6 +19,7 @@ PTXCONF_PLATFORM="v7a"
 PTXCONF_PLATFORM_VERSION="-${PTXDIST_BSP_AUTOVERSION}"
 PTXCONF_RUNTIME=y
 PTXCONF_BUILDTIME=y
+PTXCONF_VIRTUAL=y
 PTXCONF_PLATFORMCONFIG_VERSION="2023.04.0"
 
 #
@@ -295,21 +296,36 @@ PTXCONF_IMAGE_XPKG_EXTRA_ARGS=""
 # PTXCONF_KERNEL_FIT is not set
 # end of image creation options        
 
-# PTXCONF_CODE_SIGNING is not set
+PTXCONF_CODE_SIGNING=y
+PTXCONF_CODE_SIGNING_PROVIDER="devel"
+PTXCONF_CODE_SIGNING_PROVIDER_DEVEL=y
+PTXCONF_HOST_PTX_CODE_SIGNING_DEV=y
+PTXCONF_HOST_CMAKE=y
 PTXCONF_HOST_DOSFSTOOLS=y
 PTXCONF_HOST_E2FSPROGS=y
+PTXCONF_HOST_EXTRACT_CERT=y
 PTXCONF_HOST_FLEX=y
 PTXCONF_HOST_GENEXT2FS=y
 PTXCONF_HOST_GENIMAGE=y
 PTXCONF_HOST_LIBCONFUSE=y
+PTXCONF_HOST_LIBFFI=y
 PTXCONF_HOST_LIBKMOD=y
 PTXCONF_HOST_LIBLZO=y
+PTXCONF_HOST_LIBP11=y
+PTXCONF_HOST_LIBTASN1=y
 PTXCONF_HOST_LZOP=y
 PTXCONF_HOST_M4=y
+PTXCONF_HOST_MESON=y
 PTXCONF_HOST_MTOOLS=y
+PTXCONF_HOST_NINJA=y
+PTXCONF_HOST_OPENSC=y
 PTXCONF_HOST_OPENSSL=y
+PTXCONF_HOST_P11_KIT=y
+PTXCONF_HOST_SOFTHSM=y
+PTXCONF_HOST_SQLITE=y
 PTXCONF_HOST_SYSTEM_BC=y
 PTXCONF_HOST_SYSTEM_PYTHON3=y
+PTXCONF_HOST_SYSTEM_PYTHON3_SETUPTOOLS=y
 PTXCONF_HOST_UTIL_LINUX=y
 PTXCONF_HOST_TF_A=y
 
diff --git a/configs/platform-v7a_noneon/platformconfig b/configs/platform-v7a_noneon/platformconfig
index 031ba98c274a..469fe8defa8d 100644
--- a/configs/platform-v7a_noneon/platformconfig
+++ b/configs/platform-v7a_noneon/platformconfig
@@ -19,6 +19,7 @@ PTXCONF_PLATFORM="v7a_noneon"
 PTXCONF_PLATFORM_VERSION="-${PTXDIST_BSP_AUTOVERSION}"
 PTXCONF_RUNTIME=y
 PTXCONF_BUILDTIME=y
+PTXCONF_VIRTUAL=y
 PTXCONF_PLATFORMCONFIG_VERSION="2023.04.0"
 
 #
@@ -252,19 +253,36 @@ PTXCONF_IMAGE_XPKG_EXTRA_ARGS=""
 # PTXCONF_KERNEL_FIT is not set
 # end of image creation options        
 
-# PTXCONF_CODE_SIGNING is not set
+PTXCONF_CODE_SIGNING=y
+PTXCONF_CODE_SIGNING_PROVIDER="devel"
+PTXCONF_CODE_SIGNING_PROVIDER_DEVEL=y
+PTXCONF_HOST_PTX_CODE_SIGNING_DEV=y
+PTXCONF_HOST_CMAKE=y
 PTXCONF_HOST_DOSFSTOOLS=y
 PTXCONF_HOST_E2FSPROGS=y
+PTXCONF_HOST_EXTRACT_CERT=y
 PTXCONF_HOST_FLEX=y
 PTXCONF_HOST_GENEXT2FS=y
 PTXCONF_HOST_GENIMAGE=y
 PTXCONF_HOST_LIBCONFUSE=y
+PTXCONF_HOST_LIBFFI=y
 PTXCONF_HOST_LIBKMOD=y
 PTXCONF_HOST_LIBLZO=y
+PTXCONF_HOST_LIBP11=y
+PTXCONF_HOST_LIBTASN1=y
 PTXCONF_HOST_LZOP=y
 PTXCONF_HOST_M4=y
+PTXCONF_HOST_MESON=y
 PTXCONF_HOST_MTOOLS=y
+PTXCONF_HOST_NINJA=y
+PTXCONF_HOST_OPENSC=y
+PTXCONF_HOST_OPENSSL=y
+PTXCONF_HOST_P11_KIT=y
+PTXCONF_HOST_SOFTHSM=y
+PTXCONF_HOST_SQLITE=y
 PTXCONF_HOST_SYSTEM_BC=y
+PTXCONF_HOST_SYSTEM_PYTHON3=y
+PTXCONF_HOST_SYSTEM_PYTHON3_SETUPTOOLS=y
 PTXCONF_HOST_UTIL_LINUX=y
 
 #
diff --git a/configs/platform-v8a/platformconfig b/configs/platform-v8a/platformconfig
index b15e30dfe9a0..43b32c4ea0e9 100644
--- a/configs/platform-v8a/platformconfig
+++ b/configs/platform-v8a/platformconfig
@@ -19,6 +19,7 @@ PTXCONF_PLATFORM="v8a"
 PTXCONF_PLATFORM_VERSION="-${PTXDIST_BSP_AUTOVERSION}"
 PTXCONF_RUNTIME=y
 PTXCONF_BUILDTIME=y
+PTXCONF_VIRTUAL=y
 PTXCONF_PLATFORMCONFIG_VERSION="2023.04.0"
 
 #
@@ -263,19 +264,35 @@ PTXCONF_IMAGE_XPKG_EXTRA_ARGS=""
 # PTXCONF_KERNEL_FIT is not set
 # end of image creation options        
 
-# PTXCONF_CODE_SIGNING is not set
+PTXCONF_CODE_SIGNING=y
+PTXCONF_CODE_SIGNING_PROVIDER="devel"
+PTXCONF_CODE_SIGNING_PROVIDER_DEVEL=y
+PTXCONF_HOST_PTX_CODE_SIGNING_DEV=y
+PTXCONF_HOST_CMAKE=y
 PTXCONF_HOST_E2FSPROGS=y
+PTXCONF_HOST_EXTRACT_CERT=y
 PTXCONF_HOST_FLEX=y
 PTXCONF_HOST_GENEXT2FS=y
 PTXCONF_HOST_GENIMAGE=y
 PTXCONF_HOST_LIBCONFUSE=y
+PTXCONF_HOST_LIBFFI=y
 PTXCONF_HOST_LIBKMOD=y
 PTXCONF_HOST_LIBLZO=y
+PTXCONF_HOST_LIBP11=y
+PTXCONF_HOST_LIBTASN1=y
 PTXCONF_HOST_LIBUSB=y
 PTXCONF_HOST_LZOP=y
 PTXCONF_HOST_M4=y
+PTXCONF_HOST_MESON=y
+PTXCONF_HOST_NINJA=y
+PTXCONF_HOST_OPENSC=y
 PTXCONF_HOST_OPENSSL=y
+PTXCONF_HOST_P11_KIT=y
+PTXCONF_HOST_SOFTHSM=y
+PTXCONF_HOST_SQLITE=y
 PTXCONF_HOST_SYSTEM_BC=y
+PTXCONF_HOST_SYSTEM_PYTHON3=y
+PTXCONF_HOST_SYSTEM_PYTHON3_SETUPTOOLS=y
 PTXCONF_HOST_UTIL_LINUX=y
 PTXCONF_FIRMWARE_IMX=y
 # PTXCONF_FIRMWARE_IMX_VPU_IMX27 is not set
diff --git a/configs/platform-x86_64/platformconfig b/configs/platform-x86_64/platformconfig
index 3ba9acd203a9..24f3ce33d36c 100644
--- a/configs/platform-x86_64/platformconfig
+++ b/configs/platform-x86_64/platformconfig
@@ -19,6 +19,7 @@ PTXCONF_PLATFORM="x86_64"
 PTXCONF_PLATFORM_VERSION="-${PTXDIST_BSP_AUTOVERSION}"
 PTXCONF_RUNTIME=y
 PTXCONF_BUILDTIME=y
+PTXCONF_VIRTUAL=y
 PTXCONF_PLATFORMCONFIG_VERSION="2023.04.0"
 
 #
@@ -235,16 +236,33 @@ PTXCONF_IMAGE_XPKG_EXTRA_ARGS=""
 # PTXCONF_KERNEL_FIT is not set
 # end of image creation options        
 
-# PTXCONF_CODE_SIGNING is not set
+PTXCONF_CODE_SIGNING=y
+PTXCONF_CODE_SIGNING_PROVIDER="devel"
+PTXCONF_CODE_SIGNING_PROVIDER_DEVEL=y
+PTXCONF_HOST_PTX_CODE_SIGNING_DEV=y
+PTXCONF_HOST_CMAKE=y
 PTXCONF_HOST_E2FSPROGS=y
+PTXCONF_HOST_EXTRACT_CERT=y
 PTXCONF_HOST_GENEXT2FS=y
 PTXCONF_HOST_GENIMAGE=y
 PTXCONF_HOST_LIBCONFUSE=y
 PTXCONF_HOST_LIBELF=y
+PTXCONF_HOST_LIBFFI=y
 PTXCONF_HOST_LIBKMOD=y
 PTXCONF_HOST_LIBLZO=y
+PTXCONF_HOST_LIBP11=y
+PTXCONF_HOST_LIBTASN1=y
 PTXCONF_HOST_LZOP=y
+PTXCONF_HOST_MESON=y
+PTXCONF_HOST_NINJA=y
+PTXCONF_HOST_OPENSC=y
+PTXCONF_HOST_OPENSSL=y
+PTXCONF_HOST_P11_KIT=y
+PTXCONF_HOST_SOFTHSM=y
+PTXCONF_HOST_SQLITE=y
 PTXCONF_HOST_SYSTEM_BC=y
+PTXCONF_HOST_SYSTEM_PYTHON3=y
+PTXCONF_HOST_SYSTEM_PYTHON3_SETUPTOOLS=y
 PTXCONF_HOST_UTIL_LINUX=y
 PTXCONF_HOST_ZLIB=y
 
diff --git a/configs/ptxconfig b/configs/ptxconfig
index e123c5b9097a..d1894c52b44a 100644
--- a/configs/ptxconfig
+++ b/configs/ptxconfig
@@ -126,6 +126,7 @@ PTXCONF_HOST_SYSTEM_PYTHON3_JINJA2=y
 PTXCONF_HOST_SYSTEM_PYTHON3_SETUPTOOLS=y
 PTXCONF_HOST_XORGPROTO=y
 PTXCONF_HOST_ZLIB=y
+PTXCONF_CODE_SIGNING=y
 PTXCONF_HOST_AUTOTOOLS_AUTOCONF=y
 PTXCONF_HOST_AUTOTOOLS_AUTOMAKE=y
 PTXCONF_HOST_AUTOTOOLS_LIBTOOL=y
@@ -543,7 +544,7 @@ PTXCONF_BUSYBOX_FEATURE_GZIP_DECOMPRESS=y
 PTXCONF_BUSYBOX_TAR=y
 PTXCONF_BUSYBOX_FEATURE_TAR_LONG_OPTIONS=y
 PTXCONF_BUSYBOX_FEATURE_TAR_CREATE=y
-# PTXCONF_BUSYBOX_FEATURE_TAR_AUTODETECT is not set
+PTXCONF_BUSYBOX_FEATURE_TAR_AUTODETECT=y
 PTXCONF_BUSYBOX_FEATURE_TAR_FROM=y
 # PTXCONF_BUSYBOX_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set
 # PTXCONF_BUSYBOX_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set
@@ -933,7 +934,8 @@ PTXCONF_BUSYBOX_SULOGIN=y
 #
 # PTXCONF_BUSYBOX_ACPID is not set
 # PTXCONF_BUSYBOX_BLKDISCARD is not set
-# PTXCONF_BUSYBOX_BLKID is not set
+PTXCONF_BUSYBOX_BLKID=y
+PTXCONF_BUSYBOX_FEATURE_BLKID_TYPE=y
 # PTXCONF_BUSYBOX_BLOCKDEV is not set
 # PTXCONF_BUSYBOX_CAL is not set
 # PTXCONF_BUSYBOX_CHRT is not set
@@ -1006,6 +1008,38 @@ PTXCONF_BUSYBOX_RENICE=y
 # PTXCONF_BUSYBOX_UMOUNT is not set
 # PTXCONF_BUSYBOX_UNSHARE is not set
 # PTXCONF_BUSYBOX_WALL is not set
+PTXCONF_BUSYBOX_VOLUMEID=y
+
+#
+# Filesystem/Volume identification
+#
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_BCACHE=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_BTRFS=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_CRAMFS=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_EROFS=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_EXFAT=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_EXT=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_F2FS=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_FAT=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_HFS=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_ISO9660=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_JFS=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_LFS=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_LINUXRAID=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_LINUXSWAP=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_LUKS=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_MINIX=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_NILFS=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_NTFS=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_OCFS2=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_REISERFS=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_ROMFS=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_SQUASHFS=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_SYSV=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_UBIFS=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_UDF=y
+PTXCONF_BUSYBOX_FEATURE_VOLUMEID_XFS=y
+# end of Filesystem/Volume identification
 # end of Linux System Utilities
 
 #
@@ -1307,7 +1341,8 @@ PTXCONF_BUSYBOX_LOGGER=y
 # PTXCONF_DFU_UTIL is not set
 # PTXCONF_DIALOG is not set
 # PTXCONF_DIFFUTILS is not set
-# PTXCONF_DT_UTILS is not set
+PTXCONF_DT_UTILS=y
+# PTXCONF_DT_UTILS_STATE_COMPAT is not set
 # PTXCONF_EFIBOOTMGR is not set
 # PTXCONF_EFIVAR is not set
 # PTXCONF_FIGLET is not set
@@ -1552,7 +1587,10 @@ PTXCONF_UTIL_LINUX_SFDISK=y
 #
 # misc-utils
 #
-# PTXCONF_UTIL_LINUX_BLKID is not set
+
+#
+# BusyBox' blkid is selected!
+#
 # PTXCONF_UTIL_LINUX_FINDFS is not set
 # PTXCONF_UTIL_LINUX_GETOPT is not set
 PTXCONF_UTIL_LINUX_LSBLK=y
@@ -1983,6 +2021,7 @@ PTXCONF_E2FSPROGS=y
 #
 # build options                 
 #
+PTXCONF_E2FSPROGS_RESIZER=y
 # end of build options                 
 
 #
@@ -2018,7 +2057,7 @@ PTXCONF_E2FSPROGS_INSTALL_MKFS_EXT2=y
 PTXCONF_E2FSPROGS_INSTALL_MKFS_EXT3=y
 PTXCONF_E2FSPROGS_INSTALL_MKFS_EXT4=y
 # PTXCONF_E2FSPROGS_INSTALL_MKLOSTANDFOUND is not set
-# PTXCONF_E2FSPROGS_INSTALL_RESIZE2FS is not set
+PTXCONF_E2FSPROGS_INSTALL_RESIZE2FS=y
 # PTXCONF_E2FSPROGS_INSTALL_TUNE2FS is not set
 # end of binaries                      
 
@@ -2037,7 +2076,18 @@ PTXCONF_E2FSPROGS_INSTALL_MKFS_EXT4=y
 # PTXCONF_QUOTA_TOOLS is not set
 # PTXCONF_SAMBA is not set
 # PTXCONF_SDPARM is not set
-# PTXCONF_SQUASHFS_TOOLS is not set
+PTXCONF_SQUASHFS_TOOLS=y
+
+#
+# build options
+#
+# PTXCONF_SQUASHFS_TOOLS_ZSTD_SUPPORT is not set
+
+#
+# install options
+#
+# PTXCONF_SQUASHFS_TOOLS_MKSQUASHFS is not set
+PTXCONF_SQUASHFS_TOOLS_UNSQUASHFS=y
 # PTXCONF_SSHFS is not set
 # PTXCONF_UNZIP is not set
 # PTXCONF_XFSPROGS is not set
@@ -2080,7 +2130,19 @@ PTXCONF_E2FSPROGS_INSTALL_MKFS_EXT4=y
 # PTXCONF_LPC21ISP is not set
 # PTXCONF_MYSQLDB is not set
 # PTXCONF_RAUC_HAWKBIT_UPDATER is not set
-# PTXCONF_RAUC is not set
+PTXCONF_RAUC=y
+# PTXCONF_RAUC_CREATE is not set
+PTXCONF_RAUC_SERVICE=y
+PTXCONF_RAUC_NETWORK=y
+PTXCONF_RAUC_STREAMING=y
+PTXCONF_RAUC_JSON=y
+# PTXCONF_RAUC_GPT is not set
+PTXCONF_RAUC_CONFIGURATION=y
+PTXCONF_RAUC_COMPATIBLE="${PTXCONF_PROJECT_VENDOR} ${PTXCONF_PROJECT}"
+PTXCONF_RAUC_BUNDLE_VERSION="${PTXDIST_BSP_AUTOVERSION}"
+PTXCONF_RAUC_BAREBOX=y
+# PTXCONF_RAUC_U_BOOT is not set
+# PTXCONF_RAUC_EFI is not set
 # end of Applications                  
 
 #
@@ -2485,11 +2547,11 @@ PTXCONF_DBUS_SYSTEMD_UNIT=y
 # PTXCONF_GLIB_NETWORKING is not set
 PTXCONF_GLIB=y
 # PTXCONF_GLIB_GDBUS is not set
-# PTXCONF_GLIB_LIBMOUNT is not set
+PTXCONF_GLIB_LIBMOUNT=y
 # PTXCONF_GOBJECT_INTROSPECTION_HELPER is not set
 # PTXCONF_GTK_ENGINES is not set
 # PTXCONF_GTK is not set
-# PTXCONF_JSON_GLIB is not set
+PTXCONF_JSON_GLIB=y
 # PTXCONF_LIBGEE is not set
 # PTXCONF_LIBRSVG is not set
 # PTXCONF_PANGO is not set
diff --git a/projectroot/etc/rauc/system.conf b/projectroot/etc/rauc/system.conf
new file mode 100644
index 000000000000..191a2a1e4f8e
--- /dev/null
+++ b/projectroot/etc/rauc/system.conf
@@ -0,0 +1,17 @@
+[system]
+compatible=@RAUC_BUNDLE_COMPATIBLE@
+bootloader=barebox
+bundle-formats=verity
+
+[keyring]
+path=/etc/rauc/ca.cert.pem
+
+[slot.rootfs.0]
+device=/dev/disk/by-usage/rootfs0
+type=ext4
+bootname=system0
+
+[slot.rootfs.1]
+device=/dev/disk/by-usage/rootfs1
+type=ext4
+bootname=system1
diff --git a/projectroot/usr/lib/systemd/system/rauc-mark-good.service b/projectroot/usr/lib/systemd/system/rauc-mark-good.service
new file mode 100644
index 000000000000..89f56594766a
--- /dev/null
+++ b/projectroot/usr/lib/systemd/system/rauc-mark-good.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=RAUC Good-marking Service
+ConditionKernelCommandLine=|bootchooser.active
+ConditionKernelCommandLine=|rauc.slot
+Requires=boot-complete.target
+After=boot-complete.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/rauc status mark-good
+
+[Install]
+WantedBy=multi-user.target
-- 
2.39.2




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

* [DistroKit] [PATCH v2 11/14] v7a: enable RAUC bundle creation
  2023-04-26 20:14 [DistroKit] [PATCH v2 00/14] v7a: add redundant update support via RAUC Roland Hieber
                   ` (9 preceding siblings ...)
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 10/14] rauc: add initial support Roland Hieber
@ 2023-04-26 20:14 ` Roland Hieber
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 12/14] image-rauc: fork config from PTXdist 2023.04.0 Roland Hieber
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Roland Hieber @ 2023-04-26 20:14 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 configs/platform-v7a/platformconfig | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/configs/platform-v7a/platformconfig b/configs/platform-v7a/platformconfig
index 562b8bd3a620..e379820fc425 100644
--- a/configs/platform-v7a/platformconfig
+++ b/configs/platform-v7a/platformconfig
@@ -259,7 +259,12 @@ PTXCONF_IMAGE_KERNEL_INSTALL_EARLY=y
 # end of Generate images/linuximage    
 
 PTXCONF_IMAGE_LXA_MC1=y
-# PTXCONF_IMAGE_RAUC is not set
+PTXCONF_IMAGE_RAUC=y
+PTXCONF_IMAGE_RAUC_DESCRIPTION="DistroKit"
+# PTXCONF_IMAGE_RAUC_BUNDLE_FORMAT_PLAIN is not set
+PTXCONF_IMAGE_RAUC_BUNDLE_FORMAT_VERITY=y
+# PTXCONF_IMAGE_RAUC_BUNDLE_FORMAT_CRYPT is not set
+# PTXCONF_IMAGE_RAUC_INTERMEDIATE is not set
 PTXCONF_IMAGE_RIOTBOARD=y
 # PTXCONF_IMAGE_ROOT_CPIO is not set
 PTXCONF_IMAGE_ROOT_EXT=y
@@ -307,6 +312,7 @@ PTXCONF_HOST_EXTRACT_CERT=y
 PTXCONF_HOST_FLEX=y
 PTXCONF_HOST_GENEXT2FS=y
 PTXCONF_HOST_GENIMAGE=y
+PTXCONF_HOST_GLIB=y
 PTXCONF_HOST_LIBCONFUSE=y
 PTXCONF_HOST_LIBFFI=y
 PTXCONF_HOST_LIBKMOD=y
@@ -321,12 +327,16 @@ PTXCONF_HOST_NINJA=y
 PTXCONF_HOST_OPENSC=y
 PTXCONF_HOST_OPENSSL=y
 PTXCONF_HOST_P11_KIT=y
+PTXCONF_HOST_PCRE2=y
+PTXCONF_HOST_RAUC=y
 PTXCONF_HOST_SOFTHSM=y
 PTXCONF_HOST_SQLITE=y
+PTXCONF_HOST_SQUASHFS_TOOLS=y
 PTXCONF_HOST_SYSTEM_BC=y
 PTXCONF_HOST_SYSTEM_PYTHON3=y
 PTXCONF_HOST_SYSTEM_PYTHON3_SETUPTOOLS=y
 PTXCONF_HOST_UTIL_LINUX=y
+PTXCONF_HOST_ZLIB=y
 PTXCONF_HOST_TF_A=y
 
 #
-- 
2.39.2




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

* [DistroKit] [PATCH v2 12/14] image-rauc: fork config from PTXdist 2023.04.0
  2023-04-26 20:14 [DistroKit] [PATCH v2 00/14] v7a: add redundant update support via RAUC Roland Hieber
                   ` (10 preceding siblings ...)
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 11/14] v7a: enable RAUC bundle creation Roland Hieber
@ 2023-04-26 20:14 ` Roland Hieber
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 13/14] image-rauc: use ext4 rootfs instead of tar.gz Roland Hieber
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 14/14] v7a: run: start with barebox by default Roland Hieber
  13 siblings, 0 replies; 15+ messages in thread
From: Roland Hieber @ 2023-04-26 20:14 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 config/images/rauc.config | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 config/images/rauc.config

diff --git a/config/images/rauc.config b/config/images/rauc.config
new file mode 100644
index 000000000000..e4169cc8cd95
--- /dev/null
+++ b/config/images/rauc.config
@@ -0,0 +1,22 @@
+image @IMAGE@ {
+	rauc {
+		file root.tar.gz { image = "root.tgz" }
+		manifest = "
+			[update]
+			compatible=@RAUC_BUNDLE_COMPATIBLE@
+			version=@RAUC_BUNDLE_VERSION@
+			build=@RAUC_BUNDLE_BUILD@
+			description=@RAUC_BUNDLE_DESCRIPTION@
+
+			[bundle]
+			format=@RAUC_BUNDLE_FORMAT@
+
+			[image.rootfs]
+			filename=root.tar.gz
+			"
+		cert = "@RAUC_CERT@"
+		key = "@RAUC_KEY@"
+		keyring = "@RAUC_KEYRING@"
+		intermediate = @RAUC_INTERMEDIATE@
+	}
+}
-- 
2.39.2




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

* [DistroKit] [PATCH v2 13/14] image-rauc: use ext4 rootfs instead of tar.gz
  2023-04-26 20:14 [DistroKit] [PATCH v2 00/14] v7a: add redundant update support via RAUC Roland Hieber
                   ` (11 preceding siblings ...)
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 12/14] image-rauc: fork config from PTXdist 2023.04.0 Roland Hieber
@ 2023-04-26 20:14 ` Roland Hieber
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 14/14] v7a: run: start with barebox by default Roland Hieber
  13 siblings, 0 replies; 15+ messages in thread
From: Roland Hieber @ 2023-04-26 20:14 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

On one hand, the squashfs inside the RAUC bundle already uses
compression, so with a tar.gz inside a squashfs the content is
compressed twice. Also using ext4 makes it possible to use adaptive
updates in the future.

(Yes, the image generated by the image-root-ext recipe is really called
"root.ext2", even if it's an ext4 image.)

Link: https://rauc.readthedocs.io/en/latest/advanced.html#adaptive-updates
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 config/images/rauc.config | 4 ++--
 platforms/image-rauc.in   | 6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)
 create mode 100644 platforms/image-rauc.in

diff --git a/config/images/rauc.config b/config/images/rauc.config
index e4169cc8cd95..83e074274961 100644
--- a/config/images/rauc.config
+++ b/config/images/rauc.config
@@ -1,6 +1,6 @@
 image @IMAGE@ {
 	rauc {
-		file root.tar.gz { image = "root.tgz" }
+		file root.ext4 { image = "root.ext2" }
 		manifest = "
 			[update]
 			compatible=@RAUC_BUNDLE_COMPATIBLE@
@@ -12,7 +12,7 @@ image @IMAGE@ {
 			format=@RAUC_BUNDLE_FORMAT@
 
 			[image.rootfs]
-			filename=root.tar.gz
+			filename=root.ext4
 			"
 		cert = "@RAUC_CERT@"
 		key = "@RAUC_KEY@"
diff --git a/platforms/image-rauc.in b/platforms/image-rauc.in
new file mode 100644
index 000000000000..df328522a747
--- /dev/null
+++ b/platforms/image-rauc.in
@@ -0,0 +1,6 @@
+## SECTION=image
+
+menuconfig IMAGE_RAUC
+	tristate
+	select IMAGE_ROOT_EXT
+	select IMAGE_ROOT_EXT_EXT4
-- 
2.39.2




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

* [DistroKit] [PATCH v2 14/14] v7a: run: start with barebox by default
  2023-04-26 20:14 [DistroKit] [PATCH v2 00/14] v7a: add redundant update support via RAUC Roland Hieber
                   ` (12 preceding siblings ...)
  2023-04-26 20:14 ` [DistroKit] [PATCH v2 13/14] image-rauc: use ext4 rootfs instead of tar.gz Roland Hieber
@ 2023-04-26 20:14 ` Roland Hieber
  13 siblings, 0 replies; 15+ messages in thread
From: Roland Hieber @ 2023-04-26 20:14 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

Booting via 9p results in a machine that feeld very differently than any
other boards in platform-v7a, mainly because there is no data partition,
no barebox-state, and therefore no RAUC support. All of this is possible
by booting from the emulated SD card image through barebox.

Default to barebox so that qemu-vexpress feels as much as possible like
booting from other boards.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 configs/platform-v7a/run | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/platform-v7a/run b/configs/platform-v7a/run
index 004706ddaf59..3874a7b2f0af 100755
--- a/configs/platform-v7a/run
+++ b/configs/platform-v7a/run
@@ -177,7 +177,7 @@ run_qemu_barebox() {
 		"${QEMU_BAREBOX_ARGS[@]}"
 }
 
-target="${1:-9p}"
+target="${1:-barebox}"
 
 #set -x
 run_qemu_${target}
-- 
2.39.2




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

end of thread, other threads:[~2023-04-26 20:14 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-26 20:14 [DistroKit] [PATCH v2 00/14] v7a: add redundant update support via RAUC Roland Hieber
2023-04-26 20:14 ` [DistroKit] [PATCH v2 01/14] platforms: revert to default systemd loglevel Roland Hieber
2023-04-26 20:14 ` [DistroKit] [PATCH v2 02/14] ptxconfig: enable more tools for debugging Roland Hieber
2023-04-26 20:14 ` [DistroKit] [PATCH v2 03/14] rauc-udev: add a compatibility layer for mapping partitions Roland Hieber
2023-04-26 20:14 ` [DistroKit] [PATCH v2 04/14] v7a: barebox: include generic bootstate node in device tree Roland Hieber
2023-04-26 20:14 ` [DistroKit] [PATCH v2 05/14] v7a: add RAUC support for qemu-vexpress Roland Hieber
2023-04-26 20:14 ` [DistroKit] [PATCH v2 06/14] v7a: add RAUC support for beaglebone black Roland Hieber
2023-04-26 20:14 ` [DistroKit] [PATCH v2 07/14] v7a: add RAUC support for rpi3 Roland Hieber
2023-04-26 20:14 ` [DistroKit] [PATCH v2 08/14] v7a: add RAUC support for riotboard Roland Hieber
2023-04-26 20:14 ` [DistroKit] [PATCH v2 09/14] v7a: kernel: enable features necessary for RAUC Roland Hieber
2023-04-26 20:14 ` [DistroKit] [PATCH v2 10/14] rauc: add initial support Roland Hieber
2023-04-26 20:14 ` [DistroKit] [PATCH v2 11/14] v7a: enable RAUC bundle creation Roland Hieber
2023-04-26 20:14 ` [DistroKit] [PATCH v2 12/14] image-rauc: fork config from PTXdist 2023.04.0 Roland Hieber
2023-04-26 20:14 ` [DistroKit] [PATCH v2 13/14] image-rauc: use ext4 rootfs instead of tar.gz Roland Hieber
2023-04-26 20:14 ` [DistroKit] [PATCH v2 14/14] v7a: run: start with barebox by default Roland Hieber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox