DistroKit Mailinglist
 help / color / mirror / Atom feed
* [DistroKit] [PATCH next v3 0/4] refactor data partition setup
@ 2023-12-13 14:47 Roland Hieber
  2023-12-13 14:47 ` [DistroKit] [PATCH next v3 1/4] systemd: make systemd-repart work for mips Roland Hieber
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Roland Hieber @ 2023-12-13 14:47 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

PATCH next v3:
* fixups to make the state of the series already applied on the next
  branch work on remaining platforms
* don't use "linux-generic" Type UUID for data partition because then
  systemd-repart will match the STM32MP1 bootloader partitions
* select busybox rdev, and don't run systemd-repart when we don't have a
  partitionable disk (feedback from PTX Jenkins, Bastian Krause and
  Robert Schwebel)
* fix systemd-repart on mips (feedback from PTX Jenkins)
* rauc-udev: remove fallback match for data partition in mmcblk0p3

PATCH v2: https://lore.distrokit.org/distrokit/20231103225253.1349209-1-rhi@pengutronix.de
* ENV{PARTNAME} is not set for all partitions, use
  ENV{ID_PART_ENTRY_NAME} instead, which is also used by udev's
  60-persistent-storage.rules to generate /dev/disk/by-partlabel/*

PATCH v1: https://lore.distrokit.org/distrokit/20231103182438.1051601-1-rhi@pengutronix.de

Roland Hieber (4):
  systemd: make systemd-repart work for mips
  busybox: enable rdev to find out the root device
  squash! datapartition: generate partitions via systemd-repart
  fixup! rauc-udev: generate symlinks based on GPT partition labels

 configs/ptxconfig                             |   2 +-
 ...d-defines-for-big-endian-MIPS-MIPS64.patch | 122 ++++++++++++++++++
 patches/systemd-254.5/series                  |   1 +
 projectroot/etc/rc.once.d/repart              |  10 +-
 projectroot/etc/repart.rc-once.d/30-data.conf |   3 +-
 .../lib/udev/rules.d/90-rauc-partitions.rules |   4 -
 6 files changed, 134 insertions(+), 8 deletions(-)
 create mode 100644 patches/systemd-254.5/0001-sd-gpt-add-defines-for-big-endian-MIPS-MIPS64.patch
 create mode 100644 patches/systemd-254.5/series

-- 
2.39.2




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

* [DistroKit] [PATCH next v3 1/4] systemd: make systemd-repart work for mips
  2023-12-13 14:47 [DistroKit] [PATCH next v3 0/4] refactor data partition setup Roland Hieber
@ 2023-12-13 14:47 ` Roland Hieber
  2023-12-13 14:47 ` [DistroKit] [PATCH next v3 2/4] busybox: enable rdev to find out the root device Roland Hieber
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Roland Hieber @ 2023-12-13 14:47 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

systemd v254 doesn't know about the partition type GUID for big-endian
MIPS root partitions yet, so systemd-repart fails to parse the
"Type=root" setting in its config, and fails to start. Backport a patch
from systemd 255-rc1, which will wire up the respective GUID.

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 ...d-defines-for-big-endian-MIPS-MIPS64.patch | 122 ++++++++++++++++++
 patches/systemd-254.5/series                  |   1 +
 2 files changed, 123 insertions(+)
 create mode 100644 patches/systemd-254.5/0001-sd-gpt-add-defines-for-big-endian-MIPS-MIPS64.patch
 create mode 100644 patches/systemd-254.5/series

diff --git a/patches/systemd-254.5/0001-sd-gpt-add-defines-for-big-endian-MIPS-MIPS64.patch b/patches/systemd-254.5/0001-sd-gpt-add-defines-for-big-endian-MIPS-MIPS64.patch
new file mode 100644
index 000000000000..ca65e413ab66
--- /dev/null
+++ b/patches/systemd-254.5/0001-sd-gpt-add-defines-for-big-endian-MIPS-MIPS64.patch
@@ -0,0 +1,122 @@
+From 7c6dd200468f88c189d042c7ee25547032e296cd Mon Sep 17 00:00:00 2001
+From: Roland Hieber <rhi@pengutronix.de>
+Date: Tue, 10 Oct 2023 11:34:20 +0200
+Subject: [PATCH] sd-gpt: add defines for big-endian MIPS/MIPS64
+
+According to the respective change in the DPS:
+<https://github.com/uapi-group/specifications/pull/86>
+
+Signed-off-by: Roland Hieber <rhi@pengutronix.de>
+Upstream-Status: Backport [https://github.com/systemd/systemd/commit/7c6dd200468f88c189d0]
+---
+ man/systemd-gpt-auto-generator.xml |  2 +-
+ src/shared/gpt.c                   |  2 ++
+ src/systemd/sd-gpt.h               | 27 +++++++++++++++++++++++++++
+ 3 files changed, 30 insertions(+), 1 deletion(-)
+
+diff --git a/man/systemd-gpt-auto-generator.xml b/man/systemd-gpt-auto-generator.xml
+index e70bce69758e..d962ac63f79e 100644
+--- a/man/systemd-gpt-auto-generator.xml
++++ b/man/systemd-gpt-auto-generator.xml
+@@ -97,7 +97,7 @@
+           </row>
+           <row>
+             <entry>
+-              <constant>SD_GPT_ROOT_ALPHA</constant> <constant>SD_GPT_ROOT_ARC</constant> <constant>SD_GPT_ROOT_ARM</constant> <constant>SD_GPT_ROOT_ARM64</constant> <constant>SD_GPT_ROOT_IA64</constant> <constant>SD_GPT_ROOT_LOONGARCH64</constant> <constant>SD_GPT_ROOT_MIPS_LE</constant> <constant>SD_GPT_ROOT_MIPS64_LE</constant> <constant>SD_GPT_ROOT_PARISC</constant> <constant>SD_GPT_ROOT_PPC</constant> <constant>SD_GPT_ROOT_PPC64</constant> <constant>SD_GPT_ROOT_PPC64_LE</constant> <constant>SD_GPT_ROOT_RISCV32</constant> <constant>SD_GPT_ROOT_RISCV64</constant> <constant>SD_GPT_ROOT_S390</constant> <constant>SD_GPT_ROOT_S390X</constant> <constant>SD_GPT_ROOT_TILEGX</constant> <constant>SD_GPT_ROOT_X86</constant> <constant>SD_GPT_ROOT_X86_64</constant> <constant>SD_GPT_USR_ALPHA</constant> <constant>SD_GPT_USR_ARC</constant> <constant>SD_GPT_USR_ARM</constant> <constant>SD_GPT_USR_IA64</constant> <constant>SD_GPT_USR_LOONGARCH64</constant> <constant>SD_GPT_USR_MIPS_LE</constant> <constant>SD_GPT_USR_MIPS64_LE</constant> <constant>SD_GPT_USR_PARISC</constant> <constant>SD_GPT_USR_PPC</constant> <constant>SD_GPT_USR_PPC64</constant> <constant>SD_GPT_USR_PPC64_LE</constant> <constant>SD_GPT_USR_RISCV32</constant> <constant>SD_GPT_USR_RISCV64</constant> <constant>SD_GPT_USR_S390</constant> <constant>SD_GPT_USR_S390X</constant> <constant>SD_GPT_USR_TILEGX</constant> <constant>SD_GPT_USR_X86</constant>
++              <constant>SD_GPT_ROOT_ALPHA</constant> <constant>SD_GPT_ROOT_ARC</constant> <constant>SD_GPT_ROOT_ARM</constant> <constant>SD_GPT_ROOT_ARM64</constant> <constant>SD_GPT_ROOT_IA64</constant> <constant>SD_GPT_ROOT_LOONGARCH64</constant> <constant>SD_GPT_ROOT_MIPS</constant> <constant>SD_GPT_ROOT_MIPS64</constant> <constant>SD_GPT_ROOT_MIPS_LE</constant> <constant>SD_GPT_ROOT_MIPS64_LE</constant> <constant>SD_GPT_ROOT_PARISC</constant> <constant>SD_GPT_ROOT_PPC</constant> <constant>SD_GPT_ROOT_PPC64</constant> <constant>SD_GPT_ROOT_PPC64_LE</constant> <constant>SD_GPT_ROOT_RISCV32</constant> <constant>SD_GPT_ROOT_RISCV64</constant> <constant>SD_GPT_ROOT_S390</constant> <constant>SD_GPT_ROOT_S390X</constant> <constant>SD_GPT_ROOT_TILEGX</constant> <constant>SD_GPT_ROOT_X86</constant> <constant>SD_GPT_ROOT_X86_64</constant> <constant>SD_GPT_USR_ALPHA</constant> <constant>SD_GPT_USR_ARC</constant> <constant>SD_GPT_USR_ARM</constant> <constant>SD_GPT_USR_IA64</constant> <constant>SD_GPT_USR_LOONGARCH64</constant> <constant>SD_GPT_USR_MIPS_LE</constant> <constant>SD_GPT_USR_MIPS64_LE</constant> <constant>SD_GPT_USR_PARISC</constant> <constant>SD_GPT_USR_PPC</constant> <constant>SD_GPT_USR_PPC64</constant> <constant>SD_GPT_USR_PPC64_LE</constant> <constant>SD_GPT_USR_RISCV32</constant> <constant>SD_GPT_USR_RISCV64</constant> <constant>SD_GPT_USR_S390</constant> <constant>SD_GPT_USR_S390X</constant> <constant>SD_GPT_USR_TILEGX</constant> <constant>SD_GPT_USR_X86</constant>
+             </entry>
+             <entry>root partitions for other architectures</entry>
+             <entry><filename>/</filename></entry>
+diff --git a/src/shared/gpt.c b/src/shared/gpt.c
+index 2846bad5b802..d639463c24f5 100644
+--- a/src/shared/gpt.c
++++ b/src/shared/gpt.c
+@@ -143,6 +143,8 @@ const GptPartitionType gpt_partition_type_table[] = {
+         _GPT_ARCH_SEXTET(ARM64,       "aarch64"), /* Alias: must be listed after arm64 */
+         _GPT_ARCH_SEXTET(IA64,        "ia64"),
+         _GPT_ARCH_SEXTET(LOONGARCH64, "loongarch64"),
++        _GPT_ARCH_SEXTET(MIPS,        "mips"),
++        _GPT_ARCH_SEXTET(MIPS64,      "mips64"),
+         _GPT_ARCH_SEXTET(MIPS_LE,     "mips-le"),
+         _GPT_ARCH_SEXTET(MIPS64_LE,   "mips64-le"),
+         _GPT_ARCH_SEXTET(PARISC,      "parisc"),
+diff --git a/src/systemd/sd-gpt.h b/src/systemd/sd-gpt.h
+index dc389f649938..7ffa57a94513 100644
+--- a/src/systemd/sd-gpt.h
++++ b/src/systemd/sd-gpt.h
+@@ -29,6 +29,8 @@ _SD_BEGIN_DECLARATIONS;
+ #define SD_GPT_ROOT_ARM64       SD_ID128_MAKE(b9,21,b0,45,1d,f0,41,c3,af,44,4c,6f,28,0d,3f,ae)
+ #define SD_GPT_ROOT_IA64        SD_ID128_MAKE(99,3d,8d,3d,f8,0e,42,25,85,5a,9d,af,8e,d7,ea,97)
+ #define SD_GPT_ROOT_LOONGARCH64 SD_ID128_MAKE(77,05,58,00,79,2c,4f,94,b3,9a,98,c9,1b,76,2b,b6)
++#define SD_GPT_ROOT_MIPS        SD_ID128_MAKE(e9,43,45,44,6e,2c,47,cc,ba,e2,12,d6,de,af,b4,4c)
++#define SD_GPT_ROOT_MIPS64      SD_ID128_MAKE(d1,13,af,76,80,ef,41,b4,bd,b6,0c,ff,4d,3d,4a,25)
+ #define SD_GPT_ROOT_MIPS_LE     SD_ID128_MAKE(37,c5,8c,8a,d9,13,41,56,a2,5f,48,b1,b6,4e,07,f0)
+ #define SD_GPT_ROOT_MIPS64_LE   SD_ID128_MAKE(70,0b,da,43,7a,34,45,07,b1,79,ee,b9,3d,7a,7c,a3)
+ #define SD_GPT_ROOT_PARISC      SD_ID128_MAKE(1a,ac,db,3b,54,44,41,38,bd,9e,e5,c2,23,9b,23,46)
+@@ -48,6 +50,8 @@ _SD_BEGIN_DECLARATIONS;
+ #define SD_GPT_USR_ARM64        SD_ID128_MAKE(b0,e0,10,50,ee,5f,43,90,94,9a,91,01,b1,71,04,e9)
+ #define SD_GPT_USR_IA64         SD_ID128_MAKE(43,01,d2,a6,4e,3b,4b,2a,bb,94,9e,0b,2c,42,25,ea)
+ #define SD_GPT_USR_LOONGARCH64  SD_ID128_MAKE(e6,11,c7,02,57,5c,4c,be,9a,46,43,4f,a0,bf,7e,3f)
++#define SD_GPT_USR_MIPS         SD_ID128_MAKE(77,3b,2a,bc,2a,99,43,98,8b,f5,03,ba,ac,40,d0,2b)
++#define SD_GPT_USR_MIPS64       SD_ID128_MAKE(57,e1,39,58,73,31,43,65,8e,6e,35,ee,ee,17,c6,1b)
+ #define SD_GPT_USR_MIPS_LE      SD_ID128_MAKE(0f,48,68,e9,99,52,47,06,97,9f,3e,d3,a4,73,e9,47)
+ #define SD_GPT_USR_MIPS64_LE    SD_ID128_MAKE(c9,7c,1f,32,ba,06,40,b4,9f,22,23,60,61,b0,8a,a8)
+ #define SD_GPT_USR_PARISC       SD_ID128_MAKE(dc,4a,44,80,69,17,42,62,a4,ec,db,93,84,94,9f,25)
+@@ -70,6 +74,8 @@ _SD_BEGIN_DECLARATIONS;
+ #define SD_GPT_ROOT_ARM64_VERITY       SD_ID128_MAKE(df,33,00,ce,d6,9f,4c,92,97,8c,9b,fb,0f,38,d8,20)
+ #define SD_GPT_ROOT_IA64_VERITY        SD_ID128_MAKE(86,ed,10,d5,b6,07,45,bb,89,57,d3,50,f2,3d,05,71)
+ #define SD_GPT_ROOT_LOONGARCH64_VERITY SD_ID128_MAKE(f3,39,3b,22,e9,af,46,13,a9,48,9d,3b,fb,d0,c5,35)
++#define SD_GPT_ROOT_MIPS_VERITY        SD_ID128_MAKE(7a,43,07,99,f7,11,4c,7e,8e,5b,1d,68,5b,d4,86,07)
++#define SD_GPT_ROOT_MIPS64_VERITY      SD_ID128_MAKE(57,95,36,f8,6a,33,40,55,a9,5a,df,2d,5e,2c,42,a8)
+ #define SD_GPT_ROOT_MIPS_LE_VERITY     SD_ID128_MAKE(d7,d1,50,d2,2a,04,4a,33,8f,12,16,65,12,05,ff,7b)
+ #define SD_GPT_ROOT_MIPS64_LE_VERITY   SD_ID128_MAKE(16,b4,17,f8,3e,06,4f,57,8d,d2,9b,52,32,f4,1a,a6)
+ #define SD_GPT_ROOT_PARISC_VERITY      SD_ID128_MAKE(d2,12,a4,30,fb,c5,49,f9,a9,83,a7,fe,ef,2b,8d,0e)
+@@ -89,6 +95,8 @@ _SD_BEGIN_DECLARATIONS;
+ #define SD_GPT_USR_ARM64_VERITY        SD_ID128_MAKE(6e,11,a4,e7,fb,ca,4d,ed,b9,e9,e1,a5,12,bb,66,4e)
+ #define SD_GPT_USR_IA64_VERITY         SD_ID128_MAKE(6a,49,1e,03,3b,e7,45,45,8e,38,83,32,0e,0e,a8,80)
+ #define SD_GPT_USR_LOONGARCH64_VERITY  SD_ID128_MAKE(f4,6b,2c,26,59,ae,48,f0,91,06,c5,0e,d4,7f,67,3d)
++#define SD_GPT_USR_MIPS_VERITY         SD_ID128_MAKE(6e,5a,1b,c8,d2,23,49,b7,bc,a8,37,a5,fc,ce,b9,96)
++#define SD_GPT_USR_MIPS64_VERITY       SD_ID128_MAKE(81,cf,9d,90,74,58,4d,f4,8d,cf,c8,a3,a4,04,f0,9b)
+ #define SD_GPT_USR_MIPS_LE_VERITY      SD_ID128_MAKE(46,b9,8d,8d,b5,5c,4e,8f,aa,b3,37,fc,a7,f8,07,52)
+ #define SD_GPT_USR_MIPS64_LE_VERITY    SD_ID128_MAKE(3c,3d,61,fe,b5,f3,41,4d,bb,71,87,39,a6,94,a4,ef)
+ #define SD_GPT_USR_PARISC_VERITY       SD_ID128_MAKE(58,43,d6,18,ec,37,48,d7,9f,12,ce,a8,e0,87,68,b2)
+@@ -110,6 +118,8 @@ _SD_BEGIN_DECLARATIONS;
+ #define SD_GPT_ROOT_ARM64_VERITY_SIG       SD_ID128_MAKE(6d,b6,9d,e6,29,f4,47,58,a7,a5,96,21,90,f0,0c,e3)
+ #define SD_GPT_ROOT_IA64_VERITY_SIG        SD_ID128_MAKE(e9,8b,36,ee,32,ba,48,82,9b,12,0c,e1,46,55,f4,6a)
+ #define SD_GPT_ROOT_LOONGARCH64_VERITY_SIG SD_ID128_MAKE(5a,fb,67,eb,ec,c8,4f,85,ae,8e,ac,1e,7c,50,e7,d0)
++#define SD_GPT_ROOT_MIPS_VERITY_SIG        SD_ID128_MAKE(bb,a2,10,a2,9c,5d,45,ee,9e,87,ff,2c,cb,d0,02,d0)
++#define SD_GPT_ROOT_MIPS64_VERITY_SIG      SD_ID128_MAKE(43,ce,94,d4,0f,3d,49,99,82,50,b9,de,af,d9,8e,6e)
+ #define SD_GPT_ROOT_MIPS_LE_VERITY_SIG     SD_ID128_MAKE(c9,19,cc,1f,44,56,4e,ff,91,8c,f7,5e,94,52,5c,a5)
+ #define SD_GPT_ROOT_MIPS64_LE_VERITY_SIG   SD_ID128_MAKE(90,4e,58,ef,5c,65,4a,31,9c,57,6a,f5,fc,7c,5d,e7)
+ #define SD_GPT_ROOT_PARISC_VERITY_SIG      SD_ID128_MAKE(15,de,61,70,65,d3,43,1c,91,6e,b0,dc,d8,39,3f,25)
+@@ -129,6 +139,8 @@ _SD_BEGIN_DECLARATIONS;
+ #define SD_GPT_USR_ARM64_VERITY_SIG        SD_ID128_MAKE(c2,3c,e4,ff,44,bd,4b,00,b2,d4,b4,1b,34,19,e0,2a)
+ #define SD_GPT_USR_IA64_VERITY_SIG         SD_ID128_MAKE(8d,e5,8b,c2,2a,43,46,0d,b1,4e,a7,6e,4a,17,b4,7f)
+ #define SD_GPT_USR_LOONGARCH64_VERITY_SIG  SD_ID128_MAKE(b0,24,f3,15,d3,30,44,4c,84,61,44,bb,de,52,4e,99)
++#define SD_GPT_USR_MIPS_VERITY_SIG         SD_ID128_MAKE(97,ae,15,8d,f2,16,49,7b,80,57,f7,f9,05,77,0f,54)
++#define SD_GPT_USR_MIPS64_VERITY_SIG       SD_ID128_MAKE(05,81,6c,e2,dd,40,4a,c6,a6,1d,37,d3,2d,c1,ba,7d)
+ #define SD_GPT_USR_MIPS_LE_VERITY_SIG      SD_ID128_MAKE(3e,23,ca,0b,a4,bc,4b,4e,80,87,5a,b6,a2,6a,a8,a9)
+ #define SD_GPT_USR_MIPS64_LE_VERITY_SIG    SD_ID128_MAKE(f2,c2,c7,ee,ad,cc,43,51,b5,c6,ee,98,16,b6,6e,16)
+ #define SD_GPT_USR_PARISC_VERITY_SIG       SD_ID128_MAKE(45,0d,d7,d1,32,24,45,ec,9c,f2,a4,3a,34,6d,71,ee)
+@@ -216,6 +228,21 @@ _SD_BEGIN_DECLARATIONS;
+ #  define SD_GPT_USR_NATIVE_VERITY SD_GPT_USR_LOONGARCH64_VERITY
+ #  define SD_GPT_USR_NATIVE_VERITY_SIG SD_GPT_USR_LOONGARCH64_VERITY_SIG
+ 
++#elif defined(__mips__) && !defined(__mips64) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
++#  define SD_GPT_ROOT_NATIVE SD_GPT_ROOT_MIPS
++#  define SD_GPT_ROOT_NATIVE_VERITY SD_GPT_ROOT_MIPS_VERITY
++#  define SD_GPT_ROOT_NATIVE_VERITY_SIG SD_GPT_ROOT_MIPS_VERITY_SIG
++#  define SD_GPT_USR_NATIVE SD_GPT_USR_MIPS
++#  define SD_GPT_USR_NATIVE_VERITY SD_GPT_USR_MIPS_VERITY
++#  define SD_GPT_USR_NATIVE_VERITY_SIG SD_GPT_USR_MIPS_VERITY_SIG
++#elif defined(__mips64) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
++#  define SD_GPT_ROOT_NATIVE SD_GPT_ROOT_MIPS64
++#  define SD_GPT_ROOT_NATIVE_VERITY SD_GPT_ROOT_MIPS64_VERITY
++#  define SD_GPT_ROOT_NATIVE_VERITY_SIG SD_GPT_ROOT_MIPS64_VERITY_SIG
++#  define SD_GPT_USR_NATIVE SD_GPT_USR_MIPS64
++#  define SD_GPT_USR_NATIVE_VERITY SD_GPT_USR_MIPS64_VERITY
++#  define SD_GPT_USR_NATIVE_VERITY_SIG SD_GPT_USR_MIPS64_VERITY_SIG
++
+ #elif defined(__mips__) && !defined(__mips64) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ #  define SD_GPT_ROOT_NATIVE SD_GPT_ROOT_MIPS_LE
+ #  define SD_GPT_ROOT_NATIVE_VERITY SD_GPT_ROOT_MIPS_LE_VERITY
diff --git a/patches/systemd-254.5/series b/patches/systemd-254.5/series
new file mode 100644
index 000000000000..177c544453cd
--- /dev/null
+++ b/patches/systemd-254.5/series
@@ -0,0 +1 @@
+0001-sd-gpt-add-defines-for-big-endian-MIPS-MIPS64.patch
-- 
2.39.2




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

* [DistroKit] [PATCH next v3 2/4] busybox: enable rdev to find out the root device
  2023-12-13 14:47 [DistroKit] [PATCH next v3 0/4] refactor data partition setup Roland Hieber
  2023-12-13 14:47 ` [DistroKit] [PATCH next v3 1/4] systemd: make systemd-repart work for mips Roland Hieber
@ 2023-12-13 14:47 ` Roland Hieber
  2023-12-13 14:47 ` [DistroKit] [PATCH next v3 3/4] squash! datapartition: generate partitions via systemd-repart Roland Hieber
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Roland Hieber @ 2023-12-13 14:47 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

We will use this to find out whether we can run systemd-repart.

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

diff --git a/configs/ptxconfig b/configs/ptxconfig
index d6ecbe30f797..433b278c98bc 100644
--- a/configs/ptxconfig
+++ b/configs/ptxconfig
@@ -989,7 +989,7 @@ PTXCONF_BUSYBOX_FEATURE_MESG_ENABLE_ONLY_GROUP=y
 # PTXCONF_BUSYBOX_NSENTER is not set
 # PTXCONF_BUSYBOX_PIVOT_ROOT is not set
 # PTXCONF_BUSYBOX_RDATE is not set
-# PTXCONF_BUSYBOX_RDEV is not set
+PTXCONF_BUSYBOX_RDEV=y
 # PTXCONF_BUSYBOX_READPROFILE is not set
 PTXCONF_BUSYBOX_RENICE=y
 # PTXCONF_BUSYBOX_REV is not set
-- 
2.39.2




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

* [DistroKit] [PATCH next v3 3/4] squash! datapartition: generate partitions via systemd-repart
  2023-12-13 14:47 [DistroKit] [PATCH next v3 0/4] refactor data partition setup Roland Hieber
  2023-12-13 14:47 ` [DistroKit] [PATCH next v3 1/4] systemd: make systemd-repart work for mips Roland Hieber
  2023-12-13 14:47 ` [DistroKit] [PATCH next v3 2/4] busybox: enable rdev to find out the root device Roland Hieber
@ 2023-12-13 14:47 ` Roland Hieber
  2023-12-13 14:47 ` [DistroKit] [PATCH next v3 4/4] fixup! rauc-udev: generate symlinks based on GPT partition labels Roland Hieber
  2023-12-13 16:25 ` [DistroKit] [PATCH next v3 0/4] refactor data partition setup Robert Schwebel
  4 siblings, 0 replies; 6+ messages in thread
From: Roland Hieber @ 2023-12-13 14:47 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

[@rsc: please replace the last paragraph in the original commit
message by the following text:]

Remove the old systemd-autoformat service and the mkfs-ext4 udev rule,
which also only handled the case where the data partition was the third
partition on the disk (which is not always the case anymore since we
have partitions for barebox-state or device-specific firmware), and
replace it with a call to systemd-repart if the root partition is on a
disk that we can actually repartition (i.e. /dev/root is not emulated
via qemu; this should also match the case when we are running from
initrd, but this has not been tested.)

Use a custom Type UUID instead of "linux-generic" for the data partition
to prevent systemd-repart from matching any bootloader partitions that
could throw off the matching algorithm (e.g. on STM32MP1).

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 projectroot/etc/rc.once.d/repart              | 10 ++++++++--
 projectroot/etc/repart.rc-once.d/30-data.conf |  3 ++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/projectroot/etc/rc.once.d/repart b/projectroot/etc/rc.once.d/repart
index 675c4e3e57f4..c84ab31f67a1 100755
--- a/projectroot/etc/rc.once.d/repart
+++ b/projectroot/etc/rc.once.d/repart
@@ -1,3 +1,9 @@
 #!/bin/sh
-echo "Repartitioning the root disk..."
-systemd-repart --dry-run=no --definitions=/etc/repart.rc-once.d/
+if rdev | grep -q '/dev/hd.*[0-9]\|/dev/mmcblk.*[0-9]\|/dev/sd.*[0-9]\|/dev/vd.*[0-9])'; then
+	echo "Repartitioning the root disk..."
+	systemd-repart --dry-run=no --definitions=/etc/repart.rc-once.d/
+else
+	# root is not on a partitionable disk; probably running in qemu or initrd
+	echo "Note: no root device or root not on a disk, not running systemd-repart"
+	exit 0
+fi
diff --git a/projectroot/etc/repart.rc-once.d/30-data.conf b/projectroot/etc/repart.rc-once.d/30-data.conf
index cc5aebfd87d3..1f663bc275d6 100644
--- a/projectroot/etc/repart.rc-once.d/30-data.conf
+++ b/projectroot/etc/repart.rc-once.d/30-data.conf
@@ -1,6 +1,7 @@
 [Partition]
 Label=data
-Type=linux-generic
+# don't use "linux-generic" to prevent incorrectly matching any bootloader partitions
+Type=da7af157-d639-49e9-89a0-fc74beeb8954
 SizeMinBytes=200M
 Weight=999999
 Format=ext4
-- 
2.39.2




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

* [DistroKit] [PATCH next v3 4/4] fixup! rauc-udev: generate symlinks based on GPT partition labels
  2023-12-13 14:47 [DistroKit] [PATCH next v3 0/4] refactor data partition setup Roland Hieber
                   ` (2 preceding siblings ...)
  2023-12-13 14:47 ` [DistroKit] [PATCH next v3 3/4] squash! datapartition: generate partitions via systemd-repart Roland Hieber
@ 2023-12-13 14:47 ` Roland Hieber
  2023-12-13 16:25 ` [DistroKit] [PATCH next v3 0/4] refactor data partition setup Robert Schwebel
  4 siblings, 0 replies; 6+ messages in thread
From: Roland Hieber @ 2023-12-13 14:47 UTC (permalink / raw)
  To: distrokit; +Cc: Roland Hieber

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---

The assumption made in the comment does not hold true, as the fallback
match for mmcblk0p3 conflicts with any possible match made later with
the 'boot_disk' tag a few lines below, so the probe order will influence
the actual target of the symlink and lead to unwanted consequences.
Since we removed the data partition from all genimage configs in a
previous commit ("treewide: images: remove root-B and data partitions"),
the fallback does not match anyway.
---
 projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules | 4 ----
 1 file changed, 4 deletions(-)

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 2da28ae5df16..e2893fa051f9 100644
--- a/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules
+++ b/projectroot/usr/lib/udev/rules.d/90-rauc-partitions.rules
@@ -20,10 +20,6 @@ ENV{OF_BASE_COMPATIBLE}=="*radxa,rock3a*", ENV{ID_PATH}=="platform-fe2b0000.mmc"
 # second part: create /dev/disk/by-usage/ symlinks
 ENV{DEVTYPE}!="partition", GOTO="rauc_partitions_end"
 
-# fallback for boards not yet supported by RAUC;
-# this will get overwritten below if we detected the boot disk
-KERNEL=="mmcblk0p3", SYMLINK+="disk/by-usage/data"
-
 # symlinks based on GPT partition labels
 TAGS=="boot_disk", ENV{ID_PART_ENTRY_NAME}=="root-A", SYMLINK+="disk/by-usage/rootfs0"
 TAGS=="boot_disk", ENV{ID_PART_ENTRY_NAME}=="root-B", SYMLINK+="disk/by-usage/rootfs1"
-- 
2.39.2




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

* Re: [DistroKit] [PATCH next v3 0/4] refactor data partition setup
  2023-12-13 14:47 [DistroKit] [PATCH next v3 0/4] refactor data partition setup Roland Hieber
                   ` (3 preceding siblings ...)
  2023-12-13 14:47 ` [DistroKit] [PATCH next v3 4/4] fixup! rauc-udev: generate symlinks based on GPT partition labels Roland Hieber
@ 2023-12-13 16:25 ` Robert Schwebel
  4 siblings, 0 replies; 6+ messages in thread
From: Robert Schwebel @ 2023-12-13 16:25 UTC (permalink / raw)
  To: Roland Hieber; +Cc: distrokit

Thx, the series is now integrated into next, and the CI results look
good.

On Wed, Dec 13, 2023 at 03:47:46PM +0100, Roland Hieber wrote:
> PATCH next v3:
> * fixups to make the state of the series already applied on the next
>   branch work on remaining platforms
> * don't use "linux-generic" Type UUID for data partition because then
>   systemd-repart will match the STM32MP1 bootloader partitions
> * select busybox rdev, and don't run systemd-repart when we don't have a
>   partitionable disk (feedback from PTX Jenkins, Bastian Krause and
>   Robert Schwebel)
> * fix systemd-repart on mips (feedback from PTX Jenkins)
> * rauc-udev: remove fallback match for data partition in mmcblk0p3
> 
> PATCH v2: https://lore.distrokit.org/distrokit/20231103225253.1349209-1-rhi@pengutronix.de
> * ENV{PARTNAME} is not set for all partitions, use
>   ENV{ID_PART_ENTRY_NAME} instead, which is also used by udev's
>   60-persistent-storage.rules to generate /dev/disk/by-partlabel/*
> 
> PATCH v1: https://lore.distrokit.org/distrokit/20231103182438.1051601-1-rhi@pengutronix.de
> 
> Roland Hieber (4):
>   systemd: make systemd-repart work for mips
>   busybox: enable rdev to find out the root device
>   squash! datapartition: generate partitions via systemd-repart
>   fixup! rauc-udev: generate symlinks based on GPT partition labels
> 
>  configs/ptxconfig                             |   2 +-
>  ...d-defines-for-big-endian-MIPS-MIPS64.patch | 122 ++++++++++++++++++
>  patches/systemd-254.5/series                  |   1 +
>  projectroot/etc/rc.once.d/repart              |  10 +-
>  projectroot/etc/repart.rc-once.d/30-data.conf |   3 +-
>  .../lib/udev/rules.d/90-rauc-partitions.rules |   4 -
>  6 files changed, 134 insertions(+), 8 deletions(-)
>  create mode 100644 patches/systemd-254.5/0001-sd-gpt-add-defines-for-big-endian-MIPS-MIPS64.patch
>  create mode 100644 patches/systemd-254.5/series
> 
> -- 
> 2.39.2
> 
> 
> 

-- 
Pengutronix e.K.                           | Dipl.-Ing. Robert Schwebel  |
Steuerwalder Str. 21                       | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-9    |



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

end of thread, other threads:[~2023-12-13 16:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-13 14:47 [DistroKit] [PATCH next v3 0/4] refactor data partition setup Roland Hieber
2023-12-13 14:47 ` [DistroKit] [PATCH next v3 1/4] systemd: make systemd-repart work for mips Roland Hieber
2023-12-13 14:47 ` [DistroKit] [PATCH next v3 2/4] busybox: enable rdev to find out the root device Roland Hieber
2023-12-13 14:47 ` [DistroKit] [PATCH next v3 3/4] squash! datapartition: generate partitions via systemd-repart Roland Hieber
2023-12-13 14:47 ` [DistroKit] [PATCH next v3 4/4] fixup! rauc-udev: generate symlinks based on GPT partition labels Roland Hieber
2023-12-13 16:25 ` [DistroKit] [PATCH next v3 0/4] refactor data partition setup Robert Schwebel

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