From 4c293d3276f04c501e08f1abcd9f833d2e328fac Mon Sep 17 00:00:00 2001 From: hanjinpeng Date: Mon, 16 Jun 2025 10:40:41 +0800 Subject: [PATCH] Fix compilation errors caused by missing pidfs and bcachefs This fixes the following error: Filesystem found in kernel header but not in filesystems-gperf.gperf: PID_FS_MAGIC Filesystem found in kernel header but not in filesystems-gperf.gperf: BCACHEFS_SUPER_MAGIC --- ...ort-basic-add-missing-BCACHEFS-magic.patch | 45 ++++++++++++++++++ backport-basic-add-missing-PIDFS-magic.patch | 47 +++++++++++++++++++ systemd.spec | 7 ++- 3 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 backport-basic-add-missing-BCACHEFS-magic.patch create mode 100644 backport-basic-add-missing-PIDFS-magic.patch diff --git a/backport-basic-add-missing-BCACHEFS-magic.patch b/backport-basic-add-missing-BCACHEFS-magic.patch new file mode 100644 index 0000000..a30cea2 --- /dev/null +++ b/backport-basic-add-missing-BCACHEFS-magic.patch @@ -0,0 +1,45 @@ +From 201148b08de65de004d10679a8c3d201cc08fb28 Mon Sep 17 00:00:00 2001 +From: Chris Packham +Date: Fri, 31 May 2024 09:51:38 +1200 +Subject: [PATCH] basic: Add BCACHEFS magic + +Import magic.h from Linux 6.9 to get the definition of +BCACHEFS_SUPER_MAGIC. Update filesystems-gperf.gperf to add knowledge of +bcachefs. + +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: BCACHEFS_SUPER_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 1cd66b5..c82fe98 100644 +--- a/src/basic/filesystems-gperf.gperf ++++ b/src/basic/filesystems-gperf.gperf +@@ -28,6 +28,7 @@ afs, {AFS_FS_MAGIC, AFS_SUPER_MAGIC} + anon_inodefs, {ANON_INODE_FS_MAGIC} + autofs, {AUTOFS_SUPER_MAGIC} + balloon-kvm, {BALLOON_KVM_MAGIC} ++bcachefs, {BCACHEFS_SUPER_MAGIC} + bdev, {BDEVFS_MAGIC} + binder, {BINDERFS_SUPER_MAGIC} + binfmt_misc, {BINFMTFS_MAGIC} +diff --git a/src/basic/missing_magic.h b/src/basic/missing_magic.h +index 82d71c8..26378c6 100644 +--- a/src/basic/missing_magic.h ++++ b/src/basic/missing_magic.h +@@ -197,3 +197,8 @@ + #ifndef NTFS3_SUPER_MAGIC + #define NTFS3_SUPER_MAGIC 0x7366746e + #endif ++ ++/* Added in Linux commit e2f48c48090dea172c0c571101041de64634dae5. Remove when next sync'd */ ++#ifndef BCACHEFS_SUPER_MAGIC ++#define BCACHEFS_SUPER_MAGIC 0xca451a4e ++#endif diff --git a/backport-basic-add-missing-PIDFS-magic.patch b/backport-basic-add-missing-PIDFS-magic.patch new file mode 100644 index 0000000..4218650 --- /dev/null +++ b/backport-basic-add-missing-PIDFS-magic.patch @@ -0,0 +1,47 @@ +From ed01b92e1c92871bbd92711f280e2b2d15753f0e Mon Sep 17 00:00:00 2001 +From: cpackham-atlnz <85916201+cpackham-atlnz@users.noreply.github.com> +Date: Tue, 12 Mar 2024 00:55:36 +1300 +Subject: [PATCH] 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 e8c5357f91461..1cd66b5a5fa99 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 27a33adecb4ed..82d71c8ad1233 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 diff --git a/systemd.spec b/systemd.spec index f06ae84..e4c9dcf 100644 --- a/systemd.spec +++ b/systemd.spec @@ -25,7 +25,7 @@ Name: systemd Url: https://systemd.io/ Version: 255 -Release: 44 +Release: 45 License: LGPL-2.1-or-later AND MIT AND GPL-2.0-or-later Summary: System and Service Manager @@ -107,6 +107,8 @@ Patch6651: backport-core-fix-assert-when-AddDependencyUnitFiles-is-calle.pa Patch6652: backport-CVE-2023-7008.patch Patch6653: backport-run-pass-the-pty-slave-fd-to-transient-service.patch Patch6654: backport-run-do-not-pass-the-pty-slave-fd-to-transient-servic.patch +Patch6655: backport-basic-add-missing-BCACHEFS-magic.patch +Patch6656: backport-basic-add-missing-PIDFS-magic.patch Patch9008: update-rtc-with-system-clock-when-shutdown.patch Patch9009: udev-add-actions-while-rename-netif-failed.patch @@ -1712,6 +1714,9 @@ fi %{_unitdir}/veritysetup.target %changelog +* Mon Jun 16 2025 Han Jinpeng - 255-45 +- Fix missing PIDFS and BCACHEFS magic issue when compile + * Thu Jun 05 2025 yanglongkang - 255-44 - Take ownership of /var/log/lastlog from util-linux -- Gitee