expand live setup a bit

Fixes #18
Fixes #2
This commit is contained in:
Harald Sitter
2024-09-21 01:32:48 +02:00
parent 84377c92f1
commit 78fe0da4dd
3 changed files with 56 additions and 5 deletions

View File

@@ -0,0 +1,53 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
# SPDX-FileCopyrightText: 2016 Jonathan Riddell <jr@jriddell.org>
# SPDX-FileCopyrightText: 2017-2021 Harald Sitter <sitter@kde.org>
set -eux
if ! grep "kdeos.live=1" /proc/cmdline; then
echo "kdeos.live=1 not in cmdline"
exit 1
fi
if [ "$(readlink --canonicalize /dev/disk/by-label/KDEOSLive)" != "$(readlink --canonicalize /dev/gpt-auto-root)" ]; then
echo "gpt-auto-root is not KDEOSLive"
exit 1
fi
cat << EOF > /etc/sddm.conf.d/live.conf
[Autologin]
User=live
Session=plasma.desktop
Relogin=true
EOF
/usr/bin/useradd --create-home live
/usr/bin/usermod --append --groups wheel live
/usr/bin/passwd --delete live
mkdir /home/live/.config/
mkdir /home/live/Desktop/
# No search indexing. Useless and eating away at already meh performance
cat << EOF > /home/live/.config/baloofilerc
[Basic Settings]
Indexing-Enabled=false
EOF
cat << EOF > /home/live/.config/plasma-welcomerc
[General]
LiveEnvironment=true
LiveInstaller=calamares
EOF
# KWallet is also useless in a live environment
cat << EOF > /home/live/.config/kwalletrc
[Wallet]
Enabled=false
EOF
cp /usr/share/applications/calamares.desktop /home/live/Desktop/
chown -R live:live /home/live/

View File

@@ -10,7 +10,7 @@ enable apparmor.service
enable systemd-oomd.service
enable bluetooth.service
enable live-user.service
enable kde-linux-live-setup.service
enable plasma-setup-live-system.service
enable kdeos-overlay.service
enable var-lib-snapd-snap.mount

View File

@@ -8,10 +8,8 @@ After=systemd-logind.service systemd-homed.service
ConditionKernelCommandLine=kdeos.live=1
[Service]
ExecStartPre=/usr/bin/useradd --create-home live
ExecStartPre=/usr/bin/usermod --append --groups wheel live
ExecStart=/usr/bin/passwd --delete live
ExecStartPost=/usr/bin/systemctl disable live-user.service
ExecStart=/usr/bin/_kde-linux-live-setup
ExecStartPost=/usr/bin/systemctl disable %n
[Install]
RequiredBy=display-manager.service