From 9bc61b60add30a356f5fb69932ed60225b6bffba Mon Sep 17 00:00:00 2001 From: Elvin Luff Date: Thu, 9 Jan 2025 17:59:58 +0100 Subject: [PATCH] feat: add cockpit-zfs-manager for zfs builds (#145) Co-authored-by: Benjamin Sherman --- README.md | 1 + ucore/install-ucore.sh | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/README.md b/README.md index c6aa277..f088147 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,7 @@ This image builds on `ucore-minimal` but adds drivers, storage tools and utiliti - [snapraid](https://www.snapraid.it/) - usbutils(and pciutils) - technically pciutils is pulled in by open-vm-tools in ucore-minimal - Optional [ZFS versions](#tag-matrix) add: + - [cockpit-zfs-manager](https://github.com/45Drives/cockpit-zfs-manager) (an interactive ZFS on Linux admin package for Cockpit) - [sanoid/syncoid dependencies](https://github.com/jimsalterjrs/sanoid) - [see below](#zfs) for details #### `ucore-hci` diff --git a/ucore/install-ucore.sh b/ucore/install-ucore.sh index c210bb6..2aaebcf 100755 --- a/ucore/install-ucore.sh +++ b/ucore/install-ucore.sh @@ -13,6 +13,28 @@ fi export IMAGE_NAME=ucore /ctx/packages.sh +## CONDITIONAL: ZFS support +if [[ "-zfs" == "${ZFS_TAG}" ]]; then + # cockpit plugin for ZFS management + curl --fail --retry 5 --retry-delay 5 --retry-all-errors -sSL -o /tmp/cockpit-zfs-manager-api.json \ + "https://api.github.com/repos/45Drives/cockpit-zfs-manager/releases/latest" + CZM_TGZ_URL=$(jq -r .tarball_url /tmp/cockpit-zfs-manager-api.json) + curl -sSL -o /tmp/cockpit-zfs-manager.tar.gz "${CZM_TGZ_URL}" + + mkdir -p /tmp/cockpit-zfs-manager + tar -zxvf /tmp/cockpit-zfs-manager.tar.gz -C /tmp/cockpit-zfs-manager --strip-components=1 + mv /tmp/cockpit-zfs-manager/polkit-1/actions/* /usr/share/polkit-1/actions/ + mv /tmp/cockpit-zfs-manager/polkit-1/rules.d/* /usr/share/polkit-1/rules.d/ + mv /tmp/cockpit-zfs-manager/zfs /usr/share/cockpit + + curl -sSL -o /tmp/cockpit-zfs-manager-font-fix.sh \ + https://raw.githubusercontent.com/45Drives/scripts/refs/heads/main/cockpit_font_fix/fix-cockpit.sh + chmod +x /tmp/cockpit-zfs-manager-font-fix.sh + /tmp/cockpit-zfs-manager-font-fix.sh + + rm -rf /tmp/cockpit-zfs-manager* +fi + # install packages direct from github /ctx/github-release-install.sh trapexit/mergerfs "fc${RELEASE}.x86_64"