Use udev to mount OpenQA sysext instead, re-enable

Instead of baking the mount unit into the boot dependency chain, evaluate it asynchronously with a udev rule that triggers the mount unit if and when the image is attached.
Trigger the bootstrapping service after this.
Re-enable both the bootstrapping service and the mount unit.
This commit is contained in:
Thomas Duckworth
2026-05-11 12:07:57 +10:00
parent dd840fc620
commit 5a97688e4a
4 changed files with 14 additions and 14 deletions

View File

@@ -29,7 +29,7 @@ enable vboxservice.service
enable vmtoolsd.service
# OpenQA integration
#enable run-extensions-openqa.mount
enable run-extensions-openqa.mount
# NVIDIA-specific services (shouldn't affect non-NVIDIA hardware)
enable nvidia-hibernate.service
@@ -46,7 +46,7 @@ enable kde-linux-btrfs.service
enable kde-linux-configure-firefox.path
enable kde-linux-iw-set-regdomain.path
enable kde-linux-live-setup.service
#enable kde-linux-openqa-setup.service
enable kde-linux-openqa-setup.service
enable kde-linux-powertop.service
enable kde-linux-volatile-var-lib-flatpak.service
enable kde-linux-sysupdated.socket

View File

@@ -8,16 +8,18 @@ Description=Bootstrap OpenQA Testing Environment
ConditionVirtualization=vm
ConditionPathIsMountPoint=/run/extensions/openqa
After=systemd-sysext.service
After=local-fs.target network-online.target
After=run-extensions-openqa.mount systemd-sysext.service network-online.target
Before=display-manager.service
Wants=network-online.target
[Service]
Type=oneshot
# Ensure the sysext is actually merged before we try to run the executable, otherwise it won't be found.
# In case the udev rule triggers too late.
ExecStartPre=systemd-sysext refresh
ExecStart=/usr/lib/openqa-bootstrap
RemainAfterExit=yes
TimeoutStartSec=300
[Install]
WantedBy=multi-user.target
WantedBy=run-extensions-openqa.mount

View File

@@ -10,17 +10,9 @@ Description=OpenQA Bootstrapping Sysext
# We don't want people using this to inject malware on some unwitting person's system with a pen drive.
# Hence, such dangerous things should only be allowed in a VM.
ConditionVirtualization=vm
ConditionPathExists=/dev/disk/by-label/kde-openqa-ext
DefaultDependencies=no
Before=systemd-sysext.service
After=dev-disk-by\x2dlabel-kde\x2dopenqa\x2dext.device
BindsTo=dev-disk-by\x2dlabel-kde\x2dopenqa\x2dext.device
[Mount]
What=/dev/disk/by-label/kde-openqa-ext
Where=/run/extensions/openqa
Type=erofs
Options=ro
[Install]
WantedBy=systemd-sysext.service
Options=ro,nofail

View File

@@ -0,0 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
# SPDX-FileCopyrightText: 2026 Thomas Duckworth <tduck@filotimoproject.org>
# Picks up the sysext image and triggers its mount unit if it is attached.
ACTION=="add", SUBSYSTEM=="block", ENV{ID_FS_LABEL}=="kde-openqa-ext", TAG+="systemd", ENV{SYSTEMD_WANTS}+="run-extensions-openqa.mount"