-
Notifications
You must be signed in to change notification settings - Fork 12
/
8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch
94 lines (90 loc) · 2.84 KB
/
8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
From 918ebea43ba3c425e6ffefdbde0db6b55e445b77 Mon Sep 17 00:00:00 2001
From: Aditya Garg <[email protected]>
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)