feat: split flatpak update units into user and system (#72)
This commit is contained in:
@@ -9,6 +9,7 @@ FROM quay.io/fedora-ostree-desktops/silverblue:${FEDORA_MAJOR_VERSION}
|
||||
RUN wget https://copr.fedorainfracloud.org/coprs/ublue-os/vanilla-first-setup/repo/fedora-$(rpm -E %fedora)/ublue-os-vanilla-first-setup-fedora-$(rpm -E %fedora).repo -O /etc/yum.repos.d/_copr_ublue-os-vanilla-first-setup.repo
|
||||
|
||||
COPY etc /etc
|
||||
COPY usr /usr
|
||||
|
||||
COPY ublue-firstboot /usr/bin
|
||||
|
||||
@@ -16,7 +17,7 @@ RUN rpm-ostree override remove firefox firefox-langpacks && \
|
||||
rpm-ostree install distrobox gnome-tweaks just vte291-gtk4-devel vanilla-first-setup && \
|
||||
sed -i 's/#AutomaticUpdatePolicy.*/AutomaticUpdatePolicy=stage/' /etc/rpm-ostreed.conf && \
|
||||
systemctl enable rpm-ostreed-automatic.timer && \
|
||||
systemctl enable flatpak-automatic.timer && \
|
||||
systemctl enable flatpak-system-update.timer && \
|
||||
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_ublue-os-vanilla-first-setup.repo && \
|
||||
rm -rf \
|
||||
/tmp/* \
|
||||
|
||||
@@ -125,8 +125,18 @@ if [ "$?" != 0 ] ; then
|
||||
--text="Installing Celluloid Failed"
|
||||
exit 1
|
||||
fi
|
||||
echo "95"
|
||||
|
||||
echo "Enabling Flatpak auto update"
|
||||
/usr/bin/systemctl --user enable --now flatpak-user-update.timer
|
||||
if [ "$?" != 0 ] ; then
|
||||
zenity --error \
|
||||
--text="Setting Flatpak Autoupdate Failed"
|
||||
exit 1
|
||||
fi
|
||||
echo "100"
|
||||
|
||||
|
||||
echo "# Reticulating Final Splines"
|
||||
mkdir -p "$HOME"/.config/ublue/
|
||||
touch "$HOME"/.config/ublue/firstboot-done
|
||||
@@ -139,4 +149,4 @@ cp -n /etc/justfile "$HOME"/.justfile
|
||||
if [ "$?" != 0 ] ; then
|
||||
zenity --error \
|
||||
--text="Firstboot Configuration Error"
|
||||
fi
|
||||
fi
|
||||
|
||||
12
usr/lib/systemd/system/flatpak-system-update.service
Normal file
12
usr/lib/systemd/system/flatpak-system-update.service
Normal file
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Flatpak Automatic Update
|
||||
Documentation=man:flatpak(1)
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/flatpak --system update -y --noninteractive
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,5 +1,5 @@
|
||||
[Unit]
|
||||
Description=flatpak Automatic Update Trigger
|
||||
Description=Flatpak Automatic Update Trigger
|
||||
Documentation=man:flatpak(1)
|
||||
|
||||
[Timer]
|
||||
@@ -8,4 +8,4 @@ OnCalendar=0/6:00:00
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
WantedBy=timers.target
|
||||
@@ -1,12 +1,12 @@
|
||||
[Unit]
|
||||
Description=flatpak Automatic Update
|
||||
Description=Flatpak Automatic Update
|
||||
Documentation=man:flatpak(1)
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/flatpak update -y
|
||||
ExecStart=/usr/bin/flatpak --user update -y --noninteractive
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
11
usr/lib/systemd/user/flatpak-user-update.timer
Normal file
11
usr/lib/systemd/user/flatpak-user-update.timer
Normal file
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Flatpak Automatic Update Trigger
|
||||
Documentation=man:flatpak(1)
|
||||
|
||||
[Timer]
|
||||
OnBootSec=5m
|
||||
OnCalendar=0/6:00:00
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Reference in New Issue
Block a user