Skip to content

Commit 092a9c9

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

File tree

5 files changed

+109
-1
lines changed

5 files changed

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

0 commit comments

Comments
 (0)