Skip to main content
Topic: A fix for SDDM (Read 572 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

A fix for SDDM

SDDM can fail grab TTY1, which it defaults to as per some systemd standard - http://0pointer.de/blog/projects/serial-console.html, and fall into restart loop that prevents switching to a different TTY. This can be overriden by a build config option SDDM_INITIAL_VT as per it's github README:
Quote
VIRTUAL TERMINALS

SDDM is assumed to start at the tty specified by the cmake variable SDDM_INITIAL_VT which is an integer and defaults to 1.

If SDDM_INITIAL_VT wasn't available, SDDM will use the next available one instead.

You can override SDDM_INITIAL_VT if you want to have a different one if, for example, you were planning on using tty1 for something else.

I rebuilt the sddm locally with makepkg with the above option set to 7. It solved the issue. Attaching my fixed PKGBUILD file to this message didn't work, so I include it in a code snipet:
Code: [Select]
# Maintainer: Felix Yan <[email protected]>
# Maintainer: Antonio Rojas <[email protected]>
# Contributor: Andrea Scarpino <[email protected]>

pkgname=sddm
pkgver=0.21.0
pkgrel=4.1
pkgdesc='QML based X11 and Wayland display manager'
arch=(x86_64)
url='https://github.com/sddm/sddm'
license=(GPL-2.0-only)
depends=(bash
         gcc-libs
         glibc
         libelogind
         libxau
         libxcb
         pam
         qt6-base
         qt6-declarative
         ttf-font
         xorg-server
         xorg-xauth)
makedepends=(extra-cmake-modules
             python-docutils
             qt5-base
             qt5-declarative
             qt5-tools
             qt6-tools)
optdepends=('qt5-declarative: for using Qt5 themes')
backup=('usr/share/sddm/scripts/Xsetup'
        'usr/share/sddm/scripts/Xstop'
        'etc/pam.d/sddm'
        'etc/pam.d/sddm-autologin'
        'etc/pam.d/sddm-greeter')
provides=(display-manager)
source=(https://github.com/$pkgname/$pkgname/archive/v$pkgver/$pkgname-$pkgver.tar.gz
        sddm.{tmpfiles,sysusers})
sha256sums=('f895de2683627e969e4849dbfbbb2b500787481ca5ba0de6d6dfdae5f1549abf'
            'db625f2a3649d6d203e1e1b187a054d5c6263cadf7edd824774d8ace52219677'
            '9fce66f325d170c61caed57816f4bc72e9591df083e89da114a3bb16b0a0e60f')

build() {
  cmake -B build -S $pkgname-$pkgver \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib/sddm \
        -DBUILD_WITH_QT6=ON \
        -DDBUS_CONFIG_DIR=/usr/share/dbus-1/system.d \
        -DDBUS_CONFIG_FILENAME=sddm_org.freedesktop.DisplayManager.conf \
        -DBUILD_MAN_PAGES=ON \
        -DUSE_ELOGIND=yes \
        -DNO_SYSTEMD=yes \
        -DUID_MAX=60513 \
-DSDDM_INITIAL_VT=7
  cmake --build build

  cmake -B build5 -S $pkgname-$pkgver \
        -DCMAKE_INSTALL_PREFIX=/usr
  cmake --build build5/src/greeter
  cmake --build build5/components
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  DESTDIR="$pkgdir" cmake --install build5/src/greeter
  DESTDIR="$pkgdir" cmake --install build5/components

  install -d "$pkgdir"/usr/lib/sddm/sddm.conf.d
  "$pkgdir"/usr/bin/sddm --example-config > "$pkgdir"/usr/lib/sddm/sddm.conf.d/default.conf

  # Don't set PATH in sddm.conf
  sed -r 's|DefaultPath=.*|DefaultPath=/usr/local/sbin:/usr/local/bin:/usr/bin|g' -i "$pkgdir"/usr/lib/sddm/sddm.conf.d/default.conf

  # Unset InputMethod https://github.com/sddm/sddm/issues/952
  sed -e "/^InputMethod/s/qtvirtualkeyboard//" -i "$pkgdir"/usr/lib/sddm/sddm.conf.d/default.conf

  install -Dm644 sddm.sysusers "$pkgdir"/usr/lib/sysusers.d/sddm.conf
  install -Dm644 sddm.tmpfiles "$pkgdir"/usr/lib/tmpfiles.d/sddm.conf
}

Re: A fix for SDDM

Reply #1
You can also just remove symlink in /etc/init.d, if you are using openrc:

Code: [Select]
rm /etc/init.d/agetty.tty1

Of course, reboot the system afterwards.

Re: A fix for SDDM

Reply #2
Thanks for the fix!

Code: [Select]
source=(https://github.com/$pkgname/$pkgname/archive/v$pkgver/$pkgname-$pkgver.tar.gz
        sddm.{tmpfiles,sysusers})
What are these extra files? I managed to get sddm running without them, and arch pkgbuild doesn't contain them either. I'd still want to understand where they come from and their purpose.


 

Re: A fix for SDDM

Reply #4
As for their purpose:
  • .sysusers creates sddm user with home directory /var/lib/sddm and adds it to the video group;
  • .tmpfile sets permissions of /var/lib/sddm to 0755 and it's ownership to sddm:sddm.
My guess is that on Arch it's handled by systemd's .service file(s).