mirror of
https://github.com/KDE/kde-linux.git
synced 2026-02-14 18:02:43 -05:00
53
mkosi.extra/usr/bin/_kde-linux-live-setup
Executable file
53
mkosi.extra/usr/bin/_kde-linux-live-setup
Executable 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/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user