Files
armbian-build/patch/kernel/archive/uefi-x86-7.2/8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch
T
Igor 6a2ff579d2 uefi-x86: resync 7.1 and 7.2 Apple-T2 patches from t2linux (#10550)
* uefi-x86: resync 7.1 and 7.2 Apple-T2 patches from t2linux

Drop the locally-copied Apple-T2 patch sets for uefi-x86-7.1 and
uefi-x86-7.2 and replace them with the current series from their
upstream home, t2linux/linux-t2-patches (branches 7.1 and 7.2), where
they are actively maintained. Only *.patch files are kept, matching the
family config's own auto-download cleanup.

This realigns both trees with upstream: the 7.1 SMC stack moves to the
macsmc series and both gain the APFS driver; 7.2 additionally picks up
the t2bce driver stack rename and the amdgpu/ACPI T2 fixes.

Signed-off-by: Igor Pecovnik <igor@armbian.com>

* uefi-x86-7.1: rebase t2linux magicmouse onto 7.1.12; drop broken macsmc-power

The upstream t2linux 7.1 Apple-T2 series does not apply/build against
Armbian's 7.1.12 kernel, which has since absorbed much of the magicmouse
work upstream. Carry three Armbian deltas on top of the resync:

- 4001: drop the "Add .reset_resume for SPI trackpads" sub-patch --
  mainline 7.1.12 already defines magicmouse_reset_resume() and wires
  .reset_resume, so the out-of-tree copy is a duplicate (build failure +
  a hard-failing hunk on the driver struct).

- 4000 / 4006: bracket the transport-ops stack to reconcile it with
  mainline's backported recursion guard (db8d634128d2). 4000 reverts the
  __magicmouse_raw_event(nested) split so the stack applies against the
  flat function it expects; 4006 restores the guard on the resulting
  per-transport USB handler. Fixes "'nested' undeclared".

- Drop 3011 (power-supply-macsmc "add support for intel macs"): this
  experimental feature's battery-props rewrite collides with three
  mainline refactors in macsmc-power.c (fw_ge_27 detection, the
  macsmc_battery_read_bcf0 helper, reordered identity reads) and cannot
  be reconciled without a compile+hardware test. It is irrelevant to the
  qemu-uboot-x86 build target. The is_acpi field it consumes is defined
  by 3001/3002, so nothing else depends on it.

Verified: the full magicmouse chain (4000, 4001, 4004, 4005, 4006)
applies to v7.1.12 with no corrupting fuzz and is structurally
consistent. Compile is left to CI. The durable fix belongs upstream at
t2linux (rebase their 7.1 branch onto current 7.1.y).

Signed-off-by: Igor Pecovnik <igor@armbian.com>

---------

Signed-off-by: Igor Pecovnik <igor@armbian.com>
2026-08-28 20:09:29 +02: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_CEPH_FS) += ceph/
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 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.39.5 (Apple Git-154)