Skip to content

Instantly share code, notes, and snippets.

@Alexey-Tsarev
Last active March 2, 2021 14:00
Show Gist options
  • Save Alexey-Tsarev/d5809e353e756c5ce2d49363ed63df35 to your computer and use it in GitHub Desktop.
Save Alexey-Tsarev/d5809e353e756c5ce2d49363ed63df35 to your computer and use it in GitHub Desktop.
ZFS 0.8 at Raspberry Pi
#!/usr/bin/env sh
set -e
set -x
CUR_PWD="$(pwd)"
cd "$(dirname $0)"
if [ ! -d zfs ]; then
# https://github.com/zfsonlinux/zfs/wiki/Building-ZFS
sudo apt-get install -y build-essential autoconf automake libtool gawk alien fakeroot ksh
sudo apt-get install -y zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev
sudo apt-get install -y libacl1-dev libaio-dev libdevmapper-dev libssl-dev libelf-dev
sudo apt-get install -y python3 python3-dev python3-setuptools python3-cffi
#sudo apt-get install -y linux-headers-$(uname -r)
sudo apt-get install raspberrypi-kernel-headers
sudo apt-get install -y git
git clone https://github.com/zfsonlinux/zfs.git
fi
cd zfs
git checkout .
git checkout zfs-0.8-release
git pull
git branch
make clean || true
make distclean || true
./autogen.sh
autoreconf --install --force
./configure
make -s -j$(nproc)
sudo make install
sudo ldconfig
sudo depmod -a
sudo modprobe zfs
sudo zpool import -a
sudo zpool import -a -d /dev
cd "${CUR_DIR}"
@msurinx
Copy link

msurinx commented Dec 9, 2020

Same result. See below. I am asking myself if I should install Unbuntu 20.04 which includes ZFS instead of trying this on a semi 64/32 bit Debian environment? What do you propose?

pi@rpi:~ $ sudo apt install dkms
Reading package lists... Done
Building dependency tree
Reading state information... Done
dkms is already the newest version (2.6.1-4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@rpi:~ $ uname -r
5.4.81-v8+
pi@rpi:~ $ sudo su
root@rpi:/home/pi# curl -OLf https://gist.github.com/satmandu/3aebcd7d26cdc588b40af29f1be6009c/raw/502e3b32a90495722d0286545d8b289b8a2dc908/zfs_build && chmod +x zfs_build && ./zfs_build
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 6454 100 6454 0 0 15403 0 --:--:-- --:--:-- --:--:-- 15403

  • main
  • VER=10
  • export 'CC=ccache gcc-10'
  • CC='ccache gcc-10'
  • export 'CXX=ccache g++-10'
  • CXX='ccache g++-10'
  • export SHLIB_CXXLD=g++-10
  • SHLIB_CXXLD=g++-10
    ++ pwd
  • cdir=/home/pi
    ++ uname -m
  • zfs_work=/home/pi/aarch64
  • mkdir -p /home/pi/aarch64
  • zfs_branch=zfs-2.0-release
  • ubuntu_branch=applied/ubuntu/devel
  • dist=groovy
  • mkdir -p /home/pi/aarch64
  • [[ ! -f zfs_2_symbols.patch ]]
  • cd /home/pi/aarch64
  • rm -rf zfs
  • [[ ! -d zfs ]]
  • git clone --depth=1 -b zfs-2.0-release https://github.com/openzfs/zfs.git
    Cloning into 'zfs'...
    remote: Enumerating objects: 3964, done.
    remote: Counting objects: 100% (3964/3964), done.
    remote: Compressing objects: 100% (3409/3409), done.
    remote: Total 3964 (delta 1137), reused 1261 (delta 408), pack-reused 0
    Receiving objects: 100% (3964/3964), 10.41 MiB | 5.44 MiB/s, done.
    Resolving deltas: 100% (1137/1137), done.
    ++ git -C /home/pi/aarch64/zfs rev-parse --short zfs-2.0-release
  • zfsrev=dcbf847
    ++ cd /home/pi/aarch64/zfs
    ++ git log -1 --pretty=%B
    ++ head -n 1
  • zfs_commitmsg='Tag 2.0.0'
    ++ grep Version /home/pi/aarch64/zfs/META
    ++ awk '{print $2}'
  • ZFS_VERSION=2.0.0
  • sudo apt install -y devscripts libaio-dev libblkid-dev libelf-dev libssl-dev libudev-dev python3-all-dev python3-cffi python3-sphinx uuid-dev
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    devscripts is already the newest version (2.19.5+deb10u1).
    libaio-dev is already the newest version (0.3.112-3).
    libblkid-dev is already the newest version (2.33.1-0.1).
    libelf-dev is already the newest version (0.176-1.1).
    libudev-dev is already the newest version (241-7~deb10u4+rpi1).
    python3-all-dev is already the newest version (3.7.3-1).
    python3-cffi is already the newest version (1.12.2-1).
    python3-sphinx is already the newest version (1.8.4-1).
    uuid-dev is already the newest version (2.33.1-0.1).
    libssl-dev is already the newest version (1.1.1d-0+deb10u4+rpt1).
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  • rm -f /home/pi/aarch64/bb-dependencies.sh
  • cd /home/pi/aarch64
  • curl -OLf https://raw.githubusercontent.com/openzfs/zfs-buildbot/master/scripts/bb-dependencies.sh
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 7883 100 7883 0 0 29973 0 --:--:-- --:--:-- --:--:-- 30087
  • sudo bash /home/pi/aarch64/bb-dependencies.sh
    Missing configuration /etc/buildslave. Assuming dependencies are
    already satisfied and this is a persistent buildslave.
  • cd /home/pi/aarch64/zfs
  • ./autogen.sh
    autoreconf: Entering directory .' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force -I config autoreconf: configure.ac: tracing autoreconf: configure.ac: AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION autoreconf: running: libtoolize --copy --force libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'config'. libtoolize: copying file 'config/ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'config'. libtoolize: copying file 'config/libtool.m4' libtoolize: copying file 'config/ltoptions.m4' libtoolize: copying file 'config/ltsugar.m4' libtoolize: copying file 'config/ltversion.m4' libtoolize: copying file 'config/lt~obsolete.m4' autoreconf: running: /usr/bin/autoconf --force autoreconf: running: /usr/bin/autoheader --force autoreconf: running: automake --add-missing --copy --force-missing configure.ac:49: installing 'config/compile' configure.ac:39: installing 'config/config.guess' configure.ac:39: installing 'config/config.sub' configure.ac:42: installing 'config/install-sh' configure.ac:42: installing 'config/missing' cmd/mount_zfs/Makefile.am: installing 'config/depcomp' autoreconf: Leaving directory .'
  • cd /home/pi/aarch64
  • rm -rf /home/pi/aarch64/zfs-linux
  • mkdir -p /home/pi/aarch64/zfs-linux
  • cd /home/pi/aarch64/zfs-linux
  • git init
    Initialized empty Git repository in /home/pi/aarch64/zfs-linux/.git/
  • git remote add origin https://git.launchpad.net/ubuntu/+source/zfs-linux
  • git checkout -b applied/ubuntu/devel
    Switched to a new branch 'applied/ubuntu/devel'
  • git config core.sparsecheckout true
  • echo debian/
  • git config pull.ff only
  • git pull origin applied/ubuntu/devel
    remote: Enumerating objects: 16932, done.
    remote: Counting objects: 100% (16932/16932), done.
    remote: Compressing objects: 100% (5036/5036), done.
    remote: Total 16932 (delta 12303), reused 16177 (delta 11774)
    Receiving objects: 100% (16932/16932), 12.44 MiB | 5.64 MiB/s, done.
    Resolving deltas: 100% (12303/12303), done.
    From https://git.launchpad.net/ubuntu/+source/zfs-linux
  • branch applied/ubuntu/devel -> FETCH_HEAD
  • [new branch] applied/ubuntu/devel -> origin/applied/ubuntu/devel
  • mv /home/pi/aarch64/zfs-linux/debian/patches/series /home/pi/aarch64/zfs-linux/debian/patches/series.old
  • mv /home/pi/aarch64/zfs-linux/debian /home/pi/aarch64/zfs/
  • cd /home/pi/aarch64/zfs
  • sed -i 's/DO_OVERLAY_MOUNTS='''no'''/DO_OVERLAY_MOUNTS='''yes'''/g' etc/default/zfs.in
  • cd /home/pi/aarch64/zfs
  • sed -i 's/usr/share/pkgconfig/lib/pkgconfig/g' debian/libzfslinux-dev.install
  • cd /home/pi/aarch64/zfs
  • sed -i /zfs-load-module.service/d debian/zfsutils-linux.install
  • cd /home/pi/aarch64/zfs
  • sed -i '/enum-extract.*/a \t\t'''$(CURDIR)/scripts/make_gitrev.sh''' \' debian/rules
  • zfsutilsfilesadd=(usr/share/pam-configs/zfs_key usr/share/man/man8/zstream.8 usr/share/man/man8/zfs-change-key.8 usr/share/man/man8/zpool-wait.8 usr/share/man/man8/zpoolprops.8 usr/share/man/man8/zfs-unjail.8 usr/share/man/man8/zpool-list.8 usr/share/man/man8/zpool-split.8 usr/share/man/man8/zpool-replace.8 usr/share/man/man8/zpool-set.8 usr/share/man/man8/zpool-upgrade.8 usr/share/man/man8/zfs-upgrade.8 usr/share/man/man8/zpool-history.8 usr/share/man/man8/zfs-projectspace.8 usr/share/man/man8/zpool-offline.8 usr/share/man/man8/zfs-create.8 usr/share/man/man8/zfs-snapshot.8 usr/share/man/man8/zpool-events.8 usr/share/man/man8/zfs-rollback.8 usr/share/man/man8/zfs-destroy.8 usr/share/man/man8/zpool-destroy.8 usr/share/man/man8/zpool-get.8 usr/share/man/man8/zpool-trim.8 usr/share/man/man8/zfs-diff.8 usr/share/man/man8/zfs-jail.8 usr/share/man/man8/zfs-rename.8 usr/share/man/man8/zpool-online.8 usr/share/man/man8/zfs-promote.8 usr/share/man/man8/zpool-import.8 usr/share/man/man8/zfs-get.8 usr/share/man/man8/zfs-unallow.8 usr/share/man/man8/zpool-clear.8 usr/share/man/man8/zfs-unload-key.8 usr/share/man/man8/zfs-mount.8 usr/share/man/man8/zpool-labelclear.8 usr/share/man/man8/zpool-resilver.8 usr/share/man/man8/zpool-status.8 usr/share/man/man8/zfs-share.8 usr/share/man/man8/zfs_ids_to_path.8 usr/share/man/man8/zfs-load-key.8 usr/share/man/man8/zpool-export.8 usr/share/man/man8/zfs-hold.8 usr/share/man/man8/zpool-remove.8 usr/share/man/man8/zpool-initialize.8 usr/share/man/man8/zpoolconcepts.8 usr/share/man/man8/zfsconcepts.8 usr/share/man/man8/zfs-send.8 usr/share/man/man8/zfs-userspace.8 usr/share/man/man8/zfs-release.8 usr/share/man/man8/zpool-create.8 usr/share/man/man8/zpool-reguid.8 usr/share/man/man8/zfsprops.8 usr/share/man/man8/zpool-scrub.8 usr/share/man/man8/zfs-list.8 usr/share/man/man8/zfs-set.8 usr/share/man/man8/zfs-clone.8 usr/share/man/man8/zfs-inherit.8 usr/share/man/man8/zfs-bookmark.8 usr/share/man/man8/zfs-unmount.8 usr/share/man/man8/zfs-project.8 usr/share/man/man8/zfs-groupspace.8 usr/share/man/man8/zfs-redact.8 usr/share/man/man8/zpool-attach.8 usr/share/man/man8/zpool-sync.8 usr/share/man/man8/zpool-checkpoint.8 usr/share/man/man8/zfs-allow.8 usr/share/man/man8/zpool-reopen.8 usr/share/man/man8/zfs-wait.8 usr/share/man/man8/zfs-recv.8 usr/share/man/man8/zpool-iostat.8 usr/share/man/man8/zfs-receive.8 usr/share/man/man8/zpool-add.8 usr/share/man/man8/zpool-detach.8 usr/share/man/man1/arcstat.1 lib/security/pam_zfs_key.so lib/security/pam_zfs_key.la sbin/zstream sbin/zfs_ids_to_path)
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/pam-configs/zfs_key
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zstream.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-change-key.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-wait.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpoolprops.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-unjail.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-list.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-split.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-replace.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-set.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-upgrade.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-upgrade.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-history.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-projectspace.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-offline.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-create.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-snapshot.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-events.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-rollback.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-destroy.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-destroy.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-get.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-trim.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-diff.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-jail.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-rename.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-online.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-promote.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-import.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-get.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-unallow.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-clear.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-unload-key.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-mount.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-labelclear.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-resilver.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-status.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-share.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs_ids_to_path.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-load-key.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-export.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-hold.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-remove.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-initialize.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpoolconcepts.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfsconcepts.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-send.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-userspace.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-release.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-create.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-reguid.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfsprops.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-scrub.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-list.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-set.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-clone.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-inherit.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-bookmark.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-unmount.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-project.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-groupspace.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-redact.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-attach.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-sync.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-checkpoint.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-allow.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-reopen.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-wait.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-recv.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-iostat.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zfs-receive.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-add.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man8/zpool-detach.8
  • for i in "${zfsutilsfilesadd[@]}"
  • echo usr/share/man/man1/arcstat.1
  • for i in "${zfsutilsfilesadd[@]}"
  • echo lib/security/pam_zfs_key.so
  • for i in "${zfsutilsfilesadd[@]}"
  • echo lib/security/pam_zfs_key.la
  • for i in "${zfsutilsfilesadd[@]}"
  • echo sbin/zstream
  • for i in "${zfsutilsfilesadd[@]}"
  • echo sbin/zfs_ids_to_path
  • libzfs2filesadd=(lib/libzfsbootenv.a lib/libzfsbootenv.so.1 lib/libzfsbootenv.so.1.0.0)
  • for i in "${libzfs2filesadd[@]}"
  • echo lib/libzfsbootenv.a
  • for i in "${libzfs2filesadd[@]}"
  • echo lib/libzfsbootenv.so.1
  • for i in "${libzfs2filesadd[@]}"
  • echo lib/libzfsbootenv.so.1.0.0
  • cd /home/pi/aarch64
  • patch -p1
    patching file zfs/debian/libnvpair1linux.symbols
    patching file zfs/debian/libuutil1linux.symbols
    patching file zfs/debian/libzfs2linux.symbols
    patching file zfs/debian/libzpool2linux.symbols
    patching file zfs/debian/libzpool2linux.symbols
    patching file zfs/debian/libzpool2linux.symbols
    patching file zfs/debian/libuutil1linux.symbols
    patching file zfs/debian/libzpool2linux.symbols
  • [[ ! -f /home/pi/aarch64/zfs/debian/changelog ]]
  • cd /home/pi/aarch64/zfs
  • dch '' --distribution groovy -b -v 2.0.0 'Tag 2.0.0'
    libdistro-info-perl is not installed, Debian release names are not known.
    libdistro-info-perl is not installed, Ubuntu release names are not known.
    dch warning: New package version is Debian native whilst previous version was not
  • mkdir -p /home/pi/aarch64/logs/
  • echo 'tail -F /home/pi/aarch64/logs/dcbf847.log'
    tail -F /home/pi/aarch64/logs/dcbf847.log
  • nice -n 20 debuild --preserve-envvar=CC --no-tgz-check -b -uc -us
  • echo failure
    failure
  • success=1
  • tail /home/pi/aarch64/logs/dcbf847.log
    #define VERSION "2.0.0"

configure: exit 77
dh_auto_configure: ./configure --build=arm-linux-gnueabihf --prefix=/usr --includedir=${prefix}/include --mandir=${prefix}/share/man --infodir=${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=${prefix}/lib/arm-linux-gnueabihf --libexecdir=${prefix}/lib/arm-linux-gnueabihf --disable-maintainer-mode --disable-dependency-tracking --bindir=/usr/bin --sbindir=/sbin --libdir=/lib --with-udevdir=/lib/udev --with-zfsexecdir=/usr/lib/zfs-linux --enable-systemd --enable-pyzfs --with-python=python3 --with-systemdunitdir=/lib/systemd/system --with-systemdpresetdir=/lib/systemd/system-preset --with-systemdgeneratordir=/lib/systemd/system-generators --with-config=user returned exit code 77
make[1]: *** [debian/rules:48: override_dh_auto_configure] Error 2
make[1]: Leaving directory '/home/pi/aarch64/zfs'
make: *** [debian/rules:34: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui -b failed

  • [[ 1 == \0 ]]
    root@rpi:/home/pi#

@freddieventura
Copy link

Hi ,
First of all thanks for your script , I'm looking forward using it.
I tried to install it though on my Raspberry Pi 3 Model B+ , on a fresh installation of 2020-12-02-raspios-buster-armhf-lite I've got the following error

depmod: ERROR: could not open directory /lib/modules/5.4.79-v7+: No such file or directory
depmod: FATAL: could not search modules: No such file or directory

I've been trying to do some of the stuff the other contributors had shared , but I haven't had luck so far

I would appreciate if someone can guide me with this.

Thanks

Full installation log on the link (didn't fit on the comment)

https://termbin.com/dj9b

@freddieventura
Copy link

My problem can be fixed by doing

sudo umount /boot
sudo mount /dev/mmcblk0p1 /boot
sudo apt install --reinstall raspberrypi-bootloader
sudo reboot

Thanks for the resource !

@roland-orange
Copy link

Hi Alexey, and again, thank you for the script. I have used this successfully many times, and this way have found ZFS to be sufficiently reliable under the regular 32bit RPiOS to be used in production machines across several kernel updates.

However the script errors out under the recently-released kernel 5.10.11 updates, returning the following. Any guidance as to how I might fix this would be appreciated!

Making all in zcp
Making all in module
/home/pi/Downloads/zfs/zfs/module/zfs/vdev_disk.c: In function ‘vdev_blkg_tryget’:
/home/pi/Downloads/zfs/zfs/module/zfs/vdev_disk.c:506:37: error: ‘struct percpu_ref’ has no member named ‘count’
rc = atomic_long_inc_not_zero(&ref->count);
^~
make[5]: *** [scripts/Makefile.build:279: /home/pi/Downloads/zfs/zfs/module/zfs/vdev_disk.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [scripts/Makefile.build:496: /home/pi/Downloads/zfs/zfs/module/zfs] Error 2
make[3]: *** [Makefile:1808: /home/pi/Downloads/zfs/zfs/module] Error 2
make[2]: *** [Makefile:30: modules] Error 2
make[1]: *** [Makefile:843: all-recursive] Error 1
make: *** [Makefile:712: all] Error 2

@satmandu
Copy link

FYI the 2.0.x zfs-dkms and related packages in the upcoming ubuntu 21.04 support linux 5.10.x

@roland-orange
Copy link

Thank you. So realistically nothing can be done (other than downgrading the kernel) until the updated zfs-dkms also appear in the RPiOS repos? Or could I try building zfs-dkms from source and then retrying the script above?

@jimmont
Copy link

jimmont commented Mar 2, 2021

@satmandu what's the best way currently to install the 2.0.x zfs-dkms (and related) on 5.10.x (raspberrypi os)?

@satmandu
Copy link

satmandu commented Mar 2, 2021

@jimmont Easiest way would be to upgrade to bullseye, as zfs 2.0.x is already there: https://packages.debian.org/bullseye/zfs-dkms

(The only pain in upgrading to bullseye was that IIRC I had to upgrade to gcc-9 and remove some gcc8 library package which I no longer needed which was holding up other package upgrades.)

@satmandu
Copy link

satmandu commented Mar 2, 2021

(This is assuming that you are on the 64 bit Raspi-OS of course.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment