Jump to content

Recommended Posts

Posted (edited)

@roswitina

Support for OpenZFS is coming, probably v0.8.5 or v0.8.6 will arrive before v2.0.0

 

In the mean time, if you want to give OpenZFS v2.0.0 a try on the current kernel you can try these scripts to build the debs needed.

Keep in mind that you would need to compile your files every time you want to upgrade your Armbian installation to match the kernel.

Building can take around 15-30 minutes - the process will use the RAM based tmpfs so your storage is untouched.

Credits goes to @wurmfood and @grek for putting together the original versions.

 

Type exit after compilation finishes to go back to default environment

Install all 'deb' files under /tmp/chroot-zfs/zfs. with 'dpkg -i'

 

add_chroot.sh  - run manually as root or sudo user if you like:

Spoiler

#!/bin/bash
# Set up a chroot
# Make sure debootstrap is installed
sudo apt install debootstrap

# Make our chroot-dir
mkdir -p /tmp/chroot-zfs

# Make the actual chroot
# Note, right now this only works on Ubuntu
sudo debootstrap --variant=buildd focal /tmp/chroot-zfs

# Set up the mounts
sudo mount -t proc /proc /tmp/chroot-zfs/proc
sudo mount --rbind /sys /tmp/chroot-zfs/sys
sudo mount --rbind /dev /tmp/chroot-zfs/dev

# Copy the files we need for apt
cp /etc/apt/sources.list .
cat /etc/apt/sources.list.d/armbian.list >> sources.list
sudo mv sources.list /tmp/chroot-zfs/etc/apt/sources.list

mkdir -p /tmp/chroot-zfs/build
# vi /tmp/chroot-zfs/build/build_zfs.sh
cp build_zfs.sh /tmp/chroot-zfs/build/
chmod +x /tmp/chroot-zfs/build/*.sh

echo "Finished. To start the chroot, use:"
echo "\tsudo chroot /tmp/chroot-zfs /bin/bash"
echo "\t./build/build_zfs.sh"
echo "When finished, unmount the proc, sys, and dev."
echo "sudo unmount /tmp/chroot-zfs/proc /tmp/chroot-zfs/sys /tmp/chroot-zfs/dev"

## Exit out of chroot and copy deb files from /tmp/chroot-zfs/zfs/*.deb
## Install debs with 'dpkg -i' libs, kmod zfs, zfs-initram & python3-pyzfs
## Enable on SystemD zfs.target zfs-import.target zfs-import-cache zfs-mount and zfs-zed

 

build_zfs.sh - place under /build directory of chroot environment.

Spoiler

#!/bin/bash
# Install wget and gnupg
apt update; apt install -y locales gnupg vim wget
## Set Locales
locale-gen en_US.UTF-8
# Add the repository key
wget -qO - http://apt.armbian.com/armbian.key | apt-key add -
## Update repositories
apt clean && apt update
# Upgrade and install tools
apt upgrade -y
apt install -y \
  alien \
  autoconf \
  automake \
  build-essential \
  dkms \
  fakeroot \
  gawk \
  gdebi-core \
  libacl1-dev \
  libaio-dev \
  libattr1-dev \
  libblkid-dev \
  libdevmapper-dev \
  libelf-dev \
  libffi-dev \
  libselinux-dev \
  libssl-dev \
  libtool \
  libudev-dev \
  linux-headers-current-rockchip64 \
  nfs-kernel-server \
  python3 \
  python3-dev \
  python3-cffi \
  python3-setuptools \
  uuid-dev \
  zlib1g-dev
## Download source
VERSION='2.0.0'
wget -O zfs.tar.gz https://github.com/openzfs/zfs/releases/download/zfs-${VERSION}/zfs-${VERSION}.tar.gz
tar -xzf zfs.tar.gz && mv zfs-* zfs && cd zfs
## Build packages
sh autogen.sh
./configure --enable-systemd
make clean && make -s -j$(nproc)
make -j$(nproc) deb-kmod deb-utils
rm -rf *devel* && rm -rf *.src.* && rm -rf *test* && rm -rf *dracut*
exit 0
 

 

Edited by SIGSEGV
Using spoiler boxes for code.
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines