From c0f2cb46a1aece3a710a4c2730f19950a81f79c1 Mon Sep 17 00:00:00 2001 From: Lukas Ocilka Date: Thu, 20 Mar 2025 19:22:28 +0100 Subject: [PATCH 1/5] Initial version of the Agama DUD service - JSC#PED-3670 --- .../root/etc/systemd/system/agama-dud.service | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 live/root/etc/systemd/system/agama-dud.service diff --git a/live/root/etc/systemd/system/agama-dud.service b/live/root/etc/systemd/system/agama-dud.service new file mode 100644 index 0000000000..98cd4fe9f1 --- /dev/null +++ b/live/root/etc/systemd/system/agama-dud.service @@ -0,0 +1,31 @@ +[Unit] +Description=Agama DUD + +After=network-online.target + +# and after we process agama params like info which can contain password +After=agama-cmdline-process.service +# the DUD should replace wrong self_update +After=agama-self-update.service + +# before starting the Agama servers so they use the new packages +Before=agama-web-server.service +Before=agama.service +Before=x11-autologin.service +# before interactive password services +Before=live-password-dialog.service +Before=live-password-systemd.service + +[Service] +Type=oneshot +Environment=TERM=linux +ExecStartPre=dmesg --console-off +ExecStart=agama-dud +ExecStartPost=dmesg --console-on +TTYReset=yes +TTYVHangup=yes +StandardInput=tty +TimeoutStartSec=infinity + +[Install] +WantedBy=default.target From a350af2aa82115e00fa90f2f567ab9dcf73bcd1d Mon Sep 17 00:00:00 2001 From: Lukas Ocilka Date: Thu, 20 Mar 2025 19:23:42 +0100 Subject: [PATCH 2/5] Initial version of the Agama DUD script - JSC#PED-3670 --- live/root/usr/bin/agama-dud | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 live/root/usr/bin/agama-dud diff --git a/live/root/usr/bin/agama-dud b/live/root/usr/bin/agama-dud new file mode 100644 index 0000000000..f8f94241ba --- /dev/null +++ b/live/root/usr/bin/agama-dud @@ -0,0 +1,33 @@ +#!/bin/sh + +# Experimental DUD funtionality for Agama +# +# Usage: inst.dud=URI [inst.dud=URI] +# +# This is a very simple version of the DUD functionality +# - There can be multiple inst.dud=URI entries, but... +# - All of them are considered to be RPMs +# - The script does not check if downloading succeeded +# - Or for any deps of the package +# - Of whether installation/upgrade succeeded +# - Does not restart itself if the script is updated + +# check if there is any DUD +if ! grep -q "\b\(inst\|agama\)\.dud=.\+\b" /run/agama/cmdline.d/agama.conf; then + echo "No DUD present" + exit 0 +fi + +# Make sure that it does not refresh +zypper modifyrepo --disable --all + +for URI in `sed -n 's/\(.*[[:space:]]\|^\)\(inst\|agama\)\.dud=\([^[:space:]]\+\).*/\3/p' /run/agama/cmdline.d/agama.conf`; do + echo "Downloading DUD from" $URI + TMPDUD=`mktemp /tmp/agama-XXXXXXXXXX.rpm` + agama download $URI $TMPDUD; + rpm --upgrade --force --verbose --hash --noverify --nodeps --excludedocs $TMPDUD + zypper --non-interactive install $TMPDUD + rm $TMPDUD +done + +zypper modifyrepo --enable --all \ No newline at end of file From b7f054e1cfc520c9cd7893ead33b1ee32acb8e41 Mon Sep 17 00:00:00 2001 From: Lukas Ocilka Date: Thu, 20 Mar 2025 19:30:55 +0100 Subject: [PATCH 3/5] Update agama-installer.changes --- live/src/agama-installer.changes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/live/src/agama-installer.changes b/live/src/agama-installer.changes index 0aec2139a6..d13118171a 100644 --- a/live/src/agama-installer.changes +++ b/live/src/agama-installer.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Mar 20 18:26:27 UTC 2025 - Lukas Ocilka + +- Added the initial functionality for inst.dud + (jsc#3670 and jsc#AGM-65) + ------------------------------------------------------------------- Thu Mar 20 15:52:36 UTC 2025 - Knut Anderssen From 0af7910704a0c8492c5f9e19c4c0a481f42ebb0f Mon Sep 17 00:00:00 2001 From: Lukas Ocilka Date: Thu, 20 Mar 2025 21:48:51 +0100 Subject: [PATCH 4/5] Simplified agama-dud after the review - No zypper calls are actually needed --- live/root/usr/bin/agama-dud | 6 ------ 1 file changed, 6 deletions(-) diff --git a/live/root/usr/bin/agama-dud b/live/root/usr/bin/agama-dud index f8f94241ba..ac22c9a420 100644 --- a/live/root/usr/bin/agama-dud +++ b/live/root/usr/bin/agama-dud @@ -18,16 +18,10 @@ if ! grep -q "\b\(inst\|agama\)\.dud=.\+\b" /run/agama/cmdline.d/agama.conf; the exit 0 fi -# Make sure that it does not refresh -zypper modifyrepo --disable --all - for URI in `sed -n 's/\(.*[[:space:]]\|^\)\(inst\|agama\)\.dud=\([^[:space:]]\+\).*/\3/p' /run/agama/cmdline.d/agama.conf`; do echo "Downloading DUD from" $URI TMPDUD=`mktemp /tmp/agama-XXXXXXXXXX.rpm` agama download $URI $TMPDUD; rpm --upgrade --force --verbose --hash --noverify --nodeps --excludedocs $TMPDUD - zypper --non-interactive install $TMPDUD rm $TMPDUD done - -zypper modifyrepo --enable --all \ No newline at end of file From b082567ea6319c53a95040fef7a46d72d2307d30 Mon Sep 17 00:00:00 2001 From: Lukas Ocilka Date: Fri, 21 Mar 2025 10:55:21 +0100 Subject: [PATCH 5/5] Changes from the review: agama-dud.service - Let's keep the messages now, we'll see if that needs more love - Don't depend on X11 as that service is going to be removed --- live/root/etc/systemd/system/agama-dud.service | 3 --- 1 file changed, 3 deletions(-) diff --git a/live/root/etc/systemd/system/agama-dud.service b/live/root/etc/systemd/system/agama-dud.service index 98cd4fe9f1..4ac4598547 100644 --- a/live/root/etc/systemd/system/agama-dud.service +++ b/live/root/etc/systemd/system/agama-dud.service @@ -11,7 +11,6 @@ After=agama-self-update.service # before starting the Agama servers so they use the new packages Before=agama-web-server.service Before=agama.service -Before=x11-autologin.service # before interactive password services Before=live-password-dialog.service Before=live-password-systemd.service @@ -19,9 +18,7 @@ Before=live-password-systemd.service [Service] Type=oneshot Environment=TERM=linux -ExecStartPre=dmesg --console-off ExecStart=agama-dud -ExecStartPost=dmesg --console-on TTYReset=yes TTYVHangup=yes StandardInput=tty