ZFS build instructions for Buster (#38)
Co-authored-by: Gauthier Provost <gauthier@kobol.io>
This commit is contained in:
parent
c1745285e7
commit
9518a5aef1
6 changed files with 111 additions and 4 deletions
3
docs/helios64/files/zfs/Dockerfile
Normal file
3
docs/helios64/files/zfs/Dockerfile
Normal file
|
@ -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
|
||||||
|
|
49
docs/helios64/files/zfs/install-zfs.sh
Executable file
49
docs/helios64/files/zfs/install-zfs.sh
Executable file
|
@ -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 <<EOF
|
||||||
|
#!/bin/bash
|
||||||
|
cd scratch/
|
||||||
|
dpkg -i linux-headers-current-*.deb
|
||||||
|
|
||||||
|
cd "/scratch/$zfsver-$(uname -r)"
|
||||||
|
sh autogen.sh
|
||||||
|
./configure
|
||||||
|
make -s -j$(nproc)
|
||||||
|
make deb
|
||||||
|
mkdir "/scratch/deb-$zfsver-$(uname -r)"
|
||||||
|
cp *.deb "/scratch/deb-$zfsver-$(uname -r)"
|
||||||
|
rm -rf "/scratch/$zfsver-$(uname -r)"
|
||||||
|
exit
|
||||||
|
EOF
|
||||||
|
|
||||||
|
chmod +x /tmp/zfs-builds/build-zfs.sh
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "####################"
|
||||||
|
echo "starting container.."
|
||||||
|
echo "####################"
|
||||||
|
echo ""
|
||||||
|
docker run --rm -it -v /tmp/zfs-builds:/scratch zfs-build-ubuntu-bionic:0.1 /bin/bash /scratch/build-zfs.sh
|
||||||
|
|
||||||
|
# Cleanup packages (if installed).
|
||||||
|
modprobe -r zfs zunicode zzstd zlua zcommon znvpair zavl icp spl
|
||||||
|
apt remove --yes zfsutils-linux zfs-zed zfs-initramfs
|
||||||
|
apt autoremove --yes
|
||||||
|
dpkg -i "/tmp/zfs-builds/deb-$zfsver-$(uname -r)"/kmod-zfs-$(uname -r)*.deb
|
||||||
|
dpkg -i "/tmp/zfs-builds/deb-$zfsver-$(uname -r)"/{libnvpair3,libuutil3,libzfs4,libzpool4,python3-pyzfs,zfs}_*.deb
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "###################"
|
||||||
|
echo "building complete"
|
||||||
|
echo "###################"
|
||||||
|
echo ""
|
51
docs/helios64/software/zfs/build-zfs.md
Normal file
51
docs/helios64/software/zfs/build-zfs.md
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
!!! important
|
||||||
|
This install procedure only works on **Armbian Buster**
|
||||||
|
|
||||||
|
!!! note
|
||||||
|
Tested with Linux helios64 5.10.16-rockchip64 / Armbian 21.02.2
|
||||||
|
|
||||||
|
|
||||||
|
This page describes a method to easily build ZFS on your system in case the DKMS install method described [here](/helios64/software/zfs/install-zfs/) fails.
|
||||||
|
|
||||||
|
## **Step 1** - Install Docker
|
||||||
|
|
||||||
|
You can easily install docker by using **armbian-config** tool.
|
||||||
|
|
||||||
|
*armbian-config -> 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/)*
|
|
@ -25,6 +25,11 @@ Create `/etc/docker/daemon.json` with the following content:
|
||||||
|
|
||||||
## **Step 2** - Install Docker
|
## **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:
|
Add `/etc/apt/sources.list.d/docker.list` with the following content:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
|
@ -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.
|
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
|
!!! Note
|
||||||
This wiki does not cover root-on-zfs. (Although it should be also possible.)
|
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
|
## **Step 1** - Install ZFS
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,7 @@ nav:
|
||||||
- Install ZFS: 'helios64/software/zfs/install-zfs.md'
|
- Install ZFS: 'helios64/software/zfs/install-zfs.md'
|
||||||
- Docker with ZFS: 'helios64/software/zfs/docker-zfs.md'
|
- Docker with ZFS: 'helios64/software/zfs/docker-zfs.md'
|
||||||
- LXD with ZFS: 'helios64/software/zfs/lxd-zfs.md'
|
- LXD with ZFS: 'helios64/software/zfs/lxd-zfs.md'
|
||||||
|
- Build ZFS: 'helios64/software/zfs/build-zfs.md'
|
||||||
- Hardware:
|
- Hardware:
|
||||||
- Overview: 'helios64/hardware.md'
|
- Overview: 'helios64/hardware.md'
|
||||||
- Button: 'helios64/button.md'
|
- Button: 'helios64/button.md'
|
||||||
|
|
Loading…
Reference in a new issue