Skip to content

Commit d9e50e7

Browse files
committed
Allow choice of mountable writes by default
A distro packager has requested writable mounts by default, and is willing to take responsibility for any potential harm to their users: #81 Add a build flag to enable this, but leave it undocumented to avoid confusing anyone. Signed-off-by: Ernesto A. Fernández <ernesto@corellium.com>
1 parent eda21f3 commit d9e50e7

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ apfs-y := btree.o compress.o dir.o extents.o file.o inode.o key.o libzbitmap.o \
1313
lzfse/lzvn_decode_base.o message.o namei.o node.o object.o snapshot.o \
1414
spaceman.o super.o symlink.o transaction.o unicode.o xattr.o xfield.o
1515

16+
# If you want mounts to be writable by default, run the build as:
17+
# make CONFIG=-DCONFIG_APFS_RW_ALWAYS
18+
# This is risky and not generally recommended.
19+
ccflags-y += $(CONFIG)
20+
1621
default:
1722
./genver.sh
1823
make -C $(KERNEL_DIR) M=$(PWD)

super.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,11 @@ static int parse_options(struct super_block *sb, char *options)
11941194
/* Set default values before parsing */
11951195
nx_flags = 0;
11961196

1197+
#ifdef CONFIG_APFS_RW_ALWAYS
1198+
/* Still risky, but some packagers want writable mounts by default */
1199+
nx_flags |= APFS_READWRITE;
1200+
#endif
1201+
11971202
if (!options)
11981203
goto out;
11991204

0 commit comments

Comments
 (0)