Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ZFS support with cockpit-zfs-manager #12

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,41 @@ 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
dnf -y install https://zfsonlinux.org/epel/zfs-release-2-3$(rpm --eval "%{dist}").noarch.rpm
dnf -y install epel-release
# Kernel needs to be updated to get ZFS support
for pkg in kernel kernel-core kernel-modules kernel-modules-core ; do rpm --erase $pkg --nodeps ; done
dnf install -y kernel kernel-core kernel-modules{,-core,-extra}
dnf -y install kernel-devel # Is also required for building DKMS module
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
Expand Down
2 changes: 1 addition & 1 deletion image-builder-iso.config.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[customizations.installer.kickstart]
contents = """
%post
bootc switch --mutate-in-place --transport registry ghcr.io/castrojo/portainer-centos:latest
bootc switch --mutate-in-place --transport registry ghcr.io/centos-workstation/homeserver:latest
%end
"""

Expand Down