From e37d2448f02667267d11d0995befbb13df5eb5f5 Mon Sep 17 00:00:00 2001 From: Benjamin Sherman Date: Thu, 9 Jan 2025 09:32:55 -0600 Subject: [PATCH] refactor: using latest install and font patch method This updates the existing PR to: 1) install on `ucore` (not `ucore-minimal`) 2) install latest release (in case we get one) 3) use font patching from 45 drives to fix missing fonts This approach is what I've been testing for months and was suggested to me by @bketelsen based on his Homer image: https://github.com/bketelsen/homer/blob/main/build_files/fetch-install.sh --- ucore/install-ucore-minimal.sh | 3 --- ucore/install-ucore.sh | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ucore/install-ucore-minimal.sh b/ucore/install-ucore-minimal.sh index adb686a..0e01470 100755 --- a/ucore/install-ucore-minimal.sh +++ b/ucore/install-ucore-minimal.sh @@ -57,9 +57,6 @@ if [[ "-zfs" == "${ZFS_TAG}" ]]; then rpm-ostree install pv /tmp/rpms/akmods-zfs/kmods/zfs/*.rpm /tmp/rpms/akmods-zfs/kmods/zfs/other/zfs-dracut-*.rpm # for some reason depmod ran automatically with zfs 2.1 but not with 2.2 depmod -a -v ${KERNEL_VERSION} - - curl -L https://github.com/45Drives/cockpit-zfs-manager/archive/refs/tags/v1.3.1.tar.gz | tar xz -C /tmp - mv /tmp/cockpit-zfs-manager-1.3.1/zfs /usr/share/cockpit fi ## CONDITIONAL: install NVIDIA diff --git a/ucore/install-ucore.sh b/ucore/install-ucore.sh index c210bb6..bb9ff96 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=$(cat /tmp/cockpit-zfs-manager-api.json | jq -r .tarball_url) + 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"