diff --git a/Containerfile b/Containerfile index dbd9d1d5e07..a95b44c7534 100644 --- a/Containerfile +++ b/Containerfile @@ -46,6 +46,7 @@ COPY etc/yum.repos.d/ /etc/yum.repos.d/ COPY packages.json /tmp/packages.json COPY build.sh /tmp/build.sh COPY image-info.sh /tmp/image-info.sh +COPY fetch-quadlets.sh /tmp/fetch-quadlets.sh # Copy ublue-update.toml to tmp first, to avoid being overwritten. COPY usr/etc/ublue-update/ublue-update.toml /tmp/ublue-update.toml @@ -77,17 +78,13 @@ RUN curl -Lo /tmp/starship.tar.gz "https://github.com/starship/starship/releases RUN wget https://copr.fedorainfracloud.org/coprs/ublue-os/staging/repo/fedora-"${FEDORA_MAJOR_VERSION}"/ublue-os-staging-fedora-"${FEDORA_MAJOR_VERSION}".repo -O /etc/yum.repos.d/ublue-os-staging-fedora-"${FEDORA_MAJOR_VERSION}".repo && \ /tmp/build.sh && \ /tmp/image-info.sh && \ + /tmp/fetch-quadlets.sh && \ pip install --prefix=/usr yafti && \ pip install --prefix=/usr topgrade && \ rpm-ostree install ublue-update && \ mkdir -p /usr/etc/flatpak/remotes.d && \ wget -q https://dl.flathub.org/repo/flathub.flatpakrepo -P /usr/etc/flatpak/remotes.d && \ cp /tmp/ublue-update.toml /usr/etc/ublue-update/ublue-update.toml && \ - mkdir -p /usr/etc/containers/systemd/users && \ - wget -q https://raw.githubusercontent.com/ublue-os/toolboxes/main/quadlets/bluefin-cli/bluefin-cli.container -P /usr/etc/containers/systemd/users && \ - printf "\n\n[Install]\nWantedBy=bluefin-cli.target" >> /usr/etc/containers/systemd/users/bluefin-cli.container && \ - sed -i '/AutoUpdate.*/ s/^#*/#/' /usr/etc/containers/systemd/users/bluefin-cli.container && \ - sed -i 's/ContainerName=bluefin/ContainerName=bluefin-cli/' /usr/etc/containers/systemd/users/bluefin-cli.container && \ if [[ "${FEDORA_MAJOR_VERSION}" -ge "39" ]]; then \ systemctl enable tuned.service \ ; fi && \ diff --git a/fetch-quadlets.sh b/fetch-quadlets.sh new file mode 100755 index 00000000000..afa414af7de --- /dev/null +++ b/fetch-quadlets.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash + +set -oue pipefail + +# Make Directory +mkdir -p /usr/etc/containers/systemd/users + +# bluefin-cli +wget --output-document="/usr/etc/containers/systemd/users/bluefin-cli.container" --quiet https://raw.githubusercontent.com/ublue-os/toolboxes/main/quadlets/bluefin-cli/bluefin-cli.container +printf "\n\n[Install]\nWantedBy=bluefin-cli.target" >> /usr/etc/containers/systemd/users/bluefin-cli.container +sed -i '/AutoUpdate.*/ s/^#*/#/' /usr/etc/containers/systemd/users/bluefin-cli.container +sed -i 's/ContainerName=bluefin/ContainerName=bluefin-cli/' /usr/etc/containers/systemd/users/bluefin-cli.container + +# bluefin-dx-cli +wget --output-document="/usr/etc/containers/systemd/users/bluefin-dx-cli.container" --quiet https://raw.githubusercontent.com/ublue-os/toolboxes/main/quadlets/bluefin-cli/bluefin-dx-cli.container +printf "\n\n[Install]\nWantedBy=bluefin-dx-cli.target" >> /usr/etc/containers/systemd/users/bluefin-cli.container +sed -i '/AutoUpdate.*/ s/^#*/#/' /usr/etc/containers/systemd/users/bluefin-dx-cli.container +sed -i 's/ContainerName=bluefin/ContainerName=bluefin-dx-cli/' /usr/etc/containers/systemd/users/bluefin-dx-cli.container + +# fedora-toolbox +wget --output-document="/usr/etc/containers/systemd/users/fedora-toolbox.container" --quiet https://raw.githubusercontent.com/ublue-os/toolboxes/main/quadlets/fedora-toolbox/fedora-distrobox-quadlet.container +printf "\n\n[Install]\nWantedBy=fedora-toolbox.target" >> /usr/etc/containers/systemd/users/fedora-toolbox.container +sed -i '/AutoUpdate.*/ s/^#*/#/' /usr/etc/containers/systemd/users/fedora-toolbox.container +sed -i 's/ContainerName=fedora-distrobox-quadlet/ContainerName=fedora-toolbox/' /usr/etc/containers/systemd/users/fedora-toolbox.container + +# ubuntu-toolbox +wget --output-document="/usr/etc/containers/systemd/users/ubuntu-toolbox.container" --quiet https://raw.githubusercontent.com/ublue-os/toolboxes/main/quadlets/ubuntu-toolbox/ubuntu-distrobox-quadlet.container +printf "\n\n[Install]\nWantedBy=ubuntu-toolbox.target" >> /usr/etc/containers/systemd/users/ubuntu-toolbox.container +sed -i '/AutoUpdate.*/ s/^#*/#/' /usr/etc/containers/systemd/users/ubuntu-toolbox.container +sed -i 's/ContainerName=ubuntu-distrobox-quadlet/ContainerName=ubuntu-toolbox/' /usr/etc/containers/systemd/users/ubuntu-toolbox.container + +# wolfi-toolbox +wget --output-document="/usr/etc/containers/systemd/users/wolfi-toolbox.container" --quiet https://raw.githubusercontent.com/ublue-os/toolboxes/main/quadlets/wolfi-toolbox/wolfi-distrobox-quadlet.container +printf "\n\n[Install]\nWantedBy=wolfi-toolbox.target" >> /usr/etc/containers/systemd/users/wolfi-toolbox.container +sed -i '/AutoUpdate.*/ s/^#*/#/' /usr/etc/containers/systemd/users/wolfi-toolbox.container +sed -i 's/ContainerName=wolfi-quadlet/ContainerName=wolfi-toolbox/' /usr/etc/containers/systemd/users/wolfi-toolbox.container + +# wolfi-dx-toolbox +wget --output-document="/usr/etc/containers/systemd/users/wolfi-dx-toolbox.container" --quiet https://raw.githubusercontent.com/ublue-os/toolboxes/main/quadlets/wolfi-toolbox/wolfi-dx-distrobox-quadlet.container +printf "\n\n[Install]\nWantedBy=wolfi-dx-toolbox.target" >> /usr/etc/containers/systemd/users/wolfi-dx-toolbox.container +sed -i '/AutoUpdate.*/ s/^#*/#/' /usr/etc/containers/systemd/users/wolfi-dx-toolbox.container +sed -i 's/ContainerName=wolfi-quadlet/ContainerName=wolfi-dx-toolbox/' /usr/etc/containers/systemd/users/wolfi-dx-toolbox.container + +# Make systemd targets and restart services for topgrade +mkdir -p /usr/lib/systemd/user +mkdir -p /usr/share/ublue-os/bluefin-cli +QUADLET_TARGETS=( + "bluefin-cli" + "bluefin-dx-cli" + "fedora-toolbox" + "ubuntu-toolbox" + "wolfi-toolbox" + "wolfi-dx-toolbox" +) +for i in "${QUADLET_TARGETS[@]}" +do +cat > "/usr/lib/systemd/user/${i}.target" < "/usr/lib/systemd/user/${i}-update.service" < "/usr/share/ublue-os/bluefin-cli/${i}.sh" <