aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: e58c4f2c71beceeb0f12adec8cc9f576aa6db056 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105

OpenZFS Build Environment

Original document location.

Current environment covers OpenZFS for GNU/Linux version 2.2.6.

I also host branches with Debian build fixes.

Debian 13 Notes

Warning, OpenZFS 2.2.6 and 2.3.0-rc3 won't get compiled under Debian 13 currently. This is probably due to rpmbuilder spec mismatch.

However, build for Debian 12 work well under Devian 13.

Debian Dependencies

Debian 12

Install build dependencies, tested with Debian 12 following OpenZFS's Building ZFS.

sudo apt install alien autoconf automake build-essential debhelper-compat dh-autoreconf dh-dkms dh-python dkms fakeroot gawk git libaio-dev libattr1-dev libblkid-dev libcurl4-openssl-dev libelf-dev libffi-dev libpam0g-dev libssl-dev libtirpc-dev libtool libudev-dev linux-headers-generic parallel po-debconf python3 python3-all-dev python3-cffi python3-dev python3-packaging python3-setuptools python3-sphinx uuid-dev zlib1g-dev

apt install linux-headers-amd64 libselinux-dev parted lsscsi wget ksh gdebi python3-distutils

Debian 13

Install build dependencies for Debian 13 following OpenZFS's Building ZFS.

sudo apt install alien autoconf automake build-essential debhelper-compat dh-autoreconf dh-dkms dh-python dkms fakeroot gawk git libaio-dev libattr1-dev libblkid-dev libcurl4-openssl-dev libelf-dev libffi-dev libpam0g-dev libssl-dev libtirpc-dev libtool libudev-dev linux-headers-generic parallel po-debconf python3 python3-all-dev python3-cffi python3-dev python3-packaging python3-setuptools python3-sphinx uuid-dev zlib1g-dev

apt install linux-headers-amd64 libselinux-dev parted lsscsi wget ksh gdebi python3-distutils-extra

Pull sources

OpenZFS Source

Fetching the original sources.

git clone https://github.com/openzfs/zfs
cd zfs
git checkout -b b_zfs-2.2.6 zfs-2.2.6
cd ..

With Debian <= 12 Build Fix

Fetching the jausoft branch

git clone git://jausoft.com/srv/scm/openzfs/zfs.git
cd zfs
git checkout -b b_zfs_2.2.6_debian12 --track origin/b_zfs_2.2.6_debian12
cd ..

Build

The following is captured within make-all.sh script, which shall be invoked within this openzfs_build_env directory.

mkdir -p build

cd zfs
git clean -d -f -x
./autogen.sh
./configure --enable-systemd
make -j$(nproc)
make -j1 deb
mv *.tar.gz *.deb ../build
make clean
cd ..

Convenience scrips

You can find convenient removal and install scripts within scripts folder.

  • scripts: ZFS debian package remova and install scripts
  • rescue: Manual ZFS rescue scripts
  • setup: Misc ZFS setup and tuning scripts

Manual ZFS Rescue

Documented shell script rescue/chroot_zfs.sh shows how-to

  • auto import local zfs pools
  • chroot into the imported root filesystem
    • bind special devices and pipes to zfs realm
    • chroot into the zfs system
  • shows three typical recovery tasks
    • update-initramfs -u -k all
    • update-grub
    • grub-install /dev/disk/by-id/your_boot_root_device
      • perhaps repeat this for all your ZFS pool devices

ZFS Compatibility Settings

Following compatibility feature sets have been tested

  • Read-Only Feature Sets etc/zfs/compatibility.d/readonly
  • Extended GRUB2 and Read-Only Feature Sets etc/zfs/compatibility.d/grub2_readonly