From 3697261ef62204fa2563f2d7186243fefa489d9e Mon Sep 17 00:00:00 2001 From: Bahar KURT <168406273+kurtbahartr@users.noreply.github.com> Date: Mon, 31 Mar 2025 21:45:11 +0000 Subject: [PATCH] Bump module-linux-apfs-rw I should prepare a package that uses ro-by-default like the developer intended. --- .../drivers/module-linux-apfs-rw/actions.py | 4 +- .../files/rw-by-default.patch | 55 ------------------- kernel/drivers/module-linux-apfs-rw/pspec.xml | 12 ++-- 3 files changed, 11 insertions(+), 60 deletions(-) delete mode 100644 kernel/drivers/module-linux-apfs-rw/files/rw-by-default.patch diff --git a/kernel/drivers/module-linux-apfs-rw/actions.py b/kernel/drivers/module-linux-apfs-rw/actions.py index 61fe09017c..6c11e0339d 100644 --- a/kernel/drivers/module-linux-apfs-rw/actions.py +++ b/kernel/drivers/module-linux-apfs-rw/actions.py @@ -10,8 +10,10 @@ from pisi.actionsapi import pisitools KDIR = kerneltools.getKernelVersion() +CONFIGS = "-DCONFIG_APFS_RW_ALWAYS" + def build(): - autotools.make("KERNEL_DIR=/lib/modules/%s/build" % KDIR) + autotools.make("KERNEL_DIR=/lib/modules/%(kdir)s/build CONFIG=%(configs)s" % { 'kdir': KDIR, 'configs': CONFIGS }) def install(): pisitools.insinto("/lib/modules/%s/extra" % KDIR, "*.ko") diff --git a/kernel/drivers/module-linux-apfs-rw/files/rw-by-default.patch b/kernel/drivers/module-linux-apfs-rw/files/rw-by-default.patch deleted file mode 100644 index 4c54f27d69..0000000000 --- a/kernel/drivers/module-linux-apfs-rw/files/rw-by-default.patch +++ /dev/null @@ -1,55 +0,0 @@ -From e9dfb693ab15084c38805631a90730bc8c22dd37 Mon Sep 17 00:00:00 2001 -From: Bahar Kurt -Date: Tue, 22 Oct 2024 10:07:18 +0300 -Subject: [PATCH] Enable the experimental write support by default - -It looks safe enough for daily usage. ---- - super.c | 14 ++++++++++---- - 1 file changed, 10 insertions(+), 4 deletions(-) - -diff --git a/super.c b/super.c -index 5fc2b2b..a07be9a 100644 ---- a/super.c -+++ b/super.c -@@ -1184,6 +1184,9 @@ static int parse_options(struct super_block *sb, char *options) - /* Set default values before parsing */ - nx_flags = 0; - -+ /* DOWNSTREAM: Set r/w to be the default. It looks safe and sane enough to me. - Bedirhan */ -+ nx_flags |= APFS_READWRITE; -+ - if (!options) - goto out; - -@@ -1196,10 +1199,13 @@ static int parse_options(struct super_block *sb, char *options) - switch (token) { - case Opt_readwrite: - /* -- * Write support is not safe yet, so keep it disabled -- * unless the user requests it explicitly. -+ * Write support is not safe yet, and it was disabled upstream, -+ * but it looks safe and usable enough for data recovery and -+ * little operations like fixing corrupted files. - */ -- nx_flags |= APFS_READWRITE; -+ //nx_flags |= APFS_READWRITE; -+ apfs_warn(sb, "no need to explicitly state r/w mounts"); -+ apfs_notice(sb, "we have already made it the default for you downstream"); - break; - case Opt_cknodes: - /* -@@ -1242,9 +1248,9 @@ out: - if (!(sb->s_flags & SB_RDONLY)) { - if (nxi->nx_flags & APFS_READWRITE) { - apfs_notice(sb, "experimental write support is enabled"); -+ apfs_notice(sb, "this is default only downstream, and you should blame the packager for loss of written data, not the upstream"); - } else { - apfs_warn(sb, "experimental writes disabled to avoid data loss"); -- apfs_warn(sb, "if you really want them, check the README"); - sb->s_flags |= SB_RDONLY; - } - } --- -2.46.2 - diff --git a/kernel/drivers/module-linux-apfs-rw/pspec.xml b/kernel/drivers/module-linux-apfs-rw/pspec.xml index d6a164554f..6518b4f4b8 100644 --- a/kernel/drivers/module-linux-apfs-rw/pspec.xml +++ b/kernel/drivers/module-linux-apfs-rw/pspec.xml @@ -12,13 +12,10 @@ driver Experimental support for APFS The Apple File System (APFS) is the copy-on-write filesystem currently used on all Apple devices. This module provides a degree of experimental support on Linux. - https://github.com/linux-apfs/linux-apfs-rw/archive/refs/tags/v0.3.12.tar.gz + https://github.com/linux-apfs/linux-apfs-rw/archive/refs/tags/v0.3.13.tar.gz kernel-module-headers - - rw-by-default.patch - @@ -36,6 +33,13 @@ + + 2025-04-01 + 0.3.13 + Version bump & The rw-by-default is accepted upstream + Bedirhan Kurt + bedirhan.kurt@outlook.com + 2025-01-18 0.3.12