Skip to content

Commit ed6a633

Browse files
Package the linux-apfs-rw kernel module
1 parent 0d298e5 commit ed6a633

File tree

5 files changed

+111
-1
lines changed

5 files changed

+111
-1
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242
rust-nonempty/*
4343
rust-rust-ini0.20/*
4444
t2fanrd/*
45+
linux-apfs-rw/*
46+
linux-apfs-rw-kmod/*
4547
dir_names: "true"
4648

4749
- name: "Increase Disk Space"

.github/workflows/copr-webhooks.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
- "rust-nonempty/*"
1414
- "rust-rust-ini0.20/*"
1515
- "t2fanrd/*"
16+
- "linux-apfs-rw/*"
17+
- "linux-apfs-rw-kmod/*"
1618

1719
jobs:
1820
copr-webhook:

build-packages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -e
33

44
if [ "$1" == "all" ]; then
5-
packages=( "t2linux-config" "t2linux-audio" "rust-tiny-dfr" "kernel" "copr-sharpenedblade-t2linux-release" "rust-arraydeque" "rust-nonempty" "rust-rust-ini0.20" "t2fanrd" )
5+
packages=( "t2linux-config" "t2linux-audio" "rust-tiny-dfr" "kernel" "copr-sharpenedblade-t2linux-release" "rust-arraydeque" "rust-nonempty" "rust-rust-ini0.20" "t2fanrd" "linux-apfs-rw" "linux-apfs-rw-kmod" )
66
else
77
packages=( "$@" )
88
fi
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
%global debug_package %{nil}
2+
3+
%global forgeurl https://github.com/linux-apfs/linux-apfs-rw
4+
Version: 0.3.9
5+
%forgemeta
6+
7+
%global buildforkernels akmod
8+
9+
%define kmod_name apfs
10+
%define src_name linux-apfs-rw
11+
12+
Name: %{src_name}-kmod
13+
Release: 1%{?dist}
14+
Summary: APFS module for linux, with experimental write support
15+
URL: %{forgeurl}
16+
Source: %{forgesource}
17+
License: GPL-2.0
18+
19+
BuildRequires: kmodtool
20+
21+
%description
22+
The Apple File System (APFS) is the copy-on-write filesystem currently used on
23+
all Apple devices. This module provides a degree of experimental support on Linux.
24+
25+
This module is the result of reverse engineering and testing has been limited.
26+
If you make use of the write support, expect data corruption. Encryption is not
27+
yet implemented even in read-only mode, and neither are fusion drives.
28+
29+
# kmodtool does its magic here
30+
%{expand:%(kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) }
31+
32+
%prep
33+
34+
# error out if there was something wrong with kmodtool
35+
%{?kmodtool_check}
36+
37+
# print kmodtool output for debugging purposes:
38+
kmodtool --target %{_target_cpu} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null
39+
40+
%forgeautosetup %{src_name}-%{version}
41+
42+
./genver.sh
43+
44+
for kernel_version in %{?kernel_versions}; do
45+
cp -a $PWD %{_builddir}/_kmod_build_${kernel_version%%___*}
46+
done
47+
48+
%build
49+
50+
for kernel_version in %{?kernel_versions}; do
51+
make modules %{?_smp_mflags} \
52+
-C ${kernel_version##*___} \
53+
M=%{_builddir}/_kmod_build_${kernel_version%%___*}
54+
done
55+
56+
%install
57+
58+
for kernel_version in %{?kernel_versions}; do
59+
make install \
60+
-C ${kernel_version##*___} \
61+
M=%{_builddir}/_kmod_build_${kernel_version%%___*} \
62+
DESTDIR=%{buildroot} \
63+
KMODPATH=%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}
64+
done
65+
66+
%{?akmod_install}
67+
68+
%changelog

linux-apfs-rw/linux-apfs-rw.spec

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
%global debug_package %{nil}
2+
3+
%global forgeurl https://github.com/linux-apfs/linux-apfs-rw
4+
Version: 0.3.9
5+
%forgemeta
6+
7+
Name: linux-apfs-rw
8+
Release: 1%{?dist}
9+
Summary: APFS module for linux, with experimental write support
10+
URL: %{forgeurl}
11+
Source: %{forgesource}
12+
License: GPL-2.0
13+
14+
Provides: %{name}-kmod-common = %{version}
15+
Requires: %{name}-kmod >= %{version}
16+
17+
%description
18+
The Apple File System (APFS) is the copy-on-write filesystem currently used on
19+
all Apple devices. This module provides a degree of experimental support on Linux.
20+
21+
This module is the result of reverse engineering and testing has been limited.
22+
If you make use of the write support, expect data corruption. Encryption is not
23+
yet implemented even in read-only mode, and neither are fusion drives.
24+
25+
%prep
26+
27+
%forgeautosetup
28+
29+
%build
30+
31+
%install
32+
33+
%files
34+
35+
%doc README.rst
36+
%license LICENSE
37+
38+
%changelog

0 commit comments

Comments
 (0)