From d2375455746a57444cef6d00f676f235c67b11db Mon Sep 17 00:00:00 2001 From: Tulip Blossom Date: Sun, 5 Jan 2025 01:04:56 -0300 Subject: [PATCH] feat: add zfs support and cockpit-zfs --- build.sh | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 36194f0..6f795b7 100755 --- a/build.sh +++ b/build.sh @@ -11,11 +11,38 @@ ln -sr /etc/containers/systemd/*.container /usr/lib/bootc/bound-images.d/ # Packages -dnf install -y cockpit cockpit-machines cockpit-podman cockpit-files libvirt tmux vim firewalld +# ZFS Kernel Module +# Documentation on https://openzfs.github.io/openzfs-docs/Getting%20Started/RHEL-based%20distro/index.html +# Prefer DKMS installation since it has support for kernels that arent the current EL ones +# This also needs to be sequential, else DKMS wont be able to build the kernel module +dnf -y install https://zfsonlinux.org/epel/zfs-release-2-3$(rpm --eval "%{dist}").noarch.rpm +dnf -y install epel-release +dnf -y install kernel-devel +dnf -y install zfs +echo "zfs" | tee /etc/modules-load.d/zfs.conf + +dnf install -y cockpit{,-{machines,podman,files}} libvirt tmux vim firewalld + +# Cockpit ZFS Manager +ZFS_MANAGER_TEMP=$(mktemp -d) +git clone https://github.com/45drives/cockpit-zfs-manager.git $ZFS_MANAGER_TEMP +cp -r $ZFS_MANAGER_TEMP/zfs /usr/share/cockpit +rm -rf $ZFS_MANAGER_TEMP + +# Fixes missing fonts on Cockpit ZFS manager +COCKPIT_FONT_DIRECTORY="/usr/share/cockpit/base1/fonts" +mkdir -p $COCKPIT_FONT_DIRECTORY +curl -o $COCKPIT_FONT_DIRECTORY/fontawesome.woff -sSL https://scripts.45drives.com/cockpit_font_fix/fonts/fontawesome.woff +curl -o $COCKPIT_FONT_DIRECTORY/glyphicons.woff -sSL https://scripts.45drives.com/cockpit_font_fix/fonts/glyphicons.woff +curl -o $COCKPIT_FONT_DIRECTORY/patternfly.woff -sSL https://scripts.45drives.com/cockpit_font_fix/fonts/patternfly.woff +mkdir -p /usr/share/cockpit/static/fonts +curl -sSL https://scripts.45drives.com/cockpit_font_fix/fonts/OpenSans-Semibold-webfont.woff -o /usr/share/cockpit/static/fonts/OpenSans-Semibold-webfont.woffi # Docker install: https://docs.docker.com/engine/install/centos/#install-using-the-repository dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo -dnf install -y docker-ce docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin +dnf config-manager --set-disabled docker-ce-stable +dnf -y --enablerepo docker-ce-stable install \ + docker-ce docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin # Tailscale dnf config-manager --add-repo https://pkgs.tailscale.com/stable/centos/9/tailscale.repo