Skip to contentSkip to conversation

Upgrade systemd to v255

PATCH Applied Jarkko Sakkinen 2 participants 11 messages Jun 6, 2024

lore
Share & tools
lore
#0 lore raw

v2 cover Upgrade systemd to v255

The goal here is to upgrade systemd version to v255, which is the final version version with sysvinit compatibility. I also cherry-picked couple of bug fixes from the systemd upstream, which address errors complaining of missing superblocks:

1. Filesystem found in kernel header but not in \
filesystems-gperf.gperf: BCACHEFS_SUPER_MAGIC
1. Filesystem found in kernel header but not in \
filesystems-gperf.gperf: PID_FS_MAGIC

On feature side v255 has a nice tool called 'systemd-pcrlock', which can be used for creating and experimenting with TPM2 authorization policies, which is very useful.

I also upgraded tpm2-tools to 5.7 because it has a useful conversion tool called 'tpm2_encodeobject".

Change Log
==========

v1: https://lists.buildroot.org/pipermail/buildroot/2024-June/754748.html

Cc James Hilliard <[email protected]>
CC Arnout Vandecappelle <[email protected]>
Cc Erik Larsson <[email protected]>
Cc Thomas Petazzoni <[email protected]>

Jarkko Sakkinen (3):
package/tpm2-tools: bump version to 5.7 package/systemd: bump to version 255 package/systemd: add the missing superblock identifiers

 .../0001-basic-add-pidfs-magic-31709.patch    | 50 +++++++++++++++++++
 .../0002-basic-add-bcachefs-magic.patch       | 50 +++++++++++++++++++
 package/systemd/systemd.hash                  |  2 +-
 package/systemd/systemd.mk                    |  2 +-
 package/tpm2-tools/tpm2-tools.hash            |  2 +-
 package/tpm2-tools/tpm2-tools.mk              |  2 +-
 6 files changed, 104 insertions(+), 4 deletions(-)
 create mode 100644 package/systemd/0001-basic-add-pidfs-magic-31709.patch
 create mode 100644 package/systemd/0002-basic-add-bcachefs-magic.patch

--
2.45.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#1 lore raw

PATCH v2 1/3 package/tpm2-tools: bump version to 5.7

tpm2_encodeobject is essential for testing RSAPKCS1 and ECDSA TPM2 signing keys, as the key blob is loaded to the chip in DER format defined by ASN.1 schema.

---
 package/tpm2-tools/tpm2-tools.hash | 2 +-
 package/tpm2-tools/tpm2-tools.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/tpm2-tools/tpm2-tools.hash +1 -1
index f50a896363..a7b1ef559e 100644
@@ -1,3 +1,3 @@
 # Locally computed:
-sha256  c0b402f6a7b3456e8eb2445211e2d41c46c7e769e05fe4d8909ff64119f7a630  tpm2-tools-5.2.tar.gz
+sha256  3810d36b5079256f4f2f7ce552e22213d43b1031c131538df8a2dbc3c570983a  tpm2-tools-5.7.tar.gz
 sha256  f6995d52c8b8e4d2c3bace7fc9c330a77a90d808166fbad4d7ead7e8ba2fc66c  doc/LICENSE
package/tpm2-tools/tpm2-tools.mk +1 -1
index 12f924eee5..cd9c582aa9 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-TPM2_TOOLS_VERSION = 5.2
+TPM2_TOOLS_VERSION = 5.7
 TPM2_TOOLS_SITE = https://github.com/tpm2-software/tpm2-tools/releases/download/$(TPM2_TOOLS_VERSION)
 TPM2_TOOLS_LICENSE = BSD-3-Clause
 TPM2_TOOLS_LICENSE_FILES = doc/LICENSE
Signature · 6 lines
2.45.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH v2 1/3] package/tpm2-tools: bump version to 5.7

Jarkko, All,

On 2024-06-06 13:48 +0300, Jarkko Sakkinen spake thusly:

Quoted 18 lines

tpm2_encodeobject is essential for testing RSAPKCS1 and ECDSA TPM2 signing keys, as the key blob is loaded to the chip in DER format defined by ASN.1 schema.

---
 package/tpm2-tools/tpm2-tools.hash | 2 +-
 package/tpm2-tools/tpm2-tools.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/tpm2-tools/tpm2-tools.hash +0 -0
index f50a896363..a7b1ef559e 100644

package/tpm2-tools/tpm2-tools.hash line 3

Quoted 4 lines
package/tpm2-tools/tpm2-tools.hash +1 -1
@@ -1,3 +1,3 @@
 # Locally computed:
-sha256  c0b402f6a7b3456e8eb2445211e2d41c46c7e769e05fe4d8909ff64119f7a630  tpm2-tools-5.2.tar.gz
+sha256  3810d36b5079256f4f2f7ce552e22213d43b1031c131538df8a2dbc3c570983a  tpm2-tools-5.7.tar.gz
 sha256  f6995d52c8b8e4d2c3bace7fc9c330a77a90d808166fbad4d7ead7e8ba2fc66c  doc/LICENSE

make tpm2-tools-legal-info
>>> tpm2-tools 5.7 Collecting legal info
sha256sum: /home/ymorin/dev/buildroot/O/next/build/tpm2-tools-5.7/doc/LICENSE: No such file or directory
ERROR: while checking hashes from package/tpm2-tools/tpm2-tools.hash
ERROR: doc/LICENSE has wrong sha256 hash:
ERROR: expected: f6995d52c8b8e4d2c3bace7fc9c330a77a90d808166fbad4d7ead7e8ba2fc66c
ERROR: got :
ERROR: Incomplete download, or man-in-the-middle (MITM) attack
make[1]: *** [package/tpm2-tools/tpm2-tools.mk:31: tpm2-tools-legal-info] Error 1
make: *** [Makefile:23: _all] Error 2

The doc/ directory has been renamed docs/ so I also fixed that for the LICENSE file.

Applied to next, thanks.

Regards,
Yann E. MORIN.

Quoted 20 lines
package/tpm2-tools/tpm2-tools.mk +1 -1
index 12f924eee5..cd9c582aa9 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-TPM2_TOOLS_VERSION = 5.2
+TPM2_TOOLS_VERSION = 5.7
 TPM2_TOOLS_SITE = https://github.com/tpm2-software/tpm2-tools/releases/download/$(TPM2_TOOLS_VERSION)
 TPM2_TOOLS_LICENSE = BSD-3-Clause
 TPM2_TOOLS_LICENSE_FILES = doc/LICENSE
Signature · 6 lines
2.45.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

PATCH v2 2/3 package/systemd: bump to version 255

In reply to Jarkko Sakkinen

The last version with System V init scripts and cgroups v1 support. After this version the upgrade will take mostly a longer period of time.

Cd: Arnout Vandecappelle <[email protected]>

---
 package/systemd/systemd.hash | 2 +-
 package/systemd/systemd.mk   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
package/systemd/systemd.hash +1 -1
index f999d0d34e..190e326e57 100644
@@ -1,5 +1,5 @@
 # sha256 locally computed
-sha256  26ac73c2108132b1d11ff939e8b1bece42f1c1da03fdf4a242af5a7cf3ac34f1  systemd-254.13.tar.gz
+sha256  a3eb766ee96eb9f4cc25c2a6c933f3299e1b7ae22e72507dade0a5c86d92534f  systemd-255.tar.gz
 sha256  ab15fd526bd8dd18a9e77ebc139656bf4d33e97fc7238cd11bf60e2b9b8666c6  LICENSE.GPL2
 sha256  dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551  LICENSE.LGPL2.1
 sha256  e5a8645ad94aab24e312dd0c6be2aa54236eb9374480b1b14ea5c61598874fd5  LICENSES/BSD-2-Clause.txt
package/systemd/systemd.mk +1 -1
index 6b3553723c..e74eb9e830 100644
@@ -19,7 +19,7 @@
 # - Diff sysusers.d with the previous version
 # - Diff factory/etc/nsswitch.conf with the previous version
 #   (details are often sprinkled around in README and manpages)
-SYSTEMD_VERSION = 254.13
+SYSTEMD_VERSION = 255
 SYSTEMD_SITE = $(call github,systemd,systemd-stable,v$(SYSTEMD_VERSION))
 SYSTEMD_LICENSE = \
 	LGPL-2.1+, \
Signature · 6 lines
2.45.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

Re: [Buildroot] [PATCH v2 2/3] package/systemd: bump to version 255

Karkko, All,

On 2024-06-06 13:48 +0300, Jarkko Sakkinen spake thusly:

Quoted 1 line

The last version with System V init scripts

As far as I know, in Buildroot we do not use that compatibility layer, as we do pass the followign option at build: -Dsysvinit-path=

So we should not be impacted by that removal, correct?

Quoted 1 line

and cgroups v1 support.

It's not entirely clear to me how dropping cgroups v1 suport will be impactful... AFAIK, the kernel has long had cgroups v2, so virtually all systems where we would deply systemd 256+ would have a recent-enough kernel.

Quoted 8 lines

After
this version the upgrade will take mostly a longer period of time.

Cd: Arnout Vandecappelle <[email protected]>

---

[--SNIP--]

package/systemd/systemd.mk line 21

Quoted 8 lines
package/systemd/systemd.mk +0 -0
index 6b3553723c..e74eb9e830 100644
@@ -19,7 +19,7 @@
 # - Diff sysusers.d with the previous version
 # - Diff factory/etc/nsswitch.conf with the previous version
 #   (details are often sprinkled around in README and manpages)

Did you address the comments above? If so, can you elaborate (even slightly) in the commit log why nothing changed in those respects, please?

Regards,
Yann E. MORIN.

Quoted 12 lines
package/systemd/systemd.mk +1 -1
-SYSTEMD_VERSION = 254.13
+SYSTEMD_VERSION = 255
 SYSTEMD_SITE = $(call github,systemd,systemd-stable,v$(SYSTEMD_VERSION))
 SYSTEMD_LICENSE = \
 	LGPL-2.1+, \
Signature · 6 lines
2.45.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

Re: [Buildroot] [PATCH v2 2/3] package/systemd: bump to version 255

Quoted 7 lines · Yann E. MORIN

Karkko, All,

On 2024-06-06 13:48 +0300, Jarkko Sakkinen spake thusly:

Quoted 1 line

The last version with System V init scripts

As far as I know, in Buildroot we do not use that compatibility layer, as we do pass the followign option at build: -Dsysvinit-path=

Good to know.

Quoted 2 lines

So we should not be impacted by that removal, correct?

Yes.

Quoted 7 lines
Quoted 2 lines

and cgroups v1 support.

It's not entirely clear to me how dropping cgroups v1 suport will be impactful... AFAIK, the kernel has long had cgroups v2, so virtually all systems where we would deply systemd 256+ would have a recent-enough kernel.

Yes.

And aforementioned *pcrlock is not crucially important.

BR, Jarkko
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#6 lore raw

PATCH v2 3/3 package/systemd: add the missing superblock identifiers

In reply to Jarkko Sakkinen

The following superblock identifiers are missing:

1. BCACHEFS_SUPER_MAGIC
2. PID_FS_MAGIC

In my testing at least Linux 6.{9,10} have failed to compile because of this.

Cherry-pick upstream fixes, which address them.

---
 .../0001-basic-add-pidfs-magic-31709.patch    | 50 +++++++++++++++++++
 .../0002-basic-add-bcachefs-magic.patch       | 50 +++++++++++++++++++
 2 files changed, 100 insertions(+)
 create mode 100644 package/systemd/0001-basic-add-pidfs-magic-31709.patch
 create mode 100644 package/systemd/0002-basic-add-bcachefs-magic.patch
package/systemd/0001-basic-add-pidfs-magic-31709.patch new file +50 -0
new file mode 100644
index 0000000000..683f91dbb7
@@ -0,0 +1,50 @@
+From 5cffe2484bbc6ec4b5b721094936f510a81c5167 Mon Sep 17 00:00:00 2001
+From: cpackham-atlnz <[email protected]>
+Date: Tue, 12 Mar 2024 00:55:36 +1300
+Subject: [PATCH 1/2] basic: add PIDFS magic (#31709)
+
+Kernel commit cb12fd8e0dabb9a1c8aef55a6a41e2c255fcdf4b added pidfs.
+Update filesystems-gperf.gperf and missing_magic.h accordingly.
+
+This fixes the following error building against a bleeding edge kernel.
+```
+../src/basic/meson.build:234:8: ERROR: Problem encountered: Unknown filesystems defined in kernel headers:
+
+Filesystem found in kernel header but not in filesystems-gperf.gperf: PID_FS_MAGIC
+```
+---
+ src/basic/filesystems-gperf.gperf | 1 +
+ src/basic/missing_magic.h         | 5 +++++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/src/basic/filesystems-gperf.gperf b/src/basic/filesystems-gperf.gperf
+index e8c5357f91..1cd66b5a5f 100644
+--- a/src/basic/filesystems-gperf.gperf
++++ b/src/basic/filesystems-gperf.gperf
+@@ -91,6 +91,7 @@ ocfs2,           {OCFS2_SUPER_MAGIC}
+ openpromfs,      {OPENPROM_SUPER_MAGIC}
+ orangefs,        {ORANGEFS_DEVREQ_MAGIC}
+ overlay,         {OVERLAYFS_SUPER_MAGIC}
++pidfs,           {PID_FS_MAGIC}
+ pipefs,          {PIPEFS_MAGIC}
+ ppc-cmm,         {PPC_CMM_MAGIC}
+ proc,            {PROC_SUPER_MAGIC}
+diff --git a/src/basic/missing_magic.h b/src/basic/missing_magic.h
+index 27a33adecb..82d71c8ad1 100644
+--- a/src/basic/missing_magic.h
++++ b/src/basic/missing_magic.h
+@@ -128,6 +128,11 @@
+ #define DEVMEM_MAGIC 0x454d444d
+ #endif
+ 
++/* cb12fd8e0dabb9a1c8aef55a6a41e2c255fcdf4b (6.8) */
++#ifndef PID_FS_MAGIC
++#define PID_FS_MAGIC 0x50494446
++#endif
++
+ /* Not in mainline but included in Ubuntu */
+ #ifndef SHIFTFS_MAGIC
+ #define SHIFTFS_MAGIC 0x6a656a62
+-- 
+2.45.1
+
package/systemd/0002-basic-add-bcachefs-magic.patch new file +50 -0

50 lines not on this page · raw message

Signature · 6 lines
2.45.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#7 lore raw

Re: [Buildroot] [PATCH v2 3/3] package/systemd: add the missing superblock identifiers

Jarkko, All,

On 2024-06-06 13:48 +0300, Jarkko Sakkinen spake thusly:

Quoted 3 lines

The following superblock identifiers are missing:
1. BCACHEFS_SUPER_MAGIC
2. PID_FS_MAGIC

Does that already happen with systemd 254?

- if yes, then this change should be sent before the version bump:

    first, bug fixes, then new features;

- if not, then this patch should be included in the patch that does the version bump, otherwise the version bump by itself is broken.

Regards,
Yann E. MORIN.

Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#8 lore raw

Re: [Buildroot] [PATCH v2 3/3] package/systemd: add the missing superblock identifiers

Quoted 7 lines · Yann E. MORIN

Jarkko, All,

On 2024-06-06 13:48 +0300, Jarkko Sakkinen spake thusly:

Quoted 3 lines

The following superblock identifiers are missing:
1. BCACHEFS_SUPER_MAGIC
2. PID_FS_MAGIC

Quoted 6 lines

Does that already happen with systemd 254?

- if yes, then this change should be sent before the version bump:

    first, bug fixes, then new features;

- if not, then this patch should be included in the patch that does the version bump, otherwise the version bump by itself is broken.

Compiling and testing, soon we will find out.

Quoted 3 lines

Regards,
Yann E. MORIN.

BR, Jarkko
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#9 lore raw

Re: [Buildroot] [PATCH v2 3/3] package/systemd: add the missing superblock identifiers

In reply to Jarkko Sakkinen

Jarkko, All,

Sorry, I forgot something in the previous review...

On 2024-06-06 13:48 +0300, Jarkko Sakkinen spake thusly:

Quoted 3 lines

The following superblock identifiers are missing:
1. BCACHEFS_SUPER_MAGIC
2. PID_FS_MAGIC

[--SNIP--]

Quoted 10 lines
package/systemd/0001-basic-add-pidfs-magic-31709.patch new file +4 -0
new file mode 100644
index 0000000000..683f91dbb7
@@ -0,0 +1,50 @@
+From 5cffe2484bbc6ec4b5b721094936f510a81c5167 Mon Sep 17 00:00:00 2001
+From: cpackham-atlnz <[email protected]>
+Date: Tue, 12 Mar 2024 00:55:36 +1300
+Subject: [PATCH 1/2] basic: add PIDFS magic (#31709)

package/systemd/0001-basic-add-pidfs-magic-31709.patch line 14

Quoted 10 lines
package/systemd/0001-basic-add-pidfs-magic-31709.patch new file +10 -0
+
+Kernel commit cb12fd8e0dabb9a1c8aef55a6a41e2c255fcdf4b added pidfs.
+Update filesystems-gperf.gperf and missing_magic.h accordingly.
+
+This fixes the following error building against a bleeding edge kernel.
+```
+../src/basic/meson.build:234:8: ERROR: Problem encountered: Unknown filesystems defined in kernel headers:
+
+Filesystem found in kernel header but not in filesystems-gperf.gperf: PID_FS_MAGIC
+```

You forgot to add an "Upstream:" tag:

https://buildroot.org/downloads/manual/manual.html#_additional_patch_documentation

Applicalble to both bundled patches.

Regards,
Yann E. MORIN.

Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#10 lore raw

Re: [Buildroot] [PATCH v2 3/3] package/systemd: add the missing superblock identifiers

Quoted 3 lines · Yann E. MORIN

You forgot to add an "Upstream:" tag:

https://buildroot.org/downloads/manual/manual.html#_additional_patch_documentation

Yep, already found it, all good: "19.4. Additional patch documentation"

Quoted 5 lines

Applicalble to both bundled patches.

Regards,
Yann E. MORIN.

BR, Jarkko
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot