From 9518a5aef11b30b6348cf3d3b2ec165eb5310a3f Mon Sep 17 00:00:00 2001 From: samorodkin Date: Fri, 26 Feb 2021 09:55:40 +0300 Subject: [PATCH] ZFS build instructions for Buster (#38) Co-authored-by: Gauthier Provost --- docs/helios64/files/zfs/Dockerfile | 3 ++ docs/helios64/files/zfs/install-zfs.sh | 49 ++++++++++++++++++++++ docs/helios64/software/zfs/build-zfs.md | 51 +++++++++++++++++++++++ docs/helios64/software/zfs/docker-zfs.md | 5 +++ docs/helios64/software/zfs/install-zfs.md | 6 +-- mkdocs.yml | 1 + 6 files changed, 111 insertions(+), 4 deletions(-) create mode 100644 docs/helios64/files/zfs/Dockerfile create mode 100755 docs/helios64/files/zfs/install-zfs.sh create mode 100644 docs/helios64/software/zfs/build-zfs.md diff --git a/docs/helios64/files/zfs/Dockerfile b/docs/helios64/files/zfs/Dockerfile new file mode 100644 index 0000000..193aff3 --- /dev/null +++ b/docs/helios64/files/zfs/Dockerfile @@ -0,0 +1,3 @@ +FROM ubuntu:bionic +RUN apt update; apt install build-essential autoconf automake bison flex libtool gawk alien fakeroot dkms libblkid-dev uuid-dev libudev-dev libssl-dev zlib1g-dev libaio-dev libattr1-dev libelf-dev python3 python3-dev python3-setuptools python3-cffi libffi-dev -y; apt install software-properties-common -y; add-apt-repository ppa:ubuntu-toolchain-r/test; apt install gcc-10 g++-10 -y; update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10; update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10 + diff --git a/docs/helios64/files/zfs/install-zfs.sh b/docs/helios64/files/zfs/install-zfs.sh new file mode 100755 index 0000000..e4462a6 --- /dev/null +++ b/docs/helios64/files/zfs/install-zfs.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +#define zfs version +zfsver="zfs-2.0.3" +#creating building directory +mkdir /tmp/zfs-builds && cd "$_" +rm -rf /tmp/zfs-builds/build-zfs.sh +apt-get download linux-headers-current-rockchip64 +git clone -b $zfsver https://github.com/openzfs/zfs.git $zfsver-$(uname -r) + +#create file to execute inside container +echo "creating ZFS build script to be executed inside container" +cat > /tmp/zfs-builds/build-zfs.sh < software -> softy -> docker* + +## **Step 2** - Create Dockerfile + +Create dedicated directory with the required Dockerfile + +```bash +mkdir zfs-builder +cd zfs-builder +wget https://wiki.kobol.io/helios64/files/zfs/Dockerfile +``` + +Build docker image for ZFS building purpose. + +```bash +sudo docker build --tag zfs-build-ubuntu-bionic:0.1 . +``` + +## **Step 3** - Build and install ZFS packages. + +```bash +wget https://wiki.kobol.io/helios64/files/zfs/install-zfs.sh +chmod +x install-zfs.sh +./install-zfs.sh +``` + +On succeed, you may need to reboot and enable services: + +```bash +sudo reboot +sudo systemctl enable zfs-import-cache zsf-import.target zfs-mount zfs.target zfs-zed +``` + +------------ + +*Page contributed by [samorodkin](https://github.com/samorodkin)* + +*Reference [Armbian Forum Dicussion](https://forum.armbian.com/topic/16119-zfs-on-helios64/)* diff --git a/docs/helios64/software/zfs/docker-zfs.md b/docs/helios64/software/zfs/docker-zfs.md index 52c890f..d6312d5 100644 --- a/docs/helios64/software/zfs/docker-zfs.md +++ b/docs/helios64/software/zfs/docker-zfs.md @@ -25,6 +25,11 @@ Create `/etc/docker/daemon.json` with the following content: ## **Step 2** - Install Docker +!!! Note + You can easily install docker by using **armbian-config** tool. + + *armbian-config -> software -> softy -> docker* + Add `/etc/apt/sources.list.d/docker.list` with the following content: ```bash diff --git a/docs/helios64/software/zfs/install-zfs.md b/docs/helios64/software/zfs/install-zfs.md index a03c39e..7e9fcf6 100644 --- a/docs/helios64/software/zfs/install-zfs.md +++ b/docs/helios64/software/zfs/install-zfs.md @@ -1,12 +1,10 @@ -!!! Important - This install procedure only works with *Armbian Focal* for now. Instructions for *Armbian Buster* to be added soon. - So you already installed the system on eMMC or SD? You might want to use ZFS on the hard disk(s)! We assume rootfs is already on eMMC (or microSD Card) and you want to store your data on HDDs in ZFS pool. !!! Note This wiki does not cover root-on-zfs. (Although it should be also possible.) - +!!! Note + If this method fails you can try to build directly ZFS on your system with the following [instructions](/helios64/software/zfs/build-zfs). ## **Step 1** - Install ZFS diff --git a/mkdocs.yml b/mkdocs.yml index 7c50c28..6f936d3 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -89,6 +89,7 @@ nav: - Install ZFS: 'helios64/software/zfs/install-zfs.md' - Docker with ZFS: 'helios64/software/zfs/docker-zfs.md' - LXD with ZFS: 'helios64/software/zfs/lxd-zfs.md' + - Build ZFS: 'helios64/software/zfs/build-zfs.md' - Hardware: - Overview: 'helios64/hardware.md' - Button: 'helios64/button.md'