Files
linux-t2-patches/8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch
T
2024-11-10 11:02:58 +01:00

95 lines
2.8 KiB
Diff

From 918ebea43ba3c425e6ffefdbde0db6b55e445b77 Mon Sep 17 00:00:00 2001
From: Aditya Garg <85610623+AdityaGarg8@users.noreply.github.com>
Date: Sun, 10 Nov 2024 15:31:18 +0530
Subject: [PATCH] Necessary modifications to build APFS with the kernel
---
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 aae170fc2..5131d5b3c 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -321,6 +321,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/efs/Kconfig"
diff --git a/fs/Makefile b/fs/Makefile
index 61679fd58..8a17c50d7 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -120,6 +120,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_BCACHEFS_FS) += bcachefs/
diff --git a/fs/apfs/Kconfig b/fs/apfs/Kconfig
new file mode 100644
index 000000000..99caf203a
--- /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 a2dbed980..bc7bc8cc5 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 CONFIG=-DCONFIG_APFS_RW_ALWAYS
-# This is risky and not generally recommended.
-ccflags-y += $(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.39.5 (Apple Git-154)