Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
ZFS_VERSION="0.7.13"
CONTAINER=$(buildah from fedora:30)
buildah run $CONTAINER dnf clean all
buildah run $CONTAINER dnf -y update
buildah run $CONTAINER dnf -y install \
autoconf \
automake \
elfutils-libelf-devel \
ksh \
libaio-devel\
libattr-devel \
libblkid-devel \
libselinux-devel \
libtirpc-devel \
libtool \
libudev-devel \
libuuid-devel \
lsscsi \
make \
openssl-devel \
parted \
rpm-build \
wget \
zlib-devel
buildah run $CONTAINER dnf -y install kernel-devel
KERNEL_VERSION=$(buildah run $CONTAINER bash -c "rpm -q kernel-devel|sed 's/kernel-devel-//'")
buildah run $CONTAINER wget -O /root/spl-$ZFS_VERSION.tar.gz https://github.com/zfsonlinux/zfs/releases/download/zfs-$ZFS_VERSION/spl-$ZFS_VERSION.tar.gz
buildah run $CONTAINER wget -O /root/zfs-$ZFS_VERSION.tar.gz https://github.com/zfsonlinux/zfs/releases/download/zfs-$ZFS_VERSION/zfs-$ZFS_VERSION.tar.gz
buildah run $CONTAINER tar xf /root/spl-$ZFS_VERSION.tar.gz -C /root
buildah run $CONTAINER bash -c "cd /root/spl-$ZFS_VERSION; ./configure --with-config=srpm; make -s -j$(nproc)"
buildah run $CONTAINER bash -c "cd /root/spl-$ZFS_VERSION; make -j1 pkg-utils rpm-dkms"
buildah run $CONTAINER dnf -y install /root/spl-$ZFS_VERSION/spl-dkms-$ZFS_VERSION-1.fc30.noarch.rpm
buildah run $CONTAINER tar xf /root/zfs-$ZFS_VERSION.tar.gz -C /root
buildah run $CONTAINER bash -c "cd /root/zfs-$ZFS_VERSION; ./configure --with-config=srpm; make -s -j$(nproc)"
buildah run $CONTAINER bash -c "cd /root/zfs-$ZFS_VERSION; make -j1 pkg-utils rpm-dkms"
mkdir ~/zfs-rpms
MOUNTPOINT=$(buildah mount $CONTAINER)
mv $MOUNTPOINT/root/{spl,zfs}-$ZFS_VERSION/*.rpm ~/zfs-rpms
buildah rm $CONTAINER
#!/bin/bash
ZFS_VERSION="0.7.13"
CONTAINER=$(buildah from fedora:30)
buildah run $CONTAINER dnf clean all
buildah run $CONTAINER dnf -y update
buildah run $CONTAINER dnf -y install \
autoconf \
automake \
elfutils-libelf-devel \
ksh \
libaio-devel\
libattr-devel \
libblkid-devel \
libselinux-devel \
libtirpc-devel \
libtool \
libudev-devel \
libuuid-devel \
lsscsi \
make \
openssl-devel \
parted \
rpm-build \
wget \
zlib-devel
buildah run $CONTAINER dnf -y install kernel-devel
KERNEL_VERSION=$(buildah run $CONTAINER bash -c "rpm -q kernel-devel|sed 's/kernel-devel-//'")
buildah run $CONTAINER wget -O /root/spl-$ZFS_VERSION.tar.gz https://github.com/zfsonlinux/zfs/releases/download/zfs-$ZFS_VERSION/spl-$ZFS_VERSION.tar.gz
buildah run $CONTAINER wget -O /root/zfs-$ZFS_VERSION.tar.gz https://github.com/zfsonlinux/zfs/releases/download/zfs-$ZFS_VERSION/zfs-$ZFS_VERSION.tar.gz
buildah run $CONTAINER tar xf /root/spl-$ZFS_VERSION.tar.gz -C /root
buildah run $CONTAINER bash -c "cd /root/spl-$ZFS_VERSION; ./configure; make -s -j$(nproc)"
buildah run $CONTAINER bash -c "cd /root/spl-$ZFS_VERSION; make -j1 pkg-utils pkg-kmod"
buildah run $CONTAINER dnf -y install \
/root/spl-$ZFS_VERSION/spl-$ZFS_VERSION-1.fc30.x86_64.rpm \
/root/spl-$ZFS_VERSION/kmod-spl-devel-$ZFS_VERSION-1.fc30.x86_64.rpm \
/root/spl-$ZFS_VERSION/kmod-spl-$KERNEL_VERSION-$ZFS_VERSION-1.fc30.x86_64.rpm \
/root/spl-$ZFS_VERSION/kmod-spl-devel-$KERNEL_VERSION-$ZFS_VERSION-1.fc30.x86_64.rpm
buildah run $CONTAINER tar xf /root/zfs-$ZFS_VERSION.tar.gz -C /root
buildah run $CONTAINER bash -c "cd /root/zfs-$ZFS_VERSION; ./configure; make -s -j$(nproc)"
buildah run $CONTAINER bash -c "cd /root/zfs-$ZFS_VERSION; make -j1 pkg-utils pkg-kmod"
mkdir ~/zfs-rpms
MOUNTPOINT=$(buildah mount $CONTAINER)
mv $MOUNTPOINT/root/{spl,zfs}-$ZFS_VERSION/*.rpm ~/zfs-rpms
buildah rm $CONTAINER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.