From d6edfeadc8d5ecce12f46058af7e5994e28f4836 Mon Sep 17 00:00:00 2001 From: Jason Perlow Date: Tue, 22 Sep 2026 21:39:32 -0400 Subject: [PATCH] fs: integrate APFS driver into kernel build --- fs/Kconfig | 1 + fs/Makefile | 1 + fs/apfs/Kconfig | 13 +++++++++++++ fs/apfs/Makefile | 22 ++-------------------- 4 files changed, 17 insertions(+), 20 deletions(-) create mode 100644 fs/apfs/Kconfig diff --git a/fs/Kconfig b/fs/Kconfig index e05917adcd60..b13663989ec9 100644 --- a/fs/Kconfig +++ b/fs/Kconfig @@ -313,6 +313,7 @@ source "fs/affs/Kconfig" source "fs/ecryptfs/Kconfig" source "fs/hfs/Kconfig" source "fs/hfsplus/Kconfig" +source "fs/apfs/Kconfig" source "fs/befs/Kconfig" source "fs/bfs/Kconfig" source "fs/jffs2/Kconfig" diff --git a/fs/Makefile b/fs/Makefile index 055dfc23d82b..6e5ff360c889 100644 --- a/fs/Makefile +++ b/fs/Makefile @@ -118,6 +118,7 @@ obj-$(CONFIG_DEBUG_FS) += debugfs/ obj-$(CONFIG_TRACING) += tracefs/ obj-$(CONFIG_OCFS2_FS) += ocfs2/ obj-$(CONFIG_BTRFS_FS) += btrfs/ +obj-$(CONFIG_APFS_FS) += apfs/ obj-$(CONFIG_GFS2_FS) += gfs2/ obj-$(CONFIG_F2FS_FS) += f2fs/ obj-$(CONFIG_CEPH_FS) += ceph/ diff --git a/fs/apfs/Kconfig b/fs/apfs/Kconfig new file mode 100644 index 000000000000..99caf203a25f --- /dev/null +++ b/fs/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 will + corrupt your container. diff --git a/fs/apfs/Makefile b/fs/apfs/Makefile index 2bafc31f1a60..bc7bc8cc5c54 100644 --- a/fs/apfs/Makefile +++ b/fs/apfs/Makefile @@ -1,28 +1,10 @@ # SPDX-License-Identifier: GPL-2.0-only # -# Makefile for the out-of-tree Linux APFS module. +# Makefile for the Linux APFS module. # -KERNELRELEASE ?= $(shell uname -r) -KERNEL_DIR ?= /lib/modules/$(KERNELRELEASE)/build -PWD := $(shell pwd) - -obj-m = apfs.o +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 - -# If you want mounts to be writable by default, run the build as: -# make APFS_CONFIG=-DCONFIG_APFS_RW_ALWAYS -# This is risky and not generally recommended. -ccflags-y += $(APFS_CONFIG) - -default: - ./genver.sh - make -C $(KERNEL_DIR) M=$(PWD) -install: - make -C $(KERNEL_DIR) M=$(PWD) modules_install -clean: - rm -f version.h - make -C $(KERNEL_DIR) M=$(PWD) clean -- 2.47.3