diff options
Diffstat (limited to 'system/lightdm')
-rw-r--r-- | system/lightdm/42-lightdm.rules | 15 | ||||
-rw-r--r-- | system/lightdm/README | 16 | ||||
-rw-r--r-- | system/lightdm/default-config.patch | 30 | ||||
-rw-r--r-- | system/lightdm/lightdm.SlackBuild | 164 | ||||
-rw-r--r-- | system/lightdm/lightdm.info | 10 | ||||
-rw-r--r-- | system/lightdm/pam.d/lightdm | 30 | ||||
-rw-r--r-- | system/lightdm/pam.d/lightdm-autologin | 32 | ||||
-rw-r--r-- | system/lightdm/pam.d/lightdm-greeter | 19 | ||||
-rw-r--r-- | system/lightdm/slack-desc | 19 |
9 files changed, 335 insertions, 0 deletions
diff --git a/system/lightdm/42-lightdm.rules b/system/lightdm/42-lightdm.rules new file mode 100644 index 0000000000..eda155bf30 --- /dev/null +++ b/system/lightdm/42-lightdm.rules @@ -0,0 +1,15 @@ +polkit.addRule(function(action, subject) { + if (subject.user == "lightdm") { + polkit.log("action=" + action); + polkit.log("subject=" + subject); + if (action.id.indexOf("org.freedesktop.login1.") == 0) { + return polkit.Result.YES; + } + if (action.id.indexOf("org.freedesktop.consolekit.system.") == 0) { + return polkit.Result.YES; + } + if (action.id.indexOf("org.freedesktop.upower.") == 0) { + return polkit.Result.YES; + } + } +}); diff --git a/system/lightdm/README b/system/lightdm/README new file mode 100644 index 0000000000..0402df175a --- /dev/null +++ b/system/lightdm/README @@ -0,0 +1,16 @@ +LightDM is a lightweight, cross-desktop display manager. + +A "lightdm" user and group must be set up prior to running this script. +That is - please run the following commands: + groupadd -g 380 lightdm + useradd -d /var/lib/lightdm -s /bin/false -u 380 -g 380 lightdm + + +To load lightdm upon boot: + +Edit /etc/inittab. Change the default runlevel from 3 to 4. +Then, edit /etc/rc.d/rc.4 and add the following section: + +if [ -x /usr/bin/lightdm ]; then + exec /usr/bin/lightdm +fi diff --git a/system/lightdm/default-config.patch b/system/lightdm/default-config.patch new file mode 100644 index 0000000000..edd92d058d --- /dev/null +++ b/system/lightdm/default-config.patch @@ -0,0 +1,30 @@ +--- a/data/lightdm.conf ++++ b/data/lightdm.conf +@@ -22,7 +22,7 @@ + #start-default-seat=true + #greeter-user=lightdm + #minimum-display-number=0 +-#minimum-vt=7 ++minimum-vt=7 + #lock-memory=true + #user-authority-in-system-dir=false + #guest-account-script=guest-account +@@ -36,6 +36,8 @@ + #backup-logs=true + #dbus-service=true + ++sessions-directory=/usr/share/xsessions ++ + # + # Seat configuration + # +--- a/data/users.conf ++++ b/data/users.conf +@@ -9,6 +9,6 @@ + # hidden-shells = Shells that indicate a user cannot login + # + [UserList] +-minimum-uid=500 ++minimum-uid=1000 + hidden-users=nobody nobody4 noaccess + hidden-shells=/bin/false /usr/sbin/nologin /sbin/nologin diff --git a/system/lightdm/lightdm.SlackBuild b/system/lightdm/lightdm.SlackBuild new file mode 100644 index 0000000000..b687ea7313 --- /dev/null +++ b/system/lightdm/lightdm.SlackBuild @@ -0,0 +1,164 @@ +#!/bin/bash + +# Slackware build script for lightdm + +# Copyright 2025 Isaac Yu <isaacyu@protonmail.com> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# This SlackBuild is derived from the following sources: +# Frank Honolka: +# https://gitlab.com/slackernetuk/slackware-xfce-classic/-/tree/master/lightdm +# Slint (SLKBUILD originally written by George Vlahavas): +# https://slackware.uk/slint/x86_64/slint-15.0/source/lightdm/ + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=lightdm +VERSION=${VERSION:-1.32.0} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +# This SlackBuild requires a "lightdm" user and group, with UID 380 and GID 380. +# See http://slackbuilds.org/uid_gid.txt for recommended UID/GIDs +bailout() { + echo " You must have lightdm user and group:" + echo " # groupadd -g 380 lightdm" + echo " # useradd -d /var/lib/lightdm -s /bin/false -u 380 -g 380 lightdm" + exit 1 +} + +# Bail if user isn't valid on your system +if ! getent group lightdm 1>/dev/null 2>/dev/null ; then + bailout +elif ! getent passwd lightdm 1>/dev/null 2>/dev/null ; then + bailout +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.xz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +patch -p1 < $CWD/default-config.patch +sed -i s/systemd/elogind/ data/pam/* + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --libexecdir=/usr/lib${LIBDIRSUFFIX}/lightdm \ + --localstatedir=/var \ + --sbindir=/usr/bin \ + --sysconfdir=/etc \ + --disable-static \ + --disable-tests \ + --with-greeter-user=lightdm \ + --with-greeter-session=lightdm-gtk-greeter \ + --disable-liblightdm-qt5 \ + --mandir=/usr/man \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --build=$ARCH-slackware-linux + +make +make install DESTDIR=$PKG + +cp tests/src/lightdm-session $PKG/usr/bin +sed -i '1 s/sh/bash --login/' $PKG/usr/bin/lightdm-session +rm -rf $PKG/etc/init + +install -v -dm755 -o lightdm -g lightdm $PKG/var/lib/lightdm +install -v -dm755 -o lightdm -g lightdm $PKG/var/lib/lightdm-data +install -v -dm755 -o lightdm -g lightdm $PKG/var/cache/lightdm +install -v -dm770 -o lightdm -g lightdm $PKG/var/log/lightdm + +# Remove .la file +rm $PKG/usr/lib${LIBDIRSUFFIX}/liblightdm-gobject-1.la + +# Remove apparmor profiles - they only work with Ubuntu's apparmor package +# Refer to bug #494426 for more details: +# https://bugs.gentoo.org/494426 +rm -rf $PKG/etc/apparmor.d + +# PAM +cp $CWD/pam.d/* $PKG/etc/pam.d/ + +# PolicyKit +mkdir -p -m700 $PKG/usr/share/polkit-1/rules.d +chown polkitd $PKG/usr/share/polkit-1/rules.d +install -m 644 $CWD/42-lightdm.rules $PKG/usr/share/polkit-1/rules.d/42-lightdm.rules + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a COPYING.GPL3 COPYING.LGPL2 COPYING.LGPL3 NEWS README.md $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/system/lightdm/lightdm.info b/system/lightdm/lightdm.info new file mode 100644 index 0000000000..05391a40b1 --- /dev/null +++ b/system/lightdm/lightdm.info @@ -0,0 +1,10 @@ +PRGNAM="lightdm" +VERSION="1.32.0" +HOMEPAGE="https://github.com/canonical/lightdm" +DOWNLOAD="https://github.com/canonical/lightdm/releases/download/1.32.0/lightdm-1.32.0.tar.xz" +MD5SUM="e62a5da6c35f612e4d9575eda5c8d467" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Isaac Yu" +EMAIL="isaacyu@protonmail.com" diff --git a/system/lightdm/pam.d/lightdm b/system/lightdm/pam.d/lightdm new file mode 100644 index 0000000000..d1f26f4267 --- /dev/null +++ b/system/lightdm/pam.d/lightdm @@ -0,0 +1,30 @@ +#%PAM-1.0 + +# Block login if they are globally disabled +auth required pam_nologin.so + +# Load environment from /etc/environment and ~/.pam_environment +auth required pam_env.so + +# Use /etc/passwd and /etc/shadow for passwords +auth required pam_unix.so + +# Authentication support for gnome-keyring and kwallet5 +-auth optional pam_gnome_keyring.so +-auth optional pam_kwallet5.so + +# Check account is active, change password if required +account required pam_unix.so + +# Allow password to be changed +password required pam_unix.so + +# Setup session +# Support elogind (for Slackware) rather than systemd (as per lightdm's upstream default) +session required pam_unix.so +-session optional pam_elogind.so +-session optional pam_ck_connector.so nox11 + +# Auto-unlocking support for gnome-keyring and kwallet5 +-session optional pam_gnome_keyring.so auto_start +-session optional pam_kwallet5.so auto_start diff --git a/system/lightdm/pam.d/lightdm-autologin b/system/lightdm/pam.d/lightdm-autologin new file mode 100644 index 0000000000..48d0d76b1d --- /dev/null +++ b/system/lightdm/pam.d/lightdm-autologin @@ -0,0 +1,32 @@ +#%PAM-1.0 +# Block login if shell in nologin or false +auth required pam_succeed_if.so shell notin /sbin/nologin:/usr/sbin/nologin:/bin/false:/usr/bin/false + +# Block login if they are globally disabled +auth required pam_nologin.so + +# Load environment from /etc/environment and ~/.pam_environment +auth required pam_env.so + +# Allow access without authentication +auth required pam_permit.so + +# Authentication support for gnome-keyring and kwallet5 +-auth optional pam_gnome_keyring.so +-auth optional pam_kwallet5.so + +# Stop autologin if account requires action +account required pam_unix.so + +# Can't change password +password required pam_deny.so + +# Setup session +# Support elogind (for Slackware) rather than systemd (as per lightdm's upstream default) +session required pam_unix.so +-session optional pam_elogind.so +-session optional pam_ck_connector.so nox11 + +# Auto-unlocking support for gnome-keyring and kwallet5 +-session optional pam_gnome_keyring.so auto_start +-session optional pam_kwallet5.so auto_start diff --git a/system/lightdm/pam.d/lightdm-greeter b/system/lightdm/pam.d/lightdm-greeter new file mode 100644 index 0000000000..bdeede0d4b --- /dev/null +++ b/system/lightdm/pam.d/lightdm-greeter @@ -0,0 +1,19 @@ +#%PAM-1.0 + +# Load environment from /etc/environment and ~/.pam_environment +auth required pam_env.so + +# Always let the greeter start without authentication +auth required pam_permit.so + +# No action required for account management +account required pam_permit.so + +# Can't change password +password required pam_deny.so + +# Setup session +# Support elogind (for Slackware) rather than systemd (as per lightdm's upstream default) +session required pam_unix.so +-session optional pam_elogind.so +-session optional pam_ck_connector.so nox11 diff --git a/system/lightdm/slack-desc b/system/lightdm/slack-desc new file mode 100644 index 0000000000..04409da187 --- /dev/null +++ b/system/lightdm/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +lightdm: lightdm (cross-desktop display manager) +lightdm: +lightdm: lightdm is a cross-desktop display manager. +lightdm: +lightdm: +lightdm: +lightdm: +lightdm: +lightdm: +lightdm: https://github.com/canonical/lightdm +lightdm: |