Dont enable the sysext in the live session.

This commit is contained in:
Hadi Chokr
2026-02-25 21:36:58 +01:00
parent 695bb3d9b9
commit 98900dacff
5 changed files with 34 additions and 14 deletions

View File

@@ -33,7 +33,7 @@ else
sudo chattr +i "${SYSEXT_LOCATION}/extension-release.kde"
# Turn it on!
sudo systemd-sysext merge
sudo systemd-sysext refresh || sudo systemd-sysext merge
echo "Finished setting up extension! When you put files in ${SYSEXT_BASE_LOCATION} and run 'sudo systemd-sysext refresh', they will appear in /usr/. See https://community.kde.org/KDE_Linux/Add_or_override_content_in_/usr for more information."
fi

View File

@@ -47,6 +47,7 @@ enable kde-linux-powertop.service
enable kde-linux-volatile-var-lib-flatpak.service
enable kde-linux-sysupdated.socket
enable plasma-setup-live-system.service
enable sysext-trigger.service
# KMSCON
enable kmsconvt@

View File

@@ -0,0 +1,32 @@
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
# SPDX-FileCopyrightText: 2026 Hadi Chokr <hadichokr@icloud.com>
[Unit]
Description=Prepare sysext trigger and routing (installed system only)
DefaultDependencies=no
After=local-fs.target
Before=systemd-sysext.service
ConditionPathExists=!/live/
ConditionKernelCommandLine=!kde-linux.live=1
[Service]
Type=oneshot
# --- Ensure base dirs exist ---
ExecStart=/usr/bin/mkdir -p /var/lib/extensions
ExecStart=/usr/bin/mkdir -p /var/lib/extensions.mutable/usr
ExecStart=/usr/bin/mkdir -p /var/lib/extensions.mutable/.systemd-usr-workdir
# --- Ensure correct permissions ---
ExecStart=/usr/bin/chmod 0755 /var/lib/extensions.mutable
ExecStart=/usr/bin/chmod 0755 /var/lib/extensions.mutable/usr
ExecStart=/usr/bin/chmod 0700 /var/lib/extensions.mutable/.systemd-usr-workdir
# --- Route /usr/local → /opt/local ---
ExecStart=/usr/bin/ln -sfn /opt/local /var/lib/extensions.mutable/usr/local
# --- Trigger sysext normally ---
ExecStart=/usr/bin/touch /var/lib/extensions/auto-enable
[Install]
WantedBy=sysinit.target

View File

@@ -1,6 +0,0 @@
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
# SPDX-FileCopyrightText: 2026 Hadi Chokr <hadichokr@icloud.com>
# Will trigger the systemd-sysext.service Condition to merge Extensions
# TODO: Remove when https://github.com/systemd/systemd/issues/40827 is fixed
f /etc/extensions/enable-sysext 0644 root root -

View File

@@ -19,10 +19,3 @@ d /opt/local/src 0755 root root -
d /opt/local/etc/xdg 0755 root root -
d /opt/local/lib/pkgconfig 0755 root root -
d /opt/local/share/pkgconfig 0755 root root -
# sysext-routing
d /var/lib/extensions.mutable 0755 root root -
d /var/lib/extensions.mutable/usr 0755 root root -
# Route /usr/local → /opt/local
L /var/lib/extensions.mutable/usr/local - - - - /opt/local