From 9df8fa41dcb38e07eb4f11a20f43a313c3ea9c4f Mon Sep 17 00:00:00 2001 From: Paul Brown Date: Sat, 25 Jul 2026 17:59:29 +0200 Subject: [PATCH] Add option to allow users to name extensions This tweak allows users to give names different to 'kde' to their extension and also allows them to have several different extensions running at the same time. --- mkosi.extra/usr/bin/set-up-systemd-extension | 25 +++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) mode change 100755 => 100644 mkosi.extra/usr/bin/set-up-systemd-extension diff --git a/mkosi.extra/usr/bin/set-up-systemd-extension b/mkosi.extra/usr/bin/set-up-systemd-extension old mode 100755 new mode 100644 index e2ef8f7..b1330d0 --- a/mkosi.extra/usr/bin/set-up-systemd-extension +++ b/mkosi.extra/usr/bin/set-up-systemd-extension @@ -6,16 +6,23 @@ set -e -SYSEXT_BASE_LOCATION="${HOME}/kde/usr/" +# Test to see if the user added a name for their extension. Otherwise use 'kde' +SYSEXT_NAME="kde" + +if test -n "$1"; then + SYSEXT_NAME="$1" +fi + +SYSEXT_BASE_LOCATION="${HOME}/${SYSEXT_NAME}/usr/" SYSEXT_LOCATION="${SYSEXT_BASE_LOCATION}/lib/extension-release.d/" SYSEXT_ROOT_LOCATION="/var/lib/extensions/" echo -if [ -f "${SYSEXT_LOCATION}/extension-release.kde" ]; then - echo '== Systemd system extension: already set up, skipping ==' +if [ -f "${SYSEXT_LOCATION}/extension-release.${SYSEXT_NAME}" ]; then + echo '== Systemd system extension ${SYSEXT_NAME}: already set up, skipping ==' else echo '== Systemd system extension: needs setup ==' - echo "Setting up extension at ${SYSEXT_BASE_LOCATION}..." + echo "Setting up extension ${SYSEXT_NAME} at ${SYSEXT_BASE_LOCATION}..." # Create directory to hold this system extension mkdir -p "${SYSEXT_LOCATION}" @@ -24,21 +31,21 @@ else run0 sh <