From 76042d056d72b53fd363467b23a86bf69c9ed844 Mon Sep 17 00:00:00 2001 From: Lukas Ocilka Date: Mon, 26 May 2025 16:07:29 +0200 Subject: [PATCH 1/5] Simple Rescue System - Implements a rescue system by booting to the Installer Live Media image with special systemd parameters that disable booting to the graphical mode and starting Agama service - Some services are keps, such as DUD and Self-Update --- live/config-cdroot/fix_bootconfig.aarch64 | 7 +++++++ live/config-cdroot/fix_bootconfig.ppc64le | 7 +++++++ live/config-cdroot/fix_bootconfig.x86_64 | 7 +++++++ live/src/config.sh | 11 +++++++++++ 4 files changed, 32 insertions(+) diff --git a/live/config-cdroot/fix_bootconfig.aarch64 b/live/config-cdroot/fix_bootconfig.aarch64 index 68d221d7af..dfcb318a7c 100755 --- a/live/config-cdroot/fix_bootconfig.aarch64 +++ b/live/config-cdroot/fix_bootconfig.aarch64 @@ -97,6 +97,13 @@ menuentry "Check Installation Medium" --class os --unrestricted { echo Loading initrd... initrd (\$root)/boot/aarch64/loader/initrd } +menuentry "Rescue System" --class os --unrestricted { + set gfxpayload=keep + echo Loading kernel... + linux (\$root)/boot/aarch64/loader/linux \${extra_cmdline} \${isoboot} $rescue_system_boot_settings + echo Loading initrd... + initrd (\$root)/boot/aarch64/loader/initrd +} menuentry "Boot from Hard Disk" --class opensuse --class gnu-linux --class gnu --class os { exit } diff --git a/live/config-cdroot/fix_bootconfig.ppc64le b/live/config-cdroot/fix_bootconfig.ppc64le index 348c2de666..f111676aad 100755 --- a/live/config-cdroot/fix_bootconfig.ppc64le +++ b/live/config-cdroot/fix_bootconfig.ppc64le @@ -109,6 +109,13 @@ menuentry "Check Installation Medium" --class os --unrestricted { initrd /boot/ppc64le/initrd } +menuentry "Rescue System" --class os --unrestricted { + echo 'Loading kernel...' + linux /boot/ppc64le/linux $rescue_system_boot_settings + echo 'Loading initrd...' + initrd /boot/ppc64le/initrd +} + menuentry 'local' { exit } diff --git a/live/config-cdroot/fix_bootconfig.x86_64 b/live/config-cdroot/fix_bootconfig.x86_64 index f6258fb874..670f6c0222 100755 --- a/live/config-cdroot/fix_bootconfig.x86_64 +++ b/live/config-cdroot/fix_bootconfig.x86_64 @@ -97,6 +97,13 @@ menuentry "Check Installation Medium" --class os --unrestricted { echo Loading initrd... initrd (\$root)/boot/x86_64/loader/initrd } +menuentry "Rescue System" --class os --unrestricted { + set gfxpayload=keep + echo Loading kernel... + linux (\$root)/boot/x86_64/loader/linux \${extra_cmdline} \${isoboot} $rescue_system_boot_settings + echo Loading initrd... + initrd (\$root)/boot/x86_64/loader/initrd +} menuentry "Boot from Hard Disk" --class opensuse --class gnu-linux --class gnu --class os { if search --no-floppy --file /efi/boot/fallback.efi --set ; then for os in opensuse sles leap suse; do diff --git a/live/src/config.sh b/live/src/config.sh index c3fa23c6fc..65b796e7c5 100644 --- a/live/src/config.sh +++ b/live/src/config.sh @@ -97,6 +97,17 @@ arch=$(uname -m) # keep in sync with ISO Volume ID set in the fix_bootconfig script profile=$(echo "$kiwi_profiles" | tr "_" "-") label="Install-$profile-$arch" +# the simple rescue system reuses the installation live media +# but boots to the text-mode only and disables the Agama server +rescue_system_boot_settings="systemd.unit=multi-user.target +systemd.mask=agama.service +systemd.mask=agama-dbus-monitor.service +systemd.mask=agama-ssh-issue.service +systemd.mask=agama-avahi-issue.service +systemd.mask=agama-welcome-issue.service +systemd.mask=agama-url-issue.service +systemd.mask=agama-certificate-issue.service +systemd.mask=agama-certificate-wait.service" # Set the default live root except for PXE images if [[ "$kiwi_profiles" != *PXE* ]]; then From 5d5acb600ccdc3873c49065680a11c0f485370c5 Mon Sep 17 00:00:00 2001 From: Lukas Ocilka Date: Mon, 26 May 2025 16:24:57 +0200 Subject: [PATCH 2/5] Changes file entry --- 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 54eaa61afc..a184944a8b 100644 --- a/live/src/agama-installer.changes +++ b/live/src/agama-installer.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon May 26 14:22:03 UTC 2025 - Lukas Ocilka + +- Added a simple Rescue System by reusing the Installation Live + Image and disabling the Agama services + ------------------------------------------------------------------- Wed May 21 12:42:34 UTC 2025 - Knut Anderssen From 5bd1fb5a918541c81d905bf35e7b9391e2fc3aa7 Mon Sep 17 00:00:00 2001 From: Lukas Ocilka Date: Mon, 26 May 2025 16:44:42 +0200 Subject: [PATCH 3/5] Moving RESCUE_SYSTEM_BOOT_SETTINGS to the correct place --- live/config-cdroot/fix_bootconfig.aarch64 | 2 +- live/config-cdroot/fix_bootconfig.ppc64le | 2 +- live/config-cdroot/fix_bootconfig.x86_64 | 2 +- live/src/config.sh | 11 ----------- live/src/fix_bootconfig | 12 ++++++++++++ 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/live/config-cdroot/fix_bootconfig.aarch64 b/live/config-cdroot/fix_bootconfig.aarch64 index dfcb318a7c..520d9cfdb4 100755 --- a/live/config-cdroot/fix_bootconfig.aarch64 +++ b/live/config-cdroot/fix_bootconfig.aarch64 @@ -100,7 +100,7 @@ menuentry "Check Installation Medium" --class os --unrestricted { menuentry "Rescue System" --class os --unrestricted { set gfxpayload=keep echo Loading kernel... - linux (\$root)/boot/aarch64/loader/linux \${extra_cmdline} \${isoboot} $rescue_system_boot_settings + linux (\$root)/boot/aarch64/loader/linux \${extra_cmdline} \${isoboot} $RESCUE_SYSTEM_BOOT_SETTINGS echo Loading initrd... initrd (\$root)/boot/aarch64/loader/initrd } diff --git a/live/config-cdroot/fix_bootconfig.ppc64le b/live/config-cdroot/fix_bootconfig.ppc64le index f111676aad..d9254a240b 100755 --- a/live/config-cdroot/fix_bootconfig.ppc64le +++ b/live/config-cdroot/fix_bootconfig.ppc64le @@ -111,7 +111,7 @@ menuentry "Check Installation Medium" --class os --unrestricted { menuentry "Rescue System" --class os --unrestricted { echo 'Loading kernel...' - linux /boot/ppc64le/linux $rescue_system_boot_settings + linux /boot/ppc64le/linux $RESCUE_SYSTEM_BOOT_SETTINGS echo 'Loading initrd...' initrd /boot/ppc64le/initrd } diff --git a/live/config-cdroot/fix_bootconfig.x86_64 b/live/config-cdroot/fix_bootconfig.x86_64 index 670f6c0222..23956eb894 100755 --- a/live/config-cdroot/fix_bootconfig.x86_64 +++ b/live/config-cdroot/fix_bootconfig.x86_64 @@ -100,7 +100,7 @@ menuentry "Check Installation Medium" --class os --unrestricted { menuentry "Rescue System" --class os --unrestricted { set gfxpayload=keep echo Loading kernel... - linux (\$root)/boot/x86_64/loader/linux \${extra_cmdline} \${isoboot} $rescue_system_boot_settings + linux (\$root)/boot/x86_64/loader/linux \${extra_cmdline} \${isoboot} $RESCUE_SYSTEM_BOOT_SETTINGS echo Loading initrd... initrd (\$root)/boot/x86_64/loader/initrd } diff --git a/live/src/config.sh b/live/src/config.sh index 65b796e7c5..c3fa23c6fc 100644 --- a/live/src/config.sh +++ b/live/src/config.sh @@ -97,17 +97,6 @@ arch=$(uname -m) # keep in sync with ISO Volume ID set in the fix_bootconfig script profile=$(echo "$kiwi_profiles" | tr "_" "-") label="Install-$profile-$arch" -# the simple rescue system reuses the installation live media -# but boots to the text-mode only and disables the Agama server -rescue_system_boot_settings="systemd.unit=multi-user.target -systemd.mask=agama.service -systemd.mask=agama-dbus-monitor.service -systemd.mask=agama-ssh-issue.service -systemd.mask=agama-avahi-issue.service -systemd.mask=agama-welcome-issue.service -systemd.mask=agama-url-issue.service -systemd.mask=agama-certificate-issue.service -systemd.mask=agama-certificate-wait.service" # Set the default live root except for PXE images if [[ "$kiwi_profiles" != *PXE* ]]; then diff --git a/live/src/fix_bootconfig b/live/src/fix_bootconfig index d901c6974a..d2b02fd52d 100644 --- a/live/src/fix_bootconfig +++ b/live/src/fix_bootconfig @@ -59,6 +59,18 @@ profile=$(echo "$kiwi_profiles" | tr "_" "-") # keep in sync with ISO Volume ID set in the config.sh script volid="Install-\$profile-$arch" +# the simple rescue system reuses the installation live media +# but boots to the text-mode only and disables the Agama server +export RESCUE_SYSTEM_BOOT_SETTINGS="systemd.unit=multi-user.target +systemd.mask=agama.service +systemd.mask=agama-dbus-monitor.service +systemd.mask=agama-ssh-issue.service +systemd.mask=agama-avahi-issue.service +systemd.mask=agama-welcome-issue.service +systemd.mask=agama-url-issue.service +systemd.mask=agama-certificate-issue.service +systemd.mask=agama-certificate-wait.service" + [ -x $bootfix ] && $bootfix $dst rm -f $dst/fix_bootconfig.* $dst/.profile From e2718eb02ed806c705fcfeb9688a9476c50eaaec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Mon, 26 May 2025 17:44:54 +0200 Subject: [PATCH 4/5] Fixed the rescue system settings --- live/src/fix_bootconfig | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/live/src/fix_bootconfig b/live/src/fix_bootconfig index d2b02fd52d..fe081e8ea0 100644 --- a/live/src/fix_bootconfig +++ b/live/src/fix_bootconfig @@ -61,14 +61,12 @@ volid="Install-\$profile-$arch" # the simple rescue system reuses the installation live media # but boots to the text-mode only and disables the Agama server -export RESCUE_SYSTEM_BOOT_SETTINGS="systemd.unit=multi-user.target -systemd.mask=agama.service -systemd.mask=agama-dbus-monitor.service -systemd.mask=agama-ssh-issue.service -systemd.mask=agama-avahi-issue.service -systemd.mask=agama-welcome-issue.service -systemd.mask=agama-url-issue.service -systemd.mask=agama-certificate-issue.service +export RESCUE_SYSTEM_BOOT_SETTINGS="systemd.unit=multi-user.target \ +systemd.mask=agama.service systemd.mask=agama-dbus-monitor.service \ +systemd.mask=agama-ssh-issue.service systemd.mask=agama-avahi-issue.service \ +systemd.mask=agama-welcome-issue.service systemd.mask=agama-url-issue.service \ +systemd.mask=agama-certificate-issue.service \ +systemd.mask=agama-certificate-issue.path \ systemd.mask=agama-certificate-wait.service" [ -x $bootfix ] && $bootfix $dst From 27f8704a7636bc0ee31700235e2253f2dd6903dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Mon, 26 May 2025 17:54:31 +0200 Subject: [PATCH 5/5] Enable the live password service also in the rescue target --- live/live-root/etc/systemd/system/live-password.service | 1 + 1 file changed, 1 insertion(+) diff --git a/live/live-root/etc/systemd/system/live-password.service b/live/live-root/etc/systemd/system/live-password.service index dd37dfd9c8..b6131e0756 100644 --- a/live/live-root/etc/systemd/system/live-password.service +++ b/live/live-root/etc/systemd/system/live-password.service @@ -47,3 +47,4 @@ TimeoutStartSec=infinity [Install] WantedBy=multi-user.target +WantedBy=rescue.target