[PATCH RFC 6/8] staging: apfs: init build support for APFS

From: Ethan Carter Edwards
Date: Fri Mar 14 2025 - 17:59:44 EST


APFS read support is stable and functional for unencrypted, non-fusion
drives. Write support for unencrypted drives is somewhat stable and
supported. This commit adds the relevant Kconfig and Makefile options
to build this APFS driver as a module or kernel builtin.

Signed-off-by: Ethan Carter Edwards <ethan@xxxxxxxxxxxxxxxxx>
---
drivers/staging/Kconfig | 2 ++
drivers/staging/apfs/Kconfig | 13 +++++++++++++
drivers/staging/apfs/Makefile | 10 ++++++++++
3 files changed, 25 insertions(+)

diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index 075e775d3868b3449922a25df1f79dec5a83a42d..2a063a9b759091eba8b0d5486976552d3a5df0a0 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -50,4 +50,6 @@ source "drivers/staging/vme_user/Kconfig"

source "drivers/staging/gpib/Kconfig"

+source "drivers/staging/apfs/Kconfig"
+
endif # STAGING
diff --git a/drivers/staging/apfs/Kconfig b/drivers/staging/apfs/Kconfig
new file mode 100644
index 0000000000000000000000000000000000000000..55de44bba9ef29c79a1647d722caa57ba813d189
--- /dev/null
+++ b/drivers/staging/apfs/Kconfig
@@ -0,0 +1,13 @@
+# SPDX-License-Identifier: GPL-2.0-only
+config APFS_FS
+ tristate "Apple File System support"
+ select LIBCRC32C
+ select ZLIB_INFLATE
+ select NLS
+ select BUFFER_HEAD
+ select FS_IOMAP
+ select LEGACY_DIRECT_IO
+ help
+ If you say Y here, you will be able to mount APFS partitions
+ with read-only access. Write access is experimental and may
+ corrupt your container.
diff --git a/drivers/staging/apfs/Makefile b/drivers/staging/apfs/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..2fa127dd126716f0159baa514ba3194688ec1c0f
--- /dev/null
+++ b/drivers/staging/apfs/Makefile
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Makefile for the Linux APFS module.
+#
+
+obj-$(CONFIG_APFS_FS) += apfs.o
+apfs-y := btree.o compress.o dir.o extents.o file.o inode.o key.o libzbitmap.o \
+ lzfse/lzfse_decode.o lzfse/lzfse_decode_base.o lzfse/lzfse_fse.o \
+ lzfse/lzvn_decode_base.o message.o namei.o node.o object.o snapshot.o \
+ spaceman.o super.o symlink.o transaction.o unicode.o xattr.o xfield.o

--
2.48.1